@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
@@ -5,8 +5,8 @@ import * as y from "react";
5
5
  import { useState as W, useEffect as j } from "react";
6
6
  import { c as b } from "./clsx-AexbMWKp.js";
7
7
  import { Link as L, RouterProvider as P } from "react-aria-components";
8
- import { B as T } from "./Button-D22xOe8j.js";
9
- import { a as D, T as q } from "./Tooltip-C1bbgr2l.js";
8
+ import { B as T } from "./Button-GCROAMSl.js";
9
+ import { a as D, T as q } from "./Tooltip-BYEaNkZG.js";
10
10
  import { a as I, B as M } from "./BadgeContainer-CKVsfTlF.js";
11
11
  import { c as S } from "./createLucideIcon-CP-mMPfa.js";
12
12
  import { u as k } from "./useLocalizedStringFormatter-BHvsRxDk.js";
@@ -0,0 +1,59 @@
1
+ 'use client';
2
+ import { jsx as r, jsxs as _, Fragment as f } from "react/jsx-runtime";
3
+ import { Link as p } from "react-aria-components";
4
+ import { c as k } from "./clsx-AexbMWKp.js";
5
+ import { c as u } from "./createLucideIcon-CP-mMPfa.js";
6
+ import { S as w } from "./square-arrow-out-up-right-x_I6wdNi.js";
7
+ import { A as L } from "./arrow-right-BVcFGZmy.js";
8
+ import '../assets/Link.css';const x = [
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
+ ], g = u("arrow-down-to-line", x), y = "_link_1sdlh_1", A = "_icon_1sdlh_51", j = "_standalone_1sdlh_55", I = "_stretched_1sdlh_72", o = {
13
+ link: y,
14
+ icon: A,
15
+ standalone: j,
16
+ stretched: I
17
+ }, D = ({
18
+ children: t,
19
+ standalone: n,
20
+ target: s,
21
+ stretched: i,
22
+ download: l,
23
+ icon: e,
24
+ className: a,
25
+ as: d,
26
+ ...m
27
+ }) => {
28
+ const h = d || p, c = e || (l ? g : s === "_blank" ? w : n ? L : null);
29
+ return /* @__PURE__ */ r(
30
+ h,
31
+ {
32
+ className: k(
33
+ o.link,
34
+ n && o.standalone,
35
+ i && o.stretched,
36
+ a
37
+ ),
38
+ ...m,
39
+ target: s,
40
+ children: /* @__PURE__ */ _(f, { children: [
41
+ t,
42
+ c ? /* @__PURE__ */ r(
43
+ N,
44
+ {
45
+ className: o.icon,
46
+ icon: c,
47
+ size: 16
48
+ }
49
+ ) : null
50
+ ] })
51
+ }
52
+ );
53
+ }, N = ({
54
+ icon: t,
55
+ ...n
56
+ }) => /* @__PURE__ */ r(t, { ...n });
57
+ export {
58
+ D as L
59
+ };
@@ -1,68 +1,68 @@
1
1
  'use client';
2
- import { jsxs as f, jsx as c } from "react/jsx-runtime";
2
+ import { jsxs as l, jsx as c } from "react/jsx-runtime";
3
3
  import { Link as u } from "react-aria-components";
4
- import { c as w } from "./clsx-AexbMWKp.js";
4
+ import { c as x } from "./clsx-AexbMWKp.js";
5
5
  import { S as y } from "./square-arrow-out-up-right-x_I6wdNi.js";
6
6
  import { c as p } from "./createLucideIcon-CP-mMPfa.js";
7
7
  import { A as g } from "./arrow-right-BVcFGZmy.js";
8
8
  import '../assets/LinkButton.css';const h = [
9
9
  ["path", { d: "m12 19-7-7 7-7", key: "1l729n" }],
10
10
  ["path", { d: "M19 12H5", key: "x3x0zl" }]
11
- ], k = p("arrow-left", h), B = "_linkButton_18ewv_1", L = "_secondary_18ewv_56", x = "_icon_18ewv_61", v = "_tertiary_18ewv_98", A = "_danger_18ewv_124", I = "_iconBtn_18ewv_141", N = "_medium_18ewv_163", j = "_iconLeft_18ewv_168", z = "_fullwidth_18ewv_172", t = {
11
+ ], k = p("arrow-left", h), B = "_linkButton_ix6fe_1", L = "_secondary_ix6fe_56", w = "_icon_ix6fe_61", A = "_tertiary_ix6fe_98", I = "_danger_ix6fe_124", N = "_iconBtn_ix6fe_141", j = "_medium_ix6fe_163", z = "_iconLeft_ix6fe_168", R = "_fullwidth_ix6fe_172", t = {
12
12
  linkButton: B,
13
13
  secondary: L,
14
- icon: x,
15
- tertiary: v,
16
- danger: A,
17
- iconBtn: I,
18
- medium: N,
19
- iconLeft: j,
20
- fullwidth: z
21
- }, U = ({
14
+ icon: w,
15
+ tertiary: A,
16
+ danger: I,
17
+ iconBtn: N,
18
+ medium: j,
19
+ iconLeft: z,
20
+ fullwidth: R
21
+ }, D = ({
22
22
  children: o,
23
23
  variant: n,
24
24
  fullwidth: s,
25
25
  icon: e,
26
- iconPlacement: r,
27
- className: _,
28
- as: m,
29
- size: a = "large",
30
- ...i
26
+ iconPlacement: i,
27
+ className: f,
28
+ as: _,
29
+ size: m = "large",
30
+ ...r
31
31
  }) => {
32
- const d = m || u, l = e || (i.target === "_blank" ? y : r === "left" ? k : g);
33
- return /* @__PURE__ */ f(
34
- d,
32
+ const a = _ || u, d = e || (r.target === "_blank" ? y : i === "left" ? k : g);
33
+ return /* @__PURE__ */ l(
34
+ a,
35
35
  {
36
- className: w(
36
+ className: x(
37
37
  t.linkButton,
38
38
  n === "primary" && t.primary,
39
39
  n === "secondary" && t.secondary,
40
40
  n === "tertiary" && t.tertiary,
41
41
  n === "danger" && t.danger,
42
42
  n === "icon" && t.iconBtn,
43
- a === "medium" && t.medium,
43
+ m === "medium" && t.medium,
44
44
  s && t.fullwidth,
45
- r === "left" && t.iconLeft,
46
- _
45
+ i === "left" && t.iconLeft,
46
+ f
47
47
  ),
48
- ...i,
48
+ ...r,
49
49
  children: [
50
50
  o,
51
51
  /* @__PURE__ */ c(
52
- R,
52
+ S,
53
53
  {
54
54
  className: t.icon,
55
- icon: l,
55
+ icon: d,
56
56
  size: 20
57
57
  }
58
58
  )
59
59
  ]
60
60
  }
61
61
  );
62
- }, R = ({
62
+ }, S = ({
63
63
  icon: o,
64
64
  ...n
65
65
  }) => /* @__PURE__ */ c(o, { ...n });
66
66
  export {
67
- U as L
67
+ D as L
68
68
  };
@@ -1,7 +1,7 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import { ListLayout as i, Virtualizer as l, ListBox as n } from "react-aria-components";
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import { ListLayout as e, Virtualizer as n, ListBox as l } from "react-aria-components";
3
3
  import { c as x } from "./clsx-AexbMWKp.js";
4
- import '../assets/ListBox.css';class B extends i {
4
+ import '../assets/ListBox.css';class r extends e {
5
5
  /**
6
6
  * When using the ListLayout our scroll container height is not calculated properly when the content is partially sectioned.
7
7
  * ```ts
@@ -25,29 +25,29 @@ import '../assets/ListBox.css';class B extends i {
25
25
  }), this.contentSize;
26
26
  }
27
27
  }
28
- const r = "_listBox_1l41e_4", a = "_listBoxPopover_1l41e_16", c = "_listBoxSectionHeading_1l41e_30", _ = "_listBoxButton_1l41e_42", m = "_listBoxItem_1l41e_54", L = "_textContent_1l41e_68", u = "_listBoxLoadMoreItem_1l41e_174", d = {
29
- listBox: r,
28
+ const B = "_listBox_6zv1j_4", a = "_listBoxPopover_6zv1j_16 _dropdownAnimation_1ljkv_4", _ = "_listBoxSectionHeading_6zv1j_31", c = "_listBoxButton_6zv1j_43", m = "_listBoxItem_6zv1j_55", d = "_textContent_6zv1j_68", v = "_listBoxLoadMoreItem_6zv1j_172", L = {
29
+ listBox: B,
30
30
  listBoxPopover: a,
31
- listBoxSectionHeading: c,
32
- listBoxButton: _,
31
+ listBoxSectionHeading: _,
32
+ listBoxButton: c,
33
33
  listBoxItem: m,
34
- textContent: L,
35
- listBoxLoadMoreItem: u
36
- }, h = ({
37
- className: e,
34
+ textContent: d,
35
+ listBoxLoadMoreItem: v
36
+ }, p = ({
37
+ className: s,
38
38
  children: t,
39
39
  ...o
40
- }) => /* @__PURE__ */ s(
41
- l,
40
+ }) => /* @__PURE__ */ i(
41
+ n,
42
42
  {
43
- layout: B,
43
+ layout: r,
44
44
  layoutOptions: {
45
45
  headingHeight: 38
46
46
  },
47
- children: /* @__PURE__ */ s(
48
- n,
47
+ children: /* @__PURE__ */ i(
48
+ l,
49
49
  {
50
- className: x(d.listBox, e),
50
+ className: x(L.listBox, s),
51
51
  ...o,
52
52
  children: t
53
53
  }
@@ -55,6 +55,6 @@ const r = "_listBox_1l41e_4", a = "_listBoxPopover_1l41e_16", c = "_listBoxSecti
55
55
  }
56
56
  );
57
57
  export {
58
- h as L,
59
- d as s
58
+ p as L,
59
+ L as s
60
60
  };
@@ -1,7 +1,7 @@
1
1
  import { jsx as s } from "react/jsx-runtime";
2
2
  import { c as m } from "./clsx-AexbMWKp.js";
3
3
  import { Popover as r } from "react-aria-components";
4
- import { s as a } from "./ListBox-BmONCo_D.js";
4
+ import { s as a } from "./ListBox-CRtyHPj1.js";
5
5
  import { T as p } from "./Text-D0r_W4lH.js";
6
6
  import '../assets/ListBoxEmptyState.css';const n = ({
7
7
  className: t,
@@ -1,6 +1,6 @@
1
1
  import { jsx as o, jsxs as m, Fragment as c } from "react/jsx-runtime";
2
2
  import { c as i } from "./clsx-AexbMWKp.js";
3
- import { s as e } from "./ListBox-BmONCo_D.js";
3
+ import { s as e } from "./ListBox-CRtyHPj1.js";
4
4
  import { ListBoxItem as x, ListBoxSection as d, ListBoxLoadMoreItem as l, Header as L } from "react-aria-components";
5
5
  import { S as B } from "./Spinner-CfKMn18u.js";
6
6
  import { u as p } from "./useLocalizedStringFormatter-BHvsRxDk.js";
@@ -1,10 +1,10 @@
1
- import { jsx as r, jsxs as d, Fragment as l } from "react/jsx-runtime";
1
+ import { jsx as r, jsxs as i, Fragment as l } from "react/jsx-runtime";
2
2
  import { forwardRef as f } from "react";
3
- import { useContextProps as v, PopoverContext as h, Popover as w, composeRenderProps as x, OverlayArrow as P } from "react-aria-components";
3
+ import { useContextProps as v, PopoverContext as h, Popover as w, composeRenderProps as P, OverlayArrow as x } from "react-aria-components";
4
4
  import { c as _ } from "./clsx-AexbMWKp.js";
5
- import '../assets/Popover.css';const g = "_popover_1sqxu_1", u = "_arrow_1sqxu_23", e = {
5
+ import '../assets/Popover.css';const g = "_popover_1k0dj_1", j = "_arrow_1k0dj_25", e = {
6
6
  popover: g,
7
- arrow: u
7
+ arrow: j
8
8
  }, y = f((s, t) => {
9
9
  const [o, p] = v(s, t, h), { className: a, hideArrow: c = !1, offset: n = 4, ...m } = o;
10
10
  return /* @__PURE__ */ r(
@@ -14,8 +14,8 @@ import '../assets/Popover.css';const g = "_popover_1sqxu_1", u = "_arrow_1sqxu_2
14
14
  offset: n,
15
15
  ref: p,
16
16
  ...m,
17
- children: x(o.children, (i) => /* @__PURE__ */ d(l, { children: [
18
- !c && /* @__PURE__ */ r(P, { className: e.arrow, children: /* @__PURE__ */ r(
17
+ children: P(o.children, (d) => /* @__PURE__ */ i(l, { children: [
18
+ !c && /* @__PURE__ */ r(x, { className: e.arrow, children: /* @__PURE__ */ r(
19
19
  "svg",
20
20
  {
21
21
  height: 16,
@@ -24,7 +24,7 @@ import '../assets/Popover.css';const g = "_popover_1sqxu_1", u = "_arrow_1sqxu_2
24
24
  children: /* @__PURE__ */ r("path", { d: "M0 0 L8 8 L16 0" })
25
25
  }
26
26
  ) }),
27
- i
27
+ d
28
28
  ] }))
29
29
  }
30
30
  );
@@ -0,0 +1,53 @@
1
+ import { jsx as e, jsxs as _, Fragment as v } from "react/jsx-runtime";
2
+ import { ProgressBar as h } from "react-aria-components";
3
+ import { L as t } from "./Label-Cg0aAlnt.js";
4
+ import { c as l } from "./clsx-AexbMWKp.js";
5
+ import '../assets/ProgressBar.css';const d = "_progressBar_1hwve_1", f = "_label_1hwve_9", N = "_value_1hwve_14", g = "_bar_1hwve_19", p = "_fill_1hwve_29", a = {
6
+ progressBar: d,
7
+ label: f,
8
+ value: N,
9
+ bar: g,
10
+ fill: p
11
+ }, y = ({
12
+ label: r,
13
+ labelProps: s,
14
+ showValueLabel: m = !1,
15
+ ...c
16
+ }) => /* @__PURE__ */ e(
17
+ h,
18
+ {
19
+ ...c,
20
+ className: l(a.progressBar, c.className),
21
+ children: ({ percentage: i, valueText: n, isIndeterminate: o }) => /* @__PURE__ */ _(v, { children: [
22
+ r && /* @__PURE__ */ e(
23
+ t,
24
+ {
25
+ elementType: "span",
26
+ ...s,
27
+ className: l(s?.className, a.label),
28
+ children: r
29
+ }
30
+ ),
31
+ m && /* @__PURE__ */ e(
32
+ t,
33
+ {
34
+ elementType: "span",
35
+ ...s,
36
+ id: r ? "" : s?.id,
37
+ className: l(s?.className, a.value),
38
+ children: n
39
+ }
40
+ ),
41
+ /* @__PURE__ */ e("div", { className: a.bar, children: /* @__PURE__ */ e(
42
+ "div",
43
+ {
44
+ className: a.fill,
45
+ style: { width: `${o ? 50 : i}%` }
46
+ }
47
+ ) })
48
+ ] })
49
+ }
50
+ );
51
+ export {
52
+ y as P
53
+ };
@@ -0,0 +1,44 @@
1
+ 'use client';
2
+ import { jsx as o, 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-Cg0aAlnt.js";
6
+ import { T as E } from "./Text-D0r_W4lH.js";
7
+ import { F as t } from "./FieldError-krpMBtie.js";
8
+ import '../assets/Radio.css';const F = "_radioGroup_1oic0_1", L = "_wrap_1oic0_12", N = "_radio_1oic0_1", i = {
9
+ radioGroup: F,
10
+ wrap: L,
11
+ radio: N
12
+ }, g = ({
13
+ label: r,
14
+ description: a,
15
+ errorMessage: d,
16
+ children: c,
17
+ className: e,
18
+ errorPosition: s = "top",
19
+ popover: m,
20
+ ...l
21
+ }) => /* @__PURE__ */ o(
22
+ h,
23
+ {
24
+ ...l,
25
+ className: p(i.radioGroup, e),
26
+ children: G(c, (n) => /* @__PURE__ */ u(_, { children: [
27
+ /* @__PURE__ */ o(x, { popover: m, children: r && /* @__PURE__ */ o(w, { children: r }) }),
28
+ a && /* @__PURE__ */ o(E, { slot: "description", children: a }),
29
+ s === "top" && /* @__PURE__ */ o(t, { "data-testid": "fieldError", children: d }),
30
+ /* @__PURE__ */ o(R, { className: i.wrap, children: n }),
31
+ s === "bottom" && /* @__PURE__ */ o(t, { "data-testid": "fieldError", children: d })
32
+ ] }))
33
+ }
34
+ ), k = ({ className: r, ...a }) => /* @__PURE__ */ o(
35
+ f,
36
+ {
37
+ className: p(i.radio, r),
38
+ ...a
39
+ }
40
+ );
41
+ export {
42
+ k as R,
43
+ g as a
44
+ };
@@ -3,7 +3,7 @@ import { RangeCalendarContext as h, CalendarGrid as C, CalendarCell as v, Calend
3
3
  import { c as y, a as l } from "./clsx-AexbMWKp.js";
4
4
  import { F as s } from "./FieldError-krpMBtie.js";
5
5
  import * as f from "react";
6
- import { B as i } from "./Button-D22xOe8j.js";
6
+ import { B as i } from "./Button-GCROAMSl.js";
7
7
  import { H as g } from "./Heading-nfcRc2QF.js";
8
8
  import { c as R } from "./createLucideIcon-CP-mMPfa.js";
9
9
  import { C as x } from "./chevron-right-DvXGOiS_.js";
@@ -0,0 +1,118 @@
1
+ 'use client';
2
+ import { jsx as i, jsxs as s, Fragment as F } from "react/jsx-runtime";
3
+ import { useSlottedContext as j, FormContext as N, SearchField as g, Input as y } from "react-aria-components";
4
+ import { s as B } from "./TextField.module-BDIbEV87.js";
5
+ import { B as u } from "./Button-GCROAMSl.js";
6
+ import { c as o } from "./clsx-AexbMWKp.js";
7
+ import { F as h } from "./FieldError-krpMBtie.js";
8
+ import { c as C } from "./createLucideIcon-CP-mMPfa.js";
9
+ import { X as k } from "./x-B9bYxG31.js";
10
+ import { u as I } from "./useLocalizedStringFormatter-BHvsRxDk.js";
11
+ import '../assets/SearchField.css';const D = [
12
+ ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
13
+ ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
14
+ ], E = C("search", D), L = "_container_1msv3_1", T = "_inner_1msv3_10", V = "_inputContainer_1msv3_15", $ = "_medium_1msv3_21", w = "_icon_1msv3_26", O = "_clear_1msv3_38", P = "_input_1msv3_15", n = {
15
+ container: L,
16
+ inner: T,
17
+ inputContainer: V,
18
+ medium: $,
19
+ icon: w,
20
+ clear: O,
21
+ input: P
22
+ }, X = { search: "Search" }, q = { search: "Sök" }, A = {
23
+ en: X,
24
+ sv: q
25
+ };
26
+ function G(a) {
27
+ return !!a?.length;
28
+ }
29
+ const z = ({
30
+ errorPosition: a = "top",
31
+ size: r = "large",
32
+ showButton: _,
33
+ className: v,
34
+ errorMessage: m,
35
+ placeholder: l,
36
+ validationBehavior: f,
37
+ ...e
38
+ }) => {
39
+ const S = I(A), b = j(N), p = f ?? b?.validationBehavior ?? "aria", x = _ !== !1, d = (t) => {
40
+ !t || e.isInvalid || e.validate && G(e.validate(t)) || e.onSubmit?.(t);
41
+ };
42
+ return /* @__PURE__ */ i(
43
+ g,
44
+ {
45
+ ...e,
46
+ onSubmit: d,
47
+ "aria-label": e["aria-label"] ?? l,
48
+ className: o(n.container, v),
49
+ validationBehavior: p,
50
+ children: ({ state: t }) => /* @__PURE__ */ s(F, { children: [
51
+ a === "top" && /* @__PURE__ */ i(h, { children: ({ validationErrors: c }) => m ?? c.join(" ") }),
52
+ /* @__PURE__ */ s("div", { className: n.inner, children: [
53
+ /* @__PURE__ */ s(
54
+ "div",
55
+ {
56
+ className: o(n.inputContainer, {
57
+ [n.medium]: r === "medium"
58
+ }),
59
+ children: [
60
+ /* @__PURE__ */ i(
61
+ E,
62
+ {
63
+ size: 20,
64
+ className: n.icon
65
+ }
66
+ ),
67
+ /* @__PURE__ */ i(
68
+ y,
69
+ {
70
+ placeholder: l,
71
+ className: o(
72
+ B.input,
73
+ n.input,
74
+ { [n.medium]: r === "medium" }
75
+ )
76
+ }
77
+ ),
78
+ t.value.length > 0 && /* @__PURE__ */ i(
79
+ u,
80
+ {
81
+ variant: "icon",
82
+ size: r,
83
+ className: o(n.clear, {
84
+ [n.medium]: r === "medium"
85
+ }),
86
+ children: /* @__PURE__ */ i(
87
+ k,
88
+ {
89
+ size: 20,
90
+ "aria-hidden": !0
91
+ }
92
+ )
93
+ }
94
+ )
95
+ ]
96
+ }
97
+ ),
98
+ x && /* @__PURE__ */ i(
99
+ u,
100
+ {
101
+ slot: null,
102
+ excludeFromTabOrder: !0,
103
+ size: r,
104
+ isDisabled: e.isDisabled,
105
+ type: "button",
106
+ onPress: () => d(t.value),
107
+ children: e.buttonText ?? S.format("search")
108
+ }
109
+ )
110
+ ] }),
111
+ a === "bottom" && /* @__PURE__ */ i(h, { children: ({ validationErrors: c }) => m ?? c.join(" ") })
112
+ ] })
113
+ }
114
+ );
115
+ };
116
+ export {
117
+ z as S
118
+ };