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,37 +1,27 @@
1
- import { DotsVerticalIcon as A } from "../../../../../components/icons/dots-vertical-icon/DotsVerticalIcon.js";
2
- import { CircleWarningOutlineIcon as O } from "../../../../../components/icons/warning-circle-icon/CircleWarningOutlineIcon.js";
3
- import { StyledPopover as j } from "../../../../../components/utils/popover/StyledPopover.js";
4
- import { StyledMenuList as k } from "../../../../../components/navigation/menu/StyledMenuList.js";
5
- import { isCustomAction as R } from "../../../../types.js";
6
- import { StyledTooltip as b } from "../../../../shared-components/tooltip/index.js";
7
- import { useToggleMenuVisibility as E } from "../../../../hooks/useToggleMenuVisibility.hook.js";
8
- import { StyledButton as B } from "../../../../shared-components/button/StyledButton.js";
9
- import { StyledMenuItem as I } from "../../../../shared-components/StyledMenuItem.js";
10
- import v, { useEffect as L, useMemo as V, useRef as z, useState as F } from "react";
11
- import { jsx as t, jsxs as x } from "react/jsx-runtime";
12
- function _({ tableData: r, actions: y, rowActionsState: T }) {
13
- const { anchorEl: C, open: c, handleClose: i, handleOpen: M } = E(), a = y(r.row), o = T?.(r.row) ?? { state: "enabled" }, u = r.table.options.meta?.locale, P = u === "no" ? "Ingen handlinger tilgjengelig" : "No actions available", N = u === "no" ? "Radhandlinger" : "Row actions", D = V(() => a.every((e) => "component" in e ? !1 : e.hide), [a]), m = a.length > 0 && !D, f = o.state === "enabled" && !m, S = o.state !== "hidden" && (m || f || o.state === "disabled"), [p, l] = F(!1), h = z(!1), s = (e) => {
14
- h.current = e, l(!0);
15
- };
16
- if (L(() => {
17
- if (!p || !h.current) return;
18
- const e = window.setTimeout(() => l(!1), 1600);
19
- return () => window.clearTimeout(e);
20
- }, [p]), !S) return /* @__PURE__ */ t("div", { className: "flex w-[40px] items-center justify-center" });
21
- const d = o.state === "disabled", g = /* @__PURE__ */ t(B, {
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
+ import { jsx as t, jsxs as b } from "react/jsx-runtime";
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, {
22
16
  dataTest: "row-actions-button",
23
- "aria-label": N,
17
+ "aria-label": C,
24
18
  "aria-haspopup": "true",
25
- "aria-expanded": c,
19
+ "aria-expanded": s,
26
20
  variant: "text",
27
21
  size: "small",
28
- "aria-disabled": d ? !0 : void 0,
22
+ "aria-disabled": a || void 0,
29
23
  onClick: (e) => {
30
- if (e.stopPropagation(), e.preventDefault(), d) {
31
- s(!1);
32
- return;
33
- }
34
- e.currentTarget.focus({ preventScroll: !0 }), c ? i() : M(e);
24
+ e.stopPropagation(), e.preventDefault(), !a && (e.currentTarget.focus({ preventScroll: !0 }), s ? r() : x(e));
35
25
  },
36
26
  onMouseDown: (e) => {
37
27
  e.stopPropagation(), e.preventDefault();
@@ -39,45 +29,37 @@ function _({ tableData: r, actions: y, rowActionsState: T }) {
39
29
  onMouseUp: (e) => {
40
30
  e.stopPropagation(), e.preventDefault();
41
31
  },
42
- children: /* @__PURE__ */ t(A, {
43
- className: d ? "text-delta-300" : "text-delta-700",
32
+ children: /* @__PURE__ */ t(y, {
33
+ className: a ? "text-delta-300" : "text-delta-700",
44
34
  width: 20,
45
35
  height: 20
46
36
  })
47
37
  });
48
38
  return /* @__PURE__ */ t("div", {
49
39
  className: "flex w-[40px] items-center justify-center",
50
- children: /* @__PURE__ */ x("div", {
40
+ children: /* @__PURE__ */ b("div", {
51
41
  className: "flex items-center justify-center",
52
- children: [o.state === "disabled" ? /* @__PURE__ */ t(b, {
53
- title: o.tooltipTitle,
42
+ children: [n.state === "disabled" ? /* @__PURE__ */ t(f, {
43
+ title: n.tooltipTitle,
54
44
  arrow: !0,
55
- placement: o.tooltipPlacement ?? "top",
56
- open: p,
57
- onOpen: () => s(!1),
58
- onClose: () => l(!1),
45
+ placement: n.tooltipPlacement ?? "top",
46
+ openOnTap: !0,
47
+ persistentDescription: !0,
59
48
  children: /* @__PURE__ */ t("span", {
60
49
  className: "cursor-not-allowed",
61
- onMouseEnter: () => s(!1),
62
- onMouseLeave: () => l(!1),
63
- onFocus: () => s(!1),
64
- onBlur: () => l(!1),
65
- onKeyDown: (e) => {
66
- e.key === "Escape" && l(!1);
67
- },
68
50
  onTouchStart: (e) => {
69
- e.stopPropagation(), e.preventDefault(), s(!0);
51
+ e.stopPropagation(), e.preventDefault();
70
52
  },
71
53
  onClick: (e) => {
72
54
  e.stopPropagation(), e.preventDefault();
73
55
  },
74
- children: g
56
+ children: u
75
57
  })
76
- }) : g, o.state === "enabled" && /* @__PURE__ */ t(j, {
77
- open: c,
78
- anchorEl: C,
79
- onClose: i,
80
- onClick: i,
58
+ }) : u, n.state === "enabled" && /* @__PURE__ */ t(T, {
59
+ open: s,
60
+ anchorEl: P,
61
+ onClose: r,
62
+ onClick: r,
81
63
  anchorOrigin: {
82
64
  horizontal: "right",
83
65
  vertical: "bottom"
@@ -86,38 +68,50 @@ function _({ tableData: r, actions: y, rowActionsState: T }) {
86
68
  horizontal: "right",
87
69
  vertical: "top"
88
70
  },
89
- children: f ? /* @__PURE__ */ x("div", {
71
+ children: m ? /* @__PURE__ */ b("div", {
90
72
  className: "flex items-center gap-2 p-3 text-base text-delta-700",
91
- children: [/* @__PURE__ */ t(O, {
73
+ children: [/* @__PURE__ */ t(D, {
92
74
  width: 20,
93
75
  height: 20
94
- }), /* @__PURE__ */ t("span", { children: P })]
95
- }) : /* @__PURE__ */ t(k, {
76
+ }), /* @__PURE__ */ t("span", { children: N })]
77
+ }) : /* @__PURE__ */ t(A, {
96
78
  disablePadding: !0,
97
- children: a.map((e, w) => {
98
- if (R(e)) {
99
- const n = e.component(r.row, i);
100
- return v.isValidElement(n) ? /* @__PURE__ */ t(v.Fragment, { children: n }, w) : 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;
101
83
  }
102
- return e.hide ? null : /* @__PURE__ */ t(b, {
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, {
103
97
  title: e?.tooltipTitle,
104
98
  arrow: !0,
105
99
  placement: e?.tooltipPlacement ?? "left",
106
- children: /* @__PURE__ */ t("span", { children: /* @__PURE__ */ t(I, {
100
+ children: /* @__PURE__ */ t("span", { children: /* @__PURE__ */ t(h, {
107
101
  className: e.className,
108
102
  disabled: e.disabled,
109
103
  onClick: () => {
110
- e.disabled || e.onClick?.(r.row);
104
+ e.disabled || e.onClick?.(l.row);
111
105
  },
112
- onMouseDown: (n) => {
113
- n.stopPropagation(), n.preventDefault();
106
+ onMouseDown: (o) => {
107
+ o.stopPropagation(), o.preventDefault();
114
108
  },
115
- onMouseUp: (n) => {
116
- n.stopPropagation(), n.preventDefault();
109
+ onMouseUp: (o) => {
110
+ o.stopPropagation(), o.preventDefault();
117
111
  },
118
112
  children: e.label
119
113
  }) })
120
- }, w);
114
+ }, p);
121
115
  })
122
116
  })
123
117
  })]
@@ -125,5 +119,5 @@ function _({ tableData: r, actions: y, rowActionsState: T }) {
125
119
  });
126
120
  }
127
121
  export {
128
- _ as RowActionMenu
122
+ q as RowActionMenu
129
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
  };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "3.105.0",
6
+ "version": "3.107.0",
7
7
  "type": "module",
8
8
  "sideEffects": [
9
9
  "**/*.css",