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