@midas-ds/components 1.0.3 → 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 (145) hide show
  1. package/{Button-B4vMZbC6.js → Button-DL6nqUco.js} +22 -22
  2. package/CHANGELOG.md +6 -1
  3. package/{Checkbox-DnKWanep.js → Checkbox-q0dugR2t.js} +8 -8
  4. package/{Collection-COLWgm24.js → Collection-KMFfVuzU.js} +2 -2
  5. package/{Dialog-Cb6toyXO.js → Dialog-D6Bqrpn-.js} +170 -169
  6. package/Disclosure-dAZYXyTH.js +225 -0
  7. package/Disclosure.css +1 -0
  8. package/{FocusScope-C8i7CH6y.js → FocusScope-B7CkxXNC.js} +1 -1
  9. package/{Form-BQQs3jUk.js → Form-BWBjJC6v.js} +42 -42
  10. package/{Group-CdwXhx8Q.js → Group-D7_8007y.js} +10 -10
  11. package/Heading-RCRHv6hd.js +15 -0
  12. package/{Hidden-DngIphiL.js → Hidden-CVlUgUJM.js} +1 -1
  13. package/{Link-iAZLB3RI.js → Link-BnQvB-hH.js} +8 -8
  14. package/{ListBox-BKWkIIm6.js → ListBox-DBBiqvcR.js} +72 -72
  15. package/{ListKeyboardDelegate-BH-K5hyq.js → ListKeyboardDelegate-gCXy-Xnn.js} +2 -2
  16. package/{PressResponder-Cz-TRBHO.js → PressResponder-B4g56kDz.js} +5 -5
  17. package/{RSPContexts-EOiWkKOf.js → RSPContexts-BW2SEIqe.js} +2 -2
  18. package/{SelectionManager-8o40f7mx.js → SelectionManager-BfXUE1qg.js} +113 -129
  19. package/{Separator-BlvmQjwz.js → Separator-BBX9m2O2.js} +2 -2
  20. package/{Tag--W5TgxmK.js → Tag-DWt0koFj.js} +74 -74
  21. package/Text-BCF0xvqL.js +15 -0
  22. package/{TextField-DeK_yiK-.js → TextField-CX4eOQf6.js} +33 -33
  23. package/{TextField.module-0-u4LVPp.js → TextField.module-DdICj682.js} +7 -7
  24. package/{VisuallyHidden-CFx06Bae.js → VisuallyHidden-Dhr5caPC.js} +1 -1
  25. package/accordion/Accordion.d.ts +8 -8
  26. package/accordion/AccordionItem.d.ts +11 -3
  27. package/accordion/index.d.ts +0 -3
  28. package/{context-Bnqknrce.js → context-BpJLnOuu.js} +11 -11
  29. package/global.css +1 -0
  30. package/index.d.ts +1 -0
  31. package/index.js +105 -110
  32. package/index10.js +1 -1
  33. package/index11.js +1 -1
  34. package/index12.js +1 -1
  35. package/index13.js +1 -1
  36. package/index14.js +1 -1
  37. package/index15.js +2 -2
  38. package/index16.js +2 -2
  39. package/index17.js +1 -1
  40. package/index18.js +1 -1
  41. package/index19.js +2 -2
  42. package/index2.js +1 -1
  43. package/index20.js +2 -2
  44. package/index21.js +1 -1
  45. package/index22.js +1 -1
  46. package/index23.js +1 -1
  47. package/index24.js +1 -1
  48. package/index25.js +2 -2
  49. package/index26.js +2 -2
  50. package/index27.js +2 -2
  51. package/index28.js +1 -1
  52. package/index29.js +2 -8
  53. package/index3.js +1 -1
  54. package/index30.js +17 -16
  55. package/index31.js +1 -1
  56. package/index32.js +1 -1
  57. package/index33.js +1 -1
  58. package/index34.js +2 -2
  59. package/index36.js +1 -1
  60. package/index37.js +1 -1
  61. package/index38.js +1 -1
  62. package/index39.js +1 -1
  63. package/index4.js +1 -1
  64. package/index40.js +19 -12
  65. package/index41.js +61 -14
  66. package/index42.js +44 -22
  67. package/index43.js +13 -11
  68. package/index44.js +25 -4
  69. package/index45.js +16 -51
  70. package/index46.js +19 -16
  71. package/index47.js +49 -27
  72. package/index48.js +5 -18
  73. package/index49.js +25 -21
  74. package/index5.js +1 -1
  75. package/index50.js +16 -47
  76. package/index51.js +7 -3
  77. package/index52.js +18 -18
  78. package/index53.js +16 -16
  79. package/index54.js +5 -3
  80. package/index55.js +7 -20
  81. package/index56.js +13 -16
  82. package/index57.js +6 -8
  83. package/index58.js +5 -8
  84. package/index59.js +17 -13
  85. package/index6.js +1 -1
  86. package/index60.js +20 -7
  87. package/index61.js +59 -7
  88. package/index62.js +13 -17
  89. package/index63.js +9 -20
  90. package/index64.js +38 -46
  91. package/index65.js +85 -15
  92. package/index66.js +74 -11
  93. package/index67.js +23 -62
  94. package/index68.js +64 -80
  95. package/index69.js +68 -62
  96. package/index7.js +1 -1
  97. package/index70.js +138 -22
  98. package/index71.js +66 -65
  99. package/index72.js +40 -78
  100. package/index73.js +75 -133
  101. package/index74.js +69 -68
  102. package/index75.js +96 -34
  103. package/index76.js +258 -65
  104. package/index77.js +715 -63
  105. package/index78.js +478 -93
  106. package/index79.js +303 -263
  107. package/index8.js +1 -1
  108. package/index80.js +343 -677
  109. package/index81.js +242 -479
  110. package/index82.js +1332 -282
  111. package/index83.js +966 -346
  112. package/index84.js +344 -210
  113. package/index85.js +2024 -1286
  114. package/index86.js +2314 -955
  115. package/index87.js +6785 -340
  116. package/index88.js +15 -2099
  117. package/index89.js +12 -2367
  118. package/index9.js +1 -1
  119. package/index90.js +4 -6834
  120. package/index91.js +7 -15
  121. package/package.json +1 -1
  122. package/useControlledState-Kv9K2AYu.js +30 -0
  123. package/{useDescription-BPs7eRff.js → useDescription-B7stiK3j.js} +1 -1
  124. package/useEvent-Xk5kn5Ns.js +21 -0
  125. package/{useField-Dz62UHCP.js → useField-DMzJIIN4.js} +5 -5
  126. package/{useFilter-ViwzkzZe.js → useFilter-Bt9dbV1U.js} +1 -1
  127. package/{useFocusRing-BKGhL91C.js → useFocusRing-9PXyKy2A.js} +26 -26
  128. package/{useFocusable-CRSmYEQc.js → useFocusable-CcEBZe40.js} +1 -1
  129. package/{useGridSelectionCheckbox-CVEvUCJL.js → useGridSelectionCheckbox-DYgEnElE.js} +3 -3
  130. package/{useHasTabbableChild-C8y4fwiY.js → useHasTabbableChild-D6DwR81L.js} +5 -5
  131. package/{useHighlightSelectionDescription-CD74uzLh.js → useHighlightSelectionDescription-WYAbP4No.js} +4 -4
  132. package/useLabels-9zaZ9oa0.js +17 -0
  133. package/{useListState-DKnP5TB5.js → useListState-BfTeKTk5.js} +1 -1
  134. package/{useLocalizedStringFormatter-DsZ-ZWSk.js → useLocalizedStringFormatter-BlCbn-hX.js} +1 -1
  135. package/{useSingleSelectListState-BHTLh8Ob.js → useSingleSelectListState-DPkaL0la.js} +2 -2
  136. package/Text-CQPW6xs7.js +0 -15
  137. package/accordion/AccordionContent.d.ts +0 -3
  138. package/accordion/AccordionTagContext.d.ts +0 -3
  139. package/accordion/AccordionTrigger.d.ts +0 -3
  140. package/index-DK9ZACEc.js +0 -642
  141. package/index.css +0 -1
  142. package/index92.js +0 -14
  143. package/index93.js +0 -6
  144. package/index94.js +0 -9
  145. package/useControlledState-DrAoodI6.js +0 -45
@@ -1,22 +1,22 @@
1
1
  import { jsx as F, jsxs as qe } from "react/jsx-runtime";
2
- import { a as Qe } from "./Button-B4vMZbC6.js";
3
- import { $ as Xe, a as Je, b as q, f as Ye, c as Ze, d as _e } from "./Collection-COLWgm24.js";
4
- import { l as Q, n as K, e as y, B as er, G as rr, Q as X, t as P, H as tr, f as or, P as ar, a as J, y as nr, A as Y, c as Z, d as _, i as ir, b as ur } from "./useFocusRing-BKGhL91C.js";
5
- import { b as lr, $ as sr } from "./useField-Dz62UHCP.js";
6
- import { $ as R } from "./ListBox-BKWkIIm6.js";
7
- import { $ as dr } from "./Text-CQPW6xs7.js";
8
- import g, { useRef as T, useState as cr, useEffect as ee, forwardRef as re, useContext as N, createContext as te } from "react";
9
- import { $ as fr } from "./useListState-DKnP5TB5.js";
10
- import { b as h, a as br } from "./ListKeyboardDelegate-BH-K5hyq.js";
11
- import { a as pr, b as $r } from "./useHighlightSelectionDescription-CD74uzLh.js";
12
- import { $ as mr } from "./useHasTabbableChild-C8y4fwiY.js";
13
- import { $ as vr } from "./Separator-BlvmQjwz.js";
14
- import { $ as oe } from "./context-Bnqknrce.js";
15
- import { $ as gr } from "./useDescription-BPs7eRff.js";
16
- import { h as xr, d as yr, i as E } from "./SelectionManager-8o40f7mx.js";
17
- import { $ as U } from "./FocusScope-C8i7CH6y.js";
18
- import { $ as Dr } from "./useLocalizedStringFormatter-DsZ-ZWSk.js";
19
- import { Button as Br } from "./index69.js";
2
+ import { a as Je } from "./Button-DL6nqUco.js";
3
+ import { $ as Qe, a as Xe, b as q, f as Ye, c as Ze, d as _e } from "./Collection-KMFfVuzU.js";
4
+ import { k as J, o as z, e as y, C as er, I as rr, Q, u as P, J as tr, f as or, P as ar, a as X, z as nr, B as Y, c as Z, d as _, i as ir, b as ur } from "./useFocusRing-9PXyKy2A.js";
5
+ import { b as lr, $ as sr } from "./useField-DMzJIIN4.js";
6
+ import { $ as N } from "./ListBox-DBBiqvcR.js";
7
+ import { $ as dr } from "./Text-BCF0xvqL.js";
8
+ import g, { useRef as T, useState as cr, useEffect as ee, forwardRef as re, useContext as S, createContext as te } from "react";
9
+ import { $ as fr } from "./useListState-BfTeKTk5.js";
10
+ import { b as h, a as br } from "./ListKeyboardDelegate-gCXy-Xnn.js";
11
+ import { a as pr, b as $r } from "./useHighlightSelectionDescription-WYAbP4No.js";
12
+ import { $ as mr } from "./useHasTabbableChild-D6DwR81L.js";
13
+ import { $ as vr } from "./Separator-BBX9m2O2.js";
14
+ import { $ as oe } from "./context-BpJLnOuu.js";
15
+ import { $ as gr } from "./useDescription-B7stiK3j.js";
16
+ import { h as xr, d as yr, i as E } from "./SelectionManager-BfXUE1qg.js";
17
+ import { $ as U } from "./FocusScope-B7CkxXNC.js";
18
+ import { $ as Dr } from "./useLocalizedStringFormatter-BlCbn-hX.js";
19
+ import { Button as Br } from "./index66.js";
20
20
  import { c as kr } from "./clsx-OuTLNxxd.js";
21
21
  import { X as Pr } from "./x-JK7i-TQC.js";
22
22
  import './Tag.css';const V = /* @__PURE__ */ new WeakMap();
@@ -43,7 +43,7 @@ function Er(t, e, r) {
43
43
  selectOnFocus: e.selectionManager.selectionBehavior === "replace",
44
44
  shouldFocusWrap: t.shouldFocusWrap,
45
45
  linkBehavior: d
46
- }), u = Q(t.id);
46
+ }), u = J(t.id);
47
47
  V.set(e, {
48
48
  id: u,
49
49
  onAction: i,
@@ -55,7 +55,7 @@ function Er(t, e, r) {
55
55
  hasItemActions: !!i
56
56
  }), f = mr(r, {
57
57
  isDisabled: e.collection.size !== 0
58
- }), b = K(t, {
58
+ }), b = z(t, {
59
59
  labelable: !0
60
60
  }), m = y(
61
61
  b,
@@ -89,33 +89,33 @@ function Cr(t, e, r) {
89
89
  let { node: o, isVirtualized: i, shouldSelectOnPressUp: d } = t, { direction: s } = oe(), { onAction: c, linkBehavior: u, keyboardNavigationBehavior: $ } = V.get(e), f = er(), b = T(null), m = () => {
90
90
  var n;
91
91
  r.current !== null && (b.current != null && o.key !== b.current || !(!((n = r.current) === null || n === void 0) && n.contains(document.activeElement))) && P(r.current);
92
- }, z = {}, D, S = e.selectionManager.isLink(o.key);
92
+ }, K = {}, D, R = e.selectionManager.isLink(o.key);
93
93
  if (o != null && "expandedKeys" in e) {
94
94
  var C, w, L;
95
95
  let n = (C = (w = e.collection).getChildren) === null || C === void 0 ? void 0 : C.call(w, o.key);
96
96
  D = [
97
97
  ...n ?? []
98
- ].length > 1, c == null && !S && e.selectionManager.selectionMode === "none" && D && (c = () => e.toggleKey(o.key));
98
+ ].length > 1, c == null && !R && e.selectionManager.selectionMode === "none" && D && (c = () => e.toggleKey(o.key));
99
99
  let v = D ? e.expandedKeys.has(o.key) : void 0, k = 1;
100
100
  var A;
101
101
  if (o.level > 0 && (o == null ? void 0 : o.parentKey) != null) {
102
102
  let p = e.collection.getItem(o.parentKey);
103
103
  if (p) {
104
- var B, j;
105
- let x = (B = (j = e.collection).getChildren) === null || B === void 0 ? void 0 : B.call(j, p.key);
104
+ var B, I;
105
+ let x = (B = (I = e.collection).getChildren) === null || B === void 0 ? void 0 : B.call(I, p.key);
106
106
  k = xr(x).index + 1;
107
107
  }
108
108
  } else k = ((A = (L = [
109
109
  ...e.collection
110
110
  ].filter((p) => p.level === 0).at(-1)) === null || L === void 0 ? void 0 : L.index) !== null && A !== void 0 ? A : 0) + 1;
111
- z = {
111
+ K = {
112
112
  "aria-expanded": v,
113
113
  "aria-level": o.level + 1,
114
114
  "aria-posinset": (o == null ? void 0 : o.index) + 1,
115
115
  "aria-setsize": k
116
116
  };
117
117
  }
118
- let { itemProps: Ie, ...I } = yr({
118
+ let { itemProps: je, ...j } = yr({
119
119
  selectionManager: e.selectionManager,
120
120
  key: o.key,
121
121
  ref: r,
@@ -197,7 +197,7 @@ function Cr(t, e, r) {
197
197
  tr() || e.selectionManager.setFocusedKey(o.key);
198
198
  return;
199
199
  }
200
- }, We = X(o.props), He = I.hasAction ? We : {}, O = y(Ie, He, {
200
+ }, We = Q(o.props), He = j.hasAction ? We : {}, O = y(je, He, {
201
201
  role: "row",
202
202
  onKeyDownCapture: Oe,
203
203
  onFocus: Ue,
@@ -215,13 +215,13 @@ function Cr(t, e, r) {
215
215
  };
216
216
  return {
217
217
  rowProps: {
218
- ...y(O, z)
218
+ ...y(O, K)
219
219
  },
220
220
  gridCellProps: Ge,
221
221
  descriptionProps: {
222
222
  id: f
223
223
  },
224
- ...I
224
+ ...j
225
225
  };
226
226
  }
227
227
  function G(t) {
@@ -251,7 +251,7 @@ function wr(t, e, r) {
251
251
  linkBehavior: "override"
252
252
  }, e, r), [u, $] = cr(!1), { focusWithinProps: f } = or({
253
253
  onFocusWithinChange: $
254
- }), b = K(t), m = T(e.collection.size);
254
+ }), b = z(t), m = T(e.collection.size);
255
255
  return ee(() => {
256
256
  r.current && m.current > 0 && e.collection.size === 0 && u && r.current.focus(), m.current = e.collection.size;
257
257
  }, [
@@ -414,28 +414,28 @@ Fe = {
414
414
  removeButtonLabel: "Odstrani",
415
415
  removeDescription: "Pritisnite Delete, da odstranite oznako."
416
416
  };
417
- var Ke = {};
418
- Ke = {
417
+ var ze = {};
418
+ ze = {
419
419
  removeButtonLabel: "Ukloni",
420
420
  removeDescription: "Pritisnite Obriši da biste uklonili oznaku."
421
421
  };
422
- var ze = {};
423
- ze = {
422
+ var Ke = {};
423
+ Ke = {
424
424
  removeButtonLabel: "Ta bort",
425
425
  removeDescription: "Tryck på Radera för att ta bort taggen."
426
426
  };
427
- var Ne = {};
428
- Ne = {
427
+ var Se = {};
428
+ Se = {
429
429
  removeButtonLabel: "Kaldır",
430
430
  removeDescription: "Etiketi kaldırmak için Sil tuşuna basın."
431
431
  };
432
- var Re = {};
433
- Re = {
432
+ var Ne = {};
433
+ Ne = {
434
434
  removeButtonLabel: "Вилучити",
435
435
  removeDescription: "Натисніть Delete, щоб вилучити тег."
436
436
  };
437
- var Se = {};
438
- Se = {
437
+ var Re = {};
438
+ Re = {
439
439
  removeButtonLabel: "删除",
440
440
  removeDescription: "按下“删除”以删除标记。"
441
441
  };
@@ -474,18 +474,18 @@ Ve = {
474
474
  "ru-RU": Ae,
475
475
  "sk-SK": Me,
476
476
  "sl-SI": Fe,
477
- "sr-SP": Ke,
478
- "sv-SE": ze,
479
- "tr-TR": Ne,
480
- "uk-UA": Re,
481
- "zh-CN": Se,
477
+ "sr-SP": ze,
478
+ "sv-SE": Ke,
479
+ "tr-TR": Se,
480
+ "uk-UA": Ne,
481
+ "zh-CN": Re,
482
482
  "zh-TW": Te
483
483
  };
484
484
  function Lr(t) {
485
485
  return t && t.__esModule ? t.default : t;
486
486
  }
487
487
  function Ar(t, e, r) {
488
- let { item: a } = t, l = Dr(Lr(Ve), "@react-aria/tag"), o = Q(), { onRemove: i } = ae.get(e) || {}, { rowProps: d, gridCellProps: s, ...c } = Cr({
488
+ let { item: a } = t, l = Dr(Lr(Ve), "@react-aria/tag"), o = J(), { onRemove: i } = ae.get(e) || {}, { rowProps: d, gridCellProps: s, ...c } = Cr({
489
489
  node: a
490
490
  }, e, r);
491
491
  delete d.onKeyDownCapture;
@@ -498,9 +498,9 @@ function Ar(t, e, r) {
498
498
  }
499
499
  }, m = ar();
500
500
  m === "virtual" && typeof window < "u" && "ontouchstart" in window && (m = "pointer");
501
- let z = i && (m === "keyboard" || m === "virtual") ? l.format("removeDescription") : "", D = gr(z), S = a.key === e.selectionManager.focusedKey, C = e.selectionManager.focusedKey != null, w = -1;
502
- !f && (S || !C) && (w = 0);
503
- let L = K(a.props), A = X(a.props);
501
+ let K = i && (m === "keyboard" || m === "virtual") ? l.format("removeDescription") : "", D = gr(K), R = a.key === e.selectionManager.focusedKey, C = e.selectionManager.focusedKey != null, w = -1;
502
+ !f && (R || !C) && (w = 0);
503
+ let L = z(a.props), A = Q(a.props);
504
504
  return {
505
505
  removeButtonProps: {
506
506
  "aria-label": l.format("removeButtonLabel"),
@@ -525,21 +525,21 @@ function Ar(t, e, r) {
525
525
  allowsRemoving: !!i
526
526
  };
527
527
  }
528
- const Mr = /* @__PURE__ */ te(null), je = /* @__PURE__ */ te(null), Fr = /* @__PURE__ */ re(function(e, r) {
529
- return [e, r] = J(e, r, Mr), /* @__PURE__ */ g.createElement(Xe, {
528
+ const Mr = /* @__PURE__ */ te(null), Ie = /* @__PURE__ */ te(null), Fr = /* @__PURE__ */ re(function(e, r) {
529
+ return [e, r] = X(e, r, Mr), /* @__PURE__ */ g.createElement(Qe, {
530
530
  content: e.children
531
- }, (a) => /* @__PURE__ */ g.createElement(Kr, {
531
+ }, (a) => /* @__PURE__ */ g.createElement(zr, {
532
532
  props: e,
533
533
  forwardedRef: r,
534
534
  collection: a
535
535
  }));
536
536
  });
537
- function Kr({ props: t, forwardedRef: e, collection: r }) {
537
+ function zr({ props: t, forwardedRef: e, collection: r }) {
538
538
  let a = T(null), [l, o] = nr(), i = fr({
539
539
  ...t,
540
540
  children: void 0,
541
541
  collection: r
542
- }), d = K(t), s = Object.fromEntries(Object.entries(d).map(([m]) => [
542
+ }), d = z(t), s = Object.fromEntries(Object.entries(d).map(([m]) => [
543
543
  m,
544
544
  void 0
545
545
  ])), { gridProps: c, labelProps: u, descriptionProps: $, errorMessageProps: f } = wr({
@@ -565,14 +565,14 @@ function Kr({ props: t, forwardedRef: e, collection: r }) {
565
565
  }
566
566
  ],
567
567
  [
568
- je,
568
+ Ie,
569
569
  {
570
570
  ...c,
571
571
  ref: a
572
572
  }
573
573
  ],
574
574
  [
575
- R,
575
+ N,
576
576
  i
577
577
  ],
578
578
  [
@@ -587,14 +587,14 @@ function Kr({ props: t, forwardedRef: e, collection: r }) {
587
587
  ]
588
588
  }, t.children));
589
589
  }
590
- const zr = /* @__PURE__ */ re(function(e, r) {
591
- return N(R) ? /* @__PURE__ */ g.createElement(Nr, {
590
+ const Kr = /* @__PURE__ */ re(function(e, r) {
591
+ return S(N) ? /* @__PURE__ */ g.createElement(Sr, {
592
592
  props: e,
593
593
  forwardedRef: r
594
- }) : /* @__PURE__ */ g.createElement(Je, e);
594
+ }) : /* @__PURE__ */ g.createElement(Xe, e);
595
595
  });
596
- function Nr({ props: t, forwardedRef: e }) {
597
- let r = N(R), { CollectionRoot: a } = N(q), [l, o] = J(t, e, je);
596
+ function Sr({ props: t, forwardedRef: e }) {
597
+ let r = S(N), { CollectionRoot: a } = S(q), [l, o] = X(t, e, Ie);
598
598
  delete l.items, delete l.renderEmptyState;
599
599
  let { focusProps: i, isFocused: d, isFocusVisible: s } = Z(), c = {
600
600
  isEmpty: r.collection.size === 0,
@@ -619,8 +619,8 @@ function Nr({ props: t, forwardedRef: e }) {
619
619
  persistedKeys: $
620
620
  }));
621
621
  }
622
- const Rr = /* @__PURE__ */ Ze("item", (t, e, r) => {
623
- let a = N(R), l = ir(e), { focusProps: o, isFocusVisible: i } = Z({
622
+ const Nr = /* @__PURE__ */ Ze("item", (t, e, r) => {
623
+ let a = S(N), l = ir(e), { focusProps: o, isFocusVisible: i } = Z({
624
624
  within: !0
625
625
  }), { rowProps: d, gridCellProps: s, removeButtonProps: c, ...u } = Ar({
626
626
  item: r
@@ -649,7 +649,7 @@ const Rr = /* @__PURE__ */ Ze("item", (t, e, r) => {
649
649
  ]), /* @__PURE__ */ g.createElement("div", {
650
650
  ref: l,
651
651
  ...b,
652
- ...y(K(t), d, o, $),
652
+ ...y(z(t), d, o, $),
653
653
  "data-selected": u.isSelected || void 0,
654
654
  "data-disabled": u.isDisabled || void 0,
655
655
  "data-hovered": f || void 0,
@@ -666,7 +666,7 @@ const Rr = /* @__PURE__ */ Ze("item", (t, e, r) => {
666
666
  }, /* @__PURE__ */ g.createElement(Y, {
667
667
  values: [
668
668
  [
669
- Qe,
669
+ Je,
670
670
  {
671
671
  slots: {
672
672
  remove: c
@@ -679,28 +679,28 @@ const Rr = /* @__PURE__ */ Ze("item", (t, e, r) => {
679
679
  ]
680
680
  ]
681
681
  }, b.children)));
682
- }), Sr = '"../theme/tokens.css"', Tr = '"Inter", sans-serif', Vr = "#000000", jr = "#b31b1b", Ir = "(max-width: 767px)", Or = "#bfbfbf", Ur = "#d9d9d9", Wr = "#e6e6e6", Hr = "#f2f2f2", Gr = "#f2f2f2", qr = "_button_m4kn4_4", Qr = "_tag_m4kn4_14", Xr = "_dismissable_m4kn4_34", Jr = "_tagText_m4kn4_42", Yr = "_tagList_m4kn4_47", M = {
683
- tokens: Sr,
682
+ }), Rr = '"../theme/tokens.css"', Tr = '"Inter", sans-serif', Vr = "#000000", Ir = "#b31b1b", jr = "(max-width: 767px)", Or = "#bfbfbf", Ur = "#d9d9d9", Wr = "#e6e6e6", Hr = "#f2f2f2", Gr = "#f2f2f2", qr = "_button_m4kn4_4", Jr = "_tag_m4kn4_14", Qr = "_dismissable_m4kn4_34", Xr = "_tagText_m4kn4_42", Yr = "_tagList_m4kn4_47", M = {
683
+ tokens: Rr,
684
684
  display: Tr,
685
685
  black: Vr,
686
- signalRed130: jr,
687
- smBreakpoint: Ir,
686
+ signalRed130: Ir,
687
+ smBreakpoint: jr,
688
688
  gray50: Or,
689
689
  gray30: Ur,
690
690
  gray20: Wr,
691
691
  gray10: Hr,
692
692
  backgroundSecondary: Gr,
693
693
  button: qr,
694
- tag: Qr,
695
- dismissable: Xr,
696
- tagText: Jr,
694
+ tag: Jr,
695
+ dismissable: Qr,
696
+ tagText: Xr,
697
697
  tagList: Yr
698
- }, xt = ({ children: t, ...e }) => /* @__PURE__ */ F(Fr, { ...e, children: /* @__PURE__ */ F(zr, { className: M.tagList, children: t }) }), yt = ({
698
+ }, xt = ({ children: t, ...e }) => /* @__PURE__ */ F(Fr, { ...e, children: /* @__PURE__ */ F(Kr, { className: M.tagList, children: t }) }), yt = ({
699
699
  children: t,
700
700
  dismissable: e,
701
701
  ...r
702
702
  }) => /* @__PURE__ */ qe(
703
- Rr,
703
+ Nr,
704
704
  {
705
705
  className: kr(M.tag, e && M.dismissable),
706
706
  ...r,
@@ -0,0 +1,15 @@
1
+ import { a as c } from "./useFocusRing-9PXyKy2A.js";
2
+ import o, { forwardRef as $, createContext as f } from "react";
3
+ const n = /* @__PURE__ */ f({}), s = /* @__PURE__ */ $(function(e, t) {
4
+ [e, t] = c(e, t, n);
5
+ let { elementType: a = "span", ...r } = e;
6
+ return /* @__PURE__ */ o.createElement(a, {
7
+ className: "react-aria-Text",
8
+ ...r,
9
+ ref: t
10
+ });
11
+ });
12
+ export {
13
+ n as $,
14
+ s as a
15
+ };
@@ -1,20 +1,20 @@
1
1
  import { jsx as r, jsxs as $, Fragment as k } from "react/jsx-runtime";
2
2
  import b, { forwardRef as y, createContext as N, useRef as A, useState as O, useCallback as _ } from "react";
3
- import { $ as q, a as j, b as C } from "./Form-BQQs3jUk.js";
4
- import { $ as w, a as W, T as d, b as z } from "./TextField.module-0-u4LVPp.js";
5
- import { $ as L, a as G } from "./useField-Dz62UHCP.js";
6
- import { $ as J, a as H } from "./Text-CQPW6xs7.js";
7
- import { a as g, b as K, c as M, d as I, e as B, x as Q, y as U, z as X, n as Y, A as Z } from "./useFocusRing-BKGhL91C.js";
8
- import { Button as ee } from "./index69.js";
3
+ import { $ as q, a as j, b as C } from "./Form-BWBjJC6v.js";
4
+ import { $ as w, a as W, T as n, b as z } from "./TextField.module-DdICj682.js";
5
+ import { $ as L, a as G } from "./useField-DMzJIIN4.js";
6
+ import { $ as J, a as H } from "./Text-BCF0xvqL.js";
7
+ import { a as g, b as K, c as M, d as I, e as B, y as Q, z as U, A as X, o as Y, B as Z } from "./useFocusRing-9PXyKy2A.js";
8
+ import { Button as ee } from "./index66.js";
9
9
  import { c as te } from "./clsx-OuTLNxxd.js";
10
10
  const S = /* @__PURE__ */ N({});
11
11
  let ae = (s) => {
12
- let { onHoverStart: e, onHoverChange: t, onHoverEnd: n, ...i } = s;
12
+ let { onHoverStart: e, onHoverChange: t, onHoverEnd: d, ...i } = s;
13
13
  return i;
14
14
  };
15
15
  const xe = /* @__PURE__ */ y(function(e, t) {
16
16
  [e, t] = g(e, t, S);
17
- let { hoverProps: n, isHovered: i } = K(e), { isFocused: a, isFocusVisible: u, focusProps: f } = M({
17
+ let { hoverProps: d, isHovered: i } = K(e), { isFocused: a, isFocusVisible: u, focusProps: f } = M({
18
18
  isTextInput: !0,
19
19
  autoFocus: e.autoFocus
20
20
  }), l = !!e["aria-invalid"] && e["aria-invalid"] !== "false", c = I({
@@ -29,7 +29,7 @@ const xe = /* @__PURE__ */ y(function(e, t) {
29
29
  defaultClassName: "react-aria-TextArea"
30
30
  });
31
31
  return /* @__PURE__ */ b.createElement("textarea", {
32
- ...B(ae(e), f, n),
32
+ ...B(ae(e), f, d),
33
33
  ...c,
34
34
  ref: t,
35
35
  "data-focused": a || void 0,
@@ -38,11 +38,11 @@ const xe = /* @__PURE__ */ y(function(e, t) {
38
38
  "data-focus-visible": u || void 0,
39
39
  "data-invalid": l || void 0
40
40
  });
41
- }), ne = /* @__PURE__ */ N(null), de = /* @__PURE__ */ y(function(e, t) {
42
- [e, t] = g(e, t, ne);
43
- let { validationBehavior: n } = Q(q) || {};
41
+ }), de = /* @__PURE__ */ N(null), ne = /* @__PURE__ */ y(function(e, t) {
42
+ [e, t] = g(e, t, de);
43
+ let { validationBehavior: d } = Q(q) || {};
44
44
  var i, a;
45
- let u = (a = (i = e.validationBehavior) !== null && i !== void 0 ? i : n) !== null && a !== void 0 ? a : "native", f = A(null), [l, c] = g({}, f, w), [p, v] = U(), [x, o] = O("input"), { labelProps: m, inputProps: F, descriptionProps: D, errorMessageProps: V, ...h } = W({
45
+ let u = (a = (i = e.validationBehavior) !== null && i !== void 0 ? i : d) !== null && a !== void 0 ? a : "native", f = A(null), [l, c] = g({}, f, w), [p, v] = U(), [x, o] = O("input"), { labelProps: m, inputProps: F, descriptionProps: D, errorMessageProps: V, ...h } = W({
46
46
  ...X(e),
47
47
  inputElementType: x,
48
48
  label: v,
@@ -112,7 +112,7 @@ const xe = /* @__PURE__ */ y(function(e, t) {
112
112
  label: s,
113
113
  description: e,
114
114
  errorMessage: t,
115
- validationType: n,
115
+ validationType: d,
116
116
  validate: i,
117
117
  maxCharacters: a,
118
118
  showCounter: u,
@@ -121,12 +121,12 @@ const xe = /* @__PURE__ */ y(function(e, t) {
121
121
  const [l, c] = b.useState(""), p = (o) => {
122
122
  const m = o.target.value;
123
123
  c(m);
124
- }, v = (o) => n === "ssn" ? re.test(o) ? null : "Felaktigt personnummer" : n instanceof RegExp ? new RegExp(n).test(o) ? null : t == null ? void 0 : t.toString() : a ? a && o.length > a ? `Du har angett ${o.length - a} tecken för mycket. Fältet är begränsat till ${a} tecken.` : null : i ? i(o) : !0, x = () => a ? /* @__PURE__ */ $(
124
+ }, v = (o) => d === "ssn" ? re.test(o) ? null : "Felaktigt personnummer" : d instanceof RegExp ? new RegExp(d).test(o) ? null : t == null ? void 0 : t.toString() : a ? a && o.length > a ? `Du har angett ${o.length - a} tecken för mycket. Fältet är begränsat till ${a} tecken.` : null : i ? i(o) : !0, x = () => a ? /* @__PURE__ */ $(
125
125
  "span",
126
126
  {
127
127
  className: te(
128
- d.count,
129
- l.length > a && d.countExceeded
128
+ n.count,
129
+ l.length > a && n.countExceeded
130
130
  ),
131
131
  children: [
132
132
  l.length,
@@ -134,11 +134,11 @@ const xe = /* @__PURE__ */ y(function(e, t) {
134
134
  a
135
135
  ]
136
136
  }
137
- ) : u ? /* @__PURE__ */ r("span", { className: d.count, children: l.length }) : null;
137
+ ) : u ? /* @__PURE__ */ r("span", { className: n.count, children: l.length }) : null;
138
138
  return /* @__PURE__ */ r(
139
- de,
139
+ ne,
140
140
  {
141
- className: d.inputField,
141
+ className: n.inputField,
142
142
  validate: v,
143
143
  ...f,
144
144
  children: /* @__PURE__ */ $(
@@ -149,12 +149,12 @@ const xe = /* @__PURE__ */ y(function(e, t) {
149
149
  errorMessage: t,
150
150
  children: [
151
151
  /* @__PURE__ */ r(x, {}),
152
- /* @__PURE__ */ $("div", { className: d.wrap, children: [
152
+ /* @__PURE__ */ $("div", { className: n.wrap, children: [
153
153
  /* @__PURE__ */ r(
154
154
  z,
155
155
  {
156
156
  type: f.type,
157
- className: d.input,
157
+ className: n.input,
158
158
  onChange: p,
159
159
  onBlur: p
160
160
  }
@@ -176,13 +176,13 @@ const xe = /* @__PURE__ */ y(function(e, t) {
176
176
  type: s,
177
177
  input: e
178
178
  }) => {
179
- const [t, n] = b.useState(!1);
179
+ const [t, d] = b.useState(!1);
180
180
  return s === "password" ? /* @__PURE__ */ $(k, { children: [
181
181
  t && /* @__PURE__ */ r(
182
182
  H,
183
183
  {
184
184
  slot: "description",
185
- className: d.passwordText,
185
+ className: n.passwordText,
186
186
  children: e
187
187
  }
188
188
  ),
@@ -190,8 +190,8 @@ const xe = /* @__PURE__ */ y(function(e, t) {
190
190
  ee,
191
191
  {
192
192
  variant: "tertiary",
193
- onPress: () => n(!t),
194
- className: d.passwordButton,
193
+ onPress: () => d(!t),
194
+ className: n.passwordButton,
195
195
  children: t ? "Dölj" : "Visa"
196
196
  }
197
197
  )
@@ -200,24 +200,24 @@ const xe = /* @__PURE__ */ y(function(e, t) {
200
200
  label: s,
201
201
  description: e,
202
202
  errorMessage: t,
203
- children: n
204
- }) => /* @__PURE__ */ $("div", { className: d.inputWrapper, children: [
205
- s && /* @__PURE__ */ r(G, { className: d.label, children: s }),
203
+ children: d
204
+ }) => /* @__PURE__ */ $("div", { className: n.inputWrapper, children: [
205
+ s && /* @__PURE__ */ r(G, { className: n.label, children: s }),
206
206
  e && /* @__PURE__ */ r(
207
207
  H,
208
208
  {
209
209
  slot: "description",
210
- className: d.text,
210
+ className: n.text,
211
211
  children: e
212
212
  }
213
213
  ),
214
- /* @__PURE__ */ r(C, { className: d.fieldError, children: t }),
215
- n
214
+ /* @__PURE__ */ r(C, { className: n.fieldError, children: t }),
215
+ d
216
216
  ] }), re = new RegExp(
217
217
  "^(?:(?:19|20)?\\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\\d|3[01])(?:[-+ ]?\\d{4})?|\\d{4}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\\d|3[01])(?:[-+ ]?\\d{4}))$"
218
218
  );
219
219
  export {
220
- de as $,
220
+ ne as $,
221
221
  se as I,
222
222
  me as T,
223
223
  xe as a,
@@ -1,10 +1,10 @@
1
1
  import C, { useEffect as y, createContext as w } from "react";
2
- import { n as k, r as E, e as p, a as I, b as F, c as T, d as H } from "./useFocusRing-BKGhL91C.js";
3
- import { c as R, d as M, e as S } from "./Form-BQQs3jUk.js";
4
- import { $ as B } from "./useControlledState-DrAoodI6.js";
5
- import { b as V } from "./useField-Dz62UHCP.js";
6
- import { $ as W } from "./useFocusable-CRSmYEQc.js";
7
- import { $ as D } from "./Hidden-DngIphiL.js";
2
+ import { o as k, s as E, e as p, a as I, b as F, c as T, d as H } from "./useFocusRing-9PXyKy2A.js";
3
+ import { c as R, d as S, e as M } from "./Form-BWBjJC6v.js";
4
+ import { $ as B } from "./useControlledState-Kv9K2AYu.js";
5
+ import { b as V } from "./useField-DMzJIIN4.js";
6
+ import { $ as W } from "./useFocusable-CcEBZe40.js";
7
+ import { $ as D } from "./Hidden-CVlUgUJM.js";
8
8
  import './TextField.css';function me(e, a) {
9
9
  let { inputElementType: o = "input", isDisabled: i = !1, isRequired: t = !1, isReadOnly: d = !1, type: r = "text", validationBehavior: s = "aria" } = e, [n, l] = B(e.value, e.defaultValue || "", e.onChange), { focusableProps: $ } = W(e, a), f = R({
10
10
  ...e,
@@ -20,7 +20,7 @@ import './TextField.css';function me(e, a) {
20
20
  type: r,
21
21
  pattern: e.pattern
22
22
  };
23
- return M(a, n, l), S(e, f, a), y(() => {
23
+ return S(a, n, l), M(e, f, a), y(() => {
24
24
  if (a.current instanceof E(a.current).HTMLTextAreaElement) {
25
25
  let c = a.current;
26
26
  Object.defineProperty(c, "defaultValue", {
@@ -1,4 +1,4 @@
1
- import { f as n, e as d } from "./useFocusRing-BKGhL91C.js";
1
+ import { f as n, e as d } from "./useFocusRing-9PXyKy2A.js";
2
2
  import u, { useState as f, useMemo as p } from "react";
3
3
  const a = {
4
4
  border: 0,
@@ -1,13 +1,13 @@
1
- import { default as React } from 'react';
2
- import { TextElementTag } from './AccordionTagContext';
3
- import * as RadixAccordion from '@radix-ui/react-accordion';
4
- type AccordionRootCombined = RadixAccordion.AccordionSingleProps | RadixAccordion.AccordionMultipleProps;
5
- interface AccordionProps {
6
- /** Pick a heading tag to be rendered as the title in each accordion */
7
- headingTag?: TextElementTag;
1
+ import { DisclosureGroupProps } from 'react-aria-components';
2
+ import * as React from 'react';
3
+ interface MidasAccordion extends DisclosureGroupProps {
4
+ /** Display either the larger contained variant or a smaller uncontained variant */
5
+ variant?: 'uncontained' | 'contained';
6
+ /** Weither to allow the user to have multiple accordions open at the same time */
7
+ type?: 'single' | 'multiple';
8
8
  }
9
9
  /**
10
10
  * Accordions are used primarily to reduce the direct amount of information on a page and to sort it clearly.
11
11
  */
12
- export declare const Accordion: React.ForwardRefExoticComponent<(AccordionRootCombined & AccordionProps) & React.RefAttributes<HTMLDivElement>>;
12
+ export declare const Accordion: React.FC<MidasAccordion>;
13
13
  export {};
@@ -1,3 +1,11 @@
1
- import { default as React } from 'react';
2
- import * as RadixAccordion from '@radix-ui/react-accordion';
3
- export declare const AccordionItem: React.ForwardRefExoticComponent<RadixAccordion.AccordionItemProps & React.RefAttributes<HTMLDivElement>>;
1
+ import { DisclosureProps, HeadingProps } from 'react-aria-components';
2
+ import * as React from 'react';
3
+ interface MidasAccordionItem extends Omit<DisclosureProps, 'children'> {
4
+ /** The text displayed in the collapsed state */
5
+ title?: string;
6
+ children?: React.ReactNode;
7
+ /** Adjust the titles heading level to your heading tag structure */
8
+ headingLevel?: HeadingProps['level'];
9
+ }
10
+ export declare const AccordionItem: React.FC<MidasAccordionItem>;
11
+ export {};
@@ -1,5 +1,2 @@
1
1
  export { Accordion } from './Accordion';
2
2
  export { AccordionItem } from './AccordionItem';
3
- export { AccordionTrigger } from './AccordionTrigger';
4
- export { AccordionContent } from './AccordionContent';
5
- export { AccordionTagContext } from './AccordionTagContext';
@@ -1,5 +1,5 @@
1
- import l, { useState as i, useEffect as d, useContext as $ } from "react";
2
- import { g as u } from "./useFocusRing-BKGhL91C.js";
1
+ import l, { useState as d, useEffect as i, useContext as $ } from "react";
2
+ import { g as u } from "./useFocusRing-9PXyKy2A.js";
3
3
  const s = /* @__PURE__ */ new Set([
4
4
  "Arab",
5
5
  "Syrc",
@@ -34,9 +34,9 @@ const s = /* @__PURE__ */ new Set([
34
34
  ]);
35
35
  function g(e) {
36
36
  if (Intl.Locale) {
37
- let t = new Intl.Locale(e).maximize(), r = typeof t.getTextInfo == "function" ? t.getTextInfo() : t.textInfo;
38
- if (r) return r.direction === "rtl";
39
- if (t.script) return s.has(t.script);
37
+ let a = new Intl.Locale(e).maximize(), o = typeof a.getTextInfo == "function" ? a.getTextInfo() : a.textInfo;
38
+ if (o) return o.direction === "rtl";
39
+ if (a.script) return s.has(a.script);
40
40
  }
41
41
  let n = e.split("-")[0];
42
42
  return b.has(n);
@@ -56,15 +56,15 @@ function c() {
56
56
  direction: g(e) ? "rtl" : "ltr"
57
57
  };
58
58
  }
59
- let o = c(), a = /* @__PURE__ */ new Set();
59
+ let r = c(), t = /* @__PURE__ */ new Set();
60
60
  function f() {
61
- o = c();
62
- for (let e of a) e(o);
61
+ r = c();
62
+ for (let e of t) e(r);
63
63
  }
64
64
  function x() {
65
- let e = u(), [n, t] = i(o);
66
- return d(() => (a.size === 0 && window.addEventListener("languagechange", f), a.add(t), () => {
67
- a.delete(t), a.size === 0 && window.removeEventListener("languagechange", f);
65
+ let e = u(), [n, a] = d(r);
66
+ return i(() => (t.size === 0 && window.addEventListener("languagechange", f), t.add(a), () => {
67
+ t.delete(a), t.size === 0 && window.removeEventListener("languagechange", f);
68
68
  }), []), e ? {
69
69
  locale: "en-US",
70
70
  direction: "ltr"
package/global.css ADDED
@@ -0,0 +1 @@
1
+ @font-face{font-family:Inter;font-style:normal;font-display:swap;font-weight:100 900;src:url(https://cdn.jsdelivr.net/fontsource/fonts/inter:vf@latest/latin-wght-normal.woff2) format("woff2-variations");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}*{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}
package/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export * from './theme/index';
1
2
  export * from './accordion';
2
3
  export * from './breadcrumbs';
3
4
  export * from './button';