@astryxdesign/core 0.6.3-canary.22be8db → 0.6.3-canary.2bb99ed
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/dist/Chat/ChatComposerInput.d.ts.map +1 -1
- package/dist/Chat/ChatComposerInput.js +1 -1
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts +0 -2
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuItem.d.ts +1 -8
- package/dist/DropdownMenu/DropdownMenuItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuItem.js +1 -3
- package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts +0 -2
- package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts.map +1 -1
- package/dist/DropdownMenu/MenuBottomSheetActionList.d.ts.map +1 -1
- package/dist/DropdownMenu/MenuBottomSheetActionList.js +2 -6
- package/dist/astryx.css +1 -1
- package/dist/theme/defineTheme.d.ts +0 -3
- package/dist/theme/defineTheme.d.ts.map +1 -1
- package/dist/theme/defineTheme.js +1 -4
- package/dist/theme/generateThemeRules.d.ts +0 -2
- package/dist/theme/generateThemeRules.d.ts.map +1 -1
- package/dist/theme/generateThemeRules.js +1 -3
- package/dist/theme/themeAdaptations.d.ts +3 -5
- package/dist/theme/themeAdaptations.d.ts.map +1 -1
- package/dist/theme/themeAdaptations.js +5 -33
- package/package.json +3 -3
- package/src/Chat/ChatComposerInput.tsx +1 -12
- package/src/Collapsible/Collapsible.spec.md +7 -9
- package/src/Collapsible/Collapsible.test.tsx +78 -0
- package/src/Collapsible/CollapsibleGroup.test.tsx +83 -0
- package/src/DropdownMenu/DropdownMenu.test.tsx +0 -51
- package/src/DropdownMenu/DropdownMenuCheckboxItem.doc.mjs +0 -8
- package/src/DropdownMenu/DropdownMenuCheckboxItem.tsx +0 -2
- package/src/DropdownMenu/DropdownMenuItem.doc.mjs +0 -12
- package/src/DropdownMenu/DropdownMenuItem.tsx +0 -9
- package/src/DropdownMenu/DropdownMenuRadioItem.doc.mjs +0 -8
- package/src/DropdownMenu/DropdownMenuRadioItem.tsx +0 -2
- package/src/DropdownMenu/DropdownMenuSelectable.test.tsx +0 -40
- package/src/DropdownMenu/MenuBottomSheetActionList.tsx +3 -9
- package/src/theme/defineTheme.ts +0 -4
- package/src/theme/generateThemeRules.ts +0 -3
- package/src/theme/themeAdaptations.test.ts +1 -211
- package/src/theme/themeAdaptations.ts +4 -50
- package/src/Collapsible/__tests__/Collapsible.a11y.chromium.spec.ts +0 -182
- package/src/Collapsible/__tests__/Collapsible.a11y.states.ts +0 -117
- package/src/Collapsible/__tests__/Collapsible.a11y.test.tsx +0 -140
- package/src/NumberInput/__tests__/NumberInput.a11y.chromium.spec.ts +0 -91
- package/src/NumberInput/__tests__/NumberInput.a11y.renders.tsx +0 -77
- package/src/NumberInput/__tests__/NumberInput.a11y.states.ts +0 -117
- package/src/NumberInput/__tests__/NumberInput.a11y.test.tsx +0 -98
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatComposerInput.d.ts","sourceRoot":"","sources":["../../src/Chat/ChatComposerInput.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAML,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,cAAc,EAEpB,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,cAAc,EAAE,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAqBrE,OAAO,EAEL,KAAK,yBAAyB,EAC/B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAQ,KAAK,UAAU,EAAC,MAAM,UAAU,CAAC;AAShD,mEAAmE;AACnE,MAAM,WAAW,uBAAuB;IACtC,iEAAiE;IACjE,WAAW,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK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AAE,sBAAsB,+BAgjB9D;yBAhjBe,iBAAiB;;;AAwjBjC,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,6BAA6B,+BAkB5E;yBAlBe,wBAAwB"}
|
|
@@ -60,8 +60,6 @@ export interface DropdownMenuCheckboxItemProps extends Omit<BaseProps, 'onChange
|
|
|
60
60
|
* @default false
|
|
61
61
|
*/
|
|
62
62
|
hasCloseOnSelect?: boolean;
|
|
63
|
-
/** Ref forwarded to the row root — the element carrying `role="menuitemcheckbox"`. */
|
|
64
|
-
ref?: React.Ref<HTMLElement>;
|
|
65
63
|
/**
|
|
66
64
|
* Content to render after the label and description, such as a keyboard
|
|
67
65
|
* shortcut hint or badge.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenuCheckboxItem.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenuCheckboxItem.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAiC,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAErE,OAAO,EAAiB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AAOtD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AA4C5C,MAAM,WAAW,6BAA8B,SAAQ,IAAI,CACzD,SAAS,EACT,UAAU,GAAG,MAAM,GAAG,cAAc,GAAG,UAAU,CAClD;IACC;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;IACjB;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC5B;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B
|
|
1
|
+
{"version":3,"file":"DropdownMenuCheckboxItem.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenuCheckboxItem.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAiC,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAErE,OAAO,EAAiB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AAOtD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AA4C5C,MAAM,WAAW,6BAA8B,SAAQ,IAAI,CACzD,SAAS,EACT,UAAU,GAAG,MAAM,GAAG,cAAc,GAAG,UAAU,CAClD;IACC;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;IACjB;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC5B;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;OAGG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,wBAAwB,CAAC,EACvC,KAAK,EACL,WAAW,EACX,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,UAAkB,EAClB,gBAAwB,EACxB,UAAU,EACV,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,IAAI,EACR,EAAE,6BAA6B,+BA0D/B;yBAvEe,wBAAwB"}
|
|
@@ -47,13 +47,6 @@ export interface DropdownMenuItemProps extends Pick<BaseProps, 'xstyle' | 'class
|
|
|
47
47
|
* the error color for dangerous actions (e.g. Delete). @default 'default'
|
|
48
48
|
*/
|
|
49
49
|
variant?: 'default' | 'destructive';
|
|
50
|
-
/**
|
|
51
|
-
* Ref forwarded to the row root — the element carrying `role="menuitem"`.
|
|
52
|
-
* Lets a caller register the row with an element-keyed observer (an
|
|
53
|
-
* IntersectionObserver for an impression, a measurement, a debug overlay)
|
|
54
|
-
* the way `Item` and `DropdownMenuDivider` already allow.
|
|
55
|
-
*/
|
|
56
|
-
ref?: React.Ref<HTMLElement>;
|
|
57
50
|
}
|
|
58
51
|
/**
|
|
59
52
|
* An interactive dropdown menu item with icon, label, and optional description.
|
|
@@ -69,7 +62,7 @@ export interface DropdownMenuItemProps extends Pick<BaseProps, 'xstyle' | 'class
|
|
|
69
62
|
* </DropdownMenu>
|
|
70
63
|
* ```
|
|
71
64
|
*/
|
|
72
|
-
export declare function DropdownMenuItem({ icon, label, description, onClick, isDisabled, endContent, hasCloseOnSelect, variant, xstyle, className, style,
|
|
65
|
+
export declare function DropdownMenuItem({ icon, label, description, onClick, isDisabled, endContent, hasCloseOnSelect, variant, xstyle, className, style, }: DropdownMenuItemProps): import("react").JSX.Element;
|
|
73
66
|
export declare namespace DropdownMenuItem {
|
|
74
67
|
var displayName: string;
|
|
75
68
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenuItem.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenuItem.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAiC,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAErE,OAAO,EAAiB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AAStD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAuD5C,MAAM,WAAW,qBAAsB,SAAQ,IAAI,CACjD,SAAS,EACT,QAAQ,GAAG,WAAW,GAAG,OAAO,CACjC;IACC,wCAAwC;IACxC,I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,SAAS,GAAG,aAAa,CAAC;CACrC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,IAAI,EACJ,KAAK,EACL,WAAW,EACX,OAAO,EACP,UAAkB,EAClB,UAAU,EACV,gBAAuB,EACvB,OAAmB,EACnB,MAAM,EACN,SAAS,EACT,KAAK,GACN,EAAE,qBAAqB,+BA0DvB;yBAtEe,gBAAgB"}
|
|
@@ -100,8 +100,7 @@ export function DropdownMenuItem({
|
|
|
100
100
|
variant = 'default',
|
|
101
101
|
xstyle,
|
|
102
102
|
className,
|
|
103
|
-
style
|
|
104
|
-
ref
|
|
103
|
+
style
|
|
105
104
|
}) {
|
|
106
105
|
const ctx = useDropdownMenuContext();
|
|
107
106
|
const menuSize = ctx?.menuSize ?? 'md';
|
|
@@ -117,7 +116,6 @@ export function DropdownMenuItem({
|
|
|
117
116
|
const handlePointerMove = useCallback(e => focusMenuItemOnHover(e, isDisabled), [isDisabled]);
|
|
118
117
|
const isDestructive = variant === 'destructive';
|
|
119
118
|
return /*#__PURE__*/_jsx(Item, {
|
|
120
|
-
ref: ref,
|
|
121
119
|
role: "menuitem",
|
|
122
120
|
tabIndex: isDisabled ? undefined : -1,
|
|
123
121
|
onPointerMove: handlePointerMove,
|
|
@@ -50,8 +50,6 @@ export interface DropdownMenuRadioItemProps extends Omit<BaseProps, 'role' | 'ar
|
|
|
50
50
|
* metadata.
|
|
51
51
|
*/
|
|
52
52
|
endContent?: ReactNode;
|
|
53
|
-
/** Ref forwarded to the row root — the element carrying `role="menuitemradio"`. */
|
|
54
|
-
ref?: React.Ref<HTMLElement>;
|
|
55
53
|
}
|
|
56
54
|
/**
|
|
57
55
|
* A single option in a DropdownMenuRadioGroup (role="menuitemradio").
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenuRadioItem.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenuRadioItem.tsx"],"names":[],"mappings":"AAIA;;;;;;;;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rB;;;OAGG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;CACxB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,KAAK,EACL,KAAK,EACL,WAAW,EACX,IAAI,EACJ,UAAkB,EAClB,UAAU,EACV,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,IAAI,EACR,EAAE,0BAA0B,+BAmE5B;yBA9Ee,qBAAqB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuBottomSheetActionList.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/MenuBottomSheetActionList.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAC,oBAAoB,EAAE,kBAAkB,EAAC,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"MenuBottomSheetActionList.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/MenuBottomSheetActionList.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAC,oBAAoB,EAAE,kBAAkB,EAAC,MAAM,gBAAgB,CAAC;AAyB7E,wBAAgB,yBAAyB,CAAC,EACxC,KAAK,EACL,QAAQ,EACR,aAAa,GACd,EAAE;IACD,KAAK,EAAE,kBAAkB,EAAE,CAAC;IAC5B,QAAQ,EAAE,CAAC,IAAI,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAC/C,aAAa,EAAE,CAAC,IAAI,EAAE,oBAAoB,KAAK,IAAI,CAAC;CACrD,+BAqFA;yBA7Fe,yBAAyB"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @file MenuBottomSheetActionList.tsx
|
|
7
7
|
* @input Uses menu data entries and callbacks for selection and drill-in
|
|
8
|
-
* @output Internal touch-friendly action list
|
|
8
|
+
* @output Internal touch-friendly action list shared by DropdownMenu and ContextMenu
|
|
9
9
|
* @position Shared implementation for menu bottom-sheet presentations
|
|
10
10
|
*/
|
|
11
11
|
import * as stylex from '@stylexjs/stylex';
|
|
@@ -28,10 +28,6 @@ const styles = {
|
|
|
28
28
|
divider: {
|
|
29
29
|
kqGvvJ: "xsq74q5",
|
|
30
30
|
$$css: true
|
|
31
|
-
},
|
|
32
|
-
sectionHeading: {
|
|
33
|
-
kg3NbH: "xrrkdod",
|
|
34
|
-
$$css: true
|
|
35
31
|
}
|
|
36
32
|
};
|
|
37
33
|
function getItemKey(item, index) {
|
|
@@ -88,6 +84,7 @@ export function MenuBottomSheetActionList({
|
|
|
88
84
|
}
|
|
89
85
|
if ('type' in option && option.type === 'section') {
|
|
90
86
|
return /*#__PURE__*/_jsx("li", {
|
|
87
|
+
role: "presentation",
|
|
91
88
|
...{
|
|
92
89
|
className: "x3ct3a4"
|
|
93
90
|
},
|
|
@@ -99,7 +96,6 @@ export function MenuBottomSheetActionList({
|
|
|
99
96
|
},
|
|
100
97
|
children: [option.title && /*#__PURE__*/_jsx(Heading, {
|
|
101
98
|
level: 4,
|
|
102
|
-
xstyle: styles.sectionHeading,
|
|
103
99
|
children: option.title
|
|
104
100
|
}), /*#__PURE__*/_jsx(List, {
|
|
105
101
|
density: "spacious",
|
package/dist/astryx.css
CHANGED
|
@@ -1681,10 +1681,10 @@
|
|
|
1681
1681
|
.x1ov3xa9:not(#\#):not(#\#):not(#\#):not(#\#){min-height:100dvh}
|
|
1682
1682
|
.xz65tgg:not(#\#):not(#\#):not(#\#):not(#\#){min-height:200px}
|
|
1683
1683
|
.xisnujt:not(#\#):not(#\#):not(#\#):not(#\#){min-height:20px}
|
|
1684
|
+
.xe0957l:not(#\#):not(#\#):not(#\#):not(#\#){min-height:22px}
|
|
1684
1685
|
.xjwf9q1:not(#\#):not(#\#):not(#\#):not(#\#){min-height:24px}
|
|
1685
1686
|
.xe0p6wg:not(#\#):not(#\#):not(#\#):not(#\#){min-height:28px}
|
|
1686
1687
|
.x21xpn4:not(#\#):not(#\#):not(#\#):not(#\#){min-height:32px}
|
|
1687
|
-
.xf5fbcm:not(#\#):not(#\#):not(#\#):not(#\#){min-height:calc(22px + 2 * var(--spacing-1))}
|
|
1688
1688
|
.x121v3j4:not(#\#):not(#\#):not(#\#):not(#\#){min-height:min-content}
|
|
1689
1689
|
.x1xf4nls:not(#\#):not(#\#):not(#\#):not(#\#){min-height:var(--size-element-lg)}
|
|
1690
1690
|
.x1uogy3y:not(#\#):not(#\#):not(#\#):not(#\#){min-height:var(--size-element-md)}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* defineTheme — Create an Astryx theme from a flat token map.
|
|
3
3
|
*
|
|
4
|
-
* Adaptations resolve against the effective root axes and components, retaining
|
|
5
|
-
* authored component pins without repeating root typography defaults.
|
|
6
|
-
*
|
|
7
4
|
* Two distribution modes:
|
|
8
5
|
* - Unbuilt: Theme generates CSS and injects a <style> tag at runtime
|
|
9
6
|
* - Built: `astryx theme build` pre-compiles to a CSS file; Theme just
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defineTheme.d.ts","sourceRoot":"","sources":["../../src/theme/defineTheme.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"defineTheme.d.ts","sourceRoot":"","sources":["../../src/theme/defineTheme.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,KAAK,EAAC,QAAQ,EAAE,kBAAkB,EAAC,MAAM,4BAA4B,CAAC;AAE7E;;;GAGG;AACH,KAAK,kBAAkB,GAAG,OAAO,CAC/B,MAAM,CAAC,QAAQ,GAAG,kBAAkB,EAAE,SAAS,CAAC,CACjD,CAAC;AACF,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,SAAS,CAAC;AAC9C,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACrB,MAAM,iB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C1C,MAAM,EAAE,mBAAmB,CAAC;CAC7B,CAAC;AAMF,qFAAqF;AACrF,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAehD,CAAC;AAwBF;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,oBAAoB,CA6GzE;AAMD,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,kBAAkB,EAClB,qBAAqB,EACrB,gBAAgB,EAChB,KAAK,eAAe,EACpB,KAAK,cAAc,GACpB,MAAM,sBAAsB,CAAC;AAM9B,2DAA2D;AAC3D,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,YAAY,CAQpE"}
|
|
@@ -3,9 +3,6 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* defineTheme — Create an Astryx theme from a flat token map.
|
|
5
5
|
*
|
|
6
|
-
* Adaptations resolve against the effective root axes and components, retaining
|
|
7
|
-
* authored component pins without repeating root typography defaults.
|
|
8
|
-
*
|
|
9
6
|
* Two distribution modes:
|
|
10
7
|
* - Unbuilt: Theme generates CSS and injects a <style> tag at runtime
|
|
11
8
|
* - Built: `astryx theme build` pre-compiles to a CSS file; Theme just
|
|
@@ -236,7 +233,7 @@ export function defineTheme(input) {
|
|
|
236
233
|
// the root scale while preserving the base rule's authored intent.
|
|
237
234
|
const __axes = resolveThemeGenerativeAxes(base?.__axes, ownAxes);
|
|
238
235
|
const __adaptations = normalizeThemeAdaptations(input.name, base?.__adaptations, input.adaptations);
|
|
239
|
-
const __adaptationRules = resolveThemeAdaptationRules(input.name, __adaptations, __axes, tokens, localTokenContract?.localTokens
|
|
236
|
+
const __adaptationRules = resolveThemeAdaptationRules(input.name, __adaptations, __axes, tokens, localTokenContract?.localTokens);
|
|
240
237
|
|
|
241
238
|
// Icons — input icons override base icons
|
|
242
239
|
const icons = input.icons && base?.icons ? {
|
|
@@ -4,8 +4,6 @@
|
|
|
4
4
|
* Shared logic for generating CSS rules from a resolved theme definition,
|
|
5
5
|
* including one component-leaf lowering path for root, adaptation, and
|
|
6
6
|
* media-surface values plus condition-correct Heading weight precedence guards.
|
|
7
|
-
* Built adaptation metadata resolves against the same root component defaults
|
|
8
|
-
* as defineTheme, so scale-only rules do not reset authored component styles.
|
|
9
7
|
* Used by both the runtime path (Theme injects <style>) and the build
|
|
10
8
|
* path (`astryx theme build` pre-compiles to CSS files).
|
|
11
9
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateThemeRules.d.ts","sourceRoot":"","sources":["../../src/theme/generateThemeRules.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"generateThemeRules.d.ts","sourceRoot":"","sources":["../../src/theme/generateThemeRules.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAC,iBAAiB,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;AAqHnE;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,+EAA+E;IAC/E,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,kFAAkF;IAClF,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAmUD;;;;;GAKG;AACH;;;;;;;GAOG;AACH,MAAM,WAAW,eAAe;IAC9B,sCAAsC;IACtC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,yCAAyC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,0CAA0C;IAC1C,UAAU,CAAC,EAAE,iBAAiB,CAAC;CAChC;AAED,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,eAAe,EACtB,QAAQ,CAAC,EAAE,MAAM,EAAE,GAClB,MAAM,EAAE,CAiDV;AAoZD;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,YAAY,EACnB,QAAQ,CAAC,EAAE,MAAM,EAAE,GAClB,eAAe,CAejB;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,YAAY,EACnB,QAAQ,CAAC,EAAE,MAAM,EAAE,GAClB,MAAM,CAmDR;AA+CD;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,YAAY,EACnB,QAAQ,CAAC,EAAE,MAAM,EAAE,GAClB,cAAc,CAoFhB;AAOD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,4BAA4B,IAAI,MAAM,CAKrD;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,YAAY,EACnB,QAAQ,CAAC,EAAE,MAAM,EAAE,GAClB,cAAc,CAoChB"}
|
|
@@ -6,8 +6,6 @@
|
|
|
6
6
|
* Shared logic for generating CSS rules from a resolved theme definition,
|
|
7
7
|
* including one component-leaf lowering path for root, adaptation, and
|
|
8
8
|
* media-surface values plus condition-correct Heading weight precedence guards.
|
|
9
|
-
* Built adaptation metadata resolves against the same root component defaults
|
|
10
|
-
* as defineTheme, so scale-only rules do not reset authored component styles.
|
|
11
9
|
* Used by both the runtime path (Theme injects <style>) and the build
|
|
12
10
|
* path (`astryx theme build` pre-compiles to CSS files).
|
|
13
11
|
*
|
|
@@ -843,7 +841,7 @@ export function generateAdaptationCSS(theme, warnings) {
|
|
|
843
841
|
// Validate retained metadata even when it has no rules (and therefore emits
|
|
844
842
|
// no CSS): width points remain observable through AppShell and inheritance.
|
|
845
843
|
const normalizedAdaptations = theme.__adaptations === undefined ? undefined : normalizeThemeAdaptations(theme.name, theme.__adaptations, undefined);
|
|
846
|
-
const rules = theme.__adaptationRules ?? (normalizedAdaptations ? resolveThemeAdaptationRules(theme.name, normalizedAdaptations, theme.__axes ?? {}, theme.tokens, theme.localTokens
|
|
844
|
+
const rules = theme.__adaptationRules ?? (normalizedAdaptations ? resolveThemeAdaptationRules(theme.name, normalizedAdaptations, theme.__axes ?? {}, theme.tokens, theme.localTokens) : undefined);
|
|
847
845
|
if (!rules || rules.length === 0) {
|
|
848
846
|
return {
|
|
849
847
|
prose: '',
|
|
@@ -7,10 +7,8 @@
|
|
|
7
7
|
* Adaptations are deliberately closed and ordered. Width points are fixed names,
|
|
8
8
|
* sparse rules and reserved token routing are rejected during normalization,
|
|
9
9
|
* condition fields are ANDed, and rule order is the precedence model: every
|
|
10
|
-
* matching rule writes after the root theme and later matching writes win.
|
|
11
|
-
*
|
|
12
|
-
* authored rule leaves and generated token writes retain their cascade order.
|
|
13
|
-
* Token cycles are judged after each reachable ordered cascade is complete.
|
|
10
|
+
* matching rule writes after the root theme and later matching writes win. Token
|
|
11
|
+
* cycles are judged only after each reachable ordered cascade is complete.
|
|
14
12
|
*
|
|
15
13
|
* SYNC: When modified, update:
|
|
16
14
|
* - /packages/core/src/theme/defineTheme.ts (`DefineThemeInput.adaptations`)
|
|
@@ -125,5 +123,5 @@ export declare function normalizeThemeAdaptations(themeName: string, inherited:
|
|
|
125
123
|
*/
|
|
126
124
|
export declare function resolveThemeGenerativeAxes(inherited: ThemeGenerativeAxes | undefined, own: ThemeGenerativeAxes): ThemeGenerativeAxes;
|
|
127
125
|
/** Lower ordered normalized rules to concrete CSS writes. */
|
|
128
|
-
export declare function resolveThemeAdaptationRules(themeName: string, adaptations: NormalizedThemeAdaptations, axes: ThemeGenerativeAxes, rootTokens: Record<string, string>, rootLocalTokens: Record<string, string> | undefined
|
|
126
|
+
export declare function resolveThemeAdaptationRules(themeName: string, adaptations: NormalizedThemeAdaptations, axes: ThemeGenerativeAxes, rootTokens: Record<string, string>, rootLocalTokens: Record<string, string> | undefined): ResolvedThemeAdaptationRule[] | undefined;
|
|
129
127
|
//# sourceMappingURL=themeAdaptations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"themeAdaptations.d.ts","sourceRoot":"","sources":["../../src/theme/themeAdaptations.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"themeAdaptations.d.ts","sourceRoot":"","sources":["../../src/theme/themeAdaptations.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAC,iBAAiB,EAAE,SAAS,EAAE,UAAU,EAAC,MAAM,eAAe,CAAC;AAC5E,OAAO,KAAK,EAAC,gBAAgB,EAAiB,MAAM,SAAS,CAAC;AAC9D,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;AAQzD,wDAAwD;AACxD,eAAO,MAAM,sBAAsB,0CAA2C,CAAC;AAE/E,gDAAgD;AAChD,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1E,+EAA+E;AAC/E,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;AAEnE,qEAAqE;AACrE,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,gBAAgB,CAO7D,CAAC;AAEL,yEAAyE;AACzE,MAAM,WAAW,6BAA6B;IAC5C,2CAA2C;IAC3C,IAAI,CAAC,EAAE,mBAAmB,CAAC;IAC3B,6CAA6C;IAC7C,KAAK,CAAC,EAAE,mBAAmB,CAAC;CAC7B;AAED,mEAAmE;AACnE,MAAM,WAAW,wBAAwB;IACvC,sDAAsD;IACtD,KAAK,CAAC,EAAE,6BAA6B,CAAC;IACtC,yCAAyC;IACzC,OAAO,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IAC5B,gCAAgC;IAChC,QAA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E3C"}
|
|
@@ -9,10 +9,8 @@
|
|
|
9
9
|
* Adaptations are deliberately closed and ordered. Width points are fixed names,
|
|
10
10
|
* sparse rules and reserved token routing are rejected during normalization,
|
|
11
11
|
* condition fields are ANDed, and rule order is the precedence model: every
|
|
12
|
-
* matching rule writes after the root theme and later matching writes win.
|
|
13
|
-
*
|
|
14
|
-
* authored rule leaves and generated token writes retain their cascade order.
|
|
15
|
-
* Token cycles are judged after each reachable ordered cascade is complete.
|
|
12
|
+
* matching rule writes after the root theme and later matching writes win. Token
|
|
13
|
+
* cycles are judged only after each reachable ordered cascade is complete.
|
|
16
14
|
*
|
|
17
15
|
* SYNC: When modified, update:
|
|
18
16
|
* - /packages/core/src/theme/defineTheme.ts (`DefineThemeInput.adaptations`)
|
|
@@ -574,39 +572,13 @@ export function resolveThemeGenerativeAxes(inherited, own) {
|
|
|
574
572
|
};
|
|
575
573
|
}
|
|
576
574
|
|
|
577
|
-
/**
|
|
578
|
-
* Type-scale component generation is invariant var() wiring, not scale values.
|
|
579
|
-
* Keep root declarations (including authored pins) in the root cascade instead
|
|
580
|
-
* of resetting them in a rule that only changes tokens. Fill missing root paths
|
|
581
|
-
* for rule-only scales, and retain every authored rule leaf, even when it equals
|
|
582
|
-
* the root: that write may intentionally undo an earlier matching rule.
|
|
583
|
-
*
|
|
584
|
-
* SYNC: expandTypeScale.ts (generateTypeScaleComponents)
|
|
585
|
-
*/
|
|
586
|
-
function omitRootTypeScaleDefaults(resolved, root, authored) {
|
|
587
|
-
if (!resolved || !root) {
|
|
588
|
-
return resolved;
|
|
589
|
-
}
|
|
590
|
-
const components = {};
|
|
591
|
-
for (const [component, rules] of Object.entries(resolved)) {
|
|
592
|
-
for (const [key, styles] of Object.entries(rules)) {
|
|
593
|
-
const writes = Object.fromEntries(Object.entries(styles).filter(([property]) => root[component]?.[key]?.[property] === undefined || Object.hasOwn(authored?.[component]?.[key] ?? {}, property)));
|
|
594
|
-
if (Object.keys(writes).length > 0) {
|
|
595
|
-
(components[component] ??= {})[key] = writes;
|
|
596
|
-
}
|
|
597
|
-
}
|
|
598
|
-
}
|
|
599
|
-
return Object.keys(components).length > 0 ? components : undefined;
|
|
600
|
-
}
|
|
601
|
-
|
|
602
575
|
/** Lower ordered normalized rules to concrete CSS writes. */
|
|
603
|
-
export function resolveThemeAdaptationRules(themeName, adaptations, axes, rootTokens, rootLocalTokens
|
|
576
|
+
export function resolveThemeAdaptationRules(themeName, adaptations, axes, rootTokens, rootLocalTokens) {
|
|
604
577
|
if (adaptations.rules.length === 0) {
|
|
605
578
|
return undefined;
|
|
606
579
|
}
|
|
607
580
|
const resolvedRules = adaptations.rules.map((rule, index) => {
|
|
608
|
-
const
|
|
609
|
-
const resolved = resolveThemeValues(input, undefined,
|
|
581
|
+
const resolved = resolveThemeValues(valueToThemeInput(themeName, index, rule.value, axes), undefined,
|
|
610
582
|
// Authored adaptation values are a new surface with no legacy
|
|
611
583
|
// acceptance to preserve, so a malformed token is rejected here rather
|
|
612
584
|
// than emitted. The root path stays lenient for compatibility.
|
|
@@ -631,7 +603,7 @@ export function resolveThemeAdaptationRules(themeName, adaptations, axes, rootTo
|
|
|
631
603
|
query: mediaQueryForCondition(themeName, index, rule.when, adaptations.widthBreakpoints),
|
|
632
604
|
tokens: resolved.tokens,
|
|
633
605
|
localTokens,
|
|
634
|
-
components:
|
|
606
|
+
components: resolved.components
|
|
635
607
|
};
|
|
636
608
|
});
|
|
637
609
|
assertNoReachableTokenCycles(themeName, adaptations.widthBreakpoints, rootTokens, rootLocalTokens, resolvedRules);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astryxdesign/core",
|
|
3
|
-
"version": "0.6.3-canary.
|
|
3
|
+
"version": "0.6.3-canary.2bb99ed",
|
|
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",
|
|
@@ -692,8 +692,8 @@
|
|
|
692
692
|
"react-dom": ">=19.0.0"
|
|
693
693
|
},
|
|
694
694
|
"devDependencies": {
|
|
695
|
-
"@astryxdesign/a11y-spec": "0.6.3-canary.
|
|
696
|
-
"@astryxdesign/cli": "0.6.3-canary.
|
|
695
|
+
"@astryxdesign/a11y-spec": "0.6.3-canary.2bb99ed",
|
|
696
|
+
"@astryxdesign/cli": "0.6.3-canary.2bb99ed",
|
|
697
697
|
"@babel/cli": "^7.29.7",
|
|
698
698
|
"@babel/core": "^7.29.7",
|
|
699
699
|
"@babel/preset-react": "^7.29.7",
|
|
@@ -238,18 +238,7 @@ const styles = stylex.create({
|
|
|
238
238
|
position: 'relative',
|
|
239
239
|
display: 'flex',
|
|
240
240
|
flexDirection: 'column',
|
|
241
|
-
|
|
242
|
-
// `placeholder` both add `spacingVars['--spacing-1']` padding on the
|
|
243
|
-
// block axis on top of their shared line-height, and normally that's
|
|
244
|
-
// what keeps the root this tall (the editable region reserves its own
|
|
245
|
-
// padded box even when empty). A disabled, empty editable stops
|
|
246
|
-
// reserving that empty line at all in Chromium (contentEditable=false
|
|
247
|
-
// collapses to just its padding), and the absolutely positioned
|
|
248
|
-
// placeholder that would otherwise stand in for it doesn't contribute
|
|
249
|
-
// to layout height — so without this explicit floor accounting for the
|
|
250
|
-
// same padding, the root shrinks by that padding's height the moment
|
|
251
|
-
// isDisabled flips true, moving anything bottom-aligned beside it.
|
|
252
|
-
minHeight: `calc(${LINE_HEIGHT_PX}px + 2 * ${spacingVars['--spacing-1']})`,
|
|
241
|
+
minHeight: `${LINE_HEIGHT_PX}px`,
|
|
253
242
|
},
|
|
254
243
|
editable: {
|
|
255
244
|
outline: 'none',
|
|
@@ -14,8 +14,6 @@ verified_by:
|
|
|
14
14
|
[
|
|
15
15
|
packages/core/src/Collapsible/Collapsible.test.tsx,
|
|
16
16
|
packages/core/src/Collapsible/CollapsibleGroup.test.tsx,
|
|
17
|
-
packages/core/src/Collapsible/__tests__/Collapsible.a11y.test.tsx,
|
|
18
|
-
packages/core/src/Collapsible/__tests__/Collapsible.a11y.chromium.spec.ts,
|
|
19
17
|
]
|
|
20
18
|
modules: []
|
|
21
19
|
families: []
|
|
@@ -23,7 +21,7 @@ design_specs: []
|
|
|
23
21
|
architecture:
|
|
24
22
|
[architecture:public-component-api, architecture:react-component-runtime]
|
|
25
23
|
contributing: [contributing:api-conventions]
|
|
26
|
-
system_specs: [spec:AST-002/DEC-1
|
|
24
|
+
system_specs: [spec:AST-002/DEC-1]
|
|
27
25
|
---
|
|
28
26
|
|
|
29
27
|
# Collapsible component contract
|
|
@@ -165,12 +163,12 @@ semantic direction or position states.
|
|
|
165
163
|
|
|
166
164
|
## Verification map
|
|
167
165
|
|
|
168
|
-
| Contract | Verification
|
|
169
|
-
| ------------------ |
|
|
170
|
-
| FR1–FR5 | Collapsible prop/type, DOM-order, glyph/direction, and no-extra-values tests
|
|
171
|
-
| FR6 | composed trigger layout and geometry tests
|
|
172
|
-
| FR7–FR8, ORD1 | group inheritance, item override, and nested reset tests
|
|
173
|
-
| FR9, AR1–AR3, ORD2 | disclosure semantics
|
|
166
|
+
| Contract | Verification | Representative states | Mutation or failure expectation | Audit section |
|
|
167
|
+
| ------------------ | ---------------------------------------------------------------------------- | ----------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------- |
|
|
168
|
+
| FR1–FR5 | Collapsible prop/type, DOM-order, glyph/direction, and no-extra-values tests | omitted/end/start; collapsed/expanded; LTR/RTL | default changes, `start` follows the label, collapsed leading cue points outward, or an unsupported cue value is admitted | audit:Collapsible/public-api |
|
|
169
|
+
| FR6 | composed trigger layout and geometry tests | plain text; composed label with trailing content; start/end | label becomes shrink-wrapped/stranded or composed content cannot use remaining row | audit:Collapsible/layout |
|
|
170
|
+
| FR7–FR8, ORD1 | group inheritance, item override, and nested reset tests | group start/end; item override; nested omission | group value is ignored, item cannot override, or position leaks into nested content | audit:Collapsible/behavior |
|
|
171
|
+
| FR9, AR1–AR3, ORD2 | disclosure semantics plus real RTL rendering | collapsed/expanded; start/end; LTR/RTL | position changes state behavior, duplicates accessible output, or leading direction fails to mirror | audit:Collapsible/accessibility |
|
|
174
172
|
|
|
175
173
|
## Decision log
|
|
176
174
|
|
|
@@ -57,6 +57,13 @@ describe('Collapsible', () => {
|
|
|
57
57
|
expect(within(content).getByTestId('child')).toBeInTheDocument();
|
|
58
58
|
});
|
|
59
59
|
|
|
60
|
+
it('links the trigger to its content via aria-controls', () => {
|
|
61
|
+
render(<Collapsible trigger="T">Body</Collapsible>);
|
|
62
|
+
const button = screen.getByRole('button');
|
|
63
|
+
const content = contentFor(button);
|
|
64
|
+
expect(button.getAttribute('aria-controls')).toBe(content.id);
|
|
65
|
+
});
|
|
66
|
+
|
|
60
67
|
it('renders the stable astryx-collapsible class on the root', () => {
|
|
61
68
|
render(
|
|
62
69
|
<Collapsible trigger="T" data-testid="root">
|
|
@@ -90,6 +97,77 @@ describe('Collapsible', () => {
|
|
|
90
97
|
});
|
|
91
98
|
|
|
92
99
|
describe('uncontrolled open state', () => {
|
|
100
|
+
it('is open by default (aria-expanded="true")', () => {
|
|
101
|
+
render(<Collapsible trigger="T">Body</Collapsible>);
|
|
102
|
+
expect(screen.getByRole('button')).toHaveAttribute(
|
|
103
|
+
'aria-expanded',
|
|
104
|
+
'true',
|
|
105
|
+
);
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
it('honors defaultIsOpen={false} (starts collapsed)', () => {
|
|
109
|
+
render(
|
|
110
|
+
<Collapsible trigger="T" defaultIsOpen={false}>
|
|
111
|
+
Body
|
|
112
|
+
</Collapsible>,
|
|
113
|
+
);
|
|
114
|
+
expect(screen.getByRole('button')).toHaveAttribute(
|
|
115
|
+
'aria-expanded',
|
|
116
|
+
'false',
|
|
117
|
+
);
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
it('toggles open/closed when the trigger is clicked', async () => {
|
|
121
|
+
const user = userEvent.setup();
|
|
122
|
+
render(<Collapsible trigger="T">Body</Collapsible>);
|
|
123
|
+
const button = screen.getByRole('button');
|
|
124
|
+
|
|
125
|
+
expect(button).toHaveAttribute('aria-expanded', 'true');
|
|
126
|
+
await user.click(button);
|
|
127
|
+
expect(button).toHaveAttribute('aria-expanded', 'false');
|
|
128
|
+
await user.click(button);
|
|
129
|
+
expect(button).toHaveAttribute('aria-expanded', 'true');
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
it('opens a default-collapsed instance on click', async () => {
|
|
133
|
+
const user = userEvent.setup();
|
|
134
|
+
render(
|
|
135
|
+
<Collapsible trigger="T" defaultIsOpen={false}>
|
|
136
|
+
Body
|
|
137
|
+
</Collapsible>,
|
|
138
|
+
);
|
|
139
|
+
const button = screen.getByRole('button');
|
|
140
|
+
await user.click(button);
|
|
141
|
+
expect(button).toHaveAttribute('aria-expanded', 'true');
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
it('toggles via keyboard activation (Enter and Space)', async () => {
|
|
145
|
+
const user = userEvent.setup();
|
|
146
|
+
render(<Collapsible trigger="T">Body</Collapsible>);
|
|
147
|
+
const button = screen.getByRole('button');
|
|
148
|
+
|
|
149
|
+
button.focus();
|
|
150
|
+
expect(button).toHaveFocus();
|
|
151
|
+
|
|
152
|
+
await user.keyboard('{Enter}');
|
|
153
|
+
expect(button).toHaveAttribute('aria-expanded', 'false');
|
|
154
|
+
await user.keyboard(' ');
|
|
155
|
+
expect(button).toHaveAttribute('aria-expanded', 'true');
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
it('hides the content region (display:none) only when collapsed', async () => {
|
|
159
|
+
const user = userEvent.setup();
|
|
160
|
+
render(<Collapsible trigger="T">Body</Collapsible>);
|
|
161
|
+
const button = screen.getByRole('button');
|
|
162
|
+
const content = contentFor(button);
|
|
163
|
+
|
|
164
|
+
// Open: not display:none.
|
|
165
|
+
expect(content).not.toHaveStyle({display: 'none'});
|
|
166
|
+
await user.click(button);
|
|
167
|
+
// Collapsed: hidden via the contentHidden style.
|
|
168
|
+
expect(content).toHaveStyle({display: 'none'});
|
|
169
|
+
});
|
|
170
|
+
|
|
93
171
|
it('rotates the chevron indicator between open and closed states', async () => {
|
|
94
172
|
const user = userEvent.setup();
|
|
95
173
|
render(<Collapsible trigger="T">Body</Collapsible>);
|