@stihl-design-system/components 1.0.0-RC.2 → 1.0.0-RC.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/README.md +1 -1
- package/assets/CustomReactSelect.BdwXfLLO.css +1 -0
- package/assets/RadioGroup.Ur8Ro-XL.css +1 -0
- package/assets/asterisk.C-o6rbGQ.css +1 -0
- package/assets/button.DJvR-58w.css +1 -0
- package/assets/buttonround.BlfQkmMV.css +1 -0
- package/assets/checkbox.BsFEWfQe.css +1 -0
- package/assets/fieldset.xazpUXJX.css +1 -0
- package/assets/heading.CGFucb-C.css +1 -0
- package/assets/input.BcP5kkZ2.css +1 -0
- package/assets/inputpassword.C3Uyj7oA.css +1 -0
- package/assets/inputsearch.tL3e9-Ob.css +1 -0
- package/assets/inputstepper.paPJix5A.css +1 -0
- package/assets/link.V7pJOW1p.css +1 -0
- package/assets/linkstandalone.D3RbBp23.css +1 -0
- package/assets/radio.CSHQGdpr.css +1 -0
- package/assets/select.D2qBxaHP.css +1 -0
- package/assets/switch.sqve8ApJ.css +1 -0
- package/assets/textarea.BKbocznb.css +1 -0
- package/assets/title.CE0Dm7PI.css +1 -0
- package/asterisk.DU8THnoC.js +8 -0
- package/button.BUUGRxIp.js +135 -0
- package/buttonround.CKc-a-hd.js +118 -0
- package/{checkbox.Bx5D_GAe.js → checkbox.C2Ga9yTK.js} +28 -28
- package/{checkboxgroup.gQwSHy4i.js → checkboxgroup.Cfxz9bk6.js} +3 -3
- package/chunks/{CustomReactSelect.Pvkkof1f.js → CustomReactSelect.uzWNynay.js} +222 -222
- package/chunks/RadioGroup.module.bi3leRes.js +11 -0
- package/chunks/whatsapp.CPpu-7Nn.js +10 -0
- package/{combobox.BOJ7aq_B.js → combobox.BXHAo4Wx.js} +1 -1
- package/components/CheckboxGroup/CheckboxGroup.d.ts +1 -1
- package/components/Fieldset/Fieldset.d.ts +1 -1
- package/components/Heading/Heading.utils.d.ts +1 -1
- package/components/Logo/Logo.d.ts +4 -2
- package/components/Logo/Logo.utils.d.ts +1 -0
- package/components/RadioGroup/RadioGroup.d.ts +1 -1
- package/customreactselect.CipgVXTR.js +13 -0
- package/fieldset.DGcIKzDI.js +98 -0
- package/{floatingactionbutton.BtQVIj6W.js → floatingactionbutton.DzHD39NY.js} +2 -2
- package/heading.DqGbFfj2.js +50 -0
- package/{icon.CmAhxgHK.js → icon.PX9_1kNB.js} +1 -1
- package/index.es.js +22 -22
- package/input.o8OT6rxJ.js +236 -0
- package/inputpassword.-MXq8baU.js +139 -0
- package/inputsearch.CoYTSjox.js +188 -0
- package/inputstepper.BBMQr6kM.js +290 -0
- package/link.BN6AZfhG.js +115 -0
- package/linkstandalone.4-fyRd08.js +79 -0
- package/{logo.DXWgPUY4.js → logo.C_oJ8isW.js} +25 -24
- package/{optioncheckbox.CYikfEsE.js → optioncheckbox.-DRnW_ch.js} +1 -1
- package/package.json +2 -2
- package/radio.Bhu9OUY-.js +79 -0
- package/{radiogroup.7ptQiohb.js → radiogroup.oILRMrX-.js} +3 -3
- package/select.OGcreXnT.js +190 -0
- package/{spinner.CSzQEBx2.js → spinner.Diy_EeFY.js} +1 -1
- package/styles/scss/lib/_grid-extended.scss +2 -2
- package/styles/scss/lib/_grid-sidebar-sidebar.scss +2 -2
- package/styles/scss/lib/_grid-sidebar.scss +6 -6
- package/styles/scss/lib/_heading.scss +14 -1
- package/styles/scss/lib/_link.scss +9 -9
- package/styles/scss/lib/_text.scss +4 -0
- package/switch.BjoFKMQC.js +65 -0
- package/{systemfeedback.rBgdiL5T.js → systemfeedback.C7iXO5A1.js} +1 -1
- package/textarea.kc_Sfbgr.js +193 -0
- package/title.icX0VDiO.js +36 -0
- package/types/icon-types.d.ts +1 -1
- package/assets/CustomReactSelect.bVnR5yBP.css +0 -1
- package/assets/RadioGroup.SF2fv4CL.css +0 -1
- package/assets/asterisk.Bz7RZnKb.css +0 -1
- package/assets/button.C6ZbQtZ-.css +0 -1
- package/assets/buttonround.CjJUeMND.css +0 -1
- package/assets/checkbox.Bbc6PYDK.css +0 -1
- package/assets/fieldset.DTFs_koU.css +0 -1
- package/assets/heading.5HpYs7wS.css +0 -1
- package/assets/input.GpXQJqEO.css +0 -1
- package/assets/inputpassword.B9J1hCcj.css +0 -1
- package/assets/inputsearch.BY0BGFPK.css +0 -1
- package/assets/inputstepper.B0oC1URa.css +0 -1
- package/assets/link.Di4qXro5.css +0 -1
- package/assets/linkstandalone.239FeO2E.css +0 -1
- package/assets/radio.pqc9u_wx.css +0 -1
- package/assets/select.DLOQ6wu0.css +0 -1
- package/assets/switch.DVlaePGM.css +0 -1
- package/assets/textarea.BNOpd7Nf.css +0 -1
- package/assets/title.1dq1eWy9.css +0 -1
- package/asterisk.BlYjsfkN.js +0 -8
- package/button.Di5XtChf.js +0 -135
- package/buttonround._w4KDbHE.js +0 -118
- package/chunks/RadioGroup.module.B35YQcsb.js +0 -11
- package/customreactselect.DPHXAssl.js +0 -13
- package/fieldset.yE6WV6Ls.js +0 -98
- package/heading.C6k7Gakb.js +0 -44
- package/input.vP5xcwzV.js +0 -236
- package/inputpassword.BiQ8ORmn.js +0 -139
- package/inputsearch.BA9N3RRc.js +0 -188
- package/inputstepper.Cyxeg2Cj.js +0 -290
- package/link.BoSdsZHj.js +0 -115
- package/linkstandalone.BoN7nARO.js +0 -79
- package/radio.DTO5-Yzf.js +0 -79
- package/select.Dx80W7cW.js +0 -190
- package/switch.BwGtQdnx.js +0 -65
- package/textarea.C8tp1ciU.js +0 -193
- package/title.BT-uIobN.js +0 -36
package/radio.DTO5-Yzf.js
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { j as e } from "./chunks/jsx-runtime.C-kxDJ4g.js";
|
|
3
|
-
import { c as d } from "./chunks/index.CvOaL64Y.js";
|
|
4
|
-
import { forwardRef as y, useRef as H, useState as I, useCallback as R } from "react";
|
|
5
|
-
import { u as S } from "./chunks/useBreakpoint.5xBNDiCf.js";
|
|
6
|
-
import './assets/radio.pqc9u_wx.css';const g = "_root_6ckz7_63", B = "_root--disabled_6ckz7_82", V = "_radio_6ckz7_86", w = "_dot_6ckz7_101", E = "_radio--invalid_6ckz7_123", L = "_label_6ckz7_128", O = "_label--hidden_6ckz7_138", P = "_input_6ckz7_151", o = {
|
|
7
|
-
root: g,
|
|
8
|
-
"root--disabled": "_root--disabled_6ckz7_82",
|
|
9
|
-
rootDisabled: B,
|
|
10
|
-
radio: V,
|
|
11
|
-
dot: w,
|
|
12
|
-
"radio--invalid": "_radio--invalid_6ckz7_123",
|
|
13
|
-
radioInvalid: E,
|
|
14
|
-
label: L,
|
|
15
|
-
"label--hidden": "_label--hidden_6ckz7_138",
|
|
16
|
-
labelHidden: O,
|
|
17
|
-
input: P
|
|
18
|
-
}, U = y(
|
|
19
|
-
({
|
|
20
|
-
label: t,
|
|
21
|
-
name: c,
|
|
22
|
-
value: _,
|
|
23
|
-
defaultChecked: u = !1,
|
|
24
|
-
disabled: s = !1,
|
|
25
|
-
hideLabel: k = !1,
|
|
26
|
-
checked: r,
|
|
27
|
-
invalid: f = !1,
|
|
28
|
-
className: b,
|
|
29
|
-
onChange: i,
|
|
30
|
-
...m
|
|
31
|
-
}, l) => {
|
|
32
|
-
const p = H(null), [h, z] = I(u), n = r !== void 0, v = n ? r : h, x = S(k), C = d(
|
|
33
|
-
o.root,
|
|
34
|
-
{
|
|
35
|
-
[o.rootDisabled]: s
|
|
36
|
-
},
|
|
37
|
-
b
|
|
38
|
-
), j = d(o.label, {
|
|
39
|
-
// hide label only visually to keep them available for assistive technologies
|
|
40
|
-
[o.labelHidden]: x
|
|
41
|
-
}), N = d(o.radio, {
|
|
42
|
-
[o.radioInvalid]: f
|
|
43
|
-
}), D = R(
|
|
44
|
-
(a) => {
|
|
45
|
-
if (s) {
|
|
46
|
-
a.preventDefault();
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
n || z(a.target.checked), i && i(a);
|
|
50
|
-
},
|
|
51
|
-
[s, n, i]
|
|
52
|
-
);
|
|
53
|
-
return /* @__PURE__ */ e.jsxs("label", { className: C, children: [
|
|
54
|
-
/* @__PURE__ */ e.jsx(
|
|
55
|
-
"input",
|
|
56
|
-
{
|
|
57
|
-
type: "radio",
|
|
58
|
-
value: _,
|
|
59
|
-
name: c,
|
|
60
|
-
className: o.input,
|
|
61
|
-
ref: (a) => {
|
|
62
|
-
typeof l == "function" ? l(a) : l !== null && (l.current = a), p.current = a;
|
|
63
|
-
},
|
|
64
|
-
onChange: D,
|
|
65
|
-
...m,
|
|
66
|
-
disabled: s,
|
|
67
|
-
checked: v,
|
|
68
|
-
"aria-label": typeof t == "string" ? t : void 0
|
|
69
|
-
}
|
|
70
|
-
),
|
|
71
|
-
/* @__PURE__ */ e.jsx("span", { className: N, children: /* @__PURE__ */ e.jsx("div", { className: o.dot }) }),
|
|
72
|
-
/* @__PURE__ */ e.jsx("span", { className: j, children: t })
|
|
73
|
-
] });
|
|
74
|
-
}
|
|
75
|
-
);
|
|
76
|
-
U.displayName = "DSRadio";
|
|
77
|
-
export {
|
|
78
|
-
U as DSRadio
|
|
79
|
-
};
|
package/select.Dx80W7cW.js
DELETED
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { j as t } from "./chunks/jsx-runtime.C-kxDJ4g.js";
|
|
3
|
-
import { c as _ } from "./chunks/index.CvOaL64Y.js";
|
|
4
|
-
import { useRef as C, useState as q, useEffect as W } from "react";
|
|
5
|
-
import { u as F } from "./chunks/useBreakpoint.5xBNDiCf.js";
|
|
6
|
-
import { Asterisk as M } from "./asterisk.BlYjsfkN.js";
|
|
7
|
-
import { DSIcon as O } from "./icon.CmAhxgHK.js";
|
|
8
|
-
import { DSSystemFeedback as V } from "./systemfeedback.rBgdiL5T.js";
|
|
9
|
-
import { g as u } from "./chunks/helpers.B1JT5ShS.js";
|
|
10
|
-
import './assets/select.DLOQ6wu0.css';const J = "_root_1kpli_187", K = "_hint_1kpli_195", Q = "_label_1kpli_195", T = "_wrapper_1kpli_199", U = "_affix_1kpli_205", X = "_affix--small_1kpli_225", Y = "_affix--disabled_1kpli_237", Z = "_prefix_1kpli_240", z = "_affix--readonly_1kpli_243", G = "_suffix_1kpli_253", ee = "_action-button_1kpli_260", le = "_label--hidden_1kpli_277", te = "_feedback_1kpli_304", se = "_select-wrapper_1kpli_309", ne = "_select_1kpli_309", ae = "_select--invalid_1kpli_428", ie = "_select--small_1kpli_435", ce = "_input--has-leading-icon_1kpli_481", oe = "_input--has-action-button_1kpli_484", re = "_input--has-second-action-button_1kpli_487", _e = "_select--has-leading-icon_1kpli_490", de = "_select--has-action-button_1kpli_493", pe = "_select--has-second-action-button_1kpli_496", fe = "_select--has-affix_1kpli_499", ue = "_select--is-ready_1kpli_511", he = "_select--placeholder_1kpli_523", be = "_chevron_1kpli_532", ke = "_chevron--small_1kpli_536", me = "_chevron--disabled_1kpli_539", e = {
|
|
11
|
-
root: J,
|
|
12
|
-
hint: K,
|
|
13
|
-
label: Q,
|
|
14
|
-
wrapper: T,
|
|
15
|
-
affix: U,
|
|
16
|
-
"affix--small": "_affix--small_1kpli_225",
|
|
17
|
-
affixSmall: X,
|
|
18
|
-
"affix--disabled": "_affix--disabled_1kpli_237",
|
|
19
|
-
affixDisabled: Y,
|
|
20
|
-
prefix: Z,
|
|
21
|
-
"affix--readonly": "_affix--readonly_1kpli_243",
|
|
22
|
-
affixReadonly: z,
|
|
23
|
-
suffix: G,
|
|
24
|
-
"action-button": "_action-button_1kpli_260",
|
|
25
|
-
actionButton: ee,
|
|
26
|
-
"label--hidden": "_label--hidden_1kpli_277",
|
|
27
|
-
labelHidden: le,
|
|
28
|
-
feedback: te,
|
|
29
|
-
"select-wrapper": "_select-wrapper_1kpli_309",
|
|
30
|
-
selectWrapper: se,
|
|
31
|
-
select: ne,
|
|
32
|
-
"select--invalid": "_select--invalid_1kpli_428",
|
|
33
|
-
selectInvalid: ae,
|
|
34
|
-
"select--small": "_select--small_1kpli_435",
|
|
35
|
-
selectSmall: ie,
|
|
36
|
-
"input--has-leading-icon": "_input--has-leading-icon_1kpli_481",
|
|
37
|
-
inputHasLeadingIcon: ce,
|
|
38
|
-
"input--has-action-button": "_input--has-action-button_1kpli_484",
|
|
39
|
-
inputHasActionButton: oe,
|
|
40
|
-
"input--has-second-action-button": "_input--has-second-action-button_1kpli_487",
|
|
41
|
-
inputHasSecondActionButton: re,
|
|
42
|
-
"select--has-leading-icon": "_select--has-leading-icon_1kpli_490",
|
|
43
|
-
selectHasLeadingIcon: _e,
|
|
44
|
-
"select--has-action-button": "_select--has-action-button_1kpli_493",
|
|
45
|
-
selectHasActionButton: de,
|
|
46
|
-
"select--has-second-action-button": "_select--has-second-action-button_1kpli_496",
|
|
47
|
-
selectHasSecondActionButton: pe,
|
|
48
|
-
"select--has-affix": "_select--has-affix_1kpli_499",
|
|
49
|
-
selectHasAffix: fe,
|
|
50
|
-
"select--is-ready": "_select--is-ready_1kpli_511",
|
|
51
|
-
selectIsReady: ue,
|
|
52
|
-
"select--placeholder": "_select--placeholder_1kpli_523",
|
|
53
|
-
selectPlaceholder: he,
|
|
54
|
-
chevron: be,
|
|
55
|
-
"chevron--small": "_chevron--small_1kpli_536",
|
|
56
|
-
chevronSmall: ke,
|
|
57
|
-
"chevron--disabled": "_chevron--disabled_1kpli_539",
|
|
58
|
-
chevronDisabled: me
|
|
59
|
-
}, xe = ({
|
|
60
|
-
id: l,
|
|
61
|
-
label: a,
|
|
62
|
-
options: n
|
|
63
|
-
}) => {
|
|
64
|
-
if (!l)
|
|
65
|
-
throw new Error(
|
|
66
|
-
u(
|
|
67
|
-
"DSSelect",
|
|
68
|
-
'A unique "id" prop is required. Please add an unique "id" prop to the DSSelect component.'
|
|
69
|
-
)
|
|
70
|
-
);
|
|
71
|
-
if (!a)
|
|
72
|
-
throw new Error(
|
|
73
|
-
u(
|
|
74
|
-
"DSSelect",
|
|
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
|
-
)
|
|
77
|
-
);
|
|
78
|
-
if (!n || n.length === 0)
|
|
79
|
-
throw new Error(
|
|
80
|
-
u(
|
|
81
|
-
"DSSelect",
|
|
82
|
-
'Options are always required. Please add an "options" prop to the DSSelect component.'
|
|
83
|
-
)
|
|
84
|
-
);
|
|
85
|
-
}, ve = (l, a, n) => l === "" || a !== void 0 && a !== "" ? !1 : !(n !== void 0 && n !== ""), Ae = ({
|
|
86
|
-
id: l,
|
|
87
|
-
label: a,
|
|
88
|
-
options: n,
|
|
89
|
-
className: H,
|
|
90
|
-
defaultValue: h,
|
|
91
|
-
disabled: b = !1,
|
|
92
|
-
hideLabel: w = !1,
|
|
93
|
-
hint: d,
|
|
94
|
-
invalid: r = !1,
|
|
95
|
-
placeholder: p = "Select",
|
|
96
|
-
required: k = !1,
|
|
97
|
-
size: m = "medium",
|
|
98
|
-
systemFeedback: f,
|
|
99
|
-
value: x,
|
|
100
|
-
...D
|
|
101
|
-
}) => {
|
|
102
|
-
process.env.NODE_ENV !== "production" && xe({
|
|
103
|
-
id: l,
|
|
104
|
-
label: a,
|
|
105
|
-
options: n
|
|
106
|
-
});
|
|
107
|
-
const o = C(null), [I, j] = q(
|
|
108
|
-
ve(p, h, x)
|
|
109
|
-
);
|
|
110
|
-
W(() => {
|
|
111
|
-
if (!o.current)
|
|
112
|
-
return;
|
|
113
|
-
const i = () => {
|
|
114
|
-
if (!o.current)
|
|
115
|
-
return;
|
|
116
|
-
const c = o.current.value;
|
|
117
|
-
j(c === "");
|
|
118
|
-
}, s = o.current;
|
|
119
|
-
return s.addEventListener("change", i), () => {
|
|
120
|
-
s.removeEventListener("change", i);
|
|
121
|
-
};
|
|
122
|
-
}, []);
|
|
123
|
-
const A = F(w), v = `${l}-label`, S = `${l}-feedback`, g = `${l}-hint`, B = d ? ` ${g}` : "", N = (i) => [
|
|
124
|
-
p && /* @__PURE__ */ t.jsx("option", { value: "", children: p }, `${l}-hidden-option-disabled-placeholder`),
|
|
125
|
-
...i.map((s) => {
|
|
126
|
-
if ("options" in s) {
|
|
127
|
-
const { label: c, options: $ } = s;
|
|
128
|
-
return /* @__PURE__ */ t.jsx("optgroup", { label: c, children: $.map(y) }, c);
|
|
129
|
-
} else
|
|
130
|
-
return y(s);
|
|
131
|
-
})
|
|
132
|
-
], y = ({ label: i, value: s, isDisabled: c }) => /* @__PURE__ */ t.jsx("option", { value: s, disabled: c, children: i }, s), P = _(e.root, H), E = _(e.select, {
|
|
133
|
-
[e.selectSmall]: m === "small",
|
|
134
|
-
[e.selectInvalid]: r,
|
|
135
|
-
[e.selectPlaceholder]: I
|
|
136
|
-
}), L = _(e.label, {
|
|
137
|
-
// hide label only visually to keep them available for assistive technologies
|
|
138
|
-
[e.labelHidden]: A
|
|
139
|
-
}), R = _(e.chevron, {
|
|
140
|
-
[e.chevronSmall]: m === "small",
|
|
141
|
-
[e.chevronDisabled]: b
|
|
142
|
-
});
|
|
143
|
-
return /* @__PURE__ */ t.jsxs("div", { className: P, children: [
|
|
144
|
-
/* @__PURE__ */ t.jsxs("label", { className: L, id: v, htmlFor: l, children: [
|
|
145
|
-
a,
|
|
146
|
-
k && /* @__PURE__ */ t.jsx(M, {})
|
|
147
|
-
] }),
|
|
148
|
-
d && /* @__PURE__ */ t.jsx("div", { className: e.hint, id: g, children: d }),
|
|
149
|
-
r && f && /* @__PURE__ */ t.jsx(
|
|
150
|
-
V,
|
|
151
|
-
{
|
|
152
|
-
className: e.feedback,
|
|
153
|
-
message: f,
|
|
154
|
-
type: "invalid",
|
|
155
|
-
id: S,
|
|
156
|
-
"aria-live": "assertive"
|
|
157
|
-
}
|
|
158
|
-
),
|
|
159
|
-
/* @__PURE__ */ t.jsxs("div", { className: e.selectWrapper, children: [
|
|
160
|
-
/* @__PURE__ */ t.jsx(
|
|
161
|
-
"select",
|
|
162
|
-
{
|
|
163
|
-
...D,
|
|
164
|
-
id: l,
|
|
165
|
-
ref: o,
|
|
166
|
-
className: E,
|
|
167
|
-
"aria-labelledby": `${v}${B}`,
|
|
168
|
-
"aria-describedby": r && f ? S : void 0,
|
|
169
|
-
"aria-invalid": r,
|
|
170
|
-
defaultValue: h,
|
|
171
|
-
value: x,
|
|
172
|
-
disabled: b,
|
|
173
|
-
required: k,
|
|
174
|
-
children: N(n)
|
|
175
|
-
}
|
|
176
|
-
),
|
|
177
|
-
/* @__PURE__ */ t.jsx(
|
|
178
|
-
O,
|
|
179
|
-
{
|
|
180
|
-
name: "chevron-down",
|
|
181
|
-
className: R,
|
|
182
|
-
"aria-hidden": "true"
|
|
183
|
-
}
|
|
184
|
-
)
|
|
185
|
-
] })
|
|
186
|
-
] });
|
|
187
|
-
};
|
|
188
|
-
export {
|
|
189
|
-
Ae as DSSelect
|
|
190
|
-
};
|
package/switch.BwGtQdnx.js
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { j as t } from "./chunks/jsx-runtime.C-kxDJ4g.js";
|
|
3
|
-
import { c as u } from "./chunks/index.CvOaL64Y.js";
|
|
4
|
-
import "react";
|
|
5
|
-
import { DSIcon as b } from "./icon.CmAhxgHK.js";
|
|
6
|
-
import { DSSpinner as p } from "./spinner.CSzQEBx2.js";
|
|
7
|
-
import './assets/switch.DVlaePGM.css';const f = "_root_ik5go_63", x = "_root--label-right_ik5go_91", j = "_root--stretched_ik5go_94", S = "_loader_ik5go_104", w = "_thumb_ik5go_157", C = "_root--checked_ik5go_172", o = {
|
|
8
|
-
root: f,
|
|
9
|
-
"root--label-right": "_root--label-right_ik5go_91",
|
|
10
|
-
rootLabelRight: x,
|
|
11
|
-
"root--stretched": "_root--stretched_ik5go_94",
|
|
12
|
-
rootStretched: j,
|
|
13
|
-
switch: "_switch_ik5go_99",
|
|
14
|
-
loader: S,
|
|
15
|
-
thumb: w,
|
|
16
|
-
"root--checked": "_root--checked_ik5go_172",
|
|
17
|
-
rootChecked: C
|
|
18
|
-
}, E = ({
|
|
19
|
-
children: i,
|
|
20
|
-
aria: h,
|
|
21
|
-
alignLabel: l = "left",
|
|
22
|
-
checked: e = !1,
|
|
23
|
-
className: _,
|
|
24
|
-
dataTrackingid: n,
|
|
25
|
-
disabled: s = !1,
|
|
26
|
-
loading: r = !1,
|
|
27
|
-
stretched: d = !1,
|
|
28
|
-
onClick: a,
|
|
29
|
-
...m
|
|
30
|
-
}) => {
|
|
31
|
-
const k = u(o.root, _, {
|
|
32
|
-
[o.rootChecked]: e === !0,
|
|
33
|
-
[o.rootStretched]: d === !0,
|
|
34
|
-
[o.rootLabelRight]: l === "right"
|
|
35
|
-
}), g = (c) => {
|
|
36
|
-
if (s || r) {
|
|
37
|
-
c.preventDefault();
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
a && a(c);
|
|
41
|
-
};
|
|
42
|
-
return /* @__PURE__ */ t.jsxs(
|
|
43
|
-
"button",
|
|
44
|
-
{
|
|
45
|
-
className: k,
|
|
46
|
-
"data-trackingid": n,
|
|
47
|
-
onClick: g,
|
|
48
|
-
...h,
|
|
49
|
-
...m,
|
|
50
|
-
type: "button",
|
|
51
|
-
role: "switch",
|
|
52
|
-
"aria-checked": e,
|
|
53
|
-
"aria-disabled": s || r,
|
|
54
|
-
"aria-busy": r,
|
|
55
|
-
children: [
|
|
56
|
-
/* @__PURE__ */ t.jsx("span", { children: i }),
|
|
57
|
-
!r && /* @__PURE__ */ t.jsx("span", { className: o.switch, children: /* @__PURE__ */ t.jsx("span", { className: o.thumb, children: /* @__PURE__ */ t.jsx(b, { name: "check", "aria-hidden": "true" }) }) }),
|
|
58
|
-
r && /* @__PURE__ */ t.jsx("span", { className: o.loader, children: /* @__PURE__ */ t.jsx(p, { aria: { "aria-label": "Loading state" } }) })
|
|
59
|
-
]
|
|
60
|
-
}
|
|
61
|
-
);
|
|
62
|
-
};
|
|
63
|
-
export {
|
|
64
|
-
E as DSSwitch
|
|
65
|
-
};
|
package/textarea.C8tp1ciU.js
DELETED
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { j as n } from "./chunks/jsx-runtime.C-kxDJ4g.js";
|
|
3
|
-
import { c as g } from "./chunks/index.CvOaL64Y.js";
|
|
4
|
-
import { useState as c, useRef as oa, useEffect as b } from "react";
|
|
5
|
-
import { u as ia, h as sa } from "./chunks/useBreakpoint.5xBNDiCf.js";
|
|
6
|
-
import { g as k, p as H } from "./chunks/helpers.B1JT5ShS.js";
|
|
7
|
-
import { Asterisk as ra } from "./asterisk.BlYjsfkN.js";
|
|
8
|
-
import { DSSystemFeedback as la } from "./systemfeedback.rBgdiL5T.js";
|
|
9
|
-
import './assets/textarea.BNOpd7Nf.css';const ca = "_textarea_au2z2_187", ua = "_textarea--invalid_au2z2_297", da = "_textarea--small_au2z2_304", _a = "_textarea--resize-auto_au2z2_316", fa = "_root_au2z2_326", xa = "_hint_au2z2_334", ba = "_label_au2z2_334", ha = "_affix_au2z2_338", ma = "_affix--small_au2z2_358", za = "_affix--disabled_au2z2_370", pa = "_prefix_au2z2_373", va = "_affix--readonly_au2z2_376", ga = "_suffix_au2z2_386", Sa = "_leading-icon_au2z2_393", Ca = "_leading-icon--small_au2z2_405", Ia = "_leading-icon--disabled_au2z2_408", ya = "_action-button_au2z2_417", ja = "_label--hidden_au2z2_434", wa = "_feedback_au2z2_461", Aa = "_char-count_au2z2_466", Da = "_char-count-announcer_au2z2_481", t = {
|
|
10
|
-
textarea: ca,
|
|
11
|
-
"textarea--invalid": "_textarea--invalid_au2z2_297",
|
|
12
|
-
textareaInvalid: ua,
|
|
13
|
-
"textarea--small": "_textarea--small_au2z2_304",
|
|
14
|
-
textareaSmall: da,
|
|
15
|
-
"textarea--resize-auto": "_textarea--resize-auto_au2z2_316",
|
|
16
|
-
textareaResizeAuto: _a,
|
|
17
|
-
root: fa,
|
|
18
|
-
hint: xa,
|
|
19
|
-
label: ba,
|
|
20
|
-
affix: ha,
|
|
21
|
-
"affix--small": "_affix--small_au2z2_358",
|
|
22
|
-
affixSmall: ma,
|
|
23
|
-
"affix--disabled": "_affix--disabled_au2z2_370",
|
|
24
|
-
affixDisabled: za,
|
|
25
|
-
prefix: pa,
|
|
26
|
-
"affix--readonly": "_affix--readonly_au2z2_376",
|
|
27
|
-
affixReadonly: va,
|
|
28
|
-
suffix: ga,
|
|
29
|
-
"leading-icon": "_leading-icon_au2z2_393",
|
|
30
|
-
leadingIcon: Sa,
|
|
31
|
-
"leading-icon--small": "_leading-icon--small_au2z2_405",
|
|
32
|
-
leadingIconSmall: Ca,
|
|
33
|
-
"leading-icon--disabled": "_leading-icon--disabled_au2z2_408",
|
|
34
|
-
leadingIconDisabled: Ia,
|
|
35
|
-
"action-button": "_action-button_au2z2_417",
|
|
36
|
-
actionButton: ya,
|
|
37
|
-
"label--hidden": "_label--hidden_au2z2_434",
|
|
38
|
-
labelHidden: ja,
|
|
39
|
-
feedback: wa,
|
|
40
|
-
"char-count": "_char-count_au2z2_466",
|
|
41
|
-
charCount: Aa,
|
|
42
|
-
"char-count-announcer": "_char-count-announcer_au2z2_481",
|
|
43
|
-
charCountAnnouncer: Da
|
|
44
|
-
}, Ra = ({ id: o, label: d }) => {
|
|
45
|
-
if (!o)
|
|
46
|
-
throw new Error(
|
|
47
|
-
k(
|
|
48
|
-
"DSTextarea",
|
|
49
|
-
'A unique "id" prop is required. Please add an unique "id" prop to the DSTextarea component.'
|
|
50
|
-
)
|
|
51
|
-
);
|
|
52
|
-
if (!d)
|
|
53
|
-
throw new Error(
|
|
54
|
-
k(
|
|
55
|
-
"DSTextarea",
|
|
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
|
-
)
|
|
58
|
-
);
|
|
59
|
-
}, Va = ({
|
|
60
|
-
id: o,
|
|
61
|
-
label: d,
|
|
62
|
-
charsLimitText: V = "Character limit reached",
|
|
63
|
-
charsRemainingText: P = "Characters remaining:",
|
|
64
|
-
className: q,
|
|
65
|
-
defaultValue: M,
|
|
66
|
-
disabled: O = !1,
|
|
67
|
-
hint: h,
|
|
68
|
-
hideLabel: F = !1,
|
|
69
|
-
invalid: i = !1,
|
|
70
|
-
maxLength: a,
|
|
71
|
-
readonly: S = !1,
|
|
72
|
-
required: C = !1,
|
|
73
|
-
resize: _ = "vertical",
|
|
74
|
-
size: W = "medium",
|
|
75
|
-
systemFeedback: r,
|
|
76
|
-
value: m,
|
|
77
|
-
wrapperClassName: G,
|
|
78
|
-
onChange: I,
|
|
79
|
-
onInput: y,
|
|
80
|
-
...J
|
|
81
|
-
}) => {
|
|
82
|
-
process.env.NODE_ENV !== "production" && Ra({
|
|
83
|
-
id: o,
|
|
84
|
-
label: d
|
|
85
|
-
});
|
|
86
|
-
const [K, j] = c(M || ""), [l, w] = c(0), [Q, A] = c(0), [U, D] = c("off"), [R, z] = c(r), [p, v] = c(i), N = m !== void 0, f = N ? m : K, s = oa(null), X = ia(F);
|
|
87
|
-
b(() => {
|
|
88
|
-
if (!a || a <= 0)
|
|
89
|
-
return;
|
|
90
|
-
l >= a * 0.8 ? D("polite") : D("off");
|
|
91
|
-
const e = setTimeout(() => {
|
|
92
|
-
A(a - l || 0);
|
|
93
|
-
}, 1e3);
|
|
94
|
-
return () => clearTimeout(e);
|
|
95
|
-
}, [l]), b(() => {
|
|
96
|
-
j(f || ""), u(), a && a > 0 && (w(f.toString().length || 0), A(a - f.toString().length || 0));
|
|
97
|
-
}, [m]), b(() => {
|
|
98
|
-
i && r ? (z(r), v(i)) : !i && a && a >= 0 && l >= a ? (v(!0), z(V)) : (z(r), v(i));
|
|
99
|
-
}, [i, p, r, l]), b(() => {
|
|
100
|
-
if (sa && _ === "auto")
|
|
101
|
-
return u(), window.addEventListener("resize", u), () => window.removeEventListener("resize", u);
|
|
102
|
-
}, [_, s.current]);
|
|
103
|
-
const Y = g(t.root, G), Z = g(t.textarea, q, {
|
|
104
|
-
// small textarea
|
|
105
|
-
[t.textareaSmall]: W === "small",
|
|
106
|
-
// invalid state
|
|
107
|
-
[t.textareaInvalid]: p,
|
|
108
|
-
// resize handling
|
|
109
|
-
[t.textareaResizeAuto]: _ === "auto"
|
|
110
|
-
}), L = g(t.label, {
|
|
111
|
-
// hide label only visually to keep them available for assistive technologies
|
|
112
|
-
[t.labelHidden]: X
|
|
113
|
-
}), T = `${o}-label`, B = `${o}-feedback`, E = `${o}-hint`, $ = `${o}-char-count-announcer`, aa = h ? ` ${E}` : "", u = () => {
|
|
114
|
-
if (s.current && _ === "auto") {
|
|
115
|
-
s.current.style.height = "auto";
|
|
116
|
-
const e = H(s.current.scrollHeight), x = H(2);
|
|
117
|
-
s.current.style.height = `${// We need to add 2px (border-top & border-bottom) to the scrollHeight to prevent the textarea
|
|
118
|
-
// from jumping as soon as the user starts typing.
|
|
119
|
-
e + x}rem`;
|
|
120
|
-
}
|
|
121
|
-
}, ea = () => {
|
|
122
|
-
const e = [];
|
|
123
|
-
return a && a > 0 && e.push($), i && r && e.push(B), e.length > 0 ? e.join(" ") : void 0;
|
|
124
|
-
}, ta = (e) => {
|
|
125
|
-
var x;
|
|
126
|
-
y && y(e), a && a > 0 && w(((x = s.current) == null ? void 0 : x.value.length) || 0), u();
|
|
127
|
-
}, na = (e) => {
|
|
128
|
-
I && I(e), N || j(e.target.value);
|
|
129
|
-
};
|
|
130
|
-
return /* @__PURE__ */ n.jsxs("div", { className: Y, children: [
|
|
131
|
-
/* @__PURE__ */ n.jsxs("label", { className: L, id: T, htmlFor: o, children: [
|
|
132
|
-
d,
|
|
133
|
-
C && /* @__PURE__ */ n.jsx(ra, {})
|
|
134
|
-
] }),
|
|
135
|
-
h && /* @__PURE__ */ n.jsx("div", { className: t.hint, id: E, children: h }),
|
|
136
|
-
p && R && /* @__PURE__ */ n.jsx(
|
|
137
|
-
la,
|
|
138
|
-
{
|
|
139
|
-
className: t.feedback,
|
|
140
|
-
message: R,
|
|
141
|
-
type: "invalid",
|
|
142
|
-
id: B
|
|
143
|
-
}
|
|
144
|
-
),
|
|
145
|
-
/* @__PURE__ */ n.jsx(
|
|
146
|
-
"textarea",
|
|
147
|
-
{
|
|
148
|
-
className: Z,
|
|
149
|
-
id: o,
|
|
150
|
-
ref: s,
|
|
151
|
-
...J,
|
|
152
|
-
"aria-labelledby": `${T}${aa}`,
|
|
153
|
-
"aria-describedby": ea(),
|
|
154
|
-
"aria-invalid": i,
|
|
155
|
-
"aria-disabled": S,
|
|
156
|
-
maxLength: a,
|
|
157
|
-
readOnly: S,
|
|
158
|
-
required: C,
|
|
159
|
-
disabled: O,
|
|
160
|
-
value: f,
|
|
161
|
-
defaultValue: void 0,
|
|
162
|
-
rows: void 0,
|
|
163
|
-
cols: void 0,
|
|
164
|
-
onChange: na,
|
|
165
|
-
onInput: ta
|
|
166
|
-
}
|
|
167
|
-
),
|
|
168
|
-
a !== void 0 && a > 0 && /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
169
|
-
/* @__PURE__ */ n.jsxs("div", { className: t.charCount, "aria-hidden": "true", children: [
|
|
170
|
-
l,
|
|
171
|
-
"/",
|
|
172
|
-
a
|
|
173
|
-
] }),
|
|
174
|
-
/* @__PURE__ */ n.jsxs(
|
|
175
|
-
"div",
|
|
176
|
-
{
|
|
177
|
-
className: t.charCountAnnouncer,
|
|
178
|
-
id: $,
|
|
179
|
-
"aria-live": U,
|
|
180
|
-
"aria-atomic": "true",
|
|
181
|
-
children: [
|
|
182
|
-
P,
|
|
183
|
-
" ",
|
|
184
|
-
Q
|
|
185
|
-
]
|
|
186
|
-
}
|
|
187
|
-
)
|
|
188
|
-
] })
|
|
189
|
-
] });
|
|
190
|
-
};
|
|
191
|
-
export {
|
|
192
|
-
Va as DSTextarea
|
|
193
|
-
};
|
package/title.BT-uIobN.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { j as t } from "./chunks/jsx-runtime.C-kxDJ4g.js";
|
|
3
|
-
import { c } from "./chunks/index.CvOaL64Y.js";
|
|
4
|
-
import './assets/title.1dq1eWy9.css';const n = "_root_1yriq_63", h = "_root--x-large_1yriq_66", m = "_root--large_1yriq_80", d = "_root--theme-dark_1yriq_94", x = "_dash_1yriq_97", r = {
|
|
5
|
-
root: n,
|
|
6
|
-
"root--x-large": "_root--x-large_1yriq_66",
|
|
7
|
-
rootXLarge: h,
|
|
8
|
-
"root--large": "_root--large_1yriq_80",
|
|
9
|
-
rootLarge: m,
|
|
10
|
-
"root--theme-dark": "_root--theme-dark_1yriq_94",
|
|
11
|
-
rootThemeDark: d,
|
|
12
|
-
dash: x
|
|
13
|
-
}, k = ({
|
|
14
|
-
children: e,
|
|
15
|
-
className: a,
|
|
16
|
-
size: o = "x-large",
|
|
17
|
-
tag: s = "h1",
|
|
18
|
-
// Design suggested to set default tag to h1
|
|
19
|
-
theme: _ = "light",
|
|
20
|
-
...l
|
|
21
|
-
}) => {
|
|
22
|
-
const g = s, i = c(r.root, a, {
|
|
23
|
-
// sizes
|
|
24
|
-
[r.rootXLarge]: o === "x-large",
|
|
25
|
-
[r.rootLarge]: o === "large",
|
|
26
|
-
// dark theme
|
|
27
|
-
[r.rootThemeDark]: _ === "dark"
|
|
28
|
-
});
|
|
29
|
-
return /* @__PURE__ */ t.jsxs(g, { className: i, ...l, children: [
|
|
30
|
-
e,
|
|
31
|
-
/* @__PURE__ */ t.jsx("span", { className: r.dash, "aria-hidden": "true", children: "ƒ" })
|
|
32
|
-
] });
|
|
33
|
-
};
|
|
34
|
-
export {
|
|
35
|
-
k as DSTitle
|
|
36
|
-
};
|