@midas-ds/components 17.29.0 → 17.30.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 (90) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/accordion/index.js +1 -1
  3. package/button/Button.stories.d.ts +1 -1
  4. package/button/index.js +1 -1
  5. package/calendar/index.js +1 -1
  6. package/card/index.js +1 -1
  7. package/checkbox/index.js +1 -1
  8. package/chunks/FeedbackStatusIcon-DvMDGBGL.js +36 -0
  9. package/chunks/{accordion-DIVTJU3O.js → accordion-BzmYSOS3.js} +23 -23
  10. package/chunks/{button-CenXTGXL.js → button-C-WkFek9.js} +1 -1
  11. package/chunks/calendar-Bt1FLxqr.js +107 -0
  12. package/chunks/card-CdH2UMUW.js +103 -0
  13. package/chunks/checkbox-DiFQy3MS.js +106 -0
  14. package/chunks/clear-button-Bv0YGBNG.js +17 -0
  15. package/chunks/color-scheme-switch-0axiBsna.js +160 -0
  16. package/chunks/{combobox-DIou4Z-d.js → combobox-DkZbA3o4.js} +24 -24
  17. package/chunks/{date-field-BF2f9bSf.js → date-field-CPpWZqws.js} +2 -2
  18. package/chunks/date-picker-DQ7vCG5-.js +142 -0
  19. package/chunks/file-list-D8Zc1aYS.js +139 -0
  20. package/chunks/{info-banner-osR4e6nB.js → info-banner-BVKtmVKN.js} +14 -14
  21. package/chunks/label-Dw5p84T2.js +50 -0
  22. package/chunks/layout-CUAjEEuH.js +378 -0
  23. package/chunks/link-DHu1cTmz.js +44 -0
  24. package/chunks/link-button-DYg_0p4Y.js +44 -0
  25. package/chunks/{list-box-BN_MSiOD.js → list-box-DmEoMvX1.js} +1 -1
  26. package/chunks/menu-CP0Xvmx0.js +48 -0
  27. package/chunks/modal-B_uSoXZM.js +66 -0
  28. package/chunks/{progress-bar-CknF4qAm.js → progress-bar-BfFxpqUv.js} +1 -1
  29. package/chunks/{radio-BD1EuxSa.js → radio-_z6ObjYx.js} +1 -1
  30. package/chunks/search-field-Cp_HHDl4.js +91 -0
  31. package/chunks/select-Wy6NakdH.js +176 -0
  32. package/chunks/spinner-COGZlDJB.js +29 -0
  33. package/chunks/table-O_Y45Sb7.js +84 -0
  34. package/chunks/tag-RjuYlFZI.js +78 -0
  35. package/chunks/{textfield-BSvCsAyC.js → textfield-Bu0Hg2pJ.js} +2 -2
  36. package/chunks/{time-field-CmjGBQph.js → time-field-Cnp-dYhm.js} +3 -3
  37. package/chunks/{toast-gJgjitZF.js → toast-Dg3fVjSS.js} +20 -20
  38. package/clear-button/index.js +1 -1
  39. package/color-scheme-switch/index.js +1 -1
  40. package/combobox/index.js +1 -1
  41. package/date-field/index.js +1 -1
  42. package/date-picker/index.js +1 -1
  43. package/file-list/index.js +1 -1
  44. package/index.js +49 -48
  45. package/info-banner/index.js +1 -1
  46. package/label/index.js +1 -1
  47. package/layout/index.js +1 -1
  48. package/link/index.js +1 -1
  49. package/link-button/index.js +1 -1
  50. package/list-box/index.js +1 -1
  51. package/menu/index.js +1 -1
  52. package/modal/index.js +1 -1
  53. package/package.json +3 -2
  54. package/progress-bar/index.js +1 -1
  55. package/radio/index.js +1 -1
  56. package/search-field/index.js +1 -1
  57. package/select/index.js +1 -1
  58. package/spinner/index.js +1 -1
  59. package/table/index.js +1 -1
  60. package/tag/index.js +1 -1
  61. package/textfield/index.js +1 -1
  62. package/time-field/index.js +1 -1
  63. package/toast/index.js +1 -1
  64. package/chunks/FeedbackStatusIcon-DRI7WrSU.js +0 -54
  65. package/chunks/arrow-right-Db_H9KjE.js +0 -10
  66. package/chunks/calendar-Bl_obez5.js +0 -111
  67. package/chunks/card-zIYA-SQh.js +0 -103
  68. package/chunks/check-DV00NPU0.js +0 -7
  69. package/chunks/checkbox-Bqd8B58G.js +0 -110
  70. package/chunks/chevron-down-CP7nEDei.js +0 -7
  71. package/chunks/chevron-right-DwqboCdU.js +0 -7
  72. package/chunks/clear-button-D3I1X3yG.js +0 -17
  73. package/chunks/color-scheme-switch-DVZjdwc9.js +0 -203
  74. package/chunks/createLucideIcon-BgluSHFG.js +0 -39
  75. package/chunks/date-picker-DZivTUB_.js +0 -187
  76. package/chunks/file-list-B4vG_egr.js +0 -161
  77. package/chunks/info-jCyacVsy.js +0 -19
  78. package/chunks/label-LWlgvAwz.js +0 -50
  79. package/chunks/layout-Db5um0f7.js +0 -426
  80. package/chunks/link-BAgs4RwY.js +0 -59
  81. package/chunks/link-button-BuPMEGUj.js +0 -52
  82. package/chunks/menu-aT2IR0tO.js +0 -49
  83. package/chunks/modal-C-UsxdO0.js +0 -66
  84. package/chunks/search-field-GNTRFpzf.js +0 -100
  85. package/chunks/select-oLCNpryY.js +0 -177
  86. package/chunks/spinner-LdHPVms_.js +0 -32
  87. package/chunks/square-arrow-out-up-right-DkgXD7hj.js +0 -17
  88. package/chunks/table-CmNWoAYO.js +0 -150
  89. package/chunks/tag-BIcqtf7b.js +0 -78
  90. package/chunks/x-BJAOO5a5.js +0 -10
@@ -1,161 +0,0 @@
1
- 'use client';
2
- import { t as e } from "./clsx-Di52oYUU.js";
3
- import { t } from "./createLucideIcon-BgluSHFG.js";
4
- import { t as n } from "./FeedbackStatusIcon-DRI7WrSU.js";
5
- import { t as r } from "./x-BJAOO5a5.js";
6
- import { t as i } from "./useLocalizedStringFormatter-CeyBc0x0.js";
7
- import { n as a } from "./button-CenXTGXL.js";
8
- import { t as o } from "./field-error-LtNtEKDp.js";
9
- import { t as s } from "./progress-bar-CknF4qAm.js";
10
- import { useEffect as c, useId as l, useRef as u } from "react";
11
- import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
12
- import { FocusScope as m, VisuallyHidden as h, useFocusManager as g } from "react-aria";
13
- import '../assets/file-list.css';var _ = t("trash-2", [
14
- ["path", {
15
- d: "M10 11v6",
16
- key: "nco0om"
17
- }],
18
- ["path", {
19
- d: "M14 11v6",
20
- key: "outv1u"
21
- }],
22
- ["path", {
23
- d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",
24
- key: "miytrc"
25
- }],
26
- ["path", {
27
- d: "M3 6h18",
28
- key: "d0wm0j"
29
- }],
30
- ["path", {
31
- d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",
32
- key: "e791ji"
33
- }]
34
- ]), v = {
35
- fileList: "_fileList_mb5n3_1",
36
- fileListItem: "_fileListItem_mb5n3_18",
37
- row: "_row_mb5n3_25",
38
- iconSlot: "_iconSlot_mb5n3_46",
39
- progressIcon: "_progressIcon_mb5n3_70",
40
- ring: "_ring_mb5n3_82",
41
- successRing: "_successRing_mb5n3_1",
42
- checkmark: "_checkmark_mb5n3_106",
43
- successCheckmark: "_successCheckmark_mb5n3_1",
44
- successIcon: "_successIcon_mb5n3_121",
45
- errorReveal: "_errorReveal_mb5n3_163",
46
- fileInfo: "_fileInfo_mb5n3_169",
47
- fileName: "_fileName_mb5n3_177",
48
- fileSize: "_fileSize_mb5n3_186",
49
- deleteButton: "_deleteButton_mb5n3_192"
50
- }, y = ({ className: t, children: n, ...r }) => {
51
- let i = u(null);
52
- return /* @__PURE__ */ f(m, { children: /* @__PURE__ */ p("ul", {
53
- ...r,
54
- ref: i,
55
- tabIndex: -1,
56
- className: e(v.fileList, t),
57
- children: [/* @__PURE__ */ f(b, { containerRef: i }), n]
58
- }) });
59
- }, b = ({ containerRef: e }) => {
60
- let t = g(), n = u(t);
61
- return c(() => {
62
- n.current = t;
63
- }), c(() => {
64
- let t = e.current;
65
- if (!t) return;
66
- let r = new MutationObserver((e) => {
67
- e.some((e) => e.removedNodes.length > 0) && document.activeElement === document.body && (n.current?.focusFirst({ tabbable: !0 }) || t.focus());
68
- });
69
- return r.observe(t, { childList: !0 }), () => r.disconnect();
70
- }, [e]), null;
71
- }, x = {
72
- en: {
73
- removeFile: "Remove",
74
- cancelUpload: "Cancel",
75
- uploading: "Uploading",
76
- uploadComplete: "Upload complete",
77
- uploadFailed: "Upload failed"
78
- },
79
- sv: {
80
- removeFile: "Ta bort",
81
- cancelUpload: "Avbryt",
82
- uploading: "Laddar upp",
83
- uploadComplete: "Uppladdning klar",
84
- uploadFailed: "Uppladdning misslyckades"
85
- }
86
- }, S = ({ fileName: t, fileSize: c, status: u = "idle", progress: m, errorMessage: g, onCancel: y, onDelete: b, className: S }) => {
87
- let C = i(x), w = u === "uploading", T = u === "success", E = u === "error", D = E && !!g, O = l(), k = l(), A = T ? C.format("uploadComplete") : E ? C.format("uploadFailed") : void 0, j = [A && k, D && O].filter(Boolean).join(" ") || void 0, M = w ? y ?? b : b;
88
- return /* @__PURE__ */ p("li", {
89
- className: e(v.fileListItem, S),
90
- "data-status": u,
91
- children: [
92
- /* @__PURE__ */ p("div", {
93
- className: v.row,
94
- children: [
95
- /* @__PURE__ */ p("span", {
96
- className: v.iconSlot,
97
- children: [
98
- w && /* @__PURE__ */ f(s, {
99
- shape: "circular",
100
- small: !0,
101
- value: m,
102
- isIndeterminate: m === void 0,
103
- "aria-label": `${C.format("uploading")} ${t}`,
104
- className: v.progressIcon
105
- }),
106
- /* @__PURE__ */ f("span", {
107
- className: v.ring,
108
- "aria-hidden": !0
109
- }),
110
- T && /* @__PURE__ */ f(n, {
111
- status: "success",
112
- "aria-hidden": !0,
113
- size: 16,
114
- className: e(v.checkmark, v.successIcon)
115
- })
116
- ]
117
- }),
118
- A && /* @__PURE__ */ f(h, {
119
- id: k,
120
- children: A
121
- }),
122
- /* @__PURE__ */ p("span", {
123
- className: v.fileInfo,
124
- children: [/* @__PURE__ */ f("span", {
125
- className: v.fileName,
126
- children: t
127
- }), c && /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(h, { children: ", " }), /* @__PURE__ */ f("span", {
128
- className: v.fileSize,
129
- children: c
130
- })] })]
131
- }),
132
- M && /* @__PURE__ */ f(a, {
133
- variant: "icon",
134
- onPress: M,
135
- "aria-label": `${C.format(w ? "cancelUpload" : "removeFile")} ${t}`,
136
- "aria-describedby": j,
137
- className: v.deleteButton,
138
- children: f(w ? r : _, {
139
- size: 20,
140
- "aria-hidden": !0
141
- })
142
- })
143
- ]
144
- }),
145
- /* @__PURE__ */ f("div", {
146
- id: O,
147
- className: v.errorReveal,
148
- children: g && /* @__PURE__ */ f(o, {
149
- isInvalid: !0,
150
- children: g
151
- })
152
- }),
153
- /* @__PURE__ */ p(h, {
154
- role: "status",
155
- children: [T && `${C.format("uploadComplete")}: ${t}`, D && `${t}: ${g}`]
156
- })
157
- ]
158
- });
159
- };
160
- //#endregion
161
- export { y as n, S as t };
@@ -1,19 +0,0 @@
1
- import { t as e } from "./createLucideIcon-BgluSHFG.js";
2
- var t = e("info", [
3
- ["circle", {
4
- cx: "12",
5
- cy: "12",
6
- r: "10",
7
- key: "1mglay"
8
- }],
9
- ["path", {
10
- d: "M12 16v-4",
11
- key: "1dtifu"
12
- }],
13
- ["path", {
14
- d: "M12 8h.01",
15
- key: "e9boi3"
16
- }]
17
- ]);
18
- //#endregion
19
- export { t };
@@ -1,50 +0,0 @@
1
- import { t as e } from "./clsx-Di52oYUU.js";
2
- import { t } from "./info-jCyacVsy.js";
3
- import { t as n } from "./useLocalizedStringFormatter-CeyBc0x0.js";
4
- import { n as r } from "./button-CenXTGXL.js";
5
- import { t as i } from "./popover-DGcogqbS.js";
6
- import { t as a } from "./modal-C-UsxdO0.js";
7
- import * as o from "react";
8
- import s, { useContext as c } from "react";
9
- import { Label as l } from "react-aria-components";
10
- import { jsx as u, jsxs as d } from "react/jsx-runtime";
11
- import '../assets/label.css';var f = { labelBase: "_labelBase_f5wtf_1" }, p = {
12
- labelPopover: "_labelPopover_15nnd_1",
13
- labelPopoverTrigger: "_labelPopoverTrigger_15nnd_7"
14
- }, m = {
15
- en: { moreInfo: "More info" },
16
- sv: { moreInfo: "Mer information" }
17
- }, h = ({ children: e, "aria-label": o }) => {
18
- let s = c(g), l = n(m);
19
- return /* @__PURE__ */ d(a, { children: [/* @__PURE__ */ u(r, {
20
- "aria-label": o || l.format("moreInfo"),
21
- className: p.labelPopoverTrigger,
22
- id: s?.popoverId,
23
- size: "medium",
24
- slot: null,
25
- variant: "icon",
26
- children: /* @__PURE__ */ u(t, { size: 20 })
27
- }), /* @__PURE__ */ u(i, { children: e })] });
28
- }, g = s.createContext(void 0), _ = ({ children: e, popover: t }) => {
29
- let n = s.useId();
30
- return t ? /* @__PURE__ */ u(g.Provider, {
31
- value: { popoverId: n },
32
- children: /* @__PURE__ */ d("div", {
33
- className: p.labelPopover,
34
- children: [e, /* @__PURE__ */ u(h, { ...t })]
35
- })
36
- }) : e;
37
- }, v = "label", y = ({ children: t, className: n, elementType: r = v, ...i }) => {
38
- let a = {
39
- className: e(f.labelBase, n),
40
- elementType: r || v,
41
- ...i
42
- }, s = o.useContext(g);
43
- return /* @__PURE__ */ u(l, {
44
- ...a,
45
- "aria-describedby": s?.popoverId,
46
- children: t
47
- });
48
- };
49
- //#endregion
50
- export { _ as n, y as t };
@@ -1,426 +0,0 @@
1
- 'use client';
2
- import { t as e } from "./clsx-Di52oYUU.js";
3
- import { t } from "./createLucideIcon-BgluSHFG.js";
4
- import { t as n } from "./x-BJAOO5a5.js";
5
- import { t as r } from "./useLocalizedStringFormatter-CeyBc0x0.js";
6
- import { n as i } from "./button-CenXTGXL.js";
7
- import { n as a, t as o } from "./badge-BfK6XrlL.js";
8
- import { t as s } from "./grid-Cn_8RSvj.js";
9
- import { n as c, t as l } from "./tooltip-BkesIUIF.js";
10
- import { t as u } from "./logo-DyZ2pXt7.js";
11
- import * as d from "react";
12
- import { useEffect as f, useState as p } from "react";
13
- import { Link as m, RouterProvider as h } from "react-aria-components";
14
- import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
15
- import { variables as y } from "@midas-ds/theme";
16
- import '../assets/layout.css';var b = t("menu", [
17
- ["path", {
18
- d: "M4 5h16",
19
- key: "1tepv9"
20
- }],
21
- ["path", {
22
- d: "M4 12h16",
23
- key: "1lakjw"
24
- }],
25
- ["path", {
26
- d: "M4 19h16",
27
- key: "1djgab"
28
- }]
29
- ]), x = t("panel-left-close", [
30
- ["rect", {
31
- width: "18",
32
- height: "18",
33
- x: "3",
34
- y: "3",
35
- rx: "2",
36
- key: "afitv7"
37
- }],
38
- ["path", {
39
- d: "M9 3v18",
40
- key: "fh3hqa"
41
- }],
42
- ["path", {
43
- d: "m16 15-3-3 3-3",
44
- key: "14y99z"
45
- }]
46
- ]), S = t("panel-left-open", [
47
- ["rect", {
48
- width: "18",
49
- height: "18",
50
- x: "3",
51
- y: "3",
52
- rx: "2",
53
- key: "afitv7"
54
- }],
55
- ["path", {
56
- d: "M9 3v18",
57
- key: "fh3hqa"
58
- }],
59
- ["path", {
60
- d: "m14 9 3 3-3 3",
61
- key: "8010ee"
62
- }]
63
- ]), C = {
64
- baseLayout: "_baseLayout_1ylxx_1",
65
- mainContent: "_mainContent_1ylxx_10",
66
- header: "_header_1ylxx_15",
67
- headerExternal: "_headerExternal_1ylxx_26",
68
- headerContent: "_headerContent_1ylxx_41",
69
- logo: "_logo_1ylxx_60",
70
- headerItems: "_headerItems_1ylxx_69",
71
- toggleButton: "_toggleButton_1ylxx_75",
72
- sidebar: "_sidebar_1ylxx_83",
73
- main: "_main_1ylxx_10",
74
- app: "_app_1ylxx_116",
75
- sidebarOpened: "_sidebarOpened_1ylxx_124",
76
- sidebarHeader: "_sidebarHeader_1ylxx_128",
77
- appName: "_appName_1ylxx_140",
78
- collapseButton: "_collapseButton_1ylxx_147",
79
- sidebarCollapsed: "_sidebarCollapsed_1ylxx_156",
80
- userName: "_userName_1ylxx_166",
81
- abbr: "_abbr_1ylxx_178",
82
- userTitle: "_userTitle_1ylxx_184",
83
- title: "_title_1ylxx_196",
84
- sidebarNav: "_sidebarNav_1ylxx_207",
85
- list: "_list_1ylxx_213",
86
- listGroupTitle: "_listGroupTitle_1ylxx_219",
87
- listItem: "_listItem_1ylxx_226",
88
- listItemCollapsed: "_listItemCollapsed_1ylxx_231",
89
- listLink: "_listLink_1ylxx_235",
90
- listLinkCollapsed: "_listLinkCollapsed_1ylxx_298",
91
- active: "_active_1ylxx_303",
92
- linkText: "_linkText_1ylxx_314",
93
- backdrop: "_backdrop_1ylxx_321",
94
- backdropOpened: "_backdropOpened_1ylxx_331",
95
- skipToContent: "_skipToContent_1ylxx_349",
96
- navbar: "_navbar_1ylxx_363",
97
- navbarList: "_navbarList_1ylxx_375",
98
- navbarItem: "_navbarItem_1ylxx_397",
99
- headerContentExternal: "_headerContentExternal_1ylxx_448",
100
- logoExternalContainer: "_logoExternalContainer_1ylxx_456",
101
- logoExternal: "_logoExternal_1ylxx_456",
102
- logoExternalDesktop: "_logoExternalDesktop_1ylxx_468",
103
- navbarWrapper: "_navbarWrapper_1ylxx_477"
104
- }, w = d.createContext(void 0), T = ({ items: e, title: t, user: n, app: r, children: i, clientSideRouter: a, clientSideHref: o, headerChildren: s, isCollapsed: c, setIsCollapsed: l, isOpened: u, setIsOpened: d, variant: f, id: p }) => /* @__PURE__ */ _(w.Provider, {
105
- value: {
106
- items: e,
107
- title: t,
108
- user: n,
109
- app: r,
110
- headerChildren: s,
111
- isCollapsed: c,
112
- setIsCollapsed: l,
113
- isOpened: u,
114
- setIsOpened: d,
115
- clientSideRouter: a,
116
- clientSideHref: o,
117
- variant: f,
118
- id: p
119
- },
120
- children: i
121
- }), E = () => {
122
- let e = d.useContext(w);
123
- if (!e) throw Error("useLayoutContext must be used within a LayoutProvider");
124
- return e;
125
- }, D = ({ title: t, href: n, icon: r, active: i, hasBadge: s, onClick: u, target: d }) => {
126
- let { isCollapsed: h, setIsOpened: g, clientSideHref: y } = E(), b = y ? y(n) : n, [x, S] = p(!1);
127
- f(() => {
128
- if (typeof window < "u") {
129
- let e = window.location.pathname === b || window.location.pathname.startsWith(b + "/");
130
- S(i ?? e);
131
- }
132
- }, [i, b]);
133
- let w = () => {
134
- g?.(!1), u && u({
135
- title: t,
136
- href: b
137
- });
138
- };
139
- return h ? /* @__PURE__ */ v(c, { children: [/* @__PURE__ */ _(m, {
140
- href: n,
141
- "aria-label": t,
142
- className: e(C.listLink, C.listLinkCollapsed, x && C.active),
143
- onPress: w,
144
- target: d,
145
- children: /* @__PURE__ */ v(o, { children: [/* @__PURE__ */ _(r, {
146
- size: 20,
147
- "aria-label": t
148
- }), s && /* @__PURE__ */ _(a, {})] })
149
- }), /* @__PURE__ */ _(l, {
150
- placement: "right",
151
- children: t
152
- })] }) : /* @__PURE__ */ v(m, {
153
- href: n,
154
- "aria-label": t,
155
- className: e(C.listLink, x && C.active),
156
- onPress: w,
157
- target: d,
158
- children: [/* @__PURE__ */ v(o, { children: [/* @__PURE__ */ _(r, { size: 20 }), s && /* @__PURE__ */ _(a, {})] }), t]
159
- });
160
- }, O = {
161
- en: {
162
- closeMenu: "Close menu",
163
- openMenu: "Open menu",
164
- maximizeMenu: "Maximize menu",
165
- minimizeMenu: "Minimize menu",
166
- sidebarMenu: "Sidebar menu",
167
- bottomMenu: "Bottom menu",
168
- skipToContent: "Skip to main content"
169
- },
170
- sv: {
171
- closeMenu: "Stäng meny",
172
- openMenu: "Öppna meny",
173
- maximizeMenu: "Maximera meny",
174
- minimizeMenu: "Minimera meny",
175
- sidebarMenu: "Sidomeny",
176
- bottomMenu: "Bottenmeny",
177
- skipToContent: "Hoppa till huvudinnehåll"
178
- }
179
- }, k = ({ onLinkClick: t }) => {
180
- let { items: n, app: a, isOpened: o, isCollapsed: s, setIsCollapsed: c, setIsOpened: l, clientSideRouter: u, clientSideHref: f, id: p } = E(), m = r(O), g = ({ group: n }) => /* @__PURE__ */ _("ul", {
181
- className: C.list,
182
- children: n.items.map((n, r) => /* @__PURE__ */ _("li", {
183
- className: e(C.listItem, s && C.listItemCollapsed),
184
- children: n.target === "_blank" || !u ? /* @__PURE__ */ _(D, {
185
- onClick: t,
186
- ...n
187
- }) : /* @__PURE__ */ _(h, {
188
- navigate: u,
189
- useHref: f,
190
- children: /* @__PURE__ */ _(D, {
191
- onClick: t,
192
- ...n
193
- })
194
- })
195
- }, "link_" + r))
196
- });
197
- return d.useEffect(() => {
198
- let e = (e) => {
199
- e.key === "Escape" && l !== void 0 && l(!1);
200
- };
201
- return window.addEventListener("keydown", e), () => {
202
- window.removeEventListener("keydown", e);
203
- };
204
- }, [l]), /* @__PURE__ */ v("aside", {
205
- id: p,
206
- className: e(C.sidebar, s && C.sidebarCollapsed, o && C.sidebarOpened),
207
- children: [/* @__PURE__ */ v("div", {
208
- className: C.sidebarHeader,
209
- children: [!s && /* @__PURE__ */ _("p", {
210
- className: C.appName,
211
- children: a.name
212
- }), /* @__PURE__ */ _(i, {
213
- variant: "icon",
214
- "aria-label": s ? m.format("maximizeMenu") : m.format("minimizeMenu"),
215
- onPress: () => c(!s),
216
- className: C.collapseButton,
217
- children: _(s ? S : x, { size: 20 })
218
- })]
219
- }), /* @__PURE__ */ _("nav", {
220
- className: C.sidebarNav,
221
- "aria-label": m.format("sidebarMenu"),
222
- children: /* @__PURE__ */ _("ul", {
223
- className: C.list,
224
- children: n.map((e, t) => /* @__PURE__ */ v("li", { children: [e.title && !s && /* @__PURE__ */ _("p", {
225
- className: C.listGroupTitle,
226
- children: e.title
227
- }), /* @__PURE__ */ _(g, { group: e })] }, "list_" + t))
228
- })
229
- })]
230
- });
231
- }, A = () => {
232
- let { title: t, user: a, app: o, isOpened: s, setIsOpened: c, setIsCollapsed: l, headerChildren: d, variant: f, id: p } = E(), m = r(O);
233
- return f === "external" ? /* @__PURE__ */ _("header", {
234
- className: e(C.header, C.headerExternal),
235
- children: /* @__PURE__ */ v("div", {
236
- className: C.headerContentExternal,
237
- children: [/* @__PURE__ */ v("div", {
238
- className: C.logoExternalContainer,
239
- children: [
240
- /* @__PURE__ */ _(u, {
241
- size: "x-small",
242
- padding: !1,
243
- className: C.logoExternal
244
- }),
245
- /* @__PURE__ */ _(u, {
246
- size: "small",
247
- padding: !1,
248
- className: C.logoExternalDesktop
249
- }),
250
- /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("p", {
251
- className: C.userName,
252
- children: a.name
253
- }), /* @__PURE__ */ _("p", {
254
- className: C.userTitle,
255
- children: a.title
256
- })] })
257
- ]
258
- }), /* @__PURE__ */ _("div", {
259
- className: C.headerItems,
260
- children: d
261
- })]
262
- })
263
- }) : /* @__PURE__ */ v("header", {
264
- className: C.header,
265
- style: { borderTop: `solid 4px ${o.color ? o.color : y.brandPrimary}` },
266
- children: [/* @__PURE__ */ v("div", {
267
- className: C.headerContent,
268
- children: [
269
- /* @__PURE__ */ _("div", {
270
- className: C.logo,
271
- children: /* @__PURE__ */ _(u, {
272
- size: "small",
273
- padding: !1
274
- })
275
- }),
276
- s !== void 0 && /* @__PURE__ */ _(i, {
277
- variant: "icon",
278
- className: C.toggleButton,
279
- "aria-label": s ? m.format("closeMenu") : m.format("openMenu"),
280
- "aria-controls": p,
281
- onPressStart: () => {
282
- l(!1), c?.(!0);
283
- },
284
- children: _(s ? n : b, {
285
- size: 20,
286
- "aria-hidden": "true"
287
- })
288
- }),
289
- /* @__PURE__ */ v("div", { children: [
290
- /* @__PURE__ */ _("p", {
291
- className: C.userName,
292
- children: a.name
293
- }),
294
- /* @__PURE__ */ _("p", {
295
- className: C.userTitle,
296
- children: a.title
297
- }),
298
- /* @__PURE__ */ _("p", {
299
- className: C.title,
300
- children: t
301
- })
302
- ] })
303
- ]
304
- }), /* @__PURE__ */ _("div", {
305
- className: C.headerItems,
306
- children: d
307
- })]
308
- });
309
- }, j = ({ id: e = "main:first-of-type" }) => {
310
- let t = () => {
311
- let t = document.querySelector(e);
312
- t && (t.tabIndex = -1, t.focus(), setTimeout(() => t.removeAttribute("tabindex"), 1e3));
313
- }, n = r(O);
314
- return /* @__PURE__ */ _(i, {
315
- onPress: t,
316
- className: C.skipToContent,
317
- children: n.format("skipToContent")
318
- });
319
- }, M = () => {
320
- let { isOpened: t, setIsOpened: n } = E();
321
- return t ? /* @__PURE__ */ _("div", {
322
- className: e(C.backdrop, C.backdropOpened),
323
- onClick: () => {
324
- n?.(!1);
325
- },
326
- "aria-hidden": !0
327
- }) : null;
328
- }, N = () => {
329
- let { items: t, clientSideRouter: n, clientSideHref: i } = E(), a = r(O), o = t?.[0]?.items;
330
- return /* @__PURE__ */ _("nav", {
331
- className: C.navbar,
332
- "aria-label": a.format("bottomMenu"),
333
- children: o && /* @__PURE__ */ _("ul", {
334
- className: e(C.navbarList),
335
- children: n ? /* @__PURE__ */ _(h, {
336
- navigate: n,
337
- useHref: i,
338
- children: /* @__PURE__ */ _(P, { items: o })
339
- }) : /* @__PURE__ */ _(P, { items: o })
340
- })
341
- });
342
- }, P = ({ items: t }) => /* @__PURE__ */ _(g, { children: t.map(({ href: t, active: n, icon: r, title: i, hasBadge: s }, c) => /* @__PURE__ */ _("li", { children: /* @__PURE__ */ v(m, {
343
- href: t,
344
- className: e(C.navbarItem),
345
- "data-active": n,
346
- "aria-current": n && "page",
347
- children: [/* @__PURE__ */ v(o, { children: [/* @__PURE__ */ _(r, { size: 20 }), s && /* @__PURE__ */ _(a, {})] }), i]
348
- }) }, c)) }), F = ({ items: t, title: n, user: r, app: i, children: a, headerChildren: o, clientSideRouter: c, clientSideHref: l, variant: u, className: f, onSidebarLinkClick: p }) => {
349
- let [m, h] = d.useState(!1), [g, y] = d.useState(!1), b = d.useId();
350
- return u === "external" ? /* @__PURE__ */ _(F.Provider, {
351
- items: t,
352
- title: n,
353
- user: r,
354
- app: i,
355
- clientSideRouter: c,
356
- clientSideHref: l,
357
- headerChildren: o,
358
- isCollapsed: m,
359
- setIsCollapsed: h,
360
- variant: u,
361
- id: b,
362
- children: /* @__PURE__ */ v("div", {
363
- className: e(C.baseLayout, f),
364
- children: [
365
- /* @__PURE__ */ _(j, {}),
366
- /* @__PURE__ */ _(F.Header, {}),
367
- /* @__PURE__ */ v("div", {
368
- className: C.mainContent,
369
- children: [
370
- /* @__PURE__ */ _(F.Sidebar, { onLinkClick: p }),
371
- /* @__PURE__ */ _(s, { children: /* @__PURE__ */ _("main", {
372
- className: C.main,
373
- children: /* @__PURE__ */ _("div", {
374
- className: C.app,
375
- children: a
376
- })
377
- }) }),
378
- /* @__PURE__ */ _(F.Backdrop, {})
379
- ]
380
- }),
381
- /* @__PURE__ */ _("div", {
382
- className: C.navbarWrapper,
383
- children: /* @__PURE__ */ _(F.Navbar, {})
384
- })
385
- ]
386
- })
387
- }) : /* @__PURE__ */ _(F.Provider, {
388
- items: t,
389
- title: n,
390
- user: r,
391
- app: i,
392
- clientSideRouter: c,
393
- clientSideHref: l,
394
- headerChildren: o,
395
- isCollapsed: m,
396
- setIsCollapsed: h,
397
- isOpened: g,
398
- setIsOpened: y,
399
- variant: u,
400
- id: b,
401
- children: /* @__PURE__ */ v("div", {
402
- className: e(C.baseLayout, f),
403
- children: [
404
- /* @__PURE__ */ _(j, {}),
405
- /* @__PURE__ */ _(F.Header, {}),
406
- /* @__PURE__ */ v("div", {
407
- className: C.mainContent,
408
- children: [
409
- /* @__PURE__ */ _(F.Sidebar, { onLinkClick: p }),
410
- /* @__PURE__ */ _(s, { children: /* @__PURE__ */ _("main", {
411
- className: C.main,
412
- children: /* @__PURE__ */ _("div", {
413
- className: C.app,
414
- children: a
415
- })
416
- }) }),
417
- /* @__PURE__ */ _(F.Backdrop, {})
418
- ]
419
- })
420
- ]
421
- })
422
- });
423
- };
424
- F.Provider = T, F.Header = A, F.Sidebar = k, F.SidebarLink = D, F.Navbar = N, F.Backdrop = M;
425
- //#endregion
426
- export { D as a, k as i, N as n, A as r, F as t };