@astryxdesign/core 0.2.0-canary.f306f13 → 0.2.0-canary.fc53ff7
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/AvatarGroup/AvatarGroupOverflow.d.ts +1 -1
- package/dist/AvatarGroup/AvatarGroupOverflow.d.ts.map +1 -1
- package/dist/AvatarGroup/AvatarGroupOverflow.js +6 -2
- package/dist/Button/Button.d.ts +1 -1
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +4 -2
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +2 -2
- package/dist/CheckboxList/CheckboxListItem.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxListItem.js +19 -4
- package/dist/CodeBlock/CodeBlock.js +2 -2
- package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/ContextMenu/ContextMenu.js +10 -1
- package/dist/DropdownMenu/DropdownMenuRadioGroup.d.ts +8 -11
- package/dist/DropdownMenu/DropdownMenuRadioGroup.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuRadioGroup.js +3 -1
- package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts +1 -1
- package/dist/DropdownMenu/DropdownMenuRadioItem.js +1 -1
- package/dist/DropdownMenu/DropdownMenuSubMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuSubMenu.js +9 -1
- package/dist/DropdownMenu/menuItemHover.d.ts +1 -0
- package/dist/DropdownMenu/menuItemHover.d.ts.map +1 -1
- package/dist/DropdownMenu/menuItemHover.js +1 -0
- package/dist/Field/FieldLabel.d.ts +2 -1
- package/dist/Field/FieldLabel.d.ts.map +1 -1
- package/dist/Field/FieldLabel.js +7 -3
- package/dist/FieldStatus/FieldStatus.d.ts.map +1 -1
- package/dist/FieldStatus/FieldStatus.js +12 -2
- package/dist/Item/Item.d.ts +16 -3
- package/dist/Item/Item.d.ts.map +1 -1
- package/dist/Item/Item.js +31 -6
- package/dist/List/ListItem.d.ts +11 -1
- package/dist/List/ListItem.d.ts.map +1 -1
- package/dist/List/ListItem.js +2 -0
- package/dist/MetadataList/MetadataList.d.ts +1 -1
- package/dist/MetadataList/MetadataList.d.ts.map +1 -1
- package/dist/MetadataList/MetadataList.js +4 -2
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +14 -3
- package/dist/RadioList/RadioListItem.d.ts.map +1 -1
- package/dist/RadioList/RadioListItem.js +1 -1
- package/dist/SegmentedControl/SegmentedControlItem.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControlItem.js +3 -2
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +5 -0
- package/dist/Skeleton/Skeleton.d.ts.map +1 -1
- package/dist/Skeleton/Skeleton.js +2 -2
- package/dist/Switch/Switch.d.ts.map +1 -1
- package/dist/Switch/Switch.js +15 -4
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +1 -1
- package/dist/Thumbnail/Thumbnail.d.ts.map +1 -1
- package/dist/Thumbnail/Thumbnail.js +42 -43
- package/dist/Toast/ToastViewport.d.ts.map +1 -1
- package/dist/Toast/ToastViewport.js +61 -9
- package/dist/ToggleButton/ToggleButton.d.ts.map +1 -1
- package/dist/ToggleButton/ToggleButton.js +3 -1
- package/dist/Token/Token.d.ts +4 -1
- package/dist/Token/Token.d.ts.map +1 -1
- package/dist/Token/Token.js +68 -43
- package/dist/Token/TokenLink.d.ts +62 -0
- package/dist/Token/TokenLink.d.ts.map +1 -0
- package/dist/Token/TokenLink.js +76 -0
- package/dist/TopNav/TopNavMegaMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMegaMenu.js +9 -3
- package/dist/Typeahead/BaseTypeahead.d.ts +9 -0
- package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.js +2 -0
- package/dist/Typeahead/Typeahead.d.ts.map +1 -1
- package/dist/Typeahead/Typeahead.js +8 -1
- package/dist/astryx.css +51 -8
- package/dist/astryx.umd.js +50 -50
- package/dist/astryx.umd.js.map +4 -4
- package/dist/hooks/containerReveal.pool.stylex.d.ts +281 -0
- package/dist/hooks/containerReveal.pool.stylex.d.ts.map +1 -0
- package/dist/hooks/containerReveal.pool.stylex.js +281 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +2 -1
- package/dist/hooks/useContainerReveal.d.ts +83 -0
- package/dist/hooks/useContainerReveal.d.ts.map +1 -0
- package/dist/hooks/useContainerReveal.js +123 -0
- package/dist/hooks/useInputStatusIcon.d.ts.map +1 -1
- package/dist/hooks/useInputStatusIcon.js +11 -0
- package/dist/hooks/useKeyboardHint.d.ts +1 -1
- package/dist/hooks/useKeyboardHint.d.ts.map +1 -1
- package/dist/hooks/useKeyboardHint.js +4 -2
- package/locales/en.json +32 -0
- package/locales/pseudo.json +24 -0
- package/package.json +1 -1
- package/src/AvatarGroup/AvatarGroup.test.tsx +21 -1
- package/src/AvatarGroup/AvatarGroupOverflow.tsx +4 -2
- package/src/Breadcrumbs/Breadcrumbs.test.tsx +1 -1
- package/src/Button/Button.test.tsx +16 -0
- package/src/Button/Button.tsx +4 -2
- package/src/CheckboxInput/CheckboxInput.test.tsx +23 -0
- package/src/CheckboxInput/CheckboxInput.tsx +17 -2
- package/src/CheckboxList/CheckboxList.test.tsx +94 -3
- package/src/CheckboxList/CheckboxListItem.tsx +17 -10
- package/src/CodeBlock/CodeBlock.test.tsx +17 -0
- package/src/CodeBlock/CodeBlock.tsx +2 -2
- package/src/ContextMenu/ContextMenu.test.tsx +17 -2
- package/src/ContextMenu/ContextMenu.tsx +10 -1
- package/src/DropdownMenu/DropdownMenuRadioGroup.doc.mjs +4 -12
- package/src/DropdownMenu/DropdownMenuRadioGroup.tsx +9 -10
- package/src/DropdownMenu/DropdownMenuRadioItem.tsx +1 -1
- package/src/DropdownMenu/DropdownMenuSelectable.test.tsx +20 -2
- package/src/DropdownMenu/DropdownMenuSubMenu.test.tsx +29 -1
- package/src/DropdownMenu/DropdownMenuSubMenu.tsx +13 -5
- package/src/DropdownMenu/menuItemHover.ts +1 -0
- package/src/Field/Field.doc.mjs +4 -0
- package/src/Field/FieldLabel.test.tsx +25 -0
- package/src/Field/FieldLabel.tsx +11 -2
- package/src/FieldStatus/FieldStatus.doc.mjs +1 -0
- package/src/FieldStatus/FieldStatus.test.tsx +61 -0
- package/src/FieldStatus/FieldStatus.tsx +14 -3
- package/src/Item/Item.doc.mjs +5 -0
- package/src/Item/Item.test.tsx +88 -0
- package/src/Item/Item.tsx +57 -11
- package/src/List/ListItem.doc.mjs +12 -0
- package/src/List/ListItem.tsx +13 -0
- package/src/MetadataList/MetadataList.test.tsx +24 -0
- package/src/MetadataList/MetadataList.tsx +6 -2
- package/src/MultiSelector/MultiSelector.test.tsx +76 -0
- package/src/MultiSelector/MultiSelector.tsx +28 -7
- package/src/RadioList/RadioList.test.tsx +26 -4
- package/src/RadioList/RadioListItem.tsx +8 -1
- package/src/SegmentedControl/SegmentedControl.test.tsx +28 -0
- package/src/SegmentedControl/SegmentedControlItem.tsx +20 -2
- package/src/Selector/Selector.test.tsx +22 -0
- package/src/Selector/Selector.tsx +8 -1
- package/src/Skeleton/Skeleton.test.tsx +16 -0
- package/src/Skeleton/Skeleton.tsx +13 -1
- package/src/Switch/Switch.test.tsx +37 -0
- package/src/Switch/Switch.tsx +52 -3
- package/src/Table/plugins/rowExpansion/useTableRowExpansion.test.tsx +19 -0
- package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +3 -1
- package/src/Thumbnail/Thumbnail.tsx +18 -32
- package/src/Toast/ToastViewport.test.tsx +218 -8
- package/src/Toast/ToastViewport.tsx +71 -12
- package/src/ToggleButton/ToggleButton.test.tsx +24 -0
- package/src/ToggleButton/ToggleButton.tsx +19 -1
- package/src/Token/Token.test.tsx +145 -0
- package/src/Token/Token.tsx +73 -33
- package/src/Token/TokenLink.tsx +107 -0
- package/src/TopNav/TopNavMegaMenu.tsx +26 -2
- package/src/Typeahead/BaseTypeahead.tsx +12 -0
- package/src/Typeahead/Typeahead.test.tsx +62 -0
- package/src/Typeahead/Typeahead.tsx +6 -0
- package/src/__tests__/forcedColors.ts +60 -0
- package/src/hooks/containerReveal.pool.stylex.ts +464 -0
- package/src/hooks/index.ts +7 -0
- package/src/hooks/useContainerReveal.test.tsx +116 -0
- package/src/hooks/useContainerReveal.ts +180 -0
- package/src/hooks/useInputStatusIcon.test.tsx +59 -0
- package/src/hooks/useInputStatusIcon.tsx +12 -1
- package/src/hooks/useKeyboardHint.test.tsx +22 -0
- package/src/hooks/useKeyboardHint.tsx +6 -2
- package/dist/Thumbnail/thumbnail.markers.stylex.d.ts +0 -9
- package/dist/Thumbnail/thumbnail.markers.stylex.d.ts.map +0 -1
- package/dist/Thumbnail/thumbnail.markers.stylex.js +0 -14
- package/src/Thumbnail/thumbnail.markers.stylex.ts +0 -12
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file containerReveal.pool.stylex.ts
|
|
3
|
+
* @input Uses StyleX, theme tokens
|
|
4
|
+
* @output A fixed pool of scoped markers, each paired with its reveal style
|
|
5
|
+
* blocks (reveal / conceal, each with a layout-preserved variant) compiled
|
|
6
|
+
* against that marker.
|
|
7
|
+
* @position Internal to useContainerReveal.
|
|
8
|
+
*
|
|
9
|
+
* WHY A POOL OF LITERAL BLOCKS: `stylex.when.ancestor(':hover', marker)` is
|
|
10
|
+
* resolved by the StyleX compiler, which welds the marker's class into the
|
|
11
|
+
* emitted selector (`.marker:hover *`). A marker and the styles referencing it
|
|
12
|
+
* are therefore inseparable at build time — the marker cannot be passed as a
|
|
13
|
+
* runtime argument, so the blocks cannot be produced by a loop or a helper and
|
|
14
|
+
* must be written out literally per marker. A single shared marker would leak
|
|
15
|
+
* hover/focus across NESTED reveal containers (an ancestor container's :hover
|
|
16
|
+
* matches a descendant container's revealed content), so useContainerReveal
|
|
17
|
+
* hands each concurrently mounted container a distinct marker from this pool
|
|
18
|
+
* (see the free-list there).
|
|
19
|
+
*
|
|
20
|
+
* The reveal recipe hides content with `position: absolute` (removed from
|
|
21
|
+
* layout flow, so it reserves no space) plus `opacity: 0`. Both keep the
|
|
22
|
+
* content in the accessibility tree and tab order — unlike display/visibility
|
|
23
|
+
* — so it stays reachable by keyboard and assistive tech while hidden.
|
|
24
|
+
*/
|
|
25
|
+
import * as stylex from '@stylexjs/stylex';
|
|
26
|
+
export declare const POOL_SIZE = 6;
|
|
27
|
+
export declare const m0: Readonly<{
|
|
28
|
+
readonly marker: stylex.StyleXClassNameFor<"marker", symbol>;
|
|
29
|
+
}>;
|
|
30
|
+
export declare const m1: Readonly<{
|
|
31
|
+
readonly marker: stylex.StyleXClassNameFor<"marker", symbol>;
|
|
32
|
+
}>;
|
|
33
|
+
export declare const m2: Readonly<{
|
|
34
|
+
readonly marker: stylex.StyleXClassNameFor<"marker", symbol>;
|
|
35
|
+
}>;
|
|
36
|
+
export declare const m3: Readonly<{
|
|
37
|
+
readonly marker: stylex.StyleXClassNameFor<"marker", symbol>;
|
|
38
|
+
}>;
|
|
39
|
+
export declare const m4: Readonly<{
|
|
40
|
+
readonly marker: stylex.StyleXClassNameFor<"marker", symbol>;
|
|
41
|
+
}>;
|
|
42
|
+
export declare const m5: Readonly<{
|
|
43
|
+
readonly marker: stylex.StyleXClassNameFor<"marker", symbol>;
|
|
44
|
+
}>;
|
|
45
|
+
export declare const POOL: readonly [{
|
|
46
|
+
readonly marker: Readonly<{
|
|
47
|
+
readonly marker: stylex.StyleXClassNameFor<"marker", symbol>;
|
|
48
|
+
}>;
|
|
49
|
+
readonly reveal: Readonly<{
|
|
50
|
+
readonly transitionProperty: stylex.StyleXClassNameFor<"transitionProperty", "opacity">;
|
|
51
|
+
readonly transitionDuration: stylex.StyleXClassNameFor<"transitionDuration", "175ms" | "0s">;
|
|
52
|
+
readonly transitionTimingFunction: stylex.StyleXClassNameFor<"transitionTimingFunction", "cubic-bezier(0.24, 1, 0.4, 1)">;
|
|
53
|
+
readonly opacity: stylex.StyleXClassNameFor<"opacity", 0 | 1 | {
|
|
54
|
+
readonly '@media (hover: hover)': 1;
|
|
55
|
+
}>;
|
|
56
|
+
readonly position: stylex.StyleXClassNameFor<"position", "static" | "absolute" | {
|
|
57
|
+
readonly '@media (hover: hover)': "static";
|
|
58
|
+
}>;
|
|
59
|
+
}>;
|
|
60
|
+
readonly revealLayoutPreserved: Readonly<{
|
|
61
|
+
readonly transitionProperty: stylex.StyleXClassNameFor<"transitionProperty", "opacity">;
|
|
62
|
+
readonly transitionDuration: stylex.StyleXClassNameFor<"transitionDuration", "175ms" | "0s">;
|
|
63
|
+
readonly transitionTimingFunction: stylex.StyleXClassNameFor<"transitionTimingFunction", "cubic-bezier(0.24, 1, 0.4, 1)">;
|
|
64
|
+
readonly opacity: stylex.StyleXClassNameFor<"opacity", 0 | 1 | {
|
|
65
|
+
readonly '@media (hover: hover)': 1;
|
|
66
|
+
}>;
|
|
67
|
+
}>;
|
|
68
|
+
readonly conceal: Readonly<{
|
|
69
|
+
readonly transitionProperty: stylex.StyleXClassNameFor<"transitionProperty", "opacity">;
|
|
70
|
+
readonly transitionDuration: stylex.StyleXClassNameFor<"transitionDuration", "175ms" | "0s">;
|
|
71
|
+
readonly transitionTimingFunction: stylex.StyleXClassNameFor<"transitionTimingFunction", "cubic-bezier(0.24, 1, 0.4, 1)">;
|
|
72
|
+
readonly opacity: stylex.StyleXClassNameFor<"opacity", 1 | {
|
|
73
|
+
readonly '@media (hover: hover)': 0;
|
|
74
|
+
}>;
|
|
75
|
+
}>;
|
|
76
|
+
readonly concealLayoutPreserved: Readonly<{
|
|
77
|
+
readonly transitionProperty: stylex.StyleXClassNameFor<"transitionProperty", "opacity">;
|
|
78
|
+
readonly transitionDuration: stylex.StyleXClassNameFor<"transitionDuration", "175ms" | "0s">;
|
|
79
|
+
readonly transitionTimingFunction: stylex.StyleXClassNameFor<"transitionTimingFunction", "cubic-bezier(0.24, 1, 0.4, 1)">;
|
|
80
|
+
readonly opacity: stylex.StyleXClassNameFor<"opacity", 1 | {
|
|
81
|
+
readonly '@media (hover: hover)': 0;
|
|
82
|
+
}>;
|
|
83
|
+
}>;
|
|
84
|
+
}, {
|
|
85
|
+
readonly marker: Readonly<{
|
|
86
|
+
readonly marker: stylex.StyleXClassNameFor<"marker", symbol>;
|
|
87
|
+
}>;
|
|
88
|
+
readonly reveal: Readonly<{
|
|
89
|
+
readonly transitionProperty: stylex.StyleXClassNameFor<"transitionProperty", "opacity">;
|
|
90
|
+
readonly transitionDuration: stylex.StyleXClassNameFor<"transitionDuration", "175ms" | "0s">;
|
|
91
|
+
readonly transitionTimingFunction: stylex.StyleXClassNameFor<"transitionTimingFunction", "cubic-bezier(0.24, 1, 0.4, 1)">;
|
|
92
|
+
readonly opacity: stylex.StyleXClassNameFor<"opacity", 0 | 1 | {
|
|
93
|
+
readonly '@media (hover: hover)': 1;
|
|
94
|
+
}>;
|
|
95
|
+
readonly position: stylex.StyleXClassNameFor<"position", "static" | "absolute" | {
|
|
96
|
+
readonly '@media (hover: hover)': "static";
|
|
97
|
+
}>;
|
|
98
|
+
}>;
|
|
99
|
+
readonly revealLayoutPreserved: Readonly<{
|
|
100
|
+
readonly transitionProperty: stylex.StyleXClassNameFor<"transitionProperty", "opacity">;
|
|
101
|
+
readonly transitionDuration: stylex.StyleXClassNameFor<"transitionDuration", "175ms" | "0s">;
|
|
102
|
+
readonly transitionTimingFunction: stylex.StyleXClassNameFor<"transitionTimingFunction", "cubic-bezier(0.24, 1, 0.4, 1)">;
|
|
103
|
+
readonly opacity: stylex.StyleXClassNameFor<"opacity", 0 | 1 | {
|
|
104
|
+
readonly '@media (hover: hover)': 1;
|
|
105
|
+
}>;
|
|
106
|
+
}>;
|
|
107
|
+
readonly conceal: Readonly<{
|
|
108
|
+
readonly transitionProperty: stylex.StyleXClassNameFor<"transitionProperty", "opacity">;
|
|
109
|
+
readonly transitionDuration: stylex.StyleXClassNameFor<"transitionDuration", "175ms" | "0s">;
|
|
110
|
+
readonly transitionTimingFunction: stylex.StyleXClassNameFor<"transitionTimingFunction", "cubic-bezier(0.24, 1, 0.4, 1)">;
|
|
111
|
+
readonly opacity: stylex.StyleXClassNameFor<"opacity", 1 | {
|
|
112
|
+
readonly '@media (hover: hover)': 0;
|
|
113
|
+
}>;
|
|
114
|
+
}>;
|
|
115
|
+
readonly concealLayoutPreserved: Readonly<{
|
|
116
|
+
readonly transitionProperty: stylex.StyleXClassNameFor<"transitionProperty", "opacity">;
|
|
117
|
+
readonly transitionDuration: stylex.StyleXClassNameFor<"transitionDuration", "175ms" | "0s">;
|
|
118
|
+
readonly transitionTimingFunction: stylex.StyleXClassNameFor<"transitionTimingFunction", "cubic-bezier(0.24, 1, 0.4, 1)">;
|
|
119
|
+
readonly opacity: stylex.StyleXClassNameFor<"opacity", 1 | {
|
|
120
|
+
readonly '@media (hover: hover)': 0;
|
|
121
|
+
}>;
|
|
122
|
+
}>;
|
|
123
|
+
}, {
|
|
124
|
+
readonly marker: Readonly<{
|
|
125
|
+
readonly marker: stylex.StyleXClassNameFor<"marker", symbol>;
|
|
126
|
+
}>;
|
|
127
|
+
readonly reveal: Readonly<{
|
|
128
|
+
readonly transitionProperty: stylex.StyleXClassNameFor<"transitionProperty", "opacity">;
|
|
129
|
+
readonly transitionDuration: stylex.StyleXClassNameFor<"transitionDuration", "175ms" | "0s">;
|
|
130
|
+
readonly transitionTimingFunction: stylex.StyleXClassNameFor<"transitionTimingFunction", "cubic-bezier(0.24, 1, 0.4, 1)">;
|
|
131
|
+
readonly opacity: stylex.StyleXClassNameFor<"opacity", 0 | 1 | {
|
|
132
|
+
readonly '@media (hover: hover)': 1;
|
|
133
|
+
}>;
|
|
134
|
+
readonly position: stylex.StyleXClassNameFor<"position", "static" | "absolute" | {
|
|
135
|
+
readonly '@media (hover: hover)': "static";
|
|
136
|
+
}>;
|
|
137
|
+
}>;
|
|
138
|
+
readonly revealLayoutPreserved: Readonly<{
|
|
139
|
+
readonly transitionProperty: stylex.StyleXClassNameFor<"transitionProperty", "opacity">;
|
|
140
|
+
readonly transitionDuration: stylex.StyleXClassNameFor<"transitionDuration", "175ms" | "0s">;
|
|
141
|
+
readonly transitionTimingFunction: stylex.StyleXClassNameFor<"transitionTimingFunction", "cubic-bezier(0.24, 1, 0.4, 1)">;
|
|
142
|
+
readonly opacity: stylex.StyleXClassNameFor<"opacity", 0 | 1 | {
|
|
143
|
+
readonly '@media (hover: hover)': 1;
|
|
144
|
+
}>;
|
|
145
|
+
}>;
|
|
146
|
+
readonly conceal: Readonly<{
|
|
147
|
+
readonly transitionProperty: stylex.StyleXClassNameFor<"transitionProperty", "opacity">;
|
|
148
|
+
readonly transitionDuration: stylex.StyleXClassNameFor<"transitionDuration", "175ms" | "0s">;
|
|
149
|
+
readonly transitionTimingFunction: stylex.StyleXClassNameFor<"transitionTimingFunction", "cubic-bezier(0.24, 1, 0.4, 1)">;
|
|
150
|
+
readonly opacity: stylex.StyleXClassNameFor<"opacity", 1 | {
|
|
151
|
+
readonly '@media (hover: hover)': 0;
|
|
152
|
+
}>;
|
|
153
|
+
}>;
|
|
154
|
+
readonly concealLayoutPreserved: Readonly<{
|
|
155
|
+
readonly transitionProperty: stylex.StyleXClassNameFor<"transitionProperty", "opacity">;
|
|
156
|
+
readonly transitionDuration: stylex.StyleXClassNameFor<"transitionDuration", "175ms" | "0s">;
|
|
157
|
+
readonly transitionTimingFunction: stylex.StyleXClassNameFor<"transitionTimingFunction", "cubic-bezier(0.24, 1, 0.4, 1)">;
|
|
158
|
+
readonly opacity: stylex.StyleXClassNameFor<"opacity", 1 | {
|
|
159
|
+
readonly '@media (hover: hover)': 0;
|
|
160
|
+
}>;
|
|
161
|
+
}>;
|
|
162
|
+
}, {
|
|
163
|
+
readonly marker: Readonly<{
|
|
164
|
+
readonly marker: stylex.StyleXClassNameFor<"marker", symbol>;
|
|
165
|
+
}>;
|
|
166
|
+
readonly reveal: Readonly<{
|
|
167
|
+
readonly transitionProperty: stylex.StyleXClassNameFor<"transitionProperty", "opacity">;
|
|
168
|
+
readonly transitionDuration: stylex.StyleXClassNameFor<"transitionDuration", "175ms" | "0s">;
|
|
169
|
+
readonly transitionTimingFunction: stylex.StyleXClassNameFor<"transitionTimingFunction", "cubic-bezier(0.24, 1, 0.4, 1)">;
|
|
170
|
+
readonly opacity: stylex.StyleXClassNameFor<"opacity", 0 | 1 | {
|
|
171
|
+
readonly '@media (hover: hover)': 1;
|
|
172
|
+
}>;
|
|
173
|
+
readonly position: stylex.StyleXClassNameFor<"position", "static" | "absolute" | {
|
|
174
|
+
readonly '@media (hover: hover)': "static";
|
|
175
|
+
}>;
|
|
176
|
+
}>;
|
|
177
|
+
readonly revealLayoutPreserved: Readonly<{
|
|
178
|
+
readonly transitionProperty: stylex.StyleXClassNameFor<"transitionProperty", "opacity">;
|
|
179
|
+
readonly transitionDuration: stylex.StyleXClassNameFor<"transitionDuration", "175ms" | "0s">;
|
|
180
|
+
readonly transitionTimingFunction: stylex.StyleXClassNameFor<"transitionTimingFunction", "cubic-bezier(0.24, 1, 0.4, 1)">;
|
|
181
|
+
readonly opacity: stylex.StyleXClassNameFor<"opacity", 0 | 1 | {
|
|
182
|
+
readonly '@media (hover: hover)': 1;
|
|
183
|
+
}>;
|
|
184
|
+
}>;
|
|
185
|
+
readonly conceal: Readonly<{
|
|
186
|
+
readonly transitionProperty: stylex.StyleXClassNameFor<"transitionProperty", "opacity">;
|
|
187
|
+
readonly transitionDuration: stylex.StyleXClassNameFor<"transitionDuration", "175ms" | "0s">;
|
|
188
|
+
readonly transitionTimingFunction: stylex.StyleXClassNameFor<"transitionTimingFunction", "cubic-bezier(0.24, 1, 0.4, 1)">;
|
|
189
|
+
readonly opacity: stylex.StyleXClassNameFor<"opacity", 1 | {
|
|
190
|
+
readonly '@media (hover: hover)': 0;
|
|
191
|
+
}>;
|
|
192
|
+
}>;
|
|
193
|
+
readonly concealLayoutPreserved: Readonly<{
|
|
194
|
+
readonly transitionProperty: stylex.StyleXClassNameFor<"transitionProperty", "opacity">;
|
|
195
|
+
readonly transitionDuration: stylex.StyleXClassNameFor<"transitionDuration", "175ms" | "0s">;
|
|
196
|
+
readonly transitionTimingFunction: stylex.StyleXClassNameFor<"transitionTimingFunction", "cubic-bezier(0.24, 1, 0.4, 1)">;
|
|
197
|
+
readonly opacity: stylex.StyleXClassNameFor<"opacity", 1 | {
|
|
198
|
+
readonly '@media (hover: hover)': 0;
|
|
199
|
+
}>;
|
|
200
|
+
}>;
|
|
201
|
+
}, {
|
|
202
|
+
readonly marker: Readonly<{
|
|
203
|
+
readonly marker: stylex.StyleXClassNameFor<"marker", symbol>;
|
|
204
|
+
}>;
|
|
205
|
+
readonly reveal: Readonly<{
|
|
206
|
+
readonly transitionProperty: stylex.StyleXClassNameFor<"transitionProperty", "opacity">;
|
|
207
|
+
readonly transitionDuration: stylex.StyleXClassNameFor<"transitionDuration", "175ms" | "0s">;
|
|
208
|
+
readonly transitionTimingFunction: stylex.StyleXClassNameFor<"transitionTimingFunction", "cubic-bezier(0.24, 1, 0.4, 1)">;
|
|
209
|
+
readonly opacity: stylex.StyleXClassNameFor<"opacity", 0 | 1 | {
|
|
210
|
+
readonly '@media (hover: hover)': 1;
|
|
211
|
+
}>;
|
|
212
|
+
readonly position: stylex.StyleXClassNameFor<"position", "static" | "absolute" | {
|
|
213
|
+
readonly '@media (hover: hover)': "static";
|
|
214
|
+
}>;
|
|
215
|
+
}>;
|
|
216
|
+
readonly revealLayoutPreserved: Readonly<{
|
|
217
|
+
readonly transitionProperty: stylex.StyleXClassNameFor<"transitionProperty", "opacity">;
|
|
218
|
+
readonly transitionDuration: stylex.StyleXClassNameFor<"transitionDuration", "175ms" | "0s">;
|
|
219
|
+
readonly transitionTimingFunction: stylex.StyleXClassNameFor<"transitionTimingFunction", "cubic-bezier(0.24, 1, 0.4, 1)">;
|
|
220
|
+
readonly opacity: stylex.StyleXClassNameFor<"opacity", 0 | 1 | {
|
|
221
|
+
readonly '@media (hover: hover)': 1;
|
|
222
|
+
}>;
|
|
223
|
+
}>;
|
|
224
|
+
readonly conceal: Readonly<{
|
|
225
|
+
readonly transitionProperty: stylex.StyleXClassNameFor<"transitionProperty", "opacity">;
|
|
226
|
+
readonly transitionDuration: stylex.StyleXClassNameFor<"transitionDuration", "175ms" | "0s">;
|
|
227
|
+
readonly transitionTimingFunction: stylex.StyleXClassNameFor<"transitionTimingFunction", "cubic-bezier(0.24, 1, 0.4, 1)">;
|
|
228
|
+
readonly opacity: stylex.StyleXClassNameFor<"opacity", 1 | {
|
|
229
|
+
readonly '@media (hover: hover)': 0;
|
|
230
|
+
}>;
|
|
231
|
+
}>;
|
|
232
|
+
readonly concealLayoutPreserved: Readonly<{
|
|
233
|
+
readonly transitionProperty: stylex.StyleXClassNameFor<"transitionProperty", "opacity">;
|
|
234
|
+
readonly transitionDuration: stylex.StyleXClassNameFor<"transitionDuration", "175ms" | "0s">;
|
|
235
|
+
readonly transitionTimingFunction: stylex.StyleXClassNameFor<"transitionTimingFunction", "cubic-bezier(0.24, 1, 0.4, 1)">;
|
|
236
|
+
readonly opacity: stylex.StyleXClassNameFor<"opacity", 1 | {
|
|
237
|
+
readonly '@media (hover: hover)': 0;
|
|
238
|
+
}>;
|
|
239
|
+
}>;
|
|
240
|
+
}, {
|
|
241
|
+
readonly marker: Readonly<{
|
|
242
|
+
readonly marker: stylex.StyleXClassNameFor<"marker", symbol>;
|
|
243
|
+
}>;
|
|
244
|
+
readonly reveal: Readonly<{
|
|
245
|
+
readonly transitionProperty: stylex.StyleXClassNameFor<"transitionProperty", "opacity">;
|
|
246
|
+
readonly transitionDuration: stylex.StyleXClassNameFor<"transitionDuration", "175ms" | "0s">;
|
|
247
|
+
readonly transitionTimingFunction: stylex.StyleXClassNameFor<"transitionTimingFunction", "cubic-bezier(0.24, 1, 0.4, 1)">;
|
|
248
|
+
readonly opacity: stylex.StyleXClassNameFor<"opacity", 0 | 1 | {
|
|
249
|
+
readonly '@media (hover: hover)': 1;
|
|
250
|
+
}>;
|
|
251
|
+
readonly position: stylex.StyleXClassNameFor<"position", "static" | "absolute" | {
|
|
252
|
+
readonly '@media (hover: hover)': "static";
|
|
253
|
+
}>;
|
|
254
|
+
}>;
|
|
255
|
+
readonly revealLayoutPreserved: Readonly<{
|
|
256
|
+
readonly transitionProperty: stylex.StyleXClassNameFor<"transitionProperty", "opacity">;
|
|
257
|
+
readonly transitionDuration: stylex.StyleXClassNameFor<"transitionDuration", "175ms" | "0s">;
|
|
258
|
+
readonly transitionTimingFunction: stylex.StyleXClassNameFor<"transitionTimingFunction", "cubic-bezier(0.24, 1, 0.4, 1)">;
|
|
259
|
+
readonly opacity: stylex.StyleXClassNameFor<"opacity", 0 | 1 | {
|
|
260
|
+
readonly '@media (hover: hover)': 1;
|
|
261
|
+
}>;
|
|
262
|
+
}>;
|
|
263
|
+
readonly conceal: Readonly<{
|
|
264
|
+
readonly transitionProperty: stylex.StyleXClassNameFor<"transitionProperty", "opacity">;
|
|
265
|
+
readonly transitionDuration: stylex.StyleXClassNameFor<"transitionDuration", "175ms" | "0s">;
|
|
266
|
+
readonly transitionTimingFunction: stylex.StyleXClassNameFor<"transitionTimingFunction", "cubic-bezier(0.24, 1, 0.4, 1)">;
|
|
267
|
+
readonly opacity: stylex.StyleXClassNameFor<"opacity", 1 | {
|
|
268
|
+
readonly '@media (hover: hover)': 0;
|
|
269
|
+
}>;
|
|
270
|
+
}>;
|
|
271
|
+
readonly concealLayoutPreserved: Readonly<{
|
|
272
|
+
readonly transitionProperty: stylex.StyleXClassNameFor<"transitionProperty", "opacity">;
|
|
273
|
+
readonly transitionDuration: stylex.StyleXClassNameFor<"transitionDuration", "175ms" | "0s">;
|
|
274
|
+
readonly transitionTimingFunction: stylex.StyleXClassNameFor<"transitionTimingFunction", "cubic-bezier(0.24, 1, 0.4, 1)">;
|
|
275
|
+
readonly opacity: stylex.StyleXClassNameFor<"opacity", 1 | {
|
|
276
|
+
readonly '@media (hover: hover)': 0;
|
|
277
|
+
}>;
|
|
278
|
+
}>;
|
|
279
|
+
}];
|
|
280
|
+
export type RevealSlot = (typeof POOL)[number];
|
|
281
|
+
//# sourceMappingURL=containerReveal.pool.stylex.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"containerReveal.pool.stylex.d.ts","sourceRoot":"","sources":["../../src/hooks/containerReveal.pool.stylex.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAG3C,eAAO,MAAM,SAAS,IAAI,CAAC;AAE3B,eAAO,MAAM,EAAE;;EAAwB,CAAC;AAsExC,eAAO,MAAM,EAAE;;EAAwB,CAAC;AAsExC,eAAO,MAAM,EAAE;;EAAwB,CAAC;AAsExC,eAAO,MAAM,EAAE;;EAAwB,CAAC;AAsExC,eAAO,MAAM,EAAE;;EAAwB,CAAC;AAsExC,eAAO,MAAM,EAAE;;EAAwB,CAAC;AAwExC,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOP,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file containerReveal.pool.stylex.ts
|
|
5
|
+
* @input Uses StyleX, theme tokens
|
|
6
|
+
* @output A fixed pool of scoped markers, each paired with its reveal style
|
|
7
|
+
* blocks (reveal / conceal, each with a layout-preserved variant) compiled
|
|
8
|
+
* against that marker.
|
|
9
|
+
* @position Internal to useContainerReveal.
|
|
10
|
+
*
|
|
11
|
+
* WHY A POOL OF LITERAL BLOCKS: `stylex.when.ancestor(':hover', marker)` is
|
|
12
|
+
* resolved by the StyleX compiler, which welds the marker's class into the
|
|
13
|
+
* emitted selector (`.marker:hover *`). A marker and the styles referencing it
|
|
14
|
+
* are therefore inseparable at build time — the marker cannot be passed as a
|
|
15
|
+
* runtime argument, so the blocks cannot be produced by a loop or a helper and
|
|
16
|
+
* must be written out literally per marker. A single shared marker would leak
|
|
17
|
+
* hover/focus across NESTED reveal containers (an ancestor container's :hover
|
|
18
|
+
* matches a descendant container's revealed content), so useContainerReveal
|
|
19
|
+
* hands each concurrently mounted container a distinct marker from this pool
|
|
20
|
+
* (see the free-list there).
|
|
21
|
+
*
|
|
22
|
+
* The reveal recipe hides content with `position: absolute` (removed from
|
|
23
|
+
* layout flow, so it reserves no space) plus `opacity: 0`. Both keep the
|
|
24
|
+
* content in the accessibility tree and tab order — unlike display/visibility
|
|
25
|
+
* — so it stays reachable by keyboard and assistive tech while hidden.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
import * as stylex from '@stylexjs/stylex';
|
|
29
|
+
import "../theme/tokens.stylex.js";
|
|
30
|
+
import { durationVars, easeVars } from "../theme/tokens.stylex.js";
|
|
31
|
+
export const POOL_SIZE = 6;
|
|
32
|
+
export const m0 = {
|
|
33
|
+
x177fznd: "x177fznd",
|
|
34
|
+
$$css: true
|
|
35
|
+
};
|
|
36
|
+
const s0 = {
|
|
37
|
+
reveal: {
|
|
38
|
+
k1ekBW: "x19991ni",
|
|
39
|
+
kIyJzY: "xuedmi6 x12w9bfk",
|
|
40
|
+
kAMwcw: "xlr8y92",
|
|
41
|
+
kSiTet: "xg01cxk xz63v9m x1ceiq2s xhva3ql",
|
|
42
|
+
kVAEAm: "x10l6tqk xd2i8i8 xw895rg x4k19zs",
|
|
43
|
+
$$css: true
|
|
44
|
+
},
|
|
45
|
+
revealLayoutPreserved: {
|
|
46
|
+
k1ekBW: "x19991ni",
|
|
47
|
+
kIyJzY: "xuedmi6 x12w9bfk",
|
|
48
|
+
kAMwcw: "xlr8y92",
|
|
49
|
+
kSiTet: "xg01cxk xz63v9m x1ceiq2s xhva3ql",
|
|
50
|
+
$$css: true
|
|
51
|
+
},
|
|
52
|
+
conceal: {
|
|
53
|
+
k1ekBW: "x19991ni",
|
|
54
|
+
kIyJzY: "xuedmi6 x12w9bfk",
|
|
55
|
+
kAMwcw: "xlr8y92",
|
|
56
|
+
kSiTet: "x1hc1fzr x1d23w33",
|
|
57
|
+
$$css: true
|
|
58
|
+
},
|
|
59
|
+
concealLayoutPreserved: {
|
|
60
|
+
k1ekBW: "x19991ni",
|
|
61
|
+
kIyJzY: "xuedmi6 x12w9bfk",
|
|
62
|
+
kAMwcw: "xlr8y92",
|
|
63
|
+
kSiTet: "x1hc1fzr x1d23w33",
|
|
64
|
+
$$css: true
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
export const m1 = {
|
|
68
|
+
x1e36hu2: "x1e36hu2",
|
|
69
|
+
$$css: true
|
|
70
|
+
};
|
|
71
|
+
const s1 = {
|
|
72
|
+
reveal: {
|
|
73
|
+
k1ekBW: "x19991ni",
|
|
74
|
+
kIyJzY: "xuedmi6 x12w9bfk",
|
|
75
|
+
kAMwcw: "xlr8y92",
|
|
76
|
+
kSiTet: "xg01cxk x7g73g2 x8e9lel xhva3ql",
|
|
77
|
+
kVAEAm: "x10l6tqk x13sqjsa xxj8d0r x4k19zs",
|
|
78
|
+
$$css: true
|
|
79
|
+
},
|
|
80
|
+
revealLayoutPreserved: {
|
|
81
|
+
k1ekBW: "x19991ni",
|
|
82
|
+
kIyJzY: "xuedmi6 x12w9bfk",
|
|
83
|
+
kAMwcw: "xlr8y92",
|
|
84
|
+
kSiTet: "xg01cxk x7g73g2 x8e9lel xhva3ql",
|
|
85
|
+
$$css: true
|
|
86
|
+
},
|
|
87
|
+
conceal: {
|
|
88
|
+
k1ekBW: "x19991ni",
|
|
89
|
+
kIyJzY: "xuedmi6 x12w9bfk",
|
|
90
|
+
kAMwcw: "xlr8y92",
|
|
91
|
+
kSiTet: "x1hc1fzr x19f70rm",
|
|
92
|
+
$$css: true
|
|
93
|
+
},
|
|
94
|
+
concealLayoutPreserved: {
|
|
95
|
+
k1ekBW: "x19991ni",
|
|
96
|
+
kIyJzY: "xuedmi6 x12w9bfk",
|
|
97
|
+
kAMwcw: "xlr8y92",
|
|
98
|
+
kSiTet: "x1hc1fzr x19f70rm",
|
|
99
|
+
$$css: true
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
export const m2 = {
|
|
103
|
+
x10zkftw: "x10zkftw",
|
|
104
|
+
$$css: true
|
|
105
|
+
};
|
|
106
|
+
const s2 = {
|
|
107
|
+
reveal: {
|
|
108
|
+
k1ekBW: "x19991ni",
|
|
109
|
+
kIyJzY: "xuedmi6 x12w9bfk",
|
|
110
|
+
kAMwcw: "xlr8y92",
|
|
111
|
+
kSiTet: "xg01cxk xe0m1oz xtpmopf xhva3ql",
|
|
112
|
+
kVAEAm: "x10l6tqk x1k2a1sm xs5no71 x4k19zs",
|
|
113
|
+
$$css: true
|
|
114
|
+
},
|
|
115
|
+
revealLayoutPreserved: {
|
|
116
|
+
k1ekBW: "x19991ni",
|
|
117
|
+
kIyJzY: "xuedmi6 x12w9bfk",
|
|
118
|
+
kAMwcw: "xlr8y92",
|
|
119
|
+
kSiTet: "xg01cxk xe0m1oz xtpmopf xhva3ql",
|
|
120
|
+
$$css: true
|
|
121
|
+
},
|
|
122
|
+
conceal: {
|
|
123
|
+
k1ekBW: "x19991ni",
|
|
124
|
+
kIyJzY: "xuedmi6 x12w9bfk",
|
|
125
|
+
kAMwcw: "xlr8y92",
|
|
126
|
+
kSiTet: "x1hc1fzr xramsae",
|
|
127
|
+
$$css: true
|
|
128
|
+
},
|
|
129
|
+
concealLayoutPreserved: {
|
|
130
|
+
k1ekBW: "x19991ni",
|
|
131
|
+
kIyJzY: "xuedmi6 x12w9bfk",
|
|
132
|
+
kAMwcw: "xlr8y92",
|
|
133
|
+
kSiTet: "x1hc1fzr xramsae",
|
|
134
|
+
$$css: true
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
export const m3 = {
|
|
138
|
+
xbjq1vy: "xbjq1vy",
|
|
139
|
+
$$css: true
|
|
140
|
+
};
|
|
141
|
+
const s3 = {
|
|
142
|
+
reveal: {
|
|
143
|
+
k1ekBW: "x19991ni",
|
|
144
|
+
kIyJzY: "xuedmi6 x12w9bfk",
|
|
145
|
+
kAMwcw: "xlr8y92",
|
|
146
|
+
kSiTet: "xg01cxk xnsjgr4 x1y0vk26 xhva3ql",
|
|
147
|
+
kVAEAm: "x10l6tqk x1cuf62g x1qy2sty x4k19zs",
|
|
148
|
+
$$css: true
|
|
149
|
+
},
|
|
150
|
+
revealLayoutPreserved: {
|
|
151
|
+
k1ekBW: "x19991ni",
|
|
152
|
+
kIyJzY: "xuedmi6 x12w9bfk",
|
|
153
|
+
kAMwcw: "xlr8y92",
|
|
154
|
+
kSiTet: "xg01cxk xnsjgr4 x1y0vk26 xhva3ql",
|
|
155
|
+
$$css: true
|
|
156
|
+
},
|
|
157
|
+
conceal: {
|
|
158
|
+
k1ekBW: "x19991ni",
|
|
159
|
+
kIyJzY: "xuedmi6 x12w9bfk",
|
|
160
|
+
kAMwcw: "xlr8y92",
|
|
161
|
+
kSiTet: "x1hc1fzr x177ftvf",
|
|
162
|
+
$$css: true
|
|
163
|
+
},
|
|
164
|
+
concealLayoutPreserved: {
|
|
165
|
+
k1ekBW: "x19991ni",
|
|
166
|
+
kIyJzY: "xuedmi6 x12w9bfk",
|
|
167
|
+
kAMwcw: "xlr8y92",
|
|
168
|
+
kSiTet: "x1hc1fzr x177ftvf",
|
|
169
|
+
$$css: true
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
export const m4 = {
|
|
173
|
+
x3z7t8n: "x3z7t8n",
|
|
174
|
+
$$css: true
|
|
175
|
+
};
|
|
176
|
+
const s4 = {
|
|
177
|
+
reveal: {
|
|
178
|
+
k1ekBW: "x19991ni",
|
|
179
|
+
kIyJzY: "xuedmi6 x12w9bfk",
|
|
180
|
+
kAMwcw: "xlr8y92",
|
|
181
|
+
kSiTet: "xg01cxk x1qps2i7 x1a7n03g xhva3ql",
|
|
182
|
+
kVAEAm: "x10l6tqk xeilikp x1xz04m3 x4k19zs",
|
|
183
|
+
$$css: true
|
|
184
|
+
},
|
|
185
|
+
revealLayoutPreserved: {
|
|
186
|
+
k1ekBW: "x19991ni",
|
|
187
|
+
kIyJzY: "xuedmi6 x12w9bfk",
|
|
188
|
+
kAMwcw: "xlr8y92",
|
|
189
|
+
kSiTet: "xg01cxk x1qps2i7 x1a7n03g xhva3ql",
|
|
190
|
+
$$css: true
|
|
191
|
+
},
|
|
192
|
+
conceal: {
|
|
193
|
+
k1ekBW: "x19991ni",
|
|
194
|
+
kIyJzY: "xuedmi6 x12w9bfk",
|
|
195
|
+
kAMwcw: "xlr8y92",
|
|
196
|
+
kSiTet: "x1hc1fzr x1k1siky",
|
|
197
|
+
$$css: true
|
|
198
|
+
},
|
|
199
|
+
concealLayoutPreserved: {
|
|
200
|
+
k1ekBW: "x19991ni",
|
|
201
|
+
kIyJzY: "xuedmi6 x12w9bfk",
|
|
202
|
+
kAMwcw: "xlr8y92",
|
|
203
|
+
kSiTet: "x1hc1fzr x1k1siky",
|
|
204
|
+
$$css: true
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
export const m5 = {
|
|
208
|
+
x6dglqq: "x6dglqq",
|
|
209
|
+
$$css: true
|
|
210
|
+
};
|
|
211
|
+
const s5 = {
|
|
212
|
+
reveal: {
|
|
213
|
+
k1ekBW: "x19991ni",
|
|
214
|
+
kIyJzY: "xuedmi6 x12w9bfk",
|
|
215
|
+
kAMwcw: "xlr8y92",
|
|
216
|
+
kSiTet: "xg01cxk x52nu6g xt179ik xhva3ql",
|
|
217
|
+
kVAEAm: "x10l6tqk x8j1s1q x8gw32m x4k19zs",
|
|
218
|
+
$$css: true
|
|
219
|
+
},
|
|
220
|
+
revealLayoutPreserved: {
|
|
221
|
+
k1ekBW: "x19991ni",
|
|
222
|
+
kIyJzY: "xuedmi6 x12w9bfk",
|
|
223
|
+
kAMwcw: "xlr8y92",
|
|
224
|
+
kSiTet: "xg01cxk x52nu6g xt179ik xhva3ql",
|
|
225
|
+
$$css: true
|
|
226
|
+
},
|
|
227
|
+
conceal: {
|
|
228
|
+
k1ekBW: "x19991ni",
|
|
229
|
+
kIyJzY: "xuedmi6 x12w9bfk",
|
|
230
|
+
kAMwcw: "xlr8y92",
|
|
231
|
+
kSiTet: "x1hc1fzr xenj0cg",
|
|
232
|
+
$$css: true
|
|
233
|
+
},
|
|
234
|
+
concealLayoutPreserved: {
|
|
235
|
+
k1ekBW: "x19991ni",
|
|
236
|
+
kIyJzY: "xuedmi6 x12w9bfk",
|
|
237
|
+
kAMwcw: "xlr8y92",
|
|
238
|
+
kSiTet: "x1hc1fzr xenj0cg",
|
|
239
|
+
$$css: true
|
|
240
|
+
}
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
// The compiled StyleX objects carry `when.ancestor` conditionals the public
|
|
244
|
+
// `StyleXStyles` type does not model, so the slot shape is inferred.
|
|
245
|
+
export const POOL = [{
|
|
246
|
+
marker: m0,
|
|
247
|
+
reveal: s0.reveal,
|
|
248
|
+
revealLayoutPreserved: s0.revealLayoutPreserved,
|
|
249
|
+
conceal: s0.conceal,
|
|
250
|
+
concealLayoutPreserved: s0.concealLayoutPreserved
|
|
251
|
+
}, {
|
|
252
|
+
marker: m1,
|
|
253
|
+
reveal: s1.reveal,
|
|
254
|
+
revealLayoutPreserved: s1.revealLayoutPreserved,
|
|
255
|
+
conceal: s1.conceal,
|
|
256
|
+
concealLayoutPreserved: s1.concealLayoutPreserved
|
|
257
|
+
}, {
|
|
258
|
+
marker: m2,
|
|
259
|
+
reveal: s2.reveal,
|
|
260
|
+
revealLayoutPreserved: s2.revealLayoutPreserved,
|
|
261
|
+
conceal: s2.conceal,
|
|
262
|
+
concealLayoutPreserved: s2.concealLayoutPreserved
|
|
263
|
+
}, {
|
|
264
|
+
marker: m3,
|
|
265
|
+
reveal: s3.reveal,
|
|
266
|
+
revealLayoutPreserved: s3.revealLayoutPreserved,
|
|
267
|
+
conceal: s3.conceal,
|
|
268
|
+
concealLayoutPreserved: s3.concealLayoutPreserved
|
|
269
|
+
}, {
|
|
270
|
+
marker: m4,
|
|
271
|
+
reveal: s4.reveal,
|
|
272
|
+
revealLayoutPreserved: s4.revealLayoutPreserved,
|
|
273
|
+
conceal: s4.conceal,
|
|
274
|
+
concealLayoutPreserved: s4.concealLayoutPreserved
|
|
275
|
+
}, {
|
|
276
|
+
marker: m5,
|
|
277
|
+
reveal: s5.reveal,
|
|
278
|
+
revealLayoutPreserved: s5.revealLayoutPreserved,
|
|
279
|
+
conceal: s5.conceal,
|
|
280
|
+
concealLayoutPreserved: s5.concealLayoutPreserved
|
|
281
|
+
}];
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -45,4 +45,6 @@ export type { InteractiveRole, UseInteractiveRoleOptions, } from './useInteracti
|
|
|
45
45
|
export { useLongPress } from './useLongPress';
|
|
46
46
|
export type { UseLongPressOptions, UseLongPressHandlers } from './useLongPress';
|
|
47
47
|
export { useDevWarning } from './useDevWarning';
|
|
48
|
+
export { useContainerReveal } from './useContainerReveal';
|
|
49
|
+
export type { UseContainerRevealOptions, UseContainerRevealReturn, ContentRevealOptions, } from './useContainerReveal';
|
|
48
50
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","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
30
30
|
export { useInputStatusIcon } from "./useInputStatusIcon.js";
|
|
31
31
|
export { useInteractiveRole } from "./useInteractiveRole.js";
|
|
32
32
|
export { useLongPress } from "./useLongPress.js";
|
|
33
|
-
export { useDevWarning } from "./useDevWarning.js";
|
|
33
|
+
export { useDevWarning } from "./useDevWarning.js";
|
|
34
|
+
export { useContainerReveal } from "./useContainerReveal.js";
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file useContainerReveal.ts
|
|
3
|
+
* @input Uses React, the generated marker pool, useDevWarning
|
|
4
|
+
* @output Exports useContainerReveal — a headless hover/focus reveal primitive
|
|
5
|
+
* @position Core hook. Consumed by any component that reveals (or conceals)
|
|
6
|
+
* content when its container is hovered or focused — e.g. Thumbnail's remove
|
|
7
|
+
* button, TreeList row actions.
|
|
8
|
+
*
|
|
9
|
+
* Gives a container a scoped hover/focus-within trigger that reveals or
|
|
10
|
+
* conceals content inside it, entirely in CSS (no hover state in JS, no
|
|
11
|
+
* re-render on hover). The caller authors NO StyleX: the hook hands out a
|
|
12
|
+
* marker + matching reveal styles from a pre-compiled pool.
|
|
13
|
+
*
|
|
14
|
+
* ACCESSIBILITY (WCAG 2.2 by construction):
|
|
15
|
+
* - Revealed content is visually hidden at rest via the clip recipe, so it
|
|
16
|
+
* stays in the accessibility tree and tab order — never display:none.
|
|
17
|
+
* - Keyboard: revealed on :focus-within, so tabbing in shows it.
|
|
18
|
+
* - Touch: always visible on coarse pointers; never gated behind hover.
|
|
19
|
+
* - Concealed (inverted) content is a mouse-only visual swap: it ignores
|
|
20
|
+
* :focus-within (a keyboard user must never watch content vanish) and stays
|
|
21
|
+
* visible on touch and in the a11y tree.
|
|
22
|
+
* - Motion: honors prefers-reduced-motion.
|
|
23
|
+
*
|
|
24
|
+
* SYNC: When modified, update:
|
|
25
|
+
* - /packages/core/src/hooks/index.ts (export)
|
|
26
|
+
* - containerReveal.pool.stylex.ts (if the slot shape changes)
|
|
27
|
+
*/
|
|
28
|
+
import { type CSSProperties } from 'react';
|
|
29
|
+
export interface UseContainerRevealOptions {
|
|
30
|
+
/**
|
|
31
|
+
* When false the hook is inert: no marker is applied and content getters
|
|
32
|
+
* return no styles, so content is always shown. Lets a component gate on its
|
|
33
|
+
* own prop (e.g. `revealOn === 'hover'`).
|
|
34
|
+
* @default true
|
|
35
|
+
*/
|
|
36
|
+
isEnabled?: boolean;
|
|
37
|
+
}
|
|
38
|
+
export interface ContentRevealOptions {
|
|
39
|
+
/**
|
|
40
|
+
* Conceal-on-hover instead of reveal-on-hover: content is visible at rest
|
|
41
|
+
* and fades out while the container is hovered. Mouse-only and visual —
|
|
42
|
+
* stays in the a11y tree, ignores focus-within, stays visible on touch.
|
|
43
|
+
* @default false
|
|
44
|
+
*/
|
|
45
|
+
isRevealInverted?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Reserve the content's layout box while hidden (opacity-only) instead of
|
|
48
|
+
* collapsing it, to avoid layout shift when it appears.
|
|
49
|
+
* @default false
|
|
50
|
+
*/
|
|
51
|
+
isLayoutPreserved?: boolean;
|
|
52
|
+
}
|
|
53
|
+
export interface UseContainerRevealReturn {
|
|
54
|
+
/** Spread onto the container whose hover/focus-within drives the reveal. */
|
|
55
|
+
getContainerProps: () => {
|
|
56
|
+
className?: string;
|
|
57
|
+
style?: CSSProperties;
|
|
58
|
+
};
|
|
59
|
+
/** Spread onto each revealed / concealed child. */
|
|
60
|
+
getContentRevealProps: (options?: ContentRevealOptions) => {
|
|
61
|
+
className?: string;
|
|
62
|
+
style?: CSSProperties;
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Scoped, CSS-only hover/focus reveal for content inside a container.
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```tsx
|
|
70
|
+
* const {getContainerProps, getContentRevealProps} = useContainerReveal({
|
|
71
|
+
* isEnabled: revealOn === 'hover',
|
|
72
|
+
* });
|
|
73
|
+
*
|
|
74
|
+
* <div {...mergeProps(getContainerProps(), stylex.props(styles.row))}>
|
|
75
|
+
* {label}
|
|
76
|
+
* <span {...mergeProps(getContentRevealProps(), stylex.props(styles.actions))}>
|
|
77
|
+
* {actions}
|
|
78
|
+
* </span>
|
|
79
|
+
* </div>
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
export declare function useContainerReveal(options?: UseContainerRevealOptions): UseContainerRevealReturn;
|
|
83
|
+
//# sourceMappingURL=useContainerReveal.d.ts.map
|