asma-ui-core 3.127.1 → 3.127.2
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/dist/asma-ui-core.css +1 -1
- package/dist/components/custom/widget/widget/StyledWidget.js +41 -37
- package/dist/components/custom/widget/widget/StyledWidget.module.js +9 -8
- package/dist/src/components/custom/widget/widget/StyledWidget.d.ts +3 -2
- package/dist/src/components/custom/widget/widget/StyledWidget.test.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,77 +1,81 @@
|
|
|
1
|
-
import { cn as
|
|
2
|
-
import
|
|
3
|
-
import { StyledButton as
|
|
4
|
-
import { StyledEmptyPage as
|
|
5
|
-
import { StyledLoading as
|
|
6
|
-
import { StyledLink as
|
|
7
|
-
import { StyledWidgetTitle as
|
|
1
|
+
import { cn as s } from "../../../../helpers/cn.js";
|
|
2
|
+
import N from "../icons/ChevronDownIcon.js";
|
|
3
|
+
import { StyledButton as b } from "../../../inputs/button/StyledButton.js";
|
|
4
|
+
import { StyledEmptyPage as C } from "../../../feedback/empty-page/StyledEmptyPage.js";
|
|
5
|
+
import { StyledLoading as I } from "../../../feedback/loading/StyledLoading.js";
|
|
6
|
+
import { StyledLink as v } from "../../../navigation/link/StyledLink.js";
|
|
7
|
+
import { StyledWidgetTitle as T } from "../widget-title/StyledWidgetTitle.js";
|
|
8
8
|
import a from "./StyledWidget.module.js";
|
|
9
|
-
import
|
|
10
|
-
import { useState as
|
|
11
|
-
import { Fragment as
|
|
12
|
-
var
|
|
13
|
-
const [
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
-
className: `${a["asma-ui-core-styled-widget"]} ${
|
|
9
|
+
import k from "../icons/ChevronUpIcon.js";
|
|
10
|
+
import { useState as L } from "react";
|
|
11
|
+
import { Fragment as R, jsx as e, jsxs as i } from "react/jsx-runtime";
|
|
12
|
+
var V = ({ children: m, title: c, titleNode: h, icon: n, link: l, viewMore: t, persistKey: o, isLoading: g, isEmpty: r, emptyText: f, headerRight: x, headerRightClassName: p }) => {
|
|
13
|
+
const [d, w] = L(() => o ? localStorage.getItem(o) === "true" : !1), u = !!l && !l.hide, S = !!t && !t.hide, y = !!t?.disabled && !d && t?.disabledReason != null;
|
|
14
|
+
return /* @__PURE__ */ i("div", {
|
|
15
|
+
className: `${a["asma-ui-core-styled-widget"]} ${r ? a["empty-state"] : ""}`,
|
|
16
16
|
children: [
|
|
17
|
-
/* @__PURE__ */
|
|
18
|
-
className:
|
|
17
|
+
/* @__PURE__ */ i("div", {
|
|
18
|
+
className: s(a["widget-header-left"], "max-xs:flex-wrap max-xs:gap-y-2"),
|
|
19
19
|
children: [
|
|
20
20
|
n && /* @__PURE__ */ e("span", {
|
|
21
21
|
className: "flex shrink-0",
|
|
22
22
|
children: n
|
|
23
23
|
}),
|
|
24
|
-
h ?? /* @__PURE__ */ e(
|
|
24
|
+
h ?? /* @__PURE__ */ e(T, {
|
|
25
25
|
className: "min-w-min",
|
|
26
26
|
children: c
|
|
27
27
|
}),
|
|
28
28
|
/* @__PURE__ */ e("div", {
|
|
29
|
-
className:
|
|
29
|
+
className: s(a["widget-header-right"], "max-xs:flex-wrap max-xs:gap-y-2", p),
|
|
30
30
|
children: x
|
|
31
31
|
})
|
|
32
32
|
]
|
|
33
33
|
}),
|
|
34
34
|
/* @__PURE__ */ e("div", {
|
|
35
35
|
className: a["widget-content"],
|
|
36
|
-
children: /* @__PURE__ */
|
|
37
|
-
|
|
38
|
-
/* @__PURE__ */ e(
|
|
39
|
-
/* @__PURE__ */ e(
|
|
40
|
-
isEmpty:
|
|
36
|
+
children: /* @__PURE__ */ i(R, { children: [
|
|
37
|
+
m,
|
|
38
|
+
/* @__PURE__ */ e(I, { isLoading: g }),
|
|
39
|
+
/* @__PURE__ */ e(C, {
|
|
40
|
+
isEmpty: r,
|
|
41
41
|
emptyText: f
|
|
42
42
|
})
|
|
43
43
|
] })
|
|
44
44
|
}),
|
|
45
|
-
S && /* @__PURE__ */
|
|
46
|
-
className:
|
|
47
|
-
children: [
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
S && /* @__PURE__ */ i("div", {
|
|
46
|
+
className: s(a["widget-footer"], "max-xs:flex-wrap max-xs:gap-y-2"),
|
|
47
|
+
children: [y ? /* @__PURE__ */ e("p", {
|
|
48
|
+
className: a["widget-all-shown"],
|
|
49
|
+
"data-testid": "all-items-shown",
|
|
50
|
+
children: t.disabledReason
|
|
51
|
+
}) : /* @__PURE__ */ e(b, {
|
|
50
52
|
dataTest: "view-more",
|
|
51
53
|
variant: "text",
|
|
52
|
-
|
|
54
|
+
disabled: !!t.disabled && !d,
|
|
55
|
+
disabledReason: d ? void 0 : t.disabledReason,
|
|
56
|
+
endIcon: d ? /* @__PURE__ */ e(k, {
|
|
53
57
|
width: 20,
|
|
54
58
|
height: 20
|
|
55
|
-
}) : /* @__PURE__ */ e(
|
|
59
|
+
}) : /* @__PURE__ */ e(N, {
|
|
56
60
|
width: 20,
|
|
57
61
|
height: 20
|
|
58
62
|
}),
|
|
59
63
|
onClick: () => {
|
|
60
|
-
w(!
|
|
64
|
+
w(!d), o && localStorage.setItem(o, String(!d)), t.onClick?.();
|
|
61
65
|
},
|
|
62
|
-
children:
|
|
63
|
-
}), u ? /* @__PURE__ */ e(
|
|
66
|
+
children: d ? t.viewLessText : t.viewMoreText
|
|
67
|
+
}), u ? /* @__PURE__ */ e(v, {
|
|
64
68
|
dataTest: "go-to-button",
|
|
65
69
|
className: a["widget-link"],
|
|
66
70
|
size: "large",
|
|
67
|
-
href:
|
|
68
|
-
onClick:
|
|
69
|
-
content:
|
|
71
|
+
href: l.href,
|
|
72
|
+
onClick: l.onClick,
|
|
73
|
+
content: l.content
|
|
70
74
|
}) : /* @__PURE__ */ e("div", {})]
|
|
71
75
|
})
|
|
72
76
|
]
|
|
73
77
|
});
|
|
74
78
|
};
|
|
75
79
|
export {
|
|
76
|
-
|
|
80
|
+
V as StyledWidget
|
|
77
81
|
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
var e = {
|
|
2
|
-
"asma-ui-core-styled-widget": "_asma-ui-core-styled-
|
|
3
|
-
"empty-state": "_empty-
|
|
4
|
-
"widget-header": "_widget-
|
|
5
|
-
"widget-header-left": "_widget-header-
|
|
6
|
-
"widget-header-right": "_widget-header-
|
|
7
|
-
"widget-content": "_widget-
|
|
8
|
-
"widget-footer": "_widget-
|
|
9
|
-
"widget-
|
|
2
|
+
"asma-ui-core-styled-widget": "_asma-ui-core-styled-widget_ehofp_1",
|
|
3
|
+
"empty-state": "_empty-state_ehofp_13",
|
|
4
|
+
"widget-header": "_widget-header_ehofp_16",
|
|
5
|
+
"widget-header-left": "_widget-header-left_ehofp_22",
|
|
6
|
+
"widget-header-right": "_widget-header-right_ehofp_28",
|
|
7
|
+
"widget-content": "_widget-content_ehofp_34",
|
|
8
|
+
"widget-footer": "_widget-footer_ehofp_44",
|
|
9
|
+
"widget-all-shown": "_widget-all-shown_ehofp_49",
|
|
10
|
+
"widget-link": "_widget-link_ehofp_59"
|
|
10
11
|
};
|
|
11
12
|
export {
|
|
12
13
|
e as default
|
|
@@ -26,8 +26,9 @@ export interface StyledWidgetProps {
|
|
|
26
26
|
hide?: boolean;
|
|
27
27
|
disabled?: boolean;
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
29
|
+
* Read-only helper text shown in place of View more when `disabled` is set and the list is
|
|
30
|
+
* collapsed (ASMA-8699). Not a control: no click, focus, hover, or tooltip. View less stays
|
|
31
|
+
* a button so an expanded list can still collapse.
|
|
31
32
|
*/
|
|
32
33
|
disabledReason?: ReactNode;
|
|
33
34
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|