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.
@@ -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 _ } from "../../icons/close-icon/CloseIcon.js";
4
- import { StyledButton as I } from "../../inputs/button/StyledButton.js";
5
- import { useMobileMediaQuery as R } from "../../../hooks/useMediaQuery.hook.js";
6
- import z from "./StyledDialog.module.js";
7
- import { useEffect as K, useRef as P } from "react";
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 W = {
9
+ var X = {
10
10
  xs: 444,
11
11
  sm: 600,
12
12
  md: 900,
13
13
  lg: 1200,
14
14
  xl: 1536
15
- }, J = ({ open: r, onClose: o, children: h, dataTest: a, maxWidth: n = "sm", fullWidth: y, fullScreen: g, scroll: w = "paper", disableEscapeKeyDown: v, className: b, style: D, sx: N, PaperProps: k, slotProps: C, onCloseText: S, showCloseIcon: d = !0, dialogLabel: s, dialogTitle: c, dialogHeaderNode: j }) => {
16
- const M = R(), i = P(null), f = M ? !0 : g;
17
- K(() => {
18
- const e = i.current;
19
- e && (r && !e.open ? e.showModal() : !r && e.open && e.close());
20
- }, [r]);
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
- ...k,
23
- ...C?.paper
24
- }, x = n === !1 ? void 0 : W[n];
22
+ ...C,
23
+ ...S?.paper
24
+ }, x = i === !1 ? void 0 : X[i];
25
25
  return /* @__PURE__ */ t("dialog", {
26
- ref: i,
26
+ ref: c,
27
27
  "data-testid": a,
28
28
  "aria-label": a,
29
29
  onCancel: (e) => {
30
- e.preventDefault(), v || o?.(e, "escapeKeyDown");
30
+ e.preventDefault(), v || r?.(e, "escapeKeyDown");
31
31
  },
32
32
  onClick: (e) => {
33
- e.target === i.current && o?.(e, "backdropClick");
33
+ e.target === c.current && r?.(e, "backdropClick");
34
34
  },
35
- className: p(z.StyledDialog, "m-auto max-h-[calc(100%-64px)] overflow-hidden rounded-2xl border-0 bg-white p-0 text-delta-800 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" : "flex flex-col", b, m.className),
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: [(!!s || !!c || d) && /* @__PURE__ */ t("div", {
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: [s && /* @__PURE__ */ l("div", {
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: s
50
- }), c && /* @__PURE__ */ l("div", {
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: c
52
+ children: s
53
53
  })]
54
54
  }), d && /* @__PURE__ */ t("div", {
55
55
  className: "flex flex-grow justify-end gap-2",
56
- children: [j, /* @__PURE__ */ l(I, {
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) => o?.(e, "escapeKeyDown"),
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: S
70
+ children: j
71
71
  })]
72
72
  })]
73
73
  }), h]
74
74
  });
75
75
  };
76
76
  export {
77
- J as StyledDialog
77
+ O as StyledDialog
78
78
  };
@@ -1,30 +1,31 @@
1
- import { cn as S } from "../../../helpers/cn.js";
2
- import { StyledPopover as c } from "../../utils/popover/StyledPopover.js";
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 o } from "react/jsx-runtime";
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
- }, E = ({ open: p, anchorEl: e, onClose: t, anchorOrigin: a, transformOrigin: d, id: l, className: m, sx: s, classes: r, autoFocus: x = !0, onClick: i, children: n }) => /* @__PURE__ */ o(c, {
9
- open: p,
10
- anchorEl: e,
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: a,
13
- transformOrigin: d,
14
- id: l,
15
- className: m,
16
- sx: s,
12
+ anchorOrigin: l,
13
+ transformOrigin: m,
14
+ id: d,
15
+ className: s,
16
+ sx: x,
17
17
  slotProps: { paper: {
18
- className: S("rounded", r?.paper),
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__ */ o(f, {
22
- autoFocus: x,
23
- className: r?.list,
24
- onClick: i,
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
- E as StyledMenu
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 p } from "react/jsx-runtime";
4
- var w = ({ children: n, onClick: o, disabled: e, selected: l, className: i, classes: r, sx: m, "data-test": d, "data-testid": u, value: y }) => /* @__PURE__ */ p("li", {
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": d,
9
- "data-testid": u,
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-2.5 outline-none", e ? "cursor-not-allowed" : "cursor-pointer hover:bg-delta-50", l && a("bg-gama-50", r?.selected), r?.root, i),
15
- style: s(m),
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
- w as StyledMenuItem
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 P, useInteractions as S, useMergeRefs as k } from "@floating-ui/react";
6
- var C = {
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
- }, E = {
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: o = C, transformOrigin: r = E, id: n, className: p, sx: m, slotProps: a, onClick: c, children: f }) => {
13
- const { refs: d, floatingStyles: u, context: v } = P({
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(o, r), [o, r]),
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 } = S([N(v, {
26
+ }), { getFloatingProps: g } = k([N(v, {
27
27
  outsidePress: !0,
28
28
  escapeKey: !0
29
- })]), h = k([d.setFloating]);
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(a?.paper?.sx)
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", a?.paper?.className),
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?: (event: SyntheticEvent, value: TabValue) => void;
5
+ onChange?(event: SyntheticEvent, value: TabValue): void;
6
6
  variant?: 'standard' | 'scrollable' | 'fullWidth';
7
7
  scrollButtons?: 'auto' | boolean;
8
8
  centered?: boolean;
@@ -17,6 +17,7 @@ export interface StyledPopoverProps {
17
17
  paper?: {
18
18
  className?: string;
19
19
  sx?: unknown;
20
+ style?: React.CSSProperties;
20
21
  };
21
22
  };
22
23
  onClick?: (event: React.MouseEvent<HTMLDivElement>) => void;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "3.35.0",
6
+ "version": "3.37.0",
7
7
  "type": "module",
8
8
  "sideEffects": [
9
9
  "**/*.css",