@hortiview/shared-components 0.0.5431 → 0.0.5450

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.
@@ -12,10 +12,14 @@ type EmptyViewProps = {
12
12
  * The icon of the empty view, optional, default is 'dashbord'
13
13
  */
14
14
  icon?: string;
15
+ /**
16
+ * A text value which is shown in the empty view, optional, default is empty string
17
+ */
18
+ text?: string;
15
19
  /**
16
20
  * The action of the empty view, optional, default is empty
17
21
  */
18
22
  action?: ReactNode;
19
23
  };
20
- export declare const EmptyView: ({ title, subtitle, icon, action, }: EmptyViewProps) => import("react/jsx-runtime").JSX.Element;
24
+ export declare const EmptyView: ({ title, subtitle, icon, text, action, }: EmptyViewProps) => import("react/jsx-runtime").JSX.Element;
21
25
  export {};
@@ -1,20 +1,24 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import { Hero as n, HeroContent as h, Icon as l } from "@element/react-components";
3
- const d = ({
4
- title: e = "",
5
- subtitle: r = "",
6
- icon: t = "dashbord",
7
- action: i
8
- }) => /* @__PURE__ */ o(n, { style: { width: "100%", height: "25vh" }, children: /* @__PURE__ */ o(
9
- h,
1
+ import { jsx as e, jsxs as c } from "react/jsx-runtime";
2
+ import { Hero as h, HeroContent as d, Icon as s, TypoBody as n, Group as m } from "@element/react-components";
3
+ const f = ({
4
+ title: r = "",
5
+ subtitle: o = "",
6
+ icon: i = "dashbord",
7
+ text: t = "",
8
+ action: l
9
+ }) => /* @__PURE__ */ e(h, { style: { width: "100%", height: "25vh" }, themeColor: "surface", children: /* @__PURE__ */ e(
10
+ d,
10
11
  {
11
- logo: /* @__PURE__ */ o(l, { iconSize: "large", icon: t }),
12
+ logo: /* @__PURE__ */ e(s, { iconSize: "large", icon: i }),
12
13
  overline: "",
13
- subtitle: r,
14
- title: e,
15
- heroBtn: i
14
+ subtitle: o,
15
+ title: r,
16
+ heroBtn: /* @__PURE__ */ e(p, { action: l, text: t })
16
17
  }
17
- ) });
18
+ ) }), p = ({ action: r, text: o }) => o ? r ? /* @__PURE__ */ c(m, { direction: "vertical", primaryAlign: "center", secondaryAlign: "center", children: [
19
+ /* @__PURE__ */ e(n, { level: 2, children: o }),
20
+ r
21
+ ] }) : /* @__PURE__ */ e(n, { level: 2, children: o }) : r;
18
22
  export {
19
- d as EmptyView
23
+ f as EmptyView
20
24
  };
@@ -1,24 +1,54 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import { r as n, s, w as r, f as c } from "../../react.esm-C0LtovhP.js";
3
- import { EmptyView as i } from "./EmptyView.js";
4
- import { d as T, t as a, g as t, v as l } from "../../vi.JYQecGiw-BbUbJcT8.js";
5
- T("EmptyView", () => {
6
- a("should render", () => {
7
- n(/* @__PURE__ */ o(i, {})), t(s.getByText("dashbord")).toBeInTheDocument();
8
- }), a("should render with custom icon", () => {
9
- n(/* @__PURE__ */ o(i, { icon: "add" })), t(s.getByText("add")).toBeInTheDocument();
10
- }), a("should render with title", () => {
11
- n(/* @__PURE__ */ o(i, { icon: "add", title: "TITLE" }));
12
- const e = s.getByText("TITLE");
13
- t(e).toBeInTheDocument(), t(e).toHaveClass(/headline2/);
14
- }), a("should render with subtitle", () => {
15
- n(/* @__PURE__ */ o(i, { icon: "add", subtitle: "SUB_TITLE" }));
16
- const e = s.getByText("SUB_TITLE");
17
- t(e).toBeInTheDocument(), t(e).toHaveClass(/headline6/);
18
- }), a("should render with an action", async () => {
19
- const e = l.fn();
20
- n(/* @__PURE__ */ o(i, { icon: "add", action: /* @__PURE__ */ o("button", { onClick: e, children: "BUTTON" }) }));
21
- const d = s.getByText("BUTTON");
22
- t(d).toBeInTheDocument(), await r(() => c.click(d)), t(e).toHaveBeenCalledTimes(1);
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import { r as s, s as o, w as r, f as l } from "../../react.esm-C0LtovhP.js";
3
+ import { EmptyView as c } from "./EmptyView.js";
4
+ import { d as h, t as T, g as e, v as d } from "../../vi.JYQecGiw-BbUbJcT8.js";
5
+ h("EmptyView", () => {
6
+ T("should render", () => {
7
+ s(/* @__PURE__ */ n(c, {})), e(o.getByText("dashbord")).toBeInTheDocument();
8
+ }), T("should render with custom icon", () => {
9
+ s(/* @__PURE__ */ n(c, { icon: "add" })), e(o.getByText("add")).toBeInTheDocument();
10
+ }), T("should render with title", () => {
11
+ s(/* @__PURE__ */ n(c, { icon: "add", title: "TITLE" }));
12
+ const t = o.getByText("TITLE");
13
+ e(t).toBeInTheDocument(), e(t).toHaveClass(/headline2/);
14
+ }), T("should render with subtitle", () => {
15
+ s(/* @__PURE__ */ n(c, { icon: "add", subtitle: "SUB_TITLE" }));
16
+ const t = o.getByText("SUB_TITLE");
17
+ e(t).toBeInTheDocument(), e(t).toHaveClass(/headline6/);
18
+ }), T("should render with an action", async () => {
19
+ const t = d.fn();
20
+ s(/* @__PURE__ */ n(c, { icon: "add", action: /* @__PURE__ */ n("button", { onClick: t, children: "BUTTON" }) }));
21
+ const i = o.getByText("BUTTON");
22
+ e(i).toBeInTheDocument(), await r(() => l.click(i)), e(t).toHaveBeenCalledTimes(1);
23
+ }), T("should render with a text and a button", async () => {
24
+ const t = d.fn();
25
+ s(
26
+ /* @__PURE__ */ n(
27
+ c,
28
+ {
29
+ icon: "add",
30
+ action: /* @__PURE__ */ n("button", { onClick: t, children: "BUTTON" }),
31
+ text: "MY_TEXT"
32
+ }
33
+ )
34
+ );
35
+ const i = o.getByText("BUTTON");
36
+ e(i).toBeInTheDocument();
37
+ const a = o.getByText("MY_TEXT");
38
+ e(a).toBeInTheDocument();
39
+ }), T("should render with text only", async () => {
40
+ s(
41
+ /* @__PURE__ */ n(
42
+ c,
43
+ {
44
+ icon: "add",
45
+ text: "MY_TEXT"
46
+ }
47
+ )
48
+ );
49
+ const t = o.queryByText("BUTTON");
50
+ e(t).not.toBeInTheDocument();
51
+ const i = o.getByText("MY_TEXT");
52
+ e(i).toBeInTheDocument();
23
53
  });
24
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.5431",
4
+ "version": "0.0.5450",
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>",