asma-ui-core 3.123.1 → 3.124.0

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.
@@ -123,7 +123,7 @@ function Y({ items: i, expanded: n, onToggleExpanded: a, leadSlot: s, actionSlot
123
123
  children: h ? /* @__PURE__ */ e("div", {
124
124
  className: g(o.compactItems, W && o.compactItemsStacked),
125
125
  children: E.map((c) => /* @__PURE__ */ e("div", {
126
- className: g("min-w-0 whitespace-nowrap", W ? "w-full" : "shrink"),
126
+ className: g("min-w-0 whitespace-nowrap", W ? "max-w-full" : "shrink"),
127
127
  children: /* @__PURE__ */ e(b, {
128
128
  item: c,
129
129
  compact: h
@@ -9,17 +9,17 @@ import a from "./StyledWidget.module.js";
9
9
  import T from "../icons/ChevronUpIcon.js";
10
10
  import { useState as k } from "react";
11
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: l, link: d, viewMore: t, persistKey: i, isLoading: f, isEmpty: n, emptyText: g, headerRight: x, headerRightClassName: p }) => {
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
13
  const [r, w] = k(() => i ? localStorage.getItem(i) === "true" : !1), u = !!d && !d.hide, S = !!t && !t.hide;
14
14
  return /* @__PURE__ */ o("div", {
15
- className: `${a["asma-ui-core-styled-widget"]} ${n ? a["empty-state"] : ""}`,
15
+ className: `${a["asma-ui-core-styled-widget"]} ${l ? a["empty-state"] : ""}`,
16
16
  children: [
17
17
  /* @__PURE__ */ o("div", {
18
18
  className: m(a["widget-header-left"], "max-xs:flex-wrap max-xs:gap-y-2"),
19
19
  children: [
20
- l && /* @__PURE__ */ e("span", {
20
+ n && /* @__PURE__ */ e("span", {
21
21
  className: "flex shrink-0",
22
- children: l
22
+ children: n
23
23
  }),
24
24
  h ?? /* @__PURE__ */ e(I, {
25
25
  className: "min-w-min",
@@ -35,10 +35,10 @@ var U = ({ children: s, title: c, titleNode: h, icon: l, link: d, viewMore: t, p
35
35
  className: a["widget-content"],
36
36
  children: /* @__PURE__ */ o(L, { children: [
37
37
  s,
38
- /* @__PURE__ */ e(C, { isLoading: f }),
38
+ /* @__PURE__ */ e(C, { isLoading: g }),
39
39
  /* @__PURE__ */ e(v, {
40
- isEmpty: n,
41
- emptyText: g
40
+ isEmpty: l,
41
+ emptyText: f
42
42
  })
43
43
  ] })
44
44
  }),
@@ -63,7 +63,7 @@ var U = ({ children: s, title: c, titleNode: h, icon: l, link: d, viewMore: t, p
63
63
  }), u ? /* @__PURE__ */ e(b, {
64
64
  dataTest: "go-to-button",
65
65
  className: a["widget-link"],
66
- size: "small",
66
+ size: "large",
67
67
  href: d.href,
68
68
  onClick: d.onClick,
69
69
  content: d.content
@@ -1,47 +1,39 @@
1
1
  import { StyledTooltip as w } from "../../data-display/tooltip/StyledTooltip.js";
2
2
  import a from "./StyledLink.module.js";
3
- import o from "clsx";
3
+ import s from "clsx";
4
4
  import "react";
5
5
  import { jsx as h, jsxs as y } from "react/jsx-runtime";
6
- var j = ({ href: m, disabled: e, disabledReason: x, size: p = "large", dataTest: k, reflink: u, className: n, content: i, contentNode: s, onClick: c, ...t }) => {
7
- let r = a["styled-link-large"];
8
- switch (p) {
9
- case "large":
10
- r = a["styled-link-large"];
11
- break;
12
- case "small":
13
- r = a["styled-link-small"];
14
- break;
15
- case "xs":
16
- r = a["styled-link-xs"];
17
- break;
18
- }
6
+ var v = {
7
+ small: "large",
8
+ xs: "medium"
9
+ }, g = ({ href: u, disabled: e, disabledReason: x, size: r = "large", dataTest: d, reflink: f, className: n, content: i, contentNode: o, onClick: c, ...t }) => {
10
+ const m = (r === "small" || r === "xs" ? v[r] : r) === "medium" ? a["styled-link-medium"] : a["styled-link-large"];
19
11
  if (e && !x) return /* @__PURE__ */ y("span", {
20
- className: o(a["styled-link"], "max-xs:hyphens-auto max-xs:![overflow-wrap:anywhere]", a["styled-link-disabled"], r, n),
21
- children: [i, s]
12
+ className: s(a["styled-link"], "max-xs:hyphens-auto max-xs:![overflow-wrap:anywhere]", a["styled-link-disabled"], m, n),
13
+ children: [i, o]
22
14
  });
23
- const f = (l) => /* @__PURE__ */ h(w, {
15
+ const p = (l) => /* @__PURE__ */ h(w, {
24
16
  title: x,
25
17
  open: e ? void 0 : !1,
26
18
  openOnTap: !!e,
27
19
  persistentDescription: !!e,
28
20
  children: l
29
- }), d = (l) => {
21
+ }), k = (l) => {
30
22
  if (e) {
31
23
  l.preventDefault();
32
24
  return;
33
25
  }
34
26
  c?.(l);
35
27
  };
36
- return f(m ? /* @__PURE__ */ y("a", {
28
+ return p(u ? /* @__PURE__ */ y("a", {
37
29
  ...t,
38
- "data-testid": k,
39
- ref: u,
40
- href: e ? void 0 : m,
30
+ "data-testid": d,
31
+ ref: f,
32
+ href: e ? void 0 : u,
41
33
  role: e ? "link" : t.role,
42
34
  "aria-disabled": e ? !0 : t["aria-disabled"],
43
35
  tabIndex: e ? 0 : t.tabIndex,
44
- onClick: d,
36
+ onClick: k,
45
37
  onKeyDown: (l) => {
46
38
  if (e && l.key === "Enter") {
47
39
  l.preventDefault();
@@ -49,19 +41,19 @@ var j = ({ href: m, disabled: e, disabledReason: x, size: p = "large", dataTest:
49
41
  }
50
42
  t.onKeyDown?.(l);
51
43
  },
52
- className: o(a["styled-link"], "max-xs:hyphens-auto max-xs:![overflow-wrap:anywhere]", e ? a["styled-link-disabled"] : "asma-touch-ready", r, n),
53
- children: [i, s]
44
+ className: s(a["styled-link"], "max-xs:hyphens-auto max-xs:![overflow-wrap:anywhere]", e ? a["styled-link-disabled"] : "asma-touch-ready", m, n),
45
+ children: [i, o]
54
46
  }) : /* @__PURE__ */ y("button", {
55
47
  ...t,
56
- "data-testid": k,
57
- ref: u,
48
+ "data-testid": d,
49
+ ref: f,
58
50
  type: "button",
59
51
  "aria-disabled": e ? !0 : t["aria-disabled"],
60
- onClick: d,
61
- className: o(a["styled-link"], "max-xs:hyphens-auto max-xs:![overflow-wrap:anywhere]", a["styled-link-button"], e ? a["styled-link-disabled"] : "asma-touch-ready", r, n),
62
- children: [i, s]
52
+ onClick: k,
53
+ className: s(a["styled-link"], "max-xs:hyphens-auto max-xs:![overflow-wrap:anywhere]", a["styled-link-button"], e ? a["styled-link-disabled"] : "asma-touch-ready", m, n),
54
+ children: [i, o]
63
55
  }));
64
56
  };
65
57
  export {
66
- j as StyledLink
58
+ g as StyledLink
67
59
  };
@@ -1,10 +1,9 @@
1
1
  var l = {
2
- "styled-link": "_styled-link_ttb58_1",
3
- "styled-link-disabled": "_styled-link-disabled_ttb58_14",
4
- "styled-link-button": "_styled-link-button_ttb58_37",
5
- "styled-link-xs": "_styled-link-xs_ttb58_42",
6
- "styled-link-small": "_styled-link-small_ttb58_47",
7
- "styled-link-large": "_styled-link-large_ttb58_52"
2
+ "styled-link": "_styled-link_1fgwh_1",
3
+ "styled-link-disabled": "_styled-link-disabled_1fgwh_14",
4
+ "styled-link-button": "_styled-link-button_1fgwh_37",
5
+ "styled-link-medium": "_styled-link-medium_1fgwh_42",
6
+ "styled-link-large": "_styled-link-large_1fgwh_47"
8
7
  };
9
8
  export {
10
9
  l as default
@@ -6,6 +6,8 @@ import { default as React, AnchorHTMLAttributes, MouseEvent, ReactNode } from 'r
6
6
  * Disabled = delta-300; Focused/Pressed adds a 1px gama-400 rounded indicator (radius 4, px4/py2).
7
7
  * State is derived at runtime from `:hover`/`:focus`/`disabled`, not a prop.
8
8
  */
9
+ /** @deprecated ASMA-8705 — `small` → use `large`, `xs` → use `medium`. */
10
+ type LegacyLinkSize = 'small' | 'xs';
9
11
  export type StyledLinkProps = Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'onClick'> & {
10
12
  onClick?: (event: MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void;
11
13
  /** @figmaProp State = true→"Disabled" (renders a non-interactive <span>, delta-300) */
@@ -16,8 +18,14 @@ export type StyledLinkProps = Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'onC
16
18
  * (disabled-states DIS-1…DIS-3). Without it a disabled link stays a plain `<span>`.
17
19
  */
18
20
  disabledReason?: ReactNode;
19
- /** @figmaProp Size = small→"Base" (14/20) | large→"Medium" (16/24); xs (12/20) = none (no DS size) */
20
- size?: 'small' | 'large' | 'xs';
21
+ /**
22
+ * @figmaProp Body Base = large→on ("Links/Base link", 16/24) | medium→off ("Links/Helper link", 14/20).
23
+ * The design system has these two sizes only (ASMA-8705).
24
+ *
25
+ * `small` and `xs` are deprecated aliases kept so existing callers keep compiling: `small` renders as
26
+ * `large` (was 14/20) and `xs` as `medium` (was 12/20). Use `large` / `medium` instead.
27
+ */
28
+ size?: 'medium' | 'large' | LegacyLinkSize;
21
29
  /** @figmaProp none — ref */
22
30
  reflink?: React.Ref<HTMLAnchorElement>;
23
31
  /** @figmaProp none — test hook */
@@ -34,9 +42,10 @@ export type StyledLinkProps = Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'onC
34
42
  * @param content - content of the link - deprecated, has conflicts with HTMLAnchorElement content option
35
43
  * @param contentNode - content of the link
36
44
  * @param disabled = disabled
37
- * @param size - 'large' | 'small'
45
+ * @param size - 'large' (Base, 16/24) | 'medium' (Helper, 14/20); deprecated: 'small' → large, 'xs' → medium
38
46
  * @param refLink - ref to component
39
47
  * @param dataTest - data-test tag
40
48
  * @param classTest - test jsDoc
41
49
  */
42
50
  export declare const StyledLink: React.FC<StyledLinkProps>;
51
+ export {};
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "3.123.1",
6
+ "version": "3.124.0",
7
7
  "type": "module",
8
8
  "sideEffects": [
9
9
  "**/*.css",