@midas-ds/components 17.11.4 → 17.11.6

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,15 @@
1
+ ## 17.11.6 (2026-04-14)
2
+
3
+ ### 🩹 Fixes
4
+
5
+ - **components, date-picker:** add forwardRef and generic type ([eba8d627dac](https://github.com/migrationsverket/midas/commit/eba8d627dac))
6
+
7
+ ## 17.11.5 (2026-04-14)
8
+
9
+ ### 🩹 Fixes
10
+
11
+ - **components, card:** change horizontal heading level ([26fe0e0241](https://github.com/migrationsverket/midas/commit/26fe0e0241))
12
+
1
13
  ## 17.11.4 (2026-04-14)
2
14
 
3
15
  ### 🧱 Updated Dependencies
package/card/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { C, a as d, b as s, c as e, d as t, e as n, f as o } from "../chunks/Card-Br5b9Esq.js";
1
+ import { C, a as d, b as s, c as e, d as t, e as n, f as o } from "../chunks/Card-DSUs7WRL.js";
2
2
  export {
3
3
  C as Card,
4
4
  d as CardActionArea,
@@ -4,111 +4,110 @@ import * as s from "react";
4
4
  import { H as m } from "./Heading-nfcRc2QF.js";
5
5
  import { Button as _, Link as u } from "react-aria-components";
6
6
  import { A as C } from "./arrow-right-BVcFGZmy.js";
7
- import '../assets/Card.css';const A = "_card_iue4c_1", h = "_horizontal_iue4c_11", I = "_cardLink_iue4c_16", x = "_cardContent_iue4c_27", z = "_cardActions_iue4c_46", k = "_cardActionArea_iue4c_56", p = "_cardImage_iue4c_89", L = "_cardLinkIcon_iue4c_121", o = {
7
+ import '../assets/Card.css';const A = "_card_iue4c_1", h = "_horizontal_iue4c_11", I = "_cardLink_iue4c_16", z = "_cardContent_iue4c_27", k = "_cardActions_iue4c_46", x = "_cardActionArea_iue4c_56", L = "_cardImage_iue4c_89", p = "_cardLinkIcon_iue4c_121", o = {
8
8
  card: A,
9
9
  horizontal: h,
10
10
  cardLink: I,
11
- cardContent: x,
12
- cardActions: z,
13
- cardActionArea: k,
14
- cardImage: p,
15
- cardLinkIcon: L
11
+ cardContent: z,
12
+ cardActions: k,
13
+ cardActionArea: x,
14
+ cardImage: L,
15
+ cardLinkIcon: p
16
16
  }, i = s.createContext({
17
17
  horizontal: void 0,
18
18
  titleId: void 0
19
19
  }), y = ({
20
- horizontal: a,
20
+ horizontal: t,
21
21
  className: c,
22
- children: t,
22
+ children: a,
23
23
  ...e
24
24
  }) => {
25
25
  const d = `card-title-${s.useId()}`;
26
- return /* @__PURE__ */ n(i.Provider, { value: { horizontal: a, titleId: d }, children: /* @__PURE__ */ n(
26
+ return /* @__PURE__ */ n(i.Provider, { value: { horizontal: t, titleId: d }, children: /* @__PURE__ */ n(
27
27
  "div",
28
28
  {
29
29
  ...e,
30
30
  className: r(
31
31
  o.card,
32
- a && o.horizontal,
32
+ t && o.horizontal,
33
33
  c
34
34
  ),
35
- children: t
35
+ children: a
36
36
  }
37
37
  ) });
38
38
  }, H = ({
39
- children: a,
39
+ children: t,
40
40
  ...c
41
41
  }) => {
42
- const { horizontal: t } = s.useContext(i);
42
+ const { horizontal: a } = s.useContext(i);
43
43
  return /* @__PURE__ */ n(
44
44
  "div",
45
45
  {
46
46
  ...c,
47
- className: r(o.cardContent, t && o.horizontal),
48
- children: a
47
+ className: r(o.cardContent, a && o.horizontal),
48
+ children: t
49
49
  }
50
50
  );
51
51
  }, R = ({
52
- elementType: a = "h2",
52
+ elementType: t = "h2",
53
53
  children: c
54
54
  }) => {
55
- const { horizontal: t, titleId: e } = s.useContext(i);
55
+ const { horizontal: a, titleId: e } = s.useContext(i);
56
56
  return /* @__PURE__ */ n(
57
57
  m,
58
58
  {
59
- level: t ? 5 : 3,
60
- elementType: a,
61
- isExpressive: t,
62
- className: r(o.cardTitle, t && o.horizontal),
59
+ level: 3,
60
+ elementType: t,
61
+ className: r(o.cardTitle, a && o.horizontal),
63
62
  id: e,
64
63
  children: c
65
64
  }
66
65
  );
67
66
  }, T = ({
68
- children: a,
67
+ children: t,
69
68
  ...c
70
69
  }) => {
71
- const { horizontal: t } = s.useContext(i);
70
+ const { horizontal: a } = s.useContext(i);
72
71
  return /* @__PURE__ */ n(
73
72
  "div",
74
73
  {
75
74
  ...c,
76
- className: r(o.cardActions, t && o.horizontal),
77
- children: a
75
+ className: r(o.cardActions, a && o.horizontal),
76
+ children: t
78
77
  }
79
78
  );
80
- }, w = ({ children: a, className: c, ...t }) => {
79
+ }, w = ({ children: t, className: c, ...a }) => {
81
80
  const { titleId: e } = s.useContext(i);
82
81
  return /* @__PURE__ */ n(
83
82
  _,
84
83
  {
85
- ...t,
84
+ ...a,
86
85
  "aria-labelledby": e,
87
86
  className: r(o.cardActionArea, c),
88
- children: a
87
+ children: t
89
88
  }
90
89
  );
91
90
  }, B = ({
92
- as: a = "img",
91
+ as: t = "img",
93
92
  className: c,
94
- ...t
93
+ ...a
95
94
  }) => /* @__PURE__ */ n(
96
- a,
95
+ t,
97
96
  {
98
- ...t,
97
+ ...a,
99
98
  className: r(o.cardImage, c)
100
99
  }
101
- ), E = ({
102
- children: a,
100
+ ), P = ({
101
+ children: t,
103
102
  as: c,
104
- ...t
103
+ ...a
105
104
  }) => /* @__PURE__ */ l(
106
105
  c || u,
107
106
  {
108
- ...t,
109
- className: r(o.cardLink, t.className),
107
+ ...a,
108
+ className: r(o.cardLink, a.className),
110
109
  children: [
111
- a,
110
+ t,
112
111
  /* @__PURE__ */ n(
113
112
  C,
114
113
  {
@@ -125,6 +124,6 @@ export {
125
124
  T as b,
126
125
  H as c,
127
126
  B as d,
128
- E as e,
127
+ P as e,
129
128
  R as f
130
129
  };
@@ -0,0 +1,202 @@
1
+ 'use client';
2
+ import { jsx as e, jsxs as h } from "react/jsx-runtime";
3
+ import * as f from "react";
4
+ import { Group as B, DatePickerStateContext as M, DateRangePickerStateContext as N, Popover as S, Dialog as R, DatePicker as w, DateRangePicker as G } from "react-aria-components";
5
+ import { a as k } from "./clsx-AexbMWKp.js";
6
+ import { C as L, R as I } from "./RangeCalendar-DxLInTav.js";
7
+ import { D as P, a as v } from "./DateInput-NzWcnB4y.js";
8
+ import { F as _ } from "./FieldError-krpMBtie.js";
9
+ import { a as g, L as y } from "./Label-Cg0aAlnt.js";
10
+ import { T as D } from "./Text-D0r_W4lH.js";
11
+ import { C as O } from "./ClearButton-DkC8PIMi.js";
12
+ import { FocusScope as V, useFocusManager as T } from "@react-aria/focus";
13
+ import { B as $ } from "./Button-GCROAMSl.js";
14
+ import { c as A } from "./createLucideIcon-CP-mMPfa.js";
15
+ import { u as j } from "./useLocalizedStringFormatter-BHvsRxDk.js";
16
+ import { D as E } from "./DateInputDivider-BHAwPkIR.js";
17
+ import '../assets/DateRangePicker.css';const W = [
18
+ ["path", { d: "M8 2v4", key: "1cmpym" }],
19
+ ["path", { d: "M16 2v4", key: "4m81vk" }],
20
+ ["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
21
+ ["path", { d: "M3 10h18", key: "8toen8" }],
22
+ ["path", { d: "M8 14h.01", key: "6423bh" }],
23
+ ["path", { d: "M12 14h.01", key: "1etili" }],
24
+ ["path", { d: "M16 14h.01", key: "1gbofw" }],
25
+ ["path", { d: "M8 18h.01", key: "lrp35t" }],
26
+ ["path", { d: "M12 18h.01", key: "mhygvu" }],
27
+ ["path", { d: "M16 18h.01", key: "kzsmim" }]
28
+ ], q = A("calendar-days", W), H = { clear: "Clear date", "open-calendar": "Open calendar" }, J = { clear: "Rensa datum", "open-calendar": "Öppna kalender" }, C = {
29
+ en: H,
30
+ sv: J
31
+ }, K = "_datePicker_13jtn_1", Q = "_inputField_13jtn_8", U = "_medium_13jtn_24", X = "_readOnly_13jtn_47", Y = "_buttonGroup_13jtn_52", Z = "_iconButton_13jtn_58", z = "_popover_13jtn_81 _dropdownAnimation_1ljkv_4", ee = "_dialog_13jtn_85", a = {
32
+ datePicker: K,
33
+ inputField: Q,
34
+ medium: U,
35
+ readOnly: X,
36
+ buttonGroup: Y,
37
+ iconButton: Z,
38
+ popover: z,
39
+ dialog: ee
40
+ }, te = (t) => !!t && !!t.value && Object.prototype.hasOwnProperty.call(t.value, "start"), ae = ({
41
+ isClearable: t,
42
+ isDisabled: c,
43
+ isReadOnly: i,
44
+ size: n
45
+ }) => {
46
+ const r = f.useContext(M), s = f.useContext(N), l = j(C), d = T(), o = s ?? r, u = te(o) ? !!o.value.start && o.value.end : !!o?.value;
47
+ return t && u && !i ? /* @__PURE__ */ e(
48
+ O,
49
+ {
50
+ onPress: () => {
51
+ o?.setValue(null), d?.focusFirst();
52
+ },
53
+ size: n,
54
+ isDisabled: c,
55
+ "aria-label": l.format("clear"),
56
+ className: k(a.iconButton, {
57
+ [a.medium]: n === "medium"
58
+ })
59
+ }
60
+ ) : null;
61
+ }, b = ({
62
+ children: t,
63
+ isDisabled: c,
64
+ isInvalid: i,
65
+ isReadOnly: n,
66
+ size: r = "large",
67
+ isClearable: s = !1
68
+ }) => {
69
+ const l = j(C);
70
+ return /* @__PURE__ */ e(
71
+ B,
72
+ {
73
+ className: k(a.inputField, {
74
+ [a.medium]: r === "medium",
75
+ [a.readOnly]: n
76
+ }),
77
+ children: /* @__PURE__ */ h(V, { children: [
78
+ t,
79
+ /* @__PURE__ */ h("div", { className: a.buttonGroup, children: [
80
+ /* @__PURE__ */ e(
81
+ ae,
82
+ {
83
+ isClearable: s,
84
+ isDisabled: c,
85
+ isReadOnly: n,
86
+ size: r
87
+ }
88
+ ),
89
+ /* @__PURE__ */ e(
90
+ $,
91
+ {
92
+ variant: "icon",
93
+ "aria-label": l.format("open-calendar"),
94
+ className: k(a.iconButton, {
95
+ [a.medium]: r === "medium",
96
+ [a.readOnly]: n
97
+ }),
98
+ "data-invalid": i || void 0,
99
+ size: r,
100
+ children: /* @__PURE__ */ e(
101
+ q,
102
+ {
103
+ "aria-hidden": !0,
104
+ size: 20
105
+ }
106
+ )
107
+ }
108
+ )
109
+ ] })
110
+ ] })
111
+ }
112
+ );
113
+ }, x = ({
114
+ children: t
115
+ }) => /* @__PURE__ */ e(S, { className: a.popover, children: /* @__PURE__ */ e(R, { className: a.dialog, children: t }) }), fe = f.forwardRef(
116
+ ({
117
+ className: t,
118
+ description: c,
119
+ errorMessage: i,
120
+ errorPosition: n = "top",
121
+ label: r,
122
+ popover: s,
123
+ isClearable: l = !1,
124
+ isReadOnly: d,
125
+ isDisabled: o,
126
+ size: u,
127
+ ...m
128
+ }, p) => /* @__PURE__ */ h(
129
+ w,
130
+ {
131
+ className: k(a.datePicker, t),
132
+ isReadOnly: d,
133
+ isDisabled: o,
134
+ ref: p,
135
+ ...m,
136
+ children: [
137
+ /* @__PURE__ */ e(g, { popover: s, children: r && /* @__PURE__ */ e(y, { children: r }) }),
138
+ c && /* @__PURE__ */ e(D, { slot: "description", children: c }),
139
+ n === "top" && /* @__PURE__ */ e(_, { children: i }),
140
+ /* @__PURE__ */ e(
141
+ b,
142
+ {
143
+ isClearable: l,
144
+ isReadOnly: d,
145
+ isDisabled: o,
146
+ size: u,
147
+ ...m,
148
+ children: /* @__PURE__ */ e(P, { children: (F) => /* @__PURE__ */ e(v, { segment: F }) })
149
+ }
150
+ ),
151
+ n === "bottom" && /* @__PURE__ */ e(_, { children: i }),
152
+ /* @__PURE__ */ e(x, { children: /* @__PURE__ */ e(L, {}) })
153
+ ]
154
+ }
155
+ )
156
+ ), Pe = ({
157
+ className: t,
158
+ description: c,
159
+ errorMessage: i,
160
+ errorPosition: n = "top",
161
+ label: r,
162
+ popover: s,
163
+ isClearable: l = !1,
164
+ isReadOnly: d,
165
+ isDisabled: o,
166
+ size: u,
167
+ ...m
168
+ }) => /* @__PURE__ */ h(
169
+ G,
170
+ {
171
+ className: k(a.datePicker, t),
172
+ isReadOnly: d,
173
+ isDisabled: o,
174
+ ...m,
175
+ children: [
176
+ /* @__PURE__ */ e(g, { popover: s, children: r && /* @__PURE__ */ e(y, { children: r }) }),
177
+ c && /* @__PURE__ */ e(D, { slot: "description", children: c }),
178
+ n === "top" && /* @__PURE__ */ e(_, { children: i }),
179
+ /* @__PURE__ */ h(
180
+ b,
181
+ {
182
+ isClearable: l,
183
+ isReadOnly: d,
184
+ isDisabled: o,
185
+ size: u,
186
+ ...m,
187
+ children: [
188
+ /* @__PURE__ */ e(P, { slot: "start", children: (p) => /* @__PURE__ */ e(v, { segment: p }) }),
189
+ /* @__PURE__ */ e(E, {}),
190
+ /* @__PURE__ */ e(P, { slot: "end", children: (p) => /* @__PURE__ */ e(v, { segment: p }) })
191
+ ]
192
+ }
193
+ ),
194
+ n === "bottom" && /* @__PURE__ */ e(_, { children: i }),
195
+ /* @__PURE__ */ e(x, { children: /* @__PURE__ */ e(I, {}) })
196
+ ]
197
+ }
198
+ );
199
+ export {
200
+ fe as D,
201
+ Pe as a
202
+ };
@@ -2,7 +2,7 @@ import { DatePickerProps as AriaDatePickerProps, DateValue, ValidationResult } f
2
2
  import { InfoPopoverProps } from '../label';
3
3
  import { Size } from '../common/types';
4
4
  import * as React from 'react';
5
- export interface DatePickerProps extends AriaDatePickerProps<DateValue> {
5
+ export interface DatePickerProps<T extends DateValue> extends AriaDatePickerProps<T> {
6
6
  description?: string;
7
7
  errorMessage?: string | ((validation: ValidationResult) => string);
8
8
  errorPosition?: 'top' | 'bottom';
@@ -18,4 +18,6 @@ export interface DatePickerProps extends AriaDatePickerProps<DateValue> {
18
18
  */
19
19
  isClearable?: boolean;
20
20
  }
21
- export declare const DatePicker: React.FC<DatePickerProps>;
21
+ export declare const DatePicker: <T extends DateValue>(props: DatePickerProps<T> & {
22
+ ref?: React.Ref<HTMLDivElement>;
23
+ }) => React.ReactElement | null;
@@ -1,8 +1,9 @@
1
1
  import { Meta, StoryObj } from '@storybook/react-vite';
2
+ import { CalendarDate } from '@internationalized/date';
2
3
  import { DatePicker } from './DatePicker';
3
- declare const meta: Meta<typeof DatePicker>;
4
+ declare const meta: Meta<typeof DatePicker<CalendarDate>>;
4
5
  export default meta;
5
- type Story = StoryObj<typeof DatePicker>;
6
+ type Story = StoryObj<typeof DatePicker<CalendarDate>>;
6
7
  export declare const Primary: Story;
7
8
  export declare const WithTime: Story;
8
9
  export declare const Disabled: Story;
@@ -1,7 +1,8 @@
1
+ import { DateValue } from 'react-aria-components';
1
2
  import { DatePickerProps } from './DatePicker';
2
3
  import * as React from 'react';
3
- interface DatePickerInputFieldProps extends Pick<DatePickerProps, 'isDisabled' | 'isInvalid' | 'isReadOnly' | 'size' | 'isClearable'> {
4
+ interface DatePickerInputFieldProps extends Pick<DatePickerProps<DateValue>, 'isDisabled' | 'isInvalid' | 'isReadOnly' | 'size' | 'isClearable'> {
4
5
  children?: React.ReactNode;
5
6
  }
6
- export declare const DatePickerInputField: React.FC<DatePickerInputFieldProps>;
7
+ export declare const DatePickerInputField: ({ children, isDisabled, isInvalid, isReadOnly, size, isClearable, }: DatePickerInputFieldProps) => import("react/jsx-runtime").JSX.Element;
7
8
  export {};
@@ -1,4 +1,4 @@
1
- import { D as r, a as t } from "../chunks/DateRangePicker-BItgKNh8.js";
1
+ import { D as r, a as t } from "../chunks/DateRangePicker-DWxApt5r.js";
2
2
  export {
3
3
  r as DatePicker,
4
4
  t as DateRangePicker
package/index.js CHANGED
@@ -5,7 +5,7 @@ import { B as n, a as d } from "./chunks/Breadcrumb-Bs836gOn.js";
5
5
  import { B as l } from "./chunks/Button-GCROAMSl.js";
6
6
  import { B as g } from "./chunks/ButtonGroup-Dr6HOBo2.js";
7
7
  import { C as L, R as C } from "./chunks/RangeCalendar-DxLInTav.js";
8
- import { C as b, a as S, b as D, c as I, d as F, e as R, f as G } from "./chunks/Card-Br5b9Esq.js";
8
+ import { C as b, a as S, b as D, c as I, d as F, e as R, f as G } from "./chunks/Card-DSUs7WRL.js";
9
9
  import { C as k } from "./chunks/CharacterCounter-Dgnv-orm.js";
10
10
  import { C as M } from "./chunks/Checkbox-CwzV5QbM.js";
11
11
  import { C as h } from "./chunks/CheckboxGroup-CF_3F36J.js";
@@ -14,7 +14,7 @@ import { C as N } from "./chunks/ComboBox-DQOqOcic.js";
14
14
  import { D as z } from "./chunks/DateField-moMaM1xn.js";
15
15
  import { D as Q, a as V } from "./chunks/DateInput-NzWcnB4y.js";
16
16
  import { D as j } from "./chunks/DateInputDivider-BHAwPkIR.js";
17
- import { D as J, a as K } from "./chunks/DateRangePicker-BItgKNh8.js";
17
+ import { D as J, a as K } from "./chunks/DateRangePicker-DWxApt5r.js";
18
18
  import { F as W } from "./chunks/FieldError-krpMBtie.js";
19
19
  import { F as Y, a as _ } from "./chunks/FileListItem-CKF9HPjw.js";
20
20
  import { D as oo, F as ao } from "./chunks/FileUpload-D6oyWcDA.js";
@@ -52,7 +52,7 @@ import { c as ja } from "./chunks/clsx-AexbMWKp.js";
52
52
  import { DialogTrigger as Ja, MenuTrigger as Ka, RouterProvider as Ua } from "react-aria-components";
53
53
  import { u as Xa } from "./chunks/useLocalizedStringFormatter-BHvsRxDk.js";
54
54
  import { useToastState as _a } from "react-stately";
55
- const o = "17.11.4", a = {
55
+ const o = "17.11.6", a = {
56
56
  version: o
57
57
  }, r = a.version;
58
58
  export {
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.11.4",
17
+ "version": "17.11.6",
18
18
  "module": "./index.js",
19
19
  "type": "module",
20
20
  "main": "./index.js",
@@ -1,199 +0,0 @@
1
- 'use client';
2
- import { jsx as e, jsxs as h } from "react/jsx-runtime";
3
- import { Group as F, DatePickerStateContext as B, DateRangePickerStateContext as M, Popover as N, Dialog as S, DatePicker as R, DateRangePicker as G } from "react-aria-components";
4
- import { a as k } from "./clsx-AexbMWKp.js";
5
- import { C as L, R as w } from "./RangeCalendar-DxLInTav.js";
6
- import { D as f, a as P } from "./DateInput-NzWcnB4y.js";
7
- import { F as _ } from "./FieldError-krpMBtie.js";
8
- import { a as g, L as y } from "./Label-Cg0aAlnt.js";
9
- import { T as D } from "./Text-D0r_W4lH.js";
10
- import * as v from "react";
11
- import { C as I } from "./ClearButton-DkC8PIMi.js";
12
- import { FocusScope as O, useFocusManager as V } from "@react-aria/focus";
13
- import { B as T } from "./Button-GCROAMSl.js";
14
- import { c as $ } from "./createLucideIcon-CP-mMPfa.js";
15
- import { u as j } from "./useLocalizedStringFormatter-BHvsRxDk.js";
16
- import { D as A } from "./DateInputDivider-BHAwPkIR.js";
17
- import '../assets/DateRangePicker.css';const E = [
18
- ["path", { d: "M8 2v4", key: "1cmpym" }],
19
- ["path", { d: "M16 2v4", key: "4m81vk" }],
20
- ["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
21
- ["path", { d: "M3 10h18", key: "8toen8" }],
22
- ["path", { d: "M8 14h.01", key: "6423bh" }],
23
- ["path", { d: "M12 14h.01", key: "1etili" }],
24
- ["path", { d: "M16 14h.01", key: "1gbofw" }],
25
- ["path", { d: "M8 18h.01", key: "lrp35t" }],
26
- ["path", { d: "M12 18h.01", key: "mhygvu" }],
27
- ["path", { d: "M16 18h.01", key: "kzsmim" }]
28
- ], W = $("calendar-days", E), q = { clear: "Clear date", "open-calendar": "Open calendar" }, H = { clear: "Rensa datum", "open-calendar": "Öppna kalender" }, C = {
29
- en: q,
30
- sv: H
31
- }, J = "_datePicker_13jtn_1", K = "_inputField_13jtn_8", Q = "_medium_13jtn_24", U = "_readOnly_13jtn_47", X = "_buttonGroup_13jtn_52", Y = "_iconButton_13jtn_58", Z = "_popover_13jtn_81 _dropdownAnimation_1ljkv_4", z = "_dialog_13jtn_85", a = {
32
- datePicker: J,
33
- inputField: K,
34
- medium: Q,
35
- readOnly: U,
36
- buttonGroup: X,
37
- iconButton: Y,
38
- popover: Z,
39
- dialog: z
40
- }, ee = (t) => !!t && !!t.value && Object.prototype.hasOwnProperty.call(t.value, "start"), te = ({
41
- isClearable: t,
42
- isDisabled: c,
43
- isReadOnly: i,
44
- size: n
45
- }) => {
46
- const o = v.useContext(B), s = v.useContext(M), l = j(C), d = V(), r = s ?? o, u = ee(r) ? !!r.value.start && r.value.end : !!r?.value;
47
- return t && u && !i ? /* @__PURE__ */ e(
48
- I,
49
- {
50
- onPress: () => {
51
- r?.setValue(null), d?.focusFirst();
52
- },
53
- size: n,
54
- isDisabled: c,
55
- "aria-label": l.format("clear"),
56
- className: k(a.iconButton, {
57
- [a.medium]: n === "medium"
58
- })
59
- }
60
- ) : null;
61
- }, b = ({
62
- children: t,
63
- isDisabled: c,
64
- isInvalid: i,
65
- isReadOnly: n,
66
- size: o = "large",
67
- isClearable: s = !1
68
- }) => {
69
- const l = j(C);
70
- return /* @__PURE__ */ e(
71
- F,
72
- {
73
- className: k(a.inputField, {
74
- [a.medium]: o === "medium",
75
- [a.readOnly]: n
76
- }),
77
- children: /* @__PURE__ */ h(O, { children: [
78
- t,
79
- /* @__PURE__ */ h("div", { className: a.buttonGroup, children: [
80
- /* @__PURE__ */ e(
81
- te,
82
- {
83
- isClearable: s,
84
- isDisabled: c,
85
- isReadOnly: n,
86
- size: o
87
- }
88
- ),
89
- /* @__PURE__ */ e(
90
- T,
91
- {
92
- variant: "icon",
93
- "aria-label": l.format("open-calendar"),
94
- className: k(a.iconButton, {
95
- [a.medium]: o === "medium",
96
- [a.readOnly]: n
97
- }),
98
- "data-invalid": i || void 0,
99
- size: o,
100
- children: /* @__PURE__ */ e(
101
- W,
102
- {
103
- "aria-hidden": !0,
104
- size: 20
105
- }
106
- )
107
- }
108
- )
109
- ] })
110
- ] })
111
- }
112
- );
113
- }, x = ({
114
- children: t
115
- }) => /* @__PURE__ */ e(N, { className: a.popover, children: /* @__PURE__ */ e(S, { className: a.dialog, children: t }) }), _e = ({
116
- className: t,
117
- description: c,
118
- errorMessage: i,
119
- errorPosition: n = "top",
120
- label: o,
121
- popover: s,
122
- isClearable: l = !1,
123
- isReadOnly: d,
124
- isDisabled: r,
125
- size: u,
126
- ...m
127
- }) => /* @__PURE__ */ h(
128
- R,
129
- {
130
- className: k(a.datePicker, t),
131
- isReadOnly: d,
132
- isDisabled: r,
133
- ...m,
134
- children: [
135
- /* @__PURE__ */ e(g, { popover: s, children: o && /* @__PURE__ */ e(y, { children: o }) }),
136
- c && /* @__PURE__ */ e(D, { slot: "description", children: c }),
137
- n === "top" && /* @__PURE__ */ e(_, { children: i }),
138
- /* @__PURE__ */ e(
139
- b,
140
- {
141
- isClearable: l,
142
- isReadOnly: d,
143
- isDisabled: r,
144
- size: u,
145
- ...m,
146
- children: /* @__PURE__ */ e(f, { children: (p) => /* @__PURE__ */ e(P, { segment: p }) })
147
- }
148
- ),
149
- n === "bottom" && /* @__PURE__ */ e(_, { children: i }),
150
- /* @__PURE__ */ e(x, { children: /* @__PURE__ */ e(L, {}) })
151
- ]
152
- }
153
- ), fe = ({
154
- className: t,
155
- description: c,
156
- errorMessage: i,
157
- errorPosition: n = "top",
158
- label: o,
159
- popover: s,
160
- isClearable: l = !1,
161
- isReadOnly: d,
162
- isDisabled: r,
163
- size: u,
164
- ...m
165
- }) => /* @__PURE__ */ h(
166
- G,
167
- {
168
- className: k(a.datePicker, t),
169
- isReadOnly: d,
170
- isDisabled: r,
171
- ...m,
172
- children: [
173
- /* @__PURE__ */ e(g, { popover: s, children: o && /* @__PURE__ */ e(y, { children: o }) }),
174
- c && /* @__PURE__ */ e(D, { slot: "description", children: c }),
175
- n === "top" && /* @__PURE__ */ e(_, { children: i }),
176
- /* @__PURE__ */ h(
177
- b,
178
- {
179
- isClearable: l,
180
- isReadOnly: d,
181
- isDisabled: r,
182
- size: u,
183
- ...m,
184
- children: [
185
- /* @__PURE__ */ e(f, { slot: "start", children: (p) => /* @__PURE__ */ e(P, { segment: p }) }),
186
- /* @__PURE__ */ e(A, {}),
187
- /* @__PURE__ */ e(f, { slot: "end", children: (p) => /* @__PURE__ */ e(P, { segment: p }) })
188
- ]
189
- }
190
- ),
191
- n === "bottom" && /* @__PURE__ */ e(_, { children: i }),
192
- /* @__PURE__ */ e(x, { children: /* @__PURE__ */ e(w, {}) })
193
- ]
194
- }
195
- );
196
- export {
197
- _e as D,
198
- fe as a
199
- };