Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.
TypeScript accessibilityalternativecloudflarecloudflare-workersdesignfreefrontendopen-sourceradix-uireactremixweb-developmentwebflowwebsite-builderwebsite-developmentwebsiteswebstudio
refactor(stories): consolidate exports, add StorySection/StoryGrid everywhere, remove argTypes/args
Oleg Isonen91d213692147
diff --git a/apps/builder/app/auth/login.stories.tsx b/apps/builder/app/auth/login.stories.tsxindex 1375f51e6f..dc16f6317d 100644--- a/apps/builder/app/auth/login.stories.tsx+++ b/apps/builder/app/auth/login.stories.tsx@@ -1,6 +1,7 @@import type { JSX } from "react";import type { StoryFn } from "@storybook/react";import { createBrowserRouter, RouterProvider } from "react-router-dom";+import { StorySection } from "@webstudio-is/design-system";import { Login as LoginComponent } from "./login";export default {@@ -21,5 +22,9 @@ export const Auth: StoryFn<typeof LoginComponent> = () => {const router = createRouter(<LoginComponent isGoogleEnabled={false} isSecretLoginEnabled />);- return <RouterProvider router={router} />;+ return (+ <StorySection title="Auth">+ <RouterProvider router={router} />+ </StorySection>+ );};diff --git a/apps/builder/app/builder/features/address-bar.stories.tsx b/apps/builder/app/builder/features/address-bar.stories.tsxindex affca680e7..79dbb55dbe 100644--- a/apps/builder/app/builder/features/address-bar.stories.tsx+++ b/apps/builder/app/builder/features/address-bar.stories.tsx@@ -1,6 +1,6 @@import { useStore } from "@nanostores/react";import type { Meta, StoryFn } from "@storybook/react";-import { Text } from "@webstudio-is/design-system";+import { StorySection, Text } from "@webstudio-is/design-system";import { ToolbarButton } from "@webstudio-is/design-system";import { WebstudioIcon } from "@webstudio-is/icons";import { TopbarLayout } from "~/builder/shared/topbar-layout";@@ -62,14 +62,14 @@ const HistoryInspect = () => {};export default {- title: "Address bar",+ title: "Address Bar",component: AddressBarPopover,} satisfies Meta;export const AddressBar: StoryFn = () => {$awareness.set({ pageId: "dynamicId" });return (- <>+ <StorySection title="Address Bar"><TopbarLayoutmenu={<ToolbarButton aria-label="Menu">@@ -80,6 +80,6 @@ export const AddressBar: StoryFn = () => {/><SystemInspect /><HistoryInspect />- </>+ </StorySection>);};diff --git a/apps/builder/app/builder/features/blocking-alerts/alert.stories.tsx b/apps/builder/app/builder/features/blocking-alerts/alert.stories.tsxindex 23dc0b8c60..a7a44dd8b9 100644--- a/apps/builder/app/builder/features/blocking-alerts/alert.stories.tsx+++ b/apps/builder/app/builder/features/blocking-alerts/alert.stories.tsx@@ -1,11 +1,14 @@+import { StorySection } from "@webstudio-is/design-system";import { Alert } from "./alert";-export default { title: "Blocking alerts", component: Alert };+export default { title: "Blocking Alerts", component: Alert };export const BlockingAlerts = () => (- <Alert- message={- "Your browser window is too small. Resize your browser to at least 900px wide to continue building with Webstudio."- }- />+ <StorySection title="Blocking Alerts">+ <Alert+ message={+ "Your browser window is too small. Resize your browser to at least 900px wide to continue building with Webstudio."+ }+ />+ </StorySection>);diff --git a/apps/builder/app/builder/features/breakpoints/breakpoints-selector.stories.tsx b/apps/builder/app/builder/features/breakpoints/breakpoints-selector.stories.tsxindex 43ad9d822d..a40ec7f37e 100644--- a/apps/builder/app/builder/features/breakpoints/breakpoints-selector.stories.tsx+++ b/apps/builder/app/builder/features/breakpoints/breakpoints-selector.stories.tsx@@ -1,10 +1,15 @@+import { StorySection } from "@webstudio-is/design-system";import { BreakpointsSelector as BreakpointsSelectorComponent } from "./breakpoints-selector";export const BreakpointsSelector = () => {- return <BreakpointsSelectorComponent />;+ return (+ <StorySection title="Breakpoints Selector">+ <BreakpointsSelectorComponent />+ </StorySection>+ );};export default {- title: "Breakpoints selector",+ title: "Breakpoints Selector",component: BreakpointsSelector,};diff --git a/apps/builder/app/builder/features/builder-mode.stories.tsx b/apps/builder/app/builder/features/builder-mode.stories.tsxindex 46c4326cbd..755fa9aade 100644--- a/apps/builder/app/builder/features/builder-mode.stories.tsx+++ b/apps/builder/app/builder/features/builder-mode.stories.tsx@@ -1,4 +1,4 @@-import { Toolbar } from "@webstudio-is/design-system";+import { StorySection, Toolbar } from "@webstudio-is/design-system";import { BuilderModeDropDown } from "./builder-mode";import {$builderMode,@@ -11,7 +11,7 @@ export default {title: "Builder mode",};-export const DesignMode = () => {+export const BuilderMode = () => {$builderMode.set("design");$authPermit.set("own");$authToken.set(undefined);@@ -19,50 +19,20 @@ export const DesignMode = () => {...$userPlanFeatures.get(),allowContentMode: true,});- return (- <Toolbar>- <BuilderModeDropDown />- </Toolbar>- );-};-export const ContentMode = () => {- $builderMode.set("content");- $authPermit.set("own");- $authToken.set(undefined);- $userPlanFeatures.set({- ...$userPlanFeatures.get(),- allowContentMode: true,- });return (- <Toolbar>- <BuilderModeDropDown />- </Toolbar>- );-};+ <>+ <StorySection title="Design mode">+ <Toolbar>+ <BuilderModeDropDown />+ </Toolbar>+ </StorySection>-export const PreviewMode = () => {- $builderMode.set("preview");- $authPermit.set("own");- $authToken.set(undefined);- return (- <Toolbar>- <BuilderModeDropDown />- </Toolbar>- );-};--export const ContentModeOnly = () => {- $builderMode.set("content");- $authPermit.set("edit");- $authToken.set(undefined);- $userPlanFeatures.set({- ...$userPlanFeatures.get(),- allowContentMode: true,- });- return (- <Toolbar>- <BuilderModeDropDown />- </Toolbar>+ <StorySection title="Preview mode">+ <Toolbar>+ <BuilderModeDropDown />+ </Toolbar>+ </StorySection>+ </>);};diff --git a/apps/builder/app/builder/features/command-panel/command-panel.stories.tsx b/apps/builder/app/builder/features/command-panel/command-panel.stories.tsxindex 2313a28442..69298ddb73 100644--- a/apps/builder/app/builder/features/command-panel/command-panel.stories.tsx+++ b/apps/builder/app/builder/features/command-panel/command-panel.stories.tsx@@ -10,11 +10,12 @@ import {} from "~/shared/nano-states";import { $awareness } from "~/shared/awareness";import { registerContainers } from "~/shared/sync/sync-stores";+import { StorySection } from "@webstudio-is/design-system";import { CommandPanel as CommandPanelComponent } from "./command-panel";import { openCommandPanel } from "./command-state";const meta: Meta = {- title: "Command panel",+ title: "Command Panel",};export default meta;@@ -62,5 +63,9 @@ export const CommandPanel: StoryFn = () => {useEffect(() => {openCommandPanel();}, []);- return <CommandPanelComponent />;+ return (+ <StorySection title="Command Panel">+ <CommandPanelComponent />+ </StorySection>+ );};diff --git a/apps/builder/app/builder/features/help/help-center.stories.tsx b/apps/builder/app/builder/features/help/help-center.stories.tsxindex d1980df210..ddcaa67f8a 100644--- a/apps/builder/app/builder/features/help/help-center.stories.tsx+++ b/apps/builder/app/builder/features/help/help-center.stories.tsx@@ -1,20 +1,22 @@-import { Button, Flex } from "@webstudio-is/design-system";+import { Button, Flex, StorySection } from "@webstudio-is/design-system";import { HelpIcon } from "@webstudio-is/icons";import { HelpCenter as HelpCenterComponent } from "./help-center";export default {- title: "Builder/Help/Help center",+ title: "Builder/Help/Help Center",component: HelpCenterComponent,};export const HelpCenter = () => (- <Flex css={{ padding: 100 }}>- <HelpCenterComponent open>- <HelpCenterComponent.Trigger asChild>- <Button prefix={<HelpIcon />} color="ghost">- Help- </Button>- </HelpCenterComponent.Trigger>- </HelpCenterComponent>- </Flex>+ <StorySection title="Help Center">+ <Flex css={{ padding: 100 }}>+ <HelpCenterComponent open>+ <HelpCenterComponent.Trigger asChild>+ <Button prefix={<HelpIcon />} color="ghost">+ Help+ </Button>+ </HelpCenterComponent.Trigger>+ </HelpCenterComponent>+ </Flex>+ </StorySection>);diff --git a/apps/builder/app/builder/features/help/remote-dialog.stories.tsx b/apps/builder/app/builder/features/help/remote-dialog.stories.tsxindex 9dadaf3f45..05baf0ecef 100644--- a/apps/builder/app/builder/features/help/remote-dialog.stories.tsx+++ b/apps/builder/app/builder/features/help/remote-dialog.stories.tsx@@ -1,8 +1,9 @@+import { StorySection } from "@webstudio-is/design-system";import { $remoteDialog } from "../../shared/nano-states";import { RemoteDialog as RemoteDialogComponent } from "./remote-dialog";export default {- title: "Builder/Help/Remote dialog",+ title: "Builder/Help/Remote Dialog",component: RemoteDialogComponent,};@@ -11,4 +12,8 @@ $remoteDialog.set({url: "https://docs.webstudio.is",});-export const RemoteDialog = () => <RemoteDialogComponent />;+export const RemoteDialog = () => (+ <StorySection title="Remote Dialog">+ <RemoteDialogComponent />+ </StorySection>+);diff --git a/apps/builder/app/builder/features/keyboard-shortcuts-dialog/keyboard-shortcuts-dialog.stories.tsx b/apps/builder/app/builder/features/keyboard-shortcuts-dialog/keyboard-shortcuts-dialog.stories.tsxindex 3196a27183..0be87640ce 100644--- a/apps/builder/app/builder/features/keyboard-shortcuts-dialog/keyboard-shortcuts-dialog.stories.tsx+++ b/apps/builder/app/builder/features/keyboard-shortcuts-dialog/keyboard-shortcuts-dialog.stories.tsx@@ -1,5 +1,6 @@import type { Meta } from "@storybook/react";import { useEffect } from "react";+import { StorySection } from "@webstudio-is/design-system";import { subscribeCommands } from "~/builder/shared/commands";import {KeyboardShortcutsDialog as KeyboardShortcutsDialogComponent,@@ -15,5 +16,9 @@ export default {export const KeyboardShortcuts = () => {useEffect(openKeyboardShortcutsDialog, []);- return <KeyboardShortcutsDialogComponent />;+ return (+ <StorySection title="Keyboard Shortcuts">+ <KeyboardShortcutsDialogComponent />+ </StorySection>+ );};diff --git a/apps/builder/app/builder/features/marketplace/about.stories.tsx b/apps/builder/app/builder/features/marketplace/about.stories.tsxindex ba08909743..d4b803148a 100644--- a/apps/builder/app/builder/features/marketplace/about.stories.tsx+++ b/apps/builder/app/builder/features/marketplace/about.stories.tsx@@ -1,4 +1,9 @@-import { Dialog, DialogContent, Flex } from "@webstudio-is/design-system";+import {+ Dialog,+ DialogContent,+ Flex,+ StorySection,+} from "@webstudio-is/design-system";import { About as AboutComponent } from "./about";import type { MarketplaceOverviewItem } from "~/shared/marketplace/types";@@ -22,11 +27,13 @@ const sampleItem: MarketplaceOverviewItem = {};export const About = () => (- <Flex direction="column" gap="5" css={{ width: 320 }}>- <Dialog open>- <DialogContent>- <AboutComponent item={sampleItem} />- </DialogContent>- </Dialog>- </Flex>+ <StorySection title="About">+ <Flex direction="column" gap="5" css={{ width: 320 }}>+ <Dialog open>+ <DialogContent>+ <AboutComponent item={sampleItem} />+ </DialogContent>+ </Dialog>+ </Flex>+ </StorySection>);diff --git a/apps/builder/app/builder/features/marketplace/card.stories.tsx b/apps/builder/app/builder/features/marketplace/card.stories.tsxindex bf85d926a6..f2e6e3b2dd 100644--- a/apps/builder/app/builder/features/marketplace/card.stories.tsx+++ b/apps/builder/app/builder/features/marketplace/card.stories.tsx@@ -1,4 +1,9 @@-import { Flex, Text, IconButton } from "@webstudio-is/design-system";+import {+ Flex,+ IconButton,+ StorySection,+ Text,+} from "@webstudio-is/design-system";import { EllipsesIcon } from "@webstudio-is/icons";import { Card as CardComponent } from "./card";@@ -16,32 +21,34 @@ const placeholderImage = `data:image/svg+xml,${encodeURIComponent()}`;export const Card = () => (- <Flex direction="column" gap="3" css={{ width: 300 }}>- <Text variant="labels">Default</Text>- <CardComponent title="Section template" />+ <StorySection title="Card">+ <Flex direction="column" gap="3" css={{ width: 300 }}>+ <Text variant="labels">Default</Text>+ <CardComponent title="Section template" />- <Text variant="labels">With image</Text>- <CardComponent- title="Hero section"- image={placeholderImage}- suffix={- <IconButton>- <EllipsesIcon />- </IconButton>- }- />+ <Text variant="labels">With image</Text>+ <CardComponent+ title="Hero section"+ image={placeholderImage}+ suffix={+ <IconButton>+ <EllipsesIcon />+ </IconButton>+ }+ />- <Text variant="labels">No image (placeholder)</Text>- <CardComponent title="Untitled" image="" />+ <Text variant="labels">No image (placeholder)</Text>+ <CardComponent title="Untitled" image="" />- <Text variant="labels">Selected</Text>- <CardComponent title="Selected card" state="selected" />+ <Text variant="labels">Selected</Text>+ <CardComponent title="Selected card" state="selected" />- <Text variant="labels">Loading</Text>- <CardComponent- title="Loading card"- image={placeholderImage}- state="loading"- />- </Flex>+ <Text variant="labels">Loading</Text>+ <CardComponent+ title="Loading card"+ image={placeholderImage}+ state="loading"+ />+ </Flex>+ </StorySection>);diff --git a/apps/builder/app/builder/features/menu/menu.stories.tsx b/apps/builder/app/builder/features/menu/menu.stories.tsxindex c38cb5e5ae..5f600cd272 100644--- a/apps/builder/app/builder/features/menu/menu.stories.tsx+++ b/apps/builder/app/builder/features/menu/menu.stories.tsx@@ -1,4 +1,4 @@-import { Toolbar } from "@webstudio-is/design-system";+import { Flex, StorySection, Text, Toolbar } from "@webstudio-is/design-system";import { Menu } from "./menu";import {$authPermit,@@ -12,7 +12,7 @@ export default {title: "Menu",};-export const OwnerDesignMode = () => {+const OwnerDesignModeVariant = () => {$builderMode.set("design");$authPermit.set("own");$authToken.set(undefined);@@ -33,7 +33,7 @@ export const OwnerDesignMode = () => {);};-export const ViewerFreePlan = () => {+const ViewerFreePlanVariant = () => {$builderMode.set("content");$authPermit.set("view");$authToken.set("some-token");@@ -49,7 +49,7 @@ export const ViewerFreePlan = () => {);};-export const AdminContentMode = () => {+const AdminContentModeVariant = () => {$builderMode.set("content");$authPermit.set("admin");$authToken.set(undefined);@@ -69,3 +69,22 @@ export const AdminContentMode = () => {</Toolbar>);};++export const MenuStory = () => (+ <StorySection title="Menu">+ <Flex direction="column" gap="5">+ <Flex direction="column" gap="5">+ <Text variant="labels">Owner design mode</Text>+ <OwnerDesignModeVariant />+ </Flex>+ <Flex direction="column" gap="5">+ <Text variant="labels">Viewer free plan</Text>+ <ViewerFreePlanVariant />+ </Flex>+ <Flex direction="column" gap="5">+ <Text variant="labels">Admin content mode</Text>+ <AdminContentModeVariant />+ </Flex>+ </Flex>+ </StorySection>+);diff --git a/apps/builder/app/builder/features/pages/confirmation-dialogs.stories.tsx b/apps/builder/app/builder/features/pages/confirmation-dialogs.stories.tsxindex e710c0b73f..93d3ba526f 100644--- a/apps/builder/app/builder/features/pages/confirmation-dialogs.stories.tsx+++ b/apps/builder/app/builder/features/pages/confirmation-dialogs.stories.tsx@@ -1,3 +1,4 @@+import { StorySection } from "@webstudio-is/design-system";import {DeletePageConfirmationDialog,DeleteFolderConfirmationDialog,@@ -8,30 +9,34 @@ export default {};export const DeletePage = () => (- <DeletePageConfirmationDialog- page={{- id: "page-1",- name: "About us",- path: "/about",- title: "About Us",- rootInstanceId: "root-1",- systemDataSourceId: "ds-1",- meta: {},- }}- onClose={() => {}}- onConfirm={() => {}}- />+ <StorySection title="Delete Page">+ <DeletePageConfirmationDialog+ page={{+ id: "page-1",+ name: "About us",+ path: "/about",+ title: "About Us",+ rootInstanceId: "root-1",+ systemDataSourceId: "ds-1",+ meta: {},+ }}+ onClose={() => {}}+ onConfirm={() => {}}+ />+ </StorySection>);export const DeleteFolder = () => (- <DeleteFolderConfirmationDialog- folder={{- id: "folder-1",- name: "Marketing",- slug: "marketing",- children: [],- }}- onClose={() => {}}- onConfirm={() => {}}- />+ <StorySection title="Delete Folder">+ <DeleteFolderConfirmationDialog+ folder={{+ id: "folder-1",+ name: "Marketing",+ slug: "marketing",+ children: [],+ }}+ onClose={() => {}}+ onConfirm={() => {}}+ />+ </StorySection>);diff --git a/apps/builder/app/builder/features/pages/custom-metadata.stories.tsx b/apps/builder/app/builder/features/pages/custom-metadata.stories.tsxindex f09a122ec9..06a1c5cae3 100644--- a/apps/builder/app/builder/features/pages/custom-metadata.stories.tsx+++ b/apps/builder/app/builder/features/pages/custom-metadata.stories.tsx@@ -1,10 +1,10 @@-import { Box } from "@webstudio-is/design-system";+import { Box, StorySection } from "@webstudio-is/design-system";import { CustomMetadata as CustomMetadataComponent } from "./custom-metadata";import { useState } from "react";export default {component: CustomMetadataComponent,- title: "Pages/Custom metadata",+ title: "Pages/Custom Metadata",};export const CustomMetadata = () => {@@ -16,11 +16,13 @@ export const CustomMetadata = () => {]);return (- <Box css={{ width: 448, margin: 20 }}>- <CustomMetadataComponent- customMetas={customMetas}- onChange={setCustomMetas}- />- </Box>+ <StorySection title="Custom Metadata">+ <Box css={{ width: 448, margin: 20 }}>+ <CustomMetadataComponent+ customMetas={customMetas}+ onChange={setCustomMetas}+ />+ </Box>+ </StorySection>);};diff --git a/apps/builder/app/builder/features/pages/form.stories.tsx b/apps/builder/app/builder/features/pages/form.stories.tsxindex b76da8c1be..5f1440211c 100644--- a/apps/builder/app/builder/features/pages/form.stories.tsx+++ b/apps/builder/app/builder/features/pages/form.stories.tsx@@ -1,4 +1,10 @@-import { Button, Flex, InputField, Text } from "@webstudio-is/design-system";+import {+ Button,+ Flex,+ InputField,+ StorySection,+ Text,+} from "@webstudio-is/design-system";import { Form as FormComponent } from "./form";export default {@@ -7,13 +13,15 @@ export default {};export const Form = () => (- <Flex direction="column" gap="3" css={{ width: 300, height: 200 }}>- <FormComponent onSubmit={() => window.alert("Submitted!")}>- <Flex direction="column" gap="3" css={{ padding: 16 }}>- <Text variant="labels">Page name</Text>- <InputField defaultValue="Home" />- <Button type="submit">Save</Button>- </Flex>- </FormComponent>- </Flex>+ <StorySection title="Form">+ <Flex direction="column" gap="3" css={{ width: 300, height: 200 }}>+ <FormComponent onSubmit={() => window.alert("Submitted!")}>+ <Flex direction="column" gap="3" css={{ padding: 16 }}>+ <Text variant="labels">Page name</Text>+ <InputField defaultValue="Home" />+ <Button type="submit">Save</Button>+ </Flex>+ </FormComponent>+ </Flex>+ </StorySection>);diff --git a/apps/builder/app/builder/features/pages/image-info.stories.tsx b/apps/builder/app/builder/features/pages/image-info.stories.tsxindex b5e9cb1d8a..a175f7e3f0 100644--- a/apps/builder/app/builder/features/pages/image-info.stories.tsx+++ b/apps/builder/app/builder/features/pages/image-info.stories.tsx@@ -1,9 +1,9 @@-import { Flex, Text } from "@webstudio-is/design-system";+import { Flex, StorySection, Text } from "@webstudio-is/design-system";import { ImageInfo as ImageInfoComponent } from "./image-info";import type { ImageAsset } from "@webstudio-is/sdk";export default {- title: "Builder/Pages/Image info",+ title: "Builder/Pages/Image Info",component: ImageInfoComponent,};@@ -34,11 +34,13 @@ const squareAsset: ImageAsset = {};export const ImageInfo = () => (- <Flex direction="column" gap="5" css={{ width: 400 }}>- <Text variant="labels">Landscape image</Text>- <ImageInfoComponent asset={mockAsset} onDelete={() => {}} />+ <StorySection title="Image Info">+ <Flex direction="column" gap="5" css={{ width: 400 }}>+ <Text variant="labels">Landscape image</Text>+ <ImageInfoComponent asset={mockAsset} onDelete={() => {}} />- <Text variant="labels">Square image</Text>- <ImageInfoComponent asset={squareAsset} onDelete={() => {}} />- </Flex>+ <Text variant="labels">Square image</Text>+ <ImageInfoComponent asset={squareAsset} onDelete={() => {}} />+ </Flex>+ </StorySection>);diff --git a/apps/builder/app/builder/features/pages/page-settings.stories.tsx b/apps/builder/app/builder/features/pages/page-settings.stories.tsxindex 6b246ae0a8..e7221b45f7 100644--- a/apps/builder/app/builder/features/pages/page-settings.stories.tsx+++ b/apps/builder/app/builder/features/pages/page-settings.stories.tsx@@ -5,13 +5,14 @@ import {theme,Dialog,DialogContent,+ StorySection,} from "@webstudio-is/design-system";import { $assets, $project } from "~/shared/sync/data-stores";import { createDefaultPages } from "@webstudio-is/project-build";import { isRootFolder } from "@webstudio-is/sdk";export default {- title: "Pages/Page settings",+ title: "Pages/Page Settings",component: PageSettingsComponent,parameters: {lostpixel: {@@ -88,26 +89,28 @@ $project.set({export const PageSettings = () => {return (- <Dialog open>- <DialogContent>- <Grid- css={{- width: theme.spacing[35],- margin: "auto",- border: `1px solid ${theme.colors.borderMain}`,- boxShadow: theme.shadows.menuDropShadow,- background: theme.colors.backgroundPanel,- borderRadius: theme.borderRadius[4],- }}- >- <PageSettingsComponent- onClose={() => {}}- onDuplicate={() => {}}- onDelete={() => {}}- pageId="pageId"- />- </Grid>- </DialogContent>- </Dialog>+ <StorySection title="Page Settings">+ <Dialog open>+ <DialogContent>+ <Grid+ css={{+ width: theme.spacing[35],+ margin: "auto",+ border: `1px solid ${theme.colors.borderMain}`,+ boxShadow: theme.shadows.menuDropShadow,+ background: theme.colors.backgroundPanel,+ borderRadius: theme.borderRadius[4],+ }}+ >+ <PageSettingsComponent+ onClose={() => {}}+ onDuplicate={() => {}}+ onDelete={() => {}}+ pageId="pageId"+ />+ </Grid>+ </DialogContent>+ </Dialog>+ </StorySection>);};diff --git a/apps/builder/app/builder/features/pages/search-preview.stories.tsx b/apps/builder/app/builder/features/pages/search-preview.stories.tsxindex 4f7ffebec4..5d38dcf1e8 100644--- a/apps/builder/app/builder/features/pages/search-preview.stories.tsx+++ b/apps/builder/app/builder/features/pages/search-preview.stories.tsx@@ -1,8 +1,8 @@-import { Box } from "@webstudio-is/design-system";+import { Box, StorySection } from "@webstudio-is/design-system";import { SearchPreview as SearchPreviewComponent } from "./search-preview";export default {- title: "Pages/Search preview",+ title: "Pages/Search Preview",component: SearchPreviewComponent,};@@ -15,13 +15,15 @@ const faviconDataUrl = `data:image/svg+xml,${encodeURIComponent()}`;export const SearchPreview = () => (- <Box css={{ width: 600, margin: 20 }}>- <SearchPreviewComponent- pageUrl="https://webstudio.is/blog-webstudios-architecture-an-overview"- titleLink="Blog: Webstudio's Architecture - an overview"- siteName="Webstudio"- faviconUrl={faviconDataUrl}- snippet="This is an introduction for developers who want to contribute to Webstudio Core. However, it may also be an interesting read for ambitious designers who want to better understand the future of Webstudio and Visual Development."- />- </Box>+ <StorySection title="Search Preview">+ <Box css={{ width: 600, margin: 20 }}>+ <SearchPreviewComponent+ pageUrl="https://webstudio.is/blog-webstudios-architecture-an-overview"+ titleLink="Blog: Webstudio's Architecture - an overview"+ siteName="Webstudio"+ faviconUrl={faviconDataUrl}+ snippet="This is an introduction for developers who want to contribute to Webstudio Core. However, it may also be an interesting read for ambitious designers who want to better understand the future of Webstudio and Visual Development."+ />+ </Box>+ </StorySection>);diff --git a/apps/builder/app/builder/features/pages/social-preview.stories.tsx b/apps/builder/app/builder/features/pages/social-preview.stories.tsxindex 331e5de883..d95674d7f4 100644--- a/apps/builder/app/builder/features/pages/social-preview.stories.tsx+++ b/apps/builder/app/builder/features/pages/social-preview.stories.tsx@@ -1,4 +1,4 @@-import { Flex } from "@webstudio-is/design-system";+import { Flex, StorySection } from "@webstudio-is/design-system";import { SocialPreview as SocialPreviewComponent } from "./social-preview";const placeholderImage = `data:image/svg+xml,${encodeURIComponent(@@ -10,27 +10,29 @@ const placeholderImage = `data:image/svg+xml,${encodeURIComponent()}`;export default {- title: "Pages/Social preview",+ title: "Pages/Social Preview",component: SocialPreviewComponent,};export const SocialPreview = () => (- <Flex direction="column" gap="5" css={{ width: 600, margin: 20 }}>- <SocialPreviewComponent- ogImageUrl={placeholderImage}- ogUrl="https://webstudio.is/blog/architecture-overview"- ogTitle="Webstudio's Architecture - An Overview"- ogDescription="This is an introduction for developers who want to contribute to Webstudio Core."- />- <SocialPreviewComponent- ogUrl="https://webstudio.is/about"- ogTitle="About Webstudio"- ogDescription="A visual development platform for building professional websites without code."- />- <SocialPreviewComponent- ogUrl="https://webstudio.is/blog/very-long-url-path/that-should-be-truncated/at-some-point-because-its-too-long"- ogTitle="This Is a Very Long Title That Should Be Truncated After a Certain Number of Characters to Prevent Layout Issues"- ogDescription="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."- />- </Flex>+ <StorySection title="Social Preview">+ <Flex direction="column" gap="5" css={{ width: 600, margin: 20 }}>+ <SocialPreviewComponent+ ogImageUrl={placeholderImage}+ ogUrl="https://webstudio.is/blog/architecture-overview"+ ogTitle="Webstudio's Architecture - An Overview"+ ogDescription="This is an introduction for developers who want to contribute to Webstudio Core."+ />+ <SocialPreviewComponent+ ogUrl="https://webstudio.is/about"+ ogTitle="About Webstudio"+ ogDescription="A visual development platform for building professional websites without code."+ />+ <SocialPreviewComponent+ ogUrl="https://webstudio.is/blog/very-long-url-path/that-should-be-truncated/at-some-point-because-its-too-long"+ ogTitle="This Is a Very Long Title That Should Be Truncated After a Certain Number of Characters to Prevent Layout Issues"+ ogDescription="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."+ />+ </Flex>+ </StorySection>);diff --git a/apps/builder/app/builder/features/publish/collapsible-domain-section.stories.tsx b/apps/builder/app/builder/features/publish/collapsible-domain-section.stories.tsxindex b1fc4120c6..3fbd20bf83 100644--- a/apps/builder/app/builder/features/publish/collapsible-domain-section.stories.tsx+++ b/apps/builder/app/builder/features/publish/collapsible-domain-section.stories.tsx@@ -18,14 +18,12 @@ import {theme,rawTheme,buttonStyle,- PopoverContent,+ Popover,PopoverTitle,- PopoverClose,PopoverTitleActions,+ StorySection,} from "@webstudio-is/design-system";import {- DotIcon,- ExternalLinkIcon,CheckCircleIcon,AlertIcon,CopyIcon,@@ -76,112 +74,157 @@ const MockCheckbox = ({ checked = false }: { checked?: boolean }) => (// Story: Staging domain section (the wstd.work domain)export const StagingDomain = () => (- <Flex direction="column" gap="3" css={{ width: theme.spacing[33] }}>- <Text variant="labels">Published</Text>- <CollapsibleDomainSection- title="my-project.wstd.work"- prefix={<MockCheckbox checked />}- suffix={<DomainSuffix status="ok" />}- initiallyOpen- >- <Grid gap={2}>- <Grid flow="column" align="center" gap={2}>- <Flex align="center" gap={1} css={{ width: theme.spacing[20] }}>- <Label>Domain:</Label>- <Tooltip- content="Domain can't be renamed once published"- variant="wrapped"- >- <InfoCircleIcon- tabIndex={0}- style={{ flexShrink: 0 }}- color={rawTheme.colors.foregroundSubtle}- />- </Tooltip>- </Flex>- <InputField text="mono" value="my-project" disabled />- </Grid>- <Grid flow="column" align="center" gap={2}>- <Label css={{ width: theme.spacing[20] }}>Username:</Label>- <InputField text="mono" value="staging" readOnly />- </Grid>- <Grid flow="column" align="center" gap={2}>- <Flex align="center" gap={1} css={{ width: theme.spacing[20] }}>- <Label>Password:</Label>- <Tooltip content="Read-only password for staging" variant="wrapped">- <InfoCircleIcon- tabIndex={0}- style={{ flexShrink: 0 }}- color={rawTheme.colors.foregroundSubtle}- />- </Tooltip>- </Flex>- <InputField text="mono" value="abc123" readOnly />+ <StorySection title="Staging Domain">+ <Flex direction="column" gap="3" css={{ width: theme.spacing[33] }}>+ <Text variant="labels">Published</Text>+ <CollapsibleDomainSection+ title="my-project.wstd.work"+ prefix={<MockCheckbox checked />}+ suffix={<DomainSuffix status="ok" />}+ initiallyOpen+ >+ <Grid gap={2}>+ <Grid flow="column" align="center" gap={2}>+ <Flex align="center" gap={1} css={{ width: theme.spacing[20] }}>+ <Label>Domain:</Label>+ <Tooltip+ content="Domain can't be renamed once published"+ variant="wrapped"+ >+ <InfoCircleIcon+ tabIndex={0}+ style={{ flexShrink: 0 }}+ color={rawTheme.colors.foregroundSubtle}+ />+ </Tooltip>+ </Flex>+ <InputField text="mono" value="my-project" disabled />+ </Grid>+ <Grid flow="column" align="center" gap={2}>+ <Label css={{ width: theme.spacing[20] }}>Username:</Label>+ <InputField text="mono" value="staging" readOnly />+ </Grid>+ <Grid flow="column" align="center" gap={2}>+ <Flex align="center" gap={1} css={{ width: theme.spacing[20] }}>+ <Label>Password:</Label>+ <Tooltip+ content="Read-only password for staging"+ variant="wrapped"+ >+ <InfoCircleIcon+ tabIndex={0}+ style={{ flexShrink: 0 }}+ color={rawTheme.colors.foregroundSubtle}+ />+ </Tooltip>+ </Flex>+ <InputField text="mono" value="abc123" readOnly />+ </Grid>+ <Tooltip content="Unpublish to enable domain renaming">+ <Button color="destructive" css={{ width: "100%" }}>+ Unpublish+ </Button>+ </Tooltip></Grid>- <Tooltip content="Unpublish to enable domain renaming">- <Button color="destructive" css={{ width: "100%" }}>- Unpublish- </Button>- </Tooltip>- </Grid>- </CollapsibleDomainSection>-- <Text variant="labels">Not yet published</Text>- <CollapsibleDomainSection- title="my-project.wstd.work"- prefix={<MockCheckbox />}- suffix={<DomainSuffix status="pending" />}- initiallyOpen- >- <Grid gap={2}>- <Grid flow="column" align="center" gap={2}>- <Flex align="center" gap={1} css={{ width: theme.spacing[20] }}>- <Label>Domain:</Label>- </Flex>- <InputField text="mono" value="my-project" />+ </CollapsibleDomainSection>++ <Text variant="labels">Not yet published</Text>+ <CollapsibleDomainSection+ title="my-project.wstd.work"+ prefix={<MockCheckbox />}+ suffix={<DomainSuffix status="pending" />}+ initiallyOpen+ >+ <Grid gap={2}>+ <Grid flow="column" align="center" gap={2}>+ <Flex align="center" gap={1} css={{ width: theme.spacing[20] }}>+ <Label>Domain:</Label>+ </Flex>+ <InputField text="mono" value="my-project" />+ </Grid></Grid>- </Grid>- </CollapsibleDomainSection>-- <Text variant="labels">Domain rename error</Text>- <CollapsibleDomainSection- title="my-project.wstd.work"- prefix={<MockCheckbox />}- suffix={<DomainSuffix status="error" />}- initiallyOpen- >- <Grid gap={2}>- <Grid flow="column" align="center" gap={2}>- <Flex align="center" gap={1} css={{ width: theme.spacing[20] }}>- <Label>Domain:</Label>- </Flex>- <InputField text="mono" value="bad domain!" color="error" />- <Text color="destructive">- Domain must only contain letters, numbers, and hyphens- </Text>+ </CollapsibleDomainSection>++ <Text variant="labels">Domain rename error</Text>+ <CollapsibleDomainSection+ title="my-project.wstd.work"+ prefix={<MockCheckbox />}+ suffix={<DomainSuffix status="error" />}+ initiallyOpen+ >+ <Grid gap={2}>+ <Grid flow="column" align="center" gap={2}>+ <Flex align="center" gap={1} css={{ width: theme.spacing[20] }}>+ <Label>Domain:</Label>+ </Flex>+ <InputField text="mono" value="bad domain!" color="error" />+ <Text color="destructive">+ Domain must only contain letters, numbers, and hyphens+ </Text>+ </Grid></Grid>- </Grid>- </CollapsibleDomainSection>- </Flex>+ </CollapsibleDomainSection>+ </Flex>+ </StorySection>);// Story: Custom domain statesexport const CustomDomains = () => (- <Flex direction="column" gap="3" css={{ width: theme.spacing[33] }}>- <Text variant="labels">Verified and active</Text>- <CollapsibleDomainSection- title="example.com"- prefix={<MockCheckbox checked />}- suffix={<DomainSuffix status="ok" />}- initiallyOpen- >- <Grid gap={2}>- <Flex align="center" gap={1}>- <CheckCircleIcon color={rawTheme.colors.foregroundSuccessText} />- <Text>Published 2 hours ago</Text>- </Flex>- <Grid gap={1}>- <Text variant="labels">DNS records</Text>+ <StorySection title="Custom Domains">+ <Flex direction="column" gap="3" css={{ width: theme.spacing[33] }}>+ <Text variant="labels">Verified and active</Text>+ <CollapsibleDomainSection+ title="example.com"+ prefix={<MockCheckbox checked />}+ suffix={<DomainSuffix status="ok" />}+ initiallyOpen+ >+ <Grid gap={2}>+ <Flex align="center" gap={1}>+ <CheckCircleIcon color={rawTheme.colors.foregroundSuccessText} />+ <Text>Published 2 hours ago</Text>+ </Flex>+ <Grid gap={1}>+ <Text variant="labels">DNS records</Text>+ <Grid+ css={{+ gridTemplateColumns: "auto 1fr 1fr",+ gap: theme.spacing[2],+ }}+ >+ <Text variant="mono" color="subtle">+ CNAME+ </Text>+ <Text variant="mono">www</Text>+ <Text variant="mono">cname.wstd.work</Text>+ <Text variant="mono" color="subtle">+ TXT+ </Text>+ <Text variant="mono">@</Text>+ <Text variant="mono">webstudio-verify=abc123</Text>+ </Grid>+ </Grid>+ <Grid flow="column" gap={2}>+ <Button color="neutral">Verify DNS</Button>+ <Button color="destructive">Remove</Button>+ </Grid>+ </Grid>+ </CollapsibleDomainSection>++ <Text variant="labels">Unverified (DNS not configured)</Text>+ <CollapsibleDomainSection+ title="new-domain.com"+ prefix={<MockCheckbox />}+ suffix={<DomainSuffix status="error" />}+ initiallyOpen+ >+ <Grid gap={2}>+ <Flex align="center" gap={1}>+ <AlertIcon color={rawTheme.colors.foregroundDestructive} />+ <Text color="destructive">+ DNS records not found. Add these records at your registrar:+ </Text>+ </Flex><Gridcss={{ gridTemplateColumns: "auto 1fr 1fr", gap: theme.spacing[2] }}>@@ -194,416 +237,395 @@ export const CustomDomains = () => (TXT</Text><Text variant="mono">@</Text>- <Text variant="mono">webstudio-verify=abc123</Text>+ <Text variant="mono">webstudio-verify=xyz789</Text>+ </Grid>+ <Grid flow="column" gap={2}>+ <Button color="neutral">Check status</Button>+ <Button color="destructive">Remove</Button></Grid></Grid>- <Grid flow="column" gap={2}>- <Button color="neutral">Verify DNS</Button>- <Button color="destructive">Remove</Button>- </Grid>- </Grid>- </CollapsibleDomainSection>-- <Text variant="labels">Unverified (DNS not configured)</Text>- <CollapsibleDomainSection- title="new-domain.com"- prefix={<MockCheckbox />}- suffix={<DomainSuffix status="error" />}- initiallyOpen- >- <Grid gap={2}>- <Flex align="center" gap={1}>- <AlertIcon color={rawTheme.colors.foregroundDestructive} />- <Text color="destructive">- DNS records not found. Add these records at your registrar:- </Text>- </Flex>- <Grid- css={{ gridTemplateColumns: "auto 1fr 1fr", gap: theme.spacing[2] }}- >- <Text variant="mono" color="subtle">- CNAME- </Text>- <Text variant="mono">www</Text>- <Text variant="mono">cname.wstd.work</Text>- <Text variant="mono" color="subtle">- TXT- </Text>- <Text variant="mono">@</Text>- <Text variant="mono">webstudio-verify=xyz789</Text>- </Grid>- <Grid flow="column" gap={2}>+ </CollapsibleDomainSection>++ <Text variant="labels">Pending (initializing)</Text>+ <CollapsibleDomainSection+ title="staging.example.com"+ prefix={<MockCheckbox />}+ suffix={<DomainSuffix status="pending" />}+ initiallyOpen+ >+ <Grid gap={2}>+ <Flex align="center" gap={1}>+ <InfoCircleIcon color={rawTheme.colors.foregroundSubtle} />+ <Text color="subtle">Setting up SSL certificate...</Text>+ </Flex><Button color="neutral">Check status</Button>- <Button color="destructive">Remove</Button></Grid>- </Grid>- </CollapsibleDomainSection>-- <Text variant="labels">Pending (initializing)</Text>- <CollapsibleDomainSection- title="staging.example.com"- prefix={<MockCheckbox />}- suffix={<DomainSuffix status="pending" />}- initiallyOpen- >- <Grid gap={2}>- <Flex align="center" gap={1}>- <InfoCircleIcon color={rawTheme.colors.foregroundSubtle} />- <Text color="subtle">Setting up SSL certificate...</Text>- </Flex>- <Button color="neutral">Check status</Button>- </Grid>- </CollapsibleDomainSection>-- <Text variant="labels">Error state</Text>- <CollapsibleDomainSection- title="broken.example.com"- prefix={<MockCheckbox />}- suffix={<DomainSuffix status="error" />}- initiallyOpen- >- <Grid gap={2}>- <Flex align="center" gap={1}>- <AlertIcon color={rawTheme.colors.foregroundDestructive} />- <Text color="destructive">- SSL provisioning failed. Please verify your DNS records and try- again.- </Text>- </Flex>- <Grid flow="column" gap={2}>- <Button color="neutral">Verify DNS</Button>- <Button color="destructive">Remove</Button>+ </CollapsibleDomainSection>++ <Text variant="labels">Error state</Text>+ <CollapsibleDomainSection+ title="broken.example.com"+ prefix={<MockCheckbox />}+ suffix={<DomainSuffix status="error" />}+ initiallyOpen+ >+ <Grid gap={2}>+ <Flex align="center" gap={1}>+ <AlertIcon color={rawTheme.colors.foregroundDestructive} />+ <Text color="destructive">+ SSL provisioning failed. Please verify your DNS records and try+ again.+ </Text>+ </Flex>+ <Grid flow="column" gap={2}>+ <Button color="neutral">Verify DNS</Button>+ <Button color="destructive">Remove</Button>+ </Grid></Grid>- </Grid>- </CollapsibleDomainSection>- </Flex>+ </CollapsibleDomainSection>+ </Flex>+ </StorySection>);// Story: Publish button statesexport const PublishButton = () => (- <Flex direction="column" gap="3" css={{ width: theme.spacing[33] }}>- <Text variant="labels">Ready to publish</Text>- <Button color="positive" css={{ width: "100%" }}>- Publish- </Button>-- <Text variant="labels">Publishing with countdown</Text>- <Button color="positive" css={{ width: "100%" }}>- Publishing (45s)- </Button>-- <Text variant="labels">Publishing (pending)</Text>- <Button color="positive" state="pending" css={{ width: "100%" }}>- Publish- </Button>-- <Text variant="labels">No domains selected</Text>- <Tooltip content="Select at least one domain to publish">- <Button color="positive" disabled css={{ width: "100%" }}>+ <StorySection title="Publish Button">+ <Flex direction="column" gap="3" css={{ width: theme.spacing[33] }}>+ <Text variant="labels">Ready to publish</Text>+ <Button color="positive" css={{ width: "100%" }}>Publish</Button>- </Tooltip>-- <Text variant="labels">Disabled (restricted features)</Text>- <Button color="positive" disabled css={{ width: "100%" }}>- Publish- </Button>- <Text variant="labels">Publish error</Text>- <Flex gap={2} shrink={false} direction="column">- <Text color="destructive">- Build timed out after 3 minutes. Please try again.- </Text>+ <Text variant="labels">Publishing with countdown</Text><Button color="positive" css={{ width: "100%" }}>+ Publishing (45s)+ </Button>++ <Text variant="labels">Publishing (pending)</Text>+ <Button color="positive" state="pending" css={{ width: "100%" }}>Publish</Button>++ <Text variant="labels">No domains selected</Text>+ <Tooltip content="Select at least one domain to publish">+ <Button color="positive" disabled css={{ width: "100%" }}>+ Publish+ </Button>+ </Tooltip>++ <Text variant="labels">Disabled (restricted features)</Text>+ <Button color="positive" disabled css={{ width: "100%" }}>+ Publish+ </Button>++ <Text variant="labels">Publish error</Text>+ <Flex gap={2} shrink={false} direction="column">+ <Text color="destructive">+ Build timed out after 3 minutes. Please try again.+ </Text>+ <Button color="positive" css={{ width: "100%" }}>+ Publish+ </Button>+ </Flex></Flex>- </Flex>+ </StorySection>);// Story: Upgrade bannersexport const UpgradeBanners = () => (- <Flex direction="column" gap="5" css={{ width: theme.spacing[33] }}>- <Text variant="labels">Publish limit exceeded</Text>- <PanelBanner>- <Text variant="regularBold">- Upgrade to publish more than 1 time per day:- </Text>- <Link- className={buttonStyle({ color: "gradient" })}- color="contrast"- underline="none"- href="#"- >- Upgrade- </Link>- </PanelBanner>-- <Text variant="labels">Restricted pro features</Text>- <PanelBanner>- <Text variant="regularBold">Following Pro features are used:</Text>- <Text as="ul" color="destructive" css={{ paddingLeft: "1em" }}>- <li>- <Flex align="center" gap="1">- <button- style={{- all: "unset",- cursor: "pointer",- textDecoration: "underline",- }}- type="button"- >- Dynamic path- </button>- </Flex>- </li>- <li>- <Flex align="center" gap="1">- Resource variable- <Tooltip- variant="wrapped"- content="Used in Blog Post page for fetching CMS data"- >- <SmallIconButton icon={<HelpIcon />} />- </Tooltip>- </Flex>- </li>- <li>Redirect</li>- <li>Custom contact email</li>- </Text>- <Text>You can delete these features or upgrade.</Text>- <Flex align="center" gap={1}>- <UpgradeIcon />- <Link color="inherit" href="#">- Upgrade to Pro- </Link>- </Flex>- </PanelBanner>-- <Text variant="labels">Domain limit reached</Text>- <PanelBanner>- <Text variant="regular">- <Text variant="regularBold" inline>- Upgrade to a Pro account- </Text>{" "}- to add unlimited domains and publish to each domain individually.- </Text>- <Flex align="center" gap={1}>- <UpgradeIcon />- <Link color="inherit" href="#">- Upgrade to Pro+ <StorySection title="Upgrade Banners">+ <Flex direction="column" gap="5" css={{ width: theme.spacing[33] }}>+ <Text variant="labels">Publish limit exceeded</Text>+ <PanelBanner>+ <Text variant="regularBold">+ Upgrade to publish more than 1 time per day:+ </Text>+ <Link+ className={buttonStyle({ color: "gradient" })}+ color="contrast"+ underline="none"+ href="#"+ >+ Upgrade</Link>- </Flex>- </PanelBanner>+ </PanelBanner>++ <Text variant="labels">Restricted pro features</Text>+ <PanelBanner>+ <Text variant="regularBold">Following Pro features are used:</Text>+ <Text as="ul" color="destructive" css={{ paddingLeft: "1em" }}>+ <li>+ <Flex align="center" gap="1">+ <button+ style={{+ all: "unset",+ cursor: "pointer",+ textDecoration: "underline",+ }}+ type="button"+ >+ Dynamic path+ </button>+ </Flex>+ </li>+ <li>+ <Flex align="center" gap="1">+ Resource variable+ <Tooltip+ variant="wrapped"+ content="Used in Blog Post page for fetching CMS data"+ >+ <SmallIconButton icon={<HelpIcon />} />+ </Tooltip>+ </Flex>+ </li>+ <li>Redirect</li>+ <li>Custom contact email</li>+ </Text>+ <Text>You can delete these features or upgrade.</Text>+ <Flex align="center" gap={1}>+ <UpgradeIcon />+ <Link color="inherit" href="#">+ Upgrade to Pro+ </Link>+ </Flex>+ </PanelBanner>++ <Text variant="labels">Domain limit reached</Text>+ <PanelBanner>+ <Text variant="regular">+ <Text variant="regularBold" inline>+ Upgrade to a Pro account+ </Text>{" "}+ to add unlimited domains and publish to each domain individually.+ </Text>+ <Flex align="center" gap={1}>+ <UpgradeIcon />+ <Link color="inherit" href="#">+ Upgrade to Pro+ </Link>+ </Flex>+ </PanelBanner>- <Text variant="labels">Unpublished domain reminder</Text>- <PanelBanner>- <Flex align="center" gap="1">- <InfoCircleIcon color={rawTheme.colors.foregroundMain} />- <Text variant="regularBold">Don't forget to publish</Text>- </Flex>- <Text>- You have a custom domain that hasn't been published yet. Hit- publish to make it live.- </Text>- </PanelBanner>- </Flex>+ <Text variant="labels">Unpublished domain reminder</Text>+ <PanelBanner>+ <Flex align="center" gap="1">+ <InfoCircleIcon color={rawTheme.colors.foregroundMain} />+ <Text variant="regularBold">Don't forget to publish</Text>+ </Flex>+ <Text>+ You have a custom domain that hasn't been published yet. Hit+ publish to make it live.+ </Text>+ </PanelBanner>+ </Flex>+ </StorySection>);// Story: Full publish dialog layoutexport const PublishDialogLayout = () => (- <Flex- direction="column"- css={{- width: theme.spacing[33],- border: `1px solid ${rawTheme.colors.borderMain}`,- borderRadius: theme.borderRadius[4],- }}- >- <PopoverTitle- suffix={- <PopoverTitleActions>- <IconButton type="button">- <GearIcon />- </IconButton>- </PopoverTitleActions>- }+ <StorySection title="Publish Dialog Layout">+ <Flex+ direction="column"+ css={{+ width: theme.spacing[33],+ border: `1px solid ${rawTheme.colors.borderMain}`,+ borderRadius: theme.borderRadius[4],+ }}>- Publish- </PopoverTitle>- <ScrollArea css={{ maxHeight: 400 }}>- <CollapsibleDomainSection- title="my-project.wstd.work"- prefix={<MockCheckbox checked />}- suffix={<DomainSuffix status="ok" />}- initiallyOpen+ <PopoverTitle+ suffix={+ <PopoverTitleActions>+ <IconButton type="button">+ <GearIcon />+ </IconButton>+ </PopoverTitleActions>+ }>- <Grid gap={2}>- <Grid flow="column" align="center" gap={2}>- <Flex align="center" gap={1} css={{ width: theme.spacing[20] }}>- <Label>Domain:</Label>- </Flex>- <InputField text="mono" value="my-project" disabled />+ Publish+ </PopoverTitle>+ <ScrollArea css={{ maxHeight: 400 }}>+ <CollapsibleDomainSection+ title="my-project.wstd.work"+ prefix={<MockCheckbox checked />}+ suffix={<DomainSuffix status="ok" />}+ initiallyOpen+ >+ <Grid gap={2}>+ <Grid flow="column" align="center" gap={2}>+ <Flex align="center" gap={1} css={{ width: theme.spacing[20] }}>+ <Label>Domain:</Label>+ </Flex>+ <InputField text="mono" value="my-project" disabled />+ </Grid>+ <Tooltip content="Unpublish to enable domain renaming">+ <Button color="destructive" css={{ width: "100%" }}>+ Unpublish+ </Button>+ </Tooltip></Grid>- <Tooltip content="Unpublish to enable domain renaming">- <Button color="destructive" css={{ width: "100%" }}>- Unpublish- </Button>- </Tooltip>- </Grid>- </CollapsibleDomainSection>+ </CollapsibleDomainSection>- <CollapsibleDomainSection- title="example.com"- prefix={<MockCheckbox checked />}- suffix={<DomainSuffix status="ok" />}- >- <Text>Verified and active</Text>- </CollapsibleDomainSection>+ <CollapsibleDomainSection+ title="example.com"+ prefix={<MockCheckbox checked />}+ suffix={<DomainSuffix status="ok" />}+ >+ <Text>Verified and active</Text>+ </CollapsibleDomainSection>- <CollapsibleDomainSection- title="blog.example.com"- prefix={<MockCheckbox />}- suffix={<DomainSuffix status="error" />}- >- <Text color="destructive">DNS not configured</Text>- </CollapsibleDomainSection>- </ScrollArea>+ <CollapsibleDomainSection+ title="blog.example.com"+ prefix={<MockCheckbox />}+ suffix={<DomainSuffix status="error" />}+ >+ <Text color="destructive">DNS not configured</Text>+ </CollapsibleDomainSection>+ </ScrollArea>- <Flex direction="column" justify="end" css={{ height: 0 }}>- <Separator />- </Flex>+ <Flex direction="column" justify="end" css={{ height: 0 }}>+ <Separator />+ </Flex>- <Flex direction="column" gap="2" css={{ padding: theme.panel.padding }}>- <Button color="positive">Publish</Button>+ <Flex direction="column" gap="2" css={{ padding: theme.panel.padding }}>+ <Button color="positive">Publish</Button>+ </Flex></Flex>- </Flex>+ </StorySection>);// Story: Export dialog layoutexport const ExportDialogLayout = () => (- <Flex- direction="column"- css={{- width: theme.spacing[33],- border: `1px solid ${rawTheme.colors.borderMain}`,- borderRadius: theme.borderRadius[4],- }}- >- <PopoverTitle>Export</PopoverTitle>- <Grid columns={1} gap={3} css={{ padding: theme.panel.padding }}>- <Grid columns={2} gap={2} align="center">- <Text color="main" variant="labels">- Destination- </Text>- <Select- fullWidth- value="docker"- options={["docker", "static", "vercel", "netlify"]}- getLabel={(v) => v.charAt(0).toUpperCase() + v.slice(1)}- onChange={() => {}}- />- </Grid>-- <Grid columns={1} gap={2}>- <Grid- gap={2}- align="center"- css={{ gridTemplateColumns: "1fr auto 1fr" }}- >- <Separator css={{ alignSelf: "unset" }} />- <Text color="main">CLI</Text>- <Separator css={{ alignSelf: "unset" }} />- </Grid>-- <Grid columns={1} gap={1}>- <Text color="main" variant="labels">- Step 1- </Text>- <Text color="subtle">- Download and install Node v20+ from nodejs.org- </Text>- </Grid>+ <StorySection title="Export Dialog Layout">+ <Popover>+ <Flex+ direction="column"+ css={{+ width: theme.spacing[33],+ border: `1px solid ${rawTheme.colors.borderMain}`,+ borderRadius: theme.borderRadius[4],+ }}+ >+ <PopoverTitle>Export</PopoverTitle>+ <Grid columns={1} gap={3} css={{ padding: theme.panel.padding }}>+ <Grid columns={2} gap={2} align="center">+ <Text color="main" variant="labels">+ Destination+ </Text>+ <Select+ fullWidth+ value="docker"+ options={["docker", "static", "vercel", "netlify"]}+ getLabel={(v) => v.charAt(0).toUpperCase() + v.slice(1)}+ onChange={() => {}}+ />+ </Grid>- <Grid columns={1} gap={1}>- <Text color="main" variant="labels">- Step 2- </Text>- <Text color="subtle">- Run this command to install Webstudio CLI and sync your project.- </Text>- </Grid>- <Flex gap={2}>- <InputField- css={{ flex: 1 }}- text="mono"- readOnly- value="npx webstudio@latest"- />- <Button type="button" color="neutral" prefix={<CopyIcon />}>- Copy- </Button>- </Flex>+ <Grid columns={1} gap={2}>+ <Grid+ gap={2}+ align="center"+ css={{ gridTemplateColumns: "1fr auto 1fr" }}+ >+ <Separator css={{ alignSelf: "unset" }} />+ <Text color="main">CLI</Text>+ <Separator css={{ alignSelf: "unset" }} />+ </Grid>++ <Grid columns={1} gap={1}>+ <Text color="main" variant="labels">+ Step 1+ </Text>+ <Text color="subtle">+ Download and install Node v20+ from nodejs.org+ </Text>+ </Grid>++ <Grid columns={1} gap={1}>+ <Text color="main" variant="labels">+ Step 2+ </Text>+ <Text color="subtle">+ Run this command to install Webstudio CLI and sync your project.+ </Text>+ </Grid>+ <Flex gap={2}>+ <InputField+ css={{ flex: 1 }}+ text="mono"+ readOnly+ value="npx webstudio@latest"+ />+ <Button type="button" color="neutral" prefix={<CopyIcon />}>+ Copy+ </Button>+ </Flex>- <Grid columns={1} gap={1}>- <Text color="main" variant="labels">- Step 3- </Text>- <Text color="subtle">Run this command to publish to Docker</Text>+ <Grid columns={1} gap={1}>+ <Text color="main" variant="labels">+ Step 3+ </Text>+ <Text color="subtle">Run this command to publish to Docker</Text>+ </Grid>+ <Flex gap={2} align="end">+ <TextArea+ css={{ flex: 1 }}+ variant="mono"+ readOnly+ value={"docker build -t my-image .\ndocker run my-image"}+ />+ <Button+ type="button"+ css={{ flexShrink: 0 }}+ color="neutral"+ prefix={<CopyIcon />}+ >+ Copy+ </Button>+ </Flex>+ </Grid></Grid>- <Flex gap={2} align="end">- <TextArea- css={{ flex: 1 }}- variant="mono"- readOnly- value={"docker build -t my-image .\ndocker run my-image"}- />- <Button- type="button"- css={{ flexShrink: 0 }}- color="neutral"- prefix={<CopyIcon />}- >- Copy- </Button>- </Flex>- </Grid>- </Grid>- </Flex>+ </Flex>+ </Popover>+ </StorySection>);// Story: Static export variantexport const ExportStaticLayout = () => (- <Flex- direction="column"- css={{- width: theme.spacing[33],- border: `1px solid ${rawTheme.colors.borderMain}`,- borderRadius: theme.borderRadius[4],- }}- >- <PopoverTitle>Export</PopoverTitle>- <Grid columns={1} gap={3} css={{ padding: theme.panel.padding }}>- <Grid columns={2} gap={2} align="center">- <Text color="main" variant="labels">- Destination- </Text>- <Select- fullWidth- value="static"- options={["docker", "static", "vercel", "netlify"]}- getLabel={(v) => v.charAt(0).toUpperCase() + v.slice(1)}- onChange={() => {}}- />- </Grid>-- <Button color="positive">Build and download static site</Button>- <Text color="subtle">- Learn about deploying static sites{" "}- <Link variant="inherit" color="inherit" href="#">- here- </Link>- </Text>- </Grid>- </Flex>+ <StorySection title="Export Static Layout">+ <Popover>+ <Flex+ direction="column"+ css={{+ width: theme.spacing[33],+ border: `1px solid ${rawTheme.colors.borderMain}`,+ borderRadius: theme.borderRadius[4],+ }}+ >+ <PopoverTitle>Export</PopoverTitle>+ <Grid columns={1} gap={3} css={{ padding: theme.panel.padding }}>+ <Grid columns={2} gap={2} align="center">+ <Text color="main" variant="labels">+ Destination+ </Text>+ <Select+ fullWidth+ value="static"+ options={["docker", "static", "vercel", "netlify"]}+ getLabel={(v) => v.charAt(0).toUpperCase() + v.slice(1)}+ onChange={() => {}}+ />+ </Grid>++ <Button color="positive">Build and download static site</Button>+ <Text color="subtle">+ Learn about deploying static sites{" "}+ <Link variant="inherit" color="inherit" href="#">+ here+ </Link>+ </Text>+ </Grid>+ </Flex>+ </Popover>+ </StorySection>);diff --git a/apps/builder/app/builder/features/settings-panel/controls/controls.stories.tsx b/apps/builder/app/builder/features/settings-panel/controls/controls.stories.tsxindex 88ce4800c8..0155293505 100644--- a/apps/builder/app/builder/features/settings-panel/controls/controls.stories.tsx+++ b/apps/builder/app/builder/features/settings-panel/controls/controls.stories.tsx@@ -1,4 +1,4 @@-import { Flex, Text, theme } from "@webstudio-is/design-system";+import { Flex, StorySection, Text, theme } from "@webstudio-is/design-system";import { BooleanControl } from "./boolean";import { NumberControl } from "./number";import { TextControl } from "./text";@@ -34,142 +34,144 @@ const Section = ({const noop = () => {};export const Controls = () => (- <Flex- direction="column"- gap="5"- css={{ width: theme.sizes.sidebarWidth, padding: theme.spacing[5] }}- >- <Section label="Boolean">- <BooleanControl- instanceId="inst-1"- meta={{- type: "boolean",- control: "boolean",- required: false,- defaultValue: false,- }}- prop={undefined}- propName="disabled"- computedValue={false}- onChange={noop}- />- <BooleanControl- instanceId="inst-1"- meta={{- type: "boolean",- control: "boolean",- required: false,- defaultValue: true,- }}- prop={{- id: "p-1",- instanceId: "inst-1",- name: "checked",- type: "boolean",- value: true,- }}- propName="checked"- computedValue={true}- onChange={noop}- />- </Section>+ <StorySection title="Controls">+ <Flex+ direction="column"+ gap="5"+ css={{ width: theme.sizes.sidebarWidth, padding: theme.spacing[5] }}+ >+ <Section label="Boolean">+ <BooleanControl+ instanceId="inst-1"+ meta={{+ type: "boolean",+ control: "boolean",+ required: false,+ defaultValue: false,+ }}+ prop={undefined}+ propName="disabled"+ computedValue={false}+ onChange={noop}+ />+ <BooleanControl+ instanceId="inst-1"+ meta={{+ type: "boolean",+ control: "boolean",+ required: false,+ defaultValue: true,+ }}+ prop={{+ id: "p-1",+ instanceId: "inst-1",+ name: "checked",+ type: "boolean",+ value: true,+ }}+ propName="checked"+ computedValue={true}+ onChange={noop}+ />+ </Section>- <Section label="Number">- <NumberControl- instanceId="inst-1"- meta={{ type: "number", control: "number", required: false }}- prop={undefined}- propName="tabIndex"- computedValue={0}- onChange={noop}- />- <NumberControl- instanceId="inst-1"- meta={{ type: "number", control: "number", required: false }}- prop={{- id: "p-2",- instanceId: "inst-1",- name: "maxLength",- type: "number",- value: 100,- }}- propName="maxLength"- computedValue={100}- onChange={noop}- />- </Section>+ <Section label="Number">+ <NumberControl+ instanceId="inst-1"+ meta={{ type: "number", control: "number", required: false }}+ prop={undefined}+ propName="tabIndex"+ computedValue={0}+ onChange={noop}+ />+ <NumberControl+ instanceId="inst-1"+ meta={{ type: "number", control: "number", required: false }}+ prop={{+ id: "p-2",+ instanceId: "inst-1",+ name: "maxLength",+ type: "number",+ value: 100,+ }}+ propName="maxLength"+ computedValue={100}+ onChange={noop}+ />+ </Section>- <Section label="Text">- <TextControl- instanceId="inst-1"- meta={{ type: "string", control: "text", required: false, rows: 1 }}- prop={undefined}- propName="placeholder"- computedValue=""- onChange={noop}- />- <TextControl- instanceId="inst-1"- meta={{ type: "string", control: "text", required: false, rows: 3 }}- prop={{- id: "p-3",- instanceId: "inst-1",- name: "alt",- type: "string",- value: "A scenic mountain view at sunset",- }}- propName="alt"- computedValue="A scenic mountain view at sunset"- onChange={noop}- />- </Section>+ <Section label="Text">+ <TextControl+ instanceId="inst-1"+ meta={{ type: "string", control: "text", required: false, rows: 1 }}+ prop={undefined}+ propName="placeholder"+ computedValue=""+ onChange={noop}+ />+ <TextControl+ instanceId="inst-1"+ meta={{ type: "string", control: "text", required: false, rows: 3 }}+ prop={{+ id: "p-3",+ instanceId: "inst-1",+ name: "alt",+ type: "string",+ value: "A scenic mountain view at sunset",+ }}+ propName="alt"+ computedValue="A scenic mountain view at sunset"+ onChange={noop}+ />+ </Section>- <Section label="Select">- <SelectControl- instanceId="inst-1"- meta={{- type: "string",- control: "select",- required: false,- options: ["auto", "eager", "lazy"],- }}- prop={undefined}- propName="loading"- computedValue="lazy"- onChange={noop}- />- </Section>+ <Section label="Select">+ <SelectControl+ instanceId="inst-1"+ meta={{+ type: "string",+ control: "select",+ required: false,+ options: ["auto", "eager", "lazy"],+ }}+ prop={undefined}+ propName="loading"+ computedValue="lazy"+ onChange={noop}+ />+ </Section>- <Section label="Check (multi-select)">- <CheckControl- instanceId="inst-1"- meta={{- type: "string[]",- control: "check",- required: false,- options: ["nofollow", "noopener", "noreferrer"],- }}- prop={undefined}- propName="rel"- computedValue={["noopener", "noreferrer"]}- onChange={noop}- />- </Section>+ <Section label="Check (multi-select)">+ <CheckControl+ instanceId="inst-1"+ meta={{+ type: "string[]",+ control: "check",+ required: false,+ options: ["nofollow", "noopener", "noreferrer"],+ }}+ prop={undefined}+ propName="rel"+ computedValue={["noopener", "noreferrer"]}+ onChange={noop}+ />+ </Section>- <Section label="Radio">- <RadioControl- instanceId="inst-1"- meta={{- type: "string",- control: "radio",- required: false,- options: ["_self", "_blank", "_parent"],- }}- prop={undefined}- propName="target"- computedValue="_self"- onChange={noop}- />- </Section>- </Flex>+ <Section label="Radio">+ <RadioControl+ instanceId="inst-1"+ meta={{+ type: "string",+ control: "radio",+ required: false,+ options: ["_self", "_blank", "_parent"],+ }}+ prop={undefined}+ propName="target"+ computedValue="_self"+ onChange={noop}+ />+ </Section>+ </Flex>+ </StorySection>);diff --git a/apps/builder/app/builder/features/settings-panel/props-section/animation/animation-panel-content.stories.tsx b/apps/builder/app/builder/features/settings-panel/props-section/animation/animation-panel-content.stories.tsxindex 868170ba58..0b9289fb62 100644--- a/apps/builder/app/builder/features/settings-panel/props-section/animation/animation-panel-content.stories.tsx+++ b/apps/builder/app/builder/features/settings-panel/props-section/animation/animation-panel-content.stories.tsx@@ -1,17 +1,16 @@-import type { Meta, StoryObj } from "@storybook/react";import { AnimationPanelContent } from "./animation-panel-content";-import { theme } from "@webstudio-is/design-system";+import { StorySection, theme } from "@webstudio-is/design-system";import { useState } from "react";import type { ScrollAnimation, ViewAnimation } from "@webstudio-is/sdk";-const meta = {+export default {title: "Settings panel/Animation panel content",component: AnimationPanelContent,parameters: {layout: "centered",},decorators: [- (Story) => (+ (Story: React.ComponentType) => (<divstyle={{background: theme.colors.backgroundPanel,@@ -23,14 +22,44 @@ const meta = {</div>),],-} satisfies Meta<typeof AnimationPanelContent>;+};-export default meta;-type Story = StoryObj<typeof meta>;+const scrollInitialValue: ScrollAnimation = {+ name: "scroll-animation",+ timing: {+ rangeStart: ["start", { type: "unit", value: 0, unit: "%" }],+ rangeEnd: ["end", { type: "unit", value: 100, unit: "%" }],+ },+ keyframes: [+ {+ offset: 0,+ styles: {+ opacity: { type: "unit", value: 0, unit: "%" },+ color: { type: "rgb", r: 255, g: 0, b: 0, alpha: 1 },+ },+ },+ ],+};-const ScrollAnimationTemplate: Story["render"] = ({ value: initialValue }) => {- const [value, setValue] = useState(initialValue);+const viewInitialValue: ViewAnimation = {+ name: "view-animation",+ timing: {+ rangeStart: ["entry", { type: "unit", value: 0, unit: "%" }],+ rangeEnd: ["exit", { type: "unit", value: 100, unit: "%" }],+ },+ keyframes: [+ {+ offset: 0,+ styles: {+ opacity: { type: "unit", value: 0, unit: "%" },+ color: { type: "rgb", r: 255, g: 0, b: 0, alpha: 1 },+ },+ },+ ],+};+const ScrollAnimationDemo = () => {+ const [value, setValue] = useState<ScrollAnimation>(scrollInitialValue);return (<AnimationPanelContenttype="scroll"@@ -42,9 +71,8 @@ const ScrollAnimationTemplate: Story["render"] = ({ value: initialValue }) => {);};-const ViewAnimationTemplate: Story["render"] = ({ value: initialValue }) => {- const [value, setValue] = useState(initialValue);-+const ViewAnimationDemo = () => {+ const [value, setValue] = useState<ViewAnimation>(viewInitialValue);return (<AnimationPanelContenttype="view"@@ -56,50 +84,13 @@ const ViewAnimationTemplate: Story["render"] = ({ value: initialValue }) => {);};-export const ScrollAnimationStory: Story = {- render: ScrollAnimationTemplate,- args: {- type: "scroll",- value: {- name: "scroll-animation",- timing: {- rangeStart: ["start", { type: "unit", value: 0, unit: "%" }],- rangeEnd: ["end", { type: "unit", value: 100, unit: "%" }],- },- keyframes: [- {- offset: 0,- styles: {- opacity: { type: "unit", value: 0, unit: "%" },- color: { type: "rgb", r: 255, g: 0, b: 0, alpha: 1 },- },- },- ],- },- onChange: () => {},- },-};--export const ViewAnimationStory: Story = {- render: ViewAnimationTemplate,- args: {- type: "view",- value: {- name: "view-animation",- timing: {- rangeStart: ["entry", { type: "unit", value: 0, unit: "%" }],- rangeEnd: ["exit", { type: "unit", value: 100, unit: "%" }],- },- keyframes: [- {- offset: 0,- styles: {- opacity: { type: "unit", value: 0, unit: "%" },- color: { type: "rgb", r: 255, g: 0, b: 0, alpha: 1 },- },- },- ],- },- onChange: () => {},- },-};+export const AnimationPanelContentStory = () => (+ <>+ <StorySection title="Scroll animation">+ <ScrollAnimationDemo />+ </StorySection>+ <StorySection title="View animation">+ <ViewAnimationDemo />+ </StorySection>+ </>+);diff --git a/apps/builder/app/builder/features/settings-panel/props-section/props-section.stories.tsx b/apps/builder/app/builder/features/settings-panel/props-section/props-section.stories.tsxindex 94fa5adb3b..05daa18206 100644--- a/apps/builder/app/builder/features/settings-panel/props-section/props-section.stories.tsx+++ b/apps/builder/app/builder/features/settings-panel/props-section/props-section.stories.tsx@@ -1,6 +1,12 @@import { useState } from "react";import type { PropMeta, Instance, Prop, Asset, Page } from "@webstudio-is/sdk";-import { Box, Flex, textVariants, theme } from "@webstudio-is/design-system";+import {+ Box,+ Flex,+ StorySection,+ textVariants,+ theme,+} from "@webstudio-is/design-system";import { PropsSection as PropsSectionComponent } from "./props-section";import { usePropsLogic } from "./use-props-logic";import {@@ -384,32 +390,37 @@ export const PropsSection = () => {});return (- <Flex gap="3">- <Box- css={{ width: theme.sizes.sidebarWidth, border: "dashed 3px #e3e3e3" }}- >- <PropsSectionComponent- instanceId={instanceId}- propsLogic={logic}- propValues={new Map()}- component="Button"- selectedInstanceKey={instanceId}- />- </Box>- <pre style={textVariants.mono}>- {props- .map(- ({ name, value, type }) =>- `${name}: ${type} = ${JSON.stringify(value)}`- )- .join("\n")}- </pre>- </Flex>+ <StorySection title="Props Section">+ <Flex gap="3">+ <Box+ css={{+ width: theme.sizes.sidebarWidth,+ border: "dashed 3px #e3e3e3",+ }}+ >+ <PropsSectionComponent+ instanceId={instanceId}+ propsLogic={logic}+ propValues={new Map()}+ component="Button"+ selectedInstanceKey={instanceId}+ />+ </Box>+ <pre style={textVariants.mono}>+ {props+ .map(+ ({ name, value, type }) =>+ `${name}: ${type} = ${JSON.stringify(value)}`+ )+ .join("\n")}+ </pre>+ </Flex>+ </StorySection>);};export default {- title: "Settings panel/Props section",+ title: "Settings panel/Props Section",component: PropsSection,parameters: {lostpixel: {diff --git a/apps/builder/app/builder/features/settings-panel/variables-section.stories.tsx b/apps/builder/app/builder/features/settings-panel/variables-section.stories.tsxindex b61598440b..686f91628a 100644--- a/apps/builder/app/builder/features/settings-panel/variables-section.stories.tsx+++ b/apps/builder/app/builder/features/settings-panel/variables-section.stories.tsx@@ -1,5 +1,5 @@import type { Meta, StoryObj } from "@storybook/react";-import { Box, theme } from "@webstudio-is/design-system";+import { Box, StorySection, theme } from "@webstudio-is/design-system";import { createDefaultPages } from "@webstudio-is/project-build";import { $pages, $instances } from "~/shared/sync/data-stores";import { $userPlanFeatures } from "~/shared/nano-states";@@ -13,7 +13,7 @@ $userPlanFeatures.set({});export default {- title: "Variables section",+ title: "Variables Section",component: VariablesSectionComponent,} satisfies Meta;@@ -28,8 +28,10 @@ $awareness.set({ pageId: "home", instanceSelector: ["box"] });export const VariablesSection: StoryObj = {render: () => (- <Box css={{ width: theme.sizes.sidebarWidth }}>- <VariablesSectionComponent />- </Box>+ <StorySection title="Variables Section">+ <Box css={{ width: theme.sizes.sidebarWidth }}>+ <VariablesSectionComponent />+ </Box>+ </StorySection>),};diff --git a/apps/builder/app/builder/features/style-panel/sections/backdrop-filter/backdrop-filter.stories.tsx b/apps/builder/app/builder/features/style-panel/sections/backdrop-filter/backdrop-filter.stories.tsxindex d2fe42857f..a4a371dd77 100644--- a/apps/builder/app/builder/features/style-panel/sections/backdrop-filter/backdrop-filter.stories.tsx+++ b/apps/builder/app/builder/features/style-panel/sections/backdrop-filter/backdrop-filter.stories.tsx@@ -1,5 +1,11 @@import { useEffect } from "react";-import { Box, theme } from "@webstudio-is/design-system";+import {+ Box,+ Flex,+ StorySection,+ Text,+ theme,+} from "@webstudio-is/design-system";import { getStyleDeclKey, type StyleDecl } from "@webstudio-is/sdk";import {$breakpoints,@@ -92,13 +98,7 @@ const multipleBackdropFilters: StyleDecl = {},};-export const BackdropFilters = () => (- <Box css={{ width: theme.sizes.sidebarWidth }}>- <Section />- </Box>-);--export const WithBlurFilter = () => {+const WithBlurFilterVariant = () => {useEffect(() => {$styles.set(new Map([[getStyleDeclKey(blurBackdropFilter), blurBackdropFilter]])@@ -111,7 +111,7 @@ export const WithBlurFilter = () => {);};-export const WithMultipleFilters = () => {+const WithMultipleFiltersVariant = () => {useEffect(() => {$styles.set(new Map([@@ -126,7 +126,28 @@ export const WithMultipleFilters = () => {);};+export const BackdropFilters = () => (+ <StorySection title="Backdrop filters">+ <Flex direction="column" gap="5">+ <Flex direction="column" gap="5">+ <Text variant="labels">Default</Text>+ <Box css={{ width: theme.sizes.sidebarWidth }}>+ <Section />+ </Box>+ </Flex>+ <Flex direction="column" gap="5">+ <Text variant="labels">With blur filter</Text>+ <WithBlurFilterVariant />+ </Flex>+ <Flex direction="column" gap="5">+ <Text variant="labels">With multiple filters</Text>+ <WithMultipleFiltersVariant />+ </Flex>+ </Flex>+ </StorySection>+);+export default {- title: "Style panel/Backdrop filters",+ title: "Style panel/Backdrop Filters",component: Section,};diff --git a/apps/builder/app/builder/features/style-panel/sections/backgrounds/background-content.stories.tsx b/apps/builder/app/builder/features/style-panel/sections/backgrounds/background-content.stories.tsxindex 99b596d5d6..f3346b9f89 100644--- a/apps/builder/app/builder/features/style-panel/sections/backgrounds/background-content.stories.tsx+++ b/apps/builder/app/builder/features/style-panel/sections/backgrounds/background-content.stories.tsx@@ -1,6 +1,11 @@import { useEffect, useRef } from "react";import { getStyleDeclKey, type StyleDecl } from "@webstudio-is/sdk";-import { FloatingPanel } from "@webstudio-is/design-system";+import {+ FloatingPanel,+ Flex,+ StorySection,+ Text,+} from "@webstudio-is/design-system";import { createDefaultPages } from "@webstudio-is/project-build";import {$breakpoints,@@ -11,7 +16,7 @@ import {$styleSourceSelections,} from "~/shared/nano-states";import { registerContainers } from "~/shared/sync/sync-stores";-import { BackgroundContent } from "./background-content";+import { BackgroundContent as BackgroundContentPanel } from "./background-content";import { $awareness } from "~/shared/awareness";import { useComputedStyleDecl } from "../../shared/model";import { setRepeatedStyleItem } from "../../shared/repeated-style";@@ -74,7 +79,7 @@ const BackgroundStory = ({ styleValue }: { styleValue: StyleValue }) => {<FloatingPanelopentitle="Background"- content={<BackgroundContent index={0} />}+ content={<BackgroundContentPanel index={0} />}><button>Trigger</button></FloatingPanel>@@ -82,66 +87,78 @@ const BackgroundStory = ({ styleValue }: { styleValue: StyleValue }) => {);};-export const Image = () => {- const styleValue: StyleValue = { type: "keyword", value: "none" };- return <BackgroundStory styleValue={styleValue} />;-};--export const LinearGradient = () => {- const styleValue: StyleValue = {- type: "unparsed",- value:- "linear-gradient(135deg, rgba(255,126,95,1) 0%, rgba(254,180,123,1) 35%, rgba(134,168,231,1) 100%)",- };- return <BackgroundStory styleValue={styleValue} />;-};--export const ConicGradient = () => {- const styleValue: StyleValue = {- type: "unparsed",- value:- "conic-gradient(from 0deg at 50% 50%, rgba(255,126,95,1) 0deg, rgba(254,180,123,1) 120deg, rgba(134,168,231,1) 240deg, rgba(255,126,95,1) 360deg)",- };- return <BackgroundStory styleValue={styleValue} />;-};--export const RadialGradient = () => {- const styleValue: StyleValue = {- type: "unparsed",- value:- "radial-gradient(circle at 50% 50%, rgba(255,126,95,1) 0%, rgba(254,180,123,1) 50%, rgba(134,168,231,1) 100%)",- };- return <BackgroundStory styleValue={styleValue} />;-};--export const Solid = () => {- const styleValue: StyleValue = {- type: "unparsed",- value:- "linear-gradient(0deg, rgba(56,189,248,1) 0%, rgba(56,189,248,1) 100%)",- };- return <BackgroundStory styleValue={styleValue} />;-};--export const RepeatingLinearGradient = () => {- const styleValue: StyleValue = {- type: "unparsed",- value:- "repeating-linear-gradient(45deg, rgba(255,0,0,1) 0%, rgba(0,0,255,1) 10%, rgba(255,0,0,1) 20%)",- };- return <BackgroundStory styleValue={styleValue} />;-};--export const MultiStopGradient = () => {- const styleValue: StyleValue = {- type: "unparsed",- value:- "linear-gradient(90deg, rgba(255,0,0,1) 0%, rgba(255,165,0,1) 20%, rgba(255,255,0,1) 40%, rgba(0,128,0,1) 60%, rgba(0,0,255,1) 80%, rgba(128,0,128,1) 100%)",- };- return <BackgroundStory styleValue={styleValue} />;-};+export const BackgroundContent = () => (+ <StorySection title="Background content">+ <Flex direction="column" gap="5">+ <Flex direction="column" gap="5">+ <Text variant="labels">Image (none)</Text>+ <BackgroundStory styleValue={{ type: "keyword", value: "none" }} />+ </Flex>+ <Flex direction="column" gap="5">+ <Text variant="labels">Linear gradient</Text>+ <BackgroundStory+ styleValue={{+ type: "unparsed",+ value:+ "linear-gradient(135deg, rgba(255,126,95,1) 0%, rgba(254,180,123,1) 35%, rgba(134,168,231,1) 100%)",+ }}+ />+ </Flex>+ <Flex direction="column" gap="5">+ <Text variant="labels">Conic gradient</Text>+ <BackgroundStory+ styleValue={{+ type: "unparsed",+ value:+ "conic-gradient(from 0deg at 50% 50%, rgba(255,126,95,1) 0deg, rgba(254,180,123,1) 120deg, rgba(134,168,231,1) 240deg, rgba(255,126,95,1) 360deg)",+ }}+ />+ </Flex>+ <Flex direction="column" gap="5">+ <Text variant="labels">Radial gradient</Text>+ <BackgroundStory+ styleValue={{+ type: "unparsed",+ value:+ "radial-gradient(circle at 50% 50%, rgba(255,126,95,1) 0%, rgba(254,180,123,1) 50%, rgba(134,168,231,1) 100%)",+ }}+ />+ </Flex>+ <Flex direction="column" gap="5">+ <Text variant="labels">Solid</Text>+ <BackgroundStory+ styleValue={{+ type: "unparsed",+ value:+ "linear-gradient(0deg, rgba(56,189,248,1) 0%, rgba(56,189,248,1) 100%)",+ }}+ />+ </Flex>+ <Flex direction="column" gap="5">+ <Text variant="labels">Repeating linear gradient</Text>+ <BackgroundStory+ styleValue={{+ type: "unparsed",+ value:+ "repeating-linear-gradient(45deg, rgba(255,0,0,1) 0%, rgba(0,0,255,1) 10%, rgba(255,0,0,1) 20%)",+ }}+ />+ </Flex>+ <Flex direction="column" gap="5">+ <Text variant="labels">Multi-stop gradient</Text>+ <BackgroundStory+ styleValue={{+ type: "unparsed",+ value:+ "linear-gradient(90deg, rgba(255,0,0,1) 0%, rgba(255,165,0,1) 20%, rgba(255,255,0,1) 40%, rgba(0,128,0,1) 60%, rgba(0,0,255,1) 80%, rgba(128,0,128,1) 100%)",+ }}+ />+ </Flex>+ </Flex>+ </StorySection>+);export default {title: "Style panel/Backgrounds",- component: Image,+ component: BackgroundContentPanel,};diff --git a/apps/builder/app/builder/features/style-panel/sections/backgrounds/backgrounds.stories.tsx b/apps/builder/app/builder/features/style-panel/sections/backgrounds/backgrounds.stories.tsxindex 748aae11f1..18c421da5b 100644--- a/apps/builder/app/builder/features/style-panel/sections/backgrounds/backgrounds.stories.tsx+++ b/apps/builder/app/builder/features/style-panel/sections/backgrounds/backgrounds.stories.tsx@@ -1,6 +1,12 @@import { useEffect } from "react";import { getStyleDeclKey, type StyleDecl } from "@webstudio-is/sdk";-import { Box, theme } from "@webstudio-is/design-system";+import {+ Box,+ Flex,+ StorySection,+ Text,+ theme,+} from "@webstudio-is/design-system";import { registerContainers } from "~/shared/sync/sync-stores";import {$breakpoints,@@ -52,13 +58,7 @@ $awareness.set({instanceSelector: ["box"],});-export const Section = () => (- <Box css={{ width: theme.sizes.sidebarWidth }}>- <SectionComponent />- </Box>-);--export const SingleLayer = () => {+const SingleLayerVariant = () => {useEffect(() => {const singleBackground: StyleDecl = {breakpointId: "base",@@ -85,7 +85,7 @@ export const SingleLayer = () => {);};-export const EmptyBackgrounds = () => {+const EmptyBackgroundsVariant = () => {useEffect(() => {$styles.set(new Map());}, []);@@ -96,6 +96,27 @@ export const EmptyBackgrounds = () => {);};+export const Backgrounds = () => (+ <StorySection title="Backgrounds">+ <Flex direction="column" gap="5">+ <Flex direction="column" gap="5">+ <Text variant="labels">Default (multiple layers)</Text>+ <Box css={{ width: theme.sizes.sidebarWidth }}>+ <SectionComponent />+ </Box>+ </Flex>+ <Flex direction="column" gap="5">+ <Text variant="labels">Single layer</Text>+ <SingleLayerVariant />+ </Flex>+ <Flex direction="column" gap="5">+ <Text variant="labels">Empty backgrounds</Text>+ <EmptyBackgroundsVariant />+ </Flex>+ </Flex>+ </StorySection>+);+export default {title: "Style panel/Backgrounds/Section",component: SectionComponent,diff --git a/apps/builder/app/builder/features/style-panel/sections/borders/borders.stories.tsx b/apps/builder/app/builder/features/style-panel/sections/borders/borders.stories.tsxindex 13b82113e5..9daafba943 100644--- a/apps/builder/app/builder/features/style-panel/sections/borders/borders.stories.tsx+++ b/apps/builder/app/builder/features/style-panel/sections/borders/borders.stories.tsx@@ -1,5 +1,11 @@import { useEffect } from "react";-import { Box, theme } from "@webstudio-is/design-system";+import {+ Box,+ Flex,+ StorySection,+ Text,+ theme,+} from "@webstudio-is/design-system";import { getStyleDeclKey, type StyleDecl } from "@webstudio-is/sdk";import {$breakpoints,@@ -94,13 +100,7 @@ const borderRadius: StyleDecl = {value: { type: "unit", value: 8, unit: "px" },};-export const Borders = () => (- <Box css={{ width: theme.sizes.sidebarWidth }}>- <Section />- </Box>-);--export const WithSolidBorder = () => {+const WithSolidBorderVariant = () => {useEffect(() => {$styles.set(new Map([@@ -119,7 +119,7 @@ export const WithSolidBorder = () => {);};-export const WithMixedBorders = () => {+const WithMixedBordersVariant = () => {useEffect(() => {$styles.set(new Map([@@ -136,6 +136,27 @@ export const WithMixedBorders = () => {);};+export const Borders = () => (+ <StorySection title="Borders">+ <Flex direction="column" gap="5">+ <Flex direction="column" gap="5">+ <Text variant="labels">Default</Text>+ <Box css={{ width: theme.sizes.sidebarWidth }}>+ <Section />+ </Box>+ </Flex>+ <Flex direction="column" gap="5">+ <Text variant="labels">With solid border</Text>+ <WithSolidBorderVariant />+ </Flex>+ <Flex direction="column" gap="5">+ <Text variant="labels">With mixed borders</Text>+ <WithMixedBordersVariant />+ </Flex>+ </Flex>+ </StorySection>+);+export default {title: "Style panel/Borders",component: Section,diff --git a/apps/builder/app/builder/features/style-panel/sections/box-shadows/box-shadows.stories.tsx b/apps/builder/app/builder/features/style-panel/sections/box-shadows/box-shadows.stories.tsxindex 0635d7ae8c..a6e090e3f4 100644--- a/apps/builder/app/builder/features/style-panel/sections/box-shadows/box-shadows.stories.tsx+++ b/apps/builder/app/builder/features/style-panel/sections/box-shadows/box-shadows.stories.tsx@@ -1,5 +1,11 @@import { useEffect } from "react";-import { Box, theme } from "@webstudio-is/design-system";+import {+ Box,+ Flex,+ StorySection,+ Text,+ theme,+} from "@webstudio-is/design-system";import { getStyleDeclKey, type StyleDecl } from "@webstudio-is/sdk";import {$breakpoints,@@ -124,13 +130,7 @@ const multipleShadows: StyleDecl = {},};-export const BoxShadows = () => (- <Box css={{ width: theme.sizes.sidebarWidth }}>- <Section />- </Box>-);--export const WithOuterShadow = () => {+const WithOuterShadowVariant = () => {useEffect(() => {$styles.set(new Map([[getStyleDeclKey(outerShadow), outerShadow]]));}, []);@@ -141,7 +141,7 @@ export const WithOuterShadow = () => {);};-export const WithInsetShadow = () => {+const WithInsetShadowVariant = () => {useEffect(() => {$styles.set(new Map([[getStyleDeclKey(insetShadow), insetShadow]]));}, []);@@ -152,7 +152,7 @@ export const WithInsetShadow = () => {);};-export const WithMultipleShadows = () => {+const WithMultipleShadowsVariant = () => {useEffect(() => {$styles.set(new Map([[getStyleDeclKey(multipleShadows), multipleShadows]]));}, []);@@ -163,7 +163,32 @@ export const WithMultipleShadows = () => {);};+export const BoxShadows = () => (+ <StorySection title="Box Shadows">+ <Flex direction="column" gap="5">+ <Flex direction="column" gap="5">+ <Text variant="labels">Default</Text>+ <Box css={{ width: theme.sizes.sidebarWidth }}>+ <Section />+ </Box>+ </Flex>+ <Flex direction="column" gap="5">+ <Text variant="labels">With outer shadow</Text>+ <WithOuterShadowVariant />+ </Flex>+ <Flex direction="column" gap="5">+ <Text variant="labels">With inset shadow</Text>+ <WithInsetShadowVariant />+ </Flex>+ <Flex direction="column" gap="5">+ <Text variant="labels">With multiple shadows</Text>+ <WithMultipleShadowsVariant />+ </Flex>+ </Flex>+ </StorySection>+);+export default {- title: "Style panel/Box shadows",+ title: "Style panel/Box Shadows",component: Section,};diff --git a/apps/builder/app/builder/features/style-panel/sections/filter/filter.stories.tsx b/apps/builder/app/builder/features/style-panel/sections/filter/filter.stories.tsxindex f92cde4a22..048245a346 100644--- a/apps/builder/app/builder/features/style-panel/sections/filter/filter.stories.tsx+++ b/apps/builder/app/builder/features/style-panel/sections/filter/filter.stories.tsx@@ -1,5 +1,11 @@import { useEffect } from "react";-import { Box, theme } from "@webstudio-is/design-system";+import {+ Box,+ Flex,+ StorySection,+ Text,+ theme,+} from "@webstudio-is/design-system";import { getStyleDeclKey, type StyleDecl } from "@webstudio-is/sdk";import {$breakpoints,@@ -92,13 +98,7 @@ const multipleFilterStyles: StyleDecl = {},};-export const Filters = () => (- <Box css={{ width: theme.sizes.sidebarWidth }}>- <Section />- </Box>-);--export const WithBlurFilter = () => {+const WithBlurFilterVariant = () => {useEffect(() => {$styles.set(new Map([[getStyleDeclKey(blurFilterStyle), blurFilterStyle]]));}, []);@@ -109,7 +109,7 @@ export const WithBlurFilter = () => {);};-export const WithMultipleFilters = () => {+const WithMultipleFiltersVariant = () => {useEffect(() => {$styles.set(new Map([[getStyleDeclKey(multipleFilterStyles), multipleFilterStyles]])@@ -122,6 +122,27 @@ export const WithMultipleFilters = () => {);};+export const Filters = () => (+ <StorySection title="Filters">+ <Flex direction="column" gap="5">+ <Flex direction="column" gap="5">+ <Text variant="labels">Default</Text>+ <Box css={{ width: theme.sizes.sidebarWidth }}>+ <Section />+ </Box>+ </Flex>+ <Flex direction="column" gap="5">+ <Text variant="labels">With blur filter</Text>+ <WithBlurFilterVariant />+ </Flex>+ <Flex direction="column" gap="5">+ <Text variant="labels">With multiple filters</Text>+ <WithMultipleFiltersVariant />+ </Flex>+ </Flex>+ </StorySection>+);+export default {title: "Style panel/Filters",component: Section,diff --git a/apps/builder/app/builder/features/style-panel/sections/flex-child/flex-child.stories.tsx b/apps/builder/app/builder/features/style-panel/sections/flex-child/flex-child.stories.tsxindex 72568b412f..cd9f60326a 100644--- a/apps/builder/app/builder/features/style-panel/sections/flex-child/flex-child.stories.tsx+++ b/apps/builder/app/builder/features/style-panel/sections/flex-child/flex-child.stories.tsx@@ -1,13 +1,15 @@-import { Box, theme } from "@webstudio-is/design-system";+import { Box, StorySection, theme } from "@webstudio-is/design-system";import { Section } from "./flex-child";export const FlexChild = () => (- <Box css={{ width: theme.sizes.sidebarWidth }}>- <Section />- </Box>+ <StorySection title="Flex child">+ <Box css={{ width: theme.sizes.sidebarWidth }}>+ <Section />+ </Box>+ </StorySection>);export default {- title: "Style panel/Flex child",+ title: "Style panel/Flex Child",component: Section,};diff --git a/apps/builder/app/builder/features/style-panel/sections/grid-child/grid-child.stories.tsx b/apps/builder/app/builder/features/style-panel/sections/grid-child/grid-child.stories.tsxindex ac4a086742..63b6456c3e 100644--- a/apps/builder/app/builder/features/style-panel/sections/grid-child/grid-child.stories.tsx+++ b/apps/builder/app/builder/features/style-panel/sections/grid-child/grid-child.stories.tsx@@ -1,13 +1,15 @@-import { Box, theme } from "@webstudio-is/design-system";+import { Box, StorySection, theme } from "@webstudio-is/design-system";import { Section } from "./grid-child";export const GridChild = () => (- <Box css={{ width: theme.sizes.sidebarWidth }}>- <Section />- </Box>+ <StorySection title="Grid child">+ <Box css={{ width: theme.sizes.sidebarWidth }}>+ <Section />+ </Box>+ </StorySection>);export default {- title: "Style panel/Grid child",+ title: "Style panel/Grid Child",component: Section,};diff --git a/apps/builder/app/builder/features/style-panel/sections/layout/layout.stories.tsx b/apps/builder/app/builder/features/style-panel/sections/layout/layout.stories.tsxindex 6e5244cbb1..73b50bdb79 100644--- a/apps/builder/app/builder/features/style-panel/sections/layout/layout.stories.tsx+++ b/apps/builder/app/builder/features/style-panel/sections/layout/layout.stories.tsx@@ -1,10 +1,12 @@-import { Box, theme } from "@webstudio-is/design-system";+import { Box, StorySection, theme } from "@webstudio-is/design-system";import { Section } from "./layout";export const Layout = () => (- <Box css={{ width: theme.sizes.sidebarWidth }}>- <Section />- </Box>+ <StorySection title="Layout">+ <Box css={{ width: theme.sizes.sidebarWidth }}>+ <Section />+ </Box>+ </StorySection>);export default {diff --git a/apps/builder/app/builder/features/style-panel/sections/layout/shared/alignment-ui.stories.tsx b/apps/builder/app/builder/features/style-panel/sections/layout/shared/alignment-ui.stories.tsxindex e61a08fee6..d82fada834 100644--- a/apps/builder/app/builder/features/style-panel/sections/layout/shared/alignment-ui.stories.tsx+++ b/apps/builder/app/builder/features/style-panel/sections/layout/shared/alignment-ui.stories.tsx@@ -1,5 +1,10 @@-import { useState } from "react";-import { Box, Flex, Text, theme } from "@webstudio-is/design-system";+import {+ Box,+ Flex,+ StorySection,+ Text,+ theme,+} from "@webstudio-is/design-system";import { AlignmentUi } from "./alignment-ui";export default {@@ -87,82 +92,54 @@ const CombinationGrid = ({</Flex>);-// Flex: itemStretchWidth/Height are always false-// (flex has no justify-items; stretch is purely from align-items)-export const Flex_ = () => (- <Flex direction="column" gap="6">- <CombinationGrid- title="flex-direction: row"- isColumnDirection={false}- itemStretchWidth={() => false}- itemStretchHeight={() => false}- />- <CombinationGrid- title="flex-direction: column"- isColumnDirection={true}- itemStretchWidth={() => false}- itemStretchHeight={() => false}- />- </Flex>-);-const isStretchOrNormal = (ai: string) => ai === "stretch" || ai === "normal";-// Grid: justify-items controls item stretch independently-// Show both justify-items: stretch (default) and justify-items: start (no stretch)-export const Grid_ = () => (- <Flex direction="column" gap="6">- <CombinationGrid- title="grid-auto-flow: row, justify-items: stretch"- isColumnDirection={false}- itemStretchWidth={isStretchOrNormal}- itemStretchHeight={() => false}- />- <CombinationGrid- title="grid-auto-flow: row, justify-items: start"- isColumnDirection={false}- itemStretchWidth={() => false}- itemStretchHeight={() => false}- />- <CombinationGrid- title="grid-auto-flow: column, justify-items: stretch"- isColumnDirection={true}- itemStretchWidth={() => false}- itemStretchHeight={isStretchOrNormal}- />- <CombinationGrid- title="grid-auto-flow: column, justify-items: start"- isColumnDirection={true}- itemStretchWidth={() => false}- itemStretchHeight={() => false}- />- </Flex>-);+export const AlignmentUI = () => (+ <>+ <StorySection title="Flex">+ <Flex direction="column" gap="6">+ <CombinationGrid+ title="flex-direction: row"+ isColumnDirection={false}+ itemStretchWidth={() => false}+ itemStretchHeight={() => false}+ />+ <CombinationGrid+ title="flex-direction: column"+ isColumnDirection={true}+ itemStretchWidth={() => false}+ itemStretchHeight={() => false}+ />+ </Flex>+ </StorySection>-export const Interactive = () => {- const [selected, setSelected] = useState<{ x: number; y: number }>();- return (- <Flex direction="column" gap="3">- <Text css={{ ...labelStyle }}>- Selected: {selected ? `(${selected.x}, ${selected.y})` : "none"}- </Text>- <Box- css={{- width: 64,- height: 62,- color: theme.colors.foregroundFlexUiMain,- }}- >- <AlignmentUi- justifyContent="start"- alignItems="start"+ <StorySection title="Grid">+ <Flex direction="column" gap="6">+ <CombinationGrid+ title="grid-auto-flow: row, justify-items: stretch"isColumnDirection={false}- color="currentColor"- itemStretchWidth={false}- itemStretchHeight={false}- onSelect={setSelected}+ itemStretchWidth={isStretchOrNormal}+ itemStretchHeight={() => false}/>- </Box>- </Flex>- );-};+ <CombinationGrid+ title="grid-auto-flow: row, justify-items: start"+ isColumnDirection={false}+ itemStretchWidth={() => false}+ itemStretchHeight={() => false}+ />+ <CombinationGrid+ title="grid-auto-flow: column, justify-items: stretch"+ isColumnDirection={true}+ itemStretchWidth={() => false}+ itemStretchHeight={isStretchOrNormal}+ />+ <CombinationGrid+ title="grid-auto-flow: column, justify-items: start"+ isColumnDirection={true}+ itemStretchWidth={() => false}+ itemStretchHeight={() => false}+ />+ </Flex>+ </StorySection>+ </>+);diff --git a/apps/builder/app/builder/features/style-panel/sections/outline/outline.stories.tsx b/apps/builder/app/builder/features/style-panel/sections/outline/outline.stories.tsxindex c5401f6556..ab295c7f14 100644--- a/apps/builder/app/builder/features/style-panel/sections/outline/outline.stories.tsx+++ b/apps/builder/app/builder/features/style-panel/sections/outline/outline.stories.tsx@@ -1,5 +1,11 @@import { useEffect } from "react";-import { Box, theme } from "@webstudio-is/design-system";+import {+ Box,+ Flex,+ StorySection,+ Text,+ theme,+} from "@webstudio-is/design-system";import { getStyleDeclKey, type StyleDecl } from "@webstudio-is/sdk";import {$breakpoints,@@ -73,13 +79,7 @@ const outlineOffset: StyleDecl = {value: { type: "unit", value: 4, unit: "px" },};-export const Outline = () => (- <Box css={{ width: theme.sizes.sidebarWidth }}>- <Section />- </Box>-);--export const WithSolidOutline = () => {+const WithSolidOutlineVariant = () => {useEffect(() => {$styles.set(new Map([@@ -95,7 +95,7 @@ export const WithSolidOutline = () => {);};-export const WithDashedOutline = () => {+const WithDashedOutlineVariant = () => {useEffect(() => {$styles.set(new Map([@@ -113,6 +113,27 @@ export const WithDashedOutline = () => {);};+export const Outline = () => (+ <StorySection title="Outline">+ <Flex direction="column" gap="5">+ <Flex direction="column" gap="5">+ <Text variant="labels">Default</Text>+ <Box css={{ width: theme.sizes.sidebarWidth }}>+ <Section />+ </Box>+ </Flex>+ <Flex direction="column" gap="5">+ <Text variant="labels">With solid outline</Text>+ <WithSolidOutlineVariant />+ </Flex>+ <Flex direction="column" gap="5">+ <Text variant="labels">With dashed outline</Text>+ <WithDashedOutlineVariant />+ </Flex>+ </Flex>+ </StorySection>+);+export default {title: "Style panel/Outline",component: Section,diff --git a/apps/builder/app/builder/features/style-panel/sections/position/inset-control.stories.tsx b/apps/builder/app/builder/features/style-panel/sections/position/inset-control.stories.tsxindex b25a2d41be..2bd2218b6a 100644--- a/apps/builder/app/builder/features/style-panel/sections/position/inset-control.stories.tsx+++ b/apps/builder/app/builder/features/style-panel/sections/position/inset-control.stories.tsx@@ -1,5 +1,5 @@import type { Meta } from "@storybook/react";-import { Box, theme } from "@webstudio-is/design-system";+import { Box, StorySection, theme } from "@webstudio-is/design-system";import { getStyleDeclKey, StyleDecl } from "@webstudio-is/sdk";import { createDefaultPages } from "@webstudio-is/project-build";import { InsetControl } from "./inset-control";@@ -95,9 +95,11 @@ $awareness.set({export const Inset = () => {return (- <Box css={{ width: theme.sizes.sidebarWidth }}>- <InsetControl />- </Box>+ <StorySection title="Inset control">+ <Box css={{ width: theme.sizes.sidebarWidth }}>+ <InsetControl />+ </Box>+ </StorySection>);};diff --git a/apps/builder/app/builder/features/style-panel/sections/position/inset-layout.stories.tsx b/apps/builder/app/builder/features/style-panel/sections/position/inset-layout.stories.tsxindex 9708666695..1a0e56e575 100644--- a/apps/builder/app/builder/features/style-panel/sections/position/inset-layout.stories.tsx+++ b/apps/builder/app/builder/features/style-panel/sections/position/inset-layout.stories.tsx@@ -1,6 +1,12 @@import type { Meta } from "@storybook/react";import { InsetLayout as InsetLayoutComponent } from "./inset-layout";-import { Flex, Grid, Text, theme } from "@webstudio-is/design-system";+import {+ Flex,+ Grid,+ StorySection,+ Text,+ theme,+} from "@webstudio-is/design-system";import type { CssProperty } from "@webstudio-is/css-engine";const Cell = ({ label = "auto" }: { label?: string }) => (@@ -8,105 +14,101 @@ const Cell = ({ label = "auto" }: { label?: string }) => ();export const InsetLayout = () => (- <Flex direction="column" gap="3" css={{ width: theme.sizes.sidebarWidth }}>- <Text variant="labels">Default (no active properties)</Text>- <Grid css={{ height: theme.spacing[18] }}>- <InsetLayoutComponent- renderCell={() => <Cell />}- getActiveProperties={() => []}- onHover={() => {}}- />- </Grid>+ <StorySection title="Inset layout">+ <Flex direction="column" gap="3" css={{ width: theme.sizes.sidebarWidth }}>+ <Text variant="labels">Default (no active properties)</Text>+ <Grid css={{ height: theme.spacing[18] }}>+ <InsetLayoutComponent+ renderCell={() => <Cell />}+ getActiveProperties={() => []}+ onHover={() => {}}+ />+ </Grid>- <Text variant="labels">Single side active (top)</Text>- <Grid css={{ height: theme.spacing[18] }}>- <InsetLayoutComponent- renderCell={(property) => (- <Cell label={property === "top" ? "10px" : "auto"} />- )}- getActiveProperties={() => ["top"] as CssProperty[]}- onHover={() => {}}- />- </Grid>+ <Text variant="labels">Single side active (top)</Text>+ <Grid css={{ height: theme.spacing[18] }}>+ <InsetLayoutComponent+ renderCell={(property) => (+ <Cell label={property === "top" ? "10px" : "auto"} />+ )}+ getActiveProperties={() => ["top"] as CssProperty[]}+ onHover={() => {}}+ />+ </Grid>- <Text variant="labels">Opposing pair active (left + right)</Text>- <Grid css={{ height: theme.spacing[18] }}>- <InsetLayoutComponent- renderCell={(property) => {- if (property === "left") {- return <Cell label="20%" />;- }- if (property === "right") {- return <Cell label="5rem" />;- }- return <Cell />;- }}- getActiveProperties={() => ["left", "right"] as CssProperty[]}- onHover={() => {}}- />- </Grid>+ <Text variant="labels">Opposing pair active (left + right)</Text>+ <Grid css={{ height: theme.spacing[18] }}>+ <InsetLayoutComponent+ renderCell={(property) => {+ if (property === "left") {+ return <Cell label="20%" />;+ }+ if (property === "right") {+ return <Cell label="5rem" />;+ }+ return <Cell />;+ }}+ getActiveProperties={() => ["left", "right"] as CssProperty[]}+ onHover={() => {}}+ />+ </Grid>- <Text variant="labels">All sides active</Text>- <Grid css={{ height: theme.spacing[18] }}>- <InsetLayoutComponent- renderCell={(property) => {- const values: Record<string, string> = {- top: "0px",- right: "123.27rem",- bottom: "auto",- left: "-20%",- };- return <Cell label={values[property] ?? "auto"} />;- }}- getActiveProperties={() =>- ["top", "right", "bottom", "left"] as CssProperty[]- }- onHover={() => {}}- />- </Grid>- </Flex>-);+ <Text variant="labels">All sides active</Text>+ <Grid css={{ height: theme.spacing[18] }}>+ <InsetLayoutComponent+ renderCell={(property) => {+ const values: Record<string, string> = {+ top: "0px",+ right: "123.27rem",+ bottom: "auto",+ left: "-20%",+ };+ return <Cell label={values[property] ?? "auto"} />;+ }}+ getActiveProperties={() =>+ ["top", "right", "bottom", "left"] as CssProperty[]+ }+ onHover={() => {}}+ />+ </Grid>-export const AdjacentSidesActive = () => (- <Flex direction="column" gap="3" css={{ width: theme.sizes.sidebarWidth }}>- <Text variant="labels">Adjacent sides active (top + right)</Text>- <Grid css={{ height: theme.spacing[18] }}>- <InsetLayoutComponent- renderCell={(property) => {- const values: Record<string, string> = {- top: "10px",- right: "20px",- };- return <Cell label={values[property] ?? "auto"} />;- }}- getActiveProperties={() => ["top", "right"] as CssProperty[]}- onHover={() => {}}- />- </Grid>- </Flex>-);+ <Text variant="labels">Adjacent sides active (top + right)</Text>+ <Grid css={{ height: theme.spacing[18] }}>+ <InsetLayoutComponent+ renderCell={(property) => {+ const values: Record<string, string> = {+ top: "10px",+ right: "20px",+ };+ return <Cell label={values[property] ?? "auto"} />;+ }}+ getActiveProperties={() => ["top", "right"] as CssProperty[]}+ onHover={() => {}}+ />+ </Grid>-export const ThreeSidesActive = () => (- <Flex direction="column" gap="3" css={{ width: theme.sizes.sidebarWidth }}>- <Text variant="labels">Three sides active (top, right, bottom)</Text>- <Grid css={{ height: theme.spacing[18] }}>- <InsetLayoutComponent- renderCell={(property) => {- const values: Record<string, string> = {- top: "5px",- right: "10rem",- bottom: "15%",- };- return <Cell label={values[property] ?? "auto"} />;- }}- getActiveProperties={() => ["top", "right", "bottom"] as CssProperty[]}- onHover={() => {}}- />- </Grid>- </Flex>+ <Text variant="labels">Three sides active (top, right, bottom)</Text>+ <Grid css={{ height: theme.spacing[18] }}>+ <InsetLayoutComponent+ renderCell={(property) => {+ const values: Record<string, string> = {+ top: "5px",+ right: "10rem",+ bottom: "15%",+ };+ return <Cell label={values[property] ?? "auto"} />;+ }}+ getActiveProperties={() =>+ ["top", "right", "bottom"] as CssProperty[]+ }+ onHover={() => {}}+ />+ </Grid>+ </Flex>+ </StorySection>);export default {- title: "Style panel/Inset layout",+ title: "Style panel/Inset Layout",component: InsetLayoutComponent,} as Meta<typeof InsetLayoutComponent>;diff --git a/apps/builder/app/builder/features/style-panel/sections/size/size.stories.tsx b/apps/builder/app/builder/features/style-panel/sections/size/size.stories.tsxindex 09308de89a..1a89b21511 100644--- a/apps/builder/app/builder/features/style-panel/sections/size/size.stories.tsx+++ b/apps/builder/app/builder/features/style-panel/sections/size/size.stories.tsx@@ -1,10 +1,12 @@-import { Box, theme } from "@webstudio-is/design-system";+import { Box, StorySection, theme } from "@webstudio-is/design-system";import { Section } from "./size";export const Size = () => (- <Box css={{ width: theme.sizes.sidebarWidth }}>- <Section />- </Box>+ <StorySection title="Size">+ <Box css={{ width: theme.sizes.sidebarWidth }}>+ <Section />+ </Box>+ </StorySection>);export default {diff --git a/apps/builder/app/builder/features/style-panel/sections/space/layout.stories.tsx b/apps/builder/app/builder/features/style-panel/sections/space/layout.stories.tsxindex 6292a0013c..90899f20be 100644--- a/apps/builder/app/builder/features/style-panel/sections/space/layout.stories.tsx+++ b/apps/builder/app/builder/features/style-panel/sections/space/layout.stories.tsx@@ -1,6 +1,12 @@import type { Meta } from "@storybook/react";import { useState } from "react";-import { Box, Flex, Text, theme } from "@webstudio-is/design-system";+import {+ Box,+ Flex,+ StorySection,+ Text,+ theme,+} from "@webstudio-is/design-system";import { SpaceLayout } from "./layout";import { ValueText } from "../shared/value-text";@@ -9,12 +15,27 @@ export default {} as Meta;export const Layout = () => (- <Flex direction="column" gap="3">- <Text variant="labels">Placeholder cells</Text>- <Box css={{ width: theme.sizes.sidebarWidth }}>- <SpaceLayout renderCell={() => <div style={{ color: "red" }}>·</div>} />- </Box>- </Flex>+ <StorySection title="Layout">+ <Flex direction="column" gap="5">+ <Flex direction="column" gap="5">+ <Text variant="labels">Placeholder cells</Text>+ <Box css={{ width: theme.sizes.sidebarWidth }}>+ <SpaceLayout+ renderCell={() => <div style={{ color: "red" }}>·</div>}+ onHover={() => {}}+ />+ </Box>+ </Flex>+ <Flex direction="column" gap="5">+ <Text variant="labels">Value texts</Text>+ <ValueTextsSection />+ </Flex>+ <Flex direction="column" gap="5">+ <Text variant="labels">Active properties</Text>+ <ActivePropertiesSection />+ </Flex>+ </Flex>+ </StorySection>);const allSources = [@@ -33,7 +54,7 @@ const allValues = [{ type: "keyword" as const, value: "revert-layer" },];-export const ValueTexts = () => {+const ValueTextsSection = () => {const [_hovered, setHovered] = useState<{ property: string }>();return (<Flex direction="column" gap="5">@@ -73,7 +94,7 @@ export const ValueTexts = () => {);};-export const ActiveProperties = () => (+const ActivePropertiesSection = () => (<Flex direction="column" gap="5"><Flex direction="column" gap="1"><Text variant="labels">Active margin sides (top + bottom)</Text>diff --git a/apps/builder/app/builder/features/style-panel/sections/text-shadows/text-shadows.stories.tsx b/apps/builder/app/builder/features/style-panel/sections/text-shadows/text-shadows.stories.tsxindex 3472aba96d..6c78c9c964 100644--- a/apps/builder/app/builder/features/style-panel/sections/text-shadows/text-shadows.stories.tsx+++ b/apps/builder/app/builder/features/style-panel/sections/text-shadows/text-shadows.stories.tsx@@ -1,13 +1,15 @@-import { Box, theme } from "@webstudio-is/design-system";+import { Box, StorySection, theme } from "@webstudio-is/design-system";import { Section } from "./text-shadows";export const TextShadows = () => (- <Box css={{ width: theme.sizes.sidebarWidth }}>- <Section />- </Box>+ <StorySection title="Text shadows">+ <Box css={{ width: theme.sizes.sidebarWidth }}>+ <Section />+ </Box>+ </StorySection>);export default {- title: "Style panel/Text shadows",+ title: "Style panel/Text Shadows",component: Section,};diff --git a/apps/builder/app/builder/features/style-panel/sections/transforms/transforms.stories.tsx b/apps/builder/app/builder/features/style-panel/sections/transforms/transforms.stories.tsxindex f4c1adc6c6..3fa32c8e0b 100644--- a/apps/builder/app/builder/features/style-panel/sections/transforms/transforms.stories.tsx+++ b/apps/builder/app/builder/features/style-panel/sections/transforms/transforms.stories.tsx@@ -1,10 +1,12 @@-import { Box, theme } from "@webstudio-is/design-system";+import { Box, StorySection, theme } from "@webstudio-is/design-system";import { Section } from "./transforms";export const Transforms = () => (- <Box css={{ width: theme.sizes.sidebarWidth }}>- <Section />- </Box>+ <StorySection title="Transforms">+ <Box css={{ width: theme.sizes.sidebarWidth }}>+ <Section />+ </Box>+ </StorySection>);export default {diff --git a/apps/builder/app/builder/features/style-panel/sections/transitions/transitions.stories.tsx b/apps/builder/app/builder/features/style-panel/sections/transitions/transitions.stories.tsxindex f7cbefb7dc..e7447cb99f 100644--- a/apps/builder/app/builder/features/style-panel/sections/transitions/transitions.stories.tsx+++ b/apps/builder/app/builder/features/style-panel/sections/transitions/transitions.stories.tsx@@ -1,4 +1,4 @@-import { Box, theme } from "@webstudio-is/design-system";+import { Box, StorySection, theme } from "@webstudio-is/design-system";import { getStyleDeclKey, StyleDecl } from "@webstudio-is/sdk";import {$breakpoints,@@ -59,9 +59,11 @@ $awareness.set({});export const Transitions = () => (- <Box css={{ width: theme.sizes.sidebarWidth }}>- <Section />- </Box>+ <StorySection title="Transitions">+ <Box css={{ width: theme.sizes.sidebarWidth }}>+ <Section />+ </Box>+ </StorySection>);export default {diff --git a/apps/builder/app/builder/features/style-panel/sections/typography/typography.stories.tsx b/apps/builder/app/builder/features/style-panel/sections/typography/typography.stories.tsxindex bc906830f3..157dc76c3c 100644--- a/apps/builder/app/builder/features/style-panel/sections/typography/typography.stories.tsx+++ b/apps/builder/app/builder/features/style-panel/sections/typography/typography.stories.tsx@@ -1,10 +1,12 @@-import { Box, theme } from "@webstudio-is/design-system";+import { Box, StorySection, theme } from "@webstudio-is/design-system";import { Section } from "./typography";export const Typography = () => (- <Box css={{ width: theme.sizes.sidebarWidth }}>- <Section />- </Box>+ <StorySection title="Typography">+ <Box css={{ width: theme.sizes.sidebarWidth }}>+ <Section />+ </Box>+ </StorySection>);export default {diff --git a/apps/builder/app/builder/features/style-panel/shared/css-value-input/css-value-input.stories.tsx b/apps/builder/app/builder/features/style-panel/shared/css-value-input/css-value-input.stories.tsxindex 44c5f6fdd7..30e50203ac 100644--- a/apps/builder/app/builder/features/style-panel/shared/css-value-input/css-value-input.stories.tsx+++ b/apps/builder/app/builder/features/style-panel/shared/css-value-input/css-value-input.stories.tsx@@ -3,20 +3,24 @@ import {Flex,InputField,SmallIconButton,+ StorySection,Text,theme,} from "@webstudio-is/design-system";import type { StyleValue, CssProperty } from "@webstudio-is/css-engine";import type { StyleValueSourceColor } from "~/shared/style-object-model";-import { CssValueInput, type CssValueInputValue } from "./css-value-input";+import {+ CssValueInput as CssValueInputComponent,+ type CssValueInputValue,+} from "./css-value-input";import type { UnitOption } from "./unit-select";import { action } from "@storybook/addon-actions";import { toValue } from "@webstudio-is/css-engine";import { EyeOpenIcon, Link2Icon } from "@webstudio-is/icons";export default {- title: "Style panel/CSS value input",- component: CssValueInput,+ title: "Style panel/CSS Value Input",+ component: CssValueInputComponent,};const CssValueInputVariant = ({@@ -56,7 +60,7 @@ const CssValueInputVariant = ({>();const input = (- <CssValueInput+ <CssValueInputComponentstyleSource={styleSource}property={property}value={value}@@ -115,250 +119,267 @@ const keywordOptions = [];export const CSSValueInput = () => (- <Flex direction="column" gap="5" css={{ maxWidth: theme.sizes.sidebarWidth }}>- <CssValueInputVariant- label="Keywords (width)"- initialValue={{ type: "keyword", value: "auto" }}- property="width"- options={keywordOptions}- />- <CssValueInputVariant- label="Icons (align-items)"- initialValue={{ type: "keyword", value: "space-around" }}- property="align-items"- options={[- { type: "keyword", value: "normal" },- { type: "keyword", value: "start" },- { type: "keyword", value: "end" },- { type: "keyword", value: "center" },- { type: "keyword", value: "stretch" },- { type: "keyword", value: "space-around" },- { type: "keyword", value: "space-between" },- ]}- />- <CssValueInputVariant- label="Units (row-gap)"- initialValue={{ type: "unit", value: 100, unit: "px" }}- property="row-gap"- options={keywordOptions}- showOutput- />- <CssValueInputVariant- label="Oversized (100px container)"- initialValue={{- type: "var",- value: "start-test-test-test-test-test-test-test-end",- }}- property="align-items"- containerWidth={100}- />- </Flex>-);+ <>+ <StorySection title="Keywords and units">+ <Flex+ direction="column"+ gap="5"+ css={{ maxWidth: theme.sizes.sidebarWidth }}+ >+ <CssValueInputVariant+ label="Keywords (width)"+ initialValue={{ type: "keyword", value: "auto" }}+ property="width"+ options={keywordOptions}+ />+ <CssValueInputVariant+ label="Icons (align-items)"+ initialValue={{ type: "keyword", value: "space-around" }}+ property="align-items"+ options={[+ { type: "keyword", value: "normal" },+ { type: "keyword", value: "start" },+ { type: "keyword", value: "end" },+ { type: "keyword", value: "center" },+ { type: "keyword", value: "stretch" },+ { type: "keyword", value: "space-around" },+ { type: "keyword", value: "space-between" },+ ]}+ />+ <CssValueInputVariant+ label="Units (row-gap)"+ initialValue={{ type: "unit", value: 100, unit: "px" }}+ property="row-gap"+ options={keywordOptions}+ showOutput+ />+ <CssValueInputVariant+ label="Oversized (100px container)"+ initialValue={{+ type: "var",+ value: "start-test-test-test-test-test-test-test-end",+ }}+ property="align-items"+ containerWidth={100}+ />+ <CssValueInputVariant+ label="With text prefix"+ initialValue={{ type: "unit", value: 10, unit: "px" }}+ property="row-gap"+ prefix={<Text>X</Text>}+ />+ <CssValueInputVariant+ label="With placeholder"+ initialValue={{ type: "keyword", value: "" }}+ property="width"+ placeholder="Enter value\u2026"+ options={keywordOptions}+ />+ <CssValueInputVariant+ label="Only px and %"+ initialValue={{ type: "unit", value: 100, unit: "px" }}+ property="width"+ unitOptions={[+ { id: "px", label: "px", type: "unit" },+ { id: "%", label: "%", type: "unit" },+ ]}+ />+ <CssValueInputVariant+ label="Units with keyword option"+ initialValue={{ type: "unit", value: 2, unit: "rem" }}+ property="width"+ unitOptions={[+ { id: "px", label: "px", type: "unit" },+ { id: "rem", label: "rem", type: "unit" },+ { id: "auto", label: "auto", type: "keyword" },+ ]}+ />+ </Flex>+ </StorySection>-export const StyleSources = () => (- <Flex direction="column" gap="5" css={{ maxWidth: theme.sizes.sidebarWidth }}>- <CssValueInputVariant- label="Default"- styleSource="default"- initialValue={{ type: "keyword", value: "auto" }}- property="width"- options={keywordOptions}- />- <CssValueInputVariant- label="Preset"- styleSource="preset"- initialValue={{ type: "keyword", value: "auto" }}- property="width"- options={keywordOptions}- />- <CssValueInputVariant- label="Local"- styleSource="local"- initialValue={{ type: "keyword", value: "auto" }}- property="width"- options={keywordOptions}- />- <CssValueInputVariant- label="Remote"- styleSource="remote"- initialValue={{ type: "keyword", value: "auto" }}- property="width"- options={keywordOptions}- />- <CssValueInputVariant- label="Overwritten"- styleSource="overwritten"- initialValue={{ type: "keyword", value: "auto" }}- property="width"- options={keywordOptions}- />- </Flex>-);+ <StorySection title="Style sources">+ <Flex+ direction="column"+ gap="5"+ css={{ maxWidth: theme.sizes.sidebarWidth }}+ >+ <CssValueInputVariant+ label="Default"+ styleSource="default"+ initialValue={{ type: "keyword", value: "auto" }}+ property="width"+ options={keywordOptions}+ />+ <CssValueInputVariant+ label="Preset"+ styleSource="preset"+ initialValue={{ type: "keyword", value: "auto" }}+ property="width"+ options={keywordOptions}+ />+ <CssValueInputVariant+ label="Local"+ styleSource="local"+ initialValue={{ type: "keyword", value: "auto" }}+ property="width"+ options={keywordOptions}+ />+ <CssValueInputVariant+ label="Remote"+ styleSource="remote"+ initialValue={{ type: "keyword", value: "auto" }}+ property="width"+ options={keywordOptions}+ />+ <CssValueInputVariant+ label="Overwritten"+ styleSource="overwritten"+ initialValue={{ type: "keyword", value: "auto" }}+ property="width"+ options={keywordOptions}+ />+ </Flex>+ </StorySection>-export const Disabled = () => (- <Flex direction="column" gap="5" css={{ maxWidth: theme.sizes.sidebarWidth }}>- <CssValueInputVariant- label="Disabled with keyword"- initialValue={{ type: "keyword", value: "auto" }}- property="width"- disabled- options={keywordOptions}- />- <CssValueInputVariant- label="Disabled with unit"- initialValue={{ type: "unit", value: 42, unit: "px" }}- property="row-gap"- disabled- />- </Flex>-);+ <StorySection title="Disabled">+ <Flex+ direction="column"+ gap="5"+ css={{ maxWidth: theme.sizes.sidebarWidth }}+ >+ <CssValueInputVariant+ label="Disabled with keyword"+ initialValue={{ type: "keyword", value: "auto" }}+ property="width"+ disabled+ options={keywordOptions}+ />+ <CssValueInputVariant+ label="Disabled with unit"+ initialValue={{ type: "unit", value: 42, unit: "px" }}+ property="row-gap"+ disabled+ />+ </Flex>+ </StorySection>-export const WithIcon = () => (- <Flex direction="column" gap="5" css={{ maxWidth: theme.sizes.sidebarWidth }}>- <CssValueInputVariant- label="With eye icon"- initialValue={{ type: "unit", value: 100, unit: "px" }}- property="width"- icon={<SmallIconButton icon={<EyeOpenIcon />} />}- />- <CssValueInputVariant- label="With link icon"- initialValue={{ type: "unit", value: 16, unit: "px" }}- property="row-gap"- icon={<SmallIconButton icon={<Link2Icon />} />}- />- </Flex>-);+ <StorySection title="With icon">+ <Flex+ direction="column"+ gap="5"+ css={{ maxWidth: theme.sizes.sidebarWidth }}+ >+ <CssValueInputVariant+ label="With eye icon"+ initialValue={{ type: "unit", value: 100, unit: "px" }}+ property="width"+ icon={<SmallIconButton icon={<EyeOpenIcon />} />}+ />+ <CssValueInputVariant+ label="With link icon"+ initialValue={{ type: "unit", value: 16, unit: "px" }}+ property="row-gap"+ icon={<SmallIconButton icon={<Link2Icon />} />}+ />+ </Flex>+ </StorySection>-export const WithPrefix = () => (- <Flex direction="column" gap="5" css={{ maxWidth: theme.sizes.sidebarWidth }}>- <CssValueInputVariant- label="With text prefix"- initialValue={{ type: "unit", value: 10, unit: "px" }}- property="row-gap"- prefix={<Text>X</Text>}- />- </Flex>-);+ <StorySection title="Hidden suffix">+ <Flex+ direction="column"+ gap="5"+ css={{ maxWidth: theme.sizes.sidebarWidth }}+ >+ <CssValueInputVariant+ label="Suffix shown (default)"+ initialValue={{ type: "unit", value: 16, unit: "px" }}+ property="row-gap"+ showSuffix+ />+ <CssValueInputVariant+ label="Suffix hidden"+ initialValue={{ type: "unit", value: 16, unit: "px" }}+ property="row-gap"+ showSuffix={false}+ />+ </Flex>+ </StorySection>-export const WithPlaceholder = () => (- <Flex direction="column" gap="5" css={{ maxWidth: theme.sizes.sidebarWidth }}>- <CssValueInputVariant- label="With placeholder"- initialValue={{ type: "keyword", value: "" }}- property="width"- placeholder="Enter value…"- options={keywordOptions}- />- </Flex>-);+ <StorySection title="Value types">+ <Flex+ direction="column"+ gap="5"+ css={{ maxWidth: theme.sizes.sidebarWidth }}+ >+ <CssValueInputVariant+ label="Keyword value"+ initialValue={{ type: "keyword", value: "auto" }}+ property="width"+ options={keywordOptions}+ />+ <CssValueInputVariant+ label="Unit value (px)"+ initialValue={{ type: "unit", value: 100, unit: "px" }}+ property="width"+ />+ <CssValueInputVariant+ label="Unit value (rem)"+ initialValue={{ type: "unit", value: 2, unit: "rem" }}+ property="width"+ />+ <CssValueInputVariant+ label="Unit value (%)"+ initialValue={{ type: "unit", value: 50, unit: "%" }}+ property="width"+ />+ <CssValueInputVariant+ label="Var value"+ initialValue={{ type: "var", value: "my-custom-var" }}+ property="width"+ />+ <CssValueInputVariant+ label="Var with fallback"+ initialValue={{+ type: "var",+ value: "brand-color",+ fallback: { type: "keyword", value: "red" },+ }}+ property="color"+ />+ <CssValueInputVariant+ label="Invalid value"+ initialValue={{ type: "invalid", value: "not-a-valid-value" }}+ property="width"+ />+ <CssValueInputVariant+ label="Unparsed value"+ initialValue={{+ type: "unparsed",+ value: "calc(100% - 20px)",+ }}+ property="width"+ />+ </Flex>+ </StorySection>-export const HiddenSuffix = () => (- <Flex direction="column" gap="5" css={{ maxWidth: theme.sizes.sidebarWidth }}>- <CssValueInputVariant- label="Suffix shown (default)"- initialValue={{ type: "unit", value: 16, unit: "px" }}- property="row-gap"- showSuffix- />- <CssValueInputVariant- label="Suffix hidden"- initialValue={{ type: "unit", value: 16, unit: "px" }}- property="row-gap"- showSuffix={false}- />- </Flex>-);--export const CustomUnitOptions = () => (- <Flex direction="column" gap="5" css={{ maxWidth: theme.sizes.sidebarWidth }}>- <CssValueInputVariant- label="Only px and %"- initialValue={{ type: "unit", value: 100, unit: "px" }}- property="width"- unitOptions={[- { id: "px", label: "px", type: "unit" },- { id: "%", label: "%", type: "unit" },- ]}- />- <CssValueInputVariant- label="Units with keyword option"- initialValue={{ type: "unit", value: 2, unit: "rem" }}- property="width"- unitOptions={[- { id: "px", label: "px", type: "unit" },- { id: "rem", label: "rem", type: "unit" },- { id: "auto", label: "auto", type: "keyword" },- ]}- />- </Flex>-);--export const ValueTypes = () => (- <Flex direction="column" gap="5" css={{ maxWidth: theme.sizes.sidebarWidth }}>- <CssValueInputVariant- label="Keyword value"- initialValue={{ type: "keyword", value: "auto" }}- property="width"- options={keywordOptions}- />- <CssValueInputVariant- label="Unit value (px)"- initialValue={{ type: "unit", value: 100, unit: "px" }}- property="width"- />- <CssValueInputVariant- label="Unit value (rem)"- initialValue={{ type: "unit", value: 2, unit: "rem" }}- property="width"- />- <CssValueInputVariant- label="Unit value (%)"- initialValue={{ type: "unit", value: 50, unit: "%" }}- property="width"- />- <CssValueInputVariant- label="Var value"- initialValue={{ type: "var", value: "my-custom-var" }}- property="width"- />- <CssValueInputVariant- label="Var with fallback"- initialValue={{- type: "var",- value: "brand-color",- fallback: { type: "keyword", value: "red" },- }}- property="color"- />- <CssValueInputVariant- label="Invalid value"- initialValue={{ type: "invalid", value: "not-a-valid-value" }}- property="width"- />- <CssValueInputVariant- label="Unparsed value"- initialValue={{- type: "unparsed",- value: "calc(100% - 20px)",- }}- property="width"- />- </Flex>-);--export const MinWidth = () => (- <Flex direction="column" gap="5" css={{ maxWidth: theme.sizes.sidebarWidth }}>- <CssValueInputVariant- label="Default min width"- initialValue={{ type: "unit", value: 0, unit: "px" }}- property="width"- />- <CssValueInputVariant- label="Min width 120px"- initialValue={{ type: "unit", value: 0, unit: "px" }}- property="width"- minWidth="120px"- />- </Flex>+ <StorySection title="Min width">+ <Flex+ direction="column"+ gap="5"+ css={{ maxWidth: theme.sizes.sidebarWidth }}+ >+ <CssValueInputVariant+ label="Default min width"+ initialValue={{ type: "unit", value: 0, unit: "px" }}+ property="width"+ />+ <CssValueInputVariant+ label="Min width 120px"+ initialValue={{ type: "unit", value: 0, unit: "px" }}+ property="width"+ minWidth="120px"+ />+ </Flex>+ </StorySection>+ </>);diff --git a/apps/builder/app/builder/features/style-panel/shared/show-more.stories.tsx b/apps/builder/app/builder/features/style-panel/shared/show-more.stories.tsxindex 5aa54172f1..ce1373ba04 100644--- a/apps/builder/app/builder/features/style-panel/shared/show-more.stories.tsx+++ b/apps/builder/app/builder/features/style-panel/shared/show-more.stories.tsx@@ -1,19 +1,21 @@-import { Box, Text, theme } from "@webstudio-is/design-system";+import { Box, StorySection, Text, theme } from "@webstudio-is/design-system";import { ShowMore as ShowMoreComponent } from "./show-more";export default {- title: "Style panel/Show more",+ title: "Style panel/Show More",component: ShowMoreComponent,};export const ShowMore = () => (- <Box css={{ width: theme.sizes.sidebarWidth }}>- <ShowMoreComponent- styleConfigs={[- <Text key="1">First config item</Text>,- <Text key="2">Second config item</Text>,- <Text key="3">Third config item</Text>,- ]}- />- </Box>+ <StorySection title="Show More">+ <Box css={{ width: theme.sizes.sidebarWidth }}>+ <ShowMoreComponent+ styleConfigs={[+ <Text key="1">First config item</Text>,+ <Text key="2">Second config item</Text>,+ <Text key="3">Third config item</Text>,+ ]}+ />+ </Box>+ </StorySection>);diff --git a/apps/builder/app/builder/features/style-panel/style-source/style-source-badge.stories.tsx b/apps/builder/app/builder/features/style-panel/style-source/style-source-badge.stories.tsxindex 0b6fef89f6..716ed19cba 100644--- a/apps/builder/app/builder/features/style-panel/style-source/style-source-badge.stories.tsx+++ b/apps/builder/app/builder/features/style-panel/style-source/style-source-badge.stories.tsx@@ -1,42 +1,50 @@import type { StoryFn } from "@storybook/react";-import { Box, Flex, Text, theme } from "@webstudio-is/design-system";+import {+ Box,+ Flex,+ StorySection,+ Text,+ theme,+} from "@webstudio-is/design-system";import { StyleSourceBadge as StyleSourceBadgeComponent } from "./style-source-badge";export default {- title: "Style panel/Style source badge",+ title: "Style panel/Style Source Badge",component: StyleSourceBadgeComponent,};export const StyleSourceBadge: StoryFn<typeof StyleSourceBadgeComponent> = () => (- <Box css={{ width: theme.sizes.sidebarWidth }}>- <Flex direction="column" gap="3">- <Text variant="labels">All source variants</Text>- <Flex gap="1" wrap="wrap">- <StyleSourceBadgeComponent source="local" variant="small">- Local- </StyleSourceBadgeComponent>- <StyleSourceBadgeComponent source="token" variant="small">- Token- </StyleSourceBadgeComponent>- <StyleSourceBadgeComponent source="tag" variant="small">- Tag- </StyleSourceBadgeComponent>- <StyleSourceBadgeComponent source="breakpoint" variant="small">- Breakpoint- </StyleSourceBadgeComponent>- <StyleSourceBadgeComponent source="instance" variant="small">- Instance- </StyleSourceBadgeComponent>- </Flex>+ <StorySection title="Style Source Badge">+ <Box css={{ width: theme.sizes.sidebarWidth }}>+ <Flex direction="column" gap="3">+ <Text variant="labels">All source variants</Text>+ <Flex gap="1" wrap="wrap">+ <StyleSourceBadgeComponent source="local" variant="small">+ Local+ </StyleSourceBadgeComponent>+ <StyleSourceBadgeComponent source="token" variant="small">+ Token+ </StyleSourceBadgeComponent>+ <StyleSourceBadgeComponent source="tag" variant="small">+ Tag+ </StyleSourceBadgeComponent>+ <StyleSourceBadgeComponent source="breakpoint" variant="small">+ Breakpoint+ </StyleSourceBadgeComponent>+ <StyleSourceBadgeComponent source="instance" variant="small">+ Instance+ </StyleSourceBadgeComponent>+ </Flex>- <Text variant="labels">Long label (truncation)</Text>- <Flex gap="1">- <StyleSourceBadgeComponent source="token" variant="small">- Very long token name that should be truncated- </StyleSourceBadgeComponent>+ <Text variant="labels">Long label (truncation)</Text>+ <Flex gap="1">+ <StyleSourceBadgeComponent source="token" variant="small">+ Very long token name that should be truncated+ </StyleSourceBadgeComponent>+ </Flex></Flex>- </Flex>- </Box>+ </Box>+ </StorySection>);diff --git a/apps/builder/app/builder/features/style-panel/style-source/style-source-input.stories.tsx b/apps/builder/app/builder/features/style-panel/style-source/style-source-input.stories.tsxindex ac0a733cfc..972478c3ea 100644--- a/apps/builder/app/builder/features/style-panel/style-source/style-source-input.stories.tsx+++ b/apps/builder/app/builder/features/style-panel/style-source/style-source-input.stories.tsx@@ -1,6 +1,6 @@import { nanoid } from "nanoid";import { useState } from "react";-import { Flex, Text, theme } from "@webstudio-is/design-system";+import { Flex, StorySection, Text, theme } from "@webstudio-is/design-system";import {type ItemSelector,type ItemSource,@@ -8,7 +8,7 @@ import {} from ".";export default {- title: "Style panel/Style source input",+ title: "Style panel/Style Source Input",component: StyleSourceInputComponent,};@@ -98,75 +98,77 @@ export const StyleSourceInput = () => {]);return (- <Flex- direction="column"- gap="5"- css={{ maxWidth: theme.sizes.sidebarWidth }}- >- <Flex direction="column" gap="1">- <Text variant="labels">Complete (with editing & disabling)</Text>- <StyleSourceInputComponent- inputRef={() => {}}- css={{ width: theme.sizes.sidebarWidth }}- items={getItems()}- value={value}- selectedItemSelector={selectedItemSelector}- editingItemId={editingItemId}- onSelectItem={setSelectedItemSelector}- onEditItem={setEditingItemId}- onCreateItem={(label) => {- createItem(label, value, setValue);- }}- onSelectAutocompleteItem={(item) => {- setValue([...value, item]);- }}- onDetachItem={(itemToRemove) => {- removeItem(itemToRemove, value, setValue);- }}- onChangeItem={(changedItem) => {- setValue(- value.map((item) =>- item.id === changedItem.id ? changedItem : item- )- );- }}- onDisableItem={(id) => {- setValue(- value.map((item) =>- item.id === id ? { ...item, disabled: true } : item- )- );- }}- onEnableItem={(id) => {- setValue(- value.map((item) =>- item.id === id ? { ...item, disabled: false } : item- )- );- }}- onSort={setValue}- />+ <StorySection title="Style Source Input">+ <Flex+ direction="column"+ gap="5"+ css={{ maxWidth: theme.sizes.sidebarWidth }}+ >+ <Flex direction="column" gap="1">+ <Text variant="labels">Complete (with editing & disabling)</Text>+ <StyleSourceInputComponent+ inputRef={() => {}}+ css={{ width: theme.sizes.sidebarWidth }}+ items={getItems()}+ value={value}+ selectedItemSelector={selectedItemSelector}+ editingItemId={editingItemId}+ onSelectItem={setSelectedItemSelector}+ onEditItem={setEditingItemId}+ onCreateItem={(label) => {+ createItem(label, value, setValue);+ }}+ onSelectAutocompleteItem={(item) => {+ setValue([...value, item]);+ }}+ onDetachItem={(itemToRemove) => {+ removeItem(itemToRemove, value, setValue);+ }}+ onChangeItem={(changedItem) => {+ setValue(+ value.map((item) =>+ item.id === changedItem.id ? changedItem : item+ )+ );+ }}+ onDisableItem={(id) => {+ setValue(+ value.map((item) =>+ item.id === id ? { ...item, disabled: true } : item+ )+ );+ }}+ onEnableItem={(id) => {+ setValue(+ value.map((item) =>+ item.id === id ? { ...item, disabled: false } : item+ )+ );+ }}+ onSort={setValue}+ />+ </Flex>+ <Flex direction="column" gap="1">+ <Text variant="labels">Truncated item</Text>+ <StyleSourceInputComponent+ inputRef={() => {}}+ css={{ width: theme.sizes.sidebarWidth }}+ items={getItems()}+ value={truncated}+ selectedItemSelector={{ styleSourceId: truncatedId }}+ onCreateItem={(label) => {+ createItem(label, truncated, setTruncated);+ }}+ onSelectAutocompleteItem={(item) => {+ setTruncated([...truncated, item]);+ }}+ onDetachItem={(id) => {+ removeItem(id, truncated, setTruncated);+ }}+ onSort={setTruncated}+ />+ </Flex></Flex>- <Flex direction="column" gap="1">- <Text variant="labels">Truncated item</Text>- <StyleSourceInputComponent- inputRef={() => {}}- css={{ width: theme.sizes.sidebarWidth }}- items={getItems()}- value={truncated}- selectedItemSelector={{ styleSourceId: truncatedId }}- onCreateItem={(label) => {- createItem(label, truncated, setTruncated);- }}- onSelectAutocompleteItem={(item) => {- setTruncated([...truncated, item]);- }}- onDetachItem={(id) => {- removeItem(id, truncated, setTruncated);- }}- onSort={setTruncated}- />- </Flex>- </Flex>+ </StorySection>);};diff --git a/apps/builder/app/builder/features/workspace/canvas-tools/outline/outline.stories.tsx b/apps/builder/app/builder/features/workspace/canvas-tools/outline/outline.stories.tsxindex 0cc06230b0..8758367218 100644--- a/apps/builder/app/builder/features/workspace/canvas-tools/outline/outline.stories.tsx+++ b/apps/builder/app/builder/features/workspace/canvas-tools/outline/outline.stories.tsx@@ -1,4 +1,4 @@-import { Box, Flex, Grid } from "@webstudio-is/design-system";+import { Box, Flex, Grid, StorySection } from "@webstudio-is/design-system";import { Outline as OutlineComponent } from "./outline";export default {@@ -7,114 +7,116 @@ export default {};export const Outline = () => (- <Grid gap={3} columns={2} css={{ margin: 16 }}>- <Grid- align="center"- justify="center"- css={{ position: "relative", height: 150, width: 150 }}- >- <Box css={{ width: "min-content", textAlign: "center" }}>- Selected outline- </Box>- <OutlineComponent- rect={new DOMRect(0, 0, 150, 150)}- clampingRect={new DOMRect(0, 0, 150, 150)}- />- </Grid>+ <StorySection title="Outline">+ <Grid gap={3} columns={2} css={{ margin: 16 }}>+ <Grid+ align="center"+ justify="center"+ css={{ position: "relative", height: 150, width: 150 }}+ >+ <Box css={{ width: "min-content", textAlign: "center" }}>+ Selected outline+ </Box>+ <OutlineComponent+ rect={new DOMRect(0, 0, 150, 150)}+ clampingRect={new DOMRect(0, 0, 150, 150)}+ />+ </Grid>- <Flex- align="center"- justify="center"- css={{ position: "relative", height: 150, width: 150 }}- >- <Box css={{ width: "min-content", textAlign: "center" }}>- Collaboration outline- </Box>- <OutlineComponent- rect={new DOMRect(0, 0, 150, 150)}- clampingRect={new DOMRect(0, 0, 150, 150)}- variant="collaboration"- />- </Flex>+ <Flex+ align="center"+ justify="center"+ css={{ position: "relative", height: 150, width: 150 }}+ >+ <Box css={{ width: "min-content", textAlign: "center" }}>+ Collaboration outline+ </Box>+ <OutlineComponent+ rect={new DOMRect(0, 0, 150, 150)}+ clampingRect={new DOMRect(0, 0, 150, 150)}+ variant="collaboration"+ />+ </Flex>- <Flex- align="center"- justify="center"- css={{ position: "relative", height: 150, width: 150 }}- >- <Box css={{ width: "min-content", textAlign: "center" }}>- Collaboration outline over Selected- </Box>- <OutlineComponent- rect={new DOMRect(0, 0, 150, 150)}- clampingRect={new DOMRect(0, 0, 150, 150)}- />- <OutlineComponent- rect={new DOMRect(0, 0, 150, 150)}- clampingRect={new DOMRect(0, 0, 150, 150)}- variant="collaboration"- />- </Flex>+ <Flex+ align="center"+ justify="center"+ css={{ position: "relative", height: 150, width: 150 }}+ >+ <Box css={{ width: "min-content", textAlign: "center" }}>+ Collaboration outline over Selected+ </Box>+ <OutlineComponent+ rect={new DOMRect(0, 0, 150, 150)}+ clampingRect={new DOMRect(0, 0, 150, 150)}+ />+ <OutlineComponent+ rect={new DOMRect(0, 0, 150, 150)}+ clampingRect={new DOMRect(0, 0, 150, 150)}+ variant="collaboration"+ />+ </Flex>- <Flex- align="center"- justify="center"- css={{ position: "relative", height: 150, width: 150 }}- >- <Box css={{ width: "min-content", textAlign: "center" }}>- Selected outline over Collaboration- </Box>- <OutlineComponent- rect={new DOMRect(0, 0, 150, 150)}- clampingRect={new DOMRect(0, 0, 150, 150)}- variant="collaboration"- />- <OutlineComponent- rect={new DOMRect(0, 0, 150, 150)}- clampingRect={new DOMRect(0, 0, 150, 150)}- />- </Flex>+ <Flex+ align="center"+ justify="center"+ css={{ position: "relative", height: 150, width: 150 }}+ >+ <Box css={{ width: "min-content", textAlign: "center" }}>+ Selected outline over Collaboration+ </Box>+ <OutlineComponent+ rect={new DOMRect(0, 0, 150, 150)}+ clampingRect={new DOMRect(0, 0, 150, 150)}+ variant="collaboration"+ />+ <OutlineComponent+ rect={new DOMRect(0, 0, 150, 150)}+ clampingRect={new DOMRect(0, 0, 150, 150)}+ />+ </Flex>- <Flex- align="center"- justify="center"- css={{ position: "relative", height: 150, width: 150 }}- >- <Box css={{ width: "min-content", textAlign: "center" }}>- Clamped left- </Box>- <OutlineComponent- rect={new DOMRect(-10, 0, 150, 150)}- clampingRect={new DOMRect(0, 0, 150, 150)}- />- </Flex>+ <Flex+ align="center"+ justify="center"+ css={{ position: "relative", height: 150, width: 150 }}+ >+ <Box css={{ width: "min-content", textAlign: "center" }}>+ Clamped left+ </Box>+ <OutlineComponent+ rect={new DOMRect(-10, 0, 150, 150)}+ clampingRect={new DOMRect(0, 0, 150, 150)}+ />+ </Flex>- <Flex- align="center"- justify="center"- css={{ position: "relative", height: 150, width: 150 }}- >- <Box css={{ width: "min-content", textAlign: "center" }}>- Clamped right- </Box>- <OutlineComponent- rect={new DOMRect(0, 0, 160, 150)}- clampingRect={new DOMRect(0, 0, 150, 150)}- />- </Flex>+ <Flex+ align="center"+ justify="center"+ css={{ position: "relative", height: 150, width: 150 }}+ >+ <Box css={{ width: "min-content", textAlign: "center" }}>+ Clamped right+ </Box>+ <OutlineComponent+ rect={new DOMRect(0, 0, 160, 150)}+ clampingRect={new DOMRect(0, 0, 150, 150)}+ />+ </Flex>- <Flex- align="center"- justify="center"- css={{ position: "relative", height: 150, width: 150 }}- >- <Box css={{ width: "min-content", textAlign: "center" }}>- Clamped left-right- </Box>- <OutlineComponent- rect={new DOMRect(-10, 0, 170, 150)}- clampingRect={new DOMRect(0, 0, 150, 150)}- />- </Flex>- </Grid>+ <Flex+ align="center"+ justify="center"+ css={{ position: "relative", height: 150, width: 150 }}+ >+ <Box css={{ width: "min-content", textAlign: "center" }}>+ Clamped left-right+ </Box>+ <OutlineComponent+ rect={new DOMRect(-10, 0, 170, 150)}+ clampingRect={new DOMRect(0, 0, 150, 150)}+ />+ </Flex>+ </Grid>+ </StorySection>);diff --git a/apps/builder/app/builder/shared/asset-manager/asset-manager.stories.tsx b/apps/builder/app/builder/shared/asset-manager/asset-manager.stories.tsxindex c6f582cdae..fe3de0e081 100644--- a/apps/builder/app/builder/shared/asset-manager/asset-manager.stories.tsx+++ b/apps/builder/app/builder/shared/asset-manager/asset-manager.stories.tsx@@ -1,4 +1,5 @@import type { Meta, StoryObj } from "@storybook/react";+import { StorySection } from "@webstudio-is/design-system";import { AssetManager as AssetManagerComponent } from "./asset-manager";import {ALLOWED_FILE_TYPES,@@ -36,7 +37,7 @@ const createMockAssets = (): Asset[] => {};export default {- title: "Asset manager",+ title: "Asset Manager",component: AssetManagerComponent,} satisfies Meta;@@ -47,9 +48,11 @@ const AssetManagerStory = () => {}, []);return (- <div style={{ width: 400, display: "flex" }}>- <AssetManagerComponent />- </div>+ <StorySection title="Asset Manager">+ <div style={{ width: 400, display: "flex" }}>+ <AssetManagerComponent />+ </div>+ </StorySection>);};diff --git a/apps/builder/app/builder/shared/collapsible-section.stories.tsx b/apps/builder/app/builder/shared/collapsible-section.stories.tsxindex aa8c202bf8..ed9d742b5a 100644--- a/apps/builder/app/builder/shared/collapsible-section.stories.tsx+++ b/apps/builder/app/builder/shared/collapsible-section.stories.tsx@@ -1,4 +1,4 @@-import { Flex, Text } from "@webstudio-is/design-system";+import { Flex, StorySection, Text } from "@webstudio-is/design-system";import {CollapsibleSectionRoot,CollapsibleSection,@@ -12,51 +12,53 @@ export default {};export const CollapsibleSections = () => (- <Flex direction="row" gap="9">- <Flex direction="column" css={{ width: 240 }}>- <Text variant="labels" css={{ padding: 8 }}>- Independent sections- </Text>- <CollapsibleSectionRoot label="Root section">- <Text>Content inside a root section.</Text>- </CollapsibleSectionRoot>-- <CollapsibleSection label="Default section">- <Text>This section uses persisted open/close state.</Text>- </CollapsibleSection>-- <CollapsibleSectionWithAddButton- label="With add button"- onAdd={() => {}}- hasItems- >- <Text>Section with an add button in the title.</Text>- </CollapsibleSectionWithAddButton>-- <CollapsibleSectionWithAddButton- label="Empty (no items)"- onAdd={() => {}}- hasItems={false}- >- <Text>This won't appear because hasItems is false.</Text>- </CollapsibleSectionWithAddButton>- </Flex>-- <CollapsibleProvider accordion initialOpen="First">+ <StorySection title="Collapsible Sections">+ <Flex direction="row" gap="9"><Flex direction="column" css={{ width: 240 }}><Text variant="labels" css={{ padding: 8 }}>- Accordion mode+ Independent sections</Text>- <CollapsibleSection label="First">- <Text>First section content.</Text>- </CollapsibleSection>- <CollapsibleSection label="Second">- <Text>Second section content.</Text>- </CollapsibleSection>- <CollapsibleSection label="Third">- <Text>Third section content.</Text>+ <CollapsibleSectionRoot label="Root section">+ <Text>Content inside a root section.</Text>+ </CollapsibleSectionRoot>++ <CollapsibleSection label="Default section">+ <Text>This section uses persisted open/close state.</Text></CollapsibleSection>++ <CollapsibleSectionWithAddButton+ label="With add button"+ onAdd={() => {}}+ hasItems+ >+ <Text>Section with an add button in the title.</Text>+ </CollapsibleSectionWithAddButton>++ <CollapsibleSectionWithAddButton+ label="Empty (no items)"+ onAdd={() => {}}+ hasItems={false}+ >+ <Text>This won't appear because hasItems is false.</Text>+ </CollapsibleSectionWithAddButton></Flex>- </CollapsibleProvider>- </Flex>++ <CollapsibleProvider accordion initialOpen="First">+ <Flex direction="column" css={{ width: 240 }}>+ <Text variant="labels" css={{ padding: 8 }}>+ Accordion mode+ </Text>+ <CollapsibleSection label="First">+ <Text>First section content.</Text>+ </CollapsibleSection>+ <CollapsibleSection label="Second">+ <Text>Second section content.</Text>+ </CollapsibleSection>+ <CollapsibleSection label="Third">+ <Text>Third section content.</Text>+ </CollapsibleSection>+ </Flex>+ </CollapsibleProvider>+ </Flex>+ </StorySection>);diff --git a/apps/builder/app/builder/shared/css-editor/css-editor.stories.tsx b/apps/builder/app/builder/shared/css-editor/css-editor.stories.tsxindex 5667874be7..fc1aefb62e 100644--- a/apps/builder/app/builder/shared/css-editor/css-editor.stories.tsx+++ b/apps/builder/app/builder/shared/css-editor/css-editor.stories.tsx@@ -1,3 +1,4 @@+import { StorySection } from "@webstudio-is/design-system";import { CssEditor as CssEditorComponent } from "./css-editor";import type { ComputedStyleDecl } from "~/shared/style-object-model";@@ -24,17 +25,19 @@ export const CSSEditor = () => {});return (- <CssEditorComponent- declarations={declarations}- onDeleteProperty={() => undefined}- onSetProperty={() => () => undefined}- onAddDeclarations={() => undefined}- onDeleteAllDeclarations={() => undefined}- />+ <StorySection title="CSS Editor">+ <CssEditorComponent+ declarations={declarations}+ onDeleteProperty={() => undefined}+ onSetProperty={() => () => undefined}+ onAddDeclarations={() => undefined}+ onDeleteAllDeclarations={() => undefined}+ />+ </StorySection>);};export default {- title: "Style panel/CSS editor",+ title: "Style panel/CSS Editor",component: CSSEditor,};diff --git a/apps/builder/app/builder/shared/expression-editor.stories.tsx b/apps/builder/app/builder/shared/expression-editor.stories.tsxindex e431ec1cdf..dd795da83d 100644--- a/apps/builder/app/builder/shared/expression-editor.stories.tsx+++ b/apps/builder/app/builder/shared/expression-editor.stories.tsx@@ -1,9 +1,10 @@import type { Meta, StoryObj } from "@storybook/react";+import { StorySection } from "@webstudio-is/design-system";import { ExpressionEditor as ExpressionEditorComponent } from "./expression-editor";import { useState } from "react";export default {- title: "Expression editor",+ title: "Expression Editor",component: ExpressionEditorComponent,} satisfies Meta;@@ -53,11 +54,11 @@ const ExpressionStory = () => {export const ExpressionEditor: StoryObj = {render: () => (- <>+ <StorySection title="Expression Editor"><p>{`Start typing "h" or "o" or press "Tab" to start variables completion`}</p><ExpressionStory />- </>+ </StorySection>),};diff --git a/apps/builder/app/builder/shared/loading.stories.tsx b/apps/builder/app/builder/shared/loading.stories.tsxindex 9f894fb3a8..030f26b8b7 100644--- a/apps/builder/app/builder/shared/loading.stories.tsx+++ b/apps/builder/app/builder/shared/loading.stories.tsx@@ -1,4 +1,4 @@-import { Flex, Text, theme } from "@webstudio-is/design-system";+import { Flex, StorySection, Text, theme } from "@webstudio-is/design-system";import { Loading as LoadingComponent, LoadingBackground } from "./loading";export default {@@ -7,52 +7,54 @@ export default {};export const Loading = () => (- <Flex direction="column" gap="5">- <Text variant="labels">Loading at 30%</Text>- <Flex- css={{- position: "relative",- height: 200,- background: theme.colors.backgroundTopbar,- }}- >- <LoadingComponent- state={{- state: "loading",- progress: 30,- readyStates: new Map([- ["dataLoadingState", false],- ["selectedInstanceRenderState", false],- ["canvasIframeState", false],- ]),+ <StorySection title="Loading">+ <Flex direction="column" gap="5">+ <Text variant="labels">Loading at 30%</Text>+ <Flex+ css={{+ position: "relative",+ height: 200,+ background: theme.colors.backgroundTopbar,}}- />- </Flex>+ >+ <LoadingComponent+ state={{+ state: "loading",+ progress: 30,+ readyStates: new Map([+ ["dataLoadingState", false],+ ["selectedInstanceRenderState", false],+ ["canvasIframeState", false],+ ]),+ }}+ />+ </Flex>- <Text variant="labels">Loading at 80%</Text>- <Flex- css={{- position: "relative",- height: 200,- background: theme.colors.backgroundTopbar,- }}- >- <LoadingComponent- state={{- state: "loading",- progress: 80,- readyStates: new Map([- ["dataLoadingState", true],- ["selectedInstanceRenderState", true],- ["canvasIframeState", false],- ]),+ <Text variant="labels">Loading at 80%</Text>+ <Flex+ css={{+ position: "relative",+ height: 200,+ background: theme.colors.backgroundTopbar,}}- />- </Flex>+ >+ <LoadingComponent+ state={{+ state: "loading",+ progress: 80,+ readyStates: new Map([+ ["dataLoadingState", true],+ ["selectedInstanceRenderState", true],+ ["canvasIframeState", false],+ ]),+ }}+ />+ </Flex>- <Text variant="labels">Background overlay (visible)</Text>- <Flex css={{ position: "relative", height: 100 }}>- <LoadingBackground show />+ <Text variant="labels">Background overlay (visible)</Text>+ <Flex css={{ position: "relative", height: 100 }}>+ <LoadingBackground show />+ </Flex></Flex>- </Flex>+ </StorySection>);diff --git a/apps/builder/app/builder/shared/relative-time.stories.tsx b/apps/builder/app/builder/shared/relative-time.stories.tsxindex ec6b7eafcc..618dfa78bb 100644--- a/apps/builder/app/builder/shared/relative-time.stories.tsx+++ b/apps/builder/app/builder/shared/relative-time.stories.tsx@@ -1,8 +1,8 @@-import { Flex, Text } from "@webstudio-is/design-system";+import { Flex, StorySection, Text } from "@webstudio-is/design-system";import { RelativeTime as RelativeTimeComponent } from "./relative-time";export default {- title: "Builder/Shared/Relative time",+ title: "Builder/Shared/Relative Time",component: RelativeTimeComponent,};@@ -17,17 +17,19 @@ export const RelativeTime = () => {];return (- <Flex direction="column" gap="2">- {times.map(({ label, date }) => (- <Flex key={label} gap="3" align="center">- <Text variant="labels" css={{ width: 120 }}>- {label}:- </Text>- <Text>- <RelativeTimeComponent time={date} />- </Text>- </Flex>- ))}- </Flex>+ <StorySection title="Relative Time">+ <Flex direction="column" gap="2">+ {times.map(({ label, date }) => (+ <Flex key={label} gap="3" align="center">+ <Text variant="labels" css={{ width: 120 }}>+ {label}:+ </Text>+ <Text>+ <RelativeTimeComponent time={date} />+ </Text>+ </Flex>+ ))}+ </Flex>+ </StorySection>);};diff --git a/apps/builder/app/builder/shared/topbar-layout.stories.tsx b/apps/builder/app/builder/shared/topbar-layout.stories.tsxindex d9ea6fc6d9..06f46251f7 100644--- a/apps/builder/app/builder/shared/topbar-layout.stories.tsx+++ b/apps/builder/app/builder/shared/topbar-layout.stories.tsx@@ -2,6 +2,7 @@ import {Button,Flex,rawTheme,+ StorySection,theme,ToolbarButton,Text,@@ -77,71 +78,73 @@ export const TopbarLayouts = () => {$queueStatus.set({ status: "failed" });$authPermit.set("view");return (- <Flex direction="column" gap="5">- <Text variant="labels">Default</Text>- <TopbarLayout- menu={<MenuPlaceholder />}- left={<PagePlaceholder />}- center={<BreakpointsPlaceholder />}- right={- <>- <Button color="gradient">Share</Button>- <Button color="positive">Publish</Button>- </>- }- />- <Text variant="labels">With indicators</Text>- <TopbarLayout- menu={<MenuPlaceholder />}- left={<PagePlaceholder />}- center={<BreakpointsPlaceholder />}- right={- <>- <SafeModeIndicator />- <ViewModeIndicator />- <SyncErrorIndicator />- <Button color="gradient">Share</Button>- <Button color="positive">Publish</Button>- <Link- data-state="auto"- className={buttonStyle({ color: "positive" })}- color="contrast"- href="#"- underline="none"- >- Clone- </Link>- </>- }- />- <Text variant="labels">Menu only</Text>- <TopbarLayout menu={<MenuPlaceholder />} />- <Text variant="labels">Sync failed</Text>- <TopbarLayout- menu={<MenuPlaceholder />}- left={<PagePlaceholder />}- center={<BreakpointsPlaceholder />}- right={- <>- <SyncStatus />- <Button color="gradient">Share</Button>- <Button color="positive">Publish</Button>- </>- }- />- <Text variant="labels">View mode</Text>- <TopbarLayout- menu={<MenuPlaceholder />}- left={<PagePlaceholder />}- center={<BreakpointsPlaceholder />}- right={- <>- <ViewMode />- <Button color="gradient">Share</Button>- <Button color="positive">Publish</Button>- </>- }- />- </Flex>+ <StorySection title="Topbar Layouts">+ <Flex direction="column" gap="5">+ <Text variant="labels">Default</Text>+ <TopbarLayout+ menu={<MenuPlaceholder />}+ left={<PagePlaceholder />}+ center={<BreakpointsPlaceholder />}+ right={+ <>+ <Button color="gradient">Share</Button>+ <Button color="positive">Publish</Button>+ </>+ }+ />+ <Text variant="labels">With indicators</Text>+ <TopbarLayout+ menu={<MenuPlaceholder />}+ left={<PagePlaceholder />}+ center={<BreakpointsPlaceholder />}+ right={+ <>+ <SafeModeIndicator />+ <ViewModeIndicator />+ <SyncErrorIndicator />+ <Button color="gradient">Share</Button>+ <Button color="positive">Publish</Button>+ <Link+ data-state="auto"+ className={buttonStyle({ color: "positive" })}+ color="contrast"+ href="#"+ underline="none"+ >+ Clone+ </Link>+ </>+ }+ />+ <Text variant="labels">Menu only</Text>+ <TopbarLayout menu={<MenuPlaceholder />} />+ <Text variant="labels">Sync failed</Text>+ <TopbarLayout+ menu={<MenuPlaceholder />}+ left={<PagePlaceholder />}+ center={<BreakpointsPlaceholder />}+ right={+ <>+ <SyncStatus />+ <Button color="gradient">Share</Button>+ <Button color="positive">Publish</Button>+ </>+ }+ />+ <Text variant="labels">View mode</Text>+ <TopbarLayout+ menu={<MenuPlaceholder />}+ left={<PagePlaceholder />}+ center={<BreakpointsPlaceholder />}+ right={+ <>+ <ViewMode />+ <Button color="gradient">Share</Button>+ <Button color="positive">Publish</Button>+ </>+ }+ />+ </Flex>+ </StorySection>);};diff --git a/apps/builder/app/canvas/features/text-editor/text-editor.stories.tsx b/apps/builder/app/canvas/features/text-editor/text-editor.stories.tsxindex 7688ea5aea..f2c0f75da7 100644--- a/apps/builder/app/canvas/features/text-editor/text-editor.stories.tsx+++ b/apps/builder/app/canvas/features/text-editor/text-editor.stories.tsx@@ -3,7 +3,7 @@ import { useStore } from "@nanostores/react";import { ContentEditable } from "@lexical/react/LexicalContentEditable";import type { StoryFn, Meta } from "@storybook/react";import { action } from "@storybook/addon-actions";-import { Box, Button, Flex } from "@webstudio-is/design-system";+import { Box, Button, Flex, StorySection } from "@webstudio-is/design-system";import { theme } from "@webstudio-is/design-system";import type { Instance, Instances, Props } from "@webstudio-is/sdk";import { $, renderData } from "@webstudio-is/template";@@ -60,94 +60,96 @@ const instances: Instances = new Map([const props: Props = new Map();-export const Basic: StoryFn<typeof TextEditor> = ({ onChange }) => {+export const Basic: StoryFn<typeof TextEditor> = () => {const state = useStore($textToolbar);useEffect(subscribeCommands, []);return (- <div>- <button- disabled={state == null}- style={{ fontWeight: state?.isBold ? "bold" : "normal" }}- onClick={(event) => {- event.preventDefault();- emitCommand("formatBold");- }}- >- Bold- </button>- <button- disabled={state == null}- style={{ fontWeight: state?.isItalic ? "bold" : "normal" }}- onClick={() => emitCommand("formatItalic")}- >- Italic- </button>- <button- disabled={state == null}- style={{ fontWeight: state?.isSuperscript ? "bold" : "normal" }}- onClick={() => emitCommand("formatSuperscript")}- >- Superscript- </button>- <button- disabled={state == null}- style={{ fontWeight: state?.isSubscript ? "bold" : "normal" }}- onClick={() => emitCommand("formatSubscript")}- >- Subscript- </button>- <button- disabled={state == null}- style={{ fontWeight: state?.isLink ? "bold" : "normal" }}- onClick={() => emitCommand("formatLink")}- >- Link- </button>- <button- disabled={state == null}- style={{ fontWeight: state?.isSpan ? "bold" : "normal" }}- onClick={() => emitCommand("formatSpan")}- >- Span- </button>- <button- disabled={state == null}- style={{ fontWeight: "normal" }}- onClick={() => emitCommand("formatClear")}- >- Clear- </button>- <Box- css={{- "& > div": {- padding: `0 ${theme.spacing[5]}`,- border: "1px solid #999",- color: "black",- },- }}- >- <TextEditor- rootInstanceSelector={["1"]}- instances={instances}- props={props}- contentEditable={<ContentEditable />}- onChange={onChange}- onSelectInstance={(instanceId) =>- console.info("select instance", instanceId)- }- />- </Box>- </div>+ <StorySection title="Basic">+ <div>+ <button+ disabled={state == null}+ style={{ fontWeight: state?.isBold ? "bold" : "normal" }}+ onClick={(event) => {+ event.preventDefault();+ emitCommand("formatBold");+ }}+ >+ Bold+ </button>+ <button+ disabled={state == null}+ style={{ fontWeight: state?.isItalic ? "bold" : "normal" }}+ onClick={() => emitCommand("formatItalic")}+ >+ Italic+ </button>+ <button+ disabled={state == null}+ style={{ fontWeight: state?.isSuperscript ? "bold" : "normal" }}+ onClick={() => emitCommand("formatSuperscript")}+ >+ Superscript+ </button>+ <button+ disabled={state == null}+ style={{ fontWeight: state?.isSubscript ? "bold" : "normal" }}+ onClick={() => emitCommand("formatSubscript")}+ >+ Subscript+ </button>+ <button+ disabled={state == null}+ style={{ fontWeight: state?.isLink ? "bold" : "normal" }}+ onClick={() => emitCommand("formatLink")}+ >+ Link+ </button>+ <button+ disabled={state == null}+ style={{ fontWeight: state?.isSpan ? "bold" : "normal" }}+ onClick={() => emitCommand("formatSpan")}+ >+ Span+ </button>+ <button+ disabled={state == null}+ style={{ fontWeight: "normal" }}+ onClick={() => emitCommand("formatClear")}+ >+ Clear+ </button>+ <Box+ css={{+ "& > div": {+ padding: `0 ${theme.spacing[5]}`,+ border: "1px solid #999",+ color: "black",+ },+ }}+ >+ <TextEditor+ rootInstanceSelector={["1"]}+ instances={instances}+ props={props}+ contentEditable={<ContentEditable />}+ onChange={action("onChange")}+ onSelectInstance={(instanceId) =>+ console.info("select instance", instanceId)+ }+ />+ </Box>+ </div>+ </StorySection>);};-export const CursorPositioning: StoryFn<typeof TextEditor> = ({ onChange }) => {+export const CursorPositioning: StoryFn<typeof TextEditor> = () => {const textEditingInstanceSelector = useStore($textEditingInstanceSelector);return (- <>+ <StorySection title="Cursor Positioning"><Boxcss={{width: 300,@@ -181,7 +183,7 @@ export const CursorPositioning: StoryFn<typeof TextEditor> = ({ onChange }) => {instances={instances}props={props}contentEditable={<ContentEditable />}- onChange={onChange}+ onChange={action("onChange")}onSelectInstance={(instanceId) =>console.info("select instance", instanceId)}@@ -212,7 +214,7 @@ export const CursorPositioning: StoryFn<typeof TextEditor> = ({ onChange }) => {Reset</Button>)}- </>+ </StorySection>);};@@ -271,7 +273,7 @@ export const CursorPositioningUpDown: StoryFn<typeof TextEditor> = () => {const textEditingInstanceSelector = useStore($textEditingInstanceSelector);return (- <>+ <StorySection title="Cursor Positioning Up Down"><Flexgap={2}direction={"column"}@@ -347,14 +349,6 @@ export const CursorPositioningUpDown: StoryFn<typeof TextEditor> = () => {</Flex><br /><i>Use arrows to move between editors, clicks are not working</i>- </>+ </StorySection>);};--Basic.args = {- onChange: action("onChange"),-};--CursorPositioning.args = {- onChange: action("onChange"),-};diff --git a/apps/builder/app/dashboard/dashboard.stories.tsx b/apps/builder/app/dashboard/dashboard.stories.tsxindex 4f162e15cd..d419f77908 100644--- a/apps/builder/app/dashboard/dashboard.stories.tsx+++ b/apps/builder/app/dashboard/dashboard.stories.tsx@@ -1,7 +1,13 @@import type { StoryFn } from "@storybook/react";import type { JSX } from "react";import { createMemoryRouter, RouterProvider } from "react-router-dom";-import { Box, Flex, Text, theme } from "@webstudio-is/design-system";+import {+ Box,+ Flex,+ StorySection,+ Text,+ theme,+} from "@webstudio-is/design-system";import { Dashboard, DashboardSetup } from "./dashboard";import { Card as CardComponent, CardContent, CardFooter } from "./shared/card";import { ThumbnailWithAbbr, ThumbnailLinkWithAbbr } from "./shared/thumbnail";@@ -75,7 +81,11 @@ export const Welcome: StoryFn<typeof Dashboard> = () => {</>,"/dashboard/templates");- return <RouterProvider router={router} />;+ return (+ <StorySection title="Welcome">+ <RouterProvider router={router} />+ </StorySection>+ );};export const Projects: StoryFn<typeof Dashboard> = () => {@@ -86,7 +96,11 @@ export const Projects: StoryFn<typeof Dashboard> = () => {</>,"/dashboard");- return <RouterProvider router={router} />;+ return (+ <StorySection title="Projects">+ <RouterProvider router={router} />+ </StorySection>+ );};export const Templates: StoryFn<typeof Dashboard> = () => {@@ -97,7 +111,11 @@ export const Templates: StoryFn<typeof Dashboard> = () => {</>,"/dashboard/templates");- return <RouterProvider router={router} />;+ return (+ <StorySection title="Templates">+ <RouterProvider router={router} />+ </StorySection>+ );};export const Search: StoryFn<typeof Dashboard> = () => {@@ -110,7 +128,11 @@ export const Search: StoryFn<typeof Dashboard> = () => {"/dashboard/search?q=my");- return <RouterProvider router={router} />;+ return (+ <StorySection title="Search">+ <RouterProvider router={router} />+ </StorySection>+ );};export const SearchNothingFound: StoryFn<typeof Dashboard> = () => {@@ -122,50 +144,58 @@ export const SearchNothingFound: StoryFn<typeof Dashboard> = () => {"/dashboard/search","/dashboard/search?q=notfound");- return <RouterProvider router={router} />;+ return (+ <StorySection title="Search Nothing Found">+ <RouterProvider router={router} />+ </StorySection>+ );};export const Card = () => (- <Flex gap="3" wrap="wrap" align="start">- <Box css={{ width: theme.spacing[30] }}>- <CardComponent>- <CardContent- css={{ background: theme.colors.brandBackgroundProjectCardFront }}- />- <CardFooter>- <Text truncate>My project</Text>- </CardFooter>- </CardComponent>- </Box>- <Box css={{ width: theme.spacing[30] }}>- <CardComponent aria-selected={true}>- <CardContent- css={{ background: theme.colors.brandBackgroundProjectCardFront }}- />- <CardFooter>- <Text truncate>Selected project</Text>- </CardFooter>- </CardComponent>- </Box>- {["Project Alpha", "My Website", "Landing Page"].map((title) => (- <Box key={title} css={{ width: theme.spacing[30] }}>+ <StorySection title="Card">+ <Flex gap="3" wrap="wrap" align="start">+ <Box css={{ width: theme.spacing[30] }}><CardComponent><CardContentcss={{ background: theme.colors.brandBackgroundProjectCardFront }}/><CardFooter>- <Text truncate>{title}</Text>+ <Text truncate>My project</Text>+ </CardFooter>+ </CardComponent>+ </Box>+ <Box css={{ width: theme.spacing[30] }}>+ <CardComponent aria-selected={true}>+ <CardContent+ css={{ background: theme.colors.brandBackgroundProjectCardFront }}+ />+ <CardFooter>+ <Text truncate>Selected project</Text></CardFooter></CardComponent></Box>- ))}- </Flex>+ {["Project Alpha", "My Website", "Landing Page"].map((title) => (+ <Box key={title} css={{ width: theme.spacing[30] }}>+ <CardComponent>+ <CardContent+ css={{ background: theme.colors.brandBackgroundProjectCardFront }}+ />+ <CardFooter>+ <Text truncate>{title}</Text>+ </CardFooter>+ </CardComponent>+ </Box>+ ))}+ </Flex>+ </StorySection>);export const Thumbnails = () => (- <Flex gap="3">- <ThumbnailWithAbbr title="My Next Project" onClick={() => {}} />- <ThumbnailLinkWithAbbr title="Landing Page" to="#" />- <ThumbnailWithAbbr title="Portfolio" onClick={() => {}} />- </Flex>+ <StorySection title="Thumbnails">+ <Flex gap="3">+ <ThumbnailWithAbbr title="My Next Project" onClick={() => {}} />+ <ThumbnailLinkWithAbbr title="Landing Page" to="#" />+ <ThumbnailWithAbbr title="Portfolio" onClick={() => {}} />+ </Flex>+ </StorySection>);diff --git a/apps/builder/app/shared/code-editor.stories.tsx b/apps/builder/app/shared/code-editor.stories.tsxindex 807223d13d..082ab00fe2 100644--- a/apps/builder/app/shared/code-editor.stories.tsx+++ b/apps/builder/app/shared/code-editor.stories.tsx@@ -1,11 +1,11 @@import { useState } from "react";-import type { Meta } from "@storybook/react";+import { StorySection } from "@webstudio-is/design-system";import { CodeEditor as CodeEditorComponent } from "./code-editor";export default {title: "Code editor",component: CodeEditorComponent,-} satisfies Meta;+};const initialHtml = `<div>@@ -16,7 +16,7 @@ const initialHtml = `</script>`.trim();-export const BaseEditor = () => {+const BaseEditorDemo = () => {const [value, setValue] = useState(initialHtml);return (<CodeEditorComponent@@ -27,7 +27,7 @@ export const BaseEditor = () => {);};-export const HtmlEditor = () => {+const HtmlEditorDemo = () => {const [value, setValue] = useState(initialHtml);return (<CodeEditorComponent@@ -38,3 +38,14 @@ export const HtmlEditor = () => {/>);};++export const CodeEditor = () => (+ <>+ <StorySection title="Base editor">+ <BaseEditorDemo />+ </StorySection>+ <StorySection title="HTML editor">+ <HtmlEditorDemo />+ </StorySection>+ </>+);diff --git a/apps/builder/app/shared/copy-to-clipboard.stories.tsx b/apps/builder/app/shared/copy-to-clipboard.stories.tsxindex 35049fc2a8..e770d1436c 100644--- a/apps/builder/app/shared/copy-to-clipboard.stories.tsx+++ b/apps/builder/app/shared/copy-to-clipboard.stories.tsx@@ -1,22 +1,24 @@-import { Button, Flex } from "@webstudio-is/design-system";+import { Button, Flex, StorySection } from "@webstudio-is/design-system";import { CopyToClipboard as CopyToClipboardComponent } from "./copy-to-clipboard";export default {- title: "Copy to clipboard",+ title: "Copy To Clipboard",component: CopyToClipboardComponent,};export const CopyToClipboard = () => (- <Flex gap="3">- <CopyToClipboardComponent text="Hello, world!">- <Button>Click to copy</Button>- </CopyToClipboardComponent>- <CopyToClipboardComponent- text="some-secret-token-123"- copyText="Copy token"- copiedText="Token copied!"- >- <Button>Copy token</Button>- </CopyToClipboardComponent>- </Flex>+ <StorySection title="Copy To Clipboard">+ <Flex gap="3">+ <CopyToClipboardComponent text="Hello, world!">+ <Button>Click to copy</Button>+ </CopyToClipboardComponent>+ <CopyToClipboardComponent+ text="some-secret-token-123"+ copyText="Copy token"+ copiedText="Token copied!"+ >+ <Button>Copy token</Button>+ </CopyToClipboardComponent>+ </Flex>+ </StorySection>);diff --git a/apps/builder/app/shared/dom-utils.stories.tsx b/apps/builder/app/shared/dom-utils.stories.tsxindex 390f48b729..8ad237eb07 100644--- a/apps/builder/app/shared/dom-utils.stories.tsx+++ b/apps/builder/app/shared/dom-utils.stories.tsx@@ -1,3 +1,4 @@+import { StorySection } from "@webstudio-is/design-system";import { scrollIntoView } from "./dom-utils";export default {@@ -21,42 +22,44 @@ const handleClick = (selector: string) => {const ToolbarStory = () => {return (- <div>- <button onClick={() => handleClick(".element")}>- Test Scroll Into Scrollable- </button>- <button onClick={() => handleClick(".viewport")}>- Test Scroll Into Viewport- </button>- <h1- style={{- marginTop: "1000px",- }}- >- Viewport Matrix Fiztures- </h1>- <div- style={{- marginTop: "20px",- width: "200px",- height: "200px",- overflow: "auto",- }}- >- <h1 style={{ marginTop: "2400px" }} className="element">- Inside scrollable+ <StorySection title="Toolbar">+ <div>+ <button onClick={() => handleClick(".element")}>+ Test Scroll Into Scrollable+ </button>+ <button onClick={() => handleClick(".viewport")}>+ Test Scroll Into Viewport+ </button>+ <h1+ style={{+ marginTop: "1000px",+ }}+ >+ Viewport Matrix Fiztures</h1>+ <div+ style={{+ marginTop: "20px",+ width: "200px",+ height: "200px",+ overflow: "auto",+ }}+ >+ <h1 style={{ marginTop: "2400px" }} className="element">+ Inside scrollable+ </h1>+ <div style={{ height: "1000px" }}></div>+ </div>+ <h2 className="viewport">Inside viewport</h2><div style={{ height: "1000px" }}></div>+ <button onClick={() => handleClick(".element")}>+ Test Scroll Into Scrollable+ </button>+ <button onClick={() => handleClick(".viewport")}>+ Test Scroll Into Viewport+ </button></div>- <h2 className="viewport">Inside viewport</h2>- <div style={{ height: "1000px" }}></div>- <button onClick={() => handleClick(".element")}>- Test Scroll Into Scrollable- </button>- <button onClick={() => handleClick(".viewport")}>- Test Scroll Into Viewport- </button>- </div>+ </StorySection>);};diff --git a/apps/builder/app/shared/error/error-message.stories.tsx b/apps/builder/app/shared/error/error-message.stories.tsxindex cc7ea44aa1..a0960b3b20 100644--- a/apps/builder/app/shared/error/error-message.stories.tsx+++ b/apps/builder/app/shared/error/error-message.stories.tsx@@ -1,35 +1,37 @@-import { Flex } from "@webstudio-is/design-system";+import { Flex, StorySection } from "@webstudio-is/design-system";import { ErrorMessage as ErrorMessageComponent } from "./error-message.client";export default {- title: "Error message",+ title: "Error Message",component: ErrorMessageComponent,};export const ErrorMessage = () => (- <Flex direction="column" gap="9">- <ErrorMessageComponent- error={{- status: 404,- statusText: "Not Found",- message: "The page you're looking for doesn't exist.",- }}- />- <ErrorMessageComponent- error={{- status: 500,- statusText: "Internal Server Error",- message: "Something went wrong on our end.",- description:- "Please try again later or contact support if the problem persists.",- }}- />- <ErrorMessageComponent- error={{- status: 403,- statusText: "Forbidden",- message: "You don't have permission to access this resource.",- }}- />- </Flex>+ <StorySection title="Error Message">+ <Flex direction="column" gap="9">+ <ErrorMessageComponent+ error={{+ status: 404,+ statusText: "Not Found",+ message: "The page you're looking for doesn't exist.",+ }}+ />+ <ErrorMessageComponent+ error={{+ status: 500,+ statusText: "Internal Server Error",+ message: "Something went wrong on our end.",+ description:+ "Please try again later or contact support if the problem persists.",+ }}+ />+ <ErrorMessageComponent+ error={{+ status: 403,+ statusText: "Forbidden",+ message: "You don't have permission to access this resource.",+ }}+ />+ </Flex>+ </StorySection>);diff --git a/apps/builder/app/shared/project-settings/import-redirects-dialog.stories.tsx b/apps/builder/app/shared/project-settings/import-redirects-dialog.stories.tsxindex fe594f6778..2db4066c72 100644--- a/apps/builder/app/shared/project-settings/import-redirects-dialog.stories.tsx+++ b/apps/builder/app/shared/project-settings/import-redirects-dialog.stories.tsx@@ -1,18 +1,21 @@+import { StorySection } from "@webstudio-is/design-system";import { ImportRedirectsDialog as ImportRedirectsDialogComponent } from "./import-redirects-dialog";export default {- title: "Builder/Project settings/Import redirects dialog",+ title: "Builder/Project settings/Import Redirects Dialog",component: ImportRedirectsDialogComponent,};export const ImportRedirectsDialog = () => (- <ImportRedirectsDialogComponent- isOpen={true}- onOpenChange={() => {}}- existingRedirects={[- { old: "/old-page", new: "/new-page", status: "301" },- { old: "/blog/2023", new: "/blog/archive", status: "302" },- ]}- onImport={() => {}}- />+ <StorySection title="Import Redirects Dialog">+ <ImportRedirectsDialogComponent+ isOpen={true}+ onOpenChange={() => {}}+ existingRedirects={[+ { old: "/old-page", new: "/new-page", status: "301" },+ { old: "/blog/2023", new: "/blog/archive", status: "302" },+ ]}+ onImport={() => {}}+ />+ </StorySection>);diff --git a/apps/builder/app/shared/project-settings/project-settings.stories.tsx b/apps/builder/app/shared/project-settings/project-settings.stories.tsxindex e541fed723..220935a3b9 100644--- a/apps/builder/app/shared/project-settings/project-settings.stories.tsx+++ b/apps/builder/app/shared/project-settings/project-settings.stories.tsx@@ -1,5 +1,6 @@import type { JSX } from "react";import { createBrowserRouter, RouterProvider } from "react-router-dom";+import { StorySection } from "@webstudio-is/design-system";import { ProjectSettingsDialog } from "./project-settings";import { $pages, $project } from "~/shared/sync/data-stores";import type { Project } from "@webstudio-is/project";@@ -24,7 +25,11 @@ export const General = () => {const router = createRouter(<ProjectSettingsDialog currentSection="general" />);- return <RouterProvider router={router} />;+ return (+ <StorySection title="General">+ <RouterProvider router={router} />+ </StorySection>+ );};export const Redirects = () => {@@ -53,5 +58,9 @@ export const Redirects = () => {const router = createRouter(<ProjectSettingsDialog currentSection="redirects" />);- return <RouterProvider router={router} />;+ return (+ <StorySection title="Redirects">+ <RouterProvider router={router} />+ </StorySection>+ );};diff --git a/apps/builder/app/shared/share-project/share-project.stories.tsx b/apps/builder/app/shared/share-project/share-project.stories.tsxindex 9841be303a..776fba0ce2 100644--- a/apps/builder/app/shared/share-project/share-project.stories.tsx+++ b/apps/builder/app/shared/share-project/share-project.stories.tsx@@ -4,6 +4,7 @@ import {Popover,PopoverContent,PopoverTrigger,+ StorySection,} from "@webstudio-is/design-system";import { useEffect, useState } from "react";import { nanoid } from "nanoid";@@ -13,7 +14,7 @@ import {} from "./share-project";export default {- title: "Share project",+ title: "Share Project",component: ShareProjectComponent,};@@ -121,8 +122,10 @@ const ShareProjectPopover = ({};export const ShareProject = () => (- <Flex gap="9" css={{ padding: 100 }}>- <ShareProjectPopover label="Empty" />- <ShareProjectPopover label="With Links" linkOptions={initialLinks} />- </Flex>+ <StorySection title="Share Project">+ <Flex gap="9" css={{ padding: 100 }}>+ <ShareProjectPopover label="Empty" />+ <ShareProjectPopover label="With Links" linkOptions={initialLinks} />+ </Flex>+ </StorySection>);diff --git a/packages/css-engine/package.json b/packages/css-engine/package.jsonindex 6384988b9e..ec3d83e2b8 100644--- a/packages/css-engine/package.json+++ b/packages/css-engine/package.json@@ -19,6 +19,7 @@"devDependencies": {"@types/react": "^18.2.70","@types/react-dom": "^18.2.25",+ "@webstudio-is/design-system": "workspace:*","@webstudio-is/tsconfig": "workspace:*","react": "18.3.0-canary-14898b6a9-20240318","react-dom": "18.3.0-canary-14898b6a9-20240318",diff --git a/packages/css-engine/src/core/css-engine.stories.tsx b/packages/css-engine/src/core/css-engine.stories.tsxindex dd3e30fc68..e4f6675a27 100644--- a/packages/css-engine/src/core/css-engine.stories.tsx+++ b/packages/css-engine/src/core/css-engine.stories.tsx@@ -1,7 +1,8 @@import { createRegularStyleSheet } from "./create-style-sheet";+import { StorySection } from "@webstudio-is/design-system";export default {- title: "CSS engine",+ title: "CSS Engine",component: "CssEngine",};@@ -20,7 +21,7 @@ export const CSSEngine = () => {});sheet.render();return (- <>+ <StorySection title="CSS Engine"><div className="test">Should be red</div><buttononClick={() => {@@ -49,6 +50,6 @@ export const CSSEngine = () => {>Add rule with yellow background</button>- </>+ </StorySection>);};diff --git a/packages/css-engine/tsconfig.json b/packages/css-engine/tsconfig.jsonindex d2e5040f8f..0c8d2e7907 100644--- a/packages/css-engine/tsconfig.json+++ b/packages/css-engine/tsconfig.json@@ -1,3 +1,4 @@{- "extends": "@webstudio-is/tsconfig/base.json"+ "extends": "@webstudio-is/tsconfig/base.json",+ "include": ["**/*.ts", "**/*.tsx", "../../@types/**/*.d.ts"]}diff --git a/packages/design-system/src/components/__DEPRECATED__/list.stories.tsx b/packages/design-system/src/components/__DEPRECATED__/list.stories.tsxindex b8dada4f52..c6c8b236ed 100644--- a/packages/design-system/src/components/__DEPRECATED__/list.stories.tsx+++ b/packages/design-system/src/components/__DEPRECATED__/list.stories.tsx@@ -1,35 +1,14 @@-import type { StoryFn } from "@storybook/react";import { CheckMarkIcon, EllipsesIcon } from "@webstudio-is/icons";import { useState } from "react";import { DeprecatedList, DeprecatedListItem, useDeprecatedList } from "./list";+import { StorySection } from "../storybook";export default {title: "Deprecated/List",component: DeprecatedList,};-export const Declarative: StoryFn<typeof DeprecatedList> = () => {- return (- <DeprecatedList>- <DeprecatedListItem>Apple</DeprecatedListItem>- <DeprecatedListItem state="disabled">Banana</DeprecatedListItem>- <DeprecatedListItem state="selected">Orange</DeprecatedListItem>- <DeprecatedListItem prefix={<CheckMarkIcon />} suffix={<EllipsesIcon />}>- Strawberry- </DeprecatedListItem>- <DeprecatedListItem- prefix={<CheckMarkIcon />}- suffix={<EllipsesIcon />}- current- state="selected"- >- Watermelon- </DeprecatedListItem>- </DeprecatedList>- );-};--export const WithHook: StoryFn<typeof DeprecatedList> = () => {+export const List = () => {const items = ["Banana", "Orange", "Apple"];const [selectedIndex, setSelectedIndex] = useState(-1);const [currentIndex, setCurrentIndex] = useState(-1);@@ -40,44 +19,73 @@ export const WithHook: StoryFn<typeof DeprecatedList> = () => {onSelect: setSelectedIndex,onChangeCurrent: setCurrentIndex,});+return (- <DeprecatedList {...getListProps()}>- {items.map((item, index) => {- const itemProps = getItemProps({ index });- return (+ <>+ <StorySection title="Declarative">+ <DeprecatedList>+ <DeprecatedListItem>Apple</DeprecatedListItem>+ <DeprecatedListItem state="disabled">Banana</DeprecatedListItem>+ <DeprecatedListItem state="selected">Orange</DeprecatedListItem><DeprecatedListItem- {...itemProps}- key={index}- prefix={itemProps.current ? <CheckMarkIcon /> : undefined}+ prefix={<CheckMarkIcon />}+ suffix={<EllipsesIcon />}>- {item}+ Strawberry</DeprecatedListItem>- );- })}- </DeprecatedList>- );-};+ <DeprecatedListItem+ prefix={<CheckMarkIcon />}+ suffix={<EllipsesIcon />}+ current+ state="selected"+ >+ Watermelon+ </DeprecatedListItem>+ </DeprecatedList>+ </StorySection>-export const CurrentWithoutSelected: StoryFn<typeof DeprecatedList> = () => (- <DeprecatedList>- <DeprecatedListItem>Regular item</DeprecatedListItem>- <DeprecatedListItem current>Current but not selected</DeprecatedListItem>- <DeprecatedListItem prefix={<CheckMarkIcon />}>- With prefix only- </DeprecatedListItem>- </DeprecatedList>-);+ <StorySection title="With hook">+ <DeprecatedList {...getListProps()}>+ {items.map((item, index) => {+ const itemProps = getItemProps({ index });+ return (+ <DeprecatedListItem+ {...itemProps}+ key={index}+ prefix={itemProps.current ? <CheckMarkIcon /> : undefined}+ >+ {item}+ </DeprecatedListItem>+ );+ })}+ </DeprecatedList>+ </StorySection>-export const SuffixOnly: StoryFn<typeof DeprecatedList> = () => (- <DeprecatedList>- <DeprecatedListItem suffix={<EllipsesIcon />}>- Item with suffix- </DeprecatedListItem>- <DeprecatedListItem suffix={<EllipsesIcon />} state="selected">- Selected with suffix- </DeprecatedListItem>- <DeprecatedListItem suffix={<EllipsesIcon />} state="disabled">- Disabled with suffix- </DeprecatedListItem>- </DeprecatedList>-);+ <StorySection title="Current without selected">+ <DeprecatedList>+ <DeprecatedListItem>Regular item</DeprecatedListItem>+ <DeprecatedListItem current>+ Current but not selected+ </DeprecatedListItem>+ <DeprecatedListItem prefix={<CheckMarkIcon />}>+ With prefix only+ </DeprecatedListItem>+ </DeprecatedList>+ </StorySection>++ <StorySection title="Suffix only">+ <DeprecatedList>+ <DeprecatedListItem suffix={<EllipsesIcon />}>+ Item with suffix+ </DeprecatedListItem>+ <DeprecatedListItem suffix={<EllipsesIcon />} state="selected">+ Selected with suffix+ </DeprecatedListItem>+ <DeprecatedListItem suffix={<EllipsesIcon />} state="disabled">+ Disabled with suffix+ </DeprecatedListItem>+ </DeprecatedList>+ </StorySection>+ </>+ );+};diff --git a/packages/design-system/src/components/avatar.stories.tsx b/packages/design-system/src/components/avatar.stories.tsxindex cd88023e78..38f2d2f823 100644--- a/packages/design-system/src/components/avatar.stories.tsx+++ b/packages/design-system/src/components/avatar.stories.tsx@@ -1,5 +1,6 @@import { Flex } from "./flex";import { Avatar as AvatarComponent } from "./avatar";+import { StorySection } from "./storybook";export default {title: "Avatar",@@ -15,29 +16,33 @@ const avatarImage = `data:image/svg+xml,${encodeURIComponent()}`;export const Avatar = () => (- <Flex gap="3" align="center">- <AvatarComponent src={avatarImage} alt="User avatar" fallback="JD" />- <AvatarComponent fallback="JD" />- <AvatarComponent fallback="AB" />- <AvatarComponent fallback="WS" />- </Flex>-);+ <>+ <StorySection title="With image and fallback">+ <Flex gap="3" align="center">+ <AvatarComponent src={avatarImage} alt="User avatar" fallback="JD" />+ <AvatarComponent fallback="JD" />+ <AvatarComponent fallback="AB" />+ <AvatarComponent fallback="WS" />+ </Flex>+ </StorySection>-export const AvatarFallbackVariants = () => (- <Flex gap="3" align="center">- <AvatarComponent fallback="A" />- <AvatarComponent fallback="JD" />- <AvatarComponent fallback="WEB" />- </Flex>-);+ <StorySection title="Fallback variants">+ <Flex gap="3" align="center">+ <AvatarComponent fallback="A" />+ <AvatarComponent fallback="JD" />+ <AvatarComponent fallback="WEB" />+ </Flex>+ </StorySection>-export const AvatarBrokenImage = () => (- <Flex gap="3" align="center">- <AvatarComponent- src="https://broken-url.invalid/avatar.png"- fallback="FB"- alt="Broken image avatar"- />- <AvatarComponent fallback="OK" alt="No image avatar" />- </Flex>+ <StorySection title="Broken image">+ <Flex gap="3" align="center">+ <AvatarComponent+ src="https://broken-url.invalid/avatar.png"+ fallback="FB"+ alt="Broken image avatar"+ />+ <AvatarComponent fallback="OK" alt="No image avatar" />+ </Flex>+ </StorySection>+ </>);diff --git a/packages/design-system/src/components/button.stories.tsx b/packages/design-system/src/components/button.stories.tsxindex e878f99c4c..7e952e256b 100644--- a/packages/design-system/src/components/button.stories.tsx+++ b/packages/design-system/src/components/button.stories.tsx@@ -1,5 +1,5 @@import type { ComponentProps } from "react";-import { EllipsesIcon, XIcon, TrashIcon } from "@webstudio-is/icons";+import { TrashIcon } from "@webstudio-is/icons";import { Button as ButtonComponent } from "./button";import { Popover, PopoverContent, PopoverTrigger } from "./popover";import { Text } from "./text";@@ -10,13 +10,6 @@ export default {title: "Button",};-const iconsMap = {- undefined: undefined,- "<EllipsesIcon>": <EllipsesIcon />,- "<XIcon>": <XIcon />,- "<TrashIcon>": <TrashIcon />,-} as const;-const colors: ReadonlyArray<ComponentProps<typeof ButtonComponent>["color"]> = ["primary","neutral",@@ -37,23 +30,8 @@ const states: ReadonlyArray<ComponentProps<typeof ButtonComponent>["state"]> = ["pending",];-export const Button = ({- prefix,- suffix,- ...rest-}: Omit<ComponentProps<typeof ButtonComponent>, "prefix" | "suffix"> & {- prefix?: keyof typeof iconsMap;- suffix?: keyof typeof iconsMap;-}) => (+export const Button = () => (<>- <StorySection title="Configurable">- <ButtonComponent- prefix={prefix && iconsMap[prefix]}- suffix={suffix && iconsMap[suffix]}- {...rest}- />- </StorySection>-<StorySection title="Colors & States"><StoryGrid>{colors.map((color) => (@@ -120,45 +98,23 @@ export const Button = ({</PopoverContent></Popover></StorySection>- </>-);-Button.argTypes = {- children: { control: "text" },- color: { control: "inline-radio", options: colors },- prefix: { control: "inline-radio", options: Object.keys(iconsMap) },- suffix: { control: "inline-radio", options: Object.keys(iconsMap) },- disabled: { control: "boolean" },- state: { control: "inline-radio", options: states },-};--Button.args = {- children: "Button",- color: "primary",- prefix: "undefined",- suffix: "undefined",- disabled: false,- state: "auto",-};--export const ButtonTextOnly = () => (- <StorySection title="Text only">- <StoryGrid horizontal>- {colors.map((color) => (- <ButtonComponent key={color} color={color}>- {color}- </ButtonComponent>- ))}- </StoryGrid>- </StorySection>-);+ <StorySection title="Text only">+ <StoryGrid horizontal>+ {colors.map((color) => (+ <ButtonComponent key={color} color={color}>+ {color}+ </ButtonComponent>+ ))}+ </StoryGrid>+ </StorySection>-export const ButtonIconOnly = () => (- <StorySection title="Icon only">- <StoryGrid horizontal>- {colors.map((color) => (- <ButtonComponent key={color} prefix={<TrashIcon />} color={color} />- ))}- </StoryGrid>- </StorySection>+ <StorySection title="Icon only">+ <StoryGrid horizontal>+ {colors.map((color) => (+ <ButtonComponent key={color} prefix={<TrashIcon />} color={color} />+ ))}+ </StoryGrid>+ </StorySection>+ </>);diff --git a/packages/design-system/src/components/card.stories.tsx b/packages/design-system/src/components/card.stories.tsxindex 5197fb1411..c0a9af5137 100644--- a/packages/design-system/src/components/card.stories.tsx+++ b/packages/design-system/src/components/card.stories.tsx@@ -1,6 +1,6 @@-import { Flex } from "./flex";import { Text } from "./text";import { Card as CardComponent } from "./card";+import { StorySection, StoryGrid } from "./storybook";export default {title: "Card",@@ -8,26 +8,29 @@ export default {};export const Card = () => (- <Flex gap="3" align="start">- <CardComponent>- <Text>Default</Text>- </CardComponent>- <CardComponent size="1">- <Text>Size 1</Text>- </CardComponent>- </Flex>-);--export const CardMultiple = () => (- <Flex gap="3" align="start">- <CardComponent size="1">- <Text>First card</Text>- </CardComponent>- <CardComponent size="1">- <Text>Second card</Text>- </CardComponent>- <CardComponent size="1">- <Text>Third card</Text>- </CardComponent>- </Flex>+ <>+ <StorySection title="Sizes">+ <StoryGrid horizontal>+ <CardComponent>+ <Text>Default</Text>+ </CardComponent>+ <CardComponent size="1">+ <Text>Size 1</Text>+ </CardComponent>+ </StoryGrid>+ </StorySection>+ <StorySection title="Multiple">+ <StoryGrid horizontal>+ <CardComponent size="1">+ <Text>First card</Text>+ </CardComponent>+ <CardComponent size="1">+ <Text>Second card</Text>+ </CardComponent>+ <CardComponent size="1">+ <Text>Third card</Text>+ </CardComponent>+ </StoryGrid>+ </StorySection>+ </>);diff --git a/packages/design-system/src/components/checkbox.stories.tsx b/packages/design-system/src/components/checkbox.stories.tsxindex 35c341e0a2..8d7caf64e7 100644--- a/packages/design-system/src/components/checkbox.stories.tsx+++ b/packages/design-system/src/components/checkbox.stories.tsx@@ -12,6 +12,22 @@ export default {},};+const ControlledCheckbox = () => {+ const [checked, setChecked] = useState<boolean | "indeterminate">(false);+ return (+ <StoryGrid horizontal>+ <CheckboxAndLabel>+ <CheckboxComponent+ checked={checked}+ onCheckedChange={setChecked}+ id="controlled"+ />+ <Label htmlFor="controlled">State: {String(checked)}</Label>+ </CheckboxAndLabel>+ </StoryGrid>+ );+};+export const Checkbox = () => {return (<>@@ -56,25 +72,10 @@ export const Checkbox = () => {<CheckboxComponent disabled /></Tooltip></StorySection>- </>- );-};-Checkbox.storyName = "Checkbox";-export const CheckboxControlled = () => {- const [checked, setChecked] = useState<boolean | "indeterminate">(false);- return (- <StorySection title="Controlled">- <StoryGrid horizontal>- <CheckboxAndLabel>- <CheckboxComponent- checked={checked}- onCheckedChange={setChecked}- id="controlled"- />- <Label htmlFor="controlled">State: {String(checked)}</Label>- </CheckboxAndLabel>- </StoryGrid>- </StorySection>+ <StorySection title="Controlled">+ <ControlledCheckbox />+ </StorySection>+ </>);};diff --git a/packages/design-system/src/components/color-picker.stories.tsx b/packages/design-system/src/components/color-picker.stories.tsxindex 9593c387fc..a84584f351 100644--- a/packages/design-system/src/components/color-picker.stories.tsx+++ b/packages/design-system/src/components/color-picker.stories.tsx@@ -7,9 +7,10 @@ import {} from "./color-picker";import { Flex } from "./flex";import { Text } from "./text";+import { StorySection } from "./storybook";export default {- title: "Color picker",+ title: "Color Picker",};const initialColor: RgbValue = {@@ -25,46 +26,49 @@ export const ColorPicker = () => {const [popoverValue, setPopoverValue] = useState<StyleValue>(initialColor);return (- <Flex gap="9" align="start">- <Flex direction="column" gap="2">- <Text variant="labels">Inline</Text>- <ColorPickerComponent- value={inlineValue}- onChange={(value) => {- if (value !== undefined) {- setInlineValue(value);- }- }}- onChangeComplete={setInlineValue}- />- <Text>{JSON.stringify(inlineValue)}</Text>- </Flex>- <Flex direction="column" gap="2">- <Text variant="labels">Popover</Text>- <ColorPickerPopover- value={popoverValue}- onChange={(value) => {- if (value !== undefined) {- setPopoverValue(value);- }- }}- onChangeComplete={setPopoverValue}- />- <Text>{JSON.stringify(popoverValue)}</Text>- </Flex>- </Flex>+ <>+ <StorySection title="Inline">+ <Flex direction="column" gap="2">+ <ColorPickerComponent+ value={inlineValue}+ onChange={(value) => {+ if (value !== undefined) {+ setInlineValue(value);+ }+ }}+ onChangeComplete={setInlineValue}+ />+ <Text>{JSON.stringify(inlineValue)}</Text>+ </Flex>+ </StorySection>++ <StorySection title="Popover">+ <Flex direction="column" gap="2">+ <ColorPickerPopover+ value={popoverValue}+ onChange={(value) => {+ if (value !== undefined) {+ setPopoverValue(value);+ }+ }}+ onChangeComplete={setPopoverValue}+ />+ <Text>{JSON.stringify(popoverValue)}</Text>+ </Flex>+ </StorySection>++ <StorySection title="Thumb">+ <Flex gap="3" align="center">+ <ColorThumb color="rgb(255, 0, 0)" />+ <ColorThumb color="rgba(0, 128, 255, 0.5)" />+ <ColorThumb color="transparent" />+ <ColorThumb color="#00FF00" interactive />+ </Flex>+ </StorySection>+ </>);};-export const Thumb = () => (- <Flex gap="3" align="center">- <ColorThumb color="rgb(255, 0, 0)" />- <ColorThumb color="rgba(0, 128, 255, 0.5)" />- <ColorThumb color="transparent" />- <ColorThumb color="#00FF00" interactive />- </Flex>-);-export const PopoverPositioning = () => {const [value, setValue] = useState<StyleValue>(initialColor);const handleChange = (val: StyleValue | undefined) => {@@ -81,6 +85,7 @@ export const PopoverPositioning = () => {onChange={handleChange}onChangeComplete={setValue}side="top"+ open={true}/></Flex><Flex direction="column" gap="2" align="center">@@ -90,6 +95,7 @@ export const PopoverPositioning = () => {onChange={handleChange}onChangeComplete={setValue}side="right"+ open={true}/></Flex><Flex direction="column" gap="2" align="center">@@ -100,6 +106,7 @@ export const PopoverPositioning = () => {onChangeComplete={setValue}side="bottom"align="start"+ open={true}/></Flex><Flex direction="column" gap="2" align="center">@@ -109,6 +116,7 @@ export const PopoverPositioning = () => {onChange={handleChange}onChangeComplete={setValue}sideOffset={16}+ open={true}/></Flex></Flex>diff --git a/packages/design-system/src/components/combobox.stories.tsx b/packages/design-system/src/components/combobox.stories.tsxindex 3a3b4a3e0f..530ffe6cf1 100644--- a/packages/design-system/src/components/combobox.stories.tsx+++ b/packages/design-system/src/components/combobox.stories.tsx@@ -16,19 +16,22 @@ import {} from "./combobox";import { Flex } from "./flex";import { InputField } from "./input-field";+import { StorySection } from "./storybook";export const Basic = () => {const [value, setValue] = useState("");return (- <Combobox<string>- value={value}- itemToString={(item) => item ?? ""}- getItems={() => ["Apple", "Banana", "Orange"]}- onItemSelect={setValue}- onChange={(value) => {- setValue(value ?? "");- }}- />+ <StorySection title="Basic">+ <Combobox<string>+ value={value}+ itemToString={(item) => item ?? ""}+ getItems={() => ["Apple", "Banana", "Orange"]}+ onItemSelect={setValue}+ onChange={(value) => {+ setValue(value ?? "");+ }}+ />+ </StorySection>);};@@ -70,83 +73,91 @@ export const Complex = () => {});return (- <ComboboxRoot open={isOpen}>- <Flex {...getComboboxProps()} direction="column" gap="3">- <ComboboxAnchor asChild>- <InputField- prefix={- <Flex align="center">- <SearchIcon />- </Flex>- }- {...getInputProps({ value })}- />- </ComboboxAnchor>- <ComboboxContent>- <ComboboxListbox {...getMenuProps()}>- {items.map((item, index) => {- return (- <ComboboxListboxItem- {...getItemProps({ item, index })}- key={index}- >- {item}- </ComboboxListboxItem>- );- })}- <ComboboxItemDescription- descriptions={["Hello", "World", "Description"]}- >- Description- </ComboboxItemDescription>- </ComboboxListbox>- </ComboboxContent>- </Flex>- </ComboboxRoot>+ <StorySection title="Complex">+ <ComboboxRoot open={isOpen}>+ <Flex {...getComboboxProps()} direction="column" gap="3">+ <ComboboxAnchor asChild>+ <InputField+ prefix={+ <Flex align="center">+ <SearchIcon />+ </Flex>+ }+ {...getInputProps({ value })}+ />+ </ComboboxAnchor>+ <ComboboxContent>+ <ComboboxListbox {...getMenuProps()}>+ {items.map((item, index) => {+ return (+ <ComboboxListboxItem+ {...getItemProps({ item, index })}+ key={index}+ >+ {item}+ </ComboboxListboxItem>+ );+ })}+ <ComboboxItemDescription+ descriptions={["Hello", "World", "Description"]}+ >+ Description+ </ComboboxItemDescription>+ </ComboboxListbox>+ </ComboboxContent>+ </Flex>+ </ComboboxRoot>+ </StorySection>);};export const WithPlaceholder = () => {const [value, setValue] = useState("");return (- <Combobox<string>- value={value}- itemToString={(item) => item ?? ""}- getItems={() => ["Apple", "Banana", "Orange"]}- onItemSelect={setValue}- onChange={(value) => setValue(value ?? "")}- placeholder="Search fruits…"- />+ <StorySection title="With placeholder">+ <Combobox<string>+ value={value}+ itemToString={(item) => item ?? ""}+ getItems={() => ["Apple", "Banana", "Orange"]}+ onItemSelect={setValue}+ onChange={(value) => setValue(value ?? "")}+ placeholder="Search fruits…"+ />+ </StorySection>);};export const WithAutoFocus = () => {const [value, setValue] = useState("");return (- <Combobox<string>- value={value}- itemToString={(item) => item ?? ""}- getItems={() => ["Apple", "Banana", "Orange"]}- onItemSelect={setValue}- onChange={(value) => setValue(value ?? "")}- autoFocus- placeholder="Focused on mount"- />+ <StorySection title="With auto focus">+ <Combobox<string>+ value={value}+ itemToString={(item) => item ?? ""}+ getItems={() => ["Apple", "Banana", "Orange"]}+ onItemSelect={setValue}+ onChange={(value) => setValue(value ?? "")}+ autoFocus+ placeholder="Focused on mount"+ />+ </StorySection>);};export const WithErrorColor = () => {const [value, setValue] = useState("");return (- <Combobox<string>- value={value}- itemToString={(item) => item ?? ""}- getItems={() => ["Apple", "Banana", "Orange"]}- onItemSelect={setValue}- onChange={(value) => setValue(value ?? "")}- color="error"- placeholder="Error state"- />+ <StorySection title="With error color">+ <Combobox<string>+ value={value}+ itemToString={(item) => item ?? ""}+ getItems={() => ["Apple", "Banana", "Orange"]}+ onItemSelect={setValue}+ onChange={(value) => setValue(value ?? "")}+ color="error"+ placeholder="Error state"+ />+ </StorySection>);};@@ -159,15 +170,17 @@ const fruitDescriptions: Record<string, string> = {export const WithDescription = () => {const [value, setValue] = useState("");return (- <Combobox<string>- value={value}- itemToString={(item) => item ?? ""}- getItems={() => ["Apple", "Banana", "Orange"]}- getDescription={(item) => (item ? fruitDescriptions[item] : undefined)}- onItemSelect={setValue}- onChange={(value) => setValue(value ?? "")}- placeholder="Pick a fruit…"- />+ <StorySection title="With description">+ <Combobox<string>+ value={value}+ itemToString={(item) => item ?? ""}+ getItems={() => ["Apple", "Banana", "Orange"]}+ getDescription={(item) => (item ? fruitDescriptions[item] : undefined)}+ onItemSelect={setValue}+ onChange={(value) => setValue(value ?? "")}+ placeholder="Pick a fruit…"+ />+ </StorySection>);};diff --git a/packages/design-system/src/components/command.stories.tsx b/packages/design-system/src/components/command.stories.tsxindex b9314f94a6..53547cbf26 100644--- a/packages/design-system/src/components/command.stories.tsx+++ b/packages/design-system/src/components/command.stories.tsx@@ -1,5 +1,6 @@import { useState } from "react";import type { Meta, StoryFn } from "@storybook/react";+import { StorySection } from "./storybook";import {Command as CommandComponent,CommandDialog,@@ -104,60 +105,66 @@ const CommandContent = () => {export const Command: StoryFn = () => {return (- <CommandComponent>- <CommandContent />- </CommandComponent>+ <StorySection title="Command">+ <CommandComponent>+ <CommandContent />+ </CommandComponent>+ </StorySection>);};export const InDialog: StoryFn = () => {const [open, setOpen] = useState(true);return (- <CommandDialog open={open} onOpenChange={setOpen}>- <CommandComponent>- <CommandContent />- </CommandComponent>- </CommandDialog>+ <StorySection title="In dialog">+ <CommandDialog open={open} onOpenChange={setOpen}>+ <CommandComponent>+ <CommandContent />+ </CommandComponent>+ </CommandDialog>+ </StorySection>);};export const WithBackNavigation: StoryFn = () => {const [value, setValue] = useState("");return (- <CommandComponent>- <CommandInput- value={value}- onValueChange={setValue}- prefix={<CommandBackButton onClick={() => setValue("")} />}- onBack={() => setValue("")}- placeholder="Search with back button..."- />- <CommandList>- <CommandGroup- heading={<CommandGroupHeading>Results</CommandGroupHeading>}- name="results"- actions={[{ name: "select", label: "Select" }]}- >- <CommandItem>- <Flex gap={2}>- <CommandIcon>- <InfoCircleIcon />- </CommandIcon>- <Text variant="labels">Result one</Text>- </Flex>- </CommandItem>- <CommandItem>- <Flex gap={2}>- <CommandIcon>- <InfoCircleIcon />- </CommandIcon>- <Text variant="labels">Result two</Text>- </Flex>- </CommandItem>- </CommandGroup>- </CommandList>- <Separator />- <CommandFooter />- </CommandComponent>+ <StorySection title="With back navigation">+ <CommandComponent>+ <CommandInput+ value={value}+ onValueChange={setValue}+ prefix={<CommandBackButton onClick={() => setValue("")} />}+ onBack={() => setValue("")}+ placeholder="Search with back button..."+ />+ <CommandList>+ <CommandGroup+ heading={<CommandGroupHeading>Results</CommandGroupHeading>}+ name="results"+ actions={[{ name: "select", label: "Select" }]}+ >+ <CommandItem>+ <Flex gap={2}>+ <CommandIcon>+ <InfoCircleIcon />+ </CommandIcon>+ <Text variant="labels">Result one</Text>+ </Flex>+ </CommandItem>+ <CommandItem>+ <Flex gap={2}>+ <CommandIcon>+ <InfoCircleIcon />+ </CommandIcon>+ <Text variant="labels">Result two</Text>+ </Flex>+ </CommandItem>+ </CommandGroup>+ </CommandList>+ <Separator />+ <CommandFooter />+ </CommandComponent>+ </StorySection>);};diff --git a/packages/design-system/src/components/component-card.stories.tsx b/packages/design-system/src/components/component-card.stories.tsxindex 8de4b888e7..cc9ee6c8c9 100644--- a/packages/design-system/src/components/component-card.stories.tsx+++ b/packages/design-system/src/components/component-card.stories.tsx@@ -6,7 +6,7 @@ import { Grid } from "./grid";import { Text } from "./text";export default {- title: "Component card",+ title: "Component Card",};export const ComponentCard = () => (diff --git a/packages/design-system/src/components/context-menu.stories.tsx b/packages/design-system/src/components/context-menu.stories.tsxindex 5754800838..a3e844e86b 100644--- a/packages/design-system/src/components/context-menu.stories.tsx+++ b/packages/design-system/src/components/context-menu.stories.tsx@@ -20,88 +20,97 @@ import {EllipsesIcon,} from "@webstudio-is/icons";import { IconButton } from "./icon-button";+import { StorySection } from "./storybook";export default {- title: "Components/Context menu",+ title: "Components/Context Menu",};export const ContextMenu = () => (- <DropdownMenu defaultOpen>- <DropdownMenuTrigger asChild>- <IconButton>- <EllipsesIcon />- </IconButton>- </DropdownMenuTrigger>- <DropdownMenuContent>- <DropdownMenuLabel>Actions</DropdownMenuLabel>- <DropdownMenuItem icon={<CopyIcon />}>Copy</DropdownMenuItem>- <DropdownMenuItem icon={<PlusIcon />}>Add item</DropdownMenuItem>- <DropdownMenuSeparator />- <DropdownMenuCheckboxItem checked>Bookmarked</DropdownMenuCheckboxItem>- <DropdownMenuSeparator />- <DropdownMenuRadioGroup value="pedro">- <DropdownMenuLabel>People</DropdownMenuLabel>- <DropdownMenuRadioItem value="pedro">Pedro</DropdownMenuRadioItem>- <DropdownMenuRadioItem value="colm">Colm</DropdownMenuRadioItem>- </DropdownMenuRadioGroup>- <DropdownMenuSeparator />- <DropdownMenuItem icon={<TrashIcon />}>Delete</DropdownMenuItem>- </DropdownMenuContent>- </DropdownMenu>+ <StorySection title="Context menu">+ <DropdownMenu defaultOpen>+ <DropdownMenuTrigger asChild>+ <IconButton>+ <EllipsesIcon />+ </IconButton>+ </DropdownMenuTrigger>+ <DropdownMenuContent>+ <DropdownMenuLabel>Actions</DropdownMenuLabel>+ <DropdownMenuItem icon={<CopyIcon />}>Copy</DropdownMenuItem>+ <DropdownMenuItem icon={<PlusIcon />}>Add item</DropdownMenuItem>+ <DropdownMenuSeparator />+ <DropdownMenuCheckboxItem checked>Bookmarked</DropdownMenuCheckboxItem>+ <DropdownMenuSeparator />+ <DropdownMenuRadioGroup value="pedro">+ <DropdownMenuLabel>People</DropdownMenuLabel>+ <DropdownMenuRadioItem value="pedro">Pedro</DropdownMenuRadioItem>+ <DropdownMenuRadioItem value="colm">Colm</DropdownMenuRadioItem>+ </DropdownMenuRadioGroup>+ <DropdownMenuSeparator />+ <DropdownMenuItem icon={<TrashIcon />}>Delete</DropdownMenuItem>+ </DropdownMenuContent>+ </DropdownMenu>+ </StorySection>);export const WithSubMenu = () => (- <DropdownMenu defaultOpen>- <DropdownMenuTrigger asChild>- <IconButton>- <EllipsesIcon />- </IconButton>- </DropdownMenuTrigger>- <DropdownMenuContent>- <DropdownMenuItem>Regular item</DropdownMenuItem>- <DropdownMenuSub>- <DropdownMenuSubTrigger>More options</DropdownMenuSubTrigger>- <DropdownMenuSubContent>- <DropdownMenuItem>Sub item one</DropdownMenuItem>- <DropdownMenuItem>Sub item two</DropdownMenuItem>- </DropdownMenuSubContent>- </DropdownMenuSub>- <DropdownMenuSeparator />- <DropdownMenuItem>Another item</DropdownMenuItem>- </DropdownMenuContent>- </DropdownMenu>+ <StorySection title="With sub menu">+ <DropdownMenu defaultOpen>+ <DropdownMenuTrigger asChild>+ <IconButton>+ <EllipsesIcon />+ </IconButton>+ </DropdownMenuTrigger>+ <DropdownMenuContent>+ <DropdownMenuItem>Regular item</DropdownMenuItem>+ <DropdownMenuSub>+ <DropdownMenuSubTrigger>More options</DropdownMenuSubTrigger>+ <DropdownMenuSubContent>+ <DropdownMenuItem>Sub item one</DropdownMenuItem>+ <DropdownMenuItem>Sub item two</DropdownMenuItem>+ </DropdownMenuSubContent>+ </DropdownMenuSub>+ <DropdownMenuSeparator />+ <DropdownMenuItem>Another item</DropdownMenuItem>+ </DropdownMenuContent>+ </DropdownMenu>+ </StorySection>);export const DestructiveAndDisabled = () => (- <DropdownMenu defaultOpen>- <DropdownMenuTrigger asChild>- <IconButton>- <EllipsesIcon />- </IconButton>- </DropdownMenuTrigger>- <DropdownMenuContent>- <DropdownMenuItem>Normal item</DropdownMenuItem>- <DropdownMenuItem disabled>Disabled item</DropdownMenuItem>- <DropdownMenuSeparator />- <DropdownMenuItem icon={<TrashIcon />} destructive>- Delete- </DropdownMenuItem>- </DropdownMenuContent>- </DropdownMenu>+ <StorySection title="Destructive and disabled">+ <DropdownMenu defaultOpen>+ <DropdownMenuTrigger asChild>+ <IconButton>+ <EllipsesIcon />+ </IconButton>+ </DropdownMenuTrigger>+ <DropdownMenuContent>+ <DropdownMenuItem>Normal item</DropdownMenuItem>+ <DropdownMenuItem disabled>Disabled item</DropdownMenuItem>+ <DropdownMenuSeparator />+ <DropdownMenuItem icon={<TrashIcon />} destructive>+ Delete+ </DropdownMenuItem>+ </DropdownMenuContent>+ </DropdownMenu>+ </StorySection>);export const WithHintAndArrow = () => (- <DropdownMenu defaultOpen>- <DropdownMenuTrigger asChild>- <IconButton>- <EllipsesIcon />- </IconButton>- </DropdownMenuTrigger>- <DropdownMenuContent>- <DropdownMenuItem>Regular item</DropdownMenuItem>- <DropdownMenuSeparator />- <DropdownMenuItem hint>Press ⌘K to search</DropdownMenuItem>- <DropdownMenuArrow />- </DropdownMenuContent>- </DropdownMenu>+ <StorySection title="With hint and arrow">+ <DropdownMenu defaultOpen>+ <DropdownMenuTrigger asChild>+ <IconButton>+ <EllipsesIcon />+ </IconButton>+ </DropdownMenuTrigger>+ <DropdownMenuContent>+ <DropdownMenuItem>Regular item</DropdownMenuItem>+ <DropdownMenuSeparator />+ <DropdownMenuItem hint>Press ⌘K to search</DropdownMenuItem>+ <DropdownMenuArrow />+ </DropdownMenuContent>+ </DropdownMenu>+ </StorySection>);diff --git a/packages/design-system/src/components/css-value-list-item.stories.tsx b/packages/design-system/src/components/css-value-list-item.stories.tsxindex 74651dac68..c042621523 100644--- a/packages/design-system/src/components/css-value-list-item.stories.tsx+++ b/packages/design-system/src/components/css-value-list-item.stories.tsx@@ -1,5 +1,5 @@import { useState, type ComponentProps, type ReactNode } from "react";-import { css, styled, theme } from "../stitches.config";+import { styled, theme } from "../stitches.config";import {CssValueListArrowFocus,CssValueListItem,@@ -9,21 +9,11 @@ import { Label, labelColors } from "./label";import { SmallToggleButton } from "./small-toggle-button";import { EyeOpenIcon, EyeClosedIcon, MinusIcon } from "@webstudio-is/icons";import { SmallIconButton } from "./small-icon-button";-import { Popover, PopoverContent, PopoverTrigger } from "./popover";import { StorySection, StoryGrid } from "./storybook";export default {component: CssValueListItem,- args: { hidden: false, labelColor: "default", focused: false },- argTypes: {- hidden: { control: "boolean" },- focused: { control: "boolean" },- labelColor: {- options: labelColors,- type: "inline-radio",- },- },- title: "CSS value list item",+ title: "CSS Value List Item",};const Thumbnail = styled("div", {@@ -84,54 +74,9 @@ const ListItem = (props: {);};-export const CSSValueListItem = (props: {- hidden: boolean;- focused: boolean;- labelColor: "default";-}) => {- const [pressed, onPressedChange] = useState(false);-+export const CSSValueListItem = () => {return (<Panel>- <StorySection title="Configurable">- <Popover>- <PopoverTrigger asChild>- <CssValueListItem- id="0"- index={0}- label={- <Label disabled={props.hidden} color={props.labelColor}>- Image- </Label>- }- thumbnail={<Thumbnail />}- hidden={props.hidden}- focused={props.focused}- buttons={- <>- <SmallToggleButton- pressed={pressed}- onPressedChange={onPressedChange}- variant="normal"- tabIndex={-1}- icon={pressed ? <EyeClosedIcon /> : <EyeOpenIcon />}- />-- <SmallIconButton- variant="destructive"- tabIndex={-1}- icon={<MinusIcon />}- />- </>- }- />- </PopoverTrigger>- <PopoverContent>- <div className={css({ p: theme.spacing[10] })()}>Content</div>- </PopoverContent>- </Popover>- </StorySection>-<StorySection title="Overflows"><StoryGrid><>@@ -234,89 +179,77 @@ export const CSSValueListItem = (props: {</CssValueListArrowFocus></StoryGrid></StorySection>- </Panel>- );-};-export const WithoutThumbnail = () => (- <Panel>- <StorySection title="No thumbnail">- <CssValueListArrowFocus>- <CssValueListItem- id="no-thumb-0"- index={0}- label={<Label>Text only item</Label>}- hidden={false}- buttons={- <SmallIconButton- variant="destructive"- tabIndex={-1}- icon={<MinusIcon />}- />- }- {...__testing__.listItemAttributes}- />- <CssValueListItem- id="no-thumb-1"- index={1}- label={<Label>Another text item</Label>}- hidden={false}- buttons={- <SmallIconButton- variant="destructive"- tabIndex={-1}- icon={<MinusIcon />}- />- }- {...__testing__.listItemAttributes}- />- </CssValueListArrowFocus>- </StorySection>- </Panel>-);--export const DisabledItems = () => (- <Panel>- <StorySection title="Disabled state">- <CssValueListArrowFocus>- <CssValueListItem- id="disabled-0"- index={0}- label={<Label>Disabled item</Label>}- thumbnail={<Thumbnail />}- hidden={false}- disabled- {...__testing__.listItemAttributes}- />- <CssValueListItem- id="disabled-1"- index={1}- label={<Label>Enabled item</Label>}- thumbnail={<Thumbnail />}- hidden={false}- {...__testing__.listItemAttributes}- />- </CssValueListArrowFocus>- </StorySection>- </Panel>-);+ <StorySection title="No thumbnail">+ <CssValueListArrowFocus>+ <CssValueListItem+ id="no-thumb-0"+ index={0}+ label={<Label>Text only item</Label>}+ hidden={false}+ buttons={+ <SmallIconButton+ variant="destructive"+ tabIndex={-1}+ icon={<MinusIcon />}+ />+ }+ {...__testing__.listItemAttributes}+ />+ <CssValueListItem+ id="no-thumb-1"+ index={1}+ label={<Label>Another text item</Label>}+ hidden={false}+ buttons={+ <SmallIconButton+ variant="destructive"+ tabIndex={-1}+ icon={<MinusIcon />}+ />+ }+ {...__testing__.listItemAttributes}+ />+ </CssValueListArrowFocus>+ </StorySection>-export const WithDragItemId = () => (- <Panel>- <StorySection title="Arrow focus with drag item">- <CssValueListArrowFocus dragItemId="drag-1">- {labelColors.map((labelColor, index) => (- <ListItem- key={labelColor}- index={index}+ <StorySection title="Disabled state">+ <CssValueListArrowFocus>+ <CssValueListItem+ id="disabled-0"+ index={0}+ label={<Label>Disabled item</Label>}+ thumbnail={<Thumbnail />}+ hidden={false}+ disabled+ {...__testing__.listItemAttributes}+ />+ <CssValueListItem+ id="disabled-1"+ index={1}+ label={<Label>Enabled item</Label>}+ thumbnail={<Thumbnail />}hidden={false}- active={index === 1}- labelColor={labelColor}- state={undefined}- focused={false}+ {...__testing__.listItemAttributes}/>- ))}- </CssValueListArrowFocus>- </StorySection>- </Panel>-);+ </CssValueListArrowFocus>+ </StorySection>++ <StorySection title="Arrow focus with drag item">+ <CssValueListArrowFocus dragItemId="drag-1">+ {labelColors.map((labelColor, index) => (+ <ListItem+ key={labelColor}+ index={index}+ hidden={false}+ active={index === 1}+ labelColor={labelColor}+ state={undefined}+ focused={false}+ />+ ))}+ </CssValueListArrowFocus>+ </StorySection>+ </Panel>+ );+};diff --git a/packages/design-system/src/components/dialog.stories.tsx b/packages/design-system/src/components/dialog.stories.tsxindex cf5c2e4f5c..bea701efb3 100644--- a/packages/design-system/src/components/dialog.stories.tsx+++ b/packages/design-system/src/components/dialog.stories.tsx@@ -1,6 +1,7 @@import { Button } from "./button";import { css, theme } from "../stitches.config";import { textVariants } from "./text";+import { StorySection } from "./storybook";import {Dialog,DialogActions,@@ -33,117 +34,127 @@ const buttonsStyle = css({});const DialogDemo = () => (- <Dialog defaultOpen>- <DialogTrigger asChild>- <Button>Open</Button>- </DialogTrigger>- <DialogContent>- <div className={bodyStyle()}>- <DialogDescription asChild>- <p className={descriptionStyle()}>This is a description</p>- </DialogDescription>- <div className={buttonsStyle()}>- <DialogClose>- <Button color="ghost">Cancel</Button>- </DialogClose>- <DialogClose>- <Button color="positive">Save</Button>- </DialogClose>+ <StorySection title="Dialog">+ <Dialog defaultOpen>+ <DialogTrigger asChild>+ <Button>Open</Button>+ </DialogTrigger>+ <DialogContent>+ <div className={bodyStyle()}>+ <DialogDescription asChild>+ <p className={descriptionStyle()}>This is a description</p>+ </DialogDescription>+ <div className={buttonsStyle()}>+ <DialogClose>+ <Button color="ghost">Cancel</Button>+ </DialogClose>+ <DialogClose>+ <Button color="positive">Save</Button>+ </DialogClose>+ </div></div>- </div>- {/* Title is at the end intentionally,- * to make the close button last in the tab order- */}- <DialogTitle>Title</DialogTitle>- </DialogContent>- </Dialog>+ {/* Title is at the end intentionally,+ * to make the close button last in the tab order+ */}+ <DialogTitle>Title</DialogTitle>+ </DialogContent>+ </Dialog>+ </StorySection>);export { DialogDemo as Dialog };export const ResizableDialog = () => (- <Dialog defaultOpen resize="both">- <DialogTrigger asChild>- <Button>Open resizable</Button>- </DialogTrigger>- <DialogContent>- <div className={bodyStyle()}>- <DialogDescription asChild>- <p className={descriptionStyle()}>- Resize this dialog by dragging the edges- </p>- </DialogDescription>- </div>- <DialogTitle>Resizable</DialogTitle>- </DialogContent>- </Dialog>+ <StorySection title="Resizable dialog">+ <Dialog defaultOpen resize="both">+ <DialogTrigger asChild>+ <Button>Open resizable</Button>+ </DialogTrigger>+ <DialogContent>+ <div className={bodyStyle()}>+ <DialogDescription asChild>+ <p className={descriptionStyle()}>+ Resize this dialog by dragging the edges+ </p>+ </DialogDescription>+ </div>+ <DialogTitle>Resizable</DialogTitle>+ </DialogContent>+ </Dialog>+ </StorySection>);export const WithMaximize = () => (- <Dialog defaultOpen resize="both">- <DialogTrigger asChild>- <Button>Open maximizable</Button>- </DialogTrigger>- <DialogContent>- <div className={bodyStyle()}>- <DialogDescription asChild>- <p className={descriptionStyle()}>- Click the maximize button to expand- </p>- </DialogDescription>- </div>- <DialogTitle- suffix={- <DialogTitleActions>- <DialogMaximize />- <DialogClose />- </DialogTitleActions>- }- >- Maximizable- </DialogTitle>- </DialogContent>- </Dialog>+ <StorySection title="With maximize">+ <Dialog defaultOpen resize="both">+ <DialogTrigger asChild>+ <Button>Open maximizable</Button>+ </DialogTrigger>+ <DialogContent>+ <div className={bodyStyle()}>+ <DialogDescription asChild>+ <p className={descriptionStyle()}>+ Click the maximize button to expand+ </p>+ </DialogDescription>+ </div>+ <DialogTitle+ suffix={+ <DialogTitleActions>+ <DialogMaximize />+ <DialogClose />+ </DialogTitleActions>+ }+ >+ Maximizable+ </DialogTitle>+ </DialogContent>+ </Dialog>+ </StorySection>);export const WithActions = () => (- <Dialog defaultOpen>- <DialogTrigger asChild>- <Button>Open with actions</Button>- </DialogTrigger>- <DialogContent>- <div className={bodyStyle()}>- <DialogDescription asChild>- <p className={descriptionStyle()}>- Dialog with action buttons at the bottom- </p>- </DialogDescription>- </div>- <DialogActions>- <DialogClose>- <Button color="positive">Save</Button>- </DialogClose>- <DialogClose>- <Button color="ghost">Cancel</Button>- </DialogClose>- </DialogActions>- <DialogTitle>With actions</DialogTitle>- </DialogContent>- </Dialog>+ <StorySection title="With actions">+ <Dialog defaultOpen>+ <DialogTrigger asChild>+ <Button>Open with actions</Button>+ </DialogTrigger>+ <DialogContent>+ <div className={bodyStyle()}>+ <DialogDescription asChild>+ <p className={descriptionStyle()}>+ Dialog with action buttons at the bottom+ </p>+ </DialogDescription>+ </div>+ <DialogActions>+ <DialogClose>+ <Button color="positive">Save</Button>+ </DialogClose>+ <DialogClose>+ <Button color="ghost">Cancel</Button>+ </DialogClose>+ </DialogActions>+ <DialogTitle>With actions</DialogTitle>+ </DialogContent>+ </Dialog>+ </StorySection>);export const NonDraggable = () => (- <Dialog defaultOpen draggable={false}>- <DialogTrigger asChild>- <Button>Open non-draggable</Button>- </DialogTrigger>- <DialogContent>- <div className={bodyStyle()}>- <DialogDescription asChild>- <p className={descriptionStyle()}>This dialog cannot be dragged</p>- </DialogDescription>- </div>- <DialogTitle>Non-draggable</DialogTitle>- </DialogContent>- </Dialog>+ <StorySection title="Non-draggable">+ <Dialog defaultOpen draggable={false}>+ <DialogTrigger asChild>+ <Button>Open non-draggable</Button>+ </DialogTrigger>+ <DialogContent>+ <div className={bodyStyle()}>+ <DialogDescription asChild>+ <p className={descriptionStyle()}>This dialog cannot be dragged</p>+ </DialogDescription>+ </div>+ <DialogTitle>Non-draggable</DialogTitle>+ </DialogContent>+ </Dialog>+ </StorySection>);diff --git a/packages/design-system/src/components/dropdown-menu.stories.tsx b/packages/design-system/src/components/dropdown-menu.stories.tsxindex 91bff21b68..3af33338f9 100644--- a/packages/design-system/src/components/dropdown-menu.stories.tsx+++ b/packages/design-system/src/components/dropdown-menu.stories.tsx@@ -2,6 +2,7 @@ import { useState } from "react";import { CopyIcon, TrashIcon } from "@webstudio-is/icons";import { Flex } from "./flex";import { Button } from "./button";+import { StorySection } from "./storybook";import {DropdownMenu as DropdownMenuComponent,DropdownMenuTrigger,@@ -19,99 +20,111 @@ import {} from "./dropdown-menu";export default {- title: "Dropdown menu",+ title: "Dropdown Menu",};export const DropdownMenu = () => {const [bold, setBold] = useState(true);const [italic, setItalic] = useState(false);return (- <Flex gap="9" css={{ padding: 100 }}>- <DropdownMenuComponent open>- <DropdownMenuTrigger asChild>- <Button>Items</Button>- </DropdownMenuTrigger>- <DropdownMenuContent>- <DropdownMenuItem>New file</DropdownMenuItem>- <DropdownMenuItem>Open project</DropdownMenuItem>- <DropdownMenuSeparator />- <DropdownMenuItem>Settings</DropdownMenuItem>- <DropdownMenuItem disabled>Disabled item</DropdownMenuItem>- </DropdownMenuContent>- </DropdownMenuComponent>+ <StorySection title="Dropdown menu">+ <Flex gap="9" css={{ padding: 100 }}>+ <DropdownMenuComponent open>+ <DropdownMenuTrigger asChild>+ <Button>Items</Button>+ </DropdownMenuTrigger>+ <DropdownMenuContent>+ <DropdownMenuItem>New file</DropdownMenuItem>+ <DropdownMenuItem>Open project</DropdownMenuItem>+ <DropdownMenuSeparator />+ <DropdownMenuItem>Settings</DropdownMenuItem>+ <DropdownMenuItem disabled>Disabled item</DropdownMenuItem>+ </DropdownMenuContent>+ </DropdownMenuComponent>- <DropdownMenuComponent open>- <DropdownMenuTrigger asChild>- <Button>Checkboxes</Button>- </DropdownMenuTrigger>- <DropdownMenuContent>- <DropdownMenuCheckboxItem checked={bold} onCheckedChange={setBold}>- Bold- </DropdownMenuCheckboxItem>- <DropdownMenuCheckboxItem- checked={italic}- onCheckedChange={setItalic}- >- Italic- </DropdownMenuCheckboxItem>- </DropdownMenuContent>- </DropdownMenuComponent>- </Flex>+ <DropdownMenuComponent open>+ <DropdownMenuTrigger asChild>+ <Button>Checkboxes</Button>+ </DropdownMenuTrigger>+ <DropdownMenuContent>+ <DropdownMenuCheckboxItem checked={bold} onCheckedChange={setBold}>+ Bold+ </DropdownMenuCheckboxItem>+ <DropdownMenuCheckboxItem+ checked={italic}+ onCheckedChange={setItalic}+ >+ Italic+ </DropdownMenuCheckboxItem>+ </DropdownMenuContent>+ </DropdownMenuComponent>+ </Flex>+ </StorySection>);};export const WithIcons = () => (- <DropdownMenuComponent defaultOpen>- <DropdownMenuTrigger asChild>- <Button>With icons</Button>- </DropdownMenuTrigger>- <DropdownMenuContent>- <DropdownMenuItem icon={<CopyIcon />}>Copy</DropdownMenuItem>- <DropdownMenuItem icon={<TrashIcon />} destructive>- Delete- </DropdownMenuItem>- </DropdownMenuContent>- </DropdownMenuComponent>+ <StorySection title="With icons">+ <DropdownMenuComponent defaultOpen>+ <DropdownMenuTrigger asChild>+ <Button>With icons</Button>+ </DropdownMenuTrigger>+ <DropdownMenuContent>+ <DropdownMenuItem icon={<CopyIcon />}>Copy</DropdownMenuItem>+ <DropdownMenuItem icon={<TrashIcon />} destructive>+ Delete+ </DropdownMenuItem>+ </DropdownMenuContent>+ </DropdownMenuComponent>+ </StorySection>);export const WithRadioGroup = () => {const [value, setValue] = useState("one");return (+ <StorySection title="With radio group">+ <DropdownMenuComponent defaultOpen>+ <DropdownMenuTrigger asChild>+ <Button>Radio group</Button>+ </DropdownMenuTrigger>+ <DropdownMenuContent>+ <DropdownMenuLabel>Choose one</DropdownMenuLabel>+ <DropdownMenuRadioGroup value={value} onValueChange={setValue}>+ <DropdownMenuRadioItem value="one">+ Option one+ </DropdownMenuRadioItem>+ <DropdownMenuRadioItem value="two">+ Option two+ </DropdownMenuRadioItem>+ <DropdownMenuRadioItem value="three">+ Option three+ </DropdownMenuRadioItem>+ </DropdownMenuRadioGroup>+ </DropdownMenuContent>+ </DropdownMenuComponent>+ </StorySection>+ );+};++export const WithSubMenu = () => (+ <StorySection title="With sub menu"><DropdownMenuComponent defaultOpen><DropdownMenuTrigger asChild>- <Button>Radio group</Button>+ <Button>Sub menu</Button></DropdownMenuTrigger><DropdownMenuContent>- <DropdownMenuLabel>Choose one</DropdownMenuLabel>- <DropdownMenuRadioGroup value={value} onValueChange={setValue}>- <DropdownMenuRadioItem value="one">Option one</DropdownMenuRadioItem>- <DropdownMenuRadioItem value="two">Option two</DropdownMenuRadioItem>- <DropdownMenuRadioItem value="three">- Option three- </DropdownMenuRadioItem>- </DropdownMenuRadioGroup>+ <DropdownMenuItem>Item one</DropdownMenuItem>+ <DropdownMenuSub>+ <DropdownMenuSubTrigger>More options</DropdownMenuSubTrigger>+ <DropdownMenuSubContent>+ <DropdownMenuItem>Sub item one</DropdownMenuItem>+ <DropdownMenuItem>Sub item two</DropdownMenuItem>+ </DropdownMenuSubContent>+ </DropdownMenuSub>+ <DropdownMenuSeparator />+ <DropdownMenuItem>Item two</DropdownMenuItem>+ <DropdownMenuArrow /></DropdownMenuContent></DropdownMenuComponent>- );-};--export const WithSubMenu = () => (- <DropdownMenuComponent defaultOpen>- <DropdownMenuTrigger asChild>- <Button>Sub menu</Button>- </DropdownMenuTrigger>- <DropdownMenuContent>- <DropdownMenuItem>Item one</DropdownMenuItem>- <DropdownMenuSub>- <DropdownMenuSubTrigger>More options</DropdownMenuSubTrigger>- <DropdownMenuSubContent>- <DropdownMenuItem>Sub item one</DropdownMenuItem>- <DropdownMenuItem>Sub item two</DropdownMenuItem>- </DropdownMenuSubContent>- </DropdownMenuSub>- <DropdownMenuSeparator />- <DropdownMenuItem>Item two</DropdownMenuItem>- <DropdownMenuArrow />- </DropdownMenuContent>- </DropdownMenuComponent>+ </StorySection>);diff --git a/packages/design-system/src/components/enhanced-tooltip.stories.tsx b/packages/design-system/src/components/enhanced-tooltip.stories.tsxindex 707d430d03..0f3fbfd2b7 100644--- a/packages/design-system/src/components/enhanced-tooltip.stories.tsx+++ b/packages/design-system/src/components/enhanced-tooltip.stories.tsx@@ -9,7 +9,7 @@ import { StorySection } from "./storybook";import { Button } from "./button";export default {- title: "Enhanced tooltip",+ title: "Enhanced Tooltip",component: EnhancedTooltipComponent,};@@ -68,11 +68,7 @@ export const EnhancedTooltip = () => (</EnhancedTooltipComponent></Flex></StorySection>- </EnhancedTooltipProvider>-);-export const WithAlignment = () => (- <EnhancedTooltipProvider><StorySection title="Alignment options"><Flex gap="6" css={{ padding: 60 }}><EnhancedTooltipComponentdiff --git a/packages/design-system/src/components/floating-panel.stories.tsx b/packages/design-system/src/components/floating-panel.stories.tsxindex d7ed219cb9..7d7017bca8 100644--- a/packages/design-system/src/components/floating-panel.stories.tsx+++ b/packages/design-system/src/components/floating-panel.stories.tsx@@ -1,13 +1,14 @@import { useRef, type ReactNode } from "react";import { FloatingPanel as FloatingPanelComponent } from "./floating-panel";import { Box } from "./box";+import { StorySection } from "./storybook";import { Button } from "./button";import { Text } from "./text";import { Flex } from "./flex";import { CopyIcon } from "@webstudio-is/icons";export default {- title: "Floating panel",+ title: "Floating Panel",component: FloatingPanelComponent,};@@ -30,85 +31,91 @@ const Container = ({ children }: { children: ReactNode }) => {};export const FloatingPanel = () => (- <Flex direction="column" gap="9">- <Container>- <FloatingPanelComponent- open- title="Left (default)"- content={<Text>Content</Text>}- >- <Button>Open on the left</Button>- </FloatingPanelComponent>- </Container>- <Container>- <FloatingPanelComponent- placement="right-start"- open- title="Right"- content={<Text>Content</Text>}- >- <Button>Open on the right</Button>- </FloatingPanelComponent>- </Container>- <Container>- <FloatingPanelComponent- placement="bottom-within"- open- title="Bottom"- content={<Text>Content</Text>}- >- <Button>Open below</Button>- </FloatingPanelComponent>- </Container>+ <StorySection title="Floating panel">+ <Flex direction="column" gap="9">+ <Container>+ <FloatingPanelComponent+ open+ title="Left (default)"+ content={<Text>Content</Text>}+ >+ <Button>Open on the left</Button>+ </FloatingPanelComponent>+ </Container>+ <Container>+ <FloatingPanelComponent+ placement="right-start"+ open+ title="Right"+ content={<Text>Content</Text>}+ >+ <Button>Open on the right</Button>+ </FloatingPanelComponent>+ </Container>+ <Container>+ <FloatingPanelComponent+ placement="bottom-within"+ open+ title="Bottom"+ content={<Text>Content</Text>}+ >+ <Button>Open below</Button>+ </FloatingPanelComponent>+ </Container>+ <Container>+ <FloatingPanelComponent+ placement="center"+ open+ maximizable+ resize="both"+ title="Center"+ content={<Text>Content</Text>}+ >+ <Button>Open screen-centered</Button>+ </FloatingPanelComponent>+ </Container>+ <Container>+ <FloatingPanelComponent+ offset={{ mainAxis: 20, alignmentAxis: -100 }}+ width={200}+ height={300}+ open+ title="Custom Offset & Size"+ content={<Text>Content</Text>}+ >+ <Button>Open with custom offsets</Button>+ </FloatingPanelComponent>+ </Container>+ </Flex>+ </StorySection>+);++export const WithTitleSuffix = () => (+ <StorySection title="With title suffix"><Container><FloatingPanelComponent- placement="center"open- maximizable- resize="both"- title="Center"- content={<Text>Content</Text>}+ title="With suffix"+ titleSuffix={<Button color="ghost" prefix={<CopyIcon />} />}+ content={<Text>Panel with a custom title suffix button</Text>}>- <Button>Open screen-centered</Button>+ <Button>Open with title suffix</Button></FloatingPanelComponent></Container>+ </StorySection>+);++export const PersistentPanel = () => (+ <StorySection title="Persistent panel"><Container><FloatingPanelComponent- offset={{ mainAxis: 20, alignmentAxis: -100 }}- width={200}- height={300}open- title="Custom Offset & Size"- content={<Text>Content</Text>}+ title="Persistent"+ closeOnInteractOutside={false}+ content={<Text>This panel stays open when clicking outside</Text>}>- <Button>Open with custom offsets</Button>+ <Button>Open persistent</Button></FloatingPanelComponent></Container>- </Flex>-);--export const WithTitleSuffix = () => (- <Container>- <FloatingPanelComponent- open- title="With suffix"- titleSuffix={<Button color="ghost" prefix={<CopyIcon />} />}- content={<Text>Panel with a custom title suffix button</Text>}- >- <Button>Open with title suffix</Button>- </FloatingPanelComponent>- </Container>-);--export const PersistentPanel = () => (- <Container>- <FloatingPanelComponent- open- title="Persistent"- closeOnInteractOutside={false}- content={<Text>This panel stays open when clicking outside</Text>}- >- <Button>Open persistent</Button>- </FloatingPanelComponent>- </Container>+ </StorySection>);diff --git a/packages/design-system/src/components/gradient-picker.stories.tsx b/packages/design-system/src/components/gradient-picker.stories.tsxindex 4f215d1832..13c3d3357c 100644--- a/packages/design-system/src/components/gradient-picker.stories.tsx+++ b/packages/design-system/src/components/gradient-picker.stories.tsx@@ -7,9 +7,10 @@ import { useState } from "react";import { GradientPicker as GradientPickerComponent } from "./gradient-picker";import { Flex } from "./flex";import { Text } from "./text";+import { StorySection } from "./storybook";export default {- title: "Gradient picker",+ title: "Gradient Picker",};const parseLinearGradientOrThrow = (@@ -47,41 +48,45 @@ const GradientVariant = ({);};-export const GradientPicker = () => (- <Flex direction="column" gap="6">- <GradientVariant- label="Simple (90deg)"- initial="linear-gradient(90deg, black 0%, white 100%)"- />- <GradientVariant- label="Angle + Hints"- initial="linear-gradient(145deg, #ff00fa 0%, #00f497 34% 34%, #ffa800 56% 56%, #00eaff 100%)"- />- <GradientVariant- label="Side or Corner"- initial="linear-gradient(to left top, blue 0%, red 100%)"- />- </Flex>-);--export const GradientPickerWithSelectedStop = () => {+export const GradientPicker = () => {const [gradient, setGradient] = useState<ParsedLinearGradient>(() =>parseLinearGradientOrThrow("linear-gradient(90deg, red 0%, green 50%, blue 100%)"));return (- <Flex direction="column" gap="2">- <Text variant="labels">Pre-selected middle stop (index 1)</Text>- <GradientPickerComponent- gradient={gradient}- backgroundImage={formatLinearGradient(gradient)}- onChange={setGradient}- onChangeComplete={setGradient}- onThumbSelect={() => {}}- selectedStopIndex={1}- />- <Text>{formatLinearGradient(gradient)}</Text>- </Flex>+ <>+ <StorySection title="Variants">+ <Flex direction="column" gap="6">+ <GradientVariant+ label="Simple (90deg)"+ initial="linear-gradient(90deg, black 0%, white 100%)"+ />+ <GradientVariant+ label="Angle + Hints"+ initial="linear-gradient(145deg, #ff00fa 0%, #00f497 34% 34%, #ffa800 56% 56%, #00eaff 100%)"+ />+ <GradientVariant+ label="Side or Corner"+ initial="linear-gradient(to left top, blue 0%, red 100%)"+ />+ </Flex>+ </StorySection>++ <StorySection title="With selected stop">+ <Flex direction="column" gap="2">+ <Text variant="labels">Pre-selected middle stop (index 1)</Text>+ <GradientPickerComponent+ gradient={gradient}+ backgroundImage={formatLinearGradient(gradient)}+ onChange={setGradient}+ onChangeComplete={setGradient}+ onThumbSelect={() => {}}+ selectedStopIndex={1}+ />+ <Text>{formatLinearGradient(gradient)}</Text>+ </Flex>+ </StorySection>+ </>);};diff --git a/packages/design-system/src/components/icon-button.stories.tsx b/packages/design-system/src/components/icon-button.stories.tsxindex 93df5acab0..5f5ba358e0 100644--- a/packages/design-system/src/components/icon-button.stories.tsx+++ b/packages/design-system/src/components/icon-button.stories.tsx@@ -1,17 +1,16 @@-import type { StoryFn } from "@storybook/react";import { XIcon } from "@webstudio-is/icons";-import { Flex } from "./flex";import { IconButton as IconButtonComponent } from "./icon-button";+import { StorySection, StoryGrid } from "./storybook";export default {- title: "Icon button",+ title: "Icon Button",component: IconButtonComponent,};-export const IconButton: StoryFn<typeof IconButtonComponent> = () => {- return (- <Flex direction="column" gap={2}>- <Flex gap={2}>+export const IconButton = () => (+ <>+ <StorySection title="Variants">+ <StoryGrid horizontal><IconButtonComponent><XIcon fill="currentColor" /></IconButtonComponent>@@ -27,8 +26,10 @@ export const IconButton: StoryFn<typeof IconButtonComponent> = () => {<IconButtonComponent variant="remote"><XIcon fill="currentColor" /></IconButtonComponent>- </Flex>- <Flex gap={2}>+ </StoryGrid>+ </StorySection>+ <StorySection title="Disabled">+ <StoryGrid horizontal><IconButtonComponent disabled={true}><XIcon fill="currentColor" /></IconButtonComponent>@@ -44,8 +45,10 @@ export const IconButton: StoryFn<typeof IconButtonComponent> = () => {<IconButtonComponent variant="remote" disabled={true}><XIcon fill="currentColor" /></IconButtonComponent>- </Flex>- <Flex gap={2}>+ </StoryGrid>+ </StorySection>+ <StorySection title="Open state">+ <StoryGrid horizontal><IconButtonComponent data-state={"open"}><XIcon fill="currentColor" /></IconButtonComponent>@@ -61,8 +64,10 @@ export const IconButton: StoryFn<typeof IconButtonComponent> = () => {<IconButtonComponent variant="remote" data-state={"open"}><XIcon fill="currentColor" /></IconButtonComponent>- </Flex>- <Flex gap={2}>+ </StoryGrid>+ </StorySection>+ <StorySection title="Focused">+ <StoryGrid horizontal><IconButtonComponent data-focused={true}><XIcon fill="currentColor" /></IconButtonComponent>@@ -78,27 +83,26 @@ export const IconButton: StoryFn<typeof IconButtonComponent> = () => {<IconButtonComponent variant="remote" data-focused={true}><XIcon fill="currentColor" /></IconButtonComponent>- </Flex>- </Flex>- );-};--export const Hovered = () => (- <Flex gap={2}>- <IconButtonComponent data-hovered={true}>- <XIcon fill="currentColor" />- </IconButtonComponent>- <IconButtonComponent variant="preset" data-hovered={true}>- <XIcon fill="currentColor" />- </IconButtonComponent>- <IconButtonComponent variant="local" data-hovered={true}>- <XIcon fill="currentColor" />- </IconButtonComponent>- <IconButtonComponent variant="overwritten" data-hovered={true}>- <XIcon fill="currentColor" />- </IconButtonComponent>- <IconButtonComponent variant="remote" data-hovered={true}>- <XIcon fill="currentColor" />- </IconButtonComponent>- </Flex>+ </StoryGrid>+ </StorySection>+ <StorySection title="Hovered">+ <StoryGrid horizontal>+ <IconButtonComponent data-hovered={true}>+ <XIcon fill="currentColor" />+ </IconButtonComponent>+ <IconButtonComponent variant="preset" data-hovered={true}>+ <XIcon fill="currentColor" />+ </IconButtonComponent>+ <IconButtonComponent variant="local" data-hovered={true}>+ <XIcon fill="currentColor" />+ </IconButtonComponent>+ <IconButtonComponent variant="overwritten" data-hovered={true}>+ <XIcon fill="currentColor" />+ </IconButtonComponent>+ <IconButtonComponent variant="remote" data-hovered={true}>+ <XIcon fill="currentColor" />+ </IconButtonComponent>+ </StoryGrid>+ </StorySection>+ </>);diff --git a/packages/design-system/src/components/input-field.stories.tsx b/packages/design-system/src/components/input-field.stories.tsxindex c4051a501b..556a6fd5d1 100644--- a/packages/design-system/src/components/input-field.stories.tsx+++ b/packages/design-system/src/components/input-field.stories.tsx@@ -9,7 +9,7 @@ import { NestedInputButton } from "./nested-input-button";import { StorySection, StoryGrid } from "./storybook";export default {- title: "Input field",+ title: "Input Field",};const prefix = (@@ -92,57 +92,47 @@ export const InputField = () => ())}</StoryGrid></StorySection>- </>-);-InputField.storyName = "Input Field";--export const Chromeless = () => (- <StorySection title="Chromeless variant">- <StoryGrid horizontal>- <InputFieldComponent defaultValue="Chromeless" variant="chromeless" />- <InputFieldComponent- defaultValue="With prefix"- variant="chromeless"- prefix={prefix}- suffix={suffix}- />- </StoryGrid>- </StorySection>-);+ <StorySection title="Chromeless variant">+ <StoryGrid horizontal>+ <InputFieldComponent defaultValue="Chromeless" variant="chromeless" />+ <InputFieldComponent+ defaultValue="With prefix"+ variant="chromeless"+ prefix={prefix}+ suffix={suffix}+ />+ </StoryGrid>+ </StorySection>-export const SmallSize = () => (- <StorySection title="Small size (size 1)">- <StoryGrid horizontal>- <InputFieldComponent defaultValue="Size 1" size="1" />- <InputFieldComponent defaultValue="Size 2" size="2" />- <InputFieldComponent- defaultValue="Size 1 with prefix"- size="1"- prefix={prefix}- suffix={suffix}- />- </StoryGrid>- </StorySection>-);+ <StorySection title="Small size (size 1)">+ <StoryGrid horizontal>+ <InputFieldComponent defaultValue="Size 1" size="1" />+ <InputFieldComponent defaultValue="Size 2" size="2" />+ <InputFieldComponent+ defaultValue="Size 1 with prefix"+ size="1"+ prefix={prefix}+ suffix={suffix}+ />+ </StoryGrid>+ </StorySection>-export const InputTypes = () => (- <StorySection title="Input types">- <StoryGrid horizontal>- <InputFieldComponent type="number" defaultValue="42" />- <InputFieldComponent type="password" defaultValue="secret" />- <InputFieldComponent type="email" placeholder="[email protected]" />- <InputFieldComponent type="url" placeholder="https://…" />- <InputFieldComponent type="tel" placeholder="+1 555 0100" />- </StoryGrid>- </StorySection>-);+ <StorySection title="Input types">+ <StoryGrid horizontal>+ <InputFieldComponent type="number" defaultValue="42" />+ <InputFieldComponent type="password" defaultValue="secret" />+ <InputFieldComponent type="email" placeholder="[email protected]" />+ <InputFieldComponent type="url" placeholder="https://…" />+ <InputFieldComponent type="tel" placeholder="+1 555 0100" />+ </StoryGrid>+ </StorySection>-export const FieldSizingContent = () => (- <StorySection title="Field sizing content">- <StoryGrid horizontal>- <InputFieldComponent defaultValue="Content" fieldSizing="content" />- <InputFieldComponent defaultValue="Fixed" fieldSizing="fixed" />- </StoryGrid>- </StorySection>+ <StorySection title="Field sizing content">+ <StoryGrid horizontal>+ <InputFieldComponent defaultValue="Content" fieldSizing="content" />+ <InputFieldComponent defaultValue="Fixed" fieldSizing="fixed" />+ </StoryGrid>+ </StorySection>+ </>);diff --git a/packages/design-system/src/components/label.stories.tsx b/packages/design-system/src/components/label.stories.tsxindex 5c7ac8cd89..10d6004968 100644--- a/packages/design-system/src/components/label.stories.tsx+++ b/packages/design-system/src/components/label.stories.tsx@@ -1,10 +1,6 @@-import type { StoryFn } from "@storybook/react";import { StorySection, StoryGrid } from "./storybook";import { Label } from "./label";-import { Box } from "./box";import { Flex } from "./flex";-import * as Popover from "@radix-ui/react-popover";-import { theme } from "../stitches.config";export default {title: "Label",@@ -12,138 +8,85 @@ export default {const colors = ["default", "preset", "local", "overwritten", "remote"] as const;-const LabelStory: StoryFn<typeof Label> = ({ color, disabled, children }) => {- return (- <>- <StorySection title="Configurable">- <Box>- <Label color={color} disabled={disabled}>- {children}+const LabelStory = () => (+ <>+ <StorySection title="Colors">+ <StoryGrid horizontal>+ {colors.map((color) => (+ <Label key={color} color={color}>+ {color}</Label>- </Box>- </StorySection>+ ))}+ </StoryGrid>+ </StorySection>- {/* Check that spacebar is working if color property is not default */}- <StorySection title="Configurable with Popover if color is not default">- <Box>- <Popover.Root>- <Popover.Trigger asChild>- <Label color={color} disabled={disabled}>- {children}- </Label>- </Popover.Trigger>- <Popover.Content side="bottom" align="center">- <Box- css={{- backgroundColor: theme.colors.backgroundPanel,- p: theme.spacing[10],- my: theme.spacing[2],- }}- >- <input type="text" />- </Box>- </Popover.Content>- </Popover.Root>- </Box>- </StorySection>-- <StorySection title="Colors">- <StoryGrid horizontal>- {colors.map((color) => (- <Label key={color} color={color}>- {color}- </Label>- ))}- </StoryGrid>- </StorySection>-- <StorySection title="Section title">- <StoryGrid horizontal>- {colors.map((color) => (- <Label key={color} color={color} text="title">- {color}- </Label>- ))}- </StoryGrid>- </StorySection>-- <StorySection title="Focused (initially)">- <StoryGrid horizontal>- <Label color="local" ref={(element) => element?.focus()}>- Local+ <StorySection title="Section title">+ <StoryGrid horizontal>+ {colors.map((color) => (+ <Label key={color} color={color} text="title">+ {color}</Label>- </StoryGrid>- </StorySection>+ ))}+ </StoryGrid>+ </StorySection>- <StorySection title="With checkbox">- <input id="checkbox1" type="checkbox"></input>- <Label htmlFor="checkbox1">Label text</Label>- </StorySection>+ <StorySection title="Focused (initially)">+ <StoryGrid horizontal>+ <Label color="local" ref={(element) => element?.focus()}>+ Local+ </Label>+ </StoryGrid>+ </StorySection>- <StorySection title="Disabled">- <StoryGrid horizontal>- <Label disabled={true}>Label text</Label>- <div>- <input id="checkbox2" type="checkbox" disabled={true}></input>- <Label htmlFor="checkbox2" disabled={true}>- Label text- </Label>- </div>- </StoryGrid>- </StorySection>- </>- );-};-export { LabelStory as Label };+ <StorySection title="With checkbox">+ <input id="checkbox1" type="checkbox"></input>+ <Label htmlFor="checkbox1">Label text</Label>+ </StorySection>-LabelStory.argTypes = {- children: { control: "text" },- color: { control: "inline-radio", options: colors },- disabled: { control: "boolean" },-};+ <StorySection title="Disabled">+ <StoryGrid horizontal>+ <Label disabled={true}>Label text</Label>+ <div>+ <input id="checkbox2" type="checkbox" disabled={true}></input>+ <Label htmlFor="checkbox2" disabled={true}>+ Label text+ </Label>+ </div>+ </StoryGrid>+ </StorySection>-LabelStory.args = {- children: "Label text",- color: "default",- disabled: false,-};+ <StorySection title="Truncated">+ <Flex direction="column" gap="2" css={{ width: 150 }}>+ <Label truncate>+ This is a very long label text that should be truncated at the edge+ </Label>+ <Label color="local" truncate>+ This is a very long local label text that should be truncated+ </Label>+ </Flex>+ </StorySection>-export const Truncated = () => (- <StorySection title="Truncated">- <Flex direction="column" gap="2" css={{ width: 150 }}>- <Label truncate>- This is a very long label text that should be truncated at the edge- </Label>- <Label color="local" truncate>- This is a very long local label text that should be truncated- </Label>- </Flex>- </StorySection>-);+ <StorySection title="Mono text variant">+ <StoryGrid horizontal>+ <Label text="mono">Mono text</Label>+ <Label text="sentence">Sentence text</Label>+ <Label text="title">Title text</Label>+ </StoryGrid>+ </StorySection>-export const MonoText = () => (- <StorySection title="Mono text variant">- <StoryGrid horizontal>- <Label text="mono">Mono text</Label>- <Label text="sentence">Sentence text</Label>- <Label text="title">Title text</Label>- </StoryGrid>- </StorySection>-);+ <StorySection title="Inactive color">+ <Label color="inactive">Inactive label</Label>+ </StorySection>-export const InactiveColor = () => (- <StorySection title="Inactive color">- <Label color="inactive">Inactive label</Label>- </StorySection>+ <StorySection title="Tag variants">+ <StoryGrid horizontal>+ <Label tag="button">Explicit button tag</Label>+ <Label tag="label" color="local">+ Explicit label tag (with color)+ </Label>+ </StoryGrid>+ </StorySection>+ </>);-export const ButtonTag = () => (- <StorySection title="Tag variants">- <StoryGrid horizontal>- <Label tag="button">Explicit button tag</Label>- <Label tag="label" color="local">- Explicit label tag (with color)- </Label>- </StoryGrid>- </StorySection>-);+export { LabelStory as Label };diff --git a/packages/design-system/src/components/link.stories.tsx b/packages/design-system/src/components/link.stories.tsxindex 42b3616d9e..f72d327a83 100644--- a/packages/design-system/src/components/link.stories.tsx+++ b/packages/design-system/src/components/link.stories.tsx@@ -75,33 +75,27 @@ const LinkStory = () => (</div></StoryGrid></StorySection>+ <StorySection title="Stretched link">+ <Box css={{ position: "relative" }}>+ <Link href="" stretched>+ This link stretches to cover the parent container+ </Link>+ </Box>+ </StorySection>+ <StorySection title="Disabled link">+ <StoryGrid css={{ alignItems: "flex-start" }}>+ <Link href="" aria-disabled="true">+ Regular disabled+ </Link>+ <Link href="" variant="label" aria-disabled="true">+ Label disabled+ </Link>+ <Link href="" variant="mono" aria-disabled="true">+ Mono disabled+ </Link>+ </StoryGrid>+ </StorySection></>);export { LinkStory as Link };--export const Stretched = () => (- <StorySection title="Stretched link">- <Box css={{ position: "relative" }}>- <Link href="" stretched>- This link stretches to cover the parent container- </Link>- </Box>- </StorySection>-);--export const Disabled = () => (- <StorySection title="Disabled link">- <StoryGrid css={{ alignItems: "flex-start" }}>- <Link href="" aria-disabled="true">- Regular disabled- </Link>- <Link href="" variant="label" aria-disabled="true">- Label disabled- </Link>- <Link href="" variant="mono" aria-disabled="true">- Mono disabled- </Link>- </StoryGrid>- </StorySection>-);diff --git a/packages/design-system/src/components/list-position-indicator.stories.tsx b/packages/design-system/src/components/list-position-indicator.stories.tsxindex fdd39784e1..099f3805c0 100644--- a/packages/design-system/src/components/list-position-indicator.stories.tsx+++ b/packages/design-system/src/components/list-position-indicator.stories.tsx@@ -5,7 +5,7 @@ import {import { StorySection, StoryGrid } from "./storybook";export default {- title: "List position indicator",+ title: "List Position Indicator",parameters: {// to make white outline visiblebackgrounds: { default: "Maintenance Medium" },@@ -63,61 +63,55 @@ export const ListPositionIndicator = () => (</div></StoryGrid></StorySection>- </>-);--ListPositionIndicator.storyName = "List Position Indicator";-export const OffsetPositions = () => (- <StorySection title="Offset positions">- <StoryGrid>- <div- style={{- background: "black",- position: "relative",- width: 250,- height: 50,- }}- >- <ListPositionIndicatorComponent x={20} y={15} length={180} />- </div>- <div- style={{- background: "black",- position: "relative",- width: 250,- height: 50,- }}- >- <TreePositionIndicator x={20} y={25} length={180} />- </div>- </StoryGrid>- </StorySection>-);+ <StorySection title="Offset positions">+ <StoryGrid>+ <div+ style={{+ background: "black",+ position: "relative",+ width: 250,+ height: 50,+ }}+ >+ <ListPositionIndicatorComponent x={20} y={15} length={180} />+ </div>+ <div+ style={{+ background: "black",+ position: "relative",+ width: 250,+ height: 50,+ }}+ >+ <TreePositionIndicator x={20} y={25} length={180} />+ </div>+ </StoryGrid>+ </StorySection>-export const StringPositions = () => (- <StorySection title="String position values">- <StoryGrid>- <div- style={{- background: "black",- position: "relative",- width: 250,- height: 30,- }}- >- <ListPositionIndicatorComponent x="10%" y="50%" length="80%" />- </div>- <div- style={{- background: "black",- position: "relative",- width: 250,- height: 30,- }}- >- <TreePositionIndicator x="10%" y="50%" length="80%" />- </div>- </StoryGrid>- </StorySection>+ <StorySection title="String position values">+ <StoryGrid>+ <div+ style={{+ background: "black",+ position: "relative",+ width: 250,+ height: 30,+ }}+ >+ <ListPositionIndicatorComponent x="10%" y="50%" length="80%" />+ </div>+ <div+ style={{+ background: "black",+ position: "relative",+ width: 250,+ height: 30,+ }}+ >+ <TreePositionIndicator x="10%" y="50%" length="80%" />+ </div>+ </StoryGrid>+ </StorySection>+ </>);diff --git a/packages/design-system/src/components/menu.stories.tsx b/packages/design-system/src/components/menu.stories.tsxindex b5005d5ad4..d3d1c59011 100644--- a/packages/design-system/src/components/menu.stories.tsx+++ b/packages/design-system/src/components/menu.stories.tsx@@ -294,8 +294,6 @@ export const MenuMenuItem = () => (</>);-MenuMenuItem.storyName = "Menu, Menu Item";-export const StandaloneMenuItems = () => (<StorySection title="Standalone menu list"><MenuList width="regular">@@ -308,5 +306,5 @@ export const StandaloneMenuItems = () => ();export default {- title: "Menu, menu item",+ title: "Menu, Menu Item",};diff --git a/packages/design-system/src/components/nested-icon-label.stories.tsx b/packages/design-system/src/components/nested-icon-label.stories.tsxindex bf706bcc10..14e63143a6 100644--- a/packages/design-system/src/components/nested-icon-label.stories.tsx+++ b/packages/design-system/src/components/nested-icon-label.stories.tsx@@ -4,7 +4,7 @@ import { GapVerticalIcon } from "@webstudio-is/icons";import { StorySection, StoryGrid } from "./storybook";export default {- title: "Nested icon label",+ title: "Nested Icon Label",};export const NestedIconLabel = () => {@@ -40,4 +40,3 @@ export const NestedIconLabel = () => {</>);};-NestedIconLabel.storyName = "Nested Icon Label";diff --git a/packages/design-system/src/components/nested-input-button.stories.tsx b/packages/design-system/src/components/nested-input-button.stories.tsxindex e4f2adc408..b78a8f0464 100644--- a/packages/design-system/src/components/nested-input-button.stories.tsx+++ b/packages/design-system/src/components/nested-input-button.stories.tsx@@ -6,7 +6,7 @@ import {import { StoryGrid, StorySection } from "./storybook";export default {- title: "Nested select button",+ title: "Nested Select Button",};export const NestedSelectButton = () => {@@ -44,25 +44,20 @@ export const NestedSelectButton = () => {</NestedInputButton></StoryGrid></StorySection>+ <StorySection title="Unitless value">+ <StoryGrid horizontal>+ <NestedInputButton>{nestedSelectButtonUnitless}</NestedInputButton>+ <NestedInputButton data-state="hover">+ {nestedSelectButtonUnitless}+ </NestedInputButton>+ <NestedInputButton data-state="open">+ {nestedSelectButtonUnitless}+ </NestedInputButton>+ <NestedInputButton disabled>+ {nestedSelectButtonUnitless}+ </NestedInputButton>+ </StoryGrid>+ </StorySection></>);};--NestedSelectButton.storyName = "Nested Select Button";--export const UnitlessValue = () => (- <StorySection title="Unitless value">- <StoryGrid horizontal>- <NestedInputButton>{nestedSelectButtonUnitless}</NestedInputButton>- <NestedInputButton data-state="hover">- {nestedSelectButtonUnitless}- </NestedInputButton>- <NestedInputButton data-state="open">- {nestedSelectButtonUnitless}- </NestedInputButton>- <NestedInputButton disabled>- {nestedSelectButtonUnitless}- </NestedInputButton>- </StoryGrid>- </StorySection>-);diff --git a/packages/design-system/src/components/panel-banner.stories.tsx b/packages/design-system/src/components/panel-banner.stories.tsxindex da7f746cb2..82ebaa8be3 100644--- a/packages/design-system/src/components/panel-banner.stories.tsx+++ b/packages/design-system/src/components/panel-banner.stories.tsx@@ -15,7 +15,7 @@ import {} from "@webstudio-is/icons";export default {- title: "Panel banner",+ title: "Panel Banner",};export const PanelBanner = () => {@@ -84,28 +84,26 @@ export const PanelBanner = () => {</PanelBannerComponent></StoryGrid></StorySection>++ <StorySection title="Compact banners">+ <StoryGrid horizontal>+ <PanelBannerComponent style={{ width: 280 }}>+ <Text variant="regular">+ Simple informational message without a heading.+ </Text>+ </PanelBannerComponent>+ <PanelBannerComponent variant="warning" style={{ width: 280 }}>+ <Text variant="regular">+ A brief warning message without icons or headings.+ </Text>+ </PanelBannerComponent>+ <PanelBannerComponent variant="error" style={{ width: 280 }}>+ <Text variant="regular">+ Something went wrong. Please try again.+ </Text>+ </PanelBannerComponent>+ </StoryGrid>+ </StorySection></>);};--PanelBanner.storyName = "Panel Banner";--export const CompactBanner = () => (- <StorySection title="Compact banners">- <StoryGrid horizontal>- <PanelBannerComponent style={{ width: 280 }}>- <Text variant="regular">- Simple informational message without a heading.- </Text>- </PanelBannerComponent>- <PanelBannerComponent variant="warning" style={{ width: 280 }}>- <Text variant="regular">- A brief warning message without icons or headings.- </Text>- </PanelBannerComponent>- <PanelBannerComponent variant="error" style={{ width: 280 }}>- <Text variant="regular">Something went wrong. Please try again.</Text>- </PanelBannerComponent>- </StoryGrid>- </StorySection>-);diff --git a/packages/design-system/src/components/panel-tabs.stories.tsx b/packages/design-system/src/components/panel-tabs.stories.tsxindex 417edbfc40..a1ddcd8171 100644--- a/packages/design-system/src/components/panel-tabs.stories.tsx+++ b/packages/design-system/src/components/panel-tabs.stories.tsx@@ -1,4 +1,4 @@-import { StoryGrid } from "./storybook";+import { StoryGrid, StorySection } from "./storybook";import {PanelTabs as PanelTabsComponent,PanelTabsList,@@ -10,7 +10,7 @@ import { Text } from "./text";import { theme } from "../stitches.config";export default {- title: "Panel tabs",+ title: "Panel Tabs",};const Wrap = ({ children }: { children: React.ReactNode }) => (@@ -24,87 +24,90 @@ const Content = ({ children }: { children: React.ReactNode }) => ();export const PanelTabs = () => (- <StoryGrid>- <Wrap>- <PanelTabsComponent defaultValue="1">- <PanelTabsList>- <PanelTabsTrigger value="1">Tab 1</PanelTabsTrigger>- <PanelTabsTrigger value="2">Tab 2</PanelTabsTrigger>- <PanelTabsTrigger value="3">Tab 3</PanelTabsTrigger>- </PanelTabsList>- <PanelTabsContent value="1">- <Content>Content 1</Content>- </PanelTabsContent>- <PanelTabsContent value="2">- <Content>Content 2</Content>- </PanelTabsContent>- <PanelTabsContent value="3">- <Content>Content 3</Content>- </PanelTabsContent>- </PanelTabsComponent>- </Wrap>- </StoryGrid>-);-PanelTabs.storyName = "Panel Tabs";+ <>+ <StorySection title="Three tabs">+ <StoryGrid>+ <Wrap>+ <PanelTabsComponent defaultValue="1">+ <PanelTabsList>+ <PanelTabsTrigger value="1">Tab 1</PanelTabsTrigger>+ <PanelTabsTrigger value="2">Tab 2</PanelTabsTrigger>+ <PanelTabsTrigger value="3">Tab 3</PanelTabsTrigger>+ </PanelTabsList>+ <PanelTabsContent value="1">+ <Content>Content 1</Content>+ </PanelTabsContent>+ <PanelTabsContent value="2">+ <Content>Content 2</Content>+ </PanelTabsContent>+ <PanelTabsContent value="3">+ <Content>Content 3</Content>+ </PanelTabsContent>+ </PanelTabsComponent>+ </Wrap>+ </StoryGrid>+ </StorySection>-export const DisabledTab = () => (- <StoryGrid>- <Wrap>- <PanelTabsComponent defaultValue="1">- <PanelTabsList>- <PanelTabsTrigger value="1">Active</PanelTabsTrigger>- <PanelTabsTrigger value="2" disabled>- Disabled- </PanelTabsTrigger>- <PanelTabsTrigger value="3">Enabled</PanelTabsTrigger>- </PanelTabsList>- <PanelTabsContent value="1">- <Content>Active tab content</Content>- </PanelTabsContent>- <PanelTabsContent value="3">- <Content>Third tab content</Content>- </PanelTabsContent>- </PanelTabsComponent>- </Wrap>- </StoryGrid>-);+ <StorySection title="Disabled tab">+ <StoryGrid>+ <Wrap>+ <PanelTabsComponent defaultValue="1">+ <PanelTabsList>+ <PanelTabsTrigger value="1">Active</PanelTabsTrigger>+ <PanelTabsTrigger value="2" disabled>+ Disabled+ </PanelTabsTrigger>+ <PanelTabsTrigger value="3">Enabled</PanelTabsTrigger>+ </PanelTabsList>+ <PanelTabsContent value="1">+ <Content>Active tab content</Content>+ </PanelTabsContent>+ <PanelTabsContent value="3">+ <Content>Third tab content</Content>+ </PanelTabsContent>+ </PanelTabsComponent>+ </Wrap>+ </StoryGrid>+ </StorySection>-export const TwoTabs = () => (- <StoryGrid>- <Wrap>- <PanelTabsComponent defaultValue="a">- <PanelTabsList>- <PanelTabsTrigger value="a">Design</PanelTabsTrigger>- <PanelTabsTrigger value="b">Settings</PanelTabsTrigger>- </PanelTabsList>- <PanelTabsContent value="a">- <Content>Design content</Content>- </PanelTabsContent>- <PanelTabsContent value="b">- <Content>Settings content</Content>- </PanelTabsContent>- </PanelTabsComponent>- </Wrap>- </StoryGrid>-);+ <StorySection title="Two tabs">+ <StoryGrid>+ <Wrap>+ <PanelTabsComponent defaultValue="a">+ <PanelTabsList>+ <PanelTabsTrigger value="a">Design</PanelTabsTrigger>+ <PanelTabsTrigger value="b">Settings</PanelTabsTrigger>+ </PanelTabsList>+ <PanelTabsContent value="a">+ <Content>Design content</Content>+ </PanelTabsContent>+ <PanelTabsContent value="b">+ <Content>Settings content</Content>+ </PanelTabsContent>+ </PanelTabsComponent>+ </Wrap>+ </StoryGrid>+ </StorySection>-export const ManyTabs = () => (- <StoryGrid>- <Wrap>- <PanelTabsComponent defaultValue="1">- <PanelTabsList>- {Array.from({ length: 6 }, (_, i) => (- <PanelTabsTrigger key={i} value={String(i + 1)}>- Tab {i + 1}- </PanelTabsTrigger>- ))}- </PanelTabsList>- {Array.from({ length: 6 }, (_, i) => (- <PanelTabsContent key={i} value={String(i + 1)}>- <Content>Content {i + 1}</Content>- </PanelTabsContent>- ))}- </PanelTabsComponent>- </Wrap>- </StoryGrid>+ <StorySection title="Many tabs">+ <StoryGrid>+ <Wrap>+ <PanelTabsComponent defaultValue="1">+ <PanelTabsList>+ {Array.from({ length: 6 }, (_, i) => (+ <PanelTabsTrigger key={i} value={String(i + 1)}>+ Tab {i + 1}+ </PanelTabsTrigger>+ ))}+ </PanelTabsList>+ {Array.from({ length: 6 }, (_, i) => (+ <PanelTabsContent key={i} value={String(i + 1)}>+ <Content>Content {i + 1}</Content>+ </PanelTabsContent>+ ))}+ </PanelTabsComponent>+ </Wrap>+ </StoryGrid>+ </StorySection>+ </>);diff --git a/packages/design-system/src/components/panel-title.stories.tsx b/packages/design-system/src/components/panel-title.stories.tsxindex 8c98901560..beb351992c 100644--- a/packages/design-system/src/components/panel-title.stories.tsx+++ b/packages/design-system/src/components/panel-title.stories.tsx@@ -4,66 +4,75 @@ import {} from "./panel-title";import { Button } from "./button";import { XIcon, CopyIcon } from "@webstudio-is/icons";-import { StoryGrid } from "./storybook";+import { StoryGrid, StorySection } from "./storybook";import { Flex } from "./flex";import { Text } from "./text";export default {- title: "Panel title",+ title: "Panel Title",};export const PanelTitle = () => (- <StoryGrid>- <PanelTitleComponent>Without buttons</PanelTitleComponent>+ <>+ <StorySection title="Basic variants">+ <StoryGrid>+ <PanelTitleComponent>Without buttons</PanelTitleComponent>- <PanelTitleComponent suffix={<Button prefix={<XIcon />} color="ghost" />}>- One icon button- </PanelTitleComponent>+ <PanelTitleComponent+ suffix={<Button prefix={<XIcon />} color="ghost" />}+ >+ One icon button+ </PanelTitleComponent>- <PanelTitleComponent- suffix={- <>- <Button prefix={<XIcon />} color="ghost" />- <Button prefix={<CopyIcon />} color="ghost" />- </>- }- >- Many icon buttons- </PanelTitleComponent>+ <PanelTitleComponent+ suffix={+ <>+ <Button prefix={<XIcon />} color="ghost" />+ <Button prefix={<CopyIcon />} color="ghost" />+ </>+ }+ >+ Many icon buttons+ </PanelTitleComponent>- <PanelTitleComponent- suffix={- <>- <Button prefix={<XIcon />} color="ghost" />- <Button prefix={<CopyIcon />} color="ghost" />- <TitleSuffixSpacer />- <Button>Button</Button>- </>- }- >- Icon and regular buttons- </PanelTitleComponent>- </StoryGrid>-);-PanelTitle.storyName = "Panel Title";+ <PanelTitleComponent+ suffix={+ <>+ <Button prefix={<XIcon />} color="ghost" />+ <Button prefix={<CopyIcon />} color="ghost" />+ <TitleSuffixSpacer />+ <Button>Button</Button>+ </>+ }+ >+ Icon and regular buttons+ </PanelTitleComponent>+ </StoryGrid>+ </StorySection>-export const LongTitle = () => (- <StoryGrid>- <div style={{ width: 240 }}>- <PanelTitleComponent suffix={<Button prefix={<XIcon />} color="ghost" />}>- A very long panel title that should be truncated when it overflows- </PanelTitleComponent>- </div>- </StoryGrid>-);+ <StorySection title="Long title">+ <StoryGrid>+ <div style={{ width: 240 }}>+ <PanelTitleComponent+ suffix={<Button prefix={<XIcon />} color="ghost" />}+ >+ A very long panel title that should be truncated when it overflows+ </PanelTitleComponent>+ </div>+ </StoryGrid>+ </StorySection>-export const CustomChildren = () => (- <StoryGrid>- <PanelTitleComponent suffix={<Button prefix={<XIcon />} color="ghost" />}>- <Flex align="center" gap="1">- <CopyIcon />- <Text variant="titles">With icon</Text>- </Flex>- </PanelTitleComponent>- </StoryGrid>+ <StorySection title="Custom children">+ <StoryGrid>+ <PanelTitleComponent+ suffix={<Button prefix={<XIcon />} color="ghost" />}+ >+ <Flex align="center" gap="1">+ <CopyIcon />+ <Text variant="titles">With icon</Text>+ </Flex>+ </PanelTitleComponent>+ </StoryGrid>+ </StorySection>+ </>);diff --git a/packages/design-system/src/components/popover.stories.tsx b/packages/design-system/src/components/popover.stories.tsxindex 60af1663dd..e1cc10e9a1 100644--- a/packages/design-system/src/components/popover.stories.tsx+++ b/packages/design-system/src/components/popover.stories.tsx@@ -1,5 +1,6 @@import { Button } from "./button";import { Text } from "./text";+import { StorySection } from "./storybook";import {Popover,PopoverClose,@@ -18,92 +19,100 @@ export default {};const PopoverDemo = () => (- <Popover defaultOpen>- <PopoverTrigger asChild>- <Button>Open</Button>- </PopoverTrigger>- <PopoverContent>- <Flex css={{ padding: theme.spacing[7] }}>- <Text>Some content</Text>- </Flex>- <PopoverSeparator />- <Flex css={{ padding: theme.spacing[3] }}>- <PopoverClose>- <MenuItemButton>Close</MenuItemButton>- </PopoverClose>- </Flex>- </PopoverContent>- </Popover>-);-export { PopoverDemo as Popover };--export const WithTitle = () => (- <Popover defaultOpen>- <PopoverTrigger asChild>- <Button>Open</Button>- </PopoverTrigger>- <PopoverContent>- <Flex direction="column" gap="2" style={{ padding: 12 }}>- <Text>Content with a title bar</Text>- </Flex>- <PopoverTitle>Panel title</PopoverTitle>- </PopoverContent>- </Popover>-);--export const WithTitleActions = () => (- <Popover defaultOpen>- <PopoverTrigger asChild>- <Button>Open</Button>- </PopoverTrigger>- <PopoverContent>- <Flex direction="column" gap="2" style={{ padding: 12 }}>- <Text>Content with title actions</Text>- </Flex>- <PopoverTitle- suffix={- <PopoverTitleActions>- <PopoverClose />- </PopoverTitleActions>- }- >- Settings- </PopoverTitle>- </PopoverContent>- </Popover>-);--export const SidePlacement = () => (- <Flex gap="9" style={{ padding: 100 }}>+ <StorySection title="Popover"><Popover defaultOpen><PopoverTrigger asChild>- <Button>Right</Button>+ <Button>Open</Button></PopoverTrigger>- <PopoverContent side="right">- <Flex direction="column" gap="2" style={{ padding: 12 }}>- <Text>Right side</Text>+ <PopoverContent>+ <Flex css={{ padding: theme.spacing[7] }}>+ <Text>Some content</Text>+ </Flex>+ <PopoverSeparator />+ <Flex css={{ padding: theme.spacing[3] }}>+ <PopoverClose>+ <MenuItemButton>Close</MenuItemButton>+ </PopoverClose></Flex></PopoverContent></Popover>+ </StorySection>+);+export { PopoverDemo as Popover };++export const WithTitle = () => (+ <StorySection title="With title"><Popover defaultOpen><PopoverTrigger asChild>- <Button>Top</Button>+ <Button>Open</Button></PopoverTrigger>- <PopoverContent side="top">+ <PopoverContent><Flex direction="column" gap="2" style={{ padding: 12 }}>- <Text>Top side</Text>+ <Text>Content with a title bar</Text></Flex>+ <PopoverTitle>Panel title</PopoverTitle></PopoverContent></Popover>+ </StorySection>+);++export const WithTitleActions = () => (+ <StorySection title="With title actions"><Popover defaultOpen><PopoverTrigger asChild>- <Button>Bottom</Button>+ <Button>Open</Button></PopoverTrigger>- <PopoverContent side="bottom" sideOffset={16}>+ <PopoverContent><Flex direction="column" gap="2" style={{ padding: 12 }}>- <Text>Bottom with custom offset</Text>+ <Text>Content with title actions</Text></Flex>+ <PopoverTitle+ suffix={+ <PopoverTitleActions>+ <PopoverClose />+ </PopoverTitleActions>+ }+ >+ Settings+ </PopoverTitle></PopoverContent></Popover>- </Flex>+ </StorySection>+);++export const SidePlacement = () => (+ <StorySection title="Side placement">+ <Flex gap="9" style={{ padding: 100 }}>+ <Popover defaultOpen>+ <PopoverTrigger asChild>+ <Button>Right</Button>+ </PopoverTrigger>+ <PopoverContent side="right">+ <Flex direction="column" gap="2" style={{ padding: 12 }}>+ <Text>Right side</Text>+ </Flex>+ </PopoverContent>+ </Popover>+ <Popover defaultOpen>+ <PopoverTrigger asChild>+ <Button>Top</Button>+ </PopoverTrigger>+ <PopoverContent side="top">+ <Flex direction="column" gap="2" style={{ padding: 12 }}>+ <Text>Top side</Text>+ </Flex>+ </PopoverContent>+ </Popover>+ <Popover defaultOpen>+ <PopoverTrigger asChild>+ <Button>Bottom</Button>+ </PopoverTrigger>+ <PopoverContent side="bottom" sideOffset={16}>+ <Flex direction="column" gap="2" style={{ padding: 12 }}>+ <Text>Bottom with custom offset</Text>+ </Flex>+ </PopoverContent>+ </Popover>+ </Flex>+ </StorySection>);diff --git a/packages/design-system/src/components/position-grid.stories.tsx b/packages/design-system/src/components/position-grid.stories.tsxindex c52e8579f8..bbb9192805 100644--- a/packages/design-system/src/components/position-grid.stories.tsx+++ b/packages/design-system/src/components/position-grid.stories.tsx@@ -1,10 +1,10 @@import { action } from "@storybook/addon-actions";import { PositionGrid as PositionGridComponent } from "./position-grid";-import { Flex } from "./flex";import { useState } from "react";+import { StorySection, StoryGrid } from "./storybook";export default {- title: "Position grid",+ title: "Position Grid",};export const PositionGrid = () => {@@ -13,52 +13,55 @@ export const PositionGrid = () => {x: 50,});return (- <Flex gap="3">- <PositionGridComponent- onSelect={(position) => {- setSelectedPosition(position);- action("onSelect")(position);- }}- />- <PositionGridComponent- focused- onSelect={(position) => {- setSelectedPosition(position);- action("onSelect")(position);- }}- />- <PositionGridComponent- focused- selectedPosition={selectedPosition}- onSelect={(position) => {- setSelectedPosition(position);- action("onSelect")(position);- }}- />- <PositionGridComponent- focused- selectedPosition={selectedPosition}- onSelect={(position) => {- setSelectedPosition(position);- action("onSelect")(position);- }}- focusedPosition={{ y: 0, x: 0 }}- />- </Flex>+ <>+ <StorySection title="States">+ <StoryGrid horizontal>+ <PositionGridComponent+ onSelect={(position) => {+ setSelectedPosition(position);+ action("onSelect")(position);+ }}+ />+ <PositionGridComponent+ focused+ onSelect={(position) => {+ setSelectedPosition(position);+ action("onSelect")(position);+ }}+ />+ <PositionGridComponent+ focused+ selectedPosition={selectedPosition}+ onSelect={(position) => {+ setSelectedPosition(position);+ action("onSelect")(position);+ }}+ />+ <PositionGridComponent+ focused+ selectedPosition={selectedPosition}+ onSelect={(position) => {+ setSelectedPosition(position);+ action("onSelect")(position);+ }}+ focusedPosition={{ y: 0, x: 0 }}+ />+ </StoryGrid>+ </StorySection>+ <StorySection title="With keywords">+ <StoryGrid horizontal>+ <PositionGridComponent+ focused+ selectedPosition={{ x: "center", y: "bottom" }}+ onSelect={action("onSelect")}+ />+ <PositionGridComponent+ focused+ selectedPosition={{ x: "right", y: "center" }}+ onSelect={action("onSelect")}+ />+ </StoryGrid>+ </StorySection>+ </>);};--export const PositionGridWithKeywords = () => (- <Flex gap="3">- <PositionGridComponent- focused- selectedPosition={{ x: "center", y: "bottom" }}- onSelect={action("onSelect")}- />- <PositionGridComponent- focused- selectedPosition={{ x: "right", y: "center" }}- onSelect={action("onSelect")}- />- </Flex>-);diff --git a/packages/design-system/src/components/primitives/create-content-controller.stories.tsx b/packages/design-system/src/components/primitives/create-content-controller.stories.tsxindex f266c5fabf..1be222e825 100644--- a/packages/design-system/src/components/primitives/create-content-controller.stories.tsx+++ b/packages/design-system/src/components/primitives/create-content-controller.stories.tsx@@ -1,5 +1,6 @@import { useState, useRef, useEffect, type RefObject } from "react";import { createContentController } from "./create-content-controller";+import { StorySection } from "../storybook";const useContentController = ({ref,@@ -48,19 +49,21 @@ const ExampleContentController = () => {write: (target, value) => (target.value = value),});return (- <form style={{ fontFamily: "sans-serif" }}>- <fieldset>- <input- defaultValue="100px 20% fit-content calc(0.2px, -99em)"- ref={ref}- style={{ width: "50%" }}- />- </fieldset>- <fieldset>- <h1>Currently on: {content.name}</h1>- <h1>With a value of: {content.value}</h1>- </fieldset>- </form>+ <StorySection title="Create content controller">+ <form style={{ fontFamily: "sans-serif" }}>+ <fieldset>+ <input+ defaultValue="100px 20% fit-content calc(0.2px, -99em)"+ ref={ref}+ style={{ width: "50%" }}+ />+ </fieldset>+ <fieldset>+ <h1>Currently on: {content.name}</h1>+ <h1>With a value of: {content.value}</h1>+ </fieldset>+ </form>+ </StorySection>);};@@ -69,6 +72,6 @@ export const CreateContentController = Object.assign();export default {- title: "Primitives/Create content controller",+ title: "Primitives/Create Content Controller",component: ExampleContentController,};diff --git a/packages/design-system/src/components/primitives/dnd/canvas.stories.tsx b/packages/design-system/src/components/primitives/dnd/canvas.stories.tsxindex f55cc05a96..559a60dc26 100644--- a/packages/design-system/src/components/primitives/dnd/canvas.stories.tsx+++ b/packages/design-system/src/components/primitives/dnd/canvas.stories.tsx@@ -1,5 +1,6 @@import type { Meta } from "@storybook/react";import { type CSSProperties, useState, useRef } from "react";+import { StorySection } from "../../storybook";import { Box } from "../../box";import { useDrop, type DropTarget } from "./use-drop";import { useDrag } from "./use-drag";@@ -324,7 +325,7 @@ export const Canvas = () => {});return (- <>+ <StorySection title="Canvas"><Boxcss={{background: "white",@@ -355,7 +356,7 @@ export const Canvas = () => {{placementIndicator && (<PlacementIndicator placement={placementIndicator} />)}- </>+ </StorySection>);};diff --git a/packages/design-system/src/components/primitives/dnd/sortable-list.stories.tsx b/packages/design-system/src/components/primitives/dnd/sortable-list.stories.tsxindex 2820bf5060..4e123eb129 100644--- a/packages/design-system/src/components/primitives/dnd/sortable-list.stories.tsx+++ b/packages/design-system/src/components/primitives/dnd/sortable-list.stories.tsx@@ -1,5 +1,6 @@import type { Meta } from "@storybook/react";import { useState, useRef } from "react";+import { StorySection } from "../../storybook";import { Box } from "../../box";import { styled } from "../../../stitches.config";import { useDrop, type DropTarget } from "./use-drop";@@ -43,11 +44,11 @@ const Item = ({};export const SortableList = ({- direction,- reversed,+ direction = "vertical",+ reversed = false,}: {- direction: "horizontal" | "vertical" | "wrap";- reversed: boolean;+ direction?: "horizontal" | "vertical" | "wrap";+ reversed?: boolean;}) => {const [data, setData] = useState([{ id: "0", text: "First" },@@ -153,7 +154,7 @@ export const SortableList = ({});return (- <>+ <StorySection title="Sortable list"><Boxcss={{height: direction === "horizontal" ? "auto" : 500,@@ -204,21 +205,11 @@ export const SortableList = ({{placementIndicator && (<PlacementIndicator placement={placementIndicator} />)}- </>+ </StorySection>);};export default {- title: "Primitives/DND/Sortable list",+ title: "Primitives/DND/Sortable List",component: SortableList,- args: {- direction: "vertical",- reversed: false,- },- argTypes: {- direction: {- control: "select",- options: ["horizontal", "vertical", "wrap"],- },- },} satisfies Meta<typeof SortableList>;diff --git a/packages/design-system/src/components/primitives/numeric-gesture-control.stories.tsx b/packages/design-system/src/components/primitives/numeric-gesture-control.stories.tsxindex b5bfeb57a4..2b14301399 100644--- a/packages/design-system/src/components/primitives/numeric-gesture-control.stories.tsx+++ b/packages/design-system/src/components/primitives/numeric-gesture-control.stories.tsx@@ -4,6 +4,7 @@ import {type NumericScrubValue,type NumericScrubDirection,} from "./numeric-gesture-control";+import { StorySection } from "../storybook";const useNumericScrubControl = ({ref,@@ -53,28 +54,6 @@ const Input = ({return <input defaultValue={value} ref={ref} />;};-export const NumericGestureControl = Object.assign(Input.bind({}), {- args: { value: 0, direction: "horizontal", acceleration: 1 },-});--export default {- title: "Primitives/Numeric gesture control",- component: Input,- argTypes: {- value: {- control: { type: "number" },- },- direction: {- options: ["horizontal", "vertical"],- control: { type: "radio" },- },- },-};--export const VerticalControl = Object.assign(Input.bind({}), {- args: { value: 0, direction: "vertical", acceleration: 1 },-});-const ConstrainedInput = ({value,direction,@@ -111,11 +90,28 @@ const ConstrainedInput = ({return <input defaultValue={value} ref={ref} />;};-export const ConstrainedControl = () => (- <ConstrainedInput- value={50}- direction="horizontal"- minValue={0}- maxValue={100}- />+export const NumericGestureControl = () => (+ <>+ <StorySection title="Horizontal control">+ <Input value={0} direction="horizontal" acceleration={1} />+ </StorySection>++ <StorySection title="Vertical control">+ <Input value={0} direction="vertical" acceleration={1} />+ </StorySection>++ <StorySection title="Constrained control (0-100)">+ <ConstrainedInput+ value={50}+ direction="horizontal"+ minValue={0}+ maxValue={100}+ />+ </StorySection>+ </>);++export default {+ title: "Primitives/Numeric Gesture Control",+ component: Input,+};diff --git a/packages/design-system/src/components/primitives/small-button.stories.tsx b/packages/design-system/src/components/primitives/small-button.stories.tsxindex fc084f278d..541b6a39e8 100644--- a/packages/design-system/src/components/primitives/small-button.stories.tsx+++ b/packages/design-system/src/components/primitives/small-button.stories.tsx@@ -6,9 +6,10 @@ import {SmallButton as SmallButtonComponent,smallButtonVariants,} from "./small-button";+import { StorySection } from "../storybook";export default {- title: "Primitives/Small button",+ title: "Primitives/Small Button",component: SmallButtonComponent,};@@ -19,72 +20,76 @@ const icons = [];export const SmallButton = () => (- <Grid columns={4} gap="3" align="center" css={{ width: 400 }}>- <Text variant="labels">Variant</Text>- {icons.map(({ label }) => (- <Text key={label} variant="labels">- {label}- </Text>- ))}+ <>+ <StorySection title="Variants">+ <Grid columns={4} gap="3" align="center" css={{ width: 400 }}>+ <Text variant="labels">Variant</Text>+ {icons.map(({ label }) => (+ <Text key={label} variant="labels">+ {label}+ </Text>+ ))}- {smallButtonVariants.map((variant) => (- <>- <Text variant="labels">{variant}</Text>- {icons.map(({ icon, label }) => (- <Flex key={`${variant}-${label}`} gap="2" align="center">- <SmallButtonComponent variant={variant}>- {icon}- </SmallButtonComponent>- <SmallButtonComponent variant={variant} disabled>- {icon}- </SmallButtonComponent>- </Flex>+ {smallButtonVariants.map((variant) => (+ <>+ <Text variant="labels">{variant}</Text>+ {icons.map(({ icon, label }) => (+ <Flex key={`${variant}-${label}`} gap="2" align="center">+ <SmallButtonComponent variant={variant}>+ {icon}+ </SmallButtonComponent>+ <SmallButtonComponent variant={variant} disabled>+ {icon}+ </SmallButtonComponent>+ </Flex>+ ))}+ </>))}- </>- ))}- </Grid>-);+ </Grid>+ </StorySection>-export const SmallButtonBleed = () => (- <Grid columns={2} gap="3" align="center" css={{ width: 200 }}>- <Text variant="labels">Bleed (default)</Text>- <Text variant="labels">No bleed</Text>- {icons.map(({ icon, label }) => (- <>- <Flex key={`bleed-${label}`} align="center">- <SmallButtonComponent>{icon}</SmallButtonComponent>- </Flex>- <Flex key={`no-bleed-${label}`} align="center">- <SmallButtonComponent bleed={false}>{icon}</SmallButtonComponent>- </Flex>- </>- ))}- </Grid>-);+ <StorySection title="Bleed">+ <Grid columns={2} gap="3" align="center" css={{ width: 200 }}>+ <Text variant="labels">Bleed (default)</Text>+ <Text variant="labels">No bleed</Text>+ {icons.map(({ icon, label }) => (+ <>+ <Flex key={`bleed-${label}`} align="center">+ <SmallButtonComponent>{icon}</SmallButtonComponent>+ </Flex>+ <Flex key={`no-bleed-${label}`} align="center">+ <SmallButtonComponent bleed={false}>{icon}</SmallButtonComponent>+ </Flex>+ </>+ ))}+ </Grid>+ </StorySection>-export const SmallButtonStates = () => (- <Grid columns={3} gap="3" align="center" css={{ width: 300 }}>- <Text variant="labels">Default</Text>- <Text variant="labels">Open state</Text>- <Text variant="labels">Focused</Text>- {smallButtonVariants.map((variant) => (- <>- <Flex key={`default-${variant}`} align="center">- <SmallButtonComponent variant={variant}>- <PlusIcon />- </SmallButtonComponent>- </Flex>- <Flex key={`open-${variant}`} align="center">- <SmallButtonComponent variant={variant} data-state="open">- <PlusIcon />- </SmallButtonComponent>- </Flex>- <Flex key={`focused-${variant}`} align="center">- <SmallButtonComponent variant={variant} data-focused={true}>- <PlusIcon />- </SmallButtonComponent>- </Flex>- </>- ))}- </Grid>+ <StorySection title="States">+ <Grid columns={3} gap="3" align="center" css={{ width: 300 }}>+ <Text variant="labels">Default</Text>+ <Text variant="labels">Open state</Text>+ <Text variant="labels">Focused</Text>+ {smallButtonVariants.map((variant) => (+ <>+ <Flex key={`default-${variant}`} align="center">+ <SmallButtonComponent variant={variant}>+ <PlusIcon />+ </SmallButtonComponent>+ </Flex>+ <Flex key={`open-${variant}`} align="center">+ <SmallButtonComponent variant={variant} data-state="open">+ <PlusIcon />+ </SmallButtonComponent>+ </Flex>+ <Flex key={`focused-${variant}`} align="center">+ <SmallButtonComponent variant={variant} data-focused={true}>+ <PlusIcon />+ </SmallButtonComponent>+ </Flex>+ </>+ ))}+ </Grid>+ </StorySection>+ </>);diff --git a/packages/design-system/src/components/pro-badge.stories.tsx b/packages/design-system/src/components/pro-badge.stories.tsxindex c911db26de..1b1a7b4ba4 100644--- a/packages/design-system/src/components/pro-badge.stories.tsx+++ b/packages/design-system/src/components/pro-badge.stories.tsx@@ -1,22 +1,25 @@-import { Flex } from "./flex";import { ProBadge as ProBadgeComponent } from "./pro-badge";+import { StorySection, StoryGrid } from "./storybook";export default {- title: "Pro badge",+ title: "Pro Badge",component: ProBadgeComponent,};export const ProBadge = () => (- <Flex gap="3" align="center">- <ProBadgeComponent>Pro</ProBadgeComponent>- <ProBadgeComponent>Enterprise</ProBadgeComponent>- <ProBadgeComponent>Upgrade</ProBadgeComponent>- </Flex>-);--export const ProBadgeTruncated = () => (- <Flex direction="column" gap="3" style={{ width: 80 }}>- <ProBadgeComponent>Very long enterprise plan name</ProBadgeComponent>- <ProBadgeComponent>Short</ProBadgeComponent>- </Flex>+ <>+ <StorySection title="Labels">+ <StoryGrid horizontal>+ <ProBadgeComponent>Pro</ProBadgeComponent>+ <ProBadgeComponent>Enterprise</ProBadgeComponent>+ <ProBadgeComponent>Upgrade</ProBadgeComponent>+ </StoryGrid>+ </StorySection>+ <StorySection title="Truncated">+ <StoryGrid css={{ width: 80 }}>+ <ProBadgeComponent>Very long enterprise plan name</ProBadgeComponent>+ <ProBadgeComponent>Short</ProBadgeComponent>+ </StoryGrid>+ </StorySection>+ </>);diff --git a/packages/design-system/src/components/progress.stories.tsx b/packages/design-system/src/components/progress.stories.tsxindex 91f02abdf3..465ba6eb6c 100644--- a/packages/design-system/src/components/progress.stories.tsx+++ b/packages/design-system/src/components/progress.stories.tsx@@ -3,6 +3,7 @@ import { Flex } from "./flex";import { Button } from "./button";import { Progress as ProgressComponent } from "./progress";import { Text } from "./text";+import { StorySection, StoryGrid } from "./storybook";export default {title: "Progress",@@ -11,34 +12,42 @@ export default {export const Progress = () => {const [value, setValue] = useState(50);+ const [transitionValue, setTransitionValue] = useState(0);return (- <Flex direction="column" gap="3" css={{ width: 300 }}>- {[0, 25, 50, 75, 100].map((v) => (- <Flex key={v} gap="2" align="center">- <Text css={{ width: 40 }}>{v}%</Text>- <ProgressComponent value={v} />- </Flex>- ))}- <Flex gap="2" align="center">- <ProgressComponent value={value} />- <Button onClick={() => setValue(Math.max(0, value - 10))}>-10</Button>- <Button onClick={() => setValue(Math.min(100, value + 10))}>+10</Button>- </Flex>- </Flex>- );-};--export const ProgressCustomTransition = () => {- const [value, setValue] = useState(0);- return (- <Flex direction="column" gap="3" css={{ width: 300 }}>- <Text>Slow transition (1s)</Text>- <ProgressComponent value={value} transitionDuration="1000ms" />- <Flex gap="2">- <Button onClick={() => setValue(0)}>0%</Button>- <Button onClick={() => setValue(50)}>50%</Button>- <Button onClick={() => setValue(100)}>100%</Button>- </Flex>- </Flex>+ <>+ <StorySection title="Values">+ <StoryGrid css={{ width: 300 }}>+ {[0, 25, 50, 75, 100].map((v) => (+ <Flex key={v} gap="2" align="center">+ <Text css={{ width: 40 }}>{v}%</Text>+ <ProgressComponent value={v} />+ </Flex>+ ))}+ <Flex gap="2" align="center">+ <ProgressComponent value={value} />+ <Button onClick={() => setValue(Math.max(0, value - 10))}>+ -10+ </Button>+ <Button onClick={() => setValue(Math.min(100, value + 10))}>+ +10+ </Button>+ </Flex>+ </StoryGrid>+ </StorySection>+ <StorySection title="Custom transition">+ <StoryGrid css={{ width: 300 }}>+ <Text>Slow transition (1s)</Text>+ <ProgressComponent+ value={transitionValue}+ transitionDuration="1000ms"+ />+ <Flex gap="2">+ <Button onClick={() => setTransitionValue(0)}>0%</Button>+ <Button onClick={() => setTransitionValue(50)}>50%</Button>+ <Button onClick={() => setTransitionValue(100)}>100%</Button>+ </Flex>+ </StoryGrid>+ </StorySection>+ </>);};diff --git a/packages/design-system/src/components/radio.stories.tsx b/packages/design-system/src/components/radio.stories.tsxindex 06d2ec5f49..143867616f 100644--- a/packages/design-system/src/components/radio.stories.tsx+++ b/packages/design-system/src/components/radio.stories.tsx@@ -12,6 +12,7 @@ export default {};export const Radio = () => {+ const [value, setValue] = useState("A");return (<><StorySection title="Enabled">@@ -54,30 +55,24 @@ export const Radio = () => {</RadioAndLabel></RadioGroup></StorySection>- </>- );-};-Radio.storyName = "Radio";-export const RadioControlled = () => {- const [value, setValue] = useState("A");- return (- <StorySection title="Controlled">- <RadioGroup value={value} onValueChange={setValue}>- <RadioAndLabel>- <RadioComponent value="A" id="ctrl-A" />- <Label htmlFor="ctrl-A">Option A</Label>- </RadioAndLabel>- <RadioAndLabel>- <RadioComponent value="B" id="ctrl-B" />- <Label htmlFor="ctrl-B">Option B</Label>- </RadioAndLabel>- <RadioAndLabel>- <RadioComponent value="C" id="ctrl-C" />- <Label htmlFor="ctrl-C">Option C</Label>- </RadioAndLabel>- </RadioGroup>- <Label>Selected: {value}</Label>- </StorySection>+ <StorySection title="Controlled">+ <RadioGroup value={value} onValueChange={setValue}>+ <RadioAndLabel>+ <RadioComponent value="A" id="ctrl-A" />+ <Label htmlFor="ctrl-A">Option A</Label>+ </RadioAndLabel>+ <RadioAndLabel>+ <RadioComponent value="B" id="ctrl-B" />+ <Label htmlFor="ctrl-B">Option B</Label>+ </RadioAndLabel>+ <RadioAndLabel>+ <RadioComponent value="C" id="ctrl-C" />+ <Label htmlFor="ctrl-C">Option C</Label>+ </RadioAndLabel>+ </RadioGroup>+ <Label>Selected: {value}</Label>+ </StorySection>+ </>);};diff --git a/packages/design-system/src/components/scroll-area.stories.tsx b/packages/design-system/src/components/scroll-area.stories.tsxindex ec0e302c0f..03995569a7 100644--- a/packages/design-system/src/components/scroll-area.stories.tsx+++ b/packages/design-system/src/components/scroll-area.stories.tsx@@ -5,7 +5,7 @@ import { theme } from "..";import { Flex } from "./flex";export default {- title: "Scroll area",+ title: "Scroll Area",};export const ScrollArea = () => {@@ -38,19 +38,17 @@ export const ScrollArea = () => {{content}</ScrollAreaComponent></StorySection>++ <StorySection title="No overflow">+ <div style={{ height: 200, width: 200 }}>+ <ScrollAreaComponent>+ <Flex direction="column" gap="2" style={{ padding: 8 }}>+ <Text>Short content</Text>+ <Text>No scrollbar needed</Text>+ </Flex>+ </ScrollAreaComponent>+ </div>+ </StorySection></>);};--export const MinimalContent = () => (- <StorySection title="No overflow">- <div style={{ height: 200, width: 200 }}>- <ScrollAreaComponent>- <Flex direction="column" gap="2" style={{ padding: 8 }}>- <Text>Short content</Text>- <Text>No scrollbar needed</Text>- </Flex>- </ScrollAreaComponent>- </div>- </StorySection>-);diff --git a/packages/design-system/src/components/search-field.stories.tsx b/packages/design-system/src/components/search-field.stories.tsxindex 8b6e828a86..f4da20128d 100644--- a/packages/design-system/src/components/search-field.stories.tsx+++ b/packages/design-system/src/components/search-field.stories.tsx@@ -5,58 +5,58 @@ import { SearchField as SearchFieldComponent } from "./search-field";import { StorySection } from "./storybook";export default {- title: "Search field",+ title: "Search Field",component: SearchFieldComponent,};-export const SearchField = () => (- <>- <StorySection title="States">- <Flex direction="column" gap="3" css={{ width: 240 }}>- <Text variant="labels">Empty</Text>- <SearchFieldComponent placeholder="Search…" />- <Text variant="labels">With value</Text>- <SearchFieldComponent value="somevalue" title="Search" />- <Text variant="labels">Auto focus</Text>- <SearchFieldComponent autoFocus placeholder="Focused on mount" />- <Text variant="labels">Disabled</Text>- <SearchFieldComponent disabled placeholder="Disabled" />- </Flex>- </StorySection>- </>-);--export const WithAbortCallback = () => {+export const SearchField = () => {const [log, setLog] = useState<string[]>([]);const addLog = (msg: string) => setLog((prev) => [...prev.slice(-4), msg]);+return (- <Flex direction="column" gap="3" style={{ width: 240 }}>- <Text variant="labels">Type and click X or press Escape</Text>- <SearchFieldComponent- placeholder="Type and clear…"- onAbort={() => addLog("onAbort fired")}- />- {log.map((entry, i) => (- <Text key={i} variant="mono">- {entry}- </Text>- ))}- </Flex>- );-};+ <>+ <StorySection title="States">+ <Flex direction="column" gap="3" css={{ width: 240 }}>+ <Text variant="labels">Empty</Text>+ <SearchFieldComponent placeholder="Search…" />+ <Text variant="labels">With value</Text>+ <SearchFieldComponent value="somevalue" title="Search" />+ <Text variant="labels">Auto focus</Text>+ <SearchFieldComponent autoFocus placeholder="Focused on mount" />+ <Text variant="labels">Disabled</Text>+ <SearchFieldComponent disabled placeholder="Disabled" />+ </Flex>+ </StorySection>-export const WithErrorColor = () => (- <Flex direction="column" gap="3" style={{ width: 240 }}>- <Text variant="labels">Error color</Text>- <SearchFieldComponent color="error" placeholder="Error state" />- </Flex>-);+ <StorySection title="With abort callback">+ <Flex direction="column" gap="3" css={{ width: 240 }}>+ <Text variant="labels">Type and click X or press Escape</Text>+ <SearchFieldComponent+ placeholder="Type and clear…"+ onAbort={() => addLog("onAbort fired")}+ />+ {log.map((entry, i) => (+ <Text key={i} variant="mono">+ {entry}+ </Text>+ ))}+ </Flex>+ </StorySection>-export const SmallSearchField = () => (- <Flex direction="column" gap="3" style={{ width: 240 }}>- <Text variant="labels">Size 1</Text>- <SearchFieldComponent size="1" placeholder="Small search" />- <Text variant="labels">Size 2 (default)</Text>- <SearchFieldComponent size="2" placeholder="Default search" />- </Flex>-);+ <StorySection title="Error color">+ <Flex direction="column" gap="3" css={{ width: 240 }}>+ <SearchFieldComponent color="error" placeholder="Error state" />+ </Flex>+ </StorySection>++ <StorySection title="Sizes">+ <Flex direction="column" gap="3" css={{ width: 240 }}>+ <Text variant="labels">Size 1</Text>+ <SearchFieldComponent size="1" placeholder="Small search" />+ <Text variant="labels">Size 2 (default)</Text>+ <SearchFieldComponent size="2" placeholder="Default search" />+ </Flex>+ </StorySection>+ </>+ );+};diff --git a/packages/design-system/src/components/section-title.stories.tsx b/packages/design-system/src/components/section-title.stories.tsxindex 8a81fec226..ccea721dc1 100644--- a/packages/design-system/src/components/section-title.stories.tsx+++ b/packages/design-system/src/components/section-title.stories.tsx@@ -8,7 +8,7 @@ import type { ComponentProps } from "react";import { PlusIcon } from "@webstudio-is/icons";export default {- title: "Section title",+ title: "Section Title",};const Wrap = ({ children }: { children: React.ReactNode }) => (@@ -112,47 +112,41 @@ export const SectionTitle = () => (<Variants inactive state="closed" /></StoryGrid></StorySection>- </>-);-SectionTitle.storyName = "Section Title";--export const NonCollapsible = () => (- <StorySection title="Non-collapsible">- <StoryGrid>- <Wrap>- <SectionTitleComponent collapsible={false}>- <SectionTitleLabel>Not collapsible</SectionTitleLabel>- </SectionTitleComponent>- </Wrap>- <Wrap>- <SectionTitleComponent- collapsible={false}- suffix={<SectionTitleButton prefix={<PlusIcon />} />}- >- <SectionTitleLabel>With button</SectionTitleLabel>- </SectionTitleComponent>- </Wrap>- </StoryGrid>- </StorySection>-);+ <StorySection title="Non-collapsible">+ <StoryGrid>+ <Wrap>+ <SectionTitleComponent collapsible={false}>+ <SectionTitleLabel>Not collapsible</SectionTitleLabel>+ </SectionTitleComponent>+ </Wrap>+ <Wrap>+ <SectionTitleComponent+ collapsible={false}+ suffix={<SectionTitleButton prefix={<PlusIcon />} />}+ >+ <SectionTitleLabel>With button</SectionTitleLabel>+ </SectionTitleComponent>+ </Wrap>+ </StoryGrid>+ </StorySection>-export const OverwrittenDots = () => (- <StorySection title="Overwritten dot">- <StoryGrid>- <Wrap>- <SectionTitleComponent dots={["overwritten"]} data-state="closed">- <SectionTitleLabel>Overwritten</SectionTitleLabel>- </SectionTitleComponent>- </Wrap>- <Wrap>- <SectionTitleComponent- dots={["local", "overwritten", "remote"]}- data-state="closed"- >- <SectionTitleLabel>All dots</SectionTitleLabel>- </SectionTitleComponent>- </Wrap>- </StoryGrid>- </StorySection>+ <StorySection title="Overwritten dot">+ <StoryGrid>+ <Wrap>+ <SectionTitleComponent dots={["overwritten"]} data-state="closed">+ <SectionTitleLabel>Overwritten</SectionTitleLabel>+ </SectionTitleComponent>+ </Wrap>+ <Wrap>+ <SectionTitleComponent+ dots={["local", "overwritten", "remote"]}+ data-state="closed"+ >+ <SectionTitleLabel>All dots</SectionTitleLabel>+ </SectionTitleComponent>+ </Wrap>+ </StoryGrid>+ </StorySection>+ </>);diff --git a/packages/design-system/src/components/select-button.stories.tsx b/packages/design-system/src/components/select-button.stories.tsxindex a9359522b8..0470b36f6a 100644--- a/packages/design-system/src/components/select-button.stories.tsx+++ b/packages/design-system/src/components/select-button.stories.tsx@@ -5,7 +5,7 @@ import { GapVerticalIcon } from "@webstudio-is/icons";import { StorySection, StoryGrid } from "./storybook";export default {- title: "Select button",+ title: "Select Button",};const iconLabel = (@@ -14,6 +14,23 @@ const iconLabel = (</NestedIconLabel>);+const InteractiveDemo = () => {+ const [clicked, setClicked] = useState(false);+ return (+ <StoryGrid horizontal>+ <SelectButtonComponent onClick={() => setClicked(!clicked)}>+ {clicked ? "Clicked!" : "Click me"}+ </SelectButtonComponent>+ <SelectButtonComponent+ prefix={iconLabel}+ onClick={() => setClicked(!clicked)}+ >+ {clicked ? "Clicked!" : "With prefix"}+ </SelectButtonComponent>+ </StoryGrid>+ );+};+export const SelectButton = () => {return (<>@@ -101,26 +118,9 @@ export const SelectButton = () => {</SelectButtonComponent></StoryGrid></StorySection>+ <StorySection title="Interactive">+ <InteractiveDemo />+ </StorySection></>);};-SelectButton.storyName = "Select Button";--export const Interactive = () => {- const [clicked, setClicked] = useState(false);- return (- <StorySection title="Interactive">- <StoryGrid horizontal>- <SelectButtonComponent onClick={() => setClicked(!clicked)}>- {clicked ? "Clicked!" : "Click me"}- </SelectButtonComponent>- <SelectButtonComponent- prefix={iconLabel}- onClick={() => setClicked(!clicked)}- >- {clicked ? "Clicked!" : "With prefix"}- </SelectButtonComponent>- </StoryGrid>- </StorySection>- );-};diff --git a/packages/design-system/src/components/select.stories.tsx b/packages/design-system/src/components/select.stories.tsxindex 0a1ef85a38..f998af9012 100644--- a/packages/design-system/src/components/select.stories.tsx+++ b/packages/design-system/src/components/select.stories.tsx@@ -4,6 +4,7 @@ import { NestedIconLabel } from "./nested-icon-label";import { Select as SelectComponent, type SelectOption } from "./select";import { Flex } from "./flex";import { Text } from "./text";+import { StorySection } from "./storybook";export default {title: "Select",@@ -50,80 +51,82 @@ export const Select = () => {: "No fruit selected";return (- <Flex direction="column" gap="5" css={{ maxWidth: 300 }}>- <Flex direction="column" gap="1">- <Text variant="labels">Simple</Text>- <SelectComponent- name="fruit"- options={fruits}- value={simple}- onChange={setSimple}- />- </Flex>- <Flex direction="column" gap="1">- <Text variant="labels">Placeholder</Text>- <SelectComponent placeholder="Select fruit" options={fruits} />- </Flex>- <Flex direction="column" gap="1">- <Text variant="labels">Disabled</Text>- <SelectComponent disabled options={fruits} />- </Flex>- <Flex direction="column" gap="1">- <Text variant="labels">Full width</Text>- <SelectComponent- name="fruit"- options={["Apple", "Banana", "Orange Orange Orange Orange Orange"]}- defaultValue="Apple"- fullWidth- />- </Flex>- <Flex direction="column" gap="1">- <Text variant="labels">With icon prefix</Text>- <SelectComponent- prefix={- <NestedIconLabel>- <GapVerticalIcon />- </NestedIconLabel>- }- name="fruit"- options={fruits}- defaultValue="Apple"- />- </Flex>- <Flex direction="column" gap="1">- <Text variant="labels">Complex items (emoji)</Text>- <SelectComponent- name="fruit"- options={emojiOptions}- value={emoji}- onChange={setEmoji}- getLabel={getEmojiLabel}- />- </Flex>- <Flex direction="column" gap="1">- <Text variant="labels">With descriptions</Text>- <SelectComponent- name="fruit"- options={descriptionOptions}- value={desc}- getValue={(v) => v.label}- onChange={setDesc}- getLabel={(o) => o.label}- getDescription={(o) => (- <div style={{ width: 150 }}>{o.description}</div>- )}- />+ <StorySection title="Select">+ <Flex direction="column" gap="5" css={{ maxWidth: 300 }}>+ <Flex direction="column" gap="1">+ <Text variant="labels">Simple</Text>+ <SelectComponent+ name="fruit"+ options={fruits}+ value={simple}+ onChange={setSimple}+ />+ </Flex>+ <Flex direction="column" gap="1">+ <Text variant="labels">Placeholder</Text>+ <SelectComponent placeholder="Select fruit" options={fruits} />+ </Flex>+ <Flex direction="column" gap="1">+ <Text variant="labels">Disabled</Text>+ <SelectComponent disabled options={fruits} />+ </Flex>+ <Flex direction="column" gap="1">+ <Text variant="labels">Full width</Text>+ <SelectComponent+ name="fruit"+ options={["Apple", "Banana", "Orange Orange Orange Orange Orange"]}+ defaultValue="Apple"+ fullWidth+ />+ </Flex>+ <Flex direction="column" gap="1">+ <Text variant="labels">With icon prefix</Text>+ <SelectComponent+ prefix={+ <NestedIconLabel>+ <GapVerticalIcon />+ </NestedIconLabel>+ }+ name="fruit"+ options={fruits}+ defaultValue="Apple"+ />+ </Flex>+ <Flex direction="column" gap="1">+ <Text variant="labels">Complex items (emoji)</Text>+ <SelectComponent+ name="fruit"+ options={emojiOptions}+ value={emoji}+ onChange={setEmoji}+ getLabel={getEmojiLabel}+ />+ </Flex>+ <Flex direction="column" gap="1">+ <Text variant="labels">With descriptions</Text>+ <SelectComponent+ name="fruit"+ options={descriptionOptions}+ value={desc}+ getValue={(v) => v.label}+ onChange={setDesc}+ getLabel={(o) => o.label}+ getDescription={(o) => (+ <div style={{ width: 150 }}>{o.description}</div>+ )}+ />+ </Flex>+ <Flex direction="column" gap="1">+ <Text variant="labels">Many items (100)</Text>+ <SelectComponent+ name="fruit"+ options={manyItems}+ value={boundary}+ onChange={setBoundary}+ />+ </Flex></Flex>- <Flex direction="column" gap="1">- <Text variant="labels">Many items (100)</Text>- <SelectComponent- name="fruit"- options={manyItems}- value={boundary}- onChange={setBoundary}- />- </Flex>- </Flex>+ </StorySection>);};@@ -131,29 +134,33 @@ export const WithItemHighlight = () => {const [value, setValue] = useState(fruits[0]);const [highlighted, setHighlighted] = useState<string | undefined>();return (- <Flex direction="column" gap="2" style={{ maxWidth: 300 }}>- <Text variant="labels">Highlighted: {highlighted ?? "none"}</Text>- <SelectComponent- options={fruits}- value={value}- onChange={setValue}- onItemHighlight={setHighlighted}- />- </Flex>+ <StorySection title="With item highlight">+ <Flex direction="column" gap="2" style={{ maxWidth: 300 }}>+ <Text variant="labels">Highlighted: {highlighted ?? "none"}</Text>+ <SelectComponent+ options={fruits}+ value={value}+ onChange={setValue}+ onItemHighlight={setHighlighted}+ />+ </Flex>+ </StorySection>);};export const ControlledOpen = () => {const [open, setOpen] = useState(false);return (- <Flex direction="column" gap="2" style={{ maxWidth: 300 }}>- <Text variant="labels">Open: {String(open)}</Text>- <SelectComponent- options={fruits}- defaultValue="Apple"- open={open}- onOpenChange={setOpen}- />- </Flex>+ <StorySection title="Controlled open">+ <Flex direction="column" gap="2" style={{ maxWidth: 300 }}>+ <Text variant="labels">Open: {String(open)}</Text>+ <SelectComponent+ options={fruits}+ defaultValue="Apple"+ open={open}+ onOpenChange={setOpen}+ />+ </Flex>+ </StorySection>);};diff --git a/packages/design-system/src/components/separator.stories.tsx b/packages/design-system/src/components/separator.stories.tsxindex 3dbf7f84c9..ec22bee3c4 100644--- a/packages/design-system/src/components/separator.stories.tsx+++ b/packages/design-system/src/components/separator.stories.tsx@@ -24,15 +24,13 @@ export const Separator = () => (<Text>Right</Text></Flex></StorySection>- </>-);-export const Decorative = () => (- <StorySection title="Decorative (no semantic role)">- <Flex direction="column" gap="2" css={{ width: 200 }}>- <Text>Above</Text>- <SeparatorComponent decorative />- <Text>Below (separator has role=none)</Text>- </Flex>- </StorySection>+ <StorySection title="Decorative (no semantic role)">+ <Flex direction="column" gap="2" css={{ width: 200 }}>+ <Text>Above</Text>+ <SeparatorComponent decorative />+ <Text>Below (separator has role=none)</Text>+ </Flex>+ </StorySection>+ </>);diff --git a/packages/design-system/src/components/small-icon-button.stories.tsx b/packages/design-system/src/components/small-icon-button.stories.tsxindex 31e77b1110..8bacdcd40c 100644--- a/packages/design-system/src/components/small-icon-button.stories.tsx+++ b/packages/design-system/src/components/small-icon-button.stories.tsx@@ -1,5 +1,4 @@-import type { ComponentProps } from "react";-import { EllipsesIcon, XIcon, TrashIcon } from "@webstudio-is/icons";+import { TrashIcon } from "@webstudio-is/icons";import {SmallIconButton as SmallIconButtonComponent,smallIconButtonStates,@@ -7,25 +6,10 @@ import {} from "./small-icon-button";import { StorySection, StoryGrid } from "./storybook";-const iconsMap = {- "<EllipsesIcon>": <EllipsesIcon />,- "<XIcon>": <XIcon />,- "<TrashIcon>": <TrashIcon />,-} as const;-const states = [undefined, ...smallIconButtonStates];-export const SmallIconButton = ({- icon,- ...rest-}: Omit<ComponentProps<typeof SmallIconButtonComponent>, "icon"> & {- icon: keyof typeof iconsMap;-}) => (+export const SmallIconButton = () => (<>- <StorySection title="Configurable">- <SmallIconButtonComponent icon={iconsMap[icon]} {...rest} />- </StorySection>-<StorySection title="Variants & States"><StoryGrid>{smallIconButtonVariants.map((variant) => (@@ -62,43 +46,25 @@ export const SmallIconButton = ({))}</StoryGrid></StorySection>- </>-);--SmallIconButton.argTypes = {- icon: { control: "inline-radio", options: Object.keys(iconsMap) },- variant: { control: "inline-radio", options: smallIconButtonVariants },- state: { control: "inline-radio", options: states },- focused: { control: "boolean" },-};-SmallIconButton.args = {- icon: "<EllipsesIcon>",- variant: "normal",- state: undefined,- focused: false,-};--SmallIconButton.storyName = "Small Icon Button";--export const Disabled = () => (- <StorySection title="Disabled across variants">- <StoryGrid horizontal>- {smallIconButtonVariants.map((variant) => (- <SmallIconButtonComponent- key={variant}- title={variant}- icon={<TrashIcon />}- variant={variant}- disabled- />- ))}- </StoryGrid>- </StorySection>+ <StorySection title="Disabled across variants">+ <StoryGrid horizontal>+ {smallIconButtonVariants.map((variant) => (+ <SmallIconButtonComponent+ key={variant}+ title={variant}+ icon={<TrashIcon />}+ variant={variant}+ disabled+ />+ ))}+ </StoryGrid>+ </StorySection>+ </>);export default {- title: "Small icon button",+ title: "Small Icon Button",parameters: {// to make the variant=contrast visiblebackgrounds: { default: "Maintenance Medium" },diff --git a/packages/design-system/src/components/small-toggle-button.stories.tsx b/packages/design-system/src/components/small-toggle-button.stories.tsxindex 93c2634685..55e762a046 100644--- a/packages/design-system/src/components/small-toggle-button.stories.tsx+++ b/packages/design-system/src/components/small-toggle-button.stories.tsx@@ -1,4 +1,3 @@-import type { ComponentProps } from "react";import { EyeOpenIcon, EyeClosedIcon } from "@webstudio-is/icons";import {SmallToggleButton as SmallToggleButtonComponent,@@ -7,18 +6,8 @@ import {import { StorySection, StoryGrid } from "./storybook";import { theme } from "../stitches.config";-export const SmallToggleButton = ({- pressed,- ...rest-}: Omit<ComponentProps<typeof SmallToggleButtonComponent>, "icon">) => (+export const SmallToggleButton = () => (<>- <StorySection title="Configurable">- <SmallToggleButtonComponent- icon={pressed ? <EyeClosedIcon /> : <EyeOpenIcon />}- {...rest}- />- </StorySection>-<StorySection title="Variants & States"><StoryGrid>{smallToggleButtonVariants.map((variant) => (@@ -103,36 +92,18 @@ export const SmallToggleButton = ({))}</StoryGrid></StorySection>- </>-);--SmallToggleButton.argTypes = {- variant: { control: "inline-radio", options: smallToggleButtonVariants },- pressed: { control: "boolean" },- disabled: { control: "boolean" },- focused: { control: "boolean" },-};-SmallToggleButton.args = {- variant: "normal",- pressed: false,- disabled: false,- focused: false,-};--SmallToggleButton.storyName = "Small Toggle Button";--export const ControlledPressed = () => (- <StorySection title="Controlled pressed">- <StoryGrid horizontal>- <SmallToggleButtonComponent icon={<EyeClosedIcon />} pressed={true} />- <SmallToggleButtonComponent icon={<EyeOpenIcon />} pressed={false} />- </StoryGrid>- </StorySection>+ <StorySection title="Controlled pressed">+ <StoryGrid horizontal>+ <SmallToggleButtonComponent icon={<EyeClosedIcon />} pressed={true} />+ <SmallToggleButtonComponent icon={<EyeOpenIcon />} pressed={false} />+ </StoryGrid>+ </StorySection>+ </>);export default {- title: "Small toggle button",+ title: "Small Toggle Button",parameters: {// to make the variant=contrast visiblebackgrounds: { default: "Panel" },diff --git a/packages/design-system/src/components/switch.stories.tsx b/packages/design-system/src/components/switch.stories.tsxindex c5820fce5e..6055f0647f 100644--- a/packages/design-system/src/components/switch.stories.tsx+++ b/packages/design-system/src/components/switch.stories.tsx@@ -7,6 +7,20 @@ export default {title: "Switch",};+const ControlledSwitch = () => {+ const [checked, setChecked] = useState(false);+ return (+ <StoryGrid horizontal>+ <Switch+ id="switch-controlled"+ checked={checked}+ onCheckedChange={setChecked}+ />+ <Label htmlFor="switch-controlled">{checked ? "On" : "Off"}</Label>+ </StoryGrid>+ );+};+const Story = () => {return (<>@@ -25,33 +39,17 @@ const Story = () => {<StorySection title="Focussed (initially)"><Switch autoFocus /></StorySection>+ <StorySection title="With label">+ <StoryGrid horizontal>+ <Switch id="switch-label" defaultChecked />+ <Label htmlFor="switch-label">Enable feature</Label>+ </StoryGrid>+ </StorySection>+ <StorySection title="Controlled">+ <ControlledSwitch />+ </StorySection></>);};export { Story as Switch };--export const SwitchWithLabel = () => (- <StorySection title="With label">- <StoryGrid horizontal>- <Switch id="switch-label" defaultChecked />- <Label htmlFor="switch-label">Enable feature</Label>- </StoryGrid>- </StorySection>-);--export const SwitchControlled = () => {- const [checked, setChecked] = useState(false);- return (- <StorySection title="Controlled">- <StoryGrid horizontal>- <Switch- id="switch-controlled"- checked={checked}- onCheckedChange={setChecked}- />- <Label htmlFor="switch-controlled">{checked ? "On" : "Off"}</Label>- </StoryGrid>- </StorySection>- );-};diff --git a/packages/design-system/src/components/text-area.stories.tsx b/packages/design-system/src/components/text-area.stories.tsxindex befcf8285d..7ac245c370 100644--- a/packages/design-system/src/components/text-area.stories.tsx+++ b/packages/design-system/src/components/text-area.stories.tsx@@ -3,7 +3,7 @@ import { StorySection, StoryGrid } from "./storybook";import { useState } from "react";export default {- title: "Text area",+ title: "Text Area",};const exampleValue =@@ -95,26 +95,18 @@ export const TextArea = () => {<TextAreaComponent variant="mono" value={value} onChange={setValue} /></StoryGrid></StorySection>- </>- );-};-TextArea.storyName = "Text Area";-export const WithDefaultValue = () => (- <StorySection title="Uncontrolled with default value">- <StoryGrid css={{ width: 200 }}>- <TextAreaComponent defaultValue="This is a default value for an uncontrolled text area" />- </StoryGrid>- </StorySection>-);+ <StorySection title="Uncontrolled with default value">+ <StoryGrid css={{ width: 200 }}>+ <TextAreaComponent defaultValue="This is a default value for an uncontrolled text area" />+ </StoryGrid>+ </StorySection>-export const WithGrow = () => {- const [value, setValue] = useState(exampleValue);- return (- <StorySection title="Grow (manual resize disabled)">- <StoryGrid css={{ width: 200 }}>- <TextAreaComponent value={value} onChange={setValue} grow />- </StoryGrid>- </StorySection>+ <StorySection title="Grow (manual resize disabled)">+ <StoryGrid css={{ width: 200 }}>+ <TextAreaComponent value={value} onChange={setValue} grow />+ </StoryGrid>+ </StorySection>+ </>);};diff --git a/packages/design-system/src/components/text.stories.tsx b/packages/design-system/src/components/text.stories.tsxindex c508ea1cb1..c019e7494a 100644--- a/packages/design-system/src/components/text.stories.tsx+++ b/packages/design-system/src/components/text.stories.tsx@@ -14,6 +14,10 @@ const colors = ["destructive",] as const;+export default {+ title: "Text",+};+export const Text = () => (<><StorySection title="Variants">@@ -61,33 +65,25 @@ export const Text = () => (This text cannot be selected (userSelect: none)</TextComponent></StorySection>- </>-);-export const Inline = () => (- <StorySection title="Inline text">- <TextComponent>- This is a paragraph with{" "}- <TextComponent inline color="destructive">- inline destructive- </TextComponent>{" "}- and{" "}- <TextComponent inline color="success">- inline success- </TextComponent>{" "}- text inside.- </TextComponent>- </StorySection>-);+ <StorySection title="Inline text">+ <TextComponent>+ This is a paragraph with{" "}+ <TextComponent inline color="destructive">+ inline destructive+ </TextComponent>{" "}+ and{" "}+ <TextComponent inline color="success">+ inline success+ </TextComponent>{" "}+ text inside.+ </TextComponent>+ </StorySection>-export const UserSelectText = () => (- <StorySection title="User select text">- <TextComponent userSelect="text">- This text can be selected (userSelect: text)- </TextComponent>- </StorySection>+ <StorySection title="User select text">+ <TextComponent userSelect="text">+ This text can be selected (userSelect: text)+ </TextComponent>+ </StorySection>+ </>);--export default {- title: "Text",-};diff --git a/packages/design-system/src/components/toast.stories.tsx b/packages/design-system/src/components/toast.stories.tsxindex 8b1e0cf7d5..2af544a283 100644--- a/packages/design-system/src/components/toast.stories.tsx+++ b/packages/design-system/src/components/toast.stories.tsx@@ -132,27 +132,25 @@ export const Toast = () => {</ToastComponent></StoryGrid></StorySection>++ <StorySection title="With close and copy actions">+ <StoryGrid>+ <ToastComponent+ onClose={() => window.alert("Close clicked")}+ onCopy={() => window.alert("Copy clicked")}+ >+ Toast with close and copy actions+ </ToastComponent>+ <ToastComponent+ variant="error"+ icon={<AlertCircleIcon size={24} />}+ onClose={() => window.alert("Close clicked")}+ onCopy={() => window.alert("Copy clicked")}+ >+ Error toast with actions+ </ToastComponent>+ </StoryGrid>+ </StorySection></>);};--export const WithActions = () => (- <StorySection title="With close and copy actions">- <StoryGrid>- <ToastComponent- onClose={() => window.alert("Close clicked")}- onCopy={() => window.alert("Copy clicked")}- >- Toast with close and copy actions- </ToastComponent>- <ToastComponent- variant="error"- icon={<AlertCircleIcon size={24} />}- onClose={() => window.alert("Close clicked")}- onCopy={() => window.alert("Copy clicked")}- >- Error toast with actions- </ToastComponent>- </StoryGrid>- </StorySection>-);diff --git a/packages/design-system/src/components/toggle-button.stories.tsx b/packages/design-system/src/components/toggle-button.stories.tsxindex e879d3d1cb..e43b67ba11 100644--- a/packages/design-system/src/components/toggle-button.stories.tsx+++ b/packages/design-system/src/components/toggle-button.stories.tsx@@ -1,4 +1,3 @@-import type { ComponentProps } from "react";import { BorderRadiusIndividualIcon } from "@webstudio-is/icons";import { ToggleButton as ToggleButtonComponent } from "./toggle-button";import { StorySection, StoryGrid } from "./storybook";@@ -11,17 +10,8 @@ const toggleButtonVariants = ["remote",] as const;-export const ToggleButton = ({- variant,- disabled,-}: ComponentProps<typeof ToggleButtonComponent>) => (+export const ToggleButton = () => (<>- <StorySection title="Configurable">- <ToggleButtonComponent variant={variant} disabled={disabled}>- <BorderRadiusIndividualIcon fill="currentColor" />- </ToggleButtonComponent>- </StorySection>-<StorySection title="Variants"><StoryGrid horizontal>{toggleButtonVariants.map((variant) => (@@ -31,6 +21,7 @@ export const ToggleButton = ({))}</StoryGrid></StorySection>+<StorySection title="Variants disabled"><StoryGrid horizontal>{toggleButtonVariants.map((variant) => (@@ -40,6 +31,7 @@ export const ToggleButton = ({))}</StoryGrid></StorySection>+<StorySection title="Variants on"><StoryGrid horizontal>{toggleButtonVariants.map((variant) => (@@ -53,47 +45,31 @@ export const ToggleButton = ({))}</StoryGrid></StorySection>- </>-);--ToggleButton.argTypes = {- variant: { control: "inline-radio", options: toggleButtonVariants },- disabled: { control: "boolean" },-};--ToggleButton.args = {- variant: "default",- disabled: false,-};--ToggleButton.storyName = "Toggle Button";-export const Pressed = () => (- <StorySection title="Controlled pressed">- <StoryGrid horizontal>- {toggleButtonVariants.map((variant) => (- <ToggleButtonComponent key={variant} variant={variant} pressed>- <BorderRadiusIndividualIcon fill="currentColor" />- </ToggleButtonComponent>- ))}- </StoryGrid>- </StorySection>-);+ <StorySection title="Controlled pressed">+ <StoryGrid horizontal>+ {toggleButtonVariants.map((variant) => (+ <ToggleButtonComponent key={variant} variant={variant} pressed>+ <BorderRadiusIndividualIcon fill="currentColor" />+ </ToggleButtonComponent>+ ))}+ </StoryGrid>+ </StorySection>-export const DefaultPressed = () => (- <StorySection title="Default pressed (uncontrolled)">- <StoryGrid horizontal>- {toggleButtonVariants.map((variant) => (- <ToggleButtonComponent key={variant} variant={variant} defaultPressed>- <BorderRadiusIndividualIcon fill="currentColor" />- </ToggleButtonComponent>- ))}- </StoryGrid>- </StorySection>+ <StorySection title="Default pressed (uncontrolled)">+ <StoryGrid horizontal>+ {toggleButtonVariants.map((variant) => (+ <ToggleButtonComponent key={variant} variant={variant} defaultPressed>+ <BorderRadiusIndividualIcon fill="currentColor" />+ </ToggleButtonComponent>+ ))}+ </StoryGrid>+ </StorySection>+ </>);export default {- title: "Toggle button",+ title: "Toggle Button",parameters: {// to make the variant=contrast visiblebackgrounds: { default: "Panel" },diff --git a/packages/design-system/src/components/toggle-group.stories.tsx b/packages/design-system/src/components/toggle-group.stories.tsxindex 30f859f4b4..2567702062 100644--- a/packages/design-system/src/components/toggle-group.stories.tsx+++ b/packages/design-system/src/components/toggle-group.stories.tsx@@ -1,4 +1,3 @@-import type { ComponentProps } from "react";import { BorderRadiusIndividualIcon } from "@webstudio-is/icons";import {ToggleGroup as ToggleGroupComponent,@@ -48,25 +47,8 @@ const ToggleGroupButtons = () => {);};-export const ToggleGroup = ({- type = "single",- color = "default",- disabled = false,-}: ComponentProps<typeof ToggleGroupComponent>) => (+export const ToggleGroup = () => (<>- <StorySection title="Configurable">- <StoryGrid css={{ alignItems: "flex-start" }}>- <ToggleGroupComponent- key={color}- type={type}- color={color}- disabled={disabled}- >- <ToggleGroupButtons />- </ToggleGroupComponent>- </StoryGrid>- </StorySection>-<StorySection title="Colors"><StoryGrid css={{ alignItems: "flex-start" }}>{toggleGroupColors.map((color) => (@@ -101,7 +83,11 @@ export const ToggleGroup = ({<StorySection title="With text"><StoryGrid css={{ alignItems: "flex-start", flexGrow: 1 }}><EnhancedTooltipProvider>- <ToggleGroupComponent color={color} type="single" defaultValue="one">+ <ToggleGroupComponent+ color="default"+ type="single"+ defaultValue="one"+ ><EnhancedTooltip content="One"><ToggleGroupButton value="one">One</ToggleGroupButton></EnhancedTooltip>@@ -119,7 +105,11 @@ export const ToggleGroup = ({<StorySection title="With tooltips"><StoryGrid css={{ alignItems: "flex-start" }}><EnhancedTooltipProvider>- <ToggleGroupComponent color={color} type="single" defaultValue="one">+ <ToggleGroupComponent+ color="default"+ type="single"+ defaultValue="one"+ ><EnhancedTooltip content="One"><ToggleGroupButton value="one"><BorderRadiusIndividualIcon fill="currentColor" />@@ -139,37 +129,27 @@ export const ToggleGroup = ({</EnhancedTooltipProvider></StoryGrid></StorySection>- </>-);--ToggleGroup.argTypes = {- type: { control: "inline-radio", options: ["single", "multiple"] },- color: { control: "inline-radio", options: toggleGroupColors },- disabled: { control: "boolean" },-};--ToggleGroup.storyName = "Toggle Group";-export const MultipleSelection = () => (- <StorySection title="Multiple selection">- <StoryGrid css={{ alignItems: "flex-start" }}>- <ToggleGroupComponent type="multiple" defaultValue={["one", "three"]}>- <ToggleGroupButton value="one">- <BorderRadiusIndividualIcon fill="currentColor" />- </ToggleGroupButton>- <ToggleGroupButton value="two">- <BorderRadiusIndividualIcon fill="currentColor" />- </ToggleGroupButton>- <ToggleGroupButton value="three">- <BorderRadiusIndividualIcon fill="currentColor" />- </ToggleGroupButton>- </ToggleGroupComponent>- </StoryGrid>- </StorySection>+ <StorySection title="Multiple selection">+ <StoryGrid css={{ alignItems: "flex-start" }}>+ <ToggleGroupComponent type="multiple" defaultValue={["one", "three"]}>+ <ToggleGroupButton value="one">+ <BorderRadiusIndividualIcon fill="currentColor" />+ </ToggleGroupButton>+ <ToggleGroupButton value="two">+ <BorderRadiusIndividualIcon fill="currentColor" />+ </ToggleGroupButton>+ <ToggleGroupButton value="three">+ <BorderRadiusIndividualIcon fill="currentColor" />+ </ToggleGroupButton>+ </ToggleGroupComponent>+ </StoryGrid>+ </StorySection>+ </>);export default {- title: "Toggle group",+ title: "Toggle Group",parameters: {// to make the variant=contrast visiblebackgrounds: { default: "Panel" },diff --git a/packages/design-system/src/components/toolbar.stories.tsx b/packages/design-system/src/components/toolbar.stories.tsxindex 02cb6be825..9ff1fa0060 100644--- a/packages/design-system/src/components/toolbar.stories.tsx+++ b/packages/design-system/src/components/toolbar.stories.tsx@@ -7,63 +7,63 @@ import {ToolbarToggleGroup,ToolbarSeparator,} from "./toolbar";+import { StorySection } from "./storybook";export default {title: "Toolbar",};-const ToolbarStory = () => {- return (- <Toolbar css={{ gap: theme.spacing[5] }}>- <ToolbarToggleGroup type="single" value="2">- <ToolbarToggleItem value="1">+export const ToolbarDemo = () => (+ <>+ <StorySection title="Toggle groups">+ <Toolbar css={{ gap: theme.spacing[5] }}>+ <ToolbarToggleGroup type="single" value="2">+ <ToolbarToggleItem value="1">+ <PlayIcon size={22} />+ </ToolbarToggleItem>+ <ToolbarToggleItem value="2">+ <PlayIcon size={22} />+ </ToolbarToggleItem>+ </ToolbarToggleGroup>+ <ToolbarSeparator />+ <ToolbarToggleGroup type="single" value="4">+ <ToolbarToggleItem value="3" variant="subtle">+ <PlayIcon size={22} />+ </ToolbarToggleItem>+ <ToolbarToggleItem value="4" variant="preview">+ <PlayIcon size={22} />+ </ToolbarToggleItem>+ </ToolbarToggleGroup>+ <ToolbarSeparator />+ <ToolbarToggleGroup type="single">+ <ToolbarToggleItem value="5" focused>+ <PlayIcon size={22} />+ </ToolbarToggleItem>+ <ToolbarToggleItem value="5" variant="chevron">+ <ChevronDownIcon />+ </ToolbarToggleItem>+ </ToolbarToggleGroup>+ </Toolbar>+ </StorySection>+ <StorySection title="Buttons">+ <Toolbar>+ <ToolbarButton><PlayIcon size={22} />- </ToolbarToggleItem>- <ToolbarToggleItem value="2">+ </ToolbarButton>+ <ToolbarButton variant="subtle"><PlayIcon size={22} />- </ToolbarToggleItem>- </ToolbarToggleGroup>- <ToolbarSeparator />- <ToolbarToggleGroup type="single" value="4">- <ToolbarToggleItem value="3" variant="subtle">+ </ToolbarButton>+ <ToolbarButton variant="preview"><PlayIcon size={22} />- </ToolbarToggleItem>- <ToolbarToggleItem value="4" variant="preview">+ </ToolbarButton>+ <ToolbarSeparator />+ <ToolbarButton focused><PlayIcon size={22} />- </ToolbarToggleItem>- </ToolbarToggleGroup>- <ToolbarSeparator />- <ToolbarToggleGroup type="single">- <ToolbarToggleItem value="5" focused>- <PlayIcon size={22} />- </ToolbarToggleItem>- <ToolbarToggleItem value="5" variant="chevron">+ </ToolbarButton>+ <ToolbarButton variant="chevron"><ChevronDownIcon />- </ToolbarToggleItem>- </ToolbarToggleGroup>- </Toolbar>- );-};--export { ToolbarStory as Toolbar };--export const ToolbarButtonDemo = () => (- <Toolbar>- <ToolbarButton>- <PlayIcon size={22} />- </ToolbarButton>- <ToolbarButton variant="subtle">- <PlayIcon size={22} />- </ToolbarButton>- <ToolbarButton variant="preview">- <PlayIcon size={22} />- </ToolbarButton>- <ToolbarSeparator />- <ToolbarButton focused>- <PlayIcon size={22} />- </ToolbarButton>- <ToolbarButton variant="chevron">- <ChevronDownIcon />- </ToolbarButton>- </Toolbar>+ </ToolbarButton>+ </Toolbar>+ </StorySection>+ </>);diff --git a/packages/design-system/src/components/tooltip.stories.tsx b/packages/design-system/src/components/tooltip.stories.tsxindex 65010a1164..579451d741 100644--- a/packages/design-system/src/components/tooltip.stories.tsx+++ b/packages/design-system/src/components/tooltip.stories.tsx@@ -8,6 +8,7 @@ import { Box } from "./box";import { Flex } from "./flex";import { InputField } from "./input-field";import { Text } from "./text";+import { StorySection } from "./storybook";export default {title: "Tooltip",@@ -15,98 +16,96 @@ export default {export const Tooltip = () => (<TooltipProvider>- <Flex direction="column" gap="6" css={{ padding: 40 }}>- <Flex direction="column" gap="2">- <Text variant="labels">Tooltip</Text>- <Flex gap="3" align="center">- <TooltipDesign content="HELLO" open>- <Button>With tooltip</Button>- </TooltipDesign>- <TooltipDesign content={undefined}>- <Button>No tooltip content</Button>- </TooltipDesign>+ <StorySection title="Tooltip">+ <Flex direction="column" gap="6" css={{ padding: 40 }}>+ <Flex direction="column" gap="2">+ <Text variant="labels">Tooltip</Text>+ <Flex gap="3" align="center">+ <TooltipDesign content="HELLO" open>+ <Button>With tooltip</Button>+ </TooltipDesign>+ <TooltipDesign content={undefined}>+ <Button>No tooltip content</Button>+ </TooltipDesign>+ </Flex></Flex>- </Flex>- <Flex direction="column" gap="2">- <Text variant="labels">Input errors tooltip</Text>- <InputErrorsTooltip errors={["Error"]} side="right" open>- <InputField- id="input"- placeholder="Input with error"- css={{ width: 200 }}- />- </InputErrorsTooltip>- </Flex>+ <Flex direction="column" gap="2">+ <Text variant="labels">Input errors tooltip</Text>+ <InputErrorsTooltip errors={["Error"]} side="right" open>+ <InputField+ id="input"+ placeholder="Input with error"+ css={{ width: 200 }}+ />+ </InputErrorsTooltip>+ </Flex>- <Flex direction="column" gap="2">- <Text variant="labels">Scrollable container with tooltips</Text>- <Box css={{ height: 100, width: 200, overflowY: "scroll" }}>- <Box css={{ height: 2000 }}>- <InputErrorsTooltip- errors={["Tooltip content"]}- side="right"- open={true}- >- <Button css={{ width: "100%", my: 10 }}>Tooltip 1</Button>- </InputErrorsTooltip>- <br />- <InputErrorsTooltip- errors={["Tooltip content"]}- side="right"- open={true}- >- <Button css={{ width: "100%", my: 10 }}>Tooltip 2</Button>- </InputErrorsTooltip>+ <Flex direction="column" gap="2">+ <Text variant="labels">Scrollable container with tooltips</Text>+ <Box css={{ height: 100, width: 200, overflowY: "scroll" }}>+ <Box css={{ height: 2000 }}>+ <InputErrorsTooltip+ errors={["Tooltip content"]}+ side="right"+ open={true}+ >+ <Button css={{ width: "100%", my: 10 }}>Tooltip 1</Button>+ </InputErrorsTooltip>+ <br />+ <InputErrorsTooltip+ errors={["Tooltip content"]}+ side="right"+ open={true}+ >+ <Button css={{ width: "100%", my: 10 }}>Tooltip 2</Button>+ </InputErrorsTooltip>+ </Box></Box>- </Box>+ </Flex></Flex>- </Flex>- </TooltipProvider>-);--export const SidePlacements = () => (- <TooltipProvider>- <Flex gap="6" wrap="wrap" css={{ padding: 60 }}>- <TooltipDesign content="Top tooltip" side="top" open>- <Button>Top</Button>- </TooltipDesign>- <TooltipDesign content="Right tooltip" side="right" open>- <Button>Right</Button>- </TooltipDesign>- <TooltipDesign content="Bottom tooltip" side="bottom" open>- <Button>Bottom</Button>- </TooltipDesign>- <TooltipDesign content="Left tooltip" side="left" open>- <Button>Left</Button>- </TooltipDesign>- </Flex>- </TooltipProvider>-);+ </StorySection>-export const ContentVariants = () => (- <TooltipProvider>- <Flex direction="column" gap="6" css={{ padding: 40 }}>- <Flex direction="column" gap="2">- <Text variant="labels">Wrapped variant</Text>- <TooltipDesign- content="This is a tooltip with the wrapped variant that constrains the max width to a smaller size for compact content display"- variant="wrapped"- open- >- <Button>Wrapped</Button>+ <StorySection title="Side placements">+ <Flex gap="6" wrap="wrap" css={{ padding: 60 }}>+ <TooltipDesign content="Top tooltip" side="top" open>+ <Button>Top</Button></TooltipDesign>- </Flex>- <Flex direction="column" gap="2">- <Text variant="labels">Large variant</Text>- <TooltipDesign- content="This is a tooltip with the large variant that allows wider content before wrapping to the next line"- variant="large"- open- >- <Button>Large</Button>+ <TooltipDesign content="Right tooltip" side="right" open>+ <Button>Right</Button></TooltipDesign>+ <TooltipDesign content="Bottom tooltip" side="bottom" open>+ <Button>Bottom</Button>+ </TooltipDesign>+ <TooltipDesign content="Left tooltip" side="left" open>+ <Button>Left</Button>+ </TooltipDesign>+ </Flex>+ </StorySection>++ <StorySection title="Content variants">+ <Flex direction="column" gap="6" css={{ padding: 40 }}>+ <Flex direction="column" gap="2">+ <Text variant="labels">Wrapped variant</Text>+ <TooltipDesign+ content="This is a tooltip with the wrapped variant that constrains the max width to a smaller size for compact content display"+ variant="wrapped"+ open+ >+ <Button>Wrapped</Button>+ </TooltipDesign>+ </Flex>+ <Flex direction="column" gap="2">+ <Text variant="labels">Large variant</Text>+ <TooltipDesign+ content="This is a tooltip with the large variant that allows wider content before wrapping to the next line"+ variant="large"+ open+ >+ <Button>Large</Button>+ </TooltipDesign>+ </Flex></Flex>- </Flex>+ </StorySection></TooltipProvider>);diff --git a/packages/design-system/src/components/tree.stories.tsx b/packages/design-system/src/components/tree.stories.tsxindex a8ab24dde9..988c431e55 100644--- a/packages/design-system/src/components/tree.stories.tsx+++ b/packages/design-system/src/components/tree.stories.tsx@@ -9,6 +9,7 @@ import {TreeSortableItem,type TreeDropTarget,} from "./tree";+import { StorySection } from "./storybook";export default {title: "Tree",@@ -195,128 +196,132 @@ export const Tree = () => {}, [data, expandedItems, dropTarget]);return (- <Box css={{ maxWidth: 300 }}>- <TreeRoot>- {flatTree.map((node) => {- const handleExpand = (isExpanded: boolean) => {- setExpandedItems((prevExpandedItems) => {- const newExpandedItems = new Set(prevExpandedItems);- if (isExpanded) {- newExpandedItems.add(node.name);- } else {- newExpandedItems.delete(node.name);- }- return newExpandedItems;- });- };+ <>+ <StorySection title="Interactive">+ <Box css={{ maxWidth: 300 }}>+ <TreeRoot>+ {flatTree.map((node) => {+ const handleExpand = (isExpanded: boolean) => {+ setExpandedItems((prevExpandedItems) => {+ const newExpandedItems = new Set(prevExpandedItems);+ if (isExpanded) {+ newExpandedItems.add(node.name);+ } else {+ newExpandedItems.delete(node.name);+ }+ return newExpandedItems;+ });+ };- return (- <TreeSortableItem- key={node.name}- level={node.level}- isExpanded={node.isExpanded}- isLastChild={node.isLastChild}- data={node}- // prevent dragging root- canDrag={() => node.level > 0}- onExpand={handleExpand}- dropTarget={node.dropTarget}- onDropTargetChange={(dropTarget) => {- // prevent dropping into toplevel- if (dropTarget && dropTarget.parentLevel > 0) {- setDropTarget(getStoriesDropTarget(node, dropTarget));- } else {- setDropTarget(undefined);- }- }}- onDrop={(sourceNode) => {- if (dropTarget) {- setData((data) =>- move({- data,- sourceParentName: sourceNode.selector[1],- sourceName: sourceNode.selector[0],- dropTarget,- })- );- }- setDropTarget(undefined);- }}+ return (+ <TreeSortableItem+ key={node.name}+ level={node.level}+ isExpanded={node.isExpanded}+ isLastChild={node.isLastChild}+ data={node}+ // prevent dragging root+ canDrag={() => node.level > 0}+ onExpand={handleExpand}+ dropTarget={node.dropTarget}+ onDropTargetChange={(dropTarget) => {+ // prevent dropping into toplevel+ if (dropTarget && dropTarget.parentLevel > 0) {+ setDropTarget(getStoriesDropTarget(node, dropTarget));+ } else {+ setDropTarget(undefined);+ }+ }}+ onDrop={(sourceNode) => {+ if (dropTarget) {+ setData((data) =>+ move({+ data,+ sourceParentName: sourceNode.selector[1],+ sourceName: sourceNode.selector[0],+ dropTarget,+ })+ );+ }+ setDropTarget(undefined);+ }}+ >+ <TreeNode+ level={node.level}+ isSelected={node.name === selectedItemId}+ isHighlighted={dropTarget?.parentName === node.name}+ isExpanded={node.isExpanded}+ onExpand={handleExpand}+ buttonProps={{+ onFocus: () => {+ setSelectedItemId(node.name);+ },+ onClick: () => {+ setSelectedItemId(node.name);+ },+ }}+ action={+ <SmallIconButton tabIndex={-1} icon={<EllipsesIcon />} />+ }+ >+ <TreeNodeLabel>{node.name}</TreeNodeLabel>+ </TreeNode>+ </TreeSortableItem>+ );+ })}+ </TreeRoot>+ </Box>+ </StorySection>++ <StorySection title="Static nodes">+ <div style={{ maxWidth: 300 }}>+ <TreeRoot>+ <TreeNode+ level={0}+ isSelected={false}+ isExpanded={true}+ onExpand={() => {}}+ buttonProps={{}}+ action={<SmallIconButton tabIndex={-1} icon={<EllipsesIcon />} />}>- <TreeNode- level={node.level}- isSelected={node.name === selectedItemId}- isHighlighted={dropTarget?.parentName === node.name}- isExpanded={node.isExpanded}- onExpand={handleExpand}- buttonProps={{- onFocus: () => {- setSelectedItemId(node.name);- },- onClick: () => {- setSelectedItemId(node.name);- },- }}- action={- <SmallIconButton tabIndex={-1} icon={<EllipsesIcon />} />- }- >- <TreeNodeLabel>{node.name}</TreeNodeLabel>- </TreeNode>- </TreeSortableItem>- );- })}- </TreeRoot>- </Box>+ <TreeNodeLabel>Root node</TreeNodeLabel>+ </TreeNode>+ <TreeNode+ level={1}+ isSelected={true}+ isExpanded={undefined}+ isActionVisible+ buttonProps={{}}+ action={<SmallIconButton tabIndex={-1} icon={<EllipsesIcon />} />}+ >+ <TreeNodeLabel prefix={<DotIcon />}>+ With prefix and action visible+ </TreeNodeLabel>+ </TreeNode>+ <TreeNode+ level={1}+ tabbable+ isSelected={false}+ isExpanded={false}+ onExpand={() => {}}+ buttonProps={{}}+ action={<SmallIconButton tabIndex={-1} icon={<EllipsesIcon />} />}+ >+ <TreeNodeLabel>Tabbable collapsed node</TreeNodeLabel>+ </TreeNode>+ <TreeNode+ level={1}+ isSelected={false}+ isHighlighted+ isExpanded={undefined}+ buttonProps={{}}+ action={<SmallIconButton tabIndex={-1} icon={<EllipsesIcon />} />}+ >+ <TreeNodeLabel>Highlighted node</TreeNodeLabel>+ </TreeNode>+ </TreeRoot>+ </div>+ </StorySection>+ </>);};--export const StaticTreeNodes = () => (- <div style={{ maxWidth: 300 }}>- <TreeRoot>- <TreeNode- level={0}- isSelected={false}- isExpanded={true}- onExpand={() => {}}- buttonProps={{}}- action={<SmallIconButton tabIndex={-1} icon={<EllipsesIcon />} />}- >- <TreeNodeLabel>Root node</TreeNodeLabel>- </TreeNode>- <TreeNode- level={1}- isSelected={true}- isExpanded={undefined}- isActionVisible- buttonProps={{}}- action={<SmallIconButton tabIndex={-1} icon={<EllipsesIcon />} />}- >- <TreeNodeLabel prefix={<DotIcon />}>- With prefix and action visible- </TreeNodeLabel>- </TreeNode>- <TreeNode- level={1}- tabbable- isSelected={false}- isExpanded={false}- onExpand={() => {}}- buttonProps={{}}- action={<SmallIconButton tabIndex={-1} icon={<EllipsesIcon />} />}- >- <TreeNodeLabel>Tabbable collapsed node</TreeNodeLabel>- </TreeNode>- <TreeNode- level={1}- isSelected={false}- isHighlighted- isExpanded={undefined}- buttonProps={{}}- action={<SmallIconButton tabIndex={-1} icon={<EllipsesIcon />} />}- >- <TreeNodeLabel>Highlighted node</TreeNodeLabel>- </TreeNode>- </TreeRoot>- </div>-);diff --git a/packages/design-system/src/components/two-rows-icon-button-container.stories.tsx b/packages/design-system/src/components/two-rows-icon-button-container.stories.tsxindex 681ca21830..3b11b6c421 100644--- a/packages/design-system/src/components/two-rows-icon-button-container.stories.tsx+++ b/packages/design-system/src/components/two-rows-icon-button-container.stories.tsx@@ -1,25 +1,29 @@import { TwoRowsIconButtonContainer } from "./two-rows-icon-button-container";import { SmallIconButton } from "./small-icon-button";import { TrashIcon } from "@webstudio-is/icons";--export const TwoRowsSmallIconButtonContainer = () => (- <TwoRowsIconButtonContainer>- <SmallIconButton variant="destructive" icon={<TrashIcon />} />- </TwoRowsIconButtonContainer>-);--TwoRowsSmallIconButtonContainer.storyName =- "Two Rows Small Icon Button Container";+import { StorySection } from "./storybook";export default {- title: "Two rows small icon button container",+ title: "Two Rows Small Icon Button Container",};-export const EmptyContainer = () => <TwoRowsIconButtonContainer />;+export const TwoRowsSmallIconButtonContainer = () => (+ <>+ <StorySection title="Single child">+ <TwoRowsIconButtonContainer>+ <SmallIconButton variant="destructive" icon={<TrashIcon />} />+ </TwoRowsIconButtonContainer>+ </StorySection>++ <StorySection title="Empty container">+ <TwoRowsIconButtonContainer />+ </StorySection>-export const MultipleChildren = () => (- <TwoRowsIconButtonContainer>- <SmallIconButton variant="destructive" icon={<TrashIcon />} />- <SmallIconButton icon={<TrashIcon />} />- </TwoRowsIconButtonContainer>+ <StorySection title="Multiple children">+ <TwoRowsIconButtonContainer>+ <SmallIconButton variant="destructive" icon={<TrashIcon />} />+ <SmallIconButton icon={<TrashIcon />} />+ </TwoRowsIconButtonContainer>+ </StorySection>+ </>);diff --git a/packages/icons/package.json b/packages/icons/package.jsonindex 27965338ae..e484c005b4 100644--- a/packages/icons/package.json+++ b/packages/icons/package.json@@ -14,6 +14,7 @@"devDependencies": {"@svgo/jsx": "^0.4.2","@types/react": "^18.2.70",+ "@webstudio-is/design-system": "workspace:*","@types/react-dom": "^18.2.25","@webstudio-is/tsconfig": "workspace:*","change-case": "^5.4.4",diff --git a/packages/icons/src/index.stories.tsx b/packages/icons/src/index.stories.tsxindex b21029e304..bc1674b416 100644--- a/packages/icons/src/index.stories.tsx+++ b/packages/icons/src/index.stories.tsx@@ -1,10 +1,15 @@import type { ReactNode } from "react";import type { Meta } from "@storybook/react";+import { StorySection } from "@webstudio-is/design-system";import * as icons from "./index";-export const Icons = ({ testColor }: { testColor: boolean }): ReactNode => {+export const Icons = ({+ testColor = false,+}: {+ testColor?: boolean;+}): ReactNode => {return (- <>+ <StorySection title="Icons"><divstyle={{display: "flex",@@ -52,18 +57,12 @@ export const Icons = ({ testColor }: { testColor: boolean }): ReactNode => {})}</div>- </>+ </StorySection>);};const IconsMeta: Meta<typeof Icons> = {title: "Icons",component: Icons,- argTypes: {- testColor: { control: "boolean", name: "Test color" },- },- args: {- testColor: false,- },};export default IconsMeta;diff --git a/packages/icons/tsconfig.json b/packages/icons/tsconfig.jsonindex 9648eaf0a1..31d2f5d187 100644--- a/packages/icons/tsconfig.json+++ b/packages/icons/tsconfig.json@@ -1,5 +1,6 @@{"extends": "@webstudio-is/tsconfig/base.json",+ "include": ["**/*.ts", "**/*.tsx", "../../@types/**/*.d.ts"],"compilerOptions": {"isolatedDeclarations": true}diff --git a/packages/image/package.json b/packages/image/package.jsonindex 0ee8c8b291..85ba66b2fc 100644--- a/packages/image/package.json+++ b/packages/image/package.json@@ -19,6 +19,7 @@"devDependencies": {"@types/react": "^18.2.70","@types/react-dom": "^18.2.25",+ "@webstudio-is/design-system": "workspace:*","@webstudio-is/tsconfig": "workspace:*","react": "18.3.0-canary-14898b6a9-20240318","react-dom": "18.3.0-canary-14898b6a9-20240318",diff --git a/packages/image/src/image-dev.stories.tsx b/packages/image/src/image-dev.stories.tsxindex b177a31678..10fddc643e 100644--- a/packages/image/src/image-dev.stories.tsx+++ b/packages/image/src/image-dev.stories.tsx@@ -1,7 +1,7 @@// Story for image development, see https://github.com/webstudio-is/webstudio/issues/387import type * as React from "react";-import type { Meta, StoryFn } from "@storybook/react";+import { StorySection } from "@webstudio-is/design-system";import { Image as ImagePrimitive, wsImageLoader } from "./";// to not allow include local assets everywhere, just enable it for this file@@ -9,10 +9,9 @@ import { Image as ImagePrimitive, wsImageLoader } from "./";// @ts-ignoreimport localLogoImage from "../storybook-assets/logo.webp";-const meta: Meta<typeof ImagePrimitive> = {+export default {title: "Image dev",};-export default meta;type ImageProps = React.ComponentProps<typeof ImagePrimitive>;@@ -50,74 +49,77 @@ const ImageBase = ();};-/**- * Load images depending on image width and device per pixel ratio.- **/-export const FixedWidthImage: StoryFn<React.FunctionComponent> = () => (- <ImageBase src={imageSrc} width="300" height="400" />-);--/**- * Preserve ratio using object-fit: cover. Load images depending on image width and device per pixel ratio.- **/-export const FixedWidthImageCover: StoryFn<React.FunctionComponent> = () => (- <ImageBase- src={imageSrc}- width="300"- height="400"- style={{ objectFit: "cover" }}- />+const SectionTitle = ({ children }: { children: React.ReactNode }) => (+ <h3 style={{ marginTop: 24, marginBottom: 8 }}>{children}</h3>);/**- * Load images depending on the viewport width.+ * All image variants demonstrated together.**/-export const UnknownWidthImage: StoryFn<React.FunctionComponent> = () => (- <ImageBase src={imageSrc} />-);+export const ImageDev = () => (+ <StorySection title="Image Dev">+ <SectionTitle>Fixed width image</SectionTitle>+ <p>Load images depending on image width and device per pixel ratio.</p>+ <ImageBase src={imageSrc} width="300" height="400" />-/**- * Fit width of the parent container, has own aspect-ratio and object-fit=cover.- * Load images depending on the viewport width.- **/-export const AspectRatioImage: StoryFn<React.FunctionComponent> = () => (- <div style={{ width: "50%" }}>+ <SectionTitle>Fixed width image (cover)</SectionTitle>+ <p>+ Preserve ratio using object-fit: cover. Load images depending on image+ width and device per pixel ratio.+ </p><ImageBasesrc={imageSrc}- style={{ aspectRatio: "2/1", objectFit: "cover", width: "100%" }}+ width="300"+ height="400"+ style={{ objectFit: "cover" }}/>- </div>-);-/**- * Fill width and height of the relative parent container, object-fit=cover. Load images depending on the viewport width.- **/-export const FillParentImage: StoryFn<React.FunctionComponent> = () => (- <div style={{ width: "50%", aspectRatio: "2/1", position: "relative" }}>+ <SectionTitle>Unknown width image</SectionTitle>+ <p>Load images depending on the viewport width.</p>+ <ImageBase src={imageSrc} />++ <SectionTitle>Aspect ratio image</SectionTitle>+ <p>+ Fit width of the parent container, has own aspect-ratio and+ object-fit=cover. Load images depending on the viewport width.+ </p>+ <div style={{ width: "50%" }}>+ <ImageBase+ src={imageSrc}+ style={{ aspectRatio: "2/1", objectFit: "cover", width: "100%" }}+ />+ </div>++ <SectionTitle>Fill parent image</SectionTitle>+ <p>+ Fill width and height of the relative parent container, object-fit=cover.+ Load images depending on the viewport width.+ </p>+ <div style={{ width: "50%", aspectRatio: "2/1", position: "relative" }}>+ <ImageBase+ src={imageSrc}+ style={{+ objectFit: "cover",+ position: "absolute",+ width: "100%",+ height: "100%",+ }}+ />+ </div>++ <SectionTitle>Hero image</SectionTitle>+ <p>+ "sizes" attribute explicitly equal to 100vw allowing to skip the+ default behavior. Load images depending on the viewport width.+ </p><ImageBasesrc={imageSrc}+ sizes="100vw"style={{+ aspectRatio: "3/1",objectFit: "cover",- position: "absolute",width: "100%",- height: "100%",}}/>- </div>-);--/**- * "sizes" attribute explicitly equal to 100vw allowing to skip the default behavior.- * See DEFAULT_SIZES in the Image component. Load images depending on the viewport width.- **/-export const HeroImage: StoryFn<React.FunctionComponent> = () => (- <ImageBase- src={imageSrc}- sizes="100vw"- style={{- aspectRatio: "3/1",- objectFit: "cover",- width: "100%",- }}- />+ </StorySection>);diff --git a/packages/image/tsconfig.json b/packages/image/tsconfig.jsonindex 9648eaf0a1..31d2f5d187 100644--- a/packages/image/tsconfig.json+++ b/packages/image/tsconfig.json@@ -1,5 +1,6 @@{"extends": "@webstudio-is/tsconfig/base.json",+ "include": ["**/*.ts", "**/*.tsx", "../../@types/**/*.d.ts"],"compilerOptions": {"isolatedDeclarations": true}diff --git a/packages/sdk-components-react/package.json b/packages/sdk-components-react/package.jsonindex 5ff8c5cd8c..63b7ba1586 100644--- a/packages/sdk-components-react/package.json+++ b/packages/sdk-components-react/package.json@@ -62,6 +62,7 @@"@testing-library/react": "^16.2.0","@types/react": "^18.2.70","@types/react-dom": "^18.2.25",+ "@webstudio-is/design-system": "workspace:*","@webstudio-is/generate-arg-types": "workspace:*","@webstudio-is/sdk-cli": "workspace:*","@webstudio-is/template": "workspace:*",diff --git a/packages/sdk-components-react/src/xml-node.stories.tsx b/packages/sdk-components-react/src/xml-node.stories.tsxindex 408008b7a0..64ac37a651 100644--- a/packages/sdk-components-react/src/xml-node.stories.tsx+++ b/packages/sdk-components-react/src/xml-node.stories.tsx@@ -1,4 +1,5 @@import { ReactSdkContext } from "@webstudio-is/react-sdk/runtime";+import { StorySection } from "@webstudio-is/design-system";import { XmlNode } from "./xml-node";const Component = () => {@@ -30,9 +31,9 @@ export default {const Story = {render() {return (- <>+ <StorySection title="Xml Node"><Component />- </>+ </StorySection>);},};diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 92f6eb50ea..d5775d5a57 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -1296,6 +1296,9 @@ importers:'@types/react-dom':specifier: ^18.2.25version: 18.2.25+ '@webstudio-is/design-system':+ specifier: workspace:*+ version: link:../design-system'@webstudio-is/tsconfig':specifier: workspace:*version: link:../tsconfig@@ -1622,6 +1625,9 @@ importers:'@types/react-dom':specifier: ^18.2.25version: 18.2.25+ '@webstudio-is/design-system':+ specifier: workspace:*+ version: link:../design-system'@webstudio-is/tsconfig':specifier: workspace:*version: link:../tsconfig@@ -1656,6 +1662,9 @@ importers:'@types/react-dom':specifier: ^18.2.25version: 18.2.25+ '@webstudio-is/design-system':+ specifier: workspace:*+ version: link:../design-system'@webstudio-is/tsconfig':specifier: workspace:*version: link:../tsconfig@@ -2016,6 +2025,9 @@ importers:'@types/react-dom':specifier: ^18.2.25version: 18.2.25+ '@webstudio-is/design-system':+ specifier: workspace:*+ version: link:../design-system'@webstudio-is/generate-arg-types':specifier: workspace:*version: link:../generate-arg-types