@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.
- package/dist/assets/Availability.css +1 -1
- package/dist/assets/Product.css +1 -1
- package/dist/assets/SuggestionDropdown.css +1 -1
- package/dist/main-client.d.ts +1 -1
- package/dist/main.d.ts +1 -1
- package/dist/molecules/Availability/Availability.js +44 -40
- package/dist/organisms/MainNav/MainNav.js +110 -109
- package/dist/organisms/MainNav/MainNav.stories.js +17 -13
- package/dist/organisms/Product/Product.js +102 -102
- package/dist/organisms/SuggestionDropdown/SuggestionDropdown.d.ts +9 -1
- package/dist/organisms/SuggestionDropdown/SuggestionDropdown.js +110 -86
- package/dist/organisms/SuggestionDropdown/SuggestionDropdown.stories.js +10 -6
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._availability_1divs_1{font-style:italic;display:flex;align-items:center;gap:var(--spacing-spacing-4xs)}._pointer_1divs_8{cursor:pointer}._tooltip_1divs_12{background-color:#fafafa}._tooltipContent_1divs_16{max-width:370px}._tooltipContent_1divs_16>ul{padding:0;margin:var(--spacing-spacing-2xs) 0}._tooltipContent_1divs_16 li{list-style:none}._available_1divs_29,._in-stock_1divs_29{color:var(--color-alerts-success)}._limited_1divs_32{color:var(--color-alerts-warning)}._discontinued_1divs_35{color:var(--color-alerts-error-warning)}
|
package/dist/assets/Product.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._productCard_h4utb_3{box-sizing:border-box;position:relative;background:var(--surface-surface-primary, #FFF);display:flex;width:232px;height:296px;padding:var(--spacing-spacing-default, 16px) var(--spacing-spacing-sm, 20px);flex-direction:column;align-items:flex-start;gap:var(--spacing-spacing-2xs)}._productCard_h4utb_3._sm_h4utb_16{width:180px;height:230px}._productCard_h4utb_3>img{object-fit:contain;flex-shrink:0;margin:0 auto}._productCard_h4utb_3 ._productInformation_h4utb_26{display:flex;flex-direction:column;align-items:flex-start;gap:2px;margin-top:auto}._productCard_h4utb_3 ._purchaseInformation_h4utb_33{display:flex;flex-direction:row;align-items:flex-start;justify-content:space-between;width:100%}._productCard_h4utb_3 ._addToCart_h4utb_41,._productCard_h4utb_3 ._addToCartButton_h4utb_44{width:100%}._productInformation_h4utb_26>a{font-weight:var(--font-weight-semibold);white-space:break-spaces;word-wrap:normal}._partNumber_h4utb_54{display:flex;flex-direction:row;align-items:center;gap:var(--spacing-spacing-3xs)}._partNumberLabel_h4utb_61{color:var(--text-text-quaternary)}._productTile_h4utb_65{box-sizing:border-box;position:relative;width:100%;max-width:1072px;display:flex;flex-direction:row;align-items:flex-start;background:var(--surface-surface-primary, #FFF);padding:var(--spacing-spacing-default, 16px) var(--spacing-spacing-sm, 20px);gap:var(--spacing-spacing-1xs)}._productTile_h4utb_65>img{object-fit:contain}._productTile_h4utb_65 ._productInformation_h4utb_26{display:flex;flex-direction:column;align-items:flex-start;gap:2px}._productTile_h4utb_65 ._productData_h4utb_92{display:flex;flex-direction:column;align-items:flex-start;width:100%;gap:var(--spacing-spacing-2xs)}._productTile_h4utb_65 ._purchase_h4utb_33{display:flex;flex-direction:row;align-items:flex-end;justify-content:space-between;width:100%}@media (max-width: 480px){._productTile_h4utb_65 ._purchase_h4utb_33{flex-direction:column;align-items:flex-start;gap:var(--spacing-spacing-3xs)}}._productTile_h4utb_65 ._purchaseInformation_h4utb_33{display:flex;flex-direction:column;align-items:flex-start;gap:var(--spacing-spacing-2xs)}@media (max-width: 480px){._productTile_h4utb_65 ._purchaseInformation_h4utb_33{flex-direction:row;align-items:flex-start;justify-content:space-between;width:100%;gap:0px}}._productTile_h4utb_65 ._attributeContainer_h4utb_129{margin:0;padding:0;padding-top:var(--spacing-spacing-1xs);border-top:1px solid var(--border-border-primary);width:100%;list-style:none;display:flex;flex-direction:row;align-items:center;justify-content:flex-start;flex-wrap:wrap;column-gap:var(--spacing-spacing-lg);row-gap:var(--spacing-spacing-3xs)}@media (max-width: 640px){._productTile_h4utb_65 ._attributeContainer_h4utb_129{display:none}}._productTile_h4utb_65 ._attributeContainer_h4utb_129 li{display:flex;flex-direction:row;align-items:center;gap:var(--spacing-spacing-3xs)}._productTile_h4utb_65 ._addToCart_h4utb_41{display:flex;flex-direction:row;align-items:center;gap:var(--spacing-spacing-md)}@media (max-width: 480px){._productTile_h4utb_65 ._addToCart_h4utb_41{gap:var(--spacing-spacing-2xs);width:100%}}._productTile_h4utb_65 ._addToCartButton_h4utb_44{width:96px;font-size:var(--font-size-md);font-weight:var(--font-weight-semibold)}@media (max-width: 640px){._productTile_h4utb_65 ._addToCartButton_h4utb_44{width:100%}}._elevated_h4utb_177{border:1px solid var(--border-border-primary, #DFDFDF);box-shadow:2px 4px 12px #00000026}._noImage_h4utb_183 ._productInformation_h4utb_26{margin-top:0}._sm_h4utb_16{padding:var(--spacing-spacing-1xs)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._suggestionDropdown_1un69_1{display:flex;flex-direction:row;width:100%;border:1px solid;border-color:var(--color-neutrals-neutral-2);border-radius:var(--border-radius-sm);box-shadow:0 8px 24px #0f172a14;overflow:hidden}@media (max-width: 767px){._suggestionDropdown_1un69_1{flex-direction:column}}._leftColumn_1un69_31{display:flex;flex-direction:column;border-right:1px solid var(--border-border-primary);background-color:#fff;min-width:150px}@media (max-width: 767px){._leftColumn_1un69_31{border-right:0;border-bottom:1px solid var(--border-border-primary)}}._leftColumnFullWidth_1un69_55{flex:1}._suggestionSectionFullHeight_1un69_63{display:flex;flex:1}._rightColumn_1un69_73{display:flex;flex:1;flex-direction:column;gap:var(--spacing-spacing-1xs);padding:var(--spacing-spacing-default);background:var(--color-brand-primary-primary-pale-gray);min-width:250px}._categorySection_1un69_95{border-top:1px solid var(--border-border-primary)}._suggestions_1un69_101,._categories_1un69_103{display:flex;flex-direction:column;gap:0;padding:0}._suggestionsFullHeight_1un69_117{flex:1}._customPartLink_1un69_125{display:flex;align-items:center;gap:var(--spacing-spacing-4xs);box-sizing:border-box;width:100%;padding:var(--spacing-spacing-4xs) var(--spacing-spacing-default);transition:background-color .3s ease-in}._suggestions_1un69_101>:first-child,._categories_1un69_103>:first-child{padding-top:var(--spacing-spacing-default);padding-right:var(--spacing-spacing-default);padding-left:var(--spacing-spacing-default);padding-bottom:var(--spacing-spacing-2xs)}._suggestions_1un69_101>:last-child,._categories_1un69_103>:last-child{padding-bottom:var(--spacing-spacing-2xs)}._suggestionLink_1un69_169,._categoryLink_1un69_171{display:block;box-sizing:border-box;width:100%;padding:var(--spacing-spacing-2xs) var(--spacing-spacing-default);transition:background-color .3s ease-in}._suggestionLink_1un69_169:hover,._categoryLink_1un69_171:hover,._customPartLink_1un69_125:hover{text-decoration:none;background-color:var(--color-alerts-light-teal-blue)}._activeOption_1un69_207{background:var(--color-alerts-light-teal-blue)}._itemList_1un69_215{margin:0;padding:0;display:flex;flex-direction:column;gap:var(--spacing-spacing-2xs);width:100%}._item_1un69_215{display:flex;flex-direction:column;border:1px solid var(--border-border-primary);padding:var(--spacing-spacing-2xs);width:100%;background-color:#fff;transition:background-color .3s ease-in}._item_1un69_215:hover{background-color:var(--color-alerts-light-teal-blue)}._item_1un69_215>a:hover{text-decoration:none}._activeItem_1un69_269{border-color:var(--text-text-links);box-shadow:inset 0 0 0 1px var(--text-text-links)}._item_1un69_215 img{height:60px;width:60px}._item_1un69_215 a{display:flex;flex-direction:row;align-items:flex-start;gap:var(--spacing-spacing-2xs)}._itemInfo_1un69_303{display:grid;gap:var(--spacing-spacing-4xs)}._recentSearches_1un69_313{display:flex;flex-direction:column;background:var(--color-brand-primary-white);min-width:250px}._recentSearchesHeader_1un69_327{padding:var(--spacing-spacing-default) var(--spacing-spacing-default) var(--spacing-spacing-2xs)}._recentSearchesList_1un69_335{display:flex;flex-direction:column;gap:0;margin:0;padding:0}._recentSearch_1un69_313{display:flex;align-items:center;justify-content:space-between;gap:var(--spacing-spacing-2xs)}._recentSearchLink_1un69_365{display:flex;flex:1;min-width:0;align-items:center;padding:var(--spacing-spacing-2xs) var(--spacing-spacing-default)}._clearRecentSearch_1un69_381{display:flex;flex:0 0 auto;align-items:center;justify-content:center;padding:var(--spacing-spacing-2xs) var(--spacing-spacing-default);border:0;background:transparent;color:var(--text-text-primary);cursor:pointer}
|
package/dist/main-client.d.ts
CHANGED
|
@@ -49,7 +49,7 @@ export type { MainNavProps } from './organisms/MainNav/MainNav';
|
|
|
49
49
|
export { ChipSelector } from './organisms/ChipSelector/ChipSelector';
|
|
50
50
|
export type { ChipSelectorProps } from './organisms/ChipSelector/ChipSelector';
|
|
51
51
|
export { SuggestionDropdown } from './organisms/SuggestionDropdown/SuggestionDropdown';
|
|
52
|
-
export type { SuggestionDropdownProps, SuggestedCategory, SuggestedTerm, SuggestedItem, RecentSearch, } from './organisms/SuggestionDropdown/SuggestionDropdown';
|
|
52
|
+
export type { SuggestionDropdownProps, SuggestedCategory, SuggestedTerm, SuggestedItem, SuggestedCustomPart, RecentSearch, } from './organisms/SuggestionDropdown/SuggestionDropdown';
|
|
53
53
|
export { Product } from './organisms/Product/Product';
|
|
54
54
|
export type { ProductProps, ProductView } from './organisms/Product/Product';
|
|
55
55
|
export { Carousel } from './organisms/Carousel/Carousel';
|
package/dist/main.d.ts
CHANGED
|
@@ -34,4 +34,4 @@ export { MainNav } from './organisms/MainNav/MainNav';
|
|
|
34
34
|
export { ChipSelector } from './organisms/ChipSelector/ChipSelector';
|
|
35
35
|
export type { ChipSelectorProps } from './organisms/ChipSelector/ChipSelector';
|
|
36
36
|
export { SuggestionDropdown } from './organisms/SuggestionDropdown/SuggestionDropdown';
|
|
37
|
-
export type { SuggestionDropdownProps, SuggestedCategory, SuggestedTerm, SuggestedItem, RecentSearch, } from './organisms/SuggestionDropdown/SuggestionDropdown';
|
|
37
|
+
export type { SuggestionDropdownProps, SuggestedCategory, SuggestedTerm, SuggestedItem, SuggestedCustomPart, RecentSearch, } from './organisms/SuggestionDropdown/SuggestionDropdown';
|
|
@@ -1,70 +1,74 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { c as
|
|
3
|
-
import { Text as
|
|
4
|
-
import { Tooltip as
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { jsx as i, jsxs as o, Fragment as _ } from "react/jsx-runtime";
|
|
2
|
+
import { c as p } from "../../clsx-OuTLNxxd.js";
|
|
3
|
+
import { Text as s } from "../../atoms/Text/Text.js";
|
|
4
|
+
import { Tooltip as f } from "../../atoms/Tooltip/Tooltip.js";
|
|
5
|
+
import { Icon as b } from "../../atoms/Icon/Icon.js";
|
|
6
|
+
import '../../assets/Availability.css';const w = "_availability_1divs_1", C = "_pointer_1divs_8", g = "_tooltip_1divs_12", z = "_tooltipContent_1divs_16", k = "_available_1divs_29", x = "_limited_1divs_32", S = "_discontinued_1divs_35", l = {
|
|
7
|
+
availability: w,
|
|
8
|
+
pointer: C,
|
|
9
|
+
tooltip: g,
|
|
10
|
+
tooltipContent: z,
|
|
11
|
+
available: k,
|
|
12
|
+
"in-stock": "_in-stock_1divs_29",
|
|
13
|
+
limited: x,
|
|
13
14
|
discontinued: S
|
|
14
15
|
};
|
|
15
|
-
function
|
|
16
|
-
availId:
|
|
17
|
-
availDescription:
|
|
16
|
+
function D({
|
|
17
|
+
availId: t,
|
|
18
|
+
availDescription: e,
|
|
18
19
|
availClassName: d,
|
|
19
20
|
enableTooltip: n = !1,
|
|
20
|
-
inventory:
|
|
21
|
+
inventory: c
|
|
21
22
|
}) {
|
|
22
|
-
const
|
|
23
|
-
return
|
|
24
|
-
|
|
23
|
+
const a = n && c && t !== "not-found";
|
|
24
|
+
return a ? /* @__PURE__ */ i(
|
|
25
|
+
f,
|
|
25
26
|
{
|
|
26
27
|
closeDelay: 0,
|
|
27
28
|
openDelay: 250,
|
|
28
|
-
position: "
|
|
29
|
-
trigger:
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
position: "bottom center",
|
|
30
|
+
trigger: /* @__PURE__ */ o(s, { size: "xs", className: p(l.availability, l[t], a ? l.pointer : null, d), children: [
|
|
31
|
+
e,
|
|
32
|
+
/* @__PURE__ */ i(b, { iconKey: "fa-solid fa-chevron-down", size: "3xs" })
|
|
33
|
+
] }),
|
|
34
|
+
contentClassName: l.tooltip,
|
|
35
|
+
children: /* @__PURE__ */ i(T, { availabilityId: t, inventory: c })
|
|
32
36
|
}
|
|
33
|
-
) :
|
|
37
|
+
) : /* @__PURE__ */ i(s, { size: "xs", className: p(l.availability, l[t], a ? l.pointer : null, d), children: e });
|
|
34
38
|
}
|
|
35
|
-
function
|
|
36
|
-
var n,
|
|
37
|
-
const d = (((n =
|
|
38
|
-
if (
|
|
39
|
-
const
|
|
40
|
-
return /* @__PURE__ */ o("div", { className:
|
|
41
|
-
/* @__PURE__ */ o(
|
|
39
|
+
function T({ availabilityId: t, inventory: e }) {
|
|
40
|
+
var n, c, a, r, m, h;
|
|
41
|
+
const d = (((n = e == null ? void 0 : e.MPK) == null ? void 0 : n.Unreserved) ?? 0) + (((c = e == null ? void 0 : e.SEA) == null ? void 0 : c.Unreserved) ?? 0) + (((a = e == null ? void 0 : e.STL) == null ? void 0 : a.Unreserved) ?? 0);
|
|
42
|
+
if (t === "in-stock" || t === "limited") {
|
|
43
|
+
const u = t === "in-stock" ? "Additional quantity will be backordered. If you need more than we have at any one warehouse, a CSR will contact you with options." : "Once our stock is depleted, this item will no longer be available.";
|
|
44
|
+
return /* @__PURE__ */ o("div", { className: l.tooltipContent, children: [
|
|
45
|
+
/* @__PURE__ */ o(s, { size: "sm", children: [
|
|
42
46
|
"We currently have (",
|
|
43
47
|
d,
|
|
44
48
|
") in stock across our three warehouses:"
|
|
45
49
|
] }),
|
|
46
50
|
/* @__PURE__ */ o("ul", { children: [
|
|
47
|
-
/* @__PURE__ */
|
|
51
|
+
/* @__PURE__ */ i("li", { children: /* @__PURE__ */ o(s, { size: "sm", children: [
|
|
48
52
|
"(",
|
|
49
|
-
((r =
|
|
53
|
+
((r = e == null ? void 0 : e.MPK) == null ? void 0 : r.Unreserved) ?? 0,
|
|
50
54
|
") Los Angeles"
|
|
51
55
|
] }) }),
|
|
52
|
-
/* @__PURE__ */
|
|
56
|
+
/* @__PURE__ */ i("li", { children: /* @__PURE__ */ o(s, { size: "sm", children: [
|
|
53
57
|
"(",
|
|
54
|
-
((
|
|
58
|
+
((m = e == null ? void 0 : e.STL) == null ? void 0 : m.Unreserved) ?? 0,
|
|
55
59
|
") St. Louis"
|
|
56
60
|
] }) }),
|
|
57
|
-
/* @__PURE__ */
|
|
61
|
+
/* @__PURE__ */ i("li", { children: /* @__PURE__ */ o(s, { size: "sm", children: [
|
|
58
62
|
"(",
|
|
59
|
-
((
|
|
63
|
+
((h = e == null ? void 0 : e.SEA) == null ? void 0 : h.Unreserved) ?? 0,
|
|
60
64
|
") Seattle"
|
|
61
65
|
] }) })
|
|
62
66
|
] }),
|
|
63
|
-
/* @__PURE__ */
|
|
67
|
+
/* @__PURE__ */ i(s, { size: "sm", children: u })
|
|
64
68
|
] });
|
|
65
69
|
}
|
|
66
|
-
return
|
|
70
|
+
return t === "available" ? /* @__PURE__ */ i("div", { className: l.tooltipContent, children: /* @__PURE__ */ i(s, { size: "sm", children: "While this part is not currently in stock, we will arrange to get it to you asap, and your CSR will keep you advised of the lead time." }) }) : t === "discontinued" ? /* @__PURE__ */ i("div", { className: l.tooltipContent, children: /* @__PURE__ */ i(s, { size: "sm", children: "Unfortunately, this item is no longer available to purchase." }) }) : /* @__PURE__ */ i(_, {});
|
|
67
71
|
}
|
|
68
72
|
export {
|
|
69
|
-
|
|
73
|
+
D as Availability
|
|
70
74
|
};
|
|
@@ -1,126 +1,127 @@
|
|
|
1
|
-
import { jsx as m, jsxs as d, Fragment as
|
|
1
|
+
import { jsx as m, jsxs as d, Fragment as J } from "react/jsx-runtime";
|
|
2
2
|
import L from "react";
|
|
3
3
|
import { Text as U } from "../../atoms/Text/Text.js";
|
|
4
4
|
import { Link as j } from "../../atoms/Link/Link.js";
|
|
5
5
|
import { Icon as y } from "../../atoms/Icon/Icon.js";
|
|
6
|
-
import { Flex as
|
|
7
|
-
import { Grid as
|
|
8
|
-
import { Input as
|
|
9
|
-
import { InputEndAdornmentButton as
|
|
6
|
+
import { Flex as B } from "../../atoms/Flex/Flex.js";
|
|
7
|
+
import { Grid as di, Column as fi } from "../../atoms/Grid/Grid.js";
|
|
8
|
+
import { Input as X } from "../../atoms/Input/Input.js";
|
|
9
|
+
import { InputEndAdornmentButton as $ } from "../../atoms/InputEndAdornmentButton/InputEndAdornmentButton.js";
|
|
10
10
|
import { Logo as ei } from "../../molecules/Logo/Logo.js";
|
|
11
|
-
import { HamburgerMenu as
|
|
12
|
-
import { ShoppingCart as
|
|
13
|
-
import { Account as
|
|
14
|
-
import { CategoryNav as
|
|
15
|
-
import { SuggestionDropdown as
|
|
16
|
-
import { getHideAtStyles as
|
|
11
|
+
import { HamburgerMenu as si } from "../../molecules/HamburgerMenu/HamburgerMenu.js";
|
|
12
|
+
import { ShoppingCart as ci } from "../../molecules/Cart/Cart.js";
|
|
13
|
+
import { Account as ri } from "../../molecules/Account/Account.js";
|
|
14
|
+
import { CategoryNav as _i } from "../../molecules/CategoryNav/CategoryNav.js";
|
|
15
|
+
import { SuggestionDropdown as u } from "../SuggestionDropdown/SuggestionDropdown.js";
|
|
16
|
+
import { getHideAtStyles as Y } from "../../atoms/HideAt.js";
|
|
17
17
|
import { c as k } from "../../clsx-OuTLNxxd.js";
|
|
18
|
-
import '../../assets/MainNav.css';const
|
|
19
|
-
main:
|
|
18
|
+
import '../../assets/MainNav.css';const Ni = "_main_12974_1", ai = "_column_12974_8", yi = "_topNav_12974_13", ki = "_logo_12974_21", wi = "_operations_12974_24", Ai = "_search_12974_31", bi = "_mobileSearch_12974_36", Di = "_suggestionDropdown_12974_39", vi = "_siteLink_12974_45", xi = "_accountArea_12974_72", Li = "_category_12974_84", Ki = "_categoryLink_12974_92", zi = "_menuList_12974_108", pi = "_menuItemAction_12974_131", Bi = "_shortcutIcon_12974_140", t = {
|
|
19
|
+
main: Ni,
|
|
20
20
|
column: ai,
|
|
21
|
-
topNav:
|
|
22
|
-
logo:
|
|
23
|
-
operations:
|
|
24
|
-
search:
|
|
25
|
-
mobileSearch:
|
|
26
|
-
suggestionDropdown:
|
|
27
|
-
siteLink:
|
|
28
|
-
accountArea:
|
|
29
|
-
category:
|
|
30
|
-
categoryLink:
|
|
31
|
-
menuList:
|
|
32
|
-
menuItemAction:
|
|
33
|
-
shortcutIcon:
|
|
34
|
-
},
|
|
21
|
+
topNav: yi,
|
|
22
|
+
logo: ki,
|
|
23
|
+
operations: wi,
|
|
24
|
+
search: Ai,
|
|
25
|
+
mobileSearch: bi,
|
|
26
|
+
suggestionDropdown: Di,
|
|
27
|
+
siteLink: vi,
|
|
28
|
+
accountArea: xi,
|
|
29
|
+
category: Li,
|
|
30
|
+
categoryLink: Ki,
|
|
31
|
+
menuList: zi,
|
|
32
|
+
menuItemAction: pi,
|
|
33
|
+
shortcutIcon: Bi
|
|
34
|
+
}, Xi = L.forwardRef(function({
|
|
35
35
|
account: F,
|
|
36
36
|
categories: b,
|
|
37
|
-
homeRoute:
|
|
38
|
-
faqRoute:
|
|
37
|
+
homeRoute: Z,
|
|
38
|
+
faqRoute: C,
|
|
39
39
|
customPartsRoute: I,
|
|
40
|
-
aboutUsRoute:
|
|
40
|
+
aboutUsRoute: P,
|
|
41
41
|
contactRoute: M,
|
|
42
|
-
cart:
|
|
43
|
-
open:
|
|
42
|
+
cart: g,
|
|
43
|
+
open: V,
|
|
44
44
|
// consume external panel control props from CartPropsBase
|
|
45
|
-
className:
|
|
46
|
-
onLoginClick:
|
|
47
|
-
searchInputProps:
|
|
45
|
+
className: h,
|
|
46
|
+
onLoginClick: S,
|
|
47
|
+
searchInputProps: l,
|
|
48
48
|
searchValue: s,
|
|
49
49
|
onSearchValueChange: n,
|
|
50
50
|
onClearSearch: w,
|
|
51
51
|
onSearch: c,
|
|
52
|
-
searchSuggestions:
|
|
52
|
+
searchSuggestions: o,
|
|
53
53
|
recentSearches: _,
|
|
54
54
|
onClearRecentSearch: H,
|
|
55
55
|
onCategoryClick: K,
|
|
56
56
|
onClickModelSerial: R,
|
|
57
|
-
onCartClick:
|
|
58
|
-
accountPopoverContent:
|
|
59
|
-
isAccountLoading:
|
|
60
|
-
isCategoriesLoading:
|
|
61
|
-
...
|
|
62
|
-
},
|
|
63
|
-
|
|
64
|
-
|
|
57
|
+
onCartClick: ii,
|
|
58
|
+
accountPopoverContent: ti,
|
|
59
|
+
isAccountLoading: mi,
|
|
60
|
+
isCategoriesLoading: oi,
|
|
61
|
+
...li
|
|
62
|
+
}, ni) {
|
|
63
|
+
var G;
|
|
64
|
+
const [T, N] = L.useState(!1), [f, a] = L.useState(-1), z = L.useRef(null), r = L.useId(), D = T && !!s && !!o, O = T && !D && !!(_ != null && _.length), v = D ? ((o == null ? void 0 : o.terms.length) ?? 0) + ((o == null ? void 0 : o.categories.length) ?? 0) + (((G = o == null ? void 0 : o.customParts) == null ? void 0 : G.length) ?? 0) + ((o == null ? void 0 : o.items.length) ?? 0) : O ? (_ == null ? void 0 : _.length) ?? 0 : 0, q = {
|
|
65
|
+
...l,
|
|
65
66
|
onChange: (i) => {
|
|
66
|
-
var
|
|
67
|
-
|
|
67
|
+
var e;
|
|
68
|
+
a(-1), (e = l == null ? void 0 : l.onChange) == null || e.call(l, i);
|
|
68
69
|
},
|
|
69
70
|
onFocus: (i) => {
|
|
70
|
-
var
|
|
71
|
-
(
|
|
71
|
+
var e;
|
|
72
|
+
(e = l == null ? void 0 : l.onFocus) == null || e.call(l, i), N(!0);
|
|
72
73
|
},
|
|
73
74
|
onBlur: (i) => {
|
|
74
|
-
var
|
|
75
|
-
(
|
|
75
|
+
var e;
|
|
76
|
+
(e = l == null ? void 0 : l.onBlur) == null || e.call(l, i), N(!1);
|
|
76
77
|
},
|
|
77
78
|
onKeyDown: (i) => {
|
|
78
|
-
var
|
|
79
|
-
if ((
|
|
79
|
+
var e, Q, W;
|
|
80
|
+
if ((e = l == null ? void 0 : l.onKeyDown) == null || e.call(l, i), !i.defaultPrevented) {
|
|
80
81
|
if (i.key === "ArrowDown" && v > 0) {
|
|
81
|
-
i.preventDefault(),
|
|
82
|
+
i.preventDefault(), a((x) => x >= v - 1 ? 0 : x + 1);
|
|
82
83
|
return;
|
|
83
84
|
}
|
|
84
85
|
if (i.key === "ArrowUp" && v > 0) {
|
|
85
|
-
i.preventDefault(),
|
|
86
|
+
i.preventDefault(), a((x) => x <= 0 ? v - 1 : x - 1);
|
|
86
87
|
return;
|
|
87
88
|
}
|
|
88
|
-
if (i.key === "Tab" && D &&
|
|
89
|
-
i.preventDefault(), n == null || n((
|
|
89
|
+
if (i.key === "Tab" && D && f >= 0 && f < ((o == null ? void 0 : o.terms.length) ?? 0)) {
|
|
90
|
+
i.preventDefault(), n == null || n((o == null ? void 0 : o.terms[f].name) ?? ""), a(-1);
|
|
90
91
|
return;
|
|
91
92
|
}
|
|
92
|
-
if (i.key === "Enter" &&
|
|
93
|
-
i.preventDefault(), (
|
|
93
|
+
if (i.key === "Enter" && f >= 0 && f < v) {
|
|
94
|
+
i.preventDefault(), (Q = document.getElementById(`${r}-${f}`)) == null || Q.click();
|
|
94
95
|
return;
|
|
95
96
|
}
|
|
96
|
-
i.key === "Enter" && (i.preventDefault(),
|
|
97
|
+
i.key === "Enter" && (i.preventDefault(), N(!1), (W = z.current) == null || W.blur(), c == null || c(s ?? ""));
|
|
97
98
|
}
|
|
98
99
|
}
|
|
99
100
|
}, p = (i) => {
|
|
100
|
-
var
|
|
101
|
-
i.key.length !== 1 || i.altKey || i.ctrlKey || i.metaKey || (i.preventDefault(),
|
|
101
|
+
var e;
|
|
102
|
+
i.key.length !== 1 || i.altKey || i.ctrlKey || i.metaKey || (i.preventDefault(), a(-1), n == null || n(`${s ?? ""}${i.key}`), (e = z.current) == null || e.focus());
|
|
102
103
|
};
|
|
103
|
-
return /* @__PURE__ */ m(
|
|
104
|
+
return /* @__PURE__ */ m(di, { ...li, gridWrapperClassName: k(t.main, h), children: /* @__PURE__ */ d(fi, { span: 12, className: t.column, children: [
|
|
104
105
|
/* @__PURE__ */ d(
|
|
105
|
-
|
|
106
|
+
B,
|
|
106
107
|
{
|
|
107
108
|
flexDirection: "row",
|
|
108
109
|
alignItems: "center",
|
|
109
110
|
justifyContent: "space-between",
|
|
110
111
|
className: t.topNav,
|
|
111
112
|
children: [
|
|
112
|
-
/* @__PURE__ */ m("div", { className: t.logo, children: /* @__PURE__ */ m(j, { href:
|
|
113
|
+
/* @__PURE__ */ m("div", { className: t.logo, children: /* @__PURE__ */ m(j, { href: Z, children: /* @__PURE__ */ m(ei, {}) }) }),
|
|
113
114
|
/* @__PURE__ */ d(
|
|
114
|
-
|
|
115
|
+
B,
|
|
115
116
|
{
|
|
116
117
|
flexDirection: "row",
|
|
117
118
|
alignItems: "center",
|
|
118
119
|
justifyContent: "flex-end",
|
|
119
120
|
className: t.operations,
|
|
120
121
|
children: [
|
|
121
|
-
/* @__PURE__ */ d(
|
|
122
|
+
/* @__PURE__ */ d(B, { flexDirection: "row", hideAt: ["sm"], className: t.search, children: [
|
|
122
123
|
/* @__PURE__ */ m(
|
|
123
|
-
|
|
124
|
+
X,
|
|
124
125
|
{
|
|
125
126
|
variant: "search",
|
|
126
127
|
label: "Search",
|
|
@@ -129,23 +130,23 @@ import '../../assets/MainNav.css';const _i = "_main_12974_1", ai = "_column_1297
|
|
|
129
130
|
autoComplete: "off",
|
|
130
131
|
"aria-autocomplete": "list",
|
|
131
132
|
"aria-controls": r,
|
|
132
|
-
"aria-activedescendant":
|
|
133
|
+
"aria-activedescendant": f >= 0 ? `${r}-${f}` : void 0,
|
|
133
134
|
...q,
|
|
134
135
|
ref: z,
|
|
135
136
|
value: s,
|
|
136
|
-
endAdornment: /* @__PURE__ */ d(
|
|
137
|
+
endAdornment: /* @__PURE__ */ d(J, { children: [
|
|
137
138
|
!!s && /* @__PURE__ */ m(
|
|
138
|
-
|
|
139
|
+
$,
|
|
139
140
|
{
|
|
140
141
|
"aria-label": "Clear search",
|
|
141
142
|
onClick: () => {
|
|
142
|
-
|
|
143
|
+
a(-1), w == null || w();
|
|
143
144
|
},
|
|
144
145
|
iconProps: { iconKey: "fa-regular fa-xmark", size: "sm" }
|
|
145
146
|
}
|
|
146
147
|
),
|
|
147
148
|
/* @__PURE__ */ m(
|
|
148
|
-
|
|
149
|
+
$,
|
|
149
150
|
{
|
|
150
151
|
"aria-label": "Submit search",
|
|
151
152
|
onClick: () => c == null ? void 0 : c(s ?? ""),
|
|
@@ -155,21 +156,21 @@ import '../../assets/MainNav.css';const _i = "_main_12974_1", ai = "_column_1297
|
|
|
155
156
|
] })
|
|
156
157
|
}
|
|
157
158
|
),
|
|
158
|
-
D &&
|
|
159
|
-
|
|
159
|
+
D && o && /* @__PURE__ */ m(
|
|
160
|
+
u,
|
|
160
161
|
{
|
|
161
|
-
...
|
|
162
|
-
activeOptionIndex:
|
|
162
|
+
...o,
|
|
163
|
+
activeOptionIndex: f,
|
|
163
164
|
optionIdPrefix: r,
|
|
164
165
|
onKeyDown: p,
|
|
165
166
|
onSuggestionClick: (i) => {
|
|
166
|
-
n == null || n((i == null ? void 0 : i.name) ?? s ?? ""),
|
|
167
|
+
n == null || n((i == null ? void 0 : i.name) ?? s ?? ""), N(!1);
|
|
167
168
|
},
|
|
168
169
|
className: t.suggestionDropdown
|
|
169
170
|
}
|
|
170
171
|
),
|
|
171
172
|
O && /* @__PURE__ */ m(
|
|
172
|
-
|
|
173
|
+
u,
|
|
173
174
|
{
|
|
174
175
|
terms: [],
|
|
175
176
|
categories: [],
|
|
@@ -177,42 +178,42 @@ import '../../assets/MainNav.css';const _i = "_main_12974_1", ai = "_column_1297
|
|
|
177
178
|
view: "recent-searches",
|
|
178
179
|
recentSearches: _,
|
|
179
180
|
onClearRecentSearch: H,
|
|
180
|
-
activeOptionIndex:
|
|
181
|
+
activeOptionIndex: f,
|
|
181
182
|
optionIdPrefix: r,
|
|
182
183
|
onKeyDown: p,
|
|
183
184
|
onSuggestionClick: (i) => {
|
|
184
|
-
n == null || n((i == null ? void 0 : i.term) ?? s ?? ""),
|
|
185
|
+
n == null || n((i == null ? void 0 : i.term) ?? s ?? ""), N(!1);
|
|
185
186
|
},
|
|
186
187
|
className: t.suggestionDropdown
|
|
187
188
|
}
|
|
188
189
|
)
|
|
189
190
|
] }),
|
|
190
|
-
/* @__PURE__ */ d("button", { onClick: R, className: k(t.siteLink,
|
|
191
|
+
/* @__PURE__ */ d("button", { onClick: R, className: k(t.siteLink, Y(["sm", "md"])), children: [
|
|
191
192
|
/* @__PURE__ */ m(y, { iconKey: "fa-regular fa-sparkles", size: "sm" }),
|
|
192
193
|
"Model/Serial"
|
|
193
194
|
] }),
|
|
194
195
|
/* @__PURE__ */ m(A, { href: I, hideAt: ["sm", "md"], children: "Custom Parts" }),
|
|
195
196
|
/* @__PURE__ */ m(A, { href: M, hideAt: ["sm", "md"], children: "Contact Us" }),
|
|
196
197
|
/* @__PURE__ */ m("div", { className: t.accountArea, children: /* @__PURE__ */ m(
|
|
197
|
-
|
|
198
|
+
ri,
|
|
198
199
|
{
|
|
199
200
|
account: F,
|
|
200
|
-
onLoginClick:
|
|
201
|
+
onLoginClick: S,
|
|
201
202
|
className: t.avatar,
|
|
202
|
-
popoverContent:
|
|
203
|
-
isAccountLoading:
|
|
203
|
+
popoverContent: ti,
|
|
204
|
+
isAccountLoading: mi
|
|
204
205
|
}
|
|
205
206
|
) }),
|
|
206
207
|
/* @__PURE__ */ m(
|
|
207
|
-
|
|
208
|
+
ci,
|
|
208
209
|
{
|
|
209
|
-
ref:
|
|
210
|
-
cart:
|
|
211
|
-
open:
|
|
212
|
-
onCartClick:
|
|
210
|
+
ref: ni,
|
|
211
|
+
cart: g,
|
|
212
|
+
open: V,
|
|
213
|
+
onCartClick: ii
|
|
213
214
|
}
|
|
214
215
|
),
|
|
215
|
-
/* @__PURE__ */ d(
|
|
216
|
+
/* @__PURE__ */ d(si, { hideAt: ["lg"], children: [
|
|
216
217
|
/* @__PURE__ */ d("section", { children: [
|
|
217
218
|
/* @__PURE__ */ m(U, { size: "md", weight: "semibold", children: "Useful shortcuts" }),
|
|
218
219
|
/* @__PURE__ */ d("ul", { className: t.menuList, children: [
|
|
@@ -221,7 +222,7 @@ import '../../assets/MainNav.css';const _i = "_main_12974_1", ai = "_column_1297
|
|
|
221
222
|
{
|
|
222
223
|
onClick: R,
|
|
223
224
|
"data-hamburger-close": "true",
|
|
224
|
-
className: k(t.siteLink, t.menuItemAction,
|
|
225
|
+
className: k(t.siteLink, t.menuItemAction, Y(["lg"])),
|
|
225
226
|
children: [
|
|
226
227
|
/* @__PURE__ */ m(y, { iconKey: "fa-regular fa-sparkles", size: "sm", className: t.shortcutIcon }),
|
|
227
228
|
"Model/Serial"
|
|
@@ -236,11 +237,11 @@ import '../../assets/MainNav.css';const _i = "_main_12974_1", ai = "_column_1297
|
|
|
236
237
|
/* @__PURE__ */ m(y, { iconKey: "fa-regular fa-envelope", size: "sm", className: t.shortcutIcon }),
|
|
237
238
|
"Contact Us"
|
|
238
239
|
] }) }),
|
|
239
|
-
/* @__PURE__ */ m("li", { className: t.menuItem, children: /* @__PURE__ */ d(A, { href:
|
|
240
|
+
/* @__PURE__ */ m("li", { className: t.menuItem, children: /* @__PURE__ */ d(A, { href: C, className: k(t.siteLink, t.menuItemAction), children: [
|
|
240
241
|
/* @__PURE__ */ m(y, { iconKey: "fa-solid fa-question", size: "sm", className: t.shortcutIcon }),
|
|
241
242
|
"FAQ"
|
|
242
243
|
] }) }),
|
|
243
|
-
/* @__PURE__ */ m("li", { className: t.menuItem, children: /* @__PURE__ */ d(A, { href:
|
|
244
|
+
/* @__PURE__ */ m("li", { className: t.menuItem, children: /* @__PURE__ */ d(A, { href: P, className: k(t.siteLink, t.menuItemAction), children: [
|
|
244
245
|
/* @__PURE__ */ m(y, { iconKey: "fa-regular fa-people-group", size: "sm", className: t.shortcutIcon }),
|
|
245
246
|
"About Us"
|
|
246
247
|
] }) })
|
|
@@ -275,9 +276,9 @@ import '../../assets/MainNav.css';const _i = "_main_12974_1", ai = "_column_1297
|
|
|
275
276
|
]
|
|
276
277
|
}
|
|
277
278
|
),
|
|
278
|
-
/* @__PURE__ */ m(
|
|
279
|
+
/* @__PURE__ */ m(B, { flexDirection: "row", hideAt: ["md", "lg"], className: t.mobileSearch, children: /* @__PURE__ */ d("div", { className: t.search, children: [
|
|
279
280
|
/* @__PURE__ */ m(
|
|
280
|
-
|
|
281
|
+
X,
|
|
281
282
|
{
|
|
282
283
|
variant: "search",
|
|
283
284
|
label: "Search",
|
|
@@ -286,23 +287,23 @@ import '../../assets/MainNav.css';const _i = "_main_12974_1", ai = "_column_1297
|
|
|
286
287
|
autoComplete: "off",
|
|
287
288
|
"aria-autocomplete": "list",
|
|
288
289
|
"aria-controls": r,
|
|
289
|
-
"aria-activedescendant":
|
|
290
|
+
"aria-activedescendant": f >= 0 ? `${r}-${f}` : void 0,
|
|
290
291
|
...q,
|
|
291
292
|
ref: z,
|
|
292
293
|
value: s,
|
|
293
|
-
endAdornment: /* @__PURE__ */ d(
|
|
294
|
+
endAdornment: /* @__PURE__ */ d(J, { children: [
|
|
294
295
|
!!s && /* @__PURE__ */ m(
|
|
295
|
-
|
|
296
|
+
$,
|
|
296
297
|
{
|
|
297
298
|
"aria-label": "Clear search",
|
|
298
299
|
onClick: () => {
|
|
299
|
-
|
|
300
|
+
a(-1), w == null || w();
|
|
300
301
|
},
|
|
301
302
|
iconProps: { iconKey: "fa-regular fa-xmark", size: "sm" }
|
|
302
303
|
}
|
|
303
304
|
),
|
|
304
305
|
/* @__PURE__ */ m(
|
|
305
|
-
|
|
306
|
+
$,
|
|
306
307
|
{
|
|
307
308
|
"aria-label": "Submit search",
|
|
308
309
|
onClick: () => c == null ? void 0 : c(s ?? ""),
|
|
@@ -312,11 +313,11 @@ import '../../assets/MainNav.css';const _i = "_main_12974_1", ai = "_column_1297
|
|
|
312
313
|
] })
|
|
313
314
|
}
|
|
314
315
|
),
|
|
315
|
-
D &&
|
|
316
|
-
n == null || n((i == null ? void 0 : i.name) ?? s ?? ""),
|
|
316
|
+
D && o && /* @__PURE__ */ m(u, { ...o, activeOptionIndex: f, optionIdPrefix: r, onKeyDown: p, onSuggestionClick: (i) => {
|
|
317
|
+
n == null || n((i == null ? void 0 : i.name) ?? s ?? ""), N(!1);
|
|
317
318
|
}, className: t.suggestionDropdown }),
|
|
318
319
|
O && /* @__PURE__ */ m(
|
|
319
|
-
|
|
320
|
+
u,
|
|
320
321
|
{
|
|
321
322
|
terms: [],
|
|
322
323
|
categories: [],
|
|
@@ -324,21 +325,21 @@ import '../../assets/MainNav.css';const _i = "_main_12974_1", ai = "_column_1297
|
|
|
324
325
|
view: "recent-searches",
|
|
325
326
|
recentSearches: _,
|
|
326
327
|
onClearRecentSearch: H,
|
|
327
|
-
activeOptionIndex:
|
|
328
|
+
activeOptionIndex: f,
|
|
328
329
|
optionIdPrefix: r,
|
|
329
330
|
onKeyDown: p,
|
|
330
331
|
onSuggestionClick: (i) => {
|
|
331
|
-
n == null || n((i == null ? void 0 : i.term) ?? s ?? ""),
|
|
332
|
+
n == null || n((i == null ? void 0 : i.term) ?? s ?? ""), N(!1);
|
|
332
333
|
},
|
|
333
334
|
className: t.suggestionDropdown
|
|
334
335
|
}
|
|
335
336
|
)
|
|
336
337
|
] }) }),
|
|
337
338
|
/* @__PURE__ */ m(
|
|
338
|
-
|
|
339
|
+
_i,
|
|
339
340
|
{
|
|
340
341
|
categories: b,
|
|
341
|
-
isCategoriesLoading:
|
|
342
|
+
isCategoriesLoading: oi,
|
|
342
343
|
onCategoryClick: K
|
|
343
344
|
}
|
|
344
345
|
)
|
|
@@ -352,5 +353,5 @@ function A({
|
|
|
352
353
|
return /* @__PURE__ */ m(j, { href: E, className: t.siteLink, ...b, children: F });
|
|
353
354
|
}
|
|
354
355
|
export {
|
|
355
|
-
|
|
356
|
+
Xi as MainNav
|
|
356
357
|
};
|