@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
@@ -1,361 +0,0 @@
1
- "use client";
2
- import { jsx as g, jsxs as he, Fragment as ge } from "react/jsx-runtime";
3
- import { d as P } from "./index.CgTHIF3K.js";
4
- import { c as B } from "./index.CEyLAtio.js";
5
- import { useState as T, useEffect as re, useContext as ne, createContext as De, useRef as q } from "react";
6
- import { g as U, c as F, p as me } from "./helpers.BbWkXTr3.js";
7
- import { u as He } from "./useIsomorphicLayoutEffect.CnJ9AMFS.js";
8
- import { DSLogo as Pe } from "../logo.C96KaG1P.js";
9
- import '../assets/Header.DO34x-dO.css';const xe = (d) => {
10
- const e = P.c(3), t = 0, [r, n] = T("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, m = o > l ? "down" : "up";
17
- Math.abs(o - l) > t && (n(m), 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]), re(a, s), r;
23
- }, ft = ["full", "main"], Ee = ({
24
- hasBrandArea: d,
25
- hasPrimaryArea: e,
26
- hasSecondaryArea: t
27
- }) => {
28
- if (d)
29
- throw new Error(U("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(U("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(U("DSHeader", "A <DSTopBar.SecondaryArea> component was detected as a direct child of DSHeader. Please move it into the DSTopBar component."));
34
- }, Te = "ds-top-bar_root_ryiho_1", Fe = "ds-top-bar_root--sticky_ryiho_47", Ce = "ds-top-bar_root--fixed_ryiho_51", Oe = "ds-top-bar_content_ryiho_59", Ve = "ds-top-bar_content--variant-full_ryiho_78", Re = "ds-top-bar_content--has-primary-area-and-secondary-area_ryiho_82", ke = "ds-top-bar_primary_ryiho_87", Me = "ds-top-bar_content--has-brand-add-on-with-primary-area-and-secondary-area_ryiho_102", $e = "ds-top-bar_brand_ryiho_107", We = "ds-top-bar_content--has-primary-area_ryiho_82", Ie = "ds-top-bar_content--has-primary-area--with-brand-add-on_ryiho_146", Le = "ds-top-bar_brand-add-on_ryiho_210", Ye = "ds-top-bar_brand-add-on--double_ryiho_231", ze = "ds-top-bar_sub-title_ryiho_245", qe = "ds-top-bar_secondary_ryiho_271", Ue = "ds-top-bar_logo_ryiho_280", je = "ds-top-bar_logo--reduced_ryiho_290", v = {
35
- root: Te,
36
- rootSticky: Fe,
37
- rootFixed: Ce,
38
- content: Oe,
39
- contentVariantFull: Ve,
40
- contentHasPrimaryAreaAndSecondaryArea: Re,
41
- primary: ke,
42
- contentHasBrandAddOnWithPrimaryAreaAndSecondaryArea: Me,
43
- brand: $e,
44
- contentHasPrimaryArea: We,
45
- contentHasPrimaryAreaWithBrandAddOn: Ie,
46
- brandAddOn: Le,
47
- brandAddOnDouble: Ye,
48
- subTitle: ze,
49
- secondary: qe,
50
- logo: Ue,
51
- logoReduced: je
52
- }, Ge = ({
53
- hasBrandArea: d,
54
- hasPrimaryArea: e,
55
- hasSecondaryArea: t
56
- }) => {
57
- if (!d)
58
- throw new Error(U("DSTopBar", "A <DSTopBar.BrandArea> component is required. Please include it as a child of DSTopBar."));
59
- if (!e && t)
60
- throw new Error(U("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
- }, ue = (d) => d == null || typeof d == "object" && !Array.isArray(d) && d !== null && Object.keys(d).length === 0, At = ["double", "single"], I = (d) => {
62
- const e = P.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: m,
76
- hasBrandAddOn: h
77
- } = ne(j);
78
- let A, y;
79
- if (e[5] !== t || e[6] !== r || e[7] !== h || e[8] !== l || e[9] !== c || e[10] !== m || e[11] !== a || e[12] !== s) {
80
- const x = F(t, fe), p = F(t, Ae), i = F(t, ye);
81
- process.env.NODE_ENV !== "production" && Ge({
82
- hasBrandArea: x,
83
- hasPrimaryArea: p,
84
- hasSecondaryArea: i
85
- });
86
- let b;
87
- e[15] !== l || e[16] !== c || e[17] !== m || e[18] !== a ? (b = B(v.root, a, l ? {
88
- [v.rootSticky]: !c && m,
89
- [v.rootFixed]: !c && !m
90
- } : {}), e[15] = l, e[16] = c, e[17] = m, e[18] = a, e[19] = b) : b = e[19], A = b, y = B(v.content, r, {
91
- [v.contentHasPrimaryArea]: p && !h && !i,
92
- [v.contentHasPrimaryAreaWithBrandAddOn]: p && h && !i,
93
- [v.contentHasBrandAddOnWithPrimaryAreaAndSecondaryArea]: h && p && i,
94
- [v.contentHasPrimaryAreaAndSecondaryArea]: p && i && !h,
95
- [v.contentVariantFull]: s === "full"
96
- }), e[5] = t, e[6] = r, e[7] = h, e[8] = l, e[9] = c, e[10] = m, e[11] = a, e[12] = s, e[13] = A, e[14] = y;
97
- } else
98
- A = e[13], y = e[14];
99
- const _ = y;
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 u;
103
- return e[24] !== A || e[25] !== f || e[26] !== o ? (u = /* @__PURE__ */ g("div", { className: A, ref: o, children: f }), e[24] = A, e[25] = f, e[26] = o, e[27] = u) : u = e[27], u;
104
- }, fe = (d) => {
105
- const e = P.c(26), {
106
- children: t,
107
- className: r
108
- } = d, {
109
- logoProps: n,
110
- brandAddOnProps: a,
111
- setHasBrandAddOn: s
112
- } = ne(j);
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: m,
119
- target: h
120
- } = l, A = o === void 0 ? "main" : o, y = m === void 0 ? "/" : m, _ = h === void 0 ? "_self" : h;
121
- let f;
122
- e[2] !== a || e[3] !== t || e[4] !== s ? (f = () => {
123
- t || !ue(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 u;
126
- e[6] !== a || e[7] !== t ? (u = [t, a], e[6] = a, e[7] = t, e[8] = u) : u = e[8], re(f, u);
127
- let x;
128
- e[9] !== A ? (x = B(v.logo, {
129
- [v.logoReduced]: A.includes("reduced")
130
- }), e[9] = A, e[10] = x) : x = e[10];
131
- const p = x;
132
- let i;
133
- e[11] !== r ? (i = B(v.brand, r), e[11] = r, e[12] = i) : i = e[12];
134
- let b;
135
- e[13] !== c || e[14] !== y || e[15] !== A || e[16] !== p || e[17] !== _ ? (b = /* @__PURE__ */ g(Pe, { className: p, aria: c, logo: A, href: y, target: _ }), e[13] = c, e[14] = y, e[15] = A, e[16] = p, e[17] = _, e[18] = b) : b = e[18];
136
- let D;
137
- e[19] !== a ? (D = ue(a) ? void 0 : /* @__PURE__ */ g(_e, { ...a }), e[19] = a, e[20] = D) : D = e[20];
138
- let H;
139
- return e[21] !== t || e[22] !== D || e[23] !== i || e[24] !== b ? (H = /* @__PURE__ */ he("div", { className: i, children: [
140
- b,
141
- D,
142
- t
143
- ] }), e[21] = t, e[22] = D, e[23] = i, e[24] = b, e[25] = H) : H = e[25], H;
144
- };
145
- fe.displayName = "DSTopBar.BrandArea";
146
- const _e = (d) => {
147
- const e = P.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 = B(v.brandAddOn, r, {
155
- [v.brandAddOnDouble]: l
156
- }), e[0] = r, e[1] = l, e[2] = c) : c = e[2];
157
- const o = c;
158
- let m;
159
- e[3] !== t || e[4] !== n || e[5] !== s ? (m = s === "single" ? t : /* @__PURE__ */ he(ge, { children: [
160
- /* @__PURE__ */ g("span", { children: t }),
161
- n && /* @__PURE__ */ g("span", { className: v.subTitle, children: n })
162
- ] }), e[3] = t, e[4] = n, e[5] = s, e[6] = m) : m = e[6];
163
- let h;
164
- return e[7] !== o || e[8] !== m ? (h = /* @__PURE__ */ g("span", { className: o, children: m }), e[7] = o, e[8] = m, e[9] = h) : h = e[9], h;
165
- };
166
- _e.displayName = "DSTopBar.BrandAddOn";
167
- const Ae = (d) => {
168
- const e = P.c(5), {
169
- children: t,
170
- className: r
171
- } = d;
172
- let n;
173
- e[0] !== r ? (n = B(v.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
- Ae.displayName = "DSTopBar.PrimaryArea";
178
- const ye = (d) => {
179
- const e = P.c(5), {
180
- children: t,
181
- className: r
182
- } = d;
183
- let n;
184
- e[0] !== r ? (n = B(v.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
- ye.displayName = "DSTopBar.SecondaryArea";
189
- I.BrandArea = fe;
190
- I.PrimaryArea = Ae;
191
- I.SecondaryArea = ye;
192
- const Je = "ds-header_root_g2mvw_1", Ke = "ds-header_root--sticky_g2mvw_4", Qe = "ds-header_root--hidden_g2mvw_9", Xe = "ds-header_root--fixed_g2mvw_20", Ze = "ds-header_main-navigation-area_g2mvw_36", et = "ds-header_main-navigation-area--fixed_g2mvw_88", tt = "ds-header_main-navigation-area--fixed--visible_g2mvw_103", at = "ds-header_main-navigation-content_g2mvw_108", rt = "ds-header_main-navigation-content--variant-full_g2mvw_112", nt = "ds-header_header-placeholder_g2mvw_117", ot = "ds-header_header-placeholder--with-banner_g2mvw_120", S = {
193
- root: Je,
194
- rootSticky: Ke,
195
- rootHidden: Qe,
196
- rootFixed: Xe,
197
- mainNavigationArea: Ze,
198
- mainNavigationAreaFixed: et,
199
- mainNavigationAreaFixedVisible: tt,
200
- mainNavigationContent: at,
201
- mainNavigationContentVariantFull: rt,
202
- headerPlaceholder: nt,
203
- headerPlaceholderWithBanner: ot
204
- }, j = De({
205
- variant: "main"
206
- }), oe = (d) => {
207
- const e = P.c(59);
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, m = c === void 0 ? "main" : c, [h, A] = T(!1);
219
- let y;
220
- e[8] !== r ? (y = F(r, oe.BannerArea, !0), e[8] = r, e[9] = y) : y = e[9];
221
- const _ = y, f = F(r, I.BrandArea), u = F(r, I.PrimaryArea), x = F(r, I.SecondaryArea);
222
- process.env.NODE_ENV !== "production" && Ee({
223
- hasBrandArea: f,
224
- hasPrimaryArea: u,
225
- hasSecondaryArea: x
226
- });
227
- const p = xe(), [i, b] = T(!1), D = q(null), H = q(null), ie = q(null), pe = q(null), [C, Ne] = T(!1), [O, we] = T(!1), [w, ve] = T(!0), [se, Be] = T(!1), de = q(i);
228
- let G, J;
229
- e[10] !== o ? (G = () => {
230
- if (o) {
231
- const N = () => {
232
- b((W) => (de.current = W, window.innerWidth < 1024));
233
- };
234
- return N(), window.addEventListener("resize", N), () => window.removeEventListener("resize", N);
235
- }
236
- }, J = [o], e[10] = o, e[11] = G, e[12] = J) : (G = e[11], J = e[12]), re(G, J);
237
- let K, Q;
238
- e[13] !== o ? (K = () => {
239
- if (o) {
240
- const N = () => {
241
- var Y, z, ae;
242
- const W = ((Y = D.current) == null ? void 0 : Y.offsetHeight) ?? 0, ce = ((z = H.current) == null ? void 0 : z.offsetHeight) ?? 0, E = ((ae = ie.current) == null ? void 0 : ae.offsetHeight) ?? 0, L = document.documentElement;
243
- L.style.setProperty("--ds-banner-height", `${me(W)}rem`), L.style.setProperty("--ds-header-height", `${me(ce)}rem`), L.style.setProperty("--ds-top-bar-height", `${me(E)}rem`);
244
- };
245
- return N(), window.addEventListener("resize", N), () => window.removeEventListener("resize", N);
246
- }
247
- }, Q = [o], e[13] = o, e[14] = K, e[15] = Q) : (K = e[14], Q = e[15]), He(K, Q);
248
- let X;
249
- e[16] !== o || e[17] !== C || e[18] !== i || e[19] !== w || e[20] !== p ? (X = () => {
250
- if (o) {
251
- const N = () => {
252
- const E = H.current, L = !!E && window.scrollY <= E.offsetHeight;
253
- Ne(L);
254
- const Y = pe.current, z = ie.current;
255
- if (!i && de.current && !w) {
256
- ve(C && !!E && window.scrollY <= E.offsetHeight);
257
- return;
258
- }
259
- const ae = !!z && !!Y && Y.getBoundingClientRect().bottom > z.getBoundingClientRect().bottom;
260
- ve(ae && !!E && window.scrollY <= E.offsetHeight);
261
- };
262
- window.addEventListener("scroll", N, {
263
- passive: !0
264
- }), N();
265
- const W = H.current, ce = !!W && W.getBoundingClientRect().bottom > 0;
266
- return i && we(p === "up" && !ce), i || Be(p === "up" && !w), () => {
267
- window.removeEventListener("scroll", N);
268
- };
269
- }
270
- }, e[16] = o, e[17] = C, e[18] = i, e[19] = w, e[20] = p, e[21] = X) : X = e[21];
271
- let Z;
272
- e[22] !== o || e[23] !== i || e[24] !== p ? (Z = [o, i, de, p], e[22] = o, e[23] = i, e[24] = p, e[25] = Z) : Z = e[25], re(X, Z);
273
- let ee;
274
- e[26] !== n || e[27] !== O || e[28] !== o || e[29] !== C || e[30] !== i ? (ee = B(S.root, n, o ? {
275
- [S.rootSticky]: i,
276
- [S.rootHidden]: i && !C,
277
- [S.rootFixed]: i && O
278
- } : {}), e[26] = n, e[27] = O, e[28] = o, e[29] = C, e[30] = i, e[31] = ee) : ee = e[31];
279
- const le = ee;
280
- let V;
281
- e[32] !== t || e[33] !== h || e[34] !== se || e[35] !== o || e[36] !== i || e[37] !== w || e[38] !== a || e[39] !== m ? (V = {
282
- variant: m,
283
- bannerAreaRef: D,
284
- brandAddOnProps: t,
285
- hasBrandAddOn: h,
286
- setHasBrandAddOn: A,
287
- isFixedMainNavigation: se,
288
- isHeaderSticky: o,
289
- isMobile: i,
290
- isStickyMainNavigationVisible: w,
291
- mainNavigationAreaRef: pe,
292
- topBarAreaRef: ie,
293
- logoProps: a
294
- }, e[32] = t, e[33] = h, e[34] = se, e[35] = o, e[36] = i, e[37] = w, e[38] = a, e[39] = m, e[40] = V) : V = e[40];
295
- let R;
296
- e[41] !== r || e[42] !== V ? (R = /* @__PURE__ */ g(j.Provider, { value: V, children: r }), e[41] = r, e[42] = V, e[43] = R) : R = e[43];
297
- let k;
298
- e[44] !== s || e[45] !== le || e[46] !== R ? (k = /* @__PURE__ */ g("header", { className: le, ...s, ref: H, children: R }), e[44] = s, e[45] = le, e[46] = R, e[47] = k) : k = e[47];
299
- let M;
300
- e[48] !== O || e[49] !== i ? (M = i && O && /* @__PURE__ */ g("div", { className: S.headerPlaceholder }), e[48] = O, e[49] = i, e[50] = M) : M = e[50];
301
- let $;
302
- e[51] !== _ || e[52] !== i || e[53] !== w ? ($ = !i && !w && /* @__PURE__ */ g("div", { className: _ ? S.headerPlaceholderWithBanner : S.headerPlaceholder }), e[51] = _, e[52] = i, e[53] = w, e[54] = $) : $ = e[54];
303
- let te;
304
- return e[55] !== k || e[56] !== M || e[57] !== $ ? (te = /* @__PURE__ */ he(ge, { children: [
305
- k,
306
- M,
307
- $
308
- ] }), e[55] = k, e[56] = M, e[57] = $, e[58] = te) : te = e[58], te;
309
- }, be = (d) => {
310
- const e = P.c(4), {
311
- children: t,
312
- className: r
313
- } = d, {
314
- bannerAreaRef: n
315
- } = ne(j);
316
- let a;
317
- 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;
318
- };
319
- be.displayName = "DSHeader.BannerArea";
320
- const Se = (d) => {
321
- const e = P.c(15), {
322
- children: t,
323
- className: r
324
- } = d, {
325
- variant: n,
326
- isFixedMainNavigation: a,
327
- isHeaderSticky: s,
328
- isMobile: l,
329
- isStickyMainNavigationVisible: c,
330
- mainNavigationAreaRef: o
331
- } = ne(j);
332
- let m;
333
- e[0] !== r || e[1] !== a || e[2] !== s || e[3] !== l || e[4] !== c ? (m = B(S.mainNavigationArea, r, s ? {
334
- [S.mainNavigationAreaFixed]: !l && !c,
335
- [S.mainNavigationAreaFixedVisible]: !l && a
336
- } : {}), e[0] = r, e[1] = a, e[2] = s, e[3] = l, e[4] = c, e[5] = m) : m = e[5];
337
- const h = m, A = n === "full";
338
- let y;
339
- e[6] !== A ? (y = B(S.mainNavigationContent, {
340
- [S.mainNavigationContentVariantFull]: A
341
- }), e[6] = A, e[7] = y) : y = e[7];
342
- const _ = y;
343
- let f;
344
- e[8] !== t || e[9] !== _ ? (f = /* @__PURE__ */ g("div", { className: _, children: t }), e[8] = t, e[9] = _, e[10] = f) : f = e[10];
345
- let u;
346
- return e[11] !== o || e[12] !== h || e[13] !== f ? (u = /* @__PURE__ */ g("div", { className: h, ref: o, children: f }), e[11] = o, e[12] = h, e[13] = f, e[14] = u) : u = e[14], u;
347
- };
348
- Se.displayName = "DSHeader.MainNavigationArea";
349
- oe.BannerArea = be;
350
- oe.MainNavigationArea = Se;
351
- oe.displayName = "DSHeader";
352
- export {
353
- At as B,
354
- j as D,
355
- ft as H,
356
- oe as a,
357
- I as b,
358
- Ge as c,
359
- ue as i,
360
- Ee as v
361
- };
@@ -1,220 +0,0 @@
1
- "use client";
2
- import { jsxs as y, jsx as a, Fragment as fe } from "react/jsx-runtime";
3
- import { c as D } from "./index.CEyLAtio.js";
4
- import { forwardRef as ge, useState as U, useRef as me, 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 { Asterisk as he } from "../asterisk.CR60hx8S.js";
10
- import { D as Ie } from "./Button.CC0qEsuR.js";
11
- import { FileList as ye } from "../filelist.Cj9U-Jx8.js";
12
- import { D as ve } from "./Icon.C0161Glk.js";
13
- import { DSSystemFeedback as we } from "../systemfeedback.CLQCbTF6.js";
14
- import { g as v } from "./helpers.BbWkXTr3.js";
15
- import '../assets/InputFile.Dqjz53mb.css';const ze = "ds-input-file_root_1pm2y_1", Se = "ds-input-file_hint_1pm2y_1", Ne = "ds-input-file_label_1pm2y_1", Le = "ds-input-file_browse-button--is-dragging-filled_1pm2y_4", ke = "ds-input-file_browse-button--is-dragging_1pm2y_4", Be = "ds-input-file_label--hidden_1pm2y_44", Fe = "ds-input-file_label--disabled_1pm2y_57", Te = "ds-input-file_feedback_1pm2y_77", Ae = "ds-input-file_dropzone_1pm2y_82", $e = "ds-input-file_dropzone--disabled_1pm2y_88", Ce = "ds-input-file_dropzone--invalid_1pm2y_102", Ee = "ds-input-file_dropzone--is-dragging_1pm2y_105", Re = "ds-input-file_hint-drop-zone_1pm2y_108", qe = "ds-input-file_upload-icon_1pm2y_111", Pe = "ds-input-file_browse-button-dropzone--is-dragging_1pm2y_114", xe = "ds-input-file_instructions_1pm2y_117", He = "ds-input-file_input_1pm2y_154", Oe = "ds-input-file_required-sr-info_1pm2y_158", t = {
16
- root: ze,
17
- hint: Se,
18
- label: Ne,
19
- browseButtonIsDraggingFilled: Le,
20
- browseButtonIsDragging: ke,
21
- labelHidden: Be,
22
- labelDisabled: Fe,
23
- feedback: Te,
24
- dropzone: Ae,
25
- dropzoneDisabled: $e,
26
- dropzoneInvalid: Ce,
27
- dropzoneIsDragging: Ee,
28
- hintDropZone: Re,
29
- uploadIcon: qe,
30
- browseButtonDropzoneIsDragging: Pe,
31
- instructions: xe,
32
- input: He,
33
- requiredSrInfo: Oe
34
- }, We = {
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
- }, Ve = {
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
- }, je = {
53
- en: We,
54
- de: Ve
55
- }, Me = (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
- }, Ue = ({
67
- id: r,
68
- label: d,
69
- inputFileButtonProps: i
70
- }) => {
71
- var u;
72
- if (!r)
73
- throw new Error(v("DSInputFile", 'A unique "id" prop is required. Please add a unique "id" prop to the DSInputFile component.'));
74
- if (!d)
75
- throw new Error(v("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(v("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(v("DSInputFile", "The inputFileButtonProps variant value can only be 'outline' for DSInputFile components inside forms or 'filled' for standalone DSInputFile components."));
80
- }, Ze = ge(({
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: b,
89
- inputFileButtonProps: T,
90
- invalid: h = !1,
91
- isHintOutsideDropzone: G = {
92
- base: !0,
93
- m: !1
94
- },
95
- lang: A = "en",
96
- maxSizeInMb: z = 7,
97
- multiple: _ = !1,
98
- required: $ = !1,
99
- showFileList: J = !0,
100
- showDropzone: c = !1,
101
- systemFeedback: S,
102
- translations: K,
103
- onFilesSelect: p,
104
- ...Q
105
- }, I) => {
106
- const f = _e(K || je[A]);
107
- process.env.NODE_ENV !== "production" && Ue({
108
- id: r,
109
- label: d,
110
- inputFileButtonProps: T
111
- });
112
- const {
113
- label: X = A === "en" ? `Choose File${_ ? "s" : ""}` : `Datei${_ ? "en" : ""} auswählen`,
114
- variant: N = "outline",
115
- ...Y
116
- } = T || {}, [C, E] = U([]), g = me(null), [m, L] = U(!1), ee = z * 1024 * 1024, k = `${r}-label`, R = `${r}-feedback`, B = `${r}-hint`, q = b ? ` ${B}` : "", te = Z(w), P = Z(G), ne = D(t.root, u), ie = D(t.dropzone, {
117
- [t.dropzoneDisabled]: o,
118
- [t.dropzoneInvalid]: h,
119
- [t.dropzoneIsDragging]: m
120
- }), oe = D(t.label, {
121
- // hide label only visually to keep them available for assistive technologies
122
- [t.labelHidden]: te,
123
- [t.labelDisabled]: o
124
- }), se = D(t.browseButton, {
125
- [t.browseButtonIsDragging]: m && N === "outline",
126
- [t.browseButtonIsDraggingFilled]: m && N === "filled"
127
- }), re = D(t.browseButtonDropzone, {
128
- [t.browseButtonDropzoneIsDragging]: m
129
- }), ae = [h && S && R].filter(Boolean).join(" ") || void 0, le = (e) => {
130
- g.current = e, typeof I == "function" ? I(e) : I && (I.current = e);
131
- }, x = (e) => {
132
- if (!e)
133
- return;
134
- const n = [];
135
- for (const s of e)
136
- if (i && !Me(s, i) && (s.feedback = `${f("feedbackFileType")}: ${s.type}.`), s.size > ee && (s.feedback = `${f("feedbackFileSize")} ${z} MB.`), n.push(s), !_ && n.length > 0)
137
- break;
138
- n.length > 0 && (E(() => {
139
- const s = [...n], M = s.map(({
140
- name: F,
141
- feedback: pe = ""
142
- }) => `${F} ${pe}`).join(", ");
143
- return setTimeout(() => {
144
- ce(`${f("filesSelectedHint")}: ${M}.`);
145
- }, 1e3), s;
146
- }), p == null || p(n));
147
- }, H = (e) => {
148
- var n;
149
- o || ((n = g.current) == null || n.click(), e.stopPropagation());
150
- }, O = (e) => {
151
- e.preventDefault(), m || L(!0);
152
- }, W = (e) => {
153
- e.preventDefault(), m && L(!1);
154
- }, V = be((e) => {
155
- e.preventDefault(), !o && (L(!1), x(e.dataTransfer.files));
156
- }, [_, i, z, o]), de = (e) => {
157
- x(e.target.files), g != null && g.current && (g.current.value = "");
158
- }, ue = (e) => {
159
- E((n) => {
160
- const s = n.filter((M, F) => F !== e);
161
- return p == null || p(s), s;
162
- });
163
- }, ce = (e) => {
164
- const n = De();
165
- n && (n.innerText = e, setTimeout(() => {
166
- n.innerText = "";
167
- }, 350));
168
- }, j = () => /* @__PURE__ */ a(Ie, { ...Y, className: c ? re : se, type: "button", variant: N, size: c ? "small" : "medium", disabled: o, iconName: c ? void 0 : "upload", onClick: H, "aria-describedby": ae, "aria-invalid": h, children: X });
169
- return /* @__PURE__ */ y("div", { className: ne, children: [
170
- /* @__PURE__ */ y("label", { className: oe, id: k, htmlFor: r, children: [
171
- d,
172
- $ && /* @__PURE__ */ y(fe, { children: [
173
- /* @__PURE__ */ a(he, {}),
174
- /* @__PURE__ */ a("span", { className: t.requiredSrInfo, children: f("required") })
175
- ] })
176
- ] }),
177
- b && (P || !c) && /* @__PURE__ */ a("div", { className: t.hint, id: B, children: b }),
178
- h && S && /* @__PURE__ */ a(we, { className: t.feedback, message: S, type: "invalid", id: R }),
179
- !c && /* @__PURE__ */ a(
180
- "div",
181
- {
182
- onDragOver: O,
183
- onDragLeave: W,
184
- onDrop: V,
185
- "aria-labelledby": `${k}${q}`,
186
- "aria-disabled": o,
187
- children: j()
188
- }
189
- ),
190
- c && /* @__PURE__ */ y(
191
- "div",
192
- {
193
- className: ie,
194
- onClick: (e) => H(e),
195
- onDragOver: O,
196
- onDragLeave: W,
197
- onDrop: V,
198
- "aria-labelledby": `${k}${q}`,
199
- "aria-disabled": o,
200
- children: [
201
- /* @__PURE__ */ a(ve, { name: "upload", className: t.uploadIcon, size: "x-large" }),
202
- /* @__PURE__ */ a("p", { id: "file-upload-instructions", className: t.instructions, children: f("dragAndDropInstructions") }),
203
- j(),
204
- b && !P && /* @__PURE__ */ a("div", { className: t.hintDropZone, id: B, children: b })
205
- ]
206
- }
207
- ),
208
- /* @__PURE__ */ a("input", { ...Q, type: "file", className: t.input, id: r, ref: le, accept: i, multiple: _, "aria-hidden": "true", required: $, disabled: o, onChange: de }),
209
- C.length > 0 && J && /* @__PURE__ */ a(ye, { files: C, onRemoveFile: ue, fileListItemRemoveButtonProps: l, t: f })
210
- ] });
211
- });
212
- Ze.displayName = "DSInputFile";
213
- export {
214
- Ze as D,
215
- We as a,
216
- Ve as b,
217
- je as c,
218
- Me as f,
219
- Ue as v
220
- };