@caseparts-org/caseblocks 0.0.247 → 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
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@caseparts-org/caseblocks",
3
3
  "private": false,
4
- "version": "0.0.247",
4
+ "version": "0.0.248",
5
5
  "type": "module",
6
6
  "module": "dist/main.js",
7
7
  "types": "dist/main.d.ts",