@phillips/seldon 1.206.0 → 1.208.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/dist/components/ProgressIndicator/ProgressIndicator.d.ts +1 -1
- package/dist/components/ProgressIndicator/ProgressIndicator.js +35 -34
- package/dist/patterns/CountryPicker/CountryPicker.js +40 -38
- package/dist/patterns/CountryPicker/CountryPickerTrigger.d.ts +4 -0
- package/dist/patterns/CountryPicker/CountryPickerTrigger.js +34 -23
- package/dist/patterns/PhoneNumberInput/PhoneNumberInput.js +37 -36
- package/dist/patterns/ProgressWizard/ProgressWizard.d.ts +1 -1
- package/dist/patterns/ProgressWizard/ProgressWizard.js +35 -27
- package/dist/patterns/ProgressWizard/ProgressWizard.stories.d.ts +18 -443
- package/dist/patterns/ProgressWizard/types.d.ts +4 -4
- package/dist/patterns/ProgressWizard/utils.js +6 -12
- package/dist/scss/components/ComposedModal/_composedModal.scss +10 -0
- package/dist/scss/patterns/ProgressWizard/_progressWizard.scss +4 -0
- package/package.json +1 -1
|
@@ -1,62 +1,63 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
2
|
-
import { Root as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { getCommonProps as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { TextVariants as
|
|
1
|
+
import { jsx as r, jsxs as d } from "react/jsx-runtime";
|
|
2
|
+
import { Root as P } from "../../node_modules/@radix-ui/react-progress/dist/index.js";
|
|
3
|
+
import { forwardRef as $, Fragment as C } from "react";
|
|
4
|
+
import { getCommonProps as I } from "../../utils/index.js";
|
|
5
|
+
import h from "../../node_modules/classnames/index.js";
|
|
6
|
+
import S from "../Icon/Icon.js";
|
|
7
|
+
import { TextVariants as p } from "../Text/types.js";
|
|
8
8
|
import _ from "../Text/Text.js";
|
|
9
|
-
const
|
|
9
|
+
const T = $(
|
|
10
10
|
({
|
|
11
|
-
totalSteps:
|
|
11
|
+
totalSteps: i,
|
|
12
12
|
currentStep: f,
|
|
13
13
|
className: u,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
14
|
+
stepLabels: e,
|
|
15
|
+
progressIndicatorAriaLabel: g = "Progress Indicator",
|
|
16
|
+
completedIconAriaLabel: N = "Completed Icon",
|
|
17
|
+
...n
|
|
18
|
+
}, v) => {
|
|
19
|
+
const { className: a, ...M } = I(n, "ProgressIndicator");
|
|
20
|
+
if (i <= 0) return null;
|
|
21
|
+
const t = Math.max(1, Math.min(10, Math.floor(i))), c = Math.max(1, Math.min(t, Math.floor(f)));
|
|
22
|
+
return /* @__PURE__ */ r("div", { ...M, className: h(a, u), ...n, ref: v, children: /* @__PURE__ */ r(P, { value: c, max: t, "aria-label": g, children: /* @__PURE__ */ r("div", { className: `${a}__steps`, children: Array.from({ length: t }).map((x, o) => {
|
|
23
|
+
const s = o + 1, m = c > s, l = c === s;
|
|
24
|
+
return /* @__PURE__ */ d(C, { children: [
|
|
25
|
+
/* @__PURE__ */ d(
|
|
25
26
|
"div",
|
|
26
27
|
{
|
|
27
28
|
className: `${a}__item`,
|
|
28
|
-
"aria-current":
|
|
29
|
-
"data-testid": `progress-step-${
|
|
29
|
+
"aria-current": l ? "step" : void 0,
|
|
30
|
+
"data-testid": `progress-step-${s}`,
|
|
30
31
|
children: [
|
|
31
32
|
/* @__PURE__ */ r(
|
|
32
33
|
"span",
|
|
33
34
|
{
|
|
34
|
-
className:
|
|
35
|
-
[`${a}__circle--active`]:
|
|
36
|
-
[`${a}__circle--current`]:
|
|
35
|
+
className: h(`${a}__circle`, {
|
|
36
|
+
[`${a}__circle--active`]: m,
|
|
37
|
+
[`${a}__circle--current`]: l
|
|
37
38
|
}),
|
|
38
|
-
children:
|
|
39
|
-
|
|
39
|
+
children: m ? /* @__PURE__ */ r(
|
|
40
|
+
S,
|
|
40
41
|
{
|
|
41
42
|
icon: "Success",
|
|
42
|
-
"aria-label":
|
|
43
|
+
"aria-label": N,
|
|
43
44
|
color: "currentColor",
|
|
44
45
|
width: 20,
|
|
45
46
|
height: 20
|
|
46
47
|
}
|
|
47
|
-
) : /* @__PURE__ */ r(_, { variant:
|
|
48
|
+
) : /* @__PURE__ */ r(_, { variant: p.badge, children: s })
|
|
48
49
|
}
|
|
49
50
|
),
|
|
50
|
-
e
|
|
51
|
+
e && e[o] && /* @__PURE__ */ r("span", { className: `${a}__label`, children: /* @__PURE__ */ r(_, { variant: p.string2, children: e[o] }) })
|
|
51
52
|
]
|
|
52
53
|
}
|
|
53
54
|
),
|
|
54
|
-
|
|
55
|
-
] }, e
|
|
55
|
+
o < t - 1 ? /* @__PURE__ */ r("div", { className: `${a}__connector`, "aria-hidden": "true" }) : null
|
|
56
|
+
] }, e?.[o] || o);
|
|
56
57
|
}) }) }) });
|
|
57
58
|
}
|
|
58
59
|
);
|
|
59
|
-
|
|
60
|
+
T.displayName = "ProgressIndicator";
|
|
60
61
|
export {
|
|
61
|
-
|
|
62
|
+
T as default
|
|
62
63
|
};
|
|
@@ -1,52 +1,54 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { getCommonProps as
|
|
6
|
-
import { toConfig as
|
|
7
|
-
const
|
|
1
|
+
import { jsxs as v, Fragment as N, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as j, useState as M } from "react";
|
|
3
|
+
import O from "./CountryPickerTrigger.js";
|
|
4
|
+
import T from "./CountryPickerModal.js";
|
|
5
|
+
import { getCommonProps as w } from "../../utils/index.js";
|
|
6
|
+
import { toConfig as l } from "./types.js";
|
|
7
|
+
const E = j(
|
|
8
8
|
({
|
|
9
|
-
triggerLabelText:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
triggerLabelText: m,
|
|
10
|
+
triggerAriaLabel: c,
|
|
11
|
+
hasTriggerError: u,
|
|
12
|
+
triggerErrorMsg: f,
|
|
13
|
+
triggerDisplayValue: p,
|
|
14
|
+
modalTitle: d,
|
|
15
|
+
searchInputLabel: C,
|
|
16
|
+
searchInputPlaceholder: y,
|
|
17
|
+
selectButtonLabel: k,
|
|
17
18
|
inputName: o,
|
|
18
|
-
baseClassName:
|
|
19
|
+
baseClassName: P = "CountryPicker",
|
|
19
20
|
value: t,
|
|
20
|
-
onChange:
|
|
21
|
-
isPhone:
|
|
22
|
-
...
|
|
23
|
-
},
|
|
24
|
-
const [x, i] =
|
|
25
|
-
modalTitle:
|
|
26
|
-
searchInputLabel:
|
|
27
|
-
searchInputPlaceholder:
|
|
28
|
-
selectButtonLabel:
|
|
21
|
+
onChange: a,
|
|
22
|
+
isPhone: g,
|
|
23
|
+
...s
|
|
24
|
+
}, b) => {
|
|
25
|
+
const [x, i] = M(!1), { className: n } = w(s, P), h = {
|
|
26
|
+
modalTitle: d,
|
|
27
|
+
searchInputLabel: C,
|
|
28
|
+
searchInputPlaceholder: y,
|
|
29
|
+
selectButtonLabel: k,
|
|
29
30
|
inputName: o,
|
|
30
|
-
...
|
|
31
|
-
}, r =
|
|
32
|
-
return /* @__PURE__ */
|
|
31
|
+
...s
|
|
32
|
+
}, r = g ? l(!0, t, a) : l(!1, t, a);
|
|
33
|
+
return /* @__PURE__ */ v(N, { children: [
|
|
33
34
|
/* @__PURE__ */ e(
|
|
34
|
-
|
|
35
|
+
O,
|
|
35
36
|
{
|
|
36
|
-
ref:
|
|
37
|
-
labelText:
|
|
38
|
-
|
|
37
|
+
ref: b,
|
|
38
|
+
labelText: m,
|
|
39
|
+
ariaLabel: c,
|
|
40
|
+
displayValue: p,
|
|
39
41
|
onClick: () => i(!0),
|
|
40
|
-
hasError:
|
|
41
|
-
errorMsg:
|
|
42
|
+
hasError: u,
|
|
43
|
+
errorMsg: f,
|
|
42
44
|
variantConfig: r,
|
|
43
45
|
baseClassName: n
|
|
44
46
|
}
|
|
45
47
|
),
|
|
46
48
|
/* @__PURE__ */ e(
|
|
47
|
-
|
|
49
|
+
T,
|
|
48
50
|
{
|
|
49
|
-
...
|
|
51
|
+
...h,
|
|
50
52
|
isOpen: x,
|
|
51
53
|
onClose: () => i(!1),
|
|
52
54
|
variantConfig: r,
|
|
@@ -65,7 +67,7 @@ const w = N(
|
|
|
65
67
|
] });
|
|
66
68
|
}
|
|
67
69
|
);
|
|
68
|
-
|
|
70
|
+
E.displayName = "CountryPicker";
|
|
69
71
|
export {
|
|
70
|
-
|
|
72
|
+
E as default
|
|
71
73
|
};
|
|
@@ -4,6 +4,10 @@ export type CountryPickerTriggerProps = {
|
|
|
4
4
|
* The label text displayed above the button.
|
|
5
5
|
*/
|
|
6
6
|
labelText: string;
|
|
7
|
+
/**
|
|
8
|
+
* The aria-label attribute for the button, defaults to labelText if not provided.
|
|
9
|
+
*/
|
|
10
|
+
ariaLabel?: string;
|
|
7
11
|
/**
|
|
8
12
|
* The value displayed inside the button (e.g., selected country name or phone code).
|
|
9
13
|
*/
|
|
@@ -1,24 +1,35 @@
|
|
|
1
1
|
import { jsxs as d, jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { TextVariants as
|
|
4
|
-
import
|
|
2
|
+
import y from "../../components/Icon/Icon.js";
|
|
3
|
+
import { TextVariants as k } from "../../components/Text/types.js";
|
|
4
|
+
import P from "../../components/Text/Text.js";
|
|
5
5
|
import t from "../../node_modules/classnames/index.js";
|
|
6
|
-
import { countries as
|
|
7
|
-
import { forwardRef as
|
|
8
|
-
import { useNormalizedInputProps as
|
|
9
|
-
const
|
|
10
|
-
({
|
|
11
|
-
|
|
6
|
+
import { countries as w } from "./constants.js";
|
|
7
|
+
import { forwardRef as I } from "react";
|
|
8
|
+
import { useNormalizedInputProps as T, px as b } from "../../utils/index.js";
|
|
9
|
+
const j = I(
|
|
10
|
+
({
|
|
11
|
+
labelText: l,
|
|
12
|
+
ariaLabel: p = l,
|
|
13
|
+
displayValue: m,
|
|
14
|
+
onClick: _,
|
|
15
|
+
hasError: o = !1,
|
|
16
|
+
errorMsg: s,
|
|
17
|
+
id: e,
|
|
18
|
+
className: f,
|
|
19
|
+
baseClassName: r,
|
|
20
|
+
variantConfig: u
|
|
21
|
+
}, v) => {
|
|
22
|
+
const { isPhone: a, value: c } = u, n = T({
|
|
12
23
|
id: "country-picker-trigger-input",
|
|
13
24
|
invalid: o,
|
|
14
|
-
invalidText:
|
|
25
|
+
invalidText: s,
|
|
15
26
|
type: "text"
|
|
16
|
-
}),
|
|
17
|
-
return /* @__PURE__ */ d("div", { className: t(`${r}__trigger`,
|
|
27
|
+
}), $ = n.invalidId, g = a ? c : w.filter((x) => x.name === c)?.[0]?.code, h = () => n.validation ? n.validation : /* @__PURE__ */ i("p", { className: `${b}-input__validation`, children: " " });
|
|
28
|
+
return /* @__PURE__ */ d("div", { className: t(`${r}__trigger`, f), children: [
|
|
18
29
|
/* @__PURE__ */ i(
|
|
19
|
-
|
|
30
|
+
P,
|
|
20
31
|
{
|
|
21
|
-
variant:
|
|
32
|
+
variant: k.string2,
|
|
22
33
|
className: t(`${r}__trigger-label`, {
|
|
23
34
|
[`${r}__trigger-label--error`]: o
|
|
24
35
|
}),
|
|
@@ -29,16 +40,16 @@ const b = w(
|
|
|
29
40
|
/* @__PURE__ */ d(
|
|
30
41
|
"button",
|
|
31
42
|
{
|
|
32
|
-
ref:
|
|
43
|
+
ref: v,
|
|
33
44
|
type: "button",
|
|
34
|
-
"aria-label":
|
|
45
|
+
"aria-label": p,
|
|
35
46
|
"aria-invalid": n.invalid,
|
|
36
|
-
"aria-describedby":
|
|
47
|
+
"aria-describedby": $,
|
|
37
48
|
className: t(`${r}__trigger-btn`, {
|
|
38
49
|
[`${r}__trigger-btn--error`]: o,
|
|
39
50
|
[`${r}__trigger-btn--is-phone`]: a
|
|
40
51
|
}),
|
|
41
|
-
onClick:
|
|
52
|
+
onClick: _,
|
|
42
53
|
"data-testid": "country-picker-trigger",
|
|
43
54
|
id: e,
|
|
44
55
|
children: [
|
|
@@ -50,16 +61,16 @@ const b = w(
|
|
|
50
61
|
className: `${r}__trigger-flag`
|
|
51
62
|
}
|
|
52
63
|
),
|
|
53
|
-
/* @__PURE__ */ i("span", { className: t(`${r}__trigger-text`), children:
|
|
54
|
-
/* @__PURE__ */ i("span", { className: t(`${r}__trigger-icon`), children: /* @__PURE__ */ i(
|
|
64
|
+
/* @__PURE__ */ i("span", { className: t(`${r}__trigger-text`), children: m }),
|
|
65
|
+
/* @__PURE__ */ i("span", { className: t(`${r}__trigger-icon`), children: /* @__PURE__ */ i(y, { icon: "ChevronDown", color: "black-100", width: 16, height: 16 }) })
|
|
55
66
|
]
|
|
56
67
|
}
|
|
57
68
|
),
|
|
58
|
-
!a &&
|
|
69
|
+
!a && h()
|
|
59
70
|
] });
|
|
60
71
|
}
|
|
61
72
|
);
|
|
62
|
-
|
|
73
|
+
j.displayName = "CountryPickerTrigger";
|
|
63
74
|
export {
|
|
64
|
-
|
|
75
|
+
j as default
|
|
65
76
|
};
|
|
@@ -1,79 +1,80 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
1
|
+
import { jsxs as p, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import b, { forwardRef as P } from "react";
|
|
3
3
|
import { getCommonProps as _, px as x, useNormalizedInputProps as I } from "../../utils/index.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
4
|
+
import $ from "../../node_modules/classnames/index.js";
|
|
5
|
+
import S from "../CountryPicker/CountryPicker.js";
|
|
6
|
+
import T from "../../components/Input/Input.js";
|
|
7
7
|
import { getSafeCountryCallingCode as L } from "../CountryPicker/utils.js";
|
|
8
8
|
import { countries as j } from "../CountryPicker/constants.js";
|
|
9
9
|
const k = P(
|
|
10
10
|
({
|
|
11
|
-
className:
|
|
12
|
-
value:
|
|
13
|
-
countryCode:
|
|
11
|
+
className: l,
|
|
12
|
+
value: s = "",
|
|
13
|
+
countryCode: c = "",
|
|
14
14
|
handleValueChange: u,
|
|
15
|
-
label:
|
|
15
|
+
label: n = "Phone",
|
|
16
16
|
required: m = !1,
|
|
17
|
-
error:
|
|
17
|
+
error: a,
|
|
18
18
|
errorText: h,
|
|
19
|
-
disabled:
|
|
20
|
-
...
|
|
21
|
-
},
|
|
22
|
-
const { className: t, ...
|
|
23
|
-
u?.(
|
|
24
|
-
},
|
|
19
|
+
disabled: y = !1,
|
|
20
|
+
...f
|
|
21
|
+
}, g) => {
|
|
22
|
+
const { className: t, ...v } = _(f, "PhoneNumberInput"), [o, C] = b.useState(c || void 0), i = j.find((d) => d.code === o), N = (d) => {
|
|
23
|
+
u?.(d.target.value, o || "");
|
|
24
|
+
}, r = I({
|
|
25
25
|
id: "phone-input",
|
|
26
|
-
invalid:
|
|
26
|
+
invalid: a,
|
|
27
27
|
invalidText: h,
|
|
28
28
|
type: "text"
|
|
29
29
|
});
|
|
30
|
-
return /* @__PURE__ */
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
-
/* @__PURE__ */
|
|
33
|
-
/* @__PURE__ */ e("input", { type: "hidden", name: "phoneNumber", value:
|
|
30
|
+
return /* @__PURE__ */ p("div", { ref: g, className: $(`${t}`, l), ...v, children: [
|
|
31
|
+
/* @__PURE__ */ p("div", { className: `${t}__wrapper`, children: [
|
|
32
|
+
/* @__PURE__ */ p("div", { className: `${t}__country-picker`, children: [
|
|
33
|
+
/* @__PURE__ */ e("input", { type: "hidden", name: "phoneNumber", value: s, "data-testid": "phone-number-hidden-input" }),
|
|
34
34
|
/* @__PURE__ */ e(
|
|
35
35
|
"input",
|
|
36
36
|
{
|
|
37
37
|
type: "hidden",
|
|
38
38
|
name: "phoneCountryCode",
|
|
39
|
-
value:
|
|
39
|
+
value: o || "",
|
|
40
40
|
"data-testid": "phone-country-code-hidden-input"
|
|
41
41
|
}
|
|
42
42
|
),
|
|
43
43
|
/* @__PURE__ */ e(
|
|
44
|
-
|
|
44
|
+
S,
|
|
45
45
|
{
|
|
46
|
-
triggerLabelText:
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
triggerLabelText: n,
|
|
47
|
+
triggerAriaLabel: `${n.replace("*", "")} country`,
|
|
48
|
+
triggerDisplayValue: i ? `+${L(i.code)}` : "",
|
|
49
|
+
hasTriggerError: !!a,
|
|
49
50
|
modalTitle: "Country code",
|
|
50
51
|
searchInputLabel: "Search country",
|
|
51
52
|
searchInputPlaceholder: "Search country",
|
|
52
53
|
selectButtonLabel: "Select",
|
|
53
54
|
isPhone: !0,
|
|
54
|
-
value:
|
|
55
|
-
onChange:
|
|
55
|
+
value: i?.code,
|
|
56
|
+
onChange: C
|
|
56
57
|
}
|
|
57
58
|
)
|
|
58
59
|
] }),
|
|
59
60
|
/* @__PURE__ */ e("div", { className: `${t}__input`, children: /* @__PURE__ */ e(
|
|
60
|
-
|
|
61
|
+
T,
|
|
61
62
|
{
|
|
62
63
|
id: "phone-input",
|
|
63
64
|
type: "tel",
|
|
64
|
-
labelText:
|
|
65
|
+
labelText: `${n.replace("*", "")} phone`,
|
|
65
66
|
hideLabel: !0,
|
|
66
|
-
value:
|
|
67
|
-
onChange:
|
|
67
|
+
value: s,
|
|
68
|
+
onChange: N,
|
|
68
69
|
required: m,
|
|
69
|
-
invalid: !!
|
|
70
|
-
disabled:
|
|
70
|
+
invalid: !!a,
|
|
71
|
+
disabled: y,
|
|
71
72
|
invalidText: "",
|
|
72
|
-
"aria-describedby":
|
|
73
|
+
"aria-describedby": r.invalidId
|
|
73
74
|
}
|
|
74
75
|
) })
|
|
75
76
|
] }),
|
|
76
|
-
|
|
77
|
+
r.validation ? r.validation : /* @__PURE__ */ e("p", { className: `${x}-input__validation`, children: " " })
|
|
77
78
|
] });
|
|
78
79
|
}
|
|
79
80
|
);
|
|
@@ -2,7 +2,7 @@ import { CallbackProps, ProgressWizardBaseProps } from './types';
|
|
|
2
2
|
/**
|
|
3
3
|
* Props for the main ProgressWizard component.
|
|
4
4
|
*
|
|
5
|
-
* @property
|
|
5
|
+
* @property isFullHeight - Sets the wizard component to take up all available height of its container. Defaults true.
|
|
6
6
|
* @property hideNavigation - If true, hides the default footer navigation. When hidden you must manage step index changes yourself (e.g. via currentStepIndex prop)
|
|
7
7
|
* @property hideProgressIndicator - If true, hides the progress indicator bar.
|
|
8
8
|
* @property isEnableHistoryManagement - If true step advances push a history state so the browser back/forward buttons navigate between steps. Default is false and if you want this behavior you should use the useHistoryManagement hook directly in your controlling component.
|
|
@@ -5,13 +5,13 @@ import { useHistoryManagement as T } from "./hooks/useHistoryManagement.js";
|
|
|
5
5
|
import { getCommonProps as Y } from "../../utils/index.js";
|
|
6
6
|
import { ProgressWizardFooter as D } from "./components/ProgressWizardFooter.js";
|
|
7
7
|
import G from "../../components/ProgressIndicator/ProgressIndicator.js";
|
|
8
|
-
import { isControlled as
|
|
8
|
+
import { isControlled as p, getLabelsFromChildren as J, wrapChildren as K } from "./utils.js";
|
|
9
9
|
const O = B((g, f) => {
|
|
10
10
|
const {
|
|
11
|
-
|
|
11
|
+
isFullHeight: S = !0,
|
|
12
12
|
hideNavigation: a,
|
|
13
13
|
hideProgressIndicator: h,
|
|
14
|
-
isEnableHistoryManagement:
|
|
14
|
+
isEnableHistoryManagement: c = !1,
|
|
15
15
|
currentStepIndex: r,
|
|
16
16
|
defaultStepIndex: I,
|
|
17
17
|
shouldAllowContinue: x = !0,
|
|
@@ -23,40 +23,40 @@ const O = B((g, f) => {
|
|
|
23
23
|
onFormSubmit: y,
|
|
24
24
|
children: z,
|
|
25
25
|
...W
|
|
26
|
-
} = g, { className:
|
|
26
|
+
} = g, { className: t, ...N } = Y(W, "ProgressWizard");
|
|
27
27
|
let i = I;
|
|
28
28
|
i !== void 0 && r !== void 0 && (console.warn(
|
|
29
29
|
"ProgressWizard: Both defaultStepIndex and currentStepIndex props are provided. defaultStepIndex will be ignored."
|
|
30
30
|
), i = void 0);
|
|
31
|
-
const [
|
|
31
|
+
const [u, L] = q(i ?? 0), m = E(
|
|
32
32
|
(A) => {
|
|
33
|
-
!a && !
|
|
33
|
+
!a && !p(r) && L(A);
|
|
34
34
|
},
|
|
35
35
|
[a, r]
|
|
36
36
|
), e = d(
|
|
37
|
-
() => r ??
|
|
38
|
-
[r,
|
|
37
|
+
() => r ?? u,
|
|
38
|
+
[r, u]
|
|
39
39
|
);
|
|
40
|
-
|
|
40
|
+
c && p(r) && console.warn(
|
|
41
41
|
"ProgressWizard: History management is disabled in controlled mode (currentStepIndex prop). To enable history management, remove the currentStepIndex prop. You may also import and use the useHistoryManagement hook directly in your controlling component."
|
|
42
42
|
);
|
|
43
|
-
const
|
|
44
|
-
() => K(
|
|
45
|
-
[
|
|
46
|
-
), n =
|
|
47
|
-
(!
|
|
43
|
+
const o = R.toArray(z), $ = d(() => J(o), [o]), H = d(
|
|
44
|
+
() => K(o, e, t),
|
|
45
|
+
[o, e, t]
|
|
46
|
+
), n = o.length;
|
|
47
|
+
(!o || n === 0) && console.warn(
|
|
48
48
|
"ProgressWizard: No children provided. At least one child is required to render steps, two for normal behavior."
|
|
49
|
-
),
|
|
50
|
-
enabled: !
|
|
49
|
+
), o[e] || console.warn(`ProgressWizard: currentStepIndex ${e} is out of bounds (0 to ${n - 1})`), T({
|
|
50
|
+
enabled: !p(r) && c,
|
|
51
51
|
currentStepIndex: e,
|
|
52
52
|
stepCount: n,
|
|
53
|
-
setCurrentStepIndex:
|
|
53
|
+
setCurrentStepIndex: m
|
|
54
54
|
});
|
|
55
|
-
const F = e === 0,
|
|
56
|
-
setCurrentStepIndex:
|
|
55
|
+
const F = e === 0, _ = e === n - 1, M = H, k = {
|
|
56
|
+
setCurrentStepIndex: m,
|
|
57
57
|
isFirstStep: F,
|
|
58
|
-
isLastStep:
|
|
59
|
-
baseClassName:
|
|
58
|
+
isLastStep: _,
|
|
59
|
+
baseClassName: t,
|
|
60
60
|
shouldAllowContinue: x,
|
|
61
61
|
isLoading: [l.Loading, l.Submitting].includes(C),
|
|
62
62
|
labels: b,
|
|
@@ -65,12 +65,20 @@ const O = B((g, f) => {
|
|
|
65
65
|
onCancel: w,
|
|
66
66
|
onFormSubmit: y
|
|
67
67
|
};
|
|
68
|
-
return /* @__PURE__ */ j(
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
68
|
+
return /* @__PURE__ */ j(
|
|
69
|
+
"section",
|
|
70
|
+
{
|
|
71
|
+
...N,
|
|
72
|
+
className: `${t}${S ? ` ${t}--full-height` : ""}`,
|
|
73
|
+
ref: f,
|
|
74
|
+
"aria-label": "Progress Wizard",
|
|
75
|
+
children: [
|
|
76
|
+
h ? null : /* @__PURE__ */ s(G, { totalSteps: n, currentStep: e + 1, stepLabels: $ }),
|
|
77
|
+
/* @__PURE__ */ s("div", { className: `${t}__content`, children: M }),
|
|
78
|
+
a ? null : /* @__PURE__ */ s("div", { className: `${t}__footer`, children: /* @__PURE__ */ s(D, { ...k }) })
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
);
|
|
74
82
|
});
|
|
75
83
|
O.displayName = "ProgressWizard";
|
|
76
84
|
export {
|
|
@@ -1,469 +1,44 @@
|
|
|
1
|
-
import { ProgressWizardProps } from './ProgressWizard';
|
|
2
|
-
import { ArgTypes } from '@storybook/react';
|
|
3
|
-
declare const meta:
|
|
4
|
-
title: string;
|
|
5
|
-
component: import('react').ForwardRefExoticComponent<ProgressWizardProps & {
|
|
6
|
-
children?: import('react').ReactNode | undefined;
|
|
7
|
-
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
8
|
-
};
|
|
9
|
-
export default meta;
|
|
1
|
+
import { default as ProgressWizard, ProgressWizardProps } from './ProgressWizard';
|
|
2
|
+
import { Meta, ArgTypes } from '@storybook/react';
|
|
3
|
+
declare const meta: Meta<typeof ProgressWizard>;
|
|
10
4
|
export declare const BasicWizard: {
|
|
11
|
-
(): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
argTypes:
|
|
13
|
-
readonly customHeader: {
|
|
14
|
-
readonly control: {
|
|
15
|
-
readonly type: "text";
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
readonly hideNavigation: {
|
|
19
|
-
readonly control: {
|
|
20
|
-
readonly type: "boolean";
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
readonly hideProgressIndicator: {
|
|
24
|
-
readonly control: {
|
|
25
|
-
readonly type: "boolean";
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
readonly isEnableHistoryManagement: {
|
|
29
|
-
readonly control: {
|
|
30
|
-
readonly type: "boolean";
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
readonly currentStepIndex: {
|
|
34
|
-
readonly control: {
|
|
35
|
-
readonly type: "number";
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
readonly defaultStepIndex: {
|
|
39
|
-
readonly control: {
|
|
40
|
-
readonly type: "number";
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
readonly shouldAllowContinue: {
|
|
44
|
-
readonly control: {
|
|
45
|
-
readonly type: "boolean";
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
readonly loadingState: {
|
|
49
|
-
readonly control: {
|
|
50
|
-
readonly type: "select";
|
|
51
|
-
};
|
|
52
|
-
readonly options: readonly ["idle", "submitting", "loading"];
|
|
53
|
-
};
|
|
54
|
-
readonly buttonLabels: {
|
|
55
|
-
readonly control: {
|
|
56
|
-
readonly type: "object";
|
|
57
|
-
};
|
|
58
|
-
readonly description: "Object of button labels. Keys are start / cancel / back / continue / submit";
|
|
59
|
-
};
|
|
60
|
-
readonly onContinue: {
|
|
61
|
-
readonly action: "onContinue";
|
|
62
|
-
};
|
|
63
|
-
readonly onBack: {
|
|
64
|
-
readonly action: "onBack";
|
|
65
|
-
};
|
|
66
|
-
readonly onCancel: {
|
|
67
|
-
readonly action: "onCancel";
|
|
68
|
-
};
|
|
69
|
-
readonly onFormSubmit: {
|
|
70
|
-
readonly action: "onFormSubmit";
|
|
71
|
-
};
|
|
72
|
-
};
|
|
5
|
+
(props: ProgressWizardProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
argTypes: ArgTypes<import('@storybook/csf').Args>;
|
|
73
7
|
};
|
|
74
8
|
export declare const ValidationWizardWithOnBack: {
|
|
75
|
-
(): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
(props: ProgressWizardProps): import("react/jsx-runtime").JSX.Element;
|
|
76
10
|
storyName: string;
|
|
77
|
-
argTypes:
|
|
78
|
-
readonly customHeader: {
|
|
79
|
-
readonly control: {
|
|
80
|
-
readonly type: "text";
|
|
81
|
-
};
|
|
82
|
-
};
|
|
83
|
-
readonly hideNavigation: {
|
|
84
|
-
readonly control: {
|
|
85
|
-
readonly type: "boolean";
|
|
86
|
-
};
|
|
87
|
-
};
|
|
88
|
-
readonly hideProgressIndicator: {
|
|
89
|
-
readonly control: {
|
|
90
|
-
readonly type: "boolean";
|
|
91
|
-
};
|
|
92
|
-
};
|
|
93
|
-
readonly isEnableHistoryManagement: {
|
|
94
|
-
readonly control: {
|
|
95
|
-
readonly type: "boolean";
|
|
96
|
-
};
|
|
97
|
-
};
|
|
98
|
-
readonly currentStepIndex: {
|
|
99
|
-
readonly control: {
|
|
100
|
-
readonly type: "number";
|
|
101
|
-
};
|
|
102
|
-
};
|
|
103
|
-
readonly defaultStepIndex: {
|
|
104
|
-
readonly control: {
|
|
105
|
-
readonly type: "number";
|
|
106
|
-
};
|
|
107
|
-
};
|
|
108
|
-
readonly shouldAllowContinue: {
|
|
109
|
-
readonly control: {
|
|
110
|
-
readonly type: "boolean";
|
|
111
|
-
};
|
|
112
|
-
};
|
|
113
|
-
readonly loadingState: {
|
|
114
|
-
readonly control: {
|
|
115
|
-
readonly type: "select";
|
|
116
|
-
};
|
|
117
|
-
readonly options: readonly ["idle", "submitting", "loading"];
|
|
118
|
-
};
|
|
119
|
-
readonly buttonLabels: {
|
|
120
|
-
readonly control: {
|
|
121
|
-
readonly type: "object";
|
|
122
|
-
};
|
|
123
|
-
readonly description: "Object of button labels. Keys are start / cancel / back / continue / submit";
|
|
124
|
-
};
|
|
125
|
-
readonly onContinue: {
|
|
126
|
-
readonly action: "onContinue";
|
|
127
|
-
};
|
|
128
|
-
readonly onBack: {
|
|
129
|
-
readonly action: "onBack";
|
|
130
|
-
};
|
|
131
|
-
readonly onCancel: {
|
|
132
|
-
readonly action: "onCancel";
|
|
133
|
-
};
|
|
134
|
-
readonly onFormSubmit: {
|
|
135
|
-
readonly action: "onFormSubmit";
|
|
136
|
-
};
|
|
137
|
-
};
|
|
11
|
+
argTypes: ArgTypes<import('@storybook/csf').Args>;
|
|
138
12
|
};
|
|
139
13
|
export declare const AsyncValidationWizardWithAllCallbacks: {
|
|
140
|
-
(): import("react/jsx-runtime").JSX.Element;
|
|
141
|
-
argTypes:
|
|
142
|
-
readonly customHeader: {
|
|
143
|
-
readonly control: {
|
|
144
|
-
readonly type: "text";
|
|
145
|
-
};
|
|
146
|
-
};
|
|
147
|
-
readonly hideNavigation: {
|
|
148
|
-
readonly control: {
|
|
149
|
-
readonly type: "boolean";
|
|
150
|
-
};
|
|
151
|
-
};
|
|
152
|
-
readonly hideProgressIndicator: {
|
|
153
|
-
readonly control: {
|
|
154
|
-
readonly type: "boolean";
|
|
155
|
-
};
|
|
156
|
-
};
|
|
157
|
-
readonly isEnableHistoryManagement: {
|
|
158
|
-
readonly control: {
|
|
159
|
-
readonly type: "boolean";
|
|
160
|
-
};
|
|
161
|
-
};
|
|
162
|
-
readonly currentStepIndex: {
|
|
163
|
-
readonly control: {
|
|
164
|
-
readonly type: "number";
|
|
165
|
-
};
|
|
166
|
-
};
|
|
167
|
-
readonly defaultStepIndex: {
|
|
168
|
-
readonly control: {
|
|
169
|
-
readonly type: "number";
|
|
170
|
-
};
|
|
171
|
-
};
|
|
172
|
-
readonly shouldAllowContinue: {
|
|
173
|
-
readonly control: {
|
|
174
|
-
readonly type: "boolean";
|
|
175
|
-
};
|
|
176
|
-
};
|
|
177
|
-
readonly loadingState: {
|
|
178
|
-
readonly control: {
|
|
179
|
-
readonly type: "select";
|
|
180
|
-
};
|
|
181
|
-
readonly options: readonly ["idle", "submitting", "loading"];
|
|
182
|
-
};
|
|
183
|
-
readonly buttonLabels: {
|
|
184
|
-
readonly control: {
|
|
185
|
-
readonly type: "object";
|
|
186
|
-
};
|
|
187
|
-
readonly description: "Object of button labels. Keys are start / cancel / back / continue / submit";
|
|
188
|
-
};
|
|
189
|
-
readonly onContinue: {
|
|
190
|
-
readonly action: "onContinue";
|
|
191
|
-
};
|
|
192
|
-
readonly onBack: {
|
|
193
|
-
readonly action: "onBack";
|
|
194
|
-
};
|
|
195
|
-
readonly onCancel: {
|
|
196
|
-
readonly action: "onCancel";
|
|
197
|
-
};
|
|
198
|
-
readonly onFormSubmit: {
|
|
199
|
-
readonly action: "onFormSubmit";
|
|
200
|
-
};
|
|
201
|
-
};
|
|
14
|
+
(props: ProgressWizardProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
argTypes: ArgTypes<import('@storybook/csf').Args>;
|
|
202
16
|
};
|
|
203
17
|
export declare const ShouldAllowContinue: {
|
|
204
|
-
(): import("react/jsx-runtime").JSX.Element;
|
|
205
|
-
argTypes:
|
|
206
|
-
readonly customHeader: {
|
|
207
|
-
readonly control: {
|
|
208
|
-
readonly type: "text";
|
|
209
|
-
};
|
|
210
|
-
};
|
|
211
|
-
readonly hideNavigation: {
|
|
212
|
-
readonly control: {
|
|
213
|
-
readonly type: "boolean";
|
|
214
|
-
};
|
|
215
|
-
};
|
|
216
|
-
readonly hideProgressIndicator: {
|
|
217
|
-
readonly control: {
|
|
218
|
-
readonly type: "boolean";
|
|
219
|
-
};
|
|
220
|
-
};
|
|
221
|
-
readonly isEnableHistoryManagement: {
|
|
222
|
-
readonly control: {
|
|
223
|
-
readonly type: "boolean";
|
|
224
|
-
};
|
|
225
|
-
};
|
|
226
|
-
readonly currentStepIndex: {
|
|
227
|
-
readonly control: {
|
|
228
|
-
readonly type: "number";
|
|
229
|
-
};
|
|
230
|
-
};
|
|
231
|
-
readonly defaultStepIndex: {
|
|
232
|
-
readonly control: {
|
|
233
|
-
readonly type: "number";
|
|
234
|
-
};
|
|
235
|
-
};
|
|
236
|
-
readonly shouldAllowContinue: {
|
|
237
|
-
readonly control: {
|
|
238
|
-
readonly type: "boolean";
|
|
239
|
-
};
|
|
240
|
-
};
|
|
241
|
-
readonly loadingState: {
|
|
242
|
-
readonly control: {
|
|
243
|
-
readonly type: "select";
|
|
244
|
-
};
|
|
245
|
-
readonly options: readonly ["idle", "submitting", "loading"];
|
|
246
|
-
};
|
|
247
|
-
readonly buttonLabels: {
|
|
248
|
-
readonly control: {
|
|
249
|
-
readonly type: "object";
|
|
250
|
-
};
|
|
251
|
-
readonly description: "Object of button labels. Keys are start / cancel / back / continue / submit";
|
|
252
|
-
};
|
|
253
|
-
readonly onContinue: {
|
|
254
|
-
readonly action: "onContinue";
|
|
255
|
-
};
|
|
256
|
-
readonly onBack: {
|
|
257
|
-
readonly action: "onBack";
|
|
258
|
-
};
|
|
259
|
-
readonly onCancel: {
|
|
260
|
-
readonly action: "onCancel";
|
|
261
|
-
};
|
|
262
|
-
readonly onFormSubmit: {
|
|
263
|
-
readonly action: "onFormSubmit";
|
|
264
|
-
};
|
|
265
|
-
};
|
|
18
|
+
(props: ProgressWizardProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
argTypes: ArgTypes<import('@storybook/csf').Args>;
|
|
266
20
|
};
|
|
267
21
|
export declare const ExternalStepControlWizard: {
|
|
268
|
-
(): import("react/jsx-runtime").JSX.Element;
|
|
269
|
-
argTypes:
|
|
270
|
-
readonly customHeader: {
|
|
271
|
-
readonly control: {
|
|
272
|
-
readonly type: "text";
|
|
273
|
-
};
|
|
274
|
-
};
|
|
275
|
-
readonly hideNavigation: {
|
|
276
|
-
readonly control: {
|
|
277
|
-
readonly type: "boolean";
|
|
278
|
-
};
|
|
279
|
-
};
|
|
280
|
-
readonly hideProgressIndicator: {
|
|
281
|
-
readonly control: {
|
|
282
|
-
readonly type: "boolean";
|
|
283
|
-
};
|
|
284
|
-
};
|
|
285
|
-
readonly isEnableHistoryManagement: {
|
|
286
|
-
readonly control: {
|
|
287
|
-
readonly type: "boolean";
|
|
288
|
-
};
|
|
289
|
-
};
|
|
290
|
-
readonly currentStepIndex: {
|
|
291
|
-
readonly control: {
|
|
292
|
-
readonly type: "number";
|
|
293
|
-
};
|
|
294
|
-
};
|
|
295
|
-
readonly defaultStepIndex: {
|
|
296
|
-
readonly control: {
|
|
297
|
-
readonly type: "number";
|
|
298
|
-
};
|
|
299
|
-
};
|
|
300
|
-
readonly shouldAllowContinue: {
|
|
301
|
-
readonly control: {
|
|
302
|
-
readonly type: "boolean";
|
|
303
|
-
};
|
|
304
|
-
};
|
|
305
|
-
readonly loadingState: {
|
|
306
|
-
readonly control: {
|
|
307
|
-
readonly type: "select";
|
|
308
|
-
};
|
|
309
|
-
readonly options: readonly ["idle", "submitting", "loading"];
|
|
310
|
-
};
|
|
311
|
-
readonly buttonLabels: {
|
|
312
|
-
readonly control: {
|
|
313
|
-
readonly type: "object";
|
|
314
|
-
};
|
|
315
|
-
readonly description: "Object of button labels. Keys are start / cancel / back / continue / submit";
|
|
316
|
-
};
|
|
317
|
-
readonly onContinue: {
|
|
318
|
-
readonly action: "onContinue";
|
|
319
|
-
};
|
|
320
|
-
readonly onBack: {
|
|
321
|
-
readonly action: "onBack";
|
|
322
|
-
};
|
|
323
|
-
readonly onCancel: {
|
|
324
|
-
readonly action: "onCancel";
|
|
325
|
-
};
|
|
326
|
-
readonly onFormSubmit: {
|
|
327
|
-
readonly action: "onFormSubmit";
|
|
328
|
-
};
|
|
329
|
-
};
|
|
22
|
+
(props: ProgressWizardProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
argTypes: ArgTypes<import('@storybook/csf').Args>;
|
|
330
24
|
};
|
|
331
25
|
export declare const TraditionalFormWizard: {
|
|
332
|
-
(): import("react/jsx-runtime").JSX.Element;
|
|
333
|
-
argTypes:
|
|
334
|
-
readonly customHeader: {
|
|
335
|
-
readonly control: {
|
|
336
|
-
readonly type: "text";
|
|
337
|
-
};
|
|
338
|
-
};
|
|
339
|
-
readonly hideNavigation: {
|
|
340
|
-
readonly control: {
|
|
341
|
-
readonly type: "boolean";
|
|
342
|
-
};
|
|
343
|
-
};
|
|
344
|
-
readonly hideProgressIndicator: {
|
|
345
|
-
readonly control: {
|
|
346
|
-
readonly type: "boolean";
|
|
347
|
-
};
|
|
348
|
-
};
|
|
349
|
-
readonly isEnableHistoryManagement: {
|
|
350
|
-
readonly control: {
|
|
351
|
-
readonly type: "boolean";
|
|
352
|
-
};
|
|
353
|
-
};
|
|
354
|
-
readonly currentStepIndex: {
|
|
355
|
-
readonly control: {
|
|
356
|
-
readonly type: "number";
|
|
357
|
-
};
|
|
358
|
-
};
|
|
359
|
-
readonly defaultStepIndex: {
|
|
360
|
-
readonly control: {
|
|
361
|
-
readonly type: "number";
|
|
362
|
-
};
|
|
363
|
-
};
|
|
364
|
-
readonly shouldAllowContinue: {
|
|
365
|
-
readonly control: {
|
|
366
|
-
readonly type: "boolean";
|
|
367
|
-
};
|
|
368
|
-
};
|
|
369
|
-
readonly loadingState: {
|
|
370
|
-
readonly control: {
|
|
371
|
-
readonly type: "select";
|
|
372
|
-
};
|
|
373
|
-
readonly options: readonly ["idle", "submitting", "loading"];
|
|
374
|
-
};
|
|
375
|
-
readonly buttonLabels: {
|
|
376
|
-
readonly control: {
|
|
377
|
-
readonly type: "object";
|
|
378
|
-
};
|
|
379
|
-
readonly description: "Object of button labels. Keys are start / cancel / back / continue / submit";
|
|
380
|
-
};
|
|
381
|
-
readonly onContinue: {
|
|
382
|
-
readonly action: "onContinue";
|
|
383
|
-
};
|
|
384
|
-
readonly onBack: {
|
|
385
|
-
readonly action: "onBack";
|
|
386
|
-
};
|
|
387
|
-
readonly onCancel: {
|
|
388
|
-
readonly action: "onCancel";
|
|
389
|
-
};
|
|
390
|
-
readonly onFormSubmit: {
|
|
391
|
-
readonly action: "onFormSubmit";
|
|
392
|
-
};
|
|
393
|
-
};
|
|
26
|
+
(props: ProgressWizardProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
argTypes: ArgTypes<import('@storybook/csf').Args>;
|
|
394
28
|
};
|
|
395
29
|
export declare const MobileFormStory: {
|
|
396
|
-
(): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
(props: ProgressWizardProps): import("react/jsx-runtime").JSX.Element;
|
|
397
31
|
storyName: string;
|
|
398
32
|
parameters: {
|
|
399
33
|
viewport: {
|
|
400
34
|
defaultViewport: string;
|
|
401
35
|
};
|
|
402
36
|
};
|
|
403
|
-
argTypes:
|
|
404
|
-
readonly customHeader: {
|
|
405
|
-
readonly control: {
|
|
406
|
-
readonly type: "text";
|
|
407
|
-
};
|
|
408
|
-
};
|
|
409
|
-
readonly hideNavigation: {
|
|
410
|
-
readonly control: {
|
|
411
|
-
readonly type: "boolean";
|
|
412
|
-
};
|
|
413
|
-
};
|
|
414
|
-
readonly hideProgressIndicator: {
|
|
415
|
-
readonly control: {
|
|
416
|
-
readonly type: "boolean";
|
|
417
|
-
};
|
|
418
|
-
};
|
|
419
|
-
readonly isEnableHistoryManagement: {
|
|
420
|
-
readonly control: {
|
|
421
|
-
readonly type: "boolean";
|
|
422
|
-
};
|
|
423
|
-
};
|
|
424
|
-
readonly currentStepIndex: {
|
|
425
|
-
readonly control: {
|
|
426
|
-
readonly type: "number";
|
|
427
|
-
};
|
|
428
|
-
};
|
|
429
|
-
readonly defaultStepIndex: {
|
|
430
|
-
readonly control: {
|
|
431
|
-
readonly type: "number";
|
|
432
|
-
};
|
|
433
|
-
};
|
|
434
|
-
readonly shouldAllowContinue: {
|
|
435
|
-
readonly control: {
|
|
436
|
-
readonly type: "boolean";
|
|
437
|
-
};
|
|
438
|
-
};
|
|
439
|
-
readonly loadingState: {
|
|
440
|
-
readonly control: {
|
|
441
|
-
readonly type: "select";
|
|
442
|
-
};
|
|
443
|
-
readonly options: readonly ["idle", "submitting", "loading"];
|
|
444
|
-
};
|
|
445
|
-
readonly buttonLabels: {
|
|
446
|
-
readonly control: {
|
|
447
|
-
readonly type: "object";
|
|
448
|
-
};
|
|
449
|
-
readonly description: "Object of button labels. Keys are start / cancel / back / continue / submit";
|
|
450
|
-
};
|
|
451
|
-
readonly onContinue: {
|
|
452
|
-
readonly action: "onContinue";
|
|
453
|
-
};
|
|
454
|
-
readonly onBack: {
|
|
455
|
-
readonly action: "onBack";
|
|
456
|
-
};
|
|
457
|
-
readonly onCancel: {
|
|
458
|
-
readonly action: "onCancel";
|
|
459
|
-
};
|
|
460
|
-
readonly onFormSubmit: {
|
|
461
|
-
readonly action: "onFormSubmit";
|
|
462
|
-
};
|
|
463
|
-
};
|
|
37
|
+
argTypes: ArgTypes<import('@storybook/csf').Args>;
|
|
464
38
|
};
|
|
465
39
|
export declare const Playground: {
|
|
466
40
|
render: (props: ProgressWizardProps) => JSX.Element;
|
|
467
41
|
args: ProgressWizardProps;
|
|
468
42
|
argTypes: ArgTypes;
|
|
469
43
|
};
|
|
44
|
+
export default meta;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MouseEvent,
|
|
1
|
+
import { MouseEvent, Dispatch, SetStateAction } from 'react';
|
|
2
2
|
/**
|
|
3
3
|
* Describes the loading state of the ProgressWizard. Used to control UI feedback and button states. Mimics remix fetcher state.
|
|
4
4
|
* - 'idle': No loading or submission in progress
|
|
@@ -55,7 +55,7 @@ export type ButtonLabels = {
|
|
|
55
55
|
/**
|
|
56
56
|
* Base props for the ProgressWizard component.
|
|
57
57
|
*
|
|
58
|
-
* @property
|
|
58
|
+
* @property isFullHeight - Sets the wizard component to take up all available height of its container. Defaults true.
|
|
59
59
|
* @property hideNavigation - If true, hides the default footer navigation (consumer is responsible for changing steps)
|
|
60
60
|
* @property hideProgressIndicator - If true, hides the progress indicator bar entirely
|
|
61
61
|
* @property isEnableHistoryManagement - If true (default) advancing steps pushes a browser history state so back/forward navigates steps
|
|
@@ -68,9 +68,9 @@ export type ButtonLabels = {
|
|
|
68
68
|
*/
|
|
69
69
|
export type ProgressWizardBaseProps = {
|
|
70
70
|
/**
|
|
71
|
-
*
|
|
71
|
+
* Sets the wizard component to take up all available height of its container. Defaults true.
|
|
72
72
|
*/
|
|
73
|
-
|
|
73
|
+
isFullHeight?: boolean;
|
|
74
74
|
/**
|
|
75
75
|
* If true, hides the default footer navigation (so you can implement your own)
|
|
76
76
|
*/
|
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
const
|
|
4
|
-
if (n.isValidElement(r)) {
|
|
5
|
-
const a = r.props ?? {};
|
|
6
|
-
return typeof a["aria-label"] == "string" && a["aria-label"] || `Step ${t + 1}`;
|
|
7
|
-
}
|
|
8
|
-
return `Step ${t + 1}`;
|
|
9
|
-
}), c = (e) => e !== void 0;
|
|
2
|
+
import o from "react";
|
|
3
|
+
const i = (e) => `wizard-step-${e}`, l = (e, r, t, a) => o.isValidElement(e) ? /* @__PURE__ */ s("div", { className: r !== t ? `${a}-hidden` : "", children: e }, i(r)) : e, d = (e, r, t) => e.map((a, n) => l(a, n, r, t)), c = (e) => e.map((r) => o.isValidElement(r) && r.props?.["aria-label"] || ""), f = (e) => e !== void 0;
|
|
10
4
|
export {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
i as generateStepId,
|
|
6
|
+
c as getLabelsFromChildren,
|
|
7
|
+
f as isControlled,
|
|
8
|
+
l as wrapChild,
|
|
15
9
|
d as wrapChildren
|
|
16
10
|
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
@use '../../allPartials' as *;
|
|
2
2
|
|
|
3
|
+
$breakpoint-mobile-small: 450px;
|
|
4
|
+
|
|
3
5
|
.#{$px}-composed-modal {
|
|
4
6
|
border-radius: 1rem;
|
|
5
7
|
max-width: 95vw;
|
|
@@ -34,11 +36,19 @@
|
|
|
34
36
|
justify-content: center;
|
|
35
37
|
margin: 0 $spacing-lg;
|
|
36
38
|
padding: $spacing-sm 0 0;
|
|
39
|
+
|
|
40
|
+
@media (max-width: $breakpoint-mobile-small) {
|
|
41
|
+
flex-direction: column;
|
|
42
|
+
}
|
|
37
43
|
}
|
|
38
44
|
|
|
39
45
|
&__btns-group > * {
|
|
40
46
|
flex: 1 1 50%;
|
|
41
47
|
margin: $spacing-xsm 0 0;
|
|
48
|
+
|
|
49
|
+
@media (max-width: $breakpoint-mobile-small) {
|
|
50
|
+
flex: 1 1 auto;
|
|
51
|
+
}
|
|
42
52
|
}
|
|
43
53
|
|
|
44
54
|
&__btns {
|