asma-ui-core 3.78.12 → 3.79.1
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 +14 -14
- package/dist/components/custom/module/header-layout/ToolbarActionGroup.js +23 -21
- package/dist/components/custom/module/header-layout/ToolbarRows.js +4 -4
- package/dist/components/data-display/chip/StyledChip.js +41 -41
- package/dist/components/feedback/dialog/dialog-footer/StyledDialogFooter.js +105 -0
- package/dist/components/feedback/minimizable-dialog/MinimizableDialog.js +6 -6
- package/dist/components/inputs/button/StyledButton.module.js +8 -8
- package/dist/components/inputs/checkbox/base-ui/StyledCheckbox.js +45 -42
- package/dist/components/inputs/checkbox/base-ui/StyledCheckbox.module.js +8 -8
- package/dist/components/inputs/dynamic-select/components/DynamicSelectAutocomplete.js +25 -17
- package/dist/components/inputs/field-styles.js +3 -3
- package/dist/components/inputs/radio-button/base-ui/StyledRadio.js +34 -31
- package/dist/components/inputs/radio-button/base-ui/StyledRadio.module.js +10 -10
- package/dist/components/inputs/select/StyledSelect.js +147 -135
- package/dist/components/inputs/select/StyledSelectItem.js +29 -19
- package/dist/components/inputs/select-autocomplete/StyledSelectAutocomplete.js +195 -162
- package/dist/components/inputs/switch/base-ui/StyledSwitch.module.js +4 -4
- package/dist/components/inputs/textarea/StyledTextarea.module.js +4 -4
- package/dist/components/navigation/link/StyledLink.js +11 -10
- package/dist/components/navigation/link/StyledLink.module.js +5 -5
- package/dist/components/navigation/menu/StyledMenuList.js +27 -19
- package/dist/components/navigation/tabs/StyledTab.js +7 -7
- package/dist/components/utils/accordion/base-ui/StyledAccordion.module.js +3 -3
- package/dist/datetime/shared-components/button/StyledButton.module.js +12 -12
- package/dist/index.js +176 -174
- package/dist/src/components/feedback/dialog/dialog-footer/StyledDialogFooter.d.ts +62 -0
- package/dist/src/components/feedback/dialog/dialog-footer/StyledDialogFooter.test.d.ts +1 -0
- package/dist/src/components/feedback/dialog/dialog-footer/index.d.ts +2 -0
- package/dist/src/components/feedback/dialog/index.d.ts +1 -0
- package/dist/src/components/inputs/select/StyledSelectItem.d.ts +3 -1
- package/dist/src/components/inputs/select-autocomplete/StyledSelectAutocomplete.d.ts +1 -1
- package/dist/src/components/navigation/menu/StyledMenuList.d.ts +3 -1
- package/dist/src/table/components/TableRow.d.ts +2 -1
- package/dist/src/table/custom-features/focus-rows/types.d.ts +2 -2
- package/dist/src/table/hooks/useToggleMenuVisibility.hook.d.ts +14 -1
- package/dist/table/components/StyledTable.module.js +52 -52
- package/dist/table/components/TableRow.js +92 -80
- package/dist/table/components/TableRows.js +10 -8
- package/dist/table/components/columns/action-column/components/HeaderActionMenu.js +4 -4
- package/dist/table/components/table-footer/TablePagination.js +77 -64
- package/dist/table/components/table-footer/TableRowCountSelect.js +63 -44
- package/dist/table/components/table-header/TableHeader.js +72 -64
- package/dist/table/custom-features/focus-rows/FocusRowsFeature.js +4 -4
- package/dist/table/hooks/useToggleMenuVisibility.hook.js +77 -11
- package/dist/table/shared-components/button/StyledButton.module.js +9 -9
- package/dist/tailwind.config.d.ts +1 -0
- package/package.json +1 -1
- package/src/styles/_focus.scss +23 -0
- package/src/styles/color-variables/defaultTokens.css +2 -4
- package/src/styles/color-variables/fretexTokens.css +6 -7
- package/src/styles/color-variables/jadeTokens.css +2 -4
- package/src/styles/components-colors/inputVariables.css +2 -2
- package/tw-configs/twConfigs.json +1 -0
- package/dist/table/shared-components/CheckIcon.js +0 -12
- package/dist/table/shared-components/menu-item/index.js +0 -22
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { cn as ae } from "../../../../helpers/cn.js";
|
|
2
2
|
import { useMobileMediaQuery as re } from "../../../../hooks/useMediaQuery.hook.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
3
|
+
import { useElementWidthPx as ce } from "../../../../hooks/useElementWidthPx.js";
|
|
4
|
+
import { useWidthRegistry as de } from "../../../../hooks/useWidthRegistry.js";
|
|
5
|
+
import { planBulkToolbarActions as me, planToolbarActions as he } from "./planToolbarActions.js";
|
|
6
|
+
import { useToolbarTranslations as ue } from "./useTranslations.js";
|
|
7
|
+
import { DynamicToolbarLayoutContext as fe } from "./DynamicToolbarLayoutContext.js";
|
|
8
|
+
import { resolveBulkActionsAvailableWidth as Ae, resolvePageActionsAvailableWidth as xe, resolveReserveBulkActionsWidthPx as ve, resolveTitleAreaWidth as be, resolveToolbarLayout as pe } from "./estimateToolbarLayout.js";
|
|
9
9
|
import { SearchSlot as we, SelectionIndicator as Pe, SelectionRow as Te, TitleBlock as H, TitleText as We, UtilityCluster as Q } from "./ToolbarRows.js";
|
|
10
10
|
import { KEY_MORE_BUTTON as Me, KEY_SEARCH as $, KEY_SELECTION_INDICATOR as Be, KEY_TITLE as q, ToolbarMeasurementStrip as ye, actionKey as ge, filterKey as R } from "./ToolbarMeasurement.js";
|
|
11
11
|
import { useCallback as Se, useMemo as o } from "react";
|
|
@@ -34,7 +34,7 @@ var J = {
|
|
|
34
34
|
showMoreMenu: !1
|
|
35
35
|
};
|
|
36
36
|
function He(g) {
|
|
37
|
-
const { title: l, helperText: A, beforeFilterActions: x = [], filter: v, search: c, afterSearchActions: C = [], selectedCount: T = 0, onClearSelection: S, bulkActions: d = [], maxVisibleBulkActions: P = _e, locale: Z = "en", className: ee, style: te, dataTest: ie = "dynamic-toolbar" } = g, b =
|
|
37
|
+
const { title: l, helperText: A, beforeFilterActions: x = [], filter: v, search: c, afterSearchActions: C = [], selectedCount: T = 0, onClearSelection: S, bulkActions: d = [], maxVisibleBulkActions: P = _e, locale: Z = "en", className: ee, style: te, dataTest: ie = "dynamic-toolbar" } = g, b = ue(Z), { ref: oe, widthPx: n } = ce(), { register: W, widths: s } = de(), k = re(), _ = o(() => Ne(n, P), [n, P]), M = !k && n >= G ? P : _, m = T > 0, O = !m, p = o(() => [...x, ...C], [x, C]), h = Se((e, i) => s[ge(e.id, i)], [s]), a = o(() => ({
|
|
38
38
|
titleWidthPx: s[q],
|
|
39
39
|
searchWidthPx: s[$],
|
|
40
40
|
filterLabelWidthPx: s[R(!1)],
|
|
@@ -42,11 +42,11 @@ function He(g) {
|
|
|
42
42
|
selectionIndicatorWidthPx: s[Be],
|
|
43
43
|
moreButtonWidthPx: s[Me],
|
|
44
44
|
actionWidthPx: h
|
|
45
|
-
}), [s, h]), I = o(() =>
|
|
45
|
+
}), [s, h]), I = o(() => ve(ke, d, h, M), [
|
|
46
46
|
d,
|
|
47
47
|
h,
|
|
48
48
|
M
|
|
49
|
-
]), { mode: r, filterIconOnly: w, trailingIconOnly: B } = o(() =>
|
|
49
|
+
]), { mode: r, filterIconOnly: w, trailingIconOnly: B } = o(() => pe({
|
|
50
50
|
containerWidth: n,
|
|
51
51
|
isMobile: k,
|
|
52
52
|
isSelectionMode: m,
|
|
@@ -81,7 +81,7 @@ function He(g) {
|
|
|
81
81
|
n,
|
|
82
82
|
w,
|
|
83
83
|
B
|
|
84
|
-
]), V =
|
|
84
|
+
]), V = be(l, a.titleWidthPx), U = xe({
|
|
85
85
|
layoutMode: r,
|
|
86
86
|
containerWidth: n,
|
|
87
87
|
titleWidth: V,
|
|
@@ -93,7 +93,7 @@ function He(g) {
|
|
|
93
93
|
hasTrailingUtility: !1,
|
|
94
94
|
reserveBulkActionsWidthPx: m ? 0 : I,
|
|
95
95
|
measured: a
|
|
96
|
-
}), F =
|
|
96
|
+
}), F = Ae({
|
|
97
97
|
layoutMode: r,
|
|
98
98
|
containerWidth: n,
|
|
99
99
|
titleWidth: V,
|
|
@@ -101,7 +101,7 @@ function He(g) {
|
|
|
101
101
|
hasFilter: v != null,
|
|
102
102
|
hasSearch: c != null,
|
|
103
103
|
measured: a
|
|
104
|
-
}), f = o(() =>
|
|
104
|
+
}), f = o(() => he({
|
|
105
105
|
actions: p,
|
|
106
106
|
availableWidth: U,
|
|
107
107
|
collapseLabels: !0,
|
|
@@ -126,7 +126,7 @@ function He(g) {
|
|
|
126
126
|
overflowActions: f.overflowActions,
|
|
127
127
|
showMoreMenu: f.showMoreMenu
|
|
128
128
|
};
|
|
129
|
-
}, [y, f]), Y = o(() =>
|
|
129
|
+
}, [y, f]), Y = o(() => me({
|
|
130
130
|
actions: d,
|
|
131
131
|
availableWidth: F,
|
|
132
132
|
maxVisibleBulkActions: r === "compact" ? _ : P,
|
|
@@ -162,7 +162,7 @@ function He(g) {
|
|
|
162
162
|
onClearSelection: S,
|
|
163
163
|
translations: b,
|
|
164
164
|
bulkActionsPlan: Y
|
|
165
|
-
}), L = (e, i) => /* @__PURE__ */ t(
|
|
165
|
+
}), L = (e, i) => /* @__PURE__ */ t(fe.Provider, {
|
|
166
166
|
value: le,
|
|
167
167
|
children: /* @__PURE__ */ u("div", {
|
|
168
168
|
ref: oe,
|
|
@@ -3,47 +3,49 @@ import { DotsVerticalIcon as g } from "../../../icons/dots-vertical-icon/DotsVer
|
|
|
3
3
|
import { StyledButton as p } from "../../../inputs/button/StyledButton.js";
|
|
4
4
|
import { StyledMenu as x } from "../../../navigation/menu/StyledMenu.js";
|
|
5
5
|
import { StyledMenuItem as v } from "../../../navigation/menu/StyledMenuItem.js";
|
|
6
|
-
import { Fragment as k, useState as
|
|
7
|
-
import { Fragment as
|
|
6
|
+
import { Fragment as k, useState as y } from "react";
|
|
7
|
+
import { Fragment as T, jsx as n, jsxs as o } from "react/jsx-runtime";
|
|
8
8
|
function O(e) {
|
|
9
9
|
return e != null && (e.inlineActions.length > 0 || e.showMoreMenu);
|
|
10
10
|
}
|
|
11
|
-
function
|
|
12
|
-
if (e.render) return e.render({ showLabel:
|
|
11
|
+
function A({ action: e, showLabel: t, selectionTone: l = !1 }) {
|
|
12
|
+
if (e.render) return e.render({ showLabel: t });
|
|
13
13
|
const a = e.ariaLabel ?? e.label;
|
|
14
14
|
return /* @__PURE__ */ n(p, {
|
|
15
15
|
dataTest: e.dataTest ?? `dynamic-toolbar-action-${e.id}`,
|
|
16
|
-
variant: e.variant ?? (
|
|
16
|
+
variant: e.variant ?? (l ? "text" : "outlined"),
|
|
17
17
|
error: e.tone === "danger",
|
|
18
18
|
size: e.size ?? "large",
|
|
19
|
+
type: "button",
|
|
19
20
|
disabled: e.disabled,
|
|
20
21
|
startIcon: e.icon,
|
|
21
22
|
onClick: e.onClick,
|
|
22
|
-
"aria-label":
|
|
23
|
-
children:
|
|
23
|
+
"aria-label": t && e.ariaLabel == null ? void 0 : a,
|
|
24
|
+
children: t ? e.label : void 0
|
|
24
25
|
});
|
|
25
26
|
}
|
|
26
|
-
function
|
|
27
|
+
function C({ overflowMenuLabel: e, onOpen: t }) {
|
|
27
28
|
return /* @__PURE__ */ n(p, {
|
|
28
29
|
dataTest: "dynamic-toolbar-overflow-actions",
|
|
29
30
|
variant: "text",
|
|
30
31
|
size: "large",
|
|
32
|
+
type: "button",
|
|
31
33
|
endIcon: /* @__PURE__ */ n(g, {
|
|
32
34
|
width: 20,
|
|
33
35
|
height: 20
|
|
34
36
|
}),
|
|
35
|
-
onClick: (
|
|
37
|
+
onClick: (l) => t?.(l.currentTarget),
|
|
36
38
|
"aria-label": e,
|
|
37
39
|
"aria-haspopup": "menu",
|
|
38
40
|
children: e
|
|
39
41
|
});
|
|
40
42
|
}
|
|
41
|
-
function j({ plan: e, overflowMenuLabel:
|
|
42
|
-
const [
|
|
43
|
-
return !
|
|
44
|
-
className: f("flex shrink-0 flex-nowrap items-center gap-2",
|
|
45
|
-
children: [
|
|
46
|
-
const h = /* @__PURE__ */ n(
|
|
43
|
+
function j({ plan: e, overflowMenuLabel: t, className: l, selectionTone: a = !1, registerActionWidth: d }) {
|
|
44
|
+
const [u, s] = y(null), { inlineActions: m, overflowActions: b, showMoreMenu: c } = e;
|
|
45
|
+
return !m.length && !c ? null : /* @__PURE__ */ o("div", {
|
|
46
|
+
className: f("flex shrink-0 flex-nowrap items-center gap-2", l),
|
|
47
|
+
children: [m.map(({ action: r, showLabel: i }) => {
|
|
48
|
+
const h = /* @__PURE__ */ n(A, {
|
|
47
49
|
action: r,
|
|
48
50
|
showLabel: i,
|
|
49
51
|
selectionTone: a
|
|
@@ -53,12 +55,12 @@ function j({ plan: e, overflowMenuLabel: l, className: t, selectionTone: a = !1,
|
|
|
53
55
|
className: "inline-flex shrink-0",
|
|
54
56
|
children: h
|
|
55
57
|
}, r.id);
|
|
56
|
-
}), c && /* @__PURE__ */ o(
|
|
57
|
-
overflowMenuLabel:
|
|
58
|
+
}), c && /* @__PURE__ */ o(T, { children: [/* @__PURE__ */ n(C, {
|
|
59
|
+
overflowMenuLabel: t,
|
|
58
60
|
onOpen: s
|
|
59
61
|
}), /* @__PURE__ */ n(x, {
|
|
60
|
-
anchorEl:
|
|
61
|
-
open: !!
|
|
62
|
+
anchorEl: u,
|
|
63
|
+
open: !!u,
|
|
62
64
|
onClose: () => s(null),
|
|
63
65
|
anchorOrigin: {
|
|
64
66
|
vertical: "bottom",
|
|
@@ -82,8 +84,8 @@ function j({ plan: e, overflowMenuLabel: l, className: t, selectionTone: a = !1,
|
|
|
82
84
|
});
|
|
83
85
|
}
|
|
84
86
|
export {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
+
C as MoreTriggerButton,
|
|
88
|
+
A as ToolbarActionButton,
|
|
87
89
|
j as ToolbarActionGroup,
|
|
88
90
|
O as hasPlannedActions
|
|
89
91
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { cn as f } from "../../../../helpers/cn.js";
|
|
2
2
|
import { CloseIcon as T } from "../../../icons/close-icon/CloseIcon.js";
|
|
3
3
|
import { StyledButton as b } from "../../../inputs/button/StyledButton.js";
|
|
4
|
-
import { StyledWidgetTitle as j } from "../../widget/widget-title/StyledWidgetTitle.js";
|
|
5
4
|
import { ToolbarActionGroup as c, hasPlannedActions as u } from "./ToolbarActionGroup.js";
|
|
6
|
-
import { formatSelectionLabel as
|
|
5
|
+
import { formatSelectionLabel as j } from "./useTranslations.js";
|
|
6
|
+
import { StyledWidgetTitle as k } from "../../widget/widget-title/StyledWidgetTitle.js";
|
|
7
7
|
import { Fragment as o, jsx as i, jsxs as r } from "react/jsx-runtime";
|
|
8
8
|
function I({ selectedCount: e, onClearSelection: n, translations: t }) {
|
|
9
9
|
return /* @__PURE__ */ i("div", {
|
|
@@ -20,7 +20,7 @@ function I({ selectedCount: e, onClearSelection: n, translations: t }) {
|
|
|
20
20
|
}) : void 0,
|
|
21
21
|
onClick: n,
|
|
22
22
|
"aria-label": t.clearSelection,
|
|
23
|
-
children:
|
|
23
|
+
children: j(e, t)
|
|
24
24
|
})
|
|
25
25
|
});
|
|
26
26
|
}
|
|
@@ -57,7 +57,7 @@ function S({ visible: e, children: n }) {
|
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
59
|
function F({ title: e, measureRef: n }) {
|
|
60
|
-
return typeof e == "string" ? /* @__PURE__ */ i(
|
|
60
|
+
return typeof e == "string" ? /* @__PURE__ */ i(k, {
|
|
61
61
|
ref: n,
|
|
62
62
|
className: "!min-w-0 truncate",
|
|
63
63
|
children: e
|
|
@@ -1,59 +1,59 @@
|
|
|
1
1
|
import { cn as i } from "../../../helpers/cn.js";
|
|
2
|
-
import { resolveSx as
|
|
3
|
-
import { CloseIcon as
|
|
4
|
-
import { consumerOverrides as
|
|
5
|
-
import { getChipPadding as
|
|
6
|
-
import { forwardRef as
|
|
7
|
-
import { jsx as
|
|
8
|
-
var
|
|
9
|
-
const n = !o && !t && (!!
|
|
2
|
+
import { resolveSx as E } from "../../../helpers/sx.js";
|
|
3
|
+
import { CloseIcon as L } from "../../icons/close-icon/CloseIcon.js";
|
|
4
|
+
import { consumerOverrides as w } from "../../../helpers/classOverride.js";
|
|
5
|
+
import { getChipPadding as U } from "./chipPadding.js";
|
|
6
|
+
import { forwardRef as q } from "react";
|
|
7
|
+
import { jsx as s, jsxs as A } from "react/jsx-runtime";
|
|
8
|
+
var Z = q(({ dataTest: u, label: c, size: r = "medium", disabled: t, readOnly: o, clickable: x, icon: _, avatar: g, deleteIcon: k, onDelete: m, onClick: l, onMouseDown: y, onMouseUp: S, className: h, classes: a, sx: j, tabIndex: v, "aria-label": D, role: p, "aria-checked": R, "aria-readonly": B, "data-hovered": C, "data-focus": M, variant: F, color: G }, N) => {
|
|
9
|
+
const n = !o && !t && (!!x || !!l), f = g ?? _, b = !!(m && !o), d = U(r, !!f, b), I = {
|
|
10
10
|
paddingTop: d.top,
|
|
11
11
|
paddingRight: d.right,
|
|
12
12
|
paddingBottom: d.bottom,
|
|
13
13
|
paddingLeft: d.left
|
|
14
|
-
},
|
|
15
|
-
|
|
16
|
-
},
|
|
17
|
-
n && (
|
|
18
|
-
},
|
|
19
|
-
return /* @__PURE__ */
|
|
20
|
-
ref:
|
|
21
|
-
"data-testid":
|
|
22
|
-
"aria-label":
|
|
14
|
+
}, K = (e) => {
|
|
15
|
+
e.stopPropagation(), m?.(e);
|
|
16
|
+
}, P = (e) => {
|
|
17
|
+
n && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), l?.(e));
|
|
18
|
+
}, W = w(h, "width"), $ = w(h, "max-width");
|
|
19
|
+
return /* @__PURE__ */ A("div", {
|
|
20
|
+
ref: N,
|
|
21
|
+
"data-testid": u,
|
|
22
|
+
"aria-label": D,
|
|
23
23
|
"data-hovered": C,
|
|
24
|
-
"data-focus":
|
|
25
|
-
role:
|
|
26
|
-
"aria-checked":
|
|
27
|
-
"aria-readonly":
|
|
28
|
-
tabIndex: n ? v ?? 0 : v,
|
|
24
|
+
"data-focus": M,
|
|
25
|
+
role: p ?? (n ? "button" : void 0),
|
|
26
|
+
"aria-checked": p ? R : void 0,
|
|
27
|
+
"aria-readonly": p ? B : void 0,
|
|
28
|
+
tabIndex: o ? void 0 : n ? v ?? 0 : v,
|
|
29
29
|
onClick: t || o ? void 0 : l,
|
|
30
|
-
onKeyDown: t || o ? void 0 :
|
|
31
|
-
onMouseDown: t || o ? void 0 :
|
|
32
|
-
onMouseUp: t || o ? void 0 :
|
|
33
|
-
className: i("box-border inline-flex items-center gap-1 rounded-[25px] border border-solid border-delta-300 bg-white text-base text-delta-700", !
|
|
30
|
+
onKeyDown: t || o ? void 0 : P,
|
|
31
|
+
onMouseDown: t || o ? void 0 : y,
|
|
32
|
+
onMouseUp: t || o ? void 0 : S,
|
|
33
|
+
className: i("box-border inline-flex items-center gap-1 rounded-[25px] border border-solid border-delta-300 bg-white text-base text-delta-700", !W && "w-fit", !$ && "max-w-full", r === "small" ? "h-6" : "h-8", o && "pointer-events-none", t && "pointer-events-none opacity-[0.38]", "data-[focus]:!border-focus-ring data-[focus]:bg-gama-25 data-[focus]:shadow-[inset_0_0_0_2px_var(--colors-focus-ring)]", b && "focus-within:!border-focus-ring focus-within:bg-gama-25 focus-within:shadow-[inset_0_0_0_2px_var(--colors-focus-ring)]", n && i("cursor-pointer outline-none", "data-[hovered]:border-gama-200 data-[hovered]:bg-gama-25 hover:border-gama-200 hover:bg-gama-25", "focus-visible:!border-focus-ring focus-visible:bg-gama-25 focus-visible:shadow-[inset_0_0_0_2px_var(--colors-focus-ring)]", "active:!border-gama-400 active:bg-gama-25 active:shadow-[0_0_0_2px_var(--colors-gama-400)]"), a?.root, h),
|
|
34
34
|
style: {
|
|
35
|
-
...
|
|
36
|
-
|
|
35
|
+
...I,
|
|
36
|
+
...E(j)
|
|
37
37
|
},
|
|
38
38
|
children: [
|
|
39
|
-
|
|
40
|
-
className: i("flex shrink-0 items-center justify-center",
|
|
41
|
-
children:
|
|
39
|
+
f && /* @__PURE__ */ s("span", {
|
|
40
|
+
className: i("flex shrink-0 items-center justify-center", r === "small" ? "h-[18px] w-[18px]" : "h-6 w-6", g ? a?.avatar : a?.icon),
|
|
41
|
+
children: f
|
|
42
42
|
}),
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
-
className: i("min-w-0 truncate",
|
|
43
|
+
/* @__PURE__ */ s("span", {
|
|
44
|
+
className: i("min-w-0 truncate", a?.label),
|
|
45
45
|
children: c
|
|
46
46
|
}),
|
|
47
|
-
|
|
47
|
+
m && !o && /* @__PURE__ */ s("button", {
|
|
48
48
|
type: "button",
|
|
49
|
-
"data-testid": `${
|
|
49
|
+
"data-testid": `${u}-delete`,
|
|
50
50
|
"aria-label": typeof c == "string" ? `Remove ${c}` : "Remove",
|
|
51
|
-
onClick:
|
|
51
|
+
onClick: K,
|
|
52
52
|
disabled: t,
|
|
53
|
-
className: i("flex shrink-0 items-center justify-center rounded-full border border-solid border-delta-100 bg-delta-50 p-0 text-delta-700",
|
|
54
|
-
children:
|
|
55
|
-
height:
|
|
56
|
-
width:
|
|
53
|
+
className: i("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]", r === "small" ? "h-[18px] w-[18px]" : "h-5 w-5", a?.deleteIcon),
|
|
54
|
+
children: k ?? /* @__PURE__ */ s(L, {
|
|
55
|
+
height: r === "small" ? 14 : 16,
|
|
56
|
+
width: r === "small" ? 14 : 16,
|
|
57
57
|
className: "min-w-0 shrink-0"
|
|
58
58
|
})
|
|
59
59
|
})
|
|
@@ -61,5 +61,5 @@ var Y = U(({ dataTest: f, label: c, size: e = "medium", disabled: t, readOnly: o
|
|
|
61
61
|
});
|
|
62
62
|
});
|
|
63
63
|
export {
|
|
64
|
-
|
|
64
|
+
Z as StyledChip
|
|
65
65
|
};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { cn as T } from "../../../../helpers/cn.js";
|
|
2
|
+
import { DotsVerticalIcon as S } from "../../../icons/dots-vertical-icon/DotsVerticalIcon.js";
|
|
3
|
+
import { StyledButton as y } from "../../../inputs/button/StyledButton.js";
|
|
4
|
+
import { StyledMenu as $ } from "../../../navigation/menu/StyledMenu.js";
|
|
5
|
+
import { StyledMenuItem as z } from "../../../navigation/menu/StyledMenuItem.js";
|
|
6
|
+
import { useElementWidthPx as L } from "../../../../hooks/useElementWidthPx.js";
|
|
7
|
+
import { useWidthRegistry as j } from "../../../../hooks/useWidthRegistry.js";
|
|
8
|
+
import { planToolbarActions as K } from "../../../custom/module/header-layout/planToolbarActions.js";
|
|
9
|
+
import { ToolbarActionButton as F } from "../../../custom/module/header-layout/ToolbarActionGroup.js";
|
|
10
|
+
import { useToolbarTranslations as H } from "../../../custom/module/header-layout/useTranslations.js";
|
|
11
|
+
import { useMemo as C, useState as D } from "react";
|
|
12
|
+
import { Fragment as _, jsx as r, jsxs as t } from "react/jsx-runtime";
|
|
13
|
+
var G = 470, U = 8, k = "dialog-footer-right", w = "dialog-footer-more", N = (i, n) => `dialog-footer-action:${i}:${n ? "label" : "icon"}`;
|
|
14
|
+
function ae({ leftActions: i = [], leadingSlot: n, secondaryAction: o, primaryAction: s, fixed: P = !1, rounded: E = !0, locale: M = "en", className: W, dataTest: d = "styled-dialog-footer" }) {
|
|
15
|
+
const R = H(M), { ref: A, widthPx: c } = L(), { register: m, widths: a } = j(), [p, f] = D(null), u = c > 0 && c < G, B = u ? 8 : 16, g = C(() => i.filter((e) => !e.hidden).map((e) => e.icon == null && e.canHideLabel == null ? {
|
|
16
|
+
...e,
|
|
17
|
+
canHideLabel: !1
|
|
18
|
+
} : e), [i]), I = a[k] ?? 0, x = o != null || s != null, b = Math.max(0, c - B * 2 - I - (x ? U : 0)), h = C(() => K({
|
|
19
|
+
actions: g,
|
|
20
|
+
availableWidth: b,
|
|
21
|
+
collapseLabels: !0,
|
|
22
|
+
resolveActionWidth: (e, l) => a[N(e.id, l)],
|
|
23
|
+
moreButtonWidthPx: a[w]
|
|
24
|
+
}), [
|
|
25
|
+
g,
|
|
26
|
+
b,
|
|
27
|
+
a
|
|
28
|
+
]), v = (e, l, O) => /* @__PURE__ */ r(y, {
|
|
29
|
+
dataTest: e.dataTest ?? `${d}-${O}`,
|
|
30
|
+
variant: e.variant ?? l,
|
|
31
|
+
error: e.tone === "danger",
|
|
32
|
+
size: "medium",
|
|
33
|
+
type: e.type ?? "button",
|
|
34
|
+
disabled: e.disabled,
|
|
35
|
+
startIcon: e.icon,
|
|
36
|
+
onClick: e.onClick,
|
|
37
|
+
"aria-label": e.ariaLabel,
|
|
38
|
+
children: e.label
|
|
39
|
+
});
|
|
40
|
+
return /* @__PURE__ */ t("div", {
|
|
41
|
+
ref: A,
|
|
42
|
+
"data-testid": d,
|
|
43
|
+
className: T("flex items-center justify-end border-0 border-t border-solid border-delta-200 bg-white", u ? "gap-2 p-2" : "gap-4 p-4", E && "rounded-b-lg", P && "sticky bottom-0 z-[1] shadow-[0_0_16px_0_rgba(34,33,51,0.2)]", W),
|
|
44
|
+
children: [/* @__PURE__ */ r("div", {
|
|
45
|
+
className: "flex shrink-0 flex-nowrap items-center gap-2",
|
|
46
|
+
children: n ?? /* @__PURE__ */ t(_, { children: [h.inlineActions.map(({ action: e, showLabel: l }) => /* @__PURE__ */ r("span", {
|
|
47
|
+
ref: m(N(e.id, l)),
|
|
48
|
+
className: "inline-flex shrink-0",
|
|
49
|
+
children: /* @__PURE__ */ r(F, {
|
|
50
|
+
action: e,
|
|
51
|
+
showLabel: l
|
|
52
|
+
})
|
|
53
|
+
}, e.id)), h.showMoreMenu && /* @__PURE__ */ t(_, { children: [/* @__PURE__ */ r("span", {
|
|
54
|
+
ref: m(w),
|
|
55
|
+
className: "inline-flex shrink-0",
|
|
56
|
+
children: /* @__PURE__ */ r(y, {
|
|
57
|
+
dataTest: `${d}-more`,
|
|
58
|
+
variant: "outlined",
|
|
59
|
+
size: "medium",
|
|
60
|
+
type: "button",
|
|
61
|
+
onClick: (e) => f(e.currentTarget),
|
|
62
|
+
"aria-label": R.more,
|
|
63
|
+
"aria-haspopup": "menu",
|
|
64
|
+
"aria-expanded": p != null,
|
|
65
|
+
startIcon: /* @__PURE__ */ r(S, {
|
|
66
|
+
width: 24,
|
|
67
|
+
height: 24
|
|
68
|
+
})
|
|
69
|
+
})
|
|
70
|
+
}), /* @__PURE__ */ r($, {
|
|
71
|
+
anchorEl: p,
|
|
72
|
+
open: p != null,
|
|
73
|
+
onClose: () => f(null),
|
|
74
|
+
anchorOrigin: {
|
|
75
|
+
vertical: "top",
|
|
76
|
+
horizontal: "left"
|
|
77
|
+
},
|
|
78
|
+
transformOrigin: {
|
|
79
|
+
vertical: "bottom",
|
|
80
|
+
horizontal: "left"
|
|
81
|
+
},
|
|
82
|
+
children: h.overflowActions.map((e) => /* @__PURE__ */ r(z, {
|
|
83
|
+
disabled: e.disabled,
|
|
84
|
+
onClick: () => {
|
|
85
|
+
f(null), e.onClick();
|
|
86
|
+
},
|
|
87
|
+
children: /* @__PURE__ */ t("div", {
|
|
88
|
+
className: T("flex items-center gap-2", e.tone === "danger" ? "text-beta-500" : "text-delta-700"),
|
|
89
|
+
children: [e.icon, /* @__PURE__ */ r("span", { children: e.label })]
|
|
90
|
+
})
|
|
91
|
+
}, e.id))
|
|
92
|
+
})] })] })
|
|
93
|
+
}), x && /* @__PURE__ */ r("span", {
|
|
94
|
+
className: "flex min-w-px flex-1 flex-nowrap items-center justify-end",
|
|
95
|
+
children: /* @__PURE__ */ t("span", {
|
|
96
|
+
ref: m(k),
|
|
97
|
+
className: "flex shrink-0 flex-nowrap items-center gap-2",
|
|
98
|
+
children: [o && v(o, "outlined", "secondary"), s && v(s, "contained", "primary")]
|
|
99
|
+
})
|
|
100
|
+
})]
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
export {
|
|
104
|
+
ae as StyledDialogFooter
|
|
105
|
+
};
|
|
@@ -8,9 +8,9 @@ import { ArrowExpandIcon as ne } from "../../icons/arrow-expand-icon/ArrowExpand
|
|
|
8
8
|
import { ArrowShrinkIcon as oe } from "../../icons/arrow-shrink-icon/ArrowShrinkIcon.js";
|
|
9
9
|
import { StyledTooltip as f } from "../../data-display/tooltip/StyledTooltip.js";
|
|
10
10
|
import { StyledButton as t } from "../../inputs/button/StyledButton.js";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
11
|
+
import { StyledMenu as se } from "../../navigation/menu/StyledMenu.js";
|
|
12
|
+
import { StyledMenuItem as ce } from "../../navigation/menu/StyledMenuItem.js";
|
|
13
|
+
import { useFocusTrap as me } from "../../../hooks/useFocusTrap.hook.js";
|
|
14
14
|
import q from "./MinimizableDialog.module.js";
|
|
15
15
|
import { useToggleMenuVisibility as he } from "../../../hooks/useToggleMenuVisibility.hook.js";
|
|
16
16
|
import H from "clsx";
|
|
@@ -18,7 +18,7 @@ import { useRef as fe, useState as J } from "react";
|
|
|
18
18
|
import { Fragment as z, jsx as e, jsxs as i } from "react/jsx-runtime";
|
|
19
19
|
var Ee = ({ onCloseText: u = "", onMinimizeText: N = "", onExpandText: I = "", onFullScreenText: M = "", showCloseIcon: j = !0, showMinimizeIcon: Q = !0, showExpandIcon: T = !0, showFullScreenIcon: W = !0, title: s, label: b, children: g, open: C, onClose: x, className: _ = "", primaryButtonText: w, primaryButtonLoading: k = !1, secondaryButtonText: c, onPrimaryButtonClick: v, onSecondaryButtonClick: p, dataTest: F, actionNode: X, extraActions: r, extraActionsText: m, btnContainerClassName: G, footerClassName: Y, footerInfo: D, locale: l = "en", enableFullscreen: Z = !0, fullScreenState: E, handleFullScreenState: L }) => {
|
|
20
20
|
const [d, A] = J(!1), [R, P] = J(!1), { open: B, anchorEl: ee, handleOpen: ie, handleClose: te } = he(), S = fe(null), a = E ?? R, n = a && !d;
|
|
21
|
-
if (
|
|
21
|
+
if (me(C && n, S, x), !C) return null;
|
|
22
22
|
const le = n ? {
|
|
23
23
|
right: "auto",
|
|
24
24
|
bottom: "auto",
|
|
@@ -176,11 +176,11 @@ var Ee = ({ onCloseText: u = "", onMinimizeText: N = "", onExpandText: I = "", o
|
|
|
176
176
|
}),
|
|
177
177
|
onClick: ie,
|
|
178
178
|
children: m
|
|
179
|
-
}), /* @__PURE__ */ e(
|
|
179
|
+
}), /* @__PURE__ */ e(se, {
|
|
180
180
|
open: B,
|
|
181
181
|
anchorEl: ee,
|
|
182
182
|
onClose: te,
|
|
183
|
-
children: r.map((o) => /* @__PURE__ */ e(
|
|
183
|
+
children: r.map((o) => /* @__PURE__ */ e(ce, {
|
|
184
184
|
className: o.className,
|
|
185
185
|
onClick: o.onClick,
|
|
186
186
|
children: o.label
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
var _ = "
|
|
2
|
-
"asma-ui-core-button": "_asma-ui-core-
|
|
1
|
+
var _ = "_contained_lpch6_6", t = "_common_lpch6_6", a = "_medium_lpch6_55", e = "_small_lpch6_62", r = "_large_lpch6_69", l = "_error_lpch6_81", c = "_outlined_lpch6_156", o = "_text_lpch6_306", h = "_textGray_lpch6_456", m = "_textWhite_lpch6_531", p = {
|
|
2
|
+
"asma-ui-core-button": "_asma-ui-core-button_lpch6_1",
|
|
3
3
|
contained: _,
|
|
4
4
|
common: t,
|
|
5
5
|
medium: a,
|
|
6
6
|
small: e,
|
|
7
7
|
large: r,
|
|
8
|
-
error:
|
|
9
|
-
outlined:
|
|
10
|
-
text:
|
|
11
|
-
textGray:
|
|
12
|
-
textWhite:
|
|
8
|
+
error: l,
|
|
9
|
+
outlined: c,
|
|
10
|
+
text: o,
|
|
11
|
+
textGray: h,
|
|
12
|
+
textWhite: m
|
|
13
13
|
};
|
|
14
14
|
export {
|
|
15
|
-
|
|
15
|
+
p as default
|
|
16
16
|
};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { cn as C } from "../../../../helpers/cn.js";
|
|
2
2
|
import e from "./StyledCheckbox.module.js";
|
|
3
|
-
import
|
|
4
|
-
import { Fragment as
|
|
5
|
-
var
|
|
3
|
+
import F, { useEffect as x, useRef as b } from "react";
|
|
4
|
+
import { Fragment as K, jsx as t, jsxs as v } from "react/jsx-runtime";
|
|
5
|
+
var M = (o) => /* @__PURE__ */ t("svg", {
|
|
6
6
|
"aria-hidden": "true",
|
|
7
7
|
viewBox: "0 0 24 24",
|
|
8
8
|
width: "100%",
|
|
9
9
|
height: "100%",
|
|
10
10
|
fill: "none",
|
|
11
|
-
...
|
|
12
|
-
children: /* @__PURE__ */
|
|
11
|
+
...o,
|
|
12
|
+
children: /* @__PURE__ */ t("path", {
|
|
13
13
|
d: "M6 12H18",
|
|
14
14
|
stroke: "currentColor",
|
|
15
|
-
strokeWidth:
|
|
15
|
+
strokeWidth: o.strokeWidth ?? 3,
|
|
16
16
|
strokeLinecap: "round"
|
|
17
17
|
})
|
|
18
|
-
}),
|
|
18
|
+
}), S = (o) => /* @__PURE__ */ t("svg", {
|
|
19
19
|
"aria-hidden": "true",
|
|
20
20
|
viewBox: "0 0 24 24",
|
|
21
21
|
width: "100%",
|
|
@@ -25,63 +25,66 @@ var F = (n) => /* @__PURE__ */ r("svg", {
|
|
|
25
25
|
strokeWidth: 2,
|
|
26
26
|
strokeLinecap: "round",
|
|
27
27
|
strokeLinejoin: "round",
|
|
28
|
-
...
|
|
29
|
-
children: /* @__PURE__ */
|
|
30
|
-
}),
|
|
31
|
-
const
|
|
28
|
+
...o,
|
|
29
|
+
children: /* @__PURE__ */ t("path", { d: "M4 12l5 5L20 6" })
|
|
30
|
+
}), G = ({ dataTest: o, size: l = "small", disabled: d, readOnly: a, error: g, indeterminate: n = !1, checked: p, disableRipple: w, hideWrapper: R, className: N, checkboxClassName: I, onChange: W, onClick: E, onKeyDown: D, decorative: L, ...y }) => {
|
|
31
|
+
const c = !!R, s = !w && !c && !d && !a, h = b(null), u = b(null);
|
|
32
32
|
x(() => {
|
|
33
|
-
h.current && (h.current.indeterminate =
|
|
34
|
-
}, [
|
|
35
|
-
const k = C(e.CheckboxWrapper, !
|
|
36
|
-
if (
|
|
33
|
+
h.current && (h.current.indeterminate = n);
|
|
34
|
+
}, [n]);
|
|
35
|
+
const k = C(e.CheckboxWrapper, !c && e[`size-${l}`], c && e.HideWrapper, n && e.Indeterminate, a && e.ReadOnly, g && e.Error, s && e.CheckboxHover, N), H = C(e.Checkbox, e[`size-${l}`], n && e.Indeterminate, I), P = n ? M : S, j = F.useCallback((r) => {
|
|
36
|
+
if (r.stopPropagation(), !s) return;
|
|
37
37
|
const i = document.createElement("span");
|
|
38
38
|
e.CheckboxRipple && (i.className = e.CheckboxRipple), i.addEventListener("animationend", () => i.remove(), { once: !0 }), u.current?.appendChild(i);
|
|
39
|
-
}, [
|
|
39
|
+
}, [s]);
|
|
40
40
|
x(() => {
|
|
41
|
-
const
|
|
42
|
-
return () =>
|
|
41
|
+
const r = u.current;
|
|
42
|
+
return () => r?.replaceChildren();
|
|
43
43
|
}, []);
|
|
44
|
-
const
|
|
45
|
-
a || W?.(
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
"data-
|
|
44
|
+
const $ = (r) => {
|
|
45
|
+
a || W?.(r, r.target.checked);
|
|
46
|
+
}, B = (r) => {
|
|
47
|
+
D?.(r), !(r.defaultPrevented || r.key !== "Enter" || a) && (r.preventDefault(), r.currentTarget.click());
|
|
48
|
+
}, f = {
|
|
49
|
+
"data-checked": p && !n ? "" : void 0,
|
|
50
|
+
"data-unchecked": !p && !n ? "" : void 0,
|
|
51
|
+
"data-indeterminate": n ? "" : void 0,
|
|
50
52
|
"data-disabled": d ? "" : void 0
|
|
51
|
-
},
|
|
53
|
+
}, m = /* @__PURE__ */ v(K, { children: [!c && s && /* @__PURE__ */ t("span", {
|
|
52
54
|
ref: u,
|
|
53
55
|
className: e.CheckboxRippleContainer
|
|
54
|
-
}), /* @__PURE__ */
|
|
55
|
-
className:
|
|
56
|
-
children: /* @__PURE__ */
|
|
56
|
+
}), /* @__PURE__ */ t("span", {
|
|
57
|
+
className: H,
|
|
58
|
+
children: /* @__PURE__ */ t("span", {
|
|
57
59
|
className: e.Indicator,
|
|
58
|
-
children: /* @__PURE__ */
|
|
60
|
+
children: /* @__PURE__ */ t(P, { strokeWidth: l === "small" ? 3 : 2 })
|
|
59
61
|
})
|
|
60
62
|
})] });
|
|
61
|
-
return L ? /* @__PURE__ */
|
|
63
|
+
return L ? /* @__PURE__ */ t("span", {
|
|
62
64
|
"aria-hidden": "true",
|
|
63
65
|
className: k,
|
|
64
|
-
"data-testid":
|
|
65
|
-
...
|
|
66
|
-
children:
|
|
67
|
-
}) : /* @__PURE__ */
|
|
66
|
+
"data-testid": o,
|
|
67
|
+
...f,
|
|
68
|
+
children: m
|
|
69
|
+
}) : /* @__PURE__ */ v("label", {
|
|
68
70
|
className: k,
|
|
69
|
-
"data-testid":
|
|
70
|
-
onPointerDown:
|
|
71
|
+
"data-testid": o,
|
|
72
|
+
onPointerDown: j,
|
|
71
73
|
onClick: E,
|
|
72
|
-
...
|
|
73
|
-
children: [/* @__PURE__ */
|
|
74
|
+
...f,
|
|
75
|
+
children: [/* @__PURE__ */ t("input", {
|
|
74
76
|
ref: h,
|
|
75
77
|
type: "checkbox",
|
|
76
78
|
className: "sr-only",
|
|
77
79
|
checked: p,
|
|
78
80
|
disabled: d,
|
|
79
81
|
readOnly: a,
|
|
80
|
-
onChange:
|
|
81
|
-
|
|
82
|
-
|
|
82
|
+
onChange: $,
|
|
83
|
+
onKeyDown: B,
|
|
84
|
+
...y
|
|
85
|
+
}), m]
|
|
83
86
|
});
|
|
84
87
|
};
|
|
85
88
|
export {
|
|
86
|
-
|
|
89
|
+
G as StyledCheckbox
|
|
87
90
|
};
|