@astryxdesign/cli 0.1.2 → 0.1.3
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/CHANGELOG.md +64 -1
- package/README.md +49 -55
- 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/docs/theme.doc.mjs +2 -2
- package/package.json +13 -1
- package/src/api/blog.mjs +192 -0
- package/src/api/blog.test.mjs +144 -0
- package/src/api/component.mjs +253 -12
- package/src/api/discover.mjs +14 -7
- package/src/api/doctor.mjs +10 -25
- package/src/api/index.mjs +1 -0
- package/src/api/layout.mjs +11 -10
- package/src/api/layout.test.mjs +4 -1
- package/src/api/template-integration.test.mjs +225 -0
- package/src/api/template.mjs +242 -84
- package/src/api/validate-integration.mjs +370 -0
- package/src/api/validate-integration.test.mjs +222 -0
- package/src/codemod.mjs +93 -0
- package/src/codemod.test.mjs +134 -0
- package/src/codemods/__tests__/registry.test.mjs +1 -0
- package/src/codemods/__tests__/runner.test.mjs +103 -0
- package/src/codemods/integration-discovery.mjs +168 -0
- package/src/codemods/integration-discovery.test.mjs +234 -0
- package/src/codemods/integration-runner.mjs +109 -0
- package/src/codemods/registry.mjs +1 -0
- package/src/codemods/run-codemod.mjs +207 -0
- package/src/codemods/runner.mjs +73 -96
- package/src/codemods/transforms/v0.0.15/index.mjs +0 -13
- package/src/codemods/transforms/v0.1.0/__tests__/migrate-xds-css-surfaces.test.mjs +67 -0
- package/src/codemods/transforms/v0.1.0/__tests__/migrate-xds-declare-module.test.mjs +61 -0
- package/src/codemods/transforms/v0.1.0/__tests__/v0.1.0-ordering.test.mjs +104 -0
- package/src/codemods/transforms/{v0.0.15 → v0.1.0}/drop-xds-prefix-imports.mjs +15 -4
- package/src/codemods/transforms/v0.1.0/index.mjs +43 -6
- package/src/codemods/transforms/v0.1.0/migrate-xds-css-surfaces.mjs +77 -0
- package/src/codemods/transforms/v0.1.0/migrate-xds-declare-module.mjs +78 -0
- package/src/codemods/transforms/v0.1.3/__tests__/migrate-layout-components-to-experimental.test.mjs +360 -0
- package/src/codemods/transforms/v0.1.3/index.mjs +19 -0
- package/src/codemods/transforms/v0.1.3/migrate-layout-components-to-experimental.mjs +260 -0
- package/src/commands/agent-docs.mjs +4 -1
- 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/component/index.mjs +44 -10
- package/src/commands/component-ownership.test.mjs +227 -0
- package/src/commands/discover.mjs +5 -16
- package/src/commands/doctor.test.mjs +3 -3
- package/src/commands/ensure-core-built.mjs +120 -0
- package/src/commands/json-contract.test.mjs +0 -32
- package/src/commands/swizzle.mjs +224 -235
- package/src/commands/swizzle.path-safety.test.mjs +3 -3
- package/src/commands/swizzle.routing.test.mjs +279 -0
- package/src/commands/template.mjs +33 -37
- package/src/commands/upgrade.config-ordering.test.mjs +273 -0
- package/src/commands/upgrade.integration-policy.test.mjs +204 -0
- package/src/commands/upgrade.mjs +349 -170
- package/src/commands/validate-integration.mjs +110 -0
- package/src/commands/validate-integration.test.mjs +124 -0
- package/src/config.mjs +7 -20
- package/src/config.test.mjs +89 -13
- package/src/index.mjs +8 -3
- package/src/integration.mjs +19 -0
- package/src/lib/component-discovery.mjs +177 -0
- package/src/lib/config-cache.mjs +91 -0
- package/src/lib/config-cache.test.mjs +83 -0
- package/src/lib/config-schema.mjs +41 -55
- package/src/lib/error-codes.mjs +15 -12
- package/src/lib/integration-warnings.mjs +62 -0
- package/src/lib/integration-warnings.test.mjs +102 -0
- package/src/lib/integrations.mjs +92 -115
- package/src/lib/integrations.test.mjs +88 -107
- package/src/lib/manifest.mjs +5 -2
- package/src/lib/module-loader.mjs +80 -0
- package/src/lib/module-loader.test.mjs +106 -0
- package/src/lib/project.mjs +502 -0
- package/src/lib/project.test.mjs +308 -0
- package/src/lib/site.mjs +20 -0
- package/src/template.mjs +73 -0
- package/src/template.test.mjs +127 -0
- package/src/types/api.d.ts +2 -6
- package/src/types/base.d.ts +3 -9
- package/src/types/codemod.d.ts +81 -0
- package/src/types/component.d.ts +27 -2
- package/src/types/config.d.ts +56 -85
- package/src/types/error-codes.d.ts +5 -3
- package/src/types/index.d.ts +0 -1
- package/src/types/integration.d.ts +29 -0
- package/src/types/swizzle.d.ts +9 -2
- package/src/types/template-api.d.ts +54 -0
- package/src/types/template.d.ts +10 -7
- package/src/types/upgrade.d.ts +29 -0
- package/src/types/validate-integration.d.ts +24 -0
- package/src/utils/github.mjs +0 -237
- package/src/utils/interactive.mjs +2 -2
- 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/DateRangeInput/DateRangeInputWithPresets.doc.mjs +14 -0
- package/templates/blocks/components/DateRangeInput/DateRangeInputWithPresets.tsx +46 -0
- package/templates/blocks/components/DateRangeInput/DateRangeInputWithValidation.doc.mjs +14 -0
- package/templates/blocks/components/DateRangeInput/DateRangeInputWithValidation.tsx +52 -0
- package/templates/blocks/components/DateTimeInput/DateTimeInputWithValidation.doc.mjs +14 -0
- package/templates/blocks/components/DateTimeInput/DateTimeInputWithValidation.tsx +43 -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/HoverCard/HoverCardInteractiveContent.doc.mjs +1 -1
- package/templates/blocks/components/HoverCard/HoverCardInteractiveContent.tsx +9 -4
- 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/LinkProvider/LinkProviderCustomLink.doc.mjs +1 -1
- 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/Tab/TabWithSelectedIcon.doc.mjs +13 -0
- package/templates/blocks/components/Tab/TabWithSelectedIcon.tsx +39 -0
- package/templates/blocks/components/TabMenu/TabMenuBasic.doc.mjs +14 -0
- package/templates/blocks/components/TabMenu/TabMenuBasic.tsx +23 -0
- package/templates/blocks/components/Table/StickyColumnsHookUsage.doc.mjs +1 -1
- 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-nav/page.tsx +321 -0
- package/templates/pages/shell-nav/template.doc.mjs +12 -0
- package/templates/pages/shell-side-nav/page.tsx +241 -0
- package/templates/pages/shell-side-nav/template.doc.mjs +12 -0
- package/templates/pages/shell-top-nav/page.tsx +224 -0
- package/templates/pages/shell-top-nav/template.doc.mjs +12 -0
- package/src/codemods/transforms/v0.1.0/__tests__/migrate-xds-config-surfaces.test.mjs +0 -116
- package/src/codemods/transforms/v0.1.0/migrate-xds-config-surfaces.mjs +0 -230
- package/src/commands/gap-report.mjs +0 -464
- package/src/commands/gap-report.test.mjs +0 -168
- package/src/commands/swizzle-gap-safety.test.mjs +0 -273
- package/src/lib/config.mjs +0 -113
- package/src/lib/config.test.mjs +0 -91
- package/src/types/gap-report.d.ts +0 -29
- 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
- /package/src/codemods/transforms/{v0.0.15 → v0.1.0}/__tests__/drop-xds-prefix-imports.test.mjs +0 -0
|
@@ -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: 'DateRangeInput',
|
|
7
|
+
name: 'DateRangeInput — With Presets',
|
|
8
|
+
displayName: 'DateRangeInput — With Presets',
|
|
9
|
+
description:
|
|
10
|
+
'Date range picker with quick-select presets for common periods. Use for analytics dashboards, report filters, or any context where users frequently select standard time windows.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 4 / 3,
|
|
13
|
+
componentsUsed: ['DateRangeInput', 'Layout', 'Text'],
|
|
14
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {useState} from 'react';
|
|
6
|
+
import {DateRangeInput} from '@astryxdesign/core/DateRangeInput';
|
|
7
|
+
import type {DateRange} from '@astryxdesign/core/DateRangeInput';
|
|
8
|
+
import type {ISODateString} from '@astryxdesign/core/Calendar';
|
|
9
|
+
import {Stack} from '@astryxdesign/core/Layout';
|
|
10
|
+
import {Text} from '@astryxdesign/core/Text';
|
|
11
|
+
|
|
12
|
+
function daysAgo(n: number): ISODateString {
|
|
13
|
+
const d = new Date();
|
|
14
|
+
d.setDate(d.getDate() - n);
|
|
15
|
+
return d.toISOString().slice(0, 10) as ISODateString;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function today(): ISODateString {
|
|
19
|
+
return new Date().toISOString().slice(0, 10) as ISODateString;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const presets = [
|
|
23
|
+
{label: 'Last 7 days', getRange: () => ({start: daysAgo(7), end: today()})},
|
|
24
|
+
{label: 'Last 14 days', getRange: () => ({start: daysAgo(14), end: today()})},
|
|
25
|
+
{label: 'Last 30 days', getRange: () => ({start: daysAgo(30), end: today()})},
|
|
26
|
+
{label: 'Last 90 days', getRange: () => ({start: daysAgo(90), end: today()})},
|
|
27
|
+
];
|
|
28
|
+
|
|
29
|
+
export default function DateRangeInputWithPresets() {
|
|
30
|
+
const [range, setRange] = useState<DateRange | null>(null);
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<Stack direction="vertical" gap={4} width="100%" style={{maxWidth: 400}}>
|
|
34
|
+
<Text type="supporting" color="secondary">
|
|
35
|
+
{range ? `${range.start} → ${range.end}` : 'No range selected'}
|
|
36
|
+
</Text>
|
|
37
|
+
<DateRangeInput
|
|
38
|
+
label="Report period"
|
|
39
|
+
description="Use a preset or pick a custom range"
|
|
40
|
+
value={range}
|
|
41
|
+
onChange={setRange}
|
|
42
|
+
presets={presets}
|
|
43
|
+
/>
|
|
44
|
+
</Stack>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('../../../../../core/src/docs-types').TemplateDoc} */
|
|
4
|
+
export const doc = {
|
|
5
|
+
type: 'block',
|
|
6
|
+
exampleFor: 'DateRangeInput',
|
|
7
|
+
name: 'DateRangeInput — Validation',
|
|
8
|
+
displayName: 'DateRangeInput — Validation',
|
|
9
|
+
description:
|
|
10
|
+
'Date range input in all three status states: error, warning, and success. Use to surface booking conflicts, flag high-demand periods, or confirm an available range.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 4 / 3,
|
|
13
|
+
componentsUsed: ['DateRangeInput', 'Layout'],
|
|
14
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {useState} from 'react';
|
|
6
|
+
import {DateRangeInput} from '@astryxdesign/core/DateRangeInput';
|
|
7
|
+
import type {DateRange} from '@astryxdesign/core/DateRangeInput';
|
|
8
|
+
import {Stack} from '@astryxdesign/core/Layout';
|
|
9
|
+
|
|
10
|
+
export default function DateRangeInputWithValidation() {
|
|
11
|
+
const [errorRange, setErrorRange] = useState<DateRange | null>({
|
|
12
|
+
start: '2026-01-01',
|
|
13
|
+
end: '2026-01-31',
|
|
14
|
+
});
|
|
15
|
+
const [warningRange, setWarningRange] = useState<DateRange | null>({
|
|
16
|
+
start: '2026-06-01',
|
|
17
|
+
end: '2026-06-30',
|
|
18
|
+
});
|
|
19
|
+
const [successRange, setSuccessRange] = useState<DateRange | null>({
|
|
20
|
+
start: '2026-03-01',
|
|
21
|
+
end: '2026-03-31',
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<Stack direction="vertical" gap={4} width="100%" style={{maxWidth: 400}}>
|
|
26
|
+
<DateRangeInput
|
|
27
|
+
label="Booking period"
|
|
28
|
+
value={errorRange}
|
|
29
|
+
onChange={setErrorRange}
|
|
30
|
+
status={{
|
|
31
|
+
type: 'error',
|
|
32
|
+
message: 'Selected dates are no longer available',
|
|
33
|
+
}}
|
|
34
|
+
/>
|
|
35
|
+
<DateRangeInput
|
|
36
|
+
label="Preferred period"
|
|
37
|
+
value={warningRange}
|
|
38
|
+
onChange={setWarningRange}
|
|
39
|
+
status={{
|
|
40
|
+
type: 'warning',
|
|
41
|
+
message: 'High demand — limited availability',
|
|
42
|
+
}}
|
|
43
|
+
/>
|
|
44
|
+
<DateRangeInput
|
|
45
|
+
label="Confirmed period"
|
|
46
|
+
value={successRange}
|
|
47
|
+
onChange={setSuccessRange}
|
|
48
|
+
status={{type: 'success', message: 'Dates confirmed and available'}}
|
|
49
|
+
/>
|
|
50
|
+
</Stack>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
@@ -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: 'DateTimeInput',
|
|
7
|
+
name: 'DateTimeInput — Validation',
|
|
8
|
+
displayName: 'DateTimeInput — Validation',
|
|
9
|
+
description:
|
|
10
|
+
'DateTimeInput in all three status states: error, warning, and success. Use to surface scheduling conflicts, caution the user about edge cases, or confirm a valid datetime.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 4 / 3,
|
|
13
|
+
componentsUsed: ['DateTimeInput', 'Layout'],
|
|
14
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {useState} from 'react';
|
|
6
|
+
import {DateTimeInput} from '@astryxdesign/core/DateTimeInput';
|
|
7
|
+
import type {ISODateTimeString} from '@astryxdesign/core/DateTimeInput';
|
|
8
|
+
import {Stack} from '@astryxdesign/core/Layout';
|
|
9
|
+
|
|
10
|
+
export default function DateTimeInputWithValidation() {
|
|
11
|
+
const [errorVal, setErrorVal] = useState<ISODateTimeString | undefined>(
|
|
12
|
+
'2026-01-25T09:00' as ISODateTimeString,
|
|
13
|
+
);
|
|
14
|
+
const [warningVal, setWarningVal] = useState<ISODateTimeString | undefined>(
|
|
15
|
+
'2026-12-25T14:00' as ISODateTimeString,
|
|
16
|
+
);
|
|
17
|
+
const [successVal, setSuccessVal] = useState<ISODateTimeString | undefined>(
|
|
18
|
+
'2026-03-10T10:30' as ISODateTimeString,
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<Stack direction="vertical" gap={4} width="100%" style={{maxWidth: 400}}>
|
|
23
|
+
<DateTimeInput
|
|
24
|
+
label="Meeting time"
|
|
25
|
+
value={errorVal}
|
|
26
|
+
onChange={setErrorVal}
|
|
27
|
+
status={{type: 'error', message: 'This time slot is already booked'}}
|
|
28
|
+
/>
|
|
29
|
+
<DateTimeInput
|
|
30
|
+
label="Preferred time"
|
|
31
|
+
value={warningVal}
|
|
32
|
+
onChange={setWarningVal}
|
|
33
|
+
status={{type: 'warning', message: 'This falls outside business hours'}}
|
|
34
|
+
/>
|
|
35
|
+
<DateTimeInput
|
|
36
|
+
label="Start time"
|
|
37
|
+
value={successVal}
|
|
38
|
+
onChange={setSuccessVal}
|
|
39
|
+
status={{type: 'success', message: 'Time confirmed'}}
|
|
40
|
+
/>
|
|
41
|
+
</Stack>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('../../../../../core/src/docs-types').TemplateDoc} */
|
|
4
|
+
export const doc = {
|
|
5
|
+
type: 'block',
|
|
6
|
+
exampleFor: '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"
|
|
@@ -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
|
+
}
|