@jamsrui/alert-dialog 0.0.12 → 0.0.14
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/dist/alert-dialog-body.d.mts +10 -0
- package/dist/alert-dialog-body.mjs +1 -0
- package/dist/alert-dialog-config.d.mts +11 -4
- package/dist/alert-dialog-config.mjs +1 -1
- package/dist/alert-dialog-container.d.mts +10 -0
- package/dist/alert-dialog-container.mjs +1 -0
- package/dist/alert-dialog-content-inner.d.mts +10 -0
- package/dist/alert-dialog-content-inner.mjs +1 -0
- package/dist/alert-dialog-content.d.mts +11 -0
- package/dist/alert-dialog-content.mjs +1 -0
- package/dist/alert-dialog-context.d.mts +23 -0
- package/dist/alert-dialog-context.mjs +1 -0
- package/dist/alert-dialog-description.d.mts +10 -0
- package/dist/alert-dialog-description.mjs +1 -0
- package/dist/alert-dialog-footer.d.mts +10 -0
- package/dist/alert-dialog-footer.mjs +1 -0
- package/dist/alert-dialog-title.d.mts +10 -0
- package/dist/alert-dialog-title.mjs +1 -0
- package/dist/alert-dialog-trigger-close.d.mts +10 -0
- package/dist/alert-dialog-trigger-close.mjs +1 -0
- package/dist/alert-dialog-trigger.d.mts +10 -0
- package/dist/alert-dialog-trigger.mjs +1 -0
- package/dist/alert-dialog.d.mts +11 -3
- package/dist/alert-dialog.mjs +1 -1
- package/dist/index.d.mts +51 -6
- package/dist/index.mjs +1 -1
- package/dist/styles.d.mts +125 -0
- package/dist/styles.mjs +1 -0
- package/dist/use-alert-dialog.d.mts +29 -33
- package/dist/use-alert-dialog.mjs +1 -1
- package/package.json +8 -7
- package/dist/chunk-DAOQOXYD.mjs +0 -1
- package/dist/chunk-G3TQLDJ7.mjs +0 -1
- package/dist/chunk-VTOWZPYV.mjs +0 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { UIProps } from '@jamsrui/utils';
|
|
3
|
+
|
|
4
|
+
declare const AlertDialogBody: (props: AlertDialogBody.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
|
|
5
|
+
declare namespace AlertDialogBody {
|
|
6
|
+
interface Props extends UIProps<"div"> {
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { AlertDialogBody };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{useRenderElement as o}from"@jamsrui/hooks";import{useAlertDialogContext as t}from"./alert-dialog-context.mjs";const i=e=>{const{getBodyProps:r}=t();return o("div",{props:[r(e)]})};export{i as AlertDialogBody};
|
|
@@ -1,12 +1,19 @@
|
|
|
1
|
-
import { AlertDialog } from './alert-dialog.mjs';
|
|
2
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
2
|
import { GlobalConfigProps } from '@jamsrui/core';
|
|
3
|
+
import { AlertDialog } from './alert-dialog.mjs';
|
|
4
4
|
import './use-alert-dialog.mjs';
|
|
5
5
|
import 'react';
|
|
6
|
-
import '
|
|
7
|
-
import '@jamsrui/dialog';
|
|
8
|
-
import '@jamsrui/text';
|
|
6
|
+
import './styles.mjs';
|
|
9
7
|
import '@jamsrui/utils';
|
|
8
|
+
import '@jamsrui/text';
|
|
9
|
+
import '@floating-ui/react';
|
|
10
|
+
import './alert-dialog-body.mjs';
|
|
11
|
+
import './alert-dialog-container.mjs';
|
|
12
|
+
import './alert-dialog-content.mjs';
|
|
13
|
+
import './alert-dialog-content-inner.mjs';
|
|
14
|
+
import 'motion/react';
|
|
15
|
+
import './alert-dialog-footer.mjs';
|
|
16
|
+
import './alert-dialog-title.mjs';
|
|
10
17
|
|
|
11
18
|
declare const useAlertDialogConfig: () => AlertDialogConfig.Props;
|
|
12
19
|
declare const AlertDialogConfig: (props: Omit<Partial<AlertDialogConfig.Props>, "children"> & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
"use client";import{createConfigContext as o}from"@jamsrui/utils";const[r,i]=o({displayName:"AlertDialogConfig"});export{r as AlertDialogConfig,i as useAlertDialogConfig};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { UIProps } from '@jamsrui/utils';
|
|
3
|
+
|
|
4
|
+
declare const AlertDialogContainer: (props: AlertDialogContainer.Props) => react_jsx_runtime.JSX.Element;
|
|
5
|
+
declare namespace AlertDialogContainer {
|
|
6
|
+
interface Props extends UIProps<"div"> {
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { AlertDialogContainer };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as e}from"react/jsx-runtime";import{useRenderElement as l}from"@jamsrui/hooks";import{useAlertDialogContext as s}from"./alert-dialog-context.mjs";import{AnimatePresence as p}from"motion/react";import{FloatingFocusManager as g,FloatingOverlay as m,FloatingPortal as P}from"@floating-ui/react";const A=o=>{const{getContainerProps:r,getOverlayProps:t,getFocusManagerProps:n,isOpen:a}=s(),i=l("div",{props:[r(o)]});return e(p,{children:a?e(P,{children:e(m,{...t(),children:e(g,{...n(),children:i})})}):null})};export{A as AlertDialogContainer};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { HTMLMotionProps } from 'motion/react';
|
|
3
|
+
|
|
4
|
+
declare const AlertDialogContentInner: (props: AlertDialogContentInner.Props) => react_jsx_runtime.JSX.Element;
|
|
5
|
+
declare namespace AlertDialogContentInner {
|
|
6
|
+
interface Props extends HTMLMotionProps<"div"> {
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { AlertDialogContentInner };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as i}from"react/jsx-runtime";import{motion as e}from"motion/react";import{useAlertDialogContext as n}from"./alert-dialog-context.mjs";const l=t=>{const{getContentProps:o}=n();return i(e.div,{initial:{scale:.9,opacity:0,filter:"blur(4px)"},animate:{scale:1,opacity:1,filter:"blur(0px)"},exit:{scale:.95,opacity:0,filter:"blur(4px)",transition:{duration:.25}},transition:{type:"spring",stiffness:300,damping:25},...o(t)})};export{l as AlertDialogContentInner};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { AlertDialogContentInner } from './alert-dialog-content-inner.mjs';
|
|
3
|
+
import 'motion/react';
|
|
4
|
+
|
|
5
|
+
declare const AlertDialogContent: (props: AlertDialogContent.Props) => react_jsx_runtime.JSX.Element;
|
|
6
|
+
declare namespace AlertDialogContent {
|
|
7
|
+
interface Props extends AlertDialogContentInner.Props {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { AlertDialogContent };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as t}from"react/jsx-runtime";import{AlertDialogContainer as o}from"./alert-dialog-container.mjs";import{AlertDialogContentInner as n}from"./alert-dialog-content-inner.mjs";const i=e=>t(o,{children:t(n,{...e})});export{i as AlertDialogContent};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { useAlertDialog } from './use-alert-dialog.mjs';
|
|
3
|
+
import './styles.mjs';
|
|
4
|
+
import '@jamsrui/utils';
|
|
5
|
+
import '@jamsrui/text';
|
|
6
|
+
import '@floating-ui/react';
|
|
7
|
+
import './alert-dialog-body.mjs';
|
|
8
|
+
import './alert-dialog-container.mjs';
|
|
9
|
+
import 'react/jsx-runtime';
|
|
10
|
+
import './alert-dialog-content.mjs';
|
|
11
|
+
import './alert-dialog-content-inner.mjs';
|
|
12
|
+
import 'motion/react';
|
|
13
|
+
import './alert-dialog-footer.mjs';
|
|
14
|
+
import './alert-dialog-title.mjs';
|
|
15
|
+
|
|
16
|
+
declare const AlertDialogContext: react.Context<AlertDialogContext.Props | null>;
|
|
17
|
+
declare namespace AlertDialogContext {
|
|
18
|
+
interface Props extends ReturnType<typeof useAlertDialog> {
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
declare const useAlertDialogContext: () => AlertDialogContext.Props;
|
|
22
|
+
|
|
23
|
+
export { AlertDialogContext, useAlertDialogContext };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{createContext as t,use as o}from"react";const r=t(null),n=()=>{const e=o(r);if(!e)throw new Error("useAlertDialogContext must be used within a AlertDialogContext.Provider");return e};export{r as AlertDialogContext,n as useAlertDialogContext};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { Text } from '@jamsrui/text';
|
|
3
|
+
|
|
4
|
+
declare const AlertDialogDescription: (props: AlertDialogDescription.Props) => react_jsx_runtime.JSX.Element;
|
|
5
|
+
declare namespace AlertDialogDescription {
|
|
6
|
+
interface Props extends Text.Props {
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { AlertDialogDescription };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as i}from"react/jsx-runtime";import{Text as t}from"@jamsrui/text";import{useAlertDialogContext as r}from"./alert-dialog-context.mjs";const n=e=>{const{getDescriptionProps:o}=r();return i(t,{...o(e)})};export{n as AlertDialogDescription};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { UIProps } from '@jamsrui/utils';
|
|
3
|
+
|
|
4
|
+
declare const AlertDialogFooter: (props: AlertDialogFooter.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
|
|
5
|
+
declare namespace AlertDialogFooter {
|
|
6
|
+
interface Props extends UIProps<"div"> {
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { AlertDialogFooter };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{useRenderElement as o}from"@jamsrui/hooks";import{useAlertDialogContext as t}from"./alert-dialog-context.mjs";const i=e=>{const{getFooterProps:r}=t();return o("div",{props:[r(e)]})};export{i as AlertDialogFooter};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { Text } from '@jamsrui/text';
|
|
3
|
+
|
|
4
|
+
declare const AlertDialogTitle: (props: AlertDialogTitle.Props) => react_jsx_runtime.JSX.Element;
|
|
5
|
+
declare namespace AlertDialogTitle {
|
|
6
|
+
interface Props extends Text.Props {
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { AlertDialogTitle };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as l}from"react/jsx-runtime";import{Text as o}from"@jamsrui/text";import{useAlertDialogContext as r}from"./alert-dialog-context.mjs";const s=e=>{const{getTitleProps:t}=r();return l(o,{...t(e)})};export{s as AlertDialogTitle};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
|
|
3
|
+
declare const AlertDialogTriggerClose: (props: AlertDialogTriggerClose.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | null;
|
|
4
|
+
declare namespace AlertDialogTriggerClose {
|
|
5
|
+
interface Props {
|
|
6
|
+
children: React.ReactElement;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { AlertDialogTriggerClose };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{cloneElement as l,isValidElement as t}from"react";import{useAlertDialogContext as i}from"./alert-dialog-context.mjs";const g=r=>{const{children:e}=r,{getTriggerCloseProps:o}=i();return t(e)?l(e,o(e.props??{})):(console.warn("Invalid children passed to AlertDialogTriggerClose"),null)};export{g as AlertDialogTriggerClose};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
|
|
3
|
+
declare const AlertDialogTrigger: (props: AlertDialogTrigger.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | null;
|
|
4
|
+
declare namespace AlertDialogTrigger {
|
|
5
|
+
interface Props {
|
|
6
|
+
children: React.ReactElement;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { AlertDialogTrigger };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{cloneElement as o,isValidElement as l}from"react";import{useAlertDialogContext as i}from"./alert-dialog-context.mjs";const a=r=>{const{children:e}=r,{getTriggerProps:t}=i();return l(e)?o(e,t(e.props??{})):(console.warn("Invalid children passed to AlertDialogTrigger"),null)};export{a as AlertDialogTrigger};
|
package/dist/alert-dialog.d.mts
CHANGED
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { useAlertDialog } from './use-alert-dialog.mjs';
|
|
3
3
|
import 'react';
|
|
4
|
-
import '
|
|
5
|
-
import '@jamsrui/dialog';
|
|
6
|
-
import '@jamsrui/text';
|
|
4
|
+
import './styles.mjs';
|
|
7
5
|
import '@jamsrui/utils';
|
|
6
|
+
import '@jamsrui/text';
|
|
7
|
+
import '@floating-ui/react';
|
|
8
|
+
import './alert-dialog-body.mjs';
|
|
9
|
+
import './alert-dialog-container.mjs';
|
|
10
|
+
import './alert-dialog-content.mjs';
|
|
11
|
+
import './alert-dialog-content-inner.mjs';
|
|
12
|
+
import 'motion/react';
|
|
13
|
+
import './alert-dialog-footer.mjs';
|
|
14
|
+
import './alert-dialog-title.mjs';
|
|
8
15
|
|
|
9
16
|
declare const AlertDialog: (props: AlertDialog.Props) => react_jsx_runtime.JSX.Element;
|
|
10
17
|
declare namespace AlertDialog {
|
|
11
18
|
interface Props extends useAlertDialog.Props {
|
|
19
|
+
children: React.ReactNode;
|
|
12
20
|
}
|
|
13
21
|
}
|
|
14
22
|
|
package/dist/alert-dialog.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
"use client";import{jsx as g}from"react/jsx-runtime";import{mergeConfigProps as l}from"@jamsrui/utils";import{useAlertDialogConfig as i}from"./alert-dialog-config.mjs";import{AlertDialogContext as n}from"./alert-dialog-context.mjs";import{useAlertDialog as a}from"./use-alert-dialog.mjs";const f=e=>{const o=i(),r=l(o,o,e),t=a(r);return g(n,{value:t,children:e.children})};export{f as AlertDialog};
|
package/dist/index.d.mts
CHANGED
|
@@ -1,10 +1,55 @@
|
|
|
1
|
-
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
+
import { AlertDialog as AlertDialog$1 } from './alert-dialog.mjs';
|
|
4
|
+
import { AlertDialogBody } from './alert-dialog-body.mjs';
|
|
5
|
+
import { AlertDialogContainer } from './alert-dialog-container.mjs';
|
|
6
|
+
import { AlertDialogContent } from './alert-dialog-content.mjs';
|
|
7
|
+
import { AlertDialogContentInner } from './alert-dialog-content-inner.mjs';
|
|
8
|
+
import { AlertDialogDescription } from './alert-dialog-description.mjs';
|
|
9
|
+
import { AlertDialogFooter } from './alert-dialog-footer.mjs';
|
|
10
|
+
import { AlertDialogTitle } from './alert-dialog-title.mjs';
|
|
11
|
+
import { AlertDialogTrigger } from './alert-dialog-trigger.mjs';
|
|
12
|
+
import { AlertDialogTriggerClose } from './alert-dialog-trigger-close.mjs';
|
|
2
13
|
export { AlertDialogConfig, useAlertDialogConfig } from './alert-dialog-config.mjs';
|
|
3
|
-
import 'react/jsx-runtime';
|
|
4
14
|
import './use-alert-dialog.mjs';
|
|
5
|
-
import '
|
|
6
|
-
import '@jamsrui/button';
|
|
7
|
-
import '@jamsrui/dialog';
|
|
8
|
-
import '@jamsrui/text';
|
|
15
|
+
import './styles.mjs';
|
|
9
16
|
import '@jamsrui/utils';
|
|
17
|
+
import '@jamsrui/text';
|
|
18
|
+
import '@floating-ui/react';
|
|
19
|
+
import 'motion/react';
|
|
10
20
|
import '@jamsrui/core';
|
|
21
|
+
|
|
22
|
+
declare const AlertDialog: ((props: AlertDialog$1.Props) => react_jsx_runtime.JSX.Element) & {
|
|
23
|
+
Root: (props: AlertDialog$1.Props) => react_jsx_runtime.JSX.Element;
|
|
24
|
+
Trigger: (props: AlertDialogTrigger.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | null;
|
|
25
|
+
Content: (props: AlertDialogContent.Props) => react_jsx_runtime.JSX.Element;
|
|
26
|
+
Body: (props: AlertDialogBody.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
|
|
27
|
+
Footer: (props: AlertDialogFooter.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
|
|
28
|
+
Title: (props: AlertDialogTitle.Props) => react_jsx_runtime.JSX.Element;
|
|
29
|
+
Description: (props: AlertDialogDescription.Props) => react_jsx_runtime.JSX.Element;
|
|
30
|
+
Container: (props: AlertDialogContainer.Props) => react_jsx_runtime.JSX.Element;
|
|
31
|
+
ContentInner: (props: AlertDialogContentInner.Props) => react_jsx_runtime.JSX.Element;
|
|
32
|
+
TriggerClose: (props: AlertDialogTriggerClose.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | null;
|
|
33
|
+
};
|
|
34
|
+
declare namespace AlertDialog {
|
|
35
|
+
interface Props extends AlertDialog$1.Props {
|
|
36
|
+
}
|
|
37
|
+
interface Trigger extends AlertDialogTrigger.Props {
|
|
38
|
+
}
|
|
39
|
+
interface Content extends AlertDialogContent.Props {
|
|
40
|
+
}
|
|
41
|
+
interface Body extends AlertDialogBody.Props {
|
|
42
|
+
}
|
|
43
|
+
interface Footer extends AlertDialogFooter.Props {
|
|
44
|
+
}
|
|
45
|
+
interface Title extends AlertDialogTitle.Props {
|
|
46
|
+
}
|
|
47
|
+
interface Description extends AlertDialogDescription.Props {
|
|
48
|
+
}
|
|
49
|
+
interface Container extends AlertDialogContainer.Props {
|
|
50
|
+
}
|
|
51
|
+
interface ContentInner extends AlertDialogContentInner.Props {
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export { AlertDialog, AlertDialogBody, AlertDialogContainer, AlertDialogContent, AlertDialogContentInner, AlertDialogDescription, AlertDialogFooter, AlertDialogTitle, AlertDialogTrigger, AlertDialogTriggerClose };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"
|
|
1
|
+
import{AlertDialog as e}from"./alert-dialog.mjs";import{AlertDialogBody as o}from"./alert-dialog-body.mjs";import{AlertDialogContainer as r}from"./alert-dialog-container.mjs";import{AlertDialogContent as t}from"./alert-dialog-content.mjs";import{AlertDialogContentInner as i}from"./alert-dialog-content-inner.mjs";import{AlertDialogDescription as n}from"./alert-dialog-description.mjs";import{AlertDialogFooter as l}from"./alert-dialog-footer.mjs";import{AlertDialogTitle as a}from"./alert-dialog-title.mjs";import{AlertDialogTrigger as g}from"./alert-dialog-trigger.mjs";import{AlertDialogTriggerClose as p}from"./alert-dialog-trigger-close.mjs";import{AlertDialogConfig as F,useAlertDialogConfig as I}from"./alert-dialog-config.mjs";const T=Object.assign(e,{Root:e,Trigger:g,Content:t,Body:o,Footer:l,Title:a,Description:n,Container:r,ContentInner:i,TriggerClose:p});export{T as AlertDialog,o as AlertDialogBody,F as AlertDialogConfig,r as AlertDialogContainer,t as AlertDialogContent,i as AlertDialogContentInner,n as AlertDialogDescription,l as AlertDialogFooter,a as AlertDialogTitle,g as AlertDialogTrigger,p as AlertDialogTriggerClose,I as useAlertDialogConfig};
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import * as _jamsrui_utils from '@jamsrui/utils';
|
|
2
|
+
import { VariantProps } from '@jamsrui/utils';
|
|
3
|
+
|
|
4
|
+
declare const alertDialogVariant: _jamsrui_utils.TVReturnType<{
|
|
5
|
+
radius: {
|
|
6
|
+
sm: {};
|
|
7
|
+
md: {};
|
|
8
|
+
lg: {};
|
|
9
|
+
xl: {};
|
|
10
|
+
"2xl": {};
|
|
11
|
+
"3xl": {};
|
|
12
|
+
full: {};
|
|
13
|
+
none: {};
|
|
14
|
+
};
|
|
15
|
+
scrollBehavior: {
|
|
16
|
+
inside: {
|
|
17
|
+
body: string;
|
|
18
|
+
};
|
|
19
|
+
outside: {};
|
|
20
|
+
};
|
|
21
|
+
backdrop: {
|
|
22
|
+
transparent: {
|
|
23
|
+
backdrop: string;
|
|
24
|
+
};
|
|
25
|
+
opaque: {
|
|
26
|
+
backdrop: string;
|
|
27
|
+
};
|
|
28
|
+
blur: {
|
|
29
|
+
backdrop: string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
}, {
|
|
33
|
+
root: string;
|
|
34
|
+
header: string;
|
|
35
|
+
container: string;
|
|
36
|
+
content: string;
|
|
37
|
+
footer: string;
|
|
38
|
+
body: string;
|
|
39
|
+
trigger: string;
|
|
40
|
+
title: string;
|
|
41
|
+
description: string;
|
|
42
|
+
backdrop: string;
|
|
43
|
+
}, undefined, {
|
|
44
|
+
radius: {
|
|
45
|
+
sm: {};
|
|
46
|
+
md: {};
|
|
47
|
+
lg: {};
|
|
48
|
+
xl: {};
|
|
49
|
+
"2xl": {};
|
|
50
|
+
"3xl": {};
|
|
51
|
+
full: {};
|
|
52
|
+
none: {};
|
|
53
|
+
};
|
|
54
|
+
scrollBehavior: {
|
|
55
|
+
inside: {
|
|
56
|
+
body: string;
|
|
57
|
+
};
|
|
58
|
+
outside: {};
|
|
59
|
+
};
|
|
60
|
+
backdrop: {
|
|
61
|
+
transparent: {
|
|
62
|
+
backdrop: string;
|
|
63
|
+
};
|
|
64
|
+
opaque: {
|
|
65
|
+
backdrop: string;
|
|
66
|
+
};
|
|
67
|
+
blur: {
|
|
68
|
+
backdrop: string;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
}, {
|
|
72
|
+
root: string;
|
|
73
|
+
header: string;
|
|
74
|
+
container: string;
|
|
75
|
+
content: string;
|
|
76
|
+
footer: string;
|
|
77
|
+
body: string;
|
|
78
|
+
trigger: string;
|
|
79
|
+
title: string;
|
|
80
|
+
description: string;
|
|
81
|
+
backdrop: string;
|
|
82
|
+
}, _jamsrui_utils.TVReturnType<{
|
|
83
|
+
radius: {
|
|
84
|
+
sm: {};
|
|
85
|
+
md: {};
|
|
86
|
+
lg: {};
|
|
87
|
+
xl: {};
|
|
88
|
+
"2xl": {};
|
|
89
|
+
"3xl": {};
|
|
90
|
+
full: {};
|
|
91
|
+
none: {};
|
|
92
|
+
};
|
|
93
|
+
scrollBehavior: {
|
|
94
|
+
inside: {
|
|
95
|
+
body: string;
|
|
96
|
+
};
|
|
97
|
+
outside: {};
|
|
98
|
+
};
|
|
99
|
+
backdrop: {
|
|
100
|
+
transparent: {
|
|
101
|
+
backdrop: string;
|
|
102
|
+
};
|
|
103
|
+
opaque: {
|
|
104
|
+
backdrop: string;
|
|
105
|
+
};
|
|
106
|
+
blur: {
|
|
107
|
+
backdrop: string;
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
}, {
|
|
111
|
+
root: string;
|
|
112
|
+
header: string;
|
|
113
|
+
container: string;
|
|
114
|
+
content: string;
|
|
115
|
+
footer: string;
|
|
116
|
+
body: string;
|
|
117
|
+
trigger: string;
|
|
118
|
+
title: string;
|
|
119
|
+
description: string;
|
|
120
|
+
backdrop: string;
|
|
121
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
122
|
+
type AlertDialogVariants = VariantProps<typeof alertDialogVariant>;
|
|
123
|
+
type AlertDialogSlots = keyof ReturnType<typeof alertDialogVariant>;
|
|
124
|
+
|
|
125
|
+
export { type AlertDialogSlots, type AlertDialogVariants, alertDialogVariant };
|
package/dist/styles.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{radiusVariant as a,tv as r}from"@jamsrui/utils";const t=r({slots:{root:"alert-dialog alert-dialog__root",header:"alert-dialog__header p-4 text-base font-bold",container:"alert-dialog__container z-dialog max-w-md w-full",content:"alert-dialog__content relative flex size-full flex-col overflow-y-auto bg-surface shadow-lg",footer:"alert-dialog__footer flex w-full items-center justify-end gap-2 p-4",body:"alert-dialog__body w-full p-4",trigger:"alert-dialog__trigger",title:"alert-dialog__title text-foreground",description:"alert-dialog__description text-foreground-secondary",backdrop:"alert-dialog__backdrop z-backdrop grid place-items-center"},variants:{radius:a("content"),scrollBehavior:{inside:{body:"grow overflow-y-auto"},outside:{}},backdrop:{transparent:{backdrop:""},opaque:{backdrop:"bg-black/50"},blur:{backdrop:"bg-black/30 backdrop-blur-md backdrop-saturate-150"}}},defaultVariants:{scrollBehavior:"inside",backdrop:"opaque",radius:"md"}});export{t as alertDialogVariant};
|
|
@@ -1,42 +1,38 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { Dialog, DialogContent, DialogBody, DialogFooter } from '@jamsrui/dialog';
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
import { AlertDialogVariants } from './styles.mjs';
|
|
4
3
|
import { Text } from '@jamsrui/text';
|
|
5
4
|
import { PropGetter } from '@jamsrui/utils';
|
|
5
|
+
import { FloatingOverlay, FloatingFocusManagerProps } from '@floating-ui/react';
|
|
6
|
+
import { AlertDialogBody } from './alert-dialog-body.mjs';
|
|
7
|
+
import { AlertDialogContainer } from './alert-dialog-container.mjs';
|
|
8
|
+
import { AlertDialogContent } from './alert-dialog-content.mjs';
|
|
9
|
+
import { AlertDialogFooter } from './alert-dialog-footer.mjs';
|
|
10
|
+
import { AlertDialogTitle } from './alert-dialog-title.mjs';
|
|
11
|
+
import 'react/jsx-runtime';
|
|
12
|
+
import './alert-dialog-content-inner.mjs';
|
|
13
|
+
import 'motion/react';
|
|
6
14
|
|
|
7
15
|
declare const useAlertDialog: (props: useAlertDialog.Props) => {
|
|
8
|
-
|
|
9
|
-
getContentProps: PropGetter<
|
|
10
|
-
getBodyProps: PropGetter<
|
|
11
|
-
getFooterProps: PropGetter<
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
title: react.ReactNode;
|
|
20
|
-
children: react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
|
|
16
|
+
getContainerProps: PropGetter<AlertDialogContainer.Props>;
|
|
17
|
+
getContentProps: PropGetter<AlertDialogContent.Props>;
|
|
18
|
+
getBodyProps: PropGetter<AlertDialogBody.Props>;
|
|
19
|
+
getFooterProps: PropGetter<AlertDialogFooter.Props>;
|
|
20
|
+
getTitleProps: PropGetter<AlertDialogTitle.Props>;
|
|
21
|
+
getDescriptionProps: PropGetter<Text.Props>;
|
|
22
|
+
getTriggerProps: (props: Partial<ComponentProps<"button">>) => ComponentProps<"button">;
|
|
23
|
+
getOverlayProps: () => ComponentProps<typeof FloatingOverlay>;
|
|
24
|
+
getFocusManagerProps: () => Omit<FloatingFocusManagerProps, "children">;
|
|
25
|
+
getTriggerCloseProps: (props: Partial<ComponentProps<"button">>) => ComponentProps<"button">;
|
|
26
|
+
isOpen: boolean;
|
|
21
27
|
};
|
|
22
28
|
declare namespace useAlertDialog {
|
|
23
|
-
interface Props extends
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
confirmText?: string;
|
|
31
|
-
confirmButtonProps?: Button.Props;
|
|
32
|
-
cancelButtonProps?: Button.Props;
|
|
33
|
-
slotProps?: {
|
|
34
|
-
title?: Text.Props;
|
|
35
|
-
message?: Text.Props;
|
|
36
|
-
content?: DialogContent.Props;
|
|
37
|
-
body?: DialogBody.Props;
|
|
38
|
-
footer?: DialogFooter.Props;
|
|
39
|
-
};
|
|
29
|
+
interface Props extends AlertDialogVariants {
|
|
30
|
+
defaultOpen?: boolean;
|
|
31
|
+
isOpen?: boolean;
|
|
32
|
+
onOpenChange?: (open: boolean) => void;
|
|
33
|
+
isDismissible?: boolean;
|
|
34
|
+
isKeyboardDismissible?: boolean;
|
|
35
|
+
disableAnimation?: boolean;
|
|
40
36
|
}
|
|
41
37
|
}
|
|
42
38
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{useCallback as t,useMemo as R}from"react";import{dataAttrDev as s,mapPropsVariants as j}from"@jamsrui/utils";import{alertDialogVariant as D}from"./styles.mjs";import{useClick as I,useDismiss as S,useFloating as E,useInteractions as _,useRole as q}from"@floating-ui/react";import{useControlledState as w}from"@jamsrui/hooks";const oe=C=>{const[N,y]=j(C,D.variantKeys),{defaultOpen:A,disableAnimation:z=!1,isDismissible:O=!0,isKeyboardDismissible:F=!0,isOpen:v,onOpenChange:h}=N,o=D(y),[r,n]=w({defaultProp:A,onChange:h,prop:v}),{context:a,refs:{setFloating:x,setReference:T}}=E({open:r,onOpenChange:n}),k=I(a,{}),G=S(a,{escapeKey:F,outsidePressEvent:"click",enabled:O}),K=q(a),M=_([k,G,K]),{getReferenceProps:V,getFloatingProps:B}=M,l=t(()=>{n(!1)},[]),i=t(e=>({...e,"data-slot":s("container"),className:o.container({className:e.className}),ref:x,...B()}),[o]),p=t(e=>({...e,"data-slot":s("content"),className:o.content({className:e.className})}),[o]),c=t(e=>({...e,"data-slot":s("body"),className:o.body({className:e.className})}),[o]),m=t(e=>({...e,"data-slot":s("footer"),className:o.footer({className:e.className})}),[o]),g=t(e=>({variant:"h6","data-slot":s("title"),className:o.title({className:e.className}),...e}),[o]),P=t(e=>({variant:"paragraph2","data-slot":s("description"),className:o.description({className:e.className}),...e}),[o]),d=t(e=>({...e,className:o.trigger({className:e.className}),...V({ref:T})}),[o]),u=t(e=>({...e,onClick:l}),[l]),f=t(()=>({className:o.backdrop(),lockScroll:!0}),[o]),b=t(()=>({context:a,modal:!0}),[a]);return R(()=>({getContainerProps:i,getContentProps:p,getBodyProps:c,getFooterProps:m,getTitleProps:g,getDescriptionProps:P,getTriggerProps:d,getOverlayProps:f,getFocusManagerProps:b,getTriggerCloseProps:u,isOpen:r}),[i,c,p,m,g,P,d,f,b,u,r])};export{oe as useAlertDialog};
|
package/package.json
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jamsrui/alert-dialog",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.14",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"react": ">=19"
|
|
6
6
|
},
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@
|
|
9
|
-
"
|
|
10
|
-
"@jamsrui/
|
|
11
|
-
"@jamsrui/
|
|
12
|
-
"@jamsrui/text": "^0.0.
|
|
13
|
-
"@jamsrui/
|
|
8
|
+
"@floating-ui/react": ">=0.27",
|
|
9
|
+
"motion": ">=12",
|
|
10
|
+
"@jamsrui/button": "^0.0.14",
|
|
11
|
+
"@jamsrui/hooks": "^0.0.14",
|
|
12
|
+
"@jamsrui/text": "^0.0.14",
|
|
13
|
+
"@jamsrui/core": "^0.0.12",
|
|
14
|
+
"@jamsrui/utils": "^0.0.14"
|
|
14
15
|
},
|
|
15
16
|
"exports": {
|
|
16
17
|
".": {
|
package/dist/chunk-DAOQOXYD.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{useCallback as e,useMemo as T}from"react";var R=y=>{let{message:r,title:s,onConfirm:n,onCancel:a,children:i,cancelText:p="Cancel",confirmText:l="Confirm",slotProps:t,cancelButtonProps:c,confirmButtonProps:P,...g}=y,m=e(o=>({hideCloseButton:!0,size:"md",...o,...g}),[g]),u=e(o=>({...o,...t?.content}),[t?.content]),d=e(o=>({className:"flex gap-1 flex-col",...o,...t?.body}),[t?.body]),f=e(o=>({...o,...t?.footer}),[t?.footer]),x=e(o=>({onClick:n,color:"danger",...o,...P}),[n,P]),B=e(o=>({onClick:a,...o,...c}),[a,c]),C=e(o=>({variant:"h6",...o,...t?.title}),[t?.title]),D=e(o=>({variant:"paragraph2",className:"text-foreground-secondary",...o,...t?.message}),[t?.message]);return T(()=>({getDialogProps:m,getContentProps:u,getBodyProps:d,getFooterProps:f,getConfirmButtonProps:x,getCancelButtonProps:B,getTitleProps:C,getMessageProps:D,cancelText:p,confirmText:l,message:r,title:s,children:i}),[p,i,l,d,B,x,u,m,f,D,C,r,s])};export{R as a};
|
package/dist/chunk-G3TQLDJ7.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as r}from"./chunk-VTOWZPYV.mjs";import{a as g}from"./chunk-DAOQOXYD.mjs";import{Button as i}from"@jamsrui/button";import{Dialog as F,DialogBody as h,DialogCloseTrigger as l,DialogContent as M,DialogFooter as b,DialogTrigger as k}from"@jamsrui/dialog";import{Text as s}from"@jamsrui/text";import{mergeConfigProps as q}from"@jamsrui/utils";import{jsx as o,jsxs as e}from"react/jsx-runtime";var I=n=>{let t=r(),a=q(t,t,n),p=g(a),{getBodyProps:D,getCancelButtonProps:m,getConfirmButtonProps:c,getContentProps:P,getDialogProps:f,getFooterProps:T,getMessageProps:C,getTitleProps:x,cancelText:u,confirmText:B,message:d,title:A,children:y}=p;return e(F,{...f({}),children:[o(k,{children:y}),e(M,{...P({}),children:[e(h,{...D({}),children:[o(s,{...x({}),children:A}),o(s,{...C({}),children:d})]}),e(b,{...T({}),children:[o(l,{children:o(i,{...m({}),children:u})}),o(l,{children:o(i,{...c({}),children:B})})]})]})]})};export{I as a};
|
package/dist/chunk-VTOWZPYV.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createConfigContext as o}from"@jamsrui/utils";var[e,i]=o({displayName:"AlertDialogConfig"});export{e as a,i as b};
|