@caseparts-org/caseblocks 0.0.212 → 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.
@@ -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
  };
@@ -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.212",
4
+ "version": "0.0.213",
5
5
  "type": "module",
6
6
  "module": "dist/main.js",
7
7
  "types": "dist/main.d.ts",