@astryxdesign/cli 0.3.0-canary.fc1c3f3 → 0.3.0-canary.fcbc342

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.
Files changed (87) hide show
  1. package/README.md +8 -8
  2. package/api/blog/blog.doc.mjs +2 -2
  3. package/api/build/build.doc.mjs +1 -1
  4. package/api/component/component.doc.mjs +1 -1
  5. package/api/discover/discover.doc.mjs +2 -2
  6. package/api/docs/docs.doc.mjs +2 -2
  7. package/api/doctor/doctor.doc.mjs +3 -3
  8. package/api/hook/hook.doc.mjs +1 -1
  9. package/api/init/init.doc.mjs +1 -1
  10. package/api/integration/summarizeIssues.doc.mjs +1 -1
  11. package/api/integration/validateIntegration.doc.mjs +1 -1
  12. package/api/json/assertResponse.doc.mjs +2 -2
  13. package/api/json/isError.doc.mjs +1 -1
  14. package/api/json/parseResponse.doc.mjs +2 -2
  15. package/api/layout/layoutCheck.doc.mjs +1 -1
  16. package/api/layout/layoutExpand.doc.mjs +1 -1
  17. package/api/layout/layoutGrammar.doc.mjs +1 -1
  18. package/api/swizzle/swizzle.doc.mjs +1 -1
  19. package/api/template/template.test.mjs +26 -0
  20. package/api/theme/listThemes.doc.mjs +2 -2
  21. package/api/theme/themeAdd.doc.mjs +1 -1
  22. package/api/theme/themeBuild.doc.mjs +3 -3
  23. package/api/theme/themeList.doc.mjs +2 -2
  24. package/api/upgrade/upgrade.doc.mjs +1 -1
  25. package/assets/codemods/transforms/next/__tests__/next-codemods.test.mjs +92 -0
  26. package/assets/codemods/transforms/next/index.mjs +11 -1
  27. package/assets/codemods/transforms/next/rename-dropdown-menu-radio-dot-target.mjs +152 -0
  28. package/assets/codemods/transforms/v0.3.0/__tests__/migrate-table-rowexpansion-to-tree.test.mjs +201 -0
  29. package/assets/codemods/transforms/v0.3.0/index.mjs +8 -0
  30. package/assets/codemods/transforms/v0.3.0/migrate-table-rowexpansion-to-tree.mjs +214 -0
  31. package/assets/docs/browser-support.doc.mjs +6 -6
  32. package/assets/docs/getting-started.doc.mjs +3 -3
  33. package/assets/docs/icons.doc.mjs +3 -3
  34. package/assets/docs/illustrations.doc.mjs +2 -2
  35. package/assets/docs/internationalization.doc.mjs +1 -1
  36. package/assets/docs/migration.doc.mjs +1 -1
  37. package/assets/docs/principles.doc.mjs +1 -1
  38. package/assets/docs/styling-libraries.doc.mjs +1 -1
  39. package/assets/docs/styling.doc.mjs +4 -4
  40. package/assets/docs/theme.doc.mjs +3 -3
  41. package/assets/docs/typography.doc.mjs +2 -2
  42. package/assets/templates/blocks/components/Stepper/StepperHorizontal.doc.mjs +14 -0
  43. package/assets/templates/blocks/components/Stepper/StepperHorizontal.tsx +24 -0
  44. package/assets/templates/blocks/components/Stepper/StepperIndicatorModes.doc.mjs +14 -0
  45. package/assets/templates/blocks/components/Stepper/StepperIndicatorModes.tsx +68 -0
  46. package/assets/templates/blocks/components/Stepper/StepperMultiStepForm.doc.mjs +14 -0
  47. package/assets/templates/blocks/components/Stepper/StepperMultiStepForm.tsx +92 -0
  48. package/assets/templates/blocks/components/Stepper/StepperOnTrackVertical.doc.mjs +14 -0
  49. package/assets/templates/blocks/components/Stepper/StepperOnTrackVertical.tsx +41 -0
  50. package/assets/templates/blocks/components/Stepper/StepperShowcase.doc.mjs +15 -0
  51. package/assets/templates/blocks/components/Stepper/StepperShowcase.tsx +25 -0
  52. package/assets/templates/blocks/components/Stepper/StepperStatus.doc.mjs +14 -0
  53. package/assets/templates/blocks/components/Stepper/StepperStatus.tsx +50 -0
  54. package/assets/templates/blocks/components/Stepper/StepperVerticalOnboarding.doc.mjs +14 -0
  55. package/assets/templates/blocks/components/Stepper/StepperVerticalOnboarding.tsx +40 -0
  56. package/assets/templates/blocks/components/Table/TableRowExpansionTable.tsx +61 -58
  57. package/assets/templates/blocks/components/TextArea/TextAreaStates.tsx +1 -1
  58. package/assets/templates/themes/neutral/neutralTheme.ts +4 -1
  59. package/authoring/codemod/codemod.doc.mjs +2 -2
  60. package/authoring/config/config.doc.mjs +1 -1
  61. package/authoring/doctypes/base/type.ts +15 -0
  62. package/authoring/doctypes/command/command.doc.mjs +2 -2
  63. package/authoring/doctypes/component/component.doc.mjs +7 -7
  64. package/authoring/doctypes/enum/enum.doc.mjs +2 -2
  65. package/authoring/doctypes/function/function.doc.mjs +3 -3
  66. package/authoring/doctypes/hook/hook.doc.mjs +3 -3
  67. package/authoring/doctypes/reference/reference.doc.mjs +3 -3
  68. package/authoring/doctypes/schema/schema.doc.mjs +1 -1
  69. package/authoring/doctypes/template/template.doc.mjs +3 -3
  70. package/clients/cli/commands/build-theme.registry.test.mjs +14 -1
  71. package/clients/cli/commands/build.doc.mjs +1 -1
  72. package/clients/cli/commands/component.doc.mjs +1 -1
  73. package/clients/cli/commands/doctor.doc.mjs +2 -2
  74. package/clients/cli/commands/layout-expand.doc.mjs +1 -1
  75. package/clients/cli/commands/layout.doc.mjs +1 -1
  76. package/clients/cli/commands/manifest.doc.mjs +3 -3
  77. package/clients/cli/commands/search.doc.mjs +1 -1
  78. package/clients/cli/commands/theme-add.doc.mjs +1 -1
  79. package/clients/cli/commands/theme-build.doc.mjs +1 -1
  80. package/clients/cli/commands/theme-list.doc.mjs +1 -1
  81. package/clients/cli/commands/theme.doc.mjs +2 -2
  82. package/clients/cli/commands/validate-integration.doc.mjs +2 -2
  83. package/foundation/discovery/template-adapter.d.mts +6 -3
  84. package/foundation/discovery/template-adapter.mjs +30 -14
  85. package/foundation/response/response-types.doc.mjs +7 -7
  86. package/foundation/response/response.doc.mjs +5 -5
  87. package/package.json +9 -9
@@ -40,7 +40,7 @@ export const docs = {
40
40
  'Keep illustrations consistent in style across the product.',
41
41
  'Use simple, flat illustrations that work in both light and dark mode.',
42
42
  'Size illustrations proportionally to the container, typically 120\u2013240px.',
43
- 'Center illustrations with supporting text below.',
43
+ 'Place illustrations centered with supporting text below.',
44
44
  ],
45
45
  },
46
46
  {
@@ -59,7 +59,7 @@ export const docs = {
59
59
  content: [
60
60
  {
61
61
  type: 'prose',
62
- text: 'Center illustrations inside Center with supporting text stacked below. Typical illustration sizes range from 120px for inline empty states to 240px for full-page onboarding screens. Always pair the illustration with a heading and optional body text to explain what the user should do next.',
62
+ text: 'Place illustrations inside Center with supporting text stacked below. Typical illustration sizes range from 120px for inline empty states to 240px for full-page onboarding screens. Always pair the illustration with a heading and optional body text to explain what the user should do next.',
63
63
  },
64
64
  {
65
65
  type: 'code',
@@ -300,7 +300,7 @@ export default function App() {
300
300
  content: [
301
301
  {
302
302
  type: 'prose',
303
- text: 'Astryx generates a `pseudo` locale that wraps every string in `⟦…⟧` and replaces letters with accented look-alikes. Switch to it in development to catch hardcoded astryx strings and layout issues caused by longer text.',
303
+ text: 'Astryx generates a `pseudo` locale that wraps every string in `⟦…⟧` and replaces letters with accented look-alikes. Turn it on in development to catch hardcoded astryx strings and layout issues caused by longer text.',
304
304
  },
305
305
  {
306
306
  type: 'code',
@@ -350,7 +350,7 @@ if (getComputedStyle(button).paddingInline === '0px') {
350
350
  'Run the app in light and dark mode and check that surfaces, borders, text, icons, hover states, focus rings, and status colors flow together.',
351
351
  'Open the command palette from the shell, type into it, select items by keyboard, and confirm focus returns to the trigger.',
352
352
  'Check the SideNav at collapsed, expanded, active, hover, nested, and mobile states.',
353
- 'Verify settings popovers and dialogs in jsdom and in a real browser because native dialog and Popover APIs may need test shims.',
353
+ 'Verify settings popovers and dialogs in jsdom and in a real browser because the native dialog and [`Popover`](https://developer.mozilla.org/en-US/docs/Web/API/Popover_API) APIs may need test shims.',
354
354
  'Search for leftover hardcoded Tailwind colors, arbitrary hex values, and one-off hover colors after each route migration.',
355
355
  'Run component tests, build, and at least one browser screenshot pass for each migrated route.',
356
356
  ],
@@ -39,7 +39,7 @@ export const docs = {
39
39
  style: 'ordered',
40
40
  items: [
41
41
  'Use components for everything they cover',
42
- 'Layout is frame-first: pick the shell and budget regions before writing content (see \`astryx docs layout\`)',
42
+ 'Page layout is frame-first: pick the shell and budget regions before writing content (see \`astryx docs layout\`)',
43
43
  'Dense data renders as rows (Table, List/Item), edge-to-edge with dividers; Card is for widgets, galleries, and settings groups',
44
44
  'StyleX or Tailwind for custom styling; both are first-class (see \`astryx docs styling\`)',
45
45
  'Semantic tokens, not hardcoded values (see \`astryx docs tokens\`)',
@@ -56,7 +56,7 @@ export const docs = {
56
56
  '`@astryxdesign/core/tailwind-theme.css`',
57
57
  ],
58
58
  [
59
- 'Token resolver APIs',
59
+ 'Design token resolver APIs',
60
60
  'JavaScript needs token values for charts, canvas, SVG, or config objects',
61
61
  "`resolveThemeToken(theme, '--color-data-categorical-blue', {mode})`",
62
62
  ],
@@ -22,10 +22,10 @@ export const docs = {
22
22
  type: 'table',
23
23
  headers: ['Approach', 'Use for', 'Example'],
24
24
  rows: [
25
- ['StyleX', 'Component-specific overrides, reusable styles, pseudo-classes, and typed tokens', 'const styles = stylex.create(...); <Button xstyle={styles.save} />'],
26
- ['Tailwind utilities', 'Layout, wrappers, and utility styling', 'className="flex gap-3 p-4"'],
27
- ['className', 'Integrating with external CSS or Tailwind on components', 'className="my-card shadow-lg"'],
28
- ['Styling-library token aliases', 'Keeping Panda, Chakra, MUI, Emotion, styled-components, UnoCSS, CSS Modules, or Sass in sync with the system', "colors.surface = 'var(--color-background-surface)'"],
25
+ ['StyleX', 'Component-specific overrides, reusable styles, pseudo-classes, and typed tokens', '`const styles = stylex.create(...); <Button xstyle={styles.save} />`'],
26
+ ['Tailwind utilities', 'Page layout, wrappers, and utility styling', '`className="flex gap-3 p-4"`'],
27
+ ['className', 'Integrating with external CSS or Tailwind on components', '`className="my-card shadow-lg"`'],
28
+ ['Styling-library token aliases', 'Keeping Panda, Chakra, MUI, Emotion, styled-components, UnoCSS, CSS Modules, or Sass in sync with the system', "`colors.surface = 'var(--color-background-surface)'`"],
29
29
  ],
30
30
  },
31
31
  {
@@ -106,7 +106,7 @@ function App() {
106
106
  [
107
107
  'Y2K',
108
108
  "import {y2kTheme} from '@astryxdesign/theme-y2k'",
109
- 'Playful Y2K pop; periwinkle body, holographic accents, Poppins + Crimson Text.',
109
+ 'Playful Y2K pop; periwinkle body, holographic accents, Poppins + `Crimson Text`.',
110
110
  ],
111
111
  ],
112
112
  },
@@ -510,7 +510,7 @@ import './themes/ocean.css';
510
510
  content: [
511
511
  {
512
512
  type: 'prose',
513
- text: 'Wrap different sections in separate <Theme> providers.',
513
+ text: 'Wrap different sections in separate [`<Theme>`](/components/Theme) providers.',
514
514
  },
515
515
  {
516
516
  type: 'code',
@@ -606,7 +606,7 @@ function ChartConfig() {
606
606
  },
607
607
  {
608
608
  type: 'prose',
609
- text: 'Prefer CSS variables, StyleX token imports, xstyle, or className for ordinary styling. To change the theme or mode, manage state at the app level and pass it to <Theme>.',
609
+ text: 'Prefer CSS variables, StyleX token imports, xstyle, or className for ordinary styling. To change the theme or mode, manage state at the app level and pass it to `<Theme>`.',
610
610
  },
611
611
  {
612
612
  type: 'prose',
@@ -122,7 +122,7 @@ export const docs = {
122
122
  },
123
123
  {
124
124
  type: 'prose',
125
- text: 'Display text often needs heading semantics for accessibility. Use the type prop on Heading to apply display styling while preserving the correct HTML element: <Heading level={1} type="display-1"> gives you display-1 styling with an <h1> tag, so screen readers see the correct document outline.',
125
+ text: 'Display text often needs heading semantics for accessibility. Use the type prop on Heading to apply display styling while preserving the correct HTML element: `<Heading level={1} type="display-1">` gives you display-1 styling with an `<h1>` tag, so screen readers see the correct document outline.',
126
126
  },
127
127
  ],
128
128
  },
@@ -205,7 +205,7 @@ const denseTheme = defineTheme({
205
205
  items: [
206
206
  'Use Heading for document headings and Text for everything else; they apply the full type scale automatically.',
207
207
  'Adjust typography holistically: change base and ratio in defineTheme to shift the entire ramp (e.g. { base: 16, ratio: 1.25 } for editorial, { base: 12, ratio: 1.125 } for dense UI).',
208
- 'Use display types with as="h1" (or h2/h3) when display text is a page heading; this preserves accessibility while giving you display-level sizing. Or better, use <Heading level={1} type="display-1"> which handles both semantics and styling.',
208
+ 'Use display types with as="h1" (or h2/h3) when display text is a page heading; this preserves accessibility while giving you display-level sizing. Or better, use `<Heading level={1} type="display-1">` which handles both semantics and styling.',
209
209
  'Let line-height snap to the 4px grid via the type scale; expandTypeScale computes leading automatically from base and ratio.',
210
210
  'Use the supporting type for secondary information: timestamps, helper text, metadata, captions.',
211
211
  'Use accessibilityLevel on Heading when the visual hierarchy doesn\u0027t match the document outline (e.g. sidebar or card headings).',
@@ -0,0 +1,14 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /** @type {import('@astryxdesign/cli/authoring').TemplateDoc} */
4
+ export const doc = {
5
+ type: 'block',
6
+ exampleFor: 'Stepper',
7
+ name: 'Stepper — Horizontal Progress',
8
+ displayName: 'Stepper — Horizontal Progress',
9
+ description:
10
+ 'A horizontal separated stepper: each step owns a segment of the progress bar above its label. Filled segments track how far the flow has progressed.',
11
+ isReady: true,
12
+ aspectRatio: 16 / 9,
13
+ componentsUsed: ['Stepper'],
14
+ };
@@ -0,0 +1,24 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ 'use client';
4
+
5
+ import {useState} from 'react';
6
+ import {Stepper, Step} from '@astryxdesign/lab';
7
+
8
+ export default function StepperHorizontal() {
9
+ const [active, setActive] = useState(1);
10
+ return (
11
+ <div style={{width: '100%', maxWidth: 600}}>
12
+ <Stepper
13
+ activeStep={active}
14
+ orientation="horizontal"
15
+ onStepClick={setActive}>
16
+ <Step step={0} label="Workspace" />
17
+ <Step step={1} label="Team" />
18
+ <Step step={2} label="Integrations" />
19
+ <Step step={3} label="Import" />
20
+ <Step step={4} label="Launch" />
21
+ </Stepper>
22
+ </div>
23
+ );
24
+ }
@@ -0,0 +1,14 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /** @type {import('@astryxdesign/cli/authoring').TemplateDoc} */
4
+ export const doc = {
5
+ type: 'block',
6
+ exampleFor: 'Stepper',
7
+ name: 'Stepper — Indicator Modes',
8
+ displayName: 'Stepper — Indicator Modes',
9
+ description:
10
+ 'The indicator prop side by side: auto (check when done, ring when current, number ahead), always-number, and a custom icon per step.',
11
+ isReady: true,
12
+ aspectRatio: 4 / 3,
13
+ componentsUsed: ['Stepper', 'Text', 'Icon'],
14
+ };
@@ -0,0 +1,68 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ 'use client';
4
+
5
+ import {useState} from 'react';
6
+ import {Stepper, Step} from '@astryxdesign/lab';
7
+ import {Text} from '@astryxdesign/core/Text';
8
+ import {Icon} from '@astryxdesign/core/Icon';
9
+
10
+ export default function StepperIndicatorModes() {
11
+ const [active, setActive] = useState(2);
12
+ return (
13
+ <div style={{display: 'flex', gap: 48, flexWrap: 'wrap'}}>
14
+ <div style={{maxWidth: 220}}>
15
+ <Text type="label">Auto</Text>
16
+ <Stepper
17
+ activeStep={active}
18
+ orientation="vertical"
19
+ onStepClick={setActive}>
20
+ <Step step={0} label="Account" />
21
+ <Step step={1} label="Profile" />
22
+ <Step step={2} label="Settings" />
23
+ <Step step={3} label="Review" />
24
+ </Stepper>
25
+ </div>
26
+ <div style={{maxWidth: 220}}>
27
+ <Text type="label">Number</Text>
28
+ <Stepper
29
+ activeStep={active}
30
+ orientation="vertical"
31
+ onStepClick={setActive}>
32
+ <Step step={0} label="Account" indicator="number" />
33
+ <Step step={1} label="Profile" indicator="number" />
34
+ <Step step={2} label="Settings" indicator="number" />
35
+ <Step step={3} label="Review" indicator="number" />
36
+ </Stepper>
37
+ </div>
38
+ <div style={{maxWidth: 220}}>
39
+ <Text type="label">Custom icon</Text>
40
+ <Stepper
41
+ activeStep={active}
42
+ orientation="vertical"
43
+ onStepClick={setActive}>
44
+ <Step
45
+ step={0}
46
+ label="Account"
47
+ icon={<Icon icon="info" size="sm" />}
48
+ />
49
+ <Step
50
+ step={1}
51
+ label="Profile"
52
+ icon={<Icon icon="search" size="sm" />}
53
+ />
54
+ <Step
55
+ step={2}
56
+ label="Settings"
57
+ icon={<Icon icon="wrench" size="sm" />}
58
+ />
59
+ <Step
60
+ step={3}
61
+ label="Review"
62
+ icon={<Icon icon="check" size="sm" />}
63
+ />
64
+ </Stepper>
65
+ </div>
66
+ </div>
67
+ );
68
+ }
@@ -0,0 +1,14 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /** @type {import('@astryxdesign/cli/authoring').TemplateDoc} */
4
+ export const doc = {
5
+ type: 'block',
6
+ exampleFor: 'Stepper',
7
+ name: 'Stepper — Multi-Step Form',
8
+ displayName: 'Stepper — Multi-Step Form',
9
+ description:
10
+ 'A vertical stepper driving a multi-step form. Each step renders its own fields in the content slot for the active step, with Back/Continue buttons advancing activeStep.',
11
+ isReady: true,
12
+ aspectRatio: 4 / 3,
13
+ componentsUsed: ['Stepper', 'TextInput', 'Button', 'Text'],
14
+ };
@@ -0,0 +1,92 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ 'use client';
4
+
5
+ import {useState} from 'react';
6
+ import {Stepper, Step} from '@astryxdesign/lab';
7
+ import {TextInput} from '@astryxdesign/core/TextInput';
8
+ import {Button} from '@astryxdesign/core/Button';
9
+ import {Text} from '@astryxdesign/core/Text';
10
+
11
+ export default function StepperMultiStepForm() {
12
+ const [active, setActive] = useState(0);
13
+ return (
14
+ <div style={{width: '100%', maxWidth: 480}}>
15
+ <Stepper
16
+ activeStep={active}
17
+ orientation="vertical"
18
+ onStepClick={setActive}>
19
+ <Step step={0} label="Project details" indicator="number">
20
+ {active === 0 && (
21
+ <div style={{display: 'flex', flexDirection: 'column', gap: 12}}>
22
+ <TextInput
23
+ label="Project name"
24
+ placeholder="My awesome project"
25
+ value=""
26
+ />
27
+ <TextInput
28
+ label="Repository URL"
29
+ placeholder="https://github.com/..."
30
+ value=""
31
+ />
32
+ <div>
33
+ <Button
34
+ label="Continue"
35
+ variant="primary"
36
+ onClick={() => setActive(1)}
37
+ />
38
+ </div>
39
+ </div>
40
+ )}
41
+ </Step>
42
+ <Step step={1} label="Environment" indicator="number">
43
+ {active === 1 && (
44
+ <div style={{display: 'flex', flexDirection: 'column', gap: 12}}>
45
+ <TextInput label="Node version" placeholder="20" value="" />
46
+ <TextInput
47
+ label="Build command"
48
+ placeholder="npm run build"
49
+ value=""
50
+ />
51
+ <div style={{display: 'flex', gap: 8}}>
52
+ <Button
53
+ label="Back"
54
+ variant="secondary"
55
+ onClick={() => setActive(0)}
56
+ />
57
+ <Button
58
+ label="Continue"
59
+ variant="primary"
60
+ onClick={() => setActive(2)}
61
+ />
62
+ </div>
63
+ </div>
64
+ )}
65
+ </Step>
66
+ <Step step={2} label="Deploy" indicator="number">
67
+ {active === 2 && (
68
+ <div style={{display: 'flex', flexDirection: 'column', gap: 12}}>
69
+ <Text type="body">
70
+ Ready to deploy. This creates a production build and pushes to
71
+ your configured hosting.
72
+ </Text>
73
+ <div style={{display: 'flex', gap: 8}}>
74
+ <Button
75
+ label="Back"
76
+ variant="secondary"
77
+ onClick={() => setActive(1)}
78
+ />
79
+ <Button
80
+ label="Deploy now"
81
+ variant="primary"
82
+ onClick={() => setActive(3)}
83
+ />
84
+ </div>
85
+ </div>
86
+ )}
87
+ </Step>
88
+ <Step step={3} label="Done" indicator="number" />
89
+ </Stepper>
90
+ </div>
91
+ );
92
+ }
@@ -0,0 +1,14 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /** @type {import('@astryxdesign/cli/authoring').TemplateDoc} */
4
+ export const doc = {
5
+ type: 'block',
6
+ exampleFor: 'Stepper',
7
+ name: 'Stepper — On-Track Vertical',
8
+ displayName: 'Stepper — On-Track Vertical',
9
+ description:
10
+ 'The on-track layout in vertical orientation: indicators sit inline on a continuous connector rail, with each label and description beside its node.',
11
+ isReady: true,
12
+ aspectRatio: 4 / 3,
13
+ componentsUsed: ['Stepper'],
14
+ };
@@ -0,0 +1,41 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ 'use client';
4
+
5
+ import {useState} from 'react';
6
+ import {Stepper, Step} from '@astryxdesign/lab';
7
+
8
+ export default function StepperOnTrackVertical() {
9
+ const [active, setActive] = useState(2);
10
+ return (
11
+ <div style={{width: '100%', maxWidth: 400}}>
12
+ <Stepper
13
+ activeStep={active}
14
+ orientation="vertical"
15
+ indicatorPosition="on-track"
16
+ onStepClick={setActive}>
17
+ <Step
18
+ step={0}
19
+ label="Create workspace"
20
+ description="Name and configure your workspace"
21
+ />
22
+ <Step
23
+ step={1}
24
+ label="Invite team members"
25
+ description="Add collaborators by email"
26
+ />
27
+ <Step
28
+ step={2}
29
+ label="Set up integrations"
30
+ description="Connect Slack, GitHub, Jira"
31
+ />
32
+ <Step
33
+ step={3}
34
+ label="Import data"
35
+ description="Bring in existing projects"
36
+ />
37
+ <Step step={4} label="Launch" description="Go live with your team" />
38
+ </Stepper>
39
+ </div>
40
+ );
41
+ }
@@ -0,0 +1,15 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /** @type {import('@astryxdesign/cli/authoring').TemplateDoc} */
4
+ export const doc = {
5
+ type: 'block',
6
+ exampleFor: 'Stepper',
7
+ name: 'Stepper — Checkout Progress',
8
+ displayName: 'Stepper — Checkout Progress',
9
+ description:
10
+ 'A horizontal on-track stepper for a checkout flow: numbered nodes sit on a continuous connector, with completed and current steps filled. Click any step to jump.',
11
+ isReady: true,
12
+ isShowcase: true,
13
+ aspectRatio: 16 / 9,
14
+ componentsUsed: ['Stepper'],
15
+ };
@@ -0,0 +1,25 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ 'use client';
4
+
5
+ import {useState} from 'react';
6
+ import {Stepper, Step} from '@astryxdesign/lab';
7
+
8
+ export default function StepperShowcase() {
9
+ const [active, setActive] = useState(2);
10
+ return (
11
+ <div style={{width: '100%', maxWidth: 640}}>
12
+ <Stepper
13
+ activeStep={active}
14
+ orientation="horizontal"
15
+ indicatorPosition="on-track"
16
+ onStepClick={setActive}>
17
+ <Step step={0} label="Cart" indicator="number" />
18
+ <Step step={1} label="Shipping" indicator="number" />
19
+ <Step step={2} label="Payment" indicator="number" />
20
+ <Step step={3} label="Review" indicator="number" />
21
+ <Step step={4} label="Confirm" indicator="number" />
22
+ </Stepper>
23
+ </div>
24
+ );
25
+ }
@@ -0,0 +1,14 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /** @type {import('@astryxdesign/cli/authoring').TemplateDoc} */
4
+ export const doc = {
5
+ type: 'block',
6
+ exampleFor: 'Stepper',
7
+ name: 'Stepper — Validation Status',
8
+ displayName: 'Stepper — Validation Status',
9
+ description:
10
+ 'Semantic status per step in a verification flow: success shows a green check, error a red glyph, accent the in-progress step. Status sets the indicator color and glyph only, never the connector, and is announced to assistive tech as text.',
11
+ isReady: true,
12
+ aspectRatio: 4 / 3,
13
+ componentsUsed: ['Stepper'],
14
+ };
@@ -0,0 +1,50 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ 'use client';
4
+
5
+ import {useState} from 'react';
6
+ import {Stepper, Step} from '@astryxdesign/lab';
7
+
8
+ export default function StepperStatus() {
9
+ const [active, setActive] = useState(3);
10
+ return (
11
+ <div style={{width: '100%', maxWidth: 400}}>
12
+ <Stepper
13
+ activeStep={active}
14
+ orientation="vertical"
15
+ onStepClick={setActive}>
16
+ <Step
17
+ step={0}
18
+ label="Email verified"
19
+ description="you@example.com"
20
+ status="success"
21
+ />
22
+ <Step
23
+ step={1}
24
+ label="Phone verified"
25
+ description="+1 (555) 012-3456"
26
+ status="success"
27
+ />
28
+ <Step
29
+ step={2}
30
+ label="Identity document"
31
+ description="Passport upload failed"
32
+ status="error"
33
+ />
34
+ <Step
35
+ step={3}
36
+ label="Address verification"
37
+ description="Pending review"
38
+ status="accent"
39
+ />
40
+ <Step
41
+ step={4}
42
+ label="Background check"
43
+ isOptional
44
+ description="Skipped"
45
+ />
46
+ <Step step={5} label="Account activated" />
47
+ </Stepper>
48
+ </div>
49
+ );
50
+ }
@@ -0,0 +1,14 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /** @type {import('@astryxdesign/cli/authoring').TemplateDoc} */
4
+ export const doc = {
5
+ type: 'block',
6
+ exampleFor: 'Stepper',
7
+ name: 'Stepper — Vertical Onboarding',
8
+ displayName: 'Stepper — Vertical Onboarding',
9
+ description:
10
+ 'A vertical stepper for an onboarding flow, with a label and description per step. The auto indicator shows a check for completed steps, a ring for the current step, and a number for upcoming ones.',
11
+ isReady: true,
12
+ aspectRatio: 4 / 3,
13
+ componentsUsed: ['Stepper'],
14
+ };
@@ -0,0 +1,40 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ 'use client';
4
+
5
+ import {useState} from 'react';
6
+ import {Stepper, Step} from '@astryxdesign/lab';
7
+
8
+ export default function StepperVerticalOnboarding() {
9
+ const [active, setActive] = useState(2);
10
+ return (
11
+ <div style={{width: '100%', maxWidth: 400}}>
12
+ <Stepper
13
+ activeStep={active}
14
+ orientation="vertical"
15
+ onStepClick={setActive}>
16
+ <Step
17
+ step={0}
18
+ label="Create workspace"
19
+ description="Name and configure your workspace"
20
+ />
21
+ <Step
22
+ step={1}
23
+ label="Invite team members"
24
+ description="Add collaborators by email"
25
+ />
26
+ <Step
27
+ step={2}
28
+ label="Set up integrations"
29
+ description="Connect Slack, GitHub, Jira"
30
+ />
31
+ <Step
32
+ step={3}
33
+ label="Import data"
34
+ description="Bring in existing projects"
35
+ />
36
+ <Step step={4} label="Launch" description="Go live with your team" />
37
+ </Stepper>
38
+ </div>
39
+ );
40
+ }