@hortiview/shared-components 0.0.5024 → 0.0.5060

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/README.md CHANGED
@@ -27,6 +27,7 @@ Additionally the library provides form components using [react-hook-form](https:
27
27
 
28
28
  ## Available packages:
29
29
 
30
+ 1. [AlertBanner](#alertbanner)
30
31
  1. [BaseView](#baseview)
31
32
  1. [BasicHeading](#basicheading)
32
33
  1. [BlockView](#blockview)
@@ -50,6 +51,20 @@ Additionally the library provides form components using [react-hook-form](https:
50
51
  1. [SearchBar](#searchbar)
51
52
  1. [VerticalDivider](#verticaldivider)
52
53
 
54
+ ### AlertBanner
55
+
56
+ Presents an Banner containing important messages. Can used in different colors and you can add an optional action.
57
+
58
+ ```typescript
59
+ import { AlertBanner } from '@hortiview/shared-components';
60
+
61
+ <AlertBanner
62
+ text='My Alert'
63
+ color='danger' // | 'info' | 'success'
64
+ action={<MyButton />}
65
+ />;
66
+ ```
67
+
53
68
  ### BaseView
54
69
 
55
70
  Can used to show a kind off main and detail view. On the left side you will have a list of elements and on the right a detail section of the element selected.
@@ -437,6 +452,7 @@ const fields: FieldItem[] = [
437
452
  ```
438
453
 
439
454
  You can also render a multiline section, that receives an array if FieldItem-Arrays instead of a single FieldItem-Array
455
+
440
456
  ```typescript
441
457
  import { InfoGroup } from '@hortiview/shared-components';
442
458
 
@@ -453,7 +469,7 @@ const multiLineFields: FieldItem[][] = [
453
469
  { label: 'FieldTitle2', value: 'Value2' },
454
470
  { label: 'FieldTitle3', value: 'Value3' },
455
471
  { label: 'FieldTitle4', value: 'Value4' },
456
- ]
472
+ ]
457
473
  ]
458
474
 
459
475
  <InfoGroup fields={multiLineFields} />
@@ -0,0 +1,74 @@
1
+ import "./assets/ListAreaService.css";
2
+ import { jsx as l } from "react/jsx-runtime";
3
+ import { TypoButton as C, TypoSubtitle as L, TypoBody as x, Icon as N } from "@element/react-components";
4
+ import { Iconify as E } from "./components/Iconify/Iconify.js";
5
+ import { AvailableCustomIcons as $ } from "./enums/AvailableCustomIcons.js";
6
+ const W = "_fullWidth_1y0ty_1", j = "_mainElevation_1y0ty_5", S = "_searchbar_1y0ty_11", w = "_roundedBottom_1y0ty_19", A = "_list_1y0ty_24", G = "_listItem_1y0ty_52", O = "_trailingIcon_1y0ty_56", P = "_groupedListItem_1y0ty_68", _ = {
7
+ fullWidth: W,
8
+ mainElevation: j,
9
+ searchbar: S,
10
+ roundedBottom: w,
11
+ list: A,
12
+ listItem: G,
13
+ trailingIcon: O,
14
+ groupedListItem: P
15
+ }, M = (t, i, n, r) => {
16
+ const s = t.reduce((o, m) => {
17
+ const { groupName: e, ...a } = m;
18
+ return !e || typeof e != "string" || (o[e] || (o[e] = {
19
+ groupName: /* @__PURE__ */ l(C, { children: e }),
20
+ id: e,
21
+ items: []
22
+ }), o[e].items = [
23
+ ...o[e].items,
24
+ g(a, i, n, !0, r)
25
+ ]), o;
26
+ }, {});
27
+ return Object.values(s);
28
+ }, Q = (t, i, n, r) => t.map((s) => g(s, i, n, !1, r)), g = (t, i, n, r, s) => {
29
+ const {
30
+ id: o,
31
+ title: m,
32
+ subTitle: e,
33
+ route: a,
34
+ value: I,
35
+ noNavigation: y,
36
+ disabled: d,
37
+ icon: v,
38
+ iconType: p,
39
+ trailingIcon: f,
40
+ trailingIconType: T,
41
+ actionButton: h,
42
+ onClick: B,
43
+ customTitle: u,
44
+ listItemClassName: b
45
+ } = t, c = i === a;
46
+ return {
47
+ id: o,
48
+ key: o,
49
+ select: c,
50
+ primaryText: u ?? /* @__PURE__ */ l(L, { level: 1, bold: c, themeColor: c ? "primary" : void 0, children: m }),
51
+ secondaryText: e && !u ? /* @__PURE__ */ l(x, { level: 2, themeColor: c ? "primary" : void 0, children: e }) : void 0,
52
+ overlineText: t.overlineTitle,
53
+ trailingBlock: h ?? f ?? /* @__PURE__ */ l(N, { icon: "arrow_right" }),
54
+ leadingBlock: q(v),
55
+ value: I,
56
+ componentProps: {
57
+ id: o,
58
+ key: o,
59
+ leadingBlockType: p ?? "icon",
60
+ trailingBlockType: T ?? "icon",
61
+ className: `${p === "avatar" ? "" : _.listItem} ${n} ${r ? _.groupedListItem : ""} ${b ?? ""}`,
62
+ onClick: (z, k) => B?.(k),
63
+ tag: d || y ? void 0 : s ?? "a",
64
+ to: d || y ? void 0 : a,
65
+ disabled: d
66
+ }
67
+ };
68
+ }, q = (t) => typeof t == "string" && t in $ ? /* @__PURE__ */ l(E, { icon: t }) : t;
69
+ export {
70
+ Q as a,
71
+ M as g,
72
+ g as m,
73
+ _ as s
74
+ };
@@ -0,0 +1 @@
1
+ ._messageContainer_1kpsp_1{border-radius:.25rem;padding:.5rem 1rem;width:-moz-available;width:-webkit-fill-available;width:stretch}._info_1kpsp_9{border:1px solid var(--lmnt-theme-on-secondary-stroke);background:var(--lmnt-theme-secondary-50)}._danger_1kpsp_14{border:1px solid var(--lmnt-theme-on-danger-stroke);background:var(--lmnt-theme-danger-50)}._success_1kpsp_19{border:1px solid var(--lmnt-theme-on-success-stroke);background:var(--lmnt-theme-success-50)}
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ type AlertBannerProps = {
3
+ text: string | JSX.Element;
4
+ color?: 'danger' | 'info' | 'success';
5
+ isOpen?: boolean;
6
+ action?: JSX.Element;
7
+ };
8
+ export declare const AlertBanner: ({ text, color, isOpen, action }: AlertBannerProps) => import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -0,0 +1,19 @@
1
+ import "../../assets/AlertBanner.css";
2
+ import { jsx as e, Fragment as a, jsxs as c } from "react/jsx-runtime";
3
+ import { Group as p, TypoBody as l } from "@element/react-components";
4
+ import { a as m } from "../../useBreakpoint-DROHPVxO.js";
5
+ const d = "_messageContainer_1kpsp_1", g = "_info_1kpsp_9", _ = "_danger_1kpsp_14", f = "_success_1kpsp_19", n = {
6
+ messageContainer: d,
7
+ info: g,
8
+ danger: _,
9
+ success: f
10
+ }, v = ({ text: s, color: r = "info", isOpen: o = !0, action: i }) => {
11
+ const { isLg: t } = m();
12
+ return o ? /* @__PURE__ */ e("div", { className: `${n.messageContainer} ${n[r]}`, children: /* @__PURE__ */ c(p, { direction: t ? "horizontal" : "vertical", primaryAlign: "space-between", secondaryAlign: "center", children: [
13
+ typeof s == "string" ? /* @__PURE__ */ e(l, { bold: !0, level: 2, children: s }) : /* @__PURE__ */ e("div", { children: s }),
14
+ i
15
+ ] }) }) : /* @__PURE__ */ e(a, {});
16
+ };
17
+ export {
18
+ v as AlertBanner
19
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,36 @@
1
+ import { jsx as e, Fragment as m } from "react/jsx-runtime";
2
+ import { r as t, s } from "../../react.esm-C0LtovhP.js";
3
+ import { u as i } from "../../useBreakpoint-DROHPVxO.js";
4
+ import { AlertBanner as n } from "./AlertBanner.js";
5
+ import { d as c, b as u, t as r, g as l, v as a } from "../../vi.JYQecGiw-BbUbJcT8.js";
6
+ c("AlertBanner Test", () => {
7
+ u(() => {
8
+ a.spyOn(i, "useBreakpoints").mockReturnValue({
9
+ isXs: !1,
10
+ isSm: !1,
11
+ isMd: !1,
12
+ isLg: !0,
13
+ isXlg: !0,
14
+ active: "lg"
15
+ });
16
+ }), r("render AlertBanner with text", () => {
17
+ t(/* @__PURE__ */ e(n, { text: "Test" })), l(s.getByText("Test")).toBeInTheDocument();
18
+ }), r("render AlertBanner with element", () => {
19
+ t(/* @__PURE__ */ e(n, { text: /* @__PURE__ */ e(m, { children: "Element" }) })), l(s.getByText("Element")).toBeInTheDocument();
20
+ }), r("renders AlertBanner with vertical style (flex-direction: column) when screen is small", () => {
21
+ a.spyOn(i, "useBreakpoints").mockReturnValue({
22
+ isXs: !1,
23
+ isSm: !0,
24
+ isMd: !1,
25
+ isLg: !1,
26
+ isXlg: !1,
27
+ active: "sm"
28
+ }), t(/* @__PURE__ */ e(n, { text: "Test" }));
29
+ const o = s.getByText("Test").closest(".lmnt.lmnt-group");
30
+ l(o).toHaveStyle(
31
+ "display: flex; flex-direction: column; justify-content: space-between; align-items: center; gap: 16px;"
32
+ );
33
+ }), r("renders nothing when isOpen is false", () => {
34
+ t(/* @__PURE__ */ e(n, { text: "Test", isOpen: !1 })), l(s.queryByText("Test")).not.toBeInTheDocument();
35
+ });
36
+ });
@@ -4,7 +4,7 @@ import { g as Hr } from "../../_commonjsHelpers-CT_km90n.js";
4
4
  import { _ as H, a as Tr, b as wr, c as T, d as Nr, e as Wr, i as h, f as N, h as B, j as Xr, k as zr, l as I, m as Yr, n as Zr, o as Jr, p as W, q as Qr, r as Or, s as Pr, t as kr, u as Vr } from "../../get-Dyz8NMrE.js";
5
5
  import { useState as re, useMemo as k } from "react";
6
6
  import { SearchBar as ee } from "../SearchBar/SearchBar.js";
7
- import { g as ae, a as te, s as m } from "../../ListAreaService-jz92va76.js";
7
+ import { g as ae, a as te, s as m } from "../../ListAreaService-DhlEJxAH.js";
8
8
  var ne = H;
9
9
  function se() {
10
10
  this.__data__ = new ne(), this.size = 0;
@@ -2,7 +2,7 @@ import { jsx as r, Fragment as i } from "react/jsx-runtime";
2
2
  import { TypoButton as p } from "@element/react-components";
3
3
  import { r as s, s as a, f as u } from "../../react.esm-C0LtovhP.js";
4
4
  import { ListArea as c } from "./ListArea.js";
5
- import { g as h } from "../../ListAreaService-jz92va76.js";
5
+ import { g as h } from "../../ListAreaService-DhlEJxAH.js";
6
6
  import { d as m, t as n, g as t } from "../../vi.JYQecGiw-BbUbJcT8.js";
7
7
  m("ListArea Test", () => {
8
8
  const o = [
@@ -21,16 +21,20 @@ export declare const getGroupedItems: (items: ListElement[], pathname: string, i
21
21
  * @returns an array of objects with List component schema
22
22
  */
23
23
  export declare const getListedItems: (items: ListElement[], pathname: string, itemClassName: string, routerLinkElement: undefined | React.ForwardRefExoticComponent<LinkProps & React.RefAttributes<HTMLAnchorElement>>) => {
24
+ id: string;
25
+ key: string;
24
26
  select: boolean;
25
- primaryText: import("react/jsx-runtime").JSX.Element;
27
+ primaryText: JSX.Element;
26
28
  secondaryText: import("react/jsx-runtime").JSX.Element | undefined;
27
29
  overlineText: string | undefined;
28
- trailingBlock: string | number | boolean | import("react/jsx-runtime").JSX.Element | Iterable<import("react").ReactNode>;
29
- leadingBlock: string | import("react/jsx-runtime").JSX.Element | undefined;
30
+ trailingBlock: string | number | boolean | JSX.Element | Iterable<import("react").ReactNode>;
31
+ leadingBlock: string | JSX.Element | undefined;
30
32
  value: string | undefined;
31
33
  componentProps: {
32
- leadingBlockType: "icon" | "checkbox" | "radio" | "switch" | "avatar" | "badge" | "image" | "lgImage" | "meta" | "thumbnail";
33
- trailingBlockType: "icon" | "checkbox" | "radio" | "switch" | "avatar" | "badge" | "image" | "lgImage" | "meta" | "thumbnail";
34
+ id: string;
35
+ key: string;
36
+ leadingBlockType: "icon" | "badge" | "image" | "meta" | "checkbox" | "radio" | "switch" | "avatar" | "lgImage" | "thumbnail";
37
+ trailingBlockType: "icon" | "badge" | "image" | "meta" | "checkbox" | "radio" | "switch" | "avatar" | "lgImage" | "thumbnail";
34
38
  className: string;
35
39
  onClick: (_: ChangeEvent, value: string) => void | undefined;
36
40
  tag: string | import("react").ForwardRefExoticComponent<LinkProps & import("react").RefAttributes<HTMLAnchorElement>> | undefined;
@@ -47,16 +51,20 @@ export declare const getListedItems: (items: ListElement[], pathname: string, it
47
51
  * @returns an object with List component schema
48
52
  */
49
53
  export declare const mapListElement: (element: ListElement, pathname: string | undefined, itemClassName: string | undefined, isGrouped: boolean, routerLinkElement: undefined | React.ForwardRefExoticComponent<LinkProps & React.RefAttributes<HTMLAnchorElement>>) => {
54
+ id: string;
55
+ key: string;
50
56
  select: boolean;
51
- primaryText: import("react/jsx-runtime").JSX.Element;
57
+ primaryText: JSX.Element;
52
58
  secondaryText: import("react/jsx-runtime").JSX.Element | undefined;
53
59
  overlineText: string | undefined;
54
- trailingBlock: string | number | boolean | import("react/jsx-runtime").JSX.Element | Iterable<import("react").ReactNode>;
55
- leadingBlock: string | import("react/jsx-runtime").JSX.Element | undefined;
60
+ trailingBlock: string | number | boolean | JSX.Element | Iterable<import("react").ReactNode>;
61
+ leadingBlock: string | JSX.Element | undefined;
56
62
  value: string | undefined;
57
63
  componentProps: {
58
- leadingBlockType: "icon" | "checkbox" | "radio" | "switch" | "avatar" | "badge" | "image" | "lgImage" | "meta" | "thumbnail";
59
- trailingBlockType: "icon" | "checkbox" | "radio" | "switch" | "avatar" | "badge" | "image" | "lgImage" | "meta" | "thumbnail";
64
+ id: string;
65
+ key: string;
66
+ leadingBlockType: "icon" | "badge" | "image" | "meta" | "checkbox" | "radio" | "switch" | "avatar" | "lgImage" | "thumbnail";
67
+ trailingBlockType: "icon" | "badge" | "image" | "meta" | "checkbox" | "radio" | "switch" | "avatar" | "lgImage" | "thumbnail";
60
68
  className: string;
61
69
  onClick: (_: ChangeEvent, value: string) => void | undefined;
62
70
  tag: string | import("react").ForwardRefExoticComponent<LinkProps & import("react").RefAttributes<HTMLAnchorElement>> | undefined;
@@ -2,7 +2,7 @@ import "react/jsx-runtime";
2
2
  import "@element/react-components";
3
3
  import "../Iconify/Iconify.js";
4
4
  import "../../enums/AvailableCustomIcons.js";
5
- import { g as s, a as i, m as a } from "../../ListAreaService-jz92va76.js";
5
+ import { g as s, a as i, m as a } from "../../ListAreaService-DhlEJxAH.js";
6
6
  export {
7
7
  s as getGroupedItems,
8
8
  i as getListedItems,
package/dist/main.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import './styles/main.css';
2
+ export { AlertBanner } from './components/AlertBanner/AlertBanner';
2
3
  export { BaseView } from './components/BaseView/BaseView';
3
4
  export { BasicHeading } from './components/BasicHeading/BasicHeading';
4
5
  export { BlockView } from './components/BlockView/BlockView';
package/dist/main.js CHANGED
@@ -1,52 +1,54 @@
1
1
  import "./assets/main.css";
2
- import { BaseView as t } from "./components/BaseView/BaseView.js";
3
- import { BasicHeading as p } from "./components/BasicHeading/BasicHeading.js";
4
- import { BlockView as f } from "./components/BlockView/BlockView.js";
5
- import { ContextMenu as i } from "./components/ContextMenu/ContextMenu.js";
6
- import { DeleteModal as c } from "./components/DeleteModal/DeleteModal.js";
7
- import { Disclaimer as F } from "./components/Disclaimer/Disclaimer.js";
8
- import { EmptyView as d } from "./components/EmptyView/EmptyView.js";
9
- import { HashTabView as S } from "./components/HashTabView/HashTabView.js";
10
- import { HeaderFilter as b } from "./components/HeaderFilter/HeaderFilter.js";
11
- import { Iconify as u } from "./components/Iconify/Iconify.js";
12
- import { InfoGroup as D } from "./components/InfoGroup/InfoGroup.js";
13
- import { ListArea as C } from "./components/ListArea/ListArea.js";
14
- import { ScrollbarX as I, ScrollbarY as v } from "./components/Scrollbar/Scrollbar.js";
15
- import { SearchBar as A } from "./components/SearchBar/SearchBar.js";
16
- import { VerticalDivider as M } from "./components/VerticalDivider/VerticalDivider.js";
17
- import { FormCheckBox as g } from "./components/FormComponents/FormCheckBox/FormCheckBox.js";
18
- import { FormDatePicker as E } from "./components/FormComponents/FormDatePicker/FormDatePicker.js";
19
- import { FormRadio as P } from "./components/FormComponents/FormRadio/FormRadio.js";
20
- import { FormSelect as X } from "./components/FormComponents/FormSelect/FormSelect.js";
21
- import { FormSlider as j } from "./components/FormComponents/FormSlider/FormSlider.js";
22
- import { FormText as J } from "./components/FormComponents/FormText/FormText.js";
23
- import { AvailableCustomIcons as N } from "./enums/AvailableCustomIcons.js";
24
- import { a as Q } from "./useBreakpoint-DROHPVxO.js";
25
- import { capitalizeFirstLetters as W } from "./services/UtilService.js";
2
+ import { AlertBanner as t } from "./components/AlertBanner/AlertBanner.js";
3
+ import { BaseView as p } from "./components/BaseView/BaseView.js";
4
+ import { BasicHeading as f } from "./components/BasicHeading/BasicHeading.js";
5
+ import { BlockView as i } from "./components/BlockView/BlockView.js";
6
+ import { ContextMenu as c } from "./components/ContextMenu/ContextMenu.js";
7
+ import { DeleteModal as n } from "./components/DeleteModal/DeleteModal.js";
8
+ import { Disclaimer as B } from "./components/Disclaimer/Disclaimer.js";
9
+ import { EmptyView as S } from "./components/EmptyView/EmptyView.js";
10
+ import { HashTabView as b } from "./components/HashTabView/HashTabView.js";
11
+ import { HeaderFilter as u } from "./components/HeaderFilter/HeaderFilter.js";
12
+ import { Iconify as D } from "./components/Iconify/Iconify.js";
13
+ import { InfoGroup as A } from "./components/InfoGroup/InfoGroup.js";
14
+ import { ListArea as H } from "./components/ListArea/ListArea.js";
15
+ import { ScrollbarX as v, ScrollbarY as y } from "./components/Scrollbar/Scrollbar.js";
16
+ import { SearchBar as M } from "./components/SearchBar/SearchBar.js";
17
+ import { VerticalDivider as g } from "./components/VerticalDivider/VerticalDivider.js";
18
+ import { FormCheckBox as E } from "./components/FormComponents/FormCheckBox/FormCheckBox.js";
19
+ import { FormDatePicker as P } from "./components/FormComponents/FormDatePicker/FormDatePicker.js";
20
+ import { FormRadio as X } from "./components/FormComponents/FormRadio/FormRadio.js";
21
+ import { FormSelect as j } from "./components/FormComponents/FormSelect/FormSelect.js";
22
+ import { FormSlider as J } from "./components/FormComponents/FormSlider/FormSlider.js";
23
+ import { FormText as N } from "./components/FormComponents/FormText/FormText.js";
24
+ import { AvailableCustomIcons as Q } from "./enums/AvailableCustomIcons.js";
25
+ import { a as W } from "./useBreakpoint-DROHPVxO.js";
26
+ import { capitalizeFirstLetters as _ } from "./services/UtilService.js";
26
27
  export {
27
- N as AvailableCustomIcons,
28
- t as BaseView,
29
- p as BasicHeading,
30
- f as BlockView,
31
- i as ContextMenu,
32
- c as DeleteModal,
33
- F as Disclaimer,
34
- d as EmptyView,
35
- g as FormCheckBox,
36
- E as FormDatePicker,
37
- P as FormRadio,
38
- X as FormSelect,
39
- j as FormSlider,
40
- J as FormText,
41
- S as HashTabView,
42
- b as HeaderFilter,
43
- u as Iconify,
44
- D as InfoGroup,
45
- C as ListArea,
46
- I as ScrollbarX,
47
- v as ScrollbarY,
48
- A as SearchBar,
49
- M as VerticalDivider,
50
- W as capitalizeFirstLetters,
51
- Q as useBreakpoints
28
+ t as AlertBanner,
29
+ Q as AvailableCustomIcons,
30
+ p as BaseView,
31
+ f as BasicHeading,
32
+ i as BlockView,
33
+ c as ContextMenu,
34
+ n as DeleteModal,
35
+ B as Disclaimer,
36
+ S as EmptyView,
37
+ E as FormCheckBox,
38
+ P as FormDatePicker,
39
+ X as FormRadio,
40
+ j as FormSelect,
41
+ J as FormSlider,
42
+ N as FormText,
43
+ b as HashTabView,
44
+ u as HeaderFilter,
45
+ D as Iconify,
46
+ A as InfoGroup,
47
+ H as ListArea,
48
+ v as ScrollbarX,
49
+ y as ScrollbarY,
50
+ M as SearchBar,
51
+ g as VerticalDivider,
52
+ _ as capitalizeFirstLetters,
53
+ W as useBreakpoints
52
54
  };
@@ -96,4 +96,8 @@ export type ListElement = Omit<BaseListElement, 'component'> & {
96
96
  * will be rendered instead of title and subtitle
97
97
  */
98
98
  customTitle?: JSX.Element;
99
+ /**
100
+ * a custom class name for the list item
101
+ */
102
+ listItemClassName?: string;
99
103
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hortiview/shared-components",
3
3
  "description": "This is a shared component library. It should used in the HortiView platform and its modules.",
4
- "version": "0.0.5024",
4
+ "version": "0.0.5060",
5
5
  "type": "module",
6
6
  "repository": "https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared",
7
7
  "author": "Falk Menge <falk.menge.ext@bayer.com>",
@@ -1,68 +0,0 @@
1
- import "./assets/ListAreaService.css";
2
- import { jsx as l } from "react/jsx-runtime";
3
- import { TypoButton as b, TypoSubtitle as k, TypoBody as L, Icon as x } from "@element/react-components";
4
- import { Iconify as C } from "./components/Iconify/Iconify.js";
5
- import { AvailableCustomIcons as E } from "./enums/AvailableCustomIcons.js";
6
- const N = "_fullWidth_1y0ty_1", W = "_mainElevation_1y0ty_5", $ = "_searchbar_1y0ty_11", j = "_roundedBottom_1y0ty_19", S = "_list_1y0ty_24", w = "_listItem_1y0ty_52", A = "_trailingIcon_1y0ty_56", G = "_groupedListItem_1y0ty_68", _ = {
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 = (t, i, n, r) => {
16
- const s = t.reduce((e, a) => {
17
- const { groupName: o, ...m } = a;
18
- return !o || typeof o != "string" || (e[o] || (e[o] = {
19
- groupName: /* @__PURE__ */ l(b, { children: o }),
20
- id: o,
21
- items: []
22
- }), e[o].items = [
23
- ...e[o].items,
24
- g(m, i, n, !0, r)
25
- ]), e;
26
- }, {});
27
- return Object.values(s);
28
- }, K = (t, i, n, r) => t.map((s) => g(s, i, n, !1, r)), g = (t, i, n, r, s) => {
29
- const {
30
- title: e,
31
- subTitle: a,
32
- route: o,
33
- value: m,
34
- noNavigation: y,
35
- disabled: d,
36
- icon: I,
37
- iconType: p,
38
- trailingIcon: v,
39
- trailingIconType: f,
40
- actionButton: T,
41
- onClick: h,
42
- customTitle: u
43
- } = t, c = i === o;
44
- return {
45
- select: c,
46
- primaryText: u ?? /* @__PURE__ */ l(k, { level: 1, bold: c, themeColor: c ? "primary" : void 0, children: e }),
47
- secondaryText: a && !u ? /* @__PURE__ */ l(L, { level: 2, themeColor: c ? "primary" : void 0, children: a }) : void 0,
48
- overlineText: t.overlineTitle,
49
- trailingBlock: T ?? v ?? /* @__PURE__ */ l(x, { icon: "arrow_right" }),
50
- leadingBlock: O(I),
51
- value: m,
52
- componentProps: {
53
- leadingBlockType: p ?? "icon",
54
- trailingBlockType: f ?? "icon",
55
- className: `${p === "avatar" ? "" : _.listItem} ${n} ${r ? _.groupedListItem : ""}`,
56
- onClick: (P, B) => h?.(B),
57
- tag: d || y ? void 0 : s ?? "a",
58
- to: d || y ? void 0 : o,
59
- disabled: d
60
- }
61
- };
62
- }, O = (t) => typeof t == "string" && t in E ? /* @__PURE__ */ l(C, { icon: t }) : t;
63
- export {
64
- K as a,
65
- J as g,
66
- g as m,
67
- _ as s
68
- };