@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,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
|
+
}
|
|
@@ -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: 'HStack',
|
|
7
|
+
name: 'HStack — Basic',
|
|
8
|
+
displayName: 'HStack — Basic',
|
|
9
|
+
description:
|
|
10
|
+
'Items arranged in a horizontal row with a consistent gap and centered vertical alignment. Use HStack whenever siblings should sit side by side.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 16 / 9,
|
|
13
|
+
componentsUsed: ['HStack', 'Badge'],
|
|
14
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {HStack} from '@astryxdesign/core/Layout';
|
|
6
|
+
import {Badge} from '@astryxdesign/core/Badge';
|
|
7
|
+
|
|
8
|
+
export default function HStackBasic() {
|
|
9
|
+
return (
|
|
10
|
+
<HStack gap={2} vAlign="center">
|
|
11
|
+
<Badge label="React" />
|
|
12
|
+
<Badge label="TypeScript" />
|
|
13
|
+
<Badge label="Node.js" />
|
|
14
|
+
</HStack>
|
|
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: 'useKeyboardHint',
|
|
7
|
+
name: 'useKeyboardHint — Arrow-key Hint',
|
|
8
|
+
displayName: 'useKeyboardHint — Arrow-key Hint',
|
|
9
|
+
description:
|
|
10
|
+
'Toolbar shows an ephemeral "← → to navigate" hint on first keyboard focus via useKeyboardHint, teaching sighted keyboard users that arrows move within the group.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 16 / 9,
|
|
13
|
+
componentsUsed: ['Toolbar', 'Button', 'Icon', 'Card', 'Section', 'Text', 'Layout'],
|
|
14
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {Toolbar} from '@astryxdesign/core/Toolbar';
|
|
6
|
+
import {Button} from '@astryxdesign/core/Button';
|
|
7
|
+
import {Icon} from '@astryxdesign/core/Icon';
|
|
8
|
+
import {Card} from '@astryxdesign/core/Card';
|
|
9
|
+
import {Section} from '@astryxdesign/core/Section';
|
|
10
|
+
import {Text} from '@astryxdesign/core/Text';
|
|
11
|
+
import {VStack} from '@astryxdesign/core/Layout';
|
|
12
|
+
import {BoldIcon, ItalicIcon, UnderlineIcon} from '@heroicons/react/24/outline';
|
|
13
|
+
|
|
14
|
+
export default function UseKeyboardHintHookUsage() {
|
|
15
|
+
return (
|
|
16
|
+
<Card style={{width: 420}}>
|
|
17
|
+
<Toolbar
|
|
18
|
+
label="Text formatting"
|
|
19
|
+
dividers={['bottom']}
|
|
20
|
+
startContent={
|
|
21
|
+
<>
|
|
22
|
+
<Button
|
|
23
|
+
label="Bold"
|
|
24
|
+
variant="ghost"
|
|
25
|
+
icon={<Icon icon={BoldIcon} />}
|
|
26
|
+
isIconOnly
|
|
27
|
+
/>
|
|
28
|
+
<Button
|
|
29
|
+
label="Italic"
|
|
30
|
+
variant="ghost"
|
|
31
|
+
icon={<Icon icon={ItalicIcon} />}
|
|
32
|
+
isIconOnly
|
|
33
|
+
/>
|
|
34
|
+
<Button
|
|
35
|
+
label="Underline"
|
|
36
|
+
variant="ghost"
|
|
37
|
+
icon={<Icon icon={UnderlineIcon} />}
|
|
38
|
+
isIconOnly
|
|
39
|
+
/>
|
|
40
|
+
</>
|
|
41
|
+
}
|
|
42
|
+
/>
|
|
43
|
+
<Section>
|
|
44
|
+
<VStack gap={1}>
|
|
45
|
+
<Text type="body" weight="bold">
|
|
46
|
+
Keyboard-friendly by default
|
|
47
|
+
</Text>
|
|
48
|
+
<Text type="supporting" color="secondary">
|
|
49
|
+
Tab into the toolbar with your keyboard and Toolbar shows an
|
|
50
|
+
ephemeral "← → to navigate" hint — powered by useKeyboardHint — so
|
|
51
|
+
sighted keyboard users learn that arrows move within the group.
|
|
52
|
+
</Text>
|
|
53
|
+
</VStack>
|
|
54
|
+
</Section>
|
|
55
|
+
</Card>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
@@ -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: 'InputGroup',
|
|
7
|
+
name: 'InputGroup — Basic',
|
|
8
|
+
displayName: 'InputGroup — Basic',
|
|
9
|
+
description:
|
|
10
|
+
'A currency field with static prefix and suffix addons around a TextInput. Use InputGroupText to clarify units or input format.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 16 / 9,
|
|
13
|
+
componentsUsed: ['InputGroup', 'InputGroupText', 'TextInput'],
|
|
14
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {useState} from 'react';
|
|
6
|
+
import {InputGroup, InputGroupText} from '@astryxdesign/core/InputGroup';
|
|
7
|
+
import {TextInput} from '@astryxdesign/core/TextInput';
|
|
8
|
+
|
|
9
|
+
export default function InputGroupBasic() {
|
|
10
|
+
const [price, setPrice] = useState('');
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<div style={{width: 320}}>
|
|
14
|
+
<InputGroup label="Price">
|
|
15
|
+
<InputGroupText>$</InputGroupText>
|
|
16
|
+
<TextInput
|
|
17
|
+
label="Amount"
|
|
18
|
+
isLabelHidden
|
|
19
|
+
value={price}
|
|
20
|
+
onChange={setPrice}
|
|
21
|
+
placeholder="0.00"
|
|
22
|
+
/>
|
|
23
|
+
<InputGroupText>USD</InputGroupText>
|
|
24
|
+
</InputGroup>
|
|
25
|
+
</div>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
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: 'LayoutContent',
|
|
7
|
+
name: 'LayoutContent — Basic',
|
|
8
|
+
displayName: 'LayoutContent — Basic',
|
|
9
|
+
description:
|
|
10
|
+
'A scrollable main content area below a fixed header. Use LayoutContent inside Layout to get automatic padding and scroll containment for the primary content.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 16 / 9,
|
|
13
|
+
componentsUsed: [
|
|
14
|
+
'LayoutContent',
|
|
15
|
+
'Layout',
|
|
16
|
+
'LayoutHeader',
|
|
17
|
+
'Center',
|
|
18
|
+
'Card',
|
|
19
|
+
'VStack',
|
|
20
|
+
'Heading',
|
|
21
|
+
'Text',
|
|
22
|
+
],
|
|
23
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
Layout,
|
|
7
|
+
LayoutContent,
|
|
8
|
+
LayoutHeader,
|
|
9
|
+
Card,
|
|
10
|
+
VStack,
|
|
11
|
+
} from '@astryxdesign/core/Layout';
|
|
12
|
+
import {Center} from '@astryxdesign/core/Center';
|
|
13
|
+
import {Text, Heading} from '@astryxdesign/core/Text';
|
|
14
|
+
|
|
15
|
+
export default function LayoutContentBasic() {
|
|
16
|
+
return (
|
|
17
|
+
<Center width={400}>
|
|
18
|
+
<Layout
|
|
19
|
+
style={{width: '100%'}}
|
|
20
|
+
height="fill"
|
|
21
|
+
header={
|
|
22
|
+
<LayoutHeader hasDivider>
|
|
23
|
+
<Card variant="muted" />
|
|
24
|
+
</LayoutHeader>
|
|
25
|
+
}
|
|
26
|
+
content={
|
|
27
|
+
<LayoutContent role="main">
|
|
28
|
+
<VStack gap={3}>
|
|
29
|
+
<Heading level={5}>Main Content</Heading>
|
|
30
|
+
<Text type="body" color="secondary">
|
|
31
|
+
LayoutContent fills the remaining space and scrolls when its
|
|
32
|
+
content overflows, while the header stays fixed.
|
|
33
|
+
</Text>
|
|
34
|
+
</VStack>
|
|
35
|
+
</LayoutContent>
|
|
36
|
+
}
|
|
37
|
+
/>
|
|
38
|
+
</Center>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
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: 'LayoutFooter',
|
|
7
|
+
name: 'LayoutFooter — Actions',
|
|
8
|
+
displayName: 'LayoutFooter — Actions',
|
|
9
|
+
description:
|
|
10
|
+
'A fixed footer with end-aligned action buttons below scrollable content. Use LayoutFooter inside Layout for persistent actions like Save and Cancel.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 16 / 9,
|
|
13
|
+
componentsUsed: [
|
|
14
|
+
'LayoutFooter',
|
|
15
|
+
'Layout',
|
|
16
|
+
'LayoutContent',
|
|
17
|
+
'Center',
|
|
18
|
+
'Card',
|
|
19
|
+
'HStack',
|
|
20
|
+
'Button',
|
|
21
|
+
],
|
|
22
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
Layout,
|
|
7
|
+
LayoutContent,
|
|
8
|
+
LayoutFooter,
|
|
9
|
+
Card,
|
|
10
|
+
HStack,
|
|
11
|
+
} from '@astryxdesign/core/Layout';
|
|
12
|
+
import {Center} from '@astryxdesign/core/Center';
|
|
13
|
+
import {Button} from '@astryxdesign/core/Button';
|
|
14
|
+
|
|
15
|
+
export default function LayoutFooterActions() {
|
|
16
|
+
return (
|
|
17
|
+
<Center width={400}>
|
|
18
|
+
<Layout
|
|
19
|
+
style={{width: '100%'}}
|
|
20
|
+
height="fill"
|
|
21
|
+
content={
|
|
22
|
+
<LayoutContent>
|
|
23
|
+
<Card variant="muted" />
|
|
24
|
+
</LayoutContent>
|
|
25
|
+
}
|
|
26
|
+
footer={
|
|
27
|
+
<LayoutFooter hasDivider>
|
|
28
|
+
<HStack gap={2} hAlign="end">
|
|
29
|
+
<Button label="Cancel" variant="secondary">
|
|
30
|
+
Cancel
|
|
31
|
+
</Button>
|
|
32
|
+
<Button label="Save" variant="primary">
|
|
33
|
+
Save
|
|
34
|
+
</Button>
|
|
35
|
+
</HStack>
|
|
36
|
+
</LayoutFooter>
|
|
37
|
+
}
|
|
38
|
+
/>
|
|
39
|
+
</Center>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
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: 'LayoutHeader',
|
|
7
|
+
name: 'LayoutHeader — With Actions',
|
|
8
|
+
displayName: 'LayoutHeader — With Actions',
|
|
9
|
+
description:
|
|
10
|
+
'A fixed page header with a title and a primary action, above scrollable content. Use LayoutHeader inside Layout for persistent page-level headers.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 16 / 9,
|
|
13
|
+
componentsUsed: [
|
|
14
|
+
'LayoutHeader',
|
|
15
|
+
'Layout',
|
|
16
|
+
'LayoutContent',
|
|
17
|
+
'Center',
|
|
18
|
+
'Card',
|
|
19
|
+
'HStack',
|
|
20
|
+
'Heading',
|
|
21
|
+
'Button',
|
|
22
|
+
],
|
|
23
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
Layout,
|
|
7
|
+
LayoutHeader,
|
|
8
|
+
LayoutContent,
|
|
9
|
+
Card,
|
|
10
|
+
HStack,
|
|
11
|
+
} from '@astryxdesign/core/Layout';
|
|
12
|
+
import {Center} from '@astryxdesign/core/Center';
|
|
13
|
+
import {Heading} from '@astryxdesign/core/Text';
|
|
14
|
+
import {Button} from '@astryxdesign/core/Button';
|
|
15
|
+
|
|
16
|
+
export default function LayoutHeaderWithActions() {
|
|
17
|
+
return (
|
|
18
|
+
<Center width={400}>
|
|
19
|
+
<Layout
|
|
20
|
+
style={{width: '100%'}}
|
|
21
|
+
height="fill"
|
|
22
|
+
header={
|
|
23
|
+
<LayoutHeader hasDivider>
|
|
24
|
+
<HStack gap={2} vAlign="center" hAlign="between">
|
|
25
|
+
<Heading level={4}>Dashboard</Heading>
|
|
26
|
+
<Button label="New Item" variant="primary">
|
|
27
|
+
New Item
|
|
28
|
+
</Button>
|
|
29
|
+
</HStack>
|
|
30
|
+
</LayoutHeader>
|
|
31
|
+
}
|
|
32
|
+
content={
|
|
33
|
+
<LayoutContent>
|
|
34
|
+
<Card variant="muted" />
|
|
35
|
+
</LayoutContent>
|
|
36
|
+
}
|
|
37
|
+
/>
|
|
38
|
+
</Center>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
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: 'LayoutPanel',
|
|
7
|
+
name: 'LayoutPanel — Navigation',
|
|
8
|
+
displayName: 'LayoutPanel — Navigation',
|
|
9
|
+
description:
|
|
10
|
+
'A fixed-width side panel holding a navigation list next to the main content. Use LayoutPanel in the start or end slot of Layout for sidebars.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 16 / 9,
|
|
13
|
+
componentsUsed: [
|
|
14
|
+
'LayoutPanel',
|
|
15
|
+
'Layout',
|
|
16
|
+
'LayoutContent',
|
|
17
|
+
'Center',
|
|
18
|
+
'List',
|
|
19
|
+
'ListItem',
|
|
20
|
+
'Card',
|
|
21
|
+
],
|
|
22
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
Layout,
|
|
7
|
+
LayoutPanel,
|
|
8
|
+
LayoutContent,
|
|
9
|
+
Card,
|
|
10
|
+
} from '@astryxdesign/core/Layout';
|
|
11
|
+
import {Center} from '@astryxdesign/core/Center';
|
|
12
|
+
import {List, ListItem} from '@astryxdesign/core/List';
|
|
13
|
+
|
|
14
|
+
export default function LayoutPanelNavigation() {
|
|
15
|
+
return (
|
|
16
|
+
<Center width={400}>
|
|
17
|
+
<Layout
|
|
18
|
+
style={{width: '100%'}}
|
|
19
|
+
height="fill"
|
|
20
|
+
start={
|
|
21
|
+
<LayoutPanel hasDivider width={140} role="navigation">
|
|
22
|
+
<List>
|
|
23
|
+
<ListItem label="Overview" isSelected />
|
|
24
|
+
<ListItem label="Analytics" />
|
|
25
|
+
<ListItem label="Settings" />
|
|
26
|
+
</List>
|
|
27
|
+
</LayoutPanel>
|
|
28
|
+
}
|
|
29
|
+
content={
|
|
30
|
+
<LayoutContent>
|
|
31
|
+
<Card variant="muted" />
|
|
32
|
+
</LayoutContent>
|
|
33
|
+
}
|
|
34
|
+
/>
|
|
35
|
+
</Center>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
@@ -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: 'Lightbox',
|
|
7
|
+
name: 'Lightbox — Gallery',
|
|
8
|
+
displayName: 'Lightbox — Gallery',
|
|
9
|
+
description:
|
|
10
|
+
'A thumbnail grid that opens a fullscreen gallery. Clicking any thumbnail opens the lightbox at that index. Prev/next navigation lets users browse all images without closing.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 4 / 3,
|
|
13
|
+
componentsUsed: ['Lightbox', 'Grid', 'Thumbnail'],
|
|
14
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {useLightbox} from '@astryxdesign/core/Lightbox';
|
|
6
|
+
import {Grid} from '@astryxdesign/core/Grid';
|
|
7
|
+
import {Thumbnail} from '@astryxdesign/core/Thumbnail';
|
|
8
|
+
|
|
9
|
+
const PHOTOS = [
|
|
10
|
+
{
|
|
11
|
+
src: 'https://lookaside.facebook.com/assets/astryx/Neutral-Backpack.png',
|
|
12
|
+
alt: 'Backpack',
|
|
13
|
+
caption: 'A backpack displayed on a neutral background.',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
src: 'https://lookaside.facebook.com/assets/astryx/building.png',
|
|
17
|
+
alt: 'Modern building',
|
|
18
|
+
caption: 'A modern building with a contemporary architectural design.',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
src: 'https://lookaside.facebook.com/assets/astryx/light-scene-horizontal-1.png',
|
|
22
|
+
alt: 'Coastal shoreline with ocean waves',
|
|
23
|
+
caption:
|
|
24
|
+
'A scenic coastline with waves rolling onto a sandy beach beneath a clear sky.',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
src: 'https://lookaside.facebook.com/assets/astryx/illustrative-vertical-1.png',
|
|
28
|
+
alt: 'Illustrated lakeside landscape at sunset',
|
|
29
|
+
caption:
|
|
30
|
+
'A stylized landscape illustration featuring pink clouds reflected over a calm lake at sunset.',
|
|
31
|
+
},
|
|
32
|
+
];
|
|
33
|
+
|
|
34
|
+
export default function LightboxGallery() {
|
|
35
|
+
const lightbox = useLightbox({media: PHOTOS});
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<>
|
|
39
|
+
<Grid columns={2} gap={2} style={{width: 136}}>
|
|
40
|
+
{PHOTOS.map((photo, i) => (
|
|
41
|
+
<Thumbnail
|
|
42
|
+
key={photo.src}
|
|
43
|
+
src={photo.src}
|
|
44
|
+
alt={photo.alt}
|
|
45
|
+
label={photo.alt}
|
|
46
|
+
onClick={() => lightbox.open(i)}
|
|
47
|
+
/>
|
|
48
|
+
))}
|
|
49
|
+
</Grid>
|
|
50
|
+
{lightbox.element}
|
|
51
|
+
</>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
@@ -12,9 +12,10 @@ export default function LightboxShowcase() {
|
|
|
12
12
|
isOpen={isOpen}
|
|
13
13
|
onOpenChange={setIsOpen}
|
|
14
14
|
media={{
|
|
15
|
-
src: 'https://
|
|
16
|
-
alt: '
|
|
17
|
-
caption:
|
|
15
|
+
src: 'https://lookaside.facebook.com/assets/astryx/light-scene-horizontal-1.png',
|
|
16
|
+
alt: 'Coastal shoreline with ocean waves',
|
|
17
|
+
caption:
|
|
18
|
+
'A scenic coastline with waves rolling onto a sandy beach beneath a clear sky.',
|
|
18
19
|
}}
|
|
19
20
|
/>
|
|
20
21
|
</>
|