@sps-woodland/progress-indicators 8.51.3 → 8.52.0
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.
- package/README.md +1 -29
- package/lib/index.d.ts +3 -1
- package/lib/index.js +277 -19
- package/lib/index.umd.cjs +9 -9
- package/lib/progress-bar/ProgressBar.css.d.ts +18 -0
- package/lib/progress-bar/ProgressBar.d.ts +12 -0
- package/lib/progress-bar/progress-bar-step/ProgressBarStep.css.d.ts +13 -0
- package/lib/progress-bar/progress-bar-step/ProgressBarStep.d.ts +13 -0
- package/lib/progress-ring/ProgressRing.d.ts +7 -0
- package/lib/style.css +1 -1
- package/package.json +14 -8
- package/vite.config.mjs +13 -6
package/README.md
CHANGED
|
@@ -1,31 +1,3 @@
|
|
|
1
1
|
## [@sps-woodland/progress-indicators](https://github.com/SPSCommerce/woodland/tree/master/packages/@sps-woodland/progress-indicators#readme)
|
|
2
2
|
|
|
3
|
-
SPS Woodland Design System progress indicator components
|
|
4
|
-
|
|
5
|
-
> **Heads up — this is a wrapper package.** The component source now lives in
|
|
6
|
-
> [`@sps-woodland/core`](../react). This package re-exports from the
|
|
7
|
-
> mono-package so existing imports keep working, but new code should prefer the
|
|
8
|
-
> mono-package paths.
|
|
9
|
-
|
|
10
|
-
### Preferred imports (mono-package)
|
|
11
|
-
|
|
12
|
-
```ts
|
|
13
|
-
import { ProgressBar, ProgressBarStep, ProgressRing } from "@sps-woodland/core/progress-indicators";
|
|
14
|
-
// or, per-component:
|
|
15
|
-
import { ProgressBar } from "@sps-woodland/core/progress-bar";
|
|
16
|
-
import { ProgressBarStep } from "@sps-woodland/core/progress-bar-step";
|
|
17
|
-
import { ProgressRing } from "@sps-woodland/core/progress-ring";
|
|
18
|
-
|
|
19
|
-
import "@sps-woodland/core/progress-indicators/style.css";
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
The family name (`progress-indicators`) doesn't collide with any of its
|
|
23
|
-
components, so every component gets a clean flat subpath in addition to the
|
|
24
|
-
barrel.
|
|
25
|
-
|
|
26
|
-
### Legacy imports (still supported)
|
|
27
|
-
|
|
28
|
-
```ts
|
|
29
|
-
import { ProgressBar, ProgressBarStep, ProgressRing } from "@sps-woodland/progress-indicators";
|
|
30
|
-
import "@sps-woodland/progress-indicators/style.css";
|
|
31
|
-
```
|
|
3
|
+
SPS Woodland Design System progress indicator components
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -1,11 +1,266 @@
|
|
|
1
|
-
import { ProgressBar as p, ProgressBarStep as i } from "@sps-woodland/core/progress-indicators";
|
|
2
|
-
export * from "@sps-woodland/core/progress-indicators";
|
|
3
1
|
import * as e from "react";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
2
|
+
import { Metadata as b, useElementId as V, cl as E, Icon as D, selectChildren as x } from "@sps-woodland/core";
|
|
3
|
+
import { Button as F } from "@sps-woodland/buttons";
|
|
4
|
+
import { SpsTooltip as R, SpsTable as C, SpsTableHead as k, SpsTableHeader as m, SpsTableBody as y, SpsTableRow as d, SpsTableCell as r } from "@spscommerce/ds-react";
|
|
5
|
+
import { useWoodlandLanguage as I } from "@spscommerce/i18n";
|
|
6
|
+
import { Tokens as c } from "@sps-woodland/tokens";
|
|
7
|
+
import { code as u } from "@spscommerce/utils";
|
|
8
|
+
function A(s, o, a) {
|
|
9
|
+
return o in s ? Object.defineProperty(s, o, {
|
|
10
|
+
value: a,
|
|
11
|
+
enumerable: !0,
|
|
12
|
+
configurable: !0,
|
|
13
|
+
writable: !0
|
|
14
|
+
}) : s[o] = a, s;
|
|
15
|
+
}
|
|
16
|
+
function N(s, o) {
|
|
17
|
+
var a = Object.keys(s);
|
|
18
|
+
if (Object.getOwnPropertySymbols) {
|
|
19
|
+
var t = Object.getOwnPropertySymbols(s);
|
|
20
|
+
o && (t = t.filter(function(l) {
|
|
21
|
+
return Object.getOwnPropertyDescriptor(s, l).enumerable;
|
|
22
|
+
})), a.push.apply(a, t);
|
|
23
|
+
}
|
|
24
|
+
return a;
|
|
25
|
+
}
|
|
26
|
+
function j(s) {
|
|
27
|
+
for (var o = 1; o < arguments.length; o++) {
|
|
28
|
+
var a = arguments[o] != null ? arguments[o] : {};
|
|
29
|
+
o % 2 ? N(Object(a), !0).forEach(function(t) {
|
|
30
|
+
A(s, t, a[t]);
|
|
31
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(s, Object.getOwnPropertyDescriptors(a)) : N(Object(a)).forEach(function(t) {
|
|
32
|
+
Object.defineProperty(s, t, Object.getOwnPropertyDescriptor(a, t));
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
return s;
|
|
36
|
+
}
|
|
37
|
+
var M = (s, o, a) => {
|
|
38
|
+
for (var t of Object.keys(s)) {
|
|
39
|
+
var l;
|
|
40
|
+
if (s[t] !== ((l = o[t]) !== null && l !== void 0 ? l : a[t]))
|
|
41
|
+
return !1;
|
|
42
|
+
}
|
|
43
|
+
return !0;
|
|
44
|
+
}, f = (s) => (o) => {
|
|
45
|
+
var a = s.defaultClassName, t = j(j({}, s.defaultVariants), o);
|
|
46
|
+
for (var l in t) {
|
|
47
|
+
var n, p = (n = t[l]) !== null && n !== void 0 ? n : s.defaultVariants[l];
|
|
48
|
+
if (p != null) {
|
|
49
|
+
var _ = p;
|
|
50
|
+
typeof _ == "boolean" && (_ = _ === !0 ? "true" : "false");
|
|
51
|
+
var i = (
|
|
52
|
+
// @ts-expect-error
|
|
53
|
+
s.variantClassNames[l][_]
|
|
54
|
+
);
|
|
55
|
+
i && (a += " " + i);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
for (var [h, P] of s.compoundVariants)
|
|
59
|
+
M(h, t, s.defaultVariants) && (a += " " + P);
|
|
60
|
+
return a;
|
|
61
|
+
}, H = "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qme0", W = "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qme1", $ = "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qme2", G = "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qme3", U = "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qme4", Y = f({ defaultClassName: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qme5", variantClassNames: { completed: { true: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qme6", false: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qme7" }, disabled: { true: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qme8", false: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qme9" }, color: { purple: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmea", blue: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmeb", red: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmec", orange: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmed", grey: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmee" } }, defaultVariants: { completed: !1, disabled: !1, color: "purple" }, compoundVariants: [] }), K = f({ defaultClassName: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmef", variantClassNames: { disabled: { true: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmeg", false: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmeh" } }, defaultVariants: { disabled: !1 }, compoundVariants: [] }), L = f({ defaultClassName: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmei", variantClassNames: { completed: { true: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmej", false: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmek" }, disabled: { true: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmel", false: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmem" }, color: { purple: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmen", blue: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmeo", red: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmep", orange: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmeq", grey: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmer" } }, defaultVariants: { completed: !1, disabled: !1, color: "purple" }, compoundVariants: [[{ completed: !0, disabled: !0 }, "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmes"]] }), z = "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmet", J = f({ defaultClassName: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0go0", variantClassNames: { barCompleted: { true: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0go1", false: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0go2" }, disabled: { true: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0go3", false: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0go4" }, color: { purple: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0go5", blue: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0go6", red: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0go7", orange: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0go8", grey: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0go9" } }, defaultVariants: { barCompleted: !1, disabled: !1, color: "purple" }, compoundVariants: [] }), Q = f({ defaultClassName: "", variantClassNames: { barCompleted: { true: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0goa", false: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0gob" }, color: { purple: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0goc", blue: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0god", red: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0goe", orange: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0gof", grey: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0gog" }, disabled: { true: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0goh", false: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0goi" } }, defaultVariants: { barCompleted: !1, color: "purple", disabled: !1 }, compoundVariants: [] }), X = f({ defaultClassName: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0goj", variantClassNames: { stepCompleted: { true: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0gok", false: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0gol" } }, defaultVariants: { stepCompleted: !1 }, compoundVariants: [] }), Z = f({ defaultClassName: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0gom", variantClassNames: { stepCompleted: { true: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0gon", false: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0goo" }, disabled: { true: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0gop", false: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0goq" }, barCompleted: { true: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0gor", false: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0gos" }, color: { purple: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0got", red: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0gou", blue: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0gov", orange: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0gow", grey: "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0gox" } }, defaultVariants: { stepCompleted: !1, disabled: !1, barCompleted: !1, color: "purple" }, compoundVariants: [[{ barCompleted: !0, disabled: !0 }, "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0goy"], [{ barCompleted: !0, disabled: !1 }, "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0goz"], [{ stepCompleted: !0, disabled: !0 }, "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0go10"], [{ barCompleted: !1, disabled: !1, stepCompleted: !0, color: "purple" }, "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0go11"], [{ barCompleted: !1, disabled: !1, stepCompleted: !0, color: "red" }, "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0go12"], [{ barCompleted: !1, disabled: !1, stepCompleted: !0, color: "blue" }, "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0go13"], [{ barCompleted: !1, disabled: !1, stepCompleted: !0, color: "orange" }, "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0go14"], [{ barCompleted: !1, disabled: !1, stepCompleted: !0, color: "grey" }, "pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0go15"]] });
|
|
62
|
+
function S({
|
|
63
|
+
className: s,
|
|
64
|
+
title: o,
|
|
65
|
+
description: a,
|
|
66
|
+
icon: t,
|
|
67
|
+
complete: l = !1,
|
|
68
|
+
disabled: n,
|
|
69
|
+
barCompleted: p,
|
|
70
|
+
progressColor: _,
|
|
71
|
+
...i
|
|
72
|
+
}) {
|
|
73
|
+
const h = V().current || void 0;
|
|
74
|
+
return /* @__PURE__ */ e.createElement(
|
|
75
|
+
"li",
|
|
76
|
+
{
|
|
77
|
+
id: h,
|
|
78
|
+
className: E(
|
|
79
|
+
Z({
|
|
80
|
+
stepCompleted: l,
|
|
81
|
+
disabled: n,
|
|
82
|
+
barCompleted: p,
|
|
83
|
+
color: _
|
|
84
|
+
}),
|
|
85
|
+
s
|
|
86
|
+
),
|
|
87
|
+
...i
|
|
88
|
+
},
|
|
89
|
+
t && /* @__PURE__ */ e.createElement(
|
|
90
|
+
D,
|
|
91
|
+
{
|
|
92
|
+
icon: t,
|
|
93
|
+
size: "sm",
|
|
94
|
+
className: X({
|
|
95
|
+
stepCompleted: l
|
|
96
|
+
})
|
|
97
|
+
}
|
|
98
|
+
),
|
|
99
|
+
o && h && /* @__PURE__ */ e.createElement(R, { for: h, title: o }, a)
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
b.set(S, {
|
|
103
|
+
name: "ProgressBarStep",
|
|
104
|
+
props: {
|
|
105
|
+
icon: { type: "IconName" },
|
|
106
|
+
complete: { type: "boolean" },
|
|
107
|
+
title: { type: "string" },
|
|
108
|
+
description: { type: "string" }
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
function T({
|
|
112
|
+
className: s,
|
|
113
|
+
children: o,
|
|
114
|
+
detail: a,
|
|
115
|
+
disabled: t,
|
|
116
|
+
onClose: l,
|
|
117
|
+
percentComplete: n = 0,
|
|
118
|
+
title: p,
|
|
119
|
+
showStepsCounter: _,
|
|
120
|
+
progressColor: i = "purple",
|
|
121
|
+
...h
|
|
122
|
+
}) {
|
|
123
|
+
const { t: P } = I(), [w, q] = e.useState([]), [g] = x(o, [
|
|
124
|
+
{ type: S }
|
|
125
|
+
]);
|
|
126
|
+
e.useEffect(() => {
|
|
127
|
+
let v = [];
|
|
128
|
+
g.forEach((B) => {
|
|
129
|
+
B.hasOwnProperty("props") && B.props.complete === !0 && v.push(B), q(v);
|
|
130
|
+
});
|
|
131
|
+
}, []), n && g && console.warn(
|
|
132
|
+
[
|
|
133
|
+
"The percentComplete prop can't be used with the ProgressBarStep subcomponent.",
|
|
134
|
+
"The progress will be determined by how many nested ProgressBarStep components have the completed prop."
|
|
135
|
+
].join(" ")
|
|
136
|
+
);
|
|
137
|
+
const O = e.Children.map(o, (v) => e.isValidElement(v) ? e.cloneElement(v, {
|
|
138
|
+
disabled: t,
|
|
139
|
+
barCompleted: w.length === g.length,
|
|
140
|
+
progressColor: i
|
|
141
|
+
}) : v);
|
|
142
|
+
return /* @__PURE__ */ e.createElement("div", { className: E(H, s), ...h }, /* @__PURE__ */ e.createElement("div", { className: W }, p && /* @__PURE__ */ e.createElement("div", { className: G }, /* @__PURE__ */ e.createElement("div", { className: U }, p), g.length > 0 ? /* @__PURE__ */ e.createElement(e.Fragment, null, _ === !0 && /* @__PURE__ */ e.createElement(
|
|
143
|
+
"div",
|
|
144
|
+
{
|
|
145
|
+
className: J({
|
|
146
|
+
barCompleted: w.length === g.length,
|
|
147
|
+
disabled: t,
|
|
148
|
+
color: i
|
|
149
|
+
})
|
|
150
|
+
},
|
|
151
|
+
`${w.length} of ${g.length} Complete`
|
|
152
|
+
)) : /* @__PURE__ */ e.createElement(
|
|
153
|
+
"div",
|
|
154
|
+
{
|
|
155
|
+
className: Y({
|
|
156
|
+
completed: n === 1,
|
|
157
|
+
disabled: t,
|
|
158
|
+
color: i
|
|
159
|
+
})
|
|
160
|
+
},
|
|
161
|
+
`${Math.floor(n * 100)}%`
|
|
162
|
+
)), g.length > 0 ? /* @__PURE__ */ e.createElement(
|
|
163
|
+
"ul",
|
|
164
|
+
{
|
|
165
|
+
className: E(
|
|
166
|
+
Q({
|
|
167
|
+
barCompleted: w.length === g.length,
|
|
168
|
+
disabled: t,
|
|
169
|
+
color: i
|
|
170
|
+
}),
|
|
171
|
+
"d-flex align-items-center list-unstyled mb-0"
|
|
172
|
+
)
|
|
173
|
+
},
|
|
174
|
+
O
|
|
175
|
+
) : /* @__PURE__ */ e.createElement(
|
|
176
|
+
"div",
|
|
177
|
+
{
|
|
178
|
+
className: K({
|
|
179
|
+
disabled: t
|
|
180
|
+
})
|
|
181
|
+
},
|
|
182
|
+
/* @__PURE__ */ e.createElement(
|
|
183
|
+
"div",
|
|
184
|
+
{
|
|
185
|
+
className: L({
|
|
186
|
+
completed: n === 1,
|
|
187
|
+
disabled: t,
|
|
188
|
+
color: i
|
|
189
|
+
}),
|
|
190
|
+
style: { width: `${n * 100}%` }
|
|
191
|
+
}
|
|
192
|
+
)
|
|
193
|
+
), a && /* @__PURE__ */ e.createElement("div", { className: z }, a)), l && n !== 1 && /* @__PURE__ */ e.createElement("div", { className: $ }, /* @__PURE__ */ e.createElement(
|
|
194
|
+
F,
|
|
195
|
+
{
|
|
196
|
+
kind: "icon",
|
|
197
|
+
icon: "x",
|
|
198
|
+
onClick: l,
|
|
199
|
+
title: P("progressBar.closeButtonTitle", { defaultValue: "Close progress bar" })
|
|
200
|
+
}
|
|
201
|
+
)));
|
|
202
|
+
}
|
|
203
|
+
b.set(T, {
|
|
204
|
+
name: "Progress Bar",
|
|
205
|
+
props: {
|
|
206
|
+
detail: { type: "string" },
|
|
207
|
+
disabled: { type: "boolean" },
|
|
208
|
+
onClose: { type: "() => void" },
|
|
209
|
+
percentComplete: { type: "number", default: "0" },
|
|
210
|
+
progressColor: { type: '"purple" | "blue" | "red" | "orange" | "grey"', default: '"purple"' }
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
function ee({
|
|
214
|
+
className: s,
|
|
215
|
+
size: o = "sm",
|
|
216
|
+
progress: a = 0,
|
|
217
|
+
...t
|
|
218
|
+
}) {
|
|
219
|
+
const n = c.component["progress-ring"][o] - 4, p = n * 2 * Math.PI, _ = p - a / 100 * p;
|
|
220
|
+
return /* @__PURE__ */ e.createElement("div", { className: s, ...t }, /* @__PURE__ */ e.createElement(
|
|
221
|
+
"svg",
|
|
222
|
+
{
|
|
223
|
+
height: c.component["progress-ring"][o] * 2,
|
|
224
|
+
width: c.component["progress-ring"][o] * 2,
|
|
225
|
+
style: { transform: "rotate(-90deg)" }
|
|
226
|
+
},
|
|
227
|
+
/* @__PURE__ */ e.createElement(
|
|
228
|
+
"circle",
|
|
229
|
+
{
|
|
230
|
+
stroke: c.color.grey["medium-light"],
|
|
231
|
+
fill: "transparent",
|
|
232
|
+
strokeWidth: 4,
|
|
233
|
+
strokeDasharray: `${p} ${p}`,
|
|
234
|
+
r: n,
|
|
235
|
+
cx: c.component["progress-ring"][o],
|
|
236
|
+
cy: c.component["progress-ring"][o]
|
|
237
|
+
}
|
|
238
|
+
),
|
|
239
|
+
/* @__PURE__ */ e.createElement(
|
|
240
|
+
"circle",
|
|
241
|
+
{
|
|
242
|
+
stroke: c.color.purple.medium,
|
|
243
|
+
fill: "transparent",
|
|
244
|
+
strokeWidth: 4,
|
|
245
|
+
strokeDasharray: `${p} ${p}`,
|
|
246
|
+
style: { strokeDashoffset: _ },
|
|
247
|
+
r: n,
|
|
248
|
+
cx: c.component["progress-ring"][o],
|
|
249
|
+
cy: c.component["progress-ring"][o]
|
|
250
|
+
}
|
|
251
|
+
)
|
|
252
|
+
));
|
|
253
|
+
}
|
|
254
|
+
b.set(ee, {
|
|
255
|
+
name: "Progress Ring",
|
|
256
|
+
props: {
|
|
257
|
+
size: { type: '"sm" | "md" | "lg"', default: '"sm"' },
|
|
258
|
+
progress: { type: "number", default: "0" }
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
const re = {
|
|
7
262
|
description: () => /* @__PURE__ */ e.createElement("p", null, "Progress Bars are used to visualize the progression of a process (such as a file upload) or series of related tasks that take place over a longer period of time. Progress Bars can be accompanied by a variety of additional content to provide more context regarding the processes being performed."),
|
|
8
|
-
components: [
|
|
263
|
+
components: [T, S],
|
|
9
264
|
examples: {
|
|
10
265
|
general: {
|
|
11
266
|
label: "General Usage",
|
|
@@ -20,11 +275,11 @@ const c = {
|
|
|
20
275
|
alt: "A Progress Bar with labels on each section",
|
|
21
276
|
className: "w-100 mb-3"
|
|
22
277
|
}
|
|
23
|
-
), /* @__PURE__ */ e.createElement(
|
|
278
|
+
), /* @__PURE__ */ e.createElement(C, null, /* @__PURE__ */ e.createElement(k, null, /* @__PURE__ */ e.createElement(m, null, "Section"), /* @__PURE__ */ e.createElement(m, null, "Content Type"), /* @__PURE__ */ e.createElement(m, null, "Required"), /* @__PURE__ */ e.createElement(m, null, "Description/Guidelines")), /* @__PURE__ */ e.createElement(y, null, /* @__PURE__ */ e.createElement(d, null, /* @__PURE__ */ e.createElement(r, null, /* @__PURE__ */ e.createElement("span", { className: "sps-tag sps-tag--info" }, "1")), /* @__PURE__ */ e.createElement(r, null, "Title"), /* @__PURE__ */ e.createElement(r, null, "No"), /* @__PURE__ */ e.createElement(r, { wrap: 400 }, "Use the Title when it provides necessary or helpful detail about the file or action that is being processed.")), /* @__PURE__ */ e.createElement(d, null, /* @__PURE__ */ e.createElement(r, null, /* @__PURE__ */ e.createElement("span", { className: "sps-tag sps-tag--info" }, "2")), /* @__PURE__ */ e.createElement(r, null, "Progress Meter"), /* @__PURE__ */ e.createElement(r, null, "Yes"), /* @__PURE__ */ e.createElement(r, null)), /* @__PURE__ */ e.createElement(d, null, /* @__PURE__ */ e.createElement(r, null, /* @__PURE__ */ e.createElement("span", { className: "sps-tag sps-tag--info" }, "3")), /* @__PURE__ */ e.createElement(r, null, "Progress Counter"), /* @__PURE__ */ e.createElement(r, null, "No"), /* @__PURE__ */ e.createElement(r, { wrap: 400 }, "The Progress Counter should not be used without the existence of a Title.")), /* @__PURE__ */ e.createElement(d, null, /* @__PURE__ */ e.createElement(r, null, /* @__PURE__ */ e.createElement("span", { className: "sps-tag sps-tag--info" }, "4")), /* @__PURE__ */ e.createElement(r, null, "Clear Button"), /* @__PURE__ */ e.createElement(r, null, "No"), /* @__PURE__ */ e.createElement(r, { wrap: 400 }, "If the process requires the option to be cancelled or removed from a list the clear button can be used.")), /* @__PURE__ */ e.createElement(d, null, /* @__PURE__ */ e.createElement(r, null, /* @__PURE__ */ e.createElement("span", { className: "sps-tag sps-tag--info" }, "5")), /* @__PURE__ */ e.createElement(r, null, "Progress Details"), /* @__PURE__ */ e.createElement(r, null, "No"), /* @__PURE__ */ e.createElement(r, { wrap: 400 }, "Progress Details provide more context for the user and are especially useful when the process includes multiple steps."))))),
|
|
24
279
|
examples: {
|
|
25
280
|
standard: {
|
|
26
281
|
description: () => /* @__PURE__ */ e.createElement("p", null, "The Standard Progress Bar is designed to expand to fit the entire width of its container. View the diagram above for rules regarding including or excluding certain elements."),
|
|
27
|
-
react:
|
|
282
|
+
react: u`
|
|
28
283
|
import { ProgressBar } from "@sps-woodland/progress-indicators";
|
|
29
284
|
import { Card } from "@sps-woodland/cards";
|
|
30
285
|
|
|
@@ -48,7 +303,7 @@ const c = {
|
|
|
48
303
|
},
|
|
49
304
|
completed: {
|
|
50
305
|
description: () => /* @__PURE__ */ e.createElement("p", null, "Once complete, the progress bar appears in green and the clear button (if included) disappears from view."),
|
|
51
|
-
react:
|
|
306
|
+
react: u`
|
|
52
307
|
import { ProgressBar } from "@sps-woodland/progress-indicators";
|
|
53
308
|
import { Card } from "@sps-woodland/cards";
|
|
54
309
|
|
|
@@ -67,7 +322,7 @@ const c = {
|
|
|
67
322
|
},
|
|
68
323
|
disabled: {
|
|
69
324
|
description: () => /* @__PURE__ */ e.createElement("p", null, "A disabled state is available for cases when progress is intentionally paused or user interaction needs to be restricted."),
|
|
70
|
-
react:
|
|
325
|
+
react: u`
|
|
71
326
|
import { ProgressBar } from "@sps-woodland/progress-indicators";
|
|
72
327
|
import { Card } from "@sps-woodland/cards";
|
|
73
328
|
|
|
@@ -101,11 +356,11 @@ const c = {
|
|
|
101
356
|
alt: "A Progress Bar with labels on each section",
|
|
102
357
|
className: "w-100 mb-3"
|
|
103
358
|
}
|
|
104
|
-
), /* @__PURE__ */ e.createElement(
|
|
359
|
+
), /* @__PURE__ */ e.createElement(C, null, /* @__PURE__ */ e.createElement(k, null, /* @__PURE__ */ e.createElement(m, null, "Section"), /* @__PURE__ */ e.createElement(m, null, "Content Type"), /* @__PURE__ */ e.createElement(m, null, "Required"), /* @__PURE__ */ e.createElement(m, null, "Description/Guidelines")), /* @__PURE__ */ e.createElement(y, null, /* @__PURE__ */ e.createElement(d, null, /* @__PURE__ */ e.createElement(r, null, /* @__PURE__ */ e.createElement("span", { className: "sps-tag sps-tag--info" }, "1")), /* @__PURE__ */ e.createElement(r, null, "Title"), /* @__PURE__ */ e.createElement(r, null, "No"), /* @__PURE__ */ e.createElement(r, { wrap: 400 }, "Use the Title when it provides necessary or helpful detail about the file or action that is being processed.")), /* @__PURE__ */ e.createElement(d, null, /* @__PURE__ */ e.createElement(r, null, /* @__PURE__ */ e.createElement("span", { className: "sps-tag sps-tag--info" }, "2")), /* @__PURE__ */ e.createElement(r, null, "Progress Meter"), /* @__PURE__ */ e.createElement(r, null, "Yes"), /* @__PURE__ */ e.createElement(r, null)), /* @__PURE__ */ e.createElement(d, null, /* @__PURE__ */ e.createElement(r, null, /* @__PURE__ */ e.createElement("span", { className: "sps-tag sps-tag--info" }, "3")), /* @__PURE__ */ e.createElement(r, null, "Progress Counter"), /* @__PURE__ */ e.createElement(r, null, "No"), /* @__PURE__ */ e.createElement(r, { wrap: 400 }, "The Progress Counter should not be used without the existence of a Title.")), /* @__PURE__ */ e.createElement(d, null, /* @__PURE__ */ e.createElement(r, null, /* @__PURE__ */ e.createElement("span", { className: "sps-tag sps-tag--info" }, "4")), /* @__PURE__ */ e.createElement(r, null, "Step icons"), /* @__PURE__ */ e.createElement(r, null, "No"), /* @__PURE__ */ e.createElement(r, { wrap: 400 }, "Icons can be set inside of steps for visual emphasis.")), /* @__PURE__ */ e.createElement(d, null, /* @__PURE__ */ e.createElement(r, null, /* @__PURE__ */ e.createElement("span", { className: "sps-tag sps-tag--info" }, "5")), /* @__PURE__ */ e.createElement(r, null, "Step Tooltips"), /* @__PURE__ */ e.createElement(r, null, "No"), /* @__PURE__ */ e.createElement(r, { wrap: 400 }, "Tooltips can be utilized to provide more details about each specific step. Tooltips can be exposed on click or hover."))))),
|
|
105
360
|
examples: {
|
|
106
361
|
standard: {
|
|
107
362
|
description: () => /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("h4", null, "Building Stepped Progress Bars"), /* @__PURE__ */ e.createElement("p", null, "The Stepped Progress Bar is designed to expand to fit the entire width of its container. View the diagram above for rules regarding including or excluding certain elements.")),
|
|
108
|
-
react:
|
|
363
|
+
react: u`
|
|
109
364
|
import { Card } from "@sps-woodland/cards";
|
|
110
365
|
import { ProgressBar, ProgressBarStep } from "@sps-woodland/progress-indicators";
|
|
111
366
|
|
|
@@ -151,7 +406,7 @@ const c = {
|
|
|
151
406
|
},
|
|
152
407
|
color: {
|
|
153
408
|
description: () => /* @__PURE__ */ e.createElement("h4", null, "Alternate Color"),
|
|
154
|
-
react:
|
|
409
|
+
react: u`
|
|
155
410
|
import { Card } from "@sps-woodland/cards";
|
|
156
411
|
import { ProgressBar, ProgressBarStep } from "@sps-woodland/progress-indicators";
|
|
157
412
|
|
|
@@ -194,7 +449,7 @@ const c = {
|
|
|
194
449
|
},
|
|
195
450
|
skippedSteps: {
|
|
196
451
|
description: () => /* @__PURE__ */ e.createElement("h4", null, "Skip steps"),
|
|
197
|
-
react:
|
|
452
|
+
react: u`
|
|
198
453
|
import { Card } from "@sps-woodland/cards";
|
|
199
454
|
import { ProgressBar, ProgressBarStep } from "@sps-woodland/progress-indicators";
|
|
200
455
|
|
|
@@ -225,7 +480,7 @@ const c = {
|
|
|
225
480
|
},
|
|
226
481
|
completed: {
|
|
227
482
|
description: () => /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("h4", null, "Completed State"), /* @__PURE__ */ e.createElement("p", null, "Once complete, the progress bar appears in green.")),
|
|
228
|
-
react:
|
|
483
|
+
react: u`
|
|
229
484
|
import { Card } from "@sps-woodland/cards";
|
|
230
485
|
import { ProgressBar, ProgressBarStep } from "@sps-woodland/progress-indicators";
|
|
231
486
|
|
|
@@ -270,7 +525,7 @@ const c = {
|
|
|
270
525
|
},
|
|
271
526
|
disabled: {
|
|
272
527
|
description: () => /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("h4", null, "Disabled State"), /* @__PURE__ */ e.createElement("p", null, "A disabled state is available for cases when progress is intentionally paused or user interaction needs to be restricted.")),
|
|
273
|
-
react:
|
|
528
|
+
react: u`
|
|
274
529
|
import { Card } from "@sps-woodland/cards";
|
|
275
530
|
import { ProgressBar, ProgressBarStep } from "@sps-woodland/progress-indicators";
|
|
276
531
|
|
|
@@ -301,9 +556,12 @@ const c = {
|
|
|
301
556
|
}
|
|
302
557
|
}
|
|
303
558
|
}
|
|
304
|
-
},
|
|
305
|
-
"Progress Bars":
|
|
559
|
+
}, pe = {
|
|
560
|
+
"Progress Bars": re
|
|
306
561
|
};
|
|
307
562
|
export {
|
|
308
|
-
|
|
563
|
+
pe as MANIFEST,
|
|
564
|
+
T as ProgressBar,
|
|
565
|
+
S as ProgressBarStep,
|
|
566
|
+
ee as ProgressRing
|
|
309
567
|
};
|
package/lib/index.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(t,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("@sps-woodland/core/progress-indicators"),require("react"),require("@spscommerce/utils"),require("@spscommerce/ds-react")):typeof define=="function"&&define.amd?define(["exports","@sps-woodland/core/progress-indicators","react","@spscommerce/utils","@spscommerce/ds-react"],l):(t=typeof globalThis<"u"?globalThis:t||self,l(t.ProgressIndicators={},t.progressIndicators,t.React,t.utils,t.dsReact))})(this,(function(t,l,i,o,r){"use strict";function c(s){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const a in s)if(a!=="default"){const p=Object.getOwnPropertyDescriptor(s,a);Object.defineProperty(n,a,p.get?p:{enumerable:!0,get:()=>s[a]})}}return n.default=s,Object.freeze(n)}const e=c(i),m={"Progress Bars":{description:()=>e.createElement("p",null,"Progress Bars are used to visualize the progression of a process (such as a file upload) or series of related tasks that take place over a longer period of time. Progress Bars can be accompanied by a variety of additional content to provide more context regarding the processes being performed."),components:[l.ProgressBar,l.ProgressBarStep],examples:{general:{label:"General Usage",description:()=>e.createElement(e.Fragment,null,e.createElement("p",null,"Progress Bars can be used in a variety of situations, but the most common use case is to show the live progress of a process such as a file upload or the processing of a digital payload."),e.createElement("p",null,"For processes that typically complete within minutes or less, opt for the Standard Progress Bar."),e.createElement("p",null,"For processes that are divided into specific steps that are accomplished over a longer period of time, opt for the Stepped Progress Bar."))},standard:{label:"Standard Progress Bar",description:()=>e.createElement(e.Fragment,null,e.createElement("p",null,"Standard Progress Bars are comprised of the following Required and Optional elements."),e.createElement("img",{src:"assets/images/progress-bar-example.svg",alt:"A Progress Bar with labels on each section",className:"w-100 mb-3"}),e.createElement(r.SpsTable,null,e.createElement(r.SpsTableHead,null,e.createElement(r.SpsTableHeader,null,"Section"),e.createElement(r.SpsTableHeader,null,"Content Type"),e.createElement(r.SpsTableHeader,null,"Required"),e.createElement(r.SpsTableHeader,null,"Description/Guidelines")),e.createElement(r.SpsTableBody,null,e.createElement(r.SpsTableRow,null,e.createElement(r.SpsTableCell,null,e.createElement("span",{className:"sps-tag sps-tag--info"},"1")),e.createElement(r.SpsTableCell,null,"Title"),e.createElement(r.SpsTableCell,null,"No"),e.createElement(r.SpsTableCell,{wrap:400},"Use the Title when it provides necessary or helpful detail about the file or action that is being processed.")),e.createElement(r.SpsTableRow,null,e.createElement(r.SpsTableCell,null,e.createElement("span",{className:"sps-tag sps-tag--info"},"2")),e.createElement(r.SpsTableCell,null,"Progress Meter"),e.createElement(r.SpsTableCell,null,"Yes"),e.createElement(r.SpsTableCell,null)),e.createElement(r.SpsTableRow,null,e.createElement(r.SpsTableCell,null,e.createElement("span",{className:"sps-tag sps-tag--info"},"3")),e.createElement(r.SpsTableCell,null,"Progress Counter"),e.createElement(r.SpsTableCell,null,"No"),e.createElement(r.SpsTableCell,{wrap:400},"The Progress Counter should not be used without the existence of a Title.")),e.createElement(r.SpsTableRow,null,e.createElement(r.SpsTableCell,null,e.createElement("span",{className:"sps-tag sps-tag--info"},"4")),e.createElement(r.SpsTableCell,null,"Clear Button"),e.createElement(r.SpsTableCell,null,"No"),e.createElement(r.SpsTableCell,{wrap:400},"If the process requires the option to be cancelled or removed from a list the clear button can be used.")),e.createElement(r.SpsTableRow,null,e.createElement(r.SpsTableCell,null,e.createElement("span",{className:"sps-tag sps-tag--info"},"5")),e.createElement(r.SpsTableCell,null,"Progress Details"),e.createElement(r.SpsTableCell,null,"No"),e.createElement(r.SpsTableCell,{wrap:400},"Progress Details provide more context for the user and are especially useful when the process includes multiple steps."))))),examples:{standard:{description:()=>e.createElement("p",null,"The Standard Progress Bar is designed to expand to fit the entire width of its container. View the diagram above for rules regarding including or excluding certain elements."),react:o.code`
|
|
1
|
+
(function(l,S){typeof exports=="object"&&typeof module<"u"?S(exports,require("react"),require("@sps-woodland/core"),require("@sps-woodland/buttons"),require("@spscommerce/ds-react"),require("@spscommerce/i18n"),require("@sps-woodland/tokens"),require("@spscommerce/utils")):typeof define=="function"&&define.amd?define(["exports","react","@sps-woodland/core","@sps-woodland/buttons","@spscommerce/ds-react","@spscommerce/i18n","@sps-woodland/tokens","@spscommerce/utils"],S):(l=typeof globalThis<"u"?globalThis:l||self,S(l.ProgressIndicators={},l.React,l.core,l.buttons,l.dsReact,l.i18n,l.tokens,l.utils))})(this,(function(l,S,c,y,r,j,g,m){"use strict";function N(s){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const t in s)if(t!=="default"){const a=Object.getOwnPropertyDescriptor(s,t);Object.defineProperty(o,t,a.get?a:{enumerable:!0,get:()=>s[t]})}}return o.default=s,Object.freeze(o)}const e=N(S);function q(s,o,t){return o in s?Object.defineProperty(s,o,{value:t,enumerable:!0,configurable:!0,writable:!0}):s[o]=t,s}function E(s,o){var t=Object.keys(s);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(s);o&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(s,n).enumerable})),t.push.apply(t,a)}return t}function T(s){for(var o=1;o<arguments.length;o++){var t=arguments[o]!=null?arguments[o]:{};o%2?E(Object(t),!0).forEach(function(a){q(s,a,t[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(t)):E(Object(t)).forEach(function(a){Object.defineProperty(s,a,Object.getOwnPropertyDescriptor(t,a))})}return s}var O=(s,o,t)=>{for(var a of Object.keys(s)){var n;if(s[a]!==((n=o[a])!==null&&n!==void 0?n:t[a]))return!1}return!0},h=s=>o=>{var t=s.defaultClassName,a=T(T({},s.defaultVariants),o);for(var n in a){var p,_=(p=a[n])!==null&&p!==void 0?p:s.defaultVariants[n];if(_!=null){var i=_;typeof i=="boolean"&&(i=i===!0?"true":"false");var d=s.variantClassNames[n][i];d&&(t+=" "+d)}}for(var[f,C]of s.compoundVariants)O(f,a,s.defaultVariants)&&(t+=" "+C);return t},D="pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qme0",V="pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qme1",x="pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qme2",F="pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qme3",H="pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qme4",M=h({defaultClassName:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qme5",variantClassNames:{completed:{true:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qme6",false:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qme7"},disabled:{true:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qme8",false:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qme9"},color:{purple:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmea",blue:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmeb",red:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmec",orange:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmed",grey:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmee"}},defaultVariants:{completed:!1,disabled:!1,color:"purple"},compoundVariants:[]}),I=h({defaultClassName:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmef",variantClassNames:{disabled:{true:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmeg",false:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmeh"}},defaultVariants:{disabled:!1},compoundVariants:[]}),A=h({defaultClassName:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmei",variantClassNames:{completed:{true:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmej",false:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmek"},disabled:{true:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmel",false:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmem"},color:{purple:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmen",blue:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmeo",red:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmep",orange:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmeq",grey:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmer"}},defaultVariants:{completed:!1,disabled:!1,color:"purple"},compoundVariants:[[{completed:!0,disabled:!0},"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmes"]]}),W="pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmet",$=h({defaultClassName:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0go0",variantClassNames:{barCompleted:{true:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0go1",false:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0go2"},disabled:{true:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0go3",false:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0go4"},color:{purple:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0go5",blue:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0go6",red:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0go7",orange:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0go8",grey:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0go9"}},defaultVariants:{barCompleted:!1,disabled:!1,color:"purple"},compoundVariants:[]}),G=h({defaultClassName:"",variantClassNames:{barCompleted:{true:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0goa",false:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0gob"},color:{purple:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0goc",blue:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0god",red:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0goe",orange:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0gof",grey:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0gog"},disabled:{true:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0goh",false:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0goi"}},defaultVariants:{barCompleted:!1,color:"purple",disabled:!1},compoundVariants:[]}),U=h({defaultClassName:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0goj",variantClassNames:{stepCompleted:{true:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0gok",false:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0gol"}},defaultVariants:{stepCompleted:!1},compoundVariants:[]}),Y=h({defaultClassName:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0gom",variantClassNames:{stepCompleted:{true:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0gon",false:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0goo"},disabled:{true:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0gop",false:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0goq"},barCompleted:{true:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0gor",false:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0gos"},color:{purple:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0got",red:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0gou",blue:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0gov",orange:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0gow",grey:"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0gox"}},defaultVariants:{stepCompleted:!1,disabled:!1,barCompleted:!1,color:"purple"},compoundVariants:[[{barCompleted:!0,disabled:!0},"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0goy"],[{barCompleted:!0,disabled:!1},"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0goz"],[{stepCompleted:!0,disabled:!0},"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0go10"],[{barCompleted:!1,disabled:!1,stepCompleted:!0,color:"purple"},"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0go11"],[{barCompleted:!1,disabled:!1,stepCompleted:!0,color:"red"},"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0go12"],[{barCompleted:!1,disabled:!1,stepCompleted:!0,color:"blue"},"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0go13"],[{barCompleted:!1,disabled:!1,stepCompleted:!0,color:"orange"},"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0go14"],[{barCompleted:!1,disabled:!1,stepCompleted:!0,color:"grey"},"pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0go15"]]});function w({className:s,title:o,description:t,icon:a,complete:n=!1,disabled:p,barCompleted:_,progressColor:i,...d}){const f=c.useElementId().current||void 0;return e.createElement("li",{id:f,className:c.cl(Y({stepCompleted:n,disabled:p,barCompleted:_,color:i}),s),...d},a&&e.createElement(c.Icon,{icon:a,size:"sm",className:U({stepCompleted:n})}),o&&f&&e.createElement(r.SpsTooltip,{for:f,title:o},t))}c.Metadata.set(w,{name:"ProgressBarStep",props:{icon:{type:"IconName"},complete:{type:"boolean"},title:{type:"string"},description:{type:"string"}}});function P({className:s,children:o,detail:t,disabled:a,onClose:n,percentComplete:p=0,title:_,showStepsCounter:i,progressColor:d="purple",...f}){const{t:C}=j.useWoodlandLanguage(),[v,K]=e.useState([]),[u]=c.selectChildren(o,[{type:w}]);e.useEffect(()=>{let b=[];u.forEach(B=>{B.hasOwnProperty("props")&&B.props.complete===!0&&b.push(B),K(b)})},[]),p&&u&&console.warn(["The percentComplete prop can't be used with the ProgressBarStep subcomponent.","The progress will be determined by how many nested ProgressBarStep components have the completed prop."].join(" "));const L=e.Children.map(o,b=>e.isValidElement(b)?e.cloneElement(b,{disabled:a,barCompleted:v.length===u.length,progressColor:d}):b);return e.createElement("div",{className:c.cl(D,s),...f},e.createElement("div",{className:V},_&&e.createElement("div",{className:F},e.createElement("div",{className:H},_),u.length>0?e.createElement(e.Fragment,null,i===!0&&e.createElement("div",{className:$({barCompleted:v.length===u.length,disabled:a,color:d})},`${v.length} of ${u.length} Complete`)):e.createElement("div",{className:M({completed:p===1,disabled:a,color:d})},`${Math.floor(p*100)}%`)),u.length>0?e.createElement("ul",{className:c.cl(G({barCompleted:v.length===u.length,disabled:a,color:d}),"d-flex align-items-center list-unstyled mb-0")},L):e.createElement("div",{className:I({disabled:a})},e.createElement("div",{className:A({completed:p===1,disabled:a,color:d}),style:{width:`${p*100}%`}})),t&&e.createElement("div",{className:W},t)),n&&p!==1&&e.createElement("div",{className:x},e.createElement(y.Button,{kind:"icon",icon:"x",onClick:n,title:C("progressBar.closeButtonTitle",{defaultValue:"Close progress bar"})})))}c.Metadata.set(P,{name:"Progress Bar",props:{detail:{type:"string"},disabled:{type:"boolean"},onClose:{type:"() => void"},percentComplete:{type:"number",default:"0"},progressColor:{type:'"purple" | "blue" | "red" | "orange" | "grey"',default:'"purple"'}}});function k({className:s,size:o="sm",progress:t=0,...a}){const p=g.Tokens.component["progress-ring"][o]-4,_=p*2*Math.PI,i=_-t/100*_;return e.createElement("div",{className:s,...a},e.createElement("svg",{height:g.Tokens.component["progress-ring"][o]*2,width:g.Tokens.component["progress-ring"][o]*2,style:{transform:"rotate(-90deg)"}},e.createElement("circle",{stroke:g.Tokens.color.grey["medium-light"],fill:"transparent",strokeWidth:4,strokeDasharray:`${_} ${_}`,r:p,cx:g.Tokens.component["progress-ring"][o],cy:g.Tokens.component["progress-ring"][o]}),e.createElement("circle",{stroke:g.Tokens.color.purple.medium,fill:"transparent",strokeWidth:4,strokeDasharray:`${_} ${_}`,style:{strokeDashoffset:i},r:p,cx:g.Tokens.component["progress-ring"][o],cy:g.Tokens.component["progress-ring"][o]})))}c.Metadata.set(k,{name:"Progress Ring",props:{size:{type:'"sm" | "md" | "lg"',default:'"sm"'},progress:{type:"number",default:"0"}}});const z={"Progress Bars":{description:()=>e.createElement("p",null,"Progress Bars are used to visualize the progression of a process (such as a file upload) or series of related tasks that take place over a longer period of time. Progress Bars can be accompanied by a variety of additional content to provide more context regarding the processes being performed."),components:[P,w],examples:{general:{label:"General Usage",description:()=>e.createElement(e.Fragment,null,e.createElement("p",null,"Progress Bars can be used in a variety of situations, but the most common use case is to show the live progress of a process such as a file upload or the processing of a digital payload."),e.createElement("p",null,"For processes that typically complete within minutes or less, opt for the Standard Progress Bar."),e.createElement("p",null,"For processes that are divided into specific steps that are accomplished over a longer period of time, opt for the Stepped Progress Bar."))},standard:{label:"Standard Progress Bar",description:()=>e.createElement(e.Fragment,null,e.createElement("p",null,"Standard Progress Bars are comprised of the following Required and Optional elements."),e.createElement("img",{src:"assets/images/progress-bar-example.svg",alt:"A Progress Bar with labels on each section",className:"w-100 mb-3"}),e.createElement(r.SpsTable,null,e.createElement(r.SpsTableHead,null,e.createElement(r.SpsTableHeader,null,"Section"),e.createElement(r.SpsTableHeader,null,"Content Type"),e.createElement(r.SpsTableHeader,null,"Required"),e.createElement(r.SpsTableHeader,null,"Description/Guidelines")),e.createElement(r.SpsTableBody,null,e.createElement(r.SpsTableRow,null,e.createElement(r.SpsTableCell,null,e.createElement("span",{className:"sps-tag sps-tag--info"},"1")),e.createElement(r.SpsTableCell,null,"Title"),e.createElement(r.SpsTableCell,null,"No"),e.createElement(r.SpsTableCell,{wrap:400},"Use the Title when it provides necessary or helpful detail about the file or action that is being processed.")),e.createElement(r.SpsTableRow,null,e.createElement(r.SpsTableCell,null,e.createElement("span",{className:"sps-tag sps-tag--info"},"2")),e.createElement(r.SpsTableCell,null,"Progress Meter"),e.createElement(r.SpsTableCell,null,"Yes"),e.createElement(r.SpsTableCell,null)),e.createElement(r.SpsTableRow,null,e.createElement(r.SpsTableCell,null,e.createElement("span",{className:"sps-tag sps-tag--info"},"3")),e.createElement(r.SpsTableCell,null,"Progress Counter"),e.createElement(r.SpsTableCell,null,"No"),e.createElement(r.SpsTableCell,{wrap:400},"The Progress Counter should not be used without the existence of a Title.")),e.createElement(r.SpsTableRow,null,e.createElement(r.SpsTableCell,null,e.createElement("span",{className:"sps-tag sps-tag--info"},"4")),e.createElement(r.SpsTableCell,null,"Clear Button"),e.createElement(r.SpsTableCell,null,"No"),e.createElement(r.SpsTableCell,{wrap:400},"If the process requires the option to be cancelled or removed from a list the clear button can be used.")),e.createElement(r.SpsTableRow,null,e.createElement(r.SpsTableCell,null,e.createElement("span",{className:"sps-tag sps-tag--info"},"5")),e.createElement(r.SpsTableCell,null,"Progress Details"),e.createElement(r.SpsTableCell,null,"No"),e.createElement(r.SpsTableCell,{wrap:400},"Progress Details provide more context for the user and are especially useful when the process includes multiple steps."))))),examples:{standard:{description:()=>e.createElement("p",null,"The Standard Progress Bar is designed to expand to fit the entire width of its container. View the diagram above for rules regarding including or excluding certain elements."),react:m.code`
|
|
2
2
|
import { ProgressBar } from "@sps-woodland/progress-indicators";
|
|
3
3
|
import { Card } from "@sps-woodland/cards";
|
|
4
4
|
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
</Card>
|
|
19
19
|
)
|
|
20
20
|
}
|
|
21
|
-
`},completed:{description:()=>e.createElement("p",null,"Once complete, the progress bar appears in green and the clear button (if included) disappears from view."),react:
|
|
21
|
+
`},completed:{description:()=>e.createElement("p",null,"Once complete, the progress bar appears in green and the clear button (if included) disappears from view."),react:m.code`
|
|
22
22
|
import { ProgressBar } from "@sps-woodland/progress-indicators";
|
|
23
23
|
import { Card } from "@sps-woodland/cards";
|
|
24
24
|
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
</Card>
|
|
34
34
|
)
|
|
35
35
|
}
|
|
36
|
-
`},disabled:{description:()=>e.createElement("p",null,"A disabled state is available for cases when progress is intentionally paused or user interaction needs to be restricted."),react:
|
|
36
|
+
`},disabled:{description:()=>e.createElement("p",null,"A disabled state is available for cases when progress is intentionally paused or user interaction needs to be restricted."),react:m.code`
|
|
37
37
|
import { ProgressBar } from "@sps-woodland/progress-indicators";
|
|
38
38
|
import { Card } from "@sps-woodland/cards";
|
|
39
39
|
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
</Card>
|
|
55
55
|
)
|
|
56
56
|
}
|
|
57
|
-
`}}},stepped:{label:"Stepped Progress Bar",description:()=>e.createElement(e.Fragment,null,e.createElement("p",null,"Stepped Progress Bars are comprised of the following Required and Optional elements."),e.createElement("img",{src:"assets/images/stepped-progress-bar-example.svg",alt:"A Progress Bar with labels on each section",className:"w-100 mb-3"}),e.createElement(r.SpsTable,null,e.createElement(r.SpsTableHead,null,e.createElement(r.SpsTableHeader,null,"Section"),e.createElement(r.SpsTableHeader,null,"Content Type"),e.createElement(r.SpsTableHeader,null,"Required"),e.createElement(r.SpsTableHeader,null,"Description/Guidelines")),e.createElement(r.SpsTableBody,null,e.createElement(r.SpsTableRow,null,e.createElement(r.SpsTableCell,null,e.createElement("span",{className:"sps-tag sps-tag--info"},"1")),e.createElement(r.SpsTableCell,null,"Title"),e.createElement(r.SpsTableCell,null,"No"),e.createElement(r.SpsTableCell,{wrap:400},"Use the Title when it provides necessary or helpful detail about the file or action that is being processed.")),e.createElement(r.SpsTableRow,null,e.createElement(r.SpsTableCell,null,e.createElement("span",{className:"sps-tag sps-tag--info"},"2")),e.createElement(r.SpsTableCell,null,"Progress Meter"),e.createElement(r.SpsTableCell,null,"Yes"),e.createElement(r.SpsTableCell,null)),e.createElement(r.SpsTableRow,null,e.createElement(r.SpsTableCell,null,e.createElement("span",{className:"sps-tag sps-tag--info"},"3")),e.createElement(r.SpsTableCell,null,"Progress Counter"),e.createElement(r.SpsTableCell,null,"No"),e.createElement(r.SpsTableCell,{wrap:400},"The Progress Counter should not be used without the existence of a Title.")),e.createElement(r.SpsTableRow,null,e.createElement(r.SpsTableCell,null,e.createElement("span",{className:"sps-tag sps-tag--info"},"4")),e.createElement(r.SpsTableCell,null,"Step icons"),e.createElement(r.SpsTableCell,null,"No"),e.createElement(r.SpsTableCell,{wrap:400},"Icons can be set inside of steps for visual emphasis.")),e.createElement(r.SpsTableRow,null,e.createElement(r.SpsTableCell,null,e.createElement("span",{className:"sps-tag sps-tag--info"},"5")),e.createElement(r.SpsTableCell,null,"Step Tooltips"),e.createElement(r.SpsTableCell,null,"No"),e.createElement(r.SpsTableCell,{wrap:400},"Tooltips can be utilized to provide more details about each specific step. Tooltips can be exposed on click or hover."))))),examples:{standard:{description:()=>e.createElement(e.Fragment,null,e.createElement("h4",null,"Building Stepped Progress Bars"),e.createElement("p",null,"The Stepped Progress Bar is designed to expand to fit the entire width of its container. View the diagram above for rules regarding including or excluding certain elements.")),react:
|
|
57
|
+
`}}},stepped:{label:"Stepped Progress Bar",description:()=>e.createElement(e.Fragment,null,e.createElement("p",null,"Stepped Progress Bars are comprised of the following Required and Optional elements."),e.createElement("img",{src:"assets/images/stepped-progress-bar-example.svg",alt:"A Progress Bar with labels on each section",className:"w-100 mb-3"}),e.createElement(r.SpsTable,null,e.createElement(r.SpsTableHead,null,e.createElement(r.SpsTableHeader,null,"Section"),e.createElement(r.SpsTableHeader,null,"Content Type"),e.createElement(r.SpsTableHeader,null,"Required"),e.createElement(r.SpsTableHeader,null,"Description/Guidelines")),e.createElement(r.SpsTableBody,null,e.createElement(r.SpsTableRow,null,e.createElement(r.SpsTableCell,null,e.createElement("span",{className:"sps-tag sps-tag--info"},"1")),e.createElement(r.SpsTableCell,null,"Title"),e.createElement(r.SpsTableCell,null,"No"),e.createElement(r.SpsTableCell,{wrap:400},"Use the Title when it provides necessary or helpful detail about the file or action that is being processed.")),e.createElement(r.SpsTableRow,null,e.createElement(r.SpsTableCell,null,e.createElement("span",{className:"sps-tag sps-tag--info"},"2")),e.createElement(r.SpsTableCell,null,"Progress Meter"),e.createElement(r.SpsTableCell,null,"Yes"),e.createElement(r.SpsTableCell,null)),e.createElement(r.SpsTableRow,null,e.createElement(r.SpsTableCell,null,e.createElement("span",{className:"sps-tag sps-tag--info"},"3")),e.createElement(r.SpsTableCell,null,"Progress Counter"),e.createElement(r.SpsTableCell,null,"No"),e.createElement(r.SpsTableCell,{wrap:400},"The Progress Counter should not be used without the existence of a Title.")),e.createElement(r.SpsTableRow,null,e.createElement(r.SpsTableCell,null,e.createElement("span",{className:"sps-tag sps-tag--info"},"4")),e.createElement(r.SpsTableCell,null,"Step icons"),e.createElement(r.SpsTableCell,null,"No"),e.createElement(r.SpsTableCell,{wrap:400},"Icons can be set inside of steps for visual emphasis.")),e.createElement(r.SpsTableRow,null,e.createElement(r.SpsTableCell,null,e.createElement("span",{className:"sps-tag sps-tag--info"},"5")),e.createElement(r.SpsTableCell,null,"Step Tooltips"),e.createElement(r.SpsTableCell,null,"No"),e.createElement(r.SpsTableCell,{wrap:400},"Tooltips can be utilized to provide more details about each specific step. Tooltips can be exposed on click or hover."))))),examples:{standard:{description:()=>e.createElement(e.Fragment,null,e.createElement("h4",null,"Building Stepped Progress Bars"),e.createElement("p",null,"The Stepped Progress Bar is designed to expand to fit the entire width of its container. View the diagram above for rules regarding including or excluding certain elements.")),react:m.code`
|
|
58
58
|
import { Card } from "@sps-woodland/cards";
|
|
59
59
|
import { ProgressBar, ProgressBarStep } from "@sps-woodland/progress-indicators";
|
|
60
60
|
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
</Card>
|
|
97
97
|
)
|
|
98
98
|
}
|
|
99
|
-
`},color:{description:()=>e.createElement("h4",null,"Alternate Color"),react:
|
|
99
|
+
`},color:{description:()=>e.createElement("h4",null,"Alternate Color"),react:m.code`
|
|
100
100
|
import { Card } from "@sps-woodland/cards";
|
|
101
101
|
import { ProgressBar, ProgressBarStep } from "@sps-woodland/progress-indicators";
|
|
102
102
|
|
|
@@ -135,7 +135,7 @@
|
|
|
135
135
|
</Card>
|
|
136
136
|
)
|
|
137
137
|
}
|
|
138
|
-
`},skippedSteps:{description:()=>e.createElement("h4",null,"Skip steps"),react:
|
|
138
|
+
`},skippedSteps:{description:()=>e.createElement("h4",null,"Skip steps"),react:m.code`
|
|
139
139
|
import { Card } from "@sps-woodland/cards";
|
|
140
140
|
import { ProgressBar, ProgressBarStep } from "@sps-woodland/progress-indicators";
|
|
141
141
|
|
|
@@ -162,7 +162,7 @@
|
|
|
162
162
|
</Card>
|
|
163
163
|
)
|
|
164
164
|
}
|
|
165
|
-
`},completed:{description:()=>e.createElement(e.Fragment,null,e.createElement("h4",null,"Completed State"),e.createElement("p",null,"Once complete, the progress bar appears in green.")),react:
|
|
165
|
+
`},completed:{description:()=>e.createElement(e.Fragment,null,e.createElement("h4",null,"Completed State"),e.createElement("p",null,"Once complete, the progress bar appears in green.")),react:m.code`
|
|
166
166
|
import { Card } from "@sps-woodland/cards";
|
|
167
167
|
import { ProgressBar, ProgressBarStep } from "@sps-woodland/progress-indicators";
|
|
168
168
|
|
|
@@ -203,7 +203,7 @@
|
|
|
203
203
|
</Card>
|
|
204
204
|
)
|
|
205
205
|
}
|
|
206
|
-
`},disabled:{description:()=>e.createElement(e.Fragment,null,e.createElement("h4",null,"Disabled State"),e.createElement("p",null,"A disabled state is available for cases when progress is intentionally paused or user interaction needs to be restricted.")),react:
|
|
206
|
+
`},disabled:{description:()=>e.createElement(e.Fragment,null,e.createElement("h4",null,"Disabled State"),e.createElement("p",null,"A disabled state is available for cases when progress is intentionally paused or user interaction needs to be restricted.")),react:m.code`
|
|
207
207
|
import { Card } from "@sps-woodland/cards";
|
|
208
208
|
import { ProgressBar, ProgressBarStep } from "@sps-woodland/progress-indicators";
|
|
209
209
|
|
|
@@ -229,4 +229,4 @@
|
|
|
229
229
|
</Card>
|
|
230
230
|
)
|
|
231
231
|
}
|
|
232
|
-
`}}}}}};
|
|
232
|
+
`}}}}}};l.MANIFEST=z,l.ProgressBar=P,l.ProgressBarStep=w,l.ProgressRing=k,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})}));
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Tokens } from "@sps-woodland/tokens";
|
|
2
|
+
import { BooleanRecipeVariant, RecipeVariant, VariantDefinitions } from "@sps-woodland/core";
|
|
3
|
+
export type ProgressBarKind = keyof typeof Tokens.component["progress-bar"]["progress-color"];
|
|
4
|
+
interface ProgressBarVariantDefinitions extends VariantDefinitions {
|
|
5
|
+
completed: BooleanRecipeVariant;
|
|
6
|
+
disabled: BooleanRecipeVariant;
|
|
7
|
+
color: RecipeVariant<ProgressBarKind>;
|
|
8
|
+
}
|
|
9
|
+
export declare const progressBar: string;
|
|
10
|
+
export declare const progressBarContent: string;
|
|
11
|
+
export declare const progressBarCloseButton: string;
|
|
12
|
+
export declare const progressBarHeading: string;
|
|
13
|
+
export declare const progressBarTitle: string;
|
|
14
|
+
export declare const progressBarPercentage: import("@vanilla-extract/recipes/dist/declarations/src/types").RuntimeFn<ProgressBarVariantDefinitions>;
|
|
15
|
+
export declare const progressBarBackground: import("@vanilla-extract/recipes/dist/declarations/src/types").RuntimeFn<Pick<ProgressBarVariantDefinitions, "disabled">>;
|
|
16
|
+
export declare const progressBarProgress: import("@vanilla-extract/recipes/dist/declarations/src/types").RuntimeFn<ProgressBarVariantDefinitions>;
|
|
17
|
+
export declare const progressBarDetail: string;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { ComponentProps } from "@sps-woodland/core";
|
|
3
|
+
import { ProgressBarKind } from "./ProgressBar.css";
|
|
4
|
+
export declare function ProgressBar({ className, children, detail, disabled, onClose, percentComplete, title, showStepsCounter, progressColor, ...rest }: ComponentProps<{
|
|
5
|
+
detail?: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
onClose?: () => void;
|
|
8
|
+
percentComplete?: number;
|
|
9
|
+
title?: string;
|
|
10
|
+
showStepsCounter?: boolean;
|
|
11
|
+
progressColor?: ProgressBarKind;
|
|
12
|
+
}, HTMLDivElement>): React.ReactElement;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Tokens } from "@sps-woodland/tokens";
|
|
2
|
+
import type { VariantDefinitions, RecipeVariant, BooleanRecipeVariant } from "@sps-woodland/core";
|
|
3
|
+
export type SteppedProgressBarKind = keyof typeof Tokens.component["stepped-progress-bar"]["progress-color"];
|
|
4
|
+
interface ProgressBarStepVariantDefinitions extends VariantDefinitions {
|
|
5
|
+
color: RecipeVariant<SteppedProgressBarKind>;
|
|
6
|
+
stepCompleted: BooleanRecipeVariant;
|
|
7
|
+
barComplete: BooleanRecipeVariant;
|
|
8
|
+
}
|
|
9
|
+
export declare const progressBarStepsComplete: import("@vanilla-extract/recipes/dist/declarations/src/types").RuntimeFn<Pick<ProgressBarStepVariantDefinitions, "color" | "disabled" | "barCompleted">>;
|
|
10
|
+
export declare const progressBarStepBackground: import("@vanilla-extract/recipes/dist/declarations/src/types").RuntimeFn<Pick<ProgressBarStepVariantDefinitions, "color" | "disabled" | "barCompleted">>;
|
|
11
|
+
export declare const progressBarIcon: import("@vanilla-extract/recipes/dist/declarations/src/types").RuntimeFn<Pick<ProgressBarStepVariantDefinitions, "stepCompleted">>;
|
|
12
|
+
export declare const progressBarStep: import("@vanilla-extract/recipes/dist/declarations/src/types").RuntimeFn<Pick<ProgressBarStepVariantDefinitions, "color" | "disabled" | "stepCompleted" | "barCompleted">>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { ComponentProps } from "@sps-woodland/core";
|
|
3
|
+
import { IconName } from "@sps-woodland/tokens";
|
|
4
|
+
import { ProgressBarKind } from "../ProgressBar.css";
|
|
5
|
+
export declare function ProgressBarStep({ className, title, description, icon, complete, disabled, barCompleted, progressColor, ...rest }: ComponentProps<{
|
|
6
|
+
title?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
icon?: IconName;
|
|
9
|
+
complete?: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
barCompleted?: boolean;
|
|
12
|
+
progressColor?: ProgressBarKind;
|
|
13
|
+
}, HTMLElement>): React.ReactElement;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { ComponentProps } from "@sps-woodland/core";
|
|
3
|
+
import { ProgressRingSize } from "@sps-woodland/tokens";
|
|
4
|
+
export declare function ProgressRing({ className, size, progress, ...rest }: ComponentProps<{
|
|
5
|
+
size: ProgressRingSize;
|
|
6
|
+
progress: number;
|
|
7
|
+
}, HTMLDivElement>): React.ReactElement;
|
package/lib/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.pkg_sps-
|
|
1
|
+
.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qme0{align-items:center;display:flex}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qme1{flex-grow:1}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qme2{margin-left:.5rem;margin-top:-.375rem}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qme3{display:flex;font-size:.875rem;line-height:1.25rem;margin-bottom:.5rem}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qme4{color:#1f282c;flex-grow:1}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qme5{color:#91467f;font-weight:600;font-size:.875rem;line-height:1.25rem}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qme6{color:#0b8940!important}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qme8{color:#d2d4d4!important}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmea{color:#91467f}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmeb{color:#007db8}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmec{color:#de002e}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmed{color:#e7760b}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmee{color:#717779}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmef{background:#e9e9ea;border-radius:.5rem;height:1rem;width:100%;overflow:hidden}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmeg{cursor:not-allowed}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmei{background-color:#91467f;border-radius:.5rem;height:1rem}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmej{background-color:#0b8940!important}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmel{background-color:#d2d4d4!important}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmen{background:#91467f}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmen:hover{background:#6e3c65}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmeo{background:#007db8}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmeo:hover{background:#09638d}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmep{background:#de002e}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmep:hover{background:#a30d2d}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmeq{background:#e7760b}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmeq:hover{background:#aa5e14}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmer{background:#717779}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmer:hover{background:#1f282c}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmes{background-color:#d2d4d4}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_1890qmet{color:#4b5356;font-size:.75rem;line-height:1.125rem;margin-top:1rem}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0go0{font-weight:600}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0go1{color:#0b8940!important}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0go3{color:#d2d4d4!important}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0go5{color:#91467f}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0go6{color:#007db8}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0go7{color:#de002e}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0go8{color:#e7760b}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0go9{color:#717779}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0goh{cursor:not-allowed}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0goj{display:block;margin-bottom:0}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0gok{color:#fff}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0gol{color:#717779}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0gom{background:#e9e9ea;border-radius:.125rem;margin-left:.125rem;height:1rem;display:flex;flex:1 1 8%;align-items:center;justify-content:center}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0gom:last-child{border-radius:.125rem .5rem .5rem .125rem}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0gom:first-child{border-radius:.5rem .125rem .125rem .5rem;margin-left:0}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0gom:only-child{border-radius:.5rem}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0goy{background:#d2d4d4}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0goz{background:#0b8940}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0go10{background:#d2d4d4;cursor:not-allowed}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0go11{background:#91467f}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0go11:hover{background:#6e3c65}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0go12{background:#de002e}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0go12:hover{background:#a30d2d}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0go13{background:#007db8}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0go13:hover{background:#09638d}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0go14{background:#e7760b}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0go14:hover{background:#aa5e14}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0go15{background:#717779}.pkg_sps-woodland_progress-indicators__version_8_52_0__hash_17lj0go15:hover{background:#1f282c}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sps-woodland/progress-indicators",
|
|
3
3
|
"description": "SPS Woodland Design System progress indicator components",
|
|
4
|
-
"version": "8.
|
|
4
|
+
"version": "8.52.0",
|
|
5
5
|
"author": "SPS Commerce",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"repository": "https://github.com/SPSCommerce/woodland/tree/main/packages/@sps-woodland/progress-indicators",
|
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
"import": "./lib/index.js",
|
|
18
18
|
"default": "./lib/index.js"
|
|
19
19
|
},
|
|
20
|
-
"./style.css": "./lib/style.css",
|
|
21
20
|
"./lib/style.css": {
|
|
22
21
|
"import": "./lib/style.css",
|
|
23
22
|
"require": "./lib/style.css"
|
|
@@ -30,21 +29,28 @@
|
|
|
30
29
|
"@spscommerce/utils": "^7.0.0 || ^8.0.0 || ^9.0.0",
|
|
31
30
|
"react": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
32
31
|
"react-dom": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
33
|
-
"@
|
|
34
|
-
"@sps-woodland/core": "8.
|
|
32
|
+
"@sps-woodland/buttons": "8.52.0",
|
|
33
|
+
"@sps-woodland/core": "8.52.0",
|
|
34
|
+
"@sps-woodland/tokens": "8.52.0",
|
|
35
|
+
"@spscommerce/ds-react": "8.52.0",
|
|
36
|
+
"@spscommerce/i18n": "8.52.0"
|
|
35
37
|
},
|
|
36
38
|
"devDependencies": {
|
|
37
39
|
"@spscommerce/utils": "9.0.3",
|
|
40
|
+
"@vanilla-extract/css": "1.17.4",
|
|
41
|
+
"@vanilla-extract/recipes": "0.2.5",
|
|
38
42
|
"react": "16.14.0",
|
|
39
43
|
"react-dom": "16.14.0",
|
|
40
|
-
"@sps-woodland/
|
|
41
|
-
"@
|
|
44
|
+
"@sps-woodland/buttons": "8.52.0",
|
|
45
|
+
"@sps-woodland/core": "8.52.0",
|
|
46
|
+
"@sps-woodland/tokens": "8.52.0",
|
|
47
|
+
"@spscommerce/ds-react": "8.52.0",
|
|
48
|
+
"@spscommerce/i18n": "8.52.0"
|
|
42
49
|
},
|
|
43
50
|
"scripts": {
|
|
44
|
-
"build": "pnpm run build:js && pnpm run build:types
|
|
51
|
+
"build": "pnpm run build:js && pnpm run build:types",
|
|
45
52
|
"build:js": "vite build",
|
|
46
53
|
"build:types": "tsc --emitDeclarationOnly --declaration --declarationDir lib",
|
|
47
|
-
"build:css": "cp ../core/lib/progress-indicators/style.css lib/style.css 2>/dev/null || echo 'progress-indicators style.css not found, skipping'",
|
|
48
54
|
"watch": "vite build --watch",
|
|
49
55
|
"clean": "git clean -fdX",
|
|
50
56
|
"pub": "node ../../../scripts/publish-package.mjs"
|
package/vite.config.mjs
CHANGED
|
@@ -1,24 +1,31 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
+
import { vanillaExtractPlugin } from "@vanilla-extract/vite-plugin";
|
|
2
3
|
import { defineConfig } from "vite";
|
|
4
|
+
import { getVanillaExtractPluginProps } from "../../../scripts/vanilla-extract-plugin-props.mjs";
|
|
3
5
|
import pkg from "./package.json";
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
// No vanilla-extract needed - CSS is provided by the mono-package.
|
|
7
|
-
|
|
8
|
-
const peerDeps = pkg.peerDependencies ? Object.keys(pkg.peerDependencies) : [];
|
|
7
|
+
const packageVersion = process.env.PREDICTED_VERSION || pkg.version;
|
|
9
8
|
|
|
10
9
|
export default defineConfig({
|
|
10
|
+
plugins: [
|
|
11
|
+
vanillaExtractPlugin(
|
|
12
|
+
getVanillaExtractPluginProps({
|
|
13
|
+
packageName: pkg.name,
|
|
14
|
+
packageVersion,
|
|
15
|
+
})
|
|
16
|
+
),
|
|
17
|
+
],
|
|
11
18
|
build: {
|
|
12
19
|
lib: {
|
|
13
20
|
entry: path.resolve(__dirname, "src/index.ts"),
|
|
14
21
|
name: "ProgressIndicators",
|
|
15
22
|
fileName: "index",
|
|
23
|
+
cssFileName: "style",
|
|
16
24
|
},
|
|
17
25
|
outDir: path.resolve(__dirname, "./lib"),
|
|
18
26
|
emptyOutDir: false,
|
|
19
27
|
rollupOptions: {
|
|
20
|
-
|
|
21
|
-
external: (id) => !id.endsWith(".css") && peerDeps.some((dep) => id === dep || id.startsWith(dep + "/")),
|
|
28
|
+
external: pkg.peerDependencies ? Object.keys(pkg.peerDependencies) : [],
|
|
22
29
|
},
|
|
23
30
|
},
|
|
24
31
|
});
|