asma-ui-core 3.121.5 → 3.122.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/ToolbarRows.js +64 -60
- package/dist/components/custom/pathfinder-card/Pathfinder.module.js +14 -13
- package/dist/components/custom/pathfinder-card/PathfinderCard.js +64 -64
- package/dist/components/custom/widget/widget/StyledWidget.js +44 -37
- package/dist/components/custom/widget/widget-header/StyledWidgetHeader.js +7 -7
- package/dist/components/custom/widget/widget-title/StyledWidgetTitle.js +8 -8
- package/dist/components/data-display/chip/StyledChip.js +42 -42
- package/dist/components/data-display/form-label/components/StyledFormLabel.js +15 -15
- package/dist/components/feedback/dialog/StyledDialog.js +75 -75
- package/dist/components/feedback/dialog/StyledDialogActions.js +4 -4
- package/dist/components/feedback/dialog/StyledDialogTitle.js +13 -13
- package/dist/components/feedback/dialog/dialog-footer/StyledDialogFooter.js +70 -69
- package/dist/components/feedback/minimizable-dialog/MinimizableDialog.js +69 -69
- package/dist/components/feedback/minimizable-dialog/v2/MinimizableDialogV2.js +81 -81
- package/dist/components/feedback/snack-bar/StyledAlert.js +16 -16
- package/dist/components/inputs/button/StyledButton.js +36 -35
- package/dist/components/inputs/input-field/StyledInputField.js +38 -38
- package/dist/components/inputs/search-field/StyledSearchField.js +18 -17
- package/dist/components/miscellaneous/StyledFormControlLabel.js +13 -13
- package/dist/components/navigation/link/StyledLink.js +44 -44
- package/dist/components/navigation/title-chevron/StyledTitleChevron.js +13 -13
- package/dist/components/utils/bottom-sheet/StyledBottomSheet.js +45 -45
- package/dist/components/utils/popover/PopoverAnatomy.js +23 -23
- package/dist/hooks/useMediaQuery.hook.js +3 -2
- package/dist/src/components/custom/module/header-layout/ToolbarRows.d.ts +3 -1
- package/dist/src/hooks/useMediaQuery.hook.d.ts +2 -0
- package/dist/src/table/types.d.ts +8 -0
- package/dist/table/components/TableRow.js +89 -87
- package/package.json +1 -1
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { cn as
|
|
2
|
-
import { CloseIcon as
|
|
3
|
-
import { StyledButton as
|
|
4
|
-
import { ToolbarActionGroup as
|
|
5
|
-
import { formatSelectionLabel as
|
|
6
|
-
import { StyledWidgetTitle as
|
|
1
|
+
import { cn as a } from "../../../../helpers/cn.js";
|
|
2
|
+
import { CloseIcon as F } from "../../../icons/close-icon/CloseIcon.js";
|
|
3
|
+
import { StyledButton as I } from "../../../inputs/button/StyledButton.js";
|
|
4
|
+
import { ToolbarActionGroup as s, hasPlannedActions as p } from "./ToolbarActionGroup.js";
|
|
5
|
+
import { formatSelectionLabel as C } from "./useTranslations.js";
|
|
6
|
+
import { StyledWidgetTitle as G } 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 R({ 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(I, {
|
|
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(F, {
|
|
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: C(e, t)
|
|
24
24
|
})
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function H({ selectedCount: e, onClearSelection: n, translations: t, bulkActionsPlan: l }) {
|
|
28
28
|
return /* @__PURE__ */ r("div", {
|
|
29
|
-
className: "flex w-full min-w-0 flex-nowrap items-center justify-between gap-3",
|
|
30
|
-
children: [/* @__PURE__ */ i(
|
|
29
|
+
className: "flex w-full min-w-0 flex-nowrap items-center justify-between gap-3 max-xs:flex-wrap max-xs:gap-y-2",
|
|
30
|
+
children: [/* @__PURE__ */ i(R, {
|
|
31
31
|
selectedCount: e,
|
|
32
32
|
onClearSelection: n,
|
|
33
33
|
translations: t
|
|
34
|
-
}), /* @__PURE__ */ i(
|
|
34
|
+
}), /* @__PURE__ */ i(s, {
|
|
35
35
|
plan: l,
|
|
36
36
|
overflowMenuLabel: t.more,
|
|
37
37
|
inProgressLabel: t.inProgress,
|
|
@@ -39,39 +39,39 @@ function D({ selectedCount: e, onClearSelection: n, translations: t, bulkActions
|
|
|
39
39
|
})]
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function B({ search: e, expanded: n, measureRef: t }) {
|
|
43
43
|
return /* @__PURE__ */ i("div", {
|
|
44
44
|
ref: n ? void 0 : t,
|
|
45
45
|
style: n ? { "--dynamic-toolbar-search-width": "100%" } : void 0,
|
|
46
|
-
className:
|
|
46
|
+
className: a(n ? "min-w-0 flex-1 max-xs:basis-full" : "w-40 shrink-0"),
|
|
47
47
|
children: e
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function T({ visible: e, flattenBelowXs: n = !1, children: t }) {
|
|
51
51
|
return /* @__PURE__ */ i("div", {
|
|
52
|
-
className:
|
|
52
|
+
className: a("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", n && "max-xs:contents"),
|
|
53
53
|
"aria-hidden": !e,
|
|
54
54
|
children: /* @__PURE__ */ i("div", {
|
|
55
|
-
className: "inline-flex items-center gap-2",
|
|
56
|
-
children:
|
|
55
|
+
className: a("inline-flex items-center gap-2", n && "max-xs:contents"),
|
|
56
|
+
children: t
|
|
57
57
|
})
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
|
-
function
|
|
61
|
-
return typeof e == "string" ? /* @__PURE__ */ i(
|
|
60
|
+
function A({ title: e, measureRef: n }) {
|
|
61
|
+
return typeof e == "string" ? /* @__PURE__ */ i(G, {
|
|
62
62
|
ref: n,
|
|
63
|
-
className: "!min-w-0 truncate",
|
|
63
|
+
className: a("!min-w-0 truncate", "max-xs:hyphens-auto max-xs:whitespace-normal max-xs:![overflow-wrap:anywhere]"),
|
|
64
64
|
children: e
|
|
65
65
|
}) : /* @__PURE__ */ i("div", {
|
|
66
66
|
ref: n,
|
|
67
|
-
className: "min-w-0 truncate",
|
|
67
|
+
className: a("min-w-0 truncate", "max-xs:hyphens-auto max-xs:whitespace-normal max-xs:![overflow-wrap:anywhere]"),
|
|
68
68
|
children: e
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
|
-
function
|
|
71
|
+
function J({ title: e, helperText: n, titleMeasureRef: t }) {
|
|
72
72
|
return !e && !n ? null : /* @__PURE__ */ r("div", {
|
|
73
73
|
className: "min-w-0 max-w-full",
|
|
74
|
-
children: [e && /* @__PURE__ */ i(
|
|
74
|
+
children: [e && /* @__PURE__ */ i(A, {
|
|
75
75
|
title: e,
|
|
76
76
|
measureRef: t
|
|
77
77
|
}), n && /* @__PURE__ */ i("div", {
|
|
@@ -80,61 +80,65 @@ function E({ title: e, helperText: n, titleMeasureRef: t }) {
|
|
|
80
80
|
})]
|
|
81
81
|
});
|
|
82
82
|
}
|
|
83
|
-
function
|
|
84
|
-
const
|
|
85
|
-
if (!
|
|
86
|
-
const
|
|
87
|
-
visible:
|
|
88
|
-
|
|
83
|
+
function K({ variant: e, beforeFilterActionsPlan: n, filter: t, search: l, afterSearchActionsPlan: w, bulkActionsPlan: c, showPageActions: y, overflowMenuLabel: m, inProgressLabel: d, searchMeasureRef: b, align: j = "end" }) {
|
|
84
|
+
const u = y && p(n), x = y && p(w), v = e === "inline-selection" && p(c), k = t != null || l != null, f = e === "utility-row", h = f ? "max-xs:contents" : void 0;
|
|
85
|
+
if (!k && !u && !x && !v) return null;
|
|
86
|
+
const N = u ? /* @__PURE__ */ i(T, {
|
|
87
|
+
visible: u,
|
|
88
|
+
flattenBelowXs: f,
|
|
89
|
+
children: /* @__PURE__ */ i(s, {
|
|
89
90
|
plan: n,
|
|
90
|
-
|
|
91
|
-
|
|
91
|
+
className: h,
|
|
92
|
+
overflowMenuLabel: m,
|
|
93
|
+
inProgressLabel: d
|
|
92
94
|
})
|
|
93
|
-
}) : null,
|
|
94
|
-
visible:
|
|
95
|
+
}) : null, S = x ? /* @__PURE__ */ i(T, {
|
|
96
|
+
visible: x,
|
|
97
|
+
flattenBelowXs: f,
|
|
95
98
|
children: /* @__PURE__ */ i("div", {
|
|
96
|
-
className: "flex flex-nowrap items-center gap-2",
|
|
97
|
-
children: /* @__PURE__ */ i(
|
|
98
|
-
plan:
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
className: a("flex flex-nowrap items-center gap-2", h),
|
|
100
|
+
children: /* @__PURE__ */ i(s, {
|
|
101
|
+
plan: w,
|
|
102
|
+
className: h,
|
|
103
|
+
overflowMenuLabel: m,
|
|
104
|
+
inProgressLabel: d
|
|
101
105
|
})
|
|
102
106
|
})
|
|
103
|
-
}) : null,
|
|
107
|
+
}) : null, g = /* @__PURE__ */ r(o, { children: [t, l != null && /* @__PURE__ */ i(B, {
|
|
104
108
|
search: l,
|
|
105
|
-
measureRef:
|
|
109
|
+
measureRef: b
|
|
106
110
|
})] });
|
|
107
111
|
return /* @__PURE__ */ r("div", {
|
|
108
|
-
className:
|
|
112
|
+
className: a("flex w-full min-w-0 flex-nowrap items-center gap-2", j === "end" ? "justify-end" : "justify-start", e === "utility-row" && "max-xs:flex-wrap"),
|
|
109
113
|
children: [
|
|
110
|
-
e === "inline-selection" && /* @__PURE__ */ r(o, { children: [
|
|
111
|
-
plan:
|
|
112
|
-
overflowMenuLabel:
|
|
113
|
-
inProgressLabel:
|
|
114
|
+
e === "inline-selection" && /* @__PURE__ */ r(o, { children: [v && c && /* @__PURE__ */ i(s, {
|
|
115
|
+
plan: c,
|
|
116
|
+
overflowMenuLabel: m,
|
|
117
|
+
inProgressLabel: d,
|
|
114
118
|
selectionTone: !0
|
|
115
|
-
}),
|
|
119
|
+
}), g] }),
|
|
116
120
|
e === "inline-normal" && /* @__PURE__ */ r(o, { children: [
|
|
117
|
-
v,
|
|
118
121
|
N,
|
|
119
|
-
|
|
122
|
+
g,
|
|
123
|
+
S
|
|
120
124
|
] }),
|
|
121
125
|
e === "utility-row" && /* @__PURE__ */ r(o, { children: [
|
|
122
|
-
|
|
123
|
-
l != null && /* @__PURE__ */ i(
|
|
126
|
+
N,
|
|
127
|
+
l != null && /* @__PURE__ */ i(B, {
|
|
124
128
|
search: l,
|
|
125
129
|
expanded: !0
|
|
126
130
|
}),
|
|
127
131
|
t,
|
|
128
|
-
|
|
132
|
+
S
|
|
129
133
|
] })
|
|
130
134
|
]
|
|
131
135
|
});
|
|
132
136
|
}
|
|
133
137
|
export {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
138
|
+
B as SearchSlot,
|
|
139
|
+
R as SelectionIndicator,
|
|
140
|
+
H as SelectionRow,
|
|
141
|
+
J as TitleBlock,
|
|
142
|
+
A as TitleText,
|
|
143
|
+
K as UtilityCluster
|
|
140
144
|
};
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
var
|
|
2
|
-
root:
|
|
3
|
-
shell:
|
|
4
|
-
shellCompact:
|
|
5
|
-
shellExpanded:
|
|
6
|
-
content:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
var t = "_root_6jgtc_2", e = "_shell_6jgtc_6", _ = "_shellCompact_6jgtc_10", a = "_shellExpanded_6jgtc_14", c = "_content_6jgtc_18", r = "_contentCompact_6jgtc_26", o = "_compactItems_6jgtc_30", m = "_compactItemsStacked_6jgtc_34", s = "_expandedItems_6jgtc_38", l = "_measureRow_6jgtc_42", n = "_measureLayer_6jgtc_46", v = "_chevron_6jgtc_50", d = {
|
|
2
|
+
root: t,
|
|
3
|
+
shell: e,
|
|
4
|
+
shellCompact: _,
|
|
5
|
+
shellExpanded: a,
|
|
6
|
+
content: c,
|
|
7
|
+
contentCompact: r,
|
|
8
|
+
compactItems: o,
|
|
9
|
+
compactItemsStacked: m,
|
|
10
|
+
expandedItems: s,
|
|
11
|
+
measureRow: l,
|
|
12
|
+
measureLayer: n,
|
|
13
|
+
chevron: v
|
|
13
14
|
};
|
|
14
15
|
export {
|
|
15
|
-
|
|
16
|
+
d as default
|
|
16
17
|
};
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { cn as
|
|
1
|
+
import { cn as g } from "../../../helpers/cn.js";
|
|
2
2
|
import { ChevronDownIcon as j } from "../../icons/chevron-down-icon/ChevronDownIcon.js";
|
|
3
3
|
import { ChevronUpIcon as z } from "../../icons/chevron-up-icon/ChevronUpIcon.js";
|
|
4
|
-
import
|
|
5
|
-
import { useCallback as
|
|
6
|
-
import { Fragment as D, jsx as e, jsxs as
|
|
4
|
+
import o from "./Pathfinder.module.js";
|
|
5
|
+
import { useCallback as C, useEffect as M, useLayoutEffect as O, useMemo as y, useRef as I, useState as x, useSyncExternalStore as P } from "react";
|
|
6
|
+
import { Fragment as D, jsx as e, jsxs as R } from "react/jsx-runtime";
|
|
7
7
|
var _ = typeof window < "u" ? O : M;
|
|
8
8
|
function q() {
|
|
9
|
-
const [i, n] = x(null), a =
|
|
9
|
+
const [i, n] = x(null), a = C((t) => {
|
|
10
10
|
n(t);
|
|
11
|
-
}, []), s =
|
|
11
|
+
}, []), s = C(() => i ? Math.floor(i.getBoundingClientRect().width) : 0, [i]);
|
|
12
12
|
return {
|
|
13
13
|
ref: a,
|
|
14
|
-
width: P(
|
|
14
|
+
width: P(C((t) => {
|
|
15
15
|
if (!i || typeof ResizeObserver > "u") return () => {
|
|
16
16
|
};
|
|
17
17
|
let d = 0;
|
|
18
|
-
const
|
|
18
|
+
const l = new ResizeObserver(() => {
|
|
19
19
|
cancelAnimationFrame(d), d = requestAnimationFrame(t);
|
|
20
20
|
});
|
|
21
|
-
return
|
|
22
|
-
cancelAnimationFrame(d),
|
|
21
|
+
return l.observe(i), () => {
|
|
22
|
+
cancelAnimationFrame(d), l.disconnect();
|
|
23
23
|
};
|
|
24
24
|
}, [i]), s, () => 0)
|
|
25
25
|
};
|
|
@@ -31,80 +31,80 @@ function A(i) {
|
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
33
|
function K(i) {
|
|
34
|
-
const { items: n, leadSlot: a, actionSlot: s } = i, t =
|
|
34
|
+
const { items: n, leadSlot: a, actionSlot: s } = i, t = I({}), d = I(null), l = I(null), [m, v] = x({
|
|
35
35
|
itemWidths: {},
|
|
36
36
|
leadWidth: 0,
|
|
37
37
|
actionWidth: 0
|
|
38
|
-
}),
|
|
38
|
+
}), p = I(m);
|
|
39
39
|
M(() => {
|
|
40
|
-
|
|
41
|
-
}, [
|
|
42
|
-
const
|
|
43
|
-
t.current[r] =
|
|
40
|
+
p.current = m;
|
|
41
|
+
}, [m]);
|
|
42
|
+
const h = C((r) => (u) => {
|
|
43
|
+
t.current[r] = u;
|
|
44
44
|
}, []);
|
|
45
45
|
return _(() => {
|
|
46
46
|
const r = {};
|
|
47
|
-
for (const
|
|
48
|
-
const
|
|
49
|
-
r[
|
|
47
|
+
for (const f of n) {
|
|
48
|
+
const k = t.current[f.id], w = Math.ceil(k?.getBoundingClientRect().width ?? f.estimatedWidth ?? 0);
|
|
49
|
+
r[f.id] = w;
|
|
50
50
|
}
|
|
51
|
-
const
|
|
52
|
-
(!(Object.keys(W.itemWidths).length === Object.keys(r).length && n.every((
|
|
51
|
+
const u = a ? Math.ceil(d.current?.getBoundingClientRect().width ?? 0) : 0, N = s ? Math.ceil(l.current?.getBoundingClientRect().width ?? 0) : 0, W = p.current;
|
|
52
|
+
(!(Object.keys(W.itemWidths).length === Object.keys(r).length && n.every((f) => W.itemWidths[f.id] === r[f.id])) || W.leadWidth !== u || W.actionWidth !== N) && v({
|
|
53
53
|
itemWidths: r,
|
|
54
|
-
leadWidth:
|
|
55
|
-
actionWidth:
|
|
54
|
+
leadWidth: u,
|
|
55
|
+
actionWidth: N
|
|
56
56
|
});
|
|
57
57
|
}, [
|
|
58
58
|
n,
|
|
59
59
|
a,
|
|
60
60
|
s
|
|
61
61
|
]), {
|
|
62
|
-
measurements:
|
|
63
|
-
registerItemRef:
|
|
62
|
+
measurements: m,
|
|
63
|
+
registerItemRef: h,
|
|
64
64
|
leadRef: d,
|
|
65
|
-
actionRef:
|
|
65
|
+
actionRef: l
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
68
|
function U(i) {
|
|
69
69
|
const { items: n, availableWidth: a, gapPx: s, itemWidths: t } = i, d = [];
|
|
70
|
-
let
|
|
71
|
-
for (const
|
|
72
|
-
const v = Math.max(0, t[
|
|
73
|
-
if (
|
|
74
|
-
d.push(
|
|
70
|
+
let l = 0;
|
|
71
|
+
for (const m of A(n)) {
|
|
72
|
+
const v = Math.max(0, t[m.id] ?? m.estimatedWidth ?? 0), p = d.length === 0 ? v : l + s + v;
|
|
73
|
+
if (p > a) break;
|
|
74
|
+
d.push(m), l = p;
|
|
75
75
|
}
|
|
76
76
|
return d;
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function b({ item: i, compact: n }) {
|
|
79
79
|
return /* @__PURE__ */ e(D, { children: i.render({ compact: n }) });
|
|
80
80
|
}
|
|
81
|
-
function Y({ items: i, expanded: n, onToggleExpanded: a, leadSlot: s, actionSlot: t, className: d, leadReservePx:
|
|
82
|
-
const { ref: v, width:
|
|
81
|
+
function Y({ items: i, expanded: n, onToggleExpanded: a, leadSlot: s, actionSlot: t, className: d, leadReservePx: l = 140, actionReservePx: m = 44 }) {
|
|
82
|
+
const { ref: v, width: p } = q(), h = !n, r = y(() => A(i), [i]), { measurements: u, registerItemRef: N, leadRef: W, actionRef: f } = K({
|
|
83
83
|
items: r,
|
|
84
84
|
leadSlot: s,
|
|
85
85
|
actionSlot: t
|
|
86
|
-
}),
|
|
86
|
+
}), k = y(() => {
|
|
87
87
|
if (n) return r;
|
|
88
|
-
const c = 24, L =
|
|
88
|
+
const c = 24, L = 48, B = s ? Math.max(l, u.leadWidth + 12) : 0, F = t ? Math.max(m, u.actionWidth) : 0;
|
|
89
89
|
return U({
|
|
90
90
|
items: r,
|
|
91
|
-
availableWidth: Math.max(0,
|
|
91
|
+
availableWidth: Math.max(0, p - c - L - B - F),
|
|
92
92
|
gapPx: 12,
|
|
93
|
-
itemWidths:
|
|
93
|
+
itemWidths: u.itemWidths
|
|
94
94
|
});
|
|
95
95
|
}, [
|
|
96
96
|
n,
|
|
97
97
|
r,
|
|
98
|
-
|
|
98
|
+
p,
|
|
99
99
|
s,
|
|
100
100
|
t,
|
|
101
|
-
o,
|
|
102
101
|
l,
|
|
103
|
-
m
|
|
104
|
-
|
|
105
|
-
|
|
102
|
+
m,
|
|
103
|
+
u
|
|
104
|
+
]), w = h && k.length < Math.min(2, r.length), E = w ? r.slice(0, 2) : k;
|
|
105
|
+
return /* @__PURE__ */ R("div", {
|
|
106
106
|
ref: v,
|
|
107
|
-
className:
|
|
107
|
+
className: g(o.root, "asma-pressable", h ? "overflow-hidden" : "overflow-visible", d),
|
|
108
108
|
"aria-expanded": n,
|
|
109
109
|
role: "button",
|
|
110
110
|
tabIndex: 0,
|
|
@@ -113,34 +113,34 @@ function Y({ items: i, expanded: n, onToggleExpanded: a, leadSlot: s, actionSlot
|
|
|
113
113
|
(c.key === "Enter" || c.key === " ") && (c.preventDefault(), a());
|
|
114
114
|
},
|
|
115
115
|
children: [
|
|
116
|
-
/* @__PURE__ */
|
|
117
|
-
className:
|
|
116
|
+
/* @__PURE__ */ R("div", {
|
|
117
|
+
className: g(o.shell, h ? o.shellCompact : o.shellExpanded),
|
|
118
118
|
children: [s ? /* @__PURE__ */ e("div", {
|
|
119
119
|
className: "shrink-0",
|
|
120
120
|
children: s
|
|
121
121
|
}) : null, /* @__PURE__ */ e("div", {
|
|
122
|
-
className:
|
|
123
|
-
children:
|
|
124
|
-
className:
|
|
122
|
+
className: g(o.content, h && o.contentCompact),
|
|
123
|
+
children: h ? /* @__PURE__ */ e("div", {
|
|
124
|
+
className: g(o.compactItems, w && o.compactItemsStacked),
|
|
125
125
|
children: E.map((c) => /* @__PURE__ */ e("div", {
|
|
126
|
-
className: "
|
|
127
|
-
children: /* @__PURE__ */ e(
|
|
126
|
+
className: g("min-w-0 whitespace-nowrap", w ? "w-full" : "shrink"),
|
|
127
|
+
children: /* @__PURE__ */ e(b, {
|
|
128
128
|
item: c,
|
|
129
|
-
compact:
|
|
129
|
+
compact: h
|
|
130
130
|
})
|
|
131
131
|
}, c.id))
|
|
132
|
-
}) : /* @__PURE__ */
|
|
133
|
-
className:
|
|
132
|
+
}) : /* @__PURE__ */ R("div", {
|
|
133
|
+
className: o.expandedItems,
|
|
134
134
|
children: [r.map((c) => /* @__PURE__ */ e("div", {
|
|
135
135
|
className: "shrink-0 whitespace-nowrap",
|
|
136
|
-
children: /* @__PURE__ */ e(
|
|
136
|
+
children: /* @__PURE__ */ e(b, {
|
|
137
137
|
item: c,
|
|
138
|
-
compact:
|
|
138
|
+
compact: h
|
|
139
139
|
})
|
|
140
140
|
}, c.id)), t ? /* @__PURE__ */ e("div", {
|
|
141
141
|
className: "shrink-0",
|
|
142
142
|
children: /* @__PURE__ */ e("div", {
|
|
143
|
-
ref:
|
|
143
|
+
ref: f,
|
|
144
144
|
children: t
|
|
145
145
|
})
|
|
146
146
|
}) : null]
|
|
@@ -148,15 +148,15 @@ function Y({ items: i, expanded: n, onToggleExpanded: a, leadSlot: s, actionSlot
|
|
|
148
148
|
})]
|
|
149
149
|
}),
|
|
150
150
|
/* @__PURE__ */ e("div", {
|
|
151
|
-
className:
|
|
151
|
+
className: o.chevron,
|
|
152
152
|
children: n ? /* @__PURE__ */ e(z, { className: "size-6" }) : /* @__PURE__ */ e(j, { className: "size-6" })
|
|
153
153
|
}),
|
|
154
154
|
/* @__PURE__ */ e("div", {
|
|
155
155
|
"aria-hidden": !0,
|
|
156
156
|
inert: "true",
|
|
157
|
-
className:
|
|
158
|
-
children: /* @__PURE__ */
|
|
159
|
-
className:
|
|
157
|
+
className: o.measureLayer,
|
|
158
|
+
children: /* @__PURE__ */ R("div", {
|
|
159
|
+
className: o.measureRow,
|
|
160
160
|
children: [
|
|
161
161
|
s ? /* @__PURE__ */ e("div", {
|
|
162
162
|
className: "shrink-0",
|
|
@@ -166,9 +166,9 @@ function Y({ items: i, expanded: n, onToggleExpanded: a, leadSlot: s, actionSlot
|
|
|
166
166
|
})
|
|
167
167
|
}) : null,
|
|
168
168
|
r.map((c) => /* @__PURE__ */ e("div", {
|
|
169
|
-
ref:
|
|
169
|
+
ref: N(c.id),
|
|
170
170
|
className: "shrink-0 whitespace-nowrap",
|
|
171
|
-
children: /* @__PURE__ */ e(
|
|
171
|
+
children: /* @__PURE__ */ e(b, {
|
|
172
172
|
item: c,
|
|
173
173
|
compact: !0
|
|
174
174
|
})
|
|
@@ -176,7 +176,7 @@ function Y({ items: i, expanded: n, onToggleExpanded: a, leadSlot: s, actionSlot
|
|
|
176
176
|
t ? /* @__PURE__ */ e("div", {
|
|
177
177
|
className: "shrink-0",
|
|
178
178
|
children: /* @__PURE__ */ e("div", {
|
|
179
|
-
ref:
|
|
179
|
+
ref: f,
|
|
180
180
|
children: t
|
|
181
181
|
})
|
|
182
182
|
}) : null
|
|
@@ -1,70 +1,77 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
1
|
+
import { cn as m } from "../../../../helpers/cn.js";
|
|
2
|
+
import y from "../icons/ChevronDownIcon.js";
|
|
3
|
+
import { StyledButton as N } from "../../../inputs/button/StyledButton.js";
|
|
4
|
+
import { StyledEmptyPage as v } from "../../../feedback/empty-page/StyledEmptyPage.js";
|
|
4
5
|
import { StyledLoading as C } from "../../../feedback/loading/StyledLoading.js";
|
|
5
|
-
import { StyledLink as
|
|
6
|
-
import { StyledWidgetTitle as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { useState as
|
|
10
|
-
import { Fragment as
|
|
11
|
-
var
|
|
12
|
-
const [
|
|
13
|
-
return /* @__PURE__ */
|
|
14
|
-
className: `${
|
|
6
|
+
import { StyledLink as b } from "../../../navigation/link/StyledLink.js";
|
|
7
|
+
import { StyledWidgetTitle as I } from "../widget-title/StyledWidgetTitle.js";
|
|
8
|
+
import a from "./StyledWidget.module.js";
|
|
9
|
+
import T from "../icons/ChevronUpIcon.js";
|
|
10
|
+
import { useState as k } from "react";
|
|
11
|
+
import { Fragment as L, jsx as e, jsxs as o } from "react/jsx-runtime";
|
|
12
|
+
var U = ({ children: s, title: c, titleNode: h, icon: l, link: d, viewMore: t, persistKey: i, isLoading: f, isEmpty: n, emptyText: g, headerRight: x, headerRightClassName: p }) => {
|
|
13
|
+
const [r, w] = k(() => i ? localStorage.getItem(i) === "true" : !1), u = !!d && !d.hide, S = !!t && !t.hide;
|
|
14
|
+
return /* @__PURE__ */ o("div", {
|
|
15
|
+
className: `${a["asma-ui-core-styled-widget"]} ${n ? a["empty-state"] : ""}`,
|
|
15
16
|
children: [
|
|
16
|
-
/* @__PURE__ */
|
|
17
|
-
className:
|
|
17
|
+
/* @__PURE__ */ o("div", {
|
|
18
|
+
className: m(a["widget-header-left"], "max-xs:flex-wrap max-xs:gap-y-2"),
|
|
18
19
|
children: [
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
l && /* @__PURE__ */ e("span", {
|
|
21
|
+
className: "flex shrink-0",
|
|
22
|
+
children: l
|
|
23
|
+
}),
|
|
24
|
+
h ?? /* @__PURE__ */ e(I, {
|
|
25
|
+
className: "min-w-min",
|
|
26
|
+
children: c
|
|
27
|
+
}),
|
|
21
28
|
/* @__PURE__ */ e("div", {
|
|
22
|
-
className:
|
|
23
|
-
children:
|
|
29
|
+
className: m(a["widget-header-right"], "max-xs:flex-wrap max-xs:gap-y-2", p),
|
|
30
|
+
children: x
|
|
24
31
|
})
|
|
25
32
|
]
|
|
26
33
|
}),
|
|
27
34
|
/* @__PURE__ */ e("div", {
|
|
28
|
-
className:
|
|
29
|
-
children: /* @__PURE__ */
|
|
30
|
-
|
|
31
|
-
/* @__PURE__ */ e(C, { isLoading:
|
|
32
|
-
/* @__PURE__ */ e(
|
|
35
|
+
className: a["widget-content"],
|
|
36
|
+
children: /* @__PURE__ */ o(L, { children: [
|
|
37
|
+
s,
|
|
38
|
+
/* @__PURE__ */ e(C, { isLoading: f }),
|
|
39
|
+
/* @__PURE__ */ e(v, {
|
|
33
40
|
isEmpty: n,
|
|
34
41
|
emptyText: g
|
|
35
42
|
})
|
|
36
43
|
] })
|
|
37
44
|
}),
|
|
38
|
-
|
|
39
|
-
className:
|
|
40
|
-
children: [t.hide ? /* @__PURE__ */ e("div", {}) : /* @__PURE__ */ e(
|
|
45
|
+
S && /* @__PURE__ */ o("div", {
|
|
46
|
+
className: m(a["widget-footer"], "max-xs:flex-wrap max-xs:gap-y-2"),
|
|
47
|
+
children: [t.hide ? /* @__PURE__ */ e("div", {}) : /* @__PURE__ */ e(N, {
|
|
41
48
|
disabled: t.disabled,
|
|
42
49
|
disabledReason: t.disabledReason,
|
|
43
50
|
dataTest: "view-more",
|
|
44
51
|
variant: "text",
|
|
45
|
-
endIcon:
|
|
52
|
+
endIcon: r ? /* @__PURE__ */ e(T, {
|
|
46
53
|
width: 20,
|
|
47
54
|
height: 20
|
|
48
|
-
}) : /* @__PURE__ */ e(
|
|
55
|
+
}) : /* @__PURE__ */ e(y, {
|
|
49
56
|
width: 20,
|
|
50
57
|
height: 20
|
|
51
58
|
}),
|
|
52
59
|
onClick: () => {
|
|
53
|
-
|
|
60
|
+
w(!r), i && localStorage.setItem(i, String(!r)), t.onClick?.();
|
|
54
61
|
},
|
|
55
|
-
children:
|
|
56
|
-
}),
|
|
62
|
+
children: r ? t.viewLessText : t.viewMoreText
|
|
63
|
+
}), u ? /* @__PURE__ */ e(b, {
|
|
57
64
|
dataTest: "go-to-button",
|
|
58
|
-
className:
|
|
65
|
+
className: a["widget-link"],
|
|
59
66
|
size: "small",
|
|
60
|
-
href:
|
|
61
|
-
onClick:
|
|
62
|
-
content:
|
|
67
|
+
href: d.href,
|
|
68
|
+
onClick: d.onClick,
|
|
69
|
+
content: d.content
|
|
63
70
|
}) : /* @__PURE__ */ e("div", {})]
|
|
64
71
|
})
|
|
65
72
|
]
|
|
66
73
|
});
|
|
67
74
|
};
|
|
68
75
|
export {
|
|
69
|
-
|
|
76
|
+
U as StyledWidget
|
|
70
77
|
};
|
|
@@ -2,17 +2,17 @@ import { cn as l } from "../../../../helpers/cn.js";
|
|
|
2
2
|
import { StyledWidgetTitle as o } from "../widget-title/StyledWidgetTitle.js";
|
|
3
3
|
import a from "./StyledWidgetHeader.module.js";
|
|
4
4
|
import "react";
|
|
5
|
-
import { jsx as
|
|
6
|
-
var
|
|
7
|
-
const
|
|
5
|
+
import { jsx as i, jsxs as s } from "react/jsx-runtime";
|
|
6
|
+
var y = ({ actions: d, title: r, containerClassname: t, actionsClassname: m }) => {
|
|
7
|
+
const e = r != null && r !== "";
|
|
8
8
|
return /* @__PURE__ */ s("div", {
|
|
9
|
-
className: l(a["styled-widget-header"],
|
|
10
|
-
children: [
|
|
11
|
-
className: l(m, !
|
|
9
|
+
className: l(a["styled-widget-header"], "flex-wrap gap-y-2", t, !e && d && "!block"),
|
|
10
|
+
children: [e && /* @__PURE__ */ i(o, { children: r }), /* @__PURE__ */ i("div", {
|
|
11
|
+
className: l(e && "flex min-w-fit grow basis-0 justify-end", m, !e && "w-full"),
|
|
12
12
|
children: d
|
|
13
13
|
})]
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
16
|
export {
|
|
17
|
-
|
|
17
|
+
y as StyledWidgetHeader
|
|
18
18
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { cn as
|
|
2
|
-
import
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { jsx as
|
|
5
|
-
var
|
|
6
|
-
return /* @__PURE__ */
|
|
1
|
+
import { cn as r } from "../../../../helpers/cn.js";
|
|
2
|
+
import i from "./StyledWidgetTitle.module.js";
|
|
3
|
+
import { forwardRef as m } from "react";
|
|
4
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
5
|
+
var s = m(function(e, t) {
|
|
6
|
+
return /* @__PURE__ */ l(e.component ?? "h2", {
|
|
7
7
|
ref: t,
|
|
8
|
-
className: i
|
|
8
|
+
className: r(i["styled-widget-title"], "max-xs:min-w-0 max-xs:hyphens-auto max-xs:![overflow-wrap:anywhere]", e.className),
|
|
9
9
|
children: e.children
|
|
10
10
|
});
|
|
11
11
|
});
|
|
12
12
|
export {
|
|
13
|
-
|
|
13
|
+
s as StyledWidgetTitle
|
|
14
14
|
};
|