@midas-ds/components 17.10.2 → 17.10.3
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 +6 -0
- package/assets/DateField.css +1 -1
- package/chunks/DateField-PU7fIO8a.js +91 -0
- package/date-field/index.js +1 -1
- package/index.js +2 -2
- package/package.json +1 -1
- package/chunks/DateField-Bwis4G2o.js +0 -91
package/CHANGELOG.md
CHANGED
package/assets/DateField.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._dateField_1ejwm_1{font-family:var(--midas-typography-font-family);display:flex;flex-direction:column;align-items:flex-start}._dateField_1ejwm_1[data-readonly] ._inputField_1ejwm_7{background-color:transparent;border-bottom-color:var(--midas-border-color-subtle)}._dateField_1ejwm_1[data-disabled] ._inputField_1ejwm_7{color:var(--midas-text-disabled);cursor:not-allowed;border-bottom-color:var(--midas-border-color-disabled);background-color:var(--midas-field-disabled)}._dateField_1ejwm_1[data-invalid] ._inputField_1ejwm_7{border:none;box-shadow:var(--midas-state-invalid)}._inputField_1ejwm_7{box-sizing:border-box;width:100%;min-height:var(--midas-size-control);display:flex;justify-content:space-between;align-items:center;background-color:var(--midas-field-01-base);border:1px solid transparent;border-bottom-color:var(--midas-border-color-primary);padding:0 0 0 1rem;position:relative}._inputField_1ejwm_7._medium_1ejwm_38{min-height:var(--midas-size-control-md)}._dateField_1ejwm_1:not([data-disabled],[data-readonly]) ._inputField_1ejwm_7 [data-hovered]{background-color:var(--midas-field-01-hover)}._clearButton_1ejwm_47{border:none;background-color:transparent}@media(forced-colors:active){._inputField_1ejwm_7{border:1px solid var(--midas-border-color-primary)}}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { jsxs as p, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import * as h from "react";
|
|
3
|
+
import { DateField as D, DateFieldStateContext as x } from "react-aria-components";
|
|
4
|
+
import { c as d } from "./clsx-AexbMWKp.js";
|
|
5
|
+
import { D as g, b as j } from "./DateInputDivider-DwopMIb9.js";
|
|
6
|
+
import { F } from "./FieldError-krpMBtie.js";
|
|
7
|
+
import { a as B, L as C } from "./Label-Cg0aAlnt.js";
|
|
8
|
+
import { T as b } from "./Text-D0r_W4lH.js";
|
|
9
|
+
import { C as w } from "./ClearButton-DkC8PIMi.js";
|
|
10
|
+
import { FocusScope as L, useFocusManager as S } from "@react-aria/focus";
|
|
11
|
+
import { u as v } from "./useLocalizedStringFormatter-BHvsRxDk.js";
|
|
12
|
+
import '../assets/DateField.css';const N = { clear: "Clear date" }, V = { clear: "Rensa datum" }, T = {
|
|
13
|
+
en: N,
|
|
14
|
+
sv: V
|
|
15
|
+
}, E = "_dateField_1ejwm_1", I = "_inputField_1ejwm_7", M = "_medium_1ejwm_38", P = "_clearButton_1ejwm_47", s = {
|
|
16
|
+
dateField: E,
|
|
17
|
+
inputField: I,
|
|
18
|
+
medium: M,
|
|
19
|
+
clearButton: P
|
|
20
|
+
}, R = ({
|
|
21
|
+
isClearable: i,
|
|
22
|
+
size: t,
|
|
23
|
+
isDisabled: o,
|
|
24
|
+
isReadOnly: r
|
|
25
|
+
}) => {
|
|
26
|
+
const l = v(T), a = h.useContext(x), n = S(), m = () => {
|
|
27
|
+
a?.setValue(null), n?.focusFirst();
|
|
28
|
+
};
|
|
29
|
+
return i && a?.value != null && !r ? /* @__PURE__ */ e(
|
|
30
|
+
w,
|
|
31
|
+
{
|
|
32
|
+
onPress: m,
|
|
33
|
+
size: t,
|
|
34
|
+
isDisabled: o,
|
|
35
|
+
"aria-label": l.format("clear"),
|
|
36
|
+
className: d(s.clearButton, {
|
|
37
|
+
[s.medium]: t === "medium"
|
|
38
|
+
})
|
|
39
|
+
}
|
|
40
|
+
) : null;
|
|
41
|
+
}, Q = ({
|
|
42
|
+
className: i,
|
|
43
|
+
description: t,
|
|
44
|
+
errorMessage: o,
|
|
45
|
+
errorPosition: r = "top",
|
|
46
|
+
label: l,
|
|
47
|
+
size: a = "large",
|
|
48
|
+
popover: n,
|
|
49
|
+
isClearable: m = !1,
|
|
50
|
+
isReadOnly: c,
|
|
51
|
+
isDisabled: u,
|
|
52
|
+
...f
|
|
53
|
+
}) => /* @__PURE__ */ p(
|
|
54
|
+
D,
|
|
55
|
+
{
|
|
56
|
+
...f,
|
|
57
|
+
isReadOnly: c,
|
|
58
|
+
isDisabled: u,
|
|
59
|
+
className: d(s.dateField, i),
|
|
60
|
+
children: [
|
|
61
|
+
/* @__PURE__ */ e(B, { popover: n, children: l && /* @__PURE__ */ e(C, { children: l }) }),
|
|
62
|
+
t && /* @__PURE__ */ e(b, { slot: "description", children: t }),
|
|
63
|
+
r === "top" && /* @__PURE__ */ e(F, { children: o }),
|
|
64
|
+
/* @__PURE__ */ e(
|
|
65
|
+
"div",
|
|
66
|
+
{
|
|
67
|
+
className: d(s.inputField, {
|
|
68
|
+
[s.medium]: a === "medium"
|
|
69
|
+
}),
|
|
70
|
+
"data-testid": "date-field_input-field",
|
|
71
|
+
children: /* @__PURE__ */ p(L, { children: [
|
|
72
|
+
/* @__PURE__ */ e(g, { children: (_) => /* @__PURE__ */ e(j, { segment: _ }) }),
|
|
73
|
+
/* @__PURE__ */ e(
|
|
74
|
+
R,
|
|
75
|
+
{
|
|
76
|
+
isClearable: m,
|
|
77
|
+
size: a,
|
|
78
|
+
isDisabled: u,
|
|
79
|
+
isReadOnly: c
|
|
80
|
+
}
|
|
81
|
+
)
|
|
82
|
+
] })
|
|
83
|
+
}
|
|
84
|
+
),
|
|
85
|
+
r === "bottom" && /* @__PURE__ */ e(F, { children: o })
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
export {
|
|
90
|
+
Q as D
|
|
91
|
+
};
|
package/date-field/index.js
CHANGED
package/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import { C as M } from "./chunks/Checkbox-DSW-_Qpm.js";
|
|
|
11
11
|
import { C as h } from "./chunks/CheckboxGroup-DteJIgnR.js";
|
|
12
12
|
import { C as y } from "./chunks/ColorSchemeSwitch-Bp3PSGkA.js";
|
|
13
13
|
import { C as N } from "./chunks/ComboBox-PVnCPhVs.js";
|
|
14
|
-
import { D as z } from "./chunks/DateField-
|
|
14
|
+
import { D as z } from "./chunks/DateField-PU7fIO8a.js";
|
|
15
15
|
import { D as Q, a as V, b as Z } from "./chunks/DateInputDivider-DwopMIb9.js";
|
|
16
16
|
import { D as q, a as J } from "./chunks/DateRangePicker-5E41DzGI.js";
|
|
17
17
|
import { F as U } from "./chunks/FieldError-krpMBtie.js";
|
|
@@ -50,7 +50,7 @@ import { c as Qa } from "./chunks/clsx-AexbMWKp.js";
|
|
|
50
50
|
import { DialogTrigger as Za, MenuTrigger as ja, RouterProvider as qa } from "react-aria-components";
|
|
51
51
|
import { u as Ka } from "./chunks/useLocalizedStringFormatter-BHvsRxDk.js";
|
|
52
52
|
import { useToastState as Wa } from "react-stately";
|
|
53
|
-
const o = "17.10.
|
|
53
|
+
const o = "17.10.3", a = {
|
|
54
54
|
version: o
|
|
55
55
|
}, r = a.version;
|
|
56
56
|
export {
|
package/package.json
CHANGED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { jsxs as p, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import * as x from "react";
|
|
3
|
-
import { DateField as h, DateFieldStateContext as D } from "react-aria-components";
|
|
4
|
-
import { c as d } from "./clsx-AexbMWKp.js";
|
|
5
|
-
import { D as g, b as B } from "./DateInputDivider-DwopMIb9.js";
|
|
6
|
-
import { F } from "./FieldError-krpMBtie.js";
|
|
7
|
-
import { a as C, L as b } from "./Label-Cg0aAlnt.js";
|
|
8
|
-
import { T as L } from "./Text-D0r_W4lH.js";
|
|
9
|
-
import { C as S } from "./ClearButton-DkC8PIMi.js";
|
|
10
|
-
import { FocusScope as v, useFocusManager as N } from "@react-aria/focus";
|
|
11
|
-
import { u as V } from "./useLocalizedStringFormatter-BHvsRxDk.js";
|
|
12
|
-
import '../assets/DateField.css';const j = { clear: "Clear date" }, T = { clear: "Rensa datum" }, E = {
|
|
13
|
-
en: j,
|
|
14
|
-
sv: T
|
|
15
|
-
}, I = "_dateField_58xuo_1", M = "_inputField_58xuo_7", P = "_medium_58xuo_38", R = "_clearButton_58xuo_47", o = {
|
|
16
|
-
dateField: I,
|
|
17
|
-
inputField: M,
|
|
18
|
-
medium: P,
|
|
19
|
-
clearButton: R
|
|
20
|
-
}, W = ({
|
|
21
|
-
isClearable: i,
|
|
22
|
-
size: t,
|
|
23
|
-
isDisabled: s,
|
|
24
|
-
isReadOnly: r
|
|
25
|
-
}) => {
|
|
26
|
-
const l = V(E), a = x.useContext(D), n = N(), m = () => {
|
|
27
|
-
a?.setValue(null), n?.focusFirst();
|
|
28
|
-
};
|
|
29
|
-
return i && a?.value != null && !r ? /* @__PURE__ */ e(
|
|
30
|
-
S,
|
|
31
|
-
{
|
|
32
|
-
onPress: m,
|
|
33
|
-
size: t,
|
|
34
|
-
isDisabled: s,
|
|
35
|
-
"aria-label": l.format("clear"),
|
|
36
|
-
className: d(o.clearButton, {
|
|
37
|
-
[o.medium]: t === "medium"
|
|
38
|
-
})
|
|
39
|
-
}
|
|
40
|
-
) : null;
|
|
41
|
-
}, Q = ({
|
|
42
|
-
className: i,
|
|
43
|
-
description: t,
|
|
44
|
-
errorMessage: s,
|
|
45
|
-
errorPosition: r = "top",
|
|
46
|
-
label: l,
|
|
47
|
-
size: a = "large",
|
|
48
|
-
popover: n,
|
|
49
|
-
isClearable: m = !1,
|
|
50
|
-
isReadOnly: c,
|
|
51
|
-
isDisabled: u,
|
|
52
|
-
...f
|
|
53
|
-
}) => /* @__PURE__ */ p(
|
|
54
|
-
h,
|
|
55
|
-
{
|
|
56
|
-
...f,
|
|
57
|
-
isReadOnly: c,
|
|
58
|
-
isDisabled: u,
|
|
59
|
-
className: d(o.dateField, i),
|
|
60
|
-
children: [
|
|
61
|
-
/* @__PURE__ */ e(C, { popover: n, children: l && /* @__PURE__ */ e(b, { children: l }) }),
|
|
62
|
-
t && /* @__PURE__ */ e(L, { slot: "description", children: t }),
|
|
63
|
-
r === "top" && /* @__PURE__ */ e(F, { children: s }),
|
|
64
|
-
/* @__PURE__ */ e(
|
|
65
|
-
"div",
|
|
66
|
-
{
|
|
67
|
-
className: d(o.inputField, {
|
|
68
|
-
[o.medium]: a === "medium"
|
|
69
|
-
}),
|
|
70
|
-
"data-testid": "date-field_input-field",
|
|
71
|
-
children: /* @__PURE__ */ p(v, { children: [
|
|
72
|
-
/* @__PURE__ */ e(g, { children: (_) => /* @__PURE__ */ e(B, { segment: _ }) }),
|
|
73
|
-
/* @__PURE__ */ e(
|
|
74
|
-
W,
|
|
75
|
-
{
|
|
76
|
-
isClearable: m,
|
|
77
|
-
size: a,
|
|
78
|
-
isDisabled: u,
|
|
79
|
-
isReadOnly: c
|
|
80
|
-
}
|
|
81
|
-
)
|
|
82
|
-
] })
|
|
83
|
-
}
|
|
84
|
-
),
|
|
85
|
-
r === "bottom" && /* @__PURE__ */ e(F, { children: s })
|
|
86
|
-
]
|
|
87
|
-
}
|
|
88
|
-
);
|
|
89
|
-
export {
|
|
90
|
-
Q as D
|
|
91
|
-
};
|