@midas-ds/components 16.0.0 → 16.2.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 (62) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/accordion/index.js +1 -1
  3. package/assets/AccordionItem.css +1 -1
  4. package/assets/Checkbox.css +1 -1
  5. package/assets/ComboBox.css +1 -1
  6. package/assets/Dialog.css +1 -1
  7. package/assets/Layout.css +1 -1
  8. package/assets/ListBox.css +1 -1
  9. package/assets/Popover.css +1 -1
  10. package/assets/ProgressBar.css +1 -1
  11. package/assets/Radio.css +1 -1
  12. package/assets/Select.css +1 -1
  13. package/assets/Select2.css +1 -1
  14. package/assets/Table.css +1 -1
  15. package/assets/Toast.css +1 -1
  16. package/assets/Tooltip.css +1 -1
  17. package/assets/default.css +1 -1
  18. package/checkbox/index.js +2 -2
  19. package/chunks/AccordionItem-BUUDZ7l6.js +128 -0
  20. package/chunks/{Checkbox-ClhO-AzB.js → Checkbox-CP6Nv9yx.js} +25 -25
  21. package/chunks/{CheckboxGroup-dofHjXkU.js → CheckboxGroup-C5kaqBcn.js} +2 -2
  22. package/chunks/ComboBox-N97lv5kN.js +108 -0
  23. package/chunks/{DateField-ltU-Jvra.js → DateField-DeuLPe1Y.js} +1 -1
  24. package/chunks/{DateRangePicker-CdoVIV-F.js → DateRangePicker-BqjLArNi.js} +1 -1
  25. package/chunks/Dialog-DC0cGNj5.js +66 -0
  26. package/chunks/{Label-DqmNWnmm.js → Label-Dup4lWaR.js} +1 -1
  27. package/chunks/{Layout-DtwVUZus.js → Layout-BFZSROTl.js} +95 -95
  28. package/chunks/{ListBox-D4tO_OrO.js → ListBox-D5BBeZWL.js} +12 -12
  29. package/chunks/{ListBoxLoadMoreItem-D9X8YnwD.js → ListBoxLoadMoreItem-CB67meAb.js} +1 -1
  30. package/chunks/{ListBoxSection-DKHba2X0.js → ListBoxSection-MZB_5DdD.js} +1 -1
  31. package/chunks/{Popover-D9tAN-g7.js → Popover-BcEtFiU1.js} +8 -8
  32. package/chunks/ProgressBar-CbwvcHvk.js +53 -0
  33. package/chunks/Radio-Dro99zCs.js +43 -0
  34. package/chunks/{Select-Bcu1yvbR.js → Select-D-LtFSZX.js} +42 -42
  35. package/chunks/{Select-DAlreRs2.js → Select-nL9iJMlf.js} +117 -117
  36. package/chunks/{Table-B1rlSIhS.js → Table-CgBjwlIi.js} +47 -47
  37. package/chunks/{TextArea-CEiOylOx.js → TextArea-CRvbqqVZ.js} +1 -1
  38. package/chunks/{Toast-DgQ6BTmK.js → Toast-DTwUGSJ8.js} +39 -39
  39. package/chunks/{Tooltip-uNMG_UU-.js → Tooltip-m032jGgF.js} +5 -5
  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/index.js +21 -21
  44. package/label/index.js +1 -1
  45. package/layout/index.js +1 -1
  46. package/legacy-select/index.js +1 -1
  47. package/list-box/index.js +3 -3
  48. package/modal/index.js +1 -1
  49. package/package.json +2 -2
  50. package/popover/index.js +1 -1
  51. package/progress-bar/index.js +1 -1
  52. package/radio/index.js +1 -1
  53. package/select/index.js +1 -1
  54. package/table/index.js +1 -1
  55. package/textfield/index.js +1 -1
  56. package/toast/index.js +1 -1
  57. package/tooltip/index.js +1 -1
  58. package/chunks/AccordionItem-O3_wicV2.js +0 -128
  59. package/chunks/ComboBox-XQqP_jga.js +0 -108
  60. package/chunks/Dialog-x-HLOQFU.js +0 -66
  61. package/chunks/ProgressBar-DXBCKRe_.js +0 -53
  62. package/chunks/Radio-C1AFopLt.js +0 -43
@@ -1,25 +1,25 @@
1
1
  import { jsxs as v, jsx as t } from "react/jsx-runtime";
2
- import * as i from "react";
2
+ import * as c from "react";
3
3
  import f from "react";
4
4
  import { mergeProps as u, VisuallyHidden as k, useCheckboxGroupItem as C, useCheckbox as R, useHover as _, usePress as I, useFocusRing as P } from "react-aria";
5
- import { useContextProps as g, CheckboxContext as G, useSlottedContext as y, FormContext as w } from "react-aria-components";
5
+ import { useContextProps as g, CheckboxContext as G, useSlottedContext as y, FormContext as z } from "react-aria-components";
6
6
  import { a as h } from "./clsx-AexbMWKp.js";
7
7
  import { variables as m } from "@midas-ds/theme";
8
- import { c as B } from "./createLucideIcon-D4r5Phnh.js";
9
- import { C as F } from "./check-BxlvVsvD.js";
10
- import { useToggleState as L } from "@react-stately/toggle";
11
- import '../assets/Checkbox.css';const N = [["path", { d: "M5 12h14", key: "1ays0h" }]], S = B("minus", N), D = f.createContext(null), H = "_checkboxInner_19c98_1", O = "_checkbox_19c98_1", j = "_checkboxGroup_19c98_143", q = "_checkboxList_19c98_154", x = {
12
- checkboxInner: H,
13
- checkbox: O,
14
- checkboxGroup: j,
15
- checkboxList: q
16
- }, b = i.forwardRef((e, o) => {
17
- const { hoverProps: c, isHovered: s } = e.hoverResult, { pressProps: n, isPressed: a } = e.pressResult, { isFocused: r, isFocusVisible: d, focusProps: l } = e.focusRingAria;
8
+ import { c as w } from "./createLucideIcon-D4r5Phnh.js";
9
+ import { C as B } from "./check-BxlvVsvD.js";
10
+ import { useToggleState as F } from "@react-stately/toggle";
11
+ import '../assets/Checkbox.css';const L = [["path", { d: "M5 12h14", key: "1ays0h" }]], N = w("minus", L), S = f.createContext(null), D = "_checkboxInner_tzrii_1", H = "_checkbox_tzrii_1", O = "_checkboxGroup_tzrii_143", j = "_checkboxList_tzrii_154", x = {
12
+ checkboxInner: D,
13
+ checkbox: H,
14
+ checkboxGroup: O,
15
+ checkboxList: j
16
+ }, b = c.forwardRef((e, o) => {
17
+ const { hoverProps: i, isHovered: s } = e.hoverResult, { pressProps: n, isPressed: a } = e.pressResult, { isFocused: r, isFocusVisible: d, focusProps: l } = e.focusRingAria;
18
18
  return /* @__PURE__ */ v(
19
19
  "label",
20
20
  {
21
21
  ref: o,
22
- ...u(c, n, e.labelProps),
22
+ ...u(i, n, e.labelProps),
23
23
  slot: e.slot || void 0,
24
24
  className: h(x.checkbox, e.className),
25
25
  "data-hovered": s || void 0,
@@ -34,13 +34,13 @@ import '../assets/Checkbox.css';const N = [["path", { d: "M5 12h14", key: "1ays0
34
34
  "data-required": e.isRequired || void 0,
35
35
  children: [
36
36
  /* @__PURE__ */ t("div", { className: h(x.checkboxInner), children: e.isIndeterminate ? /* @__PURE__ */ t(
37
- S,
37
+ N,
38
38
  {
39
39
  size: 14,
40
40
  color: m.iconOnColor
41
41
  }
42
42
  ) : /* @__PURE__ */ t(
43
- F,
43
+ B,
44
44
  {
45
45
  size: 14,
46
46
  color: m.iconOnColor
@@ -57,8 +57,8 @@ import '../assets/Checkbox.css';const N = [["path", { d: "M5 12h14", key: "1ays0
57
57
  ]
58
58
  }
59
59
  );
60
- }), z = i.forwardRef((e, o) => {
61
- const c = C(
60
+ }), q = c.forwardRef((e, o) => {
61
+ const i = C(
62
62
  {
63
63
  ...e,
64
64
  value: e.value || ""
@@ -70,29 +70,29 @@ import '../assets/Checkbox.css';const N = [["path", { d: "M5 12h14", key: "1ays0
70
70
  b,
71
71
  {
72
72
  ...e,
73
- ...c,
73
+ ...i,
74
74
  ref: o
75
75
  }
76
76
  );
77
- }), A = i.forwardRef((e, o) => {
78
- const c = R(e, L(e), e.inputRef);
77
+ }), A = c.forwardRef((e, o) => {
78
+ const i = R(e, F(e), e.inputRef);
79
79
  return /* @__PURE__ */ t(
80
80
  b,
81
81
  {
82
82
  ...e,
83
- ...c,
83
+ ...i,
84
84
  ref: o
85
85
  }
86
86
  );
87
- }), X = i.forwardRef(
87
+ }), X = c.forwardRef(
88
88
  (e, o) => {
89
89
  [e, o] = g(e, o, G);
90
- const c = y(w), s = e.validationBehavior ?? c?.validationBehavior ?? "native", n = i.useContext(D), a = i.useRef(null), r = _(e), d = I({
90
+ const i = y(z), s = e.validationBehavior ?? i?.validationBehavior ?? "native", n = c.useContext(S), a = c.useRef(null), r = _(e), d = I({
91
91
  ref: o,
92
92
  isDisabled: e.isDisabled
93
93
  }), l = P();
94
94
  return n ? /* @__PURE__ */ t(
95
- z,
95
+ q,
96
96
  {
97
97
  ...e,
98
98
  state: n,
@@ -117,6 +117,6 @@ import '../assets/Checkbox.css';const N = [["path", { d: "M5 12h14", key: "1ays0
117
117
  );
118
118
  export {
119
119
  X as C,
120
- D as a,
120
+ S as a,
121
121
  x as s
122
122
  };
@@ -1,10 +1,10 @@
1
1
  import { jsx as o, jsxs as h } from "react/jsx-runtime";
2
2
  import { useCheckboxGroup as C } from "react-aria";
3
3
  import { useCheckboxGroupState as v } from "react-stately";
4
- import { a as k, L as S } from "./Label-DqmNWnmm.js";
4
+ import { a as k, L as S } from "./Label-Dup4lWaR.js";
5
5
  import { T as y } from "./Text-TWzJxnto.js";
6
6
  import * as r from "react";
7
- import { C as d, s as u, a as g } from "./Checkbox-ClhO-AzB.js";
7
+ import { C as d, s as u, a as g } from "./Checkbox-CP6Nv9yx.js";
8
8
  import { FieldErrorContext as A } from "react-aria-components";
9
9
  import { F as P } from "./FieldError-C0HRIcAx.js";
10
10
  import { u as V } from "./useLocalizedStringFormatter-ZgRJmvHC.js";
@@ -0,0 +1,108 @@
1
+ import { jsxs as l, jsx as o } from "react/jsx-runtime";
2
+ import g from "react";
3
+ import { ComboBox as y, Input as B, Button as F, Collection as w } from "react-aria-components";
4
+ import { c as s } from "./clsx-AexbMWKp.js";
5
+ import { a as C, L as S } from "./Label-Dup4lWaR.js";
6
+ import { T as u } from "./Text-TWzJxnto.js";
7
+ import { F as h } from "./FieldError-C0HRIcAx.js";
8
+ import { L as v } from "./ListBox-D5BBeZWL.js";
9
+ import { a as R, L as N, b as E } from "./ListBoxSection-MZB_5DdD.js";
10
+ import { C as I } from "./chevron-down-DgT-uSF9.js";
11
+ import { u as T } from "./useLocalizedStringFormatter-ZgRJmvHC.js";
12
+ import '../assets/ComboBox.css';const j = "_combobox_47hgd_1", O = "_inputField_47hgd_6", U = "_medium_47hgd_28", z = "_wrap_47hgd_74", D = "_button_47hgd_80", M = "_icon_47hgd_116", V = "_emptyState_47hgd_122", t = {
13
+ combobox: j,
14
+ inputField: O,
15
+ medium: U,
16
+ wrap: z,
17
+ button: D,
18
+ icon: M,
19
+ emptyState: V
20
+ }, W = { showList: "Show list", noResultsFound: "No results found" }, $ = { showList: "Visa lista", noResultsFound: "Inga träffar" }, k = {
21
+ en: W,
22
+ sv: $
23
+ };
24
+ function to({
25
+ label: e,
26
+ description: i,
27
+ errorMessage: r,
28
+ children: p,
29
+ items: f,
30
+ className: _,
31
+ errorPosition: a = "top",
32
+ size: m = "large",
33
+ popover: b,
34
+ ...n
35
+ }) {
36
+ const d = g.useRef(null), c = T(k), x = (L) => {
37
+ L.currentTarget.value && d.current?.select();
38
+ };
39
+ return /* @__PURE__ */ l(
40
+ y,
41
+ {
42
+ className: s(t.combobox, _),
43
+ ...n,
44
+ "data-readonly": n.isReadOnly || void 0,
45
+ children: [
46
+ /* @__PURE__ */ o(C, { popover: b, children: e && /* @__PURE__ */ o(S, { children: e }) }),
47
+ i && /* @__PURE__ */ o(u, { slot: "description", children: i }),
48
+ a === "top" && /* @__PURE__ */ o(h, { "data-testid": "fieldError", children: r }),
49
+ /* @__PURE__ */ l("div", { className: t.wrap, children: [
50
+ /* @__PURE__ */ o(
51
+ B,
52
+ {
53
+ className: s(t.inputField, {
54
+ [t.medium]: m === "medium"
55
+ }),
56
+ "data-readonly": n.isReadOnly || void 0,
57
+ onMouseUp: x,
58
+ ref: d
59
+ }
60
+ ),
61
+ /* @__PURE__ */ o(
62
+ F,
63
+ {
64
+ className: s(t.button, {
65
+ [t.medium]: m === "medium"
66
+ }),
67
+ "aria-label": c.format("showList"),
68
+ children: /* @__PURE__ */ o(
69
+ "div",
70
+ {
71
+ className: t.icon,
72
+ "aria-hidden": "true",
73
+ children: /* @__PURE__ */ o(
74
+ I,
75
+ {
76
+ size: 20,
77
+ "aria-hidden": !0
78
+ }
79
+ )
80
+ }
81
+ )
82
+ }
83
+ )
84
+ ] }),
85
+ a === "bottom" && /* @__PURE__ */ o(h, { "data-testid": "fieldError", children: r }),
86
+ /* @__PURE__ */ o(R, { children: /* @__PURE__ */ o(
87
+ v,
88
+ {
89
+ items: f,
90
+ renderEmptyState: () => /* @__PURE__ */ o(u, { className: t.emptyState, children: c.format("noResultsFound") }),
91
+ children: p
92
+ }
93
+ ) })
94
+ ]
95
+ }
96
+ );
97
+ }
98
+ function q(e) {
99
+ return /* @__PURE__ */ o(N, { ...e });
100
+ }
101
+ function eo(e) {
102
+ return /* @__PURE__ */ o(E, { ...e, children: /* @__PURE__ */ o(w, { items: e.children, children: (i) => /* @__PURE__ */ o(q, { children: i.name }, i.id) }) });
103
+ }
104
+ export {
105
+ to as C,
106
+ q as a,
107
+ eo as b
108
+ };
@@ -3,7 +3,7 @@ import { DateField as u } from "react-aria-components";
3
3
  import { c as m } from "./clsx-AexbMWKp.js";
4
4
  import { a as _, D as f } from "./DateInputDivider-CkTB5q5k.js";
5
5
  import { F as s } from "./FieldError-C0HRIcAx.js";
6
- import { a as h, L as D } from "./Label-DqmNWnmm.js";
6
+ import { a as h, L as D } from "./Label-Dup4lWaR.js";
7
7
  import { T as b } from "./Text-TWzJxnto.js";
8
8
  import '../assets/DateField.css';const x = "_dateField_y3sba_1", y = "_inputField_y3sba_7", L = "_medium_y3sba_37", i = {
9
9
  dateField: x,
@@ -4,7 +4,7 @@ import { a as m } from "./clsx-AexbMWKp.js";
4
4
  import { C as M, R as N } from "./RangeCalendar-CGk2btOp.js";
5
5
  import { a as p, D as k, b as B } from "./DateInputDivider-CkTB5q5k.js";
6
6
  import { F as h } from "./FieldError-C0HRIcAx.js";
7
- import { a as u, L as y } from "./Label-DqmNWnmm.js";
7
+ import { a as u, L as y } from "./Label-Dup4lWaR.js";
8
8
  import { T as _ } from "./Text-TWzJxnto.js";
9
9
  import { c as C } from "./createLucideIcon-D4r5Phnh.js";
10
10
  import '../assets/DateRangePicker.css';const I = [
@@ -0,0 +1,66 @@
1
+ import { jsx as o, jsxs as e } from "react/jsx-runtime";
2
+ import { ModalOverlay as n, Modal as c, Dialog as i } from "react-aria-components";
3
+ import { B as _ } from "./Button-wBgWrXj3.js";
4
+ import { H as y } from "./Heading-D8tNNJkt.js";
5
+ import { c as v } from "./clsx-AexbMWKp.js";
6
+ import { X as x } from "./x-BXShoIAM.js";
7
+ import { u as f } from "./useLocalizedStringFormatter-ZgRJmvHC.js";
8
+ import '../assets/Dialog.css';const h = "_modal_nxs78_1", p = "_overlay_nxs78_24", g = "_modalHeader_nxs78_48", B = "_modalTitle_nxs78_59", H = "_modalBody_nxs78_65", a = {
9
+ modal: h,
10
+ overlay: p,
11
+ modalHeader: g,
12
+ modalTitle: B,
13
+ modalBody: H
14
+ }, M = { close: "Close" }, N = { close: "Stäng" }, T = {
15
+ en: M,
16
+ sv: N
17
+ }, F = ({
18
+ children: s,
19
+ title: l,
20
+ hideCloseButton: r = !1,
21
+ className: t,
22
+ ...d
23
+ }) => {
24
+ const m = f(T);
25
+ return /* @__PURE__ */ o(
26
+ n,
27
+ {
28
+ ...d,
29
+ className: v(a.overlay, t),
30
+ children: /* @__PURE__ */ o(c, { className: a.modal, children: /* @__PURE__ */ e(i, { children: [
31
+ /* @__PURE__ */ e("div", { className: a.modalHeader, children: [
32
+ /* @__PURE__ */ o("div", { className: a.modalTitle, children: l && /* @__PURE__ */ o(
33
+ y,
34
+ {
35
+ level: 3,
36
+ elementType: "h2",
37
+ slot: "title",
38
+ children: l
39
+ }
40
+ ) }),
41
+ !r && /* @__PURE__ */ o(
42
+ _,
43
+ {
44
+ slot: "close",
45
+ variant: "tertiary",
46
+ icon: x,
47
+ iconPlacement: "right",
48
+ children: m.format("close")
49
+ }
50
+ )
51
+ ] }),
52
+ /* @__PURE__ */ o(
53
+ "div",
54
+ {
55
+ className: a.modalBody,
56
+ tabIndex: -1,
57
+ children: s
58
+ }
59
+ )
60
+ ] }) })
61
+ }
62
+ );
63
+ };
64
+ export {
65
+ F as M
66
+ };
@@ -3,7 +3,7 @@ import * as b from "react";
3
3
  import s from "react";
4
4
  import { c as f } from "./clsx-AexbMWKp.js";
5
5
  import { DialogTrigger as v, Label as d } from "react-aria-components";
6
- import { P as g } from "./Popover-D9tAN-g7.js";
6
+ import { P as g } from "./Popover-BcEtFiU1.js";
7
7
  import { B as u } from "./Button-wBgWrXj3.js";
8
8
  import { I as P } from "./info-kdfED7Wh.js";
9
9
  import { u as _ } from "./useLocalizedStringFormatter-ZgRJmvHC.js";