@caseparts-org/caseblocks 0.0.290 → 0.0.291

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,83 +1,81 @@
1
- import { jsxs as n, jsx as l } from "react/jsx-runtime";
2
- import { Text as m } 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 = {
1
+ import { jsxs as i, jsx as s } from "react/jsx-runtime";
2
+ import { Text as _ } from "../../atoms/Text/Text.js";
3
+ import { c as P } from "../../clsx-OuTLNxxd.js";
4
+ import '../../assets/ProgressBar.css';const f = "_track_w0n30_25", x = "_completed_w0n30_59", v = "_inProgress_w0n30_69", B = "_completedFull_w0n30_81", N = "_labels_w0n30_91", u = "_labelContainer_w0n30_105", r = {
5
5
  "progressBar-section": "_progressBar-section_w0n30_1",
6
6
  "progressBar-cell": "_progressBar-cell_w0n30_11",
7
- track: g,
8
- completed: v,
9
- inProgress: x,
7
+ track: f,
8
+ completed: x,
9
+ inProgress: v,
10
10
  completedFull: B,
11
11
  labels: N,
12
- labelContainer: k
12
+ labelContainer: u
13
13
  };
14
- function z({
14
+ function $({
15
15
  kind: o = "percent",
16
- completedValue: s,
17
- inProgressValue: e,
18
- totalValue: i,
19
- totalLabel: _,
20
- completedLabel: p,
16
+ completedValue: e,
17
+ inProgressValue: l,
18
+ totalValue: t,
19
+ totalLabel: p,
20
+ completedLabel: g,
21
21
  inProgressLabel: h,
22
22
  variant: a,
23
23
  className: b,
24
24
  ...w
25
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(
26
+ let n = 0, c = 0;
27
+ const d = l ?? 0;
28
+ return o === "percent" && (n = e, c = d), o === "raw" && t !== void 0 && t > 0 && (n = e / t * 100, c = d / t * 100), n = Math.min(100, Math.max(0, n)), c = Math.min(100, Math.max(0, c)), /* @__PURE__ */ i(
28
29
  "div",
29
30
  {
30
- className: f(
31
+ className: P(
31
32
  r.progressBar,
32
33
  r[`progressBar-${a}`],
33
34
  b
34
35
  ),
35
36
  ...w,
36
37
  children: [
37
- a === "section" && /* @__PURE__ */ n("div", { className: r.labels, children: [
38
- /* @__PURE__ */ l(
39
- d,
38
+ a === "section" && /* @__PURE__ */ i("div", { className: r.labels, children: [
39
+ /* @__PURE__ */ s(
40
+ m,
40
41
  {
41
- label: _,
42
- value: i
42
+ label: p,
43
+ value: t
43
44
  }
44
45
  ),
45
- /* @__PURE__ */ l(
46
- d,
46
+ /* @__PURE__ */ s(
47
+ m,
47
48
  {
48
- label: p,
49
- value: s
49
+ label: g,
50
+ value: e
50
51
  }
51
52
  ),
52
- /* @__PURE__ */ l(
53
- d,
53
+ /* @__PURE__ */ s(
54
+ m,
54
55
  {
55
56
  label: h,
56
- value: e
57
+ value: l
57
58
  }
58
59
  )
59
60
  ] }),
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}%` } })
61
+ /* @__PURE__ */ i("div", { className: r.track, children: [
62
+ /* @__PURE__ */ s("div", { className: r.completed, style: { width: `${n}%` } }),
63
+ a === "section" && c > 0 && n < 100 && /* @__PURE__ */ s("div", { className: r.inProgress, style: { width: `${c}%` } })
63
64
  ] }),
64
- a === "cell" && /* @__PURE__ */ n(m, { weight: "semibold", size: "xs", children: [
65
- s,
66
- "%"
67
- ] })
65
+ a === "cell" && /* @__PURE__ */ s(_, { weight: "semibold", size: "xs", children: o === "percent" ? `${e}%` : e })
68
66
  ]
69
67
  }
70
68
  );
71
69
  }
72
- function d({ isVisible: o = !0, label: s, value: e }) {
73
- return !o || !s || e === void 0 || e === null ? null : /* @__PURE__ */ n("div", { className: r.labelContainer, children: [
74
- /* @__PURE__ */ n(m, { size: "sm", colorToken: "quaternary", children: [
75
- s,
70
+ function m({ isVisible: o = !0, label: e, value: l }) {
71
+ return !o || !e || l === void 0 || l === null ? null : /* @__PURE__ */ i("div", { className: r.labelContainer, children: [
72
+ /* @__PURE__ */ i(_, { size: "sm", colorToken: "quaternary", children: [
73
+ e,
76
74
  ":"
77
75
  ] }),
78
- /* @__PURE__ */ l(m, { weight: "semibold", size: "sm", children: e })
76
+ /* @__PURE__ */ s(_, { weight: "semibold", size: "sm", children: l })
79
77
  ] });
80
78
  }
81
79
  export {
82
- z as ProgressBar
80
+ $ as ProgressBar
83
81
  };
@@ -13,6 +13,7 @@ type Story = StoryObj<typeof meta>;
13
13
  export declare const CellVariant: Story;
14
14
  export declare const SectionVariant: Story;
15
15
  export declare const SectionAllLabelsUsed: Story;
16
+ export declare const SectionPercentWithInProgress: Story;
16
17
  export declare const CellZeroPercentProgress: Story;
17
18
  export declare const CellHundredPercentProgress: Story;
18
19
  export declare const SectionZeroPercentProgress: Story;
@@ -23,26 +23,37 @@ const r = {
23
23
  args: {
24
24
  variant: "section",
25
25
  kind: "raw",
26
- completedValue: 50,
27
- inProgressValue: 30,
28
- totalValue: 120,
26
+ completedValue: 1246,
27
+ inProgressValue: 221,
28
+ totalValue: 8979,
29
29
  totalLabel: "Total",
30
- completedLabel: "Completed",
31
- inProgressLabel: "In progress"
30
+ completedLabel: "Complete",
31
+ inProgressLabel: "In Progress"
32
32
  }
33
33
  }, n = {
34
+ args: {
35
+ variant: "section",
36
+ kind: "percent",
37
+ completedValue: 60,
38
+ inProgressValue: 20,
39
+ totalLabel: "Total",
40
+ totalValue: 100,
41
+ completedLabel: "Complete",
42
+ inProgressLabel: "In Progress"
43
+ }
44
+ }, s = {
34
45
  args: {
35
46
  variant: "cell",
36
47
  kind: "percent",
37
48
  completedValue: 0
38
49
  }
39
- }, s = {
50
+ }, c = {
40
51
  args: {
41
52
  variant: "cell",
42
53
  kind: "percent",
43
54
  completedValue: 100
44
55
  }
45
- }, c = {
56
+ }, i = {
46
57
  args: {
47
58
  variant: "section",
48
59
  kind: "percent",
@@ -58,12 +69,13 @@ const r = {
58
69
  }
59
70
  };
60
71
  export {
61
- s as CellHundredPercentProgress,
72
+ c as CellHundredPercentProgress,
62
73
  a as CellVariant,
63
- n as CellZeroPercentProgress,
74
+ s as CellZeroPercentProgress,
64
75
  l as SectionAllLabelsUsed,
65
76
  d as SectionHundredPercentProgress,
77
+ n as SectionPercentWithInProgress,
66
78
  o as SectionVariant,
67
- c as SectionZeroPercentProgress,
79
+ i as SectionZeroPercentProgress,
68
80
  r as default
69
81
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@caseparts-org/caseblocks",
3
3
  "private": false,
4
- "version": "0.0.290",
4
+ "version": "0.0.291",
5
5
  "type": "module",
6
6
  "module": "dist/main.js",
7
7
  "types": "dist/main.d.ts",