@astryxdesign/cli 0.7.5-canary.fccd771 → 0.7.5
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 +91 -3
- package/README.md +2 -2
- package/api/hook/detail/detail.test.mjs +11 -0
- package/api/integration/pack-check.lifecycle-output.test.mjs +24 -1
- package/api/integration/pack-check.mjs +10 -4
- package/api/integration/pack-check.test.mjs +5 -1
- package/api/swizzle/copy/copy.mjs +1 -1
- package/api/template/tokenizer-showcase.test.mjs +47 -0
- package/api/theme/build/build.adaptation-enrollment.test.mjs +4 -0
- package/api/theme/build/build.icon-entry-variants.test.mjs +134 -0
- package/api/theme/build/build.icon-function-entries.test.mjs +499 -0
- package/api/theme/build/build.icon-variants.test.mjs +105 -0
- package/api/theme/build/build.mjs +371 -113
- package/api/theme/build/build.project-core.test.mjs +63 -8
- package/api/theme/build/build.test.mjs +77 -0
- package/api/theme/build/icon-imports.d.mts +12 -2
- package/api/theme/build/icon-imports.mjs +36 -11
- package/api/upgrade/_adapter.d.mts +47 -2
- package/api/upgrade/_adapter.mjs +58 -2
- package/api/upgrade/run/failure-receipt.test.mjs +212 -0
- package/api/upgrade/run/outcomes.test.mjs +646 -0
- package/api/upgrade/run/run.d.mts +36 -0
- package/api/upgrade/run/run.mjs +670 -44
- package/api/upgrade/upgrade.doc.mjs +4 -4
- package/api/upgrade/upgrade.mjs +19 -4
- package/api/upgrade/upgrade.type.d.mts +36 -1
- package/api/upgrade/upgrade.type.mjs +29 -4
- package/assets/codemods/__tests__/registry.test.mjs +1 -0
- package/assets/codemods/__tests__/runner.symlinks.test.mjs +205 -0
- package/assets/codemods/__tests__/runner.unparseable.test.mjs +457 -0
- package/assets/codemods/integration-runner.mjs +8 -2
- package/assets/codemods/integration-runner.protection.test.mjs +53 -0
- package/assets/codemods/outcome.mjs +79 -0
- package/assets/codemods/outcome.test.mjs +40 -0
- package/assets/codemods/parse.mjs +94 -0
- package/assets/codemods/registry.mjs +1 -0
- package/assets/codemods/run-codemod.mjs +109 -5
- package/assets/codemods/runner.mjs +119 -13
- package/assets/codemods/transform-prop.mjs +99 -49
- package/assets/codemods/transform-prop.test.mjs +36 -1
- package/assets/codemods/transforms/v0.1.2/rename-text-color-active-to-accent.mjs +1 -1
- package/assets/codemods/transforms/v0.1.3/__tests__/migrate-layout-components-to-experimental.test.mjs +216 -2
- package/assets/codemods/transforms/v0.1.3/migrate-layout-components-to-experimental.mjs +88 -6
- package/assets/codemods/transforms/v0.1.5/rename-switch-label-spacing-default-to-hug.mjs +1 -1
- package/assets/codemods/transforms/v0.1.7/migrate-table-tableprops-to-direct-props.mjs +1 -1
- package/assets/codemods/transforms/v0.1.8/rename-avatar-size-scale.mjs +1 -1
- package/assets/codemods/transforms/v0.2.0/remove-tablist-orientation.mjs +1 -1
- package/assets/codemods/transforms/v0.2.1/migrate-dialog-position-to-logical.mjs +1 -1
- package/assets/codemods/transforms/v0.6.0/migrate-astryx-theme-selectors-to-data-attrs.mjs +4 -3
- package/assets/codemods/transforms/v0.7.0/__tests__/migrate-deprecated-theme-surface.test.mjs +207 -6
- package/assets/codemods/transforms/v0.7.0/__tests__/validate-data-token-ownership.test.mjs +143 -70
- package/assets/codemods/transforms/v0.7.0/migrate-deprecated-theme-surface-v0.6-data.mjs +6 -1
- package/assets/codemods/transforms/v0.7.0/migrate-deprecated-theme-surface.mjs +244 -42
- package/assets/codemods/transforms/v0.7.0/validate-data-token-ownership.mjs +23 -78
- package/assets/codemods/transforms/v0.7.5/__tests__/migrate-codeblock-tokenizer-to-language.test.mjs +130 -0
- package/assets/codemods/transforms/v0.7.5/index.mjs +20 -0
- package/assets/codemods/transforms/v0.7.5/migrate-codeblock-tokenizer-to-language.mjs +315 -0
- package/assets/docs/README.md +13 -13
- package/assets/docs/author-a-theme.doc.mjs +5 -1
- package/assets/docs/getting-started.doc.mjs +5 -5
- package/assets/docs/icons.doc.mjs +82 -1
- package/assets/docs/motion.doc.mjs +1 -1
- package/assets/docs/theme.doc.dense.mjs +8 -0
- package/assets/docs/theme.doc.mjs +16 -0
- package/assets/docs/theme.doc.zh.mjs +11 -0
- package/assets/docs/tree/i18n-library-integration.doc.mjs +1 -1
- package/assets/docs/tree/styling-advanced.doc.mjs +1 -1
- package/assets/docs/tree/template-styles.doc.mjs +1 -1
- package/assets/docs/tree/tokens-color.doc.mjs +145 -1
- package/assets/docs/tree/tokens-ease.doc.mjs +4 -0
- package/assets/docs/tree/tokens.doc.mjs +1 -1
- package/assets/templates/blocks/components/BottomSheet/BottomSheetSwitcherReviewFlow.doc.mjs +6 -4
- package/assets/templates/blocks/components/BottomSheet/BottomSheetSwitcherReviewFlow.tsx +61 -55
- package/assets/templates/blocks/components/BottomSheet/BottomSheetSwitcherShowcase.doc.mjs +6 -4
- package/assets/templates/blocks/components/BottomSheet/BottomSheetSwitcherShowcase.tsx +68 -37
- package/assets/templates/blocks/components/CodeBlock/CodeBlockBashCommand.doc.mjs +1 -1
- package/assets/templates/blocks/components/CodeBlock/CodeBlockBashCommand.tsx +10 -2
- package/assets/templates/blocks/components/Thumbnail/ThumbnailDisabled.doc.mjs +1 -1
- package/assets/templates/blocks/components/Tokenizer/TokenizerShowcase.tsx +13 -6
- package/assets/templates/pages/dashboard-alert-rail/page.tsx +3 -3
- package/assets/templates/pages/library/page.tsx +1 -2
- package/assets/templates/pages/table-comparison/page.tsx +12 -3
- package/assets/templates/themes/butter/butterPaletteRefs.generated.ts +3 -2
- package/assets/templates/themes/butter/butterTheme.ts +47 -44
- package/assets/templates/themes/chocolate/chocolateTheme.ts +15 -2
- package/assets/templates/themes/gothic/gothicTheme.ts +21 -16
- package/assets/templates/themes/matcha/matchaPaletteRefs.generated.ts +1 -1
- package/assets/templates/themes/matcha/matchaTheme.ts +15 -2
- package/assets/templates/themes/neutral/neutralPaletteRefs.generated.ts +4 -4
- package/assets/templates/themes/neutral/neutralTheme.ts +24 -119
- package/assets/templates/themes/stone/stoneTheme.ts +46 -21
- package/assets/templates/themes/y2k/y2kTheme.ts +20 -16
- package/assets/theme.template.ts +19 -6
- package/authoring/codemod/type.ts +10 -0
- package/authoring/config/config.doc.mjs +1 -1
- package/clients/cli/commands/build-theme.adaptations.test.mjs +110 -0
- package/clients/cli/commands/build-theme.outside-project.test.mjs +140 -0
- package/clients/cli/commands/swizzle.routing.test.mjs +1 -1
- package/clients/cli/commands/upgrade.doc.mjs +47 -2
- package/clients/cli/commands/upgrade.file-protection.test.mjs +175 -0
- package/clients/cli/commands/upgrade.flag-help.test.mjs +37 -0
- package/clients/cli/commands/upgrade.integration-policy.test.mjs +103 -0
- package/clients/cli/commands/upgrade.mjs +9 -2
- package/clients/cli/commands/upgrade.outcomes.test.mjs +350 -0
- package/foundation/agent-docs/agent-docs.mjs +1 -0
- package/foundation/agent-docs/agent-docs.test.mjs +5 -0
- package/foundation/config/project.d.mts +1 -1
- package/foundation/config/project.mjs +1 -1
- package/foundation/debug/redact.test.mjs +1 -1
- package/foundation/doc-compiler/doc-loads.test.mjs +2 -6
- package/foundation/response/base.d.ts +7 -0
- package/foundation/response/error-codes.doc.mjs +3 -2
- package/foundation/response/error-codes.mjs +1 -1
- package/foundation/response/json.d.mts +10 -3
- package/foundation/response/json.mjs +16 -4
- package/foundation/response/response-types.doc.mjs +1 -1
- package/package.json +13 -12
|
@@ -26,6 +26,55 @@ export const docs = {
|
|
|
26
26
|
"type": "prose",
|
|
27
27
|
"text": "Semantic colors for consistent theming. All colors use light-dark() for automatic mode switching."
|
|
28
28
|
},
|
|
29
|
+
{
|
|
30
|
+
"type": "prose",
|
|
31
|
+
"text": "Status roles: pick the token by the surface. `<status>` is info, success, warning, or error."
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"type": "table",
|
|
35
|
+
"headers": [
|
|
36
|
+
"Status role",
|
|
37
|
+
"Use it for",
|
|
38
|
+
"Pairs with"
|
|
39
|
+
],
|
|
40
|
+
"rows": [
|
|
41
|
+
[
|
|
42
|
+
"--color-text-<status>",
|
|
43
|
+
"Status text on the page or a card (4.5:1 or more).",
|
|
44
|
+
"—"
|
|
45
|
+
],
|
|
46
|
+
[
|
|
47
|
+
"--color-icon-<status>",
|
|
48
|
+
"Status icons on the page or a card. Defaults to the text colour.",
|
|
49
|
+
"—"
|
|
50
|
+
],
|
|
51
|
+
[
|
|
52
|
+
"--color-border-<status>",
|
|
53
|
+
"Status borders on the page or a card, such as an invalid field. Defaults to the text colour.",
|
|
54
|
+
"—"
|
|
55
|
+
],
|
|
56
|
+
[
|
|
57
|
+
"--color-<status>",
|
|
58
|
+
"Strong status fill, such as a Badge or StatusDot.",
|
|
59
|
+
"--color-on-<status>"
|
|
60
|
+
],
|
|
61
|
+
[
|
|
62
|
+
"--color-on-<status>",
|
|
63
|
+
"Text and icons on the strong fill (4.5:1 or more).",
|
|
64
|
+
"--color-<status>"
|
|
65
|
+
],
|
|
66
|
+
[
|
|
67
|
+
"--color-<status>-muted",
|
|
68
|
+
"Pale status fill, such as a Banner.",
|
|
69
|
+
"--color-on-<status>-muted"
|
|
70
|
+
],
|
|
71
|
+
[
|
|
72
|
+
"--color-on-<status>-muted",
|
|
73
|
+
"Text and icons on the pale fill (4.5:1 or more).",
|
|
74
|
+
"--color-<status>-muted"
|
|
75
|
+
]
|
|
76
|
+
]
|
|
77
|
+
},
|
|
29
78
|
{
|
|
30
79
|
"type": "table",
|
|
31
80
|
"headers": [
|
|
@@ -154,6 +203,21 @@ export const docs = {
|
|
|
154
203
|
"#AA071E",
|
|
155
204
|
"#E3193B"
|
|
156
205
|
],
|
|
206
|
+
[
|
|
207
|
+
"--color-info",
|
|
208
|
+
"#0064E0",
|
|
209
|
+
"#0064E0"
|
|
210
|
+
],
|
|
211
|
+
[
|
|
212
|
+
"--color-info-muted",
|
|
213
|
+
"#0082FB33",
|
|
214
|
+
"#0082FB3F"
|
|
215
|
+
],
|
|
216
|
+
[
|
|
217
|
+
"--color-on-info",
|
|
218
|
+
"#FFFFFF",
|
|
219
|
+
"#FFFFFF"
|
|
220
|
+
],
|
|
157
221
|
[
|
|
158
222
|
"--color-success",
|
|
159
223
|
"#0D8626",
|
|
@@ -182,7 +246,7 @@ export const docs = {
|
|
|
182
246
|
[
|
|
183
247
|
"--color-on-error",
|
|
184
248
|
"#FFFFFF",
|
|
185
|
-
"#
|
|
249
|
+
"#0A1317"
|
|
186
250
|
],
|
|
187
251
|
[
|
|
188
252
|
"--color-warning",
|
|
@@ -199,6 +263,86 @@ export const docs = {
|
|
|
199
263
|
"#0A1317",
|
|
200
264
|
"#0A1317"
|
|
201
265
|
],
|
|
266
|
+
[
|
|
267
|
+
"--color-text-info",
|
|
268
|
+
"var(--color-text-blue)",
|
|
269
|
+
"var(--color-text-blue)"
|
|
270
|
+
],
|
|
271
|
+
[
|
|
272
|
+
"--color-text-success",
|
|
273
|
+
"var(--color-text-green)",
|
|
274
|
+
"var(--color-text-green)"
|
|
275
|
+
],
|
|
276
|
+
[
|
|
277
|
+
"--color-text-warning",
|
|
278
|
+
"var(--color-text-yellow)",
|
|
279
|
+
"var(--color-text-yellow)"
|
|
280
|
+
],
|
|
281
|
+
[
|
|
282
|
+
"--color-text-error",
|
|
283
|
+
"var(--color-text-red)",
|
|
284
|
+
"var(--color-text-red)"
|
|
285
|
+
],
|
|
286
|
+
[
|
|
287
|
+
"--color-icon-info",
|
|
288
|
+
"var(--color-text-info)",
|
|
289
|
+
"var(--color-text-info)"
|
|
290
|
+
],
|
|
291
|
+
[
|
|
292
|
+
"--color-icon-success",
|
|
293
|
+
"var(--color-text-success)",
|
|
294
|
+
"var(--color-text-success)"
|
|
295
|
+
],
|
|
296
|
+
[
|
|
297
|
+
"--color-icon-warning",
|
|
298
|
+
"var(--color-text-warning)",
|
|
299
|
+
"var(--color-text-warning)"
|
|
300
|
+
],
|
|
301
|
+
[
|
|
302
|
+
"--color-icon-error",
|
|
303
|
+
"var(--color-text-error)",
|
|
304
|
+
"var(--color-text-error)"
|
|
305
|
+
],
|
|
306
|
+
[
|
|
307
|
+
"--color-border-info",
|
|
308
|
+
"var(--color-text-info)",
|
|
309
|
+
"var(--color-text-info)"
|
|
310
|
+
],
|
|
311
|
+
[
|
|
312
|
+
"--color-border-success",
|
|
313
|
+
"var(--color-text-success)",
|
|
314
|
+
"var(--color-text-success)"
|
|
315
|
+
],
|
|
316
|
+
[
|
|
317
|
+
"--color-border-warning",
|
|
318
|
+
"var(--color-text-warning)",
|
|
319
|
+
"var(--color-text-warning)"
|
|
320
|
+
],
|
|
321
|
+
[
|
|
322
|
+
"--color-border-error",
|
|
323
|
+
"var(--color-text-error)",
|
|
324
|
+
"var(--color-text-error)"
|
|
325
|
+
],
|
|
326
|
+
[
|
|
327
|
+
"--color-on-info-muted",
|
|
328
|
+
"var(--color-text-blue)",
|
|
329
|
+
"var(--color-text-blue)"
|
|
330
|
+
],
|
|
331
|
+
[
|
|
332
|
+
"--color-on-success-muted",
|
|
333
|
+
"var(--color-text-green)",
|
|
334
|
+
"var(--color-text-green)"
|
|
335
|
+
],
|
|
336
|
+
[
|
|
337
|
+
"--color-on-warning-muted",
|
|
338
|
+
"var(--color-text-yellow)",
|
|
339
|
+
"var(--color-text-yellow)"
|
|
340
|
+
],
|
|
341
|
+
[
|
|
342
|
+
"--color-on-error-muted",
|
|
343
|
+
"var(--color-text-red)",
|
|
344
|
+
"var(--color-text-red)"
|
|
345
|
+
],
|
|
202
346
|
[
|
|
203
347
|
"--color-border",
|
|
204
348
|
"#05365919",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
// AUTO-GENERATED — do not edit manually.
|
|
4
4
|
// Run: node scripts/generate-token-docs.mjs
|
|
5
|
-
// Total:
|
|
5
|
+
// Total: 283 tokens across 15 categories.
|
|
6
6
|
|
|
7
7
|
/** @type {import('@astryxdesign/cli/authoring').NamespaceDoc} */
|
|
8
8
|
export const docs = {
|
package/assets/templates/blocks/components/BottomSheet/BottomSheetSwitcherReviewFlow.doc.mjs
CHANGED
|
@@ -4,16 +4,18 @@
|
|
|
4
4
|
export const doc = {
|
|
5
5
|
type: 'block',
|
|
6
6
|
exampleFor: 'BottomSheetSwitcher',
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
alsoExampleFor: ['BottomSheet'],
|
|
8
|
+
// The published registry identity predates the rewrite; keep it.
|
|
9
|
+
registry: {slug: 'review-flow'},
|
|
10
|
+
name: 'Bottom Sheet — Review flow',
|
|
11
|
+
displayName: 'Bottom Sheet — Review flow',
|
|
9
12
|
description:
|
|
10
|
-
'A two-step form flow
|
|
13
|
+
'A two-step form flow of two standalone sheets driven by one state value: Continue replaces the review step with the confirmation in place, and Back returns.',
|
|
11
14
|
isReady: true,
|
|
12
15
|
isShowcase: false,
|
|
13
16
|
aspectRatio: 3 / 4,
|
|
14
17
|
componentsUsed: [
|
|
15
18
|
'BottomSheet',
|
|
16
|
-
'BottomSheetSwitcher',
|
|
17
19
|
'Button',
|
|
18
20
|
'Heading',
|
|
19
21
|
'Section',
|
|
@@ -3,73 +3,79 @@
|
|
|
3
3
|
'use client';
|
|
4
4
|
|
|
5
5
|
import {useState} from 'react';
|
|
6
|
-
import {BottomSheet
|
|
6
|
+
import {BottomSheet} from '@astryxdesign/core/BottomSheet';
|
|
7
7
|
import {Button} from '@astryxdesign/core/Button';
|
|
8
8
|
import {Heading} from '@astryxdesign/core/Heading';
|
|
9
9
|
import {Section} from '@astryxdesign/core/Section';
|
|
10
10
|
import {HStack, VStack} from '@astryxdesign/core/Stack';
|
|
11
11
|
import {Text} from '@astryxdesign/core/Text';
|
|
12
12
|
|
|
13
|
+
type Step = 'review' | 'confirm' | null;
|
|
14
|
+
|
|
13
15
|
export default function BottomSheetSwitcherReviewFlow() {
|
|
14
|
-
|
|
16
|
+
// One state value names the open step; Continue and Back close one sheet
|
|
17
|
+
// and open the other in the same update, which replaces it in place.
|
|
18
|
+
const [step, setStep] = useState<Step>(null);
|
|
19
|
+
// Clear the step only if it is still the open one: a step that closes
|
|
20
|
+
// because the person moved on must not undo the move.
|
|
21
|
+
const close = (own: Step) => (isOpen: boolean) => {
|
|
22
|
+
if (!isOpen) {
|
|
23
|
+
setStep(current => (current === own ? null : current));
|
|
24
|
+
}
|
|
25
|
+
};
|
|
15
26
|
|
|
16
27
|
return (
|
|
17
28
|
<>
|
|
18
|
-
<Button
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
<VStack gap={1}>
|
|
33
|
-
<Heading level={3}>Review settings</Heading>
|
|
34
|
-
<Text type="supporting" color="secondary">
|
|
35
|
-
Daily summaries will be sent by email.
|
|
36
|
-
</Text>
|
|
37
|
-
</VStack>
|
|
38
|
-
<HStack gap={2} hAlign="end">
|
|
39
|
-
<Button
|
|
40
|
-
label="Cancel"
|
|
41
|
-
variant="secondary"
|
|
42
|
-
onClick={() => setActiveSheet(null)}
|
|
43
|
-
/>
|
|
44
|
-
<Button
|
|
45
|
-
label="Continue"
|
|
46
|
-
onClick={() => setActiveSheet('confirm')}
|
|
47
|
-
/>
|
|
48
|
-
</HStack>
|
|
29
|
+
<Button label="Review settings" onClick={() => setStep('review')} />
|
|
30
|
+
<BottomSheet
|
|
31
|
+
isOpen={step === 'review'}
|
|
32
|
+
onOpenChange={close('review')}
|
|
33
|
+
label="Review notification settings"
|
|
34
|
+
height="hug"
|
|
35
|
+
purpose="form">
|
|
36
|
+
<Section padding={4}>
|
|
37
|
+
<VStack gap={4}>
|
|
38
|
+
<VStack gap={1}>
|
|
39
|
+
<Heading level={3}>Review settings</Heading>
|
|
40
|
+
<Text type="supporting" color="secondary">
|
|
41
|
+
Daily summaries will be sent by email.
|
|
42
|
+
</Text>
|
|
49
43
|
</VStack>
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
44
|
+
<HStack gap={2} hAlign="end">
|
|
45
|
+
<Button
|
|
46
|
+
label="Cancel"
|
|
47
|
+
variant="secondary"
|
|
48
|
+
onClick={() => setStep(null)}
|
|
49
|
+
/>
|
|
50
|
+
<Button label="Continue" onClick={() => setStep('confirm')} />
|
|
51
|
+
</HStack>
|
|
52
|
+
</VStack>
|
|
53
|
+
</Section>
|
|
54
|
+
</BottomSheet>
|
|
55
|
+
<BottomSheet
|
|
56
|
+
isOpen={step === 'confirm'}
|
|
57
|
+
onOpenChange={close('confirm')}
|
|
58
|
+
label="Confirm settings"
|
|
59
|
+
height="hug">
|
|
60
|
+
<Section padding={4}>
|
|
61
|
+
<VStack gap={4}>
|
|
62
|
+
<VStack gap={1}>
|
|
63
|
+
<Heading level={3}>Confirm settings</Heading>
|
|
64
|
+
<Text type="supporting" color="secondary">
|
|
65
|
+
Your notification settings are ready to save.
|
|
66
|
+
</Text>
|
|
69
67
|
</VStack>
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
68
|
+
<HStack gap={2} hAlign="end">
|
|
69
|
+
<Button
|
|
70
|
+
label="Back"
|
|
71
|
+
variant="secondary"
|
|
72
|
+
onClick={() => setStep('review')}
|
|
73
|
+
/>
|
|
74
|
+
<Button label="Save" onClick={() => setStep(null)} />
|
|
75
|
+
</HStack>
|
|
76
|
+
</VStack>
|
|
77
|
+
</Section>
|
|
78
|
+
</BottomSheet>
|
|
73
79
|
</>
|
|
74
80
|
);
|
|
75
81
|
}
|
|
@@ -4,16 +4,18 @@
|
|
|
4
4
|
export const doc = {
|
|
5
5
|
type: 'block',
|
|
6
6
|
exampleFor: 'BottomSheetSwitcher',
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
alsoExampleFor: ['BottomSheet'],
|
|
8
|
+
// The published registry identity predates the rewrite; keep it.
|
|
9
|
+
registry: {slug: 'default'},
|
|
10
|
+
name: 'Bottom Sheet — Multi-step flow',
|
|
11
|
+
displayName: 'Bottom Sheet — Multi-step flow',
|
|
9
12
|
description:
|
|
10
|
-
'A three-step flow
|
|
13
|
+
'A three-step flow of standalone sheets of different heights, driven by one state value: moving on replaces the open step in place. This is the replacement for the deprecated BottomSheetSwitcher.',
|
|
11
14
|
isReady: true,
|
|
12
15
|
isShowcase: true,
|
|
13
16
|
aspectRatio: 3 / 4,
|
|
14
17
|
componentsUsed: [
|
|
15
18
|
'BottomSheet',
|
|
16
|
-
'BottomSheetSwitcher',
|
|
17
19
|
'Button',
|
|
18
20
|
'CheckboxInput',
|
|
19
21
|
'Divider',
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
'use client';
|
|
4
4
|
|
|
5
5
|
import {useState} from 'react';
|
|
6
|
-
import {BottomSheet
|
|
6
|
+
import {BottomSheet} from '@astryxdesign/core/BottomSheet';
|
|
7
7
|
import {Button} from '@astryxdesign/core/Button';
|
|
8
8
|
import {CheckboxInput} from '@astryxdesign/core/CheckboxInput';
|
|
9
9
|
import {Divider} from '@astryxdesign/core/Divider';
|
|
@@ -15,20 +15,35 @@ import {RadioList, RadioListItem} from '@astryxdesign/core/RadioList';
|
|
|
15
15
|
|
|
16
16
|
type NotificationSheetHeight = 'hug' | 'capped';
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Each step is a standalone sheet. Closing the open step and opening the
|
|
20
|
+
* next one in the same update (one `step` state value) replaces it in place.
|
|
21
|
+
*/
|
|
22
|
+
interface StepSheetProps {
|
|
23
|
+
isOpen: boolean;
|
|
24
|
+
onOpenChange: (isOpen: boolean) => void;
|
|
25
|
+
hasScrim: boolean;
|
|
19
26
|
height: NotificationSheetHeight;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
interface NotificationOverviewSheetProps extends StepSheetProps {
|
|
20
30
|
onCancel: () => void;
|
|
21
31
|
onContinue: () => void;
|
|
22
32
|
}
|
|
23
33
|
|
|
24
34
|
function NotificationOverviewSheet({
|
|
35
|
+
isOpen,
|
|
36
|
+
onOpenChange,
|
|
37
|
+
hasScrim,
|
|
25
38
|
height,
|
|
26
39
|
onCancel,
|
|
27
40
|
onContinue,
|
|
28
41
|
}: NotificationOverviewSheetProps) {
|
|
29
42
|
return (
|
|
30
43
|
<BottomSheet
|
|
31
|
-
|
|
44
|
+
isOpen={isOpen}
|
|
45
|
+
onOpenChange={onOpenChange}
|
|
46
|
+
hasScrim={hasScrim}
|
|
32
47
|
label="Set up notifications"
|
|
33
48
|
height={height}>
|
|
34
49
|
<Section padding={4}>
|
|
@@ -74,13 +89,15 @@ function NotificationOverviewSheet({
|
|
|
74
89
|
);
|
|
75
90
|
}
|
|
76
91
|
|
|
77
|
-
interface NotificationFrequencySheetProps {
|
|
78
|
-
height: NotificationSheetHeight;
|
|
92
|
+
interface NotificationFrequencySheetProps extends StepSheetProps {
|
|
79
93
|
onBack: () => void;
|
|
80
94
|
onContinue: () => void;
|
|
81
95
|
}
|
|
82
96
|
|
|
83
97
|
function NotificationFrequencySheet({
|
|
98
|
+
isOpen,
|
|
99
|
+
onOpenChange,
|
|
100
|
+
hasScrim,
|
|
84
101
|
height,
|
|
85
102
|
onBack,
|
|
86
103
|
onContinue,
|
|
@@ -89,7 +106,9 @@ function NotificationFrequencySheet({
|
|
|
89
106
|
|
|
90
107
|
return (
|
|
91
108
|
<BottomSheet
|
|
92
|
-
|
|
109
|
+
isOpen={isOpen}
|
|
110
|
+
onOpenChange={onOpenChange}
|
|
111
|
+
hasScrim={hasScrim}
|
|
93
112
|
label="Notification frequency"
|
|
94
113
|
height={height}>
|
|
95
114
|
<Section padding={4}>
|
|
@@ -120,13 +139,15 @@ function NotificationFrequencySheet({
|
|
|
120
139
|
);
|
|
121
140
|
}
|
|
122
141
|
|
|
123
|
-
interface NotificationChannelsSheetProps {
|
|
124
|
-
height: NotificationSheetHeight;
|
|
142
|
+
interface NotificationChannelsSheetProps extends StepSheetProps {
|
|
125
143
|
onBack: () => void;
|
|
126
144
|
onFinish: () => void;
|
|
127
145
|
}
|
|
128
146
|
|
|
129
147
|
function NotificationChannelsSheet({
|
|
148
|
+
isOpen,
|
|
149
|
+
onOpenChange,
|
|
150
|
+
hasScrim,
|
|
130
151
|
height,
|
|
131
152
|
onBack,
|
|
132
153
|
onFinish,
|
|
@@ -137,7 +158,9 @@ function NotificationChannelsSheet({
|
|
|
137
158
|
|
|
138
159
|
return (
|
|
139
160
|
<BottomSheet
|
|
140
|
-
|
|
161
|
+
isOpen={isOpen}
|
|
162
|
+
onOpenChange={onOpenChange}
|
|
163
|
+
hasScrim={hasScrim}
|
|
141
164
|
label="Notification channels"
|
|
142
165
|
height={height}>
|
|
143
166
|
<Section padding={4}>
|
|
@@ -175,47 +198,55 @@ function NotificationChannelsSheet({
|
|
|
175
198
|
);
|
|
176
199
|
}
|
|
177
200
|
|
|
178
|
-
|
|
201
|
+
type Step = 'overview' | 'frequency' | 'channels' | null;
|
|
202
|
+
|
|
203
|
+
interface MultiStepExampleProps {
|
|
179
204
|
height: NotificationSheetHeight;
|
|
180
205
|
hasScrim?: boolean;
|
|
181
206
|
}
|
|
182
207
|
|
|
183
|
-
function
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
const
|
|
208
|
+
function MultiStepExample({height, hasScrim = true}: MultiStepExampleProps) {
|
|
209
|
+
// One state value names the open step. Moving on closes one sheet and
|
|
210
|
+
// opens the next in the same update, which replaces it in place.
|
|
211
|
+
const [step, setStep] = useState<Step>(null);
|
|
212
|
+
const stepProps = (id: Step) => ({
|
|
213
|
+
isOpen: step === id,
|
|
214
|
+
onOpenChange: (isOpen: boolean) => {
|
|
215
|
+
// Clear the step only if it is still the open one: a step that closes
|
|
216
|
+
// because the person moved on must not undo the move.
|
|
217
|
+
if (!isOpen) {
|
|
218
|
+
setStep(current => (current === id ? null : current));
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
hasScrim,
|
|
222
|
+
height,
|
|
223
|
+
});
|
|
188
224
|
|
|
189
225
|
return (
|
|
190
226
|
<>
|
|
191
227
|
<Button
|
|
192
228
|
label="Set up notifications"
|
|
193
|
-
onClick={() =>
|
|
229
|
+
onClick={() => setStep('overview')}
|
|
230
|
+
/>
|
|
231
|
+
<NotificationOverviewSheet
|
|
232
|
+
{...stepProps('overview')}
|
|
233
|
+
onCancel={() => setStep(null)}
|
|
234
|
+
onContinue={() => setStep('frequency')}
|
|
235
|
+
/>
|
|
236
|
+
<NotificationFrequencySheet
|
|
237
|
+
{...stepProps('frequency')}
|
|
238
|
+
onBack={() => setStep('overview')}
|
|
239
|
+
onContinue={() => setStep('channels')}
|
|
240
|
+
/>
|
|
241
|
+
<NotificationChannelsSheet
|
|
242
|
+
{...stepProps('channels')}
|
|
243
|
+
onBack={() => setStep('frequency')}
|
|
244
|
+
onFinish={() => setStep(null)}
|
|
194
245
|
/>
|
|
195
|
-
<BottomSheetSwitcher
|
|
196
|
-
activeSheet={activeSheet}
|
|
197
|
-
onActiveSheetChange={setActiveSheet}
|
|
198
|
-
hasScrim={hasScrim}>
|
|
199
|
-
<NotificationOverviewSheet
|
|
200
|
-
height={height}
|
|
201
|
-
onCancel={() => setActiveSheet(null)}
|
|
202
|
-
onContinue={() => setActiveSheet('frequency')}
|
|
203
|
-
/>
|
|
204
|
-
<NotificationFrequencySheet
|
|
205
|
-
height={height}
|
|
206
|
-
onBack={() => setActiveSheet('overview')}
|
|
207
|
-
onContinue={() => setActiveSheet('channels')}
|
|
208
|
-
/>
|
|
209
|
-
<NotificationChannelsSheet
|
|
210
|
-
height={height}
|
|
211
|
-
onBack={() => setActiveSheet('frequency')}
|
|
212
|
-
onFinish={() => setActiveSheet(null)}
|
|
213
|
-
/>
|
|
214
|
-
</BottomSheetSwitcher>
|
|
215
246
|
</>
|
|
216
247
|
);
|
|
217
248
|
}
|
|
218
249
|
|
|
219
250
|
export default function BottomSheetSwitcherShowcase() {
|
|
220
|
-
return <
|
|
251
|
+
return <MultiStepExample height="hug" />;
|
|
221
252
|
}
|
|
@@ -7,7 +7,7 @@ export const doc = {
|
|
|
7
7
|
name: 'Code — Snippet',
|
|
8
8
|
displayName: 'Code — Snippet',
|
|
9
9
|
description:
|
|
10
|
-
'Short terminal commands with
|
|
10
|
+
'Short terminal commands with no header: the copy button sits in its own column beside the code, so a one-line command reads as a single row and a long line ends before the button instead of running under it. Use for install instructions or one-liner commands that readers will paste directly.',
|
|
11
11
|
isReady: true,
|
|
12
12
|
aspectRatio: 16 / 9,
|
|
13
13
|
componentsUsed: ['CodeBlock', 'Stack'],
|
|
@@ -11,13 +11,21 @@ export default function CodeBlockBashCommand() {
|
|
|
11
11
|
<CodeBlock
|
|
12
12
|
code="npm install @astryxdesign/core"
|
|
13
13
|
language="bash"
|
|
14
|
-
|
|
14
|
+
hasLanguageLabel={false}
|
|
15
15
|
style={{width: '100%'}}
|
|
16
16
|
/>
|
|
17
17
|
<CodeBlock
|
|
18
18
|
code="yarn add @astryxdesign/theme-neutral"
|
|
19
19
|
language="bash"
|
|
20
|
-
|
|
20
|
+
hasLanguageLabel={false}
|
|
21
|
+
style={{width: '100%'}}
|
|
22
|
+
/>
|
|
23
|
+
<CodeBlock
|
|
24
|
+
code={
|
|
25
|
+
'astryx upgrade --from 0.6.0 --apply --path apps/web/src --install-deps\nnpm run build'
|
|
26
|
+
}
|
|
27
|
+
language="bash"
|
|
28
|
+
hasLanguageLabel={false}
|
|
21
29
|
style={{width: '100%'}}
|
|
22
30
|
/>
|
|
23
31
|
</VStack>
|
|
@@ -6,7 +6,7 @@ export const doc = {
|
|
|
6
6
|
exampleFor: 'Thumbnail',
|
|
7
7
|
name: 'Thumbnail — Disabled',
|
|
8
8
|
displayName: 'Thumbnail — Disabled',
|
|
9
|
-
description: 'Thumbnails in the disabled state with reduced opacity. The remove
|
|
9
|
+
description: 'Thumbnails in the disabled state with reduced opacity. The open and remove buttons stay focusable and announced as disabled, and call nothing.',
|
|
10
10
|
isReady: true,
|
|
11
11
|
aspectRatio: 16 / 9,
|
|
12
12
|
componentsUsed: ['Thumbnail', 'Layout', 'Text'],
|
|
@@ -6,16 +6,23 @@ import {useState} from 'react';
|
|
|
6
6
|
import {Tokenizer} from '@astryxdesign/core/Tokenizer';
|
|
7
7
|
import type {SearchableItem, SearchSource} from '@astryxdesign/core/Typeahead';
|
|
8
8
|
|
|
9
|
+
const tags: SearchableItem[] = [
|
|
10
|
+
{id: '1', label: 'Design'},
|
|
11
|
+
{id: '2', label: 'Engineering'},
|
|
12
|
+
{id: '3', label: 'Marketing'},
|
|
13
|
+
{id: '4', label: 'Product'},
|
|
14
|
+
{id: '5', label: 'Research'},
|
|
15
|
+
{id: '6', label: 'Sales'},
|
|
16
|
+
];
|
|
17
|
+
|
|
9
18
|
const source: SearchSource = {
|
|
10
|
-
search: () =>
|
|
11
|
-
|
|
19
|
+
search: (query: string) =>
|
|
20
|
+
tags.filter(tag => tag.label.toLowerCase().includes(query.toLowerCase())),
|
|
21
|
+
bootstrap: () => tags,
|
|
12
22
|
};
|
|
13
23
|
|
|
14
24
|
export default function TokenizerShowcase() {
|
|
15
|
-
const [value, setValue] = useState<SearchableItem[]>([
|
|
16
|
-
{id: '1', label: 'Design'},
|
|
17
|
-
{id: '2', label: 'Engineering'},
|
|
18
|
-
]);
|
|
25
|
+
const [value, setValue] = useState<SearchableItem[]>([tags[0], tags[1]]);
|
|
19
26
|
return (
|
|
20
27
|
<div style={{display: 'grid', gridTemplateColumns: 'minmax(0, 400px)'}}>
|
|
21
28
|
<Tokenizer
|
|
@@ -94,9 +94,9 @@ interface WindowSeries {
|
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
const STATUS_STROKE: Record<HealthStatus, string> = {
|
|
97
|
-
healthy: 'var(--color-success
|
|
98
|
-
warning: 'var(--color-warning
|
|
99
|
-
critical: 'var(--color-error
|
|
97
|
+
healthy: 'var(--color-text-success)',
|
|
98
|
+
warning: 'var(--color-text-warning)',
|
|
99
|
+
critical: 'var(--color-text-error)',
|
|
100
100
|
};
|
|
101
101
|
|
|
102
102
|
const STATUS_DOT: Record<HealthStatus, StatusDotVariant> = {
|
|
@@ -193,8 +193,7 @@ const ITEMS: LibraryItem[] = [
|
|
|
193
193
|
{
|
|
194
194
|
id: '18',
|
|
195
195
|
name: 'MobileNav',
|
|
196
|
-
description:
|
|
197
|
-
'Bottom tab bar for mobile viewports with icon and label slots.',
|
|
196
|
+
description: 'Slide-out navigation drawer for mobile viewports.',
|
|
198
197
|
category: 'Navigation',
|
|
199
198
|
type: 'Pattern',
|
|
200
199
|
imageUrl:
|