@stihl-design-system/components 1.0.0-RC.29 → 1.0.0-RC.30
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.
- package/{actionbutton.DHt1AL7U.js → actionbutton.u1qp8oGC.js} +1 -1
- package/{actionlink.BML1jenE.js → actionlink.C7HzeIVa.js} +1 -1
- package/assets/ActionButton.oGVPTS1J.css +1 -0
- package/assets/ActionLink.CTh6IXrN.css +1 -0
- package/assets/Header.CNqtWTxB.css +1 -0
- package/assets/MegaMenu.DX9gChtY.css +1 -0
- package/assets/banner.BLdW5VF4.css +1 -0
- package/banner.j9YpudOS.js +55 -0
- package/chunks/ActionButton.B8zFwOrJ.js +165 -0
- package/chunks/{ActionLink.BlhqDEtq.js → ActionLink.IX6oRXU3.js} +31 -31
- package/chunks/Header.DqZRryB5.js +366 -0
- package/chunks/MegaMenu.BY7eOnhj.js +189 -0
- package/chunks/Popover.NGetxKGg.js +159 -0
- package/chunks/floating-ui.react.x0F9CYgn.js +1637 -0
- package/components/Banner/Banner.d.ts +1 -1
- package/components/InputFile/InputFile.d.ts +1 -1
- package/components/MegaMenu/MegaMenu.d.ts +32 -0
- package/components/MegaMenu/MegaMenu.test.d.ts +1 -0
- package/components/MegaMenu/MegaMenu.utils.d.ts +52 -0
- package/components/MegaMenu/MegaMenu.utils.test.d.ts +1 -0
- package/components/Popover/Popover.d.ts +1 -1
- package/components/Scroller/Scroller.d.ts +1 -1
- package/github-mark-white.svg +1 -0
- package/github-mark.svg +1 -0
- package/{header.Z4Oxj_xL.js → header.QpNjE3N-.js} +1 -1
- package/index.d.ts +2 -0
- package/index.es.js +117 -112
- package/megamenu.CdHrEeoh.js +12 -0
- package/megamenu.d.ts +2 -0
- package/package.json +3 -1
- package/partials/index.js +21 -15
- package/partials/lib/partials.d.ts +1 -1
- package/{popover.BFx99cHg.js → popover.DXxm1oWI.js} +3 -2
- package/styles/scss/ds/index.scss +0 -1
- package/styles/scss/ds/lib/grid-main.scss +2 -13
- package/styles/scss/ds/lib/grid-sidebar.scss +38 -136
- package/{topbar.Bccms0xZ.js → topbar.Dhy_TL0U.js} +1 -1
- package/assets/ActionButton.Ewi0i1hW.css +0 -1
- package/assets/ActionLink.BdPEvuGm.css +0 -1
- package/assets/Header.DO34x-dO.css +0 -1
- package/assets/banner.D9EiZqqR.css +0 -1
- package/banner.B2YO054K.js +0 -55
- package/chunks/ActionButton.CzaWZGPt.js +0 -165
- package/chunks/Header.BSvyYrIV.js +0 -368
- package/chunks/Popover.hXQTvwwd.js +0 -1685
- package/styles/scss/ds/lib/grid-sidebar-sidebar.scss +0 -52
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as v, jsxs as Ae, Fragment as ge } from "react/jsx-runtime";
|
|
3
|
+
import { d as T } from "./index.CgTHIF3K.js";
|
|
4
|
+
import { c as x } from "./index.CEyLAtio.js";
|
|
5
|
+
import { useState as V, useEffect as ne, useContext as oe, createContext as De, useRef as U } from "react";
|
|
6
|
+
import { g as j, c as R, p as fe } 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.CNqtWTxB.css';const Te = (c) => {
|
|
10
|
+
const e = T.c(3), t = 0, [r, n] = V("down");
|
|
11
|
+
let a, s;
|
|
12
|
+
return e[0] !== t ? (a = () => {
|
|
13
|
+
let d;
|
|
14
|
+
d = window.scrollY;
|
|
15
|
+
const l = () => {
|
|
16
|
+
const i = window.scrollY, h = i > d ? "down" : "up";
|
|
17
|
+
Math.abs(i - d) > t && (n(h), d = i);
|
|
18
|
+
};
|
|
19
|
+
return window.addEventListener("scroll", l, {
|
|
20
|
+
passive: !0
|
|
21
|
+
}), () => window.removeEventListener("scroll", l);
|
|
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: c,
|
|
25
|
+
hasPrimaryArea: e,
|
|
26
|
+
hasSecondaryArea: t
|
|
27
|
+
}) => {
|
|
28
|
+
if (c)
|
|
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_q6oxc_1", Ce = "ds-top-bar_root--sticky_q6oxc_49", Oe = "ds-top-bar_root--fixed_q6oxc_53", Ve = "ds-top-bar_content_q6oxc_62", Re = "ds-top-bar_content--variant-full_q6oxc_81", Me = "ds-top-bar_content--has-primary-area-and-secondary-area_q6oxc_85", qe = "ds-top-bar_primary_q6oxc_90", ke = "ds-top-bar_content--has-brand-add-on-with-primary-area-and-secondary-area_q6oxc_105", $e = "ds-top-bar_brand_q6oxc_110", We = "ds-top-bar_content--has-primary-area_q6oxc_85", Ie = "ds-top-bar_content--has-primary-area--with-brand-add-on_q6oxc_149", Le = "ds-top-bar_brand-add-on_q6oxc_213", Ye = "ds-top-bar_brand-add-on--double_q6oxc_234", ze = "ds-top-bar_sub-title_q6oxc_248", Ue = "ds-top-bar_secondary_q6oxc_274", je = "ds-top-bar_logo_q6oxc_283", Ge = "ds-top-bar_logo--reduced_q6oxc_293", _ = {
|
|
35
|
+
root: Fe,
|
|
36
|
+
rootSticky: Ce,
|
|
37
|
+
rootFixed: Oe,
|
|
38
|
+
content: Ve,
|
|
39
|
+
contentVariantFull: Re,
|
|
40
|
+
contentHasPrimaryAreaAndSecondaryArea: Me,
|
|
41
|
+
primary: qe,
|
|
42
|
+
contentHasBrandAddOnWithPrimaryAreaAndSecondaryArea: ke,
|
|
43
|
+
brand: $e,
|
|
44
|
+
contentHasPrimaryArea: We,
|
|
45
|
+
contentHasPrimaryAreaWithBrandAddOn: Ie,
|
|
46
|
+
brandAddOn: Le,
|
|
47
|
+
brandAddOnDouble: Ye,
|
|
48
|
+
subTitle: ze,
|
|
49
|
+
secondary: Ue,
|
|
50
|
+
logo: je,
|
|
51
|
+
logoReduced: Ge
|
|
52
|
+
}, Je = ({
|
|
53
|
+
hasBrandArea: c,
|
|
54
|
+
hasPrimaryArea: e,
|
|
55
|
+
hasSecondaryArea: t
|
|
56
|
+
}) => {
|
|
57
|
+
if (!c)
|
|
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
|
+
}, ve = (c) => c == null || typeof c == "object" && !Array.isArray(c) && c !== null && Object.keys(c).length === 0, pt = ["double", "single"], L = (c) => {
|
|
62
|
+
const e = T.c(28);
|
|
63
|
+
let t, r, n, a;
|
|
64
|
+
e[0] !== c ? ({
|
|
65
|
+
children: t,
|
|
66
|
+
className: r,
|
|
67
|
+
rootClassName: a,
|
|
68
|
+
...n
|
|
69
|
+
} = c, e[0] = c, 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: d,
|
|
73
|
+
isMobile: l,
|
|
74
|
+
topBarAreaRef: i,
|
|
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] !== d || e[9] !== l || e[10] !== h || e[11] !== a || e[12] !== s) {
|
|
80
|
+
const E = R(t, pe), u = R(t, ue), o = R(t, _e);
|
|
81
|
+
process.env.NODE_ENV !== "production" && Je({
|
|
82
|
+
hasBrandArea: E,
|
|
83
|
+
hasPrimaryArea: u,
|
|
84
|
+
hasSecondaryArea: o
|
|
85
|
+
});
|
|
86
|
+
let b;
|
|
87
|
+
e[15] !== d || e[16] !== l || e[17] !== h || e[18] !== a ? (b = x(_.root, a, d ? {
|
|
88
|
+
[_.rootSticky]: !l && h,
|
|
89
|
+
[_.rootFixed]: !l && !h
|
|
90
|
+
} : {}), e[15] = d, e[16] = l, e[17] = h, e[18] = a, e[19] = b) : b = e[19], A = b, p = x(_.content, r, {
|
|
91
|
+
[_.contentHasPrimaryArea]: u && !m && !o,
|
|
92
|
+
[_.contentHasPrimaryAreaWithBrandAddOn]: u && m && !o,
|
|
93
|
+
[_.contentHasBrandAddOnWithPrimaryAreaAndSecondaryArea]: m && u && o,
|
|
94
|
+
[_.contentHasPrimaryAreaAndSecondaryArea]: u && o && !m,
|
|
95
|
+
[_.contentVariantFull]: s === "full"
|
|
96
|
+
}), e[5] = t, e[6] = r, e[7] = m, e[8] = d, e[9] = l, 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 g = p;
|
|
100
|
+
let f;
|
|
101
|
+
e[20] !== t || e[21] !== g || e[22] !== n ? (f = /* @__PURE__ */ v("section", { className: g, ...n, children: t }), e[20] = t, e[21] = g, e[22] = n, e[23] = f) : f = e[23];
|
|
102
|
+
let y;
|
|
103
|
+
return e[24] !== A || e[25] !== f || e[26] !== i ? (y = /* @__PURE__ */ v("div", { className: A, ref: i, children: f }), e[24] = A, e[25] = f, e[26] = i, e[27] = y) : y = e[27], y;
|
|
104
|
+
}, pe = (c) => {
|
|
105
|
+
const e = T.c(26), {
|
|
106
|
+
children: t,
|
|
107
|
+
className: r
|
|
108
|
+
} = c, {
|
|
109
|
+
logoProps: n,
|
|
110
|
+
brandAddOnProps: a,
|
|
111
|
+
setHasBrandAddOn: s
|
|
112
|
+
} = oe(G);
|
|
113
|
+
let d;
|
|
114
|
+
e[0] !== n ? (d = n || {}, e[0] = n, e[1] = d) : d = e[1];
|
|
115
|
+
const {
|
|
116
|
+
aria: l,
|
|
117
|
+
logo: i,
|
|
118
|
+
href: h,
|
|
119
|
+
target: m
|
|
120
|
+
} = d, A = i === void 0 ? "main" : i, p = h === void 0 ? "/" : h, g = m === void 0 ? "_self" : m;
|
|
121
|
+
let f;
|
|
122
|
+
e[2] !== a || e[3] !== t || e[4] !== s ? (f = () => {
|
|
123
|
+
t || !ve(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 y;
|
|
126
|
+
e[6] !== a || e[7] !== t ? (y = [t, a], e[6] = a, e[7] = t, e[8] = y) : y = e[8], ne(f, y);
|
|
127
|
+
let E;
|
|
128
|
+
e[9] !== A ? (E = x(_.logo, {
|
|
129
|
+
[_.logoReduced]: A.includes("reduced")
|
|
130
|
+
}), e[9] = A, e[10] = E) : E = e[10];
|
|
131
|
+
const u = E;
|
|
132
|
+
let o;
|
|
133
|
+
e[11] !== r ? (o = x(_.brand, r), e[11] = r, e[12] = o) : o = e[12];
|
|
134
|
+
let b;
|
|
135
|
+
e[13] !== l || e[14] !== p || e[15] !== A || e[16] !== u || e[17] !== g ? (b = /* @__PURE__ */ v(Pe, { className: u, aria: l, logo: A, href: p, target: g }), e[13] = l, e[14] = p, e[15] = A, e[16] = u, e[17] = g, e[18] = b) : b = e[18];
|
|
136
|
+
let S;
|
|
137
|
+
e[19] !== a ? (S = ve(a) ? void 0 : /* @__PURE__ */ v(be, { ...a }), e[19] = a, e[20] = S) : S = e[20];
|
|
138
|
+
let D;
|
|
139
|
+
return e[21] !== t || e[22] !== S || e[23] !== o || e[24] !== b ? (D = /* @__PURE__ */ Ae("div", { className: o, children: [
|
|
140
|
+
b,
|
|
141
|
+
S,
|
|
142
|
+
t
|
|
143
|
+
] }), e[21] = t, e[22] = S, e[23] = o, e[24] = b, e[25] = D) : D = e[25], D;
|
|
144
|
+
};
|
|
145
|
+
pe.displayName = "DSTopBar.BrandArea";
|
|
146
|
+
const be = (c) => {
|
|
147
|
+
const e = T.c(10), {
|
|
148
|
+
children: t,
|
|
149
|
+
className: r,
|
|
150
|
+
subTitle: n,
|
|
151
|
+
variant: a
|
|
152
|
+
} = c, s = a === void 0 ? "single" : a, d = s === "double";
|
|
153
|
+
let l;
|
|
154
|
+
e[0] !== r || e[1] !== d ? (l = x(_.brandAddOn, r, {
|
|
155
|
+
[_.brandAddOnDouble]: d
|
|
156
|
+
}), e[0] = r, e[1] = d, e[2] = l) : l = e[2];
|
|
157
|
+
const i = l;
|
|
158
|
+
let h;
|
|
159
|
+
e[3] !== t || e[4] !== n || e[5] !== s ? (h = s === "single" ? t : /* @__PURE__ */ Ae(ge, { children: [
|
|
160
|
+
/* @__PURE__ */ v("span", { children: t }),
|
|
161
|
+
n && /* @__PURE__ */ v("span", { className: _.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] !== i || e[8] !== h ? (m = /* @__PURE__ */ v("span", { className: i, children: h }), e[7] = i, e[8] = h, e[9] = m) : m = e[9], m;
|
|
165
|
+
};
|
|
166
|
+
be.displayName = "DSTopBar.BrandAddOn";
|
|
167
|
+
const ue = (c) => {
|
|
168
|
+
const e = T.c(5), {
|
|
169
|
+
children: t,
|
|
170
|
+
className: r
|
|
171
|
+
} = c;
|
|
172
|
+
let n;
|
|
173
|
+
e[0] !== r ? (n = x(_.primary, r), e[0] = r, e[1] = n) : n = e[1];
|
|
174
|
+
let a;
|
|
175
|
+
return e[2] !== t || e[3] !== n ? (a = /* @__PURE__ */ v("div", { className: n, children: t }), e[2] = t, e[3] = n, e[4] = a) : a = e[4], a;
|
|
176
|
+
};
|
|
177
|
+
ue.displayName = "DSTopBar.PrimaryArea";
|
|
178
|
+
const _e = (c) => {
|
|
179
|
+
const e = T.c(5), {
|
|
180
|
+
children: t,
|
|
181
|
+
className: r
|
|
182
|
+
} = c;
|
|
183
|
+
let n;
|
|
184
|
+
e[0] !== r ? (n = x(_.secondary, r), e[0] = r, e[1] = n) : n = e[1];
|
|
185
|
+
let a;
|
|
186
|
+
return e[2] !== t || e[3] !== n ? (a = /* @__PURE__ */ v("div", { className: n, children: t }), e[2] = t, e[3] = n, e[4] = a) : a = e[4], a;
|
|
187
|
+
};
|
|
188
|
+
_e.displayName = "DSTopBar.SecondaryArea";
|
|
189
|
+
L.BrandArea = pe;
|
|
190
|
+
L.PrimaryArea = ue;
|
|
191
|
+
L.SecondaryArea = _e;
|
|
192
|
+
const Ke = "ds-header_root_c5fh4_1", Qe = "ds-header_root--sticky_c5fh4_4", Xe = "ds-header_root--hidden_c5fh4_9", Ze = "ds-header_root--fixed_c5fh4_20", et = "ds-header_main-navigation-area_c5fh4_37", tt = "ds-header_main-navigation-area--fixed_c5fh4_90", at = "ds-header_main-navigation-area--fixed--visible_c5fh4_105", rt = "ds-header_main-navigation-content_c5fh4_111", nt = "ds-header_main-navigation-content--variant-full_c5fh4_115", ot = "ds-header_header-placeholder_c5fh4_120", it = "ds-header_header-placeholder--with-banner_c5fh4_123", 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 = De({
|
|
205
|
+
variant: "main"
|
|
206
|
+
}), ie = (c) => {
|
|
207
|
+
const e = T.c(57);
|
|
208
|
+
let t, r, n, a, s, d, l;
|
|
209
|
+
e[0] !== c ? ({
|
|
210
|
+
children: r,
|
|
211
|
+
brandAddOnProps: t,
|
|
212
|
+
className: n,
|
|
213
|
+
isHeaderSticky: d,
|
|
214
|
+
variant: l,
|
|
215
|
+
logoProps: a,
|
|
216
|
+
...s
|
|
217
|
+
} = c, e[0] = c, e[1] = t, e[2] = r, e[3] = n, e[4] = a, e[5] = s, e[6] = d, e[7] = l) : (t = e[1], r = e[2], n = e[3], a = e[4], s = e[5], d = e[6], l = e[7]);
|
|
218
|
+
const i = d === void 0 ? !1 : d, h = l === void 0 ? "main" : l, [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 g = p, f = R(r, L.BrandArea), y = R(r, L.PrimaryArea), E = R(r, L.SecondaryArea);
|
|
222
|
+
process.env.NODE_ENV !== "production" && Ee({
|
|
223
|
+
hasBrandArea: f,
|
|
224
|
+
hasPrimaryArea: y,
|
|
225
|
+
hasSecondaryArea: E
|
|
226
|
+
});
|
|
227
|
+
const u = Te(), [o, b] = V(!1), S = U(null), D = U(null), se = U(null), ce = U(null), [de, Be] = V(!1), [M, we] = V(!1), [w, ye] = V(!0), [le, xe] = V(!1), he = U(o);
|
|
228
|
+
let J, K;
|
|
229
|
+
e[10] !== i ? (J = () => {
|
|
230
|
+
if (i) {
|
|
231
|
+
const B = () => {
|
|
232
|
+
b((H) => (he.current = H, window.innerWidth < 1024));
|
|
233
|
+
};
|
|
234
|
+
return B(), window.addEventListener("resize", B), () => window.removeEventListener("resize", B);
|
|
235
|
+
}
|
|
236
|
+
}, K = [i], e[10] = i, e[11] = J, e[12] = K) : (J = e[11], K = e[12]), ne(J, K);
|
|
237
|
+
let Q, X;
|
|
238
|
+
e[13] === Symbol.for("react.memo_cache_sentinel") ? (Q = () => {
|
|
239
|
+
const B = () => {
|
|
240
|
+
var F, O, re;
|
|
241
|
+
const H = document.documentElement, Y = ((F = S.current) == null ? void 0 : F.offsetHeight) || 0, P = ((O = se.current) == null ? void 0 : O.offsetHeight) || 0;
|
|
242
|
+
let C;
|
|
243
|
+
if (!ce.current)
|
|
244
|
+
C = Y + P;
|
|
245
|
+
else {
|
|
246
|
+
const z = (re = D.current) == null ? void 0 : re.offsetHeight;
|
|
247
|
+
!z || z === Y ? C = parseInt(H.style.getPropertyValue("--ds-header-height").replace("rem", "")) * 16 || 0 : C = z;
|
|
248
|
+
}
|
|
249
|
+
H.style.setProperty("--ds-banner-height", `${fe(Y)}rem`), H.style.setProperty("--ds-header-height", `${fe(C)}rem`), H.style.setProperty("--ds-top-bar-height", `${fe(P)}rem`);
|
|
250
|
+
};
|
|
251
|
+
return B(), window.addEventListener("resize", B), () => window.removeEventListener("resize", B);
|
|
252
|
+
}, X = [], e[13] = Q, e[14] = X) : (Q = e[13], X = e[14]), He(Q, X);
|
|
253
|
+
let Z;
|
|
254
|
+
e[15] !== i || e[16] !== o || e[17] !== w || e[18] !== u ? (Z = () => {
|
|
255
|
+
if (i) {
|
|
256
|
+
const B = () => {
|
|
257
|
+
const P = D.current, C = !!P && window.scrollY <= P.offsetHeight;
|
|
258
|
+
Be(C);
|
|
259
|
+
const F = ce.current, O = se.current;
|
|
260
|
+
if (!o && he.current && !w) {
|
|
261
|
+
ye(C && !!P && window.scrollY <= P.offsetHeight);
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
264
|
+
const re = !!O && !!F && F.getBoundingClientRect().bottom > O.getBoundingClientRect().bottom, z = !F && !!O && !!S.current && (window.scrollY >= S.current.offsetHeight || 0) || !F && !S.current && !!O && window.scrollY >= 1;
|
|
265
|
+
ye(F ? re && !!P && window.scrollY <= P.offsetHeight : !z);
|
|
266
|
+
};
|
|
267
|
+
window.addEventListener("scroll", B, {
|
|
268
|
+
passive: !0
|
|
269
|
+
}), B();
|
|
270
|
+
const H = D.current, Y = !!H && H.getBoundingClientRect().bottom > 0;
|
|
271
|
+
return o && we(u === "up" && !Y), o || xe(u === "up" && !w), () => {
|
|
272
|
+
window.removeEventListener("scroll", B);
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
}, e[15] = i, e[16] = o, e[17] = w, e[18] = u, e[19] = Z) : Z = e[19];
|
|
276
|
+
let ee;
|
|
277
|
+
e[20] !== i || e[21] !== o || e[22] !== u ? (ee = [i, o, he, u], e[20] = i, e[21] = o, e[22] = u, e[23] = ee) : ee = e[23], ne(Z, ee);
|
|
278
|
+
let te;
|
|
279
|
+
e[24] !== n || e[25] !== M || e[26] !== i || e[27] !== de || e[28] !== o ? (te = x(N.root, n, i ? {
|
|
280
|
+
[N.rootSticky]: o,
|
|
281
|
+
[N.rootHidden]: o && !de,
|
|
282
|
+
[N.rootFixed]: o && M
|
|
283
|
+
} : {}), e[24] = n, e[25] = M, e[26] = i, e[27] = de, e[28] = o, e[29] = te) : te = e[29];
|
|
284
|
+
const me = te;
|
|
285
|
+
let q;
|
|
286
|
+
e[30] !== t || e[31] !== m || e[32] !== le || e[33] !== i || e[34] !== o || e[35] !== w || e[36] !== a || e[37] !== h ? (q = {
|
|
287
|
+
variant: h,
|
|
288
|
+
bannerAreaRef: S,
|
|
289
|
+
brandAddOnProps: t,
|
|
290
|
+
hasBrandAddOn: m,
|
|
291
|
+
setHasBrandAddOn: A,
|
|
292
|
+
isFixedMainNavigation: le,
|
|
293
|
+
isHeaderSticky: i,
|
|
294
|
+
isMobile: o,
|
|
295
|
+
isStickyMainNavigationVisible: w,
|
|
296
|
+
mainNavigationAreaRef: ce,
|
|
297
|
+
topBarAreaRef: se,
|
|
298
|
+
logoProps: a
|
|
299
|
+
}, e[30] = t, e[31] = m, e[32] = le, e[33] = i, e[34] = o, e[35] = w, e[36] = a, e[37] = h, e[38] = q) : q = e[38];
|
|
300
|
+
let k;
|
|
301
|
+
e[39] !== r || e[40] !== q ? (k = /* @__PURE__ */ v(G.Provider, { value: q, children: r }), e[39] = r, e[40] = q, e[41] = k) : k = e[41];
|
|
302
|
+
let $;
|
|
303
|
+
e[42] !== s || e[43] !== me || e[44] !== k ? ($ = /* @__PURE__ */ v("header", { className: me, ...s, ref: D, children: k }), e[42] = s, e[43] = me, e[44] = k, e[45] = $) : $ = e[45];
|
|
304
|
+
let W;
|
|
305
|
+
e[46] !== M || e[47] !== o ? (W = o && M && /* @__PURE__ */ v("div", { className: N.headerPlaceholder }), e[46] = M, e[47] = o, e[48] = W) : W = e[48];
|
|
306
|
+
let I;
|
|
307
|
+
e[49] !== g || e[50] !== o || e[51] !== w ? (I = !o && !w && /* @__PURE__ */ v("div", { className: g ? N.headerPlaceholderWithBanner : N.headerPlaceholder }), e[49] = g, e[50] = o, e[51] = w, e[52] = I) : I = e[52];
|
|
308
|
+
let ae;
|
|
309
|
+
return e[53] !== $ || e[54] !== W || e[55] !== I ? (ae = /* @__PURE__ */ Ae(ge, { children: [
|
|
310
|
+
$,
|
|
311
|
+
W,
|
|
312
|
+
I
|
|
313
|
+
] }), e[53] = $, e[54] = W, e[55] = I, e[56] = ae) : ae = e[56], ae;
|
|
314
|
+
}, Se = (c) => {
|
|
315
|
+
const e = T.c(4), {
|
|
316
|
+
children: t,
|
|
317
|
+
className: r
|
|
318
|
+
} = c, {
|
|
319
|
+
bannerAreaRef: n
|
|
320
|
+
} = oe(G);
|
|
321
|
+
let a;
|
|
322
|
+
return e[0] !== n || e[1] !== t || e[2] !== r ? (a = /* @__PURE__ */ v("div", { ref: n, className: r, children: t }), e[0] = n, e[1] = t, e[2] = r, e[3] = a) : a = e[3], a;
|
|
323
|
+
};
|
|
324
|
+
Se.displayName = "DSHeader.BannerArea";
|
|
325
|
+
const Ne = (c) => {
|
|
326
|
+
const e = T.c(15), {
|
|
327
|
+
children: t,
|
|
328
|
+
className: r
|
|
329
|
+
} = c, {
|
|
330
|
+
variant: n,
|
|
331
|
+
isFixedMainNavigation: a,
|
|
332
|
+
isHeaderSticky: s,
|
|
333
|
+
isMobile: d,
|
|
334
|
+
isStickyMainNavigationVisible: l,
|
|
335
|
+
mainNavigationAreaRef: i
|
|
336
|
+
} = oe(G);
|
|
337
|
+
let h;
|
|
338
|
+
e[0] !== r || e[1] !== a || e[2] !== s || e[3] !== d || e[4] !== l ? (h = x(N.mainNavigationArea, r, s ? {
|
|
339
|
+
[N.mainNavigationAreaFixed]: !d && !l,
|
|
340
|
+
[N.mainNavigationAreaFixedVisible]: !d && a
|
|
341
|
+
} : {}), e[0] = r, e[1] = a, e[2] = s, e[3] = d, e[4] = l, e[5] = h) : h = e[5];
|
|
342
|
+
const m = h, A = n === "full";
|
|
343
|
+
let p;
|
|
344
|
+
e[6] !== A ? (p = x(N.mainNavigationContent, {
|
|
345
|
+
[N.mainNavigationContentVariantFull]: A
|
|
346
|
+
}), e[6] = A, e[7] = p) : p = e[7];
|
|
347
|
+
const g = p;
|
|
348
|
+
let f;
|
|
349
|
+
e[8] !== t || e[9] !== g ? (f = /* @__PURE__ */ v("div", { className: g, children: t }), e[8] = t, e[9] = g, e[10] = f) : f = e[10];
|
|
350
|
+
let y;
|
|
351
|
+
return e[11] !== i || e[12] !== m || e[13] !== f ? (y = /* @__PURE__ */ v("div", { className: m, ref: i, children: f }), e[11] = i, e[12] = m, e[13] = f, e[14] = y) : y = e[14], y;
|
|
352
|
+
};
|
|
353
|
+
Ne.displayName = "DSHeader.MainNavigationArea";
|
|
354
|
+
ie.BannerArea = Se;
|
|
355
|
+
ie.MainNavigationArea = Ne;
|
|
356
|
+
ie.displayName = "DSHeader";
|
|
357
|
+
export {
|
|
358
|
+
pt as B,
|
|
359
|
+
G as D,
|
|
360
|
+
At as H,
|
|
361
|
+
ie as a,
|
|
362
|
+
L as b,
|
|
363
|
+
Je as c,
|
|
364
|
+
ve as i,
|
|
365
|
+
Ee as v
|
|
366
|
+
};
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as b, jsxs as Q } from "react/jsx-runtime";
|
|
3
|
+
import { d as I } from "./index.CgTHIF3K.js";
|
|
4
|
+
import { isValidElement as G, useState as W, createContext as X, forwardRef as H, cloneElement as Y, useContext as q } from "react";
|
|
5
|
+
import { u as Z, a as A, b as B, c as R, d as ee, o as te, e as z, f as ne, F as se, g as oe, h as le } from "./floating-ui.react.x0F9CYgn.js";
|
|
6
|
+
import { c as j } from "./index.CEyLAtio.js";
|
|
7
|
+
import { g as P, c as T } from "./helpers.BbWkXTr3.js";
|
|
8
|
+
import { D as ce } from "./Header.DqZRryB5.js";
|
|
9
|
+
import { a as ae } from "./floating-ui.dom.C9TD1WpB.js";
|
|
10
|
+
import '../assets/MegaMenu.DX9gChtY.css';const re = "ds-mega-menu_root_11fw1_1", ie = "ds-mega-menu_content_11fw1_109", ue = "ds-mega-menu_content--variant-full_11fw1_134", de = "ds-mega-menu_backdrop_11fw1_139", V = {
|
|
11
|
+
root: re,
|
|
12
|
+
content: ie,
|
|
13
|
+
contentVariantFull: ue,
|
|
14
|
+
backdrop: de
|
|
15
|
+
}, fe = 9, me = (s) => {
|
|
16
|
+
const t = I.c(17);
|
|
17
|
+
let e;
|
|
18
|
+
t[0] !== s ? (e = s === void 0 ? {} : s, t[0] = s, t[1] = e) : e = t[1];
|
|
19
|
+
const {
|
|
20
|
+
initialOpen: n,
|
|
21
|
+
isOpen: o,
|
|
22
|
+
onOpenChange: c
|
|
23
|
+
} = e, m = n === void 0 ? !1 : n, [a, l] = W(m), d = o ?? a, r = c ?? l;
|
|
24
|
+
let i;
|
|
25
|
+
t[2] === Symbol.for("react.memo_cache_sentinel") ? (i = [te(fe)], t[2] = i) : i = t[2];
|
|
26
|
+
let u;
|
|
27
|
+
t[3] !== d || t[4] !== r ? (u = {
|
|
28
|
+
placement: "bottom-start",
|
|
29
|
+
open: d,
|
|
30
|
+
onOpenChange: r,
|
|
31
|
+
whileElementsMounted: ae,
|
|
32
|
+
strategy: "absolute",
|
|
33
|
+
transform: !1,
|
|
34
|
+
middleware: i
|
|
35
|
+
}, t[3] = d, t[4] = r, t[5] = u) : u = t[5];
|
|
36
|
+
const g = Z(u), _ = g.context;
|
|
37
|
+
let h;
|
|
38
|
+
t[6] === Symbol.for("react.memo_cache_sentinel") ? (h = {
|
|
39
|
+
enabled: !0
|
|
40
|
+
}, t[6] = h) : h = t[6];
|
|
41
|
+
const k = A(_, h), f = B(_);
|
|
42
|
+
let p;
|
|
43
|
+
t[7] === Symbol.for("react.memo_cache_sentinel") ? (p = {
|
|
44
|
+
role: "menu"
|
|
45
|
+
}, t[7] = p) : p = t[7];
|
|
46
|
+
const C = R(_, p);
|
|
47
|
+
let S;
|
|
48
|
+
t[8] !== k || t[9] !== f || t[10] !== C ? (S = [k, f, C], t[8] = k, t[9] = f, t[10] = C, t[11] = S) : S = t[11];
|
|
49
|
+
const D = ee(S);
|
|
50
|
+
let E, M;
|
|
51
|
+
return t[12] !== g || t[13] !== D || t[14] !== d || t[15] !== r ? (M = {
|
|
52
|
+
open: d,
|
|
53
|
+
setOpen: r,
|
|
54
|
+
...D,
|
|
55
|
+
...g
|
|
56
|
+
}, t[12] = g, t[13] = D, t[14] = d, t[15] = r, t[16] = M) : M = t[16], E = M, E;
|
|
57
|
+
}, Me = (s) => {
|
|
58
|
+
if (!G(s))
|
|
59
|
+
throw new Error(P("DSMegaMenu", "DSMegaMenu.Anchor child must be a valid React element."));
|
|
60
|
+
}, ge = ({
|
|
61
|
+
hasContent: s,
|
|
62
|
+
hasAnchor: t
|
|
63
|
+
}) => {
|
|
64
|
+
if (!s)
|
|
65
|
+
throw new Error(P("DSMegaMenu", "A DSMegaMenu must have a <DSMegaMenu.Content> component as a child. Please add it to the children of DSMegaMenu."));
|
|
66
|
+
if (!t)
|
|
67
|
+
throw new Error(P("DSMegaMenu", "A DSMegaMenu must have a <DSMegaMenu.Anchor> component as a child. Please add it to the children of DSMegaMenu."));
|
|
68
|
+
}, J = X(null), K = () => {
|
|
69
|
+
const s = q(J);
|
|
70
|
+
if (s == null)
|
|
71
|
+
throw new Error(P("DSMegaMenu", "Components like DSMegaMenu.Anchor or DSMegaMenu.Content must be wrapped in <DSMegaMenu />."));
|
|
72
|
+
return s;
|
|
73
|
+
}, $ = (s) => {
|
|
74
|
+
const t = I.c(9);
|
|
75
|
+
let e, n;
|
|
76
|
+
t[0] !== s ? ({
|
|
77
|
+
children: e,
|
|
78
|
+
...n
|
|
79
|
+
} = s, t[0] = s, t[1] = e, t[2] = n) : (e = t[1], n = t[2]);
|
|
80
|
+
let o;
|
|
81
|
+
t[3] !== n ? (o = {
|
|
82
|
+
...n
|
|
83
|
+
}, t[3] = n, t[4] = o) : o = t[4];
|
|
84
|
+
const c = me(o), m = T(e, $.Content), a = T(e, U);
|
|
85
|
+
process.env.NODE_ENV !== "production" && ge({
|
|
86
|
+
hasContent: m,
|
|
87
|
+
hasAnchor: a
|
|
88
|
+
});
|
|
89
|
+
let l;
|
|
90
|
+
return t[5] !== e || t[6] !== c || t[7] !== n ? (l = /* @__PURE__ */ b(J.Provider, { value: c, ...n, children: e }), t[5] = e, t[6] = c, t[7] = n, t[8] = l) : l = t[8], l;
|
|
91
|
+
}, U = H((s, t) => {
|
|
92
|
+
const e = I.c(12);
|
|
93
|
+
let n, o;
|
|
94
|
+
e[0] !== s ? ({
|
|
95
|
+
children: n,
|
|
96
|
+
...o
|
|
97
|
+
} = s, e[0] = s, e[1] = n, e[2] = o) : (n = e[1], o = e[2]), process.env.NODE_ENV !== "production" && Me(n);
|
|
98
|
+
const c = K(), m = n.ref;
|
|
99
|
+
let a;
|
|
100
|
+
e[3] !== m || e[4] !== c.refs.setReference || e[5] !== t ? (a = [c.refs.setReference, t, m], e[3] = m, e[4] = c.refs.setReference, e[5] = t, e[6] = a) : a = e[6];
|
|
101
|
+
const l = z(a);
|
|
102
|
+
if (G(n)) {
|
|
103
|
+
let d;
|
|
104
|
+
return e[7] !== n || e[8] !== c || e[9] !== o || e[10] !== l ? (d = Y(n, c.getReferenceProps({
|
|
105
|
+
ref: l,
|
|
106
|
+
...o,
|
|
107
|
+
...n.props,
|
|
108
|
+
"data-state": c.open ? "open" : "closed"
|
|
109
|
+
})), e[7] = n, e[8] = c, e[9] = o, e[10] = l, e[11] = d) : d = e[11], d;
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
U.displayName = "DSMegaMenu.Anchor";
|
|
113
|
+
const L = H((s, t) => {
|
|
114
|
+
const e = I.c(45);
|
|
115
|
+
let n, o, c;
|
|
116
|
+
e[0] !== s ? ({
|
|
117
|
+
style: c,
|
|
118
|
+
className: n,
|
|
119
|
+
...o
|
|
120
|
+
} = s, e[0] = s, e[1] = n, e[2] = o, e[3] = c) : (n = e[1], o = e[2], c = e[3]);
|
|
121
|
+
const m = K();
|
|
122
|
+
let a, l;
|
|
123
|
+
e[4] !== m ? ({
|
|
124
|
+
context: a,
|
|
125
|
+
...l
|
|
126
|
+
} = m, e[4] = m, e[5] = a, e[6] = l) : (a = e[5], l = e[6]);
|
|
127
|
+
const {
|
|
128
|
+
variant: d,
|
|
129
|
+
bannerAreaRef: r,
|
|
130
|
+
topBarAreaRef: i,
|
|
131
|
+
mainNavigationAreaRef: u
|
|
132
|
+
} = q(ce);
|
|
133
|
+
let g;
|
|
134
|
+
e[7] !== t || e[8] !== l.refs.setFloating ? (g = [l.refs.setFloating, t], e[7] = t, e[8] = l.refs.setFloating, e[9] = g) : g = e[9];
|
|
135
|
+
const _ = z(g);
|
|
136
|
+
let h;
|
|
137
|
+
e[10] === Symbol.for("react.memo_cache_sentinel") ? (h = {
|
|
138
|
+
duration: {
|
|
139
|
+
open: 400,
|
|
140
|
+
close: 400
|
|
141
|
+
}
|
|
142
|
+
}, e[10] = h) : h = e[10];
|
|
143
|
+
const {
|
|
144
|
+
isMounted: k,
|
|
145
|
+
status: f
|
|
146
|
+
} = ne(a, h);
|
|
147
|
+
let p;
|
|
148
|
+
e[11] !== n ? (p = j(V.root, n), e[11] = n, e[12] = p) : p = e[12];
|
|
149
|
+
const C = p, S = d === "full";
|
|
150
|
+
let D;
|
|
151
|
+
e[13] !== S ? (D = j(V.content, {
|
|
152
|
+
[V.contentVariantFull]: S
|
|
153
|
+
}), e[13] = S, e[14] = D) : D = e[14];
|
|
154
|
+
const E = D;
|
|
155
|
+
if (!k)
|
|
156
|
+
return null;
|
|
157
|
+
let M;
|
|
158
|
+
e[15] !== f ? (M = /* @__PURE__ */ b("div", { className: V.backdrop, "data-status": f }), e[15] = f, e[16] = M) : M = e[16];
|
|
159
|
+
let w;
|
|
160
|
+
e[17] !== (r == null ? void 0 : r.current) || e[18] !== (u == null ? void 0 : u.current) || e[19] !== (i == null ? void 0 : i.current) ? (w = () => [u == null ? void 0 : u.current, i == null ? void 0 : i.current, r == null ? void 0 : r.current].filter(Boolean), e[17] = r == null ? void 0 : r.current, e[18] = u == null ? void 0 : u.current, e[19] = i == null ? void 0 : i.current, e[20] = w) : w = e[20];
|
|
161
|
+
let x;
|
|
162
|
+
e[21] !== l.floatingStyles || e[22] !== c ? (x = {
|
|
163
|
+
...l.floatingStyles,
|
|
164
|
+
...c
|
|
165
|
+
}, e[21] = l.floatingStyles, e[22] = c, e[23] = x) : x = e[23];
|
|
166
|
+
let y;
|
|
167
|
+
e[24] !== o || e[25] !== l ? (y = l.getFloatingProps(o), e[24] = o, e[25] = l, e[26] = y) : y = e[26];
|
|
168
|
+
let F;
|
|
169
|
+
e[27] !== E || e[28] !== o.children || e[29] !== f ? (F = /* @__PURE__ */ b("div", { className: E, "data-status": f, children: o.children }), e[27] = E, e[28] = o.children, e[29] = f, e[30] = F) : F = e[30];
|
|
170
|
+
let O;
|
|
171
|
+
e[31] !== C || e[32] !== _ || e[33] !== f || e[34] !== y || e[35] !== F || e[36] !== x ? (O = /* @__PURE__ */ b("div", { ref: _, style: x, className: C, "data-status": f, ...y, children: F }), e[31] = C, e[32] = _, e[33] = f, e[34] = y, e[35] = F, e[36] = x, e[37] = O) : O = e[37];
|
|
172
|
+
let v;
|
|
173
|
+
e[38] !== a || e[39] !== O || e[40] !== w ? (v = /* @__PURE__ */ b(se, { context: a, modal: !1, outsideElementsInert: !0, getInsideElements: w, children: O }), e[38] = a, e[39] = O, e[40] = w, e[41] = v) : v = e[41];
|
|
174
|
+
let N;
|
|
175
|
+
return e[42] !== v || e[43] !== M ? (N = /* @__PURE__ */ b(oe, { children: /* @__PURE__ */ Q(le, { lockScroll: !0, children: [
|
|
176
|
+
M,
|
|
177
|
+
v
|
|
178
|
+
] }) }), e[42] = v, e[43] = M, e[44] = N) : N = e[44], N;
|
|
179
|
+
});
|
|
180
|
+
L.displayName = "DSMegaMenu.Content";
|
|
181
|
+
$.Anchor = U;
|
|
182
|
+
$.Content = L;
|
|
183
|
+
$.displayName = "DSMegaMenu";
|
|
184
|
+
export {
|
|
185
|
+
$ as D,
|
|
186
|
+
ge as a,
|
|
187
|
+
me as u,
|
|
188
|
+
Me as v
|
|
189
|
+
};
|