@astryxdesign/core 0.7.2-canary.081ccea → 0.7.2-canary.0d5d64e
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/README.md +4 -4
- package/dist/Avatar/Avatar.d.ts.map +1 -1
- package/dist/Avatar/Avatar.js +8 -1
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +2 -103
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts +1 -1
- package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts +1 -1
- package/dist/DropdownMenu/menuRegionStops.d.ts +38 -0
- package/dist/DropdownMenu/menuRegionStops.d.ts.map +1 -0
- package/dist/DropdownMenu/menuRegionStops.js +131 -0
- package/dist/FormLayout/FormLayout.d.ts +5 -4
- package/dist/FormLayout/FormLayout.d.ts.map +1 -1
- package/dist/FormLayout/FormLayoutContext.d.ts +3 -3
- package/dist/FormLayout/FormLayoutContext.js +3 -3
- package/dist/Grid/Grid.d.ts +8 -7
- package/dist/Grid/Grid.d.ts.map +1 -1
- package/dist/Grid/Grid.js +5 -4
- package/dist/Grid/GridSpan.d.ts +1 -1
- package/dist/Markdown/parser.d.ts.map +1 -1
- package/dist/Markdown/parser.js +8 -2
- package/dist/Markdown/plugins/headingLinks.d.ts.map +1 -1
- package/dist/Markdown/plugins/headingLinks.js +9 -1
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +5 -0
- package/dist/Token/Token.js +1 -1
- package/dist/TopNav/TopNavMegaMenu.js +2 -0
- package/dist/TopNav/TopNavMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMenu.js +2 -0
- package/dist/Typeahead/Typeahead.d.ts.map +1 -1
- package/dist/Typeahead/Typeahead.js +14 -2
- package/dist/astryx.css +1 -1
- package/dist/reset.a11y.chromium.spec.js +50 -1
- package/docs.mjs +4 -4
- package/package.json +3 -3
- package/scripts/agent-doc-state.mjs +29 -7
- package/scripts/postinstall.mjs +43 -2
- package/src/Avatar/Avatar.tsx +11 -2
- package/src/BottomSheet/BottomSheet.spec.md +13 -6
- package/src/BottomSheet/BottomSheetSwitcher.spec.md +121 -51
- package/src/ContextMenu/ContextMenu.test.tsx +6 -1
- package/src/DropdownMenu/DropdownMenu.tsx +7 -134
- package/src/DropdownMenu/DropdownMenuCheckboxItem.doc.mjs +1 -1
- package/src/DropdownMenu/DropdownMenuCheckboxItem.tsx +1 -1
- package/src/DropdownMenu/DropdownMenuRadioItem.doc.mjs +1 -1
- package/src/DropdownMenu/DropdownMenuRadioItem.tsx +1 -1
- package/src/DropdownMenu/menuRegionStops.ts +167 -0
- package/src/FormLayout/FormLayout.doc.mjs +6 -3
- package/src/FormLayout/FormLayout.spec.md +192 -0
- package/src/FormLayout/FormLayout.tsx +5 -4
- package/src/FormLayout/FormLayoutContext.ts +3 -3
- package/src/Grid/Grid.doc.mjs +7 -1
- package/src/Grid/Grid.spec.md +93 -113
- package/src/Grid/Grid.test.tsx +22 -0
- package/src/Grid/Grid.tsx +10 -9
- package/src/Grid/GridSpan.doc.mjs +3 -3
- package/src/Grid/GridSpan.tsx +1 -1
- package/src/Indicator/Indicator.doc.mjs +3 -3
- package/src/Markdown/parser.ts +8 -2
- package/src/Markdown/plugins/headingLinks.ts +9 -1
- package/src/PowerSearch/PowerSearch.test.tsx +62 -0
- package/src/PowerSearch/PowerSearch.tsx +9 -0
- package/src/Token/Token.tsx +1 -1
- package/src/Token/__tests__/TokenRemoveTarget.a11y.chromium.spec.ts +86 -0
- package/src/TopNav/TopNavMegaMenu.test.tsx +25 -0
- package/src/TopNav/TopNavMegaMenu.tsx +2 -0
- package/src/TopNav/TopNavMenu.test.tsx +27 -1
- package/src/TopNav/TopNavMenu.tsx +2 -0
- package/src/Typeahead/Typeahead.test.tsx +89 -0
- package/src/Typeahead/Typeahead.tsx +15 -2
- package/src/postinstall.test.mjs +33 -0
- package/src/reset.a11y.chromium.spec.ts +52 -1
- package/src/reset.css +9 -0
- package/src/reset.test.ts +11 -0
- package/src/unicodePropertyEscapes.source-build.test.mjs +69 -0
|
@@ -20,8 +20,16 @@ const identityTransform = markMarkdownTransformTrusted(root => root);
|
|
|
20
20
|
function fail(message) {
|
|
21
21
|
throw new TypeError(`Markdown heading links: ${message}`);
|
|
22
22
|
}
|
|
23
|
+
|
|
24
|
+
// Built at runtime, not written as a literal: for targets without property
|
|
25
|
+
// escapes, or when no browserslist is set, Babel's
|
|
26
|
+
// transform-unicode-property-regex rewrites a `\p{…}` literal, and the copy
|
|
27
|
+
// bundled with Next.js lacks the Unicode data it needs, so a source build fails
|
|
28
|
+
// with "Unknown property". A literal is safe once Next's bundled Babel ships
|
|
29
|
+
// that data.
|
|
30
|
+
const NON_SLUG_CHARACTERS = new RegExp('[^\\p{Letter}\\p{Number}]+', 'gu');
|
|
23
31
|
function headingSlug(value) {
|
|
24
|
-
return value.normalize('NFKC').trim().toLowerCase().replace(/['"]/gu, '').replace(
|
|
32
|
+
return value.normalize('NFKC').trim().toLowerCase().replace(/['"]/gu, '').replace(NON_SLUG_CHARACTERS, '-').replace(/^-+|-+$/gu, '');
|
|
25
33
|
}
|
|
26
34
|
function uniqueHeadingSlug(baseSlug, counts) {
|
|
27
35
|
const fallbackSlug = baseSlug || 'section';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PowerSearch.d.ts","sourceRoot":"","sources":["../../src/PowerSearch/PowerSearch.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,EAOZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,EAGL,KAAK,yBAAyB,EAC/B,MAAM,cAAc,CAAC;AAMtB,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AAEtC,OAAO,KAAK,EAAC,WAAW,EA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,GAAG,MAAM,CAAC;IAC9B,yCAAyC;IACzC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC,6BAA6B;IAC7B,SAAS,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACzC;;;OAGG;IACH,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB;;;OAGG;IACH,UAAU,CAAC,EAAE,qBAAqB,CAAC;CACpC;AAsBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiEG;AACH,wBAAgB,WAAW,CAAC,EAC1B,MAAM,EAAE,UAAU,EAClB,OAAO,EACP,QAAQ,EACR,KAAK,EAAE,cAAc,EACrB,aAAoB,EACpB,WAAW,EAAE,oBAAoB,EACjC,YAAoB,EACpB,QAAe,EACf,UAAkB,EAClB,UAAkB,EAClB,eAAe,EACf,SAAS,EACT,OAAO,EACP,MAAM,EACN,MAAM,EACN,aAA0B,EAC1B,SAAS,EACT,cAAmB,EACnB,oBAAoB,EACpB,gBAA6C,EAC7C,sBAAsB,EAAE,+BAA+B,EACvD,UAAU,EACV,qBAAqB,EACrB,UAAU,EACV,WAAW,EACX,GAAG,EACH,SAAS,EACT,IAAI,EAAE,QAAQ,EACd,aAAa,EAAE,MAAM,EACrB,MAAM,EACN,SAAS,EACT,KAAK,EACL,UAAU,EAAE,kBAAkB,GAC/B,EAAE,gBAAgB,qBA4iBlB;yBA9kBe,WAAW"}
|
|
@@ -661,6 +661,11 @@ export function PowerSearch({
|
|
|
661
661
|
size: size,
|
|
662
662
|
icon: tokenIcon,
|
|
663
663
|
endContent: valueContent,
|
|
664
|
+
onMouseDown: handleClick ? e => {
|
|
665
|
+
// Keep a token press from entering Tokenizer's input-focus
|
|
666
|
+
// redirect. Click still edits/removes; Tab entry is unchanged.
|
|
667
|
+
e.preventDefault();
|
|
668
|
+
} : undefined,
|
|
664
669
|
onClick: handleClick ? e => {
|
|
665
670
|
e.stopPropagation();
|
|
666
671
|
handleClick();
|
package/dist/Token/Token.js
CHANGED
|
@@ -409,6 +409,8 @@ function DrawerMegaMenu({
|
|
|
409
409
|
})]
|
|
410
410
|
}), /*#__PURE__*/_jsx("div", {
|
|
411
411
|
id: `${menuId}-items`,
|
|
412
|
+
"aria-hidden": !isExpanded,
|
|
413
|
+
inert: !isExpanded ? true : undefined,
|
|
412
414
|
...{
|
|
413
415
|
0: {
|
|
414
416
|
className: "xrvj5dj xihq33y xb3r6kr x6kj92 xd00j3c x1eizr8u xlr8y92"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TopNavMenu.d.ts","sourceRoot":"","sources":["../../src/TopNav/TopNavMenu.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,EAKZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AASf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAkN5C;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IAEjB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAMD,MAAM,WAAW,eAAgB,SAAQ,SAAS,CAAC,iBAAiB,CAAC;IACnE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACnC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,KAAK,EAAE,kBAAkB,EAAE,CAAC;IAE5B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,C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GAAG,EACH,KAAK,EACL,KAAK,EACL,KAAW,EACX,SAAe,EACf,MAAM,EACN,SAAS,EACT,KAAK,EACL,OAAO,EAAE,WAAW,EACpB,YAAY,EAAE,gBAAgB,EAC9B,YAAY,EAAE,gBAAgB,EAC9B,GAAG,IAAI,EACR,EAAE,eAAe,4BA8QjB;yBA3Re,UAAU"}
|
|
@@ -309,6 +309,8 @@ export function TopNavMenu({
|
|
|
309
309
|
})]
|
|
310
310
|
}), /*#__PURE__*/_jsx("div", {
|
|
311
311
|
id: `${menuId}-items`,
|
|
312
|
+
"aria-hidden": !drawerExpanded,
|
|
313
|
+
inert: !drawerExpanded ? true : undefined,
|
|
312
314
|
...{
|
|
313
315
|
0: {
|
|
314
316
|
className: "xrvj5dj xihq33y xb3r6kr x6kj92 xd00j3c x1eizr8u xlr8y92"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Typeahead.d.ts","sourceRoot":"","sources":["../../src/Typeahead/Typeahead.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,EAMZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAUf,OAAO,EAGL,KAAK,WAAW,EAKhB,KAAK,kBAAkB,EACxB,MAAM,UAAU,CAAC;AAGlB,OAAO,EAAiB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AAatD,OAAO,EACL,KAAK,mBAAmB,EAEzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,EAAC,cAAc,EAAE,YAAY,EAAC,MAAM,SAAS,CAAC;AAK1D,YAAY,EACV,WAAW,IAAI,eAAe,EAC9B,eAAe,IAAI,mBAAmB,GACvC,MAAM,UAAU,CAAC;AAElB,MAAM,MAAM,aAAa,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE/C,MAAM,WAAW,cAAc,CAAC,CAAC,S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K,IAAI,CAAC;CAC1C;AAuKD,wBAAgB,SAAS,CAAC,CAAC,SAAS,cAAc,EAAE,EAClD,GAAG,EACH,KAAK,EACL,aAAqB,EACrB,WAAW,EACX,UAAkB,EAClB,UAAkB,EAClB,MAAM,EACN,aAA0B,EAC1B,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,KAAK,EACL,QAAQ,EACR,UAAU,EACV,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,eAAe,EACf,UAAkB,EAClB,eAAe,EACf,QAAe,EACf,YAAY,EACZ,IAAI,EAAE,QAAQ,EACd,UAAU,EACV,aAAa,EACb,YAAY,EACZ,SAAS,EACT,KAAK,EACL,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,EAAE,EAAE,MAAM,EACV,kBAAkB,EAAE,mBAAmB,EACvC,GAAG,SAAS,EACb,EAAE,cAAc,CAAC,CAAC,CAAC,qBAiUnB;yBAxWe,SAAS"}
|
|
@@ -285,12 +285,24 @@ export function Typeahead({
|
|
|
285
285
|
}
|
|
286
286
|
}, [onChange]);
|
|
287
287
|
|
|
288
|
-
// Handle clear (explicit X button on token)
|
|
288
|
+
// Handle clear (explicit X button on token). Edit mode copied the label into
|
|
289
|
+
// the base's query, and the base only resets that query on a selection, so
|
|
290
|
+
// clearing the value has to empty it the way entering edit mode filled it
|
|
291
|
+
// (#7038): a native set plus a synthetic input event, which reaches the
|
|
292
|
+
// base's own change handler and its onChangeQuery.
|
|
289
293
|
const handleClear = useCallback(() => {
|
|
294
|
+
const input = inputRef.current;
|
|
295
|
+
if (input && input.value !== '') {
|
|
296
|
+
const nativeInputValueSetter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, 'value')?.set;
|
|
297
|
+
nativeInputValueSetter?.call(input, '');
|
|
298
|
+
input.dispatchEvent(new Event('input', {
|
|
299
|
+
bubbles: true
|
|
300
|
+
}));
|
|
301
|
+
}
|
|
290
302
|
setIsEditing(false);
|
|
291
303
|
setEditingValue(null);
|
|
292
304
|
onChange(null);
|
|
293
|
-
|
|
305
|
+
input?.focus();
|
|
294
306
|
}, [onChange]);
|
|
295
307
|
|
|
296
308
|
// Handle Escape during edit mode — restore token
|
package/dist/astryx.css
CHANGED
|
@@ -2077,7 +2077,7 @@
|
|
|
2077
2077
|
.x1bev2v5[data-astryx-press="on"]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-image:none}
|
|
2078
2078
|
.x524tya[data-astryx-press="fading"]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-image:none}
|
|
2079
2079
|
@starting-style{.x1sopeo2.x1sopeo2:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){grid-template-rows:0fr}}
|
|
2080
|
-
.
|
|
2080
|
+
.xramuyw:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{inset:-4px}
|
|
2081
2081
|
.xarstr8:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{inset:0}
|
|
2082
2082
|
.xxx281p:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{inset:0}
|
|
2083
2083
|
.xht581f:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{inset:var(--_input-clear-hit-inset)}
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* @file reset.a11y.chromium.spec.ts
|
|
5
5
|
* @input packages/core/src/reset.css, alone on a blank Chromium page
|
|
6
6
|
* @output Browser evidence that the reset reaches ::before, ::after,
|
|
7
|
-
* ::placeholder
|
|
7
|
+
* ::placeholder, the search field's cancel button and the dropdown marker
|
|
8
|
+
* of a field with a list
|
|
8
9
|
* @position reset.css integration proof. A pseudo-element inside :where() is
|
|
9
10
|
* invalid, and the forgiving list drops it without an error, so only a
|
|
10
11
|
* shipping engine shows which of the reset's rules still match.
|
|
@@ -13,6 +14,8 @@
|
|
|
13
14
|
import * as fs from 'node:fs';
|
|
14
15
|
import { fileURLToPath } from 'node:url';
|
|
15
16
|
import { expect, test } from '@playwright/test';
|
|
17
|
+
// @ts-expect-error -- pngjs ships no declarations; runtime support is pinned.
|
|
18
|
+
import { PNG } from 'pngjs';
|
|
16
19
|
const RESET_CSS = fs.readFileSync(fileURLToPath(new URL('./reset.css', import.meta.url)), 'utf8');
|
|
17
20
|
|
|
18
21
|
// No Astryx CSS is loaded, so --color-text-secondary is undefined and a
|
|
@@ -149,6 +152,52 @@ test('a search field has no cancel button to clear it', async ({
|
|
|
149
152
|
await page.mouse.click(box.x + box.width - 8, box.y + box.height / 2);
|
|
150
153
|
await expect(query).toHaveValue('query');
|
|
151
154
|
});
|
|
155
|
+
test('the dropdown marker of a field with a list sits in its middle', async ({
|
|
156
|
+
page
|
|
157
|
+
}) => {
|
|
158
|
+
// Chromium shows the marker while the pointer is over the field and draws
|
|
159
|
+
// it as a glyph set on the field's line-height, the 1.5 the reset inherits.
|
|
160
|
+
await page.evaluate(() => {
|
|
161
|
+
const field = document.createElement('input');
|
|
162
|
+
field.id = 'fruit';
|
|
163
|
+
field.setAttribute('list', 'fruits');
|
|
164
|
+
const options = document.createElement('datalist');
|
|
165
|
+
options.id = 'fruits';
|
|
166
|
+
options.append(new Option('Apple'));
|
|
167
|
+
document.body.append(field, options);
|
|
168
|
+
});
|
|
169
|
+
await page.addStyleTag({
|
|
170
|
+
content: `
|
|
171
|
+
#fruit {
|
|
172
|
+
display: block;
|
|
173
|
+
width: 240px;
|
|
174
|
+
padding: 7px 11px;
|
|
175
|
+
border: 1px solid;
|
|
176
|
+
line-height: 1.5;
|
|
177
|
+
}
|
|
178
|
+
`
|
|
179
|
+
});
|
|
180
|
+
const field = page.locator('#fruit');
|
|
181
|
+
await field.hover();
|
|
182
|
+
const png = PNG.sync.read(await field.screenshot({
|
|
183
|
+
caret: 'hide'
|
|
184
|
+
}));
|
|
185
|
+
// The marker is the only ink in the field's last 32px, inside the border.
|
|
186
|
+
const inkRows = [];
|
|
187
|
+
for (let y = 2; y < png.height - 2; y++) {
|
|
188
|
+
for (let x = png.width - 32; x < png.width - 2; x++) {
|
|
189
|
+
const offset = (y * png.width + x) * 4;
|
|
190
|
+
const luminance = (png.data[offset] + png.data[offset + 1] + png.data[offset + 2]) / 3;
|
|
191
|
+
if (luminance < 160) {
|
|
192
|
+
inkRows.push(y);
|
|
193
|
+
break;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
expect(inkRows.length, 'the hovered field shows its marker').toBeGreaterThan(0);
|
|
198
|
+
const markerMiddle = (inkRows[0] + inkRows[inkRows.length - 1] + 1) / 2;
|
|
199
|
+
expect(Math.abs(markerMiddle - png.height / 2)).toBeLessThanOrEqual(1);
|
|
200
|
+
});
|
|
152
201
|
test('a later layer and an unlayered rule still override the reset', async ({
|
|
153
202
|
page
|
|
154
203
|
}) => {
|
package/docs.mjs
CHANGED
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
* ==========================================================================
|
|
14
14
|
* AI AGENT: do NOT guess component APIs or hand-write CSS. Run:
|
|
15
15
|
* npx @astryxdesign/cli init
|
|
16
|
-
* Use the SCOPED name `@astryxdesign/cli` —
|
|
17
|
-
* unrelated package until the CLI is a dependency. Then, per component:
|
|
16
|
+
* Use the SCOPED name `@astryxdesign/cli` — the unscoped `astryx` resolves to
|
|
17
|
+
* an unrelated npm package until the CLI is a dependency. Then, per component:
|
|
18
18
|
* npx @astryxdesign/cli component <Name>
|
|
19
19
|
* npx @astryxdesign/cli component --list
|
|
20
20
|
* ==========================================================================
|
|
@@ -27,8 +27,8 @@ const BANNER = `
|
|
|
27
27
|
|
|
28
28
|
npx @astryxdesign/cli init
|
|
29
29
|
|
|
30
|
-
(Use the scoped name @astryxdesign/cli.
|
|
31
|
-
unrelated package until the CLI is installed as a dependency.)
|
|
30
|
+
(Use the scoped name @astryxdesign/cli. The unscoped name astryx resolves
|
|
31
|
+
to an unrelated npm package until the CLI is installed as a dependency.)
|
|
32
32
|
|
|
33
33
|
init writes the full component guide, page templates, design rules & tokens
|
|
34
34
|
into your AGENTS.md / CLAUDE.md. Then, for any component:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astryxdesign/core",
|
|
3
|
-
"version": "0.7.2-canary.
|
|
3
|
+
"version": "0.7.2-canary.0d5d64e",
|
|
4
4
|
"displayName": "Astryx Core",
|
|
5
5
|
"description": "The component library. Accessible, themeable React components with built-in spacing, dark mode, and StyleX styling.",
|
|
6
6
|
"author": "Meta Open Source",
|
|
@@ -792,8 +792,8 @@
|
|
|
792
792
|
"react-dom": ">=19.0.0"
|
|
793
793
|
},
|
|
794
794
|
"devDependencies": {
|
|
795
|
-
"@astryxdesign/a11y-spec": "0.7.2-canary.
|
|
796
|
-
"@astryxdesign/cli": "0.7.2-canary.
|
|
795
|
+
"@astryxdesign/a11y-spec": "0.7.2-canary.0d5d64e",
|
|
796
|
+
"@astryxdesign/cli": "0.7.2-canary.0d5d64e",
|
|
797
797
|
"@babel/cli": "^7.29.7",
|
|
798
798
|
"@babel/core": "^7.29.7",
|
|
799
799
|
"@babel/preset-react": "^7.29.7",
|
|
@@ -145,15 +145,37 @@ function findRepositoryRoot(start) {
|
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
/**
|
|
148
|
-
* The
|
|
149
|
-
* (
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
* the CLI is installed. Bare `npx astryx` would fetch an unrelated look-alike
|
|
148
|
+
* The invocation the setup nudge falls back to when the CLI's picker
|
|
149
|
+
* (`getCliInvocation`) cannot be loaded. Scoped package form
|
|
150
|
+
* (`@astryxdesign/cli`) — always resolves to us, even before the CLI is
|
|
151
|
+
* installed. npx with the unscoped name would fetch an unrelated look-alike
|
|
153
152
|
* package (see PR #4151).
|
|
154
153
|
*/
|
|
155
|
-
export const
|
|
156
|
-
|
|
154
|
+
export const SETUP_INVOCATION = 'npx @astryxdesign/cli';
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* The one-line next-step every setup layer prints. Kept here so layer 1
|
|
158
|
+
* (core), layer 2 (cli postinstall) and layer 3 (each command) can never word
|
|
159
|
+
* it differently. Each layer passes the stem from the CLI's picker when it can
|
|
160
|
+
* load it.
|
|
161
|
+
*
|
|
162
|
+
* @param {string} [invocation] the CLI invocation stem, e.g. `pnpm exec astryx`
|
|
163
|
+
* @param {{before?: string | null}} [options] `before`: a command to run
|
|
164
|
+
* first, such as the one that adds the CLI to a project that has none
|
|
165
|
+
* @returns {string}
|
|
166
|
+
*/
|
|
167
|
+
export function setupNudge(
|
|
168
|
+
invocation = SETUP_INVOCATION,
|
|
169
|
+
{before = null} = {},
|
|
170
|
+
) {
|
|
171
|
+
const run = before
|
|
172
|
+
? `\`${before}\`, then \`${invocation} init\``
|
|
173
|
+
: `\`${invocation} init\``;
|
|
174
|
+
return `\nNext step: run ${run} to finish setup and install the Astryx agent prompt.\n\n`;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/** The nudge with the fallback invocation. */
|
|
178
|
+
export const SETUP_NUDGE = setupNudge();
|
|
157
179
|
|
|
158
180
|
/**
|
|
159
181
|
* Pure decision: should a postinstall print the setup nudge? Shared by BOTH
|
package/scripts/postinstall.mjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* @file @astryxdesign/core postinstall — nudge to run `
|
|
4
|
+
* @file @astryxdesign/core postinstall — nudge to run `astryx init`, prefixed
|
|
5
|
+
* the way the project's installed CLI prints commands.
|
|
5
6
|
*
|
|
6
7
|
* Enforcement layer 1 of making `astryx init` foolproof: when the design system
|
|
7
8
|
* is installed and the project hasn't run init yet, print a one-line next-step
|
|
@@ -19,6 +20,8 @@
|
|
|
19
20
|
* during npx's fetch, and once set up.
|
|
20
21
|
*/
|
|
21
22
|
|
|
23
|
+
import * as fs from 'node:fs';
|
|
24
|
+
import * as path from 'node:path';
|
|
22
25
|
import {fileURLToPath, pathToFileURL} from 'node:url';
|
|
23
26
|
|
|
24
27
|
const HERE = fileURLToPath(import.meta.url);
|
|
@@ -37,6 +40,39 @@ async function loadContract() {
|
|
|
37
40
|
}
|
|
38
41
|
}
|
|
39
42
|
|
|
43
|
+
/**
|
|
44
|
+
* The stem the project's installed CLI would print, from its picker
|
|
45
|
+
* (`getCliInvocation`). Core cannot depend on the CLI, so this looks for an
|
|
46
|
+
* installed copy from the project upward and imports the picker by path; with
|
|
47
|
+
* no CLI there, or one too old to have the picker, it returns undefined and
|
|
48
|
+
* the contract's scoped fallback is printed. At install time no integration is
|
|
49
|
+
* loaded, so this is the package-manager guess.
|
|
50
|
+
* @param {string} root
|
|
51
|
+
* @returns {Promise<string | undefined>}
|
|
52
|
+
*/
|
|
53
|
+
export async function cliInvocation(root) {
|
|
54
|
+
try {
|
|
55
|
+
let dir = path.resolve(root);
|
|
56
|
+
for (;;) {
|
|
57
|
+
const picker = path.join(
|
|
58
|
+
dir,
|
|
59
|
+
'node_modules/@astryxdesign/cli/foundation/env/package-manager.mjs',
|
|
60
|
+
);
|
|
61
|
+
if (fs.existsSync(picker)) {
|
|
62
|
+
const {getCliInvocation} = await import(pathToFileURL(picker).href);
|
|
63
|
+
return typeof getCliInvocation === 'function'
|
|
64
|
+
? getCliInvocation(root)
|
|
65
|
+
: undefined;
|
|
66
|
+
}
|
|
67
|
+
const parent = path.dirname(dir);
|
|
68
|
+
if (parent === dir) return undefined;
|
|
69
|
+
dir = parent;
|
|
70
|
+
}
|
|
71
|
+
} catch {
|
|
72
|
+
return undefined;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
40
76
|
async function main() {
|
|
41
77
|
const contract = await loadContract();
|
|
42
78
|
if (!contract) return;
|
|
@@ -48,7 +84,12 @@ async function main() {
|
|
|
48
84
|
isSetUp: contract.isAstryxPromptInReach(root),
|
|
49
85
|
})
|
|
50
86
|
) {
|
|
51
|
-
|
|
87
|
+
const invocation = await cliInvocation(root);
|
|
88
|
+
process.stdout.write(
|
|
89
|
+
typeof contract.setupNudge === 'function'
|
|
90
|
+
? contract.setupNudge(invocation)
|
|
91
|
+
: contract.SETUP_NUDGE,
|
|
92
|
+
);
|
|
52
93
|
}
|
|
53
94
|
}
|
|
54
95
|
|
package/src/Avatar/Avatar.tsx
CHANGED
|
@@ -387,9 +387,18 @@ export interface AvatarProps extends BaseProps<HTMLDivElement> {
|
|
|
387
387
|
/**
|
|
388
388
|
* A character that can stand for a word in initials: a letter, a digit, or an
|
|
389
389
|
* emoji. Punctuation and other symbols, such as `(`, `"` or `-`, cannot.
|
|
390
|
+
*
|
|
391
|
+
* Built at runtime, not written as a literal: for targets without property
|
|
392
|
+
* escapes, or when no browserslist is set, Babel's
|
|
393
|
+
* transform-unicode-property-regex rewrites a `\p{…}` literal, and the copy
|
|
394
|
+
* bundled with Next.js lacks the Unicode data it needs, so a source build fails
|
|
395
|
+
* with "Unknown property". A literal is safe once Next's bundled Babel ships
|
|
396
|
+
* that data.
|
|
390
397
|
*/
|
|
391
|
-
const INITIAL_CHARACTER =
|
|
392
|
-
|
|
398
|
+
const INITIAL_CHARACTER = new RegExp(
|
|
399
|
+
'[\\p{L}\\p{N}\\p{Extended_Pictographic}\\p{Regional_Indicator}]',
|
|
400
|
+
'u',
|
|
401
|
+
);
|
|
393
402
|
|
|
394
403
|
/**
|
|
395
404
|
* The first character of a word that can stand for it in initials, skipping
|
|
@@ -15,6 +15,7 @@ verified_by:
|
|
|
15
15
|
packages/core/src/BottomSheet/BottomSheet.test.tsx,
|
|
16
16
|
packages/core/src/BottomSheet/BottomSheetPanel.test.tsx,
|
|
17
17
|
packages/core/src/BottomSheet/BottomSheetKeyboard.test.tsx,
|
|
18
|
+
packages/core/src/BottomSheet/__tests__/BottomSheetNativeModal.a11y.browser.spec.ts,
|
|
18
19
|
packages/core/src/BottomSheet/__tests__/BottomSheetKeyboard.a11y.browser.spec.ts,
|
|
19
20
|
apps/storybook/stories/BottomSheet.stories.tsx,
|
|
20
21
|
scripts/check-knowledge.mjs,
|
|
@@ -93,14 +94,17 @@ Consumer migration instructions belong in consumer docs and release notes.
|
|
|
93
94
|
- The Content area's container padding, published per
|
|
94
95
|
`architecture:container-padding`.
|
|
95
96
|
- Standalone sheet presentation, including its optional native-dialog Scrim.
|
|
97
|
+
- The native dialog every sheet renders, standalone or switcher-managed
|
|
98
|
+
(`component:BottomSheetSwitcher` DEC-1's decided structure).
|
|
96
99
|
|
|
97
100
|
**Does not own / non-goals**
|
|
98
101
|
|
|
99
102
|
- Caller-provided content rendered inside the Content area.
|
|
100
103
|
- A separate target for Content area, Handle, or Scrim; none exists on current
|
|
101
104
|
`main`.
|
|
102
|
-
-
|
|
103
|
-
participates in
|
|
105
|
+
- The presentation lifecycle of its dialog and the flow's scrim ownership when
|
|
106
|
+
the sheet participates in a BottomSheetSwitcher — owned by BottomSheetSwitcher
|
|
107
|
+
(`component:BottomSheetSwitcher` DEC-1's decided structure).
|
|
104
108
|
- Shared layer hosting or dismissal policy.
|
|
105
109
|
|
|
106
110
|
## Public concepts
|
|
@@ -128,8 +132,10 @@ in `BottomSheet.doc.mjs`.
|
|
|
128
132
|
- A standalone modal sheet renders Sheet panel, Content area, Handle, and Scrim.
|
|
129
133
|
- A standalone non-modal sheet renders Sheet panel, Content area, and Handle
|
|
130
134
|
without a Scrim.
|
|
131
|
-
- A switcher-managed sheet renders the same panel anatomy while
|
|
132
|
-
BottomSheetSwitcher
|
|
135
|
+
- A switcher-managed sheet renders the same panel anatomy in its own dialog while
|
|
136
|
+
BottomSheetSwitcher coordinates that dialog's lifecycle and the flow's one Scrim
|
|
137
|
+
(`component:BottomSheetSwitcher` DEC-1's decided structure, not shipped
|
|
138
|
+
anatomy).
|
|
133
139
|
|
|
134
140
|
### Transformation and precedence order
|
|
135
141
|
|
|
@@ -184,7 +190,7 @@ a decision that they must remain unthemeable.
|
|
|
184
190
|
},
|
|
185
191
|
"Scrim": {
|
|
186
192
|
"none": {
|
|
187
|
-
"reason": "reachability-gap: No BottomSheet public target reaches the native dialog backdrop or switcher-
|
|
193
|
+
"reason": "reachability-gap: No BottomSheet public target reaches the native dialog backdrop, standalone or switcher-coordinated."
|
|
188
194
|
}
|
|
189
195
|
}
|
|
190
196
|
}
|
|
@@ -210,7 +216,8 @@ a decision that they must remain unthemeable.
|
|
|
210
216
|
| ------------------- | -------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------- | --------------------------------- |
|
|
211
217
|
| FR1 | `BottomSheet.test.tsx` render, content, Handle, and scrim behavior suites | Modal, non-modal, and switcher presentations | Removing a documented part fails existing content, structure, or dismissal assertions. | `audit:BottomSheet/anatomy` |
|
|
212
218
|
| FR2 | Panel target assertion, source inspection, and theming target inventories | Sheet panel, Content area, Handle, and Scrim | Removing the panel target or documenting an unshipped child target fails evidence or inventory. | `audit:BottomSheet/theming` |
|
|
213
|
-
| FR3, AR1–AR2 | `BottomSheetKeyboard.test.tsx`; `BottomSheetKeyboard.a11y.browser.spec.ts`; open Storybook stories | fitting/overflow, plain text, usable/unusable/dynamic descendants, focus | Missing/duplicate keyboard access, stale ownership, focus movement, or broken content-box layout fails. | `audit:BottomSheet/accessibility` |
|
|
219
|
+
| FR3, AR1–AR2 | `BottomSheetKeyboard.test.tsx`; `BottomSheetKeyboard.a11y.browser.spec.ts`; open Storybook stories | fitting/overflow, plain text, usable/unusable/dynamic descendants, focus | Missing/duplicate keyboard access, stale ownership, focus movement, or broken content-box layout fails. | `audit:BottomSheet/accessibility` |
|
|
220
|
+
| Layout evidence | `BottomSheetPanel.test.tsx` | Floating Handle and scrolling Content area | Reordering or merging the stable parts fails existing panel structure and style assertions. | `audit:BottomSheet/anatomy` |
|
|
214
221
|
| FR4 | `BottomSheetPanel.test.tsx` container padding tests; `derivedVarRegistry.test.ts` | default, `padding` prop, theme `padding`, lone padded Section child | The published inset differs from the applied padding, or a lone padded Section changes geometry. | `audit:BottomSheet/anatomy` |
|
|
215
222
|
| Theming anatomy map | `scripts/check-knowledge.mjs` | Canonical anatomy and current target inventory | Missing, extra, prefixed, stale, or multiply assigned mappings fail repository validation. | `audit:BottomSheet/theming` |
|
|
216
223
|
|