@ariakit/core 0.3.10 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/CHANGELOG.md +60 -0
  2. package/cjs/__chunks/{Y6PHIDP6.cjs → 5JEQEZFR.cjs} +12 -12
  3. package/cjs/__chunks/{YIUPKKEK.cjs → 7DU6YMLQ.cjs} +6 -6
  4. package/cjs/__chunks/{MWNFQD55.cjs → AETQC2AR.cjs} +17 -16
  5. package/cjs/__chunks/{5CBCKBZ2.cjs → B4LYZ4EM.cjs} +12 -12
  6. package/cjs/__chunks/{3UT5FE6K.cjs → EEDWPDM2.cjs} +14 -1
  7. package/cjs/__chunks/{YLMJBIQM.cjs → FFZYCAXA.cjs} +24 -15
  8. package/cjs/__chunks/{MFSCSSBJ.cjs → LTLFSC4X.cjs} +2 -2
  9. package/cjs/__chunks/{CWDUO5EV.cjs → SU2BSHGB.cjs} +7 -7
  10. package/cjs/__chunks/{HMO4CKUP.cjs → UEZLSKZ4.cjs} +10 -10
  11. package/cjs/__chunks/{5F4DVUNS.cjs → UKR6TQI3.cjs} +1 -2
  12. package/cjs/__chunks/{ZXCB7MXN.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/composite/composite-overflow-store.cjs +6 -6
  17. package/cjs/composite/composite-store.cjs +6 -6
  18. package/cjs/dialog/dialog-store.cjs +5 -5
  19. package/cjs/disclosure/disclosure-store.cjs +4 -4
  20. package/cjs/disclosure/disclosure-store.d.cts +6 -2
  21. package/cjs/disclosure/disclosure-store.d.ts +6 -2
  22. package/cjs/form/form-store.cjs +24 -24
  23. package/cjs/form/form-store.d.cts +1 -1
  24. package/cjs/form/form-store.d.ts +1 -1
  25. package/cjs/hovercard/hovercard-store.cjs +7 -7
  26. package/cjs/hovercard/hovercard-store.d.cts +14 -7
  27. package/cjs/hovercard/hovercard-store.d.ts +14 -7
  28. package/cjs/menu/menu-bar-store.cjs +7 -7
  29. package/cjs/menu/menu-store.cjs +27 -27
  30. package/cjs/menu/menu-store.d.cts +16 -7
  31. package/cjs/menu/menu-store.d.ts +16 -7
  32. package/cjs/menubar/menubar-store.cjs +7 -7
  33. package/cjs/popover/popover-store.cjs +6 -6
  34. package/cjs/popover/popover-store.d.cts +31 -6
  35. package/cjs/popover/popover-store.d.ts +31 -6
  36. package/cjs/radio/radio-store.cjs +9 -9
  37. package/cjs/radio/radio-store.d.cts +2 -1
  38. package/cjs/radio/radio-store.d.ts +2 -1
  39. package/cjs/select/select-store.cjs +29 -29
  40. package/cjs/select/select-store.d.cts +2 -1
  41. package/cjs/select/select-store.d.ts +2 -1
  42. package/cjs/tab/tab-store.cjs +21 -21
  43. package/cjs/tab/tab-store.d.cts +5 -11
  44. package/cjs/tab/tab-store.d.ts +5 -11
  45. package/cjs/toolbar/toolbar-store.cjs +8 -8
  46. package/cjs/toolbar/toolbar-store.d.cts +2 -6
  47. package/cjs/toolbar/toolbar-store.d.ts +2 -6
  48. package/cjs/tooltip/tooltip-store.cjs +21 -12
  49. package/cjs/tooltip/tooltip-store.d.cts +6 -4
  50. package/cjs/tooltip/tooltip-store.d.ts +6 -4
  51. package/cjs/utils/dom.cjs +2 -2
  52. package/cjs/utils/events.cjs +5 -5
  53. package/cjs/utils/focus.cjs +13 -13
  54. package/cjs/utils/misc.cjs +4 -2
  55. package/cjs/utils/misc.d.cts +4 -0
  56. package/cjs/utils/misc.d.ts +4 -0
  57. package/cjs/utils/platform.cjs +3 -3
  58. package/cjs/utils/store.cjs +3 -3
  59. package/esm/__chunks/{I2VQ3XGR.js → 22HHDS5F.js} +13 -0
  60. package/esm/__chunks/{VEUNYQYR.js → 2H5K47H4.js} +3 -3
  61. package/esm/__chunks/{25MEC56I.js → 5RJNXXU2.js} +1 -1
  62. package/esm/__chunks/{QJ5CUA32.js → BRS7GKWU.js} +3 -3
  63. package/esm/__chunks/{AKMSZ36N.js → MFZZDIHG.js} +3 -3
  64. package/esm/__chunks/{UUFF4PQ6.js → PXYVPXSS.js} +3 -3
  65. package/esm/__chunks/{K6ELJFXN.js → R676XYVY.js} +1 -1
  66. package/esm/__chunks/{DLOEKDPY.js → RRSZHCH6.js} +1 -2
  67. package/esm/__chunks/{MYUKSFP5.js → URUD7X4C.js} +14 -5
  68. package/esm/__chunks/{MHPO2BXA.js → VDNATJW2.js} +1 -1
  69. package/esm/__chunks/{L5RYKTVQ.js → WCKXDMU7.js} +3 -2
  70. package/esm/checkbox/checkbox-store.js +2 -2
  71. package/esm/collection/collection-store.js +4 -4
  72. package/esm/combobox/combobox-store.js +9 -9
  73. package/esm/composite/composite-overflow-store.js +5 -5
  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.d.ts +1 -1
  79. package/esm/form/form-store.js +4 -4
  80. package/esm/hovercard/hovercard-store.d.ts +14 -7
  81. package/esm/hovercard/hovercard-store.js +6 -6
  82. package/esm/menu/menu-bar-store.js +6 -6
  83. package/esm/menu/menu-store.d.ts +16 -7
  84. package/esm/menu/menu-store.js +9 -9
  85. package/esm/menubar/menubar-store.js +6 -6
  86. package/esm/popover/popover-store.d.ts +31 -6
  87. package/esm/popover/popover-store.js +5 -5
  88. package/esm/radio/radio-store.d.ts +2 -1
  89. package/esm/radio/radio-store.js +5 -5
  90. package/esm/select/select-store.d.ts +2 -1
  91. package/esm/select/select-store.js +8 -8
  92. package/esm/tab/tab-store.d.ts +5 -11
  93. package/esm/tab/tab-store.js +5 -5
  94. package/esm/toolbar/toolbar-store.d.ts +2 -6
  95. package/esm/toolbar/toolbar-store.js +5 -5
  96. package/esm/tooltip/tooltip-store.d.ts +6 -4
  97. package/esm/tooltip/tooltip-store.js +15 -6
  98. package/esm/utils/dom.js +1 -1
  99. package/esm/utils/events.js +2 -2
  100. package/esm/utils/focus.js +1 -1
  101. package/esm/utils/misc.d.ts +4 -0
  102. package/esm/utils/misc.js +3 -1
  103. package/esm/utils/platform.js +2 -2
  104. package/esm/utils/store.js +2 -2
  105. package/package.json +1 -1
@@ -1,13 +1,13 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _Y6PHIDP6cjs = require('../__chunks/Y6PHIDP6.cjs');
5
- require('../__chunks/MFSCSSBJ.cjs');
6
- require('../__chunks/MWNFQD55.cjs');
4
+ var _5JEQEZFRcjs = require('../__chunks/5JEQEZFR.cjs');
5
+ require('../__chunks/LTLFSC4X.cjs');
6
+ require('../__chunks/AETQC2AR.cjs');
7
7
 
8
8
 
9
- var _ZXCB7MXNcjs = require('../__chunks/ZXCB7MXN.cjs');
10
- require('../__chunks/YLMJBIQM.cjs');
9
+ var _Y7KNI5NScjs = require('../__chunks/Y7KNI5NS.cjs');
10
+ require('../__chunks/FFZYCAXA.cjs');
11
11
 
12
12
 
13
13
 
@@ -16,11 +16,11 @@ require('../__chunks/YLMJBIQM.cjs');
16
16
 
17
17
 
18
18
 
19
- var _5CBCKBZ2cjs = require('../__chunks/5CBCKBZ2.cjs');
19
+ var _B4LYZ4EMcjs = require('../__chunks/B4LYZ4EM.cjs');
20
20
 
21
21
 
22
- var _3UT5FE6Kcjs = require('../__chunks/3UT5FE6K.cjs');
23
- require('../__chunks/5F4DVUNS.cjs');
22
+ var _EEDWPDM2cjs = require('../__chunks/EEDWPDM2.cjs');
23
+ require('../__chunks/UKR6TQI3.cjs');
24
24
 
25
25
 
26
26
  var _ULSPM3Y3cjs = require('../__chunks/ULSPM3Y3.cjs');
@@ -37,9 +37,9 @@ function createSelectStore(_a = {}) {
37
37
  } = _b, props = _AV6KTKLEcjs.__objRest.call(void 0, _b, [
38
38
  "combobox"
39
39
  ]);
40
- const store = _5CBCKBZ2cjs.mergeStore.call(void 0,
40
+ const store = _B4LYZ4EMcjs.mergeStore.call(void 0,
41
41
  props.store,
42
- _5CBCKBZ2cjs.omit.call(void 0, combobox, [
42
+ _B4LYZ4EMcjs.omit.call(void 0, combobox, [
43
43
  "value",
44
44
  "items",
45
45
  "renderedItems",
@@ -51,35 +51,35 @@ function createSelectStore(_a = {}) {
51
51
  "disclosureElement"
52
52
  ])
53
53
  );
54
- _5CBCKBZ2cjs.throwOnConflictingProps.call(void 0, props, store);
54
+ _B4LYZ4EMcjs.throwOnConflictingProps.call(void 0, props, store);
55
55
  const syncState = store.getState();
56
- const composite = _ZXCB7MXNcjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
56
+ const composite = _Y7KNI5NScjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
57
57
  store,
58
- virtualFocus: _3UT5FE6Kcjs.defaultValue.call(void 0,
58
+ virtualFocus: _EEDWPDM2cjs.defaultValue.call(void 0,
59
59
  props.virtualFocus,
60
60
  syncState.virtualFocus,
61
61
  true
62
62
  ),
63
- includesBaseElement: _3UT5FE6Kcjs.defaultValue.call(void 0,
63
+ includesBaseElement: _EEDWPDM2cjs.defaultValue.call(void 0,
64
64
  props.includesBaseElement,
65
65
  syncState.includesBaseElement,
66
66
  false
67
67
  ),
68
- activeId: _3UT5FE6Kcjs.defaultValue.call(void 0,
68
+ activeId: _EEDWPDM2cjs.defaultValue.call(void 0,
69
69
  props.activeId,
70
70
  syncState.activeId,
71
71
  props.defaultActiveId,
72
72
  null
73
73
  ),
74
- orientation: _3UT5FE6Kcjs.defaultValue.call(void 0,
74
+ orientation: _EEDWPDM2cjs.defaultValue.call(void 0,
75
75
  props.orientation,
76
76
  syncState.orientation,
77
77
  "vertical"
78
78
  )
79
79
  }));
80
- const popover = _Y6PHIDP6cjs.createPopoverStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
80
+ const popover = _5JEQEZFRcjs.createPopoverStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
81
81
  store,
82
- placement: _3UT5FE6Kcjs.defaultValue.call(void 0,
82
+ placement: _EEDWPDM2cjs.defaultValue.call(void 0,
83
83
  props.placement,
84
84
  syncState.placement,
85
85
  "bottom-start"
@@ -87,24 +87,24 @@ function createSelectStore(_a = {}) {
87
87
  }));
88
88
  const initialValue = new String("");
89
89
  const initialState = _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, composite.getState()), popover.getState()), {
90
- value: _3UT5FE6Kcjs.defaultValue.call(void 0,
90
+ value: _EEDWPDM2cjs.defaultValue.call(void 0,
91
91
  props.value,
92
92
  syncState.value,
93
93
  props.defaultValue,
94
94
  initialValue
95
95
  ),
96
- setValueOnMove: _3UT5FE6Kcjs.defaultValue.call(void 0,
96
+ setValueOnMove: _EEDWPDM2cjs.defaultValue.call(void 0,
97
97
  props.setValueOnMove,
98
98
  syncState.setValueOnMove,
99
99
  false
100
100
  ),
101
- selectElement: _3UT5FE6Kcjs.defaultValue.call(void 0, syncState.selectElement, null),
102
- labelElement: _3UT5FE6Kcjs.defaultValue.call(void 0, syncState.labelElement, null)
101
+ selectElement: _EEDWPDM2cjs.defaultValue.call(void 0, syncState.selectElement, null),
102
+ labelElement: _EEDWPDM2cjs.defaultValue.call(void 0, syncState.labelElement, null)
103
103
  });
104
- const select = _5CBCKBZ2cjs.createStore.call(void 0, initialState, composite, popover, store);
105
- _5CBCKBZ2cjs.setup.call(void 0,
104
+ const select = _B4LYZ4EMcjs.createStore.call(void 0, initialState, composite, popover, store);
105
+ _B4LYZ4EMcjs.setup.call(void 0,
106
106
  select,
107
- () => _5CBCKBZ2cjs.sync.call(void 0, select, ["value", "items"], (state) => {
107
+ () => _B4LYZ4EMcjs.sync.call(void 0, select, ["value", "items"], (state) => {
108
108
  if (state.value !== initialValue)
109
109
  return;
110
110
  if (!state.items.length)
@@ -117,9 +117,9 @@ function createSelectStore(_a = {}) {
117
117
  select.setState("value", item.value);
118
118
  })
119
119
  );
120
- _5CBCKBZ2cjs.setup.call(void 0,
120
+ _B4LYZ4EMcjs.setup.call(void 0,
121
121
  select,
122
- () => _5CBCKBZ2cjs.sync.call(void 0, select, ["mounted", "items", "value"], (state) => {
122
+ () => _B4LYZ4EMcjs.sync.call(void 0, select, ["mounted", "items", "value"], (state) => {
123
123
  if (combobox)
124
124
  return;
125
125
  if (state.mounted)
@@ -136,9 +136,9 @@ function createSelectStore(_a = {}) {
136
136
  select.setState("activeId", item.id);
137
137
  })
138
138
  );
139
- _5CBCKBZ2cjs.setup.call(void 0,
139
+ _B4LYZ4EMcjs.setup.call(void 0,
140
140
  select,
141
- () => _5CBCKBZ2cjs.batch.call(void 0, select, ["setValueOnMove", "moves"], (state) => {
141
+ () => _B4LYZ4EMcjs.batch.call(void 0, select, ["setValueOnMove", "moves"], (state) => {
142
142
  const { mounted, value, activeId } = select.getState();
143
143
  if (!state.setValueOnMove && mounted)
144
144
  return;
@@ -60,7 +60,8 @@ export interface SelectStoreState<T extends SelectStoreValue = SelectStoreValue>
60
60
  }
61
61
  export interface SelectStoreFunctions<T extends SelectStoreValue = SelectStoreValue> extends Pick<SelectStoreOptions<T>, "combobox">, CompositeStoreFunctions<SelectStoreItem>, PopoverStoreFunctions {
62
62
  /**
63
- * Sets the `value` state.
63
+ * Sets the [`value`](https://ariakit.org/reference/select-provider#value)
64
+ * state.
64
65
  * @example
65
66
  * store.setValue("Apple");
66
67
  * store.setValue(["Apple", "Banana"]);
@@ -60,7 +60,8 @@ export interface SelectStoreState<T extends SelectStoreValue = SelectStoreValue>
60
60
  }
61
61
  export interface SelectStoreFunctions<T extends SelectStoreValue = SelectStoreValue> extends Pick<SelectStoreOptions<T>, "combobox">, CompositeStoreFunctions<SelectStoreItem>, PopoverStoreFunctions {
62
62
  /**
63
- * Sets the `value` state.
63
+ * Sets the [`value`](https://ariakit.org/reference/select-provider#value)
64
+ * state.
64
65
  * @example
65
66
  * store.setValue("Apple");
66
67
  * store.setValue(["Apple", "Banana"]);
@@ -1,20 +1,20 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _ZXCB7MXNcjs = require('../__chunks/ZXCB7MXN.cjs');
4
+ var _Y7KNI5NScjs = require('../__chunks/Y7KNI5NS.cjs');
5
5
 
6
6
 
7
- var _YLMJBIQMcjs = require('../__chunks/YLMJBIQM.cjs');
7
+ var _FFZYCAXAcjs = require('../__chunks/FFZYCAXA.cjs');
8
8
 
9
9
 
10
10
 
11
11
 
12
12
 
13
- var _5CBCKBZ2cjs = require('../__chunks/5CBCKBZ2.cjs');
13
+ var _B4LYZ4EMcjs = require('../__chunks/B4LYZ4EM.cjs');
14
14
 
15
15
 
16
- var _3UT5FE6Kcjs = require('../__chunks/3UT5FE6K.cjs');
17
- require('../__chunks/5F4DVUNS.cjs');
16
+ var _EEDWPDM2cjs = require('../__chunks/EEDWPDM2.cjs');
17
+ require('../__chunks/UKR6TQI3.cjs');
18
18
  require('../__chunks/ULSPM3Y3.cjs');
19
19
 
20
20
 
@@ -25,32 +25,32 @@ var _AV6KTKLEcjs = require('../__chunks/AV6KTKLE.cjs');
25
25
  function createTabStore(props = {}) {
26
26
  var _a;
27
27
  const syncState = (_a = props.store) == null ? void 0 : _a.getState();
28
- const composite = _ZXCB7MXNcjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
29
- orientation: _3UT5FE6Kcjs.defaultValue.call(void 0,
28
+ const composite = _Y7KNI5NScjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
29
+ orientation: _EEDWPDM2cjs.defaultValue.call(void 0,
30
30
  props.orientation,
31
31
  syncState == null ? void 0 : syncState.orientation,
32
32
  "horizontal"
33
33
  ),
34
- focusLoop: _3UT5FE6Kcjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true)
34
+ focusLoop: _EEDWPDM2cjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true)
35
35
  }));
36
- const panels = _YLMJBIQMcjs.createCollectionStore.call(void 0, );
36
+ const panels = _FFZYCAXAcjs.createCollectionStore.call(void 0, );
37
37
  const initialState = _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, composite.getState()), {
38
- selectedId: _3UT5FE6Kcjs.defaultValue.call(void 0,
38
+ selectedId: _EEDWPDM2cjs.defaultValue.call(void 0,
39
39
  props.selectedId,
40
40
  syncState == null ? void 0 : syncState.selectedId,
41
41
  props.defaultSelectedId,
42
42
  void 0
43
43
  ),
44
- selectOnMove: _3UT5FE6Kcjs.defaultValue.call(void 0,
44
+ selectOnMove: _EEDWPDM2cjs.defaultValue.call(void 0,
45
45
  props.selectOnMove,
46
46
  syncState == null ? void 0 : syncState.selectOnMove,
47
47
  true
48
48
  )
49
49
  });
50
- const tab = _5CBCKBZ2cjs.createStore.call(void 0, initialState, composite, props.store);
51
- _5CBCKBZ2cjs.setup.call(void 0,
50
+ const tab = _B4LYZ4EMcjs.createStore.call(void 0, initialState, composite, props.store);
51
+ _B4LYZ4EMcjs.setup.call(void 0,
52
52
  tab,
53
- () => _5CBCKBZ2cjs.sync.call(void 0, tab, ["moves"], () => {
53
+ () => _B4LYZ4EMcjs.sync.call(void 0, tab, ["moves"], () => {
54
54
  const { activeId, selectOnMove } = tab.getState();
55
55
  if (!selectOnMove)
56
56
  return;
@@ -66,17 +66,17 @@ function createTabStore(props = {}) {
66
66
  tab.setState("selectedId", tabItem.id);
67
67
  })
68
68
  );
69
- _5CBCKBZ2cjs.setup.call(void 0,
69
+ _B4LYZ4EMcjs.setup.call(void 0,
70
70
  tab,
71
- () => _5CBCKBZ2cjs.batch.call(void 0,
71
+ () => _B4LYZ4EMcjs.batch.call(void 0,
72
72
  tab,
73
73
  ["selectedId"],
74
74
  (state) => tab.setState("activeId", state.selectedId)
75
75
  )
76
76
  );
77
- _5CBCKBZ2cjs.setup.call(void 0,
77
+ _B4LYZ4EMcjs.setup.call(void 0,
78
78
  tab,
79
- () => _5CBCKBZ2cjs.sync.call(void 0, tab, ["selectedId", "renderedItems"], (state) => {
79
+ () => _B4LYZ4EMcjs.sync.call(void 0, tab, ["selectedId", "renderedItems"], (state) => {
80
80
  if (state.selectedId !== void 0)
81
81
  return;
82
82
  const { activeId, renderedItems } = tab.getState();
@@ -91,13 +91,13 @@ function createTabStore(props = {}) {
91
91
  }
92
92
  })
93
93
  );
94
- _5CBCKBZ2cjs.setup.call(void 0,
94
+ _B4LYZ4EMcjs.setup.call(void 0,
95
95
  tab,
96
- () => _5CBCKBZ2cjs.sync.call(void 0, tab, ["renderedItems"], (state) => {
96
+ () => _B4LYZ4EMcjs.sync.call(void 0, tab, ["renderedItems"], (state) => {
97
97
  const tabs = state.renderedItems;
98
98
  if (!tabs.length)
99
99
  return;
100
- return _5CBCKBZ2cjs.sync.call(void 0, panels, ["renderedItems"], (state2) => {
100
+ return _B4LYZ4EMcjs.sync.call(void 0, panels, ["renderedItems"], (state2) => {
101
101
  const items = state2.renderedItems;
102
102
  const hasOrphanPanels = items.some((panel) => !panel.tabId);
103
103
  if (!hasOrphanPanels)
@@ -10,13 +10,9 @@ export interface TabStorePanel extends CollectionStoreItem {
10
10
  tabId?: string | null;
11
11
  }
12
12
  export interface TabStoreState extends CompositeStoreState<TabStoreItem> {
13
- /**
14
- * @default "horizontal"
15
- */
13
+ /** @default "horizontal" */
16
14
  orientation: CompositeStoreState<TabStoreItem>["orientation"];
17
- /**
18
- * @default true
19
- */
15
+ /** @default true */
20
16
  focusLoop: CompositeStoreState<TabStoreItem>["focusLoop"];
21
17
  /**
22
18
  * The id of the tab whose panel is currently visible. If it's `undefined`, it
@@ -28,8 +24,9 @@ export interface TabStoreState extends CompositeStoreState<TabStoreItem> {
28
24
  */
29
25
  selectedId: TabStoreState["activeId"];
30
26
  /**
31
- * Whether the tab should be selected when it receives focus. If it's set to
32
- * `false`, the tab will be selected only when it's clicked.
27
+ * Determines if the tab should be selected when it receives focus. If set to
28
+ * `false`, the tab will only be selected upon clicking, not when
29
+ * using arrow keys to shift focus.
33
30
  *
34
31
  * Live examples:
35
32
  * - [Tab with React Router](https://ariakit.org/examples/tab-react-router)
@@ -44,9 +41,6 @@ export interface TabStoreFunctions extends CompositeStoreFunctions<TabStoreItem>
44
41
  * without moving focus. If you want to move focus, use the
45
42
  * [`select`](https://ariakit.org/reference/use-tab-store#select) function
46
43
  * instead.
47
- *
48
- * Live examples:
49
- * - [Tab with React Router](https://ariakit.org/examples/tab-react-router)
50
44
  * @example
51
45
  * // Selects the tab with id "tab-1"
52
46
  * store.setSelectedId("tab-1");
@@ -10,13 +10,9 @@ export interface TabStorePanel extends CollectionStoreItem {
10
10
  tabId?: string | null;
11
11
  }
12
12
  export interface TabStoreState extends CompositeStoreState<TabStoreItem> {
13
- /**
14
- * @default "horizontal"
15
- */
13
+ /** @default "horizontal" */
16
14
  orientation: CompositeStoreState<TabStoreItem>["orientation"];
17
- /**
18
- * @default true
19
- */
15
+ /** @default true */
20
16
  focusLoop: CompositeStoreState<TabStoreItem>["focusLoop"];
21
17
  /**
22
18
  * The id of the tab whose panel is currently visible. If it's `undefined`, it
@@ -28,8 +24,9 @@ export interface TabStoreState extends CompositeStoreState<TabStoreItem> {
28
24
  */
29
25
  selectedId: TabStoreState["activeId"];
30
26
  /**
31
- * Whether the tab should be selected when it receives focus. If it's set to
32
- * `false`, the tab will be selected only when it's clicked.
27
+ * Determines if the tab should be selected when it receives focus. If set to
28
+ * `false`, the tab will only be selected upon clicking, not when
29
+ * using arrow keys to shift focus.
33
30
  *
34
31
  * Live examples:
35
32
  * - [Tab with React Router](https://ariakit.org/examples/tab-react-router)
@@ -44,9 +41,6 @@ export interface TabStoreFunctions extends CompositeStoreFunctions<TabStoreItem>
44
41
  * without moving focus. If you want to move focus, use the
45
42
  * [`select`](https://ariakit.org/reference/use-tab-store#select) function
46
43
  * instead.
47
- *
48
- * Live examples:
49
- * - [Tab with React Router](https://ariakit.org/examples/tab-react-router)
50
44
  * @example
51
45
  * // Selects the tab with id "tab-1"
52
46
  * store.setSelectedId("tab-1");
@@ -1,13 +1,13 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _ZXCB7MXNcjs = require('../__chunks/ZXCB7MXN.cjs');
5
- require('../__chunks/YLMJBIQM.cjs');
6
- require('../__chunks/5CBCKBZ2.cjs');
4
+ var _Y7KNI5NScjs = require('../__chunks/Y7KNI5NS.cjs');
5
+ require('../__chunks/FFZYCAXA.cjs');
6
+ require('../__chunks/B4LYZ4EM.cjs');
7
7
 
8
8
 
9
- var _3UT5FE6Kcjs = require('../__chunks/3UT5FE6K.cjs');
10
- require('../__chunks/5F4DVUNS.cjs');
9
+ var _EEDWPDM2cjs = require('../__chunks/EEDWPDM2.cjs');
10
+ require('../__chunks/UKR6TQI3.cjs');
11
11
  require('../__chunks/ULSPM3Y3.cjs');
12
12
 
13
13
 
@@ -18,13 +18,13 @@ var _AV6KTKLEcjs = require('../__chunks/AV6KTKLE.cjs');
18
18
  function createToolbarStore(props = {}) {
19
19
  var _a;
20
20
  const syncState = (_a = props.store) == null ? void 0 : _a.getState();
21
- return _ZXCB7MXNcjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
22
- orientation: _3UT5FE6Kcjs.defaultValue.call(void 0,
21
+ return _Y7KNI5NScjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
22
+ orientation: _EEDWPDM2cjs.defaultValue.call(void 0,
23
23
  props.orientation,
24
24
  syncState == null ? void 0 : syncState.orientation,
25
25
  "horizontal"
26
26
  ),
27
- focusLoop: _3UT5FE6Kcjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true)
27
+ focusLoop: _EEDWPDM2cjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true)
28
28
  }));
29
29
  }
30
30
 
@@ -5,13 +5,9 @@ import type { Store, StoreOptions, StoreProps } from "../utils/store.js";
5
5
  */
6
6
  export declare function createToolbarStore(props?: ToolbarStoreProps): ToolbarStore;
7
7
  export interface ToolbarStoreState extends CompositeStoreState {
8
- /**
9
- * @default "horizontal"
10
- */
8
+ /** @default "horizontal" */
11
9
  orientation: CompositeStoreState["orientation"];
12
- /**
13
- * @default true
14
- */
10
+ /** @default true */
15
11
  focusLoop: CompositeStoreState["focusLoop"];
16
12
  }
17
13
  export interface ToolbarStoreFunctions extends CompositeStoreFunctions {
@@ -5,13 +5,9 @@ import type { Store, StoreOptions, StoreProps } from "../utils/store.js";
5
5
  */
6
6
  export declare function createToolbarStore(props?: ToolbarStoreProps): ToolbarStore;
7
7
  export interface ToolbarStoreState extends CompositeStoreState {
8
- /**
9
- * @default "horizontal"
10
- */
8
+ /** @default "horizontal" */
11
9
  orientation: CompositeStoreState["orientation"];
12
- /**
13
- * @default true
14
- */
10
+ /** @default true */
15
11
  focusLoop: CompositeStoreState["focusLoop"];
16
12
  }
17
13
  export interface ToolbarStoreFunctions extends CompositeStoreFunctions {
@@ -1,16 +1,16 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _HMO4CKUPcjs = require('../__chunks/HMO4CKUP.cjs');
5
- require('../__chunks/Y6PHIDP6.cjs');
6
- require('../__chunks/MFSCSSBJ.cjs');
7
- require('../__chunks/MWNFQD55.cjs');
4
+ var _UEZLSKZ4cjs = require('../__chunks/UEZLSKZ4.cjs');
5
+ require('../__chunks/5JEQEZFR.cjs');
6
+ require('../__chunks/LTLFSC4X.cjs');
7
+ require('../__chunks/AETQC2AR.cjs');
8
8
 
9
9
 
10
- var _5CBCKBZ2cjs = require('../__chunks/5CBCKBZ2.cjs');
10
+ var _B4LYZ4EMcjs = require('../__chunks/B4LYZ4EM.cjs');
11
11
 
12
12
 
13
- var _3UT5FE6Kcjs = require('../__chunks/3UT5FE6K.cjs');
13
+ var _EEDWPDM2cjs = require('../__chunks/EEDWPDM2.cjs');
14
14
 
15
15
 
16
16
 
@@ -19,20 +19,29 @@ var _AV6KTKLEcjs = require('../__chunks/AV6KTKLE.cjs');
19
19
  // src/tooltip/tooltip-store.ts
20
20
  function createTooltipStore(props = {}) {
21
21
  var _a;
22
+ if (process.env.NODE_ENV !== "production") {
23
+ if (props.type === "label") {
24
+ console.warn(
25
+ "The `type` option on the tooltip store is deprecated.",
26
+ "Render a visually hidden label or use the `aria-label` or `aria-labelledby` attributes on the anchor element instead.",
27
+ "See https://ariakit.org/components/tooltip#tooltip-anchors-must-have-accessible-names"
28
+ );
29
+ }
30
+ }
22
31
  const syncState = (_a = props.store) == null ? void 0 : _a.getState();
23
- const hovercard = _HMO4CKUPcjs.createHovercardStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
24
- placement: _3UT5FE6Kcjs.defaultValue.call(void 0,
32
+ const hovercard = _UEZLSKZ4cjs.createHovercardStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
33
+ placement: _EEDWPDM2cjs.defaultValue.call(void 0,
25
34
  props.placement,
26
35
  syncState == null ? void 0 : syncState.placement,
27
36
  "top"
28
37
  ),
29
- hideTimeout: _3UT5FE6Kcjs.defaultValue.call(void 0, props.hideTimeout, syncState == null ? void 0 : syncState.hideTimeout, 0)
38
+ hideTimeout: _EEDWPDM2cjs.defaultValue.call(void 0, props.hideTimeout, syncState == null ? void 0 : syncState.hideTimeout, 0)
30
39
  }));
31
40
  const initialState = _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, hovercard.getState()), {
32
- type: _3UT5FE6Kcjs.defaultValue.call(void 0, props.type, syncState == null ? void 0 : syncState.type, "description"),
33
- skipTimeout: _3UT5FE6Kcjs.defaultValue.call(void 0, props.skipTimeout, syncState == null ? void 0 : syncState.skipTimeout, 300)
41
+ type: _EEDWPDM2cjs.defaultValue.call(void 0, props.type, syncState == null ? void 0 : syncState.type, "description"),
42
+ skipTimeout: _EEDWPDM2cjs.defaultValue.call(void 0, props.skipTimeout, syncState == null ? void 0 : syncState.skipTimeout, 300)
34
43
  });
35
- const tooltip = _5CBCKBZ2cjs.createStore.call(void 0, initialState, hovercard, props.store);
44
+ const tooltip = _B4LYZ4EMcjs.createStore.call(void 0, initialState, hovercard, props.store);
36
45
  return _AV6KTKLEcjs.__spreadValues.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, hovercard), tooltip);
37
46
  }
38
47
 
@@ -5,9 +5,15 @@ import type { Store, StoreOptions, StoreProps } from "../utils/store.js";
5
5
  */
6
6
  export declare function createTooltipStore(props?: TooltipStoreProps): TooltipStore;
7
7
  export interface TooltipStoreState extends HovercardStoreState {
8
+ /** @default "top" */
9
+ placement: HovercardStoreState["placement"];
10
+ /** @default 0 */
11
+ hideTimeout?: HovercardStoreState["hideTimeout"];
8
12
  /**
9
13
  * Determines whether the tooltip is being used as a label or a description
10
14
  * for the anchor element.
15
+ * @deprecated Render a visually hidden label or use the `aria-label` or
16
+ * `aria-labelledby` attributes on the anchor element instead.
11
17
  * @default "description"
12
18
  */
13
19
  type: "label" | "description";
@@ -17,10 +23,6 @@ export interface TooltipStoreState extends HovercardStoreState {
17
23
  * @default 300
18
24
  */
19
25
  skipTimeout: number;
20
- /** @default "top" */
21
- placement: HovercardStoreState["placement"];
22
- /** @default 0 */
23
- hideTimeout?: HovercardStoreState["hideTimeout"];
24
26
  }
25
27
  export type TooltipStoreFunctions = HovercardStoreFunctions;
26
28
  export interface TooltipStoreOptions extends HovercardStoreOptions, StoreOptions<TooltipStoreState, "type" | "placement" | "timeout" | "showTimeout" | "hideTimeout" | "skipTimeout"> {
@@ -5,9 +5,15 @@ import type { Store, StoreOptions, StoreProps } from "../utils/store.js";
5
5
  */
6
6
  export declare function createTooltipStore(props?: TooltipStoreProps): TooltipStore;
7
7
  export interface TooltipStoreState extends HovercardStoreState {
8
+ /** @default "top" */
9
+ placement: HovercardStoreState["placement"];
10
+ /** @default 0 */
11
+ hideTimeout?: HovercardStoreState["hideTimeout"];
8
12
  /**
9
13
  * Determines whether the tooltip is being used as a label or a description
10
14
  * for the anchor element.
15
+ * @deprecated Render a visually hidden label or use the `aria-label` or
16
+ * `aria-labelledby` attributes on the anchor element instead.
11
17
  * @default "description"
12
18
  */
13
19
  type: "label" | "description";
@@ -17,10 +23,6 @@ export interface TooltipStoreState extends HovercardStoreState {
17
23
  * @default 300
18
24
  */
19
25
  skipTimeout: number;
20
- /** @default "top" */
21
- placement: HovercardStoreState["placement"];
22
- /** @default 0 */
23
- hideTimeout?: HovercardStoreState["hideTimeout"];
24
26
  }
25
27
  export type TooltipStoreFunctions = HovercardStoreFunctions;
26
28
  export interface TooltipStoreOptions extends HovercardStoreOptions, StoreOptions<TooltipStoreState, "type" | "placement" | "timeout" | "showTimeout" | "hideTimeout" | "skipTimeout"> {
package/cjs/utils/dom.cjs CHANGED
@@ -18,7 +18,7 @@
18
18
 
19
19
 
20
20
 
21
- var _5F4DVUNScjs = require('../__chunks/5F4DVUNS.cjs');
21
+ var _UKR6TQI3cjs = require('../__chunks/UKR6TQI3.cjs');
22
22
  require('../__chunks/AV6KTKLE.cjs');
23
23
 
24
24
 
@@ -39,4 +39,4 @@ require('../__chunks/AV6KTKLE.cjs');
39
39
 
40
40
 
41
41
 
42
- exports.canUseDOM = _5F4DVUNScjs.canUseDOM; exports.closest = _5F4DVUNScjs.closest; exports.contains = _5F4DVUNScjs.contains; exports.getActiveElement = _5F4DVUNScjs.getActiveElement; exports.getDocument = _5F4DVUNScjs.getDocument; exports.getPopupItemRole = _5F4DVUNScjs.getPopupItemRole; exports.getPopupRole = _5F4DVUNScjs.getPopupRole; exports.getScrollingElement = _5F4DVUNScjs.getScrollingElement; exports.getTextboxSelection = _5F4DVUNScjs.getTextboxSelection; exports.getWindow = _5F4DVUNScjs.getWindow; exports.isButton = _5F4DVUNScjs.isButton; exports.isFrame = _5F4DVUNScjs.isFrame; exports.isPartiallyHidden = _5F4DVUNScjs.isPartiallyHidden; exports.isTextField = _5F4DVUNScjs.isTextField; exports.isVisible = _5F4DVUNScjs.isVisible; exports.matches = _5F4DVUNScjs.matches; exports.scrollIntoViewIfNeeded = _5F4DVUNScjs.scrollIntoViewIfNeeded; exports.setSelectionRange = _5F4DVUNScjs.setSelectionRange;
42
+ exports.canUseDOM = _UKR6TQI3cjs.canUseDOM; exports.closest = _UKR6TQI3cjs.closest; exports.contains = _UKR6TQI3cjs.contains; exports.getActiveElement = _UKR6TQI3cjs.getActiveElement; exports.getDocument = _UKR6TQI3cjs.getDocument; exports.getPopupItemRole = _UKR6TQI3cjs.getPopupItemRole; exports.getPopupRole = _UKR6TQI3cjs.getPopupRole; exports.getScrollingElement = _UKR6TQI3cjs.getScrollingElement; exports.getTextboxSelection = _UKR6TQI3cjs.getTextboxSelection; exports.getWindow = _UKR6TQI3cjs.getWindow; exports.isButton = _UKR6TQI3cjs.isButton; exports.isFrame = _UKR6TQI3cjs.isFrame; exports.isPartiallyHidden = _UKR6TQI3cjs.isPartiallyHidden; exports.isTextField = _UKR6TQI3cjs.isTextField; exports.isVisible = _UKR6TQI3cjs.isVisible; exports.matches = _UKR6TQI3cjs.matches; exports.scrollIntoViewIfNeeded = _UKR6TQI3cjs.scrollIntoViewIfNeeded; exports.setSelectionRange = _UKR6TQI3cjs.setSelectionRange;
@@ -1,10 +1,10 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _YIUPKKEKcjs = require('../__chunks/YIUPKKEK.cjs');
4
+ var _7DU6YMLQcjs = require('../__chunks/7DU6YMLQ.cjs');
5
5
 
6
6
 
7
- var _5F4DVUNScjs = require('../__chunks/5F4DVUNS.cjs');
7
+ var _UKR6TQI3cjs = require('../__chunks/UKR6TQI3.cjs');
8
8
 
9
9
 
10
10
 
@@ -13,7 +13,7 @@ var _AV6KTKLEcjs = require('../__chunks/AV6KTKLE.cjs');
13
13
  // src/utils/events.ts
14
14
  function isPortalEvent(event) {
15
15
  return Boolean(
16
- event.currentTarget && !_5F4DVUNScjs.contains.call(void 0, event.currentTarget, event.target)
16
+ event.currentTarget && !_UKR6TQI3cjs.contains.call(void 0, event.currentTarget, event.target)
17
17
  );
18
18
  }
19
19
  function isSelfTarget(event) {
@@ -23,7 +23,7 @@ function isOpeningInNewTab(event) {
23
23
  const element = event.currentTarget;
24
24
  if (!element)
25
25
  return false;
26
- const isAppleDevice = _YIUPKKEKcjs.isApple.call(void 0, );
26
+ const isAppleDevice = _7DU6YMLQcjs.isApple.call(void 0, );
27
27
  if (isAppleDevice && !event.metaKey)
28
28
  return false;
29
29
  if (!isAppleDevice && !event.ctrlKey)
@@ -81,7 +81,7 @@ function fireClickEvent(element, eventInit) {
81
81
  function isFocusEventOutside(event, container) {
82
82
  const containerElement = container || event.currentTarget;
83
83
  const relatedTarget = event.relatedTarget;
84
- return !relatedTarget || !_5F4DVUNScjs.contains.call(void 0, containerElement, relatedTarget);
84
+ return !relatedTarget || !_UKR6TQI3cjs.contains.call(void 0, containerElement, relatedTarget);
85
85
  }
86
86
  function queueBeforeEvent(element, type, callback) {
87
87
  const raf = requestAnimationFrame(() => {