asma-ui-core 3.35.0 → 3.37.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/feedback/dialog/StyledDialog.js +29 -29
- package/dist/components/navigation/menu/StyledMenu.js +19 -18
- package/dist/components/navigation/menu/StyledMenuItem.js +7 -7
- package/dist/components/utils/popover/StyledPopover.js +11 -10
- package/dist/src/components/feedback/dialog/StyledDialog.d.ts +13 -0
- package/dist/src/components/navigation/drawer/StyledDrawer.d.ts +7 -0
- package/dist/src/components/navigation/menu/StyledMenu.d.ts +10 -2
- package/dist/src/components/navigation/menu/StyledMenuItem.d.ts +3 -1
- package/dist/src/components/navigation/tabs/StyledTabs.d.ts +1 -1
- package/dist/src/components/utils/popover/StyledPopover.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
import { cn as p } from "../../../helpers/cn.js";
|
|
2
2
|
import { resolveSx as u } from "../../../helpers/sx.js";
|
|
3
|
-
import { CloseIcon as
|
|
4
|
-
import { StyledButton as
|
|
5
|
-
import { useMobileMediaQuery as
|
|
6
|
-
import
|
|
7
|
-
import { useEffect as
|
|
3
|
+
import { CloseIcon as I } from "../../icons/close-icon/CloseIcon.js";
|
|
4
|
+
import { StyledButton as R } from "../../inputs/button/StyledButton.js";
|
|
5
|
+
import { useMobileMediaQuery as z } from "../../../hooks/useMediaQuery.hook.js";
|
|
6
|
+
import K from "./StyledDialog.module.js";
|
|
7
|
+
import { useEffect as P, useRef as W } from "react";
|
|
8
8
|
import { jsx as l, jsxs as t } from "react/jsx-runtime";
|
|
9
|
-
var
|
|
9
|
+
var X = {
|
|
10
10
|
xs: 444,
|
|
11
11
|
sm: 600,
|
|
12
12
|
md: 900,
|
|
13
13
|
lg: 1200,
|
|
14
14
|
xl: 1536
|
|
15
|
-
},
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
const e =
|
|
19
|
-
e && (
|
|
20
|
-
}, [
|
|
15
|
+
}, O = ({ open: o, onClose: r, children: h, dataTest: a, maxWidth: i = "sm", fullWidth: y, fullScreen: g, scroll: w = "paper", disableEscapeKeyDown: v, className: b, style: D, sx: N, classes: k, PaperProps: C, slotProps: S, onCloseText: j, showCloseIcon: d = !0, dialogLabel: n, dialogTitle: s, dialogHeaderNode: M }) => {
|
|
16
|
+
const _ = z(), c = W(null), f = _ ? !0 : g;
|
|
17
|
+
P(() => {
|
|
18
|
+
const e = c.current;
|
|
19
|
+
e && (o && !e.open ? e.showModal() : !o && e.open && e.close());
|
|
20
|
+
}, [o]);
|
|
21
21
|
const m = {
|
|
22
|
-
...
|
|
23
|
-
...
|
|
24
|
-
}, x =
|
|
22
|
+
...C,
|
|
23
|
+
...S?.paper
|
|
24
|
+
}, x = i === !1 ? void 0 : X[i];
|
|
25
25
|
return /* @__PURE__ */ t("dialog", {
|
|
26
|
-
ref:
|
|
26
|
+
ref: c,
|
|
27
27
|
"data-testid": a,
|
|
28
28
|
"aria-label": a,
|
|
29
29
|
onCancel: (e) => {
|
|
30
|
-
e.preventDefault(), v ||
|
|
30
|
+
e.preventDefault(), v || r?.(e, "escapeKeyDown");
|
|
31
31
|
},
|
|
32
32
|
onClick: (e) => {
|
|
33
|
-
e.target ===
|
|
33
|
+
e.target === c.current && r?.(e, "backdropClick");
|
|
34
34
|
},
|
|
35
|
-
className: p(
|
|
35
|
+
className: p(K.StyledDialog, "text-delta-800 m-auto max-h-[calc(100%-64px)] overflow-hidden rounded-2xl border-0 bg-white p-0 shadow-xl", f ? "h-full max-h-full w-full max-w-full rounded-none" : p("w-[calc(100%-64px)]", y ? "w-[calc(100%-64px)]" : "w-auto"), w === "body" ? "overflow-y-auto" : "open:flex open:flex-col", b, m.className, k?.paper),
|
|
36
36
|
style: {
|
|
37
37
|
zIndex: 999,
|
|
38
38
|
...x && !f ? { maxWidth: x } : {},
|
|
@@ -40,39 +40,39 @@ var W = {
|
|
|
40
40
|
...u(m.sx),
|
|
41
41
|
...D
|
|
42
42
|
},
|
|
43
|
-
children: [(!!
|
|
43
|
+
children: [(!!n || !!s || d) && /* @__PURE__ */ t("div", {
|
|
44
44
|
className: "flex w-full justify-between px-4 pt-4",
|
|
45
45
|
children: [/* @__PURE__ */ t("div", {
|
|
46
46
|
className: "flex flex-col justify-start gap-0.5",
|
|
47
|
-
children: [
|
|
47
|
+
children: [n && /* @__PURE__ */ l("div", {
|
|
48
48
|
className: "flex h-8 items-center text-sm font-normal leading-5 text-[var(--colors-grey-700)]",
|
|
49
|
-
children:
|
|
50
|
-
}),
|
|
49
|
+
children: n
|
|
50
|
+
}), s && /* @__PURE__ */ l("div", {
|
|
51
51
|
className: "flex text-2xl font-semibold leading-8 text-[var(--colors-grey-800)]",
|
|
52
|
-
children:
|
|
52
|
+
children: s
|
|
53
53
|
})]
|
|
54
54
|
}), d && /* @__PURE__ */ t("div", {
|
|
55
55
|
className: "flex flex-grow justify-end gap-2",
|
|
56
|
-
children: [
|
|
56
|
+
children: [M, /* @__PURE__ */ l(R, {
|
|
57
57
|
dataTest: `close-button-${a}`,
|
|
58
58
|
variant: "textGray",
|
|
59
59
|
size: "small",
|
|
60
|
-
endIcon: /* @__PURE__ */ l(
|
|
60
|
+
endIcon: /* @__PURE__ */ l(I, {
|
|
61
61
|
width: 20,
|
|
62
62
|
height: 20
|
|
63
63
|
}),
|
|
64
|
-
onClick: (e) =>
|
|
64
|
+
onClick: (e) => r?.(e, "escapeKeyDown"),
|
|
65
65
|
style: {
|
|
66
66
|
color: "var(--colors-grey-800)",
|
|
67
67
|
paddingRight: "6px",
|
|
68
68
|
paddingLeft: "6px"
|
|
69
69
|
},
|
|
70
|
-
children:
|
|
70
|
+
children: j
|
|
71
71
|
})]
|
|
72
72
|
})]
|
|
73
73
|
}), h]
|
|
74
74
|
});
|
|
75
75
|
};
|
|
76
76
|
export {
|
|
77
|
-
|
|
77
|
+
O as StyledDialog
|
|
78
78
|
};
|
|
@@ -1,30 +1,31 @@
|
|
|
1
|
-
import { cn as
|
|
2
|
-
import { StyledPopover as
|
|
1
|
+
import { cn as y } from "../../../helpers/cn.js";
|
|
2
|
+
import { StyledPopover as S } from "../../utils/popover/StyledPopover.js";
|
|
3
3
|
import { StyledMenuList as f } from "./StyledMenuList.js";
|
|
4
|
-
import { jsx as
|
|
4
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
5
5
|
var u = {
|
|
6
6
|
border: "1px solid var(--colors-delta-300)",
|
|
7
7
|
boxShadow: "0px 2px 4px 0px rgba(34, 33, 51, 0.15)"
|
|
8
|
-
},
|
|
9
|
-
open:
|
|
10
|
-
anchorEl:
|
|
8
|
+
}, M = ({ open: a, anchorEl: o, onClose: t, anchorOrigin: l, transformOrigin: m, id: d, className: s, sx: x, classes: e, slotProps: r, autoFocus: i = !0, onClick: c, children: n }) => /* @__PURE__ */ p(S, {
|
|
9
|
+
open: a,
|
|
10
|
+
anchorEl: o,
|
|
11
11
|
onClose: t,
|
|
12
|
-
anchorOrigin:
|
|
13
|
-
transformOrigin:
|
|
14
|
-
id:
|
|
15
|
-
className:
|
|
16
|
-
sx:
|
|
12
|
+
anchorOrigin: l,
|
|
13
|
+
transformOrigin: m,
|
|
14
|
+
id: d,
|
|
15
|
+
className: s,
|
|
16
|
+
sx: x,
|
|
17
17
|
slotProps: { paper: {
|
|
18
|
-
className:
|
|
19
|
-
sx: u
|
|
18
|
+
className: y("rounded", e?.paper, r?.paper?.className),
|
|
19
|
+
sx: [u, r?.paper?.sx],
|
|
20
|
+
style: r?.paper?.style
|
|
20
21
|
} },
|
|
21
|
-
children: /* @__PURE__ */
|
|
22
|
-
autoFocus:
|
|
23
|
-
className:
|
|
24
|
-
onClick:
|
|
22
|
+
children: /* @__PURE__ */ p(f, {
|
|
23
|
+
autoFocus: i,
|
|
24
|
+
className: e?.list,
|
|
25
|
+
onClick: c,
|
|
25
26
|
children: n
|
|
26
27
|
})
|
|
27
28
|
});
|
|
28
29
|
export {
|
|
29
|
-
|
|
30
|
+
M as StyledMenu
|
|
30
31
|
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { cn as a } from "../../../helpers/cn.js";
|
|
2
2
|
import { resolveSx as s } from "../../../helpers/sx.js";
|
|
3
|
-
import { jsx as
|
|
4
|
-
var
|
|
3
|
+
import { jsx as y } from "react/jsx-runtime";
|
|
4
|
+
var D = ({ children: n, onClick: o, disabled: e, selected: l, dense: i, className: m, classes: r, sx: d, "data-test": u, "data-testid": p, value: f }) => /* @__PURE__ */ y("li", {
|
|
5
5
|
role: "menuitem",
|
|
6
6
|
"aria-disabled": e ? !0 : void 0,
|
|
7
7
|
tabIndex: -1,
|
|
8
|
-
"data-test":
|
|
9
|
-
"data-testid":
|
|
8
|
+
"data-test": u,
|
|
9
|
+
"data-testid": p,
|
|
10
10
|
onClick: e ? void 0 : o,
|
|
11
11
|
onKeyDown: (t) => {
|
|
12
12
|
e || (t.key === "Enter" || t.key === " ") && (t.preventDefault(), o?.(t));
|
|
13
13
|
},
|
|
14
|
-
className: a("flex items-center px-3 py-
|
|
15
|
-
style: s(
|
|
14
|
+
className: a("flex items-center px-3 outline-none", i ? "py-1.5" : "py-2.5", e ? "cursor-not-allowed" : "cursor-pointer hover:bg-delta-50", l && a("bg-gama-50", r?.selected), r?.root, m),
|
|
15
|
+
style: s(d),
|
|
16
16
|
children: n
|
|
17
17
|
});
|
|
18
18
|
export {
|
|
19
|
-
|
|
19
|
+
D as StyledMenuItem
|
|
20
20
|
};
|
|
@@ -2,17 +2,17 @@ import { cn as w } from "../../../helpers/cn.js";
|
|
|
2
2
|
import { resolveSx as l } from "../../../helpers/sx.js";
|
|
3
3
|
import { useMemo as x } from "react";
|
|
4
4
|
import { jsx as i } from "react/jsx-runtime";
|
|
5
|
-
import { FloatingPortal as z, autoUpdate as R, flip as A, offset as D, shift as M, useDismiss as N, useFloating as
|
|
6
|
-
var
|
|
5
|
+
import { FloatingPortal as z, autoUpdate as R, flip as A, offset as D, shift as M, useDismiss as N, useFloating as S, useInteractions as k, useMergeRefs as C } from "@floating-ui/react";
|
|
6
|
+
var E = {
|
|
7
7
|
vertical: "bottom",
|
|
8
8
|
horizontal: "left"
|
|
9
|
-
},
|
|
9
|
+
}, P = {
|
|
10
10
|
vertical: "top",
|
|
11
11
|
horizontal: "left"
|
|
12
|
-
}, T = (e, t) => `${t.vertical === "bottom" ? "top" : t.vertical === "top" ? "bottom" : e.vertical === "top" ? "top" : "bottom"}${e.horizontal === "left" ? "-start" : e.horizontal === "right" ? "-end" : ""}`, j = ({ open: e, anchorEl: t, onClose: s, anchorOrigin:
|
|
13
|
-
const { refs: d, floatingStyles: u, context: v } =
|
|
12
|
+
}, T = (e, t) => `${t.vertical === "bottom" ? "top" : t.vertical === "top" ? "bottom" : e.vertical === "top" ? "top" : "bottom"}${e.horizontal === "left" ? "-start" : e.horizontal === "right" ? "-end" : ""}`, j = ({ open: e, anchorEl: t, onClose: s, anchorOrigin: r = E, transformOrigin: a = P, id: n, className: p, sx: m, slotProps: o, onClick: c, children: f }) => {
|
|
13
|
+
const { refs: d, floatingStyles: u, context: v } = S({
|
|
14
14
|
open: e,
|
|
15
|
-
placement: x(() => T(
|
|
15
|
+
placement: x(() => T(r, a), [r, a]),
|
|
16
16
|
whileElementsMounted: R,
|
|
17
17
|
elements: { reference: t ?? void 0 },
|
|
18
18
|
middleware: [
|
|
@@ -23,20 +23,21 @@ var C = {
|
|
|
23
23
|
onOpenChange: (y, F, b) => {
|
|
24
24
|
y || s?.(F ?? {}, b === "escape-key" ? "escapeKeyDown" : "backdropClick");
|
|
25
25
|
}
|
|
26
|
-
}), { getFloatingProps: g } =
|
|
26
|
+
}), { getFloatingProps: g } = k([N(v, {
|
|
27
27
|
outsidePress: !0,
|
|
28
28
|
escapeKey: !0
|
|
29
|
-
})]), h =
|
|
29
|
+
})]), h = C([d.setFloating]);
|
|
30
30
|
return e ? /* @__PURE__ */ i(z, { children: /* @__PURE__ */ i("div", {
|
|
31
31
|
ref: h,
|
|
32
32
|
id: n,
|
|
33
33
|
style: {
|
|
34
34
|
...u,
|
|
35
35
|
...l(m),
|
|
36
|
-
...l(
|
|
36
|
+
...l(o?.paper?.sx),
|
|
37
|
+
...o?.paper?.style
|
|
37
38
|
},
|
|
38
39
|
...g({ onClick: c }),
|
|
39
|
-
className: w("z-[1300] overflow-auto rounded bg-white shadow-lg", p ?? "my-1",
|
|
40
|
+
className: w("z-[1300] overflow-auto rounded bg-white shadow-lg", p ?? "my-1", o?.paper?.className),
|
|
40
41
|
children: f
|
|
41
42
|
}) }) : null;
|
|
42
43
|
};
|
|
@@ -16,9 +16,22 @@ export interface IStyledDialogProps {
|
|
|
16
16
|
fullScreen?: boolean;
|
|
17
17
|
scroll?: 'paper' | 'body';
|
|
18
18
|
disableEscapeKeyDown?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Accepted for MUI `Dialog` parity (DEC-003). Focus is trapped by the native `<dialog>`
|
|
21
|
+
* `showModal()`, so this MUI `Modal` prop is a typed no-op.
|
|
22
|
+
*/
|
|
23
|
+
disableEnforceFocus?: boolean;
|
|
19
24
|
className?: string;
|
|
20
25
|
style?: CSSProperties;
|
|
21
26
|
sx?: unknown;
|
|
27
|
+
/**
|
|
28
|
+
* MUI `Dialog` `classes` parity (DEC-003). The native `<dialog>` is the paper, so `classes.paper`
|
|
29
|
+
* is merged onto it; `classes.root` is accepted as a typed no-op (no separate root element).
|
|
30
|
+
*/
|
|
31
|
+
classes?: {
|
|
32
|
+
paper?: string;
|
|
33
|
+
root?: string;
|
|
34
|
+
};
|
|
22
35
|
PaperProps?: DialogPaperProps;
|
|
23
36
|
slotProps?: {
|
|
24
37
|
paper?: DialogPaperProps;
|
|
@@ -13,6 +13,13 @@ export interface DrawerProps {
|
|
|
13
13
|
className?: string;
|
|
14
14
|
sx?: unknown;
|
|
15
15
|
};
|
|
16
|
+
/**
|
|
17
|
+
* Accepted for MUI `Drawer` parity (DEC-003). The panel always stays mounted so the slide
|
|
18
|
+
* transition can play, so `keepMounted` is effectively always-on — this prop is a typed no-op.
|
|
19
|
+
*/
|
|
20
|
+
ModalProps?: {
|
|
21
|
+
keepMounted?: boolean;
|
|
22
|
+
};
|
|
16
23
|
children?: ReactNode;
|
|
17
24
|
}
|
|
18
25
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MouseEvent, ReactNode } from 'react';
|
|
1
|
+
import { CSSProperties, MouseEvent, ReactNode } from 'react';
|
|
2
2
|
import { PopoverOrigin, StyledPopoverProps } from '../../utils/popover';
|
|
3
3
|
export interface MenuProps {
|
|
4
4
|
open: boolean;
|
|
@@ -13,6 +13,14 @@ export interface MenuProps {
|
|
|
13
13
|
paper?: string;
|
|
14
14
|
list?: string;
|
|
15
15
|
};
|
|
16
|
+
/** MUI `Menu` `slotProps.paper` parity (DEC-003): styles/classes forwarded to the menu paper. */
|
|
17
|
+
slotProps?: {
|
|
18
|
+
paper?: {
|
|
19
|
+
className?: string;
|
|
20
|
+
sx?: unknown;
|
|
21
|
+
style?: CSSProperties;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
16
24
|
autoFocus?: boolean;
|
|
17
25
|
onClick?: (event: MouseEvent<HTMLUListElement>) => void;
|
|
18
26
|
children?: ReactNode;
|
|
@@ -22,4 +30,4 @@ export interface MenuProps {
|
|
|
22
30
|
* Public props (`open`/`anchorEl`/`onClose`/`anchorOrigin`/`classes`/`autoFocus`) preserved
|
|
23
31
|
* (DEC-003). TASK-303.
|
|
24
32
|
*/
|
|
25
|
-
export declare const StyledMenu: ({ open, anchorEl, onClose, anchorOrigin, transformOrigin, id, className, sx, classes, autoFocus, onClick, children, }: MenuProps) => JSX.Element;
|
|
33
|
+
export declare const StyledMenu: ({ open, anchorEl, onClose, anchorOrigin, transformOrigin, id, className, sx, classes, slotProps, autoFocus, onClick, children, }: MenuProps) => JSX.Element;
|
|
@@ -4,6 +4,8 @@ export interface StyledMenuItemProps {
|
|
|
4
4
|
onClick?: (event: MouseEvent<HTMLLIElement>) => void;
|
|
5
5
|
disabled?: boolean;
|
|
6
6
|
selected?: boolean;
|
|
7
|
+
/** Compact vertical padding (MUI `MenuItem` `dense` parity, DEC-003). */
|
|
8
|
+
dense?: boolean;
|
|
7
9
|
value?: unknown;
|
|
8
10
|
className?: string;
|
|
9
11
|
classes?: {
|
|
@@ -18,4 +20,4 @@ export interface StyledMenuItemProps {
|
|
|
18
20
|
* Native `role="menuitem"` (replaces MUI `MenuItem`). Enter/Space activate; a disabled item stays
|
|
19
21
|
* focusable but non-interactive (MUI parity). Public props preserved (DEC-003). TASK-303.
|
|
20
22
|
*/
|
|
21
|
-
export declare const StyledMenuItem: ({ children, onClick, disabled, selected, className, classes, sx, "data-test": dataTest, "data-testid": dataTestId, value: _value, }: StyledMenuItemProps) => JSX.Element;
|
|
23
|
+
export declare const StyledMenuItem: ({ children, onClick, disabled, selected, dense, className, classes, sx, "data-test": dataTest, "data-testid": dataTestId, value: _value, }: StyledMenuItemProps) => JSX.Element;
|
|
@@ -2,7 +2,7 @@ import { FC, ReactNode, SyntheticEvent } from 'react';
|
|
|
2
2
|
import { TabValue } from './TabsContext';
|
|
3
3
|
export interface StyledTabsProps {
|
|
4
4
|
value?: TabValue;
|
|
5
|
-
onChange
|
|
5
|
+
onChange?(event: SyntheticEvent, value: TabValue): void;
|
|
6
6
|
variant?: 'standard' | 'scrollable' | 'fullWidth';
|
|
7
7
|
scrollButtons?: 'auto' | boolean;
|
|
8
8
|
centered?: boolean;
|