@ariakit/core 0.3.11 → 0.4.1

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 (102) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/cjs/__chunks/{E53JW5BD.cjs → 5JEQEZFR.cjs} +12 -12
  3. package/cjs/__chunks/{YIUPKKEK.cjs → 7DU6YMLQ.cjs} +6 -6
  4. package/cjs/__chunks/{OTVLDMN2.cjs → AETQC2AR.cjs} +17 -16
  5. package/cjs/__chunks/{F6HPKLO2.cjs → B4LYZ4EM.cjs} +12 -12
  6. package/cjs/__chunks/{KBNYGXWI.cjs → EEDWPDM2.cjs} +11 -1
  7. package/cjs/__chunks/{MI6NUQYQ.cjs → FFZYCAXA.cjs} +15 -15
  8. package/cjs/__chunks/{I3Y4EXEF.cjs → LTLFSC4X.cjs} +2 -2
  9. package/cjs/__chunks/{NOFH2BLB.cjs → SU2BSHGB.cjs} +7 -7
  10. package/cjs/__chunks/{TQTGWD5K.cjs → UEZLSKZ4.cjs} +10 -10
  11. package/cjs/__chunks/{5F4DVUNS.cjs → UKR6TQI3.cjs} +1 -2
  12. package/cjs/__chunks/{BFE5R4EZ.cjs → Y7KNI5NS.cjs} +17 -17
  13. package/cjs/checkbox/checkbox-store.cjs +5 -5
  14. package/cjs/collection/collection-store.cjs +5 -5
  15. package/cjs/combobox/combobox-store.cjs +35 -35
  16. package/cjs/combobox/combobox-store.d.cts +13 -8
  17. package/cjs/combobox/combobox-store.d.ts +13 -8
  18. package/cjs/composite/composite-overflow-store.cjs +6 -6
  19. package/cjs/composite/composite-store.cjs +6 -6
  20. package/cjs/composite/composite-store.d.cts +4 -0
  21. package/cjs/composite/composite-store.d.ts +4 -0
  22. package/cjs/dialog/dialog-store.cjs +5 -5
  23. package/cjs/disclosure/disclosure-store.cjs +4 -4
  24. package/cjs/disclosure/disclosure-store.d.cts +6 -2
  25. package/cjs/disclosure/disclosure-store.d.ts +6 -2
  26. package/cjs/form/form-store.cjs +24 -24
  27. package/cjs/hovercard/hovercard-store.cjs +7 -7
  28. package/cjs/hovercard/hovercard-store.d.cts +2 -4
  29. package/cjs/hovercard/hovercard-store.d.ts +2 -4
  30. package/cjs/menu/menu-bar-store.cjs +7 -7
  31. package/cjs/menu/menu-store.cjs +27 -27
  32. package/cjs/menu/menu-store.d.cts +7 -7
  33. package/cjs/menu/menu-store.d.ts +7 -7
  34. package/cjs/menubar/menubar-store.cjs +7 -7
  35. package/cjs/popover/popover-store.cjs +6 -6
  36. package/cjs/radio/radio-store.cjs +9 -9
  37. package/cjs/radio/radio-store.d.cts +2 -4
  38. package/cjs/radio/radio-store.d.ts +2 -4
  39. package/cjs/select/select-store.cjs +29 -29
  40. package/cjs/select/select-store.d.cts +1 -3
  41. package/cjs/select/select-store.d.ts +1 -3
  42. package/cjs/tab/tab-store.cjs +21 -21
  43. package/cjs/toolbar/toolbar-store.cjs +8 -8
  44. package/cjs/toolbar/toolbar-store.d.cts +1 -1
  45. package/cjs/toolbar/toolbar-store.d.ts +1 -1
  46. package/cjs/tooltip/tooltip-store.cjs +21 -12
  47. package/cjs/tooltip/tooltip-store.d.cts +1 -1
  48. package/cjs/tooltip/tooltip-store.d.ts +1 -1
  49. package/cjs/utils/dom.cjs +2 -2
  50. package/cjs/utils/events.cjs +5 -5
  51. package/cjs/utils/focus.cjs +13 -13
  52. package/cjs/utils/misc.cjs +4 -2
  53. package/cjs/utils/misc.d.cts +4 -0
  54. package/cjs/utils/misc.d.ts +4 -0
  55. package/cjs/utils/platform.cjs +3 -3
  56. package/cjs/utils/store.cjs +3 -3
  57. package/esm/__chunks/{Y3OOHFCN.js → 22HHDS5F.js} +10 -0
  58. package/esm/__chunks/{IERTEJ3A.js → 2H5K47H4.js} +3 -3
  59. package/esm/__chunks/{SX2XFD6A.js → 5RJNXXU2.js} +1 -1
  60. package/esm/__chunks/{SOLWE6E5.js → BRS7GKWU.js} +3 -3
  61. package/esm/__chunks/{AF6IUUFN.js → MFZZDIHG.js} +3 -3
  62. package/esm/__chunks/{XU3EOSCU.js → PXYVPXSS.js} +3 -3
  63. package/esm/__chunks/{EAHJFCU4.js → R676XYVY.js} +1 -1
  64. package/esm/__chunks/{DLOEKDPY.js → RRSZHCH6.js} +1 -2
  65. package/esm/__chunks/{22K762VQ.js → URUD7X4C.js} +3 -3
  66. package/esm/__chunks/{MHPO2BXA.js → VDNATJW2.js} +1 -1
  67. package/esm/__chunks/{Z5IGYIPT.js → WCKXDMU7.js} +3 -2
  68. package/esm/checkbox/checkbox-store.js +2 -2
  69. package/esm/collection/collection-store.js +4 -4
  70. package/esm/combobox/combobox-store.d.ts +13 -8
  71. package/esm/combobox/combobox-store.js +9 -9
  72. package/esm/composite/composite-overflow-store.js +5 -5
  73. package/esm/composite/composite-store.d.ts +4 -0
  74. package/esm/composite/composite-store.js +5 -5
  75. package/esm/dialog/dialog-store.js +4 -4
  76. package/esm/disclosure/disclosure-store.d.ts +6 -2
  77. package/esm/disclosure/disclosure-store.js +3 -3
  78. package/esm/form/form-store.js +4 -4
  79. package/esm/hovercard/hovercard-store.d.ts +2 -4
  80. package/esm/hovercard/hovercard-store.js +6 -6
  81. package/esm/menu/menu-bar-store.js +6 -6
  82. package/esm/menu/menu-store.d.ts +7 -7
  83. package/esm/menu/menu-store.js +9 -9
  84. package/esm/menubar/menubar-store.js +6 -6
  85. package/esm/popover/popover-store.js +5 -5
  86. package/esm/radio/radio-store.d.ts +2 -4
  87. package/esm/radio/radio-store.js +5 -5
  88. package/esm/select/select-store.d.ts +1 -3
  89. package/esm/select/select-store.js +8 -8
  90. package/esm/tab/tab-store.js +5 -5
  91. package/esm/toolbar/toolbar-store.d.ts +1 -1
  92. package/esm/toolbar/toolbar-store.js +5 -5
  93. package/esm/tooltip/tooltip-store.d.ts +1 -1
  94. package/esm/tooltip/tooltip-store.js +15 -6
  95. package/esm/utils/dom.js +1 -1
  96. package/esm/utils/events.js +2 -2
  97. package/esm/utils/focus.js +1 -1
  98. package/esm/utils/misc.d.ts +4 -0
  99. package/esm/utils/misc.js +3 -1
  100. package/esm/utils/platform.js +2 -2
  101. package/esm/utils/store.js +2 -2
  102. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,60 @@
1
1
  # @ariakit/core
2
2
 
3
+ ## 0.4.1
4
+
5
+ - Added [`disclosure`](https://ariakit.org/reference/use-disclosure-store#disclosure-1) property to disclosure stores.
6
+ - Improved JSDocs.
7
+
8
+ ## 0.4.0
9
+
10
+ ### Improved animation support
11
+
12
+ This version enhances support for CSS animations and transitions on Ariakit components that use [Disclosure](https://ariakit.org/component/disclosure). This includes [Dialog](https://ariakit.org/components/dialog), [Popover](https://ariakit.org/components/popover), [Combobox](https://ariakit.org/components/combobox), [Select](https://ariakit.org/components/select), [Hovercard](https://ariakit.org/components/hovercard), [Menu](https://ariakit.org/components/menu), and [Tooltip](https://ariakit.org/components/tooltip).
13
+
14
+ These components now support _enter_ and _leave_ transitions and animations right out of the box, eliminating the need to provide an explicit `animated` prop. If an enter animation is detected, the component will automatically wait for a leave animation to complete before unmounting or hiding itself.
15
+
16
+ Use the [`[data-enter]`](https://ariakit.org/guide/styling#data-enter) selector for CSS transitions. For CSS animations, use the newly introduced [`[data-open]`](https://ariakit.org/guide/styling#data-open) selector. The [`[data-leave]`](https://ariakit.org/guide/styling#data-leave) selector can be used for both transitions and animations.
17
+
18
+ ### Composite widgets with `grid` role
19
+
20
+ **BREAKING** if you're manually setting the `role="grid"` prop on a composite widget.
21
+
22
+ Ariakit automatically assigns the `role` prop to all composite items to align with the container `role`. For example, if [`SelectPopover`](https://ariakit.org/reference/select-popover) has its role set to `listbox` (which is the default value), its owned [`SelectItem`](https://ariakit.org/reference/select-item) elements will automatically get their role set to `option`.
23
+
24
+ In previous versions, this was also valid for composite widgets with a `grid` role, where the composite item element would automatically be given `role="gridcell"`. This is no longer the case, and you're now required to manually pass `role="gridcell"` to the composite item element if you're rendering a container with `role="grid"`.
25
+
26
+ Before:
27
+
28
+ ```jsx
29
+ <SelectPopover role="grid">
30
+ <SelectRow> {/* Automatically gets role="row" */}
31
+ <SelectItem> {/* Automatically gets role="gridcell" */}
32
+ ```
33
+
34
+ After:
35
+
36
+ ```jsx
37
+ <SelectPopover role="grid">
38
+ <SelectRow> {/* Still gets role="row" */}
39
+ <SelectItem role="gridcell">
40
+ ```
41
+
42
+ This change is due to the possibility of rendering a composite item element with a different role as a child of a static `div` with `role="gridcell"`, which is a valid and frequently used practice when using the `grid` role. As a result, you no longer have to manually adjust the `role` prop on the composite item:
43
+
44
+ ```jsx
45
+ <SelectPopover role="grid">
46
+ <SelectRow>
47
+ <div role="gridcell">
48
+ <SelectItem render={<button />}>
49
+ ```
50
+
51
+ Previously, you had to explicitly pass `role="button"` to the [`SelectItem`](https://ariakit.org/reference/select-item) component above, otherwise it would automatically receive `role="gridcell"`, leading to an invalid accessibility tree.
52
+
53
+ ### Other updates
54
+
55
+ - Added `removeUndefinedValues` utility function.
56
+ - Added new [`disclosure`](https://ariakit.org/reference/use-disclosure-store#disclosure-1) property to disclosure stores.
57
+
3
58
  ## 0.3.11
4
59
 
5
60
  ### Improved performance of large collections
@@ -1,16 +1,16 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _I3Y4EXEFcjs = require('./I3Y4EXEF.cjs');
4
+ var _LTLFSC4Xcjs = require('./LTLFSC4X.cjs');
5
5
 
6
6
 
7
7
 
8
8
 
9
9
 
10
- var _F6HPKLO2cjs = require('./F6HPKLO2.cjs');
10
+ var _B4LYZ4EMcjs = require('./B4LYZ4EM.cjs');
11
11
 
12
12
 
13
- var _KBNYGXWIcjs = require('./KBNYGXWI.cjs');
13
+ var _EEDWPDM2cjs = require('./EEDWPDM2.cjs');
14
14
 
15
15
 
16
16
 
@@ -24,9 +24,9 @@ function createPopoverStore(_a = {}) {
24
24
  } = _b, props = _AV6KTKLEcjs.__objRest.call(void 0, _b, [
25
25
  "popover"
26
26
  ]);
27
- const store = _F6HPKLO2cjs.mergeStore.call(void 0,
27
+ const store = _B4LYZ4EMcjs.mergeStore.call(void 0,
28
28
  props.store,
29
- _F6HPKLO2cjs.omit.call(void 0, otherPopover, [
29
+ _B4LYZ4EMcjs.omit.call(void 0, otherPopover, [
30
30
  "arrowElement",
31
31
  "anchorElement",
32
32
  "contentElement",
@@ -34,10 +34,10 @@ function createPopoverStore(_a = {}) {
34
34
  "disclosureElement"
35
35
  ])
36
36
  );
37
- _F6HPKLO2cjs.throwOnConflictingProps.call(void 0, props, store);
37
+ _B4LYZ4EMcjs.throwOnConflictingProps.call(void 0, props, store);
38
38
  const syncState = store == null ? void 0 : store.getState();
39
- const dialog = _I3Y4EXEFcjs.createDialogStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), { store }));
40
- const placement = _KBNYGXWIcjs.defaultValue.call(void 0,
39
+ const dialog = _LTLFSC4Xcjs.createDialogStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), { store }));
40
+ const placement = _EEDWPDM2cjs.defaultValue.call(void 0,
41
41
  props.placement,
42
42
  syncState == null ? void 0 : syncState.placement,
43
43
  "bottom"
@@ -45,12 +45,12 @@ function createPopoverStore(_a = {}) {
45
45
  const initialState = _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, dialog.getState()), {
46
46
  placement,
47
47
  currentPlacement: placement,
48
- anchorElement: _KBNYGXWIcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.anchorElement, null),
49
- popoverElement: _KBNYGXWIcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.popoverElement, null),
50
- arrowElement: _KBNYGXWIcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.arrowElement, null),
48
+ anchorElement: _EEDWPDM2cjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.anchorElement, null),
49
+ popoverElement: _EEDWPDM2cjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.popoverElement, null),
50
+ arrowElement: _EEDWPDM2cjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.arrowElement, null),
51
51
  rendered: Symbol("rendered")
52
52
  });
53
- const popover = _F6HPKLO2cjs.createStore.call(void 0, initialState, dialog, store);
53
+ const popover = _B4LYZ4EMcjs.createStore.call(void 0, initialState, dialog, store);
54
54
  return _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, dialog), popover), {
55
55
  setAnchorElement: (element) => popover.setState("anchorElement", element),
56
56
  setPopoverElement: (element) => popover.setState("popoverElement", element),
@@ -1,25 +1,25 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _5F4DVUNScjs = require('./5F4DVUNS.cjs');
4
+ var _UKR6TQI3cjs = require('./UKR6TQI3.cjs');
5
5
 
6
6
  // src/utils/platform.ts
7
7
  function isTouchDevice() {
8
- return _5F4DVUNScjs.canUseDOM && !!navigator.maxTouchPoints;
8
+ return _UKR6TQI3cjs.canUseDOM && !!navigator.maxTouchPoints;
9
9
  }
10
10
  function isApple() {
11
- if (!_5F4DVUNScjs.canUseDOM)
11
+ if (!_UKR6TQI3cjs.canUseDOM)
12
12
  return false;
13
13
  return /mac|iphone|ipad|ipod/i.test(navigator.platform);
14
14
  }
15
15
  function isSafari() {
16
- return _5F4DVUNScjs.canUseDOM && isApple() && /apple/i.test(navigator.vendor);
16
+ return _UKR6TQI3cjs.canUseDOM && isApple() && /apple/i.test(navigator.vendor);
17
17
  }
18
18
  function isFirefox() {
19
- return _5F4DVUNScjs.canUseDOM && /firefox\//i.test(navigator.userAgent);
19
+ return _UKR6TQI3cjs.canUseDOM && /firefox\//i.test(navigator.userAgent);
20
20
  }
21
21
  function isMac() {
22
- return _5F4DVUNScjs.canUseDOM && navigator.platform.startsWith("Mac") && !isTouchDevice();
22
+ return _UKR6TQI3cjs.canUseDOM && navigator.platform.startsWith("Mac") && !isTouchDevice();
23
23
  }
24
24
 
25
25
 
@@ -7,10 +7,10 @@
7
7
 
8
8
 
9
9
 
10
- var _F6HPKLO2cjs = require('./F6HPKLO2.cjs');
10
+ var _B4LYZ4EMcjs = require('./B4LYZ4EM.cjs');
11
11
 
12
12
 
13
- var _KBNYGXWIcjs = require('./KBNYGXWI.cjs');
13
+ var _EEDWPDM2cjs = require('./EEDWPDM2.cjs');
14
14
 
15
15
 
16
16
 
@@ -18,51 +18,52 @@ var _AV6KTKLEcjs = require('./AV6KTKLE.cjs');
18
18
 
19
19
  // src/disclosure/disclosure-store.ts
20
20
  function createDisclosureStore(props = {}) {
21
- const store = _F6HPKLO2cjs.mergeStore.call(void 0,
21
+ const store = _B4LYZ4EMcjs.mergeStore.call(void 0,
22
22
  props.store,
23
- _F6HPKLO2cjs.omit.call(void 0, props.disclosure, ["contentElement", "disclosureElement"])
23
+ _B4LYZ4EMcjs.omit.call(void 0, props.disclosure, ["contentElement", "disclosureElement"])
24
24
  );
25
- _F6HPKLO2cjs.throwOnConflictingProps.call(void 0, props, store);
25
+ _B4LYZ4EMcjs.throwOnConflictingProps.call(void 0, props, store);
26
26
  const syncState = store == null ? void 0 : store.getState();
27
- const open = _KBNYGXWIcjs.defaultValue.call(void 0,
27
+ const open = _EEDWPDM2cjs.defaultValue.call(void 0,
28
28
  props.open,
29
29
  syncState == null ? void 0 : syncState.open,
30
30
  props.defaultOpen,
31
31
  false
32
32
  );
33
- const animated = _KBNYGXWIcjs.defaultValue.call(void 0, props.animated, syncState == null ? void 0 : syncState.animated, false);
33
+ const animated = _EEDWPDM2cjs.defaultValue.call(void 0, props.animated, syncState == null ? void 0 : syncState.animated, false);
34
34
  const initialState = {
35
35
  open,
36
36
  animated,
37
37
  animating: !!animated && open,
38
38
  mounted: open,
39
- contentElement: _KBNYGXWIcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.contentElement, null),
40
- disclosureElement: _KBNYGXWIcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.disclosureElement, null)
39
+ contentElement: _EEDWPDM2cjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.contentElement, null),
40
+ disclosureElement: _EEDWPDM2cjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.disclosureElement, null)
41
41
  };
42
- const disclosure = _F6HPKLO2cjs.createStore.call(void 0, initialState, store);
43
- _F6HPKLO2cjs.setup.call(void 0,
42
+ const disclosure = _B4LYZ4EMcjs.createStore.call(void 0, initialState, store);
43
+ _B4LYZ4EMcjs.setup.call(void 0,
44
44
  disclosure,
45
- () => _F6HPKLO2cjs.sync.call(void 0, disclosure, ["animated", "animating"], (state) => {
45
+ () => _B4LYZ4EMcjs.sync.call(void 0, disclosure, ["animated", "animating"], (state) => {
46
46
  if (state.animated)
47
47
  return;
48
48
  disclosure.setState("animating", false);
49
49
  })
50
50
  );
51
- _F6HPKLO2cjs.setup.call(void 0,
51
+ _B4LYZ4EMcjs.setup.call(void 0,
52
52
  disclosure,
53
- () => _F6HPKLO2cjs.subscribe.call(void 0, disclosure, ["open"], () => {
53
+ () => _B4LYZ4EMcjs.subscribe.call(void 0, disclosure, ["open"], () => {
54
54
  if (!disclosure.getState().animated)
55
55
  return;
56
56
  disclosure.setState("animating", true);
57
57
  })
58
58
  );
59
- _F6HPKLO2cjs.setup.call(void 0,
59
+ _B4LYZ4EMcjs.setup.call(void 0,
60
60
  disclosure,
61
- () => _F6HPKLO2cjs.sync.call(void 0, disclosure, ["open", "animating"], (state) => {
61
+ () => _B4LYZ4EMcjs.sync.call(void 0, disclosure, ["open", "animating"], (state) => {
62
62
  disclosure.setState("mounted", state.open || state.animating);
63
63
  })
64
64
  );
65
65
  return _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, disclosure), {
66
+ disclosure: props.disclosure,
66
67
  setOpen: (value) => disclosure.setState("open", value),
67
68
  show: () => disclosure.setState("open", true),
68
69
  hide: () => disclosure.setState("open", false),
@@ -8,7 +8,7 @@
8
8
 
9
9
 
10
10
 
11
- var _KBNYGXWIcjs = require('./KBNYGXWI.cjs');
11
+ var _EEDWPDM2cjs = require('./EEDWPDM2.cjs');
12
12
 
13
13
 
14
14
 
@@ -17,14 +17,14 @@ var _AV6KTKLEcjs = require('./AV6KTKLE.cjs');
17
17
  // src/utils/store.ts
18
18
  function getInternal(store, key) {
19
19
  const internals = store.__unstableInternals;
20
- _KBNYGXWIcjs.invariant.call(void 0, internals, "Invalid store");
20
+ _EEDWPDM2cjs.invariant.call(void 0, internals, "Invalid store");
21
21
  return internals[key];
22
22
  }
23
23
  function createStore(initialState, ...stores) {
24
24
  let state = initialState;
25
25
  let prevStateBatch = state;
26
26
  let lastUpdate = Symbol();
27
- let destroy = _KBNYGXWIcjs.noop;
27
+ let destroy = _EEDWPDM2cjs.noop;
28
28
  const instances = /* @__PURE__ */ new Set();
29
29
  const updatedKeys = /* @__PURE__ */ new Set();
30
30
  const setups = /* @__PURE__ */ new Set();
@@ -48,14 +48,14 @@ function createStore(initialState, ...stores) {
48
48
  };
49
49
  if (initialized)
50
50
  return maybeDestroy;
51
- const desyncs = _KBNYGXWIcjs.getKeys.call(void 0, state).map(
52
- (key) => _KBNYGXWIcjs.chain.call(void 0,
51
+ const desyncs = _EEDWPDM2cjs.getKeys.call(void 0, state).map(
52
+ (key) => _EEDWPDM2cjs.chain.call(void 0,
53
53
  ...stores.map((store) => {
54
54
  var _a;
55
55
  const storeState = (_a = store == null ? void 0 : store.getState) == null ? void 0 : _a.call(store);
56
56
  if (!storeState)
57
57
  return;
58
- if (!_KBNYGXWIcjs.hasOwnProperty.call(void 0, storeState, key))
58
+ if (!_EEDWPDM2cjs.hasOwnProperty.call(void 0, storeState, key))
59
59
  return;
60
60
  return sync(store, [key], (state2) => {
61
61
  setState(
@@ -72,7 +72,7 @@ function createStore(initialState, ...stores) {
72
72
  const teardowns = [];
73
73
  setups.forEach((setup2) => teardowns.push(setup2()));
74
74
  const cleanups = stores.map(init);
75
- destroy = _KBNYGXWIcjs.chain.call(void 0, ...desyncs, ...teardowns, ...cleanups);
75
+ destroy = _EEDWPDM2cjs.chain.call(void 0, ...desyncs, ...teardowns, ...cleanups);
76
76
  return maybeDestroy;
77
77
  };
78
78
  const sub = (keys, listener, set = listeners) => {
@@ -95,13 +95,13 @@ function createStore(initialState, ...stores) {
95
95
  disposables.set(listener, listener(state, prevStateBatch));
96
96
  return sub(keys, listener, batchListeners);
97
97
  };
98
- const storePick = (keys) => createStore(_KBNYGXWIcjs.pick.call(void 0, state, keys), finalStore);
99
- const storeOmit = (keys) => createStore(_KBNYGXWIcjs.omit.call(void 0, state, keys), finalStore);
98
+ const storePick = (keys) => createStore(_EEDWPDM2cjs.pick.call(void 0, state, keys), finalStore);
99
+ const storeOmit = (keys) => createStore(_EEDWPDM2cjs.omit.call(void 0, state, keys), finalStore);
100
100
  const getState = () => state;
101
101
  const setState = (key, value, fromStores = false) => {
102
- if (!_KBNYGXWIcjs.hasOwnProperty.call(void 0, state, key))
102
+ if (!_EEDWPDM2cjs.hasOwnProperty.call(void 0, state, key))
103
103
  return;
104
- const nextValue = _KBNYGXWIcjs.applyState.call(void 0, value, state[key]);
104
+ const nextValue = _EEDWPDM2cjs.applyState.call(void 0, value, state[key]);
105
105
  if (nextValue === state[key])
106
106
  return;
107
107
  if (!fromStores) {
@@ -213,7 +213,7 @@ function throwOnConflictingProps(props, store) {
213
213
  return;
214
214
  const storeState = store.getState();
215
215
  const conflictingProps = defaultKeys.filter(
216
- (key) => _KBNYGXWIcjs.hasOwnProperty.call(void 0, storeState, key)
216
+ (key) => _EEDWPDM2cjs.hasOwnProperty.call(void 0, storeState, key)
217
217
  );
218
218
  if (!conflictingProps.length)
219
219
  return;
@@ -133,6 +133,15 @@ function isFalsyBooleanCallback(booleanOrCallback, ...args) {
133
133
  function disabledFromProps(props) {
134
134
  return props.disabled || props["aria-disabled"] === true || props["aria-disabled"] === "true";
135
135
  }
136
+ function removeUndefinedValues(obj) {
137
+ const result = {};
138
+ for (const key in obj) {
139
+ if (obj[key] !== void 0) {
140
+ result[key] = obj[key];
141
+ }
142
+ }
143
+ return result;
144
+ }
136
145
  function defaultValue(...values) {
137
146
  for (const value of values) {
138
147
  if (value !== void 0)
@@ -162,4 +171,5 @@ function defaultValue(...values) {
162
171
 
163
172
 
164
173
 
165
- exports.noop = noop; exports.shallowEqual = shallowEqual; exports.applyState = applyState; exports.isObject = isObject; exports.isEmpty = isEmpty; exports.isInteger = isInteger; exports.hasOwnProperty = hasOwnProperty; exports.chain = chain; exports.cx = cx; exports.normalizeString = normalizeString; exports.omit = omit; exports.pick = pick; exports.identity = identity; exports.beforePaint = beforePaint; exports.afterPaint = afterPaint; exports.invariant = invariant; exports.getKeys = getKeys; exports.isFalsyBooleanCallback = isFalsyBooleanCallback; exports.disabledFromProps = disabledFromProps; exports.defaultValue = defaultValue;
174
+
175
+ exports.noop = noop; exports.shallowEqual = shallowEqual; exports.applyState = applyState; exports.isObject = isObject; exports.isEmpty = isEmpty; exports.isInteger = isInteger; exports.hasOwnProperty = hasOwnProperty; exports.chain = chain; exports.cx = cx; exports.normalizeString = normalizeString; exports.omit = omit; exports.pick = pick; exports.identity = identity; exports.beforePaint = beforePaint; exports.afterPaint = afterPaint; exports.invariant = invariant; exports.getKeys = getKeys; exports.isFalsyBooleanCallback = isFalsyBooleanCallback; exports.disabledFromProps = disabledFromProps; exports.removeUndefinedValues = removeUndefinedValues; exports.defaultValue = defaultValue;
@@ -5,14 +5,14 @@
5
5
 
6
6
 
7
7
 
8
- var _F6HPKLO2cjs = require('./F6HPKLO2.cjs');
8
+ var _B4LYZ4EMcjs = require('./B4LYZ4EM.cjs');
9
9
 
10
10
 
11
11
 
12
- var _KBNYGXWIcjs = require('./KBNYGXWI.cjs');
12
+ var _EEDWPDM2cjs = require('./EEDWPDM2.cjs');
13
13
 
14
14
 
15
- var _5F4DVUNScjs = require('./5F4DVUNS.cjs');
15
+ var _UKR6TQI3cjs = require('./UKR6TQI3.cjs');
16
16
 
17
17
 
18
18
 
@@ -62,16 +62,16 @@ function getCommonParent(items) {
62
62
  }
63
63
  parentElement = parentElement.parentElement;
64
64
  }
65
- return _5F4DVUNScjs.getDocument.call(void 0, parentElement).body;
65
+ return _UKR6TQI3cjs.getDocument.call(void 0, parentElement).body;
66
66
  }
67
67
  function getPrivateStore(store) {
68
68
  return store == null ? void 0 : store.__unstablePrivateStore;
69
69
  }
70
70
  function createCollectionStore(props = {}) {
71
71
  var _a;
72
- _F6HPKLO2cjs.throwOnConflictingProps.call(void 0, props, props.store);
72
+ _B4LYZ4EMcjs.throwOnConflictingProps.call(void 0, props, props.store);
73
73
  const syncState = (_a = props.store) == null ? void 0 : _a.getState();
74
- const items = _KBNYGXWIcjs.defaultValue.call(void 0,
74
+ const items = _EEDWPDM2cjs.defaultValue.call(void 0,
75
75
  props.items,
76
76
  syncState == null ? void 0 : syncState.items,
77
77
  props.defaultItems,
@@ -80,27 +80,27 @@ function createCollectionStore(props = {}) {
80
80
  const itemsMap = new Map(items.map((item) => [item.id, item]));
81
81
  const initialState = {
82
82
  items,
83
- renderedItems: _KBNYGXWIcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.renderedItems, [])
83
+ renderedItems: _EEDWPDM2cjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.renderedItems, [])
84
84
  };
85
85
  const syncPrivateStore = getPrivateStore(props.store);
86
- const privateStore = _F6HPKLO2cjs.createStore.call(void 0,
86
+ const privateStore = _B4LYZ4EMcjs.createStore.call(void 0,
87
87
  { items, renderedItems: initialState.renderedItems },
88
88
  syncPrivateStore
89
89
  );
90
- const collection = _F6HPKLO2cjs.createStore.call(void 0, initialState, props.store);
90
+ const collection = _B4LYZ4EMcjs.createStore.call(void 0, initialState, props.store);
91
91
  const sortItems = (renderedItems) => {
92
92
  const sortedItems = sortBasedOnDOMPosition(renderedItems);
93
93
  privateStore.setState("renderedItems", sortedItems);
94
94
  collection.setState("renderedItems", sortedItems);
95
95
  };
96
- _F6HPKLO2cjs.setup.call(void 0, collection, () => _F6HPKLO2cjs.init.call(void 0, privateStore));
97
- _F6HPKLO2cjs.setup.call(void 0, privateStore, () => {
98
- return _F6HPKLO2cjs.batch.call(void 0, privateStore, ["items"], (state) => {
96
+ _B4LYZ4EMcjs.setup.call(void 0, collection, () => _B4LYZ4EMcjs.init.call(void 0, privateStore));
97
+ _B4LYZ4EMcjs.setup.call(void 0, privateStore, () => {
98
+ return _B4LYZ4EMcjs.batch.call(void 0, privateStore, ["items"], (state) => {
99
99
  collection.setState("items", state.items);
100
100
  });
101
101
  });
102
- _F6HPKLO2cjs.setup.call(void 0, privateStore, () => {
103
- return _F6HPKLO2cjs.batch.call(void 0, privateStore, ["renderedItems"], (state) => {
102
+ _B4LYZ4EMcjs.setup.call(void 0, privateStore, () => {
103
+ return _B4LYZ4EMcjs.batch.call(void 0, privateStore, ["renderedItems"], (state) => {
104
104
  let firstRun = true;
105
105
  let raf = requestAnimationFrame(() => {
106
106
  const { renderedItems } = collection.getState();
@@ -174,7 +174,7 @@ function createCollectionStore(props = {}) {
174
174
  );
175
175
  return _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, collection), {
176
176
  registerItem,
177
- renderItem: (item) => _KBNYGXWIcjs.chain.call(void 0,
177
+ renderItem: (item) => _EEDWPDM2cjs.chain.call(void 0,
178
178
  registerItem(item),
179
179
  mergeItem(
180
180
  item,
@@ -1,11 +1,11 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _OTVLDMN2cjs = require('./OTVLDMN2.cjs');
4
+ var _AETQC2ARcjs = require('./AETQC2AR.cjs');
5
5
 
6
6
  // src/dialog/dialog-store.ts
7
7
  function createDialogStore(props = {}) {
8
- return _OTVLDMN2cjs.createDisclosureStore.call(void 0, props);
8
+ return _AETQC2ARcjs.createDisclosureStore.call(void 0, props);
9
9
  }
10
10
 
11
11
 
@@ -1,13 +1,13 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _BFE5R4EZcjs = require('./BFE5R4EZ.cjs');
4
+ var _Y7KNI5NScjs = require('./Y7KNI5NS.cjs');
5
5
 
6
6
 
7
- var _F6HPKLO2cjs = require('./F6HPKLO2.cjs');
7
+ var _B4LYZ4EMcjs = require('./B4LYZ4EM.cjs');
8
8
 
9
9
 
10
- var _KBNYGXWIcjs = require('./KBNYGXWI.cjs');
10
+ var _EEDWPDM2cjs = require('./EEDWPDM2.cjs');
11
11
 
12
12
 
13
13
 
@@ -17,16 +17,16 @@ var _AV6KTKLEcjs = require('./AV6KTKLE.cjs');
17
17
  function createMenubarStore(props = {}) {
18
18
  var _a;
19
19
  const syncState = (_a = props.store) == null ? void 0 : _a.getState();
20
- const composite = _BFE5R4EZcjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
21
- orientation: _KBNYGXWIcjs.defaultValue.call(void 0,
20
+ const composite = _Y7KNI5NScjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
21
+ orientation: _EEDWPDM2cjs.defaultValue.call(void 0,
22
22
  props.orientation,
23
23
  syncState == null ? void 0 : syncState.orientation,
24
24
  "horizontal"
25
25
  ),
26
- focusLoop: _KBNYGXWIcjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true)
26
+ focusLoop: _EEDWPDM2cjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true)
27
27
  }));
28
28
  const initialState = _AV6KTKLEcjs.__spreadValues.call(void 0, {}, composite.getState());
29
- const menubar = _F6HPKLO2cjs.createStore.call(void 0, initialState, composite, props.store);
29
+ const menubar = _B4LYZ4EMcjs.createStore.call(void 0, initialState, composite, props.store);
30
30
  return _AV6KTKLEcjs.__spreadValues.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, composite), menubar);
31
31
  }
32
32
 
@@ -1,13 +1,13 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _E53JW5BDcjs = require('./E53JW5BD.cjs');
4
+ var _5JEQEZFRcjs = require('./5JEQEZFR.cjs');
5
5
 
6
6
 
7
- var _F6HPKLO2cjs = require('./F6HPKLO2.cjs');
7
+ var _B4LYZ4EMcjs = require('./B4LYZ4EM.cjs');
8
8
 
9
9
 
10
- var _KBNYGXWIcjs = require('./KBNYGXWI.cjs');
10
+ var _EEDWPDM2cjs = require('./EEDWPDM2.cjs');
11
11
 
12
12
 
13
13
 
@@ -17,21 +17,21 @@ var _AV6KTKLEcjs = require('./AV6KTKLE.cjs');
17
17
  function createHovercardStore(props = {}) {
18
18
  var _a;
19
19
  const syncState = (_a = props.store) == null ? void 0 : _a.getState();
20
- const popover = _E53JW5BDcjs.createPopoverStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
21
- placement: _KBNYGXWIcjs.defaultValue.call(void 0,
20
+ const popover = _5JEQEZFRcjs.createPopoverStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
21
+ placement: _EEDWPDM2cjs.defaultValue.call(void 0,
22
22
  props.placement,
23
23
  syncState == null ? void 0 : syncState.placement,
24
24
  "bottom"
25
25
  )
26
26
  }));
27
- const timeout = _KBNYGXWIcjs.defaultValue.call(void 0, props.timeout, syncState == null ? void 0 : syncState.timeout, 500);
27
+ const timeout = _EEDWPDM2cjs.defaultValue.call(void 0, props.timeout, syncState == null ? void 0 : syncState.timeout, 500);
28
28
  const initialState = _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, popover.getState()), {
29
29
  timeout,
30
- showTimeout: _KBNYGXWIcjs.defaultValue.call(void 0, props.showTimeout, syncState == null ? void 0 : syncState.showTimeout),
31
- hideTimeout: _KBNYGXWIcjs.defaultValue.call(void 0, props.hideTimeout, syncState == null ? void 0 : syncState.hideTimeout),
32
- autoFocusOnShow: _KBNYGXWIcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.autoFocusOnShow, false)
30
+ showTimeout: _EEDWPDM2cjs.defaultValue.call(void 0, props.showTimeout, syncState == null ? void 0 : syncState.showTimeout),
31
+ hideTimeout: _EEDWPDM2cjs.defaultValue.call(void 0, props.hideTimeout, syncState == null ? void 0 : syncState.hideTimeout),
32
+ autoFocusOnShow: _EEDWPDM2cjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.autoFocusOnShow, false)
33
33
  });
34
- const hovercard = _F6HPKLO2cjs.createStore.call(void 0, initialState, popover, props.store);
34
+ const hovercard = _B4LYZ4EMcjs.createStore.call(void 0, initialState, popover, props.store);
35
35
  return _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, popover), hovercard), {
36
36
  setAutoFocusOnShow: (value) => hovercard.setState("autoFocusOnShow", value)
37
37
  });
@@ -102,8 +102,7 @@ function getPopupItemRole(element, fallback) {
102
102
  const itemRoleByPopupRole = {
103
103
  menu: "menuitem",
104
104
  listbox: "option",
105
- tree: "treeitem",
106
- grid: "gridcell"
105
+ tree: "treeitem"
107
106
  };
108
107
  const popupRole = getPopupRole(element);
109
108
  if (!popupRole)
@@ -1,15 +1,15 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _MI6NUQYQcjs = require('./MI6NUQYQ.cjs');
4
+ var _FFZYCAXAcjs = require('./FFZYCAXA.cjs');
5
5
 
6
6
 
7
7
 
8
8
 
9
- var _F6HPKLO2cjs = require('./F6HPKLO2.cjs');
9
+ var _B4LYZ4EMcjs = require('./B4LYZ4EM.cjs');
10
10
 
11
11
 
12
- var _KBNYGXWIcjs = require('./KBNYGXWI.cjs');
12
+ var _EEDWPDM2cjs = require('./EEDWPDM2.cjs');
13
13
 
14
14
 
15
15
 
@@ -124,40 +124,40 @@ function verticalizeItems(items) {
124
124
  function createCompositeStore(props = {}) {
125
125
  var _a;
126
126
  const syncState = (_a = props.store) == null ? void 0 : _a.getState();
127
- const collection = _MI6NUQYQcjs.createCollectionStore.call(void 0, props);
128
- const activeId = _KBNYGXWIcjs.defaultValue.call(void 0,
127
+ const collection = _FFZYCAXAcjs.createCollectionStore.call(void 0, props);
128
+ const activeId = _EEDWPDM2cjs.defaultValue.call(void 0,
129
129
  props.activeId,
130
130
  syncState == null ? void 0 : syncState.activeId,
131
131
  props.defaultActiveId
132
132
  );
133
133
  const initialState = _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, collection.getState()), {
134
134
  activeId,
135
- baseElement: _KBNYGXWIcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.baseElement, null),
136
- includesBaseElement: _KBNYGXWIcjs.defaultValue.call(void 0,
135
+ baseElement: _EEDWPDM2cjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.baseElement, null),
136
+ includesBaseElement: _EEDWPDM2cjs.defaultValue.call(void 0,
137
137
  props.includesBaseElement,
138
138
  syncState == null ? void 0 : syncState.includesBaseElement,
139
139
  activeId === null
140
140
  ),
141
- moves: _KBNYGXWIcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.moves, 0),
142
- orientation: _KBNYGXWIcjs.defaultValue.call(void 0,
141
+ moves: _EEDWPDM2cjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.moves, 0),
142
+ orientation: _EEDWPDM2cjs.defaultValue.call(void 0,
143
143
  props.orientation,
144
144
  syncState == null ? void 0 : syncState.orientation,
145
145
  "both"
146
146
  ),
147
- rtl: _KBNYGXWIcjs.defaultValue.call(void 0, props.rtl, syncState == null ? void 0 : syncState.rtl, false),
148
- virtualFocus: _KBNYGXWIcjs.defaultValue.call(void 0,
147
+ rtl: _EEDWPDM2cjs.defaultValue.call(void 0, props.rtl, syncState == null ? void 0 : syncState.rtl, false),
148
+ virtualFocus: _EEDWPDM2cjs.defaultValue.call(void 0,
149
149
  props.virtualFocus,
150
150
  syncState == null ? void 0 : syncState.virtualFocus,
151
151
  false
152
152
  ),
153
- focusLoop: _KBNYGXWIcjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, false),
154
- focusWrap: _KBNYGXWIcjs.defaultValue.call(void 0, props.focusWrap, syncState == null ? void 0 : syncState.focusWrap, false),
155
- focusShift: _KBNYGXWIcjs.defaultValue.call(void 0, props.focusShift, syncState == null ? void 0 : syncState.focusShift, false)
153
+ focusLoop: _EEDWPDM2cjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, false),
154
+ focusWrap: _EEDWPDM2cjs.defaultValue.call(void 0, props.focusWrap, syncState == null ? void 0 : syncState.focusWrap, false),
155
+ focusShift: _EEDWPDM2cjs.defaultValue.call(void 0, props.focusShift, syncState == null ? void 0 : syncState.focusShift, false)
156
156
  });
157
- const composite = _F6HPKLO2cjs.createStore.call(void 0, initialState, collection, props.store);
158
- _F6HPKLO2cjs.setup.call(void 0,
157
+ const composite = _B4LYZ4EMcjs.createStore.call(void 0, initialState, collection, props.store);
158
+ _B4LYZ4EMcjs.setup.call(void 0,
159
159
  composite,
160
- () => _F6HPKLO2cjs.sync.call(void 0, composite, ["renderedItems", "activeId"], (state) => {
160
+ () => _B4LYZ4EMcjs.sync.call(void 0, composite, ["renderedItems", "activeId"], (state) => {
161
161
  composite.setState("activeId", (activeId2) => {
162
162
  var _a2;
163
163
  if (activeId2 !== void 0)
@@ -2,10 +2,10 @@
2
2
 
3
3
 
4
4
 
5
- var _F6HPKLO2cjs = require('../__chunks/F6HPKLO2.cjs');
5
+ var _B4LYZ4EMcjs = require('../__chunks/B4LYZ4EM.cjs');
6
6
 
7
7
 
8
- var _KBNYGXWIcjs = require('../__chunks/KBNYGXWI.cjs');
8
+ var _EEDWPDM2cjs = require('../__chunks/EEDWPDM2.cjs');
9
9
 
10
10
 
11
11
 
@@ -14,17 +14,17 @@ var _AV6KTKLEcjs = require('../__chunks/AV6KTKLE.cjs');
14
14
  // src/checkbox/checkbox-store.ts
15
15
  function createCheckboxStore(props = {}) {
16
16
  var _a;
17
- _F6HPKLO2cjs.throwOnConflictingProps.call(void 0, props, props.store);
17
+ _B4LYZ4EMcjs.throwOnConflictingProps.call(void 0, props, props.store);
18
18
  const syncState = (_a = props.store) == null ? void 0 : _a.getState();
19
19
  const initialState = {
20
- value: _KBNYGXWIcjs.defaultValue.call(void 0,
20
+ value: _EEDWPDM2cjs.defaultValue.call(void 0,
21
21
  props.value,
22
22
  syncState == null ? void 0 : syncState.value,
23
23
  props.defaultValue,
24
24
  false
25
25
  )
26
26
  };
27
- const checkbox = _F6HPKLO2cjs.createStore.call(void 0, initialState, props.store);
27
+ const checkbox = _B4LYZ4EMcjs.createStore.call(void 0, initialState, props.store);
28
28
  return _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, checkbox), {
29
29
  setValue: (value) => checkbox.setState("value", value)
30
30
  });