@ariakit/core 0.4.6 → 0.4.8

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 +9 -0
  2. package/cjs/__chunks/{B4LYZ4EM.cjs → 3QF3ODTR.cjs} +44 -61
  3. package/cjs/__chunks/{LPDHSEHU.cjs → 7CES7GVE.cjs} +4 -8
  4. package/cjs/__chunks/{Q2WCPTYS.cjs → 7WYII4AN.cjs} +6 -12
  5. package/cjs/__chunks/{EEDWPDM2.cjs → BTUHABP4.cjs} +16 -30
  6. package/cjs/__chunks/{4W3OYRR3.cjs → CCI5VM7E.cjs} +24 -30
  7. package/cjs/__chunks/{5JEQEZFR.cjs → H6ZQSQQL.cjs} +16 -16
  8. package/cjs/__chunks/{D7M2PCAQ.cjs → KCEXELK7.cjs} +6 -7
  9. package/cjs/__chunks/{LTLFSC4X.cjs → N667HVED.cjs} +2 -2
  10. package/cjs/__chunks/{3HYNC3XA.cjs → PW36G76L.cjs} +25 -29
  11. package/cjs/__chunks/{AETQC2AR.cjs → QLWAGBAQ.cjs} +20 -22
  12. package/cjs/__chunks/{B4AKUC4S.cjs → VJAE2Y4T.cjs} +10 -10
  13. package/cjs/__chunks/XIZWLBI2.cjs +42 -0
  14. package/cjs/checkbox/checkbox-store.cjs +7 -7
  15. package/cjs/collection/collection-store.cjs +6 -6
  16. package/cjs/combobox/combobox-store.cjs +50 -56
  17. package/cjs/combobox/combobox-store.d.cts +2 -0
  18. package/cjs/combobox/combobox-store.d.ts +2 -0
  19. package/cjs/composite/composite-overflow-store.cjs +7 -7
  20. package/cjs/composite/composite-store.cjs +7 -7
  21. package/cjs/composite/composite-store.d.cts +5 -1
  22. package/cjs/composite/composite-store.d.ts +5 -1
  23. package/cjs/dialog/dialog-store.cjs +6 -6
  24. package/cjs/disclosure/disclosure-store.cjs +5 -5
  25. package/cjs/form/form-store.cjs +32 -36
  26. package/cjs/hovercard/hovercard-store.cjs +8 -8
  27. package/cjs/index.cjs +1 -1
  28. package/cjs/menu/menu-bar-store.cjs +8 -8
  29. package/cjs/menu/menu-store.cjs +37 -42
  30. package/cjs/menubar/menubar-store.cjs +8 -8
  31. package/cjs/popover/popover-store.cjs +7 -7
  32. package/cjs/radio/radio-store.cjs +13 -13
  33. package/cjs/select/select-store.cjs +49 -62
  34. package/cjs/select/select-store.d.cts +2 -0
  35. package/cjs/select/select-store.d.ts +2 -0
  36. package/cjs/tab/tab-store.cjs +49 -61
  37. package/cjs/tab/tab-store.d.cts +10 -4
  38. package/cjs/tab/tab-store.d.ts +10 -4
  39. package/cjs/tag/tag-store.cjs +23 -27
  40. package/cjs/toolbar/toolbar-store.cjs +9 -9
  41. package/cjs/tooltip/tooltip-store.cjs +15 -15
  42. package/cjs/utils/array.cjs +1 -1
  43. package/cjs/utils/dom.cjs +3 -3
  44. package/cjs/utils/events.cjs +25 -37
  45. package/cjs/utils/focus.cjs +41 -61
  46. package/cjs/utils/misc.cjs +3 -3
  47. package/cjs/utils/misc.d.cts +1 -1
  48. package/cjs/utils/misc.d.ts +1 -1
  49. package/cjs/utils/platform.cjs +4 -4
  50. package/cjs/utils/store.cjs +4 -4
  51. package/cjs/utils/undo.cjs +3 -3
  52. package/esm/__chunks/{MFZZDIHG.js → 3UYWTADI.js} +4 -4
  53. package/esm/__chunks/{EQPTKGFA.js → 6DHTHWXD.js} +10 -16
  54. package/esm/__chunks/{WCKXDMU7.js → 6E4KKOSB.js} +5 -7
  55. package/esm/__chunks/{EKIWAN6A.js → 7LM4Q2XB.js} +4 -8
  56. package/esm/__chunks/{PBSSD2DM.js → D7EIQZAU.js} +8 -12
  57. package/esm/__chunks/{BRS7GKWU.js → EACLTACN.js} +4 -4
  58. package/esm/__chunks/{R676XYVY.js → EQQLU3CG.js} +34 -51
  59. package/esm/__chunks/{I2NJJ3XW.js → HWOIWM4O.js} +6 -12
  60. package/esm/__chunks/{22HHDS5F.js → PBFD2E7P.js} +15 -29
  61. package/esm/__chunks/{P3MTNH46.js → PIWLWQMB.js} +4 -4
  62. package/esm/__chunks/{CLSHHUGK.js → US4USQPI.js} +2 -3
  63. package/esm/__chunks/{5RJNXXU2.js → YOHCVXJB.js} +1 -1
  64. package/esm/checkbox/checkbox-store.js +3 -3
  65. package/esm/collection/collection-store.js +5 -5
  66. package/esm/combobox/combobox-store.d.ts +2 -0
  67. package/esm/combobox/combobox-store.js +16 -22
  68. package/esm/composite/composite-overflow-store.js +6 -6
  69. package/esm/composite/composite-store.d.ts +5 -1
  70. package/esm/composite/composite-store.js +6 -6
  71. package/esm/dialog/dialog-store.js +5 -5
  72. package/esm/disclosure/disclosure-store.js +4 -4
  73. package/esm/form/form-store.js +9 -13
  74. package/esm/hovercard/hovercard-store.js +7 -7
  75. package/esm/index.js +1 -1
  76. package/esm/menu/menu-bar-store.js +7 -7
  77. package/esm/menu/menu-store.js +15 -20
  78. package/esm/menubar/menubar-store.js +7 -7
  79. package/esm/popover/popover-store.js +6 -6
  80. package/esm/radio/radio-store.js +6 -6
  81. package/esm/select/select-store.d.ts +2 -0
  82. package/esm/select/select-store.js +22 -35
  83. package/esm/tab/tab-store.d.ts +10 -4
  84. package/esm/tab/tab-store.js +18 -30
  85. package/esm/tag/tag-store.js +11 -15
  86. package/esm/toolbar/toolbar-store.js +6 -6
  87. package/esm/tooltip/tooltip-store.js +7 -7
  88. package/esm/utils/array.js +1 -1
  89. package/esm/utils/dom.js +2 -2
  90. package/esm/utils/events.js +20 -32
  91. package/esm/utils/focus.js +33 -53
  92. package/esm/utils/misc.d.ts +1 -1
  93. package/esm/utils/misc.js +2 -2
  94. package/esm/utils/platform.js +3 -3
  95. package/esm/utils/store.js +3 -3
  96. package/esm/utils/undo.js +2 -2
  97. package/package.json +2 -2
  98. package/readme.md +18 -0
  99. package/.eslintignore +0 -6
  100. package/cjs/__chunks/UEZLSKZ4.cjs +0 -42
  101. /package/cjs/__chunks/{AV6KTKLE.cjs → 3IVNQNIV.cjs} +0 -0
  102. /package/esm/__chunks/{4R3V3JGP.js → 3YLGPPWQ.js} +0 -0
@@ -1,26 +1,26 @@
1
1
  "use client";
2
2
  import {
3
3
  createCompositeStore
4
- } from "../__chunks/PBSSD2DM.js";
5
- import "../__chunks/EQPTKGFA.js";
4
+ } from "../__chunks/D7EIQZAU.js";
5
+ import "../__chunks/6DHTHWXD.js";
6
6
  import "../__chunks/7PRQYBBV.js";
7
7
  import {
8
8
  UndoManager
9
- } from "../__chunks/EKIWAN6A.js";
9
+ } from "../__chunks/7LM4Q2XB.js";
10
10
  import {
11
11
  createStore,
12
12
  setup,
13
13
  sync
14
- } from "../__chunks/R676XYVY.js";
14
+ } from "../__chunks/EQQLU3CG.js";
15
15
  import {
16
16
  applyState,
17
17
  defaultValue
18
- } from "../__chunks/22HHDS5F.js";
19
- import "../__chunks/I2NJJ3XW.js";
18
+ } from "../__chunks/PBFD2E7P.js";
19
+ import "../__chunks/HWOIWM4O.js";
20
20
  import {
21
21
  __spreadProps,
22
22
  __spreadValues
23
- } from "../__chunks/4R3V3JGP.js";
23
+ } from "../__chunks/3YLGPPWQ.js";
24
24
 
25
25
  // src/tag/tag-store.ts
26
26
  function createTagStore(props = {}) {
@@ -42,10 +42,8 @@ function createTagStore(props = {}) {
42
42
  setup(
43
43
  tag,
44
44
  () => sync(tag, ["inputElement", "activeId"], (state) => {
45
- if (!state.inputElement)
46
- return;
47
- if (state.activeId !== void 0)
48
- return;
45
+ if (!state.inputElement) return;
46
+ if (state.activeId !== void 0) return;
49
47
  tag.setState("activeId", state.inputElement.id);
50
48
  })
51
49
  );
@@ -60,8 +58,7 @@ function createTagStore(props = {}) {
60
58
  }
61
59
  return next;
62
60
  });
63
- if (!changed)
64
- return;
61
+ if (!changed) return;
65
62
  return () => {
66
63
  var _a2;
67
64
  tag.setState("values", previousValues);
@@ -77,8 +74,7 @@ function createTagStore(props = {}) {
77
74
  setValues,
78
75
  addValue: (value) => {
79
76
  setValues((values) => {
80
- if (values.includes(value))
81
- return values;
77
+ if (values.includes(value)) return values;
82
78
  return [...values, value];
83
79
  });
84
80
  },
@@ -1,18 +1,18 @@
1
1
  "use client";
2
2
  import {
3
3
  createCompositeStore
4
- } from "../__chunks/PBSSD2DM.js";
5
- import "../__chunks/EQPTKGFA.js";
4
+ } from "../__chunks/D7EIQZAU.js";
5
+ import "../__chunks/6DHTHWXD.js";
6
6
  import "../__chunks/7PRQYBBV.js";
7
- import "../__chunks/R676XYVY.js";
7
+ import "../__chunks/EQQLU3CG.js";
8
8
  import {
9
9
  defaultValue
10
- } from "../__chunks/22HHDS5F.js";
11
- import "../__chunks/I2NJJ3XW.js";
10
+ } from "../__chunks/PBFD2E7P.js";
11
+ import "../__chunks/HWOIWM4O.js";
12
12
  import {
13
13
  __spreadProps,
14
14
  __spreadValues
15
- } from "../__chunks/4R3V3JGP.js";
15
+ } from "../__chunks/3YLGPPWQ.js";
16
16
 
17
17
  // src/toolbar/toolbar-store.ts
18
18
  function createToolbarStore(props = {}) {
@@ -1,20 +1,20 @@
1
1
  "use client";
2
2
  import {
3
3
  createHovercardStore
4
- } from "../__chunks/BRS7GKWU.js";
5
- import "../__chunks/MFZZDIHG.js";
6
- import "../__chunks/5RJNXXU2.js";
7
- import "../__chunks/WCKXDMU7.js";
4
+ } from "../__chunks/EACLTACN.js";
5
+ import "../__chunks/3UYWTADI.js";
6
+ import "../__chunks/YOHCVXJB.js";
7
+ import "../__chunks/6E4KKOSB.js";
8
8
  import {
9
9
  createStore
10
- } from "../__chunks/R676XYVY.js";
10
+ } from "../__chunks/EQQLU3CG.js";
11
11
  import {
12
12
  defaultValue
13
- } from "../__chunks/22HHDS5F.js";
13
+ } from "../__chunks/PBFD2E7P.js";
14
14
  import {
15
15
  __spreadProps,
16
16
  __spreadValues
17
- } from "../__chunks/4R3V3JGP.js";
17
+ } from "../__chunks/3YLGPPWQ.js";
18
18
 
19
19
  // src/tooltip/tooltip-store.ts
20
20
  function createTooltipStore(props = {}) {
@@ -5,7 +5,7 @@ import {
5
5
  reverseArray,
6
6
  toArray
7
7
  } from "../__chunks/7PRQYBBV.js";
8
- import "../__chunks/4R3V3JGP.js";
8
+ import "../__chunks/3YLGPPWQ.js";
9
9
  export {
10
10
  addItemToArray,
11
11
  flatten2DArray,
package/esm/utils/dom.js CHANGED
@@ -18,8 +18,8 @@ import {
18
18
  isVisible,
19
19
  scrollIntoViewIfNeeded,
20
20
  setSelectionRange
21
- } from "../__chunks/I2NJJ3XW.js";
22
- import "../__chunks/4R3V3JGP.js";
21
+ } from "../__chunks/HWOIWM4O.js";
22
+ import "../__chunks/3YLGPPWQ.js";
23
23
  export {
24
24
  canUseDOM,
25
25
  contains,
@@ -1,14 +1,14 @@
1
1
  "use client";
2
2
  import {
3
3
  isApple
4
- } from "../__chunks/CLSHHUGK.js";
4
+ } from "../__chunks/US4USQPI.js";
5
5
  import {
6
6
  contains
7
- } from "../__chunks/I2NJJ3XW.js";
7
+ } from "../__chunks/HWOIWM4O.js";
8
8
  import {
9
9
  __spreadProps,
10
10
  __spreadValues
11
- } from "../__chunks/4R3V3JGP.js";
11
+ } from "../__chunks/3YLGPPWQ.js";
12
12
 
13
13
  // src/utils/events.ts
14
14
  function isPortalEvent(event) {
@@ -21,35 +21,24 @@ function isSelfTarget(event) {
21
21
  }
22
22
  function isOpeningInNewTab(event) {
23
23
  const element = event.currentTarget;
24
- if (!element)
25
- return false;
24
+ if (!element) return false;
26
25
  const isAppleDevice = isApple();
27
- if (isAppleDevice && !event.metaKey)
28
- return false;
29
- if (!isAppleDevice && !event.ctrlKey)
30
- return false;
26
+ if (isAppleDevice && !event.metaKey) return false;
27
+ if (!isAppleDevice && !event.ctrlKey) return false;
31
28
  const tagName = element.tagName.toLowerCase();
32
- if (tagName === "a")
33
- return true;
34
- if (tagName === "button" && element.type === "submit")
35
- return true;
36
- if (tagName === "input" && element.type === "submit")
37
- return true;
29
+ if (tagName === "a") return true;
30
+ if (tagName === "button" && element.type === "submit") return true;
31
+ if (tagName === "input" && element.type === "submit") return true;
38
32
  return false;
39
33
  }
40
34
  function isDownloading(event) {
41
35
  const element = event.currentTarget;
42
- if (!element)
43
- return false;
36
+ if (!element) return false;
44
37
  const tagName = element.tagName.toLowerCase();
45
- if (!event.altKey)
46
- return false;
47
- if (tagName === "a")
48
- return true;
49
- if (tagName === "button" && element.type === "submit")
50
- return true;
51
- if (tagName === "input" && element.type === "submit")
52
- return true;
38
+ if (!event.altKey) return false;
39
+ if (tagName === "a") return true;
40
+ if (tagName === "button" && element.type === "submit") return true;
41
+ if (tagName === "input" && element.type === "submit") return true;
53
42
  return false;
54
43
  }
55
44
  function fireEvent(element, type, eventInit) {
@@ -85,12 +74,9 @@ function isFocusEventOutside(event, container) {
85
74
  }
86
75
  function getInputType(event) {
87
76
  const nativeEvent = "nativeEvent" in event ? event.nativeEvent : event;
88
- if (!nativeEvent)
89
- return;
90
- if (!("inputType" in nativeEvent))
91
- return;
92
- if (typeof nativeEvent.inputType !== "string")
93
- return;
77
+ if (!nativeEvent) return;
78
+ if (!("inputType" in nativeEvent)) return;
79
+ if (typeof nativeEvent.inputType !== "string") return;
94
80
  return nativeEvent.inputType;
95
81
  }
96
82
  function queueBeforeEvent(element, type, callback, timeout) {
@@ -127,7 +113,9 @@ function addGlobalEventListener(type, listener, options, scope = window) {
127
113
  scope.document.removeEventListener(type, listener, options);
128
114
  } catch (e) {
129
115
  }
130
- children.forEach((remove) => remove());
116
+ for (const remove of children) {
117
+ remove();
118
+ }
131
119
  };
132
120
  return removeEventListener;
133
121
  }
@@ -4,55 +4,39 @@ import {
4
4
  getActiveElement,
5
5
  isFrame,
6
6
  isVisible
7
- } from "../__chunks/I2NJJ3XW.js";
7
+ } from "../__chunks/HWOIWM4O.js";
8
8
  import {
9
9
  __spreadValues
10
- } from "../__chunks/4R3V3JGP.js";
10
+ } from "../__chunks/3YLGPPWQ.js";
11
11
 
12
12
  // src/utils/focus.ts
13
13
  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'])";
14
14
  function hasNegativeTabIndex(element) {
15
- const tabIndex = parseInt(element.getAttribute("tabindex") || "0", 10);
15
+ const tabIndex = Number.parseInt(element.getAttribute("tabindex") || "0", 10);
16
16
  return tabIndex < 0;
17
17
  }
18
18
  function isFocusable(element) {
19
- if (!element.matches(selector))
20
- return false;
21
- if (!isVisible(element))
22
- return false;
23
- if (element.closest("[inert]"))
24
- return false;
19
+ if (!element.matches(selector)) return false;
20
+ if (!isVisible(element)) return false;
21
+ if (element.closest("[inert]")) return false;
25
22
  return true;
26
23
  }
27
24
  function isTabbable(element) {
28
- if (!isFocusable(element))
29
- return false;
30
- if (hasNegativeTabIndex(element))
31
- return false;
32
- if (!("form" in element))
33
- return true;
34
- if (!element.form)
35
- return true;
36
- if (element.checked)
37
- return true;
38
- if (element.type !== "radio")
39
- return true;
25
+ if (!isFocusable(element)) return false;
26
+ if (hasNegativeTabIndex(element)) return false;
27
+ if (!("form" in element)) return true;
28
+ if (!element.form) return true;
29
+ if (element.checked) return true;
30
+ if (element.type !== "radio") return true;
40
31
  const radioGroup = element.form.elements.namedItem(element.name);
41
- if (!radioGroup)
42
- return true;
43
- if (!("length" in radioGroup))
44
- return true;
32
+ if (!radioGroup) return true;
33
+ if (!("length" in radioGroup)) return true;
45
34
  const activeElement = getActiveElement(element);
46
- if (!activeElement)
47
- return true;
48
- if (activeElement === element)
49
- return true;
50
- if (!("form" in activeElement))
51
- return true;
52
- if (activeElement.form !== element.form)
53
- return true;
54
- if (activeElement.name !== element.name)
55
- return true;
35
+ if (!activeElement) return true;
36
+ if (activeElement === element) return true;
37
+ if (!("form" in activeElement)) return true;
38
+ if (activeElement.form !== element.form) return true;
39
+ if (activeElement.name !== element.name) return true;
56
40
  return false;
57
41
  }
58
42
  function getAllFocusableIn(container, includeContainer) {
@@ -168,28 +152,20 @@ function getClosestFocusable(element) {
168
152
  }
169
153
  function hasFocus(element) {
170
154
  const activeElement = getActiveElement(element);
171
- if (!activeElement)
172
- return false;
173
- if (activeElement === element)
174
- return true;
155
+ if (!activeElement) return false;
156
+ if (activeElement === element) return true;
175
157
  const activeDescendant = activeElement.getAttribute("aria-activedescendant");
176
- if (!activeDescendant)
177
- return false;
158
+ if (!activeDescendant) return false;
178
159
  return activeDescendant === element.id;
179
160
  }
180
161
  function hasFocusWithin(element) {
181
162
  const activeElement = getActiveElement(element);
182
- if (!activeElement)
183
- return false;
184
- if (contains(element, activeElement))
185
- return true;
163
+ if (!activeElement) return false;
164
+ if (contains(element, activeElement)) return true;
186
165
  const activeDescendant = activeElement.getAttribute("aria-activedescendant");
187
- if (!activeDescendant)
188
- return false;
189
- if (!("id" in element))
190
- return false;
191
- if (activeDescendant === element.id)
192
- return true;
166
+ if (!activeDescendant) return false;
167
+ if (!("id" in element)) return false;
168
+ if (activeDescendant === element.id) return true;
193
169
  return !!element.querySelector(`#${CSS.escape(activeDescendant)}`);
194
170
  }
195
171
  function focusIfNeeded(element) {
@@ -205,7 +181,9 @@ function disableFocus(element) {
205
181
  }
206
182
  function disableFocusIn(container, includeContainer) {
207
183
  const tabbableElements = getAllTabbableIn(container, includeContainer);
208
- tabbableElements.forEach(disableFocus);
184
+ for (const element of tabbableElements) {
185
+ disableFocus(element);
186
+ }
209
187
  }
210
188
  function restoreFocusIn(container) {
211
189
  const elements = container.querySelectorAll("[data-tabindex]");
@@ -221,7 +199,9 @@ function restoreFocusIn(container) {
221
199
  if (container.hasAttribute("data-tabindex")) {
222
200
  restoreTabIndex(container);
223
201
  }
224
- elements.forEach(restoreTabIndex);
202
+ for (const element of elements) {
203
+ restoreTabIndex(element);
204
+ }
225
205
  }
226
206
  function focusIntoView(element, options) {
227
207
  if (!("scrollIntoView" in element)) {
@@ -99,7 +99,7 @@ export declare function invariant(condition: any, message?: string | boolean): a
99
99
  /**
100
100
  * Similar to `Object.keys` but returns a type-safe array of keys.
101
101
  */
102
- export declare function getKeys<T extends object>(obj: T): (keyof T)[];
102
+ export declare function getKeys<T extends object>(obj: T): Array<keyof T>;
103
103
  /**
104
104
  * Checks whether a boolean event prop (e.g., hideOnInteractOutside) was
105
105
  * intentionally set to false, either with a boolean value or a callback that
package/esm/utils/misc.js CHANGED
@@ -21,8 +21,8 @@ import {
21
21
  pick,
22
22
  removeUndefinedValues,
23
23
  shallowEqual
24
- } from "../__chunks/22HHDS5F.js";
25
- import "../__chunks/4R3V3JGP.js";
24
+ } from "../__chunks/PBFD2E7P.js";
25
+ import "../__chunks/3YLGPPWQ.js";
26
26
  export {
27
27
  afterPaint,
28
28
  applyState,
@@ -5,9 +5,9 @@ import {
5
5
  isMac,
6
6
  isSafari,
7
7
  isTouchDevice
8
- } from "../__chunks/CLSHHUGK.js";
9
- import "../__chunks/I2NJJ3XW.js";
10
- import "../__chunks/4R3V3JGP.js";
8
+ } from "../__chunks/US4USQPI.js";
9
+ import "../__chunks/HWOIWM4O.js";
10
+ import "../__chunks/3YLGPPWQ.js";
11
11
  export {
12
12
  isApple,
13
13
  isFirefox,
@@ -10,9 +10,9 @@ import {
10
10
  subscribe,
11
11
  sync,
12
12
  throwOnConflictingProps
13
- } from "../__chunks/R676XYVY.js";
14
- import "../__chunks/22HHDS5F.js";
15
- import "../__chunks/4R3V3JGP.js";
13
+ } from "../__chunks/EQQLU3CG.js";
14
+ import "../__chunks/PBFD2E7P.js";
15
+ import "../__chunks/3YLGPPWQ.js";
16
16
  export {
17
17
  batch,
18
18
  createStore,
package/esm/utils/undo.js CHANGED
@@ -2,8 +2,8 @@
2
2
  import {
3
3
  UndoManager,
4
4
  createUndoManager
5
- } from "../__chunks/EKIWAN6A.js";
6
- import "../__chunks/4R3V3JGP.js";
5
+ } from "../__chunks/7LM4Q2XB.js";
6
+ import "../__chunks/3YLGPPWQ.js";
7
7
  export {
8
8
  UndoManager,
9
9
  createUndoManager
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ariakit/core",
3
- "version": "0.4.6",
3
+ "version": "0.4.8",
4
4
  "description": "Ariakit core",
5
5
  "sideEffects": false,
6
6
  "license": "MIT",
@@ -20,7 +20,7 @@
20
20
  "url": "https://github.com/diegohaz"
21
21
  },
22
22
  "scripts": {
23
- "lint": "eslint . --ext js,ts,tsx",
23
+ "lint": "biome check .",
24
24
  "build": "node ../../scripts/build/build.js",
25
25
  "clean": "node ../../scripts/build/clean.js"
26
26
  },
package/readme.md ADDED
@@ -0,0 +1,18 @@
1
+ # Ariakit Core
2
+
3
+ **Important:** This package is an internal dependency of Ariakit and does not follow semantic versioning, meaning breaking changes may occur in patch and minor versions. You probably want to use [`@ariakit/react`](https://npmjs.org/package/@ariakit/react) instead.
4
+
5
+ ## Installation
6
+
7
+ ```
8
+ npm i @ariakit/core
9
+ ```
10
+
11
+ ## Core Team
12
+
13
+ - [Diego Haz](https://x.com/diegohaz)
14
+ - [Ben Rodri](https://x.com/benrodrs)
15
+
16
+ ## Contributing
17
+
18
+ Follow the instructions on the [contributing guide](https://github.com/ariakit/ariakit/blob/main/contributing.md).
package/.eslintignore DELETED
@@ -1,6 +0,0 @@
1
- cjs
2
- esm
3
- ts
4
- umd
5
- coverage
6
- node_modules
@@ -1,42 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
-
3
-
4
- var _5JEQEZFRcjs = require('./5JEQEZFR.cjs');
5
-
6
-
7
- var _B4LYZ4EMcjs = require('./B4LYZ4EM.cjs');
8
-
9
-
10
- var _EEDWPDM2cjs = require('./EEDWPDM2.cjs');
11
-
12
-
13
-
14
- var _AV6KTKLEcjs = require('./AV6KTKLE.cjs');
15
-
16
- // src/hovercard/hovercard-store.ts
17
- function createHovercardStore(props = {}) {
18
- var _a;
19
- const syncState = (_a = props.store) == null ? void 0 : _a.getState();
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
- props.placement,
23
- syncState == null ? void 0 : syncState.placement,
24
- "bottom"
25
- )
26
- }));
27
- const timeout = _EEDWPDM2cjs.defaultValue.call(void 0, props.timeout, syncState == null ? void 0 : syncState.timeout, 500);
28
- const initialState = _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, popover.getState()), {
29
- timeout,
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
- });
34
- const hovercard = _B4LYZ4EMcjs.createStore.call(void 0, initialState, popover, props.store);
35
- return _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, popover), hovercard), {
36
- setAutoFocusOnShow: (value) => hovercard.setState("autoFocusOnShow", value)
37
- });
38
- }
39
-
40
-
41
-
42
- exports.createHovercardStore = createHovercardStore;
File without changes
File without changes