@astryxdesign/cli 0.1.2-canary.bfcbf64 → 0.1.2-canary.c11faf5

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 (132) hide show
  1. package/docs/layout.doc.dense.mjs +90 -0
  2. package/docs/layout.doc.mjs +160 -0
  3. package/docs/principles.doc.dense.mjs +2 -2
  4. package/docs/principles.doc.mjs +4 -0
  5. package/docs/principles.doc.zh.mjs +2 -2
  6. package/package.json +7 -7
  7. package/src/api/blog.mjs +192 -0
  8. package/src/api/blog.test.mjs +144 -0
  9. package/src/api/index.mjs +1 -0
  10. package/src/commands/agent-docs.mjs +3 -0
  11. package/src/commands/blog.mjs +60 -0
  12. package/src/commands/build-theme.import-path.test.mjs +2 -12
  13. package/src/commands/build-theme.mjs +117 -0
  14. package/src/commands/build-theme.prose.test.mjs +5 -15
  15. package/src/commands/build-theme.watch.test.mjs +149 -0
  16. package/src/commands/ensure-core-built.mjs +120 -0
  17. package/src/index.mjs +1 -0
  18. package/src/lib/error-codes.mjs +8 -0
  19. package/src/lib/site.mjs +20 -0
  20. package/templates/blocks/components/AvatarStatusDot/AvatarStatusDotVariants.doc.mjs +14 -0
  21. package/templates/blocks/components/AvatarStatusDot/AvatarStatusDotVariants.tsx +28 -0
  22. package/templates/blocks/components/Blockquote/BlockquoteTestimonials.doc.mjs +14 -0
  23. package/templates/blocks/components/Blockquote/BlockquoteTestimonials.tsx +34 -0
  24. package/templates/blocks/components/Blockquote/BlockquoteWithCite.doc.mjs +14 -0
  25. package/templates/blocks/components/Blockquote/BlockquoteWithCite.tsx +21 -0
  26. package/templates/blocks/components/BreadcrumbItem/BreadcrumbItemBasic.doc.mjs +14 -0
  27. package/templates/blocks/components/BreadcrumbItem/BreadcrumbItemBasic.tsx +15 -0
  28. package/templates/blocks/components/ButtonGroup/ButtonGroupBasic.doc.mjs +14 -0
  29. package/templates/blocks/components/ButtonGroup/ButtonGroupBasic.tsx +16 -0
  30. package/templates/blocks/components/ChatDictationButton/ChatDictationButtonBasic.doc.mjs +19 -0
  31. package/templates/blocks/components/ChatDictationButton/ChatDictationButtonBasic.tsx +34 -0
  32. package/templates/blocks/components/CheckboxListItem/CheckboxListItemBasic.doc.mjs +14 -0
  33. package/templates/blocks/components/CheckboxListItem/CheckboxListItemBasic.tsx +30 -0
  34. package/templates/blocks/components/CollapsibleGroup/CollapsibleGroupAccordion.doc.mjs +14 -0
  35. package/templates/blocks/components/CollapsibleGroup/CollapsibleGroupAccordion.tsx +31 -0
  36. package/templates/blocks/components/CommandPaletteEmpty/CommandPaletteEmptyBasic.doc.mjs +14 -0
  37. package/templates/blocks/components/CommandPaletteEmpty/CommandPaletteEmptyBasic.tsx +26 -0
  38. package/templates/blocks/components/CommandPaletteFooter/CommandPaletteFooterBasic.doc.mjs +14 -0
  39. package/templates/blocks/components/CommandPaletteFooter/CommandPaletteFooterBasic.tsx +32 -0
  40. package/templates/blocks/components/CommandPaletteGroup/CommandPaletteGroupBasic.doc.mjs +18 -0
  41. package/templates/blocks/components/CommandPaletteGroup/CommandPaletteGroupBasic.tsx +32 -0
  42. package/templates/blocks/components/CommandPaletteItem/CommandPaletteItemBasic.doc.mjs +14 -0
  43. package/templates/blocks/components/CommandPaletteItem/CommandPaletteItemBasic.tsx +27 -0
  44. package/templates/blocks/components/ContextMenu/ContextMenuBasic.doc.mjs +14 -0
  45. package/templates/blocks/components/ContextMenu/ContextMenuBasic.tsx +32 -0
  46. package/templates/blocks/components/DialogHeader/DialogHeaderBasic.doc.mjs +14 -0
  47. package/templates/blocks/components/DialogHeader/DialogHeaderBasic.tsx +30 -0
  48. package/templates/blocks/components/DropdownMenu/DropdownMenuShowcase.tsx +0 -6
  49. package/templates/blocks/components/DropdownMenuItem/DropdownMenuItemBasic.doc.mjs +14 -0
  50. package/templates/blocks/components/DropdownMenuItem/DropdownMenuItemBasic.tsx +27 -0
  51. package/templates/blocks/components/DropdownMenuItem/DropdownMenuItemShowcase.tsx +1 -5
  52. package/templates/blocks/components/FieldLabel/FieldLabelBasic.doc.mjs +14 -0
  53. package/templates/blocks/components/FieldLabel/FieldLabelBasic.tsx +20 -0
  54. package/templates/blocks/components/FieldStatus/FieldStatusBasic.doc.mjs +14 -0
  55. package/templates/blocks/components/FieldStatus/FieldStatusBasic.tsx +23 -0
  56. package/templates/blocks/components/FileInput/FileInputBasic.doc.mjs +14 -0
  57. package/templates/blocks/components/FileInput/FileInputBasic.tsx +22 -0
  58. package/templates/blocks/components/GridSpan/GridSpanColumns.doc.mjs +14 -0
  59. package/templates/blocks/components/GridSpan/GridSpanColumns.tsx +38 -0
  60. package/templates/blocks/components/HStack/HStackBasic.doc.mjs +14 -0
  61. package/templates/blocks/components/HStack/HStackBasic.tsx +16 -0
  62. package/templates/blocks/components/Hooks/useKeyboardHintHookUsage.doc.mjs +14 -0
  63. package/templates/blocks/components/Hooks/useKeyboardHintHookUsage.tsx +57 -0
  64. package/templates/blocks/components/InputGroup/InputGroupBasic.doc.mjs +14 -0
  65. package/templates/blocks/components/InputGroup/InputGroupBasic.tsx +27 -0
  66. package/templates/blocks/components/LayoutContent/LayoutContentBasic.doc.mjs +23 -0
  67. package/templates/blocks/components/LayoutContent/LayoutContentBasic.tsx +40 -0
  68. package/templates/blocks/components/LayoutFooter/LayoutFooterActions.doc.mjs +22 -0
  69. package/templates/blocks/components/LayoutFooter/LayoutFooterActions.tsx +41 -0
  70. package/templates/blocks/components/LayoutHeader/LayoutHeaderWithActions.doc.mjs +23 -0
  71. package/templates/blocks/components/LayoutHeader/LayoutHeaderWithActions.tsx +40 -0
  72. package/templates/blocks/components/LayoutPanel/LayoutPanelNavigation.doc.mjs +22 -0
  73. package/templates/blocks/components/LayoutPanel/LayoutPanelNavigation.tsx +37 -0
  74. package/templates/blocks/components/Lightbox/LightboxGallery.doc.mjs +14 -0
  75. package/templates/blocks/components/Lightbox/LightboxGallery.tsx +53 -0
  76. package/templates/blocks/components/Lightbox/LightboxShowcase.tsx +4 -3
  77. package/templates/blocks/components/Lightbox/LightboxVideo.doc.mjs +14 -0
  78. package/templates/blocks/components/Lightbox/LightboxVideo.tsx +27 -0
  79. package/templates/blocks/components/Lightbox/LightboxZoom.doc.mjs +14 -0
  80. package/templates/blocks/components/Lightbox/LightboxZoom.tsx +33 -0
  81. package/templates/blocks/components/MetadataListItem/MetadataListItemBasic.doc.mjs +14 -0
  82. package/templates/blocks/components/MetadataListItem/MetadataListItemBasic.tsx +19 -0
  83. package/templates/blocks/components/MobileNavToggle/MobileNavToggleBasic.doc.mjs +23 -0
  84. package/templates/blocks/components/MobileNavToggle/MobileNavToggleBasic.tsx +42 -0
  85. package/templates/blocks/components/MoreMenu/MoreMenuShowcase.tsx +0 -6
  86. package/templates/blocks/components/NavIcon/NavIconBasic.doc.mjs +14 -0
  87. package/templates/blocks/components/NavIcon/NavIconBasic.tsx +16 -0
  88. package/templates/blocks/components/RadioListItem/RadioListItemBasic.doc.mjs +14 -0
  89. package/templates/blocks/components/RadioListItem/RadioListItemBasic.tsx +30 -0
  90. package/templates/blocks/components/Resizable/ResizableSidebar.doc.mjs +25 -0
  91. package/templates/blocks/components/Resizable/ResizableSidebar.tsx +67 -0
  92. package/templates/blocks/components/SegmentedControlItem/SegmentedControlItemBasic.doc.mjs +14 -0
  93. package/templates/blocks/components/SegmentedControlItem/SegmentedControlItemBasic.tsx +21 -0
  94. package/templates/blocks/components/SelectorOption/SelectorOptionBasic.doc.mjs +14 -0
  95. package/templates/blocks/components/SelectorOption/SelectorOptionBasic.tsx +39 -0
  96. package/templates/blocks/components/SideNavCollapseButton/SideNavCollapseButtonBasic.doc.mjs +14 -0
  97. package/templates/blocks/components/SideNavCollapseButton/SideNavCollapseButtonBasic.tsx +55 -0
  98. package/templates/blocks/components/SideNavHeading/SideNavHeadingBasic.doc.mjs +14 -0
  99. package/templates/blocks/components/SideNavHeading/SideNavHeadingBasic.tsx +38 -0
  100. package/templates/blocks/components/SideNavItem/SideNavItemBasic.doc.mjs +14 -0
  101. package/templates/blocks/components/SideNavItem/SideNavItemBasic.tsx +49 -0
  102. package/templates/blocks/components/SideNavSection/SideNavSectionBasic.doc.mjs +14 -0
  103. package/templates/blocks/components/SideNavSection/SideNavSectionBasic.tsx +71 -0
  104. package/templates/blocks/components/StackItem/StackItemFill.doc.mjs +14 -0
  105. package/templates/blocks/components/StackItem/StackItemFill.tsx +28 -0
  106. package/templates/blocks/components/TabMenu/TabMenuBasic.doc.mjs +14 -0
  107. package/templates/blocks/components/TabMenu/TabMenuBasic.tsx +23 -0
  108. package/templates/blocks/components/ToggleButtonGroup/ToggleButtonGroupVertical.doc.mjs +14 -0
  109. package/templates/blocks/components/ToggleButtonGroup/ToggleButtonGroupVertical.tsx +47 -0
  110. package/templates/blocks/components/TopNavHeading/TopNavHeadingBasic.doc.mjs +14 -0
  111. package/templates/blocks/components/TopNavHeading/TopNavHeadingBasic.tsx +22 -0
  112. package/templates/blocks/components/TopNavItem/TopNavItemBasic.doc.mjs +14 -0
  113. package/templates/blocks/components/TopNavItem/TopNavItemBasic.tsx +21 -0
  114. package/templates/blocks/components/TopNavMegaMenu/TopNavMegaMenuBasic.doc.mjs +20 -0
  115. package/templates/blocks/components/TopNavMegaMenu/TopNavMegaMenuBasic.tsx +46 -0
  116. package/templates/blocks/components/TopNavMegaMenuFeaturedCard/TopNavMegaMenuFeaturedCardBasic.doc.mjs +14 -0
  117. package/templates/blocks/components/TopNavMegaMenuFeaturedCard/TopNavMegaMenuFeaturedCardBasic.tsx +16 -0
  118. package/templates/blocks/components/TopNavMegaMenuItem/TopNavMegaMenuItemBasic.doc.mjs +14 -0
  119. package/templates/blocks/components/TopNavMegaMenuItem/TopNavMegaMenuItemBasic.tsx +26 -0
  120. package/templates/blocks/components/TopNavMenu/TopNavMenuBasic.doc.mjs +14 -0
  121. package/templates/blocks/components/TopNavMenu/TopNavMenuBasic.tsx +43 -0
  122. package/templates/blocks/components/TypeaheadItem/TypeaheadItemBasic.doc.mjs +14 -0
  123. package/templates/blocks/components/TypeaheadItem/TypeaheadItemBasic.tsx +43 -0
  124. package/templates/blocks/components/VStack/VStackBasic.doc.mjs +14 -0
  125. package/templates/blocks/components/VStack/VStackBasic.tsx +20 -0
  126. package/templates/pages/kanban-board/page.tsx +729 -0
  127. package/templates/pages/kanban-board/template.doc.mjs +12 -0
  128. package/templates/pages/shell-side-nav/page.tsx +0 -1
  129. package/templates/blocks/components/TreeListBranches/TreeListBranchesShowcase.doc.mjs +0 -14
  130. package/templates/blocks/components/TreeListBranches/TreeListBranchesShowcase.tsx +0 -64
  131. package/templates/blocks/components/TreeListItem/TreeListItemShowcase.doc.mjs +0 -14
  132. package/templates/blocks/components/TreeListItem/TreeListItemShowcase.tsx +0 -60
@@ -0,0 +1,49 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ 'use client';
4
+
5
+ import type {ComponentProps} from 'react';
6
+ import {SideNav, SideNavItem} from '@astryxdesign/core/SideNav';
7
+
8
+ function InboxIcon(props: ComponentProps<'svg'>) {
9
+ return (
10
+ <svg
11
+ fill="none"
12
+ viewBox="0 0 24 24"
13
+ strokeWidth={1.5}
14
+ stroke="currentColor"
15
+ {...props}>
16
+ <path
17
+ strokeLinecap="round"
18
+ strokeLinejoin="round"
19
+ d="M2.25 13.5h3.86a2.25 2.25 0 0 1 2.012 1.244l.256.512a2.25 2.25 0 0 0 2.013 1.244h3.218a2.25 2.25 0 0 0 2.013-1.244l.256-.512a2.25 2.25 0 0 1 2.013-1.244h3.859m-19.5.338V18a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18v-4.162c0-.224-.034-.447-.1-.661L19.24 5.338a2.25 2.25 0 0 0-2.15-1.588H6.911a2.25 2.25 0 0 0-2.15 1.588L2.35 13.177a2.25 2.25 0 0 0-.1.661Z"
20
+ />
21
+ </svg>
22
+ );
23
+ }
24
+
25
+ function DocumentIcon(props: ComponentProps<'svg'>) {
26
+ return (
27
+ <svg
28
+ fill="none"
29
+ viewBox="0 0 24 24"
30
+ strokeWidth={1.5}
31
+ stroke="currentColor"
32
+ {...props}>
33
+ <path
34
+ strokeLinecap="round"
35
+ strokeLinejoin="round"
36
+ 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.25m2.25 0H5.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"
37
+ />
38
+ </svg>
39
+ );
40
+ }
41
+
42
+ export default function SideNavItemBasic() {
43
+ return (
44
+ <SideNav>
45
+ <SideNavItem label="Inbox" icon={InboxIcon} isSelected href="#" />
46
+ <SideNavItem label="Documents" icon={DocumentIcon} href="#" />
47
+ </SideNav>
48
+ );
49
+ }
@@ -0,0 +1,14 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /** @type {import('../../../../../core/src/docs-types').TemplateDoc} */
4
+ export const doc = {
5
+ type: 'block',
6
+ exampleFor: 'SideNavSection',
7
+ name: 'SideNavSection — Basic',
8
+ displayName: 'SideNavSection — Basic',
9
+ description:
10
+ 'Group related SideNavItems under titled sections. Use sections to organize longer navigation lists into scannable clusters like Overview and Account.',
11
+ isReady: true,
12
+ aspectRatio: 16 / 9,
13
+ componentsUsed: ['SideNav', 'SideNavSection', 'SideNavItem'],
14
+ };
@@ -0,0 +1,71 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ 'use client';
4
+
5
+ import type {ComponentProps} from 'react';
6
+ import {SideNav, SideNavItem, SideNavSection} from '@astryxdesign/core/SideNav';
7
+
8
+ function HomeIcon(props: ComponentProps<'svg'>) {
9
+ return (
10
+ <svg
11
+ fill="none"
12
+ viewBox="0 0 24 24"
13
+ strokeWidth={1.5}
14
+ stroke="currentColor"
15
+ {...props}>
16
+ <path
17
+ strokeLinecap="round"
18
+ strokeLinejoin="round"
19
+ 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"
20
+ />
21
+ </svg>
22
+ );
23
+ }
24
+
25
+ function ChartIcon(props: ComponentProps<'svg'>) {
26
+ return (
27
+ <svg
28
+ fill="none"
29
+ viewBox="0 0 24 24"
30
+ strokeWidth={1.5}
31
+ stroke="currentColor"
32
+ {...props}>
33
+ <path
34
+ strokeLinecap="round"
35
+ strokeLinejoin="round"
36
+ 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"
37
+ />
38
+ </svg>
39
+ );
40
+ }
41
+
42
+ function UserIcon(props: ComponentProps<'svg'>) {
43
+ return (
44
+ <svg
45
+ fill="none"
46
+ viewBox="0 0 24 24"
47
+ strokeWidth={1.5}
48
+ stroke="currentColor"
49
+ {...props}>
50
+ <path
51
+ strokeLinecap="round"
52
+ strokeLinejoin="round"
53
+ d="M15.75 6a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0ZM4.501 20.118a7.5 7.5 0 0 1 14.998 0A17.933 17.933 0 0 1 12 21.75c-2.676 0-5.216-.584-7.499-1.632Z"
54
+ />
55
+ </svg>
56
+ );
57
+ }
58
+
59
+ export default function SideNavSectionBasic() {
60
+ return (
61
+ <SideNav>
62
+ <SideNavSection title="Overview">
63
+ <SideNavItem label="Dashboard" icon={HomeIcon} isSelected href="#" />
64
+ <SideNavItem label="Analytics" icon={ChartIcon} href="#" />
65
+ </SideNavSection>
66
+ <SideNavSection title="Account">
67
+ <SideNavItem label="Profile" icon={UserIcon} href="#" />
68
+ </SideNavSection>
69
+ </SideNav>
70
+ );
71
+ }
@@ -0,0 +1,14 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /** @type {import('../../../../../core/src/docs-types').TemplateDoc} */
4
+ export const doc = {
5
+ type: 'block',
6
+ exampleFor: 'StackItem',
7
+ name: 'StackItem — Fill',
8
+ displayName: 'StackItem — Fill',
9
+ description:
10
+ 'A static-width item next to one that fills the remaining space. Wrap stack children in StackItem when an item needs explicit sizing control.',
11
+ isReady: true,
12
+ aspectRatio: 16 / 9,
13
+ componentsUsed: ['StackItem', 'HStack', 'Card', 'Text'],
14
+ };
@@ -0,0 +1,28 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ 'use client';
4
+
5
+ import {HStack, StackItem} from '@astryxdesign/core/Layout';
6
+ import {Card} from '@astryxdesign/core/Card';
7
+ import {Text} from '@astryxdesign/core/Text';
8
+
9
+ export default function StackItemFill() {
10
+ return (
11
+ <HStack gap={3} vAlign="center" width="100%" style={{maxWidth: 400}}>
12
+ <StackItem size="static">
13
+ <Card padding={3}>
14
+ <Text type="supporting" color="secondary">
15
+ Static
16
+ </Text>
17
+ </Card>
18
+ </StackItem>
19
+ <StackItem size="fill">
20
+ <Card padding={3}>
21
+ <Text type="supporting" color="secondary">
22
+ Fills remaining space
23
+ </Text>
24
+ </Card>
25
+ </StackItem>
26
+ </HStack>
27
+ );
28
+ }
@@ -0,0 +1,14 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /** @type {import('../../../../../core/src/docs-types').TemplateDoc} */
4
+ export const doc = {
5
+ type: 'block',
6
+ exampleFor: 'TabMenu',
7
+ name: 'TabMenu — Basic',
8
+ displayName: 'TabMenu — Basic',
9
+ description:
10
+ 'An overflow menu at the end of a TabList that collects secondary tabs behind a dropdown. Use it when there are more tabs than fit comfortably inline.',
11
+ isReady: true,
12
+ aspectRatio: 16 / 9,
13
+ componentsUsed: ['TabList', 'Tab', 'TabMenu'],
14
+ };
@@ -0,0 +1,23 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ 'use client';
4
+
5
+ import {useState} from 'react';
6
+ import {TabList, Tab, TabMenu} from '@astryxdesign/core/TabList';
7
+
8
+ export default function TabMenuBasic() {
9
+ const [value, setValue] = useState('overview');
10
+ return (
11
+ <TabList value={value} onChange={setValue}>
12
+ <Tab value="overview" label="Overview" />
13
+ <Tab value="activity" label="Activity" />
14
+ <TabMenu
15
+ label="More"
16
+ options={[
17
+ {value: 'settings', label: 'Settings'},
18
+ {value: 'billing', label: 'Billing'},
19
+ ]}
20
+ />
21
+ </TabList>
22
+ );
23
+ }
@@ -0,0 +1,14 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /** @type {import('../../../../../core/src/docs-types').TemplateDoc} */
4
+ export const doc = {
5
+ type: 'block',
6
+ exampleFor: 'ToggleButtonGroup',
7
+ name: 'ToggleButtonGroup — Vertical',
8
+ displayName: 'ToggleButtonGroup — Vertical',
9
+ description:
10
+ 'A vertically stacked ToggleButtonGroup using the vertical orientation, shown with both single-select and multi-select behavior — ideal for sidebar-style option lists and vertical toolbars.',
11
+ isReady: true,
12
+ aspectRatio: 3 / 4,
13
+ componentsUsed: ['ToggleButton', 'ToggleButtonGroup', 'Layout', 'Text'],
14
+ };
@@ -0,0 +1,47 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ 'use client';
4
+
5
+ import {useState} from 'react';
6
+ import {ToggleButton, ToggleButtonGroup} from '@astryxdesign/core/ToggleButton';
7
+ import {VStack} from '@astryxdesign/core/Layout';
8
+ import {Text} from '@astryxdesign/core/Text';
9
+
10
+ export default function ToggleButtonGroupVertical() {
11
+ const [view, setView] = useState<string | null>('grid');
12
+ const [filters, setFilters] = useState<string[]>(['active']);
13
+
14
+ return (
15
+ <VStack gap={4}>
16
+ <VStack gap={1}>
17
+ <Text type="label" color="secondary">
18
+ Single select
19
+ </Text>
20
+ <ToggleButtonGroup
21
+ orientation="vertical"
22
+ value={view}
23
+ onChange={setView}
24
+ label="View mode">
25
+ <ToggleButton value="list" label="List" />
26
+ <ToggleButton value="grid" label="Grid" />
27
+ <ToggleButton value="board" label="Board" />
28
+ </ToggleButtonGroup>
29
+ </VStack>
30
+ <VStack gap={1}>
31
+ <Text type="label" color="secondary">
32
+ Multi select
33
+ </Text>
34
+ <ToggleButtonGroup
35
+ orientation="vertical"
36
+ type="multiple"
37
+ value={filters}
38
+ onChange={setFilters}
39
+ label="Status filters">
40
+ <ToggleButton value="active" label="Active" />
41
+ <ToggleButton value="pending" label="Pending" />
42
+ <ToggleButton value="closed" label="Closed" />
43
+ </ToggleButtonGroup>
44
+ </VStack>
45
+ </VStack>
46
+ );
47
+ }
@@ -0,0 +1,14 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /** @type {import('../../../../../core/src/docs-types').TemplateDoc} */
4
+ export const doc = {
5
+ type: 'block',
6
+ exampleFor: 'TopNavHeading',
7
+ name: 'TopNavHeading — Basic',
8
+ displayName: 'TopNavHeading — Basic',
9
+ description:
10
+ 'A product heading with a logo inside a TopNav, linked to the home page. Use as the leading brand element of a top navigation bar.',
11
+ isReady: true,
12
+ aspectRatio: 16 / 9,
13
+ componentsUsed: ['TopNav', 'TopNavHeading', 'NavIcon', 'Icon'],
14
+ };
@@ -0,0 +1,22 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ 'use client';
4
+
5
+ import {TopNav, TopNavHeading} from '@astryxdesign/core/TopNav';
6
+ import {NavIcon} from '@astryxdesign/core/NavIcon';
7
+ import {Icon} from '@astryxdesign/core/Icon';
8
+
9
+ export default function TopNavHeadingBasic() {
10
+ return (
11
+ <TopNav
12
+ label="Product navigation"
13
+ heading={
14
+ <TopNavHeading
15
+ heading="Acme Platform"
16
+ logo={<NavIcon icon={<Icon icon="viewColumns" />} />}
17
+ headingHref="/"
18
+ />
19
+ }
20
+ />
21
+ );
22
+ }
@@ -0,0 +1,14 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /** @type {import('../../../../../core/src/docs-types').TemplateDoc} */
4
+ export const doc = {
5
+ type: 'block',
6
+ exampleFor: 'TopNavItem',
7
+ name: 'TopNavItem — Basic',
8
+ displayName: 'TopNavItem — Basic',
9
+ description:
10
+ 'Navigation links inside a TopNav with one item marked as selected. Use for top-level pages of an application.',
11
+ isReady: true,
12
+ aspectRatio: 3,
13
+ componentsUsed: ['TopNav', 'TopNavHeading', 'TopNavItem'],
14
+ };
@@ -0,0 +1,21 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ 'use client';
4
+
5
+ import {TopNav, TopNavHeading, TopNavItem} from '@astryxdesign/core/TopNav';
6
+
7
+ export default function TopNavItemBasic() {
8
+ return (
9
+ <TopNav
10
+ label="Main navigation"
11
+ heading={<TopNavHeading heading="App" />}
12
+ startContent={
13
+ <>
14
+ <TopNavItem label="Dashboard" href="#" isSelected />
15
+ <TopNavItem label="Projects" href="#" />
16
+ <TopNavItem label="Reports" href="#" />
17
+ </>
18
+ }
19
+ />
20
+ );
21
+ }
@@ -0,0 +1,20 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /** @type {import('../../../../../core/src/docs-types').TemplateDoc} */
4
+ export const doc = {
5
+ type: 'block',
6
+ exampleFor: 'TopNavMegaMenu',
7
+ name: 'TopNavMegaMenu — Basic',
8
+ displayName: 'TopNavMegaMenu — Basic',
9
+ description:
10
+ 'A mega menu trigger inside a TopNav that opens a panel of rich link items. Use when a navigation section has multiple destinations worth describing.',
11
+ isReady: true,
12
+ aspectRatio: 16 / 9,
13
+ componentsUsed: [
14
+ 'TopNav',
15
+ 'TopNavHeading',
16
+ 'TopNavItem',
17
+ 'TopNavMegaMenu',
18
+ 'TopNavMegaMenuItem',
19
+ ],
20
+ };
@@ -0,0 +1,46 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ 'use client';
4
+
5
+ import {
6
+ TopNav,
7
+ TopNavHeading,
8
+ TopNavItem,
9
+ TopNavMegaMenu,
10
+ TopNavMegaMenuItem,
11
+ } from '@astryxdesign/core/TopNav';
12
+ import {RocketLaunchIcon, BookOpenIcon} from '@heroicons/react/24/outline';
13
+
14
+ export default function TopNavMegaMenuBasic() {
15
+ return (
16
+ <TopNav
17
+ style={{width: 600}}
18
+ label="Main navigation"
19
+ heading={<TopNavHeading heading="DevTools" />}
20
+ startContent={
21
+ <>
22
+ <TopNavItem label="Overview" href="#" isSelected />
23
+ <TopNavMegaMenu
24
+ label="Products"
25
+ items={
26
+ <>
27
+ <TopNavMegaMenuItem
28
+ title="Deploy"
29
+ description="Ship to production in seconds"
30
+ icon={<RocketLaunchIcon width={20} height={20} />}
31
+ href="#deploy"
32
+ />
33
+ <TopNavMegaMenuItem
34
+ title="Documentation"
35
+ description="Guides, references, and tutorials"
36
+ icon={<BookOpenIcon width={20} height={20} />}
37
+ href="#docs"
38
+ />
39
+ </>
40
+ }
41
+ />
42
+ </>
43
+ }
44
+ />
45
+ );
46
+ }
@@ -0,0 +1,14 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /** @type {import('../../../../../core/src/docs-types').TemplateDoc} */
4
+ export const doc = {
5
+ type: 'block',
6
+ exampleFor: 'TopNavMegaMenuFeaturedCard',
7
+ name: 'TopNavMegaMenuFeaturedCard — Basic',
8
+ displayName: 'TopNavMegaMenuFeaturedCard — Basic',
9
+ description:
10
+ 'A promotional card with a title, description, and call-to-action link. Pass it to the featured slot of a TopNavMegaMenu to highlight announcements.',
11
+ isReady: true,
12
+ aspectRatio: 16 / 9,
13
+ componentsUsed: ['TopNavMegaMenuFeaturedCard'],
14
+ };
@@ -0,0 +1,16 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ 'use client';
4
+
5
+ import {TopNavMegaMenuFeaturedCard} from '@astryxdesign/core/TopNav';
6
+
7
+ export default function TopNavMegaMenuFeaturedCardBasic() {
8
+ return (
9
+ <TopNavMegaMenuFeaturedCard
10
+ title="What's New"
11
+ description="Check out the latest features and improvements in the Q2 release."
12
+ linkLabel="Read the changelog"
13
+ linkHref="#changelog"
14
+ />
15
+ );
16
+ }
@@ -0,0 +1,14 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /** @type {import('../../../../../core/src/docs-types').TemplateDoc} */
4
+ export const doc = {
5
+ type: 'block',
6
+ exampleFor: 'TopNavMegaMenuItem',
7
+ name: 'TopNavMegaMenuItem — Basic',
8
+ displayName: 'TopNavMegaMenuItem — Basic',
9
+ description:
10
+ 'Rich link items with an icon, title, and description. Use inside the items slot of a TopNavMegaMenu to describe each destination.',
11
+ isReady: true,
12
+ aspectRatio: 16 / 9,
13
+ componentsUsed: ['TopNavMegaMenuItem', 'Grid'],
14
+ };
@@ -0,0 +1,26 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ 'use client';
4
+
5
+ import {TopNavMegaMenuItem} from '@astryxdesign/core/TopNav';
6
+ import {Grid} from '@astryxdesign/core/Grid';
7
+ import {BoltIcon, CircleStackIcon} from '@heroicons/react/24/outline';
8
+
9
+ export default function TopNavMegaMenuItemBasic() {
10
+ return (
11
+ <Grid columns={2} gap={2}>
12
+ <TopNavMegaMenuItem
13
+ title="Edge Functions"
14
+ description="Run serverless code at the network edge"
15
+ icon={<BoltIcon width={20} height={20} />}
16
+ href="#edge"
17
+ />
18
+ <TopNavMegaMenuItem
19
+ title="Storage"
20
+ description="Object and file storage for your application"
21
+ icon={<CircleStackIcon width={20} height={20} />}
22
+ href="#storage"
23
+ />
24
+ </Grid>
25
+ );
26
+ }
@@ -0,0 +1,14 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /** @type {import('../../../../../core/src/docs-types').TemplateDoc} */
4
+ export const doc = {
5
+ type: 'block',
6
+ exampleFor: 'TopNavMenu',
7
+ name: 'TopNavMenu — Basic',
8
+ displayName: 'TopNavMenu — Basic',
9
+ description:
10
+ 'A dropdown menu inside a TopNav built from an items array with icons and descriptions. Use to group related destinations under a single trigger.',
11
+ isReady: true,
12
+ aspectRatio: 16 / 9,
13
+ componentsUsed: ['TopNav', 'TopNavHeading', 'TopNavItem', 'TopNavMenu'],
14
+ };
@@ -0,0 +1,43 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ 'use client';
4
+
5
+ import {
6
+ TopNav,
7
+ TopNavHeading,
8
+ TopNavItem,
9
+ TopNavMenu,
10
+ } from '@astryxdesign/core/TopNav';
11
+ import {ChartBarIcon, Cog6ToothIcon} from '@heroicons/react/24/outline';
12
+
13
+ export default function TopNavMenuBasic() {
14
+ return (
15
+ <TopNav
16
+ style={{width: 600}}
17
+ label="Main navigation"
18
+ heading={<TopNavHeading heading="Platform" />}
19
+ startContent={
20
+ <>
21
+ <TopNavItem label="Home" href="#" isSelected />
22
+ <TopNavMenu
23
+ label="Tools"
24
+ items={[
25
+ {
26
+ title: 'Analytics',
27
+ description: 'View traffic and engagement metrics',
28
+ icon: <ChartBarIcon />,
29
+ href: '#analytics',
30
+ },
31
+ {
32
+ title: 'Settings',
33
+ description: 'Configure your workspace',
34
+ icon: <Cog6ToothIcon />,
35
+ href: '#settings',
36
+ },
37
+ ]}
38
+ />
39
+ </>
40
+ }
41
+ />
42
+ );
43
+ }
@@ -0,0 +1,14 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /** @type {import('../../../../../core/src/docs-types').TemplateDoc} */
4
+ export const doc = {
5
+ type: 'block',
6
+ exampleFor: 'TypeaheadItem',
7
+ name: 'TypeaheadItem — Basic',
8
+ displayName: 'TypeaheadItem — Basic',
9
+ description:
10
+ 'A typeahead whose results are rendered with TypeaheadItem, adding a secondary description below each label. Use inside renderItem to keep custom results visually consistent.',
11
+ isReady: true,
12
+ aspectRatio: 16 / 9,
13
+ componentsUsed: ['Typeahead', 'TypeaheadItem', 'Center'],
14
+ };
@@ -0,0 +1,43 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ 'use client';
4
+
5
+ import {useState} from 'react';
6
+ import {Typeahead, TypeaheadItem} from '@astryxdesign/core/Typeahead';
7
+ import type {SearchableItem, SearchSource} from '@astryxdesign/core/Typeahead';
8
+ import {Center} from '@astryxdesign/core/Center';
9
+
10
+ interface PersonItem extends SearchableItem {
11
+ auxiliaryData: {role: string};
12
+ }
13
+
14
+ const people: PersonItem[] = [
15
+ {id: '1', label: 'Alice Johnson', auxiliaryData: {role: 'Engineer'}},
16
+ {id: '2', label: 'Bob Smith', auxiliaryData: {role: 'Designer'}},
17
+ {id: '3', label: 'Charlie Brown', auxiliaryData: {role: 'Product Manager'}},
18
+ ];
19
+
20
+ const peopleSource: SearchSource<PersonItem> = {
21
+ search: (query: string) =>
22
+ people.filter(p => p.label.toLowerCase().includes(query.toLowerCase())),
23
+ bootstrap: () => people,
24
+ };
25
+
26
+ export default function TypeaheadItemBasic() {
27
+ const [value, setValue] = useState<PersonItem | null>(null);
28
+
29
+ return (
30
+ <Center width={320}>
31
+ <Typeahead
32
+ label="Assignee"
33
+ placeholder="Search people..."
34
+ searchSource={peopleSource}
35
+ value={value}
36
+ onChange={setValue}
37
+ renderItem={(item: PersonItem) => (
38
+ <TypeaheadItem item={item} description={item.auxiliaryData.role} />
39
+ )}
40
+ />
41
+ </Center>
42
+ );
43
+ }
@@ -0,0 +1,14 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /** @type {import('../../../../../core/src/docs-types').TemplateDoc} */
4
+ export const doc = {
5
+ type: 'block',
6
+ exampleFor: 'VStack',
7
+ name: 'VStack — Basic',
8
+ displayName: 'VStack — Basic',
9
+ description:
10
+ 'A heading and paragraphs stacked vertically with a consistent gap. Use VStack whenever siblings should flow top to bottom with even spacing.',
11
+ isReady: true,
12
+ aspectRatio: 16 / 9,
13
+ componentsUsed: ['VStack', 'Text', 'Heading'],
14
+ };
@@ -0,0 +1,20 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ 'use client';
4
+
5
+ import {VStack} from '@astryxdesign/core/Layout';
6
+ import {Text, Heading} from '@astryxdesign/core/Text';
7
+
8
+ export default function VStackBasic() {
9
+ return (
10
+ <VStack gap={3}>
11
+ <Heading level={5}>Weekly Report</Heading>
12
+ <Text type="body" color="secondary">
13
+ VStack arranges its children in a vertical column.
14
+ </Text>
15
+ <Text type="body" color="secondary">
16
+ The gap prop controls the spacing between each item.
17
+ </Text>
18
+ </VStack>
19
+ );
20
+ }