@hortiview/shared-components 0.0.1

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 (70) hide show
  1. package/README.md +34 -0
  2. package/dist/ListAreaService-D16C1IfO.js +67 -0
  3. package/dist/_commonjsHelpers-CT_km90n.js +30 -0
  4. package/dist/assets/BaseView.css +1 -0
  5. package/dist/assets/BasicHeading.css +1 -0
  6. package/dist/assets/BlockView.css +1 -0
  7. package/dist/assets/HashTabView.css +1 -0
  8. package/dist/assets/Iconify.css +1 -0
  9. package/dist/assets/ListAreaService.css +1 -0
  10. package/dist/assets/SearchBar.css +1 -0
  11. package/dist/assets/VerticalDivider.css +1 -0
  12. package/dist/components/BaseView/BaseView.d.ts +55 -0
  13. package/dist/components/BaseView/BaseView.js +63 -0
  14. package/dist/components/BaseView/BaseView.test.d.ts +1 -0
  15. package/dist/components/BaseView/BaseView.test.js +124 -0
  16. package/dist/components/BasicHeading/BasicHeading.d.ts +48 -0
  17. package/dist/components/BasicHeading/BasicHeading.js +80 -0
  18. package/dist/components/BasicHeading/BasicHeading.test.d.ts +1 -0
  19. package/dist/components/BasicHeading/BasicHeading.test.js +35 -0
  20. package/dist/components/BlockView/BlockView.d.ts +59 -0
  21. package/dist/components/BlockView/BlockView.js +73 -0
  22. package/dist/components/BlockView/BlockView.test.d.ts +1 -0
  23. package/dist/components/BlockView/BlockView.test.js +46 -0
  24. package/dist/components/EmptyView/EmptyView.d.ts +14 -0
  25. package/dist/components/EmptyView/EmptyView.js +10 -0
  26. package/dist/components/EmptyView/EmptyView.test.d.ts +1 -0
  27. package/dist/components/EmptyView/EmptyView.test.js +18 -0
  28. package/dist/components/HashTabView/HashTabView.d.ts +47 -0
  29. package/dist/components/HashTabView/HashTabView.js +81 -0
  30. package/dist/components/HashTabView/HashTabView.test.d.ts +1 -0
  31. package/dist/components/HashTabView/HashTabView.test.js +30 -0
  32. package/dist/components/Iconify/Iconify.d.ts +13 -0
  33. package/dist/components/Iconify/Iconify.js +38 -0
  34. package/dist/components/Iconify/Iconify.test.d.ts +1 -0
  35. package/dist/components/Iconify/Iconify.test.js +24 -0
  36. package/dist/components/ListArea/ListArea.d.ts +57 -0
  37. package/dist/components/ListArea/ListArea.js +892 -0
  38. package/dist/components/ListArea/ListArea.test.d.ts +1 -0
  39. package/dist/components/ListArea/ListArea.test.js +104 -0
  40. package/dist/components/ListArea/ListAreaService.d.ts +64 -0
  41. package/dist/components/ListArea/ListAreaService.js +10 -0
  42. package/dist/components/SearchBar/SearchBar.d.ts +24 -0
  43. package/dist/components/SearchBar/SearchBar.js +33 -0
  44. package/dist/components/SearchBar/SearchBar.test.d.ts +1 -0
  45. package/dist/components/SearchBar/SearchBar.test.js +21 -0
  46. package/dist/components/VerticalDivider/VerticalDivider.d.ts +13 -0
  47. package/dist/components/VerticalDivider/VerticalDivider.js +8 -0
  48. package/dist/components/VerticalDivider/VerticalDivider.test.d.ts +1 -0
  49. package/dist/components/VerticalDivider/VerticalDivider.test.js +14 -0
  50. package/dist/enums/AvailableCustomIcons.d.ts +15 -0
  51. package/dist/enums/AvailableCustomIcons.js +4 -0
  52. package/dist/hooks/useBreakpoint.d.ts +15 -0
  53. package/dist/hooks/useBreakpoint.js +6 -0
  54. package/dist/magic-string.es-irX7syie.js +732 -0
  55. package/dist/main.d.ts +13 -0
  56. package/dist/main.js +24 -0
  57. package/dist/services/BlockService.d.ts +8 -0
  58. package/dist/services/BlockService.js +4 -0
  59. package/dist/types/HashTab.d.ts +25 -0
  60. package/dist/types/HashTab.js +1 -0
  61. package/dist/types/ListElement.d.ts +94 -0
  62. package/dist/types/ListElement.js +1 -0
  63. package/dist/types/internal/Block.d.ts +9 -0
  64. package/dist/types/internal/Block.js +1 -0
  65. package/dist/types/internal/ReactRouterTypes.d.ts +28 -0
  66. package/dist/types/internal/ReactRouterTypes.js +1 -0
  67. package/dist/useBreakpoint-DyAmuka7.js +35 -0
  68. package/dist/vi.JYQecGiw-D8gb8QJV.js +22539 -0
  69. package/dist/vite-env.d.js +1 -0
  70. package/package.json +61 -0
package/README.md ADDED
@@ -0,0 +1,34 @@
1
+ # Status
2
+
3
+ [![Build Status](https://dev.azure.com/sdundc/HV%20Platform/_apis/build/status%2FHortiView-Frontend-Shared-Publish?branchName=main)](https://dev.azure.com/sdundc/HV%20Platform/_build/latest?definitionId=88&branchName=main)
4
+
5
+ # React + TypeScript + Vite
6
+
7
+ This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
8
+
9
+ Currently, two official plugins are available:
10
+
11
+ - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
12
+ - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
13
+
14
+ ## Expanding the ESLint configuration
15
+
16
+ If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
17
+
18
+ - Configure the top-level `parserOptions` property like this:
19
+
20
+ ```js
21
+ export default {
22
+ // other rules...
23
+ parserOptions: {
24
+ ecmaVersion: 'latest',
25
+ sourceType: 'module',
26
+ project: ['./tsconfig.json', './tsconfig.node.json'],
27
+ tsconfigRootDir: __dirname,
28
+ },
29
+ }
30
+ ```
31
+
32
+ - Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
33
+ - Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
34
+ - Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
@@ -0,0 +1,67 @@
1
+ import "./assets/ListAreaService.css";
2
+ import { jsx as a } from "react/jsx-runtime";
3
+ import { TypoButton as B, TypoSubtitle as b, TypoBody as L, Icon as C } from "@element/react-components";
4
+ import { Iconify as x } from "./components/Iconify/Iconify.js";
5
+ import { AvailableCustomIcons as E } from "./enums/AvailableCustomIcons.js";
6
+ const N = "_fullWidth_tiknm_1", W = "_mainElevation_tiknm_9", $ = "_searchbar_tiknm_21", j = "_roundedBottom_tiknm_37", S = "_list_tiknm_47", w = "_listItem_tiknm_95", A = "_trailingIcon_tiknm_103", G = "_groupedListItem_tiknm_127", _ = {
7
+ fullWidth: N,
8
+ mainElevation: W,
9
+ searchbar: $,
10
+ roundedBottom: j,
11
+ list: S,
12
+ listItem: w,
13
+ trailingIcon: A,
14
+ groupedListItem: G
15
+ }, J = (o, e, n, r) => {
16
+ const s = o.reduce((i, m) => {
17
+ const { groupName: t, ...c } = m;
18
+ return !t || typeof t != "string" || (i[t] || (i[t] = {
19
+ groupName: /* @__PURE__ */ a(B, { children: t }),
20
+ id: t,
21
+ items: []
22
+ }), i[t].items = [
23
+ ...i[t].items,
24
+ g(c, e, n, !0, r)
25
+ ]), i;
26
+ }, {});
27
+ return Object.values(s);
28
+ }, K = (o, e, n, r) => o.map((s) => g(s, e, n, !1, r)), g = (o, e, n, r, s) => {
29
+ const {
30
+ title: i,
31
+ subTitle: m,
32
+ route: t,
33
+ value: c,
34
+ noNavigation: d,
35
+ disabled: I,
36
+ icon: v,
37
+ iconType: p,
38
+ trailingIcon: y,
39
+ trailingIconType: f,
40
+ actionButton: k,
41
+ onClick: h,
42
+ customTitle: u
43
+ } = o, l = e === t;
44
+ return {
45
+ select: l,
46
+ primaryText: u ?? /* @__PURE__ */ a(b, { level: 1, bold: l, themeColor: l ? "primary" : void 0, children: i }),
47
+ secondaryText: m && !u ? /* @__PURE__ */ a(L, { level: 2, themeColor: l ? "primary" : void 0, children: m }) : void 0,
48
+ trailingBlock: k ?? y ?? /* @__PURE__ */ a(C, { icon: "arrow_right" }),
49
+ leadingBlock: O(v),
50
+ nonInteractive: I,
51
+ value: c,
52
+ componentProps: {
53
+ leadingBlockType: p ?? "icon",
54
+ trailingBlockType: f ?? "icon",
55
+ className: `${p === "avatar" ? "" : _.listItem} ${n} ${r ? _.groupedListItem : ""}`,
56
+ onClick: (P, T) => h?.(T),
57
+ tag: d ? void 0 : s ?? "a",
58
+ to: d ? void 0 : t
59
+ }
60
+ };
61
+ }, O = (o) => typeof o == "string" && o in E ? /* @__PURE__ */ a(x, { icon: o }) : o;
62
+ export {
63
+ K as a,
64
+ J as g,
65
+ g as m,
66
+ _ as s
67
+ };
@@ -0,0 +1,30 @@
1
+ var u = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
2
+ function f(e) {
3
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
4
+ }
5
+ function l(e) {
6
+ if (e.__esModule)
7
+ return e;
8
+ var r = e.default;
9
+ if (typeof r == "function") {
10
+ var t = function o() {
11
+ return this instanceof o ? Reflect.construct(r, arguments, this.constructor) : r.apply(this, arguments);
12
+ };
13
+ t.prototype = r.prototype;
14
+ } else
15
+ t = {};
16
+ return Object.defineProperty(t, "__esModule", { value: !0 }), Object.keys(e).forEach(function(o) {
17
+ var n = Object.getOwnPropertyDescriptor(e, o);
18
+ Object.defineProperty(t, o, n.get ? n : {
19
+ enumerable: !0,
20
+ get: function() {
21
+ return e[o];
22
+ }
23
+ });
24
+ }), t;
25
+ }
26
+ export {
27
+ l as a,
28
+ u as c,
29
+ f as g
30
+ };
@@ -0,0 +1 @@
1
+ ._divider_1uelt_1{margin:0 2rem}
@@ -0,0 +1 @@
1
+ ._pageHeader_1hm8h_1{display:flex;flex-wrap:nowrap;justify-content:space-between;align-items:center;width:100%;margin-bottom:1rem;align-self:end}._headlineContainer_1hm8h_21,._actionButtonContainer_1hm8h_31{display:flex;align-items:center}._actionButtonContainer_1hm8h_31>button{max-height:48px}._content_1hm8h_49{display:flex;justify-content:space-between;gap:1.5rem}._leadingIcon_1hm8h_61{margin-right:.8rem}._headingWrapper_1hm8h_75{display:flex;align-items:center}._headingContainer_1hm8h_85{display:flex;flex-direction:column}._invisible_1hm8h_95{visibility:hidden}._withAvatar_1hm8h_103{margin-left:.25rem;padding-right:1rem;margin-top:0rem}._withAvatar_1hm8h_103>._iconContainer_1hm8h_113{scale:1.1}._iconContainer_1hm8h_113{padding-right:.5rem}
@@ -0,0 +1 @@
1
+ ._grid_8fci1_1{display:flex;padding-bottom:0;flex-direction:column;justify-content:center;align-items:center;gap:1rem;align-self:stretch}._black_8fci1_21{color:#000}._blockLayout_8fci1_29{padding:.5rem;gap:.5rem;display:flex;flex-direction:column;border-radius:.5rem;background:var(--secondary-color-ramp-200, #b9e5ff);width:15rem;height:15rem}._blockRow_8fci1_53{display:flex;flex-direction:row;gap:.5rem;height:100%;align-self:stretch}._block_8fci1_29{flex:auto;border-radius:.25rem;background:var(--secondary-color-ramp-600, #3599d1);align-items:center;display:flex;justify-content:center;position:relative}._block_8fci1_29._active_8fci1_91{border:2px solid var(--lmnt-theme-primary, #673ab7);background:var(--primary-color-ramp-100, #c7b7e4);margin:-2px}._block_8fci1_29._error_8fci1_103{border:2px solid var(--danger-danger, #cf2d22);background:var(--danger-color-ramp-050, #ffeaed);margin:-2px}._block_8fci1_29._empty_8fci1_115{margin:-2px;border:2px solid var(--lmnt-theme-on-surface-disabled);background:var(--lmnt-theme-surface-variant);color:var(--lmnt-theme-on-surface-disabled)}._blockText_8fci1_129{display:flex;justify-content:center;position:absolute;width:1vw;height:1vh;align-items:center}
@@ -0,0 +1 @@
1
+ ._elevation_1whcw_1{width:100%;border-radius:.5rem}._themeBackground_1whcw_11{background:var(--lmnt-theme-background)}._tabBar_1whcw_19{background:transparent;align-self:flex-end;border-radius:.5rem}._tabWrapper_1whcw_31{border-bottom:1px solid var(--lmnt-theme-on-surface-stroke)}._tabButton_1whcw_39{height:3.5rem!important}._childContainer_1whcw_47{width:25rem}._childContainerLg_1whcw_55{width:100%}
@@ -0,0 +1 @@
1
+ ._image_diw9r_1>svg{width:inherit;height:inherit;color:inherit}
@@ -0,0 +1 @@
1
+ ._fullWidth_tiknm_1{width:100%}._mainElevation_tiknm_9{background:var(--lmnt-theme-background);border-radius:.5rem;width:100%}._searchbar_tiknm_21 div{border:none}._searchbar_tiknm_21 button{margin-right:.5rem}._roundedBottom_tiknm_37{border-bottom-right-radius:.5rem;border-bottom-left-radius:.5rem}._list_tiknm_47{padding-top:0;padding-bottom:0;overflow-y:auto}._list_tiknm_47::-webkit-scrollbar-track{-webkit-box-shadow:inset 0 0 4px rgba(0,0,0,.2);border-radius:.5rem;margin-right:.25rem;background-color:var(--lmnt-theme-background)}._list_tiknm_47::-webkit-scrollbar{width:.5rem;background-color:var(--lmnt-theme-background)}._list_tiknm_47::-webkit-scrollbar-thumb{border-radius:.5rem;-webkit-box-shadow:inset 0 0 6px rgba(0,0,0,.3);background-color:var(--lmnt-theme-primary-on-surface)}._listItem_tiknm_95{border-bottom:.0775rem solid var(--lmnt-utility-gray-surface)}._listItem_tiknm_95 i:not(._trailingIcon_tiknm_103){color:var(--lmnt-theme-on-surface-inactive)}._listItem_tiknm_95 i._trailingIcon_tiknm_103{color:var(--lmnt-theme-on-surface-disabled)}._listItem_tiknm_95 [class^=mdc-list-item__start]{margin:0 1rem!important;align-self:center!important}._groupedListItem_tiknm_127{height:4.5rem!important}
@@ -0,0 +1 @@
1
+ ._searchbar_1fl50_1 button{color:var(--lmnt-theme-on-surface-inactive)!important}
@@ -0,0 +1 @@
1
+ ._divider_dqwln_1{border-left:1px solid var(--lmnt-theme-on-surface-stroke)}
@@ -0,0 +1,55 @@
1
+ import { LinkProps } from '../../types/internal/ReactRouterTypes';
2
+ import { BaseListElement } from '../../types/ListElement';
3
+ type BaseViewProps = {
4
+ /**
5
+ * elements to be displayed in the list area
6
+ */
7
+ elements: BaseListElement[];
8
+ /**
9
+ * text to be displayed when the list is empty
10
+ */
11
+ emptyText: string;
12
+ /**
13
+ * pathname of the current route, use react-router to have the best experience (use useLocation and its pathname property)
14
+ */
15
+ pathname: string;
16
+ /**
17
+ * heading of the list area
18
+ */
19
+ heading?: string;
20
+ /**
21
+ * action to be displayed in the headings ActionButton
22
+ */
23
+ action?: JSX.Element;
24
+ /**
25
+ * isSorted is true if the list should be sorted, @default true
26
+ */
27
+ isSorted?: boolean;
28
+ /**
29
+ * hasSearch is true if the list should have a search input, @default true
30
+ */
31
+ hasSearch?: boolean;
32
+ /**
33
+ * optional className is the class name of the component
34
+ */
35
+ className?: string;
36
+ /**
37
+ * withAvatar is true if the list should have an avatar, @default false
38
+ */
39
+ withAvatar?: boolean;
40
+ /**
41
+ * listMaxHeight is the max height of the list, @default 'calc(100vh - 200px)'
42
+ */
43
+ listMaxHeight?: string;
44
+ /**
45
+ * routerLinkElement is the element to be used for the elements link, use react-router Link component for the best experience.
46
+ * If the element has `noNavigation=false` and the `routerLinkElement` is undefined an `<a>` tag is used.
47
+ * @default undefined
48
+ */
49
+ routerLinkElement: undefined | React.ForwardRefExoticComponent<LinkProps & React.RefAttributes<HTMLAnchorElement>>;
50
+ };
51
+ /**
52
+ * `BaseView` is a layout component that displays a main (a list) and a detail section.
53
+ */
54
+ export declare const BaseView: ({ action, heading, elements, emptyText, hasSearch, isSorted, className, withAvatar, listMaxHeight, pathname, routerLinkElement, }: BaseViewProps) => import("react/jsx-runtime").JSX.Element;
55
+ export {};
@@ -0,0 +1,63 @@
1
+ import "../../assets/BaseView.css";
2
+ import { jsx as t, Fragment as w, jsxs as e } from "react/jsx-runtime";
3
+ import { useMemo as n } from "react";
4
+ import { EmptyView as x } from "../EmptyView/EmptyView.js";
5
+ import { ListArea as k } from "../ListArea/ListArea.js";
6
+ import { VerticalDivider as A } from "../VerticalDivider/VerticalDivider.js";
7
+ import { u as H } from "../../useBreakpoint-DyAmuka7.js";
8
+ import { Grid as L, GridRow as V, GridCol as u, Group as m } from "@element/react-components";
9
+ import { BasicHeading as a } from "../BasicHeading/BasicHeading.js";
10
+ const W = "_divider_1uelt_1", _ = {
11
+ divider: W
12
+ }, q = ({
13
+ action: d,
14
+ heading: c,
15
+ elements: o,
16
+ emptyText: s,
17
+ hasSearch: h = !0,
18
+ isSorted: p = !0,
19
+ className: f,
20
+ withAvatar: v = !1,
21
+ listMaxHeight: g = "calc(100vh - 200px)",
22
+ pathname: l,
23
+ routerLinkElement: C
24
+ }) => {
25
+ const { isLg: r } = H(), i = n(() => o.find((b) => b.route === l), [l, o]), B = n(() => i?.component ?? (r ? /* @__PURE__ */ t(x, { subtitle: s }) : /* @__PURE__ */ t(w, {})), [i, r, s]), G = n(() => r ? !0 : !i, [i, r]);
26
+ return /* @__PURE__ */ t(L, { className: f ?? "", fullHeight: !0, fullWidth: !0, columnGap: 0, children: /* @__PURE__ */ e(V, { children: [
27
+ G && /* @__PURE__ */ e(u, { desktopCol: 4, tabletCol: 12, phoneCol: 12, children: [
28
+ /* @__PURE__ */ e(m, { direction: "vertical", fullWidth: !0, children: [
29
+ c && /* @__PURE__ */ t(a, { heading: c, level: 4, marginBottom: 0, children: d }),
30
+ /* @__PURE__ */ t(
31
+ k,
32
+ {
33
+ elements: o,
34
+ hasSearch: h,
35
+ maxHeight: g,
36
+ isSorted: p,
37
+ pathname: l,
38
+ routerLinkElement: C
39
+ }
40
+ )
41
+ ] }),
42
+ r && /* @__PURE__ */ t(A, { className: _.divider, height: "100%" })
43
+ ] }),
44
+ /* @__PURE__ */ t(u, { desktopCol: 8, tabletCol: 12, phoneCol: 12, children: /* @__PURE__ */ e(m, { direction: "vertical", fullWidth: !0, children: [
45
+ /* @__PURE__ */ t(
46
+ a,
47
+ {
48
+ heading: i?.detailTitle ?? i?.title ?? "",
49
+ level: 4,
50
+ icon: i?.hideIconInDetail === !0 ? void 0 : i?.icon,
51
+ marginBottom: 0,
52
+ invisibleButton: i?.detailAction === void 0,
53
+ withAvatar: v,
54
+ children: i?.detailAction ?? d
55
+ }
56
+ ),
57
+ B
58
+ ] }) })
59
+ ] }) });
60
+ };
61
+ export {
62
+ q as BaseView
63
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,124 @@
1
+ import { jsx as a, Fragment as s } from "react/jsx-runtime";
2
+ import { a as l } from "../../useBreakpoint-DyAmuka7.js";
3
+ import { BaseView as r } from "./BaseView.js";
4
+ import { d as p, b as u, t as i, r as n, g as t, s as e, v as c, f as d } from "../../vi.JYQecGiw-D8gb8QJV.js";
5
+ p("BaseView Test", () => {
6
+ u(() => {
7
+ c.spyOn(l, "useBreakpoints").mockReturnValue({
8
+ isXs: !1,
9
+ isSm: !1,
10
+ isMd: !1,
11
+ isLg: !0,
12
+ isXlg: !0,
13
+ active: "lg"
14
+ });
15
+ });
16
+ const o = [
17
+ {
18
+ id: "1",
19
+ title: "user.personal_information",
20
+ icon: "account_circle",
21
+ route: "/personal-profile/personal-information",
22
+ component: /* @__PURE__ */ a(s, { children: "Personal information selected" })
23
+ },
24
+ {
25
+ id: "2",
26
+ title: "user.data_privacy",
27
+ icon: "privacy_tip",
28
+ route: "/personal-profile/data-privacy",
29
+ component: /* @__PURE__ */ a(s, { children: "Data Privacy selected" }),
30
+ detailTitle: "Data Privacy 2000",
31
+ hideIconInDetail: !0
32
+ },
33
+ {
34
+ id: "3",
35
+ title: "user.security",
36
+ icon: "security",
37
+ route: "/personal-profile/security",
38
+ component: /* @__PURE__ */ a(s, { children: "Security selected" })
39
+ }
40
+ ];
41
+ i("render BaseView with empty view and navigation list", () => {
42
+ n(
43
+ /* @__PURE__ */ a(
44
+ r,
45
+ {
46
+ pathname: "/personal-profile",
47
+ elements: o,
48
+ heading: "user.personal-profile",
49
+ hasSearch: !1,
50
+ emptyText: "user.noselection",
51
+ isSorted: !1,
52
+ routerLinkElement: void 0
53
+ }
54
+ )
55
+ ), t(e.getByText("user.noselection")).toBeInTheDocument(), t(e.getByText("user.personal-profile")).toBeInTheDocument(), t(e.getByText("user.personal_information")).toBeInTheDocument(), t(e.getByText("user.data_privacy")).toBeInTheDocument(), t(e.getByText("user.security")).toBeInTheDocument();
56
+ }), i("render BaseView with data and navigation list", () => {
57
+ n(
58
+ /* @__PURE__ */ a(
59
+ r,
60
+ {
61
+ pathname: "/personal-profile/personal-information",
62
+ elements: o,
63
+ heading: "user.personal-profile",
64
+ hasSearch: !1,
65
+ emptyText: "user.noselection",
66
+ isSorted: !1,
67
+ routerLinkElement: void 0
68
+ }
69
+ )
70
+ ), t(e.getByText("Personal information selected")).toBeInTheDocument(), t(e.getAllByText("account_circle")).toHaveLength(2), t(e.getAllByText("user.personal_information")).toHaveLength(2);
71
+ }), i("render BaseView with custom detail title and no detail icon", () => {
72
+ n(
73
+ /* @__PURE__ */ a(
74
+ r,
75
+ {
76
+ pathname: "/personal-profile/data-privacy",
77
+ elements: o,
78
+ heading: "user.personal-profile",
79
+ hasSearch: !1,
80
+ emptyText: "user.noselection",
81
+ isSorted: !1,
82
+ routerLinkElement: void 0
83
+ }
84
+ )
85
+ ), t(e.getByText("Data Privacy selected")).toBeInTheDocument(), t(e.getByText("Data Privacy 2000")).toBeInTheDocument(), t(e.getAllByText("privacy_tip")).toHaveLength(1), t(e.getAllByText("user.data_privacy")).toHaveLength(1);
86
+ }), i("hide empty view when screen is small", () => {
87
+ c.spyOn(l, "useBreakpoints").mockReturnValue({
88
+ isXs: !1,
89
+ isSm: !0,
90
+ isMd: !1,
91
+ isLg: !1,
92
+ isXlg: !1,
93
+ active: "sm"
94
+ }), n(
95
+ /* @__PURE__ */ a(
96
+ r,
97
+ {
98
+ pathname: "/personal-profile/data-privacy",
99
+ elements: o,
100
+ heading: "user.personal-profile",
101
+ hasSearch: !1,
102
+ emptyText: "user.noselection",
103
+ isSorted: !1,
104
+ routerLinkElement: void 0
105
+ }
106
+ )
107
+ ), t(e.queryByText("user.noselection")).not.toBeInTheDocument();
108
+ }), i("render BaseView with selected detail section", () => {
109
+ n(
110
+ /* @__PURE__ */ a(
111
+ r,
112
+ {
113
+ pathname: "/personal-profile/data-privacy",
114
+ elements: o,
115
+ heading: "user.personal-profile",
116
+ hasSearch: !1,
117
+ emptyText: "user.noselection",
118
+ isSorted: !1,
119
+ routerLinkElement: void 0
120
+ }
121
+ )
122
+ ), d.click(e.getAllByRole("option")[1]), t(e.getByText("Data Privacy selected")).toBeInTheDocument();
123
+ });
124
+ });
@@ -0,0 +1,48 @@
1
+ export type BasicHeadingProps = {
2
+ /**
3
+ * the text content of the heading
4
+ */
5
+ heading: string;
6
+ /**
7
+ * optional actions on the right side of the header
8
+ */
9
+ children?: JSX.Element | JSX.Element[];
10
+ /**
11
+ * optional margin bottom
12
+ */
13
+ marginBottom?: 'large' | number;
14
+ /**
15
+ * the level of the heading, @default 4
16
+ */
17
+ level?: number;
18
+ /**
19
+ * optional className to customize the header style
20
+ */
21
+ className?: string;
22
+ /**
23
+ * optional icon to be displayed on the left side of the header. It can be either a string {@see https://fonts.google.com/icons?selected=Material+Icons+Outlined:search:&icon.platform=web&icon.set=Material+Icons } or a JSX.Element
24
+ */
25
+ icon?: string | JSX.Element;
26
+ /**
27
+ * the subHeading of the header
28
+ */
29
+ subHeading?: string;
30
+ /**
31
+ * the level of the subHeading, @default 2
32
+ */
33
+ subHeadingLevel?: 1 | 2;
34
+ /**
35
+ * if true the actionButtonContainer will be invisible
36
+ */
37
+ invisibleButton?: boolean;
38
+ /**
39
+ * the font weight of the heading, @default 400
40
+ */
41
+ fontWeight?: 'bold' | number;
42
+ /**
43
+ * if true the header will have an avatar
44
+ * @default false
45
+ */
46
+ withAvatar?: boolean;
47
+ };
48
+ export declare const BasicHeading: ({ children, marginBottom, heading, icon, className, subHeading, subHeadingLevel, invisibleButton, level, fontWeight, withAvatar, }: BasicHeadingProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,80 @@
1
+ import "../../assets/BasicHeading.css";
2
+ import { jsxs as a, jsx as i } from "react/jsx-runtime";
3
+ import { TypoDisplay as f, TypoBody as u, Icon as y } from "@element/react-components";
4
+ import { u as I } from "../../useBreakpoint-DyAmuka7.js";
5
+ import { Iconify as B } from "../Iconify/Iconify.js";
6
+ import { AvailableCustomIcons as N } from "../../enums/AvailableCustomIcons.js";
7
+ const H = "_pageHeader_1hm8h_1", b = "_headlineContainer_1hm8h_21", A = "_actionButtonContainer_1hm8h_31", W = "_content_1hm8h_49", $ = "_leadingIcon_1hm8h_61", w = "_headingWrapper_1hm8h_75", x = "_headingContainer_1hm8h_85", T = "_invisible_1hm8h_95", j = "_withAvatar_1hm8h_103", z = "_iconContainer_1hm8h_113", n = {
8
+ pageHeader: H,
9
+ headlineContainer: b,
10
+ actionButtonContainer: A,
11
+ content: W,
12
+ leadingIcon: $,
13
+ headingWrapper: w,
14
+ headingContainer: x,
15
+ invisible: T,
16
+ withAvatar: j,
17
+ iconContainer: z
18
+ }, L = ({ icon: e }) => e ? typeof e != "string" ? /* @__PURE__ */ i("div", { className: n.iconContainer, children: e }) : e in N ? /* @__PURE__ */ i(
19
+ B,
20
+ {
21
+ icon: e,
22
+ className: n.leadingIcon,
23
+ iconSize: "large",
24
+ iconType: "filled"
25
+ }
26
+ ) : /* @__PURE__ */ i(y, { iconSize: "large", iconType: "filled", icon: e, className: n.leadingIcon }) : null, q = ({
27
+ children: e,
28
+ marginBottom: t,
29
+ heading: l,
30
+ icon: d,
31
+ className: h,
32
+ subHeading: o,
33
+ subHeadingLevel: m = 2,
34
+ invisibleButton: p = !1,
35
+ level: r = 4,
36
+ fontWeight: s = 400,
37
+ withAvatar: _ = !1
38
+ }) => {
39
+ const { isLg: c } = I(), g = c ? r : r + 1, v = s === "bold" ? 500 : s, C = () => {
40
+ if (t !== void 0)
41
+ return typeof t == "number" ? `${t}px` : "2rem";
42
+ };
43
+ return /* @__PURE__ */ a(
44
+ "div",
45
+ {
46
+ className: n.pageHeader,
47
+ style: { marginBottom: C() },
48
+ "data-testid": "HeaderContainer",
49
+ children: [
50
+ /* @__PURE__ */ a("div", { className: `${_ && c ? n.withAvatar : ""} ${n.headingWrapper}`, children: [
51
+ /* @__PURE__ */ i(L, { icon: d }),
52
+ /* @__PURE__ */ a("div", { className: o ? n.headingContainer : "", children: [
53
+ /* @__PURE__ */ i(
54
+ f,
55
+ {
56
+ level: g,
57
+ "data-testid": "Header",
58
+ className: h ?? "",
59
+ style: { fontWeight: v },
60
+ children: l
61
+ }
62
+ ),
63
+ /* @__PURE__ */ i(u, { level: m, children: o })
64
+ ] })
65
+ ] }),
66
+ /* @__PURE__ */ i(
67
+ "div",
68
+ {
69
+ className: `${n.actionButtonContainer} ${p && n.invisible}`,
70
+ "data-testid": "RightPart",
71
+ children: e
72
+ }
73
+ )
74
+ ]
75
+ }
76
+ );
77
+ };
78
+ export {
79
+ q as BasicHeading
80
+ };
@@ -0,0 +1,35 @@
1
+ import { jsx as o, Fragment as c } from "react/jsx-runtime";
2
+ import { Button as g } from "@element/react-components";
3
+ import { BasicHeading as a } from "./BasicHeading.js";
4
+ import { d as h, t as i, r as s, s as n, g as e } from "../../vi.JYQecGiw-D8gb8QJV.js";
5
+ h("BasicHeading-Test", () => {
6
+ i("render small container without content", () => {
7
+ s(/* @__PURE__ */ o(a, { heading: "Test" }));
8
+ const t = n.getByTestId("HeaderContainer");
9
+ e(t).toBeDefined(), e(t).toHaveClass(/pageHeader/);
10
+ const r = n.getByTestId("Header");
11
+ e(r).toBeDefined(), e(r).toHaveTextContent("Test");
12
+ const d = n.getByTestId("RightPart");
13
+ e(d).toBeDefined();
14
+ }), i("render large container with children", () => {
15
+ s(
16
+ /* @__PURE__ */ o(a, { heading: "Test", marginBottom: "large", children: /* @__PURE__ */ o(g, { children: "Extracontent" }) })
17
+ );
18
+ const t = n.getByTestId("HeaderContainer");
19
+ e(t).toBeDefined();
20
+ const r = n.getByTestId("Header");
21
+ e(r).toBeDefined(), e(r).toHaveTextContent("Test");
22
+ const d = n.getByTestId("RightPart");
23
+ e(d).toBeDefined(), e(d).toContainHTML("<button");
24
+ }), i("render with available custom icon", () => {
25
+ s(/* @__PURE__ */ o(a, { heading: "Test", icon: "farm" }));
26
+ const t = n.getByTestId("farm");
27
+ e(t).toBeInTheDocument();
28
+ }), i("render with JSX element as icon", () => {
29
+ s(/* @__PURE__ */ o(a, { heading: "Test", icon: /* @__PURE__ */ o(c, { children: "JSX" }) })), e(n.getByText("JSX")).toBeInTheDocument();
30
+ }), i("render with other icon", () => {
31
+ s(/* @__PURE__ */ o(a, { heading: "Test", icon: "contact_support" }));
32
+ const t = document.querySelector("i");
33
+ e(t).toHaveTextContent("contact_support");
34
+ });
35
+ });
@@ -0,0 +1,59 @@
1
+ import { Block } from '../../types/internal/Block';
2
+ type BlockViewProps<T extends Block> = {
3
+ /**
4
+ * number of rows the will be rendered
5
+ */
6
+ rows: number;
7
+ /**
8
+ * number of columns the will be rendered
9
+ */
10
+ columns: number;
11
+ /**
12
+ * array of block numbers that should be marked as error
13
+ */
14
+ errorBlocks?: number[];
15
+ /**
16
+ * hide the text above and below the block view
17
+ */
18
+ hideText?: boolean;
19
+ /**
20
+ * show the block numbers inside the blocks
21
+ */
22
+ showNumbers?: boolean;
23
+ /**
24
+ * callback function when the user clicks on a block
25
+ */
26
+ onClick?: ((position: {
27
+ row: number;
28
+ column: number;
29
+ }, block: T | undefined) => void) | null;
30
+ /**
31
+ * the current block number
32
+ */
33
+ currentBlock?: T;
34
+ /**
35
+ * the blocks that should be rendered
36
+ */
37
+ blocks: T[];
38
+ /**
39
+ * determines if the block view is clickable
40
+ */
41
+ clickable?: boolean;
42
+ /**
43
+ * the size of the block in rem (default is 15x15)
44
+ */
45
+ size?: number;
46
+ /**
47
+ * the title of the block view, shown when `hideText` is false
48
+ */
49
+ blockViewTitle: string;
50
+ /**
51
+ * the label of the block, normally 'Block', shown when `hideText` is false
52
+ */
53
+ blockLabel: string;
54
+ };
55
+ /**
56
+ * A component that renders a grid of blocks
57
+ */
58
+ export declare const BlockView: <T extends Block>({ rows, columns, hideText, errorBlocks, showNumbers, clickable, size, onClick, currentBlock, blocks, blockViewTitle, blockLabel, }: BlockViewProps<T>) => import("react/jsx-runtime").JSX.Element;
59
+ export {};