@stihl-design-system/components 1.0.0-RC.30 → 1.0.0-RC.32
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/{accordion.DkwtJy--.js → accordion.HfUSDwQJ.js} +2 -2
- package/{actionlink.C7HzeIVa.js → actionbutton.kgd0E_xF.js} +4 -3
- package/{actionbutton.u1qp8oGC.js → actionlink.CwC42RWc.js} +4 -3
- package/assets/CustomReactSelect.DGIItWIh.css +1 -0
- package/assets/InputStepper.DvFJk1Mi.css +1 -0
- package/assets/Popover.CXyUaXiO.css +1 -0
- package/assets/Select.C1gWF32A.css +1 -0
- package/assets/Slider.Bidyhb-B.css +1 -0
- package/assets/Textarea.Dq4rH9Tg.css +1 -0
- package/assets/input.CUjGh-UM.css +1 -0
- package/assets/logo100years.CQrEg-Vo.css +1 -0
- package/assets/tooltip.Co1gWF_0.css +1 -0
- package/{banner.j9YpudOS.js → banner.o4Etkjjo.js} +1 -1
- package/{breadcrumb.BS-S3zUI.js → breadcrumb.BsQm0kUD.js} +3 -3
- package/{linkbutton.D2C4vykc.js → button.Dyy6ajX6.js} +5 -3
- package/buttonround.ChKWHzsv.js +96 -0
- package/{checkbox.BtlUvs0z.js → checkbox.BNnp4ztM.js} +3 -3
- package/{checkboxgroup.C5NgyyQF.js → checkboxgroup.BTVnKenc.js} +2 -2
- package/{chip.tVIG1ysH.js → chip.C7NstOHt.js} +4 -3
- package/chipgroup.Zo1-IOCn.js +210 -0
- package/chunks/{Accordion.C5V5IcM-.js → Accordion.CnqryAUu.js} +1 -1
- package/chunks/ActionButton.DdDesD7K.js +180 -0
- package/chunks/ActionLink.DqAsPYda.js +153 -0
- package/chunks/{Breadcrumb.BGzwzvh8.js → Breadcrumb.9KinNuyQ.js} +2 -2
- package/chunks/Button.Cf1CKq8N.js +142 -0
- package/chunks/{Checkbox.DxV7-F5W.js → Checkbox.CiwriItT.js} +2 -2
- package/chunks/{CheckboxGroup.Dy_6tiGk.js → CheckboxGroup.Cj68J6Ee.js} +2 -2
- package/chunks/Chip.BrbYu6i_.js +133 -0
- package/chunks/{CustomReactSelect.iE5iTdez.js → CustomReactSelect.Cqq70QC0.js} +152 -144
- package/chunks/{Dialog.B_2pKRnd.js → Dialog.Bv7k55He.js} +1 -1
- package/chunks/{Drawer.HFlBTcqN.js → Drawer.BVTvx276.js} +1 -1
- package/chunks/{Fieldset.CjIfmN_5.js → Fieldset.D7cLR5ze.js} +1 -1
- package/chunks/Header.um5MlziB.js +377 -0
- package/chunks/Icon.NSsVrYeq.js +231 -0
- package/chunks/{InputFile.DvOatDzg.js → InputFile.bVWWdePn.js} +4 -4
- package/chunks/{InputPassword.DC2POUc1.js → InputPassword.Da3hEKTc.js} +2 -2
- package/chunks/{InputSearch.B0aCuPRZ.js → InputSearch.GOYqFCcZ.js} +2 -2
- package/chunks/InputStepper.BuhPtfl-.js +268 -0
- package/chunks/LinkButton.59oNDwPU.js +132 -0
- package/chunks/MegaMenu._o3nNDAa.js +192 -0
- package/chunks/{NavigationTabList.dYFYTmWv.js → NavigationTabList.DuT7gzhj.js} +1 -1
- package/chunks/{NavigationTabs.ClpVGcl0.js → NavigationTabs.DspPFHPh.js} +1 -1
- package/chunks/{Notification.DIdIhGTQ.js → Notification.Pts2oh0R.js} +2 -2
- package/chunks/Popover.BRR8YZ-P.js +228 -0
- package/chunks/{RadioGroup.peTeMK45.js → RadioGroup.DeTz3c19.js} +1 -1
- package/chunks/Select.D2ehd4yN.js +162 -0
- package/chunks/{Slider.kyVr7BLk.js → Slider.84lkgq3W.js} +85 -85
- package/chunks/{SystemFeedback.B9f67mjJ.js → SystemFeedback.CyGbUCzT.js} +1 -1
- package/chunks/{Tabs.CkVL8Jw8.js → Tabs.C8ADTzJ0.js} +1 -1
- package/chunks/Textarea.Cw85sxHL.js +163 -0
- package/chunks/{Toast.DHo4pLH3.js → Toast.DG3WVvau.js} +2 -2
- package/chunks/battery-charge-0.DxlgEAto.js +10 -0
- package/chunks/battery-charge-100.D0Cax7dU.js +10 -0
- package/chunks/{battery.YCg9lYqC.js → battery.6Idoickg.js} +3 -3
- package/chunks/bluetooth-off.BzZCh4Q8.js +10 -0
- package/chunks/document-s.CoOp0kBK.js +10 -0
- package/chunks/floating-ui.dom.VgHc0h4l.js +989 -0
- package/chunks/floating-ui.react.DCyAzlZ4.js +2011 -0
- package/{combobox.Bk2ycofh.js → combobox.orZ3z8CB.js} +1 -1
- package/components/ActionButton/ActionButton.d.ts +2 -0
- package/components/Button/Button.d.ts +4 -0
- package/components/ChipGroup/Chip.d.ts +1 -0
- package/components/ChipGroup/ChipGroup.d.ts +4 -0
- package/components/ChipGroup/ChipGroup.utils.d.ts +9 -9
- package/components/Header/Header.d.ts +4 -5
- package/components/InputStepper/InputStepper.d.ts +8 -2
- package/components/InputStepper/InputStepper.utils.d.ts +1 -0
- package/components/LinkButton/LinkButton.d.ts +2 -0
- package/components/Logo100Years/Logo100Years.d.ts +1 -0
- package/components/Popover/Popover.d.ts +29 -7
- package/components/Popover/Popover.utils.d.ts +34 -3
- package/components/Tooltip/Tooltip.d.ts +40 -0
- package/components/Tooltip/Tooltip.test.d.ts +1 -0
- package/components/Tooltip/Tooltip.utils.d.ts +70 -0
- package/components/Tooltip/Tooltip.utils.test.d.ts +1 -0
- package/components/TopBar/TopBar.d.ts +4 -4
- package/components/TopBar/TopBar.utils.d.ts +1 -1
- package/{customreactselect.Hnch9LGg.js → customreactselect.Np-RpzvU.js} +4 -4
- package/{dialog.7sWoqGwL.js → dialog.D4rcbW6A.js} +2 -2
- package/{drawer.DsF4KIPn.js → drawer.BCCB3Rkj.js} +2 -2
- package/{fieldset.DUFUMcT-.js → fieldset.ZLs9IGpE.js} +2 -2
- package/{filelist.nunJKxkv.js → filelist.BiKMKCyg.js} +3 -3
- package/{flag.D_iN8iD6.js → flag.72PONA83.js} +1 -1
- package/floatingactionbutton.B2YChsNU.js +87 -0
- package/{header.QpNjE3N-.js → header.DUbn3BZt.js} +1 -1
- package/{icon.vMQcEBnH.js → icon.CHVAZr5T.js} +1 -1
- package/index.es.js +112 -111
- package/input.DG20x6gh.js +203 -0
- package/{inputfile.DK8759wV.js → inputfile.Dc56lQ4t.js} +5 -5
- package/{inputpassword.rV_ZZw5F.js → inputpassword.znFHRLsI.js} +3 -3
- package/{inputsearch.CmhakTpa.js → inputsearch.B1G6rfVk.js} +3 -3
- package/{inputstepper.5olvh4tk.js → inputstepper.o6rdM_CW.js} +3 -3
- package/link.DbnvsD3j.js +81 -0
- package/{button.CPilCCUI.js → linkbutton.DU8Ih8ZF.js} +4 -4
- package/logo100years.BcB6_c-o.js +24 -0
- package/logo100years.d.ts +2 -0
- package/{megamenu.CdHrEeoh.js → megamenu.CPH8EeFF.js} +3 -3
- package/{navigationtablist.CVjh1k-b.js → navigationtablist.C0iwsAad.js} +2 -2
- package/{navigationtabs.BGfi9AG2.js → navigationtabs.JjJtbuUe.js} +2 -2
- package/{notification.Dn-FZWEL.js → notification.Ds_Q7ifk.js} +3 -3
- package/{optioncheckbox.D97W3zeW.js → optioncheckbox.DqfXuPdi.js} +1 -1
- package/package.json +2 -3
- package/partials/index.js +14 -14
- package/{popover.DXxm1oWI.js → popover.B72W0OvU.js} +4 -3
- package/{radiogroup.J8WpEEo8.js → radiogroup.C_3IcNBq.js} +2 -2
- package/{scroller.BiRLQg__.js → scroller.CQxmQU6U.js} +1 -1
- package/{select.DIzGPVx3.js → select.Ceyt-zvu.js} +3 -3
- package/{skiptocontent._F-d8y5b.js → skiptocontent.BSCde5hT.js} +1 -1
- package/{slider.DuJK0RdB.js → slider.Dq2dcziy.js} +2 -2
- package/{spinner.Dht6FspZ.js → spinner.BUjhjAvw.js} +1 -1
- package/{switch.B37S4vfP.js → switch.D7BCfyyZ.js} +2 -2
- package/{systemfeedback.C_2PhwKe.js → systemfeedback.CSdWOWuf.js} +2 -2
- package/{tablist.g_Nwu6GA.js → tablist.V7DBklhE.js} +3 -3
- package/{tabs.oh9-wHPp.js → tabs.DQNLPAEN.js} +2 -2
- package/{textarea.dQ12-oYB.js → textarea.CixKeQBp.js} +2 -2
- package/{toast.sMNbfKxi.js → toast.D8QprMCa.js} +3 -3
- package/{toastmanager.CVamaS5T.js → toastmanager.BSVjYsg9.js} +1 -1
- package/tooltip.CUCSRXd3.js +191 -0
- package/tooltip.d.ts +2 -0
- package/{topbar.Dhy_TL0U.js → topbar.CVhJy-Br.js} +3 -2
- package/types/icon-types.d.ts +1 -1
- package/types/prettier-plugin-organize-imports.d.ts +1 -0
- package/assets/CustomReactSelect.D0b1Hg1T.css +0 -1
- package/assets/InputStepper.Dth4qZN_.css +0 -1
- package/assets/Popover.BDTDsPAt.css +0 -1
- package/assets/Select.CYACicZ3.css +0 -1
- package/assets/Slider.DzwSjDPV.css +0 -1
- package/assets/Textarea.BXWhXpXx.css +0 -1
- package/assets/input.ONbL-_C1.css +0 -1
- package/buttonround.C426mO4d.js +0 -81
- package/chipgroup.CjIK0Z0x.js +0 -209
- package/chunks/ActionButton.B8zFwOrJ.js +0 -165
- package/chunks/ActionLink.IX6oRXU3.js +0 -138
- package/chunks/Button.B7xF1E19.js +0 -127
- package/chunks/Chip.31UfPwQF.js +0 -119
- package/chunks/Header.DqZRryB5.js +0 -366
- package/chunks/Icon.DGTYCv63.js +0 -231
- package/chunks/InputStepper.B_ZjgY_f.js +0 -263
- package/chunks/LinkButton.DdTspmJz.js +0 -117
- package/chunks/MegaMenu.BY7eOnhj.js +0 -189
- package/chunks/Popover.NGetxKGg.js +0 -159
- package/chunks/Select.BDHLJ2ma.js +0 -162
- package/chunks/Textarea.ORkJUx-S.js +0 -163
- package/chunks/floating-ui.dom.C9TD1WpB.js +0 -950
- package/chunks/floating-ui.react.x0F9CYgn.js +0 -1637
- package/floatingactionbutton.DOH2k0gv.js +0 -72
- package/input.BKHOY118.js +0 -203
- package/link.D_FjTyoZ.js +0 -66
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as v, jsxs as ge } from "react/jsx-runtime";
|
|
3
|
+
import { d as xe } from "./index.CgTHIF3K.js";
|
|
4
|
+
import { c as he } from "./index.CEyLAtio.js";
|
|
5
|
+
import { forwardRef as Be, useRef as Fe, useState as Ee, useEffect as He } from "react";
|
|
6
|
+
import { u as Re } from "./useBreakpoint.CMOR9ZOB.js";
|
|
7
|
+
import { Asterisk as je } from "../asterisk.CR60hx8S.js";
|
|
8
|
+
import { D as We } from "./Icon.NSsVrYeq.js";
|
|
9
|
+
import { D as ze } from "./SystemFeedback.CyGbUCzT.js";
|
|
10
|
+
import { g as me, r as Me } from "./helpers.BbWkXTr3.js";
|
|
11
|
+
import '../assets/Select.C1gWF32A.css';const Te = "ds-select_root_17q4p_1", Oe = "ds-select_hint_17q4p_10", Ze = "ds-select_label_17q4p_10", Je = "ds-select_label--hidden_17q4p_131", Ke = "ds-select_label--disabled_17q4p_144", Qe = "ds-select_feedback_17q4p_164", Ue = "ds-select_select-wrapper_17q4p_169", Xe = "ds-select_select_17q4p_169", Ye = "ds-select_select--small_17q4p_183", Ge = "ds-select_select--invalid_17q4p_295", el = "ds-select_select--placeholder_17q4p_410", ll = "ds-select_chevron_17q4p_449", tl = "ds-select_chevron--small_17q4p_453", sl = "ds-select_chevron--disabled_17q4p_456", 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(me("DSSelect", 'A unique "id" prop is required. Please add a unique "id" prop to the DSSelect component.'));
|
|
33
|
+
if (!s)
|
|
34
|
+
throw new Error(me("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(me("DSSelect", "The options array must not be empty."));
|
|
38
|
+
} else throw new Error(me("DSSelect", Me("options", "DSSelect")));
|
|
39
|
+
}, ol = (n, s, e) => n === "" || s !== void 0 && s !== "" ? !1 : !(e !== void 0 && e !== ""), cl = Be((n, s) => {
|
|
40
|
+
const e = xe.c(127);
|
|
41
|
+
let i, d, r, l, p, f, S, q, a, Z, J, K, Q, U, X, c;
|
|
42
|
+
e[0] !== n ? ({
|
|
43
|
+
id: l,
|
|
44
|
+
label: p,
|
|
45
|
+
options: S,
|
|
46
|
+
className: i,
|
|
47
|
+
defaultValue: d,
|
|
48
|
+
disabled: Z,
|
|
49
|
+
hideLabel: J,
|
|
50
|
+
hint: r,
|
|
51
|
+
invalid: K,
|
|
52
|
+
placeholder: Q,
|
|
53
|
+
required: U,
|
|
54
|
+
size: X,
|
|
55
|
+
systemFeedback: a,
|
|
56
|
+
value: c,
|
|
57
|
+
onChange: f,
|
|
58
|
+
...q
|
|
59
|
+
} = n, e[0] = n, e[1] = i, e[2] = d, e[3] = r, e[4] = l, e[5] = p, e[6] = f, e[7] = S, e[8] = q, e[9] = a, e[10] = Z, e[11] = J, e[12] = K, e[13] = Q, e[14] = U, e[15] = X, e[16] = c) : (i = e[1], d = e[2], r = e[3], l = e[4], p = e[5], f = e[6], S = e[7], q = e[8], a = e[9], Z = e[10], J = e[11], K = e[12], Q = e[13], U = e[14], X = e[15], c = e[16]);
|
|
60
|
+
const b = Z === void 0 ? !1 : Z, Ie = J === void 0 ? !1 : J, o = K === void 0 ? !1 : K, D = Q === void 0 ? "Select" : Q, y = U === void 0 ? !1 : U, le = X === void 0 ? "medium" : X;
|
|
61
|
+
process.env.NODE_ENV !== "production" && al({
|
|
62
|
+
id: l,
|
|
63
|
+
label: p,
|
|
64
|
+
options: S
|
|
65
|
+
});
|
|
66
|
+
const Pe = Fe(null), [ue, we] = Ee(c);
|
|
67
|
+
let te;
|
|
68
|
+
e[17] !== d || e[18] !== D || e[19] !== c ? (te = ol(D, d, c), e[17] = d, e[18] = D, e[19] = c, e[20] = te) : te = e[20];
|
|
69
|
+
const [Y, Ce] = Ee(te);
|
|
70
|
+
let se, ae;
|
|
71
|
+
e[21] !== c ? (se = () => {
|
|
72
|
+
we(c);
|
|
73
|
+
}, ae = [c], e[21] = c, e[22] = se, e[23] = ae) : (se = e[22], ae = e[23]), He(se, ae);
|
|
74
|
+
let oe;
|
|
75
|
+
e[24] !== s ? (oe = (ee) => {
|
|
76
|
+
Pe.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 = Re(Ie), g = `${l}-label`, h = `${l}-feedback`, w = `${l}-hint`, ve = r ? ` ${w}` : "";
|
|
79
|
+
let ce;
|
|
80
|
+
e[26] !== o || e[27] !== a || e[28] !== h ? (ce = [o && a && h].filter(Boolean).join(" ") || void 0, e[26] = o, e[27] = a, e[28] = h, e[29] = ce) : ce = e[29];
|
|
81
|
+
const Se = ce;
|
|
82
|
+
let N, k, E, I, P, C, $, L, V, A, x, B, F, H, R, j, m, u, _;
|
|
83
|
+
if (e[30] !== Se || e[31] !== ve || e[32] !== i || e[33] !== d || e[34] !== b || e[35] !== _e || e[36] !== G || e[37] !== r || e[38] !== w || e[39] !== l || e[40] !== o || e[41] !== Y || e[42] !== p || e[43] !== f || e[44] !== S || e[45] !== D || e[46] !== y || e[47] !== q || e[48] !== g || e[49] !== ue || e[50] !== le || e[51] !== a || e[52] !== h) {
|
|
84
|
+
const ee = (be) => [D && /* @__PURE__ */ v("option", { value: "", children: D }, `${l}-hidden-option-disabled-placeholder`), ...be.map((O) => {
|
|
85
|
+
if ("options" in O) {
|
|
86
|
+
const {
|
|
87
|
+
label: ke,
|
|
88
|
+
options: Ae
|
|
89
|
+
} = O;
|
|
90
|
+
return /* @__PURE__ */ v("optgroup", { label: ke, children: Ae.map(Ne) }, ke);
|
|
91
|
+
} else
|
|
92
|
+
return Ne(O);
|
|
93
|
+
})], Ne = il;
|
|
94
|
+
let re;
|
|
95
|
+
e[72] !== i ? (re = he(t.root, i), e[72] = i, e[73] = re) : re = e[73];
|
|
96
|
+
const $e = re, De = le === "small";
|
|
97
|
+
let ne;
|
|
98
|
+
e[74] !== o || e[75] !== Y || e[76] !== De ? (ne = he(t.select, {
|
|
99
|
+
[t.selectSmall]: De,
|
|
100
|
+
[t.selectInvalid]: o,
|
|
101
|
+
[t.selectPlaceholder]: Y
|
|
102
|
+
}), e[74] = o, e[75] = Y, e[76] = De, e[77] = ne) : ne = e[77];
|
|
103
|
+
const Le = ne;
|
|
104
|
+
let de;
|
|
105
|
+
e[78] !== b || e[79] !== G ? (de = he(t.label, {
|
|
106
|
+
[t.labelHidden]: G,
|
|
107
|
+
[t.labelDisabled]: b
|
|
108
|
+
}), e[78] = b, e[79] = G, e[80] = de) : de = e[80];
|
|
109
|
+
const qe = de, ye = le === "small";
|
|
110
|
+
let pe;
|
|
111
|
+
e[81] !== b || e[82] !== ye ? (pe = he(t.chevron, {
|
|
112
|
+
[t.chevronSmall]: ye,
|
|
113
|
+
[t.chevronDisabled]: b
|
|
114
|
+
}), e[81] = b, e[82] = ye, e[83] = pe) : pe = e[83], N = pe;
|
|
115
|
+
let fe;
|
|
116
|
+
e[84] !== f ? (fe = (be) => {
|
|
117
|
+
const {
|
|
118
|
+
value: O
|
|
119
|
+
} = be.target;
|
|
120
|
+
Ce(O === ""), we(O), f && f(be);
|
|
121
|
+
}, e[84] = f, e[85] = fe) : fe = e[85];
|
|
122
|
+
const Ve = fe;
|
|
123
|
+
j = $e;
|
|
124
|
+
let T;
|
|
125
|
+
e[86] !== y ? (T = y && /* @__PURE__ */ v(je, {}), e[86] = y, e[87] = T) : T = e[87], e[88] !== l || e[89] !== p || e[90] !== qe || e[91] !== g || e[92] !== T ? (m = /* @__PURE__ */ ge("label", { className: qe, id: g, htmlFor: l, children: [
|
|
126
|
+
p,
|
|
127
|
+
T
|
|
128
|
+
] }), e[88] = l, e[89] = p, e[90] = qe, e[91] = g, e[92] = T, e[93] = m) : m = e[93], e[94] !== r || e[95] !== w ? (u = r && /* @__PURE__ */ v("div", { className: t.hint, id: w, children: r }), e[94] = r, e[95] = w, e[96] = u) : u = e[96], e[97] !== o || e[98] !== a || e[99] !== h ? (_ = o && a && /* @__PURE__ */ v(ze, { className: t.feedback, message: a, variant: "error", id: h }), e[97] = o, e[98] = a, e[99] = h, e[100] = _) : _ = e[100], R = t.selectWrapper, k = q, E = l, I = _e, P = Le, C = `${g}${ve}`, $ = Se, L = o, V = d, A = ue, x = b, B = y, F = Ve, H = ee(S), e[30] = Se, e[31] = ve, e[32] = i, e[33] = d, e[34] = b, e[35] = _e, e[36] = G, e[37] = r, e[38] = w, e[39] = l, e[40] = o, e[41] = Y, e[42] = p, e[43] = f, e[44] = S, e[45] = D, e[46] = y, e[47] = q, e[48] = g, e[49] = ue, e[50] = le, e[51] = a, e[52] = h, 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] = R, e[68] = j, e[69] = m, e[70] = u, e[71] = _;
|
|
129
|
+
} else
|
|
130
|
+
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], R = e[67], j = e[68], m = e[69], u = e[70], _ = e[71];
|
|
131
|
+
let W;
|
|
132
|
+
e[101] !== k || e[102] !== E || e[103] !== I || e[104] !== P || e[105] !== C || e[106] !== $ || e[107] !== L || e[108] !== V || e[109] !== A || e[110] !== x || e[111] !== B || e[112] !== F || e[113] !== H ? (W = /* @__PURE__ */ v("select", { ...k, id: E, ref: I, className: P, "aria-labelledby": C, "aria-describedby": $, "aria-invalid": L, defaultValue: V, value: A, disabled: x, required: B, onChange: F, children: H }), e[101] = k, e[102] = E, e[103] = I, e[104] = P, e[105] = C, e[106] = $, e[107] = L, e[108] = V, e[109] = A, e[110] = x, e[111] = B, e[112] = F, e[113] = H, e[114] = W) : W = e[114];
|
|
133
|
+
let z;
|
|
134
|
+
e[115] !== N ? (z = /* @__PURE__ */ v(We, { name: "chevron-down", className: N, "aria-hidden": "true" }), e[115] = N, e[116] = z) : z = e[116];
|
|
135
|
+
let M;
|
|
136
|
+
e[117] !== R || e[118] !== W || e[119] !== z ? (M = /* @__PURE__ */ ge("div", { className: R, children: [
|
|
137
|
+
W,
|
|
138
|
+
z
|
|
139
|
+
] }), e[117] = R, e[118] = W, e[119] = z, e[120] = M) : M = e[120];
|
|
140
|
+
let ie;
|
|
141
|
+
return e[121] !== j || e[122] !== m || e[123] !== u || e[124] !== _ || e[125] !== M ? (ie = /* @__PURE__ */ ge("div", { className: j, children: [
|
|
142
|
+
m,
|
|
143
|
+
u,
|
|
144
|
+
_,
|
|
145
|
+
M
|
|
146
|
+
] }), e[121] = j, e[122] = m, e[123] = u, e[124] = _, e[125] = M, e[126] = ie) : ie = e[126], ie;
|
|
147
|
+
});
|
|
148
|
+
cl.displayName = "DSSelect";
|
|
149
|
+
function il(n) {
|
|
150
|
+
const {
|
|
151
|
+
label: s,
|
|
152
|
+
value: e,
|
|
153
|
+
isDisabled: i
|
|
154
|
+
} = n;
|
|
155
|
+
return /* @__PURE__ */ v("option", { value: e, disabled: i, children: s }, e);
|
|
156
|
+
}
|
|
157
|
+
export {
|
|
158
|
+
cl as D,
|
|
159
|
+
_l as S,
|
|
160
|
+
ol as g,
|
|
161
|
+
al as v
|
|
162
|
+
};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as b, jsxs as Se } from "react/jsx-runtime";
|
|
3
|
-
import { d as
|
|
4
|
-
import { c as
|
|
3
|
+
import { d as nt } from "./index.CgTHIF3K.js";
|
|
4
|
+
import { c as v } from "./index.CEyLAtio.js";
|
|
5
5
|
import { forwardRef as ot, useState as Xe, useRef as ct } from "react";
|
|
6
6
|
import { u as dt } from "./useBreakpoint.CMOR9ZOB.js";
|
|
7
|
-
import { DSInput as
|
|
7
|
+
import { DSInput as ut } from "../input.DG20x6gh.js";
|
|
8
8
|
import { g as Je } from "./helpers.BbWkXTr3.js";
|
|
9
|
-
import '../assets/Slider.
|
|
10
|
-
root:
|
|
9
|
+
import '../assets/Slider.Bidyhb-B.css';const pt = "ds-slider_root_13uvg_1", mt = "ds-slider_hint_13uvg_13", bt = "ds-slider_label_13uvg_13", ft = "ds-slider_number-input_13uvg_16", _t = "ds-slider_label-hint-input-wrapper_13uvg_20", ht = "ds-slider_label--hidden_13uvg_40", vt = "ds-slider_label--disabled_13uvg_53", gt = "ds-slider_number-input--small_13uvg_82", Tt = "ds-slider_min-max-label-wrapper_13uvg_87", xt = "ds-slider_min-max-label-wrapper--disabled_13uvg_101", kt = "ds-slider_min-label_13uvg_106", Nt = "ds-slider_max-label_13uvg_110", St = "ds-slider_slider-wrapper_13uvg_114", yt = "ds-slider_slider_13uvg_114", Dt = "ds-slider_value-tooltip_13uvg_138", It = "ds-slider_proxy-thumb_13uvg_142", Mt = "ds-slider_proxy-thumb--disabled_13uvg_209", Lt = "ds-slider_custom-track_13uvg_238", Vt = "ds-slider_custom-track--progress_13uvg_243", wt = "ds-slider_custom-track--runnable_13uvg_255", Ct = "ds-slider_custom-track--disabled_13uvg_269", Wt = "ds-slider_tick-wrapper_13uvg_289", $t = "ds-slider_tick_13uvg_289", Pt = "ds-slider_value-tooltip--visible_13uvg_348", At = "ds-slider_value-tooltip--disabled_13uvg_351", a = {
|
|
10
|
+
root: pt,
|
|
11
11
|
hint: mt,
|
|
12
12
|
label: bt,
|
|
13
13
|
numberInput: ft,
|
|
14
14
|
labelHintInputWrapper: _t,
|
|
15
15
|
labelHidden: ht,
|
|
16
|
-
labelDisabled:
|
|
17
|
-
numberInputSmall:
|
|
18
|
-
minMaxLabelWrapper:
|
|
19
|
-
minMaxLabelWrapperDisabled:
|
|
16
|
+
labelDisabled: vt,
|
|
17
|
+
numberInputSmall: gt,
|
|
18
|
+
minMaxLabelWrapper: Tt,
|
|
19
|
+
minMaxLabelWrapperDisabled: xt,
|
|
20
20
|
minLabel: kt,
|
|
21
21
|
maxLabel: Nt,
|
|
22
22
|
sliderWrapper: St,
|
|
@@ -32,37 +32,37 @@ import '../assets/Slider.DzwSjDPV.css';const ut = "ds-slider_root_1p0nf_1", mt =
|
|
|
32
32
|
tick: $t,
|
|
33
33
|
valueTooltipVisible: Pt,
|
|
34
34
|
valueTooltipDisabled: At
|
|
35
|
-
}, Et = 11, Qe = 4, Ye = (
|
|
36
|
-
if (
|
|
35
|
+
}, Et = 11, Qe = 4, Ye = (p) => p.toString().length, Rt = (p, r, e) => {
|
|
36
|
+
if (r === 0)
|
|
37
37
|
return !0;
|
|
38
|
-
const m = 1e-10,
|
|
39
|
-
return Math.abs(Math.round(
|
|
40
|
-
}, Ft = (
|
|
38
|
+
const m = 1e-10, n = (p - e) / r;
|
|
39
|
+
return Math.abs(Math.round(n) - n) < m;
|
|
40
|
+
}, Ft = (p, r, e, m) => {
|
|
41
41
|
var o;
|
|
42
|
-
const
|
|
43
|
-
let d = f + c *
|
|
42
|
+
const n = parseFloat(r), f = e, c = Math.round((p - f) / n);
|
|
43
|
+
let d = f + c * n;
|
|
44
44
|
d = Math.min(Math.max(d, e), m);
|
|
45
|
-
const
|
|
46
|
-
return parseFloat(d.toFixed(
|
|
47
|
-
}, Ht = (
|
|
48
|
-
const m = (
|
|
49
|
-
return `calc(${m}% + ${
|
|
45
|
+
const T = ((o = n.toString().split(".")[1]) == null ? void 0 : o.length) || 0;
|
|
46
|
+
return parseFloat(d.toFixed(T));
|
|
47
|
+
}, Ht = (p, r, e) => {
|
|
48
|
+
const m = (p - r) / (e - r) * 100, n = `calc(-0.24 * ${m}px + 10px)`;
|
|
49
|
+
return `calc(${m}% + ${n})`;
|
|
50
50
|
}, Bt = ({
|
|
51
|
-
id:
|
|
52
|
-
label:
|
|
51
|
+
id: p,
|
|
52
|
+
label: r
|
|
53
53
|
}) => {
|
|
54
|
-
if (!
|
|
54
|
+
if (!p)
|
|
55
55
|
throw new Error(Je("DSSlider", 'A unique "id" prop is required. Please add a unique "id" prop to the DSSlider component.'));
|
|
56
|
-
if (!
|
|
56
|
+
if (!r)
|
|
57
57
|
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}.`));
|
|
58
|
-
}, qt = ot((
|
|
59
|
-
const e =
|
|
60
|
-
let m,
|
|
61
|
-
e[0] !==
|
|
58
|
+
}, qt = ot((p, r) => {
|
|
59
|
+
const e = nt.c(154);
|
|
60
|
+
let m, n, f, c, d, T, o, S, U, G, X, J, Q, Y, Z, x;
|
|
61
|
+
e[0] !== p ? ({
|
|
62
62
|
id: c,
|
|
63
63
|
label: d,
|
|
64
64
|
className: m,
|
|
65
|
-
defaultValue:
|
|
65
|
+
defaultValue: n,
|
|
66
66
|
disabled: U,
|
|
67
67
|
hideLabel: G,
|
|
68
68
|
hideNumberInput: X,
|
|
@@ -70,32 +70,32 @@ import '../assets/Slider.DzwSjDPV.css';const ut = "ds-slider_root_1p0nf_1", mt =
|
|
|
70
70
|
isTooltipAlwaysVisible: J,
|
|
71
71
|
max: Q,
|
|
72
72
|
min: Y,
|
|
73
|
-
numberInputProps:
|
|
73
|
+
numberInputProps: T,
|
|
74
74
|
step: Z,
|
|
75
|
-
value:
|
|
75
|
+
value: x,
|
|
76
76
|
onChange: o,
|
|
77
77
|
...S
|
|
78
|
-
} =
|
|
78
|
+
} = p, e[0] = p, e[1] = m, e[2] = n, e[3] = f, e[4] = c, e[5] = d, e[6] = T, e[7] = o, 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] = x) : (m = e[1], n = e[2], f = e[3], c = e[4], d = e[5], T = e[6], o = 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], x = e[16]);
|
|
79
79
|
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;
|
|
80
80
|
process.env.NODE_ENV !== "production" && Bt({
|
|
81
81
|
id: c,
|
|
82
82
|
label: d
|
|
83
83
|
});
|
|
84
|
-
const i = Number(et), t = Number(tt),
|
|
84
|
+
const i = Number(et), t = Number(tt), u = Number(ee), De = dt(Ze), D = `${c}-label`, Ie = `${c}-hint`, Me = `${c}-number-input`;
|
|
85
85
|
let se;
|
|
86
|
-
e[17] !==
|
|
87
|
-
const [I, le] = Xe(se), [
|
|
86
|
+
e[17] !== n || e[18] !== t || e[19] !== x ? (se = x || n || t.toString() || "0", e[17] = n, e[18] = t, e[19] = x, e[20] = se) : se = e[20];
|
|
87
|
+
const [I, le] = Xe(se), [g, ae] = Xe(x || n || t || 0), st = ct(null);
|
|
88
88
|
let ie;
|
|
89
|
-
e[21] !==
|
|
90
|
-
st.current = s, typeof
|
|
91
|
-
}, e[21] =
|
|
89
|
+
e[21] !== r ? (ie = (s) => {
|
|
90
|
+
st.current = s, typeof r == "function" ? r(s) : r && (r.current = s);
|
|
91
|
+
}, e[21] = r, e[22] = ie) : ie = e[22];
|
|
92
92
|
const Le = ie;
|
|
93
|
-
let
|
|
94
|
-
e[23] !==
|
|
93
|
+
let re;
|
|
94
|
+
e[23] !== T ? (re = T || {}, e[23] = T, e[24] = re) : re = e[24];
|
|
95
95
|
const {
|
|
96
96
|
size: Ge,
|
|
97
97
|
suffix: Ve
|
|
98
|
-
} =
|
|
98
|
+
} = re, ne = Ge === void 0 ? "medium" : Ge;
|
|
99
99
|
let oe;
|
|
100
100
|
e[25] !== o ? (oe = (s) => {
|
|
101
101
|
const _ = parseFloat(s.target.value);
|
|
@@ -128,35 +128,35 @@ import '../assets/Slider.DzwSjDPV.css';const ut = "ds-slider_root_1p0nf_1", mt =
|
|
|
128
128
|
e[28] = I, e[29] = o, e[30] = i, e[31] = t, e[32] = ee, e[33] = k;
|
|
129
129
|
} else
|
|
130
130
|
k = e[33];
|
|
131
|
-
const M = (
|
|
131
|
+
const M = (u === 0 ? !1 : (i - t) / u <= Et) && (i - t) / u || 0;
|
|
132
132
|
let de;
|
|
133
|
-
if (e[34] !== i || e[35] !== t || e[36] !==
|
|
133
|
+
if (e[34] !== i || e[35] !== t || e[36] !== u || e[37] !== M) {
|
|
134
134
|
let s;
|
|
135
|
-
e[39] !== i || e[40] !== t || e[41] !==
|
|
136
|
-
const h = t + te *
|
|
135
|
+
e[39] !== i || e[40] !== t || e[41] !== u ? (s = (_, te) => {
|
|
136
|
+
const h = t + te * u, rt = Ht(h, t, i);
|
|
137
137
|
return /* @__PURE__ */ b("span", { className: a.tick, style: {
|
|
138
|
-
left:
|
|
138
|
+
left: rt
|
|
139
139
|
} }, h);
|
|
140
|
-
}, e[39] = i, e[40] = t, e[41] =
|
|
140
|
+
}, e[39] = i, e[40] = t, e[41] = u, e[42] = s) : s = e[42], de = Array.from({
|
|
141
141
|
length: M + 1
|
|
142
|
-
}, s), e[34] = i, e[35] = t, e[36] =
|
|
142
|
+
}, s), e[34] = i, e[35] = t, e[36] = u, e[37] = M, e[38] = de;
|
|
143
143
|
} else
|
|
144
144
|
de = e[38];
|
|
145
145
|
const Ce = de;
|
|
146
|
-
let
|
|
147
|
-
e[43] !== i || e[44] !== t || e[45] !==
|
|
146
|
+
let ue;
|
|
147
|
+
e[43] !== i || e[44] !== t || e[45] !== g ? (ue = () => {
|
|
148
148
|
if (t === i)
|
|
149
149
|
throw new Error("Min and max values cannot be the same.");
|
|
150
|
-
const s = (
|
|
150
|
+
const s = (g - t) / (i - t) * 100;
|
|
151
151
|
return Math.max(0, Math.min(s, 100));
|
|
152
|
-
}, e[43] = i, e[44] = t, e[45] =
|
|
153
|
-
const N =
|
|
154
|
-
let
|
|
155
|
-
e[47] !== N ? (
|
|
152
|
+
}, e[43] = i, e[44] = t, e[45] = g, e[46] = ue) : ue = e[46];
|
|
153
|
+
const N = ue;
|
|
154
|
+
let pe;
|
|
155
|
+
e[47] !== N ? (pe = () => {
|
|
156
156
|
const s = N();
|
|
157
157
|
return s < 50 ? `calc(${s}% + 4px)` : `calc(${s}% - 4px)`;
|
|
158
|
-
}, e[47] = N, e[48] =
|
|
159
|
-
const at =
|
|
158
|
+
}, e[47] = N, e[48] = pe) : pe = e[48];
|
|
159
|
+
const at = pe;
|
|
160
160
|
let me;
|
|
161
161
|
e[49] !== N ? (me = () => {
|
|
162
162
|
const s = 100 - N();
|
|
@@ -164,53 +164,53 @@ import '../assets/Slider.DzwSjDPV.css';const ut = "ds-slider_root_1p0nf_1", mt =
|
|
|
164
164
|
}, e[49] = N, e[50] = me) : me = e[50];
|
|
165
165
|
const it = me;
|
|
166
166
|
let be;
|
|
167
|
-
e[51] !== m ? (be =
|
|
167
|
+
e[51] !== m ? (be = v(a.slider, m), e[51] = m, e[52] = be) : be = e[52];
|
|
168
168
|
const We = be;
|
|
169
169
|
let fe;
|
|
170
|
-
e[53] !== l || e[54] !== De ? (fe =
|
|
170
|
+
e[53] !== l || e[54] !== De ? (fe = v(a.label, {
|
|
171
171
|
[a.labelHidden]: De,
|
|
172
172
|
[a.labelDisabled]: l
|
|
173
173
|
}), e[53] = l, e[54] = De, e[55] = fe) : fe = e[55];
|
|
174
|
-
const $e = fe, Pe =
|
|
174
|
+
const $e = fe, Pe = ne === "small";
|
|
175
175
|
let _e;
|
|
176
|
-
e[56] !== Pe ? (_e =
|
|
176
|
+
e[56] !== Pe ? (_e = v(a.numberInput, {
|
|
177
177
|
[a.numberInputSmall]: Pe
|
|
178
178
|
}), e[56] = Pe, e[57] = _e) : _e = e[57];
|
|
179
179
|
const Ae = _e;
|
|
180
180
|
let he;
|
|
181
|
-
e[58] !== l ? (he =
|
|
181
|
+
e[58] !== l ? (he = v(a.minMaxLabelWrapper, {
|
|
182
182
|
[a.minMaxLabelWrapperDisabled]: l
|
|
183
183
|
}), e[58] = l, e[59] = he) : he = e[59];
|
|
184
184
|
const Ee = he;
|
|
185
|
-
let
|
|
186
|
-
e[60] !== l ? (
|
|
185
|
+
let ve;
|
|
186
|
+
e[60] !== l ? (ve = v(a.customTrack, a.customTrackProgress, {
|
|
187
187
|
[a.customTrackDisabled]: l
|
|
188
|
-
}), e[60] = l, e[61] =
|
|
189
|
-
const Re =
|
|
190
|
-
let
|
|
191
|
-
e[62] !== l ? (
|
|
188
|
+
}), e[60] = l, e[61] = ve) : ve = e[61];
|
|
189
|
+
const Re = ve;
|
|
190
|
+
let ge;
|
|
191
|
+
e[62] !== l ? (ge = v(a.customTrack, a.customTrackRunnable, {
|
|
192
192
|
[a.customTrackDisabled]: l
|
|
193
|
-
}), e[62] = l, e[63] =
|
|
194
|
-
const Fe =
|
|
195
|
-
let
|
|
196
|
-
e[64] !== l ? (
|
|
193
|
+
}), e[62] = l, e[63] = ge) : ge = e[63];
|
|
194
|
+
const Fe = ge;
|
|
195
|
+
let Te;
|
|
196
|
+
e[64] !== l ? (Te = v(a.proxyThumb, {
|
|
197
197
|
[a.proxyThumbDisabled]: l
|
|
198
|
-
}), e[64] = l, e[65] =
|
|
199
|
-
const He =
|
|
200
|
-
let
|
|
201
|
-
e[66] !== l || e[67] !== ye ? (
|
|
198
|
+
}), e[64] = l, e[65] = Te) : Te = e[65];
|
|
199
|
+
const He = Te;
|
|
200
|
+
let xe;
|
|
201
|
+
e[66] !== l || e[67] !== ye ? (xe = v(a.valueTooltip, {
|
|
202
202
|
[a.valueTooltipVisible]: ye,
|
|
203
203
|
[a.valueTooltipDisabled]: l
|
|
204
|
-
}), e[66] = l, e[67] = ye, e[68] =
|
|
205
|
-
const Be =
|
|
204
|
+
}), e[66] = l, e[67] = ye, e[68] = xe) : xe = e[68];
|
|
205
|
+
const Be = xe;
|
|
206
206
|
let L;
|
|
207
207
|
e[69] !== c || e[70] !== d || e[71] !== $e || e[72] !== D ? (L = /* @__PURE__ */ b("label", { className: $e, htmlFor: c, id: D, children: d }), e[69] = c, e[70] = d, e[71] = $e, e[72] = D, e[73] = L) : L = e[73];
|
|
208
208
|
let V;
|
|
209
209
|
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];
|
|
210
210
|
let w;
|
|
211
|
-
e[77] !== l || e[78] !== k || e[79] !== y || e[80] !== Me || e[81] !== I || e[82] !== d || e[83] !== Ae || e[84] !==
|
|
211
|
+
e[77] !== l || e[78] !== k || e[79] !== y || e[80] !== Me || e[81] !== I || e[82] !== d || e[83] !== Ae || e[84] !== ne || e[85] !== Ve || e[86] !== i || e[87] !== t || e[88] !== u ? (w = !y && /* @__PURE__ */ b(ut, { id: Me, className: Ae, type: "number", min: t, max: i, step: u, inputMode: "decimal", autoComplete: "off", disabled: l, hideLabel: !0, value: I, onChange: lt, onBlur: k, onKeyDown: (s) => {
|
|
212
212
|
s.key === "Enter" && (s.preventDefault(), k(s));
|
|
213
|
-
}, label: d, size:
|
|
213
|
+
}, label: d, size: ne, suffix: Ve }), e[77] = l, e[78] = k, e[79] = y, e[80] = Me, e[81] = I, e[82] = d, e[83] = Ae, e[84] = ne, e[85] = Ve, e[86] = i, e[87] = t, e[88] = u, e[89] = w) : w = e[89];
|
|
214
214
|
let C;
|
|
215
215
|
e[90] !== L || e[91] !== V || e[92] !== w ? (C = /* @__PURE__ */ Se("div", { className: a.labelHintInputWrapper, children: [
|
|
216
216
|
L,
|
|
@@ -219,14 +219,14 @@ import '../assets/Slider.DzwSjDPV.css';const ut = "ds-slider_root_1p0nf_1", mt =
|
|
|
219
219
|
] }), e[90] = L, e[91] = V, e[92] = w, e[93] = C) : C = e[93];
|
|
220
220
|
const qe = Ye(t) < Qe;
|
|
221
221
|
let W;
|
|
222
|
-
e[94] !== qe ? (W =
|
|
222
|
+
e[94] !== qe ? (W = v({
|
|
223
223
|
[a.minLabel]: qe
|
|
224
224
|
}), e[94] = qe, e[95] = W) : W = e[95];
|
|
225
225
|
let $;
|
|
226
226
|
e[96] !== t || e[97] !== W ? ($ = /* @__PURE__ */ b("div", { className: W, children: t }), e[96] = t, e[97] = W, e[98] = $) : $ = e[98];
|
|
227
227
|
const Oe = Ye(i) < Qe;
|
|
228
228
|
let P;
|
|
229
|
-
e[99] !== Oe ? (P =
|
|
229
|
+
e[99] !== Oe ? (P = v({
|
|
230
230
|
[a.maxLabel]: Oe
|
|
231
231
|
}), e[99] = Oe, e[100] = P) : P = e[100];
|
|
232
232
|
let A;
|
|
@@ -256,13 +256,13 @@ import '../assets/Slider.DzwSjDPV.css';const ut = "ds-slider_root_1p0nf_1", mt =
|
|
|
256
256
|
let B;
|
|
257
257
|
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];
|
|
258
258
|
let q;
|
|
259
|
-
e[120] !== l || e[121] !== Le || e[122] !== we || e[123] !== c || e[124] !== i || e[125] !== t || e[126] !==
|
|
259
|
+
e[120] !== l || e[121] !== Le || e[122] !== we || e[123] !== c || e[124] !== i || e[125] !== t || e[126] !== u || e[127] !== S || e[128] !== We || e[129] !== D || e[130] !== g ? (q = /* @__PURE__ */ b("input", { ...S, id: c, type: "range", ref: Le, className: We, min: t, max: i, step: u, value: g, disabled: l, "aria-labelledby": D, onChange: we }), e[120] = l, e[121] = Le, e[122] = we, e[123] = c, e[124] = i, e[125] = t, e[126] = u, e[127] = S, e[128] = We, e[129] = D, e[130] = g, e[131] = q) : q = e[131];
|
|
260
260
|
let O;
|
|
261
261
|
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];
|
|
262
262
|
let z;
|
|
263
263
|
e[135] !== He ? (z = /* @__PURE__ */ b("div", { className: He }), e[135] = He, e[136] = z) : z = e[136];
|
|
264
264
|
let K;
|
|
265
|
-
e[137] !== l || e[138] !== y || e[139] !==
|
|
265
|
+
e[137] !== l || e[138] !== y || e[139] !== g || e[140] !== Be ? (K = y && /* @__PURE__ */ b("div", { className: Be, "aria-disabled": l, children: g }), e[137] = l, e[138] = y, e[139] = g, e[140] = Be, e[141] = K) : K = e[141];
|
|
266
266
|
let j;
|
|
267
267
|
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: [
|
|
268
268
|
F,
|
|
@@ -3,7 +3,7 @@ import { jsxs as f, jsx as S } from "react/jsx-runtime";
|
|
|
3
3
|
import { d as _ } from "./index.CgTHIF3K.js";
|
|
4
4
|
import { c as p } from "./index.CEyLAtio.js";
|
|
5
5
|
import "react";
|
|
6
|
-
import { D as E } from "./Icon.
|
|
6
|
+
import { D as E } from "./Icon.NSsVrYeq.js";
|
|
7
7
|
import '../assets/SystemFeedback.RcrPepSZ.css';const x = "ds-system-feedback_root_1lr41_1", D = {
|
|
8
8
|
root: x
|
|
9
9
|
}, h = ["success", "error", "warning"], k = {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx as N, jsxs as L } from "react/jsx-runtime";
|
|
3
3
|
import { d as M } from "./index.CgTHIF3K.js";
|
|
4
4
|
import { useState as $ } from "react";
|
|
5
|
-
import { TabList as j } from "../tablist.
|
|
5
|
+
import { TabList as j } from "../tablist.V7DBklhE.js";
|
|
6
6
|
import { TabPane as B } from "../tabpane.CB-eudyw.js";
|
|
7
7
|
import { g as C } from "./TabPane.utils.DG16Y2uD.js";
|
|
8
8
|
import { g, r as O } from "./helpers.BbWkXTr3.js";
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as d, jsx as h, Fragment as le } from "react/jsx-runtime";
|
|
3
|
+
import { c as A } from "./index.CEyLAtio.js";
|
|
4
|
+
import { forwardRef as ie, useState as i, useRef as ce, useEffect as m } from "react";
|
|
5
|
+
import { g as q, p as z } from "./helpers.BbWkXTr3.js";
|
|
6
|
+
import { u as de } from "./useBreakpoint.CMOR9ZOB.js";
|
|
7
|
+
import "./index.CgTHIF3K.js";
|
|
8
|
+
import { Asterisk as ue } from "../asterisk.CR60hx8S.js";
|
|
9
|
+
import { D as fe } from "./SystemFeedback.CyGbUCzT.js";
|
|
10
|
+
import '../assets/Textarea.Dq4rH9Tg.css';const pe = "ds-textarea_textarea_1s8pw_1", be = "ds-textarea_textarea--small_1s8pw_9", _e = "ds-textarea_textarea--invalid_1s8pw_121", he = "ds-textarea_textarea--resize-auto_1s8pw_145", me = "ds-textarea_root_1s8pw_155", xe = "ds-textarea_hint_1s8pw_164", we = "ds-textarea_label_1s8pw_164", ve = "ds-textarea_label--hidden_1s8pw_303", Ce = "ds-textarea_label--disabled_1s8pw_316", Se = "ds-textarea_feedback_1s8pw_336", Ae = "ds-textarea_char-count_1s8pw_341", De = "ds-textarea_char-count-announcer_1s8pw_357", a = {
|
|
11
|
+
textarea: pe,
|
|
12
|
+
textareaSmall: be,
|
|
13
|
+
textareaInvalid: _e,
|
|
14
|
+
textareaResizeAuto: he,
|
|
15
|
+
root: me,
|
|
16
|
+
hint: xe,
|
|
17
|
+
label: we,
|
|
18
|
+
labelHidden: ve,
|
|
19
|
+
labelDisabled: Ce,
|
|
20
|
+
feedback: Se,
|
|
21
|
+
charCount: Ae,
|
|
22
|
+
charCountAnnouncer: De
|
|
23
|
+
}, Ve = ["medium", "small"], Ie = ({
|
|
24
|
+
id: r,
|
|
25
|
+
label: u
|
|
26
|
+
}) => {
|
|
27
|
+
if (!r)
|
|
28
|
+
throw new Error(q("DSTextarea", 'A unique "id" prop is required. Please add a unique "id" prop to the DSTextarea component.'));
|
|
29
|
+
if (!u)
|
|
30
|
+
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}.`));
|
|
31
|
+
}, Te = ie(({
|
|
32
|
+
id: r,
|
|
33
|
+
label: u,
|
|
34
|
+
charsLimitText: M = "Character limit reached",
|
|
35
|
+
charsRemainingText: O = "Characters remaining:",
|
|
36
|
+
className: F,
|
|
37
|
+
defaultValue: X,
|
|
38
|
+
disabled: D = !1,
|
|
39
|
+
hint: x,
|
|
40
|
+
hideLabel: Z = !1,
|
|
41
|
+
invalid: s = !1,
|
|
42
|
+
maxLength: e,
|
|
43
|
+
readonly: I = !1,
|
|
44
|
+
required: T = !1,
|
|
45
|
+
resize: f = "vertical",
|
|
46
|
+
size: G = "medium",
|
|
47
|
+
systemFeedback: n,
|
|
48
|
+
value: w,
|
|
49
|
+
wrapperClassName: J,
|
|
50
|
+
onChange: y,
|
|
51
|
+
onInput: R,
|
|
52
|
+
...K
|
|
53
|
+
}, p) => {
|
|
54
|
+
process.env.NODE_ENV !== "production" && Ie({
|
|
55
|
+
id: r,
|
|
56
|
+
label: u
|
|
57
|
+
});
|
|
58
|
+
const [Q, N] = i(X || ""), [l, E] = i(0), [U, g] = i(0), [W, $] = i("off"), [k, v] = i(n), [C, S] = i(s), H = w !== void 0, b = H ? w : Q, o = ce(null), Y = (t) => {
|
|
59
|
+
o.current = t, typeof p == "function" ? p(t) : p && (p.current = t);
|
|
60
|
+
}, L = de(Z);
|
|
61
|
+
m(() => {
|
|
62
|
+
if (!e || e <= 0)
|
|
63
|
+
return;
|
|
64
|
+
l >= e * 0.8 ? $("polite") : $("off");
|
|
65
|
+
const t = setTimeout(() => {
|
|
66
|
+
g(e - l || 0);
|
|
67
|
+
}, 1e3);
|
|
68
|
+
return () => clearTimeout(t);
|
|
69
|
+
}, [l]), m(() => {
|
|
70
|
+
N(b || ""), c(), e && e > 0 && (E(b.toString().length || 0), g(e - b.toString().length || 0));
|
|
71
|
+
}, [w]), m(() => {
|
|
72
|
+
s && n ? (v(n), S(s)) : !s && e && e >= 0 && l >= e ? (S(!0), v(M)) : (v(n), S(s));
|
|
73
|
+
}, [s, C, n, l]), m(() => {
|
|
74
|
+
if (f === "auto")
|
|
75
|
+
return c(), window.addEventListener("resize", c), () => window.removeEventListener("resize", c);
|
|
76
|
+
}, [f, o.current]);
|
|
77
|
+
const ee = A(a.root, J), te = A(a.textarea, F, {
|
|
78
|
+
// small textarea
|
|
79
|
+
[a.textareaSmall]: G === "small",
|
|
80
|
+
// invalid state
|
|
81
|
+
[a.textareaInvalid]: C,
|
|
82
|
+
// resize handling
|
|
83
|
+
[a.textareaResizeAuto]: f === "auto"
|
|
84
|
+
}), ae = A(a.label, {
|
|
85
|
+
// hide label only visually to keep them available for assistive technologies
|
|
86
|
+
[a.labelHidden]: L,
|
|
87
|
+
[a.labelDisabled]: D
|
|
88
|
+
}), V = `${r}-label`, P = `${r}-feedback`, j = `${r}-hint`, B = `${r}-char-count-announcer`, re = x ? ` ${j}` : "", c = () => {
|
|
89
|
+
if (o.current && f === "auto") {
|
|
90
|
+
o.current.style.height = "auto";
|
|
91
|
+
const t = z(o.current.scrollHeight), _ = z(2);
|
|
92
|
+
o.current.style.height = `${// We need to add 2px (border-top & border-bottom) to the scrollHeight to prevent the textarea
|
|
93
|
+
// from jumping as soon as the user starts typing.
|
|
94
|
+
t + _}rem`;
|
|
95
|
+
}
|
|
96
|
+
}, se = () => {
|
|
97
|
+
const t = [];
|
|
98
|
+
return e && e > 0 && t.push(B), s && n && t.push(P), t.length > 0 ? t.join(" ") : void 0;
|
|
99
|
+
}, oe = (t) => {
|
|
100
|
+
var _;
|
|
101
|
+
R && R(t), e && e > 0 && E(((_ = o.current) == null ? void 0 : _.value.length) || 0), c();
|
|
102
|
+
}, ne = (t) => {
|
|
103
|
+
y && y(t), H || N(t.target.value);
|
|
104
|
+
};
|
|
105
|
+
return /* @__PURE__ */ d("div", { className: ee, children: [
|
|
106
|
+
/* @__PURE__ */ d("label", { className: ae, id: V, htmlFor: r, children: [
|
|
107
|
+
u,
|
|
108
|
+
T && /* @__PURE__ */ h(ue, {})
|
|
109
|
+
] }),
|
|
110
|
+
x && /* @__PURE__ */ h("div", { className: a.hint, id: j, children: x }),
|
|
111
|
+
C && k && /* @__PURE__ */ h(fe, { className: a.feedback, message: k, variant: "error", id: P }),
|
|
112
|
+
/* @__PURE__ */ h(
|
|
113
|
+
"textarea",
|
|
114
|
+
{
|
|
115
|
+
className: te,
|
|
116
|
+
id: r,
|
|
117
|
+
...K,
|
|
118
|
+
ref: Y,
|
|
119
|
+
"aria-labelledby": `${V}${re}`,
|
|
120
|
+
"aria-describedby": se(),
|
|
121
|
+
"aria-invalid": s,
|
|
122
|
+
"aria-disabled": I,
|
|
123
|
+
maxLength: e,
|
|
124
|
+
readOnly: I,
|
|
125
|
+
required: T,
|
|
126
|
+
disabled: D,
|
|
127
|
+
value: b,
|
|
128
|
+
defaultValue: void 0,
|
|
129
|
+
rows: void 0,
|
|
130
|
+
cols: void 0,
|
|
131
|
+
onChange: ne,
|
|
132
|
+
onInput: oe
|
|
133
|
+
}
|
|
134
|
+
),
|
|
135
|
+
e !== void 0 && e > 0 && /* @__PURE__ */ d(le, { children: [
|
|
136
|
+
/* @__PURE__ */ d("div", { className: a.charCount, "aria-hidden": "true", children: [
|
|
137
|
+
l,
|
|
138
|
+
"/",
|
|
139
|
+
e
|
|
140
|
+
] }),
|
|
141
|
+
/* @__PURE__ */ d(
|
|
142
|
+
"div",
|
|
143
|
+
{
|
|
144
|
+
className: a.charCountAnnouncer,
|
|
145
|
+
id: B,
|
|
146
|
+
"aria-live": W,
|
|
147
|
+
"aria-atomic": "true",
|
|
148
|
+
children: [
|
|
149
|
+
O,
|
|
150
|
+
" ",
|
|
151
|
+
U
|
|
152
|
+
]
|
|
153
|
+
}
|
|
154
|
+
)
|
|
155
|
+
] })
|
|
156
|
+
] });
|
|
157
|
+
});
|
|
158
|
+
Te.displayName = "DSTextarea";
|
|
159
|
+
export {
|
|
160
|
+
Te as D,
|
|
161
|
+
Ve as T,
|
|
162
|
+
Ie as v
|
|
163
|
+
};
|