@wix/site-ui 1.30.0 → 1.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. package/dist/1268.js +99 -0
  2. package/dist/1279.js +7 -0
  3. package/dist/1457.js +10 -0
  4. package/dist/1477.js +106 -0
  5. package/dist/1500.js +111 -0
  6. package/dist/167.js +6 -0
  7. package/dist/2274.js +34 -0
  8. package/dist/2287.js +17 -0
  9. package/dist/2418.js +31 -0
  10. package/dist/2801.js +20 -0
  11. package/dist/285.js +86 -0
  12. package/dist/2861.js +6 -0
  13. package/dist/3020.js +7 -0
  14. package/dist/3021.js +72 -0
  15. package/dist/3056.js +229 -0
  16. package/dist/3140.js +4 -0
  17. package/dist/3248.js +307 -0
  18. package/dist/3296.js +4 -0
  19. package/dist/3319.js +400 -0
  20. package/dist/3395.js +4 -0
  21. package/dist/3485.js +854 -0
  22. package/dist/353.js +14 -0
  23. package/dist/3670.js +418 -0
  24. package/dist/3829.js +113 -0
  25. package/dist/4026.js +12 -0
  26. package/dist/4143.js +46 -0
  27. package/dist/42.js +32 -0
  28. package/dist/4281.js +30 -0
  29. package/dist/4346.js +2 -0
  30. package/dist/4388.js +418 -0
  31. package/dist/4490.js +32 -0
  32. package/dist/4495.js +9 -0
  33. package/dist/4549.js +24 -0
  34. package/dist/4586.js +41 -0
  35. package/dist/4586.js.LICENSE.txt +19 -0
  36. package/dist/4707.js +19 -0
  37. package/dist/4723.js +7 -0
  38. package/dist/4745.js +7 -0
  39. package/dist/4768.js +35 -0
  40. package/dist/4922.js +15 -0
  41. package/dist/5036.js +17 -0
  42. package/dist/5085.js +20 -0
  43. package/dist/5299.js +597 -0
  44. package/dist/5659.js +4 -0
  45. package/dist/5778.js +10 -0
  46. package/dist/5864.js +86 -0
  47. package/dist/5992.js +913 -0
  48. package/dist/5992.js.LICENSE.txt +19 -0
  49. package/dist/6003.js +10 -0
  50. package/dist/6046.js +29 -0
  51. package/dist/6089.js +2355 -0
  52. package/dist/6107.js +10 -0
  53. package/dist/6247.js +20 -0
  54. package/dist/6270.js +487 -0
  55. package/dist/6329.js +32 -0
  56. package/dist/6330.js +30 -0
  57. package/dist/6499.js +7 -0
  58. package/dist/6535.js +71 -0
  59. package/dist/6588.js +382 -0
  60. package/dist/6706.js +16 -0
  61. package/dist/6825.js +7 -0
  62. package/dist/6882.js +1562 -0
  63. package/dist/6914.js +30 -0
  64. package/dist/7021.js +13 -0
  65. package/dist/7366.js +83 -0
  66. package/dist/7373.js +25 -0
  67. package/dist/7541.js +25 -0
  68. package/dist/7564.js +10 -0
  69. package/dist/7642.js +20 -0
  70. package/dist/7725.js +10 -0
  71. package/dist/7871.js +38 -0
  72. package/dist/8052.js +352 -0
  73. package/dist/8106.js +238 -0
  74. package/dist/8171.js +346 -0
  75. package/dist/8225.js +21 -0
  76. package/dist/8272.js +333 -0
  77. package/dist/8527.js +58 -0
  78. package/dist/8724.js +10 -0
  79. package/dist/8750.js +1920 -0
  80. package/dist/8758.js +43 -0
  81. package/dist/880.js +149 -0
  82. package/dist/8935.js +8 -0
  83. package/dist/8960.js +22 -0
  84. package/dist/8971.js +40 -0
  85. package/dist/8979.js +10 -0
  86. package/dist/8996.js +71 -0
  87. package/dist/904.js +121 -0
  88. package/dist/9048.js +52 -0
  89. package/dist/9087.js +256 -0
  90. package/dist/9189.js +158 -0
  91. package/dist/9255.js +136 -0
  92. package/dist/9352.js +148 -0
  93. package/dist/951.js +22 -0
  94. package/dist/9635.js +22 -0
  95. package/dist/9829.js +4 -0
  96. package/dist/9863.js +8 -0
  97. package/dist/Accordion/index.d.ts +569 -12
  98. package/dist/Accordion/index.js +423 -8
  99. package/dist/AlertDialog/index.d.ts +1417 -18
  100. package/dist/AlertDialog/index.js +34 -14
  101. package/dist/Autocomplete/index.d.ts +1861 -38
  102. package/dist/Autocomplete/index.js +98 -24
  103. package/dist/Avatar/index.d.ts +129 -7
  104. package/dist/Avatar/index.js +149 -6
  105. package/dist/Breadcrumbs/index.d.ts +960 -7
  106. package/dist/Breadcrumbs/index.js +5 -5
  107. package/dist/Button/index.d.ts +88 -6
  108. package/dist/Button/index.js +27 -3
  109. package/dist/Checkbox/index.d.ts +425 -5
  110. package/dist/Checkbox/index.js +45 -5
  111. package/dist/CheckboxGroup/index.d.ts +318 -3
  112. package/dist/CheckboxGroup/index.js +166 -3
  113. package/dist/Collapsible/index.d.ts +377 -7
  114. package/dist/Collapsible/index.js +160 -6
  115. package/dist/Combobox/index.d.ts +1984 -48
  116. package/dist/Combobox/index.js +352 -29
  117. package/dist/ContextMenu/index.d.ts +2340 -36
  118. package/dist/ContextMenu/index.js +197 -22
  119. package/dist/Dialog/index.d.ts +1355 -18
  120. package/dist/Dialog/index.js +16 -14
  121. package/dist/Drawer/index.d.ts +1653 -18
  122. package/dist/Drawer/index.js +2797 -20
  123. package/dist/Field/index.d.ts +655 -15
  124. package/dist/Field/index.js +677 -10
  125. package/dist/Fieldset/index.d.ts +94 -5
  126. package/dist/Fieldset/index.js +68 -5
  127. package/dist/Form/index.d.ts +331 -2
  128. package/dist/Form/index.js +106 -3
  129. package/dist/Input/index.d.ts +692 -3
  130. package/dist/Input/index.js +10 -3
  131. package/dist/Menu/index.d.ts +2301 -36
  132. package/dist/Menu/index.js +365 -26
  133. package/dist/Menubar/index.d.ts +2301 -3
  134. package/dist/Menubar/index.js +105 -3
  135. package/dist/Meter/index.d.ts +175 -11
  136. package/dist/Meter/index.js +129 -9
  137. package/dist/NavigationMenu/index.d.ts +978 -28
  138. package/dist/NavigationMenu/index.js +1034 -17
  139. package/dist/NumberField/index.d.ts +612 -15
  140. package/dist/NumberField/index.js +1409 -11
  141. package/dist/Popover/index.d.ts +1655 -20
  142. package/dist/Popover/index.js +792 -17
  143. package/dist/PreviewCard/index.d.ts +1523 -14
  144. package/dist/PreviewCard/index.js +679 -14
  145. package/dist/Progress/index.d.ts +183 -11
  146. package/dist/Progress/index.js +181 -9
  147. package/dist/Radio/index.d.ts +185 -6
  148. package/dist/Radio/index.js +253 -6
  149. package/dist/RadioGroup/index.d.ts +341 -2
  150. package/dist/RadioGroup/index.js +154 -3
  151. package/dist/ScrollArea/index.d.ts +265 -13
  152. package/dist/ScrollArea/index.js +892 -10
  153. package/dist/Select/index.d.ts +1493 -38
  154. package/dist/Select/index.js +1824 -23
  155. package/dist/Separator/index.d.ts +80 -6
  156. package/dist/Separator/index.js +3 -3
  157. package/dist/Slider/index.d.ts +678 -16
  158. package/dist/Slider/index.js +1199 -11
  159. package/dist/Switch/index.d.ts +393 -5
  160. package/dist/Switch/index.js +208 -6
  161. package/dist/Tabs/index.d.ts +523 -12
  162. package/dist/Tabs/index.js +685 -9
  163. package/dist/Toggle/index.d.ts +305 -2
  164. package/dist/Toggle/index.js +76 -3
  165. package/dist/ToggleGroup/index.d.ts +316 -2
  166. package/dist/ToggleGroup/index.js +102 -3
  167. package/dist/Toolbar/index.d.ts +282 -13
  168. package/dist/Toolbar/index.js +230 -9
  169. package/dist/Tooltip/index.d.ts +1572 -14
  170. package/dist/Tooltip/index.js +965 -14
  171. package/dist/index.d.ts +12749 -652
  172. package/dist/rslib-runtime.js +18 -0
  173. package/package.json +3 -3
@@ -1,21 +1,391 @@
1
- import { CollapsiblePanelProps } from '@base-ui/react/collapsible';
2
- import { CollapsibleRootProps } from '@base-ui/react/collapsible';
3
- import { CollapsibleTriggerProps } from '@base-ui/react/collapsible';
1
+ import { CollapsiblePanelProps as CollapsiblePanelProps_2 } from '@base-ui/react/collapsible';
2
+ import { CollapsibleRootProps as CollapsibleRootProps_2 } from '@base-ui/react/collapsible';
3
+ import { CollapsibleTriggerProps as CollapsibleTriggerProps_2 } from '@base-ui/react/collapsible';
4
4
  import * as React_2 from 'react';
5
5
 
6
+ declare type BaseUIChangeEventDetail<Reason extends string, CustomProperties extends object> = {
7
+ /**
8
+ * The reason for the event.
9
+ */
10
+ reason: Reason;
11
+ /**
12
+ * The native event associated with the custom event.
13
+ */
14
+ event: ReasonToEvent<Reason>;
15
+ /**
16
+ * Cancels Base UI from handling the event.
17
+ */
18
+ cancel: () => void;
19
+ /**
20
+ * Allows the event to propagate in cases where Base UI will stop the propagation.
21
+ */
22
+ allowPropagation: () => void;
23
+ /**
24
+ * Indicates whether the event has been canceled.
25
+ */
26
+ isCanceled: boolean;
27
+ /**
28
+ * Indicates whether the event is allowed to propagate.
29
+ */
30
+ isPropagationAllowed: boolean;
31
+ /**
32
+ * The element that triggered the event, if applicable.
33
+ */
34
+ trigger: Element | undefined;
35
+ } & CustomProperties;
36
+
37
+ /**
38
+ * Details of custom change events emitted by Base UI components.
39
+ */
40
+ declare type BaseUIChangeEventDetails<Reason extends string, CustomProperties extends object = {}> = Reason extends string ? BaseUIChangeEventDetail<Reason, CustomProperties> & {} : never;
41
+
42
+ /**
43
+ * Props shared by all Base UI components.
44
+ * Contains `className` (string or callback taking the component's state as an argument) and `render` (function to customize rendering).
45
+ */
46
+ declare type BaseUIComponentProps<ElementType extends React_2.ElementType, State, RenderFunctionProps = HTMLProps> = Omit<WithBaseUIEvent<React_2.ComponentPropsWithRef<ElementType>>, 'className' | 'color' | 'defaultValue' | 'defaultChecked' | 'style'> & {
47
+ /**
48
+ * CSS class applied to the element, or a function that
49
+ * returns a class based on the component's state.
50
+ */
51
+ className?: string | ((state: State) => string | undefined) | undefined;
52
+ /**
53
+ * Allows you to replace the component's HTML element
54
+ * with a different tag, or compose it with another component.
55
+ *
56
+ * Accepts a `ReactElement` or a function that returns the element to render.
57
+ */
58
+ render?: React_2.ReactElement | ComponentRenderFn<RenderFunctionProps, State> | undefined;
59
+ /**
60
+ * Style applied to the element, or a function that
61
+ * returns a style object based on the component's state.
62
+ */
63
+ style?: React_2.CSSProperties | ((state: State) => React_2.CSSProperties | undefined) | undefined;
64
+ };
65
+
66
+ declare type BaseUIEvent<E extends React_2.SyntheticEvent<Element, Event>> = E & {
67
+ preventBaseUIHandler: () => void;
68
+ readonly baseUIHandlerPrevented?: boolean | undefined;
69
+ };
70
+
71
+ declare const cancelOpen: "cancel-open";
72
+
73
+ declare const chipRemovePress: "chip-remove-press";
74
+
75
+ declare const clearPress: "clear-press";
76
+
77
+ declare const closePress: "close-press";
78
+
79
+ declare const closeWatcher: "close-watcher";
80
+
6
81
  export declare const Collapsible: {
7
- Root: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<CollapsibleRootProps, "ref"> & React_2.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
82
+ Root: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<CollapsibleRootProps_2, "ref"> & React_2.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
8
83
  className?: string | undefined;
9
84
  } & React_2.RefAttributes<HTMLDivElement>>;
10
- Trigger: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<CollapsibleTriggerProps, "ref"> & React_2.RefAttributes<HTMLButtonElement>, "ref">, "className"> & {
85
+ Trigger: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<CollapsibleTriggerProps_2, "ref"> & React_2.RefAttributes<HTMLButtonElement>, "ref">, "className"> & {
11
86
  className?: string | undefined;
12
87
  } & React_2.RefAttributes<HTMLButtonElement>>;
13
- Panel: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<CollapsiblePanelProps, "ref"> & React_2.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
88
+ Panel: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<CollapsiblePanelProps_2, "ref"> & React_2.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
14
89
  className?: string | undefined;
15
90
  } & React_2.RefAttributes<HTMLDivElement>>;
16
91
  };
17
92
 
93
+ /**
94
+ * A panel with the collapsible contents.
95
+ * Renders a `<div>` element.
96
+ *
97
+ * Documentation: [Base UI Collapsible](https://base-ui.com/react/components/collapsible)
98
+ */
99
+ export declare const CollapsiblePanel: React_2.ForwardRefExoticComponent<Omit<CollapsiblePanelProps, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
100
+
101
+ export declare namespace CollapsiblePanel {
102
+ export type State = CollapsiblePanelState;
103
+ export type Props = CollapsiblePanelProps;
104
+ }
105
+
106
+ export declare interface CollapsiblePanelProps extends BaseUIComponentProps<'div', CollapsiblePanelState> {
107
+ /**
108
+ * Allows the browser's built-in page search to find and expand the panel contents.
109
+ *
110
+ * Overrides the `keepMounted` prop and uses `hidden="until-found"`
111
+ * to hide the element without removing it from the DOM.
112
+ *
113
+ * @default false
114
+ */
115
+ hiddenUntilFound?: boolean | undefined;
116
+ /**
117
+ * Whether to keep the element in the DOM while the panel is hidden.
118
+ * This prop is ignored when `hiddenUntilFound` is used.
119
+ * @default false
120
+ */
121
+ keepMounted?: boolean | undefined;
122
+ }
123
+
124
+ export declare interface CollapsiblePanelState extends CollapsibleRootState {
125
+ /**
126
+ * The transition status of the component.
127
+ */
128
+ transitionStatus: TransitionStatus;
129
+ }
130
+
131
+ /**
132
+ * Groups all parts of the collapsible.
133
+ * Renders a `<div>` element.
134
+ *
135
+ * Documentation: [Base UI Collapsible](https://base-ui.com/react/components/collapsible)
136
+ */
137
+ export declare const CollapsibleRoot: React_2.ForwardRefExoticComponent<Omit<CollapsibleRootProps, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
138
+
139
+ export declare namespace CollapsibleRoot {
140
+ export type State = CollapsibleRootState;
141
+ export type Props = CollapsibleRootProps;
142
+ export type ChangeEventReason = CollapsibleRootChangeEventReason;
143
+ export type ChangeEventDetails = CollapsibleRootChangeEventDetails;
144
+ }
145
+
146
+ export declare type CollapsibleRootChangeEventDetails = BaseUIChangeEventDetails<CollapsibleRootChangeEventReason>;
147
+
148
+ export declare type CollapsibleRootChangeEventReason = typeof REASONS.triggerPress | typeof REASONS.none;
149
+
150
+ export declare interface CollapsibleRootProps extends BaseUIComponentProps<'div', CollapsibleRootState> {
151
+ /**
152
+ * Whether the collapsible panel is currently open.
153
+ *
154
+ * To render an uncontrolled collapsible, use the `defaultOpen` prop instead.
155
+ */
156
+ open?: boolean | undefined;
157
+ /**
158
+ * Whether the collapsible panel is initially open.
159
+ *
160
+ * To render a controlled collapsible, use the `open` prop instead.
161
+ * @default false
162
+ */
163
+ defaultOpen?: boolean | undefined;
164
+ /**
165
+ * Event handler called when the panel is opened or closed.
166
+ */
167
+ onOpenChange?: ((open: boolean, eventDetails: CollapsibleRootChangeEventDetails) => void) | undefined;
168
+ /**
169
+ * Whether the component should ignore user interaction.
170
+ * @default false
171
+ */
172
+ disabled?: boolean | undefined;
173
+ }
174
+
175
+ export declare interface CollapsibleRootState extends Pick<UseCollapsibleRootReturnValue, 'open' | 'disabled' | 'transitionStatus'> {}
176
+
177
+ /**
178
+ * A button that opens and closes the collapsible panel.
179
+ * Renders a `<button>` element.
180
+ *
181
+ * Documentation: [Base UI Collapsible](https://base-ui.com/react/components/collapsible)
182
+ */
183
+ export declare const CollapsibleTrigger: React_2.ForwardRefExoticComponent<Omit<CollapsibleTriggerProps, "ref"> & React_2.RefAttributes<HTMLButtonElement>>;
184
+
185
+ export declare namespace CollapsibleTrigger {
186
+ export type State = CollapsibleTriggerState;
187
+ export type Props = CollapsibleTriggerProps;
188
+ }
189
+
190
+ export declare interface CollapsibleTriggerProps extends NativeButtonProps, BaseUIComponentProps<'button', CollapsibleTriggerState> {}
191
+
192
+ export declare interface CollapsibleTriggerState extends CollapsibleRootState {}
193
+
194
+ /**
195
+ * Shape of the render prop: a function that takes props to be spread on the element and component's state and returns a React element.
196
+ *
197
+ * @template Props Props to be spread on the rendered element.
198
+ * @template State Component's internal state.
199
+ */
200
+ declare type ComponentRenderFn<Props, State> = (props: Props, state: State) => React_2.ReactElement<unknown>;
201
+
202
+ declare const decrementPress: "decrement-press";
203
+
204
+ declare const disabled: "disabled";
205
+
206
+ declare const drag: "drag";
207
+
208
+ declare const escapeKey: "escape-key";
209
+
210
+ declare const focusOut: "focus-out";
211
+
212
+ declare type HTMLProps<T = any> = React_2.HTMLAttributes<T> & {
213
+ ref?: React_2.Ref<T> | undefined;
214
+ };
215
+
216
+ declare const imperativeAction: "imperative-action";
217
+
218
+ declare const incrementPress: "increment-press";
219
+
220
+ declare const initial: "initial";
221
+
222
+ declare const inputBlur: "input-blur";
223
+
224
+ declare const inputChange: "input-change";
225
+
226
+ declare const inputClear: "input-clear";
227
+
228
+ declare const inputPaste: "input-paste";
229
+
230
+ declare const inputPress: "input-press";
231
+
232
+ declare const itemPress: "item-press";
233
+
234
+ declare const keyboard: "keyboard";
235
+
236
+ declare const linkPress: "link-press";
237
+
238
+ declare const listNavigation: "list-navigation";
239
+
240
+ declare const missing: "missing";
241
+
242
+ declare interface NativeButtonProps {
243
+ /**
244
+ * Whether the component renders a native `<button>` element when replacing it
245
+ * via the `render` prop.
246
+ * Set to `false` if the rendered element is not a button (for example, `<div>`).
247
+ * @default true
248
+ */
249
+ nativeButton?: boolean | undefined;
250
+ }
251
+
252
+ declare const none: "none";
253
+
254
+ declare const outsidePress: "outside-press";
255
+
256
+ declare const pointer: "pointer";
257
+
258
+ declare namespace REASONS {
259
+ export {
260
+ none,
261
+ triggerPress,
262
+ triggerHover,
263
+ triggerFocus,
264
+ outsidePress,
265
+ itemPress,
266
+ closePress,
267
+ linkPress,
268
+ clearPress,
269
+ chipRemovePress,
270
+ trackPress,
271
+ incrementPress,
272
+ decrementPress,
273
+ inputChange,
274
+ inputClear,
275
+ inputBlur,
276
+ inputPaste,
277
+ inputPress,
278
+ focusOut,
279
+ escapeKey,
280
+ closeWatcher,
281
+ listNavigation,
282
+ keyboard,
283
+ pointer,
284
+ drag,
285
+ wheel,
286
+ scrub,
287
+ cancelOpen,
288
+ siblingOpen,
289
+ disabled,
290
+ missing,
291
+ initial,
292
+ imperativeAction,
293
+ swipe,
294
+ windowResize
295
+ }
296
+ }
297
+
298
+ /**
299
+ * Maps a change `reason` string to the corresponding native event type.
300
+ */
301
+ declare type ReasonToEvent<Reason extends string> = Reason extends keyof ReasonToEventMap ? ReasonToEventMap[Reason] : Event;
302
+
303
+ declare interface ReasonToEventMap {
304
+ [REASONS.none]: Event;
305
+ [REASONS.triggerPress]: MouseEvent | PointerEvent | TouchEvent | KeyboardEvent;
306
+ [REASONS.triggerHover]: MouseEvent;
307
+ [REASONS.triggerFocus]: FocusEvent;
308
+ [REASONS.outsidePress]: MouseEvent | PointerEvent | TouchEvent;
309
+ [REASONS.itemPress]: MouseEvent | KeyboardEvent | PointerEvent;
310
+ [REASONS.closePress]: MouseEvent | KeyboardEvent | PointerEvent;
311
+ [REASONS.linkPress]: MouseEvent | PointerEvent;
312
+ [REASONS.clearPress]: PointerEvent | MouseEvent | KeyboardEvent;
313
+ [REASONS.chipRemovePress]: PointerEvent | MouseEvent | KeyboardEvent;
314
+ [REASONS.trackPress]: PointerEvent | MouseEvent | TouchEvent;
315
+ [REASONS.incrementPress]: PointerEvent | MouseEvent | TouchEvent;
316
+ [REASONS.decrementPress]: PointerEvent | MouseEvent | TouchEvent;
317
+ [REASONS.inputChange]: InputEvent | Event;
318
+ [REASONS.inputClear]: InputEvent | FocusEvent | Event;
319
+ [REASONS.inputBlur]: FocusEvent;
320
+ [REASONS.inputPaste]: ClipboardEvent;
321
+ [REASONS.inputPress]: MouseEvent | PointerEvent | TouchEvent | KeyboardEvent;
322
+ [REASONS.focusOut]: FocusEvent | KeyboardEvent;
323
+ [REASONS.escapeKey]: KeyboardEvent;
324
+ [REASONS.closeWatcher]: Event;
325
+ [REASONS.listNavigation]: KeyboardEvent;
326
+ [REASONS.keyboard]: KeyboardEvent;
327
+ [REASONS.pointer]: PointerEvent;
328
+ [REASONS.drag]: PointerEvent | TouchEvent;
329
+ [REASONS.swipe]: PointerEvent | TouchEvent;
330
+ [REASONS.wheel]: WheelEvent;
331
+ [REASONS.scrub]: PointerEvent;
332
+ [REASONS.cancelOpen]: MouseEvent;
333
+ [REASONS.siblingOpen]: Event;
334
+ [REASONS.disabled]: Event;
335
+ [REASONS.missing]: Event;
336
+ [REASONS.initial]: Event;
337
+ [REASONS.imperativeAction]: Event;
338
+ [REASONS.windowResize]: UIEvent;
339
+ }
340
+
341
+ declare const scrub: "scrub";
342
+
343
+ declare const siblingOpen: "sibling-open";
344
+
345
+ declare const swipe: "swipe";
346
+
347
+ declare const trackPress: "track-press";
348
+
349
+ declare type TransitionStatus = 'starting' | 'ending' | 'idle' | undefined;
350
+
351
+ declare const triggerFocus: "trigger-focus";
352
+
353
+ declare const triggerHover: "trigger-hover";
354
+
355
+ declare const triggerPress: "trigger-press";
356
+
357
+ declare interface UseCollapsibleRootReturnValue {
358
+ /**
359
+ * Whether the component should ignore user interaction.
360
+ */
361
+ disabled: boolean;
362
+ handleTrigger: (event: React_2.MouseEvent | React_2.KeyboardEvent) => void;
363
+ /**
364
+ * Whether the collapsible panel is mounted for transition and hidden-state
365
+ * purposes. This can be `false` while the element remains in the DOM when
366
+ * `keepMounted` or `hiddenUntilFound` is enabled.
367
+ */
368
+ mounted: boolean;
369
+ /**
370
+ * Whether the collapsible panel is currently open.
371
+ */
372
+ open: boolean;
373
+ panelId: React_2.HTMLAttributes<Element>['id'];
374
+ setMounted: (nextMounted: boolean) => void;
375
+ setOpen: (open: boolean) => void;
376
+ setPanelIdState: (id: string | undefined) => void;
377
+ transitionStatus: TransitionStatus;
378
+ }
379
+
380
+ declare const wheel: "wheel";
381
+
382
+ declare const windowResize: "window-resize";
383
+
384
+ /**
385
+ * Adds a `preventBaseUIHandler` method to all event handlers.
386
+ */
387
+ declare type WithBaseUIEvent<T> = { [K in keyof T]: WithPreventBaseUIHandler<T[K]> };
18
388
 
19
- export * from "@base-ui/react/collapsible";
389
+ declare type WithPreventBaseUIHandler<T> = T extends ((event: infer E) => any) ? E extends React_2.SyntheticEvent<Element, Event> ? (event: BaseUIEvent<E>) => ReturnType<T> : T : T extends undefined ? undefined : T;
20
390
 
21
391
  export { }
@@ -1,30 +1,184 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { Collapsible } from "@base-ui/react/collapsible";
3
2
  import clsx from "clsx";
3
+ import { CollapsibleRootContext, useCollapsibleRootContext, collapsibleOpenStateMapping, triggerOpenStateMapping, useCollapsiblePanel, useCollapsibleRoot } from "../8052.js";
4
+ import { transitionStatusMapping } from "../880.js";
5
+ import { useStableCallback } from "../7541.js";
6
+ import { resolveStyle, useRenderElement, warn } from "../8272.js";
7
+ import { useButton } from "../9189.js";
8
+ import { useIsoLayoutEffect } from "../6499.js";
4
9
  import * as __rspack_external_react from "react";
10
+ const collapsibleStateAttributesMapping = {
11
+ ...collapsibleOpenStateMapping,
12
+ ...transitionStatusMapping
13
+ };
14
+ const CollapsibleRoot_CollapsibleRoot = /*#__PURE__*/ __rspack_external_react.forwardRef(function(componentProps, forwardedRef) {
15
+ const { render, className, defaultOpen = false, disabled = false, onOpenChange: onOpenChangeProp, open, style, ...elementProps } = componentProps;
16
+ const onOpenChange = useStableCallback(onOpenChangeProp);
17
+ const collapsible = useCollapsibleRoot({
18
+ open,
19
+ defaultOpen,
20
+ onOpenChange,
21
+ disabled
22
+ });
23
+ const state = __rspack_external_react.useMemo(()=>({
24
+ open: collapsible.open,
25
+ disabled: collapsible.disabled,
26
+ transitionStatus: collapsible.transitionStatus
27
+ }), [
28
+ collapsible.open,
29
+ collapsible.disabled,
30
+ collapsible.transitionStatus
31
+ ]);
32
+ const contextValue = __rspack_external_react.useMemo(()=>({
33
+ ...collapsible,
34
+ onOpenChange,
35
+ state
36
+ }), [
37
+ collapsible,
38
+ onOpenChange,
39
+ state
40
+ ]);
41
+ const element = useRenderElement('div', componentProps, {
42
+ state,
43
+ ref: forwardedRef,
44
+ props: elementProps,
45
+ stateAttributesMapping: collapsibleStateAttributesMapping
46
+ });
47
+ return /*#__PURE__*/ jsx(CollapsibleRootContext.Provider, {
48
+ value: contextValue,
49
+ children: element
50
+ });
51
+ });
52
+ if ("production" !== process.env.NODE_ENV) CollapsibleRoot_CollapsibleRoot.displayName = "CollapsibleRoot";
53
+ const stateAttributesMapping = {
54
+ ...triggerOpenStateMapping,
55
+ ...transitionStatusMapping
56
+ };
57
+ const CollapsibleTrigger_CollapsibleTrigger = /*#__PURE__*/ __rspack_external_react.forwardRef(function(componentProps, forwardedRef) {
58
+ const { panelId, open, handleTrigger, state, disabled: contextDisabled } = useCollapsibleRootContext();
59
+ const { className, disabled = contextDisabled, id, render, nativeButton = true, style, ...elementProps } = componentProps;
60
+ const { getButtonProps, buttonRef } = useButton({
61
+ disabled,
62
+ focusableWhenDisabled: true,
63
+ native: nativeButton
64
+ });
65
+ const element = useRenderElement('button', componentProps, {
66
+ state,
67
+ ref: [
68
+ forwardedRef,
69
+ buttonRef
70
+ ],
71
+ props: [
72
+ {
73
+ 'aria-controls': open ? panelId : void 0,
74
+ 'aria-expanded': open,
75
+ onClick: handleTrigger
76
+ },
77
+ elementProps,
78
+ getButtonProps
79
+ ],
80
+ stateAttributesMapping: stateAttributesMapping
81
+ });
82
+ return element;
83
+ });
84
+ if ("production" !== process.env.NODE_ENV) CollapsibleTrigger_CollapsibleTrigger.displayName = "CollapsibleTrigger";
85
+ let CollapsiblePanelCssVars_CollapsiblePanelCssVars = /*#__PURE__*/ function(CollapsiblePanelCssVars) {
86
+ CollapsiblePanelCssVars["collapsiblePanelHeight"] = "--collapsible-panel-height";
87
+ CollapsiblePanelCssVars["collapsiblePanelWidth"] = "--collapsible-panel-width";
88
+ return CollapsiblePanelCssVars;
89
+ }({});
90
+ const CollapsiblePanel_CollapsiblePanel = /*#__PURE__*/ __rspack_external_react.forwardRef(function(componentProps, forwardedRef) {
91
+ const { className, hiddenUntilFound: hiddenUntilFoundProp, keepMounted: keepMountedProp, render, id: idProp, style, ...elementProps } = componentProps;
92
+ if ('production' !== process.env.NODE_ENV) useIsoLayoutEffect(()=>{
93
+ if (hiddenUntilFoundProp && false === keepMountedProp) warn('The `keepMounted={false}` prop on `Collapsible.Panel` is ignored when `hiddenUntilFound` is enabled, since the panel must remain mounted while closed.');
94
+ }, [
95
+ hiddenUntilFoundProp,
96
+ keepMountedProp
97
+ ]);
98
+ const { mounted, onOpenChange, open, panelId, setMounted, setPanelIdState, setOpen, state, transitionStatus } = useCollapsibleRootContext();
99
+ const hiddenUntilFound = hiddenUntilFoundProp ?? false;
100
+ const keepMounted = keepMountedProp ?? false;
101
+ useIsoLayoutEffect(()=>{
102
+ if (idProp) {
103
+ setPanelIdState(idProp);
104
+ return ()=>{
105
+ setPanelIdState(void 0);
106
+ };
107
+ }
108
+ }, [
109
+ idProp,
110
+ setPanelIdState
111
+ ]);
112
+ const { height, props, ref, shouldPreventOpenAnimation, shouldRender, transitionStatus: panelTransitionStatus, width } = useCollapsiblePanel({
113
+ externalRef: forwardedRef,
114
+ hiddenUntilFound,
115
+ id: panelId,
116
+ keepMounted,
117
+ mounted,
118
+ onOpenChange,
119
+ open,
120
+ setMounted,
121
+ setOpen,
122
+ transitionStatus
123
+ });
124
+ const panelState = {
125
+ ...state,
126
+ transitionStatus: panelTransitionStatus
127
+ };
128
+ const resolvedStyle = resolveStyle(style, panelState);
129
+ const element = useRenderElement('div', {
130
+ ...componentProps,
131
+ style: void 0
132
+ }, {
133
+ state: panelState,
134
+ ref,
135
+ props: [
136
+ props,
137
+ {
138
+ style: {
139
+ [CollapsiblePanelCssVars_CollapsiblePanelCssVars.collapsiblePanelHeight]: void 0 === height ? 'auto' : `${height}px`,
140
+ [CollapsiblePanelCssVars_CollapsiblePanelCssVars.collapsiblePanelWidth]: void 0 === width ? 'auto' : `${width}px`
141
+ }
142
+ },
143
+ elementProps,
144
+ resolvedStyle ? {
145
+ style: resolvedStyle
146
+ } : void 0,
147
+ shouldPreventOpenAnimation ? {
148
+ style: {
149
+ animationName: 'none'
150
+ }
151
+ } : void 0
152
+ ],
153
+ stateAttributesMapping: collapsibleStateAttributesMapping
154
+ });
155
+ if (!shouldRender) return null;
156
+ return element;
157
+ });
158
+ if ("production" !== process.env.NODE_ENV) CollapsiblePanel_CollapsiblePanel.displayName = "CollapsiblePanel";
5
159
  const Collapsible_module = {
6
160
  root: "root-D02Wtj",
7
161
  trigger: "trigger-jzj48r",
8
162
  panel: "panel-TIli5f"
9
163
  };
10
- const Root = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(Collapsible.Root, {
164
+ const Root = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(CollapsibleRoot_CollapsibleRoot, {
11
165
  ref: ref,
12
166
  className: clsx(Collapsible_module.root, className),
13
167
  ...props
14
168
  }));
15
- const Trigger = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(Collapsible.Trigger, {
169
+ const Trigger = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(CollapsibleTrigger_CollapsibleTrigger, {
16
170
  ref: ref,
17
171
  className: clsx(Collapsible_module.trigger, className),
18
172
  ...props
19
173
  }));
20
- const Panel = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(Collapsible.Panel, {
174
+ const Panel = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(CollapsiblePanel_CollapsiblePanel, {
21
175
  ref: ref,
22
176
  className: clsx(Collapsible_module.panel, className),
23
177
  ...props
24
178
  }));
25
- const Collapsible_Collapsible = {
179
+ const Collapsible = {
26
180
  Root: Root,
27
181
  Trigger: Trigger,
28
182
  Panel: Panel
29
183
  };
30
- export { Collapsible_Collapsible as Collapsible };
184
+ export { Collapsible };