@astryxdesign/cli 0.7.0-canary.fe57f54 → 0.7.0
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 +167 -0
- package/api/doctor/doctor.d.mts +30 -2
- package/api/doctor/doctor.doc.mjs +2 -1
- package/api/doctor/doctor.mjs +153 -3
- package/api/doctor/doctor.test.mjs +250 -4
- package/assets/codemods/__tests__/registry.test.mjs +1 -0
- package/assets/codemods/registry.mjs +1 -0
- package/assets/codemods/transforms/next/index.mjs +1 -27
- package/assets/codemods/transforms/v0.7.0/__tests__/preserve-bottom-sheet-content-padding.test.mjs +178 -0
- package/assets/codemods/transforms/v0.7.0/__tests__/rename-empty-search-results-text.test.mjs +202 -0
- package/assets/codemods/transforms/v0.7.0/index.mjs +52 -0
- package/assets/codemods/transforms/v0.7.0/preserve-bottom-sheet-content-padding.mjs +242 -0
- package/assets/codemods/transforms/v0.7.0/rename-empty-search-results-text.mjs +254 -0
- package/assets/docs/spacing.doc.mjs +2 -2
- package/assets/docs/tree/tokens-spacing.doc.mjs +15 -15
- package/assets/templates/blocks/components/BottomSheet/BottomSheetHeights.tsx +1 -1
- package/assets/templates/blocks/components/BottomSheet/BottomSheetMobileKeyboard.tsx +1 -1
- package/assets/templates/blocks/components/BottomSheet/BottomSheetNoScrim.tsx +1 -1
- package/assets/templates/blocks/components/BottomSheet/BottomSheetSnapPoints.tsx +1 -1
- package/assets/templates/blocks/components/Dialog/DialogAdaptivePresentation.tsx +1 -1
- package/assets/templates/pages/table-filter/page.tsx +8 -3
- package/assets/templates/pages/table-inbox/page.tsx +3 -1
- package/assets/templates/themes/butter/butterTheme.ts +12 -0
- package/assets/templates/themes/chocolate/chocolateTheme.ts +12 -0
- package/assets/templates/themes/matcha/matchaTheme.ts +14 -14
- package/assets/templates/themes/neutral/neutralTheme.ts +12 -0
- package/assets/templates/themes/stone/stoneTheme.ts +12 -0
- package/assets/templates/themes/y2k/y2kTheme.ts +10 -10
- package/assets/theme.template.ts +1 -1
- package/clients/cli/commands/doctor.doc.mjs +1 -1
- package/clients/cli/commands/doctor.test.mjs +33 -0
- package/package.json +9 -9
- /package/assets/codemods/transforms/{next → v0.7.0}/__tests__/migrate-deprecated-theme-surface.test.mjs +0 -0
- /package/assets/codemods/transforms/{next → v0.7.0}/__tests__/migrate-field-input-styling.test.mjs +0 -0
- /package/assets/codemods/transforms/{next → v0.7.0}/__tests__/validate-data-token-ownership.test.mjs +0 -0
- /package/assets/codemods/transforms/{next → v0.7.0}/migrate-deprecated-theme-surface-v0.6-data.mjs +0 -0
- /package/assets/codemods/transforms/{next → v0.7.0}/migrate-deprecated-theme-surface.mjs +0 -0
- /package/assets/codemods/transforms/{next → v0.7.0}/migrate-field-input-styling.mjs +0 -0
- /package/assets/codemods/transforms/{next → v0.7.0}/validate-data-token-ownership.mjs +0 -0
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file Codemod: rename emptySearchResultsText to emptySearchText
|
|
5
|
+
*
|
|
6
|
+
* `emptySearchResultsText` was renamed to `emptySearchText` (`spec:AST-056`
|
|
7
|
+
* FR1) and the old name is removed in a minor release. The new prop takes a
|
|
8
|
+
* `ReactNode`, so every old `string` value stays valid and the rename never
|
|
9
|
+
* changes a value.
|
|
10
|
+
*
|
|
11
|
+
* A straight rename at the JSX boundary, through the shared `transformProp`
|
|
12
|
+
* helper: the prop on an imported `Tokenizer`, `Typeahead`, or `BaseTypeahead`
|
|
13
|
+
* element, and the key on `ChatComposerInput` trigger objects written inline
|
|
14
|
+
* in its `triggers` prop. Like every transform built on the helper it does
|
|
15
|
+
* not follow variables, helpers, spreads, wrappers, or types. Where it cannot
|
|
16
|
+
* attribute the value it leaves a TODO instead of choosing a winner: the new
|
|
17
|
+
* name already set, any spread onto one of these elements (whether or not the
|
|
18
|
+
* element writes the old name itself — a spread may carry either name or the
|
|
19
|
+
* triggers), a `triggers` value that is not an inline object or array, or a
|
|
20
|
+
* trigger object with a spread or computed key. A value forwarded through a
|
|
21
|
+
* spread is the one case the type checker cannot report after the removal,
|
|
22
|
+
* which is why every spread gets the TODO.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
import {transformProp} from '../../transform-prop.mjs';
|
|
26
|
+
|
|
27
|
+
export const meta = {
|
|
28
|
+
title: 'Rename emptySearchResultsText to emptySearchText',
|
|
29
|
+
description:
|
|
30
|
+
'Renames the removed `emptySearchResultsText` prop to `emptySearchText` ' +
|
|
31
|
+
'on imported Tokenizer, Typeahead, and BaseTypeahead elements, and the ' +
|
|
32
|
+
"same key on trigger objects written inline in ChatComposerInput's " +
|
|
33
|
+
'`triggers`. Leaves a TODO where the new name is already set, on every ' +
|
|
34
|
+
'spread onto these elements, where the triggers value is not written ' +
|
|
35
|
+
'inline, and on a trigger object with a spread or computed key.',
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const OLD_NAME = 'emptySearchResultsText';
|
|
39
|
+
const NEW_NAME = 'emptySearchText';
|
|
40
|
+
const CORE_IMPORT_RE = /^@(astryxdesign|xds)\/core(?:\/|$)/;
|
|
41
|
+
|
|
42
|
+
const COMPONENTS = new Map([
|
|
43
|
+
['Tokenizer', new Set([OLD_NAME])],
|
|
44
|
+
['Typeahead', new Set([OLD_NAME])],
|
|
45
|
+
['BaseTypeahead', new Set([OLD_NAME])],
|
|
46
|
+
['ChatComposerInput', new Set(['triggers'])],
|
|
47
|
+
]);
|
|
48
|
+
|
|
49
|
+
const BOTH_SET_COMMENT =
|
|
50
|
+
' TODO(astryx upgrade): emptySearchResultsText was removed and ' +
|
|
51
|
+
'emptySearchText is already set here; delete the old one if the new value ' +
|
|
52
|
+
'is what you want. ';
|
|
53
|
+
const UNREADABLE_OBJECT_COMMENT =
|
|
54
|
+
' TODO(astryx upgrade): emptySearchResultsText was removed. Rename it to ' +
|
|
55
|
+
'emptySearchText by hand; this object has a spread or computed key. ';
|
|
56
|
+
const SPREAD_COMMENT =
|
|
57
|
+
' TODO(astryx upgrade): emptySearchResultsText was removed. This element ' +
|
|
58
|
+
'spreads props that may carry either name; rename to emptySearchText ' +
|
|
59
|
+
'where the props are built and delete the old one. ';
|
|
60
|
+
const OPAQUE_TRIGGERS_COMMENT =
|
|
61
|
+
' TODO(astryx upgrade): emptySearchResultsText was removed. These triggers ' +
|
|
62
|
+
'are built elsewhere; rename the key to emptySearchText where they are ' +
|
|
63
|
+
'built. ';
|
|
64
|
+
|
|
65
|
+
const TYPE_WRAPPERS = new Set([
|
|
66
|
+
'TSAsExpression',
|
|
67
|
+
'TSSatisfiesExpression',
|
|
68
|
+
'TSTypeAssertion',
|
|
69
|
+
'TSNonNullExpression',
|
|
70
|
+
'TypeCastExpression',
|
|
71
|
+
'ParenthesizedExpression',
|
|
72
|
+
]);
|
|
73
|
+
|
|
74
|
+
/** @param {any} node */
|
|
75
|
+
function unwrap(node) {
|
|
76
|
+
let current = node;
|
|
77
|
+
while (current && TYPE_WRAPPERS.has(current.type)) {
|
|
78
|
+
current = current.expression;
|
|
79
|
+
}
|
|
80
|
+
return current;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** @param {any} property */
|
|
84
|
+
function staticPropertyName(property) {
|
|
85
|
+
if (property.computed) return null;
|
|
86
|
+
const key = property.key;
|
|
87
|
+
if (key?.type === 'Identifier') return key.name;
|
|
88
|
+
if (key?.type === 'StringLiteral' || key?.type === 'Literal') {
|
|
89
|
+
return typeof key.value === 'string' ? key.value : null;
|
|
90
|
+
}
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Attach a comment to a node once (re-running the codemod adds nothing).
|
|
96
|
+
* @param {any} j @param {any} node @param {string} text
|
|
97
|
+
*/
|
|
98
|
+
function addComment(j, node, text) {
|
|
99
|
+
node.comments ??= [];
|
|
100
|
+
if (node.comments.some((/** @type {any} */ c) => c.value === text)) {
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
node.comments.push(j.commentBlock(text, true, false));
|
|
104
|
+
return true;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Rename the key on one trigger object literal.
|
|
109
|
+
* @param {any} j @param {any} object @returns {boolean}
|
|
110
|
+
*/
|
|
111
|
+
function renameTriggerKey(j, object) {
|
|
112
|
+
const old = object.properties.find(
|
|
113
|
+
(/** @type {any} */ property) => staticPropertyName(property) === OLD_NAME,
|
|
114
|
+
);
|
|
115
|
+
const unreadable = object.properties.find(
|
|
116
|
+
(/** @type {any} */ property) =>
|
|
117
|
+
property.type === 'SpreadElement' ||
|
|
118
|
+
property.type === 'SpreadProperty' ||
|
|
119
|
+
property.computed,
|
|
120
|
+
);
|
|
121
|
+
// A spread or computed key may carry the removed key itself, so the
|
|
122
|
+
// object gets the TODO whether or not it writes the old name.
|
|
123
|
+
if (unreadable) {
|
|
124
|
+
return addComment(j, old ?? unreadable, UNREADABLE_OBJECT_COMMENT);
|
|
125
|
+
}
|
|
126
|
+
if (!old) return false;
|
|
127
|
+
const already = object.properties.some(
|
|
128
|
+
(/** @type {any} */ property) => staticPropertyName(property) === NEW_NAME,
|
|
129
|
+
);
|
|
130
|
+
if (already) return addComment(j, old, BOTH_SET_COMMENT);
|
|
131
|
+
old.key = j.identifier(NEW_NAME);
|
|
132
|
+
if (old.shorthand) old.shorthand = false;
|
|
133
|
+
return true;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/** @param {any} fileInfo @param {any} api */
|
|
137
|
+
export default function transform(fileInfo, api) {
|
|
138
|
+
const j = api.jscodeshift;
|
|
139
|
+
const root = j(fileInfo.source);
|
|
140
|
+
let changed = false;
|
|
141
|
+
|
|
142
|
+
transformProp(
|
|
143
|
+
root,
|
|
144
|
+
j,
|
|
145
|
+
{
|
|
146
|
+
matchesImport: source => CORE_IMPORT_RE.test(source),
|
|
147
|
+
components: COMPONENTS,
|
|
148
|
+
},
|
|
149
|
+
(propPath, {component}) => {
|
|
150
|
+
const prop = propPath.node;
|
|
151
|
+
const attributes = propPath.parent.node.attributes ?? [];
|
|
152
|
+
const hasSpread = attributes.some(
|
|
153
|
+
(/** @type {any} */ attribute) =>
|
|
154
|
+
attribute.type === 'JSXSpreadAttribute',
|
|
155
|
+
);
|
|
156
|
+
if (component === 'ChatComposerInput') {
|
|
157
|
+
// `triggers={[{...}, {...}]}` or `triggers={{...}}`: rename the key
|
|
158
|
+
// on each object written inline; a value built elsewhere, or an
|
|
159
|
+
// element whose spread may carry triggers, gets a TODO.
|
|
160
|
+
const value =
|
|
161
|
+
prop.value?.type === 'JSXExpressionContainer'
|
|
162
|
+
? unwrap(prop.value.expression)
|
|
163
|
+
: null;
|
|
164
|
+
const items =
|
|
165
|
+
value?.type === 'ArrayExpression'
|
|
166
|
+
? value.elements.map((/** @type {any} */ e) => unwrap(e))
|
|
167
|
+
: [value];
|
|
168
|
+
let opaque = hasSpread;
|
|
169
|
+
for (const item of items) {
|
|
170
|
+
if (item?.type === 'ObjectExpression') {
|
|
171
|
+
changed = renameTriggerKey(j, item) || changed;
|
|
172
|
+
} else {
|
|
173
|
+
opaque = true;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
if (opaque) {
|
|
177
|
+
changed = addComment(j, prop, OPAQUE_TRIGGERS_COMMENT) || changed;
|
|
178
|
+
}
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
if (hasSpread) {
|
|
182
|
+
changed = addComment(j, prop, SPREAD_COMMENT) || changed;
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
const already = attributes.some(
|
|
186
|
+
(/** @type {any} */ attribute) =>
|
|
187
|
+
attribute.type === 'JSXAttribute' &&
|
|
188
|
+
attribute.name?.name === NEW_NAME,
|
|
189
|
+
);
|
|
190
|
+
if (already) {
|
|
191
|
+
changed = addComment(j, prop, BOTH_SET_COMMENT) || changed;
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
prop.name.name = NEW_NAME;
|
|
195
|
+
changed = true;
|
|
196
|
+
},
|
|
197
|
+
);
|
|
198
|
+
|
|
199
|
+
// Every spread onto one of these elements that the prop pass did not reach
|
|
200
|
+
// (the element writes neither the old name nor, for ChatComposerInput,
|
|
201
|
+
// `triggers`): the spread may carry the removed key, so it gets the TODO.
|
|
202
|
+
for (const [component, props] of COMPONENTS) {
|
|
203
|
+
const sentinel = `__astryx_spread_${component}`;
|
|
204
|
+
root
|
|
205
|
+
.find(j.JSXOpeningElement)
|
|
206
|
+
.filter((/** @type {any} */ path) =>
|
|
207
|
+
(path.node.attributes ?? []).some(
|
|
208
|
+
(/** @type {any} */ attribute) =>
|
|
209
|
+
attribute.type === 'JSXSpreadAttribute',
|
|
210
|
+
),
|
|
211
|
+
)
|
|
212
|
+
.forEach((/** @type {any} */ path) => {
|
|
213
|
+
const attributes = path.node.attributes ?? [];
|
|
214
|
+
const names = new Set(
|
|
215
|
+
attributes
|
|
216
|
+
.filter((/** @type {any} */ a) => a.type === 'JSXAttribute')
|
|
217
|
+
.map((/** @type {any} */ a) => a.name?.name),
|
|
218
|
+
);
|
|
219
|
+
if ([...props].some(name => names.has(name))) return;
|
|
220
|
+
// Let the shared helper decide whether this element is the imported
|
|
221
|
+
// component: give it a sentinel prop to find, then take it back.
|
|
222
|
+
const marker = j.jsxAttribute(j.jsxIdentifier(sentinel));
|
|
223
|
+
path.node.attributes = [...attributes, marker];
|
|
224
|
+
let matched = false;
|
|
225
|
+
transformProp(
|
|
226
|
+
root,
|
|
227
|
+
j,
|
|
228
|
+
{
|
|
229
|
+
matchesImport: source => CORE_IMPORT_RE.test(source),
|
|
230
|
+
components: new Map([[component, new Set([sentinel])]]),
|
|
231
|
+
},
|
|
232
|
+
propPath => {
|
|
233
|
+
if (propPath.node === marker) matched = true;
|
|
234
|
+
},
|
|
235
|
+
);
|
|
236
|
+
path.node.attributes = attributes;
|
|
237
|
+
if (!matched) return;
|
|
238
|
+
const spread = attributes.find(
|
|
239
|
+
(/** @type {any} */ attribute) =>
|
|
240
|
+
attribute.type === 'JSXSpreadAttribute',
|
|
241
|
+
);
|
|
242
|
+
changed =
|
|
243
|
+
addComment(
|
|
244
|
+
j,
|
|
245
|
+
spread,
|
|
246
|
+
component === 'ChatComposerInput'
|
|
247
|
+
? OPAQUE_TRIGGERS_COMMENT
|
|
248
|
+
: SPREAD_COMMENT,
|
|
249
|
+
) || changed;
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
return changed ? root.toSource({quote: 'single'}) : null;
|
|
254
|
+
}
|
|
@@ -18,7 +18,7 @@ export const docs = {
|
|
|
18
18
|
content: [
|
|
19
19
|
{
|
|
20
20
|
type: 'prose',
|
|
21
|
-
text: 'The design system uses a 4px base-unit spacing scale. Component gap props accept step values that map to these tokens. The scale provides fine-grained control at the small end (2px, 4px, 6px) and consistent rhythm at larger sizes (multiples of 4px).',
|
|
21
|
+
text: 'The design system uses a 4px base-unit spacing scale, written in rem so gaps and padding grow with the reader\'s browser font size the way text does: each step is 0.25rem, which is 4px at the default 16px root. Component gap props accept step values that map to these tokens. The scale provides fine-grained control at the small end (2px, 4px, 6px) and consistent rhythm at larger sizes (multiples of 4px).',
|
|
22
22
|
},
|
|
23
23
|
],
|
|
24
24
|
},
|
|
@@ -28,7 +28,7 @@ export const docs = {
|
|
|
28
28
|
content: [
|
|
29
29
|
{
|
|
30
30
|
type: 'prose',
|
|
31
|
-
text: 'Fifteen spacing tokens, from 0px to 48px.',
|
|
31
|
+
text: 'Fifteen spacing tokens, from 0 to 3rem (0px to 48px at the default 16px root).',
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
34
|
type: 'token-ref',
|
|
@@ -35,63 +35,63 @@ export const docs = {
|
|
|
35
35
|
"rows": [
|
|
36
36
|
[
|
|
37
37
|
"--spacing-0",
|
|
38
|
-
"
|
|
38
|
+
"0rem"
|
|
39
39
|
],
|
|
40
40
|
[
|
|
41
41
|
"--spacing-0-5",
|
|
42
|
-
"
|
|
42
|
+
"0.125rem"
|
|
43
43
|
],
|
|
44
44
|
[
|
|
45
45
|
"--spacing-1",
|
|
46
|
-
"
|
|
46
|
+
"0.25rem"
|
|
47
47
|
],
|
|
48
48
|
[
|
|
49
49
|
"--spacing-1-5",
|
|
50
|
-
"
|
|
50
|
+
"0.375rem"
|
|
51
51
|
],
|
|
52
52
|
[
|
|
53
53
|
"--spacing-2",
|
|
54
|
-
"
|
|
54
|
+
"0.5rem"
|
|
55
55
|
],
|
|
56
56
|
[
|
|
57
57
|
"--spacing-3",
|
|
58
|
-
"
|
|
58
|
+
"0.75rem"
|
|
59
59
|
],
|
|
60
60
|
[
|
|
61
61
|
"--spacing-4",
|
|
62
|
-
"
|
|
62
|
+
"1rem"
|
|
63
63
|
],
|
|
64
64
|
[
|
|
65
65
|
"--spacing-5",
|
|
66
|
-
"
|
|
66
|
+
"1.25rem"
|
|
67
67
|
],
|
|
68
68
|
[
|
|
69
69
|
"--spacing-6",
|
|
70
|
-
"
|
|
70
|
+
"1.5rem"
|
|
71
71
|
],
|
|
72
72
|
[
|
|
73
73
|
"--spacing-7",
|
|
74
|
-
"
|
|
74
|
+
"1.75rem"
|
|
75
75
|
],
|
|
76
76
|
[
|
|
77
77
|
"--spacing-8",
|
|
78
|
-
"
|
|
78
|
+
"2rem"
|
|
79
79
|
],
|
|
80
80
|
[
|
|
81
81
|
"--spacing-9",
|
|
82
|
-
"
|
|
82
|
+
"2.25rem"
|
|
83
83
|
],
|
|
84
84
|
[
|
|
85
85
|
"--spacing-10",
|
|
86
|
-
"
|
|
86
|
+
"2.5rem"
|
|
87
87
|
],
|
|
88
88
|
[
|
|
89
89
|
"--spacing-11",
|
|
90
|
-
"
|
|
90
|
+
"2.75rem"
|
|
91
91
|
],
|
|
92
92
|
[
|
|
93
93
|
"--spacing-12",
|
|
94
|
-
"
|
|
94
|
+
"3rem"
|
|
95
95
|
]
|
|
96
96
|
]
|
|
97
97
|
}
|
|
@@ -34,7 +34,7 @@ export default function BottomSheetHeights() {
|
|
|
34
34
|
onOpenChange={isOpen => !isOpen && setHeight(null)}
|
|
35
35
|
label={`${height ?? 'Hug'} height`}
|
|
36
36
|
height={height ?? 'hug'}>
|
|
37
|
-
<VStack gap={4}
|
|
37
|
+
<VStack gap={4}>
|
|
38
38
|
<Heading level={3}>{height ?? 'Hug'} height</Heading>
|
|
39
39
|
<Divider />
|
|
40
40
|
<Text type="body">{descriptions[height ?? 'hug']}</Text>
|
|
@@ -51,7 +51,7 @@ export default function BottomSheetMobileKeyboard() {
|
|
|
51
51
|
event.preventDefault();
|
|
52
52
|
setIsOpen(false);
|
|
53
53
|
}}>
|
|
54
|
-
<VStack gap={4}
|
|
54
|
+
<VStack gap={4}>
|
|
55
55
|
<Heading level={3}>Edit profile</Heading>
|
|
56
56
|
<Divider />
|
|
57
57
|
<Text type="supporting" color="secondary">
|
|
@@ -33,7 +33,7 @@ export default function BottomSheetNoScrim() {
|
|
|
33
33
|
label="Place details"
|
|
34
34
|
height="hug"
|
|
35
35
|
hasScrim={false}>
|
|
36
|
-
<VStack gap={4}
|
|
36
|
+
<VStack gap={4}>
|
|
37
37
|
<Heading level={3}>Central Park</Heading>
|
|
38
38
|
<Divider />
|
|
39
39
|
<Text type="body">
|
|
@@ -122,7 +122,7 @@ export default function BottomSheetSnapPoints() {
|
|
|
122
122
|
label="Directions to the Ferry Building"
|
|
123
123
|
height="tall"
|
|
124
124
|
snapPoints={SNAP_POINTS}>
|
|
125
|
-
<VStack gap={4}
|
|
125
|
+
<VStack gap={4}>
|
|
126
126
|
<VStack gap={1}>
|
|
127
127
|
<Heading level={3}>Ferry Building</Heading>
|
|
128
128
|
<HStack gap={2}>
|
|
@@ -2084,7 +2084,8 @@ function FilterOverflow({
|
|
|
2084
2084
|
isOpen={isOpen}
|
|
2085
2085
|
onOpenChange={setIsOpen}
|
|
2086
2086
|
label={label}
|
|
2087
|
-
height="hug"
|
|
2087
|
+
height="hug"
|
|
2088
|
+
padding={0}>
|
|
2088
2089
|
{body}
|
|
2089
2090
|
</BottomSheet>
|
|
2090
2091
|
</>
|
|
@@ -4087,7 +4088,10 @@ export default function TableFilterTemplate() {
|
|
|
4087
4088
|
isOpen={isCompactSurface && isViewOpen}
|
|
4088
4089
|
onOpenChange={setIsViewOpen}
|
|
4089
4090
|
label="View options"
|
|
4090
|
-
height="tall"
|
|
4091
|
+
height="tall"
|
|
4092
|
+
// The tab strip compensates against a container inset, so the sheet
|
|
4093
|
+
// publishes none and the wrapper below owns the top band.
|
|
4094
|
+
padding={0}>
|
|
4091
4095
|
{/* The inset is the wrapper's, so the strip's own box starts at the tab
|
|
4092
4096
|
row and its scroll arrow lands on the tabs rather than above them. */}
|
|
4093
4097
|
<VStack gap={0} paddingBlockStart={SHEET_TOP_INSET}>
|
|
@@ -4313,7 +4317,8 @@ export default function TableFilterTemplate() {
|
|
|
4313
4317
|
isOpen={isCompactSurface && activeJob != null}
|
|
4314
4318
|
onOpenChange={open => !open && setActiveJobId(null)}
|
|
4315
4319
|
label="Job details"
|
|
4316
|
-
height="tall"
|
|
4320
|
+
height="tall"
|
|
4321
|
+
padding={0}>
|
|
4317
4322
|
{detailBody}
|
|
4318
4323
|
</BottomSheet>
|
|
4319
4324
|
);
|
|
@@ -1773,7 +1773,9 @@ function ComposeWindow({
|
|
|
1773
1773
|
// cheaper answer to the same problem: there is not much to drag out of
|
|
1774
1774
|
// the way in the first place.
|
|
1775
1775
|
height="hug"
|
|
1776
|
-
hasScrim={false}
|
|
1776
|
+
hasScrim={false}
|
|
1777
|
+
// The Layout below owns the inset; the sheet adds none of its own.
|
|
1778
|
+
padding={0}>
|
|
1777
1779
|
{/* The grab handle floats over the top edge, out of flow, about 12px
|
|
1778
1780
|
down. The Layout's own padding is not quite enough to clear it — the
|
|
1779
1781
|
heading came up level with the pill, four pixels under it — so the
|
|
@@ -65,6 +65,18 @@ export const butterTheme = defineTheme({
|
|
|
65
65
|
},
|
|
66
66
|
},
|
|
67
67
|
|
|
68
|
+
// Touch + narrow (Mobile Type, Pin): floor base to the 16px floor and
|
|
69
|
+
// re-derive the ratio so Display 1 keeps its desktop size:
|
|
70
|
+
// ratio' = 1.25 * (14/16)^(1/6) ~= 1.2225. Body 14 -> 16px, display-1 stays 53px.
|
|
71
|
+
adaptations: {
|
|
72
|
+
rules: [
|
|
73
|
+
{
|
|
74
|
+
when: {pointer: 'coarse', width: {below: 'lg'}},
|
|
75
|
+
value: {typography: {scale: {base: 16, ratio: 1.2225}}},
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
},
|
|
79
|
+
|
|
68
80
|
motion: {fast: 125, medium: 300, slow: 700, ratio: 0.75},
|
|
69
81
|
|
|
70
82
|
syntax: butterSyntax,
|
|
@@ -55,6 +55,18 @@ export const chocolateTheme = defineTheme({
|
|
|
55
55
|
},
|
|
56
56
|
},
|
|
57
57
|
|
|
58
|
+
// Touch + narrow (Mobile Type, Pin): floor base to the 16px floor and
|
|
59
|
+
// re-derive the ratio so Display 1 keeps its desktop size:
|
|
60
|
+
// ratio' = 1.2 * (14/16)^(1/6) ~= 1.1736. Body 14 -> 16px, display-1 stays 42px.
|
|
61
|
+
adaptations: {
|
|
62
|
+
rules: [
|
|
63
|
+
{
|
|
64
|
+
when: {pointer: 'coarse', width: {below: 'lg'}},
|
|
65
|
+
value: {typography: {scale: {base: 16, ratio: 1.1736}}},
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
},
|
|
69
|
+
|
|
58
70
|
motion: {fast: 125, medium: 300, slow: 700, ratio: 0.75},
|
|
59
71
|
|
|
60
72
|
syntax: chocolateSyntax,
|
|
@@ -180,20 +180,20 @@ export const matchaTheme = defineTheme({
|
|
|
180
180
|
// =========================================================================
|
|
181
181
|
// Spacing
|
|
182
182
|
// =========================================================================
|
|
183
|
-
'--spacing-0-5': '
|
|
184
|
-
'--spacing-1': '
|
|
185
|
-
'--spacing-1-5': '
|
|
186
|
-
'--spacing-2': '
|
|
187
|
-
'--spacing-3': '
|
|
188
|
-
'--spacing-4': '
|
|
189
|
-
'--spacing-5': '
|
|
190
|
-
'--spacing-6': '
|
|
191
|
-
'--spacing-7': '
|
|
192
|
-
'--spacing-8': '
|
|
193
|
-
'--spacing-9': '
|
|
194
|
-
'--spacing-10': '
|
|
195
|
-
'--spacing-11': '
|
|
196
|
-
'--spacing-12': '
|
|
183
|
+
'--spacing-0-5': '0.1875rem',
|
|
184
|
+
'--spacing-1': '0.375rem',
|
|
185
|
+
'--spacing-1-5': '0.5625rem',
|
|
186
|
+
'--spacing-2': '0.75rem',
|
|
187
|
+
'--spacing-3': '1.125rem',
|
|
188
|
+
'--spacing-4': '1.5rem',
|
|
189
|
+
'--spacing-5': '1.875rem',
|
|
190
|
+
'--spacing-6': '2.25rem',
|
|
191
|
+
'--spacing-7': '2.625rem',
|
|
192
|
+
'--spacing-8': '3rem',
|
|
193
|
+
'--spacing-9': '3.375rem',
|
|
194
|
+
'--spacing-10': '3.75rem',
|
|
195
|
+
'--spacing-11': '4.125rem',
|
|
196
|
+
'--spacing-12': '4.5rem',
|
|
197
197
|
|
|
198
198
|
// =========================================================================
|
|
199
199
|
// Radius — soft and rounded
|
|
@@ -95,6 +95,18 @@ export const neutralTheme = defineTheme({
|
|
|
95
95
|
},
|
|
96
96
|
},
|
|
97
97
|
|
|
98
|
+
// Touch + narrow (Mobile Type, Pin): floor base to the 16px floor and
|
|
99
|
+
// re-derive the ratio so Display 1 keeps its desktop size:
|
|
100
|
+
// ratio' = 1.2 * (14/16)^(1/6) ~= 1.1736. Body 14 -> 16px, display-1 stays 42px.
|
|
101
|
+
adaptations: {
|
|
102
|
+
rules: [
|
|
103
|
+
{
|
|
104
|
+
when: {pointer: 'coarse', width: {below: 'lg'}},
|
|
105
|
+
value: {typography: {scale: {base: 16, ratio: 1.1736}}},
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
},
|
|
109
|
+
|
|
98
110
|
// Motion: snappier than default to match shadcn/Tailwind conventions.
|
|
99
111
|
// Produces: fast-min=95ms, fast=125ms, fast-max=165ms,
|
|
100
112
|
// medium-min=225ms, medium=300ms, medium-max=400ms.
|
|
@@ -81,6 +81,18 @@ export const stoneTheme = defineTheme({
|
|
|
81
81
|
},
|
|
82
82
|
},
|
|
83
83
|
|
|
84
|
+
// Touch + narrow (Mobile Type, Pin): floor base to the 16px floor and
|
|
85
|
+
// re-derive the ratio so Display 1 keeps its desktop size:
|
|
86
|
+
// ratio' = 1.25 * (14/16)^(1/6) ~= 1.2225. Body 14 -> 16px, display-1 stays 53px.
|
|
87
|
+
adaptations: {
|
|
88
|
+
rules: [
|
|
89
|
+
{
|
|
90
|
+
when: {pointer: 'coarse', width: {below: 'lg'}},
|
|
91
|
+
value: {typography: {scale: {base: 16, ratio: 1.2225}}},
|
|
92
|
+
},
|
|
93
|
+
],
|
|
94
|
+
},
|
|
95
|
+
|
|
84
96
|
motion: {fast: 125, medium: 300, slow: 700, ratio: 0.75},
|
|
85
97
|
|
|
86
98
|
syntax: stoneSyntax,
|
|
@@ -63,16 +63,16 @@ export const y2kTheme = defineTheme({
|
|
|
63
63
|
// =========================================================================
|
|
64
64
|
// Spacing — comfortable preset (base=6)
|
|
65
65
|
// =========================================================================
|
|
66
|
-
'--spacing-0-5': '
|
|
67
|
-
'--spacing-1': '
|
|
68
|
-
'--spacing-1-5': '
|
|
69
|
-
'--spacing-2': '
|
|
70
|
-
'--spacing-3': '
|
|
71
|
-
'--spacing-4': '
|
|
72
|
-
'--spacing-5': '
|
|
73
|
-
'--spacing-6': '
|
|
74
|
-
'--spacing-7': '
|
|
75
|
-
'--spacing-8': '
|
|
66
|
+
'--spacing-0-5': '0.1875rem',
|
|
67
|
+
'--spacing-1': '0.375rem',
|
|
68
|
+
'--spacing-1-5': '0.5625rem',
|
|
69
|
+
'--spacing-2': '0.75rem',
|
|
70
|
+
'--spacing-3': '1.125rem',
|
|
71
|
+
'--spacing-4': '1.5rem',
|
|
72
|
+
'--spacing-5': '1.875rem',
|
|
73
|
+
'--spacing-6': '2.25rem',
|
|
74
|
+
'--spacing-7': '2.625rem',
|
|
75
|
+
'--spacing-8': '3rem',
|
|
76
76
|
|
|
77
77
|
// Size — comfortable preset
|
|
78
78
|
'--size-element-sm': '32px',
|
package/assets/theme.template.ts
CHANGED
|
@@ -373,7 +373,7 @@ export const myTheme = defineTheme({
|
|
|
373
373
|
// {
|
|
374
374
|
// // Narrow at every pointer precision.
|
|
375
375
|
// when: {width: {below: 'md'}},
|
|
376
|
-
// value: {tokens: {'--spacing-4': '
|
|
376
|
+
// value: {tokens: {'--spacing-4': '0.75rem'}},
|
|
377
377
|
// },
|
|
378
378
|
// {
|
|
379
379
|
// // Taller controls under a finger or stylus at every width.
|
|
@@ -16,7 +16,7 @@ export const doc = {
|
|
|
16
16
|
summary: 'Diagnose Astryx projects and integration packages',
|
|
17
17
|
description:
|
|
18
18
|
'Runs read-only project health diagnostics by default: Node version, @astryxdesign/core ' +
|
|
19
|
-
'install and version alignment, theme packages, generated app themes when present, earlier copied-theme migration, config, integrations (linked without a config entry, ' +
|
|
19
|
+
'install and version alignment, theme packages, generated app themes when present, earlier copied-theme migration, config, integrations (every one astryx.config names must load, linked without a config entry, ' +
|
|
20
20
|
'provider identity, contribution issues), agent docs, core peer dependencies, package manager, ' +
|
|
21
21
|
"and the docs the CLI reads. It writes nothing, but loading astryx.config runs that file's code. " +
|
|
22
22
|
'The `integration` subcommands provide authoring checks for one integration package.',
|
|
@@ -403,3 +403,36 @@ describe('doctor — text output mirrors the JSON', () => {
|
|
|
403
403
|
}
|
|
404
404
|
}, 60_000);
|
|
405
405
|
});
|
|
406
|
+
|
|
407
|
+
describe('doctor — a configured integration that cannot load', () => {
|
|
408
|
+
it('sets exit code 1 and reports it in the JSON', async () => {
|
|
409
|
+
const dir = fs.mkdtempSync(path.join(process.cwd(), '.astryx-doctor-exit-'));
|
|
410
|
+
const prevCwd = process.cwd();
|
|
411
|
+
const prevExit = process.exitCode;
|
|
412
|
+
process.exitCode = undefined;
|
|
413
|
+
try {
|
|
414
|
+
fs.writeFileSync(path.join(dir, 'package.json'), '{"name":"app"}');
|
|
415
|
+
fs.writeFileSync(
|
|
416
|
+
path.join(dir, 'astryx.config.mjs'),
|
|
417
|
+
"export default { integrations: ['@acme/missing'] };\n",
|
|
418
|
+
);
|
|
419
|
+
const coreDir = path.join(dir, 'node_modules', '@astryxdesign', 'core');
|
|
420
|
+
fs.mkdirSync(coreDir, {recursive: true});
|
|
421
|
+
fs.writeFileSync(
|
|
422
|
+
path.join(coreDir, 'package.json'),
|
|
423
|
+
JSON.stringify({name: '@astryxdesign/core', version: '0.6.3'}),
|
|
424
|
+
);
|
|
425
|
+
process.chdir(dir);
|
|
426
|
+
await createProgram().parseAsync(['node', 'astryx', '--json', 'doctor']);
|
|
427
|
+
expect(process.exitCode).toBe(1);
|
|
428
|
+
const {data} = JSON.parse(logCalls.join('\n'));
|
|
429
|
+
expect(
|
|
430
|
+
data.checks.find(c => c.id === 'configured-integrations'),
|
|
431
|
+
).toMatchObject({status: 'fail'});
|
|
432
|
+
} finally {
|
|
433
|
+
process.chdir(prevCwd);
|
|
434
|
+
process.exitCode = prevExit;
|
|
435
|
+
fs.rmSync(dir, {recursive: true, force: true});
|
|
436
|
+
}
|
|
437
|
+
}, 60_000);
|
|
438
|
+
});
|