@ariakit/core 0.4.16 → 0.4.18

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 (85) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/cjs/__chunks/{VZPNI7C2.cjs → 4ITB54IT.cjs} +2 -1
  3. package/cjs/__chunks/{MLCPLY2P.cjs → 6BYUUR4M.cjs} +2 -6
  4. package/cjs/__chunks/AOXAROPF.cjs +59 -0
  5. package/cjs/__chunks/{E5AYFGW2.cjs → HGVIF2R4.cjs} +20 -23
  6. package/cjs/__chunks/JNPL5IHP.cjs +36 -0
  7. package/cjs/__chunks/{6REHCF5T.cjs → JNYCP2QO.cjs} +6 -6
  8. package/cjs/__chunks/{L5GSFUJU.cjs → MJNGPYVQ.cjs} +19 -22
  9. package/cjs/__chunks/{7WVAUIME.cjs → OYTZFOIJ.cjs} +28 -28
  10. package/cjs/__chunks/{VR2FVDSU.cjs → T247D7JS.cjs} +2 -2
  11. package/cjs/__chunks/UROTDZFK.cjs +41 -0
  12. package/cjs/__chunks/{EKSEHA55.cjs → WPBYRKFQ.cjs} +13 -17
  13. package/cjs/checkbox/checkbox-store.cjs +8 -11
  14. package/cjs/collection/collection-store.cjs +5 -6
  15. package/cjs/combobox/combobox-store.cjs +57 -57
  16. package/cjs/composite/composite-overflow-store.cjs +6 -7
  17. package/cjs/composite/composite-store.cjs +6 -7
  18. package/cjs/dialog/dialog-store.cjs +5 -6
  19. package/cjs/disclosure/disclosure-store.cjs +4 -5
  20. package/cjs/form/form-store.cjs +34 -35
  21. package/cjs/hovercard/hovercard-store.cjs +7 -8
  22. package/cjs/index.cjs +1 -3
  23. package/cjs/menu/menu-bar-store.cjs +7 -8
  24. package/cjs/menu/menu-store.cjs +49 -50
  25. package/cjs/menubar/menubar-store.cjs +7 -8
  26. package/cjs/popover/popover-store.cjs +6 -7
  27. package/cjs/radio/radio-store.cjs +23 -23
  28. package/cjs/select/select-store.cjs +49 -49
  29. package/cjs/tab/tab-store.cjs +47 -51
  30. package/cjs/tag/tag-store.cjs +21 -22
  31. package/cjs/toolbar/toolbar-store.cjs +10 -13
  32. package/cjs/tooltip/tooltip-store.cjs +20 -19
  33. package/cjs/utils/array.cjs +0 -1
  34. package/cjs/utils/dom.cjs +2 -3
  35. package/cjs/utils/events.cjs +7 -11
  36. package/cjs/utils/focus.cjs +24 -25
  37. package/cjs/utils/misc.cjs +2 -3
  38. package/cjs/utils/platform.cjs +3 -4
  39. package/cjs/utils/store.cjs +3 -4
  40. package/cjs/utils/undo.cjs +0 -1
  41. package/esm/__chunks/{37JWRFYW.js → 3DNM6L6E.js} +2 -1
  42. package/esm/__chunks/{43IPP2F4.js → 75BJEVSH.js} +5 -8
  43. package/esm/__chunks/{MD3RIO2T.js → BFGNM53A.js} +15 -19
  44. package/esm/__chunks/{RZDDWCDV.js → KMAUV3TY.js} +1 -1
  45. package/esm/__chunks/{K2KIGYQU.js → N5XGANPW.js} +7 -10
  46. package/esm/__chunks/{C34RJTDU.js → RVTIKFRL.js} +13 -13
  47. package/esm/__chunks/{O6E4ZWCP.js → SNHYQNEZ.js} +1 -1
  48. package/esm/__chunks/{EWA2WL6G.js → SXKM4CGU.js} +2 -6
  49. package/esm/__chunks/{X2ASWIQW.js → TIQDSBWP.js} +13 -13
  50. package/esm/__chunks/{76UM5ZLT.js → WSDJ6ZRB.js} +13 -11
  51. package/esm/__chunks/{PBFD2E7P.js → XMCVU3LR.js} +1 -4
  52. package/esm/checkbox/checkbox-store.js +5 -8
  53. package/esm/collection/collection-store.js +4 -5
  54. package/esm/combobox/combobox-store.js +28 -28
  55. package/esm/composite/composite-overflow-store.js +5 -6
  56. package/esm/composite/composite-store.js +5 -6
  57. package/esm/dialog/dialog-store.js +4 -5
  58. package/esm/disclosure/disclosure-store.js +3 -4
  59. package/esm/form/form-store.js +12 -13
  60. package/esm/hovercard/hovercard-store.js +6 -7
  61. package/esm/index.js +0 -1
  62. package/esm/menu/menu-bar-store.js +6 -7
  63. package/esm/menu/menu-store.js +33 -34
  64. package/esm/menubar/menubar-store.js +6 -7
  65. package/esm/popover/popover-store.js +5 -6
  66. package/esm/radio/radio-store.js +20 -20
  67. package/esm/select/select-store.js +27 -27
  68. package/esm/tab/tab-store.js +21 -25
  69. package/esm/tag/tag-store.js +12 -13
  70. package/esm/toolbar/toolbar-store.js +8 -11
  71. package/esm/tooltip/tooltip-store.js +16 -15
  72. package/esm/utils/array.js +0 -1
  73. package/esm/utils/dom.js +1 -2
  74. package/esm/utils/events.js +4 -8
  75. package/esm/utils/focus.js +17 -18
  76. package/esm/utils/misc.js +1 -2
  77. package/esm/utils/platform.js +2 -3
  78. package/esm/utils/store.js +2 -3
  79. package/esm/utils/undo.js +0 -1
  80. package/package.json +1 -1
  81. package/cjs/__chunks/34NK2NPD.cjs +0 -41
  82. package/cjs/__chunks/7EQBAZ46.cjs +0 -37
  83. package/cjs/__chunks/OGYYHXPP.cjs +0 -63
  84. package/cjs/__chunks/XVG7OFIP.cjs +0 -34
  85. package/esm/__chunks/3YLGPPWQ.js +0 -38
@@ -1,11 +1,11 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _7WVAUIMEcjs = require('../__chunks/7WVAUIME.cjs');
3
+ var _OYTZFOIJcjs = require('../__chunks/OYTZFOIJ.cjs');
4
4
  require('../__chunks/GDZQUFNP.cjs');
5
5
 
6
6
 
7
- var _E5AYFGW2cjs = require('../__chunks/E5AYFGW2.cjs');
8
- require('../__chunks/VZPNI7C2.cjs');
7
+ var _HGVIF2R4cjs = require('../__chunks/HGVIF2R4.cjs');
8
+ require('../__chunks/4ITB54IT.cjs');
9
9
 
10
10
 
11
11
 
@@ -13,26 +13,18 @@ require('../__chunks/VZPNI7C2.cjs');
13
13
 
14
14
 
15
15
 
16
- var _EKSEHA55cjs = require('../__chunks/EKSEHA55.cjs');
16
+ var _WPBYRKFQcjs = require('../__chunks/WPBYRKFQ.cjs');
17
17
 
18
18
 
19
19
 
20
- var _MLCPLY2Pcjs = require('../__chunks/MLCPLY2P.cjs');
21
-
22
-
23
-
24
-
25
- var _7EQBAZ46cjs = require('../__chunks/7EQBAZ46.cjs');
20
+ var _6BYUUR4Mcjs = require('../__chunks/6BYUUR4M.cjs');
26
21
 
27
22
  // src/tab/tab-store.ts
28
- function createTabStore(_a = {}) {
29
- var _b = _a, {
30
- composite: parentComposite,
31
- combobox
32
- } = _b, props = _7EQBAZ46cjs.__objRest.call(void 0, _b, [
33
- "composite",
34
- "combobox"
35
- ]);
23
+ function createTabStore({
24
+ composite: parentComposite,
25
+ combobox,
26
+ ...props
27
+ } = {}) {
36
28
  const independentKeys = [
37
29
  "items",
38
30
  "renderedItems",
@@ -45,47 +37,49 @@ function createTabStore(_a = {}) {
45
37
  "focusShift",
46
38
  "focusWrap"
47
39
  ];
48
- const store = _EKSEHA55cjs.mergeStore.call(void 0,
40
+ const store = _WPBYRKFQcjs.mergeStore.call(void 0,
49
41
  props.store,
50
- _EKSEHA55cjs.omit.call(void 0, parentComposite, independentKeys),
51
- _EKSEHA55cjs.omit.call(void 0, combobox, independentKeys)
42
+ _WPBYRKFQcjs.omit.call(void 0, parentComposite, independentKeys),
43
+ _WPBYRKFQcjs.omit.call(void 0, combobox, independentKeys)
52
44
  );
53
45
  const syncState = store == null ? void 0 : store.getState();
54
- const composite = _7WVAUIMEcjs.createCompositeStore.call(void 0, _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, props), {
46
+ const composite = _OYTZFOIJcjs.createCompositeStore.call(void 0, {
47
+ ...props,
55
48
  store,
56
49
  // We need to explicitly set the default value of `includesBaseElement` to
57
50
  // `false` since we don't want the composite store to default it to `true`
58
51
  // when the activeId state is null, which could be the case when rendering
59
52
  // combobox with tab.
60
- includesBaseElement: _MLCPLY2Pcjs.defaultValue.call(void 0,
53
+ includesBaseElement: _6BYUUR4Mcjs.defaultValue.call(void 0,
61
54
  props.includesBaseElement,
62
55
  syncState == null ? void 0 : syncState.includesBaseElement,
63
56
  false
64
57
  ),
65
- orientation: _MLCPLY2Pcjs.defaultValue.call(void 0,
58
+ orientation: _6BYUUR4Mcjs.defaultValue.call(void 0,
66
59
  props.orientation,
67
60
  syncState == null ? void 0 : syncState.orientation,
68
61
  "horizontal"
69
62
  ),
70
- focusLoop: _MLCPLY2Pcjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true)
71
- }));
72
- const panels = _E5AYFGW2cjs.createCollectionStore.call(void 0, );
73
- const initialState = _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, composite.getState()), {
74
- selectedId: _MLCPLY2Pcjs.defaultValue.call(void 0,
63
+ focusLoop: _6BYUUR4Mcjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true)
64
+ });
65
+ const panels = _HGVIF2R4cjs.createCollectionStore.call(void 0, );
66
+ const initialState = {
67
+ ...composite.getState(),
68
+ selectedId: _6BYUUR4Mcjs.defaultValue.call(void 0,
75
69
  props.selectedId,
76
70
  syncState == null ? void 0 : syncState.selectedId,
77
71
  props.defaultSelectedId
78
72
  ),
79
- selectOnMove: _MLCPLY2Pcjs.defaultValue.call(void 0,
73
+ selectOnMove: _6BYUUR4Mcjs.defaultValue.call(void 0,
80
74
  props.selectOnMove,
81
75
  syncState == null ? void 0 : syncState.selectOnMove,
82
76
  true
83
77
  )
84
- });
85
- const tab = _EKSEHA55cjs.createStore.call(void 0, initialState, composite, store);
86
- _EKSEHA55cjs.setup.call(void 0,
78
+ };
79
+ const tab = _WPBYRKFQcjs.createStore.call(void 0, initialState, composite, store);
80
+ _WPBYRKFQcjs.setup.call(void 0,
87
81
  tab,
88
- () => _EKSEHA55cjs.sync.call(void 0, tab, ["moves"], () => {
82
+ () => _WPBYRKFQcjs.sync.call(void 0, tab, ["moves"], () => {
89
83
  const { activeId, selectOnMove } = tab.getState();
90
84
  if (!selectOnMove) return;
91
85
  if (!activeId) return;
@@ -97,9 +91,9 @@ function createTabStore(_a = {}) {
97
91
  })
98
92
  );
99
93
  let syncActiveId = true;
100
- _EKSEHA55cjs.setup.call(void 0,
94
+ _WPBYRKFQcjs.setup.call(void 0,
101
95
  tab,
102
- () => _EKSEHA55cjs.batch.call(void 0, tab, ["selectedId"], (state, prev) => {
96
+ () => _WPBYRKFQcjs.batch.call(void 0, tab, ["selectedId"], (state, prev) => {
103
97
  if (!syncActiveId) {
104
98
  syncActiveId = true;
105
99
  return;
@@ -108,9 +102,9 @@ function createTabStore(_a = {}) {
108
102
  tab.setState("activeId", state.selectedId);
109
103
  })
110
104
  );
111
- _EKSEHA55cjs.setup.call(void 0,
105
+ _WPBYRKFQcjs.setup.call(void 0,
112
106
  tab,
113
- () => _EKSEHA55cjs.sync.call(void 0, tab, ["selectedId", "renderedItems"], (state) => {
107
+ () => _WPBYRKFQcjs.sync.call(void 0, tab, ["selectedId", "renderedItems"], (state) => {
114
108
  if (state.selectedId !== void 0) return;
115
109
  const { activeId, renderedItems } = tab.getState();
116
110
  const tabItem = composite.item(activeId);
@@ -124,12 +118,12 @@ function createTabStore(_a = {}) {
124
118
  }
125
119
  })
126
120
  );
127
- _EKSEHA55cjs.setup.call(void 0,
121
+ _WPBYRKFQcjs.setup.call(void 0,
128
122
  tab,
129
- () => _EKSEHA55cjs.sync.call(void 0, tab, ["renderedItems"], (state) => {
123
+ () => _WPBYRKFQcjs.sync.call(void 0, tab, ["renderedItems"], (state) => {
130
124
  const tabs = state.renderedItems;
131
125
  if (!tabs.length) return;
132
- return _EKSEHA55cjs.sync.call(void 0, panels, ["renderedItems"], (state2) => {
126
+ return _WPBYRKFQcjs.sync.call(void 0, panels, ["renderedItems"], (state2) => {
133
127
  const items = state2.renderedItems;
134
128
  const hasOrphanPanels = items.some((panel) => !panel.tabId);
135
129
  if (!hasOrphanPanels) return;
@@ -137,13 +131,13 @@ function createTabStore(_a = {}) {
137
131
  if (panel.tabId) return;
138
132
  const tabItem = tabs[i];
139
133
  if (!tabItem) return;
140
- panels.renderItem(_7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, panel), { tabId: tabItem.id }));
134
+ panels.renderItem({ ...panel, tabId: tabItem.id });
141
135
  });
142
136
  });
143
137
  })
144
138
  );
145
139
  let selectedIdFromSelectedValue = null;
146
- _EKSEHA55cjs.setup.call(void 0, tab, () => {
140
+ _WPBYRKFQcjs.setup.call(void 0, tab, () => {
147
141
  const backupSelectedId = () => {
148
142
  selectedIdFromSelectedValue = tab.getState().selectedId;
149
143
  };
@@ -152,25 +146,27 @@ function createTabStore(_a = {}) {
152
146
  tab.setState("selectedId", selectedIdFromSelectedValue);
153
147
  };
154
148
  if (parentComposite && "setSelectElement" in parentComposite) {
155
- return _MLCPLY2Pcjs.chain.call(void 0,
156
- _EKSEHA55cjs.sync.call(void 0, parentComposite, ["value"], backupSelectedId),
157
- _EKSEHA55cjs.sync.call(void 0, parentComposite, ["mounted"], restoreSelectedId)
149
+ return _6BYUUR4Mcjs.chain.call(void 0,
150
+ _WPBYRKFQcjs.sync.call(void 0, parentComposite, ["value"], backupSelectedId),
151
+ _WPBYRKFQcjs.sync.call(void 0, parentComposite, ["mounted"], restoreSelectedId)
158
152
  );
159
153
  }
160
154
  if (!combobox) return;
161
- return _MLCPLY2Pcjs.chain.call(void 0,
162
- _EKSEHA55cjs.sync.call(void 0, combobox, ["selectedValue"], backupSelectedId),
163
- _EKSEHA55cjs.sync.call(void 0, combobox, ["mounted"], restoreSelectedId)
155
+ return _6BYUUR4Mcjs.chain.call(void 0,
156
+ _WPBYRKFQcjs.sync.call(void 0, combobox, ["selectedValue"], backupSelectedId),
157
+ _WPBYRKFQcjs.sync.call(void 0, combobox, ["mounted"], restoreSelectedId)
164
158
  );
165
159
  });
166
- return _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, composite), tab), {
160
+ return {
161
+ ...composite,
162
+ ...tab,
167
163
  panels,
168
164
  setSelectedId: (id) => tab.setState("selectedId", id),
169
165
  select: (id) => {
170
166
  tab.setState("selectedId", id);
171
167
  composite.move(id);
172
168
  }
173
- });
169
+ };
174
170
  }
175
171
 
176
172
 
@@ -3,44 +3,41 @@
3
3
  var _SHOLYDNPcjs = require('../__chunks/SHOLYDNP.cjs');
4
4
 
5
5
 
6
- var _7WVAUIMEcjs = require('../__chunks/7WVAUIME.cjs');
6
+ var _OYTZFOIJcjs = require('../__chunks/OYTZFOIJ.cjs');
7
7
  require('../__chunks/GDZQUFNP.cjs');
8
- require('../__chunks/E5AYFGW2.cjs');
9
- require('../__chunks/VZPNI7C2.cjs');
8
+ require('../__chunks/HGVIF2R4.cjs');
9
+ require('../__chunks/4ITB54IT.cjs');
10
10
 
11
11
 
12
12
 
13
13
 
14
- var _EKSEHA55cjs = require('../__chunks/EKSEHA55.cjs');
14
+ var _WPBYRKFQcjs = require('../__chunks/WPBYRKFQ.cjs');
15
15
 
16
16
 
17
17
 
18
- var _MLCPLY2Pcjs = require('../__chunks/MLCPLY2P.cjs');
19
-
20
-
21
-
22
- var _7EQBAZ46cjs = require('../__chunks/7EQBAZ46.cjs');
18
+ var _6BYUUR4Mcjs = require('../__chunks/6BYUUR4M.cjs');
23
19
 
24
20
  // src/tag/tag-store.ts
25
21
  function createTagStore(props = {}) {
26
22
  var _a;
27
23
  const syncState = (_a = props.store) == null ? void 0 : _a.getState();
28
- const composite = _7WVAUIMEcjs.createCompositeStore.call(void 0, props);
29
- const initialState = _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, composite.getState()), {
30
- inputElement: _MLCPLY2Pcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.inputElement, null),
31
- labelElement: _MLCPLY2Pcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.labelElement, null),
32
- value: _MLCPLY2Pcjs.defaultValue.call(void 0, props.value, syncState == null ? void 0 : syncState.value, props.defaultValue, ""),
33
- values: _MLCPLY2Pcjs.defaultValue.call(void 0,
24
+ const composite = _OYTZFOIJcjs.createCompositeStore.call(void 0, props);
25
+ const initialState = {
26
+ ...composite.getState(),
27
+ inputElement: _6BYUUR4Mcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.inputElement, null),
28
+ labelElement: _6BYUUR4Mcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.labelElement, null),
29
+ value: _6BYUUR4Mcjs.defaultValue.call(void 0, props.value, syncState == null ? void 0 : syncState.value, props.defaultValue, ""),
30
+ values: _6BYUUR4Mcjs.defaultValue.call(void 0,
34
31
  props.values,
35
32
  syncState == null ? void 0 : syncState.values,
36
33
  props.defaultValues,
37
34
  []
38
35
  )
39
- });
40
- const tag = _EKSEHA55cjs.createStore.call(void 0, initialState, composite, props.store);
41
- _EKSEHA55cjs.setup.call(void 0,
36
+ };
37
+ const tag = _WPBYRKFQcjs.createStore.call(void 0, initialState, composite, props.store);
38
+ _WPBYRKFQcjs.setup.call(void 0,
42
39
  tag,
43
- () => _EKSEHA55cjs.sync.call(void 0, tag, ["inputElement", "activeId"], (state) => {
40
+ () => _WPBYRKFQcjs.sync.call(void 0, tag, ["inputElement", "activeId"], (state) => {
44
41
  if (!state.inputElement) return;
45
42
  if (state.activeId !== void 0) return;
46
43
  tag.setState("activeId", state.inputElement.id);
@@ -51,7 +48,7 @@ function createTagStore(props = {}) {
51
48
  _SHOLYDNPcjs.UndoManager.execute(() => {
52
49
  let changed = true;
53
50
  tag.setState("values", (prev) => {
54
- const next = _MLCPLY2Pcjs.applyState.call(void 0, values, prev);
51
+ const next = _6BYUUR4Mcjs.applyState.call(void 0, values, prev);
55
52
  if (next === prev) {
56
53
  changed = false;
57
54
  }
@@ -65,7 +62,9 @@ function createTagStore(props = {}) {
65
62
  };
66
63
  });
67
64
  };
68
- return _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, composite), tag), {
65
+ return {
66
+ ...composite,
67
+ ...tag,
69
68
  setInputElement: (inputElement) => tag.setState("inputElement", inputElement),
70
69
  setLabelElement: (labelElement) => tag.setState("labelElement", labelElement),
71
70
  setValue: (value) => tag.setState("value", value),
@@ -78,7 +77,7 @@ function createTagStore(props = {}) {
78
77
  });
79
78
  },
80
79
  removeValue: (value) => setValues((values) => values.filter((v) => v !== value))
81
- });
80
+ };
82
81
  }
83
82
 
84
83
 
@@ -1,30 +1,27 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _7WVAUIMEcjs = require('../__chunks/7WVAUIME.cjs');
3
+ var _OYTZFOIJcjs = require('../__chunks/OYTZFOIJ.cjs');
4
4
  require('../__chunks/GDZQUFNP.cjs');
5
- require('../__chunks/E5AYFGW2.cjs');
6
- require('../__chunks/VZPNI7C2.cjs');
7
- require('../__chunks/EKSEHA55.cjs');
5
+ require('../__chunks/HGVIF2R4.cjs');
6
+ require('../__chunks/4ITB54IT.cjs');
7
+ require('../__chunks/WPBYRKFQ.cjs');
8
8
 
9
9
 
10
- var _MLCPLY2Pcjs = require('../__chunks/MLCPLY2P.cjs');
11
-
12
-
13
-
14
- var _7EQBAZ46cjs = require('../__chunks/7EQBAZ46.cjs');
10
+ var _6BYUUR4Mcjs = require('../__chunks/6BYUUR4M.cjs');
15
11
 
16
12
  // src/toolbar/toolbar-store.ts
17
13
  function createToolbarStore(props = {}) {
18
14
  var _a;
19
15
  const syncState = (_a = props.store) == null ? void 0 : _a.getState();
20
- return _7WVAUIMEcjs.createCompositeStore.call(void 0, _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, props), {
21
- orientation: _MLCPLY2Pcjs.defaultValue.call(void 0,
16
+ return _OYTZFOIJcjs.createCompositeStore.call(void 0, {
17
+ ...props,
18
+ orientation: _6BYUUR4Mcjs.defaultValue.call(void 0,
22
19
  props.orientation,
23
20
  syncState == null ? void 0 : syncState.orientation,
24
21
  "horizontal"
25
22
  ),
26
- focusLoop: _MLCPLY2Pcjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true)
27
- }));
23
+ focusLoop: _6BYUUR4Mcjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true)
24
+ });
28
25
  }
29
26
 
30
27
 
@@ -1,19 +1,15 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _34NK2NPDcjs = require('../__chunks/34NK2NPD.cjs');
4
- require('../__chunks/OGYYHXPP.cjs');
5
- require('../__chunks/VR2FVDSU.cjs');
6
- require('../__chunks/L5GSFUJU.cjs');
3
+ var _UROTDZFKcjs = require('../__chunks/UROTDZFK.cjs');
4
+ require('../__chunks/AOXAROPF.cjs');
5
+ require('../__chunks/T247D7JS.cjs');
6
+ require('../__chunks/MJNGPYVQ.cjs');
7
7
 
8
8
 
9
- var _EKSEHA55cjs = require('../__chunks/EKSEHA55.cjs');
9
+ var _WPBYRKFQcjs = require('../__chunks/WPBYRKFQ.cjs');
10
10
 
11
11
 
12
- var _MLCPLY2Pcjs = require('../__chunks/MLCPLY2P.cjs');
13
-
14
-
15
-
16
- var _7EQBAZ46cjs = require('../__chunks/7EQBAZ46.cjs');
12
+ var _6BYUUR4Mcjs = require('../__chunks/6BYUUR4M.cjs');
17
13
 
18
14
  // src/tooltip/tooltip-store.ts
19
15
  function createTooltipStore(props = {}) {
@@ -28,20 +24,25 @@ function createTooltipStore(props = {}) {
28
24
  }
29
25
  }
30
26
  const syncState = (_a = props.store) == null ? void 0 : _a.getState();
31
- const hovercard = _34NK2NPDcjs.createHovercardStore.call(void 0, _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, props), {
32
- placement: _MLCPLY2Pcjs.defaultValue.call(void 0,
27
+ const hovercard = _UROTDZFKcjs.createHovercardStore.call(void 0, {
28
+ ...props,
29
+ placement: _6BYUUR4Mcjs.defaultValue.call(void 0,
33
30
  props.placement,
34
31
  syncState == null ? void 0 : syncState.placement,
35
32
  "top"
36
33
  ),
37
- hideTimeout: _MLCPLY2Pcjs.defaultValue.call(void 0, props.hideTimeout, syncState == null ? void 0 : syncState.hideTimeout, 0)
38
- }));
39
- const initialState = _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, hovercard.getState()), {
40
- type: _MLCPLY2Pcjs.defaultValue.call(void 0, props.type, syncState == null ? void 0 : syncState.type, "description"),
41
- skipTimeout: _MLCPLY2Pcjs.defaultValue.call(void 0, props.skipTimeout, syncState == null ? void 0 : syncState.skipTimeout, 300)
34
+ hideTimeout: _6BYUUR4Mcjs.defaultValue.call(void 0, props.hideTimeout, syncState == null ? void 0 : syncState.hideTimeout, 0)
42
35
  });
43
- const tooltip = _EKSEHA55cjs.createStore.call(void 0, initialState, hovercard, props.store);
44
- return _7EQBAZ46cjs.__spreadValues.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, hovercard), tooltip);
36
+ const initialState = {
37
+ ...hovercard.getState(),
38
+ type: _6BYUUR4Mcjs.defaultValue.call(void 0, props.type, syncState == null ? void 0 : syncState.type, "description"),
39
+ skipTimeout: _6BYUUR4Mcjs.defaultValue.call(void 0, props.skipTimeout, syncState == null ? void 0 : syncState.skipTimeout, 300)
40
+ };
41
+ const tooltip = _WPBYRKFQcjs.createStore.call(void 0, initialState, hovercard, props.store);
42
+ return {
43
+ ...hovercard,
44
+ ...tooltip
45
+ };
45
46
  }
46
47
 
47
48
 
@@ -4,7 +4,6 @@
4
4
 
5
5
 
6
6
  var _GDZQUFNPcjs = require('../__chunks/GDZQUFNP.cjs');
7
- require('../__chunks/7EQBAZ46.cjs');
8
7
 
9
8
 
10
9
 
package/cjs/utils/dom.cjs CHANGED
@@ -18,8 +18,7 @@
18
18
 
19
19
 
20
20
 
21
- var _VZPNI7C2cjs = require('../__chunks/VZPNI7C2.cjs');
22
- require('../__chunks/7EQBAZ46.cjs');
21
+ var _4ITB54ITcjs = require('../__chunks/4ITB54IT.cjs');
23
22
 
24
23
 
25
24
 
@@ -40,4 +39,4 @@ require('../__chunks/7EQBAZ46.cjs');
40
39
 
41
40
 
42
41
 
43
- exports.canUseDOM = _VZPNI7C2cjs.canUseDOM; exports.contains = _VZPNI7C2cjs.contains; exports.getActiveElement = _VZPNI7C2cjs.getActiveElement; exports.getDocument = _VZPNI7C2cjs.getDocument; exports.getPopupItemRole = _VZPNI7C2cjs.getPopupItemRole; exports.getPopupRole = _VZPNI7C2cjs.getPopupRole; exports.getScrollingElement = _VZPNI7C2cjs.getScrollingElement; exports.getTextboxSelection = _VZPNI7C2cjs.getTextboxSelection; exports.getTextboxValue = _VZPNI7C2cjs.getTextboxValue; exports.getWindow = _VZPNI7C2cjs.getWindow; exports.isButton = _VZPNI7C2cjs.isButton; exports.isFrame = _VZPNI7C2cjs.isFrame; exports.isPartiallyHidden = _VZPNI7C2cjs.isPartiallyHidden; exports.isTextField = _VZPNI7C2cjs.isTextField; exports.isTextbox = _VZPNI7C2cjs.isTextbox; exports.isVisible = _VZPNI7C2cjs.isVisible; exports.scrollIntoViewIfNeeded = _VZPNI7C2cjs.scrollIntoViewIfNeeded; exports.setSelectionRange = _VZPNI7C2cjs.setSelectionRange; exports.sortBasedOnDOMPosition = _VZPNI7C2cjs.sortBasedOnDOMPosition;
42
+ exports.canUseDOM = _4ITB54ITcjs.canUseDOM; exports.contains = _4ITB54ITcjs.contains; exports.getActiveElement = _4ITB54ITcjs.getActiveElement; exports.getDocument = _4ITB54ITcjs.getDocument; exports.getPopupItemRole = _4ITB54ITcjs.getPopupItemRole; exports.getPopupRole = _4ITB54ITcjs.getPopupRole; exports.getScrollingElement = _4ITB54ITcjs.getScrollingElement; exports.getTextboxSelection = _4ITB54ITcjs.getTextboxSelection; exports.getTextboxValue = _4ITB54ITcjs.getTextboxValue; exports.getWindow = _4ITB54ITcjs.getWindow; exports.isButton = _4ITB54ITcjs.isButton; exports.isFrame = _4ITB54ITcjs.isFrame; exports.isPartiallyHidden = _4ITB54ITcjs.isPartiallyHidden; exports.isTextField = _4ITB54ITcjs.isTextField; exports.isTextbox = _4ITB54ITcjs.isTextbox; exports.isVisible = _4ITB54ITcjs.isVisible; exports.scrollIntoViewIfNeeded = _4ITB54ITcjs.scrollIntoViewIfNeeded; exports.setSelectionRange = _4ITB54ITcjs.setSelectionRange; exports.sortBasedOnDOMPosition = _4ITB54ITcjs.sortBasedOnDOMPosition;
@@ -1,18 +1,14 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _6REHCF5Tcjs = require('../__chunks/6REHCF5T.cjs');
3
+ var _JNYCP2QOcjs = require('../__chunks/JNYCP2QO.cjs');
4
4
 
5
5
 
6
- var _VZPNI7C2cjs = require('../__chunks/VZPNI7C2.cjs');
7
-
8
-
9
-
10
- var _7EQBAZ46cjs = require('../__chunks/7EQBAZ46.cjs');
6
+ var _4ITB54ITcjs = require('../__chunks/4ITB54IT.cjs');
11
7
 
12
8
  // src/utils/events.ts
13
9
  function isPortalEvent(event) {
14
10
  return Boolean(
15
- event.currentTarget && !_VZPNI7C2cjs.contains.call(void 0, event.currentTarget, event.target)
11
+ event.currentTarget && !_4ITB54ITcjs.contains.call(void 0, event.currentTarget, event.target)
16
12
  );
17
13
  }
18
14
  function isSelfTarget(event) {
@@ -21,7 +17,7 @@ function isSelfTarget(event) {
21
17
  function isOpeningInNewTab(event) {
22
18
  const element = event.currentTarget;
23
19
  if (!element) return false;
24
- const isAppleDevice = _6REHCF5Tcjs.isApple.call(void 0, );
20
+ const isAppleDevice = _JNYCP2QOcjs.isApple.call(void 0, );
25
21
  if (isAppleDevice && !event.metaKey) return false;
26
22
  if (!isAppleDevice && !event.ctrlKey) return false;
27
23
  const tagName = element.tagName.toLowerCase();
@@ -47,14 +43,14 @@ function fireEvent(element, type, eventInit) {
47
43
  function fireBlurEvent(element, eventInit) {
48
44
  const event = new FocusEvent("blur", eventInit);
49
45
  const defaultAllowed = element.dispatchEvent(event);
50
- const bubbleInit = _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, eventInit), { bubbles: true });
46
+ const bubbleInit = { ...eventInit, bubbles: true };
51
47
  element.dispatchEvent(new FocusEvent("focusout", bubbleInit));
52
48
  return defaultAllowed;
53
49
  }
54
50
  function fireFocusEvent(element, eventInit) {
55
51
  const event = new FocusEvent("focus", eventInit);
56
52
  const defaultAllowed = element.dispatchEvent(event);
57
- const bubbleInit = _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, eventInit), { bubbles: true });
53
+ const bubbleInit = { ...eventInit, bubbles: true };
58
54
  element.dispatchEvent(new FocusEvent("focusin", bubbleInit));
59
55
  return defaultAllowed;
60
56
  }
@@ -69,7 +65,7 @@ function fireClickEvent(element, eventInit) {
69
65
  function isFocusEventOutside(event, container) {
70
66
  const containerElement = container || event.currentTarget;
71
67
  const relatedTarget = event.relatedTarget;
72
- return !relatedTarget || !_VZPNI7C2cjs.contains.call(void 0, containerElement, relatedTarget);
68
+ return !relatedTarget || !_4ITB54ITcjs.contains.call(void 0, containerElement, relatedTarget);
73
69
  }
74
70
  function getInputType(event) {
75
71
  const nativeEvent = "nativeEvent" in event ? event.nativeEvent : event;
@@ -3,10 +3,7 @@
3
3
 
4
4
 
5
5
 
6
- var _VZPNI7C2cjs = require('../__chunks/VZPNI7C2.cjs');
7
-
8
-
9
- var _7EQBAZ46cjs = require('../__chunks/7EQBAZ46.cjs');
6
+ var _4ITB54ITcjs = require('../__chunks/4ITB54IT.cjs');
10
7
 
11
8
  // src/utils/focus.ts
12
9
  var selector = "input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], summary, iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])";
@@ -16,7 +13,7 @@ function hasNegativeTabIndex(element) {
16
13
  }
17
14
  function isFocusable(element) {
18
15
  if (!element.matches(selector)) return false;
19
- if (!_VZPNI7C2cjs.isVisible.call(void 0, element)) return false;
16
+ if (!_4ITB54ITcjs.isVisible.call(void 0, element)) return false;
20
17
  if (element.closest("[inert]")) return false;
21
18
  return true;
22
19
  }
@@ -30,7 +27,7 @@ function isTabbable(element) {
30
27
  const radioGroup = element.form.elements.namedItem(element.name);
31
28
  if (!radioGroup) return true;
32
29
  if (!("length" in radioGroup)) return true;
33
- const activeElement = _VZPNI7C2cjs.getActiveElement.call(void 0, element);
30
+ const activeElement = _4ITB54ITcjs.getActiveElement.call(void 0, element);
34
31
  if (!activeElement) return true;
35
32
  if (activeElement === element) return true;
36
33
  if (!("form" in activeElement)) return true;
@@ -47,10 +44,11 @@ function getAllFocusableIn(container, includeContainer) {
47
44
  }
48
45
  const focusableElements = elements.filter(isFocusable);
49
46
  focusableElements.forEach((element, i) => {
50
- if (_VZPNI7C2cjs.isFrame.call(void 0, element) && element.contentDocument) {
51
- const frameBody = element.contentDocument.body;
52
- focusableElements.splice(i, 1, ...getAllFocusableIn(frameBody));
53
- }
47
+ var _a;
48
+ if (!_4ITB54ITcjs.isFrame.call(void 0, element)) return;
49
+ const frameBody = (_a = element.contentDocument) == null ? void 0 : _a.body;
50
+ if (!frameBody) return;
51
+ focusableElements.splice(i, 1, ...getAllFocusableIn(frameBody));
54
52
  });
55
53
  return focusableElements;
56
54
  }
@@ -73,15 +71,16 @@ function getAllTabbableIn(container, includeContainer, fallbackToFocusable) {
73
71
  tabbableElements.unshift(container);
74
72
  }
75
73
  tabbableElements.forEach((element, i) => {
76
- if (_VZPNI7C2cjs.isFrame.call(void 0, element) && element.contentDocument) {
77
- const frameBody = element.contentDocument.body;
78
- const allFrameTabbable = getAllTabbableIn(
79
- frameBody,
80
- false,
81
- fallbackToFocusable
82
- );
83
- tabbableElements.splice(i, 1, ...allFrameTabbable);
84
- }
74
+ var _a;
75
+ if (!_4ITB54ITcjs.isFrame.call(void 0, element)) return;
76
+ const frameBody = (_a = element.contentDocument) == null ? void 0 : _a.body;
77
+ if (!frameBody) return;
78
+ const allFrameTabbable = getAllTabbableIn(
79
+ frameBody,
80
+ false,
81
+ fallbackToFocusable
82
+ );
83
+ tabbableElements.splice(i, 1, ...allFrameTabbable);
85
84
  });
86
85
  if (!tabbableElements.length && fallbackToFocusable) {
87
86
  return elements;
@@ -114,7 +113,7 @@ function getLastTabbable(fallbackToFocusable) {
114
113
  return getLastTabbableIn(document.body, false, fallbackToFocusable);
115
114
  }
116
115
  function getNextTabbableIn(container, includeContainer, fallbackToFirst, fallbackToFocusable) {
117
- const activeElement = _VZPNI7C2cjs.getActiveElement.call(void 0, container);
116
+ const activeElement = _4ITB54ITcjs.getActiveElement.call(void 0, container);
118
117
  const allFocusable = getAllFocusableIn(container, includeContainer);
119
118
  const activeIndex = allFocusable.indexOf(activeElement);
120
119
  const nextFocusableElements = allFocusable.slice(activeIndex + 1);
@@ -129,7 +128,7 @@ function getNextTabbable(fallbackToFirst, fallbackToFocusable) {
129
128
  );
130
129
  }
131
130
  function getPreviousTabbableIn(container, includeContainer, fallbackToLast, fallbackToFocusable) {
132
- const activeElement = _VZPNI7C2cjs.getActiveElement.call(void 0, container);
131
+ const activeElement = _4ITB54ITcjs.getActiveElement.call(void 0, container);
133
132
  const allFocusable = getAllFocusableIn(container, includeContainer).reverse();
134
133
  const activeIndex = allFocusable.indexOf(activeElement);
135
134
  const previousFocusableElements = allFocusable.slice(activeIndex + 1);
@@ -150,7 +149,7 @@ function getClosestFocusable(element) {
150
149
  return element || null;
151
150
  }
152
151
  function hasFocus(element) {
153
- const activeElement = _VZPNI7C2cjs.getActiveElement.call(void 0, element);
152
+ const activeElement = _4ITB54ITcjs.getActiveElement.call(void 0, element);
154
153
  if (!activeElement) return false;
155
154
  if (activeElement === element) return true;
156
155
  const activeDescendant = activeElement.getAttribute("aria-activedescendant");
@@ -158,9 +157,9 @@ function hasFocus(element) {
158
157
  return activeDescendant === element.id;
159
158
  }
160
159
  function hasFocusWithin(element) {
161
- const activeElement = _VZPNI7C2cjs.getActiveElement.call(void 0, element);
160
+ const activeElement = _4ITB54ITcjs.getActiveElement.call(void 0, element);
162
161
  if (!activeElement) return false;
163
- if (_VZPNI7C2cjs.contains.call(void 0, element, activeElement)) return true;
162
+ if (_4ITB54ITcjs.contains.call(void 0, element, activeElement)) return true;
164
163
  const activeDescendant = activeElement.getAttribute("aria-activedescendant");
165
164
  if (!activeDescendant) return false;
166
165
  if (!("id" in element)) return false;
@@ -207,7 +206,7 @@ function focusIntoView(element, options) {
207
206
  element.focus();
208
207
  } else {
209
208
  element.focus({ preventScroll: true });
210
- element.scrollIntoView(_7EQBAZ46cjs.__spreadValues.call(void 0, { block: "nearest", inline: "nearest" }, options));
209
+ element.scrollIntoView({ block: "nearest", inline: "nearest", ...options });
211
210
  }
212
211
  }
213
212
 
@@ -20,8 +20,7 @@
20
20
 
21
21
 
22
22
 
23
- var _MLCPLY2Pcjs = require('../__chunks/MLCPLY2P.cjs');
24
- require('../__chunks/7EQBAZ46.cjs');
23
+ var _6BYUUR4Mcjs = require('../__chunks/6BYUUR4M.cjs');
25
24
 
26
25
 
27
26
 
@@ -44,4 +43,4 @@ require('../__chunks/7EQBAZ46.cjs');
44
43
 
45
44
 
46
45
 
47
- exports.afterPaint = _MLCPLY2Pcjs.afterPaint; exports.applyState = _MLCPLY2Pcjs.applyState; exports.beforePaint = _MLCPLY2Pcjs.beforePaint; exports.chain = _MLCPLY2Pcjs.chain; exports.cx = _MLCPLY2Pcjs.cx; exports.defaultValue = _MLCPLY2Pcjs.defaultValue; exports.disabledFromProps = _MLCPLY2Pcjs.disabledFromProps; exports.getKeys = _MLCPLY2Pcjs.getKeys; exports.hasOwnProperty = _MLCPLY2Pcjs.hasOwnProperty; exports.identity = _MLCPLY2Pcjs.identity; exports.invariant = _MLCPLY2Pcjs.invariant; exports.isEmpty = _MLCPLY2Pcjs.isEmpty; exports.isFalsyBooleanCallback = _MLCPLY2Pcjs.isFalsyBooleanCallback; exports.isInteger = _MLCPLY2Pcjs.isInteger; exports.isObject = _MLCPLY2Pcjs.isObject; exports.noop = _MLCPLY2Pcjs.noop; exports.normalizeString = _MLCPLY2Pcjs.normalizeString; exports.omit = _MLCPLY2Pcjs.omit; exports.pick = _MLCPLY2Pcjs.pick; exports.removeUndefinedValues = _MLCPLY2Pcjs.removeUndefinedValues; exports.shallowEqual = _MLCPLY2Pcjs.shallowEqual;
46
+ exports.afterPaint = _6BYUUR4Mcjs.afterPaint; exports.applyState = _6BYUUR4Mcjs.applyState; exports.beforePaint = _6BYUUR4Mcjs.beforePaint; exports.chain = _6BYUUR4Mcjs.chain; exports.cx = _6BYUUR4Mcjs.cx; exports.defaultValue = _6BYUUR4Mcjs.defaultValue; exports.disabledFromProps = _6BYUUR4Mcjs.disabledFromProps; exports.getKeys = _6BYUUR4Mcjs.getKeys; exports.hasOwnProperty = _6BYUUR4Mcjs.hasOwnProperty; exports.identity = _6BYUUR4Mcjs.identity; exports.invariant = _6BYUUR4Mcjs.invariant; exports.isEmpty = _6BYUUR4Mcjs.isEmpty; exports.isFalsyBooleanCallback = _6BYUUR4Mcjs.isFalsyBooleanCallback; exports.isInteger = _6BYUUR4Mcjs.isInteger; exports.isObject = _6BYUUR4Mcjs.isObject; exports.noop = _6BYUUR4Mcjs.noop; exports.normalizeString = _6BYUUR4Mcjs.normalizeString; exports.omit = _6BYUUR4Mcjs.omit; exports.pick = _6BYUUR4Mcjs.pick; exports.removeUndefinedValues = _6BYUUR4Mcjs.removeUndefinedValues; exports.shallowEqual = _6BYUUR4Mcjs.shallowEqual;
@@ -4,13 +4,12 @@
4
4
 
5
5
 
6
6
 
7
- var _6REHCF5Tcjs = require('../__chunks/6REHCF5T.cjs');
8
- require('../__chunks/VZPNI7C2.cjs');
9
- require('../__chunks/7EQBAZ46.cjs');
7
+ var _JNYCP2QOcjs = require('../__chunks/JNYCP2QO.cjs');
8
+ require('../__chunks/4ITB54IT.cjs');
10
9
 
11
10
 
12
11
 
13
12
 
14
13
 
15
14
 
16
- exports.isApple = _6REHCF5Tcjs.isApple; exports.isFirefox = _6REHCF5Tcjs.isFirefox; exports.isMac = _6REHCF5Tcjs.isMac; exports.isSafari = _6REHCF5Tcjs.isSafari; exports.isTouchDevice = _6REHCF5Tcjs.isTouchDevice;
15
+ exports.isApple = _JNYCP2QOcjs.isApple; exports.isFirefox = _JNYCP2QOcjs.isFirefox; exports.isMac = _JNYCP2QOcjs.isMac; exports.isSafari = _JNYCP2QOcjs.isSafari; exports.isTouchDevice = _JNYCP2QOcjs.isTouchDevice;