@caseparts-org/caseblocks 0.0.110 → 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}
@@ -13,5 +13,6 @@ export interface AccountProps extends React.HTMLAttributes<HTMLDivElement>, Hide
13
13
  onLoginClick: () => void;
14
14
  /** Optional content to show when clicking the authenticated container */
15
15
  popoverContent?: React.ReactNode;
16
+ isAccountLoading?: boolean;
16
17
  }
17
18
  export declare function Account(props: AccountProps): import("react/jsx-runtime").JSX.Element;
@@ -1,111 +1,120 @@
1
- import { jsx as t, jsxs as n } from "react/jsx-runtime";
2
- import { getHideAtStyles as c } from "../../atoms/HideAt.js";
1
+ import { jsx as o, jsxs as n } from "react/jsx-runtime";
2
+ import { getHideAtStyles as a } from "../../atoms/HideAt.js";
3
3
  import { Icon as f } from "../../atoms/Icon/Icon.js";
4
- import { Text as m } 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
- import { Flex as a } from "../../atoms/Flex/Flex.js";
7
- import { Button as u } from "../../atoms/Button/Button.js";
8
- import { Popover as p } from "../../atoms/Popover/Popover.js";
9
- import { c as d } from "../../clsx-OuTLNxxd.js";
10
- import '../../assets/Account.css';const x = "_loggedIn_1aoh3_1", A = "_customer_1aoh3_12", o = {
6
+ import { Flex as d } from "../../atoms/Flex/Flex.js";
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
11
  loggedIn: x,
12
- customer: A
12
+ customer: v,
13
+ placeholder: I
13
14
  };
14
- function I(i) {
15
+ function z(i) {
15
16
  return i.account !== void 0;
16
17
  }
17
- function P(i) {
18
- return I(i) ? /* @__PURE__ */ t(v, { ...i }) : /* @__PURE__ */ t(k, { ...i });
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 v(i) {
21
+ function _(i) {
21
22
  const {
22
23
  account: e,
23
24
  className: r,
24
25
  hideAt: s,
25
- popoverContent: l,
26
- ...g
26
+ popoverContent: m,
27
+ isAccountLoading: u,
28
+ ...l
27
29
  } = i;
28
- return l ? /* @__PURE__ */ t(
29
- p,
30
+ return m ? /* @__PURE__ */ o(
31
+ A,
30
32
  {
31
33
  position: "bottom right",
32
34
  trigger: /* @__PURE__ */ n(
33
35
  "div",
34
36
  {
35
- className: d(o.loggedIn, c(s), r),
36
- ...g,
37
+ className: g(t.loggedIn, a(s), r),
38
+ ...l,
37
39
  children: [
38
40
  /* @__PURE__ */ n(
39
- a,
41
+ d,
40
42
  {
41
43
  flexDirection: "column",
42
44
  alignItems: "flex-end",
43
45
  hideAt: ["sm", "md"],
44
- className: o.customer,
46
+ className: t.customer,
45
47
  children: [
46
- /* @__PURE__ */ n(m, { size: "xxs", children: [
48
+ /* @__PURE__ */ n(c, { size: "xxs", children: [
47
49
  "Acct: ",
48
50
  e == null ? void 0 : e.number
49
51
  ] }),
50
- /* @__PURE__ */ n(m, { size: "sm", variant: "display", colorToken: "links", children: [
52
+ /* @__PURE__ */ n(c, { size: "sm", variant: "display", colorToken: "links", children: [
51
53
  "Hello ",
52
54
  e == null ? void 0 : e.name
53
55
  ] })
54
56
  ]
55
57
  }
56
58
  ),
57
- /* @__PURE__ */ t(h, { initials: e.initials })
59
+ /* @__PURE__ */ o(h, { initials: e.initials })
58
60
  ]
59
61
  }
60
62
  ),
61
- children: l
63
+ children: m
62
64
  }
63
65
  ) : /* @__PURE__ */ n(
64
66
  "div",
65
67
  {
66
- className: d(o.loggedIn, c(s), r),
67
- ...g,
68
+ className: g(t.loggedIn, a(s), r),
69
+ ...l,
68
70
  children: [
69
71
  /* @__PURE__ */ n(
70
- a,
72
+ d,
71
73
  {
72
74
  flexDirection: "column",
73
75
  alignItems: "flex-end",
74
76
  hideAt: ["sm", "md"],
75
- className: o.customer,
77
+ className: t.customer,
76
78
  children: [
77
- /* @__PURE__ */ n(m, { size: "xxs", children: [
79
+ /* @__PURE__ */ n(c, { size: "xxs", children: [
78
80
  "Acct: ",
79
81
  e == null ? void 0 : e.number
80
82
  ] }),
81
- /* @__PURE__ */ n(m, { size: "sm", variant: "display", colorToken: "links", children: [
83
+ /* @__PURE__ */ n(c, { size: "sm", variant: "display", colorToken: "links", children: [
82
84
  "Hello ",
83
85
  e == null ? void 0 : e.name
84
86
  ] })
85
87
  ]
86
88
  }
87
89
  ),
88
- /* @__PURE__ */ t(h, { initials: e.initials })
90
+ /* @__PURE__ */ o(h, { initials: e.initials })
89
91
  ]
90
92
  }
91
93
  );
92
94
  }
93
- function k(i) {
94
- const { onLoginClick: e, className: r, hideAt: s, ...l } = i;
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;
95
104
  return /* @__PURE__ */ n(
96
- a,
105
+ d,
97
106
  {
98
107
  flexDirection: "row",
99
108
  alignItems: "center",
100
109
  ...l,
101
- className: d(
102
- o.unauthenticated,
103
- c(s),
110
+ className: g(
111
+ t.unauthenticated,
112
+ a(s),
104
113
  r
105
114
  ),
106
115
  children: [
107
- /* @__PURE__ */ t(
108
- u,
116
+ /* @__PURE__ */ o(
117
+ p,
109
118
  {
110
119
  onClick: e,
111
120
  size: "sm",
@@ -114,11 +123,11 @@ function k(i) {
114
123
  children: "Sign In / Register"
115
124
  }
116
125
  ),
117
- /* @__PURE__ */ t(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" })
118
127
  ]
119
128
  }
120
129
  );
121
130
  }
122
131
  export {
123
- P as Account
132
+ T as Account
124
133
  };
@@ -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
  };
@@ -15,6 +15,8 @@ export interface MainNavProps extends CartPropsBase, React.HTMLAttributes<HTMLDi
15
15
  onClickModelSerial: () => void;
16
16
  /** Content shown in the account popover when authenticated */
17
17
  accountPopoverContent?: React.ReactNode;
18
+ isAccountLoading?: boolean;
19
+ isCategoriesLoading?: boolean;
18
20
  }
19
21
  export type MainNavHandle = ShoppingCartHandle;
20
22
  export declare const MainNav: React.ForwardRefExoticComponent<MainNavProps & React.RefAttributes<ShoppingCartHandle>>;
@@ -1,30 +1,30 @@
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,
@@ -41,9 +41,11 @@ import '../../assets/MainNav.css';const G = "_main_19pdr_1", K = "_column_19pdr_
41
41
  onClickModelSerial: f,
42
42
  onCartClick: y,
43
43
  accountPopoverContent: b,
44
- ...w
45
- }, j) {
46
- return /* @__PURE__ */ e(z, { ...w, gridWrapperClassName: s(r.main, C), children: /* @__PURE__ */ o(I, { span: 12, className: r.column, children: [
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
74
  onLoginClick: k,
73
75
  className: r.avatar,
74
- popoverContent: b
76
+ popoverContent: b,
77
+ isAccountLoading: w
75
78
  }
76
79
  ) }),
77
80
  /* @__PURE__ */ e(
78
- F,
81
+ B,
79
82
  {
80
- ref: j,
83
+ ref: M,
81
84
  cart: L,
82
85
  open: x,
83
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,19 +1,19 @@
1
- import { jsxs as u, Fragment as h, jsx as i } from "react/jsx-runtime";
2
- import { useState as p } from "react";
3
- import { MainNav as b } from "./MainNav.js";
4
- import { Text as d } from "../../atoms/Text/Text.js";
5
- import { Link as s } from "../../atoms/Link/Link.js";
6
- import { Button as v } from "../../atoms/Button/Button.js";
7
- import { CartSlideInPanel as g } from "../../molecules/Cart/CartSlideInPanel.js";
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
8
  const U = {
9
9
  title: "Case Parts/Organisms/MainNav",
10
- component: b,
10
+ component: m,
11
11
  parameters: {
12
12
  // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
13
13
  layout: "fullscreen"
14
14
  }
15
15
  // tags: ["autodocs"],
16
- }, r = [
16
+ }, l = [
17
17
  {
18
18
  id: 0,
19
19
  label: "Shop by Brands",
@@ -106,7 +106,7 @@ const U = {
106
106
  route: "#",
107
107
  children: []
108
108
  }
109
- ], a = "https://m.media-amazon.com/images/I/216+JEttsYL._UF1000,1000_QL80_.jpg", n = {
109
+ ], a = "https://m.media-amazon.com/images/I/216+JEttsYL._UF1000,1000_QL80_.jpg", r = {
110
110
  items: [
111
111
  { id: 1, itemId: "1094-01", description: "Kason Door Closer - Flush", price: "$99.99", quantity: 1, imageUrl: a, availability: "In Stock", availabilityId: "available" },
112
112
  { id: 2, itemId: "810810", description: "True Door Gasket", price: "$99.99", quantity: 1, imageUrl: a, availability: "In Stock", availabilityId: "available" },
@@ -124,32 +124,32 @@ const U = {
124
124
  };
125
125
  function y(e) {
126
126
  return `$${e.items.reduce(
127
- (t, l) => t + (parseFloat(l.price.replace(/[^0-9.]/g, "")) || 0) * l.quantity,
127
+ (i, o) => i + (parseFloat(o.price.replace(/[^0-9.]/g, "")) || 0) * o.quantity,
128
128
  0
129
129
  ).toFixed(2)}`;
130
130
  }
131
- const m = /* @__PURE__ */ u("div", { style: { display: "flex", flexDirection: "column", gap: 8, minWidth: 220 }, children: [
132
- /* @__PURE__ */ i(d, { size: "sm", weight: "semibold", children: "Account" }),
133
- /* @__PURE__ */ i(d, { size: "xs", children: "Signed in as Ringo" }),
134
- /* @__PURE__ */ i(s, { href: "/account", children: "View Account" }),
135
- /* @__PURE__ */ i(s, { href: "/orders", children: "Order History" }),
136
- /* @__PURE__ */ i(v, { size: "sm", variant: "secondary", onClick: () => alert("Sign out"), children: "Sign Out" })
137
- ] }), c = (e) => {
138
- const [o, t] = p(!1);
139
- return /* @__PURE__ */ u(h, { children: [
140
- /* @__PURE__ */ i(
141
- b,
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,
142
142
  {
143
143
  ...e,
144
- open: o,
145
- onCartClick: () => t((l) => !l)
144
+ open: c,
145
+ onCartClick: () => i((o) => !o)
146
146
  }
147
147
  ),
148
- /* @__PURE__ */ i(
149
- g,
148
+ /* @__PURE__ */ t(
149
+ v,
150
150
  {
151
- open: o,
152
- onClose: () => t(!1),
151
+ open: c,
152
+ onClose: () => i(!1),
153
153
  cart: e.cart,
154
154
  subtotal: y(e.cart),
155
155
  itemPriceLabel: "List Price",
@@ -161,10 +161,10 @@ const m = /* @__PURE__ */ u("div", { style: { display: "flex", flexDirection: "c
161
161
  }
162
162
  )
163
163
  ] });
164
- }, D = {
164
+ }, $ = {
165
165
  args: {
166
166
  account: { name: "Ringo", initials: "RS", number: "123456789012" },
167
- cart: n,
167
+ cart: r,
168
168
  homeRoute: "/",
169
169
  customPartsRoute: "/custom",
170
170
  onClickModelSerial: () => {
@@ -182,14 +182,14 @@ const m = /* @__PURE__ */ u("div", { style: { display: "flex", flexDirection: "c
182
182
  onCartClick: () => {
183
183
  },
184
184
  // placeholder required by component
185
- categories: r,
186
- accountPopoverContent: m
185
+ categories: l,
186
+ accountPopoverContent: d
187
187
  },
188
- render: c
189
- }, $ = {
188
+ render: n
189
+ }, D = {
190
190
  args: {
191
191
  account: { name: "Ringo", initials: "RS", number: "123456789012" },
192
- cart: n,
192
+ cart: r,
193
193
  homeRoute: "/",
194
194
  customPartsRoute: "/custom",
195
195
  onClickModelSerial: () => {
@@ -206,13 +206,36 @@ const m = /* @__PURE__ */ u("div", { style: { display: "flex", flexDirection: "c
206
206
  },
207
207
  onCartClick: () => {
208
208
  },
209
- categories: r,
210
- accountPopoverContent: m
209
+ categories: l,
210
+ accountPopoverContent: d
211
211
  },
212
- render: c
212
+ render: n
213
213
  }, L = {
214
214
  args: {
215
- cart: n,
215
+ cart: r,
216
+ homeRoute: "/",
217
+ customPartsRoute: "/custom",
218
+ onClickModelSerial: () => {
219
+ alert("Model/Serial");
220
+ },
221
+ faqRoute: "/faq",
222
+ aboutUsRoute: "/about",
223
+ contactRoute: "/contact",
224
+ onLoginClick: () => {
225
+ alert("Login");
226
+ },
227
+ onSearch: (e) => {
228
+ alert(`Search ${e}`);
229
+ },
230
+ onCartClick: () => {
231
+ },
232
+ categories: l
233
+ },
234
+ render: n
235
+ }, M = {
236
+ args: {
237
+ account: { name: "Ringo", initials: "RS", number: "123456789012" },
238
+ cart: r,
216
239
  homeRoute: "/",
217
240
  customPartsRoute: "/custom",
218
241
  onClickModelSerial: () => {
@@ -229,13 +252,17 @@ const m = /* @__PURE__ */ u("div", { style: { display: "flex", flexDirection: "c
229
252
  },
230
253
  onCartClick: () => {
231
254
  },
232
- categories: r
255
+ categories: l,
256
+ accountPopoverContent: d,
257
+ isAccountLoading: !0,
258
+ isCategoriesLoading: !0
233
259
  },
234
- render: c
260
+ render: n
235
261
  };
236
262
  export {
237
- D as Authenticated,
263
+ $ as Authenticated,
264
+ M as Loading,
238
265
  L as Unauthenticated,
239
- $ as WithCartItems,
266
+ D as WithCartItems,
240
267
  U as default
241
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.110",
4
+ "version": "0.0.111",
5
5
  "type": "module",
6
6
  "module": "dist/main.js",
7
7
  "types": "dist/main.d.ts",