@stihl-design-system/components 1.0.0-RC.8 → 1.0.0-RC.9
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/assets/CustomReactSelect.CMkn-EGK.css +1 -0
- package/assets/Fieldset.qHYeUFZt.css +1 -0
- package/assets/InputPassword.Cf394z47.css +1 -0
- package/assets/InputSearch.eCRQoxjN.css +1 -0
- package/assets/InputStepper.B80KulYE.css +1 -0
- package/assets/Notification.DK6agBGS.css +1 -0
- package/assets/Select.BptsMxz4.css +1 -0
- package/assets/Textarea.CIIVh03G.css +1 -0
- package/assets/Toast.Dsvs1zdM.css +1 -0
- package/assets/asterisk.DlJ4YtSZ.css +1 -0
- package/assets/button.B1O7Yw3Q.css +1 -0
- package/assets/buttonround.DlH_ipDo.css +1 -0
- package/assets/checkbox.K4CVYK9g.css +1 -0
- package/assets/heading.6bER-Eac.css +1 -0
- package/assets/input.C0MrSbQu.css +1 -0
- package/assets/link.vtTST2ki.css +1 -0
- package/assets/linkstandalone.BtAcziZ7.css +1 -0
- package/assets/optioncheckbox.BJJAph5_.css +1 -0
- package/assets/radio.9kpIO3HC.css +1 -0
- package/assets/skiptocontent.CHcqLS7S.css +1 -0
- package/assets/switch.2DQF2zH-.css +1 -0
- package/assets/systemfeedback.Sq0bAIyf.css +1 -0
- package/assets/text.Dhb_l50R.css +1 -0
- package/assets/title.f74Bosn-.css +1 -0
- package/{asterisk.Cjbk-xZi.js → asterisk.DDn-yX4P.js} +1 -1
- package/button.CkHCQg3Y.js +135 -0
- package/buttonround.DX3u2Fio.js +118 -0
- package/checkbox.BbmCDJCm.js +112 -0
- package/{checkboxgroup.C9VX3c5W.js → checkboxgroup.CPENWSuk.js} +2 -2
- package/chunks/{CheckboxGroup.kG1WWhe_.js → CheckboxGroup.Dx_Hn8Dl.js} +2 -2
- package/chunks/CustomReactSelect.C4rTVlvy.js +3593 -0
- package/chunks/{Dialog.o7bcfCBf.js → Dialog.TPjJ_yxK.js} +1 -1
- package/chunks/{Drawer.VbG4cfgJ.js → Drawer.DrLGSch-.js} +1 -1
- package/chunks/{Fieldset.B1vsrHNv.js → Fieldset.P09LInkT.js} +29 -29
- package/chunks/{Input.utils.BGUhXCNP.js → Input.utils.ChV6RJsh.js} +19 -17
- package/chunks/InputPassword.CSc1c98k.js +140 -0
- package/chunks/{InputSearch.BbCdCCax.js → InputSearch.DrgdGFT_.js} +49 -49
- package/chunks/{InputStepper.DR3NR_II.js → InputStepper.DJEuIr4C.js} +76 -76
- package/chunks/{Notification.B6a6FOlS.js → Notification.B68mMDiB.js} +24 -24
- package/chunks/{RadioGroup.BO4pbAJw.js → RadioGroup.B5jRveyI.js} +2 -2
- package/chunks/Select.Cl2eJR1z.js +191 -0
- package/chunks/Textarea.Sk9-GXfs.js +195 -0
- package/chunks/Toast.D9DAuz2m.js +89 -0
- package/{combobox.Dgp3kvFR.js → combobox.jDpV6bv-.js} +1 -1
- package/{customreactselect.BxkJi_UE.js → customreactselect.C2QK_Q8T.js} +4 -4
- package/{dialog.CVFl9IVY.js → dialog.BPX7RJtQ.js} +2 -2
- package/{drawer.BheN3lap.js → drawer.BfEPcSsQ.js} +2 -2
- package/fieldset.4yvz0e7M.js +11 -0
- package/heading.CAkraI2D.js +50 -0
- package/index.es.js +26 -26
- package/input.lLMqAG-6.js +236 -0
- package/{inputpassword.CvnUeLTq.js → inputpassword.BIdYGrhB.js} +4 -4
- package/{inputsearch.ClX9PlYG.js → inputsearch.DleOblJp.js} +4 -4
- package/inputstepper.DWkHwOAn.js +13 -0
- package/link.KZaBufPM.js +116 -0
- package/linkstandalone.B6tN-NXD.js +80 -0
- package/{notification.BGRev3jC.js → notification.DdJjbSdM.js} +2 -2
- package/optioncheckbox.DwQEfxGG.js +43 -0
- package/package.json +5 -3
- package/partials/index.js +442 -442
- package/radio.CWGJtmKl.js +115 -0
- package/{radiogroup.CiENWRos.js → radiogroup.FfK4DLsV.js} +3 -3
- package/{select.DLYav8gw.js → select.BEuTuEFZ.js} +3 -3
- package/{skiptocontent.ALhHiH8t.js → skiptocontent.fP4SOp-p.js} +9 -9
- package/styles/scss/lib/_heading.scss +50 -9
- package/styles/scss/lib/_helpers.scss +12 -0
- package/styles/scss/lib/_link.scss +58 -94
- package/styles/scss/lib/_text.scss +57 -14
- package/switch.KO8HZPNL.js +65 -0
- package/{systemfeedback.CUWch42u.js → systemfeedback._8gatmgR.js} +1 -1
- package/text.rgDKQBrU.js +57 -0
- package/{textarea.hLgeYdsI.js → textarea.DV1yVty7.js} +3 -3
- package/title.LY1ylQsb.js +36 -0
- package/{toast.CtgjrtBC.js → toast.BB8L0ixD.js} +2 -2
- package/{toastmanager.6mUZ8eCN.js → toastmanager.DifUvJcg.js} +1 -1
- package/utils/index.d.ts +1 -0
- package/utils/useIsomorphicLayoutEffect.d.ts +26 -0
- package/assets/CustomReactSelect.Bsphydqt.css +0 -1
- package/assets/Fieldset.D0jHAGRL.css +0 -1
- package/assets/InputPassword.VCNO8ANM.css +0 -1
- package/assets/InputSearch.BMRAb95l.css +0 -1
- package/assets/InputStepper.BKjqNi-i.css +0 -1
- package/assets/Notification.Bg63cvs4.css +0 -1
- package/assets/Select.Bz1TImkI.css +0 -1
- package/assets/Textarea.D2h5cW_t.css +0 -1
- package/assets/Toast.ChT0hchk.css +0 -1
- package/assets/asterisk.JlyPArZu.css +0 -1
- package/assets/button.3UhhGy87.css +0 -1
- package/assets/buttonround.DXDlPKwD.css +0 -1
- package/assets/checkbox.BjIn2stV.css +0 -1
- package/assets/heading.CCbuI4X-.css +0 -1
- package/assets/input.71tOIrpp.css +0 -1
- package/assets/link.BJHmVrew.css +0 -1
- package/assets/linkstandalone.Bx8Uvo0G.css +0 -1
- package/assets/optioncheckbox.BdRJHcSw.css +0 -1
- package/assets/radio.ewRpPo4W.css +0 -1
- package/assets/skiptocontent.DGVJ77cj.css +0 -1
- package/assets/switch.Ds-I_ybT.css +0 -1
- package/assets/systemfeedback.BzJATHDd.css +0 -1
- package/assets/text.B-CTuGgI.css +0 -1
- package/assets/title.DlhX9K3W.css +0 -1
- package/button.DPrDynn_.js +0 -135
- package/buttonround.ix_-O4l1.js +0 -118
- package/checkbox.hoVQ37RP.js +0 -112
- package/chunks/CustomReactSelect.BVv0Zcvc.js +0 -4981
- package/chunks/InputPassword.TlusvIds.js +0 -140
- package/chunks/Select.COdS787F.js +0 -191
- package/chunks/Textarea.oqCrSopu.js +0 -195
- package/chunks/Toast.BpyBIPFW.js +0 -89
- package/fieldset.aY3V2jK2.js +0 -11
- package/heading.BTNroD1E.js +0 -50
- package/input.CfO9lL_o.js +0 -236
- package/inputstepper.Dd76qaQT.js +0 -13
- package/link.CIY7SOpm.js +0 -115
- package/linkstandalone.DNe0Nydm.js +0 -79
- package/optioncheckbox.C4l2UIak.js +0 -43
- package/radio.epf54-sG.js +0 -115
- package/switch.rd7PdLc9.js +0 -65
- package/text.CrYUewrP.js +0 -57
- package/title.Dvp8LKJt.js +0 -36
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { j as n } from "./jsx-runtime.C115EyI4.js";
|
|
3
3
|
import { c as s } from "./index.CvOaL64Y.js";
|
|
4
4
|
import { useRef as v, useState as x, useEffect as b } from "react";
|
|
5
|
-
import { DSButton as j } from "../button.
|
|
5
|
+
import { DSButton as j } from "../button.CkHCQg3Y.js";
|
|
6
6
|
import { g as B } from "./helpers.B1JT5ShS.js";
|
|
7
7
|
import '../assets/Dialog.DdLMmOLt.css';const E = "_dialog_qvh8h_80", C = "_content-wrapper_qvh8h_151", F = "_content-wrapper--no-footer_qvh8h_157", W = "_close-button_qvh8h_165", k = "_header_qvh8h_178", R = "_content_qvh8h_151", y = "_footer_qvh8h_180", z = "_header--scrollable_qvh8h_201", L = "_header--close-button_qvh8h_210", M = "_content--no-footer_qvh8h_223", H = "_footer--scrollable_qvh8h_230", o = {
|
|
8
8
|
dialog: E,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { j as r } from "./jsx-runtime.C115EyI4.js";
|
|
3
3
|
import { c as n } from "./index.CvOaL64Y.js";
|
|
4
4
|
import { useRef as b, useState as j, useEffect as w } from "react";
|
|
5
|
-
import { DSButton as B } from "../button.
|
|
5
|
+
import { DSButton as B } from "../button.CkHCQg3Y.js";
|
|
6
6
|
import { g as R } from "./helpers.B1JT5ShS.js";
|
|
7
7
|
import '../assets/Drawer.BqBgbSuP.css';const W = "_drawer_h62s5_85", C = "_drawer--end_h62s5_143", F = "_content-wrapper_h62s5_161", k = "_content-wrapper--no-footer_h62s5_167", I = "_close-button_h62s5_170", O = "_header_h62s5_183", y = "_content_h62s5_161", z = "_footer_h62s5_185", L = "_header--scrollable_h62s5_206", M = "_header--close-button_h62s5_215", H = "_content--no-footer_h62s5_229", P = "_footer--scrollable_h62s5_236", o = {
|
|
8
8
|
drawer: W,
|
|
@@ -2,21 +2,21 @@
|
|
|
2
2
|
import { j as e } from "./jsx-runtime.C115EyI4.js";
|
|
3
3
|
import { c } from "./index.CvOaL64Y.js";
|
|
4
4
|
import "react";
|
|
5
|
-
import { Asterisk as
|
|
6
|
-
import { DSHeading as F } from "../heading.
|
|
7
|
-
import { DSSystemFeedback as k } from "../systemfeedback.
|
|
8
|
-
import { g as
|
|
9
|
-
import '../assets/Fieldset.
|
|
5
|
+
import { Asterisk as z } from "../asterisk.DDn-yX4P.js";
|
|
6
|
+
import { DSHeading as F } from "../heading.CAkraI2D.js";
|
|
7
|
+
import { DSSystemFeedback as k } from "../systemfeedback._8gatmgR.js";
|
|
8
|
+
import { g as h } from "./helpers.B1JT5ShS.js";
|
|
9
|
+
import '../assets/Fieldset.qHYeUFZt.css';const v = "_root_xfwzz_76", N = "_child-wrapper_xfwzz_82", E = "_legend_xfwzz_89", M = "_legend--utility--m_xfwzz_93", q = "_description_xfwzz_106", C = "_description--small_xfwzz_121", P = "_system-feedback_xfwzz_125", i = {
|
|
10
10
|
root: v,
|
|
11
|
-
"child-wrapper": "_child-
|
|
12
|
-
childWrapper:
|
|
13
|
-
legend:
|
|
14
|
-
"legend--utility--m": "_legend--utility--
|
|
15
|
-
legendUtilityM:
|
|
16
|
-
description:
|
|
17
|
-
"description--small": "_description--
|
|
11
|
+
"child-wrapper": "_child-wrapper_xfwzz_82",
|
|
12
|
+
childWrapper: N,
|
|
13
|
+
legend: E,
|
|
14
|
+
"legend--utility--m": "_legend--utility--m_xfwzz_93",
|
|
15
|
+
legendUtilityM: M,
|
|
16
|
+
description: q,
|
|
17
|
+
"description--small": "_description--small_xfwzz_121",
|
|
18
18
|
descriptionSmall: C,
|
|
19
|
-
"system-feedback": "_system-
|
|
19
|
+
"system-feedback": "_system-feedback_xfwzz_125",
|
|
20
20
|
systemFeedback: P
|
|
21
21
|
}, T = ({
|
|
22
22
|
description: a,
|
|
@@ -26,14 +26,14 @@ import '../assets/Fieldset.D0jHAGRL.css';const v = "_root_z5foq_76", w = "_child
|
|
|
26
26
|
}) => {
|
|
27
27
|
if (!s && (a || t))
|
|
28
28
|
throw new Error(
|
|
29
|
-
|
|
29
|
+
h(
|
|
30
30
|
"DSFieldset",
|
|
31
31
|
'A unique "id" prop is required when providing the description or systemFeedback property. Please add an unique "id" prop to the DSFieldset component.'
|
|
32
32
|
)
|
|
33
33
|
);
|
|
34
34
|
if (!n)
|
|
35
35
|
throw new Error(
|
|
36
|
-
|
|
36
|
+
h(
|
|
37
37
|
"DSFieldset",
|
|
38
38
|
"The legend prop is required. Please add the legend prop to the DSFieldset component."
|
|
39
39
|
)
|
|
@@ -43,42 +43,42 @@ import '../assets/Fieldset.D0jHAGRL.css';const v = "_root_z5foq_76", w = "_child
|
|
|
43
43
|
legend: s,
|
|
44
44
|
className: n,
|
|
45
45
|
description: t,
|
|
46
|
-
disabled:
|
|
46
|
+
disabled: w = !1,
|
|
47
47
|
id: d,
|
|
48
48
|
invalid: p = !1,
|
|
49
49
|
required: m = !1,
|
|
50
50
|
systemFeedback: o,
|
|
51
|
-
...
|
|
51
|
+
...y
|
|
52
52
|
}) => {
|
|
53
53
|
process.env.NODE_ENV !== "production" && T({ description: t, id: d, legend: s, systemFeedback: o });
|
|
54
54
|
let r, _, f;
|
|
55
55
|
const l = typeof s == "object" && s !== void 0;
|
|
56
56
|
l && ({ headingSize: r, headingTag: _, headingText: f } = s);
|
|
57
|
-
const g = `${d}-feedback`,
|
|
57
|
+
const g = `${d}-feedback`, x = `${d}-description`, j = [
|
|
58
58
|
o && g,
|
|
59
|
-
t &&
|
|
60
|
-
].filter(Boolean).join(" "),
|
|
59
|
+
t && x
|
|
60
|
+
].filter(Boolean).join(" "), S = !l || r === "small" || r === "small-uppercase", b = c(i.root, n), u = c(i.legend, {
|
|
61
61
|
[i.legendUtilityM]: !l
|
|
62
62
|
}), D = c(i.description, {
|
|
63
|
-
[i.descriptionSmall]:
|
|
63
|
+
[i.descriptionSmall]: S
|
|
64
64
|
});
|
|
65
65
|
return /* @__PURE__ */ e.jsxs(
|
|
66
66
|
"fieldset",
|
|
67
67
|
{
|
|
68
|
-
className:
|
|
69
|
-
disabled:
|
|
70
|
-
...
|
|
68
|
+
className: b,
|
|
69
|
+
disabled: w,
|
|
70
|
+
...y,
|
|
71
71
|
"aria-invalid": p,
|
|
72
|
-
"aria-describedby":
|
|
72
|
+
"aria-describedby": j || void 0,
|
|
73
73
|
children: [
|
|
74
|
-
/* @__PURE__ */ e.jsx("legend", { className:
|
|
74
|
+
/* @__PURE__ */ e.jsx("legend", { className: u, children: l ? /* @__PURE__ */ e.jsxs(F, { tag: _, size: r, children: [
|
|
75
75
|
f,
|
|
76
|
-
m && /* @__PURE__ */ e.jsx(
|
|
76
|
+
m && /* @__PURE__ */ e.jsx(z, {})
|
|
77
77
|
] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
78
78
|
s,
|
|
79
|
-
m && /* @__PURE__ */ e.jsx(
|
|
79
|
+
m && /* @__PURE__ */ e.jsx(z, {})
|
|
80
80
|
] }) }),
|
|
81
|
-
t && /* @__PURE__ */ e.jsx("span", { id:
|
|
81
|
+
t && /* @__PURE__ */ e.jsx("span", { id: x, className: D, children: t }),
|
|
82
82
|
p && o && /* @__PURE__ */ e.jsx(
|
|
83
83
|
k,
|
|
84
84
|
{
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { useLayoutEffect as p, useEffect as u } from "react";
|
|
3
|
+
import { h } from "./useBreakpoint.5xBNDiCf.js";
|
|
2
4
|
import { g as t } from "./helpers.B1JT5ShS.js";
|
|
3
|
-
import "
|
|
4
|
-
|
|
5
|
-
const a = 8, i = 5, T = ["medium", "small"], u = [
|
|
5
|
+
import { h as l } from "./has-document.r9i9TxKV.js";
|
|
6
|
+
const f = h ? p : u, a = 8, i = 5, U = ["medium", "small"], S = [
|
|
6
7
|
"color",
|
|
7
8
|
"date",
|
|
8
9
|
"datetime-local",
|
|
@@ -15,7 +16,7 @@ const a = 8, i = 5, T = ["medium", "small"], u = [
|
|
|
15
16
|
"text",
|
|
16
17
|
"time",
|
|
17
18
|
"url"
|
|
18
|
-
],
|
|
19
|
+
], w = [
|
|
19
20
|
"week",
|
|
20
21
|
"hidden",
|
|
21
22
|
"button",
|
|
@@ -27,7 +28,7 @@ const a = 8, i = 5, T = ["medium", "small"], u = [
|
|
|
27
28
|
"submit",
|
|
28
29
|
"image",
|
|
29
30
|
"datetime"
|
|
30
|
-
],
|
|
31
|
+
], P = ({
|
|
31
32
|
id: e,
|
|
32
33
|
label: n,
|
|
33
34
|
prefix: o,
|
|
@@ -72,8 +73,8 @@ const a = 8, i = 5, T = ["medium", "small"], u = [
|
|
|
72
73
|
"Suffix and an action button cannot be used at the same time."
|
|
73
74
|
)
|
|
74
75
|
);
|
|
75
|
-
},
|
|
76
|
-
if (!
|
|
76
|
+
}, g = (e) => {
|
|
77
|
+
if (!S.includes(e) && !w.includes(e))
|
|
77
78
|
throw new Error(
|
|
78
79
|
t(
|
|
79
80
|
"DSInput",
|
|
@@ -95,17 +96,18 @@ const a = 8, i = 5, T = ["medium", "small"], u = [
|
|
|
95
96
|
hidden: 'Type hidden is not supported by DSInput component. Use a default <input type="hidden" /> element instead.'
|
|
96
97
|
};
|
|
97
98
|
n[e] && console.warn(t("DSInput", n[e]));
|
|
98
|
-
},
|
|
99
|
+
}, I = () => l && "showPicker" in HTMLInputElement.prototype && !!window.navigator.userAgent.match(/chrome|chromium|crios|edg/i), E = (e, n) => I() && (e || n), k = (e) => e === "date" || e === "datetime-local" || e === "month", x = (e) => e === "time";
|
|
99
100
|
export {
|
|
100
|
-
|
|
101
|
+
U as I,
|
|
101
102
|
a as M,
|
|
102
|
-
|
|
103
|
-
|
|
103
|
+
S,
|
|
104
|
+
w as U,
|
|
104
105
|
i as a,
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
h,
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
106
|
+
g as b,
|
|
107
|
+
x as c,
|
|
108
|
+
I as h,
|
|
109
|
+
k as i,
|
|
110
|
+
E as s,
|
|
111
|
+
f as u,
|
|
112
|
+
P as v
|
|
111
113
|
};
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { j as a } from "./jsx-runtime.C115EyI4.js";
|
|
3
|
+
import { c as i } from "./index.CvOaL64Y.js";
|
|
4
|
+
import { useState as A } from "react";
|
|
5
|
+
import { u as D } from "./useBreakpoint.5xBNDiCf.js";
|
|
6
|
+
import { Asterisk as C } from "../asterisk.DDn-yX4P.js";
|
|
7
|
+
import { DSButton as L } from "../button.CkHCQg3Y.js";
|
|
8
|
+
import { DSSystemFeedback as $ } from "../systemfeedback._8gatmgR.js";
|
|
9
|
+
import { g as x } from "./helpers.B1JT5ShS.js";
|
|
10
|
+
import '../assets/InputPassword.Cf394z47.css';const E = "_input_1pqhx_226", R = "_input--invalid_1pqhx_338", V = "_input--small_1pqhx_345", O = "_input--has-leading-icon_1pqhx_399", F = "_input--has-action-button_1pqhx_402", M = "_input--has-second-action-button_1pqhx_405", T = "_input--has-affix_1pqhx_417", G = "_input--is-ready_1pqhx_431", J = "_root_1pqhx_438", K = "_hint_1pqhx_446", Q = "_label_1pqhx_446", U = "_wrapper_1pqhx_450", W = "_action-button_1pqhx_456", X = "_label--hidden_1pqhx_475", Y = "_feedback_1pqhx_504", t = {
|
|
11
|
+
input: E,
|
|
12
|
+
"input--invalid": "_input--invalid_1pqhx_338",
|
|
13
|
+
inputInvalid: R,
|
|
14
|
+
"input--small": "_input--small_1pqhx_345",
|
|
15
|
+
inputSmall: V,
|
|
16
|
+
"input--has-leading-icon": "_input--has-leading-icon_1pqhx_399",
|
|
17
|
+
inputHasLeadingIcon: O,
|
|
18
|
+
"input--has-action-button": "_input--has-action-button_1pqhx_402",
|
|
19
|
+
inputHasActionButton: F,
|
|
20
|
+
"input--has-second-action-button": "_input--has-second-action-button_1pqhx_405",
|
|
21
|
+
inputHasSecondActionButton: M,
|
|
22
|
+
"input--has-affix": "_input--has-affix_1pqhx_417",
|
|
23
|
+
inputHasAffix: T,
|
|
24
|
+
"input--is-ready": "_input--is-ready_1pqhx_431",
|
|
25
|
+
inputIsReady: G,
|
|
26
|
+
root: J,
|
|
27
|
+
hint: K,
|
|
28
|
+
label: Q,
|
|
29
|
+
wrapper: U,
|
|
30
|
+
"action-button": "_action-button_1pqhx_456",
|
|
31
|
+
actionButton: W,
|
|
32
|
+
"label--hidden": "_label--hidden_1pqhx_475",
|
|
33
|
+
labelHidden: X,
|
|
34
|
+
feedback: Y
|
|
35
|
+
}, Z = ({ id: n, label: s }) => {
|
|
36
|
+
if (!n)
|
|
37
|
+
throw new Error(
|
|
38
|
+
x(
|
|
39
|
+
"DSInputPassword",
|
|
40
|
+
'A unique "id" prop is required. Please add an unique "id" prop to the DSInputPassword component.'
|
|
41
|
+
)
|
|
42
|
+
);
|
|
43
|
+
if (!s)
|
|
44
|
+
throw new Error(
|
|
45
|
+
x(
|
|
46
|
+
"DSInputPassword",
|
|
47
|
+
`A label is always required for a11y reasons. Please add a descriptive "label" prop to the DSInputPassword component. If you don't want to display a label, set hideLabel={true}.`
|
|
48
|
+
)
|
|
49
|
+
);
|
|
50
|
+
}, pt = ({
|
|
51
|
+
id: n,
|
|
52
|
+
label: s,
|
|
53
|
+
autocomplete: b = "new-password",
|
|
54
|
+
className: f,
|
|
55
|
+
disabled: c = !1,
|
|
56
|
+
hidePasswordText: q = "Hide password",
|
|
57
|
+
hint: e,
|
|
58
|
+
hideLabel: w = !1,
|
|
59
|
+
invalid: o = !1,
|
|
60
|
+
readonly: r = !1,
|
|
61
|
+
required: d = !1,
|
|
62
|
+
showPasswordText: y = "Show password",
|
|
63
|
+
size: p = "medium",
|
|
64
|
+
systemFeedback: l,
|
|
65
|
+
...S
|
|
66
|
+
}) => {
|
|
67
|
+
process.env.NODE_ENV !== "production" && Z({
|
|
68
|
+
id: n,
|
|
69
|
+
label: s
|
|
70
|
+
});
|
|
71
|
+
const [u, I] = A(!1), _ = `${n}-label`, h = `${n}-feedback`, m = `${n}-hint`, v = e ? ` ${m}` : "", B = D(w), H = i(t.root, f), g = i(t.input, {
|
|
72
|
+
// small input
|
|
73
|
+
[t.inputSmall]: p === "small",
|
|
74
|
+
// invalid state
|
|
75
|
+
[t.inputInvalid]: o,
|
|
76
|
+
// action button - input password always has an action button
|
|
77
|
+
[t.inputHasActionButton]: !0
|
|
78
|
+
}), P = i(t.label, {
|
|
79
|
+
// hide label only visually to keep them available for assistive technologies
|
|
80
|
+
[t.labelHidden]: B
|
|
81
|
+
}), N = i(t.actionButton, {
|
|
82
|
+
[t.actionButtonSmall]: p === "small"
|
|
83
|
+
}), j = () => {
|
|
84
|
+
I((k) => !k);
|
|
85
|
+
};
|
|
86
|
+
return /* @__PURE__ */ a.jsxs("div", { className: H, children: [
|
|
87
|
+
/* @__PURE__ */ a.jsxs("label", { className: P, id: _, htmlFor: n, children: [
|
|
88
|
+
s,
|
|
89
|
+
d && /* @__PURE__ */ a.jsx(C, {})
|
|
90
|
+
] }),
|
|
91
|
+
e && /* @__PURE__ */ a.jsx("div", { className: t.hint, id: m, children: e }),
|
|
92
|
+
o && l && /* @__PURE__ */ a.jsx(
|
|
93
|
+
$,
|
|
94
|
+
{
|
|
95
|
+
className: t.feedback,
|
|
96
|
+
message: l,
|
|
97
|
+
type: "invalid",
|
|
98
|
+
id: h
|
|
99
|
+
}
|
|
100
|
+
),
|
|
101
|
+
/* @__PURE__ */ a.jsxs("div", { className: t.wrapper, children: [
|
|
102
|
+
/* @__PURE__ */ a.jsx(
|
|
103
|
+
"input",
|
|
104
|
+
{
|
|
105
|
+
className: g,
|
|
106
|
+
id: n,
|
|
107
|
+
...S,
|
|
108
|
+
"aria-labelledby": `${_}${v}`,
|
|
109
|
+
"aria-describedby": o && l ? h : void 0,
|
|
110
|
+
"aria-invalid": o,
|
|
111
|
+
"aria-disabled": r,
|
|
112
|
+
readOnly: r,
|
|
113
|
+
required: d,
|
|
114
|
+
disabled: c,
|
|
115
|
+
autoComplete: b,
|
|
116
|
+
type: u ? "text" : "password"
|
|
117
|
+
}
|
|
118
|
+
),
|
|
119
|
+
/* @__PURE__ */ a.jsx(
|
|
120
|
+
L,
|
|
121
|
+
{
|
|
122
|
+
hideLabel: !0,
|
|
123
|
+
theme: "light",
|
|
124
|
+
iconName: u ? "eye-closed" : "eye",
|
|
125
|
+
variant: "ghost",
|
|
126
|
+
className: N,
|
|
127
|
+
size: p,
|
|
128
|
+
onClick: j,
|
|
129
|
+
type: "button",
|
|
130
|
+
disabled: c,
|
|
131
|
+
children: u ? q : y
|
|
132
|
+
}
|
|
133
|
+
)
|
|
134
|
+
] })
|
|
135
|
+
] });
|
|
136
|
+
};
|
|
137
|
+
export {
|
|
138
|
+
pt as D,
|
|
139
|
+
Z as v
|
|
140
|
+
};
|
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { j as e } from "./jsx-runtime.C115EyI4.js";
|
|
3
|
-
import { c
|
|
3
|
+
import { c } from "./index.CvOaL64Y.js";
|
|
4
4
|
import { useState as G, useRef as N, useEffect as w } from "react";
|
|
5
5
|
import { g as S, a as J } from "./helpers.B1JT5ShS.js";
|
|
6
6
|
import { u as K } from "./useBreakpoint.5xBNDiCf.js";
|
|
7
|
-
import { Asterisk as Q } from "../asterisk.
|
|
8
|
-
import { DSButton as D } from "../button.
|
|
9
|
-
import { DSSystemFeedback as U } from "../systemfeedback.
|
|
10
|
-
import '../assets/InputSearch.
|
|
7
|
+
import { Asterisk as Q } from "../asterisk.DDn-yX4P.js";
|
|
8
|
+
import { DSButton as D } from "../button.CkHCQg3Y.js";
|
|
9
|
+
import { DSSystemFeedback as U } from "../systemfeedback._8gatmgR.js";
|
|
10
|
+
import '../assets/InputSearch.eCRQoxjN.css';const X = "_input_8z3ht_226", Y = "_input--invalid_8z3ht_338", Z = "_input--small_8z3ht_345", tt = "_input--has-leading-icon_8z3ht_399", nt = "_input--has-action-button_8z3ht_402", et = "_input--has-second-action-button_8z3ht_405", at = "_input--has-affix_8z3ht_417", st = "_input--is-ready_8z3ht_431", ot = "_root_8z3ht_438", it = "_hint_8z3ht_446", ct = "_label_8z3ht_446", ut = "_wrapper_8z3ht_450", lt = "_action-button_8z3ht_456", rt = "_second-action-button_8z3ht_460", pt = "_label--hidden_8z3ht_479", ht = "_feedback_8z3ht_508", t = {
|
|
11
11
|
input: X,
|
|
12
|
-
"input--invalid": "_input--
|
|
12
|
+
"input--invalid": "_input--invalid_8z3ht_338",
|
|
13
13
|
inputInvalid: Y,
|
|
14
|
-
"input--small": "_input--
|
|
14
|
+
"input--small": "_input--small_8z3ht_345",
|
|
15
15
|
inputSmall: Z,
|
|
16
|
-
"input--has-leading-icon": "_input--has-leading-
|
|
16
|
+
"input--has-leading-icon": "_input--has-leading-icon_8z3ht_399",
|
|
17
17
|
inputHasLeadingIcon: tt,
|
|
18
|
-
"input--has-action-button": "_input--has-action-
|
|
18
|
+
"input--has-action-button": "_input--has-action-button_8z3ht_402",
|
|
19
19
|
inputHasActionButton: nt,
|
|
20
|
-
"input--has-second-action-button": "_input--has-second-action-
|
|
20
|
+
"input--has-second-action-button": "_input--has-second-action-button_8z3ht_405",
|
|
21
21
|
inputHasSecondActionButton: et,
|
|
22
|
-
"input--has-affix": "_input--has-
|
|
22
|
+
"input--has-affix": "_input--has-affix_8z3ht_417",
|
|
23
23
|
inputHasAffix: at,
|
|
24
|
-
"input--is-ready": "_input--is-
|
|
24
|
+
"input--is-ready": "_input--is-ready_8z3ht_431",
|
|
25
25
|
inputIsReady: st,
|
|
26
26
|
root: ot,
|
|
27
27
|
hint: it,
|
|
28
|
-
label:
|
|
29
|
-
wrapper:
|
|
30
|
-
"action-button": "_action-
|
|
28
|
+
label: ct,
|
|
29
|
+
wrapper: ut,
|
|
30
|
+
"action-button": "_action-button_8z3ht_456",
|
|
31
31
|
actionButton: lt,
|
|
32
|
-
"second-action-button": "_second-action-
|
|
33
|
-
secondActionButton:
|
|
34
|
-
"label--hidden": "_label--
|
|
35
|
-
labelHidden:
|
|
36
|
-
feedback:
|
|
37
|
-
},
|
|
32
|
+
"second-action-button": "_second-action-button_8z3ht_460",
|
|
33
|
+
secondActionButton: rt,
|
|
34
|
+
"label--hidden": "_label--hidden_8z3ht_479",
|
|
35
|
+
labelHidden: pt,
|
|
36
|
+
feedback: ht
|
|
37
|
+
}, _t = ({ id: n, label: u }) => {
|
|
38
38
|
if (!n)
|
|
39
39
|
throw new Error(
|
|
40
40
|
S(
|
|
@@ -42,22 +42,22 @@ import '../assets/InputSearch.BMRAb95l.css';const X = "_input_12zpu_226", Y = "_
|
|
|
42
42
|
'A unique "id" prop is required. Please add an unique "id" prop to the DSInputSearch component.'
|
|
43
43
|
)
|
|
44
44
|
);
|
|
45
|
-
if (!
|
|
45
|
+
if (!u)
|
|
46
46
|
throw new Error(
|
|
47
47
|
S(
|
|
48
48
|
"DSInputSearch",
|
|
49
49
|
`A label is always required for a11y reasons. Please add a descriptive "label" prop to the DSInputSearch component. If you don't want to display a label, set hideLabel={true}.`
|
|
50
50
|
)
|
|
51
51
|
);
|
|
52
|
-
},
|
|
52
|
+
}, dt = (n) => !!J(n, "form"), Bt = ({
|
|
53
53
|
id: n,
|
|
54
|
-
label:
|
|
54
|
+
label: u,
|
|
55
55
|
className: A,
|
|
56
56
|
clearButtonLabel: H = "Clear search field",
|
|
57
57
|
disabled: l = !1,
|
|
58
|
-
hint:
|
|
58
|
+
hint: d,
|
|
59
59
|
hideLabel: E = !1,
|
|
60
|
-
invalid:
|
|
60
|
+
invalid: r = !1,
|
|
61
61
|
readonly: s = !1,
|
|
62
62
|
required: I = !1,
|
|
63
63
|
size: o = "medium",
|
|
@@ -68,59 +68,59 @@ import '../assets/InputSearch.BMRAb95l.css';const X = "_input_12zpu_226", Y = "_
|
|
|
68
68
|
onChange: g,
|
|
69
69
|
...k
|
|
70
70
|
}) => {
|
|
71
|
-
process.env.NODE_ENV !== "production" &&
|
|
71
|
+
process.env.NODE_ENV !== "production" && _t({
|
|
72
72
|
id: n,
|
|
73
|
-
label:
|
|
73
|
+
label: u
|
|
74
74
|
});
|
|
75
|
-
const [
|
|
75
|
+
const [p, v] = G(b), f = N(null), h = N(null), L = K(E);
|
|
76
76
|
w(() => {
|
|
77
77
|
v(b);
|
|
78
78
|
}, [b]), w(() => {
|
|
79
|
-
f.current && !
|
|
79
|
+
f.current && !dt(f.current) && process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "test" && console.warn(
|
|
80
80
|
S(
|
|
81
81
|
"DSInputSearch",
|
|
82
82
|
`The DSInputSearch component with the id "${n}" is not within a form element. This may cause issues with form submission. Please ensure the DSInputSearch component is within a form element.`
|
|
83
83
|
)
|
|
84
84
|
);
|
|
85
85
|
}, []);
|
|
86
|
-
const z = `${n}-label`, B = `${n}-feedback`, y = `${n}-hint`, V =
|
|
86
|
+
const z = `${n}-label`, B = `${n}-feedback`, y = `${n}-hint`, V = d ? ` ${y}` : "", x = p !== "" && p !== void 0 && p !== null, O = c(t.root, A), P = c(t.input, {
|
|
87
87
|
// small input
|
|
88
88
|
[t.inputSmall]: o === "small",
|
|
89
89
|
// invalid state
|
|
90
|
-
[t.inputInvalid]:
|
|
90
|
+
[t.inputInvalid]: r,
|
|
91
91
|
// action button - input password always has an action button
|
|
92
92
|
[t.inputHasActionButton]: !0,
|
|
93
93
|
// action second action button
|
|
94
94
|
[t.inputHasSecondActionButton]: x && !s && !l
|
|
95
|
-
}), $ =
|
|
95
|
+
}), $ = c(t.label, {
|
|
96
96
|
// hide label only visually to keep them available for assistive technologies
|
|
97
97
|
[t.labelHidden]: L
|
|
98
|
-
}), R =
|
|
98
|
+
}), R = c(t.actionButton, {
|
|
99
99
|
[t.actionButtonSmall]: o === "small"
|
|
100
|
-
}), q =
|
|
100
|
+
}), q = c(t.secondActionButton, {
|
|
101
101
|
[t.secondActionButtonSmall]: o === "small"
|
|
102
102
|
}), T = (a, i) => {
|
|
103
|
-
const W = Object.getPrototypeOf(a),
|
|
103
|
+
const W = Object.getPrototypeOf(a), _ = Object.getOwnPropertyDescriptor(
|
|
104
104
|
W,
|
|
105
105
|
"value"
|
|
106
106
|
);
|
|
107
|
-
|
|
107
|
+
_ != null && _.set ? _.set.call(a, i) : a.value = i;
|
|
108
108
|
}, F = () => {
|
|
109
109
|
var i;
|
|
110
|
-
if (!
|
|
111
|
-
T(
|
|
110
|
+
if (!h.current) return;
|
|
111
|
+
T(h.current, "");
|
|
112
112
|
const a = new Event("change", { bubbles: !0 });
|
|
113
|
-
(i =
|
|
113
|
+
(i = h.current) == null || i.dispatchEvent(a);
|
|
114
114
|
}, M = (a) => {
|
|
115
115
|
v(a.target.value), g && g(a);
|
|
116
116
|
};
|
|
117
117
|
return /* @__PURE__ */ e.jsxs("div", { className: O, ref: f, children: [
|
|
118
118
|
/* @__PURE__ */ e.jsxs("label", { className: $, id: z, htmlFor: n, children: [
|
|
119
|
-
|
|
119
|
+
u,
|
|
120
120
|
I && /* @__PURE__ */ e.jsx(Q, {})
|
|
121
121
|
] }),
|
|
122
|
-
|
|
123
|
-
|
|
122
|
+
d && /* @__PURE__ */ e.jsx("div", { className: t.hint, id: y, children: d }),
|
|
123
|
+
r && m && /* @__PURE__ */ e.jsx(
|
|
124
124
|
U,
|
|
125
125
|
{
|
|
126
126
|
className: t.feedback,
|
|
@@ -135,17 +135,17 @@ import '../assets/InputSearch.BMRAb95l.css';const X = "_input_12zpu_226", Y = "_
|
|
|
135
135
|
{
|
|
136
136
|
className: P,
|
|
137
137
|
id: n,
|
|
138
|
-
ref:
|
|
138
|
+
ref: h,
|
|
139
139
|
...k,
|
|
140
140
|
"aria-labelledby": `${z}${V}`,
|
|
141
|
-
"aria-describedby":
|
|
142
|
-
"aria-invalid":
|
|
141
|
+
"aria-describedby": r && m ? B : void 0,
|
|
142
|
+
"aria-invalid": r,
|
|
143
143
|
"aria-disabled": s,
|
|
144
144
|
readOnly: s,
|
|
145
145
|
required: I,
|
|
146
146
|
disabled: l,
|
|
147
147
|
type: "search",
|
|
148
|
-
value:
|
|
148
|
+
value: p,
|
|
149
149
|
onChange: M
|
|
150
150
|
}
|
|
151
151
|
),
|
|
@@ -184,6 +184,6 @@ import '../assets/InputSearch.BMRAb95l.css';const X = "_input_12zpu_226", Y = "_
|
|
|
184
184
|
};
|
|
185
185
|
export {
|
|
186
186
|
Bt as D,
|
|
187
|
-
|
|
188
|
-
|
|
187
|
+
dt as i,
|
|
188
|
+
_t as v
|
|
189
189
|
};
|