@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,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
|
+
}
|
|
@@ -10,5 +10,5 @@ export const doc = {
|
|
|
10
10
|
'Shows a page summary when hovering a link: title, description, and URL. Use for documentation links, article references, or any URL where a preview helps the user decide whether to click.',
|
|
11
11
|
isReady: true,
|
|
12
12
|
aspectRatio: 16 / 9,
|
|
13
|
-
componentsUsed: ['HoverCard', 'Icon', 'Layout', 'Text'],
|
|
13
|
+
componentsUsed: ['HoverCard', 'Icon', 'Layout', 'Link', 'Text'],
|
|
14
14
|
};
|
|
@@ -5,12 +5,14 @@
|
|
|
5
5
|
import {HoverCard} from '@astryxdesign/core/HoverCard';
|
|
6
6
|
import {Icon} from '@astryxdesign/core/Icon';
|
|
7
7
|
import {VStack, HStack} from '@astryxdesign/core/Layout';
|
|
8
|
+
import {Link} from '@astryxdesign/core/Link';
|
|
8
9
|
import {Text} from '@astryxdesign/core/Text';
|
|
9
10
|
import {LinkIcon} from '@heroicons/react/24/outline';
|
|
10
11
|
|
|
11
12
|
export default function HoverCardInteractiveContent() {
|
|
12
13
|
return (
|
|
13
|
-
<Text type="body">
|
|
14
|
+
<Text type="body">
|
|
15
|
+
Read more in the{' '}
|
|
14
16
|
<HoverCard
|
|
15
17
|
placement="below"
|
|
16
18
|
content={
|
|
@@ -30,8 +32,11 @@ export default function HoverCardInteractiveContent() {
|
|
|
30
32
|
</HStack>
|
|
31
33
|
</VStack>
|
|
32
34
|
}>
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
<Link href="#" hasUnderline>
|
|
36
|
+
Getting Started Guide
|
|
37
|
+
</Link>
|
|
38
|
+
</HoverCard>
|
|
39
|
+
.
|
|
40
|
+
</Text>
|
|
36
41
|
);
|
|
37
42
|
}
|
|
@@ -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
|
</>
|
|
@@ -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 — Video',
|
|
8
|
+
displayName: 'Lightbox — Video',
|
|
9
|
+
description:
|
|
10
|
+
'Opens a video in the lightbox. Native browser controls are available. Zoom and pan are disabled for video items.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 4 / 3,
|
|
13
|
+
componentsUsed: ['Lightbox'],
|
|
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 {Lightbox} from '@astryxdesign/core/Lightbox';
|
|
7
|
+
import {Button} from '@astryxdesign/core/Button';
|
|
8
|
+
|
|
9
|
+
export default function LightboxVideo() {
|
|
10
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<>
|
|
14
|
+
<Button label="Play video" onClick={() => setIsOpen(true)} />
|
|
15
|
+
<Lightbox
|
|
16
|
+
isOpen={isOpen}
|
|
17
|
+
onOpenChange={setIsOpen}
|
|
18
|
+
media={{
|
|
19
|
+
src: 'https://lookaside.facebook.com/assets/?set=astryx&name=Nature-1&density=1',
|
|
20
|
+
alt: 'Flower blooming in time-lapse',
|
|
21
|
+
type: 'video',
|
|
22
|
+
caption: 'A flower blooming in time-lapse',
|
|
23
|
+
}}
|
|
24
|
+
/>
|
|
25
|
+
</>
|
|
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: 'Lightbox',
|
|
7
|
+
name: 'Lightbox — Zoom',
|
|
8
|
+
displayName: 'Lightbox — Zoom',
|
|
9
|
+
description:
|
|
10
|
+
'A lightbox with zoom and pan enabled. Double-click the image to zoom in; drag to pan around. Double-click again or use the close button to exit.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 4 / 3,
|
|
13
|
+
componentsUsed: ['Lightbox', 'Thumbnail'],
|
|
14
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {useState} from 'react';
|
|
6
|
+
import {Lightbox} from '@astryxdesign/core/Lightbox';
|
|
7
|
+
import {Thumbnail} from '@astryxdesign/core/Thumbnail';
|
|
8
|
+
|
|
9
|
+
export default function LightboxZoom() {
|
|
10
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<>
|
|
14
|
+
<Thumbnail
|
|
15
|
+
src="https://lookaside.facebook.com/assets/astryx/light-scene-horizontal-1.png"
|
|
16
|
+
alt="Coastal shoreline with ocean waves"
|
|
17
|
+
label="Coastal shoreline with ocean waves"
|
|
18
|
+
onClick={() => setIsOpen(true)}
|
|
19
|
+
/>
|
|
20
|
+
<Lightbox
|
|
21
|
+
isOpen={isOpen}
|
|
22
|
+
onOpenChange={setIsOpen}
|
|
23
|
+
media={{
|
|
24
|
+
src: 'https://lookaside.facebook.com/assets/astryx/light-scene-horizontal-1.png',
|
|
25
|
+
alt: 'Coastal shoreline with ocean waves',
|
|
26
|
+
caption:
|
|
27
|
+
'A scenic coastline. Double-click to zoom in and drag to pan.',
|
|
28
|
+
}}
|
|
29
|
+
hasZoom
|
|
30
|
+
/>
|
|
31
|
+
</>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
@@ -7,7 +7,7 @@ export const doc = {
|
|
|
7
7
|
name: 'Link Provider — Custom Link Component',
|
|
8
8
|
displayName: 'Link Provider — Custom Link Component',
|
|
9
9
|
description:
|
|
10
|
-
'Routes every Astryx link through a custom component that intercepts the click
|
|
10
|
+
'Routes every Astryx link through a custom component that intercepts the click, the hook frameworks like Next.js use for client-side navigation. Click the link to see the custom handler fire instead of a full-page load.',
|
|
11
11
|
isReady: true,
|
|
12
12
|
aspectRatio: 4 / 3,
|
|
13
13
|
componentsUsed: ['LinkProvider', 'Link'],
|
|
@@ -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: 'MetadataListItem',
|
|
7
|
+
name: 'MetadataListItem — Basic',
|
|
8
|
+
displayName: 'MetadataListItem — Basic',
|
|
9
|
+
description:
|
|
10
|
+
'Labeled key–value rows inside a MetadataList. Values accept any content, from plain text to components like Badge.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 16 / 9,
|
|
13
|
+
componentsUsed: ['MetadataList', 'MetadataListItem', 'Badge'],
|
|
14
|
+
};
|