Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

fix (sandbox) Styling fixes for block examples (#2067)

Kenton Quatmand3fc363e48b1
diff --git a/packages/cli/templates/blocks/components/Stack/StackAlignment.tsx b/packages/cli/templates/blocks/components/Stack/StackAlignment.tsx
index df4f8202a3..c21232a7bb 100644
--- a/packages/cli/templates/blocks/components/Stack/StackAlignment.tsx
+++ b/packages/cli/templates/blocks/components/Stack/StackAlignment.tsx
@@ -7,35 +7,35 @@ import {XDSText} from '@xds/core/Text';
export default function StackAlignment() {
return (
- <XDSStack direction="vertical" gap={3}>
- <XDSCard padding={4} variant="muted">
- <XDSStack direction="vertical" gap={2}>
+ <XDSStack direction="vertical" gap={3} width="100%" style={{maxWidth: 500}}>
+ <XDSCard padding={4}>
+ <XDSStack direction="vertical" gap={4}>
<XDSText type="supporting" color="secondary">
Start (left)
</XDSText>
- <XDSStack direction="horizontal" gap={2} hAlign="start">
+ <XDSStack direction="horizontal" gap={1} hAlign="start">
<XDSButton label="Cancel" variant="secondary" size="sm" />
<XDSButton label="Save" variant="primary" size="sm" />
</XDSStack>
</XDSStack>
</XDSCard>
- <XDSCard padding={4} variant="muted">
- <XDSStack direction="vertical" gap={2}>
+ <XDSCard padding={4}>
+ <XDSStack direction="vertical" gap={4}>
<XDSText type="supporting" color="secondary">
Center
</XDSText>
- <XDSStack direction="horizontal" gap={2} hAlign="center">
+ <XDSStack direction="horizontal" gap={1} hAlign="center">
<XDSButton label="Cancel" variant="secondary" size="sm" />
<XDSButton label="Save" variant="primary" size="sm" />
</XDSStack>
</XDSStack>
</XDSCard>
- <XDSCard padding={4} variant="muted">
- <XDSStack direction="vertical" gap={2}>
+ <XDSCard padding={4}>
+ <XDSStack direction="vertical" gap={4}>
<XDSText type="supporting" color="secondary">
End (right)
</XDSText>
- <XDSStack direction="horizontal" gap={2} hAlign="end">
+ <XDSStack direction="horizontal" gap={1} hAlign="end">
<XDSButton label="Cancel" variant="secondary" size="sm" />
<XDSButton label="Save" variant="primary" size="sm" />
</XDSStack>
diff --git a/packages/cli/templates/blocks/components/Stack/StackDirections.tsx b/packages/cli/templates/blocks/components/Stack/StackDirections.tsx
index 1773ebf67c..450f691346 100644
--- a/packages/cli/templates/blocks/components/Stack/StackDirections.tsx
+++ b/packages/cli/templates/blocks/components/Stack/StackDirections.tsx
@@ -1,32 +1,21 @@
'use client';
-import {XDSStack} from '@xds/core/Layout';
-import {XDSBadge} from '@xds/core/Badge';
-import {XDSText} from '@xds/core/Text';
+import {XDSHStack, XDSVStack} from '@xds/core/Layout';
+import {XDSToken} from '@xds/core/Token';
export default function StackDirections() {
return (
- <XDSStack direction="horizontal" gap={10} hAlign="center">
- <XDSStack direction="vertical" gap={3}>
- <XDSText type="supporting" color="secondary">
- Horizontal
- </XDSText>
- <XDSStack direction="horizontal" gap={2}>
- <XDSBadge label="React" />
- <XDSBadge label="TypeScript" />
- <XDSBadge label="Node.js" />
- </XDSStack>
- </XDSStack>
- <XDSStack direction="vertical" gap={3}>
- <XDSText type="supporting" color="secondary">
- Vertical
- </XDSText>
- <XDSStack direction="vertical" gap={2}>
- <XDSBadge label="React" />
- <XDSBadge label="TypeScript" />
- <XDSBadge label="Node.js" />
- </XDSStack>
- </XDSStack>
- </XDSStack>
+ <XDSHStack gap={10} hAlign="center">
+ <XDSHStack gap={2} vAlign="center">
+ <XDSToken label="Horizontal" />
+ <XDSToken label="Horizontal" />
+ <XDSToken label="Horizontal" />
+ </XDSHStack>
+ <XDSVStack gap={2}>
+ <XDSToken label="Vertical" />
+ <XDSToken label="Vertical" />
+ <XDSToken label="Vertical" />
+ </XDSVStack>
+ </XDSHStack>
);
}
diff --git a/packages/cli/templates/blocks/components/Stack/StackFillItem.tsx b/packages/cli/templates/blocks/components/Stack/StackFillItem.tsx
index 005b84a4d1..53d0aeb373 100644
--- a/packages/cli/templates/blocks/components/Stack/StackFillItem.tsx
+++ b/packages/cli/templates/blocks/components/Stack/StackFillItem.tsx
@@ -13,7 +13,7 @@ const USERS = [
export default function StackFillItem() {
return (
- <XDSStack direction="vertical" gap={3}>
+ <XDSStack direction="vertical" gap={3} width="100%" style={{maxWidth: 300}}>
{USERS.map(user => (
<XDSStack
key={user.name}
diff --git a/packages/cli/templates/blocks/components/StackItem/StackItemShowcase.tsx b/packages/cli/templates/blocks/components/StackItem/StackItemShowcase.tsx
index 898208640d..fe6b95c177 100644
--- a/packages/cli/templates/blocks/components/StackItem/StackItemShowcase.tsx
+++ b/packages/cli/templates/blocks/components/StackItem/StackItemShowcase.tsx
@@ -6,25 +6,25 @@ import {XDSText} from '@xds/core/Text';
export default function StackItemShowcase() {
return (
- <XDSHStack gap={3} vAlign="center">
+ <XDSHStack gap={3} vAlign="center" width="100%" style={{maxWidth: 500}}>
<XDSStackItem size="static">
- <XDSCard variant="muted" padding={3}>
+ <XDSCard padding={3}>
<XDSText type="supporting" color="secondary">
- Static
+ Static Width
</XDSText>
</XDSCard>
</XDSStackItem>
<XDSStackItem size="fill">
- <XDSCard variant="muted" padding={3}>
+ <XDSCard padding={3}>
<XDSText type="supporting" color="secondary">
Fills remaining space
</XDSText>
</XDSCard>
</XDSStackItem>
<XDSStackItem size="static">
- <XDSCard variant="muted" padding={3}>
+ <XDSCard padding={3}>
<XDSText type="supporting" color="secondary">
- Static
+ Static Width
</XDSText>
</XDSCard>
</XDSStackItem>
diff --git a/packages/cli/templates/blocks/components/StatusDot/StatusDotPulsing.doc.mjs b/packages/cli/templates/blocks/components/StatusDot/StatusDotPulsing.doc.mjs
index f194082f30..96f0ce6638 100644
--- a/packages/cli/templates/blocks/components/StatusDot/StatusDotPulsing.doc.mjs
+++ b/packages/cli/templates/blocks/components/StatusDot/StatusDotPulsing.doc.mjs
@@ -5,7 +5,7 @@ export const doc = {
name: 'StatusDot — Pulsing',
description: 'Animated pulsing dots for live, processing, and error states.',
isReady: true,
- aspectRatio: 1,
- scale: 2,
+ aspectRatio: 16 / 9,
+ scale: 1,
componentsUsed: ['StatusDot', 'HStack'],
};
diff --git a/packages/cli/templates/blocks/components/StatusDot/StatusDotPulsing.tsx b/packages/cli/templates/blocks/components/StatusDot/StatusDotPulsing.tsx
index cc09c3c188..3e1be0c5bf 100644
--- a/packages/cli/templates/blocks/components/StatusDot/StatusDotPulsing.tsx
+++ b/packages/cli/templates/blocks/components/StatusDot/StatusDotPulsing.tsx
@@ -9,6 +9,8 @@ export default function StatusDotPulsing() {
<XDSStatusDot variant="positive" label="Live" isPulsing />
<XDSStatusDot variant="warning" label="Processing" isPulsing />
<XDSStatusDot variant="negative" label="Error" isPulsing />
+ <XDSStatusDot variant="info" label="Processing" isPulsing />
+ <XDSStatusDot variant="neutral" label="Error" isPulsing />
</XDSHStack>
);
}
diff --git a/packages/cli/templates/blocks/components/StatusDot/StatusDotShowcase.tsx b/packages/cli/templates/blocks/components/StatusDot/StatusDotShowcase.tsx
index 3170dfecea..42f463c561 100644
--- a/packages/cli/templates/blocks/components/StatusDot/StatusDotShowcase.tsx
+++ b/packages/cli/templates/blocks/components/StatusDot/StatusDotShowcase.tsx
@@ -1,7 +1,16 @@
'use client';
import {XDSStatusDot} from '@xds/core/StatusDot';
+import {XDSHStack} from '@xds/core/Layout';
export default function StatusDotShowcase() {
- return <XDSStatusDot variant="positive" label="Online" />;
+ return (
+ <XDSHStack gap={2} vAlign="center">
+ <XDSStatusDot variant="positive" label="Positive" />
+ <XDSStatusDot variant="warning" label="Warning" />
+ <XDSStatusDot variant="negative" label="Negative" />
+ <XDSStatusDot variant="info" label="Info" />
+ <XDSStatusDot variant="neutral" label="Neutral" />
+ </XDSHStack>
+ );
}
diff --git a/packages/cli/templates/blocks/components/StatusDot/StatusDotStatusIndicators.doc.mjs b/packages/cli/templates/blocks/components/StatusDot/StatusDotStatusIndicators.doc.mjs
index e8273d882d..cc738847d8 100644
--- a/packages/cli/templates/blocks/components/StatusDot/StatusDotStatusIndicators.doc.mjs
+++ b/packages/cli/templates/blocks/components/StatusDot/StatusDotStatusIndicators.doc.mjs
@@ -6,7 +6,7 @@ export const doc = {
description:
'Labeled status dot list for presence indicators like online, away, and offline.',
isReady: true,
- aspectRatio: 1,
- scale: 2,
+ aspectRatio: 16 / 9,
+ scale: 1,
componentsUsed: ['StatusDot', 'VStack', 'HStack', 'Text'],
};
diff --git a/packages/cli/templates/blocks/components/StatusDot/StatusDotVariants.doc.mjs b/packages/cli/templates/blocks/components/StatusDot/StatusDotVariants.doc.mjs
index 873afecff5..01e9d7b7e4 100644
--- a/packages/cli/templates/blocks/components/StatusDot/StatusDotVariants.doc.mjs
+++ b/packages/cli/templates/blocks/components/StatusDot/StatusDotVariants.doc.mjs
@@ -5,7 +5,7 @@ export const doc = {
name: 'StatusDot — Variants',
description: 'All five semantic color variants displayed in a row.',
isReady: true,
- aspectRatio: 1,
- scale: 2,
+ aspectRatio: 16 / 9,
+ scale: 1,
componentsUsed: ['StatusDot', 'HStack'],
};
diff --git a/packages/cli/templates/blocks/components/Switch/SwitchDisabled.doc.mjs b/packages/cli/templates/blocks/components/Switch/SwitchDisabled.doc.mjs
index 7dd98a7c9e..b01de9877e 100644
--- a/packages/cli/templates/blocks/components/Switch/SwitchDisabled.doc.mjs
+++ b/packages/cli/templates/blocks/components/Switch/SwitchDisabled.doc.mjs
@@ -5,6 +5,6 @@ export const doc = {
name: 'Switch — Disabled',
description: 'Disabled switch with label and description for gated features.',
isReady: true,
- aspectRatio: 4 / 3,
+ aspectRatio: 16 / 9,
componentsUsed: ['Switch', 'Center'],
};
diff --git a/packages/cli/templates/blocks/components/Switch/SwitchDisabled.tsx b/packages/cli/templates/blocks/components/Switch/SwitchDisabled.tsx
index 5f57719c2d..7cb6a2cf3c 100644
--- a/packages/cli/templates/blocks/components/Switch/SwitchDisabled.tsx
+++ b/packages/cli/templates/blocks/components/Switch/SwitchDisabled.tsx
@@ -2,19 +2,16 @@
import {useState} from 'react';
import {XDSSwitch} from '@xds/core/Switch';
-import {XDSCenter} from '@xds/core/Center';
export default function SwitchDisabled() {
const [value, setValue] = useState(false);
return (
- <XDSCenter>
- <XDSSwitch
- label="Premium feature"
- description="Upgrade to enable this option"
- value={value}
- onChange={setValue}
- isDisabled
- />
- </XDSCenter>
+ <XDSSwitch
+ label="Premium feature"
+ description="Upgrade to enable this option"
+ value={value}
+ onChange={setValue}
+ isDisabled
+ />
);
}
diff --git a/packages/cli/templates/blocks/components/Switch/SwitchSettingsPanel.doc.mjs b/packages/cli/templates/blocks/components/Switch/SwitchSettingsPanel.doc.mjs
index b80204f195..4786d7b5c3 100644
--- a/packages/cli/templates/blocks/components/Switch/SwitchSettingsPanel.doc.mjs
+++ b/packages/cli/templates/blocks/components/Switch/SwitchSettingsPanel.doc.mjs
@@ -6,6 +6,6 @@ export const doc = {
description:
'Settings panel with spread-spaced switches in a card.',
isReady: true,
- aspectRatio: 4 / 3,
+ aspectRatio: 16 / 9,
componentsUsed: ['Switch', 'Card', 'VStack', 'Center'],
};
diff --git a/packages/cli/templates/blocks/components/Switch/SwitchSettingsPanel.tsx b/packages/cli/templates/blocks/components/Switch/SwitchSettingsPanel.tsx
index 665bc65188..2990305f84 100644
--- a/packages/cli/templates/blocks/components/Switch/SwitchSettingsPanel.tsx
+++ b/packages/cli/templates/blocks/components/Switch/SwitchSettingsPanel.tsx
@@ -12,32 +12,30 @@ export default function SwitchSettingsPanel() {
const [autoSave, setAutoSave] = useState(false);
return (
- <XDSCenter width={350}>
- <XDSCard>
- <XDSVStack gap={4}>
- <XDSSwitch
- label="Enable notifications"
- value={notifications}
- onChange={setNotifications}
- labelPosition="start"
- labelSpacing="spread"
- />
- <XDSSwitch
- label="Dark mode"
- value={darkMode}
- onChange={setDarkMode}
- labelPosition="start"
- labelSpacing="spread"
- />
- <XDSSwitch
- label="Auto-save"
- value={autoSave}
- onChange={setAutoSave}
- labelPosition="start"
- labelSpacing="spread"
- />
- </XDSVStack>
- </XDSCard>
- </XDSCenter>
+ <XDSCard width="100%" style={{maxWidth: 300}}>
+ <XDSVStack gap={4}>
+ <XDSSwitch
+ label="Enable notifications"
+ value={notifications}
+ onChange={setNotifications}
+ labelPosition="start"
+ labelSpacing="spread"
+ />
+ <XDSSwitch
+ label="Dark mode"
+ value={darkMode}
+ onChange={setDarkMode}
+ labelPosition="start"
+ labelSpacing="spread"
+ />
+ <XDSSwitch
+ label="Auto-save"
+ value={autoSave}
+ onChange={setAutoSave}
+ labelPosition="start"
+ labelSpacing="spread"
+ />
+ </XDSVStack>
+ </XDSCard>
);
}
diff --git a/packages/cli/templates/blocks/components/Switch/SwitchShowcase.tsx b/packages/cli/templates/blocks/components/Switch/SwitchShowcase.tsx
index 4f25ba543f..d6418cf434 100644
--- a/packages/cli/templates/blocks/components/Switch/SwitchShowcase.tsx
+++ b/packages/cli/templates/blocks/components/Switch/SwitchShowcase.tsx
@@ -1,13 +1,15 @@
'use client';
+import {useState} from 'react';
import {XDSSwitch} from '@xds/core/Switch';
export default function SwitchShowcase() {
+ const [enabled, setEnabled] = useState(true);
return (
<XDSSwitch
label="Enable notifications"
- value={false}
- onChange={() => {}}
+ value={enabled}
+ onChange={setEnabled}
/>
);
}
diff --git a/packages/cli/templates/blocks/components/Switch/SwitchWithDescription.doc.mjs b/packages/cli/templates/blocks/components/Switch/SwitchWithDescription.doc.mjs
index e7881e76fe..55e501b026 100644
--- a/packages/cli/templates/blocks/components/Switch/SwitchWithDescription.doc.mjs
+++ b/packages/cli/templates/blocks/components/Switch/SwitchWithDescription.doc.mjs
@@ -5,6 +5,6 @@ export const doc = {
name: 'Switch — With Description',
description: 'Toggle with a label and supporting description text.',
isReady: true,
- aspectRatio: 4 / 3,
+ aspectRatio: 16 / 9,
componentsUsed: ['Switch', 'Center'],
};
diff --git a/packages/cli/templates/blocks/components/Switch/SwitchWithDescription.tsx b/packages/cli/templates/blocks/components/Switch/SwitchWithDescription.tsx
index 5ffa2d6a11..a80c843325 100644
--- a/packages/cli/templates/blocks/components/Switch/SwitchWithDescription.tsx
+++ b/packages/cli/templates/blocks/components/Switch/SwitchWithDescription.tsx
@@ -7,13 +7,11 @@ import {XDSCenter} from '@xds/core/Center';
export default function SwitchWithDescription() {
const [value, setValue] = useState(false);
return (
- <XDSCenter>
- <XDSSwitch
- label="Dark mode"
- description="Switch to a darker color scheme for reduced eye strain."
- value={value}
- onChange={setValue}
- />
- </XDSCenter>
+ <XDSSwitch
+ label="Dark mode"
+ description="Switch to a darker color scheme."
+ value={value}
+ onChange={setValue}
+ />
);
}
diff --git a/packages/cli/templates/blocks/components/Switch/SwitchWithStatus.tsx b/packages/cli/templates/blocks/components/Switch/SwitchWithStatus.tsx
index 6c261d1649..fa04d71164 100644
--- a/packages/cli/templates/blocks/components/Switch/SwitchWithStatus.tsx
+++ b/packages/cli/templates/blocks/components/Switch/SwitchWithStatus.tsx
@@ -12,7 +12,7 @@ export default function SwitchWithStatus() {
return (
<XDSCenter width={400}>
- <XDSVStack gap={6}>
+ <XDSVStack gap={6} width="100%" style={{maxWidth: 400}}>
<XDSSwitch
label="Accept terms and conditions"
value={terms}
diff --git a/packages/cli/templates/blocks/components/Table/TableColumnSettingsTable.doc.mjs b/packages/cli/templates/blocks/components/Table/TableColumnSettingsTable.doc.mjs
index e6a7479613..d523989402 100644
--- a/packages/cli/templates/blocks/components/Table/TableColumnSettingsTable.doc.mjs
+++ b/packages/cli/templates/blocks/components/Table/TableColumnSettingsTable.doc.mjs
@@ -6,6 +6,6 @@ export const doc = {
description:
'Table with a column visibility picker in the toolbar. Toggle columns on and off.',
isReady: true,
- aspectRatio: 4 / 3,
+ aspectRatio: 16 / 9,
componentsUsed: ['Table', 'MultiSelector', 'Toolbar', 'Text', 'Layout'],
};
diff --git a/packages/cli/templates/blocks/components/Table/TableColumnSettingsTable.tsx b/packages/cli/templates/blocks/components/Table/TableColumnSettingsTable.tsx
index 3d31adce3b..4ea9e29f7e 100644
--- a/packages/cli/templates/blocks/components/Table/TableColumnSettingsTable.tsx
+++ b/packages/cli/templates/blocks/components/Table/TableColumnSettingsTable.tsx
@@ -9,7 +9,7 @@ import {
} from '@xds/core/Table';
import type {XDSTableColumn} from '@xds/core/Table';
import {XDSMultiSelector} from '@xds/core/MultiSelector';
-import {XDSLayout, XDSLayoutHeader, XDSLayoutContent} from '@xds/core/Layout';
+import {XDSVStack} from '@xds/core/Layout';
import {XDSToolbar} from '@xds/core/Toolbar';
import {XDSText} from '@xds/core/Text';
@@ -101,31 +101,27 @@ export default function TableColumnSettingsTable() {
}));
return (
- <XDSLayout>
- <XDSLayoutHeader>
- <XDSToolbar
- label="Table actions"
- startContent={<XDSText type="label">Team</XDSText>}
- endContent={
- <XDSMultiSelector
- label="Columns"
- isLabelHidden
- options={selectorOptions}
- value={[...state.activeColumnKeys]}
- onChange={state.setActiveColumnKeys}
- />
- }
- />
- </XDSLayoutHeader>
- <XDSLayoutContent>
- <XDSTable
- data={users}
- columns={allColumns}
- idKey="id"
- hasHover
- plugins={{columnSettings: plugin}}
- />
- </XDSLayoutContent>
- </XDSLayout>
+ <XDSVStack gap={3} width="100%">
+ <XDSToolbar
+ label="Table actions"
+ startContent={<XDSText type="label">Team</XDSText>}
+ endContent={
+ <XDSMultiSelector
+ label="Columns"
+ isLabelHidden
+ options={selectorOptions}
+ value={[...state.activeColumnKeys]}
+ onChange={state.setActiveColumnKeys}
+ />
+ }
+ />
+ <XDSTable
+ data={users}
+ columns={allColumns}
+ idKey="id"
+ hasHover
+ plugins={{columnSettings: plugin}}
+ />
+ </XDSVStack>
);
}
diff --git a/packages/cli/templates/blocks/components/Table/TableFilterableTable.doc.mjs b/packages/cli/templates/blocks/components/Table/TableFilterableTable.doc.mjs
index 2adacfb4a9..60e5400b19 100644
--- a/packages/cli/templates/blocks/components/Table/TableFilterableTable.doc.mjs
+++ b/packages/cli/templates/blocks/components/Table/TableFilterableTable.doc.mjs
@@ -6,6 +6,6 @@ export const doc = {
description:
'Table with popover filter controls triggered by icons in column headers.',
isReady: true,
- aspectRatio: 4 / 3,
+ aspectRatio: 16 / 9,
componentsUsed: ['Table', 'PowerSearch'],
};
diff --git a/packages/cli/templates/blocks/components/Table/TableGridDividersTable.doc.mjs b/packages/cli/templates/blocks/components/Table/TableGridDividersTable.doc.mjs
index 3cae275073..9437d0b227 100644
--- a/packages/cli/templates/blocks/components/Table/TableGridDividersTable.doc.mjs
+++ b/packages/cli/templates/blocks/components/Table/TableGridDividersTable.doc.mjs
@@ -6,6 +6,6 @@ export const doc = {
description:
'Compact table with grid dividers showing both row and column borders, suited for dense numeric data.',
isReady: true,
- aspectRatio: 4 / 3,
+ aspectRatio: 16 / 9,
componentsUsed: ['Table'],
};
diff --git a/packages/cli/templates/blocks/components/Table/TableInCard.doc.mjs b/packages/cli/templates/blocks/components/Table/TableInCard.doc.mjs
index 7fd275cf35..b600c6c538 100644
--- a/packages/cli/templates/blocks/components/Table/TableInCard.doc.mjs
+++ b/packages/cli/templates/blocks/components/Table/TableInCard.doc.mjs
@@ -6,6 +6,6 @@ export const doc = {
description:
'Table composed inside a card with a heading, demonstrating container bleed alignment.',
isReady: true,
- aspectRatio: 4 / 3,
+ aspectRatio: 16 / 9,
componentsUsed: ['Table', 'Card', 'Layout', 'Text'],
};
diff --git a/packages/cli/templates/blocks/components/Table/TableInlineFilterTable.doc.mjs b/packages/cli/templates/blocks/components/Table/TableInlineFilterTable.doc.mjs
index 448aaa925d..bdcee7412c 100644
--- a/packages/cli/templates/blocks/components/Table/TableInlineFilterTable.doc.mjs
+++ b/packages/cli/templates/blocks/components/Table/TableInlineFilterTable.doc.mjs
@@ -6,6 +6,6 @@ export const doc = {
description:
'Table with inline filter controls rendered directly below each column header.',
isReady: true,
- aspectRatio: 4 / 3,
+ aspectRatio: 16 / 9,
componentsUsed: ['Table', 'PowerSearch'],
};
diff --git a/packages/cli/templates/blocks/components/Table/TablePaginatedTable.doc.mjs b/packages/cli/templates/blocks/components/Table/TablePaginatedTable.doc.mjs
index 6b0571a3b4..79e7b844b1 100644
--- a/packages/cli/templates/blocks/components/Table/TablePaginatedTable.doc.mjs
+++ b/packages/cli/templates/blocks/components/Table/TablePaginatedTable.doc.mjs
@@ -6,6 +6,6 @@ export const doc = {
description:
'Paginated data table navigating through a larger dataset page by page.',
isReady: true,
- aspectRatio: 4 / 3,
+ aspectRatio: 16 / 9,
componentsUsed: ['Table', 'Section'],
};
diff --git a/packages/cli/templates/blocks/components/Table/TableResizableTable.doc.mjs b/packages/cli/templates/blocks/components/Table/TableResizableTable.doc.mjs
index 0ab71b6f27..742a3e0113 100644
--- a/packages/cli/templates/blocks/components/Table/TableResizableTable.doc.mjs
+++ b/packages/cli/templates/blocks/components/Table/TableResizableTable.doc.mjs
@@ -6,6 +6,6 @@ export const doc = {
description:
'Table with draggable column resize handles. Drag the right edge of any header to resize.',
isReady: true,
- aspectRatio: 4 / 3,
+ aspectRatio: 16 / 9,
componentsUsed: ['Table'],
};
diff --git a/packages/cli/templates/blocks/components/Table/TableRichCellTable.doc.mjs b/packages/cli/templates/blocks/components/Table/TableRichCellTable.doc.mjs
index 98ba2c26bf..12183b0bd8 100644
--- a/packages/cli/templates/blocks/components/Table/TableRichCellTable.doc.mjs
+++ b/packages/cli/templates/blocks/components/Table/TableRichCellTable.doc.mjs
@@ -6,6 +6,6 @@ export const doc = {
description:
'Table with rich cell content using XDSLink for emails and XDSBadge for role labels.',
isReady: true,
- aspectRatio: 4 / 3,
+ aspectRatio: 16 / 9,
componentsUsed: ['Table', 'Badge', 'Link'],
};
diff --git a/packages/cli/templates/blocks/components/Table/TableSelectableTable.doc.mjs b/packages/cli/templates/blocks/components/Table/TableSelectableTable.doc.mjs
index 44eff03672..96e0863d04 100644
--- a/packages/cli/templates/blocks/components/Table/TableSelectableTable.doc.mjs
+++ b/packages/cli/templates/blocks/components/Table/TableSelectableTable.doc.mjs
@@ -6,6 +6,6 @@ export const doc = {
description:
'Table with row selection checkboxes and a select-all header checkbox.',
isReady: true,
- aspectRatio: 4 / 3,
+ aspectRatio: 16 / 9,
componentsUsed: ['Table'],
};
diff --git a/packages/cli/templates/blocks/components/Table/TableShowcase.tsx b/packages/cli/templates/blocks/components/Table/TableShowcase.tsx
index 0ac67c050e..dd0a29645f 100644
--- a/packages/cli/templates/blocks/components/Table/TableShowcase.tsx
+++ b/packages/cli/templates/blocks/components/Table/TableShowcase.tsx
@@ -45,7 +45,7 @@ const columns: XDSTableColumn<User>[] = [
export default function TableShowcase() {
return (
- <XDSCard>
+ <XDSCard width={600}>
<XDSTable data={users} columns={columns} idKey="id" hasHover />
</XDSCard>
);
diff --git a/packages/cli/templates/blocks/components/Table/TableSortableTable.doc.mjs b/packages/cli/templates/blocks/components/Table/TableSortableTable.doc.mjs
index 61bca24ed9..ca9a5276e1 100644
--- a/packages/cli/templates/blocks/components/Table/TableSortableTable.doc.mjs
+++ b/packages/cli/templates/blocks/components/Table/TableSortableTable.doc.mjs
@@ -6,6 +6,6 @@ export const doc = {
description:
'Table with sortable columns, click headers to sort ascending or descending.',
isReady: true,
- aspectRatio: 4 / 3,
+ aspectRatio: 16 / 9,
componentsUsed: ['Table'],
};
diff --git a/packages/cli/templates/blocks/components/Table/TableStripedTable.doc.mjs b/packages/cli/templates/blocks/components/Table/TableStripedTable.doc.mjs
index 0aa1c2eefa..156ea220e2 100644
--- a/packages/cli/templates/blocks/components/Table/TableStripedTable.doc.mjs
+++ b/packages/cli/templates/blocks/components/Table/TableStripedTable.doc.mjs
@@ -6,6 +6,6 @@ export const doc = {
description:
'Table with alternating row colors and hover highlighting for easy scanning.',
isReady: true,
- aspectRatio: 4 / 3,
+ aspectRatio: 16 / 9,
componentsUsed: ['Table'],
};
diff --git a/packages/cli/templates/blocks/components/Token/TokenColors.tsx b/packages/cli/templates/blocks/components/Token/TokenColors.tsx
index f7c1c40a32..d06b592e56 100644
--- a/packages/cli/templates/blocks/components/Token/TokenColors.tsx
+++ b/packages/cli/templates/blocks/components/Token/TokenColors.tsx
@@ -20,22 +20,26 @@ const COLORS = [
export default function TokenColors() {
return (
- <XDSStack direction="vertical" gap={4}>
- <XDSStack direction="vertical" gap={1}>
+ <XDSStack
+ direction="vertical"
+ gap={10}
+ width="100%"
+ style={{maxWidth: 400}}>
+ <XDSStack direction="vertical" gap={2}>
<XDSText type="supporting" color="secondary">
Default
</XDSText>
- <XDSStack direction="horizontal" gap={2} wrap="wrap">
+ <XDSStack direction="horizontal" gap={1} wrap="wrap">
{COLORS.map(({color, label}) => (
<XDSToken key={color} label={label} color={color} />
))}
</XDSStack>
</XDSStack>
- <XDSStack direction="vertical" gap={1}>
+ <XDSStack direction="vertical" gap={2}>
<XDSText type="supporting" color="secondary">
Disabled
</XDSText>
- <XDSStack direction="horizontal" gap={2} wrap="wrap">
+ <XDSStack direction="horizontal" gap={1} wrap="wrap">
{COLORS.map(({color, label}) => (
<XDSToken key={color} label={label} color={color} isDisabled />
))}
diff --git a/packages/cli/templates/blocks/components/Token/TokenRemovable.tsx b/packages/cli/templates/blocks/components/Token/TokenRemovable.tsx
index bca9d3b6f9..7801b59a79 100644
--- a/packages/cli/templates/blocks/components/Token/TokenRemovable.tsx
+++ b/packages/cli/templates/blocks/components/Token/TokenRemovable.tsx
@@ -6,8 +6,8 @@ import {XDSText} from '@xds/core/Text';
export default function TokenRemovable() {
return (
- <XDSStack direction="vertical" gap={4}>
- <XDSStack direction="vertical" gap={1}>
+ <XDSStack direction="vertical" gap={10}>
+ <XDSStack direction="vertical" gap={2}>
<XDSText type="supporting" color="secondary">
Active filters
</XDSText>
@@ -17,7 +17,7 @@ export default function TokenRemovable() {
<XDSToken label="Team: Design" color="purple" onRemove={() => {}} />
</XDSStack>
</XDSStack>
- <XDSStack direction="vertical" gap={1}>
+ <XDSStack direction="vertical" gap={2}>
<XDSText type="supporting" color="secondary">
Selected recipients
</XDSText>
diff --git a/packages/cli/templates/blocks/components/Toolbar/ToolbarBulkActions.tsx b/packages/cli/templates/blocks/components/Toolbar/ToolbarBulkActions.tsx
index a61e0854b5..3fd0fa3d66 100644
--- a/packages/cli/templates/blocks/components/Toolbar/ToolbarBulkActions.tsx
+++ b/packages/cli/templates/blocks/components/Toolbar/ToolbarBulkActions.tsx
@@ -7,6 +7,7 @@ import {XDSIcon} from '@xds/core/Icon';
import {XDSBadge} from '@xds/core/Badge';
import {XDSTable} from '@xds/core/Table';
import {useXDSTableSelection, useXDSTableSelectionState} from '@xds/core/Table';
+import {XDSStack} from '@xds/core/Layout';
import {TrashIcon, ArchiveBoxIcon} from '@heroicons/react/24/outline';
const DATA = [
@@ -32,12 +33,13 @@ export default function ToolbarBulkActions() {
const selectionPlugin = useXDSTableSelection(selectionConfig);
return (
- <>
+ <XDSStack direction="vertical">
{selectedKeys.size > 0 && (
<XDSToolbar
label="Bulk actions"
size="sm"
variant="wash"
+ dividers={['bottom']}
startContent={
<>
<XDSBadge label={`${selectedKeys.size} selected`} />
@@ -74,6 +76,6 @@ export default function ToolbarBulkActions() {
data={DATA}
plugins={{selection: selectionPlugin}}
/>
- </>
+ </XDSStack>
);
}
diff --git a/packages/cli/templates/blocks/components/Toolbar/ToolbarCardHeader.tsx b/packages/cli/templates/blocks/components/Toolbar/ToolbarCardHeader.tsx
index 2583e42304..727d816c09 100644
--- a/packages/cli/templates/blocks/components/Toolbar/ToolbarCardHeader.tsx
+++ b/packages/cli/templates/blocks/components/Toolbar/ToolbarCardHeader.tsx
@@ -11,7 +11,7 @@ import * as stylex from '@stylexjs/stylex';
const styles = stylex.create({
card: {
- width: 600,
+ width: 500,
height: '100%',
marginTop: 260,
},
diff --git a/packages/cli/templates/blocks/components/Toolbar/ToolbarSizes.tsx b/packages/cli/templates/blocks/components/Toolbar/ToolbarSizes.tsx
index 26a9a47153..e3397f0557 100644
--- a/packages/cli/templates/blocks/components/Toolbar/ToolbarSizes.tsx
+++ b/packages/cli/templates/blocks/components/Toolbar/ToolbarSizes.tsx
@@ -11,7 +11,7 @@ import * as stylex from '@stylexjs/stylex';
const styles = stylex.create({
container: {
- width: 600,
+ width: 500,
},
});
@@ -29,7 +29,6 @@ export default function ToolbarSizes() {
<XDSToolbar
label={`${label} toolbar`}
size={size}
- dividers={['bottom']}
startContent={<XDSHeading level={4}>{label}</XDSHeading>}
endContent={
<>
diff --git a/packages/cli/templates/blocks/components/Toolbar/ToolbarTableFilter.tsx b/packages/cli/templates/blocks/components/Toolbar/ToolbarTableFilter.tsx
index 7ced5d81d8..d28f41be8f 100644
--- a/packages/cli/templates/blocks/components/Toolbar/ToolbarTableFilter.tsx
+++ b/packages/cli/templates/blocks/components/Toolbar/ToolbarTableFilter.tsx
@@ -15,7 +15,7 @@ import {
const styles = stylex.create({
container: {
- width: 600,
+ width: '100%',
},
});
diff --git a/packages/cli/templates/blocks/components/Toolbar/ToolbarWithTabs.tsx b/packages/cli/templates/blocks/components/Toolbar/ToolbarWithTabs.tsx
index 92f43368f1..e62255e6c4 100644
--- a/packages/cli/templates/blocks/components/Toolbar/ToolbarWithTabs.tsx
+++ b/packages/cli/templates/blocks/components/Toolbar/ToolbarWithTabs.tsx
@@ -13,6 +13,7 @@ import * as stylex from '@stylexjs/stylex';
const styles = stylex.create({
card: {
width: '100%',
+ maxWidth: 500,
height: '100%',
marginTop: 200,
},
diff --git a/packages/cli/templates/blocks/components/TopNav/TopNavCenteredNavigation.doc.mjs b/packages/cli/templates/blocks/components/TopNav/TopNavCenteredNavigation.doc.mjs
index 2196e60cde..e3bf64c540 100644
--- a/packages/cli/templates/blocks/components/TopNav/TopNavCenteredNavigation.doc.mjs
+++ b/packages/cli/templates/blocks/components/TopNav/TopNavCenteredNavigation.doc.mjs
@@ -6,6 +6,6 @@ export const doc = {
description:
'Navigation layout with center-aligned nav items flanked by a logo heading and end actions.',
isReady: true,
- aspectRatio: 4 / 3,
+ aspectRatio: 16 / 9,
componentsUsed: ['TopNav', 'NavIcon', 'Button'],
};
diff --git a/packages/cli/templates/blocks/components/TopNav/TopNavCenteredNavigation.tsx b/packages/cli/templates/blocks/components/TopNav/TopNavCenteredNavigation.tsx
index 61243a56ca..a7aecc26e4 100644
--- a/packages/cli/templates/blocks/components/TopNav/TopNavCenteredNavigation.tsx
+++ b/packages/cli/templates/blocks/components/TopNav/TopNavCenteredNavigation.tsx
@@ -4,23 +4,7 @@ import {XDSTopNav, XDSTopNavHeading, XDSTopNavItem} from '@xds/core/TopNav';
import {XDSNavIcon} from '@xds/core/NavIcon';
import {XDSButton} from '@xds/core/Button';
import {XDSIcon} from '@xds/core/Icon';
-
-function CubeIcon() {
- return (
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5">
- <path strokeLinecap="round" strokeLinejoin="round" d="M21 16.5V7.914a1.5 1.5 0 0 0-.75-1.299l-7.5-4.329a1.5 1.5 0 0 0-1.5 0l-7.5 4.33A1.5 1.5 0 0 0 3 7.913V16.5a1.5 1.5 0 0 0 .75 1.3l7.5 4.328a1.5 1.5 0 0 0 1.5 0l7.5-4.329A1.5 1.5 0 0 0 21 16.5Z" />
- <path strokeLinecap="round" strokeLinejoin="round" d="m3.75 7.5 8.25 4.764 8.25-4.764M12 22.089V12.264" />
- </svg>
- );
-}
-
-function UserIcon() {
- return (
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5">
- <path strokeLinecap="round" strokeLinejoin="round" d="M17.982 18.725A7.488 7.488 0 0 0 12 15.75a7.488 7.488 0 0 0-5.982 2.975m11.963 0a9 9 0 1 0-11.963 0m11.963 0A8.966 8.966 0 0 1 12 21a8.966 8.966 0 0 1-5.982-2.275M15 9.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z" />
- </svg>
- );
-}
+import {CubeIcon, UserCircleIcon} from '@heroicons/react/24/outline';
export default function TopNavCenteredNavigation() {
return (
@@ -29,7 +13,7 @@ export default function TopNavCenteredNavigation() {
heading={
<XDSTopNavHeading
heading="My App"
- logo={<XDSNavIcon icon={<CubeIcon />} />}
+ logo={<XDSNavIcon icon={<XDSIcon icon={CubeIcon} size="sm" />} />}
href="#"
/>
}
@@ -51,7 +35,7 @@ export default function TopNavCenteredNavigation() {
<XDSButton
label="Profile"
variant="ghost"
- icon={<UserIcon />}
+ icon={<UserCircleIcon />}
isIconOnly
/>
</>
diff --git a/packages/cli/templates/blocks/components/TopNav/TopNavEnterpriseDashboard.doc.mjs b/packages/cli/templates/blocks/components/TopNav/TopNavEnterpriseDashboard.doc.mjs
index 174382df4d..8bd1672adc 100644
--- a/packages/cli/templates/blocks/components/TopNav/TopNavEnterpriseDashboard.doc.mjs
+++ b/packages/cli/templates/blocks/components/TopNav/TopNavEnterpriseDashboard.doc.mjs
@@ -6,6 +6,6 @@ export const doc = {
description:
'Full-featured navigation bar with icon-labeled nav items, search, notifications, and a primary CTA.',
isReady: true,
- aspectRatio: 4 / 3,
+ aspectRatio: 16 / 9,
componentsUsed: ['TopNav', 'NavIcon', 'Button'],
};
diff --git a/packages/cli/templates/blocks/components/TopNav/TopNavEnterpriseDashboard.tsx b/packages/cli/templates/blocks/components/TopNav/TopNavEnterpriseDashboard.tsx
index 5fccdc3a81..ef521df258 100644
--- a/packages/cli/templates/blocks/components/TopNav/TopNavEnterpriseDashboard.tsx
+++ b/packages/cli/templates/blocks/components/TopNav/TopNavEnterpriseDashboard.tsx
@@ -4,47 +4,14 @@ import {XDSTopNav, XDSTopNavHeading, XDSTopNavItem} from '@xds/core/TopNav';
import {XDSNavIcon} from '@xds/core/NavIcon';
import {XDSButton} from '@xds/core/Button';
import {XDSIcon} from '@xds/core/Icon';
-
-function ChartIcon() {
- return (
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5">
- <path strokeLinecap="round" strokeLinejoin="round" d="M3 13.125C3 12.504 3.504 12 4.125 12h2.25c.621 0 1.125.504 1.125 1.125v6.75C7.5 20.496 6.996 21 6.375 21h-2.25A1.125 1.125 0 0 1 3 19.875v-6.75ZM9.75 8.625c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125v11.25c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 0 1-1.125-1.125V8.625ZM16.5 4.125c0-.621.504-1.125 1.125-1.125h2.25C20.496 3 21 3.504 21 4.125v15.75c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 0 1-1.125-1.125V4.125Z" />
- </svg>
- );
-}
-
-function HomeIcon() {
- return (
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5">
- <path strokeLinecap="round" strokeLinejoin="round" d="m2.25 12 8.955-8.955a1.126 1.126 0 0 1 1.59 0L21.75 12M4.5 9.75v10.125c0 .621.504 1.125 1.125 1.125H9.75v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21h4.125c.621 0 1.125-.504 1.125-1.125V9.75M8.25 21h8.25" />
- </svg>
- );
-}
-
-function DocumentIcon() {
- return (
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5">
- <path strokeLinecap="round" strokeLinejoin="round" d="M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z" />
- </svg>
- );
-}
-
-function CogIcon() {
- return (
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5">
- <path strokeLinecap="round" strokeLinejoin="round" d="M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.646.87.074.04.147.083.22.127.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 0 1 1.37.49l1.296 2.247a1.125 1.125 0 0 1-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a7.723 7.723 0 0 1 0 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 0 1-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.47 6.47 0 0 1-.22.128c-.333.183-.582.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 0 1-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 0 1-1.369-.49l-1.297-2.247a1.125 1.125 0 0 1 .26-1.431l1.004-.827c.292-.24.437-.613.43-.991a6.932 6.932 0 0 1 0-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 0 1-.26-1.43l1.297-2.247a1.125 1.125 0 0 1 1.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.086.22-.128.332-.183.582-.495.644-.869l.214-1.28Z" />
- <path strokeLinecap="round" strokeLinejoin="round" d="M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z" />
- </svg>
- );
-}
-
-function BellIcon() {
- return (
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5">
- <path strokeLinecap="round" strokeLinejoin="round" d="M14.857 17.082a23.848 23.848 0 0 0 5.454-1.31A8.967 8.967 0 0 1 18 9.75V9A6 6 0 0 0 6 9v.75a8.967 8.967 0 0 1-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 0 1-5.714 0m5.714 0a3 3 0 1 1-5.714 0" />
- </svg>
- );
-}
+import {
+ ChartBarIcon,
+ CubeIcon,
+ HomeIcon,
+ DocumentTextIcon,
+ Cog6ToothIcon,
+ BellIcon,
+} from '@heroicons/react/24/outline';
export default function TopNavEnterpriseDashboard() {
return (
@@ -52,8 +19,8 @@ export default function TopNavEnterpriseDashboard() {
label="Main navigation"
heading={
<XDSTopNavHeading
- heading="Enterprise Dashboard"
- logo={<XDSNavIcon icon={<ChartIcon />} />}
+ heading="My App"
+ logo={<XDSNavIcon icon={<XDSIcon icon={CubeIcon} size="sm" />} />}
href="#"
/>
}
@@ -63,22 +30,12 @@ export default function TopNavEnterpriseDashboard() {
label="Dashboard"
href="#"
isSelected
- icon={<HomeIcon />}
+ icon={<XDSIcon icon={HomeIcon} size="sm" />}
/>
<XDSTopNavItem
label="Reports"
href="#"
- icon={<DocumentIcon />}
- />
- <XDSTopNavItem
- label="Analytics"
- href="#"
- icon={<ChartIcon />}
- />
- <XDSTopNavItem
- label="Settings"
- href="#"
- icon={<CogIcon />}
+ icon={<XDSIcon icon={DocumentTextIcon} size="sm" />}
/>
</>
}
@@ -93,7 +50,7 @@ export default function TopNavEnterpriseDashboard() {
<XDSButton
label="Notifications"
variant="ghost"
- icon={<BellIcon />}
+ icon={<XDSIcon icon={BellIcon} />}
isIconOnly
/>
<XDSButton label="Upgrade" variant="primary" />
diff --git a/packages/cli/templates/blocks/components/TopNav/TopNavHoverMenu.doc.mjs b/packages/cli/templates/blocks/components/TopNav/TopNavHoverMenu.doc.mjs
index 4c2fe44cd1..5b579bf035 100644
--- a/packages/cli/templates/blocks/components/TopNav/TopNavHoverMenu.doc.mjs
+++ b/packages/cli/templates/blocks/components/TopNav/TopNavHoverMenu.doc.mjs
@@ -6,6 +6,6 @@ export const doc = {
description:
'Navigation bar with a hover-triggered dropdown menu showing product items with icons and descriptions.',
isReady: true,
- aspectRatio: 4 / 3,
+ aspectRatio: 16 / 9,
componentsUsed: ['TopNav', 'TopNavMenu', 'NavIcon', 'Button'],
};
diff --git a/packages/cli/templates/blocks/components/TopNav/TopNavHoverMenu.tsx b/packages/cli/templates/blocks/components/TopNav/TopNavHoverMenu.tsx
index 3476dfe845..7bbad397f4 100644
--- a/packages/cli/templates/blocks/components/TopNav/TopNavHoverMenu.tsx
+++ b/packages/cli/templates/blocks/components/TopNav/TopNavHoverMenu.tsx
@@ -8,55 +8,15 @@ import {
} from '@xds/core/TopNav';
import {XDSNavIcon} from '@xds/core/NavIcon';
import {XDSButton} from '@xds/core/Button';
-
-function CubeIcon() {
- return (
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5">
- <path strokeLinecap="round" strokeLinejoin="round" d="M21 16.5V7.914a1.5 1.5 0 0 0-.75-1.299l-7.5-4.329a1.5 1.5 0 0 0-1.5 0l-7.5 4.33A1.5 1.5 0 0 0 3 7.913V16.5a1.5 1.5 0 0 0 .75 1.3l7.5 4.328a1.5 1.5 0 0 0 1.5 0l7.5-4.329A1.5 1.5 0 0 0 21 16.5Z" />
- <path strokeLinecap="round" strokeLinejoin="round" d="m3.75 7.5 8.25 4.764 8.25-4.764M12 22.089V12.264" />
- </svg>
- );
-}
-
-function ChartIcon() {
- return (
- <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5">
- <path strokeLinecap="round" strokeLinejoin="round" d="M3 13.125C3 12.504 3.504 12 4.125 12h2.25c.621 0 1.125.504 1.125 1.125v6.75C7.5 20.496 6.996 21 6.375 21h-2.25A1.125 1.125 0 0 1 3 19.875v-6.75ZM9.75 8.625c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125v11.25c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 0 1-1.125-1.125V8.625ZM16.5 4.125c0-.621.504-1.125 1.125-1.125h2.25C20.496 3 21 3.504 21 4.125v15.75c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 0 1-1.125-1.125V4.125Z" />
- </svg>
- );
-}
-
-function ShieldIcon() {
- return (
- <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5">
- <path strokeLinecap="round" strokeLinejoin="round" d="M9 12.75 11.25 15 15 9.75m-3-7.036A11.959 11.959 0 0 1 3.598 6 11.99 11.99 0 0 0 3 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285Z" />
- </svg>
- );
-}
-
-function BoltIcon() {
- return (
- <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5">
- <path strokeLinecap="round" strokeLinejoin="round" d="m3.75 13.5 10.5-11.25L12 10.5h8.25L9.75 21.75 12 13.5H3.75Z" />
- </svg>
- );
-}
-
-function CodeIcon() {
- return (
- <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5">
- <path strokeLinecap="round" strokeLinejoin="round" d="M17.25 6.75 22.5 12l-5.25 5.25m-10.5 0L1.5 12l5.25-5.25m7.5-3-4.5 16.5" />
- </svg>
- );
-}
-
-function UserIcon() {
- return (
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5">
- <path strokeLinecap="round" strokeLinejoin="round" d="M17.982 18.725A7.488 7.488 0 0 0 12 15.75a7.488 7.488 0 0 0-5.982 2.975m11.963 0a9 9 0 1 0-11.963 0m11.963 0A8.966 8.966 0 0 1 12 21a8.966 8.966 0 0 1-5.982-2.275M15 9.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z" />
- </svg>
- );
-}
+import {XDSIcon} from '@xds/core/Icon';
+import {
+ CubeIcon,
+ ChartBarIcon,
+ ShieldCheckIcon,
+ BoltIcon,
+ CodeBracketIcon,
+ UserCircleIcon,
+} from '@heroicons/react/24/outline';
export default function TopNavHoverMenu() {
return (
@@ -65,7 +25,7 @@ export default function TopNavHoverMenu() {
heading={
<XDSTopNavHeading
heading="My App"
- logo={<XDSNavIcon icon={<CubeIcon />} />}
+ logo={<XDSNavIcon icon={<XDSIcon icon={CubeIcon} size="sm" />} />}
href="#"
/>
}
@@ -78,13 +38,13 @@ export default function TopNavHoverMenu() {
{
title: 'Analytics',
description: 'Track and analyze user behavior',
- icon: <ChartIcon />,
+ icon: <ChartBarIcon />,
href: '#analytics',
},
{
title: 'Security',
description: 'Enterprise-grade protection',
- icon: <ShieldIcon />,
+ icon: <ShieldCheckIcon />,
href: '#security',
},
{
@@ -96,7 +56,7 @@ export default function TopNavHoverMenu() {
{
title: 'Developer Tools',
description: 'APIs, SDKs, and CLI tools',
- icon: <CodeIcon />,
+ icon: <CodeBracketIcon />,
href: '#dev-tools',
},
]}
@@ -108,7 +68,7 @@ export default function TopNavHoverMenu() {
<XDSButton
label="Profile"
variant="ghost"
- icon={<UserIcon />}
+ icon={<UserCircleIcon />}
isIconOnly
/>
}
diff --git a/packages/cli/templates/blocks/components/TopNav/TopNavMegaMenu.doc.mjs b/packages/cli/templates/blocks/components/TopNav/TopNavMegaMenu.doc.mjs
index 87380a66de..bc475e8031 100644
--- a/packages/cli/templates/blocks/components/TopNav/TopNavMegaMenu.doc.mjs
+++ b/packages/cli/templates/blocks/components/TopNav/TopNavMegaMenu.doc.mjs
@@ -6,6 +6,6 @@ export const doc = {
description:
'Marketing-style navigation with a full-width mega menu featuring product items and a promotional featured card.',
isReady: true,
- aspectRatio: 4 / 3,
+ aspectRatio: 16 / 9,
componentsUsed: ['TopNav', 'TopNavMegaMenu', 'NavIcon', 'Button'],
};
diff --git a/packages/cli/templates/blocks/components/TopNav/TopNavMegaMenu.tsx b/packages/cli/templates/blocks/components/TopNav/TopNavMegaMenu.tsx
index 9b64e83626..835f911c12 100644
--- a/packages/cli/templates/blocks/components/TopNav/TopNavMegaMenu.tsx
+++ b/packages/cli/templates/blocks/components/TopNav/TopNavMegaMenu.tsx
@@ -10,55 +10,15 @@ import {
} from '@xds/core/TopNav';
import {XDSNavIcon} from '@xds/core/NavIcon';
import {XDSButton} from '@xds/core/Button';
-
-function CubeIcon() {
- return (
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5">
- <path strokeLinecap="round" strokeLinejoin="round" d="M21 16.5V7.914a1.5 1.5 0 0 0-.75-1.299l-7.5-4.329a1.5 1.5 0 0 0-1.5 0l-7.5 4.33A1.5 1.5 0 0 0 3 7.913V16.5a1.5 1.5 0 0 0 .75 1.3l7.5 4.328a1.5 1.5 0 0 0 1.5 0l7.5-4.329A1.5 1.5 0 0 0 21 16.5Z" />
- <path strokeLinecap="round" strokeLinejoin="round" d="m3.75 7.5 8.25 4.764 8.25-4.764M12 22.089V12.264" />
- </svg>
- );
-}
-
-function ChartIcon() {
- return (
- <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5">
- <path strokeLinecap="round" strokeLinejoin="round" d="M3 13.125C3 12.504 3.504 12 4.125 12h2.25c.621 0 1.125.504 1.125 1.125v6.75C7.5 20.496 6.996 21 6.375 21h-2.25A1.125 1.125 0 0 1 3 19.875v-6.75ZM9.75 8.625c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125v11.25c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 0 1-1.125-1.125V8.625ZM16.5 4.125c0-.621.504-1.125 1.125-1.125h2.25C20.496 3 21 3.504 21 4.125v15.75c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 0 1-1.125-1.125V4.125Z" />
- </svg>
- );
-}
-
-function ShieldIcon() {
- return (
- <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5">
- <path strokeLinecap="round" strokeLinejoin="round" d="M9 12.75 11.25 15 15 9.75m-3-7.036A11.959 11.959 0 0 1 3.598 6 11.99 11.99 0 0 0 3 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285Z" />
- </svg>
- );
-}
-
-function BoltIcon() {
- return (
- <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5">
- <path strokeLinecap="round" strokeLinejoin="round" d="m3.75 13.5 10.5-11.25L12 10.5h8.25L9.75 21.75 12 13.5H3.75Z" />
- </svg>
- );
-}
-
-function CodeIcon() {
- return (
- <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5">
- <path strokeLinecap="round" strokeLinejoin="round" d="M17.25 6.75 22.5 12l-5.25 5.25m-10.5 0L1.5 12l5.25-5.25m7.5-3-4.5 16.5" />
- </svg>
- );
-}
-
-function GlobeIcon() {
- return (
- <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5">
- <path strokeLinecap="round" strokeLinejoin="round" d="M12 21a9.004 9.004 0 0 0 8.716-6.747M12 21a9.004 9.004 0 0 1-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 0 1 7.843 4.582M12 3a8.997 8.997 0 0 0-7.843 4.582m15.686 0A11.953 11.953 0 0 1 12 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0 1 21 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0 1 12 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 0 1 3 12c0-1.605.42-3.113 1.157-4.418" />
- </svg>
- );
-}
+import {XDSIcon} from '@xds/core/Icon';
+import {
+ CubeIcon,
+ ChartBarIcon,
+ ShieldCheckIcon,
+ BoltIcon,
+ CodeBracketIcon,
+ GlobeAltIcon,
+} from '@heroicons/react/24/outline';
export default function TopNavMegaMenu() {
return (
@@ -66,8 +26,8 @@ export default function TopNavMegaMenu() {
label="Marketing navigation"
heading={
<XDSTopNavHeading
- heading="Acme"
- logo={<XDSNavIcon icon={<CubeIcon />} />}
+ heading="My App"
+ logo={<XDSNavIcon icon={<XDSIcon icon={CubeIcon} size="sm" />} />}
href="#"
/>
}
@@ -80,13 +40,13 @@ export default function TopNavMegaMenu() {
<XDSTopNavMegaMenuItem
title="Analytics"
description="Track and analyze user behavior across your apps"
- icon={<ChartIcon />}
+ icon={<ChartBarIcon />}
href="#analytics"
/>
<XDSTopNavMegaMenuItem
title="Security"
description="Enterprise-grade protection for your data"
- icon={<ShieldIcon />}
+ icon={<ShieldCheckIcon />}
href="#security"
/>
<XDSTopNavMegaMenuItem
@@ -98,13 +58,13 @@ export default function TopNavMegaMenu() {
<XDSTopNavMegaMenuItem
title="Developer Tools"
description="APIs, SDKs, and CLI for integration"
- icon={<CodeIcon />}
+ icon={<CodeBracketIcon />}
href="#dev-tools"
/>
<XDSTopNavMegaMenuItem
title="Global Network"
description="Low-latency edge infra in 40+ regions"
- icon={<GlobeIcon />}
+ icon={<GlobeAltIcon />}
href="#network"
/>
</>
diff --git a/packages/cli/templates/blocks/components/TopNav/TopNavMultipleDropdowns.doc.mjs b/packages/cli/templates/blocks/components/TopNav/TopNavMultipleDropdowns.doc.mjs
index c2da3efefb..4889e06e91 100644
--- a/packages/cli/templates/blocks/components/TopNav/TopNavMultipleDropdowns.doc.mjs
+++ b/packages/cli/templates/blocks/components/TopNav/TopNavMultipleDropdowns.doc.mjs
@@ -6,6 +6,6 @@ export const doc = {
description:
'Navigation bar with multiple hover-triggered dropdown menus that auto-close when switching between them.',
isReady: true,
- aspectRatio: 4 / 3,
+ aspectRatio: 16 / 9,
componentsUsed: ['TopNav', 'TopNavMenu'],
};
diff --git a/packages/cli/templates/blocks/components/TopNav/TopNavMultipleDropdowns.tsx b/packages/cli/templates/blocks/components/TopNav/TopNavMultipleDropdowns.tsx
index fda97fd7f5..0f05cd2f0e 100644
--- a/packages/cli/templates/blocks/components/TopNav/TopNavMultipleDropdowns.tsx
+++ b/packages/cli/templates/blocks/components/TopNav/TopNavMultipleDropdowns.tsx
@@ -6,28 +6,25 @@ import {
XDSTopNavItem,
XDSTopNavMenu,
} from '@xds/core/TopNav';
-
-function ChartIcon() {
- return (
- <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5">
- <path strokeLinecap="round" strokeLinejoin="round" d="M3 13.125C3 12.504 3.504 12 4.125 12h2.25c.621 0 1.125.504 1.125 1.125v6.75C7.5 20.496 6.996 21 6.375 21h-2.25A1.125 1.125 0 0 1 3 19.875v-6.75ZM9.75 8.625c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125v11.25c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 0 1-1.125-1.125V8.625ZM16.5 4.125c0-.621.504-1.125 1.125-1.125h2.25C20.496 3 21 3.504 21 4.125v15.75c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 0 1-1.125-1.125V4.125Z" />
- </svg>
- );
-}
-
-function ShieldIcon() {
- return (
- <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5">
- <path strokeLinecap="round" strokeLinejoin="round" d="M9 12.75 11.25 15 15 9.75m-3-7.036A11.959 11.959 0 0 1 3.598 6 11.99 11.99 0 0 0 3 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285Z" />
- </svg>
- );
-}
+import {XDSNavIcon} from '@xds/core/NavIcon';
+import {XDSIcon} from '@xds/core/Icon';
+import {
+ CubeIcon,
+ ChartBarIcon,
+ ShieldCheckIcon,
+} from '@heroicons/react/24/outline';
export default function TopNavMultipleDropdowns() {
return (
<XDSTopNav
label="Main navigation"
- heading={<XDSTopNavHeading heading="Platform" href="#" />}
+ heading={
+ <XDSTopNavHeading
+ heading="My App"
+ logo={<XDSNavIcon icon={<XDSIcon icon={CubeIcon} size="sm" />} />}
+ href="#"
+ />
+ }
startContent={
<>
<XDSTopNavMenu
@@ -36,13 +33,13 @@ export default function TopNavMultipleDropdowns() {
{
title: 'Analytics',
description: 'Track behavior',
- icon: <ChartIcon />,
+ icon: <ChartBarIcon />,
href: '#',
},
{
title: 'Security',
description: 'Enterprise protection',
- icon: <ShieldIcon />,
+ icon: <ShieldCheckIcon />,
href: '#',
},
]}
diff --git a/packages/cli/templates/blocks/components/TopNav/TopNavShowcase.tsx b/packages/cli/templates/blocks/components/TopNav/TopNavShowcase.tsx
index c0507b46c7..22de9322aa 100644
--- a/packages/cli/templates/blocks/components/TopNav/TopNavShowcase.tsx
+++ b/packages/cli/templates/blocks/components/TopNav/TopNavShowcase.tsx
@@ -1,30 +1,22 @@
'use client';
import {XDSTopNav, XDSTopNavHeading, XDSTopNavItem} from '@xds/core/TopNav';
+import {XDSNavIcon} from '@xds/core/NavIcon';
import {XDSButton} from '@xds/core/Button';
import {XDSIcon} from '@xds/core/Icon';
-
-function BellIcon() {
- return (
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5">
- <path strokeLinecap="round" strokeLinejoin="round" d="M14.857 17.082a23.848 23.848 0 0 0 5.454-1.31A8.967 8.967 0 0 1 18 9.75V9A6 6 0 0 0 6 9v.75a8.967 8.967 0 0 1-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 0 1-5.714 0m5.714 0a3 3 0 1 1-5.714 0" />
- </svg>
- );
-}
-
-function UserIcon() {
- return (
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5">
- <path strokeLinecap="round" strokeLinejoin="round" d="M17.982 18.725A7.488 7.488 0 0 0 12 15.75a7.488 7.488 0 0 0-5.982 2.975m11.963 0a9 9 0 1 0-11.963 0m11.963 0A8.966 8.966 0 0 1 12 21a8.966 8.966 0 0 1-5.982-2.275M15 9.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z" />
- </svg>
- );
-}
+import {BellIcon, CubeIcon, UserCircleIcon} from '@heroicons/react/24/outline';
export default function TopNavShowcase() {
return (
<XDSTopNav
+ style={{width: 600}}
label="Main navigation"
- heading={<XDSTopNavHeading heading="My App" />}
+ heading={
+ <XDSTopNavHeading
+ heading="My App"
+ logo={<XDSNavIcon icon={<XDSIcon icon={CubeIcon} size="sm" />} />}
+ />
+ }
startContent={
<>
<XDSTopNavItem label="Home" href="#" isSelected />
@@ -49,7 +41,7 @@ export default function TopNavShowcase() {
<XDSButton
label="Profile"
variant="ghost"
- icon={<UserIcon />}
+ icon={<UserCircleIcon />}
isIconOnly
/>
</>
diff --git a/packages/cli/templates/blocks/components/TopNav/TopNavWithLogo.doc.mjs b/packages/cli/templates/blocks/components/TopNav/TopNavWithLogo.doc.mjs
index 4032bbb782..2f07bd6b54 100644
--- a/packages/cli/templates/blocks/components/TopNav/TopNavWithLogo.doc.mjs
+++ b/packages/cli/templates/blocks/components/TopNav/TopNavWithLogo.doc.mjs
@@ -6,6 +6,6 @@ export const doc = {
description:
'Navigation bar with a branded logo icon, heading link, nav items, and a profile action.',
isReady: true,
- aspectRatio: 4 / 3,
+ aspectRatio: 16 / 9,
componentsUsed: ['TopNav', 'NavIcon', 'Button'],
};
diff --git a/packages/cli/templates/blocks/components/TopNav/TopNavWithLogo.tsx b/packages/cli/templates/blocks/components/TopNav/TopNavWithLogo.tsx
index 9c83d19c59..b3d0c985d7 100644
--- a/packages/cli/templates/blocks/components/TopNav/TopNavWithLogo.tsx
+++ b/packages/cli/templates/blocks/components/TopNav/TopNavWithLogo.tsx
@@ -3,23 +3,8 @@
import {XDSTopNav, XDSTopNavHeading, XDSTopNavItem} from '@xds/core/TopNav';
import {XDSNavIcon} from '@xds/core/NavIcon';
import {XDSButton} from '@xds/core/Button';
-
-function CubeIcon() {
- return (
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5">
- <path strokeLinecap="round" strokeLinejoin="round" d="M21 16.5V7.914a1.5 1.5 0 0 0-.75-1.299l-7.5-4.329a1.5 1.5 0 0 0-1.5 0l-7.5 4.33A1.5 1.5 0 0 0 3 7.913V16.5a1.5 1.5 0 0 0 .75 1.3l7.5 4.328a1.5 1.5 0 0 0 1.5 0l7.5-4.329A1.5 1.5 0 0 0 21 16.5Z" />
- <path strokeLinecap="round" strokeLinejoin="round" d="m3.75 7.5 8.25 4.764 8.25-4.764M12 22.089V12.264" />
- </svg>
- );
-}
-
-function UserIcon() {
- return (
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5">
- <path strokeLinecap="round" strokeLinejoin="round" d="M17.982 18.725A7.488 7.488 0 0 0 12 15.75a7.488 7.488 0 0 0-5.982 2.975m11.963 0a9 9 0 1 0-11.963 0m11.963 0A8.966 8.966 0 0 1 12 21a8.966 8.966 0 0 1-5.982-2.275M15 9.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z" />
- </svg>
- );
-}
+import {XDSIcon} from '@xds/core/Icon';
+import {CubeIcon, UserCircleIcon} from '@heroicons/react/24/outline';
export default function TopNavWithLogo() {
return (
@@ -27,8 +12,8 @@ export default function TopNavWithLogo() {
label="Main navigation"
heading={
<XDSTopNavHeading
- heading="Dashboard"
- logo={<XDSNavIcon icon={<CubeIcon />} />}
+ heading="My App"
+ logo={<XDSNavIcon icon={<XDSIcon icon={CubeIcon} size="sm" />} />}
href="#"
/>
}
@@ -43,7 +28,7 @@ export default function TopNavWithLogo() {
<XDSButton
label="Profile"
variant="ghost"
- icon={<UserIcon />}
+ icon={<UserCircleIcon />}
isIconOnly
/>
}
diff --git a/packages/cli/templates/blocks/components/TopNavHeading/TopNavHeadingShowcase.tsx b/packages/cli/templates/blocks/components/TopNavHeading/TopNavHeadingShowcase.tsx
index f064a9beb6..0f3dc83b4a 100644
--- a/packages/cli/templates/blocks/components/TopNavHeading/TopNavHeadingShowcase.tsx
+++ b/packages/cli/templates/blocks/components/TopNavHeading/TopNavHeadingShowcase.tsx
@@ -2,11 +2,22 @@
import {XDSTopNav, XDSTopNavHeading} from '@xds/core/TopNav';
import {XDSVStack} from '@xds/core/Layout';
+import {XDSNavIcon} from '@xds/core/NavIcon';
function AppIcon() {
return (
- <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5">
- <path strokeLinecap="round" strokeLinejoin="round" d="M3.75 6A2.25 2.25 0 0 1 6 3.75h2.25A2.25 2.25 0 0 1 10.5 6v2.25a2.25 2.25 0 0 1-2.25 2.25H6a2.25 2.25 0 0 1-2.25-2.25V6ZM3.75 15.75A2.25 2.25 0 0 1 6 13.5h2.25a2.25 2.25 0 0 1 2.25 2.25V18a2.25 2.25 0 0 1-2.25 2.25H6A2.25 2.25 0 0 1 3.75 18v-2.25ZM13.5 6a2.25 2.25 0 0 1 2.25-2.25H18A2.25 2.25 0 0 1 20.25 6v2.25A2.25 2.25 0 0 1 18 10.5h-2.25a2.25 2.25 0 0 1-2.25-2.25V6ZM13.5 15.75a2.25 2.25 0 0 1 2.25-2.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-2.25a2.25 2.25 0 0 1-2.25-2.25v-2.25Z" />
+ <svg
+ width="20"
+ height="20"
+ viewBox="0 0 24 24"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth="1.5">
+ <path
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ d="M3.75 6A2.25 2.25 0 0 1 6 3.75h2.25A2.25 2.25 0 0 1 10.5 6v2.25a2.25 2.25 0 0 1-2.25 2.25H6a2.25 2.25 0 0 1-2.25-2.25V6ZM3.75 15.75A2.25 2.25 0 0 1 6 13.5h2.25a2.25 2.25 0 0 1 2.25 2.25V18a2.25 2.25 0 0 1-2.25 2.25H6A2.25 2.25 0 0 1 3.75 18v-2.25ZM13.5 6a2.25 2.25 0 0 1 2.25-2.25H18A2.25 2.25 0 0 1 20.25 6v2.25A2.25 2.25 0 0 1 18 10.5h-2.25a2.25 2.25 0 0 1-2.25-2.25V6ZM13.5 15.75a2.25 2.25 0 0 1 2.25-2.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-2.25a2.25 2.25 0 0 1-2.25-2.25v-2.25Z"
+ />
</svg>
);
}
@@ -19,7 +30,7 @@ export default function TopNavHeadingShowcase() {
heading={
<XDSTopNavHeading
heading="Acme Platform"
- logo={<AppIcon />}
+ logo={<XDSNavIcon icon={<AppIcon />} />}
/>
}
/>
diff --git a/packages/cli/templates/blocks/components/TopNavItem/TopNavItemShowcase.tsx b/packages/cli/templates/blocks/components/TopNavItem/TopNavItemShowcase.tsx
index fd834754c2..8e5c19004d 100644
--- a/packages/cli/templates/blocks/components/TopNavItem/TopNavItemShowcase.tsx
+++ b/packages/cli/templates/blocks/components/TopNavItem/TopNavItemShowcase.tsx
@@ -1,11 +1,22 @@
'use client';
import {XDSTopNav, XDSTopNavHeading, XDSTopNavItem} from '@xds/core/TopNav';
+import {XDSIcon} from '@xds/core/Icon';
function HomeIcon() {
return (
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5">
- <path strokeLinecap="round" strokeLinejoin="round" d="m2.25 12 8.954-8.955c.44-.439 1.152-.439 1.591 0L21.75 12M4.5 9.75v10.125c0 .621.504 1.125 1.125 1.125H9.75v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21h4.125c.621 0 1.125-.504 1.125-1.125V9.75M8.25 21h8.25" />
+ <svg
+ width="16"
+ height="16"
+ viewBox="0 0 24 24"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth="1.5">
+ <path
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ d="m2.25 12 8.954-8.955c.44-.439 1.152-.439 1.591 0L21.75 12M4.5 9.75v10.125c0 .621.504 1.125 1.125 1.125H9.75v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21h4.125c.621 0 1.125-.504 1.125-1.125V9.75M8.25 21h8.25"
+ />
</svg>
);
}
@@ -13,16 +24,23 @@ function HomeIcon() {
export default function TopNavItemShowcase() {
return (
<XDSTopNav
+ style={{width: 600}}
label="Navigation items demo"
heading={<XDSTopNavHeading heading="App" />}
startContent={
<>
- <XDSTopNavItem label="Dashboard" href="#" isSelected icon={<HomeIcon />} />
+ <XDSTopNavItem
+ label="Dashboard"
+ href="#"
+ isSelected
+ icon={<HomeIcon />}
+ />
<XDSTopNavItem label="Projects" href="#" />
<XDSTopNavItem label="Reports" href="#" />
<XDSTopNavItem label="Archived" href="#" isDisabled />
</>
}
+ endContent={<XDSIcon icon="search" />}
/>
);
}
diff --git a/packages/cli/templates/blocks/components/TopNavMegaMenu/TopNavMegaMenuShowcase.tsx b/packages/cli/templates/blocks/components/TopNavMegaMenu/TopNavMegaMenuShowcase.tsx
index c19715dab1..17c2083541 100644
--- a/packages/cli/templates/blocks/components/TopNavMegaMenu/TopNavMegaMenuShowcase.tsx
+++ b/packages/cli/templates/blocks/components/TopNavMegaMenu/TopNavMegaMenuShowcase.tsx
@@ -8,42 +8,18 @@ import {
XDSTopNavMegaMenuItem,
XDSTopNavMegaMenuFeaturedCard,
} from '@xds/core/TopNav';
-
-function RocketIcon() {
- return (
- <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5">
- <path strokeLinecap="round" strokeLinejoin="round" d="M15.59 14.37a6 6 0 0 1-5.84 7.38v-4.8m5.84-2.58a14.98 14.98 0 0 0 6.16-12.12A14.98 14.98 0 0 0 9.631 8.41m5.96 5.96a14.926 14.926 0 0 1-5.841 2.58m-.119-8.54a6 6 0 0 0-7.381 5.84h4.8m2.58-5.84a14.927 14.927 0 0 0-2.58 5.84m2.699 2.7c-.103.021-.207.041-.311.06a15.09 15.09 0 0 1-2.448-2.448 14.9 14.9 0 0 1 .06-.312m-2.24 2.39a4.493 4.493 0 0 0-1.757 4.306 4.493 4.493 0 0 0 4.306-1.758M16.5 9a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z" />
- </svg>
- );
-}
-
-function BookIcon() {
- return (
- <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5">
- <path strokeLinecap="round" strokeLinejoin="round" d="M12 6.042A8.967 8.967 0 0 0 6 3.75c-1.052 0-2.062.18-3 .512v14.25A8.987 8.987 0 0 1 6 18c2.305 0 4.408.867 6 2.292m0-14.25a8.966 8.966 0 0 1 6-2.292c1.052 0 2.062.18 3 .512v14.25A8.987 8.987 0 0 0 18 18a8.967 8.967 0 0 0-6 2.292m0-14.25v14.25" />
- </svg>
- );
-}
-
-function CodeIcon() {
- return (
- <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5">
- <path strokeLinecap="round" strokeLinejoin="round" d="M17.25 6.75 22.5 12l-5.25 5.25m-10.5 0L1.5 12l5.25-5.25m7.5-3-4.5 16.5" />
- </svg>
- );
-}
-
-function ShieldIcon() {
- return (
- <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5">
- <path strokeLinecap="round" strokeLinejoin="round" d="M9 12.75 11.25 15 15 9.75m-3-7.036A11.959 11.959 0 0 1 3.598 6 11.99 11.99 0 0 0 3 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285Z" />
- </svg>
- );
-}
+import {
+ RocketLaunchIcon,
+ BookOpenIcon,
+ CodeBracketIcon,
+ ShieldCheckIcon,
+ MagnifyingGlassIcon,
+} from '@heroicons/react/24/outline';
export default function TopNavMegaMenuShowcase() {
return (
<XDSTopNav
+ style={{width: 600}}
label="Mega menu demo"
heading={<XDSTopNavHeading heading="DevTools" />}
startContent={
@@ -56,25 +32,25 @@ export default function TopNavMegaMenuShowcase() {
<XDSTopNavMegaMenuItem
title="Deploy"
description="Ship to production in seconds"
- icon={<RocketIcon />}
+ icon={<RocketLaunchIcon width={20} height={20} />}
href="#deploy"
/>
<XDSTopNavMegaMenuItem
title="Documentation"
description="Guides, references, and tutorials"
- icon={<BookIcon />}
+ icon={<BookOpenIcon width={20} height={20} />}
href="#docs"
/>
<XDSTopNavMegaMenuItem
title="API"
description="Programmatic access to all features"
- icon={<CodeIcon />}
+ icon={<CodeBracketIcon width={20} height={20} />}
href="#api"
/>
<XDSTopNavMegaMenuItem
title="Security"
description="Enterprise-grade protection"
- icon={<ShieldIcon />}
+ icon={<ShieldCheckIcon width={20} height={20} />}
href="#security"
/>
</>
@@ -90,6 +66,7 @@ export default function TopNavMegaMenuShowcase() {
/>
</>
}
+ endContent={<MagnifyingGlassIcon width={20} height={20} />}
/>
);
}
diff --git a/packages/cli/templates/blocks/components/TopNavMenu/TopNavMenuShowcase.tsx b/packages/cli/templates/blocks/components/TopNavMenu/TopNavMenuShowcase.tsx
index 251d63f0c5..228b5709ed 100644
--- a/packages/cli/templates/blocks/components/TopNavMenu/TopNavMenuShowcase.tsx
+++ b/packages/cli/templates/blocks/components/TopNavMenu/TopNavMenuShowcase.tsx
@@ -6,35 +6,18 @@ import {
XDSTopNavItem,
XDSTopNavMenu,
} from '@xds/core/TopNav';
-
-function ChartIcon() {
- return (
- <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5">
- <path strokeLinecap="round" strokeLinejoin="round" d="M3 13.125C3 12.504 3.504 12 4.125 12h2.25c.621 0 1.125.504 1.125 1.125v6.75C7.5 20.496 6.996 21 6.375 21h-2.25A1.125 1.125 0 0 1 3 19.875v-6.75ZM9.75 8.625c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125v11.25c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 0 1-1.125-1.125V8.625ZM16.5 4.125c0-.621.504-1.125 1.125-1.125h2.25C20.496 3 21 3.504 21 4.125v15.75c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 0 1-1.125-1.125V4.125Z" />
- </svg>
- );
-}
-
-function UsersIcon() {
- return (
- <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5">
- <path strokeLinecap="round" strokeLinejoin="round" d="M15 19.128a9.38 9.38 0 0 0 2.625.372 9.337 9.337 0 0 0 4.121-.952 4.125 4.125 0 0 0-7.533-2.493M15 19.128v-.003c0-1.113-.285-2.16-.786-3.07M15 19.128v.106A12.318 12.318 0 0 1 8.624 21c-2.331 0-4.512-.645-6.374-1.766l-.001-.109a6.375 6.375 0 0 1 11.964-3.07M12 6.375a3.375 3.375 0 1 1-6.75 0 3.375 3.375 0 0 1 6.75 0Zm8.25 2.25a2.625 2.625 0 1 1-5.25 0 2.625 2.625 0 0 1 5.25 0Z" />
- </svg>
- );
-}
-
-function CogIcon() {
- return (
- <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5">
- <path strokeLinecap="round" strokeLinejoin="round" d="M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 0 1 1.37.49l1.296 2.247a1.125 1.125 0 0 1-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a7.723 7.723 0 0 1 0 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 0 1-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.47 6.47 0 0 1-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.212-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 0 1-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 0 1-1.369-.49l-1.297-2.247a1.125 1.125 0 0 1 .26-1.431l1.004-.827c.292-.24.437-.613.43-.991a6.932 6.932 0 0 1 0-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 0 1-.26-1.43l1.297-2.247a1.125 1.125 0 0 1 1.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.086.22-.128.332-.183.582-.495.644-.869l.214-1.28Z" />
- <path strokeLinecap="round" strokeLinejoin="round" d="M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z" />
- </svg>
- );
-}
+import {XDSButton} from '@xds/core/Button';
+import {
+ ChartBarIcon,
+ Cog6ToothIcon,
+ MagnifyingGlassIcon,
+ UsersIcon,
+} from '@heroicons/react/24/outline';
export default function TopNavMenuShowcase() {
return (
<XDSTopNav
+ style={{width: 600}}
label="Menu demo"
heading={<XDSTopNavHeading heading="Platform" />}
startContent={
@@ -46,7 +29,7 @@ export default function TopNavMenuShowcase() {
{
title: 'Analytics',
description: 'View traffic and engagement metrics',
- icon: <ChartIcon />,
+ icon: <ChartBarIcon />,
href: '#analytics',
},
{
@@ -58,13 +41,21 @@ export default function TopNavMenuShowcase() {
{
title: 'Settings',
description: 'Configure your workspace',
- icon: <CogIcon />,
+ icon: <Cog6ToothIcon />,
href: '#settings',
},
]}
/>
</>
}
+ endContent={
+ <XDSButton
+ label="Search"
+ variant="ghost"
+ icon={<MagnifyingGlassIcon />}
+ isIconOnly
+ />
+ }
/>
);
}
diff --git a/packages/cli/templates/blocks/components/TreeListItem/TreeListItemShowcase.tsx b/packages/cli/templates/blocks/components/TreeListItem/TreeListItemShowcase.tsx
index 9e37423ec1..2dede9ffd2 100644
--- a/packages/cli/templates/blocks/components/TreeListItem/TreeListItemShowcase.tsx
+++ b/packages/cli/templates/blocks/components/TreeListItem/TreeListItemShowcase.tsx
@@ -3,97 +3,56 @@
import {XDSTreeList} from '@xds/core/TreeList';
import {XDSBadge} from '@xds/core/Badge';
import {XDSIcon} from '@xds/core/Icon';
-import {XDSStack} from '@xds/core/Layout';
-import {XDSText} from '@xds/core/Text';
const noop = () => {};
export default function TreeListItemShowcase() {
return (
- <XDSStack direction="vertical" gap={4}>
- <XDSStack direction="vertical" gap={1}>
- <XDSText type="supporting" color="secondary">
- Items with descriptions, icons, badges, and states
- </XDSText>
- <XDSTreeList
- items={[
+ <XDSTreeList
+ style={{width: 400}}
+ items={[
+ {
+ id: 'inbox',
+ label: 'Inbox',
+ description: '12 unread messages',
+ isExpanded: true,
+ startContent: <XDSIcon icon="info" size="sm" />,
+ endContent: <XDSBadge label="12" variant="info" />,
+ children: [
{
- id: 'inbox',
- label: 'Inbox',
- description: '12 unread messages',
- startContent: <XDSIcon icon="info" size="sm" />,
- endContent: <XDSBadge label="12" variant="info" />,
- onClick: noop,
- },
- {
- id: 'drafts',
- label: 'Drafts',
- description: '3 draft messages',
- startContent: <XDSIcon icon="clock" size="sm" />,
- onClick: noop,
- },
- {
- id: 'sent',
- label: 'Sent',
+ id: 'primary',
+ label: 'Primary',
isSelected: true,
startContent: <XDSIcon icon="check" size="sm" />,
onClick: noop,
},
{
- id: 'archive',
- label: 'Archive',
+ id: 'updates',
+ label: 'Updates',
+ endContent: <XDSBadge label="4" variant="info" />,
onClick: noop,
},
- {
- id: 'spam',
- label: 'Spam',
- isDisabled: true,
- startContent: <XDSIcon icon="warning" size="sm" />,
- },
- ]}
- />
- </XDSStack>
-
- <XDSStack direction="vertical" gap={1}>
- <XDSText type="supporting" color="secondary">
- Nested items with expand/collapse
- </XDSText>
- <XDSTreeList
- items={[
- {
- id: 'src',
- label: 'src',
- isExpanded: true,
- children: [
- {
- id: 'components',
- label: 'components',
- isExpanded: true,
- children: [
- {id: 'button', label: 'Button.tsx', onClick: noop},
- {id: 'input', label: 'Input.tsx', onClick: noop},
- ],
- },
- {id: 'app', label: 'App.tsx', onClick: noop},
- {id: 'index', label: 'index.tsx', onClick: noop},
- ],
- },
- {
- id: 'tests',
- label: 'tests',
- children: [
- {id: 'button-test', label: 'Button.test.tsx'},
- ],
- },
- {id: 'pkg', label: 'package.json', onClick: noop},
- ]}
- />
- </XDSStack>
-
- <XDSText type="supporting" color="secondary">
- Note: TreeList is data-driven — items are configured via the items prop.
- There is no composed children API; XDSTreeListItem is an internal rendering detail.
- </XDSText>
- </XDSStack>
+ ],
+ },
+ {
+ id: 'drafts',
+ label: 'Drafts',
+ description: '3 draft messages',
+ startContent: <XDSIcon icon="clock" size="sm" />,
+ onClick: noop,
+ },
+ {
+ id: 'archive',
+ label: 'Archive',
+ onClick: noop,
+ },
+ {
+ id: 'spam',
+ label: 'Spam',
+ isDisabled: true,
+ startContent: <XDSIcon icon="warning" size="sm" />,
+ },
+ ]}
+ />
);
}