@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
|
|
2
|
-
import { Text as
|
|
3
|
-
import { c as
|
|
4
|
-
import '../../assets/ProgressBar.css';const
|
|
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:
|
|
8
|
-
completed:
|
|
9
|
-
inProgress:
|
|
7
|
+
track: f,
|
|
8
|
+
completed: x,
|
|
9
|
+
inProgress: v,
|
|
10
10
|
completedFull: B,
|
|
11
11
|
labels: N,
|
|
12
|
-
labelContainer:
|
|
12
|
+
labelContainer: u
|
|
13
13
|
};
|
|
14
|
-
function
|
|
14
|
+
function $({
|
|
15
15
|
kind: o = "percent",
|
|
16
|
-
completedValue:
|
|
17
|
-
inProgressValue:
|
|
18
|
-
totalValue:
|
|
19
|
-
totalLabel:
|
|
20
|
-
completedLabel:
|
|
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
|
|
27
|
-
|
|
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:
|
|
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__ */
|
|
38
|
-
/* @__PURE__ */
|
|
39
|
-
|
|
38
|
+
a === "section" && /* @__PURE__ */ i("div", { className: r.labels, children: [
|
|
39
|
+
/* @__PURE__ */ s(
|
|
40
|
+
m,
|
|
40
41
|
{
|
|
41
|
-
label:
|
|
42
|
-
value:
|
|
42
|
+
label: p,
|
|
43
|
+
value: t
|
|
43
44
|
}
|
|
44
45
|
),
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
|
|
46
|
+
/* @__PURE__ */ s(
|
|
47
|
+
m,
|
|
47
48
|
{
|
|
48
|
-
label:
|
|
49
|
-
value:
|
|
49
|
+
label: g,
|
|
50
|
+
value: e
|
|
50
51
|
}
|
|
51
52
|
),
|
|
52
|
-
/* @__PURE__ */
|
|
53
|
-
|
|
53
|
+
/* @__PURE__ */ s(
|
|
54
|
+
m,
|
|
54
55
|
{
|
|
55
56
|
label: h,
|
|
56
|
-
value:
|
|
57
|
+
value: l
|
|
57
58
|
}
|
|
58
59
|
)
|
|
59
60
|
] }),
|
|
60
|
-
/* @__PURE__ */
|
|
61
|
-
/* @__PURE__ */
|
|
62
|
-
a === "section" &&
|
|
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__ */
|
|
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
|
|
73
|
-
return !o || !
|
|
74
|
-
/* @__PURE__ */
|
|
75
|
-
|
|
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__ */
|
|
76
|
+
/* @__PURE__ */ s(_, { weight: "semibold", size: "sm", children: l })
|
|
79
77
|
] });
|
|
80
78
|
}
|
|
81
79
|
export {
|
|
82
|
-
|
|
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:
|
|
27
|
-
inProgressValue:
|
|
28
|
-
totalValue:
|
|
26
|
+
completedValue: 1246,
|
|
27
|
+
inProgressValue: 221,
|
|
28
|
+
totalValue: 8979,
|
|
29
29
|
totalLabel: "Total",
|
|
30
|
-
completedLabel: "
|
|
31
|
-
inProgressLabel: "In
|
|
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
|
-
},
|
|
50
|
+
}, c = {
|
|
40
51
|
args: {
|
|
41
52
|
variant: "cell",
|
|
42
53
|
kind: "percent",
|
|
43
54
|
completedValue: 100
|
|
44
55
|
}
|
|
45
|
-
},
|
|
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
|
-
|
|
72
|
+
c as CellHundredPercentProgress,
|
|
62
73
|
a as CellVariant,
|
|
63
|
-
|
|
74
|
+
s as CellZeroPercentProgress,
|
|
64
75
|
l as SectionAllLabelsUsed,
|
|
65
76
|
d as SectionHundredPercentProgress,
|
|
77
|
+
n as SectionPercentWithInProgress,
|
|
66
78
|
o as SectionVariant,
|
|
67
|
-
|
|
79
|
+
i as SectionZeroPercentProgress,
|
|
68
80
|
r as default
|
|
69
81
|
};
|