@hortiview/shared-components 2.14.0 → 2.16.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/CHANGELOG.md +16 -0
- package/dist/AlertBanner-aW6joVUm.js +35 -0
- package/dist/GenericCard-IWX-Bmb_.js +90 -0
- package/dist/assets/ButtonCard.css +1 -0
- package/dist/assets/ConfirmationModal.css +1 -0
- package/dist/assets/GenericCard.css +1 -1
- package/dist/assets/GenericTable.css +1 -1
- package/dist/assets/InfoCard.css +1 -1
- package/dist/assets/stepper.css +1 -1
- package/dist/components/AlertBanner/AlertBanner.d.ts +5 -1
- package/dist/components/AlertBanner/AlertBanner.js +1 -1
- package/dist/components/AlertBanner/AlertBanner.test.js +9 -7
- package/dist/components/AlertBanner/LinkBanner.js +1 -1
- package/dist/components/AlertBanner/LinkBanner.test.js +3 -3
- package/dist/components/BaseView/BaseView.test.js +1 -1
- package/dist/components/ButtonCard/ButtonCard.d.ts +42 -0
- package/dist/components/ButtonCard/ButtonCard.js +51 -0
- package/dist/components/ButtonCard/ButtonCard.test.d.ts +1 -0
- package/dist/components/ButtonCard/ButtonCard.test.js +92 -0
- package/dist/components/ConfirmationModal/ConfirmationModal.d.ts +77 -0
- package/dist/components/ConfirmationModal/ConfirmationModal.js +90 -0
- package/dist/components/ConfirmationModal/ConfirmationModal.test.d.ts +1 -0
- package/dist/components/ConfirmationModal/ConfirmationModal.test.js +221 -0
- package/dist/components/DeleteModal/DeleteModal.js +6 -6
- package/dist/components/Filter/Filter.js +3 -3
- package/dist/components/FormComponents/FormDatePicker/FormDatePicker.js +1 -1
- package/dist/components/FormComponents/FormNumber/CustomTextField.js +1 -1
- package/dist/components/FormComponents/FormSlider/FormSlider.js +1 -1
- package/dist/components/FormComponents/FormText/FormText.js +1 -1
- package/dist/components/GenericTable/GenericTable.js +145 -137
- package/dist/components/GenericTable/Mobile/GenericCard.js +1 -1
- package/dist/components/GenericTable/Mobile/GenericCard.test.js +1 -1
- package/dist/components/GenericTable/Mobile/GenericCardList.js +11 -11
- package/dist/components/InfoCard/InfoCard.d.ts +6 -2
- package/dist/components/InfoCard/InfoCard.js +50 -37
- package/dist/components/InfoCard/InfoCard.test.js +40 -18
- package/dist/components/ModulePadding/ModulePadding.js +2 -2
- package/dist/components/SearchBar/SearchBar.js +1 -1
- package/dist/components/Stepper/Stepper.d.ts +13 -6
- package/dist/components/Stepper/Stepper.js +94 -39
- package/dist/components/Stepper/Stepper.test.js +305 -121
- package/dist/components/Stepper/components/StepperButton.js +1 -1
- package/dist/components/Stepper/components/StepperHeader.d.ts +1 -10
- package/dist/components/Stepper/components/StepperHeader.js +140 -69
- package/dist/components/Stepper/components/StepperItem.d.ts +8 -0
- package/dist/components/Stepper/components/StepperItem.js +44 -0
- package/dist/components/Stepper/stepperTypes.d.ts +105 -46
- package/dist/components/Stepper/stepperTypes.js +4 -1
- package/dist/{index.es-B74L_Dje.js → index.es-BYcQTTL8.js} +3 -3
- package/dist/{index.es-C7cC1Hdu.js → index.es-C32E1Lcb.js} +1 -1
- package/dist/main.d.ts +2 -1
- package/dist/main.js +118 -116
- package/dist/services/UtilService.js +2 -2
- package/dist/stepper.module-DR_FbENS.js +23 -0
- package/package.json +3 -2
- package/dist/AlertBanner-Ci-F-6S9.js +0 -26
- package/dist/GenericCard-CeqYrtLH.js +0 -89
- package/dist/components/Stepper/components/StepperIndicator.d.ts +0 -9
- package/dist/components/Stepper/components/StepperIndicator.js +0 -16
- package/dist/stepper.module-c-CWmpkt.js +0 -15
|
@@ -1,72 +1,143 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { G as
|
|
3
|
-
import { T as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
1
|
+
import { jsx as r, jsxs as n } from "react/jsx-runtime";
|
|
2
|
+
import { G as i } from "../../../index.es-oxil0uFe.js";
|
|
3
|
+
import { T as o } from "../../../index.es-SjZ_-d7U.js";
|
|
4
|
+
import { useMemo as f, Fragment as A } from "react";
|
|
5
|
+
import { u as v } from "../../../useBreakpoints-MzTZ0tCT.js";
|
|
6
|
+
import { s as t } from "../../../stepper.module-DR_FbENS.js";
|
|
7
|
+
import { StepperType as c } from "../stepperTypes.js";
|
|
8
|
+
import { StepperItem as h } from "./StepperItem.js";
|
|
9
|
+
const k = ({
|
|
7
10
|
stepperType: d,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
})
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
)
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
11
|
+
stepsData: l,
|
|
12
|
+
overwriteTotalSteps: u
|
|
13
|
+
}) => {
|
|
14
|
+
const { isMobile: g } = v(), { currentStepData: s, visibleSteps: p } = f(() => {
|
|
15
|
+
const e = l.filter((a) => a.isRendered);
|
|
16
|
+
return { currentStepData: e.find((a) => a.isActive) ?? e[e.length - 1], visibleSteps: e };
|
|
17
|
+
}, [l]);
|
|
18
|
+
if (d === c.DESKTOP)
|
|
19
|
+
return g ? /* @__PURE__ */ r(
|
|
20
|
+
i,
|
|
21
|
+
{
|
|
22
|
+
"data-testid": "desktop-stepper-header",
|
|
23
|
+
className: t.stepperDesktopHeaderContainer,
|
|
24
|
+
primaryAlign: "space-between",
|
|
25
|
+
secondaryAlign: "center",
|
|
26
|
+
gap: "standard",
|
|
27
|
+
fullWidth: !0,
|
|
28
|
+
children: /* @__PURE__ */ r(
|
|
29
|
+
h,
|
|
30
|
+
{
|
|
31
|
+
stepDefinition: s.step,
|
|
32
|
+
stepActive: !0,
|
|
33
|
+
stepCompleted: !1
|
|
34
|
+
},
|
|
35
|
+
s.step.id
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
) : /* @__PURE__ */ r(
|
|
39
|
+
i,
|
|
40
|
+
{
|
|
41
|
+
"data-testid": "desktop-stepper-header",
|
|
42
|
+
className: t.stepperDesktopHeaderContainer,
|
|
43
|
+
primaryAlign: "space-between",
|
|
44
|
+
secondaryAlign: "center",
|
|
45
|
+
gap: "standard",
|
|
46
|
+
fullWidth: !0,
|
|
47
|
+
children: p.map((e, m) => /* @__PURE__ */ n(A, { children: [
|
|
48
|
+
m > 0 && /* @__PURE__ */ r(
|
|
49
|
+
"hr",
|
|
50
|
+
{
|
|
51
|
+
className: `${t.stepperItemConnector} ${e.isActive || e.isCompleted ? t.stepperItemConnectorCompleted : ""}`,
|
|
52
|
+
"aria-hidden": "true",
|
|
53
|
+
role: "presentation",
|
|
54
|
+
"data-testid": `stepper-connector-before-${e.step.id}`
|
|
55
|
+
}
|
|
56
|
+
),
|
|
57
|
+
/* @__PURE__ */ r(
|
|
58
|
+
h,
|
|
59
|
+
{
|
|
60
|
+
maxWidth: `${100 / (p.length + 0.5)}%`,
|
|
61
|
+
stepDefinition: e.step,
|
|
62
|
+
stepActive: e.isActive,
|
|
63
|
+
stepCompleted: e.isCompleted
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
] }, e.step.id))
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
if (d === c.SMALL)
|
|
70
|
+
return /* @__PURE__ */ n(
|
|
71
|
+
i,
|
|
72
|
+
{
|
|
73
|
+
"data-testid": "description-stepper-header",
|
|
74
|
+
className: t.stepperDescriptionContainer,
|
|
75
|
+
secondaryAlign: "stretch",
|
|
76
|
+
gap: "none",
|
|
77
|
+
fullWidth: !0,
|
|
78
|
+
children: [
|
|
79
|
+
/* @__PURE__ */ r(
|
|
80
|
+
i,
|
|
81
|
+
{
|
|
82
|
+
className: t.stepperDescriptionProgress,
|
|
83
|
+
primaryAlign: "center",
|
|
84
|
+
secondaryAlign: "center",
|
|
85
|
+
children: /* @__PURE__ */ n(o, { "data-testid": "description-stepper-header-progress", level: 2, children: [
|
|
86
|
+
s.step.stepNumber,
|
|
87
|
+
"/",
|
|
88
|
+
u ?? p.length
|
|
89
|
+
] })
|
|
90
|
+
}
|
|
91
|
+
),
|
|
92
|
+
/* @__PURE__ */ r(
|
|
93
|
+
i,
|
|
94
|
+
{
|
|
95
|
+
className: t.stepperDescriptionText,
|
|
96
|
+
primaryAlign: "start",
|
|
97
|
+
secondaryAlign: "center",
|
|
98
|
+
children: /* @__PURE__ */ r(o, { "data-testid": "description-stepper-header-description", level: 2, children: s.step.text })
|
|
99
|
+
}
|
|
100
|
+
)
|
|
101
|
+
]
|
|
102
|
+
}
|
|
103
|
+
);
|
|
104
|
+
if (d === c.DOTS)
|
|
105
|
+
return /* @__PURE__ */ n(
|
|
106
|
+
i,
|
|
107
|
+
{
|
|
108
|
+
"data-testid": "dots-stepper-header",
|
|
109
|
+
className: t.stepperContainer,
|
|
110
|
+
gap: "dense",
|
|
111
|
+
primaryAlign: "center",
|
|
112
|
+
secondaryAlign: "center",
|
|
113
|
+
direction: "vertical",
|
|
114
|
+
fullWidth: !0,
|
|
115
|
+
children: [
|
|
116
|
+
/* @__PURE__ */ r(i, { gap: "dense", "data-testid": "stepper-indicator", children: p.map((e) => /* @__PURE__ */ r(
|
|
117
|
+
"div",
|
|
118
|
+
{
|
|
119
|
+
"data-testid": `stepper-indicator-${e.step.id}`,
|
|
120
|
+
className: `${t.stepperIndicatorItem}
|
|
121
|
+
${e.step.optional ? t.stepperIndicatorItemOptional : ""}
|
|
122
|
+
${e.isActive || e.isCompleted ? t.stepperIndicatorItemActive : ""}`
|
|
123
|
+
},
|
|
124
|
+
`indicator_${e.step.id}`
|
|
125
|
+
)) }),
|
|
126
|
+
/* @__PURE__ */ r(
|
|
127
|
+
o,
|
|
128
|
+
{
|
|
129
|
+
"data-testid": "stepper-header-description",
|
|
130
|
+
level: 2,
|
|
131
|
+
bold: !0,
|
|
132
|
+
tag: "div",
|
|
133
|
+
className: t.stepperTitle,
|
|
134
|
+
children: s.step.text
|
|
135
|
+
}
|
|
136
|
+
)
|
|
137
|
+
]
|
|
138
|
+
}
|
|
139
|
+
);
|
|
140
|
+
};
|
|
70
141
|
export {
|
|
71
|
-
|
|
142
|
+
k as StepperHeader
|
|
72
143
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { StepperItemProps } from '../stepperTypes';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A component for the Desktop-type stepper. Shows the number of the step, title and description
|
|
5
|
+
* @param step - Step to be displayed in the stepper item.
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
export declare const StepperItem: ({ maxWidth: maxWidth, stepDefinition, stepActive, stepCompleted, }: StepperItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsxs as m, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { G as o } from "../../../index.es-oxil0uFe.js";
|
|
3
|
+
import { T as a } from "../../../index.es-SjZ_-d7U.js";
|
|
4
|
+
import { Iconify as i } from "../../Iconify/Iconify.js";
|
|
5
|
+
import { s as t } from "../../../stepper.module-DR_FbENS.js";
|
|
6
|
+
const N = ({
|
|
7
|
+
maxWidth: d,
|
|
8
|
+
stepDefinition: e,
|
|
9
|
+
stepActive: s,
|
|
10
|
+
stepCompleted: c
|
|
11
|
+
}) => {
|
|
12
|
+
const p = [
|
|
13
|
+
t.stepperItemNumber,
|
|
14
|
+
s || c ? t.stepperItemNumberActive : ""
|
|
15
|
+
].filter(Boolean).join(" "), l = [t.itemText, s ? t.itemTextActive : ""].filter(Boolean).join(" ");
|
|
16
|
+
return /* @__PURE__ */ m(
|
|
17
|
+
o,
|
|
18
|
+
{
|
|
19
|
+
className: t.stepperItem,
|
|
20
|
+
style: { maxWidth: d },
|
|
21
|
+
gap: "dense",
|
|
22
|
+
secondaryAlign: "center",
|
|
23
|
+
"data-testid": `stepper-item-${e.id}`,
|
|
24
|
+
children: [
|
|
25
|
+
/* @__PURE__ */ r("div", { className: p, "data-testid": `stepper-item-circle-for-${e.id}`, children: c ? /* @__PURE__ */ r(
|
|
26
|
+
i,
|
|
27
|
+
{
|
|
28
|
+
icon: "check",
|
|
29
|
+
"aria-label": `Step ${e.stepNumber} completed`,
|
|
30
|
+
"data-testid": `stepper-item-check-for-${e.id}`
|
|
31
|
+
}
|
|
32
|
+
) : /* @__PURE__ */ r(a, { children: e.stepNumber }) }),
|
|
33
|
+
/* @__PURE__ */ m(o, { direction: "vertical", secondaryAlign: "start", gap: "none", children: [
|
|
34
|
+
/* @__PURE__ */ r(a, { bold: !0, level: 1, className: l, children: e.text }),
|
|
35
|
+
e.secondaryText && /* @__PURE__ */ r(a, { level: 2, className: l, children: e.secondaryText })
|
|
36
|
+
] })
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
e.id
|
|
40
|
+
);
|
|
41
|
+
};
|
|
42
|
+
export {
|
|
43
|
+
N as StepperItem
|
|
44
|
+
};
|
|
@@ -1,54 +1,71 @@
|
|
|
1
1
|
import { ButtonProps } from '@element-public/react-button';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
2
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
3
3
|
|
|
4
|
+
export declare enum StepperType {
|
|
5
|
+
DESKTOP = "DESKTOP",
|
|
6
|
+
SMALL = "SMALL",
|
|
7
|
+
DOTS = "DOTS"
|
|
8
|
+
}
|
|
4
9
|
/**
|
|
5
|
-
*
|
|
6
|
-
* @param {number} step - The step number, starting from 0.
|
|
7
|
-
* @param {string} title - The title of the step showing in the Stepper.
|
|
8
|
-
* @param {boolean} optional - Whether the step is optional or not showing a different design.
|
|
9
|
-
* @param {StepperButtonProps} nextButtonProps - Props for the next button, including onClick, label, className and disabled state.
|
|
10
|
-
* @param {StepperButtonProps} prevButtonProps - Props for the previous button, including onClick, label, className and disabled state.
|
|
10
|
+
* Defines the structure of a step in the stepper
|
|
11
11
|
*/
|
|
12
12
|
export type Step = {
|
|
13
13
|
/**
|
|
14
|
-
* The
|
|
14
|
+
* The internal id of the step.
|
|
15
15
|
*/
|
|
16
|
-
|
|
16
|
+
id: string | number;
|
|
17
17
|
/**
|
|
18
|
-
* The step number that is displayed when the stepper
|
|
19
|
-
* @remarks This property is not visible within the stepper type 'default' and only serves as an identifier for the step.
|
|
18
|
+
* The step number that is displayed when the stepper shows a step number (StepperType.DESKTOP and StepperType.SMALL)
|
|
20
19
|
*/
|
|
21
|
-
|
|
20
|
+
stepNumber: number;
|
|
22
21
|
/**
|
|
23
|
-
*
|
|
22
|
+
* Whether to exclude the step from the header. Only applicable for StepperType.DESKTOP.
|
|
24
23
|
*/
|
|
25
|
-
|
|
24
|
+
excludeFromHeader?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Whether activating this step should mark the previous step as completed. Only works in StepperType.DESKTOP
|
|
27
|
+
* @default false
|
|
28
|
+
*
|
|
29
|
+
* @remarks By default a step is treated as completed when the next visible step is active. This flag allows excluded steps (invisible ones) to complete the previous step.
|
|
30
|
+
*
|
|
31
|
+
* Example applications:
|
|
32
|
+
*
|
|
33
|
+
* Show a final completion step: [1 -> 2 -> 2.5 (excluded, excludedStepCompletesPreviousStep == true)] ---
|
|
34
|
+
* Step 2 is completed as soon as step 2.5 is active, to show a final "completion" step at the end without adding a header item.
|
|
35
|
+
*/
|
|
36
|
+
excludedStepCompletesPreviousStep?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* The title of the step showing in the Stepper
|
|
39
|
+
*/
|
|
40
|
+
text: string | ReactNode;
|
|
41
|
+
/**
|
|
42
|
+
* Additional secondary text showing in the Stepper. Only applicable for the 'desktop' type
|
|
43
|
+
*/
|
|
44
|
+
secondaryText?: string | ReactNode;
|
|
26
45
|
/**
|
|
27
46
|
* Whether the step is optional or not showing a different design.
|
|
28
47
|
*
|
|
29
48
|
* @remarks There's no adjusted display logic for optional steps when using the description type stepper.
|
|
30
|
-
* In that case, use the
|
|
49
|
+
* In that case, use the displayed text to indicate that the step is optional.
|
|
31
50
|
*/
|
|
32
51
|
optional?: boolean;
|
|
33
52
|
/**
|
|
34
|
-
* The props for the next button, including onClick, label, className and disabled state.
|
|
53
|
+
* The props for the next button, including onClick, label, className and disabled state.
|
|
54
|
+
* Will print a console error if the button is embedded but no props are provided and return null for the entire stepper.
|
|
55
|
+
*
|
|
56
|
+
* See {@link StepperButtonProps} for details.
|
|
35
57
|
*/
|
|
36
|
-
nextButtonProps: StepperButtonProps
|
|
58
|
+
nextButtonProps: Partial<StepperButtonProps>;
|
|
37
59
|
/**
|
|
38
|
-
* The props for the previous button, including onClick, label, className and disabled state.
|
|
60
|
+
* The props for the previous button, including onClick, label, className and disabled state.
|
|
61
|
+
* Will print a console error if the button is embedded but no props are provided and return null for the entire stepper.
|
|
62
|
+
*
|
|
63
|
+
* See {@link StepperButtonProps} for details.
|
|
39
64
|
*/
|
|
40
|
-
prevButtonProps: StepperButtonProps
|
|
65
|
+
prevButtonProps: Partial<StepperButtonProps>;
|
|
41
66
|
};
|
|
42
67
|
/**
|
|
43
|
-
*
|
|
44
|
-
* @param {boolean} disabled - Whether the button is disabled or not.
|
|
45
|
-
* @param {() => void} onClick - The function to be called when the button is clicked.
|
|
46
|
-
* @param {string | ReactNode} label - The label of the button.
|
|
47
|
-
* @param {string | ReactNode} leadingIcon - A custom leading icon for the button. Takes precedence over showArrowIcon.
|
|
48
|
-
* @param {string | ReactNode} trailingIcon - A custom trailing icon for the button. Takes precedence over showArrowIcon.
|
|
49
|
-
* @param {boolean} showArrowIcon - Whether to show a leading/trailing arrow icon for the button.
|
|
50
|
-
* @param {string} buttonSize - The size of the button, defaults to 'themeDefault'.
|
|
51
|
-
* @param {boolean} fullWidth - Whether the button should take the full width of its container. *
|
|
68
|
+
* Defines the props for the stepper buttons, including onClick, label, className and disabled state.
|
|
52
69
|
*/
|
|
53
70
|
export type StepperButtonProps = Pick<ButtonProps, 'className' | 'disabled' | 'fullWidth'> & {
|
|
54
71
|
/**
|
|
@@ -60,7 +77,8 @@ export type StepperButtonProps = Pick<ButtonProps, 'className' | 'disabled' | 'f
|
|
|
60
77
|
*/
|
|
61
78
|
label: string | ReactNode;
|
|
62
79
|
/**
|
|
63
|
-
*
|
|
80
|
+
* Show a right arrow (->) for the next button and a (<-) left arrow for the previous button.
|
|
81
|
+
* @remarks This is overridden by the presence of leadingIcon or trailingIcon.
|
|
64
82
|
*/
|
|
65
83
|
showArrowIcon?: boolean;
|
|
66
84
|
/**
|
|
@@ -77,7 +95,7 @@ export type StepperButtonProps = Pick<ButtonProps, 'className' | 'disabled' | 'f
|
|
|
77
95
|
buttonSize?: 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'themeDefault';
|
|
78
96
|
};
|
|
79
97
|
/**
|
|
80
|
-
* @param {
|
|
98
|
+
* @param {StepperType} stepperType - The type of the stepper indicator. Defaults to StepperType.DESKTOP. See {@link StepperType}
|
|
81
99
|
* @param {Step[]} steps - An array of steps for the stepper.
|
|
82
100
|
* @param {number} currentStep - The current step index.
|
|
83
101
|
* @param {boolean} isStepLoading - A boolean indicating if the current step is loading. If true, the next button will be disabled and show a loading state.
|
|
@@ -88,27 +106,30 @@ export type StepperButtonProps = Pick<ButtonProps, 'className' | 'disabled' | 'f
|
|
|
88
106
|
export type StepperProps = {
|
|
89
107
|
/**
|
|
90
108
|
* The display-type of the Stepper.
|
|
91
|
-
* -
|
|
92
|
-
* -
|
|
109
|
+
* - StepperType.DESKTOP: EDS-like default stepper appearance. (Do not use on mobile)
|
|
110
|
+
* - StepperType.SMALL: Compact version with n/n progress display.
|
|
111
|
+
* - StepperType.DOTS: Centered dots and title underneath.
|
|
93
112
|
*
|
|
94
|
-
* @default
|
|
113
|
+
* @default StepperType.DESKTOP
|
|
95
114
|
*/
|
|
96
|
-
stepperType?:
|
|
115
|
+
stepperType?: StepperType;
|
|
97
116
|
/**
|
|
98
117
|
* An array of steps for the stepper.
|
|
99
118
|
*/
|
|
100
119
|
steps: Step[];
|
|
101
120
|
/**
|
|
102
|
-
*
|
|
103
|
-
*
|
|
121
|
+
* The name of the current step, matching the name property of one of the steps in the steps array.
|
|
122
|
+
* This is used to determine which step is currently active and displayed in the stepper.
|
|
104
123
|
*/
|
|
105
|
-
|
|
124
|
+
currentStepId: Step['id'];
|
|
106
125
|
/**
|
|
107
|
-
*
|
|
126
|
+
* Set a custom number of total steps to display in the stepper header.
|
|
127
|
+
* Only applicable for StepperType.SMALL.
|
|
128
|
+
* @remarks This can be used to show a different total number of steps than the length of the steps array. (Think half steps -> 1, 1.5, 2)
|
|
108
129
|
*/
|
|
109
|
-
|
|
130
|
+
overwriteTotalSteps?: number;
|
|
110
131
|
/**
|
|
111
|
-
*
|
|
132
|
+
* Flag which indicates if the current step is loading.
|
|
112
133
|
*/
|
|
113
134
|
isStepLoading?: boolean;
|
|
114
135
|
/**
|
|
@@ -116,11 +137,16 @@ export type StepperProps = {
|
|
|
116
137
|
* @default true
|
|
117
138
|
*/
|
|
118
139
|
showStepperHeader?: boolean;
|
|
140
|
+
/**
|
|
141
|
+
* An indicator of whether to show the stepper buttons.
|
|
142
|
+
* @default true
|
|
143
|
+
*/
|
|
144
|
+
showStepperButtons?: boolean;
|
|
119
145
|
/**
|
|
120
146
|
* The alignment of the stepper button group.
|
|
121
147
|
* @default 'center'
|
|
122
148
|
*/
|
|
123
|
-
stepperButtonAlignment?: 'center' | 'space-between'
|
|
149
|
+
stepperButtonAlignment?: Extract<CSSProperties['justifyContent'], 'center' | 'space-between'>;
|
|
124
150
|
/**
|
|
125
151
|
* A flag which indicates if the previous button should be shown on the first step.
|
|
126
152
|
* This can be useful for canceling the stepper.
|
|
@@ -129,9 +155,42 @@ export type StepperProps = {
|
|
|
129
155
|
showPreviousButtonOnFirstStep?: boolean;
|
|
130
156
|
};
|
|
131
157
|
/**
|
|
132
|
-
* @param {
|
|
133
|
-
* @param {
|
|
134
|
-
* @param {
|
|
135
|
-
|
|
158
|
+
* @param {StepperType} stepperType - The type of the stepper indicator.
|
|
159
|
+
* @param {number} overwriteTotalSteps - A custom total number of steps to display in the stepper header.
|
|
160
|
+
* @param {StepData[]} stepsData - An array of step data for rendering the steps @lookup {@link StepData}.
|
|
161
|
+
*/
|
|
162
|
+
export type StepperBaseProps = Pick<StepperProps, 'stepperType' | 'overwriteTotalSteps'> & {
|
|
163
|
+
stepsData: StepData[];
|
|
164
|
+
};
|
|
165
|
+
/**
|
|
166
|
+
* Helper type for rendering steps
|
|
167
|
+
*
|
|
168
|
+
* @param {Step} step - The step data for the step.
|
|
169
|
+
* @param {boolean} isActive - Whether the step is currently active.
|
|
170
|
+
* @param {boolean} isCompleted - Whether the step is completed.
|
|
171
|
+
* @param {boolean} isRendered - Whether the step is visible/rendered.
|
|
172
|
+
* @param {boolean} isFirst - Whether the step is the first step in the steps array.
|
|
173
|
+
* @param {boolean} isLast - Whether the step is the last step in the steps array.
|
|
174
|
+
*/
|
|
175
|
+
export type StepData = {
|
|
176
|
+
step: Step;
|
|
177
|
+
isActive: boolean;
|
|
178
|
+
isCompleted: boolean;
|
|
179
|
+
isRendered: boolean;
|
|
180
|
+
isFirst: boolean;
|
|
181
|
+
isLast: boolean;
|
|
182
|
+
};
|
|
183
|
+
/**
|
|
184
|
+
* Props for an DESKTOP-type stepper item, which shows the number of the step, title and description.
|
|
185
|
+
*
|
|
186
|
+
* @param maxWidth - The maximum width of the stepper item.
|
|
187
|
+
* @param stepDefinition - The step data for the step to be displayed in the stepper item.
|
|
188
|
+
* @param stepActive - Whether the step is currently active.
|
|
189
|
+
* @param stepCompleted - Whether the step is completed.
|
|
136
190
|
*/
|
|
137
|
-
export type
|
|
191
|
+
export type StepperItemProps = {
|
|
192
|
+
maxWidth?: CSSProperties['maxWidth'];
|
|
193
|
+
stepDefinition: Step;
|
|
194
|
+
stepActive: boolean;
|
|
195
|
+
stepCompleted: boolean;
|
|
196
|
+
};
|
|
@@ -8,7 +8,7 @@ import { M as Xn, a as Gn, N as zn, F as Ht, T as Yn } from "./index.es--C-VLspF
|
|
|
8
8
|
import { b as A, c as f } from "./tslib.es6-BDCynO9F.js";
|
|
9
9
|
import { M as ne, a as ie } from "./component-Bz_dtX1r.js";
|
|
10
10
|
import { c as Kn, I as Yt } from "./index.es-Dgxrk6xW.js";
|
|
11
|
-
import { a as pe, M as wt,
|
|
11
|
+
import { a as pe, M as wt, m as Jn, b as Qn } from "./component-DEJuY56h.js";
|
|
12
12
|
/**
|
|
13
13
|
* @license
|
|
14
14
|
* Copyright 2018 Google Inc.
|
|
@@ -1411,13 +1411,13 @@ var li = (
|
|
|
1411
1411
|
if (i || o)
|
|
1412
1412
|
return null;
|
|
1413
1413
|
var s = f(f({}, wt.createAdapter(this)), { isSurfaceActive: function() {
|
|
1414
|
-
return
|
|
1414
|
+
return Jn(n.input_, ":active");
|
|
1415
1415
|
}, registerInteractionHandler: function(_, p) {
|
|
1416
1416
|
return n.input_.addEventListener(_, p, pe());
|
|
1417
1417
|
}, deregisterInteractionHandler: function(_, p) {
|
|
1418
1418
|
return n.input_.removeEventListener(_, p, pe());
|
|
1419
1419
|
} });
|
|
1420
|
-
return e(this.root, new
|
|
1420
|
+
return e(this.root, new Qn(s));
|
|
1421
1421
|
}, t;
|
|
1422
1422
|
})(ie)
|
|
1423
1423
|
), si = {
|
|
@@ -10,7 +10,7 @@ import { c as Ua, d as Ur, e as P, f as Y, g as M, h as f, b as v, i as O, S as
|
|
|
10
10
|
import { _ as Ka, P as In } from "./index.es-DGoBge9W.js";
|
|
11
11
|
import { _ as Qn } from "./find-CHg-_ooq.js";
|
|
12
12
|
import { c as Er, I as Wr } from "./index.es-Dgxrk6xW.js";
|
|
13
|
-
import { T as Hr } from "./index.es-
|
|
13
|
+
import { T as Hr } from "./index.es-BYcQTTL8.js";
|
|
14
14
|
function ee(i) {
|
|
15
15
|
if (i === null || i === !0 || i === !1)
|
|
16
16
|
return NaN;
|
package/dist/main.d.ts
CHANGED
|
@@ -3,7 +3,9 @@ export { LinkBanner } from './components/AlertBanner/LinkBanner';
|
|
|
3
3
|
export { BaseView } from './components/BaseView/BaseView';
|
|
4
4
|
export { BasicHeading } from './components/BasicHeading/BasicHeading';
|
|
5
5
|
export { BlockView } from './components/BlockView/BlockView';
|
|
6
|
+
export { ButtonCard } from './components/ButtonCard/ButtonCard';
|
|
6
7
|
export { ChipCard } from './components/ChipCard/ChipCard';
|
|
8
|
+
export { ConfirmationModal } from './components/ConfirmationModal/ConfirmationModal';
|
|
7
9
|
export { ContextMenu } from './components/ContextMenu/ContextMenu';
|
|
8
10
|
export { DeleteModal } from './components/DeleteModal/DeleteModal';
|
|
9
11
|
export { DetailContentWrapper } from './components/DetailContentWrapper/DetailContentWrapper';
|
|
@@ -28,7 +30,6 @@ export { ScrollbarX, ScrollbarY } from './components/Scrollbar/Scrollbar';
|
|
|
28
30
|
export { SearchBar } from './components/SearchBar/SearchBar';
|
|
29
31
|
export { Select } from './components/Select/Select';
|
|
30
32
|
export { StepperHeader } from './components/Stepper/components/StepperHeader';
|
|
31
|
-
export { StepperIndicator } from './components/Stepper/components/StepperIndicator';
|
|
32
33
|
export { Stepper } from './components/Stepper/Stepper';
|
|
33
34
|
export { VerticalDivider } from './components/VerticalDivider/VerticalDivider';
|
|
34
35
|
export { FormCheckBox } from './components/FormComponents/FormCheckBox/FormCheckBox';
|