@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,133 +1,157 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as a, jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import { Text as h } from "../../atoms/Text/Text.js";
|
|
3
|
-
import { Link as
|
|
4
|
-
import { Icon as
|
|
5
|
-
import { c as
|
|
6
|
-
import { Image as
|
|
7
|
-
import '../../assets/SuggestionDropdown.css';const
|
|
8
|
-
suggestionDropdown:
|
|
9
|
-
leftColumn:
|
|
10
|
-
leftColumnFullWidth:
|
|
11
|
-
suggestionSectionFullHeight:
|
|
12
|
-
rightColumn:
|
|
13
|
-
categorySection:
|
|
14
|
-
suggestions:
|
|
15
|
-
categories:
|
|
16
|
-
suggestionsFullHeight:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
3
|
+
import { Link as m } from "../../atoms/Link/Link.js";
|
|
4
|
+
import { Icon as y } from "../../atoms/Icon/Icon.js";
|
|
5
|
+
import { c as o } from "../../clsx-OuTLNxxd.js";
|
|
6
|
+
import { Image as z } from "../../atoms/Image/Image.js";
|
|
7
|
+
import '../../assets/SuggestionDropdown.css';const F = "_suggestionDropdown_1un69_1", H = "_leftColumn_1un69_31", $ = "_leftColumnFullWidth_1un69_55", D = "_suggestionSectionFullHeight_1un69_63", w = "_rightColumn_1un69_73", b = "_categorySection_1un69_95", T = "_suggestions_1un69_101", k = "_categories_1un69_103", q = "_suggestionsFullHeight_1un69_117", W = "_customPartLink_1un69_125", j = "_suggestionLink_1un69_169", K = "_categoryLink_1un69_171", M = "_activeOption_1un69_207", O = "_itemList_1un69_215", R = "_item_1un69_215", x = "_activeItem_1un69_269", A = "_itemInfo_1un69_303", B = "_recentSearches_1un69_313", E = "_recentSearchesHeader_1un69_327", G = "_recentSearchesList_1un69_335", J = "_recentSearch_1un69_313", Q = "_recentSearchLink_1un69_365", U = "_clearRecentSearch_1un69_381", n = {
|
|
8
|
+
suggestionDropdown: F,
|
|
9
|
+
leftColumn: H,
|
|
10
|
+
leftColumnFullWidth: $,
|
|
11
|
+
suggestionSectionFullHeight: D,
|
|
12
|
+
rightColumn: w,
|
|
13
|
+
categorySection: b,
|
|
14
|
+
suggestions: T,
|
|
15
|
+
categories: k,
|
|
16
|
+
suggestionsFullHeight: q,
|
|
17
|
+
customPartLink: W,
|
|
18
|
+
suggestionLink: j,
|
|
19
|
+
categoryLink: K,
|
|
20
|
+
activeOption: M,
|
|
21
|
+
itemList: O,
|
|
22
|
+
item: R,
|
|
23
|
+
activeItem: x,
|
|
24
|
+
itemInfo: A,
|
|
25
|
+
recentSearches: B,
|
|
26
|
+
recentSearchesHeader: E,
|
|
27
|
+
recentSearchesList: G,
|
|
28
|
+
recentSearch: J,
|
|
29
|
+
recentSearchLink: Q,
|
|
30
|
+
clearRecentSearch: U
|
|
30
31
|
};
|
|
31
|
-
function
|
|
32
|
-
terms:
|
|
33
|
-
categories:
|
|
34
|
-
items:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
32
|
+
function I({
|
|
33
|
+
terms: i,
|
|
34
|
+
categories: r,
|
|
35
|
+
items: g,
|
|
36
|
+
customParts: _ = [],
|
|
37
|
+
view: v = "suggestions",
|
|
38
|
+
recentSearches: d = [],
|
|
39
|
+
onClearRecentSearch: f,
|
|
40
|
+
onSuggestionClick: t,
|
|
41
|
+
activeOptionIndex: c = -1,
|
|
40
42
|
optionIdPrefix: u,
|
|
41
|
-
onKeyDown:
|
|
42
|
-
className:
|
|
43
|
+
onKeyDown: p,
|
|
44
|
+
className: N
|
|
43
45
|
}) {
|
|
44
|
-
return
|
|
46
|
+
return i.length === 0 && r.length === 0 && g.length === 0 && _.length === 0 && d.length === 0 ? null : v === "recent-searches" ? /* @__PURE__ */ a(
|
|
45
47
|
"div",
|
|
46
48
|
{
|
|
47
49
|
id: u,
|
|
48
50
|
role: "listbox",
|
|
49
|
-
className:
|
|
50
|
-
onKeyDown:
|
|
51
|
+
className: o(n.suggestionDropdown, n.recentSearches, N),
|
|
52
|
+
onKeyDown: p,
|
|
51
53
|
onMouseDown: (e) => e.preventDefault(),
|
|
52
54
|
children: [
|
|
53
|
-
/* @__PURE__ */
|
|
54
|
-
/* @__PURE__ */
|
|
55
|
-
/* @__PURE__ */
|
|
56
|
-
|
|
55
|
+
/* @__PURE__ */ l("div", { className: n.recentSearchesHeader, children: /* @__PURE__ */ l(h, { size: "xxs", colorToken: "quaternary", children: "Recent Searches" }) }),
|
|
56
|
+
/* @__PURE__ */ l("ol", { className: n.recentSearchesList, children: d.map((e) => /* @__PURE__ */ a("li", { className: n.recentSearch, children: [
|
|
57
|
+
/* @__PURE__ */ l(
|
|
58
|
+
m,
|
|
57
59
|
{
|
|
58
60
|
href: e.url,
|
|
59
|
-
id: `${u}-${
|
|
61
|
+
id: `${u}-${d.indexOf(e)}`,
|
|
60
62
|
role: "option",
|
|
61
|
-
"aria-selected":
|
|
62
|
-
className:
|
|
63
|
-
onClick: () =>
|
|
64
|
-
children: /* @__PURE__ */
|
|
63
|
+
"aria-selected": c === d.indexOf(e),
|
|
64
|
+
className: o(n.recentSearchLink, { [n.activeOption]: c === d.indexOf(e) }),
|
|
65
|
+
onClick: () => t == null ? void 0 : t(e),
|
|
66
|
+
children: /* @__PURE__ */ l(h, { size: "sm", children: e.term })
|
|
65
67
|
}
|
|
66
68
|
),
|
|
67
|
-
/* @__PURE__ */
|
|
69
|
+
/* @__PURE__ */ l(
|
|
68
70
|
"button",
|
|
69
71
|
{
|
|
70
72
|
type: "button",
|
|
71
|
-
className:
|
|
73
|
+
className: n.clearRecentSearch,
|
|
72
74
|
"aria-label": `Clear recent search: ${e.term}`,
|
|
73
|
-
onClick: () =>
|
|
74
|
-
children: /* @__PURE__ */
|
|
75
|
+
onClick: () => f == null ? void 0 : f(e),
|
|
76
|
+
children: /* @__PURE__ */ l(y, { iconKey: "fa-regular fa-xmark", size: "sm" })
|
|
75
77
|
}
|
|
76
78
|
)
|
|
77
79
|
] }, e.url)) })
|
|
78
80
|
]
|
|
79
81
|
}
|
|
80
|
-
) : /* @__PURE__ */
|
|
81
|
-
(
|
|
82
|
-
|
|
83
|
-
/* @__PURE__ */
|
|
84
|
-
|
|
85
|
-
(e,
|
|
86
|
-
|
|
82
|
+
) : /* @__PURE__ */ a("div", { id: u, role: "listbox", className: o(n.suggestionDropdown, N), onKeyDown: p, onMouseDown: (e) => e.preventDefault(), children: [
|
|
83
|
+
(i.length > 0 || r.length > 0 || _.length > 0) && /* @__PURE__ */ a("div", { className: o(n.leftColumn, { [n.leftColumnFullWidth]: g.length === 0 }), children: [
|
|
84
|
+
i.length > 0 && /* @__PURE__ */ l("div", { className: o(n.suggestionSection, { [n.suggestionSectionFullHeight]: r.length === 0 }), children: /* @__PURE__ */ a("div", { className: o(n.suggestions, { [n.suggestionsFullHeight]: r.length === 0 }), children: [
|
|
85
|
+
/* @__PURE__ */ l(h, { size: "xxs", colorToken: "quaternary", children: "Suggestions" }),
|
|
86
|
+
i.map(
|
|
87
|
+
(e, s) => /* @__PURE__ */ l(h, { size: "sm", children: /* @__PURE__ */ l(
|
|
88
|
+
m,
|
|
87
89
|
{
|
|
88
90
|
href: e.url,
|
|
89
|
-
id: `${u}-${
|
|
91
|
+
id: `${u}-${s}`,
|
|
90
92
|
role: "option",
|
|
91
|
-
"aria-selected":
|
|
92
|
-
className:
|
|
93
|
-
onClick: () =>
|
|
93
|
+
"aria-selected": c === s,
|
|
94
|
+
className: o(n.suggestionLink, { [n.activeOption]: c === s }),
|
|
95
|
+
onClick: () => t == null ? void 0 : t(e),
|
|
94
96
|
children: e.name
|
|
95
97
|
}
|
|
96
98
|
) }, e.url)
|
|
97
99
|
)
|
|
98
100
|
] }) }),
|
|
99
|
-
|
|
100
|
-
/* @__PURE__ */
|
|
101
|
-
|
|
102
|
-
(e,
|
|
103
|
-
|
|
101
|
+
r.length > 0 && /* @__PURE__ */ l("div", { className: n.categorySection, children: /* @__PURE__ */ a("div", { className: n.categories, children: [
|
|
102
|
+
/* @__PURE__ */ l(h, { size: "xxs", colorToken: "quaternary", children: "Categories" }),
|
|
103
|
+
r.map(
|
|
104
|
+
(e, s) => /* @__PURE__ */ l(h, { size: "sm", children: /* @__PURE__ */ l(
|
|
105
|
+
m,
|
|
104
106
|
{
|
|
105
107
|
href: e.url,
|
|
106
|
-
id: `${u}-${
|
|
108
|
+
id: `${u}-${i.length + s}`,
|
|
107
109
|
role: "option",
|
|
108
|
-
"aria-selected":
|
|
109
|
-
className:
|
|
110
|
-
onClick: () =>
|
|
110
|
+
"aria-selected": c === i.length + s,
|
|
111
|
+
className: o(n.categoryLink, { [n.activeOption]: c === i.length + s }),
|
|
112
|
+
onClick: () => t == null ? void 0 : t(),
|
|
111
113
|
children: e.name
|
|
112
114
|
}
|
|
113
115
|
) }, e.categoryKey)
|
|
114
116
|
)
|
|
117
|
+
] }) }),
|
|
118
|
+
_.length > 0 && /* @__PURE__ */ l("div", { className: n.categorySection, children: /* @__PURE__ */ a("div", { className: n.categories, children: [
|
|
119
|
+
/* @__PURE__ */ l(h, { size: "xxs", colorToken: "quaternary", children: "Custom Parts" }),
|
|
120
|
+
_.map((e, s) => {
|
|
121
|
+
const L = i.length + r.length + s;
|
|
122
|
+
return /* @__PURE__ */ a(
|
|
123
|
+
m,
|
|
124
|
+
{
|
|
125
|
+
href: e.url,
|
|
126
|
+
id: `${u}-${L}`,
|
|
127
|
+
role: "option",
|
|
128
|
+
"aria-selected": c === L,
|
|
129
|
+
className: o(n.customPartLink, { [n.activeOption]: c === L }),
|
|
130
|
+
onClick: () => t == null ? void 0 : t(),
|
|
131
|
+
children: [
|
|
132
|
+
/* @__PURE__ */ l(y, { iconKey: e.icon, size: "sm" }),
|
|
133
|
+
/* @__PURE__ */ l(h, { size: "sm", children: e.label })
|
|
134
|
+
]
|
|
135
|
+
},
|
|
136
|
+
e.id
|
|
137
|
+
);
|
|
138
|
+
})
|
|
115
139
|
] }) })
|
|
116
140
|
] }),
|
|
117
|
-
|
|
118
|
-
(e,
|
|
119
|
-
|
|
141
|
+
g.length > 0 && /* @__PURE__ */ l("div", { className: n.rightColumn, children: /* @__PURE__ */ l("ol", { className: n.itemList, children: g.map(
|
|
142
|
+
(e, s) => /* @__PURE__ */ l("li", { className: o(n.item, { [n.activeItem]: c === i.length + r.length + _.length + s }), children: /* @__PURE__ */ a(
|
|
143
|
+
m,
|
|
120
144
|
{
|
|
121
145
|
href: e.url,
|
|
122
|
-
id: `${u}-${
|
|
146
|
+
id: `${u}-${i.length + r.length + _.length + s}`,
|
|
123
147
|
role: "option",
|
|
124
|
-
"aria-selected":
|
|
125
|
-
onClick: () =>
|
|
148
|
+
"aria-selected": c === i.length + r.length + _.length + s,
|
|
149
|
+
onClick: () => t == null ? void 0 : t(),
|
|
126
150
|
children: [
|
|
127
|
-
/* @__PURE__ */
|
|
128
|
-
/* @__PURE__ */
|
|
129
|
-
/* @__PURE__ */
|
|
130
|
-
/* @__PURE__ */
|
|
151
|
+
/* @__PURE__ */ l(z, { src: e.image, alt: `${e.description} product image`, height: 72, width: 72 }),
|
|
152
|
+
/* @__PURE__ */ a("div", { className: n.itemInfo, children: [
|
|
153
|
+
/* @__PURE__ */ l(h, { size: "sm", children: e.description }),
|
|
154
|
+
/* @__PURE__ */ l(h, { size: "xs", colorToken: "quaternary", children: e.itemId })
|
|
131
155
|
] })
|
|
132
156
|
]
|
|
133
157
|
}
|
|
@@ -136,5 +160,5 @@ function Z({
|
|
|
136
160
|
] });
|
|
137
161
|
}
|
|
138
162
|
export {
|
|
139
|
-
|
|
163
|
+
I as SuggestionDropdown
|
|
140
164
|
};
|
|
@@ -19,19 +19,23 @@ const a = {
|
|
|
19
19
|
{ categoryKey: 2, name: "Accessories", url: "/categories/accessories" },
|
|
20
20
|
{ categoryKey: 3, name: "Controls", url: "/categories/controls" }
|
|
21
21
|
],
|
|
22
|
+
customParts: [
|
|
23
|
+
{ id: "gasket", label: "Gaskets", url: "/custom/gasket", icon: "fa-kit fa-gaskets" },
|
|
24
|
+
{ id: "heater", label: "Bent Heaters", url: "/custom/heater", icon: "fa-kit fa-coils" }
|
|
25
|
+
],
|
|
22
26
|
items: [
|
|
23
27
|
{
|
|
24
28
|
itemKey: 1,
|
|
25
29
|
itemId: "P-1001",
|
|
26
30
|
description: "Smart Thermostat",
|
|
27
|
-
image: "https://placehold.co/120x80/png?text=
|
|
31
|
+
image: "https://placehold.co/120x80/png?text=T-Stat",
|
|
28
32
|
url: "/parts/p-1001"
|
|
29
33
|
},
|
|
30
34
|
{
|
|
31
35
|
itemKey: 2,
|
|
32
36
|
itemId: "P-1002",
|
|
33
37
|
description: "Wire Harness",
|
|
34
|
-
image: "https://placehold.co/120x80/png?text=
|
|
38
|
+
image: "https://placehold.co/120x80/png?text=Gasket",
|
|
35
39
|
url: "/parts/p-1002"
|
|
36
40
|
},
|
|
37
41
|
{
|
|
@@ -53,13 +57,13 @@ const a = {
|
|
|
53
57
|
...e.args,
|
|
54
58
|
items: []
|
|
55
59
|
}
|
|
56
|
-
},
|
|
60
|
+
}, i = {
|
|
57
61
|
args: {
|
|
58
62
|
...e.args,
|
|
59
63
|
terms: [],
|
|
60
64
|
categories: []
|
|
61
65
|
}
|
|
62
|
-
},
|
|
66
|
+
}, n = {
|
|
63
67
|
args: {
|
|
64
68
|
view: "recent-searches",
|
|
65
69
|
terms: [],
|
|
@@ -75,8 +79,8 @@ const a = {
|
|
|
75
79
|
};
|
|
76
80
|
export {
|
|
77
81
|
e as Default,
|
|
78
|
-
|
|
79
|
-
|
|
82
|
+
i as OnlyItems,
|
|
83
|
+
n as RecentSearches,
|
|
80
84
|
o as WithoutCategories,
|
|
81
85
|
c as WithoutItems,
|
|
82
86
|
a as default
|