@midas-ds/components 17.33.6 → 17.33.7

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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 17.33.7 (2026-11-11)
2
+
3
+ ### 🩹 Fixes
4
+
5
+ - **components,date-field,date-picker:** scroll segments in narrow fields ([a7ec7513411](https://github.com/migrationsverket/midas/commit/a7ec7513411))
6
+
1
7
  ## 17.33.6 (2026-11-09)
2
8
 
3
9
  ### 🩹 Fixes
@@ -1 +1 @@
1
- ._dateField_t65wr_1{font-family:var(--midas-typography-font-family);flex-direction:column;align-items:flex-start;display:flex}._dateField_t65wr_1[data-readonly] ._inputField_t65wr_7{border-bottom-color:var(--midas-border-color-subtle);background-color:#0000}._dateField_t65wr_1[data-disabled] ._inputField_t65wr_7{color:var(--midas-text-disabled);cursor:not-allowed;border-bottom-color:var(--midas-border-color-disabled);background-color:var(--midas-field-disabled,var(--midas-field-01-disabled))}._dateField_t65wr_1[data-invalid] ._inputField_t65wr_7{box-shadow:var(--midas-state-invalid);border:none}._inputField_t65wr_7{box-sizing:border-box;width:100%;min-height:var(--midas-size-control);background-color:var(--midas-field-base,var(--midas-field-01-base));border:1px solid #0000;border-bottom-color:var(--midas-border-color-primary);justify-content:space-between;align-items:center;padding:0 0 0 1rem;display:flex;position:relative}._inputField_t65wr_7._medium_t65wr_41{min-height:var(--midas-size-control-md)}._dateField_t65wr_1:not([data-disabled],[data-readonly]) ._inputField_t65wr_7 [data-hovered]{background-color:var(--midas-field-hover,var(--midas-field-01-hover))}._clearButton_t65wr_50{background-color:#0000;border:none}@media (forced-colors:active){._inputField_t65wr_7{border:1px solid var(--midas-border-color-primary)}}._dateSegment_15g5c_1{color:var(--midas-text-primary);text-transform:uppercase;padding:0 .125rem}._dateSegment_15g5c_1[data-disabled]{color:var(--midas-text-disabled)}._dateSegment_15g5c_1:focus-visible,._dateSegment_15g5c_1[data-focus-visible]{box-shadow:var(--midas-state-focus);outline:none}@media (forced-colors:active){._dateSegment_15g5c_1:focus-visible,._dateSegment_15g5c_1[data-focus-visible]{outline:1px solid}}._dateSegment_15g5c_1[data-placeholder]{color:var(--midas-text-placeholder)}._dateInput_14x1f_1{display:flex}._dateInput_14x1f_1 div:focus-visible,._dateInput_14x1f_1 div[data-focus-visible]{box-shadow:var(--midas-state-focus);outline:none}@media (forced-colors:active){._dateInput_14x1f_1 div:focus-visible,._dateInput_14x1f_1 div[data-focus-visible]{outline-offset:0;outline:3px solid highlight}}._dateInput_14x1f_1 div[data-readonly=true]{color:var(--midas-text-primary);padding:0 2px}._divider_14x1f_21{color:var(--midas-text-primary)}
1
+ ._dateField_1w6t6_1{font-family:var(--midas-typography-font-family);flex-direction:column;align-items:flex-start;display:flex}._dateField_1w6t6_1[data-readonly] ._inputField_1w6t6_7{border-bottom-color:var(--midas-border-color-subtle);background-color:#0000}._dateField_1w6t6_1[data-disabled] ._inputField_1w6t6_7{color:var(--midas-text-disabled);cursor:not-allowed;border-bottom-color:var(--midas-border-color-disabled);background-color:var(--midas-field-disabled,var(--midas-field-01-disabled))}._dateField_1w6t6_1[data-invalid] ._inputField_1w6t6_7{box-shadow:var(--midas-state-invalid);border:none}._inputField_1w6t6_7{box-sizing:border-box;width:100%;min-height:var(--midas-size-control);background-color:var(--midas-field-base,var(--midas-field-01-base));border:1px solid #0000;border-bottom-color:var(--midas-border-color-primary);padding-left:calc(var(--midas-space-medium) - var(--midas-space-xsmall));justify-content:space-between;align-items:center;display:flex;position:relative}._inputField_1w6t6_7._medium_1w6t6_43{min-height:var(--midas-size-control-md)}._dateField_1w6t6_1:not([data-disabled],[data-readonly]) ._inputField_1w6t6_7 [data-hovered]{background-color:var(--midas-field-hover,var(--midas-field-01-hover))}._clearButton_1w6t6_52{background-color:#0000;border:none}@media (forced-colors:active){._inputField_1w6t6_7{border:1px solid var(--midas-border-color-primary)}}._dateInput_u92xb_1{display:flex}._dateInput_u92xb_1 div:focus-visible,._dateInput_u92xb_1 div[data-focus-visible]{box-shadow:var(--midas-state-focus);outline:none}@media (forced-colors:active){._dateInput_u92xb_1 div:focus-visible,._dateInput_u92xb_1 div[data-focus-visible]{outline-offset:0;outline:3px solid highlight}}._dateInput_u92xb_1 div[data-readonly=true]{color:var(--midas-text-primary);padding:0 2px}._divider_u92xb_21{color:var(--midas-text-primary)}._scroller_u92xb_31{align-items:center;gap:var(--midas-space-medium);min-width:0;padding:var(--midas-space-xsmall);scroll-padding-inline:var(--midas-space-xsmall);scrollbar-width:none;white-space:nowrap;flex:1;display:flex;overflow:auto clip}._dateSegment_15g5c_1{color:var(--midas-text-primary);text-transform:uppercase;padding:0 .125rem}._dateSegment_15g5c_1[data-disabled]{color:var(--midas-text-disabled)}._dateSegment_15g5c_1:focus-visible,._dateSegment_15g5c_1[data-focus-visible]{box-shadow:var(--midas-state-focus);outline:none}@media (forced-colors:active){._dateSegment_15g5c_1:focus-visible,._dateSegment_15g5c_1[data-focus-visible]{outline:1px solid}}._dateSegment_15g5c_1[data-placeholder]{color:var(--midas-text-placeholder)}
@@ -1 +1 @@
1
- ._dropdownAnimation_1ljkv_4{opacity:1;transition:opacity var(--midas-transition-duration-quick) var(--midas-transition-timing-ease-out)}._dropdownAnimation_1ljkv_4[data-entering]{opacity:0}._dropdownAnimation_1ljkv_4[data-exiting]{opacity:0;transition-timing-function:var(--midas-transition-timing-ease-in)}@media (prefers-reduced-motion){._dropdownAnimation_1ljkv_4{transition:none}}._datePicker_14wog_1{font-family:var(--midas-typography-font-family);flex-direction:column;align-items:flex-start;display:flex}._inputField_14wog_8{box-sizing:border-box;width:100%;height:var(--midas-size-control);background-color:var(--midas-field-base,var(--midas-field-01-base));border-bottom:1px solid var(--midas-border-color-primary);justify-content:flex-start;align-items:center;gap:1rem;padding-left:1rem;display:flex}@media (forced-colors:active){._inputField_14wog_8{border:1px solid var(--midas-border-color-primary)}}._inputField_14wog_8._medium_14wog_24{height:var(--midas-size-control-md)}._inputField_14wog_8[data-disabled]{cursor:not-allowed;border-color:var(--midas-border-color-disabled)}._inputField_14wog_8:focus-visible,._inputField_14wog_8[data-focus-visible]{outline:none}._inputField_14wog_8[data-invalid]{box-shadow:var(--midas-state-invalid);border:none}@media (forced-colors:active){._inputField_14wog_8[data-invalid]{border:1px solid var(--midas-border-color-primary)}}._inputField_14wog_8._readOnly_14wog_47{border-color:var(--midas-border-color-subtle);background-color:#0000}._inputField_14wog_8 ._buttonGroup_14wog_52{height:100%;margin-left:auto;display:flex}._inputField_14wog_8 ._iconButton_14wog_58{aspect-ratio:1;border:none;height:100%;padding:0}._inputField_14wog_8 ._iconButton_14wog_58[data-disabled]{background-color:#0000}._inputField_14wog_8 ._iconButton_14wog_58:focus-visible,._inputField_14wog_8 ._iconButton_14wog_58[data-focus-visible]{box-shadow:var(--midas-state-focus-inset);outline:none}@media (forced-colors:active){._inputField_14wog_8 ._iconButton_14wog_58:focus-visible,._inputField_14wog_8 ._iconButton_14wog_58[data-focus-visible]{outline-offset:2px;outline:3px solid highlight}}._popover_14wog_81{box-shadow:0 3px 5px #0003}
1
+ ._dropdownAnimation_1ljkv_4{opacity:1;transition:opacity var(--midas-transition-duration-quick) var(--midas-transition-timing-ease-out)}._dropdownAnimation_1ljkv_4[data-entering]{opacity:0}._dropdownAnimation_1ljkv_4[data-exiting]{opacity:0;transition-timing-function:var(--midas-transition-timing-ease-in)}@media (prefers-reduced-motion){._dropdownAnimation_1ljkv_4{transition:none}}._datePicker_g3zwq_1{font-family:var(--midas-typography-font-family);flex-direction:column;align-items:flex-start;display:flex}._inputField_g3zwq_8{box-sizing:border-box;width:100%;height:var(--midas-size-control);background-color:var(--midas-field-base,var(--midas-field-01-base));border-bottom:1px solid var(--midas-border-color-primary);padding-left:calc(var(--midas-space-medium) - var(--midas-space-xsmall));justify-content:flex-start;align-items:center;display:flex}@media (forced-colors:active){._inputField_g3zwq_8{border:1px solid var(--midas-border-color-primary)}}._inputField_g3zwq_8._medium_g3zwq_25{height:var(--midas-size-control-md)}._inputField_g3zwq_8[data-disabled]{cursor:not-allowed;border-color:var(--midas-border-color-disabled)}._inputField_g3zwq_8:focus-visible,._inputField_g3zwq_8[data-focus-visible]{outline:none}._inputField_g3zwq_8[data-invalid]{box-shadow:var(--midas-state-invalid);border:none}@media (forced-colors:active){._inputField_g3zwq_8[data-invalid]{border:1px solid var(--midas-border-color-primary)}}._inputField_g3zwq_8._readOnly_g3zwq_48{border-color:var(--midas-border-color-subtle);background-color:#0000}._inputField_g3zwq_8 ._buttonGroup_g3zwq_53{height:100%;margin-left:auto;display:flex}._inputField_g3zwq_8 ._iconButton_g3zwq_59{aspect-ratio:1;border:none;height:100%;padding:0}._inputField_g3zwq_8 ._iconButton_g3zwq_59[data-disabled]{background-color:#0000}._inputField_g3zwq_8 ._iconButton_g3zwq_59:focus-visible,._inputField_g3zwq_8 ._iconButton_g3zwq_59[data-focus-visible]{box-shadow:var(--midas-state-focus-inset);outline:none}@media (forced-colors:active){._inputField_g3zwq_8 ._iconButton_g3zwq_59:focus-visible,._inputField_g3zwq_8 ._iconButton_g3zwq_59[data-focus-visible]{outline-offset:2px;outline:3px solid highlight}}._popover_g3zwq_82{box-shadow:0 3px 5px #0003}
@@ -12,11 +12,15 @@ import '../assets/date-field.css';var g = {
12
12
  en: { clear: "Clear date" },
13
13
  sv: { clear: "Rensa datum" }
14
14
  }, _ = {
15
- dateField: "_dateField_t65wr_1",
16
- inputField: "_inputField_t65wr_7",
17
- medium: "_medium_t65wr_41",
18
- clearButton: "_clearButton_t65wr_50"
19
- }, v = ({ isClearable: t, size: n, isDisabled: r, isReadOnly: i }) => {
15
+ dateField: "_dateField_1w6t6_1",
16
+ inputField: "_inputField_1w6t6_7",
17
+ medium: "_medium_1w6t6_43",
18
+ clearButton: "_clearButton_1w6t6_52"
19
+ }, v = {
20
+ dateInput: "_dateInput_u92xb_1",
21
+ divider: "_divider_u92xb_21",
22
+ scroller: "_scroller_u92xb_31"
23
+ }, y = ({ isClearable: t, size: n, isDisabled: r, isReadOnly: i }) => {
20
24
  let c = o(g), u = s.useContext(l), d = h();
21
25
  return t && u?.value != null && !i ? /* @__PURE__ */ f(a, {
22
26
  onPress: () => {
@@ -27,11 +31,11 @@ import '../assets/date-field.css';var g = {
27
31
  "aria-label": c.format("clear"),
28
32
  className: e(_.clearButton, { [_.medium]: n === "medium" })
29
33
  }) : null;
30
- }, y = s.forwardRef(({ className: a, description: o, errorMessage: s, errorPosition: l = "top", label: u, size: d = "large", popover: h, isClearable: g = !1, isReadOnly: y, isDisabled: b, ...S }, w) => /* @__PURE__ */ p(c, {
31
- ...S,
32
- ref: w,
33
- isReadOnly: y,
34
- isDisabled: b,
34
+ }, b = s.forwardRef(({ className: a, description: o, errorMessage: s, errorPosition: l = "top", label: u, size: d = "large", popover: h, isClearable: g = !1, isReadOnly: b, isDisabled: x, ...w }, T) => /* @__PURE__ */ p(c, {
35
+ ...w,
36
+ ref: T,
37
+ isReadOnly: b,
38
+ isDisabled: x,
35
39
  className: e(_.dateField, a),
36
40
  children: [
37
41
  /* @__PURE__ */ f(n, {
@@ -46,27 +50,27 @@ import '../assets/date-field.css';var g = {
46
50
  /* @__PURE__ */ f("div", {
47
51
  className: e(_.inputField, { [_.medium]: d === "medium" }),
48
52
  "data-testid": "date-field_input-field",
49
- children: /* @__PURE__ */ p(m, { children: [/* @__PURE__ */ f(C, { children: (e) => /* @__PURE__ */ f(x, { segment: e }) }), /* @__PURE__ */ f(v, {
53
+ children: /* @__PURE__ */ p(m, { children: [/* @__PURE__ */ f("div", {
54
+ className: v.scroller,
55
+ children: /* @__PURE__ */ f(C, { children: (e) => /* @__PURE__ */ f(S, { segment: e }) })
56
+ }), /* @__PURE__ */ f(y, {
50
57
  isClearable: g,
51
58
  size: d,
52
- isDisabled: b,
53
- isReadOnly: y
59
+ isDisabled: x,
60
+ isReadOnly: b
54
61
  })] })
55
62
  }),
56
63
  l === "bottom" && /* @__PURE__ */ f(t, { children: s })
57
64
  ]
58
- })), b = { dateSegment: "_dateSegment_15g5c_1" }, x = ({ className: t, ...n }) => /* @__PURE__ */ f(d, {
59
- className: e(b.dateSegment, t),
65
+ })), x = { dateSegment: "_dateSegment_15g5c_1" }, S = ({ className: t, ...n }) => /* @__PURE__ */ f(d, {
66
+ className: e(x.dateSegment, t),
60
67
  ...n
61
- }), S = {
62
- dateInput: "_dateInput_14x1f_1",
63
- divider: "_divider_14x1f_21"
64
- }, C = ({ className: t, ...n }) => /* @__PURE__ */ f(u, {
65
- className: e(S.dateInput, t),
68
+ }), C = ({ className: t, ...n }) => /* @__PURE__ */ f(u, {
69
+ className: e(v.dateInput, t),
66
70
  ...n
67
71
  }), w = () => /* @__PURE__ */ f("span", {
68
72
  "aria-hidden": "true",
69
- className: S.divider,
73
+ className: v.divider,
70
74
  children: "-"
71
75
  });
72
- export { y as i, C as n, x as r, w as t };
76
+ export { v as a, b as i, C as n, S as r, w as t };
@@ -0,0 +1,144 @@
1
+ 'use client';
2
+ import { t as e } from "./clear-button-CeQy0RdK.js";
3
+ import { t } from "./useLocalizedStringFormatter-DhIAL1D7.js";
4
+ import { a as n, n as r, r as i, t as a } from "./date-field-CdlSlO7A.js";
5
+ import { n as o } from "./button-S2AY4EEn.js";
6
+ import { n as s, t as c } from "./calendar-BOTC3DKx.js";
7
+ import { t as l } from "./field-error-C5ynuTRu.js";
8
+ import { n as u, t as d } from "./label-B5-Kmj4t.js";
9
+ import { t as f } from "./text-D7tnzTru.js";
10
+ import * as p from "react";
11
+ import { clsx as m } from "clsx";
12
+ import { DatePicker as h, DatePickerStateContext as g, DateRangePicker as _, DateRangePickerStateContext as v, Group as y, Popover as b } from "react-aria-components";
13
+ import { jsx as x, jsxs as S } from "react/jsx-runtime";
14
+ import { CalendarDays as C } from "lucide-react";
15
+ import { FocusScope as w, useFocusManager as T } from "react-aria";
16
+ import '../assets/date-picker.css';var E = {
17
+ en: {
18
+ clear: "Clear date",
19
+ "open-calendar": "Open calendar"
20
+ },
21
+ sv: {
22
+ clear: "Rensa datum",
23
+ "open-calendar": "Öppna kalender"
24
+ }
25
+ }, D = {
26
+ datePicker: "_datePicker_g3zwq_1",
27
+ inputField: "_inputField_g3zwq_8",
28
+ medium: "_medium_g3zwq_25",
29
+ readOnly: "_readOnly_g3zwq_48",
30
+ buttonGroup: "_buttonGroup_g3zwq_53",
31
+ iconButton: "_iconButton_g3zwq_59",
32
+ popover: "_popover_g3zwq_82 _dropdownAnimation_1ljkv_4"
33
+ }, O = (e) => !!e && !!e.value && Object.prototype.hasOwnProperty.call(e.value, "start"), k = ({ isClearable: n, isDisabled: r, isReadOnly: i, size: a }) => {
34
+ let o = p.useContext(g), s = p.useContext(v), c = t(E), l = T(), u = s ?? o, d = O(u) ? !!u.value.start && u.value.end : !!u?.value;
35
+ return n && d && !i ? /* @__PURE__ */ x(e, {
36
+ onPress: () => {
37
+ u?.setValue(null), l?.focusFirst();
38
+ },
39
+ size: a,
40
+ isDisabled: r,
41
+ "aria-label": c.format("clear"),
42
+ className: m(D.iconButton, { [D.medium]: a === "medium" })
43
+ }) : null;
44
+ }, A = ({ children: e, isDisabled: r, isInvalid: i, isReadOnly: a, size: s = "large", isClearable: c = !1 }) => {
45
+ let l = t(E);
46
+ return /* @__PURE__ */ x(y, {
47
+ className: m(D.inputField, {
48
+ [D.medium]: s === "medium",
49
+ [D.readOnly]: a
50
+ }),
51
+ children: /* @__PURE__ */ S(w, { children: [/* @__PURE__ */ x("div", {
52
+ className: n.scroller,
53
+ children: e
54
+ }), /* @__PURE__ */ S("div", {
55
+ className: D.buttonGroup,
56
+ children: [/* @__PURE__ */ x(k, {
57
+ isClearable: c,
58
+ isDisabled: r,
59
+ isReadOnly: a,
60
+ size: s
61
+ }), /* @__PURE__ */ x(o, {
62
+ variant: "icon",
63
+ "aria-label": l.format("open-calendar"),
64
+ className: m(D.iconButton, {
65
+ [D.medium]: s === "medium",
66
+ [D.readOnly]: a
67
+ }),
68
+ "data-invalid": i || void 0,
69
+ size: s,
70
+ children: /* @__PURE__ */ x(C, {
71
+ "aria-hidden": !0,
72
+ size: 20
73
+ })
74
+ })]
75
+ })] })
76
+ });
77
+ }, j = ({ children: e }) => /* @__PURE__ */ x(b, {
78
+ className: D.popover,
79
+ children: e
80
+ }), M = p.forwardRef(({ className: e, description: t, errorMessage: n, errorPosition: a = "top", label: o, popover: c, isClearable: p = !1, isReadOnly: g, isDisabled: _, size: v, ...y }, b) => /* @__PURE__ */ S(h, {
81
+ className: m(D.datePicker, e),
82
+ isReadOnly: g,
83
+ isDisabled: _,
84
+ ref: b,
85
+ ...y,
86
+ children: [
87
+ /* @__PURE__ */ x(u, {
88
+ popover: c,
89
+ children: o && /* @__PURE__ */ x(d, { children: o })
90
+ }),
91
+ t && /* @__PURE__ */ x(f, {
92
+ slot: "description",
93
+ children: t
94
+ }),
95
+ a === "top" && /* @__PURE__ */ x(l, { children: n }),
96
+ /* @__PURE__ */ x(A, {
97
+ isClearable: p,
98
+ isReadOnly: g,
99
+ isDisabled: _,
100
+ size: v,
101
+ ...y,
102
+ children: /* @__PURE__ */ x(r, { children: (e) => /* @__PURE__ */ x(i, { segment: e }) })
103
+ }),
104
+ a === "bottom" && /* @__PURE__ */ x(l, { children: n }),
105
+ /* @__PURE__ */ x(j, { children: /* @__PURE__ */ x(s, {}) })
106
+ ]
107
+ })), N = ({ className: e, description: t, errorMessage: n, errorPosition: o = "top", label: s, popover: p, isClearable: h = !1, isReadOnly: g, isDisabled: v, size: y, ...b }) => /* @__PURE__ */ S(_, {
108
+ className: m(D.datePicker, e),
109
+ isReadOnly: g,
110
+ isDisabled: v,
111
+ ...b,
112
+ children: [
113
+ /* @__PURE__ */ x(u, {
114
+ popover: p,
115
+ children: s && /* @__PURE__ */ x(d, { children: s })
116
+ }),
117
+ t && /* @__PURE__ */ x(f, {
118
+ slot: "description",
119
+ children: t
120
+ }),
121
+ o === "top" && /* @__PURE__ */ x(l, { children: n }),
122
+ /* @__PURE__ */ S(A, {
123
+ isClearable: h,
124
+ isReadOnly: g,
125
+ isDisabled: v,
126
+ size: y,
127
+ ...b,
128
+ children: [
129
+ /* @__PURE__ */ x(r, {
130
+ slot: "start",
131
+ children: (e) => /* @__PURE__ */ x(i, { segment: e })
132
+ }),
133
+ /* @__PURE__ */ x(a, {}),
134
+ /* @__PURE__ */ x(r, {
135
+ slot: "end",
136
+ children: (e) => /* @__PURE__ */ x(i, { segment: e })
137
+ })
138
+ ]
139
+ }),
140
+ o === "bottom" && /* @__PURE__ */ x(l, { children: n }),
141
+ /* @__PURE__ */ x(j, { children: /* @__PURE__ */ x(c, {}) })
142
+ ]
143
+ });
144
+ export { M as n, N as t };
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "./clsx-BtGY0yFD.js";
2
- import { n as t, r as n } from "./date-field-DSBHnHdN.js";
2
+ import { n as t, r as n } from "./date-field-CdlSlO7A.js";
3
3
  import { t as r } from "./field-error-C5ynuTRu.js";
4
4
  import { n as i, t as a } from "./label-B5-Kmj4t.js";
5
5
  import { t as o } from "./text-D7tnzTru.js";
@@ -1 +1 @@
1
- export { i as DateField, n as DateInput, t as DateInputDivider, r as DateSegment } from "../chunks/date-field-DSBHnHdN.js";
1
+ export { i as DateField, n as DateInput, t as DateInputDivider, r as DateSegment } from "../chunks/date-field-CdlSlO7A.js";
@@ -1 +1 @@
1
- export { n as DatePicker, t as DateRangePicker } from "../chunks/date-picker-CLizY8Vq.js";
1
+ export { n as DatePicker, t as DateRangePicker } from "../chunks/date-picker-IJI2Bxlx.js";
package/index.js CHANGED
@@ -25,8 +25,8 @@ import { n as X, t as Z } from "./chunks/toggle-button-BVyG8F2K.js";
25
25
  import { n as Q, t as $ } from "./chunks/color-scheme-switch-BpmV-r9p.js";
26
26
  import { a as ee, i as te, n as ne, o as re, r as ie, t as ae } from "./chunks/menu-7gP2Sovj.js";
27
27
  import { t as oe } from "./chunks/combobox-DQ3d6pLc.js";
28
- import { i as se, n as ce, r as le, t as ue } from "./chunks/date-field-DSBHnHdN.js";
29
- import { n as de, t as fe } from "./chunks/date-picker-CLizY8Vq.js";
28
+ import { i as se, n as ce, r as le, t as ue } from "./chunks/date-field-CdlSlO7A.js";
29
+ import { n as de, t as fe } from "./chunks/date-picker-IJI2Bxlx.js";
30
30
  import { t as pe } from "./chunks/drop-zone-BL3Z-Sbj.js";
31
31
  import { n as me, t as he } from "./chunks/file-list-etDe20pj.js";
32
32
  import { t as ge } from "./chunks/progress-bar-DE7UoEWR.js";
@@ -45,7 +45,7 @@ import { t as Re } from "./chunks/stack-DKjRicm1.js";
45
45
  import { a as ze, i as Be, n as Ve, o as He, r as Ue, t as We } from "./chunks/table-Fsf-jJip.js";
46
46
  import { i as Ge, n as Ke, r as qe, t as Je } from "./chunks/tabs-ZCpVhr_r.js";
47
47
  import { i as Ye, n as Xe, r as Ze, t as Qe } from "./chunks/textfield-C-lRIIil.js";
48
- import { t as $e } from "./chunks/time-field-1I6BMlaj.js";
48
+ import { t as $e } from "./chunks/time-field-nbvqWpzf.js";
49
49
  import { a as et, i as tt, n as nt, o as rt, r as it, t as at } from "./chunks/toast-DTqQhHFN.js";
50
50
  // src/version.ts
51
51
  var ot = {
@@ -60,7 +60,7 @@ var ot = {
60
60
  description: "Midas Components",
61
61
  homepage: "https://designsystem.migrationsverket.se/",
62
62
  license: "CC0-1.0",
63
- version: "17.33.6",
63
+ version: "17.33.7",
64
64
  module: "./index.js",
65
65
  type: "module",
66
66
  main: "./index.js",
package/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "description": "Midas Components",
15
15
  "homepage": "https://designsystem.migrationsverket.se/",
16
16
  "license": "CC0-1.0",
17
- "version": "17.33.6",
17
+ "version": "17.33.7",
18
18
  "module": "./index.js",
19
19
  "type": "module",
20
20
  "main": "./index.js",
@@ -1 +1 @@
1
- export { t as TimeField } from "../chunks/time-field-1I6BMlaj.js";
1
+ export { t as TimeField } from "../chunks/time-field-nbvqWpzf.js";
@@ -1,141 +0,0 @@
1
- 'use client';
2
- import { t as e } from "./clear-button-CeQy0RdK.js";
3
- import { t } from "./useLocalizedStringFormatter-DhIAL1D7.js";
4
- import { n } from "./button-S2AY4EEn.js";
5
- import { n as r, t as i } from "./calendar-BOTC3DKx.js";
6
- import { n as a, r as o, t as s } from "./date-field-DSBHnHdN.js";
7
- import { t as c } from "./field-error-C5ynuTRu.js";
8
- import { n as l, t as u } from "./label-B5-Kmj4t.js";
9
- import { t as d } from "./text-D7tnzTru.js";
10
- import * as f from "react";
11
- import { clsx as p } from "clsx";
12
- import { DatePicker as m, DatePickerStateContext as h, DateRangePicker as g, DateRangePickerStateContext as _, Group as v, Popover as y } from "react-aria-components";
13
- import { jsx as b, jsxs as x } from "react/jsx-runtime";
14
- import { CalendarDays as S } from "lucide-react";
15
- import { FocusScope as C, useFocusManager as w } from "react-aria";
16
- import '../assets/date-picker.css';var T = {
17
- en: {
18
- clear: "Clear date",
19
- "open-calendar": "Open calendar"
20
- },
21
- sv: {
22
- clear: "Rensa datum",
23
- "open-calendar": "Öppna kalender"
24
- }
25
- }, E = {
26
- datePicker: "_datePicker_14wog_1",
27
- inputField: "_inputField_14wog_8",
28
- medium: "_medium_14wog_24",
29
- readOnly: "_readOnly_14wog_47",
30
- buttonGroup: "_buttonGroup_14wog_52",
31
- iconButton: "_iconButton_14wog_58",
32
- popover: "_popover_14wog_81 _dropdownAnimation_1ljkv_4"
33
- }, D = (e) => !!e && !!e.value && Object.prototype.hasOwnProperty.call(e.value, "start"), O = ({ isClearable: n, isDisabled: r, isReadOnly: i, size: a }) => {
34
- let o = f.useContext(h), s = f.useContext(_), c = t(T), l = w(), u = s ?? o, d = D(u) ? !!u.value.start && u.value.end : !!u?.value;
35
- return n && d && !i ? /* @__PURE__ */ b(e, {
36
- onPress: () => {
37
- u?.setValue(null), l?.focusFirst();
38
- },
39
- size: a,
40
- isDisabled: r,
41
- "aria-label": c.format("clear"),
42
- className: p(E.iconButton, { [E.medium]: a === "medium" })
43
- }) : null;
44
- }, k = ({ children: e, isDisabled: r, isInvalid: i, isReadOnly: a, size: o = "large", isClearable: s = !1 }) => {
45
- let c = t(T);
46
- return /* @__PURE__ */ b(v, {
47
- className: p(E.inputField, {
48
- [E.medium]: o === "medium",
49
- [E.readOnly]: a
50
- }),
51
- children: /* @__PURE__ */ x(C, { children: [e, /* @__PURE__ */ x("div", {
52
- className: E.buttonGroup,
53
- children: [/* @__PURE__ */ b(O, {
54
- isClearable: s,
55
- isDisabled: r,
56
- isReadOnly: a,
57
- size: o
58
- }), /* @__PURE__ */ b(n, {
59
- variant: "icon",
60
- "aria-label": c.format("open-calendar"),
61
- className: p(E.iconButton, {
62
- [E.medium]: o === "medium",
63
- [E.readOnly]: a
64
- }),
65
- "data-invalid": i || void 0,
66
- size: o,
67
- children: /* @__PURE__ */ b(S, {
68
- "aria-hidden": !0,
69
- size: 20
70
- })
71
- })]
72
- })] })
73
- });
74
- }, A = ({ children: e }) => /* @__PURE__ */ b(y, {
75
- className: E.popover,
76
- children: e
77
- }), j = f.forwardRef(({ className: e, description: t, errorMessage: n, errorPosition: i = "top", label: s, popover: f, isClearable: h = !1, isReadOnly: g, isDisabled: _, size: v, ...y }, S) => /* @__PURE__ */ x(m, {
78
- className: p(E.datePicker, e),
79
- isReadOnly: g,
80
- isDisabled: _,
81
- ref: S,
82
- ...y,
83
- children: [
84
- /* @__PURE__ */ b(l, {
85
- popover: f,
86
- children: s && /* @__PURE__ */ b(u, { children: s })
87
- }),
88
- t && /* @__PURE__ */ b(d, {
89
- slot: "description",
90
- children: t
91
- }),
92
- i === "top" && /* @__PURE__ */ b(c, { children: n }),
93
- /* @__PURE__ */ b(k, {
94
- isClearable: h,
95
- isReadOnly: g,
96
- isDisabled: _,
97
- size: v,
98
- ...y,
99
- children: /* @__PURE__ */ b(a, { children: (e) => /* @__PURE__ */ b(o, { segment: e }) })
100
- }),
101
- i === "bottom" && /* @__PURE__ */ b(c, { children: n }),
102
- /* @__PURE__ */ b(A, { children: /* @__PURE__ */ b(r, {}) })
103
- ]
104
- })), M = ({ className: e, description: t, errorMessage: n, errorPosition: r = "top", label: f, popover: m, isClearable: h = !1, isReadOnly: _, isDisabled: v, size: y, ...S }) => /* @__PURE__ */ x(g, {
105
- className: p(E.datePicker, e),
106
- isReadOnly: _,
107
- isDisabled: v,
108
- ...S,
109
- children: [
110
- /* @__PURE__ */ b(l, {
111
- popover: m,
112
- children: f && /* @__PURE__ */ b(u, { children: f })
113
- }),
114
- t && /* @__PURE__ */ b(d, {
115
- slot: "description",
116
- children: t
117
- }),
118
- r === "top" && /* @__PURE__ */ b(c, { children: n }),
119
- /* @__PURE__ */ x(k, {
120
- isClearable: h,
121
- isReadOnly: _,
122
- isDisabled: v,
123
- size: y,
124
- ...S,
125
- children: [
126
- /* @__PURE__ */ b(a, {
127
- slot: "start",
128
- children: (e) => /* @__PURE__ */ b(o, { segment: e })
129
- }),
130
- /* @__PURE__ */ b(s, {}),
131
- /* @__PURE__ */ b(a, {
132
- slot: "end",
133
- children: (e) => /* @__PURE__ */ b(o, { segment: e })
134
- })
135
- ]
136
- }),
137
- r === "bottom" && /* @__PURE__ */ b(c, { children: n }),
138
- /* @__PURE__ */ b(A, { children: /* @__PURE__ */ b(i, {}) })
139
- ]
140
- });
141
- export { j as n, M as t };