@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,5 +1,5 @@
1
- import { useRefWithInit } from "./8272.js";
2
- import { useOnMount } from "./2861.js";
1
+ import { useRefWithInit } from "./9591.js";
2
+ import { useOnMount } from "./9120.js";
3
3
  const EMPTY = null;
4
4
  let LAST_RAF = globalThis.requestAnimationFrame;
5
5
  class Scheduler {
@@ -32,11 +32,12 @@ class Scheduler {
32
32
  cancel(id) {
33
33
  const index = id - this.startId;
34
34
  if (index < 0 || index >= this.callbacks.length) return;
35
+ if (null === this.callbacks[index]) return;
35
36
  this.callbacks[index] = null;
36
37
  this.callbacksCount -= 1;
37
38
  }
38
39
  }
39
- const scheduler = new Scheduler();
40
+ let scheduler = new Scheduler();
40
41
  class AnimationFrame {
41
42
  static create() {
42
43
  return new AnimationFrame();
package/dist/5890.js ADDED
@@ -0,0 +1,25 @@
1
+ import { useFieldRootContext } from "./201.js";
2
+ import { useStableCallback } from "./7488.js";
3
+ import { useIsoLayoutEffect } from "./3357.js";
4
+ function useSetFieldFocused(disabled, focusTargetRef, onFocusedChange) {
5
+ const { setFocused, focusOwnerRef } = useFieldRootContext();
6
+ const setFieldFocused = useStableCallback((focused)=>{
7
+ if (focused ? !disabled : focusOwnerRef.current === setFieldFocused) {
8
+ focusOwnerRef.current = focused && setFieldFocused;
9
+ onFocusedChange?.(focused);
10
+ setFocused(focused);
11
+ }
12
+ });
13
+ useIsoLayoutEffect(()=>{
14
+ const el = focusTargetRef.current;
15
+ const root = el?.getRootNode();
16
+ if (root?.activeElement === el) setFieldFocused(true);
17
+ return ()=>setFieldFocused(false);
18
+ }, [
19
+ disabled,
20
+ focusTargetRef,
21
+ setFieldFocused
22
+ ]);
23
+ return setFieldFocused;
24
+ }
25
+ export { useSetFieldFocused };
@@ -1,4 +1,4 @@
1
- import { useId } from "./2205.js";
1
+ import { useId } from "./4989.js";
2
2
  function useBaseUiId(idOverride) {
3
3
  return useId(idOverride, 'base-ui');
4
4
  }
package/dist/5984.js ADDED
@@ -0,0 +1,38 @@
1
+ import { __webpack_require__ } from "./rslib-runtime.js";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import "./4586.js";
4
+ import { isReactVersionAtLeast } from "./9591.js";
5
+ import { useCSPContext } from "./1234.js";
6
+ import * as __rspack_external_react from "react";
7
+ const use_sync_external_store = __webpack_require__("../../node_modules/use-sync-external-store/index.js");
8
+ const emptySubscribe = ()=>()=>{};
9
+ const getTrue = ()=>true;
10
+ const getFalse = ()=>false;
11
+ function useIsHydratedModern() {
12
+ return (0, use_sync_external_store.useSyncExternalStore)(emptySubscribe, getTrue, getFalse);
13
+ }
14
+ function useIsHydratedLegacy() {
15
+ const [hydrated, setHydrated] = __rspack_external_react.useState(false);
16
+ __rspack_external_react.useEffect(()=>{
17
+ setHydrated(true);
18
+ }, []);
19
+ return hydrated;
20
+ }
21
+ const useIsHydrated = isReactVersionAtLeast(18) ? useIsHydratedModern : useIsHydratedLegacy;
22
+ function useIsHydrating() {
23
+ return !useIsHydrated();
24
+ }
25
+ function PrehydrationScript(props) {
26
+ const { script } = props;
27
+ const { nonce } = useCSPContext();
28
+ const isHydrating = useIsHydrating();
29
+ if (!isHydrating) return null;
30
+ return /*#__PURE__*/ jsx("script", {
31
+ nonce: nonce,
32
+ dangerouslySetInnerHTML: {
33
+ __html: script
34
+ },
35
+ suppressHydrationWarning: true
36
+ });
37
+ }
38
+ export { PrehydrationScript, useIsHydrating };
@@ -1,9 +1,9 @@
1
- import { error } from "./4026.js";
1
+ import { error } from "./4293.js";
2
2
  import * as __rspack_external_react from "react";
3
3
  function useControlled({ controlled, default: defaultProp, name, state = 'value' }) {
4
4
  const { current: isControlled } = __rspack_external_react.useRef(void 0 !== controlled);
5
- const [valueState, setValue] = __rspack_external_react.useState(defaultProp);
6
- const value = isControlled ? controlled : valueState;
5
+ const [valueState, setValue] = __rspack_external_react.useState(()=>defaultProp);
6
+ const value = isControlled && void 0 !== controlled ? controlled : valueState;
7
7
  if ('production' !== process.env.NODE_ENV) {
8
8
  __rspack_external_react.useEffect(()=>{
9
9
  if (isControlled !== (void 0 !== controlled)) error([
package/dist/6040.js ADDED
@@ -0,0 +1,97 @@
1
+ import { __webpack_require__ } from "./rslib-runtime.js";
2
+ import "./4586.js";
3
+ import { NOOP } from "./9591.js";
4
+ import { AnimationFrame } from "./5595.js";
5
+ import { utils_formatErrorMessage } from "./5473.js";
6
+ import { createChangeEventDetails } from "./8495.js";
7
+ import { imperativeAction } from "./9837.js";
8
+ import * as __rspack_external_react from "react";
9
+ const use_sync_external_store = __webpack_require__("../../node_modules/use-sync-external-store/index.js");
10
+ function usePopupHandleStore(handle) {
11
+ const subscribe = __rspack_external_react.useCallback((listener)=>{
12
+ if (void 0 === handle) return NOOP;
13
+ return handle.subscribeStore(listener);
14
+ }, [
15
+ handle
16
+ ]);
17
+ const getSnapshot = __rspack_external_react.useCallback(()=>void 0 === handle ? void 0 : handle.store, [
18
+ handle
19
+ ]);
20
+ return (0, use_sync_external_store.useSyncExternalStore)(subscribe, getSnapshot, ()=>handle?.serverStore);
21
+ }
22
+ class BasePopupHandle {
23
+ attachedStores = [];
24
+ attachedStoreValue = null;
25
+ storeListeners = new Set();
26
+ constructor(fallbackStore, componentName, throwOnMissingTrigger = true){
27
+ this.fallbackStore = fallbackStore;
28
+ this.componentName = componentName;
29
+ this.throwOnMissingTrigger = throwOnMissingTrigger;
30
+ }
31
+ get attachedStore() {
32
+ return this.attachedStoreValue;
33
+ }
34
+ get store() {
35
+ return this.attachedStoreValue ?? this.fallbackStore;
36
+ }
37
+ get serverStore() {
38
+ return this.fallbackStore;
39
+ }
40
+ subscribeStore(listener) {
41
+ this.storeListeners.add(listener);
42
+ return ()=>{
43
+ this.storeListeners.delete(listener);
44
+ };
45
+ }
46
+ attachStore(newStore) {
47
+ this.attachedStores.push(newStore);
48
+ this.setActiveStore(newStore);
49
+ if ('production' !== process.env.NODE_ENV) {
50
+ if (this.attachedStores.length > 1) {
51
+ const dev = this;
52
+ (dev.overlapWarningFrame ??= AnimationFrame.create()).request(()=>{
53
+ if (this.attachedStores.length > 1) console.warn("Base UI: A handle is attached to more than one mounted root at the same time. The most recently mounted root takes over and the previous one stops being controlled by the handle. A handle should be used by a single root that stays mounted for the lifetime of the handle.");
54
+ });
55
+ }
56
+ }
57
+ return ()=>{
58
+ const index = this.attachedStores.lastIndexOf(newStore);
59
+ if (-1 !== index) this.attachedStores.splice(index, 1);
60
+ this.setActiveStore(this.attachedStores[this.attachedStores.length - 1] ?? null);
61
+ };
62
+ }
63
+ setActiveStore(store) {
64
+ if (this.attachedStoreValue !== store) {
65
+ this.attachedStoreValue = store;
66
+ this.storeListeners.forEach((listener)=>{
67
+ listener();
68
+ });
69
+ }
70
+ }
71
+ openByTrigger(triggerId) {
72
+ const attachedStore = this.attachedStore;
73
+ if (null === attachedStore) {
74
+ if ('production' !== process.env.NODE_ENV) console.warn(`Base UI: ${this.componentName}Handle.open() was called while no root using this handle is mounted. The call was ignored; mount a root with this handle before opening it imperatively.`);
75
+ return;
76
+ }
77
+ let triggerElement;
78
+ if (triggerId) {
79
+ for(let i = this.attachedStores.length - 1; i >= 0 && !triggerElement; i -= 1)triggerElement = this.attachedStores[i].context.triggerElements.getById(triggerId);
80
+ triggerElement ??= this.fallbackStore.context.triggerElements.getById(triggerId);
81
+ }
82
+ if (triggerId && !triggerElement) {
83
+ if (this.throwOnMissingTrigger) throw new Error("production" !== process.env.NODE_ENV ? `Base UI: ${this.componentName}Handle.open() was called with the trigger id "${triggerId}", but no matching trigger is registered with this handle. An anchored popup cannot open without a trigger to anchor to. Pass the id of a mounted ${this.componentName}.Trigger that has this handle set on its "handle" prop.` : utils_formatErrorMessage(99, this.componentName, triggerId, this.componentName));
84
+ if ('production' !== process.env.NODE_ENV) console.warn(`Base UI: ${this.componentName}Handle.open: No trigger found with id "${triggerId}". The popup will open, but the trigger will not be associated with it.`);
85
+ }
86
+ attachedStore.setOpen(true, createChangeEventDetails(imperativeAction, void 0, triggerElement));
87
+ }
88
+ closePopup() {
89
+ const attachedStore = this.attachedStore;
90
+ if (null === attachedStore) {
91
+ if ('production' !== process.env.NODE_ENV) console.warn(`Base UI: ${this.componentName}Handle.close() was called while no root using this handle is mounted. The call was ignored.`);
92
+ return;
93
+ }
94
+ attachedStore.setOpen(false, createChangeEventDetails(imperativeAction));
95
+ }
96
+ }
97
+ export { BasePopupHandle, usePopupHandleStore };
@@ -1,12 +1,14 @@
1
1
  import { isElement, isHTMLElement } from "./3829.js";
2
- import { contains } from "./4549.js";
3
- import { TYPEABLE_SELECTOR, FOCUSABLE_ATTRIBUTE } from "./4745.js";
4
- import { isJSDOM } from "./8971.js";
2
+ import { closest, contains } from "./4155.js";
3
+ import { TYPEABLE_SELECTOR, FOCUSABLE_ATTRIBUTE, jsdom } from "./5490.js";
4
+ const popupOpen = 'data-popup-open';
5
+ const pressed = 'data-pressed';
6
+ const triggerDisabled = 'data-trigger-disabled';
5
7
  function isTargetInsideEnabledTrigger(target, triggerElements) {
6
8
  if (!isElement(target)) return false;
7
9
  const targetElement = target;
8
- if (triggerElements.hasElement(targetElement)) return !targetElement.hasAttribute('data-trigger-disabled');
9
- for (const [, trigger] of triggerElements.entries())if (contains(trigger, targetElement)) return !trigger.hasAttribute('data-trigger-disabled');
10
+ if (triggerElements.hasElement(targetElement)) return !targetElement.hasAttribute(triggerDisabled);
11
+ for (const [, trigger] of triggerElements.entries())if (contains(trigger, targetElement)) return !trigger.hasAttribute(triggerDisabled);
10
12
  return false;
11
13
  }
12
14
  function isEventTargetWithin(event, node) {
@@ -22,14 +24,14 @@ function isTypeableElement(element) {
22
24
  return isHTMLElement(element) && element.matches(TYPEABLE_SELECTOR);
23
25
  }
24
26
  function isInteractiveElement(element) {
25
- return element?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${TYPEABLE_SELECTOR}`) != null;
27
+ return null != closest(element, `button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${TYPEABLE_SELECTOR}`);
26
28
  }
27
29
  function isTypeableCombobox(element) {
28
30
  if (!element) return false;
29
31
  return 'combobox' === element.getAttribute('role') && isTypeableElement(element);
30
32
  }
31
33
  function matchesFocusVisible(element) {
32
- if (!element || isJSDOM) return true;
34
+ if (!element || jsdom) return true;
33
35
  try {
34
36
  return element.matches(':focus-visible');
35
37
  } catch (_e) {
@@ -40,4 +42,4 @@ function getFloatingFocusElement(floatingElement) {
40
42
  if (!floatingElement) return null;
41
43
  return floatingElement.hasAttribute(FOCUSABLE_ATTRIBUTE) ? floatingElement : floatingElement.querySelector(`[${FOCUSABLE_ATTRIBUTE}]`) || floatingElement;
42
44
  }
43
- export { getFloatingFocusElement, isEventTargetWithin, isInteractiveElement, isRootElement, isTargetInsideEnabledTrigger, isTypeableCombobox, isTypeableElement, matchesFocusVisible };
45
+ export { getFloatingFocusElement, isEventTargetWithin, isInteractiveElement, isRootElement, isTargetInsideEnabledTrigger, isTypeableCombobox, isTypeableElement, matchesFocusVisible, popupOpen, pressed, triggerDisabled };
@@ -1,30 +1,38 @@
1
- import { useFieldRootContext } from "./1477.js";
2
- import { useIsoLayoutEffect } from "./6499.js";
3
- import * as __rspack_external_react from "react";
4
- function useRegisterFieldControl(controlRef, id, value, getFormValueOverride, enabled = true) {
1
+ import { useFieldRootContext } from "./201.js";
2
+ import { useRefWithInit } from "./9591.js";
3
+ import { useIsoLayoutEffect } from "./3357.js";
4
+ function useRegisterFieldControl(controlRef, id, value, getFormValueOverride, enabled = true, name) {
5
5
  const { registerFieldControl } = useFieldRootContext();
6
- const sourceRef = __rspack_external_react.useRef(null);
7
- if (!sourceRef.current) sourceRef.current = Symbol();
6
+ const sourceRef = useRefWithInit(()=>Symbol());
8
7
  useIsoLayoutEffect(()=>{
9
8
  const source = sourceRef.current;
10
- if (!source || !enabled) return;
9
+ if (!enabled) return void registerFieldControl(source, void 0);
11
10
  const registration = {
12
11
  controlRef,
13
12
  getValue: getFormValueOverride,
14
13
  id,
14
+ name,
15
15
  value
16
16
  };
17
17
  registerFieldControl(source, registration);
18
- return ()=>{
19
- registerFieldControl(source, void 0);
20
- };
21
18
  }, [
22
19
  controlRef,
23
20
  enabled,
24
21
  getFormValueOverride,
25
22
  id,
23
+ name,
26
24
  registerFieldControl,
25
+ sourceRef,
27
26
  value
28
27
  ]);
28
+ useIsoLayoutEffect(()=>{
29
+ const source = sourceRef.current;
30
+ return ()=>{
31
+ registerFieldControl(source, void 0);
32
+ };
33
+ }, [
34
+ registerFieldControl,
35
+ sourceRef
36
+ ]);
29
37
  }
30
38
  export { useRegisterFieldControl };
@@ -1,10 +1,10 @@
1
1
  import { jsxs } from "react/jsx-runtime";
2
- import { useFloatingPortalNode } from "./487.js";
2
+ import { useFloatingPortalNode } from "./3398.js";
3
3
  import * as __rspack_external_react from "react";
4
4
  import * as __rspack_external_react_dom_7136dc57 from "react-dom";
5
5
  const FloatingPortalLite_FloatingPortalLite = /*#__PURE__*/ __rspack_external_react.forwardRef(function(componentProps, forwardedRef) {
6
6
  const { children, container, className, render, style, ...elementProps } = componentProps;
7
- const { portalNode, portalSubtree } = useFloatingPortalNode({
7
+ const { node: portalNode, subtree: portalSubtree } = useFloatingPortalNode({
8
8
  container,
9
9
  ref: forwardedRef,
10
10
  componentProps,
package/dist/6240.js ADDED
@@ -0,0 +1,121 @@
1
+ import { useLabelableContext, useFieldRootContext, fieldValidityMapping } from "./201.js";
2
+ import { useFormContext } from "./9880.js";
3
+ import { useLabelableId } from "./6551.js";
4
+ import { useStableCallback } from "./7488.js";
5
+ import { useRegisterFieldControl } from "./6140.js";
6
+ import { useIsoLayoutEffect } from "./3357.js";
7
+ import { useValueChanged } from "./9252.js";
8
+ import { useSetFieldFocused } from "./5890.js";
9
+ import { useTimeout } from "./9197.js";
10
+ import { useRenderElement } from "./9591.js";
11
+ import { createChangeEventDetails } from "./8495.js";
12
+ import * as __rspack_external_react from "react";
13
+ const FieldControl_FieldControl = /*#__PURE__*/ __rspack_external_react.forwardRef(function(componentProps, forwardedRef) {
14
+ const { render, className, id: idProp, name: nameProp, value, disabled: disabledProp = false, onValueChange, defaultValue, autoFocus = false, style, ...elementProps } = componentProps;
15
+ const { state: fieldState, name: fieldName, disabled: fieldDisabled, setTouched, setDirty, validityData, setFilled, validationMode, validation } = useFieldRootContext();
16
+ const { clearErrors, elementRef: formElementRef, submitCountRef } = useFormContext();
17
+ const disabled = fieldDisabled || disabledProp;
18
+ const name = fieldName ?? nameProp;
19
+ const state = {
20
+ ...fieldState,
21
+ disabled
22
+ };
23
+ const { labelId } = useLabelableContext();
24
+ const id = useLabelableId({
25
+ id: idProp
26
+ });
27
+ const isControlled = void 0 !== value;
28
+ const serializedValue = null == value ? void 0 : String(value);
29
+ const getValueFromInput = useStableCallback(()=>validation.inputRef.current?.value);
30
+ useRegisterFieldControl(validation.inputRef, id, serializedValue, getValueFromInput, !disabled, nameProp);
31
+ useIsoLayoutEffect(()=>{
32
+ const currentValue = serializedValue ?? validation.inputRef.current?.value;
33
+ if (void 0 !== currentValue) setFilled('' !== currentValue);
34
+ }, [
35
+ serializedValue,
36
+ defaultValue,
37
+ validation.inputRef,
38
+ setFilled
39
+ ]);
40
+ useValueChanged(serializedValue, ()=>{
41
+ if (void 0 === serializedValue) return;
42
+ clearErrors(name);
43
+ setDirty(serializedValue !== (validityData.initialValue ?? ''));
44
+ validation.change(serializedValue);
45
+ });
46
+ const inputRef = __rspack_external_react.useRef(null);
47
+ const setFocused = useSetFieldFocused(disabled, inputRef);
48
+ const enterValidationTimeout = useTimeout();
49
+ const element = useRenderElement('input', componentProps, {
50
+ ref: [
51
+ forwardedRef,
52
+ inputRef
53
+ ],
54
+ state,
55
+ props: [
56
+ {
57
+ id,
58
+ disabled,
59
+ name,
60
+ ref: validation.inputRef,
61
+ 'aria-labelledby': labelId,
62
+ autoFocus,
63
+ ...isControlled ? {
64
+ value
65
+ } : {
66
+ defaultValue
67
+ },
68
+ onChange (event) {
69
+ const inputValue = event.currentTarget.value;
70
+ const details = createChangeEventDetails("none", event.nativeEvent);
71
+ onValueChange?.(inputValue, details);
72
+ if (isControlled) return;
73
+ setDirty(inputValue !== (validityData.initialValue ?? ''));
74
+ setFilled('' !== inputValue);
75
+ if (!event.nativeEvent.defaultPrevented && !details.isCanceled) {
76
+ clearErrors(name);
77
+ validation.change(inputValue);
78
+ }
79
+ },
80
+ onFocus () {
81
+ setFocused(true);
82
+ },
83
+ onBlur (event) {
84
+ setTouched(true);
85
+ setFocused(false);
86
+ if ('onBlur' === validationMode) {
87
+ const inputValue = event.currentTarget.value;
88
+ validation.commit(inputValue);
89
+ if (isControlled) queueMicrotask(()=>{
90
+ const nextValue = validation.inputRef.current?.value;
91
+ if (void 0 !== nextValue && nextValue !== inputValue && nextValue !== (validityData.initialValue ?? '')) validation.commit(nextValue);
92
+ });
93
+ }
94
+ },
95
+ onKeyDown (event) {
96
+ if ('INPUT' === event.currentTarget.tagName && 'Enter' === event.key) {
97
+ setTouched(true);
98
+ const value = event.currentTarget.value;
99
+ const form = event.currentTarget.form;
100
+ if (form && form === formElementRef.current && !event.defaultPrevented) {
101
+ const input = event.currentTarget;
102
+ const submitCount = submitCountRef.current;
103
+ enterValidationTimeout.start(0, ()=>{
104
+ if (submitCountRef.current === submitCount) validation.commit(input.value);
105
+ });
106
+ } else validation.commit(value);
107
+ }
108
+ }
109
+ },
110
+ elementProps,
111
+ (props)=>validation.getValidationProps(disabled, props)
112
+ ],
113
+ stateAttributesMapping: fieldValidityMapping
114
+ });
115
+ return element;
116
+ });
117
+ if ("production" !== process.env.NODE_ENV) FieldControl_FieldControl.displayName = "FieldControl";
118
+ const Input_module = {
119
+ root: "root-Y7wYn3"
120
+ };
121
+ export { FieldControl_FieldControl, Input_module };
@@ -1,12 +1,14 @@
1
- import { useBaseUiId } from "./6046.js";
2
- import { useIsoLayoutEffect } from "./6499.js";
1
+ import { useBaseUiId } from "./5969.js";
2
+ import { useIsoLayoutEffect } from "./3357.js";
3
3
  import * as __rspack_external_react from "react";
4
- function useAriaLabelledBy(explicitAriaLabelledBy, labelId, labelSourceRef, enableFallback = true, labelSourceId) {
4
+ function useAriaLabelledBy(explicitAriaLabelledBy, labelId, labelSourceRef, enableFallback = true, labelSourceId, ariaLabel) {
5
5
  const [fallbackAriaLabelledBy, setFallbackAriaLabelledBy] = __rspack_external_react.useState();
6
6
  const generatedLabelId = useBaseUiId(labelSourceId ? `${labelSourceId}-label` : void 0);
7
- const ariaLabelledBy = explicitAriaLabelledBy ?? labelId ?? fallbackAriaLabelledBy;
7
+ const hasAriaLabel = Boolean(ariaLabel?.trim());
8
+ const implicitLabelId = hasAriaLabel ? void 0 : labelId;
9
+ const ariaLabelledBy = explicitAriaLabelledBy ?? implicitLabelId ?? fallbackAriaLabelledBy;
8
10
  useIsoLayoutEffect(()=>{
9
- const nextAriaLabelledBy = explicitAriaLabelledBy || labelId || !enableFallback ? void 0 : getAriaLabelledBy(labelSourceRef.current, generatedLabelId);
11
+ const nextAriaLabelledBy = explicitAriaLabelledBy || labelId || hasAriaLabel || !enableFallback ? void 0 : getAriaLabelledBy(labelSourceRef.current, generatedLabelId);
10
12
  if (fallbackAriaLabelledBy !== nextAriaLabelledBy) setFallbackAriaLabelledBy(nextAriaLabelledBy);
11
13
  });
12
14
  return ariaLabelledBy;
@@ -1,19 +1,19 @@
1
- import { isMac, isSafari } from "./8971.js";
2
- import { useTimeout } from "./42.js";
1
+ import { mac } from "./2221.js";
2
+ import { webkit } from "./3189.js";
3
+ import { useTimeout } from "./9197.js";
3
4
  import { getWindow, isHTMLElement, isElement } from "./3829.js";
4
- import { getTarget, contains, activeElement } from "./4549.js";
5
- import { ownerDocument } from "./9829.js";
6
- import { mergeCleanups } from "./4495.js";
7
- import { addEventListener } from "./4723.js";
8
- import { triggerPress, triggerFocus, escapeKey } from "./2418.js";
9
- import { matchesFocusVisible, isTypeableElement, isTargetInsideEnabledTrigger } from "./8758.js";
10
- import { createChangeEventDetails } from "./4768.js";
11
- import { createAttribute } from "./2445.js";
5
+ import { getTarget, contains, activeElement } from "./4155.js";
6
+ import { ownerDocument } from "./6488.js";
7
+ import { mergeCleanups } from "./7718.js";
8
+ import { addEventListener } from "./1282.js";
9
+ import { triggerPress, triggerFocus, escapeKey } from "./9837.js";
10
+ import { matchesFocusVisible, isTypeableElement, isTargetInsideEnabledTrigger } from "./6137.js";
11
+ import { createChangeEventDetails } from "./8495.js";
12
+ import { createAttribute } from "./226.js";
12
13
  import * as __rspack_external_react from "react";
13
- const isMacSafari = isMac && isSafari;
14
- function useFocus(context, props = {}) {
14
+ const isMacSafari = mac && webkit;
15
+ function useFocus(store, props = {}) {
15
16
  const { enabled = true, delay } = props;
16
- const store = 'rootStore' in context ? context.rootStore : context;
17
17
  const { events, dataRef } = store.context;
18
18
  const blockFocusRef = __rspack_external_react.useRef(false);
19
19
  const blockedReferenceRef = __rspack_external_react.useRef(null);
@@ -25,7 +25,10 @@ function useFocus(context, props = {}) {
25
25
  const win = getWindow(domReference);
26
26
  function onBlur() {
27
27
  const currentDomReference = store.select('domReferenceElement');
28
- if (!store.select('open') && isHTMLElement(currentDomReference) && currentDomReference === activeElement(ownerDocument(currentDomReference))) blockFocusRef.current = true;
28
+ if (!store.select('open') && isHTMLElement(currentDomReference) && currentDomReference === activeElement(ownerDocument(currentDomReference))) {
29
+ blockFocusRef.current = true;
30
+ blockedReferenceRef.current = currentDomReference;
31
+ }
29
32
  }
30
33
  function onKeyDown() {
31
34
  keyboardModalityRef.current = true;
@@ -81,9 +84,8 @@ function useFocus(context, props = {}) {
81
84
  }
82
85
  const movedFromOtherEnabledTrigger = isTargetInsideEnabledTrigger(event.relatedTarget, store.context.triggerElements);
83
86
  const { nativeEvent, currentTarget } = event;
84
- const delayValue = 'function' == typeof delay ? delay() : delay;
85
- if (store.select('open') && movedFromOtherEnabledTrigger || 0 === delayValue || void 0 === delayValue) return void store.setOpen(true, createChangeEventDetails(triggerFocus, nativeEvent, currentTarget));
86
- timeout.start(delayValue, ()=>{
87
+ if (store.select('open') && movedFromOtherEnabledTrigger || !delay) return void store.setOpen(true, createChangeEventDetails(triggerFocus, nativeEvent, currentTarget));
88
+ timeout.start(delay, ()=>{
87
89
  if (blockFocusRef.current) return;
88
90
  store.setOpen(true, createChangeEventDetails(triggerFocus, nativeEvent, currentTarget));
89
91
  });
@@ -1,4 +1,4 @@
1
- import { useRenderElement } from "./8272.js";
1
+ import { useRenderElement } from "./9591.js";
2
2
  import * as __rspack_external_react from "react";
3
3
  const Separator = /*#__PURE__*/ __rspack_external_react.forwardRef(function(componentProps, forwardedRef) {
4
4
  const { className, render, orientation = 'horizontal', style, ...elementProps } = componentProps;
package/dist/6499.js CHANGED
@@ -1,7 +1,4 @@
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 };
1
+ function isElementDisabled(element) {
2
+ return null == element || element.hasAttribute('disabled') || 'true' === element.getAttribute('aria-disabled');
3
+ }
4
+ export { isElementDisabled };
package/dist/6508.js ADDED
@@ -0,0 +1,7 @@
1
+ import * as __rspack_external_react from "react";
2
+ const ToolbarGroupContext = /*#__PURE__*/ __rspack_external_react.createContext(void 0);
3
+ if ("production" !== process.env.NODE_ENV) ToolbarGroupContext.displayName = "ToolbarGroupContext";
4
+ function useToolbarGroupContext() {
5
+ return __rspack_external_react.useContext(ToolbarGroupContext);
6
+ }
7
+ export { ToolbarGroupContext, useToolbarGroupContext };
@@ -11,6 +11,7 @@ const visuallyHiddenBase = {
11
11
  const visuallyHidden = {
12
12
  ...visuallyHiddenBase,
13
13
  position: 'fixed',
14
+ margin: 0,
14
15
  top: 0,
15
16
  left: 0
16
17
  };
package/dist/6551.js ADDED
@@ -0,0 +1,46 @@
1
+ import { useLabelableContext } from "./201.js";
2
+ import { useBaseUiId } from "./5969.js";
3
+ import { useRefWithInit, NOOP } from "./9591.js";
4
+ import { useStableCallback } from "./7488.js";
5
+ import { useIsoLayoutEffect } from "./3357.js";
6
+ import * as __rspack_external_react from "react";
7
+ function useLabelableId(params = {}) {
8
+ const { id, enabled = true } = params;
9
+ const { controlId, registerControlId, resetControlId } = useLabelableContext();
10
+ const defaultId = useBaseUiId();
11
+ const controlSourceRef = useRefWithInit(()=>Symbol());
12
+ const hasRegisteredRef = __rspack_external_react.useRef(false);
13
+ const hadExplicitIdRef = __rspack_external_react.useRef(false);
14
+ const unregisterControlId = useStableCallback(()=>{
15
+ if (!hasRegisteredRef.current || registerControlId === NOOP) return;
16
+ hasRegisteredRef.current = false;
17
+ registerControlId(controlSourceRef.current, void 0);
18
+ });
19
+ useIsoLayoutEffect(()=>{
20
+ if (!enabled || registerControlId === NOOP) return void unregisterControlId();
21
+ let nextId;
22
+ if (void 0 !== id) {
23
+ hadExplicitIdRef.current = true;
24
+ nextId = id;
25
+ } else {
26
+ if (!hadExplicitIdRef.current) return void resetControlId();
27
+ nextId = defaultId;
28
+ }
29
+ if (void 0 === nextId) return void unregisterControlId();
30
+ hasRegisteredRef.current = true;
31
+ registerControlId(controlSourceRef.current, nextId);
32
+ }, [
33
+ id,
34
+ enabled,
35
+ registerControlId,
36
+ resetControlId,
37
+ defaultId,
38
+ controlSourceRef,
39
+ unregisterControlId
40
+ ]);
41
+ useIsoLayoutEffect(()=>unregisterControlId, [
42
+ unregisterControlId
43
+ ]);
44
+ return (enabled ? controlId : void 0) ?? id ?? defaultId;
45
+ }
46
+ export { useLabelableId };