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.
@@ -1,77 +1,81 @@
1
- import { cn as m } from "../../../../helpers/cn.js";
2
- import y from "../icons/ChevronDownIcon.js";
3
- import { StyledButton as N } from "../../../inputs/button/StyledButton.js";
4
- import { StyledEmptyPage as v } from "../../../feedback/empty-page/StyledEmptyPage.js";
5
- import { StyledLoading as C } from "../../../feedback/loading/StyledLoading.js";
6
- import { StyledLink as b } from "../../../navigation/link/StyledLink.js";
7
- import { StyledWidgetTitle as I } from "../widget-title/StyledWidgetTitle.js";
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 T from "../icons/ChevronUpIcon.js";
10
- import { useState as k } from "react";
11
- import { Fragment as L, jsx as e, jsxs as o } from "react/jsx-runtime";
12
- var U = ({ children: s, title: c, titleNode: h, icon: n, link: d, viewMore: t, persistKey: i, isLoading: g, isEmpty: l, emptyText: f, headerRight: x, headerRightClassName: p }) => {
13
- const [r, w] = k(() => i ? localStorage.getItem(i) === "true" : !1), u = !!d && !d.hide, S = !!t && !t.hide;
14
- return /* @__PURE__ */ o("div", {
15
- className: `${a["asma-ui-core-styled-widget"]} ${l ? a["empty-state"] : ""}`,
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__ */ o("div", {
18
- className: m(a["widget-header-left"], "max-xs:flex-wrap max-xs:gap-y-2"),
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(I, {
24
+ h ?? /* @__PURE__ */ e(T, {
25
25
  className: "min-w-min",
26
26
  children: c
27
27
  }),
28
28
  /* @__PURE__ */ e("div", {
29
- className: m(a["widget-header-right"], "max-xs:flex-wrap max-xs:gap-y-2", p),
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__ */ o(L, { children: [
37
- s,
38
- /* @__PURE__ */ e(C, { isLoading: g }),
39
- /* @__PURE__ */ e(v, {
40
- isEmpty: l,
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__ */ o("div", {
46
- className: m(a["widget-footer"], "max-xs:flex-wrap max-xs:gap-y-2"),
47
- children: [t.hide ? /* @__PURE__ */ e("div", {}) : /* @__PURE__ */ e(N, {
48
- disabled: t.disabled,
49
- disabledReason: t.disabledReason,
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
- endIcon: r ? /* @__PURE__ */ e(T, {
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(y, {
59
+ }) : /* @__PURE__ */ e(N, {
56
60
  width: 20,
57
61
  height: 20
58
62
  }),
59
63
  onClick: () => {
60
- w(!r), i && localStorage.setItem(i, String(!r)), t.onClick?.();
64
+ w(!d), o && localStorage.setItem(o, String(!d)), t.onClick?.();
61
65
  },
62
- children: r ? t.viewLessText : t.viewMoreText
63
- }), u ? /* @__PURE__ */ e(b, {
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: d.href,
68
- onClick: d.onClick,
69
- content: d.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
- U as StyledWidget
80
+ V as StyledWidget
77
81
  };
@@ -1,12 +1,13 @@
1
1
  var e = {
2
- "asma-ui-core-styled-widget": "_asma-ui-core-styled-widget_1oj8h_1",
3
- "empty-state": "_empty-state_1oj8h_13",
4
- "widget-header": "_widget-header_1oj8h_16",
5
- "widget-header-left": "_widget-header-left_1oj8h_22",
6
- "widget-header-right": "_widget-header-right_1oj8h_28",
7
- "widget-content": "_widget-content_1oj8h_34",
8
- "widget-footer": "_widget-footer_1oj8h_44",
9
- "widget-link": "_widget-link_1oj8h_49"
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
- * @figmaProp none — behavioral. Why "view more" is unavailable. With `disabled` the button stays
30
- * focusable and shows the reason on hover, focus and tap (disabled-states DIS-1…DIS-4).
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
  };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "3.127.1",
6
+ "version": "3.127.2",
7
7
  "type": "module",
8
8
  "sideEffects": [
9
9
  "**/*.css",