@caseparts-org/caseblocks 0.0.232 → 0.0.233

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
- ._suggestionDropdown_zk1ld_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_zk1ld_1{flex-direction:column}}._leftColumn_zk1ld_31{display:flex;flex-direction:column;border-right:1px solid var(--border-border-primary);background:var(--color-brand-primary-primary-pale-gray);min-width:150px}@media (max-width: 767px){._leftColumn_zk1ld_31{border-right:0;border-bottom:1px solid var(--border-border-primary)}}._rightColumn_zk1ld_55{display:flex;flex-direction:column;gap:var(--spacing-spacing-1xs);padding:var(--spacing-spacing-default);background:var(--color-brand-primary-white);min-width:250px}._categorySection_zk1ld_75{border-top:1px solid var(--border-border-primary)}._suggestions_zk1ld_81,._categories_zk1ld_83{display:flex;flex-direction:column;gap:0;padding:0}._suggestions_zk1ld_81>:first-child,._categories_zk1ld_83>: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_zk1ld_81>:last-child{padding-bottom:var(--spacing-spacing-2xs)}._suggestionLink_zk1ld_119,._categoryLink_zk1ld_121{display:block;box-sizing:border-box;width:100%;padding:var(--spacing-spacing-2xs) var(--spacing-spacing-default)}._itemList_zk1ld_135{margin:0;padding:0;display:flex;flex-direction:column;gap:var(--spacing-spacing-2xs);width:100%}._item_zk1ld_135{display:flex;flex-direction:column;border:1px solid var(--border-border-primary);padding:var(--spacing-spacing-2xs);width:100%}._item_zk1ld_135 img{height:60px;width:60px}._item_zk1ld_135 a{display:flex;flex-direction:row;align-items:flex-start;gap:var(--spacing-spacing-2xs)}._itemInfo_zk1ld_193{display:grid;gap:var(--spacing-spacing-4xs)}._recentSearches_zk1ld_203{display:flex;flex-direction:column;background:var(--color-brand-primary-white);min-width:250px}._recentSearchesHeader_zk1ld_217{padding:var(--spacing-spacing-default) var(--spacing-spacing-default) var(--spacing-spacing-2xs)}._recentSearchesList_zk1ld_225{display:flex;flex-direction:column;gap:0;margin:0;padding:0}._recentSearch_zk1ld_203{display:flex;align-items:center;justify-content:space-between;gap:var(--spacing-spacing-2xs)}._recentSearchLink_zk1ld_255{display:flex;flex:1;min-width:0;align-items:center;padding:var(--spacing-spacing-2xs) var(--spacing-spacing-default)}._clearRecentSearch_zk1ld_271{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
+ ._suggestionDropdown_1fc5y_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_1fc5y_1{flex-direction:column}}._leftColumn_1fc5y_31{display:flex;flex-direction:column;border-right:1px solid var(--border-border-primary);background:var(--color-brand-primary-primary-pale-gray);min-width:150px}@media (max-width: 767px){._leftColumn_1fc5y_31{border-right:0;border-bottom:1px solid var(--border-border-primary)}}._leftColumnFullWidth_1fc5y_55{flex:1}._suggestionSectionFullHeight_1fc5y_63{display:flex;flex:1}._rightColumn_1fc5y_73{display:flex;flex:1;flex-direction:column;gap:var(--spacing-spacing-1xs);padding:var(--spacing-spacing-default);background:var(--color-brand-primary-white);min-width:250px}._categorySection_1fc5y_95{border-top:1px solid var(--border-border-primary)}._suggestions_1fc5y_101,._categories_1fc5y_103{display:flex;flex-direction:column;gap:0;padding:0}._suggestionsFullHeight_1fc5y_117{flex:1}._suggestions_1fc5y_101>:first-child,._categories_1fc5y_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_1fc5y_101>:last-child{padding-bottom:var(--spacing-spacing-2xs)}._suggestionLink_1fc5y_147,._categoryLink_1fc5y_149{display:block;box-sizing:border-box;width:100%;padding:var(--spacing-spacing-2xs) var(--spacing-spacing-default)}._itemList_1fc5y_163{margin:0;padding:0;display:flex;flex-direction:column;gap:var(--spacing-spacing-2xs);width:100%}._item_1fc5y_163{display:flex;flex-direction:column;border:1px solid var(--border-border-primary);padding:var(--spacing-spacing-2xs);width:100%}._item_1fc5y_163 img{height:60px;width:60px}._item_1fc5y_163 a{display:flex;flex-direction:row;align-items:flex-start;gap:var(--spacing-spacing-2xs)}._itemInfo_1fc5y_221{display:grid;gap:var(--spacing-spacing-4xs)}._recentSearches_1fc5y_231{display:flex;flex-direction:column;background:var(--color-brand-primary-white);min-width:250px}._recentSearchesHeader_1fc5y_245{padding:var(--spacing-spacing-default) var(--spacing-spacing-default) var(--spacing-spacing-2xs)}._recentSearchesList_1fc5y_253{display:flex;flex-direction:column;gap:0;margin:0;padding:0}._recentSearch_1fc5y_231{display:flex;align-items:center;justify-content:space-between;gap:var(--spacing-spacing-2xs)}._recentSearchLink_1fc5y_283{display:flex;flex:1;min-width:0;align-items:center;padding:var(--spacing-spacing-2xs) var(--spacing-spacing-default)}._clearRecentSearch_1fc5y_299{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,85 +1,88 @@
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
1
+ import { jsxs as t, jsx as s } from "react/jsx-runtime";
2
+ import { Text as c } from "../../atoms/Text/Text.js";
3
+ import { Link as o } from "../../atoms/Link/Link.js";
4
+ import { Icon as m } from "../../atoms/Icon/Icon.js";
5
+ import { c as r } from "../../clsx-OuTLNxxd.js";
6
+ import { Image as f } from "../../atoms/Image/Image.js";
7
+ import '../../assets/SuggestionDropdown.css';const d = "_suggestionDropdown_1fc5y_1", y = "_leftColumn_1fc5y_31", S = "_leftColumnFullWidth_1fc5y_55", p = "_suggestionSectionFullHeight_1fc5y_63", L = "_rightColumn_1fc5y_73", k = "_categorySection_1fc5y_95", N = "_suggestions_1fc5y_101", v = "_categories_1fc5y_103", x = "_suggestionsFullHeight_1fc5y_117", F = "_suggestionLink_1fc5y_147", H = "_categoryLink_1fc5y_149", C = "_itemList_1fc5y_163", D = "_item_1fc5y_163", w = "_itemInfo_1fc5y_221", z = "_recentSearches_1fc5y_231", T = "_recentSearchesHeader_1fc5y_245", q = "_recentSearchesList_1fc5y_253", W = "_recentSearch_1fc5y_231", b = "_recentSearchLink_1fc5y_283", I = "_clearRecentSearch_1fc5y_299", n = {
8
+ suggestionDropdown: d,
9
+ leftColumn: y,
10
+ leftColumnFullWidth: S,
11
+ suggestionSectionFullHeight: p,
12
+ rightColumn: L,
13
+ categorySection: k,
14
+ suggestions: N,
15
+ categories: v,
16
+ suggestionsFullHeight: x,
17
+ suggestionLink: F,
18
+ categoryLink: H,
19
+ itemList: C,
20
+ item: D,
21
+ itemInfo: w,
22
+ recentSearches: z,
23
+ recentSearchesHeader: T,
24
+ recentSearchesList: q,
25
+ recentSearch: W,
26
+ recentSearchLink: b,
27
+ clearRecentSearch: I
25
28
  };
26
- function A({
29
+ function B({
27
30
  terms: l,
28
- categories: d,
29
- items: h,
30
- view: m = "suggestions",
31
+ categories: i,
32
+ items: a,
33
+ view: u = "suggestions",
31
34
  recentSearches: _ = [],
32
- onClearRecentSearch: t,
33
- className: o
35
+ onClearRecentSearch: g,
36
+ className: h
34
37
  }) {
35
- return m === "recent-searches" ? /* @__PURE__ */ n(
38
+ return u === "recent-searches" ? /* @__PURE__ */ t(
36
39
  "div",
37
40
  {
38
- className: a(r.suggestionDropdown, r.recentSearches, o),
41
+ className: r(n.suggestionDropdown, n.recentSearches, h),
39
42
  onMouseDown: (e) => e.preventDefault(),
40
43
  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("div", { className: n.recentSearchesHeader, children: /* @__PURE__ */ s(c, { size: "xxs", colorToken: "quaternary", children: "Recent Searches" }) }),
45
+ /* @__PURE__ */ s("ol", { className: n.recentSearchesList, children: _.map((e) => /* @__PURE__ */ t("li", { className: n.recentSearch, children: [
46
+ /* @__PURE__ */ s(o, { href: e.url, className: n.recentSearchLink, children: /* @__PURE__ */ s(c, { size: "sm", children: e.term }) }),
44
47
  /* @__PURE__ */ s(
45
48
  "button",
46
49
  {
47
50
  type: "button",
48
- className: r.clearRecentSearch,
51
+ className: n.clearRecentSearch,
49
52
  "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" })
53
+ onClick: () => g == null ? void 0 : g(e),
54
+ children: /* @__PURE__ */ s(m, { iconKey: "fa-regular fa-xmark", size: "sm" })
52
55
  }
53
56
  )
54
57
  ] }, e.url)) })
55
58
  ]
56
59
  }
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" }),
60
+ ) : /* @__PURE__ */ t("div", { className: r(n.suggestionDropdown, h), onMouseDown: (e) => e.preventDefault(), children: [
61
+ (l.length > 0 || i.length > 0) && /* @__PURE__ */ t("div", { className: r(n.leftColumn, { [n.leftColumnFullWidth]: a.length === 0 }), children: [
62
+ l.length > 0 && /* @__PURE__ */ s("div", { className: r(n.suggestionSection, { [n.suggestionSectionFullHeight]: i.length === 0 }), children: /* @__PURE__ */ t("div", { className: r(n.suggestions, { [n.suggestionsFullHeight]: i.length === 0 }), children: [
63
+ /* @__PURE__ */ s(c, { size: "xxs", colorToken: "quaternary", children: "Suggestions" }),
61
64
  l.map(
62
- (e) => /* @__PURE__ */ s(i, { size: "sm", children: /* @__PURE__ */ s(c, { href: e.url, className: r.suggestionLink, children: e.name }) }, e.url)
65
+ (e) => /* @__PURE__ */ s(c, { size: "sm", children: /* @__PURE__ */ s(o, { href: e.url, className: n.suggestionLink, children: e.name }) }, e.url)
63
66
  )
64
67
  ] }) }),
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)
68
+ i.length > 0 && /* @__PURE__ */ s("div", { className: n.categorySection, children: /* @__PURE__ */ t("div", { className: n.categories, children: [
69
+ /* @__PURE__ */ s(c, { size: "xxs", colorToken: "quaternary", children: "Categories" }),
70
+ i.map(
71
+ (e) => /* @__PURE__ */ s(c, { size: "sm", children: /* @__PURE__ */ s(o, { href: e.url, className: n.categoryLink, children: e.name }) }, e.name)
69
72
  )
70
73
  ] }) })
71
74
  ] }),
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 })
75
+ a.length > 0 && /* @__PURE__ */ s("div", { className: n.rightColumn, children: /* @__PURE__ */ s("ol", { className: n.itemList, children: a.map(
76
+ (e) => /* @__PURE__ */ s("li", { className: n.item, children: /* @__PURE__ */ t(o, { href: e.url, children: [
77
+ /* @__PURE__ */ s(f, { src: e.image, alt: `${e.description} product image`, height: 72, width: 72 }),
78
+ /* @__PURE__ */ t("div", { className: n.itemInfo, children: [
79
+ /* @__PURE__ */ s(c, { size: "sm", children: e.description }),
80
+ /* @__PURE__ */ s(c, { size: "sm", colorToken: "quaternary", children: e.itemId })
78
81
  ] })
79
82
  ] }) }, e.itemId)
80
83
  ) }) })
81
84
  ] });
82
85
  }
83
86
  export {
84
- A as SuggestionDropdown
87
+ B as SuggestionDropdown
85
88
  };
@@ -11,4 +11,7 @@ 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 WithoutCategories: Story;
15
+ export declare const WithoutItems: Story;
16
+ export declare const OnlyItems: Story;
14
17
  export declare const RecentSearches: Story;
@@ -1,12 +1,12 @@
1
- import { SuggestionDropdown as t } from "./SuggestionDropdown.js";
2
- const s = {
1
+ import { SuggestionDropdown as r } from "./SuggestionDropdown.js";
2
+ const a = {
3
3
  title: "Case Parts/Organisms/SuggestionDropdown",
4
- component: t,
4
+ component: r,
5
5
  parameters: {
6
6
  layout: "centered"
7
7
  },
8
8
  tags: ["autodocs"]
9
- }, a = {
9
+ }, e = {
10
10
  args: {
11
11
  terms: [
12
12
  { name: "thermostat", url: "/search/thermostat" },
@@ -44,6 +44,22 @@ const s = {
44
44
  ]
45
45
  }
46
46
  }, o = {
47
+ args: {
48
+ ...e.args,
49
+ categories: []
50
+ }
51
+ }, c = {
52
+ args: {
53
+ ...e.args,
54
+ items: []
55
+ }
56
+ }, n = {
57
+ args: {
58
+ ...e.args,
59
+ terms: [],
60
+ categories: []
61
+ }
62
+ }, i = {
47
63
  args: {
48
64
  view: "recent-searches",
49
65
  terms: [],
@@ -54,11 +70,14 @@ const s = {
54
70
  { term: "walk-in cooler", url: "/search/walk-in-cooler" },
55
71
  { term: "thermostat", url: "/search/thermostat" }
56
72
  ],
57
- onClearRecentSearch: (e) => alert(`Clear ${e.term}`)
73
+ onClearRecentSearch: (t) => alert(`Clear ${t.term}`)
58
74
  }
59
75
  };
60
76
  export {
61
- a as Default,
62
- o as RecentSearches,
63
- s as default
77
+ e as Default,
78
+ n as OnlyItems,
79
+ i as RecentSearches,
80
+ o as WithoutCategories,
81
+ c as WithoutItems,
82
+ a as default
64
83
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@caseparts-org/caseblocks",
3
3
  "private": false,
4
- "version": "0.0.232",
4
+ "version": "0.0.233",
5
5
  "type": "module",
6
6
  "module": "dist/main.js",
7
7
  "types": "dist/main.d.ts",