@midas-ds/components 1.0.2 → 1.1.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 (175) hide show
  1. package/Button-DL6nqUco.js +182 -0
  2. package/CHANGELOG.md +15 -0
  3. package/Checkbox-q0dugR2t.js +402 -0
  4. package/{Collection-B3xUVWPF.js → Collection-KMFfVuzU.js} +179 -152
  5. package/Dialog-D6Bqrpn-.js +1952 -0
  6. package/Disclosure-dAZYXyTH.js +225 -0
  7. package/Disclosure.css +1 -0
  8. package/DragAndDrop-B0T3WgjL.js +40 -0
  9. package/FocusScope-B7CkxXNC.js +513 -0
  10. package/{Form-DXLoQL91.js → Form-BWBjJC6v.js} +79 -81
  11. package/Group-D7_8007y.js +42 -0
  12. package/Heading-RCRHv6hd.js +15 -0
  13. package/{Hidden-BQWDvze4.js → Hidden-CVlUgUJM.js} +1 -1
  14. package/Link-BnQvB-hH.js +75 -0
  15. package/ListBox-DBBiqvcR.js +474 -0
  16. package/ListKeyboardDelegate-gCXy-Xnn.js +172 -0
  17. package/PressResponder-B4g56kDz.js +31 -0
  18. package/README.md +21 -3
  19. package/{RSPContexts-EOiWkKOf.js → RSPContexts-BW2SEIqe.js} +2 -2
  20. package/SelectionManager-BfXUE1qg.js +1031 -0
  21. package/Separator-BBX9m2O2.js +49 -0
  22. package/Tag-DWt0koFj.js +728 -0
  23. package/Text-BCF0xvqL.js +15 -0
  24. package/TextField-CX4eOQf6.js +225 -0
  25. package/TextField.module-DdICj682.js +143 -0
  26. package/{VisuallyHidden-B_XzVvlX.js → VisuallyHidden-Dhr5caPC.js} +1 -1
  27. package/accordion/Accordion.d.ts +8 -8
  28. package/accordion/AccordionItem.d.ts +11 -3
  29. package/accordion/index.d.ts +0 -3
  30. package/{context-ScOIq_Gu.js → context-BpJLnOuu.js} +11 -11
  31. package/global.css +1 -0
  32. package/index-B-jHjTDC.js +120 -0
  33. package/{index-CorR1LBD.js → index-BPdc9gJ8.js} +3 -3
  34. package/{index-Dl1Q-tbj.js → index-KSgQWWiy.js} +5315 -5315
  35. package/index.d.ts +1 -0
  36. package/index.js +105 -112
  37. package/index10.js +1 -1
  38. package/index11.js +1 -1
  39. package/index12.js +1 -1
  40. package/index13.js +1 -1
  41. package/index14.js +1 -1
  42. package/index15.js +2 -2
  43. package/index16.js +2 -2
  44. package/index17.js +1 -1
  45. package/index18.js +1 -1
  46. package/index19.js +2 -2
  47. package/index2.js +1 -1
  48. package/index20.js +2 -2
  49. package/index21.js +1 -1
  50. package/index22.js +1 -1
  51. package/index23.js +1 -1
  52. package/index24.js +1 -1
  53. package/index25.js +2 -2
  54. package/index26.js +2 -2
  55. package/index27.js +2 -2
  56. package/index28.js +1 -1
  57. package/index29.js +2 -8
  58. package/index3.js +2 -4
  59. package/index30.js +17 -16
  60. package/index31.js +3 -3
  61. package/index32.js +3 -3
  62. package/index33.js +2 -2
  63. package/index34.js +3 -3
  64. package/index35.js +1 -1
  65. package/index36.js +2 -2
  66. package/index37.js +2 -2
  67. package/index38.js +2 -2
  68. package/index39.js +2 -2
  69. package/index4.js +1 -1
  70. package/index40.js +19 -12
  71. package/index41.js +61 -14
  72. package/index42.js +44 -22
  73. package/index43.js +13 -11
  74. package/index44.js +25 -4
  75. package/index45.js +16 -51
  76. package/index46.js +19 -16
  77. package/index47.js +49 -27
  78. package/index48.js +5 -18
  79. package/index49.js +25 -21
  80. package/index5.js +1 -1
  81. package/index50.js +16 -47
  82. package/index51.js +7 -3
  83. package/index52.js +18 -18
  84. package/index53.js +16 -16
  85. package/index54.js +6 -4
  86. package/index55.js +8 -21
  87. package/index56.js +13 -16
  88. package/index57.js +6 -8
  89. package/index58.js +6 -9
  90. package/index59.js +17 -13
  91. package/index6.js +1 -1
  92. package/index60.js +20 -7
  93. package/index61.js +59 -7
  94. package/index62.js +13 -17
  95. package/index63.js +9 -20
  96. package/index64.js +40 -48
  97. package/index65.js +85 -15
  98. package/index66.js +74 -11
  99. package/index67.js +23 -62
  100. package/index68.js +64 -80
  101. package/index69.js +68 -62
  102. package/index7.js +1 -1
  103. package/index70.js +138 -22
  104. package/index71.js +66 -65
  105. package/index72.js +40 -78
  106. package/index73.js +75 -133
  107. package/index74.js +69 -68
  108. package/index75.js +96 -34
  109. package/index76.js +258 -65
  110. package/index77.js +715 -63
  111. package/index78.js +478 -93
  112. package/index79.js +303 -263
  113. package/index8.js +1 -1
  114. package/index80.js +343 -678
  115. package/index81.js +242 -481
  116. package/index82.js +1329 -282
  117. package/index83.js +968 -350
  118. package/index84.js +343 -211
  119. package/index85.js +2025 -1288
  120. package/index86.js +2313 -954
  121. package/index87.js +6782 -339
  122. package/index88.js +15 -2103
  123. package/index89.js +12 -2369
  124. package/index9.js +1 -1
  125. package/index90.js +4 -6832
  126. package/index91.js +7 -15
  127. package/link/Link.d.ts +2 -2
  128. package/link-button/LinkButton.d.ts +1 -1
  129. package/package.json +7 -1
  130. package/{react.esm-D8HpDGKP.js → react.esm-sMU8Z7rL.js} +1872 -1872
  131. package/textfield/index.d.ts +0 -2
  132. package/useControlledState-Kv9K2AYu.js +30 -0
  133. package/{useDescription-D4_zk_sA.js → useDescription-B7stiK3j.js} +1 -1
  134. package/useEvent-Xk5kn5Ns.js +21 -0
  135. package/useField-DMzJIIN4.js +67 -0
  136. package/{useFilter-BnJDBCkt.js → useFilter-Bt9dbV1U.js} +1 -1
  137. package/useFocusRing-9PXyKy2A.js +1297 -0
  138. package/{useFocusable-C-N9wcwm.js → useFocusable-CcEBZe40.js} +11 -8
  139. package/{useGridSelectionCheckbox-i1rsjlC-.js → useGridSelectionCheckbox-DYgEnElE.js} +3 -3
  140. package/useHasTabbableChild-D6DwR81L.js +34 -0
  141. package/{useHighlightSelectionDescription-JVx2MW_e.js → useHighlightSelectionDescription-WYAbP4No.js} +19 -19
  142. package/useLabels-9zaZ9oa0.js +17 -0
  143. package/useListState-BfTeKTk5.js +119 -0
  144. package/{useLocalizedStringFormatter-DVCAZqcL.js → useLocalizedStringFormatter-BlCbn-hX.js} +29 -29
  145. package/{useSingleSelectListState-CmX9_L5H.js → useSingleSelectListState-DPkaL0la.js} +5 -5
  146. package/Button-CCevm2s3.js +0 -183
  147. package/Checkbox-CllWDBxF.js +0 -405
  148. package/Dialog-CLTyYwkS.js +0 -1889
  149. package/DragAndDrop-OTN7La7U.js +0 -42
  150. package/FocusScope-BR0SJ-cZ.js +0 -512
  151. package/Group-DPMuN3h8.js +0 -44
  152. package/Label-C18A_4Z5.js +0 -69
  153. package/Link-BU1h3K2a.js +0 -77
  154. package/ListBox-D21tdwTs.js +0 -463
  155. package/ListKeyboardDelegate-DxMjfMsI.js +0 -172
  156. package/PressResponder-DP8ZDNGy.js +0 -31
  157. package/SelectionManager-D4WtKtey.js +0 -988
  158. package/Separator-DLUHK9vv.js +0 -48
  159. package/Tag-CEd6WWSc.js +0 -725
  160. package/Text-DGLaY3HR.js +0 -17
  161. package/TextField-C_hq9WeT.js +0 -226
  162. package/TextField.module-Cwq1FAm7.js +0 -141
  163. package/accordion/AccordionContent.d.ts +0 -3
  164. package/accordion/AccordionTagContext.d.ts +0 -3
  165. package/accordion/AccordionTrigger.d.ts +0 -3
  166. package/index-CEg5vZQH.js +0 -132
  167. package/index-CgfokhRq.js +0 -674
  168. package/index.css +0 -1
  169. package/index92.js +0 -14
  170. package/index93.js +0 -6
  171. package/index94.js +0 -9
  172. package/useControlledState-S_TYcV_c.js +0 -45
  173. package/useFocusRing-D97-G3fT.js +0 -1324
  174. package/useHasTabbableChild-DeuCnGGv.js +0 -34
  175. package/useListState-DSOTbsL3.js +0 -119
@@ -1,19 +1,19 @@
1
- import { F as b, l as Q, G as k, n as q, d as G } from "./useFocusRing-D97-G3fT.js";
1
+ import { m as b, l as Q, K as k, o as q, d as K } from "./useFocusRing-9PXyKy2A.js";
2
2
  import R, { useRef as x, useEffect as S, createContext as L, useMemo as y, useContext as D, useState as m, forwardRef as B } from "react";
3
- import { a as Y } from "./Text-DGLaY3HR.js";
3
+ import { a as Y } from "./Text-BCF0xvqL.js";
4
4
  function ne(t, e, a) {
5
- let i = x(e), l = b(() => {
5
+ let i = x(e), n = b(() => {
6
6
  a && a(i.current);
7
7
  });
8
8
  S(() => {
9
9
  var r;
10
- let n = t == null || (r = t.current) === null || r === void 0 ? void 0 : r.form;
11
- return n == null || n.addEventListener("reset", l), () => {
12
- n == null || n.removeEventListener("reset", l);
10
+ let l = t == null || (r = t.current) === null || r === void 0 ? void 0 : r.form;
11
+ return l == null || l.addEventListener("reset", n), () => {
12
+ l == null || l.removeEventListener("reset", n);
13
13
  };
14
14
  }, [
15
15
  t,
16
- l
16
+ n
17
17
  ]);
18
18
  }
19
19
  const C = {
@@ -32,66 +32,66 @@ const C = {
32
32
  ...C,
33
33
  customError: !0,
34
34
  valid: !1
35
- }, f = {
35
+ }, v = {
36
36
  isInvalid: !1,
37
37
  validationDetails: C,
38
38
  validationErrors: []
39
39
  }, z = L({}), F = "__formValidationState" + Date.now();
40
- function oe(t) {
40
+ function le(t) {
41
41
  if (t[F]) {
42
- let { realtimeValidation: e, displayValidation: a, updateValidation: i, resetValidation: l, commitValidation: r } = t[F];
42
+ let { realtimeValidation: e, displayValidation: a, updateValidation: i, resetValidation: n, commitValidation: r } = t[F];
43
43
  return {
44
44
  realtimeValidation: e,
45
45
  displayValidation: a,
46
46
  updateValidation: i,
47
- resetValidation: l,
47
+ resetValidation: n,
48
48
  commitValidation: r
49
49
  };
50
50
  }
51
- return H(t);
51
+ return G(t);
52
52
  }
53
- function H(t) {
54
- let { isInvalid: e, validationState: a, name: i, value: l, builtinValidation: r, validate: n, validationBehavior: v = "aria" } = t;
53
+ function G(t) {
54
+ let { isInvalid: e, validationState: a, name: i, value: n, builtinValidation: r, validate: l, validationBehavior: u = "aria" } = t;
55
55
  a && (e || (e = a === "invalid"));
56
- let o = e !== void 0 ? {
56
+ let d = e !== void 0 ? {
57
57
  isInvalid: e,
58
58
  validationErrors: [],
59
59
  validationDetails: T
60
60
  } : null, s = y(() => {
61
- if (!n || l == null) return null;
62
- let d = J(n, l);
63
- return O(d);
61
+ if (!l || n == null) return null;
62
+ let o = H(l, n);
63
+ return O(o);
64
64
  }, [
65
- n,
66
- l
65
+ l,
66
+ n
67
67
  ]);
68
68
  r != null && r.validationDetails.valid && (r = void 0);
69
- let c = D(z), u = y(() => i ? Array.isArray(i) ? i.flatMap((d) => M(c[d])) : M(c[i]) : [], [
70
- c,
69
+ let f = D(z), c = y(() => i ? Array.isArray(i) ? i.flatMap((o) => M(f[o])) : M(f[i]) : [], [
70
+ f,
71
71
  i
72
- ]), [_, j] = m(c), [w, V] = m(!1);
73
- c !== _ && (j(c), V(!1));
74
- let p = y(() => O(w ? [] : u), [
72
+ ]), [_, j] = m(f), [w, V] = m(!1);
73
+ f !== _ && (j(f), V(!1));
74
+ let p = y(() => O(w ? [] : c), [
75
75
  w,
76
- u
77
- ]), A = x(f), [E, g] = m(f), $ = x(f), P = () => {
76
+ c
77
+ ]), A = x(v), [E, g] = m(v), $ = x(v), P = () => {
78
78
  if (!N) return;
79
79
  h(!1);
80
- let d = s || r || A.current;
81
- I(d, $.current) || ($.current = d, g(d));
80
+ let o = s || r || A.current;
81
+ I(o, $.current) || ($.current = o, g(o));
82
82
  }, [N, h] = m(!1);
83
83
  return S(P), {
84
- realtimeValidation: o || p || s || r || f,
85
- displayValidation: v === "native" ? o || p || E : o || p || s || r || E,
86
- updateValidation(d) {
87
- v === "aria" && !I(E, d) ? g(d) : A.current = d;
84
+ realtimeValidation: d || p || s || r || v,
85
+ displayValidation: u === "native" ? d || p || E : d || p || s || r || E,
86
+ updateValidation(o) {
87
+ u === "aria" && !I(E, o) ? g(o) : A.current = o;
88
88
  },
89
89
  resetValidation() {
90
- let d = f;
91
- I(d, $.current) || ($.current = d, g(d)), v === "native" && h(!1), V(!0);
90
+ let o = v;
91
+ I(o, $.current) || ($.current = o, g(o)), u === "native" && h(!1), V(!0);
92
92
  },
93
93
  commitValidation() {
94
- v === "native" && h(!0), V(!0);
94
+ u === "native" && h(!0), V(!0);
95
95
  }
96
96
  };
97
97
  }
@@ -100,7 +100,7 @@ function M(t) {
100
100
  t
101
101
  ] : [];
102
102
  }
103
- function J(t, e) {
103
+ function H(t, e) {
104
104
  if (typeof t == "function") {
105
105
  let a = t(e);
106
106
  if (a && typeof a != "boolean") return M(a);
@@ -121,11 +121,11 @@ function de(...t) {
121
121
  let e = /* @__PURE__ */ new Set(), a = !1, i = {
122
122
  ...C
123
123
  };
124
- for (let n of t) {
125
- var l, r;
126
- for (let v of n.validationErrors) e.add(v);
127
- a || (a = n.isInvalid);
128
- for (let v in i) (l = i)[r = v] || (l[r] = n.validationDetails[v]);
124
+ for (let l of t) {
125
+ var n, r;
126
+ for (let u of l.validationErrors) e.add(u);
127
+ a || (a = l.isInvalid);
128
+ for (let u in i) (n = i)[r = u] || (n[r] = l.validationDetails[u]);
129
129
  }
130
130
  return i.valid = !a, {
131
131
  isInvalid: a,
@@ -135,44 +135,44 @@ function de(...t) {
135
135
  validationDetails: i
136
136
  };
137
137
  }
138
- function se(t, e, a) {
139
- let { validationBehavior: i, focus: l } = t;
138
+ function oe(t, e, a) {
139
+ let { validationBehavior: i, focus: n } = t;
140
140
  Q(() => {
141
- if (i === "native" && (a != null && a.current)) {
142
- let o = e.realtimeValidation.isInvalid ? e.realtimeValidation.validationErrors.join(" ") || "Invalid value." : "";
143
- a.current.setCustomValidity(o), a.current.hasAttribute("title") || (a.current.title = ""), e.realtimeValidation.isInvalid || e.updateValidation(W(a.current));
141
+ if (i === "native" && (a != null && a.current) && !a.current.disabled) {
142
+ let d = e.realtimeValidation.isInvalid ? e.realtimeValidation.validationErrors.join(" ") || "Invalid value." : "";
143
+ a.current.setCustomValidity(d), a.current.hasAttribute("title") || (a.current.title = ""), e.realtimeValidation.isInvalid || e.updateValidation(W(a.current));
144
144
  }
145
145
  });
146
146
  let r = b(() => {
147
147
  e.resetValidation();
148
- }), n = b((o) => {
148
+ }), l = b((d) => {
149
149
  var s;
150
150
  e.displayValidation.isInvalid || e.commitValidation();
151
- let c = a == null || (s = a.current) === null || s === void 0 ? void 0 : s.form;
152
- if (!o.defaultPrevented && a && c && X(c) === a.current) {
153
- var u;
154
- l ? l() : (u = a.current) === null || u === void 0 || u.focus(), k("keyboard");
151
+ let f = a == null || (s = a.current) === null || s === void 0 ? void 0 : s.form;
152
+ if (!d.defaultPrevented && a && f && X(f) === a.current) {
153
+ var c;
154
+ n ? n() : (c = a.current) === null || c === void 0 || c.focus(), k("keyboard");
155
155
  }
156
- o.preventDefault();
157
- }), v = b(() => {
156
+ d.preventDefault();
157
+ }), u = b(() => {
158
158
  e.commitValidation();
159
159
  });
160
160
  S(() => {
161
- let o = a == null ? void 0 : a.current;
162
- if (!o) return;
163
- let s = o.form;
164
- return o.addEventListener("invalid", n), o.addEventListener("change", v), s == null || s.addEventListener("reset", r), () => {
165
- o.removeEventListener("invalid", n), o.removeEventListener("change", v), s == null || s.removeEventListener("reset", r);
161
+ let d = a == null ? void 0 : a.current;
162
+ if (!d) return;
163
+ let s = d.form;
164
+ return d.addEventListener("invalid", l), d.addEventListener("change", u), s == null || s.addEventListener("reset", r), () => {
165
+ d.removeEventListener("invalid", l), d.removeEventListener("change", u), s == null || s.removeEventListener("reset", r);
166
166
  };
167
167
  }, [
168
168
  a,
169
- n,
170
- v,
169
+ l,
170
+ u,
171
171
  r,
172
172
  i
173
173
  ]);
174
174
  }
175
- function K(t) {
175
+ function J(t) {
176
176
  let e = t.validity;
177
177
  return {
178
178
  badInput: e.badInput,
@@ -191,7 +191,7 @@ function K(t) {
191
191
  function W(t) {
192
192
  return {
193
193
  isInvalid: !t.validity.valid,
194
- validationDetails: K(t),
194
+ validationDetails: J(t),
195
195
  validationErrors: t.validationMessage ? [
196
196
  t.validationMessage
197
197
  ] : []
@@ -204,37 +204,35 @@ function X(t) {
204
204
  }
205
205
  return null;
206
206
  }
207
- const U = /* @__PURE__ */ L(null);
208
- function Z(t, e) {
209
- let a = D(U);
210
- return a != null && a.isInvalid ? /* @__PURE__ */ R.createElement(ee, {
211
- ...t,
212
- ref: e
207
+ const U = /* @__PURE__ */ L(null), se = /* @__PURE__ */ B(function(e, a) {
208
+ let i = D(U);
209
+ return i != null && i.isInvalid ? /* @__PURE__ */ R.createElement(Z, {
210
+ ...e,
211
+ ref: a
213
212
  }) : null;
214
- }
215
- const ve = /* @__PURE__ */ B(Z), ee = /* @__PURE__ */ B((t, e) => {
216
- let a = D(U), i = q(t), l = G({
213
+ }), Z = /* @__PURE__ */ B((t, e) => {
214
+ let a = D(U), i = q(t), n = K({
217
215
  ...t,
218
216
  defaultClassName: "react-aria-FieldError",
219
217
  defaultChildren: a.validationErrors.length === 0 ? void 0 : a.validationErrors.join(" "),
220
218
  values: a
221
219
  });
222
- return l.children == null ? null : /* @__PURE__ */ R.createElement(Y, {
220
+ return n.children == null ? null : /* @__PURE__ */ R.createElement(Y, {
223
221
  slot: "errorMessage",
224
222
  ...i,
225
- ...l,
223
+ ...n,
226
224
  ref: e
227
225
  });
228
- }), ce = /* @__PURE__ */ L(null);
226
+ }), ue = /* @__PURE__ */ L(null);
229
227
  export {
230
- oe as $,
231
- ne as a,
228
+ ue as $,
229
+ U as a,
232
230
  se as b,
233
- ce as c,
234
- U as d,
235
- ve as e,
231
+ le as c,
232
+ ne as d,
233
+ oe as e,
236
234
  F as f,
237
- f as g,
235
+ v as g,
238
236
  de as h,
239
237
  C as i
240
238
  };
@@ -0,0 +1,42 @@
1
+ import { a as H, b as h, c as x, d as m, e as F } from "./useFocusRing-9PXyKy2A.js";
2
+ import P, { forwardRef as _, createContext as p } from "react";
3
+ const C = /* @__PURE__ */ p({}), S = /* @__PURE__ */ _(function(e, i) {
4
+ [e, i] = H(e, i, C);
5
+ let { isDisabled: d, isInvalid: a, onHoverStart: f, onHoverChange: u, onHoverEnd: c, ...v } = e, { hoverProps: $, isHovered: r } = h({
6
+ onHoverStart: f,
7
+ onHoverChange: u,
8
+ onHoverEnd: c,
9
+ isDisabled: d
10
+ }), { isFocused: s, isFocusVisible: t, focusProps: b } = x({
11
+ within: !0
12
+ });
13
+ d ?? (d = !!e["aria-disabled"] && e["aria-disabled"] !== "false"), a ?? (a = !!e["aria-invalid"] && e["aria-invalid"] !== "false");
14
+ let l = m({
15
+ ...e,
16
+ values: {
17
+ isHovered: r,
18
+ isFocusWithin: s,
19
+ isFocusVisible: t,
20
+ isDisabled: d,
21
+ isInvalid: a
22
+ },
23
+ defaultClassName: "react-aria-Group"
24
+ });
25
+ var o, n;
26
+ return /* @__PURE__ */ P.createElement("div", {
27
+ ...F(v, b, $),
28
+ ...l,
29
+ ref: i,
30
+ role: (o = e.role) !== null && o !== void 0 ? o : "group",
31
+ slot: (n = e.slot) !== null && n !== void 0 ? n : void 0,
32
+ "data-focus-within": s || void 0,
33
+ "data-hovered": r || void 0,
34
+ "data-focus-visible": t || void 0,
35
+ "data-disabled": d || void 0,
36
+ "data-invalid": a || void 0
37
+ }, l.children);
38
+ });
39
+ export {
40
+ S as $,
41
+ C as a
42
+ };
@@ -0,0 +1,15 @@
1
+ import { $ } from "./RSPContexts-BW2SEIqe.js";
2
+ import { a as n } from "./useFocusRing-9PXyKy2A.js";
3
+ import o, { forwardRef as m } from "react";
4
+ const b = /* @__PURE__ */ m(function(e, a) {
5
+ [e, a] = n(e, a, $);
6
+ let { children: t, level: l = 3, className: r, ...d } = e, f = `h${l}`;
7
+ return /* @__PURE__ */ o.createElement(f, {
8
+ ...d,
9
+ ref: a,
10
+ className: r ?? "react-aria-Heading"
11
+ }, t);
12
+ });
13
+ export {
14
+ b as $
15
+ };
@@ -1,6 +1,6 @@
1
1
  import { createPortal as c } from "react-dom";
2
2
  import a, { forwardRef as l, useContext as d, createContext as o } from "react";
3
- import { g as f } from "./useFocusRing-D97-G3fT.js";
3
+ import { g as f } from "./useFocusRing-9PXyKy2A.js";
4
4
  if (typeof HTMLTemplateElement < "u") {
5
5
  const e = Object.getOwnPropertyDescriptor(Node.prototype, "firstChild").get;
6
6
  Object.defineProperty(HTMLTemplateElement.prototype, "firstChild", {
@@ -0,0 +1,75 @@
1
+ import { n as v, o as h, e as b, p as C, q as D, r as T, a as E, b as F, c as H, d as g } from "./useFocusRing-9PXyKy2A.js";
2
+ import y, { createContext as L, forwardRef as S } from "react";
3
+ import { $ as _ } from "./useFocusable-CcEBZe40.js";
4
+ function V(r, e) {
5
+ let {
6
+ elementType: a = "a",
7
+ onPress: i,
8
+ onPressStart: f,
9
+ onPressEnd: o,
10
+ // @ts-ignore
11
+ onClick: c,
12
+ isDisabled: d,
13
+ ...u
14
+ } = r, n = {};
15
+ a !== "a" && (n = {
16
+ role: "link",
17
+ tabIndex: d ? void 0 : 0
18
+ });
19
+ let { focusableProps: l } = _(r, e), { pressProps: t, isPressed: p } = v({
20
+ onPress: i,
21
+ onPressStart: f,
22
+ onPressEnd: o,
23
+ isDisabled: d,
24
+ ref: e
25
+ }), x = h(u, {
26
+ labelable: !0
27
+ }), k = b(l, t), P = C(), m = D(r);
28
+ return {
29
+ isPressed: p,
30
+ linkProps: b(x, m, {
31
+ ...k,
32
+ ...n,
33
+ "aria-disabled": d || void 0,
34
+ "aria-current": r["aria-current"],
35
+ onClick: (s) => {
36
+ var $;
37
+ ($ = t.onClick) === null || $ === void 0 || $.call(t, s), c && (c(s), console.warn("onClick is deprecated, please use onPress")), !P.isNative && s.currentTarget instanceof HTMLAnchorElement && s.currentTarget.href && // If props are applied to a router Link component, it may have already prevented default.
38
+ !s.isDefaultPrevented() && T(s.currentTarget, s) && r.href && (s.preventDefault(), P.open(s.currentTarget, s, r.href, r.routerOptions));
39
+ }
40
+ })
41
+ };
42
+ }
43
+ const w = /* @__PURE__ */ L(null), q = /* @__PURE__ */ S(function(e, a) {
44
+ [e, a] = E(e, a, w);
45
+ let i = e.href && !e.isDisabled ? "a" : "span", { linkProps: f, isPressed: o } = V({
46
+ ...e,
47
+ elementType: i
48
+ }, a), { hoverProps: c, isHovered: d } = F(e), { focusProps: u, isFocused: n, isFocusVisible: l } = H(), t = g({
49
+ ...e,
50
+ defaultClassName: "react-aria-Link",
51
+ values: {
52
+ isCurrent: !!e["aria-current"],
53
+ isDisabled: e.isDisabled || !1,
54
+ isPressed: o,
55
+ isHovered: d,
56
+ isFocused: n,
57
+ isFocusVisible: l
58
+ }
59
+ });
60
+ return /* @__PURE__ */ y.createElement(i, {
61
+ ref: a,
62
+ slot: e.slot || void 0,
63
+ ...b(t, f, c, u),
64
+ "data-focused": n || void 0,
65
+ "data-hovered": d || void 0,
66
+ "data-pressed": o || void 0,
67
+ "data-focus-visible": l || void 0,
68
+ "data-current": !!e["aria-current"] || void 0,
69
+ "data-disabled": e.isDisabled || void 0
70
+ }, t.children);
71
+ });
72
+ export {
73
+ q as $,
74
+ w as a
75
+ };