@astryxdesign/cli 0.7.1-canary.ff40b78 → 0.7.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,40 @@
1
1
  # @xds/cli
2
2
 
3
+ # 0.7.1
4
+
5
+ #### Fixes
6
+
7
+ - `CommandPaletteInput` now exposes the semantics and name that its visible state promises. (#7321)
8
+ - A standalone field with no popup attributes was `role="combobox"` with `aria-expanded="true"` and `aria-autocomplete="list"`; it is now `role="searchbox"` with no popup state. Pass `role="combobox"`, or your popup's own ARIA attributes, to keep the old semantics. A field that already passes popup attributes (`aria-expanded`, `aria-controls`, `aria-owns`, `aria-haspopup`, and the like) stays a `combobox` and keeps them, and a field inside `CommandPalette` is unchanged.
9
+
10
+ - The field's default accessible name was its placeholder (`Search…`, or the caller's `placeholder`); it is now `Search commands`, translated. Pass `label` to keep a specific name, for example `label="Search…"` for the old default. A caller whose custom `placeholder` served as the name keeps working code and hears the generic name until it passes `label`.
11
+
12
+ - The CLI's async-search CommandPalette block names its field `Search files`.
13
+
14
+ - `endContent={true}` no longer renders an empty trailing slot, and `endContent={0}` renders inside the trailing slot instead of after it.
15
+ - Stone, Y2K, and Gothic set `CodeBlock`'s diff row slots in their own syntax palettes, so a reader of a diff on those themes gets added and removed rows whose code, line numbers, and `+`/`-` glyphs stay readable: every syntax token keeps at least 4.5:1 on the tinted rows in Stone (light and dark) and Y2K (light and dark), and in Gothic the rows take a deep green and a deep red at the background's own luminance, so every token keeps the contrast it has on the plain background. Line numbers and glyphs on changed rows use each theme's own green and red. The CLI's bundled copies of the three themes (`astryx theme eject`) carry the same palettes. (#7428)
16
+ - A `secondary` Selector, MultiSelector, or ComplexSelector now matches the theme's secondary Button: under butter, chocolate, gothic, stone, and y2k it takes that Button's border, fill, text color, and hover instead of the default borderless neutral fill, so a toolbar mixing secondary buttons and selectors reads as one set of controls. Disabled and read-only triggers keep a still fill on hover, as a disabled Button does, and a Selector or MultiSelector inside an InputGroup keeps the group's neutral fill and edges. The default theme is unchanged, the selector docs now say `secondary` follows the theme's secondary Button, and themes added with the CLI get the same parity. (#7548)
17
+ - `astryx theme build --watch` stops as soon as it is interrupted (Ctrl-C or SIGTERM). A change saved while a rebuild was running no longer starts another rebuild after "Stopped watching.", and a rebuild in progress stops with the watcher instead of keeping the process alive. (#7508)
18
+
19
+ #### Performance
20
+
21
+ - `astryx search` and `astryx build`, and the `search` and `build` API functions, read each source directory once per call instead of once per candidate. Results are unchanged. A warm `search` drops from about 1.9 s to 0.4 s on macOS. (#7421)
22
+
23
+ #### Documentation
24
+
25
+ - The generated token docs list the five diff row slots of the syntax vocabulary — `--color-syntax-added`, `--color-syntax-removed`, `--color-syntax-diff-header`, `--color-syntax-added-marker`, `--color-syntax-removed-marker` — with their defaults, so `astryx docs tokens` describes nineteen syntax slots. (#7389)
26
+ - The Tailwind and migration setup docs now say that `globals.css` (or a `layers.css` holding only the `@layer` line) must be the first import in the root layout or app entry, before the `astryx-themes` module or any component that imports theme CSS; otherwise Tailwind preflight overrides Astryx base styles and theme overrides lose. The Tailwind v3 coexistence snippet moves its `@layer` line into a `layers.css` imported first, because Next.js (webpack or Turbopack) hoists CSS imports above an inline `@layer` line. (#7534)
27
+ - Grid's `columns` docs now lead with the shape that reflows: a numeric `columns` is exactly N columns at every width and never reflows, and `columns={{minWidth, max}}` is the form for columns that must survive a phone. The `astryx docs layout/responsive` topic gains a "Columns that reflow" section with a reflowing stat row beside a fixed week row. No behavior changes. (#7340)
28
+ - The styling setup docs now load the prebuilt stylesheets on every path. The "StyleX from source" path becomes "StyleX for your own code": it keeps `astryx.css` and points the StyleX compiler at your own and swizzled source only. A new "Other Astryx packages" section lists each package's stylesheet (`richtext.css`, `lab.css`, `charts.css`) and where to import it. Getting started no longer lists the two example setups that compile Astryx source; the remaining examples all load `astryx.css`. (#7587)
29
+
30
+ #### Contributors
31
+
32
+ Thanks to everyone who contributed to this release:
33
+
34
+ - @cixzhang
35
+
36
+ ---
37
+
3
38
  # 0.7.0
4
39
 
5
40
  #### Breaking Changes
@@ -66,6 +66,7 @@ export function isWeightsFile(file: any): file is import("./kit/weights.mjs").We
66
66
  * @returns {string[]} Setup notes (empty when the template needs nothing).
67
67
  */
68
68
  export function templateSetupNotes(template: PageTemplate, cwd: string): string[];
69
+ export { withListingCache } from "../../foundation/fs/listing-cache.mjs";
69
70
  /**
70
71
  * A page template the kit can recommend starting from.
71
72
  */
@@ -23,6 +23,13 @@ import {componentKeywords} from '../search/search.mjs';
23
23
  import {findCoreDir} from '../../foundation/fs/paths.mjs';
24
24
  import {analyzeTemplateNeeds} from '../../foundation/discovery/template-needs.mjs';
25
25
 
26
+ /**
27
+ * Runs one build with a single directory listing per path: the kit resolves
28
+ * every candidate's source and docs by walking the same tree, which does not
29
+ * change during the call.
30
+ */
31
+ export {withListingCache} from '../../foundation/fs/listing-cache.mjs';
32
+
26
33
  /**
27
34
  * A page template the kit can recommend starting from.
28
35
  * @typedef {object} PageTemplate
@@ -17,6 +17,7 @@ import {AstryxError} from '../error.mjs';
17
17
  import {ERROR_CODES} from '../../foundation/response/error-codes.mjs';
18
18
  import {buildHelp} from './help/help.mjs';
19
19
  import {buildKit} from './kit/kit.mjs';
20
+ import {withListingCache} from './_adapter.mjs';
20
21
 
21
22
  // Barrel: surface the leaves alongside the dispatcher for the fractal shape.
22
23
  export {buildHelp, buildKit};
@@ -40,5 +41,7 @@ export async function build(query, options = {}) {
40
41
  ERROR_CODES.ERR_INVALID_ARGUMENT,
41
42
  );
42
43
  }
43
- return buildKit(query, options);
44
+ // The kit resolves every candidate's source and docs by walking the same
45
+ // tree; read each directory once for this call.
46
+ return withListingCache(() => buildKit(query, options));
44
47
  }
@@ -79,6 +79,7 @@
79
79
  * queries they have nothing to do with.
80
80
  */
81
81
 
82
+ import {withListingCache} from '../../foundation/fs/listing-cache.mjs';
82
83
  import {readDocView} from '../../foundation/doc-compiler/read.mjs';
83
84
  import {findCoreDir} from '../../foundation/fs/paths.mjs';
84
85
  import {
@@ -1769,6 +1770,17 @@ function toResult(c, score, reason, matchedTerms, queryTerms) {
1769
1770
  * @returns {Promise<import('./search.type.mjs').SearchResponse>}
1770
1771
  */
1771
1772
  export async function search(query, options = {}) {
1773
+ // Every candidate resolves its source and docs by walking the same tree;
1774
+ // read each directory once for this call.
1775
+ return withListingCache(() => searchOnce(query, options));
1776
+ }
1777
+
1778
+ /**
1779
+ * @param {string} query
1780
+ * @param {NonNullable<Parameters<typeof search>[1]>} options
1781
+ * @returns {ReturnType<typeof search>}
1782
+ */
1783
+ async function searchOnce(query, options) {
1772
1784
  const {cwd = process.cwd(), type, limit = 20} = options;
1773
1785
 
1774
1786
  if (!query || !String(query).trim()) {
@@ -185,16 +185,6 @@ const overrides = stylex.create({
185
185
  'Next.js + Tailwind bridge',
186
186
  '[apps/example-nextjs-tailwind](https://github.com/facebook/astryx/tree/main/apps/example-nextjs-tailwind)',
187
187
  ],
188
- [
189
- 'Next.js Source',
190
- 'Next.js importing from source',
191
- '[apps/example-nextjs-source](https://github.com/facebook/astryx/tree/main/apps/example-nextjs-source)',
192
- ],
193
- [
194
- 'Vite',
195
- 'Vite',
196
- '[apps/example-vite](https://github.com/facebook/astryx/tree/main/apps/example-vite)',
197
- ],
198
188
  [
199
189
  'Vite + Tailwind',
200
190
  'Vite + Tailwind bridge',
@@ -4,7 +4,8 @@
4
4
  * @file `astryx docs styling-overview`
5
5
  *
6
6
  * One question: "How do I set up CSS?"
7
- * Three paths, each with its exact imports.
7
+ * Three paths, each with its exact imports. Every path loads the prebuilt
8
+ * stylesheets (spec:AST-080 FR5); none compiles Astryx package source.
8
9
  */
9
10
 
10
11
  /** @type {import('@astryxdesign/cli/authoring').ReferenceDoc} */
@@ -14,7 +15,7 @@ export const docs = {
14
15
  title: 'Styling overview',
15
16
  category: 'guide',
16
17
  description:
17
- 'How to set up CSS — exact imports for three paths: plain, Tailwind, and StyleX from source.',
18
+ 'How to set up CSS — exact imports for three paths: plain, Tailwind, and StyleX for your own code — plus the stylesheet each Astryx package ships.',
18
19
  keywords: [
19
20
  'styling',
20
21
  'CSS',
@@ -46,15 +47,15 @@ export const docs = {
46
47
  "None beyond Tailwind's own.",
47
48
  ],
48
49
  [
49
- 'StyleX from source',
50
- 'Swizzled (ejected) components. Raw StyleX source needs a compiler plugin.',
51
- 'Yes \u2014 a StyleX bundler plugin.',
50
+ 'StyleX for your own code',
51
+ 'Your own `stylex.create()` styles and swizzled (ejected) components. Astryx itself stays prebuilt.',
52
+ 'Yes \u2014 a StyleX plugin for your own code.',
52
53
  ],
53
54
  ],
54
55
  },
55
56
  {
56
57
  type: 'prose',
57
- text: 'All three resolve to the same design tokens and support theming and dark mode. You can mix them in one app.',
58
+ text: 'All three load the same prebuilt Astryx stylesheets, resolve to the same design tokens, and support theming and dark mode. None of them compiles Astryx package source. You can mix them in one app.',
58
59
  },
59
60
  ],
60
61
  },
@@ -117,12 +118,12 @@ export const docs = {
117
118
  ],
118
119
  },
119
120
  {
120
- id: 'stylex-from-source',
121
- title: 'StyleX from source',
121
+ id: 'stylex-own-code',
122
+ title: 'StyleX for your own code',
122
123
  content: [
123
124
  {
124
125
  type: 'prose',
125
- text: 'Only needed when you swizzle a component (`astryx swizzle <Component>`) or write your own StyleX. The plain path already supports `xstyle` overrides \u2014 this path is for editing component internals. Some built-in page templates also use StyleX for layout; if you scaffold one and see "Unexpected stylex.create call at runtime", add the compiler plugin for your bundler below.',
126
+ text: 'Only needed when you write your own StyleX (`stylex.create()`) or swizzle a component (`astryx swizzle <Component>`), which copies its StyleX source into your app. The plain path already supports `xstyle` overrides \u2014 this path is for your own StyleX code. Some built-in page templates also use StyleX for layout; if you scaffold one and see "Unexpected stylex.create call at runtime", add the compiler plugin for your bundler below.',
126
127
  },
127
128
  {
128
129
  type: 'code',
@@ -134,14 +135,13 @@ export const docs = {
134
135
  type: 'code',
135
136
  lang: 'css',
136
137
  label: 'globals.css',
137
- code: `@layer reset, astryx-base, astryx-theme;
138
-
139
- @import "@astryxdesign/core/reset.css";
138
+ code: `@import "@astryxdesign/core/reset.css";
139
+ @import "@astryxdesign/core/astryx.css";
140
140
  @import "@astryxdesign/theme-neutral/theme.css";`,
141
141
  },
142
142
  {
143
143
  type: 'prose',
144
- text: 'No `astryx.css` \u2014 the StyleX compiler produces component styles from source. Add the plugin for your bundler:',
144
+ text: 'Keep `astryx.css`: Astryx component styles always come from the prebuilt stylesheets. Point the StyleX compiler at your own source only, never at `node_modules/@astryxdesign`. Add the plugin for your bundler:',
145
145
  },
146
146
  {
147
147
  type: 'table',
@@ -149,7 +149,10 @@ export const docs = {
149
149
  rows: [
150
150
  ['Webpack', '@stylexjs/webpack-plugin'],
151
151
  ['Vite / Rollup', '@stylexjs/rollup-plugin'],
152
- ['Babel (any)', '@stylexjs/babel-plugin + @stylexjs/postcss-plugin'],
152
+ [
153
+ 'Babel (any)',
154
+ '@stylexjs/babel-plugin + @stylexjs/postcss-plugin',
155
+ ],
153
156
  ['Next.js (keep next/font)', '@stylexswc/nextjs-plugin'],
154
157
  ],
155
158
  },
@@ -159,6 +162,37 @@ export const docs = {
159
162
  },
160
163
  ],
161
164
  },
165
+ {
166
+ id: 'other-packages',
167
+ title: 'Other Astryx packages',
168
+ content: [
169
+ {
170
+ type: 'prose',
171
+ text: 'Every Astryx package whose components carry styles ships its own prebuilt stylesheet. Import it after `astryx.css` for each package you use. All of them place their rules in the same `astryx-base` layer, so your theme overrides win over every package.',
172
+ },
173
+ {
174
+ type: 'code',
175
+ lang: 'css',
176
+ label: 'globals.css',
177
+ code: `@import "@astryxdesign/core/reset.css";
178
+ @import "@astryxdesign/core/astryx.css";
179
+ @import "@astryxdesign/richtext/richtext.css"; /* Rich Text */
180
+ @import "@astryxdesign/lab/lab.css"; /* Lab */
181
+ @import "@astryxdesign/charts/charts.css"; /* Charts */
182
+ @import "@astryxdesign/theme-neutral/theme.css";`,
183
+ },
184
+ {
185
+ type: 'table',
186
+ headers: ['Package', 'Stylesheet'],
187
+ rows: [
188
+ ['@astryxdesign/core', '@astryxdesign/core/astryx.css'],
189
+ ['@astryxdesign/richtext', '@astryxdesign/richtext/richtext.css'],
190
+ ['@astryxdesign/lab', '@astryxdesign/lab/lab.css'],
191
+ ['@astryxdesign/charts', '@astryxdesign/charts/charts.css'],
192
+ ],
193
+ },
194
+ ],
195
+ },
162
196
  {
163
197
  id: 'what-each-file-does',
164
198
  title: 'What each import does',
@@ -175,7 +209,12 @@ export const docs = {
175
209
  [
176
210
  'astryx.css',
177
211
  'astryx-base',
178
- 'Pre-compiled component styles. Required for plain and Tailwind. Omit when compiling from source.',
212
+ 'Prebuilt component styles. Required on every path.',
213
+ ],
214
+ [
215
+ 'richtext.css, lab.css, charts.css',
216
+ 'astryx-base',
217
+ 'Prebuilt styles for each other Astryx package you use. Load after astryx.css.',
179
218
  ],
180
219
  [
181
220
  'theme.css',
@@ -129,15 +129,31 @@ export function AppRoot({children}: {children: React.ReactNode}) {
129
129
  },
130
130
  {
131
131
  type: 'prose',
132
- text: 'On Tailwind v3 there is no preflight.css to import, so wrap the @tailwind base directive in a named layer instead. Keep utilities unlayered so existing app utility classes still win everywhere.',
132
+ text: 'A layer\'s rank is set by the first stylesheet on the page that names it, so the global CSS file (or a `layers.css` holding only the `@layer` line) must be the first import in the root layout or app entry. Import it before any module that imports Astryx or theme CSS, including the `astryx-themes` module generated by `astryx theme add` and a root component like the `AppRoot` above that imports `theme.css`. If a theme stylesheet loads first, Tailwind preflight overrides Astryx base styles and theme overrides lose.',
133
133
  },
134
134
  {
135
135
  type: 'code',
136
- lang: 'css',
137
- label: 'Tailwind v3 coexistence',
138
- code: `@layer reset, tw-preflight, astryx-base, astryx-theme;
136
+ lang: 'tsx',
137
+ label: 'Root layout or app entry',
138
+ code: `import './globals.css'; // first: declares the cascade-layer order
139
139
 
140
- @import "@astryxdesign/core/reset.css";
140
+ import {AppRoot} from './AppRoot';`,
141
+ },
142
+ {
143
+ type: 'prose',
144
+ text: 'On Tailwind v3 there is no preflight.css to import, so wrap the @tailwind base directive in a named layer instead. Keep utilities unlayered so existing app utility classes still win everywhere. Put the `@layer` order line in its own `layers.css` and import it first, before `globals.css`: Next.js (webpack or Turbopack) and other bundlers that hoist CSS imports move the imported files above an inline `@layer` line, so the order would arrive too late.',
145
+ },
146
+ {
147
+ type: 'code',
148
+ lang: 'css',
149
+ label: 'layers.css (imported first)',
150
+ code: `@layer reset, tw-preflight, astryx-base, astryx-theme;`,
151
+ },
152
+ {
153
+ type: 'code',
154
+ lang: 'css',
155
+ label: 'globals.css (Tailwind v3 coexistence)',
156
+ code: `@import "@astryxdesign/core/reset.css";
141
157
  @import "@astryxdesign/core/astryx.css";
142
158
  @import "@astryxdesign/theme-neutral/theme.css";
143
159
 
@@ -147,6 +163,15 @@ export function AppRoot({children}: {children: React.ReactNode}) {
147
163
  @tailwind components;
148
164
  @tailwind utilities; /* unlayered: legacy utility classes keep winning */`,
149
165
  },
166
+ {
167
+ type: 'code',
168
+ lang: 'tsx',
169
+ label: 'Root layout or app entry (Tailwind v3)',
170
+ code: `import './layers.css'; // first: declares the cascade-layer order
171
+ import './globals.css';
172
+
173
+ import {AppRoot} from './AppRoot';`,
174
+ },
150
175
  ],
151
176
  },
152
177
  {
@@ -186,7 +211,7 @@ export function AppRoot({children}: {children: React.ReactNode}) {
186
211
  type: 'list',
187
212
  style: 'unordered',
188
213
  items: [
189
- 'Declare the canonical @layer order once, before any @import. With webpack-based bundlers (including Next.js) the order declaration must live in its own CSS file imported first, such as layers.css, because webpack hoists @import content above the inline CSS that follows it.',
214
+ 'Declare the canonical @layer order once, before any @import. With Next.js (webpack or Turbopack) and other bundlers that hoist CSS imports, the order declaration must live in its own CSS file imported first, such as layers.css, because the bundler hoists @import content above the inline CSS that follows it.',
190
215
  'Audit every pre-existing global or reset stylesheet and assign each one to a layer deliberately. Top-level imports without layer() stay unlayered and beat every layer; imports nested inside a layered file inherit that layer.',
191
216
  'Remove or demote the app legacy reset. The design system ships its own :where() reset in the lowest layer, so any app reset belongs in that same reset layer and never in a layer above astryx-base.',
192
217
  'Layer Tailwind preflight. On Tailwind v4, import preflight.css with layer(base). On Tailwind v3, wrap the @tailwind base directive in a named layer (see the snippet in Theme and CSS Setup). Unlayered preflight overrides theme CSS silently.',
@@ -21,6 +21,9 @@ export const docs = {
21
21
  'Dialog',
22
22
  'BottomSheet',
23
23
  'contract',
24
+ 'Grid',
25
+ 'columns',
26
+ 'minWidth',
24
27
  ],
25
28
 
26
29
  sections: [
@@ -94,5 +97,39 @@ const isNarrow = useMediaQuery('(max-width: 1024px)');
94
97
  },
95
98
  ],
96
99
  },
100
+ {
101
+ id: 'columns-that-reflow',
102
+ title: 'Columns that reflow',
103
+ content: [
104
+ {
105
+ type: 'prose',
106
+ text: 'For columns that reflow on small screens, use `Grid columns={{minWidth, max}}`. A numeric `columns` is exactly N columns at every width and never reflows: `columns={4}` on a 390px phone renders four tracks under 100px wide, and the row overflows the page as soon as their content cannot shrink to fit. `{minWidth: 240, max: 4}` renders at most four columns, each at least 240px, and drops to one full-width column when the container is narrow; `max` is what lets that last column shrink to the container, and `gap` counts toward the room the columns need.',
107
+ },
108
+ {
109
+ type: 'code',
110
+ lang: 'tsx',
111
+ label: 'Reflowing stat row versus a fixed week row',
112
+ code: `// Reflows: 4 columns on desktop, 3 in a 768px-wide grid, 1 on a phone.
113
+ <Grid columns={{minWidth: 240, max: 4}} gap={3}>
114
+ {stats.map(stat => <StatCard key={stat.id} {...stat} />)}
115
+ </Grid>
116
+
117
+ // Fixed: exactly 7 columns at every width (a number never reflows).
118
+ <Grid columns={7} gap={1}>
119
+ {days.map(day => <DayCell key={day} day={day} />)}
120
+ </Grid>`,
121
+ },
122
+ {
123
+ type: 'list',
124
+ style: 'unordered',
125
+ items: [
126
+ '`{minWidth}` alone: as many columns as fit at the floor, no cap; a container narrower than `minWidth` overflows, so add `max` for anything that reaches a phone',
127
+ "`{minWidth, repeat: 'fit'}`: empty tracks collapse so present items stretch",
128
+ "A numeric `GridSpan` wider than the grid's current columns adds implicit columns to the whole grid; items placed before and after the span flow into them, and `columns='full'` then covers only the explicit columns. In a reflowing grid keep spans within the smallest count it can reach, or use `'full'`, which adds none",
129
+ 'Styling that changes the room columns have to fit changes the count a reflowing shape reaches: a `columnGap` or `gap` step, inline padding on the grid, or `grid-auto-flow: column` through `xstyle`, which places items into extra implicit columns. A `className` rule replaces the computed track list only when it wins the cascade against the generated styles; prefer `xstyle` for overrides',
130
+ ],
131
+ },
132
+ ],
133
+ },
97
134
  ],
98
135
  };
@@ -47,6 +47,18 @@ export const docs = {
47
47
  type: 'prose',
48
48
  text: 'Pre-declare every layer before any imports. This keeps reset lowest, Tailwind preflight above reset, component/theme styles in the middle, and Tailwind utilities last so utility classes on `className` can intentionally override component defaults.',
49
49
  },
50
+ {
51
+ type: 'prose',
52
+ text: 'A layer\'s rank is set by the first stylesheet on the page that names it, so this order only holds when `globals.css` loads first. Make it the first import in the root layout or app entry, before any module that imports Astryx or theme CSS. That includes the `astryx-themes` module generated by `astryx theme add` and any root component that imports a theme\'s `theme.css`. If a theme stylesheet loads first, Tailwind preflight overrides Astryx base styles and theme overrides lose. If `globals.css` cannot come first, move the `@layer` line into its own `layers.css` and import that first instead.',
53
+ },
54
+ {
55
+ type: 'code',
56
+ lang: 'tsx',
57
+ label: 'Root layout or app entry',
58
+ code: `import './globals.css'; // first: declares the cascade-layer order
59
+
60
+ import {themes, defaultThemeSlug} from './astryx-themes';`,
61
+ },
50
62
  {
51
63
  type: 'code',
52
64
  lang: 'tsx',
@@ -77,7 +77,7 @@ const styles = stylex.create({
77
77
  content: [
78
78
  {
79
79
  type: 'prose',
80
- text: 'Astryx components ship pre-compiled, so consuming the published package needs no StyleX setup. But `astryx swizzle <Component>` copies the raw StyleX *source* into your app, and StyleX source requires a build-time StyleX compiler to produce atomic CSS. Without one the component compiles but renders completely unstyled: no error, no warning. If a swizzled component looks unstyled, a missing StyleX compiler is almost always why. The same applies if you author your own StyleX with `stylex.create()`.',
80
+ text: 'Astryx components ship pre-compiled: `astryx.css` and each package\'s own stylesheet hold all of their styles, so consuming the published packages needs no StyleX setup. But `astryx swizzle <Component>` copies the raw StyleX *source* into your app, and StyleX source requires a build-time StyleX compiler to produce atomic CSS. Without one the component compiles but renders completely unstyled: no error, no warning. If a swizzled component looks unstyled, a missing StyleX compiler is almost always why. The same applies if you author your own StyleX with `stylex.create()`.',
81
81
  },
82
82
  {
83
83
  type: 'table',
@@ -105,7 +105,7 @@ const styles = stylex.create({
105
105
 
106
106
  export default stylexPlugin({
107
107
  rsOptions: {
108
- // Resolve @astryxdesign/core's StyleX so swizzled component source compiles.
108
+ // Resolve the Astryx token modules that swizzled source imports.
109
109
  aliases: {'@/*': ['./src/*']},
110
110
  unstable_moduleResolution: {type: 'commonJS'},
111
111
  },
@@ -120,6 +120,7 @@ export default stylexPlugin({
120
120
  'Symptom of a missing compiler: swizzled component renders with no styles, but no build or runtime error.',
121
121
  'A Babel config turns off SWC in Next.js; skip it if you need `next/font`.',
122
122
  'Pure theming (defineTheme + astryx theme build) needs NO StyleX compiler; only swizzled/authored StyleX source does.',
123
+ 'Keep loading `astryx.css` with a StyleX compiler in place. The compiler builds your own and swizzled source only; never add `node_modules/@astryxdesign` to its inputs.',
123
124
  ],
124
125
  },
125
126
  ],
@@ -88,6 +88,26 @@ export const docs = {
88
88
  [
89
89
  "--color-syntax-background",
90
90
  "var(--color-background-muted)"
91
+ ],
92
+ [
93
+ "--color-syntax-added",
94
+ "color-mix(in srgb, var(--color-success-muted) 25%, transparent)"
95
+ ],
96
+ [
97
+ "--color-syntax-removed",
98
+ "color-mix(in srgb, var(--color-error-muted) 25%, transparent)"
99
+ ],
100
+ [
101
+ "--color-syntax-diff-header",
102
+ "var(--color-background-muted)"
103
+ ],
104
+ [
105
+ "--color-syntax-added-marker",
106
+ "var(--color-text-green)"
107
+ ],
108
+ [
109
+ "--color-syntax-removed-marker",
110
+ "var(--color-text-red)"
91
111
  ]
92
112
  ]
93
113
  }
@@ -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: 258 tokens across 15 categories.
5
+ // Total: 263 tokens across 15 categories.
6
6
 
7
7
  /** @type {import('@astryxdesign/cli/authoring').NamespaceDoc} */
8
8
  export const docs = {
@@ -39,7 +39,12 @@ export default function CommandPaletteAsyncSearch() {
39
39
  isInline
40
40
  onOpenChange={() => {}}
41
41
  searchSource={source}
42
- input={<CommandPaletteInput placeholder="Search files..." />}
42
+ input={
43
+ <CommandPaletteInput
44
+ label="Search files"
45
+ placeholder="Search files..."
46
+ />
47
+ }
43
48
  emptyBootstrapText="Type a filename to search"
44
49
  emptySearchText="No files found"
45
50
  />
@@ -43,6 +43,55 @@ const butterSyntax = defineSyntaxTheme({
43
43
  },
44
44
  });
45
45
 
46
+ /**
47
+ * The secondary Button treatment. Selector, MultiSelector, and ComplexSelector
48
+ * reuse it for their `secondary` trigger so every secondary control in this
49
+ * theme matches (AST-079 FR2).
50
+ *
51
+ * Secondary: blue outline + label in light, butter yellow in dark.
52
+ */
53
+ const SECONDARY_BUTTON = {
54
+ backgroundColor: 'transparent',
55
+ borderWidth: '1.5px',
56
+ borderStyle: 'solid',
57
+ borderColor: 'light-dark(#225BFF, #FDEE8C)',
58
+ color: 'light-dark(#225BFF, #FDEE8C)',
59
+ ':hover': {
60
+ backgroundColor: 'light-dark(#225BFF14, #FDEE8C14)',
61
+ },
62
+ } as const;
63
+
64
+ /**
65
+ * The secondary Button treatment on Selector and MultiSelector triggers
66
+ * (AST-079 FR2). Inside an InputGroup a trigger keeps the neutral fill and the
67
+ * group's edges instead (FR6). The hover stays off disabled and read-only
68
+ * triggers, which carry `data-disabled` and `data-readonly`.
69
+ */
70
+ const SECONDARY_SELECTOR = {
71
+ ':not(.astryx-input-group *)': {
72
+ backgroundColor: SECONDARY_BUTTON.backgroundColor,
73
+ borderWidth: SECONDARY_BUTTON.borderWidth,
74
+ borderStyle: SECONDARY_BUTTON.borderStyle,
75
+ borderColor: SECONDARY_BUTTON.borderColor,
76
+ color: SECONDARY_BUTTON.color,
77
+ },
78
+ ':hover:not([data-disabled], [data-readonly], .astryx-input-group *)':
79
+ SECONDARY_BUTTON[':hover'],
80
+ } as const;
81
+
82
+ /**
83
+ * The secondary Button treatment on ComplexSelector triggers (AST-079 FR2), with
84
+ * the hover kept off a disabled trigger, whose inner button is disabled.
85
+ */
86
+ const SECONDARY_COMPLEX_SELECTOR = {
87
+ backgroundColor: SECONDARY_BUTTON.backgroundColor,
88
+ borderWidth: SECONDARY_BUTTON.borderWidth,
89
+ borderStyle: SECONDARY_BUTTON.borderStyle,
90
+ borderColor: SECONDARY_BUTTON.borderColor,
91
+ color: SECONDARY_BUTTON.color,
92
+ ':hover:not(:has(> :disabled))': SECONDARY_BUTTON[':hover'],
93
+ } as const;
94
+
46
95
  export const butterTheme = defineTheme({
47
96
  name: 'butter',
48
97
 
@@ -276,17 +325,7 @@ export const butterTheme = defineTheme({
276
325
  paddingBlock: 'var(--spacing-3)',
277
326
  paddingInline: 'var(--spacing-4)',
278
327
  },
279
- // Secondary: blue outline + label in light, butter yellow in dark.
280
- 'variant:secondary': {
281
- backgroundColor: 'transparent',
282
- borderWidth: '1.5px',
283
- borderStyle: 'solid',
284
- borderColor: 'light-dark(#225BFF, #FDEE8C)',
285
- color: 'light-dark(#225BFF, #FDEE8C)',
286
- ':hover': {
287
- backgroundColor: 'light-dark(#225BFF14, #FDEE8C14)',
288
- },
289
- },
328
+ 'variant:secondary': SECONDARY_BUTTON,
290
329
  // Ghost: same accent color as secondary, no background.
291
330
  'variant:ghost': {
292
331
  color: 'light-dark(#225BFF, #FDEE8C)',
@@ -534,6 +573,7 @@ export const butterTheme = defineTheme({
534
573
  'status:success': {'--color-success': '#91D143'},
535
574
  'status:warning': {'--color-warning': '#ffc502'},
536
575
  'status:error': {'--color-error': '#fc473b'},
576
+ 'variant:secondary': SECONDARY_SELECTOR,
537
577
  },
538
578
  'multi-selector': {
539
579
  base: {
@@ -544,7 +584,9 @@ export const butterTheme = defineTheme({
544
584
  'status:success': {'--color-success': '#91D143'},
545
585
  'status:warning': {'--color-warning': '#ffc502'},
546
586
  'status:error': {'--color-error': '#fc473b'},
587
+ 'variant:secondary': SECONDARY_SELECTOR,
547
588
  },
589
+ 'complex-selector': {'variant:secondary': SECONDARY_COMPLEX_SELECTOR},
548
590
  typeahead: {
549
591
  base: {
550
592
  paddingBlock: 'var(--spacing-2)',
@@ -34,6 +34,30 @@ const chocolateSyntax = defineSyntaxTheme({
34
34
  },
35
35
  });
36
36
 
37
+ /**
38
+ * The secondary Button treatment. Selector, MultiSelector, and ComplexSelector
39
+ * reuse it for their `secondary` trigger so every secondary control in this
40
+ * theme matches (AST-079 FR2).
41
+ */
42
+ const SECONDARY_BUTTON = {
43
+ borderWidth: '1px',
44
+ borderStyle: 'solid',
45
+ borderColor: 'var(--color-border-emphasized)',
46
+ } as const;
47
+
48
+ /**
49
+ * The secondary Button treatment on Selector and MultiSelector triggers
50
+ * (AST-079 FR2). Inside an InputGroup a trigger keeps the neutral fill and the
51
+ * group's edges instead (FR6).
52
+ */
53
+ const SECONDARY_SELECTOR = {
54
+ ':not(.astryx-input-group *)': {
55
+ borderWidth: SECONDARY_BUTTON.borderWidth,
56
+ borderStyle: SECONDARY_BUTTON.borderStyle,
57
+ borderColor: SECONDARY_BUTTON.borderColor,
58
+ },
59
+ } as const;
60
+
37
61
  export const chocolateTheme = defineTheme({
38
62
  name: 'chocolate',
39
63
 
@@ -219,12 +243,12 @@ export const chocolateTheme = defineTheme({
219
243
  base: {
220
244
  borderRadius: 'var(--radius-full)',
221
245
  },
222
- 'variant:secondary': {
223
- borderWidth: '1px',
224
- borderStyle: 'solid',
225
- borderColor: 'var(--color-border-emphasized)',
226
- },
246
+ 'variant:secondary': SECONDARY_BUTTON,
227
247
  },
248
+ // Secondary selector triggers match the secondary Button (AST-079 FR2).
249
+ selector: {'variant:secondary': SECONDARY_SELECTOR},
250
+ 'multi-selector': {'variant:secondary': SECONDARY_SELECTOR},
251
+ 'complex-selector': {'variant:secondary': SECONDARY_BUTTON},
228
252
 
229
253
  card: {
230
254
  base: {