@astryxdesign/cli 0.6.0 → 0.6.1

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 (219) hide show
  1. package/CHANGELOG.md +48 -1
  2. package/README.md +76 -67
  3. package/api/build/build.test.mjs +37 -0
  4. package/api/build/build.type.mjs +1 -1
  5. package/api/build/kit/kit.mjs +31 -1
  6. package/api/component/_adapter.mjs +14 -28
  7. package/api/component/integration-import-agreement.test.mjs +318 -0
  8. package/api/doctor/doctor.d.mts +32 -3
  9. package/api/doctor/doctor.doc.mjs +2 -1
  10. package/api/doctor/doctor.mjs +97 -4
  11. package/api/doctor/doctor.test.mjs +90 -1
  12. package/api/gap-report/gap-report-worker.d.mts +4 -0
  13. package/api/gap-report/gap-report-worker.mjs +73 -0
  14. package/api/gap-report/gap-report.d.mts +81 -0
  15. package/api/gap-report/gap-report.doc.d.mts +9 -0
  16. package/api/gap-report/gap-report.doc.mjs +127 -0
  17. package/api/gap-report/gap-report.mjs +707 -0
  18. package/api/gap-report/gap-report.test.mjs +1210 -0
  19. package/api/gap-report/gap-report.type.d.mts +88 -0
  20. package/api/gap-report/gap-report.type.mjs +69 -0
  21. package/api/index.d.mts +8 -1
  22. package/api/index.mjs +24 -1
  23. package/api/integration/add-contribution.d.mts +44 -0
  24. package/api/integration/add-contribution.mjs +1160 -0
  25. package/api/integration/add-contribution.test.mjs +733 -0
  26. package/api/integration/add-helpers.d.mts +80 -0
  27. package/api/integration/add-helpers.mjs +333 -0
  28. package/api/integration/add-helpers.test.mjs +161 -0
  29. package/api/integration/add-theme.d.mts +10 -0
  30. package/api/integration/add-theme.mjs +332 -0
  31. package/api/integration/add-theme.test.mjs +194 -0
  32. package/api/integration/integration-authoring.type.d.mts +55 -0
  33. package/api/integration/integration-authoring.type.mjs +76 -0
  34. package/api/integration/integration-block-exports.test.mjs +4 -0
  35. package/api/integration/integrationAdd.doc.d.mts +5 -0
  36. package/api/integration/integrationAdd.doc.mjs +100 -0
  37. package/api/integration/integrationAddAgentDoc.doc.d.mts +5 -0
  38. package/api/integration/integrationAddAgentDoc.doc.mjs +49 -0
  39. package/api/integration/integrationAddCodemod.doc.d.mts +5 -0
  40. package/api/integration/integrationAddCodemod.doc.mjs +55 -0
  41. package/api/integration/integrationAddComponent.doc.d.mts +5 -0
  42. package/api/integration/integrationAddComponent.doc.mjs +49 -0
  43. package/api/integration/integrationAddDoc.doc.d.mts +5 -0
  44. package/api/integration/integrationAddDoc.doc.mjs +59 -0
  45. package/api/integration/integrationAddTemplate.doc.d.mts +5 -0
  46. package/api/integration/integrationAddTemplate.doc.mjs +55 -0
  47. package/api/integration/integrationAddTheme.doc.d.mts +5 -0
  48. package/api/integration/integrationAddTheme.doc.mjs +85 -0
  49. package/api/integration/integrationPackCheck.doc.d.mts +5 -0
  50. package/api/integration/integrationPackCheck.doc.mjs +35 -0
  51. package/api/integration/pack-check.d.mts +27 -0
  52. package/api/integration/pack-check.mjs +795 -0
  53. package/api/integration/pack-check.test.mjs +569 -0
  54. package/api/integration/pack-check.type.d.mts +45 -0
  55. package/api/integration/pack-check.type.mjs +56 -0
  56. package/api/integration/public-api.test.mjs +21 -0
  57. package/api/integration/validate-integration.mjs +221 -11
  58. package/api/integration/validate-integration.test.mjs +189 -5
  59. package/api/integration/validateIntegration.doc.mjs +2 -2
  60. package/api/json/index.ts +1 -0
  61. package/api/search/search.mjs +19 -1
  62. package/api/theme/_adapter.d.mts +26 -28
  63. package/api/theme/_adapter.mjs +101 -38
  64. package/api/theme/add/add.d.mts +2 -1
  65. package/api/theme/add/add.mjs +56 -20
  66. package/api/theme/add/add.test.mjs +1 -0
  67. package/api/theme/build/build.d.mts +25 -0
  68. package/api/theme/build/build.mjs +101 -70
  69. package/api/theme/build/build.test.mjs +77 -44
  70. package/api/theme/integration-themes.test.mjs +183 -0
  71. package/api/theme/list/list.d.mts +10 -2
  72. package/api/theme/list/list.mjs +31 -10
  73. package/api/theme/list/list.test.mjs +102 -23
  74. package/api/theme/listThemes.doc.d.mts +1 -5
  75. package/api/theme/listThemes.doc.mjs +6 -13
  76. package/api/theme/targets/targets.test.mjs +22 -8
  77. package/api/theme/theme.d.mts +1 -1
  78. package/api/theme/theme.mjs +1 -1
  79. package/api/theme/theme.type.d.mts +9 -0
  80. package/api/theme/theme.type.mjs +3 -1
  81. package/api/theme/themeAdd.doc.d.mts +1 -4
  82. package/api/theme/themeAdd.doc.mjs +31 -31
  83. package/api/theme/themeBuild.doc.mjs +1 -1
  84. package/api/theme/themeList.doc.d.mts +1 -4
  85. package/api/theme/themeList.doc.mjs +7 -15
  86. package/api/theme/themeListAvailable.doc.d.mts +8 -0
  87. package/api/theme/themeListAvailable.doc.mjs +57 -0
  88. package/api/theme/themeTargets.doc.mjs +21 -7
  89. package/api/upgrade/_adapter.d.mts +2 -0
  90. package/api/upgrade/_adapter.mjs +1 -0
  91. package/api/upgrade/registry/registry.d.mts +40 -0
  92. package/api/upgrade/registry/registry.mjs +1154 -0
  93. package/api/upgrade/registry/registry.test.mjs +826 -0
  94. package/api/upgrade/run/run.mjs +49 -8
  95. package/api/upgrade/status/status.d.mts +6 -4
  96. package/api/upgrade/status/status.mjs +26 -8
  97. package/api/upgrade/upgrade.d.mts +2 -2
  98. package/api/upgrade/upgrade.doc.mjs +33 -9
  99. package/api/upgrade/upgrade.mjs +34 -7
  100. package/api/upgrade/upgrade.test.mjs +198 -8
  101. package/api/upgrade/upgrade.type.d.mts +90 -1
  102. package/api/upgrade/upgrade.type.mjs +51 -2
  103. package/assets/docs/cli-integrations.doc.mjs +152 -28
  104. package/assets/docs/getting-started.doc.mjs +1 -1
  105. package/assets/docs/{shadcn-compatibility.doc.mjs → shadcn-compatibility.doc.draft.mjs} +23 -13
  106. package/assets/docs/styling.doc.mjs +3 -3
  107. package/assets/docs/theme.doc.dense.mjs +2 -2
  108. package/assets/docs/theme.doc.mjs +23 -13
  109. package/assets/docs/theme.doc.zh.mjs +1 -1
  110. package/assets/templates/blocks/components/BaseTypeahead/BaseTypeaheadCustomSearch.doc.mjs +2 -1
  111. package/assets/templates/blocks/components/BaseTypeahead/BaseTypeaheadCustomSearch.tsx +38 -12
  112. package/assets/templates/blocks/components/BaseTypeahead/BaseTypeaheadShowcase.doc.mjs +15 -0
  113. package/assets/templates/blocks/components/BaseTypeahead/BaseTypeaheadShowcase.tsx +87 -0
  114. package/assets/templates/blocks/components/BottomSheet/BottomSheetSwitcherReviewFlow.doc.mjs +23 -0
  115. package/assets/templates/blocks/components/BottomSheet/BottomSheetSwitcherReviewFlow.tsx +75 -0
  116. package/assets/templates/blocks/components/BreadcrumbItem/BreadcrumbItemShowcase.tsx +5 -19
  117. package/assets/templates/blocks/components/Center/CenterHorizontal.doc.mjs +3 -2
  118. package/assets/templates/blocks/components/Center/CenterHorizontal.tsx +4 -5
  119. package/assets/templates/blocks/components/Toast/ToastAction.tsx +2 -1
  120. package/assets/templates/blocks/components/Toast/ToastDeduplication.tsx +2 -1
  121. package/assets/templates/blocks/components/Toast/ToastDismiss.tsx +2 -1
  122. package/assets/templates/blocks/components/Toast/ToastShowcase.tsx +2 -1
  123. package/assets/templates/blocks/components/Toast/ToastStacking.tsx +2 -1
  124. package/assets/templates/blocks/components/Toast/ToastTypes.tsx +2 -1
  125. package/assets/templates/pages/dashboard/template.doc.mjs +2 -2
  126. package/assets/templates/pages/dashboard-alert-rail/template.doc.mjs +3 -2
  127. package/assets/templates/pages/dashboard-cohort-funnel/template.doc.mjs +3 -2
  128. package/assets/templates/pages/dashboard-comparison/template.doc.mjs +3 -3
  129. package/assets/templates/pages/dashboard-composition/template.doc.mjs +2 -2
  130. package/assets/templates/pages/dashboard-progress/template.doc.mjs +2 -2
  131. package/assets/templates/pages/dashboard-scorecard/template.doc.mjs +2 -2
  132. package/assets/templates/themes/butter/butterTheme.ts +3 -3
  133. package/assets/templates/themes/neutral/neutralTheme.ts +2 -2
  134. package/assets/templates/themes/stone/stoneTheme.ts +3 -3
  135. package/assets/theme.template.ts +4 -7
  136. package/authoring/config/config.doc.mjs +9 -1
  137. package/authoring/config/parse.d.mts +2 -0
  138. package/authoring/config/parse.mjs +28 -3
  139. package/authoring/config/parse.test.mjs +25 -3
  140. package/authoring/config/type.ts +3 -0
  141. package/authoring/doctypes/_schema.d.mts +3 -0
  142. package/authoring/doctypes/_schema.mjs +6 -1
  143. package/authoring/doctypes/base/type.ts +6 -6
  144. package/authoring/doctypes/component/component.doc.mjs +6 -0
  145. package/authoring/doctypes/component/type.ts +2 -0
  146. package/authoring/gap-report/parse.d.mts +63 -0
  147. package/authoring/gap-report/parse.mjs +121 -0
  148. package/authoring/gap-report/parse.test.mjs +172 -0
  149. package/authoring/gap-report/type.ts +107 -0
  150. package/authoring/index.d.mts +1 -0
  151. package/authoring/index.d.ts +12 -0
  152. package/authoring/index.mjs +4 -0
  153. package/authoring/integration/integration.doc.mjs +14 -2
  154. package/authoring/integration/parse.test.mjs +9 -4
  155. package/authoring/integration/schema.d.mts +2 -0
  156. package/authoring/integration/schema.mjs +1 -0
  157. package/authoring/integration/type.ts +23 -6
  158. package/authoring/shadcn/receipt.d.mts +219 -0
  159. package/authoring/shadcn/receipt.mjs +248 -0
  160. package/authoring/shadcn/receipt.test.mjs +187 -0
  161. package/authoring/shadcn/source-variants.d.mts +28 -0
  162. package/authoring/shadcn/source-variants.mjs +176 -0
  163. package/authoring/shadcn/source-variants.test.mjs +120 -0
  164. package/clients/cli/commands/build-theme.mjs +54 -19
  165. package/clients/cli/commands/build-theme.variants.test.mjs +15 -12
  166. package/clients/cli/commands/component/index.mjs +1 -1
  167. package/clients/cli/commands/docs.test.mjs +1 -0
  168. package/clients/cli/commands/doctor-integration.doc.mjs +1 -1
  169. package/clients/cli/commands/gap-report.doc.mjs +73 -0
  170. package/clients/cli/commands/gap-report.mjs +114 -0
  171. package/clients/cli/commands/gap-report.test.mjs +198 -0
  172. package/clients/cli/commands/import-hint-correctness.test.mjs +88 -0
  173. package/clients/cli/commands/integration-add.doc.mjs +88 -0
  174. package/clients/cli/commands/integration-authoring.test.mjs +177 -0
  175. package/clients/cli/commands/integration-pack.doc.mjs +34 -0
  176. package/clients/cli/commands/integration-real-world.test.mjs +618 -0
  177. package/clients/cli/commands/integration.doc.mjs +28 -0
  178. package/clients/cli/commands/integration.mjs +153 -0
  179. package/clients/cli/commands/theme-add.doc.mjs +11 -6
  180. package/clients/cli/commands/theme-list.doc.mjs +21 -5
  181. package/clients/cli/commands/theme-targets.behavior.test.mjs +19 -2
  182. package/clients/cli/commands/theme.doc.mjs +2 -2
  183. package/clients/cli/commands/upgrade.doc.mjs +17 -4
  184. package/clients/cli/commands/upgrade.mjs +12 -1
  185. package/clients/cli/commands/upgrade.test.mjs +41 -0
  186. package/clients/cli/index.mjs +5 -0
  187. package/clients/cli/lib/component-format.mjs +42 -26
  188. package/clients/cli/lib/component-format.test.mjs +34 -3
  189. package/clients/cli/lib/manifest.mjs +12 -0
  190. package/foundation/config/project-themes.test.mjs +127 -0
  191. package/foundation/config/project.d.mts +23 -4
  192. package/foundation/config/project.mjs +96 -9
  193. package/foundation/config/project.test.mjs +132 -6
  194. package/foundation/discovery/component-discovery.d.mts +36 -0
  195. package/foundation/discovery/component-discovery.mjs +96 -0
  196. package/foundation/discovery/theme-discovery.d.mts +39 -0
  197. package/foundation/discovery/theme-discovery.mjs +650 -0
  198. package/foundation/discovery/theme-discovery.test.mjs +375 -0
  199. package/foundation/discovery/theming-targets.d.mts +16 -0
  200. package/foundation/discovery/theming-targets.mjs +39 -3
  201. package/foundation/discovery/theming-targets.test.mjs +139 -0
  202. package/foundation/integrations/autolink.d.mts +96 -0
  203. package/foundation/integrations/autolink.mjs +265 -0
  204. package/foundation/integrations/autolink.test.mjs +430 -0
  205. package/foundation/integrations/contribution-inventory.d.mts +152 -0
  206. package/foundation/integrations/contribution-inventory.mjs +497 -0
  207. package/foundation/integrations/contribution-inventory.test.mjs +361 -0
  208. package/foundation/integrations/integrations.d.mts +73 -9
  209. package/foundation/integrations/integrations.mjs +158 -8
  210. package/foundation/integrations/integrations.test.mjs +152 -29
  211. package/foundation/integrations/manifest-writer.d.mts +56 -0
  212. package/foundation/integrations/manifest-writer.mjs +328 -0
  213. package/foundation/integrations/manifest-writer.test.mjs +229 -0
  214. package/foundation/integrations/validate-contributions.mjs +81 -6
  215. package/foundation/response/error-codes.d.mts +4 -1
  216. package/foundation/response/error-codes.doc.mjs +16 -1
  217. package/foundation/response/error-codes.mjs +10 -1
  218. package/foundation/response/response-types.doc.mjs +23 -2
  219. package/package.json +8 -1
@@ -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: 'BaseTypeahead',
7
+ name: 'BaseTypeahead',
8
+ displayName: 'Base Typeahead',
9
+ description:
10
+ 'A custom result renderer that adds supporting metadata while BaseTypeahead retains option semantics and keyboard behavior.',
11
+ registry: {slug: 'custom-search-bar'},
12
+ isReady: true,
13
+ aspectRatio: 16 / 9,
14
+ componentsUsed: ['BaseTypeahead', 'Layout', 'Text'],
15
+ };
@@ -0,0 +1,87 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ 'use client';
4
+
5
+ import {useRef, useState} from 'react';
6
+ import * as stylex from '@stylexjs/stylex';
7
+ import {BaseTypeahead, createStaticSource} from '@astryxdesign/core/Typeahead';
8
+ import type {SearchableItem} from '@astryxdesign/core/Typeahead';
9
+ import {VStack} from '@astryxdesign/core/Layout';
10
+ import {Text} from '@astryxdesign/core/Text';
11
+ import {
12
+ borderVars,
13
+ colorVars,
14
+ focusVars,
15
+ radiusVars,
16
+ spacingVars,
17
+ } from '@astryxdesign/core/theme/tokens.stylex';
18
+
19
+ const frameworks: SearchableItem[] = [
20
+ {id: 'react', label: 'React', auxiliaryData: {category: 'UI library'}},
21
+ {id: 'remix', label: 'Remix', auxiliaryData: {category: 'Web framework'}},
22
+ {id: 'next', label: 'Next.js', auxiliaryData: {category: 'Web framework'}},
23
+ ];
24
+
25
+ const source = createStaticSource(frameworks);
26
+
27
+ const styles = stylex.create({
28
+ root: {
29
+ width: '100%',
30
+ maxWidth: 360,
31
+ },
32
+ field: {
33
+ backgroundColor: colorVars['--color-background-surface'],
34
+ borderColor: colorVars['--color-border'],
35
+ borderRadius: radiusVars['--radius-element'],
36
+ borderStyle: 'solid',
37
+ borderWidth: borderVars['--border-width'],
38
+ paddingBlock: spacingVars['--spacing-1-5'],
39
+ paddingInline: spacingVars['--spacing-2'],
40
+ outlineColor: {
41
+ default: 'transparent',
42
+ ':has(input:focus-visible)': focusVars['--focus-outline-color'],
43
+ },
44
+ outlineOffset: focusVars['--focus-outline-offset'],
45
+ outlineStyle: 'solid',
46
+ outlineWidth: {
47
+ default: '0',
48
+ ':has(input:focus-visible)': focusVars['--focus-outline-width'],
49
+ },
50
+ },
51
+ result: {
52
+ minWidth: 0,
53
+ },
54
+ });
55
+
56
+ export default function BaseTypeaheadCustomResults() {
57
+ const [value, setValue] = useState<SearchableItem | null>(null);
58
+ const wrapperRef = useRef<HTMLDivElement>(null);
59
+
60
+ return (
61
+ <VStack gap={3} xstyle={styles.root}>
62
+ <div ref={wrapperRef} {...stylex.props(styles.field)}>
63
+ <BaseTypeahead
64
+ aria-label="Search frameworks"
65
+ searchSource={source}
66
+ value={value}
67
+ onChange={setValue}
68
+ anchorRef={wrapperRef}
69
+ placeholder="Search frameworks…"
70
+ hasEntriesOnFocus
71
+ debounceMs={0}
72
+ renderItem={item => (
73
+ <VStack gap={0} xstyle={styles.result}>
74
+ <Text type="label">{item.label}</Text>
75
+ <Text type="supporting" color="secondary">
76
+ {
77
+ (item.auxiliaryData as {category?: string} | undefined)
78
+ ?.category
79
+ }
80
+ </Text>
81
+ </VStack>
82
+ )}
83
+ />
84
+ </div>
85
+ </VStack>
86
+ );
87
+ }
@@ -0,0 +1,23 @@
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: 'BottomSheetSwitcher',
7
+ name: 'Bottom Sheet Switcher — Review flow',
8
+ displayName: 'Bottom Sheet Switcher — Review flow',
9
+ description:
10
+ 'A two-step form flow that lets a person review settings, confirm them, or move back without replacing the shared dialog.',
11
+ isReady: true,
12
+ isShowcase: false,
13
+ aspectRatio: 3 / 4,
14
+ componentsUsed: [
15
+ 'BottomSheet',
16
+ 'BottomSheetSwitcher',
17
+ 'Button',
18
+ 'Heading',
19
+ 'Section',
20
+ 'Stack',
21
+ 'Text',
22
+ ],
23
+ };
@@ -0,0 +1,75 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ 'use client';
4
+
5
+ import {useState} from 'react';
6
+ import {BottomSheet, BottomSheetSwitcher} from '@astryxdesign/core/BottomSheet';
7
+ import {Button} from '@astryxdesign/core/Button';
8
+ import {Heading} from '@astryxdesign/core/Heading';
9
+ import {Section} from '@astryxdesign/core/Section';
10
+ import {HStack, VStack} from '@astryxdesign/core/Stack';
11
+ import {Text} from '@astryxdesign/core/Text';
12
+
13
+ export default function BottomSheetSwitcherReviewFlow() {
14
+ const [activeSheet, setActiveSheet] = useState<string | null>(null);
15
+
16
+ return (
17
+ <>
18
+ <Button
19
+ label="Review settings"
20
+ onClick={() => setActiveSheet('review')}
21
+ />
22
+ <BottomSheetSwitcher
23
+ activeSheet={activeSheet}
24
+ onActiveSheetChange={setActiveSheet}>
25
+ <BottomSheet
26
+ sheetId="review"
27
+ label="Review notification settings"
28
+ height="hug"
29
+ purpose="form">
30
+ <Section padding={4}>
31
+ <VStack gap={4}>
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>
49
+ </VStack>
50
+ </Section>
51
+ </BottomSheet>
52
+ <BottomSheet sheetId="confirm" label="Confirm settings" height="hug">
53
+ <Section padding={4}>
54
+ <VStack gap={4}>
55
+ <VStack gap={1}>
56
+ <Heading level={3}>Confirm settings</Heading>
57
+ <Text type="supporting" color="secondary">
58
+ Your notification settings are ready to save.
59
+ </Text>
60
+ </VStack>
61
+ <HStack gap={2} hAlign="end">
62
+ <Button
63
+ label="Back"
64
+ variant="secondary"
65
+ onClick={() => setActiveSheet('review')}
66
+ />
67
+ <Button label="Save" onClick={() => setActiveSheet(null)} />
68
+ </HStack>
69
+ </VStack>
70
+ </Section>
71
+ </BottomSheet>
72
+ </BottomSheetSwitcher>
73
+ </>
74
+ );
75
+ }
@@ -2,27 +2,11 @@
2
2
 
3
3
  'use client';
4
4
 
5
- import type {ComponentProps} from 'react';
6
5
  import {Breadcrumbs, BreadcrumbItem} from '@astryxdesign/core/Breadcrumbs';
6
+ import {Icon} from '@astryxdesign/core/Icon';
7
7
  import {VStack} from '@astryxdesign/core/Layout';
8
8
  import {Text} from '@astryxdesign/core/Text';
9
-
10
- function HomeIcon(props: ComponentProps<'svg'>) {
11
- return (
12
- <svg
13
- fill="none"
14
- viewBox="0 0 24 24"
15
- strokeWidth={2}
16
- stroke="currentColor"
17
- {...props}>
18
- <path
19
- strokeLinecap="round"
20
- strokeLinejoin="round"
21
- d="M3 9.5L12 3l9 6.5V20a1 1 0 01-1 1H4a1 1 0 01-1-1V9.5z"
22
- />
23
- </svg>
24
- );
25
- }
9
+ import {HomeIcon} from '@heroicons/react/24/outline';
26
10
 
27
11
  export default function BreadcrumbItemShowcase() {
28
12
  return (
@@ -32,7 +16,9 @@ export default function BreadcrumbItemShowcase() {
32
16
  With start icon
33
17
  </Text>
34
18
  <Breadcrumbs>
35
- <BreadcrumbItem href="/" startIcon={<HomeIcon />}>
19
+ <BreadcrumbItem
20
+ href="/"
21
+ startIcon={<Icon icon={HomeIcon} size="sm" />}>
36
22
  Home
37
23
  </BreadcrumbItem>
38
24
  <BreadcrumbItem href="/docs">Docs</BreadcrumbItem>
@@ -6,8 +6,9 @@ export const doc = {
6
6
  exampleFor: 'Center',
7
7
  name: 'Center — Horizontal Center',
8
8
  displayName: 'Center — Horizontal Center',
9
- description: 'An editor toolbar with a document title on the left and formatting actions on the right. This shows axis="horizontal", centering in one direction only. Use when content needs to be horizontally centered while other elements are positioned independently around it.',
9
+ description:
10
+ 'A formatting control group centered with axis="horizontal" in the default horizontal writing mode. In other writing modes, Center currently follows the flex main axis rather than guaranteeing physical horizontal centering.',
10
11
  isReady: true,
11
12
  aspectRatio: 16 / 9,
12
- componentsUsed: ['Center', 'Card', 'Icon', 'IconButton', 'Layout', 'Text'],
13
+ componentsUsed: ['Center', 'Card', 'Icon', 'IconButton', 'Layout'],
13
14
  };
@@ -2,9 +2,9 @@
2
2
 
3
3
  'use client';
4
4
 
5
+ import {Center} from '@astryxdesign/core/Center';
5
6
  import {Card} from '@astryxdesign/core/Card';
6
7
  import {Stack} from '@astryxdesign/core/Layout';
7
- import {Heading} from '@astryxdesign/core/Text';
8
8
  import {Icon} from '@astryxdesign/core/Icon';
9
9
  import {IconButton} from '@astryxdesign/core/IconButton';
10
10
  import {
@@ -19,9 +19,8 @@ import {
19
19
  export default function CenterHorizontal() {
20
20
  return (
21
21
  <Card width={520} padding={2}>
22
- <Stack direction="horizontal" vAlign="center">
23
- <Heading level={2}>Untitled Document</Heading>
24
- <Stack direction="horizontal" gap={0} hAlign="end" style={{flex: 1}}>
22
+ <Center axis="horizontal" width="100%">
23
+ <Stack direction="horizontal" gap={0} vAlign="center">
25
24
  <IconButton
26
25
  label="Bold"
27
26
  icon={<Icon icon={BoldIcon} />}
@@ -59,7 +58,7 @@ export default function CenterHorizontal() {
59
58
  size="sm"
60
59
  />
61
60
  </Stack>
62
- </Stack>
61
+ </Center>
63
62
  </Card>
64
63
  );
65
64
  }
@@ -1,8 +1,9 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
- // In production, use useToast() hook for proper positioning, stacking, and lifecycle.
4
3
  'use client';
5
4
 
5
+ // In production, use useToast() hook for proper positioning, stacking, and lifecycle.
6
+
6
7
  import {Toast} from '@astryxdesign/core/Toast';
7
8
  import {useToast} from '@astryxdesign/core/Toast';
8
9
  import {Button} from '@astryxdesign/core/Button';
@@ -1,8 +1,9 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
- // In production, use useToast() hook for proper positioning, stacking, and lifecycle.
4
3
  'use client';
5
4
 
5
+ // In production, use useToast() hook for proper positioning, stacking, and lifecycle.
6
+
6
7
  import {Toast} from '@astryxdesign/core/Toast';
7
8
  import {useToast} from '@astryxdesign/core/Toast';
8
9
  import {Button} from '@astryxdesign/core/Button';
@@ -1,8 +1,9 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
- // In production, use useToast() hook for proper positioning, stacking, and lifecycle.
4
3
  'use client';
5
4
 
5
+ // In production, use useToast() hook for proper positioning, stacking, and lifecycle.
6
+
6
7
  import {useRef} from 'react';
7
8
  import {Toast} from '@astryxdesign/core/Toast';
8
9
  import {useToast} from '@astryxdesign/core/Toast';
@@ -1,8 +1,9 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
- // In production, use useToast() hook for proper positioning, stacking, and lifecycle.
4
3
  'use client';
5
4
 
5
+ // In production, use useToast() hook for proper positioning, stacking, and lifecycle.
6
+
6
7
  import {Toast} from '@astryxdesign/core/Toast';
7
8
  import {useToast} from '@astryxdesign/core/Toast';
8
9
  import {Button} from '@astryxdesign/core/Button';
@@ -1,8 +1,9 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
- // In production, use useToast() hook for proper positioning, stacking, and lifecycle.
4
3
  'use client';
5
4
 
5
+ // In production, use useToast() hook for proper positioning, stacking, and lifecycle.
6
+
6
7
  import {useRef} from 'react';
7
8
  import {Toast} from '@astryxdesign/core/Toast';
8
9
  import {useToast} from '@astryxdesign/core/Toast';
@@ -1,8 +1,9 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
- // In production, use useToast() hook for proper positioning, stacking, and lifecycle.
4
3
  'use client';
5
4
 
5
+ // In production, use useToast() hook for proper positioning, stacking, and lifecycle.
6
+
6
7
  import {Toast} from '@astryxdesign/core/Toast';
7
8
  import {useToast} from '@astryxdesign/core/Toast';
8
9
  import {Button} from '@astryxdesign/core/Button';
@@ -5,8 +5,8 @@ export const doc = {
5
5
  type: 'page',
6
6
  name: 'Analytics Dashboard',
7
7
  displayName: 'Analytics Dashboard',
8
- description: 'Three-band analytics: a row of headline tiles, then charts, then supporting tables, all re-reading from one global filter bar. Breadth over depth, a summary surface rather than a drill-down. Dashboard, overview, metrics, stats, analytics, reporting, or insights.',
8
+ description:
9
+ 'Three-band analytics: a row of headline tiles, then charts, then supporting tables, all re-reading from one global filter bar. Breadth over depth, a summary surface rather than a drill-down. Dashboard, overview, metrics, stats, analytics, reporting, or insights.',
9
10
  isReady: true,
10
11
  category: 'Dashboard - Analytics',
11
- isHiddenFromOverview: true,
12
12
  };
@@ -5,7 +5,8 @@ export const doc = {
5
5
  type: 'page',
6
6
  name: 'Service Monitoring Dashboard',
7
7
  displayName: 'Service Monitoring Dashboard',
8
- description: 'Always-on analytics with a triage rail: status-colored tiles with sparklines, multi-series time charts over a switchable window, and an independently scrolling alert column that folds into the content when narrow. Monitoring, uptime, health, latency, alerting, incidents, or observability.',
9
- isReady: false,
8
+ description:
9
+ 'Always-on analytics with a triage rail: status-colored tiles with sparklines, multi-series time charts over a switchable window, and an independently scrolling alert column that folds into the content when narrow. Monitoring, uptime, health, latency, alerting, incidents, or observability.',
10
+ isReady: true,
10
11
  category: 'Dashboard - Monitoring',
11
12
  };
@@ -5,7 +5,8 @@ export const doc = {
5
5
  type: 'page',
6
6
  name: 'Funnel & Cohort Dashboard',
7
7
  displayName: 'Funnel & Cohort Dashboard',
8
- description: 'Analytics for sequence and retention questions, pairing two shapes a plain dashboard cannot hold: a staged funnel where each step reads as drop-off against the one before, and a two-axis cohort matrix rendered as a heatmap. Conversion, drop-off, activation, churn, or retention reporting.',
9
- isReady: false,
8
+ description:
9
+ 'Analytics for sequence and retention questions, pairing two shapes a plain dashboard cannot hold: a staged funnel where each step reads as drop-off against the one before, and a two-axis cohort matrix rendered as a heatmap. Conversion, drop-off, activation, churn, or retention reporting.',
10
+ isReady: true,
10
11
  category: 'Dashboard - Funnel & Cohort',
11
12
  };
@@ -5,8 +5,8 @@ export const doc = {
5
5
  type: 'page',
6
6
  name: 'Data Dashboard',
7
7
  displayName: 'Data Dashboard',
8
- description: 'Comparison-heavy analytics behind a persistent filter bar: tiles that each carry an inline sparkline and several period-over-period deltas, then segmented breakdowns underneath. Every number is shown against another number. Dashboard, metrics, stats, analytics, trends, or reporting.',
9
- isReady: false,
8
+ description:
9
+ 'Comparison-heavy analytics behind a persistent filter bar: tiles that each carry an inline sparkline and several period-over-period deltas, then segmented breakdowns underneath. Every number is shown against another number. Dashboard, metrics, stats, analytics, trends, or reporting.',
10
+ isReady: true,
10
11
  category: 'Dashboard - Comparison',
11
- isHiddenFromOverview: true,
12
12
  };
@@ -5,8 +5,8 @@ export const doc = {
5
5
  type: 'page',
6
6
  name: 'Portfolio Dashboard',
7
7
  displayName: 'Portfolio Dashboard',
8
- description: 'Analytics for a value-over-time question: balance and change tiles above a stacked area chart of composition through time, closing on a ranked table of the largest contributors. Portfolio, holdings, positions, returns, allocation, investments, or performance reporting.',
8
+ description:
9
+ 'Analytics for a value-over-time question: balance and change tiles above a stacked area chart of composition through time, closing on a ranked table of the largest contributors. Portfolio, holdings, positions, returns, allocation, investments, or performance reporting.',
9
10
  isReady: true,
10
11
  category: 'Dashboard - Portfolio',
11
- isHiddenFromOverview: true,
12
12
  };
@@ -5,8 +5,8 @@ export const doc = {
5
5
  type: 'page',
6
6
  name: 'Project Status Dashboard',
7
7
  displayName: 'Project Status Dashboard',
8
- description: 'Status analytics mixing progress and time-axis shapes: a completion donut, a horizontal timeline of dated bars against a today marker, a per-owner table with progress and status, an at-risk list, and a burndown. Project, program, milestone, roadmap, launch, or delivery status.',
8
+ description:
9
+ 'Status analytics mixing progress and time-axis shapes: a completion donut, a horizontal timeline of dated bars against a today marker, a per-owner table with progress and status, an at-risk list, and a burndown. Project, program, milestone, roadmap, launch, or delivery status.',
9
10
  isReady: true,
10
11
  category: 'Dashboard - Project Status',
11
- isHiddenFromOverview: true,
12
12
  };
@@ -5,8 +5,8 @@ export const doc = {
5
5
  type: 'page',
6
6
  name: 'Executive Summary Dashboard',
7
7
  displayName: 'Executive Summary Dashboard',
8
- description: 'Report-shaped analytics with a prose rail beside the charts: a scorecard of headline numbers with period deltas and status coloring, goal-attainment bars, a trend grid, and a written commentary column that folds beneath the content when narrow. Executive summary, business review, readout, or reporting.',
8
+ description:
9
+ 'Report-shaped analytics with a prose rail beside the charts: a scorecard of headline numbers with period deltas and status coloring, goal-attainment bars, a trend grid, and a written commentary column that folds beneath the content when narrow. Executive summary, business review, readout, or reporting.',
9
10
  isReady: true,
10
11
  category: 'Dashboard - Scorecard',
11
- isHiddenFromOverview: true,
12
12
  };
@@ -424,12 +424,12 @@ export const butterTheme = defineTheme({
424
424
 
425
425
  // Progress bar — white track in light, warm brown in dark. Vivid
426
426
  // semantic fills match the banner colors (Success / Warning / Error).
427
- 'progressbar-track': {
427
+ 'progress-bar-track': {
428
428
  base: {
429
429
  backgroundColor: 'light-dark(#e5e3d4, #725538)',
430
430
  },
431
431
  },
432
- 'progressbar-fill': {
432
+ 'progress-bar-fill': {
433
433
  'variant:success': {
434
434
  backgroundColor: '#91D143',
435
435
  },
@@ -473,7 +473,7 @@ export const butterTheme = defineTheme({
473
473
  'status:warning': {'--color-warning': '#ffc502'},
474
474
  'status:error': {'--color-error': '#fc473b'},
475
475
  },
476
- textarea: {
476
+ 'text-area': {
477
477
  base: {
478
478
  paddingBlock: 'var(--spacing-2)',
479
479
  paddingInline: 'var(--spacing-3)',
@@ -348,7 +348,7 @@ export const neutralTheme = defineTheme({
348
348
  },
349
349
  },
350
350
 
351
- statusdot: {
351
+ 'status-dot': {
352
352
  'variant:success': {backgroundColor: statusFill.success},
353
353
  'variant:warning': {backgroundColor: statusFill.warning},
354
354
  'variant:error': {backgroundColor: statusFill.error},
@@ -427,7 +427,7 @@ export const neutralTheme = defineTheme({
427
427
  },
428
428
  },
429
429
 
430
- progressbar: {
430
+ 'progress-bar': {
431
431
  base: {
432
432
  '--color-background-muted': 'var(--color-border-emphasized)',
433
433
  },
@@ -324,7 +324,7 @@ export const stoneTheme = defineTheme({
324
324
  // the same color family as the matching status surface). Dark = T70.
325
325
  // Hexes from the preview Tonal Palettes ramp. accent (default) +
326
326
  // indeterminate both route to blue for the in-progress / loading look.
327
- 'progressbar-fill': {
327
+ 'progress-bar-fill': {
328
328
  'variant:accent': {
329
329
  backgroundColor: 'light-dark(#d7e4f5, #a0acbc)', // Blue T90 / T70
330
330
  },
@@ -341,7 +341,7 @@ export const stoneTheme = defineTheme({
341
341
 
342
342
  // Track default --color-background-muted reads near-body in stone;
343
343
  // redirect to --color-skeleton so the channel stays visible.
344
- 'progressbar-track': {
344
+ 'progress-bar-track': {
345
345
  base: {
346
346
  backgroundColor: 'var(--color-skeleton)',
347
347
  },
@@ -373,7 +373,7 @@ export const stoneTheme = defineTheme({
373
373
  // Input status borders + icons across all 9 input components share the
374
374
  // same softer T60/T70 redirection. See INPUT_STATUS_VARS above.
375
375
  'text-input': INPUT_STATUS_VARS,
376
- textarea: INPUT_STATUS_VARS,
376
+ 'text-area': INPUT_STATUS_VARS,
377
377
  'number-input': INPUT_STATUS_VARS,
378
378
  'date-input': INPUT_STATUS_VARS,
379
379
  'time-input': INPUT_STATUS_VARS,
@@ -222,12 +222,9 @@ export const myTheme = defineTheme({
222
222
  '--shadow-low': '0 1px 2px light-dark(#0000001A, #00000066)',
223
223
  },
224
224
 
225
- /**
226
- * Optional theme-family-local roles. Use the complete exact name and keep
227
- * references inside this maintained theme family. These do not become
228
- * portable Astryx tokens.
229
- */
230
- // localTokens: {'--astryx-theme-my-theme-color-status-fill-accent': ['#0077B6', '#48CAE4']},
225
+ /** Optional theme-family-local roles accept any valid CSS custom-property name;
226
+ * prefixes do not establish ownership. */
227
+ // localTokens: {},
231
228
 
232
229
  // ───────────────────────────────────────────────────────────────────────
233
230
  // components — per-component CSS, emitted inside
@@ -235,7 +232,7 @@ export const myTheme = defineTheme({
235
232
  //
236
233
  // Keys are the component's stable class minus the `astryx-` prefix
237
234
  // (`astryx-button` → `button`, `astryx-side-nav-item` → `side-nav-item`),
238
- // including inner parts like `progressbar-fill`.
235
+ // including inner parts like `progress-bar-fill`.
239
236
  //
240
237
  // `astryx component <Name>` IS THE REFERENCE HERE. It prints that
241
238
  // component's theming targets, the visual props and states you can key on,
@@ -15,7 +15,7 @@ export const doc = {
15
15
  description:
16
16
  'The optional astryx.config.* file at your project root. Declares which ' +
17
17
  'integrations to load, where to route issue links, post-codemod hooks, local ' +
18
- 'debug-log settings, and experimental layout components. All fields are ' +
18
+ 'debug-log and gap-report handlers, and experimental layout components. All ' +
19
19
  'optional; {} is valid.',
20
20
  appliesTo: 'astryx.config.{ts,mjs,js}',
21
21
  fields: [
@@ -52,6 +52,14 @@ export const doc = {
52
52
  example:
53
53
  "event => appendFileSync('runs.ndjson', JSON.stringify(event) + '\\n')",
54
54
  },
55
+ {
56
+ name: 'gapReport',
57
+ type: 'GapReportHandler',
58
+ description:
59
+ 'Handle explicit gap reports in addition to every loaded integration handler. The project handler runs first. Public handlers require caller consent; internal handlers always run.',
60
+ example:
61
+ "{ audience: 'internal', async handle(report, {signal}) { return sendGap(report, {signal}); } }",
62
+ },
55
63
  {
56
64
  name: 'experimental',
57
65
  type: '{ xle?: { components?: Record<string, XleComponent> } }',
@@ -29,6 +29,7 @@ export type PostCodemodHook = import("./type").PostCodemodHook;
29
29
  export type XleComponent = import("./type").XleComponent;
30
30
  export type DebugConfig = import("./type").DebugConfig;
31
31
  export type DebugEventHandler = import("../debug/type").DebugEventHandler;
32
+ export type GapReportHandler = import("../gap-report/type").GapReportHandler;
32
33
  import { z } from 'zod';
33
34
  declare const configSchema: z.ZodObject<{
34
35
  integrations: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -46,6 +47,7 @@ declare const configSchema: z.ZodObject<{
46
47
  }, z.core.$strict>>>;
47
48
  }, z.core.$strict>>;
48
49
  debug: z.ZodOptional<z.ZodType<import("../debug/type").DebugEventHandler, any, z.core.$ZodTypeInternals<import("../debug/type").DebugEventHandler, any>>>;
50
+ gapReport: z.ZodOptional<z.ZodType<import("../gap-report/type").GapReportHandler, any, z.core.$ZodTypeInternals<import("../gap-report/type").GapReportHandler, any>>>;
49
51
  experimental: z.ZodOptional<z.ZodObject<{
50
52
  xle: z.ZodOptional<z.ZodObject<{
51
53
  components: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
@@ -11,16 +11,20 @@
11
11
 
12
12
  import {z} from 'zod';
13
13
  import {formatZodError} from '../_shared/errors.mjs';
14
+ import {parseGapReportHandler} from '../gap-report/parse.mjs';
14
15
 
15
16
  /** @typedef {import('./type').AstryxConfig} AstryxConfig */
16
17
  /** @typedef {import('./type').PostCodemodHook} PostCodemodHook */
17
18
  /** @typedef {import('./type').XleComponent} XleComponent */
18
19
  /** @typedef {import('./type').DebugConfig} DebugConfig */
19
20
  /** @typedef {import('../debug/type').DebugEventHandler} DebugEventHandler */
21
+ /** @typedef {import('../gap-report/type').GapReportHandler} GapReportHandler */
20
22
 
21
23
  // Typed `z.custom` so `z.infer` reproduces the real function type (not `unknown`).
22
24
  const buildCommand = /** @type {z.ZodType<PostCodemodHook['buildCommand']>} */ (
23
- z.custom(value => typeof value === 'function', {message: 'Expected a function'})
25
+ z.custom(value => typeof value === 'function', {
26
+ message: 'Expected a function',
27
+ })
24
28
  );
25
29
 
26
30
  const postCodemodHookSchema = z
@@ -41,7 +45,25 @@ const xleComponentSchema = z
41
45
  // Typed `z.custom` so `z.infer` reproduces the real handler type (not
42
46
  // `unknown`), the same way the post-codemod hook above keeps its signature.
43
47
  const debugSchema = /** @type {z.ZodType<DebugEventHandler>} */ (
44
- z.custom(value => typeof value === 'function', {message: 'Expected a function'})
48
+ z.custom(value => typeof value === 'function', {
49
+ message: 'Expected a function',
50
+ })
51
+ );
52
+
53
+ // Reuse the shared load-boundary parser so project and integration handlers
54
+ // accept exactly one shape. Typed z.custom preserves the public function type.
55
+ const gapReportHandlerSchema = /** @type {z.ZodType<GapReportHandler>} */ (
56
+ z.custom(
57
+ value => {
58
+ try {
59
+ parseGapReportHandler(value);
60
+ return true;
61
+ } catch {
62
+ return false;
63
+ }
64
+ },
65
+ {message: 'Expected a GapReportHandler {audience, handle}'},
66
+ )
45
67
  );
46
68
 
47
69
  const configSchema = z
@@ -53,10 +75,13 @@ const configSchema = z
53
75
  .strict()
54
76
  .optional(),
55
77
  debug: debugSchema.optional(),
78
+ gapReport: gapReportHandlerSchema.optional(),
56
79
  experimental: z
57
80
  .object({
58
81
  xle: z
59
- .object({components: z.record(z.string(), xleComponentSchema).optional()})
82
+ .object({
83
+ components: z.record(z.string(), xleComponentSchema).optional(),
84
+ })
60
85
  .strict()
61
86
  .optional(),
62
87
  })