@astryxdesign/cli 0.4.7 → 0.5.0-canary.009bcb3
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 -0
- package/README.md +53 -51
- package/api/docs/docs.doc.mjs +2 -2
- package/api/index.d.mts +1 -1
- package/api/index.mjs +1 -1
- package/api/search/search.mjs +50 -4
- package/api/search/search.test.mjs +71 -0
- package/api/template/data-token-fallbacks.test.mjs +85 -0
- package/api/template/template.doc.mjs +2 -2
- package/api/theme/build/build.mjs +43 -44
- package/api/theme/targets/targets.d.mts +18 -0
- package/api/theme/targets/targets.mjs +87 -0
- package/api/theme/targets/targets.test.mjs +66 -0
- package/api/theme/theme.d.mts +1 -0
- package/api/theme/theme.mjs +3 -1
- package/api/theme/theme.type.d.mts +23 -0
- package/api/theme/theme.type.mjs +21 -1
- package/api/theme/themeTargets.doc.d.mts +11 -0
- package/api/theme/themeTargets.doc.mjs +58 -0
- package/api/theme/themeTemplate.doc.mjs +3 -3
- package/assets/codemods/__tests__/registry.test.mjs +1 -0
- package/assets/codemods/registry.mjs +1 -0
- package/assets/codemods/transforms/v0.5.0/__tests__/next-codemods.test.mjs +127 -0
- package/assets/codemods/transforms/v0.5.0/banner-collapsible-content.mjs +171 -0
- package/assets/codemods/transforms/v0.5.0/index.mjs +20 -0
- package/assets/docs/README.md +50 -0
- package/assets/docs/cli-integrations.doc.mjs +4 -4
- package/assets/docs/theme.doc.dense.mjs +1 -1
- package/assets/docs/theme.doc.mjs +1 -1
- package/assets/docs/typography.doc.mjs +2 -2
- package/assets/templates/blocks/components/Banner/BannerCollapsibleContent.doc.mjs +1 -1
- package/assets/templates/blocks/components/Banner/BannerCollapsibleContent.tsx +1 -1
- package/assets/templates/blocks/components/DateInput/DateInputClearable.tsx +5 -1
- package/assets/templates/blocks/components/DateInput/DateInputDateRange.tsx +6 -1
- package/assets/templates/blocks/components/DateInput/DateInputFormats.tsx +5 -1
- package/assets/templates/blocks/components/DateInput/DateInputShowcase.tsx +4 -1
- package/assets/templates/blocks/components/DateInput/DateInputWithDescription.tsx +5 -1
- package/assets/templates/blocks/components/DateInput/DateInputWithValidation.tsx +5 -1
- package/assets/templates/blocks/components/Dialog/DialogAdaptivePresentation.doc.mjs +25 -0
- package/assets/templates/blocks/components/Dialog/DialogAdaptivePresentation.tsx +167 -0
- package/assets/templates/blocks/components/Dialog/DialogScrollingContent.tsx +1 -1
- package/assets/templates/blocks/components/HoverCard/HoverCardHookUsage.tsx +4 -1
- package/assets/templates/blocks/components/Step/StepContent.doc.mjs +14 -0
- package/assets/templates/blocks/components/Step/StepContent.tsx +32 -0
- package/assets/templates/blocks/components/Step/StepIndicator.doc.mjs +14 -0
- package/assets/templates/blocks/components/Step/StepIndicator.tsx +60 -0
- package/assets/templates/blocks/components/Step/StepShowcase.doc.mjs +15 -0
- package/assets/templates/blocks/components/Step/StepShowcase.tsx +26 -0
- package/assets/templates/blocks/components/Step/StepStates.doc.mjs +14 -0
- package/assets/templates/blocks/components/Step/StepStates.tsx +46 -0
- package/assets/templates/blocks/components/Stepper/StepperCustomContent.doc.mjs +22 -0
- package/assets/templates/blocks/components/Stepper/StepperCustomContent.tsx +126 -0
- package/assets/templates/blocks/components/Stepper/StepperIndicatorModes.doc.mjs +1 -1
- package/assets/templates/blocks/components/Stepper/StepperIndicatorModes.tsx +17 -5
- package/assets/templates/blocks/components/Stepper/StepperOnTrackHorizontal.doc.mjs +14 -0
- package/assets/templates/blocks/components/Stepper/StepperOnTrackHorizontal.tsx +25 -0
- package/assets/templates/blocks/components/Stepper/StepperOnTrackVertical.doc.mjs +2 -2
- package/assets/templates/blocks/components/Stepper/StepperOnTrackVertical.tsx +1 -1
- package/assets/templates/blocks/components/Stepper/StepperShowcase.doc.mjs +1 -1
- package/assets/templates/blocks/components/Stepper/StepperShowcase.tsx +6 -7
- package/assets/templates/blocks/components/Stepper/StepperStatus.tsx +1 -1
- package/assets/templates/pages/dashboard-cohort-funnel/page.tsx +1 -1
- package/assets/templates/pages/dashboard-data/page.tsx +1 -1
- package/assets/templates/pages/dashboard-portfolio/page.tsx +5 -5
- package/assets/templates/pages/dashboard-service-monitoring/page.tsx +1 -1
- package/assets/templates/pages/mixed-gallery/page.tsx +12 -3
- package/assets/templates/pages/settings-dialog/page.tsx +2543 -757
- package/assets/templates/pages/settings-dialog/template.doc.mjs +1 -2
- package/assets/templates/pages/table-filter/page.tsx +4093 -0
- package/assets/templates/pages/table-filter/template.doc.mjs +12 -0
- package/assets/templates/pages/table-grouped/page.tsx +151 -144
- package/assets/templates/pages/theme-showcase/page.tsx +36 -17
- package/assets/templates/themes/chocolate/chocolateTheme.ts +3 -1
- package/assets/templates/themes/matcha/matchaTheme.ts +3 -1
- package/assets/templates/themes/neutral/neutralTheme.ts +16 -9
- package/assets/templates/themes/stone/stoneTheme.ts +3 -1
- package/clients/cli/commands/build-theme.color-scheme.test.mjs +7 -6
- package/clients/cli/commands/build-theme.data-tokens.test.mjs +144 -0
- package/clients/cli/commands/build-theme.mjs +85 -0
- package/clients/cli/commands/build-theme.variants.test.mjs +3 -0
- package/clients/cli/commands/dialog-adaptive-template.test.mjs +24 -0
- package/clients/cli/commands/theme-targets.behavior.test.mjs +64 -0
- package/clients/cli/commands/theme-targets.doc.mjs +38 -0
- package/clients/cli/commands/theme-template.doc.mjs +2 -2
- package/clients/cli/commands/theme.doc.mjs +4 -2
- package/clients/cli/index.mjs +1 -0
- package/clients/cli/lib/component-format.mjs +2 -2
- package/clients/cli/lib/manifest.mjs +2 -0
- package/foundation/discovery/component-discovery.mjs +10 -9
- package/foundation/discovery/hook-discovery.mjs +2 -1
- package/foundation/discovery/hook-discovery.test.mjs +156 -37
- package/foundation/discovery/theming-targets.d.mts +86 -0
- package/foundation/discovery/theming-targets.mjs +202 -0
- package/foundation/discovery/theming-targets.test.mjs +245 -0
- package/foundation/fs/paths.d.mts +16 -0
- package/foundation/fs/paths.mjs +36 -0
- package/foundation/fs/paths.test.mjs +29 -1
- package/foundation/response/response-types.doc.mjs +7 -2
- package/package.json +9 -9
- package/assets/templates/blocks/components/Stepper/StepperHorizontal.doc.mjs +0 -14
- package/assets/templates/blocks/components/Stepper/StepperHorizontal.tsx +0 -24
- package/assets/templates/blocks/components/Stepper/StepperMultiStepForm.doc.mjs +0 -14
- package/assets/templates/blocks/components/Stepper/StepperMultiStepForm.tsx +0 -92
- package/assets/templates/blocks/components/Stepper/StepperVerticalOnboarding.doc.mjs +0 -14
- package/assets/templates/blocks/components/Stepper/StepperVerticalOnboarding.tsx +0 -40
|
@@ -13,6 +13,7 @@ export default function HoverCardHookUsage() {
|
|
|
13
13
|
placement: 'below',
|
|
14
14
|
delay: 100,
|
|
15
15
|
isDefaultOpen: true,
|
|
16
|
+
label: 'Alex Morgan',
|
|
16
17
|
});
|
|
17
18
|
|
|
18
19
|
return (
|
|
@@ -20,7 +21,9 @@ export default function HoverCardHookUsage() {
|
|
|
20
21
|
<Button
|
|
21
22
|
label="Hover profile"
|
|
22
23
|
ref={hoverCard.ref}
|
|
23
|
-
aria-
|
|
24
|
+
aria-haspopup="dialog"
|
|
25
|
+
aria-controls={hoverCard.isOpen ? hoverCard.id : undefined}
|
|
26
|
+
aria-expanded={hoverCard.isOpen}
|
|
24
27
|
/>
|
|
25
28
|
{hoverCard.renderHoverCard(
|
|
26
29
|
<VStack gap={1}>
|
|
@@ -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: 'Step',
|
|
7
|
+
name: 'Step — Content Slot',
|
|
8
|
+
displayName: 'Step — Content Slot',
|
|
9
|
+
description:
|
|
10
|
+
'Children passed to a Step render below its description, indented to line up with the label rather than the indicator, and stay outside the clickable label area so buttons inside remain their own targets. In a full flow you gate the slot on the step being active. That is what turns a vertical stepper into an expanding one.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 4 / 3,
|
|
13
|
+
componentsUsed: ['Stepper', 'Step', 'TextInput', 'Button'],
|
|
14
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {Stepper, Step} from '@astryxdesign/core/Stepper';
|
|
6
|
+
import {TextInput} from '@astryxdesign/core/TextInput';
|
|
7
|
+
import {Button} from '@astryxdesign/core/Button';
|
|
8
|
+
|
|
9
|
+
export default function StepContent() {
|
|
10
|
+
// Anything passed as children renders below the description, indented to line
|
|
11
|
+
// up with the label rather than the indicator. In a full flow you would gate
|
|
12
|
+
// this on the step being active; here it is a single Step so the slot is
|
|
13
|
+
// always shown.
|
|
14
|
+
return (
|
|
15
|
+
<div style={{width: 400}}>
|
|
16
|
+
<Stepper activeStep={1} orientation="vertical">
|
|
17
|
+
<Step
|
|
18
|
+
step={1}
|
|
19
|
+
label="Billing address"
|
|
20
|
+
description="Used for invoices and tax calculation">
|
|
21
|
+
<div style={{display: 'flex', flexDirection: 'column', gap: 12}}>
|
|
22
|
+
<TextInput label="Street" placeholder="1 Hacker Way" value="" />
|
|
23
|
+
<TextInput label="City" placeholder="Menlo Park" value="" />
|
|
24
|
+
<div>
|
|
25
|
+
<Button label="Save address" variant="primary" />
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
</Step>
|
|
29
|
+
</Stepper>
|
|
30
|
+
</div>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
@@ -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: 'Step',
|
|
7
|
+
name: 'Step — Indicator',
|
|
8
|
+
displayName: 'Step — Indicator',
|
|
9
|
+
description:
|
|
10
|
+
'Everything the indicator prop accepts: the auto default, an always-number badge, a custom ReactNode, and none, each on its own completed Step so the prop is the only difference between them. Every variant occupies the same 16px box, so a step swapping its number for a check as it completes never shifts the label beside it. The last cell shows that a custom node can be live rather than static: a Spinner on a step that is in progress, shaded `inherit` so it picks up the step\'s own tint like any other glyph.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 4 / 3,
|
|
13
|
+
componentsUsed: ['Stepper', 'Step', 'Icon', 'Spinner', 'Text'],
|
|
14
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {Stepper, Step} from '@astryxdesign/core/Stepper';
|
|
6
|
+
import {Text} from '@astryxdesign/core/Text';
|
|
7
|
+
import {Icon} from '@astryxdesign/core/Icon';
|
|
8
|
+
import {Spinner} from '@astryxdesign/core/Spinner';
|
|
9
|
+
|
|
10
|
+
export default function StepIndicator() {
|
|
11
|
+
// The first four steps are all completed — same progress, so the indicator
|
|
12
|
+
// prop is the only difference between them. `auto` is the one that reacts to
|
|
13
|
+
// progress: a numbered badge until the step is reached, then a check. The
|
|
14
|
+
// last step is in progress instead, because the node it passes to `indicator`
|
|
15
|
+
// is a spinner and a spinner only makes sense on work that is running.
|
|
16
|
+
return (
|
|
17
|
+
<div style={{display: 'flex', flexWrap: 'wrap', gap: 24}}>
|
|
18
|
+
<div style={{width: 190}}>
|
|
19
|
+
<Text type="label">auto (default)</Text>
|
|
20
|
+
<Stepper activeStep={1} orientation="vertical">
|
|
21
|
+
<Step step={0} label="Verify email" />
|
|
22
|
+
</Stepper>
|
|
23
|
+
</div>
|
|
24
|
+
<div style={{width: 190}}>
|
|
25
|
+
<Text type="label">number</Text>
|
|
26
|
+
<Stepper activeStep={1} orientation="vertical">
|
|
27
|
+
<Step step={0} label="Verify email" indicator="number" />
|
|
28
|
+
</Stepper>
|
|
29
|
+
</div>
|
|
30
|
+
<div style={{width: 190}}>
|
|
31
|
+
<Text type="label">Custom node</Text>
|
|
32
|
+
<Stepper activeStep={1} orientation="vertical">
|
|
33
|
+
<Step
|
|
34
|
+
step={0}
|
|
35
|
+
label="Verify email"
|
|
36
|
+
indicator={<Icon icon="wrench" size="sm" />}
|
|
37
|
+
/>
|
|
38
|
+
</Stepper>
|
|
39
|
+
</div>
|
|
40
|
+
<div style={{width: 190}}>
|
|
41
|
+
<Text type="label">none</Text>
|
|
42
|
+
<Stepper activeStep={1} orientation="vertical">
|
|
43
|
+
<Step step={0} label="Verify email" indicator="none" />
|
|
44
|
+
</Stepper>
|
|
45
|
+
</div>
|
|
46
|
+
<div style={{width: 190}}>
|
|
47
|
+
<Text type="label">Spinner (in progress)</Text>
|
|
48
|
+
<Stepper activeStep={0} orientation="vertical">
|
|
49
|
+
<Step
|
|
50
|
+
step={0}
|
|
51
|
+
label="Verify email"
|
|
52
|
+
// `inherit` picks up the indicator's own tint, so the spinner is
|
|
53
|
+
// colored by the step's progress and status like any other glyph.
|
|
54
|
+
indicator={<Spinner size="md" shade="inherit" />}
|
|
55
|
+
/>
|
|
56
|
+
</Stepper>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
@@ -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: 'Step',
|
|
7
|
+
name: 'Step',
|
|
8
|
+
displayName: 'Step',
|
|
9
|
+
description:
|
|
10
|
+
'A single Step, with every part it can render: the indicator, the label with its optional marker and trailing endContent, and the description beneath. A Step never sets its own completed/current state. It declares its index and derives the rest from the parent Stepper, so one Step in one Stepper is a complete example.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
isShowcase: true,
|
|
13
|
+
aspectRatio: 16 / 9,
|
|
14
|
+
componentsUsed: ['Stepper', 'Step', 'Text'],
|
|
15
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {Stepper, Step} from '@astryxdesign/core/Stepper';
|
|
6
|
+
import {Text} from '@astryxdesign/core/Text';
|
|
7
|
+
|
|
8
|
+
export default function StepShowcase() {
|
|
9
|
+
// One Step, and every part it renders: the indicator, the label with its
|
|
10
|
+
// optional marker and trailing slot, and the description beneath. A Step is
|
|
11
|
+
// always wrapped in a Stepper — that is where it reads its progress from —
|
|
12
|
+
// so a single Step in a single Stepper is the smallest complete example.
|
|
13
|
+
return (
|
|
14
|
+
<div style={{width: 380}}>
|
|
15
|
+
<Stepper activeStep={1} orientation="vertical">
|
|
16
|
+
<Step
|
|
17
|
+
step={1}
|
|
18
|
+
label="Connect a repository"
|
|
19
|
+
description="Astryx reads your build settings from the default branch"
|
|
20
|
+
endContent={<Text type="supporting">2 min</Text>}
|
|
21
|
+
isOptional
|
|
22
|
+
/>
|
|
23
|
+
</Stepper>
|
|
24
|
+
</div>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
@@ -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: 'Step',
|
|
7
|
+
name: 'Step — States',
|
|
8
|
+
displayName: 'Step — States',
|
|
9
|
+
description:
|
|
10
|
+
'Every state a single Step can land in, each shown as one Step in its own Stepper. Completed, current, and upcoming are derived by comparing the step index against the parent activeStep, so they are never set directly; isDisabled and status are the two a step declares itself. Status is a separate axis from progress, which is why a completed step can still carry a warning.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 4 / 3,
|
|
13
|
+
componentsUsed: ['Stepper', 'Step', 'Text'],
|
|
14
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {Stepper, Step} from '@astryxdesign/core/Stepper';
|
|
6
|
+
import {Text} from '@astryxdesign/core/Text';
|
|
7
|
+
|
|
8
|
+
export default function StepStates() {
|
|
9
|
+
// A Step holds no state of its own — it compares its `step` index against the
|
|
10
|
+
// Stepper's `activeStep`. Each state below is therefore one Step in its own
|
|
11
|
+
// Stepper, with activeStep placed on one side of it or the other.
|
|
12
|
+
return (
|
|
13
|
+
<div style={{display: 'flex', flexWrap: 'wrap', gap: 32}}>
|
|
14
|
+
<div style={{width: 220}}>
|
|
15
|
+
<Text type="label">Completed</Text>
|
|
16
|
+
<Stepper activeStep={1} orientation="vertical">
|
|
17
|
+
<Step step={0} label="Verify email" />
|
|
18
|
+
</Stepper>
|
|
19
|
+
</div>
|
|
20
|
+
<div style={{width: 220}}>
|
|
21
|
+
<Text type="label">Current</Text>
|
|
22
|
+
<Stepper activeStep={0} orientation="vertical">
|
|
23
|
+
<Step step={0} label="Verify email" />
|
|
24
|
+
</Stepper>
|
|
25
|
+
</div>
|
|
26
|
+
<div style={{width: 220}}>
|
|
27
|
+
<Text type="label">Upcoming</Text>
|
|
28
|
+
<Stepper activeStep={0} orientation="vertical">
|
|
29
|
+
<Step step={1} label="Add a payment method" />
|
|
30
|
+
</Stepper>
|
|
31
|
+
</div>
|
|
32
|
+
<div style={{width: 220}}>
|
|
33
|
+
<Text type="label">Disabled</Text>
|
|
34
|
+
<Stepper activeStep={0} orientation="vertical" onStepClick={() => {}}>
|
|
35
|
+
<Step step={1} label="Add a payment method" isDisabled />
|
|
36
|
+
</Stepper>
|
|
37
|
+
</div>
|
|
38
|
+
<div style={{width: 220}}>
|
|
39
|
+
<Text type="label">Completed, with a status</Text>
|
|
40
|
+
<Stepper activeStep={1} orientation="vertical">
|
|
41
|
+
<Step step={0} label="Verify email" status="warning" />
|
|
42
|
+
</Stepper>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
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 — Custom Content',
|
|
8
|
+
displayName: 'Stepper — Custom Content',
|
|
9
|
+
description:
|
|
10
|
+
'A vertical stepper where each step owns a slice of the page. The content slot takes any node (form fields, a summary panel, a banner), so a stepper is not limited to multi-step forms. Rendering the slot only for the active step is what makes the flow expand one step at a time.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 4 / 3,
|
|
13
|
+
componentsUsed: [
|
|
14
|
+
'Stepper',
|
|
15
|
+
'TextInput',
|
|
16
|
+
'Button',
|
|
17
|
+
'Text',
|
|
18
|
+
'Card',
|
|
19
|
+
'Badge',
|
|
20
|
+
'Banner',
|
|
21
|
+
],
|
|
22
|
+
};
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {useState} from 'react';
|
|
6
|
+
import {Stepper, Step} from '@astryxdesign/core/Stepper';
|
|
7
|
+
import {TextInput} from '@astryxdesign/core/TextInput';
|
|
8
|
+
import {Button} from '@astryxdesign/core/Button';
|
|
9
|
+
import {Text} from '@astryxdesign/core/Text';
|
|
10
|
+
import {Card} from '@astryxdesign/core/Card';
|
|
11
|
+
import {Badge} from '@astryxdesign/core/Badge';
|
|
12
|
+
import {Banner} from '@astryxdesign/core/Banner';
|
|
13
|
+
|
|
14
|
+
export default function StepperCustomContent() {
|
|
15
|
+
const [active, setActive] = useState(0);
|
|
16
|
+
// The content slot takes any node, not just form fields — a panel, a summary,
|
|
17
|
+
// a notice. Gating it on `active` is what makes the flow expand a step at a
|
|
18
|
+
// time.
|
|
19
|
+
return (
|
|
20
|
+
<div style={{width: 680}}>
|
|
21
|
+
<Stepper
|
|
22
|
+
activeStep={active}
|
|
23
|
+
orientation="vertical"
|
|
24
|
+
onStepClick={setActive}>
|
|
25
|
+
<Step
|
|
26
|
+
step={0}
|
|
27
|
+
label="Project details"
|
|
28
|
+
description="Name it and point us at the source"
|
|
29
|
+
indicator="number">
|
|
30
|
+
{active === 0 && (
|
|
31
|
+
<div style={{display: 'flex', flexDirection: 'column', gap: 12}}>
|
|
32
|
+
<div style={{display: 'flex', gap: 12}}>
|
|
33
|
+
<TextInput
|
|
34
|
+
label="Project name"
|
|
35
|
+
placeholder="My awesome project"
|
|
36
|
+
value=""
|
|
37
|
+
width="100%"
|
|
38
|
+
/>
|
|
39
|
+
<TextInput
|
|
40
|
+
label="Repository URL"
|
|
41
|
+
placeholder="https://github.com/..."
|
|
42
|
+
value=""
|
|
43
|
+
width="100%"
|
|
44
|
+
/>
|
|
45
|
+
</div>
|
|
46
|
+
<div>
|
|
47
|
+
<Button
|
|
48
|
+
label="Continue"
|
|
49
|
+
variant="primary"
|
|
50
|
+
onClick={() => setActive(1)}
|
|
51
|
+
/>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
)}
|
|
55
|
+
</Step>
|
|
56
|
+
<Step
|
|
57
|
+
step={1}
|
|
58
|
+
label="Review the build"
|
|
59
|
+
description="What we detected from your default branch"
|
|
60
|
+
indicator="number">
|
|
61
|
+
{active === 1 && (
|
|
62
|
+
<div style={{display: 'flex', flexDirection: 'column', gap: 12}}>
|
|
63
|
+
<Card variant="muted" padding={3}>
|
|
64
|
+
<div style={{display: 'flex', flexDirection: 'column', gap: 8}}>
|
|
65
|
+
<div
|
|
66
|
+
style={{
|
|
67
|
+
display: 'flex',
|
|
68
|
+
alignItems: 'center',
|
|
69
|
+
gap: 8,
|
|
70
|
+
}}>
|
|
71
|
+
<Text type="label">Next.js 15</Text>
|
|
72
|
+
<Badge variant="success" label="Detected" />
|
|
73
|
+
</div>
|
|
74
|
+
<Text type="supporting">
|
|
75
|
+
Build command <code>next build</code> · Output{' '}
|
|
76
|
+
<code>.next</code> · Node 20
|
|
77
|
+
</Text>
|
|
78
|
+
</div>
|
|
79
|
+
</Card>
|
|
80
|
+
<div style={{display: 'flex', gap: 8}}>
|
|
81
|
+
<Button
|
|
82
|
+
label="Back"
|
|
83
|
+
variant="secondary"
|
|
84
|
+
onClick={() => setActive(0)}
|
|
85
|
+
/>
|
|
86
|
+
<Button
|
|
87
|
+
label="Looks right"
|
|
88
|
+
variant="primary"
|
|
89
|
+
onClick={() => setActive(2)}
|
|
90
|
+
/>
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
)}
|
|
94
|
+
</Step>
|
|
95
|
+
<Step
|
|
96
|
+
step={2}
|
|
97
|
+
label="Deploy"
|
|
98
|
+
description="Ships to production"
|
|
99
|
+
indicator="number">
|
|
100
|
+
{active === 2 && (
|
|
101
|
+
<div style={{display: 'flex', flexDirection: 'column', gap: 12}}>
|
|
102
|
+
<Banner
|
|
103
|
+
status="info"
|
|
104
|
+
title="First deploy takes a few minutes"
|
|
105
|
+
description="Later deploys reuse the build cache and finish in under a minute."
|
|
106
|
+
/>
|
|
107
|
+
<div style={{display: 'flex', gap: 8}}>
|
|
108
|
+
<Button
|
|
109
|
+
label="Back"
|
|
110
|
+
variant="secondary"
|
|
111
|
+
onClick={() => setActive(1)}
|
|
112
|
+
/>
|
|
113
|
+
<Button
|
|
114
|
+
label="Deploy now"
|
|
115
|
+
variant="primary"
|
|
116
|
+
onClick={() => setActive(3)}
|
|
117
|
+
/>
|
|
118
|
+
</div>
|
|
119
|
+
</div>
|
|
120
|
+
)}
|
|
121
|
+
</Step>
|
|
122
|
+
<Step step={3} label="Live" indicator="number" />
|
|
123
|
+
</Stepper>
|
|
124
|
+
</div>
|
|
125
|
+
);
|
|
126
|
+
}
|
|
@@ -7,7 +7,7 @@ export const doc = {
|
|
|
7
7
|
name: 'Stepper — Indicator Modes',
|
|
8
8
|
displayName: 'Stepper — Indicator Modes',
|
|
9
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.',
|
|
10
|
+
'The indicator prop side by side: none (the bar and label carry the progress on their own), auto (check when done, ring when current, number ahead), always-number, and a custom icon per step.',
|
|
11
11
|
isReady: true,
|
|
12
12
|
aspectRatio: 4 / 3,
|
|
13
13
|
componentsUsed: ['Stepper', 'Text', 'Icon'],
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
'use client';
|
|
4
4
|
|
|
5
5
|
import {useState} from 'react';
|
|
6
|
-
import {Stepper, Step} from '@astryxdesign/
|
|
6
|
+
import {Stepper, Step} from '@astryxdesign/core/Stepper';
|
|
7
7
|
import {Text} from '@astryxdesign/core/Text';
|
|
8
8
|
import {Icon} from '@astryxdesign/core/Icon';
|
|
9
9
|
|
|
@@ -11,6 +11,18 @@ export default function StepperIndicatorModes() {
|
|
|
11
11
|
const [active, setActive] = useState(2);
|
|
12
12
|
return (
|
|
13
13
|
<div style={{display: 'flex', gap: 48, flexWrap: 'wrap'}}>
|
|
14
|
+
<div style={{maxWidth: 220}}>
|
|
15
|
+
<Text type="label">None</Text>
|
|
16
|
+
<Stepper
|
|
17
|
+
activeStep={active}
|
|
18
|
+
orientation="vertical"
|
|
19
|
+
onStepClick={setActive}>
|
|
20
|
+
<Step step={0} label="Account" indicator="none" />
|
|
21
|
+
<Step step={1} label="Profile" indicator="none" />
|
|
22
|
+
<Step step={2} label="Settings" indicator="none" />
|
|
23
|
+
<Step step={3} label="Review" indicator="none" />
|
|
24
|
+
</Stepper>
|
|
25
|
+
</div>
|
|
14
26
|
<div style={{maxWidth: 220}}>
|
|
15
27
|
<Text type="label">Auto</Text>
|
|
16
28
|
<Stepper
|
|
@@ -44,22 +56,22 @@ export default function StepperIndicatorModes() {
|
|
|
44
56
|
<Step
|
|
45
57
|
step={0}
|
|
46
58
|
label="Account"
|
|
47
|
-
|
|
59
|
+
indicator={<Icon icon="info" size="sm" />}
|
|
48
60
|
/>
|
|
49
61
|
<Step
|
|
50
62
|
step={1}
|
|
51
63
|
label="Profile"
|
|
52
|
-
|
|
64
|
+
indicator={<Icon icon="search" size="sm" />}
|
|
53
65
|
/>
|
|
54
66
|
<Step
|
|
55
67
|
step={2}
|
|
56
68
|
label="Settings"
|
|
57
|
-
|
|
69
|
+
indicator={<Icon icon="wrench" size="sm" />}
|
|
58
70
|
/>
|
|
59
71
|
<Step
|
|
60
72
|
step={3}
|
|
61
73
|
label="Review"
|
|
62
|
-
|
|
74
|
+
indicator={<Icon icon="check" size="sm" />}
|
|
63
75
|
/>
|
|
64
76
|
</Stepper>
|
|
65
77
|
</div>
|
|
@@ -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 Horizontal',
|
|
8
|
+
displayName: 'Stepper — On-Track Horizontal',
|
|
9
|
+
description:
|
|
10
|
+
'The on-track layout in horizontal orientation: instead of sitting beside the label, each indicator is slotted into the connector itself, so the numbered nodes read as beads on one continuous line. Labels center under their node.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 16 / 9,
|
|
13
|
+
componentsUsed: ['Stepper'],
|
|
14
|
+
};
|
|
@@ -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/core/Stepper';
|
|
7
|
+
|
|
8
|
+
export default function StepperOnTrackHorizontal() {
|
|
9
|
+
const [active, setActive] = useState(2);
|
|
10
|
+
return (
|
|
11
|
+
<div style={{width: 560}}>
|
|
12
|
+
<Stepper
|
|
13
|
+
activeStep={active}
|
|
14
|
+
orientation="horizontal"
|
|
15
|
+
indicatorPosition="on-track"
|
|
16
|
+
onStepClick={setActive}>
|
|
17
|
+
<Step step={0} label="Workspace" indicator="number" />
|
|
18
|
+
<Step step={1} label="Team" indicator="number" />
|
|
19
|
+
<Step step={2} label="Integrations" indicator="number" />
|
|
20
|
+
<Step step={3} label="Import" indicator="number" />
|
|
21
|
+
<Step step={4} label="Launch" indicator="number" />
|
|
22
|
+
</Stepper>
|
|
23
|
+
</div>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
@@ -7,8 +7,8 @@ export const doc = {
|
|
|
7
7
|
name: 'Stepper — On-Track Vertical',
|
|
8
8
|
displayName: 'Stepper — On-Track Vertical',
|
|
9
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.',
|
|
10
|
+
'The on-track layout in vertical orientation: indicators sit inline on a continuous connector rail, with each label and description beside its node. Compare with the separated layout, where the indicator sits alongside its own bar segment instead of on a shared rail.',
|
|
11
11
|
isReady: true,
|
|
12
12
|
aspectRatio: 4 / 3,
|
|
13
|
-
componentsUsed: ['Stepper'],
|
|
13
|
+
componentsUsed: ['Stepper', 'Step'],
|
|
14
14
|
};
|
|
@@ -7,7 +7,7 @@ export const doc = {
|
|
|
7
7
|
name: 'Stepper — Checkout Progress',
|
|
8
8
|
displayName: 'Stepper — Checkout Progress',
|
|
9
9
|
description:
|
|
10
|
-
'
|
|
10
|
+
'The default stepper: a horizontal track where every step owns an equal segment of the progress bar above its label. The default auto indicator resolves itself per step: a check once the step is done, a ring on the current step, a number for the ones still ahead. Click any step to jump.',
|
|
11
11
|
isReady: true,
|
|
12
12
|
isShowcase: true,
|
|
13
13
|
aspectRatio: 16 / 9,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
'use client';
|
|
4
4
|
|
|
5
5
|
import {useState} from 'react';
|
|
6
|
-
import {Stepper, Step} from '@astryxdesign/
|
|
6
|
+
import {Stepper, Step} from '@astryxdesign/core/Stepper';
|
|
7
7
|
|
|
8
8
|
export default function StepperShowcase() {
|
|
9
9
|
const [active, setActive] = useState(2);
|
|
@@ -12,13 +12,12 @@ export default function StepperShowcase() {
|
|
|
12
12
|
<Stepper
|
|
13
13
|
activeStep={active}
|
|
14
14
|
orientation="horizontal"
|
|
15
|
-
indicatorPosition="on-track"
|
|
16
15
|
onStepClick={setActive}>
|
|
17
|
-
<Step step={0} label="Cart"
|
|
18
|
-
<Step step={1} label="Shipping"
|
|
19
|
-
<Step step={2} label="Payment"
|
|
20
|
-
<Step step={3} label="Review"
|
|
21
|
-
<Step step={4} label="Confirm"
|
|
16
|
+
<Step step={0} label="Cart" />
|
|
17
|
+
<Step step={1} label="Shipping" />
|
|
18
|
+
<Step step={2} label="Payment" />
|
|
19
|
+
<Step step={3} label="Review" />
|
|
20
|
+
<Step step={4} label="Confirm" />
|
|
22
21
|
</Stepper>
|
|
23
22
|
</div>
|
|
24
23
|
);
|
|
@@ -79,7 +79,7 @@ const COLORS = {
|
|
|
79
79
|
green: 'var(--color-data-categorical-green, #0B991F)',
|
|
80
80
|
orange: 'var(--color-data-categorical-orange, #EB6E00)',
|
|
81
81
|
purple: 'var(--color-data-categorical-purple, #6B1EFD)',
|
|
82
|
-
teal: 'var(--color-data-categorical-teal, #
|
|
82
|
+
teal: 'var(--color-data-categorical-teal, #08A3A3)',
|
|
83
83
|
};
|
|
84
84
|
const GRID_STROKE = 'var(--color-border, rgba(5, 54, 89, 0.1))';
|
|
85
85
|
const AXIS_TICK = {
|
|
@@ -98,7 +98,7 @@ const COLORS = {
|
|
|
98
98
|
green: 'var(--color-data-categorical-green, #0B991F)',
|
|
99
99
|
orange: 'var(--color-data-categorical-orange, #EB6E00)',
|
|
100
100
|
purple: 'var(--color-data-categorical-purple, #6B1EFD)',
|
|
101
|
-
teal: 'var(--color-data-categorical-teal, #
|
|
101
|
+
teal: 'var(--color-data-categorical-teal, #08A3A3)',
|
|
102
102
|
neutral: 'var(--color-data-neutral, #8494A3)',
|
|
103
103
|
};
|
|
104
104
|
const GRID_STROKE = 'var(--color-border, rgba(5, 54, 89, 0.1))';
|
|
@@ -370,12 +370,12 @@ function PortfolioChart() {
|
|
|
370
370
|
<linearGradient id="portfolioGradient" x1="0" y1="0" x2="0" y2="1">
|
|
371
371
|
<stop
|
|
372
372
|
offset="5%"
|
|
373
|
-
stopColor="var(--color-data-categorical-green, #
|
|
373
|
+
stopColor="var(--color-data-categorical-green, #0B991F)"
|
|
374
374
|
stopOpacity={0.3}
|
|
375
375
|
/>
|
|
376
376
|
<stop
|
|
377
377
|
offset="95%"
|
|
378
|
-
stopColor="var(--color-data-categorical-green, #
|
|
378
|
+
stopColor="var(--color-data-categorical-green, #0B991F)"
|
|
379
379
|
stopOpacity={0.05}
|
|
380
380
|
/>
|
|
381
381
|
</linearGradient>
|
|
@@ -417,7 +417,7 @@ function PortfolioChart() {
|
|
|
417
417
|
<Area
|
|
418
418
|
type="linear"
|
|
419
419
|
dataKey="value"
|
|
420
|
-
stroke="var(--color-data-categorical-green, #
|
|
420
|
+
stroke="var(--color-data-categorical-green, #0B991F)"
|
|
421
421
|
strokeWidth={1.5}
|
|
422
422
|
fill="url(#portfolioGradient)"
|
|
423
423
|
dot={false}
|
|
@@ -434,7 +434,7 @@ function Sparkline({data, positive}: {data: number[]; positive: boolean}) {
|
|
|
434
434
|
const chartData = data.map((v, i) => ({i, v}));
|
|
435
435
|
const color = positive
|
|
436
436
|
? 'var(--color-data-categorical-green, #0B991F)'
|
|
437
|
-
: 'var(--color-data-categorical-red, #
|
|
437
|
+
: 'var(--color-data-categorical-red, #F5394F)';
|
|
438
438
|
return (
|
|
439
439
|
<ResponsiveContainer width="100%" height={40}>
|
|
440
440
|
<LineChart
|
|
@@ -503,7 +503,7 @@ function TrendSparkline({data, positive}: {data: number[]; positive: boolean}) {
|
|
|
503
503
|
const chartData = data.map((v, i) => ({i, v}));
|
|
504
504
|
const color = positive
|
|
505
505
|
? 'var(--color-data-categorical-green, #0B991F)'
|
|
506
|
-
: 'var(--color-data-categorical-red, #
|
|
506
|
+
: 'var(--color-data-categorical-red, #F5394F)';
|
|
507
507
|
return (
|
|
508
508
|
<ResponsiveContainer width="100%" height={24}>
|
|
509
509
|
<LineChart
|
|
@@ -727,7 +727,7 @@ interface ChartLine {
|
|
|
727
727
|
const BLUE = 'var(--color-data-categorical-blue, #0171E3)';
|
|
728
728
|
const ORANGE = 'var(--color-data-categorical-orange, #EB6E00)';
|
|
729
729
|
const PURPLE = 'var(--color-data-categorical-purple, #6B1EFD)';
|
|
730
|
-
const TEAL = 'var(--color-data-categorical-teal, #
|
|
730
|
+
const TEAL = 'var(--color-data-categorical-teal, #08A3A3)';
|
|
731
731
|
|
|
732
732
|
const LATENCY_LINES: ChartLine[] = [
|
|
733
733
|
{key: 'p50', name: 'p50', color: BLUE},
|