@caseparts-org/caseblocks 0.0.106 → 0.0.108
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/dist/assets/MainNav.css +1 -1
- package/dist/assets/buttonClassName.css +1 -1
- package/dist/atoms/Button/buttonClassName.js +29 -29
- package/dist/atoms/Tooltip/Tooltip.js +79 -73
- package/dist/organisms/MainNav/MainNav.d.ts +1 -1
- package/dist/organisms/MainNav/MainNav.js +64 -64
- package/dist/organisms/MainNav/MainNav.stories.js +13 -7
- package/package.json +1 -1
package/dist/assets/MainNav.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._main_19pdr_1{box-shadow:#bbb3 0 8px 24px;padding:var(--spacing-0-5) 0;z-index:1;position:relative}._column_19pdr_8{box-sizing:border-box;padding:0 var(--spacing-1)}._topNav_19pdr_13{padding-bottom:var(--spacing-0-5);gap:var(--spacing-1-5)}@media (max-width: 1281px){._topNav_19pdr_13{gap:var(--spacing-1);padding-bottom:0}}._logo_19pdr_21{cursor:pointer}._operations_19pdr_24{gap:var(--spacing-1-5);width:100%}@media (max-width: 1281px){._operations_19pdr_24{gap:var(--spacing-1)}}._search_19pdr_31{flex:1}._siteLink_19pdr_34{color:var(--color-brand-primary-primary-black);cursor:default;border:none;background-color:transparent;padding:0;margin:0;font-family:var(--font-family-display);font-size:var(--font-size-md)}._siteLink_19pdr_34:hover{text-decoration:underline}._accountArea_19pdr_48{width:145px}@media (max-width: 1281px){._accountArea_19pdr_48{width:min-content}}._cart_19pdr_54{border:none;padding:0;margin:0;background-color:transparent}._category_19pdr_60{list-style:none}._category_19pdr_60 a{color:var(--text-text-primary);font-weight:var(--font-weight-semibold);text-decoration:none;display:flex;flex-direction:row;align-items:center}@media (max-width: 1281px){._category_19pdr_60 a{justify-content:space-between;width:100%}}._category_19pdr_60 a:hover{color:var(--color-brand-primary-primary-teal-blue);text-decoration:none}._category_19pdr_60 a path{fill:var(--color-brand-primary-primary-teal-blue)}._menuList_19pdr_82{list-style:none;padding:0;margin:0;height:min-content;border:1px solid var(--border-border-secondary-btn, #dfdfdf)}._menuList_19pdr_82>li{width:100%;padding:var(--spacing-0-5) var(--spacing-1);border-bottom:1px solid var(--border-border-secondary-btn, #dfdfdf);box-sizing:border-box}._menuList_19pdr_82>li:last-of-type{border-bottom:none}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._button_15vt6_1{--inset-shadow-color: var(--surface-surface-primary-btn);--inset-shadow-style: 0 0 0, inset 0 0 0 var(--spacing-0-125) var(--inset-shadow-color);transition-property:background-color,border-width,box-shadow,color;transition-duration:.1s;transition-timing-function:ease-in;padding:var(--spacing-1);border:none;cursor:pointer;text-decoration:none;text-align:center;display:flex;flex-direction:row;align-items:center;justify-content:center;gap:var(--spacing-spacing-3xs)}._button_15vt6_1:hover{box-shadow:var(--color-neutrals-neutral-2) var(--spacing-0-125) var(--spacing-0-25) var(--spacing-0-5)}._button_15vt6_1:active{box-shadow:none}._button_15vt6_1:disabled{background-color:var(--surface-surface-disabled-btn);color:var(--text-text-invert);transition:none;cursor:default}._button_15vt6_1:disabled:hover{box-shadow:none}._button-primary_15vt6_44{background-color:var(--surface-surface-primary-btn);color:var(--surface-surface-primary)}._button-primary_15vt6_44:active{background-color:var(--color-brand-secondary-dark-teal-blue)}._button-primary_15vt6_44:active:disabled{background-color:var(--surface-surface-disabled-btn);color:var(--text-text-invert)}._button-secondary_15vt6_58{background-color:var(--surface-surface-secondary-btn);border:1px solid var(--border-border-secondary-btn);color:var(--text-text-links)}._button-secondary_15vt6_58:active{--inset-shadow-color: var(--surface-surface-secondary);box-shadow:var(--inset-shadow-style)}._button-secondary_15vt6_58:disabled{background-color:var(--surface-surface-disabled-btn-focus);color:var(--surface-surface-disabled-btn);box-shadow:none}._button-secondary_15vt6_58:disabled:hover{box-shadow:var(--inset-shadow-style)}._button-secondary-transparent_15vt6_79{background-color:transparent;border:1px solid var(--color-neutrals-neutral-1);color:var(--color-neutrals-neutral-1)}._button-secondary-transparent_15vt6_79:disabled{background-color:var(--surface-surface-disabled-btn-focus);color:var(--surface-surface-disabled-btn);border:1px solid var(--border-border-primary)}._button-secondary-transparent_15vt6_79:disabled:hover{color:var(--surface-surface-disabled-btn);background-color:var(--surface-surface-disabled-btn-focus);box-shadow:none}._button-secondary-transparent_15vt6_79:hover{background-color:var(--color-neutrals-neutral-1);border:1px solid var(--border-border-primary);color:#000;box-shadow:none}._button-cta-primary_15vt6_104{background-color:var(--surface-surface-call-to-action-btn);color:var(--surface-surface-primary)}._button-cta-primary_15vt6_104:active{background-color:var(--surface-surface-call-to-action-btn-focus)}._button-cta-primary_15vt6_104:active:disabled{background-color:var(--surface-surface-disabled-btn);color:var(--text-text-invert)}._button-tertiary_15vt6_118{background-color:var(--surface-surface-tertiary-btn);color:var(--surface-surface-tertiary-btn-focus)}._button-tertiary_15vt6_118:active{color:var(--surface-surface-disabled-btn);background-color:var(--surface-surface-tertiary-btn-focus);--inset-shadow-color: var(--surface-surface-disabled-btn);box-shadow:var(--inset-shadow-style)}._button-tertiary_15vt6_118:active:disabled{background-color:var(--surface-surface-disabled-btn);color:var(--text-text-invert)}._button-destructive_15vt6_136{background-color:var(--surface-surface-error-warning-btn);color:var(--surface-surface-primary)}._button-destructive_15vt6_136:active{color:var(--surface-surface-error-warning-btn);background-color:var(--surface-surface-tertiary-btn-focus);--inset-shadow-color: var(--border-border-error-warning);box-shadow:var(--inset-shadow-style)}._button-destructive_15vt6_136:active:disabled{background-color:var(--surface-surface-disabled-btn);color:var(--text-text-invert)}._button-size-xxs_15vt6_154{border-radius:var(--border-radius-xs);padding:var(--spacing-spacing-4xs) var(--spacing-spacing-4xs)}._button-size-xs_15vt6_158{border-radius:var(--border-radius-xs);padding:calc(var(--spacing-spacing-4xs) - 1px) var(--spacing-spacing-2xs)}._button-size-sm_15vt6_162{border-radius:var(--border-radius-sm);padding:calc(var(--spacing-spacing-3xs) - 1px) var(--spacing-0-75)}._button-size-md_15vt6_166,._button-size-lg_15vt6_170{border-radius:var(--border-radius-sm);padding:calc(var(--spacing-spacing-2xs) - 1px) var(--spacing-spacing-default)}._button-size-xl_15vt6_174{border-radius:var(--border-radius-sm);padding:var(--spacing-0-75) var(--spacing-spacing-default)}._button-primary_15vt6_44._button-disabled_15vt6_179{background-color:var(--surface-surface-disabled-btn);color:var(--text-text-invert)}._button-secondary_15vt6_58._button-disabled_15vt6_179{background-color:var(--surface-surface-disabled-btn-focus);color:var(--surface-surface-disabled-btn);--inset-shadow-color: var(--surface-surface-disabled-btn);box-shadow:var(--inset-shadow-style)}._button-secondary_15vt6_58._button-disabled_15vt6_179:hover{box-shadow:var(--inset-shadow-style)}._button-secondary-transparent_15vt6_79._button-disabled_15vt6_179{background-color:var(--surface-surface-disabled-btn-focus);color:var(--surface-surface-disabled-btn);--inset-shadow-color: var(--surface-surface-disabled-btn);box-shadow:var(--inset-shadow-style);border:1px solid var(--border-border-primary)}._button-secondary-transparent_15vt6_79._button-disabled_15vt6_179:hover{box-shadow:var(--inset-shadow-style);color:var(--surface-surface-disabled-btn);background-color:var(--surface-surface-disabled-btn-focus)}._button-cta-primary_15vt6_104._button-disabled_15vt6_179,._button-tertiary_15vt6_118._button-disabled_15vt6_179,._button-destructive_15vt6_136._button-disabled_15vt6_179{background-color:var(--surface-surface-disabled-btn);color:var(--text-text-invert)}
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import { t as
|
|
1
|
+
import { t as o } from "../../Text.module-Dzhzk2fH.js";
|
|
2
2
|
import { c as u } from "../../clsx-OuTLNxxd.js";
|
|
3
3
|
import { getHideAtStyles as r } from "../HideAt.js";
|
|
4
|
-
import '../../assets/buttonClassName.css';const
|
|
5
|
-
button:
|
|
6
|
-
"button-primary": "_button-
|
|
7
|
-
"button-secondary": "_button-
|
|
8
|
-
"button-secondary-transparent": "_button-secondary-
|
|
9
|
-
"button-cta-primary": "_button-cta-
|
|
10
|
-
"button-tertiary": "_button-
|
|
11
|
-
"button-destructive": "_button-
|
|
12
|
-
"button-size-xxs": "_button-size-
|
|
13
|
-
"button-size-xs": "_button-size-
|
|
14
|
-
"button-size-sm": "_button-size-
|
|
15
|
-
"button-size-md": "_button-size-
|
|
16
|
-
"button-size-lg": "_button-size-
|
|
17
|
-
"button-size-xl": "_button-size-
|
|
18
|
-
"button-disabled": "_button-
|
|
4
|
+
import '../../assets/buttonClassName.css';const i = "_button_15vt6_1", t = {
|
|
5
|
+
button: i,
|
|
6
|
+
"button-primary": "_button-primary_15vt6_44",
|
|
7
|
+
"button-secondary": "_button-secondary_15vt6_58",
|
|
8
|
+
"button-secondary-transparent": "_button-secondary-transparent_15vt6_79",
|
|
9
|
+
"button-cta-primary": "_button-cta-primary_15vt6_104",
|
|
10
|
+
"button-tertiary": "_button-tertiary_15vt6_118",
|
|
11
|
+
"button-destructive": "_button-destructive_15vt6_136",
|
|
12
|
+
"button-size-xxs": "_button-size-xxs_15vt6_154",
|
|
13
|
+
"button-size-xs": "_button-size-xs_15vt6_158",
|
|
14
|
+
"button-size-sm": "_button-size-sm_15vt6_162",
|
|
15
|
+
"button-size-md": "_button-size-md_15vt6_166",
|
|
16
|
+
"button-size-lg": "_button-size-lg_15vt6_170",
|
|
17
|
+
"button-size-xl": "_button-size-xl_15vt6_174",
|
|
18
|
+
"button-disabled": "_button-disabled_15vt6_179"
|
|
19
19
|
};
|
|
20
|
-
function
|
|
21
|
-
size:
|
|
22
|
-
variant:
|
|
23
|
-
hideAt:
|
|
24
|
-
className:
|
|
20
|
+
function v({
|
|
21
|
+
size: n,
|
|
22
|
+
variant: s,
|
|
23
|
+
hideAt: _,
|
|
24
|
+
className: e,
|
|
25
25
|
disabled: b
|
|
26
26
|
}) {
|
|
27
27
|
return u(
|
|
28
28
|
t.button,
|
|
29
|
-
t[`button-${
|
|
30
|
-
t[`button-size-${
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
r(
|
|
29
|
+
t[`button-${s}`],
|
|
30
|
+
t[`button-size-${n}`],
|
|
31
|
+
o.text,
|
|
32
|
+
o[`text-${n}`],
|
|
33
|
+
o["text-semibold"],
|
|
34
|
+
r(_),
|
|
35
35
|
b && t["button-disabled"],
|
|
36
|
-
|
|
36
|
+
e
|
|
37
37
|
);
|
|
38
38
|
}
|
|
39
39
|
export {
|
|
40
|
-
|
|
40
|
+
v as buttonClassNames
|
|
41
41
|
};
|
|
@@ -1,121 +1,127 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
1
|
+
import { jsxs as W, Fragment as X, jsx as O } from "react/jsx-runtime";
|
|
2
|
+
import * as r from "react";
|
|
3
3
|
import { c as S } from "../../clsx-OuTLNxxd.js";
|
|
4
|
-
import { r as
|
|
5
|
-
import '../../assets/Tooltip.css';const
|
|
6
|
-
tooltip:
|
|
7
|
-
content:
|
|
4
|
+
import { r as Y } from "../../index-B4KbmMH3.js";
|
|
5
|
+
import '../../assets/Tooltip.css';const A = "_tooltip_17o7a_1", D = "_content_17o7a_11", j = {
|
|
6
|
+
tooltip: A,
|
|
7
|
+
content: D
|
|
8
8
|
};
|
|
9
|
-
function
|
|
10
|
-
return
|
|
9
|
+
function $(a) {
|
|
10
|
+
return a ? a.includes(" ") ? a : `${a} center` : "top center";
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
const v =
|
|
12
|
+
function q(a) {
|
|
13
|
+
const v = $(a).toLowerCase(), [s, n] = v.split(" ");
|
|
14
14
|
return { side: ["top", "right", "bottom", "left"].includes(s) ? s : "top", align: n === "left" || n === "top" ? "start" : n === "right" || n === "bottom" ? "end" : "center" };
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
const o =
|
|
16
|
+
function G(a, v, s, n, h = 0) {
|
|
17
|
+
const o = a.getBoundingClientRect(), d = v.getBoundingClientRect(), m = window.pageXOffset || document.documentElement.scrollLeft || 0, p = window.pageYOffset || document.documentElement.scrollTop || 0;
|
|
18
18
|
let l = 0, c = 0;
|
|
19
|
-
s === "top" ? l =
|
|
19
|
+
s === "top" ? l = p + o.top - d.height - h : s === "bottom" ? l = p + o.bottom + h : s === "left" ? c = m + o.left - d.width - h : s === "right" && (c = m + o.right + h), s === "top" || s === "bottom" ? n === "start" ? c = m + o.left : n === "end" ? c = m + o.right - d.width : c = m + o.left + o.width / 2 - d.width / 2 : n === "start" ? l = p + o.top : n === "end" ? l = p + o.bottom - d.height : l = p + o.top + o.height / 2 - d.height / 2;
|
|
20
20
|
const R = window.innerWidth, t = window.innerHeight;
|
|
21
|
-
return l = Math.max(
|
|
21
|
+
return l = Math.max(p + 4, Math.min(p + t - d.height - 4, l)), c = Math.max(m + 4, Math.min(m + R - d.width - 4, c)), { top: l, left: c };
|
|
22
22
|
}
|
|
23
|
-
const
|
|
24
|
-
tooltipClassName:
|
|
23
|
+
const U = ({
|
|
24
|
+
tooltipClassName: a,
|
|
25
25
|
contentClassName: v,
|
|
26
26
|
children: s,
|
|
27
27
|
trigger: n,
|
|
28
28
|
position: h,
|
|
29
29
|
disabled: o,
|
|
30
|
-
openDelay:
|
|
30
|
+
openDelay: d = 150,
|
|
31
31
|
closeDelay: m = 100,
|
|
32
|
-
leaveGraceMs:
|
|
32
|
+
leaveGraceMs: p = 0,
|
|
33
33
|
tooltipOffset: l = 4
|
|
34
34
|
}) => {
|
|
35
|
-
const { side: c, align: R } =
|
|
35
|
+
const { side: c, align: R } = q(h), [t, P] = r.useState(!1), [w, z] = r.useState(null), b = r.useRef(null), C = r.useRef(null), g = r.useRef(null), L = r.useRef(null), y = r.useRef(null), E = r.useRef(!1), B = r.useId(), u = (e) => {
|
|
36
36
|
e.current && (window.clearTimeout(e.current), e.current = null);
|
|
37
|
-
},
|
|
38
|
-
|
|
37
|
+
}, k = () => {
|
|
38
|
+
u(g), u(L), u(y);
|
|
39
39
|
};
|
|
40
|
-
|
|
41
|
-
const
|
|
42
|
-
o || t || (
|
|
40
|
+
r.useEffect(() => () => k(), []);
|
|
41
|
+
const F = () => {
|
|
42
|
+
o || t || (u(g), g.current = window.setTimeout(() => P(!0), d));
|
|
43
|
+
}, H = () => {
|
|
44
|
+
const e = b.current;
|
|
45
|
+
if (e && e.matches(":hover") || E.current) {
|
|
46
|
+
T();
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
P(!1);
|
|
50
|
+
}, T = () => {
|
|
51
|
+
t && (u(L), L.current = window.setTimeout(H, m));
|
|
43
52
|
}, _ = () => {
|
|
44
|
-
t && (p(L), L.current = window.setTimeout(() => {
|
|
45
|
-
const e = b.current;
|
|
46
|
-
e && e.matches(":hover") || E.current || P(!1);
|
|
47
|
-
}, m));
|
|
48
|
-
}, z = () => {
|
|
49
53
|
if (t) {
|
|
50
|
-
if (
|
|
51
|
-
|
|
54
|
+
if (u(y), p <= 0) {
|
|
55
|
+
T();
|
|
52
56
|
return;
|
|
53
57
|
}
|
|
54
58
|
y.current = window.setTimeout(() => {
|
|
55
|
-
E.current ||
|
|
56
|
-
},
|
|
59
|
+
E.current || T();
|
|
60
|
+
}, p);
|
|
57
61
|
}
|
|
58
|
-
},
|
|
59
|
-
e == null || e(
|
|
60
|
-
},
|
|
62
|
+
}, x = (e, i) => (f) => {
|
|
63
|
+
e == null || e(f), i == null || i(f);
|
|
64
|
+
}, N = r.cloneElement(n, {
|
|
61
65
|
ref: (e) => {
|
|
62
|
-
const { ref:
|
|
63
|
-
typeof
|
|
66
|
+
const { ref: i } = n;
|
|
67
|
+
typeof i == "function" ? i(e) : i && (i.current = e), b.current = e;
|
|
64
68
|
},
|
|
65
|
-
onPointerEnter:
|
|
66
|
-
|
|
69
|
+
onPointerEnter: x(n.props.onPointerEnter, () => {
|
|
70
|
+
u(L), u(y), t || F();
|
|
71
|
+
}),
|
|
72
|
+
onPointerLeave: x(n.props.onPointerLeave, () => {
|
|
73
|
+
u(g), _();
|
|
67
74
|
}),
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
"aria-describedby": t ? "tooltip-popup" : void 0,
|
|
75
|
+
onFocus: x(n.props.onFocus, F),
|
|
76
|
+
onBlur: x(n.props.onBlur, T),
|
|
77
|
+
"aria-describedby": t ? B : void 0,
|
|
72
78
|
style: { ...n.props.style || {}, outline: "none" }
|
|
73
79
|
});
|
|
74
|
-
return
|
|
75
|
-
o && t && (
|
|
76
|
-
}, [o]),
|
|
80
|
+
return r.useEffect(() => {
|
|
81
|
+
o && t && (k(), P(!1));
|
|
82
|
+
}, [o]), r.useEffect(() => {
|
|
77
83
|
if (!t) return;
|
|
78
|
-
const e = (
|
|
79
|
-
|
|
84
|
+
const e = (i) => {
|
|
85
|
+
i.key === "Escape" && P(!1);
|
|
80
86
|
};
|
|
81
87
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
82
|
-
}, [t]),
|
|
88
|
+
}, [t]), r.useLayoutEffect(() => {
|
|
83
89
|
if (!t) {
|
|
84
|
-
|
|
90
|
+
z(null);
|
|
85
91
|
return;
|
|
86
92
|
}
|
|
87
|
-
const e = b.current,
|
|
88
|
-
if (!e || !
|
|
89
|
-
const
|
|
90
|
-
|
|
93
|
+
const e = b.current, i = C.current;
|
|
94
|
+
if (!e || !i) return;
|
|
95
|
+
const f = () => {
|
|
96
|
+
z(G(e, i, c, R, l));
|
|
91
97
|
};
|
|
92
|
-
return
|
|
93
|
-
window.removeEventListener("resize",
|
|
98
|
+
return f(), window.addEventListener("resize", f), window.addEventListener("scroll", f, !0), () => {
|
|
99
|
+
window.removeEventListener("resize", f), window.removeEventListener("scroll", f, !0);
|
|
94
100
|
};
|
|
95
|
-
}, [t, c, R, s, l]),
|
|
101
|
+
}, [t, c, R, s, l]), r.useEffect(() => {
|
|
96
102
|
if (!t) return;
|
|
97
|
-
const e = (
|
|
98
|
-
const
|
|
99
|
-
if (!
|
|
100
|
-
const M =
|
|
101
|
-
!
|
|
103
|
+
const e = (i) => {
|
|
104
|
+
const f = b.current, I = C.current;
|
|
105
|
+
if (!f || !I) return;
|
|
106
|
+
const M = i.target;
|
|
107
|
+
!f.contains(M) && !I.contains(M) && (E.current = !1, _());
|
|
102
108
|
};
|
|
103
109
|
return document.addEventListener("pointermove", e), () => document.removeEventListener("pointermove", e);
|
|
104
|
-
}, [t]),
|
|
110
|
+
}, [t]), r.useEffect(() => {
|
|
105
111
|
t || (E.current = !1);
|
|
106
|
-
}, [t]), /* @__PURE__ */
|
|
107
|
-
|
|
108
|
-
t && typeof document < "u" &&
|
|
112
|
+
}, [t]), /* @__PURE__ */ W(X, { children: [
|
|
113
|
+
N,
|
|
114
|
+
t && typeof document < "u" && Y.createPortal(
|
|
109
115
|
/* @__PURE__ */ O(
|
|
110
116
|
"div",
|
|
111
117
|
{
|
|
112
|
-
id:
|
|
113
|
-
ref:
|
|
118
|
+
id: B,
|
|
119
|
+
ref: C,
|
|
114
120
|
role: "tooltip",
|
|
115
121
|
"aria-hidden": !t,
|
|
116
122
|
"data-side": c,
|
|
117
123
|
"data-align": R,
|
|
118
|
-
className: S(j.tooltip,
|
|
124
|
+
className: S(j.tooltip, a),
|
|
119
125
|
style: {
|
|
120
126
|
position: "absolute",
|
|
121
127
|
top: (w == null ? void 0 : w.top) ?? 0,
|
|
@@ -124,10 +130,10 @@ const K = ({
|
|
|
124
130
|
zIndex: 10
|
|
125
131
|
},
|
|
126
132
|
onPointerEnter: () => {
|
|
127
|
-
E.current = !0,
|
|
133
|
+
E.current = !0, u(L), u(y);
|
|
128
134
|
},
|
|
129
135
|
onPointerLeave: () => {
|
|
130
|
-
E.current = !1,
|
|
136
|
+
E.current = !1, _();
|
|
131
137
|
},
|
|
132
138
|
children: /* @__PURE__ */ O("div", { className: S(j.content, v), children: s })
|
|
133
139
|
}
|
|
@@ -137,5 +143,5 @@ const K = ({
|
|
|
137
143
|
] });
|
|
138
144
|
};
|
|
139
145
|
export {
|
|
140
|
-
|
|
146
|
+
U as Tooltip
|
|
141
147
|
};
|
|
@@ -6,7 +6,6 @@ export interface MainNavProps extends CartPropsBase, React.HTMLAttributes<HTMLDi
|
|
|
6
6
|
categories?: CategoryWithChildren[];
|
|
7
7
|
homeRoute: string;
|
|
8
8
|
faqRoute: string;
|
|
9
|
-
byModelSerialRoute: string;
|
|
10
9
|
customPartsRoute: string;
|
|
11
10
|
aboutUsRoute: string;
|
|
12
11
|
accountRoute: string;
|
|
@@ -14,6 +13,7 @@ export interface MainNavProps extends CartPropsBase, React.HTMLAttributes<HTMLDi
|
|
|
14
13
|
cart: ShoppingCart;
|
|
15
14
|
onLoginClick: () => void;
|
|
16
15
|
onSearch: (_input: string) => void;
|
|
16
|
+
onClickModelSerial: () => void;
|
|
17
17
|
}
|
|
18
18
|
export type MainNavHandle = ShoppingCartHandle;
|
|
19
19
|
export declare const MainNav: React.ForwardRefExoticComponent<MainNavProps & React.RefAttributes<ShoppingCartHandle>>;
|
|
@@ -1,49 +1,49 @@
|
|
|
1
1
|
import { jsx as e, jsxs as o } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { Text as
|
|
2
|
+
import D from "react";
|
|
3
|
+
import { Text as N } from "../../atoms/Text/Text.js";
|
|
4
4
|
import { Link as l } from "../../atoms/Link/Link.js";
|
|
5
|
-
import { Icon as
|
|
5
|
+
import { Icon as M } from "../../atoms/Icon/Icon.js";
|
|
6
6
|
import { Flex as t } from "../../atoms/Flex/Flex.js";
|
|
7
|
-
import { Grid as
|
|
8
|
-
import { Logo as
|
|
9
|
-
import { SearchBox as
|
|
10
|
-
import { HamburgerMenu as
|
|
11
|
-
import { ShoppingCart as
|
|
12
|
-
import { Account as
|
|
13
|
-
import { CategoryNav as
|
|
14
|
-
import { c as
|
|
15
|
-
import
|
|
7
|
+
import { Grid as z, Column as I } from "../../atoms/Grid/Grid.js";
|
|
8
|
+
import { Logo as S } from "../../molecules/Logo/Logo.js";
|
|
9
|
+
import { SearchBox as _ } from "../../molecules/SearchBox/SearchBox.js";
|
|
10
|
+
import { HamburgerMenu as U } from "../../molecules/HamburgerMenu/HamburgerMenu.js";
|
|
11
|
+
import { ShoppingCart as F } from "../../molecules/Cart/Cart.js";
|
|
12
|
+
import { Account as H } from "../../molecules/Account/Account.js";
|
|
13
|
+
import { CategoryNav as B } from "../../molecules/CategoryNav/CategoryNav.js";
|
|
14
|
+
import { c as s } from "../../clsx-OuTLNxxd.js";
|
|
15
|
+
import { getHideAtStyles as u } from "../../atoms/HideAt.js";
|
|
16
|
+
import '../../assets/MainNav.css';const G = "_main_19pdr_1", K = "_column_19pdr_8", P = "_topNav_19pdr_13", Q = "_logo_19pdr_21", T = "_operations_19pdr_24", W = "_search_19pdr_31", q = "_siteLink_19pdr_34", E = "_accountArea_19pdr_48", J = "_category_19pdr_60", O = "_menuList_19pdr_82", r = {
|
|
16
17
|
main: G,
|
|
17
|
-
column:
|
|
18
|
-
topNav:
|
|
19
|
-
logo:
|
|
20
|
-
operations:
|
|
21
|
-
search:
|
|
22
|
-
siteLink:
|
|
23
|
-
accountArea:
|
|
24
|
-
category:
|
|
25
|
-
menuList:
|
|
26
|
-
},
|
|
18
|
+
column: K,
|
|
19
|
+
topNav: P,
|
|
20
|
+
logo: Q,
|
|
21
|
+
operations: T,
|
|
22
|
+
search: W,
|
|
23
|
+
siteLink: q,
|
|
24
|
+
accountArea: E,
|
|
25
|
+
category: J,
|
|
26
|
+
menuList: O
|
|
27
|
+
}, le = D.forwardRef(function({
|
|
27
28
|
account: c,
|
|
28
29
|
categories: n,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
onSearch: f,
|
|
39
|
-
open: L,
|
|
40
|
-
// NEW: consume external panel control props from CartPropsBase
|
|
41
|
-
onCartClick: C,
|
|
42
|
-
// NEW: callback from consumer
|
|
30
|
+
homeRoute: g,
|
|
31
|
+
faqRoute: v,
|
|
32
|
+
customPartsRoute: d,
|
|
33
|
+
aboutUsRoute: A,
|
|
34
|
+
accountRoute: L,
|
|
35
|
+
contactRoute: h,
|
|
36
|
+
cart: x,
|
|
37
|
+
open: C,
|
|
38
|
+
// consume external panel control props from CartPropsBase
|
|
43
39
|
className: k,
|
|
40
|
+
onLoginClick: y,
|
|
41
|
+
onSearch: p,
|
|
42
|
+
onClickModelSerial: f,
|
|
43
|
+
onCartClick: b,
|
|
44
44
|
...w
|
|
45
|
-
},
|
|
46
|
-
return /* @__PURE__ */ e(
|
|
45
|
+
}, j) {
|
|
46
|
+
return /* @__PURE__ */ e(z, { ...w, gridWrapperClassName: s(r.main, k), children: /* @__PURE__ */ o(I, { span: 12, className: r.column, children: [
|
|
47
47
|
/* @__PURE__ */ o(
|
|
48
48
|
t,
|
|
49
49
|
{
|
|
@@ -52,7 +52,7 @@ import '../../assets/MainNav.css';const G = "_main_1l043_1", H = "_column_1l043_
|
|
|
52
52
|
justifyContent: "space-between",
|
|
53
53
|
className: r.topNav,
|
|
54
54
|
children: [
|
|
55
|
-
/* @__PURE__ */ e("div", { className: r.logo, children: /* @__PURE__ */ e(l, { href:
|
|
55
|
+
/* @__PURE__ */ e("div", { className: r.logo, children: /* @__PURE__ */ e(l, { href: g, children: /* @__PURE__ */ e(S, {}) }) }),
|
|
56
56
|
/* @__PURE__ */ o(
|
|
57
57
|
t,
|
|
58
58
|
{
|
|
@@ -61,38 +61,38 @@ import '../../assets/MainNav.css';const G = "_main_1l043_1", H = "_column_1l043_
|
|
|
61
61
|
justifyContent: "flex-end",
|
|
62
62
|
className: r.operations,
|
|
63
63
|
children: [
|
|
64
|
-
/* @__PURE__ */ e(t, { flexDirection: "row", hideAt: ["sm"], className: r.search, children: /* @__PURE__ */ e(
|
|
65
|
-
/* @__PURE__ */ e(
|
|
66
|
-
/* @__PURE__ */ e(i, { href:
|
|
67
|
-
/* @__PURE__ */ e(i, { href:
|
|
64
|
+
/* @__PURE__ */ e(t, { flexDirection: "row", hideAt: ["sm"], className: r.search, children: /* @__PURE__ */ e(_, { onSearch: p, inputName: "cpc-search" }) }),
|
|
65
|
+
/* @__PURE__ */ e("button", { onClick: f, className: s(r.siteLink, u(["sm", "md"])), children: "Model/Serial" }),
|
|
66
|
+
/* @__PURE__ */ e(i, { href: d, hideAt: ["sm", "md"], children: "Custom Parts" }),
|
|
67
|
+
/* @__PURE__ */ e(i, { href: h, hideAt: ["sm", "md"], children: "Contact Us" }),
|
|
68
68
|
/* @__PURE__ */ e("div", { className: r.accountArea, children: /* @__PURE__ */ e(
|
|
69
|
-
|
|
69
|
+
H,
|
|
70
70
|
{
|
|
71
71
|
account: c,
|
|
72
|
-
accountRoute:
|
|
73
|
-
onLoginClick:
|
|
72
|
+
accountRoute: L,
|
|
73
|
+
onLoginClick: y,
|
|
74
74
|
className: r.avatar
|
|
75
75
|
}
|
|
76
76
|
) }),
|
|
77
77
|
/* @__PURE__ */ e(
|
|
78
|
-
|
|
78
|
+
F,
|
|
79
79
|
{
|
|
80
|
-
ref:
|
|
81
|
-
cart:
|
|
82
|
-
open:
|
|
83
|
-
onCartClick:
|
|
80
|
+
ref: j,
|
|
81
|
+
cart: x,
|
|
82
|
+
open: C,
|
|
83
|
+
onCartClick: b
|
|
84
84
|
}
|
|
85
85
|
),
|
|
86
|
-
/* @__PURE__ */ e(
|
|
87
|
-
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
|
|
88
|
-
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(i, { href:
|
|
89
|
-
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(i, { href:
|
|
90
|
-
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(i, { href:
|
|
91
|
-
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(i, { href:
|
|
86
|
+
/* @__PURE__ */ e(U, { hideAt: ["lg"], children: /* @__PURE__ */ o("ul", { className: r.menuList, children: [
|
|
87
|
+
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { onClick: f, className: s(r.siteLink, u(["lg"])), children: "Model/Serial" }) }),
|
|
88
|
+
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(i, { href: d, children: "Custom Parts" }) }),
|
|
89
|
+
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(i, { href: h, children: "Contact Us" }) }),
|
|
90
|
+
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(i, { href: v, children: "FAQ" }) }),
|
|
91
|
+
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(i, { href: A, children: "About Us" }) }),
|
|
92
92
|
n && n.map((a) => /* @__PURE__ */ e("li", { className: r.category, children: /* @__PURE__ */ o(l, { href: a.route, children: [
|
|
93
|
-
/* @__PURE__ */ e(
|
|
93
|
+
/* @__PURE__ */ e(N, { size: "sm", weight: "semibold", children: a.label }),
|
|
94
94
|
/* @__PURE__ */ e(
|
|
95
|
-
|
|
95
|
+
M,
|
|
96
96
|
{
|
|
97
97
|
iconKey: "fa-solid fa-chevron-right",
|
|
98
98
|
title: "Navigate",
|
|
@@ -107,17 +107,17 @@ import '../../assets/MainNav.css';const G = "_main_1l043_1", H = "_column_1l043_
|
|
|
107
107
|
]
|
|
108
108
|
}
|
|
109
109
|
),
|
|
110
|
-
/* @__PURE__ */ e(t, { flexDirection: "row", hideAt: ["md", "lg"], children: /* @__PURE__ */ e(
|
|
111
|
-
/* @__PURE__ */ e(
|
|
110
|
+
/* @__PURE__ */ e(t, { flexDirection: "row", hideAt: ["md", "lg"], children: /* @__PURE__ */ e(_, { onSearch: p, inputName: "cpc-search", className: r.search }) }),
|
|
111
|
+
/* @__PURE__ */ e(B, { categories: n })
|
|
112
112
|
] }) });
|
|
113
113
|
});
|
|
114
114
|
function i({
|
|
115
|
-
href:
|
|
115
|
+
href: m,
|
|
116
116
|
children: c,
|
|
117
117
|
...n
|
|
118
118
|
}) {
|
|
119
|
-
return /* @__PURE__ */ e(l, { href:
|
|
119
|
+
return /* @__PURE__ */ e(l, { href: m, className: r.siteLink, ...n, children: /* @__PURE__ */ e(N, { size: "md", variant: "display", children: c }) });
|
|
120
120
|
}
|
|
121
121
|
export {
|
|
122
|
-
|
|
122
|
+
le as MainNav
|
|
123
123
|
};
|
|
@@ -119,7 +119,7 @@ const I = {
|
|
|
119
119
|
{ id: 12, itemId: "1092-02", description: "Kason Door Closer - Offset", price: "$99.99", quantity: 1, imageUrl: a, availability: "In Stock", availabilityId: "available" }
|
|
120
120
|
]
|
|
121
121
|
};
|
|
122
|
-
function
|
|
122
|
+
function v(e) {
|
|
123
123
|
return `$${e.items.reduce(
|
|
124
124
|
(t, i) => t + (parseFloat(i.price.replace(/[^0-9.]/g, "")) || 0) * i.quantity,
|
|
125
125
|
0
|
|
@@ -142,7 +142,7 @@ const n = (e) => {
|
|
|
142
142
|
open: l,
|
|
143
143
|
onClose: () => t(!1),
|
|
144
144
|
cart: e.cart,
|
|
145
|
-
subtotal:
|
|
145
|
+
subtotal: v(e.cart),
|
|
146
146
|
itemPriceLabel: "List Price",
|
|
147
147
|
contactHref: e.contactRoute,
|
|
148
148
|
contactLinkBehavior: "new-tab",
|
|
@@ -159,7 +159,9 @@ const n = (e) => {
|
|
|
159
159
|
homeRoute: "/",
|
|
160
160
|
customPartsRoute: "/custom",
|
|
161
161
|
accountRoute: "/account",
|
|
162
|
-
|
|
162
|
+
onClickModelSerial: () => {
|
|
163
|
+
alert("Model/Serial");
|
|
164
|
+
},
|
|
163
165
|
faqRoute: "/faq",
|
|
164
166
|
aboutUsRoute: "/about",
|
|
165
167
|
contactRoute: "/contact",
|
|
@@ -182,7 +184,9 @@ const n = (e) => {
|
|
|
182
184
|
homeRoute: "/",
|
|
183
185
|
customPartsRoute: "/custom",
|
|
184
186
|
accountRoute: "/account",
|
|
185
|
-
|
|
187
|
+
onClickModelSerial: () => {
|
|
188
|
+
alert("Model/Serial");
|
|
189
|
+
},
|
|
186
190
|
faqRoute: "/faq",
|
|
187
191
|
aboutUsRoute: "/about",
|
|
188
192
|
contactRoute: "/contact",
|
|
@@ -197,13 +201,15 @@ const n = (e) => {
|
|
|
197
201
|
categories: o
|
|
198
202
|
},
|
|
199
203
|
render: n
|
|
200
|
-
},
|
|
204
|
+
}, k = {
|
|
201
205
|
args: {
|
|
202
206
|
cart: r,
|
|
203
207
|
homeRoute: "/",
|
|
204
208
|
customPartsRoute: "/custom",
|
|
205
209
|
accountRoute: "/account",
|
|
206
|
-
|
|
210
|
+
onClickModelSerial: () => {
|
|
211
|
+
alert("Model/Serial");
|
|
212
|
+
},
|
|
207
213
|
faqRoute: "/faq",
|
|
208
214
|
aboutUsRoute: "/about",
|
|
209
215
|
contactRoute: "/contact",
|
|
@@ -221,7 +227,7 @@ const n = (e) => {
|
|
|
221
227
|
};
|
|
222
228
|
export {
|
|
223
229
|
S as Authenticated,
|
|
224
|
-
|
|
230
|
+
k as Unauthenticated,
|
|
225
231
|
C as WithCartItems,
|
|
226
232
|
I as default
|
|
227
233
|
};
|