@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,110 +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 "./check-DV00NPU0.js";
5
- import { t as r } from "./useLocalizedStringFormatter-CeyBc0x0.js";
6
- import { n as i, t as a } from "./label-LWlgvAwz.js";
7
- import { t as o } from "./text-DwmZ-ew8.js";
8
- import { t as s } from "./field-error-LtNtEKDp.js";
9
- import { t as c } from "./splitDataAttributes-_JTFOOIb.js";
10
- import * as l from "react";
11
- import { forwardRef as u, useContext as d } from "react";
12
- import { CheckboxButton as f, CheckboxField as p, CheckboxGroup as m, CheckboxGroupStateContext as h, composeRenderProps as g } from "react-aria-components";
13
- import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
14
- import { variables as b } from "@midas-ds/theme";
15
- import '../assets/checkbox.css';var x = t("minus", [["path", {
16
- d: "M5 12h14",
17
- key: "1ays0h"
18
- }]]), S = {
19
- indicator: "_indicator_3jfn4_1",
20
- checkboxButton: "_checkboxButton_3jfn4_27",
21
- checkboxField: "_checkboxField_3jfn4_144",
22
- checkboxGroup: "_checkboxGroup_3jfn4_155",
23
- checkboxList: "_checkboxList_3jfn4_166"
24
- }, C = ({ className: t, ...n }) => /* @__PURE__ */ v(p, {
25
- className: e(S.checkboxField, t),
26
- ...n
27
- }), w = u(({ className: t, ...n }, r) => /* @__PURE__ */ v(f, {
28
- className: e(S.checkboxButton, t),
29
- ref: r,
30
- ...n
31
- })), T = u(({ className: e, description: t, errorMessage: r, errorPosition: i = "top", children: a, ...l }, u) => {
32
- let [d, f] = c(l);
33
- return /* @__PURE__ */ y(C, {
34
- ...f,
35
- children: [
36
- t && /* @__PURE__ */ v(o, {
37
- slot: "description",
38
- children: t
39
- }),
40
- i === "top" && /* @__PURE__ */ v(s, { children: r }),
41
- /* @__PURE__ */ v(w, {
42
- ...d,
43
- ref: u,
44
- className: e,
45
- children: ({ isIndeterminate: e }) => /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v("div", {
46
- className: S.indicator,
47
- children: v(e ? x : n, {
48
- size: 14,
49
- color: b.iconOnColor
50
- })
51
- }), a] })
52
- }),
53
- i === "bottom" && /* @__PURE__ */ v(s, { children: r })
54
- ]
55
- });
56
- });
57
- T.displayName = "Checkbox";
58
- //#endregion
59
- //#region src/checkbox/useSelectAll.ts
60
- var E = (e, t) => {
61
- let n = t?.value ?? [], r = l.Children.toArray(e).filter((e) => l.isValidElement(e) && e.type === T), i = r.filter((e) => !e.props.isDisabled).map((e) => e.props.value || ""), a = r.filter((e) => e.props.isDisabled).map((e) => e.props.value || "").filter((e) => n.includes(e)), o = n.filter((e) => i.includes(e)).length, s = o === 0, c = o === i.length;
62
- return {
63
- allSelected: c,
64
- someSelected: !s && !c,
65
- checkboxValues: i,
66
- disabledSelectedValues: a
67
- };
68
- }, D = {
69
- en: { selectAll: "Select all" },
70
- sv: { selectAll: "Välj alla" }
71
- }, O = ({ checkboxes: e, label: t }) => {
72
- let n = d(h), i = r(D), { allSelected: a, someSelected: o, checkboxValues: s, disabledSelectedValues: c } = E(e, n);
73
- return /* @__PURE__ */ v(h.Provider, {
74
- value: null,
75
- children: /* @__PURE__ */ v(T, {
76
- isSelected: a,
77
- isIndeterminate: o,
78
- isReadOnly: n?.isReadOnly,
79
- isDisabled: n?.isDisabled,
80
- onChange: (e) => {
81
- n?.setValue(e ? [...s, ...c] : c);
82
- },
83
- children: t || i.format("selectAll")
84
- })
85
- });
86
- }, k = ({ label: t, description: n, errorMessage: r, errorPosition: c = "top", popover: l, showSelectAll: u, selectAllLabel: d, className: f, children: p, ...h }) => /* @__PURE__ */ v(m, {
87
- ...h,
88
- className: e(S.checkboxGroup, f),
89
- children: g(p, (e) => /* @__PURE__ */ y(_, { children: [
90
- /* @__PURE__ */ v(i, {
91
- popover: l,
92
- children: t && /* @__PURE__ */ v(a, { children: t })
93
- }),
94
- n && /* @__PURE__ */ v(o, {
95
- slot: "description",
96
- children: n
97
- }),
98
- c === "top" && r && /* @__PURE__ */ v(s, { children: r }),
99
- /* @__PURE__ */ y("div", {
100
- className: S.checkboxList,
101
- children: [u && /* @__PURE__ */ v(O, {
102
- label: d,
103
- checkboxes: e
104
- }), e]
105
- }),
106
- c === "bottom" && r && /* @__PURE__ */ v(s, { children: r })
107
- ] }))
108
- });
109
- //#endregion
110
- export { C as i, T as n, w as r, k as t };
@@ -1,7 +0,0 @@
1
- import { t as e } from "./createLucideIcon-BgluSHFG.js";
2
- var t = e("chevron-down", [["path", {
3
- d: "m6 9 6 6 6-6",
4
- key: "qrunsl"
5
- }]]);
6
- //#endregion
7
- export { t };
@@ -1,7 +0,0 @@
1
- import { t as e } from "./createLucideIcon-BgluSHFG.js";
2
- var t = e("chevron-right", [["path", {
3
- d: "m9 18 6-6-6-6",
4
- key: "mthhwq"
5
- }]]);
6
- //#endregion
7
- export { t };
@@ -1,17 +0,0 @@
1
- 'use client';
2
- import { t as e } from "./x-BJAOO5a5.js";
3
- import { n as t } from "./button-CenXTGXL.js";
4
- import "react";
5
- import { jsx as n } from "react/jsx-runtime";
6
- //#region src/clear-button/ClearButton.tsx
7
- var r = (r) => /* @__PURE__ */ n(t, {
8
- variant: "icon",
9
- slot: null,
10
- ...r,
11
- children: /* @__PURE__ */ n(e, {
12
- size: 20,
13
- "aria-hidden": !0
14
- })
15
- });
16
- //#endregion
17
- export { r as t };
@@ -1,203 +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 "./chevron-down-CP7nEDei.js";
5
- import { t as r } from "./useLocalizedStringFormatter-CeyBc0x0.js";
6
- import { n as i } from "./button-CenXTGXL.js";
7
- import { t as a } from "./icons-UBHIX2oV.js";
8
- import { n as o, t as s } from "./toggle-button-CIvsOXQf.js";
9
- import { a as c, o as l, r as u } from "./menu-aT2IR0tO.js";
10
- import * as d from "react";
11
- import { useEffect as f, useState as p } from "react";
12
- import { MenuItem as m, SelectionIndicator as h } from "react-aria-components";
13
- import { jsx as g, jsxs as _ } from "react/jsx-runtime";
14
- import { VisuallyHidden as v } from "react-aria";
15
- import '../assets/color-scheme-switch.css';var y = t("moon", [["path", {
16
- d: "M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",
17
- key: "kfwtm"
18
- }]]), b = t("sun", [
19
- ["circle", {
20
- cx: "12",
21
- cy: "12",
22
- r: "4",
23
- key: "4exip2"
24
- }],
25
- ["path", {
26
- d: "M12 2v2",
27
- key: "tus03m"
28
- }],
29
- ["path", {
30
- d: "M12 20v2",
31
- key: "1lh1kg"
32
- }],
33
- ["path", {
34
- d: "m4.93 4.93 1.41 1.41",
35
- key: "149t6j"
36
- }],
37
- ["path", {
38
- d: "m17.66 17.66 1.41 1.41",
39
- key: "ptbguv"
40
- }],
41
- ["path", {
42
- d: "M2 12h2",
43
- key: "1t8f8n"
44
- }],
45
- ["path", {
46
- d: "M20 12h2",
47
- key: "1q8mjw"
48
- }],
49
- ["path", {
50
- d: "m6.34 17.66-1.41 1.41",
51
- key: "1m8zz5"
52
- }],
53
- ["path", {
54
- d: "m19.07 4.93-1.41 1.41",
55
- key: "1shlcs"
56
- }]
57
- ]), x = {
58
- button: "_button_1r8vq_1",
59
- selectionIndicator: "_selectionIndicator_1r8vq_14"
60
- }, S = {
61
- en: {
62
- colorScheme: "Color scheme",
63
- darkMode: "Dark mode",
64
- lightMode: "Light mode",
65
- system: "Follows system",
66
- triggerDarkMode: "Color scheme: Dark mode",
67
- triggerLightMode: "Color scheme: Light mode",
68
- triggerSystem: "Color scheme: Follows system"
69
- },
70
- sv: {
71
- colorScheme: "Färgschema",
72
- darkMode: "Mörkt läge",
73
- lightMode: "Ljust läge",
74
- system: "Följer systemet",
75
- triggerDarkMode: "Färgschema: Mörkt läge",
76
- triggerLightMode: "Färgschema: Ljust läge",
77
- triggerSystem: "Färgschema: Följer systemet"
78
- }
79
- }, C = ({ selector: e = ":root", defaultScheme: t = "light dark", scheme: n, onSchemeChange: r }) => {
80
- let [i, a] = p(n ?? t), o = n ?? i;
81
- return f(() => {
82
- let t = document.querySelector(e);
83
- if (!t) {
84
- console.warn(`No element found for selector: "${e}"`);
85
- return;
86
- }
87
- o === "light dark" ? delete t.dataset.colorScheme : t.dataset.colorScheme = o;
88
- }, [o, e]), {
89
- resolved: o,
90
- onChange: (e) => {
91
- a(e), r?.(e);
92
- }
93
- };
94
- }, w = ({ selector: e = ":root", defaultScheme: t = "light dark", scheme: n, onSchemeChange: i, defaultValue: c, className: l }) => {
95
- let { resolved: u, onChange: d } = C({
96
- selector: e,
97
- defaultScheme: c ? Array.from(c)[0] : t,
98
- scheme: n,
99
- onSchemeChange: i
100
- }), f = r(S);
101
- return /* @__PURE__ */ _(s, {
102
- selectionMode: "single",
103
- selectedKeys: /* @__PURE__ */ new Set([u]),
104
- onSelectionChange: (e) => {
105
- d(Array.from(e)[0]);
106
- },
107
- disallowEmptySelection: !0,
108
- "aria-label": f.format("colorScheme"),
109
- className: l,
110
- children: [
111
- /* @__PURE__ */ _(o, {
112
- id: "light",
113
- className: x.button,
114
- children: [
115
- /* @__PURE__ */ g(b, {}),
116
- /* @__PURE__ */ g(v, { children: f.format("lightMode") }),
117
- /* @__PURE__ */ g(h, { className: x.selectionIndicator })
118
- ]
119
- }),
120
- /* @__PURE__ */ _(o, {
121
- id: "dark",
122
- className: x.button,
123
- children: [
124
- /* @__PURE__ */ g(y, {}),
125
- /* @__PURE__ */ g(v, { children: f.format("darkMode") }),
126
- /* @__PURE__ */ g(h, { className: x.selectionIndicator })
127
- ]
128
- }),
129
- /* @__PURE__ */ _(o, {
130
- id: "light dark",
131
- className: x.button,
132
- children: [
133
- /* @__PURE__ */ g(a, {}),
134
- /* @__PURE__ */ g(v, { children: f.format("system") }),
135
- /* @__PURE__ */ g(h, { className: x.selectionIndicator })
136
- ]
137
- })
138
- ]
139
- });
140
- }, T = {
141
- trigger: "_trigger_y8ah9_1",
142
- chevron: "_chevron_y8ah9_6",
143
- menu: "_menu_y8ah9_17",
144
- menuItem: "_menuItem_y8ah9_21"
145
- }, E = {
146
- light: b,
147
- "light dark": a,
148
- dark: y
149
- }, D = (e) => e === "light" ? "triggerLightMode" : e === "dark" ? "triggerDarkMode" : "triggerSystem", O = ({ selector: t = ":root", defaultScheme: o = "light dark", scheme: s, onSchemeChange: f, className: p }) => {
150
- let { resolved: h, onChange: x } = C({
151
- selector: t,
152
- defaultScheme: o,
153
- scheme: s,
154
- onSchemeChange: f
155
- }), w = E[h];
156
- d.useEffect(() => {
157
- let e = document.querySelector(t);
158
- if (!e) {
159
- console.warn(`No element found for selector: "${t}"`);
160
- return;
161
- }
162
- h === "light dark" ? delete e.dataset.colorScheme : e.dataset.colorScheme = h;
163
- }, [h, t]);
164
- let O = r(S);
165
- return /* @__PURE__ */ _(l, { children: [/* @__PURE__ */ _(i, {
166
- variant: "icon",
167
- size: "medium",
168
- className: e(T.trigger, p),
169
- "aria-label": O.format(D(h)),
170
- children: [/* @__PURE__ */ g(w, { size: 20 }), /* @__PURE__ */ g(n, {
171
- size: 20,
172
- className: T.chevron
173
- })]
174
- }), /* @__PURE__ */ g(u, {
175
- placement: "bottom start",
176
- children: /* @__PURE__ */ _(c, {
177
- onAction: (e) => x(e),
178
- className: T.menu,
179
- children: [
180
- /* @__PURE__ */ _(m, {
181
- id: "light",
182
- textValue: O.format("lightMode"),
183
- className: T.menuItem,
184
- children: [/* @__PURE__ */ g(b, { size: 20 }), /* @__PURE__ */ g(v, { children: O.format("lightMode") })]
185
- }),
186
- /* @__PURE__ */ _(m, {
187
- id: "dark",
188
- textValue: O.format("darkMode"),
189
- className: T.menuItem,
190
- children: [/* @__PURE__ */ g(y, { size: 20 }), /* @__PURE__ */ g(v, { children: O.format("darkMode") })]
191
- }),
192
- /* @__PURE__ */ _(m, {
193
- id: "light dark",
194
- textValue: O.format("system"),
195
- className: T.menuItem,
196
- children: [/* @__PURE__ */ g(a, { size: 20 }), /* @__PURE__ */ g(v, { children: O.format("system") })]
197
- })
198
- ]
199
- })
200
- })] });
201
- };
202
- //#endregion
203
- export { w as n, O as t };
@@ -1,39 +0,0 @@
1
- import { createElement as e, forwardRef as t } from "react";
2
- //#region ../../node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.js
3
- var n = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), r = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), i = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), a = (e) => {
4
- let t = i(e);
5
- return t.charAt(0).toUpperCase() + t.slice(1);
6
- }, o = {
7
- xmlns: "http://www.w3.org/2000/svg",
8
- width: 24,
9
- height: 24,
10
- viewBox: "0 0 24 24",
11
- fill: "none",
12
- stroke: "currentColor",
13
- strokeWidth: 2,
14
- strokeLinecap: "round",
15
- strokeLinejoin: "round"
16
- }, s = (e) => {
17
- for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
18
- return !1;
19
- }, c = t(({ color: t = "currentColor", size: r = 24, strokeWidth: i = 2, absoluteStrokeWidth: a, className: c = "", children: l, iconNode: u, ...d }, f) => e("svg", {
20
- ref: f,
21
- ...o,
22
- width: r,
23
- height: r,
24
- stroke: t,
25
- strokeWidth: a ? Number(i) * 24 / Number(r) : i,
26
- className: n("lucide", c),
27
- ...!l && !s(d) && { "aria-hidden": "true" },
28
- ...d
29
- }, [...u.map(([t, n]) => e(t, n)), ...Array.isArray(l) ? l : [l]])), l = (i, o) => {
30
- let s = t(({ className: t, ...s }, l) => e(c, {
31
- ref: l,
32
- iconNode: o,
33
- className: n(`lucide-${r(a(i))}`, `lucide-${i}`, t),
34
- ...s
35
- }));
36
- return s.displayName = a(i), s;
37
- };
38
- //#endregion
39
- export { l as t };
@@ -1,187 +0,0 @@
1
- 'use client';
2
- import { n as e } from "./clsx-Di52oYUU.js";
3
- import { t } from "./createLucideIcon-BgluSHFG.js";
4
- import { n, t as r } from "./calendar-Bl_obez5.js";
5
- import { t as i } from "./useLocalizedStringFormatter-CeyBc0x0.js";
6
- import { n as a } from "./button-CenXTGXL.js";
7
- import { n as o, t as s } from "./label-LWlgvAwz.js";
8
- import { t as c } from "./text-DwmZ-ew8.js";
9
- import { t as l } from "./field-error-LtNtEKDp.js";
10
- import { t as u } from "./clear-button-D3I1X3yG.js";
11
- import { n as d, r as f, t as p } from "./date-field-BF2f9bSf.js";
12
- import * as m from "react";
13
- import { DatePicker as h, DatePickerStateContext as g, DateRangePicker as _, DateRangePickerStateContext as v, Group as y, Popover as b } from "react-aria-components";
14
- import { jsx as x, jsxs as S } from "react/jsx-runtime";
15
- import { FocusScope as C, useFocusManager as w } from "react-aria";
16
- import '../assets/date-picker.css';var T = t("calendar-days", [
17
- ["path", {
18
- d: "M8 2v4",
19
- key: "1cmpym"
20
- }],
21
- ["path", {
22
- d: "M16 2v4",
23
- key: "4m81vk"
24
- }],
25
- ["rect", {
26
- width: "18",
27
- height: "18",
28
- x: "3",
29
- y: "4",
30
- rx: "2",
31
- key: "1hopcy"
32
- }],
33
- ["path", {
34
- d: "M3 10h18",
35
- key: "8toen8"
36
- }],
37
- ["path", {
38
- d: "M8 14h.01",
39
- key: "6423bh"
40
- }],
41
- ["path", {
42
- d: "M12 14h.01",
43
- key: "1etili"
44
- }],
45
- ["path", {
46
- d: "M16 14h.01",
47
- key: "1gbofw"
48
- }],
49
- ["path", {
50
- d: "M8 18h.01",
51
- key: "lrp35t"
52
- }],
53
- ["path", {
54
- d: "M12 18h.01",
55
- key: "mhygvu"
56
- }],
57
- ["path", {
58
- d: "M16 18h.01",
59
- key: "kzsmim"
60
- }]
61
- ]), E = {
62
- en: {
63
- clear: "Clear date",
64
- "open-calendar": "Open calendar"
65
- },
66
- sv: {
67
- clear: "Rensa datum",
68
- "open-calendar": "Öppna kalender"
69
- }
70
- }, D = {
71
- datePicker: "_datePicker_14wog_1",
72
- inputField: "_inputField_14wog_8",
73
- medium: "_medium_14wog_24",
74
- readOnly: "_readOnly_14wog_47",
75
- buttonGroup: "_buttonGroup_14wog_52",
76
- iconButton: "_iconButton_14wog_58",
77
- popover: "_popover_14wog_81 _dropdownAnimation_1ljkv_4"
78
- }, O = (e) => !!e && !!e.value && Object.prototype.hasOwnProperty.call(e.value, "start"), k = ({ isClearable: t, isDisabled: n, isReadOnly: r, size: a }) => {
79
- let o = m.useContext(g), s = m.useContext(v), c = i(E), l = w(), d = s ?? o, f = O(d) ? !!d.value.start && d.value.end : !!d?.value;
80
- return t && f && !r ? /* @__PURE__ */ x(u, {
81
- onPress: () => {
82
- d?.setValue(null), l?.focusFirst();
83
- },
84
- size: a,
85
- isDisabled: n,
86
- "aria-label": c.format("clear"),
87
- className: e(D.iconButton, { [D.medium]: a === "medium" })
88
- }) : null;
89
- }, A = ({ children: t, isDisabled: n, isInvalid: r, isReadOnly: o, size: s = "large", isClearable: c = !1 }) => {
90
- let l = i(E);
91
- return /* @__PURE__ */ x(y, {
92
- className: e(D.inputField, {
93
- [D.medium]: s === "medium",
94
- [D.readOnly]: o
95
- }),
96
- children: /* @__PURE__ */ S(C, { children: [t, /* @__PURE__ */ S("div", {
97
- className: D.buttonGroup,
98
- children: [/* @__PURE__ */ x(k, {
99
- isClearable: c,
100
- isDisabled: n,
101
- isReadOnly: o,
102
- size: s
103
- }), /* @__PURE__ */ x(a, {
104
- variant: "icon",
105
- "aria-label": l.format("open-calendar"),
106
- className: e(D.iconButton, {
107
- [D.medium]: s === "medium",
108
- [D.readOnly]: o
109
- }),
110
- "data-invalid": r || void 0,
111
- size: s,
112
- children: /* @__PURE__ */ x(T, {
113
- "aria-hidden": !0,
114
- size: 20
115
- })
116
- })]
117
- })] })
118
- });
119
- }, j = ({ children: e }) => /* @__PURE__ */ x(b, {
120
- className: D.popover,
121
- children: e
122
- }), M = m.forwardRef(({ className: t, description: r, errorMessage: i, errorPosition: a = "top", label: u, popover: p, isClearable: m = !1, isReadOnly: g, isDisabled: _, size: v, ...y }, b) => /* @__PURE__ */ S(h, {
123
- className: e(D.datePicker, t),
124
- isReadOnly: g,
125
- isDisabled: _,
126
- ref: b,
127
- ...y,
128
- children: [
129
- /* @__PURE__ */ x(o, {
130
- popover: p,
131
- children: u && /* @__PURE__ */ x(s, { children: u })
132
- }),
133
- r && /* @__PURE__ */ x(c, {
134
- slot: "description",
135
- children: r
136
- }),
137
- a === "top" && /* @__PURE__ */ x(l, { children: i }),
138
- /* @__PURE__ */ x(A, {
139
- isClearable: m,
140
- isReadOnly: g,
141
- isDisabled: _,
142
- size: v,
143
- ...y,
144
- children: /* @__PURE__ */ x(d, { children: (e) => /* @__PURE__ */ x(f, { segment: e }) })
145
- }),
146
- a === "bottom" && /* @__PURE__ */ x(l, { children: i }),
147
- /* @__PURE__ */ x(j, { children: /* @__PURE__ */ x(n, {}) })
148
- ]
149
- })), N = ({ className: t, description: n, errorMessage: i, errorPosition: a = "top", label: u, popover: m, isClearable: h = !1, isReadOnly: g, isDisabled: v, size: y, ...b }) => /* @__PURE__ */ S(_, {
150
- className: e(D.datePicker, t),
151
- isReadOnly: g,
152
- isDisabled: v,
153
- ...b,
154
- children: [
155
- /* @__PURE__ */ x(o, {
156
- popover: m,
157
- children: u && /* @__PURE__ */ x(s, { children: u })
158
- }),
159
- n && /* @__PURE__ */ x(c, {
160
- slot: "description",
161
- children: n
162
- }),
163
- a === "top" && /* @__PURE__ */ x(l, { children: i }),
164
- /* @__PURE__ */ S(A, {
165
- isClearable: h,
166
- isReadOnly: g,
167
- isDisabled: v,
168
- size: y,
169
- ...b,
170
- children: [
171
- /* @__PURE__ */ x(d, {
172
- slot: "start",
173
- children: (e) => /* @__PURE__ */ x(f, { segment: e })
174
- }),
175
- /* @__PURE__ */ x(p, {}),
176
- /* @__PURE__ */ x(d, {
177
- slot: "end",
178
- children: (e) => /* @__PURE__ */ x(f, { segment: e })
179
- })
180
- ]
181
- }),
182
- a === "bottom" && /* @__PURE__ */ x(l, { children: i }),
183
- /* @__PURE__ */ x(j, { children: /* @__PURE__ */ x(r, {}) })
184
- ]
185
- });
186
- //#endregion
187
- export { M as n, N as t };