@astryxdesign/cli 0.1.2-canary.deb5aa0 → 0.1.2-canary.df46db7
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.mjs +117 -0
- package/src/commands/build-theme.watch.test.mjs +157 -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 -5
- 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 -4
- 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/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 -5
- 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/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 {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,16 +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
10
|
button={{label: 'Actions'}}
|
|
16
11
|
items={[
|
|
17
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,10 +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
|
-
onOpenChange={() => {}}>
|
|
68
|
+
<DropdownMenu button={{label: 'Actions'}}>
|
|
72
69
|
<DropdownMenuItem
|
|
73
70
|
icon={PencilIcon}
|
|
74
71
|
label="Edit"
|
|
@@ -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: 'FieldLabel',
|
|
7
|
+
name: 'FieldLabel — Basic',
|
|
8
|
+
displayName: 'FieldLabel — Basic',
|
|
9
|
+
description:
|
|
10
|
+
'Standalone labels with required and optional indicators and a helper description. Use when labeling a custom control that does not render its own label.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 16 / 9,
|
|
13
|
+
componentsUsed: ['Field', 'FieldLabel', 'VStack'],
|
|
14
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {FieldLabel} from '@astryxdesign/core/Field';
|
|
6
|
+
import {VStack} from '@astryxdesign/core/Layout';
|
|
7
|
+
|
|
8
|
+
export default function FieldLabelBasic() {
|
|
9
|
+
return (
|
|
10
|
+
<VStack gap={4}>
|
|
11
|
+
<FieldLabel label="Email address" inputID="email-input" isRequired />
|
|
12
|
+
<FieldLabel
|
|
13
|
+
label="Phone number"
|
|
14
|
+
inputID="phone-input"
|
|
15
|
+
isOptional
|
|
16
|
+
description="Include country code for international numbers"
|
|
17
|
+
/>
|
|
18
|
+
</VStack>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
@@ -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: 'FieldStatus',
|
|
7
|
+
name: 'FieldStatus — Basic',
|
|
8
|
+
displayName: 'FieldStatus — Basic',
|
|
9
|
+
description:
|
|
10
|
+
'Detached error and success messages for validation feedback. Use below checkboxes, switches, or custom controls where an attached status would overlap.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 16 / 9,
|
|
13
|
+
componentsUsed: ['FieldStatus', 'VStack'],
|
|
14
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {FieldStatus} from '@astryxdesign/core/FieldStatus';
|
|
6
|
+
import {VStack} from '@astryxdesign/core/Layout';
|
|
7
|
+
|
|
8
|
+
export default function FieldStatusBasic() {
|
|
9
|
+
return (
|
|
10
|
+
<VStack gap={4}>
|
|
11
|
+
<FieldStatus
|
|
12
|
+
type="error"
|
|
13
|
+
message="This field is required"
|
|
14
|
+
variant="detached"
|
|
15
|
+
/>
|
|
16
|
+
<FieldStatus
|
|
17
|
+
type="success"
|
|
18
|
+
message="Your changes have been saved"
|
|
19
|
+
variant="detached"
|
|
20
|
+
/>
|
|
21
|
+
</VStack>
|
|
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: 'FileInput',
|
|
7
|
+
name: 'FileInput — Basic',
|
|
8
|
+
displayName: 'FileInput — Basic',
|
|
9
|
+
description:
|
|
10
|
+
'A controlled single-file upload with accepted types, a size limit, and helper text. Use for standard document upload fields in forms.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 16 / 9,
|
|
13
|
+
componentsUsed: ['FileInput'],
|
|
14
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {useState} from 'react';
|
|
6
|
+
import {FileInput} from '@astryxdesign/core/FileInput';
|
|
7
|
+
|
|
8
|
+
export default function FileInputBasic() {
|
|
9
|
+
const [value, setValue] = useState<File | File[] | null>(null);
|
|
10
|
+
return (
|
|
11
|
+
<div style={{width: 350}}>
|
|
12
|
+
<FileInput
|
|
13
|
+
label="Resume"
|
|
14
|
+
value={value}
|
|
15
|
+
onChange={setValue}
|
|
16
|
+
accept=".pdf,.docx"
|
|
17
|
+
description="PDF or Word document, up to 5 MB"
|
|
18
|
+
maxSize={5 * 1024 * 1024}
|
|
19
|
+
/>
|
|
20
|
+
</div>
|
|
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: 'GridSpan',
|
|
7
|
+
name: 'GridSpan — Columns',
|
|
8
|
+
displayName: 'GridSpan — Columns',
|
|
9
|
+
description:
|
|
10
|
+
'Grid items spanning two of three columns. Wrap a grid child in GridSpan to make it occupy multiple columns for asymmetric layouts.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 16 / 9,
|
|
13
|
+
componentsUsed: ['GridSpan', 'Grid', 'Card', 'Text'],
|
|
14
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {Grid, GridSpan} from '@astryxdesign/core/Grid';
|
|
6
|
+
import {Card} from '@astryxdesign/core/Card';
|
|
7
|
+
import {Text} from '@astryxdesign/core/Text';
|
|
8
|
+
|
|
9
|
+
export default function GridSpanColumns() {
|
|
10
|
+
return (
|
|
11
|
+
<Grid columns={3} gap={3} width={400}>
|
|
12
|
+
<GridSpan columns={2}>
|
|
13
|
+
<Card height={80}>
|
|
14
|
+
<Text type="body" color="secondary">
|
|
15
|
+
Spans 2 columns
|
|
16
|
+
</Text>
|
|
17
|
+
</Card>
|
|
18
|
+
</GridSpan>
|
|
19
|
+
<Card height={80}>
|
|
20
|
+
<Text type="body" color="secondary">
|
|
21
|
+
1 col
|
|
22
|
+
</Text>
|
|
23
|
+
</Card>
|
|
24
|
+
<Card height={80}>
|
|
25
|
+
<Text type="body" color="secondary">
|
|
26
|
+
1 col
|
|
27
|
+
</Text>
|
|
28
|
+
</Card>
|
|
29
|
+
<GridSpan columns={2}>
|
|
30
|
+
<Card height={80}>
|
|
31
|
+
<Text type="body" color="secondary">
|
|
32
|
+
Spans 2 columns
|
|
33
|
+
</Text>
|
|
34
|
+
</Card>
|
|
35
|
+
</GridSpan>
|
|
36
|
+
</Grid>
|
|
37
|
+
);
|
|
38
|
+
}
|