@temp-spotwork/ui 1.7.8 → 1.7.9

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.
@@ -11,3 +11,4 @@ export declare const WithLabelColorAlert: Story;
11
11
  export declare const WithLabelColorWarning: Story;
12
12
  export declare const WithLabelColorActive: Story;
13
13
  export declare const WithTotalCount: Story;
14
+ export declare const WithTextClassName: Story;
@@ -1,9 +1,13 @@
1
- import { ProgressBar as o } from "./progress-bar.js";
1
+ import t from "react";
2
+ import { ProgressBar as e } from "./progress-bar.js";
2
3
  import "../../../styles/colors/colors.js";
3
- import { glyphColorsKeys as t } from "../../../styles/colors/colormap.js";
4
- const s = {
4
+ import { glyphColorsKeys as l } from "../../../styles/colors/colormap.js";
5
+ const n = {
5
6
  title: "@spotwork-ui/ProgresBar",
6
- component: o,
7
+ component: e,
8
+ decorators: [
9
+ (o) => t.createElement("div", { style: { width: 100 } }, t.createElement(o))
10
+ ],
7
11
  parameters: {
8
12
  layout: "centered"
9
13
  },
@@ -11,7 +15,7 @@ const s = {
11
15
  argTypes: {
12
16
  labelColor: {
13
17
  control: "select",
14
- options: t,
18
+ options: l,
15
19
  description: 'Custom color for the label. Defaults to "subdued" if not provided.'
16
20
  },
17
21
  progress: {
@@ -27,47 +31,47 @@ const s = {
27
31
  control: "text"
28
32
  }
29
33
  }
30
- }, a = {
34
+ }, c = {
31
35
  args: {
32
36
  progress: 50,
33
37
  total: 100,
34
38
  text: "Filled"
35
39
  }
36
- }, n = {
40
+ }, g = {
37
41
  args: {
38
42
  progress: 75,
39
43
  total: 100,
40
44
  text: "Filled"
41
45
  }
42
- }, i = {
46
+ }, p = {
43
47
  args: {
44
48
  progress: 80,
45
49
  total: 100,
46
50
  text: "Filled",
47
51
  labelColor: "success"
48
52
  }
49
- }, c = {
53
+ }, u = {
50
54
  args: {
51
55
  progress: 30,
52
56
  total: 100,
53
57
  text: "Filled",
54
58
  labelColor: "alert"
55
59
  }
56
- }, g = {
60
+ }, C = {
57
61
  args: {
58
62
  progress: 60,
59
63
  total: 100,
60
64
  text: "Filled",
61
65
  labelColor: "warning"
62
66
  }
63
- }, p = {
67
+ }, d = {
64
68
  args: {
65
69
  progress: 90,
66
70
  total: 100,
67
71
  text: "Filled",
68
72
  labelColor: "active"
69
73
  }
70
- }, u = {
74
+ }, m = {
71
75
  args: {
72
76
  progress: 75,
73
77
  total: 100,
@@ -75,14 +79,24 @@ const s = {
75
79
  hasTotalCount: !0,
76
80
  labelColor: "active"
77
81
  }
82
+ }, b = {
83
+ args: {
84
+ progress: 75,
85
+ total: 100,
86
+ text: "",
87
+ hasTotalCount: !0,
88
+ labelColor: "active",
89
+ textClassName: "flex justify-center items-center"
90
+ }
78
91
  };
79
92
  export {
80
- a as Default,
81
- p as WithLabelColorActive,
82
- c as WithLabelColorAlert,
83
- i as WithLabelColorSuccess,
84
- g as WithLabelColorWarning,
85
- u as WithTotalCount,
86
- n as WithoutLabelColor,
87
- s as default
93
+ c as Default,
94
+ d as WithLabelColorActive,
95
+ u as WithLabelColorAlert,
96
+ p as WithLabelColorSuccess,
97
+ C as WithLabelColorWarning,
98
+ b as WithTextClassName,
99
+ m as WithTotalCount,
100
+ g as WithoutLabelColor,
101
+ n as default
88
102
  };
@@ -30,5 +30,9 @@ export type ProgressBarProps = {
30
30
  * Custom class name for the component
31
31
  */
32
32
  className?: string;
33
+ /**
34
+ * Custom class name for the text label
35
+ */
36
+ textClassName?: string;
33
37
  };
34
- export declare function ProgressBar({ progress, total, hasTotalCount, text, swStyle, labelColor, className, }: ProgressBarProps): import("react/jsx-runtime").JSX.Element;
38
+ export declare function ProgressBar({ progress, total, hasTotalCount, text, swStyle, labelColor, className, textClassName, }: ProgressBarProps): import("react/jsx-runtime").JSX.Element;
@@ -1,41 +1,42 @@
1
- import { jsx as a, jsxs as c } from "react/jsx-runtime";
2
- import { Typography as h } from "../../../styles/typography/typography.js";
1
+ import { jsx as d, jsxs as t } from "react/jsx-runtime";
2
+ import { Typography as b } from "../../../styles/typography/typography.js";
3
3
  import "../../../styles/colors/colors.js";
4
- import { surface as b, crusta as B, sun as v, apple as y } from "../../../styles/colors/colormap.js";
4
+ import { surface as B, crusta as v, sun as y, apple as N } from "../../../styles/colors/colormap.js";
5
5
  import { getStyles as $ } from "./styles.js";
6
6
  import { t as o } from "../../../../bundle-mjs-BjFsLjkg.js";
7
- function P({
7
+ function W({
8
8
  progress: e,
9
9
  total: r,
10
- hasTotalCount: n = !1,
11
- text: l = "Filled",
10
+ hasTotalCount: l = !1,
11
+ text: n = "Filled",
12
12
  swStyle: m = 1,
13
13
  labelColor: u,
14
- className: p
14
+ className: p,
15
+ textClassName: f
15
16
  }) {
16
- const s = e && r > 0 ? e / r * 100 : 0, i = 100 - s, f = s <= 33.99 ? b.badge : s <= 66.99 ? B[400] : s <= 99.99 ? v[400] : y[600], g = (n ? `${e > r ? r : e}/${r}` : `${e > r ? r : e}`) + " " + l, t = u ?? "subdued", d = $();
17
- return /* @__PURE__ */ a("div", { children: /* @__PURE__ */ c("div", { className: o(d.container, p), children: [
18
- /* @__PURE__ */ a(h, { swStyle: m, color: t, children: g }),
19
- /* @__PURE__ */ c("div", { className: d.chartBox, children: [
20
- /* @__PURE__ */ a(
17
+ const s = e && r > 0 ? e / r * 100 : 0, i = 100 - s, g = s <= 33.99 ? B.badge : s <= 66.99 ? v[400] : s <= 99.99 ? y[400] : N[600], h = (l ? `${e > r ? r : e}/${r}` : `${e > r ? r : e}`) + " " + n, c = u ?? "subdued", a = $();
18
+ return /* @__PURE__ */ d("div", { children: /* @__PURE__ */ t("div", { className: o(a.container, p), children: [
19
+ /* @__PURE__ */ d(b, { swStyle: m, className: f, color: c, children: h }),
20
+ /* @__PURE__ */ t("div", { className: a.chartBox, children: [
21
+ /* @__PURE__ */ d(
21
22
  "div",
22
23
  {
23
24
  "data-testid": "progress-bar",
24
- style: { width: `${s}%`, background: f },
25
+ style: { width: `${s}%`, background: g },
25
26
  className: o(
26
- d.progressBar,
27
+ a.progressBar,
27
28
  s >= 100 ? "rounded-r-[0.3rem] rounded-l-[0.3rem]" : "rounded-l-[0.3rem]"
28
29
  )
29
30
  }
30
31
  ),
31
- /* @__PURE__ */ a(
32
+ /* @__PURE__ */ d(
32
33
  "div",
33
34
  {
34
35
  "data-testid": "unfilled-progress-bar",
35
36
  style: { width: `${i}%` },
36
37
  className: o(
37
- d.progressBar,
38
- t === "active" ? "bg-progressBar-trackActive" : "bg-progressBar-trackDefault",
38
+ a.progressBar,
39
+ c === "active" ? "bg-progressBar-trackActive" : "bg-progressBar-trackDefault",
39
40
  i >= 100 ? "rounded-[0.3rem]" : "rounded-r-[0.3rem]"
40
41
  )
41
42
  }
@@ -44,5 +45,5 @@ function P({
44
45
  ] }) });
45
46
  }
46
47
  export {
47
- P as ProgressBar
48
+ W as ProgressBar
48
49
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@temp-spotwork/ui",
3
3
  "private": false,
4
- "version": "1.7.8",
4
+ "version": "1.7.9",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",
7
7
  "types": "dist/main.d.ts",