@caseparts-org/caseblocks 0.0.49 → 0.0.51

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.
@@ -32,7 +32,7 @@ function U({
32
32
  itemPriceLabel: p,
33
33
  ...u
34
34
  }) {
35
- return n = n || { items: [] }, console.log(n), /* @__PURE__ */ t(
35
+ return n = n || { items: [] }, /* @__PURE__ */ t(
36
36
  f,
37
37
  {
38
38
  tooltipClassName: i.cartTooltip,
@@ -379,7 +379,7 @@ function J() {
379
379
  }
380
380
  }
381
381
  process.env.NODE_ENV === "production" ? (J(), B.exports = ue()) : B.exports = le();
382
- var H = B.exports;
382
+ var P = B.exports;
383
383
  const de = "_wrapper_1bu3d_1", fe = "_tooltip_1bu3d_6", ge = "_open_1bu3d_19", U = {
384
384
  wrapper: de,
385
385
  tooltip: fe,
@@ -397,9 +397,9 @@ const de = "_wrapper_1bu3d_1", fe = "_tooltip_1bu3d_6", ge = "_open_1bu3d_19", U
397
397
  viewportPadding: t = 4,
398
398
  allowEnter: o = !0
399
399
  }) => {
400
- const [r, e] = m.useState(!1), i = m.useRef(null), y = m.useId(), O = m.useRef(null), b = m.useRef(null), Q = ye(), M = _ === "auto" ? Q ? "hover" : "click" : _, G = o ? 200 : 0, k = m.useRef(null), [Z, F] = m.useState(a), [ee, P] = m.useState(0), [te, I] = m.useState(0);
400
+ const [r, e] = m.useState(!1), i = m.useRef(null), y = m.useId(), O = m.useRef(null), b = m.useRef(null), Q = ye(), M = _ === "auto" ? Q ? "hover" : "click" : _, G = o ? 200 : 0, k = m.useRef(null), [Z, F] = m.useState(a), [ee, H] = m.useState(0), [te, I] = m.useState(0);
401
401
  m.useEffect(() => {
402
- r || (F(a), P(0), I(0));
402
+ r || (F(a), H(0), I(0));
403
403
  }, [r, a]);
404
404
  function C() {
405
405
  i.current && (window.clearTimeout(i.current), i.current = null);
@@ -407,7 +407,7 @@ const de = "_wrapper_1bu3d_1", fe = "_tooltip_1bu3d_6", ge = "_open_1bu3d_19", U
407
407
  function x() {
408
408
  const s = O.current, S = b.current;
409
409
  if (!s || !S) return;
410
- P(0), I(0);
410
+ H(0), I(0);
411
411
  const h = window.innerWidth, $ = window.innerHeight, w = s.getBoundingClientRect(), A = S.getBoundingClientRect();
412
412
  let D = a;
413
413
  if (n)
@@ -422,7 +422,7 @@ const de = "_wrapper_1bu3d_1", fe = "_tooltip_1bu3d_6", ge = "_open_1bu3d_19", U
422
422
  if (D === "top" || D === "bottom") {
423
423
  const l = w.left + w.width / 2 - A.width / 2, p = t, E = h - t - A.width;
424
424
  let L = 0;
425
- l < p ? L = p - l : l > E && (L = E - l), P(L);
425
+ l < p ? L = p - l : l > E && (L = E - l), H(L);
426
426
  } else {
427
427
  const l = w.top + w.height / 2 - A.height / 2, p = t, E = $ - t - A.height;
428
428
  let L = 0;
@@ -443,19 +443,19 @@ const de = "_wrapper_1bu3d_1", fe = "_tooltip_1bu3d_6", ge = "_open_1bu3d_19", U
443
443
  return;
444
444
  }
445
445
  i.current = window.setTimeout(() => {
446
- H.flushSync(() => e(!0)), H.flushSync(() => x());
446
+ P.flushSync(() => e(!0)), P.flushSync(() => x());
447
447
  }, c);
448
448
  }
449
449
  function re() {
450
450
  C(), N(), k.current = window.setTimeout(() => {
451
- console.log("Hiding tooltip"), e(!1);
451
+ e(!1);
452
452
  }, G);
453
453
  }
454
454
  function j() {
455
455
  C(), N(), e(!1);
456
456
  }
457
457
  function z() {
458
- C(), r ? e(!1) : (H.flushSync(() => e(!0)), H.flushSync(() => x()));
458
+ C(), r ? e(!1) : (P.flushSync(() => e(!0)), P.flushSync(() => x()));
459
459
  }
460
460
  V(() => {
461
461
  if (!r) return;
@@ -507,7 +507,7 @@ const de = "_wrapper_1bu3d_1", fe = "_tooltip_1bu3d_6", ge = "_open_1bu3d_19", U
507
507
  }
508
508
  } : {}, oe = M === "click" ? {
509
509
  onClick: (s) => {
510
- r || (s.preventDefault(), z());
510
+ s.preventDefault(), z();
511
511
  },
512
512
  onKeyDown: (s) => {
513
513
  s.key === "Enter" || s.key === " " ? (s.preventDefault(), z()) : s.key === "Escape" && re();
@@ -36,3 +36,4 @@ export declare const OnHover: Story;
36
36
  export declare const OnClick: Story;
37
37
  export declare const PositionRight: Story;
38
38
  export declare const PositionLeft: Story;
39
+ export declare const AbsolutelyPositioned: Story;
@@ -1,6 +1,6 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
2
  import { Tooltip as e } from "./Tooltip.js";
3
- import { Button as o } from "../../atoms/Button/Button.js";
3
+ import { Button as i } from "../../atoms/Button/Button.js";
4
4
  const s = {
5
5
  title: "Case Parts/Molecules/Tooltip",
6
6
  component: e,
@@ -38,7 +38,7 @@ const s = {
38
38
  delay: 0,
39
39
  allowEnter: !0
40
40
  },
41
- render: (i) => /* @__PURE__ */ t(
41
+ render: (o) => /* @__PURE__ */ t(
42
42
  "div",
43
43
  {
44
44
  style: {
@@ -52,8 +52,8 @@ const s = {
52
52
  children: /* @__PURE__ */ t(
53
53
  e,
54
54
  {
55
- ...i,
56
- trigger: /* @__PURE__ */ t("div", { className: "tooltip-story", children: /* @__PURE__ */ t(o, { size: "md", variant: "primary", children: "Hover me" }) }),
55
+ ...o,
56
+ trigger: /* @__PURE__ */ t("div", { className: "tooltip-story", children: /* @__PURE__ */ t(i, { size: "md", variant: "primary", children: "Hover me" }) }),
57
57
  on: "hover",
58
58
  children: "This tooltip appears on hover (top center)."
59
59
  }
@@ -75,7 +75,7 @@ const s = {
75
75
  children: /* @__PURE__ */ t(
76
76
  e,
77
77
  {
78
- trigger: /* @__PURE__ */ t("div", { className: "tooltip-story", children: /* @__PURE__ */ t(o, { size: "md", variant: "secondary", children: "Click me" }) }),
78
+ trigger: /* @__PURE__ */ t("div", { className: "tooltip-story", children: /* @__PURE__ */ t(i, { size: "md", variant: "secondary", children: "Click me" }) }),
79
79
  on: "click",
80
80
  position: "bottom",
81
81
  children: "This tooltip appears on click (bottom center)."
@@ -98,7 +98,7 @@ const s = {
98
98
  children: /* @__PURE__ */ t(
99
99
  e,
100
100
  {
101
- trigger: /* @__PURE__ */ t("div", { className: "tooltip-story", children: /* @__PURE__ */ t(o, { size: "md", variant: "cta-primary", children: "Hover right" }) }),
101
+ trigger: /* @__PURE__ */ t("div", { className: "tooltip-story", children: /* @__PURE__ */ t(i, { size: "md", variant: "cta-primary", children: "Hover right" }) }),
102
102
  on: "hover",
103
103
  position: "right",
104
104
  children: "Tooltip on the right."
@@ -121,7 +121,7 @@ const s = {
121
121
  children: /* @__PURE__ */ t(
122
122
  e,
123
123
  {
124
- trigger: /* @__PURE__ */ t("div", { className: "tooltip-story", children: /* @__PURE__ */ t(o, { size: "md", variant: "tertiary", children: "Hover left" }) }),
124
+ trigger: /* @__PURE__ */ t("div", { className: "tooltip-story", children: /* @__PURE__ */ t(i, { size: "md", variant: "tertiary", children: "Hover left" }) }),
125
125
  on: "hover",
126
126
  position: "left",
127
127
  children: "Tooltip on the left."
@@ -129,8 +129,33 @@ const s = {
129
129
  )
130
130
  }
131
131
  )
132
+ }, p = {
133
+ render: () => /* @__PURE__ */ t(
134
+ "div",
135
+ {
136
+ style: {
137
+ height: "10vh",
138
+ display: "flex",
139
+ flexDirection: "row",
140
+ alignItems: "center",
141
+ justifyContent: "center",
142
+ position: "absolute",
143
+ right: "300px"
144
+ },
145
+ children: /* @__PURE__ */ t(
146
+ e,
147
+ {
148
+ trigger: /* @__PURE__ */ t("div", { className: "tooltip-story", children: /* @__PURE__ */ t(i, { size: "md", variant: "cta-primary", children: "Hover right" }) }),
149
+ on: "hover",
150
+ position: "right",
151
+ children: "Tooltip on the right."
152
+ }
153
+ )
154
+ }
155
+ )
132
156
  };
133
157
  export {
158
+ p as AbsolutelyPositioned,
134
159
  a as OnClick,
135
160
  c as OnHover,
136
161
  d as PositionLeft,
@@ -4,6 +4,7 @@ import { ContactUsLinkBehavior } from 'lib/main-client';
4
4
  export interface MainNavProps extends CartPropsBase, React.HTMLAttributes<HTMLDivElement>, Pick<AccountProps, "account"> {
5
5
  categories?: MainCategory[];
6
6
  faqRoute: string;
7
+ byModelSerialRoute: string;
7
8
  customPartsRoute: string;
8
9
  aboutUsRoute: string;
9
10
  accountRoute: string;
@@ -24,4 +25,4 @@ export interface MainCategory extends Category {
24
25
  children: Category[];
25
26
  showChevron?: boolean;
26
27
  }
27
- export declare function MainNav({ account, categories, faqRoute, customPartsRoute, aboutUsRoute, accountRoute, contactRoute, cart, cartSubtotal, cartItemPriceLabel, cartContactLinkBehavior, onLoginClick, onSearch, onItemQtyChange, onItemDelete, onItemEdit, onCheckout, className, ...otherProps }: MainNavProps): import("react/jsx-runtime").JSX.Element;
28
+ export declare function MainNav({ account, categories, byModelSerialRoute, faqRoute, customPartsRoute, aboutUsRoute, accountRoute, contactRoute, cart, cartSubtotal, cartItemPriceLabel, cartContactLinkBehavior, onLoginClick, onSearch, onItemQtyChange, onItemDelete, onItemEdit, onCheckout, className, ...otherProps }: MainNavProps): import("react/jsx-runtime").JSX.Element;
@@ -1,109 +1,111 @@
1
1
  import { jsx as e, jsxs as t } from "react/jsx-runtime";
2
2
  import { Text as f } from "../../atoms/Text/Text.js";
3
3
  import { Link as p } from "../../atoms/Link/Link.js";
4
- import { Icon as k } from "../../atoms/Icon/Icon.js";
5
- import { Flex as o } from "../../atoms/Flex/Flex.js";
6
- import { Grid as w, Column as D } from "../../atoms/Grid/Grid.js";
7
- import { Logo as F } from "../../molecules/Logo/Logo.js";
4
+ import { Icon as w } from "../../atoms/Icon/Icon.js";
5
+ import { Flex as a } from "../../atoms/Flex/Flex.js";
6
+ import { Grid as D, Column as I } from "../../atoms/Grid/Grid.js";
7
+ import { Logo as M } from "../../molecules/Logo/Logo.js";
8
8
  import { SearchBox as d } from "../../molecules/SearchBox/SearchBox.js";
9
- import { HamburgerMenu as I } from "../../molecules/HamburgerMenu/HamburgerMenu.js";
10
- import { ShoppingCart as U } from "../../molecules/Cart/Cart.js";
11
- import { Account as B } from "../../molecules/Account/Account.js";
9
+ import { HamburgerMenu as U } from "../../molecules/HamburgerMenu/HamburgerMenu.js";
10
+ import { ShoppingCart as B } from "../../molecules/Cart/Cart.js";
11
+ import { Account as F } from "../../molecules/Account/Account.js";
12
12
  import { CategoryNav as H } from "../../molecules/CategoryNav/CategoryNav.js";
13
- import { c as M } from "../../clsx-OuTLNxxd.js";
14
- import '../../assets/MainNav.css';const P = "_main_18fjz_1", Q = "_column_18fjz_8", G = "_topNav_18fjz_13", K = "_operations_18fjz_21", S = "_search_18fjz_28", T = "_siteLink_18fjz_31", W = "_accountArea_18fjz_35", E = "_category_18fjz_47", J = "_menuList_18fjz_69", i = {
15
- main: P,
16
- column: Q,
17
- topNav: G,
18
- operations: K,
19
- search: S,
20
- siteLink: T,
21
- accountArea: W,
13
+ import { c as P } from "../../clsx-OuTLNxxd.js";
14
+ import '../../assets/MainNav.css';const S = "_main_18fjz_1", G = "_column_18fjz_8", K = "_topNav_18fjz_13", Q = "_operations_18fjz_21", T = "_search_18fjz_28", W = "_siteLink_18fjz_31", q = "_accountArea_18fjz_35", E = "_category_18fjz_47", J = "_menuList_18fjz_69", i = {
15
+ main: S,
16
+ column: G,
17
+ topNav: K,
18
+ operations: Q,
19
+ search: T,
20
+ siteLink: W,
21
+ accountArea: q,
22
22
  category: E,
23
23
  menuList: J
24
24
  };
25
- function ce({
26
- account: a,
25
+ function ae({
26
+ account: o,
27
27
  categories: n,
28
- faqRoute: c,
29
- customPartsRoute: l,
30
- aboutUsRoute: _,
31
- accountRoute: u,
28
+ byModelSerialRoute: c,
29
+ faqRoute: _,
30
+ customPartsRoute: m,
31
+ aboutUsRoute: u,
32
+ accountRoute: N,
32
33
  contactRoute: s,
33
- cart: N,
34
- cartSubtotal: v,
35
- cartItemPriceLabel: A,
36
- cartContactLinkBehavior: g,
37
- onLoginClick: j,
34
+ cart: v,
35
+ cartSubtotal: g,
36
+ cartItemPriceLabel: j,
37
+ cartContactLinkBehavior: A,
38
+ onLoginClick: L,
38
39
  onSearch: h,
39
- onItemQtyChange: L,
40
- onItemDelete: x,
41
- onItemEdit: z,
42
- onCheckout: C,
40
+ onItemQtyChange: x,
41
+ onItemDelete: z,
42
+ onItemEdit: C,
43
+ onCheckout: k,
43
44
  className: y,
44
45
  ...b
45
46
  }) {
46
- return /* @__PURE__ */ e(w, { ...b, gridWrapperClassName: M(i.main, y), children: /* @__PURE__ */ t(D, { span: 12, className: i.column, children: [
47
+ return /* @__PURE__ */ e(D, { ...b, gridWrapperClassName: P(i.main, y), children: /* @__PURE__ */ t(I, { span: 12, className: i.column, children: [
47
48
  /* @__PURE__ */ t(
48
- o,
49
+ a,
49
50
  {
50
51
  flexDirection: "row",
51
52
  alignItems: "center",
52
53
  justifyContent: "space-between",
53
54
  className: i.topNav,
54
55
  children: [
55
- /* @__PURE__ */ e("div", { className: i.logo, children: /* @__PURE__ */ e(F, {}) }),
56
+ /* @__PURE__ */ e("div", { className: i.logo, children: /* @__PURE__ */ e(M, {}) }),
56
57
  /* @__PURE__ */ t(
57
- o,
58
+ a,
58
59
  {
59
60
  flexDirection: "row",
60
61
  alignItems: "center",
61
62
  justifyContent: "flex-end",
62
63
  className: i.operations,
63
64
  children: [
64
- /* @__PURE__ */ e(o, { flexDirection: "row", hideAt: ["sm"], className: i.search, children: /* @__PURE__ */ e(d, { onSearch: h, inputName: "cpc-search" }) }),
65
- /* @__PURE__ */ e(r, { href: l, hideAt: ["sm", "md"], children: "Custom Parts" }),
66
- /* @__PURE__ */ e(r, { href: c, hideAt: ["sm", "md"], children: "FAQ" }),
65
+ /* @__PURE__ */ e(a, { flexDirection: "row", hideAt: ["sm"], className: i.search, children: /* @__PURE__ */ e(d, { onSearch: h, inputName: "cpc-search" }) }),
66
+ /* @__PURE__ */ e(r, { href: c, hideAt: ["sm", "md"], children: "Model/Serial" }),
67
+ /* @__PURE__ */ e(r, { href: m, hideAt: ["sm", "md"], children: "Custom Parts" }),
67
68
  /* @__PURE__ */ e(r, { href: s, hideAt: ["sm", "md"], children: "Contact Us" }),
68
69
  /* @__PURE__ */ e("div", { className: i.accountArea, children: /* @__PURE__ */ e(
69
- B,
70
+ F,
70
71
  {
71
- account: a,
72
- accountRoute: u,
73
- onLoginClick: j,
72
+ account: o,
73
+ accountRoute: N,
74
+ onLoginClick: L,
74
75
  className: i.avatar
75
76
  }
76
77
  ) }),
77
78
  /* @__PURE__ */ e(
78
- U,
79
+ B,
79
80
  {
80
- cart: N,
81
- onItemDelete: x,
82
- onItemEdit: z,
83
- onItemQtyChange: L,
84
- onCheckout: C,
85
- subtotal: v,
81
+ cart: v,
82
+ onItemDelete: z,
83
+ onItemEdit: C,
84
+ onItemQtyChange: x,
85
+ onCheckout: k,
86
+ subtotal: g,
86
87
  contactHref: s,
87
- contactLinkBehavior: g,
88
- itemPriceLabel: A
88
+ contactLinkBehavior: A,
89
+ itemPriceLabel: j
89
90
  }
90
91
  ),
91
- /* @__PURE__ */ e(I, { hideAt: ["lg"], children: /* @__PURE__ */ t("ul", { className: i.menuList, children: [
92
- /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(r, { href: l, children: "Custom Parts" }) }),
93
- /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(r, { href: c, children: "FAQ" }) }),
92
+ /* @__PURE__ */ e(U, { hideAt: ["lg"], children: /* @__PURE__ */ t("ul", { className: i.menuList, children: [
93
+ /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(r, { href: c, children: "Make/Serial" }) }),
94
+ /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(r, { href: m, children: "Custom Parts" }) }),
94
95
  /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(r, { href: s, children: "Contact Us" }) }),
95
- /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(r, { href: _, children: "About Us" }) }),
96
- n && n.map((m) => /* @__PURE__ */ e("li", { className: i.category, children: /* @__PURE__ */ t(p, { href: m.route, children: [
97
- /* @__PURE__ */ e(f, { size: "sm", weight: "semibold", children: m.label }),
96
+ /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(r, { href: _, children: "FAQ" }) }),
97
+ /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(r, { href: u, children: "About Us" }) }),
98
+ n && n.map((l) => /* @__PURE__ */ e("li", { className: i.category, children: /* @__PURE__ */ t(p, { href: l.route, children: [
99
+ /* @__PURE__ */ e(f, { size: "sm", weight: "semibold", children: l.label }),
98
100
  /* @__PURE__ */ e(
99
- k,
101
+ w,
100
102
  {
101
103
  iconKey: "fa-solid fa-chevron-right",
102
104
  title: "Navigate",
103
105
  size: "sm"
104
106
  }
105
107
  )
106
- ] }) }, m.id))
108
+ ] }) }, l.id))
107
109
  ] }) })
108
110
  ]
109
111
  }
@@ -111,17 +113,17 @@ function ce({
111
113
  ]
112
114
  }
113
115
  ),
114
- /* @__PURE__ */ e(o, { flexDirection: "row", hideAt: ["md", "lg"], children: /* @__PURE__ */ e(d, { onSearch: h, inputName: "cpc-search", className: i.search }) }),
116
+ /* @__PURE__ */ e(a, { flexDirection: "row", hideAt: ["md", "lg"], children: /* @__PURE__ */ e(d, { onSearch: h, inputName: "cpc-search", className: i.search }) }),
115
117
  /* @__PURE__ */ e(H, { categories: n })
116
118
  ] }) });
117
119
  }
118
120
  function r({
119
- href: a,
121
+ href: o,
120
122
  children: n,
121
123
  ...c
122
124
  }) {
123
- return /* @__PURE__ */ e(p, { href: a, className: i.siteLink, ...c, children: /* @__PURE__ */ e(f, { size: "md", variant: "display", children: n }) });
125
+ return /* @__PURE__ */ e(p, { href: o, className: i.siteLink, ...c, children: /* @__PURE__ */ e(f, { size: "md", variant: "display", children: n }) });
124
126
  }
125
127
  export {
126
- ce as MainNav
128
+ ae as MainNav
127
129
  };
@@ -105,6 +105,7 @@ const r = {
105
105
  cart: i,
106
106
  customPartsRoute: "/custom",
107
107
  accountRoute: "/account",
108
+ byModelSerialRoute: "/model",
108
109
  faqRoute: "/faq",
109
110
  aboutUsRoute: "/about",
110
111
  contactRoute: "/contact",
@@ -138,6 +139,7 @@ const r = {
138
139
  cart: i,
139
140
  customPartsRoute: "/custom",
140
141
  accountRoute: "/account",
142
+ byModelSerialRoute: "/model",
141
143
  faqRoute: "/faq",
142
144
  aboutUsRoute: "/about",
143
145
  contactRoute: "/contact",
@@ -166,6 +168,7 @@ const r = {
166
168
  cart: i,
167
169
  customPartsRoute: "/custom",
168
170
  accountRoute: "/account",
171
+ byModelSerialRoute: "/model",
169
172
  faqRoute: "/faq",
170
173
  aboutUsRoute: "/about",
171
174
  contactRoute: "/contact",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@caseparts-org/caseblocks",
3
3
  "private": false,
4
- "version": "0.0.49",
4
+ "version": "0.0.51",
5
5
  "type": "module",
6
6
  "module": "dist/main.js",
7
7
  "types": "dist/main.d.ts",