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

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 (238) hide show
  1. package/README.md +0 -9
  2. package/{accordion.B3UkxlAZ.js → accordion.CEKQh-7i.js} +1 -1
  3. package/accordion.d.ts +1 -0
  4. package/{arialiveregions.BK4T7Vhk.js → arialiveregions.BKpxxK7O.js} +1 -1
  5. package/arialiveregions.d.ts +1 -0
  6. package/assets/Accordion.DMEFgtQm.css +1 -0
  7. package/assets/Chip.D10_7Q82.css +1 -0
  8. package/assets/CustomReactSelect.D5XKd9vg.css +1 -0
  9. package/assets/Dialog.B0pucIEI.css +1 -0
  10. package/assets/Drawer.CATBzfY7.css +1 -0
  11. package/assets/Fieldset.CwDhKRUL.css +1 -0
  12. package/assets/InputPassword.DOAAzj-O.css +1 -0
  13. package/assets/InputSearch.CxPYaQGZ.css +1 -0
  14. package/assets/InputStepper.CYYJUu0b.css +1 -0
  15. package/assets/Notification.mhVFeSGm.css +1 -0
  16. package/assets/Select.DZKpHV4G.css +1 -0
  17. package/assets/Textarea.Cp0b7oZp.css +1 -0
  18. package/assets/Toast.Cz6wYaBv.css +1 -0
  19. package/assets/button.C9_ejpGG.css +1 -0
  20. package/assets/buttonround.DTCqRP-0.css +1 -0
  21. package/assets/chipgroup.BMovtKTy.css +1 -0
  22. package/assets/flag.DX_lH1v7.css +1 -0
  23. package/assets/floatingactionbutton.Do-yEH6c.css +1 -0
  24. package/assets/input.Q5oKkmW2.css +1 -0
  25. package/assets/link.DhZqkLMP.css +1 -0
  26. package/assets/linkstandalone.Dwz-_O8q.css +1 -0
  27. package/assets/optioncheckbox.C62HtIj5.css +1 -0
  28. package/assets/radio.-Xxx5wL4.css +1 -0
  29. package/assets/switch.C1Ei0-z8.css +1 -0
  30. package/assets/text.DxKFcfY6.css +1 -0
  31. package/asterisk.d.ts +1 -0
  32. package/button.C5opEJ6x.js +135 -0
  33. package/button.d.ts +1 -0
  34. package/buttonround.CUoqRyy0.js +118 -0
  35. package/buttonround.d.ts +1 -0
  36. package/checkbox.d.ts +1 -0
  37. package/checkboxgroup.BqD5IV51.js +8 -0
  38. package/checkboxgroup.d.ts +1 -0
  39. package/chip.B92ew-hk.js +10 -0
  40. package/chip.d.ts +2 -0
  41. package/chipgroup.BJrqEfvr.js +175 -0
  42. package/chipgroup.d.ts +2 -0
  43. package/chunks/Accordion.DFwFN8mX.js +125 -0
  44. package/chunks/{AriaLiveRegions.utils.D2ni4Yrf.js → AriaLiveRegions.utils.BGSZafnS.js} +2 -2
  45. package/chunks/CheckboxGroup.M3jOjhNf.js +92 -0
  46. package/chunks/Chip.fMG8wi5K.js +142 -0
  47. package/chunks/{CustomReactSelect.ChAtL6fu.js → CustomReactSelect.D3jv5-fa.js} +883 -876
  48. package/chunks/{Dialog.Z5ESJQMi.js → Dialog.Fwr6vLiK.js} +47 -47
  49. package/chunks/{Drawer.BdowMqE0.js → Drawer.CKoYzQHd.js} +32 -32
  50. package/chunks/Fieldset.C9K8BYmH.js +99 -0
  51. package/chunks/InputPassword.C7pNeWGx.js +143 -0
  52. package/chunks/InputSearch.B24rcIJ_.js +192 -0
  53. package/chunks/InputStepper.CEW-bieQ.js +294 -0
  54. package/chunks/Notification.BXVN7_Fs.js +93 -0
  55. package/chunks/RadioGroup.D4UOflwr.js +137 -0
  56. package/chunks/Select.Ds86q4UC.js +194 -0
  57. package/chunks/Textarea.DcB8hKnO.js +198 -0
  58. package/chunks/Toast.DrzxdzVW.js +89 -0
  59. package/chunks/translate.isa3FHb8.js +11 -0
  60. package/{combobox.JL1Dsn3E.js → combobox.BeTnbG1m.js} +1 -1
  61. package/combobox.d.ts +1 -0
  62. package/components/Accordion/Accordion.d.ts +0 -1
  63. package/components/Accordion/Accordion.utils.d.ts +0 -1
  64. package/components/Button/Button.d.ts +0 -1
  65. package/components/ButtonRound/ButtonRound.d.ts +0 -1
  66. package/components/Checkbox/Checkbox.d.ts +0 -1
  67. package/components/CheckboxGroup/CheckboxGroup.d.ts +6 -7
  68. package/components/CheckboxGroup/CheckboxGroup.utils.d.ts +0 -1
  69. package/components/ChipGroup/Chip.d.ts +12 -0
  70. package/components/ChipGroup/ChipGroup.d.ts +42 -0
  71. package/components/ChipGroup/ChipGroup.test.d.ts +1 -0
  72. package/components/ChipGroup/ChipGroup.utils.d.ts +60 -0
  73. package/components/ChipGroup/ChipGroup.utils.test.d.ts +1 -0
  74. package/components/Combobox/Combobox.d.ts +0 -1
  75. package/components/Combobox/Combobox.utils.d.ts +6 -1
  76. package/components/CustomReactSelect/CustomReactSelect.d.ts +0 -1
  77. package/components/CustomReactSelect/CustomReactSelect.utils.d.ts +0 -13
  78. package/components/CustomReactSelect/OptionCheckbox.d.ts +0 -1
  79. package/components/Dialog/Dialog.d.ts +0 -1
  80. package/components/Dialog/Dialog.utils.d.ts +0 -1
  81. package/components/Drawer/Drawer.d.ts +0 -1
  82. package/components/Drawer/Drawer.utils.d.ts +0 -1
  83. package/components/Fieldset/Fieldset.d.ts +0 -1
  84. package/components/Fieldset/Fieldset.utils.d.ts +7 -1
  85. package/components/Flag/Flag.d.ts +23 -0
  86. package/components/Flag/Flag.test.d.ts +1 -0
  87. package/components/Flag/Flag.utils.d.ts +2 -0
  88. package/components/FloatingActionButton/FloatingActionButton.d.ts +0 -1
  89. package/components/Heading/Heading.d.ts +0 -1
  90. package/components/Icon/Icon.d.ts +0 -1
  91. package/components/Icon/Icon.utils.d.ts +0 -1
  92. package/components/Input/Input.d.ts +0 -1
  93. package/components/Input/Input.utils.d.ts +0 -1
  94. package/components/InputPassword/InputPassword.d.ts +0 -1
  95. package/components/InputPassword/InputPassword.utils.d.ts +0 -1
  96. package/components/InputSearch/InputSearch.d.ts +0 -1
  97. package/components/InputSearch/InputSearch.utils.d.ts +0 -1
  98. package/components/InputStepper/InputStepper.d.ts +0 -1
  99. package/components/InputStepper/InputStepper.utils.d.ts +0 -1
  100. package/components/Link/Link.d.ts +0 -1
  101. package/components/LinkStandalone/LinkStandalone.d.ts +0 -1
  102. package/components/Logo/Logo.d.ts +1 -2
  103. package/components/Logo/Logo.utils.d.ts +0 -1
  104. package/components/Notification/Notification.d.ts +0 -1
  105. package/components/Notification/Notification.utils.d.ts +0 -1
  106. package/components/Radio/Radio.d.ts +0 -1
  107. package/components/RadioGroup/RadioGroup.d.ts +7 -8
  108. package/components/RadioGroup/RadioGroup.utils.d.ts +2 -3
  109. package/components/Select/Select.d.ts +0 -1
  110. package/components/Select/Select.utils.d.ts +0 -1
  111. package/components/SkipToContent/SkipToContent.d.ts +0 -1
  112. package/components/Spinner/Spinner.d.ts +0 -1
  113. package/components/Switch/Switch.d.ts +0 -1
  114. package/components/SystemFeedback/SystemFeedback.d.ts +0 -1
  115. package/components/Text/Text.d.ts +0 -1
  116. package/components/Textarea/Textarea.d.ts +0 -1
  117. package/components/Textarea/Textarea.utils.d.ts +0 -1
  118. package/components/Title/Title.d.ts +0 -1
  119. package/components/Toast/Toast.d.ts +0 -1
  120. package/components/Toast/Toast.utils.d.ts +0 -1
  121. package/components/Toast/ToastManager.d.ts +0 -1
  122. package/customreactselect.d.ts +1 -0
  123. package/{customreactselect.Dg8Kgq3e.js → customreactselect.lYJhIeyx.js} +2 -2
  124. package/dialog.d.ts +1 -0
  125. package/{dialog.D3bJ0rsW.js → dialog.lGwNQU91.js} +2 -2
  126. package/{drawer.CNPF1-Kc.js → drawer.DNi5m8wP.js} +2 -2
  127. package/drawer.d.ts +1 -0
  128. package/{fieldset.CTshPWYX.js → fieldset.BqiAjeax.js} +1 -1
  129. package/fieldset.d.ts +1 -0
  130. package/flag.XJHHSP38.js +43 -0
  131. package/flag.d.ts +2 -0
  132. package/floatingactionbutton.CMpkTdhX.js +87 -0
  133. package/floatingactionbutton.d.ts +1 -0
  134. package/heading.d.ts +1 -0
  135. package/icon.d.ts +1 -0
  136. package/index.d.ts +4 -0
  137. package/index.es.js +133 -113
  138. package/input.d.ts +1 -0
  139. package/input.v7qB7wPJ.js +239 -0
  140. package/{inputpassword.nsYu6YeB.js → inputpassword.CSjh1GU7.js} +2 -2
  141. package/inputpassword.d.ts +1 -0
  142. package/{inputsearch.ZGIrDrcv.js → inputsearch.DyznOWLK.js} +2 -2
  143. package/inputsearch.d.ts +1 -0
  144. package/{inputstepper.BvY36hA1.js → inputstepper.3BLb7s0P.js} +2 -2
  145. package/inputstepper.d.ts +1 -0
  146. package/link.Clk5_BYp.js +116 -0
  147. package/link.d.ts +1 -0
  148. package/linkstandalone.BXERmqdN.js +80 -0
  149. package/linkstandalone.d.ts +1 -0
  150. package/logo.d.ts +1 -0
  151. package/{notification.BAS13UQ6.js → notification.0kX1GMaB.js} +2 -2
  152. package/notification.d.ts +1 -0
  153. package/{optioncheckbox.DZWwtx6f.js → optioncheckbox.BPN3f6l_.js} +13 -13
  154. package/optioncheckbox.d.ts +1 -0
  155. package/package.json +44 -39
  156. package/partials/index.js +407 -407
  157. package/partials/lib/partials.d.ts +0 -1
  158. package/radio.DTZNJzMU.js +115 -0
  159. package/radio.d.ts +1 -0
  160. package/radiogroup.SYkZm2DG.js +10 -0
  161. package/radiogroup.d.ts +1 -0
  162. package/{select.C4OZMB-V.js → select.CYbwR3RW.js} +1 -1
  163. package/select.d.ts +1 -0
  164. package/{skiptocontent.C4yQfWr2.js → skiptocontent.DUQWopO4.js} +1 -1
  165. package/skiptocontent.d.ts +1 -0
  166. package/spinner.d.ts +1 -0
  167. package/styles/fonts/STIHLContrafaceDigitalTextDemi.woff +0 -0
  168. package/styles/fonts/STIHLContrafaceDigitalTextDemi.woff2 +0 -0
  169. package/styles/fonts/font-face.min.css +1 -1
  170. package/styles/scss/_index.scss +1 -0
  171. package/styles/scss/lib/_breakpoints.scss +0 -1
  172. package/styles/scss/lib/_link.scss +3 -0
  173. package/styles/scss/lib/_spacing-dynamic.scss +61 -0
  174. package/switch.CoNnIhM4.js +65 -0
  175. package/switch.d.ts +1 -0
  176. package/systemfeedback.d.ts +1 -0
  177. package/text.d.ts +1 -0
  178. package/text.fMcHzVbH.js +57 -0
  179. package/{textarea.CtQtGqn5.js → textarea.DJc527nX.js} +1 -1
  180. package/textarea.d.ts +1 -0
  181. package/title.d.ts +1 -0
  182. package/{toast.DVd9dLs2.js → toast.D48GFmp0.js} +2 -2
  183. package/toast.d.ts +1 -0
  184. package/{toastmanager.Dh0gzFkM.js → toastmanager.Dl8-Q3ED.js} +2 -2
  185. package/toastmanager.d.ts +1 -0
  186. package/utils/index.d.ts +1 -0
  187. package/utils/translate.d.ts +11 -0
  188. package/utils/translate.test.d.ts +1 -0
  189. package/utils/useBreakpoint.d.ts +0 -1
  190. package/utils/useIsomorphicLayoutEffect.d.ts +0 -1
  191. package/utils/vitest.setup.d.ts +0 -1
  192. package/assets/Accordion.lFv7Q_RG.css +0 -1
  193. package/assets/CustomReactSelect.CMkn-EGK.css +0 -1
  194. package/assets/Dialog.fiQvxJg_.css +0 -1
  195. package/assets/Drawer.BqBgbSuP.css +0 -1
  196. package/assets/Fieldset.qHYeUFZt.css +0 -1
  197. package/assets/InputPassword.Cf394z47.css +0 -1
  198. package/assets/InputSearch.eCRQoxjN.css +0 -1
  199. package/assets/InputStepper.B80KulYE.css +0 -1
  200. package/assets/Notification.DK6agBGS.css +0 -1
  201. package/assets/Select.BptsMxz4.css +0 -1
  202. package/assets/Textarea.CIIVh03G.css +0 -1
  203. package/assets/Toast.Dsvs1zdM.css +0 -1
  204. package/assets/button.B1O7Yw3Q.css +0 -1
  205. package/assets/buttonround.DlH_ipDo.css +0 -1
  206. package/assets/floatingactionbutton.DRYentYC.css +0 -1
  207. package/assets/input.C0MrSbQu.css +0 -1
  208. package/assets/link.vtTST2ki.css +0 -1
  209. package/assets/linkstandalone.BtAcziZ7.css +0 -1
  210. package/assets/optioncheckbox.BJJAph5_.css +0 -1
  211. package/assets/radio.9kpIO3HC.css +0 -1
  212. package/assets/switch.2DQF2zH-.css +0 -1
  213. package/assets/text.Dhb_l50R.css +0 -1
  214. package/button.DH0h6uPs.js +0 -135
  215. package/buttonround.0mw4zzlU.js +0 -118
  216. package/checkboxgroup.CZqrlF-x.js +0 -9
  217. package/chunks/Accordion.pI3JyHJL.js +0 -125
  218. package/chunks/CheckboxGroup.4J_gZ_XJ.js +0 -87
  219. package/chunks/Fieldset.COGbZwry.js +0 -99
  220. package/chunks/InputPassword.Dgo95-PU.js +0 -140
  221. package/chunks/InputSearch.BFof0pBn.js +0 -189
  222. package/chunks/InputStepper.4IqLa5tX.js +0 -291
  223. package/chunks/Notification.BhwbaXqk.js +0 -93
  224. package/chunks/RadioGroup.C5jbCJM4.js +0 -132
  225. package/chunks/RadioGroup.module.BBZwHDjW.js +0 -11
  226. package/chunks/Select.fXeQJXtz.js +0 -191
  227. package/chunks/Textarea.Bewrp0Za.js +0 -195
  228. package/chunks/Toast.DA_CQ9J-.js +0 -89
  229. package/floatingactionbutton.CCIj9Fjr.js +0 -87
  230. package/input.CTgeAYdu.js +0 -236
  231. package/link.DAZNwQ0a.js +0 -116
  232. package/linkstandalone.C9X3er7g.js +0 -80
  233. package/radio.CWGJtmKl.js +0 -115
  234. package/radiogroup.BhffFqN3.js +0 -11
  235. package/switch.CmpNUC7s.js +0 -65
  236. package/text.rgDKQBrU.js +0 -57
  237. package/utils/render-in-iframe.d.ts +0 -15
  238. /package/assets/{RadioGroup.Bz3_xkZU.css → CheckboxGroup.Bz3_xkZU.css} +0 -0
@@ -1,87 +0,0 @@
1
- "use client";
2
- import { j as u } from "./jsx-runtime.C115EyI4.js";
3
- import { c as D } from "./index.CvOaL64Y.js";
4
- import { D as b } from "./Fieldset.COGbZwry.js";
5
- import { s as c } from "./RadioGroup.module.BBZwHDjW.js";
6
- import l from "react";
7
- import { g as s } from "./helpers.B1JT5ShS.js";
8
- import { DSCheckbox as f } from "../checkbox.DETR3e3X.js";
9
- const C = (e) => `The "${e}" prop is required. Please add the "${e}" prop to the DSCheckboxGroup component.`, k = ({
10
- children: e,
11
- description: o,
12
- id: i,
13
- legend: n,
14
- systemFeedback: r
15
- }) => {
16
- if (!i && (o || r))
17
- throw new Error(
18
- s(
19
- "DSCheckboxGroup",
20
- 'A unique "id" prop is required when providing the description or systemFeedback property. Please add an unique "id" prop to the DSCheckboxGroup component.'
21
- )
22
- );
23
- if (!n)
24
- throw new Error(
25
- s("DSCheckboxGroup", C("legend"))
26
- );
27
- if (!e)
28
- throw new Error(
29
- s(
30
- "DSCheckboxGroup",
31
- "The component requires DSCheckbox components to be explicitly set as its children. Ensure that you include individual DSCheckbox components within the DSCheckboxGroup to create a cohesive checkbox group."
32
- )
33
- );
34
- l.Children.forEach(e, (t) => {
35
- if (!(l.isValidElement(t) && t.type === f))
36
- throw new Error(
37
- s(
38
- "DSCheckboxGroup",
39
- "The component requires the children to be DSCheckbox elements. Ensure that you include individual DSCheckbox components within the DSCheckboxGroup to create a cohesive checkbox group."
40
- )
41
- );
42
- });
43
- }, y = ({
44
- children: e,
45
- legend: o,
46
- alignment: i = "vertical",
47
- className: n,
48
- description: r,
49
- disabled: t = !1,
50
- id: h,
51
- invalid: a = !1,
52
- required: m = !1,
53
- systemFeedback: p,
54
- ...x
55
- }) => {
56
- process.env.NODE_ENV !== "production" && k({
57
- children: e,
58
- legend: o,
59
- description: r,
60
- id: h,
61
- systemFeedback: p
62
- });
63
- const d = D(c.group, {
64
- // In case of longer copy, use vertical alignment
65
- [c.groupHorizontal]: i === "horizontal",
66
- [c.groupInvalid]: a && !!p
67
- });
68
- return /* @__PURE__ */ u.jsx(
69
- b,
70
- {
71
- id: h,
72
- legend: o,
73
- className: n,
74
- description: r,
75
- disabled: t,
76
- required: m,
77
- invalid: a,
78
- systemFeedback: p,
79
- ...x,
80
- children: /* @__PURE__ */ u.jsx("div", { className: d, children: e })
81
- }
82
- );
83
- };
84
- export {
85
- y as D,
86
- k as v
87
- };
@@ -1,99 +0,0 @@
1
- "use client";
2
- import { j as e } from "./jsx-runtime.C115EyI4.js";
3
- import { c } from "./index.CvOaL64Y.js";
4
- import "react";
5
- import { Asterisk as z } from "../asterisk.DDn-yX4P.js";
6
- import { DSHeading as F } from "../heading.CAkraI2D.js";
7
- import { DSSystemFeedback as k } from "../systemfeedback.ZzRUAVYX.js";
8
- import { g as h } from "./helpers.B1JT5ShS.js";
9
- import '../assets/Fieldset.qHYeUFZt.css';const v = "_root_xfwzz_76", N = "_child-wrapper_xfwzz_82", E = "_legend_xfwzz_89", M = "_legend--utility--m_xfwzz_93", q = "_description_xfwzz_106", C = "_description--small_xfwzz_121", P = "_system-feedback_xfwzz_125", i = {
10
- root: v,
11
- "child-wrapper": "_child-wrapper_xfwzz_82",
12
- childWrapper: N,
13
- legend: E,
14
- "legend--utility--m": "_legend--utility--m_xfwzz_93",
15
- legendUtilityM: M,
16
- description: q,
17
- "description--small": "_description--small_xfwzz_121",
18
- descriptionSmall: C,
19
- "system-feedback": "_system-feedback_xfwzz_125",
20
- systemFeedback: P
21
- }, T = ({
22
- description: a,
23
- id: s,
24
- legend: n,
25
- systemFeedback: t
26
- }) => {
27
- if (!s && (a || t))
28
- throw new Error(
29
- h(
30
- "DSFieldset",
31
- 'A unique "id" prop is required when providing the description or systemFeedback property. Please add an unique "id" prop to the DSFieldset component.'
32
- )
33
- );
34
- if (!n)
35
- throw new Error(
36
- h(
37
- "DSFieldset",
38
- "The legend prop is required. Please add the legend prop to the DSFieldset component."
39
- )
40
- );
41
- }, H = ({
42
- children: a,
43
- legend: s,
44
- className: n,
45
- description: t,
46
- disabled: w = !1,
47
- id: d,
48
- invalid: p = !1,
49
- required: m = !1,
50
- systemFeedback: o,
51
- ...y
52
- }) => {
53
- process.env.NODE_ENV !== "production" && T({ description: t, id: d, legend: s, systemFeedback: o });
54
- let r, _, f;
55
- const l = typeof s == "object" && s !== void 0;
56
- l && ({ headingSize: r, headingTag: _, headingText: f } = s);
57
- const g = `${d}-feedback`, x = `${d}-description`, j = [
58
- o && g,
59
- t && x
60
- ].filter(Boolean).join(" "), S = !l || r === "small" || r === "small-uppercase", b = c(i.root, n), u = c(i.legend, {
61
- [i.legendUtilityM]: !l
62
- }), D = c(i.description, {
63
- [i.descriptionSmall]: S
64
- });
65
- return /* @__PURE__ */ e.jsxs(
66
- "fieldset",
67
- {
68
- className: b,
69
- disabled: w,
70
- ...y,
71
- "aria-invalid": p,
72
- "aria-describedby": j || void 0,
73
- children: [
74
- /* @__PURE__ */ e.jsx("legend", { className: u, children: l ? /* @__PURE__ */ e.jsxs(F, { tag: _, size: r, children: [
75
- f,
76
- m && /* @__PURE__ */ e.jsx(z, {})
77
- ] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
78
- s,
79
- m && /* @__PURE__ */ e.jsx(z, {})
80
- ] }) }),
81
- t && /* @__PURE__ */ e.jsx("span", { id: x, className: D, children: t }),
82
- p && o && /* @__PURE__ */ e.jsx(
83
- k,
84
- {
85
- id: g,
86
- type: "invalid",
87
- message: o,
88
- className: i.systemFeedback
89
- }
90
- ),
91
- /* @__PURE__ */ e.jsx("div", { className: i.childWrapper, children: a })
92
- ]
93
- }
94
- );
95
- };
96
- export {
97
- H as D,
98
- T as v
99
- };
@@ -1,140 +0,0 @@
1
- "use client";
2
- import { j as a } from "./jsx-runtime.C115EyI4.js";
3
- import { c as i } from "./index.CvOaL64Y.js";
4
- import { useState as A } from "react";
5
- import { u as D } from "./useBreakpoint.5xBNDiCf.js";
6
- import { Asterisk as C } from "../asterisk.DDn-yX4P.js";
7
- import { DSButton as L } from "../button.DH0h6uPs.js";
8
- import { DSSystemFeedback as $ } from "../systemfeedback.ZzRUAVYX.js";
9
- import { g as x } from "./helpers.B1JT5ShS.js";
10
- import '../assets/InputPassword.Cf394z47.css';const E = "_input_1pqhx_226", R = "_input--invalid_1pqhx_338", V = "_input--small_1pqhx_345", O = "_input--has-leading-icon_1pqhx_399", F = "_input--has-action-button_1pqhx_402", M = "_input--has-second-action-button_1pqhx_405", T = "_input--has-affix_1pqhx_417", G = "_input--is-ready_1pqhx_431", J = "_root_1pqhx_438", K = "_hint_1pqhx_446", Q = "_label_1pqhx_446", U = "_wrapper_1pqhx_450", W = "_action-button_1pqhx_456", X = "_label--hidden_1pqhx_475", Y = "_feedback_1pqhx_504", t = {
11
- input: E,
12
- "input--invalid": "_input--invalid_1pqhx_338",
13
- inputInvalid: R,
14
- "input--small": "_input--small_1pqhx_345",
15
- inputSmall: V,
16
- "input--has-leading-icon": "_input--has-leading-icon_1pqhx_399",
17
- inputHasLeadingIcon: O,
18
- "input--has-action-button": "_input--has-action-button_1pqhx_402",
19
- inputHasActionButton: F,
20
- "input--has-second-action-button": "_input--has-second-action-button_1pqhx_405",
21
- inputHasSecondActionButton: M,
22
- "input--has-affix": "_input--has-affix_1pqhx_417",
23
- inputHasAffix: T,
24
- "input--is-ready": "_input--is-ready_1pqhx_431",
25
- inputIsReady: G,
26
- root: J,
27
- hint: K,
28
- label: Q,
29
- wrapper: U,
30
- "action-button": "_action-button_1pqhx_456",
31
- actionButton: W,
32
- "label--hidden": "_label--hidden_1pqhx_475",
33
- labelHidden: X,
34
- feedback: Y
35
- }, Z = ({ id: n, label: s }) => {
36
- if (!n)
37
- throw new Error(
38
- x(
39
- "DSInputPassword",
40
- 'A unique "id" prop is required. Please add an unique "id" prop to the DSInputPassword component.'
41
- )
42
- );
43
- if (!s)
44
- throw new Error(
45
- x(
46
- "DSInputPassword",
47
- `A label is always required for a11y reasons. Please add a descriptive "label" prop to the DSInputPassword component. If you don't want to display a label, set hideLabel={true}.`
48
- )
49
- );
50
- }, pt = ({
51
- id: n,
52
- label: s,
53
- autocomplete: b = "new-password",
54
- className: f,
55
- disabled: c = !1,
56
- hidePasswordText: q = "Hide password",
57
- hint: e,
58
- hideLabel: w = !1,
59
- invalid: o = !1,
60
- readonly: r = !1,
61
- required: d = !1,
62
- showPasswordText: y = "Show password",
63
- size: p = "medium",
64
- systemFeedback: l,
65
- ...S
66
- }) => {
67
- process.env.NODE_ENV !== "production" && Z({
68
- id: n,
69
- label: s
70
- });
71
- const [u, I] = A(!1), _ = `${n}-label`, h = `${n}-feedback`, m = `${n}-hint`, v = e ? ` ${m}` : "", B = D(w), H = i(t.root, f), g = i(t.input, {
72
- // small input
73
- [t.inputSmall]: p === "small",
74
- // invalid state
75
- [t.inputInvalid]: o,
76
- // action button - input password always has an action button
77
- [t.inputHasActionButton]: !0
78
- }), P = i(t.label, {
79
- // hide label only visually to keep them available for assistive technologies
80
- [t.labelHidden]: B
81
- }), N = i(t.actionButton, {
82
- [t.actionButtonSmall]: p === "small"
83
- }), j = () => {
84
- I((k) => !k);
85
- };
86
- return /* @__PURE__ */ a.jsxs("div", { className: H, children: [
87
- /* @__PURE__ */ a.jsxs("label", { className: P, id: _, htmlFor: n, children: [
88
- s,
89
- d && /* @__PURE__ */ a.jsx(C, {})
90
- ] }),
91
- e && /* @__PURE__ */ a.jsx("div", { className: t.hint, id: m, children: e }),
92
- o && l && /* @__PURE__ */ a.jsx(
93
- $,
94
- {
95
- className: t.feedback,
96
- message: l,
97
- type: "invalid",
98
- id: h
99
- }
100
- ),
101
- /* @__PURE__ */ a.jsxs("div", { className: t.wrapper, children: [
102
- /* @__PURE__ */ a.jsx(
103
- "input",
104
- {
105
- className: g,
106
- id: n,
107
- ...S,
108
- "aria-labelledby": `${_}${v}`,
109
- "aria-describedby": o && l ? h : void 0,
110
- "aria-invalid": o,
111
- "aria-disabled": r,
112
- readOnly: r,
113
- required: d,
114
- disabled: c,
115
- autoComplete: b,
116
- type: u ? "text" : "password"
117
- }
118
- ),
119
- /* @__PURE__ */ a.jsx(
120
- L,
121
- {
122
- hideLabel: !0,
123
- theme: "light",
124
- iconName: u ? "eye-closed" : "eye",
125
- variant: "ghost",
126
- className: N,
127
- size: p,
128
- onClick: j,
129
- type: "button",
130
- disabled: c,
131
- children: u ? q : y
132
- }
133
- )
134
- ] })
135
- ] });
136
- };
137
- export {
138
- pt as D,
139
- Z as v
140
- };
@@ -1,189 +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 G, useRef as N, useEffect as w } from "react";
5
- import { g as S, a as J } from "./helpers.B1JT5ShS.js";
6
- import { u as K } from "./useBreakpoint.5xBNDiCf.js";
7
- import { Asterisk as Q } from "../asterisk.DDn-yX4P.js";
8
- import { DSButton as D } from "../button.DH0h6uPs.js";
9
- import { DSSystemFeedback as U } from "../systemfeedback.ZzRUAVYX.js";
10
- import '../assets/InputSearch.eCRQoxjN.css';const X = "_input_8z3ht_226", Y = "_input--invalid_8z3ht_338", Z = "_input--small_8z3ht_345", tt = "_input--has-leading-icon_8z3ht_399", nt = "_input--has-action-button_8z3ht_402", et = "_input--has-second-action-button_8z3ht_405", at = "_input--has-affix_8z3ht_417", st = "_input--is-ready_8z3ht_431", ot = "_root_8z3ht_438", it = "_hint_8z3ht_446", ct = "_label_8z3ht_446", ut = "_wrapper_8z3ht_450", lt = "_action-button_8z3ht_456", rt = "_second-action-button_8z3ht_460", pt = "_label--hidden_8z3ht_479", ht = "_feedback_8z3ht_508", t = {
11
- input: X,
12
- "input--invalid": "_input--invalid_8z3ht_338",
13
- inputInvalid: Y,
14
- "input--small": "_input--small_8z3ht_345",
15
- inputSmall: Z,
16
- "input--has-leading-icon": "_input--has-leading-icon_8z3ht_399",
17
- inputHasLeadingIcon: tt,
18
- "input--has-action-button": "_input--has-action-button_8z3ht_402",
19
- inputHasActionButton: nt,
20
- "input--has-second-action-button": "_input--has-second-action-button_8z3ht_405",
21
- inputHasSecondActionButton: et,
22
- "input--has-affix": "_input--has-affix_8z3ht_417",
23
- inputHasAffix: at,
24
- "input--is-ready": "_input--is-ready_8z3ht_431",
25
- inputIsReady: st,
26
- root: ot,
27
- hint: it,
28
- label: ct,
29
- wrapper: ut,
30
- "action-button": "_action-button_8z3ht_456",
31
- actionButton: lt,
32
- "second-action-button": "_second-action-button_8z3ht_460",
33
- secondActionButton: rt,
34
- "label--hidden": "_label--hidden_8z3ht_479",
35
- labelHidden: pt,
36
- feedback: ht
37
- }, _t = ({ id: n, label: u }) => {
38
- if (!n)
39
- throw new Error(
40
- S(
41
- "DSInputSearch",
42
- 'A unique "id" prop is required. Please add an unique "id" prop to the DSInputSearch component.'
43
- )
44
- );
45
- if (!u)
46
- throw new Error(
47
- S(
48
- "DSInputSearch",
49
- `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}.`
50
- )
51
- );
52
- }, dt = (n) => !!J(n, "form"), Bt = ({
53
- id: n,
54
- label: u,
55
- className: A,
56
- clearButtonLabel: H = "Clear search field",
57
- disabled: l = !1,
58
- hint: d,
59
- hideLabel: E = !1,
60
- invalid: r = !1,
61
- readonly: s = !1,
62
- required: I = !1,
63
- size: o = "medium",
64
- submitButtonLabel: j = "Search",
65
- systemFeedback: m,
66
- value: b,
67
- submitButtonOnClick: C,
68
- onChange: g,
69
- ...k
70
- }) => {
71
- process.env.NODE_ENV !== "production" && _t({
72
- id: n,
73
- label: u
74
- });
75
- const [p, v] = G(b), f = N(null), h = N(null), L = K(E);
76
- w(() => {
77
- v(b);
78
- }, [b]), w(() => {
79
- f.current && !dt(f.current) && process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "test" && console.warn(
80
- S(
81
- "DSInputSearch",
82
- `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.`
83
- )
84
- );
85
- }, []);
86
- const z = `${n}-label`, B = `${n}-feedback`, y = `${n}-hint`, V = d ? ` ${y}` : "", x = p !== "" && p !== void 0 && p !== null, O = c(t.root, A), P = c(t.input, {
87
- // small input
88
- [t.inputSmall]: o === "small",
89
- // invalid state
90
- [t.inputInvalid]: r,
91
- // action button - input password always has an action button
92
- [t.inputHasActionButton]: !0,
93
- // action second action button
94
- [t.inputHasSecondActionButton]: x && !s && !l
95
- }), $ = c(t.label, {
96
- // hide label only visually to keep them available for assistive technologies
97
- [t.labelHidden]: L
98
- }), R = c(t.actionButton, {
99
- [t.actionButtonSmall]: o === "small"
100
- }), q = c(t.secondActionButton, {
101
- [t.secondActionButtonSmall]: o === "small"
102
- }), T = (a, i) => {
103
- const W = Object.getPrototypeOf(a), _ = Object.getOwnPropertyDescriptor(
104
- W,
105
- "value"
106
- );
107
- _ != null && _.set ? _.set.call(a, i) : a.value = i;
108
- }, F = () => {
109
- var i;
110
- if (!h.current) return;
111
- T(h.current, "");
112
- const a = new Event("change", { bubbles: !0 });
113
- (i = h.current) == null || i.dispatchEvent(a);
114
- }, M = (a) => {
115
- v(a.target.value), g && g(a);
116
- };
117
- return /* @__PURE__ */ e.jsxs("div", { className: O, ref: f, children: [
118
- /* @__PURE__ */ e.jsxs("label", { className: $, id: z, htmlFor: n, children: [
119
- u,
120
- I && /* @__PURE__ */ e.jsx(Q, {})
121
- ] }),
122
- d && /* @__PURE__ */ e.jsx("div", { className: t.hint, id: y, children: d }),
123
- r && m && /* @__PURE__ */ e.jsx(
124
- U,
125
- {
126
- className: t.feedback,
127
- message: m,
128
- type: "invalid",
129
- id: B
130
- }
131
- ),
132
- /* @__PURE__ */ e.jsxs("div", { className: t.wrapper, children: [
133
- /* @__PURE__ */ e.jsx(
134
- "input",
135
- {
136
- className: P,
137
- id: n,
138
- ref: h,
139
- ...k,
140
- "aria-labelledby": `${z}${V}`,
141
- "aria-describedby": r && m ? B : void 0,
142
- "aria-invalid": r,
143
- "aria-disabled": s,
144
- readOnly: s,
145
- required: I,
146
- disabled: l,
147
- type: "search",
148
- value: p,
149
- onChange: M
150
- }
151
- ),
152
- x && !s && !l && /* @__PURE__ */ e.jsx(
153
- D,
154
- {
155
- hideLabel: !0,
156
- theme: "light",
157
- iconName: "cross",
158
- className: q,
159
- variant: "ghost",
160
- size: o,
161
- onClick: F,
162
- type: "button",
163
- tabIndex: -1,
164
- children: H
165
- }
166
- ),
167
- /* @__PURE__ */ e.jsx(
168
- D,
169
- {
170
- hideLabel: !0,
171
- theme: "light",
172
- iconName: "magnifying-glass",
173
- className: R,
174
- variant: "ghost",
175
- size: o,
176
- onClick: C,
177
- type: "submit",
178
- disabled: l || s,
179
- children: j
180
- }
181
- )
182
- ] })
183
- ] });
184
- };
185
- export {
186
- Bt as D,
187
- dt as i,
188
- _t as v
189
- };