@caseparts-org/caseblocks 0.0.226 → 0.0.228

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.
Files changed (33) hide show
  1. package/dist/assets/InputEndAdornmentButton.css +1 -0
  2. package/dist/assets/MainNav.css +1 -1
  3. package/dist/assets/StatusPage.css +1 -0
  4. package/dist/assets/SuggestionDropdown.css +1 -1
  5. package/dist/atoms/Input/Input.js +10 -1
  6. package/dist/atoms/InputEndAdornmentButton/InputEndAdornmentButton.d.ts +6 -0
  7. package/dist/atoms/InputEndAdornmentButton/InputEndAdornmentButton.js +17 -0
  8. package/dist/main-client.d.ts +2 -0
  9. package/dist/main-client.js +80 -78
  10. package/dist/main-server.d.ts +2 -2
  11. package/dist/main-server.js +39 -39
  12. package/dist/main.d.ts +2 -2
  13. package/dist/main.js +28 -28
  14. package/dist/not-found-DhBNR9yc.js +4 -0
  15. package/dist/organisms/MainNav/MainNav.d.ts +12 -1
  16. package/dist/organisms/MainNav/MainNav.js +218 -109
  17. package/dist/organisms/MainNav/MainNav.stories.d.ts +1 -0
  18. package/dist/organisms/MainNav/MainNav.stories.js +125 -64
  19. package/dist/organisms/NotFound/NotFound.js +26 -25
  20. package/dist/organisms/StatusPage/StatusPage.d.ts +28 -0
  21. package/dist/organisms/StatusPage/StatusPage.js +106 -0
  22. package/dist/organisms/StatusPage/StatusPage.stories.d.ts +7 -0
  23. package/dist/organisms/StatusPage/StatusPage.stories.js +81 -0
  24. package/dist/organisms/SuggestionDropdown/SuggestionDropdown.d.ts +13 -2
  25. package/dist/organisms/SuggestionDropdown/SuggestionDropdown.js +72 -38
  26. package/dist/organisms/SuggestionDropdown/SuggestionDropdown.stories.d.ts +1 -0
  27. package/dist/organisms/SuggestionDropdown/SuggestionDropdown.stories.js +24 -5
  28. package/package.json +1 -1
  29. package/dist/assets/SearchBox.css +0 -1
  30. package/dist/molecules/SearchBox/SearchBox.d.ts +0 -7
  31. package/dist/molecules/SearchBox/SearchBox.js +0 -36
  32. package/dist/molecules/SearchBox/SearchBox.stories.d.ts +0 -12
  33. package/dist/molecules/SearchBox/SearchBox.stories.js +0 -15
@@ -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.228",
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
- };