@caseparts-org/caseblocks 0.0.240 → 0.0.242

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,8 +1,8 @@
1
- import { jsxs as p, Fragment as k, jsx as i } from "react/jsx-runtime";
1
+ import { jsxs as p, Fragment as C, jsx as i } from "react/jsx-runtime";
2
2
  import { useState as g } from "react";
3
3
  import { MainNav as b } from "./MainNav.js";
4
- import { Text as y } from "../../atoms/Text/Text.js";
5
- import { Link as h } from "../../atoms/Link/Link.js";
4
+ import { Text as h } from "../../atoms/Text/Text.js";
5
+ import { Link as y } from "../../atoms/Link/Link.js";
6
6
  import { Button as S } from "../../atoms/Button/Button.js";
7
7
  import { CartSlideInPanel as v } from "../../molecules/Cart/CartSlideInPanel.js";
8
8
  const P = {
@@ -119,6 +119,10 @@ const P = {
119
119
  { categoryKey: 46971, name: "Magnetic Gaskets", url: "/category/46971" },
120
120
  { categoryKey: 47501, name: "Magnetic Gaskets", url: "/category/47501" }
121
121
  ],
122
+ customParts: [
123
+ { id: "gasket", label: "Gaskets", url: "/custom/gasket", icon: "fa-kit fa-gaskets" },
124
+ { id: "heater", label: "Bent Heaters", url: "/custom/heater", icon: "fa-kit fa-coils" }
125
+ ],
122
126
  items: [
123
127
  { itemKey: 13503, itemId: "GASKET-RING", description: "Gasket Sample Ring", image: a, url: "/part/GASKET-RING" },
124
128
  { itemKey: 13968, itemId: "810719", description: "26-5/8 x 54-1/4 Door Gasket For True", image: a, url: "/part/810719" },
@@ -126,7 +130,7 @@ const P = {
126
130
  { itemKey: 435, itemId: "810803", description: "25-5/8 x 54-1/8 Door Gasket For True", image: a, url: "/part/810803" },
127
131
  { itemKey: 14622, itemId: "932587", description: "26-3/4 x 26-3/4 Door Gasket For True", image: a, url: "/part/932587" }
128
132
  ]
129
- }, R = [
133
+ }, f = [
130
134
  { term: "door gasket", url: "/search/door-gasket" },
131
135
  { term: "walk-in cooler", url: "/search/walk-in-cooler" },
132
136
  { term: "thermostat", url: "/search/thermostat" }
@@ -146,21 +150,21 @@ const P = {
146
150
  { id: 12, itemId: "1092-02", description: "Kason Door Closer - Offset", price: "$99.99", quantity: 1, imageUrl: a, availability: "In Stock", availabilityId: "available" }
147
151
  ]
148
152
  };
149
- function f(e) {
153
+ function R(e) {
150
154
  return `$${e.items.reduce(
151
155
  (t, r) => t + (parseFloat(r.price.replace(/[^0-9.]/g, "")) || 0) * r.quantity,
152
156
  0
153
157
  ).toFixed(2)}`;
154
158
  }
155
159
  const u = /* @__PURE__ */ p("div", { style: { display: "flex", flexDirection: "column", gap: 8, minWidth: 220 }, children: [
156
- /* @__PURE__ */ i(y, { size: "sm", weight: "semibold", children: "Account" }),
157
- /* @__PURE__ */ i(y, { size: "xs", children: "Signed in as Ringo" }),
158
- /* @__PURE__ */ i(h, { href: "/account", "data-popover-close": "true", children: "View Account" }),
159
- /* @__PURE__ */ i(h, { href: "/orders", "data-popover-close": "true", children: "Order History" }),
160
+ /* @__PURE__ */ i(h, { size: "sm", weight: "semibold", children: "Account" }),
161
+ /* @__PURE__ */ i(h, { size: "xs", children: "Signed in as Ringo" }),
162
+ /* @__PURE__ */ i(y, { href: "/account", "data-popover-close": "true", children: "View Account" }),
163
+ /* @__PURE__ */ i(y, { href: "/orders", "data-popover-close": "true", children: "Order History" }),
160
164
  /* @__PURE__ */ i(S, { size: "sm", variant: "secondary", "data-popover-close": "true", onClick: () => alert("Sign out"), children: "Sign Out" })
161
165
  ] }), m = (e) => {
162
166
  const [o, t] = g(!1);
163
- return /* @__PURE__ */ p(k, { children: [
167
+ return /* @__PURE__ */ p(C, { children: [
164
168
  /* @__PURE__ */ i(
165
169
  b,
166
170
  {
@@ -175,7 +179,7 @@ const u = /* @__PURE__ */ p("div", { style: { display: "flex", flexDirection: "c
175
179
  open: o,
176
180
  onClose: () => t(!1),
177
181
  cart: e.cart,
178
- subtotal: f(e.cart),
182
+ subtotal: R(e.cart),
179
183
  itemPriceLabel: "List Price",
180
184
  onItemQtyChange: () => alert("Qty Change"),
181
185
  onItemDelete: () => alert("Delete"),
@@ -184,7 +188,7 @@ const u = /* @__PURE__ */ p("div", { style: { display: "flex", flexDirection: "c
184
188
  )
185
189
  ] });
186
190
  }, G = (e) => {
187
- const [o, t] = g(""), [r, C] = g(R);
191
+ const [o, t] = g(""), [r, k] = g(f);
188
192
  return /* @__PURE__ */ i(
189
193
  b,
190
194
  {
@@ -196,7 +200,7 @@ const u = /* @__PURE__ */ p("div", { style: { display: "flex", flexDirection: "c
196
200
  searchSuggestions: o ? I : void 0,
197
201
  recentSearches: r,
198
202
  onClearRecentSearch: (l) => {
199
- C((n) => n.filter((d) => d.url !== l.url));
203
+ k((n) => n.filter((d) => d.url !== l.url));
200
204
  },
201
205
  searchInputProps: {
202
206
  ...e.searchInputProps,
@@ -1,87 +1,87 @@
1
- import { jsxs as e, jsx as t } from "react/jsx-runtime";
2
- import { Image as w } from "../../atoms/Image/Image.js";
3
- import { Link as $ } from "../../atoms/Link/Link.js";
1
+ import { jsxs as e, jsx as a } from "react/jsx-runtime";
2
+ import { Image as P } from "../../atoms/Image/Image.js";
3
+ import { Link as j } from "../../atoms/Link/Link.js";
4
4
  import { Text as n } from "../../atoms/Text/Text.js";
5
- import { Availability as P } from "../../molecules/Availability/Availability.js";
6
- import { Pricing as D } from "../../molecules/Pricing/Pricing.js";
7
- import { AddToCart as V } from "../../molecules/AddToCart/AddToCart.js";
8
- import { CustomWizardBadge as k } from "../../molecules/CustomWizardBadge/CustomWizardBadge.js";
9
- import { c as E } from "../../clsx-OuTLNxxd.js";
10
- import '../../assets/Product.css';const G = "_productCard_1qkjr_3", J = "_sm_1qkjr_16", M = "_productInformation_1qkjr_26", O = "_purchaseInformation_1qkjr_33", R = "_addToCart_1qkjr_41", X = "_addToCartButton_1qkjr_44", Y = "_partNumber_1qkjr_54", Z = "_partNumberLabel_1qkjr_61", H = "_productTile_1qkjr_65", y = "_productData_1qkjr_93", L = "_purchase_1qkjr_33", K = "_attributeContainer_1qkjr_130", Q = "_elevated_1qkjr_178", S = "_noImage_1qkjr_184", r = {
11
- productCard: G,
12
- sm: J,
13
- productInformation: M,
14
- purchaseInformation: O,
15
- addToCart: R,
16
- addToCartButton: X,
17
- partNumber: Y,
18
- partNumberLabel: Z,
19
- productTile: H,
20
- productData: y,
21
- purchase: L,
22
- attributeContainer: K,
23
- elevated: Q,
24
- noImage: S
5
+ import { Availability as D } from "../../molecules/Availability/Availability.js";
6
+ import { Pricing as V } from "../../molecules/Pricing/Pricing.js";
7
+ import { AddToCart as E } from "../../molecules/AddToCart/AddToCart.js";
8
+ import { CustomWizardBadge as F } from "../../molecules/CustomWizardBadge/CustomWizardBadge.js";
9
+ import { c as G } from "../../clsx-OuTLNxxd.js";
10
+ import '../../assets/Product.css';const M = "_productCard_h4utb_3", O = "_sm_h4utb_16", R = "_productInformation_h4utb_26", X = "_purchaseInformation_h4utb_33", Y = "_addToCart_h4utb_41", Z = "_addToCartButton_h4utb_44", q = "_partNumber_h4utb_54", H = "_partNumberLabel_h4utb_61", y = "_productTile_h4utb_65", L = "_productData_h4utb_92", K = "_purchase_h4utb_33", Q = "_attributeContainer_h4utb_129", S = "_elevated_h4utb_177", U = "_noImage_h4utb_183", t = {
11
+ productCard: M,
12
+ sm: O,
13
+ productInformation: R,
14
+ purchaseInformation: X,
15
+ addToCart: Y,
16
+ addToCartButton: Z,
17
+ partNumber: q,
18
+ partNumberLabel: H,
19
+ productTile: y,
20
+ productData: L,
21
+ purchase: K,
22
+ attributeContainer: Q,
23
+ elevated: S,
24
+ noImage: U
25
25
  };
26
- function nr({
27
- productView: F,
26
+ function nt({
27
+ productView: J,
28
28
  itemKey: c,
29
29
  partNumber: s,
30
- productDescription: b,
30
+ productDescription: i,
31
31
  availDescription: f,
32
32
  availId: m,
33
33
  inventory: N,
34
34
  productHref: T,
35
- customWizardUrl: l,
36
- customWizardText: j = "Customize",
37
- customWizardColorToken: C = "secondary",
38
- priceLabel: g,
39
- price: u,
35
+ customWizardUrl: u,
36
+ customWizardText: C = "Customize",
37
+ customWizardColorToken: g = "secondary",
38
+ priceLabel: v,
39
+ price: l,
40
40
  imgSrc: o,
41
41
  attributes: _,
42
- className: q,
43
- onAddToCart: v,
44
- flat: x,
45
- size: a = "md",
46
- showQuantity: i = !0,
42
+ className: x,
43
+ onAddToCart: I,
44
+ flat: B,
45
+ size: r = "md",
46
+ showQuantity: b = !0,
47
47
  onLinkClicked: d,
48
- requiresUnitDetails: I = !1,
49
- maxQuantity: B,
50
- ...A
48
+ requiresUnitDetails: A = !1,
49
+ maxQuantity: w,
50
+ ...$
51
51
  }) {
52
- const p = a === "sm" ? "xs" : "sm";
53
- return F === "Card" ? /* @__PURE__ */ e(
52
+ const h = r === "sm" ? "xs" : "sm";
53
+ return J === "Card" ? /* @__PURE__ */ e(
54
54
  "div",
55
55
  {
56
- className: E(
57
- r.productCard,
58
- a && r[a],
59
- q,
60
- !x && r.elevated,
61
- !o && r.noImage
56
+ className: G(
57
+ t.productCard,
58
+ r && t[r],
59
+ x,
60
+ !B && t.elevated,
61
+ !o && t.noImage
62
62
  ),
63
- ...A,
63
+ ...$,
64
64
  children: [
65
- l && /* @__PURE__ */ t(k, { href: l, text: j, colorToken: C }),
66
- o && /* @__PURE__ */ t(
67
- w,
65
+ u && /* @__PURE__ */ a(F, { href: u, text: C, colorToken: g }),
66
+ o && /* @__PURE__ */ a(
67
+ P,
68
68
  {
69
69
  src: o,
70
70
  alt: `${s} product image`,
71
- height: a === "sm" ? 78 : 96,
72
- width: a === "sm" ? 78 : 96
71
+ height: r === "sm" ? 78 : 96,
72
+ width: r === "sm" ? 78 : 96
73
73
  }
74
74
  ),
75
- /* @__PURE__ */ e("div", { className: r.productInformation, children: [
76
- /* @__PURE__ */ t($, { onClick: () => d == null ? void 0 : d(c), size: a, href: T || "#", children: b }),
77
- /* @__PURE__ */ e("div", { className: r.partNumber, children: [
78
- /* @__PURE__ */ t(n, { size: p, className: r.partNumberLabel, children: "Part #" }),
79
- /* @__PURE__ */ t(n, { size: p, weight: "semibold", children: s })
75
+ /* @__PURE__ */ e("div", { className: t.productInformation, children: [
76
+ /* @__PURE__ */ a(j, { onClick: () => d == null ? void 0 : d(c), size: r, href: T || "#", children: i }),
77
+ /* @__PURE__ */ e("div", { className: t.partNumber, children: [
78
+ /* @__PURE__ */ a(n, { size: h, className: t.partNumberLabel, children: "Part #" }),
79
+ /* @__PURE__ */ a(n, { size: h, weight: "semibold", children: s })
80
80
  ] })
81
81
  ] }),
82
- /* @__PURE__ */ e("div", { className: r.purchaseInformation, children: [
83
- m && /* @__PURE__ */ t(
84
- P,
82
+ /* @__PURE__ */ e("div", { className: t.purchaseInformation, children: [
83
+ m && /* @__PURE__ */ a(
84
+ D,
85
85
  {
86
86
  availId: m,
87
87
  availDescription: f,
@@ -89,55 +89,55 @@ function nr({
89
89
  enableTooltip: !0
90
90
  }
91
91
  ),
92
- u && /* @__PURE__ */ t(D, { pricingLabel: g, price: u })
92
+ l && /* @__PURE__ */ a(V, { pricingLabel: v, price: l })
93
93
  ] }),
94
- /* @__PURE__ */ t(
95
- V,
94
+ /* @__PURE__ */ a(
95
+ E,
96
96
  {
97
97
  itemKey: c,
98
- onAdd: v,
99
- max: B,
100
- className: r.addToCart,
101
- addButtonClassName: r.addToCartButton,
102
- addButtonVariant: i ? "cta-primary" : "secondary",
103
- size: a,
98
+ onAdd: I,
99
+ max: w,
100
+ className: t.addToCart,
101
+ addButtonClassName: t.addToCartButton,
102
+ addButtonVariant: b ? "cta-primary" : "secondary",
103
+ size: r,
104
104
  buttonDoneText: "",
105
- buttonText: i ? "Add" : "Add to Cart",
106
- showQuantity: i,
107
- requiresUnitDetails: I
105
+ buttonText: b ? "Add" : "Add to Cart",
106
+ showQuantity: b,
107
+ requiresUnitDetails: A
108
108
  }
109
109
  )
110
110
  ]
111
111
  }
112
- ) : /* @__PURE__ */ e("div", { className: E(
113
- r.productTile,
114
- q,
115
- a && r[a],
116
- !x && r.elevated,
117
- !o && r.noImage
118
- ), ...A, children: [
119
- l && /* @__PURE__ */ t(k, { href: l, text: j, colorToken: C }),
120
- o && /* @__PURE__ */ t(
121
- w,
112
+ ) : /* @__PURE__ */ e("div", { className: G(
113
+ t.productTile,
114
+ x,
115
+ r && t[r],
116
+ !B && t.elevated,
117
+ !o && t.noImage
118
+ ), ...$, children: [
119
+ u && /* @__PURE__ */ a(F, { href: u, text: C, colorToken: g }),
120
+ o && /* @__PURE__ */ a(
121
+ P,
122
122
  {
123
123
  src: o,
124
124
  alt: `${s} product image`,
125
- height: a === "sm" ? 86 : 108,
126
- width: a === "sm" ? 86 : 108
125
+ height: r === "sm" ? 86 : 108,
126
+ width: r === "sm" ? 86 : 108
127
127
  }
128
128
  ),
129
- /* @__PURE__ */ e("div", { className: r.productData, children: [
130
- /* @__PURE__ */ e("div", { className: r.productInformation, children: [
131
- /* @__PURE__ */ t($, { onClick: () => d == null ? void 0 : d(c), size: a, href: T || "#", children: b }),
132
- /* @__PURE__ */ e("div", { className: r.partNumber, children: [
133
- /* @__PURE__ */ t(n, { size: p, className: r.partNumberLabel, children: "Part #" }),
134
- /* @__PURE__ */ t(n, { size: p, weight: "semibold", children: s })
129
+ /* @__PURE__ */ e("div", { className: t.productData, children: [
130
+ /* @__PURE__ */ e("div", { className: t.productInformation, children: [
131
+ /* @__PURE__ */ a(j, { onClick: () => d == null ? void 0 : d(c), size: r, href: T || "#", children: i }),
132
+ /* @__PURE__ */ e("div", { className: t.partNumber, children: [
133
+ /* @__PURE__ */ a(n, { size: h, className: t.partNumberLabel, children: "Part #" }),
134
+ /* @__PURE__ */ a(n, { size: h, weight: "semibold", children: s })
135
135
  ] })
136
136
  ] }),
137
- /* @__PURE__ */ e("div", { className: r.purchase, children: [
138
- /* @__PURE__ */ e("div", { className: r.purchaseInformation, children: [
139
- m && /* @__PURE__ */ t(
140
- P,
137
+ /* @__PURE__ */ e("div", { className: t.purchase, children: [
138
+ /* @__PURE__ */ e("div", { className: t.purchaseInformation, children: [
139
+ m && /* @__PURE__ */ a(
140
+ D,
141
141
  {
142
142
  availId: m,
143
143
  availDescription: f,
@@ -145,20 +145,20 @@ function nr({
145
145
  enableTooltip: !0
146
146
  }
147
147
  ),
148
- u && /* @__PURE__ */ t(D, { pricingLabel: g, price: u })
148
+ l && /* @__PURE__ */ a(V, { pricingLabel: v, price: l })
149
149
  ] }),
150
- /* @__PURE__ */ t(V, { size: a, itemKey: c, onAdd: v, max: B, className: r.addToCart, addButtonClassName: r.addToCartButton, requiresUnitDetails: I })
150
+ /* @__PURE__ */ a(E, { size: r, itemKey: c, onAdd: I, max: w, className: t.addToCart, addButtonClassName: t.addToCartButton, requiresUnitDetails: A })
151
151
  ] }),
152
- _ && _.length > 0 && /* @__PURE__ */ t("ul", { className: r.attributeContainer, children: _.map((h) => /* @__PURE__ */ e("li", { children: [
152
+ _ && _.length > 0 && /* @__PURE__ */ a("ul", { className: t.attributeContainer, children: _.map((p) => /* @__PURE__ */ e("li", { children: [
153
153
  /* @__PURE__ */ e(n, { size: "xs", weight: "light", children: [
154
- h.label,
154
+ p.label,
155
155
  ":"
156
156
  ] }),
157
- /* @__PURE__ */ t(n, { size: "xs", weight: "semibold", children: h.value })
158
- ] }, `${h.label}.${h.value}`)) })
157
+ /* @__PURE__ */ a(n, { size: "xs", weight: "semibold", children: p.value })
158
+ ] }, `${p.label}.${p.value}`)) })
159
159
  ] })
160
160
  ] });
161
161
  }
162
162
  export {
163
- nr as Product
163
+ nt as Product
164
164
  };
@@ -1,3 +1,4 @@
1
+ import { IconProps } from '../../atoms/Icon/Icon';
1
2
  export type SuggestedCategory = {
2
3
  categoryKey: number;
3
4
  name: string;
@@ -14,6 +15,12 @@ export type SuggestedItem = {
14
15
  image: string;
15
16
  url: string;
16
17
  };
18
+ export type SuggestedCustomPart = {
19
+ id: string;
20
+ label: string;
21
+ url: string;
22
+ icon: IconProps["iconKey"];
23
+ };
17
24
  export type RecentSearch = {
18
25
  term: string;
19
26
  url: string;
@@ -27,6 +34,7 @@ export interface SuggestionDropdownProps {
27
34
  terms: SuggestedTerm[];
28
35
  categories: SuggestedCategory[];
29
36
  items: SuggestedItem[];
37
+ customParts?: SuggestedCustomPart[];
30
38
  recentSearches?: RecentSearch[];
31
39
  onClearRecentSearch?: (_recentSearch: RecentSearch) => void;
32
40
  onSuggestionClick?: (_suggestion?: SearchSelection) => void;
@@ -35,5 +43,5 @@ export interface SuggestionDropdownProps {
35
43
  onKeyDown?: React.KeyboardEventHandler<HTMLDivElement>;
36
44
  className?: string;
37
45
  }
38
- export declare function SuggestionDropdown({ terms, categories, items, view, recentSearches, onClearRecentSearch, onSuggestionClick, activeOptionIndex, optionIdPrefix, onKeyDown, className }: SuggestionDropdownProps): import("react/jsx-runtime").JSX.Element;
46
+ export declare function SuggestionDropdown({ terms, categories, items, customParts, view, recentSearches, onClearRecentSearch, onSuggestionClick, activeOptionIndex, optionIdPrefix, onKeyDown, className }: SuggestionDropdownProps): import("react/jsx-runtime").JSX.Element | null;
39
47
  export {};