@wix/site-ui 1.347.0 → 1.349.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,29 +1,28 @@
1
1
  import { jsx as jsx_runtime_jsx } from "react/jsx-runtime";
2
- import { EMPTY_OBJECT, useRenderElement, esm_formatErrorMessage } from "./8272.js";
3
- import { getEmptyRootContext } from "./4922.js";
4
- import { useHoverFloatingInteraction } from "./3056.js";
5
- import { getNodeChildren, useDismiss } from "./5992.js";
6
- import { getTarget, contains, activeElement } from "./4549.js";
7
- import { CompositeRoot } from "./9087.js";
8
- import { useBaseUiId } from "./6046.js";
9
- import { useFloatingParentNodeId, FloatingTree, FloatingNode, useFloatingTree, useFloatingNodeId } from "./285.js";
10
- import { createChangeEventDetails } from "./4768.js";
11
- import { focusOut, outsidePress, triggerHover, linkPress } from "./2418.js";
12
- import { CompositeItem } from "./951.js";
13
- import { getCssDimensions } from "./7642.js";
14
- import { useControlled } from "./8527.js";
15
- import { useTransitionStatus } from "./4863.js";
16
- import { useStableCallback } from "./7541.js";
17
- import { ownerDocument } from "./9829.js";
2
+ import { utils_formatErrorMessage } from "./5473.js";
3
+ import { getNodeChildren, attachPreventUnmountOnClose, PopupTriggerMap, FloatingRootStore, useUnmountAfterClose, useDismiss } from "./4346.js";
4
+ import { useHoverFloatingInteraction } from "./1607.js";
5
+ import { contains, activeElement, getTarget, closest } from "./4155.js";
6
+ import { useRenderElement, EMPTY_OBJECT } from "./9591.js";
7
+ import { CompositeRoot } from "./3502.js";
8
+ import { useBaseUiId } from "./5969.js";
9
+ import { useFloatingParentNodeId, FloatingTree, FloatingNode, useFloatingTree, useFloatingNodeId } from "./4472.js";
10
+ import { createChangeEventDetails } from "./8495.js";
11
+ import { imperativeAction, focusOut, outsidePress, triggerHover, linkPress } from "./9837.js";
12
+ import { CompositeItem } from "./7270.js";
13
+ import { useControlled } from "./6006.js";
14
+ import { ownerDocument } from "./6488.js";
18
15
  import { isHTMLElement } from "./3829.js";
19
- import { useOpenChangeComplete } from "./9369.js";
16
+ import { useOpenChangeComplete } from "./6620.js";
17
+ import { useIsoLayoutEffect } from "./3357.js";
18
+ import { useStableCallback } from "./7488.js";
20
19
  import * as __rspack_external_react from "react";
21
20
  const NavigationMenuRootContext = /*#__PURE__*/ __rspack_external_react.createContext(void 0);
22
21
  if ("production" !== process.env.NODE_ENV) NavigationMenuRootContext.displayName = "NavigationMenuRootContext";
23
22
  if ('production' !== process.env.NODE_ENV) NavigationMenuRootContext.displayName = 'NavigationMenuRootContext';
24
23
  function useNavigationMenuRootContext(optional) {
25
24
  const context = __rspack_external_react.useContext(NavigationMenuRootContext);
26
- if (void 0 === context && !optional) throw new Error("production" !== process.env.NODE_ENV ? 'Base UI: NavigationMenuRootContext is missing. Navigation Menu parts must be placed within <NavigationMenu.Root>.' : esm_formatErrorMessage(41));
25
+ if (void 0 === context && !optional) throw new Error("production" !== process.env.NODE_ENV ? 'Base UI: NavigationMenuRootContext is missing. Navigation Menu parts must be placed within <NavigationMenu.Root>.' : utils_formatErrorMessage(41));
27
26
  return context;
28
27
  }
29
28
  const NavigationMenuTreeContext = /*#__PURE__*/ __rspack_external_react.createContext(void 0);
@@ -37,14 +36,27 @@ if ("production" !== process.env.NODE_ENV) NavigationMenuDismissContext.displayN
37
36
  function useNavigationMenuDismissContext() {
38
37
  return __rspack_external_react.useContext(NavigationMenuDismissContext);
39
38
  }
39
+ function getEmptyRootContext() {
40
+ return new FloatingRootStore({
41
+ open: false,
42
+ transitionStatus: void 0,
43
+ floatingElement: null,
44
+ referenceElement: null,
45
+ triggerElements: new PopupTriggerMap(),
46
+ floatingId: void 0,
47
+ syncOnly: false,
48
+ nested: false,
49
+ onOpenChange: void 0
50
+ });
51
+ }
40
52
  const NavigationMenuList_NavigationMenuList = /*#__PURE__*/ __rspack_external_react.forwardRef(function(componentProps, forwardedRef) {
41
53
  const { render, className, style, ...elementProps } = componentProps;
42
54
  const nodeId = useNavigationMenuTreeContext();
43
55
  const { orientation, open, floatingRootContext, positionerElement, value, closeDelay, viewportElement, nested } = useNavigationMenuRootContext();
44
56
  const fallbackContext = __rspack_external_react.useMemo(()=>getEmptyRootContext(), []);
45
57
  const context = floatingRootContext || fallbackContext;
46
- const interactionsEnabled = positionerElement ? true : !value;
47
- const hoverInteractionsEnabled = positionerElement || viewportElement ? true : !value;
58
+ const interactionsEnabled = null != positionerElement || null == value;
59
+ const hoverInteractionsEnabled = null != positionerElement || null != viewportElement || null == value;
48
60
  useHoverFloatingInteraction(context, {
49
61
  enabled: Boolean(floatingRootContext) && hoverInteractionsEnabled,
50
62
  closeDelay,
@@ -55,7 +67,7 @@ const NavigationMenuList_NavigationMenuList = /*#__PURE__*/ __rspack_external_re
55
67
  outsidePressEvent: 'intentional',
56
68
  outsidePress (event) {
57
69
  const target = getTarget(event);
58
- const closestNavigationMenuTrigger = target?.closest(`[${NAVIGATION_MENU_TRIGGER_IDENTIFIER}]`);
70
+ const closestNavigationMenuTrigger = closest(target, `[${NAVIGATION_MENU_TRIGGER_IDENTIFIER}]`);
59
71
  return null === closestNavigationMenuTrigger;
60
72
  }
61
73
  });
@@ -72,9 +84,6 @@ const NavigationMenuList_NavigationMenuList = /*#__PURE__*/ __rspack_external_re
72
84
  const props = [
73
85
  dismissProps?.floating || EMPTY_OBJECT,
74
86
  defaultProps,
75
- {
76
- 'aria-orientation': void 0
77
- },
78
87
  elementProps
79
88
  ];
80
89
  const element = useRenderElement('ul', componentProps, {
@@ -109,7 +118,7 @@ const NavigationMenuItemContext = /*#__PURE__*/ __rspack_external_react.createCo
109
118
  if ("production" !== process.env.NODE_ENV) NavigationMenuItemContext.displayName = "NavigationMenuItemContext";
110
119
  function useNavigationMenuItemContext() {
111
120
  const value = __rspack_external_react.useContext(NavigationMenuItemContext);
112
- if (!value) throw new Error("production" !== process.env.NODE_ENV ? 'Base UI: NavigationMenuItem parts must be used within a <NavigationMenu.Item>.' : esm_formatErrorMessage(39));
121
+ if (!value) throw new Error("production" !== process.env.NODE_ENV ? 'Base UI: NavigationMenuItem parts must be used within a <NavigationMenu.Item>.' : utils_formatErrorMessage(39));
113
122
  return value;
114
123
  }
115
124
  const NavigationMenuItem_NavigationMenuItem = /*#__PURE__*/ __rspack_external_react.forwardRef(function(componentProps, forwardedRef) {
@@ -133,9 +142,9 @@ const NavigationMenuItem_NavigationMenuItem = /*#__PURE__*/ __rspack_external_re
133
142
  if ("production" !== process.env.NODE_ENV) NavigationMenuItem_NavigationMenuItem.displayName = "NavigationMenuItem";
134
143
  function isOutsideMenuEvent({ currentTarget, relatedTarget }, params) {
135
144
  const { popupElement, rootRef, tree, nodeId } = params;
136
- const nodeChildrenContains = tree ? getNodeChildren(tree.nodesRef.current, nodeId).some((node)=>contains(node.context?.elements.floating, relatedTarget)) : [];
145
+ const nodeChildrenContains = tree ? getNodeChildren(tree.nodesRef.current, nodeId).some((node)=>contains(node.context?.elements.floating, relatedTarget)) : false;
137
146
  if (!popupElement) return !contains(rootRef.current, relatedTarget) && !nodeChildrenContains;
138
- return !contains(popupElement, currentTarget) && !contains(popupElement, relatedTarget) && !contains(rootRef.current, relatedTarget) && !nodeChildrenContains && !(contains(popupElement, relatedTarget) && relatedTarget?.hasAttribute('data-base-ui-focus-guard'));
147
+ return !contains(popupElement, currentTarget) && !contains(popupElement, relatedTarget) && !contains(rootRef.current, relatedTarget) && !nodeChildrenContains;
139
148
  }
140
149
  const NavigationMenuLink_NavigationMenuLink = /*#__PURE__*/ __rspack_external_react.forwardRef(function(componentProps, forwardedRef) {
141
150
  const { className, render, active = false, closeOnClick = false, style, ...elementProps } = componentProps;
@@ -179,33 +188,29 @@ const NavigationMenuLink_NavigationMenuLink = /*#__PURE__*/ __rspack_external_re
179
188
  });
180
189
  });
181
190
  if ("production" !== process.env.NODE_ENV) NavigationMenuLink_NavigationMenuLink.displayName = "NavigationMenuLink";
182
- let NavigationMenuPopupCssVars_NavigationMenuPopupCssVars = /*#__PURE__*/ function(NavigationMenuPopupCssVars) {
183
- NavigationMenuPopupCssVars["popupWidth"] = "--popup-width";
184
- NavigationMenuPopupCssVars["popupHeight"] = "--popup-height";
185
- return NavigationMenuPopupCssVars;
186
- }({});
187
- let NavigationMenuPositionerCssVars_NavigationMenuPositionerCssVars = /*#__PURE__*/ function(NavigationMenuPositionerCssVars) {
188
- NavigationMenuPositionerCssVars["availableWidth"] = "--available-width";
189
- NavigationMenuPositionerCssVars["availableHeight"] = "--available-height";
190
- NavigationMenuPositionerCssVars["anchorWidth"] = "--anchor-width";
191
- NavigationMenuPositionerCssVars["anchorHeight"] = "--anchor-height";
192
- NavigationMenuPositionerCssVars["transformOrigin"] = "--transform-origin";
193
- NavigationMenuPositionerCssVars["positionerWidth"] = "--positioner-width";
194
- NavigationMenuPositionerCssVars["positionerHeight"] = "--positioner-height";
195
- return NavigationMenuPositionerCssVars;
196
- }({});
191
+ const positionerWidth = '--positioner-width';
192
+ const positionerHeight = '--positioner-height';
193
+ const popupWidth = '--popup-width';
194
+ const popupHeight = '--popup-height';
195
+ function setSharedFixedSize(popupElement, positionerElement, width, height) {
196
+ popupElement.style.setProperty(popupWidth, `${width}px`);
197
+ popupElement.style.setProperty(popupHeight, `${height}px`);
198
+ positionerElement.style.setProperty(positionerWidth, `${width}px`);
199
+ positionerElement.style.setProperty(positionerHeight, `${height}px`);
200
+ }
197
201
  const blockedReturnFocusReasons = new Set([
198
202
  triggerHover,
199
203
  outsidePress,
200
204
  focusOut
201
205
  ]);
202
- function setSharedFixedSize(popupElement, positionerElement) {
203
- const { width, height } = getCssDimensions(popupElement);
204
- if (0 === width || 0 === height) return;
205
- popupElement.style.setProperty(NavigationMenuPopupCssVars_NavigationMenuPopupCssVars.popupWidth, `${width}px`);
206
- popupElement.style.setProperty(NavigationMenuPopupCssVars_NavigationMenuPopupCssVars.popupHeight, `${height}px`);
207
- positionerElement.style.setProperty(NavigationMenuPositionerCssVars_NavigationMenuPositionerCssVars.positionerWidth, `${width}px`);
208
- positionerElement.style.setProperty(NavigationMenuPositionerCssVars_NavigationMenuPositionerCssVars.positionerHeight, `${height}px`);
206
+ function getPositionerFixedSize(positionerElement) {
207
+ const width = parseFloat(positionerElement.style.getPropertyValue(positionerWidth)) || 0;
208
+ const height = parseFloat(positionerElement.style.getPropertyValue(positionerHeight)) || 0;
209
+ if (width <= 0 || height <= 0) return null;
210
+ return {
211
+ width,
212
+ height
213
+ };
209
214
  }
210
215
  const NavigationMenuRoot_NavigationMenuRoot = /*#__PURE__*/ __rspack_external_react.forwardRef(function(componentProps, forwardedRef) {
211
216
  const { defaultValue = null, value: valueParam, onValueChange, actionsRef, delay = 50, closeDelay = 50, orientation = 'horizontal', onOpenChangeComplete } = componentProps;
@@ -237,53 +242,33 @@ const NavigationMenuRoot_NavigationMenuRoot = /*#__PURE__*/ __rspack_external_re
237
242
  abortController: null,
238
243
  owner: null
239
244
  });
240
- const { mounted, setMounted, transitionStatus } = useTransitionStatus(open);
241
- __rspack_external_react.useEffect(()=>{
242
- setViewportInert(false);
243
- }, [
244
- value
245
- ]);
246
- const setValue = useStableCallback((nextValue, eventDetails)=>{
247
- if (!nextValue) {
248
- closeReasonRef.current = eventDetails.reason;
249
- setActivationDirection(null);
250
- setFloatingRootContext(void 0);
251
- if (positionerElement && popupElement) setSharedFixedSize(popupElement, positionerElement);
252
- }
253
- if (nextValue !== value) onValueChange?.(nextValue, eventDetails);
254
- if (eventDetails.isCanceled) return;
255
- setValueUnwrapped(nextValue);
256
- if (nested && !nextValue && eventDetails.reason === linkPress && parentRootContext) parentRootContext.setValue(null, eventDetails);
257
- });
258
- const handleUnmount = useStableCallback(()=>{
259
- const doc = ownerDocument(rootRef.current);
260
- const activeEl = activeElement(doc);
261
- const isReturnFocusBlocked = closeReasonRef.current ? blockedReturnFocusReasons.has(closeReasonRef.current) : false;
262
- if (!isReturnFocusBlocked && isHTMLElement(prevTriggerElementRef.current) && (activeEl === ownerDocument(popupElement).body || contains(popupElement, activeEl)) && popupElement) {
263
- prevTriggerElementRef.current.focus({
264
- preventScroll: true
265
- });
266
- prevTriggerElementRef.current = void 0;
267
- }
268
- setMounted(false);
269
- onOpenChangeComplete?.(false);
270
- setActivationDirection(null);
271
- setFloatingRootContext(void 0);
272
- currentContentRef.current = null;
273
- closeReasonRef.current = void 0;
274
- });
275
- useOpenChangeComplete({
276
- enabled: !actionsRef,
245
+ const [preventUnmountOnClose, setPreventUnmountOnClose] = __rspack_external_react.useState(false);
246
+ const { mounted, transitionStatus, preventUnmountingOnClose, forceUnmount: handleUnmount } = useUnmountAfterClose({
277
247
  open,
278
248
  ref: {
279
249
  current: popupElement
280
250
  },
281
- onComplete () {
282
- if (!open) handleUnmount();
251
+ preventUnmountOnClose,
252
+ setPreventUnmountOnClose,
253
+ onUnmount () {
254
+ const doc = ownerDocument(rootRef.current);
255
+ const activeEl = activeElement(doc);
256
+ const isReturnFocusBlocked = closeReasonRef.current ? blockedReturnFocusReasons.has(closeReasonRef.current) : false;
257
+ if (!isReturnFocusBlocked && isHTMLElement(prevTriggerElementRef.current) && (activeEl === ownerDocument(popupElement).body || contains(popupElement, activeEl)) && popupElement) {
258
+ prevTriggerElementRef.current.focus({
259
+ preventScroll: true
260
+ });
261
+ prevTriggerElementRef.current = void 0;
262
+ }
263
+ onOpenChangeComplete?.(false);
264
+ setActivationDirection(null);
265
+ setFloatingRootContext(void 0);
266
+ currentContentRef.current = null;
267
+ closeReasonRef.current = void 0;
283
268
  }
284
269
  });
285
270
  useOpenChangeComplete({
286
- enabled: !actionsRef,
271
+ enabled: mounted && !open && !preventUnmountingOnClose,
287
272
  open,
288
273
  ref: {
289
274
  current: viewportTargetElement
@@ -292,6 +277,44 @@ const NavigationMenuRoot_NavigationMenuRoot = /*#__PURE__*/ __rspack_external_re
292
277
  if (!open) handleUnmount();
293
278
  }
294
279
  });
280
+ useIsoLayoutEffect(()=>{
281
+ if (open) return;
282
+ if (!positionerElement || !popupElement) return;
283
+ const closeTransitionSize = getPositionerFixedSize(positionerElement);
284
+ if (!closeTransitionSize) return;
285
+ setSharedFixedSize(popupElement, positionerElement, closeTransitionSize.width, closeTransitionSize.height);
286
+ }, [
287
+ open,
288
+ popupElement,
289
+ positionerElement
290
+ ]);
291
+ __rspack_external_react.useEffect(()=>{
292
+ setViewportInert(false);
293
+ }, [
294
+ value
295
+ ]);
296
+ const setValue = useStableCallback((nextValue, eventDetails)=>{
297
+ if (null == nextValue) closeReasonRef.current = eventDetails.reason;
298
+ const changeEventDetails = eventDetails;
299
+ const shouldPreventUnmountOnClose = attachPreventUnmountOnClose(changeEventDetails);
300
+ if (nextValue !== value) onValueChange?.(nextValue, changeEventDetails);
301
+ if (eventDetails.isCanceled) return;
302
+ if (null == nextValue) {
303
+ if (null != value) setPreventUnmountOnClose(shouldPreventUnmountOnClose());
304
+ setActivationDirection(null);
305
+ setFloatingRootContext(void 0);
306
+ }
307
+ setValueUnwrapped(nextValue);
308
+ if (nested && null == nextValue && eventDetails.reason === linkPress && parentRootContext) parentRootContext.setValue(null, eventDetails);
309
+ });
310
+ __rspack_external_react.useImperativeHandle(actionsRef, ()=>({
311
+ unmount: handleUnmount,
312
+ close: ()=>setValue(null, createChangeEventDetails(imperativeAction))
313
+ }), [
314
+ handleUnmount,
315
+ setValue
316
+ ]);
317
+ const contextActivationDirection = open ? activationDirection : null;
295
318
  const contextValue = __rspack_external_react.useMemo(()=>({
296
319
  open,
297
320
  value,
@@ -306,7 +329,7 @@ const NavigationMenuRoot_NavigationMenuRoot = /*#__PURE__*/ __rspack_external_re
306
329
  setViewportElement,
307
330
  viewportTargetElement,
308
331
  setViewportTargetElement,
309
- activationDirection,
332
+ activationDirection: contextActivationDirection,
310
333
  setActivationDirection,
311
334
  floatingRootContext,
312
335
  setFloatingRootContext,
@@ -334,7 +357,7 @@ const NavigationMenuRoot_NavigationMenuRoot = /*#__PURE__*/ __rspack_external_re
334
357
  popupElement,
335
358
  viewportElement,
336
359
  viewportTargetElement,
337
- activationDirection,
360
+ contextActivationDirection,
338
361
  floatingRootContext,
339
362
  nested,
340
363
  delay,
@@ -380,4 +403,4 @@ function TreeContext(props) {
380
403
  })
381
404
  });
382
405
  }
383
- export { NAVIGATION_MENU_TRIGGER_IDENTIFIER, NavigationMenuItem_NavigationMenuItem, NavigationMenuLink_NavigationMenuLink, NavigationMenuList_NavigationMenuList, NavigationMenuPopupCssVars_NavigationMenuPopupCssVars, NavigationMenuPositionerCssVars_NavigationMenuPositionerCssVars, NavigationMenuRoot_NavigationMenuRoot, isOutsideMenuEvent, useNavigationMenuDismissContext, useNavigationMenuItemContext, useNavigationMenuRootContext, useNavigationMenuTreeContext };
406
+ export { NAVIGATION_MENU_TRIGGER_IDENTIFIER, NavigationMenuItem_NavigationMenuItem, NavigationMenuLink_NavigationMenuLink, NavigationMenuList_NavigationMenuList, NavigationMenuRoot_NavigationMenuRoot, getEmptyRootContext, isOutsideMenuEvent, popupHeight, popupWidth, positionerHeight, positionerWidth, setSharedFixedSize, useNavigationMenuDismissContext, useNavigationMenuItemContext, useNavigationMenuRootContext, useNavigationMenuTreeContext };
@@ -1,26 +1,25 @@
1
- import { useFloatingTree } from "./285.js";
2
- import { useHoverInteractionSharedState, clearSafePolygonPointerEventsMutation, getDelay, applySafePolygonPointerEventsMutation, getRestMs, useHoverShared_isClickLikeOpenEvent } from "./3056.js";
3
- import { useValueAsRef } from "./4707.js";
4
- import { useStableCallback } from "./7541.js";
5
- import { getTarget, contains } from "./4549.js";
1
+ import { useFloatingTree } from "./4472.js";
2
+ import { useHoverInteractionSharedState, clearSafePolygonPointerEventsMutation, getDelay, applySafePolygonPointerEventsMutation, getRestMs, useHoverShared_isClickLikeOpenEvent } from "./1607.js";
3
+ import { useValueAsRef } from "./7930.js";
4
+ import { useStableCallback } from "./7488.js";
5
+ import { getTarget, contains } from "./4155.js";
6
6
  import { isElement } from "./3829.js";
7
- import { ownerDocument } from "./9829.js";
8
- import { triggerHover } from "./2418.js";
9
- import { createChangeEventDetails } from "./4768.js";
10
- import { isMouseLikePointerType } from "./6330.js";
11
- import { isTargetInsideEnabledTrigger } from "./8758.js";
12
- import { mergeCleanups } from "./4495.js";
13
- import { addEventListener } from "./4723.js";
14
- import { Timeout } from "./42.js";
15
- import { getNodeChildren } from "./5992.js";
7
+ import { ownerDocument } from "./6488.js";
8
+ import { triggerHover } from "./9837.js";
9
+ import { createChangeEventDetails } from "./8495.js";
10
+ import { isMouseLikePointerType } from "./8358.js";
11
+ import { isTargetInsideEnabledTrigger } from "./6137.js";
12
+ import { addEventListener } from "./1282.js";
13
+ import { mergeCleanups } from "./7718.js";
14
+ import { Timeout } from "./9197.js";
15
+ import { getNodeChildren } from "./4346.js";
16
16
  import * as __rspack_external_react from "react";
17
17
  import * as __rspack_external_react_dom_7136dc57 from "react-dom";
18
18
  const EMPTY_REF = {
19
19
  current: null
20
20
  };
21
- function useHoverReferenceInteraction(context, props = {}) {
22
- const { enabled = true, delay = 0, handleClose = null, mouseOnly = false, restMs = 0, move = true, triggerElementRef = EMPTY_REF, externalTree, isActiveTrigger = true, getHandleCloseContext, isClosing, shouldOpen: shouldOpenProp } = props;
23
- const store = 'rootStore' in context ? context.rootStore : context;
21
+ function useHoverReferenceInteraction(store, props = {}) {
22
+ const { enabled = true, delay = 0, handleClose = null, mouseOnly = false, restMs = 0, move = true, triggerElementRef = EMPTY_REF, externalTree, isActiveTrigger = true, getHandleCloseContext, isClosing, shouldOpen: shouldOpenProp, guardStaleOpen = false } = props;
24
23
  const { dataRef, events } = store.context;
25
24
  const tree = useFloatingTree(externalTree);
26
25
  const instance = useHoverInteractionSharedState(store);
@@ -49,7 +48,7 @@ function useHoverReferenceInteraction(context, props = {}) {
49
48
  const clearPointerEvents = useStableCallback(()=>{
50
49
  clearSafePolygonPointerEventsMutation(instance);
51
50
  });
52
- if (isActiveTrigger) instance.handleCloseOptions = handleCloseRef.current?.__options;
51
+ if (isActiveTrigger) instance.handleCloseOptions = handleClose?.__options;
53
52
  __rspack_external_react.useEffect(()=>cleanupMouseMoveHandler, [
54
53
  cleanupMouseMoveHandler
55
54
  ]);
@@ -159,10 +158,17 @@ function useHoverReferenceInteraction(context, props = {}) {
159
158
  const shouldClose = 'touch' === instance.pointerType ? !contains(store.select('floatingElement'), event.relatedTarget) : true;
160
159
  if (shouldClose) closeWithDelay(event);
161
160
  }
161
+ function onMouseOut(event) {
162
+ if (contains(trigger, event.relatedTarget)) return;
163
+ instance.openChangeTimeout.clear();
164
+ instance.restTimeout.clear();
165
+ instance.restTimeoutPending = false;
166
+ }
167
+ const staleOpenGuard = guardStaleOpen ? addEventListener(trigger, 'mouseout', onMouseOut) : void 0;
162
168
  if (move) return mergeCleanups(addEventListener(trigger, 'mousemove', onMouseEnter, {
163
169
  once: true
164
- }), addEventListener(trigger, 'mouseenter', onMouseEnter), addEventListener(trigger, 'mouseleave', onMouseLeave));
165
- return mergeCleanups(addEventListener(trigger, 'mouseenter', onMouseEnter), addEventListener(trigger, 'mouseleave', onMouseLeave));
170
+ }), addEventListener(trigger, 'mouseenter', onMouseEnter), addEventListener(trigger, 'mouseleave', onMouseLeave), staleOpenGuard);
171
+ return mergeCleanups(addEventListener(trigger, 'mouseenter', onMouseEnter), addEventListener(trigger, 'mouseleave', onMouseLeave), staleOpenGuard);
166
172
  }, [
167
173
  cleanupMouseMoveHandler,
168
174
  clearPointerEvents,
@@ -183,7 +189,8 @@ function useHoverReferenceInteraction(context, props = {}) {
183
189
  enabledRef,
184
190
  getHandleCloseContext,
185
191
  isClosingRef,
186
- checkShouldOpen
192
+ checkShouldOpen,
193
+ guardStaleOpen
187
194
  ]);
188
195
  return __rspack_external_react.useMemo(()=>{
189
196
  if (!enabled) return;
package/dist/392.js ADDED
@@ -0,0 +1,7 @@
1
+ import * as __rspack_external_react from "react";
2
+ const ToggleGroupContext = /*#__PURE__*/ __rspack_external_react.createContext(void 0);
3
+ if ("production" !== process.env.NODE_ENV) ToggleGroupContext.displayName = "ToggleGroupContext";
4
+ function useToggleGroupContext() {
5
+ return __rspack_external_react.useContext(ToggleGroupContext);
6
+ }
7
+ export { ToggleGroupContext, useToggleGroupContext };
@@ -1,4 +1,4 @@
1
- import { isShadowRoot } from "./3829.js";
1
+ import { isShadowRoot, isElement } from "./3829.js";
2
2
  function activeElement(doc) {
3
3
  let element = doc.activeElement;
4
4
  while(element?.shadowRoot?.activeElement != null)element = element.shadowRoot.activeElement;
@@ -17,8 +17,16 @@ function contains(parent, child) {
17
17
  }
18
18
  return false;
19
19
  }
20
+ function closest(node, selector) {
21
+ let current = node;
22
+ while(current){
23
+ if (isElement(current) && current.matches(selector)) return current;
24
+ current = current.assignedSlot ?? current.parentNode ?? (isShadowRoot(current) ? current.host : null);
25
+ }
26
+ return null;
27
+ }
20
28
  function getTarget(event) {
21
- if ('composedPath' in event) return event.composedPath()[0];
29
+ if ('composedPath' in event) return event.composedPath()[0] ?? event.target;
22
30
  return event.target;
23
31
  }
24
- export { activeElement, contains, getTarget };
32
+ export { activeElement, closest, contains, getTarget };
package/dist/4226.js ADDED
@@ -0,0 +1,7 @@
1
+ import * as __rspack_external_react from "react";
2
+ const CheckboxGroupContext = /*#__PURE__*/ __rspack_external_react.createContext(void 0);
3
+ if ("production" !== process.env.NODE_ENV) CheckboxGroupContext.displayName = "CheckboxGroupContext";
4
+ function useCheckboxGroupContext() {
5
+ return __rspack_external_react.useContext(CheckboxGroupContext);
6
+ }
7
+ export { CheckboxGroupContext, useCheckboxGroupContext };
@@ -1,5 +1,5 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { clamp } from "./3296.js";
2
+ import { clamp } from "./5568.js";
3
3
  const DISABLE_SCROLLBAR_CLASS_NAME = 'base-ui-disable-scrollbar';
4
4
  const styleDisableScrollbar = {
5
5
  className: DISABLE_SCROLLBAR_CLASS_NAME,
package/dist/4293.js ADDED
@@ -0,0 +1,3 @@
1
+ import { createLogOnce } from "./9591.js";
2
+ const error = createLogOnce('error', 'Base UI');
3
+ export { error };