@hortiview/shared-components 0.0.4539 → 0.0.4624

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 (82) hide show
  1. package/README.md +101 -29
  2. package/dist/BlockView.module-8kbPxxc4.js +15 -0
  3. package/dist/HashTabView.module-BY0tbl3B.js +13 -0
  4. package/dist/HeaderFilter.module-DiBmulr5.js +7 -0
  5. package/dist/_getTag-DNUtgXkb.js +136 -0
  6. package/dist/_stringToPath-BfzwTbL6.js +54 -0
  7. package/dist/assets/{main.css → DeleteModal.css} +2 -2
  8. package/dist/assets/HeaderFilter.css +1 -0
  9. package/dist/assets/Scrollbar.css +1 -0
  10. package/dist/assets/disclaimer.css +1 -0
  11. package/dist/baseView.module-DXWalo9p.js +7 -0
  12. package/dist/basicHeading.module-ClcvD7x2.js +16 -0
  13. package/dist/{component-D1YrRAXe.js → component-Rx4bNsGO.js} +61 -54
  14. package/dist/components/BaseView/BaseView.d.ts +5 -1
  15. package/dist/components/BaseView/BaseView.js +75 -75
  16. package/dist/components/BaseView/BaseView.test.js +15 -14
  17. package/dist/components/BasicHeading/BasicHeading.d.ts +2 -5
  18. package/dist/components/BasicHeading/BasicHeading.js +38 -49
  19. package/dist/components/BasicHeading/BasicHeading.test.js +33 -333
  20. package/dist/components/BlockView/BlockView.js +41 -51
  21. package/dist/components/BlockView/BlockView.test.js +15 -14
  22. package/dist/components/DeleteModal/DeleteModal.d.ts +65 -0
  23. package/dist/components/DeleteModal/DeleteModal.js +4719 -0
  24. package/dist/components/DeleteModal/DeleteModal.test.d.ts +1 -0
  25. package/dist/components/DeleteModal/DeleteModal.test.js +85 -0
  26. package/dist/components/Disclaimer/Disclaimer.d.ts +33 -0
  27. package/dist/components/Disclaimer/Disclaimer.js +21 -0
  28. package/dist/components/Disclaimer/Disclaimer.test.d.ts +1 -0
  29. package/dist/components/Disclaimer/Disclaimer.test.js +13 -0
  30. package/dist/components/EmptyView/EmptyView.js +4 -4
  31. package/dist/components/EmptyView/EmptyView.test.js +14 -13
  32. package/dist/components/HashTabView/HashTabView.js +60 -68
  33. package/dist/components/HashTabView/HashTabView.test.js +9 -8
  34. package/dist/components/HeaderFilter/HeaderFilter.d.ts +33 -0
  35. package/dist/components/HeaderFilter/HeaderFilter.js +7605 -0
  36. package/dist/components/HeaderFilter/HeaderFilter.test.d.ts +1 -0
  37. package/dist/components/HeaderFilter/HeaderFilter.test.js +46 -0
  38. package/dist/components/Iconify/Iconify.js +1 -1
  39. package/dist/components/Iconify/Iconify.test.js +8 -7
  40. package/dist/components/ListArea/ListArea.js +247 -5344
  41. package/dist/components/ListArea/ListArea.test.js +4 -3
  42. package/dist/components/ListArea/ListAreaService.js +56 -9
  43. package/dist/components/Scrollbar/Scrollbar.d.ts +2 -0
  44. package/dist/components/Scrollbar/Scrollbar.js +9 -0
  45. package/dist/components/Scrollbar/scrollbar.test.d.ts +1 -0
  46. package/dist/components/Scrollbar/scrollbar.test.js +15 -0
  47. package/dist/components/SearchBar/SearchBar.js +2051 -3
  48. package/dist/components/SearchBar/SearchBar.test.js +16 -15
  49. package/dist/components/VerticalDivider/VerticalDivider.js +4 -6
  50. package/dist/components/VerticalDivider/VerticalDivider.test.js +8 -7
  51. package/dist/disclaimer.module-BZydt-Q_.js +8 -0
  52. package/dist/index.es-Ba9oZK_n.js +769 -0
  53. package/dist/{index.es-CUWXKh7P.js → index.es-C1ojb4Lq.js} +8 -8
  54. package/dist/{index.es-DYsXox--.js → index.es-CNBieliG.js} +1 -1
  55. package/dist/index.es-CQ3ep412.js +305 -0
  56. package/dist/{index.es-mBp_Btvi.js → index.es-CVCp4d0C.js} +2 -2
  57. package/dist/{index.es-WZ1mqvGz.js → index.es-Cct4Uapb.js} +106 -99
  58. package/dist/index.es-Cj9DW-2T.js +430 -0
  59. package/dist/{index.es-BD4kFWFx.js → index.es-Cm4X20_S.js} +4 -4
  60. package/dist/{index.es-Cv6meSAn.js → index.es-InSNsV4f.js} +1 -1
  61. package/dist/index.es-L0ZCcbUf.js +4939 -0
  62. package/dist/listArea.module-B04TR5bj.js +14 -0
  63. package/dist/main.d.ts +6 -0
  64. package/dist/main.js +33 -23
  65. package/dist/react.esm-BeDwcQWb.js +12741 -0
  66. package/dist/searchBar.module-9gKyrZRT.js +7 -0
  67. package/dist/services/UtilService.d.ts +6 -0
  68. package/dist/services/UtilService.js +4 -0
  69. package/dist/services/services.test.d.ts +1 -0
  70. package/dist/services/services.test.js +22 -0
  71. package/dist/{tslib.es6-BOWp4lfV.js → tslib.es6-CIXEwqhg.js} +4 -4
  72. package/dist/verticalDivider.module-C3_GL-fH.js +7 -0
  73. package/dist/vi.JYQecGiw-BbUbJcT8.js +9795 -0
  74. package/package.json +1 -1
  75. package/dist/ListAreaService-CFOmATRF.js +0 -68
  76. package/dist/SearchBar-CY2zfu6B.js +0 -3232
  77. package/dist/vi.JYQecGiw-8gz0k16C.js +0 -22532
  78. /package/dist/assets/{BaseView.css → baseView.css} +0 -0
  79. /package/dist/assets/{BasicHeading.css → basicHeading.css} +0 -0
  80. /package/dist/assets/{ListAreaService.css → listArea.css} +0 -0
  81. /package/dist/assets/{SearchBar.css → searchBar.css} +0 -0
  82. /package/dist/assets/{VerticalDivider.css → verticalDivider.css} +0 -0
@@ -1,9 +1,10 @@
1
1
  import { jsx as a, Fragment as s } from "react/jsx-runtime";
2
2
  import { a as l } from "../../useBreakpoint-DyAmuka7.js";
3
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-8gz0k16C.js";
5
- p("BaseView Test", () => {
6
- u(() => {
4
+ import { r as i, s as e, f as p } from "../../react.esm-BeDwcQWb.js";
5
+ import { d as u, b as m, t as n, g as t, v as c } from "../../vi.JYQecGiw-BbUbJcT8.js";
6
+ u("BaseView Test", () => {
7
+ m(() => {
7
8
  c.spyOn(l, "useBreakpoints").mockReturnValue({
8
9
  isXs: !1,
9
10
  isSm: !1,
@@ -38,8 +39,8 @@ p("BaseView Test", () => {
38
39
  component: /* @__PURE__ */ a(s, { children: "Security selected" })
39
40
  }
40
41
  ];
41
- i("render BaseView with empty view and navigation list", () => {
42
- n(
42
+ n("render BaseView with empty view and navigation list", () => {
43
+ i(
43
44
  /* @__PURE__ */ a(
44
45
  r,
45
46
  {
@@ -53,8 +54,8 @@ p("BaseView Test", () => {
53
54
  }
54
55
  )
55
56
  ), 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(
57
+ }), n("render BaseView with data and navigation list", () => {
58
+ i(
58
59
  /* @__PURE__ */ a(
59
60
  r,
60
61
  {
@@ -68,8 +69,8 @@ p("BaseView Test", () => {
68
69
  }
69
70
  )
70
71
  ), 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(
72
+ }), n("render BaseView with custom detail title and no detail icon", () => {
73
+ i(
73
74
  /* @__PURE__ */ a(
74
75
  r,
75
76
  {
@@ -83,7 +84,7 @@ p("BaseView Test", () => {
83
84
  }
84
85
  )
85
86
  ), 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
+ }), n("hide empty view when screen is small", () => {
87
88
  c.spyOn(l, "useBreakpoints").mockReturnValue({
88
89
  isXs: !1,
89
90
  isSm: !0,
@@ -91,7 +92,7 @@ p("BaseView Test", () => {
91
92
  isLg: !1,
92
93
  isXlg: !1,
93
94
  active: "sm"
94
- }), n(
95
+ }), i(
95
96
  /* @__PURE__ */ a(
96
97
  r,
97
98
  {
@@ -105,8 +106,8 @@ p("BaseView Test", () => {
105
106
  }
106
107
  )
107
108
  ), t(e.queryByText("user.noselection")).not.toBeInTheDocument();
108
- }), i("render BaseView with selected detail section", () => {
109
- n(
109
+ }), n("render BaseView with selected detail section", () => {
110
+ i(
110
111
  /* @__PURE__ */ a(
111
112
  r,
112
113
  {
@@ -119,6 +120,6 @@ p("BaseView Test", () => {
119
120
  routerLinkElement: void 0
120
121
  }
121
122
  )
122
- ), d.click(e.getAllByRole("option")[1]), t(e.getByText("Data Privacy selected")).toBeInTheDocument();
123
+ ), p.click(e.getAllByRole("option")[1]), t(e.getByText("Data Privacy selected")).toBeInTheDocument();
123
124
  });
124
125
  });
@@ -1,12 +1,9 @@
1
+ import { PropsWithChildren } from 'react';
1
2
  export type BasicHeadingProps = {
2
3
  /**
3
4
  * the text content of the heading
4
5
  */
5
6
  heading: string;
6
- /**
7
- * optional actions on the right side of the header
8
- */
9
- children?: JSX.Element | JSX.Element[];
10
7
  /**
11
8
  * optional margin bottom
12
9
  */
@@ -45,4 +42,4 @@ export type BasicHeadingProps = {
45
42
  */
46
43
  withAvatar?: boolean;
47
44
  };
48
- export declare const BasicHeading: ({ children, marginBottom, heading, icon, className, subHeading, subHeadingLevel, invisibleButton, level, fontWeight, withAvatar, }: BasicHeadingProps) => import("react/jsx-runtime").JSX.Element;
45
+ export declare const BasicHeading: ({ children, marginBottom, heading, icon, className, subHeading, subHeadingLevel, invisibleButton, level, fontWeight, withAvatar, }: PropsWithChildren<BasicHeadingProps>) => import("react/jsx-runtime").JSX.Element;
@@ -1,75 +1,64 @@
1
- import "../../assets/BasicHeading.css";
2
- import { jsxs as t, jsx as i } from "react/jsx-runtime";
3
- import { u as C } from "../../useBreakpoint-DyAmuka7.js";
4
- import { Iconify as u } from "../Iconify/Iconify.js";
5
- import { AvailableCustomIcons as w } from "../../enums/AvailableCustomIcons.js";
6
- import { b as y, c as I } from "../../index.es-BD4kFWFx.js";
7
- import { I as B } from "../../index.es-Cv6meSAn.js";
8
- const N = "_pageHeader_fwns1_1", b = "_headlineContainer_fwns1_11", H = "_actionButtonContainer_fwns1_16", A = "_content_fwns1_25", W = "_leadingIcon_fwns1_31", $ = "_headingWrapper_fwns1_38", x = "_headingContainer_fwns1_43", T = "_invisible_fwns1_48", j = "_withAvatar_fwns1_52", z = "_iconContainer_fwns1_57", n = {
9
- pageHeader: N,
10
- headlineContainer: b,
11
- actionButtonContainer: H,
12
- content: A,
13
- leadingIcon: W,
14
- headingWrapper: $,
15
- headingContainer: x,
16
- invisible: T,
17
- withAvatar: j,
18
- iconContainer: z
19
- }, L = ({ icon: e }) => e ? typeof e != "string" ? /* @__PURE__ */ i("div", { className: n.iconContainer, children: e }) : e in w ? /* @__PURE__ */ i(
20
- u,
1
+ import { jsxs as r, jsx as i } from "react/jsx-runtime";
2
+ import { u as v } from "../../useBreakpoint-DyAmuka7.js";
3
+ import { Iconify as N } from "../Iconify/Iconify.js";
4
+ import { s as e } from "../../basicHeading.module-ClcvD7x2.js";
5
+ import { AvailableCustomIcons as I } from "../../enums/AvailableCustomIcons.js";
6
+ import { c as B, b as C } from "../../index.es-Cm4X20_S.js";
7
+ import { I as $ } from "../../index.es-InSNsV4f.js";
8
+ const b = ({ icon: a }) => a ? typeof a != "string" ? /* @__PURE__ */ i("div", { className: e.iconContainer, children: a }) : a in I ? /* @__PURE__ */ i(
9
+ N,
21
10
  {
22
- icon: e,
23
- className: n.leadingIcon,
11
+ icon: a,
12
+ className: e.leadingIcon,
24
13
  iconSize: "large",
25
14
  iconType: "filled"
26
15
  }
27
- ) : /* @__PURE__ */ i(B, { iconSize: "large", iconType: "filled", icon: e, className: n.leadingIcon }) : null, E = ({
28
- children: e,
29
- marginBottom: a,
30
- heading: l,
16
+ ) : /* @__PURE__ */ i($, { iconSize: "large", iconType: "filled", icon: a, className: e.leadingIcon }) : null, S = ({
17
+ children: a,
18
+ marginBottom: t,
19
+ heading: c,
31
20
  icon: d,
32
- className: p,
33
- subHeading: o,
34
- subHeadingLevel: _ = 2,
21
+ className: m,
22
+ subHeading: s,
23
+ subHeadingLevel: p = 2,
35
24
  invisibleButton: f = !1,
36
- level: r = 4,
37
- fontWeight: s = 400,
38
- withAvatar: g = !1
25
+ level: n = 4,
26
+ fontWeight: o = 400,
27
+ withAvatar: y = !1
39
28
  }) => {
40
- const { isLg: c } = C(), m = c ? r : r + 1, h = s === "bold" ? 500 : s, v = () => {
41
- if (a !== void 0)
42
- return typeof a == "number" ? `${a}px` : "2rem";
29
+ const { isLg: l } = v(), g = l ? n : n + 1, h = o === "bold" ? 500 : o, u = () => {
30
+ if (t !== void 0)
31
+ return typeof t == "number" ? `${t}px` : "2rem";
43
32
  };
44
- return /* @__PURE__ */ t(
33
+ return /* @__PURE__ */ r(
45
34
  "div",
46
35
  {
47
- className: n.pageHeader,
48
- style: { marginBottom: v() },
36
+ className: e.pageHeader,
37
+ style: { marginBottom: u() },
49
38
  "data-testid": "HeaderContainer",
50
39
  children: [
51
- /* @__PURE__ */ t("div", { className: `${g && c ? n.withAvatar : ""} ${n.headingWrapper}`, children: [
52
- /* @__PURE__ */ i(L, { icon: d }),
53
- /* @__PURE__ */ t("div", { className: o ? n.headingContainer : "", children: [
40
+ /* @__PURE__ */ r("div", { className: `${y && l ? e.withAvatar : ""} ${e.headingWrapper}`, children: [
41
+ /* @__PURE__ */ i(b, { icon: d }),
42
+ /* @__PURE__ */ r("div", { className: s ? e.headingContainer : "", children: [
54
43
  /* @__PURE__ */ i(
55
- y,
44
+ B,
56
45
  {
57
- level: m,
46
+ level: g,
58
47
  "data-testid": "Header",
59
- className: p ?? "",
48
+ className: m ?? "",
60
49
  style: { fontWeight: h },
61
- children: l
50
+ children: c
62
51
  }
63
52
  ),
64
- /* @__PURE__ */ i(I, { level: _, children: o })
53
+ /* @__PURE__ */ i(C, { level: p, children: s })
65
54
  ] })
66
55
  ] }),
67
56
  /* @__PURE__ */ i(
68
57
  "div",
69
58
  {
70
- className: `${n.actionButtonContainer} ${f && n.invisible}`,
59
+ className: `${e.actionButtonContainer} ${f && e.invisible}`,
71
60
  "data-testid": "RightPart",
72
- children: e
61
+ children: a
73
62
  }
74
63
  )
75
64
  ]
@@ -77,5 +66,5 @@ const N = "_pageHeader_fwns1_1", b = "_headlineContainer_fwns1_11", H = "_action
77
66
  );
78
67
  };
79
68
  export {
80
- E as BasicHeading
69
+ S as BasicHeading
81
70
  };
@@ -1,336 +1,36 @@
1
- import { jsx as g, Fragment as st } from "react/jsx-runtime";
2
- import { BasicHeading as w } from "./BasicHeading.js";
3
- import { d as ut, t as T, r as k, s as p, g as a } from "../../vi.JYQecGiw-8gz0k16C.js";
4
- import { d as s, P as t, b as ct, e as W, _ as J, c as X } from "../../index.es-WZ1mqvGz.js";
5
- import m, { forwardRef as F, useRef as mt, useImperativeHandle as bt, useCallback as G } from "react";
6
- import { R as ft } from "../../index.es-mBp_Btvi.js";
7
- import { I as z } from "../../index.es-Cv6meSAn.js";
8
- const pt = {
9
- /**
10
- * @deprecated _Use `themeColor='secondary'` instead._
11
- *
12
- * Preview feature, this may change. Apply alternative button color scheme (defined by the individual theme).
13
- *
14
- * Defaults to **undefined**.
15
- */
16
- altColor: s(t.bool, "Button", 'Use `themeColor="secondary"` instead.'),
17
- /**
18
- * One of 'xsmall', 'small', 'medium', 'large' and 'xlarge' will change the size of the button. Defaults according to your theme.
19
- *
20
- * Defaults to **'themeDefault'**.
21
- */
22
- buttonSize: t.oneOf(["xsmall", "small", "medium", "large", "xlarge", "themeDefault"]),
23
- /**
24
- * Content to be rendered inside the button. Can be used instead `label` of to provide more flexibility. Accepts any valid markup. _Warning, if Label is set, it will be used instead of child content._
25
- *
26
- * Defaults to **null**.
27
- */
28
- children: t.node,
29
- /**
30
- * The css class name to be passed through to the component markup.
31
- *
32
- * Defaults to **undefined**.
33
- */
34
- className: t.string,
35
- /**
36
- * @deprecated _forwardRef has been implemented for Button._
37
- *
38
- * Reference to the DOM button. This enables a greater level of integration.
39
- *
40
- * Defaults to **undefined**.
41
- */
42
- customRef: s(t.oneOfType([
43
- t.func,
44
- // eslint-disable-next-line react/forbid-prop-types
45
- t.shape({
46
- current: t.any
47
- })
48
- ]), "Button", "forwardRef has been implemented for Button."),
49
- /**
50
- * @deprecated _Use `variant='danger'` instead._
51
- *
52
- * Apply danger style to the button.
53
- *
54
- * Defaults to **undefined**.
55
- */
56
- danger: s(t.bool, "Button", 'Use `variant="danger"` instead.'),
57
- /**
58
- * Prevent the user from interacting with the component.
59
- *
60
- * Defaults to **false**.
61
- */
62
- disabled: t.bool,
63
- /**
64
- * Sets elevation of the button. Default will be the theme default.
65
- *
66
- * Defaults to **'default'**.
67
- */
68
- elevation: t.oneOf(["default", "elevated", "flat"]),
69
- /**
70
- * @deprecated _Use `variant='filled'` instead._
71
- *
72
- * Apply a filled-in style. Previously called `primary`.
73
- *
74
- * Defaults to **undefined**.
75
- */
76
- filled: s(t.bool, "Button", 'Use `variant="filled"` instead.'),
77
- /**
78
- * Applies a full-width style where the textfield will fill it's container.
79
- *
80
- * Defaults to **false**.
81
- */
82
- fullWidth: t.bool,
83
- /**
84
- * The button will render as an anchor tag. If the tag prop is set, that prop will take precedence.
85
- *
86
- * Defaults to **null**.
87
- */
88
- href: t.string,
89
- /**
90
- * The displayed text. Expects a valid string. If label and children are both set, label will take priority.
91
- *
92
- * Defaults to **null**.
93
- */
94
- label: t.string,
95
- /**
96
- * Adds the given Icon to the left of the button text. May not be used with `trailingIcon` - if `leadingIcon` and `trailingIcon` are both set, `leadingIcon` will take priority. Expects the name of a valid Material.io icon, however an icon component may be passed in instead for more control,
97
- *
98
- * Defaults to **undefined**.
99
- */
100
- leadingIcon: t.oneOfType([t.string, t.func, t.node]),
101
- /**
102
- * The primary interaction event for button.
103
- *
104
- * Defaults to **null**.
105
- */
106
- onClick: t.func,
107
- /**
108
- * @deprecated _Use `variant='outlined'`._
109
- *
110
- * Apply outlined style to the button. Previously called `secondary`.
111
- *
112
- * Defaults to **undefined**.
113
- */
114
- outlined: s(t.bool, "Button", 'Use `variant="outlined"`.'),
115
- /**
116
- * @deprecated _Use `variant='filled'` instead._
117
- *
118
- * Apply primary style to the Button.
119
- *
120
- * Defaults to **undefined**.
121
- */
122
- primary: s(t.bool, "Button", 'Use `variant="filled"` instead.'),
123
- /**
124
- * @deprecated _Use `'variant=outlined'` instead._
125
- *
126
- * Apply secondary style to the Button.
127
- *
128
- * Defaults to **undefined**.
129
- */
130
- secondary: s(t.bool, "Button", 'Use `"variant=outlined"` instead.'),
131
- /**
132
- * By default a button or anchor tag will be rendered, this allows another tag/component to be used instead. A block type element/component is suggested.
133
- *
134
- * Defaults to **null**.
135
- */
136
- tag: t.oneOfType([t.string, t.elementType, t.instanceOf(m.Component)]),
137
- /**
138
- * @deprecated _Use `variant='embedded'` instead._
139
- *
140
- * Apply tertiary style to the Button.
141
- *
142
- * Defaults to **undefined**.
143
- */
144
- tertiary: s(t.bool, "Button", 'Use `variant="embedded"` instead.'),
145
- /**
146
- * @deprecated _Use `variant='text'` instead._
147
- *
148
- * Apply unfilled, un-outlined style to the Button. Previously called `tertiary`.
149
- *
150
- * Defaults to **undefined**.
151
- */
152
- text: s(t.bool, "Button", 'Use `variant="text"` instead.'),
153
- /**
154
- * Sets the theme color for the button. Most commonly used when the control is placed on a darker surface.
155
- *
156
- * Defaults to **'primary'**.
157
- */
158
- themeColor: ct(t.oneOf(["primary", "secondary", "danger", "success", "on-unknown-black", "on-unknown-white", "on-primary", "on-secondary", "on-success", "on-danger"]), ["onUnknownBlack", "onUnknownWhite"], "Button", "Please use one of 'primary','secondary','danger','success','on-unknown-black','on-unknown-white','on-primary','on-secondary','on-success','on-danger'."),
159
- /**
160
- * Adds the given Icon to the right of the button text. May not be used with `leadingIcon` - if `leadingIcon` and `trailingIcon` are both set, `leadingIcon` will take priority. Expects the name of a valid Material.io icon, however an icon component may be passed in instead for more control.
161
- *
162
- * Defaults to **undefined**.
163
- */
164
- trailingIcon: t.oneOfType([t.string, t.func, t.node]),
165
- /**
166
- * This applies the html button type (button, submit, reset) or the anchor media type when used with the href property.
167
- *
168
- * Defaults to **'button'**.
169
- */
170
- type: t.oneOf(["button", "submit", "reset"]),
171
- /**
172
- * @deprecated _Use `elevation='flat' instead._
173
- *
174
- * Remove elevation.
175
- *
176
- * Defaults to **undefined**.
177
- */
178
- unelevated: s(t.bool, "Button", 'Use `elevation="flat" instead.'),
179
- /**
180
- * Applies the selected style to the button. `rounded-small` and `rounded-micro` are only available on select themes.
181
- *
182
- * Defaults to **'filled'**.
183
- */
184
- variant: t.oneOf(["filled", "outlined", "danger", "text", "success", "rounded-small", "rounded-micro"])
185
- }, yt = {
186
- altColor: void 0,
187
- buttonSize: "themeDefault",
188
- children: null,
189
- className: void 0,
190
- customRef: void 0,
191
- danger: void 0,
192
- disabled: !1,
193
- elevation: "default",
194
- filled: void 0,
195
- fullWidth: !1,
196
- href: null,
197
- label: null,
198
- leadingIcon: void 0,
199
- outlined: void 0,
200
- primary: void 0,
201
- secondary: void 0,
202
- tag: null,
203
- tertiary: void 0,
204
- text: void 0,
205
- themeColor: "primary",
206
- trailingIcon: void 0,
207
- type: "button",
208
- unelevated: void 0,
209
- variant: "filled"
210
- }, gt = {
211
- /**
212
- * Children to be rendered. Expects multiple Element Buttons
213
- *
214
- * Defaults to **null**.
215
- */
216
- children: t.node,
217
- /**
218
- * How much spacing between buttons. Dense is 8p, standard is 16px and airy is 24px.
219
- *
220
- * Defaults to **'standard'**.
221
- */
222
- variant: t.oneOf(["dense", "standard", "airy"])
223
- }, ht = {
224
- children: null,
225
- variant: "standard"
226
- }, C = /* @__PURE__ */ F((r, u) => {
227
- const {
228
- altColor: b,
229
- buttonSize: P,
230
- children: x,
231
- className: O,
232
- customRef: L,
233
- disabled: j,
234
- elevation: H,
235
- primary: q,
236
- secondary: M,
237
- tertiary: $,
238
- text: A,
239
- danger: K,
240
- filled: Q,
241
- fullWidth: V,
242
- href: R,
243
- label: Y,
244
- leadingIcon: d,
245
- onClick: Z,
246
- outlined: tt,
247
- tag: nt,
248
- themeColor: e,
249
- trailingIcon: h,
250
- type: et,
251
- unelevated: n,
252
- variant: c,
253
- ...ot
254
- } = r, N = mt(L || null);
255
- bt(u, () => N.current, []);
256
- const at = Y || x, rt = nt || (R ? "a" : "button"), l = c === "outlined" || tt || M, S = c === "rounded-small" || c === "rounded-micro", i = c === "text" || A || $, y = c === "danger" || K || e === "danger", _ = c === "success" || e === "success", o = !l && !i && (c === "filled" || Q || q), B = b || e === "secondary", f = e === "primary", dt = h && !d, v = e === "onUnknownBlack" || e === "on-unknown-black", I = e === "onUnknownWhite" || e === "on-unknown-white", U = e === "onPrimary" || e === "on-primary", E = e === "onSecondary" || e === "on-secondary", lt = G(() => typeof d == "string" ? /* @__PURE__ */ m.createElement(z, {
257
- tabIndex: 0,
258
- role: "button",
259
- className: "mdc-button__icon lmnt-button__icon--leading",
260
- icon: d
261
- }) : typeof d == "function" ? d({
262
- className: "mdc-button__icon lmnt-button__icon--leading"
263
- }) : W(d, "mdc-button__icon lmnt-button__icon--leading"), [d]), it = G(() => typeof h == "string" ? /* @__PURE__ */ m.createElement(z, {
264
- tabIndex: 0,
265
- role: "button",
266
- className: "mdc-button__icon lmnt-button__icon--trailing",
267
- icon: h
268
- }) : typeof d == "function" ? h({
269
- className: "mdc-button__icon lmnt-button__icon--trailing"
270
- }) : W(h, "mdc-button__icon lmnt-button__icon--trailing"), [d, h]);
271
- return /* @__PURE__ */ m.createElement(ft, {
272
- componentRef: N
273
- }, /* @__PURE__ */ m.createElement(rt, J({
274
- ref: N,
275
- href: R,
276
- onClick: Z,
277
- type: et,
278
- disabled: j,
279
- className: X("lmnt", "mdc-button", "lmnt-button", o && n && f && "lmnt-button--filled-primary", o && y && "lmnt-button--filled-danger", o && _ && "lmnt-button--filled-success", o && n && B && "lmnt-button--filled-secondary", o && !n && f && ["lmnt-button--filled-primary", "mdc-button--raised"], o && !n && B && ["lmnt-button--filled-secondary", "mdc-button--raised"], o && !n && e === "on-primary" && ["lmnt-button--filled-on-primary", "mdc-button--raised"], o && !n && e === "on-secondary" && ["lmnt-button--filled-on-secondary", "mdc-button--raised"], o && !n && e === "on-success" && ["lmnt-button--filled-on-success", "mdc-button--raised"], o && !n && e === "on-danger" && ["lmnt-button--filled-on-danger", "mdc-button--raised"], o && !n && v && ["lmnt-button--filled-on-unknown-black", "mdc-button--raised"], o && !n && I && ["lmnt-button--filled-on-unknown-white", "mdc-button--raised"], l && f && ["lmnt-button--outlined-primary", "mdc-button--outlined"], o && !n && U && ["lmnt-button--filled-on-primary", "mdc-button--raised"], l && B && ["lmnt-button--outlined-secondary", "mdc-button--outlined"], l && U && "lmnt-button--outlined-on-primary mdc-button--outlined", l && E && "lmnt-button--outlined-on-secondary mdc-button--outlined", l && I && "lmnt-button--outlined-on-unknown-white mdc-button--outlined", l && v && "lmnt-button--outlined-on-unknown-black mdc-button--outlined", i && U && "lmnt-button--text-on-primary mdc-button__text", i && E && "lmnt-button--text-on-secondary mdc-button__text", i && I && "lmnt-button--text-on-unknown-white mdc-button__text", i && v && "lmnt-button--text-on-unknown-black mdc-button__text", S && I && "lmnt-button--text-on-unknown-white mdc-button__text", S && v && "lmnt-button--text-on-unknown-black mdc-button__text", i && f && "lmnt-button--text-primary", i && B && "lmnt-button--text-secondary", i && y && "lmnt-button--text-danger", i && _ && "lmnt-button--text-success", y && n && B && "lmnt-button--danger-secondary", y && !n && B && ["lmnt-button--danger-secondary", "mdc-button--raised"], y && n && f && "lmnt-button--danger-primary", y && !n && f && ["lmnt-button--danger-primary", "mdc-button--raised"], y && l && ["lmnt-button--danger-primary", "mdc-button--outlined"], _ && n && f && "lmnt-button--success-primary", _ && !n && f && ["lmnt-button--success-primary", "mdc-button--raised"], _ && l && ["lmnt-button--success-primary", "mdc-button--outlined"], _ && l && ["lmnt-button--success-primary", "mdc-button--outlined"], V && "lmnt-button--full-width", n && !i && "mdc-button--unelevated", H === "flat" && "lmnt-button--flat", H === "elevated" && "lmnt-button--elevated", `lmnt-button--${P}`, c === "rounded-small" && "lmnt-button--rounded lmnt-button--rounded-small mdc-button__text lmnt-button--text-primary", c === "rounded-micro" && "lmnt-button--rounded lmnt-button--rounded-micro mdc-button__text lmnt-button--text-primary", O, "mdc-touch-target-wrapper")
280
- }, ot), /* @__PURE__ */ m.createElement("span", {
281
- className: "mdc-button__ripple"
282
- }), d && lt(), /* @__PURE__ */ m.createElement("span", {
283
- className: "mdc-button__label"
284
- }, at), dt && it(), /* @__PURE__ */ m.createElement("span", {
285
- className: "mdc-button__touch"
286
- })));
287
- });
288
- C.displayName = "Button";
289
- C.propTypes = pt;
290
- C.defaultProps = yt;
291
- const D = /* @__PURE__ */ F((r, u) => {
292
- const {
293
- children: b,
294
- className: P,
295
- variant: x,
296
- ...O
297
- } = r;
298
- return /* @__PURE__ */ m.createElement("div", J({
299
- ref: u,
300
- className: X("lmnt", "lmnt-button-group", x === "dense" && "lmnt-button-group--dense", x === "standard" && "lmnt-button-group--standard", x === "airy" && "lmnt-button-group--airy", P)
301
- }, O), b);
302
- });
303
- D.displayName = "ButtonGroup";
304
- D.propTypes = gt;
305
- D.defaultProps = ht;
306
- ut("BasicHeading-Test", () => {
307
- T("render small container without content", () => {
308
- k(/* @__PURE__ */ g(w, { heading: "Test" }));
309
- const r = p.getByTestId("HeaderContainer");
310
- a(r).toBeDefined(), a(r).toHaveClass(/pageHeader/);
311
- const u = p.getByTestId("Header");
312
- a(u).toBeDefined(), a(u).toHaveTextContent("Test");
313
- const b = p.getByTestId("RightPart");
314
- a(b).toBeDefined();
315
- }), T("render large container with children", () => {
316
- k(
317
- /* @__PURE__ */ g(w, { heading: "Test", marginBottom: "large", children: /* @__PURE__ */ g(C, { children: "Extracontent" }) })
1
+ import { jsx as o, Fragment as c } from "react/jsx-runtime";
2
+ import { BasicHeading as a } from "./BasicHeading.js";
3
+ import { r as i, s as n } from "../../react.esm-BeDwcQWb.js";
4
+ import { d as g, t as s, g as e } from "../../vi.JYQecGiw-BbUbJcT8.js";
5
+ import { B as h } from "../../index.es-CQ3ep412.js";
6
+ g("BasicHeading-Test", () => {
7
+ s("render small container without content", () => {
8
+ i(/* @__PURE__ */ o(a, { heading: "Test" }));
9
+ const t = n.getByTestId("HeaderContainer");
10
+ e(t).toBeDefined(), e(t).toHaveClass(/pageHeader/);
11
+ const r = n.getByTestId("Header");
12
+ e(r).toBeDefined(), e(r).toHaveTextContent("Test");
13
+ const d = n.getByTestId("RightPart");
14
+ e(d).toBeDefined();
15
+ }), s("render large container with children", () => {
16
+ i(
17
+ /* @__PURE__ */ o(a, { heading: "Test", marginBottom: "large", children: /* @__PURE__ */ o(h, { children: "Extracontent" }) })
318
18
  );
319
- const r = p.getByTestId("HeaderContainer");
320
- a(r).toBeDefined();
321
- const u = p.getByTestId("Header");
322
- a(u).toBeDefined(), a(u).toHaveTextContent("Test");
323
- const b = p.getByTestId("RightPart");
324
- a(b).toBeDefined(), a(b).toContainHTML("<button");
325
- }), T("render with available custom icon", () => {
326
- k(/* @__PURE__ */ g(w, { heading: "Test", icon: "farm" }));
327
- const r = p.getByTestId("farm");
328
- a(r).toBeInTheDocument();
329
- }), T("render with JSX element as icon", () => {
330
- k(/* @__PURE__ */ g(w, { heading: "Test", icon: /* @__PURE__ */ g(st, { children: "JSX" }) })), a(p.getByText("JSX")).toBeInTheDocument();
331
- }), T("render with other icon", () => {
332
- k(/* @__PURE__ */ g(w, { heading: "Test", icon: "contact_support" }));
333
- const r = document.querySelector("i");
334
- a(r).toHaveTextContent("contact_support");
19
+ const t = n.getByTestId("HeaderContainer");
20
+ e(t).toBeDefined();
21
+ const r = n.getByTestId("Header");
22
+ e(r).toBeDefined(), e(r).toHaveTextContent("Test");
23
+ const d = n.getByTestId("RightPart");
24
+ e(d).toBeDefined(), e(d).toContainHTML("<button");
25
+ }), s("render with available custom icon", () => {
26
+ i(/* @__PURE__ */ o(a, { heading: "Test", icon: "farm" }));
27
+ const t = n.getByTestId("farm");
28
+ e(t).toBeInTheDocument();
29
+ }), s("render with JSX element as icon", () => {
30
+ i(/* @__PURE__ */ o(a, { heading: "Test", icon: /* @__PURE__ */ o(c, { children: "JSX" }) })), e(n.getByText("JSX")).toBeInTheDocument();
31
+ }), s("render with other icon", () => {
32
+ i(/* @__PURE__ */ o(a, { heading: "Test", icon: "contact_support" }));
33
+ const t = document.querySelector("i");
34
+ e(t).toHaveTextContent("contact_support");
335
35
  });
336
36
  });