@lets-events/react 12.2.11 → 12.2.13
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/.turbo/turbo-build.log +8 -8
- package/CHANGELOG.md +12 -0
- package/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +38 -9
- package/dist/index.mjs +38 -9
- package/package.json +1 -1
- package/src/components/Modal.tsx +29 -9
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @lets-events/react@12.2.
|
|
2
|
+
> @lets-events/react@12.2.13 build
|
|
3
3
|
> tsup src/index.tsx --format esm,cjs --dts --external react
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.tsx
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
[34mCLI[39m Target: es6
|
|
10
10
|
[34mESM[39m Build start
|
|
11
11
|
[34mCJS[39m Build start
|
|
12
|
-
[32mESM[39m [1mdist\index.mjs [22m[32m380.
|
|
13
|
-
[32mESM[39m ⚡️ Build success in
|
|
14
|
-
[32mCJS[39m [1mdist\index.js [22m[32m394.
|
|
15
|
-
[32mCJS[39m ⚡️ Build success in
|
|
12
|
+
[32mESM[39m [1mdist\index.mjs [22m[32m380.64 KB[39m
|
|
13
|
+
[32mESM[39m ⚡️ Build success in 231ms
|
|
14
|
+
[32mCJS[39m [1mdist\index.js [22m[32m394.61 KB[39m
|
|
15
|
+
[32mCJS[39m ⚡️ Build success in 232ms
|
|
16
16
|
[34mDTS[39m Build start
|
|
17
|
-
[32mDTS[39m ⚡️ Build success in
|
|
18
|
-
[32mDTS[39m [1mdist\index.d.mts [22m[32m398.
|
|
19
|
-
[32mDTS[39m [1mdist\index.d.ts [22m[32m398.
|
|
17
|
+
[32mDTS[39m ⚡️ Build success in 4562ms
|
|
18
|
+
[32mDTS[39m [1mdist\index.d.mts [22m[32m398.61 KB[39m
|
|
19
|
+
[32mDTS[39m [1mdist\index.d.ts [22m[32m398.61 KB[39m
|
package/CHANGELOG.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -4280,8 +4280,10 @@ type ModalProps = ComponentProps<typeof Dialog.Root> & {
|
|
|
4280
4280
|
trigger?: React.ReactNode;
|
|
4281
4281
|
title?: string;
|
|
4282
4282
|
children: React.ReactNode;
|
|
4283
|
+
zIndex?: number;
|
|
4284
|
+
maxWidth?: number;
|
|
4283
4285
|
};
|
|
4284
|
-
declare function Modal({ children, title, trigger, ...props }: ModalProps): react_jsx_runtime.JSX.Element;
|
|
4286
|
+
declare function Modal({ children, title, trigger, zIndex, maxWidth, ...props }: ModalProps): react_jsx_runtime.JSX.Element;
|
|
4285
4287
|
|
|
4286
4288
|
type MenuDropdownProps = HTMLAttributes<HTMLDivElement> & {
|
|
4287
4289
|
children: ReactNode;
|
package/dist/index.d.ts
CHANGED
|
@@ -4280,8 +4280,10 @@ type ModalProps = ComponentProps<typeof Dialog.Root> & {
|
|
|
4280
4280
|
trigger?: React.ReactNode;
|
|
4281
4281
|
title?: string;
|
|
4282
4282
|
children: React.ReactNode;
|
|
4283
|
+
zIndex?: number;
|
|
4284
|
+
maxWidth?: number;
|
|
4283
4285
|
};
|
|
4284
|
-
declare function Modal({ children, title, trigger, ...props }: ModalProps): react_jsx_runtime.JSX.Element;
|
|
4286
|
+
declare function Modal({ children, title, trigger, zIndex, maxWidth, ...props }: ModalProps): react_jsx_runtime.JSX.Element;
|
|
4285
4287
|
|
|
4286
4288
|
type MenuDropdownProps = HTMLAttributes<HTMLDivElement> & {
|
|
4287
4289
|
children: ReactNode;
|
package/dist/index.js
CHANGED
|
@@ -3691,7 +3691,7 @@ var ModalContentStyled = styled(import_radix_ui.Dialog.Content, {
|
|
|
3691
3691
|
lineHeight: "$base",
|
|
3692
3692
|
fontSize: "$13",
|
|
3693
3693
|
maxWidth: "502px",
|
|
3694
|
-
width: "100%",
|
|
3694
|
+
width: "calc(100% - 2rem)",
|
|
3695
3695
|
border: "1px solid $neutral",
|
|
3696
3696
|
borderRadius: "$2xl",
|
|
3697
3697
|
boxShadow: "0px 4px 4px 0px rgba(35, 53, 67, 0.08), 0px 2px 4px 0px rgba(35, 53, 67, 0.16)",
|
|
@@ -3732,16 +3732,45 @@ var ModalTitleStyled = styled(import_radix_ui.Dialog.Title, {
|
|
|
3732
3732
|
textTransform: "uppercase"
|
|
3733
3733
|
});
|
|
3734
3734
|
function Modal(_a) {
|
|
3735
|
-
var _b = _a, {
|
|
3735
|
+
var _b = _a, {
|
|
3736
|
+
children,
|
|
3737
|
+
title,
|
|
3738
|
+
trigger,
|
|
3739
|
+
zIndex,
|
|
3740
|
+
maxWidth
|
|
3741
|
+
} = _b, props = __objRest(_b, [
|
|
3742
|
+
"children",
|
|
3743
|
+
"title",
|
|
3744
|
+
"trigger",
|
|
3745
|
+
"zIndex",
|
|
3746
|
+
"maxWidth"
|
|
3747
|
+
]);
|
|
3748
|
+
const { onOpenChange } = props;
|
|
3736
3749
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_radix_ui.Dialog.Root, __spreadProps(__spreadValues({}, props), { children: [
|
|
3737
3750
|
trigger && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_radix_ui.Dialog.Trigger, { asChild: true, children: trigger }),
|
|
3738
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_radix_ui.Dialog.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3751
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_radix_ui.Dialog.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
3752
|
+
ModalOverlay,
|
|
3753
|
+
{
|
|
3754
|
+
css: {
|
|
3755
|
+
zIndex
|
|
3756
|
+
},
|
|
3757
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
3758
|
+
ModalContentStyled,
|
|
3759
|
+
{
|
|
3760
|
+
css: {
|
|
3761
|
+
maxWidth
|
|
3762
|
+
},
|
|
3763
|
+
children: [
|
|
3764
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(ModalHeaderStyled, { children: [
|
|
3765
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ModalTitleStyled, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Text, { typography: "headline6", fontWeight: "medium", children: title }) }),
|
|
3766
|
+
(onOpenChange || trigger) && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_radix_ui.Dialog.Close, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ModalIconClose, { name: "close", size: "xl" }) })
|
|
3767
|
+
] }),
|
|
3768
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Box, { children })
|
|
3769
|
+
]
|
|
3770
|
+
}
|
|
3771
|
+
)
|
|
3772
|
+
}
|
|
3773
|
+
) })
|
|
3745
3774
|
] }));
|
|
3746
3775
|
}
|
|
3747
3776
|
|
package/dist/index.mjs
CHANGED
|
@@ -3579,7 +3579,7 @@ var ModalContentStyled = styled(ModalRadix.Content, {
|
|
|
3579
3579
|
lineHeight: "$base",
|
|
3580
3580
|
fontSize: "$13",
|
|
3581
3581
|
maxWidth: "502px",
|
|
3582
|
-
width: "100%",
|
|
3582
|
+
width: "calc(100% - 2rem)",
|
|
3583
3583
|
border: "1px solid $neutral",
|
|
3584
3584
|
borderRadius: "$2xl",
|
|
3585
3585
|
boxShadow: "0px 4px 4px 0px rgba(35, 53, 67, 0.08), 0px 2px 4px 0px rgba(35, 53, 67, 0.16)",
|
|
@@ -3620,16 +3620,45 @@ var ModalTitleStyled = styled(ModalRadix.Title, {
|
|
|
3620
3620
|
textTransform: "uppercase"
|
|
3621
3621
|
});
|
|
3622
3622
|
function Modal(_a) {
|
|
3623
|
-
var _b = _a, {
|
|
3623
|
+
var _b = _a, {
|
|
3624
|
+
children,
|
|
3625
|
+
title,
|
|
3626
|
+
trigger,
|
|
3627
|
+
zIndex,
|
|
3628
|
+
maxWidth
|
|
3629
|
+
} = _b, props = __objRest(_b, [
|
|
3630
|
+
"children",
|
|
3631
|
+
"title",
|
|
3632
|
+
"trigger",
|
|
3633
|
+
"zIndex",
|
|
3634
|
+
"maxWidth"
|
|
3635
|
+
]);
|
|
3636
|
+
const { onOpenChange } = props;
|
|
3624
3637
|
return /* @__PURE__ */ jsxs4(ModalRadix.Root, __spreadProps(__spreadValues({}, props), { children: [
|
|
3625
3638
|
trigger && /* @__PURE__ */ jsx13(ModalRadix.Trigger, { asChild: true, children: trigger }),
|
|
3626
|
-
/* @__PURE__ */ jsx13(ModalRadix.Portal, { children: /* @__PURE__ */ jsx13(
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3639
|
+
/* @__PURE__ */ jsx13(ModalRadix.Portal, { children: /* @__PURE__ */ jsx13(
|
|
3640
|
+
ModalOverlay,
|
|
3641
|
+
{
|
|
3642
|
+
css: {
|
|
3643
|
+
zIndex
|
|
3644
|
+
},
|
|
3645
|
+
children: /* @__PURE__ */ jsxs4(
|
|
3646
|
+
ModalContentStyled,
|
|
3647
|
+
{
|
|
3648
|
+
css: {
|
|
3649
|
+
maxWidth
|
|
3650
|
+
},
|
|
3651
|
+
children: [
|
|
3652
|
+
title && /* @__PURE__ */ jsxs4(ModalHeaderStyled, { children: [
|
|
3653
|
+
/* @__PURE__ */ jsx13(ModalTitleStyled, { asChild: true, children: /* @__PURE__ */ jsx13(Text, { typography: "headline6", fontWeight: "medium", children: title }) }),
|
|
3654
|
+
(onOpenChange || trigger) && /* @__PURE__ */ jsx13(ModalRadix.Close, { asChild: true, children: /* @__PURE__ */ jsx13(ModalIconClose, { name: "close", size: "xl" }) })
|
|
3655
|
+
] }),
|
|
3656
|
+
/* @__PURE__ */ jsx13(Box, { children })
|
|
3657
|
+
]
|
|
3658
|
+
}
|
|
3659
|
+
)
|
|
3660
|
+
}
|
|
3661
|
+
) })
|
|
3633
3662
|
] }));
|
|
3634
3663
|
}
|
|
3635
3664
|
|
package/package.json
CHANGED
package/src/components/Modal.tsx
CHANGED
|
@@ -10,7 +10,7 @@ const ModalContentStyled = styled(ModalRadix.Content, {
|
|
|
10
10
|
lineHeight: "$base",
|
|
11
11
|
fontSize: "$13",
|
|
12
12
|
maxWidth: "502px",
|
|
13
|
-
width: "100%",
|
|
13
|
+
width: "calc(100% - 2rem)",
|
|
14
14
|
border: "1px solid $neutral",
|
|
15
15
|
borderRadius: "$2xl",
|
|
16
16
|
boxShadow:
|
|
@@ -20,7 +20,7 @@ const ModalContentStyled = styled(ModalRadix.Content, {
|
|
|
20
20
|
left: "50%",
|
|
21
21
|
transform: "translate(-50%, -50%)",
|
|
22
22
|
backgroundColor: "$dark50",
|
|
23
|
-
zIndex:
|
|
23
|
+
zIndex: "10001",
|
|
24
24
|
});
|
|
25
25
|
|
|
26
26
|
const ModalOverlay = styled(ModalRadix.Overlay, {
|
|
@@ -28,7 +28,7 @@ const ModalOverlay = styled(ModalRadix.Overlay, {
|
|
|
28
28
|
inset: 0,
|
|
29
29
|
opacity: 1,
|
|
30
30
|
backgroundColor: "rgba(0, 0, 0, .5)",
|
|
31
|
-
zIndex:
|
|
31
|
+
zIndex: "10000",
|
|
32
32
|
});
|
|
33
33
|
|
|
34
34
|
const ModalHeaderStyled = styled("div", {
|
|
@@ -60,15 +60,33 @@ export type ModalProps = ComponentProps<typeof ModalRadix.Root> & {
|
|
|
60
60
|
trigger?: React.ReactNode;
|
|
61
61
|
title?: string;
|
|
62
62
|
children: React.ReactNode;
|
|
63
|
+
zIndex?: number;
|
|
64
|
+
maxWidth?: number;
|
|
63
65
|
};
|
|
64
66
|
|
|
65
|
-
export function Modal({
|
|
67
|
+
export function Modal({
|
|
68
|
+
children,
|
|
69
|
+
title,
|
|
70
|
+
trigger,
|
|
71
|
+
zIndex,
|
|
72
|
+
maxWidth,
|
|
73
|
+
...props
|
|
74
|
+
}: ModalProps) {
|
|
75
|
+
const { onOpenChange } = props;
|
|
66
76
|
return (
|
|
67
77
|
<ModalRadix.Root {...props}>
|
|
68
78
|
{trigger && <ModalRadix.Trigger asChild>{trigger}</ModalRadix.Trigger>}
|
|
69
79
|
<ModalRadix.Portal>
|
|
70
|
-
<ModalOverlay
|
|
71
|
-
|
|
80
|
+
<ModalOverlay
|
|
81
|
+
css={{
|
|
82
|
+
zIndex,
|
|
83
|
+
}}
|
|
84
|
+
>
|
|
85
|
+
<ModalContentStyled
|
|
86
|
+
css={{
|
|
87
|
+
maxWidth,
|
|
88
|
+
}}
|
|
89
|
+
>
|
|
72
90
|
{title && (
|
|
73
91
|
<ModalHeaderStyled>
|
|
74
92
|
<ModalTitleStyled asChild>
|
|
@@ -76,9 +94,11 @@ export function Modal({ children, title, trigger, ...props }: ModalProps) {
|
|
|
76
94
|
{title}
|
|
77
95
|
</Text>
|
|
78
96
|
</ModalTitleStyled>
|
|
79
|
-
|
|
80
|
-
<
|
|
81
|
-
|
|
97
|
+
{(onOpenChange || trigger) && (
|
|
98
|
+
<ModalRadix.Close asChild>
|
|
99
|
+
<ModalIconClose name="close" size="xl" />
|
|
100
|
+
</ModalRadix.Close>
|
|
101
|
+
)}
|
|
82
102
|
</ModalHeaderStyled>
|
|
83
103
|
)}
|
|
84
104
|
<Box>{children}</Box>
|