@caseparts-org/caseblocks 0.0.109 → 0.0.111

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.
@@ -1 +1 @@
1
- ._loggedIn_1aoh3_1{flex-shrink:0;gap:var(--spacing-spacing-2xs);cursor:pointer;transition:all .3s linear;display:flex;flex-direction:row;align-items:center;justify-content:center;padding:var(--spacing-spacing-3xs)}._customer_1aoh3_12>a,._customer_1aoh3_12>a:hover{text-decoration:none}._loggedIn_1aoh3_1:hover{background-color:#f3f3f3;border-radius:var(--border-radius-md)}
1
+ ._loggedIn_w7zna_1{flex-shrink:0;gap:var(--spacing-spacing-2xs);cursor:pointer;transition:all .3s linear;display:flex;flex-direction:row;align-items:center;justify-content:center;padding:var(--spacing-spacing-3xs)}._customer_w7zna_12>a,._customer_w7zna_12>a:hover{text-decoration:none}._loggedIn_w7zna_1:hover{background-color:#f3f3f3;border-radius:var(--border-radius-md)}._placeholder_w7zna_21{height:30px;width:120px}@media (max-width:1280px){._placeholder_w7zna_21{width:30px;height:30px}}
@@ -1 +1 @@
1
- ._categories_1of98_1{display:flex;flex-direction:row;align-items:center;justify-content:space-between;padding:0;margin:0 90px 0 47px}@media (max-width: 1281px){._categories_1of98_1{display:none}}._category_1of98_17{list-style:none}._category_1of98_17 a{color:var(--text-text-primary);font-weight:var(--font-weight-semibold);text-decoration:none;display:flex;flex-direction:row;align-items:center}@media (max-width: 1281px){._category_1of98_17 a{justify-content:space-between;width:100%}}._category_1of98_17 a:hover{color:var(--color-brand-primary-primary-teal-blue);text-decoration:none}._category_1of98_17 a path{fill:var(--color-brand-primary-primary-teal-blue)}._submenuTooltip_1of98_43{list-style:none;padding:0;margin:0;height:min-content;display:flex;flex-direction:column;gap:var(--spacing-spacing-3xs);flex-wrap:wrap;max-height:400px}
1
+ ._categories_19tew_1{display:flex;flex-direction:row;align-items:center;justify-content:space-between;padding:0;margin:0 90px 0 47px}@media (max-width: 1281px){._categories_19tew_1{display:none}}._placeholder_19tew_17{height:24px;width:100%}@media (max-width:1280px){._placeholder_19tew_17{display:none}}._category_19tew_25{list-style:none}._category_19tew_25 a{color:var(--text-text-primary);font-weight:var(--font-weight-semibold);text-decoration:none;display:flex;flex-direction:row;align-items:center}@media (max-width: 1281px){._category_19tew_25 a{justify-content:space-between;width:100%}}._category_19tew_25 a:hover{color:var(--color-brand-primary-primary-teal-blue);text-decoration:none}._category_19tew_25 a path{fill:var(--color-brand-primary-primary-teal-blue)}._submenuTooltip_19tew_51{list-style:none;padding:0;margin:0;height:min-content;display:flex;flex-direction:column;gap:var(--spacing-spacing-3xs);flex-wrap:wrap;max-height:400px}
@@ -10,7 +10,9 @@ export interface AccountProps extends React.HTMLAttributes<HTMLDivElement>, Hide
10
10
  /** The account user's initials. */
11
11
  initials: string;
12
12
  };
13
- accountRoute: string;
14
13
  onLoginClick: () => void;
14
+ /** Optional content to show when clicking the authenticated container */
15
+ popoverContent?: React.ReactNode;
16
+ isAccountLoading?: boolean;
15
17
  }
16
18
  export declare function Account(props: AccountProps): import("react/jsx-runtime").JSX.Element;
@@ -1,36 +1,72 @@
1
- import { jsx as i, jsxs as n } from "react/jsx-runtime";
1
+ import { jsx as o, jsxs as n } from "react/jsx-runtime";
2
2
  import { getHideAtStyles as a } from "../../atoms/HideAt.js";
3
3
  import { Icon as f } from "../../atoms/Icon/Icon.js";
4
- import { Text as l } from "../../atoms/Text/Text.js";
4
+ import { Text as c } from "../../atoms/Text/Text.js";
5
5
  import { Avatar as h } from "../Avatar/Avatar.js";
6
6
  import { Flex as d } from "../../atoms/Flex/Flex.js";
7
- import { Button as A } from "../../atoms/Button/Button.js";
8
- import { c as u } from "../../clsx-OuTLNxxd.js";
9
- import { Link as x } from "../../atoms/Link/Link.js";
10
- import '../../assets/Account.css';const p = "_loggedIn_1aoh3_1", I = "_customer_1aoh3_12", s = {
11
- loggedIn: p,
12
- customer: I
7
+ import { Button as p } from "../../atoms/Button/Button.js";
8
+ import { Popover as A } from "../../atoms/Popover/Popover.js";
9
+ import { c as g } from "../../clsx-OuTLNxxd.js";
10
+ import '../../assets/Account.css';const x = "_loggedIn_w7zna_1", v = "_customer_w7zna_12", I = "_placeholder_w7zna_21", t = {
11
+ loggedIn: x,
12
+ customer: v,
13
+ placeholder: I
13
14
  };
14
- function _(e) {
15
- return e.account !== void 0;
15
+ function z(i) {
16
+ return i.account !== void 0;
16
17
  }
17
- function P(e) {
18
- return _(e) ? /* @__PURE__ */ i(k, { ...e }) : /* @__PURE__ */ i(v, { ...e });
18
+ function T(i) {
19
+ return i.isAccountLoading ? /* @__PURE__ */ o("div", { className: t.placeholder }) : z(i) ? /* @__PURE__ */ o(_, { ...i }) : /* @__PURE__ */ o(N, { ...i });
19
20
  }
20
- function k(e) {
21
+ function _(i) {
21
22
  const {
22
- account: t,
23
- accountRoute: o,
24
- onLoginClick: m,
23
+ account: e,
25
24
  className: r,
26
- hideAt: c,
27
- ...g
28
- } = e;
29
- return /* @__PURE__ */ n(
25
+ hideAt: s,
26
+ popoverContent: m,
27
+ isAccountLoading: u,
28
+ ...l
29
+ } = i;
30
+ return m ? /* @__PURE__ */ o(
31
+ A,
32
+ {
33
+ position: "bottom right",
34
+ trigger: /* @__PURE__ */ n(
35
+ "div",
36
+ {
37
+ className: g(t.loggedIn, a(s), r),
38
+ ...l,
39
+ children: [
40
+ /* @__PURE__ */ n(
41
+ d,
42
+ {
43
+ flexDirection: "column",
44
+ alignItems: "flex-end",
45
+ hideAt: ["sm", "md"],
46
+ className: t.customer,
47
+ children: [
48
+ /* @__PURE__ */ n(c, { size: "xxs", children: [
49
+ "Acct: ",
50
+ e == null ? void 0 : e.number
51
+ ] }),
52
+ /* @__PURE__ */ n(c, { size: "sm", variant: "display", colorToken: "links", children: [
53
+ "Hello ",
54
+ e == null ? void 0 : e.name
55
+ ] })
56
+ ]
57
+ }
58
+ ),
59
+ /* @__PURE__ */ o(h, { initials: e.initials })
60
+ ]
61
+ }
62
+ ),
63
+ children: m
64
+ }
65
+ ) : /* @__PURE__ */ n(
30
66
  "div",
31
67
  {
32
- className: u(s.loggedIn, a(c), r),
33
- ...g,
68
+ className: g(t.loggedIn, a(s), r),
69
+ ...l,
34
70
  children: [
35
71
  /* @__PURE__ */ n(
36
72
  d,
@@ -38,53 +74,60 @@ function k(e) {
38
74
  flexDirection: "column",
39
75
  alignItems: "flex-end",
40
76
  hideAt: ["sm", "md"],
41
- className: s.customer,
77
+ className: t.customer,
42
78
  children: [
43
- /* @__PURE__ */ n(l, { size: "xxs", children: [
79
+ /* @__PURE__ */ n(c, { size: "xxs", children: [
44
80
  "Acct: ",
45
- t == null ? void 0 : t.number
81
+ e == null ? void 0 : e.number
46
82
  ] }),
47
- /* @__PURE__ */ i(x, { href: o, children: /* @__PURE__ */ n(l, { size: "sm", variant: "display", children: [
83
+ /* @__PURE__ */ n(c, { size: "sm", variant: "display", colorToken: "links", children: [
48
84
  "Hello ",
49
- t == null ? void 0 : t.name
50
- ] }) })
85
+ e == null ? void 0 : e.name
86
+ ] })
51
87
  ]
52
88
  }
53
89
  ),
54
- /* @__PURE__ */ i(h, { initials: t.initials, accountRoute: o })
90
+ /* @__PURE__ */ o(h, { initials: e.initials })
55
91
  ]
56
92
  }
57
93
  );
58
94
  }
59
- function v(e) {
60
- const { accountRoute: t, onLoginClick: o, className: m, hideAt: r, ...c } = e;
95
+ function N(i) {
96
+ const {
97
+ onLoginClick: e,
98
+ className: r,
99
+ hideAt: s,
100
+ popoverContent: m,
101
+ isAccountLoading: u,
102
+ ...l
103
+ } = i;
61
104
  return /* @__PURE__ */ n(
62
105
  d,
63
106
  {
64
107
  flexDirection: "row",
65
108
  alignItems: "center",
66
- ...c,
67
- className: u(
68
- s.unauthenticated,
69
- a(r),
70
- m
109
+ ...l,
110
+ className: g(
111
+ t.unauthenticated,
112
+ a(s),
113
+ r
71
114
  ),
72
115
  children: [
73
- /* @__PURE__ */ i(
74
- A,
116
+ /* @__PURE__ */ o(
117
+ p,
75
118
  {
76
- onClick: o,
119
+ onClick: e,
77
120
  size: "sm",
78
121
  variant: "primary",
79
122
  hideAt: ["sm", "md"],
80
123
  children: "Sign In / Register"
81
124
  }
82
125
  ),
83
- /* @__PURE__ */ i(f, { iconKey: "fa-kit fa-user-anon", size: "lg", hideAt: "lg" })
126
+ /* @__PURE__ */ o(f, { iconKey: "fa-kit fa-user-anon", size: "lg", hideAt: "lg" })
84
127
  ]
85
128
  }
86
129
  );
87
130
  }
88
131
  export {
89
- P as Account
132
+ T as Account
90
133
  };
@@ -1,5 +1,5 @@
1
1
  import { Account as t } from "./Account.js";
2
- const c = {
2
+ const o = {
3
3
  title: "Case Parts/Molecules/Account",
4
4
  component: t,
5
5
  parameters: {
@@ -8,9 +8,8 @@ const c = {
8
8
  },
9
9
  // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
10
10
  tags: ["autodocs"]
11
- }, n = {
11
+ }, e = {
12
12
  args: {
13
- accountRoute: "/account",
14
13
  onLoginClick: () => {
15
14
  }
16
15
  }
@@ -21,13 +20,12 @@ const c = {
21
20
  initials: "RS",
22
21
  number: "123456789012"
23
22
  },
24
- accountRoute: "/account",
25
23
  onLoginClick: () => {
26
24
  }
27
25
  }
28
26
  };
29
27
  export {
30
28
  a as Authenticated,
31
- n as Unauthenticated,
32
- c as default
29
+ e as Unauthenticated,
30
+ o as default
33
31
  };
@@ -2,6 +2,5 @@ import { HideAtProps } from '../../atoms/HideAt';
2
2
  export interface AvatarProps extends React.HTMLAttributes<HTMLDivElement>, HideAtProps {
3
3
  /** The user's initials (2 characters) */
4
4
  initials: string;
5
- accountRoute: string;
6
5
  }
7
6
  export declare function Avatar(props: AvatarProps): import("react/jsx-runtime").JSX.Element;
@@ -1,32 +1,31 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import { Flex as m } from "../../atoms/Flex/Flex.js";
3
- import { Link as c } from "../../atoms/Link/Link.js";
4
- import { getHideAtStyles as l } from "../../atoms/HideAt.js";
5
- import { c as f } from "../../clsx-OuTLNxxd.js";
6
- import { t as r } from "../../Text.module-Dzhzk2fH.js";
7
- import '../../assets/Avatar.css';const p = "_avatar_nvnsd_1", x = {
8
- avatar: p
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { Flex as n } from "../../atoms/Flex/Flex.js";
3
+ import { getHideAtStyles as m } from "../../atoms/HideAt.js";
4
+ import { c } from "../../clsx-OuTLNxxd.js";
5
+ import { t } from "../../Text.module-Dzhzk2fH.js";
6
+ import '../../assets/Avatar.css';const l = "_avatar_nvnsd_1", f = {
7
+ avatar: l
9
8
  };
10
- function A(e) {
11
- const { accountRoute: a, initials: s, className: o, hideAt: i, ...n } = e;
12
- return /* @__PURE__ */ t(c, { href: a, children: /* @__PURE__ */ t(
13
- m,
9
+ function u(r) {
10
+ const { initials: e, className: a, hideAt: s, ...i } = r;
11
+ return /* @__PURE__ */ o(
12
+ n,
14
13
  {
15
14
  flexDirection: "row",
16
15
  alignItems: "center",
17
16
  justifyContent: "center",
18
- className: f(
19
- x.avatar,
20
- r["text-display"],
21
- r["text-md"],
22
- l(i),
23
- o
17
+ className: c(
18
+ f.avatar,
19
+ t["text-display"],
20
+ t["text-md"],
21
+ m(s),
22
+ a
24
23
  ),
25
- ...n,
26
- children: s.substring(0, 2)
24
+ ...i,
25
+ children: e.substring(0, 2)
27
26
  }
28
- ) });
27
+ );
29
28
  }
30
29
  export {
31
- A as Avatar
30
+ u as Avatar
32
31
  };
@@ -10,8 +10,7 @@ const e = {
10
10
  tags: ["autodocs"]
11
11
  }, o = {
12
12
  args: {
13
- initials: "RS",
14
- accountRoute: "/account"
13
+ initials: "RS"
15
14
  }
16
15
  };
17
16
  export {
@@ -7,6 +7,7 @@ export interface CategoryWithChildren extends Category {
7
7
  children: Category[];
8
8
  showChevron?: boolean;
9
9
  }
10
- export declare function CategoryNav({ categories, }: {
10
+ export declare function CategoryNav({ categories, isCategoriesLoading, }: {
11
11
  categories?: CategoryWithChildren[];
12
+ isCategoriesLoading?: boolean;
12
13
  }): import("react/jsx-runtime").JSX.Element | null;
@@ -1,28 +1,30 @@
1
- import { jsx as e, jsxs as t } from "react/jsx-runtime";
2
- import { c as a } from "../../clsx-OuTLNxxd.js";
3
- import { Text as n } from "../../atoms/Text/Text.js";
1
+ import { jsx as e, jsxs as n } from "react/jsx-runtime";
2
+ import { c } from "../../clsx-OuTLNxxd.js";
3
+ import { Text as t } 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";
7
- import { Tooltip as d } from "../../atoms/Tooltip/Tooltip.js";
8
- import '../../assets/CategoryNav.css';const h = "_categories_1of98_1", f = "_category_1of98_17", p = "_submenuTooltip_1of98_43", o = {
9
- categories: h,
6
+ import { getHideAtStyles as d } from "../../atoms/HideAt.js";
7
+ import { Tooltip as h } from "../../atoms/Tooltip/Tooltip.js";
8
+ import '../../assets/CategoryNav.css';const p = "_categories_19tew_1", u = "_placeholder_19tew_17", f = "_category_19tew_25", b = "_submenuTooltip_19tew_51", i = {
9
+ categories: p,
10
+ placeholder: u,
10
11
  category: f,
11
- submenuTooltip: p
12
+ submenuTooltip: b
12
13
  };
13
- function z({
14
- categories: l
14
+ function v({
15
+ categories: o,
16
+ isCategoriesLoading: a
15
17
  }) {
16
- return !l || l.length === 0 ? null : /* @__PURE__ */ e("ul", { className: a(o.categories, c(["sm"])), children: l.map(
17
- (i) => i.children.length > 0 ? /* @__PURE__ */ e(
18
- d,
18
+ return a ? /* @__PURE__ */ e("div", { className: i.placeholder }) : !o || o.length === 0 ? null : /* @__PURE__ */ e("ul", { className: c(i.categories, d(["sm"])), children: o.map(
19
+ (l) => l.children.length > 0 ? /* @__PURE__ */ e(
20
+ h,
19
21
  {
20
22
  openDelay: 180,
21
23
  closeDelay: 0,
22
24
  tooltipOffset: 0,
23
- trigger: /* @__PURE__ */ e("li", { className: o.category, tabIndex: 0, children: /* @__PURE__ */ t(s, { href: i.route, children: [
24
- /* @__PURE__ */ e(n, { size: "sm", weight: "semibold", children: i.label }),
25
- i.showChevron && /* @__PURE__ */ e(
25
+ trigger: /* @__PURE__ */ e("li", { className: i.category, tabIndex: 0, children: /* @__PURE__ */ n(s, { href: l.route, children: [
26
+ /* @__PURE__ */ e(t, { size: "sm", weight: "semibold", children: l.label }),
27
+ l.showChevron && /* @__PURE__ */ e(
26
28
  m,
27
29
  {
28
30
  iconKey: "fa-regular fa-angle-down",
@@ -32,12 +34,12 @@ function z({
32
34
  )
33
35
  ] }) }),
34
36
  position: "bottom center",
35
- children: /* @__PURE__ */ e("ul", { className: o.submenuTooltip, children: i.children.map((r) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(s, { href: r.route, children: /* @__PURE__ */ e(n, { size: "sm", weight: "semibold", children: r.label }) }) }, r.id)) })
37
+ children: /* @__PURE__ */ e("ul", { className: i.submenuTooltip, children: l.children.map((r) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(s, { href: r.route, children: /* @__PURE__ */ e(t, { size: "sm", weight: "semibold", children: r.label }) }) }, r.id)) })
36
38
  },
37
- i.id
38
- ) : /* @__PURE__ */ e("li", { className: o.category, children: /* @__PURE__ */ t(s, { href: i.route, children: [
39
- /* @__PURE__ */ e(n, { size: "sm", weight: "semibold", children: i.label }),
40
- i.showChevron && /* @__PURE__ */ e(
39
+ l.id
40
+ ) : /* @__PURE__ */ e("li", { className: i.category, children: /* @__PURE__ */ n(s, { href: l.route, children: [
41
+ /* @__PURE__ */ e(t, { size: "sm", weight: "semibold", children: l.label }),
42
+ l.showChevron && /* @__PURE__ */ e(
41
43
  m,
42
44
  {
43
45
  iconKey: "fa-regular fa-angle-down",
@@ -45,9 +47,9 @@ function z({
45
47
  size: "sm"
46
48
  }
47
49
  )
48
- ] }) }, i.id)
50
+ ] }) }, l.id)
49
51
  ) });
50
52
  }
51
53
  export {
52
- z as CategoryNav
54
+ v as CategoryNav
53
55
  };
@@ -8,12 +8,15 @@ export interface MainNavProps extends CartPropsBase, React.HTMLAttributes<HTMLDi
8
8
  faqRoute: string;
9
9
  customPartsRoute: string;
10
10
  aboutUsRoute: string;
11
- accountRoute: string;
12
11
  contactRoute: string;
13
12
  cart: ShoppingCart;
14
13
  onLoginClick: () => void;
15
14
  onSearch: (_input: string) => void;
16
15
  onClickModelSerial: () => void;
16
+ /** Content shown in the account popover when authenticated */
17
+ accountPopoverContent?: React.ReactNode;
18
+ isAccountLoading?: boolean;
19
+ isCategoriesLoading?: boolean;
17
20
  }
18
21
  export type MainNavHandle = ShoppingCartHandle;
19
22
  export declare const MainNav: React.ForwardRefExoticComponent<MainNavProps & React.RefAttributes<ShoppingCartHandle>>;
@@ -1,49 +1,51 @@
1
1
  import { jsx as e, jsxs as o } from "react/jsx-runtime";
2
- import D from "react";
2
+ import z from "react";
3
3
  import { Text as N } from "../../atoms/Text/Text.js";
4
4
  import { Link as l } from "../../atoms/Link/Link.js";
5
- import { Icon as M } from "../../atoms/Icon/Icon.js";
5
+ import { Icon as I } from "../../atoms/Icon/Icon.js";
6
6
  import { Flex as t } from "../../atoms/Flex/Flex.js";
7
- import { Grid as z, Column as I } from "../../atoms/Grid/Grid.js";
8
- import { Logo as S } from "../../molecules/Logo/Logo.js";
7
+ import { Grid as S, Column as U } from "../../atoms/Grid/Grid.js";
8
+ import { Logo as F } from "../../molecules/Logo/Logo.js";
9
9
  import { SearchBox as _ } from "../../molecules/SearchBox/SearchBox.js";
10
- import { HamburgerMenu as U } from "../../molecules/HamburgerMenu/HamburgerMenu.js";
11
- import { ShoppingCart as F } from "../../molecules/Cart/Cart.js";
12
- import { Account as H } from "../../molecules/Account/Account.js";
13
- import { CategoryNav as B } from "../../molecules/CategoryNav/CategoryNav.js";
10
+ import { HamburgerMenu as H } from "../../molecules/HamburgerMenu/HamburgerMenu.js";
11
+ import { ShoppingCart as B } from "../../molecules/Cart/Cart.js";
12
+ import { Account as G } from "../../molecules/Account/Account.js";
13
+ import { CategoryNav as K } from "../../molecules/CategoryNav/CategoryNav.js";
14
14
  import { c as s } from "../../clsx-OuTLNxxd.js";
15
15
  import { getHideAtStyles as u } from "../../atoms/HideAt.js";
16
- import '../../assets/MainNav.css';const G = "_main_19pdr_1", K = "_column_19pdr_8", P = "_topNav_19pdr_13", Q = "_logo_19pdr_21", T = "_operations_19pdr_24", W = "_search_19pdr_31", q = "_siteLink_19pdr_34", E = "_accountArea_19pdr_48", J = "_category_19pdr_60", O = "_menuList_19pdr_82", r = {
17
- main: G,
18
- column: K,
19
- topNav: P,
20
- logo: Q,
21
- operations: T,
22
- search: W,
23
- siteLink: q,
24
- accountArea: E,
25
- category: J,
26
- menuList: O
27
- }, le = D.forwardRef(function({
16
+ import '../../assets/MainNav.css';const P = "_main_19pdr_1", Q = "_column_19pdr_8", T = "_topNav_19pdr_13", W = "_logo_19pdr_21", q = "_operations_19pdr_24", E = "_search_19pdr_31", J = "_siteLink_19pdr_34", O = "_accountArea_19pdr_48", R = "_category_19pdr_60", V = "_menuList_19pdr_82", r = {
17
+ main: P,
18
+ column: Q,
19
+ topNav: T,
20
+ logo: W,
21
+ operations: q,
22
+ search: E,
23
+ siteLink: J,
24
+ accountArea: O,
25
+ category: R,
26
+ menuList: V
27
+ }, de = z.forwardRef(function({
28
28
  account: c,
29
29
  categories: n,
30
30
  homeRoute: g,
31
31
  faqRoute: v,
32
32
  customPartsRoute: d,
33
33
  aboutUsRoute: A,
34
- accountRoute: L,
35
34
  contactRoute: h,
36
- cart: x,
37
- open: C,
35
+ cart: L,
36
+ open: x,
38
37
  // consume external panel control props from CartPropsBase
39
- className: k,
40
- onLoginClick: y,
38
+ className: C,
39
+ onLoginClick: k,
41
40
  onSearch: p,
42
41
  onClickModelSerial: f,
43
- onCartClick: b,
44
- ...w
45
- }, j) {
46
- return /* @__PURE__ */ e(z, { ...w, gridWrapperClassName: s(r.main, k), children: /* @__PURE__ */ o(I, { span: 12, className: r.column, children: [
42
+ onCartClick: y,
43
+ accountPopoverContent: b,
44
+ isAccountLoading: w,
45
+ isCategoriesLoading: j,
46
+ ...D
47
+ }, M) {
48
+ return /* @__PURE__ */ e(S, { ...D, gridWrapperClassName: s(r.main, C), children: /* @__PURE__ */ o(U, { span: 12, className: r.column, children: [
47
49
  /* @__PURE__ */ o(
48
50
  t,
49
51
  {
@@ -52,7 +54,7 @@ import '../../assets/MainNav.css';const G = "_main_19pdr_1", K = "_column_19pdr_
52
54
  justifyContent: "space-between",
53
55
  className: r.topNav,
54
56
  children: [
55
- /* @__PURE__ */ e("div", { className: r.logo, children: /* @__PURE__ */ e(l, { href: g, children: /* @__PURE__ */ e(S, {}) }) }),
57
+ /* @__PURE__ */ e("div", { className: r.logo, children: /* @__PURE__ */ e(l, { href: g, children: /* @__PURE__ */ e(F, {}) }) }),
56
58
  /* @__PURE__ */ o(
57
59
  t,
58
60
  {
@@ -66,24 +68,25 @@ import '../../assets/MainNav.css';const G = "_main_19pdr_1", K = "_column_19pdr_
66
68
  /* @__PURE__ */ e(i, { href: d, hideAt: ["sm", "md"], children: "Custom Parts" }),
67
69
  /* @__PURE__ */ e(i, { href: h, hideAt: ["sm", "md"], children: "Contact Us" }),
68
70
  /* @__PURE__ */ e("div", { className: r.accountArea, children: /* @__PURE__ */ e(
69
- H,
71
+ G,
70
72
  {
71
73
  account: c,
72
- accountRoute: L,
73
- onLoginClick: y,
74
- className: r.avatar
74
+ onLoginClick: k,
75
+ className: r.avatar,
76
+ popoverContent: b,
77
+ isAccountLoading: w
75
78
  }
76
79
  ) }),
77
80
  /* @__PURE__ */ e(
78
- F,
81
+ B,
79
82
  {
80
- ref: j,
81
- cart: x,
82
- open: C,
83
- onCartClick: b
83
+ ref: M,
84
+ cart: L,
85
+ open: x,
86
+ onCartClick: y
84
87
  }
85
88
  ),
86
- /* @__PURE__ */ e(U, { hideAt: ["lg"], children: /* @__PURE__ */ o("ul", { className: r.menuList, children: [
89
+ /* @__PURE__ */ e(H, { hideAt: ["lg"], children: /* @__PURE__ */ o("ul", { className: r.menuList, children: [
87
90
  /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { onClick: f, className: s(r.siteLink, u(["lg"])), children: "Model/Serial" }) }),
88
91
  /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(i, { href: d, children: "Custom Parts" }) }),
89
92
  /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(i, { href: h, children: "Contact Us" }) }),
@@ -92,7 +95,7 @@ import '../../assets/MainNav.css';const G = "_main_19pdr_1", K = "_column_19pdr_
92
95
  n && n.map((a) => /* @__PURE__ */ e("li", { className: r.category, children: /* @__PURE__ */ o(l, { href: a.route, children: [
93
96
  /* @__PURE__ */ e(N, { size: "sm", weight: "semibold", children: a.label }),
94
97
  /* @__PURE__ */ e(
95
- M,
98
+ I,
96
99
  {
97
100
  iconKey: "fa-solid fa-chevron-right",
98
101
  title: "Navigate",
@@ -108,7 +111,7 @@ import '../../assets/MainNav.css';const G = "_main_19pdr_1", K = "_column_19pdr_
108
111
  }
109
112
  ),
110
113
  /* @__PURE__ */ e(t, { flexDirection: "row", hideAt: ["md", "lg"], children: /* @__PURE__ */ e(_, { onSearch: p, inputName: "cpc-search", className: r.search }) }),
111
- /* @__PURE__ */ e(B, { categories: n })
114
+ /* @__PURE__ */ e(K, { categories: n, isCategoriesLoading: j })
112
115
  ] }) });
113
116
  });
114
117
  function i({
@@ -119,5 +122,5 @@ function i({
119
122
  return /* @__PURE__ */ e(l, { href: m, className: r.siteLink, ...n, children: /* @__PURE__ */ e(N, { size: "md", variant: "display", children: c }) });
120
123
  }
121
124
  export {
122
- le as MainNav
125
+ de as MainNav
123
126
  };
@@ -11,3 +11,4 @@ type Story = StoryObj<typeof meta>;
11
11
  export declare const Authenticated: Story;
12
12
  export declare const WithCartItems: Story;
13
13
  export declare const Unauthenticated: Story;
14
+ export declare const Loading: Story;
@@ -1,16 +1,19 @@
1
- import { jsxs as u, Fragment as s, jsx as c } from "react/jsx-runtime";
2
- import { useState as b } from "react";
3
- import { MainNav as d } from "./MainNav.js";
4
- import { CartSlideInPanel as m } from "../../molecules/Cart/CartSlideInPanel.js";
5
- const I = {
1
+ import { jsxs as b, Fragment as g, jsx as t } from "react/jsx-runtime";
2
+ import { useState as h } from "react";
3
+ import { MainNav as m } from "./MainNav.js";
4
+ import { Text as s } from "../../atoms/Text/Text.js";
5
+ import { Link as u } from "../../atoms/Link/Link.js";
6
+ import { Button as p } from "../../atoms/Button/Button.js";
7
+ import { CartSlideInPanel as v } from "../../molecules/Cart/CartSlideInPanel.js";
8
+ const U = {
6
9
  title: "Case Parts/Organisms/MainNav",
7
- component: d,
10
+ component: m,
8
11
  parameters: {
9
12
  // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
10
13
  layout: "fullscreen"
11
14
  }
12
15
  // tags: ["autodocs"],
13
- }, o = [
16
+ }, l = [
14
17
  {
15
18
  id: 0,
16
19
  label: "Shop by Brands",
@@ -119,30 +122,36 @@ const I = {
119
122
  { id: 12, itemId: "1092-02", description: "Kason Door Closer - Offset", price: "$99.99", quantity: 1, imageUrl: a, availability: "In Stock", availabilityId: "available" }
120
123
  ]
121
124
  };
122
- function v(e) {
125
+ function y(e) {
123
126
  return `$${e.items.reduce(
124
- (t, i) => t + (parseFloat(i.price.replace(/[^0-9.]/g, "")) || 0) * i.quantity,
127
+ (i, o) => i + (parseFloat(o.price.replace(/[^0-9.]/g, "")) || 0) * o.quantity,
125
128
  0
126
129
  ).toFixed(2)}`;
127
130
  }
128
- const n = (e) => {
129
- const [l, t] = b(!1);
130
- return /* @__PURE__ */ u(s, { children: [
131
- /* @__PURE__ */ c(
132
- d,
131
+ const d = /* @__PURE__ */ b("div", { style: { display: "flex", flexDirection: "column", gap: 8, minWidth: 220 }, children: [
132
+ /* @__PURE__ */ t(s, { size: "sm", weight: "semibold", children: "Account" }),
133
+ /* @__PURE__ */ t(s, { size: "xs", children: "Signed in as Ringo" }),
134
+ /* @__PURE__ */ t(u, { href: "/account", children: "View Account" }),
135
+ /* @__PURE__ */ t(u, { href: "/orders", children: "Order History" }),
136
+ /* @__PURE__ */ t(p, { size: "sm", variant: "secondary", onClick: () => alert("Sign out"), children: "Sign Out" })
137
+ ] }), n = (e) => {
138
+ const [c, i] = h(!1);
139
+ return /* @__PURE__ */ b(g, { children: [
140
+ /* @__PURE__ */ t(
141
+ m,
133
142
  {
134
143
  ...e,
135
- open: l,
136
- onCartClick: () => t((i) => !i)
144
+ open: c,
145
+ onCartClick: () => i((o) => !o)
137
146
  }
138
147
  ),
139
- /* @__PURE__ */ c(
140
- m,
148
+ /* @__PURE__ */ t(
149
+ v,
141
150
  {
142
- open: l,
143
- onClose: () => t(!1),
151
+ open: c,
152
+ onClose: () => i(!1),
144
153
  cart: e.cart,
145
- subtotal: v(e.cart),
154
+ subtotal: y(e.cart),
146
155
  itemPriceLabel: "List Price",
147
156
  contactHref: e.contactRoute,
148
157
  contactLinkBehavior: "new-tab",
@@ -152,13 +161,12 @@ const n = (e) => {
152
161
  }
153
162
  )
154
163
  ] });
155
- }, S = {
164
+ }, $ = {
156
165
  args: {
157
166
  account: { name: "Ringo", initials: "RS", number: "123456789012" },
158
167
  cart: r,
159
168
  homeRoute: "/",
160
169
  customPartsRoute: "/custom",
161
- accountRoute: "/account",
162
170
  onClickModelSerial: () => {
163
171
  alert("Model/Serial");
164
172
  },
@@ -174,16 +182,16 @@ const n = (e) => {
174
182
  onCartClick: () => {
175
183
  },
176
184
  // placeholder required by component
177
- categories: o
185
+ categories: l,
186
+ accountPopoverContent: d
178
187
  },
179
188
  render: n
180
- }, C = {
189
+ }, D = {
181
190
  args: {
182
191
  account: { name: "Ringo", initials: "RS", number: "123456789012" },
183
192
  cart: r,
184
193
  homeRoute: "/",
185
194
  customPartsRoute: "/custom",
186
- accountRoute: "/account",
187
195
  onClickModelSerial: () => {
188
196
  alert("Model/Serial");
189
197
  },
@@ -198,15 +206,15 @@ const n = (e) => {
198
206
  },
199
207
  onCartClick: () => {
200
208
  },
201
- categories: o
209
+ categories: l,
210
+ accountPopoverContent: d
202
211
  },
203
212
  render: n
204
- }, k = {
213
+ }, L = {
205
214
  args: {
206
215
  cart: r,
207
216
  homeRoute: "/",
208
217
  customPartsRoute: "/custom",
209
- accountRoute: "/account",
210
218
  onClickModelSerial: () => {
211
219
  alert("Model/Serial");
212
220
  },
@@ -221,13 +229,40 @@ const n = (e) => {
221
229
  },
222
230
  onCartClick: () => {
223
231
  },
224
- categories: o
232
+ categories: l
233
+ },
234
+ render: n
235
+ }, M = {
236
+ args: {
237
+ account: { name: "Ringo", initials: "RS", number: "123456789012" },
238
+ cart: r,
239
+ homeRoute: "/",
240
+ customPartsRoute: "/custom",
241
+ onClickModelSerial: () => {
242
+ alert("Model/Serial");
243
+ },
244
+ faqRoute: "/faq",
245
+ aboutUsRoute: "/about",
246
+ contactRoute: "/contact",
247
+ onLoginClick: () => {
248
+ alert("Login");
249
+ },
250
+ onSearch: (e) => {
251
+ alert(`Search ${e}`);
252
+ },
253
+ onCartClick: () => {
254
+ },
255
+ categories: l,
256
+ accountPopoverContent: d,
257
+ isAccountLoading: !0,
258
+ isCategoriesLoading: !0
225
259
  },
226
260
  render: n
227
261
  };
228
262
  export {
229
- S as Authenticated,
230
- k as Unauthenticated,
231
- C as WithCartItems,
232
- I as default
263
+ $ as Authenticated,
264
+ M as Loading,
265
+ L as Unauthenticated,
266
+ D as WithCartItems,
267
+ U as default
233
268
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@caseparts-org/caseblocks",
3
3
  "private": false,
4
- "version": "0.0.109",
4
+ "version": "0.0.111",
5
5
  "type": "module",
6
6
  "module": "dist/main.js",
7
7
  "types": "dist/main.d.ts",