@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
package/dist/8106.js DELETED
@@ -1,239 +0,0 @@
1
- import { FloatingRootStore } from "./5992.js";
2
- import { useIsoLayoutEffect } from "./6499.js";
3
- import { isElement } from "./3829.js";
4
- import { FOCUSABLE_ATTRIBUTE } from "./4745.js";
5
- import { useId } from "./2205.js";
6
- import { useFloatingParentNodeId } from "./285.js";
7
- import { useStableCallback } from "./7541.js";
8
- import { useTransitionStatus } from "./4863.js";
9
- import { useOpenChangeComplete } from "./9369.js";
10
- import { EMPTY_OBJECT } from "./8272.js";
11
- import * as __rspack_external_react from "react";
12
- function useSyncedFloatingRootContext(options) {
13
- const { popupStore, treatPopupAsFloatingElement = false, floatingRootContext: floatingRootContextProp, floatingId, nested, onOpenChange } = options;
14
- const open = popupStore.useState('open');
15
- const referenceElement = popupStore.useState('activeTriggerElement');
16
- const floatingElement = popupStore.useState(treatPopupAsFloatingElement ? 'popupElement' : 'positionerElement');
17
- const triggerElements = popupStore.context.triggerElements;
18
- const handleOpenChange = onOpenChange;
19
- const internalStoreRef = __rspack_external_react.useRef(null);
20
- if (void 0 === floatingRootContextProp && null === internalStoreRef.current) internalStoreRef.current = new FloatingRootStore({
21
- open,
22
- transitionStatus: void 0,
23
- referenceElement,
24
- floatingElement,
25
- triggerElements,
26
- onOpenChange: handleOpenChange,
27
- floatingId,
28
- syncOnly: true,
29
- nested
30
- });
31
- const store = floatingRootContextProp ?? internalStoreRef.current;
32
- popupStore.useSyncedValue('floatingId', floatingId);
33
- useIsoLayoutEffect(()=>{
34
- const valuesToSync = {
35
- open,
36
- floatingId,
37
- referenceElement,
38
- floatingElement
39
- };
40
- if (isElement(referenceElement)) valuesToSync.domReferenceElement = referenceElement;
41
- if (store.state.positionReference === store.state.referenceElement) valuesToSync.positionReference = referenceElement;
42
- store.update(valuesToSync);
43
- }, [
44
- open,
45
- floatingId,
46
- referenceElement,
47
- floatingElement,
48
- store
49
- ]);
50
- store.context.onOpenChange = handleOpenChange;
51
- store.context.nested = nested;
52
- return store;
53
- }
54
- const FOCUSABLE_POPUP_PROPS = {
55
- tabIndex: -1,
56
- [FOCUSABLE_ATTRIBUTE]: ''
57
- };
58
- function usePopupStore(externalStore, createStore, treatPopupAsFloatingElement = false) {
59
- const floatingId = useId();
60
- const nested = null != useFloatingParentNodeId();
61
- const internalStoreRef = __rspack_external_react.useRef(null);
62
- if (void 0 === externalStore && null === internalStoreRef.current) internalStoreRef.current = createStore(floatingId, nested);
63
- const store = externalStore ?? internalStoreRef.current;
64
- useSyncedFloatingRootContext({
65
- popupStore: store,
66
- treatPopupAsFloatingElement,
67
- floatingRootContext: store.state.floatingRootContext,
68
- floatingId,
69
- nested,
70
- onOpenChange: store.setOpen
71
- });
72
- return {
73
- store,
74
- internalStore: internalStoreRef.current
75
- };
76
- }
77
- function useTriggerRegistration(id, store) {
78
- const registeredElementIdRef = __rspack_external_react.useRef(null);
79
- const registeredElementRef = __rspack_external_react.useRef(null);
80
- return __rspack_external_react.useCallback((element)=>{
81
- if (void 0 === id) return;
82
- let shouldSyncTriggerCount = false;
83
- if (null !== registeredElementIdRef.current) {
84
- const registeredId = registeredElementIdRef.current;
85
- const registeredElement = registeredElementRef.current;
86
- const currentElement = store.context.triggerElements.getById(registeredId);
87
- if (registeredElement && currentElement === registeredElement) {
88
- store.context.triggerElements.delete(registeredId);
89
- shouldSyncTriggerCount = true;
90
- }
91
- registeredElementIdRef.current = null;
92
- registeredElementRef.current = null;
93
- }
94
- if (null !== element) {
95
- registeredElementIdRef.current = id;
96
- registeredElementRef.current = element;
97
- store.context.triggerElements.add(id, element);
98
- shouldSyncTriggerCount = true;
99
- }
100
- if (shouldSyncTriggerCount) {
101
- const triggerCount = store.context.triggerElements.size;
102
- if (store.select('open') && store.state.triggerCount !== triggerCount) store.set('triggerCount', triggerCount);
103
- }
104
- }, [
105
- store,
106
- id
107
- ]);
108
- }
109
- function setOpenTriggerState(state, open, trigger) {
110
- const triggerId = trigger?.id ?? null;
111
- if (triggerId || open) {
112
- state.activeTriggerId = triggerId;
113
- state.activeTriggerElement = trigger ?? null;
114
- }
115
- }
116
- function useTriggerDataForwarding(triggerId, triggerElementRef, store, stateUpdates) {
117
- const isMountedByThisTrigger = store.useState('isMountedByTrigger', triggerId);
118
- const baseRegisterTrigger = useTriggerRegistration(triggerId, store);
119
- const registerTrigger = useStableCallback((element)=>{
120
- baseRegisterTrigger(element);
121
- if (!element) return;
122
- const open = store.select('open');
123
- const activeTriggerId = store.select('activeTriggerId');
124
- if (activeTriggerId === triggerId) return void store.update({
125
- activeTriggerElement: element,
126
- ...open ? stateUpdates : null
127
- });
128
- if (null == activeTriggerId && open) store.update({
129
- activeTriggerId: triggerId,
130
- activeTriggerElement: element,
131
- ...stateUpdates
132
- });
133
- });
134
- useIsoLayoutEffect(()=>{
135
- if (isMountedByThisTrigger) store.update({
136
- activeTriggerElement: triggerElementRef.current,
137
- ...stateUpdates
138
- });
139
- }, [
140
- isMountedByThisTrigger,
141
- store,
142
- triggerElementRef,
143
- ...Object.values(stateUpdates)
144
- ]);
145
- return {
146
- registerTrigger,
147
- isMountedByThisTrigger
148
- };
149
- }
150
- function useImplicitActiveTrigger(store) {
151
- const open = store.useState('open');
152
- const reactiveTriggerCount = store.useState('triggerCount');
153
- useIsoLayoutEffect(()=>{
154
- if (!open) {
155
- if (0 !== store.state.triggerCount) store.set('triggerCount', 0);
156
- return;
157
- }
158
- const triggerCount = store.context.triggerElements.size;
159
- const stateUpdates = {};
160
- if (store.state.triggerCount !== triggerCount) stateUpdates.triggerCount = triggerCount;
161
- if (!store.select('activeTriggerId') && 1 === triggerCount) {
162
- const iteratorResult = store.context.triggerElements.entries().next();
163
- if (!iteratorResult.done) {
164
- const [implicitTriggerId, implicitTriggerElement] = iteratorResult.value;
165
- stateUpdates.activeTriggerId = implicitTriggerId;
166
- stateUpdates.activeTriggerElement = implicitTriggerElement;
167
- }
168
- }
169
- if (void 0 !== stateUpdates.triggerCount || void 0 !== stateUpdates.activeTriggerId) store.update(stateUpdates);
170
- }, [
171
- open,
172
- store,
173
- reactiveTriggerCount
174
- ]);
175
- }
176
- function useOpenStateTransitions(open, store, onUnmount) {
177
- const { mounted, setMounted, transitionStatus } = useTransitionStatus(open);
178
- store.useSyncedValues({
179
- mounted,
180
- transitionStatus
181
- });
182
- const forceUnmount = useStableCallback(()=>{
183
- setMounted(false);
184
- store.update({
185
- activeTriggerId: null,
186
- activeTriggerElement: null,
187
- mounted: false,
188
- preventUnmountingOnClose: false
189
- });
190
- onUnmount?.();
191
- store.context.onOpenChangeComplete?.(false);
192
- });
193
- const preventUnmountingOnClose = store.useState('preventUnmountingOnClose');
194
- useOpenChangeComplete({
195
- enabled: mounted && !open && !preventUnmountingOnClose,
196
- open,
197
- ref: store.context.popupRef,
198
- onComplete () {
199
- if (!open) forceUnmount();
200
- }
201
- });
202
- return {
203
- forceUnmount,
204
- transitionStatus
205
- };
206
- }
207
- function usePopupInteractionProps(store, statePart) {
208
- store.useSyncedValues(statePart);
209
- useIsoLayoutEffect(()=>()=>{
210
- store.update({
211
- activeTriggerProps: EMPTY_OBJECT,
212
- inactiveTriggerProps: EMPTY_OBJECT,
213
- popupProps: EMPTY_OBJECT
214
- });
215
- }, [
216
- store
217
- ]);
218
- }
219
- function usePopupRootSync(store, open) {
220
- useIsoLayoutEffect(()=>{
221
- if (!open && null !== store.state.openMethod) store.set('openMethod', null);
222
- }, [
223
- open,
224
- store
225
- ]);
226
- useIsoLayoutEffect(()=>()=>{
227
- if (null !== store.state.openMethod) store.set('openMethod', null);
228
- }, [
229
- store
230
- ]);
231
- }
232
- function useOnFirstRender(fn) {
233
- const ref = __rspack_external_react.useRef(true);
234
- if (ref.current) {
235
- ref.current = false;
236
- fn();
237
- }
238
- }
239
- export { FOCUSABLE_POPUP_PROPS, setOpenTriggerState, useImplicitActiveTrigger, useOnFirstRender, useOpenStateTransitions, usePopupInteractionProps, usePopupRootSync, usePopupStore, useSyncedFloatingRootContext, useTriggerDataForwarding, useTriggerRegistration };
package/dist/8685.js DELETED
@@ -1,102 +0,0 @@
1
- import { useLabelableContext, useFieldRootContext, fieldValidityMapping } from "./1477.js";
2
- import { useLabelableId } from "./9048.js";
3
- import { useIsoLayoutEffect } from "./6499.js";
4
- import { activeElement } from "./4549.js";
5
- import { ownerDocument } from "./9829.js";
6
- import { useControlled } from "./8527.js";
7
- import { useStableCallback } from "./7541.js";
8
- import { useRegisterFieldControl } from "./4281.js";
9
- import { useRenderElement } from "./8272.js";
10
- import { createChangeEventDetails } from "./4768.js";
11
- import * as __rspack_external_react from "react";
12
- const FieldControl_FieldControl = /*#__PURE__*/ __rspack_external_react.forwardRef(function(componentProps, forwardedRef) {
13
- const { render, className, id: idProp, name: nameProp, value: valueProp, disabled: disabledProp = false, onValueChange, defaultValue, autoFocus = false, style, ...elementProps } = componentProps;
14
- const { state: fieldState, name: fieldName, disabled: fieldDisabled, setTouched, setDirty, validityData, setFocused, setFilled, validationMode, validation } = useFieldRootContext();
15
- const disabled = fieldDisabled || disabledProp;
16
- const name = fieldName ?? nameProp;
17
- const state = {
18
- ...fieldState,
19
- disabled
20
- };
21
- const { labelId } = useLabelableContext();
22
- const id = useLabelableId({
23
- id: idProp
24
- });
25
- useIsoLayoutEffect(()=>{
26
- const hasExternalValue = null != valueProp;
27
- if (validation.inputRef.current?.value || hasExternalValue && '' !== valueProp) setFilled(true);
28
- else if (hasExternalValue && '' === valueProp) setFilled(false);
29
- }, [
30
- validation.inputRef,
31
- setFilled,
32
- valueProp
33
- ]);
34
- const inputRef = __rspack_external_react.useRef(null);
35
- useIsoLayoutEffect(()=>{
36
- if (autoFocus && inputRef.current === activeElement(ownerDocument(inputRef.current))) setFocused(true);
37
- }, [
38
- autoFocus,
39
- setFocused
40
- ]);
41
- const [valueUnwrapped] = useControlled({
42
- controlled: valueProp,
43
- default: defaultValue,
44
- name: 'FieldControl',
45
- state: 'value'
46
- });
47
- const isControlled = void 0 !== valueProp;
48
- const value = isControlled ? valueUnwrapped : void 0;
49
- const getValueFromInput = useStableCallback(()=>validation.inputRef.current?.value);
50
- useRegisterFieldControl(validation.inputRef, id, value, getValueFromInput);
51
- const element = useRenderElement('input', componentProps, {
52
- ref: [
53
- forwardedRef,
54
- inputRef
55
- ],
56
- state,
57
- props: [
58
- {
59
- id,
60
- disabled,
61
- name,
62
- ref: validation.inputRef,
63
- 'aria-labelledby': labelId,
64
- autoFocus,
65
- ...isControlled ? {
66
- value
67
- } : {
68
- defaultValue
69
- },
70
- onChange (event) {
71
- const inputValue = event.currentTarget.value;
72
- onValueChange?.(inputValue, createChangeEventDetails("none", event.nativeEvent));
73
- setDirty(inputValue !== validityData.initialValue);
74
- setFilled('' !== inputValue);
75
- },
76
- onFocus () {
77
- setFocused(true);
78
- },
79
- onBlur (event) {
80
- setTouched(true);
81
- setFocused(false);
82
- if ('onBlur' === validationMode) validation.commit(event.currentTarget.value);
83
- },
84
- onKeyDown (event) {
85
- if ('INPUT' === event.currentTarget.tagName && 'Enter' === event.key) {
86
- setTouched(true);
87
- validation.commit(event.currentTarget.value);
88
- }
89
- }
90
- },
91
- validation.getInputValidationProps(),
92
- elementProps
93
- ],
94
- stateAttributesMapping: fieldValidityMapping
95
- });
96
- return element;
97
- });
98
- if ("production" !== process.env.NODE_ENV) FieldControl_FieldControl.displayName = "FieldControl";
99
- const Input_module = {
100
- root: "root-Y7wYn3"
101
- };
102
- export { FieldControl_FieldControl, Input_module };
package/dist/8935.js DELETED
@@ -1,8 +0,0 @@
1
- import * as __rspack_external_react from "react";
2
- function useForcedRerendering() {
3
- const [, setState] = __rspack_external_react.useState({});
4
- return __rspack_external_react.useCallback(()=>{
5
- setState({});
6
- }, []);
7
- }
8
- export { useForcedRerendering };
package/dist/8971.js DELETED
@@ -1,40 +0,0 @@
1
- const hasNavigator = "u" > typeof navigator;
2
- const nav = getNavigatorData();
3
- const platform = getPlatform();
4
- const userAgent = getUserAgent();
5
- const isWebKit = "u" > typeof CSS && CSS.supports ? CSS.supports('-webkit-backdrop-filter:none') : false;
6
- const isIOS = 'MacIntel' === nav.platform && nav.maxTouchPoints > 1 ? true : /iP(hone|ad|od)|iOS/.test(nav.platform);
7
- const isFirefox = hasNavigator && /firefox/i.test(userAgent);
8
- const isSafari = hasNavigator && /apple/i.test(navigator.vendor);
9
- hasNavigator && /Edg/i.test(userAgent);
10
- const isAndroid = hasNavigator && /android/i.test(platform) || /android/i.test(userAgent);
11
- const isMac = hasNavigator && platform.toLowerCase().startsWith('mac') && !navigator.maxTouchPoints;
12
- const isJSDOM = userAgent.includes('jsdom/');
13
- function getNavigatorData() {
14
- if (!hasNavigator) return {
15
- platform: '',
16
- maxTouchPoints: -1
17
- };
18
- const uaData = navigator.userAgentData;
19
- if (uaData?.platform) return {
20
- platform: uaData.platform,
21
- maxTouchPoints: navigator.maxTouchPoints
22
- };
23
- return {
24
- platform: navigator.platform ?? '',
25
- maxTouchPoints: navigator.maxTouchPoints ?? -1
26
- };
27
- }
28
- function getUserAgent() {
29
- if (!hasNavigator) return '';
30
- const uaData = navigator.userAgentData;
31
- if (uaData && Array.isArray(uaData.brands)) return uaData.brands.map(({ brand, version })=>`${brand}/${version}`).join(' ');
32
- return navigator.userAgent;
33
- }
34
- function getPlatform() {
35
- if (!hasNavigator) return '';
36
- const uaData = navigator.userAgentData;
37
- if (uaData?.platform) return uaData.platform;
38
- return navigator.platform ?? '';
39
- }
40
- export { isAndroid, isFirefox, isIOS, isJSDOM, isMac, isSafari, isWebKit };
package/dist/8979.js DELETED
@@ -1,10 +0,0 @@
1
- import { esm_formatErrorMessage } from "./8272.js";
2
- import * as __rspack_external_react from "react";
3
- const CheckboxGroupContext = /*#__PURE__*/ __rspack_external_react.createContext(void 0);
4
- if ("production" !== process.env.NODE_ENV) CheckboxGroupContext.displayName = "CheckboxGroupContext";
5
- function useCheckboxGroupContext(optional = true) {
6
- const context = __rspack_external_react.useContext(CheckboxGroupContext);
7
- if (void 0 === context && !optional) throw new Error("production" !== process.env.NODE_ENV ? 'Base UI: CheckboxGroupContext is missing. CheckboxGroup parts must be placed within <CheckboxGroup>.' : esm_formatErrorMessage(3));
8
- return context;
9
- }
10
- export { CheckboxGroupContext, useCheckboxGroupContext };
package/dist/9048.js DELETED
@@ -1,52 +0,0 @@
1
- import { useLabelableContext } from "./1477.js";
2
- import { useBaseUiId } from "./6046.js";
3
- import { useRefWithInit, NOOP } from "./8272.js";
4
- import { useStableCallback } from "./7541.js";
5
- import { useIsoLayoutEffect } from "./6499.js";
6
- import { isElement } from "./3829.js";
7
- import * as __rspack_external_react from "react";
8
- function useLabelableId(params = {}) {
9
- const { id, implicit = false, controlRef } = params;
10
- const { controlId, registerControlId } = useLabelableContext();
11
- const defaultId = useBaseUiId(id);
12
- const controlIdForEffect = implicit ? controlId : void 0;
13
- const controlSourceRef = useRefWithInit(()=>Symbol('labelable-control'));
14
- const hasRegisteredRef = __rspack_external_react.useRef(false);
15
- const hadExplicitIdRef = __rspack_external_react.useRef(null != id);
16
- const unregisterControlId = useStableCallback(()=>{
17
- if (!hasRegisteredRef.current || registerControlId === NOOP) return;
18
- hasRegisteredRef.current = false;
19
- registerControlId(controlSourceRef.current, void 0);
20
- });
21
- useIsoLayoutEffect(()=>{
22
- if (registerControlId === NOOP) return;
23
- let nextId;
24
- if (implicit) {
25
- const elem = controlRef?.current;
26
- nextId = isElement(elem) && null != elem.closest('label') ? id ?? null : controlIdForEffect ?? defaultId;
27
- } else if (null != id) {
28
- hadExplicitIdRef.current = true;
29
- nextId = id;
30
- } else {
31
- if (!hadExplicitIdRef.current) return void unregisterControlId();
32
- nextId = defaultId;
33
- }
34
- if (void 0 === nextId) return void unregisterControlId();
35
- hasRegisteredRef.current = true;
36
- registerControlId(controlSourceRef.current, nextId);
37
- }, [
38
- id,
39
- controlRef,
40
- controlIdForEffect,
41
- registerControlId,
42
- implicit,
43
- defaultId,
44
- controlSourceRef,
45
- unregisterControlId
46
- ]);
47
- __rspack_external_react.useEffect(()=>unregisterControlId, [
48
- unregisterControlId
49
- ]);
50
- return controlId ?? defaultId;
51
- }
52
- export { useLabelableId };