asma-ui-core 3.105.0 → 3.107.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.
Files changed (72) hide show
  1. package/dist/asma-ui-core.css +1 -1
  2. package/dist/components/custom/module/header-layout/DynamicToolbar.js +99 -97
  3. package/dist/components/custom/module/header-layout/ToolbarActionGroup.js +60 -41
  4. package/dist/components/custom/module/header-layout/ToolbarRows.js +51 -47
  5. package/dist/components/custom/module/header-layout/useTranslations.js +12 -10
  6. package/dist/components/custom/page/page-header/PageHeader.js +41 -40
  7. package/dist/components/custom/widget/widget/StyledWidget.js +21 -20
  8. package/dist/components/data-display/chip/StyledChip.js +70 -53
  9. package/dist/components/data-display/tooltip/StyledTooltip.js +116 -73
  10. package/dist/components/feedback/dialog/DialogBusyContext.js +32 -0
  11. package/dist/components/feedback/dialog/StyledDialog.js +81 -72
  12. package/dist/components/feedback/dialog/dialog-footer/StyledDialogFooter.js +76 -71
  13. package/dist/components/feedback/minimizable-dialog/MinimizableDialog.js +133 -137
  14. package/dist/components/feedback/minimizable-dialog/components/CloseBtn.js +11 -8
  15. package/dist/components/feedback/minimizable-dialog/components/FullscreenBtn.js +6 -6
  16. package/dist/components/feedback/minimizable-dialog/components/MinimizeBtn.js +1 -1
  17. package/dist/components/feedback/minimizable-dialog/v2/MinimizableDialogV2.js +108 -88
  18. package/dist/components/feedback/minimizable-dialog/v2/useTranslations.js +6 -4
  19. package/dist/components/inputs/button/StyledButton.js +83 -33
  20. package/dist/components/inputs/button/StyledButton.module.js +13 -13
  21. package/dist/components/inputs/dynamic-select/components/DynamicInteractiveChipGroup.js +32 -32
  22. package/dist/components/inputs/dynamic-select/components/DynamicSelectAutocomplete.js +6 -6
  23. package/dist/components/inputs/select/StyledSelect.js +8 -8
  24. package/dist/components/inputs/select-autocomplete/StyledSelectAutocomplete.js +14 -14
  25. package/dist/components/navigation/link/StyledLink.js +53 -26
  26. package/dist/components/navigation/link/StyledLink.module.js +6 -6
  27. package/dist/components/navigation/menu/StyledMenuItem.js +35 -30
  28. package/dist/components/navigation/tabs/StyledTab.js +23 -25
  29. package/dist/components/utils/bottom-sheet/StyledBottomSheet.js +6 -6
  30. package/dist/components/utils/copy-wrapper/CopyButton.js +4 -4
  31. package/dist/components/utils/copy-wrapper/CopyWrapper.js +4 -4
  32. package/dist/datetime/components/date-picker/components/BaseDatePickerInput.js +66 -56
  33. package/dist/datetime/components/date-picker/components/DatePickerInputSingle.js +13 -12
  34. package/dist/datetime/components/time-picker/TimePickerInput.js +47 -39
  35. package/dist/datetime/helpers/getTitleLabelling.js +10 -0
  36. package/dist/datetime/shared-components/button/StyledButton.module.js +11 -11
  37. package/dist/helpers/focusable.js +2 -2
  38. package/dist/index.js +589 -585
  39. package/dist/src/components/custom/module/header-layout/ToolbarActionGroup.d.ts +13 -2
  40. package/dist/src/components/custom/module/header-layout/ToolbarRows.d.ts +2 -1
  41. package/dist/src/components/custom/module/header-layout/planToolbarActions.d.ts +18 -1
  42. package/dist/src/components/custom/module/header-layout/useTranslations.d.ts +2 -0
  43. package/dist/src/components/custom/widget/widget/StyledWidget.d.ts +5 -0
  44. package/dist/src/components/data-display/chip/StyledChip.d.ts +6 -0
  45. package/dist/src/components/data-display/interactive-chip/StyledInteractiveChip.d.ts +7 -1
  46. package/dist/src/components/data-display/tooltip/StyledTooltip.d.ts +16 -2
  47. package/dist/src/components/feedback/dialog/DialogBusy.test.d.ts +1 -0
  48. package/dist/src/components/feedback/dialog/DialogBusyContext.d.ts +28 -0
  49. package/dist/src/components/feedback/dialog/StyledDialog.d.ts +5 -0
  50. package/dist/src/components/feedback/dialog/dialog-footer/StyledDialogFooter.d.ts +9 -8
  51. package/dist/src/components/feedback/dialog/index.d.ts +1 -0
  52. package/dist/src/components/feedback/minimizable-dialog/components/CloseBtn.d.ts +2 -0
  53. package/dist/src/components/feedback/minimizable-dialog/types.d.ts +11 -0
  54. package/dist/src/components/feedback/minimizable-dialog/v2/types.d.ts +2 -0
  55. package/dist/src/components/feedback/minimizable-dialog/v2/useTranslations.d.ts +2 -0
  56. package/dist/src/components/inputs/button/StyledButton.d.ts +25 -1
  57. package/dist/src/components/inputs/button/StyledButtonBusy.test.d.ts +1 -0
  58. package/dist/src/components/navigation/link/StyledLink.d.ts +6 -0
  59. package/dist/src/components/navigation/menu/StyledMenuItem.d.ts +8 -1
  60. package/dist/src/components/navigation/tabs/StyledTab.d.ts +6 -0
  61. package/dist/src/datetime/components/date-picker/components/BaseDatePickerInput.d.ts +2 -0
  62. package/dist/src/datetime/components/date-picker/types.d.ts +6 -0
  63. package/dist/src/datetime/components/time-picker/types.d.ts +6 -1
  64. package/dist/src/datetime/helpers/getTitleLabelling.d.ts +12 -0
  65. package/dist/src/forms/submitChanged.d.ts +3 -0
  66. package/dist/src/helpers/focusable.d.ts +8 -0
  67. package/dist/src/helpers/index.d.ts +1 -0
  68. package/dist/src/helpers/uiCoreLocale.d.ts +1 -0
  69. package/dist/src/table/shared-components/StyledMenuItem.d.ts +5 -1
  70. package/dist/table/components/columns/action-column/components/RowActionMenu.js +63 -69
  71. package/dist/table/shared-components/StyledMenuItem.js +28 -16
  72. package/package.json +1 -1
@@ -1,54 +1,55 @@
1
- import { cn as f } from "../../../../helpers/cn.js";
2
- import { CloseIcon as T } from "../../../icons/close-icon/CloseIcon.js";
3
- import { StyledButton as b } from "../../../inputs/button/StyledButton.js";
4
- import { ToolbarActionGroup as c, hasPlannedActions as u } from "./ToolbarActionGroup.js";
5
- import { formatSelectionLabel as j } from "./useTranslations.js";
6
- import { StyledWidgetTitle as k } from "../../widget/widget-title/StyledWidgetTitle.js";
1
+ import { cn as h } from "../../../../helpers/cn.js";
2
+ import { CloseIcon as j } from "../../../icons/close-icon/CloseIcon.js";
3
+ import { StyledButton as k } from "../../../inputs/button/StyledButton.js";
4
+ import { ToolbarActionGroup as c, hasPlannedActions as f } from "./ToolbarActionGroup.js";
5
+ import { formatSelectionLabel as b } from "./useTranslations.js";
6
+ import { StyledWidgetTitle as I } from "../../widget/widget-title/StyledWidgetTitle.js";
7
7
  import { Fragment as o, jsx as i, jsxs as r } from "react/jsx-runtime";
8
- function I({ selectedCount: e, onClearSelection: n, translations: t }) {
8
+ function F({ selectedCount: e, onClearSelection: n, translations: t }) {
9
9
  return /* @__PURE__ */ i("div", {
10
10
  className: "flex shrink-0 items-center whitespace-nowrap",
11
11
  "aria-live": "polite",
12
12
  "aria-atomic": "true",
13
- children: /* @__PURE__ */ i(b, {
13
+ children: /* @__PURE__ */ i(k, {
14
14
  dataTest: "dynamic-toolbar-clear-selection",
15
15
  variant: "text",
16
16
  className: "!min-w-0 !px-1 !font-semibold",
17
- startIcon: n ? /* @__PURE__ */ i(T, {
17
+ startIcon: n ? /* @__PURE__ */ i(j, {
18
18
  width: 20,
19
19
  height: 20
20
20
  }) : void 0,
21
21
  onClick: n,
22
22
  "aria-label": t.clearSelection,
23
- children: j(e, t)
23
+ children: b(e, t)
24
24
  })
25
25
  });
26
26
  }
27
- function z({ selectedCount: e, onClearSelection: n, translations: t, bulkActionsPlan: l }) {
27
+ function D({ selectedCount: e, onClearSelection: n, translations: t, bulkActionsPlan: l }) {
28
28
  return /* @__PURE__ */ r("div", {
29
29
  className: "flex w-full min-w-0 flex-nowrap items-center justify-between gap-3",
30
- children: [/* @__PURE__ */ i(I, {
30
+ children: [/* @__PURE__ */ i(F, {
31
31
  selectedCount: e,
32
32
  onClearSelection: n,
33
33
  translations: t
34
34
  }), /* @__PURE__ */ i(c, {
35
35
  plan: l,
36
36
  overflowMenuLabel: t.more,
37
+ inProgressLabel: t.inProgress,
37
38
  selectionTone: !0
38
39
  })]
39
40
  });
40
41
  }
41
- function N({ search: e, expanded: n, measureRef: t }) {
42
+ function S({ search: e, expanded: n, measureRef: t }) {
42
43
  return /* @__PURE__ */ i("div", {
43
44
  ref: n ? void 0 : t,
44
45
  style: n ? { "--dynamic-toolbar-search-width": "100%" } : void 0,
45
- className: f(n ? "min-w-0 flex-1" : "w-40 shrink-0"),
46
+ className: h(n ? "min-w-0 flex-1" : "w-40 shrink-0"),
46
47
  children: e
47
48
  });
48
49
  }
49
- function S({ visible: e, children: n }) {
50
+ function g({ visible: e, children: n }) {
50
51
  return /* @__PURE__ */ i("div", {
51
- className: f("overflow-hidden whitespace-nowrap transition-[max-width,opacity] duration-200 ease-in-out", e ? "max-w-[2000px] opacity-100" : "pointer-events-none max-w-0 opacity-0"),
52
+ className: h("overflow-hidden whitespace-nowrap transition-[max-width,opacity] duration-200 ease-in-out", e ? "max-w-[2000px] opacity-100" : "pointer-events-none max-w-0 opacity-0"),
52
53
  "aria-hidden": !e,
53
54
  children: /* @__PURE__ */ i("div", {
54
55
  className: "inline-flex items-center gap-2",
@@ -56,8 +57,8 @@ function S({ visible: e, children: n }) {
56
57
  })
57
58
  });
58
59
  }
59
- function F({ title: e, measureRef: n }) {
60
- return typeof e == "string" ? /* @__PURE__ */ i(k, {
60
+ function C({ title: e, measureRef: n }) {
61
+ return typeof e == "string" ? /* @__PURE__ */ i(I, {
61
62
  ref: n,
62
63
  className: "!min-w-0 truncate",
63
64
  children: e
@@ -67,10 +68,10 @@ function F({ title: e, measureRef: n }) {
67
68
  children: e
68
69
  });
69
70
  }
70
- function D({ title: e, helperText: n, titleMeasureRef: t }) {
71
+ function E({ title: e, helperText: n, titleMeasureRef: t }) {
71
72
  return !e && !n ? null : /* @__PURE__ */ r("div", {
72
73
  className: "min-w-0 max-w-full",
73
- children: [e && /* @__PURE__ */ i(F, {
74
+ children: [e && /* @__PURE__ */ i(C, {
74
75
  title: e,
75
76
  measureRef: t
76
77
  }), n && /* @__PURE__ */ i("div", {
@@ -79,58 +80,61 @@ function D({ title: e, helperText: n, titleMeasureRef: t }) {
79
80
  })]
80
81
  });
81
82
  }
82
- function E({ variant: e, beforeFilterActionsPlan: n, filter: t, search: l, afterSearchActionsPlan: h, bulkActionsPlan: a, showPageActions: p, overflowMenuLabel: s, searchMeasureRef: g, align: B = "end" }) {
83
- const m = p && u(n), d = p && u(h), w = e === "inline-selection" && u(a);
84
- if (!(t != null || l != null) && !m && !d && !w) return null;
85
- const x = m ? /* @__PURE__ */ i(S, {
86
- visible: m,
83
+ function H({ variant: e, beforeFilterActionsPlan: n, filter: t, search: l, afterSearchActionsPlan: p, bulkActionsPlan: a, showPageActions: w, overflowMenuLabel: s, inProgressLabel: m, searchMeasureRef: B, align: T = "end" }) {
84
+ const d = w && f(n), u = w && f(p), x = e === "inline-selection" && f(a);
85
+ if (!(t != null || l != null) && !d && !u && !x) return null;
86
+ const v = d ? /* @__PURE__ */ i(g, {
87
+ visible: d,
87
88
  children: /* @__PURE__ */ i(c, {
88
89
  plan: n,
89
- overflowMenuLabel: s
90
+ overflowMenuLabel: s,
91
+ inProgressLabel: m
90
92
  })
91
- }) : null, v = d ? /* @__PURE__ */ i(S, {
92
- visible: d,
93
+ }) : null, y = u ? /* @__PURE__ */ i(g, {
94
+ visible: u,
93
95
  children: /* @__PURE__ */ i("div", {
94
96
  className: "flex flex-nowrap items-center gap-2",
95
97
  children: /* @__PURE__ */ i(c, {
96
- plan: h,
97
- overflowMenuLabel: s
98
+ plan: p,
99
+ overflowMenuLabel: s,
100
+ inProgressLabel: m
98
101
  })
99
102
  })
100
- }) : null, y = /* @__PURE__ */ r(o, { children: [t, l != null && /* @__PURE__ */ i(N, {
103
+ }) : null, N = /* @__PURE__ */ r(o, { children: [t, l != null && /* @__PURE__ */ i(S, {
101
104
  search: l,
102
- measureRef: g
105
+ measureRef: B
103
106
  })] });
104
107
  return /* @__PURE__ */ r("div", {
105
- className: f("flex w-full min-w-0 flex-nowrap items-center gap-2", B === "end" ? "justify-end" : "justify-start"),
108
+ className: h("flex w-full min-w-0 flex-nowrap items-center gap-2", T === "end" ? "justify-end" : "justify-start"),
106
109
  children: [
107
- e === "inline-selection" && /* @__PURE__ */ r(o, { children: [w && a && /* @__PURE__ */ i(c, {
110
+ e === "inline-selection" && /* @__PURE__ */ r(o, { children: [x && a && /* @__PURE__ */ i(c, {
108
111
  plan: a,
109
112
  overflowMenuLabel: s,
113
+ inProgressLabel: m,
110
114
  selectionTone: !0
111
- }), y] }),
115
+ }), N] }),
112
116
  e === "inline-normal" && /* @__PURE__ */ r(o, { children: [
113
- x,
114
- y,
115
- v
117
+ v,
118
+ N,
119
+ y
116
120
  ] }),
117
121
  e === "utility-row" && /* @__PURE__ */ r(o, { children: [
118
- x,
119
- l != null && /* @__PURE__ */ i(N, {
122
+ v,
123
+ l != null && /* @__PURE__ */ i(S, {
120
124
  search: l,
121
125
  expanded: !0
122
126
  }),
123
127
  t,
124
- v
128
+ y
125
129
  ] })
126
130
  ]
127
131
  });
128
132
  }
129
133
  export {
130
- N as SearchSlot,
131
- I as SelectionIndicator,
132
- z as SelectionRow,
133
- D as TitleBlock,
134
- F as TitleText,
135
- E as UtilityCluster
134
+ S as SearchSlot,
135
+ F as SelectionIndicator,
136
+ D as SelectionRow,
137
+ E as TitleBlock,
138
+ C as TitleText,
139
+ H as UtilityCluster
136
140
  };
@@ -1,12 +1,13 @@
1
- import { useMemo as r } from "react";
2
- var n = {
1
+ import { useMemo as o } from "react";
2
+ var r = {
3
3
  en: {
4
4
  more: "More",
5
5
  clearSelection: "Clear selection",
6
6
  selected: "selected",
7
7
  back: "Back",
8
8
  menu: "Menu",
9
- close: "Close"
9
+ close: "Close",
10
+ inProgress: "In progress"
10
11
  },
11
12
  no: {
12
13
  more: "Mer",
@@ -14,16 +15,17 @@ var n = {
14
15
  selected: "valgt",
15
16
  back: "Tilbake",
16
17
  menu: "Meny",
17
- close: "Lukk"
18
+ close: "Lukk",
19
+ inProgress: "Pågår"
18
20
  }
19
21
  };
20
- function t(e = "en") {
21
- return r(() => n[e] ?? n.en, [e]);
22
+ function l(e = "en") {
23
+ return o(() => r[e] ?? r.en, [e]);
22
24
  }
23
- function a(e, o) {
24
- return `${e} ${o.selected}`;
25
+ function t(e, n) {
26
+ return `${e} ${n.selected}`;
25
27
  }
26
28
  export {
27
- a as formatSelectionLabel,
28
- t as useToolbarTranslations
29
+ t as formatSelectionLabel,
30
+ l as useToolbarTranslations
29
31
  };
@@ -9,24 +9,24 @@ import { planToolbarActions as ce } from "../../module/header-layout/planToolbar
9
9
  import { ToolbarActionButton as de, ToolbarActionGroup as me } from "../../module/header-layout/ToolbarActionGroup.js";
10
10
  import { useToolbarTranslations as ue } from "../../module/header-layout/useTranslations.js";
11
11
  import { KEY_MORE_BUTTON as he, ToolbarMeasurementStrip as fe, actionKey as z } from "../../module/header-layout/ToolbarMeasurement.js";
12
- import { useIsTitleClamped as pe, useSearchFocus as xe, useStickyScrollPadding as ge, useStuckOnScroll as be } from "./PageHeader.hooks.js";
12
+ import { useIsTitleClamped as pe, useSearchFocus as ge, useStickyScrollPadding as xe, useStuckOnScroll as be } from "./PageHeader.hooks.js";
13
13
  import { useMemo as G, useRef as E } from "react";
14
- import { Fragment as ve, jsx as e, jsxs as s } from "react/jsx-runtime";
14
+ import { Fragment as ve, jsx as e, jsxs as r } from "react/jsx-runtime";
15
15
  import { useMergeRefs as we } from "@floating-ui/react";
16
- var Ne = 744, Te = 8, Ae = 32, Le = 120, Me = (t) => {
17
- const { badgeCount: r, ...o } = t, a = {
16
+ var Ne = 744, Te = 8, Ae = 32, Le = 120, Pe = (t) => {
17
+ const { badgeCount: c, ...o } = t, a = {
18
18
  ...o,
19
19
  canHideLabel: o.icon != null && o.canHideLabel !== !1
20
20
  };
21
- if (r == null || a.render) return a;
22
- const l = `${a.label} (${r})`;
21
+ if (c == null || a.render) return a;
22
+ const l = `${a.label} (${c})`;
23
23
  return {
24
24
  ...a,
25
25
  label: l,
26
26
  ariaLabel: l,
27
27
  render: ({ showLabel: u }) => /* @__PURE__ */ e(le, {
28
28
  dataTest: `${a.dataTest ?? `page-header-action-${a.id}`}-badge`,
29
- badgeContent: r,
29
+ badgeContent: c,
30
30
  statusMessage: l,
31
31
  slotProps: { badge: { style: {
32
32
  right: -8,
@@ -43,50 +43,50 @@ var Ne = 744, Te = 8, Ae = 32, Le = 120, Me = (t) => {
43
43
  })
44
44
  };
45
45
  };
46
- function Pe({ compact: t }) {
47
- return /* @__PURE__ */ s("div", {
46
+ function Me({ compact: t }) {
47
+ return /* @__PURE__ */ r("div", {
48
48
  className: "flex w-full min-w-0 items-center justify-between gap-2",
49
49
  "aria-hidden": !0,
50
50
  children: [/* @__PURE__ */ e("div", { className: m("animate-pulse rounded bg-delta-100", t ? "h-6 w-3/5" : "h-8 w-2/5 max-w-[500px]") }), /* @__PURE__ */ e("div", { className: "h-10 w-14 shrink-0 animate-pulse rounded bg-delta-100" })]
51
51
  });
52
52
  }
53
- function Ye({ title: t, titleAs: r = "h1", titleDataTest: o, titleRef: a, subtitle: l, status: u, leading: h, onLeadingClick: I, leadingLabel: X, leadingSlot: W, actions: k = [], search: w, searchOpen: y = !1, onSearchClose: Y, searchCloseLabel: F, loading: f = !1, sticky: p = !1, locale: D = "en", className: U, dataTest: x = "page-header" }) {
54
- const c = ue(D), { ref: S, widthPx: N } = se(), { register: g, widths: i } = re(), T = E(null), C = E(null), B = E(null), n = N > 0 && N < Ne, V = we([T, a]), A = y && w != null, b = f || A;
55
- xe(w != null, y, B, T);
53
+ function Ye({ title: t, titleAs: c = "h1", titleDataTest: o, titleRef: a, subtitle: l, status: u, leading: h, onLeadingClick: I, leadingLabel: X, leadingSlot: W, actions: k = [], search: w, searchOpen: y = !1, onSearchClose: Y, searchCloseLabel: F, loading: f = !1, sticky: p = !1, locale: D = "en", className: U, dataTest: g = "page-header" }) {
54
+ const i = ue(D), { ref: S, widthPx: N } = se(), { register: x, widths: s } = re(), T = E(null), C = E(null), B = E(null), n = N > 0 && N < Ne, V = we([T, a]), A = y && w != null, b = f || A;
55
+ ge(w != null, y, B, T);
56
56
  const v = be(p, C);
57
- ge(p, S);
58
- const Z = pe(T, t, !b), L = G(() => k.filter((d) => !d.hidden).map(Me), [k]), $ = Math.max(0, N - Ae), H = h != null || W != null, M = u != null, q = H ? i["slot:leading"] ?? 0 : 0, J = M ? i["slot:status"] ?? 0 : 0, Q = i.title ?? 0, ee = Math.max(Le, Math.min(Q, Math.floor($ * 0.5))), te = 1 + (H ? 1 : 0) + (M ? 1 : 0), K = Math.max(0, $ - q - J - ee - Te * te), ae = G(() => ce({
57
+ xe(p, S);
58
+ const Z = pe(T, t, !b), L = G(() => k.filter((d) => !d.hidden).map(Pe), [k]), $ = Math.max(0, N - Ae), H = h != null || W != null, P = u != null, q = H ? s["slot:leading"] ?? 0 : 0, J = P ? s["slot:status"] ?? 0 : 0, Q = s.title ?? 0, ee = Math.max(Le, Math.min(Q, Math.floor($ * 0.5))), te = 1 + (H ? 1 : 0) + (P ? 1 : 0), K = Math.max(0, $ - q - J - ee - Te * te), ae = G(() => ce({
59
59
  actions: L,
60
60
  availableWidth: K,
61
61
  collapseLabels: !0,
62
- resolveActionWidth: (d, R) => i[z(d.id, R)],
63
- moreButtonWidthPx: i[he]
62
+ resolveActionWidth: (d, R) => s[z(d.id, R)],
63
+ moreButtonWidthPx: s[he]
64
64
  }), [
65
65
  L,
66
66
  K,
67
- i
68
- ]), P = X ?? (h === "menu" ? c.menu : c.back), O = W ?? (h === "menu" ? /* @__PURE__ */ e(_, {
69
- dataTest: `${x}-menu`,
67
+ s
68
+ ]), M = X ?? (h === "menu" ? i.menu : i.back), O = W ?? (h === "menu" ? /* @__PURE__ */ e(_, {
69
+ dataTest: `${g}-menu`,
70
70
  variant: "text",
71
71
  size: "large",
72
72
  onClick: I,
73
- "aria-label": P,
73
+ "aria-label": M,
74
74
  startIcon: /* @__PURE__ */ e(oe, {
75
75
  width: 24,
76
76
  height: 24
77
77
  })
78
78
  }) : h === "back" ? /* @__PURE__ */ e(_, {
79
- dataTest: `${x}-back`,
79
+ dataTest: `${g}-back`,
80
80
  variant: n ? "text" : "outlined",
81
81
  size: "large",
82
82
  onClick: I,
83
- "aria-label": n ? P : void 0,
83
+ "aria-label": n ? M : void 0,
84
84
  startIcon: /* @__PURE__ */ e(ie, {
85
85
  width: n ? 24 : 20,
86
86
  height: n ? 24 : 20
87
87
  }),
88
- children: n ? void 0 : P
89
- }) : null), j = n || v, ne = t === "" ? null : /* @__PURE__ */ e(r, {
88
+ children: n ? void 0 : M
89
+ }) : null), j = n || v, ne = t === "" ? null : /* @__PURE__ */ e(c, {
90
90
  ref: V,
91
91
  tabIndex: -1,
92
92
  "data-test": o,
@@ -95,14 +95,14 @@ function Ye({ title: t, titleAs: r = "h1", titleDataTest: o, titleRef: a, subtit
95
95
  className: m("m-0 line-clamp-2 min-w-0 break-words font-semibold text-delta-800 outline-none", j ? "text-xl leading-7" : "text-2xl leading-8"),
96
96
  children: t
97
97
  });
98
- return /* @__PURE__ */ s(ve, { children: [p && /* @__PURE__ */ e("div", {
98
+ return /* @__PURE__ */ r(ve, { children: [p && /* @__PURE__ */ e("div", {
99
99
  ref: C,
100
100
  "aria-hidden": !0,
101
101
  className: "h-px w-full",
102
102
  style: { marginBottom: -1 }
103
- }), /* @__PURE__ */ s("div", {
103
+ }), /* @__PURE__ */ r("div", {
104
104
  ref: S,
105
- "data-testid": x,
105
+ "data-testid": g,
106
106
  "data-compact": n ? "true" : "false",
107
107
  "data-stuck": v ? "true" : "false",
108
108
  "aria-busy": f || void 0,
@@ -110,22 +110,22 @@ function Ye({ title: t, titleAs: r = "h1", titleDataTest: o, titleRef: a, subtit
110
110
  children: [
111
111
  /* @__PURE__ */ e(fe, {
112
112
  actions: L,
113
- register: g,
114
- overflowMenuLabel: c.more,
113
+ register: x,
114
+ overflowMenuLabel: i.more,
115
115
  title: t,
116
116
  titleClassName: m("font-semibold", j ? "text-xl leading-7" : "text-2xl leading-8")
117
117
  }),
118
118
  O != null && /* @__PURE__ */ e("span", {
119
- ref: g("slot:leading"),
119
+ ref: x("slot:leading"),
120
120
  className: "inline-flex shrink-0",
121
121
  children: O
122
122
  }),
123
- /* @__PURE__ */ s("div", {
123
+ /* @__PURE__ */ r("div", {
124
124
  className: m(b ? "sr-only" : "flex min-w-0 flex-1 flex-col justify-center"),
125
- children: [/* @__PURE__ */ s("div", {
125
+ children: [/* @__PURE__ */ r("div", {
126
126
  className: "flex min-w-0 items-center gap-2",
127
- children: [ne, M && !b && /* @__PURE__ */ e("span", {
128
- ref: g("slot:status"),
127
+ children: [ne, P && !b && /* @__PURE__ */ e("span", {
128
+ ref: x("slot:status"),
129
129
  className: "inline-flex shrink-0 items-center",
130
130
  children: u
131
131
  })]
@@ -134,25 +134,26 @@ function Ye({ title: t, titleAs: r = "h1", titleDataTest: o, titleRef: a, subtit
134
134
  children: l
135
135
  })]
136
136
  }),
137
- f && /* @__PURE__ */ e(Pe, { compact: n }),
138
- A && /* @__PURE__ */ s("div", {
137
+ f && /* @__PURE__ */ e(Me, { compact: n }),
138
+ A && /* @__PURE__ */ r("div", {
139
139
  ref: B,
140
140
  className: "flex w-full min-w-0 items-center gap-2",
141
141
  children: [/* @__PURE__ */ e("div", {
142
142
  className: "min-w-0 flex-1",
143
143
  children: w
144
144
  }), /* @__PURE__ */ e(_, {
145
- dataTest: `${x}-search-close`,
145
+ dataTest: `${g}-search-close`,
146
146
  variant: "text",
147
147
  size: "large",
148
148
  onClick: Y,
149
- children: F ?? c.close
149
+ children: F ?? i.close
150
150
  })]
151
151
  }),
152
152
  !f && !A && /* @__PURE__ */ e(me, {
153
153
  plan: ae,
154
- overflowMenuLabel: c.more,
155
- registerActionWidth: (d, R) => g(z(d, R))
154
+ overflowMenuLabel: i.more,
155
+ inProgressLabel: i.inProgress,
156
+ registerActionWidth: (d, R) => x(z(d, R))
156
157
  })
157
158
  ]
158
159
  })] });
@@ -1,23 +1,23 @@
1
- import v from "../icons/ChevronDownIcon.js";
2
- import { StyledButton as x } from "../../../inputs/button/StyledButton.js";
1
+ import x from "../icons/ChevronDownIcon.js";
2
+ import { StyledButton as v } from "../../../inputs/button/StyledButton.js";
3
3
  import { StyledEmptyPage as y } from "../../../feedback/empty-page/StyledEmptyPage.js";
4
4
  import { StyledLoading as C } from "../../../feedback/loading/StyledLoading.js";
5
5
  import { StyledLink as N } from "../../../navigation/link/StyledLink.js";
6
- import { StyledWidgetTitle as I } from "../widget-title/StyledWidgetTitle.js";
6
+ import { StyledWidgetTitle as b } from "../widget-title/StyledWidgetTitle.js";
7
7
  import d from "./StyledWidget.module.js";
8
- import T from "../icons/ChevronUpIcon.js";
9
- import { useState as $ } from "react";
10
- import { Fragment as L, jsx as e, jsxs as a } from "react/jsx-runtime";
11
- var P = ({ children: l, title: m, titleNode: c, icon: s, link: i, viewMore: t, persistKey: o, isLoading: h, isEmpty: n, emptyText: g, headerRight: f, headerRightClassName: p }) => {
12
- const [r, u] = $(() => o ? localStorage.getItem(o) === "true" : !1), S = !!i && !i.hide, w = !!t && !t.hide;
13
- return /* @__PURE__ */ a("div", {
8
+ import I from "../icons/ChevronUpIcon.js";
9
+ import { useState as T } from "react";
10
+ import { Fragment as $, jsx as e, jsxs as r } from "react/jsx-runtime";
11
+ var E = ({ children: l, title: m, titleNode: s, icon: c, link: i, viewMore: t, persistKey: o, isLoading: h, isEmpty: n, emptyText: g, headerRight: f, headerRightClassName: p }) => {
12
+ const [a, u] = T(() => o ? localStorage.getItem(o) === "true" : !1), S = !!i && !i.hide, w = !!t && !t.hide;
13
+ return /* @__PURE__ */ r("div", {
14
14
  className: `${d["asma-ui-core-styled-widget"]} ${n ? d["empty-state"] : ""}`,
15
15
  children: [
16
- /* @__PURE__ */ a("div", {
16
+ /* @__PURE__ */ r("div", {
17
17
  className: d["widget-header-left"],
18
18
  children: [
19
- s,
20
- c ?? /* @__PURE__ */ e(I, { children: m }),
19
+ c,
20
+ s ?? /* @__PURE__ */ e(b, { children: m }),
21
21
  /* @__PURE__ */ e("div", {
22
22
  className: `${d["widget-header-right"]} ${p ?? ""}`,
23
23
  children: f
@@ -26,7 +26,7 @@ var P = ({ children: l, title: m, titleNode: c, icon: s, link: i, viewMore: t, p
26
26
  }),
27
27
  /* @__PURE__ */ e("div", {
28
28
  className: d["widget-content"],
29
- children: /* @__PURE__ */ a(L, { children: [
29
+ children: /* @__PURE__ */ r($, { children: [
30
30
  l,
31
31
  /* @__PURE__ */ e(C, { isLoading: h }),
32
32
  /* @__PURE__ */ e(y, {
@@ -35,23 +35,24 @@ var P = ({ children: l, title: m, titleNode: c, icon: s, link: i, viewMore: t, p
35
35
  })
36
36
  ] })
37
37
  }),
38
- w && /* @__PURE__ */ a("div", {
38
+ w && /* @__PURE__ */ r("div", {
39
39
  className: d["widget-footer"],
40
- children: [t.hide ? /* @__PURE__ */ e("div", {}) : /* @__PURE__ */ e(x, {
40
+ children: [t.hide ? /* @__PURE__ */ e("div", {}) : /* @__PURE__ */ e(v, {
41
41
  disabled: t.disabled,
42
+ disabledReason: t.disabledReason,
42
43
  dataTest: "view-more",
43
44
  variant: "text",
44
- endIcon: r ? /* @__PURE__ */ e(T, {
45
+ endIcon: a ? /* @__PURE__ */ e(I, {
45
46
  width: 20,
46
47
  height: 20
47
- }) : /* @__PURE__ */ e(v, {
48
+ }) : /* @__PURE__ */ e(x, {
48
49
  width: 20,
49
50
  height: 20
50
51
  }),
51
52
  onClick: () => {
52
- u(!r), o && localStorage.setItem(o, String(!r)), t.onClick?.();
53
+ u(!a), o && localStorage.setItem(o, String(!a)), t.onClick?.();
53
54
  },
54
- children: r ? t.viewLessText : t.viewMoreText
55
+ children: a ? t.viewLessText : t.viewMoreText
55
56
  }), S ? /* @__PURE__ */ e(N, {
56
57
  dataTest: "go-to-button",
57
58
  className: d["widget-link"],
@@ -65,5 +66,5 @@ var P = ({ children: l, title: m, titleNode: c, icon: s, link: i, viewMore: t, p
65
66
  });
66
67
  };
67
68
  export {
68
- P as StyledWidget
69
+ E as StyledWidget
69
70
  };
@@ -1,68 +1,85 @@
1
- import { cn as i } from "../../../helpers/cn.js";
2
- import { resolveSx as L } from "../../../helpers/sx.js";
3
- import { CloseIcon as U } from "../../icons/close-icon/CloseIcon.js";
4
- import { consumerOverrides as b } from "../../../helpers/classOverride.js";
5
- import { getChipPadding as q } from "./chipPadding.js";
6
- import A from "./StyledChip.module.js";
7
- import { forwardRef as F } from "react";
8
- import { jsx as p, jsxs as G } from "react/jsx-runtime";
9
- var oo = F(({ dataTest: v, label: l, size: r = "medium", disabled: o, readOnly: t, clickable: x, icon: _, avatar: w, deleteIcon: y, onDelete: h, onClick: n, onMouseDown: S, onMouseUp: k, className: s, classes: a, sx: j, tabIndex: u, deleteButtonTabIndex: D, "aria-label": R, role: f, "aria-checked": B, "aria-readonly": C, "data-hovered": M, "data-focus": N, variant: H, color: J }, I) => {
10
- const d = !t && !o && (!!x || !!n), m = !t && !!o && (!!x || !!n), g = w ?? _, c = q(r, !!g, !!(h && !t)), K = {
11
- paddingTop: c.top,
12
- paddingRight: c.right,
13
- paddingBottom: c.bottom,
14
- paddingLeft: c.left
15
- }, P = (e) => {
16
- e.stopPropagation(), h?.(e);
17
- }, W = (e) => {
18
- d && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), n?.(e));
19
- }, $ = b(s, "width"), E = b(s, "max-width");
20
- return /* @__PURE__ */ G("div", {
21
- ref: I,
22
- "data-testid": v,
23
- "aria-label": R,
24
- "data-hovered": M,
25
- "data-focus": N,
26
- role: f ?? (d || m ? "button" : void 0),
27
- "aria-checked": f ? B : void 0,
28
- "aria-readonly": f ? C : void 0,
29
- "aria-disabled": m ? !0 : void 0,
30
- tabIndex: m ? u ?? 0 : t || o ? void 0 : d ? u ?? 0 : u,
31
- onClick: o || t ? void 0 : n,
32
- onKeyDown: o || t ? void 0 : W,
33
- onMouseDown: o || t ? void 0 : S,
34
- onMouseUp: o || t ? void 0 : k,
35
- className: i("box-border inline-flex items-center gap-1 rounded-[25px] border border-solid border-delta-300 bg-white text-base text-delta-700", !$ && "w-fit", !E && "max-w-full", r === "small" ? "h-6" : "h-8", t && "pointer-events-none", o && "opacity-[0.38]", o && (m ? "cursor-not-allowed" : "pointer-events-none"), d && i("cursor-pointer outline-none", "asma-touch-ready", "data-[hovered]:border-gama-200 data-[hovered]:bg-gama-25 hover:border-gama-200 hover:bg-gama-25", "active:!border-gama-400 active:bg-gama-25 active:shadow-[0_0_0_2px_var(--colors-gama-400)]"), A["focus-ring"], a?.root, s),
1
+ import { cn as c } from "../../../helpers/cn.js";
2
+ import { resolveSx as A } from "../../../helpers/sx.js";
3
+ import { StyledTooltip as F } from "../tooltip/StyledTooltip.js";
4
+ import { CloseIcon as G } from "../../icons/close-icon/CloseIcon.js";
5
+ import { consumerOverrides as y } from "../../../helpers/classOverride.js";
6
+ import { getChipPadding as H } from "./chipPadding.js";
7
+ import J from "./StyledChip.module.js";
8
+ import { forwardRef as Q } from "react";
9
+ import { jsx as m, jsxs as V } from "react/jsx-runtime";
10
+ var X = ({ readOnly: l, disabled: n, interactive: e, focusableDisabled: o, tabIndex: a }) => {
11
+ if (o) return a ?? 0;
12
+ if (!(l || n))
13
+ return e ? a ?? 0 : a;
14
+ }, co = Q(({ dataTest: l, label: n, size: e = "medium", disabled: o, disabledReason: a, readOnly: t, clickable: S, icon: _, avatar: b, deleteIcon: k, onDelete: h, onClick: f, onMouseDown: B, onMouseUp: C, className: u, classes: i, sx: D, tabIndex: j, deleteButtonTabIndex: I, "aria-label": M, role: g, "aria-checked": N, "aria-readonly": R, "data-hovered": T, "data-focus": K, variant: Y, color: Z }, P) => {
15
+ const w = !t && (!!S || !!f), p = w && !o, d = w && !!o, v = d && !!a, x = b ?? _, s = H(e, !!x, !!(h && !t)), W = {
16
+ paddingTop: s.top,
17
+ paddingRight: s.right,
18
+ paddingBottom: s.bottom,
19
+ paddingLeft: s.left
20
+ }, $ = (r) => {
21
+ r.stopPropagation(), h?.(r);
22
+ }, E = (r) => {
23
+ p && (r.key === "Enter" || r.key === " ") && (r.preventDefault(), f?.(r));
24
+ }, L = y(u, "width"), U = y(u, "max-width"), q = /* @__PURE__ */ V("div", {
25
+ ref: P,
26
+ "data-testid": l,
27
+ "aria-label": M,
28
+ "data-hovered": T,
29
+ "data-focus": K,
30
+ role: g ?? (p || d ? "button" : void 0),
31
+ "aria-disabled": d || void 0,
32
+ "aria-checked": g ? N : void 0,
33
+ "aria-readonly": g ? R : void 0,
34
+ tabIndex: X({
35
+ readOnly: t,
36
+ disabled: o,
37
+ interactive: p,
38
+ focusableDisabled: d,
39
+ tabIndex: j
40
+ }),
41
+ onClick: o || t ? void 0 : f,
42
+ onKeyDown: o || t ? void 0 : E,
43
+ onMouseDown: o || t ? void 0 : B,
44
+ onMouseUp: o || t ? void 0 : C,
45
+ className: c("box-border inline-flex items-center gap-1 rounded-[25px] border border-solid border-delta-300 bg-white text-base text-delta-700", !L && "w-fit", !U && "max-w-full", e === "small" ? "h-6" : "h-8", t && "pointer-events-none", o && "opacity-[0.38]", o && (d ? "cursor-not-allowed" : "pointer-events-none"), p && c("cursor-pointer outline-none", "asma-touch-ready", "data-[hovered]:border-gama-200 data-[hovered]:bg-gama-25 hover:border-gama-200 hover:bg-gama-25", "active:!border-gama-400 active:bg-gama-25 active:shadow-[0_0_0_2px_var(--colors-gama-400)]"), J["focus-ring"], i?.root, u),
36
46
  style: {
37
- ...K,
38
- ...L(j)
47
+ ...W,
48
+ ...A(D)
39
49
  },
40
50
  children: [
41
- g && /* @__PURE__ */ p("span", {
42
- className: i("flex shrink-0 items-center justify-center", r === "small" ? "h-[18px] w-[18px]" : "h-6 w-6", w ? a?.avatar : a?.icon),
43
- children: g
51
+ x && /* @__PURE__ */ m("span", {
52
+ className: c("flex shrink-0 items-center justify-center", e === "small" ? "h-[18px] w-[18px]" : "h-6 w-6", b ? i?.avatar : i?.icon),
53
+ children: x
44
54
  }),
45
- /* @__PURE__ */ p("span", {
46
- className: i("min-w-0 truncate", a?.label),
47
- children: l
55
+ /* @__PURE__ */ m("span", {
56
+ className: c("min-w-0 truncate", i?.label),
57
+ children: n
48
58
  }),
49
- h && !t && /* @__PURE__ */ p("button", {
59
+ h && !t && /* @__PURE__ */ m("button", {
50
60
  type: "button",
51
- tabIndex: D,
52
- "data-testid": `${v}-delete`,
53
- "aria-label": typeof l == "string" ? `Remove ${l}` : "Remove",
54
- onClick: P,
61
+ tabIndex: I,
62
+ "data-testid": `${l}-delete`,
63
+ "aria-label": typeof n == "string" ? `Remove ${n}` : "Remove",
64
+ onClick: $,
55
65
  disabled: o,
56
- className: i("flex shrink-0 items-center justify-center rounded-full border border-solid border-delta-100 bg-delta-50 p-0 text-delta-700 [outline:none]", r === "small" ? "h-[18px] w-[18px]" : "h-5 w-5", a?.deleteIcon),
57
- children: y ?? /* @__PURE__ */ p(U, {
58
- height: r === "small" ? 14 : 16,
59
- width: r === "small" ? 14 : 16,
66
+ className: c("flex shrink-0 items-center justify-center rounded-full border border-solid border-delta-100 bg-delta-50 p-0 text-delta-700 [outline:none]", e === "small" ? "h-[18px] w-[18px]" : "h-5 w-5", i?.deleteIcon),
67
+ children: k ?? /* @__PURE__ */ m(G, {
68
+ height: e === "small" ? 14 : 16,
69
+ width: e === "small" ? 14 : 16,
60
70
  className: "min-w-0 shrink-0"
61
71
  })
62
72
  })
63
73
  ]
64
74
  });
75
+ return /* @__PURE__ */ m(F, {
76
+ title: a,
77
+ open: v ? void 0 : !1,
78
+ openOnTap: v,
79
+ persistentDescription: v,
80
+ children: q
81
+ });
65
82
  });
66
83
  export {
67
- oo as StyledChip
84
+ co as StyledChip
68
85
  };