@stihl-design-system/components 1.0.0-RC.27 → 1.0.0-RC.28

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 (80) hide show
  1. package/{accordion.CBaDU14g.js → accordion.B9X4Vlig.js} +1 -1
  2. package/{actionbutton.DEJsLxnQ.js → actionbutton.7x4F7a0U.js} +1 -1
  3. package/{actionlink.Cs6BTCA3.js → actionlink.CV0n19ik.js} +1 -1
  4. package/assets/Accordion.BHWEZCmu.css +1 -0
  5. package/assets/CustomReactSelect.Dq5Hoqv2.css +1 -0
  6. package/assets/{Fieldset.Cy5r0K7n.css → Fieldset.CW9dBvAo.css} +1 -1
  7. package/assets/InputFile.BVgHILAZ.css +1 -0
  8. package/assets/InputPassword.CBpkWGy7.css +1 -0
  9. package/assets/InputSearch.CnPJYH8L.css +1 -0
  10. package/assets/InputStepper.U2h9Kd0t.css +1 -0
  11. package/assets/Select.U7xsC0o1.css +1 -0
  12. package/assets/Slider.DzwSjDPV.css +1 -0
  13. package/assets/Textarea.C4IEEOFR.css +1 -0
  14. package/assets/input.CuIHvnD5.css +1 -0
  15. package/assets/radio.ipbv7OMF.css +1 -0
  16. package/{checkboxgroup.YK8H0YoX.js → checkboxgroup.Bylq97Q9.js} +2 -2
  17. package/chunks/Accordion.BvHroAyn.js +154 -0
  18. package/chunks/ActionButton.BlhiiU3l.js +165 -0
  19. package/chunks/ActionLink.BvFL6rgb.js +138 -0
  20. package/chunks/{CheckboxGroup.DHzpgOWp.js → CheckboxGroup.D4MQD0i0.js} +1 -1
  21. package/chunks/{CustomReactSelect.BPnzhvw1.js → CustomReactSelect.D9B928kB.js} +408 -409
  22. package/chunks/Fieldset.BgZMYAH-.js +74 -0
  23. package/chunks/Header.BSvyYrIV.js +368 -0
  24. package/chunks/InputFile.rC7NJYrU.js +218 -0
  25. package/chunks/InputPassword.5-r36K86.js +132 -0
  26. package/chunks/InputSearch.D4Q99_nR.js +170 -0
  27. package/chunks/InputStepper.EsPAGCFJ.js +259 -0
  28. package/chunks/{RadioGroup.c7YYJdUe.js → RadioGroup.CRP8_vsg.js} +2 -2
  29. package/chunks/Select.lveq1iBY.js +158 -0
  30. package/chunks/Slider.D9MHH4cZ.js +292 -0
  31. package/chunks/Textarea.BRfh8ykm.js +161 -0
  32. package/combobox.pMk_oggm.js +60 -0
  33. package/components/Combobox/Combobox.d.ts +4 -0
  34. package/components/Combobox/CustomReactSelect/CustomReactSelect.d.ts +1 -1
  35. package/{customreactselect.Bu1i8wkh.js → customreactselect.-DGMZMFu.js} +2 -3
  36. package/{fieldset.DM9ELUJa.js → fieldset.BR9fZReW.js} +1 -1
  37. package/{header.WhQHSuB1.js → header.Z4Oxj_xL.js} +1 -1
  38. package/index.es.js +17 -17
  39. package/input.DAneVu7p.js +199 -0
  40. package/{inputfile.Cmkxf4Vq.js → inputfile.CB-QTIDn.js} +2 -3
  41. package/{inputpassword.CaJBCMA0.js → inputpassword.B_A0JDkz.js} +2 -3
  42. package/{inputsearch.B06DhYzo.js → inputsearch.DUgTkPWm.js} +2 -3
  43. package/{inputstepper.DNY7nzP8.js → inputstepper.DKmlBa0Y.js} +2 -3
  44. package/package.json +1 -1
  45. package/partials/index.js +24 -24
  46. package/{radio.Be4pFOLf.js → radio.z-Mi3J6t.js} +20 -20
  47. package/{radiogroup.BRjwP01C.js → radiogroup.Bk36A24U.js} +3 -3
  48. package/{select.3zE96eWc.js → select.4wUa3vMT.js} +2 -3
  49. package/{slider.CTCf7Xdm.js → slider.BicJfJzc.js} +2 -2
  50. package/styles/scss/ds/index.scss +1 -0
  51. package/styles/scss/ds/lib/ds-internal/_index.scss +1 -0
  52. package/styles/scss/ds/lib/ds-internal/_input.scss +187 -0
  53. package/styles/scss/ds/lib/input.scss +26 -0
  54. package/{textarea.B_3fPtmd.js → textarea.BynOgkpo.js} +2 -3
  55. package/{topbar.2b8fjmA4.js → topbar.Bccms0xZ.js} +1 -1
  56. package/assets/Accordion.DOcfZwq8.css +0 -1
  57. package/assets/CustomReactSelect.B9f_KYFg.css +0 -1
  58. package/assets/InputFile.Dqjz53mb.css +0 -1
  59. package/assets/InputPassword.BuVQ9dRy.css +0 -1
  60. package/assets/InputSearch.Dwtb3Mhw.css +0 -1
  61. package/assets/InputStepper.CBt99L83.css +0 -1
  62. package/assets/Select.CghDnBUQ.css +0 -1
  63. package/assets/Slider.C8i4U4iT.css +0 -1
  64. package/assets/Textarea.BgtH-TTe.css +0 -1
  65. package/assets/input.DFwunFjw.css +0 -1
  66. package/assets/radio.BCB51D_y.css +0 -1
  67. package/chunks/Accordion.eVOD7J_8.js +0 -154
  68. package/chunks/ActionButton.Ck1rGqgm.js +0 -165
  69. package/chunks/ActionLink.DnUNjoAT.js +0 -138
  70. package/chunks/Fieldset.BX46NuLh.js +0 -74
  71. package/chunks/Header.Djs1adPW.js +0 -361
  72. package/chunks/InputFile.vkkg5Pab.js +0 -220
  73. package/chunks/InputPassword.D42uUEGy.js +0 -136
  74. package/chunks/InputSearch.aIbUXVQU.js +0 -174
  75. package/chunks/InputStepper.DFEdUWm7.js +0 -263
  76. package/chunks/Select.B_EHpk22.js +0 -162
  77. package/chunks/Slider.DMSwmGwD.js +0 -292
  78. package/chunks/Textarea.Ce26v6ht.js +0 -163
  79. package/combobox.AaK6QjRl.js +0 -58
  80. package/input.DhxUW3zc.js +0 -203
@@ -0,0 +1,74 @@
1
+ "use client";
2
+ import { jsxs as p, jsx as i, Fragment as j } from "react/jsx-runtime";
3
+ import { c as m } from "./index.CEyLAtio.js";
4
+ import "react";
5
+ import { Asterisk as S } from "../asterisk.CR60hx8S.js";
6
+ import { DSHeading as M } from "../heading.BXFBZhKv.js";
7
+ import { DSSystemFeedback as x } from "../systemfeedback.CLQCbTF6.js";
8
+ import { g as D } from "./helpers.BbWkXTr3.js";
9
+ import "./index.CgTHIF3K.js";
10
+ import '../assets/Fieldset.CW9dBvAo.css';const E = "ds-fieldset_root_dtiam_1", q = "ds-fieldset_child-wrapper_dtiam_98", C = "ds-fieldset_legend_dtiam_105", P = "ds-fieldset_legend--utility--m_dtiam_109", T = "ds-fieldset_description_dtiam_121", U = "ds-fieldset_description--small_dtiam_135", W = "ds-fieldset_system-feedback_dtiam_139", s = {
11
+ root: E,
12
+ childWrapper: q,
13
+ legend: C,
14
+ legendUtilityM: P,
15
+ description: T,
16
+ descriptionSmall: U,
17
+ systemFeedback: W
18
+ }, z = ({
19
+ description: a,
20
+ id: e,
21
+ legend: l,
22
+ systemFeedback: t
23
+ }) => {
24
+ if (!e && (a || t))
25
+ throw new Error(D("DSFieldset", 'A unique "id" prop is required when providing the description or systemFeedback property. Please add a unique "id" prop to the DSFieldset component.'));
26
+ if (!l)
27
+ throw new Error(D("DSFieldset", "The legend prop is required. Please add the legend prop to the DSFieldset component."));
28
+ }, G = ({
29
+ children: a,
30
+ legend: e,
31
+ className: l,
32
+ description: t,
33
+ disabled: b = !1,
34
+ id: n,
35
+ invalid: c = !1,
36
+ required: f = !1,
37
+ systemFeedback: d,
38
+ ...u
39
+ }) => {
40
+ process.env.NODE_ENV !== "production" && z({
41
+ description: t,
42
+ id: n,
43
+ legend: e,
44
+ systemFeedback: d
45
+ });
46
+ let o, g, _;
47
+ const r = typeof e == "object" && e !== void 0;
48
+ r && ({
49
+ headingSize: o,
50
+ headingTag: g,
51
+ headingText: _
52
+ } = e);
53
+ const h = `${n}-feedback`, y = `${n}-description`, F = [c && d && h, t && y].filter(Boolean).join(" ") || void 0, N = !r || o === "small" || o === "small-uppercase", v = m(s.root, l), k = m(s.legend, {
54
+ [s.legendUtilityM]: !r
55
+ }), w = m(s.description, {
56
+ [s.descriptionSmall]: N
57
+ });
58
+ return /* @__PURE__ */ p("fieldset", { className: v, disabled: b, ...u, "aria-invalid": c, "aria-describedby": F, children: [
59
+ /* @__PURE__ */ i("legend", { className: k, children: r ? /* @__PURE__ */ p(M, { tag: g, size: o, children: [
60
+ _,
61
+ f && /* @__PURE__ */ i(S, {})
62
+ ] }) : /* @__PURE__ */ p(j, { children: [
63
+ e,
64
+ f && /* @__PURE__ */ i(S, {})
65
+ ] }) }),
66
+ t && /* @__PURE__ */ i("span", { id: y, className: w, children: t }),
67
+ c && d && /* @__PURE__ */ i(x, { id: h, type: "invalid", message: d, className: s.systemFeedback }),
68
+ /* @__PURE__ */ i("div", { className: s.childWrapper, children: a })
69
+ ] });
70
+ };
71
+ export {
72
+ G as D,
73
+ z as v
74
+ };
@@ -0,0 +1,368 @@
1
+ "use client";
2
+ import { jsx as g, jsxs as Ae, Fragment as _e } from "react/jsx-runtime";
3
+ import { d as T } from "./index.CgTHIF3K.js";
4
+ import { c as D } from "./index.CEyLAtio.js";
5
+ import { useState as V, useEffect as ne, useContext as oe, createContext as He, useRef as U } from "react";
6
+ import { g as j, c as R, p as fe } from "./helpers.BbWkXTr3.js";
7
+ import { u as Pe } from "./useIsomorphicLayoutEffect.CnJ9AMFS.js";
8
+ import { DSLogo as xe } from "../logo.C96KaG1P.js";
9
+ import '../assets/Header.DO34x-dO.css';const Te = (d) => {
10
+ const e = T.c(3), t = 0, [r, n] = V("down");
11
+ let a, s;
12
+ return e[0] !== t ? (a = () => {
13
+ let l;
14
+ l = window.scrollY;
15
+ const c = () => {
16
+ const o = window.scrollY, h = o > l ? "down" : "up";
17
+ Math.abs(o - l) > t && (n(h), l = o);
18
+ };
19
+ return window.addEventListener("scroll", c, {
20
+ passive: !0
21
+ }), () => window.removeEventListener("scroll", c);
22
+ }, s = [t], e[0] = t, e[1] = a, e[2] = s) : (a = e[1], s = e[2]), ne(a, s), r;
23
+ }, At = ["full", "main"], Ee = ({
24
+ hasBrandArea: d,
25
+ hasPrimaryArea: e,
26
+ hasSecondaryArea: t
27
+ }) => {
28
+ if (d)
29
+ throw new Error(j("DSHeader", "A <DSTopBar.BrandArea> component was detected as a direct child of DSHeader. Please move it into the DSTopBar component."));
30
+ if (e)
31
+ throw new Error(j("DSHeader", "A <DSTopBar.PrimaryArea> component was detected as a direct child of DSHeader. Please move it into the DSTopBar component."));
32
+ if (t)
33
+ throw new Error(j("DSHeader", "A <DSTopBar.SecondaryArea> component was detected as a direct child of DSHeader. Please move it into the DSTopBar component."));
34
+ }, Fe = "ds-top-bar_root_ryiho_1", Ce = "ds-top-bar_root--sticky_ryiho_47", Oe = "ds-top-bar_root--fixed_ryiho_51", Ve = "ds-top-bar_content_ryiho_59", Re = "ds-top-bar_content--variant-full_ryiho_78", Me = "ds-top-bar_content--has-primary-area-and-secondary-area_ryiho_82", ke = "ds-top-bar_primary_ryiho_87", $e = "ds-top-bar_content--has-brand-add-on-with-primary-area-and-secondary-area_ryiho_102", We = "ds-top-bar_brand_ryiho_107", Ie = "ds-top-bar_content--has-primary-area_ryiho_82", Le = "ds-top-bar_content--has-primary-area--with-brand-add-on_ryiho_146", Ye = "ds-top-bar_brand-add-on_ryiho_210", ze = "ds-top-bar_brand-add-on--double_ryiho_231", qe = "ds-top-bar_sub-title_ryiho_245", Ue = "ds-top-bar_secondary_ryiho_271", je = "ds-top-bar_logo_ryiho_280", Ge = "ds-top-bar_logo--reduced_ryiho_290", u = {
35
+ root: Fe,
36
+ rootSticky: Ce,
37
+ rootFixed: Oe,
38
+ content: Ve,
39
+ contentVariantFull: Re,
40
+ contentHasPrimaryAreaAndSecondaryArea: Me,
41
+ primary: ke,
42
+ contentHasBrandAddOnWithPrimaryAreaAndSecondaryArea: $e,
43
+ brand: We,
44
+ contentHasPrimaryArea: Ie,
45
+ contentHasPrimaryAreaWithBrandAddOn: Le,
46
+ brandAddOn: Ye,
47
+ brandAddOnDouble: ze,
48
+ subTitle: qe,
49
+ secondary: Ue,
50
+ logo: je,
51
+ logoReduced: Ge
52
+ }, Je = ({
53
+ hasBrandArea: d,
54
+ hasPrimaryArea: e,
55
+ hasSecondaryArea: t
56
+ }) => {
57
+ if (!d)
58
+ throw new Error(j("DSTopBar", "A <DSTopBar.BrandArea> component is required. Please include it as a child of DSTopBar."));
59
+ if (!e && t)
60
+ throw new Error(j("DSTopBar", "A <DSTopBar.PrimaryArea> is required when using <DSTopBar.SecondaryArea>. Please include <DSTopBar.PrimaryArea> as a child of DSTopBar, or move the content from <DSTopBar.SecondaryArea> into <DSTopBar.PrimaryArea>."));
61
+ }, ge = (d) => d == null || typeof d == "object" && !Array.isArray(d) && d !== null && Object.keys(d).length === 0, pt = ["double", "single"], Y = (d) => {
62
+ const e = T.c(28);
63
+ let t, r, n, a;
64
+ e[0] !== d ? ({
65
+ children: t,
66
+ className: r,
67
+ rootClassName: a,
68
+ ...n
69
+ } = d, e[0] = d, e[1] = t, e[2] = r, e[3] = n, e[4] = a) : (t = e[1], r = e[2], n = e[3], a = e[4]);
70
+ const {
71
+ variant: s,
72
+ isHeaderSticky: l,
73
+ isMobile: c,
74
+ topBarAreaRef: o,
75
+ isStickyMainNavigationVisible: h,
76
+ hasBrandAddOn: m
77
+ } = oe(G);
78
+ let A, p;
79
+ if (e[5] !== t || e[6] !== r || e[7] !== m || e[8] !== l || e[9] !== c || e[10] !== h || e[11] !== a || e[12] !== s) {
80
+ const E = R(t, pe), y = R(t, ye), i = R(t, ue);
81
+ process.env.NODE_ENV !== "production" && Je({
82
+ hasBrandArea: E,
83
+ hasPrimaryArea: y,
84
+ hasSecondaryArea: i
85
+ });
86
+ let b;
87
+ e[15] !== l || e[16] !== c || e[17] !== h || e[18] !== a ? (b = D(u.root, a, l ? {
88
+ [u.rootSticky]: !c && h,
89
+ [u.rootFixed]: !c && !h
90
+ } : {}), e[15] = l, e[16] = c, e[17] = h, e[18] = a, e[19] = b) : b = e[19], A = b, p = D(u.content, r, {
91
+ [u.contentHasPrimaryArea]: y && !m && !i,
92
+ [u.contentHasPrimaryAreaWithBrandAddOn]: y && m && !i,
93
+ [u.contentHasBrandAddOnWithPrimaryAreaAndSecondaryArea]: m && y && i,
94
+ [u.contentHasPrimaryAreaAndSecondaryArea]: y && i && !m,
95
+ [u.contentVariantFull]: s === "full"
96
+ }), e[5] = t, e[6] = r, e[7] = m, e[8] = l, e[9] = c, e[10] = h, e[11] = a, e[12] = s, e[13] = A, e[14] = p;
97
+ } else
98
+ A = e[13], p = e[14];
99
+ const _ = p;
100
+ let f;
101
+ e[20] !== t || e[21] !== _ || e[22] !== n ? (f = /* @__PURE__ */ g("section", { className: _, ...n, children: t }), e[20] = t, e[21] = _, e[22] = n, e[23] = f) : f = e[23];
102
+ let v;
103
+ return e[24] !== A || e[25] !== f || e[26] !== o ? (v = /* @__PURE__ */ g("div", { className: A, ref: o, children: f }), e[24] = A, e[25] = f, e[26] = o, e[27] = v) : v = e[27], v;
104
+ }, pe = (d) => {
105
+ const e = T.c(26), {
106
+ children: t,
107
+ className: r
108
+ } = d, {
109
+ logoProps: n,
110
+ brandAddOnProps: a,
111
+ setHasBrandAddOn: s
112
+ } = oe(G);
113
+ let l;
114
+ e[0] !== n ? (l = n || {}, e[0] = n, e[1] = l) : l = e[1];
115
+ const {
116
+ aria: c,
117
+ logo: o,
118
+ href: h,
119
+ target: m
120
+ } = l, A = o === void 0 ? "main" : o, p = h === void 0 ? "/" : h, _ = m === void 0 ? "_self" : m;
121
+ let f;
122
+ e[2] !== a || e[3] !== t || e[4] !== s ? (f = () => {
123
+ t || !ge(a) ? s == null || s(!0) : s == null || s(!1);
124
+ }, e[2] = a, e[3] = t, e[4] = s, e[5] = f) : f = e[5];
125
+ let v;
126
+ e[6] !== a || e[7] !== t ? (v = [t, a], e[6] = a, e[7] = t, e[8] = v) : v = e[8], ne(f, v);
127
+ let E;
128
+ e[9] !== A ? (E = D(u.logo, {
129
+ [u.logoReduced]: A.includes("reduced")
130
+ }), e[9] = A, e[10] = E) : E = e[10];
131
+ const y = E;
132
+ let i;
133
+ e[11] !== r ? (i = D(u.brand, r), e[11] = r, e[12] = i) : i = e[12];
134
+ let b;
135
+ e[13] !== c || e[14] !== p || e[15] !== A || e[16] !== y || e[17] !== _ ? (b = /* @__PURE__ */ g(xe, { className: y, aria: c, logo: A, href: p, target: _ }), e[13] = c, e[14] = p, e[15] = A, e[16] = y, e[17] = _, e[18] = b) : b = e[18];
136
+ let S;
137
+ e[19] !== a ? (S = ge(a) ? void 0 : /* @__PURE__ */ g(be, { ...a }), e[19] = a, e[20] = S) : S = e[20];
138
+ let H;
139
+ return e[21] !== t || e[22] !== S || e[23] !== i || e[24] !== b ? (H = /* @__PURE__ */ Ae("div", { className: i, children: [
140
+ b,
141
+ S,
142
+ t
143
+ ] }), e[21] = t, e[22] = S, e[23] = i, e[24] = b, e[25] = H) : H = e[25], H;
144
+ };
145
+ pe.displayName = "DSTopBar.BrandArea";
146
+ const be = (d) => {
147
+ const e = T.c(10), {
148
+ children: t,
149
+ className: r,
150
+ subTitle: n,
151
+ variant: a
152
+ } = d, s = a === void 0 ? "single" : a, l = s === "double";
153
+ let c;
154
+ e[0] !== r || e[1] !== l ? (c = D(u.brandAddOn, r, {
155
+ [u.brandAddOnDouble]: l
156
+ }), e[0] = r, e[1] = l, e[2] = c) : c = e[2];
157
+ const o = c;
158
+ let h;
159
+ e[3] !== t || e[4] !== n || e[5] !== s ? (h = s === "single" ? t : /* @__PURE__ */ Ae(_e, { children: [
160
+ /* @__PURE__ */ g("span", { children: t }),
161
+ n && /* @__PURE__ */ g("span", { className: u.subTitle, children: n })
162
+ ] }), e[3] = t, e[4] = n, e[5] = s, e[6] = h) : h = e[6];
163
+ let m;
164
+ return e[7] !== o || e[8] !== h ? (m = /* @__PURE__ */ g("span", { className: o, children: h }), e[7] = o, e[8] = h, e[9] = m) : m = e[9], m;
165
+ };
166
+ be.displayName = "DSTopBar.BrandAddOn";
167
+ const ye = (d) => {
168
+ const e = T.c(5), {
169
+ children: t,
170
+ className: r
171
+ } = d;
172
+ let n;
173
+ e[0] !== r ? (n = D(u.primary, r), e[0] = r, e[1] = n) : n = e[1];
174
+ let a;
175
+ return e[2] !== t || e[3] !== n ? (a = /* @__PURE__ */ g("div", { className: n, children: t }), e[2] = t, e[3] = n, e[4] = a) : a = e[4], a;
176
+ };
177
+ ye.displayName = "DSTopBar.PrimaryArea";
178
+ const ue = (d) => {
179
+ const e = T.c(5), {
180
+ children: t,
181
+ className: r
182
+ } = d;
183
+ let n;
184
+ e[0] !== r ? (n = D(u.secondary, r), e[0] = r, e[1] = n) : n = e[1];
185
+ let a;
186
+ return e[2] !== t || e[3] !== n ? (a = /* @__PURE__ */ g("div", { className: n, children: t }), e[2] = t, e[3] = n, e[4] = a) : a = e[4], a;
187
+ };
188
+ ue.displayName = "DSTopBar.SecondaryArea";
189
+ Y.BrandArea = pe;
190
+ Y.PrimaryArea = ye;
191
+ Y.SecondaryArea = ue;
192
+ const Ke = "ds-header_root_g2mvw_1", Qe = "ds-header_root--sticky_g2mvw_4", Xe = "ds-header_root--hidden_g2mvw_9", Ze = "ds-header_root--fixed_g2mvw_20", et = "ds-header_main-navigation-area_g2mvw_36", tt = "ds-header_main-navigation-area--fixed_g2mvw_88", at = "ds-header_main-navigation-area--fixed--visible_g2mvw_103", rt = "ds-header_main-navigation-content_g2mvw_108", nt = "ds-header_main-navigation-content--variant-full_g2mvw_112", ot = "ds-header_header-placeholder_g2mvw_117", it = "ds-header_header-placeholder--with-banner_g2mvw_120", N = {
193
+ root: Ke,
194
+ rootSticky: Qe,
195
+ rootHidden: Xe,
196
+ rootFixed: Ze,
197
+ mainNavigationArea: et,
198
+ mainNavigationAreaFixed: tt,
199
+ mainNavigationAreaFixedVisible: at,
200
+ mainNavigationContent: rt,
201
+ mainNavigationContentVariantFull: nt,
202
+ headerPlaceholder: ot,
203
+ headerPlaceholderWithBanner: it
204
+ }, G = He({
205
+ variant: "main"
206
+ }), ie = (d) => {
207
+ const e = T.c(58);
208
+ let t, r, n, a, s, l, c;
209
+ e[0] !== d ? ({
210
+ children: r,
211
+ brandAddOnProps: t,
212
+ className: n,
213
+ isHeaderSticky: l,
214
+ variant: c,
215
+ logoProps: a,
216
+ ...s
217
+ } = d, e[0] = d, e[1] = t, e[2] = r, e[3] = n, e[4] = a, e[5] = s, e[6] = l, e[7] = c) : (t = e[1], r = e[2], n = e[3], a = e[4], s = e[5], l = e[6], c = e[7]);
218
+ const o = l === void 0 ? !1 : l, h = c === void 0 ? "main" : c, [m, A] = V(!1);
219
+ let p;
220
+ e[8] !== r ? (p = R(r, ie.BannerArea, !0), e[8] = r, e[9] = p) : p = e[9];
221
+ const _ = p, f = R(r, Y.BrandArea), v = R(r, Y.PrimaryArea), E = R(r, Y.SecondaryArea);
222
+ process.env.NODE_ENV !== "production" && Ee({
223
+ hasBrandArea: f,
224
+ hasPrimaryArea: v,
225
+ hasSecondaryArea: E
226
+ });
227
+ const y = Te(), [i, b] = V(!1), S = U(null), H = U(null), se = U(null), de = U(null), [le, we] = V(!1), [M, Be] = V(!1), [B, ve] = V(!0), [ce, De] = V(!1), he = U(i);
228
+ let J, K;
229
+ e[10] !== o ? (J = () => {
230
+ if (o) {
231
+ const w = () => {
232
+ b((P) => (he.current = P, window.innerWidth < 1024));
233
+ };
234
+ return w(), window.addEventListener("resize", w), () => window.removeEventListener("resize", w);
235
+ }
236
+ }, K = [o], e[10] = o, e[11] = J, e[12] = K) : (J = e[11], K = e[12]), ne(J, K);
237
+ let Q, X;
238
+ e[13] !== o ? (Q = () => {
239
+ if (o) {
240
+ const w = () => {
241
+ var F, O, re;
242
+ const P = document.documentElement, z = ((F = S.current) == null ? void 0 : F.offsetHeight) || 0, x = ((O = se.current) == null ? void 0 : O.offsetHeight) || 0;
243
+ let C;
244
+ if (!de.current)
245
+ C = z + x;
246
+ else {
247
+ const q = (re = H.current) == null ? void 0 : re.offsetHeight;
248
+ !q || q === z ? C = parseInt(P.style.getPropertyValue("--ds-header-height").replace("rem", "")) * 16 || 0 : C = q;
249
+ }
250
+ P.style.setProperty("--ds-banner-height", `${fe(z)}rem`), P.style.setProperty("--ds-header-height", `${fe(C)}rem`), P.style.setProperty("--ds-top-bar-height", `${fe(x)}rem`);
251
+ };
252
+ return w(), window.addEventListener("resize", w), () => window.removeEventListener("resize", w);
253
+ }
254
+ }, X = [o], e[13] = o, e[14] = Q, e[15] = X) : (Q = e[14], X = e[15]), Pe(Q, X);
255
+ let Z;
256
+ e[16] !== o || e[17] !== i || e[18] !== B || e[19] !== y ? (Z = () => {
257
+ if (o) {
258
+ const w = () => {
259
+ const x = H.current, C = !!x && window.scrollY <= x.offsetHeight;
260
+ we(C);
261
+ const F = de.current, O = se.current;
262
+ if (!i && he.current && !B) {
263
+ ve(C && !!x && window.scrollY <= x.offsetHeight);
264
+ return;
265
+ }
266
+ const re = !!O && !!F && F.getBoundingClientRect().bottom > O.getBoundingClientRect().bottom, q = !F && !!O && !!S.current && (window.scrollY >= S.current.offsetHeight || 0) || !F && !S.current && !!O && window.scrollY >= 1;
267
+ ve(F ? re && !!x && window.scrollY <= x.offsetHeight : !q);
268
+ };
269
+ window.addEventListener("scroll", w, {
270
+ passive: !0
271
+ }), w();
272
+ const P = H.current, z = !!P && P.getBoundingClientRect().bottom > 0;
273
+ return i && Be(y === "up" && !z), i || De(y === "up" && !B), () => {
274
+ window.removeEventListener("scroll", w);
275
+ };
276
+ }
277
+ }, e[16] = o, e[17] = i, e[18] = B, e[19] = y, e[20] = Z) : Z = e[20];
278
+ let ee;
279
+ e[21] !== o || e[22] !== i || e[23] !== y ? (ee = [o, i, he, y], e[21] = o, e[22] = i, e[23] = y, e[24] = ee) : ee = e[24], ne(Z, ee);
280
+ let te;
281
+ e[25] !== n || e[26] !== M || e[27] !== o || e[28] !== le || e[29] !== i ? (te = D(N.root, n, o ? {
282
+ [N.rootSticky]: i,
283
+ [N.rootHidden]: i && !le,
284
+ [N.rootFixed]: i && M
285
+ } : {}), e[25] = n, e[26] = M, e[27] = o, e[28] = le, e[29] = i, e[30] = te) : te = e[30];
286
+ const me = te;
287
+ let k;
288
+ e[31] !== t || e[32] !== m || e[33] !== ce || e[34] !== o || e[35] !== i || e[36] !== B || e[37] !== a || e[38] !== h ? (k = {
289
+ variant: h,
290
+ bannerAreaRef: S,
291
+ brandAddOnProps: t,
292
+ hasBrandAddOn: m,
293
+ setHasBrandAddOn: A,
294
+ isFixedMainNavigation: ce,
295
+ isHeaderSticky: o,
296
+ isMobile: i,
297
+ isStickyMainNavigationVisible: B,
298
+ mainNavigationAreaRef: de,
299
+ topBarAreaRef: se,
300
+ logoProps: a
301
+ }, e[31] = t, e[32] = m, e[33] = ce, e[34] = o, e[35] = i, e[36] = B, e[37] = a, e[38] = h, e[39] = k) : k = e[39];
302
+ let $;
303
+ e[40] !== r || e[41] !== k ? ($ = /* @__PURE__ */ g(G.Provider, { value: k, children: r }), e[40] = r, e[41] = k, e[42] = $) : $ = e[42];
304
+ let W;
305
+ e[43] !== s || e[44] !== me || e[45] !== $ ? (W = /* @__PURE__ */ g("header", { className: me, ...s, ref: H, children: $ }), e[43] = s, e[44] = me, e[45] = $, e[46] = W) : W = e[46];
306
+ let I;
307
+ e[47] !== M || e[48] !== i ? (I = i && M && /* @__PURE__ */ g("div", { className: N.headerPlaceholder }), e[47] = M, e[48] = i, e[49] = I) : I = e[49];
308
+ let L;
309
+ e[50] !== _ || e[51] !== i || e[52] !== B ? (L = !i && !B && /* @__PURE__ */ g("div", { className: _ ? N.headerPlaceholderWithBanner : N.headerPlaceholder }), e[50] = _, e[51] = i, e[52] = B, e[53] = L) : L = e[53];
310
+ let ae;
311
+ return e[54] !== W || e[55] !== I || e[56] !== L ? (ae = /* @__PURE__ */ Ae(_e, { children: [
312
+ W,
313
+ I,
314
+ L
315
+ ] }), e[54] = W, e[55] = I, e[56] = L, e[57] = ae) : ae = e[57], ae;
316
+ }, Se = (d) => {
317
+ const e = T.c(4), {
318
+ children: t,
319
+ className: r
320
+ } = d, {
321
+ bannerAreaRef: n
322
+ } = oe(G);
323
+ let a;
324
+ return e[0] !== n || e[1] !== t || e[2] !== r ? (a = /* @__PURE__ */ g("div", { ref: n, className: r, children: t }), e[0] = n, e[1] = t, e[2] = r, e[3] = a) : a = e[3], a;
325
+ };
326
+ Se.displayName = "DSHeader.BannerArea";
327
+ const Ne = (d) => {
328
+ const e = T.c(15), {
329
+ children: t,
330
+ className: r
331
+ } = d, {
332
+ variant: n,
333
+ isFixedMainNavigation: a,
334
+ isHeaderSticky: s,
335
+ isMobile: l,
336
+ isStickyMainNavigationVisible: c,
337
+ mainNavigationAreaRef: o
338
+ } = oe(G);
339
+ let h;
340
+ e[0] !== r || e[1] !== a || e[2] !== s || e[3] !== l || e[4] !== c ? (h = D(N.mainNavigationArea, r, s ? {
341
+ [N.mainNavigationAreaFixed]: !l && !c,
342
+ [N.mainNavigationAreaFixedVisible]: !l && a
343
+ } : {}), e[0] = r, e[1] = a, e[2] = s, e[3] = l, e[4] = c, e[5] = h) : h = e[5];
344
+ const m = h, A = n === "full";
345
+ let p;
346
+ e[6] !== A ? (p = D(N.mainNavigationContent, {
347
+ [N.mainNavigationContentVariantFull]: A
348
+ }), e[6] = A, e[7] = p) : p = e[7];
349
+ const _ = p;
350
+ let f;
351
+ e[8] !== t || e[9] !== _ ? (f = /* @__PURE__ */ g("div", { className: _, children: t }), e[8] = t, e[9] = _, e[10] = f) : f = e[10];
352
+ let v;
353
+ return e[11] !== o || e[12] !== m || e[13] !== f ? (v = /* @__PURE__ */ g("div", { className: m, ref: o, children: f }), e[11] = o, e[12] = m, e[13] = f, e[14] = v) : v = e[14], v;
354
+ };
355
+ Ne.displayName = "DSHeader.MainNavigationArea";
356
+ ie.BannerArea = Se;
357
+ ie.MainNavigationArea = Ne;
358
+ ie.displayName = "DSHeader";
359
+ export {
360
+ pt as B,
361
+ G as D,
362
+ At as H,
363
+ ie as a,
364
+ Y as b,
365
+ Je as c,
366
+ ge as i,
367
+ Ee as v
368
+ };
@@ -0,0 +1,218 @@
1
+ "use client";
2
+ import { jsxs as T, jsx as a } from "react/jsx-runtime";
3
+ import { c as m } from "./index.CEyLAtio.js";
4
+ import { forwardRef as pe, useState as U, useRef as ge, useCallback as be } from "react";
5
+ import { t as _e } from "./translate.nuU7uChI.js";
6
+ import { u as Z } from "./useBreakpoint.CMOR9ZOB.js";
7
+ import "./index.CgTHIF3K.js";
8
+ import { g as De } from "./AriaLiveRegions.utils.Cb327d_2.js";
9
+ import { D as me } from "./Button.CC0qEsuR.js";
10
+ import { FileList as ve } from "../filelist.Cj9U-Jx8.js";
11
+ import { D as he } from "./Icon.C0161Glk.js";
12
+ import { DSSystemFeedback as Ie } from "../systemfeedback.CLQCbTF6.js";
13
+ import { g as I } from "./helpers.BbWkXTr3.js";
14
+ import '../assets/InputFile.BVgHILAZ.css';const we = "ds-input-file_root_38v94_1", ze = "ds-input-file_hint_38v94_1", Se = "ds-input-file_label_38v94_1", Ne = "ds-input-file_browse-button--is-dragging-filled_38v94_4", ye = "ds-input-file_browse-button--is-dragging_38v94_4", Le = "ds-input-file_label--hidden_38v94_44", ke = "ds-input-file_label--disabled_38v94_57", Be = "ds-input-file_label--required_38v94_61", Fe = "ds-input-file_feedback_38v94_82", Te = "ds-input-file_dropzone_38v94_87", $e = "ds-input-file_dropzone--disabled_38v94_93", Ae = "ds-input-file_dropzone--invalid_38v94_107", Ce = "ds-input-file_dropzone--is-dragging_38v94_110", Re = "ds-input-file_hint-drop-zone_38v94_113", qe = "ds-input-file_upload-icon_38v94_116", Ee = "ds-input-file_browse-button-dropzone--is-dragging_38v94_119", Pe = "ds-input-file_instructions_38v94_122", xe = "ds-input-file_input_38v94_159", He = "ds-input-file_required-sr-info_38v94_163", t = {
15
+ root: we,
16
+ hint: ze,
17
+ label: Se,
18
+ browseButtonIsDraggingFilled: Ne,
19
+ browseButtonIsDragging: ye,
20
+ labelHidden: Le,
21
+ labelDisabled: ke,
22
+ labelRequired: Be,
23
+ feedback: Fe,
24
+ dropzone: Te,
25
+ dropzoneDisabled: $e,
26
+ dropzoneInvalid: Ae,
27
+ dropzoneIsDragging: Ce,
28
+ hintDropZone: Re,
29
+ uploadIcon: qe,
30
+ browseButtonDropzoneIsDragging: Ee,
31
+ instructions: Pe,
32
+ input: xe,
33
+ requiredSrInfo: He
34
+ }, Oe = {
35
+ dragAndDropInstructions: "Drag and drop files here or",
36
+ feedbackFileSize: "File too large. Maximum file size is",
37
+ feedbackFileType: "File type not allowed",
38
+ // {0} is the file name
39
+ fileListRemoveSelectionButtonLabel: "Remove {0} from selected files",
40
+ fileListPreviewAltText: "Preview of",
41
+ filesSelectedHint: "The following files are selected",
42
+ required: "required"
43
+ }, We = {
44
+ dragAndDropInstructions: "Dateien hier hin ziehen oder",
45
+ feedbackFileSize: "Datei zu groß. Maximale Dateigröße ist",
46
+ feedbackFileType: "Dateityp nicht zugelassen",
47
+ // {0} is the file name
48
+ fileListRemoveSelectionButtonLabel: "Datei {0} aus der Auswahl entfernen",
49
+ fileListPreviewAltText: "Vorschau von",
50
+ filesSelectedHint: "Die folgenden Dateien sind ausgewählt",
51
+ required: "erforderlich"
52
+ }, Ve = {
53
+ en: Oe,
54
+ de: We
55
+ }, je = (r, d) => {
56
+ const i = d.split(",").map((l) => l.trim().toLowerCase()).filter(Boolean), u = r.name.toLowerCase(), o = r.type.toLowerCase();
57
+ return i.some((l) => {
58
+ if (l.startsWith("."))
59
+ return u.endsWith(l);
60
+ if (l.endsWith("/*")) {
61
+ const [w] = o.split("/");
62
+ return w === l.slice(0, -2);
63
+ }
64
+ return o === l;
65
+ });
66
+ }, Me = ({
67
+ id: r,
68
+ label: d,
69
+ inputFileButtonProps: i
70
+ }) => {
71
+ var u;
72
+ if (!r)
73
+ throw new Error(I("DSInputFile", 'A unique "id" prop is required. Please add a unique "id" prop to the DSInputFile component.'));
74
+ if (!d)
75
+ throw new Error(I("DSInputFile", `A label is always required for a11y reasons. Please add a descriptive "label" prop to the DSInputFile component. If you don't want to display a label, set hideLabel={true}.`));
76
+ if (i && ((u = i.label) == null ? void 0 : u.trim()) === "")
77
+ throw new Error(I("DSInputFile", "The input file button needs to have a label for a11y reasons. Please add a label to the inputFileButtonProps."));
78
+ if (i && i.variant && i.variant !== "outline" && i.variant !== "filled")
79
+ throw new Error(I("DSInputFile", "The inputFileButtonProps variant value can only be 'outline' for DSInputFile components inside forms or 'filled' for standalone DSInputFile components."));
80
+ }, Ue = pe(({
81
+ id: r,
82
+ label: d,
83
+ accept: i,
84
+ className: u,
85
+ disabled: o = !1,
86
+ fileListItemRemoveButtonProps: l,
87
+ hideLabel: w = !1,
88
+ hint: _,
89
+ inputFileButtonProps: $,
90
+ invalid: v = !1,
91
+ isHintOutsideDropzone: G = {
92
+ base: !0,
93
+ m: !1
94
+ },
95
+ lang: A = "en",
96
+ maxSizeInMb: z = 7,
97
+ multiple: D = !1,
98
+ required: S = !1,
99
+ showFileList: J = !0,
100
+ showDropzone: c = !1,
101
+ systemFeedback: N,
102
+ translations: K,
103
+ onFilesSelect: f,
104
+ ...Q
105
+ }, h) => {
106
+ const p = _e(K || Ve[A]);
107
+ process.env.NODE_ENV !== "production" && Me({
108
+ id: r,
109
+ label: d,
110
+ inputFileButtonProps: $
111
+ });
112
+ const {
113
+ label: X = A === "en" ? `Choose File${D ? "s" : ""}` : `Datei${D ? "en" : ""} auswählen`,
114
+ variant: y = "outline",
115
+ ...Y
116
+ } = $ || {}, [C, R] = U([]), g = ge(null), [b, L] = U(!1), ee = z * 1024 * 1024, k = `${r}-label`, q = `${r}-feedback`, B = `${r}-hint`, E = _ ? ` ${B}` : "", te = Z(w), P = Z(G), ne = m(t.root, u), ie = m(t.dropzone, {
117
+ [t.dropzoneDisabled]: o,
118
+ [t.dropzoneInvalid]: v,
119
+ [t.dropzoneIsDragging]: b
120
+ }), oe = m(t.label, {
121
+ // hide label only visually to keep them available for assistive technologies
122
+ [t.labelHidden]: te,
123
+ [t.labelDisabled]: o,
124
+ [t.labelRequired]: S
125
+ }), se = m(t.browseButton, {
126
+ [t.browseButtonIsDragging]: b && y === "outline",
127
+ [t.browseButtonIsDraggingFilled]: b && y === "filled"
128
+ }), re = m(t.browseButtonDropzone, {
129
+ [t.browseButtonDropzoneIsDragging]: b
130
+ }), ae = [v && N && q].filter(Boolean).join(" ") || void 0, le = (e) => {
131
+ g.current = e, typeof h == "function" ? h(e) : h && (h.current = e);
132
+ }, x = (e) => {
133
+ if (!e)
134
+ return;
135
+ const n = [];
136
+ for (const s of e)
137
+ if (i && !je(s, i) && (s.feedback = `${p("feedbackFileType")}: ${s.type}.`), s.size > ee && (s.feedback = `${p("feedbackFileSize")} ${z} MB.`), n.push(s), !D && n.length > 0)
138
+ break;
139
+ n.length > 0 && (R(() => {
140
+ const s = [...n], M = s.map(({
141
+ name: F,
142
+ feedback: fe = ""
143
+ }) => `${F} ${fe}`).join(", ");
144
+ return setTimeout(() => {
145
+ ce(`${p("filesSelectedHint")}: ${M}.`);
146
+ }, 1e3), s;
147
+ }), f == null || f(n));
148
+ }, H = (e) => {
149
+ var n;
150
+ o || ((n = g.current) == null || n.click(), e.stopPropagation());
151
+ }, O = (e) => {
152
+ e.preventDefault(), b || L(!0);
153
+ }, W = (e) => {
154
+ e.preventDefault(), b && L(!1);
155
+ }, V = be((e) => {
156
+ e.preventDefault(), !o && (L(!1), x(e.dataTransfer.files));
157
+ }, [D, i, z, o]), de = (e) => {
158
+ x(e.target.files), g != null && g.current && (g.current.value = "");
159
+ }, ue = (e) => {
160
+ R((n) => {
161
+ const s = n.filter((M, F) => F !== e);
162
+ return f == null || f(s), s;
163
+ });
164
+ }, ce = (e) => {
165
+ const n = De();
166
+ n && (n.innerText = e, setTimeout(() => {
167
+ n.innerText = "";
168
+ }, 350));
169
+ }, j = () => /* @__PURE__ */ a(me, { ...Y, className: c ? re : se, type: "button", variant: y, size: c ? "small" : "medium", disabled: o, iconName: c ? void 0 : "upload", onClick: H, "aria-describedby": ae, "aria-invalid": v, children: X });
170
+ return /* @__PURE__ */ T("div", { className: ne, children: [
171
+ /* @__PURE__ */ T("label", { className: oe, id: k, htmlFor: r, children: [
172
+ d,
173
+ S && /* @__PURE__ */ a("span", { className: t.requiredSrInfo, children: p("required") })
174
+ ] }),
175
+ _ && (P || !c) && /* @__PURE__ */ a("div", { className: t.hint, id: B, children: _ }),
176
+ v && N && /* @__PURE__ */ a(Ie, { className: t.feedback, message: N, type: "invalid", id: q }),
177
+ !c && /* @__PURE__ */ a(
178
+ "div",
179
+ {
180
+ onDragOver: O,
181
+ onDragLeave: W,
182
+ onDrop: V,
183
+ "aria-labelledby": `${k}${E}`,
184
+ "aria-disabled": o,
185
+ children: j()
186
+ }
187
+ ),
188
+ c && /* @__PURE__ */ T(
189
+ "div",
190
+ {
191
+ className: ie,
192
+ onClick: (e) => H(e),
193
+ onDragOver: O,
194
+ onDragLeave: W,
195
+ onDrop: V,
196
+ "aria-labelledby": `${k}${E}`,
197
+ "aria-disabled": o,
198
+ children: [
199
+ /* @__PURE__ */ a(he, { name: "upload", className: t.uploadIcon, size: "x-large" }),
200
+ /* @__PURE__ */ a("p", { id: "file-upload-instructions", className: t.instructions, children: p("dragAndDropInstructions") }),
201
+ j(),
202
+ _ && !P && /* @__PURE__ */ a("div", { className: t.hintDropZone, id: B, children: _ })
203
+ ]
204
+ }
205
+ ),
206
+ /* @__PURE__ */ a("input", { ...Q, type: "file", className: t.input, id: r, ref: le, accept: i, multiple: D, "aria-hidden": "true", required: S, disabled: o, onChange: de }),
207
+ C.length > 0 && J && /* @__PURE__ */ a(ve, { files: C, onRemoveFile: ue, fileListItemRemoveButtonProps: l, t: p })
208
+ ] });
209
+ });
210
+ Ue.displayName = "DSInputFile";
211
+ export {
212
+ Ue as D,
213
+ Oe as a,
214
+ We as b,
215
+ Ve as c,
216
+ je as f,
217
+ Me as v
218
+ };