@caseparts-org/caseblocks 0.0.243 → 0.0.244
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_11emu_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_11emu_1{flex-direction:column}}._leftColumn_11emu_29{display:flex;flex-direction:column;border-right:1px solid var(--border-border-primary);background-color:#fff;min-width:150px;max-width:220px}@media (max-width: 767px){._leftColumn_11emu_29{border-right:0;border-bottom:1px solid var(--border-border-primary)}}._leftColumnFullWidth_11emu_55{flex:1}._suggestionSectionFullHeight_11emu_63{display:flex;flex:1}._rightColumn_11emu_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_11emu_93{border-top:1px solid var(--border-border-primary)}._suggestions_11emu_99,._categories_11emu_101{display:flex;flex-direction:column;gap:0;padding:0}._suggestionsFullHeight_11emu_115{flex:1}._customPartLink_11emu_123{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_11emu_99>:first-child,._categories_11emu_101>: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_11emu_99>:last-child,._categories_11emu_101>:last-child{margin-bottom:var(--spacing-spacing-2xs)}._suggestionLink_11emu_167,._categoryLink_11emu_169{display:block;box-sizing:border-box;width:100%;padding:var(--spacing-spacing-2xs) var(--spacing-spacing-default);transition:background-color .3s ease-in}._suggestionLink_11emu_167:hover,._categoryLink_11emu_169:hover,._customPartLink_11emu_123:hover{text-decoration:none;background-color:var(--color-alerts-light-teal-blue)}._activeOption_11emu_205{background:var(--color-alerts-light-teal-blue)}._itemList_11emu_213{margin:0;padding:0;display:flex;flex-direction:column;gap:var(--spacing-spacing-2xs);width:100%}._item_11emu_213{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_11emu_213:hover{background-color:var(--color-alerts-light-teal-blue)}._item_11emu_213>a:hover{text-decoration:none}._activeItem_11emu_267{border-color:var(--text-text-links);box-shadow:inset 0 0 0 1px var(--text-text-links)}._item_11emu_213 img{height:60px;width:60px;object-fit:contain}._item_11emu_213 a{display:flex;flex-direction:row;align-items:flex-start;gap:var(--spacing-spacing-2xs)}._itemInfo_11emu_303{display:grid;gap:var(--spacing-spacing-4xs)}._recentSearches_11emu_313{display:flex;flex-direction:column;background:var(--color-brand-primary-white);min-width:250px}._recentSearchesHeader_11emu_327{padding:var(--spacing-spacing-default) var(--spacing-spacing-default) var(--spacing-spacing-2xs)}._recentSearchesList_11emu_335{display:flex;flex-direction:column;gap:0;margin:0;padding:0}._recentSearch_11emu_313{display:flex;align-items:center;justify-content:space-between;gap:var(--spacing-spacing-2xs)}._recentSearchLink_11emu_365{display:flex;flex:1;min-width:0;align-items:center;padding:var(--spacing-spacing-2xs) var(--spacing-spacing-default)}._clearRecentSearch_11emu_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
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 d } from "../../atoms/Link/Link.js";
|
|
4
|
+
import { Icon as y } 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 z } from "../../atoms/Image/Image.js";
|
|
7
|
+
import '../../assets/SuggestionDropdown.css';const F = "_suggestionDropdown_11emu_1", H = "_leftColumn_11emu_29", $ = "_leftColumnFullWidth_11emu_55", D = "_suggestionSectionFullHeight_11emu_63", w = "_rightColumn_11emu_73", b = "_categorySection_11emu_93", T = "_suggestions_11emu_99", k = "_categories_11emu_101", q = "_suggestionsFullHeight_11emu_115", W = "_customPartLink_11emu_123", j = "_suggestionLink_11emu_167", K = "_categoryLink_11emu_169", M = "_activeOption_11emu_205", O = "_itemList_11emu_213", R = "_item_11emu_213", x = "_activeItem_11emu_267", A = "_itemInfo_11emu_303", B = "_recentSearches_11emu_313", E = "_recentSearchesHeader_11emu_327", G = "_recentSearchesList_11emu_335", J = "_recentSearch_11emu_313", Q = "_recentSearchLink_11emu_365", U = "_clearRecentSearch_11emu_381", l = {
|
|
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
24
|
itemInfo: A,
|
|
25
25
|
recentSearches: B,
|
|
26
26
|
recentSearchesHeader: E,
|
|
@@ -32,36 +32,36 @@ import '../../assets/SuggestionDropdown.css';const y = "_suggestionDropdown_17xz
|
|
|
32
32
|
function I({
|
|
33
33
|
terms: i,
|
|
34
34
|
categories: r,
|
|
35
|
-
items:
|
|
36
|
-
customParts:
|
|
37
|
-
view:
|
|
38
|
-
recentSearches:
|
|
39
|
-
onClearRecentSearch:
|
|
35
|
+
items: g,
|
|
36
|
+
customParts: m = [],
|
|
37
|
+
view: v = "suggestions",
|
|
38
|
+
recentSearches: u = [],
|
|
39
|
+
onClearRecentSearch: f,
|
|
40
40
|
onSuggestionClick: n,
|
|
41
41
|
activeOptionIndex: c = -1,
|
|
42
|
-
optionIdPrefix:
|
|
43
|
-
onKeyDown:
|
|
44
|
-
className:
|
|
42
|
+
optionIdPrefix: _,
|
|
43
|
+
onKeyDown: p,
|
|
44
|
+
className: N
|
|
45
45
|
}) {
|
|
46
|
-
return i.length === 0 && r.length === 0 &&
|
|
46
|
+
return i.length === 0 && r.length === 0 && g.length === 0 && m.length === 0 && u.length === 0 ? null : v === "recent-searches" ? /* @__PURE__ */ a(
|
|
47
47
|
"div",
|
|
48
48
|
{
|
|
49
|
-
id:
|
|
49
|
+
id: _,
|
|
50
50
|
role: "listbox",
|
|
51
|
-
className: o(l.suggestionDropdown, l.recentSearches,
|
|
52
|
-
onKeyDown:
|
|
51
|
+
className: o(l.suggestionDropdown, l.recentSearches, N),
|
|
52
|
+
onKeyDown: p,
|
|
53
53
|
onMouseDown: (e) => e.preventDefault(),
|
|
54
54
|
children: [
|
|
55
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:
|
|
56
|
+
/* @__PURE__ */ t("ol", { className: l.recentSearchesList, children: u.map((e) => /* @__PURE__ */ a("li", { className: l.recentSearch, children: [
|
|
57
57
|
/* @__PURE__ */ t(
|
|
58
|
-
|
|
58
|
+
d,
|
|
59
59
|
{
|
|
60
60
|
href: e.url,
|
|
61
|
-
id: `${
|
|
61
|
+
id: `${_}-${u.indexOf(e)}`,
|
|
62
62
|
role: "option",
|
|
63
|
-
"aria-selected": c ===
|
|
64
|
-
className: o(l.recentSearchLink, { [l.activeOption]: c ===
|
|
63
|
+
"aria-selected": c === u.indexOf(e),
|
|
64
|
+
className: o(l.recentSearchLink, { [l.activeOption]: c === u.indexOf(e) }),
|
|
65
65
|
onClick: () => n == null ? void 0 : n(e),
|
|
66
66
|
children: /* @__PURE__ */ t(h, { size: "sm", children: e.term })
|
|
67
67
|
}
|
|
@@ -72,23 +72,23 @@ function I({
|
|
|
72
72
|
type: "button",
|
|
73
73
|
className: l.clearRecentSearch,
|
|
74
74
|
"aria-label": `Clear recent search: ${e.term}`,
|
|
75
|
-
onClick: () =>
|
|
76
|
-
children: /* @__PURE__ */ t(
|
|
75
|
+
onClick: () => f == null ? void 0 : f(e),
|
|
76
|
+
children: /* @__PURE__ */ t(y, { 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 ||
|
|
82
|
+
) : /* @__PURE__ */ a("div", { id: _, role: "listbox", className: o(l.suggestionDropdown, N), onKeyDown: p, onMouseDown: (e) => e.preventDefault(), children: [
|
|
83
|
+
(i.length > 0 || r.length > 0 || m.length > 0) && /* @__PURE__ */ a("div", { className: o(l.leftColumn, { [l.leftColumnFullWidth]: g.length === 0 }), children: [
|
|
84
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
85
|
/* @__PURE__ */ t(h, { size: "xxs", colorToken: "quaternary", children: "Suggestions" }),
|
|
86
86
|
i.map(
|
|
87
87
|
(e, s) => /* @__PURE__ */ t(h, { size: "sm", children: /* @__PURE__ */ t(
|
|
88
|
-
|
|
88
|
+
d,
|
|
89
89
|
{
|
|
90
90
|
href: e.url,
|
|
91
|
-
id: `${
|
|
91
|
+
id: `${_}-${s}`,
|
|
92
92
|
role: "option",
|
|
93
93
|
"aria-selected": c === s,
|
|
94
94
|
className: o(l.suggestionLink, { [l.activeOption]: c === s }),
|
|
@@ -102,10 +102,10 @@ function I({
|
|
|
102
102
|
/* @__PURE__ */ t(h, { size: "xxs", colorToken: "quaternary", children: "Categories" }),
|
|
103
103
|
r.map(
|
|
104
104
|
(e, s) => /* @__PURE__ */ t(h, { size: "sm", children: /* @__PURE__ */ t(
|
|
105
|
-
|
|
105
|
+
d,
|
|
106
106
|
{
|
|
107
107
|
href: e.url,
|
|
108
|
-
id: `${
|
|
108
|
+
id: `${_}-${i.length + s}`,
|
|
109
109
|
role: "option",
|
|
110
110
|
"aria-selected": c === i.length + s,
|
|
111
111
|
className: o(l.categoryLink, { [l.activeOption]: c === i.length + s }),
|
|
@@ -115,21 +115,21 @@ function I({
|
|
|
115
115
|
) }, e.categoryKey)
|
|
116
116
|
)
|
|
117
117
|
] }) }),
|
|
118
|
-
|
|
118
|
+
m.length > 0 && /* @__PURE__ */ t("div", { className: l.categorySection, children: /* @__PURE__ */ a("div", { className: l.categories, children: [
|
|
119
119
|
/* @__PURE__ */ t(h, { size: "xxs", colorToken: "quaternary", children: "Custom Parts" }),
|
|
120
|
-
|
|
121
|
-
const
|
|
120
|
+
m.map((e, s) => {
|
|
121
|
+
const L = i.length + r.length + s;
|
|
122
122
|
return /* @__PURE__ */ a(
|
|
123
|
-
|
|
123
|
+
d,
|
|
124
124
|
{
|
|
125
125
|
href: e.url,
|
|
126
|
-
id: `${
|
|
126
|
+
id: `${_}-${L}`,
|
|
127
127
|
role: "option",
|
|
128
|
-
"aria-selected": c ===
|
|
129
|
-
className: o(l.customPartLink, { [l.activeOption]: c ===
|
|
128
|
+
"aria-selected": c === L,
|
|
129
|
+
className: o(l.customPartLink, { [l.activeOption]: c === L }),
|
|
130
130
|
onClick: () => n == null ? void 0 : n(),
|
|
131
131
|
children: [
|
|
132
|
-
/* @__PURE__ */ t(
|
|
132
|
+
/* @__PURE__ */ t(y, { iconKey: e.icon, size: "sm" }),
|
|
133
133
|
/* @__PURE__ */ t(h, { size: "sm", children: e.label })
|
|
134
134
|
]
|
|
135
135
|
},
|
|
@@ -138,17 +138,17 @@ function I({
|
|
|
138
138
|
})
|
|
139
139
|
] }) })
|
|
140
140
|
] }),
|
|
141
|
-
|
|
142
|
-
(e, s) => /* @__PURE__ */ t("li", { className: o(l.item, { [l.activeItem]: c === i.length + r.length +
|
|
143
|
-
|
|
141
|
+
g.length > 0 && /* @__PURE__ */ t("div", { className: l.rightColumn, children: /* @__PURE__ */ t("ol", { className: l.itemList, children: g.map(
|
|
142
|
+
(e, s) => /* @__PURE__ */ t("li", { className: o(l.item, { [l.activeItem]: c === i.length + r.length + m.length + s }), children: /* @__PURE__ */ a(
|
|
143
|
+
d,
|
|
144
144
|
{
|
|
145
145
|
href: e.url,
|
|
146
|
-
id: `${
|
|
146
|
+
id: `${_}-${i.length + r.length + m.length + s}`,
|
|
147
147
|
role: "option",
|
|
148
|
-
"aria-selected": c === i.length + r.length +
|
|
148
|
+
"aria-selected": c === i.length + r.length + m.length + s,
|
|
149
149
|
onClick: () => n == null ? void 0 : n(),
|
|
150
150
|
children: [
|
|
151
|
-
/* @__PURE__ */ t(
|
|
151
|
+
/* @__PURE__ */ t(z, { src: e.image, alt: `${e.description} product image`, height: 72, width: 72 }),
|
|
152
152
|
/* @__PURE__ */ a("div", { className: l.itemInfo, children: [
|
|
153
153
|
/* @__PURE__ */ t(h, { size: "sm", children: e.description }),
|
|
154
154
|
/* @__PURE__ */ t(h, { size: "xs", colorToken: "quaternary", children: e.itemId })
|