@midas-ds/components 1.0.2

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 (243) hide show
  1. package/Breadcrumbs.css +1 -0
  2. package/Button-CCevm2s3.js +183 -0
  3. package/Button.css +1 -0
  4. package/ButtonGroup.css +1 -0
  5. package/CHANGELOG.md +76 -0
  6. package/Card.css +1 -0
  7. package/Checkbox-CllWDBxF.js +405 -0
  8. package/Checkbox.css +1 -0
  9. package/Collection-B3xUVWPF.js +483 -0
  10. package/ComboBox.css +1 -0
  11. package/DatePicker.css +1 -0
  12. package/Dialog-CLTyYwkS.js +1889 -0
  13. package/DragAndDrop-OTN7La7U.js +42 -0
  14. package/Dropdown.css +1 -0
  15. package/FileUpload.css +1 -0
  16. package/Flex.css +1 -0
  17. package/Flex.module-CpoxBzQX.js +37 -0
  18. package/FocusScope-BR0SJ-cZ.js +512 -0
  19. package/Form-DXLoQL91.js +240 -0
  20. package/Grid.css +1 -0
  21. package/Grid.module-Ia0e9Dix.js +36 -0
  22. package/Group-DPMuN3h8.js +44 -0
  23. package/Hidden-BQWDvze4.js +37 -0
  24. package/InfoBanner.css +1 -0
  25. package/Label-C18A_4Z5.js +69 -0
  26. package/Layout.css +1 -0
  27. package/Link-BU1h3K2a.js +77 -0
  28. package/Link.css +1 -0
  29. package/LinkButton.css +1 -0
  30. package/ListBox-D21tdwTs.js +463 -0
  31. package/ListKeyboardDelegate-DxMjfMsI.js +172 -0
  32. package/Logo.css +1 -0
  33. package/Modal.css +1 -0
  34. package/MultiSelect.css +1 -0
  35. package/PressResponder-DP8ZDNGy.js +31 -0
  36. package/README.md +7 -0
  37. package/RSPContexts-EOiWkKOf.js +11 -0
  38. package/Radio.css +1 -0
  39. package/SearchField.css +1 -0
  40. package/Select.css +1 -0
  41. package/SelectionManager-D4WtKtey.js +988 -0
  42. package/Separator-DLUHK9vv.js +48 -0
  43. package/Spinner.css +1 -0
  44. package/Table.css +1 -0
  45. package/Tabs.css +1 -0
  46. package/Tag-CEd6WWSc.js +725 -0
  47. package/Tag.css +1 -0
  48. package/Text-DGLaY3HR.js +17 -0
  49. package/TextArea.css +1 -0
  50. package/TextField-C_hq9WeT.js +226 -0
  51. package/TextField.css +1 -0
  52. package/TextField.module-Cwq1FAm7.js +141 -0
  53. package/Toast.css +1 -0
  54. package/VisuallyHidden-B_XzVvlX.js +39 -0
  55. package/accordion/Accordion.d.ts +13 -0
  56. package/accordion/AccordionContent.d.ts +3 -0
  57. package/accordion/AccordionItem.d.ts +3 -0
  58. package/accordion/AccordionTagContext.d.ts +3 -0
  59. package/accordion/AccordionTrigger.d.ts +3 -0
  60. package/accordion/index.d.ts +5 -0
  61. package/breadcrumbs/Breadcrumbs.d.ts +9 -0
  62. package/breadcrumbs/index.d.ts +1 -0
  63. package/button/Button.d.ts +41 -0
  64. package/button/ButtonGroup.d.ts +12 -0
  65. package/button/index.d.ts +2 -0
  66. package/card/Card.d.ts +34 -0
  67. package/card/index.d.ts +1 -0
  68. package/checkbox/Checkbox.d.ts +2 -0
  69. package/checkbox/CheckboxGroup.d.ts +10 -0
  70. package/checkbox/index.d.ts +2 -0
  71. package/chevron-down-Cd1bkzXT.js +13 -0
  72. package/chevron-right-DBMc9VMi.js +23 -0
  73. package/clsx-OuTLNxxd.js +16 -0
  74. package/combobox/ComboBox.d.ts +12 -0
  75. package/combobox/index.d.ts +1 -0
  76. package/context-ScOIq_Gu.js +80 -0
  77. package/createLucideIcon-DeWljiyi.js +79 -0
  78. package/date-picker/DatePicker.d.ts +14 -0
  79. package/date-picker/index.d.ts +2 -0
  80. package/dropdown/Dropdown.d.ts +8 -0
  81. package/dropdown/index.d.ts +1 -0
  82. package/file-upload/FileUpload.d.ts +11 -0
  83. package/file-upload/index.d.ts +1 -0
  84. package/flex/Flex.d.ts +17 -0
  85. package/flex/FlexItem.d.ts +15 -0
  86. package/flex/index.d.ts +2 -0
  87. package/grid/Grid.d.ts +16 -0
  88. package/grid/GridItem.d.ts +7 -0
  89. package/grid/index.d.ts +2 -0
  90. package/index-CEg5vZQH.js +132 -0
  91. package/index-CgfokhRq.js +674 -0
  92. package/index-CorR1LBD.js +3122 -0
  93. package/index-Dl1Q-tbj.js +26984 -0
  94. package/index.css +1 -0
  95. package/index.d.ts +29 -0
  96. package/index.js +114 -0
  97. package/index10.js +4 -0
  98. package/index11.js +5 -0
  99. package/index12.js +4 -0
  100. package/index13.js +4 -0
  101. package/index14.js +4 -0
  102. package/index15.js +6 -0
  103. package/index16.js +6 -0
  104. package/index17.js +6 -0
  105. package/index18.js +4 -0
  106. package/index19.js +6 -0
  107. package/index2.js +8 -0
  108. package/index20.js +6 -0
  109. package/index21.js +4 -0
  110. package/index22.js +5 -0
  111. package/index23.js +5 -0
  112. package/index24.js +5 -0
  113. package/index25.js +6 -0
  114. package/index26.js +6 -0
  115. package/index27.js +6 -0
  116. package/index28.js +4 -0
  117. package/index29.js +12 -0
  118. package/index3.js +8 -0
  119. package/index30.js +20 -0
  120. package/index31.js +22 -0
  121. package/index32.js +14 -0
  122. package/index33.js +11 -0
  123. package/index34.js +31 -0
  124. package/index35.js +8 -0
  125. package/index36.js +9 -0
  126. package/index37.js +19 -0
  127. package/index38.js +9 -0
  128. package/index39.js +9 -0
  129. package/index4.js +4 -0
  130. package/index40.js +16 -0
  131. package/index41.js +16 -0
  132. package/index42.js +31 -0
  133. package/index43.js +16 -0
  134. package/index44.js +6 -0
  135. package/index45.js +53 -0
  136. package/index46.js +18 -0
  137. package/index47.js +27 -0
  138. package/index48.js +18 -0
  139. package/index49.js +21 -0
  140. package/index5.js +5 -0
  141. package/index50.js +49 -0
  142. package/index51.js +5 -0
  143. package/index52.js +25 -0
  144. package/index53.js +18 -0
  145. package/index54.js +9 -0
  146. package/index55.js +25 -0
  147. package/index56.js +18 -0
  148. package/index57.js +11 -0
  149. package/index58.js +12 -0
  150. package/index59.js +15 -0
  151. package/index6.js +4 -0
  152. package/index60.js +9 -0
  153. package/index61.js +9 -0
  154. package/index62.js +19 -0
  155. package/index63.js +22 -0
  156. package/index64.js +61 -0
  157. package/index65.js +15 -0
  158. package/index66.js +11 -0
  159. package/index67.js +63 -0
  160. package/index68.js +85 -0
  161. package/index69.js +74 -0
  162. package/index7.js +9 -0
  163. package/index70.js +24 -0
  164. package/index71.js +69 -0
  165. package/index72.js +80 -0
  166. package/index73.js +140 -0
  167. package/index74.js +70 -0
  168. package/index75.js +42 -0
  169. package/index76.js +82 -0
  170. package/index77.js +71 -0
  171. package/index78.js +104 -0
  172. package/index79.js +274 -0
  173. package/index8.js +4 -0
  174. package/index80.js +724 -0
  175. package/index81.js +491 -0
  176. package/index82.js +317 -0
  177. package/index83.js +391 -0
  178. package/index84.js +254 -0
  179. package/index85.js +1364 -0
  180. package/index86.js +1009 -0
  181. package/index87.js +388 -0
  182. package/index88.js +2105 -0
  183. package/index89.js +2371 -0
  184. package/index9.js +5 -0
  185. package/index90.js +6834 -0
  186. package/index91.js +17 -0
  187. package/index92.js +14 -0
  188. package/index93.js +6 -0
  189. package/index94.js +9 -0
  190. package/info-banner/InfoBanner.d.ts +21 -0
  191. package/info-banner/index.d.ts +1 -0
  192. package/intlStrings-Cd44R5hT.js +278 -0
  193. package/layout/Layout.d.ts +51 -0
  194. package/layout/index.d.ts +1 -0
  195. package/link/Link.d.ts +13 -0
  196. package/link/index.d.ts +1 -0
  197. package/link-button/LinkButton.d.ts +18 -0
  198. package/link-button/index.d.ts +1 -0
  199. package/logo/Logo.d.ts +16 -0
  200. package/logo/index.d.ts +1 -0
  201. package/modal/Modal.d.ts +13 -0
  202. package/modal/index.d.ts +1 -0
  203. package/multi-select/MultiSelect.d.ts +28 -0
  204. package/multi-select/index.d.ts +1 -0
  205. package/package.json +29 -0
  206. package/radio/Radio.d.ts +20 -0
  207. package/radio/index.d.ts +1 -0
  208. package/react.esm-D8HpDGKP.js +11060 -0
  209. package/search-field/SearchField.d.ts +13 -0
  210. package/search-field/index.d.ts +1 -0
  211. package/select/Select.d.ts +11 -0
  212. package/select/index.d.ts +1 -0
  213. package/spinner/Spinner.d.ts +11 -0
  214. package/spinner/index.d.ts +1 -0
  215. package/table/Table.d.ts +12 -0
  216. package/table/index.d.ts +1 -0
  217. package/tabs/Tabs.d.ts +12 -0
  218. package/tabs/index.d.ts +1 -0
  219. package/tag/Tag.d.ts +11 -0
  220. package/tag/index.d.ts +1 -0
  221. package/textarea/TextArea.d.ts +20 -0
  222. package/textarea/index.d.ts +1 -0
  223. package/textfield/TextField.d.ts +16 -0
  224. package/textfield/index.d.ts +3 -0
  225. package/theme/index.d.ts +138 -0
  226. package/theme/tokens.d.ts +135 -0
  227. package/toast/Toast.d.ts +25 -0
  228. package/toast/index.d.ts +1 -0
  229. package/tokens-CjXmpXTi.js +160 -0
  230. package/triangle-alert-1OYl9KWz.js +56 -0
  231. package/useControlledState-S_TYcV_c.js +45 -0
  232. package/useDescription-D4_zk_sA.js +32 -0
  233. package/useFilter-BnJDBCkt.js +35 -0
  234. package/useFocusRing-D97-G3fT.js +1324 -0
  235. package/useFocusable-C-N9wcwm.js +56 -0
  236. package/useGridSelectionCheckbox-i1rsjlC-.js +22 -0
  237. package/useHasTabbableChild-DeuCnGGv.js +34 -0
  238. package/useHighlightSelectionDescription-JVx2MW_e.js +552 -0
  239. package/useListState-DSOTbsL3.js +119 -0
  240. package/useLocalizedStringFormatter-DVCAZqcL.js +96 -0
  241. package/useSingleSelectListState-CmX9_L5H.js +34 -0
  242. package/useUpdateEffect-Dtz-i14F.js +12 -0
  243. package/x-JK7i-TQC.js +14 -0
@@ -0,0 +1,119 @@
1
+ import { $ as C, a as T, b as V } from "./SelectionManager-D4WtKtey.js";
2
+ import { useMemo as m, useCallback as W, useRef as z, useEffect as F } from "react";
3
+ class D {
4
+ *[Symbol.iterator]() {
5
+ yield* this.iterable;
6
+ }
7
+ get size() {
8
+ return this.keyMap.size;
9
+ }
10
+ getKeys() {
11
+ return this.keyMap.keys();
12
+ }
13
+ getKeyBefore(t) {
14
+ let l = this.keyMap.get(t);
15
+ var e;
16
+ return l && (e = l.prevKey) !== null && e !== void 0 ? e : null;
17
+ }
18
+ getKeyAfter(t) {
19
+ let l = this.keyMap.get(t);
20
+ var e;
21
+ return l && (e = l.nextKey) !== null && e !== void 0 ? e : null;
22
+ }
23
+ getFirstKey() {
24
+ return this.firstKey;
25
+ }
26
+ getLastKey() {
27
+ return this.lastKey;
28
+ }
29
+ getItem(t) {
30
+ var l;
31
+ return (l = this.keyMap.get(t)) !== null && l !== void 0 ? l : null;
32
+ }
33
+ at(t) {
34
+ const l = [
35
+ ...this.getKeys()
36
+ ];
37
+ return this.getItem(l[t]);
38
+ }
39
+ getChildren(t) {
40
+ let l = this.keyMap.get(t);
41
+ return (l == null ? void 0 : l.childNodes) || [];
42
+ }
43
+ constructor(t) {
44
+ this.keyMap = /* @__PURE__ */ new Map(), this.firstKey = null, this.lastKey = null, this.iterable = t;
45
+ let l = (n) => {
46
+ if (this.keyMap.set(n.key, n), n.childNodes && n.type === "section") for (let i of n.childNodes) l(i);
47
+ };
48
+ for (let n of t) l(n);
49
+ let e = null, f = 0;
50
+ for (let [n, i] of this.keyMap)
51
+ e ? (e.nextKey = n, i.prevKey = e.key) : (this.firstKey = n, i.prevKey = void 0), i.type === "item" && (i.index = f++), e = i, e.nextKey = void 0;
52
+ var c;
53
+ this.lastKey = (c = e == null ? void 0 : e.key) !== null && c !== void 0 ? c : null;
54
+ }
55
+ }
56
+ function A(s) {
57
+ let { filter: t, layoutDelegate: l } = s, e = C(s), f = m(() => s.disabledKeys ? new Set(s.disabledKeys) : /* @__PURE__ */ new Set(), [
58
+ s.disabledKeys
59
+ ]), c = W((y) => t ? new D(t(y)) : new D(y), [
60
+ t
61
+ ]), n = m(() => ({
62
+ suppressTextValueWarning: s.suppressTextValueWarning
63
+ }), [
64
+ s.suppressTextValueWarning
65
+ ]), i = T(s, c, n), K = m(() => new V(i, e, {
66
+ layoutDelegate: l
67
+ }), [
68
+ i,
69
+ e,
70
+ l
71
+ ]);
72
+ const v = z(null);
73
+ return F(() => {
74
+ if (e.focusedKey != null && !i.getItem(e.focusedKey) && v.current) {
75
+ const o = v.current.getItem(e.focusedKey), M = [
76
+ ...v.current.getKeys()
77
+ ].map((d) => {
78
+ const a = v.current.getItem(d);
79
+ return (a == null ? void 0 : a.type) === "item" ? a : null;
80
+ }).filter((d) => d !== null), u = [
81
+ ...i.getKeys()
82
+ ].map((d) => {
83
+ const a = i.getItem(d);
84
+ return (a == null ? void 0 : a.type) === "item" ? a : null;
85
+ }).filter((d) => d !== null);
86
+ var y, g;
87
+ const w = ((y = M == null ? void 0 : M.length) !== null && y !== void 0 ? y : 0) - ((g = u == null ? void 0 : u.length) !== null && g !== void 0 ? g : 0);
88
+ var h, k, p;
89
+ let r = Math.min(w > 1 ? Math.max(((h = o == null ? void 0 : o.index) !== null && h !== void 0 ? h : 0) - w + 1, 0) : (k = o == null ? void 0 : o.index) !== null && k !== void 0 ? k : 0, ((p = u == null ? void 0 : u.length) !== null && p !== void 0 ? p : 0) - 1), x = null, S = !1;
90
+ for (; r >= 0; ) {
91
+ if (!K.isDisabled(u[r].key)) {
92
+ x = u[r];
93
+ break;
94
+ }
95
+ if (r < u.length - 1 && !S) r++;
96
+ else {
97
+ S = !0;
98
+ var b, $;
99
+ r > ((b = o == null ? void 0 : o.index) !== null && b !== void 0 ? b : 0) && (r = ($ = o == null ? void 0 : o.index) !== null && $ !== void 0 ? $ : 0), r--;
100
+ }
101
+ }
102
+ e.setFocusedKey(x ? x.key : null);
103
+ }
104
+ v.current = i;
105
+ }, [
106
+ i,
107
+ K,
108
+ e,
109
+ e.focusedKey
110
+ ]), {
111
+ collection: i,
112
+ disabledKeys: f,
113
+ selectionManager: K
114
+ };
115
+ }
116
+ export {
117
+ A as $,
118
+ D as a
119
+ };
@@ -0,0 +1,96 @@
1
+ import { $ } from "./context-ScOIq_Gu.js";
2
+ import { useMemo as b } from "react";
3
+ const g = Symbol.for("react-aria.i18n.locale"), h = Symbol.for("react-aria.i18n.strings");
4
+ let i;
5
+ class c {
6
+ /** Returns a localized string for the given key and locale. */
7
+ getStringForLocale(e, t) {
8
+ let a = this.getStringsForLocale(t)[e];
9
+ if (!a) throw new Error(`Could not find intl message ${e} in ${t} locale`);
10
+ return a;
11
+ }
12
+ /** Returns all localized strings for the given locale. */
13
+ getStringsForLocale(e) {
14
+ let t = this.strings[e];
15
+ return t || (t = w(e, this.strings, this.defaultLocale), this.strings[e] = t), t;
16
+ }
17
+ static getGlobalDictionaryForPackage(e) {
18
+ if (typeof window > "u") return null;
19
+ let t = window[g];
20
+ if (i === void 0) {
21
+ let a = window[h];
22
+ if (!a) return null;
23
+ i = {};
24
+ for (let o in a) i[o] = new c({
25
+ [t]: a[o]
26
+ }, t);
27
+ }
28
+ let r = i == null ? void 0 : i[e];
29
+ if (!r) throw new Error(`Strings for package "${e}" were not included by LocalizedStringProvider. Please add it to the list passed to createLocalizedStringDictionary.`);
30
+ return r;
31
+ }
32
+ constructor(e, t = "en-US") {
33
+ this.strings = Object.fromEntries(Object.entries(e).filter(([, r]) => r)), this.defaultLocale = t;
34
+ }
35
+ }
36
+ function w(n, e, t = "en-US") {
37
+ if (e[n]) return e[n];
38
+ let r = m(n);
39
+ if (e[r]) return e[r];
40
+ for (let a in e)
41
+ if (a.startsWith(r + "-")) return e[a];
42
+ return e[t];
43
+ }
44
+ function m(n) {
45
+ return Intl.Locale ? new Intl.Locale(n).language : n.split("-")[0];
46
+ }
47
+ const s = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map();
48
+ class p {
49
+ /** Formats a localized string for the given key with the provided variables. */
50
+ format(e, t) {
51
+ let r = this.strings.getStringForLocale(e, this.locale);
52
+ return typeof r == "function" ? r(t, this) : r;
53
+ }
54
+ plural(e, t, r = "cardinal") {
55
+ let a = t["=" + e];
56
+ if (a) return typeof a == "function" ? a() : a;
57
+ let o = this.locale + ":" + r, l = s.get(o);
58
+ l || (l = new Intl.PluralRules(this.locale, {
59
+ type: r
60
+ }), s.set(o, l));
61
+ let d = l.select(e);
62
+ return a = t[d] || t.other, typeof a == "function" ? a() : a;
63
+ }
64
+ number(e) {
65
+ let t = f.get(this.locale);
66
+ return t || (t = new Intl.NumberFormat(this.locale), f.set(this.locale, t)), t.format(e);
67
+ }
68
+ select(e, t) {
69
+ let r = e[t] || e.other;
70
+ return typeof r == "function" ? r() : r;
71
+ }
72
+ constructor(e, t) {
73
+ this.locale = e, this.strings = t;
74
+ }
75
+ }
76
+ const u = /* @__PURE__ */ new WeakMap();
77
+ function y(n) {
78
+ let e = u.get(n);
79
+ return e || (e = new c(n), u.set(n, e)), e;
80
+ }
81
+ function S(n, e) {
82
+ return e && c.getGlobalDictionaryForPackage(e) || y(n);
83
+ }
84
+ function F(n, e) {
85
+ let { locale: t } = $(), r = S(n, e);
86
+ return b(() => new p(t, r), [
87
+ t,
88
+ r
89
+ ]);
90
+ }
91
+ export {
92
+ F as $,
93
+ S as a,
94
+ c as b,
95
+ p as c
96
+ };
@@ -0,0 +1,34 @@
1
+ import { $ as f } from "./useListState-DSOTbsL3.js";
2
+ import { $ as y } from "./useControlledState-S_TYcV_c.js";
3
+ import { useMemo as K } from "react";
4
+ function S(l) {
5
+ var t;
6
+ let [e, c] = y(l.selectedKey, (t = l.defaultSelectedKey) !== null && t !== void 0 ? t : null, l.onSelectionChange), i = K(() => e != null ? [
7
+ e
8
+ ] : [], [
9
+ e
10
+ ]), { collection: o, disabledKeys: s, selectionManager: u } = f({
11
+ ...l,
12
+ selectionMode: "single",
13
+ disallowEmptySelection: !0,
14
+ allowDuplicateSelectionEvents: !0,
15
+ selectedKeys: i,
16
+ onSelectionChange: (d) => {
17
+ if (d === "all") return;
18
+ var n;
19
+ let a = (n = d.values().next().value) !== null && n !== void 0 ? n : null;
20
+ a === e && l.onSelectionChange && l.onSelectionChange(a), c(a);
21
+ }
22
+ }), r = e != null ? o.getItem(e) : null;
23
+ return {
24
+ collection: o,
25
+ disabledKeys: s,
26
+ selectionManager: u,
27
+ selectedKey: e,
28
+ setSelectedKey: c,
29
+ selectedItem: r
30
+ };
31
+ }
32
+ export {
33
+ S as $
34
+ };
@@ -0,0 +1,12 @@
1
+ import { useRef as u, useEffect as f } from "react";
2
+ function l(c, t) {
3
+ const r = u(!0), e = u(null);
4
+ f(() => (r.current = !0, () => {
5
+ r.current = !1;
6
+ }), []), f(() => {
7
+ r.current ? r.current = !1 : (!e.current || t.some((s, n) => !Object.is(s, e[n]))) && c(), e.current = t;
8
+ }, t);
9
+ }
10
+ export {
11
+ l as $
12
+ };
package/x-JK7i-TQC.js ADDED
@@ -0,0 +1,14 @@
1
+ import { c as e } from "./createLucideIcon-DeWljiyi.js";
2
+ /**
3
+ * @license lucide-react v0.453.0 - ISC
4
+ *
5
+ * This source code is licensed under the ISC license.
6
+ * See the LICENSE file in the root directory of this source tree.
7
+ */
8
+ const c = e("X", [
9
+ ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
10
+ ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
11
+ ]);
12
+ export {
13
+ c as X
14
+ };