@astryxdesign/core 0.1.4-canary.37c19d3 → 0.1.4-canary.39ffd21

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.
Files changed (226) hide show
  1. package/dist/Banner/Banner.d.ts.map +1 -1
  2. package/dist/Banner/Banner.js +1 -8
  3. package/dist/Calendar/Calendar.d.ts.map +1 -1
  4. package/dist/Calendar/Calendar.js +11 -31
  5. package/dist/Calendar/styles.d.ts +2 -2
  6. package/dist/Calendar/styles.d.ts.map +1 -1
  7. package/dist/Calendar/styles.js +2 -2
  8. package/dist/Carousel/Carousel.d.ts.map +1 -1
  9. package/dist/Carousel/Carousel.js +0 -1
  10. package/dist/Chat/ChatToolCalls.d.ts.map +1 -1
  11. package/dist/Chat/ChatToolCalls.js +1 -8
  12. package/dist/CheckboxInput/CheckboxInput.d.ts +1 -1
  13. package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
  14. package/dist/CheckboxInput/CheckboxInput.js +1 -3
  15. package/dist/ClickableCard/ClickableCard.d.ts.map +1 -1
  16. package/dist/ClickableCard/ClickableCard.js +3 -26
  17. package/dist/CodeBlock/CodeBlock.d.ts +1 -10
  18. package/dist/CodeBlock/CodeBlock.d.ts.map +1 -1
  19. package/dist/CodeBlock/CodeBlock.js +5 -23
  20. package/dist/Collapsible/Collapsible.d.ts +3 -9
  21. package/dist/Collapsible/Collapsible.d.ts.map +1 -1
  22. package/dist/Collapsible/Collapsible.js +13 -101
  23. package/dist/Collapsible/CollapsibleGroup.d.ts +7 -39
  24. package/dist/Collapsible/CollapsibleGroup.d.ts.map +1 -1
  25. package/dist/Collapsible/CollapsibleGroup.js +9 -70
  26. package/dist/Collapsible/CollapsibleGroupContext.d.ts +0 -31
  27. package/dist/Collapsible/CollapsibleGroupContext.d.ts.map +1 -1
  28. package/dist/Collapsible/CollapsibleGroupContext.js +3 -33
  29. package/dist/Collapsible/index.d.ts +0 -1
  30. package/dist/Collapsible/index.d.ts.map +1 -1
  31. package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
  32. package/dist/ContextMenu/ContextMenu.js +0 -2
  33. package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
  34. package/dist/DateTimeInput/DateTimeInput.js +0 -2
  35. package/dist/Grid/Grid.d.ts +3 -4
  36. package/dist/Grid/Grid.d.ts.map +1 -1
  37. package/dist/Grid/Grid.js +9 -26
  38. package/dist/Icon/Icon.d.ts.map +1 -1
  39. package/dist/Icon/Icon.js +1 -5
  40. package/dist/Lightbox/Lightbox.d.ts.map +1 -1
  41. package/dist/Lightbox/Lightbox.js +2 -26
  42. package/dist/NumberInput/NumberInput.d.ts.map +1 -1
  43. package/dist/NumberInput/NumberInput.js +16 -32
  44. package/dist/Pagination/Pagination.d.ts.map +1 -1
  45. package/dist/Pagination/Pagination.js +36 -87
  46. package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
  47. package/dist/PowerSearch/PowerSearch.js +21 -39
  48. package/dist/ProgressBar/ProgressBar.d.ts.map +1 -1
  49. package/dist/ProgressBar/ProgressBar.js +1 -2
  50. package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
  51. package/dist/Resizable/ResizeHandle.js +2 -10
  52. package/dist/SideNav/SideNav.d.ts.map +1 -1
  53. package/dist/SideNav/SideNav.js +2 -6
  54. package/dist/TabList/TabMenu.d.ts.map +1 -1
  55. package/dist/TabList/TabMenu.js +7 -34
  56. package/dist/Table/BaseTable.d.ts.map +1 -1
  57. package/dist/Table/BaseTable.js +2 -12
  58. package/dist/Table/plugins/columnResize/useTableColumnResize.d.ts.map +1 -1
  59. package/dist/Table/plugins/columnResize/useTableColumnResize.js +2 -5
  60. package/dist/Table/plugins/pagination/paginateData.d.ts.map +1 -1
  61. package/dist/Table/plugins/pagination/paginateData.js +1 -5
  62. package/dist/Table/plugins/selection/useTableSelectionState.d.ts.map +1 -1
  63. package/dist/Table/plugins/selection/useTableSelectionState.js +1 -11
  64. package/dist/Table/plugins/sortable/useTableSortableState.d.ts.map +1 -1
  65. package/dist/Table/plugins/sortable/useTableSortableState.js +4 -8
  66. package/dist/Thumbnail/Thumbnail.d.ts +2 -3
  67. package/dist/Thumbnail/Thumbnail.d.ts.map +1 -1
  68. package/dist/Thumbnail/Thumbnail.js +0 -1
  69. package/dist/TimeInput/TimeInput.d.ts.map +1 -1
  70. package/dist/TimeInput/TimeInput.js +1 -6
  71. package/dist/Toast/Toast.d.ts.map +1 -1
  72. package/dist/Toast/Toast.js +3 -11
  73. package/dist/Toast/ToastViewport.d.ts.map +1 -1
  74. package/dist/Toast/ToastViewport.js +0 -12
  75. package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
  76. package/dist/Typeahead/BaseTypeahead.js +2 -5
  77. package/dist/astryx.css +0 -7
  78. package/dist/astryx.umd.js +48 -48
  79. package/dist/astryx.umd.js.map +4 -4
  80. package/dist/hooks/focusableSelector.d.ts +1 -1
  81. package/dist/hooks/focusableSelector.d.ts.map +1 -1
  82. package/dist/hooks/focusableSelector.js +1 -1
  83. package/dist/hooks/useFocusTrap.d.ts +0 -3
  84. package/dist/hooks/useFocusTrap.d.ts.map +1 -1
  85. package/dist/hooks/useFocusTrap.js +1 -38
  86. package/dist/theme/defineTheme.d.ts +1 -1
  87. package/dist/theme/defineTheme.d.ts.map +1 -1
  88. package/dist/theme/expandColorScale.d.ts.map +1 -1
  89. package/dist/theme/expandColorScale.js +3 -10
  90. package/dist/theme/hct.d.ts +15 -0
  91. package/dist/theme/hct.d.ts.map +1 -1
  92. package/dist/theme/hct.js +9 -9
  93. package/dist/theme/tokens.d.ts +2 -10
  94. package/dist/theme/tokens.d.ts.map +1 -1
  95. package/dist/theme/tokens.js +4 -220
  96. package/dist/utils/index.d.ts +0 -2
  97. package/dist/utils/index.d.ts.map +1 -1
  98. package/dist/utils/index.js +1 -2
  99. package/dist/utils/timeParser.d.ts.map +1 -1
  100. package/dist/utils/timeParser.js +5 -8
  101. package/package.json +1 -1
  102. package/src/Avatar/Avatar.doc.mjs +0 -11
  103. package/src/Banner/Banner.doc.mjs +0 -8
  104. package/src/Banner/Banner.test.tsx +0 -38
  105. package/src/Banner/Banner.tsx +1 -8
  106. package/src/Calendar/Calendar.doc.mjs +1 -1
  107. package/src/Calendar/Calendar.test.tsx +4 -112
  108. package/src/Calendar/Calendar.tsx +5 -26
  109. package/src/Calendar/styles.ts +2 -12
  110. package/src/Carousel/Carousel.doc.mjs +12 -12
  111. package/src/Carousel/Carousel.test.tsx +0 -13
  112. package/src/Carousel/Carousel.tsx +0 -1
  113. package/src/Chat/Chat.doc.mjs +1 -1
  114. package/src/Chat/ChatToolCalls.test.tsx +0 -55
  115. package/src/Chat/ChatToolCalls.tsx +12 -10
  116. package/src/CheckboxInput/CheckboxInput.doc.mjs +3 -3
  117. package/src/CheckboxInput/CheckboxInput.test.tsx +4 -71
  118. package/src/CheckboxInput/CheckboxInput.tsx +0 -2
  119. package/src/Citation/Citation.doc.mjs +0 -5
  120. package/src/ClickableCard/ClickableCard.tsx +2 -45
  121. package/src/CodeBlock/CodeBlock.doc.mjs +2 -7
  122. package/src/CodeBlock/CodeBlock.test.tsx +3 -87
  123. package/src/CodeBlock/CodeBlock.tsx +3 -43
  124. package/src/Collapsible/Collapsible.doc.mjs +4 -8
  125. package/src/Collapsible/Collapsible.tsx +10 -86
  126. package/src/Collapsible/CollapsibleGroup.doc.mjs +3 -27
  127. package/src/Collapsible/CollapsibleGroup.test.tsx +0 -288
  128. package/src/Collapsible/CollapsibleGroup.tsx +9 -107
  129. package/src/Collapsible/CollapsibleGroupContext.tsx +2 -42
  130. package/src/Collapsible/index.ts +0 -4
  131. package/src/CommandPalette/CommandPaletteEmpty.doc.mjs +0 -5
  132. package/src/CommandPalette/CommandPaletteGroup.doc.mjs +0 -10
  133. package/src/CommandPalette/CommandPaletteInput.doc.mjs +0 -6
  134. package/src/CommandPalette/CommandPaletteItem.doc.mjs +0 -6
  135. package/src/CommandPalette/CommandPaletteList.doc.mjs +0 -9
  136. package/src/ContextMenu/ContextMenu.doc.mjs +0 -15
  137. package/src/ContextMenu/ContextMenu.test.tsx +0 -15
  138. package/src/ContextMenu/ContextMenu.tsx +0 -2
  139. package/src/ContextMenu/ContextMenuItem.doc.mjs +0 -6
  140. package/src/DateTimeInput/DateTimeInput.test.tsx +0 -70
  141. package/src/DateTimeInput/DateTimeInput.tsx +0 -2
  142. package/src/Dialog/DialogHeader.doc.mjs +0 -45
  143. package/src/DropdownMenu/DropdownMenu.doc.mjs +1 -1
  144. package/src/Field/FieldLabel.test.tsx +2 -2
  145. package/src/FormLayout/__snapshots__/FormLayout.test.tsx.snap +3 -0
  146. package/src/Grid/Grid.test.tsx +18 -43
  147. package/src/Grid/Grid.tsx +9 -26
  148. package/src/Icon/Icon.test.tsx +29 -41
  149. package/src/Icon/Icon.tsx +2 -6
  150. package/src/Layout/LayoutContent.doc.mjs +0 -12
  151. package/src/Layout/LayoutPanel.doc.mjs +0 -40
  152. package/src/Lightbox/Lightbox.doc.mjs +0 -5
  153. package/src/Lightbox/Lightbox.test.tsx +2 -123
  154. package/src/Lightbox/Lightbox.tsx +1 -29
  155. package/src/NavMenu/NavMenu.doc.mjs +0 -15
  156. package/src/NumberInput/NumberInput.test.tsx +3 -48
  157. package/src/NumberInput/NumberInput.tsx +15 -32
  158. package/src/Overlay/Overlay.doc.mjs +0 -6
  159. package/src/Pagination/Pagination.test.tsx +0 -143
  160. package/src/Pagination/Pagination.tsx +23 -75
  161. package/src/Popover/Popover.test.tsx +0 -65
  162. package/src/PowerSearch/PowerSearch.doc.mjs +2 -2
  163. package/src/PowerSearch/PowerSearch.test.tsx +1 -109
  164. package/src/PowerSearch/PowerSearch.tsx +16 -37
  165. package/src/ProgressBar/ProgressBar.test.tsx +0 -10
  166. package/src/ProgressBar/ProgressBar.tsx +1 -2
  167. package/src/Resizable/ResizeHandle.tsx +2 -10
  168. package/src/SegmentedControl/SegmentedControl.doc.mjs +1 -1
  169. package/src/SelectableCard/SelectableCard.doc.mjs +1 -1
  170. package/src/SideNav/SideNav.doc.mjs +1 -7
  171. package/src/SideNav/SideNav.test.tsx +0 -20
  172. package/src/SideNav/SideNav.tsx +2 -6
  173. package/src/TabList/TabList.test.tsx +1 -185
  174. package/src/TabList/TabMenu.tsx +9 -45
  175. package/src/Table/BaseTable.tsx +1 -11
  176. package/src/Table/Table.test.tsx +0 -51
  177. package/src/Table/plugins/columnResize/useTableColumnResize.test.tsx +0 -13
  178. package/src/Table/plugins/columnResize/useTableColumnResize.tsx +1 -3
  179. package/src/Table/plugins/pagination/paginateData.ts +1 -5
  180. package/src/Table/plugins/pagination/useTablePagination.test.tsx +0 -13
  181. package/src/Table/plugins/selection/useTableSelectionState.test.tsx +0 -23
  182. package/src/Table/plugins/selection/useTableSelectionState.tsx +6 -11
  183. package/src/Table/plugins/sortable/useTableSortableState.test.tsx +1 -35
  184. package/src/Table/plugins/sortable/useTableSortableState.tsx +4 -8
  185. package/src/TextArea/TextArea.test.tsx +3 -3
  186. package/src/TextInput/TextInput.test.tsx +3 -3
  187. package/src/Thumbnail/Thumbnail.test.tsx +2 -36
  188. package/src/Thumbnail/Thumbnail.tsx +2 -4
  189. package/src/TimeInput/TimeInput.test.tsx +0 -37
  190. package/src/TimeInput/TimeInput.tsx +1 -11
  191. package/src/Timestamp/Timestamp.doc.mjs +1 -1
  192. package/src/Toast/Toast.tsx +3 -11
  193. package/src/Toast/ToastViewport.test.tsx +0 -64
  194. package/src/Toast/ToastViewport.tsx +0 -12
  195. package/src/ToggleButton/ToggleButton.doc.mjs +0 -1
  196. package/src/Tokenizer/Tokenizer.doc.mjs +2 -2
  197. package/src/TopNav/TopNav.doc.mjs +1 -1
  198. package/src/TreeList/TreeList.doc.mjs +2 -2
  199. package/src/Typeahead/BaseTypeahead.doc.mjs +0 -19
  200. package/src/Typeahead/BaseTypeahead.tsx +2 -5
  201. package/src/Typeahead/Typeahead.doc.mjs +1 -1
  202. package/src/Typeahead/Typeahead.test.tsx +1 -45
  203. package/src/hooks/focusableSelector.ts +1 -1
  204. package/src/hooks/useFocusTrap.doc.mjs +2 -4
  205. package/src/hooks/useFocusTrap.test.tsx +1 -149
  206. package/src/hooks/useFocusTrap.ts +1 -50
  207. package/src/theme/SyntaxTheme.doc.mjs +4 -4
  208. package/src/theme/defineTheme.ts +13 -4
  209. package/src/theme/derivedVarRegistry.test.ts +2 -2
  210. package/src/theme/expandColorScale.test.ts +0 -29
  211. package/src/theme/expandColorScale.ts +6 -11
  212. package/src/theme/hct.ts +17 -9
  213. package/src/theme/tokens.test.ts +9 -182
  214. package/src/theme/tokens.ts +4 -239
  215. package/src/theme/useTheme.test.tsx +0 -20
  216. package/src/utils/index.ts +0 -3
  217. package/src/utils/timeParser.test.ts +0 -13
  218. package/src/utils/timeParser.ts +5 -8
  219. package/dist/utils/color.d.ts +0 -42
  220. package/dist/utils/color.d.ts.map +0 -1
  221. package/dist/utils/color.js +0 -150
  222. package/src/Resizable/ResizeHandle.test.tsx +0 -180
  223. package/src/__tests__/TestIcon.tsx +0 -26
  224. package/src/docPropReferences.test.ts +0 -178
  225. package/src/utils/color.test.ts +0 -133
  226. package/src/utils/color.ts +0 -148
@@ -4,18 +4,13 @@
4
4
 
5
5
  /**
6
6
  * @file CollapsibleGroup.tsx
7
- * @input Uses React useState, useCallback, CollapsibleGroupContext, StyleX, theme tokens
7
+ * @input Uses React useState, useCallback, CollapsibleGroupContext
8
8
  * @output Exports CollapsibleGroup component and CollapsibleGroupProps
9
- * @position Core collapsible group coordination provider — renders no wrapper
10
- * DOM unless `dividers` is enabled
9
+ * @position Core collapsible group coordination provider — renders no wrapper DOM
11
10
  *
12
11
  * CollapsibleGroup groups collapsible components (Card, etc.) with
13
- * coordinated open/close behavior. By default it renders only `{children}` —
14
- * no wrapper DOM element. When `dividers` is 'between' or 'all' it renders a
15
- * wrapper div that anchors the divider chrome (outer borders, reliable
16
- * :first-child suppression) and provides dividers/density to items via
17
- * CollapsibleGroupPresentationContext — each Collapsible draws its own
18
- * borders since StyleX has no child selectors.
12
+ * coordinated open/close behavior. It renders only `{children}` — no wrapper
13
+ * DOM element.
19
14
  *
20
15
  * In "single" mode (default), only one item can be open at a time.
21
16
  * In "multiple" mode, any number of items can be open simultaneously.
@@ -29,35 +24,10 @@
29
24
  */
30
25
 
31
26
  import React, {useCallback, useMemo, useState, type ReactNode} from 'react';
32
- import * as stylex from '@stylexjs/stylex';
33
- import {borderVars, colorVars} from '../theme/tokens.stylex';
34
- import {
35
- CollapsibleGroupContext,
36
- CollapsibleGroupPresentationContext,
37
- } from './CollapsibleGroupContext';
38
- import type {
39
- CollapsibleGroupContextValue,
40
- CollapsibleGroupDensity,
41
- CollapsibleGroupDividers,
42
- CollapsibleGroupPresentationValue,
43
- } from './CollapsibleGroupContext';
44
- import {mergeProps} from '../utils';
45
- import {themeProps} from '../utils/themeProps';
27
+ import {CollapsibleGroupContext} from './CollapsibleGroupContext';
28
+ import type {CollapsibleGroupContextValue} from './CollapsibleGroupContext';
46
29
  import type {BaseProps} from '../BaseProps';
47
30
 
48
- const styles = stylex.create({
49
- // 'all' draws the group's outer top/bottom edges; between-item lines are
50
- // drawn by each Collapsible (borderBlockStart, suppressed on :first-child)
51
- wrapperAll: {
52
- borderBlockStartWidth: borderVars['--border-width'],
53
- borderBlockStartStyle: 'solid',
54
- borderBlockStartColor: colorVars['--color-border'],
55
- borderBlockEndWidth: borderVars['--border-width'],
56
- borderBlockEndStyle: 'solid',
57
- borderBlockEndColor: colorVars['--color-border'],
58
- },
59
- });
60
-
61
31
  export interface CollapsibleGroupProps extends Omit<
62
32
  BaseProps<HTMLElement>,
63
33
  'onChange'
@@ -86,24 +56,6 @@ export interface CollapsibleGroupProps extends Omit<
86
56
  */
87
57
  onChange?: (value: string | string[]) => void;
88
58
 
89
- /**
90
- * Divider style rendered around the group's items — the accordion row
91
- * chrome. 'between' draws hairlines between adjacent items; 'all' adds the
92
- * group's top and bottom edges. When enabled, the group renders a wrapper
93
- * div (it otherwise renders no DOM) and items get 'balanced' density unless
94
- * `density` says otherwise. Pair with bare Collapsible children; Card-wrapped
95
- * items provide their own separation.
96
- * @default "none"
97
- */
98
- dividers?: CollapsibleGroupDividers;
99
-
100
- /**
101
- * Row density controlling trigger and content block padding on the group's
102
- * items. Defaults to 'balanced' when dividers are shown; otherwise items
103
- * keep their default unpadded look.
104
- */
105
- density?: CollapsibleGroupDensity;
106
-
107
59
  /**
108
60
  * Children — any components that support isCollapsible + value.
109
61
  *
@@ -140,26 +92,16 @@ function normalizeToArray(value: string | string[] | undefined): string[] {
140
92
 
141
93
  /**
142
94
  * Groups collapsible components with coordinated open/close behavior.
143
- * Renders no wrapper DOM unless `dividers` is enabled.
95
+ * Renders no wrapper DOM.
144
96
  *
145
97
  * In "single" mode (default), opening one item closes the others.
146
98
  * In "multiple" mode, items toggle independently.
147
99
  *
148
100
  * @compositionHint Wrap Collapsible instances to coordinate their open/close state.
149
- * Each Collapsible needs a `value` prop to participate. For FAQ-style lists,
150
- * use `dividers` with bare Collapsible children instead of wrapping each item
151
- * in Card.
101
+ * Each Collapsible needs a `value` prop to participate.
152
102
  *
153
103
  * @example
154
104
  * ```
155
- * <CollapsibleGroup type="single" dividers="between" defaultValue="faq1">
156
- * <Collapsible trigger="What is Astryx?" value="faq1">
157
- * Astryx is a design system for building internal tools.
158
- * </Collapsible>
159
- * <Collapsible trigger="How do I start?" value="faq2">
160
- * Install the package and import components.
161
- * </Collapsible>
162
- * </CollapsibleGroup>
163
105
  * <CollapsibleGroup type="single" defaultValue="faq1">
164
106
  * <VStack gap={2}>
165
107
  * <Card>
@@ -181,14 +123,7 @@ export function CollapsibleGroup({
181
123
  defaultValue,
182
124
  value: controlledValue,
183
125
  onChange,
184
- dividers = 'none',
185
- density,
186
126
  children,
187
- ref,
188
- xstyle,
189
- className,
190
- style,
191
- ...props
192
127
  }: CollapsibleGroupProps) {
193
128
  const isControlled = controlledValue !== undefined;
194
129
  const [internalValue, setInternalValue] = useState<string[]>(() =>
@@ -239,42 +174,9 @@ export function CollapsibleGroup({
239
174
  [isOpen, toggle],
240
175
  );
241
176
 
242
- const hasDividers = dividers !== 'none';
243
- const resolvedDensity = density ?? (hasDividers ? 'balanced' : null);
244
-
245
- const presentationValue = useMemo<CollapsibleGroupPresentationValue>(
246
- () => ({dividers, density: resolvedDensity}),
247
- [dividers, resolvedDensity],
248
- );
249
-
250
- // The wrapper anchors divider chrome: 'all' outer borders live here, and it
251
- // makes the items' :first-child suppression independent of surrounding
252
- // siblings. Without dividers the group stays DOM-less (documented contract),
253
- // so ref/xstyle/className/style only take effect in wrapper mode.
254
- const content = hasDividers ? (
255
- <div
256
- ref={ref as React.Ref<HTMLDivElement>}
257
- {...mergeProps(
258
- themeProps('collapsible-group', {
259
- dividers,
260
- density: resolvedDensity ?? undefined,
261
- }),
262
- stylex.props(dividers === 'all' && styles.wrapperAll, xstyle),
263
- className,
264
- style,
265
- )}
266
- {...props}>
267
- {children}
268
- </div>
269
- ) : (
270
- children
271
- );
272
-
273
177
  return (
274
178
  <CollapsibleGroupContext value={contextValue}>
275
- <CollapsibleGroupPresentationContext value={presentationValue}>
276
- {content}
277
- </CollapsibleGroupPresentationContext>
179
+ {children}
278
180
  </CollapsibleGroupContext>
279
181
  );
280
182
  }
@@ -5,10 +5,8 @@
5
5
  /**
6
6
  * @file CollapsibleGroupContext.tsx
7
7
  * @input Uses React createContext
8
- * @output Exports CollapsibleGroupContext, CollapsibleGroupContextValue,
9
- * CollapsibleGroupPresentationContext, CollapsibleGroupPresentationValue,
10
- * CollapsibleGroupDividers, and CollapsibleGroupDensity types
11
- * @position Context definitions for collapsible group coordination and presentation
8
+ * @output Exports CollapsibleGroupContext and CollapsibleGroupContextValue type
9
+ * @position Context definition for collapsible group coordination
12
10
  *
13
11
  * SYNC: When modified, update these files to stay in sync:
14
12
  * - /packages/core/src/Collapsible/CollapsibleGroup.tsx (provider)
@@ -35,41 +33,3 @@ export interface CollapsibleGroupContextValue {
35
33
  export const CollapsibleGroupContext =
36
34
  createContext<CollapsibleGroupContextValue | null>(null);
37
35
  CollapsibleGroupContext.displayName = 'CollapsibleGroupContext';
38
-
39
- /**
40
- * Divider style rendered around the items of a CollapsibleGroup.
41
- * - 'between': hairlines between adjacent items only.
42
- * - 'all': hairlines between items plus the group's top and bottom edges.
43
- * - 'none': no dividers (default).
44
- */
45
- export type CollapsibleGroupDividers = 'between' | 'all' | 'none';
46
-
47
- /**
48
- * Row density for the items of a CollapsibleGroup, controlling trigger and
49
- * content block padding. Shares the repo-wide density vocabulary
50
- * (Table, List, Item).
51
- */
52
- export type CollapsibleGroupDensity = 'compact' | 'balanced' | 'spacious';
53
-
54
- /**
55
- * Presentation value provided by CollapsibleGroup so each Collapsible can
56
- * draw its own group chrome (StyleX has no child selectors, so the group
57
- * cannot style items from the outside).
58
- */
59
- export interface CollapsibleGroupPresentationValue {
60
- /** Resolved divider style for the group's items. */
61
- dividers: CollapsibleGroupDividers;
62
- /** Resolved row density, or null to keep the default (unpadded) look. */
63
- density: CollapsibleGroupDensity | null;
64
- }
65
-
66
- /**
67
- * Context for collapsible group presentation (dividers, density).
68
- * Kept separate from CollapsibleGroupContext so the public useCollapsible
69
- * state API is unaffected. Collapsible resets this context around its
70
- * children so nested collapsibles never inherit row chrome.
71
- */
72
- export const CollapsibleGroupPresentationContext =
73
- createContext<CollapsibleGroupPresentationValue | null>(null);
74
- CollapsibleGroupPresentationContext.displayName =
75
- 'CollapsibleGroupPresentationContext';
@@ -16,10 +16,6 @@ export type {CollapsibleProps} from './Collapsible';
16
16
 
17
17
  export {CollapsibleGroup} from './CollapsibleGroup';
18
18
  export type {CollapsibleGroupProps} from './CollapsibleGroup';
19
- export type {
20
- CollapsibleGroupDividers,
21
- CollapsibleGroupDensity,
22
- } from './CollapsibleGroupContext';
23
19
 
24
20
  export {useCollapsible} from './useCollapsible';
25
21
  export type {
@@ -16,11 +16,6 @@ export const docs = {
16
16
  required: true,
17
17
  },
18
18
  ],
19
- playground: {
20
- defaults: {
21
- children: 'No results found. Try a different search.',
22
- },
23
- },
24
19
  };
25
20
 
26
21
  export const docsZh = {
@@ -27,16 +27,6 @@ export const docs = {
27
27
  description: 'StyleX styles for layout customization. Must be a stylex.create() value.',
28
28
  },
29
29
  ],
30
- playground: {
31
- defaults: {
32
- heading: 'Navigation',
33
- children: [
34
- {__element: 'CommandPaletteItem', props: {value: 'home', onSelect: undefined}, children: 'Go Home'},
35
- {__element: 'CommandPaletteItem', props: {value: 'settings', onSelect: undefined}, children: 'Open Settings'},
36
- {__element: 'CommandPaletteItem', props: {value: 'profile', onSelect: undefined}, children: 'View Profile'},
37
- ],
38
- },
39
- },
40
30
  };
41
31
 
42
32
  export const docsZh = {
@@ -57,12 +57,6 @@ export const docs = {
57
57
  description: 'StyleX styles for layout customization. Must be a stylex.create() value.',
58
58
  },
59
59
  ],
60
- playground: {
61
- defaults: {
62
- placeholder: 'Search commands, files, or actions...',
63
- hasAutoFocus: false,
64
- },
65
- },
66
60
  };
67
61
 
68
62
  export const docsZh = {
@@ -50,12 +50,6 @@ export const docs = {
50
50
  description: 'StyleX styles for layout customization. Must be a stylex.create() value.',
51
51
  },
52
52
  ],
53
- playground: {
54
- defaults: {
55
- value: 'go-home',
56
- children: 'Go to Dashboard',
57
- },
58
- },
59
53
  };
60
54
 
61
55
  export const docsZh = {
@@ -27,15 +27,6 @@ export const docs = {
27
27
  description: 'StyleX styles for layout customization. Must be a stylex.create() value.',
28
28
  },
29
29
  ],
30
- playground: {
31
- defaults: {
32
- children: [
33
- {__element: 'CommandPaletteItem', props: {value: 'home', onSelect: undefined}, children: 'Go Home'},
34
- {__element: 'CommandPaletteItem', props: {value: 'settings', onSelect: undefined}, children: 'Open Settings'},
35
- {__element: 'CommandPaletteItem', props: {value: 'profile', onSelect: undefined}, children: 'View Profile'},
36
- ],
37
- },
38
- },
39
30
  };
40
31
 
41
32
  export const docsZh = {
@@ -78,21 +78,6 @@ export const docs = {
78
78
  { guidance: false, description: 'Place more than 10–12 items in a single menu without grouping them into sections.' },
79
79
  ],
80
80
  },
81
- playground: {
82
- defaults: {
83
- children: {
84
- __element: 'Card',
85
- props: {padding: 6},
86
- children: {__element: 'Text', props: {color: 'secondary'}, children: 'Right-click this area'},
87
- },
88
- items: [
89
- {label: 'Edit'},
90
- {label: 'Duplicate'},
91
- {type: 'divider'},
92
- {label: 'Delete'},
93
- ],
94
- },
95
- },
96
81
  };
97
82
 
98
83
  /** @type {import('../docs-types').TranslationDoc} */
@@ -172,21 +172,6 @@ describe('ContextMenu', () => {
172
172
  expect(preventDefault).toHaveBeenCalled();
173
173
  });
174
174
 
175
- it('prevents default context menu on the opened menu container', () => {
176
- render(
177
- <ContextMenu items={[{label: 'Item 1'}]}>
178
- <div>Right-click me</div>
179
- </ContextMenu>,
180
- );
181
-
182
- fireEvent.contextMenu(screen.getByText('Right-click me'));
183
- const menu = screen.getByRole('menu', {hidden: true});
184
- const event = new MouseEvent('contextmenu', {bubbles: true});
185
- const preventDefault = vi.spyOn(event, 'preventDefault');
186
- menu.dispatchEvent(event);
187
- expect(preventDefault).toHaveBeenCalled();
188
- });
189
-
190
175
  it('does not open when isDisabled is true', () => {
191
176
  render(
192
177
  <ContextMenu items={[{label: 'Item 1'}]} isDisabled>
@@ -87,7 +87,6 @@ const styles = stylex.create({
87
87
  transitionProperty: 'opacity',
88
88
  transitionDuration: durationVars['--duration-fast'],
89
89
  transitionTimingFunction: easeVars['--ease-standard'],
90
- userSelect: 'none',
91
90
  },
92
91
  popover: {
93
92
  minWidth: '160px',
@@ -410,7 +409,6 @@ export function ContextMenu({
410
409
  role="menu"
411
410
  aria-label={label}
412
411
  onKeyDown={listKeyDown}
413
- onContextMenu={e => e.preventDefault()}
414
412
  {...mergeProps(
415
413
  themeProps('context-menu'),
416
414
  stylex.props(styles.menu, xstyle),
@@ -35,12 +35,6 @@ export const docs = {
35
35
  description: 'StyleX styles for layout customization.',
36
36
  },
37
37
  ],
38
- playground: {
39
- defaults: {
40
- label: 'Edit',
41
- description: 'Modify this item',
42
- },
43
- },
44
38
  };
45
39
 
46
40
  export const docsZh = {
@@ -214,21 +214,6 @@ describe('DateTimeInput', () => {
214
214
  expect(screen.getByRole('combobox')).not.toHaveAttribute('aria-busy');
215
215
  });
216
216
 
217
- it('sets aria-busy on the time input when isLoading is true', () => {
218
- render(<DateTimeInput label="Meeting" isLoading onChange={() => {}} />);
219
- expect(screen.getByLabelText('Meeting time')).toHaveAttribute(
220
- 'aria-busy',
221
- 'true',
222
- );
223
- });
224
-
225
- it('does not set aria-busy on the time input when not loading', () => {
226
- render(<DateTimeInput label="Meeting" onChange={() => {}} />);
227
- expect(screen.getByLabelText('Meeting time')).not.toHaveAttribute(
228
- 'aria-busy',
229
- );
230
- });
231
-
232
217
  it('renders status icon for error status', () => {
233
218
  render(
234
219
  <DateTimeInput
@@ -285,61 +270,6 @@ describe('DateTimeInput', () => {
285
270
  expect(found).toBe(true);
286
271
  });
287
272
 
288
- it('links the description to the time input via aria-describedby', () => {
289
- render(
290
- <DateTimeInput
291
- label="Meeting"
292
- description="Pick the meeting datetime"
293
- onChange={() => {}}
294
- />,
295
- );
296
- // The description covers both halves of the field, so the time input must
297
- // carry it too — a screen-reader user tabbing into the time half should
298
- // not lose the field's description.
299
- const timeInput = screen.getByLabelText('Meeting time');
300
- const describedBy = timeInput.getAttribute('aria-describedby')!;
301
- const ids = describedBy.split(' ');
302
- const found = ids.some(id =>
303
- document
304
- .getElementById(id)
305
- ?.textContent?.includes('Pick the meeting datetime'),
306
- );
307
- expect(found).toBe(true);
308
- });
309
-
310
- it('links the status message to the time input via aria-describedby', () => {
311
- render(
312
- <DateTimeInput
313
- label="Meeting"
314
- onChange={() => {}}
315
- status={{type: 'error', message: 'Invalid datetime'}}
316
- />,
317
- );
318
- const timeInput = screen.getByLabelText('Meeting time');
319
- const describedBy = timeInput.getAttribute('aria-describedby')!;
320
- const ids = describedBy.split(' ');
321
- const found = ids.some(id =>
322
- document.getElementById(id)?.textContent?.includes('Invalid datetime'),
323
- );
324
- expect(found).toBe(true);
325
- });
326
-
327
- it('links the disabled reason to the time input via aria-describedby', () => {
328
- HTMLElement.prototype.showPopover = vi.fn();
329
- HTMLElement.prototype.hidePopover = vi.fn();
330
- render(
331
- <DateTimeInput
332
- label="When"
333
- onChange={() => {}}
334
- isDisabled
335
- disabledMessage="You need the Editor role"
336
- />,
337
- );
338
- const timeInput = screen.getByLabelText('When time');
339
- const tooltip = screen.getByRole('tooltip', {hidden: true});
340
- expect(timeInput.getAttribute('aria-describedby')).toContain(tooltip.id);
341
- });
342
-
343
273
  it('handles Escape keydown on date input without error', () => {
344
274
  render(<DateTimeInput label="Meeting" onChange={() => {}} />);
345
275
  const input = screen.getByRole('combobox');
@@ -987,12 +987,10 @@ export function DateTimeInput({
987
987
  aria-disabled={showsDisabledMessage ? 'true' : undefined}
988
988
  readOnly={showsDisabledMessage || undefined}
989
989
  aria-label={timeLabel ?? `${label} time`}
990
- aria-describedby={ariaDescribedBy}
991
990
  aria-required={isRequired === true ? 'true' : undefined}
992
991
  aria-invalid={
993
992
  status?.type === 'error' || !isTimeInputValid ? 'true' : undefined
994
993
  }
995
- aria-busy={isBusy || undefined}
996
994
  {...stylex.props(
997
995
  styles.input,
998
996
  isEffectivelyDisabled && styles.inputDisabled,
@@ -65,51 +65,6 @@ export const docs = {
65
65
  default: 'true',
66
66
  },
67
67
  ],
68
- playground: {
69
- defaults: {
70
- title: 'Delete file?',
71
- subtitle: 'This action cannot be undone.',
72
- hasDivider: true,
73
- },
74
- },
75
- examples: [
76
- {
77
- label: 'Basic',
78
- code: `
79
- import {DialogHeader} from '@astryxdesign/core/Dialog';
80
-
81
- <DialogHeader title="Delete file?" subtitle="This action cannot be undone." />;
82
- `,
83
- },
84
- {
85
- label: 'With close button',
86
- code: `
87
- import {useState} from 'react';
88
- import {DialogHeader} from '@astryxdesign/core/Dialog';
89
-
90
- function Header() {
91
- const [, setIsOpen] = useState(true);
92
-
93
- // Passing onOpenChange renders a close button that calls it with false.
94
- return <DialogHeader title="Settings" onOpenChange={setIsOpen} />;
95
- }
96
- `,
97
- },
98
- {
99
- label: 'With start and end content',
100
- code: `
101
- import {DialogHeader} from '@astryxdesign/core/Dialog';
102
- import {Icon} from '@astryxdesign/core/Icon';
103
- import {Badge} from '@astryxdesign/core/Badge';
104
-
105
- <DialogHeader
106
- title="Notifications"
107
- startContent={<Icon icon="chevronLeft" size="sm" />}
108
- endContent={<Badge label="3" />}
109
- />;
110
- `,
111
- },
112
- ],
113
68
  };
114
69
 
115
70
  export const docsZh = {
@@ -11,7 +11,7 @@ export const docs = {
11
11
  theming: {
12
12
  targets: [
13
13
  {className: 'astryx-dropdown-menu'},
14
- {className: 'astryx-dropdown-menu-item', visualProps: ['size']},
14
+ {className: 'astryx-dropdown-menu-item'},
15
15
  ],
16
16
  vars: [
17
17
  {name: '--_dropdown-menu-radius', description: 'Border radius of the menu popup', default: 'var(--radius-element)', private: true},
@@ -11,7 +11,7 @@
11
11
 
12
12
  import {describe, it, expect, vi} from 'vitest';
13
13
  import {render, screen} from '@testing-library/react';
14
- import {TestIcon} from '../__tests__/TestIcon';
14
+ import {StarIcon} from '@heroicons/react/24/outline';
15
15
  import {FieldLabel} from './FieldLabel';
16
16
 
17
17
  describe('FieldLabel', () => {
@@ -49,7 +49,7 @@ describe('FieldLabel', () => {
49
49
  <FieldLabel
50
50
  label="Starred"
51
51
  inputID="starred-input"
52
- labelIcon={TestIcon}
52
+ labelIcon={StarIcon}
53
53
  />,
54
54
  );
55
55
  const svg = document.querySelector('svg');
@@ -4,6 +4,7 @@ exports[`FormLayout > matches snapshot for horizontal direction 1`] = `
4
4
  <div
5
5
  class="astryx-form-layout horizontal FormLayout__styles.base xdt5ytf x18g69wz FormLayout__styles.horizontal xrvj5dj x1mt1orb xu6a5m6"
6
6
  data-direction="horizontal"
7
+ data-style-src="@astryxdesign/core:src/FormLayout/FormLayout.tsx:40; @astryxdesign/core:src/FormLayout/FormLayout.tsx:45"
7
8
  data-testid="layout"
8
9
  >
9
10
  <input
@@ -19,6 +20,7 @@ exports[`FormLayout > matches snapshot for horizontal-labels direction 1`] = `
19
20
  <div
20
21
  class="astryx-form-layout horizontal-labels FormLayout__styles.base xdt5ytf FormLayout__styles.horizontalLabels xrvj5dj x1pmbctz xlaq8a2 x7a106z xedohl4 x1rpgqan x1a1jff"
21
22
  data-direction="horizontal-labels"
23
+ data-style-src="@astryxdesign/core:src/FormLayout/FormLayout.tsx:40; @astryxdesign/core:src/FormLayout/FormLayout.tsx:50"
22
24
  data-testid="layout"
23
25
  >
24
26
  <label>
@@ -34,6 +36,7 @@ exports[`FormLayout > matches snapshot for vertical direction 1`] = `
34
36
  <div
35
37
  class="astryx-form-layout vertical FormLayout__styles.base x78zum5 xdt5ytf x18g69wz"
36
38
  data-direction="vertical"
39
+ data-style-src="@astryxdesign/core:src/FormLayout/FormLayout.tsx:40"
37
40
  data-testid="layout"
38
41
  >
39
42
  <input