@astryxdesign/cli 0.1.4-canary.e67829d → 0.1.4-canary.e830adc

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/CHANGELOG.md +1 -2
  2. package/docs/getting-started.doc.mjs +0 -4
  3. package/docs/migration.doc.mjs +0 -134
  4. package/docs/styling.doc.mjs +0 -53
  5. package/docs/working-with-ai.doc.mjs +1 -1
  6. package/package.json +8 -13
  7. package/src/api/doctor.mjs +2 -13
  8. package/src/codemods/__tests__/registry.test.mjs +0 -1
  9. package/src/codemods/__tests__/runner.test.mjs +0 -38
  10. package/src/codemods/registry.mjs +0 -1
  11. package/src/codemods/runner.mjs +0 -2
  12. package/src/commands/agent-docs.mjs +5 -7
  13. package/src/commands/agent-docs.test.mjs +0 -33
  14. package/src/commands/build-theme.mjs +1 -2
  15. package/src/commands/build-theme.variants.test.mjs +18 -7
  16. package/src/commands/doctor.test.mjs +0 -34
  17. package/src/commands/init.mjs +1 -1
  18. package/src/commands/swizzle.mjs +0 -34
  19. package/src/commands/swizzle.routing.test.mjs +0 -67
  20. package/templates/blocks/components/AspectRatio/AspectRatioCircleImage.tsx +6 -1
  21. package/templates/blocks/components/AspectRatio/AspectRatioImageGallery.tsx +7 -2
  22. package/templates/blocks/components/AspectRatio/AspectRatioShowcase.tsx +5 -2
  23. package/templates/blocks/components/AspectRatio/AspectRatioSquareImage.tsx +6 -1
  24. package/templates/blocks/components/AspectRatio/AspectRatioWidescreen.tsx +6 -1
  25. package/templates/blocks/components/CodeBlock/CodeBlockTerminal.doc.mjs +1 -1
  26. package/templates/blocks/components/Collapsible/CollapsibleWithoutCard.tsx +23 -25
  27. package/templates/blocks/components/CommandPaletteGroup/CommandPaletteGroupShowcase.tsx +48 -27
  28. package/templates/blocks/components/CommandPaletteItem/CommandPaletteItemShowcase.tsx +54 -31
  29. package/templates/blocks/components/NavHeadingMenu/NavHeadingMenuShowcase.tsx +16 -18
  30. package/templates/pages/classic-gallery/page.tsx +1 -1
  31. package/templates/pages/dashboard/page.tsx +1 -1
  32. package/templates/pages/documentation/page.tsx +1 -1
  33. package/templates/pages/kanban-board/page.tsx +13 -37
  34. package/templates/pages/mixed-gallery/page.tsx +1 -1
  35. package/templates/pages/payment-form/page.tsx +6 -2
  36. package/templates/pages/product-detail/page.tsx +11 -3
  37. package/templates/pages/product-gallery/page.tsx +1 -1
  38. package/templates/pages/settings/page.tsx +1 -1
  39. package/templates/pages/side-gallery/page.tsx +1 -1
  40. package/templates/pages/table-page/page.tsx +1 -1
  41. package/templates/pages/table-page-chart/page.tsx +14 -4
  42. package/templates/pages/table-page-heatmap-status/page.tsx +1 -1
  43. package/templates/pages/table-page-shoe-store-heatmap/page.tsx +19 -5
  44. package/src/codemods/transforms/v0.1.5/__tests__/rename-switch-label-spacing-default-to-hug.test.mjs +0 -93
  45. package/src/codemods/transforms/v0.1.5/index.mjs +0 -19
  46. package/src/codemods/transforms/v0.1.5/rename-switch-label-spacing-default-to-hug.mjs +0 -140
  47. package/src/commands/build-theme.color-scheme.test.mjs +0 -153
  48. package/templates/blocks/components/Collapsible/CollapsibleDividedAccordion.doc.mjs +0 -13
  49. package/templates/blocks/components/Collapsible/CollapsibleDividedAccordion.tsx +0 -33
  50. package/templates/blocks/components/CommandPaletteInput/CommandPaletteInputBasic.doc.mjs +0 -15
  51. package/templates/blocks/components/CommandPaletteInput/CommandPaletteInputBasic.tsx +0 -39
  52. package/templates/blocks/components/CommandPaletteInput/CommandPaletteInputShowcase.doc.mjs +0 -15
  53. package/templates/blocks/components/CommandPaletteInput/CommandPaletteInputShowcase.tsx +0 -39
  54. package/templates/blocks/components/CommandPaletteList/CommandPaletteListBasic.doc.mjs +0 -15
  55. package/templates/blocks/components/CommandPaletteList/CommandPaletteListBasic.tsx +0 -27
  56. package/templates/blocks/components/CommandPaletteList/CommandPaletteListShowcase.doc.mjs +0 -15
  57. package/templates/blocks/components/CommandPaletteList/CommandPaletteListShowcase.tsx +0 -38
  58. package/templates/blocks/components/ContextMenuItem/ContextMenuItemBasic.doc.mjs +0 -14
  59. package/templates/blocks/components/ContextMenuItem/ContextMenuItemBasic.tsx +0 -44
  60. package/templates/blocks/components/ContextMenuItem/ContextMenuItemShowcase.doc.mjs +0 -15
  61. package/templates/blocks/components/ContextMenuItem/ContextMenuItemShowcase.tsx +0 -107
  62. package/templates/pages/incident-console/page.tsx +0 -580
  63. package/templates/pages/incident-console/template.doc.mjs +0 -12
  64. package/templates/pages/messaging-shell/page.tsx +0 -676
  65. package/templates/pages/messaging-shell/template.doc.mjs +0 -12
@@ -26,7 +26,6 @@ import {jsonOut, humanLog} from '../lib/json.mjs';
26
26
  import {cliError} from '../lib/cli-error.mjs';
27
27
  import {ERROR_CODES} from '../lib/error-codes.mjs';
28
28
  import {checkGhCli} from '../utils/github.mjs';
29
- import {getRunPrefix} from '../utils/package-manager.mjs';
30
29
  import {Project} from '../lib/project.mjs';
31
30
  import {
32
31
  CORE_PACKAGE,
@@ -340,10 +339,6 @@ export function registerSwizzle(program) {
340
339
  // Copy all non-test, non-doc, non-README files
341
340
  const files = fs.readdirSync(componentDir);
342
341
  let copied = 0;
343
- // Track whether any copied source uses StyleX. Swizzled StyleX source
344
- // needs a build-time StyleX compiler in the consumer's app or it renders
345
- // unstyled with no error — so we surface a setup note after copying.
346
- let usesStyleX = false;
347
342
 
348
343
  for (const file of files) {
349
344
  // Skip test files, doc files, and README
@@ -360,13 +355,6 @@ export function registerSwizzle(program) {
360
355
  content = rewriteImports(content, owner.ownerPackage);
361
356
  }
362
357
 
363
- if (
364
- (file.endsWith('.ts') || file.endsWith('.tsx')) &&
365
- content.includes('@stylexjs/stylex')
366
- ) {
367
- usesStyleX = true;
368
- }
369
-
370
358
  fs.writeFileSync(path.join(outputDir, file), content);
371
359
  copied++;
372
360
  }
@@ -388,7 +376,6 @@ export function registerSwizzle(program) {
388
376
  outputDir: relOutput,
389
377
  filesCopied: copied,
390
378
  files: copiedFiles.map(f => f),
391
- usesStyleX,
392
379
  };
393
380
  if (feedback) payload.feedback = feedback;
394
381
  return jsonOut('swizzle.copy', payload);
@@ -400,27 +387,6 @@ export function registerSwizzle(program) {
400
387
  );
401
388
  humanLog('You can now customize the component source freely.\n');
402
389
 
403
- // StyleX build requirement. Swizzled components ship raw StyleX source,
404
- // which needs a build-time StyleX compiler in the consumer's app to
405
- // produce atomic CSS. Without it the component compiles but renders
406
- // unstyled, with no error — a confusing silent failure, so call it out.
407
- if (usesStyleX) {
408
- humanLog(
409
- '⚠ These components use StyleX and require a StyleX compiler in your build.',
410
- );
411
- humanLog(
412
- ' Without one they render unstyled (no error). See setup per framework:',
413
- );
414
- humanLog(` ${getRunPrefix()} astryx docs styling`);
415
- humanLog(
416
- ' Next.js note: the StyleX Babel plugin disables SWC and breaks next/font —',
417
- );
418
- humanLog(
419
- ' use an SWC-based StyleX transform instead (covered in the guide).',
420
- );
421
- humanLog('');
422
- }
423
-
424
390
  // Maintainer feedback note. If we couldn't swizzle cleanly, the team
425
391
  // wants to know — point users at the issue tracker. Skipped when the
426
392
  // owning package ships no issues URL.
@@ -277,70 +277,3 @@ describe('swizzle — ambiguous ownership', () => {
277
277
  expect(out).toContain(`from '@astryxdesign/core/theme'`);
278
278
  });
279
279
  });
280
-
281
- /**
282
- * Build a fake @astryxdesign/core with a component that imports StyleX directly
283
- * (so the swizzle StyleX-build note should fire) and one that doesn't.
284
- */
285
- function buildStyleXCore(project) {
286
- const core = path.join(project, 'node_modules', '@astryxdesign', 'core');
287
- // StyleX component.
288
- const styledDir = path.join(core, 'src', 'Styled');
289
- fs.mkdirSync(styledDir, {recursive: true});
290
- fs.writeFileSync(
291
- path.join(core, 'package.json'),
292
- '{"name":"@astryxdesign/core","version":"0.0.13"}',
293
- );
294
- fs.writeFileSync(
295
- path.join(styledDir, 'Styled.tsx'),
296
- [
297
- `import * as stylex from '@stylexjs/stylex';`,
298
- `const styles = stylex.create({base: {color: 'red'}});`,
299
- `export const Styled = () => null;`,
300
- '',
301
- ].join('\n'),
302
- );
303
- // Plain component (no StyleX).
304
- const plainDir = path.join(core, 'src', 'Plain');
305
- fs.mkdirSync(plainDir, {recursive: true});
306
- fs.writeFileSync(
307
- path.join(plainDir, 'Plain.tsx'),
308
- `export const Plain = () => null;\n`,
309
- );
310
- return core;
311
- }
312
-
313
- describe('swizzle — StyleX build setup note (#3373)', () => {
314
- it('reports usesStyleX and prints a setup note for StyleX components', () => {
315
- buildStyleXCore(project);
316
- writeProjectPackageJson(project);
317
-
318
- // JSON payload carries the machine-readable flag.
319
- const jsonResult = runCli(['--json', 'swizzle', 'Styled', '-f'], project);
320
- expect(jsonResult.code).toBe(0);
321
- const env = JSON.parse(jsonResult.stdout);
322
- expect(env.data.usesStyleX).toBe(true);
323
-
324
- // Human output surfaces the compiler requirement + Next.js caveat.
325
- const humanResult = runCli(['swizzle', 'Styled', '-f'], project);
326
- expect(humanResult.code).toBe(0);
327
- expect(humanResult.stdout).toMatch(/StyleX compiler/i);
328
- expect(humanResult.stdout).toMatch(/unstyled/i);
329
- expect(humanResult.stdout).toMatch(/next\/font/i);
330
- expect(humanResult.stdout).toMatch(/astryx docs styling/);
331
- });
332
-
333
- it('does not print the StyleX note for components without StyleX', () => {
334
- buildStyleXCore(project);
335
- writeProjectPackageJson(project);
336
-
337
- const jsonResult = runCli(['--json', 'swizzle', 'Plain', '-f'], project);
338
- expect(jsonResult.code).toBe(0);
339
- const env = JSON.parse(jsonResult.stdout);
340
- expect(env.data.usesStyleX).toBe(false);
341
-
342
- const humanResult = runCli(['swizzle', 'Plain', '-f'], project);
343
- expect(humanResult.code).toBe(0);
344
- expect(humanResult.stdout).not.toMatch(/StyleX compiler/i);
345
- });
346
- });
@@ -8,10 +8,15 @@ import {Center} from '@astryxdesign/core/Center';
8
8
  export default function AspectRatioCircleImage() {
9
9
  return (
10
10
  <Center width={300}>
11
- <AspectRatio ratio={1} shape="ellipse" fit="cover">
11
+ <AspectRatio ratio={1} shape="ellipse">
12
12
  <img
13
13
  src="https://lookaside.facebook.com/assets/astryx/light-home-square-1.png"
14
14
  alt="Circular image"
15
+ style={{
16
+ width: '100%',
17
+ height: '100%',
18
+ objectFit: 'cover',
19
+ }}
15
20
  />
16
21
  </AspectRatio>
17
22
  </Center>
@@ -25,11 +25,16 @@ export default function AspectRatioImageGallery() {
25
25
  <Center width={600}>
26
26
  <Grid columns={3} gap={4} width="100%">
27
27
  {images.map(({id, alt}) => (
28
- <AspectRatio key={id} ratio={4 / 3} fit="cover">
28
+ <AspectRatio key={id} ratio={4 / 3}>
29
29
  <img
30
30
  src="https://lookaside.facebook.com/assets/astryx/illustrative-horizontal-1.png"
31
31
  alt={alt}
32
- style={{borderRadius: 8}}
32
+ style={{
33
+ width: '100%',
34
+ height: '100%',
35
+ objectFit: 'cover',
36
+ borderRadius: 8,
37
+ }}
33
38
  />
34
39
  </AspectRatio>
35
40
  ))}
@@ -34,13 +34,16 @@ export default function AspectRatioShowcase() {
34
34
  <VStack key={label} gap={2} hAlign="center">
35
35
  <AspectRatio
36
36
  ratio={ratio}
37
- fit="cover"
38
37
  style={{
39
38
  height: 120,
40
39
  width: 'auto',
41
40
  borderRadius: 'var(--radius-container)',
42
41
  }}>
43
- <img src={src} alt={alt} />
42
+ <img
43
+ src={src}
44
+ alt={alt}
45
+ style={{width: '100%', height: '100%', objectFit: 'cover'}}
46
+ />
44
47
  </AspectRatio>
45
48
  <Text type="supporting" color="secondary">
46
49
  {label}
@@ -8,10 +8,15 @@ import {Center} from '@astryxdesign/core/Center';
8
8
  export default function AspectRatioSquareImage() {
9
9
  return (
10
10
  <Center width={300}>
11
- <AspectRatio ratio={1} fit="cover">
11
+ <AspectRatio ratio={1}>
12
12
  <img
13
13
  src="https://lookaside.facebook.com/assets/astryx/light-home-square-1.png"
14
14
  alt="1:1 square"
15
+ style={{
16
+ width: '100%',
17
+ height: '100%',
18
+ objectFit: 'cover',
19
+ }}
15
20
  />
16
21
  </AspectRatio>
17
22
  </Center>
@@ -8,10 +8,15 @@ import {Center} from '@astryxdesign/core/Center';
8
8
  export default function AspectRatioWidescreen() {
9
9
  return (
10
10
  <Center width={600}>
11
- <AspectRatio ratio={16 / 9} fit="cover">
11
+ <AspectRatio ratio={16 / 9}>
12
12
  <img
13
13
  src="https://lookaside.facebook.com/assets/astryx/light-scene-horizontal-1.png"
14
14
  alt="16:9 widescreen"
15
+ style={{
16
+ width: '100%',
17
+ height: '100%',
18
+ objectFit: 'cover',
19
+ }}
15
20
  />
16
21
  </AspectRatio>
17
22
  </Center>
@@ -7,7 +7,7 @@ export const doc = {
7
7
  name: 'Code — Terminal',
8
8
  displayName: 'Code — Terminal',
9
9
  description:
10
- 'A dark terminal-style command block: a bash CodeBlock wrapped in SyntaxTheme with the GitHub Dark preset, copy button on, and no line numbers. Use for shell sessions or CLI output that should read as a terminal even on light pages. Reach for a dark syntax preset instead of hand-rolling a dark box with custom CSS.',
10
+ 'A dark terminal-style command block: a bash CodeBlock wrapped in SyntaxTheme with the GitHub Dark preset, copy button on, and no line numbers. Use for shell sessions or CLI output that should read as a terminal even on light pages reach for a dark syntax preset instead of hand-rolling a dark box with custom CSS.',
11
11
  isReady: true,
12
12
  aspectRatio: 16 / 9,
13
13
  componentsUsed: ['CodeBlock', 'SyntaxTheme'],
@@ -2,36 +2,34 @@
2
2
 
3
3
  'use client';
4
4
 
5
- import {Collapsible, CollapsibleGroup} from '@astryxdesign/core/Collapsible';
5
+ import {Collapsible} from '@astryxdesign/core/Collapsible';
6
6
  import {Divider} from '@astryxdesign/core/Divider';
7
7
  import {Text} from '@astryxdesign/core/Text';
8
8
  import {VStack} from '@astryxdesign/core/Layout';
9
9
 
10
10
  export default function CollapsibleWithoutCard() {
11
11
  return (
12
- <CollapsibleGroup type="single" defaultValue="deployment">
13
- <VStack gap={3} style={{width: '100%', maxWidth: 400}}>
14
- <Collapsible trigger="Deployment Details" value="deployment">
15
- <Text type="body">
16
- Last deployed on April 18, 2026 at 3:42 PM by Sarah Chen. Build
17
- duration was 2m 14s with zero warnings.
18
- </Text>
19
- </Collapsible>
20
- <Divider />
21
- <Collapsible trigger="Environment Variables" value="environment">
22
- <Text type="body">
23
- 12 variables configured. Last updated March 30, 2026. All secrets
24
- are encrypted at rest with AES-256.
25
- </Text>
26
- </Collapsible>
27
- <Divider />
28
- <Collapsible trigger="Build Logs" value="logs">
29
- <Text type="body">
30
- Build completed successfully. 847 modules compiled, 0 errors, 0
31
- warnings. Bundle size: 142 KB gzipped.
32
- </Text>
33
- </Collapsible>
34
- </VStack>
35
- </CollapsibleGroup>
12
+ <VStack gap={3} style={{width: '100%', maxWidth: 400}}>
13
+ <Collapsible trigger="Deployment Details">
14
+ <Text type="body">
15
+ Last deployed on April 18, 2026 at 3:42 PM by Sarah Chen. Build
16
+ duration was 2m 14s with zero warnings.
17
+ </Text>
18
+ </Collapsible>
19
+ <Divider />
20
+ <Collapsible trigger="Environment Variables" defaultIsOpen={false}>
21
+ <Text type="body">
22
+ 12 variables configured. Last updated March 30, 2026. All secrets are
23
+ encrypted at rest with AES-256.
24
+ </Text>
25
+ </Collapsible>
26
+ <Divider />
27
+ <Collapsible trigger="Build Logs" defaultIsOpen={false}>
28
+ <Text type="body">
29
+ Build completed successfully. 847 modules compiled, 0 errors, 0
30
+ warnings. Bundle size: 142 KB gzipped.
31
+ </Text>
32
+ </Collapsible>
33
+ </VStack>
36
34
  );
37
35
  }
@@ -3,45 +3,66 @@
3
3
  'use client';
4
4
 
5
5
  import {useMemo} from 'react';
6
- import {CommandPalette} from '@astryxdesign/core/CommandPalette';
6
+ import {
7
+ CommandPalette,
8
+ CommandPaletteList,
9
+ CommandPaletteGroup,
10
+ CommandPaletteItem,
11
+ } from '@astryxdesign/core/CommandPalette';
7
12
  import {createStaticSource} from '@astryxdesign/core/Typeahead';
13
+ import {Stack} from '@astryxdesign/core/Layout';
14
+ import {Text} from '@astryxdesign/core/Text';
8
15
 
9
16
  export default function CommandPaletteGroupShowcase() {
10
17
  const source = useMemo(
11
18
  () =>
12
19
  createStaticSource([
13
- {
14
- id: 'index',
15
- label: 'index.tsx',
16
- auxiliaryData: {group: 'Recent Files'},
17
- },
20
+ {id: 'index', label: 'index.tsx', auxiliaryData: {group: 'Recent Files'}},
18
21
  {id: 'app', label: 'App.tsx', auxiliaryData: {group: 'Recent Files'}},
19
- {
20
- id: 'settings',
21
- label: 'Open Settings',
22
- auxiliaryData: {group: 'Commands'},
23
- },
24
- {
25
- id: 'terminal',
26
- label: 'Toggle Terminal',
27
- auxiliaryData: {group: 'Commands'},
28
- },
29
- {
30
- id: 'theme',
31
- label: 'Color Theme',
32
- auxiliaryData: {group: 'Preferences'},
33
- },
22
+ {id: 'settings', label: 'Open Settings', auxiliaryData: {group: 'Commands'}},
23
+ {id: 'terminal', label: 'Toggle Terminal', auxiliaryData: {group: 'Commands'}},
24
+ {id: 'theme', label: 'Color Theme', auxiliaryData: {group: 'Preferences'}},
34
25
  {id: 'font', label: 'Font Size', auxiliaryData: {group: 'Preferences'}},
35
26
  ]),
36
27
  [],
37
28
  );
38
29
 
39
30
  return (
40
- <CommandPalette
41
- isOpen
42
- isInline
43
- onOpenChange={() => {}}
44
- searchSource={source}
45
- />
31
+ <Stack direction="vertical" gap={4}>
32
+ <Stack direction="vertical" gap={1}>
33
+ <Text type="supporting" color="secondary">
34
+ Data-driven grouping (auxiliaryData.group)
35
+ </Text>
36
+ <CommandPalette
37
+ isOpen
38
+ isInline
39
+ onOpenChange={() => {}}
40
+ searchSource={source}
41
+ />
42
+ </Stack>
43
+ <Stack direction="vertical" gap={1}>
44
+ <Text type="supporting" color="secondary">
45
+ Composed form (CommandPaletteGroup + CommandPaletteItem)
46
+ </Text>
47
+ <CommandPaletteList>
48
+ <CommandPaletteGroup heading="Navigation">
49
+ <CommandPaletteItem value="home" onSelect={() => {}}>
50
+ Home
51
+ </CommandPaletteItem>
52
+ <CommandPaletteItem value="dashboard" onSelect={() => {}}>
53
+ Dashboard
54
+ </CommandPaletteItem>
55
+ </CommandPaletteGroup>
56
+ <CommandPaletteGroup heading="Actions">
57
+ <CommandPaletteItem value="new-file" onSelect={() => {}}>
58
+ New File
59
+ </CommandPaletteItem>
60
+ <CommandPaletteItem value="save" onSelect={() => {}}>
61
+ Save All
62
+ </CommandPaletteItem>
63
+ </CommandPaletteGroup>
64
+ </CommandPaletteList>
65
+ </Stack>
66
+ </Stack>
46
67
  );
47
68
  }
@@ -3,10 +3,16 @@
3
3
  'use client';
4
4
 
5
5
  import {useMemo, type CSSProperties} from 'react';
6
- import {CommandPalette} from '@astryxdesign/core/CommandPalette';
6
+ import {
7
+ CommandPalette,
8
+ CommandPaletteList,
9
+ CommandPaletteItem,
10
+ } from '@astryxdesign/core/CommandPalette';
7
11
  import {Text} from '@astryxdesign/core/Text';
8
12
  import {Kbd} from '@astryxdesign/core/Kbd';
13
+ import {Icon} from '@astryxdesign/core/Icon';
9
14
  import {createStaticSource} from '@astryxdesign/core/Typeahead';
15
+ import {Stack} from '@astryxdesign/core/Layout';
10
16
  import type {SearchableItem} from '@astryxdesign/core/Typeahead';
11
17
 
12
18
  const itemLabel: CSSProperties = {
@@ -17,21 +23,9 @@ type CommandItem = SearchableItem<{shortcut?: string}>;
17
23
 
18
24
  const commands: CommandItem[] = [
19
25
  {id: 'save', label: 'Save File', auxiliaryData: {shortcut: 'mod+s'}},
20
- {
21
- id: 'find',
22
- label: 'Find in Files',
23
- auxiliaryData: {shortcut: 'mod+shift+f'},
24
- },
25
- {
26
- id: 'palette',
27
- label: 'Command Palette',
28
- auxiliaryData: {shortcut: 'mod+shift+p'},
29
- },
30
- {
31
- id: 'terminal',
32
- label: 'Toggle Terminal',
33
- auxiliaryData: {shortcut: 'ctrl+`'},
34
- },
26
+ {id: 'find', label: 'Find in Files', auxiliaryData: {shortcut: 'mod+shift+f'}},
27
+ {id: 'palette', label: 'Command Palette', auxiliaryData: {shortcut: 'mod+shift+p'}},
28
+ {id: 'terminal', label: 'Toggle Terminal', auxiliaryData: {shortcut: 'ctrl+`'}},
35
29
  {id: 'sidebar', label: 'Toggle Sidebar', auxiliaryData: {shortcut: 'mod+b'}},
36
30
  ];
37
31
 
@@ -39,21 +33,50 @@ export default function CommandPaletteItemShowcase() {
39
33
  const source = useMemo(() => createStaticSource(commands), []);
40
34
 
41
35
  return (
42
- <CommandPalette
43
- isOpen
44
- isInline
45
- onOpenChange={() => {}}
46
- searchSource={source}
47
- renderItem={(item: CommandItem) => (
48
- <>
49
- <Text type="body" style={itemLabel}>
50
- {item.label}
51
- </Text>
52
- {item.auxiliaryData?.shortcut && (
53
- <Kbd keys={item.auxiliaryData.shortcut} />
36
+ <Stack direction="vertical" gap={4}>
37
+ <Stack direction="vertical" gap={1}>
38
+ <Text type="supporting" color="secondary">
39
+ Custom renderItem with keyboard shortcuts
40
+ </Text>
41
+ <CommandPalette
42
+ isOpen
43
+ isInline
44
+ onOpenChange={() => {}}
45
+ searchSource={source}
46
+ renderItem={(item: CommandItem) => (
47
+ <>
48
+ <Text type="body" style={itemLabel}>
49
+ {item.label}
50
+ </Text>
51
+ {item.auxiliaryData?.shortcut && (
52
+ <Kbd keys={item.auxiliaryData.shortcut} />
53
+ )}
54
+ </>
54
55
  )}
55
- </>
56
- )}
57
- />
56
+ />
57
+ </Stack>
58
+ <Stack direction="vertical" gap={1}>
59
+ <Text type="supporting" color="secondary">
60
+ Composed items with icons and states
61
+ </Text>
62
+ <CommandPaletteList>
63
+ <CommandPaletteItem value="home" onSelect={() => {}}>
64
+ <Icon icon="externalLink" size="sm" />
65
+ <Text type="body" style={itemLabel}>Home</Text>
66
+ </CommandPaletteItem>
67
+ <CommandPaletteItem value="search" isHighlighted onSelect={() => {}}>
68
+ <Icon icon="search" size="sm" />
69
+ <Text type="body" style={itemLabel}>Search (highlighted)</Text>
70
+ </CommandPaletteItem>
71
+ <CommandPaletteItem value="selected" isSelected onSelect={() => {}}>
72
+ <Icon icon="check" size="sm" />
73
+ <Text type="body" style={itemLabel}>Selected item</Text>
74
+ </CommandPaletteItem>
75
+ <CommandPaletteItem value="disabled" isDisabled>
76
+ <Text type="body" style={itemLabel}>Disabled item</Text>
77
+ </CommandPaletteItem>
78
+ </CommandPaletteList>
79
+ </Stack>
80
+ </Stack>
58
81
  );
59
82
  }
@@ -25,23 +25,21 @@ function AppIcon() {
25
25
 
26
26
  export default function NavHeadingMenuShowcase() {
27
27
  return (
28
- <div style={{height: 100}}>
29
- <SideNav
30
- header={
31
- <SideNavHeading
32
- heading="Acme Platform"
33
- icon={<AppIcon />}
34
- menu={
35
- <NavHeadingMenu size="lg">
36
- <NavHeadingMenuItem label="Dashboard" href="/dashboard" />
37
- <NavHeadingMenuItem label="Analytics" href="/analytics" />
38
- <NavHeadingMenuItem label="Settings" href="/settings" />
39
- </NavHeadingMenu>
40
- }
41
- />
42
- }>
43
- {null}
44
- </SideNav>
45
- </div>
28
+ <SideNav
29
+ header={
30
+ <SideNavHeading
31
+ heading="Acme Platform"
32
+ icon={<AppIcon />}
33
+ menu={
34
+ <NavHeadingMenu size="lg">
35
+ <NavHeadingMenuItem label="Dashboard" href="/dashboard" />
36
+ <NavHeadingMenuItem label="Analytics" href="/analytics" />
37
+ <NavHeadingMenuItem label="Settings" href="/settings" />
38
+ </NavHeadingMenu>
39
+ }
40
+ />
41
+ }>
42
+ {null}
43
+ </SideNav>
46
44
  );
47
45
  }
@@ -110,7 +110,7 @@ export default function ClassicGalleryTemplate() {
110
110
 
111
111
  return (
112
112
  <Layout
113
- height="fill"
113
+ height="auto"
114
114
  content={
115
115
  <LayoutContent padding={0}>
116
116
  <Center axis="horizontal">
@@ -729,7 +729,7 @@ function TableCard<T extends {id: string}>({
729
729
  export default function DashboardTemplate() {
730
730
  return (
731
731
  <Layout
732
- height="fill"
732
+ height="auto"
733
733
  content={
734
734
  <LayoutContent padding={6}>
735
735
  <VStack gap={6}>
@@ -209,7 +209,7 @@ const COMPONENT_CATEGORIES = [
209
209
  export default function DocumentationOverviewPage() {
210
210
  return (
211
211
  <Layout
212
- height="fill"
212
+ height="auto"
213
213
  contentWidth={1200}
214
214
  content={
215
215
  <LayoutContent padding={8}>