@caseparts-org/caseblocks 0.0.90 → 0.0.91
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/Cart.module-9txlotpz.js +18 -0
- package/dist/assets/Cart.css +1 -1
- package/dist/assets/Icon.css +1 -1
- package/dist/assets/Popover.css +1 -0
- package/dist/assets/SlideInPanel.css +1 -0
- package/dist/assets/Tooltip.css +1 -1
- package/dist/assets/buttonClassName.css +1 -1
- package/dist/atoms/Button/buttonClassName.js +25 -25
- package/dist/atoms/Icon/Icon.d.ts +3 -1
- package/dist/atoms/Icon/Icon.js +48 -32
- package/dist/atoms/Input/Input.js +4 -4
- package/dist/atoms/Popover/Popover.d.ts +14 -0
- package/dist/atoms/Popover/Popover.js +110 -0
- package/dist/atoms/Popover/Popover.stories.d.ts +66 -0
- package/dist/atoms/Popover/Popover.stories.js +207 -0
- package/dist/atoms/SlideInPanel/SlideInPanel.d.ts +18 -0
- package/dist/atoms/SlideInPanel/SlideInPanel.js +99 -0
- package/dist/atoms/SlideInPanel/SlideInPanel.stories.d.ts +10 -0
- package/dist/atoms/SlideInPanel/SlideInPanel.stories.js +117 -0
- package/dist/atoms/Tooltip/Tooltip.d.ts +16 -0
- package/dist/atoms/Tooltip/Tooltip.js +126 -0
- package/dist/{molecules → atoms}/Tooltip/Tooltip.stories.d.ts +8 -26
- package/dist/atoms/Tooltip/Tooltip.stories.js +209 -0
- package/dist/index-B4KbmMH3.js +383 -0
- package/dist/main-client.d.ts +3 -1
- package/dist/main-client.js +40 -38
- package/dist/molecules/AddToCart/AddToCart.js +18 -18
- package/dist/molecules/Cart/Cart.d.ts +10 -6
- package/dist/molecules/Cart/Cart.js +42 -93
- package/dist/molecules/Cart/Cart.stories.js +61 -28
- package/dist/molecules/Cart/CartSlideInPanel.d.ts +15 -0
- package/dist/molecules/Cart/CartSlideInPanel.js +97 -0
- package/dist/molecules/CategoryNav/CategoryNav.js +2 -2
- package/dist/molecules/StatefulButton/StatefulButton.stories.js +4 -4
- package/dist/molecules/ToggleView/ToggleView.js +6 -6
- package/dist/organisms/Carousel/Carousel.js +44 -44
- package/dist/organisms/Footer/Footer.js +1 -1
- package/dist/organisms/MainNav/MainNav.d.ts +13 -11
- package/dist/organisms/MainNav/MainNav.js +86 -82
- package/dist/organisms/MainNav/MainNav.stories.d.ts +1 -2
- package/dist/organisms/MainNav/MainNav.stories.js +85 -58
- package/package.json +28 -7
- package/dist/molecules/Cart/Cart.stories.d.ts +0 -15
- package/dist/molecules/Tooltip/Tooltip.d.ts +0 -12
- package/dist/molecules/Tooltip/Tooltip.js +0 -2321
- package/dist/molecules/Tooltip/Tooltip.stories.js +0 -202
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import n from "react";
|
|
3
3
|
import { StatefulButton as l } from "./StatefulButton.js";
|
|
4
4
|
const u = {
|
|
5
5
|
title: "Case Parts/Molecules/StatefulButton",
|
|
@@ -40,15 +40,15 @@ const u = {
|
|
|
40
40
|
}, b = {
|
|
41
41
|
args: { text: "Add Part", completedText: "Done" }
|
|
42
42
|
}, r = (e) => {
|
|
43
|
-
const [c, t] =
|
|
43
|
+
const [c, t] = n.useState(!1);
|
|
44
44
|
return /* @__PURE__ */ a(
|
|
45
45
|
l,
|
|
46
46
|
{
|
|
47
47
|
...e,
|
|
48
48
|
completed: c,
|
|
49
|
-
onClick: (
|
|
49
|
+
onClick: (d) => {
|
|
50
50
|
var o;
|
|
51
|
-
(o = e.onClick) == null || o.call(e,
|
|
51
|
+
(o = e.onClick) == null || o.call(e, d), t(!0), setTimeout(() => t(!1), 1600);
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
);
|
|
@@ -2,11 +2,11 @@ import { jsx as e, jsxs as d } from "react/jsx-runtime";
|
|
|
2
2
|
import m from "react";
|
|
3
3
|
import { Flex as p } from "../../atoms/Flex/Flex.js";
|
|
4
4
|
import { Icon as l } from "../../atoms/Icon/Icon.js";
|
|
5
|
-
import { Text as
|
|
6
|
-
import { getHideAtStyles as
|
|
5
|
+
import { Text as _ } from "../../atoms/Text/Text.js";
|
|
6
|
+
import { getHideAtStyles as x } from "../../atoms/HideAt.js";
|
|
7
7
|
import { c as f } from "../../clsx-OuTLNxxd.js";
|
|
8
|
-
import '../../assets/ToggleView.css';const
|
|
9
|
-
toggleView:
|
|
8
|
+
import '../../assets/ToggleView.css';const T = "_toggleView_1u0oz_1", z = "_compactText_1u0oz_5", O = "_toggleOption_1u0oz_12", y = "_selected_1u0oz_22", g = {
|
|
9
|
+
toggleView: T,
|
|
10
10
|
compactText: z,
|
|
11
11
|
toggleOption: O,
|
|
12
12
|
selected: y
|
|
@@ -32,7 +32,7 @@ function r({
|
|
|
32
32
|
{
|
|
33
33
|
flexDirection: "row",
|
|
34
34
|
alignItems: "center",
|
|
35
|
-
className: f(g.toggleView,
|
|
35
|
+
className: f(g.toggleView, x(a), n),
|
|
36
36
|
...s,
|
|
37
37
|
children: m.Children.map(o, (i) => m.isValidElement(i) ? m.cloneElement(i, {
|
|
38
38
|
isSelected: i.props.id === c,
|
|
@@ -88,7 +88,7 @@ function u({
|
|
|
88
88
|
...i,
|
|
89
89
|
children: [
|
|
90
90
|
n,
|
|
91
|
-
/* @__PURE__ */ e(
|
|
91
|
+
/* @__PURE__ */ e(_, { size: "xs", className: g.compactText, children: t })
|
|
92
92
|
]
|
|
93
93
|
}
|
|
94
94
|
);
|
|
@@ -23,12 +23,12 @@ function At(t, n) {
|
|
|
23
23
|
return typeof u == "function" ? `${u}` == `${s}` : !Kt(u) || !Kt(s) ? u === s : At(u, s);
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function _t(t) {
|
|
27
27
|
return t.concat().sort((n, e) => n.name > e.name ? 1 : -1).map((n) => n.options);
|
|
28
28
|
}
|
|
29
29
|
function xn(t, n) {
|
|
30
30
|
if (t.length !== n.length) return !1;
|
|
31
|
-
const e =
|
|
31
|
+
const e = _t(t), i = _t(n);
|
|
32
32
|
return e.every((c, r) => {
|
|
33
33
|
const o = i[r];
|
|
34
34
|
return At(c, o);
|
|
@@ -43,7 +43,7 @@ function Tt(t) {
|
|
|
43
43
|
function St(t) {
|
|
44
44
|
return typeof t == "boolean";
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function Qt(t) {
|
|
47
47
|
return Object.prototype.toString.call(t) === "[object Object]";
|
|
48
48
|
}
|
|
49
49
|
function N(t) {
|
|
@@ -75,16 +75,16 @@ function gt(t) {
|
|
|
75
75
|
function Nt(t, n) {
|
|
76
76
|
return n === gt(t);
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function Jt(t, n = 0) {
|
|
79
79
|
return Array.from(Array(t), (e, i) => n + i);
|
|
80
80
|
}
|
|
81
81
|
function pt(t) {
|
|
82
82
|
return Object.keys(t);
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function Xt(t, n) {
|
|
85
85
|
return [t, n].reduce((e, i) => (pt(i).forEach((c) => {
|
|
86
|
-
const r = e[c], o = i[c], u =
|
|
87
|
-
e[c] = u ?
|
|
86
|
+
const r = e[c], o = i[c], u = Qt(r) && Qt(o);
|
|
87
|
+
e[c] = u ? Xt(r, o) : o;
|
|
88
88
|
}), e), {});
|
|
89
89
|
}
|
|
90
90
|
function Dt(t, n) {
|
|
@@ -270,7 +270,7 @@ function Tn(t, n, e, i, c, r, o, u, s, a, h, d, m, S, l, p, g, f, y) {
|
|
|
270
270
|
touch: 600
|
|
271
271
|
}, F = l ? 43 : 25;
|
|
272
272
|
let U = !1, A = 0, k = 0, z = !1, H = !1, $ = !1, q = !1;
|
|
273
|
-
function
|
|
273
|
+
function _(x) {
|
|
274
274
|
if (!y) return;
|
|
275
275
|
function w(j) {
|
|
276
276
|
(St(y) || y(x, j)) && ut(j);
|
|
@@ -283,11 +283,11 @@ function Tn(t, n, e, i, c, r, o, u, s, a, h, d, m, S, l, p, g, f, y) {
|
|
|
283
283
|
function R() {
|
|
284
284
|
L.clear(), I.clear();
|
|
285
285
|
}
|
|
286
|
-
function
|
|
286
|
+
function J() {
|
|
287
287
|
const x = q ? e : n;
|
|
288
288
|
I.add(x, "touchmove", V, v).add(x, "touchend", B).add(x, "mousemove", V, v).add(x, "mouseup", B);
|
|
289
289
|
}
|
|
290
|
-
function
|
|
290
|
+
function X(x) {
|
|
291
291
|
const w = x.nodeName || "";
|
|
292
292
|
return D.includes(w);
|
|
293
293
|
}
|
|
@@ -300,19 +300,19 @@ function Tn(t, n, e, i, c, r, o, u, s, a, h, d, m, S, l, p, g, f, y) {
|
|
|
300
300
|
}
|
|
301
301
|
function ut(x) {
|
|
302
302
|
const w = Dt(x, i);
|
|
303
|
-
q = w, $ = l && w && !x.buttons && U, U = lt(c.get(), o.get()) >= 2, !(w && x.button !== 0) && (
|
|
303
|
+
q = w, $ = l && w && !x.buttons && U, U = lt(c.get(), o.get()) >= 2, !(w && x.button !== 0) && (X(x.target) || (z = !0, r.pointerDown(x), a.useFriction(0).useDuration(0), c.set(o), J(), A = r.readPoint(x), k = r.readPoint(x, b), m.emit("pointerDown")));
|
|
304
304
|
}
|
|
305
305
|
function V(x) {
|
|
306
306
|
if (!Dt(x, i) && x.touches.length >= 2) return B(x);
|
|
307
|
-
const C = r.readPoint(x), j = r.readPoint(x, b),
|
|
308
|
-
if (!H && !q && (!x.cancelable || (H =
|
|
307
|
+
const C = r.readPoint(x), j = r.readPoint(x, b), Q = lt(C, A), W = lt(j, k);
|
|
308
|
+
if (!H && !q && (!x.cancelable || (H = Q > W, !H)))
|
|
309
309
|
return B(x);
|
|
310
310
|
const nt = r.pointerMove(x);
|
|
311
|
-
|
|
311
|
+
Q > p && ($ = !0), a.useFriction(0.3).useDuration(0.75), u.start(), c.add(E(nt)), x.preventDefault();
|
|
312
312
|
}
|
|
313
313
|
function B(x) {
|
|
314
|
-
const C = h.byDistance(0, !1).index !== d.get(), j = r.pointerUp(x) * Y(),
|
|
315
|
-
H = !1, z = !1, I.clear(), a.useDuration(nt).useFriction(tt), s.distance(
|
|
314
|
+
const C = h.byDistance(0, !1).index !== d.get(), j = r.pointerUp(x) * Y(), Q = ct(E(j), C), W = En(j, Q), nt = F - 10 * W, tt = f + W / 50;
|
|
315
|
+
H = !1, z = !1, I.clear(), a.useDuration(nt).useFriction(tt), s.distance(Q, !l), q = !1, m.emit("pointerUp");
|
|
316
316
|
}
|
|
317
317
|
function Z(x) {
|
|
318
318
|
$ && (x.stopPropagation(), x.preventDefault(), $ = !1);
|
|
@@ -321,7 +321,7 @@ function Tn(t, n, e, i, c, r, o, u, s, a, h, d, m, S, l, p, g, f, y) {
|
|
|
321
321
|
return z;
|
|
322
322
|
}
|
|
323
323
|
return {
|
|
324
|
-
init:
|
|
324
|
+
init: _,
|
|
325
325
|
destroy: R,
|
|
326
326
|
pointerDown: G
|
|
327
327
|
};
|
|
@@ -583,11 +583,11 @@ function Vn(t, n, e, i, c, r) {
|
|
|
583
583
|
const f = !p, y = Nt(g, p);
|
|
584
584
|
if (f) {
|
|
585
585
|
const b = K(g[0]) + 1;
|
|
586
|
-
return
|
|
586
|
+
return Jt(b);
|
|
587
587
|
}
|
|
588
588
|
if (y) {
|
|
589
589
|
const b = gt(r) - K(g)[0] + 1;
|
|
590
|
-
return
|
|
590
|
+
return Jt(b, K(g)[0]);
|
|
591
591
|
}
|
|
592
592
|
return l;
|
|
593
593
|
});
|
|
@@ -926,7 +926,7 @@ function Kn(t, n, e, i, c, r, o, u, s) {
|
|
|
926
926
|
groupSlides: p
|
|
927
927
|
};
|
|
928
928
|
}
|
|
929
|
-
function
|
|
929
|
+
function _n(t, n, e, i, c, r, o) {
|
|
930
930
|
const {
|
|
931
931
|
align: u,
|
|
932
932
|
axis: s,
|
|
@@ -948,14 +948,14 @@ function Qn(t, n, e, i, c, r, o) {
|
|
|
948
948
|
slideSizes: H,
|
|
949
949
|
slideSizesWithGaps: $,
|
|
950
950
|
startGap: q,
|
|
951
|
-
endGap:
|
|
952
|
-
} = qn(T, O, P, e, z, c), R = Kn(T, F, g, d, O, P, q,
|
|
953
|
-
snaps:
|
|
954
|
-
snapsAligned:
|
|
955
|
-
} = jn(T, A, O, P, R), Y = -K(
|
|
951
|
+
endGap: _
|
|
952
|
+
} = qn(T, O, P, e, z, c), R = Kn(T, F, g, d, O, P, q, _, L), {
|
|
953
|
+
snaps: J,
|
|
954
|
+
snapsAligned: X
|
|
955
|
+
} = jn(T, A, O, P, R), Y = -K(J) + K($), {
|
|
956
956
|
snapsContained: ct,
|
|
957
957
|
scrollContainLimit: ut
|
|
958
|
-
} = Cn(F, Y,
|
|
958
|
+
} = Cn(F, Y, X, y, L), V = k ? ct : X, {
|
|
959
959
|
limit: B
|
|
960
960
|
} = Fn(Y, V, d), Z = Yt(gt(V), h, d), G = Z.clone(), M = dt(e), x = ({
|
|
961
961
|
dragHandler: it,
|
|
@@ -986,7 +986,7 @@ function Qn(t, n, e, i, c, r, o) {
|
|
|
986
986
|
Gt && sn.stop();
|
|
987
987
|
const an = It.get() * zt + nn.get() * (1 - zt);
|
|
988
988
|
ht.set(an), Vt && (en.loop(it.direction()), on.loop()), Lt.to(ht.get()), Gt && jt.emit("settle"), Rt || jt.emit("scroll");
|
|
989
|
-
}, C = vn(i, c, () => x(Et), (it) => w(Et, it)), j = 0.68,
|
|
989
|
+
}, C = vn(i, c, () => x(Et), (it) => w(Et, it)), j = 0.68, Q = V[Z.get()], W = ft(Q), nt = ft(Q), tt = ft(Q), et = ft(Q), at = Nn(W, tt, nt, et, m, j), bt = zn(d, V, Y, B, et), xt = Hn(C, Z, G, at, bt, et, o), Ft = Bn(B), kt = mt(), Wt = $n(n, e, o, p), {
|
|
990
990
|
slideRegistry: Bt
|
|
991
991
|
} = Vn(k, y, V, ut, R, M), tn = Rn(t, e, Bt, xt, at, kt, o, v), Et = {
|
|
992
992
|
ownerDocument: i,
|
|
@@ -1015,7 +1015,7 @@ function Qn(t, n, e, i, c, r, o) {
|
|
|
1015
1015
|
scrollSnaps: V,
|
|
1016
1016
|
scrollTarget: bt,
|
|
1017
1017
|
scrollTo: xt,
|
|
1018
|
-
slideLooper: Gn(T, F, Y, H, $,
|
|
1018
|
+
slideLooper: Gn(T, F, Y, H, $, J, V, tt, e),
|
|
1019
1019
|
slideFocus: tn,
|
|
1020
1020
|
slidesHandler: Un(n, o, E),
|
|
1021
1021
|
slidesInView: Wt,
|
|
@@ -1027,7 +1027,7 @@ function Qn(t, n, e, i, c, r, o) {
|
|
|
1027
1027
|
};
|
|
1028
1028
|
return Et;
|
|
1029
1029
|
}
|
|
1030
|
-
function
|
|
1030
|
+
function Qn() {
|
|
1031
1031
|
let t = {}, n;
|
|
1032
1032
|
function e(a) {
|
|
1033
1033
|
n = a;
|
|
@@ -1056,7 +1056,7 @@ function Jn() {
|
|
|
1056
1056
|
};
|
|
1057
1057
|
return s;
|
|
1058
1058
|
}
|
|
1059
|
-
const
|
|
1059
|
+
const Jn = {
|
|
1060
1060
|
align: "center",
|
|
1061
1061
|
axis: "x",
|
|
1062
1062
|
container: null,
|
|
@@ -1078,9 +1078,9 @@ const Xn = {
|
|
|
1078
1078
|
watchSlides: !0,
|
|
1079
1079
|
watchFocus: !0
|
|
1080
1080
|
};
|
|
1081
|
-
function
|
|
1081
|
+
function Xn(t) {
|
|
1082
1082
|
function n(r, o) {
|
|
1083
|
-
return
|
|
1083
|
+
return Xt(r, o || {});
|
|
1084
1084
|
}
|
|
1085
1085
|
function e(r) {
|
|
1086
1086
|
const o = r.breakpoints || {}, u = pt(o).filter((s) => t.matchMedia(s).matches).map((s) => o[s]).reduce((s, a) => n(s, a), {});
|
|
@@ -1113,7 +1113,7 @@ function Yn(t) {
|
|
|
1113
1113
|
};
|
|
1114
1114
|
}
|
|
1115
1115
|
function yt(t, n, e) {
|
|
1116
|
-
const i = t.ownerDocument, c = i.defaultView, r =
|
|
1116
|
+
const i = t.ownerDocument, c = i.defaultView, r = Xn(c), o = Yn(r), u = mt(), s = Qn(), {
|
|
1117
1117
|
mergeOptions: a,
|
|
1118
1118
|
optionsAtMedia: h,
|
|
1119
1119
|
optionsMediaQueries: d
|
|
@@ -1122,7 +1122,7 @@ function yt(t, n, e) {
|
|
|
1122
1122
|
off: S,
|
|
1123
1123
|
emit: l
|
|
1124
1124
|
} = s, p = T;
|
|
1125
|
-
let g = !1, f, y = a(
|
|
1125
|
+
let g = !1, f, y = a(Jn, yt.globalOptions), b = a(y), E = [], D, v, L;
|
|
1126
1126
|
function I() {
|
|
1127
1127
|
const {
|
|
1128
1128
|
container: M,
|
|
@@ -1133,7 +1133,7 @@ function yt(t, n, e) {
|
|
|
1133
1133
|
L = [].slice.call(C || v.children);
|
|
1134
1134
|
}
|
|
1135
1135
|
function O(M) {
|
|
1136
|
-
const x =
|
|
1136
|
+
const x = _n(t, v, L, i, c, M, s);
|
|
1137
1137
|
if (M.loop && !x.slideLooper.canLoop()) {
|
|
1138
1138
|
const w = Object.assign({}, M, {
|
|
1139
1139
|
loop: !1
|
|
@@ -1179,16 +1179,16 @@ function yt(t, n, e) {
|
|
|
1179
1179
|
function q() {
|
|
1180
1180
|
return f.scrollSnapList;
|
|
1181
1181
|
}
|
|
1182
|
-
function
|
|
1182
|
+
function _() {
|
|
1183
1183
|
return f.scrollProgress.get(f.offsetLocation.get());
|
|
1184
1184
|
}
|
|
1185
1185
|
function R() {
|
|
1186
1186
|
return f.index.get();
|
|
1187
1187
|
}
|
|
1188
|
-
function
|
|
1188
|
+
function J() {
|
|
1189
1189
|
return f.indexPrevious.get();
|
|
1190
1190
|
}
|
|
1191
|
-
function
|
|
1191
|
+
function X() {
|
|
1192
1192
|
return f.slidesInView.get();
|
|
1193
1193
|
}
|
|
1194
1194
|
function Y() {
|
|
@@ -1219,17 +1219,17 @@ function yt(t, n, e) {
|
|
|
1219
1219
|
on: m,
|
|
1220
1220
|
emit: l,
|
|
1221
1221
|
plugins: ct,
|
|
1222
|
-
previousScrollSnap:
|
|
1222
|
+
previousScrollSnap: J,
|
|
1223
1223
|
reInit: p,
|
|
1224
1224
|
rootNode: V,
|
|
1225
1225
|
scrollNext: k,
|
|
1226
1226
|
scrollPrev: z,
|
|
1227
|
-
scrollProgress:
|
|
1227
|
+
scrollProgress: _,
|
|
1228
1228
|
scrollSnapList: q,
|
|
1229
1229
|
scrollTo: A,
|
|
1230
1230
|
selectedScrollSnap: R,
|
|
1231
1231
|
slideNodes: Z,
|
|
1232
|
-
slidesInView:
|
|
1232
|
+
slidesInView: X,
|
|
1233
1233
|
slidesNotInView: Y
|
|
1234
1234
|
};
|
|
1235
1235
|
return P(n, e), setTimeout(() => s.emit("init"), 0), G;
|
|
@@ -1284,10 +1284,10 @@ function Ct(t = {}) {
|
|
|
1284
1284
|
if (n = H(q), e.scrollSnapList().length <= 1) return;
|
|
1285
1285
|
h = n.jump, i = !1, c = Wn(e, n.delay);
|
|
1286
1286
|
const {
|
|
1287
|
-
eventStore:
|
|
1287
|
+
eventStore: _,
|
|
1288
1288
|
ownerDocument: R
|
|
1289
|
-
} = e.internalEngine(),
|
|
1290
|
-
|
|
1289
|
+
} = e.internalEngine(), J = !!e.internalEngine().options.watchDrag, X = te(e, n.rootNode);
|
|
1290
|
+
_.add(R, "visibilitychange", f), J && e.on("pointerDown", b), J && !n.stopOnInteraction && e.on("pointerUp", E), n.stopOnMouseEnter && _.add(X, "mouseenter", D), n.stopOnMouseEnter && !n.stopOnInteraction && _.add(X, "mouseleave", v), n.stopOnFocusIn && e.on("slideFocusStart", g), n.stopOnFocusIn && !n.stopOnInteraction && _.add(e.containerNode(), "focusout", p), n.playOnInit && p();
|
|
1291
1291
|
}
|
|
1292
1292
|
function m() {
|
|
1293
1293
|
e.off("pointerDown", b).off("pointerUp", E).off("slideFocusStart", g), g(), i = !0, u = !1;
|
|
@@ -5,7 +5,7 @@ import { Link as i } from "../../atoms/Link/Link.js";
|
|
|
5
5
|
import { Icon as n } from "../../atoms/Icon/Icon.js";
|
|
6
6
|
import { Logo as x } from "../../molecules/Logo/Logo.js";
|
|
7
7
|
import { Text as o } from "../../atoms/Text/Text.js";
|
|
8
|
-
import { Tooltip as a } from "../../
|
|
8
|
+
import { Tooltip as a } from "../../atoms/Tooltip/Tooltip.js";
|
|
9
9
|
import { c as h } from "../../clsx-OuTLNxxd.js";
|
|
10
10
|
import '../../assets/Footer.css';const y = "_footer_1r911_2", p = "_grid_1r911_18", C = "_title_1r911_31", b = "_columnContent_1r911_40", _ = "_history_1r911_48", w = "_logo_1r911_62", t = {
|
|
11
11
|
footer: y,
|
|
@@ -1,6 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { CartPropsBase, ShoppingCart, ShoppingCartHandle } from '../../molecules/Cart/Cart';
|
|
2
3
|
import { AccountProps } from '../../molecules/Account/Account';
|
|
3
4
|
import { ContactUsLinkBehavior } from 'lib/main-client';
|
|
5
|
+
export interface Category {
|
|
6
|
+
id: string | number;
|
|
7
|
+
label: string;
|
|
8
|
+
route: string;
|
|
9
|
+
}
|
|
10
|
+
export interface MainCategory extends Category {
|
|
11
|
+
children: Category[];
|
|
12
|
+
showChevron?: boolean;
|
|
13
|
+
}
|
|
4
14
|
export interface MainNavProps extends CartPropsBase, React.HTMLAttributes<HTMLDivElement>, Pick<AccountProps, "account"> {
|
|
5
15
|
categories?: MainCategory[];
|
|
6
16
|
homeRoute: string;
|
|
@@ -17,13 +27,5 @@ export interface MainNavProps extends CartPropsBase, React.HTMLAttributes<HTMLDi
|
|
|
17
27
|
onLoginClick: () => void;
|
|
18
28
|
onSearch: (_input: string) => void;
|
|
19
29
|
}
|
|
20
|
-
export
|
|
21
|
-
|
|
22
|
-
label: string;
|
|
23
|
-
route: string;
|
|
24
|
-
}
|
|
25
|
-
export interface MainCategory extends Category {
|
|
26
|
-
children: Category[];
|
|
27
|
-
showChevron?: boolean;
|
|
28
|
-
}
|
|
29
|
-
export declare function MainNav({ account, categories, byModelSerialRoute, homeRoute, faqRoute, customPartsRoute, aboutUsRoute, accountRoute, contactRoute, cart, cartSubtotal, cartItemPriceLabel, cartContactLinkBehavior, onLoginClick, onSearch, onItemQtyChange, onItemDelete, onItemEdit, onCheckout, className, ...otherProps }: MainNavProps): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
export type MainNavHandle = ShoppingCartHandle;
|
|
31
|
+
export declare const MainNav: React.ForwardRefExoticComponent<MainNavProps & React.RefAttributes<ShoppingCartHandle>>;
|
|
@@ -1,113 +1,117 @@
|
|
|
1
1
|
import { jsx as e, jsxs as o } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import I from "react";
|
|
3
|
+
import { Text as _ } from "../../atoms/Text/Text.js";
|
|
4
|
+
import { Link as s } from "../../atoms/Link/Link.js";
|
|
5
|
+
import { Icon as U } from "../../atoms/Icon/Icon.js";
|
|
5
6
|
import { Flex as t } from "../../atoms/Flex/Flex.js";
|
|
6
|
-
import { Grid as
|
|
7
|
-
import { Logo as
|
|
8
|
-
import { SearchBox as
|
|
9
|
-
import { HamburgerMenu as
|
|
10
|
-
import { ShoppingCart as
|
|
11
|
-
import { Account as
|
|
12
|
-
import { CategoryNav as
|
|
13
|
-
import { c as
|
|
14
|
-
import '../../assets/MainNav.css';const
|
|
15
|
-
main:
|
|
16
|
-
column:
|
|
17
|
-
topNav:
|
|
18
|
-
logo:
|
|
19
|
-
operations:
|
|
20
|
-
search:
|
|
21
|
-
siteLink:
|
|
22
|
-
accountArea:
|
|
23
|
-
category:
|
|
24
|
-
menuList:
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
account: l,
|
|
7
|
+
import { Grid as B, Column as F } from "../../atoms/Grid/Grid.js";
|
|
8
|
+
import { Logo as H } from "../../molecules/Logo/Logo.js";
|
|
9
|
+
import { SearchBox as p } from "../../molecules/SearchBox/SearchBox.js";
|
|
10
|
+
import { HamburgerMenu as P } from "../../molecules/HamburgerMenu/HamburgerMenu.js";
|
|
11
|
+
import { ShoppingCart as S } from "../../molecules/Cart/Cart.js";
|
|
12
|
+
import { Account as G } from "../../molecules/Account/Account.js";
|
|
13
|
+
import { CategoryNav as K } from "../../molecules/CategoryNav/CategoryNav.js";
|
|
14
|
+
import { c as Q } from "../../clsx-OuTLNxxd.js";
|
|
15
|
+
import '../../assets/MainNav.css';const T = "_main_1l043_1", W = "_column_1l043_8", q = "_topNav_1l043_13", E = "_logo_1l043_21", J = "_operations_1l043_24", O = "_search_1l043_31", V = "_siteLink_1l043_34", X = "_accountArea_1l043_38", Y = "_category_1l043_50", Z = "_menuList_1l043_72", r = {
|
|
16
|
+
main: T,
|
|
17
|
+
column: W,
|
|
18
|
+
topNav: q,
|
|
19
|
+
logo: E,
|
|
20
|
+
operations: J,
|
|
21
|
+
search: O,
|
|
22
|
+
siteLink: V,
|
|
23
|
+
accountArea: X,
|
|
24
|
+
category: Y,
|
|
25
|
+
menuList: Z
|
|
26
|
+
}, fe = I.forwardRef(function({
|
|
27
|
+
account: c,
|
|
28
28
|
categories: n,
|
|
29
|
-
byModelSerialRoute:
|
|
30
|
-
homeRoute:
|
|
31
|
-
faqRoute:
|
|
32
|
-
customPartsRoute:
|
|
33
|
-
aboutUsRoute:
|
|
34
|
-
accountRoute:
|
|
29
|
+
byModelSerialRoute: h,
|
|
30
|
+
homeRoute: u,
|
|
31
|
+
faqRoute: N,
|
|
32
|
+
customPartsRoute: d,
|
|
33
|
+
aboutUsRoute: g,
|
|
34
|
+
accountRoute: v,
|
|
35
35
|
contactRoute: a,
|
|
36
|
-
cart:
|
|
37
|
-
cartSubtotal:
|
|
38
|
-
cartItemPriceLabel:
|
|
39
|
-
cartContactLinkBehavior:
|
|
36
|
+
cart: A,
|
|
37
|
+
cartSubtotal: L,
|
|
38
|
+
cartItemPriceLabel: x,
|
|
39
|
+
cartContactLinkBehavior: $,
|
|
40
40
|
onLoginClick: C,
|
|
41
|
-
onSearch:
|
|
41
|
+
onSearch: f,
|
|
42
42
|
onItemQtyChange: k,
|
|
43
|
-
onItemDelete:
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
43
|
+
onItemDelete: w,
|
|
44
|
+
onCheckout: y,
|
|
45
|
+
open: b,
|
|
46
|
+
// NEW: consume external panel control props from CartPropsBase
|
|
47
|
+
onCartClick: j,
|
|
48
|
+
// NEW: callback from consumer
|
|
49
|
+
className: D,
|
|
50
|
+
...M
|
|
51
|
+
}, z) {
|
|
52
|
+
return /* @__PURE__ */ e(B, { ...M, gridWrapperClassName: Q(r.main, D), children: /* @__PURE__ */ o(F, { span: 12, className: r.column, children: [
|
|
50
53
|
/* @__PURE__ */ o(
|
|
51
54
|
t,
|
|
52
55
|
{
|
|
53
56
|
flexDirection: "row",
|
|
54
57
|
alignItems: "center",
|
|
55
58
|
justifyContent: "space-between",
|
|
56
|
-
className:
|
|
59
|
+
className: r.topNav,
|
|
57
60
|
children: [
|
|
58
|
-
/* @__PURE__ */ e("div", { className:
|
|
61
|
+
/* @__PURE__ */ e("div", { className: r.logo, children: /* @__PURE__ */ e(s, { href: u, children: /* @__PURE__ */ e(H, {}) }) }),
|
|
59
62
|
/* @__PURE__ */ o(
|
|
60
63
|
t,
|
|
61
64
|
{
|
|
62
65
|
flexDirection: "row",
|
|
63
66
|
alignItems: "center",
|
|
64
67
|
justifyContent: "flex-end",
|
|
65
|
-
className:
|
|
68
|
+
className: r.operations,
|
|
66
69
|
children: [
|
|
67
|
-
/* @__PURE__ */ e(t, { flexDirection: "row", hideAt: ["sm"], className:
|
|
68
|
-
/* @__PURE__ */ e(
|
|
69
|
-
/* @__PURE__ */ e(
|
|
70
|
-
/* @__PURE__ */ e(
|
|
71
|
-
/* @__PURE__ */ e("div", { className:
|
|
72
|
-
|
|
70
|
+
/* @__PURE__ */ e(t, { flexDirection: "row", hideAt: ["sm"], className: r.search, children: /* @__PURE__ */ e(p, { onSearch: f, inputName: "cpc-search" }) }),
|
|
71
|
+
/* @__PURE__ */ e(i, { href: h, hideAt: ["sm", "md"], children: "Model/Serial" }),
|
|
72
|
+
/* @__PURE__ */ e(i, { href: d, hideAt: ["sm", "md"], children: "Custom Parts" }),
|
|
73
|
+
/* @__PURE__ */ e(i, { href: a, hideAt: ["sm", "md"], children: "Contact Us" }),
|
|
74
|
+
/* @__PURE__ */ e("div", { className: r.accountArea, children: /* @__PURE__ */ e(
|
|
75
|
+
G,
|
|
73
76
|
{
|
|
74
|
-
account:
|
|
75
|
-
accountRoute:
|
|
77
|
+
account: c,
|
|
78
|
+
accountRoute: v,
|
|
76
79
|
onLoginClick: C,
|
|
77
|
-
className:
|
|
80
|
+
className: r.avatar
|
|
78
81
|
}
|
|
79
82
|
) }),
|
|
80
83
|
/* @__PURE__ */ e(
|
|
81
|
-
|
|
84
|
+
S,
|
|
82
85
|
{
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
+
ref: z,
|
|
87
|
+
cart: A,
|
|
88
|
+
open: b,
|
|
89
|
+
onCartClick: j,
|
|
90
|
+
onItemDelete: w,
|
|
86
91
|
onItemQtyChange: k,
|
|
87
|
-
onCheckout:
|
|
88
|
-
subtotal:
|
|
92
|
+
onCheckout: y,
|
|
93
|
+
subtotal: L,
|
|
89
94
|
contactHref: a,
|
|
90
|
-
|
|
91
|
-
itemPriceLabel: L
|
|
95
|
+
itemPriceLabel: x
|
|
92
96
|
}
|
|
93
97
|
),
|
|
94
|
-
/* @__PURE__ */ e(
|
|
95
|
-
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
|
|
96
|
-
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
|
|
97
|
-
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
|
|
98
|
-
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
|
|
99
|
-
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
|
|
100
|
-
n && n.map((
|
|
101
|
-
/* @__PURE__ */ e(
|
|
98
|
+
/* @__PURE__ */ e(P, { hideAt: ["lg"], children: /* @__PURE__ */ o("ul", { className: r.menuList, children: [
|
|
99
|
+
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(i, { href: h, children: "Make/Serial" }) }),
|
|
100
|
+
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(i, { href: d, children: "Custom Parts" }) }),
|
|
101
|
+
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(i, { href: a, children: "Contact Us" }) }),
|
|
102
|
+
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(i, { href: N, children: "FAQ" }) }),
|
|
103
|
+
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(i, { href: g, children: "About Us" }) }),
|
|
104
|
+
n && n.map((l) => /* @__PURE__ */ e("li", { className: r.category, children: /* @__PURE__ */ o(s, { href: l.route, children: [
|
|
105
|
+
/* @__PURE__ */ e(_, { size: "sm", weight: "semibold", children: l.label }),
|
|
102
106
|
/* @__PURE__ */ e(
|
|
103
|
-
|
|
107
|
+
U,
|
|
104
108
|
{
|
|
105
109
|
iconKey: "fa-solid fa-chevron-right",
|
|
106
110
|
title: "Navigate",
|
|
107
111
|
size: "sm"
|
|
108
112
|
}
|
|
109
113
|
)
|
|
110
|
-
] }) },
|
|
114
|
+
] }) }, l.id))
|
|
111
115
|
] }) })
|
|
112
116
|
]
|
|
113
117
|
}
|
|
@@ -115,17 +119,17 @@ function ae({
|
|
|
115
119
|
]
|
|
116
120
|
}
|
|
117
121
|
),
|
|
118
|
-
/* @__PURE__ */ e(t, { flexDirection: "row", hideAt: ["md", "lg"], children: /* @__PURE__ */ e(
|
|
119
|
-
/* @__PURE__ */ e(
|
|
122
|
+
/* @__PURE__ */ e(t, { flexDirection: "row", hideAt: ["md", "lg"], children: /* @__PURE__ */ e(p, { onSearch: f, inputName: "cpc-search", className: r.search }) }),
|
|
123
|
+
/* @__PURE__ */ e(K, { categories: n })
|
|
120
124
|
] }) });
|
|
121
|
-
}
|
|
122
|
-
function
|
|
123
|
-
href:
|
|
124
|
-
children:
|
|
125
|
-
...
|
|
125
|
+
});
|
|
126
|
+
function i({
|
|
127
|
+
href: m,
|
|
128
|
+
children: c,
|
|
129
|
+
...n
|
|
126
130
|
}) {
|
|
127
|
-
return /* @__PURE__ */ e(
|
|
131
|
+
return /* @__PURE__ */ e(s, { href: m, className: r.siteLink, ...n, children: /* @__PURE__ */ e(_, { size: "md", variant: "display", children: c }) });
|
|
128
132
|
}
|
|
129
133
|
export {
|
|
130
|
-
|
|
134
|
+
fe as MainNav
|
|
131
135
|
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
-
import { MainNav } from './MainNav';
|
|
3
2
|
declare const meta: {
|
|
4
3
|
title: string;
|
|
5
|
-
component:
|
|
4
|
+
component: import('react').ForwardRefExoticComponent<import('./MainNav').MainNavProps & import('react').RefAttributes<import('../../molecules/Cart/Cart').ShoppingCartHandle>>;
|
|
6
5
|
parameters: {
|
|
7
6
|
layout: string;
|
|
8
7
|
};
|