@stihl-design-system/components 1.0.0-RC.3 → 1.0.0-RC.5
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/Klarna.svg +1 -0
- package/Mastercard.svg +2 -0
- package/PayPal.svg +2 -0
- package/Placeholder.svg +1 -0
- package/Visa.svg +2 -0
- package/arialiveregions.BvZhV6hb.js +27 -0
- package/arialiveregions.d.ts +1 -0
- package/assets/CustomReactSelect.Bsphydqt.css +1 -0
- package/assets/Fieldset.D0jHAGRL.css +1 -0
- package/assets/Icon.Duy_0R8w.css +1 -0
- package/assets/InputPassword.VCNO8ANM.css +1 -0
- package/assets/InputSearch.BMRAb95l.css +1 -0
- package/assets/InputStepper.BKjqNi-i.css +1 -0
- package/assets/Notification.Bg63cvs4.css +1 -0
- package/assets/RadioGroup.Bz3_xkZU.css +1 -0
- package/assets/Select.Bz1TImkI.css +1 -0
- package/assets/Textarea.D2h5cW_t.css +1 -0
- package/assets/Toast.BzVaebc0.css +1 -0
- package/assets/arialiveregions.GsGx2USO.css +1 -0
- package/assets/{asterisk.C-o6rbGQ.css → asterisk.JlyPArZu.css} +1 -1
- package/assets/button.BdxtFZKx.css +1 -0
- package/assets/buttonround.pR4StXA7.css +1 -0
- package/assets/checkbox.BjIn2stV.css +1 -0
- package/assets/dialog.CKwM2EBH.css +1 -0
- package/assets/floatingactionbutton.CUvMbEMf.css +1 -0
- package/assets/heading.CCbuI4X-.css +1 -0
- package/assets/input.71tOIrpp.css +1 -0
- package/assets/link.D61tKkSK.css +1 -0
- package/assets/linkstandalone.Bx8Uvo0G.css +1 -0
- package/assets/logo.C05WqGId.css +1 -0
- package/assets/optioncheckbox.BdRJHcSw.css +1 -0
- package/assets/radio.ewRpPo4W.css +1 -0
- package/assets/spinner.LuV09jaU.css +1 -0
- package/assets/switch.Ds-I_ybT.css +1 -0
- package/assets/{systemfeedback.WE3wClZ3.css → systemfeedback.BzJATHDd.css} +1 -1
- package/assets/text.B-CTuGgI.css +1 -0
- package/assets/{title.CE0Dm7PI.css → title.DlhX9K3W.css} +1 -1
- package/asterisk.Cjbk-xZi.js +8 -0
- package/button.DlFWwHuA.js +135 -0
- package/buttonround.eYOQM994.js +118 -0
- package/checkbox.DNHdo6_n.js +113 -0
- package/checkboxgroup.DqWlzAeR.js +9 -0
- package/chunks/AriaLiveRegions.utils.DzWI5KCU.js +31 -0
- package/{checkboxgroup.Cfxz9bk6.js → chunks/CheckboxGroup.DsQ6lI5a.js} +38 -31
- package/chunks/{CustomReactSelect.uzWNynay.js → CustomReactSelect.5dHi6PEO.js} +873 -917
- package/chunks/Fieldset.B1vsrHNv.js +99 -0
- package/chunks/Icon.n4XZrQ4N.js +223 -0
- package/chunks/{Input.utils.Bly6ZzLI.js → Input.utils.AKWCNkpA.js} +12 -8
- package/chunks/InputPassword.DTqI58Z4.js +140 -0
- package/chunks/InputSearch.IwQATLKh.js +189 -0
- package/chunks/InputStepper.Jew1ETB6.js +291 -0
- package/chunks/Notification.DbflCBIL.js +93 -0
- package/chunks/RadioGroup.BO4pbAJw.js +132 -0
- package/chunks/RadioGroup.module.BBZwHDjW.js +11 -0
- package/chunks/Select.COdS787F.js +191 -0
- package/chunks/Textarea.oqCrSopu.js +195 -0
- package/chunks/Toast.BLGKvAvZ.js +89 -0
- package/chunks/{circle-info-colored.DLY6BTL4.js → circle-info-colored.D2pp54gf.js} +3 -3
- package/chunks/{jsx-runtime.C-kxDJ4g.js → jsx-runtime.C115EyI4.js} +3 -7
- package/{combobox.BXHAo4Wx.js → combobox.CRlhqmuO.js} +8 -8
- package/components/AriaLiveRegions/AriaLiveRegions.d.ts +4 -0
- package/components/AriaLiveRegions/AriaLiveRegions.utils.d.ts +5 -0
- package/components/AriaLiveRegions/AriaLiveRegions.utils.test.d.ts +1 -0
- package/components/Checkbox/Checkbox.d.ts +1 -1
- package/components/CheckboxGroup/CheckboxGroup.utils.d.ts +1 -1
- package/components/Dialog/Dialog.d.ts +11 -0
- package/components/Dialog/Dialog.utils.d.ts +0 -0
- package/components/Fieldset/Fieldset.utils.d.ts +1 -1
- package/components/Notification/Notification.d.ts +26 -0
- package/components/Notification/Notification.test.d.ts +1 -0
- package/components/Notification/Notification.utils.d.ts +5 -0
- package/components/Radio/Radio.d.ts +11 -3
- package/components/RadioGroup/RadioGroup.d.ts +6 -3
- package/components/RadioGroup/RadioGroup.utils.d.ts +5 -3
- package/components/RadioGroup/RadioGroup.utils.test.d.ts +1 -0
- package/components/Toast/Toast.d.ts +21 -0
- package/components/Toast/Toast.utils.d.ts +9 -0
- package/components/Toast/ToastManager.d.ts +6 -0
- package/components/Toast/ToastManager.test.d.ts +1 -0
- package/components/Toast/ToastManager.utils.d.ts +2 -0
- package/components/Toast/ToastManager.utils.test.d.ts +1 -0
- package/customreactselect.CD58gwtp.js +13 -0
- package/dialog.d.ts +1 -0
- package/dialog.qd2pOyVc.js +45 -0
- package/fieldset.aY3V2jK2.js +11 -0
- package/floatingactionbutton.CGV3YFQq.js +87 -0
- package/heading.BTNroD1E.js +50 -0
- package/icon.D3RXjzh4.js +8 -0
- package/index.d.ts +24 -0
- package/index.es.js +140 -45
- package/input.BAxvG272.js +236 -0
- package/inputpassword.mn9qFlfs.js +12 -0
- package/inputsearch.qQJj9yFd.js +13 -0
- package/inputstepper.DhbHujiM.js +13 -0
- package/link.SAcKvzJ3.js +115 -0
- package/linkstandalone.DNe0Nydm.js +79 -0
- package/{logo.C_oJ8isW.js → logo.BR_CUXFl.js} +16 -16
- package/notification.CnJOdQza.js +9 -0
- package/notification.d.ts +1 -0
- package/{optioncheckbox.-DRnW_ch.js → optioncheckbox.C4l2UIak.js} +9 -9
- package/package.json +30 -26
- package/partials/index.js +51 -79
- package/radio.epf54-sG.js +115 -0
- package/radiogroup.CiENWRos.js +11 -0
- package/select.DLYav8gw.js +12 -0
- package/spinner.DEtbkdfi.js +58 -0
- package/styles/scss/_index.scss +1 -0
- package/styles/scss/lib/_animation.scss +20 -5
- package/styles/scss/lib/_container-query.scss +3 -3
- package/styles/scss/lib/_grid-sidebar-sidebar.scss +2 -0
- package/styles/scss/lib/_grid-sidebar.scss +14 -7
- package/styles/scss/lib/_link.scss +48 -41
- package/styles/scss/lib/_media-query.scss +3 -3
- package/styles/scss/lib/_shadow.scss +10 -0
- package/styles/scss/lib/_theme.scss +7 -5
- package/styles/scss/lib/_transition.scss +26 -7
- package/switch.BezS5z0Y.js +65 -0
- package/{systemfeedback.C7iXO5A1.js → systemfeedback.CUWch42u.js} +3 -3
- package/text.CrYUewrP.js +57 -0
- package/textarea.hLgeYdsI.js +12 -0
- package/title.Dvp8LKJt.js +36 -0
- package/toast.BR7QuHOG.js +10 -0
- package/toast.d.ts +1 -0
- package/toastmanager.DBp8B1e3.js +96 -0
- package/toastmanager.d.ts +1 -0
- package/utils/index.d.ts +1 -0
- package/utils/remove-spaces.d.ts +6 -0
- package/utils/remove-spaces.test.d.ts +1 -0
- package/utils/vitest.setup.d.ts +2 -0
- package/assets/CustomReactSelect.BdwXfLLO.css +0 -1
- package/assets/RadioGroup.Ur8Ro-XL.css +0 -1
- package/assets/button.DJvR-58w.css +0 -1
- package/assets/buttonround.BlfQkmMV.css +0 -1
- package/assets/checkbox.BsFEWfQe.css +0 -1
- package/assets/fieldset.xazpUXJX.css +0 -1
- package/assets/floatingactionbutton.D7ywURL3.css +0 -1
- package/assets/heading.CGFucb-C.css +0 -1
- package/assets/icon.CB-KQmw4.css +0 -1
- package/assets/input.BcP5kkZ2.css +0 -1
- package/assets/inputpassword.C3Uyj7oA.css +0 -1
- package/assets/inputsearch.tL3e9-Ob.css +0 -1
- package/assets/inputstepper.paPJix5A.css +0 -1
- package/assets/link.V7pJOW1p.css +0 -1
- package/assets/linkstandalone.D3RbBp23.css +0 -1
- package/assets/logo.BbHYgnWo.css +0 -1
- package/assets/optioncheckbox.C-K1FLhc.css +0 -1
- package/assets/radio.CSHQGdpr.css +0 -1
- package/assets/select.D2qBxaHP.css +0 -1
- package/assets/spinner.C5rBmKiF.css +0 -1
- package/assets/switch.sqve8ApJ.css +0 -1
- package/assets/text.DDAveG7E.css +0 -1
- package/assets/textarea.BKbocznb.css +0 -1
- package/asterisk.DU8THnoC.js +0 -8
- package/button.BUUGRxIp.js +0 -135
- package/buttonround.CKc-a-hd.js +0 -118
- package/checkbox.C2Ga9yTK.js +0 -112
- package/chunks/RadioGroup.module.bi3leRes.js +0 -11
- package/customreactselect.CipgVXTR.js +0 -13
- package/fieldset.DGcIKzDI.js +0 -98
- package/floatingactionbutton.DzHD39NY.js +0 -87
- package/heading.DqGbFfj2.js +0 -50
- package/icon.PX9_1kNB.js +0 -215
- package/input.o8OT6rxJ.js +0 -236
- package/inputpassword.-MXq8baU.js +0 -139
- package/inputsearch.CoYTSjox.js +0 -188
- package/inputstepper.BBMQr6kM.js +0 -290
- package/link.BN6AZfhG.js +0 -115
- package/linkstandalone.4-fyRd08.js +0 -79
- package/radio.Bhu9OUY-.js +0 -79
- package/radiogroup.oILRMrX-.js +0 -102
- package/select.OGcreXnT.js +0 -190
- package/spinner.Diy_EeFY.js +0 -58
- package/switch.BjoFKMQC.js +0 -65
- package/text.CPU8IUqY.js +0 -57
- package/textarea.kc_Sfbgr.js +0 -193
- package/title.icX0VDiO.js +0 -36
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import '../assets/RadioGroup.Bz3_xkZU.css';const o = "_group_2f5rk_76", r = "_group--horizontal_2f5rk_84", n = "_group--invalid_2f5rk_87", _ = {
|
|
3
|
+
group: o,
|
|
4
|
+
"group--horizontal": "_group--horizontal_2f5rk_84",
|
|
5
|
+
groupHorizontal: r,
|
|
6
|
+
"group--invalid": "_group--invalid_2f5rk_87",
|
|
7
|
+
groupInvalid: n
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
_ as s
|
|
11
|
+
};
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { j as n } from "./jsx-runtime.C115EyI4.js";
|
|
3
|
+
import { c as _ } from "./index.CvOaL64Y.js";
|
|
4
|
+
import { useRef as C, useState as q, useEffect as W } from "react";
|
|
5
|
+
import { u as F } from "./useBreakpoint.5xBNDiCf.js";
|
|
6
|
+
import { Asterisk as M } from "../asterisk.Cjbk-xZi.js";
|
|
7
|
+
import { D as O } from "./Icon.n4XZrQ4N.js";
|
|
8
|
+
import { DSSystemFeedback as T } from "../systemfeedback.CUWch42u.js";
|
|
9
|
+
import { g as u } from "./helpers.B1JT5ShS.js";
|
|
10
|
+
import '../assets/Select.Bz1TImkI.css';const V = "_root_omrno_226", Z = "_hint_omrno_234", J = "_label_omrno_234", K = "_wrapper_omrno_238", Q = "_affix_omrno_244", U = "_affix--small_omrno_264", X = "_affix--disabled_omrno_276", Y = "_prefix_omrno_279", z = "_affix--readonly_omrno_282", G = "_suffix_omrno_292", ee = "_action-button_omrno_299", oe = "_label--hidden_omrno_316", ne = "_feedback_omrno_343", te = "_select-wrapper_omrno_348", se = "_select_omrno_348", ae = "_select--invalid_omrno_464", le = "_select--small_omrno_471", ce = "_input--has-leading-icon_omrno_523", re = "_input--has-action-button_omrno_526", ie = "_input--has-second-action-button_omrno_529", _e = "_select--has-leading-icon_omrno_532", de = "_select--has-action-button_omrno_535", me = "_select--has-second-action-button_omrno_538", fe = "_select--has-affix_omrno_541", ue = "_select--is-ready_omrno_555", he = "_select--placeholder_omrno_572", pe = "_chevron_omrno_581", be = "_chevron--small_omrno_585", xe = "_chevron--disabled_omrno_588", e = {
|
|
11
|
+
root: V,
|
|
12
|
+
hint: Z,
|
|
13
|
+
label: J,
|
|
14
|
+
wrapper: K,
|
|
15
|
+
affix: Q,
|
|
16
|
+
"affix--small": "_affix--small_omrno_264",
|
|
17
|
+
affixSmall: U,
|
|
18
|
+
"affix--disabled": "_affix--disabled_omrno_276",
|
|
19
|
+
affixDisabled: X,
|
|
20
|
+
prefix: Y,
|
|
21
|
+
"affix--readonly": "_affix--readonly_omrno_282",
|
|
22
|
+
affixReadonly: z,
|
|
23
|
+
suffix: G,
|
|
24
|
+
"action-button": "_action-button_omrno_299",
|
|
25
|
+
actionButton: ee,
|
|
26
|
+
"label--hidden": "_label--hidden_omrno_316",
|
|
27
|
+
labelHidden: oe,
|
|
28
|
+
feedback: ne,
|
|
29
|
+
"select-wrapper": "_select-wrapper_omrno_348",
|
|
30
|
+
selectWrapper: te,
|
|
31
|
+
select: se,
|
|
32
|
+
"select--invalid": "_select--invalid_omrno_464",
|
|
33
|
+
selectInvalid: ae,
|
|
34
|
+
"select--small": "_select--small_omrno_471",
|
|
35
|
+
selectSmall: le,
|
|
36
|
+
"input--has-leading-icon": "_input--has-leading-icon_omrno_523",
|
|
37
|
+
inputHasLeadingIcon: ce,
|
|
38
|
+
"input--has-action-button": "_input--has-action-button_omrno_526",
|
|
39
|
+
inputHasActionButton: re,
|
|
40
|
+
"input--has-second-action-button": "_input--has-second-action-button_omrno_529",
|
|
41
|
+
inputHasSecondActionButton: ie,
|
|
42
|
+
"select--has-leading-icon": "_select--has-leading-icon_omrno_532",
|
|
43
|
+
selectHasLeadingIcon: _e,
|
|
44
|
+
"select--has-action-button": "_select--has-action-button_omrno_535",
|
|
45
|
+
selectHasActionButton: de,
|
|
46
|
+
"select--has-second-action-button": "_select--has-second-action-button_omrno_538",
|
|
47
|
+
selectHasSecondActionButton: me,
|
|
48
|
+
"select--has-affix": "_select--has-affix_omrno_541",
|
|
49
|
+
selectHasAffix: fe,
|
|
50
|
+
"select--is-ready": "_select--is-ready_omrno_555",
|
|
51
|
+
selectIsReady: ue,
|
|
52
|
+
"select--placeholder": "_select--placeholder_omrno_572",
|
|
53
|
+
selectPlaceholder: he,
|
|
54
|
+
chevron: pe,
|
|
55
|
+
"chevron--small": "_chevron--small_omrno_585",
|
|
56
|
+
chevronSmall: be,
|
|
57
|
+
"chevron--disabled": "_chevron--disabled_omrno_588",
|
|
58
|
+
chevronDisabled: xe
|
|
59
|
+
}, Be = ["medium", "small"], ve = ({
|
|
60
|
+
id: o,
|
|
61
|
+
label: a,
|
|
62
|
+
options: s
|
|
63
|
+
}) => {
|
|
64
|
+
if (!o)
|
|
65
|
+
throw new Error(
|
|
66
|
+
u(
|
|
67
|
+
"DSSelect",
|
|
68
|
+
'A unique "id" prop is required. Please add an unique "id" prop to the DSSelect component.'
|
|
69
|
+
)
|
|
70
|
+
);
|
|
71
|
+
if (!a)
|
|
72
|
+
throw new Error(
|
|
73
|
+
u(
|
|
74
|
+
"DSSelect",
|
|
75
|
+
`A label is always required for a11y reasons. Please add a descriptive "label" prop to the DSSelect component. If you don't want to display a label, set hideLabel={true}.`
|
|
76
|
+
)
|
|
77
|
+
);
|
|
78
|
+
if (!s || s.length === 0)
|
|
79
|
+
throw new Error(
|
|
80
|
+
u(
|
|
81
|
+
"DSSelect",
|
|
82
|
+
'Options are always required. Please add an "options" prop to the DSSelect component.'
|
|
83
|
+
)
|
|
84
|
+
);
|
|
85
|
+
}, Se = (o, a, s) => o === "" || a !== void 0 && a !== "" ? !1 : !(s !== void 0 && s !== ""), Ee = ({
|
|
86
|
+
id: o,
|
|
87
|
+
label: a,
|
|
88
|
+
options: s,
|
|
89
|
+
className: H,
|
|
90
|
+
defaultValue: h,
|
|
91
|
+
disabled: p = !1,
|
|
92
|
+
hideLabel: I = !1,
|
|
93
|
+
hint: d,
|
|
94
|
+
invalid: i = !1,
|
|
95
|
+
placeholder: m = "Select",
|
|
96
|
+
required: b = !1,
|
|
97
|
+
size: x = "medium",
|
|
98
|
+
systemFeedback: f,
|
|
99
|
+
value: v,
|
|
100
|
+
...w
|
|
101
|
+
}) => {
|
|
102
|
+
process.env.NODE_ENV !== "production" && ve({
|
|
103
|
+
id: o,
|
|
104
|
+
label: a,
|
|
105
|
+
options: s
|
|
106
|
+
});
|
|
107
|
+
const r = C(null), [j, A] = q(
|
|
108
|
+
Se(m, h, v)
|
|
109
|
+
);
|
|
110
|
+
W(() => {
|
|
111
|
+
if (!r.current) return;
|
|
112
|
+
const l = () => {
|
|
113
|
+
if (!r.current) return;
|
|
114
|
+
const c = r.current.value;
|
|
115
|
+
A(c === "");
|
|
116
|
+
}, t = r.current;
|
|
117
|
+
return t.addEventListener("change", l), () => {
|
|
118
|
+
t.removeEventListener("change", l);
|
|
119
|
+
};
|
|
120
|
+
}, []);
|
|
121
|
+
const B = F(I), S = `${o}-label`, g = `${o}-feedback`, y = `${o}-hint`, E = d ? ` ${y}` : "", L = (l) => [
|
|
122
|
+
m && /* @__PURE__ */ n.jsx("option", { value: "", children: m }, `${o}-hidden-option-disabled-placeholder`),
|
|
123
|
+
...l.map((t) => {
|
|
124
|
+
if ("options" in t) {
|
|
125
|
+
const { label: c, options: $ } = t;
|
|
126
|
+
return /* @__PURE__ */ n.jsx("optgroup", { label: c, children: $.map(D) }, c);
|
|
127
|
+
} else
|
|
128
|
+
return D(t);
|
|
129
|
+
})
|
|
130
|
+
], D = ({ label: l, value: t, isDisabled: c }) => /* @__PURE__ */ n.jsx("option", { value: t, disabled: c, children: l }, t), N = _(e.root, H), P = _(e.select, {
|
|
131
|
+
[e.selectSmall]: x === "small",
|
|
132
|
+
[e.selectInvalid]: i,
|
|
133
|
+
[e.selectPlaceholder]: j
|
|
134
|
+
}), k = _(e.label, {
|
|
135
|
+
// hide label only visually to keep them available for assistive technologies
|
|
136
|
+
[e.labelHidden]: B
|
|
137
|
+
}), R = _(e.chevron, {
|
|
138
|
+
[e.chevronSmall]: x === "small",
|
|
139
|
+
[e.chevronDisabled]: p
|
|
140
|
+
});
|
|
141
|
+
return /* @__PURE__ */ n.jsxs("div", { className: N, children: [
|
|
142
|
+
/* @__PURE__ */ n.jsxs("label", { className: k, id: S, htmlFor: o, children: [
|
|
143
|
+
a,
|
|
144
|
+
b && /* @__PURE__ */ n.jsx(M, {})
|
|
145
|
+
] }),
|
|
146
|
+
d && /* @__PURE__ */ n.jsx("div", { className: e.hint, id: y, children: d }),
|
|
147
|
+
i && f && /* @__PURE__ */ n.jsx(
|
|
148
|
+
T,
|
|
149
|
+
{
|
|
150
|
+
className: e.feedback,
|
|
151
|
+
message: f,
|
|
152
|
+
type: "invalid",
|
|
153
|
+
id: g,
|
|
154
|
+
"aria-live": "assertive"
|
|
155
|
+
}
|
|
156
|
+
),
|
|
157
|
+
/* @__PURE__ */ n.jsxs("div", { className: e.selectWrapper, children: [
|
|
158
|
+
/* @__PURE__ */ n.jsx(
|
|
159
|
+
"select",
|
|
160
|
+
{
|
|
161
|
+
...w,
|
|
162
|
+
id: o,
|
|
163
|
+
ref: r,
|
|
164
|
+
className: P,
|
|
165
|
+
"aria-labelledby": `${S}${E}`,
|
|
166
|
+
"aria-describedby": i && f ? g : void 0,
|
|
167
|
+
"aria-invalid": i,
|
|
168
|
+
defaultValue: h,
|
|
169
|
+
value: v,
|
|
170
|
+
disabled: p,
|
|
171
|
+
required: b,
|
|
172
|
+
children: L(s)
|
|
173
|
+
}
|
|
174
|
+
),
|
|
175
|
+
/* @__PURE__ */ n.jsx(
|
|
176
|
+
O,
|
|
177
|
+
{
|
|
178
|
+
name: "chevron-down",
|
|
179
|
+
className: R,
|
|
180
|
+
"aria-hidden": "true"
|
|
181
|
+
}
|
|
182
|
+
)
|
|
183
|
+
] })
|
|
184
|
+
] });
|
|
185
|
+
};
|
|
186
|
+
export {
|
|
187
|
+
Ee as D,
|
|
188
|
+
Be as S,
|
|
189
|
+
Se as g,
|
|
190
|
+
ve as v
|
|
191
|
+
};
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { j as n } from "./jsx-runtime.C115EyI4.js";
|
|
3
|
+
import { c as g } from "./index.CvOaL64Y.js";
|
|
4
|
+
import { useState as c, useRef as oe, useEffect as q } from "react";
|
|
5
|
+
import { u as se, h as ie } from "./useBreakpoint.5xBNDiCf.js";
|
|
6
|
+
import { g as k, p as H } from "./helpers.B1JT5ShS.js";
|
|
7
|
+
import { Asterisk as re } from "../asterisk.Cjbk-xZi.js";
|
|
8
|
+
import { DSSystemFeedback as le } from "../systemfeedback.CUWch42u.js";
|
|
9
|
+
import '../assets/Textarea.D2h5cW_t.css';const ce = "_textarea_q1qm9_226", de = "_textarea--invalid_q1qm9_336", _e = "_textarea--small_q1qm9_343", ue = "_textarea--resize-auto_q1qm9_361", fe = "_root_q1qm9_371", me = "_hint_q1qm9_379", qe = "_label_q1qm9_379", xe = "_affix_q1qm9_383", be = "_affix--small_q1qm9_403", he = "_affix--disabled_q1qm9_415", pe = "_prefix_q1qm9_418", ve = "_affix--readonly_q1qm9_421", ge = "_suffix_q1qm9_431", Se = "_leading-icon_q1qm9_438", Ie = "_leading-icon--small_q1qm9_450", Ce = "_leading-icon--disabled_q1qm9_453", ye = "_action-button_q1qm9_462", Ae = "_label--hidden_q1qm9_479", De = "_feedback_q1qm9_506", je = "_char-count_q1qm9_511", we = "_char-count-announcer_q1qm9_526", t = {
|
|
10
|
+
textarea: ce,
|
|
11
|
+
"textarea--invalid": "_textarea--invalid_q1qm9_336",
|
|
12
|
+
textareaInvalid: de,
|
|
13
|
+
"textarea--small": "_textarea--small_q1qm9_343",
|
|
14
|
+
textareaSmall: _e,
|
|
15
|
+
"textarea--resize-auto": "_textarea--resize-auto_q1qm9_361",
|
|
16
|
+
textareaResizeAuto: ue,
|
|
17
|
+
root: fe,
|
|
18
|
+
hint: me,
|
|
19
|
+
label: qe,
|
|
20
|
+
affix: xe,
|
|
21
|
+
"affix--small": "_affix--small_q1qm9_403",
|
|
22
|
+
affixSmall: be,
|
|
23
|
+
"affix--disabled": "_affix--disabled_q1qm9_415",
|
|
24
|
+
affixDisabled: he,
|
|
25
|
+
prefix: pe,
|
|
26
|
+
"affix--readonly": "_affix--readonly_q1qm9_421",
|
|
27
|
+
affixReadonly: ve,
|
|
28
|
+
suffix: ge,
|
|
29
|
+
"leading-icon": "_leading-icon_q1qm9_438",
|
|
30
|
+
leadingIcon: Se,
|
|
31
|
+
"leading-icon--small": "_leading-icon--small_q1qm9_450",
|
|
32
|
+
leadingIconSmall: Ie,
|
|
33
|
+
"leading-icon--disabled": "_leading-icon--disabled_q1qm9_453",
|
|
34
|
+
leadingIconDisabled: Ce,
|
|
35
|
+
"action-button": "_action-button_q1qm9_462",
|
|
36
|
+
actionButton: ye,
|
|
37
|
+
"label--hidden": "_label--hidden_q1qm9_479",
|
|
38
|
+
labelHidden: Ae,
|
|
39
|
+
feedback: De,
|
|
40
|
+
"char-count": "_char-count_q1qm9_511",
|
|
41
|
+
charCount: je,
|
|
42
|
+
"char-count-announcer": "_char-count-announcer_q1qm9_526",
|
|
43
|
+
charCountAnnouncer: we
|
|
44
|
+
}, Ve = ["medium", "small"], Re = ({ id: o, label: _ }) => {
|
|
45
|
+
if (!o)
|
|
46
|
+
throw new Error(
|
|
47
|
+
k(
|
|
48
|
+
"DSTextarea",
|
|
49
|
+
'A unique "id" prop is required. Please add an unique "id" prop to the DSTextarea component.'
|
|
50
|
+
)
|
|
51
|
+
);
|
|
52
|
+
if (!_)
|
|
53
|
+
throw new Error(
|
|
54
|
+
k(
|
|
55
|
+
"DSTextarea",
|
|
56
|
+
`A label is always required for a11y reasons. Please add a descriptive "label" prop to the DSTextarea component. If you don't want to display a label, set hideLabel={true}.`
|
|
57
|
+
)
|
|
58
|
+
);
|
|
59
|
+
}, ze = ({
|
|
60
|
+
id: o,
|
|
61
|
+
label: _,
|
|
62
|
+
charsLimitText: V = "Character limit reached",
|
|
63
|
+
charsRemainingText: z = "Characters remaining:",
|
|
64
|
+
className: P,
|
|
65
|
+
defaultValue: M,
|
|
66
|
+
disabled: O = !1,
|
|
67
|
+
hint: x,
|
|
68
|
+
hideLabel: F = !1,
|
|
69
|
+
invalid: s = !1,
|
|
70
|
+
maxLength: e,
|
|
71
|
+
readonly: S = !1,
|
|
72
|
+
required: I = !1,
|
|
73
|
+
resize: u = "vertical",
|
|
74
|
+
size: W = "medium",
|
|
75
|
+
systemFeedback: r,
|
|
76
|
+
value: b,
|
|
77
|
+
wrapperClassName: X,
|
|
78
|
+
onChange: C,
|
|
79
|
+
onInput: y,
|
|
80
|
+
...Z
|
|
81
|
+
}) => {
|
|
82
|
+
process.env.NODE_ENV !== "production" && Re({
|
|
83
|
+
id: o,
|
|
84
|
+
label: _
|
|
85
|
+
});
|
|
86
|
+
const [G, A] = c(M || ""), [l, D] = c(0), [J, j] = c(0), [K, w] = c("off"), [R, h] = c(r), [p, v] = c(s), T = b !== void 0, f = T ? b : G, i = oe(null), Q = se(F);
|
|
87
|
+
q(() => {
|
|
88
|
+
if (!e || e <= 0)
|
|
89
|
+
return;
|
|
90
|
+
l >= e * 0.8 ? w("polite") : w("off");
|
|
91
|
+
const a = setTimeout(() => {
|
|
92
|
+
j(e - l || 0);
|
|
93
|
+
}, 1e3);
|
|
94
|
+
return () => clearTimeout(a);
|
|
95
|
+
}, [l]), q(() => {
|
|
96
|
+
A(f || ""), d(), e && e > 0 && (D(f.toString().length || 0), j(e - f.toString().length || 0));
|
|
97
|
+
}, [b]), q(() => {
|
|
98
|
+
s && r ? (h(r), v(s)) : !s && e && e >= 0 && l >= e ? (v(!0), h(V)) : (h(r), v(s));
|
|
99
|
+
}, [s, p, r, l]), q(() => {
|
|
100
|
+
if (ie && u === "auto")
|
|
101
|
+
return d(), window.addEventListener("resize", d), () => window.removeEventListener("resize", d);
|
|
102
|
+
}, [u, i.current]);
|
|
103
|
+
const U = g(t.root, X), Y = g(t.textarea, P, {
|
|
104
|
+
// small textarea
|
|
105
|
+
[t.textareaSmall]: W === "small",
|
|
106
|
+
// invalid state
|
|
107
|
+
[t.textareaInvalid]: p,
|
|
108
|
+
// resize handling
|
|
109
|
+
[t.textareaResizeAuto]: u === "auto"
|
|
110
|
+
}), L = g(t.label, {
|
|
111
|
+
// hide label only visually to keep them available for assistive technologies
|
|
112
|
+
[t.labelHidden]: Q
|
|
113
|
+
}), E = `${o}-label`, N = `${o}-feedback`, B = `${o}-hint`, $ = `${o}-char-count-announcer`, ee = x ? ` ${B}` : "", d = () => {
|
|
114
|
+
if (i.current && u === "auto") {
|
|
115
|
+
i.current.style.height = "auto";
|
|
116
|
+
const a = H(i.current.scrollHeight), m = H(2);
|
|
117
|
+
i.current.style.height = `${// We need to add 2px (border-top & border-bottom) to the scrollHeight to prevent the textarea
|
|
118
|
+
// from jumping as soon as the user starts typing.
|
|
119
|
+
a + m}rem`;
|
|
120
|
+
}
|
|
121
|
+
}, ae = () => {
|
|
122
|
+
const a = [];
|
|
123
|
+
return e && e > 0 && a.push($), s && r && a.push(N), a.length > 0 ? a.join(" ") : void 0;
|
|
124
|
+
}, te = (a) => {
|
|
125
|
+
var m;
|
|
126
|
+
y && y(a), e && e > 0 && D(((m = i.current) == null ? void 0 : m.value.length) || 0), d();
|
|
127
|
+
}, ne = (a) => {
|
|
128
|
+
C && C(a), T || A(a.target.value);
|
|
129
|
+
};
|
|
130
|
+
return /* @__PURE__ */ n.jsxs("div", { className: U, children: [
|
|
131
|
+
/* @__PURE__ */ n.jsxs("label", { className: L, id: E, htmlFor: o, children: [
|
|
132
|
+
_,
|
|
133
|
+
I && /* @__PURE__ */ n.jsx(re, {})
|
|
134
|
+
] }),
|
|
135
|
+
x && /* @__PURE__ */ n.jsx("div", { className: t.hint, id: B, children: x }),
|
|
136
|
+
p && R && /* @__PURE__ */ n.jsx(
|
|
137
|
+
le,
|
|
138
|
+
{
|
|
139
|
+
className: t.feedback,
|
|
140
|
+
message: R,
|
|
141
|
+
type: "invalid",
|
|
142
|
+
id: N
|
|
143
|
+
}
|
|
144
|
+
),
|
|
145
|
+
/* @__PURE__ */ n.jsx(
|
|
146
|
+
"textarea",
|
|
147
|
+
{
|
|
148
|
+
className: Y,
|
|
149
|
+
id: o,
|
|
150
|
+
ref: i,
|
|
151
|
+
...Z,
|
|
152
|
+
"aria-labelledby": `${E}${ee}`,
|
|
153
|
+
"aria-describedby": ae(),
|
|
154
|
+
"aria-invalid": s,
|
|
155
|
+
"aria-disabled": S,
|
|
156
|
+
maxLength: e,
|
|
157
|
+
readOnly: S,
|
|
158
|
+
required: I,
|
|
159
|
+
disabled: O,
|
|
160
|
+
value: f,
|
|
161
|
+
defaultValue: void 0,
|
|
162
|
+
rows: void 0,
|
|
163
|
+
cols: void 0,
|
|
164
|
+
onChange: ne,
|
|
165
|
+
onInput: te
|
|
166
|
+
}
|
|
167
|
+
),
|
|
168
|
+
e !== void 0 && e > 0 && /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
169
|
+
/* @__PURE__ */ n.jsxs("div", { className: t.charCount, "aria-hidden": "true", children: [
|
|
170
|
+
l,
|
|
171
|
+
"/",
|
|
172
|
+
e
|
|
173
|
+
] }),
|
|
174
|
+
/* @__PURE__ */ n.jsxs(
|
|
175
|
+
"div",
|
|
176
|
+
{
|
|
177
|
+
className: t.charCountAnnouncer,
|
|
178
|
+
id: $,
|
|
179
|
+
"aria-live": K,
|
|
180
|
+
"aria-atomic": "true",
|
|
181
|
+
children: [
|
|
182
|
+
z,
|
|
183
|
+
" ",
|
|
184
|
+
J
|
|
185
|
+
]
|
|
186
|
+
}
|
|
187
|
+
)
|
|
188
|
+
] })
|
|
189
|
+
] });
|
|
190
|
+
};
|
|
191
|
+
export {
|
|
192
|
+
ze as D,
|
|
193
|
+
Ve as T,
|
|
194
|
+
Re as v
|
|
195
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { j as n } from "./jsx-runtime.C115EyI4.js";
|
|
3
|
+
import { c } from "./index.CvOaL64Y.js";
|
|
4
|
+
import { forwardRef as u } from "react";
|
|
5
|
+
import { DSButton as g } from "../button.DlFWwHuA.js";
|
|
6
|
+
import { D as h } from "./Icon.n4XZrQ4N.js";
|
|
7
|
+
import '../assets/Toast.BzVaebc0.css';const p = "_root_127fr_80", x = "_root--closing_127fr_89", I = "_fade-out_127fr_1", S = "_move-in_127fr_1", N = "_root--success_127fr_124", j = "_root--info_127fr_128", v = "_root--warning_127fr_132", w = "_content_127fr_137", C = "_content--hide-icon_127fr_144", D = "_icon_127fr_148", O = "_message_127fr_152", o = {
|
|
8
|
+
root: p,
|
|
9
|
+
"root--closing": "_root--closing_127fr_89",
|
|
10
|
+
rootClosing: x,
|
|
11
|
+
"fade-out": "_fade-out_127fr_1",
|
|
12
|
+
fadeOut: I,
|
|
13
|
+
"move-in": "_move-in_127fr_1",
|
|
14
|
+
moveIn: S,
|
|
15
|
+
"root--success": "_root--success_127fr_124",
|
|
16
|
+
rootSuccess: N,
|
|
17
|
+
"root--info": "_root--info_127fr_128",
|
|
18
|
+
rootInfo: j,
|
|
19
|
+
"root--warning": "_root--warning_127fr_132",
|
|
20
|
+
rootWarning: v,
|
|
21
|
+
content: w,
|
|
22
|
+
"content--hide-icon": "_content--hide-icon_127fr_144",
|
|
23
|
+
contentHideIcon: C,
|
|
24
|
+
icon: D,
|
|
25
|
+
message: O
|
|
26
|
+
}, T = {
|
|
27
|
+
success: "circle-check-colored",
|
|
28
|
+
warning: "triangle-exclamationmark-colored",
|
|
29
|
+
info: "circle-info-colored"
|
|
30
|
+
}, H = u(
|
|
31
|
+
({
|
|
32
|
+
message: s,
|
|
33
|
+
className: e,
|
|
34
|
+
hideIcon: r = !1,
|
|
35
|
+
variant: t = "info",
|
|
36
|
+
onClick: i,
|
|
37
|
+
onMouseEnter: a,
|
|
38
|
+
onMouseLeave: _,
|
|
39
|
+
...f
|
|
40
|
+
}, l) => {
|
|
41
|
+
const m = c(o.root, e, {
|
|
42
|
+
[o.rootSuccess]: t === "success",
|
|
43
|
+
[o.rootWarning]: t === "warning",
|
|
44
|
+
[o.rootInfo]: t === "info"
|
|
45
|
+
}), d = c(o.content, {
|
|
46
|
+
[o.contentHideIcon]: r
|
|
47
|
+
});
|
|
48
|
+
return /* @__PURE__ */ n.jsx(
|
|
49
|
+
"aside",
|
|
50
|
+
{
|
|
51
|
+
className: m,
|
|
52
|
+
ref: l,
|
|
53
|
+
popover: "manual",
|
|
54
|
+
"data-ds-toast": !0,
|
|
55
|
+
onMouseEnter: a,
|
|
56
|
+
onMouseLeave: _,
|
|
57
|
+
"aria-label": s,
|
|
58
|
+
...f,
|
|
59
|
+
children: /* @__PURE__ */ n.jsxs("div", { className: d, children: [
|
|
60
|
+
!r && /* @__PURE__ */ n.jsx(
|
|
61
|
+
h,
|
|
62
|
+
{
|
|
63
|
+
name: T[t],
|
|
64
|
+
className: o.icon,
|
|
65
|
+
"aria-hidden": "true"
|
|
66
|
+
}
|
|
67
|
+
),
|
|
68
|
+
/* @__PURE__ */ n.jsx("div", { className: o.message, children: s }),
|
|
69
|
+
/* @__PURE__ */ n.jsx(
|
|
70
|
+
g,
|
|
71
|
+
{
|
|
72
|
+
hideLabel: !0,
|
|
73
|
+
iconName: "cross",
|
|
74
|
+
size: "small",
|
|
75
|
+
variant: "ghost",
|
|
76
|
+
onClick: i,
|
|
77
|
+
children: "Close toast"
|
|
78
|
+
}
|
|
79
|
+
)
|
|
80
|
+
] })
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
);
|
|
85
|
+
H.displayName = "DSToast";
|
|
86
|
+
export {
|
|
87
|
+
H as D,
|
|
88
|
+
o as s
|
|
89
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import * as e from "react";
|
|
3
|
-
const
|
|
3
|
+
const n = ({
|
|
4
4
|
title: l,
|
|
5
5
|
titleId: t,
|
|
6
6
|
...a
|
|
7
|
-
}) => /* @__PURE__ */ e.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", focusable: "false", width: "100%", height: "100%", "aria-labelledby": t, ...a }, l ? /* @__PURE__ */ e.createElement("title", { id: t }, l) : null, /* @__PURE__ */ e.createElement("path", { fill: "#666", fillRule: "evenodd", d: "M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0
|
|
7
|
+
}) => /* @__PURE__ */ e.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", focusable: "false", width: "100%", height: "100%", "aria-labelledby": t, ...a }, l ? /* @__PURE__ */ e.createElement("title", { id: t }, l) : null, /* @__PURE__ */ e.createElement("path", { fill: "#666", fillRule: "evenodd", d: "M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16", clipRule: "evenodd" }), /* @__PURE__ */ e.createElement("path", { fill: "#fff", d: "M6.575 3.35C6.575 2.6 7.175 2 8 2s1.425.6 1.425 1.35c0 .825-.6 1.425-1.425 1.425A1.424 1.424 0 0 1 6.575 3.35M9.05 6.775H6.875v6.75H9.05z" }));
|
|
8
8
|
export {
|
|
9
|
-
|
|
9
|
+
n as default
|
|
10
10
|
};
|
|
@@ -12,18 +12,14 @@ var Z = { exports: {} }, D = {};
|
|
|
12
12
|
*/
|
|
13
13
|
var Oe;
|
|
14
14
|
function lr() {
|
|
15
|
-
if (Oe)
|
|
16
|
-
return D;
|
|
15
|
+
if (Oe) return D;
|
|
17
16
|
Oe = 1;
|
|
18
17
|
var M = we, C = Symbol.for("react.element"), U = Symbol.for("react.fragment"), m = Object.prototype.hasOwnProperty, A = M.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, I = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
19
18
|
function P(h, c, T) {
|
|
20
19
|
var p, b = {}, _ = null, W = null;
|
|
21
20
|
T !== void 0 && (_ = "" + T), c.key !== void 0 && (_ = "" + c.key), c.ref !== void 0 && (W = c.ref);
|
|
22
|
-
for (p in c)
|
|
23
|
-
|
|
24
|
-
if (h && h.defaultProps)
|
|
25
|
-
for (p in c = h.defaultProps, c)
|
|
26
|
-
b[p] === void 0 && (b[p] = c[p]);
|
|
21
|
+
for (p in c) m.call(c, p) && !I.hasOwnProperty(p) && (b[p] = c[p]);
|
|
22
|
+
if (h && h.defaultProps) for (p in c = h.defaultProps, c) b[p] === void 0 && (b[p] = c[p]);
|
|
27
23
|
return { $$typeof: C, type: h, key: _, ref: W, props: b, _owner: A.current };
|
|
28
24
|
}
|
|
29
25
|
return D.Fragment = U, D.jsx = P, D.jsxs = P, D;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { j as u } from "./chunks/jsx-runtime.
|
|
3
|
-
import { v as x, C } from "./chunks/CustomReactSelect.
|
|
2
|
+
import { j as u } from "./chunks/jsx-runtime.C115EyI4.js";
|
|
3
|
+
import { v as x, c as C } from "./chunks/CustomReactSelect.5dHi6PEO.js";
|
|
4
4
|
const v = ({
|
|
5
5
|
id: s,
|
|
6
6
|
label: o,
|
|
@@ -8,9 +8,9 @@ const v = ({
|
|
|
8
8
|
disabled: a = !1,
|
|
9
9
|
dropdownOnFocus: e = !1,
|
|
10
10
|
hideLabel: l = !1,
|
|
11
|
-
invalid:
|
|
12
|
-
lang:
|
|
13
|
-
required:
|
|
11
|
+
invalid: c = !1,
|
|
12
|
+
lang: m = "en",
|
|
13
|
+
required: r = !1,
|
|
14
14
|
variant: f = "single",
|
|
15
15
|
...t
|
|
16
16
|
}) => {
|
|
@@ -32,12 +32,12 @@ const v = ({
|
|
|
32
32
|
disabled: a,
|
|
33
33
|
hideLabel: l,
|
|
34
34
|
isMulti: i,
|
|
35
|
-
invalid:
|
|
36
|
-
lang:
|
|
35
|
+
invalid: c,
|
|
36
|
+
lang: m,
|
|
37
37
|
openMenuOnClick: e,
|
|
38
38
|
openMenuOnFocus: e,
|
|
39
39
|
isClearable: !e || i,
|
|
40
|
-
required:
|
|
40
|
+
required: r,
|
|
41
41
|
...t
|
|
42
42
|
}
|
|
43
43
|
);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const ARIA_LIVE_REGION_ALERT_ID = "ds-alert-live-region";
|
|
2
|
+
export declare const ARIA_LIVE_REGION_STATUS_ID = "ds-status-live-region";
|
|
3
|
+
export declare const getAriaAlertLiveRegionElement: () => HTMLElement | null;
|
|
4
|
+
export declare const getAriaStatusLiveRegionElement: () => HTMLElement | null;
|
|
5
|
+
export declare const validateMultipleDSAriaLiveRegionsOnPage: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -8,7 +8,7 @@ export interface CheckboxProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
|
8
8
|
checked?: boolean;
|
|
9
9
|
/** Disables the checkbox, preventing user interaction */
|
|
10
10
|
disabled?: boolean;
|
|
11
|
-
/**
|
|
11
|
+
/** Hides the checkbox label, can be responsive
|
|
12
12
|
* `boolean | { base: boolean; s?: boolean; m?: boolean; l?: boolean; xl?: boolean; }`
|
|
13
13
|
* */
|
|
14
14
|
hideLabel?: BreakpointCustomizable<boolean>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CheckboxGroupProps } from './CheckboxGroup';
|
|
2
2
|
|
|
3
3
|
type ValidationProps = Pick<CheckboxGroupProps, 'children' | 'description' | 'id' | 'legend' | 'systemFeedback'>;
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const validateCheckboxGroupProps: ({ children, description, id, legend, systemFeedback, }: ValidationProps) => void;
|
|
5
5
|
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
|
|
3
|
+
type DialogProps = {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
footer?: React.ReactNode;
|
|
6
|
+
header?: React.ReactNode;
|
|
7
|
+
isOpen?: boolean;
|
|
8
|
+
onClose?: () => void;
|
|
9
|
+
} & HTMLAttributes<HTMLDialogElement>;
|
|
10
|
+
export declare const DSDialog: ({ children, className, footer, header, isOpen, onClose, }: DialogProps) => JSX.Element;
|
|
11
|
+
export {};
|
|
File without changes
|
|
@@ -7,5 +7,5 @@ export type Legend = string | {
|
|
|
7
7
|
headingTag?: HeadingTag;
|
|
8
8
|
};
|
|
9
9
|
type ValidationProps = Pick<FieldsetProps, 'description' | 'id' | 'legend' | 'systemFeedback'>;
|
|
10
|
-
export declare const
|
|
10
|
+
export declare const validateFieldsetProps: ({ description, id, legend, systemFeedback, }: ValidationProps) => void;
|
|
11
11
|
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
import { NotificationVariant } from './Notification.utils';
|
|
3
|
+
|
|
4
|
+
export interface NotificationProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
/** Content within the Notification */
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
/** Content within the Notification's action bar. For example a CTA button. */
|
|
8
|
+
customActionArea?: React.ReactNode;
|
|
9
|
+
/** Label for the close button */
|
|
10
|
+
closeButtonLabel?: string;
|
|
11
|
+
/** Hides the close button */
|
|
12
|
+
hideCloseButton?: boolean;
|
|
13
|
+
/** Hides the icon */
|
|
14
|
+
hideIcon?: boolean;
|
|
15
|
+
/** Defines the variant */
|
|
16
|
+
variant?: NotificationVariant;
|
|
17
|
+
/** Callback function triggered when the close button is clicked */
|
|
18
|
+
onClose?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* An inline notification component that can be used to provide system feedback messages
|
|
22
|
+
* or highlight important content.
|
|
23
|
+
*
|
|
24
|
+
* The background color and icon vary based on the value of the `variant` prop.
|
|
25
|
+
*/
|
|
26
|
+
export declare const DSNotification: ({ children, variant, customActionArea, className, closeButtonLabel, hideCloseButton, hideIcon, onClose, ...rest }: NotificationProps) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IconName } from '../../types';
|
|
2
|
+
|
|
3
|
+
export declare const NOTIFICATION_VARIANT: readonly ["success", "error", "warning", "info"];
|
|
4
|
+
export type NotificationVariant = (typeof NOTIFICATION_VARIANT)[number];
|
|
5
|
+
export declare const NOTIFICATION_ICONS: Record<NotificationVariant, IconName>;
|