@phillips/seldon 1.166.0 → 1.168.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.
|
@@ -28,6 +28,14 @@ export interface ModalProps extends React.HTMLAttributes<HTMLDivElement>, Dialog
|
|
|
28
28
|
* Content label for accessibility
|
|
29
29
|
*/
|
|
30
30
|
contentLabel?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Custom close icon
|
|
33
|
+
*/
|
|
34
|
+
closeIcon?: React.ReactElement;
|
|
35
|
+
/**
|
|
36
|
+
* Position of the close icon
|
|
37
|
+
*/
|
|
38
|
+
closeIconPosition?: 'left' | 'right';
|
|
31
39
|
}
|
|
32
40
|
/**
|
|
33
41
|
* ## Overview
|
|
@@ -1,51 +1,64 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { getCommonProps as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import { jsx as o, jsxs as r } from "react/jsx-runtime";
|
|
2
|
+
import t from "../../node_modules/classnames/index.js";
|
|
3
|
+
import { getCommonProps as N, noOp as _ } from "../../utils/index.js";
|
|
4
|
+
import M from "../Icon/Icon.js";
|
|
5
|
+
import g from "../IconButton/IconButton.js";
|
|
6
6
|
import { ButtonVariants as v } from "../Button/types.js";
|
|
7
|
-
import { Root as
|
|
8
|
-
import { VisuallyHidden as
|
|
9
|
-
import { forwardRef as
|
|
10
|
-
const
|
|
11
|
-
({
|
|
12
|
-
|
|
7
|
+
import { Root as b, Portal as x, Overlay as I, Content as O, Title as P, Description as $, Close as j } from "../../node_modules/@radix-ui/react-dialog/dist/index.js";
|
|
8
|
+
import { VisuallyHidden as w } from "../../node_modules/@radix-ui/react-visually-hidden/dist/index.js";
|
|
9
|
+
import { forwardRef as B } from "react";
|
|
10
|
+
const R = B(
|
|
11
|
+
({
|
|
12
|
+
children: l,
|
|
13
|
+
className: i,
|
|
14
|
+
overlayClassName: s,
|
|
15
|
+
isOpen: m = !1,
|
|
16
|
+
onClose: d = _,
|
|
17
|
+
style: n,
|
|
18
|
+
contentLabel: c,
|
|
19
|
+
closeIcon: f = /* @__PURE__ */ o(M, { icon: "CloseX", height: 32, width: 32, color: "currentColor" }),
|
|
20
|
+
closeIconPosition: p = "right",
|
|
21
|
+
...e
|
|
22
|
+
}, h) => {
|
|
23
|
+
const { className: a, "data-testid": u, ...C } = N(e, "Modal");
|
|
13
24
|
return /* @__PURE__ */ o(
|
|
14
|
-
|
|
25
|
+
b,
|
|
15
26
|
{
|
|
16
27
|
open: m,
|
|
17
|
-
onOpenChange: (
|
|
18
|
-
|
|
28
|
+
onOpenChange: (y) => {
|
|
29
|
+
y || d();
|
|
19
30
|
},
|
|
20
|
-
children: /* @__PURE__ */
|
|
31
|
+
children: /* @__PURE__ */ r(x, { children: [
|
|
21
32
|
/* @__PURE__ */ o(
|
|
22
|
-
|
|
33
|
+
I,
|
|
23
34
|
{
|
|
24
|
-
className:
|
|
35
|
+
className: t(`${a}__overlay`, s),
|
|
25
36
|
"data-testid": "modal-overlay"
|
|
26
37
|
}
|
|
27
38
|
),
|
|
28
|
-
/* @__PURE__ */
|
|
29
|
-
|
|
39
|
+
/* @__PURE__ */ r(
|
|
40
|
+
O,
|
|
30
41
|
{
|
|
31
|
-
ref:
|
|
32
|
-
className:
|
|
33
|
-
"data-testid":
|
|
42
|
+
ref: h,
|
|
43
|
+
className: t(a, i),
|
|
44
|
+
"data-testid": u,
|
|
34
45
|
"aria-modal": "true",
|
|
35
46
|
style: n,
|
|
36
|
-
...
|
|
37
|
-
...
|
|
47
|
+
...C,
|
|
48
|
+
...e,
|
|
38
49
|
children: [
|
|
39
|
-
/* @__PURE__ */ o(
|
|
40
|
-
/* @__PURE__ */ o(
|
|
41
|
-
/* @__PURE__ */ o(
|
|
42
|
-
|
|
50
|
+
/* @__PURE__ */ o(w, { asChild: !0, children: /* @__PURE__ */ o(P, { children: c ?? "Modal" }) }),
|
|
51
|
+
/* @__PURE__ */ o($, {}),
|
|
52
|
+
/* @__PURE__ */ o(j, { asChild: !0, children: /* @__PURE__ */ o(
|
|
53
|
+
g,
|
|
43
54
|
{
|
|
44
55
|
id: "modal-close-button",
|
|
45
56
|
"aria-label": "Close Modal",
|
|
46
|
-
className:
|
|
57
|
+
className: t(`${a}__close`, {
|
|
58
|
+
[`${a}__close--left`]: p === "left"
|
|
59
|
+
}),
|
|
47
60
|
variant: v.tertiary,
|
|
48
|
-
children:
|
|
61
|
+
children: f
|
|
49
62
|
}
|
|
50
63
|
) }),
|
|
51
64
|
l
|
|
@@ -57,7 +70,7 @@ const B = w(
|
|
|
57
70
|
);
|
|
58
71
|
}
|
|
59
72
|
);
|
|
60
|
-
|
|
73
|
+
R.displayName = "Modal";
|
|
61
74
|
export {
|
|
62
|
-
|
|
75
|
+
R as default
|
|
63
76
|
};
|