@hortiview/shared-components 2.2.0 → 2.4.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.
Files changed (44) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.md +11 -0
  3. package/dist/AlertBanner-75jjene1.js +26 -0
  4. package/dist/OfflineView-BW19N4Cu.js +48 -0
  5. package/dist/assets/AlertBanner.css +1 -1
  6. package/dist/assets/ContextMenu.css +1 -1
  7. package/dist/assets/Modal.css +1 -1
  8. package/dist/assets/OfflineView.css +1 -0
  9. package/dist/components/AlertBanner/AlertBanner.d.ts +1 -2
  10. package/dist/components/AlertBanner/AlertBanner.js +6 -22
  11. package/dist/components/AlertBanner/AlertBanner.test.js +1 -1
  12. package/dist/components/AlertBanner/LinkBanner.d.ts +21 -0
  13. package/dist/components/AlertBanner/LinkBanner.js +37 -0
  14. package/dist/components/AlertBanner/LinkBanner.test.d.ts +1 -0
  15. package/dist/components/AlertBanner/LinkBanner.test.js +17 -0
  16. package/dist/components/BaseView/BaseView.d.ts +10 -1
  17. package/dist/components/BaseView/BaseView.js +42 -39
  18. package/dist/components/BaseView/BaseView.test.js +51 -34
  19. package/dist/components/ContextMenu/ContextMenu.d.ts +12 -1
  20. package/dist/components/ContextMenu/ContextMenu.js +40 -36
  21. package/dist/components/ContextMenu/ContextMenu.test.js +42 -19
  22. package/dist/components/DeleteModal/DeleteModal.d.ts +13 -1
  23. package/dist/components/DeleteModal/DeleteModal.js +52 -48
  24. package/dist/components/DeleteModal/DeleteModal.test.js +35 -11
  25. package/dist/components/GenericTable/GenericTable.d.ts +3 -1
  26. package/dist/components/GenericTable/GenericTable.js +1225 -1216
  27. package/dist/components/GenericTable/GenericTable.test.js +36 -6
  28. package/dist/components/Modal/Modal.d.ts +6 -1
  29. package/dist/components/Modal/Modal.js +126 -120
  30. package/dist/components/ModulePadding/ModulePadding.js +1 -1
  31. package/dist/components/OfflineView/OfflineView.d.ts +68 -0
  32. package/dist/components/OfflineView/OfflineView.js +9 -0
  33. package/dist/components/OfflineView/OfflineView.test.d.ts +1 -0
  34. package/dist/components/OfflineView/OfflineView.test.js +24 -0
  35. package/dist/components/Stepper/Stepper.d.ts +4 -3
  36. package/dist/components/Stepper/Stepper.js +33 -21
  37. package/dist/components/Stepper/Stepper.test.js +40 -64
  38. package/dist/components/Stepper/components/StepperButton.d.ts +8 -2
  39. package/dist/components/Stepper/components/StepperButton.js +54 -38
  40. package/dist/components/Stepper/stepperTypes.d.ts +31 -1
  41. package/dist/main.d.ts +6 -4
  42. package/dist/main.js +101 -97
  43. package/dist/types/GenericTable.d.ts +9 -0
  44. package/package.json +1 -1
@@ -0,0 +1,68 @@
1
+ export type OfflineViewProps = {
2
+ /**
3
+ * The title of the offline view
4
+ *
5
+ * Defaults to **You’re currently offline**
6
+ */
7
+ title?: string;
8
+ /**
9
+ * The subtitle of the offline view, optional
10
+ */
11
+ subtitle?: string;
12
+ /**
13
+ * The Icon of the offline view
14
+ *
15
+ * Defaults to **cloud_off**.
16
+ */
17
+ icon?: string;
18
+ /**
19
+ * The offline view size
20
+ *
21
+ * Defaults to **large**
22
+ */
23
+ size?: 'large' | 'small';
24
+ /**
25
+ * Visual variant
26
+ *
27
+ * Defaults to **basic**
28
+ */
29
+ variant?: 'basic' | 'filled';
30
+ /**
31
+ * The button label. If provided, a button will be shown.
32
+ */
33
+ buttonLabel?: string;
34
+ /**
35
+ * Click handler for the button (used only if a button is rendered).
36
+ */
37
+ onClick?: () => void;
38
+ /**
39
+ * Optional test id pass-through.
40
+ */
41
+ 'data-testid'?: string;
42
+ /**
43
+ * Optional CSS class for the root element
44
+ */
45
+ className?: string;
46
+ /**
47
+ * Stretch to the container’s full width.
48
+ *
49
+ * Defaults to **false**.
50
+ */
51
+ fullWidth?: boolean;
52
+ };
53
+ /**
54
+ * Offline placeholder/view shown when no network connection is available.
55
+ *
56
+ * @param {string} title - The title of the offline view
57
+ * @param {string} subtitle - Optional subtitle
58
+ * @param {string} icon - The Icon of the offline view, default is cloud_off
59
+ * @param {'large' | 'small'} size - The offline view size, default is large
60
+ * @param {'basic' | 'filled'} variant - Visual variant, default is basic
61
+ * @param {string} buttonLabel - The button label, if defined, the button will be displayed
62
+ * @param {() => void} onClick - Event handler for the button
63
+ * @param {string} 'data-testid' - Optional test id passthrough
64
+ * @param {string} className - Optional CSS class for the root element
65
+ * @param {boolean} fullWidth - Stretch to the container’s full width.
66
+ * @returns {JSX.Element}
67
+ */
68
+ export declare const OfflineView: ({ title, subtitle, icon, size, variant, "data-testid": dataTestId, buttonLabel, fullWidth, className, onClick, }: OfflineViewProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import "react/jsx-runtime";
2
+ import "../../index.es-DntoATwO.js";
3
+ import "../Iconify/Iconify.js";
4
+ import "../../index.es-D54RuMc_.js";
5
+ import { O as f } from "../../OfflineView-BW19N4Cu.js";
6
+ import "../../index.es-CiqbARoC.js";
7
+ export {
8
+ f as OfflineView
9
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,24 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { a as n, s as t, f as u } from "../../react.esm-CX1WJ2Pp.js";
3
+ import { s as r, O as i } from "../../OfflineView-BW19N4Cu.js";
4
+ import { d as B, t as l, g as e, a as c } from "../../vi.CjhMlMwf-CKxPQtd6.js";
5
+ B("OfflineView", () => {
6
+ l("should render OfflineView with title and subtitle", () => {
7
+ n(/* @__PURE__ */ o(i, { title: "test-title", subtitle: "test-subtitle" })), e(t.getByTestId("offline-view-container")).toBeInTheDocument(), e(t.getByText("test-title")).toBeInTheDocument(), e(t.getByText("test-subtitle")).toBeInTheDocument(), e(t.queryByText("cloud_off")).toBeInTheDocument();
8
+ }), l("should render without subtitle", () => {
9
+ n(/* @__PURE__ */ o(i, { title: "test-title" })), e(t.getByTestId("offline-view-container")).toBeInTheDocument(), e(t.getByText("test-title")).toBeInTheDocument(), e(t.queryByText("test-subtitle")).not.toBeInTheDocument();
10
+ }), l("should render custom icon", () => {
11
+ n(/* @__PURE__ */ o(i, { title: "test-title", icon: "add" })), e(t.getByTestId("offline-view-container")).toBeInTheDocument(), e(t.getByText("test-title")).toBeInTheDocument(), e(t.getByText("add")).toBeInTheDocument();
12
+ }), l("should render the small offline view", () => {
13
+ n(/* @__PURE__ */ o(i, { title: "test-title", size: "small" })), e(t.getByText("test-title")).toHaveClass("mdc-typography--subtitle1");
14
+ }), l("should render the filled offline view", () => {
15
+ n(/* @__PURE__ */ o(i, { title: "test-title", variant: "filled", "data-testid": "test" })), e(t.getByTestId("test")).toHaveClass(r.bgGrey);
16
+ }), l("should render OfflineView with button", () => {
17
+ n(/* @__PURE__ */ o(i, { title: "test-title", buttonLabel: "Button" })), e(t.getByText("Button")).toBeInTheDocument(), e(t.getByRole("button")).toBeInTheDocument();
18
+ }), l("calls onClick when button is clicked", () => {
19
+ const s = c.fn();
20
+ n(/* @__PURE__ */ o(i, { title: "test-title", buttonLabel: "Button", onClick: s })), u.click(t.getByText("Button")), e(s).toHaveBeenCalled();
21
+ }), l("should render OfflineView without button", () => {
22
+ n(/* @__PURE__ */ o(i, { title: "test-title" })), e(t.queryByText("Button")).not.toBeInTheDocument(), e(t.queryByRole("button")).not.toBeInTheDocument();
23
+ });
24
+ });
@@ -8,9 +8,10 @@ import { StepperProps } from './stepperTypes';
8
8
  * @param steps - An array of steps for the stepper.
9
9
  * @param currentStep - The current step index.
10
10
  * @param children - The content to be displayed in the stepper.
11
- * @param nextButtonProps - Props for the next button, including onClick, label, and disabled state.
12
- * @param prevButtonProps - Props for the previous button, including onClick, label, and disabled state.
13
11
  * @param isStepLoading - A boolean indicating if the current step is loading. If true, the next button will be disabled and show a loading state.
12
+ * @param showStepperHeader - An indicator of whether to show the stepper header. Defaults to true.
13
+ * @param stepperButtonAlignment - The alignment of the stepper button group. Defaults to 'center'.
14
+ * @param showPreviousButtonOnFirstStep - A flag which indicates if the previous button should be shown on the first step. This can be useful for canceling the stepper. Defaults to false.
14
15
  * @returns
15
16
  */
16
- export declare const Stepper: ({ steps, currentStep, children, isStepLoading, }: PropsWithChildren<StepperProps>) => import("react/jsx-runtime").JSX.Element;
17
+ export declare const Stepper: ({ steps, currentStep, children, isStepLoading, showStepperHeader, stepperButtonAlignment, showPreviousButtonOnFirstStep, }: PropsWithChildren<StepperProps>) => import("react/jsx-runtime").JSX.Element;
@@ -1,16 +1,19 @@
1
1
  import { jsxs as i, jsx as r } from "react/jsx-runtime";
2
2
  import { G as o } from "../../index.es-DntoATwO.js";
3
- import { useMemo as s } from "react";
4
- import { StepperPreviousButton as l, StepperNextButton as d } from "./components/StepperButton.js";
5
- import { StepperHeader as m } from "./components/StepperHeader.js";
6
- import { s as c } from "../../stepper.module-HuqmDJPj.js";
7
- const A = ({
3
+ import { useMemo as m } from "react";
4
+ import { StepperPreviousButton as c, StepperNextButton as u } from "./components/StepperButton.js";
5
+ import { StepperHeader as f } from "./components/StepperHeader.js";
6
+ import { s as g } from "../../stepper.module-HuqmDJPj.js";
7
+ const P = ({
8
8
  steps: e,
9
9
  currentStep: t,
10
10
  children: n,
11
- isStepLoading: a
11
+ isStepLoading: a,
12
+ showStepperHeader: p = !0,
13
+ stepperButtonAlignment: l = "center",
14
+ showPreviousButtonOnFirstStep: s = !1
12
15
  }) => {
13
- const p = s(() => t === e.length - 1, [t, e.length]);
16
+ const d = m(() => t === e.length - 1, [t, e.length]);
14
17
  return /* @__PURE__ */ i(
15
18
  o,
16
19
  {
@@ -21,34 +24,43 @@ const A = ({
21
24
  primaryAlign: "center",
22
25
  secondaryAlign: "center",
23
26
  children: [
24
- /* @__PURE__ */ r(m, { steps: e, currentStep: t }),
27
+ p ? /* @__PURE__ */ r(f, { steps: e, currentStep: t }) : null,
25
28
  /* @__PURE__ */ r(
26
29
  o,
27
30
  {
28
31
  "data-testid": "stepper-content",
29
32
  fullWidth: !0,
30
- className: c.stepperContent,
33
+ className: g.stepperContent,
31
34
  gap: "airy",
32
35
  secondaryAlign: "center",
33
36
  direction: "vertical",
34
37
  children: n
35
38
  }
36
39
  ),
37
- /* @__PURE__ */ i(o, { "data-testid": "stepper-buttons", fullWidth: !0, secondaryAlign: "center", primaryAlign: "center", children: [
38
- t !== 0 && /* @__PURE__ */ r(l, { ...e[t].prevButtonProps }),
39
- /* @__PURE__ */ r(
40
- d,
41
- {
42
- ...e[t].nextButtonProps,
43
- isStepLoading: a,
44
- isLastStep: p
45
- }
46
- )
47
- ] })
40
+ /* @__PURE__ */ i(
41
+ o,
42
+ {
43
+ "data-testid": "stepper-buttons",
44
+ fullWidth: !0,
45
+ secondaryAlign: "center",
46
+ primaryAlign: l,
47
+ children: [
48
+ (t !== 0 || s) && /* @__PURE__ */ r(c, { ...e[t].prevButtonProps }),
49
+ /* @__PURE__ */ r(
50
+ u,
51
+ {
52
+ ...e[t].nextButtonProps,
53
+ isStepLoading: a,
54
+ isLastStep: d
55
+ }
56
+ )
57
+ ]
58
+ }
59
+ )
48
60
  ]
49
61
  }
50
62
  );
51
63
  };
52
64
  export {
53
- A as Stepper
65
+ P as Stepper
54
66
  };
@@ -1,95 +1,71 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
- import { a as r, s as n, f as c } from "../../react.esm-CX1WJ2Pp.js";
3
- import { Stepper as l } from "./Stepper.js";
4
- import { v as s, d as a, t as p, g as o } from "../../vi.CjhMlMwf-CKxPQtd6.js";
5
- const i = [
2
+ import { a as s, s as t, f as c } from "../../react.esm-CX1WJ2Pp.js";
3
+ import { Stepper as i } from "./Stepper.js";
4
+ import { v as l, d as a, t as p, g as n } from "../../vi.CjhMlMwf-CKxPQtd6.js";
5
+ const o = [
6
6
  {
7
7
  name: "step1",
8
8
  step: 0,
9
9
  title: "Step 1",
10
10
  optional: !1,
11
- nextButtonProps: { onClick: s.fn(), label: "Next" },
12
- prevButtonProps: { onClick: s.fn(), label: "Back" }
11
+ nextButtonProps: { onClick: l.fn(), label: "Next" },
12
+ prevButtonProps: { onClick: l.fn(), label: "Back" }
13
13
  },
14
14
  {
15
15
  name: "step2",
16
16
  step: 1,
17
17
  title: "Step 2",
18
18
  optional: !1,
19
- nextButtonProps: { onClick: s.fn(), label: "Next" },
20
- prevButtonProps: { onClick: s.fn(), label: "Back" }
19
+ nextButtonProps: { onClick: l.fn(), label: "Next" },
20
+ prevButtonProps: { onClick: l.fn(), label: "Back" }
21
21
  },
22
22
  {
23
23
  name: "step3",
24
24
  step: 2,
25
25
  title: "Step 3",
26
26
  optional: !0,
27
- nextButtonProps: { onClick: s.fn(), label: "Finish" },
28
- prevButtonProps: { onClick: s.fn(), label: "Back" }
27
+ nextButtonProps: { onClick: l.fn(), label: "Finish" },
28
+ prevButtonProps: { onClick: l.fn(), label: "Back" }
29
29
  }
30
30
  ];
31
31
  a("Stepper", () => {
32
32
  p("renders the stepper header and children", () => {
33
- r(
34
- /* @__PURE__ */ e(l, { steps: i, currentStep: 1, isStepLoading: !1, children: /* @__PURE__ */ e("div", { children: "Step Content" }) })
35
- ), o(n.queryByText("Step 1")).not.toBeInTheDocument(), o(n.getByText("Step 2")).toBeInTheDocument(), o(n.queryByText("Step 3")).not.toBeInTheDocument(), o(n.getByText("Step Content")).toBeInTheDocument();
33
+ s(
34
+ /* @__PURE__ */ e(i, { steps: o, currentStep: 1, isStepLoading: !1, children: /* @__PURE__ */ e("div", { children: "Step Content" }) })
35
+ ), n(t.queryByText("Step 1")).not.toBeInTheDocument(), n(t.getByText("Step 2")).toBeInTheDocument(), n(t.queryByText("Step 3")).not.toBeInTheDocument(), n(t.getByText("Step Content")).toBeInTheDocument();
36
36
  }), p("disables the next button when isStepLoading is true", () => {
37
- r(
38
- /* @__PURE__ */ e(l, { steps: i, currentStep: 1, isStepLoading: !0, children: /* @__PURE__ */ e("div", { children: "Step Content" }) })
37
+ s(
38
+ /* @__PURE__ */ e(i, { steps: o, currentStep: 1, isStepLoading: !0, children: /* @__PURE__ */ e("div", { children: "Step Content" }) })
39
39
  );
40
- const t = n.getByText("Next").closest("button");
41
- o(t).toBeDisabled();
40
+ const r = t.getByText("Next").closest("button");
41
+ n(r).toBeDisabled();
42
42
  }), p("calls nextButtonProps.onClick when next button is clicked", () => {
43
- const t = s.fn();
44
- i[1].nextButtonProps.onClick = t, r(
45
- /* @__PURE__ */ e(
46
- l,
47
- {
48
- steps: i,
49
- currentStep: 1,
50
- isStepLoading: !1,
51
- children: /* @__PURE__ */ e("div", { children: "Step Content" })
52
- }
53
- )
54
- ), c.click(n.getByText("Next")), o(t).toHaveBeenCalled();
43
+ const r = l.fn();
44
+ o[1].nextButtonProps.onClick = r, s(
45
+ /* @__PURE__ */ e(i, { steps: o, currentStep: 1, isStepLoading: !1, children: /* @__PURE__ */ e("div", { children: "Step Content" }) })
46
+ ), c.click(t.getByText("Next")), n(r).toHaveBeenCalled();
55
47
  }), p("calls prevButtonProps.onClick when prev button is clicked", () => {
56
- const t = s.fn();
57
- i[1].prevButtonProps.onClick = t, r(
58
- /* @__PURE__ */ e(
59
- l,
60
- {
61
- steps: i,
62
- currentStep: 1,
63
- isStepLoading: !1,
64
- children: /* @__PURE__ */ e("div", { children: "Step Content" })
65
- }
66
- )
67
- ), c.click(n.getByText("Back")), o(t).toHaveBeenCalled();
48
+ const r = l.fn();
49
+ o[1].prevButtonProps.onClick = r, s(
50
+ /* @__PURE__ */ e(i, { steps: o, currentStep: 1, isStepLoading: !1, children: /* @__PURE__ */ e("div", { children: "Step Content" }) })
51
+ ), c.click(t.getByText("Back")), n(r).toHaveBeenCalled();
68
52
  }), p("does not render the prev button on the first step", () => {
69
- r(
70
- /* @__PURE__ */ e(
71
- l,
72
- {
73
- steps: i,
74
- currentStep: 0,
75
- isStepLoading: !1,
76
- children: /* @__PURE__ */ e("div", { children: "Step Content" })
77
- }
78
- )
79
- ), o(n.queryByText("Back")).not.toBeInTheDocument();
53
+ s(
54
+ /* @__PURE__ */ e(i, { steps: o, currentStep: 0, isStepLoading: !1, children: /* @__PURE__ */ e("div", { children: "Step Content" }) })
55
+ ), n(t.queryByText("Back")).not.toBeInTheDocument();
80
56
  }), p("renders the next button as submit on last step", () => {
81
- r(
82
- /* @__PURE__ */ e(
83
- l,
84
- {
85
- steps: i,
86
- currentStep: 2,
87
- isStepLoading: !1,
88
- children: /* @__PURE__ */ e("div", { children: "Step Content" })
89
- }
90
- )
57
+ s(
58
+ /* @__PURE__ */ e(i, { steps: o, currentStep: 2, isStepLoading: !1, children: /* @__PURE__ */ e("div", { children: "Step Content" }) })
91
59
  );
92
- const t = n.getByText("Finish").closest("button");
93
- o(t).toHaveAttribute("type", "submit");
60
+ const r = t.getByText("Finish").closest("button");
61
+ n(r).toHaveAttribute("type", "submit");
62
+ }), p("does not render the stepper header when showStepperHeader is false", () => {
63
+ s(
64
+ /* @__PURE__ */ e(i, { steps: o, currentStep: 1, isStepLoading: !1, showStepperHeader: !1, children: /* @__PURE__ */ e("div", { children: "Step Content" }) })
65
+ ), n(t.queryByTestId("stepper-header")).not.toBeInTheDocument();
66
+ }), p("does not render stepper button icons when showArrowIcon is false", () => {
67
+ o[1].nextButtonProps.showArrowIcon = !1, o[1].prevButtonProps.showArrowIcon = !1, s(
68
+ /* @__PURE__ */ e(i, { steps: o, currentStep: 1, isStepLoading: !1, children: /* @__PURE__ */ e("div", { children: "Step Content" }) })
69
+ ), n(t.queryByText("arrow_forward")).not.toBeInTheDocument(), n(t.queryByText("arrow_back")).not.toBeInTheDocument();
94
70
  });
95
71
  });
@@ -6,9 +6,12 @@ import { StepperButtonProps } from '../stepperTypes';
6
6
  * @param onClick - The function to be called when the button is clicked.
7
7
  * @param disabled - Whether the button is disabled or not.
8
8
  * @param className - Additional class names to apply to the button.
9
+ * @param showArrowIcon - Whether to show a leading arrow icon for the button. Defaults to true.
10
+ * @param buttonSize - The size of the button, defaults to 'themeDefault'.
11
+ * @param fullWidth - Whether the button should take the full width of its container. Defaults to true.
9
12
  * @returns
10
13
  */
11
- export declare const StepperPreviousButton: ({ label, onClick, disabled, className, }: StepperButtonProps) => import("react/jsx-runtime").JSX.Element;
14
+ export declare const StepperPreviousButton: ({ label, onClick, disabled, className, showArrowIcon, buttonSize, fullWidth, }: StepperButtonProps) => import("react/jsx-runtime").JSX.Element;
12
15
  /**
13
16
  * A button component for the stepper that is used to go to the next step.
14
17
  * @param label - The label of the button.
@@ -17,9 +20,12 @@ export declare const StepperPreviousButton: ({ label, onClick, disabled, classNa
17
20
  * @param className - Additional class names to apply to the button.
18
21
  * @param isStepLoading - A boolean indicating if the current step is loading. If true, the next button will show a loading state and be disabled.
19
22
  * @param isLastStep - A boolean indicating if this is the last step. If true, the button will submit the form instead of going to the next step.
23
+ * @param showArrowIcon - Whether to show a trailing arrow icon for the button. Defaults to true.
24
+ * @param buttonSize - The size of the button, defaults to 'themeDefault'.
25
+ * @param fullWidth - Whether the button should take the full width of its container. Defaults to true.
20
26
  * @returns
21
27
  */
22
- export declare const StepperNextButton: ({ label, onClick, disabled, className, isStepLoading, isLastStep, }: StepperButtonProps & {
28
+ export declare const StepperNextButton: ({ label, onClick, disabled, className, isStepLoading, isLastStep, showArrowIcon, buttonSize, fullWidth, }: StepperButtonProps & {
23
29
  isStepLoading?: boolean;
24
30
  isLastStep?: boolean;
25
31
  }) => import("react/jsx-runtime").JSX.Element;
@@ -1,44 +1,60 @@
1
- import { jsx as a } from "react/jsx-runtime";
2
- import { B as p } from "../../../index.es-CiqbARoC.js";
3
- import { s } from "../../../stepper.module-HuqmDJPj.js";
4
- const c = ({
5
- label: t,
6
- onClick: r,
7
- disabled: e,
8
- className: o
9
- }) => /* @__PURE__ */ a(
10
- p,
1
+ import { jsx as p } from "react/jsx-runtime";
2
+ import { B as s } from "../../../index.es-CiqbARoC.js";
3
+ import { useMemo as c } from "react";
4
+ import { s as i } from "../../../stepper.module-HuqmDJPj.js";
5
+ const $ = ({
6
+ label: o,
7
+ onClick: u,
8
+ disabled: n,
9
+ className: a,
10
+ showArrowIcon: t = !0,
11
+ buttonSize: e = "themeDefault",
12
+ fullWidth: r = !0
13
+ }) => /* @__PURE__ */ p(
14
+ s,
11
15
  {
12
16
  "data-testid": "stepper-previous-button",
13
- className: `${s.stepperButton} ${o ?? ""}`,
14
- onClick: r,
15
- disabled: e,
16
- fullWidth: !0,
17
+ className: `${i.stepperButton} ${a ?? ""}`,
18
+ onClick: u,
19
+ disabled: n,
20
+ fullWidth: r,
21
+ buttonSize: e,
17
22
  variant: "outlined",
18
- leadingIcon: "arrow_back",
19
- children: t
23
+ leadingIcon: t ? "arrow_back" : void 0,
24
+ type: "button",
25
+ children: o
20
26
  }
21
- ), m = ({
22
- label: t,
23
- onClick: r,
24
- disabled: e,
25
- className: o,
26
- isStepLoading: n,
27
- isLastStep: u
28
- }) => /* @__PURE__ */ a(
29
- p,
30
- {
31
- "data-testid": "stepper-next-button",
32
- className: `${s.stepperButton} ${n ? s.stepperButtonLoading : ""} ${o ?? ""}`,
33
- onClick: r,
34
- disabled: n || e,
35
- fullWidth: !0,
36
- trailingIcon: n || u ? void 0 : "arrow_forward",
37
- type: u ? "submit" : "button",
38
- children: t
39
- }
40
- );
27
+ ), x = ({
28
+ label: o,
29
+ onClick: u,
30
+ disabled: n,
31
+ className: a,
32
+ isStepLoading: t,
33
+ isLastStep: e,
34
+ showArrowIcon: r = !0,
35
+ buttonSize: m = "themeDefault",
36
+ fullWidth: d = !0
37
+ }) => {
38
+ const l = c(() => {
39
+ if (!t && !e)
40
+ return r ? "arrow_forward" : void 0;
41
+ }, [e, t, r]);
42
+ return /* @__PURE__ */ p(
43
+ s,
44
+ {
45
+ "data-testid": "stepper-next-button",
46
+ className: `${i.stepperButton} ${t ? i.stepperButtonLoading : ""} ${a ?? ""}`,
47
+ onClick: u,
48
+ disabled: t || n,
49
+ fullWidth: d,
50
+ trailingIcon: l,
51
+ type: e ? "submit" : "button",
52
+ buttonSize: m,
53
+ children: o
54
+ }
55
+ );
56
+ };
41
57
  export {
42
- m as StepperNextButton,
43
- c as StepperPreviousButton
58
+ x as StepperNextButton,
59
+ $ as StepperPreviousButton
44
60
  };
@@ -40,8 +40,11 @@ export type Step = {
40
40
  * @param {boolean} disabled - Whether the button is disabled or not.
41
41
  * @param {() => void} onClick - The function to be called when the button is clicked.
42
42
  * @param {string | ReactNode} label - The label of the button.
43
+ * @param {boolean} showArrowIcon - Whether to show a leading/trailing arrow icon for the button.
44
+ * @param {string} buttonSize - The size of the button, defaults to 'themeDefault'.
45
+ * @param {boolean} fullWidth - Whether the button should take the full width of its container. *
43
46
  */
44
- export type StepperButtonProps = Pick<ButtonProps, 'className' | 'disabled'> & {
47
+ export type StepperButtonProps = Pick<ButtonProps, 'className' | 'disabled' | 'fullWidth'> & {
45
48
  /**
46
49
  * The function to be called when the button is clicked.
47
50
  */
@@ -50,11 +53,22 @@ export type StepperButtonProps = Pick<ButtonProps, 'className' | 'disabled'> & {
50
53
  * The label of the button.
51
54
  */
52
55
  label: string | ReactNode;
56
+ /**
57
+ * Whether to show a leading/trailing arrow icon for the button.
58
+ */
59
+ showArrowIcon?: boolean;
60
+ /**
61
+ * Property adapted from Element library
62
+ */
63
+ buttonSize?: 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'themeDefault';
53
64
  };
54
65
  /**
55
66
  * @param {Step[]} steps - An array of steps for the stepper.
56
67
  * @param {number} currentStep - The current step index.
57
68
  * @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.
69
+ * @param {boolean} showStepperHeader - An indicator of whether to show the stepper header. Defaults to true.
70
+ * @param {string} stepperButtonAlignment - The alignment of the stepper button group. Defaults to 'center'.
71
+ * @param {boolean} showPreviousButtonOnFirstStep - A flag which indicates if the previous button should be shown on the first step. This can be useful for canceling the stepper.
58
72
  */
59
73
  export type StepperProps = {
60
74
  /**
@@ -69,6 +83,22 @@ export type StepperProps = {
69
83
  * a flag which indicates if the current step is loading.
70
84
  */
71
85
  isStepLoading?: boolean;
86
+ /**
87
+ * An indicator of whether to show the stepper header.
88
+ * @default true
89
+ */
90
+ showStepperHeader?: boolean;
91
+ /**
92
+ * The alignment of the stepper button group.
93
+ * @default 'center'
94
+ */
95
+ stepperButtonAlignment?: 'center' | 'space-between';
96
+ /**
97
+ * A flag which indicates if the previous button should be shown on the first step.
98
+ * This can be useful for canceling the stepper.
99
+ * @default false
100
+ */
101
+ showPreviousButtonOnFirstStep?: boolean;
72
102
  };
73
103
  /**
74
104
  * @param {Step[]} steps - An array of steps for the stepper.
package/dist/main.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export { AlertBanner } from './components/AlertBanner/AlertBanner';
2
+ export { LinkBanner } from './components/AlertBanner/LinkBanner';
2
3
  export { BaseView } from './components/BaseView/BaseView';
3
4
  export { BasicHeading } from './components/BasicHeading/BasicHeading';
4
5
  export { BlockView } from './components/BlockView/BlockView';
@@ -20,6 +21,8 @@ export { ListArea } from './components/ListArea/ListArea';
20
21
  export { LoadingSpinner } from './components/LoadingSpinner/Default/LoadingSpinner';
21
22
  export { Modal } from './components/Modal/Modal';
22
23
  export { ModulePadding } from './components/ModulePadding/ModulePadding';
24
+ export { OfflineView } from './components/OfflineView/OfflineView';
25
+ export { OnboardingBanner } from './components/OnboardingBanner/OnboardingBanner';
23
26
  export { OverflowTooltip } from './components/OverflowTooltip/OverflowTooltip';
24
27
  export { ScrollbarX, ScrollbarY } from './components/Scrollbar/Scrollbar';
25
28
  export { SearchBar } from './components/SearchBar/SearchBar';
@@ -28,7 +31,6 @@ export { StepperHeader } from './components/Stepper/components/StepperHeader';
28
31
  export { StepperIndicator } from './components/Stepper/components/StepperIndicator';
29
32
  export { Stepper } from './components/Stepper/Stepper';
30
33
  export { VerticalDivider } from './components/VerticalDivider/VerticalDivider';
31
- export { OnboardingBanner } from './components/OnboardingBanner/OnboardingBanner';
32
34
  export { FormCheckBox } from './components/FormComponents/FormCheckBox/FormCheckBox';
33
35
  export { FormDatePicker } from './components/FormComponents/FormDatePicker/FormDatePicker';
34
36
  export { FormNumber } from './components/FormComponents/FormNumber/FormNumber';
@@ -40,17 +42,17 @@ export { FormToggle } from './components/FormComponents/FormToggle/FormToggle';
40
42
  export { AvailableCustomIcons } from './enums/AvailableCustomIcons';
41
43
  export { ThemeColor } from './enums/ThemeColor';
42
44
  export { useBreakpoints } from './hooks/useBreakpoints';
43
- export { capitalizeFirstLetters, getNumberAsLocaleString, trimLeadingAndTrailingSpaces, } from './services/UtilService';
45
+ export { capitalizeFirstLetters, getNumberAsLocaleString, trimLeadingAndTrailingSpaces } from './services/UtilService';
44
46
  export type { ActionProps } from './components/ContextMenu/ContextMenu';
45
47
  export type { FormSelectOption } from './components/FormComponents/FormSelect/FormSelect';
46
48
  export type { FormTextProps } from './components/FormComponents/FormText/FormText';
47
49
  export type { HealthCheckFailedProps } from './components/HealthCheckFailed/HealthCheckFailed';
48
50
  export type { FieldItem } from './components/InfoGroup/InfoGroup';
49
51
  export type { LoadingSpinnerProps } from './components/LoadingSpinner/Default/LoadingSpinner';
50
- export type { Step, StepperBaseProps, StepperButtonProps, StepperProps, } from './components/Stepper/stepperTypes';
52
+ export type { Step, StepperBaseProps, StepperButtonProps, StepperProps } from './components/Stepper/stepperTypes';
51
53
  export type { FilterData, FilterOption, FilterSelection } from './types/Filter';
52
54
  export type { CellTemplate, CellTemplateProps, TableLayoutProps } from './types/GenericTable';
53
55
  export type { HashTab } from './types/HashTab';
54
56
  export type { BaseListElement, ListElement } from './types/ListElement';
55
- export { AVAILABLE_COUNTRY_KEYS, AVAILABLE_LOCALES, ENGLISH_LANGUAGE_ID, GERMAN_LANGUAGE_ID, LANGUAGE_CODES_MAPPER, LANGUAGE_ID_MAPPER, SPANISH_LANGUAGE_ID, TURKISH_LANGUAGE_ID, } from './types/Languages';
57
+ export { AVAILABLE_COUNTRY_KEYS, AVAILABLE_LOCALES, ENGLISH_LANGUAGE_ID, GERMAN_LANGUAGE_ID, LANGUAGE_CODES_MAPPER, LANGUAGE_ID_MAPPER, SPANISH_LANGUAGE_ID, TURKISH_LANGUAGE_ID } from './types/Languages';
56
58
  export type { AVAILABLE_LANGUAGE_CODES, LANGUAGE_COUNTRY_CODES } from './types/Languages';