@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.
- package/docs/layout.doc.dense.mjs +90 -0
- package/docs/layout.doc.mjs +160 -0
- package/docs/principles.doc.dense.mjs +2 -2
- package/docs/principles.doc.mjs +4 -0
- package/docs/principles.doc.zh.mjs +2 -2
- package/package.json +7 -7
- package/src/api/blog.mjs +192 -0
- package/src/api/blog.test.mjs +144 -0
- package/src/api/index.mjs +1 -0
- package/src/commands/agent-docs.mjs +3 -0
- package/src/commands/blog.mjs +60 -0
- package/src/commands/build-theme.import-path.test.mjs +2 -12
- package/src/commands/build-theme.mjs +117 -0
- package/src/commands/build-theme.prose.test.mjs +5 -15
- package/src/commands/build-theme.watch.test.mjs +149 -0
- package/src/commands/ensure-core-built.mjs +120 -0
- package/src/index.mjs +1 -0
- package/src/lib/error-codes.mjs +8 -0
- package/src/lib/site.mjs +20 -0
- package/templates/blocks/components/AvatarStatusDot/AvatarStatusDotVariants.doc.mjs +14 -0
- package/templates/blocks/components/AvatarStatusDot/AvatarStatusDotVariants.tsx +28 -0
- package/templates/blocks/components/Blockquote/BlockquoteTestimonials.doc.mjs +14 -0
- package/templates/blocks/components/Blockquote/BlockquoteTestimonials.tsx +34 -0
- package/templates/blocks/components/Blockquote/BlockquoteWithCite.doc.mjs +14 -0
- package/templates/blocks/components/Blockquote/BlockquoteWithCite.tsx +21 -0
- package/templates/blocks/components/BreadcrumbItem/BreadcrumbItemBasic.doc.mjs +14 -0
- package/templates/blocks/components/BreadcrumbItem/BreadcrumbItemBasic.tsx +15 -0
- package/templates/blocks/components/ButtonGroup/ButtonGroupBasic.doc.mjs +14 -0
- package/templates/blocks/components/ButtonGroup/ButtonGroupBasic.tsx +16 -0
- package/templates/blocks/components/ChatDictationButton/ChatDictationButtonBasic.doc.mjs +19 -0
- package/templates/blocks/components/ChatDictationButton/ChatDictationButtonBasic.tsx +34 -0
- package/templates/blocks/components/CheckboxListItem/CheckboxListItemBasic.doc.mjs +14 -0
- package/templates/blocks/components/CheckboxListItem/CheckboxListItemBasic.tsx +30 -0
- package/templates/blocks/components/CollapsibleGroup/CollapsibleGroupAccordion.doc.mjs +14 -0
- package/templates/blocks/components/CollapsibleGroup/CollapsibleGroupAccordion.tsx +31 -0
- package/templates/blocks/components/CommandPaletteEmpty/CommandPaletteEmptyBasic.doc.mjs +14 -0
- package/templates/blocks/components/CommandPaletteEmpty/CommandPaletteEmptyBasic.tsx +26 -0
- package/templates/blocks/components/CommandPaletteFooter/CommandPaletteFooterBasic.doc.mjs +14 -0
- package/templates/blocks/components/CommandPaletteFooter/CommandPaletteFooterBasic.tsx +32 -0
- package/templates/blocks/components/CommandPaletteGroup/CommandPaletteGroupBasic.doc.mjs +18 -0
- package/templates/blocks/components/CommandPaletteGroup/CommandPaletteGroupBasic.tsx +32 -0
- package/templates/blocks/components/CommandPaletteItem/CommandPaletteItemBasic.doc.mjs +14 -0
- package/templates/blocks/components/CommandPaletteItem/CommandPaletteItemBasic.tsx +27 -0
- package/templates/blocks/components/ContextMenu/ContextMenuBasic.doc.mjs +14 -0
- package/templates/blocks/components/ContextMenu/ContextMenuBasic.tsx +32 -0
- package/templates/blocks/components/DialogHeader/DialogHeaderBasic.doc.mjs +14 -0
- package/templates/blocks/components/DialogHeader/DialogHeaderBasic.tsx +30 -0
- package/templates/blocks/components/DropdownMenu/DropdownMenuShowcase.tsx +0 -6
- package/templates/blocks/components/DropdownMenuItem/DropdownMenuItemBasic.doc.mjs +14 -0
- package/templates/blocks/components/DropdownMenuItem/DropdownMenuItemBasic.tsx +27 -0
- package/templates/blocks/components/DropdownMenuItem/DropdownMenuItemShowcase.tsx +1 -5
- package/templates/blocks/components/FieldLabel/FieldLabelBasic.doc.mjs +14 -0
- package/templates/blocks/components/FieldLabel/FieldLabelBasic.tsx +20 -0
- package/templates/blocks/components/FieldStatus/FieldStatusBasic.doc.mjs +14 -0
- package/templates/blocks/components/FieldStatus/FieldStatusBasic.tsx +23 -0
- package/templates/blocks/components/FileInput/FileInputBasic.doc.mjs +14 -0
- package/templates/blocks/components/FileInput/FileInputBasic.tsx +22 -0
- package/templates/blocks/components/GridSpan/GridSpanColumns.doc.mjs +14 -0
- package/templates/blocks/components/GridSpan/GridSpanColumns.tsx +38 -0
- package/templates/blocks/components/HStack/HStackBasic.doc.mjs +14 -0
- package/templates/blocks/components/HStack/HStackBasic.tsx +16 -0
- package/templates/blocks/components/Hooks/useKeyboardHintHookUsage.doc.mjs +14 -0
- package/templates/blocks/components/Hooks/useKeyboardHintHookUsage.tsx +57 -0
- package/templates/blocks/components/InputGroup/InputGroupBasic.doc.mjs +14 -0
- package/templates/blocks/components/InputGroup/InputGroupBasic.tsx +27 -0
- package/templates/blocks/components/LayoutContent/LayoutContentBasic.doc.mjs +23 -0
- package/templates/blocks/components/LayoutContent/LayoutContentBasic.tsx +40 -0
- package/templates/blocks/components/LayoutFooter/LayoutFooterActions.doc.mjs +22 -0
- package/templates/blocks/components/LayoutFooter/LayoutFooterActions.tsx +41 -0
- package/templates/blocks/components/LayoutHeader/LayoutHeaderWithActions.doc.mjs +23 -0
- package/templates/blocks/components/LayoutHeader/LayoutHeaderWithActions.tsx +40 -0
- package/templates/blocks/components/LayoutPanel/LayoutPanelNavigation.doc.mjs +22 -0
- package/templates/blocks/components/LayoutPanel/LayoutPanelNavigation.tsx +37 -0
- package/templates/blocks/components/Lightbox/LightboxGallery.doc.mjs +14 -0
- package/templates/blocks/components/Lightbox/LightboxGallery.tsx +53 -0
- package/templates/blocks/components/Lightbox/LightboxShowcase.tsx +4 -3
- package/templates/blocks/components/Lightbox/LightboxVideo.doc.mjs +14 -0
- package/templates/blocks/components/Lightbox/LightboxVideo.tsx +27 -0
- package/templates/blocks/components/Lightbox/LightboxZoom.doc.mjs +14 -0
- package/templates/blocks/components/Lightbox/LightboxZoom.tsx +33 -0
- package/templates/blocks/components/MetadataListItem/MetadataListItemBasic.doc.mjs +14 -0
- package/templates/blocks/components/MetadataListItem/MetadataListItemBasic.tsx +19 -0
- package/templates/blocks/components/MobileNavToggle/MobileNavToggleBasic.doc.mjs +23 -0
- package/templates/blocks/components/MobileNavToggle/MobileNavToggleBasic.tsx +42 -0
- package/templates/blocks/components/MoreMenu/MoreMenuShowcase.tsx +0 -6
- package/templates/blocks/components/NavIcon/NavIconBasic.doc.mjs +14 -0
- package/templates/blocks/components/NavIcon/NavIconBasic.tsx +16 -0
- package/templates/blocks/components/RadioListItem/RadioListItemBasic.doc.mjs +14 -0
- package/templates/blocks/components/RadioListItem/RadioListItemBasic.tsx +30 -0
- package/templates/blocks/components/Resizable/ResizableSidebar.doc.mjs +25 -0
- package/templates/blocks/components/Resizable/ResizableSidebar.tsx +67 -0
- package/templates/blocks/components/SegmentedControlItem/SegmentedControlItemBasic.doc.mjs +14 -0
- package/templates/blocks/components/SegmentedControlItem/SegmentedControlItemBasic.tsx +21 -0
- package/templates/blocks/components/SelectorOption/SelectorOptionBasic.doc.mjs +14 -0
- package/templates/blocks/components/SelectorOption/SelectorOptionBasic.tsx +39 -0
- package/templates/blocks/components/SideNavCollapseButton/SideNavCollapseButtonBasic.doc.mjs +14 -0
- package/templates/blocks/components/SideNavCollapseButton/SideNavCollapseButtonBasic.tsx +55 -0
- package/templates/blocks/components/SideNavHeading/SideNavHeadingBasic.doc.mjs +14 -0
- package/templates/blocks/components/SideNavHeading/SideNavHeadingBasic.tsx +38 -0
- package/templates/blocks/components/SideNavItem/SideNavItemBasic.doc.mjs +14 -0
- package/templates/blocks/components/SideNavItem/SideNavItemBasic.tsx +49 -0
- package/templates/blocks/components/SideNavSection/SideNavSectionBasic.doc.mjs +14 -0
- package/templates/blocks/components/SideNavSection/SideNavSectionBasic.tsx +71 -0
- package/templates/blocks/components/StackItem/StackItemFill.doc.mjs +14 -0
- package/templates/blocks/components/StackItem/StackItemFill.tsx +28 -0
- package/templates/blocks/components/TabMenu/TabMenuBasic.doc.mjs +14 -0
- package/templates/blocks/components/TabMenu/TabMenuBasic.tsx +23 -0
- package/templates/blocks/components/ToggleButtonGroup/ToggleButtonGroupVertical.doc.mjs +14 -0
- package/templates/blocks/components/ToggleButtonGroup/ToggleButtonGroupVertical.tsx +47 -0
- package/templates/blocks/components/TopNavHeading/TopNavHeadingBasic.doc.mjs +14 -0
- package/templates/blocks/components/TopNavHeading/TopNavHeadingBasic.tsx +22 -0
- package/templates/blocks/components/TopNavItem/TopNavItemBasic.doc.mjs +14 -0
- package/templates/blocks/components/TopNavItem/TopNavItemBasic.tsx +21 -0
- package/templates/blocks/components/TopNavMegaMenu/TopNavMegaMenuBasic.doc.mjs +20 -0
- package/templates/blocks/components/TopNavMegaMenu/TopNavMegaMenuBasic.tsx +46 -0
- package/templates/blocks/components/TopNavMegaMenuFeaturedCard/TopNavMegaMenuFeaturedCardBasic.doc.mjs +14 -0
- package/templates/blocks/components/TopNavMegaMenuFeaturedCard/TopNavMegaMenuFeaturedCardBasic.tsx +16 -0
- package/templates/blocks/components/TopNavMegaMenuItem/TopNavMegaMenuItemBasic.doc.mjs +14 -0
- package/templates/blocks/components/TopNavMegaMenuItem/TopNavMegaMenuItemBasic.tsx +26 -0
- package/templates/blocks/components/TopNavMenu/TopNavMenuBasic.doc.mjs +14 -0
- package/templates/blocks/components/TopNavMenu/TopNavMenuBasic.tsx +43 -0
- package/templates/blocks/components/TypeaheadItem/TypeaheadItemBasic.doc.mjs +14 -0
- package/templates/blocks/components/TypeaheadItem/TypeaheadItemBasic.tsx +43 -0
- package/templates/blocks/components/VStack/VStackBasic.doc.mjs +14 -0
- package/templates/blocks/components/VStack/VStackBasic.tsx +20 -0
- package/templates/pages/kanban-board/page.tsx +729 -0
- package/templates/pages/kanban-board/template.doc.mjs +12 -0
- package/templates/pages/shell-side-nav/page.tsx +0 -1
- package/templates/blocks/components/TreeListBranches/TreeListBranchesShowcase.doc.mjs +0 -14
- package/templates/blocks/components/TreeListBranches/TreeListBranchesShowcase.tsx +0 -64
- package/templates/blocks/components/TreeListItem/TreeListItemShowcase.doc.mjs +0 -14
- package/templates/blocks/components/TreeListItem/TreeListItemShowcase.tsx +0 -60
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {Blockquote} from '@astryxdesign/core/Blockquote';
|
|
6
|
+
import {Grid, GridSpan} from '@astryxdesign/core/Grid';
|
|
7
|
+
import {Card} from '@astryxdesign/core/Card';
|
|
8
|
+
|
|
9
|
+
export default function BlockquoteTestimonials() {
|
|
10
|
+
return (
|
|
11
|
+
<Grid columns={2} gap={3} style={{maxWidth: 600}}>
|
|
12
|
+
<Card padding={4}>
|
|
13
|
+
<Blockquote cite="Sarah K., Lead Engineer">
|
|
14
|
+
Shipping UI has never been this fast. Our team went from design to
|
|
15
|
+
production in a single afternoon.
|
|
16
|
+
</Blockquote>
|
|
17
|
+
</Card>
|
|
18
|
+
<Card padding={4}>
|
|
19
|
+
<Blockquote cite="Marcus T., Product Designer">
|
|
20
|
+
The token system means every new screen just looks right — no manual
|
|
21
|
+
color or spacing decisions.
|
|
22
|
+
</Blockquote>
|
|
23
|
+
</Card>
|
|
24
|
+
<GridSpan columns={2}>
|
|
25
|
+
<Card padding={4}>
|
|
26
|
+
<Blockquote cite="Priya L., Engineering Manager">
|
|
27
|
+
Onboarding a new engineer used to take a week of design review. Now
|
|
28
|
+
they're shipping accessible, polished components on day one.
|
|
29
|
+
</Blockquote>
|
|
30
|
+
</Card>
|
|
31
|
+
</GridSpan>
|
|
32
|
+
</Grid>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
@@ -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: 'Blockquote',
|
|
7
|
+
name: 'Blockquote — With Attribution',
|
|
8
|
+
displayName: 'Blockquote — With Attribution',
|
|
9
|
+
description:
|
|
10
|
+
'A plain quote and a quote with a cite attribution. Use cite to credit the original author or source.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 4 / 3,
|
|
13
|
+
componentsUsed: ['Blockquote', 'Layout'],
|
|
14
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {Blockquote} from '@astryxdesign/core/Blockquote';
|
|
6
|
+
import {VStack} from '@astryxdesign/core/Layout';
|
|
7
|
+
|
|
8
|
+
export default function BlockquoteWithCite() {
|
|
9
|
+
return (
|
|
10
|
+
<VStack gap={4} style={{maxWidth: 500}}>
|
|
11
|
+
<Blockquote>
|
|
12
|
+
Design is not just what it looks like and feels like. Design is how it
|
|
13
|
+
works.
|
|
14
|
+
</Blockquote>
|
|
15
|
+
<Blockquote cite="Steve Jobs">
|
|
16
|
+
The people who are crazy enough to think they can change the world are
|
|
17
|
+
the ones who do.
|
|
18
|
+
</Blockquote>
|
|
19
|
+
</VStack>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
@@ -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: 'BreadcrumbItem',
|
|
7
|
+
name: 'BreadcrumbItem — Basic',
|
|
8
|
+
displayName: 'BreadcrumbItem — Basic',
|
|
9
|
+
description:
|
|
10
|
+
'Breadcrumb links inside a Breadcrumbs trail. Ancestor pages get an href; mark the last item with isCurrent to render it as plain text for the current page.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 16 / 9,
|
|
13
|
+
componentsUsed: ['Breadcrumbs', 'BreadcrumbItem'],
|
|
14
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {Breadcrumbs, BreadcrumbItem} from '@astryxdesign/core/Breadcrumbs';
|
|
6
|
+
|
|
7
|
+
export default function BreadcrumbItemBasic() {
|
|
8
|
+
return (
|
|
9
|
+
<Breadcrumbs>
|
|
10
|
+
<BreadcrumbItem href="/">Home</BreadcrumbItem>
|
|
11
|
+
<BreadcrumbItem href="/settings">Settings</BreadcrumbItem>
|
|
12
|
+
<BreadcrumbItem isCurrent>Profile</BreadcrumbItem>
|
|
13
|
+
</Breadcrumbs>
|
|
14
|
+
);
|
|
15
|
+
}
|
|
@@ -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: 'ButtonGroup',
|
|
7
|
+
name: 'ButtonGroup — Basic',
|
|
8
|
+
displayName: 'ButtonGroup — Basic',
|
|
9
|
+
description:
|
|
10
|
+
'Three related actions joined into a single connected control. Provide a group label for accessibility and keep all buttons the same variant so they read as one unit.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 16 / 9,
|
|
13
|
+
componentsUsed: ['ButtonGroup', 'Button'],
|
|
14
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {ButtonGroup} from '@astryxdesign/core/ButtonGroup';
|
|
6
|
+
import {Button} from '@astryxdesign/core/Button';
|
|
7
|
+
|
|
8
|
+
export default function ButtonGroupBasic() {
|
|
9
|
+
return (
|
|
10
|
+
<ButtonGroup label="Text editing actions">
|
|
11
|
+
<Button label="Copy" />
|
|
12
|
+
<Button label="Cut" />
|
|
13
|
+
<Button label="Paste" />
|
|
14
|
+
</ButtonGroup>
|
|
15
|
+
);
|
|
16
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
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: 'ChatDictationButton',
|
|
7
|
+
name: 'ChatDictationButton — Basic',
|
|
8
|
+
displayName: 'ChatDictationButton — Basic',
|
|
9
|
+
description:
|
|
10
|
+
'A dictation button wired to useChatDictation and placed in the sendActions slot of a ChatComposer. Click the microphone to transcribe speech into the input.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 16 / 9,
|
|
13
|
+
componentsUsed: [
|
|
14
|
+
'Chat',
|
|
15
|
+
'ChatDictationButton',
|
|
16
|
+
'ChatComposer',
|
|
17
|
+
'ChatComposerInput',
|
|
18
|
+
],
|
|
19
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {useRef} from 'react';
|
|
6
|
+
import {
|
|
7
|
+
ChatDictationButton,
|
|
8
|
+
ChatComposer,
|
|
9
|
+
ChatComposerInput,
|
|
10
|
+
useChatDictation,
|
|
11
|
+
} from '@astryxdesign/core/Chat';
|
|
12
|
+
import type {ChatComposerInputHandle} from '@astryxdesign/core/Chat';
|
|
13
|
+
import {Stack} from '@astryxdesign/core/Layout';
|
|
14
|
+
|
|
15
|
+
export default function ChatDictationButtonBasic() {
|
|
16
|
+
const inputRef = useRef<ChatComposerInputHandle>(null);
|
|
17
|
+
|
|
18
|
+
const dictation = useChatDictation({
|
|
19
|
+
inputRef,
|
|
20
|
+
onResult: text => {
|
|
21
|
+
console.log('Dictation result:', text);
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<Stack direction="vertical" width="100%" style={{maxWidth: 450}}>
|
|
27
|
+
<ChatComposer
|
|
28
|
+
onSubmit={value => console.log('Submit:', value)}
|
|
29
|
+
input={<ChatComposerInput handleRef={inputRef} />}
|
|
30
|
+
sendActions={<ChatDictationButton dictation={dictation} />}
|
|
31
|
+
/>
|
|
32
|
+
</Stack>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
@@ -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: 'CheckboxListItem',
|
|
7
|
+
name: 'CheckboxListItem — Basic',
|
|
8
|
+
displayName: 'CheckboxListItem — Basic',
|
|
9
|
+
description:
|
|
10
|
+
'Checkbox items with labels and descriptions inside a controlled CheckboxList. Use for multi-select option groups like notification preferences.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 16 / 9,
|
|
13
|
+
componentsUsed: ['CheckboxList', 'CheckboxListItem'],
|
|
14
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {useState} from 'react';
|
|
6
|
+
import {CheckboxList, CheckboxListItem} from '@astryxdesign/core/CheckboxList';
|
|
7
|
+
|
|
8
|
+
export default function CheckboxListItemBasic() {
|
|
9
|
+
const [value, setValue] = useState<string[]>(['updates']);
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<CheckboxList label="Email preferences" value={value} onChange={setValue}>
|
|
13
|
+
<CheckboxListItem
|
|
14
|
+
label="Product updates"
|
|
15
|
+
value="updates"
|
|
16
|
+
description="New features and improvements"
|
|
17
|
+
/>
|
|
18
|
+
<CheckboxListItem
|
|
19
|
+
label="Security alerts"
|
|
20
|
+
value="security"
|
|
21
|
+
description="Important account security notifications"
|
|
22
|
+
/>
|
|
23
|
+
<CheckboxListItem
|
|
24
|
+
label="Marketing"
|
|
25
|
+
value="marketing"
|
|
26
|
+
description="Tips, offers, and promotions"
|
|
27
|
+
/>
|
|
28
|
+
</CheckboxList>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
@@ -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: 'CollapsibleGroup',
|
|
7
|
+
name: 'CollapsibleGroup — Accordion',
|
|
8
|
+
displayName: 'CollapsibleGroup — Accordion',
|
|
9
|
+
description:
|
|
10
|
+
'An accordion built with type="single": opening one Collapsible automatically closes the others. Use defaultValue to pre-expand the most important section.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 16 / 9,
|
|
13
|
+
componentsUsed: ['CollapsibleGroup', 'Collapsible', 'VStack', 'Text'],
|
|
14
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {Collapsible, CollapsibleGroup} from '@astryxdesign/core/Collapsible';
|
|
6
|
+
import {VStack} from '@astryxdesign/core/Layout';
|
|
7
|
+
import {Text} from '@astryxdesign/core/Text';
|
|
8
|
+
|
|
9
|
+
export default function CollapsibleGroupAccordion() {
|
|
10
|
+
return (
|
|
11
|
+
<CollapsibleGroup type="single" defaultValue="account">
|
|
12
|
+
<VStack gap={2} width="100%">
|
|
13
|
+
<Collapsible trigger="Account" value="account">
|
|
14
|
+
<Text type="body" color="secondary">
|
|
15
|
+
Manage your profile details, email address, and password.
|
|
16
|
+
</Text>
|
|
17
|
+
</Collapsible>
|
|
18
|
+
<Collapsible trigger="Notifications" value="notifications">
|
|
19
|
+
<Text type="body" color="secondary">
|
|
20
|
+
Choose which activity triggers email and push notifications.
|
|
21
|
+
</Text>
|
|
22
|
+
</Collapsible>
|
|
23
|
+
<Collapsible trigger="Billing" value="billing">
|
|
24
|
+
<Text type="body" color="secondary">
|
|
25
|
+
View invoices and update your payment method.
|
|
26
|
+
</Text>
|
|
27
|
+
</Collapsible>
|
|
28
|
+
</VStack>
|
|
29
|
+
</CollapsibleGroup>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
@@ -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: 'CommandPaletteEmpty',
|
|
7
|
+
name: 'CommandPaletteEmpty — Basic',
|
|
8
|
+
displayName: 'CommandPaletteEmpty — Basic',
|
|
9
|
+
description:
|
|
10
|
+
'A command palette with no results, showing a custom empty message via emptyBootstrapText. Use to explain why the palette is empty and what the user can do next.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 16 / 9,
|
|
13
|
+
componentsUsed: ['CommandPalette', 'CommandPaletteEmpty', 'Text'],
|
|
14
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {useMemo} from 'react';
|
|
6
|
+
import {CommandPalette} from '@astryxdesign/core/CommandPalette';
|
|
7
|
+
import {Text} from '@astryxdesign/core/Text';
|
|
8
|
+
import {createStaticSource} from '@astryxdesign/core/Typeahead';
|
|
9
|
+
|
|
10
|
+
export default function CommandPaletteEmptyBasic() {
|
|
11
|
+
const emptySource = useMemo(() => createStaticSource([]), []);
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<CommandPalette
|
|
15
|
+
isOpen
|
|
16
|
+
isInline
|
|
17
|
+
onOpenChange={() => {}}
|
|
18
|
+
searchSource={emptySource}
|
|
19
|
+
emptyBootstrapText={
|
|
20
|
+
<Text type="supporting" color="secondary">
|
|
21
|
+
No commands available
|
|
22
|
+
</Text>
|
|
23
|
+
}
|
|
24
|
+
/>
|
|
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: 'CommandPaletteFooter',
|
|
7
|
+
name: 'CommandPaletteFooter — Basic',
|
|
8
|
+
displayName: 'CommandPaletteFooter — Basic',
|
|
9
|
+
description:
|
|
10
|
+
'A command palette footer with no children, rendering the built-in keyboard navigation hints. Use CommandPaletteFooter without content to get the default arrow-key, Enter, and Esc hints below the results list.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 16 / 9,
|
|
13
|
+
componentsUsed: ['CommandPalette', 'CommandPaletteFooter'],
|
|
14
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {useMemo} from 'react';
|
|
6
|
+
import {
|
|
7
|
+
CommandPalette,
|
|
8
|
+
CommandPaletteFooter,
|
|
9
|
+
} from '@astryxdesign/core/CommandPalette';
|
|
10
|
+
import {createStaticSource} from '@astryxdesign/core/Typeahead';
|
|
11
|
+
|
|
12
|
+
export default function CommandPaletteFooterBasic() {
|
|
13
|
+
const source = useMemo(
|
|
14
|
+
() =>
|
|
15
|
+
createStaticSource([
|
|
16
|
+
{id: 'new-file', label: 'New File'},
|
|
17
|
+
{id: 'open-recent', label: 'Open Recent'},
|
|
18
|
+
{id: 'save-all', label: 'Save All'},
|
|
19
|
+
]),
|
|
20
|
+
[],
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<CommandPalette
|
|
25
|
+
isOpen
|
|
26
|
+
isInline
|
|
27
|
+
onOpenChange={() => {}}
|
|
28
|
+
searchSource={source}
|
|
29
|
+
footer={<CommandPaletteFooter />}
|
|
30
|
+
/>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
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: 'CommandPaletteGroup',
|
|
7
|
+
name: 'CommandPaletteGroup — Basic',
|
|
8
|
+
displayName: 'CommandPaletteGroup — Basic',
|
|
9
|
+
description:
|
|
10
|
+
'Command palette items organized under group headings using the composed CommandPaletteGroup form. Use to separate related commands into labeled sections.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 16 / 9,
|
|
13
|
+
componentsUsed: [
|
|
14
|
+
'CommandPaletteGroup',
|
|
15
|
+
'CommandPaletteItem',
|
|
16
|
+
'CommandPaletteList',
|
|
17
|
+
],
|
|
18
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
CommandPaletteList,
|
|
7
|
+
CommandPaletteGroup,
|
|
8
|
+
CommandPaletteItem,
|
|
9
|
+
} from '@astryxdesign/core/CommandPalette';
|
|
10
|
+
|
|
11
|
+
export default function CommandPaletteGroupBasic() {
|
|
12
|
+
return (
|
|
13
|
+
<CommandPaletteList>
|
|
14
|
+
<CommandPaletteGroup heading="Navigation">
|
|
15
|
+
<CommandPaletteItem value="home" onSelect={() => {}}>
|
|
16
|
+
Go to Home
|
|
17
|
+
</CommandPaletteItem>
|
|
18
|
+
<CommandPaletteItem value="dashboard" onSelect={() => {}}>
|
|
19
|
+
Go to Dashboard
|
|
20
|
+
</CommandPaletteItem>
|
|
21
|
+
</CommandPaletteGroup>
|
|
22
|
+
<CommandPaletteGroup heading="Actions">
|
|
23
|
+
<CommandPaletteItem value="new-file" onSelect={() => {}}>
|
|
24
|
+
New File
|
|
25
|
+
</CommandPaletteItem>
|
|
26
|
+
<CommandPaletteItem value="save-all" onSelect={() => {}}>
|
|
27
|
+
Save All
|
|
28
|
+
</CommandPaletteItem>
|
|
29
|
+
</CommandPaletteGroup>
|
|
30
|
+
</CommandPaletteList>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
@@ -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: 'CommandPaletteItem',
|
|
7
|
+
name: 'CommandPaletteItem — Basic',
|
|
8
|
+
displayName: 'CommandPaletteItem — Basic',
|
|
9
|
+
description:
|
|
10
|
+
'Selectable command palette items inside a CommandPaletteList, including highlighted and disabled states. Use when composing a palette manually instead of a search source.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 16 / 9,
|
|
13
|
+
componentsUsed: ['CommandPaletteItem', 'CommandPaletteList'],
|
|
14
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
CommandPaletteList,
|
|
7
|
+
CommandPaletteItem,
|
|
8
|
+
} from '@astryxdesign/core/CommandPalette';
|
|
9
|
+
|
|
10
|
+
export default function CommandPaletteItemBasic() {
|
|
11
|
+
return (
|
|
12
|
+
<CommandPaletteList>
|
|
13
|
+
<CommandPaletteItem value="new-file" onSelect={() => {}}>
|
|
14
|
+
New File
|
|
15
|
+
</CommandPaletteItem>
|
|
16
|
+
<CommandPaletteItem value="open-recent" isHighlighted onSelect={() => {}}>
|
|
17
|
+
Open Recent
|
|
18
|
+
</CommandPaletteItem>
|
|
19
|
+
<CommandPaletteItem value="save-all" onSelect={() => {}}>
|
|
20
|
+
Save All
|
|
21
|
+
</CommandPaletteItem>
|
|
22
|
+
<CommandPaletteItem value="publish" isDisabled>
|
|
23
|
+
Publish (disabled)
|
|
24
|
+
</CommandPaletteItem>
|
|
25
|
+
</CommandPaletteList>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
@@ -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: 'ContextMenu',
|
|
7
|
+
name: 'ContextMenu — Basic',
|
|
8
|
+
displayName: 'ContextMenu — Basic',
|
|
9
|
+
description:
|
|
10
|
+
'A right-click area with action items and a divider separating a destructive action. Use to provide contextual actions for a specific element or region.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 16 / 9,
|
|
13
|
+
componentsUsed: ['ContextMenu'],
|
|
14
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {ContextMenu} from '@astryxdesign/core/ContextMenu';
|
|
6
|
+
|
|
7
|
+
export default function ContextMenuBasic() {
|
|
8
|
+
return (
|
|
9
|
+
<ContextMenu
|
|
10
|
+
items={[
|
|
11
|
+
{label: 'Cut', onClick: () => {}},
|
|
12
|
+
{label: 'Copy', onClick: () => {}},
|
|
13
|
+
{label: 'Paste', onClick: () => {}},
|
|
14
|
+
{type: 'divider'},
|
|
15
|
+
{label: 'Delete', onClick: () => {}},
|
|
16
|
+
]}>
|
|
17
|
+
<div
|
|
18
|
+
style={{
|
|
19
|
+
padding: '48px',
|
|
20
|
+
borderWidth: '2px',
|
|
21
|
+
borderStyle: 'dashed',
|
|
22
|
+
borderColor: '#d1d5db',
|
|
23
|
+
borderRadius: '8px',
|
|
24
|
+
textAlign: 'center',
|
|
25
|
+
color: '#6b7280',
|
|
26
|
+
userSelect: 'none',
|
|
27
|
+
}}>
|
|
28
|
+
Right-click this area
|
|
29
|
+
</div>
|
|
30
|
+
</ContextMenu>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
@@ -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: 'DialogHeader',
|
|
7
|
+
name: 'DialogHeader — Basic',
|
|
8
|
+
displayName: 'DialogHeader — Basic',
|
|
9
|
+
description:
|
|
10
|
+
'A DialogHeader with a title, subtitle, and close button, placed in the header slot of a Dialog Layout. Pass onOpenChange to render the close button.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 16 / 9,
|
|
13
|
+
componentsUsed: ['Dialog', 'DialogHeader', 'Layout', 'LayoutContent', 'Text'],
|
|
14
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {Dialog, DialogHeader} from '@astryxdesign/core/Dialog';
|
|
6
|
+
import {Layout, LayoutContent} from '@astryxdesign/core/Layout';
|
|
7
|
+
import {Text} from '@astryxdesign/core/Text';
|
|
8
|
+
|
|
9
|
+
export default function DialogHeaderBasic() {
|
|
10
|
+
return (
|
|
11
|
+
<Dialog isOpen isInline onOpenChange={() => {}}>
|
|
12
|
+
<Layout
|
|
13
|
+
header={
|
|
14
|
+
<DialogHeader
|
|
15
|
+
title="Invite teammates"
|
|
16
|
+
subtitle="Send invitations to join your workspace"
|
|
17
|
+
onOpenChange={() => {}}
|
|
18
|
+
/>
|
|
19
|
+
}
|
|
20
|
+
content={
|
|
21
|
+
<LayoutContent>
|
|
22
|
+
<Text type="body" color="secondary">
|
|
23
|
+
Dialog body content goes here.
|
|
24
|
+
</Text>
|
|
25
|
+
</LayoutContent>
|
|
26
|
+
}
|
|
27
|
+
/>
|
|
28
|
+
</Dialog>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
@@ -2,17 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
'use client';
|
|
4
4
|
|
|
5
|
-
import {useState} from 'react';
|
|
6
5
|
import {DropdownMenu} from '@astryxdesign/core/DropdownMenu';
|
|
7
6
|
|
|
8
7
|
export default function DropdownMenuShowcase() {
|
|
9
|
-
const [isMenuOpen, setIsMenuOpen] = useState(false);
|
|
10
|
-
|
|
11
8
|
return (
|
|
12
9
|
<DropdownMenu
|
|
13
|
-
isMenuOpen={isMenuOpen}
|
|
14
|
-
onOpenChange={setIsMenuOpen}
|
|
15
|
-
hasAutoFocus={false}
|
|
16
10
|
button={{label: 'Actions'}}
|
|
17
11
|
items={[
|
|
18
12
|
{label: 'Edit', onClick: () => {}},
|
|
@@ -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: 'DropdownMenuItem',
|
|
7
|
+
name: 'DropdownMenuItem — Basic',
|
|
8
|
+
displayName: 'DropdownMenuItem — Basic',
|
|
9
|
+
description:
|
|
10
|
+
'Dropdown menu items with labels and secondary descriptions. Use DropdownMenuItem to render custom menu entries with consistent styling.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 16 / 9,
|
|
13
|
+
componentsUsed: ['DropdownMenu', 'DropdownMenuItem'],
|
|
14
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {DropdownMenu, DropdownMenuItem} from '@astryxdesign/core/DropdownMenu';
|
|
6
|
+
|
|
7
|
+
export default function DropdownMenuItemBasic() {
|
|
8
|
+
return (
|
|
9
|
+
<DropdownMenu button={{label: 'Actions'}}>
|
|
10
|
+
<DropdownMenuItem
|
|
11
|
+
label="Edit"
|
|
12
|
+
description="Modify this item"
|
|
13
|
+
onClick={() => {}}
|
|
14
|
+
/>
|
|
15
|
+
<DropdownMenuItem
|
|
16
|
+
label="Duplicate"
|
|
17
|
+
description="Create a copy"
|
|
18
|
+
onClick={() => {}}
|
|
19
|
+
/>
|
|
20
|
+
<DropdownMenuItem
|
|
21
|
+
label="Delete"
|
|
22
|
+
description="This action cannot be undone"
|
|
23
|
+
onClick={() => {}}
|
|
24
|
+
/>
|
|
25
|
+
</DropdownMenu>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
@@ -65,11 +65,7 @@ const TrashIcon = (props: React.SVGProps<SVGSVGElement>) => (
|
|
|
65
65
|
|
|
66
66
|
export default function DropdownMenuItemShowcase() {
|
|
67
67
|
return (
|
|
68
|
-
<DropdownMenu
|
|
69
|
-
button={{label: 'Actions'}}
|
|
70
|
-
isMenuOpen
|
|
71
|
-
hasAutoFocus={false}
|
|
72
|
-
onOpenChange={() => {}}>
|
|
68
|
+
<DropdownMenu button={{label: 'Actions'}}>
|
|
73
69
|
<DropdownMenuItem
|
|
74
70
|
icon={PencilIcon}
|
|
75
71
|
label="Edit"
|