@stihl-design-system/components 1.0.0-RC.2 → 1.0.0-RC.3

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 (102) hide show
  1. package/README.md +1 -1
  2. package/assets/CustomReactSelect.BdwXfLLO.css +1 -0
  3. package/assets/RadioGroup.Ur8Ro-XL.css +1 -0
  4. package/assets/asterisk.C-o6rbGQ.css +1 -0
  5. package/assets/button.DJvR-58w.css +1 -0
  6. package/assets/buttonround.BlfQkmMV.css +1 -0
  7. package/assets/checkbox.BsFEWfQe.css +1 -0
  8. package/assets/fieldset.xazpUXJX.css +1 -0
  9. package/assets/heading.CGFucb-C.css +1 -0
  10. package/assets/input.BcP5kkZ2.css +1 -0
  11. package/assets/inputpassword.C3Uyj7oA.css +1 -0
  12. package/assets/inputsearch.tL3e9-Ob.css +1 -0
  13. package/assets/inputstepper.paPJix5A.css +1 -0
  14. package/assets/link.V7pJOW1p.css +1 -0
  15. package/assets/linkstandalone.D3RbBp23.css +1 -0
  16. package/assets/radio.CSHQGdpr.css +1 -0
  17. package/assets/select.D2qBxaHP.css +1 -0
  18. package/assets/switch.sqve8ApJ.css +1 -0
  19. package/assets/textarea.BKbocznb.css +1 -0
  20. package/assets/title.CE0Dm7PI.css +1 -0
  21. package/asterisk.DU8THnoC.js +8 -0
  22. package/button.BUUGRxIp.js +135 -0
  23. package/buttonround.CKc-a-hd.js +118 -0
  24. package/{checkbox.Bx5D_GAe.js → checkbox.C2Ga9yTK.js} +28 -28
  25. package/{checkboxgroup.gQwSHy4i.js → checkboxgroup.Cfxz9bk6.js} +3 -3
  26. package/chunks/{CustomReactSelect.Pvkkof1f.js → CustomReactSelect.uzWNynay.js} +222 -222
  27. package/chunks/RadioGroup.module.bi3leRes.js +11 -0
  28. package/chunks/whatsapp.CPpu-7Nn.js +10 -0
  29. package/{combobox.BOJ7aq_B.js → combobox.BXHAo4Wx.js} +1 -1
  30. package/components/CheckboxGroup/CheckboxGroup.d.ts +1 -1
  31. package/components/Fieldset/Fieldset.d.ts +1 -1
  32. package/components/Heading/Heading.utils.d.ts +1 -1
  33. package/components/Logo/Logo.d.ts +4 -2
  34. package/components/Logo/Logo.utils.d.ts +1 -0
  35. package/components/RadioGroup/RadioGroup.d.ts +1 -1
  36. package/customreactselect.CipgVXTR.js +13 -0
  37. package/fieldset.DGcIKzDI.js +98 -0
  38. package/{floatingactionbutton.BtQVIj6W.js → floatingactionbutton.DzHD39NY.js} +2 -2
  39. package/heading.DqGbFfj2.js +50 -0
  40. package/{icon.CmAhxgHK.js → icon.PX9_1kNB.js} +1 -1
  41. package/index.es.js +22 -22
  42. package/input.o8OT6rxJ.js +236 -0
  43. package/inputpassword.-MXq8baU.js +139 -0
  44. package/inputsearch.CoYTSjox.js +188 -0
  45. package/inputstepper.BBMQr6kM.js +290 -0
  46. package/link.BN6AZfhG.js +115 -0
  47. package/linkstandalone.4-fyRd08.js +79 -0
  48. package/{logo.DXWgPUY4.js → logo.C_oJ8isW.js} +25 -24
  49. package/{optioncheckbox.CYikfEsE.js → optioncheckbox.-DRnW_ch.js} +1 -1
  50. package/package.json +2 -2
  51. package/radio.Bhu9OUY-.js +79 -0
  52. package/{radiogroup.7ptQiohb.js → radiogroup.oILRMrX-.js} +3 -3
  53. package/select.OGcreXnT.js +190 -0
  54. package/{spinner.CSzQEBx2.js → spinner.Diy_EeFY.js} +1 -1
  55. package/styles/scss/lib/_grid-extended.scss +2 -2
  56. package/styles/scss/lib/_grid-sidebar-sidebar.scss +2 -2
  57. package/styles/scss/lib/_grid-sidebar.scss +6 -6
  58. package/styles/scss/lib/_heading.scss +14 -1
  59. package/styles/scss/lib/_link.scss +9 -9
  60. package/styles/scss/lib/_text.scss +4 -0
  61. package/switch.BjoFKMQC.js +65 -0
  62. package/{systemfeedback.rBgdiL5T.js → systemfeedback.C7iXO5A1.js} +1 -1
  63. package/textarea.kc_Sfbgr.js +193 -0
  64. package/title.icX0VDiO.js +36 -0
  65. package/types/icon-types.d.ts +1 -1
  66. package/assets/CustomReactSelect.bVnR5yBP.css +0 -1
  67. package/assets/RadioGroup.SF2fv4CL.css +0 -1
  68. package/assets/asterisk.Bz7RZnKb.css +0 -1
  69. package/assets/button.C6ZbQtZ-.css +0 -1
  70. package/assets/buttonround.CjJUeMND.css +0 -1
  71. package/assets/checkbox.Bbc6PYDK.css +0 -1
  72. package/assets/fieldset.DTFs_koU.css +0 -1
  73. package/assets/heading.5HpYs7wS.css +0 -1
  74. package/assets/input.GpXQJqEO.css +0 -1
  75. package/assets/inputpassword.B9J1hCcj.css +0 -1
  76. package/assets/inputsearch.BY0BGFPK.css +0 -1
  77. package/assets/inputstepper.B0oC1URa.css +0 -1
  78. package/assets/link.Di4qXro5.css +0 -1
  79. package/assets/linkstandalone.239FeO2E.css +0 -1
  80. package/assets/radio.pqc9u_wx.css +0 -1
  81. package/assets/select.DLOQ6wu0.css +0 -1
  82. package/assets/switch.DVlaePGM.css +0 -1
  83. package/assets/textarea.BNOpd7Nf.css +0 -1
  84. package/assets/title.1dq1eWy9.css +0 -1
  85. package/asterisk.BlYjsfkN.js +0 -8
  86. package/button.Di5XtChf.js +0 -135
  87. package/buttonround._w4KDbHE.js +0 -118
  88. package/chunks/RadioGroup.module.B35YQcsb.js +0 -11
  89. package/customreactselect.DPHXAssl.js +0 -13
  90. package/fieldset.yE6WV6Ls.js +0 -98
  91. package/heading.C6k7Gakb.js +0 -44
  92. package/input.vP5xcwzV.js +0 -236
  93. package/inputpassword.BiQ8ORmn.js +0 -139
  94. package/inputsearch.BA9N3RRc.js +0 -188
  95. package/inputstepper.Cyxeg2Cj.js +0 -290
  96. package/link.BoSdsZHj.js +0 -115
  97. package/linkstandalone.BoN7nARO.js +0 -79
  98. package/radio.DTO5-Yzf.js +0 -79
  99. package/select.Dx80W7cW.js +0 -190
  100. package/switch.BwGtQdnx.js +0 -65
  101. package/textarea.C8tp1ciU.js +0 -193
  102. package/title.BT-uIobN.js +0 -36
@@ -0,0 +1,190 @@
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,7 +1,7 @@
1
1
  "use client";
2
2
  import { j as t } from "./chunks/jsx-runtime.C-kxDJ4g.js";
3
3
  import { c as n } from "./chunks/index.CvOaL64Y.js";
4
- import { DSIcon as _ } from "./icon.CmAhxgHK.js";
4
+ import { DSIcon as _ } from "./icon.PX9_1kNB.js";
5
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
6
  root: m,
7
7
  "root-size-small": "_root-size-small_1xfbe_69",
@@ -5,7 +5,7 @@ $ds-grid-extended-column-end: extended-end;
5
5
  grid-column: $ds-grid-extended-column-start / $ds-grid-extended-column-end;
6
6
 
7
7
  @media (min-width: 1668px) {
8
- margin-left: -32px;
9
- margin-right: -32px;
8
+ margin-inline-start: -32px;
9
+ margin-inline-end: -32px;
10
10
  }
11
11
  }
@@ -39,10 +39,10 @@ $ds-grid-sidebar-sidebar-2-column-end: sidebar-2-end;
39
39
  display: unset;
40
40
  width: 320px;
41
41
  max-width: 320px;
42
- margin-left: -24px;
42
+ margin-inline-start: -24px;
43
43
  }
44
44
  }
45
45
  @media (min-width: 1535px) {
46
- margin-left: -32px;
46
+ margin-inline-start: -32px;
47
47
  }
48
48
  }
@@ -60,11 +60,11 @@
60
60
  --ds-grid-sidebar-gap: 0px;
61
61
  gap: var(--ds-grid-sidebar-gap);
62
62
  column-gap: 24px;
63
- // The children get a margin-bottom to imitate row-gap behavior
63
+ // The children get a margin-block-end to imitate row-gap behavior
64
64
  // This is counteracted for the last row in the parent
65
- margin-bottom: -24px;
65
+ margin-block-end: -24px;
66
66
  & > * {
67
- margin-bottom: 24px;
67
+ margin-block-end: 24px;
68
68
  }
69
69
  @if $is-sidebar-1-open == false {
70
70
  grid-template-columns:
@@ -106,11 +106,11 @@
106
106
 
107
107
  @include ds-media-query-min('xl') {
108
108
  column-gap: 32px;
109
- // The children get a margin-bottom to imitate row-gap behavior
109
+ // The children get a margin-block-end to imitate row-gap behavior
110
110
  // This is counteracted for the last row in the parent
111
- margin-bottom: -32px;
111
+ margin-block-end: -32px;
112
112
  & > * {
113
- margin-bottom: 32px;
113
+ margin-block-end: 32px;
114
114
  }
115
115
 
116
116
  @if $is-sidebar-1-open == false {
@@ -18,7 +18,13 @@
18
18
  }
19
19
 
20
20
  // Mixins for specific heading sizes
21
+ // XL
21
22
  @mixin ds-heading-x-large {
23
+ @include base-heading('STIHL Contraface Digital Text Bold', 1.625rem, 1.2);
24
+ @include responsive-heading('l', 1.875rem, 1.25);
25
+ }
26
+
27
+ @mixin ds-heading-x-large-uppercase {
22
28
  @include base-heading(
23
29
  'STIHL Contraface Digital Display Title',
24
30
  1.625rem,
@@ -27,7 +33,13 @@
27
33
  @include responsive-heading('l', 1.875rem, 1.25);
28
34
  }
29
35
 
36
+ // Large
30
37
  @mixin ds-heading-large {
38
+ @include base-heading('STIHL Contraface Digital Text Bold', 1.375rem, 1.25);
39
+ @include responsive-heading('l', 1.625rem, 1.2);
40
+ }
41
+
42
+ @mixin ds-heading-large-uppercase {
31
43
  @include base-heading(
32
44
  'STIHL Contraface Digital Display Title',
33
45
  1.375rem,
@@ -36,6 +48,7 @@
36
48
  @include responsive-heading('l', 1.625rem, 1.2);
37
49
  }
38
50
 
51
+ // Medium
39
52
  @mixin ds-heading-medium {
40
53
  @include base-heading('STIHL Contraface Digital Text Bold', 1.25rem, 1.2);
41
54
  }
@@ -44,10 +57,10 @@
44
57
  @include base-heading('STIHL Contraface Digital Display Title', 1.25rem, 1.2);
45
58
  }
46
59
 
60
+ // Small
47
61
  @mixin ds-heading-small {
48
62
  @include base-heading('STIHL Contraface Digital Text Bold', 1rem, 1.5);
49
63
  }
50
-
51
64
  @mixin ds-heading-small-uppercase {
52
65
  @include base-heading('STIHL Contraface Digital Display Title', 1rem, 1.5);
53
66
  }
@@ -101,10 +101,10 @@
101
101
  @include link-underline;
102
102
 
103
103
  display: inline;
104
- padding-right: $ds-spacing-2;
105
- padding-left: $ds-spacing-2;
106
- padding-top: 0;
107
- padding-bottom: 0;
104
+ padding-inline-end: $ds-spacing-2;
105
+ padding-inline-start: $ds-spacing-2;
106
+ padding-block-start: 0;
107
+ padding-block-end: 0;
108
108
  line-height: inherit;
109
109
  font-size: inherit;
110
110
 
@@ -115,7 +115,7 @@
115
115
  :where(&)[href^="https://"]::after,
116
116
  :where(&)[href^='#']::after {
117
117
  display: inline-block;
118
- margin-left: 0.375em;
118
+ margin-inline-start: 0.375em;
119
119
  width: 0.75em;
120
120
  height: 0.75em;
121
121
  }
@@ -136,10 +136,10 @@
136
136
  display: inline-flex;
137
137
  align-items: center;
138
138
  gap: $ds-spacing-6;
139
- padding-right: $ds-spacing-4;
140
- padding-left: $ds-spacing-4;
141
- padding-top: $ds-spacing-2;
142
- padding-bottom: $ds-spacing-2;
139
+ padding-inline-end: $ds-spacing-4;
140
+ padding-inline-start: $ds-spacing-4;
141
+ padding-block-start: $ds-spacing-2;
142
+ padding-block-end: $ds-spacing-2;
143
143
  // Set color to transparent instead of text-decoration: none to support forced colors link decoration
144
144
  text-decoration-color: transparent;
145
145
 
@@ -61,3 +61,7 @@
61
61
  @mixin ds-utility-small {
62
62
  @include base-text('STIHL Contraface Digital Text Regular', 0.875rem, 1.14);
63
63
  }
64
+
65
+ @mixin ds-utility-small-bold {
66
+ @include base-text('STIHL Contraface Digital Text Bold', 0.875rem, 1.14);
67
+ }
@@ -0,0 +1,65 @@
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
+ };
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { j as o } from "./chunks/jsx-runtime.C-kxDJ4g.js";
3
3
  import { c } from "./chunks/index.CvOaL64Y.js";
4
- import { DSIcon as n } from "./icon.CmAhxgHK.js";
4
+ import { DSIcon as n } from "./icon.PX9_1kNB.js";
5
5
  import './assets/systemfeedback.WE3wClZ3.css';const i = "_root_18s1i_63", l = {
6
6
  root: i
7
7
  }, m = {
@@ -0,0 +1,193 @@
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
+ };
@@ -0,0 +1,36 @@
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
+ };
@@ -1,2 +1,2 @@
1
- export declare const ICON_NAMES: readonly ["360", "academic-cap", "alarm-clock", "arrow-clockwise", "arrow-counterclockwise", "arrow-down", "arrow-down-line", "arrow-edge", "arrow-left", "arrow-out", "arrow-outline-left", "arrow-right", "arrow-up", "arrow-up-arrow-down", "at", "barcode-scanner", "battery", "bell", "bin", "bin-open", "bluetooth", "bookmark", "burger", "calendar", "camera", "cart", "cart-check", "cart-plus", "catalog", "certificate", "chain-link", "chainsaw", "check", "chevron-down", "chevron-left", "chevron-line-left", "chevron-line-right", "chevron-right", "chevron-up", "circle", "circle-check-colored", "circle-check-inverted", "circle-info-colored", "circle-info-inverted", "circle-pause", "circle-stroke", "clock", "coffee-cup", "compare", "connected-box", "connected-box-mobile", "connected-box-stationary", "cross", "diamond", "diamond-exclamationmark-colored", "diamond-exclamationmark-inverted", "diskette", "distance", "dots-connected", "download-complete", "envelope", "envelope-open", "exclamationmark", "exit", "eye", "eye-closed", "facebook", "filter", "finger-double-arrow", "flash", "fullscreen", "gear", "globe", "grid", "guidance", "haircross", "hanger", "headphones", "heart", "hexagon-arrow-clockwise", "horizontal-ellipsis", "house", "imow", "info", "instagram", "leave-fullscreen", "lightbulb", "linkedin", "list-three-rows", "list-two-rows", "loading-spinner", "lock", "magnifying-glass", "magnifying-glass-minus", "magnifying-glass-plus", "map", "minus", "mobile", "nine-squares", "note", "note-check", "note-plus", "number-input", "paperclip", "parcel", "pause", "pdf", "pen", "percent", "petrol", "phone", "pin", "pin-s", "pinterest", "placeholder", "play", "plug", "plus", "printer", "prohibition-sign", "questionmark", "security", "share", "shirt", "shop", "sound-off", "sound-on", "speechbubble", "speechbubbles", "square", "star", "star-half", "tag", "thumbs-down", "thumbs-up", "triangle", "triangle-exclamationmark-colored", "triangle-exclamationmark-inverted", "truck", "two-people-screen", "two-sheets", "upload", "user", "vertical-ellipsis", "wc", "wifi", "wifi-1bar", "wifi-2bars", "wifi-off", "wind-rose", "wrench", "x", "xing", "youtube"];
1
+ export declare const ICON_NAMES: readonly ["360", "academic-cap", "alarm-clock", "arrow-clockwise", "arrow-counterclockwise", "arrow-down", "arrow-down-line", "arrow-edge", "arrow-left", "arrow-out", "arrow-outline-left", "arrow-right", "arrow-up", "arrow-up-arrow-down", "at", "barcode-scanner", "battery", "bell", "bin", "bin-open", "bluetooth", "bookmark", "burger", "calendar", "camera", "cart", "cart-check", "cart-plus", "catalog", "certificate", "chain-link", "chainsaw", "check", "chevron-down", "chevron-left", "chevron-line-left", "chevron-line-right", "chevron-right", "chevron-up", "circle", "circle-check-colored", "circle-check-inverted", "circle-info-colored", "circle-info-inverted", "circle-pause", "circle-stroke", "clock", "coffee-cup", "compare", "connected-box", "connected-box-mobile", "connected-box-stationary", "cross", "diamond", "diamond-exclamationmark-colored", "diamond-exclamationmark-inverted", "diskette", "distance", "dots-connected", "download-complete", "envelope", "envelope-open", "exclamationmark", "exit", "eye", "eye-closed", "facebook", "filter", "finger-double-arrow", "flash", "fullscreen", "gear", "globe", "grid", "guidance", "haircross", "hanger", "headphones", "heart", "hexagon-arrow-clockwise", "horizontal-ellipsis", "house", "imow", "info", "instagram", "leave-fullscreen", "lightbulb", "linkedin", "list-three-rows", "list-two-rows", "loading-spinner", "lock", "magnifying-glass", "magnifying-glass-minus", "magnifying-glass-plus", "map", "minus", "mobile", "nine-squares", "note", "note-check", "note-plus", "number-input", "paperclip", "parcel", "pause", "pdf", "pen", "percent", "petrol", "phone", "pin", "pin-s", "pinterest", "placeholder", "play", "plug", "plus", "printer", "prohibition-sign", "questionmark", "security", "share", "shirt", "shop", "sound-off", "sound-on", "speechbubble", "speechbubbles", "square", "star", "star-half", "tag", "thumbs-down", "thumbs-up", "triangle", "triangle-exclamationmark-colored", "triangle-exclamationmark-inverted", "truck", "two-people-screen", "two-sheets", "upload", "user", "vertical-ellipsis", "wc", "whatsapp", "wifi", "wifi-1bar", "wifi-2bars", "wifi-off", "wind-rose", "wrench", "x", "xing", "youtube"];
2
2
  export type IconName = typeof ICON_NAMES[number];