asma-ui-core 3.104.0 → 3.106.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 (70) 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 +62 -43
  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 -52
  9. package/dist/components/data-display/tooltip/StyledTooltip.js +110 -65
  10. package/dist/components/feedback/dialog/DialogBusyContext.js +32 -0
  11. package/dist/components/feedback/dialog/StyledDialog.js +104 -80
  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 +94 -85
  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 +8 -8
  21. package/dist/components/inputs/dynamic-select/components/DynamicInteractiveChipGroup.js +32 -32
  22. package/dist/components/inputs/dynamic-select/components/DynamicSelectAutocomplete.js +91 -82
  23. package/dist/components/inputs/select/StyledSelect.js +8 -8
  24. package/dist/components/inputs/select-autocomplete/StyledSelectAutocomplete.js +152 -152
  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/menu/StyledMenuList.js +47 -38
  29. package/dist/components/navigation/tabs/StyledTab.js +25 -18
  30. package/dist/components/navigation/tabs/StyledTabs.js +33 -33
  31. package/dist/components/utils/bottom-sheet/StyledBottomSheet.js +6 -6
  32. package/dist/components/utils/copy-wrapper/CopyButton.js +4 -4
  33. package/dist/components/utils/copy-wrapper/CopyWrapper.js +4 -4
  34. package/dist/datetime/shared-components/button/StyledButton.module.js +11 -11
  35. package/dist/helpers/focusable.js +4 -3
  36. package/dist/helpers/warnUnnamedDialog.js +6 -0
  37. package/dist/index.js +589 -585
  38. package/dist/src/components/custom/module/header-layout/ToolbarActionGroup.d.ts +13 -2
  39. package/dist/src/components/custom/module/header-layout/ToolbarRows.d.ts +2 -1
  40. package/dist/src/components/custom/module/header-layout/planToolbarActions.d.ts +18 -1
  41. package/dist/src/components/custom/module/header-layout/useTranslations.d.ts +2 -0
  42. package/dist/src/components/custom/widget/widget/StyledWidget.d.ts +5 -0
  43. package/dist/src/components/data-display/chip/StyledChip.d.ts +6 -0
  44. package/dist/src/components/data-display/interactive-chip/StyledInteractiveChip.d.ts +7 -1
  45. package/dist/src/components/data-display/tooltip/StyledTooltip.d.ts +16 -2
  46. package/dist/src/components/feedback/dialog/DialogBusy.test.d.ts +1 -0
  47. package/dist/src/components/feedback/dialog/DialogBusyContext.d.ts +28 -0
  48. package/dist/src/components/feedback/dialog/StyledDialog.d.ts +15 -2
  49. package/dist/src/components/feedback/dialog/dialog-footer/StyledDialogFooter.d.ts +10 -7
  50. package/dist/src/components/feedback/dialog/index.d.ts +1 -0
  51. package/dist/src/components/feedback/minimizable-dialog/components/CloseBtn.d.ts +2 -0
  52. package/dist/src/components/feedback/minimizable-dialog/types.d.ts +11 -0
  53. package/dist/src/components/feedback/minimizable-dialog/v2/types.d.ts +2 -0
  54. package/dist/src/components/feedback/minimizable-dialog/v2/useTranslations.d.ts +2 -0
  55. package/dist/src/components/inputs/button/StyledButton.d.ts +25 -1
  56. package/dist/src/components/inputs/button/StyledButtonBusy.test.d.ts +1 -0
  57. package/dist/src/components/navigation/link/StyledLink.d.ts +6 -0
  58. package/dist/src/components/navigation/menu/StyledMenuItem.d.ts +8 -1
  59. package/dist/src/components/navigation/menu/StyledMenuList.d.ts +2 -1
  60. package/dist/src/components/navigation/tabs/StyledTab.d.ts +17 -1
  61. package/dist/src/forms/submitChanged.d.ts +3 -0
  62. package/dist/src/helpers/focusable.d.ts +9 -0
  63. package/dist/src/helpers/index.d.ts +1 -0
  64. package/dist/src/helpers/uiCoreLocale.d.ts +1 -0
  65. package/dist/src/helpers/warnUnnamedDialog.d.ts +5 -0
  66. package/dist/src/table/shared-components/StyledMenuItem.d.ts +5 -1
  67. package/dist/table/components/columns/action-column/components/RowActionMenu.js +57 -50
  68. package/dist/table/shared-components/StyledMenuItem.js +28 -16
  69. package/dist/table/shared-components/button/StyledButton.module.js +11 -11
  70. package/package.json +1 -1
@@ -1,31 +1,27 @@
1
- import { DotsVerticalIcon as S } from "../../../../../components/icons/dots-vertical-icon/DotsVerticalIcon.js";
2
- import { CircleWarningOutlineIcon as A } from "../../../../../components/icons/warning-circle-icon/CircleWarningOutlineIcon.js";
3
- import { StyledPopover as D } from "../../../../../components/utils/popover/StyledPopover.js";
4
- import { StyledMenuList as O } from "../../../../../components/navigation/menu/StyledMenuList.js";
5
- import { isCustomAction as j } from "../../../../types.js";
6
- import { StyledTooltip as g } from "../../../../shared-components/tooltip/index.js";
7
- import { useToggleMenuVisibility as k } from "../../../../hooks/useToggleMenuVisibility.hook.js";
8
- import { StyledButton as I } from "../../../../shared-components/button/StyledButton.js";
9
- import { StyledMenuItem as R } from "../../../../shared-components/StyledMenuItem.js";
10
- import w, { useEffect as V, useMemo as z, useState as E } from "react";
1
+ import { DotsVerticalIcon as y } from "../../../../../components/icons/dots-vertical-icon/DotsVerticalIcon.js";
2
+ import { CircleWarningOutlineIcon as D } from "../../../../../components/icons/warning-circle-icon/CircleWarningOutlineIcon.js";
3
+ import { StyledPopover as T } from "../../../../../components/utils/popover/StyledPopover.js";
4
+ import { StyledMenuList as A } from "../../../../../components/navigation/menu/StyledMenuList.js";
5
+ import { isCustomAction as S } from "../../../../types.js";
6
+ import { StyledTooltip as f } from "../../../../shared-components/tooltip/index.js";
7
+ import { useToggleMenuVisibility as j } from "../../../../hooks/useToggleMenuVisibility.hook.js";
8
+ import { StyledButton as k } from "../../../../shared-components/button/StyledButton.js";
9
+ import { StyledMenuItem as h } from "../../../../shared-components/StyledMenuItem.js";
10
+ import g, { useMemo as O } from "react";
11
11
  import { jsx as t, jsxs as b } from "react/jsx-runtime";
12
- function X({ tableData: l, actions: v, rowActionsState: x }) {
13
- const { anchorEl: C, open: a, handleClose: r, handleOpen: P } = k(), i = v(l.row), o = x?.(l.row) ?? { state: "enabled" }, d = l.table.options.meta?.locale, T = d === "no" ? "Ingen handlinger tilgjengelig" : "No actions available", y = d === "no" ? "Radhandlinger" : "Row actions", N = z(() => i.every((e) => "component" in e ? !1 : e.hide), [i]), u = i.length > 0 && !N, m = o.state === "enabled" && !u, M = o.state !== "hidden" && (u || m || o.state === "disabled"), [c, s] = E(!1);
14
- if (V(() => {
15
- if (!c) return;
16
- const e = window.setTimeout(() => s(!1), 1600);
17
- return () => window.clearTimeout(e);
18
- }, [c]), !M) return /* @__PURE__ */ t("div", { className: "flex w-[40px] items-center justify-center" });
19
- const p = o.state === "disabled", f = /* @__PURE__ */ t(I, {
12
+ function q({ tableData: l, actions: v, rowActionsState: w }) {
13
+ const { anchorEl: P, open: s, handleClose: r, handleOpen: x } = j(), i = v(l.row), n = w?.(l.row) ?? { state: "enabled" }, d = l.table.options.meta?.locale, N = d === "no" ? "Ingen handlinger tilgjengelig" : "No actions available", C = d === "no" ? "Radhandlinger" : "Row actions", M = O(() => i.every((e) => "component" in e ? !1 : e.hide), [i]), c = i.length > 0 && !M, m = n.state === "enabled" && !c;
14
+ if (!(n.state !== "hidden" && (c || m || n.state === "disabled"))) return /* @__PURE__ */ t("div", { className: "flex w-[40px] items-center justify-center" });
15
+ const a = n.state === "disabled", u = /* @__PURE__ */ t(k, {
20
16
  dataTest: "row-actions-button",
21
- "aria-label": y,
17
+ "aria-label": C,
22
18
  "aria-haspopup": "true",
23
- "aria-expanded": a,
19
+ "aria-expanded": s,
24
20
  variant: "text",
25
21
  size: "small",
26
- disabled: p,
22
+ "aria-disabled": a || void 0,
27
23
  onClick: (e) => {
28
- e.stopPropagation(), e.preventDefault(), !p && (e.currentTarget.focus({ preventScroll: !0 }), a ? r() : P(e));
24
+ e.stopPropagation(), e.preventDefault(), !a && (e.currentTarget.focus({ preventScroll: !0 }), s ? r() : x(e));
29
25
  },
30
26
  onMouseDown: (e) => {
31
27
  e.stopPropagation(), e.preventDefault();
@@ -33,8 +29,8 @@ function X({ tableData: l, actions: v, rowActionsState: x }) {
33
29
  onMouseUp: (e) => {
34
30
  e.stopPropagation(), e.preventDefault();
35
31
  },
36
- children: /* @__PURE__ */ t(S, {
37
- className: p ? "text-delta-300" : "text-delta-700",
32
+ children: /* @__PURE__ */ t(y, {
33
+ className: a ? "text-delta-300" : "text-delta-700",
38
34
  width: 20,
39
35
  height: 20
40
36
  })
@@ -43,26 +39,25 @@ function X({ tableData: l, actions: v, rowActionsState: x }) {
43
39
  className: "flex w-[40px] items-center justify-center",
44
40
  children: /* @__PURE__ */ b("div", {
45
41
  className: "flex items-center justify-center",
46
- children: [o.state === "disabled" ? /* @__PURE__ */ t(g, {
47
- title: o.tooltipTitle,
42
+ children: [n.state === "disabled" ? /* @__PURE__ */ t(f, {
43
+ title: n.tooltipTitle,
48
44
  arrow: !0,
49
- placement: o.tooltipPlacement ?? "top",
50
- open: c,
51
- onOpen: () => s(!0),
52
- onClose: () => s(!1),
45
+ placement: n.tooltipPlacement ?? "top",
46
+ openOnTap: !0,
47
+ persistentDescription: !0,
53
48
  children: /* @__PURE__ */ t("span", {
54
49
  className: "cursor-not-allowed",
55
50
  onTouchStart: (e) => {
56
- e.stopPropagation(), e.preventDefault(), s(!0);
51
+ e.stopPropagation(), e.preventDefault();
57
52
  },
58
53
  onClick: (e) => {
59
54
  e.stopPropagation(), e.preventDefault();
60
55
  },
61
- children: f
56
+ children: u
62
57
  })
63
- }) : f, o.state === "enabled" && /* @__PURE__ */ t(D, {
64
- open: a,
65
- anchorEl: C,
58
+ }) : u, n.state === "enabled" && /* @__PURE__ */ t(T, {
59
+ open: s,
60
+ anchorEl: P,
66
61
  onClose: r,
67
62
  onClick: r,
68
63
  anchorOrigin: {
@@ -75,36 +70,48 @@ function X({ tableData: l, actions: v, rowActionsState: x }) {
75
70
  },
76
71
  children: m ? /* @__PURE__ */ b("div", {
77
72
  className: "flex items-center gap-2 p-3 text-base text-delta-700",
78
- children: [/* @__PURE__ */ t(A, {
73
+ children: [/* @__PURE__ */ t(D, {
79
74
  width: 20,
80
75
  height: 20
81
- }), /* @__PURE__ */ t("span", { children: T })]
82
- }) : /* @__PURE__ */ t(O, {
76
+ }), /* @__PURE__ */ t("span", { children: N })]
77
+ }) : /* @__PURE__ */ t(A, {
83
78
  disablePadding: !0,
84
- children: i.map((e, h) => {
85
- if (j(e)) {
86
- const n = e.component(l.row, r);
87
- return w.isValidElement(n) ? /* @__PURE__ */ t(w.Fragment, { children: n }, h) : null;
79
+ children: i.map((e, p) => {
80
+ if (S(e)) {
81
+ const o = e.component(l.row, r);
82
+ return g.isValidElement(o) ? /* @__PURE__ */ t(g.Fragment, { children: o }, p) : null;
88
83
  }
89
- return e.hide ? null : /* @__PURE__ */ t(g, {
84
+ return e.hide ? null : e.disabled && e.tooltipTitle ? /* @__PURE__ */ t(h, {
85
+ className: e.className,
86
+ disabled: !0,
87
+ disabledReason: e.tooltipTitle,
88
+ reasonPlacement: e.tooltipPlacement ?? "left",
89
+ onMouseDown: (o) => {
90
+ o.stopPropagation(), o.preventDefault();
91
+ },
92
+ onMouseUp: (o) => {
93
+ o.stopPropagation(), o.preventDefault();
94
+ },
95
+ children: e.label
96
+ }, p) : /* @__PURE__ */ t(f, {
90
97
  title: e?.tooltipTitle,
91
98
  arrow: !0,
92
99
  placement: e?.tooltipPlacement ?? "left",
93
- children: /* @__PURE__ */ t("span", { children: /* @__PURE__ */ t(R, {
100
+ children: /* @__PURE__ */ t("span", { children: /* @__PURE__ */ t(h, {
94
101
  className: e.className,
95
102
  disabled: e.disabled,
96
103
  onClick: () => {
97
104
  e.disabled || e.onClick?.(l.row);
98
105
  },
99
- onMouseDown: (n) => {
100
- n.stopPropagation(), n.preventDefault();
106
+ onMouseDown: (o) => {
107
+ o.stopPropagation(), o.preventDefault();
101
108
  },
102
- onMouseUp: (n) => {
103
- n.stopPropagation(), n.preventDefault();
109
+ onMouseUp: (o) => {
110
+ o.stopPropagation(), o.preventDefault();
104
111
  },
105
112
  children: e.label
106
113
  }) })
107
- }, h);
114
+ }, p);
108
115
  })
109
116
  })
110
117
  })]
@@ -112,5 +119,5 @@ function X({ tableData: l, actions: v, rowActionsState: x }) {
112
119
  });
113
120
  }
114
121
  export {
115
- X as RowActionMenu
122
+ q as RowActionMenu
116
123
  };
@@ -1,18 +1,30 @@
1
- import { cn as u } from "../../helpers/cn.js";
2
- import { jsx as x } from "react/jsx-runtime";
3
- var c = ({ children: o, disabled: e, selected: n, className: a, classes: i, onClick: t, onMouseDown: l, onMouseUp: m }) => /* @__PURE__ */ x("li", {
4
- role: "menuitem",
5
- "aria-disabled": e ? !0 : void 0,
6
- tabIndex: -1,
7
- onClick: e ? void 0 : t,
8
- onKeyDown: (r) => {
9
- e || (r.key === "Enter" || r.key === " ") && (r.preventDefault(), t?.(r));
10
- },
11
- onMouseDown: l,
12
- onMouseUp: m,
13
- className: u("box-border flex min-h-10 items-center px-3 py-2 text-base text-delta-700 outline-none", e ? "cursor-not-allowed" : "cursor-pointer hover:bg-delta-50", n && "bg-gama-50", i?.root, a, e && "aria-disabled:text-delta-300"),
14
- children: o
15
- });
1
+ import { cn as y } from "../../helpers/cn.js";
2
+ import { StyledTooltip as d } from "../../components/data-display/tooltip/StyledTooltip.js";
3
+ import { jsx as i } from "react/jsx-runtime";
4
+ var D = ({ children: l, disabled: e, disabledReason: o, reasonPlacement: p = "left", selected: m, className: u, classes: s, onClick: r, onMouseDown: c, onMouseUp: f }) => {
5
+ const x = (t) => {
6
+ e || (t.key === "Enter" || t.key === " ") && (t.preventDefault(), r?.(t));
7
+ }, n = !!e && !!o, a = /* @__PURE__ */ i("li", {
8
+ role: "menuitem",
9
+ "aria-disabled": e ? !0 : void 0,
10
+ "data-has-reason": n || void 0,
11
+ tabIndex: -1,
12
+ onClick: e ? (t) => t.stopPropagation() : r,
13
+ onKeyDown: x,
14
+ onMouseDown: c,
15
+ onMouseUp: f,
16
+ className: y("box-border flex min-h-10 items-center px-3 py-2 text-base text-delta-700 outline-none", e ? "cursor-not-allowed" : "cursor-pointer hover:bg-delta-50", m && "bg-gama-50", s?.root, u, e && "aria-disabled:text-delta-300"),
17
+ children: l
18
+ });
19
+ return n ? /* @__PURE__ */ i(d, {
20
+ title: o,
21
+ arrow: !0,
22
+ placement: p,
23
+ openOnTap: !0,
24
+ persistentDescription: !0,
25
+ children: a
26
+ }) : a;
27
+ };
16
28
  export {
17
- c as StyledMenuItem
29
+ D as StyledMenuItem
18
30
  };
@@ -1,15 +1,15 @@
1
- var _ = "_contained_1ysgm_6", t = "_common_1ysgm_6", a = "_medium_1ysgm_56", e = "_small_1ysgm_61", m = "_large_1ysgm_66", r = "_error_1ysgm_76", o = "_outlined_1ysgm_146", s = "_text_1ysgm_286", y = "_textGray_1ysgm_426", g = "_textWhite_1ysgm_496", l = {
2
- "asma-core-ui-button": "_asma-core-ui-button_1ysgm_1",
3
- contained: _,
4
- common: t,
5
- medium: a,
1
+ var a = "_contained_awucv_6", _ = "_common_awucv_6", t = "_medium_awucv_56", e = "_small_awucv_61", r = "_large_awucv_66", u = "_error_awucv_76", v = "_outlined_awucv_146", c = "_text_awucv_286", o = "_textGray_awucv_426", m = "_textWhite_awucv_496", l = {
2
+ "asma-core-ui-button": "_asma-core-ui-button_awucv_1",
3
+ contained: a,
4
+ common: _,
5
+ medium: t,
6
6
  small: e,
7
- large: m,
8
- error: r,
9
- outlined: o,
10
- text: s,
11
- textGray: y,
12
- textWhite: g
7
+ large: r,
8
+ error: u,
9
+ outlined: v,
10
+ text: c,
11
+ textGray: o,
12
+ textWhite: m
13
13
  };
14
14
  export {
15
15
  l as default
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "3.104.0",
6
+ "version": "3.106.0",
7
7
  "type": "module",
8
8
  "sideEffects": [
9
9
  "**/*.css",