@caseparts-org/caseblocks 0.0.38 → 0.0.40

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 (43) hide show
  1. package/dist/assets/AddToCart.css +1 -0
  2. package/dist/assets/AnimatedCheckmark.css +1 -0
  3. package/dist/assets/Availability.css +1 -0
  4. package/dist/assets/Button.css +1 -1
  5. package/dist/assets/MainNav.css +1 -1
  6. package/dist/assets/Pricing.css +1 -0
  7. package/dist/assets/Product.css +1 -0
  8. package/dist/assets/QuantityInput.css +1 -1
  9. package/dist/assets/StatefulButton.css +1 -0
  10. package/dist/atoms/Button/Button.js +21 -21
  11. package/dist/atoms/Image/Image.d.ts +21 -0
  12. package/dist/atoms/Image/Image.js +23 -0
  13. package/dist/atoms/Link/Link.d.ts +2 -1
  14. package/dist/atoms/Link/Link.js +40 -39
  15. package/dist/main-client.d.ts +11 -1
  16. package/dist/main-client.js +44 -29
  17. package/dist/main-server.d.ts +4 -0
  18. package/dist/main-server.js +22 -18
  19. package/dist/molecules/AddToCart/AddToCart.d.ts +17 -0
  20. package/dist/molecules/AddToCart/AddToCart.js +64 -0
  21. package/dist/molecules/AddToCart/AddToCart.stories.d.ts +74 -0
  22. package/dist/molecules/AddToCart/AddToCart.stories.js +106 -0
  23. package/dist/molecules/Availability/Availability.d.ts +9 -0
  24. package/dist/molecules/Availability/Availability.js +36 -0
  25. package/dist/molecules/Availability/Availability.stories.d.ts +46 -0
  26. package/dist/molecules/Availability/Availability.stories.js +119 -0
  27. package/dist/molecules/Pricing/Pricing.d.ts +6 -0
  28. package/dist/molecules/Pricing/Pricing.js +15 -0
  29. package/dist/molecules/Pricing/Pricing.stories.d.ts +43 -0
  30. package/dist/molecules/Pricing/Pricing.stories.js +49 -0
  31. package/dist/molecules/QuantityInput/QuantityInput.js +29 -29
  32. package/dist/molecules/StatefulButton/AnimatedCheckmark.d.ts +6 -0
  33. package/dist/molecules/StatefulButton/AnimatedCheckmark.js +60 -0
  34. package/dist/molecules/StatefulButton/StatefulButton.d.ts +16 -0
  35. package/dist/molecules/StatefulButton/StatefulButton.js +37 -0
  36. package/dist/molecules/StatefulButton/StatefulButton.stories.d.ts +64 -0
  37. package/dist/molecules/StatefulButton/StatefulButton.stories.js +66 -0
  38. package/dist/organisms/MainNav/MainNav.js +21 -21
  39. package/dist/organisms/Product/Product.d.ts +22 -0
  40. package/dist/organisms/Product/Product.js +113 -0
  41. package/dist/organisms/Product/Product.stories.d.ts +79 -0
  42. package/dist/organisms/Product/Product.stories.js +110 -0
  43. package/package.json +1 -1
@@ -0,0 +1,106 @@
1
+ import { AddToCart as o } from "./AddToCart.js";
2
+ const i = {
3
+ title: "Case Parts/Molecules/AddToCart",
4
+ component: o,
5
+ parameters: { layout: "centered" },
6
+ argTypes: {
7
+ itemKey: {
8
+ control: "number",
9
+ description: "Unique item identifier passed to onAdd"
10
+ },
11
+ initialQuantity: {
12
+ control: "number",
13
+ description: "Initial quantity (clamped by min/max)"
14
+ },
15
+ min: {
16
+ control: "number",
17
+ description: "Minimum quantity"
18
+ },
19
+ max: {
20
+ control: "number",
21
+ description: "Maximum quantity (optional)"
22
+ },
23
+ onQuantityChange: {
24
+ action: "quantityChanged",
25
+ description: "(q:number) fired when quantity changes"
26
+ },
27
+ onAdd: {
28
+ description: "(itemKey, quantity) invoked when Add clicked (can return Promise)"
29
+ },
30
+ autoHideDelayMs: {
31
+ control: "number",
32
+ description: 'Milliseconds before "Added!" state resets'
33
+ },
34
+ showQuantity: {
35
+ control: "boolean",
36
+ description: "Show/hide quantity input"
37
+ },
38
+ buttonText: {
39
+ control: "text",
40
+ description: "Label before add completes"
41
+ },
42
+ buttonDoneText: {
43
+ control: "text",
44
+ description: "Label after add completes"
45
+ },
46
+ className: { control: "text" },
47
+ addButtonClassName: { control: "text" }
48
+ },
49
+ args: {
50
+ itemKey: 101,
51
+ initialQuantity: 1,
52
+ min: 1,
53
+ max: void 0,
54
+ autoHideDelayMs: 2500,
55
+ showQuantity: !0,
56
+ buttonText: "Add",
57
+ buttonDoneText: "Added!",
58
+ onAdd: async (t, e) => {
59
+ await new Promise((n) => setTimeout(n, 600)), alert(`Added (story default):${JSON.stringify({ itemKey: t, quantity: e })}`);
60
+ }
61
+ },
62
+ tags: ["autodocs"]
63
+ }, s = {}, d = {
64
+ name: "Without Quantity Input",
65
+ args: {
66
+ showQuantity: !1
67
+ }
68
+ }, r = {
69
+ name: "With Max Constraint",
70
+ args: {
71
+ max: 5,
72
+ initialQuantity: 3
73
+ }
74
+ }, u = {
75
+ args: {
76
+ buttonText: "Add to Cart",
77
+ buttonDoneText: "In Cart"
78
+ }
79
+ }, c = {
80
+ name: "Async (Simulated Slow)",
81
+ args: {
82
+ onAdd: async (t, e) => {
83
+ await new Promise((n) => setTimeout(n, 1800)), console.log("Slow add complete:", { itemKey: t, quantity: e });
84
+ }
85
+ },
86
+ parameters: {
87
+ docs: {
88
+ description: {
89
+ story: "Simulates a slower network add (1.8s) before showing the completed state."
90
+ }
91
+ }
92
+ }
93
+ }, l = {
94
+ args: {
95
+ autoHideDelayMs: 5e3
96
+ }
97
+ };
98
+ export {
99
+ c as AsyncSlowAdd,
100
+ l as CustomAutoHideDelay,
101
+ u as CustomTexts,
102
+ s as Default,
103
+ d as HiddenQuantity,
104
+ r as WithMaxConstraint,
105
+ i as default
106
+ };
@@ -0,0 +1,9 @@
1
+ export type ContactUsLinkBehavior = "same-tab" | "new-tab";
2
+ export interface AvailabilityProps {
3
+ availId: string;
4
+ availDescription: string;
5
+ contactHref: string;
6
+ contactLinkBehavior: ContactUsLinkBehavior;
7
+ availClassName?: string;
8
+ }
9
+ export declare function Availability({ availId: id, availDescription: description, contactHref, contactLinkBehavior, availClassName: className }: AvailabilityProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,36 @@
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import { c as o } from "../../clsx-OuTLNxxd.js";
3
+ import { Text as s } from "../../atoms/Text/Text.js";
4
+ import { Link as c } from "../../atoms/Link/Link.js";
5
+ import '../../assets/Availability.css';const m = "_availability_jaqg4_1", _ = "_availabilityLink_jaqg4_4", y = "_available_jaqg4_8", f = "_limited_jaqg4_11", d = "_unavailable_jaqg4_14", a = {
6
+ availability: m,
7
+ availabilityLink: _,
8
+ available: y,
9
+ limited: f,
10
+ unavailable: d
11
+ };
12
+ function p({
13
+ availId: i,
14
+ availDescription: l,
15
+ contactHref: v,
16
+ contactLinkBehavior: r,
17
+ availClassName: t
18
+ }) {
19
+ const e = r === "new-tab";
20
+ if (i === "contact")
21
+ return /* @__PURE__ */ n(
22
+ c,
23
+ {
24
+ target: e ? "_blank" : void 0,
25
+ rel: e ? "noopener noreferrer" : void 0,
26
+ className: o(a.availabilityLink, t),
27
+ href: v,
28
+ children: l
29
+ }
30
+ );
31
+ const b = i === "available" ? a.available : i === "limited" ? a.limited : a.unavailable;
32
+ return /* @__PURE__ */ n(s, { size: "xs", className: o(a.availability, b, t), children: l });
33
+ }
34
+ export {
35
+ p as Availability
36
+ };
@@ -0,0 +1,46 @@
1
+ import { StoryObj } from '@storybook/react';
2
+ import { AvailabilityProps, ContactUsLinkBehavior } from './Availability';
3
+ declare const meta: {
4
+ title: string;
5
+ component: (props: AvailabilityProps) => import("react/jsx-runtime").JSX.Element;
6
+ parameters: {
7
+ layout: string;
8
+ };
9
+ argTypes: {
10
+ availId: {
11
+ control: {
12
+ type: "select";
13
+ };
14
+ options: string[];
15
+ description: string;
16
+ };
17
+ availDescription: {
18
+ control: "text";
19
+ description: string;
20
+ };
21
+ contactHref: {
22
+ control: "text";
23
+ description: string;
24
+ };
25
+ contactLinkBehavior: {
26
+ control: {
27
+ type: "inline-radio";
28
+ };
29
+ options: ContactUsLinkBehavior[];
30
+ description: string;
31
+ };
32
+ availClassName: {
33
+ control: "text";
34
+ description: string;
35
+ };
36
+ };
37
+ args: AvailabilityProps;
38
+ tags: string[];
39
+ };
40
+ export default meta;
41
+ type Story = StoryObj<typeof meta>;
42
+ export declare const Available: Story;
43
+ export declare const Limited: Story;
44
+ export declare const Unavailable: Story;
45
+ export declare const ContactSameTab: Story;
46
+ export declare const ContactNewTab: Story;
@@ -0,0 +1,119 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { Availability as e } from "./Availability.js";
3
+ const i = (a) => /* @__PURE__ */ t(e, { ...a }), c = {
4
+ title: "Case Parts/Molecules/Availability",
5
+ component: i,
6
+ parameters: {
7
+ layout: "centered"
8
+ },
9
+ argTypes: {
10
+ availId: {
11
+ control: { type: "select" },
12
+ options: ["available", "limited", "unavailable", "contact"],
13
+ description: "Determines variant / rendering mode"
14
+ },
15
+ availDescription: {
16
+ control: "text",
17
+ description: "Displayed text content"
18
+ },
19
+ contactHref: {
20
+ control: "text",
21
+ description: 'Href for the contact link (used only when id === "contact")'
22
+ },
23
+ contactLinkBehavior: {
24
+ control: { type: "inline-radio" },
25
+ options: ["same-tab", "new-tab"],
26
+ description: "Whether the contact link opens in the same or new tab"
27
+ },
28
+ availClassName: {
29
+ control: "text",
30
+ description: "Optional custom className"
31
+ }
32
+ },
33
+ args: {
34
+ // Default (can be overridden in each story)
35
+ availId: "available",
36
+ availDescription: "Available",
37
+ contactHref: "/contact",
38
+ contactLinkBehavior: "same-tab",
39
+ availClassName: ""
40
+ },
41
+ tags: ["autodocs"]
42
+ }, s = {
43
+ name: "Available",
44
+ args: {
45
+ availId: "available",
46
+ availDescription: "In stock"
47
+ },
48
+ parameters: {
49
+ docs: {
50
+ description: {
51
+ story: "Shows the green / positive availability state."
52
+ }
53
+ }
54
+ }
55
+ }, r = {
56
+ name: "Limited",
57
+ args: {
58
+ availId: "limited",
59
+ availDescription: "Limited stock"
60
+ },
61
+ parameters: {
62
+ docs: {
63
+ description: {
64
+ story: "Shows the limited / caution state."
65
+ }
66
+ }
67
+ }
68
+ }, l = {
69
+ name: "Unavailable",
70
+ args: {
71
+ availId: "unavailable",
72
+ availDescription: "Out of stock"
73
+ },
74
+ parameters: {
75
+ docs: {
76
+ description: {
77
+ story: "Shows the unavailable / negative state."
78
+ }
79
+ }
80
+ }
81
+ }, p = {
82
+ name: "Contact (Same Tab)",
83
+ args: {
84
+ availId: "contact",
85
+ availDescription: "Contact us for availability",
86
+ contactHref: "/contact",
87
+ contactLinkBehavior: "same-tab"
88
+ },
89
+ parameters: {
90
+ docs: {
91
+ description: {
92
+ story: "Renders a link opening in the current tab."
93
+ }
94
+ }
95
+ }
96
+ }, d = {
97
+ name: "Contact (New Tab)",
98
+ args: {
99
+ availId: "contact",
100
+ availDescription: "Contact us (opens new tab)",
101
+ contactHref: "https://example.com/contact",
102
+ contactLinkBehavior: "new-tab"
103
+ },
104
+ parameters: {
105
+ docs: {
106
+ description: {
107
+ story: 'Renders a link with target="_blank" and rel="noopener noreferrer".'
108
+ }
109
+ }
110
+ }
111
+ };
112
+ export {
113
+ s as Available,
114
+ d as ContactNewTab,
115
+ p as ContactSameTab,
116
+ r as Limited,
117
+ l as Unavailable,
118
+ c as default
119
+ };
@@ -0,0 +1,6 @@
1
+ export interface PricingProps {
2
+ pricingLabel?: string;
3
+ price?: string;
4
+ className?: string;
5
+ }
6
+ export declare function Pricing({ pricingLabel, price, className }: PricingProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { jsxs as c, jsx as i } from "react/jsx-runtime";
2
+ import { c as s } from "../../clsx-OuTLNxxd.js";
3
+ import { Text as n } from "../../atoms/Text/Text.js";
4
+ import '../../assets/Pricing.css';const e = "_pricingInformation_u1dqz_1", m = {
5
+ pricingInformation: e
6
+ };
7
+ function a({ pricingLabel: r, price: o, className: t }) {
8
+ return /* @__PURE__ */ c("div", { className: s(m.pricingInformation, t), children: [
9
+ /* @__PURE__ */ i(n, { size: "xxs", children: r }),
10
+ /* @__PURE__ */ i(n, { size: "lg", weight: "bold", children: o })
11
+ ] });
12
+ }
13
+ export {
14
+ a as Pricing
15
+ };
@@ -0,0 +1,43 @@
1
+ import { StoryObj } from '@storybook/react';
2
+ import { Pricing, PricingProps } from './Pricing';
3
+ /**
4
+ * Stories for Pricing.
5
+ * Simple presentational component showing an optional pricing label (e.g. "Net Price")
6
+ * above (or beside in future) a price value.
7
+ *
8
+ * Props:
9
+ * - pricingLabel?: string (descriptor, e.g. "Net Price", "List Price", "Price")
10
+ * - price?: string (already-formatted currency or value string)
11
+ * - className?: string (custom styling hook)
12
+ *
13
+ * Both props are optional so the component can be composed in flexible layouts.
14
+ */
15
+ declare const meta: {
16
+ title: string;
17
+ component: typeof Pricing;
18
+ parameters: {
19
+ layout: string;
20
+ };
21
+ argTypes: {
22
+ pricingLabel: {
23
+ control: "text";
24
+ description: string;
25
+ };
26
+ price: {
27
+ control: "text";
28
+ description: string;
29
+ };
30
+ className: {
31
+ control: "text";
32
+ description: string;
33
+ };
34
+ };
35
+ args: PricingProps;
36
+ tags: string[];
37
+ };
38
+ export default meta;
39
+ type Story = StoryObj<typeof meta>;
40
+ export declare const Default: Story;
41
+ export declare const LabelOnly: Story;
42
+ export declare const PriceOnly: Story;
43
+ export declare const SaleExample: Story;
@@ -0,0 +1,49 @@
1
+ import { Pricing as e } from "./Pricing.js";
2
+ const r = {
3
+ title: "Case Parts/Molecules/Pricing",
4
+ component: e,
5
+ parameters: { layout: "centered" },
6
+ argTypes: {
7
+ pricingLabel: {
8
+ control: "text",
9
+ description: "Descriptor label above the price"
10
+ },
11
+ price: {
12
+ control: "text",
13
+ description: "Price string (already formatted)"
14
+ },
15
+ className: {
16
+ control: "text",
17
+ description: "Optional custom className"
18
+ }
19
+ },
20
+ args: {
21
+ pricingLabel: "List Price",
22
+ price: "$129.99",
23
+ className: ""
24
+ },
25
+ tags: ["autodocs"]
26
+ }, c = {}, i = {
27
+ args: {
28
+ price: void 0,
29
+ pricingLabel: "List Price"
30
+ }
31
+ }, a = {
32
+ args: {
33
+ pricingLabel: void 0,
34
+ price: "$249.00"
35
+ }
36
+ }, o = {
37
+ name: "Account Example",
38
+ args: {
39
+ pricingLabel: "Net Price",
40
+ price: "$89.00"
41
+ }
42
+ };
43
+ export {
44
+ c as Default,
45
+ i as LabelOnly,
46
+ a as PriceOnly,
47
+ o as SaleExample,
48
+ r as default
49
+ };
@@ -1,39 +1,39 @@
1
- import { jsxs as v, jsx as r } from "react/jsx-runtime";
2
- import { c } from "../../clsx-OuTLNxxd.js";
1
+ import { jsxs as k, jsx as r } from "react/jsx-runtime";
2
+ import { c as a } from "../../clsx-OuTLNxxd.js";
3
3
  import { Icon as l } from "../../atoms/Icon/Icon.js";
4
- import { getHideAtStyles as g } from "../../atoms/HideAt.js";
4
+ import { getHideAtStyles as v } from "../../atoms/HideAt.js";
5
5
  import '../../assets/QuantityInput.css';const s = {
6
- "qty-container": "_qty-container_19ir9_1",
7
- "decrease-btn": "_decrease-btn_19ir9_34",
8
- "increase-btn": "_increase-btn_19ir9_45",
9
- "button-sm": "_button-sm_19ir9_66",
10
- "button-md": "_button-md_19ir9_70",
11
- "qty-input-sm": "_qty-input-sm_19ir9_74",
12
- "qty-input-md": "_qty-input-md_19ir9_78"
6
+ "qty-container": "_qty-container_krcn7_1",
7
+ "decrease-btn": "_decrease-btn_krcn7_35",
8
+ "increase-btn": "_increase-btn_krcn7_46",
9
+ "button-sm": "_button-sm_krcn7_67",
10
+ "button-md": "_button-md_krcn7_71",
11
+ "qty-input-sm": "_qty-input-sm_krcn7_75",
12
+ "qty-input-md": "_qty-input-md_krcn7_79"
13
13
  };
14
- function j({
15
- quantity: i = 1,
14
+ function $({
15
+ quantity: c = 1,
16
16
  onQuantityChange: b,
17
- min: e = 1,
18
- max: n = 9999,
17
+ min: n = 1,
18
+ max: e = 9999,
19
19
  className: d,
20
20
  wrapperClassName: _,
21
21
  hideAt: p,
22
- size: a = "md",
22
+ size: i = "md",
23
23
  ...m
24
24
  }) {
25
- const y = (t) => (e !== void 0 && t < e && (t = e), n !== void 0 && n !== void 0 && t > n && (t = n), t), u = (t) => {
26
- const o = y(Number.isNaN(t) ? e ?? 1 : t);
25
+ const y = (t) => (n !== void 0 && t < n && (t = n), e !== void 0 && e !== void 0 && t > e && (t = e), t), u = (t) => {
26
+ const o = y(Number.isNaN(t) ? n ?? 1 : t);
27
27
  b(o);
28
- }, f = () => u(i - 1), N = () => u(i + 1);
29
- return /* @__PURE__ */ v("div", { className: c(s["qty-container"], g(p), _), children: [
28
+ }, f = () => u(c - 1), N = () => u(c + 1);
29
+ return /* @__PURE__ */ k("div", { className: a(s["qty-container"], v(p), _), children: [
30
30
  /* @__PURE__ */ r(
31
31
  "button",
32
32
  {
33
33
  type: "button",
34
- className: c(s["decrease-btn"], s[`button-${a}`]),
34
+ className: a(s["decrease-btn"], s[`button-${i}`]),
35
35
  onClick: f,
36
- disabled: i <= (e ?? 1),
36
+ disabled: c <= (n ?? 1),
37
37
  "aria-label": "Decrease quantity",
38
38
  children: /* @__PURE__ */ r(l, { iconKey: "fa-solid fa-minus", size: "sm" })
39
39
  }
@@ -41,15 +41,15 @@ function j({
41
41
  /* @__PURE__ */ r(
42
42
  "input",
43
43
  {
44
- className: c(s["qty-input"], s[`qty-input-${a}`], d),
44
+ className: a(s["qty-input"], s[`qty-input-${i}`], d),
45
45
  type: "number",
46
- min: e,
47
- max: n,
48
- value: i,
46
+ min: n,
47
+ max: e,
48
+ value: c,
49
49
  onFocus: (t) => t.currentTarget.select(),
50
50
  onChange: (t) => {
51
51
  const o = parseInt(t.target.value, 10);
52
- u(Number.isNaN(o) ? e ?? 1 : o);
52
+ u(Number.isNaN(o) ? n ?? 1 : o);
53
53
  },
54
54
  "aria-label": "Quantity",
55
55
  ...m
@@ -59,9 +59,9 @@ function j({
59
59
  "button",
60
60
  {
61
61
  type: "button",
62
- className: c(s["increase-btn"], s[`button-${a}`]),
62
+ className: a(s["increase-btn"], s[`button-${i}`]),
63
63
  onClick: N,
64
- disabled: n !== void 0 && i >= n,
64
+ disabled: e !== void 0 && c >= e,
65
65
  "aria-label": "Increase quantity",
66
66
  children: /* @__PURE__ */ r(l, { iconKey: "fa-solid fa-plus", size: "sm" })
67
67
  }
@@ -69,5 +69,5 @@ function j({
69
69
  ] });
70
70
  }
71
71
  export {
72
- j as QuantityInput
72
+ $ as QuantityInput
73
73
  };
@@ -0,0 +1,6 @@
1
+ export interface AnimatedCheckMarkProps {
2
+ size: "xxs" | "xs" | "sm" | "md" | "lg" | "xl";
3
+ circleColor?: string;
4
+ checkColor?: string;
5
+ }
6
+ export declare function AnimatedCheckMark({ size, circleColor, checkColor, }: AnimatedCheckMarkProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,60 @@
1
+ import { jsx as k, jsxs as m } from "react/jsx-runtime";
2
+ import { c as a } from "../../clsx-OuTLNxxd.js";
3
+ import '../../assets/AnimatedCheckmark.css';const s = "_wrapper_ku95m_1", l = "_checkmark__circle_ku95m_8", h = "_stroke_ku95m_1", o = "_checkmark_ku95m_8", t = "_fill_ku95m_1", i = "_scale_ku95m_1", n = "_checkmark__check_ku95m_52", c = {
4
+ wrapper: s,
5
+ checkmark__circle: l,
6
+ stroke: h,
7
+ checkmark: o,
8
+ fill: t,
9
+ scale: i,
10
+ "checkmark-xxs": "_checkmark-xxs_ku95m_27",
11
+ "checkmark-xs": "_checkmark-xs_ku95m_31",
12
+ "checkmark-sm": "_checkmark-sm_ku95m_35",
13
+ "checkmark-md": "_checkmark-md_ku95m_39",
14
+ "checkmark-lg": "_checkmark-lg_ku95m_43",
15
+ "checkmark-xl": "_checkmark-xl_ku95m_47",
16
+ checkmark__check: n
17
+ };
18
+ function d({
19
+ size: e,
20
+ circleColor: r,
21
+ checkColor: _
22
+ // removeMargin
23
+ }) {
24
+ return /* @__PURE__ */ k("div", { style: {
25
+ "--circle-color": r,
26
+ "--check-color": _
27
+ }, children: /* @__PURE__ */ k("div", { className: c.wrapper, children: /* @__PURE__ */ m(
28
+ "svg",
29
+ {
30
+ className: a(c.checkmark, c[`checkmark-${e}`]),
31
+ xmlns: "http://www.w3.org/2000/svg",
32
+ viewBox: "0 0 52 52",
33
+ role: "img",
34
+ "aria-label": "Success",
35
+ children: [
36
+ /* @__PURE__ */ k(
37
+ "circle",
38
+ {
39
+ className: c.checkmark__circle,
40
+ cx: "26",
41
+ cy: "26",
42
+ r: "25",
43
+ fill: "none"
44
+ }
45
+ ),
46
+ /* @__PURE__ */ k(
47
+ "path",
48
+ {
49
+ className: c.checkmark__check,
50
+ fill: "none",
51
+ d: "M14.1 27.2l7.1 7.2 16.7-16.8"
52
+ }
53
+ )
54
+ ]
55
+ }
56
+ ) }) });
57
+ }
58
+ export {
59
+ d as AnimatedCheckMark
60
+ };
@@ -0,0 +1,16 @@
1
+ import { ButtonProps } from '../../atoms/Button/Button';
2
+ export interface StatefulButtonProps extends Omit<ButtonProps, 'children'> {
3
+ /**
4
+ * Whether the "completed" (added) state should be shown.
5
+ */
6
+ completed: boolean;
7
+ /**
8
+ * Label shown before completion.
9
+ */
10
+ text?: string;
11
+ /**
12
+ * Label shown after completion.
13
+ */
14
+ completedText?: string;
15
+ }
16
+ export declare function StatefulButton({ completed, text, completedText, className, size, variant, ...buttonProps }: StatefulButtonProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,37 @@
1
+ import { jsxs as o, Fragment as c, jsx as r } from "react/jsx-runtime";
2
+ import { c as f } from "../../clsx-OuTLNxxd.js";
3
+ import { AnimatedCheckMark as d } from "./AnimatedCheckmark.js";
4
+ import { Button as i } from "../../atoms/Button/Button.js";
5
+ import '../../assets/StatefulButton.css';const p = "_statefulButton_1laml_1", B = {
6
+ statefulButton: p
7
+ };
8
+ function j({
9
+ completed: t,
10
+ text: s = "Add",
11
+ completedText: a = "Added!",
12
+ className: e,
13
+ size: n = "md",
14
+ variant: l = "cta-primary",
15
+ ...m
16
+ }) {
17
+ const u = f(B.statefulButton, e);
18
+ return /* @__PURE__ */ o(
19
+ i,
20
+ {
21
+ size: n,
22
+ variant: l,
23
+ className: u,
24
+ ...m,
25
+ children: [
26
+ !t && s,
27
+ t && /* @__PURE__ */ o(c, { children: [
28
+ /* @__PURE__ */ r(d, { size: n }),
29
+ /* @__PURE__ */ r("p", { children: a })
30
+ ] })
31
+ ]
32
+ }
33
+ );
34
+ }
35
+ export {
36
+ j as StatefulButton
37
+ };