@stihl-design-system/components 1.0.0-RC.7 → 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.
Files changed (155) hide show
  1. package/Notification-additional-information.jpeg +0 -0
  2. package/Notification-confirm-error.jpg +0 -0
  3. package/Notification-confirm-warn.jpeg +0 -0
  4. package/Notification-overview.jpeg +0 -0
  5. package/Notification-success.jpeg +0 -0
  6. package/assets/CustomReactSelect.CMkn-EGK.css +1 -0
  7. package/assets/Dialog.DdLMmOLt.css +1 -0
  8. package/assets/Drawer.BqBgbSuP.css +1 -0
  9. package/assets/Fieldset.qHYeUFZt.css +1 -0
  10. package/assets/InputPassword.Cf394z47.css +1 -0
  11. package/assets/InputSearch.eCRQoxjN.css +1 -0
  12. package/assets/InputStepper.B80KulYE.css +1 -0
  13. package/assets/Notification.DK6agBGS.css +1 -0
  14. package/assets/Select.BptsMxz4.css +1 -0
  15. package/assets/Textarea.CIIVh03G.css +1 -0
  16. package/assets/Toast.Dsvs1zdM.css +1 -0
  17. package/assets/asterisk.DlJ4YtSZ.css +1 -0
  18. package/assets/button.B1O7Yw3Q.css +1 -0
  19. package/assets/buttonround.DlH_ipDo.css +1 -0
  20. package/assets/checkbox.K4CVYK9g.css +1 -0
  21. package/assets/heading.6bER-Eac.css +1 -0
  22. package/assets/input.C0MrSbQu.css +1 -0
  23. package/assets/link.vtTST2ki.css +1 -0
  24. package/assets/linkstandalone.BtAcziZ7.css +1 -0
  25. package/assets/logo.pETQEsvZ.css +1 -0
  26. package/assets/optioncheckbox.BJJAph5_.css +1 -0
  27. package/assets/radio.9kpIO3HC.css +1 -0
  28. package/assets/skiptocontent.CHcqLS7S.css +1 -0
  29. package/assets/switch.2DQF2zH-.css +1 -0
  30. package/assets/systemfeedback.Sq0bAIyf.css +1 -0
  31. package/assets/text.Dhb_l50R.css +1 -0
  32. package/assets/title.f74Bosn-.css +1 -0
  33. package/{asterisk.Cjbk-xZi.js → asterisk.DDn-yX4P.js} +1 -1
  34. package/button.CkHCQg3Y.js +135 -0
  35. package/buttonround.DX3u2Fio.js +118 -0
  36. package/checkbox.BbmCDJCm.js +112 -0
  37. package/{checkboxgroup.DqWlzAeR.js → checkboxgroup.CPENWSuk.js} +2 -2
  38. package/chunks/{CheckboxGroup.DsQ6lI5a.js → CheckboxGroup.Dx_Hn8Dl.js} +2 -2
  39. package/chunks/CustomReactSelect.C4rTVlvy.js +3593 -0
  40. package/chunks/Dialog.TPjJ_yxK.js +148 -0
  41. package/chunks/Drawer.DrLGSch-.js +154 -0
  42. package/chunks/{Fieldset.B1vsrHNv.js → Fieldset.P09LInkT.js} +29 -29
  43. package/chunks/{Input.utils.BGUhXCNP.js → Input.utils.ChV6RJsh.js} +19 -17
  44. package/chunks/InputPassword.CSc1c98k.js +140 -0
  45. package/chunks/{InputSearch.DITRiB92.js → InputSearch.DrgdGFT_.js} +49 -49
  46. package/chunks/{InputStepper.Bf8NZ9pb.js → InputStepper.DJEuIr4C.js} +76 -76
  47. package/chunks/{Notification.DVVuSOqG.js → Notification.B68mMDiB.js} +24 -24
  48. package/chunks/{RadioGroup.BO4pbAJw.js → RadioGroup.B5jRveyI.js} +2 -2
  49. package/chunks/Select.Cl2eJR1z.js +191 -0
  50. package/chunks/Textarea.Sk9-GXfs.js +195 -0
  51. package/chunks/{Toast.RON4bFPY.js → Toast.D9DAuz2m.js} +33 -33
  52. package/{combobox.CRlhqmuO.js → combobox.jDpV6bv-.js} +1 -1
  53. package/components/Button/Button.d.ts +1 -1
  54. package/components/Checkbox/Checkbox.d.ts +1 -1
  55. package/components/CustomReactSelect/CustomReactSelect.d.ts +2 -2
  56. package/components/Dialog/Dialog.d.ts +22 -3
  57. package/components/Dialog/Dialog.test.d.ts +1 -0
  58. package/components/Dialog/Dialog.utils.d.ts +12 -0
  59. package/components/Dialog/Dialog.utils.test.d.ts +1 -0
  60. package/components/Drawer/Drawer.d.ts +31 -0
  61. package/components/Drawer/Drawer.test.d.ts +1 -0
  62. package/components/Drawer/Drawer.utils.d.ts +14 -0
  63. package/components/Drawer/Drawer.utils.test.d.ts +1 -0
  64. package/components/Input/Input.d.ts +1 -1
  65. package/components/InputSearch/InputSearch.d.ts +1 -1
  66. package/components/LinkStandalone/LinkStandalone.d.ts +1 -1
  67. package/components/Notification/Notification.d.ts +3 -1
  68. package/components/Radio/Radio.d.ts +1 -1
  69. package/components/RadioGroup/RadioGroup.d.ts +1 -1
  70. package/components/SkipToContent/SkipToContent.d.ts +1 -1
  71. package/components/Switch/Switch.d.ts +1 -1
  72. package/components/Toast/Toast.d.ts +3 -0
  73. package/{customreactselect.CD58gwtp.js → customreactselect.C2QK_Q8T.js} +4 -4
  74. package/dialog.BPX7RJtQ.js +9 -0
  75. package/drawer.BfEPcSsQ.js +9 -0
  76. package/drawer.d.ts +1 -0
  77. package/fieldset.4yvz0e7M.js +11 -0
  78. package/heading.CAkraI2D.js +50 -0
  79. package/index.d.ts +4 -0
  80. package/index.es.js +99 -92
  81. package/input.lLMqAG-6.js +236 -0
  82. package/{inputpassword.Ba9SUUIK.js → inputpassword.BIdYGrhB.js} +4 -4
  83. package/{inputsearch.BK-0OTwA.js → inputsearch.DleOblJp.js} +4 -4
  84. package/inputstepper.DWkHwOAn.js +13 -0
  85. package/link.KZaBufPM.js +116 -0
  86. package/linkstandalone.B6tN-NXD.js +80 -0
  87. package/{logo.BR_CUXFl.js → logo.CqukakYv.js} +32 -36
  88. package/{notification.Csn5QCR2.js → notification.DdJjbSdM.js} +2 -2
  89. package/optioncheckbox.DwQEfxGG.js +43 -0
  90. package/package.json +6 -4
  91. package/partials/index.js +442 -442
  92. package/radio.CWGJtmKl.js +115 -0
  93. package/{radiogroup.CiENWRos.js → radiogroup.FfK4DLsV.js} +3 -3
  94. package/{select.DLYav8gw.js → select.BEuTuEFZ.js} +3 -3
  95. package/{skiptocontent._YZRKxnc.js → skiptocontent.fP4SOp-p.js} +16 -14
  96. package/styles/scss/lib/_heading.scss +50 -9
  97. package/styles/scss/lib/_helpers.scss +12 -0
  98. package/styles/scss/lib/_link.scss +58 -94
  99. package/styles/scss/lib/_text.scss +57 -14
  100. package/switch.KO8HZPNL.js +65 -0
  101. package/{systemfeedback.CUWch42u.js → systemfeedback._8gatmgR.js} +1 -1
  102. package/text.rgDKQBrU.js +57 -0
  103. package/{textarea.hLgeYdsI.js → textarea.DV1yVty7.js} +3 -3
  104. package/title.LY1ylQsb.js +36 -0
  105. package/{toast.r_yhGYEe.js → toast.BB8L0ixD.js} +2 -2
  106. package/{toastmanager.BncH_rUP.js → toastmanager.DifUvJcg.js} +27 -25
  107. package/utils/index.d.ts +1 -0
  108. package/utils/render-in-iframe.d.ts +15 -0
  109. package/utils/useIsomorphicLayoutEffect.d.ts +26 -0
  110. package/utils/vitest.setup.d.ts +2 -0
  111. package/assets/CustomReactSelect.Bsphydqt.css +0 -1
  112. package/assets/Fieldset.D0jHAGRL.css +0 -1
  113. package/assets/InputPassword.VCNO8ANM.css +0 -1
  114. package/assets/InputSearch.BMRAb95l.css +0 -1
  115. package/assets/InputStepper.BKjqNi-i.css +0 -1
  116. package/assets/Notification.Bg63cvs4.css +0 -1
  117. package/assets/Select.Bz1TImkI.css +0 -1
  118. package/assets/Textarea.D2h5cW_t.css +0 -1
  119. package/assets/Toast.BzVaebc0.css +0 -1
  120. package/assets/asterisk.JlyPArZu.css +0 -1
  121. package/assets/button.BdxtFZKx.css +0 -1
  122. package/assets/buttonround.pR4StXA7.css +0 -1
  123. package/assets/checkbox.BjIn2stV.css +0 -1
  124. package/assets/dialog.CKwM2EBH.css +0 -1
  125. package/assets/heading.CCbuI4X-.css +0 -1
  126. package/assets/input.71tOIrpp.css +0 -1
  127. package/assets/link.D61tKkSK.css +0 -1
  128. package/assets/linkstandalone.Bx8Uvo0G.css +0 -1
  129. package/assets/logo.C05WqGId.css +0 -1
  130. package/assets/optioncheckbox.BdRJHcSw.css +0 -1
  131. package/assets/radio.ewRpPo4W.css +0 -1
  132. package/assets/skiptocontent.DGVJ77cj.css +0 -1
  133. package/assets/switch.Ds-I_ybT.css +0 -1
  134. package/assets/systemfeedback.BzJATHDd.css +0 -1
  135. package/assets/text.B-CTuGgI.css +0 -1
  136. package/assets/title.DlhX9K3W.css +0 -1
  137. package/button.L1lgCuM9.js +0 -135
  138. package/buttonround.ddSqXjYf.js +0 -118
  139. package/checkbox.DNHdo6_n.js +0 -113
  140. package/chunks/CustomReactSelect.5dHi6PEO.js +0 -4983
  141. package/chunks/InputPassword.a7zHKrmM.js +0 -140
  142. package/chunks/Select.COdS787F.js +0 -191
  143. package/chunks/Textarea.oqCrSopu.js +0 -195
  144. package/dialog.0qPUVJha.js +0 -45
  145. package/fieldset.aY3V2jK2.js +0 -11
  146. package/heading.BTNroD1E.js +0 -50
  147. package/input.DqSOhSMX.js +0 -236
  148. package/inputstepper.DFQ4zC15.js +0 -13
  149. package/link.SAcKvzJ3.js +0 -115
  150. package/linkstandalone.DNe0Nydm.js +0 -79
  151. package/optioncheckbox.C4l2UIak.js +0 -43
  152. package/radio.epf54-sG.js +0 -115
  153. package/switch.rd7PdLc9.js +0 -65
  154. package/text.CrYUewrP.js +0 -57
  155. package/title.Dvp8LKJt.js +0 -36
@@ -1,140 +0,0 @@
1
- "use client";
2
- import { j as n } from "./jsx-runtime.C115EyI4.js";
3
- import { c as i } from "./index.CvOaL64Y.js";
4
- import { useState as D } from "react";
5
- import { u as C } from "./useBreakpoint.5xBNDiCf.js";
6
- import { Asterisk as L } from "../asterisk.Cjbk-xZi.js";
7
- import { DSButton as $ } from "../button.L1lgCuM9.js";
8
- import { DSSystemFeedback as E } from "../systemfeedback.CUWch42u.js";
9
- import { g as b } from "./helpers.B1JT5ShS.js";
10
- import '../assets/InputPassword.VCNO8ANM.css';const q = "_input_1s7sy_226", R = "_input--invalid_1s7sy_336", V = "_input--small_1s7sy_343", O = "_input--has-leading-icon_1s7sy_395", F = "_input--has-action-button_1s7sy_398", M = "_input--has-second-action-button_1s7sy_401", T = "_input--has-affix_1s7sy_413", G = "_input--is-ready_1s7sy_427", J = "_root_1s7sy_434", K = "_hint_1s7sy_442", Q = "_label_1s7sy_442", U = "_wrapper_1s7sy_446", W = "_action-button_1s7sy_452", X = "_label--hidden_1s7sy_469", Y = "_feedback_1s7sy_496", s = {
11
- input: q,
12
- "input--invalid": "_input--invalid_1s7sy_336",
13
- inputInvalid: R,
14
- "input--small": "_input--small_1s7sy_343",
15
- inputSmall: V,
16
- "input--has-leading-icon": "_input--has-leading-icon_1s7sy_395",
17
- inputHasLeadingIcon: O,
18
- "input--has-action-button": "_input--has-action-button_1s7sy_398",
19
- inputHasActionButton: F,
20
- "input--has-second-action-button": "_input--has-second-action-button_1s7sy_401",
21
- inputHasSecondActionButton: M,
22
- "input--has-affix": "_input--has-affix_1s7sy_413",
23
- inputHasAffix: T,
24
- "input--is-ready": "_input--is-ready_1s7sy_427",
25
- inputIsReady: G,
26
- root: J,
27
- hint: K,
28
- label: Q,
29
- wrapper: U,
30
- "action-button": "_action-button_1s7sy_452",
31
- actionButton: W,
32
- "label--hidden": "_label--hidden_1s7sy_469",
33
- labelHidden: X,
34
- feedback: Y
35
- }, Z = ({ id: t, label: a }) => {
36
- if (!t)
37
- throw new Error(
38
- b(
39
- "DSInputPassword",
40
- 'A unique "id" prop is required. Please add an unique "id" prop to the DSInputPassword component.'
41
- )
42
- );
43
- if (!a)
44
- throw new Error(
45
- b(
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
- }, ls = ({
51
- id: t,
52
- label: a,
53
- autocomplete: h = "new-password",
54
- className: f,
55
- disabled: c = !1,
56
- hidePasswordText: w = "Hide password",
57
- hint: e,
58
- hideLabel: S = !1,
59
- invalid: o = !1,
60
- readonly: r = !1,
61
- required: d = !1,
62
- showPasswordText: x = "Show password",
63
- size: l = "medium",
64
- systemFeedback: u,
65
- ...I
66
- }) => {
67
- process.env.NODE_ENV !== "production" && Z({
68
- id: t,
69
- label: a
70
- });
71
- const [p, v] = D(!1), _ = `${t}-label`, m = `${t}-feedback`, y = `${t}-hint`, B = e ? ` ${y}` : "", H = C(S), g = i(s.root, f), P = i(s.input, {
72
- // small input
73
- [s.inputSmall]: l === "small",
74
- // invalid state
75
- [s.inputInvalid]: o,
76
- // action button - input password always has an action button
77
- [s.inputHasActionButton]: !0
78
- }), N = i(s.label, {
79
- // hide label only visually to keep them available for assistive technologies
80
- [s.labelHidden]: H
81
- }), j = i(s.actionButton, {
82
- [s.actionButtonSmall]: l === "small"
83
- }), k = () => {
84
- v((A) => !A);
85
- };
86
- return /* @__PURE__ */ n.jsxs("div", { className: g, children: [
87
- /* @__PURE__ */ n.jsxs("label", { className: N, id: _, htmlFor: t, children: [
88
- a,
89
- d && /* @__PURE__ */ n.jsx(L, {})
90
- ] }),
91
- e && /* @__PURE__ */ n.jsx("div", { className: s.hint, id: y, children: e }),
92
- o && u && /* @__PURE__ */ n.jsx(
93
- E,
94
- {
95
- className: s.feedback,
96
- message: u,
97
- type: "invalid",
98
- id: m
99
- }
100
- ),
101
- /* @__PURE__ */ n.jsxs("div", { className: s.wrapper, children: [
102
- /* @__PURE__ */ n.jsx(
103
- "input",
104
- {
105
- className: P,
106
- id: t,
107
- ...I,
108
- "aria-labelledby": `${_}${B}`,
109
- "aria-describedby": o && u ? m : void 0,
110
- "aria-invalid": o,
111
- "aria-disabled": r,
112
- readOnly: r,
113
- required: d,
114
- disabled: c,
115
- autoComplete: h,
116
- type: p ? "text" : "password"
117
- }
118
- ),
119
- /* @__PURE__ */ n.jsx(
120
- $,
121
- {
122
- hideLabel: !0,
123
- theme: "light",
124
- iconName: p ? "eye-closed" : "eye",
125
- variant: "ghost",
126
- className: j,
127
- size: l,
128
- onClick: k,
129
- type: "button",
130
- disabled: c,
131
- children: p ? w : x
132
- }
133
- )
134
- ] })
135
- ] });
136
- };
137
- export {
138
- ls as D,
139
- Z as v
140
- };
@@ -1,191 +0,0 @@
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
- };
@@ -1,195 +0,0 @@
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
- };
@@ -1,45 +0,0 @@
1
- "use client";
2
- import { j as e } from "./chunks/jsx-runtime.C115EyI4.js";
3
- import { c as u } from "./chunks/index.CvOaL64Y.js";
4
- import { useRef as f, useEffect as l } from "react";
5
- import { DSButton as m } from "./button.L1lgCuM9.js";
6
- import './assets/dialog.CKwM2EBH.css';const _ = "_root_4piiz_76", p = "_success_4piiz_80", d = "_info_4piiz_84", g = "_warning_4piiz_88", h = {
7
- root: _,
8
- success: p,
9
- info: d,
10
- warning: g
11
- }, z = ({
12
- children: r,
13
- className: c,
14
- footer: n,
15
- header: a,
16
- isOpen: t,
17
- onClose: s
18
- }) => {
19
- const i = f(null);
20
- return l(() => {
21
- const o = i.current;
22
- return o && (t ? o.showModal() : o.close(), s && o.addEventListener("close", s)), () => {
23
- o && s && o.removeEventListener("close", s);
24
- };
25
- }, [t, s]), /* @__PURE__ */ e.jsxs("dialog", { ref: i, className: u(h.root, c), children: [
26
- /* @__PURE__ */ e.jsx(
27
- m,
28
- {
29
- type: "button",
30
- iconName: "cross",
31
- variant: "ghost",
32
- hideLabel: !0,
33
- onClick: s,
34
- autoFocus: !0,
35
- children: "Close Dialog"
36
- }
37
- ),
38
- a,
39
- r,
40
- n
41
- ] });
42
- };
43
- export {
44
- z as DSDialog
45
- };
@@ -1,11 +0,0 @@
1
- "use client";
2
- import "./chunks/jsx-runtime.C115EyI4.js";
3
- import "./chunks/index.CvOaL64Y.js";
4
- import "react";
5
- import "./asterisk.Cjbk-xZi.js";
6
- import "./heading.BTNroD1E.js";
7
- import "./systemfeedback.CUWch42u.js";
8
- import { D as l } from "./chunks/Fieldset.B1vsrHNv.js";
9
- export {
10
- l as DSFieldset
11
- };
@@ -1,50 +0,0 @@
1
- "use client";
2
- import { j as l } from "./chunks/jsx-runtime.C115EyI4.js";
3
- import { c } from "./chunks/index.CvOaL64Y.js";
4
- import './assets/heading.CCbuI4X-.css';const n = "_root_n4708_76", u = "_root--x-large_n4708_79", g = "_root--x-large-uppercase_n4708_93", d = "_root--large_n4708_107", i = "_root--large-uppercase_n4708_121", x = "_root--medium_n4708_135", L = "_root--medium-uppercase_n4708_143", U = "_root--small_n4708_151", h = "_root--small-uppercase_n4708_159", k = "_root--theme-dark_n4708_167", o = {
5
- root: n,
6
- "root--x-large": "_root--x-large_n4708_79",
7
- rootXLarge: u,
8
- "root--x-large-uppercase": "_root--x-large-uppercase_n4708_93",
9
- rootXLargeUppercase: g,
10
- "root--large": "_root--large_n4708_107",
11
- rootLarge: d,
12
- "root--large-uppercase": "_root--large-uppercase_n4708_121",
13
- rootLargeUppercase: i,
14
- "root--medium": "_root--medium_n4708_135",
15
- rootMedium: x,
16
- "root--medium-uppercase": "_root--medium-uppercase_n4708_143",
17
- rootMediumUppercase: L,
18
- "root--small": "_root--small_n4708_151",
19
- rootSmall: U,
20
- "root--small-uppercase": "_root--small-uppercase_n4708_159",
21
- rootSmallUppercase: h,
22
- "root--theme-dark": "_root--theme-dark_n4708_167",
23
- rootThemeDark: k
24
- }, X = ({
25
- children: e,
26
- className: a,
27
- size: r = "medium",
28
- tag: t = "h2",
29
- // default tag because of SEO reasons (h1 should be used only once per page)
30
- theme: p = "light",
31
- ...s
32
- }) => {
33
- const _ = t, m = c(o.root, a, {
34
- // sizes
35
- [o.rootXLarge]: r === "x-large",
36
- [o.rootXLargeUppercase]: r === "x-large-uppercase",
37
- [o.rootLarge]: r === "large",
38
- [o.rootLargeUppercase]: r === "large-uppercase",
39
- [o.rootMedium]: r == "medium",
40
- [o.rootMediumUppercase]: r == "medium-uppercase",
41
- [o.rootSmall]: r == "small",
42
- [o.rootSmallUppercase]: r == "small-uppercase",
43
- // dark theme
44
- [o.rootThemeDark]: p === "dark"
45
- });
46
- return /* @__PURE__ */ l.jsx(_, { className: m, ...s, children: e });
47
- };
48
- export {
49
- X as DSHeading
50
- };