@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/1669.js ADDED
@@ -0,0 +1,75 @@
1
+ import { ReactStore } from "./226.js";
2
+ import { FloatingRootStore } from "./4346.js";
3
+ import { EMPTY_OBJECT } from "./9591.js";
4
+ class NullStore extends ReactStore {
5
+ setState(_newState) {}
6
+ update(_changes) {}
7
+ set(_key, _value) {}
8
+ notifyAll() {}
9
+ }
10
+ function createInitialPopupStoreState(triggerElements, floatingId, nested = false) {
11
+ return {
12
+ open: false,
13
+ openProp: void 0,
14
+ mounted: false,
15
+ transitionStatus: void 0,
16
+ floatingRootContext: new FloatingRootStore({
17
+ open: false,
18
+ transitionStatus: void 0,
19
+ floatingElement: null,
20
+ referenceElement: null,
21
+ triggerElements,
22
+ floatingId,
23
+ syncOnly: true,
24
+ nested,
25
+ onOpenChange: void 0
26
+ }),
27
+ floatingId,
28
+ triggerCount: 0,
29
+ preventUnmountingOnClose: false,
30
+ payload: void 0,
31
+ activeTriggerId: null,
32
+ activeTriggerElement: null,
33
+ openedWithoutTrigger: false,
34
+ triggerIdProp: void 0,
35
+ popupElement: null,
36
+ positionerElement: null,
37
+ activeTriggerProps: EMPTY_OBJECT,
38
+ inactiveTriggerProps: EMPTY_OBJECT,
39
+ popupProps: EMPTY_OBJECT
40
+ };
41
+ }
42
+ const activeTriggerIdSelector = (state)=>state.triggerIdProp ?? state.activeTriggerId;
43
+ const openSelector = (state)=>state.openProp ?? state.open;
44
+ const popupIdSelector = (state)=>{
45
+ const popupId = state.popupElement?.id ?? state.floatingId;
46
+ return popupId || void 0;
47
+ };
48
+ function triggerOwnsOpenPopup(state, triggerId) {
49
+ return void 0 !== triggerId && openSelector(state) && activeTriggerIdSelector(state) === triggerId;
50
+ }
51
+ function triggerOwnsOpenPopupOrIsOnlyTrigger(state, triggerId) {
52
+ if (triggerOwnsOpenPopup(state, triggerId)) return true;
53
+ return void 0 !== triggerId && openSelector(state) && null == activeTriggerIdSelector(state) && !state.openedWithoutTrigger && 1 === state.triggerCount;
54
+ }
55
+ const popupStoreSelectors = {
56
+ open: openSelector,
57
+ mounted: (state)=>state.mounted,
58
+ transitionStatus: (state)=>openSelector(state) && !state.mounted ? 'starting' : state.transitionStatus,
59
+ floatingRootContext: (state)=>state.floatingRootContext,
60
+ triggerCount: (state)=>state.triggerCount,
61
+ preventUnmountingOnClose: (state)=>state.preventUnmountingOnClose,
62
+ payload: (state)=>state.payload,
63
+ activeTriggerId: activeTriggerIdSelector,
64
+ activeTriggerElement: (state)=>state.mounted ? state.activeTriggerElement : null,
65
+ popupId: popupIdSelector,
66
+ isTriggerActive: (state, triggerId)=>void 0 !== triggerId && activeTriggerIdSelector(state) === triggerId,
67
+ isOpenedByTrigger: (state, triggerId)=>triggerOwnsOpenPopup(state, triggerId),
68
+ isMountedByTrigger: (state, triggerId)=>void 0 !== triggerId && activeTriggerIdSelector(state) === triggerId && state.mounted,
69
+ triggerProps: (state, isActive)=>isActive ? state.activeTriggerProps : state.inactiveTriggerProps,
70
+ triggerPopupId: (state, triggerId)=>triggerOwnsOpenPopupOrIsOnlyTrigger(state, triggerId) ? popupIdSelector(state) : void 0,
71
+ popupProps: (state)=>state.popupProps,
72
+ popupElement: (state)=>state.popupElement,
73
+ positionerElement: (state)=>state.positionerElement
74
+ };
75
+ export { NullStore, createInitialPopupStoreState, popupStoreSelectors };
package/dist/1718.js ADDED
@@ -0,0 +1,26 @@
1
+ import { createChangeEventDetails } from "./8495.js";
2
+ import { focusOut } from "./9837.js";
3
+ import { getTabbableNearElement, isOutsideEvent } from "./3398.js";
4
+ import * as __rspack_external_react_dom_7136dc57 from "react-dom";
5
+ function useTriggerFocusGuards(store, triggerElementRef) {
6
+ function closeAndFocus(event, direction, positionerElement) {
7
+ const guard = event.currentTarget;
8
+ __rspack_external_react_dom_7136dc57.flushSync(()=>{
9
+ store.setOpen(false, createChangeEventDetails(focusOut, event.nativeEvent, guard));
10
+ });
11
+ getTabbableNearElement(guard.isConnected ? guard : triggerElementRef.current, direction, positionerElement)?.focus();
12
+ }
13
+ function handlePreFocusGuardFocus(event) {
14
+ closeAndFocus(event, -1, store.select('positionerElement'));
15
+ }
16
+ function handleFocusTargetFocus(event) {
17
+ const positionerElement = store.select('positionerElement');
18
+ if (positionerElement && isOutsideEvent(event, positionerElement)) store.context.beforeContentFocusGuardRef.current?.focus();
19
+ else closeAndFocus(event, 1, positionerElement);
20
+ }
21
+ return {
22
+ handlePreFocusGuardFocus,
23
+ handleFocusTargetFocus
24
+ };
25
+ }
26
+ export { useTriggerFocusGuards };
@@ -1,15 +1,8 @@
1
- import { NOOP, esm_formatErrorMessage, EMPTY_OBJECT } from "./8272.js";
1
+ import { NOOP, EMPTY_OBJECT } from "./9591.js";
2
+ import { utils_formatErrorMessage } from "./5473.js";
2
3
  import * as __rspack_external_react from "react";
3
- let FieldControlDataAttributes_FieldControlDataAttributes = /*#__PURE__*/ function(FieldControlDataAttributes) {
4
- FieldControlDataAttributes["disabled"] = "data-disabled";
5
- FieldControlDataAttributes["valid"] = "data-valid";
6
- FieldControlDataAttributes["invalid"] = "data-invalid";
7
- FieldControlDataAttributes["touched"] = "data-touched";
8
- FieldControlDataAttributes["dirty"] = "data-dirty";
9
- FieldControlDataAttributes["filled"] = "data-filled";
10
- FieldControlDataAttributes["focused"] = "data-focused";
11
- return FieldControlDataAttributes;
12
- }({});
4
+ const valid = 'data-valid';
5
+ const invalid = 'data-invalid';
13
6
  const DEFAULT_VALIDITY_STATE = {
14
7
  badInput: false,
15
8
  customError: false,
@@ -38,10 +31,10 @@ const fieldValidityMapping = {
38
31
  valid (value) {
39
32
  if (null === value) return null;
40
33
  if (value) return {
41
- [FieldControlDataAttributes_FieldControlDataAttributes.valid]: ''
34
+ [valid]: ''
42
35
  };
43
36
  return {
44
- [FieldControlDataAttributes_FieldControlDataAttributes.invalid]: ''
37
+ [invalid]: ''
45
38
  };
46
39
  }
47
40
  };
@@ -57,42 +50,40 @@ const DEFAULT_FIELD_ROOT_CONTEXT = {
57
50
  },
58
51
  setValidityData: NOOP,
59
52
  disabled: void 0,
60
- touched: DEFAULT_FIELD_STATE_ATTRIBUTES.touched,
61
53
  setTouched: NOOP,
62
- dirty: DEFAULT_FIELD_STATE_ATTRIBUTES.dirty,
63
54
  setDirty: NOOP,
64
- filled: DEFAULT_FIELD_STATE_ATTRIBUTES.filled,
65
55
  setFilled: NOOP,
66
- focused: DEFAULT_FIELD_STATE_ATTRIBUTES.focused,
67
56
  setFocused: NOOP,
68
- validate: ()=>null,
57
+ focusOwnerRef: {
58
+ current: void 0
59
+ },
69
60
  validationMode: 'onSubmit',
70
- validationDebounceTime: 0,
71
61
  shouldValidateOnChange: ()=>false,
72
62
  state: DEFAULT_FIELD_ROOT_STATE,
73
- markedDirtyRef: {
74
- current: false
75
- },
76
63
  registerFieldControl: NOOP,
77
64
  validation: {
78
- getValidationProps: (props = EMPTY_OBJECT)=>props,
79
- getInputValidationProps: (props = EMPTY_OBJECT)=>props,
65
+ getValidationProps: (_disabled, props = EMPTY_OBJECT)=>props,
80
66
  inputRef: {
81
67
  current: null
82
68
  },
83
- commit: async ()=>{}
69
+ registeredInputs: new Map(),
70
+ registerInput: NOOP,
71
+ getInputControl: ()=>null,
72
+ commit: async ()=>{},
73
+ change: NOOP
84
74
  }
85
75
  };
86
76
  const FieldRootContext = /*#__PURE__*/ __rspack_external_react.createContext(DEFAULT_FIELD_ROOT_CONTEXT);
87
77
  if ("production" !== process.env.NODE_ENV) FieldRootContext.displayName = "FieldRootContext";
88
78
  function useFieldRootContext(optional = true) {
89
79
  const context = __rspack_external_react.useContext(FieldRootContext);
90
- if (context.setValidityData === NOOP && !optional) throw new Error("production" !== process.env.NODE_ENV ? 'Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.' : esm_formatErrorMessage(28));
80
+ if (context.setValidityData === NOOP && !optional) throw new Error("production" !== process.env.NODE_ENV ? 'Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.' : utils_formatErrorMessage(28));
91
81
  return context;
92
82
  }
93
83
  const LabelableContext = /*#__PURE__*/ __rspack_external_react.createContext({
94
84
  controlId: void 0,
95
85
  registerControlId: NOOP,
86
+ resetControlId: NOOP,
96
87
  labelId: void 0,
97
88
  setLabelId: NOOP,
98
89
  messageIds: [],
package/dist/2221.js ADDED
@@ -0,0 +1,9 @@
1
+ import { lowerPlatform, lowerUserAgent, maxTouchPoints } from "./70.js";
2
+ const ios = /^i(os$|p)/.test(lowerPlatform) || 'macintel' === lowerPlatform && maxTouchPoints > 1;
3
+ const ANDROID_STRING = 'android';
4
+ const android = lowerPlatform === ANDROID_STRING || lowerUserAgent.includes(ANDROID_STRING);
5
+ const mac = !ios && lowerPlatform.startsWith('mac');
6
+ lowerPlatform.startsWith('win');
7
+ android || /^(linux|chrome os)/.test(lowerPlatform);
8
+ const apple = mac || ios;
9
+ export { android, apple, ios, mac };
@@ -1,9 +1,9 @@
1
- /*! LICENSE: 2445.js.LICENSE.txt */
1
+ /*! LICENSE: 226.js.LICENSE.txt */
2
2
  import { __webpack_require__ } from "./rslib-runtime.js";
3
3
  import "./4586.js";
4
- import { NOOP, useRefWithInit, isReactVersionAtLeast, esm_formatErrorMessage } from "./8272.js";
5
- import { useIsoLayoutEffect } from "./6499.js";
6
- import { useStableCallback } from "./7541.js";
4
+ import { useRefWithInit, isReactVersionAtLeast, NOOP } from "./9591.js";
5
+ import { useIsoLayoutEffect } from "./3357.js";
6
+ import { useStableCallback } from "./7488.js";
7
7
  import * as __rspack_external_react from "react";
8
8
  __webpack_require__.add({
9
9
  "../../node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.development.js" (__unused_rspack_module, exports, __webpack_require__) {
@@ -156,43 +156,6 @@ __webpack_require__.add({
156
156
  function createAttribute(name) {
157
157
  return `data-base-ui-${name}`;
158
158
  }
159
- const createSelector = (a, b, c, d, e, f, ...other)=>{
160
- if (other.length > 0) throw new Error("production" !== process.env.NODE_ENV ? 'Unsupported number of selectors' : esm_formatErrorMessage(1));
161
- let selector;
162
- if (a && b && c && d && e && f) selector = (state, a1, a2, a3)=>{
163
- const va = a(state, a1, a2, a3);
164
- const vb = b(state, a1, a2, a3);
165
- const vc = c(state, a1, a2, a3);
166
- const vd = d(state, a1, a2, a3);
167
- const ve = e(state, a1, a2, a3);
168
- return f(va, vb, vc, vd, ve, a1, a2, a3);
169
- };
170
- else if (a && b && c && d && e) selector = (state, a1, a2, a3)=>{
171
- const va = a(state, a1, a2, a3);
172
- const vb = b(state, a1, a2, a3);
173
- const vc = c(state, a1, a2, a3);
174
- const vd = d(state, a1, a2, a3);
175
- return e(va, vb, vc, vd, a1, a2, a3);
176
- };
177
- else if (a && b && c && d) selector = (state, a1, a2, a3)=>{
178
- const va = a(state, a1, a2, a3);
179
- const vb = b(state, a1, a2, a3);
180
- const vc = c(state, a1, a2, a3);
181
- return d(va, vb, vc, a1, a2, a3);
182
- };
183
- else if (a && b && c) selector = (state, a1, a2, a3)=>{
184
- const va = a(state, a1, a2, a3);
185
- const vb = b(state, a1, a2, a3);
186
- return c(va, vb, a1, a2, a3);
187
- };
188
- else if (a && b) selector = (state, a1, a2, a3)=>{
189
- const va = a(state, a1, a2, a3);
190
- return b(va, a1, a2, a3);
191
- };
192
- else if (a) selector = a;
193
- else throw new Error('Missing arguments');
194
- return selector;
195
- };
196
159
  const hooks = [];
197
160
  let currentInstance;
198
161
  function getInstance() {
@@ -256,10 +219,9 @@ register({
256
219
  for(let i = 0; i < instance.syncHooks.length; i += 1){
257
220
  const hook = instance.syncHooks[i];
258
221
  const value = hook.selector(hook.store.state, hook.a1, hook.a2, hook.a3);
259
- if (hook.didChange || !Object.is(hook.value, value)) {
222
+ if (!Object.is(hook.value, value)) {
260
223
  didChange = true;
261
224
  hook.value = value;
262
- hook.didChange = false;
263
225
  }
264
226
  }
265
227
  if (didChange) instance.syncTick += 1;
@@ -300,7 +262,7 @@ function useStoreFast(store, selector, a1, a2, a3) {
300
262
  hook.a1 = a1;
301
263
  hook.a2 = a2;
302
264
  hook.a3 = a3;
303
- hook.didChange = true;
265
+ hook.value = selector(store.getSnapshot(), a1, a2, a3);
304
266
  }
305
267
  } else {
306
268
  hook = {
@@ -309,8 +271,7 @@ function useStoreFast(store, selector, a1, a2, a3) {
309
271
  a1,
310
272
  a2,
311
273
  a3,
312
- value: selector(store.getSnapshot(), a1, a2, a3),
313
- didChange: false
274
+ value: selector(store.getSnapshot(), a1, a2, a3)
314
275
  };
315
276
  instance.syncHooks.push(hook);
316
277
  }
@@ -320,6 +281,9 @@ function useStoreLegacy(store, selector, a1, a2, a3) {
320
281
  return (0, with_selector.useSyncExternalStoreWithSelector)(store.subscribe, store.getSnapshot, store.getSnapshot, (state)=>selector(state, a1, a2, a3));
321
282
  }
322
283
  class Store {
284
+ static create(state) {
285
+ return new this(state);
286
+ }
323
287
  constructor(state){
324
288
  this.state = state;
325
289
  this.listeners = new Set();
@@ -429,7 +393,7 @@ class ReactStore extends Store {
429
393
  const cache = this.controlledValues ??= new Map();
430
394
  if (!cache.has(key)) cache.set(key, isControlled);
431
395
  const previouslyControlled = cache.get(key);
432
- if (void 0 !== previouslyControlled && previouslyControlled !== isControlled) console.error(`A component is changing the ${isControlled ? '' : 'un'}controlled state of ${key.toString()} to be ${isControlled ? 'un' : ''}controlled. Elements should not switch from uncontrolled to controlled (or vice versa).`);
396
+ if (void 0 !== previouslyControlled && previouslyControlled !== isControlled) console.error(`A component is changing the ${previouslyControlled ? '' : 'un'}controlled state of ${key.toString()} to be ${previouslyControlled ? 'un' : ''}controlled. Elements should not switch from uncontrolled to controlled (or vice versa).`);
433
397
  }
434
398
  }
435
399
  select(key, a1, a2, a3) {
@@ -467,4 +431,4 @@ class ReactStore extends Store {
467
431
  });
468
432
  }
469
433
  }
470
- export { ReactStore, Store, createAttribute, createSelector, fastComponent, fastComponentRef, useStore };
434
+ export { ReactStore, createAttribute, fastComponent, fastComponentRef };
package/dist/2387.js ADDED
@@ -0,0 +1,7 @@
1
+ function areArraysEqual(array1, array2, itemComparer = Object.is) {
2
+ const { length } = array1;
3
+ if (length !== array2.length) return false;
4
+ for(let i = 0; i < length; i += 1)if (!itemComparer(array1[i], array2[i])) return false;
5
+ return true;
6
+ }
7
+ export { areArraysEqual };
package/dist/2580.js ADDED
@@ -0,0 +1,6 @@
1
+ function stringifyLocale(locale) {
2
+ if (Array.isArray(locale)) return locale.map((value)=>stringifyLocale(value)).join(',');
3
+ if (null == locale) return '';
4
+ return String(locale);
5
+ }
6
+ export { stringifyLocale };
@@ -6,45 +6,21 @@ const ARROW_RIGHT = 'ArrowRight';
6
6
  const HOME = 'Home';
7
7
  const END = 'End';
8
8
  const PAGE_DOWN = 'PageDown';
9
- const HORIZONTAL_KEYS = new Set([
10
- ARROW_LEFT,
11
- ARROW_RIGHT
12
- ]);
13
- const HORIZONTAL_KEYS_WITH_EXTRA_KEYS = new Set([
14
- ARROW_LEFT,
15
- ARROW_RIGHT,
16
- HOME,
17
- END
18
- ]);
19
- const VERTICAL_KEYS = new Set([
20
- ARROW_UP,
21
- ARROW_DOWN
22
- ]);
23
- const VERTICAL_KEYS_WITH_EXTRA_KEYS = new Set([
9
+ const COMPOSITE_KEYS = new Set([
24
10
  ARROW_UP,
25
11
  ARROW_DOWN,
26
- HOME,
27
- END
28
- ]);
29
- const ARROW_KEYS = new Set([
30
- ...HORIZONTAL_KEYS,
31
- ...VERTICAL_KEYS
32
- ]);
33
- const COMPOSITE_KEYS = new Set([
34
- ...ARROW_KEYS,
12
+ ARROW_LEFT,
13
+ ARROW_RIGHT,
35
14
  HOME,
36
15
  END
37
16
  ]);
38
17
  const SHIFT = 'Shift';
39
- const CONTROL = 'Control';
40
- const ALT = 'Alt';
41
- const META = 'Meta';
42
- const MODIFIER_KEYS = new Set([
18
+ const MODIFIER_KEYS = [
43
19
  SHIFT,
44
- CONTROL,
45
- ALT,
46
- META
47
- ]);
20
+ 'Control',
21
+ 'Alt',
22
+ 'Meta'
23
+ ];
48
24
  function isInputElement(element) {
49
25
  return isHTMLElement(element) && 'INPUT' === element.tagName;
50
26
  }
@@ -68,7 +44,7 @@ function scrollIntoViewIfNeeded(scrollContainer, element, direction, orientation
68
44
  else if (elementOffsetLeft - elementStyles.scrollMarginLeft < scrollContainer.scrollLeft + containerStyles.scrollPaddingLeft) targetX = elementOffsetLeft - elementStyles.scrollMarginLeft - containerStyles.scrollPaddingLeft;
69
45
  }
70
46
  if ('rtl' === direction) {
71
- if (elementOffsetLeft - elementStyles.scrollMarginRight < scrollContainer.scrollLeft + containerStyles.scrollPaddingLeft) targetX = elementOffsetLeft - elementStyles.scrollMarginLeft - containerStyles.scrollPaddingLeft;
47
+ if (elementOffsetLeft - elementStyles.scrollMarginLeft < scrollContainer.scrollLeft + containerStyles.scrollPaddingLeft) targetX = elementOffsetLeft - elementStyles.scrollMarginLeft - containerStyles.scrollPaddingLeft;
72
48
  else if (elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight > scrollContainer.scrollLeft + scrollContainer.clientWidth - containerStyles.scrollPaddingRight) targetX = elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight - scrollContainer.clientWidth + containerStyles.scrollPaddingRight;
73
49
  }
74
50
  }
@@ -108,4 +84,4 @@ function getStyles(element) {
108
84
  scrollPaddingLeft: parseFloat(styles.scrollPaddingLeft) || 0
109
85
  };
110
86
  }
111
- export { ARROW_DOWN, ARROW_KEYS, ARROW_LEFT, ARROW_RIGHT, ARROW_UP, COMPOSITE_KEYS, HORIZONTAL_KEYS, HORIZONTAL_KEYS_WITH_EXTRA_KEYS, MODIFIER_KEYS, PAGE_DOWN, VERTICAL_KEYS, VERTICAL_KEYS_WITH_EXTRA_KEYS, isNativeInput, scrollIntoViewIfNeeded };
87
+ export { ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT, ARROW_UP, COMPOSITE_KEYS, MODIFIER_KEYS, PAGE_DOWN, isNativeInput, scrollIntoViewIfNeeded };
package/dist/3014.js ADDED
@@ -0,0 +1,178 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useStableCallback } from "./7488.js";
3
+ import { useRefWithInit } from "./9591.js";
4
+ import { useIsoLayoutEffect } from "./3357.js";
5
+ import { CompositeListContext } from "./5275.js";
6
+ import * as __rspack_external_react from "react";
7
+ function CompositeList(props) {
8
+ const { children, elementsRef, labelsRef, onMapChange: onMapChangeProp } = props;
9
+ const onMapChange = useStableCallback(onMapChangeProp);
10
+ const [, setMapTick] = __rspack_external_react.useState(0);
11
+ const listeners = useRefWithInit(createListeners).current;
12
+ const map = useRefWithInit(createMap).current;
13
+ const nextIndexRef = __rspack_external_react.useRef(0);
14
+ const isDirtyRef = __rspack_external_react.useRef(true);
15
+ const itemsRef = __rspack_external_react.useRef(null);
16
+ const mutationObserverRef = __rspack_external_react.useRef(null);
17
+ const scheduleMapUpdate = useStableCallback(()=>{
18
+ if (isDirtyRef.current) return;
19
+ isDirtyRef.current = true;
20
+ setMapTick((tick)=>tick + 1);
21
+ });
22
+ const register = useStableCallback((node, registration)=>{
23
+ map.set(node, registration);
24
+ scheduleMapUpdate();
25
+ });
26
+ const unregister = useStableCallback((node)=>{
27
+ map.delete(node);
28
+ scheduleMapUpdate();
29
+ });
30
+ const syncRefs = useStableCallback((items)=>{
31
+ const nextMap = new Map();
32
+ elementsRef.current.length = 0;
33
+ if (labelsRef) labelsRef.current.length = 0;
34
+ items.forEach((item)=>{
35
+ nextMap.set(item.element, {
36
+ ...item.registration.metadata ?? {},
37
+ index: item.index
38
+ });
39
+ elementsRef.current[item.index] = item.element;
40
+ if (labelsRef) labelsRef.current[item.index] = void 0 !== item.registration.label ? item.registration.label : item.registration.textRef?.current?.textContent ?? item.element.textContent;
41
+ });
42
+ nextIndexRef.current = elementsRef.current.length;
43
+ return nextMap;
44
+ });
45
+ function observe(sortedNodes) {
46
+ mutationObserverRef.current?.disconnect();
47
+ mutationObserverRef.current = null;
48
+ if ('function' != typeof MutationObserver || sortedNodes.length < 2) return;
49
+ const mutationObserver = new MutationObserver((entries)=>{
50
+ if (!hasMovedNode(entries)) return;
51
+ let previousConnectedNode = null;
52
+ for (const node of sortedNodes)if (node.isConnected) {
53
+ if (previousConnectedNode && sortByDocumentPosition(previousConnectedNode, node) > 0) {
54
+ mutationObserver.disconnect();
55
+ scheduleMapUpdate();
56
+ return;
57
+ }
58
+ previousConnectedNode = node;
59
+ }
60
+ });
61
+ mutationObserverRef.current = mutationObserver;
62
+ const roots = new Set();
63
+ for(let i = 1; i < sortedNodes.length; i += 1){
64
+ const root = getCommonAncestor(sortedNodes[i - 1], sortedNodes[i]);
65
+ if (root) roots.add(root);
66
+ }
67
+ roots.forEach((root)=>mutationObserver.observe(root, {
68
+ childList: true
69
+ }));
70
+ }
71
+ const flush = useStableCallback(()=>{
72
+ const [items, automaticNodes] = getCompositeListSnapshot(map);
73
+ const nextMap = syncRefs(items);
74
+ const previousItems = itemsRef.current;
75
+ const changed = !previousItems || previousItems.length !== items.length || items.some((item, index)=>{
76
+ const previousItem = previousItems[index];
77
+ return item.index !== previousItem.index || item.element !== previousItem.element || item.registration.index !== previousItem.registration.index || item.registration.metadata !== previousItem.registration.metadata;
78
+ });
79
+ observe(automaticNodes);
80
+ itemsRef.current = items;
81
+ isDirtyRef.current = false;
82
+ if (!changed) return;
83
+ listeners.forEach((listener)=>listener(nextMap));
84
+ onMapChange(nextMap);
85
+ });
86
+ useIsoLayoutEffect(()=>{
87
+ if (!isDirtyRef.current && itemsRef.current) syncRefs(itemsRef.current);
88
+ return ()=>{
89
+ elementsRef.current = [];
90
+ if (labelsRef) labelsRef.current = [];
91
+ };
92
+ }, [
93
+ elementsRef,
94
+ labelsRef,
95
+ syncRefs
96
+ ]);
97
+ useIsoLayoutEffect(()=>{
98
+ if (isDirtyRef.current) flush();
99
+ });
100
+ useIsoLayoutEffect(()=>()=>{
101
+ mutationObserverRef.current?.disconnect();
102
+ isDirtyRef.current = true;
103
+ }, []);
104
+ const subscribeMapChange = useStableCallback((fn)=>{
105
+ listeners.add(fn);
106
+ return ()=>{
107
+ listeners.delete(fn);
108
+ };
109
+ });
110
+ const contextValue = __rspack_external_react.useMemo(()=>({
111
+ register,
112
+ unregister,
113
+ subscribeMapChange,
114
+ nextIndexRef
115
+ }), [
116
+ register,
117
+ unregister,
118
+ subscribeMapChange,
119
+ nextIndexRef
120
+ ]);
121
+ return /*#__PURE__*/ jsx(CompositeListContext.Provider, {
122
+ value: contextValue,
123
+ children: children
124
+ });
125
+ }
126
+ function createMap() {
127
+ return new Map();
128
+ }
129
+ function createListeners() {
130
+ return new Set();
131
+ }
132
+ function getCompositeListSnapshot(map) {
133
+ const reservedIndices = new Set();
134
+ const items = [];
135
+ const automaticItems = [];
136
+ map.forEach((registration, node)=>{
137
+ if (!node.isConnected) return;
138
+ const index = registration.index;
139
+ const item = {
140
+ index: index ?? -1,
141
+ element: node,
142
+ registration
143
+ };
144
+ if (null === index) automaticItems.push(item);
145
+ else if (index >= 0) {
146
+ reservedIndices.add(index);
147
+ items.push(item);
148
+ }
149
+ });
150
+ let nextAutomaticIndex = 0;
151
+ automaticItems.sort((a, b)=>sortByDocumentPosition(a.element, b.element));
152
+ automaticItems.forEach((item)=>{
153
+ while(reservedIndices.has(nextAutomaticIndex))nextAutomaticIndex += 1;
154
+ item.index = nextAutomaticIndex;
155
+ items.push(item);
156
+ nextAutomaticIndex += 1;
157
+ });
158
+ if (reservedIndices.size > 0) items.sort((a, b)=>a.index - b.index);
159
+ return [
160
+ items,
161
+ automaticItems.map((item)=>item.element)
162
+ ];
163
+ }
164
+ function getCommonAncestor(firstNode, lastNode) {
165
+ let ancestor = firstNode.parentElement;
166
+ while(ancestor && !ancestor.contains(lastNode))ancestor = ancestor.parentElement;
167
+ return ancestor;
168
+ }
169
+ function hasMovedNode(entries) {
170
+ for (const entry of entries)for(let i = 0; i < entry.removedNodes.length; i += 1)if (entry.removedNodes[i].isConnected) return true;
171
+ return false;
172
+ }
173
+ function sortByDocumentPosition(a, b) {
174
+ if (a.nextElementSibling === b) return -1;
175
+ if (b.nextElementSibling === a) return 1;
176
+ return a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1;
177
+ }
178
+ export { CompositeList };
@@ -1,6 +1,6 @@
1
- import { useIsoLayoutEffect } from "./6499.js";
2
- import { ownerDocument } from "./9829.js";
3
- import { useScrollLock } from "./3485.js";
1
+ import { useIsoLayoutEffect } from "./3357.js";
2
+ import { ownerDocument } from "./6488.js";
3
+ import { useScrollLock } from "./7323.js";
4
4
  import * as __rspack_external_react from "react";
5
5
  const VIEWPORT_WIDTH_TOLERANCE_PX = 20;
6
6
  function useAnchoredPopupScrollLock(enabled, touchOpen, positionerElement, referenceElement) {
@@ -1,5 +1,5 @@
1
1
  import { getComputedStyle, isHTMLElement } from "./3829.js";
2
- import { round } from "./3319.js";
2
+ import { round } from "./8358.js";
3
3
  function getCssDimensions(element) {
4
4
  const css = getComputedStyle(element);
5
5
  let width = parseFloat(css.width) || 0;
package/dist/3189.js ADDED
@@ -0,0 +1,5 @@
1
+ import { lowerUserAgent } from "./70.js";
2
+ const webkit = "u" > typeof CSS && !!CSS.supports?.('-webkit-backdrop-filter:none');
3
+ const gecko = !webkit && lowerUserAgent.includes('firefox');
4
+ webkit || lowerUserAgent.includes('chrom');
5
+ export { gecko, webkit };
@@ -1,10 +1,10 @@
1
- import { esm_formatErrorMessage } from "./8272.js";
1
+ import { utils_formatErrorMessage } from "./5473.js";
2
2
  import * as __rspack_external_react from "react";
3
3
  const MenubarContext = /*#__PURE__*/ __rspack_external_react.createContext(null);
4
4
  if ("production" !== process.env.NODE_ENV) MenubarContext.displayName = "MenubarContext";
5
5
  function useMenubarContext(optional) {
6
6
  const context = __rspack_external_react.useContext(MenubarContext);
7
- if (null === context && !optional) throw new Error("production" !== process.env.NODE_ENV ? 'Base UI: MenubarContext is missing. Menubar parts must be placed within <Menubar>.' : esm_formatErrorMessage(5));
7
+ if (null === context && !optional) throw new Error("production" !== process.env.NODE_ENV ? 'Base UI: MenubarContext is missing. Menubar parts must be placed within <Menubar>.' : utils_formatErrorMessage(5));
8
8
  return context;
9
9
  }
10
10
  export { MenubarContext, useMenubarContext };
package/dist/3357.js ADDED
@@ -0,0 +1,7 @@
1
+ import * as __rspack_external_react from "react";
2
+ const SafeReact = {
3
+ ...__rspack_external_react
4
+ };
5
+ const noop = ()=>{};
6
+ const useIsoLayoutEffect = "u" > typeof document ? __rspack_external_react.useLayoutEffect : noop;
7
+ export { SafeReact, useIsoLayoutEffect };