@midas-ds/components 17.8.2 → 17.9.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 (97) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/accordion/index.js +1 -1
  3. package/assets/Button.css +1 -1
  4. package/assets/Checkbox.css +1 -1
  5. package/assets/ComboBox.css +1 -1
  6. package/assets/DateRangePicker.css +1 -1
  7. package/assets/Dialog.css +1 -1
  8. package/assets/InfoBanner.css +1 -1
  9. package/assets/Label.css +1 -1
  10. package/assets/Link.css +1 -1
  11. package/assets/LinkButton.css +1 -1
  12. package/assets/ListBox.css +1 -1
  13. package/assets/Popover.css +1 -1
  14. package/assets/ProgressBar.css +1 -1
  15. package/assets/Radio.css +1 -1
  16. package/assets/SearchField.css +1 -1
  17. package/assets/Select.css +1 -1
  18. package/assets/Separator.css +1 -1
  19. package/assets/Skeleton.css +1 -1
  20. package/assets/Table.css +1 -1
  21. package/assets/Toast.css +1 -1
  22. package/assets/Tooltip.css +1 -1
  23. package/assets/default.css +1 -1
  24. package/button/index.js +1 -1
  25. package/calendar/index.js +1 -1
  26. package/checkbox/index.js +2 -2
  27. package/chunks/{AccordionItem-w6c28fSu.js → AccordionItem-DHhQDd6o.js} +1 -1
  28. package/chunks/{Button-D22xOe8j.js → Button-GCROAMSl.js} +1 -1
  29. package/chunks/Button.module-byTN5rhp.js +14 -0
  30. package/chunks/{Checkbox-sAkQe7Q9.js → Checkbox-DSW-_Qpm.js} +28 -28
  31. package/chunks/{CheckboxGroup-DY8sC9ro.js → CheckboxGroup-DteJIgnR.js} +2 -2
  32. package/chunks/{ClearButton-DfwjeVYh.js → ClearButton-DkC8PIMi.js} +1 -1
  33. package/chunks/{ColorSchemeSwitch-D52V0sr3.js → ColorSchemeSwitch-gD9pFu9h.js} +1 -1
  34. package/chunks/{ComboBox-BGMkkxN2.js → ComboBox-BEUfJ6IN.js} +29 -29
  35. package/chunks/{DateField-kEqIc-Nc.js → DateField-Bwis4G2o.js} +2 -2
  36. package/chunks/DateRangePicker-5E41DzGI.js +198 -0
  37. package/chunks/{Dialog-SBj6IJAF.js → Dialog-BSWBlyJI.js} +16 -16
  38. package/chunks/InfoBanner-CWLvkP6D.js +76 -0
  39. package/chunks/{Label-BNQY5OnB.js → Label-Cg0aAlnt.js} +7 -7
  40. package/chunks/{Layout-fkaVQ6a0.js → Layout-BLP0HVR-.js} +2 -2
  41. package/chunks/Link-CyY3-8M8.js +59 -0
  42. package/chunks/{LinkButton-DJ-D5PkB.js → LinkButton-DWKAbxXF.js} +28 -28
  43. package/chunks/{ListBox-BmONCo_D.js → ListBox-CRtyHPj1.js} +19 -19
  44. package/chunks/{ListBoxEmptyState-7VzB4KvQ.js → ListBoxEmptyState-D6Jvy1WT.js} +1 -1
  45. package/chunks/{ListBoxHeader-D_WqTfOS.js → ListBoxHeader-DIxY1gOH.js} +1 -1
  46. package/chunks/{Popover-6cnHxDEK.js → Popover-CjEPHe4A.js} +7 -7
  47. package/chunks/ProgressBar-CBz_dIOH.js +53 -0
  48. package/chunks/Radio-CRHdSthr.js +44 -0
  49. package/chunks/{RangeCalendar-_g_BVyUN.js → RangeCalendar-DL6cCjH3.js} +1 -1
  50. package/chunks/SearchField-VIMb28RB.js +118 -0
  51. package/chunks/{Select-DJ_VE1E4.js → Select-C01v_D--.js} +57 -57
  52. package/chunks/Separator-CDRwpeHz.js +76 -0
  53. package/chunks/{Skeleton-D6mxKxuu.js → Skeleton-tiP1Syzf.js} +20 -20
  54. package/chunks/{Table-Bg-AKi7d.js → Table-BpVSZ3aM.js} +48 -48
  55. package/chunks/{TagGroup-YCiXkdo3.js → TagGroup-DPFh8qHR.js} +1 -1
  56. package/chunks/{TextArea-Z4BKGpA9.js → TextArea-C7l7_Kof.js} +2 -2
  57. package/chunks/Toast-BFq_0Ue4.js +158 -0
  58. package/chunks/{ToggleButtonGroup-Bv9xpwTT.js → ToggleButtonGroup-DRnEEi5-.js} +1 -1
  59. package/chunks/{Tooltip-C1bbgr2l.js → Tooltip-BYEaNkZG.js} +11 -11
  60. package/clear-button/index.js +1 -1
  61. package/color-scheme-switch/index.js +1 -1
  62. package/combobox/index.js +1 -1
  63. package/date-field/index.js +1 -1
  64. package/date-picker/index.js +1 -1
  65. package/index.js +32 -32
  66. package/info-banner/index.js +1 -1
  67. package/label/index.js +1 -1
  68. package/layout/index.js +1 -1
  69. package/link/index.js +1 -1
  70. package/link-button/index.js +1 -1
  71. package/list-box/index.js +3 -3
  72. package/menu/index.js +1 -1
  73. package/modal/index.js +1 -1
  74. package/package.json +2 -2
  75. package/popover/index.js +1 -1
  76. package/progress-bar/index.js +1 -1
  77. package/radio/index.js +1 -1
  78. package/search-field/SearchField.d.ts +22 -4
  79. package/search-field/SearchField.stories.d.ts +10 -1
  80. package/search-field/index.js +1 -1
  81. package/select/index.js +1 -1
  82. package/skeleton/index.js +1 -1
  83. package/table/index.js +1 -1
  84. package/tag/index.js +1 -1
  85. package/textfield/index.js +1 -1
  86. package/toast/index.js +1 -1
  87. package/toggle-button/index.js +1 -1
  88. package/tooltip/index.js +1 -1
  89. package/chunks/Button.module-BW0TvYZ2.js +0 -14
  90. package/chunks/DateRangePicker-B7d3F0qi.js +0 -197
  91. package/chunks/InfoBanner-BIDGEIpk.js +0 -76
  92. package/chunks/Link-rqGQvFQq.js +0 -59
  93. package/chunks/ProgressBar-BIfkrfrH.js +0 -53
  94. package/chunks/Radio-D-sGYrD6.js +0 -44
  95. package/chunks/SearchField-D2Mm_VUO.js +0 -128
  96. package/chunks/Separator-CkVOLF6I.js +0 -76
  97. package/chunks/Toast-D8euCY5O.js +0 -158
@@ -1,197 +0,0 @@
1
- 'use client';
2
- import { jsx as e, jsxs as h } from "react/jsx-runtime";
3
- import { Group as B, DatePickerStateContext as M, DateRangePickerStateContext as S, Popover as N, Dialog as R, DatePicker as G, DateRangePicker as L } from "react-aria-components";
4
- import { a as k } from "./clsx-AexbMWKp.js";
5
- import { C as I, R as O } from "./RangeCalendar-_g_BVyUN.js";
6
- import { D as P, b as _, a as V } from "./DateInputDivider-DwopMIb9.js";
7
- import { F as g } from "./FieldError-krpMBtie.js";
8
- import { a as y, L as v } from "./Label-BNQY5OnB.js";
9
- import { T as D } from "./Text-D0r_W4lH.js";
10
- import * as f from "react";
11
- import { C as j } from "./ClearButton-DfwjeVYh.js";
12
- import { FocusScope as w, useFocusManager as T } from "@react-aria/focus";
13
- import { B as $ } from "./Button-D22xOe8j.js";
14
- import { c as E } from "./createLucideIcon-CP-mMPfa.js";
15
- import { u as b } from "./useLocalizedStringFormatter-BHvsRxDk.js";
16
- import '../assets/DateRangePicker.css';const W = [
17
- ["path", { d: "M8 2v4", key: "1cmpym" }],
18
- ["path", { d: "M16 2v4", key: "4m81vk" }],
19
- ["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
20
- ["path", { d: "M3 10h18", key: "8toen8" }],
21
- ["path", { d: "M8 14h.01", key: "6423bh" }],
22
- ["path", { d: "M12 14h.01", key: "1etili" }],
23
- ["path", { d: "M16 14h.01", key: "1gbofw" }],
24
- ["path", { d: "M8 18h.01", key: "lrp35t" }],
25
- ["path", { d: "M12 18h.01", key: "mhygvu" }],
26
- ["path", { d: "M16 18h.01", key: "kzsmim" }]
27
- ], q = E("calendar-days", W), A = { clear: "Clear date", "open-calendar": "Open calendar" }, H = { clear: "Rensa datum", "open-calendar": "Öppna kalender" }, C = {
28
- en: A,
29
- sv: H
30
- }, J = "_datePicker_1g3e7_1", K = "_inputField_1g3e7_8", Q = "_medium_1g3e7_24", U = "_readOnly_1g3e7_47", X = "_buttonGroup_1g3e7_52", Y = "_iconButton_1g3e7_58", Z = "_dialog_1g3e7_81", n = {
31
- datePicker: J,
32
- inputField: K,
33
- medium: Q,
34
- readOnly: U,
35
- buttonGroup: X,
36
- iconButton: Y,
37
- dialog: Z
38
- }, z = (t) => !!t && !!t.value && Object.prototype.hasOwnProperty.call(t.value, "start"), ee = ({
39
- isClearable: t,
40
- isDisabled: c,
41
- isReadOnly: i,
42
- size: a
43
- }) => {
44
- const r = f.useContext(M), s = f.useContext(S), l = b(C), d = T(), o = s ?? r, p = z(o) ? !!o.value.start && o.value.end : !!o?.value;
45
- return t && p && !i ? /* @__PURE__ */ e(
46
- j,
47
- {
48
- onPress: () => {
49
- o?.setValue(null), d?.focusFirst();
50
- },
51
- size: a,
52
- isDisabled: c,
53
- "aria-label": l.format("clear"),
54
- className: k(n.iconButton, {
55
- [n.medium]: a === "medium"
56
- })
57
- }
58
- ) : null;
59
- }, x = ({
60
- children: t,
61
- isDisabled: c,
62
- isInvalid: i,
63
- isReadOnly: a,
64
- size: r = "large",
65
- isClearable: s = !1
66
- }) => {
67
- const l = b(C);
68
- return /* @__PURE__ */ e(
69
- B,
70
- {
71
- className: k(n.inputField, {
72
- [n.medium]: r === "medium",
73
- [n.readOnly]: a
74
- }),
75
- children: /* @__PURE__ */ h(w, { children: [
76
- t,
77
- /* @__PURE__ */ h("div", { className: n.buttonGroup, children: [
78
- /* @__PURE__ */ e(
79
- ee,
80
- {
81
- isClearable: s,
82
- isDisabled: c,
83
- isReadOnly: a,
84
- size: r
85
- }
86
- ),
87
- /* @__PURE__ */ e(
88
- $,
89
- {
90
- variant: "icon",
91
- "aria-label": l.format("open-calendar"),
92
- className: k(n.iconButton, {
93
- [n.medium]: r === "medium",
94
- [n.readOnly]: a
95
- }),
96
- "data-invalid": i || void 0,
97
- size: r,
98
- children: /* @__PURE__ */ e(
99
- q,
100
- {
101
- "aria-hidden": !0,
102
- size: 20
103
- }
104
- )
105
- }
106
- )
107
- ] })
108
- ] })
109
- }
110
- );
111
- }, F = ({
112
- children: t
113
- }) => /* @__PURE__ */ e(N, { children: /* @__PURE__ */ e(R, { className: n.dialog, children: t }) }), he = ({
114
- className: t,
115
- description: c,
116
- errorMessage: i,
117
- errorPosition: a = "top",
118
- label: r,
119
- popover: s,
120
- isClearable: l = !1,
121
- isReadOnly: d,
122
- isDisabled: o,
123
- size: p,
124
- ...m
125
- }) => /* @__PURE__ */ h(
126
- G,
127
- {
128
- className: k(n.datePicker, t),
129
- isReadOnly: d,
130
- isDisabled: o,
131
- ...m,
132
- children: [
133
- /* @__PURE__ */ e(y, { popover: s, children: r && /* @__PURE__ */ e(v, { children: r }) }),
134
- c && /* @__PURE__ */ e(D, { slot: "description", children: c }),
135
- a === "top" && /* @__PURE__ */ e(g, { children: i }),
136
- /* @__PURE__ */ e(
137
- x,
138
- {
139
- isClearable: l,
140
- isReadOnly: d,
141
- isDisabled: o,
142
- size: p,
143
- ...m,
144
- children: /* @__PURE__ */ e(P, { children: (u) => /* @__PURE__ */ e(_, { segment: u }) })
145
- }
146
- ),
147
- a === "bottom" && /* @__PURE__ */ e(g, { children: i }),
148
- /* @__PURE__ */ e(F, { children: /* @__PURE__ */ e(I, {}) })
149
- ]
150
- }
151
- ), ke = ({
152
- className: t,
153
- description: c,
154
- errorMessage: i,
155
- errorPosition: a = "top",
156
- label: r,
157
- popover: s,
158
- isClearable: l = !1,
159
- isReadOnly: d,
160
- isDisabled: o,
161
- size: p,
162
- ...m
163
- }) => /* @__PURE__ */ h(
164
- L,
165
- {
166
- className: k(n.datePicker, t),
167
- isReadOnly: d,
168
- isDisabled: o,
169
- ...m,
170
- children: [
171
- /* @__PURE__ */ e(y, { popover: s, children: r && /* @__PURE__ */ e(v, { children: r }) }),
172
- c && /* @__PURE__ */ e(D, { slot: "description", children: c }),
173
- a === "top" && /* @__PURE__ */ e(g, { children: i }),
174
- /* @__PURE__ */ h(
175
- x,
176
- {
177
- isClearable: l,
178
- isReadOnly: d,
179
- isDisabled: o,
180
- size: p,
181
- ...m,
182
- children: [
183
- /* @__PURE__ */ e(P, { slot: "start", children: (u) => /* @__PURE__ */ e(_, { segment: u }) }),
184
- /* @__PURE__ */ e(V, {}),
185
- /* @__PURE__ */ e(P, { slot: "end", children: (u) => /* @__PURE__ */ e(_, { segment: u }) })
186
- ]
187
- }
188
- ),
189
- a === "bottom" && /* @__PURE__ */ e(g, { children: i }),
190
- /* @__PURE__ */ e(F, { children: /* @__PURE__ */ e(O, {}) })
191
- ]
192
- }
193
- );
194
- export {
195
- he as D,
196
- ke as a
197
- };
@@ -1,76 +0,0 @@
1
- import { jsxs as i, jsx as s } from "react/jsx-runtime";
2
- import { c as g } from "./clsx-AexbMWKp.js";
3
- import { B as h } from "./Button-D22xOe8j.js";
4
- import { F as k } from "./FeedbackStatusIcon-X9Bjgeta.js";
5
- import { useControlledState as x } from "@react-stately/utils";
6
- import { X as B } from "./x-B9bYxG31.js";
7
- import { u as N } from "./useLocalizedStringFormatter-BHvsRxDk.js";
8
- import '../assets/InfoBanner.css';const b = "_infoBanner_8niki_1", v = "_success_8niki_11", I = "_info_8niki_1", S = "_important_8niki_21", w = "_warning_8niki_26", C = "_content_8niki_40", F = "_heading_8niki_46", O = "_text_8niki_51", j = "_icon_8niki_66", z = "_dismissable_8niki_75", n = {
9
- infoBanner: b,
10
- success: v,
11
- info: I,
12
- important: S,
13
- warning: w,
14
- content: C,
15
- heading: F,
16
- text: O,
17
- icon: j,
18
- dismissable: z
19
- }, L = { close: "Close" }, P = { close: "Stäng" }, X = {
20
- en: L,
21
- sv: P
22
- }, J = ({
23
- title: e,
24
- message: a,
25
- type: o,
26
- children: c,
27
- isDismissable: r = !1,
28
- defaultOpen: l = !0,
29
- isOpen: m,
30
- onOpenChange: _,
31
- ...t
32
- }) => {
33
- const [d, f] = x(
34
- m,
35
- l,
36
- _
37
- ), u = N(X), p = () => {
38
- f(!1);
39
- };
40
- return d ? /* @__PURE__ */ i(
41
- "aside",
42
- {
43
- ...t,
44
- className: g(n.infoBanner, n[o], t.className),
45
- children: [
46
- /* @__PURE__ */ s(
47
- k,
48
- {
49
- "aria-hidden": !0,
50
- className: n.icon,
51
- status: o
52
- }
53
- ),
54
- /* @__PURE__ */ i("div", { className: n.content, children: [
55
- e && /* @__PURE__ */ s("strong", { className: n.heading, children: e }),
56
- /* @__PURE__ */ i("div", { className: n.text, children: [
57
- a,
58
- c
59
- ] })
60
- ] }),
61
- r && /* @__PURE__ */ s("div", { className: n.dismissable, children: /* @__PURE__ */ s(
62
- h,
63
- {
64
- variant: "icon",
65
- "aria-label": u.format("close"),
66
- onPress: p,
67
- children: /* @__PURE__ */ s(B, { size: 20 })
68
- }
69
- ) })
70
- ]
71
- }
72
- ) : null;
73
- };
74
- export {
75
- J as I
76
- };
@@ -1,59 +0,0 @@
1
- 'use client';
2
- import { jsx as r, jsxs as u, Fragment as f } from "react/jsx-runtime";
3
- import { Link as p } from "react-aria-components";
4
- import { c as h } from "./clsx-AexbMWKp.js";
5
- import { c as k } from "./createLucideIcon-CP-mMPfa.js";
6
- import { S as g } from "./square-arrow-out-up-right-x_I6wdNi.js";
7
- import { A as w } from "./arrow-right-BVcFGZmy.js";
8
- import '../assets/Link.css';const L = [
9
- ["path", { d: "M12 17V3", key: "1cwfxf" }],
10
- ["path", { d: "m6 11 6 6 6-6", key: "12ii2o" }],
11
- ["path", { d: "M19 21H5", key: "150jfl" }]
12
- ], x = k("arrow-down-to-line", L), v = "_link_u43gv_1", y = "_icon_u43gv_51", A = "_standalone_u43gv_55", j = "_stretched_u43gv_72", o = {
13
- link: v,
14
- icon: y,
15
- standalone: A,
16
- stretched: j
17
- }, C = ({
18
- children: t,
19
- standalone: n,
20
- target: e,
21
- stretched: s,
22
- download: a,
23
- icon: c,
24
- className: l,
25
- as: m,
26
- ...d
27
- }) => {
28
- const _ = m || p, i = c || (a ? x : e === "_blank" ? g : n ? w : null);
29
- return /* @__PURE__ */ r(
30
- _,
31
- {
32
- className: h(
33
- o.link,
34
- n && o.standalone,
35
- s && o.stretched,
36
- l
37
- ),
38
- ...d,
39
- target: e,
40
- children: /* @__PURE__ */ u(f, { children: [
41
- t,
42
- i ? /* @__PURE__ */ r(
43
- I,
44
- {
45
- className: o.icon,
46
- icon: i,
47
- size: 16
48
- }
49
- ) : null
50
- ] })
51
- }
52
- );
53
- }, I = ({
54
- icon: t,
55
- ...n
56
- }) => /* @__PURE__ */ r(t, { ...n });
57
- export {
58
- C as L
59
- };
@@ -1,53 +0,0 @@
1
- import { jsx as s, jsxs as d, Fragment as _ } from "react/jsx-runtime";
2
- import { ProgressBar as f } from "react-aria-components";
3
- import { L as t } from "./Label-BNQY5OnB.js";
4
- import { c as l } from "./clsx-AexbMWKp.js";
5
- import '../assets/ProgressBar.css';const N = "_progressBar_1a2ad_1", g = "_label_1a2ad_9", p = "_value_1a2ad_14", v = "_bar_1a2ad_19", h = "_fill_1a2ad_29", e = {
6
- progressBar: N,
7
- label: g,
8
- value: p,
9
- bar: v,
10
- fill: h
11
- }, b = ({
12
- label: r,
13
- labelProps: a,
14
- showValueLabel: m = !1,
15
- ...c
16
- }) => /* @__PURE__ */ s(
17
- f,
18
- {
19
- ...c,
20
- className: l(e.progressBar, c.className),
21
- children: ({ percentage: i, valueText: n, isIndeterminate: o }) => /* @__PURE__ */ d(_, { children: [
22
- r && /* @__PURE__ */ s(
23
- t,
24
- {
25
- elementType: "span",
26
- ...a,
27
- className: l(a?.className, e.label),
28
- children: r
29
- }
30
- ),
31
- m && /* @__PURE__ */ s(
32
- t,
33
- {
34
- elementType: "span",
35
- ...a,
36
- id: r ? "" : a?.id,
37
- className: l(a?.className, e.value),
38
- children: n
39
- }
40
- ),
41
- /* @__PURE__ */ s("div", { className: e.bar, children: /* @__PURE__ */ s(
42
- "div",
43
- {
44
- className: e.fill,
45
- style: { width: `${o ? 50 : i}%` }
46
- }
47
- ) })
48
- ] })
49
- }
50
- );
51
- export {
52
- b as P
53
- };
@@ -1,44 +0,0 @@
1
- 'use client';
2
- import { jsx as r, jsxs as u, Fragment as _ } from "react/jsx-runtime";
3
- import { Radio as f, RadioGroup as h, composeRenderProps as G, Group as R } from "react-aria-components";
4
- import { c as p } from "./clsx-AexbMWKp.js";
5
- import { a as x, L as w } from "./Label-BNQY5OnB.js";
6
- import { T as z } from "./Text-D0r_W4lH.js";
7
- import { F as t } from "./FieldError-krpMBtie.js";
8
- import '../assets/Radio.css';const E = "_radioGroup_1ls9z_1", F = "_wrap_1ls9z_12", L = "_radio_1ls9z_1", s = {
9
- radioGroup: E,
10
- wrap: F,
11
- radio: L
12
- }, W = ({
13
- label: o,
14
- description: a,
15
- errorMessage: i,
16
- children: e,
17
- className: c,
18
- errorPosition: d = "top",
19
- popover: l,
20
- ...m
21
- }) => /* @__PURE__ */ r(
22
- h,
23
- {
24
- ...m,
25
- className: p(s.radioGroup, c),
26
- children: G(e, (n) => /* @__PURE__ */ u(_, { children: [
27
- /* @__PURE__ */ r(x, { popover: l, children: o && /* @__PURE__ */ r(w, { children: o }) }),
28
- a && /* @__PURE__ */ r(z, { slot: "description", children: a }),
29
- d === "top" && /* @__PURE__ */ r(t, { "data-testid": "fieldError", children: i }),
30
- /* @__PURE__ */ r(R, { className: s.wrap, children: n }),
31
- d === "bottom" && /* @__PURE__ */ r(t, { "data-testid": "fieldError", children: i })
32
- ] }))
33
- }
34
- ), g = ({ className: o, ...a }) => /* @__PURE__ */ r(
35
- f,
36
- {
37
- className: p(s.radio, o),
38
- ...a
39
- }
40
- );
41
- export {
42
- g as R,
43
- W as a
44
- };
@@ -1,128 +0,0 @@
1
- 'use client';
2
- import { jsxs as u, jsx as a } from "react/jsx-runtime";
3
- import { s as y } from "./TextField.module-BDIbEV87.js";
4
- import { B as C } from "./Button-D22xOe8j.js";
5
- import { C as F } from "./ClearButton-DfwjeVYh.js";
6
- import { c as l } from "./clsx-AexbMWKp.js";
7
- import * as N from "react";
8
- import { useSearchFieldState as x } from "react-stately";
9
- import { useSearchField as j } from "react-aria";
10
- import { F as f } from "./FieldError-krpMBtie.js";
11
- import { c as p } from "./createLucideIcon-CP-mMPfa.js";
12
- import { u as B } from "./useLocalizedStringFormatter-BHvsRxDk.js";
13
- import '../assets/SearchField.css';const D = [
14
- ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
15
- ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
16
- ], E = p("search", D), k = "_container_19q7q_1", P = "_inner_19q7q_10", T = "_inputContainer_19q7q_15", w = "_medium_19q7q_21", I = "_icon_19q7q_26", K = "_clear_19q7q_39", L = "_input_19q7q_15", n = {
17
- container: k,
18
- inner: P,
19
- inputContainer: T,
20
- medium: w,
21
- icon: I,
22
- clear: K,
23
- input: L
24
- }, M = { search: "Search" }, R = { search: "Sök" }, V = {
25
- en: M,
26
- sv: R
27
- };
28
- function O(r) {
29
- return !!r?.length;
30
- }
31
- const Z = ({
32
- errorPosition: r = "top",
33
- size: i = "large",
34
- ...e
35
- }) => {
36
- const { value: t, setValue: m } = x(e), b = B(V), d = N.useRef(null), { inputProps: o, isInvalid: c, validationErrors: h, clearButtonProps: q } = j(
37
- {
38
- ...e,
39
- label: e.placeholder,
40
- validationBehavior: "native"
41
- },
42
- { value: t, setValue: m },
43
- d
44
- ), v = ({ target: s }) => m(s.value), S = () => m(""), _ = () => {
45
- if (e.validate && O(e.validate(t)) || c || !t) {
46
- d.current?.focus();
47
- return;
48
- }
49
- e.onSubmit && e.onSubmit(t);
50
- }, g = ({ key: s }) => {
51
- s === "Enter" && _();
52
- };
53
- return /* @__PURE__ */ u(
54
- "div",
55
- {
56
- className: l(n.container, e.className),
57
- "data-disabled": o.disabled,
58
- children: [
59
- r === "top" && /* @__PURE__ */ a(f, { isInvalid: c, children: e.errorMessage ?? h.join(" ") }),
60
- /* @__PURE__ */ u("div", { className: n.inner, children: [
61
- /* @__PURE__ */ u(
62
- "div",
63
- {
64
- className: l(n.inputContainer, {
65
- [n.medium]: i === "medium"
66
- }),
67
- children: [
68
- /* @__PURE__ */ a(
69
- E,
70
- {
71
- size: 20,
72
- className: n.icon
73
- }
74
- ),
75
- /* @__PURE__ */ a(
76
- "input",
77
- {
78
- ...o,
79
- ...o.disabled && { "data-disabled": !0 },
80
- className: l(
81
- y.input,
82
- n.input,
83
- o.className,
84
- { [n.medium]: i === "medium" }
85
- ),
86
- ref: d,
87
- onChange: v,
88
- value: t,
89
- "aria-invalid": c,
90
- onKeyDown: g,
91
- "aria-label": e.placeholder,
92
- "aria-labelledby": ""
93
- }
94
- ),
95
- t.length > 0 && /* @__PURE__ */ a(
96
- F,
97
- {
98
- ...q,
99
- onPress: S,
100
- size: i,
101
- className: l(n.clear, {
102
- [n.medium]: i === "medium"
103
- })
104
- }
105
- )
106
- ]
107
- }
108
- ),
109
- /* @__PURE__ */ a(
110
- C,
111
- {
112
- size: i,
113
- isDisabled: e.isDisabled,
114
- excludeFromTabOrder: !0,
115
- onPress: _,
116
- type: "button",
117
- children: e.buttonText ? e.buttonText : b.format("search")
118
- }
119
- )
120
- ] }),
121
- r === "bottom" && /* @__PURE__ */ a(f, { isInvalid: c, children: e.errorMessage ?? h.join(" ") })
122
- ]
123
- }
124
- );
125
- };
126
- export {
127
- Z as S
128
- };
@@ -1,76 +0,0 @@
1
- import { jsx as n, jsxs as r, Fragment as u } from "react/jsx-runtime";
2
- import { Menu as _, MenuItem as l, Popover as d, MenuSection as M, Separator as h } from "react-aria-components";
3
- import { c as a } from "./clsx-AexbMWKp.js";
4
- import { C as S } from "./check-Bt2UikoU.js";
5
- import { C as f } from "./chevron-right-DvXGOiS_.js";
6
- import '../assets/Separator.css';const p = "_menu_1oois_1", v = "_menuSection_1oois_17", k = "_medium_1oois_29", C = "_menuItem_1oois_36", N = "_mainContent_1oois_106", I = "_checkMark_1oois_117", x = "_separator_1oois_127", P = "_menuPopover_1oois_150", t = {
7
- menu: p,
8
- menuSection: v,
9
- medium: k,
10
- menuItem: C,
11
- mainContent: N,
12
- checkMark: I,
13
- separator: x,
14
- menuPopover: P
15
- }, z = ({
16
- className: e,
17
- size: o = "large",
18
- ...s
19
- }) => /* @__PURE__ */ n(
20
- _,
21
- {
22
- className: a(e, t.menu, o === "medium" && t.medium),
23
- ...s
24
- }
25
- ), V = (e) => /* @__PURE__ */ n(
26
- l,
27
- {
28
- ...e,
29
- textValue: e.textValue || (typeof e.children == "string" ? e.children : void 0),
30
- className: a(t.menuItem, e.className),
31
- children: (o) => {
32
- const { children: s } = e, { selectionMode: m, isSelected: c, hasSubmenu: i } = o;
33
- return /* @__PURE__ */ r(u, { children: [
34
- m !== "none" && /* @__PURE__ */ n(
35
- S,
36
- {
37
- size: 16,
38
- className: t.checkMark,
39
- "data-selected": c || void 0
40
- }
41
- ),
42
- /* @__PURE__ */ n("div", { className: t.mainContent, children: typeof s == "function" ? s(o) : s }),
43
- i && /* @__PURE__ */ n(f, { size: 20 })
44
- ] });
45
- }
46
- }
47
- ), F = ({ className: e, ...o }) => /* @__PURE__ */ n(
48
- d,
49
- {
50
- className: a(e, t.menuPopover),
51
- offset: 4,
52
- ...o
53
- }
54
- ), R = ({
55
- className: e,
56
- ...o
57
- }) => /* @__PURE__ */ n(
58
- M,
59
- {
60
- className: a(e, t.menuSection),
61
- ...o
62
- }
63
- ), q = ({ className: e, ...o }) => /* @__PURE__ */ n(
64
- h,
65
- {
66
- className: a(e, t.separator),
67
- ...o
68
- }
69
- );
70
- export {
71
- z as M,
72
- q as S,
73
- V as a,
74
- F as b,
75
- R as c
76
- };