Skip to content

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

TypeScript

fix(sandbox) App shell block updates (#1933)

Kenton Quatmane926ad0ffcd8
diff --git a/apps/sandbox/src/app/(fullscreen)/BlockDocContext.tsx b/apps/sandbox/src/app/(fullscreen)/BlockDocContext.tsx
index 3b931b52dc..db8a69e538 100644
--- a/apps/sandbox/src/app/(fullscreen)/BlockDocContext.tsx
+++ b/apps/sandbox/src/app/(fullscreen)/BlockDocContext.tsx
@@ -14,7 +14,9 @@ export interface BlockDocMeta {
export function ShowcasePreview({children}: {children: React.ReactNode}) {
return (
<XDSCenter width="100%" height="100vh">
- <XDSCard variant="muted" style={{width: '100%', maxWidth: 968, height: 360}}>
+ <XDSCard
+ variant="muted"
+ style={{width: '100%', maxWidth: 968, height: 360}}>
<XDSCenter width="100%" height="100%">
{children}
</XDSCenter>
@@ -34,9 +36,15 @@ export function BlockPreview({
const scale = meta.scale;
return (
- <XDSCenter style={{flex: 1, overflow: 'auto', padding: 24, backgroundColor: 'var(--color-background-wash)'}}>
+ <XDSCenter style={{flex: 1, overflow: 'auto', padding: 24}}>
<XDSVStack gap={2} style={{width: '100%', maxWidth: 600}}>
- <XDSCard padding={5} style={{overflow: 'hidden'}}>
+ <div
+ style={{
+ border: '1px solid var(--color-border-emphasized)',
+ borderRadius: 'var(--radius-container)',
+ overflow: 'clip',
+ padding: 0,
+ }}>
<XDSAspectRatio ratio={ar}>
<XDSCenter
width="100%"
@@ -48,7 +56,7 @@ export function BlockPreview({
{children}
</XDSCenter>
</XDSAspectRatio>
- </XDSCard>
+ </div>
<XDSVStack gap={0} style={{textAlign: 'center'}}>
<XDSText type="supporting" color="secondary">
aspect-ratio:{' '}
diff --git a/packages/cli/templates/blocks/components/AppShell/AppShellContentOnly.doc.mjs b/packages/cli/templates/blocks/components/AppShell/AppShellContentOnly.doc.mjs
index 3676d631ef..353eba34ba 100644
--- a/packages/cli/templates/blocks/components/AppShell/AppShellContentOnly.doc.mjs
+++ b/packages/cli/templates/blocks/components/AppShell/AppShellContentOnly.doc.mjs
@@ -6,5 +6,5 @@ export const doc = {
'Minimal shell with no navigation, useful for full-bleed pages, auth screens, or embedded views.',
isReady: true,
aspectRatio: 4 / 3,
- componentsUsed: ['AppShell', 'Text'],
+ componentsUsed: ['AppShell', 'Heading', 'Text', 'VStack'],
};
diff --git a/packages/cli/templates/blocks/components/AppShell/AppShellContentOnly.tsx b/packages/cli/templates/blocks/components/AppShell/AppShellContentOnly.tsx
index fad473b279..dedfa91ad0 100644
--- a/packages/cli/templates/blocks/components/AppShell/AppShellContentOnly.tsx
+++ b/packages/cli/templates/blocks/components/AppShell/AppShellContentOnly.tsx
@@ -1,17 +1,28 @@
'use client';
import {XDSAppShell} from '@xds/core/AppShell';
-import {XDSText} from '@xds/core/Text';
+import {XDSVStack} from '@xds/core/Stack';
+import {XDSHeading, XDSText} from '@xds/core/Text';
+import stylex from '@stylexjs/stylex';
+
+const styles = stylex.create({
+ fit: {
+ height: '100%',
+ minHeight: 0,
+ },
+});
export default function AppShellContentOnly() {
return (
- <XDSAppShell contentPadding={6}>
- <XDSText type="large">Page Content</XDSText>
- <XDSText type="body">
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod
- tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
- veniam, quis nostrud exercitation ullamco laboris.
- </XDSText>
+ <XDSAppShell contentPadding={6} xstyle={styles.fit}>
+ <XDSVStack gap={4}>
+ <XDSHeading level={3}>Page Content</XDSHeading>
+ <XDSText type="body">
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do
+ eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
+ minim veniam, quis nostrud exercitation ullamco laboris.
+ </XDSText>
+ </XDSVStack>
</XDSAppShell>
);
}
diff --git a/packages/cli/templates/blocks/components/AppShell/AppShellShowcase.doc.mjs b/packages/cli/templates/blocks/components/AppShell/AppShellShowcase.doc.mjs
index 1f804633a3..ecf4409b02 100644
--- a/packages/cli/templates/blocks/components/AppShell/AppShellShowcase.doc.mjs
+++ b/packages/cli/templates/blocks/components/AppShell/AppShellShowcase.doc.mjs
@@ -7,5 +7,5 @@ export const doc = {
isShowcase: true,
description:
'A basic app shell with content padding.',
- componentsUsed: ['AppShell', 'Text'],
+ componentsUsed: ['AppShell', 'SideNav', 'Heading', 'Text', 'VStack', 'NavIcon'],
};
diff --git a/packages/cli/templates/blocks/components/AppShell/AppShellShowcase.tsx b/packages/cli/templates/blocks/components/AppShell/AppShellShowcase.tsx
index 8a9053e3be..68cea0e2a7 100644
--- a/packages/cli/templates/blocks/components/AppShell/AppShellShowcase.tsx
+++ b/packages/cli/templates/blocks/components/AppShell/AppShellShowcase.tsx
@@ -1,12 +1,70 @@
'use client';
import {XDSAppShell} from '@xds/core/AppShell';
-import {XDSText} from '@xds/core/Text';
+import {XDSVStack} from '@xds/core/Stack';
+import {XDSHeading, XDSText} from '@xds/core/Text';
+import {XDSNavIcon} from '@xds/core/NavIcon';
+import {
+ XDSSideNav,
+ XDSSideNavHeading,
+ XDSSideNavItem,
+ XDSSideNavSection,
+} from '@xds/core/SideNav';
+import {
+ ChartBarIcon,
+ DocumentTextIcon,
+ UsersIcon,
+} from '@heroicons/react/24/outline';
+import {HomeIcon} from '@heroicons/react/24/solid';
+import {CubeIcon} from '@heroicons/react/24/outline';
+import stylex from '@stylexjs/stylex';
+
+const styles = stylex.create({
+ fit: {
+ height: '100%',
+ minHeight: 0,
+ width: '100%',
+ },
+});
export default function AppShellShowcase() {
return (
- <XDSAppShell contentPadding={6}>
- <XDSText type="large">Page Content</XDSText>
+ <XDSAppShell
+ contentPadding={6}
+ xstyle={styles.fit}
+ sideNav={
+ <XDSSideNav
+ header={
+ <XDSSideNavHeading
+ icon={
+ <XDSNavIcon
+ icon={<CubeIcon style={{width: 16, height: 16}} />}
+ />
+ }
+ heading="App Shell"
+ headingHref="#"
+ />
+ }>
+ <XDSSideNavSection title="Main" isHeaderHidden>
+ <XDSSideNavItem label="Home" icon={HomeIcon} isSelected href="#" />
+ <XDSSideNavItem label="Reports" icon={ChartBarIcon} href="#" />
+ <XDSSideNavItem
+ label="Documents"
+ icon={DocumentTextIcon}
+ href="#"
+ />
+ <XDSSideNavItem label="Team" icon={UsersIcon} href="#" />
+ </XDSSideNavSection>
+ </XDSSideNav>
+ }>
+ <XDSVStack gap={4}>
+ <XDSHeading level={3}>Page Content</XDSHeading>
+ <XDSText type="body">
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do
+ eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
+ minim veniam, quis nostrud exercitation ullamco laboris.
+ </XDSText>
+ </XDSVStack>
</XDSAppShell>
);
}
diff --git a/packages/cli/templates/blocks/components/AppShell/AppShellSideNavOnly.doc.mjs b/packages/cli/templates/blocks/components/AppShell/AppShellSideNavOnly.doc.mjs
index de172af5ee..0297bfbd76 100644
--- a/packages/cli/templates/blocks/components/AppShell/AppShellSideNavOnly.doc.mjs
+++ b/packages/cli/templates/blocks/components/AppShell/AppShellSideNavOnly.doc.mjs
@@ -6,5 +6,5 @@ export const doc = {
'App shell with SideNav header providing app identity, no TopNav needed.',
isReady: true,
aspectRatio: 4 / 3,
- componentsUsed: ['AppShell', 'SideNav', 'Text', 'NavIcon'],
+ componentsUsed: ['AppShell', 'SideNav', 'Heading', 'Text', 'VStack', 'NavIcon'],
};
diff --git a/packages/cli/templates/blocks/components/AppShell/AppShellSideNavOnly.tsx b/packages/cli/templates/blocks/components/AppShell/AppShellSideNavOnly.tsx
index 8f22f477a5..32d4396684 100644
--- a/packages/cli/templates/blocks/components/AppShell/AppShellSideNavOnly.tsx
+++ b/packages/cli/templates/blocks/components/AppShell/AppShellSideNavOnly.tsx
@@ -1,7 +1,8 @@
'use client';
import {XDSAppShell} from '@xds/core/AppShell';
-import {XDSText} from '@xds/core/Text';
+import {XDSVStack} from '@xds/core/Stack';
+import {XDSHeading, XDSText} from '@xds/core/Text';
import {XDSNavIcon} from '@xds/core/NavIcon';
import {
XDSSideNav,
@@ -9,86 +10,65 @@ import {
XDSSideNavItem,
XDSSideNavSection,
} from '@xds/core/SideNav';
+import {
+ ChartBarIcon,
+ FolderIcon,
+ UsersIcon,
+ Cog6ToothIcon,
+} from '@heroicons/react/24/outline';
+import {HomeIcon} from '@heroicons/react/24/solid';
+import {CubeIcon} from '@heroicons/react/24/outline';
+import stylex from '@stylexjs/stylex';
-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 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 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 FolderIcon() {
- 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.75V12A2.25 2.25 0 0 1 4.5 9.75h15A2.25 2.25 0 0 1 21.75 12v.75m-8.69-6.44-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z" />
- </svg>
- );
-}
-
-function UsersIcon() {
- return (
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5">
- <path strokeLinecap="round" strokeLinejoin="round" d="M18 18.72a9.094 9.094 0 0 0 3.741-.479 3 3 0 0 0-4.682-2.72m.94 3.198.001.031c0 .225-.012.447-.037.666A11.944 11.944 0 0 1 12 21c-2.17 0-4.207-.576-5.963-1.584A6.062 6.062 0 0 1 6 18.719m12 0a5.971 5.971 0 0 0-.941-3.197m0 0A5.995 5.995 0 0 0 12 12.75a5.995 5.995 0 0 0-5.058 2.772m0 0a3 3 0 0 0-4.681 2.72 8.986 8.986 0 0 0 3.74.477m.94-3.197a5.971 5.971 0 0 0-.94 3.197M15 6.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm6 3a2.25 2.25 0 1 1-4.5 0 2.25 2.25 0 0 1 4.5 0Zm-13.5 0a2.25 2.25 0 1 1-4.5 0 2.25 2.25 0 0 1 4.5 0Z" />
- </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>
- );
-}
+const styles = stylex.create({
+ fit: {
+ height: '100%',
+ minHeight: 0,
+ },
+});
export default function AppShellSideNavOnly() {
return (
<XDSAppShell
contentPadding={6}
+ xstyle={styles.fit}
sideNav={
<XDSSideNav
header={
<XDSSideNavHeading
- icon={<XDSNavIcon icon={<CubeIcon />} />}
- heading="Acme App"
+ icon={
+ <XDSNavIcon
+ icon={<CubeIcon style={{width: 16, height: 16}} />}
+ />
+ }
+ heading="App Shell"
headingHref="#"
/>
}>
<XDSSideNavSection title="Main" isHeaderHidden>
- <XDSSideNavItem label="Dashboard" icon={HomeIcon} isSelected href="#" />
- <XDSSideNavItem label="Analytics" icon={ChartIcon} href="#" />
+ <XDSSideNavItem
+ label="Dashboard"
+ icon={HomeIcon}
+ isSelected
+ href="#"
+ />
+ <XDSSideNavItem label="Analytics" icon={ChartBarIcon} href="#" />
<XDSSideNavItem label="Projects" icon={FolderIcon} href="#" />
</XDSSideNavSection>
<XDSSideNavSection title="Organization">
<XDSSideNavItem label="Team" icon={UsersIcon} href="#" />
- <XDSSideNavItem label="Settings" icon={CogIcon} href="#" />
+ <XDSSideNavItem label="Settings" icon={Cog6ToothIcon} href="#" />
</XDSSideNavSection>
</XDSSideNav>
}>
- <XDSText type="large">Page Content</XDSText>
- <XDSText type="body">
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod
- tempor incididunt ut labore et dolore magna aliqua.
- </XDSText>
+ <XDSVStack gap={4}>
+ <XDSHeading level={3}>Page Content</XDSHeading>
+ <XDSText type="body">
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do
+ eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
+ minim veniam, quis nostrud exercitation ullamco laboris.
+ </XDSText>
+ </XDSVStack>
</XDSAppShell>
);
}
diff --git a/packages/cli/templates/blocks/components/AppShell/AppShellTopNavOnly.doc.mjs b/packages/cli/templates/blocks/components/AppShell/AppShellTopNavOnly.doc.mjs
index 1997661f0c..e95e5e1dc6 100644
--- a/packages/cli/templates/blocks/components/AppShell/AppShellTopNavOnly.doc.mjs
+++ b/packages/cli/templates/blocks/components/AppShell/AppShellTopNavOnly.doc.mjs
@@ -6,5 +6,5 @@ export const doc = {
'Simple layout with TopNav and no side navigation, suitable for landing pages.',
isReady: true,
aspectRatio: 4 / 3,
- componentsUsed: ['AppShell', 'TopNav', 'Text', 'NavIcon'],
+ componentsUsed: ['AppShell', 'TopNav', 'Heading', 'Text', 'VStack', 'NavIcon'],
};
diff --git a/packages/cli/templates/blocks/components/AppShell/AppShellTopNavOnly.tsx b/packages/cli/templates/blocks/components/AppShell/AppShellTopNavOnly.tsx
index 806ad4cce1..210093d88f 100644
--- a/packages/cli/templates/blocks/components/AppShell/AppShellTopNavOnly.tsx
+++ b/packages/cli/templates/blocks/components/AppShell/AppShellTopNavOnly.tsx
@@ -1,30 +1,36 @@
'use client';
import {XDSAppShell} from '@xds/core/AppShell';
-import {XDSText} from '@xds/core/Text';
+import {XDSVStack} from '@xds/core/Stack';
+import {XDSHeading, XDSText} from '@xds/core/Text';
import {XDSTopNav, XDSTopNavHeading, XDSTopNavItem} from '@xds/core/TopNav';
import {XDSNavIcon} from '@xds/core/NavIcon';
+import {CubeIcon} from '@heroicons/react/24/outline';
+import stylex from '@stylexjs/stylex';
-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>
- );
-}
+const styles = stylex.create({
+ fit: {
+ height: '100%',
+ minHeight: 0,
+ },
+});
export default function AppShellTopNavOnly() {
return (
<XDSAppShell
contentPadding={6}
+ xstyle={styles.fit}
topNav={
<XDSTopNav
label="Main navigation"
heading={
<XDSTopNavHeading
- heading="Acme App"
- logo={<XDSNavIcon icon={<CubeIcon />} />}
+ heading="App Shell"
+ logo={
+ <XDSNavIcon
+ icon={<CubeIcon style={{width: 16, height: 16}} />}
+ />
+ }
/>
}
startContent={
@@ -36,11 +42,14 @@ export default function AppShellTopNavOnly() {
}
/>
}>
- <XDSText type="large">Page Content</XDSText>
- <XDSText type="body">
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod
- tempor incididunt ut labore et dolore magna aliqua.
- </XDSText>
+ <XDSVStack gap={4}>
+ <XDSHeading level={3}>Page Content</XDSHeading>
+ <XDSText type="body">
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do
+ eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
+ minim veniam, quis nostrud exercitation ullamco laboris.
+ </XDSText>
+ </XDSVStack>
</XDSAppShell>
);
}
diff --git a/packages/cli/templates/blocks/components/AppShell/AppShellTopNavWithSideNav.doc.mjs b/packages/cli/templates/blocks/components/AppShell/AppShellTopNavWithSideNav.doc.mjs
index ce559bed79..5442a9d1f9 100644
--- a/packages/cli/templates/blocks/components/AppShell/AppShellTopNavWithSideNav.doc.mjs
+++ b/packages/cli/templates/blocks/components/AppShell/AppShellTopNavWithSideNav.doc.mjs
@@ -6,5 +6,5 @@ export const doc = {
'The most common layout with TopNav for app identity and SideNav for page-level navigation.',
isReady: true,
aspectRatio: 4 / 3,
- componentsUsed: ['AppShell', 'TopNav', 'SideNav', 'Text', 'NavIcon', 'Icon'],
+ componentsUsed: ['AppShell', 'TopNav', 'SideNav', 'Heading', 'Text', 'VStack', 'NavIcon'],
};
diff --git a/packages/cli/templates/blocks/components/AppShell/AppShellTopNavWithSideNav.tsx b/packages/cli/templates/blocks/components/AppShell/AppShellTopNavWithSideNav.tsx
index 74f81f3947..842ea992a6 100644
--- a/packages/cli/templates/blocks/components/AppShell/AppShellTopNavWithSideNav.tsx
+++ b/packages/cli/templates/blocks/components/AppShell/AppShellTopNavWithSideNav.tsx
@@ -1,77 +1,44 @@
'use client';
import {XDSAppShell} from '@xds/core/AppShell';
-import {XDSText} from '@xds/core/Text';
+import {XDSVStack} from '@xds/core/Stack';
+import {XDSHeading, XDSText} from '@xds/core/Text';
import {XDSTopNav, XDSTopNavHeading, XDSTopNavItem} from '@xds/core/TopNav';
import {XDSNavIcon} from '@xds/core/NavIcon';
+import {XDSSideNav, XDSSideNavItem, XDSSideNavSection} from '@xds/core/SideNav';
import {
- XDSSideNav,
- XDSSideNavItem,
- XDSSideNavSection,
-} from '@xds/core/SideNav';
+ ChartBarIcon,
+ FolderIcon,
+ UsersIcon,
+ Cog6ToothIcon,
+} from '@heroicons/react/24/outline';
+import {HomeIcon} from '@heroicons/react/24/solid';
+import {CubeIcon} from '@heroicons/react/24/outline';
+import stylex from '@stylexjs/stylex';
-
-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 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 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 FolderIcon() {
- 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.75V12A2.25 2.25 0 0 1 4.5 9.75h15A2.25 2.25 0 0 1 21.75 12v.75m-8.69-6.44-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z" />
- </svg>
- );
-}
-
-function UsersIcon() {
- return (
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5">
- <path strokeLinecap="round" strokeLinejoin="round" d="M18 18.72a9.094 9.094 0 0 0 3.741-.479 3 3 0 0 0-4.682-2.72m.94 3.198.001.031c0 .225-.012.447-.037.666A11.944 11.944 0 0 1 12 21c-2.17 0-4.207-.576-5.963-1.584A6.062 6.062 0 0 1 6 18.719m12 0a5.971 5.971 0 0 0-.941-3.197m0 0A5.995 5.995 0 0 0 12 12.75a5.995 5.995 0 0 0-5.058 2.772m0 0a3 3 0 0 0-4.681 2.72 8.986 8.986 0 0 0 3.74.477m.94-3.197a5.971 5.971 0 0 0-.94 3.197M15 6.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm6 3a2.25 2.25 0 1 1-4.5 0 2.25 2.25 0 0 1 4.5 0Zm-13.5 0a2.25 2.25 0 1 1-4.5 0 2.25 2.25 0 0 1 4.5 0Z" />
- </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>
- );
-}
+const styles = stylex.create({
+ fit: {
+ height: '100%',
+ minHeight: 0,
+ },
+});
export default function AppShellTopNavWithSideNav() {
return (
<XDSAppShell
contentPadding={6}
+ xstyle={styles.fit}
topNav={
<XDSTopNav
label="Main navigation"
heading={
<XDSTopNavHeading
- heading="Acme App"
- logo={<XDSNavIcon icon={<CubeIcon />} />}
+ heading="App Shell"
+ logo={
+ <XDSNavIcon
+ icon={<CubeIcon style={{width: 16, height: 16}} />}
+ />
+ }
/>
}
startContent={
@@ -86,21 +53,29 @@ export default function AppShellTopNavWithSideNav() {
sideNav={
<XDSSideNav>
<XDSSideNavSection title="Main" isHeaderHidden>
- <XDSSideNavItem label="Dashboard" icon={HomeIcon} isSelected href="#" />
- <XDSSideNavItem label="Analytics" icon={ChartIcon} href="#" />
+ <XDSSideNavItem
+ label="Dashboard"
+ icon={HomeIcon}
+ isSelected
+ href="#"
+ />
+ <XDSSideNavItem label="Analytics" icon={ChartBarIcon} href="#" />
<XDSSideNavItem label="Projects" icon={FolderIcon} href="#" />
</XDSSideNavSection>
<XDSSideNavSection title="Organization">
<XDSSideNavItem label="Team" icon={UsersIcon} href="#" />
- <XDSSideNavItem label="Settings" icon={CogIcon} href="#" />
+ <XDSSideNavItem label="Settings" icon={Cog6ToothIcon} href="#" />
</XDSSideNavSection>
</XDSSideNav>
}>
- <XDSText type="large">Page Content</XDSText>
- <XDSText type="body">
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod
- tempor incididunt ut labore et dolore magna aliqua.
- </XDSText>
+ <XDSVStack gap={4}>
+ <XDSHeading level={3}>Page Content</XDSHeading>
+ <XDSText type="body">
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do
+ eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
+ minim veniam, quis nostrud exercitation ullamco laboris.
+ </XDSText>
+ </XDSVStack>
</XDSAppShell>
);
}
diff --git a/packages/cli/templates/blocks/components/AppShell/AppShellWithBanner.doc.mjs b/packages/cli/templates/blocks/components/AppShell/AppShellWithBanner.doc.mjs
index 288e3a50bd..0f1b5be921 100644
--- a/packages/cli/templates/blocks/components/AppShell/AppShellWithBanner.doc.mjs
+++ b/packages/cli/templates/blocks/components/AppShell/AppShellWithBanner.doc.mjs
@@ -6,5 +6,5 @@ export const doc = {
'Full layout with TopNav, SideNav, and a dismissable info banner between the nav and content.',
isReady: true,
aspectRatio: 4 / 3,
- componentsUsed: ['AppShell', 'TopNav', 'SideNav', 'Banner', 'Text', 'NavIcon'],
+ componentsUsed: ['AppShell', 'TopNav', 'SideNav', 'Banner', 'Heading', 'Text', 'VStack', 'NavIcon'],
};
diff --git a/packages/cli/templates/blocks/components/AppShell/AppShellWithBanner.tsx b/packages/cli/templates/blocks/components/AppShell/AppShellWithBanner.tsx
index 3d254f4376..d7d2331a64 100644
--- a/packages/cli/templates/blocks/components/AppShell/AppShellWithBanner.tsx
+++ b/packages/cli/templates/blocks/components/AppShell/AppShellWithBanner.tsx
@@ -2,76 +2,44 @@
import {XDSAppShell} from '@xds/core/AppShell';
import {XDSBanner} from '@xds/core/Banner';
-import {XDSText} from '@xds/core/Text';
+import {XDSVStack} from '@xds/core/Stack';
+import {XDSHeading, XDSText} from '@xds/core/Text';
import {XDSTopNav, XDSTopNavHeading, XDSTopNavItem} from '@xds/core/TopNav';
import {XDSNavIcon} from '@xds/core/NavIcon';
+import {XDSSideNav, XDSSideNavItem, XDSSideNavSection} from '@xds/core/SideNav';
import {
- XDSSideNav,
- XDSSideNavItem,
- XDSSideNavSection,
-} from '@xds/core/SideNav';
+ ChartBarIcon,
+ FolderIcon,
+ UsersIcon,
+ Cog6ToothIcon,
+} from '@heroicons/react/24/outline';
+import {HomeIcon} from '@heroicons/react/24/solid';
+import {CubeIcon} from '@heroicons/react/24/outline';
+import stylex from '@stylexjs/stylex';
-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 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 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 FolderIcon() {
- 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.75V12A2.25 2.25 0 0 1 4.5 9.75h15A2.25 2.25 0 0 1 21.75 12v.75m-8.69-6.44-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z" />
- </svg>
- );
-}
-
-function UsersIcon() {
- return (
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5">
- <path strokeLinecap="round" strokeLinejoin="round" d="M18 18.72a9.094 9.094 0 0 0 3.741-.479 3 3 0 0 0-4.682-2.72m.94 3.198.001.031c0 .225-.012.447-.037.666A11.944 11.944 0 0 1 12 21c-2.17 0-4.207-.576-5.963-1.584A6.062 6.062 0 0 1 6 18.719m12 0a5.971 5.971 0 0 0-.941-3.197m0 0A5.995 5.995 0 0 0 12 12.75a5.995 5.995 0 0 0-5.058 2.772m0 0a3 3 0 0 0-4.681 2.72 8.986 8.986 0 0 0 3.74.477m.94-3.197a5.971 5.971 0 0 0-.94 3.197M15 6.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm6 3a2.25 2.25 0 1 1-4.5 0 2.25 2.25 0 0 1 4.5 0Zm-13.5 0a2.25 2.25 0 1 1-4.5 0 2.25 2.25 0 0 1 4.5 0Z" />
- </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>
- );
-}
+const styles = stylex.create({
+ fit: {
+ height: '100%',
+ minHeight: 0,
+ },
+});
export default function AppShellWithBanner() {
return (
<XDSAppShell
contentPadding={6}
+ xstyle={styles.fit}
topNav={
<XDSTopNav
label="Main navigation"
heading={
<XDSTopNavHeading
- heading="Acme App"
- logo={<XDSNavIcon icon={<CubeIcon />} />}
+ heading="App Shell"
+ logo={
+ <XDSNavIcon
+ icon={<CubeIcon style={{width: 16, height: 16}} />}
+ />
+ }
/>
}
startContent={
@@ -86,13 +54,18 @@ export default function AppShellWithBanner() {
sideNav={
<XDSSideNav>
<XDSSideNavSection title="Main" isHeaderHidden>
- <XDSSideNavItem label="Dashboard" icon={HomeIcon} isSelected href="#" />
- <XDSSideNavItem label="Analytics" icon={ChartIcon} href="#" />
+ <XDSSideNavItem
+ label="Dashboard"
+ icon={HomeIcon}
+ isSelected
+ href="#"
+ />
+ <XDSSideNavItem label="Analytics" icon={ChartBarIcon} href="#" />
<XDSSideNavItem label="Projects" icon={FolderIcon} href="#" />
</XDSSideNavSection>
<XDSSideNavSection title="Organization">
<XDSSideNavItem label="Team" icon={UsersIcon} href="#" />
- <XDSSideNavItem label="Settings" icon={CogIcon} href="#" />
+ <XDSSideNavItem label="Settings" icon={Cog6ToothIcon} href="#" />
</XDSSideNavSection>
</XDSSideNav>
}
@@ -105,11 +78,14 @@ export default function AppShellWithBanner() {
isDismissable
/>
}>
- <XDSText type="large">Page Content</XDSText>
- <XDSText type="body">
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod
- tempor incididunt ut labore et dolore magna aliqua.
- </XDSText>
+ <XDSVStack gap={4}>
+ <XDSHeading level={3}>Page Content</XDSHeading>
+ <XDSText type="body">
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do
+ eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
+ minim veniam, quis nostrud exercitation ullamco laboris.
+ </XDSText>
+ </XDSVStack>
</XDSAppShell>
);
}
diff --git a/packages/cli/templates/blocks/components/AspectRatio/AspectRatioImageGallery.tsx b/packages/cli/templates/blocks/components/AspectRatio/AspectRatioImageGallery.tsx
index aa753f60b9..47cd7b91a6 100644
--- a/packages/cli/templates/blocks/components/AspectRatio/AspectRatioImageGallery.tsx
+++ b/packages/cli/templates/blocks/components/AspectRatio/AspectRatioImageGallery.tsx
@@ -14,7 +14,7 @@ const images = [
export default function AspectRatioImageGallery() {
return (
- <XDSGrid columns={3} gap={4}>
+ <XDSGrid columns={3} gap={4} width="100%">
{images.map(({id, alt}) => (
<XDSAspectRatio key={id} ratio={4 / 3}>
<img