@ariakit/core 0.4.18 → 0.4.19

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 (126) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/cjs/__chunks/{MJNGPYVQ.cjs → 2RUCRSRF.cjs} +16 -16
  3. package/cjs/__chunks/{6BYUUR4M.cjs → 4TRESXTO.cjs} +7 -1
  4. package/cjs/__chunks/{AOXAROPF.cjs → 75F3RDBE.cjs} +14 -14
  5. package/cjs/__chunks/{SHOLYDNP.cjs → CTEQSOKZ.cjs} +2 -2
  6. package/cjs/__chunks/{T247D7JS.cjs → CVLMIMPT.cjs} +2 -2
  7. package/cjs/__chunks/{JNPL5IHP.cjs → G2CSOTWZ.cjs} +7 -7
  8. package/cjs/__chunks/{4ITB54IT.cjs → I4CBIWTX.cjs} +2 -3
  9. package/cjs/__chunks/{JNYCP2QO.cjs → LS2SNHDM.cjs} +6 -6
  10. package/cjs/__chunks/{UROTDZFK.cjs → R37KOEUW.cjs} +10 -10
  11. package/cjs/__chunks/{OYTZFOIJ.cjs → UGAVMSQJ.cjs} +18 -18
  12. package/cjs/__chunks/{HGVIF2R4.cjs → VC22SYOD.cjs} +24 -21
  13. package/cjs/__chunks/{WPBYRKFQ.cjs → WMTGHDLE.cjs} +15 -15
  14. package/cjs/checkbox/checkbox-store.cjs +5 -5
  15. package/cjs/checkbox/checkbox-store.d.cts +5 -5
  16. package/cjs/checkbox/checkbox-store.d.ts +5 -5
  17. package/cjs/collection/collection-store.cjs +5 -5
  18. package/cjs/collection/collection-store.d.cts +5 -5
  19. package/cjs/collection/collection-store.d.ts +5 -5
  20. package/cjs/combobox/combobox-store.cjs +40 -40
  21. package/cjs/combobox/combobox-store.d.cts +26 -26
  22. package/cjs/combobox/combobox-store.d.ts +26 -26
  23. package/cjs/composite/composite-overflow-store.cjs +6 -6
  24. package/cjs/composite/composite-store.cjs +6 -6
  25. package/cjs/composite/composite-store.d.cts +62 -54
  26. package/cjs/composite/composite-store.d.ts +62 -54
  27. package/cjs/dialog/dialog-store.cjs +5 -5
  28. package/cjs/disclosure/disclosure-store.cjs +4 -4
  29. package/cjs/disclosure/disclosure-store.d.cts +22 -22
  30. package/cjs/disclosure/disclosure-store.d.ts +22 -22
  31. package/cjs/form/form-store.cjs +41 -37
  32. package/cjs/form/form-store.d.cts +14 -14
  33. package/cjs/form/form-store.d.ts +14 -14
  34. package/cjs/hovercard/hovercard-store.cjs +7 -7
  35. package/cjs/hovercard/hovercard-store.d.cts +10 -10
  36. package/cjs/hovercard/hovercard-store.d.ts +10 -10
  37. package/cjs/menu/menu-bar-store.cjs +7 -7
  38. package/cjs/menu/menu-store.cjs +27 -27
  39. package/cjs/menu/menu-store.d.cts +10 -10
  40. package/cjs/menu/menu-store.d.ts +10 -10
  41. package/cjs/menubar/menubar-store.cjs +7 -7
  42. package/cjs/popover/popover-store.cjs +6 -6
  43. package/cjs/popover/popover-store.d.cts +17 -17
  44. package/cjs/popover/popover-store.d.ts +17 -17
  45. package/cjs/radio/radio-store.cjs +9 -9
  46. package/cjs/radio/radio-store.d.cts +1 -1
  47. package/cjs/radio/radio-store.d.ts +1 -1
  48. package/cjs/select/select-store.cjs +32 -32
  49. package/cjs/select/select-store.d.cts +17 -17
  50. package/cjs/select/select-store.d.ts +17 -17
  51. package/cjs/tab/tab-store.cjs +32 -32
  52. package/cjs/tab/tab-store.d.cts +20 -20
  53. package/cjs/tab/tab-store.d.ts +20 -20
  54. package/cjs/tag/tag-store.cjs +16 -16
  55. package/cjs/tag/tag-store.d.cts +5 -5
  56. package/cjs/tag/tag-store.d.ts +5 -5
  57. package/cjs/toolbar/toolbar-store.cjs +8 -8
  58. package/cjs/tooltip/tooltip-store.cjs +13 -13
  59. package/cjs/utils/dom.cjs +2 -2
  60. package/cjs/utils/events.cjs +6 -6
  61. package/cjs/utils/focus.cjs +12 -13
  62. package/cjs/utils/misc.cjs +4 -2
  63. package/cjs/utils/misc.d.cts +4 -0
  64. package/cjs/utils/misc.d.ts +4 -0
  65. package/cjs/utils/platform.cjs +3 -3
  66. package/cjs/utils/store.cjs +3 -3
  67. package/cjs/utils/store.d.cts +1 -1
  68. package/cjs/utils/store.d.ts +1 -1
  69. package/cjs/utils/undo.cjs +2 -2
  70. package/esm/__chunks/{KMAUV3TY.js → 7KNZCZ55.js} +1 -1
  71. package/esm/__chunks/{3DNM6L6E.js → G7XPWBXK.js} +1 -2
  72. package/esm/__chunks/{SNHYQNEZ.js → GMGLSF2B.js} +1 -1
  73. package/esm/__chunks/{WSDJ6ZRB.js → H7R2CY4Q.js} +3 -3
  74. package/esm/__chunks/{75BJEVSH.js → IHNLLH3I.js} +2 -2
  75. package/esm/__chunks/{N5XGANPW.js → KZX46JDB.js} +11 -8
  76. package/esm/__chunks/{BFGNM53A.js → MJ4ZJEIM.js} +5 -5
  77. package/esm/__chunks/{TIQDSBWP.js → TEVO2DMI.js} +3 -3
  78. package/esm/__chunks/{7LM4Q2XB.js → U4NM2NCP.js} +1 -1
  79. package/esm/__chunks/{RVTIKFRL.js → UNDE2QJS.js} +3 -3
  80. package/esm/__chunks/{XMCVU3LR.js → UWJK2WK2.js} +6 -0
  81. package/esm/__chunks/{SXKM4CGU.js → XTZ53NXG.js} +4 -4
  82. package/esm/checkbox/checkbox-store.d.ts +5 -5
  83. package/esm/checkbox/checkbox-store.js +2 -2
  84. package/esm/collection/collection-store.d.ts +5 -5
  85. package/esm/collection/collection-store.js +4 -4
  86. package/esm/combobox/combobox-store.d.ts +26 -26
  87. package/esm/combobox/combobox-store.js +9 -9
  88. package/esm/composite/composite-overflow-store.js +5 -5
  89. package/esm/composite/composite-store.d.ts +62 -54
  90. package/esm/composite/composite-store.js +5 -5
  91. package/esm/dialog/dialog-store.js +4 -4
  92. package/esm/disclosure/disclosure-store.d.ts +22 -22
  93. package/esm/disclosure/disclosure-store.js +3 -3
  94. package/esm/form/form-store.d.ts +14 -14
  95. package/esm/form/form-store.js +19 -15
  96. package/esm/hovercard/hovercard-store.d.ts +10 -10
  97. package/esm/hovercard/hovercard-store.js +6 -6
  98. package/esm/menu/menu-bar-store.js +6 -6
  99. package/esm/menu/menu-store.d.ts +10 -10
  100. package/esm/menu/menu-store.js +9 -9
  101. package/esm/menubar/menubar-store.js +6 -6
  102. package/esm/popover/popover-store.d.ts +17 -17
  103. package/esm/popover/popover-store.js +5 -5
  104. package/esm/radio/radio-store.d.ts +1 -1
  105. package/esm/radio/radio-store.js +5 -5
  106. package/esm/select/select-store.d.ts +17 -17
  107. package/esm/select/select-store.js +8 -8
  108. package/esm/tab/tab-store.d.ts +20 -20
  109. package/esm/tab/tab-store.js +5 -5
  110. package/esm/tag/tag-store.d.ts +5 -5
  111. package/esm/tag/tag-store.js +7 -7
  112. package/esm/toolbar/toolbar-store.js +5 -5
  113. package/esm/tooltip/tooltip-store.js +7 -7
  114. package/esm/utils/dom.js +1 -1
  115. package/esm/utils/events.js +4 -4
  116. package/esm/utils/focus.js +2 -3
  117. package/esm/utils/misc.d.ts +4 -0
  118. package/esm/utils/misc.js +3 -1
  119. package/esm/utils/platform.js +2 -2
  120. package/esm/utils/store.d.ts +1 -1
  121. package/esm/utils/store.js +2 -2
  122. package/esm/utils/undo.js +1 -1
  123. package/package.json +20 -21
  124. package/tsconfig.build.json +7 -2
  125. package/tsconfig.node.json +5 -0
  126. package/tsconfig.test.json +5 -0
@@ -9,25 +9,25 @@ export interface DisclosureStoreState {
9
9
  * Whether the content is visible.
10
10
  *
11
11
  * Live examples:
12
- * - [Combobox with links](https://ariakit.org/examples/combobox-links)
12
+ * - [Combobox with links](https://ariakit.com/examples/combobox-links)
13
13
  * - [Dialog with React
14
- * Router](https://ariakit.org/examples/dialog-react-router)
15
- * - [Menu with Framer
16
- * Motion](https://ariakit.org/examples/menu-framer-motion)
17
- * - [Lazy Popover](https://ariakit.org/examples/popover-lazy)
14
+ * Router](https://ariakit.com/examples/dialog-react-router)
15
+ * - [Menu with
16
+ * Motion](https://ariakit.com/examples/menu-framer-motion)
17
+ * - [Lazy Popover](https://ariakit.com/examples/popover-lazy)
18
18
  * @default false
19
19
  */
20
20
  open: boolean;
21
21
  /**
22
22
  * The mounted state usually matches the
23
- * [`open`](https://ariakit.org/reference/disclosure-provider#open) value.
23
+ * [`open`](https://ariakit.com/reference/disclosure-provider#open) value.
24
24
  * However, if the content element is animated, it waits for the animation to
25
25
  * finish before turning `false`. This ensures the content element doesn't get
26
26
  * unmounted during the animation.
27
27
  *
28
28
  * Live examples:
29
- * - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
30
- * - [Responsive Popover](https://ariakit.org/examples/popover-responsive)
29
+ * - [Navigation Menubar](https://ariakit.com/examples/menubar-navigation)
30
+ * - [Responsive Popover](https://ariakit.com/examples/popover-responsive)
31
31
  */
32
32
  mounted: boolean;
33
33
  /**
@@ -55,43 +55,43 @@ export interface DisclosureStoreState {
55
55
  }
56
56
  export interface DisclosureStoreFunctions extends Pick<DisclosureStoreOptions, "disclosure"> {
57
57
  /**
58
- * Sets the [`open`](https://ariakit.org/reference/disclosure-provider#open)
58
+ * Sets the [`open`](https://ariakit.com/reference/disclosure-provider#open)
59
59
  * state.
60
60
  *
61
61
  * Live examples:
62
62
  * - [Textarea with inline
63
- * Combobox](https://ariakit.org/examples/combobox-textarea)
63
+ * Combobox](https://ariakit.com/examples/combobox-textarea)
64
64
  * @example
65
65
  * store.setOpen(true);
66
66
  * store.setOpen((open) => !open);
67
67
  */
68
68
  setOpen: SetState<DisclosureStoreState["open"]>;
69
69
  /**
70
- * Sets the [`open`](https://ariakit.org/reference/disclosure-provider#open)
70
+ * Sets the [`open`](https://ariakit.com/reference/disclosure-provider#open)
71
71
  * state to `true`.
72
72
  *
73
73
  * Live examples:
74
74
  * - [Textarea with inline
75
- * Combobox](https://ariakit.org/examples/combobox-textarea)
76
- * - [Dialog with Framer
77
- * Motion](https://ariakit.org/examples/dialog-framer-motion)
78
- * - [Context Menu](https://ariakit.org/examples/menu-context-menu)
79
- * - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
75
+ * Combobox](https://ariakit.com/examples/combobox-textarea)
76
+ * - [Dialog with
77
+ * Motion](https://ariakit.com/examples/dialog-framer-motion)
78
+ * - [Context Menu](https://ariakit.com/examples/menu-context-menu)
79
+ * - [Navigation Menubar](https://ariakit.com/examples/menubar-navigation)
80
80
  */
81
81
  show: () => void;
82
82
  /**
83
- * Sets the [`open`](https://ariakit.org/reference/disclosure-provider#open)
83
+ * Sets the [`open`](https://ariakit.com/reference/disclosure-provider#open)
84
84
  * state to `false`.
85
85
  *
86
86
  * Live examples:
87
87
  * - [Textarea with inline
88
- * Combobox](https://ariakit.org/examples/combobox-textarea)
89
- * - [Sliding Menu](https://ariakit.org/examples/menu-slide)
88
+ * Combobox](https://ariakit.com/examples/combobox-textarea)
89
+ * - [Sliding Menu](https://ariakit.com/examples/menu-slide)
90
90
  */
91
91
  hide: () => void;
92
92
  /**
93
93
  * Toggles the
94
- * [`open`](https://ariakit.org/reference/disclosure-provider#open) state.
94
+ * [`open`](https://ariakit.com/reference/disclosure-provider#open) state.
95
95
  */
96
96
  toggle: () => void;
97
97
  /**
@@ -109,7 +109,7 @@ export interface DisclosureStoreFunctions extends Pick<DisclosureStoreOptions, "
109
109
  * Sets the `disclosureElement` state.
110
110
  *
111
111
  * Live examples:
112
- * - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
112
+ * - [Navigation Menubar](https://ariakit.com/examples/menubar-navigation)
113
113
  */
114
114
  setDisclosureElement: SetState<DisclosureStoreState["disclosureElement"]>;
115
115
  }
@@ -128,7 +128,7 @@ export interface DisclosureStoreOptions extends StoreOptions<DisclosureStoreStat
128
128
  * A reference to another disclosure store that controls another disclosure
129
129
  * component to keep them in sync. Element states like `contentElement` and
130
130
  * `disclosureElement` won't be synced. For that, use the
131
- * [`store`](https://ariakit.org/reference/disclosure-provider#store) prop
131
+ * [`store`](https://ariakit.com/reference/disclosure-provider#store) prop
132
132
  * instead.
133
133
  */
134
134
  disclosure?: DisclosureStore | null;
@@ -9,25 +9,25 @@ export interface DisclosureStoreState {
9
9
  * Whether the content is visible.
10
10
  *
11
11
  * Live examples:
12
- * - [Combobox with links](https://ariakit.org/examples/combobox-links)
12
+ * - [Combobox with links](https://ariakit.com/examples/combobox-links)
13
13
  * - [Dialog with React
14
- * Router](https://ariakit.org/examples/dialog-react-router)
15
- * - [Menu with Framer
16
- * Motion](https://ariakit.org/examples/menu-framer-motion)
17
- * - [Lazy Popover](https://ariakit.org/examples/popover-lazy)
14
+ * Router](https://ariakit.com/examples/dialog-react-router)
15
+ * - [Menu with
16
+ * Motion](https://ariakit.com/examples/menu-framer-motion)
17
+ * - [Lazy Popover](https://ariakit.com/examples/popover-lazy)
18
18
  * @default false
19
19
  */
20
20
  open: boolean;
21
21
  /**
22
22
  * The mounted state usually matches the
23
- * [`open`](https://ariakit.org/reference/disclosure-provider#open) value.
23
+ * [`open`](https://ariakit.com/reference/disclosure-provider#open) value.
24
24
  * However, if the content element is animated, it waits for the animation to
25
25
  * finish before turning `false`. This ensures the content element doesn't get
26
26
  * unmounted during the animation.
27
27
  *
28
28
  * Live examples:
29
- * - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
30
- * - [Responsive Popover](https://ariakit.org/examples/popover-responsive)
29
+ * - [Navigation Menubar](https://ariakit.com/examples/menubar-navigation)
30
+ * - [Responsive Popover](https://ariakit.com/examples/popover-responsive)
31
31
  */
32
32
  mounted: boolean;
33
33
  /**
@@ -55,43 +55,43 @@ export interface DisclosureStoreState {
55
55
  }
56
56
  export interface DisclosureStoreFunctions extends Pick<DisclosureStoreOptions, "disclosure"> {
57
57
  /**
58
- * Sets the [`open`](https://ariakit.org/reference/disclosure-provider#open)
58
+ * Sets the [`open`](https://ariakit.com/reference/disclosure-provider#open)
59
59
  * state.
60
60
  *
61
61
  * Live examples:
62
62
  * - [Textarea with inline
63
- * Combobox](https://ariakit.org/examples/combobox-textarea)
63
+ * Combobox](https://ariakit.com/examples/combobox-textarea)
64
64
  * @example
65
65
  * store.setOpen(true);
66
66
  * store.setOpen((open) => !open);
67
67
  */
68
68
  setOpen: SetState<DisclosureStoreState["open"]>;
69
69
  /**
70
- * Sets the [`open`](https://ariakit.org/reference/disclosure-provider#open)
70
+ * Sets the [`open`](https://ariakit.com/reference/disclosure-provider#open)
71
71
  * state to `true`.
72
72
  *
73
73
  * Live examples:
74
74
  * - [Textarea with inline
75
- * Combobox](https://ariakit.org/examples/combobox-textarea)
76
- * - [Dialog with Framer
77
- * Motion](https://ariakit.org/examples/dialog-framer-motion)
78
- * - [Context Menu](https://ariakit.org/examples/menu-context-menu)
79
- * - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
75
+ * Combobox](https://ariakit.com/examples/combobox-textarea)
76
+ * - [Dialog with
77
+ * Motion](https://ariakit.com/examples/dialog-framer-motion)
78
+ * - [Context Menu](https://ariakit.com/examples/menu-context-menu)
79
+ * - [Navigation Menubar](https://ariakit.com/examples/menubar-navigation)
80
80
  */
81
81
  show: () => void;
82
82
  /**
83
- * Sets the [`open`](https://ariakit.org/reference/disclosure-provider#open)
83
+ * Sets the [`open`](https://ariakit.com/reference/disclosure-provider#open)
84
84
  * state to `false`.
85
85
  *
86
86
  * Live examples:
87
87
  * - [Textarea with inline
88
- * Combobox](https://ariakit.org/examples/combobox-textarea)
89
- * - [Sliding Menu](https://ariakit.org/examples/menu-slide)
88
+ * Combobox](https://ariakit.com/examples/combobox-textarea)
89
+ * - [Sliding Menu](https://ariakit.com/examples/menu-slide)
90
90
  */
91
91
  hide: () => void;
92
92
  /**
93
93
  * Toggles the
94
- * [`open`](https://ariakit.org/reference/disclosure-provider#open) state.
94
+ * [`open`](https://ariakit.com/reference/disclosure-provider#open) state.
95
95
  */
96
96
  toggle: () => void;
97
97
  /**
@@ -109,7 +109,7 @@ export interface DisclosureStoreFunctions extends Pick<DisclosureStoreOptions, "
109
109
  * Sets the `disclosureElement` state.
110
110
  *
111
111
  * Live examples:
112
- * - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
112
+ * - [Navigation Menubar](https://ariakit.com/examples/menubar-navigation)
113
113
  */
114
114
  setDisclosureElement: SetState<DisclosureStoreState["disclosureElement"]>;
115
115
  }
@@ -128,7 +128,7 @@ export interface DisclosureStoreOptions extends StoreOptions<DisclosureStoreStat
128
128
  * A reference to another disclosure store that controls another disclosure
129
129
  * component to keep them in sync. Element states like `contentElement` and
130
130
  * `disclosureElement` won't be synced. For that, use the
131
- * [`store`](https://ariakit.org/reference/disclosure-provider#store) prop
131
+ * [`store`](https://ariakit.com/reference/disclosure-provider#store) prop
132
132
  * instead.
133
133
  */
134
134
  disclosure?: DisclosureStore | null;
@@ -1,20 +1,20 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
2
 
3
- var _HGVIF2R4cjs = require('../__chunks/HGVIF2R4.cjs');
4
- require('../__chunks/4ITB54IT.cjs');
3
+ var _VC22SYODcjs = require('../__chunks/VC22SYOD.cjs');
4
+ require('../__chunks/I4CBIWTX.cjs');
5
5
 
6
6
 
7
7
 
8
8
 
9
9
 
10
10
 
11
- var _WPBYRKFQcjs = require('../__chunks/WPBYRKFQ.cjs');
11
+ var _WMTGHDLEcjs = require('../__chunks/WMTGHDLE.cjs');
12
12
 
13
13
 
14
14
 
15
15
 
16
16
 
17
- var _6BYUUR4Mcjs = require('../__chunks/6BYUUR4M.cjs');
17
+ var _4TRESXTOcjs = require('../__chunks/4TRESXTO.cjs');
18
18
 
19
19
  // src/form/form-store.ts
20
20
  function nextFrame() {
@@ -22,45 +22,49 @@ function nextFrame() {
22
22
  }
23
23
  function hasMessages(object) {
24
24
  return Object.keys(object).some((key) => {
25
- if (_6BYUUR4Mcjs.isObject.call(void 0, object[key])) {
25
+ if (_4TRESXTOcjs.isObject.call(void 0, object[key])) {
26
26
  return hasMessages(object[key]);
27
27
  }
28
28
  return !!object[key];
29
29
  });
30
30
  }
31
31
  function get(values, path, defaultValue2) {
32
- var _a;
33
- const [key, ...rest] = Array.isArray(path) ? path : `${path}`.split(".");
32
+ const [key, ...rest] = Array.isArray(path) ? path : String(path).split(".");
34
33
  if (key == null || !values) {
35
34
  return defaultValue2;
36
35
  }
37
36
  if (!rest.length) {
38
- return (_a = values[key]) != null ? _a : defaultValue2;
37
+ return _nullishCoalesce(values[key], () => ( defaultValue2));
39
38
  }
40
39
  return get(values[key], rest, defaultValue2);
41
40
  }
41
+ function getOrCreateNested(nestedValues, nextKey) {
42
+ if (Array.isArray(nestedValues) || _4TRESXTOcjs.isObject.call(void 0, nestedValues)) {
43
+ return nestedValues;
44
+ }
45
+ return _4TRESXTOcjs.isInteger.call(void 0, nextKey) ? [] : {};
46
+ }
42
47
  function set(values, path, value) {
43
- const [k, ...rest] = Array.isArray(path) ? path : `${path}`.split(".");
48
+ const [k, ...rest] = Array.isArray(path) ? path : String(path).split(".");
44
49
  if (k == null) return values;
45
50
  const key = k;
46
- const isIntegerKey = _6BYUUR4Mcjs.isInteger.call(void 0, key);
51
+ const isIntegerKey = _4TRESXTOcjs.isInteger.call(void 0, key);
47
52
  const nextValues = isIntegerKey ? values || [] : values || {};
48
53
  const nestedValues = nextValues[key];
49
- const result = rest.length && (Array.isArray(nestedValues) || _6BYUUR4Mcjs.isObject.call(void 0, nestedValues)) ? set(nestedValues, rest, value) : value;
54
+ const nextKey = rest[0];
55
+ const result = rest.length && nextKey != null ? set(getOrCreateNested(nestedValues, nextKey), rest, value) : value;
50
56
  if (isIntegerKey) {
51
57
  const index = Number(key);
52
58
  if (values && Array.isArray(values)) {
53
- return [
54
- ...values.slice(0, index),
55
- result,
56
- ...values.slice(index + 1)
57
- ];
59
+ const copy = [...values];
60
+ copy[index] = result;
61
+ return copy;
58
62
  }
59
63
  const nextValues2 = [];
60
64
  nextValues2[index] = result;
61
65
  return nextValues2;
62
66
  }
63
- return { ...values, [key]: result };
67
+ return Object.assign({}, values, { [key]: result });
64
68
  }
65
69
  function setAll(values, value) {
66
70
  const result = {};
@@ -69,12 +73,12 @@ function setAll(values, value) {
69
73
  const currentValue = values[key];
70
74
  if (Array.isArray(currentValue)) {
71
75
  result[key] = currentValue.map((v) => {
72
- if (_6BYUUR4Mcjs.isObject.call(void 0, v)) {
76
+ if (_4TRESXTOcjs.isObject.call(void 0, v)) {
73
77
  return setAll(v, value);
74
78
  }
75
79
  return value;
76
80
  });
77
- } else if (_6BYUUR4Mcjs.isObject.call(void 0, currentValue)) {
81
+ } else if (_4TRESXTOcjs.isObject.call(void 0, currentValue)) {
78
82
  result[key] = setAll(currentValue, value);
79
83
  } else {
80
84
  result[key] = value;
@@ -109,22 +113,22 @@ function createNames() {
109
113
  }
110
114
  function createFormStore(props = {}) {
111
115
  var _a;
112
- _WPBYRKFQcjs.throwOnConflictingProps.call(void 0, props, props.store);
116
+ _WMTGHDLEcjs.throwOnConflictingProps.call(void 0, props, props.store);
113
117
  const syncState = (_a = props.store) == null ? void 0 : _a.getState();
114
- const collection = _HGVIF2R4cjs.createCollectionStore.call(void 0, props);
115
- const values = _6BYUUR4Mcjs.defaultValue.call(void 0,
118
+ const collection = _VC22SYODcjs.createCollectionStore.call(void 0, props);
119
+ const values = _4TRESXTOcjs.defaultValue.call(void 0,
116
120
  props.values,
117
121
  syncState == null ? void 0 : syncState.values,
118
122
  props.defaultValues,
119
123
  {}
120
124
  );
121
- const errors = _6BYUUR4Mcjs.defaultValue.call(void 0,
125
+ const errors = _4TRESXTOcjs.defaultValue.call(void 0,
122
126
  props.errors,
123
127
  syncState == null ? void 0 : syncState.errors,
124
128
  props.defaultErrors,
125
129
  {}
126
130
  );
127
- const touched = _6BYUUR4Mcjs.defaultValue.call(void 0,
131
+ const touched = _4TRESXTOcjs.defaultValue.call(void 0,
128
132
  props.touched,
129
133
  syncState == null ? void 0 : syncState.touched,
130
134
  props.defaultTouched,
@@ -135,24 +139,24 @@ function createFormStore(props = {}) {
135
139
  values,
136
140
  errors,
137
141
  touched,
138
- validating: _6BYUUR4Mcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.validating, false),
139
- submitting: _6BYUUR4Mcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.submitting, false),
140
- submitSucceed: _6BYUUR4Mcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.submitSucceed, 0),
141
- submitFailed: _6BYUUR4Mcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.submitFailed, 0),
142
+ validating: _4TRESXTOcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.validating, false),
143
+ submitting: _4TRESXTOcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.submitting, false),
144
+ submitSucceed: _4TRESXTOcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.submitSucceed, 0),
145
+ submitFailed: _4TRESXTOcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.submitFailed, 0),
142
146
  valid: !hasMessages(errors)
143
147
  };
144
- const form = _WPBYRKFQcjs.createStore.call(void 0, initialState, collection, props.store);
148
+ const form = _WMTGHDLEcjs.createStore.call(void 0, initialState, collection, props.store);
145
149
  const syncCallbacks = getStoreCallbacks(props.store);
146
150
  const syncCallbacksState = syncCallbacks == null ? void 0 : syncCallbacks.getState();
147
151
  const callbacksInitialState = {
148
152
  validate: (syncCallbacksState == null ? void 0 : syncCallbacksState.validate) || [],
149
153
  submit: (syncCallbacksState == null ? void 0 : syncCallbacksState.submit) || []
150
154
  };
151
- const callbacks = _WPBYRKFQcjs.createStore.call(void 0, callbacksInitialState, syncCallbacks);
152
- _WPBYRKFQcjs.setup.call(void 0, form, () => _WPBYRKFQcjs.init.call(void 0, callbacks));
153
- _WPBYRKFQcjs.setup.call(void 0,
155
+ const callbacks = _WMTGHDLEcjs.createStore.call(void 0, callbacksInitialState, syncCallbacks);
156
+ _WMTGHDLEcjs.setup.call(void 0, form, () => _WMTGHDLEcjs.init.call(void 0, callbacks));
157
+ _WMTGHDLEcjs.setup.call(void 0,
154
158
  form,
155
- () => _WPBYRKFQcjs.sync.call(void 0, form, ["validating", "errors"], (state) => {
159
+ () => _WMTGHDLEcjs.sync.call(void 0, form, ["validating", "errors"], (state) => {
156
160
  if (state.validating) return;
157
161
  form.setState("valid", !hasMessages(state.errors));
158
162
  })
@@ -179,7 +183,7 @@ function createFormStore(props = {}) {
179
183
  getValue: (name) => get(form.getState().values, name),
180
184
  setValue: (name, value) => form.setState("values", (values2) => {
181
185
  const prevValue = get(values2, name);
182
- const nextValue = _6BYUUR4Mcjs.applyState.call(void 0, value, prevValue);
186
+ const nextValue = _4TRESXTOcjs.applyState.call(void 0, value, prevValue);
183
187
  if (nextValue === prevValue) return values2;
184
188
  return set(values2, name, nextValue);
185
189
  }),
@@ -199,7 +203,7 @@ function createFormStore(props = {}) {
199
203
  getError: (name) => get(form.getState().errors, name),
200
204
  setError: (name, error) => form.setState("errors", (errors2) => {
201
205
  const prevError = get(errors2, name);
202
- const nextError = _6BYUUR4Mcjs.applyState.call(void 0, error, prevError);
206
+ const nextError = _4TRESXTOcjs.applyState.call(void 0, error, prevError);
203
207
  if (nextError === prevError) return errors2;
204
208
  return set(errors2, name, nextError);
205
209
  }),
@@ -207,7 +211,7 @@ function createFormStore(props = {}) {
207
211
  getFieldTouched: (name) => !!get(form.getState().touched, name),
208
212
  setFieldTouched: (name, value) => form.setState("touched", (touched2) => {
209
213
  const prevValue = get(touched2, name);
210
- const nextValue = _6BYUUR4Mcjs.applyState.call(void 0, value, prevValue);
214
+ const nextValue = _4TRESXTOcjs.applyState.call(void 0, value, prevValue);
211
215
  if (nextValue === prevValue) return touched2;
212
216
  return set(touched2, name, nextValue);
213
217
  }),
@@ -21,8 +21,8 @@ export interface FormStoreState<T extends FormStoreValues = FormStoreValues> ext
21
21
  * Form values.
22
22
  *
23
23
  * Live examples:
24
- * - [FormRadio](https://ariakit.org/examples/form-radio)
25
- * - [FormSelect](https://ariakit.org/examples/form-select)
24
+ * - [FormRadio](https://ariakit.com/examples/form-radio)
25
+ * - [FormSelect](https://ariakit.com/examples/form-select)
26
26
  * @default {}
27
27
  */
28
28
  values: T;
@@ -48,13 +48,13 @@ export interface FormStoreState<T extends FormStoreValues = FormStoreValues> ext
48
48
  submitting: boolean;
49
49
  /**
50
50
  * The number of times
51
- * [`submit`](https://ariakit.org/reference/use-form-store#submit) has been
51
+ * [`submit`](https://ariakit.com/reference/use-form-store#submit) has been
52
52
  * called with a successful response.
53
53
  */
54
54
  submitSucceed: number;
55
55
  /**
56
56
  * The number of times
57
- * [`submit`](https://ariakit.org/reference/use-form-store#submit) has been
57
+ * [`submit`](https://ariakit.com/reference/use-form-store#submit) has been
58
58
  * called with an error response.
59
59
  */
60
60
  submitFailed: number;
@@ -64,8 +64,8 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
64
64
  * An object containing the names of the form fields for type safety.
65
65
  *
66
66
  * Live examples:
67
- * - [FormRadio](https://ariakit.org/examples/form-radio)
68
- * - [FormSelect](https://ariakit.org/examples/form-select)
67
+ * - [FormRadio](https://ariakit.com/examples/form-radio)
68
+ * - [FormSelect](https://ariakit.com/examples/form-select)
69
69
  * @example
70
70
  * store.names.name; // "name"
71
71
  * store.names.name.first; // "name.first"
@@ -73,7 +73,7 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
73
73
  */
74
74
  names: Names<T>;
75
75
  /**
76
- * Sets the [`values`](https://ariakit.org/reference/form-provider#values)
76
+ * Sets the [`values`](https://ariakit.com/reference/form-provider#values)
77
77
  * state.
78
78
  * @example
79
79
  * store.setValues({ name: "John" });
@@ -84,7 +84,7 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
84
84
  * Retrieves a field value.
85
85
  *
86
86
  * Live examples:
87
- * - [FormRadio](https://ariakit.org/examples/form-radio)
87
+ * - [FormRadio](https://ariakit.com/examples/form-radio)
88
88
  * @example
89
89
  * const nameValue = store.getValue("name");
90
90
  * // Can also use store.names for type-safety.
@@ -95,7 +95,7 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
95
95
  * Sets a field value.
96
96
  *
97
97
  * Live examples:
98
- * - [FormSelect](https://ariakit.org/examples/form-select)
98
+ * - [FormSelect](https://ariakit.com/examples/form-select)
99
99
  * @example
100
100
  * store.setValue("name", "John");
101
101
  * store.setValue("name", (value) => value + " Doe");
@@ -122,7 +122,7 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
122
122
  */
123
123
  removeValue: (name: StringLike, index: number) => void;
124
124
  /**
125
- * Sets the [`errors`](https://ariakit.org/reference/form-provider#errors)
125
+ * Sets the [`errors`](https://ariakit.com/reference/form-provider#errors)
126
126
  * state.
127
127
  * @example
128
128
  * store.setErrors({ name: "Name is required" });
@@ -141,7 +141,7 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
141
141
  * Sets a field error.
142
142
  *
143
143
  * Live examples:
144
- * - [FormRadio](https://ariakit.org/examples/form-radio)
144
+ * - [FormRadio](https://ariakit.com/examples/form-radio)
145
145
  * @example
146
146
  * store.setError("name", "Name is required");
147
147
  * store.setError("name", (error) => error + "!");
@@ -150,7 +150,7 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
150
150
  */
151
151
  setError: (name: StringLike, error: SetStateAction<ErrorMessage>) => void;
152
152
  /**
153
- * Sets the [`touched`](https://ariakit.org/reference/form-provider#touched)
153
+ * Sets the [`touched`](https://ariakit.com/reference/form-provider#touched)
154
154
  * state.
155
155
  * @example
156
156
  * store.setTouched({ name: true });
@@ -176,7 +176,7 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
176
176
  setFieldTouched: (name: StringLike, value: SetStateAction<boolean>) => void;
177
177
  /**
178
178
  * Function that accepts a callback that will be used to validate the form
179
- * when [`validate`](https://ariakit.org/reference/use-form-store#validate) is
179
+ * when [`validate`](https://ariakit.com/reference/use-form-store#validate) is
180
180
  * called. It returns a cleanup function that will remove the callback.
181
181
  * @example
182
182
  * const cleanup = store.onValidate(async (state) => {
@@ -189,7 +189,7 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
189
189
  onValidate: (callback: FormStoreCallback<FormStoreState<T>>) => () => void;
190
190
  /**
191
191
  * Function that accepts a callback that will be used to submit the form when
192
- * [`submit`](https://ariakit.org/reference/use-form-store#submit) is called.
192
+ * [`submit`](https://ariakit.com/reference/use-form-store#submit) is called.
193
193
  * It returns a cleanup function that will remove the callback.
194
194
  * @param callback The callback function.
195
195
  * @example
@@ -21,8 +21,8 @@ export interface FormStoreState<T extends FormStoreValues = FormStoreValues> ext
21
21
  * Form values.
22
22
  *
23
23
  * Live examples:
24
- * - [FormRadio](https://ariakit.org/examples/form-radio)
25
- * - [FormSelect](https://ariakit.org/examples/form-select)
24
+ * - [FormRadio](https://ariakit.com/examples/form-radio)
25
+ * - [FormSelect](https://ariakit.com/examples/form-select)
26
26
  * @default {}
27
27
  */
28
28
  values: T;
@@ -48,13 +48,13 @@ export interface FormStoreState<T extends FormStoreValues = FormStoreValues> ext
48
48
  submitting: boolean;
49
49
  /**
50
50
  * The number of times
51
- * [`submit`](https://ariakit.org/reference/use-form-store#submit) has been
51
+ * [`submit`](https://ariakit.com/reference/use-form-store#submit) has been
52
52
  * called with a successful response.
53
53
  */
54
54
  submitSucceed: number;
55
55
  /**
56
56
  * The number of times
57
- * [`submit`](https://ariakit.org/reference/use-form-store#submit) has been
57
+ * [`submit`](https://ariakit.com/reference/use-form-store#submit) has been
58
58
  * called with an error response.
59
59
  */
60
60
  submitFailed: number;
@@ -64,8 +64,8 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
64
64
  * An object containing the names of the form fields for type safety.
65
65
  *
66
66
  * Live examples:
67
- * - [FormRadio](https://ariakit.org/examples/form-radio)
68
- * - [FormSelect](https://ariakit.org/examples/form-select)
67
+ * - [FormRadio](https://ariakit.com/examples/form-radio)
68
+ * - [FormSelect](https://ariakit.com/examples/form-select)
69
69
  * @example
70
70
  * store.names.name; // "name"
71
71
  * store.names.name.first; // "name.first"
@@ -73,7 +73,7 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
73
73
  */
74
74
  names: Names<T>;
75
75
  /**
76
- * Sets the [`values`](https://ariakit.org/reference/form-provider#values)
76
+ * Sets the [`values`](https://ariakit.com/reference/form-provider#values)
77
77
  * state.
78
78
  * @example
79
79
  * store.setValues({ name: "John" });
@@ -84,7 +84,7 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
84
84
  * Retrieves a field value.
85
85
  *
86
86
  * Live examples:
87
- * - [FormRadio](https://ariakit.org/examples/form-radio)
87
+ * - [FormRadio](https://ariakit.com/examples/form-radio)
88
88
  * @example
89
89
  * const nameValue = store.getValue("name");
90
90
  * // Can also use store.names for type-safety.
@@ -95,7 +95,7 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
95
95
  * Sets a field value.
96
96
  *
97
97
  * Live examples:
98
- * - [FormSelect](https://ariakit.org/examples/form-select)
98
+ * - [FormSelect](https://ariakit.com/examples/form-select)
99
99
  * @example
100
100
  * store.setValue("name", "John");
101
101
  * store.setValue("name", (value) => value + " Doe");
@@ -122,7 +122,7 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
122
122
  */
123
123
  removeValue: (name: StringLike, index: number) => void;
124
124
  /**
125
- * Sets the [`errors`](https://ariakit.org/reference/form-provider#errors)
125
+ * Sets the [`errors`](https://ariakit.com/reference/form-provider#errors)
126
126
  * state.
127
127
  * @example
128
128
  * store.setErrors({ name: "Name is required" });
@@ -141,7 +141,7 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
141
141
  * Sets a field error.
142
142
  *
143
143
  * Live examples:
144
- * - [FormRadio](https://ariakit.org/examples/form-radio)
144
+ * - [FormRadio](https://ariakit.com/examples/form-radio)
145
145
  * @example
146
146
  * store.setError("name", "Name is required");
147
147
  * store.setError("name", (error) => error + "!");
@@ -150,7 +150,7 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
150
150
  */
151
151
  setError: (name: StringLike, error: SetStateAction<ErrorMessage>) => void;
152
152
  /**
153
- * Sets the [`touched`](https://ariakit.org/reference/form-provider#touched)
153
+ * Sets the [`touched`](https://ariakit.com/reference/form-provider#touched)
154
154
  * state.
155
155
  * @example
156
156
  * store.setTouched({ name: true });
@@ -176,7 +176,7 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
176
176
  setFieldTouched: (name: StringLike, value: SetStateAction<boolean>) => void;
177
177
  /**
178
178
  * Function that accepts a callback that will be used to validate the form
179
- * when [`validate`](https://ariakit.org/reference/use-form-store#validate) is
179
+ * when [`validate`](https://ariakit.com/reference/use-form-store#validate) is
180
180
  * called. It returns a cleanup function that will remove the callback.
181
181
  * @example
182
182
  * const cleanup = store.onValidate(async (state) => {
@@ -189,7 +189,7 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
189
189
  onValidate: (callback: FormStoreCallback<FormStoreState<T>>) => () => void;
190
190
  /**
191
191
  * Function that accepts a callback that will be used to submit the form when
192
- * [`submit`](https://ariakit.org/reference/use-form-store#submit) is called.
192
+ * [`submit`](https://ariakit.com/reference/use-form-store#submit) is called.
193
193
  * It returns a cleanup function that will remove the callback.
194
194
  * @param callback The callback function.
195
195
  * @example
@@ -1,11 +1,11 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _UROTDZFKcjs = require('../__chunks/UROTDZFK.cjs');
4
- require('../__chunks/AOXAROPF.cjs');
5
- require('../__chunks/T247D7JS.cjs');
6
- require('../__chunks/MJNGPYVQ.cjs');
7
- require('../__chunks/WPBYRKFQ.cjs');
8
- require('../__chunks/6BYUUR4M.cjs');
3
+ var _R37KOEUWcjs = require('../__chunks/R37KOEUW.cjs');
4
+ require('../__chunks/75F3RDBE.cjs');
5
+ require('../__chunks/CVLMIMPT.cjs');
6
+ require('../__chunks/2RUCRSRF.cjs');
7
+ require('../__chunks/WMTGHDLE.cjs');
8
+ require('../__chunks/4TRESXTO.cjs');
9
9
 
10
10
 
11
- exports.createHovercardStore = _UROTDZFKcjs.createHovercardStore;
11
+ exports.createHovercardStore = _R37KOEUWcjs.createHovercardStore;