@caseparts-org/caseblocks 0.0.242 → 0.0.243
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
|
-
.
|
|
1
|
+
._suggestionDropdown_17xzw_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_17xzw_1{flex-direction:column}}._leftColumn_17xzw_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_17xzw_31{border-right:0;border-bottom:1px solid var(--border-border-primary)}}._leftColumnFullWidth_17xzw_55{flex:1}._suggestionSectionFullHeight_17xzw_63{display:flex;flex:1}._rightColumn_17xzw_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_17xzw_95{border-top:1px solid var(--border-border-primary)}._suggestions_17xzw_101,._categories_17xzw_103{display:flex;flex-direction:column;gap:0;padding:0}._suggestionsFullHeight_17xzw_117{flex:1}._customPartLink_17xzw_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_17xzw_101>:first-child,._categories_17xzw_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_17xzw_101>:last-child,._categories_17xzw_103>:last-child{margin-bottom:var(--spacing-spacing-2xs)}._suggestionLink_17xzw_169,._categoryLink_17xzw_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_17xzw_169:hover,._categoryLink_17xzw_171:hover,._customPartLink_17xzw_125:hover{text-decoration:none;background-color:var(--color-alerts-light-teal-blue)}._activeOption_17xzw_207{background:var(--color-alerts-light-teal-blue)}._itemList_17xzw_215{margin:0;padding:0;display:flex;flex-direction:column;gap:var(--spacing-spacing-2xs);width:100%}._item_17xzw_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_17xzw_215:hover{background-color:var(--color-alerts-light-teal-blue)}._item_17xzw_215>a:hover{text-decoration:none}._activeItem_17xzw_269{border-color:var(--text-text-links);box-shadow:inset 0 0 0 1px var(--text-text-links)}._item_17xzw_215 img{height:60px;width:60px}._item_17xzw_215 a{display:flex;flex-direction:row;align-items:flex-start;gap:var(--spacing-spacing-2xs)}._itemInfo_17xzw_303{display:grid;gap:var(--spacing-spacing-4xs)}._recentSearches_17xzw_313{display:flex;flex-direction:column;background:var(--color-brand-primary-white);min-width:250px}._recentSearchesHeader_17xzw_327{padding:var(--spacing-spacing-default) var(--spacing-spacing-default) var(--spacing-spacing-2xs)}._recentSearchesList_17xzw_335{display:flex;flex-direction:column;gap:0;margin:0;padding:0}._recentSearch_17xzw_313{display:flex;align-items:center;justify-content:space-between;gap:var(--spacing-spacing-2xs)}._recentSearchLink_17xzw_365{display:flex;flex:1;min-width:0;align-items:center;padding:var(--spacing-spacing-2xs) var(--spacing-spacing-default)}._clearRecentSearch_17xzw_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}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { jsxs as a, jsx as
|
|
1
|
+
import { jsxs as a, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { Text as h } from "../../atoms/Text/Text.js";
|
|
3
|
-
import { Link as
|
|
4
|
-
import { Icon as
|
|
3
|
+
import { Link as g } from "../../atoms/Link/Link.js";
|
|
4
|
+
import { Icon as x } from "../../atoms/Icon/Icon.js";
|
|
5
5
|
import { c as o } from "../../clsx-OuTLNxxd.js";
|
|
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
|
-
customPartLink:
|
|
18
|
-
suggestionLink:
|
|
19
|
-
categoryLink:
|
|
20
|
-
activeOption:
|
|
21
|
-
itemList:
|
|
22
|
-
item:
|
|
23
|
-
activeItem:
|
|
6
|
+
import { Image as N } from "../../atoms/Image/Image.js";
|
|
7
|
+
import '../../assets/SuggestionDropdown.css';const y = "_suggestionDropdown_17xzw_1", v = "_leftColumn_17xzw_31", F = "_leftColumnFullWidth_17xzw_55", H = "_suggestionSectionFullHeight_17xzw_63", $ = "_rightColumn_17xzw_73", D = "_categorySection_17xzw_95", b = "_suggestions_17xzw_101", T = "_categories_17xzw_103", k = "_suggestionsFullHeight_17xzw_117", q = "_customPartLink_17xzw_125", W = "_suggestionLink_17xzw_169", j = "_categoryLink_17xzw_171", K = "_activeOption_17xzw_207", M = "_itemList_17xzw_215", O = "_item_17xzw_215", R = "_activeItem_17xzw_269", A = "_itemInfo_17xzw_303", B = "_recentSearches_17xzw_313", E = "_recentSearchesHeader_17xzw_327", G = "_recentSearchesList_17xzw_335", J = "_recentSearch_17xzw_313", Q = "_recentSearchLink_17xzw_365", U = "_clearRecentSearch_17xzw_381", l = {
|
|
8
|
+
suggestionDropdown: y,
|
|
9
|
+
leftColumn: v,
|
|
10
|
+
leftColumnFullWidth: F,
|
|
11
|
+
suggestionSectionFullHeight: H,
|
|
12
|
+
rightColumn: $,
|
|
13
|
+
categorySection: D,
|
|
14
|
+
suggestions: b,
|
|
15
|
+
categories: T,
|
|
16
|
+
suggestionsFullHeight: k,
|
|
17
|
+
customPartLink: q,
|
|
18
|
+
suggestionLink: W,
|
|
19
|
+
categoryLink: j,
|
|
20
|
+
activeOption: K,
|
|
21
|
+
itemList: M,
|
|
22
|
+
item: O,
|
|
23
|
+
activeItem: R,
|
|
24
24
|
itemInfo: A,
|
|
25
25
|
recentSearches: B,
|
|
26
26
|
recentSearchesHeader: E,
|
|
@@ -32,105 +32,105 @@ import '../../assets/SuggestionDropdown.css';const F = "_suggestionDropdown_1un6
|
|
|
32
32
|
function I({
|
|
33
33
|
terms: i,
|
|
34
34
|
categories: r,
|
|
35
|
-
items:
|
|
35
|
+
items: u,
|
|
36
36
|
customParts: _ = [],
|
|
37
|
-
view:
|
|
38
|
-
recentSearches:
|
|
39
|
-
onClearRecentSearch:
|
|
40
|
-
onSuggestionClick:
|
|
37
|
+
view: p = "suggestions",
|
|
38
|
+
recentSearches: m = [],
|
|
39
|
+
onClearRecentSearch: z,
|
|
40
|
+
onSuggestionClick: n,
|
|
41
41
|
activeOptionIndex: c = -1,
|
|
42
|
-
optionIdPrefix:
|
|
43
|
-
onKeyDown:
|
|
44
|
-
className:
|
|
42
|
+
optionIdPrefix: d,
|
|
43
|
+
onKeyDown: f,
|
|
44
|
+
className: L
|
|
45
45
|
}) {
|
|
46
|
-
return i.length === 0 && r.length === 0 &&
|
|
46
|
+
return i.length === 0 && r.length === 0 && u.length === 0 && _.length === 0 && m.length === 0 ? null : p === "recent-searches" ? /* @__PURE__ */ a(
|
|
47
47
|
"div",
|
|
48
48
|
{
|
|
49
|
-
id:
|
|
49
|
+
id: d,
|
|
50
50
|
role: "listbox",
|
|
51
|
-
className: o(
|
|
52
|
-
onKeyDown:
|
|
51
|
+
className: o(l.suggestionDropdown, l.recentSearches, L),
|
|
52
|
+
onKeyDown: f,
|
|
53
53
|
onMouseDown: (e) => e.preventDefault(),
|
|
54
54
|
children: [
|
|
55
|
-
/* @__PURE__ */
|
|
56
|
-
/* @__PURE__ */
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
-
|
|
55
|
+
/* @__PURE__ */ t("div", { className: l.recentSearchesHeader, children: /* @__PURE__ */ t(h, { size: "xxs", colorToken: "quaternary", children: "Recent Searches" }) }),
|
|
56
|
+
/* @__PURE__ */ t("ol", { className: l.recentSearchesList, children: m.map((e) => /* @__PURE__ */ a("li", { className: l.recentSearch, children: [
|
|
57
|
+
/* @__PURE__ */ t(
|
|
58
|
+
g,
|
|
59
59
|
{
|
|
60
60
|
href: e.url,
|
|
61
|
-
id: `${
|
|
61
|
+
id: `${d}-${m.indexOf(e)}`,
|
|
62
62
|
role: "option",
|
|
63
|
-
"aria-selected": c ===
|
|
64
|
-
className: o(
|
|
65
|
-
onClick: () =>
|
|
66
|
-
children: /* @__PURE__ */
|
|
63
|
+
"aria-selected": c === m.indexOf(e),
|
|
64
|
+
className: o(l.recentSearchLink, { [l.activeOption]: c === m.indexOf(e) }),
|
|
65
|
+
onClick: () => n == null ? void 0 : n(e),
|
|
66
|
+
children: /* @__PURE__ */ t(h, { size: "sm", children: e.term })
|
|
67
67
|
}
|
|
68
68
|
),
|
|
69
|
-
/* @__PURE__ */
|
|
69
|
+
/* @__PURE__ */ t(
|
|
70
70
|
"button",
|
|
71
71
|
{
|
|
72
72
|
type: "button",
|
|
73
|
-
className:
|
|
73
|
+
className: l.clearRecentSearch,
|
|
74
74
|
"aria-label": `Clear recent search: ${e.term}`,
|
|
75
|
-
onClick: () =>
|
|
76
|
-
children: /* @__PURE__ */
|
|
75
|
+
onClick: () => z == null ? void 0 : z(e),
|
|
76
|
+
children: /* @__PURE__ */ t(x, { iconKey: "fa-regular fa-xmark", size: "sm" })
|
|
77
77
|
}
|
|
78
78
|
)
|
|
79
79
|
] }, e.url)) })
|
|
80
80
|
]
|
|
81
81
|
}
|
|
82
|
-
) : /* @__PURE__ */ a("div", { id:
|
|
83
|
-
(i.length > 0 || r.length > 0 || _.length > 0) && /* @__PURE__ */ a("div", { className: o(
|
|
84
|
-
i.length > 0 && /* @__PURE__ */
|
|
85
|
-
/* @__PURE__ */
|
|
82
|
+
) : /* @__PURE__ */ a("div", { id: d, role: "listbox", className: o(l.suggestionDropdown, L), onKeyDown: f, onMouseDown: (e) => e.preventDefault(), children: [
|
|
83
|
+
(i.length > 0 || r.length > 0 || _.length > 0) && /* @__PURE__ */ a("div", { className: o(l.leftColumn, { [l.leftColumnFullWidth]: u.length === 0 }), children: [
|
|
84
|
+
i.length > 0 && /* @__PURE__ */ t("div", { className: o(l.suggestionSection, { [l.suggestionSectionFullHeight]: r.length === 0 }), children: /* @__PURE__ */ a("div", { className: o(l.suggestions, { [l.suggestionsFullHeight]: r.length === 0 }), children: [
|
|
85
|
+
/* @__PURE__ */ t(h, { size: "xxs", colorToken: "quaternary", children: "Suggestions" }),
|
|
86
86
|
i.map(
|
|
87
|
-
(e, s) => /* @__PURE__ */
|
|
88
|
-
|
|
87
|
+
(e, s) => /* @__PURE__ */ t(h, { size: "sm", children: /* @__PURE__ */ t(
|
|
88
|
+
g,
|
|
89
89
|
{
|
|
90
90
|
href: e.url,
|
|
91
|
-
id: `${
|
|
91
|
+
id: `${d}-${s}`,
|
|
92
92
|
role: "option",
|
|
93
93
|
"aria-selected": c === s,
|
|
94
|
-
className: o(
|
|
95
|
-
onClick: () =>
|
|
94
|
+
className: o(l.suggestionLink, { [l.activeOption]: c === s }),
|
|
95
|
+
onClick: () => n == null ? void 0 : n(e),
|
|
96
96
|
children: e.name
|
|
97
97
|
}
|
|
98
98
|
) }, e.url)
|
|
99
99
|
)
|
|
100
100
|
] }) }),
|
|
101
|
-
r.length > 0 && /* @__PURE__ */
|
|
102
|
-
/* @__PURE__ */
|
|
101
|
+
r.length > 0 && /* @__PURE__ */ t("div", { className: l.categorySection, children: /* @__PURE__ */ a("div", { className: l.categories, children: [
|
|
102
|
+
/* @__PURE__ */ t(h, { size: "xxs", colorToken: "quaternary", children: "Categories" }),
|
|
103
103
|
r.map(
|
|
104
|
-
(e, s) => /* @__PURE__ */
|
|
105
|
-
|
|
104
|
+
(e, s) => /* @__PURE__ */ t(h, { size: "sm", children: /* @__PURE__ */ t(
|
|
105
|
+
g,
|
|
106
106
|
{
|
|
107
107
|
href: e.url,
|
|
108
|
-
id: `${
|
|
108
|
+
id: `${d}-${i.length + s}`,
|
|
109
109
|
role: "option",
|
|
110
110
|
"aria-selected": c === i.length + s,
|
|
111
|
-
className: o(
|
|
112
|
-
onClick: () =>
|
|
111
|
+
className: o(l.categoryLink, { [l.activeOption]: c === i.length + s }),
|
|
112
|
+
onClick: () => n == null ? void 0 : n(),
|
|
113
113
|
children: e.name
|
|
114
114
|
}
|
|
115
115
|
) }, e.categoryKey)
|
|
116
116
|
)
|
|
117
117
|
] }) }),
|
|
118
|
-
_.length > 0 && /* @__PURE__ */
|
|
119
|
-
/* @__PURE__ */
|
|
118
|
+
_.length > 0 && /* @__PURE__ */ t("div", { className: l.categorySection, children: /* @__PURE__ */ a("div", { className: l.categories, children: [
|
|
119
|
+
/* @__PURE__ */ t(h, { size: "xxs", colorToken: "quaternary", children: "Custom Parts" }),
|
|
120
120
|
_.map((e, s) => {
|
|
121
|
-
const
|
|
121
|
+
const w = i.length + r.length + s;
|
|
122
122
|
return /* @__PURE__ */ a(
|
|
123
|
-
|
|
123
|
+
g,
|
|
124
124
|
{
|
|
125
125
|
href: e.url,
|
|
126
|
-
id: `${
|
|
126
|
+
id: `${d}-${w}`,
|
|
127
127
|
role: "option",
|
|
128
|
-
"aria-selected": c ===
|
|
129
|
-
className: o(
|
|
130
|
-
onClick: () =>
|
|
128
|
+
"aria-selected": c === w,
|
|
129
|
+
className: o(l.customPartLink, { [l.activeOption]: c === w }),
|
|
130
|
+
onClick: () => n == null ? void 0 : n(),
|
|
131
131
|
children: [
|
|
132
|
-
/* @__PURE__ */
|
|
133
|
-
/* @__PURE__ */
|
|
132
|
+
/* @__PURE__ */ t(x, { iconKey: e.icon, size: "sm" }),
|
|
133
|
+
/* @__PURE__ */ t(h, { size: "sm", children: e.label })
|
|
134
134
|
]
|
|
135
135
|
},
|
|
136
136
|
e.id
|
|
@@ -138,20 +138,20 @@ function I({
|
|
|
138
138
|
})
|
|
139
139
|
] }) })
|
|
140
140
|
] }),
|
|
141
|
-
|
|
142
|
-
(e, s) => /* @__PURE__ */
|
|
143
|
-
|
|
141
|
+
u.length > 0 && /* @__PURE__ */ t("div", { className: l.rightColumn, children: /* @__PURE__ */ t("ol", { className: l.itemList, children: u.map(
|
|
142
|
+
(e, s) => /* @__PURE__ */ t("li", { className: o(l.item, { [l.activeItem]: c === i.length + r.length + _.length + s }), children: /* @__PURE__ */ a(
|
|
143
|
+
g,
|
|
144
144
|
{
|
|
145
145
|
href: e.url,
|
|
146
|
-
id: `${
|
|
146
|
+
id: `${d}-${i.length + r.length + _.length + s}`,
|
|
147
147
|
role: "option",
|
|
148
148
|
"aria-selected": c === i.length + r.length + _.length + s,
|
|
149
|
-
onClick: () =>
|
|
149
|
+
onClick: () => n == null ? void 0 : n(),
|
|
150
150
|
children: [
|
|
151
|
-
/* @__PURE__ */
|
|
152
|
-
/* @__PURE__ */ a("div", { className:
|
|
153
|
-
/* @__PURE__ */
|
|
154
|
-
/* @__PURE__ */
|
|
151
|
+
/* @__PURE__ */ t(N, { src: e.image, alt: `${e.description} product image`, height: 72, width: 72 }),
|
|
152
|
+
/* @__PURE__ */ a("div", { className: l.itemInfo, children: [
|
|
153
|
+
/* @__PURE__ */ t(h, { size: "sm", children: e.description }),
|
|
154
|
+
/* @__PURE__ */ t(h, { size: "xs", colorToken: "quaternary", children: e.itemId })
|
|
155
155
|
] })
|
|
156
156
|
]
|
|
157
157
|
}
|