@hortiview/shared-components 1.12.0 → 2.1.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 +21 -0
- package/README.md +15 -0
- package/dist/GenericCard-BFYKwkzI.js +89 -0
- package/dist/assets/OnboardingBanner.css +1 -0
- package/dist/components/Filter/Filter.js +11 -12
- package/dist/components/GenericTable/GenericTable.js +3 -4
- package/dist/components/GenericTable/Mobile/GenericCard.js +3 -2
- package/dist/components/GenericTable/Mobile/GenericCard.test.js +1 -1
- package/dist/components/GenericTable/Mobile/GenericCardList.js +1 -1
- package/dist/components/ModulePadding/ModulePadding.js +4 -5
- package/dist/components/OnboardingBanner/OnboardingBanner.d.ts +30 -0
- package/dist/components/OnboardingBanner/OnboardingBanner.js +89 -0
- package/dist/components/OnboardingBanner/OnboardingBanner.test.d.ts +1 -0
- package/dist/components/OnboardingBanner/OnboardingBanner.test.js +72 -0
- package/dist/index.es-Dvj_qpAp.js +268 -0
- package/dist/main.d.ts +4 -4
- package/dist/main.js +94 -93
- package/package.json +1 -1
- package/dist/GenericCard-DuNnB9Ve.js +0 -350
- package/dist/assets/main.css +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
## [2.1.0](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/compare/v2.0.0...v2.1.0) (2025-06-11)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
* create OnboardingBanner component ([8cfeadf](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/8cfeadf8dde24b6d888de22533e506805b81c83c))
|
|
6
|
+
* improve component API, update tests and docs ([12e6da4](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/12e6da4a40b66885dc2ccf56c8319e4baab5df4c))
|
|
7
|
+
|
|
8
|
+
### Code Refactoring
|
|
9
|
+
|
|
10
|
+
* change index to buttonProps.id ([0c9e4b6](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/0c9e4b661ef71bde4b82540a15d73a2d2e79552c))
|
|
11
|
+
|
|
12
|
+
## [2.0.0](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/compare/v1.12.0...v2.0.0) (2025-06-06)
|
|
13
|
+
|
|
14
|
+
### ⚠ BREAKING CHANGES
|
|
15
|
+
|
|
16
|
+
* remove font call from main.ts but keep it for storybook
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
* remove font call from main.ts but keep it for storybook ([a5999c7](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/a5999c72ac274c4a23efd06d0e362f427e87f1c0))
|
|
21
|
+
|
|
1
22
|
## [1.12.0](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/compare/v1.11.0...v1.12.0) (2025-06-02)
|
|
2
23
|
|
|
3
24
|
### Features
|
package/README.md
CHANGED
|
@@ -51,6 +51,7 @@ Additionally the library provides form components using [react-hook-form](https:
|
|
|
51
51
|
1. [LoadingSpinner](#loadingspinner)
|
|
52
52
|
1. [Modal](#modal)
|
|
53
53
|
1. [ModulePadding](#modulepadding)
|
|
54
|
+
1. [OnboardingBanner](#onboardingbanner)
|
|
54
55
|
1. [OverflowTooltip](#overflowtooltip)
|
|
55
56
|
1. [ScrollBar](#scrollbar)
|
|
56
57
|
1. [SearchBar](#searchbar)
|
|
@@ -887,6 +888,20 @@ import { ModulePadding } from '@hortiview/shared-components';
|
|
|
887
888
|
</ModulePadding>;
|
|
888
889
|
```
|
|
889
890
|
|
|
891
|
+
### OnboardingBanner
|
|
892
|
+
|
|
893
|
+
A responsive onboarding banner that adapts its layout for desktop and mobile.
|
|
894
|
+
|
|
895
|
+
- **Desktop:** Media content is displayed to the _right_ of the description
|
|
896
|
+
- **Mobile:** Media content appears _above_ the description
|
|
897
|
+
|
|
898
|
+
```jsx
|
|
899
|
+
import {OnboardingBanner} from '@hortiview/shared-components';
|
|
900
|
+
|
|
901
|
+
<OnboardingBanner headline='Hello' />
|
|
902
|
+
|
|
903
|
+
```
|
|
904
|
+
|
|
890
905
|
### OverflowTooltip
|
|
891
906
|
|
|
892
907
|
Provides a tooltip and overflow behavior of a given text value.
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { jsx as r, jsxs as d, Fragment as C } from "react/jsx-runtime";
|
|
2
|
+
import { C as h, a as m, b as T, c as g, d as v } from "./index.es-6TJ1S8Jr.js";
|
|
3
|
+
import { G as b, a as x, b as c } from "./index.es-Dvj_qpAp.js";
|
|
4
|
+
import { d as f } from "./index.es-D54RuMc_.js";
|
|
5
|
+
import { useMemo as w } from "react";
|
|
6
|
+
import { OverflowTooltip as l } from "./components/OverflowTooltip/OverflowTooltip.js";
|
|
7
|
+
import './assets/GenericCard.css';const u = "_cardTitle_ny9m0_1", B = "_cardBody_ny9m0_5", N = "_cardContent_ny9m0_10", $ = "_row_ny9m0_14", G = "_font_ny9m0_18", k = "_fontHeader_ny9m0_23", H = "_title_ny9m0_27", S = "_emptyContainer_ny9m0_33", A = "_empty_ny9m0_33", n = {
|
|
8
|
+
cardTitle: u,
|
|
9
|
+
cardBody: B,
|
|
10
|
+
cardContent: N,
|
|
11
|
+
row: $,
|
|
12
|
+
font: G,
|
|
13
|
+
fontHeader: k,
|
|
14
|
+
title: H,
|
|
15
|
+
emptyContainer: S,
|
|
16
|
+
empty: A
|
|
17
|
+
}, _ = {
|
|
18
|
+
desktopCol: 6,
|
|
19
|
+
phoneCol: 2,
|
|
20
|
+
tabletCol: 4,
|
|
21
|
+
verticalAlign: "bottom"
|
|
22
|
+
}, W = ({ item: e, columns: t, hiddenColumns: o }) => {
|
|
23
|
+
const i = t.find((a) => a.asCardTitle), y = t.find((a) => a.asCardSubtitle), p = w(
|
|
24
|
+
() => t.filter(
|
|
25
|
+
(a) => !a.asCardTitle && !a.asCardSubtitle && a.id !== "actions"
|
|
26
|
+
),
|
|
27
|
+
[t]
|
|
28
|
+
);
|
|
29
|
+
return /* @__PURE__ */ r(
|
|
30
|
+
h,
|
|
31
|
+
{
|
|
32
|
+
variant: "raised",
|
|
33
|
+
"data-testid": `card${i ? "-" + e[i.accessor] : ""}`,
|
|
34
|
+
children: /* @__PURE__ */ d(m, { className: n.cardContent, "data-testid": "card-content", children: [
|
|
35
|
+
/* @__PURE__ */ r(j, { item: e, titleColumn: i, subTitleColumn: y }),
|
|
36
|
+
/* @__PURE__ */ r(T, { className: n.cardBody, "data-testid": "card-body", children: /* @__PURE__ */ r(b, { fullHeight: !0, fullWidth: !0, variant: "none", children: p.map((a) => o?.includes(a.id) ? null : /* @__PURE__ */ d(x, { className: n.row, "data-testid": "row", children: [
|
|
37
|
+
/* @__PURE__ */ r(c, { horizontalAlign: "right", ..._, children: /* @__PURE__ */ d(
|
|
38
|
+
f,
|
|
39
|
+
{
|
|
40
|
+
level: 2,
|
|
41
|
+
themeColor: "text-secondary-on-background",
|
|
42
|
+
className: `${n.font} ${n.fontHeader}`,
|
|
43
|
+
tag: "div",
|
|
44
|
+
children: [
|
|
45
|
+
a.header,
|
|
46
|
+
":"
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
) }),
|
|
50
|
+
/* @__PURE__ */ r(c, { horizontalAlign: "left", ..._, children: /* @__PURE__ */ r(s, { column: a, item: e }) })
|
|
51
|
+
] }, a.id)) }) })
|
|
52
|
+
] })
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
}, j = ({ item: e, titleColumn: t, subTitleColumn: o }) => {
|
|
56
|
+
const i = e.actions;
|
|
57
|
+
return !t && !o && !i ? null : /* @__PURE__ */ d(C, { children: [
|
|
58
|
+
/* @__PURE__ */ r(
|
|
59
|
+
g,
|
|
60
|
+
{
|
|
61
|
+
"data-testid": "card-title",
|
|
62
|
+
className: n.cardTitle,
|
|
63
|
+
primaryText: t !== void 0 && /* @__PURE__ */ r(s, { column: t, item: e, isTitle: !0 }),
|
|
64
|
+
secondaryText: o !== void 0 && /* @__PURE__ */ r(s, { column: o, item: e, isTitle: !0 }),
|
|
65
|
+
trailingBlock: i,
|
|
66
|
+
trailingBlockType: i ? "title-actions" : void 0
|
|
67
|
+
}
|
|
68
|
+
),
|
|
69
|
+
/* @__PURE__ */ r(v, {})
|
|
70
|
+
] });
|
|
71
|
+
}, s = ({ item: e, column: t, isTitle: o = !1 }) => t.cellTemplate ? t.cellTemplate({ row: { original: e } }) : o ? /* @__PURE__ */ r(
|
|
72
|
+
l,
|
|
73
|
+
{
|
|
74
|
+
id: `tip_${t.id}_${e[t.accessor]}`,
|
|
75
|
+
text: e[t.accessor],
|
|
76
|
+
children: /* @__PURE__ */ r("span", { className: n.title, children: e[t.accessor] })
|
|
77
|
+
}
|
|
78
|
+
) : /* @__PURE__ */ r(
|
|
79
|
+
l,
|
|
80
|
+
{
|
|
81
|
+
id: `tip_${t.id}_${e[t.accessor]}`,
|
|
82
|
+
text: e[t.accessor],
|
|
83
|
+
children: /* @__PURE__ */ r(f, { level: 2, themeColor: "text-primary-on-background", className: n.font, children: e[t.accessor] })
|
|
84
|
+
}
|
|
85
|
+
);
|
|
86
|
+
export {
|
|
87
|
+
W as G,
|
|
88
|
+
n as s
|
|
89
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._elevation_5dfyt_1{background-color:var(--lmnt-theme-primary-50)}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { jsx as e, jsxs as b, Fragment as D } from "react/jsx-runtime";
|
|
2
2
|
import { N as F } from "../../index.es-fnFnw2P1.js";
|
|
3
|
-
import { B as
|
|
3
|
+
import { B as p } from "../../index.es-CiqbARoC.js";
|
|
4
4
|
import { G as _ } from "../../index.es-DntoATwO.js";
|
|
5
5
|
import { I as W } from "../../index.es-0lQcz8m1.js";
|
|
6
6
|
import { S as j } from "../../index.es-8GOVkuo-.js";
|
|
7
7
|
import { useState as v } from "react";
|
|
8
|
-
import '../../assets/main.css';import '../../assets/Filter.css';/* empty css */
|
|
9
8
|
import { Iconify as z } from "../Iconify/Iconify.js";
|
|
10
9
|
import { u as k } from "../../useBreakpoints-MzTZ0tCT.js";
|
|
11
10
|
import "../../react-tooltip.min-DSY6KDqS.js";
|
|
@@ -18,12 +17,12 @@ import "react-hook-form";
|
|
|
18
17
|
import "../../get-DFv1gXfq.js";
|
|
19
18
|
import "../../isArray-Dub1wGJM.js";
|
|
20
19
|
import "../../isString-BW9UHONv.js";
|
|
21
|
-
const K = "_filterButton_qtl7a_1", T = "_relativeParent_qtl7a_6", V = "_filterBadge_qtl7a_10", E = "_dense_qtl7a_17", u = {
|
|
20
|
+
import '../../assets/Filter.css';const K = "_filterButton_qtl7a_1", T = "_relativeParent_qtl7a_6", V = "_filterBadge_qtl7a_10", E = "_dense_qtl7a_17", u = {
|
|
22
21
|
filterButton: K,
|
|
23
22
|
relativeParent: T,
|
|
24
23
|
filterBadge: V,
|
|
25
24
|
dense: E
|
|
26
|
-
},
|
|
25
|
+
}, mt = ({
|
|
27
26
|
clearFilterText: m,
|
|
28
27
|
closeCallback: s,
|
|
29
28
|
currentFilter: i,
|
|
@@ -32,7 +31,7 @@ const K = "_filterButton_qtl7a_1", T = "_relativeParent_qtl7a_6", V = "_filterBa
|
|
|
32
31
|
filterModalTitle: t,
|
|
33
32
|
filters: f,
|
|
34
33
|
modalCancelButtonText: g,
|
|
35
|
-
modalConfirmButtonText:
|
|
34
|
+
modalConfirmButtonText: h,
|
|
36
35
|
useModal: o = !0,
|
|
37
36
|
selectAllLabel: r,
|
|
38
37
|
"data-testid": w
|
|
@@ -68,9 +67,9 @@ const K = "_filterButton_qtl7a_1", T = "_relativeParent_qtl7a_6", V = "_filterBa
|
|
|
68
67
|
onClose: x,
|
|
69
68
|
title: t,
|
|
70
69
|
modalSize: A ? "small" : "fullscreen",
|
|
71
|
-
headerActions: /* @__PURE__ */ e(
|
|
70
|
+
headerActions: /* @__PURE__ */ e(p, { "data-testid": "filter-clear-button", variant: "text", onClick: O, children: m }),
|
|
72
71
|
dismissiveButton: /* @__PURE__ */ e(
|
|
73
|
-
|
|
72
|
+
p,
|
|
74
73
|
{
|
|
75
74
|
"data-testid": "filter-cancel-button",
|
|
76
75
|
variant: "outlined",
|
|
@@ -78,13 +77,13 @@ const K = "_filterButton_qtl7a_1", T = "_relativeParent_qtl7a_6", V = "_filterBa
|
|
|
78
77
|
children: g
|
|
79
78
|
}
|
|
80
79
|
),
|
|
81
|
-
primaryButton: /* @__PURE__ */ e(
|
|
80
|
+
primaryButton: /* @__PURE__ */ e(p, { "data-testid": "filter-confirm-button", variant: "filled", onClick: x, children: h }),
|
|
82
81
|
children: /* @__PURE__ */ e(_, { direction: "vertical", "data-testid": "filter-map-filters", children: N(f, c, S, r) })
|
|
83
82
|
}
|
|
84
83
|
)
|
|
85
84
|
] }) : /* @__PURE__ */ e(_, { secondaryAlign: "center", fullWidth: !0, children: N(f, c, S, r, !1) });
|
|
86
|
-
}, N = (m, s, i, d, a = !0) => m.map(({ id: t, title: f, availableOptions: g, icon:
|
|
87
|
-
|
|
85
|
+
}, N = (m, s, i, d, a = !0) => m.map(({ id: t, title: f, availableOptions: g, icon: h, type: o }) => /* @__PURE__ */ b(_, { fullWidth: !0, secondaryAlign: "center", "data-testid": `filter-${o}-group-${t}`, children: [
|
|
86
|
+
h ? /* @__PURE__ */ e(z, { icon: h, iconSize: "medium" }) : null,
|
|
88
87
|
o === "select" && /* @__PURE__ */ e(
|
|
89
88
|
I,
|
|
90
89
|
{
|
|
@@ -158,7 +157,7 @@ const K = "_filterButton_qtl7a_1", T = "_relativeParent_qtl7a_6", V = "_filterBa
|
|
|
158
157
|
style: { height: "100%", width: t ? void 0 : "100%" },
|
|
159
158
|
children: [
|
|
160
159
|
/* @__PURE__ */ e(
|
|
161
|
-
|
|
160
|
+
p,
|
|
162
161
|
{
|
|
163
162
|
"data-testid": "filter-button",
|
|
164
163
|
variant: "outlined",
|
|
@@ -184,5 +183,5 @@ const K = "_filterButton_qtl7a_1", T = "_relativeParent_qtl7a_6", V = "_filterBa
|
|
|
184
183
|
);
|
|
185
184
|
};
|
|
186
185
|
export {
|
|
187
|
-
|
|
186
|
+
mt as Filter
|
|
188
187
|
};
|
|
@@ -21,7 +21,6 @@ import { b as vo, c as lo, d as yi, f as wl, g as Rl } from "../../tslib.es6-BDC
|
|
|
21
21
|
import { M as bi, a as wi } from "../../component-neHBNHRu.js";
|
|
22
22
|
import { c as Ga } from "../../component-DsB0poTj.js";
|
|
23
23
|
import { a as Cl } from "../../util-DA21pZXj.js";
|
|
24
|
-
import '../../assets/main.css';import '../../assets/GenericTable.css';/* empty css */
|
|
25
24
|
import "../../isEmpty-B4GG2s-V.js";
|
|
26
25
|
import { u as Sl } from "../../useBreakpoints-MzTZ0tCT.js";
|
|
27
26
|
import "../../react-tooltip.min-DSY6KDqS.js";
|
|
@@ -32,7 +31,7 @@ import "../../isArray-Dub1wGJM.js";
|
|
|
32
31
|
import "../../isString-BW9UHONv.js";
|
|
33
32
|
import { useGenerateColumns as El, useGenerateTableData as xl } from "./GenericTableService.js";
|
|
34
33
|
import { GenericCardList as Pl } from "./Mobile/GenericCardList.js";
|
|
35
|
-
function Il(r, o) {
|
|
34
|
+
import '../../assets/GenericTable.css';function Il(r, o) {
|
|
36
35
|
r.prototype = Object.create(o.prototype), r.prototype.constructor = r, ml(r, o);
|
|
37
36
|
}
|
|
38
37
|
/**
|
|
@@ -10433,7 +10432,7 @@ const bd = "_topBar_1tmb3_1", wd = "_filterBar_1tmb3_5", Rd = "_start_1tmb3_10",
|
|
|
10433
10432
|
elevation: Sd,
|
|
10434
10433
|
table: Ed,
|
|
10435
10434
|
noBorder: xd
|
|
10436
|
-
},
|
|
10435
|
+
}, ac = ({
|
|
10437
10436
|
data: r = [],
|
|
10438
10437
|
hiddenColumns: o = [],
|
|
10439
10438
|
order: e = [],
|
|
@@ -10545,5 +10544,5 @@ const bd = "_topBar_1tmb3_1", wd = "_filterBar_1tmb3_5", Rd = "_start_1tmb3_10",
|
|
|
10545
10544
|
) });
|
|
10546
10545
|
};
|
|
10547
10546
|
export {
|
|
10548
|
-
|
|
10547
|
+
ac as GenericTable
|
|
10549
10548
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "../../../index.es-6TJ1S8Jr.js";
|
|
3
|
-
import
|
|
3
|
+
import "../../../index.es-Dvj_qpAp.js";
|
|
4
4
|
import "../../../index.es-D54RuMc_.js";
|
|
5
5
|
import "react";
|
|
6
6
|
import "../../OverflowTooltip/OverflowTooltip.js";
|
|
7
|
+
import { G } from "../../../GenericCard-BFYKwkzI.js";
|
|
7
8
|
export {
|
|
8
|
-
|
|
9
|
+
G as GenericCard
|
|
9
10
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { a as c, s as o } from "../../../react.esm-CX1WJ2Pp.js";
|
|
3
|
-
import { G as i } from "../../../GenericCard-
|
|
3
|
+
import { G as i } from "../../../GenericCard-BFYKwkzI.js";
|
|
4
4
|
import { d as m, t as s, g as e } from "../../../vi.CjhMlMwf-CKxPQtd6.js";
|
|
5
5
|
m("GenericCard", () => {
|
|
6
6
|
const d = {
|
|
@@ -2,7 +2,7 @@ import { jsx as r } from "react/jsx-runtime";
|
|
|
2
2
|
import { G as c } from "../../../index.es-DntoATwO.js";
|
|
3
3
|
import { P as l } from "../../../index.es-D-CKRzIB.js";
|
|
4
4
|
import { a as o } from "../../../index.es-D54RuMc_.js";
|
|
5
|
-
import { s as i, G as m } from "../../../GenericCard-
|
|
5
|
+
import { s as i, G as m } from "../../../GenericCard-BFYKwkzI.js";
|
|
6
6
|
const u = ({
|
|
7
7
|
columns: n,
|
|
8
8
|
data: e,
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { P as r } from "../../index.es-D-CKRzIB.js";
|
|
3
|
-
import '../../assets/main.css';/* empty css */
|
|
4
3
|
import "react";
|
|
5
4
|
import "../../isEmpty-B4GG2s-V.js";
|
|
6
|
-
import { u as
|
|
5
|
+
import { u as d } from "../../useBreakpoints-MzTZ0tCT.js";
|
|
7
6
|
import "../../react-tooltip.min-DSY6KDqS.js";
|
|
8
7
|
import "../../orderBy-Bd48bw88.js";
|
|
9
8
|
import "../../uniqueId-NU3-C36A.js";
|
|
@@ -11,8 +10,8 @@ import "react-hook-form";
|
|
|
11
10
|
import "../../get-DFv1gXfq.js";
|
|
12
11
|
import "../../isArray-Dub1wGJM.js";
|
|
13
12
|
import "../../isString-BW9UHONv.js";
|
|
14
|
-
const
|
|
15
|
-
const { isDesktop: t } =
|
|
13
|
+
const k = ({ children: o }) => {
|
|
14
|
+
const { isDesktop: t } = d();
|
|
16
15
|
return /* @__PURE__ */ i(
|
|
17
16
|
r,
|
|
18
17
|
{
|
|
@@ -24,5 +23,5 @@ const x = ({ children: o }) => {
|
|
|
24
23
|
);
|
|
25
24
|
};
|
|
26
25
|
export {
|
|
27
|
-
|
|
26
|
+
k as ModulePadding
|
|
28
27
|
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ButtonProps } from '@element-public/react-button';
|
|
2
|
+
|
|
3
|
+
type OnboardingBannerProps = {
|
|
4
|
+
headline: string;
|
|
5
|
+
description: string;
|
|
6
|
+
mediaContent?: React.ReactNode;
|
|
7
|
+
isVisible: boolean;
|
|
8
|
+
onClose: () => void;
|
|
9
|
+
buttons?: (ButtonProps & {
|
|
10
|
+
id: string;
|
|
11
|
+
})[];
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* A responsive onboarding banner that displays a headline, description, optional media content,
|
|
15
|
+
* and, if provided, one or more action buttons.
|
|
16
|
+
*
|
|
17
|
+
* @remarks
|
|
18
|
+
* On desktop, the mediaContent is shown to the right of the description;
|
|
19
|
+
* on mobile, it appears above the description.
|
|
20
|
+
*
|
|
21
|
+
* @param headline - The headline of the Onboarding Banner
|
|
22
|
+
* @param description - The description of the Onboarding Banner
|
|
23
|
+
* @param mediaContent - Optional React node (e.g. video or image) shown on the side
|
|
24
|
+
* @param isVisible - Whether the banner should be rendered
|
|
25
|
+
* @param onClose - Fired when the close icon is clicked
|
|
26
|
+
* @param buttons - An array of ButtonProps to render as action buttons below the description.
|
|
27
|
+
* @returns
|
|
28
|
+
*/
|
|
29
|
+
export declare const OnboardingBanner: ({ headline, description, mediaContent, isVisible, onClose, buttons, }: OnboardingBannerProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { jsx as o, jsxs as r } from "react/jsx-runtime";
|
|
2
|
+
import { G as a } from "../../index.es-DntoATwO.js";
|
|
3
|
+
import { I as m } from "../../index.es-0lQcz8m1.js";
|
|
4
|
+
import { B as b } from "../../index.es-CiqbARoC.js";
|
|
5
|
+
import { b as h, T as u } from "../../index.es-D54RuMc_.js";
|
|
6
|
+
import { E as g } from "../../index.es-h2lMdt7G.js";
|
|
7
|
+
import { G as f, a as v, b as i } from "../../index.es-Dvj_qpAp.js";
|
|
8
|
+
import { I as y } from "../../index.es-3043KTnb.js";
|
|
9
|
+
import { u as C } from "../../useBreakpoints-MzTZ0tCT.js";
|
|
10
|
+
import '../../assets/OnboardingBanner.css';const G = "_elevation_5dfyt_1", k = {
|
|
11
|
+
elevation: G
|
|
12
|
+
}, D = ({
|
|
13
|
+
headline: l,
|
|
14
|
+
description: s,
|
|
15
|
+
mediaContent: n,
|
|
16
|
+
isVisible: c,
|
|
17
|
+
onClose: p,
|
|
18
|
+
buttons: e
|
|
19
|
+
}) => {
|
|
20
|
+
const { isDesktop: d } = C();
|
|
21
|
+
return c ? /* @__PURE__ */ o(
|
|
22
|
+
g,
|
|
23
|
+
{
|
|
24
|
+
"data-testid": "onboarding-banner",
|
|
25
|
+
elevation: 3,
|
|
26
|
+
customPadding: "1rem 1.5rem",
|
|
27
|
+
rounded: !0,
|
|
28
|
+
className: k.elevation,
|
|
29
|
+
children: /* @__PURE__ */ o(f, { variant: "none", rowGap: "8px", columnGap: "8px", children: /* @__PURE__ */ r(v, { "data-testid": "onboarding-banner-content", children: [
|
|
30
|
+
/* @__PURE__ */ o(i, { desktopCol: 12, phoneCol: 4, tabletCol: 8, children: /* @__PURE__ */ r(
|
|
31
|
+
a,
|
|
32
|
+
{
|
|
33
|
+
"data-testid": "onboarding-banner-header-content",
|
|
34
|
+
primaryAlign: "space-between",
|
|
35
|
+
secondaryAlign: "center",
|
|
36
|
+
fullWidth: !0,
|
|
37
|
+
children: [
|
|
38
|
+
/* @__PURE__ */ o(h, { level: 6, children: l }),
|
|
39
|
+
/* @__PURE__ */ o(
|
|
40
|
+
m,
|
|
41
|
+
{
|
|
42
|
+
"data-testid": "onboarding-banner-close-button",
|
|
43
|
+
type: "button",
|
|
44
|
+
onClick: p,
|
|
45
|
+
icon: /* @__PURE__ */ o(y, { icon: "clear" })
|
|
46
|
+
}
|
|
47
|
+
)
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
) }),
|
|
51
|
+
/* @__PURE__ */ o(
|
|
52
|
+
i,
|
|
53
|
+
{
|
|
54
|
+
desktopCol: n ? 10 : 12,
|
|
55
|
+
phoneCol: 4,
|
|
56
|
+
tabletCol: 8,
|
|
57
|
+
order: d ? 2 : 3,
|
|
58
|
+
children: /* @__PURE__ */ r(a, { direction: "vertical", gap: "dense", children: [
|
|
59
|
+
/* @__PURE__ */ o(u, { bold: !0, level: 2, children: s }),
|
|
60
|
+
e && e.length > 0 && /* @__PURE__ */ o(a, { "data-testid": "onboarding-banner-buttons", direction: "horizontal", children: e?.map((t) => /* @__PURE__ */ o(
|
|
61
|
+
b,
|
|
62
|
+
{
|
|
63
|
+
"data-testid": `onboarding-banner-button-${t.id}`,
|
|
64
|
+
...t
|
|
65
|
+
},
|
|
66
|
+
t.id
|
|
67
|
+
)) })
|
|
68
|
+
] })
|
|
69
|
+
}
|
|
70
|
+
),
|
|
71
|
+
n && /* @__PURE__ */ o(
|
|
72
|
+
i,
|
|
73
|
+
{
|
|
74
|
+
horizontalAlign: "center",
|
|
75
|
+
"data-testid": "onboarding-banner-media-content",
|
|
76
|
+
desktopCol: 2,
|
|
77
|
+
phoneCol: 4,
|
|
78
|
+
tabletCol: 8,
|
|
79
|
+
order: d ? 3 : 2,
|
|
80
|
+
children: n
|
|
81
|
+
}
|
|
82
|
+
)
|
|
83
|
+
] }) })
|
|
84
|
+
}
|
|
85
|
+
) : null;
|
|
86
|
+
};
|
|
87
|
+
export {
|
|
88
|
+
D as OnboardingBanner
|
|
89
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { jsx as n, Fragment as a } from "react/jsx-runtime";
|
|
2
|
+
import { a as o, s as e } from "../../react.esm-CX1WJ2Pp.js";
|
|
3
|
+
import { OnboardingBanner as s } from "./OnboardingBanner.js";
|
|
4
|
+
import { d, t as i, a as r, g as t } from "../../vi.CjhMlMwf-CKxPQtd6.js";
|
|
5
|
+
d("Onboarding Banner Test", () => {
|
|
6
|
+
i("render OnboardingBanner with headline & description text", () => {
|
|
7
|
+
o(
|
|
8
|
+
/* @__PURE__ */ n(
|
|
9
|
+
s,
|
|
10
|
+
{
|
|
11
|
+
headline: "test",
|
|
12
|
+
description: "test description",
|
|
13
|
+
isVisible: !0,
|
|
14
|
+
onClose: r.fn()
|
|
15
|
+
}
|
|
16
|
+
)
|
|
17
|
+
), t(e.getByText("test")).toBeInTheDocument(), t(e.getByText("test description")).toBeInTheDocument();
|
|
18
|
+
}), i("render OnboardingBanner with media content", () => {
|
|
19
|
+
o(
|
|
20
|
+
/* @__PURE__ */ n(
|
|
21
|
+
s,
|
|
22
|
+
{
|
|
23
|
+
headline: "test",
|
|
24
|
+
description: "test description",
|
|
25
|
+
mediaContent: /* @__PURE__ */ n(a, { children: "Element" }),
|
|
26
|
+
isVisible: !0,
|
|
27
|
+
onClose: r.fn()
|
|
28
|
+
}
|
|
29
|
+
)
|
|
30
|
+
), t(e.getByText("Element")).toBeInTheDocument();
|
|
31
|
+
}), i("render OnboardingBanner with buttons", () => {
|
|
32
|
+
o(
|
|
33
|
+
/* @__PURE__ */ n(
|
|
34
|
+
s,
|
|
35
|
+
{
|
|
36
|
+
headline: "test",
|
|
37
|
+
description: "test description",
|
|
38
|
+
isVisible: !0,
|
|
39
|
+
onClose: r.fn(),
|
|
40
|
+
buttons: [{ label: "button-1" }, { label: "button-2" }]
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
), t(e.getByText("button-1")).toBeInTheDocument(), t(e.getByText("button-2")).toBeInTheDocument(), t(e.queryByText("button-3")).not.toBeInTheDocument();
|
|
44
|
+
}), i("calls onClose when close button is clicked", () => {
|
|
45
|
+
const l = r.fn();
|
|
46
|
+
o(
|
|
47
|
+
/* @__PURE__ */ n(
|
|
48
|
+
s,
|
|
49
|
+
{
|
|
50
|
+
headline: "test",
|
|
51
|
+
description: "test description",
|
|
52
|
+
isVisible: !0,
|
|
53
|
+
onClose: l,
|
|
54
|
+
buttons: [{ label: "button-1" }, { label: "button2" }]
|
|
55
|
+
}
|
|
56
|
+
)
|
|
57
|
+
), e.getByTestId("onboarding-banner-close-button").click(), t(l).toHaveBeenCalledTimes(1);
|
|
58
|
+
}), i("renders nothing when isVisibility is false", () => {
|
|
59
|
+
o(
|
|
60
|
+
/* @__PURE__ */ n(
|
|
61
|
+
s,
|
|
62
|
+
{
|
|
63
|
+
headline: "test",
|
|
64
|
+
description: "test description",
|
|
65
|
+
isVisible: !1,
|
|
66
|
+
onClose: r.fn(),
|
|
67
|
+
buttons: [{ label: "button-1" }, { label: "button-2" }]
|
|
68
|
+
}
|
|
69
|
+
)
|
|
70
|
+
), t(e.queryByText("test")).not.toBeInTheDocument();
|
|
71
|
+
});
|
|
72
|
+
});
|