@lattice-ui/dialog 0.1.1 → 0.3.1
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/LICENSE +7 -0
- package/out/Dialog/DialogContent.luau +1 -0
- package/out/index.d.ts +15 -6
- package/out/init.luau +23 -8
- package/package.json +10 -6
- package/src/Dialog/DialogClose.tsx +0 -35
- package/src/Dialog/DialogContent.tsx +0 -84
- package/src/Dialog/DialogOverlay.tsx +0 -48
- package/src/Dialog/DialogPortal.tsx +0 -28
- package/src/Dialog/DialogRoot.tsx +0 -32
- package/src/Dialog/DialogTrigger.tsx +0 -60
- package/src/Dialog/context.ts +0 -6
- package/src/Dialog/types.ts +0 -52
- package/src/index.ts +0 -14
- package/tsconfig.json +0 -16
- package/tsconfig.typecheck.json +0 -25
package/LICENSE
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Copyright 2026 astra-void
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
+
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -15,6 +15,7 @@ local function DialogContentImpl(props)
|
|
|
15
15
|
onInteractOutside = props.onInteractOutside,
|
|
16
16
|
onPointerDownOutside = props.onPointerDownOutside,
|
|
17
17
|
}, React.createElement(FocusScope, {
|
|
18
|
+
active = props.enabled,
|
|
18
19
|
restoreFocus = props.restoreFocus,
|
|
19
20
|
trapped = props.trapFocus,
|
|
20
21
|
}, props.children))
|
package/out/index.d.ts
CHANGED
|
@@ -1,7 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { DialogClose } from "./Dialog/DialogClose";
|
|
2
|
+
import { DialogContent } from "./Dialog/DialogContent";
|
|
3
|
+
import { DialogOverlay } from "./Dialog/DialogOverlay";
|
|
4
|
+
import { DialogPortal } from "./Dialog/DialogPortal";
|
|
5
|
+
import { Dialog as DialogRoot } from "./Dialog/DialogRoot";
|
|
6
|
+
import { DialogTrigger } from "./Dialog/DialogTrigger";
|
|
7
|
+
export declare const Dialog: {
|
|
8
|
+
readonly Root: typeof DialogRoot;
|
|
9
|
+
readonly Trigger: typeof DialogTrigger;
|
|
10
|
+
readonly Portal: typeof DialogPortal;
|
|
11
|
+
readonly Content: typeof DialogContent;
|
|
12
|
+
readonly Overlay: typeof DialogOverlay;
|
|
13
|
+
readonly Close: typeof DialogClose;
|
|
14
|
+
};
|
|
15
|
+
export { DialogClose, DialogContent, DialogOverlay, DialogPortal, DialogRoot, DialogTrigger };
|
|
7
16
|
export type { DialogCloseProps, DialogContentProps, DialogOverlayProps, DialogPortalProps, DialogProps, DialogTriggerProps, } from "./Dialog/types";
|
package/out/init.luau
CHANGED
|
@@ -1,10 +1,25 @@
|
|
|
1
1
|
-- Compiled with roblox-ts v3.0.0
|
|
2
2
|
local TS = _G[script]
|
|
3
|
-
local
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
local DialogClose = TS.import(script, script, "Dialog", "DialogClose").DialogClose
|
|
4
|
+
local DialogContent = TS.import(script, script, "Dialog", "DialogContent").DialogContent
|
|
5
|
+
local DialogOverlay = TS.import(script, script, "Dialog", "DialogOverlay").DialogOverlay
|
|
6
|
+
local DialogPortal = TS.import(script, script, "Dialog", "DialogPortal").DialogPortal
|
|
7
|
+
local DialogRoot = TS.import(script, script, "Dialog", "DialogRoot").Dialog
|
|
8
|
+
local DialogTrigger = TS.import(script, script, "Dialog", "DialogTrigger").DialogTrigger
|
|
9
|
+
local Dialog = {
|
|
10
|
+
Root = DialogRoot,
|
|
11
|
+
Trigger = DialogTrigger,
|
|
12
|
+
Portal = DialogPortal,
|
|
13
|
+
Content = DialogContent,
|
|
14
|
+
Overlay = DialogOverlay,
|
|
15
|
+
Close = DialogClose,
|
|
16
|
+
}
|
|
17
|
+
return {
|
|
18
|
+
Dialog = Dialog,
|
|
19
|
+
DialogClose = DialogClose,
|
|
20
|
+
DialogContent = DialogContent,
|
|
21
|
+
DialogOverlay = DialogOverlay,
|
|
22
|
+
DialogPortal = DialogPortal,
|
|
23
|
+
DialogRoot = DialogRoot,
|
|
24
|
+
DialogTrigger = DialogTrigger,
|
|
25
|
+
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lattice-ui/dialog",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "out/init.luau",
|
|
6
6
|
"types": "out/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"out",
|
|
9
|
+
"README.md"
|
|
10
|
+
],
|
|
7
11
|
"dependencies": {
|
|
8
|
-
"@lattice-ui/core": "0.
|
|
9
|
-
"@lattice-ui/
|
|
10
|
-
"@lattice-ui/
|
|
12
|
+
"@lattice-ui/core": "0.3.1",
|
|
13
|
+
"@lattice-ui/layer": "0.3.1",
|
|
14
|
+
"@lattice-ui/focus": "0.3.1"
|
|
11
15
|
},
|
|
12
16
|
"devDependencies": {
|
|
13
17
|
"@rbxts/react": "17.3.7-ts.1",
|
|
@@ -19,7 +23,7 @@
|
|
|
19
23
|
},
|
|
20
24
|
"scripts": {
|
|
21
25
|
"build": "rbxtsc -p tsconfig.json",
|
|
22
|
-
"
|
|
23
|
-
"
|
|
26
|
+
"typecheck": "tsc -p tsconfig.typecheck.json",
|
|
27
|
+
"watch": "rbxtsc -p tsconfig.json -w"
|
|
24
28
|
}
|
|
25
29
|
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { React, Slot } from "@lattice-ui/core";
|
|
2
|
-
import { useDialogContext } from "./context";
|
|
3
|
-
import type { DialogCloseProps } from "./types";
|
|
4
|
-
|
|
5
|
-
export function DialogClose(props: DialogCloseProps) {
|
|
6
|
-
const dialogContext = useDialogContext();
|
|
7
|
-
|
|
8
|
-
const handleActivated = React.useCallback(() => {
|
|
9
|
-
dialogContext.setOpen(false);
|
|
10
|
-
}, [dialogContext.setOpen]);
|
|
11
|
-
|
|
12
|
-
if (props.asChild) {
|
|
13
|
-
const child = props.children;
|
|
14
|
-
if (!child) {
|
|
15
|
-
error("[DialogClose] `asChild` requires a child element.");
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
return <Slot Event={{ Activated: handleActivated }}>{child}</Slot>;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
return (
|
|
22
|
-
<textbutton
|
|
23
|
-
AutoButtonColor={false}
|
|
24
|
-
BackgroundTransparency={1}
|
|
25
|
-
BorderSizePixel={0}
|
|
26
|
-
Event={{ Activated: handleActivated }}
|
|
27
|
-
Size={UDim2.fromOffset(110, 34)}
|
|
28
|
-
Text="Close"
|
|
29
|
-
TextColor3={Color3.fromRGB(240, 244, 250)}
|
|
30
|
-
TextSize={16}
|
|
31
|
-
>
|
|
32
|
-
{props.children}
|
|
33
|
-
</textbutton>
|
|
34
|
-
);
|
|
35
|
-
}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { React } from "@lattice-ui/core";
|
|
2
|
-
import { FocusScope } from "@lattice-ui/focus";
|
|
3
|
-
import { DismissableLayer, Presence } from "@lattice-ui/layer";
|
|
4
|
-
import { useDialogContext } from "./context";
|
|
5
|
-
import type { DialogContentProps } from "./types";
|
|
6
|
-
|
|
7
|
-
type DialogContentImplProps = {
|
|
8
|
-
enabled: boolean;
|
|
9
|
-
modal: boolean;
|
|
10
|
-
trapFocus: boolean;
|
|
11
|
-
restoreFocus: boolean;
|
|
12
|
-
onDismiss: () => void;
|
|
13
|
-
} & Pick<DialogContentProps, "children" | "onEscapeKeyDown" | "onInteractOutside" | "onPointerDownOutside">;
|
|
14
|
-
|
|
15
|
-
function DialogContentImpl(props: DialogContentImplProps) {
|
|
16
|
-
return (
|
|
17
|
-
<DismissableLayer
|
|
18
|
-
enabled={props.enabled}
|
|
19
|
-
modal={props.modal}
|
|
20
|
-
onDismiss={props.onDismiss}
|
|
21
|
-
onEscapeKeyDown={props.onEscapeKeyDown}
|
|
22
|
-
onInteractOutside={props.onInteractOutside}
|
|
23
|
-
onPointerDownOutside={props.onPointerDownOutside}
|
|
24
|
-
>
|
|
25
|
-
<FocusScope restoreFocus={props.restoreFocus} trapped={props.trapFocus}>
|
|
26
|
-
{props.children}
|
|
27
|
-
</FocusScope>
|
|
28
|
-
</DismissableLayer>
|
|
29
|
-
);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export function DialogContent(props: DialogContentProps) {
|
|
33
|
-
const dialogContext = useDialogContext();
|
|
34
|
-
const open = dialogContext.open;
|
|
35
|
-
const forceMount = props.forceMount === true;
|
|
36
|
-
const trapFocus = props.trapFocus ?? true;
|
|
37
|
-
const restoreFocus = props.restoreFocus ?? true;
|
|
38
|
-
|
|
39
|
-
const handleDismiss = React.useCallback(() => {
|
|
40
|
-
dialogContext.setOpen(false);
|
|
41
|
-
}, [dialogContext.setOpen]);
|
|
42
|
-
|
|
43
|
-
if (!open && !forceMount) {
|
|
44
|
-
return undefined;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
if (forceMount) {
|
|
48
|
-
return (
|
|
49
|
-
<DialogContentImpl
|
|
50
|
-
enabled={open}
|
|
51
|
-
modal={dialogContext.modal}
|
|
52
|
-
onDismiss={handleDismiss}
|
|
53
|
-
onEscapeKeyDown={props.onEscapeKeyDown}
|
|
54
|
-
onInteractOutside={props.onInteractOutside}
|
|
55
|
-
onPointerDownOutside={props.onPointerDownOutside}
|
|
56
|
-
restoreFocus={restoreFocus}
|
|
57
|
-
trapFocus={trapFocus}
|
|
58
|
-
>
|
|
59
|
-
{props.children}
|
|
60
|
-
</DialogContentImpl>
|
|
61
|
-
);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
return (
|
|
65
|
-
<Presence
|
|
66
|
-
exitFallbackMs={0}
|
|
67
|
-
present={open}
|
|
68
|
-
render={(state) => (
|
|
69
|
-
<DialogContentImpl
|
|
70
|
-
enabled={state.isPresent}
|
|
71
|
-
modal={dialogContext.modal}
|
|
72
|
-
onDismiss={handleDismiss}
|
|
73
|
-
onEscapeKeyDown={props.onEscapeKeyDown}
|
|
74
|
-
onInteractOutside={props.onInteractOutside}
|
|
75
|
-
onPointerDownOutside={props.onPointerDownOutside}
|
|
76
|
-
restoreFocus={restoreFocus}
|
|
77
|
-
trapFocus={trapFocus}
|
|
78
|
-
>
|
|
79
|
-
{props.children}
|
|
80
|
-
</DialogContentImpl>
|
|
81
|
-
)}
|
|
82
|
-
/>
|
|
83
|
-
);
|
|
84
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { React, Slot } from "@lattice-ui/core";
|
|
2
|
-
import { useDialogContext } from "./context";
|
|
3
|
-
import type { DialogOverlayProps } from "./types";
|
|
4
|
-
|
|
5
|
-
export function DialogOverlay(props: DialogOverlayProps) {
|
|
6
|
-
const dialogContext = useDialogContext();
|
|
7
|
-
const open = dialogContext.open;
|
|
8
|
-
const shouldRender = open || props.forceMount === true;
|
|
9
|
-
|
|
10
|
-
const handleActivated = React.useCallback(() => {
|
|
11
|
-
dialogContext.setOpen(false);
|
|
12
|
-
}, [dialogContext.setOpen]);
|
|
13
|
-
|
|
14
|
-
if (!shouldRender) {
|
|
15
|
-
return undefined;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
if (props.asChild) {
|
|
19
|
-
const child = props.children;
|
|
20
|
-
if (!child) {
|
|
21
|
-
error("[DialogOverlay] `asChild` requires a child element.");
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
return (
|
|
25
|
-
<Slot Active={open} Event={{ Activated: handleActivated }} Visible={open}>
|
|
26
|
-
{child}
|
|
27
|
-
</Slot>
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return (
|
|
32
|
-
<textbutton
|
|
33
|
-
Active={open}
|
|
34
|
-
AutoButtonColor={false}
|
|
35
|
-
BackgroundColor3={Color3.fromRGB(8, 10, 14)}
|
|
36
|
-
BackgroundTransparency={open ? 0.35 : 1}
|
|
37
|
-
BorderSizePixel={0}
|
|
38
|
-
Event={{ Activated: handleActivated }}
|
|
39
|
-
Position={UDim2.fromScale(0, 0)}
|
|
40
|
-
Selectable={false}
|
|
41
|
-
Size={UDim2.fromScale(1, 1)}
|
|
42
|
-
Text=""
|
|
43
|
-
TextTransparency={1}
|
|
44
|
-
Visible={open}
|
|
45
|
-
ZIndex={5}
|
|
46
|
-
/>
|
|
47
|
-
);
|
|
48
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { React } from "@lattice-ui/core";
|
|
2
|
-
import { Portal, PortalProvider, usePortalContext } from "@lattice-ui/layer";
|
|
3
|
-
import type { DialogPortalProps } from "./types";
|
|
4
|
-
|
|
5
|
-
function DialogPortalWithOverrides(props: DialogPortalProps) {
|
|
6
|
-
const portalContext = usePortalContext();
|
|
7
|
-
const container = props.container ?? portalContext.container;
|
|
8
|
-
const displayOrderBase = props.displayOrderBase ?? portalContext.displayOrderBase;
|
|
9
|
-
|
|
10
|
-
return (
|
|
11
|
-
<PortalProvider container={container} displayOrderBase={displayOrderBase}>
|
|
12
|
-
<Portal>{props.children}</Portal>
|
|
13
|
-
</PortalProvider>
|
|
14
|
-
);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export function DialogPortal(props: DialogPortalProps) {
|
|
18
|
-
const hasOverrides = props.container !== undefined || props.displayOrderBase !== undefined;
|
|
19
|
-
if (hasOverrides) {
|
|
20
|
-
return (
|
|
21
|
-
<DialogPortalWithOverrides container={props.container} displayOrderBase={props.displayOrderBase}>
|
|
22
|
-
{props.children}
|
|
23
|
-
</DialogPortalWithOverrides>
|
|
24
|
-
);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
return <Portal>{props.children}</Portal>;
|
|
28
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { React, useControllableState } from "@lattice-ui/core";
|
|
2
|
-
import { DialogContextProvider } from "./context";
|
|
3
|
-
import type { DialogProps } from "./types";
|
|
4
|
-
|
|
5
|
-
export function Dialog(props: DialogProps) {
|
|
6
|
-
const [open, setOpenState] = useControllableState<boolean>({
|
|
7
|
-
value: props.open,
|
|
8
|
-
defaultValue: props.defaultOpen ?? false,
|
|
9
|
-
onChange: props.onOpenChange,
|
|
10
|
-
});
|
|
11
|
-
const modal = props.modal ?? true;
|
|
12
|
-
const triggerRef = React.useRef<GuiObject>();
|
|
13
|
-
|
|
14
|
-
const setOpen = React.useCallback(
|
|
15
|
-
(nextOpen: boolean) => {
|
|
16
|
-
setOpenState(nextOpen);
|
|
17
|
-
},
|
|
18
|
-
[setOpenState],
|
|
19
|
-
);
|
|
20
|
-
|
|
21
|
-
const contextValue = React.useMemo(
|
|
22
|
-
() => ({
|
|
23
|
-
open,
|
|
24
|
-
setOpen,
|
|
25
|
-
modal,
|
|
26
|
-
triggerRef,
|
|
27
|
-
}),
|
|
28
|
-
[modal, open, setOpen],
|
|
29
|
-
);
|
|
30
|
-
|
|
31
|
-
return <DialogContextProvider value={contextValue}>{props.children}</DialogContextProvider>;
|
|
32
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { React, Slot } from "@lattice-ui/core";
|
|
2
|
-
import { useDialogContext } from "./context";
|
|
3
|
-
import type { DialogTriggerProps } from "./types";
|
|
4
|
-
|
|
5
|
-
function toGuiObject(instance: Instance | undefined) {
|
|
6
|
-
if (!instance || !instance.IsA("GuiObject")) {
|
|
7
|
-
return undefined;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
return instance;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export function DialogTrigger(props: DialogTriggerProps) {
|
|
14
|
-
const dialogContext = useDialogContext();
|
|
15
|
-
|
|
16
|
-
const setTriggerRef = React.useCallback(
|
|
17
|
-
(instance: Instance | undefined) => {
|
|
18
|
-
dialogContext.triggerRef.current = toGuiObject(instance);
|
|
19
|
-
},
|
|
20
|
-
[dialogContext.triggerRef],
|
|
21
|
-
);
|
|
22
|
-
|
|
23
|
-
const handleActivated = React.useCallback(() => {
|
|
24
|
-
if (props.disabled) {
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
dialogContext.setOpen(true);
|
|
29
|
-
}, [dialogContext.setOpen, props.disabled]);
|
|
30
|
-
|
|
31
|
-
if (props.asChild) {
|
|
32
|
-
const child = props.children;
|
|
33
|
-
if (!child) {
|
|
34
|
-
error("[DialogTrigger] `asChild` requires a child element.");
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
return (
|
|
38
|
-
<Slot Event={{ Activated: handleActivated }} ref={setTriggerRef}>
|
|
39
|
-
{child}
|
|
40
|
-
</Slot>
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
return (
|
|
45
|
-
<textbutton
|
|
46
|
-
Active={props.disabled !== true}
|
|
47
|
-
AutoButtonColor={false}
|
|
48
|
-
BackgroundTransparency={1}
|
|
49
|
-
BorderSizePixel={0}
|
|
50
|
-
Event={{ Activated: handleActivated }}
|
|
51
|
-
Size={UDim2.fromOffset(140, 38)}
|
|
52
|
-
Text="Open Dialog"
|
|
53
|
-
TextColor3={Color3.fromRGB(240, 244, 250)}
|
|
54
|
-
TextSize={16}
|
|
55
|
-
ref={setTriggerRef}
|
|
56
|
-
>
|
|
57
|
-
{props.children}
|
|
58
|
-
</textbutton>
|
|
59
|
-
);
|
|
60
|
-
}
|
package/src/Dialog/context.ts
DELETED
package/src/Dialog/types.ts
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import type { LayerInteractEvent } from "@lattice-ui/layer";
|
|
2
|
-
import type React from "@rbxts/react";
|
|
3
|
-
|
|
4
|
-
export type DialogSetOpen = (open: boolean) => void;
|
|
5
|
-
|
|
6
|
-
export type DialogContextValue = {
|
|
7
|
-
open: boolean;
|
|
8
|
-
setOpen: DialogSetOpen;
|
|
9
|
-
modal: boolean;
|
|
10
|
-
triggerRef: React.MutableRefObject<GuiObject | undefined>;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export type DialogProps = {
|
|
14
|
-
open?: boolean;
|
|
15
|
-
defaultOpen?: boolean;
|
|
16
|
-
onOpenChange?: (open: boolean) => void;
|
|
17
|
-
modal?: boolean;
|
|
18
|
-
children?: React.ReactNode;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export type DialogTriggerProps = {
|
|
22
|
-
asChild?: boolean;
|
|
23
|
-
disabled?: boolean;
|
|
24
|
-
children?: React.ReactElement;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export type DialogPortalProps = {
|
|
28
|
-
container?: BasePlayerGui;
|
|
29
|
-
displayOrderBase?: number;
|
|
30
|
-
children?: React.ReactNode;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export type DialogOverlayProps = {
|
|
34
|
-
asChild?: boolean;
|
|
35
|
-
forceMount?: boolean;
|
|
36
|
-
children?: React.ReactElement;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export type DialogContentProps = {
|
|
40
|
-
forceMount?: boolean;
|
|
41
|
-
trapFocus?: boolean;
|
|
42
|
-
restoreFocus?: boolean;
|
|
43
|
-
onEscapeKeyDown?: (event: LayerInteractEvent) => void;
|
|
44
|
-
onPointerDownOutside?: (event: LayerInteractEvent) => void;
|
|
45
|
-
onInteractOutside?: (event: LayerInteractEvent) => void;
|
|
46
|
-
children?: React.ReactNode;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
export type DialogCloseProps = {
|
|
50
|
-
asChild?: boolean;
|
|
51
|
-
children?: React.ReactElement;
|
|
52
|
-
};
|
package/src/index.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export { DialogClose } from "./Dialog/DialogClose";
|
|
2
|
-
export { DialogContent } from "./Dialog/DialogContent";
|
|
3
|
-
export { DialogOverlay } from "./Dialog/DialogOverlay";
|
|
4
|
-
export { DialogPortal } from "./Dialog/DialogPortal";
|
|
5
|
-
export { Dialog } from "./Dialog/DialogRoot";
|
|
6
|
-
export { DialogTrigger } from "./Dialog/DialogTrigger";
|
|
7
|
-
export type {
|
|
8
|
-
DialogCloseProps,
|
|
9
|
-
DialogContentProps,
|
|
10
|
-
DialogOverlayProps,
|
|
11
|
-
DialogPortalProps,
|
|
12
|
-
DialogProps,
|
|
13
|
-
DialogTriggerProps,
|
|
14
|
-
} from "./Dialog/types";
|
package/tsconfig.json
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../tsconfig.base.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"rootDir": "src",
|
|
5
|
-
"outDir": "out",
|
|
6
|
-
"declaration": true,
|
|
7
|
-
"typeRoots": [
|
|
8
|
-
"./node_modules/@rbxts",
|
|
9
|
-
"../../node_modules/@rbxts",
|
|
10
|
-
"./node_modules/@lattice-ui",
|
|
11
|
-
"../../node_modules/@lattice-ui"
|
|
12
|
-
],
|
|
13
|
-
"types": ["types", "compiler-types"]
|
|
14
|
-
},
|
|
15
|
-
"include": ["src"]
|
|
16
|
-
}
|
package/tsconfig.typecheck.json
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "./tsconfig.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"noEmit": true,
|
|
5
|
-
"baseUrl": "..",
|
|
6
|
-
"rootDir": "..",
|
|
7
|
-
"paths": {
|
|
8
|
-
"@lattice-ui/checkbox": ["checkbox/src/index.ts"],
|
|
9
|
-
"@lattice-ui/core": ["core/src/index.ts"],
|
|
10
|
-
"@lattice-ui/dialog": ["dialog/src/index.ts"],
|
|
11
|
-
"@lattice-ui/focus": ["focus/src/index.ts"],
|
|
12
|
-
"@lattice-ui/layer": ["layer/src/index.ts"],
|
|
13
|
-
"@lattice-ui/menu": ["menu/src/index.ts"],
|
|
14
|
-
"@lattice-ui/popover": ["popover/src/index.ts"],
|
|
15
|
-
"@lattice-ui/popper": ["popper/src/index.ts"],
|
|
16
|
-
"@lattice-ui/radio-group": ["radio-group/src/index.ts"],
|
|
17
|
-
"@lattice-ui/style": ["style/src/index.ts"],
|
|
18
|
-
"@lattice-ui/switch": ["switch/src/index.ts"],
|
|
19
|
-
"@lattice-ui/system": ["system/src/index.ts"],
|
|
20
|
-
"@lattice-ui/tabs": ["tabs/src/index.ts"],
|
|
21
|
-
"@lattice-ui/toggle-group": ["toggle-group/src/index.ts"],
|
|
22
|
-
"@lattice-ui/tooltip": ["tooltip/src/index.ts"]
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|