@midas-ds/components 16.2.3 → 16.2.5

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 (56) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/assets/Layout.css +1 -1
  3. package/calendar/index.js +1 -1
  4. package/character-counter/CharacterCounter.d.ts +3 -2
  5. package/character-counter/index.js +1 -1
  6. package/checkbox/Checkbox.d.ts +2 -4
  7. package/checkbox/CheckboxGroupItem.d.ts +1 -2
  8. package/checkbox/CheckboxInner.d.ts +2 -2
  9. package/checkbox/SingleCheckbox.d.ts +1 -2
  10. package/checkbox/index.js +2 -2
  11. package/checkbox/types.d.ts +2 -1
  12. package/chunks/CharacterCounter-_m-SgTMV.js +20 -0
  13. package/chunks/Checkbox-gsEu5wcB.js +119 -0
  14. package/chunks/{CheckboxGroup-C5kaqBcn.js → CheckboxGroup-A7UJMi5J.js} +3 -3
  15. package/chunks/{ComboBox-N97lv5kN.js → ComboBox-yl5zHYPk.js} +1 -1
  16. package/chunks/{DateField-DeuLPe1Y.js → DateField-BsT1K-bB.js} +1 -1
  17. package/chunks/{DateRangePicker-BqjLArNi.js → DateRangePicker-BsK7pMRv.js} +2 -2
  18. package/chunks/FieldError-Bc0acYNs.js +21 -0
  19. package/chunks/Layout-DX3HUm5b.js +466 -0
  20. package/chunks/{Radio-Dro99zCs.js → Radio-CSFYbin8.js} +1 -1
  21. package/chunks/{RangeCalendar-CGk2btOp.js → RangeCalendar-BF-6p7u2.js} +1 -1
  22. package/chunks/{SearchField-BfpeANM6.js → SearchField-mBHZ9pFg.js} +1 -1
  23. package/chunks/{Select-nL9iJMlf.js → Select-BjD5iQvX.js} +2 -2
  24. package/chunks/{Select-D-LtFSZX.js → Select-Df4333VV.js} +2 -2
  25. package/chunks/{Table-CgBjwlIi.js → Table-t3rVzb31.js} +1 -1
  26. package/chunks/TextArea-B2BePnZz.js +136 -0
  27. package/combobox/index.js +1 -1
  28. package/date-field/index.js +1 -1
  29. package/date-picker/index.js +1 -1
  30. package/field-error/FieldError.d.ts +3 -2
  31. package/field-error/index.js +1 -1
  32. package/index.js +15 -15
  33. package/layout/components/SidebarLink.d.ts +1 -2
  34. package/layout/index.js +1 -1
  35. package/legacy-select/HiddenMultiSelect.d.ts +2 -2
  36. package/legacy-select/MultiSelectValueTag.d.ts +3 -3
  37. package/legacy-select/Select.d.ts +2 -4
  38. package/legacy-select/index.js +1 -1
  39. package/legacy-select/types.d.ts +2 -1
  40. package/legacy-select/useMultiSelect.d.ts +1 -1
  41. package/package.json +1 -1
  42. package/radio/index.js +1 -1
  43. package/search-field/index.js +1 -1
  44. package/select/index.js +1 -1
  45. package/table/index.js +1 -1
  46. package/textfield/Input.d.ts +3 -2
  47. package/textfield/PasswordField.d.ts +1 -2
  48. package/textfield/TextArea.d.ts +5 -3
  49. package/textfield/TextField.d.ts +5 -3
  50. package/textfield/TextFieldBase.d.ts +3 -3
  51. package/textfield/index.js +1 -1
  52. package/chunks/CharacterCounter-DeuE2det.js +0 -21
  53. package/chunks/Checkbox-CP6Nv9yx.js +0 -122
  54. package/chunks/FieldError-C0HRIcAx.js +0 -23
  55. package/chunks/Layout-LjCfmVhQ.js +0 -465
  56. package/chunks/TextArea-CRvbqqVZ.js +0 -124
@@ -1,465 +0,0 @@
1
- import { jsx as e, jsxs as i, Fragment as P } from "react/jsx-runtime";
2
- import { G as T } from "./GridItem-5t1Z14sM.js";
3
- import * as v from "react";
4
- import { c as u } from "./clsx-AexbMWKp.js";
5
- import { Link as q, RouterProvider as B } from "react-aria-components";
6
- import { B as I } from "./Button-wBgWrXj3.js";
7
- import { a as H, T as G } from "./Tooltip-m032jGgF.js";
8
- import { a as L, B as y } from "./BadgeContainer-CKVsfTlF.js";
9
- import { c as M } from "./createLucideIcon-D4r5Phnh.js";
10
- import { u as C } from "./useLocalizedStringFormatter-ZgRJmvHC.js";
11
- import { variables as W } from "@midas-ds/theme";
12
- import { L as g } from "./Logo-InDSslpO.js";
13
- import { X as j } from "./x-BXShoIAM.js";
14
- import '../assets/Layout.css';const D = [
15
- ["path", { d: "M4 12h16", key: "1lakjw" }],
16
- ["path", { d: "M4 18h16", key: "19g7jn" }],
17
- ["path", { d: "M4 6h16", key: "1o0s65" }]
18
- ], A = M("menu", D);
19
- const R = [
20
- ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
21
- ["path", { d: "M9 3v18", key: "fh3hqa" }],
22
- ["path", { d: "m16 15-3-3 3-3", key: "14y99z" }]
23
- ], $ = M("panel-left-close", R);
24
- const F = [
25
- ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
26
- ["path", { d: "M9 3v18", key: "fh3hqa" }],
27
- ["path", { d: "m14 9 3 3-3 3", key: "8010ee" }]
28
- ], X = M("panel-left-open", F), J = "_baseLayout_1hkrq_1", K = "_mainContent_1hkrq_10", Q = "_header_1hkrq_15", U = "_headerExternal_1hkrq_26", V = "_headerContent_1hkrq_41", Y = "_logo_1hkrq_60", Z = "_headerItems_1hkrq_69", ee = "_toggleButton_1hkrq_75", ae = "_sidebar_1hkrq_83", te = "_main_1hkrq_10", ne = "_app_1hkrq_116", se = "_sidebarOpened_1hkrq_124", re = "_sidebarHeader_1hkrq_128", ie = "_appName_1hkrq_140", oe = "_collapseButton_1hkrq_147", le = "_sidebarCollapsed_1hkrq_156", de = "_userName_1hkrq_166", ce = "_userTitle_1hkrq_184", me = "_title_1hkrq_196", pe = "_sidebarNav_1hkrq_207", he = "_list_1hkrq_213", _e = "_listGroupTitle_1hkrq_219", ue = "_listItem_1hkrq_226", ke = "_listItemCollapsed_1hkrq_231", be = "_listLink_1hkrq_235", ve = "_listLinkCollapsed_1hkrq_298", Ne = "_active_1hkrq_303", fe = "_backdrop_1hkrq_330", Ce = "_backdropOpened_1hkrq_340", xe = "_skipToContent_1hkrq_358", ge = "_navbar_1hkrq_372", qe = "_navbarList_1hkrq_384", Le = "_navbarItem_1hkrq_406", ye = "_headerContentExternal_1hkrq_457", Ie = "_logoExternalContainer_1hkrq_465", Me = "_logoExternal_1hkrq_465", Ee = "_logoExternalDesktop_1hkrq_477", Te = "_navbarWrapper_1hkrq_486", a = {
29
- baseLayout: J,
30
- mainContent: K,
31
- header: Q,
32
- headerExternal: U,
33
- headerContent: V,
34
- logo: Y,
35
- headerItems: Z,
36
- toggleButton: ee,
37
- sidebar: ae,
38
- main: te,
39
- app: ne,
40
- sidebarOpened: se,
41
- sidebarHeader: re,
42
- appName: ie,
43
- collapseButton: oe,
44
- sidebarCollapsed: le,
45
- userName: de,
46
- userTitle: ce,
47
- title: me,
48
- sidebarNav: pe,
49
- list: he,
50
- listGroupTitle: _e,
51
- listItem: ue,
52
- listItemCollapsed: ke,
53
- listLink: be,
54
- listLinkCollapsed: ve,
55
- active: Ne,
56
- backdrop: fe,
57
- backdropOpened: Ce,
58
- skipToContent: xe,
59
- navbar: ge,
60
- navbarList: qe,
61
- navbarItem: Le,
62
- headerContentExternal: ye,
63
- logoExternalContainer: Ie,
64
- logoExternal: Me,
65
- logoExternalDesktop: Ee,
66
- navbarWrapper: Te
67
- }, O = v.createContext(
68
- void 0
69
- ), Se = ({
70
- items: n,
71
- title: s,
72
- user: r,
73
- app: t,
74
- children: o,
75
- clientSideRouter: m,
76
- clientSideHref: d,
77
- headerChildren: _,
78
- isCollapsed: h,
79
- setIsCollapsed: p,
80
- isOpened: k,
81
- setIsOpened: l,
82
- variant: b,
83
- id: N
84
- }) => /* @__PURE__ */ e(
85
- O.Provider,
86
- {
87
- value: {
88
- items: n,
89
- title: s,
90
- user: r,
91
- app: t,
92
- headerChildren: _,
93
- isCollapsed: h,
94
- setIsCollapsed: p,
95
- isOpened: k,
96
- setIsOpened: l,
97
- clientSideRouter: m,
98
- clientSideHref: d,
99
- variant: b,
100
- id: N
101
- },
102
- children: o
103
- }
104
- ), f = () => {
105
- const n = v.useContext(O);
106
- if (!n)
107
- throw new Error("useLayoutContext must be used within a LayoutProvider");
108
- return n;
109
- }, w = ({
110
- title: n,
111
- href: s,
112
- icon: r,
113
- active: t,
114
- hasBadge: o
115
- }) => {
116
- const { isCollapsed: m, setIsOpened: d, clientSideHref: _ } = f(), h = _ ? _(s) : s, [p, k] = v.useState(!1);
117
- return v.useEffect(() => {
118
- if (typeof window < "u") {
119
- const l = window.location.pathname === h || window.location.pathname.startsWith(h + "/");
120
- k(t ?? l);
121
- }
122
- }, [t, h]), m ? /* @__PURE__ */ i(H, { children: [
123
- /* @__PURE__ */ e(
124
- q,
125
- {
126
- href: s,
127
- "aria-label": n,
128
- className: u(
129
- a.listLink,
130
- a.listLinkCollapsed,
131
- p && a.active
132
- ),
133
- onPress: () => d?.(!1),
134
- children: /* @__PURE__ */ i(L, { children: [
135
- /* @__PURE__ */ e(
136
- r,
137
- {
138
- size: 20,
139
- "aria-label": n
140
- }
141
- ),
142
- o && /* @__PURE__ */ e(y, {})
143
- ] })
144
- }
145
- ),
146
- /* @__PURE__ */ e(G, { placement: "right", children: n })
147
- ] }) : /* @__PURE__ */ i(
148
- q,
149
- {
150
- href: s,
151
- "aria-label": n,
152
- className: u(a.listLink, p && a.active),
153
- onPress: () => d?.(!1),
154
- children: [
155
- /* @__PURE__ */ i(L, { children: [
156
- /* @__PURE__ */ e(r, { size: 20 }),
157
- o && /* @__PURE__ */ e(y, {})
158
- ] }),
159
- n
160
- ]
161
- }
162
- );
163
- }, ze = { closeMenu: "Close menu", openMenu: "Open menu", maximizeMenu: "Maximize menu", minimizeMenu: "Minimize menu", sidebarMenu: "Sidebar menu", bottomMenu: "Bottom menu", skipToContent: "Skip to main content" }, Be = { closeMenu: "Stäng meny", openMenu: "Öppna meny", maximizeMenu: "Maximera meny", minimizeMenu: "Minimera meny", sidebarMenu: "Sidomeny", bottomMenu: "Bottenmeny", skipToContent: "Hoppa till huvudinnehåll" }, x = {
164
- en: ze,
165
- sv: Be
166
- }, Oe = () => {
167
- const {
168
- items: n,
169
- app: s,
170
- isOpened: r,
171
- isCollapsed: t,
172
- setIsCollapsed: o,
173
- setIsOpened: m,
174
- clientSideRouter: d,
175
- clientSideHref: _,
176
- id: h
177
- } = f(), p = C(x), k = ({ group: l }) => /* @__PURE__ */ e("ul", { className: a.list, children: l.items.map((b, N) => /* @__PURE__ */ e(
178
- "li",
179
- {
180
- className: u(
181
- a.listItem,
182
- t && a.listItemCollapsed
183
- ),
184
- children: /* @__PURE__ */ e(w, { ...b })
185
- },
186
- "link_" + N
187
- )) });
188
- return v.useEffect(() => {
189
- const l = (b) => {
190
- b.key === "Escape" && m !== void 0 && m(!1);
191
- };
192
- return window.addEventListener("keydown", l), () => {
193
- window.removeEventListener("keydown", l);
194
- };
195
- }, [m]), /* @__PURE__ */ i(
196
- "aside",
197
- {
198
- id: h,
199
- className: u(
200
- a.sidebar,
201
- t && a.sidebarCollapsed,
202
- r && a.sidebarOpened
203
- ),
204
- children: [
205
- /* @__PURE__ */ i("div", { className: a.sidebarHeader, children: [
206
- !t && /* @__PURE__ */ e("p", { className: a.appName, children: s.name }),
207
- /* @__PURE__ */ e(
208
- I,
209
- {
210
- variant: "icon",
211
- "aria-label": t ? p.format("maximizeMenu") : p.format("minimizeMenu"),
212
- onPress: () => o(!t),
213
- className: a.collapseButton,
214
- children: t ? /* @__PURE__ */ e(X, { size: 20 }) : /* @__PURE__ */ e($, { size: 20 })
215
- }
216
- )
217
- ] }),
218
- /* @__PURE__ */ e(
219
- "nav",
220
- {
221
- className: a.sidebarNav,
222
- "aria-label": p.format("sidebarMenu"),
223
- children: /* @__PURE__ */ e("ul", { className: a.list, children: n.map((l, b) => /* @__PURE__ */ i("li", { children: [
224
- l.title && !t && /* @__PURE__ */ e("p", { className: a.listGroupTitle, children: l.title }),
225
- d ? /* @__PURE__ */ e(
226
- B,
227
- {
228
- navigate: d,
229
- useHref: _,
230
- children: /* @__PURE__ */ e(k, { group: l })
231
- }
232
- ) : /* @__PURE__ */ e(k, { group: l })
233
- ] }, "list_" + b)) })
234
- }
235
- )
236
- ]
237
- }
238
- );
239
- }, we = () => {
240
- const {
241
- title: n,
242
- user: s,
243
- app: r,
244
- isOpened: t,
245
- setIsOpened: o,
246
- setIsCollapsed: m,
247
- headerChildren: d,
248
- variant: _,
249
- id: h
250
- } = f(), p = C(x);
251
- return _ === "external" ? /* @__PURE__ */ e("header", { className: u(a.header, a.headerExternal), children: /* @__PURE__ */ i("div", { className: a.headerContentExternal, children: [
252
- /* @__PURE__ */ i("div", { className: a.logoExternalContainer, children: [
253
- /* @__PURE__ */ e(
254
- g,
255
- {
256
- size: "x-small",
257
- padding: !1,
258
- className: a.logoExternal
259
- }
260
- ),
261
- /* @__PURE__ */ e(
262
- g,
263
- {
264
- size: "small",
265
- padding: !1,
266
- className: a.logoExternalDesktop
267
- }
268
- ),
269
- /* @__PURE__ */ i("div", { children: [
270
- /* @__PURE__ */ e("p", { className: a.userName, children: s.name }),
271
- /* @__PURE__ */ e("p", { className: a.userTitle, children: s.title })
272
- ] })
273
- ] }),
274
- /* @__PURE__ */ e("div", { className: a.headerItems, children: d })
275
- ] }) }) : /* @__PURE__ */ i(
276
- "header",
277
- {
278
- className: a.header,
279
- style: {
280
- borderTop: `solid 4px ${r.color ? r.color : W.brandPrimary}`
281
- },
282
- children: [
283
- /* @__PURE__ */ i("div", { className: a.headerContent, children: [
284
- /* @__PURE__ */ e("div", { className: a.logo, children: /* @__PURE__ */ e(
285
- g,
286
- {
287
- size: "small",
288
- padding: !1
289
- }
290
- ) }),
291
- t !== void 0 && /* @__PURE__ */ e(
292
- I,
293
- {
294
- variant: "icon",
295
- className: a.toggleButton,
296
- "aria-label": t ? p.format("closeMenu") : p.format("openMenu"),
297
- "aria-controls": h,
298
- onPressStart: () => {
299
- m(!1), o?.(!0);
300
- },
301
- children: t ? /* @__PURE__ */ e(
302
- j,
303
- {
304
- size: 20,
305
- "aria-hidden": "true"
306
- }
307
- ) : /* @__PURE__ */ e(
308
- A,
309
- {
310
- size: 20,
311
- "aria-hidden": "true"
312
- }
313
- )
314
- }
315
- ),
316
- /* @__PURE__ */ i("div", { children: [
317
- /* @__PURE__ */ e("p", { className: a.userName, children: s.name }),
318
- /* @__PURE__ */ e("p", { className: a.userTitle, children: s.title }),
319
- /* @__PURE__ */ e("p", { className: a.title, children: n })
320
- ] })
321
- ] }),
322
- /* @__PURE__ */ e("div", { className: a.headerItems, children: d })
323
- ]
324
- }
325
- );
326
- }, S = ({
327
- id: n = "main:first-of-type"
328
- }) => {
329
- const s = () => {
330
- const t = document.querySelector(n);
331
- t && (t.tabIndex = -1, t.focus(), setTimeout(() => t.removeAttribute("tabindex"), 1e3));
332
- }, r = C(x);
333
- return /* @__PURE__ */ e(
334
- I,
335
- {
336
- onPress: s,
337
- className: a.skipToContent,
338
- children: r.format("skipToContent")
339
- }
340
- );
341
- }, Pe = () => {
342
- const { isOpened: n, setIsOpened: s } = f();
343
- return n ? /* @__PURE__ */ e(
344
- "div",
345
- {
346
- className: u(a.backdrop, a.backdropOpened),
347
- onClick: () => {
348
- s?.(!1);
349
- },
350
- "aria-hidden": !0
351
- }
352
- ) : null;
353
- }, He = () => {
354
- const { items: n, clientSideRouter: s, clientSideHref: r } = f(), t = C(x), o = n.at(0)?.items;
355
- return /* @__PURE__ */ e(
356
- "nav",
357
- {
358
- className: a.navbar,
359
- "aria-label": t.format("bottomMenu"),
360
- children: o && /* @__PURE__ */ e("ul", { className: u(a.navbarList), children: s ? /* @__PURE__ */ e(
361
- B,
362
- {
363
- navigate: s,
364
- useHref: r,
365
- children: /* @__PURE__ */ e(z, { items: o })
366
- }
367
- ) : /* @__PURE__ */ e(z, { items: o }) })
368
- }
369
- );
370
- }, z = ({
371
- items: n
372
- }) => /* @__PURE__ */ e(P, { children: n.map(({ href: s, active: r, icon: t, title: o, hasBadge: m }, d) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
373
- q,
374
- {
375
- href: s,
376
- className: u(a.navbarItem),
377
- "data-active": r,
378
- "aria-current": r && "page",
379
- children: [
380
- /* @__PURE__ */ i(L, { children: [
381
- /* @__PURE__ */ e(t, { size: 20 }),
382
- m && /* @__PURE__ */ e(y, {})
383
- ] }),
384
- o
385
- ]
386
- }
387
- ) }, d)) }), c = ({
388
- items: n,
389
- title: s,
390
- user: r,
391
- app: t,
392
- children: o,
393
- headerChildren: m,
394
- clientSideRouter: d,
395
- clientSideHref: _,
396
- variant: h,
397
- className: p
398
- }) => {
399
- const [k, l] = v.useState(!1), [b, N] = v.useState(!1), E = v.useId();
400
- return h === "external" ? /* @__PURE__ */ e(
401
- c.Provider,
402
- {
403
- items: n,
404
- title: s,
405
- user: r,
406
- app: t,
407
- clientSideRouter: d,
408
- clientSideHref: _,
409
- headerChildren: m,
410
- isCollapsed: k,
411
- setIsCollapsed: l,
412
- variant: h,
413
- id: E,
414
- children: /* @__PURE__ */ i("div", { className: u(a.baseLayout, p), children: [
415
- /* @__PURE__ */ e(S, {}),
416
- /* @__PURE__ */ e(c.Header, {}),
417
- /* @__PURE__ */ i("div", { className: a.mainContent, children: [
418
- /* @__PURE__ */ e(c.Sidebar, {}),
419
- /* @__PURE__ */ e(T, { children: /* @__PURE__ */ e("main", { className: a.main, children: /* @__PURE__ */ e("div", { className: a.app, children: o }) }) }),
420
- /* @__PURE__ */ e(c.Backdrop, {})
421
- ] }),
422
- /* @__PURE__ */ e("div", { className: a.navbarWrapper, children: /* @__PURE__ */ e(c.Navbar, {}) })
423
- ] })
424
- }
425
- ) : /* @__PURE__ */ e(
426
- c.Provider,
427
- {
428
- items: n,
429
- title: s,
430
- user: r,
431
- app: t,
432
- clientSideRouter: d,
433
- clientSideHref: _,
434
- headerChildren: m,
435
- isCollapsed: k,
436
- setIsCollapsed: l,
437
- isOpened: b,
438
- setIsOpened: N,
439
- variant: h,
440
- id: E,
441
- children: /* @__PURE__ */ i("div", { className: u(a.baseLayout, p), children: [
442
- /* @__PURE__ */ e(S, {}),
443
- /* @__PURE__ */ e(c.Header, {}),
444
- /* @__PURE__ */ i("div", { className: a.mainContent, children: [
445
- /* @__PURE__ */ e(c.Sidebar, {}),
446
- /* @__PURE__ */ e(T, { children: /* @__PURE__ */ e("main", { className: a.main, children: /* @__PURE__ */ e("div", { className: a.app, children: o }) }) }),
447
- /* @__PURE__ */ e(c.Backdrop, {})
448
- ] })
449
- ] })
450
- }
451
- );
452
- };
453
- c.Provider = Se;
454
- c.Header = we;
455
- c.Sidebar = Oe;
456
- c.SidebarLink = w;
457
- c.Navbar = He;
458
- c.Backdrop = Pe;
459
- export {
460
- we as H,
461
- c as L,
462
- He as N,
463
- Oe as S,
464
- w as a
465
- };
@@ -1,124 +0,0 @@
1
- import { jsxs as l, jsx as s, Fragment as N } from "react/jsx-runtime";
2
- import * as c from "react";
3
- import { useContextProps as m, TextFieldContext as C, TextField as P, InputContext as p, Input as b, TextArea as g } from "react-aria-components";
4
- import { a as R, c as f } from "./clsx-AexbMWKp.js";
5
- import { s as d } from "./TextField.module-DZslrEPC.js";
6
- import { T as x } from "./Text-TWzJxnto.js";
7
- import { B as v } from "./Button-wBgWrXj3.js";
8
- import { u as I } from "./useLocalizedStringFormatter-ZgRJmvHC.js";
9
- import { F as h } from "./FieldError-C0HRIcAx.js";
10
- import { C as L } from "./CharacterCounter-DeuE2det.js";
11
- import { a as y, L as A } from "./Label-Dup4lWaR.js";
12
- const u = c.forwardRef((e, t) => {
13
- [e] = m(e, t, C);
14
- const {
15
- label: r,
16
- description: o,
17
- errorMessage: i,
18
- showCounter: n,
19
- errorPosition: a = "top",
20
- size: w = "large",
21
- popover: T,
22
- children: F
23
- } = e;
24
- return /* @__PURE__ */ l(
25
- P,
26
- {
27
- ...e,
28
- className: R(d.textField, {
29
- [d.medium]: w === "medium"
30
- }),
31
- children: [
32
- /* @__PURE__ */ s(y, { popover: T, children: r && /* @__PURE__ */ s(A, { children: r }) }),
33
- o && /* @__PURE__ */ s(x, { slot: "description", children: o }),
34
- n && /* @__PURE__ */ s(L, { isLonely: !o }),
35
- a === "top" && /* @__PURE__ */ s(h, { "data-testid": "fieldError", children: i }),
36
- F,
37
- a === "bottom" && /* @__PURE__ */ s(
38
- h,
39
- {
40
- "data-testid": "fieldError",
41
- className: d.bottomError,
42
- children: i
43
- }
44
- )
45
- ]
46
- }
47
- );
48
- }), B = { hide: "Hide", show: "Show" }, E = { hide: "Dölj", show: "Visa" }, S = {
49
- en: B,
50
- sv: E
51
- }, $ = c.forwardRef(
52
- (e, t) => {
53
- [e, t] = m(e, t, p);
54
- const [r, o] = c.useState(!1), i = () => o((a) => !a), n = I(S);
55
- return /* @__PURE__ */ l(N, { children: [
56
- r && /* @__PURE__ */ s(
57
- x,
58
- {
59
- slot: "description",
60
- className: d.passwordText,
61
- children: e.value
62
- }
63
- ),
64
- /* @__PURE__ */ s(
65
- v,
66
- {
67
- variant: "tertiary",
68
- onPress: i,
69
- className: d.passwordButton,
70
- children: r ? n.format("hide") : n.format("show")
71
- }
72
- )
73
- ] });
74
- }
75
- ), j = c.forwardRef(
76
- ({ skipContext: e = !1, ...t }, r) => {
77
- const [o, i] = m(
78
- t,
79
- r,
80
- p
81
- ), n = e ? r : i, a = e ? t : o;
82
- return /* @__PURE__ */ l("div", { className: d.wrap, children: [
83
- /* @__PURE__ */ s(
84
- b,
85
- {
86
- ...a,
87
- ref: n,
88
- className: f(d.input, a.className)
89
- }
90
- ),
91
- a.type === "password" && /* @__PURE__ */ s($, { ...a })
92
- ] });
93
- }
94
- ), K = c.forwardRef(
95
- ({ className: e, list: t, type: r, min: o, max: i, ...n }, a) => /* @__PURE__ */ s(u, { ...n, children: /* @__PURE__ */ s(
96
- j,
97
- {
98
- className: f(e),
99
- list: t,
100
- min: o,
101
- max: i,
102
- ref: a,
103
- type: r,
104
- skipContext: !0
105
- }
106
- ) })
107
- ), O = c.forwardRef(
108
- ({ className: e, cols: t, rows: r, wrap: o, ...i }, n) => /* @__PURE__ */ s(u, { ...i, children: /* @__PURE__ */ s(
109
- g,
110
- {
111
- className: f(d.textArea, e),
112
- cols: t,
113
- ref: n,
114
- rows: r,
115
- wrap: o
116
- }
117
- ) })
118
- );
119
- export {
120
- j as I,
121
- u as T,
122
- K as a,
123
- O as b
124
- };