@indietabletop/appkit 3.2.0-13 → 3.2.0-15
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,21 +1,24 @@
|
|
|
1
1
|
import { Dialog, type DialogProps } from "@ariakit/react";
|
|
2
|
+
import type { RecipeVariants } from "@vanilla-extract/recipes";
|
|
2
3
|
import type { ReactNode } from "react";
|
|
3
4
|
import { cx } from "../class-names.ts";
|
|
4
5
|
import * as css from "./style.css.ts";
|
|
5
6
|
|
|
7
|
+
type Size = NonNullable<NonNullable<RecipeVariants<typeof css.dialog>>["size"]>;
|
|
8
|
+
|
|
6
9
|
export type ModalDialogProps = Omit<DialogProps, "modal" | "backdrop"> & {
|
|
7
10
|
children: ReactNode;
|
|
8
|
-
|
|
11
|
+
size: Size;
|
|
9
12
|
backdropClassName?: string;
|
|
10
13
|
};
|
|
11
14
|
|
|
12
15
|
export function ModalDialog(props: ModalDialogProps) {
|
|
13
|
-
const {
|
|
16
|
+
const { size, backdropClassName, className, ...dialogProps } = props;
|
|
14
17
|
|
|
15
18
|
return (
|
|
16
19
|
<Dialog
|
|
17
20
|
{...dialogProps}
|
|
18
|
-
{...cx(className, css.dialog({
|
|
21
|
+
{...cx(className, css.dialog({ size }))}
|
|
19
22
|
backdrop={<div {...cx(css.backdrop, backdropClassName)} />}
|
|
20
23
|
modal
|
|
21
24
|
>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { style
|
|
1
|
+
import { style } from "@vanilla-extract/css";
|
|
2
2
|
import { recipe } from "@vanilla-extract/recipes";
|
|
3
3
|
import { MinWidth } from "../media.ts";
|
|
4
4
|
|
|
5
|
-
const scaleTransition
|
|
5
|
+
const scaleTransition = {
|
|
6
6
|
transition: "transform 200ms, opacity 200ms",
|
|
7
7
|
transform: "scale(1.1)",
|
|
8
8
|
|
|
@@ -19,7 +19,7 @@ const scaleTransition: ComplexStyleRule = {
|
|
|
19
19
|
},
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
-
const translateTransition
|
|
22
|
+
const translateTransition = {
|
|
23
23
|
transition: "transform 200ms, opacity 200ms",
|
|
24
24
|
transform: "translateY(5rem)",
|
|
25
25
|
|
|
@@ -48,8 +48,8 @@ export const dialog = recipe({
|
|
|
48
48
|
},
|
|
49
49
|
|
|
50
50
|
variants: {
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
size: {
|
|
52
|
+
large: {
|
|
53
53
|
...translateTransition,
|
|
54
54
|
inlineSize: "100%",
|
|
55
55
|
blockSize: "100%",
|
|
@@ -65,7 +65,7 @@ export const dialog = recipe({
|
|
|
65
65
|
},
|
|
66
66
|
},
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
small: {
|
|
69
69
|
...scaleTransition,
|
|
70
70
|
inlineSize: "min(24rem, 90svw)",
|
|
71
71
|
blockSize: "fit-content",
|
package/lib/globals.css.ts
CHANGED