@stihl-design-system/components 1.0.0-RC.12 → 1.0.0-RC.14

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 (87) hide show
  1. package/README.md +1 -1
  2. package/{accordion.Rvtiu8Y4.js → accordion.C6_sqiW2.js} +1 -1
  3. package/{arialiveregions.Cyycgs8g.js → arialiveregions.2dxodwBP.js} +1 -1
  4. package/assets/TabPane.zywjfwo8.css +1 -0
  5. package/assets/Tabs.DUqlqP6R.css +1 -0
  6. package/assets/numberindicator.BJ9vFpnd.css +1 -0
  7. package/{button.M4nXjcUn.js → button.BfcWQZhx.js} +1 -1
  8. package/{checkbox.Cb2_ey6U.js → checkbox.Dt0OWryN.js} +1 -1
  9. package/{checkboxgroup.DBDmB-zR.js → checkboxgroup.je32bRPr.js} +2 -2
  10. package/{chip.C_1tGqvZ.js → chip.CpnDX4Ro.js} +1 -1
  11. package/{chipgroup.BvTj1ziW.js → chipgroup.Cy76KMWu.js} +17 -16
  12. package/chunks/{Accordion.CB6jB3s_.js → Accordion.Bza3TO4Y.js} +1 -1
  13. package/chunks/AriaLiveRegions.utils.Bq6Mp2bE.js +40 -0
  14. package/chunks/{CheckboxGroup.S6i5EOc4.js → CheckboxGroup.C_2ZwEQJ.js} +38 -35
  15. package/chunks/{Chip.CMlPUyOJ.js → Chip.BvlKC503.js} +30 -24
  16. package/chunks/{CustomReactSelect.Cg_XW3YK.js → CustomReactSelect.CB41lklE.js} +335 -335
  17. package/chunks/{Dialog.CudsqNag.js → Dialog.ClBjJWOh.js} +2 -2
  18. package/chunks/{Drawer.ueG2Bzr9.js → Drawer.ReDW3ohH.js} +2 -2
  19. package/chunks/{Fieldset.Cjmkgxxk.js → Fieldset.Ct_JFRs9.js} +2 -2
  20. package/chunks/{Input.utils.ChV6RJsh.js → Input.utils.DYbmWlx6.js} +19 -21
  21. package/chunks/{InputPassword.CNLbBFjx.js → InputPassword.Cvk5J8w1.js} +18 -18
  22. package/chunks/{InputSearch.CHA6mkX_.js → InputSearch.BIIW-ERk.js} +4 -4
  23. package/chunks/{InputStepper.xmWGU9pU.js → InputStepper.DGzR3KY6.js} +49 -47
  24. package/chunks/{Notification.o6pagKQy.js → Notification.uAEjPywP.js} +31 -32
  25. package/chunks/RadioGroup.D10-pe9H.js +146 -0
  26. package/chunks/{Select.E6gLFYLk.js → Select.DsLnW29U.js} +3 -3
  27. package/chunks/TabPane.CYuUi0oL.js +51 -0
  28. package/chunks/Tabs.D_JAsvoh.js +270 -0
  29. package/chunks/{Textarea.DUBSOpNL.js → Textarea.Dh9R9YdZ.js} +19 -18
  30. package/chunks/{Toast.DyEi2GEP.js → Toast.j7LPnQ36.js} +1 -1
  31. package/chunks/has-window.ut_-aShB.js +5 -0
  32. package/chunks/helpers.CcqWV-wZ.js +8 -0
  33. package/chunks/{useBreakpoint.5xBNDiCf.js → useBreakpoint.B8XxjSVJ.js} +9 -9
  34. package/chunks/useIsomorphicLayoutEffect.CnJ9AMFS.js +7 -0
  35. package/{combobox.DUzv8jzM.js → combobox.D6zXg976.js} +1 -1
  36. package/components/AriaLiveRegions/AriaLiveRegions.utils.d.ts +2 -2
  37. package/components/Combobox/CustomReactSelect/CustomReactSelect.d.ts +1 -1
  38. package/components/Input/Input.d.ts +6 -0
  39. package/components/InputPassword/InputPassword.d.ts +3 -3
  40. package/components/Notification/Notification.d.ts +2 -6
  41. package/components/NumberIndicator/NumberIndicator.d.ts +12 -0
  42. package/components/NumberIndicator/NumberIndicator.test.d.ts +1 -0
  43. package/components/NumberIndicator/NumberIndicator.utils.d.ts +2 -0
  44. package/components/Tabs/TabPane/TabPane.d.ts +10 -0
  45. package/components/Tabs/TabPane/TabPane.utils.d.ts +3 -0
  46. package/components/Tabs/TabPane/TabPane.utils.test.d.ts +1 -0
  47. package/components/Tabs/Tabs.d.ts +42 -0
  48. package/components/Tabs/Tabs.test.d.ts +1 -0
  49. package/components/Tabs/Tabs.utils.d.ts +11 -0
  50. package/components/Tabs/Tabs.utils.test.d.ts +1 -0
  51. package/{customreactselect.CXmBRqQ9.js → customreactselect.BcjDvZG6.js} +2 -2
  52. package/{dialog.DYlBUsOD.js → dialog.BkVOgeWY.js} +2 -2
  53. package/{drawer.CvhbP1ra.js → drawer.DM_NKGTQ.js} +2 -2
  54. package/{fieldset.CtUGEdLv.js → fieldset.CSNoVbL1.js} +1 -1
  55. package/index.d.ts +4 -2
  56. package/index.es.js +134 -127
  57. package/{input.BEnCFNM-.js → input.BbnmbMCI.js} +49 -47
  58. package/{inputpassword.B-D_jB9w.js → inputpassword.KnZRwWCQ.js} +3 -3
  59. package/{inputsearch.CaSpklR1.js → inputsearch.DgYJPZ2v.js} +4 -4
  60. package/inputstepper.T_of1Gz0.js +15 -0
  61. package/{link.DREJAoPG.js → link.L8O_InKe.js} +1 -1
  62. package/{notification.JWhrkEcE.js → notification.Bt9TbAAt.js} +2 -2
  63. package/numberindicator.UU7FSouT.js +26 -0
  64. package/numberindicator.d.ts +2 -0
  65. package/package.json +4 -4
  66. package/{radio.DEILy_lV.js → radio.B-2uuWHq.js} +1 -1
  67. package/{radiogroup.DeU-HdlP.js → radiogroup.DM_lF4hI.js} +3 -3
  68. package/{select.BYraFJzz.js → select.COLuwr89.js} +2 -2
  69. package/{skiptocontent.BxvpIB7H.js → skiptocontent.DxogCFvU.js} +2 -2
  70. package/styles/scss/ds/lib/theme.scss +2 -0
  71. package/tabpane.BnQBzVXw.js +8 -0
  72. package/tabpane.d.ts +2 -0
  73. package/tabs.BaELlVri.js +15 -0
  74. package/tabs.d.ts +2 -0
  75. package/textarea.Wcl_pVBb.js +13 -0
  76. package/{toast.n1QUINSA.js → toast.DQlMWU6I.js} +2 -2
  77. package/{toastmanager.B7EZ4JSI.js → toastmanager.DxHFtr5C.js} +17 -17
  78. package/utils/helpers.d.ts +7 -0
  79. package/utils/index.d.ts +1 -0
  80. package/utils/isAnimationDisabled.d.ts +1 -0
  81. package/chunks/AriaLiveRegions.utils.BGSZafnS.js +0 -34
  82. package/chunks/RadioGroup.Crj7NoOs.js +0 -137
  83. package/chunks/has-document.r9i9TxKV.js +0 -5
  84. package/chunks/helpers.B1JT5ShS.js +0 -7
  85. package/inputstepper.C7KD1-0S.js +0 -13
  86. package/textarea.CBvH0ljM.js +0 -12
  87. package/utils/has-document.d.ts +0 -1
@@ -0,0 +1,146 @@
1
+ "use client";
2
+ import { j as f } from "./jsx-runtime.C115EyI4.js";
3
+ import { c as y } from "./index.CvOaL64Y.js";
4
+ import { forwardRef as C, useState as q } from "react";
5
+ import { D as I } from "./Fieldset.Ct_JFRs9.js";
6
+ import { DSRadio as A } from "../radio.B-2uuWHq.js";
7
+ import { g as a, r as h } from "./helpers.CcqWV-wZ.js";
8
+ import '../assets/RadioGroup.BfMo157q.css';const B = "ds-radio-group_root_12fot_1", M = "ds-radio-group_root--horizontal_12fot_9", O = "ds-radio-group_root--invalid_12fot_12", m = {
9
+ root: B,
10
+ "root--horizontal": "ds-radio-group_root--horizontal_12fot_9",
11
+ rootHorizontal: M,
12
+ "root--invalid": "ds-radio-group_root--invalid_12fot_12",
13
+ rootInvalid: O
14
+ }, v = (t) => t.some(({ hint: e }) => !!e), G = (t) => t.some(({ customArea: e }) => !!e), V = ({
15
+ legend: t,
16
+ name: e,
17
+ options: r,
18
+ description: l,
19
+ direction: i,
20
+ id: s,
21
+ systemFeedback: n
22
+ }) => {
23
+ if (!s && (l || n))
24
+ throw new Error(
25
+ a(
26
+ "DSRadioGroup",
27
+ 'A unique "id" prop is required when providing the description or systemFeedback property. Please add a unique "id" prop to the DSRadioGroup component.'
28
+ )
29
+ );
30
+ if (!t)
31
+ throw new Error(
32
+ a(
33
+ "DSRadioGroup",
34
+ h("legend", "DSRadioGroup")
35
+ )
36
+ );
37
+ if (!e)
38
+ throw new Error(
39
+ a(
40
+ "DSRadioGroup",
41
+ h("name", "DSRadioGroup")
42
+ )
43
+ );
44
+ if (!r)
45
+ throw new Error(
46
+ a(
47
+ "DSRadioGroup",
48
+ h("options", "DSRadioGroup")
49
+ )
50
+ );
51
+ if (i === "horizontal" && v(r))
52
+ throw new Error(
53
+ a(
54
+ "DSRadioGroup",
55
+ "Horizontal direction is not possible when options contain a hint. Please remove hints or change direction property to 'vertical'."
56
+ )
57
+ );
58
+ if (i === "horizontal" && G(r))
59
+ throw new Error(
60
+ a(
61
+ "DSRadioGroup",
62
+ "Horizontal direction is not possible when options contain a custom area. Please remove custom areas or change direction property to 'vertical'."
63
+ )
64
+ );
65
+ }, b = C(
66
+ ({
67
+ legend: t,
68
+ name: e,
69
+ options: r,
70
+ className: l,
71
+ defaultValue: i,
72
+ description: s,
73
+ direction: n = "vertical",
74
+ disabled: d = !1,
75
+ hideUncheckedHints: D = !1,
76
+ id: p,
77
+ invalid: u = !1,
78
+ required: S = !1,
79
+ systemFeedback: c,
80
+ value: w,
81
+ onChange: R,
82
+ ...z
83
+ }, E) => {
84
+ process.env.NODE_ENV !== "production" && V({
85
+ legend: t,
86
+ name: e,
87
+ options: r,
88
+ description: s,
89
+ direction: n,
90
+ id: p,
91
+ systemFeedback: c
92
+ });
93
+ const [H, x] = q(i), _ = w !== void 0, g = _ ? w : H, j = y(m.root, {
94
+ // In case of longer copy, use vertical direction
95
+ [m.rootHorizontal]: n === "horizontal" && !v(r) && !G(r),
96
+ [m.rootInvalid]: u && !!c
97
+ }), N = (o) => {
98
+ if (d) {
99
+ o.preventDefault();
100
+ return;
101
+ }
102
+ _ || x(
103
+ o.target.value
104
+ ), R && R(o);
105
+ }, P = v(r) && !D;
106
+ return /* @__PURE__ */ f.jsx(
107
+ I,
108
+ {
109
+ id: p,
110
+ legend: t,
111
+ className: l,
112
+ description: s,
113
+ disabled: d,
114
+ required: S,
115
+ invalid: u,
116
+ systemFeedback: c,
117
+ ...z,
118
+ role: "radiogroup",
119
+ onChange: N,
120
+ children: /* @__PURE__ */ f.jsx("div", { className: j, children: r.map((o) => /* @__PURE__ */ f.jsx(
121
+ A,
122
+ {
123
+ name: e,
124
+ checked: o.value === g,
125
+ disabled: d,
126
+ hideUncheckedHint: D,
127
+ hint: o.hint,
128
+ invalid: u,
129
+ isBold: P,
130
+ required: S,
131
+ ref: o.value === g ? E : null,
132
+ ...o
133
+ },
134
+ p + o.label + o.value + o.hint
135
+ )) })
136
+ }
137
+ );
138
+ }
139
+ );
140
+ b.displayName = "DSRadioGroup";
141
+ export {
142
+ b as D,
143
+ G as a,
144
+ v as o,
145
+ V as v
146
+ };
@@ -2,11 +2,11 @@
2
2
  import { j as t } from "./jsx-runtime.C115EyI4.js";
3
3
  import { c as r } from "./index.CvOaL64Y.js";
4
4
  import { useRef as C, useState as q, useEffect as W } from "react";
5
- import { u as F } from "./useBreakpoint.5xBNDiCf.js";
5
+ import { u as F } from "./useBreakpoint.B8XxjSVJ.js";
6
6
  import { Asterisk as M } from "../asterisk.DpzETKdT.js";
7
7
  import { D as O } from "./Icon.BCmt_XBG.js";
8
8
  import { DSSystemFeedback as T } from "../systemfeedback.C3Pfxxpp.js";
9
- import { g as p } from "./helpers.B1JT5ShS.js";
9
+ import { g as p } from "./helpers.CcqWV-wZ.js";
10
10
  import '../assets/Select.D4EXgIbz.css';const V = "ds-select_root_1ui0h_1", Z = "ds-select_hint_1ui0h_9", J = "ds-select_label_1ui0h_9", K = "ds-select_wrapper_1ui0h_13", Q = "ds-select_affix_1ui0h_19", U = "ds-select_affix--small_1ui0h_40", X = "ds-select_affix--disabled_1ui0h_53", Y = "ds-select_prefix_1ui0h_61", z = "ds-select_affix--readonly_1ui0h_64", G = "ds-select_suffix_1ui0h_74", ee = "ds-select_action-button_1ui0h_81", se = "ds-select_label--hidden_1ui0h_99", te = "ds-select_label--disabled_1ui0h_112", le = "ds-select_feedback_1ui0h_132", ce = "ds-select_select-wrapper_1ui0h_137", ae = "ds-select_select_1ui0h_137", ne = "ds-select_select--invalid_1ui0h_262", ie = "ds-select_select--small_1ui0h_269", oe = "ds-select_input--has-leading-icon_1ui0h_322", de = "ds-select_input--has-action-button_1ui0h_325", re = "ds-select_input--has-second-action-button_1ui0h_328", _e = "ds-select_select--has-leading-icon_1ui0h_331", ue = "ds-select_select--has-action-button_1ui0h_334", he = "ds-select_select--has-second-action-button_1ui0h_337", fe = "ds-select_select--has-affix_1ui0h_340", pe = "ds-select_select--is-ready_1ui0h_354", be = "ds-select_select--placeholder_1ui0h_371", me = "ds-select_chevron_1ui0h_410", xe = "ds-select_chevron--small_1ui0h_414", ve = "ds-select_chevron--disabled_1ui0h_417", e = {
11
11
  root: V,
12
12
  hint: Z,
@@ -67,7 +67,7 @@ import '../assets/Select.D4EXgIbz.css';const V = "ds-select_root_1ui0h_1", Z = "
67
67
  throw new Error(
68
68
  p(
69
69
  "DSSelect",
70
- 'A unique "id" prop is required. Please add an unique "id" prop to the DSSelect component.'
70
+ 'A unique "id" prop is required. Please add a unique "id" prop to the DSSelect component.'
71
71
  )
72
72
  );
73
73
  if (!a)
@@ -0,0 +1,51 @@
1
+ "use client";
2
+ import { j as u } from "./jsx-runtime.C115EyI4.js";
3
+ import { c as i } from "./index.CvOaL64Y.js";
4
+ import { useRef as f, useState as m, useEffect as p } from "react";
5
+ import '../assets/TabPane.zywjfwo8.css';const T = "ds-tabs_tabpane_30tnb_1", d = {
6
+ tabpane: T
7
+ }, E = (e) => [
8
+ "A",
9
+ "BUTTON",
10
+ "INPUT",
11
+ "SELECT",
12
+ "TEXTAREA",
13
+ "AUDIO",
14
+ "VIDEO"
15
+ ].includes(e.tagName) || e.hasAttribute("contenteditable"), g = (e) => {
16
+ const t = (a) => E(a) ? !0 : Array.from(a.children).some(
17
+ (s) => t(s)
18
+ );
19
+ return t(e);
20
+ }, A = (e, t) => `tabs-${e}-tabbutton-${t}`, h = (e, t, a) => `tabs-${e}-tabpanel-${t}-${a}`, x = ({
21
+ id: e,
22
+ content: t,
23
+ index: a,
24
+ selectedTabIndex: s,
25
+ tabListId: r,
26
+ className: o
27
+ }) => {
28
+ const n = f(null), [c, l] = m(!1);
29
+ p(() => {
30
+ n.current && l(g(n.current));
31
+ }, [t]);
32
+ const b = i(d.tabpane, o);
33
+ return /* @__PURE__ */ u.jsx(
34
+ "div",
35
+ {
36
+ id: h(r, e, a),
37
+ role: "tabpanel",
38
+ "aria-labelledby": A(r, e),
39
+ hidden: s !== a,
40
+ tabIndex: c ? void 0 : 0,
41
+ ref: n,
42
+ className: b,
43
+ children: t
44
+ }
45
+ );
46
+ };
47
+ export {
48
+ x as T,
49
+ h as a,
50
+ A as g
51
+ };
@@ -0,0 +1,270 @@
1
+ "use client";
2
+ import { j as l } from "./jsx-runtime.C115EyI4.js";
3
+ import { c as T } from "./index.CvOaL64Y.js";
4
+ import { useState as v, useRef as p, useEffect as tt } from "react";
5
+ import { h as R } from "./has-window.ut_-aShB.js";
6
+ import { g as N, r as et } from "./helpers.CcqWV-wZ.js";
7
+ import { u as M } from "./useIsomorphicLayoutEffect.CnJ9AMFS.js";
8
+ import { DSButton as H } from "../button.BfcWQZhx.js";
9
+ import { D as rt } from "./Icon.BCmt_XBG.js";
10
+ import { NumberIndicator as st } from "../numberindicator.UU7FSouT.js";
11
+ import { g as z, a as O, T as nt } from "./TabPane.CYuUi0oL.js";
12
+ import '../assets/Tabs.DUqlqP6R.css';const y = () => {
13
+ if (R) {
14
+ const o = getComputedStyle(document.documentElement).getPropertyValue("--ds-animation-duration").trim();
15
+ return o === "0s" || o === "0ms";
16
+ } else
17
+ return !0;
18
+ }, ot = "ds-tabs_tabs-wrapper_infm4_1", ct = "ds-tabs_scroll-wrapper_infm4_6", at = "ds-tabs_scroller_infm4_17", lt = "ds-tabs_scroller--centered_infm4_23", it = "ds-tabs_tab_infm4_1", ut = "ds-tabs_scroll-button_infm4_98", dt = "ds-tabs_scroll-button--hidden_infm4_103", ft = "ds-tabs_scroll-button--right_infm4_107", mt = "ds-tabs_indicator_infm4_119", a = {
19
+ "tabs-wrapper": "ds-tabs_tabs-wrapper_infm4_1",
20
+ tabsWrapper: ot,
21
+ "scroll-wrapper": "ds-tabs_scroll-wrapper_infm4_6",
22
+ scrollWrapper: ct,
23
+ scroller: at,
24
+ "scroller--centered": "ds-tabs_scroller--centered_infm4_23",
25
+ scrollerCentered: lt,
26
+ tab: it,
27
+ "scroll-button": "ds-tabs_scroll-button_infm4_98",
28
+ scrollButton: ut,
29
+ "scroll-button--hidden": "ds-tabs_scroll-button--hidden_infm4_103",
30
+ scrollButtonHidden: dt,
31
+ "scroll-button--right": "ds-tabs_scroll-button--right_infm4_107",
32
+ scrollButtonRight: ft,
33
+ indicator: mt
34
+ }, St = ["left", "center"], Bt = ["prev", "next"], m = (o) => R && (o == null ? void 0 : o.getBoundingClientRect()) || DOMRect.fromRect({ x: 0, y: 0, width: 0, height: 0 }), h = 48, pt = ({ id: o, tabs: f }) => {
35
+ if (!o)
36
+ throw new Error(
37
+ N(
38
+ "DSTabs",
39
+ 'A unique "id" prop is required. Please add a unique "id" prop to the DSTabs component.'
40
+ )
41
+ );
42
+ if (!f)
43
+ throw new Error(
44
+ N("DSTabs", et("tabs", "DSTabs"))
45
+ );
46
+ }, yt = ({
47
+ id: o,
48
+ tabs: f,
49
+ alignment: E = "left",
50
+ className: q,
51
+ classNameTabPane: $,
52
+ defaultSelectedTabIndex: L = 0,
53
+ onTabChange: I,
54
+ ...X
55
+ }) => {
56
+ process.env.NODE_ENV !== "production" && pt({
57
+ id: o,
58
+ tabs: f
59
+ });
60
+ const [i, G] = v(
61
+ L
62
+ ), [C, b] = v(
63
+ L
64
+ ), [K, V] = v(!1), [F, Q] = v(!1), _ = p([]), g = p(null), u = p(null), d = p(null), w = p(!1), j = p(i);
65
+ M(() => {
66
+ var t;
67
+ if (R) {
68
+ const r = [
69
+ "16px 'STIHL Contraface Digital Text Regular'",
70
+ "14px 'STIHL Contraface Digital Text Demi'",
71
+ "16px 'STIHL Contraface Digital Text Bold'"
72
+ ];
73
+ Promise.all(r.map((c) => document.fonts.load(c))).then(() => {
74
+ x(i), D("next", i, "instant"), k(), w.current = !0;
75
+ }).catch((c) => {
76
+ throw new Error(
77
+ N(
78
+ "DSTabs",
79
+ `The component requires the fonts to be loaded: ${c}`
80
+ )
81
+ );
82
+ });
83
+ const e = () => {
84
+ !w.current || !d.current || (s.matches ? d.current.style.transitionDuration = "0s" : d.current.style.transitionDuration = "");
85
+ }, s = window.matchMedia("(prefers-reduced-motion: reduce)");
86
+ s.addEventListener("change", e);
87
+ const n = () => {
88
+ k(), J();
89
+ };
90
+ return window.addEventListener("resize", n), (t = u.current) == null || t.addEventListener("scroll", n), () => {
91
+ var c;
92
+ s.removeEventListener("change", e), window.removeEventListener("resize", n), (c = u.current) == null || c.removeEventListener("scroll", n);
93
+ };
94
+ }
95
+ }, [f, E]), M(() => {
96
+ w.current && x(i), j.current = i;
97
+ }, [i]), tt(() => {
98
+ var t;
99
+ w.current && ((t = _.current[C]) == null || t.focus());
100
+ }, [C]);
101
+ const W = (t) => {
102
+ const r = m(u.current), e = m(_.current[t]);
103
+ let s = "next";
104
+ e.left - h < r.left ? s = "prev" : e.right + h > r.right ? s = "next" : s = i < t ? "next" : "prev", G(t), b(t), D(s, t), I && I(t);
105
+ }, k = () => {
106
+ if (u.current && g.current) {
107
+ const t = m(u.current), r = m(g.current);
108
+ V(r.left < t.left), Q(r.right > t.right + 4);
109
+ }
110
+ }, A = (t = 0) => {
111
+ R && d.current && !y() && !window.matchMedia("(prefers-reduced-motion: reduce)").matches && setTimeout(() => {
112
+ d.current && (d.current.style.transitionDuration = "250ms");
113
+ }, t);
114
+ }, J = () => {
115
+ d.current && (d.current.style.transitionDuration = "0s", x(j.current), A());
116
+ }, x = (t) => {
117
+ const r = d.current, e = m(_.current[t]), s = m(g.current), n = e.left - s.left;
118
+ r && (w.current ? (r.style.width = `${e.width}px`, r.style.transform = `translateX(${n}px)`) : (r.style.transitionDuration = "0s", r.style.transform = `translateX(${n}px)`, r.style.width = `${e.width}px`, A(50)));
119
+ }, U = (t, r) => {
120
+ let e;
121
+ switch (t.key) {
122
+ case "ArrowLeft":
123
+ e = (r > 0 ? r : f.length) - 1, b(e);
124
+ break;
125
+ case "ArrowRight":
126
+ e = (r + 1) % f.length, b(e);
127
+ break;
128
+ case "Home":
129
+ e = 0, b(e);
130
+ break;
131
+ case "End":
132
+ e = f.length - 1, b(e);
133
+ break;
134
+ case "Enter":
135
+ case " ":
136
+ W(r);
137
+ return;
138
+ default:
139
+ return;
140
+ }
141
+ e !== void 0 && setTimeout(
142
+ () => D(
143
+ t.key === "ArrowRight" ? "next" : "prev",
144
+ e
145
+ ),
146
+ 0
147
+ ), t.preventDefault();
148
+ }, D = (t, r, e = "smooth") => {
149
+ const s = _.current[r], n = u.current, c = m(s), S = m(n);
150
+ let B;
151
+ if (!(!s || !n)) {
152
+ if (t === "prev") {
153
+ if (c.left - h > S.left)
154
+ return;
155
+ B = s.offsetLeft - h;
156
+ } else {
157
+ if (c.right + h < S.right)
158
+ return;
159
+ B = s.offsetLeft + s.offsetWidth - S.width + h;
160
+ }
161
+ n.scrollTo({
162
+ left: B,
163
+ behavior: y() ? "instant" : e
164
+ });
165
+ }
166
+ }, P = (t) => {
167
+ var e;
168
+ const r = Y(t);
169
+ (e = u.current) == null || e.scrollTo({
170
+ left: r,
171
+ behavior: y() ? "instant" : "smooth"
172
+ });
173
+ }, Y = (t) => {
174
+ if (!g.current || !u.current)
175
+ return 0;
176
+ const { scrollLeft: r, offsetWidth: e } = u.current, s = Math.round(e * 0.2);
177
+ return t === "next" ? r + s : r - s;
178
+ }, Z = T(a.scroller, {
179
+ [a.scrollerCentered]: E === "center"
180
+ });
181
+ return /* @__PURE__ */ l.jsxs(
182
+ "div",
183
+ {
184
+ className: T(a.tabs, q),
185
+ id: o,
186
+ ...X,
187
+ children: [
188
+ /* @__PURE__ */ l.jsxs("div", { className: a.tabsWrapper, children: [
189
+ /* @__PURE__ */ l.jsxs("div", { className: a.scrollWrapper, ref: u, children: [
190
+ /* @__PURE__ */ l.jsx("div", { role: "tablist", className: Z, ref: g, children: f.map(
191
+ ({ id: t, label: r, iconName: e, numberIndicatorValue: s }, n) => /* @__PURE__ */ l.jsxs(
192
+ "button",
193
+ {
194
+ id: z(o, t),
195
+ role: "tab",
196
+ "aria-selected": i === n,
197
+ "aria-controls": O(o, t, n),
198
+ tabIndex: i === n ? 0 : -1,
199
+ className: a.tab,
200
+ ref: (c) => {
201
+ _.current[n] = c;
202
+ },
203
+ onClick: () => W(n),
204
+ onKeyDown: (c) => U(c, n),
205
+ children: [
206
+ e && /* @__PURE__ */ l.jsx(rt, { name: e, "aria-hidden": "true" }),
207
+ r,
208
+ s && /* @__PURE__ */ l.jsx(st, { label: s })
209
+ ]
210
+ },
211
+ z(o, t)
212
+ )
213
+ ) }),
214
+ /* @__PURE__ */ l.jsx("span", { className: a.indicator, ref: d })
215
+ ] }),
216
+ /* @__PURE__ */ l.jsx(
217
+ H,
218
+ {
219
+ variant: "filled",
220
+ className: T(a.scrollButton, {
221
+ [a.scrollButtonHidden]: !K
222
+ }),
223
+ hideLabel: !0,
224
+ iconName: "chevron-left",
225
+ tabIndex: -1,
226
+ size: "small",
227
+ onClick: () => P("prev"),
228
+ children: "Left"
229
+ }
230
+ ),
231
+ /* @__PURE__ */ l.jsx(
232
+ H,
233
+ {
234
+ variant: "filled",
235
+ className: T(a.scrollButton, a.scrollButtonRight, {
236
+ [a.scrollButtonHidden]: !F
237
+ }),
238
+ hideLabel: !0,
239
+ iconName: "chevron-right",
240
+ tabIndex: -1,
241
+ size: "small",
242
+ onClick: () => P("next"),
243
+ children: "Right"
244
+ }
245
+ )
246
+ ] }),
247
+ f.map(({ id: t, content: r }, e) => /* @__PURE__ */ l.jsx(
248
+ nt,
249
+ {
250
+ id: t,
251
+ content: r,
252
+ index: e,
253
+ selectedTabIndex: i,
254
+ tabListId: o,
255
+ className: $
256
+ },
257
+ O(o, t, e)
258
+ ))
259
+ ]
260
+ }
261
+ );
262
+ };
263
+ export {
264
+ yt as D,
265
+ h as S,
266
+ St as T,
267
+ Bt as a,
268
+ m as g,
269
+ pt as v
270
+ };
@@ -2,11 +2,12 @@
2
2
  import { j as s } from "./jsx-runtime.C115EyI4.js";
3
3
  import { c as g } from "./index.CvOaL64Y.js";
4
4
  import { useState as d, useRef as re, useEffect as x } from "react";
5
- import { u as ne, h as oe } from "./useBreakpoint.5xBNDiCf.js";
6
- import { g as V, p as z } from "./helpers.B1JT5ShS.js";
5
+ import { h as ne } from "./has-window.ut_-aShB.js";
6
+ import { g as V, p as z } from "./helpers.CcqWV-wZ.js";
7
+ import { u as oe } from "./useBreakpoint.B8XxjSVJ.js";
7
8
  import { Asterisk as ie } from "../asterisk.DpzETKdT.js";
8
9
  import { DSSystemFeedback as le } from "../systemfeedback.C3Pfxxpp.js";
9
- import '../assets/Textarea.KJGPTYMz.css';const de = "ds-textarea_textarea_18bj7_1", ce = "ds-textarea_textarea--invalid_18bj7_113", _e = "ds-textarea_textarea--small_18bj7_120", ue = "ds-textarea_textarea--resize-auto_18bj7_139", be = "ds-textarea_root_18bj7_149", fe = "ds-textarea_hint_18bj7_157", xe = "ds-textarea_label_18bj7_157", je = "ds-textarea_affix_18bj7_161", me = "ds-textarea_affix--small_18bj7_182", he = "ds-textarea_affix--disabled_18bj7_195", pe = "ds-textarea_prefix_18bj7_203", ve = "ds-textarea_affix--readonly_18bj7_206", ge = "ds-textarea_suffix_18bj7_216", Se = "ds-textarea_leading-icon_18bj7_223", Ie = "ds-textarea_leading-icon--small_18bj7_235", Ce = "ds-textarea_leading-icon--disabled_18bj7_238", ye = "ds-textarea_action-button_18bj7_247", De = "ds-textarea_label--hidden_18bj7_265", Ae = "ds-textarea_label--disabled_18bj7_278", we = "ds-textarea_feedback_18bj7_298", Re = "ds-textarea_char-count_18bj7_303", Te = "ds-textarea_char-count-announcer_18bj7_319", t = {
10
+ import '../assets/Textarea.KJGPTYMz.css';const de = "ds-textarea_textarea_18bj7_1", ce = "ds-textarea_textarea--invalid_18bj7_113", _e = "ds-textarea_textarea--small_18bj7_120", ue = "ds-textarea_textarea--resize-auto_18bj7_139", fe = "ds-textarea_root_18bj7_149", be = "ds-textarea_hint_18bj7_157", xe = "ds-textarea_label_18bj7_157", je = "ds-textarea_affix_18bj7_161", me = "ds-textarea_affix--small_18bj7_182", he = "ds-textarea_affix--disabled_18bj7_195", pe = "ds-textarea_prefix_18bj7_203", ve = "ds-textarea_affix--readonly_18bj7_206", ge = "ds-textarea_suffix_18bj7_216", Se = "ds-textarea_leading-icon_18bj7_223", Ie = "ds-textarea_leading-icon--small_18bj7_235", Ce = "ds-textarea_leading-icon--disabled_18bj7_238", ye = "ds-textarea_action-button_18bj7_247", De = "ds-textarea_label--hidden_18bj7_265", Ae = "ds-textarea_label--disabled_18bj7_278", we = "ds-textarea_feedback_18bj7_298", Re = "ds-textarea_char-count_18bj7_303", Te = "ds-textarea_char-count-announcer_18bj7_319", t = {
10
11
  textarea: de,
11
12
  "textarea--invalid": "ds-textarea_textarea--invalid_18bj7_113",
12
13
  textareaInvalid: ce,
@@ -14,8 +15,8 @@ import '../assets/Textarea.KJGPTYMz.css';const de = "ds-textarea_textarea_18bj7_
14
15
  textareaSmall: _e,
15
16
  "textarea--resize-auto": "ds-textarea_textarea--resize-auto_18bj7_139",
16
17
  textareaResizeAuto: ue,
17
- root: be,
18
- hint: fe,
18
+ root: fe,
19
+ hint: be,
19
20
  label: xe,
20
21
  affix: je,
21
22
  "affix--small": "ds-textarea_affix--small_18bj7_182",
@@ -43,12 +44,12 @@ import '../assets/Textarea.KJGPTYMz.css';const de = "ds-textarea_textarea_18bj7_
43
44
  charCount: Re,
44
45
  "char-count-announcer": "ds-textarea_char-count-announcer_18bj7_319",
45
46
  charCountAnnouncer: Te
46
- }, Pe = ["medium", "small"], Ee = ({ id: r, label: _ }) => {
47
+ }, qe = ["medium", "small"], Ee = ({ id: r, label: _ }) => {
47
48
  if (!r)
48
49
  throw new Error(
49
50
  V(
50
51
  "DSTextarea",
51
- 'A unique "id" prop is required. Please add an unique "id" prop to the DSTextarea component.'
52
+ 'A unique "id" prop is required. Please add a unique "id" prop to the DSTextarea component.'
52
53
  )
53
54
  );
54
55
  if (!_)
@@ -58,7 +59,7 @@ import '../assets/Textarea.KJGPTYMz.css';const de = "ds-textarea_textarea_18bj7_
58
59
  `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}.`
59
60
  )
60
61
  );
61
- }, qe = ({
62
+ }, Me = ({
62
63
  id: r,
63
64
  label: _,
64
65
  charsLimitText: P = "Character limit reached",
@@ -85,7 +86,7 @@ import '../assets/Textarea.KJGPTYMz.css';const de = "ds-textarea_textarea_18bj7_
85
86
  id: r,
86
87
  label: _
87
88
  });
88
- const [G, A] = d(O || ""), [l, w] = d(0), [J, R] = d(0), [K, T] = d("off"), [E, h] = d(i), [p, v] = d(n), N = m !== void 0, b = N ? m : G, o = re(null), Q = ne(F);
89
+ const [G, A] = d(O || ""), [l, w] = d(0), [J, R] = d(0), [K, T] = d("off"), [E, h] = d(i), [p, v] = d(n), N = m !== void 0, f = N ? m : G, o = re(null), Q = oe(F);
89
90
  x(() => {
90
91
  if (!e || e <= 0)
91
92
  return;
@@ -95,11 +96,11 @@ import '../assets/Textarea.KJGPTYMz.css';const de = "ds-textarea_textarea_18bj7_
95
96
  }, 1e3);
96
97
  return () => clearTimeout(a);
97
98
  }, [l]), x(() => {
98
- A(b || ""), c(), e && e > 0 && (w(b.toString().length || 0), R(e - b.toString().length || 0));
99
+ A(f || ""), c(), e && e > 0 && (w(f.toString().length || 0), R(e - f.toString().length || 0));
99
100
  }, [m]), x(() => {
100
101
  n && i ? (h(i), v(n)) : !n && e && e >= 0 && l >= e ? (v(!0), h(P)) : (h(i), v(n));
101
102
  }, [n, p, i, l]), x(() => {
102
- if (oe && u === "auto")
103
+ if (ne && u === "auto")
103
104
  return c(), window.addEventListener("resize", c), () => window.removeEventListener("resize", c);
104
105
  }, [u, o.current]);
105
106
  const U = g(t.root, X), Y = g(t.textarea, M, {
@@ -116,17 +117,17 @@ import '../assets/Textarea.KJGPTYMz.css';const de = "ds-textarea_textarea_18bj7_
116
117
  }), B = `${r}-label`, $ = `${r}-feedback`, k = `${r}-hint`, H = `${r}-char-count-announcer`, ee = j ? ` ${k}` : "", c = () => {
117
118
  if (o.current && u === "auto") {
118
119
  o.current.style.height = "auto";
119
- const a = z(o.current.scrollHeight), f = z(2);
120
+ const a = z(o.current.scrollHeight), b = z(2);
120
121
  o.current.style.height = `${// We need to add 2px (border-top & border-bottom) to the scrollHeight to prevent the textarea
121
122
  // from jumping as soon as the user starts typing.
122
- a + f}rem`;
123
+ a + b}rem`;
123
124
  }
124
125
  }, ae = () => {
125
126
  const a = [];
126
127
  return e && e > 0 && a.push(H), n && i && a.push($), a.length > 0 ? a.join(" ") : void 0;
127
128
  }, te = (a) => {
128
- var f;
129
- D && D(a), e && e > 0 && w(((f = o.current) == null ? void 0 : f.value.length) || 0), c();
129
+ var b;
130
+ D && D(a), e && e > 0 && w(((b = o.current) == null ? void 0 : b.value.length) || 0), c();
130
131
  }, se = (a) => {
131
132
  y && y(a), N || A(a.target.value);
132
133
  };
@@ -160,7 +161,7 @@ import '../assets/Textarea.KJGPTYMz.css';const de = "ds-textarea_textarea_18bj7_
160
161
  readOnly: I,
161
162
  required: C,
162
163
  disabled: S,
163
- value: b,
164
+ value: f,
164
165
  defaultValue: void 0,
165
166
  rows: void 0,
166
167
  cols: void 0,
@@ -192,7 +193,7 @@ import '../assets/Textarea.KJGPTYMz.css';const de = "ds-textarea_textarea_18bj7_
192
193
  ] });
193
194
  };
194
195
  export {
195
- qe as D,
196
- Pe as T,
196
+ Me as D,
197
+ qe as T,
197
198
  Ee as v
198
199
  };
@@ -2,7 +2,7 @@
2
2
  import { j as t } from "./jsx-runtime.C115EyI4.js";
3
3
  import { c } from "./index.CvOaL64Y.js";
4
4
  import { forwardRef as u } from "react";
5
- import { DSButton as y } from "../button.M4nXjcUn.js";
5
+ import { DSButton as y } from "../button.BfcWQZhx.js";
6
6
  import { D as g } from "./Icon.BCmt_XBG.js";
7
7
  import '../assets/Toast.CuafTAf7.css';const h = "ds-toast_root_58y8a_5", p = "ds-toast_root--closing_58y8a_19", x = "ds-toast_fade-out_58y8a_1", I = "ds-toast_move-in_58y8a_1", S = "ds-toast_root--success_58y8a_54", N = "ds-toast_root--info_58y8a_58", j = "ds-toast_root--warning_58y8a_62", v = "ds-toast_content_58y8a_67", w = "ds-toast_content--hide-icon_58y8a_74", C = "ds-toast_icon_58y8a_78", D = "ds-toast_message_58y8a_82", o = {
8
8
  root: h,
@@ -0,0 +1,5 @@
1
+ "use client";
2
+ const e = typeof window < "u" && typeof window.document < "u";
3
+ export {
4
+ e as h
5
+ };
@@ -0,0 +1,8 @@
1
+ "use client";
2
+ const r = (e) => typeof e != "number" || isNaN(e) ? 0 : e / 16, t = (e, s) => `[STIHL Design System] - [${e}]: ${s}`, o = (e, s) => `The "${e}" prop is required. Please add the "${e}" prop to the ${s} component.`, n = (e, s) => e == null ? void 0 : e.closest(s);
3
+ export {
4
+ n as a,
5
+ t as g,
6
+ r as p,
7
+ o as r
8
+ };
@@ -1,12 +1,13 @@
1
1
  "use client";
2
2
  import { useState as c, useEffect as k } from "react";
3
- const a = typeof window < "u", o = {
3
+ import { h as a } from "./has-window.ut_-aShB.js";
4
+ const o = {
4
5
  base: 0,
5
6
  s: 320,
6
7
  m: 768,
7
8
  l: 1024,
8
9
  xl: 1536
9
- }, u = ["base", "s", "m", "l", "xl"], f = (e) => {
10
+ }, u = ["base", "s", "m", "l", "xl"], b = (e) => {
10
11
  let n = "base";
11
12
  for (const t of u)
12
13
  if (e >= o[t])
@@ -14,7 +15,7 @@ const a = typeof window < "u", o = {
14
15
  else
15
16
  break;
16
17
  return n;
17
- }, b = (e) => e && typeof e == "object" && "base" in e, d = () => {
18
+ }, f = (e) => e && typeof e == "object" && "base" in e, l = () => {
18
19
  const [e, n] = c("base");
19
20
  k(() => {
20
21
  if (a)
@@ -23,13 +24,13 @@ const a = typeof window < "u", o = {
23
24
  const t = () => {
24
25
  if (a) {
25
26
  const r = window.innerWidth;
26
- n(f(r));
27
+ n(b(r));
27
28
  }
28
29
  };
29
30
  return e;
30
- }, B = (e) => {
31
- const n = d();
32
- if (e && typeof e != "object" || !b(e))
31
+ }, p = (e) => {
32
+ const n = l();
33
+ if (e && typeof e != "object" || !f(e))
33
34
  return e;
34
35
  const t = [...u].reverse();
35
36
  let r = e.base;
@@ -43,6 +44,5 @@ const a = typeof window < "u", o = {
43
44
  return r;
44
45
  };
45
46
  export {
46
- a as h,
47
- B as u
47
+ p as u
48
48
  };