@astryxdesign/cli 0.6.5-canary.c8d8a1d → 0.6.5-canary.ca77025

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.
@@ -3,7 +3,10 @@
3
3
  /**
4
4
  * @file FunctionDoc for `themeBuild()` / `astryx theme build`. Colocated with
5
5
  * the API function it documents; the response-shape source of truth stays in
6
- * `theme.type.mjs`.
6
+ * `theme.type.mjs`. Documents imported/inherited icons and atomic rejection
7
+ * of registries that cannot be preserved in build/check modes.
8
+ * @input themeBuild's build/check and icon-import behavior.
9
+ * @output Consumer API documentation for generated theme artifacts.
7
10
  * @position packages/cli/api/theme — function documentation
8
11
  */
9
12
 
@@ -21,6 +24,14 @@ export const doc = {
21
24
  'writes a scoped CSS file, a JS module that re-exports the built theme, and a .d.ts ' +
22
25
  '(plus an optional .variants.d.ts when the theme adds custom prop values). It uses ' +
23
26
  "@astryxdesign/core's own generator, so the CSS matches what the <Theme> runtime emits. " +
27
+ 'When another build step emits the icon registry, ' +
28
+ '{iconsSpecifier} declares the fully specified module path for the generated JS import. ' +
29
+ 'Real registry imports are preserved, including aliases, default imports, and namespace ' +
30
+ 'imports. Icons inherited through extends are retained, with child entries taking precedence. ' +
31
+ 'Comment and string contents do not affect import detection. ' +
32
+ 'An inline registry that cannot be preserved fails with ERR_THEME_INVALID before any ' +
33
+ 'output is written, including in check mode. Move the registry to its own module and ' +
34
+ 'import it into the theme file. ' +
24
35
  'With {check: true} it writes nothing and instead compares ' +
25
36
  'each output against disk, returning the drift: the CI guard for committed, generated theme CSS.',
26
37
  importPath: '@astryxdesign/cli/api',
@@ -60,7 +71,7 @@ export const doc = {
60
71
  name: 'options.iconsSpecifier',
61
72
  type: 'string',
62
73
  description:
63
- 'Override the import specifier of the icon registry in the generated JS module, for example ./icons.mjs. Takes effect only when the theme sets icons: to a named import; when omitted, the source specifier is kept.',
74
+ 'Override the selected icon-registry import specifier in the generated JS module, for example ./icons.mjs. With child and inherited registries, this changes the child registry import. When omitted, direct source specifiers are preserved; relative imports followed through a local base are rebased to the theme file. A registry inherited through a package theme must be imported directly to use this option.',
64
75
  },
65
76
  {
66
77
  name: 'ctx.cwd',
@@ -90,7 +101,7 @@ export const doc = {
90
101
  },
91
102
  {
92
103
  code: 'ERR_THEME_INVALID',
93
- when: 'the resolved theme is invalid, for example it has no name, or a custom Heading type has no standalone rule with a declaration the compiler can emit',
104
+ when: 'the resolved theme is invalid, for example it has no name, a custom Heading type has no standalone rule with a declaration the compiler can emit, or its icon registry cannot be preserved through an import (also rejected in check mode)',
94
105
  },
95
106
  {
96
107
  code: 'ERR_PATH_TRAVERSAL',
@@ -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: 'DropdownMenuGroup',
7
+ name: 'DropdownMenuGroup',
8
+ displayName: 'Dropdown Menu Group',
9
+ description:
10
+ 'A compound-mode menu whose rows are titled in groups. Each DropdownMenuGroup renders a role="group" named by its heading; arrow keys and typeahead skip the heading.',
11
+ isReady: true,
12
+ isShowcase: true,
13
+ aspectRatio: 16 / 9,
14
+ componentsUsed: ['DropdownMenu', 'DropdownMenuGroup', 'DropdownMenuItem'],
15
+ };
@@ -0,0 +1,38 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ 'use client';
4
+
5
+ import {
6
+ DropdownMenu,
7
+ DropdownMenuDivider,
8
+ DropdownMenuGroup,
9
+ DropdownMenuItem,
10
+ } from '@astryxdesign/core/DropdownMenu';
11
+
12
+ export default function DropdownMenuGroupShowcase() {
13
+ return (
14
+ <DropdownMenu button={{label: 'Version'}}>
15
+ <DropdownMenuGroup title="Version history">
16
+ <DropdownMenuItem
17
+ icon="arrowDown"
18
+ label="Restore this version"
19
+ onClick={() => {}}
20
+ />
21
+ <DropdownMenuItem
22
+ icon="copy"
23
+ label="Compare with current"
24
+ onClick={() => {}}
25
+ />
26
+ </DropdownMenuGroup>
27
+ <DropdownMenuDivider />
28
+ <DropdownMenuGroup title="Add to message">
29
+ <DropdownMenuItem
30
+ icon="externalLink"
31
+ label="As a link"
32
+ onClick={() => {}}
33
+ />
34
+ <DropdownMenuItem label="As a snippet" onClick={() => {}} />
35
+ </DropdownMenuGroup>
36
+ </DropdownMenu>
37
+ );
38
+ }
@@ -0,0 +1,20 @@
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: 'DropdownMenuGroup',
7
+ name: 'DropdownMenuGroup — Selectable rows',
8
+ displayName: 'DropdownMenuGroup — Selectable rows',
9
+ description:
10
+ 'Titled groups around a radio group and checkbox rows — the rows the data API cannot express, which is why the heading lives in compound mode.',
11
+ isReady: true,
12
+ aspectRatio: 16 / 9,
13
+ componentsUsed: [
14
+ 'DropdownMenu',
15
+ 'DropdownMenuGroup',
16
+ 'DropdownMenuRadioGroup',
17
+ 'DropdownMenuRadioItem',
18
+ 'DropdownMenuCheckboxItem',
19
+ ],
20
+ };
@@ -0,0 +1,48 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ 'use client';
4
+
5
+ import {useState} from 'react';
6
+ import {
7
+ DropdownMenu,
8
+ DropdownMenuCheckboxItem,
9
+ DropdownMenuDivider,
10
+ DropdownMenuGroup,
11
+ DropdownMenuRadioGroup,
12
+ DropdownMenuRadioItem,
13
+ } from '@astryxdesign/core/DropdownMenu';
14
+
15
+ export default function DropdownMenuGroupWithSelectable() {
16
+ const [model, setModel] = useState('balanced');
17
+ const [notify, setNotify] = useState(true);
18
+ const [retry, setRetry] = useState(false);
19
+
20
+ return (
21
+ <DropdownMenu button={{label: 'Run settings'}}>
22
+ <DropdownMenuGroup title="Model">
23
+ <DropdownMenuRadioGroup
24
+ label="Model"
25
+ value={model}
26
+ onChange={setModel}
27
+ hasCloseOnSelect={false}>
28
+ <DropdownMenuRadioItem value="fast" label="Fast" />
29
+ <DropdownMenuRadioItem value="balanced" label="Balanced" />
30
+ <DropdownMenuRadioItem value="thorough" label="Thorough" />
31
+ </DropdownMenuRadioGroup>
32
+ </DropdownMenuGroup>
33
+ <DropdownMenuDivider />
34
+ <DropdownMenuGroup title="On completion">
35
+ <DropdownMenuCheckboxItem
36
+ label="Notify me"
37
+ value={notify}
38
+ onChange={setNotify}
39
+ />
40
+ <DropdownMenuCheckboxItem
41
+ label="Retry on failure"
42
+ value={retry}
43
+ onChange={setRetry}
44
+ />
45
+ </DropdownMenuGroup>
46
+ </DropdownMenu>
47
+ );
48
+ }
@@ -65,7 +65,7 @@ const RUNNERS = {
65
65
  sites: [
66
66
  '.evalModule() ×2',
67
67
  '.import()',
68
- 'createJiti ×4',
68
+ 'createJiti ×5',
69
69
  'eval ×2',
70
70
  'import(<computed>) ×3',
71
71
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astryxdesign/cli",
3
- "version": "0.6.5-canary.c8d8a1d",
3
+ "version": "0.6.5-canary.ca77025",
4
4
  "displayName": "CLI",
5
5
  "description": "Scaffold projects, browse templates, generate themes, and get agent-ready docs from the command line.",
6
6
  "author": "Meta Open Source",
@@ -101,10 +101,10 @@
101
101
  "zod": "^4.4.3"
102
102
  },
103
103
  "peerDependencies": {
104
- "@astryxdesign/charts": "0.6.5-canary.c8d8a1d",
105
- "@astryxdesign/core": "0.6.5-canary.c8d8a1d",
106
- "@astryxdesign/lab": "0.6.5-canary.c8d8a1d",
107
- "@astryxdesign/theme-neutral": "0.6.5-canary.c8d8a1d"
104
+ "@astryxdesign/charts": "0.6.5-canary.ca77025",
105
+ "@astryxdesign/core": "0.6.5-canary.ca77025",
106
+ "@astryxdesign/lab": "0.6.5-canary.ca77025",
107
+ "@astryxdesign/theme-neutral": "0.6.5-canary.ca77025"
108
108
  },
109
109
  "peerDependenciesMeta": {
110
110
  "@astryxdesign/charts": {
@@ -121,10 +121,10 @@
121
121
  }
122
122
  },
123
123
  "devDependencies": {
124
- "@astryxdesign/charts": "0.6.5-canary.c8d8a1d",
125
- "@astryxdesign/core": "0.6.5-canary.c8d8a1d",
126
- "@astryxdesign/lab": "0.6.5-canary.c8d8a1d",
127
- "@astryxdesign/theme-neutral": "0.6.5-canary.c8d8a1d",
124
+ "@astryxdesign/charts": "0.6.5-canary.ca77025",
125
+ "@astryxdesign/core": "0.6.5-canary.ca77025",
126
+ "@astryxdesign/lab": "0.6.5-canary.ca77025",
127
+ "@astryxdesign/theme-neutral": "0.6.5-canary.ca77025",
128
128
  "@heroicons/react": "^2.2.0",
129
129
  "@stylexjs/stylex": "^0.19.0",
130
130
  "@types/babel__core": "^7.20.5",