@caseparts-org/caseblocks 0.0.97 → 0.0.99
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/Breadcrumbs.css +1 -0
- package/dist/assets/HorizontalScroll.css +1 -1
- package/dist/assets/Product.css +1 -1
- package/dist/atoms/HorizontalScroll/HorizontalScroll.d.ts +9 -2
- package/dist/atoms/HorizontalScroll/HorizontalScroll.js +141 -45
- package/dist/atoms/HorizontalScroll/HorizontalScroll.stories.d.ts +4 -0
- package/dist/atoms/HorizontalScroll/HorizontalScroll.stories.js +132 -29
- package/dist/main-client.d.ts +2 -1
- package/dist/main-client.js +47 -45
- package/dist/main-server.d.ts +2 -0
- package/dist/main-server.js +17 -15
- package/dist/main.d.ts +0 -1
- package/dist/molecules/Breadcrumbs/Breadcrumbs.d.ts +9 -0
- package/dist/molecules/Breadcrumbs/Breadcrumbs.js +29 -0
- package/dist/molecules/Breadcrumbs/Breadcrumbs.stories.d.ts +32 -0
- package/dist/molecules/Breadcrumbs/Breadcrumbs.stories.js +69 -0
- package/dist/molecules/CategoryNav/CategoryNav.d.ts +3 -3
- package/dist/molecules/CategoryNav/CategoryNav.js +4 -2
- package/dist/organisms/MainNav/MainNav.d.ts +2 -10
- package/dist/organisms/MainNav/MainNav.stories.js +33 -18
- package/dist/organisms/Product/Product.js +46 -46
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._nav_5oobe_1{display:flex;flex-direction:row;align-items:center;flex-wrap:wrap}._crumb_5oobe_8{color:var(--color-brand-primary-primary-teal-blue);font-size:var(--font-size-xs)}._final_5oobe_13{pointer-events:none;color:#333}._nav_5oobe_1>span{padding:0 4px;font-size:var(--font-size-xs)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._root_1bnow_1{width:100%}._header_1bnow_5{display:flex;align-items:center;justify-content:space-between;width:100%;gap:var(--spacing-spacing-2xs);margin-bottom:var(--spacing-spacing-2xs)}._controls_1bnow_13{display:flex;align-items:center;gap:var(--spacing-spacing-2xs)}._controlBtn_1bnow_18{cursor:pointer;padding:var(--spacing-spacing-3xs);border:none;background-color:transparent;line-height:1;display:flex;align-items:center;justify-content:center}._controlBtn_1bnow_18:hover{color:var(--color-brand-primary-primary-teal-blue)}._controlBtn_1bnow_18:disabled:hover{cursor:default;color:var(--color-neutrals-neutral-3)}._container_1bnow_37{display:flex;flex-direction:row;align-items:center;flex-wrap:nowrap;overflow-x:auto;width:100%;-webkit-overflow-scrolling:touch;cursor:grab;-webkit-user-select:none;user-select:none;overscroll-behavior:contain;touch-action:pan-x}._dragging_1bnow_50{cursor:grabbing}._noOverflow_1bnow_53{cursor:default}._scrollVisibility--false_1bnow_58{scrollbar-width:none;-ms-overflow-style:none}._scrollVisibility--false_1bnow_58::-webkit-scrollbar{display:none}._viewport_1bnow_66{position:relative}._indicator_1bnow_69{position:absolute;top:0;bottom:0;width:48px;pointer-events:none;opacity:1;transition:opacity .25s;z-index:1}._left_1bnow_79{left:0;background:linear-gradient(to right,var(--horizontal-scroll-indicator-color, rgba(0,0,0,.15)) 0%,rgba(0,0,0,0) 100%)}._right_1bnow_85{right:0;background:linear-gradient(to left,var(--horizontal-scroll-indicator-color, rgba(0,0,0,.15)) 0%,rgba(0,0,0,0) 100%)}._hidden_1bnow_91{opacity:0}
|
package/dist/assets/Product.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._productCard_15dy7_1{box-sizing:border-box;border:1px solid var(--border-border-primary, #DFDFDF);background:var(--surface-surface-primary, #FFF);box-shadow:2px 4px 12px #00000026;display:flex;width:232px;height:296px;padding:var(--spacing-spacing-default, 16px) var(--spacing-spacing-sm, 20px);flex-direction:column;align-items:flex-start;gap:var(--spacing-spacing-2xs)}._productCard_15dy7_1>img{width:96px;height:96px;object-fit:contain;flex-shrink:0;margin:0 auto}._productCard_15dy7_1 ._productInformation_15dy7_22{display:flex;flex-direction:column;align-items:flex-start;gap:2px;margin-top:auto}._productCard_15dy7_1 ._purchaseInformation_15dy7_29{display:flex;flex-direction:row;align-items:flex-start;justify-content:space-between;width:100%}._productCard_15dy7_1 ._addToCart_15dy7_37,._productCard_15dy7_1 ._addToCartButton_15dy7_40{width:100%}._productInformation_15dy7_22>a{font-weight:var(--font-weight-semibold)}._partNumber_15dy7_48{display:flex;flex-direction:row;align-items:center;gap:var(--spacing-spacing-3xs)}._partNumberLabel_15dy7_55{color:var(--text-text-quaternary)}._productTile_15dy7_59{box-sizing:border-box;width:100%;max-width:1072px;display:flex;flex-direction:row;align-items:flex-start;border:1px solid var(--border-border-primary, #DFDFDF);background:var(--surface-surface-primary, #FFF);box-shadow:2px 4px 12px #00000026;padding:var(--spacing-spacing-default, 16px) var(--spacing-spacing-sm, 20px);gap:var(--spacing-spacing-1xs)}._productTile_15dy7_59>img{width:108px;height:108px;object-fit:contain}._productTile_15dy7_59 ._topRow_15dy7_80{display:grid;grid-template-columns:1fr auto;width:100%}._productTile_15dy7_59 ._topRow_15dy7_80 button{background-color:transparent;padding:0;margin:0;outline:none;border:none;height:min-content;width:min-content}._productTile_15dy7_59 ._topRow_15dy7_80 path{fill:var(--icons-icon-search)}._productTile_15dy7_59 ._topRow_15dy7_80 svg{padding:0}._productTile_15dy7_59 ._productInformation_15dy7_22{display:flex;flex-direction:column;align-items:flex-start;gap:2px}._productTile_15dy7_59 ._productData_15dy7_111{display:flex;flex-direction:column;align-items:flex-start;width:100%;gap:var(--spacing-spacing-2xs)}._productTile_15dy7_59 ._purchase_15dy7_29{display:flex;flex-direction:row;align-items:flex-end;justify-content:space-between;width:100%}@media (max-width: 480px){._productTile_15dy7_59 ._purchase_15dy7_29{flex-direction:column;align-items:flex-start;gap:var(--spacing-spacing-3xs)}}._productTile_15dy7_59 ._purchaseInformation_15dy7_29{display:flex;flex-direction:column;align-items:flex-start;gap:var(--spacing-spacing-2xs)}@media (max-width: 480px){._productTile_15dy7_59 ._purchaseInformation_15dy7_29{flex-direction:row;align-items:flex-start;justify-content:space-between;width:100%;gap:0px}}._productTile_15dy7_59 ._attributeContainer_15dy7_148{margin:0;padding:0;padding-top:var(--spacing-spacing-1xs);border-top:1px solid var(--border-border-primary);width:100%;list-style:none;display:flex;flex-direction:row;align-items:center;justify-content:flex-start;flex-wrap:wrap;column-gap:var(--spacing-spacing-lg);row-gap:var(--spacing-spacing-3xs)}@media (max-width: 640px){._productTile_15dy7_59 ._attributeContainer_15dy7_148{display:none}}._productTile_15dy7_59 ._attributeContainer_15dy7_148 li{display:flex;flex-direction:row;align-items:center;gap:var(--spacing-spacing-3xs)}._productTile_15dy7_59 ._addToCart_15dy7_37{display:flex;flex-direction:row;align-items:center;gap:var(--spacing-spacing-md)}@media (max-width: 480px){._productTile_15dy7_59 ._addToCart_15dy7_37{gap:var(--spacing-spacing-2xs);width:100%}}._productTile_15dy7_59 ._addToCartButton_15dy7_40{width:96px;font-size:var(--font-size-md);font-weight:var(--font-weight-semibold)}@media (max-width: 640px){._productTile_15dy7_59 ._addToCartButton_15dy7_40{width:100%}}
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
1
|
+
import { PropsWithChildren, ReactNode } from 'react';
|
|
2
2
|
export interface HorizontalScrollProps extends PropsWithChildren {
|
|
3
3
|
className?: string;
|
|
4
4
|
showScrollbar?: boolean;
|
|
5
|
+
caption?: ReactNode;
|
|
6
|
+
scrollStep?: number;
|
|
7
|
+
leftButtonContent?: ReactNode;
|
|
8
|
+
rightButtonContent?: ReactNode;
|
|
9
|
+
headerClassName?: string;
|
|
10
|
+
showIndicators?: boolean;
|
|
11
|
+
hideHeader?: boolean;
|
|
5
12
|
}
|
|
6
|
-
export declare function HorizontalScroll({ className, showScrollbar, children }: HorizontalScrollProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare function HorizontalScroll({ className, showScrollbar, children, caption, scrollStep, leftButtonContent, rightButtonContent, headerClassName, showIndicators, hideHeader, }: HorizontalScrollProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,55 +1,151 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { jsxs as i, jsx as l, Fragment as V } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as b, useState as h, useEffect as m } from "react";
|
|
3
|
+
import { Icon as N } from "../Icon/Icon.js";
|
|
4
|
+
import { Text as Y } from "../Text/Text.js";
|
|
5
|
+
import { c as a } from "../../clsx-OuTLNxxd.js";
|
|
6
|
+
import '../../assets/HorizontalScroll.css';const j = "_root_1bnow_1", F = "_header_1bnow_5", K = "_controls_1bnow_13", q = "_controlBtn_1bnow_18", G = "_container_1bnow_37", I = "_dragging_1bnow_50", U = "_noOverflow_1bnow_53", $ = "_viewport_1bnow_66", J = "_indicator_1bnow_69", Q = "_left_1bnow_79", Z = "_right_1bnow_85", tt = "_hidden_1bnow_91", e = {
|
|
7
|
+
root: j,
|
|
8
|
+
header: F,
|
|
9
|
+
controls: K,
|
|
10
|
+
controlBtn: q,
|
|
11
|
+
container: G,
|
|
12
|
+
dragging: I,
|
|
13
|
+
noOverflow: U,
|
|
14
|
+
"scrollVisibility--false": "_scrollVisibility--false_1bnow_58",
|
|
15
|
+
viewport: $,
|
|
16
|
+
indicator: J,
|
|
17
|
+
left: Q,
|
|
18
|
+
right: Z,
|
|
19
|
+
hidden: tt
|
|
8
20
|
};
|
|
9
|
-
function
|
|
10
|
-
className:
|
|
11
|
-
showScrollbar:
|
|
12
|
-
children:
|
|
21
|
+
function st({
|
|
22
|
+
className: S,
|
|
23
|
+
showScrollbar: E = !1,
|
|
24
|
+
children: C,
|
|
25
|
+
caption: d,
|
|
26
|
+
scrollStep: g = 160,
|
|
27
|
+
leftButtonContent: D,
|
|
28
|
+
rightButtonContent: W,
|
|
29
|
+
headerClassName: z,
|
|
30
|
+
showIndicators: O = !0,
|
|
31
|
+
hideHeader: B = !1
|
|
32
|
+
// new default
|
|
13
33
|
}) {
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
34
|
+
const n = b(null), [w, p] = h(!1), c = b({ x: 0, scroll: 0 }), f = b(!1), M = 5, [_, P] = h(!0), [v, R] = h(!1), [u, X] = h(!1), s = () => {
|
|
35
|
+
const t = n.current;
|
|
36
|
+
if (!t) return;
|
|
37
|
+
const r = t.scrollWidth - t.clientWidth;
|
|
38
|
+
X(t.scrollWidth > t.clientWidth + 1), P(t.scrollLeft <= 0), R(t.scrollLeft >= r - 1);
|
|
39
|
+
}, k = (t) => {
|
|
40
|
+
!n.current || !u || (p(!0), c.current.x = t.clientX, c.current.scroll = n.current.scrollLeft, f.current = !1);
|
|
41
|
+
}, A = (t) => {
|
|
42
|
+
if (!w || !n.current) return;
|
|
43
|
+
const r = t.clientX - c.current.x;
|
|
44
|
+
n.current.scrollLeft = c.current.scroll - r, Math.abs(t.clientX - c.current.x) > M && (f.current = !0);
|
|
45
|
+
}, x = () => {
|
|
46
|
+
n.current && p(!1);
|
|
47
|
+
}, H = (t) => {
|
|
48
|
+
f.current && (t.preventDefault(), t.stopPropagation(), f.current = !1);
|
|
49
|
+
}, y = (t) => {
|
|
50
|
+
const r = n.current;
|
|
51
|
+
if (!r) return;
|
|
52
|
+
const o = Math.max(0, Math.min(r.scrollLeft + t, r.scrollWidth - r.clientWidth));
|
|
53
|
+
r.scrollTo({ left: o, behavior: "smooth" }), requestAnimationFrame(s);
|
|
24
54
|
};
|
|
25
|
-
|
|
26
|
-
const t =
|
|
55
|
+
m(() => {
|
|
56
|
+
const t = n.current;
|
|
27
57
|
if (!t) return;
|
|
28
|
-
const
|
|
58
|
+
const r = (o) => {
|
|
29
59
|
if (!(t.scrollWidth > t.clientWidth)) return;
|
|
30
|
-
const
|
|
31
|
-
|
|
60
|
+
const L = Math.abs(o.deltaY) >= Math.abs(o.deltaX) && o.deltaY !== 0 ? o.deltaY : o.deltaX;
|
|
61
|
+
L !== 0 ? (o.preventDefault(), t.scrollLeft += L) : o.preventDefault();
|
|
32
62
|
};
|
|
33
|
-
return t.addEventListener("wheel",
|
|
34
|
-
}, []),
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
63
|
+
return t.addEventListener("wheel", r, { passive: !1 }), () => t.removeEventListener("wheel", r);
|
|
64
|
+
}, []), m(() => {
|
|
65
|
+
const t = n.current;
|
|
66
|
+
if (t)
|
|
67
|
+
return s(), t.addEventListener("scroll", s), () => t.removeEventListener("scroll", s);
|
|
68
|
+
}, []), m(() => {
|
|
69
|
+
const t = n.current;
|
|
70
|
+
if (!t || typeof ResizeObserver > "u") return;
|
|
71
|
+
const r = new ResizeObserver(() => s());
|
|
72
|
+
return r.observe(t), () => r.disconnect();
|
|
73
|
+
}, []);
|
|
74
|
+
const T = () => d == null ? null : typeof d == "string" ? /* @__PURE__ */ l(Y, { variant: "display", size: "2xl", className: e.caption, children: d }) : d;
|
|
75
|
+
return /* @__PURE__ */ i("div", { className: a(e.root, S), children: [
|
|
76
|
+
!B && /* @__PURE__ */ i("div", { className: a(e.header, z), children: [
|
|
77
|
+
T(),
|
|
78
|
+
/* @__PURE__ */ i("div", { className: e.controls, children: [
|
|
79
|
+
/* @__PURE__ */ l(
|
|
80
|
+
"button",
|
|
81
|
+
{
|
|
82
|
+
type: "button",
|
|
83
|
+
className: e.controlBtn,
|
|
84
|
+
onClick: () => y(-g),
|
|
85
|
+
"aria-label": "Scroll left",
|
|
86
|
+
disabled: _,
|
|
87
|
+
"aria-disabled": _,
|
|
88
|
+
children: D ?? /* @__PURE__ */ l(N, { iconKey: "fa-regular fa-chevron-left", size: "sm" })
|
|
89
|
+
}
|
|
90
|
+
),
|
|
91
|
+
/* @__PURE__ */ l(
|
|
92
|
+
"button",
|
|
93
|
+
{
|
|
94
|
+
type: "button",
|
|
95
|
+
className: e.controlBtn,
|
|
96
|
+
onClick: () => y(g),
|
|
97
|
+
"aria-label": "Scroll right",
|
|
98
|
+
disabled: v,
|
|
99
|
+
"aria-disabled": v,
|
|
100
|
+
children: W ?? /* @__PURE__ */ l(N, { iconKey: "fa-regular fa-chevron-right", size: "sm" })
|
|
101
|
+
}
|
|
102
|
+
)
|
|
103
|
+
] })
|
|
104
|
+
] }),
|
|
105
|
+
/* @__PURE__ */ i("div", { className: e.viewport, children: [
|
|
106
|
+
/* @__PURE__ */ l(
|
|
107
|
+
"div",
|
|
108
|
+
{
|
|
109
|
+
ref: n,
|
|
110
|
+
className: a(
|
|
111
|
+
e.container,
|
|
112
|
+
e[`scrollVisibility--${E}`],
|
|
113
|
+
w ? e.dragging : "",
|
|
114
|
+
!u && e.noOverflow
|
|
115
|
+
),
|
|
116
|
+
onPointerDown: k,
|
|
117
|
+
onPointerMove: A,
|
|
118
|
+
onPointerLeave: x,
|
|
119
|
+
onPointerUp: x,
|
|
120
|
+
onClickCapture: H,
|
|
121
|
+
children: C
|
|
122
|
+
}
|
|
43
123
|
),
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
124
|
+
O && /* @__PURE__ */ i(V, { children: [
|
|
125
|
+
/* @__PURE__ */ l(
|
|
126
|
+
"div",
|
|
127
|
+
{
|
|
128
|
+
className: a(
|
|
129
|
+
e.indicator,
|
|
130
|
+
e.left,
|
|
131
|
+
(_ || !u) && e.hidden
|
|
132
|
+
)
|
|
133
|
+
}
|
|
134
|
+
),
|
|
135
|
+
/* @__PURE__ */ l(
|
|
136
|
+
"div",
|
|
137
|
+
{
|
|
138
|
+
className: a(
|
|
139
|
+
e.indicator,
|
|
140
|
+
e.right,
|
|
141
|
+
(v || !u) && e.hidden
|
|
142
|
+
)
|
|
143
|
+
}
|
|
144
|
+
)
|
|
145
|
+
] })
|
|
146
|
+
] })
|
|
147
|
+
] });
|
|
52
148
|
}
|
|
53
149
|
export {
|
|
54
|
-
|
|
150
|
+
st as HorizontalScroll
|
|
55
151
|
};
|
|
@@ -7,6 +7,8 @@ interface DemoArgs {
|
|
|
7
7
|
gap: number;
|
|
8
8
|
rounded: boolean;
|
|
9
9
|
gradient: boolean;
|
|
10
|
+
showIndicators: boolean;
|
|
11
|
+
hideHeader: boolean;
|
|
10
12
|
}
|
|
11
13
|
type StoryArgs = DemoArgs;
|
|
12
14
|
declare const meta: Meta<StoryArgs>;
|
|
@@ -16,3 +18,5 @@ export declare const Playground: Story;
|
|
|
16
18
|
export declare const WithScrollbar: Story;
|
|
17
19
|
export declare const DenseSmallItems: Story;
|
|
18
20
|
export declare const LargeCards: Story;
|
|
21
|
+
export declare const WithoutIndicators: Story;
|
|
22
|
+
export declare const HeaderHidden: Story;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as t, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { HorizontalScroll as r } from "./HorizontalScroll.js";
|
|
3
|
-
const
|
|
3
|
+
const b = {
|
|
4
4
|
title: "Case Parts/Atoms/HorizontalScroll",
|
|
5
5
|
component: r,
|
|
6
6
|
tags: ["autodocs"],
|
|
@@ -49,6 +49,14 @@ Use for carousels, chip lists, card rails, horizontally overflowing panels.
|
|
|
49
49
|
gradient: {
|
|
50
50
|
control: { type: "boolean" },
|
|
51
51
|
description: "Use gradient background instead of solid."
|
|
52
|
+
},
|
|
53
|
+
showIndicators: {
|
|
54
|
+
control: { type: "boolean" },
|
|
55
|
+
description: "Show gradient edge scroll affordances."
|
|
56
|
+
},
|
|
57
|
+
hideHeader: {
|
|
58
|
+
control: { type: "boolean" },
|
|
59
|
+
description: "Hide the caption row and arrow controls."
|
|
52
60
|
}
|
|
53
61
|
},
|
|
54
62
|
args: {
|
|
@@ -58,9 +66,13 @@ Use for carousels, chip lists, card rails, horizontally overflowing panels.
|
|
|
58
66
|
itemHeight: 80,
|
|
59
67
|
gap: 12,
|
|
60
68
|
rounded: !0,
|
|
61
|
-
gradient: !0
|
|
69
|
+
gradient: !0,
|
|
70
|
+
showIndicators: !0,
|
|
71
|
+
// new default
|
|
72
|
+
hideHeader: !1
|
|
73
|
+
// new default
|
|
62
74
|
}
|
|
63
|
-
},
|
|
75
|
+
}, i = /* @__PURE__ */ o("style", { children: `
|
|
64
76
|
.horizontalDemoScroll {
|
|
65
77
|
touch-action: none; /* ensure pointer events for horizontal drag */
|
|
66
78
|
}
|
|
@@ -68,9 +80,9 @@ Use for carousels, chip lists, card rails, horizontally overflowing panels.
|
|
|
68
80
|
-webkit-user-drag: none; /* Safari/Chrome: prevent ghost dragging of link */
|
|
69
81
|
}
|
|
70
82
|
` }), n = (e) => {
|
|
71
|
-
const { itemCount:
|
|
72
|
-
return Array.from({ length:
|
|
73
|
-
const
|
|
83
|
+
const { itemCount: d, itemWidth: s, itemHeight: a, gap: c, rounded: h, gradient: m } = e;
|
|
84
|
+
return Array.from({ length: d }, (g, p) => {
|
|
85
|
+
const l = p + 1;
|
|
74
86
|
return /* @__PURE__ */ o(
|
|
75
87
|
"a",
|
|
76
88
|
{
|
|
@@ -78,41 +90,61 @@ Use for carousels, chip lists, card rails, horizontally overflowing panels.
|
|
|
78
90
|
draggable: !1,
|
|
79
91
|
style: {
|
|
80
92
|
flex: "0 0 auto",
|
|
81
|
-
width:
|
|
82
|
-
height:
|
|
83
|
-
marginRight:
|
|
93
|
+
width: s,
|
|
94
|
+
height: a,
|
|
95
|
+
marginRight: c,
|
|
84
96
|
borderRadius: h ? 8 : 0,
|
|
85
97
|
background: m ? "linear-gradient(135deg,#4F46E5,#6366F1)" : "#4F46E5",
|
|
86
98
|
color: "#fff",
|
|
87
99
|
display: "flex",
|
|
88
100
|
alignItems: "center",
|
|
89
101
|
justifyContent: "center",
|
|
90
|
-
fontSize: Math.max(12, Math.min(24,
|
|
102
|
+
fontSize: Math.max(12, Math.min(24, a / 3)),
|
|
91
103
|
fontWeight: 600,
|
|
92
104
|
userSelect: "none",
|
|
93
105
|
boxShadow: "0 2px 6px rgba(0,0,0,0.25)"
|
|
94
106
|
},
|
|
95
|
-
children:
|
|
107
|
+
children: l
|
|
96
108
|
},
|
|
97
|
-
|
|
109
|
+
l
|
|
98
110
|
);
|
|
99
111
|
});
|
|
100
|
-
},
|
|
112
|
+
}, S = {
|
|
101
113
|
name: "Playground",
|
|
102
114
|
render: (e) => /* @__PURE__ */ t("div", { style: { padding: 24 }, children: [
|
|
103
|
-
|
|
115
|
+
i,
|
|
104
116
|
/* @__PURE__ */ o("h3", { style: { margin: "0 0 12px" }, children: "HorizontalScroll Playground" }),
|
|
105
117
|
/* @__PURE__ */ o("p", { style: { margin: "0 0 16px", fontSize: 14, color: "#555" }, children: "Drag horizontally or use the mouse wheel. Tweak values in Controls." }),
|
|
106
|
-
/* @__PURE__ */ o(
|
|
118
|
+
/* @__PURE__ */ o(
|
|
119
|
+
r,
|
|
120
|
+
{
|
|
121
|
+
className: "horizontalDemoScroll",
|
|
122
|
+
showScrollbar: e.showScrollbar,
|
|
123
|
+
showIndicators: e.showIndicators,
|
|
124
|
+
hideHeader: e.hideHeader,
|
|
125
|
+
caption: `Playground (${e.itemCount} items)`,
|
|
126
|
+
children: n(e)
|
|
127
|
+
}
|
|
128
|
+
)
|
|
107
129
|
] })
|
|
108
|
-
},
|
|
130
|
+
}, y = {
|
|
109
131
|
args: { showScrollbar: !0 },
|
|
110
132
|
render: (e) => /* @__PURE__ */ t("div", { style: { padding: 24 }, children: [
|
|
111
|
-
|
|
133
|
+
i,
|
|
112
134
|
/* @__PURE__ */ o("h3", { style: { margin: "0 0 12px" }, children: "Scrollbar Visible" }),
|
|
113
|
-
/* @__PURE__ */ o(
|
|
135
|
+
/* @__PURE__ */ o(
|
|
136
|
+
r,
|
|
137
|
+
{
|
|
138
|
+
className: "horizontalDemoScroll",
|
|
139
|
+
showScrollbar: !0,
|
|
140
|
+
showIndicators: e.showIndicators,
|
|
141
|
+
hideHeader: e.hideHeader,
|
|
142
|
+
caption: "Scrollbar Visible",
|
|
143
|
+
children: n(e)
|
|
144
|
+
}
|
|
145
|
+
)
|
|
114
146
|
] })
|
|
115
|
-
},
|
|
147
|
+
}, f = {
|
|
116
148
|
args: {
|
|
117
149
|
itemCount: 40,
|
|
118
150
|
itemWidth: 90,
|
|
@@ -121,11 +153,21 @@ Use for carousels, chip lists, card rails, horizontally overflowing panels.
|
|
|
121
153
|
showScrollbar: !1
|
|
122
154
|
},
|
|
123
155
|
render: (e) => /* @__PURE__ */ t("div", { style: { padding: 24 }, children: [
|
|
124
|
-
|
|
156
|
+
i,
|
|
125
157
|
/* @__PURE__ */ o("h3", { style: { margin: "0 0 12px" }, children: "Dense Small Items" }),
|
|
126
|
-
/* @__PURE__ */ o(
|
|
158
|
+
/* @__PURE__ */ o(
|
|
159
|
+
r,
|
|
160
|
+
{
|
|
161
|
+
className: "horizontalDemoScroll",
|
|
162
|
+
showScrollbar: e.showScrollbar,
|
|
163
|
+
showIndicators: e.showIndicators,
|
|
164
|
+
hideHeader: e.hideHeader,
|
|
165
|
+
caption: `Dense (${e.itemCount} items)`,
|
|
166
|
+
children: n(e)
|
|
167
|
+
}
|
|
168
|
+
)
|
|
127
169
|
] })
|
|
128
|
-
},
|
|
170
|
+
}, H = {
|
|
129
171
|
args: {
|
|
130
172
|
itemCount: 12,
|
|
131
173
|
itemWidth: 260,
|
|
@@ -134,15 +176,76 @@ Use for carousels, chip lists, card rails, horizontally overflowing panels.
|
|
|
134
176
|
gradient: !1
|
|
135
177
|
},
|
|
136
178
|
render: (e) => /* @__PURE__ */ t("div", { style: { padding: 24 }, children: [
|
|
137
|
-
|
|
179
|
+
i,
|
|
138
180
|
/* @__PURE__ */ o("h3", { style: { margin: "0 0 12px" }, children: "Large Cards" }),
|
|
139
|
-
/* @__PURE__ */ o(
|
|
181
|
+
/* @__PURE__ */ o(
|
|
182
|
+
r,
|
|
183
|
+
{
|
|
184
|
+
className: "horizontalDemoScroll",
|
|
185
|
+
showScrollbar: e.showScrollbar,
|
|
186
|
+
showIndicators: e.showIndicators,
|
|
187
|
+
hideHeader: e.hideHeader,
|
|
188
|
+
caption: "Large Cards",
|
|
189
|
+
children: n(e)
|
|
190
|
+
}
|
|
191
|
+
)
|
|
192
|
+
] })
|
|
193
|
+
}, x = {
|
|
194
|
+
name: "Without Indicators",
|
|
195
|
+
args: {
|
|
196
|
+
showIndicators: !1,
|
|
197
|
+
itemCount: 16,
|
|
198
|
+
itemWidth: 140,
|
|
199
|
+
itemHeight: 72,
|
|
200
|
+
gap: 12
|
|
201
|
+
},
|
|
202
|
+
render: (e) => /* @__PURE__ */ t("div", { style: { padding: 24 }, children: [
|
|
203
|
+
i,
|
|
204
|
+
/* @__PURE__ */ o("h3", { style: { margin: "0 0 12px" }, children: "Indicators Disabled" }),
|
|
205
|
+
/* @__PURE__ */ o(
|
|
206
|
+
r,
|
|
207
|
+
{
|
|
208
|
+
className: "horizontalDemoScroll",
|
|
209
|
+
showScrollbar: e.showScrollbar,
|
|
210
|
+
showIndicators: !1,
|
|
211
|
+
hideHeader: e.hideHeader,
|
|
212
|
+
caption: "No Edge Indicators",
|
|
213
|
+
children: n(e)
|
|
214
|
+
}
|
|
215
|
+
)
|
|
216
|
+
] })
|
|
217
|
+
}, I = {
|
|
218
|
+
name: "Header Hidden",
|
|
219
|
+
args: {
|
|
220
|
+
hideHeader: !0,
|
|
221
|
+
itemCount: 14,
|
|
222
|
+
itemWidth: 130,
|
|
223
|
+
itemHeight: 70,
|
|
224
|
+
gap: 10,
|
|
225
|
+
showIndicators: !0
|
|
226
|
+
},
|
|
227
|
+
render: (e) => /* @__PURE__ */ t("div", { style: { padding: 24 }, children: [
|
|
228
|
+
i,
|
|
229
|
+
/* @__PURE__ */ o("h3", { style: { margin: "0 0 12px" }, children: "Header Hidden" }),
|
|
230
|
+
/* @__PURE__ */ o(
|
|
231
|
+
r,
|
|
232
|
+
{
|
|
233
|
+
className: "horizontalDemoScroll",
|
|
234
|
+
showScrollbar: e.showScrollbar,
|
|
235
|
+
showIndicators: e.showIndicators,
|
|
236
|
+
hideHeader: !0,
|
|
237
|
+
caption: "(Will not render since header hidden)",
|
|
238
|
+
children: n(e)
|
|
239
|
+
}
|
|
240
|
+
)
|
|
140
241
|
] })
|
|
141
242
|
};
|
|
142
243
|
export {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
244
|
+
f as DenseSmallItems,
|
|
245
|
+
I as HeaderHidden,
|
|
246
|
+
H as LargeCards,
|
|
247
|
+
S as Playground,
|
|
248
|
+
y as WithScrollbar,
|
|
249
|
+
x as WithoutIndicators,
|
|
250
|
+
b as default
|
|
148
251
|
};
|
package/dist/main-client.d.ts
CHANGED
|
@@ -19,8 +19,9 @@ export type { AnimatedCheckMarkProps } from './molecules/StatefulButton/Animated
|
|
|
19
19
|
export { AnimatedCheckMark } from './molecules/StatefulButton/AnimatedCheckmark';
|
|
20
20
|
export type { AddToCartProps } from './molecules/AddToCart/AddToCart';
|
|
21
21
|
export { AddToCart } from './molecules/AddToCart/AddToCart';
|
|
22
|
+
export type { CategoryWithChildren as MainCategory, Category } from './molecules/CategoryNav/CategoryNav';
|
|
22
23
|
export { MainNav } from './organisms/MainNav/MainNav';
|
|
23
|
-
export type {
|
|
24
|
+
export type { MainNavProps } from './organisms/MainNav/MainNav';
|
|
24
25
|
export { ChipSelector } from './organisms/ChipSelector/ChipSelector';
|
|
25
26
|
export type { ChipSelectorProps } from './organisms/ChipSelector/ChipSelector';
|
|
26
27
|
export { Product } from './organisms/Product/Product';
|
package/dist/main-client.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { Button as t } from "./atoms/Button/Button.js";
|
|
2
2
|
import { Flex as p } from "./atoms/Flex/Flex.js";
|
|
3
3
|
import { Column as f, Grid as x } from "./atoms/Grid/Grid.js";
|
|
4
|
-
import { Head as
|
|
4
|
+
import { Head as n } from "./atoms/Root/Head.js";
|
|
5
5
|
import { Icon as l } from "./atoms/Icon/Icon.js";
|
|
6
6
|
import { Root as d } from "./atoms/Root/Root.js";
|
|
7
7
|
import { Separator as C } from "./atoms/Separator/Separator.js";
|
|
8
8
|
import { Text as k } from "./atoms/Text/Text.js";
|
|
9
|
-
import { Input as
|
|
10
|
-
import { Link as
|
|
9
|
+
import { Input as B } from "./atoms/Input/Input.js";
|
|
10
|
+
import { Link as A } from "./atoms/Link/Link.js";
|
|
11
11
|
import { linkClassName as h } from "./atoms/Link/linkClassName.js";
|
|
12
|
-
import { configureLink as
|
|
12
|
+
import { configureLink as v, routerOverride as P } from "./atoms/Link/configureLink.js";
|
|
13
13
|
import { LinkButton as F } from "./atoms/LinkButton/LinkButton.js";
|
|
14
|
-
import { configureImage as
|
|
15
|
-
import { Logo as
|
|
14
|
+
import { configureImage as b } from "./atoms/Image/configureImage.js";
|
|
15
|
+
import { Logo as H } from "./molecules/Logo/Logo.js";
|
|
16
16
|
import { SearchBox as w } from "./molecules/SearchBox/SearchBox.js";
|
|
17
17
|
import { QuantityInput as G } from "./molecules/QuantityInput/QuantityInput.js";
|
|
18
18
|
import { Pricing as Q } from "./molecules/Pricing/Pricing.js";
|
|
@@ -20,61 +20,63 @@ import { Availability as V } from "./molecules/Availability/Availability.js";
|
|
|
20
20
|
import { Avatar as q } from "./molecules/Avatar/Avatar.js";
|
|
21
21
|
import { BannerCard as E } from "./molecules/BannerCard/BannerCard.js";
|
|
22
22
|
import { CardLink as K } from "./molecules/CardLink/CardLink.js";
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
23
|
+
import { Breadcrumbs as W } from "./molecules/Breadcrumbs/Breadcrumbs.js";
|
|
24
|
+
import { NotFound as Y } from "./organisms/NotFound/NotFound.js";
|
|
25
|
+
import { HorizontalScroll as _ } from "./atoms/HorizontalScroll/HorizontalScroll.js";
|
|
26
|
+
import { SlideInPanel as oo } from "./atoms/SlideInPanel/SlideInPanel.js";
|
|
27
|
+
import { Tooltip as to } from "./atoms/Tooltip/Tooltip.js";
|
|
28
|
+
import { Account as po } from "./molecules/Account/Account.js";
|
|
29
|
+
import { Chip as fo } from "./molecules/Chip/Chip.js";
|
|
30
|
+
import { ToggleView as ao } from "./molecules/ToggleView/ToggleView.js";
|
|
31
|
+
import { CartSlideInPanel as io } from "./molecules/Cart/CartSlideInPanel.js";
|
|
32
|
+
import { StatefulButton as uo } from "./molecules/StatefulButton/StatefulButton.js";
|
|
33
|
+
import { AnimatedCheckMark as Co } from "./molecules/StatefulButton/AnimatedCheckmark.js";
|
|
34
|
+
import { AddToCart as ko } from "./molecules/AddToCart/AddToCart.js";
|
|
35
|
+
import { MainNav as Bo } from "./organisms/MainNav/MainNav.js";
|
|
36
|
+
import { ChipSelector as Ao } from "./organisms/ChipSelector/ChipSelector.js";
|
|
37
|
+
import { Product as ho } from "./organisms/Product/Product.js";
|
|
38
|
+
import { Carousel as vo } from "./organisms/Carousel/Carousel.js";
|
|
39
|
+
import { Footer as To } from "./organisms/Footer/Footer.js";
|
|
39
40
|
export {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
po as Account,
|
|
42
|
+
ko as AddToCart,
|
|
43
|
+
Co as AnimatedCheckMark,
|
|
43
44
|
V as Availability,
|
|
44
45
|
q as Avatar,
|
|
45
46
|
E as BannerCard,
|
|
47
|
+
W as Breadcrumbs,
|
|
46
48
|
t as Button,
|
|
47
49
|
K as CardLink,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
vo as Carousel,
|
|
51
|
+
io as CartSlideInPanel,
|
|
52
|
+
fo as Chip,
|
|
53
|
+
Ao as ChipSelector,
|
|
52
54
|
f as Column,
|
|
53
55
|
p as Flex,
|
|
54
|
-
|
|
56
|
+
To as Footer,
|
|
55
57
|
x as Grid,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
+
n as Head,
|
|
59
|
+
_ as HorizontalScroll,
|
|
58
60
|
l as Icon,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
+
B as Input,
|
|
62
|
+
A as Link,
|
|
61
63
|
F as LinkButton,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
64
|
+
H as Logo,
|
|
65
|
+
Bo as MainNav,
|
|
66
|
+
Y as NotFound,
|
|
65
67
|
Q as Pricing,
|
|
66
|
-
|
|
68
|
+
ho as Product,
|
|
67
69
|
G as QuantityInput,
|
|
68
70
|
d as Root,
|
|
69
71
|
w as SearchBox,
|
|
70
72
|
C as Separator,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
+
oo as SlideInPanel,
|
|
74
|
+
uo as StatefulButton,
|
|
73
75
|
k as Text,
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
ao as ToggleView,
|
|
77
|
+
to as Tooltip,
|
|
78
|
+
b as configureImage,
|
|
79
|
+
v as configureLink,
|
|
78
80
|
h as linkClassName,
|
|
79
|
-
|
|
81
|
+
P as routerOverride
|
|
80
82
|
};
|
package/dist/main-server.d.ts
CHANGED
|
@@ -37,5 +37,7 @@ export { BannerCard } from './molecules/BannerCard/BannerCard';
|
|
|
37
37
|
export type { BannerCardProps } from './molecules/BannerCard/BannerCard';
|
|
38
38
|
export { CardLink } from './molecules/CardLink/CardLink';
|
|
39
39
|
export type { CardLinkProps } from './molecules/CardLink/CardLink';
|
|
40
|
+
export { Breadcrumbs } from './molecules/Breadcrumbs/Breadcrumbs';
|
|
41
|
+
export type { BreadcrumbProps, Breadcrumb } from './molecules/Breadcrumbs/Breadcrumbs';
|
|
40
42
|
export { NotFound } from './organisms/NotFound/NotFound';
|
|
41
43
|
export type { NotFoundProps } from './organisms/NotFound/NotFound';
|
package/dist/main-server.js
CHANGED
|
@@ -3,14 +3,14 @@ import { Flex as m } from "./atoms/Flex/Flex.js";
|
|
|
3
3
|
import { Column as x, Grid as f } from "./atoms/Grid/Grid.js";
|
|
4
4
|
import { Head as a } from "./atoms/Root/Head.js";
|
|
5
5
|
import { Icon as u } from "./atoms/Icon/Icon.js";
|
|
6
|
-
import { Root as
|
|
6
|
+
import { Root as c } from "./atoms/Root/Root.js";
|
|
7
7
|
import { Separator as g } from "./atoms/Separator/Separator.js";
|
|
8
|
-
import { Text as
|
|
8
|
+
import { Text as B } from "./atoms/Text/Text.js";
|
|
9
9
|
import { Input as C } from "./atoms/Input/Input.js";
|
|
10
|
-
import { Link as
|
|
11
|
-
import { linkClassName as
|
|
12
|
-
import { configureLink as
|
|
13
|
-
import { LinkButton as
|
|
10
|
+
import { Link as s } from "./atoms/Link/Link.js";
|
|
11
|
+
import { linkClassName as b } from "./atoms/Link/linkClassName.js";
|
|
12
|
+
import { configureLink as A, routerOverride as F } from "./atoms/Link/configureLink.js";
|
|
13
|
+
import { LinkButton as S } from "./atoms/LinkButton/LinkButton.js";
|
|
14
14
|
import { configureImage as G } from "./atoms/Image/configureImage.js";
|
|
15
15
|
import { Logo as O } from "./molecules/Logo/Logo.js";
|
|
16
16
|
import { SearchBox as Q } from "./molecules/SearchBox/SearchBox.js";
|
|
@@ -20,11 +20,13 @@ import { Availability as z } from "./molecules/Availability/Availability.js";
|
|
|
20
20
|
import { Avatar as E } from "./molecules/Avatar/Avatar.js";
|
|
21
21
|
import { BannerCard as K } from "./molecules/BannerCard/BannerCard.js";
|
|
22
22
|
import { CardLink as U } from "./molecules/CardLink/CardLink.js";
|
|
23
|
-
import {
|
|
23
|
+
import { Breadcrumbs as W } from "./molecules/Breadcrumbs/Breadcrumbs.js";
|
|
24
|
+
import { NotFound as Y } from "./organisms/NotFound/NotFound.js";
|
|
24
25
|
export {
|
|
25
26
|
z as Availability,
|
|
26
27
|
E as Avatar,
|
|
27
28
|
K as BannerCard,
|
|
29
|
+
W as Breadcrumbs,
|
|
28
30
|
t as Button,
|
|
29
31
|
U as CardLink,
|
|
30
32
|
x as Column,
|
|
@@ -33,18 +35,18 @@ export {
|
|
|
33
35
|
a as Head,
|
|
34
36
|
u as Icon,
|
|
35
37
|
C as Input,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
+
s as Link,
|
|
39
|
+
S as LinkButton,
|
|
38
40
|
O as Logo,
|
|
39
|
-
|
|
41
|
+
Y as NotFound,
|
|
40
42
|
q as Pricing,
|
|
41
43
|
T as QuantityInput,
|
|
42
|
-
|
|
44
|
+
c as Root,
|
|
43
45
|
Q as SearchBox,
|
|
44
46
|
g as Separator,
|
|
45
|
-
|
|
47
|
+
B as Text,
|
|
46
48
|
G as configureImage,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
49
|
+
A as configureLink,
|
|
50
|
+
b as linkClassName,
|
|
51
|
+
F as routerOverride
|
|
50
52
|
};
|
package/dist/main.d.ts
CHANGED
|
@@ -25,6 +25,5 @@ export type { SearchBoxProps } from './molecules/SearchBox/SearchBox';
|
|
|
25
25
|
export { ToggleView } from './molecules/ToggleView/ToggleView';
|
|
26
26
|
export type { ToggleViewProps, ToggleOptionProps, ToggleOptionBaseProps, } from './molecules/ToggleView/ToggleView';
|
|
27
27
|
export { MainNav } from './organisms/MainNav/MainNav';
|
|
28
|
-
export type { MainCategory, Category } from './organisms/MainNav/MainNav';
|
|
29
28
|
export { ChipSelector } from './organisms/ChipSelector/ChipSelector';
|
|
30
29
|
export type { ChipSelectorProps } from './organisms/ChipSelector/ChipSelector';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface Breadcrumb {
|
|
3
|
+
href: string;
|
|
4
|
+
label: string | React.ReactElement;
|
|
5
|
+
}
|
|
6
|
+
export interface BreadcrumbProps {
|
|
7
|
+
breadcrumbs: Breadcrumb[];
|
|
8
|
+
}
|
|
9
|
+
export declare function Breadcrumbs({ breadcrumbs }: BreadcrumbProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as t, jsxs as f } from "react/jsx-runtime";
|
|
2
|
+
import s from "react";
|
|
3
|
+
import { Link as c } from "../../atoms/Link/Link.js";
|
|
4
|
+
import '../../assets/Breadcrumbs.css';const r = "_nav_5oobe_1", _ = "_crumb_5oobe_8", h = "_final_5oobe_13", l = {
|
|
5
|
+
nav: r,
|
|
6
|
+
crumb: _,
|
|
7
|
+
final: h
|
|
8
|
+
};
|
|
9
|
+
function g({
|
|
10
|
+
breadcrumbs: n
|
|
11
|
+
}) {
|
|
12
|
+
return !n || (n == null ? void 0 : n.length) === 0 ? null : /* @__PURE__ */ t("nav", { className: l.nav, children: n.map((o, e) => {
|
|
13
|
+
const a = e === n.length - 1, i = a && n.length > 1;
|
|
14
|
+
return /* @__PURE__ */ f(s.Fragment, { children: [
|
|
15
|
+
/* @__PURE__ */ t(
|
|
16
|
+
c,
|
|
17
|
+
{
|
|
18
|
+
href: o.href,
|
|
19
|
+
className: `${l.crumb} ${i ? l.final : ""}`,
|
|
20
|
+
children: o.label
|
|
21
|
+
}
|
|
22
|
+
),
|
|
23
|
+
!a && /* @__PURE__ */ t("span", { children: "/" })
|
|
24
|
+
] }, `breadcrumb.${e}`);
|
|
25
|
+
}) });
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
g as Breadcrumbs
|
|
29
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { Breadcrumbs } from './Breadcrumbs';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: typeof Breadcrumbs;
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: string;
|
|
8
|
+
};
|
|
9
|
+
tags: string[];
|
|
10
|
+
argTypes: {
|
|
11
|
+
breadcrumbs: {
|
|
12
|
+
control: {
|
|
13
|
+
type: "object";
|
|
14
|
+
};
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
args: {
|
|
19
|
+
breadcrumbs: {
|
|
20
|
+
href: string;
|
|
21
|
+
label: string;
|
|
22
|
+
}[];
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export default meta;
|
|
26
|
+
type Story = StoryObj<typeof meta>;
|
|
27
|
+
export declare const Default: Story;
|
|
28
|
+
export declare const SingleCrumb: Story;
|
|
29
|
+
export declare const Empty: Story;
|
|
30
|
+
export declare const WithElementLabel: Story;
|
|
31
|
+
export declare const ManyCrumbs: Story;
|
|
32
|
+
export declare const Playground: Story;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Breadcrumbs as a } from "./Breadcrumbs.js";
|
|
3
|
+
const l = {
|
|
4
|
+
title: "Case Parts/Molecules/Breadcrumbs",
|
|
5
|
+
component: a,
|
|
6
|
+
parameters: { layout: "centered" },
|
|
7
|
+
tags: ["autodocs"],
|
|
8
|
+
argTypes: {
|
|
9
|
+
breadcrumbs: {
|
|
10
|
+
control: { type: "object" },
|
|
11
|
+
description: "Array of breadcrumb items: { href, label }"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
args: {
|
|
15
|
+
breadcrumbs: [
|
|
16
|
+
{ href: "/", label: "Home" },
|
|
17
|
+
{ href: "/products", label: "Products" },
|
|
18
|
+
{ href: "/products/widgets", label: "Widgets" }
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
}, o = {
|
|
22
|
+
render: (r) => /* @__PURE__ */ e(a, { ...r })
|
|
23
|
+
}, b = {
|
|
24
|
+
args: {
|
|
25
|
+
breadcrumbs: [{ href: "/", label: "Home" }]
|
|
26
|
+
}
|
|
27
|
+
}, c = {
|
|
28
|
+
args: {
|
|
29
|
+
breadcrumbs: []
|
|
30
|
+
},
|
|
31
|
+
name: "Empty"
|
|
32
|
+
}, n = {
|
|
33
|
+
args: {
|
|
34
|
+
breadcrumbs: [
|
|
35
|
+
{ href: "/", label: /* @__PURE__ */ e("span", { style: { fontWeight: 600 }, children: "Home" }) },
|
|
36
|
+
{ href: "/team", label: /* @__PURE__ */ e("em", { children: "Team" }) },
|
|
37
|
+
{ href: "/team/engineering", label: /* @__PURE__ */ e("strong", { children: "Engineering" }) }
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
}, m = {
|
|
41
|
+
args: {
|
|
42
|
+
breadcrumbs: [
|
|
43
|
+
{ href: "/", label: "Home" },
|
|
44
|
+
{ href: "/section", label: "Section" },
|
|
45
|
+
{ href: "/section/sub", label: "Sub" },
|
|
46
|
+
{ href: "/section/sub/topic", label: "Topic" },
|
|
47
|
+
{ href: "/section/sub/topic/deep", label: "Deep" },
|
|
48
|
+
{ href: "/section/sub/topic/deep/final", label: "Final" }
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
}, d = {
|
|
52
|
+
render: (r) => /* @__PURE__ */ e(a, { ...r }),
|
|
53
|
+
args: {
|
|
54
|
+
breadcrumbs: [
|
|
55
|
+
{ href: "/", label: "Home" },
|
|
56
|
+
{ href: "/products", label: "Products" },
|
|
57
|
+
{ href: "/products/widgets", label: "Widgets" }
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
export {
|
|
62
|
+
o as Default,
|
|
63
|
+
c as Empty,
|
|
64
|
+
m as ManyCrumbs,
|
|
65
|
+
d as Playground,
|
|
66
|
+
b as SingleCrumb,
|
|
67
|
+
n as WithElementLabel,
|
|
68
|
+
l as default
|
|
69
|
+
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export interface Category {
|
|
2
2
|
id: string | number;
|
|
3
|
-
label: string;
|
|
3
|
+
label: string | React.ReactElement;
|
|
4
4
|
route: string;
|
|
5
5
|
}
|
|
6
|
-
export interface
|
|
6
|
+
export interface CategoryWithChildren extends Category {
|
|
7
7
|
children: Category[];
|
|
8
8
|
showChevron?: boolean;
|
|
9
9
|
}
|
|
10
10
|
export declare function CategoryNav({ categories, }: {
|
|
11
|
-
categories?:
|
|
11
|
+
categories?: CategoryWithChildren[];
|
|
12
12
|
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -5,10 +5,10 @@ import { Link as s } from "../../atoms/Link/Link.js";
|
|
|
5
5
|
import { Icon as m } from "../../atoms/Icon/Icon.js";
|
|
6
6
|
import { getHideAtStyles as c } from "../../atoms/HideAt.js";
|
|
7
7
|
import { Tooltip as d } from "../../atoms/Tooltip/Tooltip.js";
|
|
8
|
-
import '../../assets/CategoryNav.css';const h = "_categories_1of98_1", f = "_category_1of98_17",
|
|
8
|
+
import '../../assets/CategoryNav.css';const h = "_categories_1of98_1", f = "_category_1of98_17", p = "_submenuTooltip_1of98_43", o = {
|
|
9
9
|
categories: h,
|
|
10
10
|
category: f,
|
|
11
|
-
submenuTooltip:
|
|
11
|
+
submenuTooltip: p
|
|
12
12
|
};
|
|
13
13
|
function z({
|
|
14
14
|
categories: l
|
|
@@ -17,6 +17,8 @@ function z({
|
|
|
17
17
|
(i) => i.children.length > 0 ? /* @__PURE__ */ e(
|
|
18
18
|
d,
|
|
19
19
|
{
|
|
20
|
+
openDelay: 180,
|
|
21
|
+
closeDelay: 0,
|
|
20
22
|
trigger: /* @__PURE__ */ e("li", { className: o.category, tabIndex: 0, children: /* @__PURE__ */ t(s, { href: i.route, children: [
|
|
21
23
|
/* @__PURE__ */ e(n, { size: "sm", weight: "semibold", children: i.label }),
|
|
22
24
|
i.showChevron && /* @__PURE__ */ e(
|
|
@@ -1,17 +1,9 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { CartPropsBase, ShoppingCart, ShoppingCartHandle } from '../../molecules/Cart/Cart';
|
|
3
3
|
import { AccountProps } from '../../molecules/Account/Account';
|
|
4
|
-
|
|
5
|
-
id: string | number;
|
|
6
|
-
label: string;
|
|
7
|
-
route: string;
|
|
8
|
-
}
|
|
9
|
-
export interface MainCategory extends Category {
|
|
10
|
-
children: Category[];
|
|
11
|
-
showChevron?: boolean;
|
|
12
|
-
}
|
|
4
|
+
import { CategoryWithChildren } from '../../molecules/CategoryNav/CategoryNav';
|
|
13
5
|
export interface MainNavProps extends CartPropsBase, React.HTMLAttributes<HTMLDivElement>, Pick<AccountProps, "account"> {
|
|
14
|
-
categories?:
|
|
6
|
+
categories?: CategoryWithChildren[];
|
|
15
7
|
homeRoute: string;
|
|
16
8
|
faqRoute: string;
|
|
17
9
|
byModelSerialRoute: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as u, Fragment as s, jsx as c } from "react/jsx-runtime";
|
|
2
2
|
import { useState as b } from "react";
|
|
3
3
|
import { MainNav as d } from "./MainNav.js";
|
|
4
4
|
import { CartSlideInPanel as m } from "../../molecules/Cart/CartSlideInPanel.js";
|
|
5
|
-
const
|
|
5
|
+
const I = {
|
|
6
6
|
title: "Case Parts/Organisms/MainNav",
|
|
7
7
|
component: d,
|
|
8
8
|
parameters: {
|
|
@@ -10,7 +10,7 @@ const g = {
|
|
|
10
10
|
layout: "fullscreen"
|
|
11
11
|
}
|
|
12
12
|
// tags: ["autodocs"],
|
|
13
|
-
},
|
|
13
|
+
}, o = [
|
|
14
14
|
{
|
|
15
15
|
id: 0,
|
|
16
16
|
label: "Shop by Brands",
|
|
@@ -38,19 +38,34 @@ const g = {
|
|
|
38
38
|
id: 2,
|
|
39
39
|
label: "Hardware",
|
|
40
40
|
route: "#",
|
|
41
|
-
children: [
|
|
41
|
+
children: [
|
|
42
|
+
{ id: 29, label: "Hardware1", route: "/anthony" },
|
|
43
|
+
{ id: 30, label: "Hardware2", route: "/beverage" },
|
|
44
|
+
{ id: 31, label: "Hardwaren3", route: "/continental" },
|
|
45
|
+
{ id: 32, label: "Hardware4", route: "/delfield" }
|
|
46
|
+
]
|
|
42
47
|
},
|
|
43
48
|
{
|
|
44
49
|
id: 3,
|
|
45
50
|
label: "Refrigeration",
|
|
46
51
|
route: "#",
|
|
47
|
-
children: [
|
|
52
|
+
children: [
|
|
53
|
+
{ id: 33, label: "Refrigeration1", route: "/anthony" },
|
|
54
|
+
{ id: 34, label: "Refrigeration2", route: "/beverage" },
|
|
55
|
+
{ id: 34, label: "Refrigeration3", route: "/continental" },
|
|
56
|
+
{ id: 35, label: "Refrigeration4", route: "/delfield" }
|
|
57
|
+
]
|
|
48
58
|
},
|
|
49
59
|
{
|
|
50
60
|
id: 4,
|
|
51
61
|
label: "Controls",
|
|
52
62
|
route: "#",
|
|
53
|
-
children: [
|
|
63
|
+
children: [
|
|
64
|
+
{ id: 36, label: "Controls1", route: "/anthony" },
|
|
65
|
+
{ id: 37, label: "Controls2", route: "/beverage" },
|
|
66
|
+
{ id: 38, label: "Controls3", route: "/continental" },
|
|
67
|
+
{ id: 39, label: "Controls4", route: "/delfield" }
|
|
68
|
+
]
|
|
54
69
|
},
|
|
55
70
|
{
|
|
56
71
|
id: 5,
|
|
@@ -111,20 +126,20 @@ function y(e) {
|
|
|
111
126
|
).toFixed(2)}`;
|
|
112
127
|
}
|
|
113
128
|
const n = (e) => {
|
|
114
|
-
const [
|
|
115
|
-
return /* @__PURE__ */ s
|
|
129
|
+
const [l, t] = b(!1);
|
|
130
|
+
return /* @__PURE__ */ u(s, { children: [
|
|
116
131
|
/* @__PURE__ */ c(
|
|
117
132
|
d,
|
|
118
133
|
{
|
|
119
134
|
...e,
|
|
120
|
-
open:
|
|
135
|
+
open: l,
|
|
121
136
|
onCartClick: () => t((i) => !i)
|
|
122
137
|
}
|
|
123
138
|
),
|
|
124
139
|
/* @__PURE__ */ c(
|
|
125
140
|
m,
|
|
126
141
|
{
|
|
127
|
-
open:
|
|
142
|
+
open: l,
|
|
128
143
|
onClose: () => t(!1),
|
|
129
144
|
cart: e.cart,
|
|
130
145
|
subtotal: y(e.cart),
|
|
@@ -157,10 +172,10 @@ const n = (e) => {
|
|
|
157
172
|
onCartClick: () => {
|
|
158
173
|
},
|
|
159
174
|
// placeholder required by component
|
|
160
|
-
categories:
|
|
175
|
+
categories: o
|
|
161
176
|
},
|
|
162
177
|
render: n
|
|
163
|
-
},
|
|
178
|
+
}, C = {
|
|
164
179
|
args: {
|
|
165
180
|
account: { name: "Ringo", initials: "RS", number: "123456789012" },
|
|
166
181
|
cart: r,
|
|
@@ -179,10 +194,10 @@ const n = (e) => {
|
|
|
179
194
|
},
|
|
180
195
|
onCartClick: () => {
|
|
181
196
|
},
|
|
182
|
-
categories:
|
|
197
|
+
categories: o
|
|
183
198
|
},
|
|
184
199
|
render: n
|
|
185
|
-
},
|
|
200
|
+
}, f = {
|
|
186
201
|
args: {
|
|
187
202
|
cart: r,
|
|
188
203
|
homeRoute: "/",
|
|
@@ -200,13 +215,13 @@ const n = (e) => {
|
|
|
200
215
|
},
|
|
201
216
|
onCartClick: () => {
|
|
202
217
|
},
|
|
203
|
-
categories:
|
|
218
|
+
categories: o
|
|
204
219
|
},
|
|
205
220
|
render: n
|
|
206
221
|
};
|
|
207
222
|
export {
|
|
208
223
|
S as Authenticated,
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
224
|
+
f as Unauthenticated,
|
|
225
|
+
C as WithCartItems,
|
|
226
|
+
I as default
|
|
212
227
|
};
|
|
@@ -1,76 +1,76 @@
|
|
|
1
1
|
import { jsxs as a, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { Image as T } from "../../atoms/Image/Image.js";
|
|
3
3
|
import { Link as g } from "../../atoms/Link/Link.js";
|
|
4
|
-
import { Text as
|
|
5
|
-
import { Availability as
|
|
6
|
-
import { Pricing as
|
|
7
|
-
import { AddToCart as
|
|
8
|
-
import { Icon as
|
|
9
|
-
import { c as
|
|
10
|
-
import '../../assets/Product.css';const P = "
|
|
11
|
-
productCard:
|
|
12
|
-
productInformation:
|
|
13
|
-
purchaseInformation:
|
|
14
|
-
addToCart:
|
|
15
|
-
addToCartButton:
|
|
16
|
-
partNumber:
|
|
17
|
-
partNumberLabel:
|
|
18
|
-
productTile:
|
|
4
|
+
import { Text as o } from "../../atoms/Text/Text.js";
|
|
5
|
+
import { Availability as y } from "../../molecules/Availability/Availability.js";
|
|
6
|
+
import { Pricing as w } from "../../molecules/Pricing/Pricing.js";
|
|
7
|
+
import { AddToCart as v } from "../../molecules/AddToCart/AddToCart.js";
|
|
8
|
+
import { Icon as B } from "../../atoms/Icon/Icon.js";
|
|
9
|
+
import { c as x } from "../../clsx-OuTLNxxd.js";
|
|
10
|
+
import '../../assets/Product.css';const L = "_productCard_15dy7_1", P = "_productInformation_15dy7_22", R = "_purchaseInformation_15dy7_29", $ = "_addToCart_15dy7_37", A = "_addToCartButton_15dy7_40", D = "_partNumber_15dy7_48", j = "_partNumberLabel_15dy7_55", k = "_productTile_15dy7_59", q = "_topRow_15dy7_80", E = "_productData_15dy7_111", F = "_purchase_15dy7_29", G = "_attributeContainer_15dy7_148", r = {
|
|
11
|
+
productCard: L,
|
|
12
|
+
productInformation: P,
|
|
13
|
+
purchaseInformation: R,
|
|
14
|
+
addToCart: $,
|
|
15
|
+
addToCartButton: A,
|
|
16
|
+
partNumber: D,
|
|
17
|
+
partNumberLabel: j,
|
|
18
|
+
productTile: k,
|
|
19
19
|
topRow: q,
|
|
20
20
|
productData: E,
|
|
21
21
|
purchase: F,
|
|
22
22
|
attributeContainer: G
|
|
23
23
|
};
|
|
24
24
|
function Z({
|
|
25
|
-
productView:
|
|
25
|
+
productView: I,
|
|
26
26
|
itemKey: s,
|
|
27
|
-
partNumber:
|
|
27
|
+
partNumber: d,
|
|
28
28
|
productDescription: l,
|
|
29
29
|
availDescription: m,
|
|
30
|
-
availId:
|
|
30
|
+
availId: e,
|
|
31
31
|
contactHref: u,
|
|
32
32
|
contactLinkBehavior: h,
|
|
33
33
|
productHref: p,
|
|
34
34
|
priceLabel: _,
|
|
35
|
-
price:
|
|
35
|
+
price: i,
|
|
36
36
|
imgSrc: N,
|
|
37
37
|
attributes: c,
|
|
38
38
|
className: b,
|
|
39
39
|
onAddToCart: f,
|
|
40
40
|
onClose: C,
|
|
41
|
-
...
|
|
41
|
+
...z
|
|
42
42
|
}) {
|
|
43
|
-
return
|
|
43
|
+
return I === "Card" ? /* @__PURE__ */ a("div", { className: x(r.productCard, b), children: [
|
|
44
44
|
/* @__PURE__ */ t(
|
|
45
45
|
T,
|
|
46
46
|
{
|
|
47
47
|
src: N,
|
|
48
|
-
alt: `${
|
|
49
|
-
height:
|
|
50
|
-
width:
|
|
48
|
+
alt: `${d} product image`,
|
|
49
|
+
height: 96,
|
|
50
|
+
width: 96
|
|
51
51
|
}
|
|
52
52
|
),
|
|
53
53
|
/* @__PURE__ */ a("div", { className: r.productInformation, children: [
|
|
54
54
|
/* @__PURE__ */ t(g, { href: p, children: l }),
|
|
55
55
|
/* @__PURE__ */ a("div", { className: r.partNumber, children: [
|
|
56
|
-
/* @__PURE__ */ t(
|
|
57
|
-
/* @__PURE__ */ t(
|
|
56
|
+
/* @__PURE__ */ t(o, { size: "sm", className: r.partNumberLabel, children: "Part #" }),
|
|
57
|
+
/* @__PURE__ */ t(o, { size: "sm", weight: "semibold", children: d })
|
|
58
58
|
] })
|
|
59
59
|
] }),
|
|
60
60
|
/* @__PURE__ */ a("div", { className: r.purchaseInformation, children: [
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
e && /* @__PURE__ */ t(
|
|
62
|
+
y,
|
|
63
63
|
{
|
|
64
|
-
availId:
|
|
64
|
+
availId: e,
|
|
65
65
|
availDescription: m,
|
|
66
66
|
contactHref: u,
|
|
67
67
|
contactLinkBehavior: h
|
|
68
68
|
}
|
|
69
69
|
),
|
|
70
|
-
|
|
70
|
+
i && /* @__PURE__ */ t(w, { pricingLabel: _, price: i })
|
|
71
71
|
] }),
|
|
72
72
|
/* @__PURE__ */ t(
|
|
73
|
-
|
|
73
|
+
v,
|
|
74
74
|
{
|
|
75
75
|
itemKey: s,
|
|
76
76
|
onAdd: f,
|
|
@@ -80,12 +80,12 @@ function Z({
|
|
|
80
80
|
buttonDoneText: ""
|
|
81
81
|
}
|
|
82
82
|
)
|
|
83
|
-
] }) : /* @__PURE__ */ a("div", { className:
|
|
83
|
+
] }) : /* @__PURE__ */ a("div", { className: x(r.productTile, b), ...z, children: [
|
|
84
84
|
/* @__PURE__ */ t(
|
|
85
85
|
T,
|
|
86
86
|
{
|
|
87
87
|
src: N,
|
|
88
|
-
alt: `${
|
|
88
|
+
alt: `${d} product image`,
|
|
89
89
|
height: 108,
|
|
90
90
|
width: 108
|
|
91
91
|
}
|
|
@@ -95,34 +95,34 @@ function Z({
|
|
|
95
95
|
/* @__PURE__ */ a("div", { className: r.productInformation, children: [
|
|
96
96
|
/* @__PURE__ */ t(g, { href: p, children: l }),
|
|
97
97
|
/* @__PURE__ */ a("div", { className: r.partNumber, children: [
|
|
98
|
-
/* @__PURE__ */ t(
|
|
99
|
-
/* @__PURE__ */ t(
|
|
98
|
+
/* @__PURE__ */ t(o, { size: "sm", className: r.partNumberLabel, children: "Part #" }),
|
|
99
|
+
/* @__PURE__ */ t(o, { size: "sm", weight: "semibold", children: d })
|
|
100
100
|
] })
|
|
101
101
|
] }),
|
|
102
|
-
C && /* @__PURE__ */ t("button", { onClick: () => C(s), children: /* @__PURE__ */ t(
|
|
102
|
+
C && /* @__PURE__ */ t("button", { onClick: () => C(s), children: /* @__PURE__ */ t(B, { size: "sm", iconKey: "fa-light fa-xmark" }) })
|
|
103
103
|
] }),
|
|
104
104
|
/* @__PURE__ */ a("div", { className: r.purchase, children: [
|
|
105
105
|
/* @__PURE__ */ a("div", { className: r.purchaseInformation, children: [
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
e && /* @__PURE__ */ t(
|
|
107
|
+
y,
|
|
108
108
|
{
|
|
109
|
-
availId:
|
|
109
|
+
availId: e,
|
|
110
110
|
availDescription: m,
|
|
111
111
|
contactHref: u,
|
|
112
112
|
contactLinkBehavior: h
|
|
113
113
|
}
|
|
114
114
|
),
|
|
115
|
-
|
|
115
|
+
i && /* @__PURE__ */ t(w, { pricingLabel: _, price: i })
|
|
116
116
|
] }),
|
|
117
|
-
/* @__PURE__ */ t(
|
|
117
|
+
/* @__PURE__ */ t(v, { itemKey: s, onAdd: f, className: r.addToCart, addButtonClassName: r.addToCartButton })
|
|
118
118
|
] }),
|
|
119
|
-
c && c.length > 0 && /* @__PURE__ */ t("ul", { className: r.attributeContainer, children: c.map((
|
|
120
|
-
/* @__PURE__ */ a(
|
|
121
|
-
|
|
119
|
+
c && c.length > 0 && /* @__PURE__ */ t("ul", { className: r.attributeContainer, children: c.map((n) => /* @__PURE__ */ a("li", { children: [
|
|
120
|
+
/* @__PURE__ */ a(o, { size: "xs", weight: "light", children: [
|
|
121
|
+
n.label,
|
|
122
122
|
":"
|
|
123
123
|
] }),
|
|
124
|
-
/* @__PURE__ */ t(
|
|
125
|
-
] }, `${
|
|
124
|
+
/* @__PURE__ */ t(o, { size: "xs", weight: "semibold", children: n.value })
|
|
125
|
+
] }, `${n.label}.${n.value}`)) })
|
|
126
126
|
] })
|
|
127
127
|
] });
|
|
128
128
|
}
|