@caseparts-org/caseblocks 0.0.154 → 0.0.156
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-gkb4IOVS.js +19 -0
- package/dist/assets/Cart.css +1 -1
- package/dist/atoms/HorizontalScroll/HorizontalScroll.d.ts +2 -1
- package/dist/atoms/HorizontalScroll/HorizontalScroll.js +118 -110
- package/dist/atoms/HorizontalScroll/HorizontalScroll.stories.d.ts +1 -0
- package/dist/atoms/HorizontalScroll/HorizontalScroll.stories.js +59 -47
- package/dist/molecules/Cart/Cart.js +1 -1
- package/dist/molecules/Cart/CartSlideInPanel.js +51 -48
- package/package.json +1 -1
- package/dist/Cart.module-9txlotpz.js +0 -18
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import './assets/Cart.css';const t = "_cartIconButton_1dh0n_2", n = "_count_1dh0n_9", o = "_cartContainer_1dh0n_24", e = "_headerWrapper_1dh0n_35", _ = "_header_1dh0n_35", c = "_cartItems_1dh0n_53", a = "_topRow_1dh0n_78", r = "_itemInfo_1dh0n_84", s = "_purchaseInformation_1dh0n_89", h = "_itemManagement_1dh0n_96", m = "_removeItem_1dh0n_114", d = "_noItems_1dh0n_124", u = "_subtotal_1dh0n_131", I = "_checkoutButton_1dh0n_138", p = {
|
|
2
|
+
cartIconButton: t,
|
|
3
|
+
count: n,
|
|
4
|
+
cartContainer: o,
|
|
5
|
+
headerWrapper: e,
|
|
6
|
+
header: _,
|
|
7
|
+
cartItems: c,
|
|
8
|
+
topRow: a,
|
|
9
|
+
itemInfo: r,
|
|
10
|
+
purchaseInformation: s,
|
|
11
|
+
itemManagement: h,
|
|
12
|
+
removeItem: m,
|
|
13
|
+
noItems: d,
|
|
14
|
+
subtotal: u,
|
|
15
|
+
checkoutButton: I
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
p as s
|
|
19
|
+
};
|
package/dist/assets/Cart.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._cartIconButton_1dh0n_2{position:relative;border:none;padding:0;margin:0;background-color:transparent}._count_1dh0n_9{position:absolute;top:0;left:14px;border-radius:50%;width:18px;height:18px;display:flex;flex-direction:row;align-items:center;justify-content:center;background-color:var(--color-brand-primary-primary-tangerine);color:var(--color-neutrals-neutral-1);font-weight:var(--font-weight-semibold)}._cartContainer_1dh0n_24{height:100vh;width:100%;min-width:320px;max-width:375px;box-sizing:border-box;display:grid;grid-template-rows:auto 1fr auto auto;gap:var(--spacing-1);padding:var(--spacing-1)}._headerWrapper_1dh0n_35{display:flex;flex-direction:row;align-items:flex-start;gap:var(--spacing-spacing-2xs)}._headerWrapper_1dh0n_35>button{padding:0;margin:0;background-color:transparent;border:none}._header_1dh0n_35{display:flex;flex-direction:column;align-items:flex-start;width:100%}._cartItems_1dh0n_53{height:100%;overflow-y:auto;overflow-x:hidden}._cartItems_1dh0n_53 ul{margin:0;padding:0}._cartItems_1dh0n_53 li{display:grid;grid-template-columns:auto 1fr;gap:var(--spacing-0-5);align-items:center;box-sizing:border-box;position:relative;list-style:none;margin:0;padding:var(--spacing-0-5);width:100%;border-bottom:1px solid var(--color-neutrals-neutral-2)}._cartItems_1dh0n_53 li:first-of-type{border-top:1px solid var(--color-neutrals-neutral-2)}._topRow_1dh0n_78{display:flex;flex-direction:row;align-items:flex-start;justify-content:space-between}._itemInfo_1dh0n_84{display:flex;flex-direction:column;align-items:flex-start}._purchaseInformation_1dh0n_89{display:flex;flex-direction:row;align-items:flex-start;justify-content:space-between;width:100%}._itemManagement_1dh0n_96{display:flex;flex-direction:column;align-items:flex-end;gap:var(--spacing-spacing-3xs)}._cartItems_1dh0n_53 li p{margin:0;padding:0;word-wrap:break-word;white-space:normal;overflow-wrap:break-word}._cartItems_1dh0n_53 img{height:40px;width:40px;object-fit:contain}._removeItem_1dh0n_114{border:none;background-color:transparent;padding:0;margin:0;cursor:pointer;width:min-content;height:min-content}._noItems_1dh0n_124{display:flex;flex-direction:row;align-items:center;justify-content:center;height:100%}._subtotal_1dh0n_131{display:flex;flex-direction:row;align-items:center;justify-content:space-between;padding:var(--spacing-0-5)}._checkoutButton_1dh0n_138{width:100%}
|
|
@@ -13,6 +13,7 @@ export interface HorizontalScrollProps extends PropsWithChildren, HideAtProps {
|
|
|
13
13
|
headerClassName?: string;
|
|
14
14
|
showIndicators?: boolean;
|
|
15
15
|
hideHeader?: boolean;
|
|
16
|
+
wheelActivationDelay?: number;
|
|
16
17
|
}
|
|
17
18
|
export declare function HorizontalScroll({ className, childrenContainerClassName, childrenSpacing, showScrollbar, children, caption, scrollStep, leftButtonContent, rightButtonContent, headerContainerClassName, headerClassName, showIndicators, hideHeader, // new default
|
|
18
|
-
hideAt }: HorizontalScrollProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
wheelActivationDelay, hideAt }: HorizontalScrollProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,152 +1,160 @@
|
|
|
1
|
-
import { jsxs as d, jsx as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { Icon as
|
|
4
|
-
import { Text as
|
|
5
|
-
import { c as
|
|
6
|
-
import { getHideAtStyles as
|
|
7
|
-
import '../../assets/HorizontalScroll.css';const
|
|
8
|
-
root:
|
|
9
|
-
header:
|
|
10
|
-
caption:
|
|
11
|
-
controls:
|
|
12
|
-
controlBtn:
|
|
13
|
-
container:
|
|
14
|
-
dragging:
|
|
15
|
-
noOverflow:
|
|
1
|
+
import { jsxs as d, jsx as o, Fragment as U } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as _, useState as m, useEffect as b } from "react";
|
|
3
|
+
import { Icon as W } from "../Icon/Icon.js";
|
|
4
|
+
import { Text as $ } from "../Text/Text.js";
|
|
5
|
+
import { c as l } from "../../clsx-OuTLNxxd.js";
|
|
6
|
+
import { getHideAtStyles as J } from "../HideAt.js";
|
|
7
|
+
import '../../assets/HorizontalScroll.css';const Q = "_root_1565i_1", Z = "_header_1565i_5", ee = "_caption_1565i_13", te = "_controls_1565i_21", re = "_controlBtn_1565i_26", ne = "_container_1565i_45", oe = "_dragging_1565i_58", ie = "_noOverflow_1565i_61", le = "_viewport_1565i_74", ce = "_indicator_1565i_77", se = "_left_1565i_87", ae = "_right_1565i_93", de = "_hidden_1565i_99", t = {
|
|
8
|
+
root: Q,
|
|
9
|
+
header: Z,
|
|
10
|
+
caption: ee,
|
|
11
|
+
controls: te,
|
|
12
|
+
controlBtn: re,
|
|
13
|
+
container: ne,
|
|
14
|
+
dragging: oe,
|
|
15
|
+
noOverflow: ie,
|
|
16
16
|
"scrollVisibility--false": "_scrollVisibility--false_1565i_66",
|
|
17
|
-
viewport:
|
|
18
|
-
indicator:
|
|
19
|
-
left:
|
|
20
|
-
right:
|
|
21
|
-
hidden:
|
|
17
|
+
viewport: le,
|
|
18
|
+
indicator: ce,
|
|
19
|
+
left: se,
|
|
20
|
+
right: ae,
|
|
21
|
+
hidden: de
|
|
22
22
|
};
|
|
23
|
-
function
|
|
24
|
-
className:
|
|
25
|
-
childrenContainerClassName:
|
|
26
|
-
childrenSpacing:
|
|
27
|
-
showScrollbar:
|
|
28
|
-
children:
|
|
29
|
-
caption:
|
|
30
|
-
scrollStep:
|
|
31
|
-
leftButtonContent:
|
|
32
|
-
rightButtonContent:
|
|
33
|
-
headerContainerClassName:
|
|
34
|
-
headerClassName:
|
|
35
|
-
showIndicators:
|
|
36
|
-
hideHeader:
|
|
23
|
+
function be({
|
|
24
|
+
className: z,
|
|
25
|
+
childrenContainerClassName: A,
|
|
26
|
+
childrenSpacing: D,
|
|
27
|
+
showScrollbar: O = !1,
|
|
28
|
+
children: P,
|
|
29
|
+
caption: u,
|
|
30
|
+
scrollStep: L = 160,
|
|
31
|
+
leftButtonContent: B,
|
|
32
|
+
rightButtonContent: M,
|
|
33
|
+
headerContainerClassName: R,
|
|
34
|
+
headerClassName: X,
|
|
35
|
+
showIndicators: k = !0,
|
|
36
|
+
hideHeader: H = !1,
|
|
37
37
|
// new default
|
|
38
|
-
|
|
38
|
+
wheelActivationDelay: x = 250,
|
|
39
|
+
hideAt: T
|
|
39
40
|
}) {
|
|
40
|
-
const n =
|
|
41
|
-
const
|
|
42
|
-
if (!
|
|
43
|
-
const r =
|
|
44
|
-
|
|
45
|
-
},
|
|
46
|
-
!n.current || !s || (
|
|
47
|
-
},
|
|
48
|
-
if (!
|
|
49
|
-
const r =
|
|
50
|
-
n.current.scrollLeft = c.current.scroll - r, Math.abs(
|
|
41
|
+
const n = _(null), [E, w] = m(!1), c = _({ x: 0, scroll: 0 }), f = _(!1), h = _(null), V = 5, [g, Y] = m(!0), [p, j] = m(!1), [s, F] = m(!1), a = () => {
|
|
42
|
+
const e = n.current;
|
|
43
|
+
if (!e) return;
|
|
44
|
+
const r = e.scrollWidth - e.clientWidth;
|
|
45
|
+
F(e.scrollWidth > e.clientWidth + 1), Y(e.scrollLeft <= 0), j(e.scrollLeft >= r - 1);
|
|
46
|
+
}, K = (e) => {
|
|
47
|
+
!n.current || !s || (w(!0), c.current.x = e.clientX, c.current.scroll = n.current.scrollLeft, f.current = !1);
|
|
48
|
+
}, q = (e) => {
|
|
49
|
+
if (!E || !n.current) return;
|
|
50
|
+
const r = e.clientX - c.current.x;
|
|
51
|
+
n.current.scrollLeft = c.current.scroll - r, Math.abs(e.clientX - c.current.x) > V && (f.current = !0);
|
|
51
52
|
}, y = () => {
|
|
52
|
-
n.current &&
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
},
|
|
53
|
+
n.current && w(!1);
|
|
54
|
+
}, G = (e) => {
|
|
55
|
+
f.current && (e.preventDefault(), e.stopPropagation(), f.current = !1);
|
|
56
|
+
}, S = (e) => {
|
|
56
57
|
const r = n.current;
|
|
57
58
|
if (!r) return;
|
|
58
|
-
const
|
|
59
|
-
r.scrollTo({ left:
|
|
59
|
+
const v = Math.max(0, Math.min(r.scrollLeft + e, r.scrollWidth - r.clientWidth));
|
|
60
|
+
r.scrollTo({ left: v, behavior: "smooth" }), requestAnimationFrame(a);
|
|
60
61
|
};
|
|
61
|
-
|
|
62
|
-
const
|
|
63
|
-
if (!
|
|
64
|
-
const r = (
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
62
|
+
b(() => {
|
|
63
|
+
const e = n.current;
|
|
64
|
+
if (!e) return;
|
|
65
|
+
const r = () => {
|
|
66
|
+
h.current = performance.now();
|
|
67
|
+
}, v = () => {
|
|
68
|
+
h.current = null;
|
|
69
|
+
}, N = (i) => {
|
|
70
|
+
if (!(e.scrollWidth > e.clientWidth) || (h.current == null ? 0 : performance.now() - h.current) < x)
|
|
71
|
+
return;
|
|
72
|
+
const C = Math.abs(i.deltaY) >= Math.abs(i.deltaX) && i.deltaY !== 0 ? i.deltaY : i.deltaX;
|
|
73
|
+
C !== 0 ? (i.preventDefault(), e.scrollLeft += C) : i.preventDefault();
|
|
68
74
|
};
|
|
69
|
-
return
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
return e.addEventListener("pointerenter", r), e.addEventListener("pointerleave", v), e.addEventListener("wheel", N, { passive: !1 }), () => {
|
|
76
|
+
e.removeEventListener("pointerenter", r), e.removeEventListener("pointerleave", v), e.removeEventListener("wheel", N);
|
|
77
|
+
};
|
|
78
|
+
}, [x]), b(() => {
|
|
79
|
+
const e = n.current;
|
|
80
|
+
if (e)
|
|
81
|
+
return a(), e.addEventListener("scroll", a), () => e.removeEventListener("scroll", a);
|
|
82
|
+
}, []), b(() => {
|
|
83
|
+
const e = n.current;
|
|
84
|
+
if (!e || typeof ResizeObserver > "u") return;
|
|
77
85
|
const r = new ResizeObserver(() => a());
|
|
78
|
-
return r.observe(
|
|
86
|
+
return r.observe(e), () => r.disconnect();
|
|
79
87
|
}, []);
|
|
80
|
-
const
|
|
81
|
-
return /* @__PURE__ */ d("div", { className:
|
|
82
|
-
!
|
|
83
|
-
|
|
84
|
-
s && /* @__PURE__ */ d("div", { className:
|
|
85
|
-
/* @__PURE__ */
|
|
88
|
+
const I = () => u == null ? null : typeof u == "string" ? /* @__PURE__ */ o($, { variant: "display", size: "2xl", className: l(X, t.caption), children: u }) : u;
|
|
89
|
+
return /* @__PURE__ */ d("div", { className: l(t.root, z, J(T)), children: [
|
|
90
|
+
!H && /* @__PURE__ */ d("div", { className: l(R, t.header), children: [
|
|
91
|
+
I(),
|
|
92
|
+
s && /* @__PURE__ */ d("div", { className: t.controls, children: [
|
|
93
|
+
/* @__PURE__ */ o(
|
|
86
94
|
"button",
|
|
87
95
|
{
|
|
88
96
|
type: "button",
|
|
89
|
-
className:
|
|
90
|
-
onClick: () =>
|
|
97
|
+
className: t.controlBtn,
|
|
98
|
+
onClick: () => S(-L),
|
|
91
99
|
"aria-label": "Scroll left",
|
|
92
|
-
disabled:
|
|
93
|
-
"aria-disabled":
|
|
94
|
-
children:
|
|
100
|
+
disabled: g,
|
|
101
|
+
"aria-disabled": g,
|
|
102
|
+
children: B ?? /* @__PURE__ */ o(W, { iconKey: "fa-regular fa-chevron-left", size: "sm" })
|
|
95
103
|
}
|
|
96
104
|
),
|
|
97
|
-
/* @__PURE__ */
|
|
105
|
+
/* @__PURE__ */ o(
|
|
98
106
|
"button",
|
|
99
107
|
{
|
|
100
108
|
type: "button",
|
|
101
|
-
className:
|
|
102
|
-
onClick: () =>
|
|
109
|
+
className: t.controlBtn,
|
|
110
|
+
onClick: () => S(L),
|
|
103
111
|
"aria-label": "Scroll right",
|
|
104
|
-
disabled:
|
|
105
|
-
"aria-disabled":
|
|
106
|
-
children:
|
|
112
|
+
disabled: p,
|
|
113
|
+
"aria-disabled": p,
|
|
114
|
+
children: M ?? /* @__PURE__ */ o(W, { iconKey: "fa-regular fa-chevron-right", size: "sm" })
|
|
107
115
|
}
|
|
108
116
|
)
|
|
109
117
|
] })
|
|
110
118
|
] }),
|
|
111
|
-
/* @__PURE__ */ d("div", { className:
|
|
112
|
-
/* @__PURE__ */
|
|
119
|
+
/* @__PURE__ */ d("div", { className: t.viewport, children: [
|
|
120
|
+
/* @__PURE__ */ o(
|
|
113
121
|
"div",
|
|
114
122
|
{
|
|
115
123
|
ref: n,
|
|
116
|
-
style: { gap:
|
|
117
|
-
className:
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
!s &&
|
|
122
|
-
|
|
124
|
+
style: { gap: D ?? "var(--spacing-spacing-3xs)" },
|
|
125
|
+
className: l(
|
|
126
|
+
t.container,
|
|
127
|
+
t[`scrollVisibility--${O}`],
|
|
128
|
+
E ? t.dragging : "",
|
|
129
|
+
!s && t.noOverflow,
|
|
130
|
+
A
|
|
123
131
|
),
|
|
124
|
-
onPointerDown:
|
|
125
|
-
onPointerMove:
|
|
132
|
+
onPointerDown: K,
|
|
133
|
+
onPointerMove: q,
|
|
126
134
|
onPointerLeave: y,
|
|
127
135
|
onPointerUp: y,
|
|
128
|
-
onClickCapture:
|
|
129
|
-
children:
|
|
136
|
+
onClickCapture: G,
|
|
137
|
+
children: P
|
|
130
138
|
}
|
|
131
139
|
),
|
|
132
|
-
|
|
133
|
-
/* @__PURE__ */
|
|
140
|
+
k && /* @__PURE__ */ d(U, { children: [
|
|
141
|
+
/* @__PURE__ */ o(
|
|
134
142
|
"div",
|
|
135
143
|
{
|
|
136
|
-
className:
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
(
|
|
144
|
+
className: l(
|
|
145
|
+
t.indicator,
|
|
146
|
+
t.left,
|
|
147
|
+
(g || !s) && t.hidden
|
|
140
148
|
)
|
|
141
149
|
}
|
|
142
150
|
),
|
|
143
|
-
/* @__PURE__ */
|
|
151
|
+
/* @__PURE__ */ o(
|
|
144
152
|
"div",
|
|
145
153
|
{
|
|
146
|
-
className:
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
(
|
|
154
|
+
className: l(
|
|
155
|
+
t.indicator,
|
|
156
|
+
t.right,
|
|
157
|
+
(p || !s) && t.hidden
|
|
150
158
|
)
|
|
151
159
|
}
|
|
152
160
|
)
|
|
@@ -155,5 +163,5 @@ function _t({
|
|
|
155
163
|
] });
|
|
156
164
|
}
|
|
157
165
|
export {
|
|
158
|
-
|
|
166
|
+
be as HorizontalScroll
|
|
159
167
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { HorizontalScroll as
|
|
3
|
-
const
|
|
1
|
+
import { jsxs as r, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { HorizontalScroll as i } from "./HorizontalScroll.js";
|
|
3
|
+
const g = {
|
|
4
4
|
title: "Case Parts/Atoms/HorizontalScroll",
|
|
5
|
-
component:
|
|
5
|
+
component: i,
|
|
6
6
|
tags: ["autodocs"],
|
|
7
7
|
parameters: {
|
|
8
8
|
layout: "fullscreen",
|
|
@@ -14,6 +14,7 @@ A drag + wheel enabled horizontal scrolling container.
|
|
|
14
14
|
Features:
|
|
15
15
|
- Pointer drag (mouse / touch) horizontal scrolling.
|
|
16
16
|
- Converts vertical mouse wheel motion to horizontal scrolling.
|
|
17
|
+
- Small hover delay before wheel is captured for horizontal scrolling.
|
|
17
18
|
- Optional native scrollbar visibility via showScrollbar.
|
|
18
19
|
|
|
19
20
|
Use for carousels, chip lists, card rails, horizontally overflowing panels.
|
|
@@ -57,6 +58,10 @@ Use for carousels, chip lists, card rails, horizontally overflowing panels.
|
|
|
57
58
|
childrenSpacing: {
|
|
58
59
|
control: { type: "number", min: 0, max: 64, step: 2 },
|
|
59
60
|
description: "Gap between direct children (flex gap)."
|
|
61
|
+
},
|
|
62
|
+
wheelActivationDelay: {
|
|
63
|
+
control: { type: "number", min: 0, max: 1e3, step: 25 },
|
|
64
|
+
description: "Delay (ms) before mouse wheel is captured for horizontal scroll after hover."
|
|
60
65
|
}
|
|
61
66
|
},
|
|
62
67
|
args: {
|
|
@@ -70,19 +75,20 @@ Use for carousels, chip lists, card rails, horizontally overflowing panels.
|
|
|
70
75
|
// new default
|
|
71
76
|
hideHeader: !1,
|
|
72
77
|
// new default
|
|
73
|
-
childrenSpacing: 12
|
|
78
|
+
childrenSpacing: 12,
|
|
74
79
|
// new default
|
|
80
|
+
wheelActivationDelay: 250
|
|
75
81
|
}
|
|
76
|
-
},
|
|
82
|
+
}, t = /* @__PURE__ */ o("style", { children: `
|
|
77
83
|
.horizontalDemoScroll {
|
|
78
84
|
touch-action: none; /* ensure pointer events for horizontal drag */
|
|
79
85
|
}
|
|
80
86
|
.horizontalDemoScroll a {
|
|
81
87
|
-webkit-user-drag: none; /* Safari/Chrome: prevent ghost dragging of link */
|
|
82
88
|
}
|
|
83
|
-
` }),
|
|
84
|
-
const { itemCount:
|
|
85
|
-
return Array.from({ length:
|
|
89
|
+
` }), n = (e) => {
|
|
90
|
+
const { itemCount: c, itemWidth: d, itemHeight: l, rounded: h, gradient: s } = e;
|
|
91
|
+
return Array.from({ length: c }, (p, m) => {
|
|
86
92
|
const a = m + 1;
|
|
87
93
|
return /* @__PURE__ */ o(
|
|
88
94
|
"a",
|
|
@@ -91,10 +97,10 @@ Use for carousels, chip lists, card rails, horizontally overflowing panels.
|
|
|
91
97
|
draggable: !1,
|
|
92
98
|
style: {
|
|
93
99
|
flex: "0 0 auto",
|
|
94
|
-
width:
|
|
100
|
+
width: d,
|
|
95
101
|
height: l,
|
|
96
|
-
borderRadius:
|
|
97
|
-
background:
|
|
102
|
+
borderRadius: h ? 8 : 0,
|
|
103
|
+
background: s ? "linear-gradient(135deg,#4F46E5,#6366F1)" : "#4F46E5",
|
|
98
104
|
color: "#fff",
|
|
99
105
|
display: "flex",
|
|
100
106
|
alignItems: "center",
|
|
@@ -109,63 +115,66 @@ Use for carousels, chip lists, card rails, horizontally overflowing panels.
|
|
|
109
115
|
a
|
|
110
116
|
);
|
|
111
117
|
});
|
|
112
|
-
},
|
|
118
|
+
}, S = {
|
|
113
119
|
name: "Playground",
|
|
114
|
-
render: (e) => /* @__PURE__ */
|
|
115
|
-
|
|
120
|
+
render: (e) => /* @__PURE__ */ r("div", { style: { padding: 24 }, children: [
|
|
121
|
+
t,
|
|
116
122
|
/* @__PURE__ */ o("h3", { style: { margin: "0 0 12px" }, children: "HorizontalScroll Playground" }),
|
|
117
123
|
/* @__PURE__ */ o("p", { style: { margin: "0 0 16px", fontSize: 14, color: "#555" }, children: "Drag horizontally or use the mouse wheel. Tweak values in Controls." }),
|
|
118
124
|
/* @__PURE__ */ o(
|
|
119
|
-
|
|
125
|
+
i,
|
|
120
126
|
{
|
|
121
127
|
className: "horizontalDemoScroll",
|
|
122
128
|
showScrollbar: e.showScrollbar,
|
|
123
129
|
showIndicators: e.showIndicators,
|
|
124
130
|
hideHeader: e.hideHeader,
|
|
125
131
|
childrenSpacing: e.childrenSpacing,
|
|
132
|
+
wheelActivationDelay: e.wheelActivationDelay,
|
|
126
133
|
caption: `Playground (${e.itemCount} items)`,
|
|
127
|
-
children:
|
|
134
|
+
children: n(e)
|
|
128
135
|
}
|
|
129
136
|
)
|
|
130
137
|
] })
|
|
131
|
-
},
|
|
138
|
+
}, y = {
|
|
132
139
|
args: { showScrollbar: !0 },
|
|
133
|
-
render: (e) => /* @__PURE__ */
|
|
134
|
-
|
|
140
|
+
render: (e) => /* @__PURE__ */ r("div", { style: { padding: 24 }, children: [
|
|
141
|
+
t,
|
|
135
142
|
/* @__PURE__ */ o("h3", { style: { margin: "0 0 12px" }, children: "Scrollbar Visible" }),
|
|
136
143
|
/* @__PURE__ */ o(
|
|
137
|
-
|
|
144
|
+
i,
|
|
138
145
|
{
|
|
139
146
|
className: "horizontalDemoScroll",
|
|
140
147
|
showScrollbar: !0,
|
|
141
148
|
showIndicators: e.showIndicators,
|
|
142
149
|
hideHeader: e.hideHeader,
|
|
143
150
|
childrenSpacing: e.childrenSpacing,
|
|
151
|
+
wheelActivationDelay: e.wheelActivationDelay,
|
|
144
152
|
caption: "Scrollbar Visible",
|
|
145
|
-
children:
|
|
153
|
+
children: n(e)
|
|
146
154
|
}
|
|
147
155
|
)
|
|
148
156
|
] })
|
|
149
|
-
},
|
|
157
|
+
}, b = {
|
|
150
158
|
args: {
|
|
151
159
|
itemCount: 40,
|
|
152
160
|
itemWidth: 90,
|
|
153
161
|
itemHeight: 60,
|
|
154
162
|
showScrollbar: !1
|
|
155
163
|
},
|
|
156
|
-
render: (e) => /* @__PURE__ */
|
|
157
|
-
|
|
164
|
+
render: (e) => /* @__PURE__ */ r("div", { style: { padding: 24 }, children: [
|
|
165
|
+
t,
|
|
158
166
|
/* @__PURE__ */ o("h3", { style: { margin: "0 0 12px" }, children: "Dense Small Items" }),
|
|
159
167
|
/* @__PURE__ */ o(
|
|
160
|
-
|
|
168
|
+
i,
|
|
161
169
|
{
|
|
162
170
|
className: "horizontalDemoScroll",
|
|
163
171
|
showScrollbar: e.showScrollbar,
|
|
164
172
|
showIndicators: e.showIndicators,
|
|
165
173
|
hideHeader: e.hideHeader,
|
|
166
174
|
childrenSpacing: e.childrenSpacing,
|
|
175
|
+
wheelActivationDelay: e.wheelActivationDelay,
|
|
167
176
|
caption: `Dense (${e.itemCount} items)`,
|
|
168
|
-
children:
|
|
177
|
+
children: n(e)
|
|
169
178
|
}
|
|
170
179
|
)
|
|
171
180
|
] })
|
|
@@ -176,23 +185,24 @@ Use for carousels, chip lists, card rails, horizontally overflowing panels.
|
|
|
176
185
|
itemHeight: 160,
|
|
177
186
|
gradient: !1
|
|
178
187
|
},
|
|
179
|
-
render: (e) => /* @__PURE__ */
|
|
180
|
-
|
|
188
|
+
render: (e) => /* @__PURE__ */ r("div", { style: { padding: 24 }, children: [
|
|
189
|
+
t,
|
|
181
190
|
/* @__PURE__ */ o("h3", { style: { margin: "0 0 12px" }, children: "Large Cards" }),
|
|
182
191
|
/* @__PURE__ */ o(
|
|
183
|
-
|
|
192
|
+
i,
|
|
184
193
|
{
|
|
185
194
|
className: "horizontalDemoScroll",
|
|
186
195
|
showScrollbar: e.showScrollbar,
|
|
187
196
|
showIndicators: e.showIndicators,
|
|
188
197
|
hideHeader: e.hideHeader,
|
|
189
198
|
childrenSpacing: e.childrenSpacing,
|
|
199
|
+
wheelActivationDelay: e.wheelActivationDelay,
|
|
190
200
|
caption: "Large Cards",
|
|
191
|
-
children:
|
|
201
|
+
children: n(e)
|
|
192
202
|
}
|
|
193
203
|
)
|
|
194
204
|
] })
|
|
195
|
-
},
|
|
205
|
+
}, v = {
|
|
196
206
|
name: "Without Indicators",
|
|
197
207
|
args: {
|
|
198
208
|
showIndicators: !1,
|
|
@@ -201,23 +211,24 @@ Use for carousels, chip lists, card rails, horizontally overflowing panels.
|
|
|
201
211
|
itemHeight: 72,
|
|
202
212
|
childrenSpacing: 12
|
|
203
213
|
},
|
|
204
|
-
render: (e) => /* @__PURE__ */
|
|
205
|
-
|
|
214
|
+
render: (e) => /* @__PURE__ */ r("div", { style: { padding: 24 }, children: [
|
|
215
|
+
t,
|
|
206
216
|
/* @__PURE__ */ o("h3", { style: { margin: "0 0 12px" }, children: "Indicators Disabled" }),
|
|
207
217
|
/* @__PURE__ */ o(
|
|
208
|
-
|
|
218
|
+
i,
|
|
209
219
|
{
|
|
210
220
|
className: "horizontalDemoScroll",
|
|
211
221
|
showScrollbar: e.showScrollbar,
|
|
212
222
|
showIndicators: !1,
|
|
213
223
|
hideHeader: e.hideHeader,
|
|
214
224
|
childrenSpacing: e.childrenSpacing,
|
|
225
|
+
wheelActivationDelay: e.wheelActivationDelay,
|
|
215
226
|
caption: "No Edge Indicators",
|
|
216
|
-
children:
|
|
227
|
+
children: n(e)
|
|
217
228
|
}
|
|
218
229
|
)
|
|
219
230
|
] })
|
|
220
|
-
},
|
|
231
|
+
}, H = {
|
|
221
232
|
name: "Header Hidden",
|
|
222
233
|
args: {
|
|
223
234
|
hideHeader: !0,
|
|
@@ -226,29 +237,30 @@ Use for carousels, chip lists, card rails, horizontally overflowing panels.
|
|
|
226
237
|
itemHeight: 70,
|
|
227
238
|
showIndicators: !0
|
|
228
239
|
},
|
|
229
|
-
render: (e) => /* @__PURE__ */
|
|
230
|
-
|
|
240
|
+
render: (e) => /* @__PURE__ */ r("div", { style: { padding: 24 }, children: [
|
|
241
|
+
t,
|
|
231
242
|
/* @__PURE__ */ o("h3", { style: { margin: "0 0 12px" }, children: "Header Hidden" }),
|
|
232
243
|
/* @__PURE__ */ o(
|
|
233
|
-
|
|
244
|
+
i,
|
|
234
245
|
{
|
|
235
246
|
className: "horizontalDemoScroll",
|
|
236
247
|
showScrollbar: e.showScrollbar,
|
|
237
248
|
showIndicators: e.showIndicators,
|
|
238
249
|
hideHeader: !0,
|
|
239
250
|
childrenSpacing: e.childrenSpacing,
|
|
251
|
+
wheelActivationDelay: e.wheelActivationDelay,
|
|
240
252
|
caption: "(Will not render since header hidden)",
|
|
241
|
-
children:
|
|
253
|
+
children: n(e)
|
|
242
254
|
}
|
|
243
255
|
)
|
|
244
256
|
] })
|
|
245
257
|
};
|
|
246
258
|
export {
|
|
247
|
-
|
|
248
|
-
|
|
259
|
+
b as DenseSmallItems,
|
|
260
|
+
H as HeaderHidden,
|
|
249
261
|
f as LargeCards,
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
262
|
+
S as Playground,
|
|
263
|
+
y as WithScrollbar,
|
|
264
|
+
v as WithoutIndicators,
|
|
265
|
+
g as default
|
|
254
266
|
};
|
|
@@ -2,7 +2,7 @@ import { jsx as a, jsxs as d } from "react/jsx-runtime";
|
|
|
2
2
|
import l from "react";
|
|
3
3
|
import { Icon as g } from "../../atoms/Icon/Icon.js";
|
|
4
4
|
import { Text as p } from "../../atoms/Text/Text.js";
|
|
5
|
-
import { s as m } from "../../Cart.module-
|
|
5
|
+
import { s as m } from "../../Cart.module-gkb4IOVS.js";
|
|
6
6
|
const S = l.forwardRef(function({
|
|
7
7
|
cart: i,
|
|
8
8
|
open: t = !1,
|
|
@@ -1,86 +1,89 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { SlideInPanel as
|
|
1
|
+
import { jsx as e, jsxs as a } from "react/jsx-runtime";
|
|
2
|
+
import { SlideInPanel as y } from "../../atoms/SlideInPanel/SlideInPanel.js";
|
|
3
3
|
import { Text as n } from "../../atoms/Text/Text.js";
|
|
4
|
-
import { Link as
|
|
5
|
-
import { Button as
|
|
6
|
-
import { Pricing as
|
|
7
|
-
import { QuantityInput as
|
|
8
|
-
import { Availability as
|
|
9
|
-
import { Icon as
|
|
10
|
-
import { s as r } from "../../Cart.module-
|
|
4
|
+
import { Link as I } from "../../atoms/Link/Link.js";
|
|
5
|
+
import { Button as b } from "../../atoms/Button/Button.js";
|
|
6
|
+
import { Pricing as N } from "../Pricing/Pricing.js";
|
|
7
|
+
import { QuantityInput as z } from "../QuantityInput/QuantityInput.js";
|
|
8
|
+
import { Availability as k } from "../Availability/Availability.js";
|
|
9
|
+
import { Icon as c } from "../../atoms/Icon/Icon.js";
|
|
10
|
+
import { s as r } from "../../Cart.module-gkb4IOVS.js";
|
|
11
11
|
function H({
|
|
12
|
-
open:
|
|
13
|
-
onClose:
|
|
14
|
-
cart:
|
|
15
|
-
subtotal:
|
|
16
|
-
itemPriceLabel:
|
|
17
|
-
contactHref:
|
|
18
|
-
contactLinkBehavior:
|
|
19
|
-
onItemQtyChange:
|
|
20
|
-
onItemDelete:
|
|
12
|
+
open: o,
|
|
13
|
+
onClose: l,
|
|
14
|
+
cart: t,
|
|
15
|
+
subtotal: m,
|
|
16
|
+
itemPriceLabel: d,
|
|
17
|
+
contactHref: h,
|
|
18
|
+
contactLinkBehavior: p,
|
|
19
|
+
onItemQtyChange: u,
|
|
20
|
+
onItemDelete: f,
|
|
21
21
|
onCheckout: v
|
|
22
22
|
}) {
|
|
23
23
|
var s;
|
|
24
|
-
return
|
|
25
|
-
|
|
24
|
+
return t = t || { items: [] }, /* @__PURE__ */ e(
|
|
25
|
+
y,
|
|
26
26
|
{
|
|
27
27
|
side: "right",
|
|
28
|
-
open:
|
|
29
|
-
onClose:
|
|
28
|
+
open: o,
|
|
29
|
+
onClose: l,
|
|
30
30
|
ariaLabel: "Shopping Cart",
|
|
31
|
-
children: /* @__PURE__ */
|
|
32
|
-
/* @__PURE__ */
|
|
33
|
-
/* @__PURE__ */
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
children: /* @__PURE__ */ a("div", { id: "cart-panel", className: r.cartContainer, children: [
|
|
32
|
+
/* @__PURE__ */ a("div", { className: r.headerWrapper, children: [
|
|
33
|
+
/* @__PURE__ */ a("div", { className: r.header, children: [
|
|
34
|
+
/* @__PURE__ */ e(n, { size: "2xl", children: "Cart" }),
|
|
35
|
+
/* @__PURE__ */ a(n, { size: "xs", colorToken: "quaternary", children: [
|
|
36
|
+
(s = t == null ? void 0 : t.items) == null ? void 0 : s.length,
|
|
37
|
+
" items in your cart"
|
|
38
|
+
] })
|
|
39
|
+
] }),
|
|
40
|
+
/* @__PURE__ */ e("button", { onClick: l, children: /* @__PURE__ */ e(c, { iconKey: "fa-regular fa-xmark", size: "md" }) })
|
|
38
41
|
] }),
|
|
39
|
-
/* @__PURE__ */ e("div", { className: r.cartItems, children:
|
|
42
|
+
/* @__PURE__ */ e("div", { className: r.cartItems, children: t.items.length > 0 ? /* @__PURE__ */ e("ul", { children: t.items.map((i) => /* @__PURE__ */ a("li", { className: r.cartItem, children: [
|
|
40
43
|
/* @__PURE__ */ e("img", { src: i.imageUrl, alt: `${i.itemId} product image` }),
|
|
41
|
-
/* @__PURE__ */
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
-
/* @__PURE__ */ e(n, { size: "sm", weight: "semibold", children: /* @__PURE__ */ e(
|
|
45
|
-
/* @__PURE__ */
|
|
44
|
+
/* @__PURE__ */ a("div", { children: [
|
|
45
|
+
/* @__PURE__ */ a("div", { className: r.topRow, children: [
|
|
46
|
+
/* @__PURE__ */ a("div", { className: r.itemInfo, children: [
|
|
47
|
+
/* @__PURE__ */ e(n, { size: "sm", weight: "semibold", children: /* @__PURE__ */ e(I, { href: i.itemHref || `/part/${i.itemId}`, children: i.description }) }),
|
|
48
|
+
/* @__PURE__ */ a(n, { size: "sm", children: [
|
|
46
49
|
/* @__PURE__ */ e(n, { colorToken: "quaternary", size: "xs", children: i.custom ? "Specs " : "Part # " }),
|
|
47
50
|
i.itemId
|
|
48
51
|
] })
|
|
49
52
|
] }),
|
|
50
|
-
/* @__PURE__ */ e("button", { onClick: () =>
|
|
53
|
+
/* @__PURE__ */ e("button", { onClick: () => f(i), className: r.removeItem, "aria-label": "Remove item", children: /* @__PURE__ */ e(c, { iconKey: "fa-regular fa-trash", size: "sm" }) })
|
|
51
54
|
] }),
|
|
52
|
-
/* @__PURE__ */
|
|
53
|
-
/* @__PURE__ */
|
|
55
|
+
/* @__PURE__ */ a("div", { className: r.itemManagement, children: [
|
|
56
|
+
/* @__PURE__ */ a("div", { className: r.purchaseInformation, children: [
|
|
54
57
|
/* @__PURE__ */ e(
|
|
55
|
-
|
|
58
|
+
k,
|
|
56
59
|
{
|
|
57
60
|
availId: i.availabilityId || "",
|
|
58
61
|
availDescription: i.availability || "",
|
|
59
|
-
contactHref:
|
|
60
|
-
contactLinkBehavior:
|
|
62
|
+
contactHref: h || "",
|
|
63
|
+
contactLinkBehavior: p || "new-tab"
|
|
61
64
|
}
|
|
62
65
|
),
|
|
63
|
-
/* @__PURE__ */ e(
|
|
66
|
+
/* @__PURE__ */ e(N, { pricingLabel: d || "List Price", price: i.price })
|
|
64
67
|
] }),
|
|
65
68
|
/* @__PURE__ */ e(
|
|
66
|
-
|
|
69
|
+
z,
|
|
67
70
|
{
|
|
68
71
|
quantity: i.quantity,
|
|
69
|
-
onQuantityChange: (
|
|
72
|
+
onQuantityChange: (g) => u(i, g),
|
|
70
73
|
size: "sm"
|
|
71
74
|
}
|
|
72
75
|
)
|
|
73
76
|
] })
|
|
74
77
|
] })
|
|
75
78
|
] }, i.id)) }) : /* @__PURE__ */ e("div", { className: r.noItems, children: /* @__PURE__ */ e(n, { as: "p", size: "sm", children: "No items in your cart yet" }) }) }),
|
|
76
|
-
|
|
79
|
+
m && /* @__PURE__ */ a("div", { className: r.subtotal, children: [
|
|
77
80
|
/* @__PURE__ */ e(n, { size: "md", weight: "semibold", children: "Subtotal" }),
|
|
78
|
-
/* @__PURE__ */ e(n, { size: "md", weight: "semibold", children:
|
|
81
|
+
/* @__PURE__ */ e(n, { size: "md", weight: "semibold", children: m })
|
|
79
82
|
] }),
|
|
80
83
|
/* @__PURE__ */ e(
|
|
81
|
-
|
|
84
|
+
b,
|
|
82
85
|
{
|
|
83
|
-
disabled:
|
|
86
|
+
disabled: t.items.length === 0,
|
|
84
87
|
onClick: v,
|
|
85
88
|
variant: "cta-primary",
|
|
86
89
|
size: "md",
|
package/package.json
CHANGED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import './assets/Cart.css';const t = "_cartIconButton_pkqoj_2", o = "_count_pkqoj_9", n = "_cartContainer_pkqoj_24", e = "_header_pkqoj_35", _ = "_cartItems_pkqoj_40", c = "_topRow_pkqoj_65", a = "_itemInfo_pkqoj_71", s = "_purchaseInformation_pkqoj_76", r = "_itemManagement_pkqoj_83", m = "_removeItem_pkqoj_101", p = "_noItems_pkqoj_111", u = "_subtotal_pkqoj_118", I = "_checkoutButton_pkqoj_125", k = {
|
|
2
|
-
cartIconButton: t,
|
|
3
|
-
count: o,
|
|
4
|
-
cartContainer: n,
|
|
5
|
-
header: e,
|
|
6
|
-
cartItems: _,
|
|
7
|
-
topRow: c,
|
|
8
|
-
itemInfo: a,
|
|
9
|
-
purchaseInformation: s,
|
|
10
|
-
itemManagement: r,
|
|
11
|
-
removeItem: m,
|
|
12
|
-
noItems: p,
|
|
13
|
-
subtotal: u,
|
|
14
|
-
checkoutButton: I
|
|
15
|
-
};
|
|
16
|
-
export {
|
|
17
|
-
k as s
|
|
18
|
-
};
|