@caseparts-org/caseblocks 0.0.246 → 0.0.248

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
- ._disclaimer_hmbag_1{display:flex;flex-direction:column;gap:var(--spacing-spacing-3xs);border:1px solid var(--border-border-primary);border-radius:var(--border-radius-sm);padding:var(--spacing-spacing-2xs) var(--spacing-spacing-1xs);background:var(--surface-surface-primary)}._header_hmbag_11{display:flex;align-items:flex-start;gap:var(--spacing-spacing-2xs)}._content_hmbag_17{display:grid;gap:var(--spacing-spacing-3xs);min-width:0}._description_hmbag_23{white-space:pre-line}._variantInfo_hmbag_27{border-color:var(--border-border-primary);background:color-mix(in srgb,var(--surface-surface-secondary) 24%,var(--surface-surface-primary))}._variantWarning_hmbag_32{border-color:var(--border-border-warning);background:color-mix(in srgb,var(--color-alerts-warning) 10%,var(--surface-surface-primary))}
1
+ ._disclaimer_1bxdj_1{display:flex;justify-content:space-between;align-items:flex-start;gap:var(--spacing-spacing-2xs);width:100%;border:1px solid;border-radius:var(--border-radius-sm);padding:var(--spacing-spacing-2xs) var(--spacing-spacing-1xs)}._content_1bxdj_12{display:flex;align-items:flex-start;gap:var(--spacing-spacing-2xs);flex:1;min-width:0}._layout-stacked_1bxdj_20 ._content_1bxdj_12{display:grid;grid-template-columns:auto minmax(0,1fr);row-gap:var(--spacing-spacing-3xs)}._layout-stacked_1bxdj_20 ._primary_1bxdj_26,._layout-stacked_1bxdj_20 ._subtext_1bxdj_27{grid-column:2}._layout-stacked_1bxdj_20 ._icon_1bxdj_31{grid-row:span 2;align-self:start}._primary_1bxdj_26{font-size:var(--font-size-sm);font-weight:var(--font-weight-semibold)}._subtext_1bxdj_27{font-size:var(--font-size-xs);white-space:pre-line}._cta_1bxdj_46{flex:none}._background-neutral_1bxdj_50{background-color:var(--color-neutrals-neutral-1)}._background-secondary_1bxdj_54{background-color:var(--color-brand-secondary-lt-teal-blue)}._background-caution-tips_1bxdj_58{background-color:var(--color-brand-secondary-lt-yellow)}._background-warning_1bxdj_62{background-color:var(--color-brand-secondary-lt-orange)}._background-success_1bxdj_66{background-color:var(--color-brand-secondary-lt-green)}._background-error-warning_1bxdj_70{background-color:var(--color-brand-secondary-lt-red)}._border-neutral_1bxdj_74{border-color:var(--color-neutrals-neutral-1)}._border-secondary_1bxdj_78{border-color:var(--color-brand-secondary-lt-teal-blue)}._border-caution-tips_1bxdj_82{border-color:var(--color-brand-secondary-lt-yellow)}._border-warning_1bxdj_86{border-color:var(--color-brand-secondary-lt-orange)}._border-success_1bxdj_90{border-color:var(--color-brand-secondary-lt-green)}._border-error-warning_1bxdj_94{border-color:var(--color-brand-secondary-lt-red)}
@@ -47,7 +47,7 @@ export type { CardLinkProps } from './molecules/CardLink/CardLink';
47
47
  export { Breadcrumbs } from './molecules/Breadcrumbs/Breadcrumbs';
48
48
  export type { BreadcrumbProps, Breadcrumb } from './molecules/Breadcrumbs/Breadcrumbs';
49
49
  export { Disclaimer } from './molecules/Disclaimer/Disclaimer';
50
- export type { DisclaimerProps, DisclaimerSeverity } from './molecules/Disclaimer/Disclaimer';
50
+ export type { DisclaimerProps, DisclaimerColorToken, DisclaimerIcon, DisclaimerContentProps, DisclaimerIconProps, DisclaimerPrimaryProps, DisclaimerSubtextProps, DisclaimerCTAProps, } from './molecules/Disclaimer/Disclaimer';
51
51
  export { Admonition } from './molecules/Admonition/Admonition';
52
52
  export type { AdmonitionProps, AdmonitionVariant } from './molecules/Admonition/Admonition';
53
53
  export { CustomWizardBadge } from './molecules/CustomWizardBadge/CustomWizardBadge';
@@ -1,13 +1,39 @@
1
- import { ReactNode } from 'react';
2
- export type DisclaimerSeverity = "info" | "warning";
3
- export interface DisclaimerProps {
4
- title: ReactNode;
5
- description?: ReactNode;
6
- severity?: DisclaimerSeverity;
7
- iconKey?: "fa-solid fa-circle-info" | "fa-solid fa-triangle-exclamation";
8
- className?: string;
9
- compact?: boolean;
10
- linkHref?: string;
11
- linkText?: string;
12
- }
13
- export declare function Disclaimer({ title, description, severity, iconKey, className, compact, linkHref, linkText, }: DisclaimerProps): import("react/jsx-runtime").JSX.Element;
1
+ import { ComponentPropsWithoutRef, ReactNode } from 'react';
2
+ import { IconProps } from '../../atoms/Icon/Icon';
3
+ export type DisclaimerColorToken = "neutral" | "secondary" | "caution-tips" | "warning" | "success" | "error-warning";
4
+ export type DisclaimerIcon = "info" | "question" | "warning" | "security" | "lock";
5
+ export interface DisclaimerProps extends ComponentPropsWithoutRef<"aside"> {
6
+ backgroundColorToken?: DisclaimerColorToken;
7
+ borderColorToken?: DisclaimerColorToken;
8
+ layout?: "inline" | "stacked";
9
+ }
10
+ export interface DisclaimerContentProps extends ComponentPropsWithoutRef<"div"> {
11
+ children: ReactNode;
12
+ }
13
+ export interface DisclaimerIconProps extends Omit<IconProps, "iconKey"> {
14
+ icon?: DisclaimerIcon;
15
+ iconKey?: IconProps["iconKey"];
16
+ }
17
+ export interface DisclaimerPrimaryProps extends ComponentPropsWithoutRef<"span"> {
18
+ children: ReactNode;
19
+ }
20
+ export interface DisclaimerSubtextProps extends ComponentPropsWithoutRef<"span"> {
21
+ children: ReactNode;
22
+ }
23
+ export interface DisclaimerCTAProps extends ComponentPropsWithoutRef<"div"> {
24
+ children: ReactNode;
25
+ }
26
+ declare function DisclaimerRoot({ backgroundColorToken, borderColorToken, layout, className, children, ...otherProps }: DisclaimerProps): import("react/jsx-runtime").JSX.Element;
27
+ declare function DisclaimerContent({ className, children, ...otherProps }: DisclaimerContentProps): import("react/jsx-runtime").JSX.Element;
28
+ declare function DisclaimerIcon({ icon, iconKey, className, ...otherProps }: DisclaimerIconProps): import("react/jsx-runtime").JSX.Element;
29
+ declare function DisclaimerPrimary({ className, children, ...otherProps }: DisclaimerPrimaryProps): import("react/jsx-runtime").JSX.Element;
30
+ declare function DisclaimerSubtext({ className, children, ...otherProps }: DisclaimerSubtextProps): import("react/jsx-runtime").JSX.Element;
31
+ declare function DisclaimerCTA({ className, children, ...otherProps }: DisclaimerCTAProps): import("react/jsx-runtime").JSX.Element;
32
+ export declare const Disclaimer: typeof DisclaimerRoot & {
33
+ Content: typeof DisclaimerContent;
34
+ Icon: typeof DisclaimerIcon;
35
+ Primary: typeof DisclaimerPrimary;
36
+ Subtext: typeof DisclaimerSubtext;
37
+ CTA: typeof DisclaimerCTA;
38
+ };
39
+ export {};
@@ -1,48 +1,79 @@
1
- import { jsx as a, jsxs as c } from "react/jsx-runtime";
2
- import { c as h } from "../../clsx-OuTLNxxd.js";
3
- import { Icon as g } from "../../atoms/Icon/Icon.js";
4
- import { Link as p } from "../../atoms/Link/Link.js";
5
- import { Text as t } from "../../atoms/Text/Text.js";
6
- import '../../assets/Disclaimer.css';const v = "_disclaimer_hmbag_1", b = "_header_hmbag_11", x = "_content_hmbag_17", I = "_description_hmbag_23", w = "_variantInfo_hmbag_27", z = "_variantWarning_hmbag_32", n = {
7
- disclaimer: v,
8
- header: b,
9
- content: x,
10
- description: I,
11
- variantInfo: w,
12
- variantWarning: z
1
+ import { jsx as c } from "react/jsx-runtime";
2
+ import { c as e } from "../../clsx-OuTLNxxd.js";
3
+ import { Icon as d } from "../../atoms/Icon/Icon.js";
4
+ import '../../assets/Disclaimer.css';const _ = "_disclaimer_1bxdj_1", b = "_content_1bxdj_12", u = "_primary_1bxdj_26", l = "_subtext_1bxdj_27", m = "_icon_1bxdj_31", x = "_cta_1bxdj_46", a = {
5
+ disclaimer: _,
6
+ content: b,
7
+ "layout-stacked": "_layout-stacked_1bxdj_20",
8
+ primary: u,
9
+ subtext: l,
10
+ icon: m,
11
+ cta: x,
12
+ "background-neutral": "_background-neutral_1bxdj_50",
13
+ "background-secondary": "_background-secondary_1bxdj_54",
14
+ "background-caution-tips": "_background-caution-tips_1bxdj_58",
15
+ "background-warning": "_background-warning_1bxdj_62",
16
+ "background-success": "_background-success_1bxdj_66",
17
+ "background-error-warning": "_background-error-warning_1bxdj_70",
18
+ "border-neutral": "_border-neutral_1bxdj_74",
19
+ "border-secondary": "_border-secondary_1bxdj_78",
20
+ "border-caution-tips": "_border-caution-tips_1bxdj_82",
21
+ "border-warning": "_border-warning_1bxdj_86",
22
+ "border-success": "_border-success_1bxdj_90",
23
+ "border-error-warning": "_border-error-warning_1bxdj_94"
24
+ }, g = {
25
+ info: "fa-solid fa-circle-info",
26
+ question: "fa-solid fa-circle-question",
27
+ warning: "fa-solid fa-triangle-exclamation",
28
+ security: "fa-solid fa-shield",
29
+ lock: "fa-solid fa-lock"
13
30
  };
14
- function u({
15
- title: l,
16
- description: r,
17
- severity: i = "info",
18
- iconKey: m,
19
- className: d,
20
- compact: e = !1,
21
- linkHref: o,
22
- linkText: s
31
+ function f({
32
+ backgroundColorToken: r = "neutral",
33
+ borderColorToken: n = "neutral",
34
+ layout: o = "stacked",
35
+ className: t,
36
+ children: i,
37
+ ...s
23
38
  }) {
24
- const _ = m ?? (i === "warning" ? "fa-solid fa-triangle-exclamation" : "fa-solid fa-circle-info"), f = i === "warning" ? "warning" : "secondary";
25
- return /* @__PURE__ */ a(
26
- "div",
39
+ return /* @__PURE__ */ c(
40
+ "aside",
27
41
  {
28
- className: h(
29
- n.disclaimer,
30
- i === "warning" ? n.variantWarning : n.variantInfo,
31
- d
42
+ ...s,
43
+ className: e(
44
+ a.disclaimer,
45
+ a[`background-${r}`],
46
+ a[`border-${n}`],
47
+ a[`layout-${o}`],
48
+ t
32
49
  ),
33
50
  role: "note",
34
- "aria-live": "polite",
35
- children: /* @__PURE__ */ c("div", { className: n.header, children: [
36
- /* @__PURE__ */ a(g, { iconKey: _, size: "sm", colorToken: f }),
37
- /* @__PURE__ */ c("div", { className: n.content, children: [
38
- /* @__PURE__ */ a(t, { as: "p", size: "sm", weight: "semibold", children: l }),
39
- !e && r && /* @__PURE__ */ a(t, { as: "p", size: "xs", colorToken: "primary", className: n.description, children: r }),
40
- !e && o && s && /* @__PURE__ */ a(p, { href: o, target: "_blank", rel: "noopener noreferrer", size: "xs", children: s })
41
- ] })
42
- ] })
51
+ children: i
43
52
  }
44
53
  );
45
54
  }
55
+ function j({ className: r, children: n, ...o }) {
56
+ return /* @__PURE__ */ c("div", { ...o, className: e(a.content, r), children: n });
57
+ }
58
+ function k({ icon: r = "info", iconKey: n, className: o, ...t }) {
59
+ return /* @__PURE__ */ c(d, { ...t, iconKey: n ?? g[r], className: e(a.icon, o) });
60
+ }
61
+ function y({ className: r, children: n, ...o }) {
62
+ return /* @__PURE__ */ c("span", { ...o, className: e(a.primary, r), children: n });
63
+ }
64
+ function p({ className: r, children: n, ...o }) {
65
+ return /* @__PURE__ */ c("span", { ...o, className: e(a.subtext, r), children: n });
66
+ }
67
+ function w({ className: r, children: n, ...o }) {
68
+ return /* @__PURE__ */ c("div", { ...o, className: e(a.cta, r), children: n });
69
+ }
70
+ const I = Object.assign(f, {
71
+ Content: j,
72
+ Icon: k,
73
+ Primary: y,
74
+ Subtext: p,
75
+ CTA: w
76
+ });
46
77
  export {
47
- u as Disclaimer
78
+ I as Disclaimer
48
79
  };
@@ -1,53 +1,41 @@
1
1
  import { StoryObj } from '@storybook/react-vite';
2
- import { Disclaimer } from './Disclaimer';
3
2
  declare const meta: {
4
3
  title: string;
5
- component: typeof Disclaimer;
4
+ component: (({ backgroundColorToken, borderColorToken, layout, className, children, ...otherProps }: import('./Disclaimer').DisclaimerProps) => import("react/jsx-runtime").JSX.Element) & {
5
+ Content: ({ className, children, ...otherProps }: import('./Disclaimer').DisclaimerContentProps) => import("react/jsx-runtime").JSX.Element;
6
+ Icon: ({ icon, iconKey, className, ...otherProps }: import('./Disclaimer').DisclaimerIconProps) => import("react/jsx-runtime").JSX.Element;
7
+ Primary: ({ className, children, ...otherProps }: import('./Disclaimer').DisclaimerPrimaryProps) => import("react/jsx-runtime").JSX.Element;
8
+ Subtext: ({ className, children, ...otherProps }: import('./Disclaimer').DisclaimerSubtextProps) => import("react/jsx-runtime").JSX.Element;
9
+ CTA: ({ className, children, ...otherProps }: import('./Disclaimer').DisclaimerCTAProps) => import("react/jsx-runtime").JSX.Element;
10
+ };
6
11
  tags: string[];
7
12
  parameters: {
8
13
  layout: string;
9
14
  };
15
+ args: {
16
+ backgroundColorToken: "secondary";
17
+ borderColorToken: "secondary";
18
+ layout: "stacked";
19
+ };
10
20
  argTypes: {
11
- title: {
12
- control: "text";
13
- description: string;
21
+ backgroundColorToken: {
22
+ control: "select";
23
+ options: readonly ["neutral", "secondary", "caution-tips", "warning", "success", "error-warning"];
14
24
  };
15
- description: {
16
- control: "text";
17
- description: string;
25
+ borderColorToken: {
26
+ control: "select";
27
+ options: readonly ["neutral", "secondary", "caution-tips", "warning", "success", "error-warning"];
18
28
  };
19
- severity: {
20
- control: {
21
- type: "radio";
22
- };
29
+ layout: {
30
+ control: "radio";
23
31
  options: string[];
24
- description: string;
25
- };
26
- compact: {
27
- control: "boolean";
28
- description: string;
29
32
  };
30
- linkHref: {
31
- control: "text";
32
- description: string;
33
- };
34
- linkText: {
35
- control: "text";
36
- description: string;
37
- };
38
- };
39
- args: {
40
- title: string;
41
- description: string;
42
- severity: "warning";
43
- compact: false;
44
- linkHref: string;
45
- linkText: string;
46
33
  };
47
34
  };
48
35
  export default meta;
49
36
  type Story = StoryObj<typeof meta>;
50
- export declare const Warning: Story;
51
- export declare const Info: Story;
52
- export declare const WithLink: Story;
53
- export declare const Compact: Story;
37
+ export declare const AllProps: Story;
38
+ export declare const Layouts: Story;
39
+ export declare const ColorTokens: Story;
40
+ export declare const IconOptions: Story;
41
+ export declare const WithCTA: Story;
@@ -1,72 +1,71 @@
1
- import { Disclaimer as t } from "./Disclaimer.js";
2
- const i = {
1
+ import { jsx as n, jsxs as o } from "react/jsx-runtime";
2
+ import { Disclaimer as e } from "./Disclaimer.js";
3
+ const i = ["neutral", "secondary", "caution-tips", "warning", "success", "error-warning"], d = {
3
4
  title: "Case Parts/Molecules/Disclaimer",
4
- component: t,
5
+ component: e,
5
6
  tags: ["autodocs"],
6
- parameters: {
7
- layout: "centered"
7
+ parameters: { layout: "centered" },
8
+ args: {
9
+ backgroundColorToken: "secondary",
10
+ borderColorToken: "secondary",
11
+ layout: "stacked"
8
12
  },
9
13
  argTypes: {
10
- title: {
11
- control: "text",
12
- description: "Short header for the disclaimer card."
13
- },
14
- description: {
15
- control: "text",
16
- description: "Supporting disclaimer message."
17
- },
18
- severity: {
19
- control: { type: "radio" },
20
- options: ["info", "warning"],
21
- description: "Visual severity variant."
22
- },
23
- compact: {
24
- control: "boolean",
25
- description: "Hides description and link when true."
26
- },
27
- linkHref: {
28
- control: "text",
29
- description: "Optional external link URL."
30
- },
31
- linkText: {
32
- control: "text",
33
- description: "Optional external link label."
34
- }
35
- },
36
- args: {
37
- title: "Custom Parts Lead Time",
38
- description: "Custom-made parts are non-refundable and may require additional production time.",
39
- severity: "warning",
40
- compact: !1,
41
- linkHref: "",
42
- linkText: ""
43
- }
44
- }, n = {}, r = {
45
- args: {
46
- title: "UPS 2nd Day Air",
47
- description: "In-stock orders placed during business hours usually ship the same day and arrive within two business days.",
48
- severity: "info"
49
- }
50
- }, o = {
51
- args: {
52
- title: "CA Prop 65 Warning",
53
- description: "Some products sold by Case Parts may expose you to chemicals known to the State of California to cause cancer or reproductive harm.",
54
- severity: "warning",
55
- linkHref: "https://www.p65warnings.ca.gov",
56
- linkText: "www.p65warnings.ca.gov"
14
+ backgroundColorToken: { control: "select", options: i },
15
+ borderColorToken: { control: "select", options: i },
16
+ layout: { control: "radio", options: ["inline", "stacked"] }
57
17
  }
18
+ }, l = {
19
+ render: (r) => /* @__PURE__ */ n("div", { style: { width: 640 }, children: /* @__PURE__ */ n(e, { ...r, children: /* @__PURE__ */ o(e.Content, { children: [
20
+ /* @__PURE__ */ n(e.Icon, { icon: "info", size: "sm", colorToken: "secondary" }),
21
+ /* @__PURE__ */ n(e.Primary, { children: "Custom parts may require additional production time." }),
22
+ /* @__PURE__ */ n(e.Subtext, { children: "Orders cannot be changed after production begins." })
23
+ ] }) }) })
58
24
  }, a = {
59
- args: {
60
- title: "Parts Not in Stock",
61
- description: "This text is hidden when compact mode is enabled.",
62
- compact: !0,
63
- severity: "warning"
64
- }
25
+ render: () => /* @__PURE__ */ n("div", { style: { display: "grid", gap: 16, width: 640 }, children: ["inline", "stacked"].map((r) => /* @__PURE__ */ n(e, { backgroundColorToken: "secondary", borderColorToken: "secondary", layout: r, children: /* @__PURE__ */ o(e.Content, { children: [
26
+ /* @__PURE__ */ n(e.Icon, { icon: "info", size: "sm", colorToken: "secondary" }),
27
+ /* @__PURE__ */ o(e.Primary, { children: [
28
+ r === "inline" ? "Inline" : "Stacked",
29
+ " primary text."
30
+ ] }),
31
+ /* @__PURE__ */ n(e.Subtext, { children: "Supporting text for this disclaimer." })
32
+ ] }) }, r)) })
33
+ }, s = {
34
+ render: () => /* @__PURE__ */ n("div", { style: { display: "grid", gap: 12, width: 640 }, children: i.map((r) => /* @__PURE__ */ n(e, { backgroundColorToken: r, borderColorToken: r, layout: "inline", children: /* @__PURE__ */ o(e.Content, { children: [
35
+ /* @__PURE__ */ n(e.Icon, { icon: "info", size: "sm" }),
36
+ /* @__PURE__ */ n(e.Primary, { children: r }),
37
+ /* @__PURE__ */ n(e.Subtext, { children: "Background and border token." })
38
+ ] }) }, r)) })
39
+ }, h = {
40
+ render: () => /* @__PURE__ */ o("div", { style: { display: "grid", gap: 12, width: 640 }, children: [
41
+ ["info", "question", "warning", "security", "lock"].map((r) => /* @__PURE__ */ n(e, { backgroundColorToken: "neutral", borderColorToken: "neutral", layout: "inline", children: /* @__PURE__ */ o(e.Content, { children: [
42
+ /* @__PURE__ */ n(e.Icon, { icon: r, size: "sm" }),
43
+ /* @__PURE__ */ n(e.Primary, { children: r })
44
+ ] }) }, r)),
45
+ /* @__PURE__ */ n(e, { backgroundColorToken: "neutral", borderColorToken: "neutral", layout: "inline", children: /* @__PURE__ */ o(e.Content, { children: [
46
+ /* @__PURE__ */ n(e.Icon, { iconKey: "fa-regular fa-circle-question", size: "sm" }),
47
+ /* @__PURE__ */ n(e.Primary, { children: "Custom icon key" })
48
+ ] }) })
49
+ ] })
50
+ }, u = {
51
+ render: () => /* @__PURE__ */ n("div", { style: { width: 640 }, children: /* @__PURE__ */ o(e, { backgroundColorToken: "caution-tips", borderColorToken: "caution-tips", children: [
52
+ /* @__PURE__ */ o(e.Content, { children: [
53
+ /* @__PURE__ */ n(e.Icon, { icon: "warning", size: "sm", colorToken: "warning" }),
54
+ /* @__PURE__ */ n(e.Primary, { children: "Some installation conditions need review." }),
55
+ /* @__PURE__ */ o(e.Subtext, { children: [
56
+ "See the ",
57
+ /* @__PURE__ */ n("a", { href: "https://www.caseparts.com", children: "installation guide" }),
58
+ " before ordering."
59
+ ] })
60
+ ] }),
61
+ /* @__PURE__ */ n(e.CTA, { children: /* @__PURE__ */ n("a", { href: "https://www.caseparts.com", children: "Review" }) })
62
+ ] }) })
65
63
  };
66
64
  export {
67
- a as Compact,
68
- r as Info,
69
- n as Warning,
70
- o as WithLink,
71
- i as default
65
+ l as AllProps,
66
+ s as ColorTokens,
67
+ h as IconOptions,
68
+ a as Layouts,
69
+ u as WithCTA,
70
+ d as default
72
71
  };
@@ -1,23 +1,23 @@
1
- import { jsx as o, jsxs as e, Fragment as Y } from "react/jsx-runtime";
1
+ import { jsx as m, jsxs as f, Fragment as Y } from "react/jsx-runtime";
2
2
  import D from "react";
3
3
  import { Text as O } from "../../atoms/Text/Text.js";
4
4
  import { Link as U } from "../../atoms/Link/Link.js";
5
- import { Icon as y } from "../../atoms/Icon/Icon.js";
6
- import { Flex as z } from "../../atoms/Flex/Flex.js";
7
- import { Grid as fi, Column as si } from "../../atoms/Grid/Grid.js";
5
+ import { Icon as k } from "../../atoms/Icon/Icon.js";
6
+ import { Flex as u } from "../../atoms/Flex/Flex.js";
7
+ import { Grid as ei, Column as ci } from "../../atoms/Grid/Grid.js";
8
8
  import { Input as Z } from "../../atoms/Input/Input.js";
9
9
  import { InputEndAdornmentButton as B } from "../../atoms/InputEndAdornmentButton/InputEndAdornmentButton.js";
10
- import { Logo as ci } from "../../molecules/Logo/Logo.js";
11
- import { HamburgerMenu as ri } from "../../molecules/HamburgerMenu/HamburgerMenu.js";
12
- import { ShoppingCart as ai } from "../../molecules/Cart/Cart.js";
13
- import { Account as _i } from "../../molecules/Account/Account.js";
14
- import { CategoryNav as Ni } from "../../molecules/CategoryNav/CategoryNav.js";
10
+ import { Logo as ri } from "../../molecules/Logo/Logo.js";
11
+ import { HamburgerMenu as si } from "../../molecules/HamburgerMenu/HamburgerMenu.js";
12
+ import { ShoppingCart as _i } from "../../molecules/Cart/Cart.js";
13
+ import { Account as Ni } from "../../molecules/Account/Account.js";
14
+ import { CategoryNav as yi } from "../../molecules/CategoryNav/CategoryNav.js";
15
15
  import { SuggestionDropdown as $ } from "../SuggestionDropdown/SuggestionDropdown.js";
16
- import { getHideAtStyles as P } from "../../atoms/HideAt.js";
17
- import { c as k } from "../../clsx-OuTLNxxd.js";
18
- import '../../assets/MainNav.css';const yi = "_main_12974_1", ki = "_column_12974_8", wi = "_topNav_12974_13", Di = "_logo_12974_21", bi = "_operations_12974_24", Ai = "_search_12974_31", vi = "_mobileSearch_12974_36", xi = "_suggestionDropdown_12974_39", Li = "_siteLink_12974_45", Ki = "_accountArea_12974_72", ui = "_category_12974_84", pi = "_categoryLink_12974_92", zi = "_menuList_12974_108", Bi = "_menuItemAction_12974_131", $i = "_shortcutIcon_12974_140", t = {
19
- main: yi,
20
- column: ki,
16
+ import { getHideAtStyles as C } from "../../atoms/HideAt.js";
17
+ import { c as a } from "../../clsx-OuTLNxxd.js";
18
+ import '../../assets/MainNav.css';const ki = "_main_12974_1", ai = "_column_12974_8", wi = "_topNav_12974_13", Di = "_logo_12974_21", bi = "_operations_12974_24", Ai = "_search_12974_31", vi = "_mobileSearch_12974_36", xi = "_suggestionDropdown_12974_39", Li = "_siteLink_12974_45", Ki = "_accountArea_12974_72", pi = "_category_12974_84", zi = "_categoryLink_12974_92", ui = "_menuList_12974_108", Bi = "_menuItemAction_12974_131", $i = "_shortcutIcon_12974_140", t = {
19
+ main: ki,
20
+ column: ai,
21
21
  topNav: wi,
22
22
  logo: Di,
23
23
  operations: bi,
@@ -26,18 +26,18 @@ import '../../assets/MainNav.css';const yi = "_main_12974_1", ki = "_column_1297
26
26
  suggestionDropdown: xi,
27
27
  siteLink: Li,
28
28
  accountArea: Ki,
29
- category: ui,
30
- categoryLink: pi,
31
- menuList: zi,
29
+ category: pi,
30
+ categoryLink: zi,
31
+ menuList: ui,
32
32
  menuItemAction: Bi,
33
33
  shortcutIcon: $i
34
34
  }, Zi = D.forwardRef(function({
35
35
  account: F,
36
36
  categories: A,
37
- homeRoute: C,
38
- faqRoute: g,
37
+ homeRoute: P,
38
+ faqRoute: V,
39
39
  customPartsRoute: E,
40
- aboutUsRoute: V,
40
+ aboutUsRoute: g,
41
41
  contactRoute: R,
42
42
  cart: h,
43
43
  open: S,
@@ -45,85 +45,85 @@ import '../../assets/MainNav.css';const yi = "_main_12974_1", ki = "_column_1297
45
45
  className: ii,
46
46
  onLoginClick: ti,
47
47
  searchInputProps: l,
48
- searchValue: s,
49
- onSearchValueChange: n,
48
+ searchValue: c,
49
+ onSearchValueChange: d,
50
50
  onClearSearch: w,
51
- onSearch: c,
52
- searchSuggestions: m,
53
- recentSearches: a,
51
+ onSearch: r,
52
+ searchSuggestions: o,
53
+ recentSearches: _,
54
54
  onClearRecentSearch: H,
55
55
  onCategoryClick: K,
56
56
  onClickModelSerial: T,
57
- onCartClick: oi,
58
- accountPopoverContent: mi,
57
+ onCartClick: mi,
58
+ accountPopoverContent: oi,
59
59
  isAccountLoading: li,
60
60
  isCategoriesLoading: ni,
61
- ...ei
62
- }, di) {
61
+ ...di
62
+ }, fi) {
63
63
  var W;
64
- const [q, _] = D.useState(!1), [d, N] = D.useState(-1), u = D.useRef(null), I = D.useRef(null), r = D.useId(), G = () => {
64
+ const [q, N] = D.useState(!1), [e, y] = D.useState(-1), p = D.useRef(null), I = D.useRef(null), s = D.useId(), G = () => {
65
65
  var i;
66
- return (i = u.current) != null && i.offsetParent ? u.current : I.current;
67
- }, v = q && !!s && !!m, M = q && !v && !!(a != null && a.length), x = v ? ((m == null ? void 0 : m.terms.length) ?? 0) + ((m == null ? void 0 : m.categories.length) ?? 0) + (((W = m == null ? void 0 : m.customParts) == null ? void 0 : W.length) ?? 0) + ((m == null ? void 0 : m.items.length) ?? 0) : M ? (a == null ? void 0 : a.length) ?? 0 : 0, Q = {
66
+ return (i = p.current) != null && i.offsetParent ? p.current : I.current;
67
+ }, v = q && !!c && !!o, M = q && !v && !!(_ != null && _.length), x = v ? ((o == null ? void 0 : o.terms.length) ?? 0) + ((o == null ? void 0 : o.categories.length) ?? 0) + (((W = o == null ? void 0 : o.customParts) == null ? void 0 : W.length) ?? 0) + ((o == null ? void 0 : o.items.length) ?? 0) : M ? (_ == null ? void 0 : _.length) ?? 0 : 0, Q = {
68
68
  ...l,
69
69
  onChange: (i) => {
70
- var f;
71
- N(-1), (f = l == null ? void 0 : l.onChange) == null || f.call(l, i);
70
+ var n;
71
+ y(-1), (n = l == null ? void 0 : l.onChange) == null || n.call(l, i);
72
72
  },
73
73
  onFocus: (i) => {
74
- var f;
75
- (f = l == null ? void 0 : l.onFocus) == null || f.call(l, i), _(!0);
74
+ var n;
75
+ (n = l == null ? void 0 : l.onFocus) == null || n.call(l, i), N(!0);
76
76
  },
77
77
  onBlur: (i) => {
78
- var f;
79
- (f = l == null ? void 0 : l.onBlur) == null || f.call(l, i), _(!1);
78
+ var n;
79
+ (n = l == null ? void 0 : l.onBlur) == null || n.call(l, i), N(!1);
80
80
  },
81
81
  onKeyDown: (i) => {
82
- var f, J, X;
83
- if ((f = l == null ? void 0 : l.onKeyDown) == null || f.call(l, i), !i.defaultPrevented) {
82
+ var n, J, X;
83
+ if ((n = l == null ? void 0 : l.onKeyDown) == null || n.call(l, i), !i.defaultPrevented) {
84
84
  if (i.key === "ArrowDown" && x > 0) {
85
- i.preventDefault(), N((L) => L >= x - 1 ? 0 : L + 1);
85
+ i.preventDefault(), y((L) => L >= x - 1 ? 0 : L + 1);
86
86
  return;
87
87
  }
88
88
  if (i.key === "ArrowUp" && x > 0) {
89
- i.preventDefault(), N((L) => L <= 0 ? x - 1 : L - 1);
89
+ i.preventDefault(), y((L) => L <= 0 ? x - 1 : L - 1);
90
90
  return;
91
91
  }
92
- if (i.key === "Tab" && v && d >= 0 && d < ((m == null ? void 0 : m.terms.length) ?? 0)) {
93
- i.preventDefault(), n == null || n((m == null ? void 0 : m.terms[d].name) ?? ""), N(-1);
92
+ if (i.key === "Tab" && v && e >= 0 && e < ((o == null ? void 0 : o.terms.length) ?? 0)) {
93
+ i.preventDefault(), d == null || d((o == null ? void 0 : o.terms[e].name) ?? ""), y(-1);
94
94
  return;
95
95
  }
96
- if (i.key === "Enter" && d >= 0 && d < x) {
97
- i.preventDefault(), (J = document.getElementById(`${r}-${d}`)) == null || J.click();
96
+ if (i.key === "Enter" && e >= 0 && e < x) {
97
+ i.preventDefault(), (J = document.getElementById(`${s}-${e}`)) == null || J.click();
98
98
  return;
99
99
  }
100
- i.key === "Enter" && (i.preventDefault(), _(!1), (X = G()) == null || X.blur(), c == null || c(s ?? ""));
100
+ i.key === "Enter" && (i.preventDefault(), N(!1), (X = G()) == null || X.blur(), r == null || r(c ?? ""));
101
101
  }
102
102
  }
103
- }, p = (i) => {
104
- var f;
105
- i.key.length !== 1 || i.altKey || i.ctrlKey || i.metaKey || (i.preventDefault(), N(-1), n == null || n(`${s ?? ""}${i.key}`), (f = G()) == null || f.focus());
103
+ }, z = (i) => {
104
+ var n;
105
+ i.key.length !== 1 || i.altKey || i.ctrlKey || i.metaKey || (i.preventDefault(), y(-1), d == null || d(`${c ?? ""}${i.key}`), (n = G()) == null || n.focus());
106
106
  };
107
- return /* @__PURE__ */ o(fi, { ...ei, gridWrapperClassName: k(t.main, ii), children: /* @__PURE__ */ e(si, { span: 12, className: t.column, children: [
108
- /* @__PURE__ */ e(
109
- z,
107
+ return /* @__PURE__ */ m(ei, { ...di, gridWrapperClassName: a(t.main, ii), children: /* @__PURE__ */ f(ci, { span: 12, className: t.column, children: [
108
+ /* @__PURE__ */ f(
109
+ u,
110
110
  {
111
111
  flexDirection: "row",
112
112
  alignItems: "center",
113
113
  justifyContent: "space-between",
114
114
  className: t.topNav,
115
115
  children: [
116
- /* @__PURE__ */ o("div", { className: t.logo, children: /* @__PURE__ */ o(U, { href: C, children: /* @__PURE__ */ o(ci, {}) }) }),
117
- /* @__PURE__ */ e(
118
- z,
116
+ /* @__PURE__ */ m("div", { className: t.logo, children: /* @__PURE__ */ m(U, { href: P, children: /* @__PURE__ */ m(ri, {}) }) }),
117
+ /* @__PURE__ */ f(
118
+ u,
119
119
  {
120
120
  flexDirection: "row",
121
121
  alignItems: "center",
122
122
  justifyContent: "flex-end",
123
123
  className: t.operations,
124
124
  children: [
125
- /* @__PURE__ */ e(z, { flexDirection: "row", hideAt: ["sm"], className: t.search, children: [
126
- /* @__PURE__ */ o(
125
+ /* @__PURE__ */ f(u, { flexDirection: "row", hideAt: ["sm"], className: t.search, children: [
126
+ /* @__PURE__ */ m(
127
127
  Z,
128
128
  {
129
129
  variant: "search",
@@ -132,138 +132,139 @@ import '../../assets/MainNav.css';const yi = "_main_12974_1", ki = "_column_1297
132
132
  name: "cpc-search",
133
133
  autoComplete: "off",
134
134
  "aria-autocomplete": "list",
135
- "aria-controls": r,
136
- "aria-activedescendant": d >= 0 ? `${r}-${d}` : void 0,
135
+ "aria-controls": s,
136
+ "aria-activedescendant": e >= 0 ? `${s}-${e}` : void 0,
137
137
  ...Q,
138
- ref: u,
139
- value: s,
140
- endAdornment: /* @__PURE__ */ e(Y, { children: [
141
- !!s && /* @__PURE__ */ o(
138
+ ref: p,
139
+ value: c,
140
+ endAdornment: /* @__PURE__ */ f(Y, { children: [
141
+ !!c && /* @__PURE__ */ m(
142
142
  B,
143
143
  {
144
144
  "aria-label": "Clear search",
145
145
  onMouseDown: (i) => i.preventDefault(),
146
146
  onClick: () => {
147
147
  var i;
148
- N(-1), w == null || w(), (i = u.current) == null || i.focus();
148
+ y(-1), w == null || w(), (i = p.current) == null || i.focus();
149
149
  },
150
150
  iconProps: { iconKey: "fa-regular fa-xmark", size: "sm" }
151
151
  }
152
152
  ),
153
- /* @__PURE__ */ o(
153
+ /* @__PURE__ */ m(
154
154
  B,
155
155
  {
156
156
  "aria-label": "Submit search",
157
- onClick: () => c == null ? void 0 : c(s ?? ""),
157
+ onClick: () => r == null ? void 0 : r(c ?? ""),
158
158
  iconProps: { iconKey: "fa-regular fa-magnifying-glass", size: "sm" }
159
159
  }
160
160
  )
161
161
  ] })
162
162
  }
163
163
  ),
164
- v && m && /* @__PURE__ */ o(
164
+ v && o && /* @__PURE__ */ m(
165
165
  $,
166
166
  {
167
- ...m,
168
- activeOptionIndex: d,
169
- optionIdPrefix: r,
170
- onKeyDown: p,
167
+ ...o,
168
+ activeOptionIndex: e,
169
+ optionIdPrefix: s,
170
+ onKeyDown: z,
171
171
  onSuggestionClick: (i) => {
172
- n == null || n((i == null ? void 0 : i.name) ?? s ?? ""), _(!1);
172
+ var n;
173
+ (n = o.onSuggestionClick) == null || n.call(o, i), d == null || d((i == null ? void 0 : i.name) ?? c ?? ""), N(!1);
173
174
  },
174
175
  className: t.suggestionDropdown
175
176
  }
176
177
  ),
177
- M && /* @__PURE__ */ o(
178
+ M && /* @__PURE__ */ m(
178
179
  $,
179
180
  {
180
181
  terms: [],
181
182
  categories: [],
182
183
  items: [],
183
184
  view: "recent-searches",
184
- recentSearches: a,
185
+ recentSearches: _,
185
186
  onClearRecentSearch: H,
186
- activeOptionIndex: d,
187
- optionIdPrefix: r,
188
- onKeyDown: p,
187
+ activeOptionIndex: e,
188
+ optionIdPrefix: s,
189
+ onKeyDown: z,
189
190
  onSuggestionClick: (i) => {
190
- n == null || n((i == null ? void 0 : i.term) ?? s ?? ""), _(!1);
191
+ d == null || d((i == null ? void 0 : i.term) ?? c ?? ""), N(!1);
191
192
  },
192
193
  className: t.suggestionDropdown
193
194
  }
194
195
  )
195
196
  ] }),
196
- /* @__PURE__ */ e("button", { onClick: T, className: k(t.siteLink, P(["sm", "md"])), children: [
197
- /* @__PURE__ */ o(y, { iconKey: "fa-regular fa-sparkles", size: "sm" }),
197
+ /* @__PURE__ */ f("button", { onClick: T, className: a(t.siteLink, C(["sm", "md"])), children: [
198
+ /* @__PURE__ */ m(k, { iconKey: "fa-regular fa-sparkles", size: "sm" }),
198
199
  "Model/Serial"
199
200
  ] }),
200
- /* @__PURE__ */ o(b, { href: E, hideAt: ["sm", "md"], children: "Custom Parts" }),
201
- /* @__PURE__ */ o(b, { href: R, hideAt: ["sm", "md"], children: "Contact Us" }),
202
- /* @__PURE__ */ o("div", { className: t.accountArea, children: /* @__PURE__ */ o(
203
- _i,
201
+ /* @__PURE__ */ m(b, { href: E, hideAt: ["sm", "md"], children: "Custom Parts" }),
202
+ /* @__PURE__ */ m(b, { href: R, hideAt: ["sm", "md"], children: "Contact Us" }),
203
+ /* @__PURE__ */ m("div", { className: t.accountArea, children: /* @__PURE__ */ m(
204
+ Ni,
204
205
  {
205
206
  account: F,
206
207
  onLoginClick: ti,
207
208
  className: t.avatar,
208
- popoverContent: mi,
209
+ popoverContent: oi,
209
210
  isAccountLoading: li
210
211
  }
211
212
  ) }),
212
- /* @__PURE__ */ o(
213
- ai,
213
+ /* @__PURE__ */ m(
214
+ _i,
214
215
  {
215
- ref: di,
216
+ ref: fi,
216
217
  cart: h,
217
218
  open: S,
218
- onCartClick: oi
219
+ onCartClick: mi
219
220
  }
220
221
  ),
221
- /* @__PURE__ */ e(ri, { hideAt: ["lg"], children: [
222
- /* @__PURE__ */ e("section", { children: [
223
- /* @__PURE__ */ o(O, { size: "md", weight: "semibold", children: "Useful shortcuts" }),
224
- /* @__PURE__ */ e("ul", { className: t.menuList, children: [
225
- /* @__PURE__ */ o("li", { className: t.menuItem, children: /* @__PURE__ */ e(
222
+ /* @__PURE__ */ f(si, { hideAt: ["lg"], children: [
223
+ /* @__PURE__ */ f("section", { children: [
224
+ /* @__PURE__ */ m(O, { size: "md", weight: "semibold", children: "Useful shortcuts" }),
225
+ /* @__PURE__ */ f("ul", { className: t.menuList, children: [
226
+ /* @__PURE__ */ m("li", { className: t.menuItem, children: /* @__PURE__ */ f(
226
227
  "button",
227
228
  {
228
229
  onClick: T,
229
230
  "data-hamburger-close": "true",
230
- className: k(t.siteLink, t.menuItemAction, P(["lg"])),
231
+ className: a(t.siteLink, t.menuItemAction, C(["lg"])),
231
232
  children: [
232
- /* @__PURE__ */ o(y, { iconKey: "fa-regular fa-sparkles", size: "sm", className: t.shortcutIcon }),
233
+ /* @__PURE__ */ m(k, { iconKey: "fa-regular fa-sparkles", size: "sm", className: t.shortcutIcon }),
233
234
  "Model/Serial"
234
235
  ]
235
236
  }
236
237
  ) }),
237
- /* @__PURE__ */ o("li", { className: t.menuItem, children: /* @__PURE__ */ e(b, { href: E, className: k(t.siteLink, t.menuItemAction), children: [
238
- /* @__PURE__ */ o(y, { iconKey: "fa-regular fa-screwdriver-wrench", size: "sm", className: t.shortcutIcon }),
238
+ /* @__PURE__ */ m("li", { className: t.menuItem, children: /* @__PURE__ */ f(b, { href: E, className: a(t.siteLink, t.menuItemAction), children: [
239
+ /* @__PURE__ */ m(k, { iconKey: "fa-regular fa-screwdriver-wrench", size: "sm", className: t.shortcutIcon }),
239
240
  "Custom Parts"
240
241
  ] }) }),
241
- /* @__PURE__ */ o("li", { className: t.menuItem, children: /* @__PURE__ */ e(b, { href: R, className: k(t.siteLink, t.menuItemAction), children: [
242
- /* @__PURE__ */ o(y, { iconKey: "fa-regular fa-envelope", size: "sm", className: t.shortcutIcon }),
242
+ /* @__PURE__ */ m("li", { className: t.menuItem, children: /* @__PURE__ */ f(b, { href: R, className: a(t.siteLink, t.menuItemAction), children: [
243
+ /* @__PURE__ */ m(k, { iconKey: "fa-regular fa-envelope", size: "sm", className: t.shortcutIcon }),
243
244
  "Contact Us"
244
245
  ] }) }),
245
- /* @__PURE__ */ o("li", { className: t.menuItem, children: /* @__PURE__ */ e(b, { href: g, className: k(t.siteLink, t.menuItemAction), children: [
246
- /* @__PURE__ */ o(y, { iconKey: "fa-solid fa-question", size: "sm", className: t.shortcutIcon }),
246
+ /* @__PURE__ */ m("li", { className: t.menuItem, children: /* @__PURE__ */ f(b, { href: V, className: a(t.siteLink, t.menuItemAction), children: [
247
+ /* @__PURE__ */ m(k, { iconKey: "fa-solid fa-question", size: "sm", className: t.shortcutIcon }),
247
248
  "FAQ"
248
249
  ] }) }),
249
- /* @__PURE__ */ o("li", { className: t.menuItem, children: /* @__PURE__ */ e(b, { href: V, className: k(t.siteLink, t.menuItemAction), children: [
250
- /* @__PURE__ */ o(y, { iconKey: "fa-regular fa-people-group", size: "sm", className: t.shortcutIcon }),
250
+ /* @__PURE__ */ m("li", { className: t.menuItem, children: /* @__PURE__ */ f(b, { href: g, className: a(t.siteLink, t.menuItemAction), children: [
251
+ /* @__PURE__ */ m(k, { iconKey: "fa-regular fa-people-group", size: "sm", className: t.shortcutIcon }),
251
252
  "About Us"
252
253
  ] }) })
253
254
  ] })
254
255
  ] }),
255
- /* @__PURE__ */ e("section", { children: [
256
- /* @__PURE__ */ o(O, { size: "md", weight: "semibold", children: "Shop by category" }),
257
- /* @__PURE__ */ o("ul", { className: t.menuList, children: A && A.map((i) => /* @__PURE__ */ o("li", { className: t.category, children: /* @__PURE__ */ e(
256
+ /* @__PURE__ */ f("section", { children: [
257
+ /* @__PURE__ */ m(O, { size: "md", weight: "semibold", children: "Shop by category" }),
258
+ /* @__PURE__ */ m("ul", { className: t.menuList, children: A && A.map((i) => /* @__PURE__ */ m("li", { className: t.category, children: /* @__PURE__ */ f(
258
259
  U,
259
260
  {
260
261
  href: i.route,
261
262
  className: t.categoryLink,
262
263
  onClick: () => K == null ? void 0 : K(i),
263
264
  children: [
264
- /* @__PURE__ */ o(O, { size: "sm", children: i.label }),
265
- /* @__PURE__ */ o(
266
- y,
265
+ /* @__PURE__ */ m(O, { size: "sm", children: i.label }),
266
+ /* @__PURE__ */ m(
267
+ k,
267
268
  {
268
269
  iconKey: "fa-solid fa-chevron-right",
269
270
  title: "Navigate",
@@ -281,8 +282,8 @@ import '../../assets/MainNav.css';const yi = "_main_12974_1", ki = "_column_1297
281
282
  ]
282
283
  }
283
284
  ),
284
- /* @__PURE__ */ o(z, { flexDirection: "row", hideAt: ["md", "lg"], className: t.mobileSearch, children: /* @__PURE__ */ e("div", { className: t.search, children: [
285
- /* @__PURE__ */ o(
285
+ /* @__PURE__ */ m(u, { flexDirection: "row", hideAt: ["md", "lg"], className: t.mobileSearch, children: /* @__PURE__ */ f("div", { className: t.search, children: [
286
+ /* @__PURE__ */ m(
286
287
  Z,
287
288
  {
288
289
  variant: "search",
@@ -291,59 +292,60 @@ import '../../assets/MainNav.css';const yi = "_main_12974_1", ki = "_column_1297
291
292
  name: "cpc-search",
292
293
  autoComplete: "off",
293
294
  "aria-autocomplete": "list",
294
- "aria-controls": r,
295
- "aria-activedescendant": d >= 0 ? `${r}-${d}` : void 0,
295
+ "aria-controls": s,
296
+ "aria-activedescendant": e >= 0 ? `${s}-${e}` : void 0,
296
297
  ...Q,
297
298
  ref: I,
298
- value: s,
299
- endAdornment: /* @__PURE__ */ e(Y, { children: [
300
- !!s && /* @__PURE__ */ o(
299
+ value: c,
300
+ endAdornment: /* @__PURE__ */ f(Y, { children: [
301
+ !!c && /* @__PURE__ */ m(
301
302
  B,
302
303
  {
303
304
  "aria-label": "Clear search",
304
305
  onMouseDown: (i) => i.preventDefault(),
305
306
  onClick: () => {
306
307
  var i;
307
- N(-1), w == null || w(), (i = I.current) == null || i.focus();
308
+ y(-1), w == null || w(), (i = I.current) == null || i.focus();
308
309
  },
309
310
  iconProps: { iconKey: "fa-regular fa-xmark", size: "sm" }
310
311
  }
311
312
  ),
312
- /* @__PURE__ */ o(
313
+ /* @__PURE__ */ m(
313
314
  B,
314
315
  {
315
316
  "aria-label": "Submit search",
316
- onClick: () => c == null ? void 0 : c(s ?? ""),
317
+ onClick: () => r == null ? void 0 : r(c ?? ""),
317
318
  iconProps: { iconKey: "fa-regular fa-magnifying-glass", size: "sm" }
318
319
  }
319
320
  )
320
321
  ] })
321
322
  }
322
323
  ),
323
- v && m && /* @__PURE__ */ o($, { ...m, activeOptionIndex: d, optionIdPrefix: r, onKeyDown: p, onSuggestionClick: (i) => {
324
- n == null || n((i == null ? void 0 : i.name) ?? s ?? ""), _(!1);
324
+ v && o && /* @__PURE__ */ m($, { ...o, activeOptionIndex: e, optionIdPrefix: s, onKeyDown: z, onSuggestionClick: (i) => {
325
+ var n;
326
+ (n = o.onSuggestionClick) == null || n.call(o, i), d == null || d((i == null ? void 0 : i.name) ?? c ?? ""), N(!1);
325
327
  }, className: t.suggestionDropdown }),
326
- M && /* @__PURE__ */ o(
328
+ M && /* @__PURE__ */ m(
327
329
  $,
328
330
  {
329
331
  terms: [],
330
332
  categories: [],
331
333
  items: [],
332
334
  view: "recent-searches",
333
- recentSearches: a,
335
+ recentSearches: _,
334
336
  onClearRecentSearch: H,
335
- activeOptionIndex: d,
336
- optionIdPrefix: r,
337
- onKeyDown: p,
337
+ activeOptionIndex: e,
338
+ optionIdPrefix: s,
339
+ onKeyDown: z,
338
340
  onSuggestionClick: (i) => {
339
- n == null || n((i == null ? void 0 : i.term) ?? s ?? ""), _(!1);
341
+ d == null || d((i == null ? void 0 : i.term) ?? c ?? ""), N(!1);
340
342
  },
341
343
  className: t.suggestionDropdown
342
344
  }
343
345
  )
344
346
  ] }) }),
345
- /* @__PURE__ */ o(
346
- Ni,
347
+ /* @__PURE__ */ m(
348
+ yi,
347
349
  {
348
350
  categories: A,
349
351
  isCategoriesLoading: ni,
@@ -357,7 +359,7 @@ function b({
357
359
  children: F,
358
360
  ...A
359
361
  }) {
360
- return /* @__PURE__ */ o(U, { href: j, className: t.siteLink, ...A, children: F });
362
+ return /* @__PURE__ */ m(U, { href: j, className: t.siteLink, ...A, children: F });
361
363
  }
362
364
  export {
363
365
  Zi as MainNav
@@ -3,6 +3,7 @@ export type SuggestedCategory = {
3
3
  categoryKey: number;
4
4
  name: string;
5
5
  url: string;
6
+ isBrandCategory?: boolean;
6
7
  };
7
8
  export type SuggestedTerm = {
8
9
  name: string;
@@ -25,10 +26,10 @@ export type RecentSearch = {
25
26
  term: string;
26
27
  url: string;
27
28
  };
28
- type SearchSelection = {
29
+ export type SearchSelection = {
29
30
  name?: string;
30
31
  term?: string;
31
- };
32
+ } & (SuggestedTerm | SuggestedCategory | SuggestedItem | SuggestedCustomPart | RecentSearch);
32
33
  export interface SuggestionDropdownProps {
33
34
  view?: "suggestions" | "recent-searches";
34
35
  terms: SuggestedTerm[];
@@ -44,4 +45,3 @@ export interface SuggestionDropdownProps {
44
45
  className?: string;
45
46
  }
46
47
  export declare function SuggestionDropdown({ terms, categories, items, customParts, view, recentSearches, onClearRecentSearch, onSuggestionClick, activeOptionIndex, optionIdPrefix, onKeyDown, className }: SuggestionDropdownProps): import("react/jsx-runtime").JSX.Element | null;
47
- export {};
@@ -30,20 +30,20 @@ import '../../assets/SuggestionDropdown.css';const z = "_suggestionDropdown_ukyk
30
30
  clearRecentSearch: U
31
31
  };
32
32
  function I({
33
- terms: a,
34
- categories: i,
35
- items: m,
33
+ terms: i,
34
+ categories: a,
35
+ items: g,
36
36
  customParts: _ = [],
37
37
  view: N = "suggestions",
38
38
  recentSearches: k = [],
39
- onClearRecentSearch: g,
39
+ onClearRecentSearch: m,
40
40
  onSuggestionClick: n,
41
41
  activeOptionIndex: r = -1,
42
42
  optionIdPrefix: u,
43
43
  onKeyDown: f,
44
44
  className: L
45
45
  }) {
46
- return a.length === 0 && i.length === 0 && m.length === 0 && _.length === 0 && k.length === 0 ? null : N === "recent-searches" ? /* @__PURE__ */ c(
46
+ return i.length === 0 && a.length === 0 && g.length === 0 && _.length === 0 && k.length === 0 ? null : N === "recent-searches" ? /* @__PURE__ */ c(
47
47
  "div",
48
48
  {
49
49
  id: u,
@@ -72,7 +72,7 @@ function I({
72
72
  type: "button",
73
73
  className: l.clearRecentSearch,
74
74
  "aria-label": `Clear recent search: ${e.term}`,
75
- onClick: () => g == null ? void 0 : g(e),
75
+ onClick: () => m == null ? void 0 : m(e),
76
76
  children: /* @__PURE__ */ t(p, { iconKey: "fa-regular fa-xmark", size: "sm" })
77
77
  }
78
78
  )
@@ -80,10 +80,10 @@ function I({
80
80
  ]
81
81
  }
82
82
  ) : /* @__PURE__ */ c("div", { id: u, role: "listbox", className: o(l.suggestionDropdown, L), onKeyDown: f, onMouseDown: (e) => e.preventDefault(), children: [
83
- (a.length > 0 || i.length > 0 || _.length > 0) && /* @__PURE__ */ c("div", { className: o(l.leftColumn, { [l.leftColumnFullWidth]: m.length === 0 }), children: [
84
- a.length > 0 && /* @__PURE__ */ t("div", { className: o(l.suggestionSection, { [l.suggestionSectionFullHeight]: i.length === 0 }), children: /* @__PURE__ */ c("div", { className: o(l.suggestions, { [l.suggestionsFullHeight]: i.length === 0 }), children: [
83
+ (i.length > 0 || a.length > 0 || _.length > 0) && /* @__PURE__ */ c("div", { className: o(l.leftColumn, { [l.leftColumnFullWidth]: g.length === 0 }), children: [
84
+ i.length > 0 && /* @__PURE__ */ t("div", { className: o(l.suggestionSection, { [l.suggestionSectionFullHeight]: a.length === 0 }), children: /* @__PURE__ */ c("div", { className: o(l.suggestions, { [l.suggestionsFullHeight]: a.length === 0 }), children: [
85
85
  /* @__PURE__ */ t(h, { size: "xxs", colorToken: "quaternary", children: "Suggestions" }),
86
- a.map(
86
+ i.map(
87
87
  (e, s) => /* @__PURE__ */ t(h, { size: "sm", children: /* @__PURE__ */ t(
88
88
  d,
89
89
  {
@@ -98,18 +98,18 @@ function I({
98
98
  ) }, e.url)
99
99
  )
100
100
  ] }) }),
101
- i.length > 0 && /* @__PURE__ */ t("div", { className: l.categorySection, children: /* @__PURE__ */ c("div", { className: l.categories, children: [
101
+ a.length > 0 && /* @__PURE__ */ t("div", { className: l.categorySection, children: /* @__PURE__ */ c("div", { className: l.categories, children: [
102
102
  /* @__PURE__ */ t(h, { size: "xxs", colorToken: "quaternary", children: "Categories" }),
103
- i.map(
103
+ a.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: `${u}-${a.length + s}`,
108
+ id: `${u}-${i.length + s}`,
109
109
  role: "option",
110
- "aria-selected": r === a.length + s,
111
- className: o(l.categoryLink, { [l.activeOption]: r === a.length + s }),
112
- onClick: () => n == null ? void 0 : n(),
110
+ "aria-selected": r === i.length + s,
111
+ className: o(l.categoryLink, { [l.activeOption]: r === i.length + s }),
112
+ onClick: () => n == null ? void 0 : n(e),
113
113
  children: e.name
114
114
  }
115
115
  ) }, e.categoryKey)
@@ -118,7 +118,7 @@ function I({
118
118
  _.length > 0 && /* @__PURE__ */ t("div", { className: l.categorySection, children: /* @__PURE__ */ c("div", { className: l.categories, children: [
119
119
  /* @__PURE__ */ t(h, { size: "xxs", colorToken: "quaternary", children: "Custom Parts" }),
120
120
  _.map((e, s) => {
121
- const y = a.length + i.length + s;
121
+ const y = i.length + a.length + s;
122
122
  return /* @__PURE__ */ c(
123
123
  d,
124
124
  {
@@ -127,7 +127,7 @@ function I({
127
127
  role: "option",
128
128
  "aria-selected": r === y,
129
129
  className: o(l.customPartLink, { [l.activeOption]: r === y }),
130
- onClick: () => n == null ? void 0 : n(),
130
+ onClick: () => n == null ? void 0 : n(e),
131
131
  children: [
132
132
  /* @__PURE__ */ t(p, { iconKey: e.icon, size: "sm" }),
133
133
  /* @__PURE__ */ t(h, { size: "sm", children: e.label })
@@ -138,15 +138,15 @@ function I({
138
138
  })
139
139
  ] }) })
140
140
  ] }),
141
- m.length > 0 && /* @__PURE__ */ t("div", { className: l.rightColumn, children: /* @__PURE__ */ t("ol", { className: l.itemList, children: m.map(
142
- (e, s) => /* @__PURE__ */ t("li", { className: o(l.item, { [l.activeItem]: r === a.length + i.length + _.length + s }), children: /* @__PURE__ */ c(
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]: r === i.length + a.length + _.length + s }), children: /* @__PURE__ */ c(
143
143
  d,
144
144
  {
145
145
  href: e.url,
146
- id: `${u}-${a.length + i.length + _.length + s}`,
146
+ id: `${u}-${i.length + a.length + _.length + s}`,
147
147
  role: "option",
148
- "aria-selected": r === a.length + i.length + _.length + s,
149
- onClick: () => n == null ? void 0 : n(),
148
+ "aria-selected": r === i.length + a.length + _.length + s,
149
+ onClick: () => n == null ? void 0 : n(e),
150
150
  children: [
151
151
  /* @__PURE__ */ t(v, { src: e.image, alt: `${e.description} product image`, height: 72, width: 72 }),
152
152
  /* @__PURE__ */ c("div", { className: l.itemInfo, children: [
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@caseparts-org/caseblocks",
3
3
  "private": false,
4
- "version": "0.0.246",
4
+ "version": "0.0.248",
5
5
  "type": "module",
6
6
  "module": "dist/main.js",
7
7
  "types": "dist/main.d.ts",