@astryxdesign/cli 0.7.1-canary.c2e7d8b → 0.7.1-canary.c529db2
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/assets/docs/getting-started.doc.mjs +0 -10
- package/assets/docs/styling-overview.doc.mjs +54 -15
- package/assets/docs/tree/tokens-and-setup.doc.mjs +3 -2
- package/assets/templates/blocks/components/CommandPalette/CommandPaletteAsyncSearch.tsx +6 -1
- package/assets/templates/themes/butter/butterTheme.ts +53 -11
- package/assets/templates/themes/chocolate/chocolateTheme.ts +29 -5
- package/assets/templates/themes/gothic/gothicTheme.ts +35 -9
- package/assets/templates/themes/stone/stoneTheme.ts +51 -11
- package/assets/templates/themes/y2k/y2kTheme.ts +52 -10
- package/package.json +9 -9
|
@@ -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
|
|
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
|
|
50
|
-
'
|
|
51
|
-
'Yes \u2014 a StyleX
|
|
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-
|
|
121
|
-
title: 'StyleX
|
|
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>`)
|
|
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: `@
|
|
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: '
|
|
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
|
-
[
|
|
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
|
-
'
|
|
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',
|
|
@@ -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
|
|
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
|
|
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
|
],
|
|
@@ -39,7 +39,12 @@ export default function CommandPaletteAsyncSearch() {
|
|
|
39
39
|
isInline
|
|
40
40
|
onOpenChange={() => {}}
|
|
41
41
|
searchSource={source}
|
|
42
|
-
input={
|
|
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
|
-
|
|
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: {
|
|
@@ -52,6 +52,36 @@ const gothicSyntax = defineSyntaxTheme({
|
|
|
52
52
|
},
|
|
53
53
|
});
|
|
54
54
|
|
|
55
|
+
/**
|
|
56
|
+
* The secondary Button treatment. Selector, MultiSelector, and ComplexSelector
|
|
57
|
+
* reuse it for their `secondary` trigger so every secondary control in this
|
|
58
|
+
* theme matches (AST-079 FR2).
|
|
59
|
+
*
|
|
60
|
+
* Primary inherits default — light pill with dark text via
|
|
61
|
+
* --color-accent / --color-on-accent (matches the cream badge).
|
|
62
|
+
* Secondary uses the dark-slate "neutral" badge treatment.
|
|
63
|
+
*/
|
|
64
|
+
const SECONDARY_BUTTON = {
|
|
65
|
+
backgroundColor: 'var(--color-background-gray)',
|
|
66
|
+
color: 'var(--color-text-gray)',
|
|
67
|
+
borderColor: 'transparent',
|
|
68
|
+
borderWidth: '0',
|
|
69
|
+
} as const;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* The secondary Button treatment on Selector and MultiSelector triggers
|
|
73
|
+
* (AST-079 FR2). Inside an InputGroup a trigger keeps the neutral fill and the
|
|
74
|
+
* group's edges instead (FR6).
|
|
75
|
+
*/
|
|
76
|
+
const SECONDARY_SELECTOR = {
|
|
77
|
+
':not(.astryx-input-group *)': {
|
|
78
|
+
backgroundColor: SECONDARY_BUTTON.backgroundColor,
|
|
79
|
+
color: SECONDARY_BUTTON.color,
|
|
80
|
+
borderColor: SECONDARY_BUTTON.borderColor,
|
|
81
|
+
borderWidth: SECONDARY_BUTTON.borderWidth,
|
|
82
|
+
},
|
|
83
|
+
} as const;
|
|
84
|
+
|
|
55
85
|
export const gothicTheme = defineTheme({
|
|
56
86
|
name: 'gothic',
|
|
57
87
|
|
|
@@ -236,15 +266,7 @@ export const gothicTheme = defineTheme({
|
|
|
236
266
|
|
|
237
267
|
components: {
|
|
238
268
|
button: {
|
|
239
|
-
|
|
240
|
-
// --color-accent / --color-on-accent (matches the cream badge).
|
|
241
|
-
// Secondary uses the dark-slate "neutral" badge treatment.
|
|
242
|
-
'variant:secondary': {
|
|
243
|
-
backgroundColor: 'var(--color-background-gray)',
|
|
244
|
-
color: 'var(--color-text-gray)',
|
|
245
|
-
borderColor: 'transparent',
|
|
246
|
-
borderWidth: '0',
|
|
247
|
-
},
|
|
269
|
+
'variant:secondary': SECONDARY_BUTTON,
|
|
248
270
|
'variant:ghost': {
|
|
249
271
|
':hover': {
|
|
250
272
|
backgroundColor: 'var(--color-overlay-hover)',
|
|
@@ -257,6 +279,10 @@ export const gothicTheme = defineTheme({
|
|
|
257
279
|
color: 'var(--color-text-red)',
|
|
258
280
|
},
|
|
259
281
|
},
|
|
282
|
+
// Secondary selector triggers match the secondary Button (AST-079 FR2).
|
|
283
|
+
selector: {'variant:secondary': SECONDARY_SELECTOR},
|
|
284
|
+
'multi-selector': {'variant:secondary': SECONDARY_SELECTOR},
|
|
285
|
+
'complex-selector': {'variant:secondary': SECONDARY_BUTTON},
|
|
260
286
|
|
|
261
287
|
badge: {
|
|
262
288
|
base: {
|
|
@@ -66,6 +66,50 @@ const stoneSyntax = defineSyntaxTheme({
|
|
|
66
66
|
},
|
|
67
67
|
});
|
|
68
68
|
|
|
69
|
+
/**
|
|
70
|
+
* The secondary Button treatment. Selector, MultiSelector, and ComplexSelector
|
|
71
|
+
* reuse it for their `secondary` trigger so every secondary control in this
|
|
72
|
+
* theme matches (AST-079 FR2).
|
|
73
|
+
*/
|
|
74
|
+
const SECONDARY_BUTTON = {
|
|
75
|
+
backgroundColor: 'transparent',
|
|
76
|
+
borderWidth: '1.5px',
|
|
77
|
+
borderStyle: 'solid',
|
|
78
|
+
borderColor: 'var(--color-border-emphasized)',
|
|
79
|
+
':hover': {
|
|
80
|
+
backgroundColor: 'var(--color-neutral)',
|
|
81
|
+
},
|
|
82
|
+
} as const;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* The secondary Button treatment on Selector and MultiSelector triggers
|
|
86
|
+
* (AST-079 FR2). Inside an InputGroup a trigger keeps the neutral fill and the
|
|
87
|
+
* group's edges instead (FR6). The hover stays off disabled and read-only
|
|
88
|
+
* triggers, which carry `data-disabled` and `data-readonly`.
|
|
89
|
+
*/
|
|
90
|
+
const SECONDARY_SELECTOR = {
|
|
91
|
+
':not(.astryx-input-group *)': {
|
|
92
|
+
backgroundColor: SECONDARY_BUTTON.backgroundColor,
|
|
93
|
+
borderWidth: SECONDARY_BUTTON.borderWidth,
|
|
94
|
+
borderStyle: SECONDARY_BUTTON.borderStyle,
|
|
95
|
+
borderColor: SECONDARY_BUTTON.borderColor,
|
|
96
|
+
},
|
|
97
|
+
':hover:not([data-disabled], [data-readonly], .astryx-input-group *)':
|
|
98
|
+
SECONDARY_BUTTON[':hover'],
|
|
99
|
+
} as const;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* The secondary Button treatment on ComplexSelector triggers (AST-079 FR2), with
|
|
103
|
+
* the hover kept off a disabled trigger, whose inner button is disabled.
|
|
104
|
+
*/
|
|
105
|
+
const SECONDARY_COMPLEX_SELECTOR = {
|
|
106
|
+
backgroundColor: SECONDARY_BUTTON.backgroundColor,
|
|
107
|
+
borderWidth: SECONDARY_BUTTON.borderWidth,
|
|
108
|
+
borderStyle: SECONDARY_BUTTON.borderStyle,
|
|
109
|
+
borderColor: SECONDARY_BUTTON.borderColor,
|
|
110
|
+
':hover:not(:has(> :disabled))': SECONDARY_BUTTON[':hover'],
|
|
111
|
+
} as const;
|
|
112
|
+
|
|
69
113
|
export const stoneTheme = defineTheme({
|
|
70
114
|
name: 'stone',
|
|
71
115
|
|
|
@@ -269,15 +313,7 @@ export const stoneTheme = defineTheme({
|
|
|
269
313
|
base: {
|
|
270
314
|
borderRadius: 'var(--radius-full)',
|
|
271
315
|
},
|
|
272
|
-
'variant:secondary':
|
|
273
|
-
backgroundColor: 'transparent',
|
|
274
|
-
borderWidth: '1.5px',
|
|
275
|
-
borderStyle: 'solid',
|
|
276
|
-
borderColor: 'var(--color-border-emphasized)',
|
|
277
|
-
':hover': {
|
|
278
|
-
backgroundColor: 'var(--color-neutral)',
|
|
279
|
-
},
|
|
280
|
-
},
|
|
316
|
+
'variant:secondary': SECONDARY_BUTTON,
|
|
281
317
|
'variant:destructive': {
|
|
282
318
|
backgroundColor: 'var(--color-background-red)',
|
|
283
319
|
color: 'var(--color-text-red)',
|
|
@@ -396,8 +432,12 @@ export const stoneTheme = defineTheme({
|
|
|
396
432
|
'number-input': INPUT_STATUS_VARS,
|
|
397
433
|
'date-input': INPUT_STATUS_VARS,
|
|
398
434
|
'time-input': INPUT_STATUS_VARS,
|
|
399
|
-
selector: INPUT_STATUS_VARS,
|
|
400
|
-
'multi-selector':
|
|
435
|
+
selector: {...INPUT_STATUS_VARS, 'variant:secondary': SECONDARY_SELECTOR},
|
|
436
|
+
'multi-selector': {
|
|
437
|
+
...INPUT_STATUS_VARS,
|
|
438
|
+
'variant:secondary': SECONDARY_SELECTOR,
|
|
439
|
+
},
|
|
440
|
+
'complex-selector': {'variant:secondary': SECONDARY_COMPLEX_SELECTOR},
|
|
401
441
|
typeahead: INPUT_STATUS_VARS,
|
|
402
442
|
tokenizer: INPUT_STATUS_VARS,
|
|
403
443
|
|
|
@@ -40,6 +40,53 @@ const y2kSyntax = defineSyntaxTheme({
|
|
|
40
40
|
},
|
|
41
41
|
});
|
|
42
42
|
|
|
43
|
+
/**
|
|
44
|
+
* The secondary Button treatment. Selector, MultiSelector, and ComplexSelector
|
|
45
|
+
* reuse it for their `secondary` trigger so every secondary control in this
|
|
46
|
+
* theme matches (AST-079 FR2).
|
|
47
|
+
*/
|
|
48
|
+
const SECONDARY_BUTTON = {
|
|
49
|
+
backgroundColor: 'var(--color-background-green)',
|
|
50
|
+
borderWidth: '1px',
|
|
51
|
+
borderStyle: 'solid',
|
|
52
|
+
borderColor: 'var(--color-text-green)',
|
|
53
|
+
color: 'var(--color-text-green)',
|
|
54
|
+
':hover': {
|
|
55
|
+
backgroundColor: 'var(--color-border-green)',
|
|
56
|
+
},
|
|
57
|
+
} as const;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* The secondary Button treatment on Selector and MultiSelector triggers
|
|
61
|
+
* (AST-079 FR2). Inside an InputGroup a trigger keeps the neutral fill and the
|
|
62
|
+
* group's edges instead (FR6). The hover stays off disabled and read-only
|
|
63
|
+
* triggers, which carry `data-disabled` and `data-readonly`.
|
|
64
|
+
*/
|
|
65
|
+
const SECONDARY_SELECTOR = {
|
|
66
|
+
':not(.astryx-input-group *)': {
|
|
67
|
+
backgroundColor: SECONDARY_BUTTON.backgroundColor,
|
|
68
|
+
borderWidth: SECONDARY_BUTTON.borderWidth,
|
|
69
|
+
borderStyle: SECONDARY_BUTTON.borderStyle,
|
|
70
|
+
borderColor: SECONDARY_BUTTON.borderColor,
|
|
71
|
+
color: SECONDARY_BUTTON.color,
|
|
72
|
+
},
|
|
73
|
+
':hover:not([data-disabled], [data-readonly], .astryx-input-group *)':
|
|
74
|
+
SECONDARY_BUTTON[':hover'],
|
|
75
|
+
} as const;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* The secondary Button treatment on ComplexSelector triggers (AST-079 FR2), with
|
|
79
|
+
* the hover kept off a disabled trigger, whose inner button is disabled.
|
|
80
|
+
*/
|
|
81
|
+
const SECONDARY_COMPLEX_SELECTOR = {
|
|
82
|
+
backgroundColor: SECONDARY_BUTTON.backgroundColor,
|
|
83
|
+
borderWidth: SECONDARY_BUTTON.borderWidth,
|
|
84
|
+
borderStyle: SECONDARY_BUTTON.borderStyle,
|
|
85
|
+
borderColor: SECONDARY_BUTTON.borderColor,
|
|
86
|
+
color: SECONDARY_BUTTON.color,
|
|
87
|
+
':hover:not(:has(> :disabled))': SECONDARY_BUTTON[':hover'],
|
|
88
|
+
} as const;
|
|
89
|
+
|
|
43
90
|
export const y2kTheme = defineTheme({
|
|
44
91
|
name: 'y2k',
|
|
45
92
|
|
|
@@ -264,16 +311,7 @@ export const y2kTheme = defineTheme({
|
|
|
264
311
|
color: 'var(--color-background-body)',
|
|
265
312
|
borderColor: 'transparent',
|
|
266
313
|
},
|
|
267
|
-
'variant:secondary':
|
|
268
|
-
backgroundColor: 'var(--color-background-green)',
|
|
269
|
-
borderWidth: '1px',
|
|
270
|
-
borderStyle: 'solid',
|
|
271
|
-
borderColor: 'var(--color-text-green)',
|
|
272
|
-
color: 'var(--color-text-green)',
|
|
273
|
-
':hover': {
|
|
274
|
-
backgroundColor: 'var(--color-border-green)',
|
|
275
|
-
},
|
|
276
|
-
},
|
|
314
|
+
'variant:secondary': SECONDARY_BUTTON,
|
|
277
315
|
'variant:ghost': {
|
|
278
316
|
borderColor: 'transparent',
|
|
279
317
|
},
|
|
@@ -285,6 +323,10 @@ export const y2kTheme = defineTheme({
|
|
|
285
323
|
borderColor: 'var(--color-text-red)',
|
|
286
324
|
},
|
|
287
325
|
},
|
|
326
|
+
// Secondary selector triggers match the secondary Button (AST-079 FR2).
|
|
327
|
+
selector: {'variant:secondary': SECONDARY_SELECTOR},
|
|
328
|
+
'multi-selector': {'variant:secondary': SECONDARY_SELECTOR},
|
|
329
|
+
'complex-selector': {'variant:secondary': SECONDARY_COMPLEX_SELECTOR},
|
|
288
330
|
|
|
289
331
|
badge: {
|
|
290
332
|
base: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astryxdesign/cli",
|
|
3
|
-
"version": "0.7.1-canary.
|
|
3
|
+
"version": "0.7.1-canary.c529db2",
|
|
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.7.1-canary.
|
|
105
|
-
"@astryxdesign/core": "0.7.1-canary.
|
|
106
|
-
"@astryxdesign/lab": "0.7.1-canary.
|
|
107
|
-
"@astryxdesign/theme-neutral": "0.7.1-canary.
|
|
104
|
+
"@astryxdesign/charts": "0.7.1-canary.c529db2",
|
|
105
|
+
"@astryxdesign/core": "0.7.1-canary.c529db2",
|
|
106
|
+
"@astryxdesign/lab": "0.7.1-canary.c529db2",
|
|
107
|
+
"@astryxdesign/theme-neutral": "0.7.1-canary.c529db2"
|
|
108
108
|
},
|
|
109
109
|
"peerDependenciesMeta": {
|
|
110
110
|
"@astryxdesign/charts": {
|
|
@@ -121,10 +121,10 @@
|
|
|
121
121
|
}
|
|
122
122
|
},
|
|
123
123
|
"devDependencies": {
|
|
124
|
-
"@astryxdesign/charts": "0.7.1-canary.
|
|
125
|
-
"@astryxdesign/core": "0.7.1-canary.
|
|
126
|
-
"@astryxdesign/lab": "0.7.1-canary.
|
|
127
|
-
"@astryxdesign/theme-neutral": "0.7.1-canary.
|
|
124
|
+
"@astryxdesign/charts": "0.7.1-canary.c529db2",
|
|
125
|
+
"@astryxdesign/core": "0.7.1-canary.c529db2",
|
|
126
|
+
"@astryxdesign/lab": "0.7.1-canary.c529db2",
|
|
127
|
+
"@astryxdesign/theme-neutral": "0.7.1-canary.c529db2",
|
|
128
128
|
"@heroicons/react": "^2.2.0",
|
|
129
129
|
"@stylexjs/stylex": "^0.19.0",
|
|
130
130
|
"@types/babel__core": "^7.20.5",
|