@caseparts-org/caseblocks 0.0.19 → 0.0.21
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/Cart.css +1 -1
- package/dist/assets/SearchBox.css +1 -1
- package/dist/assets/Tooltip.css +1 -1
- package/dist/main.d.ts +1 -0
- package/dist/molecules/Cart/Cart.d.ts +21 -4
- package/dist/molecules/Cart/Cart.js +55 -19
- package/dist/molecules/Cart/Cart.stories.d.ts +2 -2
- package/dist/molecules/Cart/Cart.stories.js +49 -12
- package/dist/molecules/CategoryNav/CategoryNav.js +6 -5
- package/dist/molecules/SearchBox/SearchBox.d.ts +3 -2
- package/dist/molecules/SearchBox/SearchBox.js +27 -22
- package/dist/molecules/SearchBox/SearchBox.stories.js +5 -5
- package/dist/molecules/Tooltip/Tooltip.js +58 -59
- package/dist/organisms/MainNav/MainNav.d.ts +5 -4
- package/dist/organisms/MainNav/MainNav.js +70 -57
- package/dist/organisms/MainNav/MainNav.stories.js +73 -22
- package/package.json +1 -1
package/dist/assets/Cart.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._cart_15bzn_1{position:relative;border:none;padding:0;margin:0;background-color:transparent}._count_15bzn_8{position:absolute;top:4px;left:17px;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_15bzn_23{height:calc(100vh - 120px);width:375px;box-sizing:border-box;display:grid;grid-template-rows:auto 1fr auto;gap:var(--spacing-1)}._cartItems_15bzn_32{height:100%;overflow-y:auto;overflow-x:hidden}._cartItems_15bzn_32 ul{margin:0;padding:0}._cartItems_15bzn_32 li{list-style:none;margin:0;padding:var(--spacing-0-25);width:100%;display:flex;flex-direction:row;align-items:center}._cartItems_15bzn_32 li p{margin:0;padding:0}._cartItems_15bzn_32 img{height:40px;width:40px}._noItems_15bzn_58{display:flex;flex-direction:row;align-items:center;justify-content:center;height:100%}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._button_1izj4_1{box-sizing:border-box;cursor:pointer;width:var(--spacing-2-5);height:var(--spacing-2-5);padding:var(--spacing-0-5);border-width:0;border-radius:0px var(--spacing-0-125) var(--spacing-0-125) 0px;display:flex;flex-direction:row;align-items:center;justify-content:center;background-color:inherit;color:var(--icons-icon-search)}._text_1izj4_16{flex:1;position:relative;border:none;border-radius:40px;outline:none;font-family:var(--font-family-body);font-size:var(--font-size-sm);line-height:var(--line-height-sm);background:var(--surface-surface-searchBar, #f6f6f6)}._text_1izj4_16::placeholder{font-style:italic;font-weight:var(--font-weight-light);color:var(--text-text-search-bar)}._input_1izj4_32{flex:1;padding:0px var(--spacing-0-5) 0px var(--spacing-0-5);box-sizing:border-box}._inputSearch_1izj4_37{flex:1;border-radius:var(--spacing-0-125)}._searchfield_1izj4_41{flex:1;height:var(--spacing-2-5);border-radius:var(--spacing-2-5);overflow:hidden;background-color:var(--surface-surface-search-bar)}._searchBox_1izj4_48{flex:1;width:100%;min-width:250px;height:var(--spacing-2-5);position:relative;border-radius:var(--spacing-2-5);overflow:hidden;text-align:left;background-color:var(--surface-surface-search-bar)}
|
package/dist/assets/Tooltip.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._content_lgc5i_1{box-shadow:8px 8px 12px #00000026;background-color:#fff;padding:var(--spacing-1);box-sizing:border-box;width:max-content;border:1px solid var(--color-neutrals-neutral-1);border-radius:4px;z-index:9999}
|
package/dist/main.d.ts
CHANGED
|
@@ -27,5 +27,6 @@ export type { SearchBoxProps } from './molecules/SearchBox/SearchBox';
|
|
|
27
27
|
export { ToggleView } from './molecules/ToggleView/ToggleView';
|
|
28
28
|
export type { ToggleViewProps, ToggleOptionProps, ToggleOptionBaseProps, } from './molecules/ToggleView/ToggleView';
|
|
29
29
|
export { MainNav } from './organisms/MainNav/MainNav';
|
|
30
|
+
export type { MainCategory, Category } from './organisms/MainNav/MainNav';
|
|
30
31
|
export { ChipSelector } from './organisms/ChipSelector/ChipSelector';
|
|
31
32
|
export type { ChipSelectorProps } from './organisms/ChipSelector/ChipSelector';
|
|
@@ -1,7 +1,24 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
interface
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
export interface CartItem {
|
|
3
|
+
id: string | number;
|
|
4
|
+
itemId: string | undefined;
|
|
5
|
+
description: string | undefined;
|
|
6
|
+
price: number;
|
|
7
|
+
quantity: number;
|
|
8
|
+
availability: string;
|
|
9
|
+
imageUrl: string | undefined;
|
|
5
10
|
}
|
|
6
|
-
export
|
|
11
|
+
export interface ShoppingCart {
|
|
12
|
+
items: CartItem[];
|
|
13
|
+
}
|
|
14
|
+
export interface CartPropsBase {
|
|
15
|
+
onItemQtyChange: (_item: CartItem, _newQuantity: number) => void;
|
|
16
|
+
onItemDelete: (_item: CartItem) => void;
|
|
17
|
+
onItemEdit: (_item: CartItem) => void;
|
|
18
|
+
onCheckout: () => void;
|
|
19
|
+
cart: ShoppingCart;
|
|
20
|
+
}
|
|
21
|
+
interface CartProps extends CartPropsBase, React.HtmlHTMLAttributes<HTMLButtonElement> {
|
|
22
|
+
}
|
|
23
|
+
export declare function ShoppingCart({ cart, onItemQtyChange, onItemDelete, onItemEdit, onCheckout, ...otherProps }: CartProps): import("react/jsx-runtime").JSX.Element;
|
|
7
24
|
export {};
|
|
@@ -1,23 +1,59 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Icon as
|
|
3
|
-
import { Text as
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { jsx as t, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import { Icon as m } from "../../atoms/Icon/Icon.js";
|
|
3
|
+
import { Text as n } from "../../atoms/Text/Text.js";
|
|
4
|
+
import { Button as a } from "../../atoms/Button/Button.js";
|
|
5
|
+
import { Tooltip as l } from "../Tooltip/Tooltip.js";
|
|
6
|
+
import '../../assets/Cart.css';const d = "_cart_15bzn_1", h = "_count_15bzn_8", p = "_cartContainer_15bzn_23", g = "_cartItems_15bzn_32", _ = "_noItems_15bzn_58", s = {
|
|
7
|
+
cart: d,
|
|
8
|
+
count: h,
|
|
9
|
+
cartContainer: p,
|
|
10
|
+
cartItems: g,
|
|
11
|
+
noItems: _
|
|
7
12
|
};
|
|
8
|
-
function
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
function v({
|
|
14
|
+
cart: e,
|
|
15
|
+
onItemQtyChange: I,
|
|
16
|
+
onItemDelete: u,
|
|
17
|
+
onItemEdit: z,
|
|
18
|
+
onCheckout: o,
|
|
19
|
+
...c
|
|
20
|
+
}) {
|
|
21
|
+
return e = e || { items: [] }, /* @__PURE__ */ t(
|
|
22
|
+
l,
|
|
23
|
+
{
|
|
24
|
+
trigger: /* @__PURE__ */ i("button", { className: s.cart, ...c, children: [
|
|
25
|
+
/* @__PURE__ */ t(
|
|
26
|
+
m,
|
|
27
|
+
{
|
|
28
|
+
iconKey: "fa-kit fa-shoppingcart-empty",
|
|
29
|
+
title: "Shopping Cart",
|
|
30
|
+
size: "lg"
|
|
31
|
+
}
|
|
32
|
+
),
|
|
33
|
+
e.items.length > 0 && /* @__PURE__ */ t("div", { className: s.count, children: /* @__PURE__ */ t(n, { size: "xxs", children: e.items.length }) })
|
|
34
|
+
] }),
|
|
35
|
+
arrow: !1,
|
|
36
|
+
position: "bottom right",
|
|
37
|
+
on: "click",
|
|
38
|
+
children: /* @__PURE__ */ i("div", { className: s.cartContainer, children: [
|
|
39
|
+
/* @__PURE__ */ t(n, { as: "h1", size: "2xl", children: "Cart" }),
|
|
40
|
+
/* @__PURE__ */ t("div", { className: s.cartItems, children: e.items.length > 0 ? /* @__PURE__ */ t("ul", { children: e.items.map(
|
|
41
|
+
(r) => /* @__PURE__ */ i("li", { children: [
|
|
42
|
+
/* @__PURE__ */ t("img", { src: r.imageUrl, alt: `${r.itemId} product image` }),
|
|
43
|
+
/* @__PURE__ */ i("div", { children: [
|
|
44
|
+
/* @__PURE__ */ t(n, { as: "p", size: "sm", children: r.description }),
|
|
45
|
+
/* @__PURE__ */ i(n, { as: "p", size: "sm", children: [
|
|
46
|
+
"Part # ",
|
|
47
|
+
r.itemId
|
|
48
|
+
] })
|
|
49
|
+
] })
|
|
50
|
+
] })
|
|
51
|
+
) }) : /* @__PURE__ */ t("div", { className: s.noItems, children: /* @__PURE__ */ t(n, { as: "p", size: "sm", children: "No items in your cart yet" }) }) }),
|
|
52
|
+
/* @__PURE__ */ t(a, { disabled: e.items.length === 0, onClick: o, variant: "cta-primary", size: "md", children: "Checkout" })
|
|
53
|
+
] })
|
|
54
|
+
}
|
|
55
|
+
);
|
|
20
56
|
}
|
|
21
57
|
export {
|
|
22
|
-
|
|
58
|
+
v as ShoppingCart
|
|
23
59
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
-
import {
|
|
2
|
+
import { ShoppingCart } from './Cart';
|
|
3
3
|
declare const meta: {
|
|
4
4
|
title: string;
|
|
5
|
-
component: typeof
|
|
5
|
+
component: typeof ShoppingCart;
|
|
6
6
|
parameters: {
|
|
7
7
|
layout: string;
|
|
8
8
|
};
|
|
@@ -1,24 +1,61 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const
|
|
1
|
+
import { ShoppingCart as e } from "./Cart.js";
|
|
2
|
+
const r = {
|
|
3
3
|
title: "Case Parts/Molecules/Cart",
|
|
4
|
-
component:
|
|
4
|
+
component: e,
|
|
5
5
|
parameters: {
|
|
6
6
|
layout: "centered"
|
|
7
7
|
},
|
|
8
8
|
tags: ["autodocs"]
|
|
9
|
-
},
|
|
9
|
+
}, t = "https://m.media-amazon.com/images/I/216+JEttsYL._UF1000,1000_QL80_.jpg", i = {
|
|
10
|
+
items: [
|
|
11
|
+
{ id: 1, itemId: "1094-01", description: "Kason Door Closer - Flush", price: 99.99, quantity: 1, imageUrl: t, availability: "In Stock" },
|
|
12
|
+
{ id: 2, itemId: "810810", description: "True Door Gasket", price: 9.99, quantity: 1, imageUrl: t, availability: "In Stock" },
|
|
13
|
+
{ id: 3, itemId: "MG064", description: '36" x 79" 3-Sided Dart-to-Dart Gasket', price: 9.99, quantity: 1, imageUrl: t, availability: "" },
|
|
14
|
+
{ id: 4, itemId: "MG064-B", description: '36" x 79" 3-Sided Dart-to-Dart Gasket', price: 9.99, quantity: 1, imageUrl: t, availability: "" },
|
|
15
|
+
{ id: 5, itemId: "Warmer Wire", description: '228" 7.0 ohms 115V', price: 9.99, quantity: 1, imageUrl: t, availability: "" },
|
|
16
|
+
{ id: 6, itemId: "810803", description: "True Door Gasket", price: 9.99, quantity: 1, imageUrl: t, availability: "In Stock" },
|
|
17
|
+
{ id: 7, itemId: "ABG-12114-PF", description: "Adhesive Sponge Gasket 1/4", price: 9.99, quantity: 10, imageUrl: t, availability: "In Stock" },
|
|
18
|
+
{ id: 8, itemId: "ABG-12138-PF", description: "Adhesive Sponge Gasket 3/8", price: 9.99, quantity: 10, imageUrl: t, availability: "In Stock" },
|
|
19
|
+
{ id: 9, itemId: "1094-C1", description: "Kason Door Closer - Flush", price: 20.99, quantity: 1, imageUrl: t, availability: "In Stock" },
|
|
20
|
+
{ id: 10, itemId: "1094-02", description: "Kason Door Closer - Offset", price: 30.05, quantity: 1, imageUrl: t, availability: "In Stock" },
|
|
21
|
+
{ id: 11, itemId: "1092-01", description: "Kason Door Closer - Flush", price: 40.1, quantity: 1, imageUrl: t, availability: "In Stock" },
|
|
22
|
+
{ id: 12, itemId: "1092-02", description: "Kason Door Closer - Offset", price: 50.15, quantity: 1, imageUrl: t, availability: "In Stock" }
|
|
23
|
+
]
|
|
24
|
+
}, o = {
|
|
10
25
|
args: {
|
|
11
|
-
|
|
12
|
-
|
|
26
|
+
cart: { items: [] },
|
|
27
|
+
onCheckout: () => {
|
|
28
|
+
alert("Checkout");
|
|
29
|
+
},
|
|
30
|
+
onItemDelete: () => {
|
|
31
|
+
alert("Delete");
|
|
32
|
+
},
|
|
33
|
+
onItemEdit: () => {
|
|
34
|
+
alert("Delete");
|
|
35
|
+
},
|
|
36
|
+
onItemQtyChange: () => {
|
|
37
|
+
alert("Delete");
|
|
38
|
+
}
|
|
13
39
|
}
|
|
14
|
-
},
|
|
40
|
+
}, l = {
|
|
15
41
|
args: {
|
|
16
|
-
|
|
17
|
-
|
|
42
|
+
cart: i,
|
|
43
|
+
onCheckout: () => {
|
|
44
|
+
alert("Checkout");
|
|
45
|
+
},
|
|
46
|
+
onItemDelete: () => {
|
|
47
|
+
alert("Delete");
|
|
48
|
+
},
|
|
49
|
+
onItemEdit: () => {
|
|
50
|
+
alert("Delete");
|
|
51
|
+
},
|
|
52
|
+
onItemQtyChange: () => {
|
|
53
|
+
alert("Delete");
|
|
54
|
+
}
|
|
18
55
|
}
|
|
19
56
|
};
|
|
20
57
|
export {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
58
|
+
l as CartWithItems,
|
|
59
|
+
o as EmptyCart,
|
|
60
|
+
r as default
|
|
24
61
|
};
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
2
|
-
import { c } from "../../clsx-OuTLNxxd.js";
|
|
2
|
+
import { c as a } from "../../clsx-OuTLNxxd.js";
|
|
3
3
|
import { Text as n } from "../../atoms/Text/Text.js";
|
|
4
4
|
import { Link as s } from "../../atoms/Link/Link.js";
|
|
5
5
|
import { Icon as m } from "../../atoms/Icon/Icon.js";
|
|
6
|
+
import { getHideAtStyles as c } from "../../atoms/HideAt.js";
|
|
6
7
|
import { Tooltip as h } from "../Tooltip/Tooltip.js";
|
|
7
|
-
import { getHideAtStyles as a } from "../../atoms/HideAt.js";
|
|
8
8
|
import '../../assets/CategoryNav.css';const d = "_categories_1m4w9_1", u = "_category_1m4w9_16", p = "_submenuTooltip_1m4w9_42", o = {
|
|
9
9
|
categories: d,
|
|
10
10
|
category: u,
|
|
11
11
|
submenuTooltip: p
|
|
12
12
|
};
|
|
13
13
|
function z({
|
|
14
|
-
categories:
|
|
14
|
+
categories: r
|
|
15
15
|
}) {
|
|
16
|
-
return !
|
|
16
|
+
return !r || r.length === 0 ? null : /* @__PURE__ */ e("ul", { className: a(o.categories, c(["sm"])), children: r.map(
|
|
17
17
|
(i) => i.children.length > 0 ? /* @__PURE__ */ e(
|
|
18
18
|
h,
|
|
19
19
|
{
|
|
20
|
+
arrow: !1,
|
|
20
21
|
trigger: /* @__PURE__ */ e("li", { className: o.category, children: /* @__PURE__ */ t(s, { href: i.route, children: [
|
|
21
22
|
/* @__PURE__ */ e(n, { size: "sm", weight: "semibold", children: i.label }),
|
|
22
23
|
i.showChevron && /* @__PURE__ */ e(
|
|
@@ -30,7 +31,7 @@ function z({
|
|
|
30
31
|
] }) }),
|
|
31
32
|
on: "hover",
|
|
32
33
|
position: "bottom center",
|
|
33
|
-
children: /* @__PURE__ */ e("ul", { className: o.submenuTooltip, children: i.children.map((
|
|
34
|
+
children: /* @__PURE__ */ e("ul", { className: o.submenuTooltip, children: i.children.map((l) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(s, { href: l.route, children: /* @__PURE__ */ e(n, { size: "sm", weight: "semibold", children: l.label }) }) }, l.id)) })
|
|
34
35
|
},
|
|
35
36
|
i.id
|
|
36
37
|
) : /* @__PURE__ */ e("li", { className: o.category, children: /* @__PURE__ */ t(s, { href: i.route, children: [
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { HideAtProps } from '../../atoms/HideAt';
|
|
2
2
|
/** A search box. */
|
|
3
3
|
export interface SearchBoxProps extends React.HTMLAttributes<HTMLDivElement>, HideAtProps {
|
|
4
|
-
|
|
4
|
+
onSearch: (_input: string) => void;
|
|
5
|
+
inputName?: string;
|
|
5
6
|
}
|
|
6
|
-
export declare function SearchBox({
|
|
7
|
+
export declare function SearchBox({ onSearch, inputName, hideAt, className, ...otherProps }: SearchBoxProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,50 +1,55 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { c as
|
|
1
|
+
import { jsx as e, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import { c as h } from "../../clsx-OuTLNxxd.js";
|
|
3
3
|
import { Flex as r } from "../../atoms/Flex/Flex.js";
|
|
4
|
-
import { getHideAtStyles as
|
|
5
|
-
import { Icon as
|
|
6
|
-
import '../../assets/SearchBox.css';const
|
|
7
|
-
button:
|
|
8
|
-
text:
|
|
9
|
-
input:
|
|
10
|
-
inputSearch:
|
|
11
|
-
searchfield:
|
|
12
|
-
searchBox:
|
|
4
|
+
import { getHideAtStyles as u } from "../../atoms/HideAt.js";
|
|
5
|
+
import { Icon as f } from "../../atoms/Icon/Icon.js";
|
|
6
|
+
import '../../assets/SearchBox.css';const p = "_button_1izj4_1", x = "_text_1izj4_16", _ = "_input_1izj4_32", d = "_inputSearch_1izj4_37", g = "_searchfield_1izj4_41", b = "_searchBox_1izj4_48", t = {
|
|
7
|
+
button: p,
|
|
8
|
+
text: x,
|
|
9
|
+
input: _,
|
|
10
|
+
inputSearch: d,
|
|
11
|
+
searchfield: g,
|
|
12
|
+
searchBox: b
|
|
13
13
|
};
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
function D({
|
|
15
|
+
onSearch: i,
|
|
16
|
+
inputName: c,
|
|
17
|
+
hideAt: s,
|
|
18
|
+
className: o,
|
|
19
|
+
...a
|
|
19
20
|
}) {
|
|
20
21
|
return /* @__PURE__ */ e(
|
|
21
22
|
r,
|
|
22
23
|
{
|
|
23
24
|
flexDirection: "row",
|
|
24
25
|
alignItems: "center",
|
|
25
|
-
className:
|
|
26
|
-
...
|
|
26
|
+
className: h(t.searchBox, u(s), o),
|
|
27
|
+
...a,
|
|
27
28
|
children: /* @__PURE__ */ e(
|
|
28
29
|
r,
|
|
29
30
|
{
|
|
30
31
|
flexDirection: "row",
|
|
31
32
|
alignItems: "center",
|
|
32
33
|
className: t.searchfield,
|
|
33
|
-
children: /* @__PURE__ */ e("div", { className: t.inputSearch, children: /* @__PURE__ */ e("form", {
|
|
34
|
+
children: /* @__PURE__ */ e("div", { className: t.inputSearch, children: /* @__PURE__ */ e("form", { onSubmit: (n) => {
|
|
35
|
+
n.preventDefault();
|
|
36
|
+
const l = (new FormData(n.currentTarget).get(c ?? "search") || "").trim();
|
|
37
|
+
i(l);
|
|
38
|
+
}, children: /* @__PURE__ */ m(
|
|
34
39
|
r,
|
|
35
40
|
{
|
|
36
41
|
className: t.input,
|
|
37
42
|
flexDirection: "row",
|
|
38
43
|
alignItems: "center",
|
|
39
44
|
children: [
|
|
40
|
-
/* @__PURE__ */ e("button", { className: t.button, type: "submit", children: /* @__PURE__ */ e(
|
|
45
|
+
/* @__PURE__ */ e("button", { className: t.button, type: "submit", children: /* @__PURE__ */ e(f, { iconKey: "fa-regular fa-magnifying-glass", size: "sm" }) }),
|
|
41
46
|
/* @__PURE__ */ e(
|
|
42
47
|
"input",
|
|
43
48
|
{
|
|
44
49
|
type: "text",
|
|
45
50
|
className: t.text,
|
|
46
51
|
placeholder: "Search by keyword(s) or Part #....",
|
|
47
|
-
name: "
|
|
52
|
+
name: c ?? "search"
|
|
48
53
|
}
|
|
49
54
|
)
|
|
50
55
|
]
|
|
@@ -56,5 +61,5 @@ function S({
|
|
|
56
61
|
);
|
|
57
62
|
}
|
|
58
63
|
export {
|
|
59
|
-
|
|
64
|
+
D as SearchBox
|
|
60
65
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { SearchBox as
|
|
2
|
-
const
|
|
1
|
+
import { SearchBox as a } from "./SearchBox.js";
|
|
2
|
+
const r = {
|
|
3
3
|
title: "Case Parts/Molecules/SearchBox",
|
|
4
|
-
component:
|
|
4
|
+
component: a,
|
|
5
5
|
parameters: {
|
|
6
6
|
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
|
|
7
7
|
layout: "centered"
|
|
8
8
|
}
|
|
9
9
|
}, o = {
|
|
10
|
-
args: {
|
|
10
|
+
args: { onSearch: (e) => alert(`Search ${e}`) }
|
|
11
11
|
};
|
|
12
12
|
export {
|
|
13
13
|
o as Default,
|
|
14
|
-
|
|
14
|
+
r as default
|
|
15
15
|
};
|
|
@@ -14,10 +14,10 @@ var K = { exports: {} }, O = {};
|
|
|
14
14
|
* This source code is licensed under the MIT license found in the
|
|
15
15
|
* LICENSE file in the root directory of this source tree.
|
|
16
16
|
*/
|
|
17
|
-
var
|
|
17
|
+
var Ee;
|
|
18
18
|
function Ke() {
|
|
19
|
-
if (
|
|
20
|
-
|
|
19
|
+
if (Ee) return O;
|
|
20
|
+
Ee = 1;
|
|
21
21
|
var s = T;
|
|
22
22
|
function i(n) {
|
|
23
23
|
var t = "https://react.dev/errors/" + n;
|
|
@@ -147,7 +147,7 @@ function Ke() {
|
|
|
147
147
|
return p.H.useHostTransitionStatus();
|
|
148
148
|
}, O.version = "19.1.1", O;
|
|
149
149
|
}
|
|
150
|
-
var
|
|
150
|
+
var E = {};
|
|
151
151
|
/**
|
|
152
152
|
* @license React
|
|
153
153
|
* react-dom.development.js
|
|
@@ -157,9 +157,9 @@ var _ = {};
|
|
|
157
157
|
* This source code is licensed under the MIT license found in the
|
|
158
158
|
* LICENSE file in the root directory of this source tree.
|
|
159
159
|
*/
|
|
160
|
-
var
|
|
160
|
+
var _e;
|
|
161
161
|
function We() {
|
|
162
|
-
return
|
|
162
|
+
return _e || (_e = 1, process.env.NODE_ENV !== "production" && function() {
|
|
163
163
|
function s() {
|
|
164
164
|
}
|
|
165
165
|
function i(r) {
|
|
@@ -169,11 +169,11 @@ function We() {
|
|
|
169
169
|
var y = 3 < arguments.length && arguments[3] !== void 0 ? arguments[3] : null;
|
|
170
170
|
try {
|
|
171
171
|
i(y);
|
|
172
|
-
var
|
|
172
|
+
var g = !1;
|
|
173
173
|
} catch {
|
|
174
|
-
|
|
174
|
+
g = !0;
|
|
175
175
|
}
|
|
176
|
-
return
|
|
176
|
+
return g && (console.error(
|
|
177
177
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
178
178
|
typeof Symbol == "function" && Symbol.toStringTag && y[Symbol.toStringTag] || y.constructor.name || "Object"
|
|
179
179
|
), i(y)), {
|
|
@@ -227,12 +227,12 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
|
|
|
227
227
|
}, t = Symbol.for("react.portal"), l = m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
228
228
|
typeof Map == "function" && Map.prototype != null && typeof Map.prototype.forEach == "function" && typeof Set == "function" && Set.prototype != null && typeof Set.prototype.clear == "function" && typeof Set.prototype.forEach == "function" || console.error(
|
|
229
229
|
"React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"
|
|
230
|
-
),
|
|
230
|
+
), E.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = n, E.createPortal = function(r, e) {
|
|
231
231
|
var o = 2 < arguments.length && arguments[2] !== void 0 ? arguments[2] : null;
|
|
232
232
|
if (!e || e.nodeType !== 1 && e.nodeType !== 9 && e.nodeType !== 11)
|
|
233
233
|
throw Error("Target container is not a DOM element.");
|
|
234
234
|
return c(r, e, null, o);
|
|
235
|
-
},
|
|
235
|
+
}, E.flushSync = function(r) {
|
|
236
236
|
var e = l.T, o = n.p;
|
|
237
237
|
try {
|
|
238
238
|
if (l.T = null, n.p = 2, r)
|
|
@@ -242,7 +242,7 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
|
|
|
242
242
|
"flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task."
|
|
243
243
|
);
|
|
244
244
|
}
|
|
245
|
-
},
|
|
245
|
+
}, E.preconnect = function(r, e) {
|
|
246
246
|
typeof r == "string" && r ? e != null && typeof e != "object" ? console.error(
|
|
247
247
|
"ReactDOM.preconnect(): Expected the `options` argument (second) to be an object but encountered %s instead. The only supported option at this time is `crossOrigin` which accepts a string.",
|
|
248
248
|
d(e)
|
|
@@ -253,7 +253,7 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
|
|
|
253
253
|
"ReactDOM.preconnect(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",
|
|
254
254
|
f(r)
|
|
255
255
|
), typeof r == "string" && (e ? (e = e.crossOrigin, e = typeof e == "string" ? e === "use-credentials" ? e : "" : void 0) : e = null, n.d.C(r, e));
|
|
256
|
-
},
|
|
256
|
+
}, E.prefetchDNS = function(r) {
|
|
257
257
|
if (typeof r != "string" || !r)
|
|
258
258
|
console.error(
|
|
259
259
|
"ReactDOM.prefetchDNS(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",
|
|
@@ -270,7 +270,7 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
|
|
|
270
270
|
);
|
|
271
271
|
}
|
|
272
272
|
typeof r == "string" && n.d.D(r);
|
|
273
|
-
},
|
|
273
|
+
}, E.preinit = function(r, e) {
|
|
274
274
|
if (typeof r == "string" && r ? e == null || typeof e != "object" ? console.error(
|
|
275
275
|
"ReactDOM.preinit(): Expected the `options` argument (second) to be an object with an `as` property describing the type of resource to be preinitialized but encountered %s instead.",
|
|
276
276
|
d(e)
|
|
@@ -281,23 +281,23 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
|
|
|
281
281
|
"ReactDOM.preinit(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",
|
|
282
282
|
f(r)
|
|
283
283
|
), typeof r == "string" && e && typeof e.as == "string") {
|
|
284
|
-
var o = e.as, y = a(o, e.crossOrigin),
|
|
284
|
+
var o = e.as, y = a(o, e.crossOrigin), g = typeof e.integrity == "string" ? e.integrity : void 0, w = typeof e.fetchPriority == "string" ? e.fetchPriority : void 0;
|
|
285
285
|
o === "style" ? n.d.S(
|
|
286
286
|
r,
|
|
287
287
|
typeof e.precedence == "string" ? e.precedence : void 0,
|
|
288
288
|
{
|
|
289
289
|
crossOrigin: y,
|
|
290
|
-
integrity:
|
|
290
|
+
integrity: g,
|
|
291
291
|
fetchPriority: w
|
|
292
292
|
}
|
|
293
293
|
) : o === "script" && n.d.X(r, {
|
|
294
294
|
crossOrigin: y,
|
|
295
|
-
integrity:
|
|
295
|
+
integrity: g,
|
|
296
296
|
fetchPriority: w,
|
|
297
297
|
nonce: typeof e.nonce == "string" ? e.nonce : void 0
|
|
298
298
|
});
|
|
299
299
|
}
|
|
300
|
-
},
|
|
300
|
+
}, E.preinitModule = function(r, e) {
|
|
301
301
|
var o = "";
|
|
302
302
|
if (typeof r == "string" && r || (o += " The `href` argument encountered was " + f(r) + "."), e !== void 0 && typeof e != "object" ? o += " The `options` argument encountered was " + f(e) + "." : e && "as" in e && e.as !== "script" && (o += " The `as` option encountered was " + d(e.as) + "."), o)
|
|
303
303
|
console.error(
|
|
@@ -323,7 +323,7 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
|
|
|
323
323
|
integrity: typeof e.integrity == "string" ? e.integrity : void 0,
|
|
324
324
|
nonce: typeof e.nonce == "string" ? e.nonce : void 0
|
|
325
325
|
})) : e == null && n.d.M(r));
|
|
326
|
-
},
|
|
326
|
+
}, E.preload = function(r, e) {
|
|
327
327
|
var o = "";
|
|
328
328
|
if (typeof r == "string" && r || (o += " The `href` argument encountered was " + f(r) + "."), e == null || typeof e != "object" ? o += " The `options` argument encountered was " + f(e) + "." : typeof e.as == "string" && e.as || (o += " The `as` option encountered was " + f(e.as) + "."), o && console.error(
|
|
329
329
|
'ReactDOM.preload(): Expected two arguments, a non-empty `href` string and an `options` object with an `as` property valid for a `<link rel="preload" as="..." />` tag.%s',
|
|
@@ -346,7 +346,7 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
|
|
|
346
346
|
media: typeof e.media == "string" ? e.media : void 0
|
|
347
347
|
});
|
|
348
348
|
}
|
|
349
|
-
},
|
|
349
|
+
}, E.preloadModule = function(r, e) {
|
|
350
350
|
var o = "";
|
|
351
351
|
typeof r == "string" && r || (o += " The `href` argument encountered was " + f(r) + "."), e !== void 0 && typeof e != "object" ? o += " The `options` argument encountered was " + f(e) + "." : e && "as" in e && typeof e.as != "string" && (o += " The `as` option encountered was " + f(e.as) + "."), o && console.error(
|
|
352
352
|
'ReactDOM.preloadModule(): Expected two arguments, a non-empty `href` string and, optionally, an `options` object with an `as` property valid for a `<link rel="modulepreload" as="..." />` tag.%s',
|
|
@@ -359,16 +359,16 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
|
|
|
359
359
|
crossOrigin: o,
|
|
360
360
|
integrity: typeof e.integrity == "string" ? e.integrity : void 0
|
|
361
361
|
})) : n.d.m(r));
|
|
362
|
-
},
|
|
362
|
+
}, E.requestFormReset = function(r) {
|
|
363
363
|
n.d.r(r);
|
|
364
|
-
},
|
|
364
|
+
}, E.unstable_batchedUpdates = function(r, e) {
|
|
365
365
|
return r(e);
|
|
366
|
-
},
|
|
366
|
+
}, E.useFormState = function(r, e, o) {
|
|
367
367
|
return p().useFormState(r, e, o);
|
|
368
|
-
},
|
|
368
|
+
}, E.useFormStatus = function() {
|
|
369
369
|
return p().useHostTransitionStatus();
|
|
370
|
-
},
|
|
371
|
-
}()),
|
|
370
|
+
}, E.version = "19.1.1", typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
371
|
+
}()), E;
|
|
372
372
|
}
|
|
373
373
|
function Se() {
|
|
374
374
|
if (!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ > "u" || typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE != "function")) {
|
|
@@ -491,7 +491,7 @@ var Ze = function(i, c) {
|
|
|
491
491
|
}
|
|
492
492
|
}
|
|
493
493
|
}, nt = ["top left", "top center", "top right", "right top", "right center", "right bottom", "bottom left", "bottom center", "bottom right", "left top", "left center", "left bottom"], ot = function(i, c, a, f, d) {
|
|
494
|
-
var p = d.offsetX, m = d.offsetY, n = f ? 8 : 0, t = a.split(" "), l = i.top + i.height / 2, r = i.left + i.width / 2, e = c.height, o = c.width, y = l - e / 2,
|
|
494
|
+
var p = d.offsetX, m = d.offsetY, n = f ? 8 : 0, t = a.split(" "), l = i.top + i.height / 2, r = i.left + i.width / 2, e = c.height, o = c.width, y = l - e / 2, g = r - o / 2, w = "", R = "0%", k = "0%";
|
|
495
495
|
switch (t[0]) {
|
|
496
496
|
case "top":
|
|
497
497
|
y -= e / 2 + i.height / 2 + n, w = "rotate(180deg) translateX(50%)", R = "100%", k = "50%";
|
|
@@ -500,10 +500,10 @@ var Ze = function(i, c) {
|
|
|
500
500
|
y += e / 2 + i.height / 2 + n, w = "rotate(0deg) translateY(-100%) translateX(-50%)", k = "50%";
|
|
501
501
|
break;
|
|
502
502
|
case "left":
|
|
503
|
-
|
|
503
|
+
g -= o / 2 + i.width / 2 + n, w = " rotate(90deg) translateY(50%) translateX(-25%)", k = "100%", R = "50%";
|
|
504
504
|
break;
|
|
505
505
|
case "right":
|
|
506
|
-
|
|
506
|
+
g += o / 2 + i.width / 2 + n, w = "rotate(-90deg) translateY(-150%) translateX(25%)", R = "50%";
|
|
507
507
|
break;
|
|
508
508
|
}
|
|
509
509
|
switch (t[1]) {
|
|
@@ -514,15 +514,15 @@ var Ze = function(i, c) {
|
|
|
514
514
|
y = i.top - e + i.height, R = e - i.height / 2 + "px";
|
|
515
515
|
break;
|
|
516
516
|
case "left":
|
|
517
|
-
|
|
517
|
+
g = i.left, k = i.width / 2 + "px";
|
|
518
518
|
break;
|
|
519
519
|
case "right":
|
|
520
|
-
|
|
520
|
+
g = i.left - o + i.width, k = o - i.width / 2 + "px";
|
|
521
521
|
break;
|
|
522
522
|
}
|
|
523
|
-
return y = t[0] === "top" ? y - m : y + m,
|
|
523
|
+
return y = t[0] === "top" ? y - m : y + m, g = t[0] === "left" ? g - p : g + p, {
|
|
524
524
|
top: y,
|
|
525
|
-
left:
|
|
525
|
+
left: g,
|
|
526
526
|
transform: w,
|
|
527
527
|
arrowLeft: k,
|
|
528
528
|
arrowTop: R
|
|
@@ -574,9 +574,9 @@ var Ze = function(i, c) {
|
|
|
574
574
|
}, lt = /* @__PURE__ */ Xe(function(s, i) {
|
|
575
575
|
var c = s.trigger, a = c === void 0 ? null : c, f = s.onOpen, d = f === void 0 ? function() {
|
|
576
576
|
} : f, p = s.onClose, m = p === void 0 ? function() {
|
|
577
|
-
} : p, n = s.defaultOpen, t = n === void 0 ? !1 : n, l = s.open, r = l === void 0 ? void 0 : l, e = s.disabled, o = e === void 0 ? !1 : e, y = s.nested,
|
|
577
|
+
} : p, n = s.defaultOpen, t = n === void 0 ? !1 : n, l = s.open, r = l === void 0 ? void 0 : l, e = s.disabled, o = e === void 0 ? !1 : e, y = s.nested, g = y === void 0 ? !1 : y, w = s.closeOnDocumentClick, R = w === void 0 ? !0 : w, k = s.repositionOnResize, we = k === void 0 ? !0 : k, W = s.closeOnEscape, Te = W === void 0 ? !0 : W, J = s.on, I = J === void 0 ? ["click"] : J, Q = s.contentStyle, Re = Q === void 0 ? {} : Q, Z = s.arrowStyle, X = Z === void 0 ? {} : Z, B = s.overlayStyle, De = B === void 0 ? {} : B, ee = s.className, A = ee === void 0 ? "" : ee, te = s.position, ke = te === void 0 ? "bottom center" : te, re = s.modal, ne = re === void 0 ? !1 : re, oe = s.lockScroll, ie = oe === void 0 ? !1 : oe, ae = s.arrow, F = ae === void 0 ? !0 : ae, se = s.offsetX, Ce = se === void 0 ? 0 : se, ce = s.offsetY, Le = ce === void 0 ? 0 : ce, le = s.mouseEnterDelay, Pe = le === void 0 ? 100 : le, ue = s.mouseLeaveDelay, Me = ue === void 0 ? 100 : ue, fe = s.keepTooltipInside, Ae = fe === void 0 ? !1 : fe, z = s.children, de = Fe(r || t), D = de[0], pe = de[1], C = N(null), b = N(null), P = N(null), ye = N(null), ge = N("popup-" + ++st), S = ne ? !0 : !a, j = N(0);
|
|
578
578
|
rt(function() {
|
|
579
|
-
return D ? (ye.current = document.activeElement,
|
|
579
|
+
return D ? (ye.current = document.activeElement, ve(), je(), xe()) : Ie(), function() {
|
|
580
580
|
clearTimeout(j.current);
|
|
581
581
|
};
|
|
582
582
|
}, [D]), x(function() {
|
|
@@ -587,8 +587,8 @@ var Ze = function(i, c) {
|
|
|
587
587
|
return d(u);
|
|
588
588
|
}, 0));
|
|
589
589
|
}, L = function(u) {
|
|
590
|
-
var
|
|
591
|
-
!D || o || (pe(!1), S && ((
|
|
590
|
+
var _;
|
|
591
|
+
!D || o || (pe(!1), S && ((_ = ye.current) === null || _ === void 0 || _.focus()), setTimeout(function() {
|
|
592
592
|
return m(u);
|
|
593
593
|
}, 0));
|
|
594
594
|
}, V = function(u) {
|
|
@@ -608,8 +608,8 @@ var Ze = function(i, c) {
|
|
|
608
608
|
}, Ie = function() {
|
|
609
609
|
S && ie && (document.getElementsByTagName("body")[0].style.overflow = "auto");
|
|
610
610
|
}, je = function() {
|
|
611
|
-
var u,
|
|
612
|
-
|
|
611
|
+
var u, _ = b == null || (u = b.current) === null || u === void 0 ? void 0 : u.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]'), v = Array.prototype.slice.call(_)[0];
|
|
612
|
+
v == null || v.focus();
|
|
613
613
|
};
|
|
614
614
|
Ge(i, function() {
|
|
615
615
|
return {
|
|
@@ -624,26 +624,26 @@ var Ze = function(i, c) {
|
|
|
624
624
|
}
|
|
625
625
|
};
|
|
626
626
|
});
|
|
627
|
-
var
|
|
627
|
+
var ve = function() {
|
|
628
628
|
if (!(S || !D) && !(!(C != null && C.current) || !(C != null && C.current) || !(b != null && b.current))) {
|
|
629
|
-
var u = C.current.getBoundingClientRect(),
|
|
629
|
+
var u = C.current.getBoundingClientRect(), _ = b.current.getBoundingClientRect(), v = at(u, _, ke, F, {
|
|
630
630
|
offsetX: Ce,
|
|
631
631
|
offsetY: Le
|
|
632
632
|
}, Ae);
|
|
633
|
-
if (b.current.style.top =
|
|
633
|
+
if (b.current.style.top = v.top + window.scrollY + "px", b.current.style.left = v.left + window.scrollX + "px", F && P.current) {
|
|
634
634
|
var M, $;
|
|
635
|
-
P.current.style.transform =
|
|
635
|
+
P.current.style.transform = v.transform, P.current.style.setProperty("-ms-transform", v.transform), P.current.style.setProperty("-webkit-transform", v.transform), P.current.style.top = ((M = X.top) === null || M === void 0 ? void 0 : M.toString()) || v.arrowTop, P.current.style.left = (($ = X.left) === null || $ === void 0 ? void 0 : $.toString()) || v.arrowLeft;
|
|
636
636
|
}
|
|
637
637
|
}
|
|
638
638
|
};
|
|
639
|
-
Ze(L, Te), tt(b, D && S), Be(
|
|
639
|
+
Ze(L, Te), tt(b, D && S), Be(ve, we), et(a ? [b, C] : [b], L, R && !g);
|
|
640
640
|
var $e = function() {
|
|
641
641
|
for (var u = {
|
|
642
642
|
key: "T",
|
|
643
643
|
ref: C,
|
|
644
|
-
"aria-describedby":
|
|
645
|
-
},
|
|
646
|
-
switch (
|
|
644
|
+
"aria-describedby": ge.current
|
|
645
|
+
}, _ = Array.isArray(I) ? I : [I], v = 0, M = _.length; v < M; v++)
|
|
646
|
+
switch (_[v]) {
|
|
647
647
|
case "click":
|
|
648
648
|
u.onClick = V;
|
|
649
649
|
break;
|
|
@@ -663,9 +663,9 @@ var Ze = function(i, c) {
|
|
|
663
663
|
}
|
|
664
664
|
return !!a && T.cloneElement(a, u);
|
|
665
665
|
}, He = function() {
|
|
666
|
-
var u = S ? H.popupContent.modal : H.popupContent.tooltip,
|
|
667
|
-
className: "popup-content " + (A !== "" ? A.split(" ").map(function(
|
|
668
|
-
return
|
|
666
|
+
var u = S ? H.popupContent.modal : H.popupContent.tooltip, _ = {
|
|
667
|
+
className: "popup-content " + (A !== "" ? A.split(" ").map(function(v) {
|
|
668
|
+
return v + "-content";
|
|
669
669
|
}).join(" ") : ""),
|
|
670
670
|
style: Y({}, u, Re, {
|
|
671
671
|
pointerEvents: "auto"
|
|
@@ -675,12 +675,12 @@ var Ze = function(i, c) {
|
|
|
675
675
|
M.stopPropagation();
|
|
676
676
|
}
|
|
677
677
|
};
|
|
678
|
-
return !ne && I.indexOf("hover") >= 0 && (
|
|
678
|
+
return !ne && I.indexOf("hover") >= 0 && (_.onMouseEnter = G, _.onMouseLeave = q), _;
|
|
679
679
|
}, me = function() {
|
|
680
680
|
return T.createElement("div", Object.assign({}, He(), {
|
|
681
681
|
key: "C",
|
|
682
682
|
role: S ? "dialog" : "tooltip",
|
|
683
|
-
id:
|
|
683
|
+
id: ge.current
|
|
684
684
|
}), F && !S && T.createElement("div", {
|
|
685
685
|
ref: P,
|
|
686
686
|
style: H.popupArrow
|
|
@@ -705,17 +705,16 @@ var Ze = function(i, c) {
|
|
|
705
705
|
return h + "-overlay";
|
|
706
706
|
}).join(" ") : ""),
|
|
707
707
|
style: Y({}, ze, De, {
|
|
708
|
-
pointerEvents: R &&
|
|
708
|
+
pointerEvents: R && g || S ? "auto" : "none"
|
|
709
709
|
}),
|
|
710
|
-
onClick: R &&
|
|
710
|
+
onClick: R && g ? L : void 0,
|
|
711
711
|
tabIndex: -1
|
|
712
712
|
}, S && me()), !S && me()];
|
|
713
713
|
return T.createElement(T.Fragment, null, $e(), D && Qe.createPortal(Ue, ct()));
|
|
714
714
|
});
|
|
715
|
-
const ut = "
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
}, vt = ({
|
|
715
|
+
const ut = "_content_lgc5i_1", be = {
|
|
716
|
+
content: ut
|
|
717
|
+
}, yt = ({
|
|
719
718
|
tooltipClassName: s,
|
|
720
719
|
contentClassName: i,
|
|
721
720
|
children: c,
|
|
@@ -730,5 +729,5 @@ const ut = "_tooltip_mtsuw_1", ft = "_content_mtsuw_5", be = {
|
|
|
730
729
|
}
|
|
731
730
|
);
|
|
732
731
|
export {
|
|
733
|
-
|
|
732
|
+
yt as Tooltip
|
|
734
733
|
};
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
+
import { CartPropsBase, ShoppingCart } from '../../molecules/Cart/Cart';
|
|
1
2
|
import { AccountProps } from '../../molecules/Account/Account';
|
|
2
|
-
export interface MainNavProps extends React.HTMLAttributes<HTMLDivElement>, Pick<AccountProps, "account"> {
|
|
3
|
+
export interface MainNavProps extends CartPropsBase, React.HTMLAttributes<HTMLDivElement>, Pick<AccountProps, "account"> {
|
|
3
4
|
categories?: MainCategory[];
|
|
4
5
|
faqRoute: string;
|
|
5
6
|
customPartsRoute: string;
|
|
6
7
|
aboutUsRoute: string;
|
|
7
8
|
accountRoute: string;
|
|
8
9
|
contactRoute: string;
|
|
9
|
-
|
|
10
|
+
cart: ShoppingCart;
|
|
10
11
|
onLoginClick: () => void;
|
|
11
|
-
|
|
12
|
+
onSearch: (_input: string) => void;
|
|
12
13
|
}
|
|
13
14
|
export interface Category {
|
|
14
15
|
id: string | number;
|
|
@@ -19,4 +20,4 @@ export interface MainCategory extends Category {
|
|
|
19
20
|
children: Category[];
|
|
20
21
|
showChevron?: boolean;
|
|
21
22
|
}
|
|
22
|
-
export declare function MainNav({ account, categories, faqRoute, customPartsRoute, aboutUsRoute, accountRoute, contactRoute,
|
|
23
|
+
export declare function MainNav({ account, categories, faqRoute, customPartsRoute, aboutUsRoute, accountRoute, contactRoute, cart, onLoginClick, onSearch, onItemQtyChange, onItemDelete, onItemEdit, onCheckout, ...otherProps }: MainNavProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,78 +1,91 @@
|
|
|
1
1
|
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
2
|
-
import { Text as
|
|
3
|
-
import { Link as
|
|
4
|
-
import { Icon as
|
|
5
|
-
import { Flex as
|
|
6
|
-
import { Grid as
|
|
7
|
-
import { Logo as
|
|
8
|
-
import { SearchBox as
|
|
9
|
-
import { HamburgerMenu as
|
|
10
|
-
import {
|
|
11
|
-
import { Account as
|
|
12
|
-
import { CategoryNav as
|
|
13
|
-
import '../../assets/MainNav.css';const
|
|
14
|
-
topNav:
|
|
15
|
-
operations:
|
|
16
|
-
search:
|
|
17
|
-
siteLink:
|
|
18
|
-
accountArea:
|
|
19
|
-
category:
|
|
20
|
-
menuList:
|
|
2
|
+
import { Text as f } from "../../atoms/Text/Text.js";
|
|
3
|
+
import { Link as p } from "../../atoms/Link/Link.js";
|
|
4
|
+
import { Icon as C } from "../../atoms/Icon/Icon.js";
|
|
5
|
+
import { Flex as o } from "../../atoms/Flex/Flex.js";
|
|
6
|
+
import { Grid as y, Column as k } from "../../atoms/Grid/Grid.js";
|
|
7
|
+
import { Logo as b } from "../../molecules/Logo/Logo.js";
|
|
8
|
+
import { SearchBox as d } from "../../molecules/SearchBox/SearchBox.js";
|
|
9
|
+
import { HamburgerMenu as j } from "../../molecules/HamburgerMenu/HamburgerMenu.js";
|
|
10
|
+
import { ShoppingCart as D } from "../../molecules/Cart/Cart.js";
|
|
11
|
+
import { Account as z } from "../../molecules/Account/Account.js";
|
|
12
|
+
import { CategoryNav as F } from "../../molecules/CategoryNav/CategoryNav.js";
|
|
13
|
+
import '../../assets/MainNav.css';const I = "_topNav_1uhwf_1", U = "_operations_1uhwf_9", M = "_search_1uhwf_16", Q = "_siteLink_1uhwf_19", B = "_accountArea_1uhwf_23", G = "_category_1uhwf_35", H = "_menuList_1uhwf_57", i = {
|
|
14
|
+
topNav: I,
|
|
15
|
+
operations: U,
|
|
16
|
+
search: M,
|
|
17
|
+
siteLink: Q,
|
|
18
|
+
accountArea: B,
|
|
19
|
+
category: G,
|
|
20
|
+
menuList: H
|
|
21
21
|
};
|
|
22
|
-
function
|
|
22
|
+
function $({
|
|
23
23
|
account: s,
|
|
24
24
|
categories: n,
|
|
25
|
-
faqRoute:
|
|
25
|
+
faqRoute: c,
|
|
26
26
|
customPartsRoute: l,
|
|
27
27
|
aboutUsRoute: u,
|
|
28
|
-
accountRoute:
|
|
29
|
-
contactRoute:
|
|
30
|
-
|
|
31
|
-
onLoginClick:
|
|
32
|
-
|
|
33
|
-
|
|
28
|
+
accountRoute: _,
|
|
29
|
+
contactRoute: m,
|
|
30
|
+
cart: N,
|
|
31
|
+
onLoginClick: A,
|
|
32
|
+
onSearch: h,
|
|
33
|
+
onItemQtyChange: v,
|
|
34
|
+
onItemDelete: w,
|
|
35
|
+
onItemEdit: g,
|
|
36
|
+
onCheckout: x,
|
|
37
|
+
...L
|
|
34
38
|
}) {
|
|
35
|
-
return /* @__PURE__ */ e(
|
|
39
|
+
return /* @__PURE__ */ e(y, { ...L, children: /* @__PURE__ */ t(k, { span: 12, children: [
|
|
36
40
|
/* @__PURE__ */ t(
|
|
37
|
-
|
|
41
|
+
o,
|
|
38
42
|
{
|
|
39
43
|
flexDirection: "row",
|
|
40
44
|
alignItems: "center",
|
|
41
45
|
justifyContent: "space-between",
|
|
42
|
-
className:
|
|
46
|
+
className: i.topNav,
|
|
43
47
|
children: [
|
|
44
|
-
/* @__PURE__ */ e("div", { className:
|
|
48
|
+
/* @__PURE__ */ e("div", { className: i.logo, children: /* @__PURE__ */ e(b, {}) }),
|
|
45
49
|
/* @__PURE__ */ t(
|
|
46
|
-
|
|
50
|
+
o,
|
|
47
51
|
{
|
|
48
52
|
flexDirection: "row",
|
|
49
53
|
alignItems: "center",
|
|
50
54
|
justifyContent: "flex-end",
|
|
51
|
-
className:
|
|
55
|
+
className: i.operations,
|
|
52
56
|
children: [
|
|
53
|
-
/* @__PURE__ */ e(
|
|
54
|
-
/* @__PURE__ */ e(
|
|
55
|
-
/* @__PURE__ */ e(
|
|
56
|
-
/* @__PURE__ */ e(
|
|
57
|
-
/* @__PURE__ */ e("div", { className:
|
|
58
|
-
|
|
57
|
+
/* @__PURE__ */ e(o, { flexDirection: "row", hideAt: ["sm"], className: i.search, children: /* @__PURE__ */ e(d, { onSearch: h, inputName: "cpc-search" }) }),
|
|
58
|
+
/* @__PURE__ */ e(r, { href: l, hideAt: ["sm", "md"], children: "Custom Parts" }),
|
|
59
|
+
/* @__PURE__ */ e(r, { href: c, hideAt: ["sm", "md"], children: "FAQ" }),
|
|
60
|
+
/* @__PURE__ */ e(r, { href: m, hideAt: ["sm", "md"], children: "Contact Us" }),
|
|
61
|
+
/* @__PURE__ */ e("div", { className: i.accountArea, children: /* @__PURE__ */ e(
|
|
62
|
+
z,
|
|
59
63
|
{
|
|
60
64
|
account: s,
|
|
61
|
-
accountRoute:
|
|
62
|
-
onLoginClick:
|
|
63
|
-
className:
|
|
65
|
+
accountRoute: _,
|
|
66
|
+
onLoginClick: A,
|
|
67
|
+
className: i.avatar
|
|
64
68
|
}
|
|
65
69
|
) }),
|
|
66
|
-
/* @__PURE__ */ e(
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
70
|
+
/* @__PURE__ */ e(
|
|
71
|
+
D,
|
|
72
|
+
{
|
|
73
|
+
cart: N,
|
|
74
|
+
onItemDelete: w,
|
|
75
|
+
onItemEdit: g,
|
|
76
|
+
onItemQtyChange: v,
|
|
77
|
+
onCheckout: x
|
|
78
|
+
}
|
|
79
|
+
),
|
|
80
|
+
/* @__PURE__ */ e(j, { hideAt: ["lg"], children: /* @__PURE__ */ t("ul", { className: i.menuList, children: [
|
|
81
|
+
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(r, { href: l, children: "Custom Parts" }) }),
|
|
82
|
+
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(r, { href: c, children: "FAQ" }) }),
|
|
83
|
+
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(r, { href: m, children: "Contact Us" }) }),
|
|
84
|
+
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(r, { href: u, children: "About Us" }) }),
|
|
85
|
+
n && n.map((a) => /* @__PURE__ */ e("li", { className: i.category, children: /* @__PURE__ */ t(p, { href: a.route, children: [
|
|
86
|
+
/* @__PURE__ */ e(f, { size: "sm", weight: "semibold", children: a.label }),
|
|
74
87
|
/* @__PURE__ */ e(
|
|
75
|
-
|
|
88
|
+
C,
|
|
76
89
|
{
|
|
77
90
|
iconKey: "fa-solid fa-chevron-right",
|
|
78
91
|
title: "Navigate",
|
|
@@ -87,17 +100,17 @@ function V({
|
|
|
87
100
|
]
|
|
88
101
|
}
|
|
89
102
|
),
|
|
90
|
-
/* @__PURE__ */ e(
|
|
91
|
-
/* @__PURE__ */ e(
|
|
103
|
+
/* @__PURE__ */ e(o, { flexDirection: "row", hideAt: ["md", "lg"], children: /* @__PURE__ */ e(d, { onSearch: h, inputName: "cpc-search", className: i.search }) }),
|
|
104
|
+
/* @__PURE__ */ e(F, { categories: n })
|
|
92
105
|
] }) });
|
|
93
106
|
}
|
|
94
|
-
function
|
|
107
|
+
function r({
|
|
95
108
|
href: s,
|
|
96
109
|
children: n,
|
|
97
|
-
...
|
|
110
|
+
...c
|
|
98
111
|
}) {
|
|
99
|
-
return /* @__PURE__ */ e(
|
|
112
|
+
return /* @__PURE__ */ e(p, { href: s, className: i.siteLink, ...c, children: /* @__PURE__ */ e(f, { size: "md", variant: "display", children: n }) });
|
|
100
113
|
}
|
|
101
114
|
export {
|
|
102
|
-
|
|
115
|
+
$ as MainNav
|
|
103
116
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { MainNav as
|
|
2
|
-
const
|
|
1
|
+
import { MainNav as o } from "./MainNav.js";
|
|
2
|
+
const l = {
|
|
3
3
|
title: "Case Parts/Organisms/MainNav",
|
|
4
|
-
component:
|
|
4
|
+
component: o,
|
|
5
5
|
parameters: {
|
|
6
6
|
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
|
|
7
7
|
layout: "fullscreen"
|
|
8
8
|
}
|
|
9
9
|
// tags: ["autodocs"],
|
|
10
|
-
},
|
|
10
|
+
}, a = [
|
|
11
11
|
{
|
|
12
12
|
id: 0,
|
|
13
13
|
label: "Shop by Brands",
|
|
@@ -80,14 +80,29 @@ const o = {
|
|
|
80
80
|
route: "#",
|
|
81
81
|
children: []
|
|
82
82
|
}
|
|
83
|
-
],
|
|
83
|
+
], e = "https://m.media-amazon.com/images/I/216+JEttsYL._UF1000,1000_QL80_.jpg", i = {
|
|
84
|
+
items: [
|
|
85
|
+
{ id: 1, itemId: "1094-01", description: "Kason Door Closer - Flush", price: 99.99, quantity: 1, imageUrl: e, availability: "In Stock" },
|
|
86
|
+
{ id: 2, itemId: "810810", description: "True Door Gasket", price: 9.99, quantity: 1, imageUrl: e, availability: "In Stock" },
|
|
87
|
+
{ id: 3, itemId: "MG064", description: '36" x 79" 3-Sided Dart-to-Dart Gasket', price: 9.99, quantity: 1, imageUrl: e, availability: "" },
|
|
88
|
+
{ id: 4, itemId: "MG064-B", description: '36" x 79" 3-Sided Dart-to-Dart Gasket', price: 9.99, quantity: 1, imageUrl: e, availability: "" },
|
|
89
|
+
{ id: 5, itemId: "Warmer Wire", description: '228" 7.0 ohms 115V', price: 9.99, quantity: 1, imageUrl: e, availability: "" },
|
|
90
|
+
{ id: 6, itemId: "810803", description: "True Door Gasket", price: 9.99, quantity: 1, imageUrl: e, availability: "In Stock" },
|
|
91
|
+
{ id: 7, itemId: "ABG-12114-PF", description: "Adhesive Sponge Gasket 1/4", price: 9.99, quantity: 10, imageUrl: e, availability: "In Stock" },
|
|
92
|
+
{ id: 8, itemId: "ABG-12138-PF", description: "Adhesive Sponge Gasket 3/8", price: 9.99, quantity: 10, imageUrl: e, availability: "In Stock" },
|
|
93
|
+
{ id: 9, itemId: "1094-C1", description: "Kason Door Closer - Flush", price: 20.99, quantity: 1, imageUrl: e, availability: "In Stock" },
|
|
94
|
+
{ id: 10, itemId: "1094-02", description: "Kason Door Closer - Offset", price: 30.05, quantity: 1, imageUrl: e, availability: "In Stock" },
|
|
95
|
+
{ id: 11, itemId: "1092-01", description: "Kason Door Closer - Flush", price: 40.1, quantity: 1, imageUrl: e, availability: "In Stock" },
|
|
96
|
+
{ id: 12, itemId: "1092-02", description: "Kason Door Closer - Offset", price: 50.15, quantity: 1, imageUrl: e, availability: "In Stock" }
|
|
97
|
+
]
|
|
98
|
+
}, n = {
|
|
84
99
|
args: {
|
|
85
100
|
account: {
|
|
86
101
|
name: "Ringo",
|
|
87
102
|
initials: "RS",
|
|
88
103
|
number: "123456789012"
|
|
89
104
|
},
|
|
90
|
-
|
|
105
|
+
cart: i,
|
|
91
106
|
customPartsRoute: "/custom",
|
|
92
107
|
accountRoute: "/account",
|
|
93
108
|
faqRoute: "/faq",
|
|
@@ -96,19 +111,31 @@ const o = {
|
|
|
96
111
|
onLoginClick: () => {
|
|
97
112
|
alert("Login ");
|
|
98
113
|
},
|
|
99
|
-
|
|
100
|
-
alert("
|
|
114
|
+
onCheckout: () => {
|
|
115
|
+
alert("Checkout");
|
|
101
116
|
},
|
|
102
|
-
|
|
117
|
+
onItemDelete: () => {
|
|
118
|
+
alert("Delete");
|
|
119
|
+
},
|
|
120
|
+
onItemEdit: () => {
|
|
121
|
+
alert("Delete");
|
|
122
|
+
},
|
|
123
|
+
onItemQtyChange: () => {
|
|
124
|
+
alert("Delete");
|
|
125
|
+
},
|
|
126
|
+
onSearch: (t) => {
|
|
127
|
+
alert(`Search ${t}`);
|
|
128
|
+
},
|
|
129
|
+
categories: a
|
|
103
130
|
}
|
|
104
|
-
},
|
|
131
|
+
}, c = {
|
|
105
132
|
args: {
|
|
106
133
|
account: {
|
|
107
134
|
name: "Ringo",
|
|
108
135
|
initials: "RS",
|
|
109
136
|
number: "123456789012"
|
|
110
137
|
},
|
|
111
|
-
|
|
138
|
+
cart: i,
|
|
112
139
|
customPartsRoute: "/custom",
|
|
113
140
|
accountRoute: "/account",
|
|
114
141
|
faqRoute: "/faq",
|
|
@@ -117,14 +144,26 @@ const o = {
|
|
|
117
144
|
onLoginClick: () => {
|
|
118
145
|
alert("Login ");
|
|
119
146
|
},
|
|
120
|
-
|
|
121
|
-
alert("
|
|
147
|
+
onCheckout: () => {
|
|
148
|
+
alert("Checkout");
|
|
149
|
+
},
|
|
150
|
+
onItemDelete: () => {
|
|
151
|
+
alert("Delete");
|
|
152
|
+
},
|
|
153
|
+
onItemEdit: () => {
|
|
154
|
+
alert("Delete");
|
|
122
155
|
},
|
|
123
|
-
|
|
156
|
+
onItemQtyChange: () => {
|
|
157
|
+
alert("Delete");
|
|
158
|
+
},
|
|
159
|
+
onSearch: (t) => {
|
|
160
|
+
alert(`Search ${t}`);
|
|
161
|
+
},
|
|
162
|
+
categories: a
|
|
124
163
|
}
|
|
125
|
-
},
|
|
164
|
+
}, s = {
|
|
126
165
|
args: {
|
|
127
|
-
|
|
166
|
+
cart: i,
|
|
128
167
|
customPartsRoute: "/custom",
|
|
129
168
|
accountRoute: "/account",
|
|
130
169
|
faqRoute: "/faq",
|
|
@@ -133,15 +172,27 @@ const o = {
|
|
|
133
172
|
onLoginClick: () => {
|
|
134
173
|
alert("Login ");
|
|
135
174
|
},
|
|
136
|
-
|
|
137
|
-
alert("
|
|
175
|
+
onCheckout: () => {
|
|
176
|
+
alert("Checkout");
|
|
177
|
+
},
|
|
178
|
+
onItemDelete: () => {
|
|
179
|
+
alert("Delete");
|
|
180
|
+
},
|
|
181
|
+
onItemEdit: () => {
|
|
182
|
+
alert("Delete");
|
|
183
|
+
},
|
|
184
|
+
onItemQtyChange: () => {
|
|
185
|
+
alert("Delete");
|
|
186
|
+
},
|
|
187
|
+
onSearch: (t) => {
|
|
188
|
+
alert(`Search ${t}`);
|
|
138
189
|
},
|
|
139
|
-
categories:
|
|
190
|
+
categories: a
|
|
140
191
|
}
|
|
141
192
|
};
|
|
142
193
|
export {
|
|
143
194
|
n as Authenticated,
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
195
|
+
s as Unauthenticated,
|
|
196
|
+
c as WithCartItems,
|
|
197
|
+
l as default
|
|
147
198
|
};
|