@stihl-design-system/components 1.0.0-RC.3 → 1.0.0-RC.4
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/arialiveregions.49Zyf6mj.js +27 -0
- package/arialiveregions.d.ts +1 -0
- package/assets/CustomReactSelect.B0rJLjN0.css +1 -0
- package/assets/Notification.CCCbfXEz.css +1 -0
- package/assets/Toast.CAP_EwDX.css +1 -0
- package/assets/arialiveregions.VnhjP8Gr.css +1 -0
- package/assets/button.BuIpnG-S.css +1 -0
- package/assets/buttonround.C3ph5Yyu.css +1 -0
- package/assets/dialog.BGK3mgk7.css +1 -0
- package/assets/link.DQy_OhwC.css +1 -0
- package/assets/linkstandalone.Dh6bE5Fb.css +1 -0
- package/button.DX_nxoJC.js +135 -0
- package/buttonround.CXsBk9nL.js +118 -0
- package/{checkbox.C2Ga9yTK.js → checkbox.B43oeMeC.js} +6 -6
- package/checkboxgroup.C7aCjYds.js +9 -0
- package/chunks/AriaLiveRegions.utils.DzWI5KCU.js +31 -0
- package/{checkboxgroup.Cfxz9bk6.js → chunks/CheckboxGroup.CS6Q_TeZ.js} +27 -20
- package/chunks/{CustomReactSelect.uzWNynay.js → CustomReactSelect.DtmbYZUf.js} +455 -449
- package/{fieldset.DGcIKzDI.js → chunks/Fieldset.BokeZzG5.js} +20 -19
- package/chunks/Icon.9gDIp6p4.js +217 -0
- package/chunks/{Input.utils.Bly6ZzLI.js → Input.utils.AKWCNkpA.js} +12 -8
- package/{inputpassword.-MXq8baU.js → chunks/InputPassword.jpUCijp7.js} +15 -14
- package/{inputsearch.CoYTSjox.js → chunks/InputSearch.BmOtAZcR.js} +16 -14
- package/{inputstepper.BBMQr6kM.js → chunks/InputStepper.DTKjUL4U.js} +20 -19
- package/chunks/Notification.CUPOlHAX.js +93 -0
- package/{radiogroup.oILRMrX-.js → chunks/RadioGroup.DpwnVv7u.js} +37 -29
- package/{select.OGcreXnT.js → chunks/Select.DkDZo0ky.js} +49 -46
- package/{textarea.kc_Sfbgr.js → chunks/Textarea.C938p79X.js} +63 -61
- package/chunks/Toast.CLYrwQVO.js +89 -0
- package/chunks/{circle-info-colored.DLY6BTL4.js → circle-info-colored.D2pp54gf.js} +3 -3
- package/{combobox.BXHAo4Wx.js → combobox.BaSkiD6f.js} +7 -7
- package/components/AriaLiveRegions/AriaLiveRegions.d.ts +4 -0
- package/components/AriaLiveRegions/AriaLiveRegions.utils.d.ts +5 -0
- package/components/AriaLiveRegions/AriaLiveRegions.utils.test.d.ts +1 -0
- package/components/Checkbox/Checkbox.d.ts +1 -1
- package/components/CheckboxGroup/CheckboxGroup.utils.d.ts +1 -1
- package/components/Dialog/Dialog.d.ts +11 -0
- package/components/Dialog/Dialog.utils.d.ts +0 -0
- package/components/Fieldset/Fieldset.utils.d.ts +1 -1
- package/components/Notification/Notification.d.ts +26 -0
- package/components/Notification/Notification.test.d.ts +1 -0
- package/components/Notification/Notification.utils.d.ts +5 -0
- package/components/RadioGroup/RadioGroup.utils.d.ts +1 -1
- package/components/Toast/Toast.d.ts +21 -0
- package/components/Toast/Toast.utils.d.ts +9 -0
- package/components/Toast/ToastManager.d.ts +6 -0
- package/components/Toast/ToastManager.test.d.ts +1 -0
- package/components/Toast/ToastManager.utils.d.ts +2 -0
- package/components/Toast/ToastManager.utils.test.d.ts +1 -0
- package/{customreactselect.CipgVXTR.js → customreactselect.LTbjaBN2.js} +4 -4
- package/dialog.BkXwcbUh.js +45 -0
- package/dialog.d.ts +1 -0
- package/fieldset.BXOWK-B-.js +11 -0
- package/{floatingactionbutton.DzHD39NY.js → floatingactionbutton.-nDRRiXY.js} +9 -9
- package/icon.Cpp_9L1I.js +8 -0
- package/index.d.ts +24 -0
- package/index.es.js +138 -45
- package/{input.o8OT6rxJ.js → input.BM6tyRUm.js} +34 -34
- package/inputpassword.DUxH1K_k.js +12 -0
- package/inputsearch.B-vePHle.js +13 -0
- package/inputstepper.C2ypADPI.js +13 -0
- package/link.B4XZoLDj.js +115 -0
- package/linkstandalone.BSfd95Pd.js +79 -0
- package/notification.CxxAOdNV.js +9 -0
- package/notification.d.ts +1 -0
- package/{optioncheckbox.-DRnW_ch.js → optioncheckbox.CUV1MQhh.js} +3 -3
- package/package.json +3 -3
- package/radiogroup.CMJ1b38q.js +11 -0
- package/select.DFJK2mHF.js +12 -0
- package/{spinner.Diy_EeFY.js → spinner.BskX4ovu.js} +1 -1
- package/styles/scss/_index.scss +1 -0
- package/styles/scss/lib/_animation.scss +18 -4
- package/styles/scss/lib/_grid-sidebar-sidebar.scss +2 -0
- package/styles/scss/lib/_link.scss +1 -0
- package/styles/scss/lib/_shadow.scss +10 -0
- package/styles/scss/lib/_theme.scss +7 -5
- package/{switch.BjoFKMQC.js → switch.Bx2tDKx0.js} +2 -2
- package/{systemfeedback.C7iXO5A1.js → systemfeedback.4Hkfigi-.js} +1 -1
- package/textarea.DPy3TJJf.js +12 -0
- package/toast.C-Yg5EoE.js +10 -0
- package/toast.d.ts +1 -0
- package/toastmanager.DQ_-eTrx.js +96 -0
- package/toastmanager.d.ts +1 -0
- package/utils/vitest.setup.d.ts +2 -0
- package/assets/CustomReactSelect.BdwXfLLO.css +0 -1
- package/assets/button.DJvR-58w.css +0 -1
- package/assets/buttonround.BlfQkmMV.css +0 -1
- package/assets/link.V7pJOW1p.css +0 -1
- package/assets/linkstandalone.D3RbBp23.css +0 -1
- package/button.BUUGRxIp.js +0 -135
- package/buttonround.CKc-a-hd.js +0 -118
- package/icon.PX9_1kNB.js +0 -215
- package/link.BN6AZfhG.js +0 -115
- package/linkstandalone.4-fyRd08.js +0 -79
- /package/assets/{fieldset.xazpUXJX.css → Fieldset.xazpUXJX.css} +0 -0
- /package/assets/{icon.CB-KQmw4.css → Icon.CB-KQmw4.css} +0 -0
- /package/assets/{inputpassword.C3Uyj7oA.css → InputPassword.C3Uyj7oA.css} +0 -0
- /package/assets/{inputsearch.tL3e9-Ob.css → InputSearch.tL3e9-Ob.css} +0 -0
- /package/assets/{inputstepper.paPJix5A.css → InputStepper.paPJix5A.css} +0 -0
- /package/assets/{select.D2qBxaHP.css → Select.D2qBxaHP.css} +0 -0
- /package/assets/{textarea.BKbocznb.css → Textarea.BKbocznb.css} +0 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { j as s } from "./jsx-runtime.C-kxDJ4g.js";
|
|
3
|
+
import { c } from "./index.CvOaL64Y.js";
|
|
4
|
+
import { D as p } from "./Icon.9gDIp6p4.js";
|
|
5
|
+
import { DSButton as g } from "../button.DX_nxoJC.js";
|
|
6
|
+
import '../assets/Notification.CCCbfXEz.css';const N = "_root_unops_63", f = "_root--success_unops_87", h = "_root--error_unops_91", I = "_root--warning_unops_95", x = "_root--hide-icon_unops_99", A = "_content_unops_113", C = "_content--hide-close-button_unops_120", H = "_content--hide-icon_unops_123", j = "_icon_unops_127", S = "_message_unops_131", w = "_custom-action-area_unops_144", o = {
|
|
7
|
+
root: N,
|
|
8
|
+
"root--success": "_root--success_unops_87",
|
|
9
|
+
rootSuccess: f,
|
|
10
|
+
"root--error": "_root--error_unops_91",
|
|
11
|
+
rootError: h,
|
|
12
|
+
"root--warning": "_root--warning_unops_95",
|
|
13
|
+
rootWarning: I,
|
|
14
|
+
"root--hide-icon": "_root--hide-icon_unops_99",
|
|
15
|
+
rootHideIcon: x,
|
|
16
|
+
content: A,
|
|
17
|
+
"content--hide-close-button": "_content--hide-close-button_unops_120",
|
|
18
|
+
contentHideCloseButton: C,
|
|
19
|
+
"content--hide-icon": "_content--hide-icon_unops_123",
|
|
20
|
+
contentHideIcon: H,
|
|
21
|
+
icon: j,
|
|
22
|
+
message: S,
|
|
23
|
+
"custom-action-area": "_custom-action-area_unops_144",
|
|
24
|
+
customActionArea: w
|
|
25
|
+
}, R = [
|
|
26
|
+
"success",
|
|
27
|
+
"error",
|
|
28
|
+
"warning",
|
|
29
|
+
"info"
|
|
30
|
+
], O = {
|
|
31
|
+
success: "circle-check-colored",
|
|
32
|
+
error: "diamond-exclamationmark-colored",
|
|
33
|
+
warning: "triangle-exclamationmark-colored",
|
|
34
|
+
info: "circle-info-colored"
|
|
35
|
+
}, T = {
|
|
36
|
+
error: "alert",
|
|
37
|
+
warning: "alert",
|
|
38
|
+
info: "status",
|
|
39
|
+
success: "status"
|
|
40
|
+
}, B = ({
|
|
41
|
+
children: i,
|
|
42
|
+
variant: n = "info",
|
|
43
|
+
customActionArea: e,
|
|
44
|
+
className: a,
|
|
45
|
+
closeButtonLabel: _ = "Close notification",
|
|
46
|
+
hideCloseButton: r = !1,
|
|
47
|
+
hideIcon: t = !1,
|
|
48
|
+
onClose: u,
|
|
49
|
+
...l
|
|
50
|
+
}) => {
|
|
51
|
+
const m = c(o.root, a, {
|
|
52
|
+
[o.rootSuccess]: n === "success",
|
|
53
|
+
[o.rootError]: n === "error",
|
|
54
|
+
[o.rootWarning]: n === "warning",
|
|
55
|
+
[o.rootInfo]: n === "info",
|
|
56
|
+
[o.rootHideIcon]: t
|
|
57
|
+
}), d = c(o.content, {
|
|
58
|
+
[o.contentHideCloseButton]: r,
|
|
59
|
+
[o.contentHideIcon]: t
|
|
60
|
+
});
|
|
61
|
+
return /* @__PURE__ */ s.jsxs("div", { className: m, ...l, role: T[n], children: [
|
|
62
|
+
/* @__PURE__ */ s.jsxs("div", { className: d, children: [
|
|
63
|
+
!t && /* @__PURE__ */ s.jsx(
|
|
64
|
+
p,
|
|
65
|
+
{
|
|
66
|
+
name: O[n],
|
|
67
|
+
className: o.icon,
|
|
68
|
+
"aria-hidden": "true"
|
|
69
|
+
}
|
|
70
|
+
),
|
|
71
|
+
/* @__PURE__ */ s.jsx("div", { className: o.message, children: i }),
|
|
72
|
+
!r && /* @__PURE__ */ s.jsx(
|
|
73
|
+
g,
|
|
74
|
+
{
|
|
75
|
+
hideLabel: !0,
|
|
76
|
+
iconName: "cross",
|
|
77
|
+
isFlush: !0,
|
|
78
|
+
variant: "ghost",
|
|
79
|
+
size: "small",
|
|
80
|
+
onClick: u,
|
|
81
|
+
type: "button",
|
|
82
|
+
children: _
|
|
83
|
+
}
|
|
84
|
+
)
|
|
85
|
+
] }),
|
|
86
|
+
e && /* @__PURE__ */ s.jsx("div", { className: c({ [o.customActionArea]: !t }), children: e })
|
|
87
|
+
] });
|
|
88
|
+
};
|
|
89
|
+
export {
|
|
90
|
+
B as D,
|
|
91
|
+
R as N,
|
|
92
|
+
O as a
|
|
93
|
+
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { j as d } from "./
|
|
3
|
-
import { c as N } from "./
|
|
2
|
+
import { j as d } from "./jsx-runtime.C-kxDJ4g.js";
|
|
3
|
+
import { c as N } from "./index.CvOaL64Y.js";
|
|
4
4
|
import { forwardRef as P, useState as C } from "react";
|
|
5
|
-
import {
|
|
6
|
-
import { DSRadio as z } from "
|
|
7
|
-
import { s as c } from "./
|
|
8
|
-
import { g as a } from "./
|
|
9
|
-
const f = (
|
|
10
|
-
description:
|
|
5
|
+
import { D as y } from "./Fieldset.BokeZzG5.js";
|
|
6
|
+
import { DSRadio as z } from "../radio.Bhu9OUY-.js";
|
|
7
|
+
import { s as c } from "./RadioGroup.module.bi3leRes.js";
|
|
8
|
+
import { g as a } from "./helpers.B1JT5ShS.js";
|
|
9
|
+
const f = (r) => `The "${r}" prop is required. Please add the "${r}" prop to the DSRadioGroup component.`, M = ({
|
|
10
|
+
description: r,
|
|
11
11
|
id: e,
|
|
12
12
|
legend: t,
|
|
13
13
|
name: s,
|
|
14
14
|
options: i,
|
|
15
15
|
systemFeedback: n
|
|
16
16
|
}) => {
|
|
17
|
-
if (!e && (
|
|
17
|
+
if (!e && (r || n))
|
|
18
18
|
throw new Error(
|
|
19
19
|
a(
|
|
20
20
|
"DSRadioGroup",
|
|
@@ -35,7 +35,7 @@ const f = (o) => `The "${o}" prop is required. Please add the "${o}" prop to the
|
|
|
35
35
|
);
|
|
36
36
|
}, O = P(
|
|
37
37
|
({
|
|
38
|
-
legend:
|
|
38
|
+
legend: r,
|
|
39
39
|
name: e,
|
|
40
40
|
options: t,
|
|
41
41
|
alignment: s = "vertical",
|
|
@@ -45,52 +45,59 @@ const f = (o) => `The "${o}" prop is required. Please add the "${o}" prop to the
|
|
|
45
45
|
disabled: l = !1,
|
|
46
46
|
id: h,
|
|
47
47
|
invalid: p = !1,
|
|
48
|
-
required:
|
|
48
|
+
required: D = !1,
|
|
49
49
|
systemFeedback: u,
|
|
50
|
-
value:
|
|
50
|
+
value: S,
|
|
51
51
|
onChange: R,
|
|
52
|
-
...
|
|
52
|
+
...g
|
|
53
53
|
}, v) => {
|
|
54
|
-
process.env.NODE_ENV !== "production" && M({
|
|
55
|
-
|
|
54
|
+
process.env.NODE_ENV !== "production" && M({
|
|
55
|
+
description: m,
|
|
56
|
+
id: h,
|
|
57
|
+
legend: r,
|
|
58
|
+
name: e,
|
|
59
|
+
options: t,
|
|
60
|
+
systemFeedback: u
|
|
61
|
+
});
|
|
62
|
+
const [E, x] = C(n), w = S !== void 0, G = w ? S : E, j = N(c.root, {
|
|
56
63
|
// In case of longer copy, use vertical alignment
|
|
57
64
|
[c.rootHorizontal]: s === "horizontal",
|
|
58
65
|
[c.rootInvalid]: p && !!u
|
|
59
|
-
}), q = (
|
|
66
|
+
}), q = (o) => {
|
|
60
67
|
if (l) {
|
|
61
|
-
|
|
68
|
+
o.preventDefault();
|
|
62
69
|
return;
|
|
63
70
|
}
|
|
64
71
|
w || x(
|
|
65
|
-
|
|
66
|
-
), R && R(
|
|
72
|
+
o.target.value
|
|
73
|
+
), R && R(o);
|
|
67
74
|
};
|
|
68
75
|
return /* @__PURE__ */ d.jsx(
|
|
69
76
|
y,
|
|
70
77
|
{
|
|
71
78
|
id: h,
|
|
72
|
-
legend:
|
|
79
|
+
legend: r,
|
|
73
80
|
className: i,
|
|
74
81
|
description: m,
|
|
75
82
|
disabled: l,
|
|
76
|
-
required:
|
|
83
|
+
required: D,
|
|
77
84
|
invalid: p,
|
|
78
85
|
systemFeedback: u,
|
|
79
|
-
...
|
|
86
|
+
...g,
|
|
80
87
|
role: "radiogroup",
|
|
81
88
|
onChange: q,
|
|
82
|
-
children: /* @__PURE__ */ d.jsx("div", { className: j, children: t.map((
|
|
89
|
+
children: /* @__PURE__ */ d.jsx("div", { className: j, children: t.map((o) => /* @__PURE__ */ d.jsx(
|
|
83
90
|
z,
|
|
84
91
|
{
|
|
85
92
|
name: e,
|
|
86
|
-
checked:
|
|
93
|
+
checked: o.value === G,
|
|
87
94
|
disabled: l,
|
|
88
95
|
invalid: p,
|
|
89
|
-
required:
|
|
90
|
-
ref:
|
|
91
|
-
...
|
|
96
|
+
required: D,
|
|
97
|
+
ref: o.value === G ? v : null,
|
|
98
|
+
...o
|
|
92
99
|
},
|
|
93
|
-
|
|
100
|
+
o.label + o.value
|
|
94
101
|
)) })
|
|
95
102
|
}
|
|
96
103
|
);
|
|
@@ -98,5 +105,6 @@ const f = (o) => `The "${o}" prop is required. Please add the "${o}" prop to the
|
|
|
98
105
|
);
|
|
99
106
|
O.displayName = "DSRadioGroup";
|
|
100
107
|
export {
|
|
101
|
-
O as
|
|
108
|
+
O as D,
|
|
109
|
+
M as v
|
|
102
110
|
};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { j as t } from "./
|
|
3
|
-
import { c as _ } from "./
|
|
2
|
+
import { j as t } from "./jsx-runtime.C-kxDJ4g.js";
|
|
3
|
+
import { c as _ } from "./index.CvOaL64Y.js";
|
|
4
4
|
import { useRef as $, useState as C, useEffect as W } from "react";
|
|
5
|
-
import { u as F } from "./
|
|
6
|
-
import { Asterisk as M } from "
|
|
7
|
-
import {
|
|
8
|
-
import { DSSystemFeedback as
|
|
9
|
-
import { g as f } from "./
|
|
10
|
-
import '
|
|
11
|
-
root:
|
|
12
|
-
hint:
|
|
13
|
-
label:
|
|
14
|
-
wrapper:
|
|
15
|
-
affix:
|
|
5
|
+
import { u as F } from "./useBreakpoint.5xBNDiCf.js";
|
|
6
|
+
import { Asterisk as M } from "../asterisk.DU8THnoC.js";
|
|
7
|
+
import { D as O } from "./Icon.9gDIp6p4.js";
|
|
8
|
+
import { DSSystemFeedback as T } from "../systemfeedback.4Hkfigi-.js";
|
|
9
|
+
import { g as f } from "./helpers.B1JT5ShS.js";
|
|
10
|
+
import '../assets/Select.D2qBxaHP.css';const V = "_root_quxca_187", Z = "_hint_quxca_195", J = "_label_quxca_195", K = "_wrapper_quxca_199", Q = "_affix_quxca_205", U = "_affix--small_quxca_225", X = "_affix--disabled_quxca_237", Y = "_prefix_quxca_240", z = "_affix--readonly_quxca_243", G = "_suffix_quxca_253", ee = "_action-button_quxca_260", ae = "_label--hidden_quxca_277", te = "_feedback_quxca_304", se = "_select-wrapper_quxca_309", ce = "_select_quxca_309", ne = "_select--invalid_quxca_428", le = "_select--small_quxca_435", oe = "_input--has-leading-icon_quxca_481", ie = "_input--has-action-button_quxca_484", re = "_input--has-second-action-button_quxca_487", _e = "_select--has-leading-icon_quxca_490", ue = "_select--has-action-button_quxca_493", de = "_select--has-second-action-button_quxca_496", xe = "_select--has-affix_quxca_499", fe = "_select--is-ready_quxca_511", he = "_select--placeholder_quxca_523", pe = "_chevron_quxca_532", be = "_chevron--small_quxca_536", me = "_chevron--disabled_quxca_539", e = {
|
|
11
|
+
root: V,
|
|
12
|
+
hint: Z,
|
|
13
|
+
label: J,
|
|
14
|
+
wrapper: K,
|
|
15
|
+
affix: Q,
|
|
16
16
|
"affix--small": "_affix--small_quxca_225",
|
|
17
|
-
affixSmall:
|
|
17
|
+
affixSmall: U,
|
|
18
18
|
"affix--disabled": "_affix--disabled_quxca_237",
|
|
19
|
-
affixDisabled:
|
|
20
|
-
prefix:
|
|
19
|
+
affixDisabled: X,
|
|
20
|
+
prefix: Y,
|
|
21
21
|
"affix--readonly": "_affix--readonly_quxca_243",
|
|
22
22
|
affixReadonly: z,
|
|
23
23
|
suffix: G,
|
|
@@ -27,8 +27,8 @@ import './assets/select.D2qBxaHP.css';const J = "_root_quxca_187", K = "_hint_qu
|
|
|
27
27
|
labelHidden: ae,
|
|
28
28
|
feedback: te,
|
|
29
29
|
"select-wrapper": "_select-wrapper_quxca_309",
|
|
30
|
-
selectWrapper:
|
|
31
|
-
select:
|
|
30
|
+
selectWrapper: se,
|
|
31
|
+
select: ce,
|
|
32
32
|
"select--invalid": "_select--invalid_quxca_428",
|
|
33
33
|
selectInvalid: ne,
|
|
34
34
|
"select--small": "_select--small_quxca_435",
|
|
@@ -56,10 +56,10 @@ import './assets/select.D2qBxaHP.css';const J = "_root_quxca_187", K = "_hint_qu
|
|
|
56
56
|
chevronSmall: be,
|
|
57
57
|
"chevron--disabled": "_chevron--disabled_quxca_539",
|
|
58
58
|
chevronDisabled: me
|
|
59
|
-
}, qe = ({
|
|
59
|
+
}, Ae = ["medium", "small"], qe = ({
|
|
60
60
|
id: a,
|
|
61
61
|
label: n,
|
|
62
|
-
options:
|
|
62
|
+
options: c
|
|
63
63
|
}) => {
|
|
64
64
|
if (!a)
|
|
65
65
|
throw new Error(
|
|
@@ -75,21 +75,21 @@ import './assets/select.D2qBxaHP.css';const J = "_root_quxca_187", K = "_hint_qu
|
|
|
75
75
|
`A label is always required for a11y reasons. Please add a descriptive "label" prop to the DSSelect component. If you don't want to display a label, set hideLabel={true}.`
|
|
76
76
|
)
|
|
77
77
|
);
|
|
78
|
-
if (!
|
|
78
|
+
if (!c || c.length === 0)
|
|
79
79
|
throw new Error(
|
|
80
80
|
f(
|
|
81
81
|
"DSSelect",
|
|
82
82
|
'Options are always required. Please add an "options" prop to the DSSelect component.'
|
|
83
83
|
)
|
|
84
84
|
);
|
|
85
|
-
}, ve = (a, n,
|
|
85
|
+
}, ve = (a, n, c) => a === "" || n !== void 0 && n !== "" ? !1 : !(c !== void 0 && c !== ""), Be = ({
|
|
86
86
|
id: a,
|
|
87
87
|
label: n,
|
|
88
|
-
options:
|
|
89
|
-
className:
|
|
88
|
+
options: c,
|
|
89
|
+
className: D,
|
|
90
90
|
defaultValue: h,
|
|
91
91
|
disabled: p = !1,
|
|
92
|
-
hideLabel:
|
|
92
|
+
hideLabel: H = !1,
|
|
93
93
|
hint: u,
|
|
94
94
|
invalid: r = !1,
|
|
95
95
|
placeholder: d = "Select",
|
|
@@ -97,14 +97,14 @@ import './assets/select.D2qBxaHP.css';const J = "_root_quxca_187", K = "_hint_qu
|
|
|
97
97
|
size: m = "medium",
|
|
98
98
|
systemFeedback: x,
|
|
99
99
|
value: q,
|
|
100
|
-
...
|
|
100
|
+
...I
|
|
101
101
|
}) => {
|
|
102
102
|
process.env.NODE_ENV !== "production" && qe({
|
|
103
103
|
id: a,
|
|
104
104
|
label: n,
|
|
105
|
-
options:
|
|
105
|
+
options: c
|
|
106
106
|
});
|
|
107
|
-
const i = $(null), [
|
|
107
|
+
const i = $(null), [w, j] = C(
|
|
108
108
|
ve(d, h, q)
|
|
109
109
|
);
|
|
110
110
|
W(() => {
|
|
@@ -115,39 +115,39 @@ import './assets/select.D2qBxaHP.css';const J = "_root_quxca_187", K = "_hint_qu
|
|
|
115
115
|
return;
|
|
116
116
|
const o = i.current.value;
|
|
117
117
|
j(o === "");
|
|
118
|
-
},
|
|
119
|
-
return
|
|
120
|
-
|
|
118
|
+
}, s = i.current;
|
|
119
|
+
return s.addEventListener("change", l), () => {
|
|
120
|
+
s.removeEventListener("change", l);
|
|
121
121
|
};
|
|
122
122
|
}, []);
|
|
123
|
-
const A = F(
|
|
123
|
+
const A = F(H), v = `${a}-label`, S = `${a}-feedback`, g = `${a}-hint`, B = u ? ` ${g}` : "", E = (l) => [
|
|
124
124
|
d && /* @__PURE__ */ t.jsx("option", { value: "", children: d }, `${a}-hidden-option-disabled-placeholder`),
|
|
125
|
-
...l.map((
|
|
126
|
-
if ("options" in
|
|
127
|
-
const { label: o, options: R } =
|
|
125
|
+
...l.map((s) => {
|
|
126
|
+
if ("options" in s) {
|
|
127
|
+
const { label: o, options: R } = s;
|
|
128
128
|
return /* @__PURE__ */ t.jsx("optgroup", { label: o, children: R.map(y) }, o);
|
|
129
129
|
} else
|
|
130
|
-
return y(
|
|
130
|
+
return y(s);
|
|
131
131
|
})
|
|
132
|
-
], y = ({ label: l, value:
|
|
132
|
+
], y = ({ label: l, value: s, isDisabled: o }) => /* @__PURE__ */ t.jsx("option", { value: s, disabled: o, children: l }, s), L = _(e.root, D), N = _(e.select, {
|
|
133
133
|
[e.selectSmall]: m === "small",
|
|
134
134
|
[e.selectInvalid]: r,
|
|
135
|
-
[e.selectPlaceholder]:
|
|
136
|
-
}),
|
|
135
|
+
[e.selectPlaceholder]: w
|
|
136
|
+
}), P = _(e.label, {
|
|
137
137
|
// hide label only visually to keep them available for assistive technologies
|
|
138
138
|
[e.labelHidden]: A
|
|
139
139
|
}), k = _(e.chevron, {
|
|
140
140
|
[e.chevronSmall]: m === "small",
|
|
141
141
|
[e.chevronDisabled]: p
|
|
142
142
|
});
|
|
143
|
-
return /* @__PURE__ */ t.jsxs("div", { className:
|
|
144
|
-
/* @__PURE__ */ t.jsxs("label", { className:
|
|
143
|
+
return /* @__PURE__ */ t.jsxs("div", { className: L, children: [
|
|
144
|
+
/* @__PURE__ */ t.jsxs("label", { className: P, id: v, htmlFor: a, children: [
|
|
145
145
|
n,
|
|
146
146
|
b && /* @__PURE__ */ t.jsx(M, {})
|
|
147
147
|
] }),
|
|
148
148
|
u && /* @__PURE__ */ t.jsx("div", { className: e.hint, id: g, children: u }),
|
|
149
149
|
r && x && /* @__PURE__ */ t.jsx(
|
|
150
|
-
|
|
150
|
+
T,
|
|
151
151
|
{
|
|
152
152
|
className: e.feedback,
|
|
153
153
|
message: x,
|
|
@@ -160,10 +160,10 @@ import './assets/select.D2qBxaHP.css';const J = "_root_quxca_187", K = "_hint_qu
|
|
|
160
160
|
/* @__PURE__ */ t.jsx(
|
|
161
161
|
"select",
|
|
162
162
|
{
|
|
163
|
-
...
|
|
163
|
+
...I,
|
|
164
164
|
id: a,
|
|
165
165
|
ref: i,
|
|
166
|
-
className:
|
|
166
|
+
className: N,
|
|
167
167
|
"aria-labelledby": `${v}${B}`,
|
|
168
168
|
"aria-describedby": r && x ? S : void 0,
|
|
169
169
|
"aria-invalid": r,
|
|
@@ -171,7 +171,7 @@ import './assets/select.D2qBxaHP.css';const J = "_root_quxca_187", K = "_hint_qu
|
|
|
171
171
|
value: q,
|
|
172
172
|
disabled: p,
|
|
173
173
|
required: b,
|
|
174
|
-
children:
|
|
174
|
+
children: E(c)
|
|
175
175
|
}
|
|
176
176
|
),
|
|
177
177
|
/* @__PURE__ */ t.jsx(
|
|
@@ -186,5 +186,8 @@ import './assets/select.D2qBxaHP.css';const J = "_root_quxca_187", K = "_hint_qu
|
|
|
186
186
|
] });
|
|
187
187
|
};
|
|
188
188
|
export {
|
|
189
|
-
|
|
189
|
+
Be as D,
|
|
190
|
+
Ae as S,
|
|
191
|
+
ve as g,
|
|
192
|
+
qe as v
|
|
190
193
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { j as n } from "./
|
|
3
|
-
import { c as S } from "./
|
|
2
|
+
import { j as n } from "./jsx-runtime.C-kxDJ4g.js";
|
|
3
|
+
import { c as S } from "./index.CvOaL64Y.js";
|
|
4
4
|
import { useState as c, useRef as le, useEffect as x } from "react";
|
|
5
|
-
import { u as oe, h as
|
|
6
|
-
import { g as H, p as V } from "./
|
|
7
|
-
import { Asterisk as
|
|
8
|
-
import { DSSystemFeedback as re } from "
|
|
9
|
-
import '
|
|
5
|
+
import { u as oe, h as se } from "./useBreakpoint.5xBNDiCf.js";
|
|
6
|
+
import { g as H, p as V } from "./helpers.B1JT5ShS.js";
|
|
7
|
+
import { Asterisk as ie } from "../asterisk.DU8THnoC.js";
|
|
8
|
+
import { DSSystemFeedback as re } from "../systemfeedback.4Hkfigi-.js";
|
|
9
|
+
import '../assets/Textarea.BKbocznb.css';const ce = "_textarea_1elbe_187", de = "_textarea--invalid_1elbe_297", _e = "_textarea--small_1elbe_304", ue = "_textarea--resize-auto_1elbe_316", fe = "_root_1elbe_326", be = "_hint_1elbe_334", xe = "_label_1elbe_334", me = "_affix_1elbe_338", he = "_affix--small_1elbe_358", pe = "_affix--disabled_1elbe_370", ve = "_prefix_1elbe_373", ge = "_affix--readonly_1elbe_376", Se = "_suffix_1elbe_386", Ie = "_leading-icon_1elbe_393", Ce = "_leading-icon--small_1elbe_405", ye = "_leading-icon--disabled_1elbe_408", Ae = "_action-button_1elbe_417", De = "_label--hidden_1elbe_434", je = "_feedback_1elbe_461", we = "_char-count_1elbe_466", Re = "_char-count-announcer_1elbe_481", t = {
|
|
10
10
|
textarea: ce,
|
|
11
11
|
"textarea--invalid": "_textarea--invalid_1elbe_297",
|
|
12
12
|
textareaInvalid: de,
|
|
@@ -17,9 +17,9 @@ import './assets/textarea.BKbocznb.css';const ce = "_textarea_1elbe_187", de = "
|
|
|
17
17
|
root: fe,
|
|
18
18
|
hint: be,
|
|
19
19
|
label: xe,
|
|
20
|
-
affix:
|
|
20
|
+
affix: me,
|
|
21
21
|
"affix--small": "_affix--small_1elbe_358",
|
|
22
|
-
affixSmall:
|
|
22
|
+
affixSmall: he,
|
|
23
23
|
"affix--disabled": "_affix--disabled_1elbe_370",
|
|
24
24
|
affixDisabled: pe,
|
|
25
25
|
prefix: ve,
|
|
@@ -27,21 +27,21 @@ import './assets/textarea.BKbocznb.css';const ce = "_textarea_1elbe_187", de = "
|
|
|
27
27
|
affixReadonly: ge,
|
|
28
28
|
suffix: Se,
|
|
29
29
|
"leading-icon": "_leading-icon_1elbe_393",
|
|
30
|
-
leadingIcon:
|
|
30
|
+
leadingIcon: Ie,
|
|
31
31
|
"leading-icon--small": "_leading-icon--small_1elbe_405",
|
|
32
|
-
leadingIconSmall:
|
|
32
|
+
leadingIconSmall: Ce,
|
|
33
33
|
"leading-icon--disabled": "_leading-icon--disabled_1elbe_408",
|
|
34
34
|
leadingIconDisabled: ye,
|
|
35
35
|
"action-button": "_action-button_1elbe_417",
|
|
36
|
-
actionButton:
|
|
36
|
+
actionButton: Ae,
|
|
37
37
|
"label--hidden": "_label--hidden_1elbe_434",
|
|
38
|
-
labelHidden:
|
|
39
|
-
feedback:
|
|
38
|
+
labelHidden: De,
|
|
39
|
+
feedback: je,
|
|
40
40
|
"char-count": "_char-count_1elbe_466",
|
|
41
|
-
charCount:
|
|
41
|
+
charCount: we,
|
|
42
42
|
"char-count-announcer": "_char-count-announcer_1elbe_481",
|
|
43
43
|
charCountAnnouncer: Re
|
|
44
|
-
},
|
|
44
|
+
}, ze = ["medium", "small"], Te = ({ id: l, label: _ }) => {
|
|
45
45
|
if (!l)
|
|
46
46
|
throw new Error(
|
|
47
47
|
H(
|
|
@@ -56,7 +56,7 @@ import './assets/textarea.BKbocznb.css';const ce = "_textarea_1elbe_187", de = "
|
|
|
56
56
|
`A label is always required for a11y reasons. Please add a descriptive "label" prop to the DSTextarea component. If you don't want to display a label, set hideLabel={true}.`
|
|
57
57
|
)
|
|
58
58
|
);
|
|
59
|
-
},
|
|
59
|
+
}, Pe = ({
|
|
60
60
|
id: l,
|
|
61
61
|
label: _,
|
|
62
62
|
charsLimitText: z = "Character limit reached",
|
|
@@ -64,43 +64,43 @@ import './assets/textarea.BKbocznb.css';const ce = "_textarea_1elbe_187", de = "
|
|
|
64
64
|
className: q,
|
|
65
65
|
defaultValue: M,
|
|
66
66
|
disabled: O = !1,
|
|
67
|
-
hint:
|
|
67
|
+
hint: m,
|
|
68
68
|
hideLabel: F = !1,
|
|
69
69
|
invalid: o = !1,
|
|
70
70
|
maxLength: e,
|
|
71
|
-
readonly:
|
|
72
|
-
required:
|
|
71
|
+
readonly: I = !1,
|
|
72
|
+
required: C = !1,
|
|
73
73
|
resize: u = "vertical",
|
|
74
74
|
size: W = "medium",
|
|
75
|
-
systemFeedback:
|
|
76
|
-
value:
|
|
77
|
-
wrapperClassName:
|
|
75
|
+
systemFeedback: i,
|
|
76
|
+
value: h,
|
|
77
|
+
wrapperClassName: X,
|
|
78
78
|
onChange: y,
|
|
79
|
-
onInput:
|
|
80
|
-
...
|
|
79
|
+
onInput: A,
|
|
80
|
+
...Z
|
|
81
81
|
}) => {
|
|
82
|
-
process.env.NODE_ENV !== "production" &&
|
|
82
|
+
process.env.NODE_ENV !== "production" && Te({
|
|
83
83
|
id: l,
|
|
84
84
|
label: _
|
|
85
85
|
});
|
|
86
|
-
const [
|
|
86
|
+
const [G, D] = c(M || ""), [r, j] = c(0), [J, w] = c(0), [K, R] = c("off"), [T, p] = c(i), [v, g] = c(o), E = h !== void 0, f = E ? h : G, s = le(null), Q = oe(F);
|
|
87
87
|
x(() => {
|
|
88
88
|
if (!e || e <= 0)
|
|
89
89
|
return;
|
|
90
90
|
r >= e * 0.8 ? R("polite") : R("off");
|
|
91
91
|
const a = setTimeout(() => {
|
|
92
|
-
|
|
92
|
+
w(e - r || 0);
|
|
93
93
|
}, 1e3);
|
|
94
94
|
return () => clearTimeout(a);
|
|
95
95
|
}, [r]), x(() => {
|
|
96
|
-
|
|
97
|
-
}, [
|
|
98
|
-
o &&
|
|
99
|
-
}, [o, v,
|
|
100
|
-
if (
|
|
96
|
+
D(f || ""), d(), e && e > 0 && (j(f.toString().length || 0), w(e - f.toString().length || 0));
|
|
97
|
+
}, [h]), x(() => {
|
|
98
|
+
o && i ? (p(i), g(o)) : !o && e && e >= 0 && r >= e ? (g(!0), p(z)) : (p(i), g(o));
|
|
99
|
+
}, [o, v, i, r]), x(() => {
|
|
100
|
+
if (se && u === "auto")
|
|
101
101
|
return d(), window.addEventListener("resize", d), () => window.removeEventListener("resize", d);
|
|
102
|
-
}, [u,
|
|
103
|
-
const
|
|
102
|
+
}, [u, s.current]);
|
|
103
|
+
const U = S(t.root, X), Y = S(t.textarea, q, {
|
|
104
104
|
// small textarea
|
|
105
105
|
[t.textareaSmall]: W === "small",
|
|
106
106
|
// invalid state
|
|
@@ -109,53 +109,53 @@ import './assets/textarea.BKbocznb.css';const ce = "_textarea_1elbe_187", de = "
|
|
|
109
109
|
[t.textareaResizeAuto]: u === "auto"
|
|
110
110
|
}), L = S(t.label, {
|
|
111
111
|
// hide label only visually to keep them available for assistive technologies
|
|
112
|
-
[t.labelHidden]:
|
|
113
|
-
}),
|
|
114
|
-
if (
|
|
115
|
-
|
|
116
|
-
const a = V(
|
|
117
|
-
|
|
112
|
+
[t.labelHidden]: Q
|
|
113
|
+
}), N = `${l}-label`, B = `${l}-feedback`, $ = `${l}-hint`, k = `${l}-char-count-announcer`, ee = m ? ` ${$}` : "", d = () => {
|
|
114
|
+
if (s.current && u === "auto") {
|
|
115
|
+
s.current.style.height = "auto";
|
|
116
|
+
const a = V(s.current.scrollHeight), b = V(2);
|
|
117
|
+
s.current.style.height = `${// We need to add 2px (border-top & border-bottom) to the scrollHeight to prevent the textarea
|
|
118
118
|
// from jumping as soon as the user starts typing.
|
|
119
119
|
a + b}rem`;
|
|
120
120
|
}
|
|
121
121
|
}, ae = () => {
|
|
122
122
|
const a = [];
|
|
123
|
-
return e && e > 0 && a.push(k), o &&
|
|
123
|
+
return e && e > 0 && a.push(k), o && i && a.push(B), a.length > 0 ? a.join(" ") : void 0;
|
|
124
124
|
}, te = (a) => {
|
|
125
125
|
var b;
|
|
126
|
-
|
|
126
|
+
A && A(a), e && e > 0 && j(((b = s.current) == null ? void 0 : b.value.length) || 0), d();
|
|
127
127
|
}, ne = (a) => {
|
|
128
|
-
y && y(a),
|
|
128
|
+
y && y(a), E || D(a.target.value);
|
|
129
129
|
};
|
|
130
|
-
return /* @__PURE__ */ n.jsxs("div", { className:
|
|
131
|
-
/* @__PURE__ */ n.jsxs("label", { className: L, id:
|
|
130
|
+
return /* @__PURE__ */ n.jsxs("div", { className: U, children: [
|
|
131
|
+
/* @__PURE__ */ n.jsxs("label", { className: L, id: N, htmlFor: l, children: [
|
|
132
132
|
_,
|
|
133
|
-
|
|
133
|
+
C && /* @__PURE__ */ n.jsx(ie, {})
|
|
134
134
|
] }),
|
|
135
|
-
|
|
136
|
-
v &&
|
|
135
|
+
m && /* @__PURE__ */ n.jsx("div", { className: t.hint, id: $, children: m }),
|
|
136
|
+
v && T && /* @__PURE__ */ n.jsx(
|
|
137
137
|
re,
|
|
138
138
|
{
|
|
139
139
|
className: t.feedback,
|
|
140
|
-
message:
|
|
140
|
+
message: T,
|
|
141
141
|
type: "invalid",
|
|
142
|
-
id:
|
|
142
|
+
id: B
|
|
143
143
|
}
|
|
144
144
|
),
|
|
145
145
|
/* @__PURE__ */ n.jsx(
|
|
146
146
|
"textarea",
|
|
147
147
|
{
|
|
148
|
-
className:
|
|
148
|
+
className: Y,
|
|
149
149
|
id: l,
|
|
150
|
-
ref:
|
|
151
|
-
...
|
|
152
|
-
"aria-labelledby": `${
|
|
150
|
+
ref: s,
|
|
151
|
+
...Z,
|
|
152
|
+
"aria-labelledby": `${N}${ee}`,
|
|
153
153
|
"aria-describedby": ae(),
|
|
154
154
|
"aria-invalid": o,
|
|
155
|
-
"aria-disabled":
|
|
155
|
+
"aria-disabled": I,
|
|
156
156
|
maxLength: e,
|
|
157
|
-
readOnly:
|
|
158
|
-
required:
|
|
157
|
+
readOnly: I,
|
|
158
|
+
required: C,
|
|
159
159
|
disabled: O,
|
|
160
160
|
value: f,
|
|
161
161
|
defaultValue: void 0,
|
|
@@ -176,12 +176,12 @@ import './assets/textarea.BKbocznb.css';const ce = "_textarea_1elbe_187", de = "
|
|
|
176
176
|
{
|
|
177
177
|
className: t.charCountAnnouncer,
|
|
178
178
|
id: k,
|
|
179
|
-
"aria-live":
|
|
179
|
+
"aria-live": K,
|
|
180
180
|
"aria-atomic": "true",
|
|
181
181
|
children: [
|
|
182
182
|
P,
|
|
183
183
|
" ",
|
|
184
|
-
|
|
184
|
+
J
|
|
185
185
|
]
|
|
186
186
|
}
|
|
187
187
|
)
|
|
@@ -189,5 +189,7 @@ import './assets/textarea.BKbocznb.css';const ce = "_textarea_1elbe_187", de = "
|
|
|
189
189
|
] });
|
|
190
190
|
};
|
|
191
191
|
export {
|
|
192
|
-
|
|
192
|
+
Pe as D,
|
|
193
|
+
ze as T,
|
|
194
|
+
Te as v
|
|
193
195
|
};
|