@caseparts-org/caseblocks 0.0.226 → 0.0.227

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,19 +1,19 @@
1
- import { jsxs as b, Fragment as g, jsx as t } from "react/jsx-runtime";
2
- import { useState as y } from "react";
3
- import { MainNav as m } from "./MainNav.js";
4
- import { Text as s } from "../../atoms/Text/Text.js";
5
- import { Link as u } from "../../atoms/Link/Link.js";
6
- import { Button as p } from "../../atoms/Button/Button.js";
7
- import { CartSlideInPanel as h } from "../../molecules/Cart/CartSlideInPanel.js";
8
- const q = {
1
+ import { jsxs as y, Fragment as k, jsx as t } from "react/jsx-runtime";
2
+ import { useState as g } from "react";
3
+ import { MainNav as b } from "./MainNav.js";
4
+ import { Text as p } from "../../atoms/Text/Text.js";
5
+ import { Link as h } from "../../atoms/Link/Link.js";
6
+ import { Button as S } from "../../atoms/Button/Button.js";
7
+ import { CartSlideInPanel as v } from "../../molecules/Cart/CartSlideInPanel.js";
8
+ const x = {
9
9
  title: "Case Parts/Organisms/MainNav",
10
- component: m,
10
+ component: b,
11
11
  parameters: {
12
12
  // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
13
13
  layout: "fullscreen"
14
14
  }
15
15
  // tags: ["autodocs"],
16
- }, l = [
16
+ }, c = [
17
17
  {
18
18
  id: 0,
19
19
  label: "Shop by Brands",
@@ -106,7 +106,31 @@ const q = {
106
106
  route: "#",
107
107
  children: []
108
108
  }
109
- ], a = "https://m.media-amazon.com/images/I/216+JEttsYL._UF1000,1000_QL80_.jpg", r = {
109
+ ], a = "https://m.media-amazon.com/images/I/216+JEttsYL._UF1000,1000_QL80_.jpg", I = {
110
+ terms: [
111
+ { name: "gasket", url: "/search/gasket" },
112
+ { name: "gasket strip", url: "/search/gasket-strip" },
113
+ { name: "gasket material", url: "/search/gasket-material" }
114
+ ],
115
+ categories: [
116
+ { name: "Magnetic Door Gaskets and Sweeper Gasket", url: "/category/47432" },
117
+ { name: "01 Gaskets", url: "/category/46795" },
118
+ { name: "Door Gaskets", url: "/category/47022" },
119
+ { name: "Magnetic Gaskets", url: "/category/46971" },
120
+ { name: "Magnetic Gaskets", url: "/category/47501" }
121
+ ],
122
+ items: [
123
+ { itemKey: 13503, itemId: "GASKET-RING", description: "Gasket Sample Ring", image: a, url: "/part/GASKET-RING" },
124
+ { itemKey: 13968, itemId: "810719", description: "26-5/8 x 54-1/4 Door Gasket For True", image: a, url: "/part/810719" },
125
+ { itemKey: 14853, itemId: "932588", description: "23-3/8 x 26-3/4 Door Gasket For True", image: a, url: "/part/932588" },
126
+ { itemKey: 435, itemId: "810803", description: "25-5/8 x 54-1/8 Door Gasket For True", image: a, url: "/part/810803" },
127
+ { itemKey: 14622, itemId: "932587", description: "26-3/4 x 26-3/4 Door Gasket For True", image: a, url: "/part/932587" }
128
+ ]
129
+ }, R = [
130
+ { term: "door gasket", url: "/search/door-gasket" },
131
+ { term: "walk-in cooler", url: "/search/walk-in-cooler" },
132
+ { term: "thermostat", url: "/search/thermostat" }
133
+ ], s = {
110
134
  items: [
111
135
  { id: 1, itemId: "1094-01", description: "Kason Door Closer - Flush", price: "$99.99", quantity: 1, imageUrl: a, availability: "In Stock", availabilityId: "available" },
112
136
  { id: 2, itemId: "810810", description: "True Door Gasket", price: "$99.99", quantity: 1, imageUrl: a, availability: "In Stock", availabilityId: "available" },
@@ -122,36 +146,36 @@ const q = {
122
146
  { id: 12, itemId: "1092-02", description: "Kason Door Closer - Offset", price: "$99.99", quantity: 1, imageUrl: a, availability: "In Stock", availabilityId: "available" }
123
147
  ]
124
148
  };
125
- function C(e) {
149
+ function f(e) {
126
150
  return `$${e.items.reduce(
127
- (i, o) => i + (parseFloat(o.price.replace(/[^0-9.]/g, "")) || 0) * o.quantity,
151
+ (o, r) => o + (parseFloat(r.price.replace(/[^0-9.]/g, "")) || 0) * r.quantity,
128
152
  0
129
153
  ).toFixed(2)}`;
130
154
  }
131
- const d = /* @__PURE__ */ b("div", { style: { display: "flex", flexDirection: "column", gap: 8, minWidth: 220 }, children: [
132
- /* @__PURE__ */ t(s, { size: "sm", weight: "semibold", children: "Account" }),
133
- /* @__PURE__ */ t(s, { size: "xs", children: "Signed in as Ringo" }),
134
- /* @__PURE__ */ t(u, { href: "/account", "data-popover-close": "true", children: "View Account" }),
135
- /* @__PURE__ */ t(u, { href: "/orders", "data-popover-close": "true", children: "Order History" }),
136
- /* @__PURE__ */ t(p, { size: "sm", variant: "secondary", "data-popover-close": "true", onClick: () => alert("Sign out"), children: "Sign Out" })
137
- ] }), n = (e) => {
138
- const [c, i] = y(!1);
139
- return /* @__PURE__ */ b(g, { children: [
155
+ const u = /* @__PURE__ */ y("div", { style: { display: "flex", flexDirection: "column", gap: 8, minWidth: 220 }, children: [
156
+ /* @__PURE__ */ t(p, { size: "sm", weight: "semibold", children: "Account" }),
157
+ /* @__PURE__ */ t(p, { size: "xs", children: "Signed in as Ringo" }),
158
+ /* @__PURE__ */ t(h, { href: "/account", "data-popover-close": "true", children: "View Account" }),
159
+ /* @__PURE__ */ t(h, { href: "/orders", "data-popover-close": "true", children: "Order History" }),
160
+ /* @__PURE__ */ t(S, { size: "sm", variant: "secondary", "data-popover-close": "true", onClick: () => alert("Sign out"), children: "Sign Out" })
161
+ ] }), m = (e) => {
162
+ const [i, o] = g(!1);
163
+ return /* @__PURE__ */ y(k, { children: [
140
164
  /* @__PURE__ */ t(
141
- m,
165
+ b,
142
166
  {
143
167
  ...e,
144
- open: c,
145
- onCartClick: () => i((o) => !o)
168
+ open: i,
169
+ onCartClick: () => o((r) => !r)
146
170
  }
147
171
  ),
148
172
  /* @__PURE__ */ t(
149
- h,
173
+ v,
150
174
  {
151
- open: c,
152
- onClose: () => i(!1),
175
+ open: i,
176
+ onClose: () => o(!1),
153
177
  cart: e.cart,
154
- subtotal: C(e.cart),
178
+ subtotal: f(e.cart),
155
179
  itemPriceLabel: "List Price",
156
180
  onItemQtyChange: () => alert("Qty Change"),
157
181
  onItemDelete: () => alert("Delete"),
@@ -159,10 +183,34 @@ const d = /* @__PURE__ */ b("div", { style: { display: "flex", flexDirection: "c
159
183
  }
160
184
  )
161
185
  ] });
162
- }, U = {
186
+ }, G = (e) => {
187
+ const [i, o] = g(""), [r, C] = g(R);
188
+ return /* @__PURE__ */ t(
189
+ b,
190
+ {
191
+ ...e,
192
+ searchValue: i,
193
+ onClearSearch: () => o(""),
194
+ onSearch: (l) => alert(`Search for ${l}`),
195
+ searchSuggestions: i ? I : void 0,
196
+ recentSearches: r,
197
+ onClearRecentSearch: (l) => {
198
+ C((n) => n.filter((d) => d.url !== l.url));
199
+ },
200
+ searchInputProps: {
201
+ ...e.searchInputProps,
202
+ value: i,
203
+ onChange: (l) => {
204
+ var n, d;
205
+ (d = (n = e.searchInputProps) == null ? void 0 : n.onChange) == null || d.call(n, l), o(l.target.value);
206
+ }
207
+ }
208
+ }
209
+ );
210
+ }, A = {
163
211
  args: {
164
212
  account: { name: "Ringo", initials: "RS", number: "123456789012" },
165
- cart: r,
213
+ cart: s,
166
214
  homeRoute: "/",
167
215
  customPartsRoute: "/custom",
168
216
  onClickModelSerial: () => {
@@ -174,23 +222,20 @@ const d = /* @__PURE__ */ b("div", { style: { display: "flex", flexDirection: "c
174
222
  onLoginClick: () => {
175
223
  alert("Login");
176
224
  },
177
- onSearch: (e) => {
178
- alert(`Search ${e}`);
179
- },
180
225
  onCategoryClick: (e) => {
181
226
  alert(`Category ${e.label}`);
182
227
  },
183
228
  onCartClick: () => {
184
229
  },
185
230
  // placeholder required by component
186
- categories: l,
187
- accountPopoverContent: d
231
+ categories: c,
232
+ accountPopoverContent: u
188
233
  },
189
- render: n
190
- }, D = {
234
+ render: m
235
+ }, F = {
191
236
  args: {
192
237
  account: { name: "Ringo", initials: "RS", number: "123456789012" },
193
- cart: r,
238
+ cart: s,
194
239
  homeRoute: "/",
195
240
  customPartsRoute: "/custom",
196
241
  onClickModelSerial: () => {
@@ -202,21 +247,19 @@ const d = /* @__PURE__ */ b("div", { style: { display: "flex", flexDirection: "c
202
247
  onLoginClick: () => {
203
248
  alert("Login");
204
249
  },
205
- onSearch: (e) => {
206
- alert(`Search ${e}`);
207
- },
208
250
  onCategoryClick: (e) => {
209
251
  alert(`Category ${e.label}`);
210
252
  },
211
253
  onCartClick: () => {
212
254
  },
213
- categories: l,
214
- accountPopoverContent: d
255
+ categories: c,
256
+ accountPopoverContent: u
215
257
  },
216
- render: n
217
- }, L = {
258
+ render: m
259
+ }, w = {
218
260
  args: {
219
- cart: r,
261
+ account: { name: "Ringo", initials: "RS", number: "123456789012" },
262
+ cart: s,
220
263
  homeRoute: "/",
221
264
  customPartsRoute: "/custom",
222
265
  onClickModelSerial: () => {
@@ -228,21 +271,41 @@ const d = /* @__PURE__ */ b("div", { style: { display: "flex", flexDirection: "c
228
271
  onLoginClick: () => {
229
272
  alert("Login");
230
273
  },
231
- onSearch: (e) => {
232
- alert(`Search ${e}`);
274
+ onCategoryClick: (e) => {
275
+ alert(`Category ${e.label}`);
276
+ },
277
+ onCartClick: () => {
278
+ },
279
+ categories: c,
280
+ accountPopoverContent: u
281
+ },
282
+ render: G
283
+ }, K = {
284
+ args: {
285
+ cart: s,
286
+ homeRoute: "/",
287
+ customPartsRoute: "/custom",
288
+ onClickModelSerial: () => {
289
+ alert("Model/Serial");
290
+ },
291
+ faqRoute: "/faq",
292
+ aboutUsRoute: "/about",
293
+ contactRoute: "/contact",
294
+ onLoginClick: () => {
295
+ alert("Login");
233
296
  },
234
297
  onCategoryClick: (e) => {
235
298
  alert(`Category ${e.label}`);
236
299
  },
237
300
  onCartClick: () => {
238
301
  },
239
- categories: l
302
+ categories: c
240
303
  },
241
- render: n
242
- }, M = {
304
+ render: m
305
+ }, T = {
243
306
  args: {
244
307
  account: { name: "Ringo", initials: "RS", number: "123456789012" },
245
- cart: r,
308
+ cart: s,
246
309
  homeRoute: "/",
247
310
  customPartsRoute: "/custom",
248
311
  onClickModelSerial: () => {
@@ -254,25 +317,23 @@ const d = /* @__PURE__ */ b("div", { style: { display: "flex", flexDirection: "c
254
317
  onLoginClick: () => {
255
318
  alert("Login");
256
319
  },
257
- onSearch: (e) => {
258
- alert(`Search ${e}`);
259
- },
260
320
  onCategoryClick: (e) => {
261
321
  alert(`Category ${e.label}`);
262
322
  },
263
323
  onCartClick: () => {
264
324
  },
265
- categories: l,
266
- accountPopoverContent: d,
325
+ categories: c,
326
+ accountPopoverContent: u,
267
327
  isAccountLoading: !0,
268
328
  isCategoriesLoading: !0
269
329
  },
270
- render: n
330
+ render: m
271
331
  };
272
332
  export {
273
- U as Authenticated,
274
- M as Loading,
275
- L as Unauthenticated,
276
- D as WithCartItems,
277
- q as default
333
+ A as Authenticated,
334
+ T as Loading,
335
+ K as Unauthenticated,
336
+ F as WithCartItems,
337
+ w as WithSearchSuggestions,
338
+ x as default
278
339
  };
@@ -2,6 +2,10 @@ export type SuggestedCategory = {
2
2
  name: string;
3
3
  url: string;
4
4
  };
5
+ export type SuggestedTerm = {
6
+ name: string;
7
+ url: string;
8
+ };
5
9
  export type SuggestedItem = {
6
10
  itemKey: number;
7
11
  itemId: string;
@@ -9,10 +13,17 @@ export type SuggestedItem = {
9
13
  image: string;
10
14
  url: string;
11
15
  };
16
+ export type RecentSearch = {
17
+ term: string;
18
+ url: string;
19
+ };
12
20
  export interface SuggestionDropdownProps {
13
- terms: string[];
21
+ view?: "suggestions" | "recent-searches";
22
+ terms: SuggestedTerm[];
14
23
  categories: SuggestedCategory[];
15
24
  items: SuggestedItem[];
25
+ recentSearches?: RecentSearch[];
26
+ onClearRecentSearch?: (_recentSearch: RecentSearch) => void;
16
27
  className?: string;
17
28
  }
18
- export declare function SuggestionDropdown({ terms: suggestions, categories, items: recommendedItems, className }: SuggestionDropdownProps): import("react/jsx-runtime").JSX.Element;
29
+ export declare function SuggestionDropdown({ terms, categories, items, view, recentSearches, onClearRecentSearch, className }: SuggestionDropdownProps): import("react/jsx-runtime").JSX.Element;
@@ -1,51 +1,85 @@
1
- import { jsxs as o, jsx as s } from "react/jsx-runtime";
2
- import { Text as t } from "../../atoms/Text/Text.js";
3
- import { Link as n } from "../../atoms/Link/Link.js";
4
- import { c as m } from "../../clsx-OuTLNxxd.js";
5
- import { Image as g } from "../../atoms/Image/Image.js";
6
- import '../../assets/SuggestionDropdown.css';const d = "_suggestionDropdown_1y1jy_1", h = "_leftColumn_1y1jy_31", u = "_rightColumn_1y1jy_55", _ = "_categorySection_1y1jy_75", y = "_suggestions_1y1jy_81", p = "_categories_1y1jy_83", f = "_itemList_1y1jy_97", j = "_item_1y1jy_97", N = "_itemInfo_1y1jy_155", e = {
7
- suggestionDropdown: d,
8
- leftColumn: h,
9
- rightColumn: u,
10
- categorySection: _,
11
- suggestions: y,
12
- categories: p,
13
- itemList: f,
14
- item: j,
15
- itemInfo: N
1
+ import { jsxs as n, jsx as s } from "react/jsx-runtime";
2
+ import { Text as i } from "../../atoms/Text/Text.js";
3
+ import { Link as c } from "../../atoms/Link/Link.js";
4
+ import { Icon as g } from "../../atoms/Icon/Icon.js";
5
+ import { c as a } from "../../clsx-OuTLNxxd.js";
6
+ import { Image as u } from "../../atoms/Image/Image.js";
7
+ import '../../assets/SuggestionDropdown.css';const k = "_suggestionDropdown_zk1ld_1", z = "_leftColumn_zk1ld_31", f = "_rightColumn_zk1ld_55", S = "_categorySection_zk1ld_75", p = "_suggestions_zk1ld_81", L = "_categories_zk1ld_83", N = "_suggestionLink_zk1ld_119", y = "_categoryLink_zk1ld_121", v = "_itemList_zk1ld_135", x = "_item_zk1ld_135", D = "_itemInfo_zk1ld_193", w = "_recentSearches_zk1ld_203", C = "_recentSearchesHeader_zk1ld_217", T = "_recentSearchesList_zk1ld_225", q = "_recentSearch_zk1ld_203", H = "_recentSearchLink_zk1ld_255", b = "_clearRecentSearch_zk1ld_271", r = {
8
+ suggestionDropdown: k,
9
+ leftColumn: z,
10
+ rightColumn: f,
11
+ categorySection: S,
12
+ suggestions: p,
13
+ categories: L,
14
+ suggestionLink: N,
15
+ categoryLink: y,
16
+ itemList: v,
17
+ item: x,
18
+ itemInfo: D,
19
+ recentSearches: w,
20
+ recentSearchesHeader: C,
21
+ recentSearchesList: T,
22
+ recentSearch: q,
23
+ recentSearchLink: H,
24
+ clearRecentSearch: b
16
25
  };
17
- function z({
18
- terms: r,
19
- categories: c,
20
- items: l,
21
- className: a
26
+ function A({
27
+ terms: l,
28
+ categories: d,
29
+ items: h,
30
+ view: m = "suggestions",
31
+ recentSearches: _ = [],
32
+ onClearRecentSearch: t,
33
+ className: o
22
34
  }) {
23
- return /* @__PURE__ */ o("div", { className: m(e.suggestionDropdown, a), children: [
24
- /* @__PURE__ */ o("div", { className: e.leftColumn, children: [
25
- /* @__PURE__ */ s("div", { className: e.suggestionSection, children: /* @__PURE__ */ o("div", { className: e.suggestions, children: [
26
- /* @__PURE__ */ s(t, { size: "xxs", colorToken: "quaternary", children: "Suggestions" }),
27
- r.map(
28
- (i) => /* @__PURE__ */ s(t, { size: "sm", children: i }, i)
35
+ return m === "recent-searches" ? /* @__PURE__ */ n(
36
+ "div",
37
+ {
38
+ className: a(r.suggestionDropdown, r.recentSearches, o),
39
+ onMouseDown: (e) => e.preventDefault(),
40
+ children: [
41
+ /* @__PURE__ */ s("div", { className: r.recentSearchesHeader, children: /* @__PURE__ */ s(i, { size: "xxs", colorToken: "quaternary", children: "Recent Searches" }) }),
42
+ /* @__PURE__ */ s("ol", { className: r.recentSearchesList, children: _.map((e) => /* @__PURE__ */ n("li", { className: r.recentSearch, children: [
43
+ /* @__PURE__ */ s(c, { href: e.url, className: r.recentSearchLink, children: /* @__PURE__ */ s(i, { size: "sm", children: e.term }) }),
44
+ /* @__PURE__ */ s(
45
+ "button",
46
+ {
47
+ type: "button",
48
+ className: r.clearRecentSearch,
49
+ "aria-label": `Clear recent search: ${e.term}`,
50
+ onClick: () => t == null ? void 0 : t(e),
51
+ children: /* @__PURE__ */ s(g, { iconKey: "fa-regular fa-xmark", size: "sm" })
52
+ }
53
+ )
54
+ ] }, e.url)) })
55
+ ]
56
+ }
57
+ ) : /* @__PURE__ */ n("div", { className: a(r.suggestionDropdown, o), onMouseDown: (e) => e.preventDefault(), children: [
58
+ /* @__PURE__ */ n("div", { className: r.leftColumn, children: [
59
+ /* @__PURE__ */ s("div", { className: r.suggestionSection, children: /* @__PURE__ */ n("div", { className: r.suggestions, children: [
60
+ /* @__PURE__ */ s(i, { size: "xxs", colorToken: "quaternary", children: "Suggestions" }),
61
+ l.map(
62
+ (e) => /* @__PURE__ */ s(i, { size: "sm", children: /* @__PURE__ */ s(c, { href: e.url, className: r.suggestionLink, children: e.name }) }, e.url)
29
63
  )
30
64
  ] }) }),
31
- /* @__PURE__ */ s("div", { className: e.categorySection, children: /* @__PURE__ */ o("div", { className: e.categories, children: [
32
- /* @__PURE__ */ s(t, { size: "xxs", colorToken: "quaternary", children: "Categories" }),
33
- c.map(
34
- (i) => /* @__PURE__ */ s(t, { size: "sm", children: /* @__PURE__ */ s(n, { href: i.url, children: i.name }, i.url) }, i.name)
65
+ /* @__PURE__ */ s("div", { className: r.categorySection, children: /* @__PURE__ */ n("div", { className: r.categories, children: [
66
+ /* @__PURE__ */ s(i, { size: "xxs", colorToken: "quaternary", children: "Categories" }),
67
+ d.map(
68
+ (e) => /* @__PURE__ */ s(i, { size: "sm", children: /* @__PURE__ */ s(c, { href: e.url, className: r.categoryLink, children: e.name }) }, e.name)
35
69
  )
36
70
  ] }) })
37
71
  ] }),
38
- /* @__PURE__ */ s("div", { className: e.rightColumn, children: /* @__PURE__ */ s("ol", { className: e.itemList, children: l.map(
39
- (i) => /* @__PURE__ */ s("li", { className: e.item, children: /* @__PURE__ */ o(n, { href: i.url, children: [
40
- /* @__PURE__ */ s(g, { src: i.image, alt: `${i.description} product image`, height: 72, width: 72 }),
41
- /* @__PURE__ */ o("div", { className: e.itemInfo, children: [
42
- /* @__PURE__ */ s(t, { size: "sm", children: i.description }),
43
- /* @__PURE__ */ s(t, { size: "sm", colorToken: "quaternary", children: i.itemId })
72
+ /* @__PURE__ */ s("div", { className: r.rightColumn, children: /* @__PURE__ */ s("ol", { className: r.itemList, children: h.map(
73
+ (e) => /* @__PURE__ */ s("li", { className: r.item, children: /* @__PURE__ */ n(c, { href: e.url, children: [
74
+ /* @__PURE__ */ s(u, { src: e.image, alt: `${e.description} product image`, height: 72, width: 72 }),
75
+ /* @__PURE__ */ n("div", { className: r.itemInfo, children: [
76
+ /* @__PURE__ */ s(i, { size: "sm", children: e.description }),
77
+ /* @__PURE__ */ s(i, { size: "sm", colorToken: "quaternary", children: e.itemId })
44
78
  ] })
45
- ] }) }, i.itemId)
79
+ ] }) }, e.itemId)
46
80
  ) }) })
47
81
  ] });
48
82
  }
49
83
  export {
50
- z as SuggestionDropdown
84
+ A as SuggestionDropdown
51
85
  };
@@ -11,3 +11,4 @@ declare const meta: {
11
11
  export default meta;
12
12
  type Story = StoryObj<typeof meta>;
13
13
  export declare const Default: Story;
14
+ export declare const RecentSearches: Story;
@@ -1,14 +1,19 @@
1
- import { SuggestionDropdown as e } from "./SuggestionDropdown.js";
1
+ import { SuggestionDropdown as t } from "./SuggestionDropdown.js";
2
2
  const s = {
3
3
  title: "Case Parts/Organisms/SuggestionDropdown",
4
- component: e,
4
+ component: t,
5
5
  parameters: {
6
6
  layout: "centered"
7
7
  },
8
8
  tags: ["autodocs"]
9
- }, r = {
9
+ }, a = {
10
10
  args: {
11
- terms: ["thermostat", "sensor", "cover", "wiring"],
11
+ terms: [
12
+ { name: "thermostat", url: "/search/thermostat" },
13
+ { name: "sensor", url: "/search/sensor" },
14
+ { name: "cover", url: "/search/cover" },
15
+ { name: "wiring", url: "/search/wiring" }
16
+ ],
12
17
  categories: [
13
18
  { name: "Heating", url: "/categories/heating" },
14
19
  { name: "Accessories", url: "/categories/accessories" },
@@ -38,8 +43,22 @@ const s = {
38
43
  }
39
44
  ]
40
45
  }
46
+ }, o = {
47
+ args: {
48
+ view: "recent-searches",
49
+ terms: [],
50
+ categories: [],
51
+ items: [],
52
+ recentSearches: [
53
+ { term: "door gasket", url: "/search/door-gasket" },
54
+ { term: "walk-in cooler", url: "/search/walk-in-cooler" },
55
+ { term: "thermostat", url: "/search/thermostat" }
56
+ ],
57
+ onClearRecentSearch: (e) => alert(`Clear ${e.term}`)
58
+ }
41
59
  };
42
60
  export {
43
- r as Default,
61
+ a as Default,
62
+ o as RecentSearches,
44
63
  s as default
45
64
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@caseparts-org/caseblocks",
3
3
  "private": false,
4
- "version": "0.0.226",
4
+ "version": "0.0.227",
5
5
  "type": "module",
6
6
  "module": "dist/main.js",
7
7
  "types": "dist/main.d.ts",
@@ -1 +0,0 @@
1
- ._inputContainer_ptqd0_1{position:relative;width:100%}._button_ptqd0_10{background-color:transparent;border:none;padding:0;margin:0;position:absolute;right:8px;top:4px}
@@ -1,7 +0,0 @@
1
- import { HideAtProps } from '../../atoms/HideAt';
2
- /** A search box. */
3
- export interface SearchBoxProps extends React.HTMLAttributes<HTMLDivElement>, HideAtProps {
4
- onSearch: (_input: string) => void;
5
- inputName?: string;
6
- }
7
- export declare function SearchBox({ onSearch, inputName, hideAt, className, ...otherProps }: SearchBoxProps): import("react/jsx-runtime").JSX.Element;
@@ -1,36 +0,0 @@
1
- import { jsxs as r, jsx as t } from "react/jsx-runtime";
2
- import { Icon as i } from "../../atoms/Icon/Icon.js";
3
- import { Input as s } from "../../atoms/Input/Input.js";
4
- import { c as p } from "../../clsx-OuTLNxxd.js";
5
- import '../../assets/SearchBox.css';const c = "_inputContainer_ptqd0_1", u = "_input_ptqd0_1", m = "_button_ptqd0_10", n = {
6
- inputContainer: c,
7
- input: u,
8
- button: m
9
- };
10
- function y({
11
- onSearch: l,
12
- inputName: o,
13
- hideAt: f,
14
- className: e,
15
- ...a
16
- }) {
17
- return /* @__PURE__ */ r("div", { className: n.inputContainer, children: [
18
- /* @__PURE__ */ t(
19
- s,
20
- {
21
- type: "text",
22
- className: p(n.input, e),
23
- autoComplete: "off",
24
- label: "Search",
25
- placeholder: "Search by keyword(s) or Part #....",
26
- name: o ?? "search",
27
- "aria-autocomplete": "list",
28
- ...a
29
- }
30
- ),
31
- /* @__PURE__ */ t("button", { className: n.button, type: "submit", children: /* @__PURE__ */ t(i, { iconKey: "fa-regular fa-magnifying-glass", size: "sm" }) })
32
- ] });
33
- }
34
- export {
35
- y as SearchBox
36
- };
@@ -1,12 +0,0 @@
1
- import { StoryObj } from '@storybook/react-vite';
2
- import { SearchBox } from './SearchBox';
3
- declare const meta: {
4
- title: string;
5
- component: typeof SearchBox;
6
- parameters: {
7
- layout: string;
8
- };
9
- };
10
- export default meta;
11
- type Story = StoryObj<typeof meta>;
12
- export declare const Default: Story;
@@ -1,15 +0,0 @@
1
- import { SearchBox as a } from "./SearchBox.js";
2
- const r = {
3
- title: "Case Parts/Molecules/SearchBox",
4
- component: a,
5
- parameters: {
6
- // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
7
- layout: "centered"
8
- }
9
- }, o = {
10
- args: { onSearch: (e) => alert(`Search ${e}`) }
11
- };
12
- export {
13
- o as Default,
14
- r as default
15
- };