@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.
@@ -14,7 +14,7 @@ export interface ProgressIndicatorProps extends Progress.ProgressProps, Componen
14
14
  * If supplied, only visible on desktop breakpoints.
15
15
  *
16
16
  */
17
- labels?: string[];
17
+ stepLabels?: string[];
18
18
  /**
19
19
  * Optional class name for additional styling.
20
20
  */
@@ -1,62 +1,63 @@
1
- import { jsx as r, jsxs as m } from "react/jsx-runtime";
2
- import { Root as v } from "../../node_modules/@radix-ui/react-progress/dist/index.js";
3
- import { forwardRef as M, Fragment as P } from "react";
4
- import { getCommonProps as $ } from "../../utils/index.js";
5
- import d from "../../node_modules/classnames/index.js";
6
- import C from "../Icon/Icon.js";
7
- import { TextVariants as h } from "../Text/types.js";
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 I = M(
9
+ const T = $(
10
10
  ({
11
- totalSteps: c,
11
+ totalSteps: i,
12
12
  currentStep: f,
13
13
  className: u,
14
- progressIndicatorAriaLabel: p = "Progress Indicator",
15
- completedIconAriaLabel: b = "Completed Icon",
16
- ...e
17
- }, g) => {
18
- const { className: a, ...N } = $(e, "ProgressIndicator");
19
- if (c <= 0) return null;
20
- const s = Math.max(1, Math.min(10, Math.floor(c))), l = Math.max(1, Math.min(s, Math.floor(f)));
21
- return /* @__PURE__ */ r("div", { ...N, className: d(a, u), ...e, ref: g, children: /* @__PURE__ */ r(v, { value: l, max: s, "aria-label": p, children: /* @__PURE__ */ r("div", { className: `${a}__steps`, children: Array.from({ length: s }).map((T, t) => {
22
- const o = t + 1, i = l > o, n = l === o;
23
- return /* @__PURE__ */ m(P, { children: [
24
- /* @__PURE__ */ m(
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": n ? "step" : void 0,
29
- "data-testid": `progress-step-${o}`,
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: d(`${a}__circle`, {
35
- [`${a}__circle--active`]: i,
36
- [`${a}__circle--current`]: n
35
+ className: h(`${a}__circle`, {
36
+ [`${a}__circle--active`]: m,
37
+ [`${a}__circle--current`]: l
37
38
  }),
38
- children: i ? /* @__PURE__ */ r(
39
- C,
39
+ children: m ? /* @__PURE__ */ r(
40
+ S,
40
41
  {
41
42
  icon: "Success",
42
- "aria-label": b,
43
+ "aria-label": N,
43
44
  color: "currentColor",
44
45
  width: 20,
45
46
  height: 20
46
47
  }
47
- ) : /* @__PURE__ */ r(_, { variant: h.badge, children: o })
48
+ ) : /* @__PURE__ */ r(_, { variant: p.badge, children: s })
48
49
  }
49
50
  ),
50
- e.labels && e.labels[t] && /* @__PURE__ */ r("span", { className: `${a}__label`, children: /* @__PURE__ */ r(_, { variant: h.string2, children: e.labels[t] }) })
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
- t < s - 1 ? /* @__PURE__ */ r("div", { className: `${a}__connector`, "aria-hidden": "true" }) : null
55
- ] }, e.labels ? e.labels[t] : t);
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
- I.displayName = "ProgressIndicator";
60
+ T.displayName = "ProgressIndicator";
60
61
  export {
61
- I as default
62
+ T as default
62
63
  };
@@ -1,52 +1,54 @@
1
- import { jsxs as h, Fragment as v, jsx as e } from "react/jsx-runtime";
2
- import { forwardRef as N, useState as j } from "react";
3
- import M from "./CountryPickerTrigger.js";
4
- import O from "./CountryPickerModal.js";
5
- import { getCommonProps as T } from "../../utils/index.js";
6
- import { toConfig as m } from "./types.js";
7
- const w = N(
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: l,
10
- hasTriggerError: c,
11
- triggerErrorMsg: u,
12
- triggerDisplayValue: f,
13
- modalTitle: p,
14
- searchInputLabel: d,
15
- searchInputPlaceholder: C,
16
- selectButtonLabel: y,
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: k = "CountryPicker",
19
+ baseClassName: P = "CountryPicker",
19
20
  value: t,
20
- onChange: s,
21
- isPhone: P,
22
- ...a
23
- }, g) => {
24
- const [x, i] = j(!1), { className: n } = T(a, k), b = {
25
- modalTitle: p,
26
- searchInputLabel: d,
27
- searchInputPlaceholder: C,
28
- selectButtonLabel: y,
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
- ...a
31
- }, r = P ? m(!0, t, s) : m(!1, t, s);
32
- return /* @__PURE__ */ h(v, { children: [
31
+ ...s
32
+ }, r = g ? l(!0, t, a) : l(!1, t, a);
33
+ return /* @__PURE__ */ v(N, { children: [
33
34
  /* @__PURE__ */ e(
34
- M,
35
+ O,
35
36
  {
36
- ref: g,
37
- labelText: l,
38
- displayValue: f,
37
+ ref: b,
38
+ labelText: m,
39
+ ariaLabel: c,
40
+ displayValue: p,
39
41
  onClick: () => i(!0),
40
- hasError: c,
41
- errorMsg: u,
42
+ hasError: u,
43
+ errorMsg: f,
42
44
  variantConfig: r,
43
45
  baseClassName: n
44
46
  }
45
47
  ),
46
48
  /* @__PURE__ */ e(
47
- O,
49
+ T,
48
50
  {
49
- ...b,
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
- w.displayName = "CountryPicker";
70
+ E.displayName = "CountryPicker";
69
71
  export {
70
- w as default
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 x from "../../components/Icon/Icon.js";
3
- import { TextVariants as y } from "../../components/Text/types.js";
4
- import k from "../../components/Text/Text.js";
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 P } from "./constants.js";
7
- import { forwardRef as w } from "react";
8
- import { useNormalizedInputProps as I, px as T } from "../../utils/index.js";
9
- const b = w(
10
- ({ labelText: l, displayValue: p, onClick: m, hasError: o = !1, errorMsg: _, id: e, className: s, baseClassName: r, variantConfig: f }, u) => {
11
- const { isPhone: a, value: c } = f, n = I({
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
- }), v = n.invalidId, g = a ? c : P.filter((h) => h.name === c)?.[0]?.code, $ = () => n.validation ? n.validation : /* @__PURE__ */ i("p", { className: `${T}-input__validation`, children: " " });
17
- return /* @__PURE__ */ d("div", { className: t(`${r}__trigger`, s), children: [
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
- k,
30
+ P,
20
31
  {
21
- variant: y.string2,
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: u,
43
+ ref: v,
33
44
  type: "button",
34
- "aria-label": l,
45
+ "aria-label": p,
35
46
  "aria-invalid": n.invalid,
36
- "aria-describedby": v,
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: m,
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: p }),
54
- /* @__PURE__ */ i("span", { className: t(`${r}__trigger-icon`), children: /* @__PURE__ */ i(x, { icon: "ChevronDown", color: "black-100", width: 16, height: 16 }) })
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
- b.displayName = "CountryPickerTrigger";
73
+ j.displayName = "CountryPickerTrigger";
63
74
  export {
64
- b as default
75
+ j as default
65
76
  };
@@ -1,79 +1,80 @@
1
- import { jsxs as d, jsx as e } from "react/jsx-runtime";
2
- import C, { forwardRef as P } from "react";
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 S from "../../node_modules/classnames/index.js";
5
- import T from "../CountryPicker/CountryPicker.js";
6
- import $ from "../../components/Input/Input.js";
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: s,
12
- value: l = "",
13
- countryCode: p = "",
11
+ className: l,
12
+ value: s = "",
13
+ countryCode: c = "",
14
14
  handleValueChange: u,
15
- label: c = "Phone",
15
+ label: n = "Phone",
16
16
  required: m = !1,
17
- error: n,
17
+ error: a,
18
18
  errorText: h,
19
- disabled: f = !1,
20
- ...y
21
- }, v) => {
22
- const { className: t, ...b } = _(y, "PhoneNumberInput"), [a, N] = C.useState(p || void 0), o = j.find((r) => r.code === a), g = (r) => {
23
- u?.(r.target.value, a || "");
24
- }, i = I({
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: n,
26
+ invalid: a,
27
27
  invalidText: h,
28
28
  type: "text"
29
29
  });
30
- return /* @__PURE__ */ d("div", { ref: v, className: S(`${t}`, s), ...b, children: [
31
- /* @__PURE__ */ d("div", { className: `${t}__wrapper`, children: [
32
- /* @__PURE__ */ d("div", { className: `${t}__country-picker`, children: [
33
- /* @__PURE__ */ e("input", { type: "hidden", name: "phoneNumber", value: l, "data-testid": "phone-number-hidden-input" }),
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: a || "",
39
+ value: o || "",
40
40
  "data-testid": "phone-country-code-hidden-input"
41
41
  }
42
42
  ),
43
43
  /* @__PURE__ */ e(
44
- T,
44
+ S,
45
45
  {
46
- triggerLabelText: "Phone Number",
47
- triggerDisplayValue: o ? `+${L(o.code)}` : "",
48
- hasTriggerError: !!n,
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: o?.code,
55
- onChange: N
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: c,
65
+ labelText: `${n.replace("*", "")} phone`,
65
66
  hideLabel: !0,
66
- value: l,
67
- onChange: g,
67
+ value: s,
68
+ onChange: N,
68
69
  required: m,
69
- invalid: !!n,
70
- disabled: f,
70
+ invalid: !!a,
71
+ disabled: y,
71
72
  invalidText: "",
72
- "aria-describedby": i.invalidId
73
+ "aria-describedby": r.invalidId
73
74
  }
74
75
  ) })
75
76
  ] }),
76
- i.validation ? i.validation : /* @__PURE__ */ e("p", { className: `${x}-input__validation`, children: " " })
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 customHeader - Optional custom header ReactNode displayed above the progress indicator. This can be used to add a logo or other branding element to the top of the wizard. If not provided, no header will be shown. For Phillips, it should probably be ` <Icon icon="PhillipsLogo" height={32} width={120} aria-label="Phillips Logo" />
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 c, getLabelsFromChildren as J, wrapChildren as K } from "./utils.js";
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
- customHeader: S,
11
+ isFullHeight: S = !0,
12
12
  hideNavigation: a,
13
13
  hideProgressIndicator: h,
14
- isEnableHistoryManagement: p = !1,
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: o, ...N } = Y(W, "ProgressWizard");
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 [m, H] = q(i ?? 0), u = E(
31
+ const [u, L] = q(i ?? 0), m = E(
32
32
  (A) => {
33
- !a && !c(r) && H(A);
33
+ !a && !p(r) && L(A);
34
34
  },
35
35
  [a, r]
36
36
  ), e = d(
37
- () => r ?? m,
38
- [r, m]
37
+ () => r ?? u,
38
+ [r, u]
39
39
  );
40
- p && c(r) && console.warn(
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 t = R.toArray(z), L = d(() => J(t), [t]), _ = d(
44
- () => K(t, e, o),
45
- [t, e, o]
46
- ), n = t.length;
47
- (!t || n === 0) && console.warn(
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
- ), t[e] || console.warn(`ProgressWizard: currentStepIndex ${e} is out of bounds (0 to ${n - 1})`), T({
50
- enabled: !c(r) && p,
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: u
53
+ setCurrentStepIndex: m
54
54
  });
55
- const F = e === 0, M = e === n - 1, $ = _, k = {
56
- setCurrentStepIndex: u,
55
+ const F = e === 0, _ = e === n - 1, M = H, k = {
56
+ setCurrentStepIndex: m,
57
57
  isFirstStep: F,
58
- isLastStep: M,
59
- baseClassName: o,
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("section", { ...N, className: o, ref: f, "aria-label": "Progress Wizard", children: [
69
- S,
70
- h ? null : /* @__PURE__ */ s(G, { totalSteps: n, currentStep: e + 1, labels: L }),
71
- /* @__PURE__ */ s("div", { className: `${o}__content`, children: $ }),
72
- a ? null : /* @__PURE__ */ s("div", { className: `${o}__footer`, children: /* @__PURE__ */ s(D, { ...k }) })
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, ReactNode, Dispatch, SetStateAction } from 'react';
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 customHeader - Optional custom header ReactNode rendered above the progress indicator (e.g. logo or contextual banner)
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
- * Optional custom header ReactNode (renders above progress indicator)
71
+ * Sets the wizard component to take up all available height of its container. Defaults true.
72
72
  */
73
- customHeader?: ReactNode;
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 n from "react";
3
- const p = (e) => `wizard-step-${e}`, i = (e, r, t, a) => n.isValidElement(e) ? /* @__PURE__ */ s("div", { className: r !== t ? `${a}-hidden` : "", children: e }, p(r)) : e, d = (e, r, t) => e.map((a, o) => i(a, o, r, t)), f = (e) => e.map((r, t) => {
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
- p as generateStepId,
12
- f as getLabelsFromChildren,
13
- c as isControlled,
14
- i as wrapChild,
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 {
@@ -20,6 +20,10 @@
20
20
  overflow-y: auto;
21
21
  }
22
22
 
23
+ &--full-height {
24
+ height: 100%;
25
+ }
26
+
23
27
  &__footer {
24
28
  align-items: stretch;
25
29
  background-color: $white;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phillips/seldon",
3
- "version": "1.206.0",
3
+ "version": "1.208.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/PhillipsAuctionHouse/seldon"