@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
package/index76.js CHANGED
@@ -1,82 +1,275 @@
1
- import { jsxs as t, jsx as c, Fragment as i } from "react/jsx-runtime";
2
- import { $ as d, a, b as l, c as f } from "./Dialog-Cb6toyXO.js";
3
- import { Button as u } from "./index69.js";
4
- import { c as p } from "./createLucideIcon-DeWljiyi.js";
5
- import './Dropdown.css';/**
1
+ import { jsxs as l, jsx as e } from "react/jsx-runtime";
2
+ import { LinkButton as f } from "./index75.js";
3
+ import { Button as k } from "./index66.js";
4
+ import { c as h } from "./clsx-OuTLNxxd.js";
5
+ import { FlexItem as N } from "./index44.js";
6
+ import { Logo as g } from "./index70.js";
7
+ import b from "react";
8
+ import './global.css';import './Layout.css';/* empty css */
9
+ import { m as v } from "./tokens-CjXmpXTi.js";
10
+ import { Dropdown as x, DropdownItem as C } from "./index73.js";
11
+ import { $ as L } from "./useFocusRing-9PXyKy2A.js";
12
+ import { c as y } from "./createLucideIcon-DeWljiyi.js";
13
+ import { X as T } from "./x-JK7i-TQC.js";
14
+ /**
6
15
  * @license lucide-react v0.453.0 - ISC
7
16
  *
8
17
  * This source code is licensed under the ISC license.
9
18
  * See the LICENSE file in the root directory of this source tree.
10
19
  */
11
- const x = p("EllipsisVertical", [
12
- ["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
13
- ["circle", { cx: "12", cy: "5", r: "1", key: "gxeob9" }],
14
- ["circle", { cx: "12", cy: "19", r: "1", key: "lyex9k" }]
15
- ]), $ = '"../theme/tokens.css"', b = '"Inter", sans-serif', m = "0 0 0 2px #ffffff, 0 0 0 4px #000000", h = "#f2f2f2", y = "_dropDownMenu_1f4ap_4", w = "_dropdownMenu_1f4ap_15", s = {
16
- tokens: $,
17
- display: b,
18
- focus: m,
19
- gray10: h,
20
- dropDownMenu: y,
21
- dropdownMenu: w
22
- };
23
- function _({
24
- label: e,
20
+ const I = y("Menu", [
21
+ ["line", { x1: "4", x2: "20", y1: "12", y2: "12", key: "1e0a9i" }],
22
+ ["line", { x1: "4", x2: "20", y1: "6", y2: "6", key: "1owob3" }],
23
+ ["line", { x1: "4", x2: "20", y1: "18", y2: "18", key: "yk5zj1" }]
24
+ ]);
25
+ /**
26
+ * @license lucide-react v0.453.0 - ISC
27
+ *
28
+ * This source code is licensed under the ISC license.
29
+ * See the LICENSE file in the root directory of this source tree.
30
+ */
31
+ const B = y("PanelLeftClose", [
32
+ ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
33
+ ["path", { d: "M9 3v18", key: "fh3hqa" }],
34
+ ["path", { d: "m16 15-3-3 3-3", key: "14y99z" }]
35
+ ]);
36
+ /**
37
+ * @license lucide-react v0.453.0 - ISC
38
+ *
39
+ * This source code is licensed under the ISC license.
40
+ * See the LICENSE file in the root directory of this source tree.
41
+ */
42
+ const M = y("PanelRightClose", [
43
+ ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
44
+ ["path", { d: "M15 3v18", key: "14nvp0" }],
45
+ ["path", { d: "m8 9 3 3-3 3", key: "12hl5m" }]
46
+ ]), P = '"../theme/tokens.css"', $ = '"Inter", sans-serif', H = "#143c50", O = "#f2f2f2", z = "#d9d9d9", E = "#b3b3b3", F = "#a6a6a6", S = "#5d5d5d", G = "(min-width: 768px)", j = "#b90835", D = "_baseLayout_1w6p5_4", R = "_mainContent_1w6p5_13", q = "_header_1w6p5_18", X = "_headerContent_1w6p5_35", A = "_headerItems_1w6p5_52", J = "_logo_1w6p5_53", K = "_headerMenu_1w6p5_61", Q = "_toggleButton_1w6p5_69", U = "_sidebar_1w6p5_77", V = "_main_1w6p5_13", W = "_app_1w6p5_112", Y = "_sidebarOpened_1w6p5_121", Z = "_sidebarHeader_1w6p5_125", ee = "_sidebarFooter_1w6p5_134", ae = "_sidebarCollapsed_1w6p5_148", te = "_userName_1w6p5_165", se = "_abbr_1w6p5_177", ne = "_userTitle_1w6p5_183", ie = "_title_1w6p5_194", re = "_sidebarNav_1w6p5_205", oe = "_list_1w6p5_211", le = "_listGroupTitle_1w6p5_218", de = "_listItem_1w6p5_227", ce = "_listItemCollapsed_1w6p5_231", me = "_listLink_1w6p5_235", pe = "_linkText_1w6p5_242", _e = "_linkTextCollapsed_1w6p5_252", he = "_listLinkCollapsed_1w6p5_263", be = "_collapseButton_1w6p5_267", ye = "_backdrop_1w6p5_272", ue = "_backdropOpened_1w6p5_281", a = {
47
+ tokens: P,
48
+ display: $,
49
+ primaryBackground: H,
50
+ gray10: O,
51
+ gray30: z,
52
+ gray60: E,
53
+ gray70: F,
54
+ gray130: S,
55
+ mdBreakpoint: G,
56
+ logoPrimary: j,
57
+ baseLayout: D,
58
+ mainContent: R,
59
+ header: q,
60
+ headerContent: X,
61
+ headerItems: A,
62
+ logo: J,
63
+ headerMenu: K,
64
+ toggleButton: Q,
65
+ sidebar: U,
66
+ main: V,
67
+ app: W,
68
+ sidebarOpened: Y,
69
+ sidebarHeader: Z,
70
+ sidebarFooter: ee,
71
+ sidebarCollapsed: ae,
72
+ userName: te,
73
+ abbr: se,
74
+ userTitle: ne,
75
+ title: ie,
76
+ sidebarNav: re,
77
+ list: oe,
78
+ listGroupTitle: le,
79
+ listItem: de,
80
+ listItemCollapsed: ce,
81
+ listLink: me,
82
+ linkText: pe,
83
+ linkTextCollapsed: _e,
84
+ listLinkCollapsed: he,
85
+ collapseButton: be,
86
+ backdrop: ye,
87
+ backdropOpened: ue
88
+ }, He = ({
89
+ items: p,
25
90
  title: r,
26
- children: n,
27
- ...o
28
- }) {
29
- return /* @__PURE__ */ t(d, { ...o, children: [
30
- /* @__PURE__ */ t(
31
- u,
91
+ user: d,
92
+ app: t,
93
+ children: i,
94
+ headerChildren: o,
95
+ clientSideRouter: c
96
+ }) => {
97
+ const [m, s] = b.useState(!1), [n, _] = b.useState(!1);
98
+ return b.useEffect(() => {
99
+ const u = (w) => {
100
+ w.key === "Escape" && _(!1);
101
+ };
102
+ return window.addEventListener("keydown", u), () => {
103
+ window.removeEventListener("keydown", u);
104
+ };
105
+ }, []), /* @__PURE__ */ l("div", { className: a.baseLayout, children: [
106
+ /* @__PURE__ */ e(
107
+ we,
32
108
  {
33
- "aria-label": e,
34
- variant: "icon",
35
- children: [
36
- r,
37
- /* @__PURE__ */ c(
38
- x,
39
- {
40
- size: 20,
41
- "aria-hidden": !0
42
- }
43
- )
44
- ]
109
+ title: r,
110
+ headerChildren: o,
111
+ user: d,
112
+ app: t,
113
+ isOpened: n,
114
+ setIsOpened: _,
115
+ setIsCollapsed: s
45
116
  }
46
117
  ),
47
- /* @__PURE__ */ c(a, { children: /* @__PURE__ */ c(
48
- l,
49
- {
50
- ...o,
51
- className: s.dropDownMenu,
52
- children: n
53
- }
54
- ) })
118
+ /* @__PURE__ */ l("div", { className: a.mainContent, children: [
119
+ /* @__PURE__ */ e(
120
+ ke,
121
+ {
122
+ items: p,
123
+ app: t,
124
+ isOpened: n,
125
+ isCollapsed: m,
126
+ setIsCollapsed: s,
127
+ clientSideRouter: c
128
+ }
129
+ ),
130
+ /* @__PURE__ */ e(N, { children: /* @__PURE__ */ e("main", { className: a.main, children: /* @__PURE__ */ e("div", { className: a.app, children: i }) }) }),
131
+ /* @__PURE__ */ e(
132
+ "div",
133
+ {
134
+ className: h(a.backdrop, n && a.backdropOpened),
135
+ onClick: () => _(!1),
136
+ "aria-hidden": !0
137
+ }
138
+ )
139
+ ] })
55
140
  ] });
56
- }
57
- function v(e) {
58
- const r = e.textValue || (typeof e.children == "string" ? e.children : void 0);
59
- return /* @__PURE__ */ c(
60
- f,
141
+ }, ke = ({
142
+ items: p,
143
+ app: r,
144
+ isOpened: d,
145
+ isCollapsed: t,
146
+ setIsCollapsed: i,
147
+ clientSideRouter: o
148
+ }) => {
149
+ const c = () => /* @__PURE__ */ e("div", { className: a.sidebarHeader, children: t ? /* @__PURE__ */ e("p", { className: a.name, children: r.shortName }) : /* @__PURE__ */ e("p", { className: a.abbr, children: r.name }) }), m = ({ group: s }) => /* @__PURE__ */ e("ul", { className: a.list, children: s.items.map((n, _) => /* @__PURE__ */ e(
150
+ "li",
151
+ {
152
+ className: h(
153
+ a.listItem,
154
+ t && a.listItemCollapsed
155
+ ),
156
+ children: /* @__PURE__ */ e(
157
+ f,
158
+ {
159
+ iconPlacement: "left",
160
+ href: n.href,
161
+ icon: n.icon,
162
+ className: h(
163
+ a.listLink,
164
+ t && a.listLinkCollapsed
165
+ ),
166
+ variant: "tertiary",
167
+ children: /* @__PURE__ */ e(
168
+ "span",
169
+ {
170
+ className: h(
171
+ a.linkText,
172
+ t && a.linkTextCollapsed
173
+ ),
174
+ children: n.title
175
+ }
176
+ )
177
+ }
178
+ )
179
+ },
180
+ "link_" + _
181
+ )) });
182
+ return /* @__PURE__ */ l(
183
+ "aside",
61
184
  {
62
- ...e,
63
- textValue: r,
64
- className: ({ isFocused: n, isOpen: o }) => `${s.dropdownMenu} ${n ? "focused" : ""} ${o ? "open" : ""}`,
65
- children: ({ hasSubmenu: n }) => /* @__PURE__ */ t(i, { children: [
66
- e.children,
67
- n && /* @__PURE__ */ c(
68
- "svg",
185
+ id: "midasMainMenu",
186
+ className: h(
187
+ a.sidebar,
188
+ t && a.sidebarCollapsed,
189
+ d && a.sidebarOpened
190
+ ),
191
+ children: [
192
+ /* @__PURE__ */ e(c, {}),
193
+ /* @__PURE__ */ e("nav", { className: a.sidebarNav, children: /* @__PURE__ */ e("ul", { className: a.list, children: p.map((s, n) => /* @__PURE__ */ l("li", { children: [
194
+ s.title && !t && /* @__PURE__ */ e("p", { className: a.listGroupTitle, children: s.title }),
195
+ o ? /* @__PURE__ */ e(L, { navigate: o, children: /* @__PURE__ */ e(m, { group: s }) }) : /* @__PURE__ */ e(m, { group: s })
196
+ ] }, "list_" + n)) }) }),
197
+ /* @__PURE__ */ e("div", { className: a.sidebarFooter, children: /* @__PURE__ */ e(
198
+ k,
69
199
  {
70
- className: "chevron",
71
- viewBox: "0 0 24 24",
72
- children: /* @__PURE__ */ c("path", { d: "m9 18 6-6-6-6" })
200
+ variant: "tertiary",
201
+ "aria-label": t ? "Maximera sidomenyn" : "Minimera sidomenyn",
202
+ onPress: () => i(!t),
203
+ className: a.collapseButton,
204
+ children: t ? /* @__PURE__ */ e(M, {}) : /* @__PURE__ */ e(B, {})
73
205
  }
74
- )
75
- ] })
206
+ ) })
207
+ ]
76
208
  }
77
209
  );
78
- }
210
+ }, we = ({
211
+ title: p,
212
+ user: r,
213
+ app: d,
214
+ headerChildren: t,
215
+ isOpened: i,
216
+ setIsOpened: o,
217
+ setIsCollapsed: c
218
+ }) => /* @__PURE__ */ l(
219
+ "header",
220
+ {
221
+ className: a.header,
222
+ style: {
223
+ borderTop: `solid 4px ${d.color ? d.color : v.logoPrimary}`
224
+ },
225
+ children: [
226
+ /* @__PURE__ */ l("div", { className: a.headerContent, children: [
227
+ /* @__PURE__ */ e(
228
+ g,
229
+ {
230
+ padding: !1,
231
+ size: "small",
232
+ className: a.logo
233
+ }
234
+ ),
235
+ i !== void 0 && c && o && /* @__PURE__ */ e(
236
+ k,
237
+ {
238
+ variant: "icon",
239
+ className: a.toggleButton,
240
+ "aria-label": i ? "Stäng meny" : "Öppna meny",
241
+ "aria-controls": "midasMainMenu",
242
+ onPress: () => {
243
+ c(!1), o(!i);
244
+ },
245
+ children: i ? /* @__PURE__ */ e(
246
+ T,
247
+ {
248
+ size: 20,
249
+ "aria-hidden": !0
250
+ }
251
+ ) : /* @__PURE__ */ e(
252
+ I,
253
+ {
254
+ size: 20,
255
+ "aria-hidden": !0
256
+ }
257
+ )
258
+ }
259
+ ),
260
+ /* @__PURE__ */ l("div", { children: [
261
+ /* @__PURE__ */ e("p", { className: a.userName, children: r.name }),
262
+ /* @__PURE__ */ e("p", { className: a.userTitle, children: r.title }),
263
+ /* @__PURE__ */ e("p", { className: a.title, children: p })
264
+ ] })
265
+ ] }),
266
+ /* @__PURE__ */ e("div", { className: a.headerItems, children: t }),
267
+ /* @__PURE__ */ e("div", { className: a.headerMenu, children: /* @__PURE__ */ e(x, { children: b.Children.map(t, (m) => /* @__PURE__ */ e(C, { children: m })) }) })
268
+ ]
269
+ }
270
+ );
79
271
  export {
80
- _ as Dropdown,
81
- v as DropdownItem
272
+ we as Header,
273
+ He as Layout,
274
+ ke as Sidebar
82
275
  };