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,9 +1,9 @@
1
- import { ArrowExpandIcon as i } from "../../../icons/arrow-expand-icon/ArrowExpandIcon.js";
2
- import { ArrowShrinkIcon as n } from "../../../icons/arrow-shrink-icon/ArrowShrinkIcon.js";
3
- import { StyledTooltip as a } from "../../../data-display/tooltip/StyledTooltip.js";
1
+ import { StyledTooltip as i } from "../../../data-display/tooltip/StyledTooltip.js";
2
+ import { ArrowExpandIcon as n } from "../../../icons/arrow-expand-icon/ArrowExpandIcon.js";
3
+ import { ArrowShrinkIcon as a } from "../../../icons/arrow-shrink-icon/ArrowShrinkIcon.js";
4
4
  import { StyledButton as d } from "../../../inputs/button/StyledButton.js";
5
5
  import { jsx as r } from "react/jsx-runtime";
6
- var u = ({ fullScreen: e, showFullScreenIcon: o, tooltipTitle: t, onClick: l }) => o ? /* @__PURE__ */ r(a, {
6
+ var u = ({ fullScreen: e, showFullScreenIcon: o, tooltipTitle: t, onClick: l }) => o ? /* @__PURE__ */ r(i, {
7
7
  title: t,
8
8
  children: /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(d, {
9
9
  dataTest: "fullscreen-button",
@@ -11,11 +11,11 @@ var u = ({ fullScreen: e, showFullScreenIcon: o, tooltipTitle: t, onClick: l })
11
11
  variant: "textGray",
12
12
  size: "small",
13
13
  onClick: l,
14
- endIcon: e ? /* @__PURE__ */ r(n, {
14
+ endIcon: e ? /* @__PURE__ */ r(a, {
15
15
  width: 20,
16
16
  height: 20,
17
17
  color: "text-delta-700"
18
- }) : /* @__PURE__ */ r(i, {
18
+ }) : /* @__PURE__ */ r(n, {
19
19
  width: 20,
20
20
  height: 20,
21
21
  color: "text-delta-700"
@@ -1,6 +1,6 @@
1
+ import { StyledTooltip as r } from "../../../data-display/tooltip/StyledTooltip.js";
1
2
  import { MinimizeIcon as d } from "../../../icons/minimize-icon/MinimizeIcon.js";
2
3
  import { KeyboardCapslockIcon as c } from "../../../icons/keyboard-capslock-icon/KeyboardCapslockIcon.js";
3
- import { StyledTooltip as r } from "../../../data-display/tooltip/StyledTooltip.js";
4
4
  import { StyledButton as a } from "../../../inputs/button/StyledButton.js";
5
5
  import { jsx as i } from "react/jsx-runtime";
6
6
  var g = ({ visibility: l, tooltipTitle: t, onClick: e, type: n }) => {
@@ -1,46 +1,53 @@
1
- import { cn as a } from "../../../../helpers/cn.js";
2
- import { firstTabbable as M } from "../../../../helpers/focusable.js";
3
- import { StyledTooltip as $ } from "../../../data-display/tooltip/StyledTooltip.js";
4
- import { useMobileMediaQuery as H } from "../../../../hooks/useMediaQuery.hook.js";
5
- import { useFocusTrap as L } from "../../../../hooks/useFocusTrap.hook.js";
6
- import { CloseBtn as k } from "../components/CloseBtn.js";
7
- import { MinimizeBtn as B } from "../components/MinimizeBtn.js";
8
- import { FullScreenBtn as Q } from "../components/FullscreenBtn.js";
9
- import p from "./MinimizableDialogV2.module.js";
10
- import { useTranslations as G } from "./useTranslations.js";
11
- import { useControlledProps as J } from "./useControlledProps.js";
12
- import K from "clsx";
13
- import { useLayoutEffect as I, useRef as u } from "react";
14
- import { Fragment as U, jsx as e, jsxs as n } from "react/jsx-runtime";
15
- var ue = (g) => {
16
- const { showCloseIcon: z = !0, showMinimizeIcon: j = !0, showExpandIcon: A = !0, enableFullscreen: D = !0, title: o, label: x, children: O, open: m, onClose: q, classNameOverrides: h = {
1
+ import { cn as s } from "../../../../helpers/cn.js";
2
+ import { firstTabbable as A } from "../../../../helpers/focusable.js";
3
+ import { StyledTooltip as te } from "../../../data-display/tooltip/StyledTooltip.js";
4
+ import { DialogBusyContext as $, useDialogBusyBoundary as ie } from "../../dialog/DialogBusyContext.js";
5
+ import { useMobileMediaQuery as le } from "../../../../hooks/useMediaQuery.hook.js";
6
+ import { useFocusTrap as ne } from "../../../../hooks/useFocusTrap.hook.js";
7
+ import { CloseBtn as O } from "../components/CloseBtn.js";
8
+ import { MinimizeBtn as V } from "../components/MinimizeBtn.js";
9
+ import { FullScreenBtn as oe } from "../components/FullscreenBtn.js";
10
+ import v from "./MinimizableDialogV2.module.js";
11
+ import { useTranslations as re } from "./useTranslations.js";
12
+ import { useControlledProps as se } from "./useControlledProps.js";
13
+ import ce from "clsx";
14
+ import { useId as q, useLayoutEffect as H, useRef as c } from "react";
15
+ import { Fragment as ae, jsx as e, jsxs as n } from "react/jsx-runtime";
16
+ var Se = (N) => {
17
+ const { showCloseIcon: R = !0, showMinimizeIcon: L = !0, showExpandIcon: W = !0, enableFullscreen: _ = !0, title: u, label: f, children: Q, open: o, onClose: U, classNameOverrides: h = {
17
18
  maximized: "",
18
19
  minimized: "",
19
20
  fullscreen: ""
20
- }, dataTest: E, actionNode: P, locale: V = "en", style: y, initialFocusRef: w } = g, r = H(), s = G(V), d = u(null), f = u(null), N = u(null), C = u(null), F = u(!1), { minimized: t, setMinimized: S, fullScreen: i, setFullScreen: R } = J(g), l = i && !t, v = () => {
21
- S(!1), q();
21
+ }, dataTest: G, actionNode: J, locale: K = "en", busyReason: X, style: C, initialFocusRef: S } = N, r = le(), i = re(K), a = c(null), p = c(null), F = c(null), T = c(null), b = c(!1), g = c(null), x = q(), I = q(), { minimized: t, setMinimized: M, fullScreen: l, setFullScreen: B } = se(N), d = l && !t, { busy: y, busyReason: E, contextValue: j } = ie(X ?? i.waitUntilSaved), z = () => {
22
+ y || (M(!1), U());
22
23
  };
23
- I(() => {
24
- d.current?.toggleAttribute("inert", t), f.current?.toggleAttribute("inert", !t);
25
- }, [t]), I(() => {
26
- const b = m && !F.current;
27
- if (F.current = m, !b) return;
28
- const c = t ? f.current : d.current, _ = t ? C.current : N.current;
29
- (w?.current ?? _ ?? (c ? M(c) : void 0))?.focus({ preventScroll: !0 });
24
+ H(() => {
25
+ a.current?.toggleAttribute("inert", t), p.current?.toggleAttribute("inert", !t);
26
+ }, [t]), H(() => {
27
+ const w = o && !b.current, m = !o && b.current;
28
+ if (b.current = o, m) {
29
+ const P = g.current;
30
+ g.current = null, (!document.activeElement || document.activeElement === document.body) && P?.isConnected && P.focus({ preventScroll: !0 });
31
+ return;
32
+ }
33
+ if (!w) return;
34
+ g.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;
35
+ const D = t ? p.current : a.current, ee = t ? T.current : F.current;
36
+ (S?.current ?? ee ?? (D ? A(D) : void 0))?.focus({ preventScroll: !0 });
30
37
  }, [
31
- w,
38
+ S,
32
39
  t,
33
- m
40
+ o
34
41
  ]);
35
- const T = () => {
36
- const b = t ? d : f;
37
- S(!t), requestAnimationFrame(() => {
38
- const c = b.current;
39
- c && (c.querySelector('[data-testid="toggle-minimize-btn"]') ?? M(c))?.focus({ preventScroll: !0 });
42
+ const k = () => {
43
+ const w = t ? a : p;
44
+ M(!t), requestAnimationFrame(() => {
45
+ const m = w.current;
46
+ m && (m.querySelector('[data-testid="toggle-minimize-btn"]') ?? A(m))?.focus({ preventScroll: !0 });
40
47
  });
41
48
  };
42
- L(m && l, d, v);
43
- const W = l ? r ? {
49
+ ne(o && d, a, z);
50
+ const Y = d ? r ? {
44
51
  inset: 0,
45
52
  maxHeight: "100dvh",
46
53
  maxWidth: "100dvw",
@@ -57,107 +64,120 @@ var ue = (g) => {
57
64
  maxWidth: "min(1000px, calc(100vw - 32px))",
58
65
  height: "95dvh"
59
66
  } : void 0;
60
- return m ? /* @__PURE__ */ n(U, { children: [
67
+ if (!o) return null;
68
+ const Z = f ? `${I} ${x}` : x;
69
+ return /* @__PURE__ */ n(ae, { children: [
61
70
  /* @__PURE__ */ e("div", {
62
- ref: f,
71
+ ref: p,
63
72
  style: {
64
73
  zIndex: 51,
65
- ...y
74
+ ...C
66
75
  },
67
- className: a(p["minimized-dialog"], !t && p.hidden, h.minimized),
76
+ className: s(v["minimized-dialog"], !t && v.hidden, h.minimized),
68
77
  children: /* @__PURE__ */ n("div", {
69
- className: K("flex items-center justify-between", !t && "hidden"),
70
- "data-testid": E,
78
+ className: ce("flex items-center justify-between", !t && "hidden"),
79
+ "data-testid": G,
71
80
  children: [/* @__PURE__ */ e("div", {
72
81
  className: "max-w-[303px] truncate pr-1 text-lg font-semibold text-delta-800",
73
- children: /* @__PURE__ */ e($, {
74
- title: o,
82
+ children: /* @__PURE__ */ e(te, {
83
+ title: u,
75
84
  placement: "top",
76
85
  children: /* @__PURE__ */ e("div", {
77
86
  className: "truncate",
78
- children: o
87
+ children: u
79
88
  })
80
89
  })
81
90
  }), /* @__PURE__ */ n("div", {
82
91
  className: "flex items-center gap-x-1",
83
- children: [/* @__PURE__ */ e(B, {
92
+ children: [/* @__PURE__ */ e(V, {
84
93
  type: "expand",
85
- visibility: A,
86
- onClick: T,
87
- tooltipTitle: s.expand
88
- }), /* @__PURE__ */ e(k, {
89
- buttonRef: C,
90
- showCloseIcon: z,
91
- onClick: v,
92
- tooltipTitle: s.close
94
+ visibility: W,
95
+ onClick: k,
96
+ tooltipTitle: i.expand
97
+ }), /* @__PURE__ */ e(O, {
98
+ buttonRef: T,
99
+ showCloseIcon: R,
100
+ onClick: z,
101
+ disabledReason: y ? E : void 0,
102
+ tooltipTitle: i.close
93
103
  })]
94
104
  })]
95
105
  })
96
106
  }),
97
- l && /* @__PURE__ */ e("div", {
107
+ d && /* @__PURE__ */ e("div", {
98
108
  className: "fixed inset-0 z-[52] bg-[rgb(98,110,126)] bg-opacity-70",
99
109
  onClick: () => {
100
- R(!1);
110
+ B(!1);
101
111
  }
102
112
  }),
103
113
  /* @__PURE__ */ n("div", {
104
114
  style: {
105
115
  zIndex: 51,
106
- ...y,
107
- ...W
116
+ ...C,
117
+ ...Y
108
118
  },
109
- ref: d,
110
- role: l ? "dialog" : void 0,
111
- "aria-modal": l ? !0 : void 0,
112
- "aria-label": l && typeof o == "string" ? o : void 0,
113
- className: a(p.dialog, t && p.hidden, !i && h.maximized, i && h.fullscreen, l && "fixed z-[53] duration-0"),
119
+ ref: a,
120
+ role: "dialog",
121
+ "aria-modal": d ? !0 : void 0,
122
+ "aria-labelledby": Z,
123
+ className: s(v.dialog, t && v.hidden, !l && h.maximized, l && h.fullscreen, d && "fixed z-[53] duration-0"),
114
124
  children: [/* @__PURE__ */ n("div", {
115
- className: a("flex flex-col border-b-[1px] border-delta-200 px-4", r ? "py-3" : "py-4"),
125
+ className: s("flex flex-col border-b-[1px] border-delta-200 px-4", r ? "py-3" : "py-4"),
116
126
  children: [/* @__PURE__ */ n("div", {
117
127
  className: "flex items-center justify-between",
118
- children: [x ? /* @__PURE__ */ e("div", {
128
+ children: [f ? /* @__PURE__ */ e("div", {
129
+ id: I,
119
130
  className: "text-sm text-delta-700",
120
- children: x
131
+ children: f
121
132
  }) : /* @__PURE__ */ e("div", {
122
- className: a("font-semibold text-delta-800", r ? "line-clamp-2 text-xl" : "line-clamp-1 text-2xl"),
123
- children: o
133
+ id: x,
134
+ className: s("font-semibold text-delta-800", r ? "line-clamp-2 text-xl" : "line-clamp-1 text-2xl"),
135
+ children: u
124
136
  }), /* @__PURE__ */ n("div", {
125
137
  className: "flex items-center gap-x-1",
126
138
  children: [
127
- P,
128
- /* @__PURE__ */ e(B, {
129
- visibility: j && !r && !i,
139
+ /* @__PURE__ */ e($.Provider, {
140
+ value: j,
141
+ children: J
142
+ }),
143
+ /* @__PURE__ */ e(V, {
144
+ visibility: L && !r && !l,
130
145
  type: "minimize",
131
- onClick: T,
132
- tooltipTitle: s.minimize
146
+ onClick: k,
147
+ tooltipTitle: i.minimize
133
148
  }),
134
- /* @__PURE__ */ e(Q, {
135
- showFullScreenIcon: D && !r,
136
- fullScreen: i,
149
+ /* @__PURE__ */ e(oe, {
150
+ showFullScreenIcon: _ && !r,
151
+ fullScreen: l,
137
152
  onClick: () => {
138
- R(!i);
153
+ B(!l);
139
154
  },
140
- tooltipTitle: i ? s.exitFullscreen : s.fullscreen
155
+ tooltipTitle: l ? i.exitFullscreen : i.fullscreen
141
156
  }),
142
- /* @__PURE__ */ e(k, {
143
- buttonRef: N,
144
- showCloseIcon: z,
145
- onClick: v,
146
- tooltipTitle: s.close
157
+ /* @__PURE__ */ e(O, {
158
+ buttonRef: F,
159
+ showCloseIcon: R,
160
+ onClick: z,
161
+ disabledReason: y ? E : void 0,
162
+ tooltipTitle: i.close
147
163
  })
148
164
  ]
149
165
  })]
150
- }), x && /* @__PURE__ */ e("div", {
151
- className: a("font-semibold text-delta-800", r ? "line-clamp-2 text-xl" : "line-clamp-1 text-2xl"),
152
- children: o
166
+ }), f && /* @__PURE__ */ e("div", {
167
+ id: x,
168
+ className: s("font-semibold text-delta-800", r ? "line-clamp-2 text-xl" : "line-clamp-1 text-2xl"),
169
+ children: u
153
170
  })]
154
171
  }), /* @__PURE__ */ e("div", {
155
- className: a(t && "hidden", "flex flex-grow flex-col overflow-y-auto overscroll-contain"),
156
- children: O
172
+ className: s(t && "hidden", "flex flex-grow flex-col overflow-y-auto overscroll-contain"),
173
+ children: /* @__PURE__ */ e($.Provider, {
174
+ value: j,
175
+ children: Q
176
+ })
157
177
  })]
158
178
  })
159
- ] }) : null;
179
+ ] });
160
180
  };
161
181
  export {
162
- ue as MinimizableDialogV2
182
+ Se as MinimizableDialogV2
163
183
  };
@@ -1,7 +1,8 @@
1
- import { useMemo as l } from "react";
1
+ import { useMemo as i } from "react";
2
2
  var n = {
3
3
  en: {
4
4
  close: "Close",
5
+ waitUntilSaved: "Wait until saved",
5
6
  expand: "Expand",
6
7
  minimize: "Minimize",
7
8
  fullscreen: "Fullscreen",
@@ -9,15 +10,16 @@ var n = {
9
10
  },
10
11
  no: {
11
12
  close: "Lukk",
13
+ waitUntilSaved: "Vent til lagringen er ferdig",
12
14
  expand: "Utvid",
13
15
  minimize: "Minimer",
14
16
  fullscreen: "Fullskjerm",
15
17
  exitFullscreen: "Avslutt fullskjerm"
16
18
  }
17
19
  };
18
- function s(e = "en") {
19
- return l(() => n[e] ?? n.en, [e]);
20
+ function t(e = "en") {
21
+ return i(() => n[e] ?? n.en, [e]);
20
22
  }
21
23
  export {
22
- s as useTranslations
24
+ t as useTranslations
23
25
  };
@@ -1,49 +1,99 @@
1
- import t from "./StyledButton.module.js";
2
- import f from "clsx";
1
+ import { StyledTooltip as L } from "../../data-display/tooltip/StyledTooltip.js";
2
+ import { LoadingIcon as N } from "../../icons/loading-icon/LoadingIcon.js";
3
+ import e from "./StyledButton.module.js";
4
+ import { useReportDialogBusy as O } from "../../feedback/dialog/DialogBusyContext.js";
5
+ import W from "clsx";
3
6
  import "react";
4
- import { jsx as y, jsxs as g } from "react/jsx-runtime";
5
- var a = {
6
- contained: t.contained,
7
- outlined: t.outlined,
8
- text: t.text,
9
- textGray: t.textGray,
10
- textWhite: t.textWhite,
11
- large: t.large,
12
- small: t.small,
13
- medium: t.medium,
14
- error: t.error,
15
- common: t.common
16
- }, B = ({ variant: n = "contained", className: i = "", size: e = "medium", children: o, refLink: l, startIcon: d, endIcon: s, dataTest: x, error: p, style: m, ...c }) => {
17
- const r = e === "large" || e === "medium", u = p ? "error" : "common";
18
- return /* @__PURE__ */ g("button", {
19
- ...c,
20
- className: f("asma-touch-ready", t["asma-ui-core-button"], a[n], a[u], a[e], i),
21
- style: o ? {
22
- flexShrink: 0,
23
- ...m
24
- } : m,
25
- ref: l,
26
- "data-testid": x,
7
+ import { Fragment as _, jsx as r, jsxs as f } from "react/jsx-runtime";
8
+ var F = {
9
+ en: "In progress",
10
+ no: "Pågår"
11
+ }, c = {
12
+ contained: e.contained,
13
+ outlined: e.outlined,
14
+ text: e.text,
15
+ textGray: e.textGray,
16
+ textWhite: e.textWhite,
17
+ large: e.large,
18
+ small: e.small,
19
+ medium: e.medium,
20
+ error: e.error,
21
+ common: e.common
22
+ }, M = ({ variant: x = "contained", className: h = "", size: a = "medium", children: s, refLink: v, startIcon: B, endIcon: b, dataTest: g, error: S, style: w, disabled: p, disabledReason: d, loading: t, holdsDialog: I = !0, loadingAnnouncement: j, locale: k = "en", onClick: C, ...l }) => {
23
+ O(!!t && I);
24
+ const i = a === "large" || a === "medium", D = S ? "error" : "common", n = !!p && !!d, m = n || !!t, u = i ? 20 : 16, y = (o) => t && o ? /* @__PURE__ */ r("span", {
25
+ style: {
26
+ display: "inline-flex",
27
+ opacity: 0
28
+ },
29
+ children: o
30
+ }) : o, R = (o) => {
31
+ if (m) {
32
+ o.preventDefault();
33
+ return;
34
+ }
35
+ C?.(o);
36
+ }, G = /* @__PURE__ */ f("button", {
37
+ ...l,
38
+ disabled: !!p && !m,
39
+ "aria-disabled": m ? !0 : l["aria-disabled"],
40
+ "aria-busy": t ? !0 : l["aria-busy"],
41
+ onClick: R,
42
+ className: W("asma-touch-ready", e["asma-ui-core-button"], c[x], c[D], c[a], h),
43
+ style: {
44
+ ...s ? { flexShrink: 0 } : {},
45
+ ...t ? { position: "relative" } : {},
46
+ ...w
47
+ },
48
+ ref: v,
49
+ "data-testid": g,
27
50
  children: [
28
- d,
29
- o && /* @__PURE__ */ y("div", {
51
+ y(B),
52
+ s && /* @__PURE__ */ r("div", {
30
53
  style: {
54
+ opacity: t ? 0 : void 0,
31
55
  overflow: "hidden",
32
56
  textOverflow: "ellipsis",
33
57
  whiteSpace: "nowrap",
34
58
  display: "flex",
35
59
  alignItems: "center",
36
60
  justifyContent: "center",
37
- gap: r ? "8px" : "4px",
38
- paddingLeft: r ? "8px" : "4px",
39
- paddingRight: r ? "8px" : "4px"
61
+ gap: i ? "8px" : "4px",
62
+ paddingLeft: i ? "8px" : "4px",
63
+ paddingRight: i ? "8px" : "4px"
40
64
  },
41
- children: o
65
+ children: s
42
66
  }),
43
- s
67
+ y(b),
68
+ t && /* @__PURE__ */ r("span", {
69
+ "aria-hidden": "true",
70
+ style: {
71
+ position: "absolute",
72
+ inset: 0,
73
+ display: "flex",
74
+ alignItems: "center",
75
+ justifyContent: "center"
76
+ },
77
+ children: /* @__PURE__ */ r(N, {
78
+ width: u,
79
+ height: u
80
+ })
81
+ })
44
82
  ]
45
83
  });
84
+ return /* @__PURE__ */ f(_, { children: [/* @__PURE__ */ r(L, {
85
+ arrow: !0,
86
+ title: d,
87
+ open: n ? void 0 : !1,
88
+ openOnTap: n,
89
+ persistentDescription: n,
90
+ children: G
91
+ }), t !== void 0 && /* @__PURE__ */ r("span", {
92
+ role: "status",
93
+ className: "sr-only",
94
+ children: t ? j ?? F[k] : ""
95
+ })] });
46
96
  };
47
97
  export {
48
- B as StyledButton
98
+ M as StyledButton
49
99
  };
@@ -1,16 +1,16 @@
1
- var a = "_contained_1fdad_6", _ = "_common_1fdad_6", d = "_medium_1fdad_55", t = "_small_1fdad_62", e = "_large_1fdad_69", r = "_error_1fdad_81", o = "_outlined_1fdad_156", f = "_text_1fdad_306", m = "_textGray_1fdad_456", l = "_textWhite_1fdad_531", u = {
2
- "asma-ui-core-button": "_asma-ui-core-button_1fdad_1",
3
- contained: a,
4
- common: _,
5
- medium: d,
6
- small: t,
7
- large: e,
8
- error: r,
9
- outlined: o,
10
- text: f,
11
- textGray: m,
12
- textWhite: l
1
+ var _ = "_contained_w4qg4_6", t = "_common_w4qg4_6", a = "_medium_w4qg4_58", e = "_small_w4qg4_65", r = "_large_w4qg4_72", o = "_error_w4qg4_84", g = "_outlined_w4qg4_162", m = "_text_w4qg4_318", l = "_textGray_w4qg4_474", u = "_textWhite_w4qg4_552", n = {
2
+ "asma-ui-core-button": "_asma-ui-core-button_w4qg4_1",
3
+ contained: _,
4
+ common: t,
5
+ medium: a,
6
+ small: e,
7
+ large: r,
8
+ error: o,
9
+ outlined: g,
10
+ text: m,
11
+ textGray: l,
12
+ textWhite: u
13
13
  };
14
14
  export {
15
- u as default
15
+ n as default
16
16
  };
@@ -1,27 +1,27 @@
1
- import { cn as y } from "../../../../helpers/cn.js";
1
+ import { cn as v } from "../../../../helpers/cn.js";
2
+ import { StyledTooltip as J } from "../../../data-display/tooltip/StyledTooltip.js";
2
3
  import { CloseIcon as j } from "../../../icons/close-icon/CloseIcon.js";
3
- import { ErrorOutlineIcon as J } from "../../../icons/error-outline-icon/ErrorOutlineIcon.js";
4
- import { StyledChip as P } from "../../../data-display/chip/StyledChip.js";
4
+ import { ErrorOutlineIcon as P } from "../../../icons/error-outline-icon/ErrorOutlineIcon.js";
5
+ import { StyledChip as Q } from "../../../data-display/chip/StyledChip.js";
5
6
  import { StyledInteractiveChip as O } from "../../../data-display/interactive-chip/StyledInteractiveChip.js";
6
- import { StyledTooltip as Q } from "../../../data-display/tooltip/StyledTooltip.js";
7
7
  import { StyledButton as U } from "../../button/StyledButton.js";
8
8
  import { useHelperAlertRole as X } from "../../../../helpers/useHelperAlertRole.js";
9
9
  import { warnMissingErrorMessage as Y } from "../../../../helpers/warnMissingErrorMessage.js";
10
10
  import { useWrap as Z } from "../helpers/useWrap.js";
11
- import { Skeleton as v } from "../../../mui-compat/Skeleton.js";
11
+ import { Skeleton as N } from "../../../mui-compat/Skeleton.js";
12
12
  import { forwardRef as _, useEffect as ee, useId as te } from "react";
13
- import { jsx as t, jsxs as N } from "react/jsx-runtime";
13
+ import { jsx as t, jsxs as T } from "react/jsx-runtime";
14
14
  var he = _((V, A) => {
15
- const { options: d, dataTest: R, value: r, readOnly: n, multiple: i, title: T, disabled: C, onChange: p, required: D, error: f, helperText: I, valueKey: E = "value", labelKey: L = "label", renderLabel: o, getOptionTooltip: k, loading: $, size: b, locale: z = "en", clearSelectionLabel: B } = V, q = te();
15
+ const { options: d, dataTest: R, value: r, readOnly: n, multiple: i, title: C, disabled: b, onChange: p, required: D, error: f, helperText: I, valueKey: E = "value", labelKey: L = "label", renderLabel: o, getOptionTooltip: k, loading: $, size: g, locale: z = "en", clearSelectionLabel: B } = V, q = te();
16
16
  Y("DynamicInteractiveChipGroup", f, I);
17
- const G = X(f), { containerRef: m, wrapDisabled: g } = Z({ dependencyList: [d, d.length] });
17
+ const G = X(f), { containerRef: m, wrapDisabled: w } = Z({ dependencyList: [d, d.length] });
18
18
  ee(() => {
19
19
  m.current && (m.current.inert = !0);
20
20
  }, [m]);
21
- const u = (e) => typeof e == "object" ? e?.[L]?.toString() ?? "" : e?.toString() ?? "", w = (e) => typeof e == "object" ? e?.[E] : e, c = (e) => {
22
- const l = w(e);
21
+ const u = (e) => typeof e == "object" ? e?.[L]?.toString() ?? "" : e?.toString() ?? "", y = (e) => typeof e == "object" ? e?.[E] : e, c = (e) => {
22
+ const l = y(e);
23
23
  return l == null ? "" : typeof l == "string" || typeof l == "number" || typeof l == "boolean" ? String(l) : e == null ? "" : u(e);
24
- }, s = (e, l) => w(e) === w(l), K = i ? Array.isArray(r) && r.length > 0 : r != null, M = (e) => {
24
+ }, s = (e, l) => y(e) === y(l), K = i ? Array.isArray(r) && r.length > 0 : r != null, M = (e) => {
25
25
  if (!i) {
26
26
  const a = s(e, r) ? null : e;
27
27
  if (a === null) return;
@@ -31,13 +31,13 @@ var he = _((V, A) => {
31
31
  const l = r ?? [];
32
32
  p(l.find((a) => s(a, e)) ? l.filter((a) => !s(a, e)) : [...l, e]);
33
33
  }, h = n ? d.filter((e) => !!(i ? r?.find((l) => s(l, e)) : s(r, e))) : d, F = h.findIndex((e) => !(typeof e == "object" && e?.disabled) && !n);
34
- return /* @__PURE__ */ N("div", {
34
+ return /* @__PURE__ */ T("div", {
35
35
  "data-testid": `${R}-dynamic-radio-group`,
36
36
  className: "relative flex flex-col gap-y-1",
37
37
  children: [
38
- T && /* @__PURE__ */ t("span", {
38
+ C && /* @__PURE__ */ t("span", {
39
39
  className: "text-base font-semibold text-delta-800",
40
- children: T
40
+ children: C
41
41
  }),
42
42
  /* @__PURE__ */ t("div", {
43
43
  "aria-hidden": !0,
@@ -53,34 +53,34 @@ var he = _((V, A) => {
53
53
  }, c(e)))
54
54
  }),
55
55
  /* @__PURE__ */ t("div", {
56
- className: y("flex flex-wrap gap-2", g && "flex-col gap-1"),
57
- children: $ ? /* @__PURE__ */ N("div", {
56
+ className: v("flex flex-wrap gap-2", w && "flex-col gap-1"),
57
+ children: $ ? /* @__PURE__ */ T("div", {
58
58
  className: "flex flex-wrap gap-2",
59
59
  children: [
60
- /* @__PURE__ */ t(v, { className: "h-[32px] w-[60px]" }),
61
- /* @__PURE__ */ t(v, { className: "h-[32px] w-[60px]" }),
62
- /* @__PURE__ */ t(v, { className: "h-[32px] w-[60px]" })
60
+ /* @__PURE__ */ t(N, { className: "h-[32px] w-[60px]" }),
61
+ /* @__PURE__ */ t(N, { className: "h-[32px] w-[60px]" }),
62
+ /* @__PURE__ */ t(N, { className: "h-[32px] w-[60px]" })
63
63
  ]
64
64
  }) : h?.length ? h.map((e, l) => {
65
65
  const a = !!(i ? r?.find((W) => s(W, e)) : s(r, e)), H = k ? k(e) : null;
66
66
  if (n && !a) return null;
67
67
  const x = typeof e == "object" ? !!e?.disabled : !1, S = !x && !n && l === F ? A : void 0;
68
- return /* @__PURE__ */ t(Q, {
68
+ return /* @__PURE__ */ t(J, {
69
69
  title: H,
70
70
  arrow: !0,
71
71
  children: /* @__PURE__ */ t("span", {
72
- className: y(x && "cursor-not-allowed"),
73
- children: n && !g ? /* @__PURE__ */ t(P, {
72
+ className: v(x && "cursor-not-allowed"),
73
+ children: n && !w ? /* @__PURE__ */ t(Q, {
74
74
  ref: S,
75
- disabled: !!C || x,
75
+ disabled: !!b || x,
76
76
  classes: { root: "min-h-[32px] h-full" },
77
77
  className: "w-fit",
78
78
  dataTest: `ic-${c(e)}`,
79
79
  label: o ? o(e) : u(e)
80
80
  }) : /* @__PURE__ */ t(O, {
81
81
  ref: S,
82
- disabled: !!C || x,
83
- classes: g ? {
82
+ disabled: !!b || x,
83
+ classes: w ? {
84
84
  root: "border-none outline-none bg-transparent w-full flex justify-start h-full min-h-[40px] shadow-none",
85
85
  label: "block whitespace-normal break-words overflow-visible"
86
86
  } : { root: "min-h-[32px] h-full" },
@@ -89,7 +89,7 @@ var he = _((V, A) => {
89
89
  type: i ? "checkbox" : "radio",
90
90
  dataTest: `ic-${c(e)}`,
91
91
  checked: a,
92
- size: b,
92
+ size: g,
93
93
  onClick: () => M(e),
94
94
  label: o ? o(e) : u(e)
95
95
  })
@@ -97,10 +97,10 @@ var he = _((V, A) => {
97
97
  }, c(e));
98
98
  }) : /* @__PURE__ */ t("span", { children: "-" })
99
99
  }),
100
- !D && K && !n && /* @__PURE__ */ t(U, {
100
+ !D && K && !n && !b && /* @__PURE__ */ t(U, {
101
101
  dataTest: "clear-selection-btn",
102
102
  variant: "text",
103
- startIcon: b === "medium" ? /* @__PURE__ */ t(j, {
103
+ startIcon: g === "medium" ? /* @__PURE__ */ t(j, {
104
104
  height: 24,
105
105
  width: 24,
106
106
  className: "size-6"
@@ -110,15 +110,15 @@ var he = _((V, A) => {
110
110
  className: "size-5"
111
111
  }),
112
112
  className: "w-fit",
113
- size: b,
113
+ size: g,
114
114
  onClick: () => p(i ? [] : null),
115
115
  children: B ?? (z === "en" ? "Clear selection" : "Fjern valget")
116
116
  }),
117
- /* @__PURE__ */ N("div", {
117
+ /* @__PURE__ */ T("div", {
118
118
  id: q,
119
119
  role: G,
120
- className: y("flex min-h-[24px] items-center gap-1 pt-1 text-sm/5 text-delta-600", f && "text-error-500"),
121
- children: [f && /* @__PURE__ */ t(J, {
120
+ className: v("flex min-h-[24px] items-center gap-1 pt-1 text-sm/5 text-delta-600", f && "text-error-500"),
121
+ children: [f && /* @__PURE__ */ t(P, {
122
122
  width: 20,
123
123
  height: 20,
124
124
  className: "min-w-5"