asma-ui-core 3.121.6 → 3.123.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/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/index.js +66 -63
- 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/components/table-header/SortIndicator.d.ts +12 -0
- package/dist/src/table/custom-features/order-columns/columnLayout.d.ts +24 -0
- package/dist/src/table/custom-features/order-columns/columnLayout.test.d.ts +1 -0
- package/dist/src/table/custom-features/order-columns/types.d.ts +8 -0
- package/dist/src/table/custom-features/order-columns/usePersistColumnOrder.d.ts +5 -0
- package/dist/src/table/helpers/columnIds.d.ts +27 -0
- package/dist/src/table/helpers/columnIds.test.d.ts +1 -0
- package/dist/src/table/helpers/tableStorage.d.ts +12 -0
- package/dist/src/table/helpers/tableStorage.test.d.ts +1 -0
- package/dist/src/table/hooks/useColumnSizingPersistence.d.ts +16 -3
- package/dist/src/table/hooks/useColumnSizingPersistence.test.d.ts +1 -0
- package/dist/src/table/hooks/usePersistedSorting.d.ts +54 -0
- package/dist/src/table/hooks/usePersistedSorting.test.d.ts +1 -0
- package/dist/src/table/hooks/usePersistedStateWriter.d.ts +30 -0
- package/dist/src/table/hooks/useTranslations.d.ts +6 -4
- package/dist/src/table/index.d.ts +1 -0
- package/dist/src/table/types.d.ts +9 -2
- package/dist/table/components/StyledTable.module.js +59 -56
- package/dist/table/components/columns/action-column/components/HeaderActionMenu.js +61 -54
- package/dist/table/components/columns/action-column/components/TableActions.module.js +4 -4
- package/dist/table/components/table-header/SortIndicator.js +23 -0
- package/dist/table/components/table-header/TableHeader.js +30 -30
- package/dist/table/components/table-header/TableHeaderCell.js +30 -31
- package/dist/table/custom-features/order-columns/OrderColumnsFeature.js +7 -8
- package/dist/table/custom-features/order-columns/columnLayout.js +9 -0
- package/dist/table/custom-features/order-columns/usePersistColumnOrder.js +12 -11
- package/dist/table/custom-features/order-columns/usePersistedColumnOrder.js +7 -12
- package/dist/table/helpers/columnIds.js +28 -0
- package/dist/table/helpers/tableStorage.js +33 -0
- package/dist/table/hooks/useColumnSizingPersistence.js +16 -34
- package/dist/table/hooks/usePersistedPageSize.js +11 -16
- package/dist/table/hooks/usePersistedSorting.js +58 -0
- package/dist/table/hooks/usePersistedStateWriter.js +36 -0
- package/dist/table/hooks/useStyledTable.js +90 -60
- package/dist/table/hooks/useTranslations.js +13 -11
- package/dist/table/index.js +3 -2
- package/dist/table/shared-components/DropDownIcon.js +4 -2
- package/dist/table/shared-components/DropUpIcon.js +5 -3
- 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,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
|
};
|
|
@@ -7,77 +7,77 @@ import { getChipPadding as J } from "./chipPadding.js";
|
|
|
7
7
|
import Q from "./StyledChip.module.js";
|
|
8
8
|
import { forwardRef as V } from "react";
|
|
9
9
|
import { jsx as p, jsxs as X } from "react/jsx-runtime";
|
|
10
|
-
var Y = ({ readOnly:
|
|
11
|
-
if (o) return
|
|
12
|
-
if (!(
|
|
13
|
-
return
|
|
14
|
-
}, lo = V(({ dataTest:
|
|
15
|
-
const b = !
|
|
16
|
-
paddingTop:
|
|
17
|
-
paddingRight:
|
|
18
|
-
paddingBottom:
|
|
19
|
-
paddingLeft:
|
|
20
|
-
}, E = (
|
|
21
|
-
|
|
22
|
-
}, L = (
|
|
23
|
-
|
|
10
|
+
var Y = ({ readOnly: s, disabled: n, interactive: t, focusableDisabled: o, tabIndex: r }) => {
|
|
11
|
+
if (o) return r ?? 0;
|
|
12
|
+
if (!(s || n))
|
|
13
|
+
return t ? r ?? 0 : r;
|
|
14
|
+
}, lo = V(({ dataTest: s, label: n, size: t = "medium", disabled: o, disabledReason: r, readOnly: e, clickable: _, icon: k, avatar: w, deleteIcon: D, onDelete: h, onClick: x, onMouseDown: B, onMouseUp: C, className: u, classes: i, sx: j, tabIndex: I, deleteButtonTabIndex: M, "aria-label": N, role: f, "aria-checked": R, "aria-readonly": T, "data-hovered": K, "data-focus": P, variant: Z, color: z }, W) => {
|
|
15
|
+
const b = !e && (!!_ || !!x), m = b && !o, d = b && !!o, v = d && !!r, g = w ?? k, y = !!(h && !e), c = J(t, !!g, y), $ = {
|
|
16
|
+
paddingTop: c.top,
|
|
17
|
+
paddingRight: c.right,
|
|
18
|
+
paddingBottom: c.bottom,
|
|
19
|
+
paddingLeft: c.left
|
|
20
|
+
}, E = (a) => {
|
|
21
|
+
a.stopPropagation(), h?.(a);
|
|
22
|
+
}, L = (a) => {
|
|
23
|
+
m && (a.key === "Enter" || a.key === " ") && (a.preventDefault(), x?.(a));
|
|
24
24
|
}, U = S(u, "width"), q = S(u, "max-width"), A = /* @__PURE__ */ X("div", {
|
|
25
25
|
ref: W,
|
|
26
|
-
"data-testid":
|
|
26
|
+
"data-testid": s,
|
|
27
27
|
"data-chip": "",
|
|
28
28
|
"aria-label": N,
|
|
29
29
|
"data-hovered": K,
|
|
30
30
|
"data-focus": P,
|
|
31
|
-
role:
|
|
32
|
-
"aria-disabled":
|
|
33
|
-
"aria-checked":
|
|
34
|
-
"aria-readonly":
|
|
31
|
+
role: f ?? (m || d ? "button" : void 0),
|
|
32
|
+
"aria-disabled": d || void 0,
|
|
33
|
+
"aria-checked": f ? R : void 0,
|
|
34
|
+
"aria-readonly": f ? T : void 0,
|
|
35
35
|
tabIndex: Y({
|
|
36
|
-
readOnly:
|
|
36
|
+
readOnly: e,
|
|
37
37
|
disabled: o,
|
|
38
|
-
interactive:
|
|
39
|
-
focusableDisabled:
|
|
38
|
+
interactive: m,
|
|
39
|
+
focusableDisabled: d,
|
|
40
40
|
tabIndex: I
|
|
41
41
|
}),
|
|
42
|
-
onClick: o ||
|
|
43
|
-
onKeyDown: o ||
|
|
44
|
-
onMouseDown: o ||
|
|
45
|
-
onMouseUp: o ||
|
|
46
|
-
className: l("box-border inline-flex items-center gap-1 rounded-[25px] border border-solid border-delta-300 bg-white text-base text-delta-700", !U && "w-fit", !q && "max-w-full",
|
|
42
|
+
onClick: o || e ? void 0 : x,
|
|
43
|
+
onKeyDown: o || e ? void 0 : L,
|
|
44
|
+
onMouseDown: o || e ? void 0 : B,
|
|
45
|
+
onMouseUp: o || e ? void 0 : C,
|
|
46
|
+
className: l("box-border inline-flex items-center gap-1 rounded-[25px] border border-solid border-delta-300 bg-white text-base text-delta-700", !U && "w-fit", !q && "max-w-full", t === "small" ? "h-6" : "h-8", "max-xs:h-auto max-xs:py-0", t === "small" ? "max-xs:min-h-6" : "max-xs:min-h-8", e && "pointer-events-none", o && "opacity-[0.38]", o && (d ? "cursor-not-allowed" : "pointer-events-none"), m && l("cursor-pointer outline-none", "asma-touch-ready", "active:!border-gama-400 active:bg-gama-25 active:shadow-[0_0_0_2px_var(--colors-gama-400)]"), (m || y && !o) && "data-[hovered]:bg-delta-50 hover:bg-delta-50", Q["focus-ring"], i?.root, u),
|
|
47
47
|
style: {
|
|
48
48
|
...$,
|
|
49
49
|
...F(j)
|
|
50
50
|
},
|
|
51
51
|
children: [
|
|
52
|
-
|
|
53
|
-
className: l("flex shrink-0 items-center justify-center",
|
|
54
|
-
children:
|
|
52
|
+
g && /* @__PURE__ */ p("span", {
|
|
53
|
+
className: l("flex shrink-0 items-center justify-center", t === "small" ? "h-[18px] w-[18px]" : "h-6 w-6", w ? i?.avatar : i?.icon),
|
|
54
|
+
children: g
|
|
55
55
|
}),
|
|
56
56
|
/* @__PURE__ */ p("span", {
|
|
57
|
-
className: l("min-w-0 truncate", i?.label),
|
|
58
|
-
children:
|
|
57
|
+
className: l("min-w-0 truncate", "max-xs:hyphens-auto max-xs:whitespace-normal max-xs:![overflow-wrap:anywhere]", t === "small" ? "max-xs:-my-px" : "max-xs:py-[3px]", i?.label),
|
|
58
|
+
children: n
|
|
59
59
|
}),
|
|
60
|
-
h && !
|
|
60
|
+
h && !e && /* @__PURE__ */ p("button", {
|
|
61
61
|
type: "button",
|
|
62
62
|
tabIndex: M,
|
|
63
|
-
"data-testid": `${
|
|
64
|
-
"aria-label": typeof
|
|
63
|
+
"data-testid": `${s}-delete`,
|
|
64
|
+
"aria-label": typeof n == "string" ? `Remove ${n}` : "Remove",
|
|
65
65
|
onClick: E,
|
|
66
66
|
disabled: o,
|
|
67
|
-
className: l("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]",
|
|
67
|
+
className: l("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]", t === "small" ? "h-[18px] w-[18px]" : "h-5 w-5", i?.deleteIcon),
|
|
68
68
|
children: D ?? /* @__PURE__ */ p(H, {
|
|
69
|
-
height:
|
|
70
|
-
width:
|
|
69
|
+
height: t === "small" ? 14 : 16,
|
|
70
|
+
width: t === "small" ? 14 : 16,
|
|
71
71
|
className: "min-w-0 shrink-0"
|
|
72
72
|
})
|
|
73
73
|
})
|
|
74
74
|
]
|
|
75
75
|
});
|
|
76
76
|
return /* @__PURE__ */ p(G, {
|
|
77
|
-
title:
|
|
78
|
-
open:
|
|
79
|
-
openOnTap:
|
|
80
|
-
persistentDescription:
|
|
77
|
+
title: r,
|
|
78
|
+
open: v ? void 0 : !1,
|
|
79
|
+
openOnTap: v,
|
|
80
|
+
persistentDescription: v,
|
|
81
81
|
children: A
|
|
82
82
|
});
|
|
83
83
|
});
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { getStyles as
|
|
2
|
-
import
|
|
3
|
-
import { jsx as
|
|
4
|
-
var
|
|
5
|
-
const
|
|
6
|
-
(
|
|
1
|
+
import { getStyles as x } from "../helpers/getStyles.js";
|
|
2
|
+
import y from "clsx";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
var f = ({ title: t, onClick: e, className: o, dataTest: a, size: s = "base" }) => {
|
|
5
|
+
const m = x({ size: s }), d = e ? (r) => {
|
|
6
|
+
(r.key === "Enter" || r.key === " ") && (r.preventDefault(), e(r));
|
|
7
7
|
} : void 0;
|
|
8
|
-
return /* @__PURE__ */
|
|
9
|
-
className:
|
|
10
|
-
onClick:
|
|
11
|
-
onKeyDown:
|
|
12
|
-
role:
|
|
13
|
-
tabIndex:
|
|
14
|
-
"data-testid":
|
|
15
|
-
children:
|
|
8
|
+
return /* @__PURE__ */ n("div", {
|
|
9
|
+
className: y(m, "max-xs:min-w-0 max-xs:hyphens-auto max-xs:![overflow-wrap:anywhere]", o),
|
|
10
|
+
onClick: e,
|
|
11
|
+
onKeyDown: d,
|
|
12
|
+
role: e ? "button" : void 0,
|
|
13
|
+
tabIndex: e ? 0 : void 0,
|
|
14
|
+
"data-testid": a,
|
|
15
|
+
children: t
|
|
16
16
|
});
|
|
17
17
|
};
|
|
18
18
|
export {
|
|
19
|
-
|
|
19
|
+
f as StyledFormLabel
|
|
20
20
|
};
|