@wix/site-ui 1.346.0 → 1.348.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 (226) hide show
  1. package/dist/{6706.js → 1093.js} +3 -3
  2. package/dist/{8724.js → 1219.js} +2 -2
  3. package/dist/{7373.js → 1288.js} +8 -2
  4. package/dist/{5299.js → 1381.js} +98 -127
  5. package/dist/{3056.js → 1607.js} +32 -34
  6. package/dist/1629.js +2 -0
  7. package/dist/1669.js +75 -0
  8. package/dist/1718.js +26 -0
  9. package/dist/{1477.js → 201.js} +17 -26
  10. package/dist/2221.js +9 -0
  11. package/dist/{2445.js → 226.js} +12 -48
  12. package/dist/2387.js +7 -0
  13. package/dist/2580.js +6 -0
  14. package/dist/{1500.js → 2859.js} +10 -34
  15. package/dist/3014.js +178 -0
  16. package/dist/{6247.js → 3054.js} +3 -3
  17. package/dist/{7642.js → 3093.js} +1 -1
  18. package/dist/3189.js +5 -0
  19. package/dist/{7564.js → 331.js} +2 -2
  20. package/dist/3357.js +7 -0
  21. package/dist/{487.js → 3398.js} +38 -39
  22. package/dist/3502.js +224 -0
  23. package/dist/3695.js +50 -0
  24. package/dist/3829.js +1 -1
  25. package/dist/{6588.js → 3859.js} +115 -92
  26. package/dist/{3670.js → 3910.js} +28 -21
  27. package/dist/392.js +7 -0
  28. package/dist/{4549.js → 4155.js} +11 -3
  29. package/dist/4226.js +7 -0
  30. package/dist/{6329.js → 4229.js} +1 -1
  31. package/dist/4293.js +3 -0
  32. package/dist/4346.js +853 -2
  33. package/dist/{285.js → 4472.js} +3 -3
  34. package/dist/4605.js +207 -0
  35. package/dist/{7366.js → 488.js} +60 -7
  36. package/dist/{8750.js → 497.js} +190 -375
  37. package/dist/4989.js +35 -0
  38. package/dist/{6270.js → 510.js} +157 -196
  39. package/dist/5258.js +26 -0
  40. package/dist/{5036.js → 5275.js} +0 -3
  41. package/dist/{8171.js → 5298.js} +90 -102
  42. package/dist/5473.js +11 -0
  43. package/dist/{4745.js → 5490.js} +3 -1
  44. package/dist/{6089.js → 5561.js} +869 -786
  45. package/dist/{8996.js → 5595.js} +4 -3
  46. package/dist/5890.js +25 -0
  47. package/dist/{6046.js → 5969.js} +1 -1
  48. package/dist/5984.js +38 -0
  49. package/dist/{8527.js → 6006.js} +3 -3
  50. package/dist/6040.js +97 -0
  51. package/dist/{8758.js → 6137.js} +10 -8
  52. package/dist/{4281.js → 6140.js} +18 -10
  53. package/dist/{8960.js → 6191.js} +2 -2
  54. package/dist/6240.js +121 -0
  55. package/dist/{4490.js → 6373.js} +7 -5
  56. package/dist/{904.js → 6487.js} +19 -17
  57. package/dist/{9635.js → 6498.js} +1 -1
  58. package/dist/6499.js +4 -7
  59. package/dist/6508.js +7 -0
  60. package/dist/{8225.js → 6540.js} +1 -0
  61. package/dist/6551.js +46 -0
  62. package/dist/{9369.js → 6620.js} +35 -34
  63. package/dist/{4143.js → 6838.js} +19 -10
  64. package/dist/6902.js +48 -0
  65. package/dist/6904.js +51 -0
  66. package/dist/70.js +24 -0
  67. package/dist/7024.js +39 -0
  68. package/dist/{6882.js → 721.js} +737 -362
  69. package/dist/{951.js → 7270.js} +4 -4
  70. package/dist/{3485.js → 7323.js} +143 -111
  71. package/dist/{7541.js → 7488.js} +2 -2
  72. package/dist/{4863.js → 7542.js} +7 -6
  73. package/dist/7551.js +28 -0
  74. package/dist/{7021.js → 7640.js} +1 -1
  75. package/dist/{353.js → 7692.js} +3 -7
  76. package/dist/{4707.js → 7930.js} +2 -2
  77. package/dist/{8052.js → 8.js} +80 -64
  78. package/dist/{6914.js → 8129.js} +3 -15
  79. package/dist/{3319.js → 8358.js} +62 -63
  80. package/dist/{5864.js → 8407.js} +13 -13
  81. package/dist/8488.js +15 -0
  82. package/dist/{4768.js → 8495.js} +1 -1
  83. package/dist/8734.js +171 -0
  84. package/dist/{1763.js → 9018.js} +205 -331
  85. package/dist/9053.js +29 -0
  86. package/dist/9067.js +41 -0
  87. package/dist/{2861.js → 9120.js} +2 -2
  88. package/dist/{42.js → 9197.js} +2 -2
  89. package/dist/{9189.js → 9248.js} +36 -17
  90. package/dist/{2801.js → 9252.js} +4 -9
  91. package/dist/9295.js +7 -0
  92. package/dist/9303.js +8 -0
  93. package/dist/{167.js → 9374.js} +1 -1
  94. package/dist/{9352.js → 9540.js} +17 -47
  95. package/dist/9576.js +51 -0
  96. package/dist/{8272.js → 9591.js} +36 -46
  97. package/dist/{6107.js → 9770.js} +2 -2
  98. package/dist/{5085.js → 9880.js} +6 -3
  99. package/dist/Accordion/index.d.ts +207 -41
  100. package/dist/Accordion/index.js +75 -177
  101. package/dist/AlertDialog/index.d.ts +440 -140
  102. package/dist/AlertDialog/index.js +3 -13
  103. package/dist/Autocomplete/index.d.ts +722 -150
  104. package/dist/Autocomplete/index.js +16 -29
  105. package/dist/Avatar/index.d.ts +38 -3
  106. package/dist/Avatar/index.js +82 -28
  107. package/dist/Breadcrumbs/index.d.ts +63 -91
  108. package/dist/Breadcrumbs/index.js +1 -1
  109. package/dist/Button/index.d.ts +11 -0
  110. package/dist/Button/index.js +2 -2
  111. package/dist/Checkbox/index.d.ts +206 -36
  112. package/dist/Checkbox/index.js +293 -8
  113. package/dist/CheckboxField/index.css +1 -1
  114. package/dist/CheckboxField/index.d.ts +40 -36
  115. package/dist/CheckboxGroup/index.d.ts +50 -36
  116. package/dist/CheckboxGroup/index.js +87 -58
  117. package/dist/CheckboxGroupField/index.css +1 -1
  118. package/dist/Collapsible/index.d.ts +128 -36
  119. package/dist/Collapsible/index.js +21 -25
  120. package/dist/Combobox/index.d.ts +801 -158
  121. package/dist/Combobox/index.js +70 -114
  122. package/dist/ContextMenu/index.d.ts +1162 -195
  123. package/dist/ContextMenu/index.js +46 -36
  124. package/dist/Dialog/index.d.ts +425 -133
  125. package/dist/Dialog/index.js +8 -4
  126. package/dist/Drawer/index.d.ts +589 -144
  127. package/dist/Drawer/index.js +482 -562
  128. package/dist/Field/index.css +1 -1
  129. package/dist/Field/index.d.ts +341 -42
  130. package/dist/Field/index.js +123 -273
  131. package/dist/Fieldset/index.d.ts +11 -0
  132. package/dist/Fieldset/index.js +10 -17
  133. package/dist/Form/index.d.ts +43 -39
  134. package/dist/Form/index.js +58 -50
  135. package/dist/Input/index.css +1 -1
  136. package/dist/Input/index.d.ts +94 -42
  137. package/dist/Input/index.js +1 -1
  138. package/dist/Menu/index.d.ts +1140 -175
  139. package/dist/Menu/index.js +51 -67
  140. package/dist/Menubar/index.d.ts +651 -173
  141. package/dist/Menubar/index.js +12 -16
  142. package/dist/Meter/index.js +21 -18
  143. package/dist/NavigationMenu/index.d.ts +370 -86
  144. package/dist/NavigationMenu/index.js +144 -178
  145. package/dist/NumberField/index.css +1 -1
  146. package/dist/NumberField/index.d.ts +507 -47
  147. package/dist/NumberField/index.js +434 -718
  148. package/dist/Popover/index.d.ts +561 -142
  149. package/dist/Popover/index.js +181 -252
  150. package/dist/PreviewCard/index.d.ts +507 -143
  151. package/dist/PreviewCard/index.js +97 -151
  152. package/dist/Progress/index.d.ts +117 -3
  153. package/dist/Progress/index.js +37 -36
  154. package/dist/Radio/index.d.ts +177 -7
  155. package/dist/Radio/index.js +54 -70
  156. package/dist/RadioField/index.css +1 -1
  157. package/dist/RadioField/index.d.ts +23 -7
  158. package/dist/RadioGroup/index.d.ts +51 -37
  159. package/dist/RadioGroup/index.js +60 -51
  160. package/dist/RadioGroupField/index.css +1 -1
  161. package/dist/RadioGroupField/index.d.ts +40 -37
  162. package/dist/ScrollArea/index.d.ts +295 -1
  163. package/dist/ScrollArea/index.js +256 -324
  164. package/dist/Select/index.d.ts +516 -123
  165. package/dist/Select/index.js +513 -635
  166. package/dist/SelectField/index.css +1 -1
  167. package/dist/SelectField/index.d.ts +109 -134
  168. package/dist/SelectField/index.js +5 -1
  169. package/dist/Separator/index.d.ts +12 -0
  170. package/dist/Separator/index.js +1 -1
  171. package/dist/Slider/index.d.ts +383 -64
  172. package/dist/Slider/index.js +298 -374
  173. package/dist/Switch/index.d.ts +184 -37
  174. package/dist/Switch/index.js +44 -58
  175. package/dist/Tabs/index.d.ts +220 -35
  176. package/dist/Tabs/index.js +199 -193
  177. package/dist/Toast/index.d.ts +280 -64
  178. package/dist/Toast/index.js +299 -374
  179. package/dist/Toggle/index.d.ts +55 -35
  180. package/dist/Toggle/index.js +19 -13
  181. package/dist/ToggleGroup/index.d.ts +62 -35
  182. package/dist/ToggleGroup/index.js +13 -31
  183. package/dist/Toolbar/index.d.ts +117 -2
  184. package/dist/Toolbar/index.js +31 -43
  185. package/dist/Tooltip/index.d.ts +507 -150
  186. package/dist/Tooltip/index.js +163 -213
  187. package/dist/index.d.ts +12912 -5382
  188. package/package.json +3 -3
  189. package/dist/2205.js +0 -26
  190. package/dist/2274.js +0 -34
  191. package/dist/2287.js +0 -17
  192. package/dist/3020.js +0 -7
  193. package/dist/3021.js +0 -72
  194. package/dist/3140.js +0 -4
  195. package/dist/3248.js +0 -307
  196. package/dist/4026.js +0 -12
  197. package/dist/4922.js +0 -15
  198. package/dist/5659.js +0 -4
  199. package/dist/5992.js +0 -447
  200. package/dist/6330.js +0 -30
  201. package/dist/6535.js +0 -72
  202. package/dist/6917.js +0 -55
  203. package/dist/7725.js +0 -10
  204. package/dist/7871.js +0 -38
  205. package/dist/8106.js +0 -239
  206. package/dist/8685.js +0 -102
  207. package/dist/8935.js +0 -8
  208. package/dist/8971.js +0 -40
  209. package/dist/8979.js +0 -10
  210. package/dist/9048.js +0 -52
  211. package/dist/9087.js +0 -256
  212. package/dist/9255.js +0 -136
  213. /package/dist/{1457.js → 1068.js} +0 -0
  214. /package/dist/{6003.js → 1234.js} +0 -0
  215. /package/dist/{4723.js → 1282.js} +0 -0
  216. /package/dist/{6825.js → 1876.js} +0 -0
  217. /package/dist/{5778.js → 1885.js} +0 -0
  218. /package/dist/{2445.js.LICENSE.txt → 226.js.LICENSE.txt} +0 -0
  219. /package/dist/{1279.js → 3278.js} +0 -0
  220. /package/dist/{3296.js → 5568.js} +0 -0
  221. /package/dist/{8685.css → 6240.css} +0 -0
  222. /package/dist/{9829.js → 6488.js} +0 -0
  223. /package/dist/{9863.js → 6534.js} +0 -0
  224. /package/dist/{4495.js → 7718.js} +0 -0
  225. /package/dist/{3395.js → 8866.js} +0 -0
  226. /package/dist/{2418.js → 9837.js} +0 -0
@@ -1,52 +1,70 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { useBaseUiId } from "../6046.js";
3
- import { useStableCallback } from "../7541.js";
4
- import { useLabelableContext, useFieldRootContext, fieldValidityMapping } from "../1477.js";
5
- import { useFormContext } from "../5085.js";
6
- import { useControlled } from "../8527.js";
7
- import { PARENT_CHECKBOX } from "../3248.js";
8
- import { useRegisterFieldControl } from "../4281.js";
9
- import { EMPTY_ARRAY, useRenderElement } from "../8272.js";
10
- import { useValueChanged } from "../2801.js";
11
- import { areArraysEqual } from "../5659.js";
12
- import { CheckboxGroupContext } from "../8979.js";
2
+ import { EMPTY_ARRAY, useRenderElement } from "../9591.js";
3
+ import { useStableCallback } from "../7488.js";
4
+ import { useLabelableContext, useFieldRootContext, fieldValidityMapping } from "../201.js";
5
+ import { useFormContext } from "../9880.js";
6
+ import { useControlled } from "../6006.js";
7
+ import { useLabelableId } from "../6551.js";
8
+ import { useBaseUiId } from "../5969.js";
9
+ import { isEligibleInput } from "../4605.js";
10
+ import { useRegisterFieldControl } from "../6140.js";
11
+ import { useIsoLayoutEffect } from "../3357.js";
12
+ import { useValueChanged } from "../9252.js";
13
+ import { areArraysEqual } from "../2387.js";
14
+ import { CheckboxGroupContext } from "../4226.js";
13
15
  import * as __rspack_external_react from "react";
14
- const EMPTY = [];
15
16
  function useCheckboxGroupParent(params) {
16
- const { allValues = EMPTY, value = EMPTY, onValueChange: onValueChangeProp } = params;
17
+ const { allValues = EMPTY_ARRAY, value, onValueChange: onValueChangeProp } = params;
17
18
  const uncontrolledStateRef = __rspack_external_react.useRef(value);
18
19
  const disabledStatesRef = __rspack_external_react.useRef(new Map());
19
20
  const [status, setStatus] = __rspack_external_react.useState('mixed');
20
- const id = useBaseUiId();
21
+ const [childIdsState, setChildIdsState] = __rspack_external_react.useState(()=>({
22
+ registry: new Map()
23
+ }));
21
24
  const checked = value.length === allValues.length;
22
25
  const indeterminate = value.length !== allValues.length && value.length > 0;
23
26
  const onValueChange = useStableCallback(onValueChangeProp);
27
+ const registerChildId = useStableCallback((childValue, childId)=>{
28
+ const childIds = childIdsState.registry;
29
+ childIds.set(childValue, (childIds.get(childValue) ?? EMPTY_ARRAY).concat(childId));
30
+ setChildIdsState({
31
+ registry: childIds
32
+ });
33
+ return ()=>{
34
+ const nextIds = (childIds.get(childValue) ?? EMPTY_ARRAY).filter((id)=>id !== childId);
35
+ if (0 === nextIds.length) childIds.delete(childValue);
36
+ else childIds.set(childValue, nextIds);
37
+ setChildIdsState({
38
+ registry: childIds
39
+ });
40
+ };
41
+ });
24
42
  const getParentProps = __rspack_external_react.useCallback(()=>({
25
- id,
26
43
  indeterminate,
27
44
  checked,
28
- 'aria-controls': allValues.map((v)=>`${id}-${v}`).join(' '),
45
+ 'aria-controls': allValues.flatMap((v)=>childIdsState.registry.get(v) ?? EMPTY_ARRAY).join(' ') || void 0,
29
46
  onCheckedChange (_, eventDetails) {
30
47
  const uncontrolledState = uncontrolledStateRef.current;
31
48
  const none = allValues.filter((v)=>disabledStatesRef.current.get(v) && uncontrolledState.includes(v));
32
- const all = allValues.filter((v)=>!disabledStatesRef.current.get(v) || disabledStatesRef.current.get(v) && uncontrolledState.includes(v));
49
+ const all = allValues.filter((v)=>!disabledStatesRef.current.get(v) || uncontrolledState.includes(v));
33
50
  const allOnOrOff = uncontrolledState.length === all.length || 0 === uncontrolledState.length;
34
51
  if (allOnOrOff) return void (value.length === all.length ? onValueChange(none, eventDetails) : onValueChange(all, eventDetails));
52
+ let nextStatus = 'mixed';
53
+ let nextValue = uncontrolledState;
35
54
  if ('mixed' === status) {
36
- onValueChange(all, eventDetails);
37
- setStatus('on');
55
+ nextStatus = 'on';
56
+ nextValue = all;
38
57
  } else if ('on' === status) {
39
- onValueChange(none, eventDetails);
40
- setStatus('off');
41
- } else if ('off' === status) {
42
- onValueChange(uncontrolledState, eventDetails);
43
- setStatus('mixed');
58
+ nextStatus = 'off';
59
+ nextValue = none;
44
60
  }
61
+ onValueChange(nextValue, eventDetails);
62
+ if (!eventDetails.isCanceled) setStatus(nextStatus);
45
63
  }
46
64
  }), [
47
65
  allValues,
48
66
  checked,
49
- id,
67
+ childIdsState,
50
68
  indeterminate,
51
69
  onValueChange,
52
70
  status,
@@ -58,39 +76,34 @@ function useCheckboxGroupParent(params) {
58
76
  const newValue = value.slice();
59
77
  if (nextChecked) newValue.push(childValue);
60
78
  else newValue.splice(newValue.indexOf(childValue), 1);
61
- uncontrolledStateRef.current = newValue;
62
79
  onValueChange(newValue, eventDetails);
63
- setStatus('mixed');
80
+ if (!eventDetails.isCanceled) {
81
+ uncontrolledStateRef.current = newValue;
82
+ setStatus('mixed');
83
+ }
64
84
  }
65
85
  }), [
66
86
  onValueChange,
67
87
  value
68
88
  ]);
69
89
  return __rspack_external_react.useMemo(()=>({
70
- id,
71
- indeterminate,
72
90
  getParentProps,
73
91
  getChildProps,
92
+ registerChildId,
74
93
  disabledStatesRef
75
94
  }), [
76
- id,
77
- indeterminate,
78
95
  getParentProps,
79
- getChildProps
96
+ getChildProps,
97
+ registerChildId
80
98
  ]);
81
99
  }
82
100
  const CheckboxGroup_CheckboxGroup = /*#__PURE__*/ __rspack_external_react.forwardRef(function(componentProps, forwardedRef) {
83
101
  const { allValues, className, defaultValue: defaultValueProp, disabled: disabledProp = false, id: idProp, onValueChange, render, value: externalValue, style, ...elementProps } = componentProps;
84
- const { disabled: fieldDisabled, name: fieldName, state: fieldState, validation, setFilled, setDirty, shouldValidateOnChange, validityData } = useFieldRootContext();
85
- const { labelId, getDescriptionProps } = useLabelableContext();
86
- const { clearErrors } = useFormContext();
102
+ const { disabled: fieldDisabled, name: fieldName, state: fieldState, validation, setFilled, setDirty, validityData } = useFieldRootContext();
103
+ const { labelId, registerControlId, getDescriptionProps } = useLabelableContext();
104
+ const { clearErrors, elementRef } = useFormContext();
87
105
  const disabled = fieldDisabled || disabledProp;
88
- const defaultValue = __rspack_external_react.useMemo(()=>{
89
- if (void 0 === externalValue) return defaultValueProp ?? [];
90
- }, [
91
- externalValue,
92
- defaultValueProp
93
- ]);
106
+ const defaultValue = defaultValueProp ?? EMPTY_ARRAY;
94
107
  const [value, setValueUnwrapped] = useControlled({
95
108
  controlled: externalValue,
96
109
  default: defaultValue,
@@ -107,20 +120,37 @@ const CheckboxGroup_CheckboxGroup = /*#__PURE__*/ __rspack_external_react.forwar
107
120
  value,
108
121
  onValueChange: setValue
109
122
  });
123
+ useLabelableId({
124
+ id: null
125
+ });
110
126
  const id = useBaseUiId(idProp);
111
- const controlRef = __rspack_external_react.useRef(null);
112
- const registerControlRef = __rspack_external_react.useCallback((element)=>{
113
- if (null == controlRef.current && null != element && !element.hasAttribute(PARENT_CHECKBOX)) controlRef.current = element;
114
- }, []);
115
- useRegisterFieldControl(controlRef, id, value, void 0, !!fieldName);
116
- const resolvedValue = value ?? EMPTY_ARRAY;
117
- useValueChanged(resolvedValue, ()=>{
127
+ const getInputControl = validation.getInputControl;
128
+ const controlRef = __rspack_external_react.useMemo(()=>({
129
+ get current () {
130
+ return getInputControl();
131
+ }
132
+ }), [
133
+ getInputControl
134
+ ]);
135
+ const getFormValue = useStableCallback(()=>{
136
+ const formElement = elementRef.current;
137
+ if (!formElement) return value;
138
+ const successfulValues = new Set();
139
+ for (const [input, registration] of validation.registeredInputs)if (void 0 !== registration.value && input.checked && isEligibleInput(input, formElement)) successfulValues.add(registration.value);
140
+ return value.filter((inputValue)=>successfulValues.has(inputValue));
141
+ });
142
+ useRegisterFieldControl(controlRef, id, value, getFormValue, !!fieldName && !disabled, fieldName);
143
+ useIsoLayoutEffect(()=>{
144
+ setFilled(value.length > 0);
145
+ }, [
146
+ value,
147
+ setFilled
148
+ ]);
149
+ useValueChanged(value, ()=>{
118
150
  if (fieldName) clearErrors(fieldName);
119
151
  const initialValue = Array.isArray(validityData.initialValue) ? validityData.initialValue : EMPTY_ARRAY;
120
- setFilled(resolvedValue.length > 0);
121
- setDirty(!areArraysEqual(resolvedValue, initialValue));
122
- if (shouldValidateOnChange()) validation.commit(resolvedValue);
123
- else validation.commit(resolvedValue, true);
152
+ setDirty(!areArraysEqual(value, initialValue));
153
+ validation.change(value);
124
154
  });
125
155
  const state = {
126
156
  ...fieldState,
@@ -129,32 +159,31 @@ const CheckboxGroup_CheckboxGroup = /*#__PURE__*/ __rspack_external_react.forwar
129
159
  const contextValue = __rspack_external_react.useMemo(()=>({
130
160
  allValues,
131
161
  value,
132
- defaultValue,
133
162
  setValue,
134
163
  parent,
135
164
  disabled,
136
165
  validation,
137
- registerControlRef
166
+ registerControlId
138
167
  }), [
139
168
  allValues,
140
169
  value,
141
- defaultValue,
142
170
  setValue,
143
171
  parent,
144
172
  disabled,
145
173
  validation,
146
- registerControlRef
174
+ registerControlId
147
175
  ]);
148
176
  const element = useRenderElement('div', componentProps, {
149
177
  state,
150
178
  ref: forwardedRef,
151
179
  props: [
152
180
  {
181
+ id: idProp,
153
182
  role: 'group',
154
183
  'aria-labelledby': labelId
155
184
  },
156
- getDescriptionProps,
157
- elementProps
185
+ elementProps,
186
+ getDescriptionProps
158
187
  ],
159
188
  stateAttributesMapping: fieldValidityMapping
160
189
  });
@@ -1,4 +1,4 @@
1
- @import "../8685.css";
1
+ @import "../6240.css";
2
2
  @import "../Field/index.css";
3
3
  .field-Tx5eMP {
4
4
  --checkbox-group-width: auto;
@@ -68,15 +68,25 @@ declare type BaseUIEvent<E extends React_2.SyntheticEvent<Element, Event>> = E &
68
68
  readonly baseUIHandlerPrevented?: boolean | undefined;
69
69
  };
70
70
 
71
- declare const cancelOpen: "cancel-open";
71
+ declare const cancelOpen: 'cancel-open';
72
72
 
73
- declare const chipRemovePress: "chip-remove-press";
73
+ declare const chipRemovePress: 'chip-remove-press';
74
74
 
75
- declare const clearPress: "clear-press";
75
+ declare const clearPress: 'clear-press';
76
76
 
77
- declare const closePress: "close-press";
77
+ /**
78
+ * Present when the collapsible is closed.
79
+ */
80
+ declare const closed_2 = "data-closed";
78
81
 
79
- declare const closeWatcher: "close-watcher";
82
+ /**
83
+ * Present when the collapsible panel is closed.
84
+ */
85
+ declare const closed_3 = "data-closed";
86
+
87
+ declare const closePress: 'close-press';
88
+
89
+ declare const closeWatcher: 'close-watcher';
80
90
 
81
91
  export declare const Collapsible: {
82
92
  Root: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<CollapsibleRootProps_2, "ref"> & React_2.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
@@ -103,6 +113,28 @@ export declare namespace CollapsiblePanel {
103
113
  export type Props = CollapsiblePanelProps;
104
114
  }
105
115
 
116
+ export declare namespace CollapsiblePanelCssVariables {
117
+ export {
118
+ collapsiblePanelHeight,
119
+ collapsiblePanelWidth
120
+ }
121
+ }
122
+
123
+ export declare namespace CollapsiblePanelDataAttributes {
124
+ export {
125
+ open_3 as open,
126
+ closed_3 as closed,
127
+ startingStyle_2 as startingStyle,
128
+ endingStyle_2 as endingStyle
129
+ }
130
+ }
131
+
132
+ /**
133
+ * The collapsible panel's height.
134
+ * @type {number}
135
+ */
136
+ declare const collapsiblePanelHeight = "--collapsible-panel-height";
137
+
106
138
  export declare interface CollapsiblePanelProps extends BaseUIComponentProps<'div', CollapsiblePanelState> {
107
139
  /**
108
140
  * Allows the browser's built-in page search to find and expand the panel contents.
@@ -128,6 +160,12 @@ export declare interface CollapsiblePanelState extends CollapsibleRootState {
128
160
  transitionStatus: TransitionStatus;
129
161
  }
130
162
 
163
+ /**
164
+ * The collapsible panel's width.
165
+ * @type {number}
166
+ */
167
+ declare const collapsiblePanelWidth = "--collapsible-panel-width";
168
+
131
169
  /**
132
170
  * Groups all parts of the collapsible.
133
171
  * Renders a `<div>` element.
@@ -147,6 +185,15 @@ export declare type CollapsibleRootChangeEventDetails = BaseUIChangeEventDetails
147
185
 
148
186
  export declare type CollapsibleRootChangeEventReason = typeof REASONS.triggerPress | typeof REASONS.none;
149
187
 
188
+ export declare namespace CollapsibleRootDataAttributes {
189
+ export {
190
+ open_2 as open,
191
+ closed_2 as closed,
192
+ startingStyle,
193
+ endingStyle
194
+ }
195
+ }
196
+
150
197
  export declare interface CollapsibleRootProps extends BaseUIComponentProps<'div', CollapsibleRootState> {
151
198
  /**
152
199
  * Whether the collapsible panel is currently open.
@@ -187,6 +234,12 @@ export declare namespace CollapsibleTrigger {
187
234
  export type Props = CollapsibleTriggerProps;
188
235
  }
189
236
 
237
+ export declare namespace CollapsibleTriggerDataAttributes {
238
+ export {
239
+ panelOpen
240
+ }
241
+ }
242
+
190
243
  export declare interface CollapsibleTriggerProps extends NativeButtonProps, BaseUIComponentProps<'button', CollapsibleTriggerState> {}
191
244
 
192
245
  export declare interface CollapsibleTriggerState extends CollapsibleRootState {}
@@ -199,45 +252,55 @@ export declare interface CollapsibleTriggerState extends CollapsibleRootState {}
199
252
  */
200
253
  declare type ComponentRenderFn<Props, State> = (props: Props, state: State) => React_2.ReactElement<unknown>;
201
254
 
202
- declare const decrementPress: "decrement-press";
255
+ declare const decrementPress: 'decrement-press';
203
256
 
204
- declare const disabled: "disabled";
257
+ declare const disabled: 'disabled';
205
258
 
206
- declare const drag: "drag";
259
+ declare const drag: 'drag';
207
260
 
208
- declare const escapeKey: "escape-key";
261
+ /**
262
+ * Present when the collapsible is animating out.
263
+ */
264
+ declare const endingStyle = "data-ending-style";
209
265
 
210
- declare const focusOut: "focus-out";
266
+ /**
267
+ * Present when the panel is animating out.
268
+ */
269
+ declare const endingStyle_2 = "data-ending-style";
270
+
271
+ declare const escapeKey: 'escape-key';
272
+
273
+ declare const focusOut: 'focus-out';
211
274
 
212
275
  declare type HTMLProps<T = any> = React_2.HTMLAttributes<T> & {
213
276
  ref?: React_2.Ref<T> | undefined;
214
277
  };
215
278
 
216
- declare const imperativeAction: "imperative-action";
279
+ declare const imperativeAction: 'imperative-action';
217
280
 
218
- declare const incrementPress: "increment-press";
281
+ declare const incrementPress: 'increment-press';
219
282
 
220
- declare const initial: "initial";
283
+ declare const initial: 'initial';
221
284
 
222
- declare const inputBlur: "input-blur";
285
+ declare const inputBlur: 'input-blur';
223
286
 
224
- declare const inputChange: "input-change";
287
+ declare const inputChange: 'input-change';
225
288
 
226
- declare const inputClear: "input-clear";
289
+ declare const inputClear: 'input-clear';
227
290
 
228
- declare const inputPaste: "input-paste";
291
+ declare const inputPaste: 'input-paste';
229
292
 
230
- declare const inputPress: "input-press";
293
+ declare const inputPress: 'input-press';
231
294
 
232
- declare const itemPress: "item-press";
295
+ declare const itemPress: 'item-press';
233
296
 
234
- declare const keyboard: "keyboard";
297
+ declare const keyboard: 'keyboard';
235
298
 
236
- declare const linkPress: "link-press";
299
+ declare const linkPress: 'link-press';
237
300
 
238
- declare const listNavigation: "list-navigation";
301
+ declare const listNavigation: 'list-navigation';
239
302
 
240
- declare const missing: "missing";
303
+ declare const missing: 'missing';
241
304
 
242
305
  declare interface NativeButtonProps {
243
306
  /**
@@ -249,11 +312,28 @@ declare interface NativeButtonProps {
249
312
  nativeButton?: boolean | undefined;
250
313
  }
251
314
 
252
- declare const none: "none";
315
+ declare const none: 'none';
253
316
 
254
- declare const outsidePress: "outside-press";
317
+ /**
318
+ * Present when the collapsible is open.
319
+ */
320
+ declare const open_2 = "data-open";
255
321
 
256
- declare const pointer: "pointer";
322
+ /**
323
+ * Present when the collapsible panel is open.
324
+ */
325
+ declare const open_3 = "data-open";
326
+
327
+ declare const outsidePress: 'outside-press';
328
+
329
+ /**
330
+ * Present when the collapsible panel is open.
331
+ */
332
+ declare const panelOpen = "data-panel-open";
333
+
334
+ declare const pointer: 'pointer';
335
+
336
+ declare const popupClose: 'popup-close';
257
337
 
258
338
  declare namespace REASONS {
259
339
  export {
@@ -284,6 +364,7 @@ declare namespace REASONS {
284
364
  drag,
285
365
  wheel,
286
366
  scrub,
367
+ popupClose,
287
368
  cancelOpen,
288
369
  siblingOpen,
289
370
  disabled,
@@ -338,23 +419,34 @@ declare interface ReasonToEventMap {
338
419
  [REASONS.windowResize]: UIEvent;
339
420
  }
340
421
 
341
- declare const scrub: "scrub";
422
+ declare const scrub: 'scrub';
342
423
 
343
- declare const siblingOpen: "sibling-open";
424
+ declare const siblingOpen: 'sibling-open';
425
+
426
+ /**
427
+ * Present when the collapsible begins animating in.
428
+ */
429
+ declare const startingStyle = "data-starting-style";
430
+
431
+ /**
432
+ * Present when the panel begins animating in.
433
+ */
434
+ declare const startingStyle_2 = "data-starting-style";
344
435
 
345
- declare const swipe: "swipe";
436
+ declare const swipe: 'swipe';
346
437
 
347
- declare const trackPress: "track-press";
438
+ declare const trackPress: 'track-press';
348
439
 
349
440
  declare type TransitionStatus = 'starting' | 'ending' | 'idle' | undefined;
350
441
 
351
- declare const triggerFocus: "trigger-focus";
442
+ declare const triggerFocus: 'trigger-focus';
352
443
 
353
- declare const triggerHover: "trigger-hover";
444
+ declare const triggerHover: 'trigger-hover';
354
445
 
355
- declare const triggerPress: "trigger-press";
446
+ declare const triggerPress: 'trigger-press';
356
447
 
357
448
  declare interface UseCollapsibleRootReturnValue {
449
+ defaultPanelId: React_2.HTMLAttributes<Element>['id'];
358
450
  /**
359
451
  * Whether the component should ignore user interaction.
360
452
  */
@@ -373,13 +465,13 @@ declare interface UseCollapsibleRootReturnValue {
373
465
  panelId: React_2.HTMLAttributes<Element>['id'];
374
466
  setMounted: (nextMounted: boolean) => void;
375
467
  setOpen: (open: boolean) => void;
376
- setPanelIdState: (id: string | undefined) => void;
468
+ setPanelIdState: React_2.Dispatch<React_2.SetStateAction<string | null | undefined>>;
377
469
  transitionStatus: TransitionStatus;
378
470
  }
379
471
 
380
- declare const wheel: "wheel";
472
+ declare const wheel: 'wheel';
381
473
 
382
- declare const windowResize: "window-resize";
474
+ declare const windowResize: 'window-resize';
383
475
 
384
476
  /**
385
477
  * Adds a `preventBaseUIHandler` method to all event handlers.
@@ -1,10 +1,10 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { CollapsibleRootContext, useCollapsibleRootContext, collapsibleOpenStateMapping, triggerOpenStateMapping, useCollapsiblePanel, useCollapsibleRoot } from "../8052.js";
3
- import { transitionStatusMapping } from "../9369.js";
4
- import { useStableCallback } from "../7541.js";
5
- import { resolveStyle, useRenderElement, warn } from "../8272.js";
6
- import { useButton } from "../9189.js";
7
- import { useIsoLayoutEffect } from "../6499.js";
2
+ import { CollapsibleRootContext, useCollapsibleRootContext, collapsibleOpenStateMapping, triggerOpenStateMapping, useCollapsiblePanel, useCollapsibleRoot } from "../8.js";
3
+ import { transitionStatusMapping } from "../8488.js";
4
+ import { useStableCallback } from "../7488.js";
5
+ import { resolveStyle, useRenderElement, warn } from "../9591.js";
6
+ import { useButton } from "../9248.js";
7
+ import { useIsoLayoutEffect } from "../3357.js";
8
8
  import * as __rspack_external_react from "react";
9
9
  const collapsibleStateAttributesMapping = {
10
10
  ...collapsibleOpenStateMapping,
@@ -55,10 +55,9 @@ const stateAttributesMapping = {
55
55
  };
56
56
  const CollapsibleTrigger_CollapsibleTrigger = /*#__PURE__*/ __rspack_external_react.forwardRef(function(componentProps, forwardedRef) {
57
57
  const { panelId, open, handleTrigger, state, disabled: contextDisabled } = useCollapsibleRootContext();
58
- const { className, disabled = contextDisabled, id, render, nativeButton = true, style, ...elementProps } = componentProps;
58
+ const { className, disabled = contextDisabled, render, nativeButton = true, style, ...elementProps } = componentProps;
59
59
  const { getButtonProps, buttonRef } = useButton({
60
60
  disabled,
61
- focusableWhenDisabled: true,
62
61
  native: nativeButton
63
62
  });
64
63
  const element = useRenderElement('button', componentProps, {
@@ -81,37 +80,34 @@ const CollapsibleTrigger_CollapsibleTrigger = /*#__PURE__*/ __rspack_external_re
81
80
  return element;
82
81
  });
83
82
  if ("production" !== process.env.NODE_ENV) CollapsibleTrigger_CollapsibleTrigger.displayName = "CollapsibleTrigger";
84
- let CollapsiblePanelCssVars_CollapsiblePanelCssVars = /*#__PURE__*/ function(CollapsiblePanelCssVars) {
85
- CollapsiblePanelCssVars["collapsiblePanelHeight"] = "--collapsible-panel-height";
86
- CollapsiblePanelCssVars["collapsiblePanelWidth"] = "--collapsible-panel-width";
87
- return CollapsiblePanelCssVars;
88
- }({});
83
+ const collapsiblePanelHeight = '--collapsible-panel-height';
84
+ const collapsiblePanelWidth = '--collapsible-panel-width';
89
85
  const CollapsiblePanel_CollapsiblePanel = /*#__PURE__*/ __rspack_external_react.forwardRef(function(componentProps, forwardedRef) {
90
86
  const { className, hiddenUntilFound: hiddenUntilFoundProp, keepMounted: keepMountedProp, render, id: idProp, style, ...elementProps } = componentProps;
91
- if ('production' !== process.env.NODE_ENV) useIsoLayoutEffect(()=>{
87
+ if ('production' !== process.env.NODE_ENV) __rspack_external_react.useEffect(()=>{
92
88
  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.');
93
89
  }, [
94
90
  hiddenUntilFoundProp,
95
91
  keepMountedProp
96
92
  ]);
97
- const { mounted, onOpenChange, open, panelId, setMounted, setPanelIdState, setOpen, state, transitionStatus } = useCollapsibleRootContext();
93
+ const { defaultPanelId, mounted, onOpenChange, open, setMounted, setPanelIdState, setOpen, state, transitionStatus } = useCollapsibleRootContext();
98
94
  const hiddenUntilFound = hiddenUntilFoundProp ?? false;
99
95
  const keepMounted = keepMountedProp ?? false;
96
+ const registeredId = idProp || void 0;
97
+ const id = registeredId ?? defaultPanelId;
100
98
  useIsoLayoutEffect(()=>{
101
- if (idProp) {
102
- setPanelIdState(idProp);
103
- return ()=>{
104
- setPanelIdState(void 0);
105
- };
106
- }
99
+ setPanelIdState((currentId)=>registeredId ?? (null === currentId ? void 0 : currentId));
100
+ return ()=>{
101
+ setPanelIdState((currentId)=>currentId === registeredId ? null : currentId);
102
+ };
107
103
  }, [
108
- idProp,
104
+ registeredId,
109
105
  setPanelIdState
110
106
  ]);
111
107
  const { height, props, ref, shouldPreventOpenAnimation, shouldRender, transitionStatus: panelTransitionStatus, width } = useCollapsiblePanel({
112
108
  externalRef: forwardedRef,
113
109
  hiddenUntilFound,
114
- id: panelId,
110
+ id,
115
111
  keepMounted,
116
112
  mounted,
117
113
  onOpenChange,
@@ -135,8 +131,8 @@ const CollapsiblePanel_CollapsiblePanel = /*#__PURE__*/ __rspack_external_react.
135
131
  props,
136
132
  {
137
133
  style: {
138
- [CollapsiblePanelCssVars_CollapsiblePanelCssVars.collapsiblePanelHeight]: void 0 === height ? 'auto' : `${height}px`,
139
- [CollapsiblePanelCssVars_CollapsiblePanelCssVars.collapsiblePanelWidth]: void 0 === width ? 'auto' : `${width}px`
134
+ [collapsiblePanelHeight]: void 0 === height ? 'auto' : `${height}px`,
135
+ [collapsiblePanelWidth]: void 0 === width ? 'auto' : `${width}px`
140
136
  }
141
137
  },
142
138
  elementProps,