@caseparts-org/caseblocks 0.0.211 → 0.0.213

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
- ._availability_9rzvh_1{font-style:italic}._tooltipContent_9rzvh_5{max-width:370px}._tooltipContent_9rzvh_5>ul{padding:0;margin:var(--spacing-spacing-2xs) 0}._tooltipContent_9rzvh_5 li{list-style:none}._available_9rzvh_18,._in-stock_9rzvh_18{color:var(--color-alerts-success)}._limited_9rzvh_21{color:var(--color-alerts-warning)}._discontinued_9rzvh_24{color:var(--color-alerts-error-warning)}
1
+ ._availability_kb59t_1{font-style:italic}._pointer_kb59t_5{cursor:pointer}._tooltip_kb59t_9{background-color:#fafafa}._tooltipContent_kb59t_13{max-width:370px}._tooltipContent_kb59t_13>ul{padding:0;margin:var(--spacing-spacing-2xs) 0}._tooltipContent_kb59t_13 li{list-style:none}._available_kb59t_26,._in-stock_kb59t_26{color:var(--color-alerts-success)}._limited_kb59t_29{color:var(--color-alerts-warning)}._discontinued_kb59t_32{color:var(--color-alerts-error-warning)}
@@ -0,0 +1 @@
1
+ ._progressBar-section_w0n30_1{width:500px;display:grid;gap:var(--spacing-spacing-2xs)}._progressBar-cell_w0n30_11{width:90px;display:flex;align-items:center;gap:var(--spacing-spacing-2xs)}._progressBar-cell_w0n30_11>._track_w0n30_25{height:8px}._progressBar-section_w0n30_1>._track_w0n30_25{height:24px}._track_w0n30_25{border:1px solid var(--border-border-primary);border-radius:28px;width:100%;display:flex;flex-direction:row;overflow:hidden;background-color:var(--color-neutrals-neutral-1)}._completed_w0n30_59{background-color:var(--color-alerts-success);height:100%}._inProgress_w0n30_69{background-color:var(--color-alerts-caution-tips);height:100%}._completed_w0n30_59,._completedFull_w0n30_81,._inProgress_w0n30_69{transition:width .8s ease}._labels_w0n30_91{display:flex;flex-direction:row;justify-content:flex-start;gap:var(--spacing-spacing-default)}._labelContainer_w0n30_105{display:flex;flex-direction:row;gap:4px}
@@ -1,6 +1,6 @@
1
- import { ReactNode } from 'react';
1
+ import { default as React, ReactNode } from 'react';
2
2
  import { TextColorToken } from '../Text/Text';
3
- export interface PillProps {
3
+ export interface PillProps extends React.HTMLAttributes<HTMLSpanElement> {
4
4
  children: ReactNode;
5
5
  colorToken?: "neutral" | "secondary" | "caution-tips" | "warning" | "success" | "error-warning";
6
6
  customColor?: string;
@@ -8,4 +8,4 @@ export interface PillProps {
8
8
  size: "xs" | "sm" | "md";
9
9
  className?: string;
10
10
  }
11
- export declare function Pill({ children, colorToken, textColorToken, customColor, size, className }: PillProps): import("react/jsx-runtime").JSX.Element;
11
+ export declare function Pill({ colorToken, textColorToken, customColor, size, className, children, ...otherProps }: PillProps): import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,8 @@
1
1
  import { jsx as i } from "react/jsx-runtime";
2
- import { Text as s } from "../Text/Text.js";
3
- import { c as m } from "../../clsx-OuTLNxxd.js";
4
- import '../../assets/Pill.css';const d = "_pill_1dm0w_1", l = {
5
- pill: d,
2
+ import { Text as m } from "../Text/Text.js";
3
+ import { c as d } from "../../clsx-OuTLNxxd.js";
4
+ import '../../assets/Pill.css';const t = "_pill_1dm0w_1", l = {
5
+ pill: t,
6
6
  "pill-xs": "_pill-xs_1dm0w_17",
7
7
  "pill-sm": "_pill-sm_1dm0w_25",
8
8
  "pill-md": "_pill-md_1dm0w_33",
@@ -13,21 +13,30 @@ import '../../assets/Pill.css';const d = "_pill_1dm0w_1", l = {
13
13
  "pill-color-success": "_pill-color-success_1dm0w_73",
14
14
  "pill-color-error-warning": "_pill-color-error-warning_1dm0w_81"
15
15
  };
16
- function w({ children: p, colorToken: _ = "neutral", textColorToken: c, customColor: o, size: r, className: n }) {
16
+ function u({
17
+ colorToken: p = "neutral",
18
+ textColorToken: _,
19
+ customColor: o,
20
+ size: r,
21
+ className: c,
22
+ children: n,
23
+ ...s
24
+ }) {
17
25
  return /* @__PURE__ */ i(
18
26
  "span",
19
27
  {
20
- className: m(
28
+ className: d(
21
29
  l.pill,
22
- l[`pill-color-${_}`],
30
+ l[`pill-color-${p}`],
23
31
  l[`pill-${r}`],
24
- n
32
+ c
25
33
  ),
26
34
  style: o ? { background: o } : void 0,
27
- children: /* @__PURE__ */ i(s, { size: r, colorToken: c, children: p })
35
+ ...s,
36
+ children: /* @__PURE__ */ i(m, { size: r, colorToken: _, children: n })
28
37
  }
29
38
  );
30
39
  }
31
40
  export {
32
- w as Pill
41
+ u as Pill
33
42
  };
@@ -1,67 +1,70 @@
1
- import { jsx as l, jsxs as s, Fragment as p } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as o, Fragment as m } from "react/jsx-runtime";
2
2
  import { c as _ } from "../../clsx-OuTLNxxd.js";
3
- import { Text as t } from "../../atoms/Text/Text.js";
4
- import { Tooltip as f } from "../../atoms/Tooltip/Tooltip.js";
5
- import '../../assets/Availability.css';const b = "_availability_9rzvh_1", z = "_tooltipContent_9rzvh_5", g = "_available_9rzvh_18", w = "_limited_9rzvh_21", C = "_discontinued_9rzvh_24", c = {
6
- availability: b,
7
- tooltipContent: z,
8
- available: g,
9
- "in-stock": "_in-stock_9rzvh_18",
10
- limited: w,
11
- discontinued: C
3
+ import { Text as l } from "../../atoms/Text/Text.js";
4
+ import { Tooltip as b } from "../../atoms/Tooltip/Tooltip.js";
5
+ import '../../assets/Availability.css';const k = "_availability_kb59t_1", f = "_pointer_kb59t_5", C = "_tooltip_kb59t_9", g = "_tooltipContent_kb59t_13", w = "_available_kb59t_26", z = "_limited_kb59t_29", S = "_discontinued_kb59t_32", s = {
6
+ availability: k,
7
+ pointer: f,
8
+ tooltip: C,
9
+ tooltipContent: g,
10
+ available: w,
11
+ "in-stock": "_in-stock_kb59t_26",
12
+ limited: z,
13
+ discontinued: S
12
14
  };
13
- function T({
15
+ function L({
14
16
  availId: i,
15
- availDescription: e,
17
+ availDescription: t,
16
18
  availClassName: d,
17
- enableTooltip: r = !1,
19
+ enableTooltip: n = !1,
18
20
  inventory: a
19
21
  }) {
20
- const o = /* @__PURE__ */ l(t, { size: "xs", className: _(c.availability, c[i], d), children: e });
21
- return r && a && i !== "not-found" ? /* @__PURE__ */ l(
22
- f,
22
+ const c = n && a && i !== "not-found", r = /* @__PURE__ */ e(l, { size: "xs", className: _(s.availability, s[i], c ? s.pointer : null, d), children: t });
23
+ return c ? /* @__PURE__ */ e(
24
+ b,
23
25
  {
24
26
  closeDelay: 0,
25
27
  openDelay: 250,
26
28
  position: "top center",
27
- trigger: o,
28
- children: /* @__PURE__ */ l(k, { availabilityId: i, inventory: a })
29
+ trigger: r,
30
+ contentClassName: s.tooltip,
31
+ children: /* @__PURE__ */ e(A, { availabilityId: i, inventory: a })
29
32
  }
30
- ) : o;
33
+ ) : r;
31
34
  }
32
- function k({ availabilityId: i, inventory: e }) {
33
- var r, a, o, n, h, u;
34
- const d = (((r = e == null ? void 0 : e.MPK) == null ? void 0 : r.Unreserved) ?? 0) + (((a = e == null ? void 0 : e.SEA) == null ? void 0 : a.Unreserved) ?? 0) + (((o = e == null ? void 0 : e.STL) == null ? void 0 : o.Unreserved) ?? 0);
35
+ function A({ availabilityId: i, inventory: t }) {
36
+ var n, a, c, r, p, u;
37
+ const d = (((n = t == null ? void 0 : t.MPK) == null ? void 0 : n.Unreserved) ?? 0) + (((a = t == null ? void 0 : t.SEA) == null ? void 0 : a.Unreserved) ?? 0) + (((c = t == null ? void 0 : t.STL) == null ? void 0 : c.Unreserved) ?? 0);
35
38
  if (i === "in-stock" || i === "limited") {
36
- const m = i === "in-stock" ? "Additional quantity will be backordered. If you need more than we have at any one warehouse, a CSR will contact you with options." : "Once our stock is depleted, this item will no longer be available.";
37
- return /* @__PURE__ */ s("div", { className: c.tooltipContent, children: [
38
- /* @__PURE__ */ s(t, { size: "sm", children: [
39
+ const h = i === "in-stock" ? "Additional quantity will be backordered. If you need more than we have at any one warehouse, a CSR will contact you with options." : "Once our stock is depleted, this item will no longer be available.";
40
+ return /* @__PURE__ */ o("div", { className: s.tooltipContent, children: [
41
+ /* @__PURE__ */ o(l, { size: "sm", children: [
39
42
  "We currently have (",
40
43
  d,
41
44
  ") in stock across our three warehouses:"
42
45
  ] }),
43
- /* @__PURE__ */ s("ul", { children: [
44
- /* @__PURE__ */ l("li", { children: /* @__PURE__ */ s(t, { size: "sm", children: [
46
+ /* @__PURE__ */ o("ul", { children: [
47
+ /* @__PURE__ */ e("li", { children: /* @__PURE__ */ o(l, { size: "sm", children: [
45
48
  "(",
46
- ((n = e == null ? void 0 : e.MPK) == null ? void 0 : n.Unreserved) ?? 0,
49
+ ((r = t == null ? void 0 : t.MPK) == null ? void 0 : r.Unreserved) ?? 0,
47
50
  ") Los Angeles"
48
51
  ] }) }),
49
- /* @__PURE__ */ l("li", { children: /* @__PURE__ */ s(t, { size: "sm", children: [
52
+ /* @__PURE__ */ e("li", { children: /* @__PURE__ */ o(l, { size: "sm", children: [
50
53
  "(",
51
- ((h = e == null ? void 0 : e.STL) == null ? void 0 : h.Unreserved) ?? 0,
54
+ ((p = t == null ? void 0 : t.STL) == null ? void 0 : p.Unreserved) ?? 0,
52
55
  ") St. Louis"
53
56
  ] }) }),
54
- /* @__PURE__ */ l("li", { children: /* @__PURE__ */ s(t, { size: "sm", children: [
57
+ /* @__PURE__ */ e("li", { children: /* @__PURE__ */ o(l, { size: "sm", children: [
55
58
  "(",
56
- ((u = e == null ? void 0 : e.SEA) == null ? void 0 : u.Unreserved) ?? 0,
59
+ ((u = t == null ? void 0 : t.SEA) == null ? void 0 : u.Unreserved) ?? 0,
57
60
  ") Seattle"
58
61
  ] }) })
59
62
  ] }),
60
- /* @__PURE__ */ l(t, { size: "sm", children: m })
63
+ /* @__PURE__ */ e(l, { size: "sm", children: h })
61
64
  ] });
62
65
  }
63
- return i === "available" ? /* @__PURE__ */ l("div", { className: c.tooltipContent, children: /* @__PURE__ */ l(t, { size: "sm", children: "While this part is not currently in stock, we will arrange to get it to you asap, and your CSR will keep you advised of the lead time." }) }) : i === "discontinued" ? /* @__PURE__ */ l("div", { className: c.tooltipContent, children: /* @__PURE__ */ l(t, { size: "sm", children: "Unfortunately, this item is no longer available to purchase." }) }) : /* @__PURE__ */ l(p, {});
66
+ return i === "available" ? /* @__PURE__ */ e("div", { className: s.tooltipContent, children: /* @__PURE__ */ e(l, { size: "sm", children: "While this part is not currently in stock, we will arrange to get it to you asap, and your CSR will keep you advised of the lead time." }) }) : i === "discontinued" ? /* @__PURE__ */ e("div", { className: s.tooltipContent, children: /* @__PURE__ */ e(l, { size: "sm", children: "Unfortunately, this item is no longer available to purchase." }) }) : /* @__PURE__ */ e(m, {});
64
67
  }
65
68
  export {
66
- T as Availability
69
+ L as Availability
67
70
  };
@@ -0,0 +1,13 @@
1
+ import { default as React } from 'react';
2
+ export interface ProgressBarProps extends React.HTMLAttributes<HTMLDivElement> {
3
+ kind?: "percent" | "raw";
4
+ completedValue: number;
5
+ inProgressValue?: number;
6
+ totalValue?: number;
7
+ totalLabel?: string;
8
+ completedLabel?: string;
9
+ inProgressLabel?: string;
10
+ variant: "cell" | "section";
11
+ className?: string;
12
+ }
13
+ export declare function ProgressBar({ kind, completedValue, inProgressValue, totalValue, totalLabel, completedLabel, inProgressLabel, variant, className, ...otherProps }: ProgressBarProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,83 @@
1
+ import { jsxs as n, jsx as l } from "react/jsx-runtime";
2
+ import { Text as _ } from "../../atoms/Text/Text.js";
3
+ import { c as f } from "../../clsx-OuTLNxxd.js";
4
+ import '../../assets/ProgressBar.css';const g = "_track_w0n30_25", v = "_completed_w0n30_59", x = "_inProgress_w0n30_69", B = "_completedFull_w0n30_81", N = "_labels_w0n30_91", k = "_labelContainer_w0n30_105", r = {
5
+ "progressBar-section": "_progressBar-section_w0n30_1",
6
+ "progressBar-cell": "_progressBar-cell_w0n30_11",
7
+ track: g,
8
+ completed: v,
9
+ inProgress: x,
10
+ completedFull: B,
11
+ labels: N,
12
+ labelContainer: k
13
+ };
14
+ function z({
15
+ kind: o = "percent",
16
+ completedValue: s,
17
+ inProgressValue: e,
18
+ totalValue: i,
19
+ totalLabel: d,
20
+ completedLabel: p,
21
+ inProgressLabel: h,
22
+ variant: a,
23
+ className: b,
24
+ ...w
25
+ }) {
26
+ let c = 0, t = 0;
27
+ return o === "percent" && (c = s, t = e ?? 0), o === "raw" && i !== void 0 && (c = s / i * 100, e === void 0 && (e = 0), t = e / i * 100), c = Math.min(100, Math.max(0, c)), t = Math.min(100, Math.max(0, t)), /* @__PURE__ */ n(
28
+ "div",
29
+ {
30
+ className: f(
31
+ r.progressBar,
32
+ r[`progressBar-${a}`],
33
+ b
34
+ ),
35
+ ...w,
36
+ children: [
37
+ a === "section" && /* @__PURE__ */ n("div", { className: r.labels, children: [
38
+ /* @__PURE__ */ l(
39
+ m,
40
+ {
41
+ label: d,
42
+ value: i
43
+ }
44
+ ),
45
+ /* @__PURE__ */ l(
46
+ m,
47
+ {
48
+ label: p,
49
+ value: s
50
+ }
51
+ ),
52
+ /* @__PURE__ */ l(
53
+ m,
54
+ {
55
+ label: h,
56
+ value: e
57
+ }
58
+ )
59
+ ] }),
60
+ /* @__PURE__ */ n("div", { className: r.track, children: [
61
+ /* @__PURE__ */ l("div", { className: r.completed, style: { width: `${c}%` } }),
62
+ a === "section" && e !== void 0 && e !== 0 && s < 100 && /* @__PURE__ */ l("div", { className: r.inProgress, style: { width: `${t}%` } })
63
+ ] }),
64
+ a === "cell" && /* @__PURE__ */ n(_, { weight: "semibold", size: "xs", children: [
65
+ s,
66
+ "%"
67
+ ] })
68
+ ]
69
+ }
70
+ );
71
+ }
72
+ function m({ isVisible: o = !0, label: s, value: e }) {
73
+ return !o || !s || !e ? null : /* @__PURE__ */ n("div", { className: r.labelContainer, children: [
74
+ /* @__PURE__ */ n(_, { size: "sm", colorToken: "quaternary", children: [
75
+ s,
76
+ ":"
77
+ ] }),
78
+ /* @__PURE__ */ l(_, { weight: "semibold", size: "sm", children: e })
79
+ ] });
80
+ }
81
+ export {
82
+ z as ProgressBar
83
+ };
@@ -0,0 +1,19 @@
1
+ import { StoryObj } from '@storybook/react-vite';
2
+ import { ProgressBar } from './ProgressBar';
3
+ declare const meta: {
4
+ title: string;
5
+ component: typeof ProgressBar;
6
+ parameters: {
7
+ layout: string;
8
+ };
9
+ tags: string[];
10
+ };
11
+ export default meta;
12
+ type Story = StoryObj<typeof meta>;
13
+ export declare const CellVariant: Story;
14
+ export declare const SectionVariant: Story;
15
+ export declare const SectionAllLabelsUsed: Story;
16
+ export declare const CellZeroPercentProgress: Story;
17
+ export declare const CellHundredPercentProgress: Story;
18
+ export declare const SectionZeroPercentProgress: Story;
19
+ export declare const SectionHundredPercentProgress: Story;
@@ -0,0 +1,69 @@
1
+ import { ProgressBar as e } from "./ProgressBar.js";
2
+ const r = {
3
+ title: "Case Parts/Molecules/ProgressBar",
4
+ component: e,
5
+ parameters: {
6
+ layout: "centered"
7
+ },
8
+ tags: ["autodocs"]
9
+ }, a = {
10
+ args: {
11
+ variant: "cell",
12
+ kind: "percent",
13
+ completedValue: 75
14
+ }
15
+ }, o = {
16
+ args: {
17
+ variant: "section",
18
+ kind: "percent",
19
+ completedValue: 60,
20
+ completedLabel: "Completed"
21
+ }
22
+ }, l = {
23
+ args: {
24
+ variant: "section",
25
+ kind: "raw",
26
+ completedValue: 50,
27
+ inProgressValue: 30,
28
+ totalValue: 120,
29
+ totalLabel: "Total",
30
+ completedLabel: "Completed",
31
+ inProgressLabel: "In progress"
32
+ }
33
+ }, n = {
34
+ args: {
35
+ variant: "cell",
36
+ kind: "percent",
37
+ completedValue: 0
38
+ }
39
+ }, s = {
40
+ args: {
41
+ variant: "cell",
42
+ kind: "percent",
43
+ completedValue: 100
44
+ }
45
+ }, c = {
46
+ args: {
47
+ variant: "section",
48
+ kind: "percent",
49
+ completedValue: 0,
50
+ completedLabel: "Completed"
51
+ }
52
+ }, d = {
53
+ args: {
54
+ variant: "section",
55
+ kind: "percent",
56
+ completedValue: 100,
57
+ completedLabel: "Completed"
58
+ }
59
+ };
60
+ export {
61
+ s as CellHundredPercentProgress,
62
+ a as CellVariant,
63
+ n as CellZeroPercentProgress,
64
+ l as SectionAllLabelsUsed,
65
+ d as SectionHundredPercentProgress,
66
+ o as SectionVariant,
67
+ c as SectionZeroPercentProgress,
68
+ r as default
69
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@caseparts-org/caseblocks",
3
3
  "private": false,
4
- "version": "0.0.211",
4
+ "version": "0.0.213",
5
5
  "type": "module",
6
6
  "module": "dist/main.js",
7
7
  "types": "dist/main.d.ts",