@hortiview/shared-components 0.0.5024 → 0.0.5053
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 +17 -1
- package/dist/assets/AlertBanner.css +1 -0
- package/dist/components/AlertBanner/AlertBanner.d.ts +9 -0
- package/dist/components/AlertBanner/AlertBanner.js +20 -0
- package/dist/components/AlertBanner/AlertBanner.test.d.ts +1 -0
- package/dist/components/AlertBanner/AlertBanner.test.js +36 -0
- package/dist/components/ListArea/ListAreaService.d.ts +10 -10
- package/dist/main.d.ts +1 -0
- package/dist/main.js +51 -49
- package/package.json +1 -1
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 @@
|
|
|
1
|
+
._messageContainer_92aoe_1{border-radius:.25rem;padding:.5rem 1rem;width:-moz-available;width:-webkit-fill-available;width:stretch}._message_92aoe_1{color:var(--lmnt-theme-on-surface-active);font-weight:700}._info_92aoe_13{border:1px solid var(--lmnt-theme-on-secondary-stroke);background:var(--lmnt-theme-secondary-50)}._danger_92aoe_18{border:1px solid var(--lmnt-theme-on-danger-stroke);background:var(--lmnt-theme-danger-50)}._success_92aoe_23{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,20 @@
|
|
|
1
|
+
import "../../assets/AlertBanner.css";
|
|
2
|
+
import { jsx as e, Fragment as t, jsxs as c } from "react/jsx-runtime";
|
|
3
|
+
import { Group as m, TypoBody as g } from "@element/react-components";
|
|
4
|
+
import { a as _ } from "../../useBreakpoint-DROHPVxO.js";
|
|
5
|
+
const l = "_messageContainer_92aoe_1", d = "_message_92aoe_1", p = "_info_92aoe_13", f = "_danger_92aoe_18", u = "_success_92aoe_23", n = {
|
|
6
|
+
messageContainer: l,
|
|
7
|
+
message: d,
|
|
8
|
+
info: p,
|
|
9
|
+
danger: f,
|
|
10
|
+
success: u
|
|
11
|
+
}, A = ({ text: s, color: o = "info", isOpen: r = !0, action: a }) => {
|
|
12
|
+
const { isLg: i } = _();
|
|
13
|
+
return r ? /* @__PURE__ */ e("div", { className: `${n.messageContainer} ${n[o]}`, children: /* @__PURE__ */ c(m, { direction: i ? "horizontal" : "vertical", primaryAlign: "space-between", secondaryAlign: "center", children: [
|
|
14
|
+
typeof s == "string" ? /* @__PURE__ */ e(g, { bold: !0, level: 2, children: s }) : /* @__PURE__ */ e("div", { children: s }),
|
|
15
|
+
a
|
|
16
|
+
] }) }) : /* @__PURE__ */ e(t, {});
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
A as AlertBanner
|
|
20
|
+
};
|
|
@@ -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
|
+
});
|
|
@@ -22,15 +22,15 @@ export declare const getGroupedItems: (items: ListElement[], pathname: string, i
|
|
|
22
22
|
*/
|
|
23
23
|
export declare const getListedItems: (items: ListElement[], pathname: string, itemClassName: string, routerLinkElement: undefined | React.ForwardRefExoticComponent<LinkProps & React.RefAttributes<HTMLAnchorElement>>) => {
|
|
24
24
|
select: boolean;
|
|
25
|
-
primaryText:
|
|
25
|
+
primaryText: JSX.Element;
|
|
26
26
|
secondaryText: import("react/jsx-runtime").JSX.Element | undefined;
|
|
27
27
|
overlineText: string | undefined;
|
|
28
|
-
trailingBlock: string | number | boolean |
|
|
29
|
-
leadingBlock: string |
|
|
28
|
+
trailingBlock: string | number | boolean | JSX.Element | Iterable<import("react").ReactNode>;
|
|
29
|
+
leadingBlock: string | JSX.Element | undefined;
|
|
30
30
|
value: string | undefined;
|
|
31
31
|
componentProps: {
|
|
32
|
-
leadingBlockType: "icon" | "
|
|
33
|
-
trailingBlockType: "icon" | "
|
|
32
|
+
leadingBlockType: "icon" | "badge" | "image" | "meta" | "checkbox" | "radio" | "switch" | "avatar" | "lgImage" | "thumbnail";
|
|
33
|
+
trailingBlockType: "icon" | "badge" | "image" | "meta" | "checkbox" | "radio" | "switch" | "avatar" | "lgImage" | "thumbnail";
|
|
34
34
|
className: string;
|
|
35
35
|
onClick: (_: ChangeEvent, value: string) => void | undefined;
|
|
36
36
|
tag: string | import("react").ForwardRefExoticComponent<LinkProps & import("react").RefAttributes<HTMLAnchorElement>> | undefined;
|
|
@@ -48,15 +48,15 @@ export declare const getListedItems: (items: ListElement[], pathname: string, it
|
|
|
48
48
|
*/
|
|
49
49
|
export declare const mapListElement: (element: ListElement, pathname: string | undefined, itemClassName: string | undefined, isGrouped: boolean, routerLinkElement: undefined | React.ForwardRefExoticComponent<LinkProps & React.RefAttributes<HTMLAnchorElement>>) => {
|
|
50
50
|
select: boolean;
|
|
51
|
-
primaryText:
|
|
51
|
+
primaryText: JSX.Element;
|
|
52
52
|
secondaryText: import("react/jsx-runtime").JSX.Element | undefined;
|
|
53
53
|
overlineText: string | undefined;
|
|
54
|
-
trailingBlock: string | number | boolean |
|
|
55
|
-
leadingBlock: string |
|
|
54
|
+
trailingBlock: string | number | boolean | JSX.Element | Iterable<import("react").ReactNode>;
|
|
55
|
+
leadingBlock: string | JSX.Element | undefined;
|
|
56
56
|
value: string | undefined;
|
|
57
57
|
componentProps: {
|
|
58
|
-
leadingBlockType: "icon" | "
|
|
59
|
-
trailingBlockType: "icon" | "
|
|
58
|
+
leadingBlockType: "icon" | "badge" | "image" | "meta" | "checkbox" | "radio" | "switch" | "avatar" | "lgImage" | "thumbnail";
|
|
59
|
+
trailingBlockType: "icon" | "badge" | "image" | "meta" | "checkbox" | "radio" | "switch" | "avatar" | "lgImage" | "thumbnail";
|
|
60
60
|
className: string;
|
|
61
61
|
onClick: (_: ChangeEvent, value: string) => void | undefined;
|
|
62
62
|
tag: string | import("react").ForwardRefExoticComponent<LinkProps & import("react").RefAttributes<HTMLAnchorElement>> | undefined;
|
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 {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
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
|
-
|
|
28
|
-
|
|
29
|
-
p as
|
|
30
|
-
f as
|
|
31
|
-
i as
|
|
32
|
-
c as
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
E as
|
|
37
|
-
P as
|
|
38
|
-
X as
|
|
39
|
-
j as
|
|
40
|
-
J as
|
|
41
|
-
|
|
42
|
-
b as
|
|
43
|
-
u as
|
|
44
|
-
D as
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
v as
|
|
48
|
-
|
|
49
|
-
M as
|
|
50
|
-
|
|
51
|
-
|
|
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
|
};
|
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.
|
|
4
|
+
"version": "0.0.5053",
|
|
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>",
|