@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.
Files changed (176) hide show
  1. package/Klarna.svg +1 -0
  2. package/Mastercard.svg +2 -0
  3. package/PayPal.svg +2 -0
  4. package/Placeholder.svg +1 -0
  5. package/Visa.svg +2 -0
  6. package/arialiveregions.BvZhV6hb.js +27 -0
  7. package/arialiveregions.d.ts +1 -0
  8. package/assets/CustomReactSelect.Bsphydqt.css +1 -0
  9. package/assets/Fieldset.D0jHAGRL.css +1 -0
  10. package/assets/Icon.Duy_0R8w.css +1 -0
  11. package/assets/InputPassword.VCNO8ANM.css +1 -0
  12. package/assets/InputSearch.BMRAb95l.css +1 -0
  13. package/assets/InputStepper.BKjqNi-i.css +1 -0
  14. package/assets/Notification.Bg63cvs4.css +1 -0
  15. package/assets/RadioGroup.Bz3_xkZU.css +1 -0
  16. package/assets/Select.Bz1TImkI.css +1 -0
  17. package/assets/Textarea.D2h5cW_t.css +1 -0
  18. package/assets/Toast.BzVaebc0.css +1 -0
  19. package/assets/arialiveregions.GsGx2USO.css +1 -0
  20. package/assets/{asterisk.C-o6rbGQ.css → asterisk.JlyPArZu.css} +1 -1
  21. package/assets/button.BdxtFZKx.css +1 -0
  22. package/assets/buttonround.pR4StXA7.css +1 -0
  23. package/assets/checkbox.BjIn2stV.css +1 -0
  24. package/assets/dialog.CKwM2EBH.css +1 -0
  25. package/assets/floatingactionbutton.CUvMbEMf.css +1 -0
  26. package/assets/heading.CCbuI4X-.css +1 -0
  27. package/assets/input.71tOIrpp.css +1 -0
  28. package/assets/link.D61tKkSK.css +1 -0
  29. package/assets/linkstandalone.Bx8Uvo0G.css +1 -0
  30. package/assets/logo.C05WqGId.css +1 -0
  31. package/assets/optioncheckbox.BdRJHcSw.css +1 -0
  32. package/assets/radio.ewRpPo4W.css +1 -0
  33. package/assets/spinner.LuV09jaU.css +1 -0
  34. package/assets/switch.Ds-I_ybT.css +1 -0
  35. package/assets/{systemfeedback.WE3wClZ3.css → systemfeedback.BzJATHDd.css} +1 -1
  36. package/assets/text.B-CTuGgI.css +1 -0
  37. package/assets/{title.CE0Dm7PI.css → title.DlhX9K3W.css} +1 -1
  38. package/asterisk.Cjbk-xZi.js +8 -0
  39. package/button.DlFWwHuA.js +135 -0
  40. package/buttonround.eYOQM994.js +118 -0
  41. package/checkbox.DNHdo6_n.js +113 -0
  42. package/checkboxgroup.DqWlzAeR.js +9 -0
  43. package/chunks/AriaLiveRegions.utils.DzWI5KCU.js +31 -0
  44. package/{checkboxgroup.Cfxz9bk6.js → chunks/CheckboxGroup.DsQ6lI5a.js} +38 -31
  45. package/chunks/{CustomReactSelect.uzWNynay.js → CustomReactSelect.5dHi6PEO.js} +873 -917
  46. package/chunks/Fieldset.B1vsrHNv.js +99 -0
  47. package/chunks/Icon.n4XZrQ4N.js +223 -0
  48. package/chunks/{Input.utils.Bly6ZzLI.js → Input.utils.AKWCNkpA.js} +12 -8
  49. package/chunks/InputPassword.DTqI58Z4.js +140 -0
  50. package/chunks/InputSearch.IwQATLKh.js +189 -0
  51. package/chunks/InputStepper.Jew1ETB6.js +291 -0
  52. package/chunks/Notification.DbflCBIL.js +93 -0
  53. package/chunks/RadioGroup.BO4pbAJw.js +132 -0
  54. package/chunks/RadioGroup.module.BBZwHDjW.js +11 -0
  55. package/chunks/Select.COdS787F.js +191 -0
  56. package/chunks/Textarea.oqCrSopu.js +195 -0
  57. package/chunks/Toast.BLGKvAvZ.js +89 -0
  58. package/chunks/{circle-info-colored.DLY6BTL4.js → circle-info-colored.D2pp54gf.js} +3 -3
  59. package/chunks/{jsx-runtime.C-kxDJ4g.js → jsx-runtime.C115EyI4.js} +3 -7
  60. package/{combobox.BXHAo4Wx.js → combobox.CRlhqmuO.js} +8 -8
  61. package/components/AriaLiveRegions/AriaLiveRegions.d.ts +4 -0
  62. package/components/AriaLiveRegions/AriaLiveRegions.utils.d.ts +5 -0
  63. package/components/AriaLiveRegions/AriaLiveRegions.utils.test.d.ts +1 -0
  64. package/components/Checkbox/Checkbox.d.ts +1 -1
  65. package/components/CheckboxGroup/CheckboxGroup.utils.d.ts +1 -1
  66. package/components/Dialog/Dialog.d.ts +11 -0
  67. package/components/Dialog/Dialog.utils.d.ts +0 -0
  68. package/components/Fieldset/Fieldset.utils.d.ts +1 -1
  69. package/components/Notification/Notification.d.ts +26 -0
  70. package/components/Notification/Notification.test.d.ts +1 -0
  71. package/components/Notification/Notification.utils.d.ts +5 -0
  72. package/components/Radio/Radio.d.ts +11 -3
  73. package/components/RadioGroup/RadioGroup.d.ts +6 -3
  74. package/components/RadioGroup/RadioGroup.utils.d.ts +5 -3
  75. package/components/RadioGroup/RadioGroup.utils.test.d.ts +1 -0
  76. package/components/Toast/Toast.d.ts +21 -0
  77. package/components/Toast/Toast.utils.d.ts +9 -0
  78. package/components/Toast/ToastManager.d.ts +6 -0
  79. package/components/Toast/ToastManager.test.d.ts +1 -0
  80. package/components/Toast/ToastManager.utils.d.ts +2 -0
  81. package/components/Toast/ToastManager.utils.test.d.ts +1 -0
  82. package/customreactselect.CD58gwtp.js +13 -0
  83. package/dialog.d.ts +1 -0
  84. package/dialog.qd2pOyVc.js +45 -0
  85. package/fieldset.aY3V2jK2.js +11 -0
  86. package/floatingactionbutton.CGV3YFQq.js +87 -0
  87. package/heading.BTNroD1E.js +50 -0
  88. package/icon.D3RXjzh4.js +8 -0
  89. package/index.d.ts +24 -0
  90. package/index.es.js +140 -45
  91. package/input.BAxvG272.js +236 -0
  92. package/inputpassword.mn9qFlfs.js +12 -0
  93. package/inputsearch.qQJj9yFd.js +13 -0
  94. package/inputstepper.DhbHujiM.js +13 -0
  95. package/link.SAcKvzJ3.js +115 -0
  96. package/linkstandalone.DNe0Nydm.js +79 -0
  97. package/{logo.C_oJ8isW.js → logo.BR_CUXFl.js} +16 -16
  98. package/notification.CnJOdQza.js +9 -0
  99. package/notification.d.ts +1 -0
  100. package/{optioncheckbox.-DRnW_ch.js → optioncheckbox.C4l2UIak.js} +9 -9
  101. package/package.json +30 -26
  102. package/partials/index.js +51 -79
  103. package/radio.epf54-sG.js +115 -0
  104. package/radiogroup.CiENWRos.js +11 -0
  105. package/select.DLYav8gw.js +12 -0
  106. package/spinner.DEtbkdfi.js +58 -0
  107. package/styles/scss/_index.scss +1 -0
  108. package/styles/scss/lib/_animation.scss +20 -5
  109. package/styles/scss/lib/_container-query.scss +3 -3
  110. package/styles/scss/lib/_grid-sidebar-sidebar.scss +2 -0
  111. package/styles/scss/lib/_grid-sidebar.scss +14 -7
  112. package/styles/scss/lib/_link.scss +48 -41
  113. package/styles/scss/lib/_media-query.scss +3 -3
  114. package/styles/scss/lib/_shadow.scss +10 -0
  115. package/styles/scss/lib/_theme.scss +7 -5
  116. package/styles/scss/lib/_transition.scss +26 -7
  117. package/switch.BezS5z0Y.js +65 -0
  118. package/{systemfeedback.C7iXO5A1.js → systemfeedback.CUWch42u.js} +3 -3
  119. package/text.CrYUewrP.js +57 -0
  120. package/textarea.hLgeYdsI.js +12 -0
  121. package/title.Dvp8LKJt.js +36 -0
  122. package/toast.BR7QuHOG.js +10 -0
  123. package/toast.d.ts +1 -0
  124. package/toastmanager.DBp8B1e3.js +96 -0
  125. package/toastmanager.d.ts +1 -0
  126. package/utils/index.d.ts +1 -0
  127. package/utils/remove-spaces.d.ts +6 -0
  128. package/utils/remove-spaces.test.d.ts +1 -0
  129. package/utils/vitest.setup.d.ts +2 -0
  130. package/assets/CustomReactSelect.BdwXfLLO.css +0 -1
  131. package/assets/RadioGroup.Ur8Ro-XL.css +0 -1
  132. package/assets/button.DJvR-58w.css +0 -1
  133. package/assets/buttonround.BlfQkmMV.css +0 -1
  134. package/assets/checkbox.BsFEWfQe.css +0 -1
  135. package/assets/fieldset.xazpUXJX.css +0 -1
  136. package/assets/floatingactionbutton.D7ywURL3.css +0 -1
  137. package/assets/heading.CGFucb-C.css +0 -1
  138. package/assets/icon.CB-KQmw4.css +0 -1
  139. package/assets/input.BcP5kkZ2.css +0 -1
  140. package/assets/inputpassword.C3Uyj7oA.css +0 -1
  141. package/assets/inputsearch.tL3e9-Ob.css +0 -1
  142. package/assets/inputstepper.paPJix5A.css +0 -1
  143. package/assets/link.V7pJOW1p.css +0 -1
  144. package/assets/linkstandalone.D3RbBp23.css +0 -1
  145. package/assets/logo.BbHYgnWo.css +0 -1
  146. package/assets/optioncheckbox.C-K1FLhc.css +0 -1
  147. package/assets/radio.CSHQGdpr.css +0 -1
  148. package/assets/select.D2qBxaHP.css +0 -1
  149. package/assets/spinner.C5rBmKiF.css +0 -1
  150. package/assets/switch.sqve8ApJ.css +0 -1
  151. package/assets/text.DDAveG7E.css +0 -1
  152. package/assets/textarea.BKbocznb.css +0 -1
  153. package/asterisk.DU8THnoC.js +0 -8
  154. package/button.BUUGRxIp.js +0 -135
  155. package/buttonround.CKc-a-hd.js +0 -118
  156. package/checkbox.C2Ga9yTK.js +0 -112
  157. package/chunks/RadioGroup.module.bi3leRes.js +0 -11
  158. package/customreactselect.CipgVXTR.js +0 -13
  159. package/fieldset.DGcIKzDI.js +0 -98
  160. package/floatingactionbutton.DzHD39NY.js +0 -87
  161. package/heading.DqGbFfj2.js +0 -50
  162. package/icon.PX9_1kNB.js +0 -215
  163. package/input.o8OT6rxJ.js +0 -236
  164. package/inputpassword.-MXq8baU.js +0 -139
  165. package/inputsearch.CoYTSjox.js +0 -188
  166. package/inputstepper.BBMQr6kM.js +0 -290
  167. package/link.BN6AZfhG.js +0 -115
  168. package/linkstandalone.4-fyRd08.js +0 -79
  169. package/radio.Bhu9OUY-.js +0 -79
  170. package/radiogroup.oILRMrX-.js +0 -102
  171. package/select.OGcreXnT.js +0 -190
  172. package/spinner.Diy_EeFY.js +0 -58
  173. package/switch.BjoFKMQC.js +0 -65
  174. package/text.CPU8IUqY.js +0 -57
  175. package/textarea.kc_Sfbgr.js +0 -193
  176. package/title.icX0VDiO.js +0 -36
@@ -1,190 +0,0 @@
1
- "use client";
2
- import { j as t } from "./chunks/jsx-runtime.C-kxDJ4g.js";
3
- import { c as _ } from "./chunks/index.CvOaL64Y.js";
4
- import { useRef as $, useState as C, useEffect as W } from "react";
5
- import { u as F } from "./chunks/useBreakpoint.5xBNDiCf.js";
6
- import { Asterisk as M } from "./asterisk.DU8THnoC.js";
7
- import { DSIcon as O } from "./icon.PX9_1kNB.js";
8
- import { DSSystemFeedback as V } from "./systemfeedback.C7iXO5A1.js";
9
- import { g as f } from "./chunks/helpers.B1JT5ShS.js";
10
- import './assets/select.D2qBxaHP.css';const J = "_root_quxca_187", K = "_hint_quxca_195", Q = "_label_quxca_195", T = "_wrapper_quxca_199", U = "_affix_quxca_205", X = "_affix--small_quxca_225", Y = "_affix--disabled_quxca_237", Z = "_prefix_quxca_240", z = "_affix--readonly_quxca_243", G = "_suffix_quxca_253", ee = "_action-button_quxca_260", ae = "_label--hidden_quxca_277", te = "_feedback_quxca_304", ce = "_select-wrapper_quxca_309", se = "_select_quxca_309", ne = "_select--invalid_quxca_428", le = "_select--small_quxca_435", oe = "_input--has-leading-icon_quxca_481", ie = "_input--has-action-button_quxca_484", re = "_input--has-second-action-button_quxca_487", _e = "_select--has-leading-icon_quxca_490", ue = "_select--has-action-button_quxca_493", de = "_select--has-second-action-button_quxca_496", xe = "_select--has-affix_quxca_499", fe = "_select--is-ready_quxca_511", he = "_select--placeholder_quxca_523", pe = "_chevron_quxca_532", be = "_chevron--small_quxca_536", me = "_chevron--disabled_quxca_539", e = {
11
- root: J,
12
- hint: K,
13
- label: Q,
14
- wrapper: T,
15
- affix: U,
16
- "affix--small": "_affix--small_quxca_225",
17
- affixSmall: X,
18
- "affix--disabled": "_affix--disabled_quxca_237",
19
- affixDisabled: Y,
20
- prefix: Z,
21
- "affix--readonly": "_affix--readonly_quxca_243",
22
- affixReadonly: z,
23
- suffix: G,
24
- "action-button": "_action-button_quxca_260",
25
- actionButton: ee,
26
- "label--hidden": "_label--hidden_quxca_277",
27
- labelHidden: ae,
28
- feedback: te,
29
- "select-wrapper": "_select-wrapper_quxca_309",
30
- selectWrapper: ce,
31
- select: se,
32
- "select--invalid": "_select--invalid_quxca_428",
33
- selectInvalid: ne,
34
- "select--small": "_select--small_quxca_435",
35
- selectSmall: le,
36
- "input--has-leading-icon": "_input--has-leading-icon_quxca_481",
37
- inputHasLeadingIcon: oe,
38
- "input--has-action-button": "_input--has-action-button_quxca_484",
39
- inputHasActionButton: ie,
40
- "input--has-second-action-button": "_input--has-second-action-button_quxca_487",
41
- inputHasSecondActionButton: re,
42
- "select--has-leading-icon": "_select--has-leading-icon_quxca_490",
43
- selectHasLeadingIcon: _e,
44
- "select--has-action-button": "_select--has-action-button_quxca_493",
45
- selectHasActionButton: ue,
46
- "select--has-second-action-button": "_select--has-second-action-button_quxca_496",
47
- selectHasSecondActionButton: de,
48
- "select--has-affix": "_select--has-affix_quxca_499",
49
- selectHasAffix: xe,
50
- "select--is-ready": "_select--is-ready_quxca_511",
51
- selectIsReady: fe,
52
- "select--placeholder": "_select--placeholder_quxca_523",
53
- selectPlaceholder: he,
54
- chevron: pe,
55
- "chevron--small": "_chevron--small_quxca_536",
56
- chevronSmall: be,
57
- "chevron--disabled": "_chevron--disabled_quxca_539",
58
- chevronDisabled: me
59
- }, qe = ({
60
- id: a,
61
- label: n,
62
- options: s
63
- }) => {
64
- if (!a)
65
- throw new Error(
66
- f(
67
- "DSSelect",
68
- 'A unique "id" prop is required. Please add an unique "id" prop to the DSSelect component.'
69
- )
70
- );
71
- if (!n)
72
- throw new Error(
73
- f(
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
- f(
81
- "DSSelect",
82
- 'Options are always required. Please add an "options" prop to the DSSelect component.'
83
- )
84
- );
85
- }, ve = (a, n, s) => a === "" || n !== void 0 && n !== "" ? !1 : !(s !== void 0 && s !== ""), Ae = ({
86
- id: a,
87
- label: n,
88
- options: s,
89
- className: H,
90
- defaultValue: h,
91
- disabled: p = !1,
92
- hideLabel: w = !1,
93
- hint: u,
94
- invalid: r = !1,
95
- placeholder: d = "Select",
96
- required: b = !1,
97
- size: m = "medium",
98
- systemFeedback: x,
99
- value: q,
100
- ...D
101
- }) => {
102
- process.env.NODE_ENV !== "production" && qe({
103
- id: a,
104
- label: n,
105
- options: s
106
- });
107
- const i = $(null), [I, j] = C(
108
- ve(d, h, q)
109
- );
110
- W(() => {
111
- if (!i.current)
112
- return;
113
- const l = () => {
114
- if (!i.current)
115
- return;
116
- const o = i.current.value;
117
- j(o === "");
118
- }, c = i.current;
119
- return c.addEventListener("change", l), () => {
120
- c.removeEventListener("change", l);
121
- };
122
- }, []);
123
- const A = F(w), v = `${a}-label`, S = `${a}-feedback`, g = `${a}-hint`, B = u ? ` ${g}` : "", N = (l) => [
124
- d && /* @__PURE__ */ t.jsx("option", { value: "", children: d }, `${a}-hidden-option-disabled-placeholder`),
125
- ...l.map((c) => {
126
- if ("options" in c) {
127
- const { label: o, options: R } = c;
128
- return /* @__PURE__ */ t.jsx("optgroup", { label: o, children: R.map(y) }, o);
129
- } else
130
- return y(c);
131
- })
132
- ], y = ({ label: l, value: c, isDisabled: o }) => /* @__PURE__ */ t.jsx("option", { value: c, disabled: o, children: l }, c), P = _(e.root, H), E = _(e.select, {
133
- [e.selectSmall]: m === "small",
134
- [e.selectInvalid]: r,
135
- [e.selectPlaceholder]: I
136
- }), L = _(e.label, {
137
- // hide label only visually to keep them available for assistive technologies
138
- [e.labelHidden]: A
139
- }), k = _(e.chevron, {
140
- [e.chevronSmall]: m === "small",
141
- [e.chevronDisabled]: p
142
- });
143
- return /* @__PURE__ */ t.jsxs("div", { className: P, children: [
144
- /* @__PURE__ */ t.jsxs("label", { className: L, id: v, htmlFor: a, children: [
145
- n,
146
- b && /* @__PURE__ */ t.jsx(M, {})
147
- ] }),
148
- u && /* @__PURE__ */ t.jsx("div", { className: e.hint, id: g, children: u }),
149
- r && x && /* @__PURE__ */ t.jsx(
150
- V,
151
- {
152
- className: e.feedback,
153
- message: x,
154
- type: "invalid",
155
- id: S,
156
- "aria-live": "assertive"
157
- }
158
- ),
159
- /* @__PURE__ */ t.jsxs("div", { className: e.selectWrapper, children: [
160
- /* @__PURE__ */ t.jsx(
161
- "select",
162
- {
163
- ...D,
164
- id: a,
165
- ref: i,
166
- className: E,
167
- "aria-labelledby": `${v}${B}`,
168
- "aria-describedby": r && x ? S : void 0,
169
- "aria-invalid": r,
170
- defaultValue: h,
171
- value: q,
172
- disabled: p,
173
- required: b,
174
- children: N(s)
175
- }
176
- ),
177
- /* @__PURE__ */ t.jsx(
178
- O,
179
- {
180
- name: "chevron-down",
181
- className: k,
182
- "aria-hidden": "true"
183
- }
184
- )
185
- ] })
186
- ] });
187
- };
188
- export {
189
- Ae as DSSelect
190
- };
@@ -1,58 +0,0 @@
1
- "use client";
2
- import { j as t } from "./chunks/jsx-runtime.C-kxDJ4g.js";
3
- import { c as n } from "./chunks/index.CvOaL64Y.js";
4
- import { DSIcon as _ } from "./icon.PX9_1kNB.js";
5
- import './assets/spinner.C5rBmKiF.css';const m = "_root_1xfbe_63", z = "_root-size-small_1xfbe_69", c = "_root-size-medium_1xfbe_73", x = "_root-size-large_1xfbe_77", S = "_root-size-x-large_1xfbe_81", f = "_root-size-inherit_1xfbe_85", d = "_rotate_1xfbe_1", b = "_screenReaderOnly_1xfbe_105", e = {
6
- root: m,
7
- "root-size-small": "_root-size-small_1xfbe_69",
8
- rootSizeSmall: z,
9
- "root-size-medium": "_root-size-medium_1xfbe_73",
10
- rootSizeMedium: c,
11
- "root-size-large": "_root-size-large_1xfbe_77",
12
- rootSizeLarge: x,
13
- "root-size-x-large": "_root-size-x-large_1xfbe_81",
14
- rootSizeXLarge: S,
15
- "root-size-inherit": "_root-size-inherit_1xfbe_85",
16
- rootSizeInherit: f,
17
- rotate: d,
18
- screenReaderOnly: b
19
- }, p = ({
20
- aria: r,
21
- className: i,
22
- size: o = "small",
23
- theme: s = "light",
24
- ...a
25
- }) => {
26
- const l = n(e.root, i, {
27
- [e.rootSizeSmall]: o === "small",
28
- [e.rootSizeMedium]: o === "medium",
29
- [e.rootSizeLarge]: o === "large",
30
- [e.rootSizeXLarge]: o === "x-large",
31
- [e.rootSizeInherit]: o === "inherit"
32
- });
33
- return /* @__PURE__ */ t.jsxs(
34
- "span",
35
- {
36
- className: l,
37
- role: "alert",
38
- "aria-live": "assertive",
39
- "aria-label": (r == null ? void 0 : r["aria-label"]) || void 0,
40
- ...a,
41
- children: [
42
- /* @__PURE__ */ t.jsx("span", { className: e.screenReaderOnly, children: " " }),
43
- /* @__PURE__ */ t.jsx(
44
- _,
45
- {
46
- name: "loading-spinner",
47
- theme: s,
48
- focusable: "false",
49
- "aria-hidden": "true"
50
- }
51
- )
52
- ]
53
- }
54
- );
55
- };
56
- export {
57
- p as DSSpinner
58
- };
@@ -1,65 +0,0 @@
1
- "use client";
2
- import { j as t } from "./chunks/jsx-runtime.C-kxDJ4g.js";
3
- import { c as b } from "./chunks/index.CvOaL64Y.js";
4
- import "react";
5
- import { DSIcon as p } from "./icon.PX9_1kNB.js";
6
- import { DSSpinner as f } from "./spinner.Diy_EeFY.js";
7
- import './assets/switch.sqve8ApJ.css';const x = "_root_1gc2h_63", j = "_root--label-right_1gc2h_91", k = "_root--stretched_1gc2h_94", S = "_loader_1gc2h_104", w = "_thumb_1gc2h_157", C = "_root--checked_1gc2h_172", o = {
8
- root: x,
9
- "root--label-right": "_root--label-right_1gc2h_91",
10
- rootLabelRight: j,
11
- "root--stretched": "_root--stretched_1gc2h_94",
12
- rootStretched: k,
13
- switch: "_switch_1gc2h_99",
14
- loader: S,
15
- thumb: w,
16
- "root--checked": "_root--checked_1gc2h_172",
17
- rootChecked: C
18
- }, E = ({
19
- children: h,
20
- aria: i,
21
- alignLabel: l = "left",
22
- checked: e = !1,
23
- className: _,
24
- dataTrackingid: n,
25
- disabled: c = !1,
26
- loading: r = !1,
27
- stretched: d = !1,
28
- onClick: s,
29
- ...m
30
- }) => {
31
- const g = b(o.root, _, {
32
- [o.rootChecked]: e === !0,
33
- [o.rootStretched]: d === !0,
34
- [o.rootLabelRight]: l === "right"
35
- }), u = (a) => {
36
- if (c || r) {
37
- a.preventDefault();
38
- return;
39
- }
40
- s && s(a);
41
- };
42
- return /* @__PURE__ */ t.jsxs(
43
- "button",
44
- {
45
- className: g,
46
- "data-trackingid": n,
47
- onClick: u,
48
- ...i,
49
- ...m,
50
- type: "button",
51
- role: "switch",
52
- "aria-checked": e,
53
- "aria-disabled": c || r,
54
- "aria-busy": r,
55
- children: [
56
- /* @__PURE__ */ t.jsx("span", { children: h }),
57
- !r && /* @__PURE__ */ t.jsx("span", { className: o.switch, children: /* @__PURE__ */ t.jsx("span", { className: o.thumb, children: /* @__PURE__ */ t.jsx(p, { name: "check", "aria-hidden": "true" }) }) }),
58
- r && /* @__PURE__ */ t.jsx("span", { className: o.loader, children: /* @__PURE__ */ t.jsx(f, { aria: { "aria-label": "Loading state" } }) })
59
- ]
60
- }
61
- );
62
- };
63
- export {
64
- E as DSSwitch
65
- };
package/text.CPU8IUqY.js DELETED
@@ -1,57 +0,0 @@
1
- "use client";
2
- import { j as x } from "./chunks/jsx-runtime.C-kxDJ4g.js";
3
- import { c as v } from "./chunks/index.CvOaL64Y.js";
4
- import './assets/text.DDAveG7E.css';const c = "_root_16s1v_63", n = "_root--large_16s1v_69", u = "_root--large-bold_16s1v_79", b = "_root--medium_16s1v_89", S = "_root--medium-bold_16s1v_99", g = "_root--small_16s1v_109", B = "_root--small-bold_16s1v_119", i = "_root--x-small_16s1v_129", X = "_root--x-small-bold_16s1v_139", k = "_root--xx-small_16s1v_149", L = "_root--theme-dark_16s1v_159", o = {
5
- root: c,
6
- "root--large": "_root--large_16s1v_69",
7
- rootLarge: n,
8
- "root--large-bold": "_root--large-bold_16s1v_79",
9
- rootLargeBold: u,
10
- "root--medium": "_root--medium_16s1v_89",
11
- rootMedium: b,
12
- "root--medium-bold": "_root--medium-bold_16s1v_99",
13
- rootMediumBold: S,
14
- "root--small": "_root--small_16s1v_109",
15
- rootSmall: g,
16
- "root--small-bold": "_root--small-bold_16s1v_119",
17
- rootSmallBold: B,
18
- "root--x-small": "_root--x-small_16s1v_129",
19
- rootXSmall: i,
20
- "root--x-small-bold": "_root--x-small-bold_16s1v_139",
21
- rootXSmallBold: X,
22
- "root--xx-small": "_root--xx-small_16s1v_149",
23
- rootXxSmall: k,
24
- "root--theme-dark": "_root--theme-dark_16s1v_159",
25
- rootThemeDark: L
26
- }, T = ({
27
- children: t,
28
- className: m,
29
- size: l = "medium",
30
- tag: a = "p",
31
- theme: s = "light",
32
- weight: r = "normal",
33
- ..._
34
- }) => {
35
- const d = a, e = v(o.root, m, {
36
- // large
37
- [o.rootLarge]: l === "large",
38
- [o.rootLargeBold]: l === "large" && r === "bold",
39
- // medium
40
- [o.rootMedium]: l == "medium",
41
- [o.rootMediumBold]: l === "medium" && r === "bold",
42
- // small
43
- [o.rootSmall]: l == "small",
44
- [o.rootSmallBold]: l == "small" && r === "bold",
45
- // x-small
46
- [o.rootXSmall]: l == "x-small",
47
- [o.rootXSmallBold]: l == "x-small" && r === "bold",
48
- // xx-small
49
- [o.rootXxSmall]: l == "xx-small",
50
- // dark theme
51
- [o.rootThemeDark]: s === "dark"
52
- });
53
- return /* @__PURE__ */ x.jsx(d, { className: e, ..._, children: t });
54
- };
55
- export {
56
- T as DSText
57
- };
@@ -1,193 +0,0 @@
1
- "use client";
2
- import { j as n } from "./chunks/jsx-runtime.C-kxDJ4g.js";
3
- import { c as S } from "./chunks/index.CvOaL64Y.js";
4
- import { useState as c, useRef as le, useEffect as x } from "react";
5
- import { u as oe, h as ie } from "./chunks/useBreakpoint.5xBNDiCf.js";
6
- import { g as H, p as V } from "./chunks/helpers.B1JT5ShS.js";
7
- import { Asterisk as se } from "./asterisk.DU8THnoC.js";
8
- import { DSSystemFeedback as re } from "./systemfeedback.C7iXO5A1.js";
9
- import './assets/textarea.BKbocznb.css';const ce = "_textarea_1elbe_187", de = "_textarea--invalid_1elbe_297", _e = "_textarea--small_1elbe_304", ue = "_textarea--resize-auto_1elbe_316", fe = "_root_1elbe_326", be = "_hint_1elbe_334", xe = "_label_1elbe_334", he = "_affix_1elbe_338", me = "_affix--small_1elbe_358", pe = "_affix--disabled_1elbe_370", ve = "_prefix_1elbe_373", ge = "_affix--readonly_1elbe_376", Se = "_suffix_1elbe_386", Ce = "_leading-icon_1elbe_393", Ie = "_leading-icon--small_1elbe_405", ye = "_leading-icon--disabled_1elbe_408", je = "_action-button_1elbe_417", we = "_label--hidden_1elbe_434", Ae = "_feedback_1elbe_461", De = "_char-count_1elbe_466", Re = "_char-count-announcer_1elbe_481", t = {
10
- textarea: ce,
11
- "textarea--invalid": "_textarea--invalid_1elbe_297",
12
- textareaInvalid: de,
13
- "textarea--small": "_textarea--small_1elbe_304",
14
- textareaSmall: _e,
15
- "textarea--resize-auto": "_textarea--resize-auto_1elbe_316",
16
- textareaResizeAuto: ue,
17
- root: fe,
18
- hint: be,
19
- label: xe,
20
- affix: he,
21
- "affix--small": "_affix--small_1elbe_358",
22
- affixSmall: me,
23
- "affix--disabled": "_affix--disabled_1elbe_370",
24
- affixDisabled: pe,
25
- prefix: ve,
26
- "affix--readonly": "_affix--readonly_1elbe_376",
27
- affixReadonly: ge,
28
- suffix: Se,
29
- "leading-icon": "_leading-icon_1elbe_393",
30
- leadingIcon: Ce,
31
- "leading-icon--small": "_leading-icon--small_1elbe_405",
32
- leadingIconSmall: Ie,
33
- "leading-icon--disabled": "_leading-icon--disabled_1elbe_408",
34
- leadingIconDisabled: ye,
35
- "action-button": "_action-button_1elbe_417",
36
- actionButton: je,
37
- "label--hidden": "_label--hidden_1elbe_434",
38
- labelHidden: we,
39
- feedback: Ae,
40
- "char-count": "_char-count_1elbe_466",
41
- charCount: De,
42
- "char-count-announcer": "_char-count-announcer_1elbe_481",
43
- charCountAnnouncer: Re
44
- }, Ne = ({ id: l, label: _ }) => {
45
- if (!l)
46
- throw new Error(
47
- H(
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
- H(
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: l,
61
- label: _,
62
- charsLimitText: z = "Character limit reached",
63
- charsRemainingText: P = "Characters remaining:",
64
- className: q,
65
- defaultValue: M,
66
- disabled: O = !1,
67
- hint: h,
68
- hideLabel: F = !1,
69
- invalid: o = !1,
70
- maxLength: e,
71
- readonly: C = !1,
72
- required: I = !1,
73
- resize: u = "vertical",
74
- size: W = "medium",
75
- systemFeedback: s,
76
- value: m,
77
- wrapperClassName: G,
78
- onChange: y,
79
- onInput: j,
80
- ...J
81
- }) => {
82
- process.env.NODE_ENV !== "production" && Ne({
83
- id: l,
84
- label: _
85
- });
86
- const [K, w] = c(M || ""), [r, A] = c(0), [Q, D] = c(0), [U, R] = c("off"), [N, p] = c(s), [v, g] = c(o), T = m !== void 0, f = T ? m : K, i = le(null), X = oe(F);
87
- x(() => {
88
- if (!e || e <= 0)
89
- return;
90
- r >= e * 0.8 ? R("polite") : R("off");
91
- const a = setTimeout(() => {
92
- D(e - r || 0);
93
- }, 1e3);
94
- return () => clearTimeout(a);
95
- }, [r]), x(() => {
96
- w(f || ""), d(), e && e > 0 && (A(f.toString().length || 0), D(e - f.toString().length || 0));
97
- }, [m]), x(() => {
98
- o && s ? (p(s), g(o)) : !o && e && e >= 0 && r >= e ? (g(!0), p(z)) : (p(s), g(o));
99
- }, [o, v, s, r]), x(() => {
100
- if (ie && u === "auto")
101
- return d(), window.addEventListener("resize", d), () => window.removeEventListener("resize", d);
102
- }, [u, i.current]);
103
- const Y = S(t.root, G), Z = S(t.textarea, q, {
104
- // small textarea
105
- [t.textareaSmall]: W === "small",
106
- // invalid state
107
- [t.textareaInvalid]: v,
108
- // resize handling
109
- [t.textareaResizeAuto]: u === "auto"
110
- }), L = S(t.label, {
111
- // hide label only visually to keep them available for assistive technologies
112
- [t.labelHidden]: X
113
- }), B = `${l}-label`, E = `${l}-feedback`, $ = `${l}-hint`, k = `${l}-char-count-announcer`, ee = h ? ` ${$}` : "", d = () => {
114
- if (i.current && u === "auto") {
115
- i.current.style.height = "auto";
116
- const a = V(i.current.scrollHeight), b = V(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 + b}rem`;
120
- }
121
- }, ae = () => {
122
- const a = [];
123
- return e && e > 0 && a.push(k), o && s && a.push(E), a.length > 0 ? a.join(" ") : void 0;
124
- }, te = (a) => {
125
- var b;
126
- j && j(a), e && e > 0 && A(((b = i.current) == null ? void 0 : b.value.length) || 0), d();
127
- }, ne = (a) => {
128
- y && y(a), T || w(a.target.value);
129
- };
130
- return /* @__PURE__ */ n.jsxs("div", { className: Y, children: [
131
- /* @__PURE__ */ n.jsxs("label", { className: L, id: B, htmlFor: l, children: [
132
- _,
133
- I && /* @__PURE__ */ n.jsx(se, {})
134
- ] }),
135
- h && /* @__PURE__ */ n.jsx("div", { className: t.hint, id: $, children: h }),
136
- v && N && /* @__PURE__ */ n.jsx(
137
- re,
138
- {
139
- className: t.feedback,
140
- message: N,
141
- type: "invalid",
142
- id: E
143
- }
144
- ),
145
- /* @__PURE__ */ n.jsx(
146
- "textarea",
147
- {
148
- className: Z,
149
- id: l,
150
- ref: i,
151
- ...J,
152
- "aria-labelledby": `${B}${ee}`,
153
- "aria-describedby": ae(),
154
- "aria-invalid": o,
155
- "aria-disabled": C,
156
- maxLength: e,
157
- readOnly: C,
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
- r,
171
- "/",
172
- e
173
- ] }),
174
- /* @__PURE__ */ n.jsxs(
175
- "div",
176
- {
177
- className: t.charCountAnnouncer,
178
- id: k,
179
- "aria-live": U,
180
- "aria-atomic": "true",
181
- children: [
182
- P,
183
- " ",
184
- Q
185
- ]
186
- }
187
- )
188
- ] })
189
- ] });
190
- };
191
- export {
192
- ze as DSTextarea
193
- };
package/title.icX0VDiO.js DELETED
@@ -1,36 +0,0 @@
1
- "use client";
2
- import { j as o } from "./chunks/jsx-runtime.C-kxDJ4g.js";
3
- import { c as g } from "./chunks/index.CvOaL64Y.js";
4
- import './assets/title.CE0Dm7PI.css';const n = "_root_1bpc5_63", h = "_root--x-large-uppercase_1bpc5_66", m = "_root--large-uppercase_1bpc5_80", d = "_root--theme-dark_1bpc5_94", u = "_dash_1bpc5_97", r = {
5
- root: n,
6
- "root--x-large-uppercase": "_root--x-large-uppercase_1bpc5_66",
7
- rootXLargeUppercase: h,
8
- "root--large-uppercase": "_root--large-uppercase_1bpc5_80",
9
- rootLargeUppercase: m,
10
- "root--theme-dark": "_root--theme-dark_1bpc5_94",
11
- rootThemeDark: d,
12
- dash: u
13
- }, b = ({
14
- children: a,
15
- className: t,
16
- size: e = "x-large",
17
- tag: s = "h1",
18
- // Design suggested to set default tag to h1
19
- theme: p = "light",
20
- ...c
21
- }) => {
22
- const _ = s, l = g(r.root, t, {
23
- // sizes
24
- [r.rootXLargeUppercase]: e === "x-large",
25
- [r.rootLargeUppercase]: e === "large",
26
- // dark theme
27
- [r.rootThemeDark]: p === "dark"
28
- });
29
- return /* @__PURE__ */ o.jsxs(_, { className: l, ...c, children: [
30
- a,
31
- /* @__PURE__ */ o.jsx("span", { className: r.dash, "aria-hidden": "true", children: "ƒ" })
32
- ] });
33
- };
34
- export {
35
- b as DSTitle
36
- };