@stihl-design-system/components 1.0.0-RC.34 → 1.0.0-RC.36
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/Placeholder.svg +1 -1
- package/{actionbutton.DLQJU6AV.js → actionbutton.Du5CT-Mt.js} +2 -2
- package/{actionlink.DEBrWfN3.js → actionlink.BK9CaQUY.js} +2 -2
- package/assets/Button.CmeGVEAY.css +1 -0
- package/assets/CustomReactSelect.BihX36Uo.css +1 -0
- package/assets/Fieldset.Oqu7pOBv.css +1 -0
- package/assets/InputFile.D7Ihod7B.css +1 -0
- package/assets/InputNumber.z_UqRYdv.css +1 -0
- package/assets/InputPassword.DZENjxJ9.css +1 -0
- package/assets/InputSearch.GBH9Eh6F.css +1 -0
- package/assets/LinkButton.88j5ckLu.css +1 -0
- package/assets/RadioGroup.q1lQ-HIZ.css +1 -0
- package/assets/Select.CL0fqx7X.css +1 -0
- package/assets/Slider.DWLuIsNj.css +1 -0
- package/assets/Textarea.B1HOakic.css +1 -0
- package/assets/buttonround.DBpMesfr.css +1 -0
- package/assets/input.RPDR8qdT.css +1 -0
- package/assets/radio.CsfCywxz.css +1 -0
- package/{banner.CI5HnDqD.js → banner.AhUeW3HM.js} +1 -1
- package/{breadcrumb.CtwAux3P.js → breadcrumb.DpIAQk3r.js} +3 -3
- package/button.CqNYOfSj.js +12 -0
- package/buttonround.9IS0tUqw.js +96 -0
- package/{checkbox.DwccD0Mp.js → checkbox.XYQI-ubx.js} +2 -2
- package/{checkboxgroup.ZiUFfCJ1.js → checkboxgroup.C66ZwglF.js} +2 -2
- package/{chip.B0s_fS8L.js → chip.B-pxhsdb.js} +2 -2
- package/{chipgroup.Dpu66bo5.js → chipgroup.CY3pWyLO.js} +4 -3
- package/chunks/{ActionButton.DOYsEHPr.js → ActionButton.BOYQYo5M.js} +1 -1
- package/chunks/{ActionLink.DbyciN3Y.js → ActionLink.BlwvrnPN.js} +1 -1
- package/chunks/{Breadcrumb.BgnpTo01.js → Breadcrumb.C_Yaz_vw.js} +2 -2
- package/chunks/Button.CQlIao-Z.js +139 -0
- package/chunks/{Checkbox.BcGXAuuP.js → Checkbox.D5X5T6Yg.js} +1 -1
- package/chunks/CheckboxGroup.BIspWqeW.js +74 -0
- package/chunks/{Chip.D6pubCZV.js → Chip.DIp5hdRH.js} +1 -1
- package/chunks/{CustomReactSelect.Dg3wC_VH.js → CustomReactSelect.D4kopDzX.js} +816 -800
- package/chunks/{Dialog.DpqSVrYR.js → Dialog.DMxHRrxo.js} +1 -1
- package/chunks/{Drawer.DISWybOa.js → Drawer.CatmvDHJ.js} +1 -1
- package/chunks/Fieldset.Bk8W5h13.js +81 -0
- package/chunks/{Header.7TQL_J9t.js → Header.18sOO0Gf.js} +1 -1
- package/chunks/{Input.utils.Dkw7gRrr.js → Input.utils.CL1u4Ctq.js} +27 -25
- package/chunks/InputFile.CjK3gEst.js +236 -0
- package/chunks/InputNumber.wfDjnz58.js +242 -0
- package/chunks/InputPassword.Ctb0xbwg.js +121 -0
- package/chunks/InputSearch.C-r5ktR8.js +149 -0
- package/chunks/LinkButton.CWibqvhs.js +140 -0
- package/chunks/{MegaMenu.CQbOeaib.js → MegaMenu.qttkjGbD.js} +7 -8
- package/chunks/{NavigationTabs.BwM-6CRm.js → NavigationTabs.SBNLx87A.js} +1 -1
- package/chunks/{Notification.CrojkJ0E.js → Notification.DYl1rcGu.js} +1 -1
- package/chunks/{Popover.Bb0Pjmvg.js → Popover.C9tT8xkE.js} +9 -10
- package/chunks/RadioGroup.BDsVAhCK.js +125 -0
- package/chunks/Select.BjBPN-6W.js +147 -0
- package/chunks/Slider.Bh2jhGKn.js +306 -0
- package/chunks/{Stepper.PTQdQBYf.js → Stepper.D1Yzw-gL.js} +2 -2
- package/chunks/{Tabs.DyP4whX0.js → Tabs.BvG-OPWa.js} +1 -1
- package/chunks/Textarea.DibBqiam.js +181 -0
- package/chunks/{Toast.ug_RjGgF.js → Toast.ldZRNpGM.js} +1 -1
- package/chunks/floating-ui.react.COTL3jH5.js +2984 -0
- package/chunks/{useBreakpoint.BzR_yaIv.js → useBreakpoint.1txsny17.js} +8 -5
- package/combobox.C2XUM4fM.js +67 -0
- package/components/Button/Button.d.ts +5 -0
- package/components/Button/Button.utils.d.ts +4 -5
- package/components/CheckboxGroup/CheckboxGroup.d.ts +14 -1
- package/components/Combobox/Combobox.utils.d.ts +3 -2
- package/components/Combobox/CustomReactSelect/CustomReactSelect.d.ts +13 -0
- package/components/Fieldset/Fieldset.d.ts +14 -1
- package/components/Input/Input.d.ts +13 -0
- package/components/Input/Input.utils.d.ts +2 -2
- package/components/InputFile/InputFile.d.ts +13 -0
- package/components/InputFile/InputFile.utils.d.ts +4 -2
- package/components/InputNumber/InputNumber.d.ts +17 -4
- package/components/InputNumber/InputNumber.utils.d.ts +2 -2
- package/components/InputPassword/InputPassword.d.ts +13 -0
- package/components/InputPassword/InputPassword.utils.d.ts +2 -2
- package/components/InputSearch/InputSearch.d.ts +13 -0
- package/components/InputSearch/InputSearch.utils.d.ts +2 -2
- package/components/LinkButton/LinkButton.d.ts +5 -0
- package/components/LinkButton/LinkButton.utils.d.ts +4 -5
- package/components/RadioGroup/RadioGroup.d.ts +13 -0
- package/components/RadioGroup/RadioGroup.utils.d.ts +3 -2
- package/components/Scroller/Scroller.test.d.ts +1 -0
- package/components/Select/Select.d.ts +13 -0
- package/components/Select/Select.utils.d.ts +2 -2
- package/components/Slider/Slider.d.ts +13 -0
- package/components/Textarea/Textarea.d.ts +13 -0
- package/components/Textarea/Textarea.utils.d.ts +2 -2
- package/{customreactselect.BFN8cYJi.js → customreactselect.BNwzk8Qi.js} +4 -3
- package/{dialog.CzM_Cxp0.js → dialog.D5geKDtZ.js} +2 -2
- package/{drawer._A9MQ8Cj.js → drawer.ucjhpIF4.js} +2 -2
- package/{fieldset.CId-NtI5.js → fieldset.Crx4Cb9a.js} +3 -2
- package/{filelist.DgVuWpR3.js → filelist.Bcu6TZRj.js} +1 -1
- package/{floatingactionbutton.Bsnncudt.js → floatingactionbutton.B5hJ2At2.js} +1 -1
- package/{header.CelAkqtp.js → header.A77yIAH3.js} +1 -1
- package/index.es.js +103 -102
- package/input.DL_M_Pg3.js +190 -0
- package/{inputfile.BjgJGefV.js → inputfile.iwsNHjrc.js} +6 -5
- package/{inputnumber.BcrxBVv0.js → inputnumber.raC_7KIP.js} +7 -6
- package/{inputpassword.CddmBW-T.js → inputpassword.Brte78Sr.js} +4 -4
- package/{inputsearch.CFOASqrd.js → inputsearch.BP0EzFcF.js} +6 -5
- package/{link.f8MMZo-w.js → link.BtZeNdii.js} +2 -2
- package/{linkbutton.BYAvi-_V.js → linkbutton.In_ROT0Z.js} +4 -4
- package/{logo100years.B4d_DIiB.js → logo100years.DDzCrczW.js} +10 -10
- package/{megamenu.Cy9Cc-mC.js → megamenu.BurL9MfF.js} +3 -3
- package/{navigationtabs.Dp7D2fnc.js → navigationtabs.EbmfKv1R.js} +2 -2
- package/{notification.B-norGiB.js → notification.tadg6lCc.js} +2 -2
- package/package.json +4 -3
- package/partials/index.js +32 -32
- package/{popover.DFVDZY-m.js → popover.CXq7VoZt.js} +3 -3
- package/radio.pyM5ma9s.js +134 -0
- package/{radiogroup.DaThoMfq.js → radiogroup.sdob0iPE.js} +3 -3
- package/{scroller.Cu7H_VCT.js → scroller.B1LijjCF.js} +1 -1
- package/{select.CMdKf7tC.js → select.CZ0C3yJD.js} +5 -4
- package/{skiptocontent.CHVh0hbr.js → skiptocontent.CAQy194o.js} +1 -1
- package/slider.B3u5du_Q.js +12 -0
- package/{step.DKf4CHGr.js → step.DaJFsafj.js} +1 -1
- package/{stepper.CCP_igpJ.js → stepper.DcaZESJi.js} +3 -3
- package/styles/scss/ds/lib/ds-internal/_input.scss +12 -3
- package/styles/scss/ds/lib/ds-internal/_link-button.scss +10 -2
- package/styles/scss/ds/lib/link-button.scss +11 -3
- package/{tablist.DZgo49nZ.js → tablist.mX5nQWwH.js} +1 -1
- package/{tabs.BkoT7feH.js → tabs.DjWfks34.js} +2 -2
- package/{textarea.DMn20z4p.js → textarea.69r-5faY.js} +4 -3
- package/{toast.Dvs8woTH.js → toast.FzO5KoiK.js} +2 -2
- package/{toastmanager.pi_Fhd5t.js → toastmanager.BGIYNKkT.js} +1 -1
- package/{tooltip.QJe_bfO-.js → tooltip.Cj3AvYgB.js} +22 -23
- package/{topbar.Bxwvp9Lf.js → topbar.CAujTZAE.js} +2 -2
- package/utils/useIsomorphicLayoutEffect.d.ts +2 -2
- package/assets/Button.C8sNwIeW.css +0 -1
- package/assets/CustomReactSelect.E_jJFVew.css +0 -1
- package/assets/Fieldset.CW9dBvAo.css +0 -1
- package/assets/InputFile.BnIvK65P.css +0 -1
- package/assets/InputNumber.BoiCIR1f.css +0 -1
- package/assets/InputPassword.Dk3_vNLV.css +0 -1
- package/assets/InputSearch.C1_4cVCi.css +0 -1
- package/assets/LinkButton.B86yacK5.css +0 -1
- package/assets/RadioGroup.CM2mYOzc.css +0 -1
- package/assets/Select.COxLltX7.css +0 -1
- package/assets/Slider.DPEmJ3HD.css +0 -1
- package/assets/Textarea.y3MW7VW0.css +0 -1
- package/assets/buttonround.BN3vUDc_.css +0 -1
- package/assets/input.DTu4g_iA.css +0 -1
- package/assets/radio.CgpGvYc-.css +0 -1
- package/button.DHuKanZP.js +0 -13
- package/buttonround.CMlmEDaN.js +0 -96
- package/chunks/Button.DCZgBNmA.js +0 -142
- package/chunks/CheckboxGroup.BuFd1luB.js +0 -72
- package/chunks/Fieldset.DiMtr6Vw.js +0 -74
- package/chunks/InputFile.C8nt9Fu8.js +0 -218
- package/chunks/InputNumber.CbH1XJfl.js +0 -267
- package/chunks/InputPassword.DbdjuSiJ.js +0 -136
- package/chunks/InputSearch.joxmugiv.js +0 -173
- package/chunks/LinkButton.BZgIGgc8.js +0 -132
- package/chunks/RadioGroup.CexC4v2Z.js +0 -104
- package/chunks/Select.BEIdNMML.js +0 -164
- package/chunks/Slider.CR0zYHeZ.js +0 -291
- package/chunks/Textarea.Du2RII5u.js +0 -168
- package/chunks/floating-ui.dom.BT8pKtCQ.js +0 -1005
- package/chunks/floating-ui.react.3FjeMiuN.js +0 -1999
- package/combobox.jG5GRA7C.js +0 -65
- package/input.DuEbg7d6.js +0 -206
- package/radio.DHUfSPai.js +0 -126
- package/slider.C5dK6KcG.js +0 -11
- /package/components/InputNumber/{InputNumberutils.test.d.ts → InputNumber.utils.test.d.ts} +0 -0
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as u, jsxs as ye } from "react/jsx-runtime";
|
|
3
|
-
import { d as Ae } from "./index.D-sRdssb.js";
|
|
4
|
-
import { c as me } from "./index.DL9mof6u.js";
|
|
5
|
-
import { forwardRef as xe, useRef as Be, useState as ke, useEffect as Fe } from "react";
|
|
6
|
-
import { u as He } from "./useBreakpoint.BzR_yaIv.js";
|
|
7
|
-
import { Asterisk as Re } from "../asterisk.B2ih8VwF.js";
|
|
8
|
-
import { D as je } from "./Icon.CDLyB7Pv.js";
|
|
9
|
-
import { D as We } from "./SystemFeedback.CjlARKki.js";
|
|
10
|
-
import { g as pe, r as Me } from "./helpers.CexwVao7.js";
|
|
11
|
-
import '../assets/Select.COxLltX7.css';const Te = "ds-select_root_1qg6z_1", Oe = "ds-select_hint_1qg6z_1", Ze = "ds-select_label_1qg6z_1", Je = "ds-select_label--hidden_1qg6z_122", Ke = "ds-select_label--disabled_1qg6z_135", Qe = "ds-select_feedback_1qg6z_155", Ue = "ds-select_select-wrapper_1qg6z_159", Xe = "ds-select_select_1qg6z_159", Ye = "ds-select_select--small_1qg6z_173", Ge = "ds-select_select--invalid_1qg6z_285", el = "ds-select_select--placeholder_1qg6z_393", ll = "ds-select_chevron_1qg6z_443", tl = "ds-select_chevron--small_1qg6z_447", sl = "ds-select_chevron--disabled_1qg6z_450", t = {
|
|
12
|
-
root: Te,
|
|
13
|
-
hint: Oe,
|
|
14
|
-
label: Ze,
|
|
15
|
-
labelHidden: Je,
|
|
16
|
-
labelDisabled: Ke,
|
|
17
|
-
feedback: Qe,
|
|
18
|
-
selectWrapper: Ue,
|
|
19
|
-
select: Xe,
|
|
20
|
-
selectSmall: Ye,
|
|
21
|
-
selectInvalid: Ge,
|
|
22
|
-
selectPlaceholder: el,
|
|
23
|
-
chevron: ll,
|
|
24
|
-
chevronSmall: tl,
|
|
25
|
-
chevronDisabled: sl
|
|
26
|
-
}, _l = ["medium", "small"], al = ({
|
|
27
|
-
id: n,
|
|
28
|
-
label: s,
|
|
29
|
-
options: e
|
|
30
|
-
}) => {
|
|
31
|
-
if (!n)
|
|
32
|
-
throw new Error(pe("DSSelect", 'A unique "id" prop is required. Please add a unique "id" prop to the DSSelect component.'));
|
|
33
|
-
if (!s)
|
|
34
|
-
throw new Error(pe("DSSelect", `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}.`));
|
|
35
|
-
if (Array.isArray(e)) {
|
|
36
|
-
if (e.length === 0)
|
|
37
|
-
throw new Error(pe("DSSelect", "The options array must not be empty."));
|
|
38
|
-
} else throw new Error(pe("DSSelect", Me("options", "DSSelect")));
|
|
39
|
-
}, ol = (n, s, e) => n === "" || s !== void 0 && s !== "" ? !1 : !(e !== void 0 && e !== ""), cl = xe((n, s) => {
|
|
40
|
-
const e = Ae.c(124);
|
|
41
|
-
let c, d, i, l, f, b, _, S, r, Z, J, K, Q, U, X, o;
|
|
42
|
-
e[0] !== n ? ({
|
|
43
|
-
id: l,
|
|
44
|
-
label: f,
|
|
45
|
-
options: _,
|
|
46
|
-
className: c,
|
|
47
|
-
defaultValue: d,
|
|
48
|
-
disabled: Z,
|
|
49
|
-
hideLabel: J,
|
|
50
|
-
hint: i,
|
|
51
|
-
invalid: K,
|
|
52
|
-
placeholder: Q,
|
|
53
|
-
required: U,
|
|
54
|
-
size: X,
|
|
55
|
-
systemFeedback: r,
|
|
56
|
-
value: o,
|
|
57
|
-
onChange: b,
|
|
58
|
-
...S
|
|
59
|
-
} = n, e[0] = n, e[1] = c, e[2] = d, e[3] = i, e[4] = l, e[5] = f, e[6] = b, e[7] = _, e[8] = S, e[9] = r, e[10] = Z, e[11] = J, e[12] = K, e[13] = Q, e[14] = U, e[15] = X, e[16] = o) : (c = e[1], d = e[2], i = e[3], l = e[4], f = e[5], b = e[6], _ = e[7], S = e[8], r = e[9], Z = e[10], J = e[11], K = e[12], Q = e[13], U = e[14], X = e[15], o = e[16]);
|
|
60
|
-
const h = Z === void 0 ? !1 : Z, Ee = J === void 0 ? !1 : J, a = K === void 0 ? !1 : K, v = Q === void 0 ? "Select" : Q, g = U === void 0 ? !1 : U, le = X === void 0 ? "medium" : X;
|
|
61
|
-
process.env.NODE_ENV !== "production" && al({
|
|
62
|
-
id: l,
|
|
63
|
-
label: f,
|
|
64
|
-
options: _
|
|
65
|
-
});
|
|
66
|
-
const Ie = Be(null), [ue, ze] = ke(o);
|
|
67
|
-
let te;
|
|
68
|
-
e[17] !== d || e[18] !== v || e[19] !== o ? (te = ol(v, d, o), e[17] = d, e[18] = v, e[19] = o, e[20] = te) : te = e[20];
|
|
69
|
-
const [Y, Pe] = ke(te);
|
|
70
|
-
let se, ae;
|
|
71
|
-
e[21] !== o ? (se = () => {
|
|
72
|
-
ze(o);
|
|
73
|
-
}, ae = [o], e[21] = o, e[22] = se, e[23] = ae) : (se = e[22], ae = e[23]), Fe(se, ae);
|
|
74
|
-
let oe;
|
|
75
|
-
e[24] !== s ? (oe = (ee) => {
|
|
76
|
-
Ie.current = ee, typeof s == "function" ? s(ee) : s && (s.current = ee);
|
|
77
|
-
}, e[24] = s, e[25] = oe) : oe = e[25];
|
|
78
|
-
const _e = oe, G = He(Ee), D = `${l}-label`, q = `${l}-feedback`, y = `${l}-hint`, ve = i ? ` ${y}` : "";
|
|
79
|
-
let ce;
|
|
80
|
-
e[26] !== a || e[27] !== r || e[28] !== q ? (ce = [a && r && q].filter(Boolean).join(" ") || void 0, e[26] = a, e[27] = r, e[28] = q, e[29] = ce) : ce = e[29];
|
|
81
|
-
const Se = ce;
|
|
82
|
-
let z, w, N, k, E, I, P, C, $, L, V, A, x, B, F, H, m, p;
|
|
83
|
-
if (e[30] !== Se || e[31] !== ve || e[32] !== c || e[33] !== d || e[34] !== h || e[35] !== _e || e[36] !== G || e[37] !== i || e[38] !== y || e[39] !== l || e[40] !== a || e[41] !== Y || e[42] !== f || e[43] !== b || e[44] !== _ || e[45] !== v || e[46] !== g || e[47] !== S || e[48] !== D || e[49] !== ue || e[50] !== le) {
|
|
84
|
-
const ee = (he) => [v && /* @__PURE__ */ u("option", { value: "", children: v }, `${l}-hidden-option-disabled-placeholder`), ...he.map((O) => {
|
|
85
|
-
if ("options" in O) {
|
|
86
|
-
const {
|
|
87
|
-
label: Ne,
|
|
88
|
-
options: Ve
|
|
89
|
-
} = O;
|
|
90
|
-
return /* @__PURE__ */ u("optgroup", { label: Ne, children: Ve.map(we) }, Ne);
|
|
91
|
-
} else
|
|
92
|
-
return we(O);
|
|
93
|
-
})], we = il;
|
|
94
|
-
let re;
|
|
95
|
-
e[69] !== c ? (re = me(t.root, c), e[69] = c, e[70] = re) : re = e[70];
|
|
96
|
-
const Ce = re, ge = le === "small";
|
|
97
|
-
let ne;
|
|
98
|
-
e[71] !== a || e[72] !== Y || e[73] !== ge ? (ne = me(t.select, {
|
|
99
|
-
[t.selectSmall]: ge,
|
|
100
|
-
[t.selectInvalid]: a,
|
|
101
|
-
[t.selectPlaceholder]: Y
|
|
102
|
-
}), e[71] = a, e[72] = Y, e[73] = ge, e[74] = ne) : ne = e[74];
|
|
103
|
-
const $e = ne;
|
|
104
|
-
let de;
|
|
105
|
-
e[75] !== h || e[76] !== G ? (de = me(t.label, {
|
|
106
|
-
[t.labelHidden]: G,
|
|
107
|
-
[t.labelDisabled]: h
|
|
108
|
-
}), e[75] = h, e[76] = G, e[77] = de) : de = e[77];
|
|
109
|
-
const De = de, qe = le === "small";
|
|
110
|
-
let fe;
|
|
111
|
-
e[78] !== h || e[79] !== qe ? (fe = me(t.chevron, {
|
|
112
|
-
[t.chevronSmall]: qe,
|
|
113
|
-
[t.chevronDisabled]: h
|
|
114
|
-
}), e[78] = h, e[79] = qe, e[80] = fe) : fe = e[80], z = fe;
|
|
115
|
-
let be;
|
|
116
|
-
e[81] !== b ? (be = (he) => {
|
|
117
|
-
const {
|
|
118
|
-
value: O
|
|
119
|
-
} = he.target;
|
|
120
|
-
Pe(O === ""), ze(O), b && b(he);
|
|
121
|
-
}, e[81] = b, e[82] = be) : be = e[82];
|
|
122
|
-
const Le = be;
|
|
123
|
-
H = Ce;
|
|
124
|
-
let T;
|
|
125
|
-
e[83] !== g ? (T = g && /* @__PURE__ */ u(Re, {}), e[83] = g, e[84] = T) : T = e[84], e[85] !== l || e[86] !== f || e[87] !== De || e[88] !== D || e[89] !== T ? (m = /* @__PURE__ */ ye("label", { className: De, id: D, htmlFor: l, children: [
|
|
126
|
-
f,
|
|
127
|
-
T
|
|
128
|
-
] }), e[85] = l, e[86] = f, e[87] = De, e[88] = D, e[89] = T, e[90] = m) : m = e[90], e[91] !== i || e[92] !== y ? (p = i && /* @__PURE__ */ u("div", { className: t.hint, id: y, children: i }), e[91] = i, e[92] = y, e[93] = p) : p = e[93], F = t.selectWrapper, w = S, N = l, k = _e, E = $e, I = `${D}${ve}`, P = Se, C = a, $ = d, L = ue, V = h, A = g, x = Le, B = ee(_), e[30] = Se, e[31] = ve, e[32] = c, e[33] = d, e[34] = h, e[35] = _e, e[36] = G, e[37] = i, e[38] = y, e[39] = l, e[40] = a, e[41] = Y, e[42] = f, e[43] = b, e[44] = _, e[45] = v, e[46] = g, e[47] = S, e[48] = D, e[49] = ue, e[50] = le, e[51] = z, e[52] = w, e[53] = N, e[54] = k, e[55] = E, e[56] = I, e[57] = P, e[58] = C, e[59] = $, e[60] = L, e[61] = V, e[62] = A, e[63] = x, e[64] = B, e[65] = F, e[66] = H, e[67] = m, e[68] = p;
|
|
129
|
-
} else
|
|
130
|
-
z = e[51], w = e[52], N = e[53], k = e[54], E = e[55], I = e[56], P = e[57], C = e[58], $ = e[59], L = e[60], V = e[61], A = e[62], x = e[63], B = e[64], F = e[65], H = e[66], m = e[67], p = e[68];
|
|
131
|
-
let R;
|
|
132
|
-
e[94] !== w || e[95] !== N || e[96] !== k || e[97] !== E || e[98] !== I || e[99] !== P || e[100] !== C || e[101] !== $ || e[102] !== L || e[103] !== V || e[104] !== A || e[105] !== x || e[106] !== B ? (R = /* @__PURE__ */ u("select", { ...w, id: N, ref: k, className: E, "aria-labelledby": I, "aria-describedby": P, "aria-invalid": C, defaultValue: $, value: L, disabled: V, required: A, onChange: x, children: B }), e[94] = w, e[95] = N, e[96] = k, e[97] = E, e[98] = I, e[99] = P, e[100] = C, e[101] = $, e[102] = L, e[103] = V, e[104] = A, e[105] = x, e[106] = B, e[107] = R) : R = e[107];
|
|
133
|
-
let j;
|
|
134
|
-
e[108] !== z ? (j = /* @__PURE__ */ u(je, { name: "chevron-down", className: z, "aria-hidden": "true" }), e[108] = z, e[109] = j) : j = e[109];
|
|
135
|
-
let W;
|
|
136
|
-
e[110] !== F || e[111] !== R || e[112] !== j ? (W = /* @__PURE__ */ ye("div", { className: F, children: [
|
|
137
|
-
R,
|
|
138
|
-
j
|
|
139
|
-
] }), e[110] = F, e[111] = R, e[112] = j, e[113] = W) : W = e[113];
|
|
140
|
-
let M;
|
|
141
|
-
e[114] !== a || e[115] !== r || e[116] !== q ? (M = a && r && /* @__PURE__ */ u(We, { className: t.feedback, message: r, variant: "error", id: q }), e[114] = a, e[115] = r, e[116] = q, e[117] = M) : M = e[117];
|
|
142
|
-
let ie;
|
|
143
|
-
return e[118] !== H || e[119] !== m || e[120] !== p || e[121] !== W || e[122] !== M ? (ie = /* @__PURE__ */ ye("div", { className: H, children: [
|
|
144
|
-
m,
|
|
145
|
-
p,
|
|
146
|
-
W,
|
|
147
|
-
M
|
|
148
|
-
] }), e[118] = H, e[119] = m, e[120] = p, e[121] = W, e[122] = M, e[123] = ie) : ie = e[123], ie;
|
|
149
|
-
});
|
|
150
|
-
cl.displayName = "DSSelect";
|
|
151
|
-
function il(n) {
|
|
152
|
-
const {
|
|
153
|
-
label: s,
|
|
154
|
-
value: e,
|
|
155
|
-
isDisabled: c
|
|
156
|
-
} = n;
|
|
157
|
-
return /* @__PURE__ */ u("option", { value: e, disabled: c, children: s }, e);
|
|
158
|
-
}
|
|
159
|
-
export {
|
|
160
|
-
cl as D,
|
|
161
|
-
_l as S,
|
|
162
|
-
ol as g,
|
|
163
|
-
al as v
|
|
164
|
-
};
|
|
@@ -1,291 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as b, jsxs as Se } from "react/jsx-runtime";
|
|
3
|
-
import { d as nt } from "./index.D-sRdssb.js";
|
|
4
|
-
import { c as T } from "./index.DL9mof6u.js";
|
|
5
|
-
import { forwardRef as ot, useState as Xe, useRef as ct } from "react";
|
|
6
|
-
import { u as dt } from "./useBreakpoint.BzR_yaIv.js";
|
|
7
|
-
import { DSInput as ut } from "../input.DuEbg7d6.js";
|
|
8
|
-
import { g as Je } from "./helpers.CexwVao7.js";
|
|
9
|
-
import '../assets/Slider.DPEmJ3HD.css';const pt = "ds-slider_root_164e2_1", mt = "ds-slider_hint_164e2_4", bt = "ds-slider_label_164e2_4", ft = "ds-slider_number-input_164e2_7", _t = "ds-slider_label-hint-input-wrapper_164e2_11", ht = "ds-slider_label--hidden_164e2_31", Tt = "ds-slider_label--disabled_164e2_44", xt = "ds-slider_number-input--small_164e2_73", vt = "ds-slider_min-max-label-wrapper_164e2_78", gt = "ds-slider_min-max-label-wrapper--disabled_164e2_92", kt = "ds-slider_min-label_164e2_97", Nt = "ds-slider_max-label_164e2_101", St = "ds-slider_slider-wrapper_164e2_105", yt = "ds-slider_slider_164e2_105", Dt = "ds-slider_value-tooltip_164e2_124", It = "ds-slider_proxy-thumb_164e2_128", Mt = "ds-slider_proxy-thumb--disabled_164e2_206", Lt = "ds-slider_custom-track_164e2_235", Vt = "ds-slider_custom-track--progress_164e2_240", wt = "ds-slider_custom-track--runnable_164e2_252", Ct = "ds-slider_custom-track--disabled_164e2_266", Wt = "ds-slider_tick-wrapper_164e2_286", $t = "ds-slider_tick_164e2_286", Pt = "ds-slider_value-tooltip--visible_164e2_345", At = "ds-slider_value-tooltip--disabled_164e2_348", a = {
|
|
10
|
-
root: pt,
|
|
11
|
-
hint: mt,
|
|
12
|
-
label: bt,
|
|
13
|
-
numberInput: ft,
|
|
14
|
-
labelHintInputWrapper: _t,
|
|
15
|
-
labelHidden: ht,
|
|
16
|
-
labelDisabled: Tt,
|
|
17
|
-
numberInputSmall: xt,
|
|
18
|
-
minMaxLabelWrapper: vt,
|
|
19
|
-
minMaxLabelWrapperDisabled: gt,
|
|
20
|
-
minLabel: kt,
|
|
21
|
-
maxLabel: Nt,
|
|
22
|
-
sliderWrapper: St,
|
|
23
|
-
slider: yt,
|
|
24
|
-
valueTooltip: Dt,
|
|
25
|
-
proxyThumb: It,
|
|
26
|
-
proxyThumbDisabled: Mt,
|
|
27
|
-
customTrack: Lt,
|
|
28
|
-
customTrackProgress: Vt,
|
|
29
|
-
customTrackRunnable: wt,
|
|
30
|
-
customTrackDisabled: Ct,
|
|
31
|
-
tickWrapper: Wt,
|
|
32
|
-
tick: $t,
|
|
33
|
-
valueTooltipVisible: Pt,
|
|
34
|
-
valueTooltipDisabled: At
|
|
35
|
-
}, Et = 11, Qe = 4, Ye = (u) => u.toString().length, Rt = (u, r, e) => {
|
|
36
|
-
if (r === 0)
|
|
37
|
-
return !0;
|
|
38
|
-
const p = 1e-10, n = (u - e) / r;
|
|
39
|
-
return Math.abs(Math.round(n) - n) < p;
|
|
40
|
-
}, Ft = (u, r, e, p) => {
|
|
41
|
-
const n = parseFloat(r), f = e, o = Math.round((u - f) / n);
|
|
42
|
-
let c = f + o * n;
|
|
43
|
-
c = Math.min(Math.max(c, e), p);
|
|
44
|
-
const v = n.toString().split(".")[1]?.length || 0;
|
|
45
|
-
return parseFloat(c.toFixed(v));
|
|
46
|
-
}, Ht = (u, r, e) => {
|
|
47
|
-
const p = (u - r) / (e - r) * 100, n = `calc(-0.24 * ${p}px + 10px)`;
|
|
48
|
-
return `calc(${p}% + ${n})`;
|
|
49
|
-
}, Bt = ({
|
|
50
|
-
id: u,
|
|
51
|
-
label: r
|
|
52
|
-
}) => {
|
|
53
|
-
if (!u)
|
|
54
|
-
throw new Error(Je("DSSlider", 'A unique "id" prop is required. Please add a unique "id" prop to the DSSlider component.'));
|
|
55
|
-
if (!r)
|
|
56
|
-
throw new Error(Je("DSSlider", `A label is always required for a11y reasons. Please add a descriptive "label" prop to the DSSlider component. If you don't want to display a label, set hideLabel={true}.`));
|
|
57
|
-
}, qt = ot((u, r) => {
|
|
58
|
-
const e = nt.c(154);
|
|
59
|
-
let p, n, f, o, c, v, m, S, U, G, X, J, Q, Y, Z, g;
|
|
60
|
-
e[0] !== u ? ({
|
|
61
|
-
id: o,
|
|
62
|
-
label: c,
|
|
63
|
-
className: p,
|
|
64
|
-
defaultValue: n,
|
|
65
|
-
disabled: U,
|
|
66
|
-
hideLabel: G,
|
|
67
|
-
hideNumberInput: X,
|
|
68
|
-
hint: f,
|
|
69
|
-
isTooltipAlwaysVisible: J,
|
|
70
|
-
max: Q,
|
|
71
|
-
min: Y,
|
|
72
|
-
numberInputProps: v,
|
|
73
|
-
step: Z,
|
|
74
|
-
value: g,
|
|
75
|
-
onChange: m,
|
|
76
|
-
...S
|
|
77
|
-
} = u, e[0] = u, e[1] = p, e[2] = n, e[3] = f, e[4] = o, e[5] = c, e[6] = v, e[7] = m, e[8] = S, e[9] = U, e[10] = G, e[11] = X, e[12] = J, e[13] = Q, e[14] = Y, e[15] = Z, e[16] = g) : (p = e[1], n = e[2], f = e[3], o = e[4], c = e[5], v = e[6], m = e[7], S = e[8], U = e[9], G = e[10], X = e[11], J = e[12], Q = e[13], Y = e[14], Z = e[15], g = e[16]);
|
|
78
|
-
const l = U === void 0 ? !1 : U, Ze = G === void 0 ? !1 : G, y = X === void 0 ? !1 : X, ye = J === void 0 ? !1 : J, et = Q === void 0 ? 100 : Q, tt = Y === void 0 ? 0 : Y, ee = Z === void 0 ? 1 : Z;
|
|
79
|
-
process.env.NODE_ENV !== "production" && Bt({
|
|
80
|
-
id: o,
|
|
81
|
-
label: c
|
|
82
|
-
});
|
|
83
|
-
const i = Number(et), t = Number(tt), d = Number(ee), De = dt(Ze), D = `${o}-label`, Ie = `${o}-hint`, Me = `${o}-number-input`;
|
|
84
|
-
let se;
|
|
85
|
-
e[17] !== n || e[18] !== t || e[19] !== g ? (se = g || n || t.toString() || "0", e[17] = n, e[18] = t, e[19] = g, e[20] = se) : se = e[20];
|
|
86
|
-
const [I, le] = Xe(se), [x, ae] = Xe(g || n || t || 0), st = ct(null);
|
|
87
|
-
let ie;
|
|
88
|
-
e[21] !== r ? (ie = (s) => {
|
|
89
|
-
st.current = s, typeof r == "function" ? r(s) : r && (r.current = s);
|
|
90
|
-
}, e[21] = r, e[22] = ie) : ie = e[22];
|
|
91
|
-
const Le = ie;
|
|
92
|
-
let re;
|
|
93
|
-
e[23] !== v ? (re = v || {}, e[23] = v, e[24] = re) : re = e[24];
|
|
94
|
-
const {
|
|
95
|
-
size: Ge,
|
|
96
|
-
suffix: Ve
|
|
97
|
-
} = re, ne = Ge === void 0 ? "medium" : Ge;
|
|
98
|
-
let oe;
|
|
99
|
-
e[25] !== m ? (oe = (s) => {
|
|
100
|
-
const _ = parseFloat(s.target.value);
|
|
101
|
-
ae(_), le(s.target.value), m && m(s);
|
|
102
|
-
}, e[25] = m, e[26] = oe) : oe = e[26];
|
|
103
|
-
const we = oe;
|
|
104
|
-
let ce;
|
|
105
|
-
e[27] === Symbol.for("react.memo_cache_sentinel") ? (ce = (s) => {
|
|
106
|
-
const _ = s.target.value;
|
|
107
|
-
if (le(_), /^-?\d+(\.\d+)?$/.test(_)) {
|
|
108
|
-
const h = parseFloat(_);
|
|
109
|
-
Number.isNaN(h) || ae(h);
|
|
110
|
-
}
|
|
111
|
-
}, e[27] = ce) : ce = e[27];
|
|
112
|
-
const lt = ce;
|
|
113
|
-
let k;
|
|
114
|
-
if (e[28] !== I || e[29] !== m || e[30] !== i || e[31] !== t || e[32] !== ee) {
|
|
115
|
-
k = (_) => {
|
|
116
|
-
const te = parseFloat(I);
|
|
117
|
-
if (Number.isNaN(te)) {
|
|
118
|
-
s(_);
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
let h = Math.min(Math.max(te, t), i);
|
|
122
|
-
Rt(h, parseFloat(ee), t) || (h = Ft(h, ee, t, i)), le(h.toString()), ae(h), m && m(_);
|
|
123
|
-
};
|
|
124
|
-
const s = (_) => {
|
|
125
|
-
le(t.toString()), ae(t), m && m(_);
|
|
126
|
-
};
|
|
127
|
-
e[28] = I, e[29] = m, e[30] = i, e[31] = t, e[32] = ee, e[33] = k;
|
|
128
|
-
} else
|
|
129
|
-
k = e[33];
|
|
130
|
-
const M = (d === 0 ? !1 : (i - t) / d <= Et) && (i - t) / d || 0;
|
|
131
|
-
let de;
|
|
132
|
-
if (e[34] !== i || e[35] !== t || e[36] !== d || e[37] !== M) {
|
|
133
|
-
let s;
|
|
134
|
-
e[39] !== i || e[40] !== t || e[41] !== d ? (s = (_, te) => {
|
|
135
|
-
const h = t + te * d, rt = Ht(h, t, i);
|
|
136
|
-
return /* @__PURE__ */ b("span", { className: a.tick, style: {
|
|
137
|
-
left: rt
|
|
138
|
-
} }, h);
|
|
139
|
-
}, e[39] = i, e[40] = t, e[41] = d, e[42] = s) : s = e[42], de = Array.from({
|
|
140
|
-
length: M + 1
|
|
141
|
-
}, s), e[34] = i, e[35] = t, e[36] = d, e[37] = M, e[38] = de;
|
|
142
|
-
} else
|
|
143
|
-
de = e[38];
|
|
144
|
-
const Ce = de;
|
|
145
|
-
let ue;
|
|
146
|
-
e[43] !== i || e[44] !== t || e[45] !== x ? (ue = () => {
|
|
147
|
-
if (t === i)
|
|
148
|
-
throw new Error("Min and max values cannot be the same.");
|
|
149
|
-
const s = (x - t) / (i - t) * 100;
|
|
150
|
-
return Math.max(0, Math.min(s, 100));
|
|
151
|
-
}, e[43] = i, e[44] = t, e[45] = x, e[46] = ue) : ue = e[46];
|
|
152
|
-
const N = ue;
|
|
153
|
-
let pe;
|
|
154
|
-
e[47] !== N ? (pe = () => {
|
|
155
|
-
const s = N();
|
|
156
|
-
return s < 50 ? `calc(${s}% + 4px)` : `calc(${s}% - 4px)`;
|
|
157
|
-
}, e[47] = N, e[48] = pe) : pe = e[48];
|
|
158
|
-
const at = pe;
|
|
159
|
-
let me;
|
|
160
|
-
e[49] !== N ? (me = () => {
|
|
161
|
-
const s = 100 - N();
|
|
162
|
-
return s < 50 ? `calc(${s}% + 4px)` : `calc(${s}% - 4px)`;
|
|
163
|
-
}, e[49] = N, e[50] = me) : me = e[50];
|
|
164
|
-
const it = me;
|
|
165
|
-
let be;
|
|
166
|
-
e[51] !== p ? (be = T(a.slider, p), e[51] = p, e[52] = be) : be = e[52];
|
|
167
|
-
const We = be;
|
|
168
|
-
let fe;
|
|
169
|
-
e[53] !== l || e[54] !== De ? (fe = T(a.label, {
|
|
170
|
-
[a.labelHidden]: De,
|
|
171
|
-
[a.labelDisabled]: l
|
|
172
|
-
}), e[53] = l, e[54] = De, e[55] = fe) : fe = e[55];
|
|
173
|
-
const $e = fe, Pe = ne === "small";
|
|
174
|
-
let _e;
|
|
175
|
-
e[56] !== Pe ? (_e = T(a.numberInput, {
|
|
176
|
-
[a.numberInputSmall]: Pe
|
|
177
|
-
}), e[56] = Pe, e[57] = _e) : _e = e[57];
|
|
178
|
-
const Ae = _e;
|
|
179
|
-
let he;
|
|
180
|
-
e[58] !== l ? (he = T(a.minMaxLabelWrapper, {
|
|
181
|
-
[a.minMaxLabelWrapperDisabled]: l
|
|
182
|
-
}), e[58] = l, e[59] = he) : he = e[59];
|
|
183
|
-
const Ee = he;
|
|
184
|
-
let Te;
|
|
185
|
-
e[60] !== l ? (Te = T(a.customTrack, a.customTrackProgress, {
|
|
186
|
-
[a.customTrackDisabled]: l
|
|
187
|
-
}), e[60] = l, e[61] = Te) : Te = e[61];
|
|
188
|
-
const Re = Te;
|
|
189
|
-
let xe;
|
|
190
|
-
e[62] !== l ? (xe = T(a.customTrack, a.customTrackRunnable, {
|
|
191
|
-
[a.customTrackDisabled]: l
|
|
192
|
-
}), e[62] = l, e[63] = xe) : xe = e[63];
|
|
193
|
-
const Fe = xe;
|
|
194
|
-
let ve;
|
|
195
|
-
e[64] !== l ? (ve = T(a.proxyThumb, {
|
|
196
|
-
[a.proxyThumbDisabled]: l
|
|
197
|
-
}), e[64] = l, e[65] = ve) : ve = e[65];
|
|
198
|
-
const He = ve;
|
|
199
|
-
let ge;
|
|
200
|
-
e[66] !== l || e[67] !== ye ? (ge = T(a.valueTooltip, {
|
|
201
|
-
[a.valueTooltipVisible]: ye,
|
|
202
|
-
[a.valueTooltipDisabled]: l
|
|
203
|
-
}), e[66] = l, e[67] = ye, e[68] = ge) : ge = e[68];
|
|
204
|
-
const Be = ge;
|
|
205
|
-
let L;
|
|
206
|
-
e[69] !== o || e[70] !== c || e[71] !== $e || e[72] !== D ? (L = /* @__PURE__ */ b("label", { className: $e, htmlFor: o, id: D, children: c }), e[69] = o, e[70] = c, e[71] = $e, e[72] = D, e[73] = L) : L = e[73];
|
|
207
|
-
let V;
|
|
208
|
-
e[74] !== f || e[75] !== Ie ? (V = f && /* @__PURE__ */ b("div", { className: a.hint, id: Ie, children: f }), e[74] = f, e[75] = Ie, e[76] = V) : V = e[76];
|
|
209
|
-
let w;
|
|
210
|
-
e[77] !== l || e[78] !== k || e[79] !== y || e[80] !== Me || e[81] !== I || e[82] !== c || e[83] !== Ae || e[84] !== ne || e[85] !== Ve || e[86] !== i || e[87] !== t || e[88] !== d ? (w = !y && /* @__PURE__ */ b(ut, { id: Me, className: Ae, type: "number", min: t, max: i, step: d, inputMode: "decimal", autoComplete: "off", disabled: l, hideLabel: !0, value: I, onChange: lt, onBlur: k, onKeyDown: (s) => {
|
|
211
|
-
s.key === "Enter" && (s.preventDefault(), k(s));
|
|
212
|
-
}, label: c, size: ne, suffix: Ve }), e[77] = l, e[78] = k, e[79] = y, e[80] = Me, e[81] = I, e[82] = c, e[83] = Ae, e[84] = ne, e[85] = Ve, e[86] = i, e[87] = t, e[88] = d, e[89] = w) : w = e[89];
|
|
213
|
-
let C;
|
|
214
|
-
e[90] !== L || e[91] !== V || e[92] !== w ? (C = /* @__PURE__ */ Se("div", { className: a.labelHintInputWrapper, children: [
|
|
215
|
-
L,
|
|
216
|
-
V,
|
|
217
|
-
w
|
|
218
|
-
] }), e[90] = L, e[91] = V, e[92] = w, e[93] = C) : C = e[93];
|
|
219
|
-
const qe = Ye(t) < Qe;
|
|
220
|
-
let W;
|
|
221
|
-
e[94] !== qe ? (W = T({
|
|
222
|
-
[a.minLabel]: qe
|
|
223
|
-
}), e[94] = qe, e[95] = W) : W = e[95];
|
|
224
|
-
let $;
|
|
225
|
-
e[96] !== t || e[97] !== W ? ($ = /* @__PURE__ */ b("div", { className: W, children: t }), e[96] = t, e[97] = W, e[98] = $) : $ = e[98];
|
|
226
|
-
const Oe = Ye(i) < Qe;
|
|
227
|
-
let P;
|
|
228
|
-
e[99] !== Oe ? (P = T({
|
|
229
|
-
[a.maxLabel]: Oe
|
|
230
|
-
}), e[99] = Oe, e[100] = P) : P = e[100];
|
|
231
|
-
let A;
|
|
232
|
-
e[101] !== i || e[102] !== P ? (A = /* @__PURE__ */ b("div", { className: P, children: i }), e[101] = i, e[102] = P, e[103] = A) : A = e[103];
|
|
233
|
-
let E;
|
|
234
|
-
e[104] !== Ee || e[105] !== $ || e[106] !== A ? (E = /* @__PURE__ */ Se("div", { className: Ee, children: [
|
|
235
|
-
$,
|
|
236
|
-
A
|
|
237
|
-
] }), e[104] = Ee, e[105] = $, e[106] = A, e[107] = E) : E = e[107];
|
|
238
|
-
const ze = `${N()}`;
|
|
239
|
-
let ke;
|
|
240
|
-
e[108] !== ze ? (ke = {
|
|
241
|
-
"--ds-input-slider-thumb-position": ze
|
|
242
|
-
}, e[108] = ze, e[109] = ke) : ke = e[109];
|
|
243
|
-
const Ke = ke, je = at();
|
|
244
|
-
let R;
|
|
245
|
-
e[110] !== je ? (R = {
|
|
246
|
-
width: je
|
|
247
|
-
}, e[110] = je, e[111] = R) : R = e[111];
|
|
248
|
-
let F;
|
|
249
|
-
e[112] !== Re || e[113] !== R ? (F = /* @__PURE__ */ b("div", { className: Re, style: R }), e[112] = Re, e[113] = R, e[114] = F) : F = e[114];
|
|
250
|
-
const Ue = it();
|
|
251
|
-
let H;
|
|
252
|
-
e[115] !== Ue ? (H = {
|
|
253
|
-
width: Ue
|
|
254
|
-
}, e[115] = Ue, e[116] = H) : H = e[116];
|
|
255
|
-
let B;
|
|
256
|
-
e[117] !== Fe || e[118] !== H ? (B = /* @__PURE__ */ b("div", { className: Fe, style: H }), e[117] = Fe, e[118] = H, e[119] = B) : B = e[119];
|
|
257
|
-
let q;
|
|
258
|
-
e[120] !== l || e[121] !== Le || e[122] !== we || e[123] !== o || e[124] !== i || e[125] !== t || e[126] !== d || e[127] !== S || e[128] !== We || e[129] !== D || e[130] !== x ? (q = /* @__PURE__ */ b("input", { ...S, id: o, type: "range", ref: Le, className: We, min: t, max: i, step: d, value: x, disabled: l, "aria-labelledby": D, onChange: we }), e[120] = l, e[121] = Le, e[122] = we, e[123] = o, e[124] = i, e[125] = t, e[126] = d, e[127] = S, e[128] = We, e[129] = D, e[130] = x, e[131] = q) : q = e[131];
|
|
259
|
-
let O;
|
|
260
|
-
e[132] !== M || e[133] !== Ce ? (O = M > 0 && /* @__PURE__ */ b("div", { className: a.tickWrapper, children: Ce }), e[132] = M, e[133] = Ce, e[134] = O) : O = e[134];
|
|
261
|
-
let z;
|
|
262
|
-
e[135] !== He ? (z = /* @__PURE__ */ b("div", { className: He }), e[135] = He, e[136] = z) : z = e[136];
|
|
263
|
-
let K;
|
|
264
|
-
e[137] !== l || e[138] !== y || e[139] !== x || e[140] !== Be ? (K = y && /* @__PURE__ */ b("div", { className: Be, "aria-disabled": l, children: x }), e[137] = l, e[138] = y, e[139] = x, e[140] = Be, e[141] = K) : K = e[141];
|
|
265
|
-
let j;
|
|
266
|
-
e[142] !== Ke || e[143] !== F || e[144] !== B || e[145] !== q || e[146] !== O || e[147] !== z || e[148] !== K ? (j = /* @__PURE__ */ Se("div", { className: a.sliderWrapper, style: Ke, children: [
|
|
267
|
-
F,
|
|
268
|
-
B,
|
|
269
|
-
q,
|
|
270
|
-
O,
|
|
271
|
-
z,
|
|
272
|
-
K
|
|
273
|
-
] }), e[142] = Ke, e[143] = F, e[144] = B, e[145] = q, e[146] = O, e[147] = z, e[148] = K, e[149] = j) : j = e[149];
|
|
274
|
-
let Ne;
|
|
275
|
-
return e[150] !== C || e[151] !== E || e[152] !== j ? (Ne = /* @__PURE__ */ Se("div", { className: a.root, children: [
|
|
276
|
-
C,
|
|
277
|
-
E,
|
|
278
|
-
j
|
|
279
|
-
] }), e[150] = C, e[151] = E, e[152] = j, e[153] = Ne) : Ne = e[153], Ne;
|
|
280
|
-
});
|
|
281
|
-
qt.displayName = "DSSlider";
|
|
282
|
-
export {
|
|
283
|
-
qt as D,
|
|
284
|
-
Qe as L,
|
|
285
|
-
Et as M,
|
|
286
|
-
Ht as a,
|
|
287
|
-
Ye as g,
|
|
288
|
-
Rt as i,
|
|
289
|
-
Ft as s,
|
|
290
|
-
Bt as v
|
|
291
|
-
};
|
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsxs as l, jsx as h, Fragment as de } from "react/jsx-runtime";
|
|
3
|
-
import { c as m } from "./index.DL9mof6u.js";
|
|
4
|
-
import { forwardRef as ue, useState as c, useRef as fe, useEffect as p } from "react";
|
|
5
|
-
import { g as q, p as z } from "./helpers.CexwVao7.js";
|
|
6
|
-
import { u as _e } from "./useBreakpoint.BzR_yaIv.js";
|
|
7
|
-
import "./index.D-sRdssb.js";
|
|
8
|
-
import { Asterisk as be } from "../asterisk.B2ih8VwF.js";
|
|
9
|
-
import { D as he } from "./SystemFeedback.CjlARKki.js";
|
|
10
|
-
import '../assets/Textarea.y3MW7VW0.css';const me = "ds-textarea_textarea_16wji_1", pe = "ds-textarea_textarea--small_16wji_9", xe = "ds-textarea_textarea--invalid_16wji_121", we = "ds-textarea_textarea--resize-auto_16wji_145", ve = "ds-textarea_root_16wji_155", Ce = "ds-textarea_hint_16wji_155", Se = "ds-textarea_label_16wji_155", je = "ds-textarea_label--hidden_16wji_294", ye = "ds-textarea_label--disabled_16wji_307", Ae = "ds-textarea_feedback_16wji_327", De = "ds-textarea_footer_16wji_331", Ie = "ds-textarea_footer--has-system-feedback_16wji_336", Te = "ds-textarea_char-count_16wji_345", ke = "ds-textarea_char-count-announcer_16wji_358", a = {
|
|
11
|
-
textarea: me,
|
|
12
|
-
textareaSmall: pe,
|
|
13
|
-
textareaInvalid: xe,
|
|
14
|
-
textareaResizeAuto: we,
|
|
15
|
-
root: ve,
|
|
16
|
-
hint: Ce,
|
|
17
|
-
label: Se,
|
|
18
|
-
labelHidden: je,
|
|
19
|
-
labelDisabled: ye,
|
|
20
|
-
feedback: Ae,
|
|
21
|
-
footer: De,
|
|
22
|
-
footerHasSystemFeedback: Ie,
|
|
23
|
-
charCount: Te,
|
|
24
|
-
charCountAnnouncer: ke
|
|
25
|
-
}, qe = ["medium", "small"], Ne = ({
|
|
26
|
-
id: r,
|
|
27
|
-
label: u
|
|
28
|
-
}) => {
|
|
29
|
-
if (!r)
|
|
30
|
-
throw new Error(q("DSTextarea", 'A unique "id" prop is required. Please add a unique "id" prop to the DSTextarea component.'));
|
|
31
|
-
if (!u)
|
|
32
|
-
throw new Error(q("DSTextarea", `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}.`));
|
|
33
|
-
}, Re = ue(({
|
|
34
|
-
id: r,
|
|
35
|
-
label: u,
|
|
36
|
-
charsLimitText: M = "Character limit reached",
|
|
37
|
-
charsRemainingText: O = "Characters remaining:",
|
|
38
|
-
className: X,
|
|
39
|
-
defaultValue: Z,
|
|
40
|
-
disabled: y = !1,
|
|
41
|
-
hint: x,
|
|
42
|
-
hideLabel: G = !1,
|
|
43
|
-
invalid: s = !1,
|
|
44
|
-
maxLength: e,
|
|
45
|
-
readonly: A = !1,
|
|
46
|
-
required: D = !1,
|
|
47
|
-
resize: f = "vertical",
|
|
48
|
-
size: J = "medium",
|
|
49
|
-
systemFeedback: n,
|
|
50
|
-
value: w,
|
|
51
|
-
wrapperClassName: K,
|
|
52
|
-
onChange: I,
|
|
53
|
-
onInput: T,
|
|
54
|
-
...Q
|
|
55
|
-
}, _) => {
|
|
56
|
-
process.env.NODE_ENV !== "production" && Ne({
|
|
57
|
-
id: r,
|
|
58
|
-
label: u
|
|
59
|
-
});
|
|
60
|
-
const [U, k] = c(Z || ""), [i, N] = c(0), [W, R] = c(0), [Y, E] = c("off"), [H, v] = c(n), [C, S] = c(s), g = w !== void 0, b = g ? w : U, o = fe(null), $ = e !== void 0 && e > 0, j = C && H, L = (t) => {
|
|
61
|
-
o.current = t, typeof _ == "function" ? _(t) : _ && (_.current = t);
|
|
62
|
-
}, ee = _e(G);
|
|
63
|
-
p(() => {
|
|
64
|
-
if (!e || e <= 0)
|
|
65
|
-
return;
|
|
66
|
-
i >= e * 0.8 ? E("polite") : E("off");
|
|
67
|
-
const t = setTimeout(() => {
|
|
68
|
-
R(e - i || 0);
|
|
69
|
-
}, 1e3);
|
|
70
|
-
return () => clearTimeout(t);
|
|
71
|
-
}, [i]), p(() => {
|
|
72
|
-
k(b || ""), d(), e && e > 0 && (N(b.toString().length || 0), R(e - b.toString().length || 0));
|
|
73
|
-
}, [w]), p(() => {
|
|
74
|
-
s && n ? (v(n), S(s)) : !s && e && e >= 0 && i >= e ? (S(!0), v(M)) : (v(n), S(s));
|
|
75
|
-
}, [s, C, n, i]), p(() => {
|
|
76
|
-
if (f === "auto")
|
|
77
|
-
return d(), window.addEventListener("resize", d), () => window.removeEventListener("resize", d);
|
|
78
|
-
}, [f, o.current]);
|
|
79
|
-
const te = m(a.root, K), ae = m(a.textarea, X, {
|
|
80
|
-
// small textarea
|
|
81
|
-
[a.textareaSmall]: J === "small",
|
|
82
|
-
// invalid state
|
|
83
|
-
[a.textareaInvalid]: C,
|
|
84
|
-
// resize handling
|
|
85
|
-
[a.textareaResizeAuto]: f === "auto"
|
|
86
|
-
}), re = m(a.label, {
|
|
87
|
-
// hide label only visually to keep them available for assistive technologies
|
|
88
|
-
[a.labelHidden]: ee,
|
|
89
|
-
[a.labelDisabled]: y
|
|
90
|
-
}), se = m(a.footer, {
|
|
91
|
-
[a.footerHasSystemFeedback]: j
|
|
92
|
-
}), V = `${r}-label`, F = `${r}-feedback`, P = `${r}-hint`, B = `${r}-char-count-announcer`, oe = x ? ` ${P}` : "", d = () => {
|
|
93
|
-
if (o.current && f === "auto") {
|
|
94
|
-
o.current.style.height = "auto";
|
|
95
|
-
const t = z(o.current.scrollHeight), ce = z(2);
|
|
96
|
-
o.current.style.height = `${// We need to add 2px (border-top & border-bottom) to the scrollHeight to prevent the textarea
|
|
97
|
-
// from jumping as soon as the user starts typing.
|
|
98
|
-
t + ce}rem`;
|
|
99
|
-
}
|
|
100
|
-
}, ne = () => {
|
|
101
|
-
const t = [];
|
|
102
|
-
return e && e > 0 && t.push(B), s && n && t.push(F), t.length > 0 ? t.join(" ") : void 0;
|
|
103
|
-
}, ie = (t) => {
|
|
104
|
-
T && T(t), e && e > 0 && N(o.current?.value.length || 0), d();
|
|
105
|
-
}, le = (t) => {
|
|
106
|
-
I && I(t), g || k(t.target.value);
|
|
107
|
-
};
|
|
108
|
-
return /* @__PURE__ */ l("div", { className: te, children: [
|
|
109
|
-
/* @__PURE__ */ l("label", { className: re, id: V, htmlFor: r, children: [
|
|
110
|
-
u,
|
|
111
|
-
D && /* @__PURE__ */ h(be, {})
|
|
112
|
-
] }),
|
|
113
|
-
x && /* @__PURE__ */ h("div", { className: a.hint, id: P, children: x }),
|
|
114
|
-
/* @__PURE__ */ h(
|
|
115
|
-
"textarea",
|
|
116
|
-
{
|
|
117
|
-
className: ae,
|
|
118
|
-
id: r,
|
|
119
|
-
...Q,
|
|
120
|
-
ref: L,
|
|
121
|
-
"aria-labelledby": `${V}${oe}`,
|
|
122
|
-
"aria-describedby": ne(),
|
|
123
|
-
"aria-invalid": s,
|
|
124
|
-
"aria-disabled": A,
|
|
125
|
-
maxLength: e,
|
|
126
|
-
readOnly: A,
|
|
127
|
-
required: D,
|
|
128
|
-
disabled: y,
|
|
129
|
-
value: b,
|
|
130
|
-
defaultValue: void 0,
|
|
131
|
-
rows: void 0,
|
|
132
|
-
cols: void 0,
|
|
133
|
-
onChange: le,
|
|
134
|
-
onInput: ie
|
|
135
|
-
}
|
|
136
|
-
),
|
|
137
|
-
$ || j ? /* @__PURE__ */ l("div", { className: se, children: [
|
|
138
|
-
j && /* @__PURE__ */ h(he, { className: a.feedback, message: H, variant: "error", id: F }),
|
|
139
|
-
$ && /* @__PURE__ */ l(de, { children: [
|
|
140
|
-
/* @__PURE__ */ l("div", { className: a.charCount, "aria-hidden": "true", children: [
|
|
141
|
-
i,
|
|
142
|
-
"/",
|
|
143
|
-
e
|
|
144
|
-
] }),
|
|
145
|
-
/* @__PURE__ */ l(
|
|
146
|
-
"div",
|
|
147
|
-
{
|
|
148
|
-
className: a.charCountAnnouncer,
|
|
149
|
-
id: B,
|
|
150
|
-
"aria-live": Y,
|
|
151
|
-
"aria-atomic": "true",
|
|
152
|
-
children: [
|
|
153
|
-
O,
|
|
154
|
-
" ",
|
|
155
|
-
W
|
|
156
|
-
]
|
|
157
|
-
}
|
|
158
|
-
)
|
|
159
|
-
] })
|
|
160
|
-
] }) : null
|
|
161
|
-
] });
|
|
162
|
-
});
|
|
163
|
-
Re.displayName = "DSTextarea";
|
|
164
|
-
export {
|
|
165
|
-
Re as D,
|
|
166
|
-
qe as T,
|
|
167
|
-
Ne as v
|
|
168
|
-
};
|