Skip to content

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.

fix: expand story coverage and apply sentence case to all story titles

Oleg Isonen2216adf4f032
diff --git a/.storybook/main.ts b/.storybook/main.ts
index d66948872d..fa64ddf898 100644
--- a/.storybook/main.ts
+++ b/.storybook/main.ts
@@ -24,7 +24,7 @@ const visualTestingStories: StorybookConfig["stories"] = [
},
{
directory: "../packages/design-system/src/components",
- titlePrefix: "Design System",
+ titlePrefix: "Design system",
files: "**/*.stories.tsx",
},
];
@@ -36,7 +36,7 @@ export default {
...visualTestingStories,
{
directory: "../packages/css-engine/src",
- titlePrefix: "CSS Engine",
+ titlePrefix: "CSS engine",
files: "**/*.stories.tsx",
},
{
@@ -51,17 +51,17 @@ export default {
},
{
directory: "../packages/sdk-components-react",
- titlePrefix: "SDK Components React",
+ titlePrefix: "SDK components React",
files: "**/*.stories.tsx",
},
{
directory: "../packages/sdk-components-react-radix",
- titlePrefix: "SDK Components React Radix",
+ titlePrefix: "SDK components React Radix",
files: "**/*.stories.tsx",
},
{
directory: "../packages/sdk-components-animation",
- titlePrefix: "SDK Components Animation",
+ titlePrefix: "SDK components animation",
files: "**/*.stories.tsx",
},
],
diff --git a/apps/builder/app/auth/login.stories.tsx b/apps/builder/app/auth/login.stories.tsx
index c4499d81a6..1375f51e6f 100644
--- a/apps/builder/app/auth/login.stories.tsx
+++ b/apps/builder/app/auth/login.stories.tsx
@@ -4,7 +4,7 @@ import { createBrowserRouter, RouterProvider } from "react-router-dom";
import { Login as LoginComponent } from "./login";
export default {
- title: "Auth/Login",
+ title: "Auth",
component: LoginComponent,
};
@@ -17,7 +17,7 @@ const createRouter = (element: JSX.Element) =>
},
]);
-export const Login: StoryFn<typeof LoginComponent> = () => {
+export const Auth: StoryFn<typeof LoginComponent> = () => {
const router = createRouter(
<LoginComponent isGoogleEnabled={false} isSecretLoginEnabled />
);
diff --git a/apps/builder/app/builder/features/address-bar.stories.tsx b/apps/builder/app/builder/features/address-bar.stories.tsx
index 3a0432f826..affca680e7 100644
--- a/apps/builder/app/builder/features/address-bar.stories.tsx
+++ b/apps/builder/app/builder/features/address-bar.stories.tsx
@@ -62,7 +62,7 @@ const HistoryInspect = () => {
};
export default {
- title: "Address Bar",
+ title: "Address bar",
component: AddressBarPopover,
} satisfies Meta;
diff --git a/apps/builder/app/builder/features/blocking-alerts/alert.stories.tsx b/apps/builder/app/builder/features/blocking-alerts/alert.stories.tsx
index a06154aa1b..23dc0b8c60 100644
--- a/apps/builder/app/builder/features/blocking-alerts/alert.stories.tsx
+++ b/apps/builder/app/builder/features/blocking-alerts/alert.stories.tsx
@@ -1,6 +1,6 @@
import { Alert } from "./alert";
-export default { title: "Blocking Alerts", component: Alert };
+export default { title: "Blocking alerts", component: Alert };
export const BlockingAlerts = () => (
<Alert
diff --git a/apps/builder/app/builder/features/breakpoints/breakpoints-selector.stories.tsx b/apps/builder/app/builder/features/breakpoints/breakpoints-selector.stories.tsx
index 75bc9f740b..43ad9d822d 100644
--- a/apps/builder/app/builder/features/breakpoints/breakpoints-selector.stories.tsx
+++ b/apps/builder/app/builder/features/breakpoints/breakpoints-selector.stories.tsx
@@ -5,6 +5,6 @@ export const BreakpointsSelector = () => {
};
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.tsx
index 60d1db596f..46c4326cbd 100644
--- a/apps/builder/app/builder/features/builder-mode.stories.tsx
+++ b/apps/builder/app/builder/features/builder-mode.stories.tsx
@@ -8,7 +8,7 @@ import {
} from "~/shared/nano-states";
export default {
- title: "Builder Mode",
+ title: "Builder mode",
};
export const DesignMode = () => {
diff --git a/apps/builder/app/builder/features/builder-mode.tsx b/apps/builder/app/builder/features/builder-mode.tsx
index 43c3f09791..33c1e4e293 100644
--- a/apps/builder/app/builder/features/builder-mode.tsx
+++ b/apps/builder/app/builder/features/builder-mode.tsx
@@ -17,6 +17,7 @@ import {
MenuCheckedIcon,
menuItemCss,
theme,
+ ToolbarButton,
ToolbarToggleGroup,
ToolbarToggleItem,
Tooltip,
@@ -93,14 +94,13 @@ export const BuilderModeDropDown = () => {
<DropdownMenu>
<Tooltip content={"Choose mode"}>
<DropdownMenuTrigger asChild>
- <ToolbarToggleItem
+ <ToolbarButton
tabIndex={0}
aria-label="Choose mode"
variant="chevron"
- value="chevron"
>
<ChevronDownIcon />
- </ToolbarToggleItem>
+ </ToolbarButton>
</DropdownMenuTrigger>
</Tooltip>
<DropdownMenuContent
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.tsx
index c18800cdfd..2313a28442 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
@@ -14,7 +14,7 @@ import { CommandPanel as CommandPanelComponent } from "./command-panel";
import { openCommandPanel } from "./command-state";
const meta: Meta = {
- title: "Command Panel",
+ title: "Command panel",
};
export default meta;
diff --git a/apps/builder/app/builder/features/help/help-center.stories.tsx b/apps/builder/app/builder/features/help/help-center.stories.tsx
index f439835850..d1980df210 100644
--- a/apps/builder/app/builder/features/help/help-center.stories.tsx
+++ b/apps/builder/app/builder/features/help/help-center.stories.tsx
@@ -3,7 +3,7 @@ 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,
};
diff --git a/apps/builder/app/builder/features/help/remote-dialog.stories.tsx b/apps/builder/app/builder/features/help/remote-dialog.stories.tsx
index ede02fc85e..9dadaf3f45 100644
--- a/apps/builder/app/builder/features/help/remote-dialog.stories.tsx
+++ b/apps/builder/app/builder/features/help/remote-dialog.stories.tsx
@@ -2,7 +2,7 @@ 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,
};
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.tsx
index e9a50f6075..3196a27183 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
@@ -10,10 +10,10 @@ import {
subscribeCommands();
export default {
- title: "Keyboard Shortcuts Dialog",
+ title: "Keyboard shortcuts dialog",
} satisfies Meta;
-export const KeyboardShortcutsDialog = () => {
+export const KeyboardShortcuts = () => {
useEffect(openKeyboardShortcutsDialog, []);
return <KeyboardShortcutsDialogComponent />;
};
diff --git a/apps/builder/app/builder/features/pages/confirmation-dialogs.stories.tsx b/apps/builder/app/builder/features/pages/confirmation-dialogs.stories.tsx
index 31be14657c..e710c0b73f 100644
--- a/apps/builder/app/builder/features/pages/confirmation-dialogs.stories.tsx
+++ b/apps/builder/app/builder/features/pages/confirmation-dialogs.stories.tsx
@@ -1,37 +1,37 @@
-import { Flex } from "@webstudio-is/design-system";
import {
DeletePageConfirmationDialog,
DeleteFolderConfirmationDialog,
} from "./confirmation-dialogs";
export default {
- title: "Builder/Pages/Confirmation Dialogs",
+ title: "Builder/Pages/Confirmation dialogs",
};
-export const ConfirmationDialogs = () => (
- <Flex direction="column" gap="5">
- <DeletePageConfirmationDialog
- page={{
- id: "page-1",
- name: "About us",
- path: "/about",
- title: "About Us",
- rootInstanceId: "root-1",
- systemDataSourceId: "ds-1",
- meta: {},
- }}
- onClose={() => {}}
- onConfirm={() => {}}
- />
- <DeleteFolderConfirmationDialog
- folder={{
- id: "folder-1",
- name: "Marketing",
- slug: "marketing",
- children: [],
- }}
- onClose={() => {}}
- onConfirm={() => {}}
- />
- </Flex>
+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={() => {}}
+ />
+);
+
+export const DeleteFolder = () => (
+ <DeleteFolderConfirmationDialog
+ folder={{
+ id: "folder-1",
+ name: "Marketing",
+ slug: "marketing",
+ children: [],
+ }}
+ onClose={() => {}}
+ onConfirm={() => {}}
+ />
);
diff --git a/apps/builder/app/builder/features/pages/custom-metadata.stories.tsx b/apps/builder/app/builder/features/pages/custom-metadata.stories.tsx
index 85b4567932..f09a122ec9 100644
--- a/apps/builder/app/builder/features/pages/custom-metadata.stories.tsx
+++ b/apps/builder/app/builder/features/pages/custom-metadata.stories.tsx
@@ -4,7 +4,7 @@ import { useState } from "react";
export default {
component: CustomMetadataComponent,
- title: "Pages/Custom Metadata",
+ title: "Pages/Custom metadata",
};
export const CustomMetadata = () => {
diff --git a/apps/builder/app/builder/features/pages/image-info.stories.tsx b/apps/builder/app/builder/features/pages/image-info.stories.tsx
index 41aeae23b7..b5e9cb1d8a 100644
--- a/apps/builder/app/builder/features/pages/image-info.stories.tsx
+++ b/apps/builder/app/builder/features/pages/image-info.stories.tsx
@@ -3,7 +3,7 @@ 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,
};
diff --git a/apps/builder/app/builder/features/pages/page-settings.stories.tsx b/apps/builder/app/builder/features/pages/page-settings.stories.tsx
index 83367c5093..6b246ae0a8 100644
--- a/apps/builder/app/builder/features/pages/page-settings.stories.tsx
+++ b/apps/builder/app/builder/features/pages/page-settings.stories.tsx
@@ -11,7 +11,7 @@ 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: {
diff --git a/apps/builder/app/builder/features/pages/search-preview.stories.tsx b/apps/builder/app/builder/features/pages/search-preview.stories.tsx
index 239d963568..4f7ffebec4 100644
--- a/apps/builder/app/builder/features/pages/search-preview.stories.tsx
+++ b/apps/builder/app/builder/features/pages/search-preview.stories.tsx
@@ -2,7 +2,7 @@ import { Box } from "@webstudio-is/design-system";
import { SearchPreview as SearchPreviewComponent } from "./search-preview";
export default {
- title: "Pages/Search Preview",
+ title: "Pages/Search preview",
component: SearchPreviewComponent,
};
diff --git a/apps/builder/app/builder/features/pages/social-preview.stories.tsx b/apps/builder/app/builder/features/pages/social-preview.stories.tsx
index 3e92bfe968..331e5de883 100644
--- a/apps/builder/app/builder/features/pages/social-preview.stories.tsx
+++ b/apps/builder/app/builder/features/pages/social-preview.stories.tsx
@@ -10,7 +10,7 @@ const placeholderImage = `data:image/svg+xml,${encodeURIComponent(
)}`;
export default {
- title: "Pages/Social Preview",
+ title: "Pages/Social preview",
component: SocialPreviewComponent,
};
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.tsx
index 146b0b288c..b1fc4120c6 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
@@ -1,35 +1,609 @@
import {
Flex,
+ Grid,
Text,
Button,
+ InputField,
+ Label,
+ Separator,
SmallIconButton,
+ IconButton,
+ Tooltip,
+ ScrollArea,
+ PanelBanner,
+ Link,
+ Select,
+ TextArea,
+ Checkbox,
+ theme,
+ rawTheme,
+ buttonStyle,
+ PopoverContent,
+ PopoverTitle,
+ PopoverClose,
+ PopoverTitleActions,
} from "@webstudio-is/design-system";
-import { DotIcon, ExternalLinkIcon } from "@webstudio-is/icons";
-import { CollapsibleDomainSection as CollapsibleDomainSectionComponent } from "./collapsible-domain-section";
+import {
+ DotIcon,
+ ExternalLinkIcon,
+ CheckCircleIcon,
+ AlertIcon,
+ CopyIcon,
+ GearIcon,
+ UpgradeIcon,
+ InfoCircleIcon,
+ HelpIcon,
+} from "@webstudio-is/icons";
+import { CollapsibleDomainSection } from "./collapsible-domain-section";
export default {
- title: "Builder/Publish/Collapsible Domain Section",
- component: CollapsibleDomainSectionComponent,
+ title: "Builder/Publish",
};
-export const CollapsibleDomainSection = () => (
- <Flex direction="column" gap="3" css={{ width: 320 }}>
- <CollapsibleDomainSectionComponent
+const StatusIcon = ({ status }: { status: "ok" | "error" | "pending" }) => (
+ <Flex
+ align="center"
+ justify="center"
+ css={{
+ width: theme.sizes.controlHeight,
+ height: theme.sizes.controlHeight,
+ color:
+ status === "error"
+ ? theme.colors.foregroundDestructive
+ : status === "pending"
+ ? theme.colors.foregroundSubtle
+ : theme.colors.foregroundSuccessText,
+ }}
+ >
+ {status === "error" ? <AlertIcon /> : <CheckCircleIcon />}
+ </Flex>
+);
+
+const DomainSuffix = ({ status }: { status: "ok" | "error" | "pending" }) => (
+ <Grid flow="column" align="center">
+ <Tooltip content={<Text>Status</Text>}>
+ <StatusIcon status={status} />
+ </Tooltip>
+ <IconButton type="button" tabIndex={-1}>
+ <CopyIcon />
+ </IconButton>
+ </Grid>
+);
+
+const MockCheckbox = ({ checked = false }: { checked?: boolean }) => (
+ <Checkbox defaultChecked={checked} />
+);
+
+// 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 />
+ </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" />
+ </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>
+ </Grid>
+ </Grid>
+ </CollapsibleDomainSection>
+ </Flex>
+);
+
+// Story: Custom domain states
+export const CustomDomains = () => (
+ <Flex direction="column" gap="3" css={{ width: theme.spacing[33] }}>
+ <Text variant="labels">Verified and active</Text>
+ <CollapsibleDomainSection
title="example.com"
- prefix={<DotIcon />}
- suffix={<SmallIconButton icon={<ExternalLinkIcon />} aria-label="Open" />}
+ prefix={<MockCheckbox checked />}
+ suffix={<DomainSuffix status="ok" />}
initiallyOpen
>
- <Text>DNS records and status go here.</Text>
- <Button color="neutral">Verify DNS</Button>
- </CollapsibleDomainSectionComponent>
+ <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>
- <CollapsibleDomainSectionComponent
+ <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}>
+ <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={<DotIcon />}
- suffix={<SmallIconButton icon={<ExternalLinkIcon />} aria-label="Open" />}
+ prefix={<MockCheckbox />}
+ suffix={<DomainSuffix status="pending" />}
+ initiallyOpen
>
- <Text>This section is collapsed by default.</Text>
- </CollapsibleDomainSectionComponent>
+ <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>
+ </Grid>
+ </Grid>
+ </CollapsibleDomainSection>
+ </Flex>
+);
+
+// Story: Publish button states
+export 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%" }}>
+ 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>
+);
+
+// Story: Upgrade banners
+export 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
+ </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&apos;t forget to publish</Text>
+ </Flex>
+ <Text>
+ You have a custom domain that hasn&apos;t been published yet. Hit
+ publish to make it live.
+ </Text>
+ </PanelBanner>
+ </Flex>
+);
+
+// Story: Full publish dialog layout
+export 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>
+ }
+ >
+ 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>
+ </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>
+
+ <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>
+ </Flex>
+);
+
+// Story: Export dialog layout
+export 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>
+
+ <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>
+ <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>
+);
+
+// Story: Static export variant
+export 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>
);
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.tsx
index e154b6c208..88ce4800c8 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
@@ -7,7 +7,7 @@ import { CheckControl } from "./check";
import { RadioControl } from "./radio";
export default {
- title: "Builder/Settings Panel/Controls",
+ title: "Builder/Settings panel/Controls",
};
const Section = ({
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.tsx
index 0102ee2b86..868170ba58 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
@@ -5,7 +5,7 @@ import { useState } from "react";
import type { ScrollAnimation, ViewAnimation } from "@webstudio-is/sdk";
const meta = {
- title: "Settings Panel/Animation Panel Content",
+ title: "Settings panel/Animation panel content",
component: AnimationPanelContent,
parameters: {
layout: "centered",
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.tsx
index 4494e70fc0..94fa5adb3b 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
@@ -409,7 +409,7 @@ export const PropsSection = () => {
};
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.tsx
index 3aef174ae5..b61598440b 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
@@ -13,7 +13,7 @@ $userPlanFeatures.set({
});
export default {
- title: "Variables Section",
+ title: "Variables section",
component: VariablesSectionComponent,
} satisfies Meta;
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.tsx
index 8c15bcc8fd..d2fe42857f 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,13 +1,132 @@
+import { useEffect } from "react";
import { Box, theme } from "@webstudio-is/design-system";
+import { getStyleDeclKey, type StyleDecl } from "@webstudio-is/sdk";
+import {
+ $breakpoints,
+ $instances,
+ $pages,
+ $selectedBreakpointId,
+ $styles,
+ $styleSources,
+ $styleSourceSelections,
+} from "~/shared/nano-states";
+import { registerContainers } from "~/shared/sync/sync-stores";
+import { createDefaultPages } from "@webstudio-is/project-build";
+import { $awareness } from "~/shared/awareness";
import { Section } from "./backdrop-filter";
+registerContainers();
+$breakpoints.set(new Map([["base", { id: "base", label: "" }]]));
+$selectedBreakpointId.set("base");
+$styleSources.set(new Map([["local", { id: "local", type: "local" }]]));
+$styleSourceSelections.set(
+ new Map([["box", { instanceId: "box", values: ["local"] }]])
+);
+$instances.set(
+ new Map([
+ ["box", { type: "instance", id: "box", component: "Box", children: [] }],
+ ])
+);
+$pages.set(
+ createDefaultPages({
+ homePageId: "homePageId",
+ rootInstanceId: "box",
+ })
+);
+$awareness.set({
+ pageId: "homePageId",
+ instanceSelector: ["box"],
+});
+
+const blurBackdropFilter: StyleDecl = {
+ breakpointId: "base",
+ styleSourceId: "local",
+ property: "backdropFilter",
+ value: {
+ type: "tuple",
+ value: [
+ {
+ type: "function",
+ name: "blur",
+ args: {
+ type: "tuple",
+ value: [{ type: "unit", unit: "px", value: 4 }],
+ },
+ },
+ ],
+ },
+};
+
+const multipleBackdropFilters: StyleDecl = {
+ breakpointId: "base",
+ styleSourceId: "local",
+ property: "backdropFilter",
+ value: {
+ type: "tuple",
+ value: [
+ {
+ type: "function",
+ name: "blur",
+ args: {
+ type: "tuple",
+ value: [{ type: "unit", unit: "px", value: 4 }],
+ },
+ },
+ {
+ type: "function",
+ name: "brightness",
+ args: {
+ type: "tuple",
+ value: [{ type: "unit", unit: "%", value: 150 }],
+ },
+ },
+ {
+ type: "function",
+ name: "contrast",
+ args: {
+ type: "tuple",
+ value: [{ type: "unit", unit: "%", value: 200 }],
+ },
+ },
+ ],
+ },
+};
+
export const BackdropFilters = () => (
<Box css={{ width: theme.sizes.sidebarWidth }}>
<Section />
</Box>
);
+export const WithBlurFilter = () => {
+ useEffect(() => {
+ $styles.set(
+ new Map([[getStyleDeclKey(blurBackdropFilter), blurBackdropFilter]])
+ );
+ }, []);
+ return (
+ <Box css={{ width: theme.sizes.sidebarWidth }}>
+ <Section />
+ </Box>
+ );
+};
+
+export const WithMultipleFilters = () => {
+ useEffect(() => {
+ $styles.set(
+ new Map([
+ [getStyleDeclKey(multipleBackdropFilters), multipleBackdropFilters],
+ ])
+ );
+ }, []);
+ return (
+ <Box css={{ width: theme.sizes.sidebarWidth }}>
+ <Section />
+ </Box>
+ );
+};
+
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.tsx
index e83e68514e..99b596d5d6 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
@@ -123,7 +123,25 @@ export const Solid = () => {
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 default {
- title: "Style Panel/Backgrounds",
+ title: "Style panel/Backgrounds",
component: Image,
};
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.tsx
index 991c6e3f5d..748aae11f1 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,3 +1,4 @@
+import { useEffect } from "react";
import { getStyleDeclKey, type StyleDecl } from "@webstudio-is/sdk";
import { Box, theme } from "@webstudio-is/design-system";
import { registerContainers } from "~/shared/sync/sync-stores";
@@ -57,7 +58,45 @@ export const Section = () => (
</Box>
);
+export const SingleLayer = () => {
+ useEffect(() => {
+ const singleBackground: StyleDecl = {
+ breakpointId: "base",
+ styleSourceId: "local",
+ property: "backgroundImage",
+ value: {
+ type: "layers",
+ value: [
+ {
+ type: "unparsed",
+ value: "linear-gradient(to right, red, orange)",
+ },
+ ],
+ },
+ };
+ $styles.set(
+ new Map([[getStyleDeclKey(singleBackground), singleBackground]])
+ );
+ }, []);
+ return (
+ <Box css={{ width: theme.sizes.sidebarWidth }}>
+ <SectionComponent />
+ </Box>
+ );
+};
+
+export const EmptyBackgrounds = () => {
+ useEffect(() => {
+ $styles.set(new Map());
+ }, []);
+ return (
+ <Box css={{ width: theme.sizes.sidebarWidth }}>
+ <SectionComponent />
+ </Box>
+ );
+};
+
export default {
- title: "Style Panel/Backgrounds/Section",
+ 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.tsx
index e5e051a51c..13b82113e5 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,13 +1,142 @@
+import { useEffect } from "react";
import { Box, theme } from "@webstudio-is/design-system";
+import { getStyleDeclKey, type StyleDecl } from "@webstudio-is/sdk";
+import {
+ $breakpoints,
+ $instances,
+ $pages,
+ $selectedBreakpointId,
+ $styles,
+ $styleSources,
+ $styleSourceSelections,
+} from "~/shared/nano-states";
+import { registerContainers } from "~/shared/sync/sync-stores";
+import { createDefaultPages } from "@webstudio-is/project-build";
+import { $awareness } from "~/shared/awareness";
import { Section } from "./borders";
+registerContainers();
+$breakpoints.set(new Map([["base", { id: "base", label: "" }]]));
+$selectedBreakpointId.set("base");
+$styleSources.set(new Map([["local", { id: "local", type: "local" }]]));
+$styleSourceSelections.set(
+ new Map([["box", { instanceId: "box", values: ["local"] }]])
+);
+$instances.set(
+ new Map([
+ ["box", { type: "instance", id: "box", component: "Box", children: [] }],
+ ])
+);
+$pages.set(
+ createDefaultPages({
+ homePageId: "homePageId",
+ rootInstanceId: "box",
+ })
+);
+$awareness.set({
+ pageId: "homePageId",
+ instanceSelector: ["box"],
+});
+
+const solidBorderTop: StyleDecl = {
+ breakpointId: "base",
+ styleSourceId: "local",
+ property: "borderTopStyle",
+ value: { type: "keyword", value: "solid" },
+};
+
+const solidBorderRight: StyleDecl = {
+ breakpointId: "base",
+ styleSourceId: "local",
+ property: "borderRightStyle",
+ value: { type: "keyword", value: "solid" },
+};
+
+const solidBorderBottom: StyleDecl = {
+ breakpointId: "base",
+ styleSourceId: "local",
+ property: "borderBottomStyle",
+ value: { type: "keyword", value: "solid" },
+};
+
+const solidBorderLeft: StyleDecl = {
+ breakpointId: "base",
+ styleSourceId: "local",
+ property: "borderLeftStyle",
+ value: { type: "keyword", value: "solid" },
+};
+
+const borderWidthTop: StyleDecl = {
+ breakpointId: "base",
+ styleSourceId: "local",
+ property: "borderTopWidth",
+ value: { type: "unit", value: 2, unit: "px" },
+};
+
+const dashedBorderTop: StyleDecl = {
+ breakpointId: "base",
+ styleSourceId: "local",
+ property: "borderTopStyle",
+ value: { type: "keyword", value: "dashed" },
+};
+
+const dottedBorderBottom: StyleDecl = {
+ breakpointId: "base",
+ styleSourceId: "local",
+ property: "borderBottomStyle",
+ value: { type: "keyword", value: "dotted" },
+};
+
+const borderRadius: StyleDecl = {
+ breakpointId: "base",
+ styleSourceId: "local",
+ property: "borderTopLeftRadius",
+ value: { type: "unit", value: 8, unit: "px" },
+};
+
export const Borders = () => (
<Box css={{ width: theme.sizes.sidebarWidth }}>
<Section />
</Box>
);
+export const WithSolidBorder = () => {
+ useEffect(() => {
+ $styles.set(
+ new Map([
+ [getStyleDeclKey(solidBorderTop), solidBorderTop],
+ [getStyleDeclKey(solidBorderRight), solidBorderRight],
+ [getStyleDeclKey(solidBorderBottom), solidBorderBottom],
+ [getStyleDeclKey(solidBorderLeft), solidBorderLeft],
+ [getStyleDeclKey(borderWidthTop), borderWidthTop],
+ ])
+ );
+ }, []);
+ return (
+ <Box css={{ width: theme.sizes.sidebarWidth }}>
+ <Section />
+ </Box>
+ );
+};
+
+export const WithMixedBorders = () => {
+ useEffect(() => {
+ $styles.set(
+ new Map([
+ [getStyleDeclKey(dashedBorderTop), dashedBorderTop],
+ [getStyleDeclKey(dottedBorderBottom), dottedBorderBottom],
+ [getStyleDeclKey(borderRadius), borderRadius],
+ ])
+ );
+ }, []);
+ return (
+ <Box css={{ width: theme.sizes.sidebarWidth }}>
+ <Section />
+ </Box>
+ );
+};
+
export default {
- title: "Style Panel/Borders",
+ 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.tsx
index 2657bb0f65..0635d7ae8c 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,13 +1,169 @@
+import { useEffect } from "react";
import { Box, theme } from "@webstudio-is/design-system";
+import { getStyleDeclKey, type StyleDecl } from "@webstudio-is/sdk";
+import {
+ $breakpoints,
+ $instances,
+ $pages,
+ $selectedBreakpointId,
+ $styles,
+ $styleSources,
+ $styleSourceSelections,
+} from "~/shared/nano-states";
+import { registerContainers } from "~/shared/sync/sync-stores";
+import { createDefaultPages } from "@webstudio-is/project-build";
+import { $awareness } from "~/shared/awareness";
import { Section } from "./box-shadows";
+registerContainers();
+$breakpoints.set(new Map([["base", { id: "base", label: "" }]]));
+$selectedBreakpointId.set("base");
+$styleSources.set(new Map([["local", { id: "local", type: "local" }]]));
+$styleSourceSelections.set(
+ new Map([["box", { instanceId: "box", values: ["local"] }]])
+);
+$instances.set(
+ new Map([
+ ["box", { type: "instance", id: "box", component: "Box", children: [] }],
+ ])
+);
+$pages.set(
+ createDefaultPages({
+ homePageId: "homePageId",
+ rootInstanceId: "box",
+ })
+);
+$awareness.set({
+ pageId: "homePageId",
+ instanceSelector: ["box"],
+});
+
+const outerShadow: StyleDecl = {
+ breakpointId: "base",
+ styleSourceId: "local",
+ property: "boxShadow",
+ value: {
+ type: "layers",
+ value: [
+ {
+ type: "shadow",
+ position: "outset",
+ offsetX: { type: "unit", unit: "px", value: 0 },
+ offsetY: { type: "unit", unit: "px", value: 2 },
+ blur: { type: "unit", unit: "px", value: 5 },
+ spread: { type: "unit", unit: "px", value: 0 },
+ color: {
+ type: "color",
+ colorSpace: "srgb",
+ alpha: 0.2,
+ components: [0, 0, 0],
+ },
+ },
+ ],
+ },
+};
+
+const insetShadow: StyleDecl = {
+ breakpointId: "base",
+ styleSourceId: "local",
+ property: "boxShadow",
+ value: {
+ type: "layers",
+ value: [
+ {
+ type: "shadow",
+ position: "inset",
+ offsetX: { type: "unit", unit: "px", value: 0 },
+ offsetY: { type: "unit", unit: "px", value: 0 },
+ blur: { type: "unit", unit: "px", value: 10 },
+ color: {
+ type: "color",
+ colorSpace: "srgb",
+ alpha: 0.3,
+ components: [0, 0, 0],
+ },
+ },
+ ],
+ },
+};
+
+const multipleShadows: StyleDecl = {
+ breakpointId: "base",
+ styleSourceId: "local",
+ property: "boxShadow",
+ value: {
+ type: "layers",
+ value: [
+ {
+ type: "shadow",
+ position: "outset",
+ offsetX: { type: "unit", unit: "px", value: 0 },
+ offsetY: { type: "unit", unit: "px", value: 2 },
+ blur: { type: "unit", unit: "px", value: 5 },
+ color: {
+ type: "color",
+ colorSpace: "srgb",
+ alpha: 0.2,
+ components: [0, 0, 0],
+ },
+ },
+ {
+ type: "shadow",
+ position: "inset",
+ offsetX: { type: "unit", unit: "px", value: 0 },
+ offsetY: { type: "unit", unit: "px", value: 0 },
+ blur: { type: "unit", unit: "px", value: 10 },
+ color: {
+ type: "color",
+ colorSpace: "srgb",
+ alpha: 0.3,
+ components: [0, 0, 0],
+ },
+ },
+ ],
+ },
+};
+
export const BoxShadows = () => (
<Box css={{ width: theme.sizes.sidebarWidth }}>
<Section />
</Box>
);
+export const WithOuterShadow = () => {
+ useEffect(() => {
+ $styles.set(new Map([[getStyleDeclKey(outerShadow), outerShadow]]));
+ }, []);
+ return (
+ <Box css={{ width: theme.sizes.sidebarWidth }}>
+ <Section />
+ </Box>
+ );
+};
+
+export const WithInsetShadow = () => {
+ useEffect(() => {
+ $styles.set(new Map([[getStyleDeclKey(insetShadow), insetShadow]]));
+ }, []);
+ return (
+ <Box css={{ width: theme.sizes.sidebarWidth }}>
+ <Section />
+ </Box>
+ );
+};
+
+export const WithMultipleShadows = () => {
+ useEffect(() => {
+ $styles.set(new Map([[getStyleDeclKey(multipleShadows), multipleShadows]]));
+ }, []);
+ return (
+ <Box css={{ width: theme.sizes.sidebarWidth }}>
+ <Section />
+ </Box>
+ );
+};
+
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.tsx
index 1dded201d7..f92cde4a22 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,13 +1,128 @@
+import { useEffect } from "react";
import { Box, theme } from "@webstudio-is/design-system";
+import { getStyleDeclKey, type StyleDecl } from "@webstudio-is/sdk";
+import {
+ $breakpoints,
+ $instances,
+ $pages,
+ $selectedBreakpointId,
+ $styles,
+ $styleSources,
+ $styleSourceSelections,
+} from "~/shared/nano-states";
+import { registerContainers } from "~/shared/sync/sync-stores";
+import { createDefaultPages } from "@webstudio-is/project-build";
+import { $awareness } from "~/shared/awareness";
import { Section } from "./filter";
+registerContainers();
+$breakpoints.set(new Map([["base", { id: "base", label: "" }]]));
+$selectedBreakpointId.set("base");
+$styleSources.set(new Map([["local", { id: "local", type: "local" }]]));
+$styleSourceSelections.set(
+ new Map([["box", { instanceId: "box", values: ["local"] }]])
+);
+$instances.set(
+ new Map([
+ ["box", { type: "instance", id: "box", component: "Box", children: [] }],
+ ])
+);
+$pages.set(
+ createDefaultPages({
+ homePageId: "homePageId",
+ rootInstanceId: "box",
+ })
+);
+$awareness.set({
+ pageId: "homePageId",
+ instanceSelector: ["box"],
+});
+
+const blurFilterStyle: StyleDecl = {
+ breakpointId: "base",
+ styleSourceId: "local",
+ property: "filter",
+ value: {
+ type: "tuple",
+ value: [
+ {
+ type: "function",
+ name: "blur",
+ args: {
+ type: "tuple",
+ value: [{ type: "unit", unit: "px", value: 4 }],
+ },
+ },
+ ],
+ },
+};
+
+const multipleFilterStyles: StyleDecl = {
+ breakpointId: "base",
+ styleSourceId: "local",
+ property: "filter",
+ value: {
+ type: "tuple",
+ value: [
+ {
+ type: "function",
+ name: "blur",
+ args: {
+ type: "tuple",
+ value: [{ type: "unit", unit: "px", value: 4 }],
+ },
+ },
+ {
+ type: "function",
+ name: "brightness",
+ args: {
+ type: "tuple",
+ value: [{ type: "unit", unit: "%", value: 150 }],
+ },
+ },
+ {
+ type: "function",
+ name: "grayscale",
+ args: {
+ type: "tuple",
+ value: [{ type: "unit", unit: "%", value: 50 }],
+ },
+ },
+ ],
+ },
+};
+
export const Filters = () => (
<Box css={{ width: theme.sizes.sidebarWidth }}>
<Section />
</Box>
);
+export const WithBlurFilter = () => {
+ useEffect(() => {
+ $styles.set(new Map([[getStyleDeclKey(blurFilterStyle), blurFilterStyle]]));
+ }, []);
+ return (
+ <Box css={{ width: theme.sizes.sidebarWidth }}>
+ <Section />
+ </Box>
+ );
+};
+
+export const WithMultipleFilters = () => {
+ useEffect(() => {
+ $styles.set(
+ new Map([[getStyleDeclKey(multipleFilterStyles), multipleFilterStyles]])
+ );
+ }, []);
+ return (
+ <Box css={{ width: theme.sizes.sidebarWidth }}>
+ <Section />
+ </Box>
+ );
+};
+
export default {
- title: "Style Panel/Filters",
+ 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.tsx
index 35be714d2f..72568b412f 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
@@ -8,6 +8,6 @@ export const FlexChild = () => (
);
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.tsx
index 0c7fa8f096..ac4a086742 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
@@ -8,6 +8,6 @@ export const GridChild = () => (
);
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.tsx
index fd4209d7e9..6e5244cbb1 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
@@ -8,6 +8,6 @@ export const Layout = () => (
);
export default {
- title: "Style Panel/Layout",
+ title: "Style panel/Layout",
component: Section,
};
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.tsx
index 52d329713d..e61a08fee6 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,8 +1,9 @@
+import { useState } from "react";
import { Box, Flex, Text, theme } from "@webstudio-is/design-system";
import { AlignmentUi } from "./alignment-ui";
export default {
- title: "Style Panel/Layout/Alignment UI",
+ title: "Style panel/Layout/Alignment UI",
component: AlignmentUi,
};
@@ -137,3 +138,31 @@ export const Grid_ = () => (
/>
</Flex>
);
+
+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"
+ isColumnDirection={false}
+ color="currentColor"
+ itemStretchWidth={false}
+ itemStretchHeight={false}
+ onSelect={setSelected}
+ />
+ </Box>
+ </Flex>
+ );
+};
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.tsx
index c6a13ce8ee..c5401f6556 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,13 +1,119 @@
+import { useEffect } from "react";
import { Box, theme } from "@webstudio-is/design-system";
+import { getStyleDeclKey, type StyleDecl } from "@webstudio-is/sdk";
+import {
+ $breakpoints,
+ $instances,
+ $pages,
+ $selectedBreakpointId,
+ $styles,
+ $styleSources,
+ $styleSourceSelections,
+} from "~/shared/nano-states";
+import { registerContainers } from "~/shared/sync/sync-stores";
+import { createDefaultPages } from "@webstudio-is/project-build";
+import { $awareness } from "~/shared/awareness";
import { Section } from "./outline";
+registerContainers();
+$breakpoints.set(new Map([["base", { id: "base", label: "" }]]));
+$selectedBreakpointId.set("base");
+$styleSources.set(new Map([["local", { id: "local", type: "local" }]]));
+$styleSourceSelections.set(
+ new Map([["box", { instanceId: "box", values: ["local"] }]])
+);
+$instances.set(
+ new Map([
+ ["box", { type: "instance", id: "box", component: "Box", children: [] }],
+ ])
+);
+$pages.set(
+ createDefaultPages({
+ homePageId: "homePageId",
+ rootInstanceId: "box",
+ })
+);
+$awareness.set({
+ pageId: "homePageId",
+ instanceSelector: ["box"],
+});
+
+const solidOutline: StyleDecl = {
+ breakpointId: "base",
+ styleSourceId: "local",
+ property: "outlineStyle",
+ value: { type: "keyword", value: "solid" },
+};
+
+const outlineWidth: StyleDecl = {
+ breakpointId: "base",
+ styleSourceId: "local",
+ property: "outlineWidth",
+ value: { type: "unit", value: 2, unit: "px" },
+};
+
+const dashedOutline: StyleDecl = {
+ breakpointId: "base",
+ styleSourceId: "local",
+ property: "outlineStyle",
+ value: { type: "keyword", value: "dashed" },
+};
+
+const outlineColor: StyleDecl = {
+ breakpointId: "base",
+ styleSourceId: "local",
+ property: "outlineColor",
+ value: { type: "keyword", value: "red" },
+};
+
+const outlineOffset: StyleDecl = {
+ breakpointId: "base",
+ styleSourceId: "local",
+ property: "outlineOffset",
+ value: { type: "unit", value: 4, unit: "px" },
+};
+
export const Outline = () => (
<Box css={{ width: theme.sizes.sidebarWidth }}>
<Section />
</Box>
);
+export const WithSolidOutline = () => {
+ useEffect(() => {
+ $styles.set(
+ new Map([
+ [getStyleDeclKey(solidOutline), solidOutline],
+ [getStyleDeclKey(outlineWidth), outlineWidth],
+ ])
+ );
+ }, []);
+ return (
+ <Box css={{ width: theme.sizes.sidebarWidth }}>
+ <Section />
+ </Box>
+ );
+};
+
+export const WithDashedOutline = () => {
+ useEffect(() => {
+ $styles.set(
+ new Map([
+ [getStyleDeclKey(dashedOutline), dashedOutline],
+ [getStyleDeclKey(outlineColor), outlineColor],
+ [getStyleDeclKey(outlineWidth), outlineWidth],
+ [getStyleDeclKey(outlineOffset), outlineOffset],
+ ])
+ );
+ }, []);
+ return (
+ <Box css={{ width: theme.sizes.sidebarWidth }}>
+ <Section />
+ </Box>
+ );
+};
+
export default {
- title: "Style Panel/Outline",
+ 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.tsx
index db1346ee28..b25a2d41be 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
@@ -102,6 +102,6 @@ export const Inset = () => {
};
export default {
- title: "Style Panel/Inset",
+ title: "Style panel/Inset",
component: Inset,
} as Meta<typeof Inset>;
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.tsx
index 6299b42af8..9708666695 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
@@ -67,7 +67,46 @@ export const InsetLayout = () => (
</Flex>
);
+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>
+);
+
+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>
+);
+
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/shared/value-text.stories.tsx b/apps/builder/app/builder/features/style-panel/sections/shared/value-text.stories.tsx
deleted file mode 100644
index 07070c6a82..0000000000
--- a/apps/builder/app/builder/features/style-panel/sections/shared/value-text.stories.tsx
+++ /dev/null
@@ -1,56 +0,0 @@
-import type { Meta } from "@storybook/react";
-import { type ComponentProps, useState } from "react";
-import { parseCssValue } from "@webstudio-is/css-data";
-import { Box, theme } from "@webstudio-is/design-system";
-import { SpaceLayout } from "../space/layout";
-import { ValueText as ValueTextComponent } from "./value-text";
-
-export const ValueText = (
- args: Pick<ComponentProps<typeof ValueTextComponent>, "source" | "value">
-) => {
- const [_hovered, setHovered] = useState<{ property: string }>();
- return (
- <Box css={{ width: theme.sizes.sidebarWidth }}>
- <SpaceLayout
- onHover={setHovered}
- onClick={() => null}
- renderCell={() => <ValueTextComponent {...args} />}
- />
- </Box>
- );
-};
-
-ValueText.args = {
- source: "local",
- value: { type: "unit", value: 100, unit: "px" },
-};
-
-const valueOptions = [
- "0",
- "10rem",
- "100rem",
- "100px",
- "1000px",
- "10000px",
- "100000px",
- "auto",
- "revert-layer",
-];
-
-export default {
- title: "Style Panel/Space/Value Text",
- component: ValueText,
- argTypes: {
- source: {
- control: "select",
- options: ["local", "overwritten", "preset", "default", "remote"],
- },
- value: {
- control: "select",
- options: valueOptions,
- labels: Object.fromEntries(
- valueOptions.map((value) => [value, parseCssValue("margin-top", value)])
- ),
- },
- },
-} as Meta<typeof ValueText>;
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.tsx
index e34d016e9d..09308de89a 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
@@ -8,6 +8,6 @@ export const Size = () => (
);
export default {
- title: "Style Panel/Size",
+ title: "Style panel/Size",
component: Section,
};
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.tsx
index 82b9f5fc90..6292a0013c 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,20 +1,133 @@
import type { Meta } from "@storybook/react";
-import type * as React from "react";
-import { Box, theme } from "@webstudio-is/design-system";
+import { useState } from "react";
+import { Box, Flex, Text, theme } from "@webstudio-is/design-system";
import { SpaceLayout } from "./layout";
+import { ValueText } from "../shared/value-text";
-export const Layout = (
- args: Omit<React.ComponentProps<typeof SpaceLayout>, "renderCell">
-) => (
- <Box css={{ width: theme.sizes.sidebarWidth }}>
- <SpaceLayout
- renderCell={() => <div style={{ color: "red" }}>·</div>}
- {...args}
- />
- </Box>
+export default {
+ title: "Style panel/Space",
+} 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>
);
-export default {
- title: "Style Panel/Space/Layout",
- component: Layout,
-} as Meta<typeof Layout>;
+const allSources = [
+ "local",
+ "overwritten",
+ "preset",
+ "default",
+ "remote",
+] as const;
+const allValues = [
+ { type: "unit" as const, value: 0, unit: "px" as const },
+ { type: "unit" as const, value: 10, unit: "rem" as const },
+ { type: "unit" as const, value: 100, unit: "px" as const },
+ { type: "unit" as const, value: 1000, unit: "px" as const },
+ { type: "keyword" as const, value: "auto" },
+ { type: "keyword" as const, value: "revert-layer" },
+];
+
+export const ValueTexts = () => {
+ const [_hovered, setHovered] = useState<{ property: string }>();
+ return (
+ <Flex direction="column" gap="5">
+ {allSources.map((source) => (
+ <Flex key={source} direction="column" gap="1">
+ <Text variant="labels">Source: {source}</Text>
+ <Box css={{ width: theme.sizes.sidebarWidth }}>
+ <SpaceLayout
+ onHover={setHovered}
+ onClick={() => undefined}
+ renderCell={() => (
+ <ValueText
+ source={source}
+ value={{ type: "unit", value: 100, unit: "px" }}
+ />
+ )}
+ />
+ </Box>
+ </Flex>
+ ))}
+ <Text variant="labels">Different values</Text>
+ {allValues.map((value, index) => (
+ <Flex key={index} direction="column" gap="1">
+ <Text variant="mono" css={{ fontSize: 11 }}>
+ {JSON.stringify(value)}
+ </Text>
+ <Box css={{ width: theme.sizes.sidebarWidth }}>
+ <SpaceLayout
+ onHover={setHovered}
+ onClick={() => undefined}
+ renderCell={() => <ValueText source="local" value={value} />}
+ />
+ </Box>
+ </Flex>
+ ))}
+ </Flex>
+ );
+};
+
+export const ActiveProperties = () => (
+ <Flex direction="column" gap="5">
+ <Flex direction="column" gap="1">
+ <Text variant="labels">Active margin sides (top + bottom)</Text>
+ <Box css={{ width: theme.sizes.sidebarWidth }}>
+ <SpaceLayout
+ onHover={() => {}}
+ activeProperties={["margin-top", "margin-bottom"]}
+ renderCell={() => (
+ <ValueText
+ source="local"
+ value={{ type: "unit", value: 10, unit: "px" }}
+ />
+ )}
+ />
+ </Box>
+ </Flex>
+ <Flex direction="column" gap="1">
+ <Text variant="labels">Active padding sides (left + right)</Text>
+ <Box css={{ width: theme.sizes.sidebarWidth }}>
+ <SpaceLayout
+ onHover={() => {}}
+ activeProperties={["padding-left", "padding-right"]}
+ renderCell={() => (
+ <ValueText
+ source="local"
+ value={{ type: "unit", value: 20, unit: "px" }}
+ />
+ )}
+ />
+ </Box>
+ </Flex>
+ <Flex direction="column" gap="1">
+ <Text variant="labels">All properties active</Text>
+ <Box css={{ width: theme.sizes.sidebarWidth }}>
+ <SpaceLayout
+ onHover={() => {}}
+ activeProperties={[
+ "margin-top",
+ "margin-right",
+ "margin-bottom",
+ "margin-left",
+ "padding-top",
+ "padding-right",
+ "padding-bottom",
+ "padding-left",
+ ]}
+ renderCell={() => (
+ <ValueText
+ source="local"
+ value={{ type: "unit", value: 8, unit: "px" }}
+ />
+ )}
+ />
+ </Box>
+ </Flex>
+ </Flex>
+);
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.tsx
index 09870606de..3472aba96d 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
@@ -8,6 +8,6 @@ export const TextShadows = () => (
);
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.tsx
index dae89ee54c..f4c1adc6c6 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
@@ -8,6 +8,6 @@ export const Transforms = () => (
);
export default {
- title: "Style Panel/Transforms",
+ title: "Style panel/Transforms",
component: Section,
};
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.tsx
index c685f07e9b..f7cbefb7dc 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
@@ -65,6 +65,6 @@ export const Transitions = () => (
);
export default {
- title: "Style Panel/Transitions",
+ title: "Style panel/Transitions",
component: Transitions,
};
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.tsx
index 658eb4e863..bc906830f3 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
@@ -8,6 +8,6 @@ export const Typography = () => (
);
export default {
- title: "Style Panel/Typography",
+ title: "Style panel/Typography",
component: Section,
};
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.tsx
index 18155250de..44c5f6fdd7 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
@@ -1,12 +1,21 @@
import * as React from "react";
-import { Flex, InputField, Text, theme } from "@webstudio-is/design-system";
+import {
+ Flex,
+ InputField,
+ SmallIconButton,
+ Text,
+ theme,
+} from "@webstudio-is/design-system";
import type { StyleValue, CssProperty } from "@webstudio-is/css-engine";
-import { CssValueInput, type IntermediateStyleValue } from "./css-value-input";
+import type { StyleValueSourceColor } from "~/shared/style-object-model";
+import { CssValueInput, 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",
+ title: "Style panel/CSS value input",
component: CssValueInput,
};
@@ -17,6 +26,14 @@ const CssValueInputVariant = ({
options,
containerWidth,
showOutput,
+ styleSource = "preset",
+ disabled,
+ icon,
+ showSuffix,
+ unitOptions,
+ placeholder,
+ minWidth,
+ prefix,
}: {
label: string;
initialValue: StyleValue;
@@ -24,15 +41,23 @@ const CssValueInputVariant = ({
options?: Array<{ type: "keyword"; value: string }>;
containerWidth?: number;
showOutput?: boolean;
+ styleSource?: StyleValueSourceColor;
+ disabled?: boolean;
+ icon?: React.ReactNode;
+ showSuffix?: boolean;
+ unitOptions?: UnitOption[];
+ placeholder?: string;
+ minWidth?: string;
+ prefix?: React.ReactNode;
}) => {
const [value, setValue] = React.useState<StyleValue>(initialValue);
const [intermediateValue, setIntermediateValue] = React.useState<
- StyleValue | IntermediateStyleValue
+ CssValueInputValue | undefined
>();
const input = (
<CssValueInput
- styleSource="preset"
+ styleSource={styleSource}
property={property}
value={value}
intermediateValue={intermediateValue}
@@ -46,6 +71,13 @@ const CssValueInputVariant = ({
}}
onAbort={() => action("onAbort")()}
onReset={() => action("onReset")()}
+ disabled={disabled}
+ icon={icon}
+ showSuffix={showSuffix}
+ unitOptions={unitOptions}
+ placeholder={placeholder}
+ minWidth={minWidth}
+ prefix={prefix}
/>
);
@@ -75,18 +107,20 @@ const CssValueInputVariant = ({
);
};
+const keywordOptions = [
+ { type: "keyword" as const, value: "auto" },
+ { type: "keyword" as const, value: "min-content" },
+ { type: "keyword" as const, value: "max-content" },
+ { type: "keyword" as const, value: "fit-content" },
+];
+
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={[
- { type: "keyword", value: "auto" },
- { type: "keyword", value: "min-content" },
- { type: "keyword", value: "max-content" },
- { type: "keyword", value: "fit-content" },
- ]}
+ options={keywordOptions}
/>
<CssValueInputVariant
label="Icons (align-items)"
@@ -106,12 +140,7 @@ export const CSSValueInput = () => (
label="Units (row-gap)"
initialValue={{ type: "unit", value: 100, unit: "px" }}
property="row-gap"
- options={[
- { type: "keyword", value: "auto" },
- { type: "keyword", value: "min-content" },
- { type: "keyword", value: "max-content" },
- { type: "keyword", value: "fit-content" },
- ]}
+ options={keywordOptions}
showOutput
/>
<CssValueInputVariant
@@ -125,3 +154,211 @@ export const CSSValueInput = () => (
/>
</Flex>
);
+
+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>
+);
+
+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>
+);
+
+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>
+);
+
+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>
+);
+
+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>
+);
+
+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>
+);
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.tsx
index 608eecc491..5aa54172f1 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
@@ -2,7 +2,7 @@ import { Box, 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,
};
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.tsx
index 3ac708a09c..0b6fef89f6 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
@@ -3,7 +3,7 @@ import { Box, Flex, 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,
};
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.tsx
index dca641f248..ac0a733cfc 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
@@ -8,7 +8,7 @@ import {
} from ".";
export default {
- title: "Style Panel/Style Source Input",
+ title: "Style panel/Style source input",
component: StyleSourceInputComponent,
};
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.tsx
index 8219a60a68..0cc06230b0 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
@@ -2,7 +2,7 @@ import { Box, Flex, Grid } from "@webstudio-is/design-system";
import { Outline as OutlineComponent } from "./outline";
export default {
- title: "Canvas Tools/Outline",
+ title: "Canvas tools/Outline",
component: OutlineComponent,
};
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.tsx
index 6efecbcf46..c6f582cdae 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
@@ -36,7 +36,7 @@ const createMockAssets = (): Asset[] => {
};
export default {
- title: "Asset Manager",
+ title: "Asset manager",
component: AssetManagerComponent,
} satisfies Meta;
diff --git a/apps/builder/app/builder/shared/collapsible-section.stories.tsx b/apps/builder/app/builder/shared/collapsible-section.stories.tsx
index accedbe734..aa8c202bf8 100644
--- a/apps/builder/app/builder/shared/collapsible-section.stories.tsx
+++ b/apps/builder/app/builder/shared/collapsible-section.stories.tsx
@@ -7,50 +7,56 @@ import {
} from "./collapsible-section";
export default {
- title: "Builder/Shared/Collapsible Section",
+ title: "Builder/Shared/Collapsible section",
component: CollapsibleSection,
};
-export const Demo = () => (
- <Flex direction="column" css={{ width: 240 }}>
- <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>
+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>
- <CollapsibleSectionWithAddButton
- label="With add button"
- onAdd={() => {}}
- hasItems
- >
- <Text>Section with an add button in the title.</Text>
- </CollapsibleSectionWithAddButton>
+ <CollapsibleSection label="Default section">
+ <Text>This section uses persisted open/close state.</Text>
+ </CollapsibleSection>
- <CollapsibleSectionWithAddButton
- label="Empty (no items)"
- onAdd={() => {}}
- hasItems={false}
- >
- <Text>This won't appear because hasItems is false.</Text>
- </CollapsibleSectionWithAddButton>
- </Flex>
-);
+ <CollapsibleSectionWithAddButton
+ label="With add button"
+ onAdd={() => {}}
+ hasItems
+ >
+ <Text>Section with an add button in the title.</Text>
+ </CollapsibleSectionWithAddButton>
-export const Accordion = () => (
- <CollapsibleProvider accordion initialOpen="First">
- <Flex direction="column" css={{ width: 240 }}>
- <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>
+ <CollapsibleSectionWithAddButton
+ label="Empty (no items)"
+ onAdd={() => {}}
+ hasItems={false}
+ >
+ <Text>This won&apos;t appear because hasItems is false.</Text>
+ </CollapsibleSectionWithAddButton>
</Flex>
- </CollapsibleProvider>
+
+ <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>
);
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.tsx
index 9c4c63386a..5667874be7 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
@@ -35,6 +35,6 @@ export const CSSEditor = () => {
};
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.tsx
index 4acec43dbe..e431ec1cdf 100644
--- a/apps/builder/app/builder/shared/expression-editor.stories.tsx
+++ b/apps/builder/app/builder/shared/expression-editor.stories.tsx
@@ -3,7 +3,7 @@ import { ExpressionEditor as ExpressionEditorComponent } from "./expression-edit
import { useState } from "react";
export default {
- title: "Expression Editor",
+ title: "Expression editor",
component: ExpressionEditorComponent,
} satisfies Meta;
diff --git a/apps/builder/app/builder/shared/relative-time.stories.tsx b/apps/builder/app/builder/shared/relative-time.stories.tsx
index d90b4095c1..ec6b7eafcc 100644
--- a/apps/builder/app/builder/shared/relative-time.stories.tsx
+++ b/apps/builder/app/builder/shared/relative-time.stories.tsx
@@ -2,7 +2,7 @@ import { Flex, 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,
};
diff --git a/apps/builder/app/builder/shared/topbar-layout.stories.tsx b/apps/builder/app/builder/shared/topbar-layout.stories.tsx
index 8ae02f4c50..d9ea6fc6d9 100644
--- a/apps/builder/app/builder/shared/topbar-layout.stories.tsx
+++ b/apps/builder/app/builder/shared/topbar-layout.stories.tsx
@@ -21,7 +21,7 @@ import { ViewMode } from "~/builder/features/view-mode";
import { TopbarLayout } from "./topbar-layout";
export default {
- title: "Topbar Layout",
+ title: "Topbar layout",
component: TopbarLayout,
};
@@ -73,78 +73,75 @@ const SafeModeIndicator = () => (
</ToolbarButton>
);
-export const Demo = () => (
- <Flex direction="column" gap="5">
- <TopbarLayout
- menu={<MenuPlaceholder />}
- left={<PagePlaceholder />}
- center={<BreakpointsPlaceholder />}
- right={
- <>
- <Button color="gradient">Share</Button>
- <Button color="positive">Publish</Button>
- </>
- }
- />
- <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>
- </>
- }
- />
- <TopbarLayout menu={<MenuPlaceholder />} />
- </Flex>
-);
-
-export const WithSyncStatusFailed = () => {
+export const TopbarLayouts = () => {
$queueStatus.set({ status: "failed" });
- return (
- <TopbarLayout
- menu={<MenuPlaceholder />}
- left={<PagePlaceholder />}
- center={<BreakpointsPlaceholder />}
- right={
- <>
- <SyncStatus />
- <Button color="gradient">Share</Button>
- <Button color="positive">Publish</Button>
- </>
- }
- />
- );
-};
-
-export const WithViewModeActive = () => {
$authPermit.set("view");
return (
- <TopbarLayout
- menu={<MenuPlaceholder />}
- left={<PagePlaceholder />}
- center={<BreakpointsPlaceholder />}
- right={
- <>
- <ViewMode />
- <Button color="gradient">Share</Button>
- <Button color="positive">Publish</Button>
- </>
- }
- />
+ <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>
);
};
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.tsx
index 6da376e8ec..7688ea5aea 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
@@ -20,7 +20,7 @@ import { $awareness } from "~/shared/awareness";
export default {
component: TextEditor,
- title: "Canvas/Text Editor",
+ title: "Canvas/Text editor",
} satisfies Meta<typeof TextEditor>;
const createInstancePair = (
diff --git a/apps/builder/app/dashboard/dashboard.stories.tsx b/apps/builder/app/dashboard/dashboard.stories.tsx
index 72450462bd..4f162e15cd 100644
--- a/apps/builder/app/dashboard/dashboard.stories.tsx
+++ b/apps/builder/app/dashboard/dashboard.stories.tsx
@@ -1,11 +1,15 @@
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 { Dashboard, DashboardSetup } from "./dashboard";
+import { Card as CardComponent, CardContent, CardFooter } from "./shared/card";
+import { ThumbnailWithAbbr, ThumbnailLinkWithAbbr } from "./shared/thumbnail";
import type { UserPlanFeatures } from "~/shared/db/user-plan-features.server";
import type { DashboardProject } from "@webstudio-is/dashboard";
export default {
+ title: "Dashboard",
component: Dashboard,
};
@@ -120,3 +124,48 @@ export const SearchNothingFound: StoryFn<typeof Dashboard> = () => {
);
return <RouterProvider router={router} />;
};
+
+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] }}>
+ <CardComponent>
+ <CardContent
+ css={{ background: theme.colors.brandBackgroundProjectCardFront }}
+ />
+ <CardFooter>
+ <Text truncate>{title}</Text>
+ </CardFooter>
+ </CardComponent>
+ </Box>
+ ))}
+ </Flex>
+);
+
+export const Thumbnails = () => (
+ <Flex gap="3">
+ <ThumbnailWithAbbr title="My Next Project" onClick={() => {}} />
+ <ThumbnailLinkWithAbbr title="Landing Page" to="#" />
+ <ThumbnailWithAbbr title="Portfolio" onClick={() => {}} />
+ </Flex>
+);
diff --git a/apps/builder/app/dashboard/shared/card.stories.tsx b/apps/builder/app/dashboard/shared/card.stories.tsx
deleted file mode 100644
index 9e98aa4e52..0000000000
--- a/apps/builder/app/dashboard/shared/card.stories.tsx
+++ /dev/null
@@ -1,44 +0,0 @@
-import { Box, Flex, Text, theme } from "@webstudio-is/design-system";
-import { Card as CardComponent, CardContent, CardFooter } from "./card";
-
-export default {
- title: "Dashboard/Card",
- component: CardComponent,
-};
-
-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] }}>
- <CardComponent>
- <CardContent
- css={{ background: theme.colors.brandBackgroundProjectCardFront }}
- />
- <CardFooter>
- <Text truncate>{title}</Text>
- </CardFooter>
- </CardComponent>
- </Box>
- ))}
- </Flex>
-);
diff --git a/apps/builder/app/dashboard/shared/thumbnail.stories.tsx b/apps/builder/app/dashboard/shared/thumbnail.stories.tsx
deleted file mode 100644
index 8dfaf211ea..0000000000
--- a/apps/builder/app/dashboard/shared/thumbnail.stories.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { Flex } from "@webstudio-is/design-system";
-import { ThumbnailWithAbbr, ThumbnailLinkWithAbbr } from "./thumbnail";
-
-export default {
- title: "Dashboard/Thumbnail",
-};
-
-export const Thumbnail = () => (
- <Flex gap="3">
- <ThumbnailWithAbbr title="My Next Project" onClick={() => {}} />
- <ThumbnailLinkWithAbbr title="Landing Page" to="#" />
- <ThumbnailWithAbbr title="Portfolio" onClick={() => {}} />
- </Flex>
-);
diff --git a/apps/builder/app/shared/code-editor.stories.tsx b/apps/builder/app/shared/code-editor.stories.tsx
index f8dd1ad117..807223d13d 100644
--- a/apps/builder/app/shared/code-editor.stories.tsx
+++ b/apps/builder/app/shared/code-editor.stories.tsx
@@ -3,7 +3,7 @@ import type { Meta } from "@storybook/react";
import { CodeEditor as CodeEditorComponent } from "./code-editor";
export default {
- title: "Code Editor",
+ title: "Code editor",
component: CodeEditorComponent,
} satisfies Meta;
diff --git a/apps/builder/app/shared/copy-to-clipboard.stories.tsx b/apps/builder/app/shared/copy-to-clipboard.stories.tsx
index 60a59b0602..35049fc2a8 100644
--- a/apps/builder/app/shared/copy-to-clipboard.stories.tsx
+++ b/apps/builder/app/shared/copy-to-clipboard.stories.tsx
@@ -2,7 +2,7 @@ import { Button, Flex } 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,
};
diff --git a/apps/builder/app/shared/dom-utils.stories.tsx b/apps/builder/app/shared/dom-utils.stories.tsx
index 3dccdb9db3..390f48b729 100644
--- a/apps/builder/app/shared/dom-utils.stories.tsx
+++ b/apps/builder/app/shared/dom-utils.stories.tsx
@@ -1,7 +1,7 @@
import { scrollIntoView } from "./dom-utils";
export default {
- title: "DOM Utils/Scroll Into View",
+ title: "DOM utils/Scroll into view",
};
const handleClick = (selector: string) => {
diff --git a/apps/builder/app/shared/error/error-message.stories.tsx b/apps/builder/app/shared/error/error-message.stories.tsx
index 0193e85f5c..cc7ea44aa1 100644
--- a/apps/builder/app/shared/error/error-message.stories.tsx
+++ b/apps/builder/app/shared/error/error-message.stories.tsx
@@ -2,7 +2,7 @@ import { Flex } from "@webstudio-is/design-system";
import { ErrorMessage as ErrorMessageComponent } from "./error-message.client";
export default {
- title: "Error Message",
+ title: "Error message",
component: ErrorMessageComponent,
};
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.tsx
index 285f9ad16a..fe594f6778 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,7 +1,7 @@
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,
};
diff --git a/apps/builder/app/shared/share-project/share-project.stories.tsx b/apps/builder/app/shared/share-project/share-project.stories.tsx
index 3177318e5a..9841be303a 100644
--- a/apps/builder/app/shared/share-project/share-project.stories.tsx
+++ b/apps/builder/app/shared/share-project/share-project.stories.tsx
@@ -13,7 +13,7 @@ import {
} from "./share-project";
export default {
- title: "Share Project",
+ title: "Share project",
component: ShareProjectComponent,
};
diff --git a/packages/css-engine/src/core/css-engine.stories.tsx b/packages/css-engine/src/core/css-engine.stories.tsx
index b1ad80a1e8..dd3e30fc68 100644
--- a/packages/css-engine/src/core/css-engine.stories.tsx
+++ b/packages/css-engine/src/core/css-engine.stories.tsx
@@ -1,7 +1,7 @@
import { createRegularStyleSheet } from "./create-style-sheet";
export default {
- title: "CSS Engine",
+ title: "CSS engine",
component: "CssEngine",
};
diff --git a/packages/design-system/src/components/__DEPRECATED__/list.stories.tsx b/packages/design-system/src/components/__DEPRECATED__/list.stories.tsx
index 94d72f2ccb..b8dada4f52 100644
--- a/packages/design-system/src/components/__DEPRECATED__/list.stories.tsx
+++ b/packages/design-system/src/components/__DEPRECATED__/list.stories.tsx
@@ -57,3 +57,27 @@ export const WithHook: StoryFn<typeof DeprecatedList> = () => {
</DeprecatedList>
);
};
+
+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>
+);
+
+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>
+);
diff --git a/packages/design-system/src/components/avatar.stories.tsx b/packages/design-system/src/components/avatar.stories.tsx
index 70a2e1a391..cd88023e78 100644
--- a/packages/design-system/src/components/avatar.stories.tsx
+++ b/packages/design-system/src/components/avatar.stories.tsx
@@ -22,3 +22,22 @@ export const Avatar = () => (
<AvatarComponent fallback="WS" />
</Flex>
);
+
+export const AvatarFallbackVariants = () => (
+ <Flex gap="3" align="center">
+ <AvatarComponent fallback="A" />
+ <AvatarComponent fallback="JD" />
+ <AvatarComponent fallback="WEB" />
+ </Flex>
+);
+
+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>
+);
diff --git a/packages/design-system/src/components/button.stories.tsx b/packages/design-system/src/components/button.stories.tsx
index bfc5711653..e878f99c4c 100644
--- a/packages/design-system/src/components/button.stories.tsx
+++ b/packages/design-system/src/components/button.stories.tsx
@@ -140,3 +140,25 @@ Button.args = {
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>
+);
+
+export const ButtonIconOnly = () => (
+ <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.tsx
index b8992b8872..5197fb1411 100644
--- a/packages/design-system/src/components/card.stories.tsx
+++ b/packages/design-system/src/components/card.stories.tsx
@@ -17,3 +17,17 @@ export const Card = () => (
</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>
+);
diff --git a/packages/design-system/src/components/checkbox.stories.tsx b/packages/design-system/src/components/checkbox.stories.tsx
index 9bcca4bada..35c341e0a2 100644
--- a/packages/design-system/src/components/checkbox.stories.tsx
+++ b/packages/design-system/src/components/checkbox.stories.tsx
@@ -1,3 +1,4 @@
+import { useState } from "react";
import { Label } from "./label";
import { Checkbox as CheckboxComponent, CheckboxAndLabel } from "./checkbox";
import { StorySection, StoryGrid } from "./storybook";
@@ -59,3 +60,21 @@ export const Checkbox = () => {
);
};
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>
+ );
+};
diff --git a/packages/design-system/src/components/color-picker.stories.tsx b/packages/design-system/src/components/color-picker.stories.tsx
index 6b2582d3c7..9593c387fc 100644
--- a/packages/design-system/src/components/color-picker.stories.tsx
+++ b/packages/design-system/src/components/color-picker.stories.tsx
@@ -3,12 +3,13 @@ import type { RgbValue, StyleValue } from "@webstudio-is/css-engine";
import {
ColorPicker as ColorPickerComponent,
ColorPickerPopover,
+ ColorThumb,
} from "./color-picker";
import { Flex } from "./flex";
import { Text } from "./text";
export default {
- title: "Color Picker",
+ title: "Color picker",
};
const initialColor: RgbValue = {
@@ -54,3 +55,62 @@ export const ColorPicker = () => {
</Flex>
);
};
+
+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) => {
+ if (val !== undefined) {
+ setValue(val);
+ }
+ };
+ return (
+ <Flex gap="9" align="center" wrap="wrap" style={{ padding: 100 }}>
+ <Flex direction="column" gap="2" align="center">
+ <Text variant="labels">Side top</Text>
+ <ColorPickerPopover
+ value={value}
+ onChange={handleChange}
+ onChangeComplete={setValue}
+ side="top"
+ />
+ </Flex>
+ <Flex direction="column" gap="2" align="center">
+ <Text variant="labels">Side right</Text>
+ <ColorPickerPopover
+ value={value}
+ onChange={handleChange}
+ onChangeComplete={setValue}
+ side="right"
+ />
+ </Flex>
+ <Flex direction="column" gap="2" align="center">
+ <Text variant="labels">Align start</Text>
+ <ColorPickerPopover
+ value={value}
+ onChange={handleChange}
+ onChangeComplete={setValue}
+ side="bottom"
+ align="start"
+ />
+ </Flex>
+ <Flex direction="column" gap="2" align="center">
+ <Text variant="labels">Side offset 16</Text>
+ <ColorPickerPopover
+ value={value}
+ onChange={handleChange}
+ onChangeComplete={setValue}
+ sideOffset={16}
+ />
+ </Flex>
+ </Flex>
+ );
+};
diff --git a/packages/design-system/src/components/combobox.stories.tsx b/packages/design-system/src/components/combobox.stories.tsx
index 10e78ea52b..3a3b4a3e0f 100644
--- a/packages/design-system/src/components/combobox.stories.tsx
+++ b/packages/design-system/src/components/combobox.stories.tsx
@@ -106,6 +106,71 @@ export const Complex = () => {
);
};
+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…"
+ />
+ );
+};
+
+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"
+ />
+ );
+};
+
+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"
+ />
+ );
+};
+
+const fruitDescriptions: Record<string, string> = {
+ Apple: "A red or green fruit",
+ Banana: "A yellow tropical fruit",
+ Orange: "A citrus fruit",
+} as const;
+
+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…"
+ />
+ );
+};
+
export default {
title: "Combobox",
component: Complex,
diff --git a/packages/design-system/src/components/command.stories.tsx b/packages/design-system/src/components/command.stories.tsx
index 87bb221212..b9314f94a6 100644
--- a/packages/design-system/src/components/command.stories.tsx
+++ b/packages/design-system/src/components/command.stories.tsx
@@ -1,6 +1,9 @@
+import { useState } from "react";
import type { Meta, StoryFn } from "@storybook/react";
import {
Command as CommandComponent,
+ CommandDialog,
+ CommandBackButton,
CommandFooter,
CommandGroup,
CommandGroupHeading,
@@ -106,3 +109,55 @@ export const Command: StoryFn = () => {
</CommandComponent>
);
};
+
+export const InDialog: StoryFn = () => {
+ const [open, setOpen] = useState(true);
+ return (
+ <CommandDialog open={open} onOpenChange={setOpen}>
+ <CommandComponent>
+ <CommandContent />
+ </CommandComponent>
+ </CommandDialog>
+ );
+};
+
+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>
+ );
+};
diff --git a/packages/design-system/src/components/component-card.stories.tsx b/packages/design-system/src/components/component-card.stories.tsx
index cc9ee6c8c9..8de4b888e7 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.tsx
index 2efc3e20f2..5754800838 100644
--- a/packages/design-system/src/components/context-menu.stories.tsx
+++ b/packages/design-system/src/components/context-menu.stories.tsx
@@ -8,6 +8,10 @@ import {
DropdownMenuCheckboxItem,
DropdownMenuRadioGroup,
DropdownMenuRadioItem,
+ DropdownMenuSub,
+ DropdownMenuSubTrigger,
+ DropdownMenuSubContent,
+ DropdownMenuArrow,
} from "./dropdown-menu";
import {
CopyIcon,
@@ -18,7 +22,7 @@ import {
import { IconButton } from "./icon-button";
export default {
- title: "Components/Context Menu",
+ title: "Components/Context menu",
};
export const ContextMenu = () => (
@@ -45,3 +49,59 @@ export const ContextMenu = () => (
</DropdownMenuContent>
</DropdownMenu>
);
+
+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>
+);
+
+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>
+);
+
+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>
+);
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.tsx
index f1a94c8ca2..74651dac68 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
@@ -23,7 +23,7 @@ export default {
type: "inline-radio",
},
},
- title: "CSS Value List Item",
+ title: "CSS value list item",
};
const Thumbnail = styled("div", {
@@ -237,3 +237,86 @@ export const CSSValueListItem = (props: {
</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>
+);
+
+export const WithDragItemId = () => (
+ <Panel>
+ <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.tsx
index 8541589935..cf5c2e4f5c 100644
--- a/packages/design-system/src/components/dialog.stories.tsx
+++ b/packages/design-system/src/components/dialog.stories.tsx
@@ -3,15 +3,18 @@ import { css, theme } from "../stitches.config";
import { textVariants } from "./text";
import {
Dialog,
+ DialogActions,
DialogClose,
DialogContent,
DialogDescription,
+ DialogMaximize,
DialogTitle,
+ DialogTitleActions,
DialogTrigger,
} from "./dialog";
export default {
- title: "Floating Panel/Dialog",
+ title: "Floating panel/Dialog",
};
const bodyStyle = css({
@@ -57,3 +60,90 @@ const DialogDemo = () => (
</Dialog>
);
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>
+);
+
+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>
+);
+
+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>
+);
+
+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>
+);
diff --git a/packages/design-system/src/components/dropdown-menu.stories.tsx b/packages/design-system/src/components/dropdown-menu.stories.tsx
index 78afadb73b..91bff21b68 100644
--- a/packages/design-system/src/components/dropdown-menu.stories.tsx
+++ b/packages/design-system/src/components/dropdown-menu.stories.tsx
@@ -1,4 +1,5 @@
import { useState } from "react";
+import { CopyIcon, TrashIcon } from "@webstudio-is/icons";
import { Flex } from "./flex";
import { Button } from "./button";
import {
@@ -8,10 +9,17 @@ import {
DropdownMenuItem,
DropdownMenuSeparator,
DropdownMenuCheckboxItem,
+ DropdownMenuLabel,
+ DropdownMenuRadioGroup,
+ DropdownMenuRadioItem,
+ DropdownMenuSub,
+ DropdownMenuSubTrigger,
+ DropdownMenuSubContent,
+ DropdownMenuArrow,
} from "./dropdown-menu";
export default {
- title: "Dropdown Menu",
+ title: "Dropdown menu",
};
export const DropdownMenu = () => {
@@ -51,3 +59,59 @@ export const DropdownMenu = () => {
</Flex>
);
};
+
+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>
+);
+
+export const WithRadioGroup = () => {
+ const [value, setValue] = useState("one");
+ return (
+ <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>
+ );
+};
+
+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>
+);
diff --git a/packages/design-system/src/components/enhanced-tooltip.stories.tsx b/packages/design-system/src/components/enhanced-tooltip.stories.tsx
index c9b1f486d0..707d430d03 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,
};
@@ -70,3 +70,29 @@ export const EnhancedTooltip = () => (
</StorySection>
</EnhancedTooltipProvider>
);
+
+export const WithAlignment = () => (
+ <EnhancedTooltipProvider>
+ <StorySection title="Alignment options">
+ <Flex gap="6" css={{ padding: 60 }}>
+ <EnhancedTooltipComponent
+ content="Aligned start"
+ align="start"
+ defaultOpen
+ >
+ <Button>Start</Button>
+ </EnhancedTooltipComponent>
+ <EnhancedTooltipComponent
+ content="Aligned center"
+ align="center"
+ defaultOpen
+ >
+ <Button>Center</Button>
+ </EnhancedTooltipComponent>
+ <EnhancedTooltipComponent content="Aligned end" align="end" defaultOpen>
+ <Button>End</Button>
+ </EnhancedTooltipComponent>
+ </Flex>
+ </StorySection>
+ </EnhancedTooltipProvider>
+);
diff --git a/packages/design-system/src/components/floating-panel.stories.tsx b/packages/design-system/src/components/floating-panel.stories.tsx
index 8a87c9ba2e..d7ed219cb9 100644
--- a/packages/design-system/src/components/floating-panel.stories.tsx
+++ b/packages/design-system/src/components/floating-panel.stories.tsx
@@ -4,9 +4,10 @@ import { Box } from "./box";
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,
};
@@ -85,3 +86,29 @@ export const FloatingPanel = () => (
</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>
+);
diff --git a/packages/design-system/src/components/gradient-picker.stories.tsx b/packages/design-system/src/components/gradient-picker.stories.tsx
index fbed372de4..4f215d1832 100644
--- a/packages/design-system/src/components/gradient-picker.stories.tsx
+++ b/packages/design-system/src/components/gradient-picker.stories.tsx
@@ -9,7 +9,7 @@ import { Flex } from "./flex";
import { Text } from "./text";
export default {
- title: "Gradient Picker",
+ title: "Gradient picker",
};
const parseLinearGradientOrThrow = (
@@ -63,3 +63,25 @@ export const GradientPicker = () => (
/>
</Flex>
);
+
+export const GradientPickerWithSelectedStop = () => {
+ 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>
+ );
+};
diff --git a/packages/design-system/src/components/icon-button.stories.tsx b/packages/design-system/src/components/icon-button.stories.tsx
index c7b6957906..93df5acab0 100644
--- a/packages/design-system/src/components/icon-button.stories.tsx
+++ b/packages/design-system/src/components/icon-button.stories.tsx
@@ -4,7 +4,7 @@ import { Flex } from "./flex";
import { IconButton as IconButtonComponent } from "./icon-button";
export default {
- title: "Icon Button",
+ title: "Icon button",
component: IconButtonComponent,
};
@@ -82,3 +82,23 @@ export const IconButton: StoryFn<typeof IconButtonComponent> = () => {
</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>
+);
diff --git a/packages/design-system/src/components/input-field.stories.tsx b/packages/design-system/src/components/input-field.stories.tsx
index 79115c35f0..c4051a501b 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 = (
@@ -96,3 +96,53 @@ export const InputField = () => (
);
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>
+);
+
+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>
+);
+
+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>
+);
+
+export const FieldSizingContent = () => (
+ <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.tsx
index 204c300057..5c7ac8cd89 100644
--- a/packages/design-system/src/components/label.stories.tsx
+++ b/packages/design-system/src/components/label.stories.tsx
@@ -2,6 +2,7 @@ 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";
@@ -106,3 +107,43 @@ LabelStory.args = {
color: "default",
disabled: false,
};
+
+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>
+);
+
+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>
+);
+
+export const InactiveColor = () => (
+ <StorySection title="Inactive color">
+ <Label color="inactive">Inactive label</Label>
+ </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>
+);
diff --git a/packages/design-system/src/components/link.stories.tsx b/packages/design-system/src/components/link.stories.tsx
index 3b53423049..42b3616d9e 100644
--- a/packages/design-system/src/components/link.stories.tsx
+++ b/packages/design-system/src/components/link.stories.tsx
@@ -79,3 +79,29 @@ const LinkStory = () => (
);
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.tsx
index bb1b44a136..fdd39784e1 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 visible
backgrounds: { default: "Maintenance Medium" },
@@ -67,3 +67,57 @@ export const ListPositionIndicator = () => (
);
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>
+);
+
+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>
+);
diff --git a/packages/design-system/src/components/menu.stories.tsx b/packages/design-system/src/components/menu.stories.tsx
index cdc67df0c7..b5005d5ad4 100644
--- a/packages/design-system/src/components/menu.stories.tsx
+++ b/packages/design-system/src/components/menu.stories.tsx
@@ -33,7 +33,13 @@ import {
SelectSeparator,
SelectGroup,
} from "./select";
-import { MenuCheckedAndSetIcon, MenuCheckedIcon, MenuSetDotIcon } from "./menu";
+import {
+ MenuCheckedAndSetIcon,
+ MenuCheckedIcon,
+ MenuSetDotIcon,
+ MenuList,
+ MenuItemButton,
+} from "./menu";
import { Button } from "./button";
import {
ChevronDownIcon,
@@ -290,6 +296,17 @@ export const MenuMenuItem = () => (
MenuMenuItem.storyName = "Menu, Menu Item";
+export const StandaloneMenuItems = () => (
+ <StorySection title="Standalone menu list">
+ <MenuList width="regular">
+ <MenuItemButton>Create new</MenuItemButton>
+ <MenuItemButton destructive>Delete item</MenuItemButton>
+ <MenuItemButton disabled>Disabled item</MenuItemButton>
+ <MenuItemButton hint>Hint item</MenuItemButton>
+ </MenuList>
+ </StorySection>
+);
+
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.tsx
index 56cb101d54..bf706bcc10 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 = () => {
diff --git a/packages/design-system/src/components/nested-input-button.stories.tsx b/packages/design-system/src/components/nested-input-button.stories.tsx
index 0995863a73..e4f2adc408 100644
--- a/packages/design-system/src/components/nested-input-button.stories.tsx
+++ b/packages/design-system/src/components/nested-input-button.stories.tsx
@@ -1,9 +1,12 @@
import { CopyIcon } from "@webstudio-is/icons";
-import { NestedInputButton } from "./nested-input-button";
+import {
+ NestedInputButton,
+ nestedSelectButtonUnitless,
+} from "./nested-input-button";
import { StoryGrid, StorySection } from "./storybook";
export default {
- title: "Nested Select Button",
+ title: "Nested select button",
};
export const NestedSelectButton = () => {
@@ -46,3 +49,20 @@ export const NestedSelectButton = () => {
};
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.tsx
index 5631881340..da7f746cb2 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 = () => {
@@ -89,3 +89,23 @@ export const PanelBanner = () => {
};
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.tsx
index bd6dd95cc3..417edbfc40 100644
--- a/packages/design-system/src/components/panel-tabs.stories.tsx
+++ b/packages/design-system/src/components/panel-tabs.stories.tsx
@@ -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 }) => (
@@ -46,3 +46,65 @@ export const PanelTabs = () => (
</StoryGrid>
);
PanelTabs.storyName = "Panel Tabs";
+
+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>
+);
+
+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>
+);
+
+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>
+);
diff --git a/packages/design-system/src/components/panel-title.stories.tsx b/packages/design-system/src/components/panel-title.stories.tsx
index fe845f64cc..8c98901560 100644
--- a/packages/design-system/src/components/panel-title.stories.tsx
+++ b/packages/design-system/src/components/panel-title.stories.tsx
@@ -5,9 +5,11 @@ import {
import { Button } from "./button";
import { XIcon, CopyIcon } from "@webstudio-is/icons";
import { StoryGrid } from "./storybook";
+import { Flex } from "./flex";
+import { Text } from "./text";
export default {
- title: "Panel Title",
+ title: "Panel title",
};
export const PanelTitle = () => (
@@ -44,3 +46,24 @@ export const PanelTitle = () => (
</StoryGrid>
);
PanelTitle.storyName = "Panel Title";
+
+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>
+);
+
+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>
+);
diff --git a/packages/design-system/src/components/popover.stories.tsx b/packages/design-system/src/components/popover.stories.tsx
index 95df9733d2..60af1663dd 100644
--- a/packages/design-system/src/components/popover.stories.tsx
+++ b/packages/design-system/src/components/popover.stories.tsx
@@ -4,6 +4,8 @@ import {
Popover,
PopoverClose,
PopoverContent,
+ PopoverTitle,
+ PopoverTitleActions,
PopoverTrigger,
PopoverSeparator,
} from "./popover";
@@ -34,3 +36,74 @@ const PopoverDemo = () => (
</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 }}>
+ <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>
+);
diff --git a/packages/design-system/src/components/position-grid.stories.tsx b/packages/design-system/src/components/position-grid.stories.tsx
index 4675285c8f..c52e8579f8 100644
--- a/packages/design-system/src/components/position-grid.stories.tsx
+++ b/packages/design-system/src/components/position-grid.stories.tsx
@@ -4,7 +4,7 @@ import { Flex } from "./flex";
import { useState } from "react";
export default {
- title: "Position Grid",
+ title: "Position grid",
};
export const PositionGrid = () => {
@@ -47,3 +47,18 @@ export const PositionGrid = () => {
</Flex>
);
};
+
+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.tsx
index 55c1869419..f266c5fabf 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
@@ -69,6 +69,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/sortable-list.stories.tsx b/packages/design-system/src/components/primitives/dnd/sortable-list.stories.tsx
index e93227a8dd..2820bf5060 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
@@ -209,7 +209,7 @@ export const SortableList = ({
};
export default {
- title: "Primitives/DND/Sortable List",
+ title: "Primitives/DND/Sortable list",
component: SortableList,
args: {
direction: "vertical",
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.tsx
index 283d03d6de..b5bfeb57a4 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
@@ -58,7 +58,7 @@ export const NumericGestureControl = Object.assign(Input.bind({}), {
});
export default {
- title: "Primitives/Numeric Gesture Control",
+ title: "Primitives/Numeric gesture control",
component: Input,
argTypes: {
value: {
@@ -70,3 +70,52 @@ export default {
},
},
};
+
+export const VerticalControl = Object.assign(Input.bind({}), {
+ args: { value: 0, direction: "vertical", acceleration: 1 },
+});
+
+const ConstrainedInput = ({
+ value,
+ direction,
+ minValue,
+ maxValue,
+}: {
+ value: NumericScrubValue;
+ direction: NumericScrubDirection;
+ minValue: number;
+ maxValue: number;
+}) => {
+ const ref = useRef<HTMLInputElement | null>(null);
+ useEffect(() => {
+ if (ref.current === null) {
+ return;
+ }
+ ref.current.value = String(value);
+ return numericScrubControl(ref.current, {
+ getInitialValue: () => value,
+ direction,
+ minValue,
+ maxValue,
+ getAcceleration: () => 1,
+ onValueInput: (event) => {
+ (event.target as HTMLInputElement).value = String(event.value);
+ },
+ onValueChange: (event) => {
+ event.preventDefault();
+ (event.target as HTMLInputElement).value = String(event.value);
+ (event.target as HTMLInputElement).select();
+ },
+ });
+ }, [direction, value, minValue, maxValue, ref]);
+ return <input defaultValue={value} ref={ref} />;
+};
+
+export const ConstrainedControl = () => (
+ <ConstrainedInput
+ value={50}
+ direction="horizontal"
+ minValue={0}
+ maxValue={100}
+ />
+);
diff --git a/packages/design-system/src/components/primitives/small-button.stories.tsx b/packages/design-system/src/components/primitives/small-button.stories.tsx
index a0a5e31067..fc084f278d 100644
--- a/packages/design-system/src/components/primitives/small-button.stories.tsx
+++ b/packages/design-system/src/components/primitives/small-button.stories.tsx
@@ -8,7 +8,7 @@ import {
} from "./small-button";
export default {
- title: "Primitives/Small Button",
+ title: "Primitives/Small button",
component: SmallButtonComponent,
};
@@ -44,3 +44,47 @@ export const SmallButton = () => (
))}
</Grid>
);
+
+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>
+);
+
+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>
+);
diff --git a/packages/design-system/src/components/pro-badge.stories.tsx b/packages/design-system/src/components/pro-badge.stories.tsx
index 60a22a3e81..c911db26de 100644
--- a/packages/design-system/src/components/pro-badge.stories.tsx
+++ b/packages/design-system/src/components/pro-badge.stories.tsx
@@ -2,7 +2,7 @@ import { Flex } from "./flex";
import { ProBadge as ProBadgeComponent } from "./pro-badge";
export default {
- title: "ProBadge",
+ title: "Pro badge",
component: ProBadgeComponent,
};
@@ -13,3 +13,10 @@ export const ProBadge = () => (
<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>
+);
diff --git a/packages/design-system/src/components/progress.stories.tsx b/packages/design-system/src/components/progress.stories.tsx
index 9833204f38..91f02abdf3 100644
--- a/packages/design-system/src/components/progress.stories.tsx
+++ b/packages/design-system/src/components/progress.stories.tsx
@@ -27,3 +27,18 @@ export const Progress = () => {
</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>
+ );
+};
diff --git a/packages/design-system/src/components/radio.stories.tsx b/packages/design-system/src/components/radio.stories.tsx
index 70498aa5f1..06d2ec5f49 100644
--- a/packages/design-system/src/components/radio.stories.tsx
+++ b/packages/design-system/src/components/radio.stories.tsx
@@ -1,3 +1,4 @@
+import { useState } from "react";
import { Label } from "./label";
import { RadioGroup, Radio as RadioComponent, RadioAndLabel } from "./radio";
import { StorySection, StoryGrid } from "./storybook";
@@ -57,3 +58,26 @@ export const Radio = () => {
);
};
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>
+ );
+};
diff --git a/packages/design-system/src/components/scroll-area.stories.tsx b/packages/design-system/src/components/scroll-area.stories.tsx
index f6ee240530..ec0e302c0f 100644
--- a/packages/design-system/src/components/scroll-area.stories.tsx
+++ b/packages/design-system/src/components/scroll-area.stories.tsx
@@ -1,9 +1,11 @@
import { StorySection } from "./storybook";
import { ScrollArea as ScrollAreaComponent } from "./scroll-area";
+import { Text } from "./text";
import { theme } from "..";
+import { Flex } from "./flex";
export default {
- title: "Scroll Area",
+ title: "Scroll area",
};
export const ScrollArea = () => {
@@ -39,3 +41,16 @@ export const ScrollArea = () => {
</>
);
};
+
+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.tsx
index b3a76288e4..8b6e828a86 100644
--- a/packages/design-system/src/components/search-field.stories.tsx
+++ b/packages/design-system/src/components/search-field.stories.tsx
@@ -1,10 +1,11 @@
+import { useState } from "react";
import { Flex } from "./flex";
import { Text } from "./text";
import { SearchField as SearchFieldComponent } from "./search-field";
import { StorySection } from "./storybook";
export default {
- title: "Search Field",
+ title: "Search field",
component: SearchFieldComponent,
};
@@ -24,3 +25,38 @@ export const SearchField = () => (
</StorySection>
</>
);
+
+export const WithAbortCallback = () => {
+ 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>
+ );
+};
+
+export const WithErrorColor = () => (
+ <Flex direction="column" gap="3" style={{ width: 240 }}>
+ <Text variant="labels">Error color</Text>
+ <SearchFieldComponent color="error" placeholder="Error state" />
+ </Flex>
+);
+
+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>
+);
diff --git a/packages/design-system/src/components/section-title.stories.tsx b/packages/design-system/src/components/section-title.stories.tsx
index 8a37574651..8a81fec226 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 }) => (
@@ -116,3 +116,43 @@ export const SectionTitle = () => (
);
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>
+);
+
+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>
+);
diff --git a/packages/design-system/src/components/select-button.stories.tsx b/packages/design-system/src/components/select-button.stories.tsx
index 16492a3530..a9359522b8 100644
--- a/packages/design-system/src/components/select-button.stories.tsx
+++ b/packages/design-system/src/components/select-button.stories.tsx
@@ -1,10 +1,11 @@
+import { useState } from "react";
import { NestedIconLabel } from "./nested-icon-label";
import { SelectButton as SelectButtonComponent } from "./select-button";
import { GapVerticalIcon } from "@webstudio-is/icons";
import { StorySection, StoryGrid } from "./storybook";
export default {
- title: "Select Button",
+ title: "Select button",
};
const iconLabel = (
@@ -104,3 +105,22 @@ export const SelectButton = () => {
);
};
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.tsx
index f59729c9cd..0a1ef85a38 100644
--- a/packages/design-system/src/components/select.stories.tsx
+++ b/packages/design-system/src/components/select.stories.tsx
@@ -126,3 +126,34 @@ export const Select = () => {
</Flex>
);
};
+
+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>
+ );
+};
+
+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>
+ );
+};
diff --git a/packages/design-system/src/components/separator.stories.tsx b/packages/design-system/src/components/separator.stories.tsx
index 0a15e4cc86..3dbf7f84c9 100644
--- a/packages/design-system/src/components/separator.stories.tsx
+++ b/packages/design-system/src/components/separator.stories.tsx
@@ -26,3 +26,13 @@ export const Separator = () => (
</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>
+);
diff --git a/packages/design-system/src/components/small-icon-button.stories.tsx b/packages/design-system/src/components/small-icon-button.stories.tsx
index 0a4fedc60d..31e77b1110 100644
--- a/packages/design-system/src/components/small-icon-button.stories.tsx
+++ b/packages/design-system/src/components/small-icon-button.stories.tsx
@@ -81,8 +81,24 @@ SmallIconButton.args = {
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>
+);
+
export default {
- title: "Small Icon Button",
+ title: "Small icon button",
parameters: {
// to make the variant=contrast visible
backgrounds: { 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.tsx
index 2a92a0a1dc..93c2634685 100644
--- a/packages/design-system/src/components/small-toggle-button.stories.tsx
+++ b/packages/design-system/src/components/small-toggle-button.stories.tsx
@@ -122,8 +122,17 @@ SmallToggleButton.args = {
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>
+);
+
export default {
- title: "Small Toggle Button",
+ title: "Small toggle button",
parameters: {
// to make the variant=contrast visible
backgrounds: { default: "Panel" },
diff --git a/packages/design-system/src/components/switch.stories.tsx b/packages/design-system/src/components/switch.stories.tsx
index 1616be696c..c5820fce5e 100644
--- a/packages/design-system/src/components/switch.stories.tsx
+++ b/packages/design-system/src/components/switch.stories.tsx
@@ -1,3 +1,5 @@
+import { useState } from "react";
+import { Label } from "./label";
import { Switch } from "./switch";
import { StorySection, StoryGrid } from "./storybook";
@@ -28,3 +30,28 @@ const Story = () => {
};
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.tsx
index 85a78eaad3..befcf8285d 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 =
@@ -99,3 +99,22 @@ export const TextArea = () => {
);
};
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>
+);
+
+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>
+ );
+};
diff --git a/packages/design-system/src/components/text.stories.tsx b/packages/design-system/src/components/text.stories.tsx
index 16358ddf74..c508ea1cb1 100644
--- a/packages/design-system/src/components/text.stories.tsx
+++ b/packages/design-system/src/components/text.stories.tsx
@@ -64,6 +64,30 @@ export const Text = () => (
</>
);
+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>
+);
+
+export const UserSelectText = () => (
+ <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.tsx
index aca884568f..8b1e0cf7d5 100644
--- a/packages/design-system/src/components/toast.stories.tsx
+++ b/packages/design-system/src/components/toast.stories.tsx
@@ -135,3 +135,24 @@ export const Toast = () => {
</>
);
};
+
+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.tsx
index 6f1ce2c0c8..e879d3d1cb 100644
--- a/packages/design-system/src/components/toggle-button.stories.tsx
+++ b/packages/design-system/src/components/toggle-button.stories.tsx
@@ -68,8 +68,32 @@ ToggleButton.args = {
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>
+);
+
+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>
+);
+
export default {
- title: "Toggle Button",
+ title: "Toggle button",
parameters: {
// to make the variant=contrast visible
backgrounds: { default: "Panel" },
diff --git a/packages/design-system/src/components/toggle-group.stories.tsx b/packages/design-system/src/components/toggle-group.stories.tsx
index 0acffad6ba..30f859f4b4 100644
--- a/packages/design-system/src/components/toggle-group.stories.tsx
+++ b/packages/design-system/src/components/toggle-group.stories.tsx
@@ -150,8 +150,26 @@ ToggleGroup.argTypes = {
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>
+);
+
export default {
- title: "Toggle Group",
+ title: "Toggle group",
parameters: {
// to make the variant=contrast visible
backgrounds: { default: "Panel" },
diff --git a/packages/design-system/src/components/toolbar.stories.tsx b/packages/design-system/src/components/toolbar.stories.tsx
index bb1a6947b0..02cb6be825 100644
--- a/packages/design-system/src/components/toolbar.stories.tsx
+++ b/packages/design-system/src/components/toolbar.stories.tsx
@@ -2,6 +2,7 @@ import { PlayIcon, ChevronDownIcon } from "@webstudio-is/icons";
import { theme } from "../stitches.config";
import {
Toolbar,
+ ToolbarButton,
ToolbarToggleItem,
ToolbarToggleGroup,
ToolbarSeparator,
@@ -45,3 +46,24 @@ const ToolbarStory = () => {
};
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>
+);
diff --git a/packages/design-system/src/components/tooltip.stories.tsx b/packages/design-system/src/components/tooltip.stories.tsx
index f7cf5e686d..65010a1164 100644
--- a/packages/design-system/src/components/tooltip.stories.tsx
+++ b/packages/design-system/src/components/tooltip.stories.tsx
@@ -64,3 +64,49 @@ export const Tooltip = () => (
</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>
+);
+
+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>
+ </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>
+ </TooltipProvider>
+);
diff --git a/packages/design-system/src/components/tree.stories.tsx b/packages/design-system/src/components/tree.stories.tsx
index 646190ceab..a8ab24dde9 100644
--- a/packages/design-system/src/components/tree.stories.tsx
+++ b/packages/design-system/src/components/tree.stories.tsx
@@ -1,5 +1,5 @@
import { useMemo, useState } from "react";
-import { EllipsesIcon } from "@webstudio-is/icons";
+import { EllipsesIcon, DotIcon } from "@webstudio-is/icons";
import { SmallIconButton } from "./small-icon-button";
import { Box } from "./box";
import {
@@ -270,3 +270,53 @@ export const Tree = () => {
</Box>
);
};
+
+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.tsx
index fbfb6a4d16..681ca21830 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
@@ -12,5 +12,14 @@ TwoRowsSmallIconButtonContainer.storyName =
"Two Rows Small Icon Button Container";
export default {
- title: "Two Rows Small Icon Button Container",
+ title: "Two rows small icon button container",
};
+
+export const EmptyContainer = () => <TwoRowsIconButtonContainer />;
+
+export const MultipleChildren = () => (
+ <TwoRowsIconButtonContainer>
+ <SmallIconButton variant="destructive" icon={<TrashIcon />} />
+ <SmallIconButton icon={<TrashIcon />} />
+ </TwoRowsIconButtonContainer>
+);
diff --git a/packages/image/src/image-dev.stories.tsx b/packages/image/src/image-dev.stories.tsx
index 2d073210d9..b177a31678 100644
--- a/packages/image/src/image-dev.stories.tsx
+++ b/packages/image/src/image-dev.stories.tsx
@@ -10,7 +10,7 @@ import { Image as ImagePrimitive, wsImageLoader } from "./";
import localLogoImage from "../storybook-assets/logo.webp";
const meta: Meta<typeof ImagePrimitive> = {
- title: "Image Dev",
+ title: "Image dev",
};
export default meta;
diff --git a/packages/sdk-components-react/src/xml-node.stories.tsx b/packages/sdk-components-react/src/xml-node.stories.tsx
index 95a80e9b6a..408008b7a0 100644
--- a/packages/sdk-components-react/src/xml-node.stories.tsx
+++ b/packages/sdk-components-react/src/xml-node.stories.tsx
@@ -24,7 +24,7 @@ const Component = () => {
};
export default {
- title: "XML Node",
+ title: "XML node",
};
const Story = {