@stihl-design-system/components 1.0.0-RC.11 → 1.0.0-RC.13

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 (225) hide show
  1. package/README.md +1 -1
  2. package/{accordion.CEKQh-7i.js → accordion.Rvtiu8Y4.js} +3 -3
  3. package/arialiveregions.Cyycgs8g.js +27 -0
  4. package/assets/Accordion.i4k5SMQM.css +1 -0
  5. package/assets/CheckboxGroup.BH1Br1dg.css +1 -0
  6. package/assets/Chip.DSdLuzoi.css +1 -0
  7. package/assets/CustomReactSelect.vHt8qNKC.css +1 -0
  8. package/assets/Dialog.BgzebVk4.css +1 -0
  9. package/assets/Drawer.Bauwxrk7.css +1 -0
  10. package/assets/Fieldset.DOdTbb7C.css +1 -0
  11. package/assets/Icon.DxRSBRSL.css +1 -0
  12. package/assets/InputPassword.CG7Ugu73.css +1 -0
  13. package/assets/InputSearch.CseChMc-.css +1 -0
  14. package/assets/InputStepper.C0eAYr7P.css +1 -0
  15. package/assets/Notification.DbRapUJo.css +1 -0
  16. package/assets/RadioGroup.BfMo157q.css +1 -0
  17. package/assets/Select.D4EXgIbz.css +1 -0
  18. package/assets/Textarea.KJGPTYMz.css +1 -0
  19. package/assets/Toast.CuafTAf7.css +1 -0
  20. package/assets/arialiveregions.DhsijBaL.css +1 -0
  21. package/assets/asterisk.BfVAUBO7.css +1 -0
  22. package/assets/button.DF4RBeC2.css +1 -0
  23. package/assets/buttonround.19uK_-oO.css +1 -0
  24. package/assets/checkbox.ByOoFouu.css +1 -0
  25. package/assets/chipgroup.BzfZLbkv.css +1 -0
  26. package/assets/flag.B-RLcMcf.css +1 -0
  27. package/assets/floatingactionbutton.E9HekT6S.css +1 -0
  28. package/assets/heading.u4f8Mz94.css +1 -0
  29. package/assets/input.BAkFKPW3.css +1 -0
  30. package/assets/link.DDJj0D1U.css +1 -0
  31. package/assets/linkstandalone.DIazcjIv.css +1 -0
  32. package/assets/logo.CnW8alZU.css +1 -0
  33. package/assets/optioncheckbox.BZaWtRD7.css +1 -0
  34. package/assets/radio.X-RTl_jo.css +1 -0
  35. package/assets/skiptocontent.PTL3256m.css +1 -0
  36. package/assets/spinner.2iWJWKyA.css +1 -0
  37. package/assets/switch.gw6aa3kx.css +1 -0
  38. package/assets/systemfeedback.BPz5YlPC.css +1 -0
  39. package/assets/text.DjTG_qNb.css +1 -0
  40. package/assets/title.rosWPEG3.css +1 -0
  41. package/asterisk.DpzETKdT.js +8 -0
  42. package/button.M4nXjcUn.js +135 -0
  43. package/buttonround.E56F_805.js +118 -0
  44. package/checkbox.Cb2_ey6U.js +111 -0
  45. package/{checkboxgroup.BqD5IV51.js → checkboxgroup.DBDmB-zR.js} +2 -2
  46. package/{chip.B92ew-hk.js → chip.C_1tGqvZ.js} +2 -2
  47. package/chipgroup.BvTj1ziW.js +174 -0
  48. package/chunks/Accordion.CB6jB3s_.js +125 -0
  49. package/chunks/{CheckboxGroup.M3jOjhNf.js → CheckboxGroup.S6i5EOc4.js} +40 -40
  50. package/chunks/{Chip.fMG8wi5K.js → Chip.CMlPUyOJ.js} +15 -15
  51. package/chunks/{CustomReactSelect.D3jv5-fa.js → CustomReactSelect.CQ1uexBH.js} +1321 -1321
  52. package/chunks/Dialog.CudsqNag.js +148 -0
  53. package/chunks/Drawer.ueG2Bzr9.js +154 -0
  54. package/chunks/{Fieldset.C9K8BYmH.js → Fieldset.Cjmkgxxk.js} +32 -32
  55. package/chunks/{Icon.C2o2seDb.js → Icon.BCmt_XBG.js} +45 -45
  56. package/chunks/InputPassword.CNLbBFjx.js +143 -0
  57. package/chunks/InputSearch.CHA6mkX_.js +192 -0
  58. package/chunks/InputStepper.xmWGU9pU.js +294 -0
  59. package/chunks/Notification.nx5vTamN.js +92 -0
  60. package/chunks/RadioGroup.Crj7NoOs.js +137 -0
  61. package/chunks/Select.E6gLFYLk.js +194 -0
  62. package/chunks/Textarea.DUBSOpNL.js +198 -0
  63. package/chunks/Toast.DyEi2GEP.js +89 -0
  64. package/{combobox.BeTnbG1m.js → combobox.CzBpi97e.js} +1 -1
  65. package/components/Combobox/Combobox.d.ts +1 -1
  66. package/components/{CustomReactSelect → Combobox/CustomReactSelect}/CustomReactSelect.d.ts +2 -2
  67. package/components/{CustomReactSelect → Combobox/CustomReactSelect}/CustomReactSelect.utils.d.ts +1 -1
  68. package/components/Notification/Notification.d.ts +2 -6
  69. package/components/Radio/Radio.d.ts +1 -1
  70. package/customreactselect.d.ts +1 -1
  71. package/customreactselect.qf7CIeFs.js +13 -0
  72. package/{dialog.lGwNQU91.js → dialog.DYlBUsOD.js} +2 -2
  73. package/{drawer.DNi5m8wP.js → drawer.CvhbP1ra.js} +2 -2
  74. package/fieldset.CtUGEdLv.js +11 -0
  75. package/flag.BKpsdB_-.js +43 -0
  76. package/floatingactionbutton.D5L0B7zI.js +87 -0
  77. package/heading.IPIYc5vW.js +50 -0
  78. package/{icon.BoMgOmC1.js → icon.Ck0BpI34.js} +1 -1
  79. package/index.es.js +34 -34
  80. package/input.BEnCFNM-.js +239 -0
  81. package/{inputpassword.CSjh1GU7.js → inputpassword.B-D_jB9w.js} +4 -4
  82. package/{inputsearch.DyznOWLK.js → inputsearch.CaSpklR1.js} +4 -4
  83. package/{inputstepper.3BLb7s0P.js → inputstepper.C7KD1-0S.js} +4 -4
  84. package/link.DREJAoPG.js +116 -0
  85. package/linkstandalone.BBoEniZ_.js +79 -0
  86. package/logo.Hul8qCFo.js +65 -0
  87. package/{notification.0kX1GMaB.js → notification.6M0OdGXK.js} +3 -3
  88. package/optioncheckbox.BRUTnQnJ.js +43 -0
  89. package/optioncheckbox.d.ts +1 -1
  90. package/package.json +8 -6
  91. package/partials/index.js +1 -1
  92. package/radio.DEILy_lV.js +114 -0
  93. package/{radiogroup.SYkZm2DG.js → radiogroup.DeU-HdlP.js} +3 -3
  94. package/{select.CYbwR3RW.js → select.BYraFJzz.js} +4 -4
  95. package/skiptocontent.BxvpIB7H.js +45 -0
  96. package/spinner.Bq97Og-6.js +58 -0
  97. package/styles/scss/ds/index.scss +19 -0
  98. package/styles/scss/ds/lib/animation.scss +21 -0
  99. package/styles/scss/ds/lib/breakpoints.scss +15 -0
  100. package/styles/scss/ds/lib/container-query.scss +54 -0
  101. package/styles/scss/ds/lib/ds-internal/_a11y.scss +15 -0
  102. package/styles/scss/{lib → ds/lib/ds-internal}/_focus.scss +13 -15
  103. package/styles/scss/ds/lib/ds-internal/_heading.scss +37 -0
  104. package/styles/scss/ds/lib/ds-internal/_helpers.scss +32 -0
  105. package/styles/scss/ds/lib/ds-internal/_high-contrast.scss +6 -0
  106. package/styles/scss/ds/lib/ds-internal/_hover.scss +6 -0
  107. package/styles/scss/ds/lib/ds-internal/_index.scss +9 -0
  108. package/styles/scss/ds/lib/ds-internal/_link.scss +62 -0
  109. package/styles/scss/ds/lib/ds-internal/_spacing-dynamic.scss +53 -0
  110. package/styles/scss/ds/lib/ds-internal/_text.scss +30 -0
  111. package/styles/scss/ds/lib/grid-extended.scss +11 -0
  112. package/styles/scss/ds/lib/grid-full.scss +6 -0
  113. package/styles/scss/ds/lib/grid-main.scss +119 -0
  114. package/styles/scss/ds/lib/grid-narrow.scss +14 -0
  115. package/styles/scss/ds/lib/grid-sidebar-sidebar.scss +52 -0
  116. package/styles/scss/{lib/_grid-sidebar.scss → ds/lib/grid-sidebar.scss} +23 -32
  117. package/styles/scss/{lib/_grid.scss → ds/lib/grid.scss} +15 -17
  118. package/styles/scss/ds/lib/heading.scss +75 -0
  119. package/styles/scss/ds/lib/link.scss +74 -0
  120. package/styles/scss/ds/lib/media-query.scss +32 -0
  121. package/styles/scss/{lib/_shadow.scss → ds/lib/shadow.scss} +2 -2
  122. package/styles/scss/ds/lib/spacing-dynamic.scss +7 -0
  123. package/styles/scss/ds/lib/spacing.scss +20 -0
  124. package/styles/scss/ds/lib/text.scss +83 -0
  125. package/styles/scss/ds/lib/theme.scss +162 -0
  126. package/styles/scss/ds/lib/transition.scss +36 -0
  127. package/switch.DI8YYa5G.js +65 -0
  128. package/{systemfeedback.ZzRUAVYX.js → systemfeedback.C3Pfxxpp.js} +6 -6
  129. package/text.DThvTwm8.js +57 -0
  130. package/{textarea.DJc527nX.js → textarea.CBvH0ljM.js} +3 -3
  131. package/title.DqzdB2Gq.js +36 -0
  132. package/{toast.D48GFmp0.js → toast.n1QUINSA.js} +3 -3
  133. package/{toastmanager.Dl8-Q3ED.js → toastmanager.B7EZ4JSI.js} +1 -1
  134. package/arialiveregions.BKpxxK7O.js +0 -27
  135. package/assets/Accordion.DMEFgtQm.css +0 -1
  136. package/assets/CheckboxGroup.Bz3_xkZU.css +0 -1
  137. package/assets/Chip.D10_7Q82.css +0 -1
  138. package/assets/CustomReactSelect.D5XKd9vg.css +0 -1
  139. package/assets/Dialog.B0pucIEI.css +0 -1
  140. package/assets/Drawer.CATBzfY7.css +0 -1
  141. package/assets/Fieldset.CwDhKRUL.css +0 -1
  142. package/assets/Icon.Duy_0R8w.css +0 -1
  143. package/assets/InputPassword.DOAAzj-O.css +0 -1
  144. package/assets/InputSearch.CxPYaQGZ.css +0 -1
  145. package/assets/InputStepper.CYYJUu0b.css +0 -1
  146. package/assets/Notification.mhVFeSGm.css +0 -1
  147. package/assets/Select.DZKpHV4G.css +0 -1
  148. package/assets/Textarea.Cp0b7oZp.css +0 -1
  149. package/assets/Toast.Cz6wYaBv.css +0 -1
  150. package/assets/arialiveregions.GsGx2USO.css +0 -1
  151. package/assets/asterisk.DlJ4YtSZ.css +0 -1
  152. package/assets/button.C9_ejpGG.css +0 -1
  153. package/assets/buttonround.DTCqRP-0.css +0 -1
  154. package/assets/checkbox.K4CVYK9g.css +0 -1
  155. package/assets/chipgroup.BMovtKTy.css +0 -1
  156. package/assets/flag.DX_lH1v7.css +0 -1
  157. package/assets/floatingactionbutton.Do-yEH6c.css +0 -1
  158. package/assets/heading.6bER-Eac.css +0 -1
  159. package/assets/input.Q5oKkmW2.css +0 -1
  160. package/assets/link.DhZqkLMP.css +0 -1
  161. package/assets/linkstandalone.Dwz-_O8q.css +0 -1
  162. package/assets/logo.pETQEsvZ.css +0 -1
  163. package/assets/optioncheckbox.C62HtIj5.css +0 -1
  164. package/assets/radio.-Xxx5wL4.css +0 -1
  165. package/assets/skiptocontent.CHcqLS7S.css +0 -1
  166. package/assets/spinner.D_Nnf1ZG.css +0 -1
  167. package/assets/switch.C1Ei0-z8.css +0 -1
  168. package/assets/systemfeedback.Sq0bAIyf.css +0 -1
  169. package/assets/text.DxKFcfY6.css +0 -1
  170. package/assets/title.f74Bosn-.css +0 -1
  171. package/asterisk.DDn-yX4P.js +0 -8
  172. package/button.C5opEJ6x.js +0 -135
  173. package/buttonround.CUoqRyy0.js +0 -118
  174. package/checkbox.DETR3e3X.js +0 -112
  175. package/chipgroup.BJrqEfvr.js +0 -175
  176. package/chunks/Accordion.DFwFN8mX.js +0 -125
  177. package/chunks/Dialog.Fwr6vLiK.js +0 -148
  178. package/chunks/Drawer.CKoYzQHd.js +0 -154
  179. package/chunks/InputPassword.C7pNeWGx.js +0 -143
  180. package/chunks/InputSearch.B24rcIJ_.js +0 -192
  181. package/chunks/InputStepper.CEW-bieQ.js +0 -294
  182. package/chunks/Notification.BXVN7_Fs.js +0 -93
  183. package/chunks/RadioGroup.D4UOflwr.js +0 -137
  184. package/chunks/Select.Ds86q4UC.js +0 -194
  185. package/chunks/Textarea.DcB8hKnO.js +0 -198
  186. package/chunks/Toast.DrzxdzVW.js +0 -89
  187. package/customreactselect.lYJhIeyx.js +0 -13
  188. package/fieldset.BqiAjeax.js +0 -11
  189. package/flag.XJHHSP38.js +0 -43
  190. package/floatingactionbutton.CMpkTdhX.js +0 -87
  191. package/heading.CAkraI2D.js +0 -50
  192. package/input.v7qB7wPJ.js +0 -239
  193. package/link.Clk5_BYp.js +0 -116
  194. package/linkstandalone.BXERmqdN.js +0 -80
  195. package/logo.CEO6OV7u.js +0 -65
  196. package/optioncheckbox.BPN3f6l_.js +0 -43
  197. package/radio.DTZNJzMU.js +0 -115
  198. package/skiptocontent.DUQWopO4.js +0 -46
  199. package/spinner.D-xrotcu.js +0 -58
  200. package/styles/scss/_index.scss +0 -24
  201. package/styles/scss/lib/_a11y.scss +0 -15
  202. package/styles/scss/lib/_animation.scss +0 -21
  203. package/styles/scss/lib/_breakpoints.scss +0 -15
  204. package/styles/scss/lib/_container-query.scss +0 -58
  205. package/styles/scss/lib/_grid-extended.scss +0 -11
  206. package/styles/scss/lib/_grid-full.scss +0 -6
  207. package/styles/scss/lib/_grid-main.scss +0 -117
  208. package/styles/scss/lib/_grid-narrow.scss +0 -16
  209. package/styles/scss/lib/_grid-sidebar-sidebar.scss +0 -50
  210. package/styles/scss/lib/_heading.scss +0 -107
  211. package/styles/scss/lib/_helpers.scss +0 -15
  212. package/styles/scss/lib/_high-contrast.scss +0 -24
  213. package/styles/scss/lib/_hover.scss +0 -10
  214. package/styles/scss/lib/_link.scss +0 -129
  215. package/styles/scss/lib/_media-query.scss +0 -32
  216. package/styles/scss/lib/_spacing-dynamic.scss +0 -61
  217. package/styles/scss/lib/_spacing.scss +0 -32
  218. package/styles/scss/lib/_text.scss +0 -110
  219. package/styles/scss/lib/_theme.scss +0 -162
  220. package/styles/scss/lib/_transition.scss +0 -45
  221. package/switch.CoNnIhM4.js +0 -65
  222. package/text.fMcHzVbH.js +0 -57
  223. package/title.LY1ylQsb.js +0 -36
  224. /package/components/{CustomReactSelect → Combobox/CustomReactSelect}/CustomReactSelect.utils.test.d.ts +0 -0
  225. /package/components/{CustomReactSelect → Combobox/CustomReactSelect}/OptionCheckbox.d.ts +0 -0
@@ -1,192 +0,0 @@
1
- "use client";
2
- import { j as e } from "./jsx-runtime.C115EyI4.js";
3
- import { c as l } from "./index.CvOaL64Y.js";
4
- import { useState as J, useRef as N, useEffect as w } from "react";
5
- import { g as y, a as K } from "./helpers.B1JT5ShS.js";
6
- import { u as Q } from "./useBreakpoint.5xBNDiCf.js";
7
- import { Asterisk as U } from "../asterisk.DDn-yX4P.js";
8
- import { DSButton as A } from "../button.C5opEJ6x.js";
9
- import { DSSystemFeedback as X } from "../systemfeedback.ZzRUAVYX.js";
10
- import '../assets/InputSearch.CxPYaQGZ.css';const Y = "_input_eh22y_226", Z = "_input--invalid_eh22y_343", z = "_input--small_eh22y_350", tt = "_input--has-leading-icon_eh22y_404", nt = "_input--has-action-button_eh22y_407", et = "_input--has-second-action-button_eh22y_410", at = "_input--has-affix_eh22y_422", st = "_input--is-ready_eh22y_436", ot = "_root_eh22y_443", it = "_hint_eh22y_451", ct = "_label_eh22y_451", lt = "_wrapper_eh22y_455", ut = "_action-button_eh22y_461", rt = "_second-action-button_eh22y_465", pt = "_label--hidden_eh22y_484", ht = "_label--disabled_eh22y_497", _t = "_feedback_eh22y_518", t = {
11
- input: Y,
12
- "input--invalid": "_input--invalid_eh22y_343",
13
- inputInvalid: Z,
14
- "input--small": "_input--small_eh22y_350",
15
- inputSmall: z,
16
- "input--has-leading-icon": "_input--has-leading-icon_eh22y_404",
17
- inputHasLeadingIcon: tt,
18
- "input--has-action-button": "_input--has-action-button_eh22y_407",
19
- inputHasActionButton: nt,
20
- "input--has-second-action-button": "_input--has-second-action-button_eh22y_410",
21
- inputHasSecondActionButton: et,
22
- "input--has-affix": "_input--has-affix_eh22y_422",
23
- inputHasAffix: at,
24
- "input--is-ready": "_input--is-ready_eh22y_436",
25
- inputIsReady: st,
26
- root: ot,
27
- hint: it,
28
- label: ct,
29
- wrapper: lt,
30
- "action-button": "_action-button_eh22y_461",
31
- actionButton: ut,
32
- "second-action-button": "_second-action-button_eh22y_465",
33
- secondActionButton: rt,
34
- "label--hidden": "_label--hidden_eh22y_484",
35
- labelHidden: pt,
36
- "label--disabled": "_label--disabled_eh22y_497",
37
- labelDisabled: ht,
38
- feedback: _t
39
- }, dt = ({ id: n, label: u }) => {
40
- if (!n)
41
- throw new Error(
42
- y(
43
- "DSInputSearch",
44
- 'A unique "id" prop is required. Please add an unique "id" prop to the DSInputSearch component.'
45
- )
46
- );
47
- if (!u)
48
- throw new Error(
49
- y(
50
- "DSInputSearch",
51
- `A label is always required for a11y reasons. Please add a descriptive "label" prop to the DSInputSearch component. If you don't want to display a label, set hideLabel={true}.`
52
- )
53
- );
54
- }, bt = (n) => !!K(n, "form"), Dt = ({
55
- id: n,
56
- label: u,
57
- className: H,
58
- clearButtonLabel: E = "Clear search field",
59
- disabled: s = !1,
60
- hint: d,
61
- hideLabel: j = !1,
62
- invalid: r = !1,
63
- readonly: o = !1,
64
- required: S = !1,
65
- size: i = "medium",
66
- submitButtonLabel: C = "Search",
67
- systemFeedback: b,
68
- value: m,
69
- submitButtonOnClick: k,
70
- onChange: I,
71
- ...L
72
- }) => {
73
- process.env.NODE_ENV !== "production" && dt({
74
- id: n,
75
- label: u
76
- });
77
- const [p, g] = J(m), f = N(null), h = N(null), V = Q(j);
78
- w(() => {
79
- g(m);
80
- }, [m]), w(() => {
81
- f.current && !bt(f.current) && process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "test" && console.warn(
82
- y(
83
- "DSInputSearch",
84
- `The DSInputSearch component with the id "${n}" is not within a form element. This may cause issues with form submission. Please ensure the DSInputSearch component is within a form element.`
85
- )
86
- );
87
- }, []);
88
- const v = `${n}-label`, B = `${n}-feedback`, D = `${n}-hint`, O = d ? ` ${D}` : "", x = p !== "" && p !== void 0 && p !== null, P = l(t.root, H), $ = l(t.input, {
89
- // small input
90
- [t.inputSmall]: i === "small",
91
- // invalid state
92
- [t.inputInvalid]: r,
93
- // action button - input password always has an action button
94
- [t.inputHasActionButton]: !0,
95
- // action second action button
96
- [t.inputHasSecondActionButton]: x && !o && !s
97
- }), R = l(t.label, {
98
- // hide label only visually to keep them available for assistive technologies
99
- [t.labelHidden]: V,
100
- [t.labelDisabled]: s
101
- }), q = l(t.actionButton, {
102
- [t.actionButtonSmall]: i === "small"
103
- }), T = l(t.secondActionButton, {
104
- [t.secondActionButtonSmall]: i === "small"
105
- }), F = (a, c) => {
106
- const G = Object.getPrototypeOf(a), _ = Object.getOwnPropertyDescriptor(
107
- G,
108
- "value"
109
- );
110
- _ != null && _.set ? _.set.call(a, c) : a.value = c;
111
- }, M = () => {
112
- var c;
113
- if (!h.current) return;
114
- F(h.current, "");
115
- const a = new Event("change", { bubbles: !0 });
116
- (c = h.current) == null || c.dispatchEvent(a);
117
- }, W = (a) => {
118
- g(a.target.value), I && I(a);
119
- };
120
- return /* @__PURE__ */ e.jsxs("div", { className: P, ref: f, children: [
121
- /* @__PURE__ */ e.jsxs("label", { className: R, id: v, htmlFor: n, children: [
122
- u,
123
- S && /* @__PURE__ */ e.jsx(U, {})
124
- ] }),
125
- d && /* @__PURE__ */ e.jsx("div", { className: t.hint, id: D, children: d }),
126
- r && b && /* @__PURE__ */ e.jsx(
127
- X,
128
- {
129
- className: t.feedback,
130
- message: b,
131
- type: "invalid",
132
- id: B
133
- }
134
- ),
135
- /* @__PURE__ */ e.jsxs("div", { className: t.wrapper, children: [
136
- /* @__PURE__ */ e.jsx(
137
- "input",
138
- {
139
- className: $,
140
- id: n,
141
- ref: h,
142
- ...L,
143
- "aria-labelledby": `${v}${O}`,
144
- "aria-describedby": r && b ? B : void 0,
145
- "aria-invalid": r,
146
- "aria-disabled": o,
147
- readOnly: o,
148
- required: S,
149
- disabled: s,
150
- type: "search",
151
- value: p,
152
- onChange: W
153
- }
154
- ),
155
- x && !o && !s && /* @__PURE__ */ e.jsx(
156
- A,
157
- {
158
- hideLabel: !0,
159
- theme: "light",
160
- iconName: "cross",
161
- className: T,
162
- variant: "ghost",
163
- size: i,
164
- onClick: M,
165
- type: "button",
166
- tabIndex: -1,
167
- children: E
168
- }
169
- ),
170
- /* @__PURE__ */ e.jsx(
171
- A,
172
- {
173
- hideLabel: !0,
174
- theme: "light",
175
- iconName: "magnifying-glass",
176
- className: q,
177
- variant: "ghost",
178
- size: i,
179
- onClick: k,
180
- type: "submit",
181
- disabled: s || o,
182
- children: C
183
- }
184
- )
185
- ] })
186
- ] });
187
- };
188
- export {
189
- Dt as D,
190
- bt as i,
191
- dt as v
192
- };
@@ -1,294 +0,0 @@
1
- "use client";
2
- import { j as e } from "./jsx-runtime.C115EyI4.js";
3
- import { c } from "./index.CvOaL64Y.js";
4
- import { useState as f, useRef as B, useEffect as N } from "react";
5
- import { u as bn } from "./useBreakpoint.5xBNDiCf.js";
6
- import { M as E, a as H, u as M } from "./Input.utils.ChV6RJsh.js";
7
- import { Asterisk as xn } from "../asterisk.DDn-yX4P.js";
8
- import { DSButton as X } from "../button.C5opEJ6x.js";
9
- import { DSSystemFeedback as mn } from "../systemfeedback.ZzRUAVYX.js";
10
- import { g as S } from "./helpers.B1JT5ShS.js";
11
- import '../assets/InputStepper.CYYJUu0b.css';const hn = "_input_bwxln_226", wn = "_input--invalid_bwxln_343", Sn = "_input--small_bwxln_350", yn = "_input--has-leading-icon_bwxln_404", In = "_input--has-action-button_bwxln_407", vn = "_input--has-second-action-button_bwxln_410", gn = "_input--has-affix_bwxln_422", An = "_input--is-ready_bwxln_436", Dn = "_root_bwxln_446", Bn = "_hint_bwxln_454", Nn = "_label_bwxln_454", En = "_wrapper_bwxln_458", Hn = "_affix_bwxln_464", Ln = "_affix--small_bwxln_486", jn = "_affix--disabled_bwxln_500", Rn = "_prefix_bwxln_508", kn = "_affix--readonly_bwxln_511", Cn = "_suffix_bwxln_521", $n = "_action-button_bwxln_528", Fn = "_label--hidden_bwxln_547", Vn = "_label--disabled_bwxln_560", Pn = "_feedback_bwxln_581", Tn = "_second-action-button_bwxln_595", Wn = "_value-announcer_bwxln_599", t = {
12
- input: hn,
13
- "input--invalid": "_input--invalid_bwxln_343",
14
- inputInvalid: wn,
15
- "input--small": "_input--small_bwxln_350",
16
- inputSmall: Sn,
17
- "input--has-leading-icon": "_input--has-leading-icon_bwxln_404",
18
- inputHasLeadingIcon: yn,
19
- "input--has-action-button": "_input--has-action-button_bwxln_407",
20
- inputHasActionButton: In,
21
- "input--has-second-action-button": "_input--has-second-action-button_bwxln_410",
22
- inputHasSecondActionButton: vn,
23
- "input--has-affix": "_input--has-affix_bwxln_422",
24
- inputHasAffix: gn,
25
- "input--is-ready": "_input--is-ready_bwxln_436",
26
- inputIsReady: An,
27
- root: Dn,
28
- hint: Bn,
29
- label: Nn,
30
- wrapper: En,
31
- affix: Hn,
32
- "affix--small": "_affix--small_bwxln_486",
33
- affixSmall: Ln,
34
- "affix--disabled": "_affix--disabled_bwxln_500",
35
- affixDisabled: jn,
36
- prefix: Rn,
37
- "affix--readonly": "_affix--readonly_bwxln_511",
38
- affixReadonly: kn,
39
- suffix: Cn,
40
- "action-button": "_action-button_bwxln_528",
41
- actionButton: $n,
42
- "label--hidden": "_label--hidden_bwxln_547",
43
- labelHidden: Fn,
44
- "label--disabled": "_label--disabled_bwxln_560",
45
- labelDisabled: Vn,
46
- feedback: Pn,
47
- "second-action-button": "_second-action-button_bwxln_595",
48
- secondActionButton: Tn,
49
- "value-announcer": "_value-announcer_bwxln_599",
50
- valueAnnouncer: Wn
51
- }, Mn = ({
52
- id: a,
53
- label: b,
54
- prefix: x,
55
- suffix: m
56
- }) => {
57
- if (!a)
58
- throw new Error(
59
- S(
60
- "DSInputStepper",
61
- 'A unique "id" prop is required. Please add an unique "id" prop to the DSInputStepper component.'
62
- )
63
- );
64
- if (!b)
65
- throw new Error(
66
- S(
67
- "DSInputStepper",
68
- `A label is always required for a11y reasons. Please add a descriptive "label" prop to the DSInputStepper component. If you don't want to display a label, set hideLabel={true}.`
69
- )
70
- );
71
- x && x.length > E && console.warn(
72
- S(
73
- "DSInputStepper",
74
- `Prefix length must not exceed ${E} characters.`
75
- )
76
- ), m && m.length > H && console.warn(
77
- S(
78
- "DSInputStepper",
79
- `Suffix length must not exceed ${H} characters.`
80
- )
81
- );
82
- }, Zn = ({
83
- id: a,
84
- label: b,
85
- announcementText: x = "Value changed to",
86
- className: m,
87
- disabled: u = !1,
88
- decreaseAmountButtonLabel: q = "Decrease",
89
- hint: y,
90
- hideLabel: G = !1,
91
- invalid: h = !1,
92
- increaseAmountButtonLabel: O = "Increase",
93
- prefix: r,
94
- max: L = 100,
95
- min: j = 0,
96
- readonly: p = !1,
97
- required: R = !1,
98
- size: l = "medium",
99
- step: U = 1,
100
- suffix: d,
101
- systemFeedback: I,
102
- value: w,
103
- onChange: k,
104
- ...J
105
- }) => {
106
- process.env.NODE_ENV !== "production" && Mn({
107
- id: a,
108
- label: b,
109
- prefix: r,
110
- suffix: d
111
- });
112
- const [K, Q] = f(!1), [_, v] = f(w), [g, C] = f(""), [Y, Z] = f(!1), [z, nn] = f({}), s = B(null), tn = r == null ? void 0 : r.substring(0, E), A = B(null), en = d == null ? void 0 : d.substring(0, H), D = B(null), an = bn(G);
113
- N(() => {
114
- w && v(w);
115
- }, [w]), N(() => {
116
- if (g) {
117
- const n = setTimeout(() => {
118
- C("");
119
- }, 3e3);
120
- return () => clearTimeout(n);
121
- }
122
- }, [g]), N(() => {
123
- var i;
124
- const n = (o) => {
125
- o.preventDefault();
126
- };
127
- return (i = s.current) == null || i.addEventListener("wheel", n, {
128
- // The { passive: false } option is used to indicate that the event listener wants to cancel the event, allowing preventDefault to work as expected.
129
- passive: !1
130
- }), () => {
131
- var o;
132
- (o = s.current) == null || o.removeEventListener("wheel", n);
133
- };
134
- }, []), M(() => {
135
- const n = l === "medium" ? 16 : 8, i = {};
136
- if (A.current) {
137
- const o = A.current.offsetWidth;
138
- i.paddingInlineStart = n + o + "px";
139
- }
140
- if (D.current) {
141
- const o = D.current.offsetWidth;
142
- i.paddingInlineEnd = n + o + "px";
143
- }
144
- nn(i), Q(!0);
145
- }, [r, d, l, Y]), M(() => {
146
- (async () => {
147
- "fonts" in document && (await document.fonts.load(
148
- '1em "STIHL Contraface Digital Text Regular"'
149
- ), Z(!0));
150
- })();
151
- }, []);
152
- const $ = c(t.affix, {
153
- [t.affixSmall]: l === "small",
154
- [t.affixDisabled]: u,
155
- [t.affixReadonly]: p
156
- }), F = `${a}-label`, V = `${a}-feedback`, P = `${a}-hint`, T = `${a}-value-announcer`, sn = y ? ` ${P}` : "", ln = c(t.root, m), on = c(t.input, {
157
- // small input
158
- [t.inputSmall]: l === "small",
159
- // invalid state
160
- [t.inputInvalid]: h,
161
- // prefix/suffix
162
- [t.inputHasAffix]: r || d,
163
- [t.inputIsReady]: K
164
- }), cn = c(t.label, {
165
- // hide label only visually to keep them available for assistive technologies
166
- [t.labelHidden]: an,
167
- [t.labelDisabled]: u
168
- }), un = c(t.secondActionButton, {
169
- [t.secondActionButtonSmall]: l === "small"
170
- }), rn = c(t.actionButton, {
171
- [t.actionButtonSmall]: l === "small"
172
- }), dn = () => {
173
- const n = [T];
174
- return h && I && n.push(V), n.join(" ");
175
- }, W = () => {
176
- var n;
177
- if (s.current) {
178
- v(s.current.value);
179
- const i = new Event("change", { bubbles: !0 });
180
- (n = s.current) == null || n.dispatchEvent(i), C(`${x} ${s.current.value}`);
181
- }
182
- }, pn = () => {
183
- var n;
184
- (n = s.current) == null || n.stepDown(), W();
185
- }, _n = () => {
186
- var n;
187
- (n = s.current) == null || n.stepUp(), W();
188
- }, fn = (n) => {
189
- v(n.target.value), k && k(n);
190
- };
191
- return /* @__PURE__ */ e.jsxs("div", { className: ln, children: [
192
- /* @__PURE__ */ e.jsxs("label", { className: cn, id: F, htmlFor: a, children: [
193
- b,
194
- R && /* @__PURE__ */ e.jsx(xn, {})
195
- ] }),
196
- y && /* @__PURE__ */ e.jsx("div", { className: t.hint, id: P, children: y }),
197
- /* @__PURE__ */ e.jsx(
198
- "div",
199
- {
200
- "aria-live": "polite",
201
- "aria-atomic": "true",
202
- className: t.valueAnnouncer,
203
- id: T,
204
- children: g
205
- }
206
- ),
207
- h && I && /* @__PURE__ */ e.jsx(
208
- mn,
209
- {
210
- className: t.feedback,
211
- message: I,
212
- type: "invalid",
213
- id: V
214
- }
215
- ),
216
- /* @__PURE__ */ e.jsxs("div", { className: t.wrapper, children: [
217
- r && /* @__PURE__ */ e.jsx(
218
- "span",
219
- {
220
- className: c($, t.prefix),
221
- ref: A,
222
- "aria-disabled": u,
223
- children: tn
224
- }
225
- ),
226
- /* @__PURE__ */ e.jsx(
227
- "input",
228
- {
229
- className: on,
230
- id: a,
231
- ref: s,
232
- ...J,
233
- style: z,
234
- "aria-labelledby": `${F}${sn}`,
235
- "aria-describedby": dn(),
236
- "aria-invalid": h,
237
- "aria-disabled": p,
238
- disabled: u,
239
- min: j,
240
- max: L,
241
- readOnly: p,
242
- required: R,
243
- step: U,
244
- type: "number",
245
- value: _,
246
- onChange: fn
247
- }
248
- ),
249
- d && /* @__PURE__ */ e.jsx(
250
- "span",
251
- {
252
- className: c($, t.suffix),
253
- ref: D,
254
- "aria-disabled": u,
255
- children: en
256
- }
257
- ),
258
- /* @__PURE__ */ e.jsx(
259
- X,
260
- {
261
- hideLabel: !0,
262
- theme: "light",
263
- iconName: "minus",
264
- variant: "filled",
265
- className: un,
266
- size: l,
267
- onClick: pn,
268
- disabled: u || p || !!_ && Number(_) <= j,
269
- type: "button",
270
- children: q
271
- }
272
- ),
273
- /* @__PURE__ */ e.jsx(
274
- X,
275
- {
276
- hideLabel: !0,
277
- theme: "light",
278
- iconName: "plus",
279
- variant: "filled",
280
- className: rn,
281
- size: l,
282
- onClick: _n,
283
- disabled: u || p || !!_ && Number(_) >= L,
284
- type: "button",
285
- children: O
286
- }
287
- )
288
- ] })
289
- ] });
290
- };
291
- export {
292
- Zn as D,
293
- Mn as v
294
- };
@@ -1,93 +0,0 @@
1
- "use client";
2
- import { j as n } from "./jsx-runtime.C115EyI4.js";
3
- import { c } from "./index.CvOaL64Y.js";
4
- import { DSButton as x } from "../button.C5opEJ6x.js";
5
- import { D as w } from "./Icon.C2o2seDb.js";
6
- import '../assets/Notification.mhVFeSGm.css';const k = "_root_1xkow_76", g = "_root--success_1xkow_102", N = "_root--error_1xkow_106", f = "_root--warning_1xkow_110", h = "_root--hide-icon_1xkow_114", I = "_content_1xkow_128", A = "_content--hide-close-button_1xkow_135", C = "_content--hide-icon_1xkow_138", H = "_icon_1xkow_142", j = "_message_1xkow_146", S = "_custom-action-area_1xkow_246", o = {
7
- root: k,
8
- "root--success": "_root--success_1xkow_102",
9
- rootSuccess: g,
10
- "root--error": "_root--error_1xkow_106",
11
- rootError: N,
12
- "root--warning": "_root--warning_1xkow_110",
13
- rootWarning: f,
14
- "root--hide-icon": "_root--hide-icon_1xkow_114",
15
- rootHideIcon: h,
16
- content: I,
17
- "content--hide-close-button": "_content--hide-close-button_1xkow_135",
18
- contentHideCloseButton: A,
19
- "content--hide-icon": "_content--hide-icon_1xkow_138",
20
- contentHideIcon: C,
21
- icon: H,
22
- message: j,
23
- "custom-action-area": "_custom-action-area_1xkow_246",
24
- customActionArea: S
25
- }, R = [
26
- "success",
27
- "error",
28
- "warning",
29
- "info"
30
- ], p = {
31
- success: "circle-check-colored",
32
- error: "diamond-exclamationmark-colored",
33
- warning: "triangle-exclamationmark-colored",
34
- info: "circle-info-colored"
35
- }, O = {
36
- error: "alert",
37
- warning: "alert",
38
- info: "status",
39
- success: "status"
40
- }, B = ({
41
- children: i,
42
- variant: t = "info",
43
- className: a,
44
- closeButtonLabel: _ = "Close notification",
45
- customActionArea: e,
46
- hideCloseButton: r = !1,
47
- hideIcon: s = !1,
48
- onClose: l,
49
- ...m
50
- }) => {
51
- const d = c(o.root, a, {
52
- [o.rootSuccess]: t === "success",
53
- [o.rootError]: t === "error",
54
- [o.rootWarning]: t === "warning",
55
- [o.rootInfo]: t === "info",
56
- [o.rootHideIcon]: s
57
- }), u = c(o.content, {
58
- [o.contentHideCloseButton]: r,
59
- [o.contentHideIcon]: s
60
- });
61
- return /* @__PURE__ */ n.jsxs("div", { className: d, ...m, role: O[t], children: [
62
- /* @__PURE__ */ n.jsxs("div", { className: u, children: [
63
- !s && /* @__PURE__ */ n.jsx(
64
- w,
65
- {
66
- name: p[t],
67
- className: o.icon,
68
- "aria-hidden": "true"
69
- }
70
- ),
71
- /* @__PURE__ */ n.jsx("div", { className: o.message, children: i }),
72
- !r && /* @__PURE__ */ n.jsx(
73
- x,
74
- {
75
- hideLabel: !0,
76
- iconName: "cross",
77
- isFlush: !0,
78
- variant: "ghost",
79
- size: "small",
80
- onClick: l,
81
- type: "button",
82
- children: _
83
- }
84
- )
85
- ] }),
86
- e && /* @__PURE__ */ n.jsx("div", { className: c({ [o.customActionArea]: !s }), children: e })
87
- ] });
88
- };
89
- export {
90
- B as D,
91
- R as N,
92
- p as a
93
- };