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.
- package/dist/asma-ui-core.css +1 -1
- package/dist/components/custom/module/header-layout/DynamicToolbar.js +99 -97
- package/dist/components/custom/module/header-layout/ToolbarActionGroup.js +60 -41
- package/dist/components/custom/module/header-layout/ToolbarRows.js +51 -47
- package/dist/components/custom/module/header-layout/useTranslations.js +12 -10
- package/dist/components/custom/page/page-header/PageHeader.js +41 -40
- package/dist/components/custom/widget/widget/StyledWidget.js +21 -20
- package/dist/components/data-display/chip/StyledChip.js +70 -53
- package/dist/components/data-display/tooltip/StyledTooltip.js +116 -73
- package/dist/components/feedback/dialog/DialogBusyContext.js +32 -0
- package/dist/components/feedback/dialog/StyledDialog.js +81 -72
- package/dist/components/feedback/dialog/dialog-footer/StyledDialogFooter.js +76 -71
- package/dist/components/feedback/minimizable-dialog/MinimizableDialog.js +133 -137
- package/dist/components/feedback/minimizable-dialog/components/CloseBtn.js +11 -8
- package/dist/components/feedback/minimizable-dialog/components/FullscreenBtn.js +6 -6
- package/dist/components/feedback/minimizable-dialog/components/MinimizeBtn.js +1 -1
- package/dist/components/feedback/minimizable-dialog/v2/MinimizableDialogV2.js +108 -88
- package/dist/components/feedback/minimizable-dialog/v2/useTranslations.js +6 -4
- package/dist/components/inputs/button/StyledButton.js +83 -33
- package/dist/components/inputs/button/StyledButton.module.js +13 -13
- package/dist/components/inputs/dynamic-select/components/DynamicInteractiveChipGroup.js +32 -32
- package/dist/components/inputs/dynamic-select/components/DynamicSelectAutocomplete.js +6 -6
- package/dist/components/inputs/select/StyledSelect.js +8 -8
- package/dist/components/inputs/select-autocomplete/StyledSelectAutocomplete.js +14 -14
- package/dist/components/navigation/link/StyledLink.js +53 -26
- package/dist/components/navigation/link/StyledLink.module.js +6 -6
- package/dist/components/navigation/menu/StyledMenuItem.js +35 -30
- package/dist/components/navigation/tabs/StyledTab.js +23 -25
- package/dist/components/utils/bottom-sheet/StyledBottomSheet.js +6 -6
- package/dist/components/utils/copy-wrapper/CopyButton.js +4 -4
- package/dist/components/utils/copy-wrapper/CopyWrapper.js +4 -4
- package/dist/datetime/components/date-picker/components/BaseDatePickerInput.js +66 -56
- package/dist/datetime/components/date-picker/components/DatePickerInputSingle.js +13 -12
- package/dist/datetime/components/time-picker/TimePickerInput.js +47 -39
- package/dist/datetime/helpers/getTitleLabelling.js +10 -0
- package/dist/datetime/shared-components/button/StyledButton.module.js +11 -11
- package/dist/helpers/focusable.js +2 -2
- package/dist/index.js +589 -585
- package/dist/src/components/custom/module/header-layout/ToolbarActionGroup.d.ts +13 -2
- package/dist/src/components/custom/module/header-layout/ToolbarRows.d.ts +2 -1
- package/dist/src/components/custom/module/header-layout/planToolbarActions.d.ts +18 -1
- package/dist/src/components/custom/module/header-layout/useTranslations.d.ts +2 -0
- package/dist/src/components/custom/widget/widget/StyledWidget.d.ts +5 -0
- package/dist/src/components/data-display/chip/StyledChip.d.ts +6 -0
- package/dist/src/components/data-display/interactive-chip/StyledInteractiveChip.d.ts +7 -1
- package/dist/src/components/data-display/tooltip/StyledTooltip.d.ts +16 -2
- package/dist/src/components/feedback/dialog/DialogBusy.test.d.ts +1 -0
- package/dist/src/components/feedback/dialog/DialogBusyContext.d.ts +28 -0
- package/dist/src/components/feedback/dialog/StyledDialog.d.ts +5 -0
- package/dist/src/components/feedback/dialog/dialog-footer/StyledDialogFooter.d.ts +9 -8
- package/dist/src/components/feedback/dialog/index.d.ts +1 -0
- package/dist/src/components/feedback/minimizable-dialog/components/CloseBtn.d.ts +2 -0
- package/dist/src/components/feedback/minimizable-dialog/types.d.ts +11 -0
- package/dist/src/components/feedback/minimizable-dialog/v2/types.d.ts +2 -0
- package/dist/src/components/feedback/minimizable-dialog/v2/useTranslations.d.ts +2 -0
- package/dist/src/components/inputs/button/StyledButton.d.ts +25 -1
- package/dist/src/components/inputs/button/StyledButtonBusy.test.d.ts +1 -0
- package/dist/src/components/navigation/link/StyledLink.d.ts +6 -0
- package/dist/src/components/navigation/menu/StyledMenuItem.d.ts +8 -1
- package/dist/src/components/navigation/tabs/StyledTab.d.ts +6 -0
- package/dist/src/datetime/components/date-picker/components/BaseDatePickerInput.d.ts +2 -0
- package/dist/src/datetime/components/date-picker/types.d.ts +6 -0
- package/dist/src/datetime/components/time-picker/types.d.ts +6 -1
- package/dist/src/datetime/helpers/getTitleLabelling.d.ts +12 -0
- package/dist/src/forms/submitChanged.d.ts +3 -0
- package/dist/src/helpers/focusable.d.ts +8 -0
- package/dist/src/helpers/index.d.ts +1 -0
- package/dist/src/helpers/uiCoreLocale.d.ts +1 -0
- package/dist/src/table/shared-components/StyledMenuItem.d.ts +5 -1
- package/dist/table/components/columns/action-column/components/RowActionMenu.js +63 -69
- package/dist/table/shared-components/StyledMenuItem.js +28 -16
- package/package.json +1 -1
|
@@ -1,97 +1,102 @@
|
|
|
1
|
-
import { cn as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { StyledButton as
|
|
6
|
-
import { StyledMenu as
|
|
7
|
-
import { StyledMenuItem as
|
|
8
|
-
import { useElementWidthPx as
|
|
9
|
-
import { useWidthRegistry as
|
|
10
|
-
import { planToolbarActions as
|
|
11
|
-
import { ToolbarActionButton as
|
|
12
|
-
import { useToolbarTranslations as
|
|
13
|
-
import { useMemo as
|
|
14
|
-
import { Fragment as
|
|
15
|
-
var
|
|
16
|
-
function
|
|
17
|
-
const
|
|
1
|
+
import { cn as j } from "../../../../helpers/cn.js";
|
|
2
|
+
import { StyledTooltip as K } from "../../../data-display/tooltip/StyledTooltip.js";
|
|
3
|
+
import { DotsVerticalIcon as U } from "../../../icons/dots-vertical-icon/DotsVerticalIcon.js";
|
|
4
|
+
import { DialogBusyContext as H, WAIT_UNTIL_SAVED as V, useReportDialogBusy as G } from "../DialogBusyContext.js";
|
|
5
|
+
import { StyledButton as P } from "../../../inputs/button/StyledButton.js";
|
|
6
|
+
import { StyledMenu as X } from "../../../navigation/menu/StyledMenu.js";
|
|
7
|
+
import { StyledMenuItem as Y } from "../../../navigation/menu/StyledMenuItem.js";
|
|
8
|
+
import { useElementWidthPx as q } from "../../../../hooks/useElementWidthPx.js";
|
|
9
|
+
import { useWidthRegistry as J } from "../../../../hooks/useWidthRegistry.js";
|
|
10
|
+
import { planToolbarActions as Q } from "../../../custom/module/header-layout/planToolbarActions.js";
|
|
11
|
+
import { ToolbarActionButton as Z, overflowItemState as ee } from "../../../custom/module/header-layout/ToolbarActionGroup.js";
|
|
12
|
+
import { useToolbarTranslations as oe } from "../../../custom/module/header-layout/useTranslations.js";
|
|
13
|
+
import { useContext as re, useMemo as R, useState as le } from "react";
|
|
14
|
+
import { Fragment as _, jsx as o, jsxs as d } from "react/jsx-runtime";
|
|
15
|
+
var ne = 2, ie = 470, te = 8, M = "dialog-footer-right", O = "dialog-footer-more", k = (l, n) => `dialog-footer-action:${l}:${n ? "label" : "icon"}`;
|
|
16
|
+
function Te({ leftActions: l = [], leadingSlot: n, secondaryAction: c, primaryAction: m, fixed: E = !1, rounded: W = !0, locale: i = "en", className: S, dataTest: f = "styled-dialog-footer" }) {
|
|
17
|
+
const b = re(H), p = oe(i), { ref: L, widthPx: h } = q(), { register: u, widths: t } = J(), [g, x] = le(null), y = h > 0 && h < ie, D = y ? 8 : 16, a = R(() => l.filter((e) => !e.hidden).map((e) => e.icon == null && e.canHideLabel == null ? {
|
|
18
18
|
...e,
|
|
19
19
|
canHideLabel: !1
|
|
20
|
-
} : e), [l]),
|
|
20
|
+
} : e), [l]), $ = t[M] ?? 0, T = c != null || m != null, B = Math.max(0, h - D * 2 - $ - (T ? te : 0)), s = R(() => a.length >= ne ? {
|
|
21
21
|
inlineActions: [],
|
|
22
|
-
overflowActions:
|
|
22
|
+
overflowActions: a,
|
|
23
23
|
showMoreMenu: !0
|
|
24
|
-
} :
|
|
25
|
-
actions:
|
|
26
|
-
availableWidth:
|
|
24
|
+
} : Q({
|
|
25
|
+
actions: a,
|
|
26
|
+
availableWidth: B,
|
|
27
27
|
collapseLabels: !0,
|
|
28
|
-
resolveActionWidth: (e,
|
|
29
|
-
moreButtonWidthPx: t[
|
|
28
|
+
resolveActionWidth: (e, r) => t[k(e.id, r)],
|
|
29
|
+
moreButtonWidthPx: t[O]
|
|
30
30
|
}), [
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
a,
|
|
32
|
+
B,
|
|
33
33
|
t
|
|
34
|
-
])
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
]);
|
|
35
|
+
G(n == null && s.overflowActions.some((e) => !!e.loading && e.holdsDialog !== !1));
|
|
36
|
+
const C = (e, r, w) => {
|
|
37
|
+
const N = w === "secondary" && b?.busy, v = !!e.disabled || !!N, A = N ? b.busyReason ?? V[i] : e.tooltip, I = v || !!e.loading, z = /* @__PURE__ */ o(P, {
|
|
38
|
+
locale: i,
|
|
39
|
+
dataTest: e.dataTest ?? `${f}-${w}`,
|
|
40
|
+
variant: e.variant ?? r,
|
|
38
41
|
error: e.tone === "danger",
|
|
39
42
|
size: "medium",
|
|
40
43
|
type: e.type ?? "button",
|
|
41
|
-
|
|
44
|
+
disabled: v && !!A,
|
|
45
|
+
"aria-disabled": I || void 0,
|
|
46
|
+
disabledReason: A,
|
|
47
|
+
loading: !!e.loading,
|
|
42
48
|
startIcon: e.icon,
|
|
43
|
-
endIcon: e.
|
|
44
|
-
|
|
45
|
-
height: 20
|
|
46
|
-
}) : e.endIcon,
|
|
47
|
-
onClick: T ? (S) => S.preventDefault() : e.onClick,
|
|
49
|
+
endIcon: e.endIcon,
|
|
50
|
+
onClick: I ? (F) => F.preventDefault() : e.onClick,
|
|
48
51
|
"aria-label": e.ariaLabel,
|
|
49
|
-
"aria-busy": e.loading,
|
|
50
52
|
children: e.label
|
|
51
53
|
});
|
|
52
|
-
return
|
|
54
|
+
return /* @__PURE__ */ o(K, {
|
|
53
55
|
arrow: !0,
|
|
54
56
|
title: e.tooltip,
|
|
55
|
-
|
|
57
|
+
open: v || !e.tooltip ? !1 : void 0,
|
|
58
|
+
children: /* @__PURE__ */ o("span", {
|
|
56
59
|
className: "inline-flex",
|
|
57
|
-
children:
|
|
60
|
+
children: z
|
|
58
61
|
})
|
|
59
|
-
})
|
|
62
|
+
});
|
|
60
63
|
};
|
|
61
|
-
return /* @__PURE__ */
|
|
62
|
-
ref:
|
|
63
|
-
"data-testid":
|
|
64
|
-
className:
|
|
65
|
-
children: [/* @__PURE__ */
|
|
64
|
+
return /* @__PURE__ */ d("div", {
|
|
65
|
+
ref: L,
|
|
66
|
+
"data-testid": f,
|
|
67
|
+
className: j("flex items-center justify-end self-stretch border-0 border-t border-solid border-delta-200 bg-white", y ? "gap-2 p-2" : "gap-4 p-4", W && "rounded-b-lg", E && "sticky bottom-0 z-[1]", S),
|
|
68
|
+
children: [/* @__PURE__ */ o("div", {
|
|
66
69
|
className: "flex shrink-0 flex-nowrap items-center gap-2",
|
|
67
|
-
children:
|
|
68
|
-
ref:
|
|
70
|
+
children: n ?? /* @__PURE__ */ d(_, { children: [s.inlineActions.map(({ action: e, showLabel: r }) => /* @__PURE__ */ o("span", {
|
|
71
|
+
ref: u(k(e.id, r)),
|
|
69
72
|
className: "inline-flex shrink-0",
|
|
70
|
-
children: /* @__PURE__ */
|
|
73
|
+
children: /* @__PURE__ */ o(Z, {
|
|
71
74
|
action: e,
|
|
72
|
-
showLabel:
|
|
75
|
+
showLabel: r,
|
|
76
|
+
inProgressLabel: p.inProgress
|
|
73
77
|
})
|
|
74
|
-
}, e.id)),
|
|
75
|
-
ref:
|
|
78
|
+
}, e.id)), s.showMoreMenu && /* @__PURE__ */ d(_, { children: [/* @__PURE__ */ o("span", {
|
|
79
|
+
ref: u(O),
|
|
76
80
|
className: "inline-flex shrink-0",
|
|
77
|
-
children: /* @__PURE__ */
|
|
78
|
-
|
|
81
|
+
children: /* @__PURE__ */ o(P, {
|
|
82
|
+
locale: i,
|
|
83
|
+
dataTest: `${f}-more`,
|
|
79
84
|
variant: "outlined",
|
|
80
85
|
size: "medium",
|
|
81
86
|
type: "button",
|
|
82
|
-
onClick: (e) =>
|
|
83
|
-
"aria-label":
|
|
87
|
+
onClick: (e) => x(e.currentTarget),
|
|
88
|
+
"aria-label": p.more,
|
|
84
89
|
"aria-haspopup": "menu",
|
|
85
|
-
"aria-expanded":
|
|
86
|
-
startIcon: /* @__PURE__ */
|
|
90
|
+
"aria-expanded": g != null,
|
|
91
|
+
startIcon: /* @__PURE__ */ o(U, {
|
|
87
92
|
width: 24,
|
|
88
93
|
height: 24
|
|
89
94
|
})
|
|
90
95
|
})
|
|
91
|
-
}), /* @__PURE__ */
|
|
92
|
-
anchorEl:
|
|
93
|
-
open:
|
|
94
|
-
onClose: () =>
|
|
96
|
+
}), /* @__PURE__ */ o(X, {
|
|
97
|
+
anchorEl: g,
|
|
98
|
+
open: g != null,
|
|
99
|
+
onClose: () => x(null),
|
|
95
100
|
anchorOrigin: {
|
|
96
101
|
vertical: "top",
|
|
97
102
|
horizontal: "left"
|
|
@@ -100,27 +105,27 @@ function pe({ leftActions: l = [], leadingSlot: a, secondaryAction: s, primaryAc
|
|
|
100
105
|
vertical: "bottom",
|
|
101
106
|
horizontal: "left"
|
|
102
107
|
},
|
|
103
|
-
children:
|
|
104
|
-
|
|
108
|
+
children: s.overflowActions.map((e) => /* @__PURE__ */ o(Y, {
|
|
109
|
+
...ee(e, p.inProgress),
|
|
105
110
|
onClick: () => {
|
|
106
|
-
|
|
111
|
+
x(null), e.onClick();
|
|
107
112
|
},
|
|
108
|
-
children: /* @__PURE__ */
|
|
113
|
+
children: /* @__PURE__ */ o("span", {
|
|
109
114
|
className: e.tone === "danger" ? "text-beta-500" : "text-delta-700",
|
|
110
115
|
children: e.label
|
|
111
116
|
})
|
|
112
117
|
}, e.id))
|
|
113
118
|
})] })] })
|
|
114
|
-
}),
|
|
119
|
+
}), T && /* @__PURE__ */ o("span", {
|
|
115
120
|
className: "flex min-w-px flex-1 flex-nowrap items-center justify-end",
|
|
116
|
-
children: /* @__PURE__ */
|
|
117
|
-
ref:
|
|
121
|
+
children: /* @__PURE__ */ d("span", {
|
|
122
|
+
ref: u(M),
|
|
118
123
|
className: "flex shrink-0 flex-nowrap items-center gap-2",
|
|
119
|
-
children: [
|
|
124
|
+
children: [c && C(c, "outlined", "secondary"), m && C(m, "contained", "primary")]
|
|
120
125
|
})
|
|
121
126
|
})]
|
|
122
127
|
});
|
|
123
128
|
}
|
|
124
129
|
export {
|
|
125
|
-
|
|
130
|
+
Te as StyledDialogFooter
|
|
126
131
|
};
|
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
import { cn as h } from "../../../helpers/cn.js";
|
|
2
|
-
import {
|
|
3
|
-
import { LoadingIcon as A } from "../../icons/loading-icon/LoadingIcon.js";
|
|
4
|
-
import { CloseIcon as K } from "../../icons/close-icon/CloseIcon.js";
|
|
5
|
-
import { MinimizeIcon as oe } from "../../icons/minimize-icon/MinimizeIcon.js";
|
|
6
|
-
import { KeyboardCapslockIcon as se } from "../../icons/keyboard-capslock-icon/KeyboardCapslockIcon.js";
|
|
7
|
-
import { ArrowExpandIcon as ce } from "../../icons/arrow-expand-icon/ArrowExpandIcon.js";
|
|
8
|
-
import { ArrowShrinkIcon as me } from "../../icons/arrow-shrink-icon/ArrowShrinkIcon.js";
|
|
9
|
-
import { firstTabbable as he } from "../../../helpers/focusable.js";
|
|
2
|
+
import { firstTabbable as me } from "../../../helpers/focusable.js";
|
|
10
3
|
import { StyledTooltip as f } from "../../data-display/tooltip/StyledTooltip.js";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import
|
|
16
|
-
import {
|
|
17
|
-
import
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
4
|
+
import { DotsVerticalIcon as he } from "../../icons/dots-vertical-icon/DotsVerticalIcon.js";
|
|
5
|
+
import { CloseIcon as P } from "../../icons/close-icon/CloseIcon.js";
|
|
6
|
+
import { MinimizeIcon as fe } from "../../icons/minimize-icon/MinimizeIcon.js";
|
|
7
|
+
import { KeyboardCapslockIcon as ue } from "../../icons/keyboard-capslock-icon/KeyboardCapslockIcon.js";
|
|
8
|
+
import { ArrowExpandIcon as be } from "../../icons/arrow-expand-icon/ArrowExpandIcon.js";
|
|
9
|
+
import { ArrowShrinkIcon as ve } from "../../icons/arrow-shrink-icon/ArrowShrinkIcon.js";
|
|
10
|
+
import { StyledButton as n } from "../../inputs/button/StyledButton.js";
|
|
11
|
+
import { useFocusTrap as pe } from "../../../hooks/useFocusTrap.hook.js";
|
|
12
|
+
import { StyledMenu as ge } from "../../navigation/menu/StyledMenu.js";
|
|
13
|
+
import { StyledMenuItem as xe } from "../../navigation/menu/StyledMenuItem.js";
|
|
14
|
+
import T from "./MinimizableDialog.module.js";
|
|
15
|
+
import { useToggleMenuVisibility as ye } from "../../../hooks/useToggleMenuVisibility.hook.js";
|
|
16
|
+
import H from "clsx";
|
|
17
|
+
import { useLayoutEffect as ke, useRef as J, useState as Q } from "react";
|
|
18
|
+
import { Fragment as v, jsx as e, jsxs as l } from "react/jsx-runtime";
|
|
19
|
+
var $e = ({ onCloseText: u = "", onMinimizeText: N = "", onExpandText: I = "", onFullScreenText: C = "", showCloseIcon: M = !0, showMinimizeIcon: X = !0, showExpandIcon: Y = !0, showFullScreenIcon: Z = !0, title: c, label: p, children: g, open: j, onClose: L, className: R = "", primaryButtonText: S, primaryButtonLoading: r = !1, primaryButtonDisabled: B, primaryButtonDisabledReason: ee, secondaryButtonText: x, onPrimaryButtonClick: F, onSecondaryButtonClick: _, dataTest: E, actionNode: te, extraActions: d, extraActionsText: m, btnContainerClassName: G, footerClassName: ie, footerInfo: D, locale: t = "en", enableFullscreen: le = !0, fullScreenState: V, handleFullScreenState: q }) => {
|
|
20
|
+
const [i, ne] = Q(!1), [O, re] = Q(!1), { open: de, anchorEl: ae, handleOpen: oe, handleClose: se } = ye(), b = J(null), y = J(null), k = t === "en" ? "Wait until saved" : "Vent til lagringen er ferdig", w = () => {
|
|
21
|
+
r || L();
|
|
22
|
+
}, a = V ?? O, o = a && !i;
|
|
23
|
+
if (pe(j && o, b, w), ke(() => {
|
|
24
|
+
b.current?.toggleAttribute("inert", i), y.current?.toggleAttribute("inert", !i);
|
|
25
|
+
}, [i]), !j) return null;
|
|
26
|
+
const ce = o ? {
|
|
26
27
|
right: "auto",
|
|
27
28
|
bottom: "auto",
|
|
28
29
|
left: "50%",
|
|
@@ -30,51 +31,69 @@ var Oe = ({ onCloseText: u = "", onMinimizeText: j = "", onExpandText: C = "", o
|
|
|
30
31
|
transform: "translate(-50%, -50%)",
|
|
31
32
|
width: "min(1000px, calc(100vw - 32px))",
|
|
32
33
|
height: "95dvh"
|
|
33
|
-
} : void 0, U =
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
} : void 0, U = a ? t === "en" ? "Exit full screen" : "Avslutt fullskjerm" : t === "en" ? "Full screen" : "Fullskjerm", W = S ?? r, $ = W || x, A = /* @__PURE__ */ l(v, { children: [x && _ && /* @__PURE__ */ e(n, {
|
|
35
|
+
dataTest: "cancel-button",
|
|
36
|
+
variant: "outlined",
|
|
37
|
+
disabled: r,
|
|
38
|
+
disabledReason: k,
|
|
39
|
+
onClick: _,
|
|
40
|
+
children: x
|
|
41
|
+
}), W && F && /* @__PURE__ */ e(n, {
|
|
42
|
+
dataTest: "save-button",
|
|
43
|
+
loading: r,
|
|
44
|
+
locale: t,
|
|
45
|
+
disabled: B,
|
|
46
|
+
disabledReason: ee,
|
|
47
|
+
onClick: F,
|
|
48
|
+
children: S
|
|
49
|
+
})] }), K = () => {
|
|
50
|
+
const s = i ? b : y;
|
|
51
|
+
ne(!i), requestAnimationFrame(() => {
|
|
52
|
+
const z = s.current;
|
|
53
|
+
z && (z.querySelector('[data-testid="minimize-button"]') ?? me(z))?.focus({ preventScroll: !0 });
|
|
38
54
|
});
|
|
39
55
|
};
|
|
40
|
-
return /* @__PURE__ */
|
|
41
|
-
|
|
56
|
+
return /* @__PURE__ */ l(v, { children: [
|
|
57
|
+
o && /* @__PURE__ */ e("div", { className: "fixed inset-0 z-[51] bg-[rgb(98,110,126)] bg-opacity-70" }),
|
|
42
58
|
/* @__PURE__ */ e("div", {
|
|
43
|
-
ref:
|
|
59
|
+
ref: y,
|
|
44
60
|
style: { zIndex: 51 },
|
|
45
|
-
className: h(
|
|
46
|
-
children: /* @__PURE__ */
|
|
47
|
-
className:
|
|
48
|
-
"data-testid":
|
|
61
|
+
className: h(T.dialog, !i && T.hidden),
|
|
62
|
+
children: /* @__PURE__ */ l("div", {
|
|
63
|
+
className: H("flex items-center justify-between", !i && "hidden"),
|
|
64
|
+
"data-testid": E,
|
|
49
65
|
children: [/* @__PURE__ */ e("div", {
|
|
50
66
|
className: "truncate text-lg font-semibold text-delta-800",
|
|
51
|
-
children:
|
|
52
|
-
}), /* @__PURE__ */
|
|
67
|
+
children: c
|
|
68
|
+
}), /* @__PURE__ */ l("div", {
|
|
53
69
|
className: "flex items-center gap-x-1",
|
|
54
|
-
children: [
|
|
55
|
-
title:
|
|
56
|
-
children: /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
70
|
+
children: [Y && /* @__PURE__ */ e(f, {
|
|
71
|
+
title: t === "en" ? "Expand" : "Utvid",
|
|
72
|
+
children: /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(n, {
|
|
57
73
|
dataTest: "minimize-button",
|
|
58
|
-
"aria-label":
|
|
74
|
+
"aria-label": I ? void 0 : t === "en" ? "Expand" : "Utvid",
|
|
59
75
|
variant: "text",
|
|
60
76
|
size: "small",
|
|
61
|
-
onClick:
|
|
62
|
-
endIcon: /* @__PURE__ */ e(
|
|
77
|
+
onClick: K,
|
|
78
|
+
endIcon: /* @__PURE__ */ e(ue, {
|
|
63
79
|
height: 20,
|
|
64
80
|
width: 20,
|
|
65
81
|
color: "text-gama-500"
|
|
66
82
|
}),
|
|
67
|
-
children:
|
|
83
|
+
children: I
|
|
68
84
|
}) })
|
|
69
|
-
}),
|
|
70
|
-
title:
|
|
71
|
-
|
|
85
|
+
}), M && /* @__PURE__ */ e(f, {
|
|
86
|
+
title: t === "en" ? "Close" : "Lukk",
|
|
87
|
+
open: r ? !1 : void 0,
|
|
88
|
+
children: /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(n, {
|
|
72
89
|
dataTest: "close-button",
|
|
73
|
-
"aria-label": u ? void 0 :
|
|
90
|
+
"aria-label": u ? void 0 : t === "en" ? "Close" : "Lukk",
|
|
74
91
|
variant: "textGray",
|
|
75
92
|
size: "small",
|
|
93
|
+
disabled: r,
|
|
94
|
+
disabledReason: k,
|
|
76
95
|
onClick: w,
|
|
77
|
-
endIcon: /* @__PURE__ */ e(
|
|
96
|
+
endIcon: /* @__PURE__ */ e(P, {
|
|
78
97
|
height: 20,
|
|
79
98
|
width: 20,
|
|
80
99
|
color: "text-delta-700"
|
|
@@ -85,75 +104,78 @@ var Oe = ({ onCloseText: u = "", onMinimizeText: j = "", onExpandText: C = "", o
|
|
|
85
104
|
})]
|
|
86
105
|
})
|
|
87
106
|
}),
|
|
88
|
-
/* @__PURE__ */
|
|
107
|
+
/* @__PURE__ */ l("div", {
|
|
89
108
|
ref: b,
|
|
90
|
-
style:
|
|
91
|
-
role:
|
|
92
|
-
"aria-modal":
|
|
93
|
-
"aria-label":
|
|
94
|
-
className: h("fixed bottom-4 right-4 z-[51] rounded-lg bg-white shadow-[0_4px_40px_0px_rgba(34,33,51,0.4)] transition-all duration-300",
|
|
95
|
-
"data-testid":
|
|
96
|
-
children: [/* @__PURE__ */
|
|
109
|
+
style: ce,
|
|
110
|
+
role: o ? "dialog" : void 0,
|
|
111
|
+
"aria-modal": o ? !0 : void 0,
|
|
112
|
+
"aria-label": o && typeof c == "string" ? c : void 0,
|
|
113
|
+
className: h("fixed bottom-4 right-4 z-[51] rounded-lg bg-white shadow-[0_4px_40px_0px_rgba(34,33,51,0.4)] transition-all duration-300", R && !i && !a ? R : "", i && "!h-0 !w-0 opacity-0 duration-0", o && "fixed duration-0"),
|
|
114
|
+
"data-testid": E,
|
|
115
|
+
children: [/* @__PURE__ */ l("div", {
|
|
97
116
|
className: "flex flex-col gap-y-2 border-b-[1px] border-delta-200 p-4",
|
|
98
|
-
children: [/* @__PURE__ */
|
|
117
|
+
children: [/* @__PURE__ */ l("div", {
|
|
99
118
|
className: "flex items-center justify-between",
|
|
100
|
-
children: [
|
|
119
|
+
children: [p ? /* @__PURE__ */ e("div", {
|
|
101
120
|
className: "text-sm text-delta-700",
|
|
102
|
-
children:
|
|
121
|
+
children: p
|
|
103
122
|
}) : /* @__PURE__ */ e("div", {
|
|
104
123
|
className: "text-2xl font-semibold text-delta-800",
|
|
105
|
-
children:
|
|
106
|
-
}), /* @__PURE__ */
|
|
124
|
+
children: c
|
|
125
|
+
}), /* @__PURE__ */ l("div", {
|
|
107
126
|
className: "flex items-center gap-x-1",
|
|
108
127
|
children: [
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
title:
|
|
112
|
-
children: /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
128
|
+
te,
|
|
129
|
+
X && !a && /* @__PURE__ */ e(f, {
|
|
130
|
+
title: t === "en" ? "Minimize" : "Minimer",
|
|
131
|
+
children: /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(n, {
|
|
113
132
|
dataTest: "minimize-button",
|
|
114
|
-
"aria-label":
|
|
133
|
+
"aria-label": N ? void 0 : t === "en" ? "Minimize" : "Minimer",
|
|
115
134
|
variant: "textGray",
|
|
116
135
|
size: "small",
|
|
117
|
-
onClick:
|
|
118
|
-
endIcon: /* @__PURE__ */ e(
|
|
136
|
+
onClick: K,
|
|
137
|
+
endIcon: /* @__PURE__ */ e(fe, {
|
|
119
138
|
height: 20,
|
|
120
139
|
width: 20,
|
|
121
140
|
color: "text-delta-700"
|
|
122
141
|
}),
|
|
123
|
-
children:
|
|
142
|
+
children: N
|
|
124
143
|
}) })
|
|
125
144
|
}),
|
|
126
|
-
|
|
145
|
+
le && Z && /* @__PURE__ */ e(f, {
|
|
127
146
|
title: U,
|
|
128
|
-
children: /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
147
|
+
children: /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(n, {
|
|
129
148
|
dataTest: "fullscreen-button",
|
|
130
|
-
"aria-label":
|
|
149
|
+
"aria-label": C ? void 0 : U,
|
|
131
150
|
variant: "textGray",
|
|
132
151
|
size: "small",
|
|
133
152
|
onClick: () => {
|
|
134
|
-
|
|
153
|
+
V !== void 0 && q ? q() : re(!O);
|
|
135
154
|
},
|
|
136
|
-
endIcon:
|
|
155
|
+
endIcon: a ? /* @__PURE__ */ e(ve, {
|
|
137
156
|
width: 20,
|
|
138
157
|
height: 20,
|
|
139
158
|
color: "text-delta-700"
|
|
140
|
-
}) : /* @__PURE__ */ e(
|
|
159
|
+
}) : /* @__PURE__ */ e(be, {
|
|
141
160
|
width: 20,
|
|
142
161
|
height: 20,
|
|
143
162
|
color: "text-delta-700"
|
|
144
163
|
}),
|
|
145
|
-
children:
|
|
164
|
+
children: C
|
|
146
165
|
}) })
|
|
147
166
|
}),
|
|
148
|
-
|
|
149
|
-
title:
|
|
150
|
-
|
|
167
|
+
M && /* @__PURE__ */ e(f, {
|
|
168
|
+
title: t === "en" ? "Close" : "Lukk",
|
|
169
|
+
open: r ? !1 : void 0,
|
|
170
|
+
children: /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(n, {
|
|
151
171
|
dataTest: "close-button",
|
|
152
|
-
"aria-label": u ? void 0 :
|
|
172
|
+
"aria-label": u ? void 0 : t === "en" ? "Close" : "Lukk",
|
|
153
173
|
variant: "textGray",
|
|
154
174
|
size: "small",
|
|
175
|
+
disabled: r,
|
|
176
|
+
disabledReason: k,
|
|
155
177
|
onClick: w,
|
|
156
|
-
endIcon: /* @__PURE__ */ e(
|
|
178
|
+
endIcon: /* @__PURE__ */ e(P, {
|
|
157
179
|
height: 20,
|
|
158
180
|
width: 20,
|
|
159
181
|
color: "text-delta-700"
|
|
@@ -163,83 +185,57 @@ var Oe = ({ onCloseText: u = "", onMinimizeText: j = "", onExpandText: C = "", o
|
|
|
163
185
|
})
|
|
164
186
|
]
|
|
165
187
|
})]
|
|
166
|
-
}),
|
|
188
|
+
}), p && /* @__PURE__ */ e("div", {
|
|
167
189
|
className: "truncate text-2xl font-semibold text-delta-800",
|
|
168
|
-
children:
|
|
190
|
+
children: c
|
|
169
191
|
})]
|
|
170
|
-
}), /* @__PURE__ */
|
|
171
|
-
className:
|
|
192
|
+
}), /* @__PURE__ */ l("div", {
|
|
193
|
+
className: H("flex flex-col", a && !i && "h-[87dvh]"),
|
|
172
194
|
children: [/* @__PURE__ */ e("div", {
|
|
173
195
|
className: "flex-grow overflow-y-auto overscroll-contain",
|
|
174
|
-
children: typeof
|
|
175
|
-
}), (Array.isArray(
|
|
176
|
-
className: h("flex items-center justify-between border-0 border-t-[1px] border-solid border-delta-200 bg-white p-4",
|
|
196
|
+
children: typeof g == "function" ? g({ fullScreen: a }) : g
|
|
197
|
+
}), (Array.isArray(d) && d.length || typeof d == "function") && m || D ? /* @__PURE__ */ l("div", {
|
|
198
|
+
className: h("flex items-center justify-between border-0 border-t-[1px] border-solid border-delta-200 bg-white p-4", ie),
|
|
177
199
|
children: [
|
|
178
|
-
Array.isArray(
|
|
200
|
+
Array.isArray(d) && d.length && m ? /* @__PURE__ */ l(v, { children: [/* @__PURE__ */ e(n, {
|
|
179
201
|
dataTest: "extra-actions-button",
|
|
180
202
|
variant: "textGray",
|
|
181
|
-
startIcon: /* @__PURE__ */ e(
|
|
203
|
+
startIcon: /* @__PURE__ */ e(he, {
|
|
182
204
|
width: 24,
|
|
183
205
|
height: 24
|
|
184
206
|
}),
|
|
185
|
-
onClick:
|
|
207
|
+
onClick: oe,
|
|
186
208
|
children: m
|
|
187
|
-
}), /* @__PURE__ */ e(
|
|
188
|
-
open:
|
|
189
|
-
anchorEl:
|
|
190
|
-
onClose:
|
|
191
|
-
children:
|
|
192
|
-
className:
|
|
193
|
-
onClick:
|
|
194
|
-
children:
|
|
195
|
-
},
|
|
196
|
-
})] }) : m && typeof
|
|
209
|
+
}), /* @__PURE__ */ e(ge, {
|
|
210
|
+
open: de,
|
|
211
|
+
anchorEl: ae,
|
|
212
|
+
onClose: se,
|
|
213
|
+
children: d.map((s) => /* @__PURE__ */ e(xe, {
|
|
214
|
+
className: s.className,
|
|
215
|
+
onClick: s.onClick,
|
|
216
|
+
children: s.label
|
|
217
|
+
}, s.label))
|
|
218
|
+
})] }) : m && typeof d == "function" && /* @__PURE__ */ e(n, {
|
|
197
219
|
dataTest: "extra-action-button",
|
|
198
220
|
variant: "text",
|
|
199
|
-
onClick:
|
|
221
|
+
onClick: d,
|
|
200
222
|
children: m
|
|
201
223
|
}),
|
|
202
224
|
" ",
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
className: h("flex justify-end gap-x-2",
|
|
206
|
-
children:
|
|
207
|
-
dataTest: "cancel-button",
|
|
208
|
-
variant: "outlined",
|
|
209
|
-
onClick: p,
|
|
210
|
-
children: c
|
|
211
|
-
}), N && v && /* @__PURE__ */ e(l, {
|
|
212
|
-
dataTest: "save-button",
|
|
213
|
-
startIcon: k && /* @__PURE__ */ e(A, {
|
|
214
|
-
width: 24,
|
|
215
|
-
height: 24
|
|
216
|
-
}),
|
|
217
|
-
onClick: v,
|
|
218
|
-
children: y
|
|
219
|
-
})]
|
|
225
|
+
D,
|
|
226
|
+
$ ? /* @__PURE__ */ e("div", {
|
|
227
|
+
className: h("flex justify-end gap-x-2", G),
|
|
228
|
+
children: A
|
|
220
229
|
}) : null
|
|
221
230
|
]
|
|
222
|
-
}) : /* @__PURE__ */ e(
|
|
223
|
-
className: h("flex justify-end gap-x-2 border-t-[1px] border-delta-200 p-4",
|
|
224
|
-
children:
|
|
225
|
-
dataTest: "cancel-button",
|
|
226
|
-
variant: "outlined",
|
|
227
|
-
onClick: p,
|
|
228
|
-
children: c
|
|
229
|
-
}), N && v && /* @__PURE__ */ e(l, {
|
|
230
|
-
dataTest: "save-button",
|
|
231
|
-
startIcon: k && /* @__PURE__ */ e(A, {
|
|
232
|
-
width: 24,
|
|
233
|
-
height: 24
|
|
234
|
-
}),
|
|
235
|
-
onClick: v,
|
|
236
|
-
children: y
|
|
237
|
-
})]
|
|
231
|
+
}) : /* @__PURE__ */ e(v, { children: $ ? /* @__PURE__ */ e("div", {
|
|
232
|
+
className: h("flex justify-end gap-x-2 border-t-[1px] border-delta-200 p-4", G),
|
|
233
|
+
children: A
|
|
238
234
|
}) : null })]
|
|
239
235
|
})]
|
|
240
236
|
})
|
|
241
237
|
] });
|
|
242
238
|
};
|
|
243
239
|
export {
|
|
244
|
-
|
|
240
|
+
$e as MinimizableDialog
|
|
245
241
|
};
|
|
@@ -1,19 +1,22 @@
|
|
|
1
|
-
import { CloseIcon as i } from "../../../icons/close-icon/CloseIcon.js";
|
|
2
1
|
import { StyledTooltip as n } from "../../../data-display/tooltip/StyledTooltip.js";
|
|
3
|
-
import {
|
|
2
|
+
import { CloseIcon as a } from "../../../icons/close-icon/CloseIcon.js";
|
|
3
|
+
import { StyledButton as m } from "../../../inputs/button/StyledButton.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import { jsx as t } from "react/jsx-runtime";
|
|
6
|
-
var
|
|
6
|
+
var u = ({ showCloseIcon: e, tooltipTitle: r, onClick: l, buttonRef: i, disabledReason: o }) => e ? /* @__PURE__ */ t(n, {
|
|
7
7
|
title: r,
|
|
8
8
|
placement: "top",
|
|
9
|
-
|
|
9
|
+
open: o ? !1 : void 0,
|
|
10
|
+
children: /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(m, {
|
|
10
11
|
dataTest: "close-button",
|
|
11
|
-
refLink:
|
|
12
|
+
refLink: i,
|
|
12
13
|
"aria-label": r,
|
|
13
14
|
variant: "textGray",
|
|
14
15
|
size: "small",
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
disabled: !!o,
|
|
17
|
+
disabledReason: o,
|
|
18
|
+
onClick: l,
|
|
19
|
+
endIcon: /* @__PURE__ */ t(a, {
|
|
17
20
|
height: 20,
|
|
18
21
|
width: 20,
|
|
19
22
|
color: "text-delta-700"
|
|
@@ -21,5 +24,5 @@ var h = ({ showCloseIcon: e, tooltipTitle: r, onClick: o, buttonRef: l }) => e ?
|
|
|
21
24
|
}) })
|
|
22
25
|
}) : null;
|
|
23
26
|
export {
|
|
24
|
-
|
|
27
|
+
u as CloseBtn
|
|
25
28
|
};
|