@stihl-design-system/components 1.0.0-RC.47 → 1.0.0-RC.48

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 (261) hide show
  1. package/{accordion.BQ7vavIt.js → accordion.D4XR2R7e.js} +2 -2
  2. package/{actionbutton.C7lqEmBx.js → actionbutton.C8hePX-D.js} +3 -3
  3. package/{actioncard.dgVHW0BC.js → actioncard.kDxu01xm.js} +1 -1
  4. package/{actionlink.CL6v1mQA.js → actionlink.dccc5JQV.js} +3 -3
  5. package/{arialiveregions.DC1Gq9Lo.js → arialiveregions.BniSDuPM.js} +9 -10
  6. package/assets/Accordion.RlqWqpGo.css +1 -0
  7. package/assets/ActionButton.Dw2FeIaW.css +1 -0
  8. package/assets/ActionCard.viEoC26n.css +1 -0
  9. package/assets/ActionLink.B1Jjaf7k.css +1 -0
  10. package/assets/Button.Bi1KUKMv.css +1 -0
  11. package/assets/Checkbox.C6RWhy0V.css +1 -0
  12. package/assets/Chip.DfamkUPw.css +1 -0
  13. package/assets/CustomReactSelect.CvWMmrAU.css +1 -0
  14. package/assets/Dialog.6AkQo8ew.css +1 -0
  15. package/assets/Drawer.CDOlX809.css +1 -0
  16. package/assets/Fieldset.BbLGXCWa.css +1 -0
  17. package/assets/InputFile.CDtghZtl.css +1 -0
  18. package/assets/InputNumber.BNpO9p7n.css +1 -0
  19. package/assets/InputPassword.BgZo-RUc.css +1 -0
  20. package/assets/InputSearch.BROFFTK9.css +1 -0
  21. package/assets/LinkButton.IKIlFnpH.css +1 -0
  22. package/assets/Notification.2B81JHOp.css +1 -0
  23. package/assets/Pagination.DH71DZ0j.css +1 -0
  24. package/assets/Popover.58Tb0dOt.css +1 -0
  25. package/assets/Select.CfTN3CJo.css +1 -0
  26. package/assets/Slider.B4kzL60S.css +1 -0
  27. package/assets/{SystemFeedback.DYi9QetY.css → SystemFeedback.DVMml_h9.css} +1 -1
  28. package/assets/TextUtility.BThulfyl.css +1 -0
  29. package/assets/Textarea.BO4AcRJD.css +1 -0
  30. package/assets/buttonround.syTU1QSI.css +1 -0
  31. package/assets/chipgroup.DtCnsmS7.css +1 -0
  32. package/assets/filelist.B-Ru0GP_.css +1 -0
  33. package/assets/input.Dy8VS73e.css +1 -0
  34. package/assets/numberindicator.CtbitPQ8.css +1 -0
  35. package/assets/progressindicator.tyY_RVQ9.css +1 -0
  36. package/assets/radio.9hUUyg8R.css +1 -0
  37. package/assets/switch.8v7Wp1Fj.css +1 -0
  38. package/assets/tabpane.DDaeSDQb.css +1 -0
  39. package/assets/text.BwGsYzGM.css +1 -0
  40. package/assets/tooltip.C_BL2kou.css +1 -0
  41. package/{banner.BlB_7xue.js → banner.DO7GsDL_.js} +1 -1
  42. package/{breadcrumb.DajORKq7.js → breadcrumb.DYov6vtt.js} +3 -3
  43. package/{button.EooIlFBI.js → button.qxcuzbnv.js} +2 -2
  44. package/buttonround.BO7_ewzA.js +101 -0
  45. package/{checkbox.NJj9qMnx.js → checkbox.C9kyIY9P.js} +4 -5
  46. package/{checkboxgroup.DELdyn0X.js → checkboxgroup.kEUxnKLf.js} +2 -2
  47. package/{chip.C4h8Hm9g.js → chip.5ktNLRYf.js} +3 -3
  48. package/chipgroup.kRU3Z98U.js +226 -0
  49. package/chunks/Accordion.gih2ni1d.js +179 -0
  50. package/chunks/ActionButton.B-wm5sUy.js +194 -0
  51. package/chunks/{ActionCard.Dbq2VqyZ.js → ActionCard.Bm-2ewfS.js} +44 -44
  52. package/chunks/ActionLink.D0KzqbH4.js +166 -0
  53. package/chunks/{AriaLiveRegions.utils.BPvIKT6B.js → AriaLiveRegions.utils.xoETe2Ps.js} +14 -16
  54. package/chunks/{Breadcrumb.Ccm79ver.js → Breadcrumb.I2G-T0zc.js} +2 -2
  55. package/chunks/Button.CCol--xy.js +165 -0
  56. package/chunks/Checkbox.BxOGR1bR.js +96 -0
  57. package/chunks/CheckboxGroup.TneO0tuE.js +85 -0
  58. package/chunks/Chip.DffaXMkV.js +148 -0
  59. package/chunks/{CustomReactSelect.oEQpO9iN.js → CustomReactSelect.DTAavYaz.js} +282 -277
  60. package/chunks/Dialog.guuxflWL.js +101 -0
  61. package/chunks/{Drawer.CDe_g99S.js → Drawer.CjUZu6GW.js} +27 -28
  62. package/chunks/Fieldset.BBMuLKps.js +94 -0
  63. package/chunks/{Flag.X9tB3Mfv.js → Flag.CbQYBzVC.js} +12 -13
  64. package/chunks/{Header.bLSdAY9-.js → Header.CvcGSuhX.js} +1 -1
  65. package/chunks/{Input.utils.CkmzxIrU.js → Input.utils.Wycy2SzG.js} +23 -25
  66. package/chunks/InputFile.y71Cd5J9.js +260 -0
  67. package/chunks/InputNumber.Fn2YbF_s.js +250 -0
  68. package/chunks/InputPassword.DtT9yrlx.js +129 -0
  69. package/chunks/InputSearch.BoAfGqoH.js +157 -0
  70. package/chunks/LinkButton.BxG7fx1O.js +150 -0
  71. package/chunks/LinkCard.DM-5WrSt.js +200 -0
  72. package/chunks/{MegaMenu.DbunD_yW.js → MegaMenu.udXR1H3W.js} +1 -1
  73. package/chunks/{NavigationTabList.CyrKNAer.js → NavigationTabList.thzA1pU8.js} +1 -1
  74. package/chunks/{NavigationTabs.DVBe-Wt3.js → NavigationTabs.BWewgBch.js} +1 -1
  75. package/chunks/Notification.C_o7Ge6Q.js +91 -0
  76. package/chunks/Pagination.BrOMUJMi.js +272 -0
  77. package/chunks/Popover.CxZZ_y1Z.js +230 -0
  78. package/chunks/RadioGroup.CO91_5hA.js +136 -0
  79. package/chunks/Select.EzoMdk1u.js +157 -0
  80. package/chunks/Slider.CX38t4Sk.js +330 -0
  81. package/chunks/{Stepper.KBRikedB.js → Stepper.Ds_aIEF8.js} +68 -69
  82. package/chunks/SystemFeedback.DhWcYjnu.js +43 -0
  83. package/chunks/{Tabs.xXn4zpGp.js → Tabs.BHVlgp7L.js} +2 -2
  84. package/chunks/Text.utils.DzlY9pJS.js +9 -0
  85. package/chunks/TextUtility.BZLwqyic.js +82 -0
  86. package/chunks/Textarea.vuJgvW6_.js +192 -0
  87. package/chunks/{Toast.NZfb7z3q.js → Toast.V_ZUAsf2.js} +1 -1
  88. package/chunks/translate.DSb-TdWR.js +2460 -0
  89. package/{combobox.CPsl2TC0.js → combobox.C6cPz4AJ.js} +1 -1
  90. package/components/Accordion/Accordion.d.ts +5 -0
  91. package/components/ActionButton/ActionButton.d.ts +5 -1
  92. package/components/ActionLink/ActionLink.d.ts +1 -1
  93. package/components/Button/Button.utils.d.ts +1 -1
  94. package/components/Checkbox/Checkbox.d.ts +8 -1
  95. package/components/CheckboxGroup/CheckboxGroup.d.ts +9 -1
  96. package/components/ChipGroup/Chip.d.ts +2 -0
  97. package/components/ChipGroup/ChipGroup.d.ts +12 -2
  98. package/components/ChipGroup/ChipGroup.utils.d.ts +39 -15
  99. package/components/Combobox/Combobox.utils.d.ts +66 -9
  100. package/components/Combobox/CustomReactSelect/CustomReactSelect.d.ts +5 -1
  101. package/components/Combobox/CustomReactSelect/CustomReactSelect.utils.d.ts +1 -1
  102. package/components/Fieldset/Fieldset.d.ts +9 -2
  103. package/components/Input/Input.d.ts +8 -1
  104. package/components/InputFile/FileList/FileList.d.ts +4 -2
  105. package/components/InputFile/FileList/FilePreview/FilePreview.d.ts +8 -2
  106. package/components/InputFile/FileList/ProgressIndicator/ProgressIndicator.d.ts +8 -2
  107. package/components/InputFile/InputFile.d.ts +12 -2
  108. package/components/InputFile/InputFile.utils.d.ts +41 -23
  109. package/components/InputNumber/InputNumber.d.ts +8 -1
  110. package/components/InputPassword/InputPassword.d.ts +8 -1
  111. package/components/InputSearch/InputSearch.d.ts +8 -1
  112. package/components/LinkCard/LinkCard.d.ts +10 -4
  113. package/components/LinkCard/LinkCard.utils.d.ts +2 -2
  114. package/components/NumberIndicator/NumberIndicator.d.ts +6 -1
  115. package/components/Pagination/Pagination.d.ts +10 -3
  116. package/components/Pagination/Pagination.utils.d.ts +22 -9
  117. package/components/Popover/Popover.d.ts +9 -1
  118. package/components/Popover/Popover.utils.d.ts +3 -2
  119. package/components/Radio/Radio.d.ts +5 -0
  120. package/components/RadioGroup/RadioGroup.d.ts +8 -0
  121. package/components/Select/Select.d.ts +8 -1
  122. package/components/Slider/Slider.d.ts +8 -1
  123. package/components/Stepper/Step.d.ts +1 -1
  124. package/components/Stepper/Step.utils.d.ts +1 -1
  125. package/components/Stepper/Stepper.d.ts +4 -1
  126. package/components/Stepper/Stepper.utils.d.ts +9 -4
  127. package/components/SystemFeedback/SystemFeedback.d.ts +9 -1
  128. package/components/Textarea/Textarea.d.ts +8 -1
  129. package/{customreactselect.D7BJg-2s.js → customreactselect.L0zSh3Tg.js} +4 -4
  130. package/{dialog.BlprGigG.js → dialog.Ddq8o8Od.js} +2 -2
  131. package/{drawer.BoyrTFi1.js → drawer.rbbjQvqL.js} +2 -2
  132. package/{fieldset.D_e2-vo_.js → fieldset.BHf3XK2q.js} +3 -3
  133. package/filelist.GrEwoM1u.js +143 -0
  134. package/filepreview.B2Ot9SZ7.js +97 -0
  135. package/{flag.0vpitrQ-.js → flag.fX6LAgty.js} +3 -4
  136. package/{floatingactionbutton.BrdE1vi2.js → floatingactionbutton.BwCiybnc.js} +1 -1
  137. package/{header.C3AqYBtz.js → header.BCeCjYfG.js} +1 -1
  138. package/index.es.js +203 -204
  139. package/input.Dh0ws-9j.js +187 -0
  140. package/inputfile.DiZh3GcT.js +17 -0
  141. package/{inputnumber.Box5R2An.js → inputnumber.D2cmptaH.js} +8 -9
  142. package/{inputpassword.CBc8GNwI.js → inputpassword.C53Kg4EA.js} +4 -4
  143. package/inputsearch.BrsIDUSW.js +14 -0
  144. package/link.DEZDbUgq.js +81 -0
  145. package/{linkbutton.DxEPueLb.js → linkbutton._X50W2Md.js} +3 -3
  146. package/{linkcard.CCY-VFWN.js → linkcard.BtM3KnjT.js} +3 -3
  147. package/{logo.D7LnRA1E.js → logo.D6BTxbxv.js} +0 -1
  148. package/{megamenu.C8OynEzk.js → megamenu.odVCUm4c.js} +2 -2
  149. package/{navigationtablist.iSQd5PX4.js → navigationtablist.n9DrtYe5.js} +2 -2
  150. package/{navigationtabs.FtkVv_qV.js → navigationtabs.D0mSyAtK.js} +2 -2
  151. package/{notification.Cqg8HpJ8.js → notification._X8-8vOa.js} +2 -2
  152. package/numberindicator.DsK65Bj3.js +39 -0
  153. package/package.json +6 -1
  154. package/pagination.B7Hrx_sk.js +14 -0
  155. package/partials/index.js +68 -68
  156. package/{popover.DYiEGSnj.js → popover.BBaqL7y9.js} +3 -3
  157. package/progressindicator.D9CfVD95.js +74 -0
  158. package/radio.DjToa2aV.js +148 -0
  159. package/{radiogroup.wqgExwrG.js → radiogroup.mc-8lw65.js} +3 -3
  160. package/{scroller.Dqnsxq2M.js → scroller.CgWp2WXG.js} +10 -11
  161. package/{select.DkKuGI6O.js → select.DTZ6a6Ag.js} +5 -6
  162. package/{skeleton.DUkBgXxO.js → skeleton.CNJdNVav.js} +10 -10
  163. package/{skiptocontent.CRQywi6J.js → skiptocontent.BsRpWvyu.js} +4 -4
  164. package/{slider.BOjqQp9n.js → slider.BMGAihY0.js} +3 -3
  165. package/{step.C6zDRCBu.js → step.DCQ6CawJ.js} +1 -1
  166. package/stepper.D7-7BdSv.js +15 -0
  167. package/styles/scss/ds/index.scss +2 -0
  168. package/styles/scss/ds/lib/border-width.scss +3 -0
  169. package/styles/scss/ds/lib/ds-internal/_input.scss +65 -21
  170. package/styles/scss/ds/lib/ds-internal/_link-button.scss +4 -2
  171. package/styles/scss/ds/lib/ds-internal/_link.scss +23 -3
  172. package/styles/scss/ds/lib/input.scss +12 -7
  173. package/styles/scss/ds/lib/link.scss +2 -2
  174. package/styles/scss/ds/lib/radius.scss +5 -0
  175. package/{switch.CuNNdrkD.js → switch.tM2XBag8.js} +2 -2
  176. package/{systemfeedback.Da0wX0Eb.js → systemfeedback.BPPOht_9.js} +1 -1
  177. package/{tablist.BjKwrLz9.js → tablist.BAm0_UIG.js} +22 -23
  178. package/{tabpane.7vMXUKFX.js → tabpane.B9rZghU6.js} +1 -1
  179. package/{tabs.-U2k6Oll.js → tabs.BgTdWbTe.js} +3 -3
  180. package/text.BEO_ZfJq.js +72 -0
  181. package/{textarea.BWznY6Gg.js → textarea.Cki-uMkZ.js} +5 -6
  182. package/{textutility.CBLuAdaa.js → textutility.BypzssPt.js} +2 -2
  183. package/{toast.D9XLSgJg.js → toast.s0Hfuh5i.js} +2 -2
  184. package/{toastmanager.V5E05qgI.js → toastmanager.CPIPn4Io.js} +19 -20
  185. package/{tooltip.a1aWHK00.js → tooltip.BFQG-7VR.js} +1 -1
  186. package/{topbar.BdGK62KJ.js → topbar.Bbct-XkB.js} +3 -3
  187. package/utils/translate.d.ts +22 -6
  188. package/assets/Accordion.DPu2l_Kg.css +0 -1
  189. package/assets/ActionButton.DcQYatF1.css +0 -1
  190. package/assets/ActionCard.gRQVVFWz.css +0 -1
  191. package/assets/ActionLink.B62Aa8y9.css +0 -1
  192. package/assets/Button.BI6zz6Fw.css +0 -1
  193. package/assets/Checkbox.DknHnS9a.css +0 -1
  194. package/assets/Chip.CYhVB1Jh.css +0 -1
  195. package/assets/CustomReactSelect.lKMLwL7n.css +0 -1
  196. package/assets/Dialog.BKwWy1g2.css +0 -1
  197. package/assets/Drawer.IRb7Vc1n.css +0 -1
  198. package/assets/Fieldset.C4Fx4-UV.css +0 -1
  199. package/assets/InputFile.ne7gwc_5.css +0 -1
  200. package/assets/InputNumber.BIdsQuFc.css +0 -1
  201. package/assets/InputPassword.YSKTDTA1.css +0 -1
  202. package/assets/InputSearch.C3qtDQcj.css +0 -1
  203. package/assets/LinkButton.CmEE7Od_.css +0 -1
  204. package/assets/Notification.BO0Mu9No.css +0 -1
  205. package/assets/Pagination.OLmfdASf.css +0 -1
  206. package/assets/Popover.mL5g23EK.css +0 -1
  207. package/assets/Select.CDP-1_K9.css +0 -1
  208. package/assets/Slider.Cu7MgNph.css +0 -1
  209. package/assets/TextUtility.bwkCWEiV.css +0 -1
  210. package/assets/Textarea.Hsq68tg1.css +0 -1
  211. package/assets/buttonround.rmUb58WF.css +0 -1
  212. package/assets/chipgroup.BGxjdSDX.css +0 -1
  213. package/assets/filelist.cP3O1JeJ.css +0 -1
  214. package/assets/input.BEBgyvkK.css +0 -1
  215. package/assets/numberindicator.DSpNPJcs.css +0 -1
  216. package/assets/progressindicator.Dxrigyne.css +0 -1
  217. package/assets/radio.DsHt-9om.css +0 -1
  218. package/assets/switch.fwcMI6o7.css +0 -1
  219. package/assets/tabpane.o34hshTz.css +0 -1
  220. package/assets/text.Doa-APfR.css +0 -1
  221. package/assets/tooltip.DrSplliO.css +0 -1
  222. package/buttonround.BeQakrPs.js +0 -101
  223. package/chipgroup.BKjeuuM0.js +0 -213
  224. package/chunks/Accordion.8kTbiPxs.js +0 -173
  225. package/chunks/ActionButton.CBV1-_HP.js +0 -188
  226. package/chunks/ActionLink.BXxDS1Gg.js +0 -161
  227. package/chunks/Button.COycNYUI.js +0 -160
  228. package/chunks/Checkbox.CMshaWIU.js +0 -88
  229. package/chunks/CheckboxGroup.D3D1spfJ.js +0 -79
  230. package/chunks/Chip.DCJYE513.js +0 -157
  231. package/chunks/Dialog.lJXxzgu2.js +0 -102
  232. package/chunks/Fieldset.DOjI3DlI.js +0 -91
  233. package/chunks/InputFile.DYXvF6vT.js +0 -260
  234. package/chunks/InputNumber.CkWpchPo.js +0 -240
  235. package/chunks/InputPassword.21E6XMr5.js +0 -121
  236. package/chunks/InputSearch.Dy3EKa9f.js +0 -149
  237. package/chunks/LinkButton.BCHTLFMJ.js +0 -150
  238. package/chunks/LinkCard.BYmTwsS5.js +0 -197
  239. package/chunks/Notification.BjyLiO2h.js +0 -91
  240. package/chunks/Pagination.CJikF9Cw.js +0 -247
  241. package/chunks/Popover.ByaoNwGK.js +0 -221
  242. package/chunks/RadioGroup.Bh2X6pT9.js +0 -130
  243. package/chunks/Select.KWb09VmF.js +0 -147
  244. package/chunks/Slider.CxnIy51F.js +0 -309
  245. package/chunks/SystemFeedback.4osheYxC.js +0 -38
  246. package/chunks/Text.utils.BZ4nTZVu.js +0 -11
  247. package/chunks/TextUtility.BPrxUX-x.js +0 -82
  248. package/chunks/Textarea.CAOqZMUi.js +0 -181
  249. package/chunks/translate.nuU7uChI.js +0 -8
  250. package/filelist.DfAt2xJa.js +0 -128
  251. package/filepreview.Defs34bv.js +0 -94
  252. package/input.ChMzyHej.js +0 -175
  253. package/inputfile.DZIUs1EC.js +0 -18
  254. package/inputsearch.DzzYb-C0.js +0 -15
  255. package/link.aU1f2Xzu.js +0 -81
  256. package/numberindicator.Q7g4J3Ry.js +0 -36
  257. package/pagination.DA4PMLOq.js +0 -14
  258. package/progressindicator.DpmERE8T.js +0 -53
  259. package/radio.KQ8CUM3_.js +0 -137
  260. package/stepper.DHl3_XU9.js +0 -16
  261. package/text.CnP3baHy.js +0 -72
@@ -1,82 +0,0 @@
1
- "use client";
2
- import { jsx as k } from "react/jsx-runtime";
3
- import { d as M } from "./index.cKLI89Eg.js";
4
- import { c as X } from "./index.DQOqod3i.js";
5
- import { useRef as N, useEffect as P } from "react";
6
- import { g as f } from "./helpers.CexwVao7.js";
7
- import { i as B } from "./Text.utils.BZ4nTZVu.js";
8
- import '../assets/TextUtility.bwkCWEiV.css';const Y = "ds-text-utility_root_181q1_6", $ = "ds-text-utility_root--large_181q1_15", z = "ds-text-utility_root--large-bold_181q1_26", G = "ds-text-utility_root--medium_181q1_38", R = "ds-text-utility_root--medium-bold_181q1_49", W = "ds-text-utility_root--small_181q1_61", j = "ds-text-utility_root--small-bold_181q1_72", A = "ds-text-utility_root--small-demi_181q1_84", C = "ds-text-utility_root--x-small-demi_181q1_94", H = "ds-text-utility_root--theme-dark_181q1_187", l = {
9
- root: Y,
10
- rootLarge: $,
11
- rootLargeBold: z,
12
- rootMedium: G,
13
- rootMediumBold: R,
14
- rootSmall: W,
15
- rootSmallBold: j,
16
- rootSmallDemi: A,
17
- rootXSmallDemi: C,
18
- rootThemeDark: H
19
- }, tt = ["address", "blockquote", "cite", "div", "dd", "dfn", "dt", "figcaption", "legend", "li", "p", "span", "time"], ot = ["large", "medium", "small", "x-small"], et = ["bold", "demi", "normal"], O = ({
20
- size: i,
21
- weight: t
22
- }) => {
23
- t === "demi" && i !== "small" && i !== "x-small" && console.warn(f("DSTextUtility", 'Invalid prop combination: weight "demi" is only supported on sizes "small" and "x-small".')), i === "x-small" && t !== "demi" && console.warn(f("DSTextUtility", 'Invalid prop combination: size "x-small" only supports weight "demi".'));
24
- }, lt = (i) => {
25
- const t = M.c(29);
26
- let r, a, m, n, d, c, u;
27
- t[0] !== i ? ({
28
- children: r,
29
- className: a,
30
- size: n,
31
- tag: d,
32
- theme: c,
33
- weight: u,
34
- ...m
35
- } = i, t[0] = i, t[1] = r, t[2] = a, t[3] = m, t[4] = n, t[5] = d, t[6] = c, t[7] = u) : (r = t[1], a = t[2], m = t[3], n = t[4], d = t[5], c = t[6], u = t[7]);
36
- const o = n === void 0 ? "medium" : n, s = d === void 0 ? "p" : d, L = c === void 0 ? "light" : c, e = u === void 0 ? "normal" : u, _ = N(null);
37
- let T, p;
38
- t[8] !== o || t[9] !== s || t[10] !== e ? (T = () => {
39
- if (process.env.NODE_ENV !== "production" && (O({
40
- size: o,
41
- weight: e
42
- }), _.current))
43
- t: switch (s) {
44
- case "li": {
45
- if (!B(_.current, "ul, ol"))
46
- throw Error(f("DSTextUtility", `The DSTextUtility component with the tag "${s}" is not within a list element (ul, ol). Please ensure it's placed correctly.`));
47
- break t;
48
- }
49
- case "dt":
50
- case "dd": {
51
- if (!B(_.current, "dl"))
52
- throw Error(f("DSTextUtility", `The DSTextUtility component with the tag "${s}" is not within a description list element (dl). Please ensure it's placed correctly.`));
53
- break t;
54
- }
55
- default:
56
- return;
57
- }
58
- }, p = [s, o, e], t[8] = o, t[9] = s, t[10] = e, t[11] = T, t[12] = p) : (T = t[11], p = t[12]), P(T, p);
59
- const h = s, y = o === "large" && e === "normal", S = o === "large" && e === "bold", D = o === "medium" && e === "normal", b = o === "medium" && e === "bold", w = o === "small" && e === "normal", E = o === "small" && e === "bold", q = o === "small" && e === "demi", U = o === "x-small" && e === "demi", v = L === "dark";
60
- let x;
61
- t[13] !== a || t[14] !== b || t[15] !== w || t[16] !== E || t[17] !== q || t[18] !== U || t[19] !== v || t[20] !== y || t[21] !== S || t[22] !== D ? (x = X(l.root, a, {
62
- [l.rootLarge]: y,
63
- [l.rootLargeBold]: S,
64
- [l.rootMedium]: D,
65
- [l.rootMediumBold]: b,
66
- [l.rootSmall]: w,
67
- [l.rootSmallBold]: E,
68
- [l.rootSmallDemi]: q,
69
- [l.rootXSmallDemi]: U,
70
- [l.rootThemeDark]: v
71
- }), t[13] = a, t[14] = b, t[15] = w, t[16] = E, t[17] = q, t[18] = U, t[19] = v, t[20] = y, t[21] = S, t[22] = D, t[23] = x) : x = t[23];
72
- const I = x;
73
- let g;
74
- return t[24] !== h || t[25] !== r || t[26] !== m || t[27] !== I ? (g = /* @__PURE__ */ k(h, { className: I, ref: _, ...m, children: r }), t[24] = h, t[25] = r, t[26] = m, t[27] = I, t[28] = g) : g = t[28], g;
75
- };
76
- export {
77
- lt as D,
78
- ot as T,
79
- tt as a,
80
- et as b,
81
- O as v
82
- };
@@ -1,181 +0,0 @@
1
- "use client";
2
- import { jsxs as n, jsx as u, Fragment as be } from "react/jsx-runtime";
3
- import { c as f } from "./index.DQOqod3i.js";
4
- import { forwardRef as _e, useState as i, useRef as he, useEffect as m } from "react";
5
- import { g as T, p as X } from "./helpers.CexwVao7.js";
6
- import { u as Z } from "./useBreakpoint.1txsny17.js";
7
- import "./index.cKLI89Eg.js";
8
- import { Asterisk as me } from "../asterisk.Dwtdwpkq.js";
9
- import { D as xe } from "./Popover.ByaoNwGK.js";
10
- import { D as ve } from "./SystemFeedback.4osheYxC.js";
11
- import '../assets/Textarea.Hsq68tg1.css';const Se = "ds-textarea_textarea_10o0g_1", ge = "ds-textarea_textarea--small_10o0g_9", Ce = "ds-textarea_textarea--invalid_10o0g_121", we = "ds-textarea_textarea--resize-auto_10o0g_145", ye = "ds-textarea_root_10o0g_155", De = "ds-textarea_hint_10o0g_155", Ae = "ds-textarea_label-wrapper_10o0g_155", Te = "ds-textarea_label_10o0g_155", Ie = "ds-textarea_label--disabled_10o0g_295", Ne = "ds-textarea_label-wrapper--hidden_10o0g_307", ke = "ds-textarea_feedback_10o0g_335", Re = "ds-textarea_footer_10o0g_339", Ee = "ds-textarea_footer--has-system-feedback_10o0g_344", He = "ds-textarea_char-count_10o0g_353", $e = "ds-textarea_char-count-announcer_10o0g_366", t = {
12
- textarea: Se,
13
- textareaSmall: ge,
14
- textareaInvalid: Ce,
15
- textareaResizeAuto: we,
16
- root: ye,
17
- hint: De,
18
- labelWrapper: Ae,
19
- label: Te,
20
- labelDisabled: Ie,
21
- labelWrapperHidden: Ne,
22
- feedback: ke,
23
- footer: Re,
24
- footerHasSystemFeedback: Ee,
25
- charCount: He,
26
- charCountAnnouncer: $e
27
- }, Xe = ["medium", "small"], Pe = ({
28
- id: r,
29
- label: p,
30
- hideLabel: x,
31
- popoverContent: v
32
- }) => {
33
- if (!r)
34
- throw new Error(T("DSTextarea", 'A unique "id" prop is required. Please add a unique "id" prop to the DSTextarea component.'));
35
- if (!p)
36
- throw new Error(T("DSTextarea", `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}.`));
37
- x && v && console.warn(T("DSTextarea", "Using a popover when hideLabel is set to true is not supported."));
38
- }, Ve = _e(({
39
- id: r,
40
- label: p,
41
- charsLimitText: x = "Character limit reached",
42
- charsRemainingText: v = "Characters remaining:",
43
- className: G,
44
- defaultValue: J,
45
- disabled: I = !1,
46
- hint: S,
47
- hideLabel: N = !1,
48
- invalid: o = !1,
49
- maxLength: e,
50
- popoverContent: g,
51
- popoverInfoButtonProps: K,
52
- readonly: k = !1,
53
- required: R = !1,
54
- resize: b = "vertical",
55
- size: Q = "medium",
56
- systemFeedback: l,
57
- value: C,
58
- wrapperClassName: Y,
59
- onChange: E,
60
- onInput: H,
61
- ...L
62
- }, _) => {
63
- process.env.NODE_ENV !== "production" && Pe({
64
- id: r,
65
- label: p,
66
- hideLabel: Z(N),
67
- popoverContent: g
68
- });
69
- const [ee, $] = i(J || ""), [c, P] = i(0), [ae, V] = i(0), [te, W] = i("off"), [B, w] = i(l), [y, D] = i(o), F = C !== void 0, h = F ? C : ee, s = he(null), j = e !== void 0 && e > 0, A = y && B, re = (a) => {
70
- s.current = a, typeof _ == "function" ? _(a) : _ && (_.current = a);
71
- }, q = Z(N);
72
- m(() => {
73
- if (!e || e <= 0)
74
- return;
75
- c >= e * 0.8 ? W("polite") : W("off");
76
- const a = setTimeout(() => {
77
- V(e - c || 0);
78
- }, 1e3);
79
- return () => clearTimeout(a);
80
- }, [c]), m(() => {
81
- $(h || ""), d(), e && e > 0 && (P(h.toString().length || 0), V(e - h.toString().length || 0));
82
- }, [C]), m(() => {
83
- o && l ? (w(l), D(o)) : !o && e && e >= 0 && c >= e ? (D(!0), w(x)) : (w(l), D(o));
84
- }, [o, y, l, c]), m(() => {
85
- if (b === "auto")
86
- return d(), window.addEventListener("resize", d), () => window.removeEventListener("resize", d);
87
- }, [b, s.current]);
88
- const oe = f(t.root, Y), se = f(t.textarea, G, {
89
- // small textarea
90
- [t.textareaSmall]: Q === "small",
91
- // invalid state
92
- [t.textareaInvalid]: y,
93
- // resize handling
94
- [t.textareaResizeAuto]: b === "auto"
95
- }), ne = f(t.label, {
96
- [t.labelDisabled]: I
97
- }), le = f(t.labelWrapper, {
98
- // hide label only visually to keep them available for assistive technologies
99
- [t.labelWrapperHidden]: q
100
- }), ce = f(t.footer, {
101
- [t.footerHasSystemFeedback]: A
102
- }), z = `${r}-label`, M = `${r}-feedback`, O = `${r}-hint`, U = `${r}-char-count-announcer`, ie = S ? ` ${O}` : "", d = () => {
103
- if (s.current && b === "auto") {
104
- s.current.style.height = "auto";
105
- const a = X(s.current.scrollHeight), pe = X(2);
106
- s.current.style.height = `${// We need to add 2px (border-top & border-bottom) to the scrollHeight to prevent the textarea
107
- // from jumping as soon as the user starts typing.
108
- a + pe}rem`;
109
- }
110
- }, de = () => {
111
- const a = [];
112
- return e && e > 0 && a.push(U), o && l && a.push(M), a.length > 0 ? a.join(" ") : void 0;
113
- }, ue = (a) => {
114
- H && H(a), e && e > 0 && P(s.current?.value.length || 0), d();
115
- }, fe = (a) => {
116
- E && E(a), F || $(a.target.value);
117
- };
118
- return /* @__PURE__ */ n("div", { className: oe, children: [
119
- /* @__PURE__ */ n("div", { className: le, children: [
120
- /* @__PURE__ */ n("label", { className: ne, id: z, htmlFor: r, children: [
121
- p,
122
- R && /* @__PURE__ */ u(me, {})
123
- ] }),
124
- g && !q && /* @__PURE__ */ u(xe, { placement: "top", defaultAnchorButtonProps: K, children: g })
125
- ] }),
126
- S && /* @__PURE__ */ u("div", { className: t.hint, id: O, children: S }),
127
- /* @__PURE__ */ u(
128
- "textarea",
129
- {
130
- className: se,
131
- id: r,
132
- ...L,
133
- ref: re,
134
- "aria-labelledby": `${z}${ie}`,
135
- "aria-describedby": de(),
136
- "aria-invalid": o,
137
- "aria-disabled": k,
138
- maxLength: e,
139
- readOnly: k,
140
- required: R,
141
- disabled: I,
142
- value: h,
143
- defaultValue: void 0,
144
- rows: void 0,
145
- cols: void 0,
146
- onChange: fe,
147
- onInput: ue
148
- }
149
- ),
150
- j || A ? /* @__PURE__ */ n("div", { className: ce, children: [
151
- A && /* @__PURE__ */ u(ve, { className: t.feedback, message: B, variant: "error", id: M }),
152
- j && /* @__PURE__ */ n(be, { children: [
153
- /* @__PURE__ */ n("div", { className: t.charCount, "aria-hidden": "true", children: [
154
- c,
155
- "/",
156
- e
157
- ] }),
158
- /* @__PURE__ */ n(
159
- "div",
160
- {
161
- className: t.charCountAnnouncer,
162
- id: U,
163
- "aria-live": te,
164
- "aria-atomic": "true",
165
- children: [
166
- v,
167
- " ",
168
- ae
169
- ]
170
- }
171
- )
172
- ] })
173
- ] }) : null
174
- ] });
175
- });
176
- Ve.displayName = "DSTextarea";
177
- export {
178
- Ve as D,
179
- Xe as T,
180
- Pe as v
181
- };
@@ -1,8 +0,0 @@
1
- "use client";
2
- const s = (n, r, t = []) => {
3
- let a = r[n];
4
- return a = a.replace(/\{(\d+)\}/g, (l, e) => e < t.length ? t[e] : ""), a;
5
- }, o = (n) => (r, t) => s(r, n, t);
6
- export {
7
- o as t
8
- };
@@ -1,128 +0,0 @@
1
- "use client";
2
- import { jsxs as _, jsx as u } from "react/jsx-runtime";
3
- import { d as N } from "./chunks/index.cKLI89Eg.js";
4
- import { c as R } from "./chunks/index.DQOqod3i.js";
5
- import { D as L } from "./chunks/Button.COycNYUI.js";
6
- import { D as F } from "./chunks/SystemFeedback.4osheYxC.js";
7
- import { FilePreview as B } from "./filepreview.Defs34bv.js";
8
- import { ProgressIndicator as A } from "./progressindicator.DpmERE8T.js";
9
- import './assets/filelist.cP3O1JeJ.css';const I = new RegExp("([\\p{Ll}\\d])(\\p{Lu})", "gu"), y = new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])", "gu"), U = new RegExp("(\\d)\\p{Ll}|(\\p{L})\\d", "u"), D = /[^\p{L}\d]+/giu, v = "$1\0$2", x = "";
10
- function E(r) {
11
- let e = r.trim();
12
- e = e.replace(I, v).replace(y, v), e = e.replace(D, "\0");
13
- let o = 0, a = e.length;
14
- for (; e.charAt(o) === "\0"; )
15
- o++;
16
- if (o === a)
17
- return [];
18
- for (; e.charAt(a - 1) === "\0"; )
19
- a--;
20
- return e.slice(o, a).split(/\0/g);
21
- }
22
- function T(r) {
23
- const e = E(r);
24
- for (let o = 0; o < e.length; o++) {
25
- const a = e[o], s = U.exec(a);
26
- if (s) {
27
- const n = s.index + (s[1] ?? s[2]).length;
28
- e.splice(o, 1, a.slice(0, n), a.slice(n));
29
- }
30
- }
31
- return e;
32
- }
33
- function W(r, e) {
34
- const [o, a, s] = z(r, e);
35
- return o + a.map($(e?.locale)).join(e?.delimiter ?? " ") + s;
36
- }
37
- function S(r, e) {
38
- return W(r, { delimiter: "-", ...e });
39
- }
40
- function $(r) {
41
- return r === !1 ? (e) => e.toLowerCase() : (e) => e.toLocaleLowerCase(r);
42
- }
43
- function z(r, e = {}) {
44
- const o = e.split ?? (e.separateNumbers ? T : E), a = e.prefixCharacters ?? x, s = e.suffixCharacters ?? x;
45
- let n = 0, i = r.length;
46
- for (; n < r.length; ) {
47
- const p = r.charAt(n);
48
- if (!a.includes(p))
49
- break;
50
- n++;
51
- }
52
- for (; i > n; ) {
53
- const p = i - 1, c = r.charAt(p);
54
- if (!s.includes(c))
55
- break;
56
- i = p;
57
- }
58
- return [
59
- r.slice(0, n),
60
- o(r.slice(n, i)),
61
- r.slice(i)
62
- ];
63
- }
64
- const M = "ds-input-file_root_1s9kg_1", j = "ds-input-file_file-wrapper_1s9kg_7", X = "ds-input-file_file-wrapper--invalid_1s9kg_16", G = "ds-input-file_file-details_1s9kg_20", H = "ds-input-file_file-name_1s9kg_34", K = "ds-input-file_file-size_1s9kg_38", O = "ds-input-file_progress-bar_1s9kg_54", V = "ds-input-file_feedback_1s9kg_59", d = {
65
- root: M,
66
- fileWrapper: j,
67
- fileWrapperInvalid: X,
68
- fileDetails: G,
69
- fileName: H,
70
- fileSize: K,
71
- progressBar: O,
72
- feedback: V
73
- }, q = (r) => r >= 1024 * 1024 ? (r / (1024 * 1024)).toFixed(1) + " MB" : r >= 1024 ? (r / 1024).toFixed(0) + " KB" : r + " B", oe = (r) => {
74
- const e = N.c(11), {
75
- files: o,
76
- onRemoveFile: a,
77
- t: s,
78
- showProgress: n
79
- } = r, i = J, p = Q;
80
- let c;
81
- if (e[0] !== o || e[1] !== a || e[2] !== n || e[3] !== s) {
82
- let g;
83
- e[5] !== a || e[6] !== n || e[7] !== s ? (g = (t, b) => {
84
- const l = t.uploadStatus === "error", m = t.uploadStatus === "success", f = t.uploadStatus === "uploading";
85
- let P = "indeterminate";
86
- if (t.uploadPercent !== void 0 && t.uploadPercent !== "indeterminate") {
87
- const C = m ? 100 : 0, w = t.uploadPercent === void 0 ? C : t.uploadPercent;
88
- P = Math.min(Math.max(w, 0), 100);
89
- }
90
- const k = f ? s("fileListCancelUploadButtonLabel", [t.name]) : m ? s("fileListDeleteFileButtonLabel", [t.name]) : s("fileListRemoveSelectionButtonLabel", [t.name]);
91
- return /* @__PURE__ */ _("div", { className: R(d.fileWrapper, {
92
- [d.fileWrapperInvalid]: l
93
- }), "aria-busy": f ? "true" : "false", "aria-describedby": f ? p(t.name) : i(t.name), "aria-invalid": l ? !0 : void 0, children: [
94
- /* @__PURE__ */ u(B, { file: t, t: s }),
95
- /* @__PURE__ */ _("div", { className: d.fileDetails, children: [
96
- /* @__PURE__ */ u("span", { className: d.fileName, children: t.name }),
97
- /* @__PURE__ */ u("span", { className: d.fileSize, children: q(t.size) })
98
- ] }),
99
- /* @__PURE__ */ _("div", { children: [
100
- l && t.retryButtonProps && /* @__PURE__ */ _(L, { ...t.retryButtonProps, onClick: t.retryButtonProps.onClick, hideLabel: !0, iconName: "arrow-counterclockwise", size: "small", variant: "ghost", type: "button", "aria-describedby": t.feedback ? i(t.name) : void 0, tooltip: s("retry"), children: [
101
- s("retry"),
102
- "."
103
- ] }),
104
- (f || m) && !t.removeButtonProps?.onClick ? null : /* @__PURE__ */ _(L, { ...t.removeButtonProps, onClick: () => {
105
- t.uploadStatus !== void 0 && t.removeButtonProps?.onClick ? t.removeButtonProps?.onClick() : a(b);
106
- }, hideLabel: !0, iconName: "cross", size: "small", variant: "ghost", type: "button", "aria-describedby": t.feedback && l ? i(t.name) : void 0, tooltip: k, children: [
107
- k,
108
- "."
109
- ] })
110
- ] }),
111
- (f || l) && n && /* @__PURE__ */ u(A, { id: p(t.name), fileName: t.name, percent: P, progressStatus: l ? "error" : "uploading", className: d.progressBar, variant: n, t: s }),
112
- (t.feedback && (l || m) || t.feedback === void 0 && m) && /* @__PURE__ */ u(F, { variant: l ? "error" : "success", id: i(t.name), message: t.feedback || s("success"), className: d.feedback })
113
- ] }, b + t.name);
114
- }, e[5] = a, e[6] = n, e[7] = s, e[8] = g) : g = e[8], c = o.map(g), e[0] = o, e[1] = a, e[2] = n, e[3] = s, e[4] = c;
115
- } else
116
- c = e[4];
117
- let h;
118
- return e[9] !== c ? (h = /* @__PURE__ */ u("div", { className: d.root, children: c }), e[9] = c, e[10] = h) : h = e[10], h;
119
- };
120
- function J(r) {
121
- return `file-feedback-${S(r)}`;
122
- }
123
- function Q(r) {
124
- return `progress-${S(r)}`;
125
- }
126
- export {
127
- oe as FileList
128
- };
@@ -1,94 +0,0 @@
1
- "use client";
2
- import { jsx as d } from "react/jsx-runtime";
3
- import { d as z } from "./chunks/index.cKLI89Eg.js";
4
- import { useState as N } from "react";
5
- import { D as w } from "./chunks/Icon.DYtaQgbw.js";
6
- import './assets/filepreview.2cdH-1Xs.css';const S = "ds-input-file_preview_15s1u_1", E = "ds-input-file_root_15s1u_7", D = "ds-input-file_file-icon_15s1u_7", u = {
7
- preview: S,
8
- root: E,
9
- fileIcon: D
10
- }, x = {
11
- nonDisplayableImages: ["heic", "heif", "raw", "cr2", "cr3", "nef", "arw", "orf", "rw2", "dng", "svgz", "jp2", "jxl", "dds", "exr", "psd", "ai", "indd"],
12
- documents: [
13
- "doc",
14
- "docx",
15
- "odt",
16
- "fodt",
17
- "gdoc",
18
- "rtf",
19
- "dot",
20
- "dotx",
21
- "pages",
22
- "wpd",
23
- "abw",
24
- "tmd",
25
- "lwp",
26
- "wps",
27
- "wks",
28
- // Excel and spreadsheet formats
29
- "xls",
30
- "xlsx",
31
- "xlsm",
32
- "xlsb",
33
- "xlt",
34
- "xltx",
35
- "ods",
36
- "fods",
37
- "csv",
38
- "tsv",
39
- "gsheet"
40
- ],
41
- videos: ["mp4", "m4v", "mov", "webm", "ogv", "avi", "wmv", "flv", "f4v", "mkv", "3gp", "3g2", "ts", "vob", "rm", "rmvb", "mpeg", "mpg"],
42
- archives: ["zip", "rar", "7z", "tar", "gz", "tar.gz", "tgz", "xz", "tar.xz", "bz2", "tar.bz2", "lzma", "cab", "iso"]
43
- }, L = (f, e) => {
44
- const {
45
- documents: t,
46
- videos: r,
47
- archives: p
48
- } = x;
49
- return f.type.startsWith("image/") ? "file-type-image" : t.includes(e) ? "file-type-doc" : f.type === "application/pdf" ? "file-type-pdf" : f.type.startsWith("video/") && r.includes(e) ? "file-type-video" : p.includes(e) ? "file-type-zip" : "file";
50
- }, T = (f) => {
51
- const e = z.c(25), {
52
- file: t,
53
- t: r
54
- } = f, [p, h] = N(!1);
55
- let o, l, a, n, i;
56
- if (e[0] !== t || e[1] !== p || e[2] !== r) {
57
- i = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
58
- e: {
59
- const _ = t.name.split(".").pop()?.toLowerCase() || "", {
60
- nonDisplayableImages: I
61
- } = x, b = t.type.startsWith("image/") && !I.includes(_);
62
- if (b && p) {
63
- let s;
64
- e[8] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ d("span", { className: u.root, children: /* @__PURE__ */ d(w, { "aria-hidden": "true", name: "file-type-image", className: u.fileIcon }) }), e[8] = s) : s = e[8], i = s;
65
- break e;
66
- }
67
- if (b) {
68
- let s;
69
- e[9] !== t ? (s = URL.createObjectURL(t), e[9] = t, e[10] = s) : s = e[10];
70
- let m;
71
- e[11] !== t.name || e[12] !== r ? (m = r("fileListPreviewAltText", [t.name]), e[11] = t.name, e[12] = r, e[13] = m) : m = e[13];
72
- let g;
73
- e[14] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (g = () => {
74
- h(!0);
75
- }, e[14] = g) : g = e[14];
76
- let y;
77
- e[15] !== s || e[16] !== m ? (y = /* @__PURE__ */ d("img", { src: s, alt: m, className: u.preview, onError: g }), e[15] = s, e[16] = m, e[17] = y) : y = e[17], i = y;
78
- break e;
79
- }
80
- n = u.root, o = w, l = "true", a = L(t, _);
81
- }
82
- e[0] = t, e[1] = p, e[2] = r, e[3] = o, e[4] = l, e[5] = a, e[6] = n, e[7] = i;
83
- } else
84
- o = e[3], l = e[4], a = e[5], n = e[6], i = e[7];
85
- if (i !== /* @__PURE__ */ Symbol.for("react.early_return_sentinel"))
86
- return i;
87
- let c;
88
- e[18] !== o || e[19] !== l || e[20] !== a ? (c = /* @__PURE__ */ d(o, { "aria-hidden": l, name: a, className: u.fileIcon }), e[18] = o, e[19] = l, e[20] = a, e[21] = c) : c = e[21];
89
- let v;
90
- return e[22] !== n || e[23] !== c ? (v = /* @__PURE__ */ d("span", { className: n, children: c }), e[22] = n, e[23] = c, e[24] = v) : v = e[24], v;
91
- };
92
- export {
93
- T as FilePreview
94
- };
package/input.ChMzyHej.js DELETED
@@ -1,175 +0,0 @@
1
- "use client";
2
- import { jsxs as u, jsx as s } from "react/jsx-runtime";
3
- import { c as i } from "./chunks/index.DQOqod3i.js";
4
- import { forwardRef as _t, useState as b, useRef as R, useEffect as mt } from "react";
5
- import { u as M } from "./chunks/useBreakpoint.1txsny17.js";
6
- import "./chunks/index.cKLI89Eg.js";
7
- import { u as V } from "./chunks/useIsomorphicLayoutEffect.CnJ9AMFS.js";
8
- import { Asterisk as bt } from "./asterisk.Dwtdwpkq.js";
9
- import { D as $ } from "./chunks/Button.COycNYUI.js";
10
- import { D as xt } from "./chunks/Icon.DYtaQgbw.js";
11
- import { D as ht } from "./chunks/Popover.ByaoNwGK.js";
12
- import { D as It } from "./chunks/SystemFeedback.4osheYxC.js";
13
- import { v as gt, c as St, M as yt, a as Dt, s as Bt, i as H, b as Nt } from "./chunks/Input.utils.CkmzxIrU.js";
14
- import './assets/input.BEBgyvkK.css';const kt = "ds-input_input_1x68c_1", Ct = "ds-input_input--small_1x68c_9", Rt = "ds-input_input--invalid_1x68c_121", Ht = "ds-input_input--has-leading-icon_1x68c_179", Lt = "ds-input_input--has-action-button_1x68c_182", vt = "ds-input_input--has-affix_1x68c_197", wt = "ds-input_input--is-ready_1x68c_211", At = "ds-input_root_1x68c_218", Wt = "ds-input_hint_1x68c_218", Pt = "ds-input_label-wrapper_1x68c_218", Tt = "ds-input_wrapper_1x68c_222", Et = "ds-input_affix_1x68c_228", Ft = "ds-input_affix--small_1x68c_249", Ot = "ds-input_prefix_1x68c_262", jt = "ds-input_suffix_1x68c_268", Xt = "ds-input_affix--disabled_1x68c_274", Mt = "ds-input_affix--readonly_1x68c_285", Vt = "ds-input_leading-icon_1x68c_321", $t = "ds-input_leading-icon--small_1x68c_333", Gt = "ds-input_leading-icon--disabled_1x68c_336", Ut = "ds-input_action-button_1x68c_345", Jt = "ds-input_label_1x68c_218", Kt = "ds-input_label--disabled_1x68c_364", Qt = "ds-input_label-wrapper--hidden_1x68c_376", Yt = "ds-input_feedback_1x68c_404", t = {
15
- input: kt,
16
- inputSmall: Ct,
17
- inputInvalid: Rt,
18
- inputHasLeadingIcon: Ht,
19
- inputHasActionButton: Lt,
20
- inputHasAffix: vt,
21
- inputIsReady: wt,
22
- root: At,
23
- hint: Wt,
24
- labelWrapper: Pt,
25
- wrapper: Tt,
26
- affix: Et,
27
- affixSmall: Ft,
28
- prefix: Ot,
29
- suffix: jt,
30
- affixDisabled: Xt,
31
- affixReadonly: Mt,
32
- leadingIcon: Vt,
33
- leadingIconSmall: $t,
34
- leadingIconDisabled: Gt,
35
- actionButton: Ut,
36
- label: Jt,
37
- labelDisabled: Kt,
38
- labelWrapperHidden: Qt,
39
- feedback: Yt
40
- }, Zt = _t(({
41
- id: c,
42
- label: L,
43
- aria: v,
44
- actionButtonProps: w,
45
- className: G,
46
- disabled: n = !1,
47
- hint: x,
48
- hideLabel: A = !1,
49
- invalid: p = !1,
50
- leadingIconName: f,
51
- leadingIconSource: _,
52
- prefix: r,
53
- popoverContent: h,
54
- popoverInfoButtonProps: U,
55
- readonly: d = !1,
56
- required: W = !1,
57
- size: e = "medium",
58
- suffix: l,
59
- systemFeedback: I,
60
- type: o = "text",
61
- ...P
62
- }, m) => {
63
- process.env.NODE_ENV !== "production" && (gt({
64
- hideLabel: M(A),
65
- id: c,
66
- label: L,
67
- prefix: r,
68
- popoverContent: h,
69
- suffix: l,
70
- leadingIconName: f,
71
- leadingIconSource: _,
72
- actionButtonProps: w
73
- }), St(o, P.autoComplete));
74
- const {
75
- iconName: g,
76
- iconSource: S,
77
- label: J,
78
- onClick: K,
79
- ...Q
80
- } = w || {}, [Y, Z] = b(!1), [q, z] = b(!1), [y, tt] = b(!1), [at, nt] = b({}), D = R(null), st = (a) => {
81
- D.current = a, typeof m == "function" ? m(a) : m && (m.current = a);
82
- }, it = r?.substring(0, yt), B = R(null), et = l?.substring(0, Dt), N = R(null), T = M(A);
83
- V(() => {
84
- const a = e === "medium" ? 16 : 8, k = {};
85
- if (B.current) {
86
- const C = B.current.offsetWidth;
87
- k.paddingInlineStart = a + C + "px";
88
- }
89
- if (N.current) {
90
- const C = N.current.offsetWidth;
91
- k.paddingInlineEnd = a + C + "px";
92
- }
93
- nt(k), Z(!0);
94
- }, [r, l, e, q]), V(() => {
95
- (async () => "fonts" in document && (await document.fonts.load('1em "STIHL Contraface Digital Text Regular"'), z(!0)))();
96
- }, []), mt(() => {
97
- const a = Bt(H(o), Nt(o));
98
- tt(a);
99
- }, [o]);
100
- const E = i(t.affix, {
101
- [t.affixSmall]: e === "small",
102
- [t.affixDisabled]: n,
103
- [t.affixReadonly]: d
104
- }), F = `${c}-label`, O = `${c}-feedback`, j = `${c}-hint`, lt = () => {
105
- const a = [F];
106
- return x && a.push(j), v?.["aria-labelledby"] && a.push(v["aria-labelledby"]), a.join(" ");
107
- }, ot = [p && I && O].filter(Boolean).join(" ") || void 0, ct = i(t.root, G), rt = i(t.input, {
108
- // small input
109
- [t.inputSmall]: e === "small",
110
- // invalid state
111
- [t.inputInvalid]: p,
112
- // leading icon
113
- [t.inputHasLeadingIcon]: f || _,
114
- // prefix/suffix
115
- [t.inputHasAffix]: r || l,
116
- // action button
117
- [t.inputHasActionButton]: g || S || y,
118
- [t.inputIsReady]: Y
119
- }), dt = i(t.label, {
120
- [t.labelDisabled]: n
121
- }), ut = i(t.labelWrapper, {
122
- // hide label only visually to keep them available for assistive technologies
123
- [t.labelWrapperHidden]: T
124
- }), pt = i(t.leadingIcon, {
125
- [t.leadingIconSmall]: e === "small",
126
- [t.leadingIconDisabled]: n
127
- }), X = i(t.actionButton, {
128
- [t.actionButtonSmall]: e === "small"
129
- }), ft = (a) => {
130
- D.current && !n && !d && D.current.showPicker(), a.preventDefault();
131
- };
132
- return /* @__PURE__ */ u("div", { className: ct, children: [
133
- /* @__PURE__ */ u("div", { className: ut, children: [
134
- /* @__PURE__ */ u("label", { className: dt, id: F, htmlFor: c, children: [
135
- L,
136
- W && /* @__PURE__ */ s(bt, {})
137
- ] }),
138
- h && !T && /* @__PURE__ */ s(ht, { placement: "top", defaultAnchorButtonProps: U, children: h })
139
- ] }),
140
- x && /* @__PURE__ */ s("div", { className: t.hint, id: j, children: x }),
141
- /* @__PURE__ */ u("div", { className: t.wrapper, children: [
142
- r && /* @__PURE__ */ s(
143
- "span",
144
- {
145
- className: i(E, t.prefix),
146
- ref: B,
147
- "aria-disabled": n,
148
- children: it
149
- }
150
- ),
151
- !r && (f || _) && /* @__PURE__ */ s(xt, { name: f, theme: "light", source: _, className: pt, "aria-hidden": "true" }),
152
- /* @__PURE__ */ s("input", { type: o, className: rt, id: c, ...P, ref: st, style: at, "aria-labelledby": lt(), "aria-describedby": ot, "aria-invalid": p, "aria-disabled": d, readOnly: d, required: W, disabled: n }),
153
- l && /* @__PURE__ */ s(
154
- "span",
155
- {
156
- className: i(E, t.suffix),
157
- ref: N,
158
- "aria-disabled": n,
159
- children: et
160
- }
161
- ),
162
- !l && !y && (g || S) && /* @__PURE__ */ s($, { ...Q, hideLabel: !0, theme: "light", iconName: g, iconSource: S, variant: "ghost", className: X, size: e, onClick: K, type: "button", disabled: n || d, children: J }),
163
- !l && y && !d && !n && /* @__PURE__ */ u($, { hideLabel: !0, theme: "light", iconName: H(o) ? "calendar" : "clock", variant: "ghost", className: X, size: e, onClick: ft, type: "button", children: [
164
- "Open ",
165
- H(o) ? "date" : "time",
166
- " picker"
167
- ] })
168
- ] }),
169
- p && I && /* @__PURE__ */ s(It, { className: t.feedback, message: I, variant: "error", id: O })
170
- ] });
171
- });
172
- Zt.displayName = "DSInput";
173
- export {
174
- Zt as DSInput
175
- };