@jamsrui/alert-dialog 0.0.12 → 0.0.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/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/chunk-3W6FKSJO.mjs +1 -0
- package/dist/chunk-5XRTY4OL.mjs +1 -0
- package/dist/chunk-6AJ2IDW7.mjs +1 -0
- package/dist/chunk-6FHXRWXR.mjs +1 -0
- package/dist/chunk-E6C5RTGB.mjs +1 -0
- package/dist/chunk-GS6BJ5DM.mjs +1 -0
- package/dist/chunk-K54YAAFP.mjs +1 -0
- package/dist/chunk-NY3FHVFZ.mjs +1 -0
- package/dist/chunk-OX456KPR.mjs +1 -0
- package/dist/chunk-QQSF43ZH.mjs +1 -0
- package/dist/chunk-T7VKR4X6.mjs +1 -0
- package/dist/chunk-TY5TGK4N.mjs +1 -0
- package/dist/chunk-WQMEDVMI.mjs +1 -0
- package/dist/chunk-WZF2LFB5.mjs +1 -0
- 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{a}from"./chunk-OX456KPR.mjs";import"./chunk-WQMEDVMI.mjs";export{a 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{a,b}from"./chunk-
|
|
1
|
+
"use client";import{a,b}from"./chunk-QQSF43ZH.mjs";export{a as AlertDialogConfig,b 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{a}from"./chunk-TY5TGK4N.mjs";import"./chunk-WQMEDVMI.mjs";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{a}from"./chunk-6FHXRWXR.mjs";import"./chunk-WQMEDVMI.mjs";export{a 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{a}from"./chunk-K54YAAFP.mjs";import"./chunk-TY5TGK4N.mjs";import"./chunk-6FHXRWXR.mjs";import"./chunk-WQMEDVMI.mjs";export{a 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{a,b}from"./chunk-WQMEDVMI.mjs";export{a as AlertDialogContext,b 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{a}from"./chunk-WZF2LFB5.mjs";import"./chunk-WQMEDVMI.mjs";export{a 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{a}from"./chunk-GS6BJ5DM.mjs";import"./chunk-WQMEDVMI.mjs";export{a 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{a}from"./chunk-T7VKR4X6.mjs";import"./chunk-WQMEDVMI.mjs";export{a 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{a}from"./chunk-3W6FKSJO.mjs";import"./chunk-WQMEDVMI.mjs";export{a 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{a}from"./chunk-5XRTY4OL.mjs";import"./chunk-WQMEDVMI.mjs";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{a}from"./chunk-
|
|
1
|
+
"use client";import{a}from"./chunk-6AJ2IDW7.mjs";import"./chunk-NY3FHVFZ.mjs";import"./chunk-E6C5RTGB.mjs";import"./chunk-QQSF43ZH.mjs";import"./chunk-WQMEDVMI.mjs";export{a as AlertDialog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as r}from"./chunk-WQMEDVMI.mjs";import{cloneElement as t,isValidElement as i}from"react";var g=o=>{let{children:e}=o,{getTriggerCloseProps:l}=r();return i(e)?t(e,l(e.props??{})):(console.warn("Invalid children passed to AlertDialogTriggerClose"),null)};export{g as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as r}from"./chunk-WQMEDVMI.mjs";import{cloneElement as l,isValidElement as i}from"react";var a=t=>{let{children:e}=t,{getTriggerProps:o}=r();return i(e)?l(e,o(e.props??{})):(console.warn("Invalid children passed to AlertDialogTrigger"),null)};export{a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as l}from"./chunk-NY3FHVFZ.mjs";import{b as t}from"./chunk-QQSF43ZH.mjs";import{a as r}from"./chunk-WQMEDVMI.mjs";import{mergeConfigProps as a}from"@jamsrui/utils";import{jsx as g}from"react/jsx-runtime";var f=e=>{let o=t(),i=a(o,o,e),n=l(i);return g(r,{value:n,children:e.children})};export{f as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as t}from"./chunk-WQMEDVMI.mjs";import{motion as n}from"motion/react";import{jsx as i}from"react/jsx-runtime";var l=o=>{let{getContentProps:e}=t();return i(n.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},...e(o)})};export{l as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{radiusVariant as a,tv as r}from"@jamsrui/utils";var 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 a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as e}from"./chunk-WQMEDVMI.mjs";import{useRenderElement as t}from"@jamsrui/hooks";var i=r=>{let{getFooterProps:o}=e();return t("div",{props:[o(r)]})};export{i as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as t}from"./chunk-TY5TGK4N.mjs";import{a as e}from"./chunk-6FHXRWXR.mjs";import{jsx as o}from"react/jsx-runtime";var i=n=>o(t,{children:o(e,{...n})});export{i as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as n}from"./chunk-E6C5RTGB.mjs";import{useCallback as t,useMemo as R}from"react";import{dataAttrDev as s,mapPropsVariants as j}from"@jamsrui/utils";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";var $=C=>{let[N,y]=j(C,n.variantKeys),{defaultOpen:A,disableAnimation:z=!1,isDismissible:O=!0,isKeyboardDismissible:F=!0,isOpen:v,onOpenChange:h}=N,o=n(y),[r,l]=w({defaultProp:A,onChange:h,prop:v}),{context:a,refs:{setFloating:x,setReference:T}}=E({open:r,onOpenChange:l}),k=I(a,{}),G=S(a,{escapeKey:F,outsidePressEvent:"click",enabled:O}),K=q(a),M=_([k,G,K]),{getReferenceProps:V,getFloatingProps:B}=M,i=t(()=>{l(!1)},[]),p=t(e=>({...e,"data-slot":s("container"),className:o.container({className:e.className}),ref:x,...B()}),[o]),c=t(e=>({...e,"data-slot":s("content"),className:o.content({className:e.className})}),[o]),m=t(e=>({...e,"data-slot":s("body"),className:o.body({className:e.className})}),[o]),g=t(e=>({...e,"data-slot":s("footer"),className:o.footer({className:e.className})}),[o]),P=t(e=>({variant:"h6","data-slot":s("title"),className:o.title({className:e.className}),...e}),[o]),d=t(e=>({variant:"paragraph2","data-slot":s("description"),className:o.description({className:e.className}),...e}),[o]),u=t(e=>({...e,className:o.trigger({className:e.className}),...V({ref:T})}),[o]),f=t(e=>({...e,onClick:i}),[i]),b=t(()=>({className:o.backdrop(),lockScroll:!0}),[o]),D=t(()=>({context:a,modal:!0}),[a]);return R(()=>({getContainerProps:p,getContentProps:c,getBodyProps:m,getFooterProps:g,getTitleProps:P,getDescriptionProps:d,getTriggerProps:u,getOverlayProps:b,getFocusManagerProps:D,getTriggerCloseProps:f,isOpen:r}),[p,m,c,g,P,d,u,b,D,f,r])};export{$ as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as e}from"./chunk-WQMEDVMI.mjs";import{useRenderElement as t}from"@jamsrui/hooks";var i=r=>{let{getBodyProps:o}=e();return t("div",{props:[o(r)]})};export{i as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createConfigContext as o}from"@jamsrui/utils";var[r,i]=o({displayName:"AlertDialogConfig"});export{r as a,i as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as e}from"./chunk-WQMEDVMI.mjs";import{Text as r}from"@jamsrui/text";import{jsx as l}from"react/jsx-runtime";var s=t=>{let{getTitleProps:o}=e();return l(r,{...o(t)})};export{s as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as o}from"./chunk-WQMEDVMI.mjs";import{useRenderElement as s}from"@jamsrui/hooks";import{AnimatePresence as p}from"motion/react";import{FloatingFocusManager as g,FloatingOverlay as m,FloatingPortal as P}from"@floating-ui/react";import{jsx as e}from"react/jsx-runtime";var A=r=>{let{getContainerProps:t,getOverlayProps:n,getFocusManagerProps:a,isOpen:i}=o(),l=s("div",{props:[t(r)]});return e(p,{children:i?e(P,{children:e(m,{...n(),children:e(g,{...a(),children:l})})}):null})};export{A as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createContext as t,use as o}from"react";var r=t(null),n=()=>{let e=o(r);if(!e)throw new Error("useAlertDialogContext must be used within a AlertDialogContext.Provider");return e};export{r as a,n as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as e}from"./chunk-WQMEDVMI.mjs";import{Text as r}from"@jamsrui/text";import{jsx as i}from"react/jsx-runtime";var n=o=>{let{getDescriptionProps:t}=e();return i(r,{...t(o)})};export{n as a};
|
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{a}from"./chunk-T7VKR4X6.mjs";import{a as g}from"./chunk-3W6FKSJO.mjs";import{a as p}from"./chunk-5XRTY4OL.mjs";import{a as e}from"./chunk-6AJ2IDW7.mjs";import"./chunk-NY3FHVFZ.mjs";import"./chunk-E6C5RTGB.mjs";import{a as o}from"./chunk-OX456KPR.mjs";import{a as s,b as D}from"./chunk-QQSF43ZH.mjs";import{a as i}from"./chunk-K54YAAFP.mjs";import{a as r}from"./chunk-TY5TGK4N.mjs";import{a as t}from"./chunk-6FHXRWXR.mjs";import{a as n}from"./chunk-WZF2LFB5.mjs";import{a as l}from"./chunk-GS6BJ5DM.mjs";import"./chunk-WQMEDVMI.mjs";var B=Object.assign(e,{Root:e,Trigger:p,Content:i,Body:o,Footer:l,Title:a,Description:n,Container:r,ContentInner:t,TriggerClose:g});export{B as AlertDialog,o as AlertDialogBody,s as AlertDialogConfig,r as AlertDialogContainer,i as AlertDialogContent,t as AlertDialogContentInner,n as AlertDialogDescription,l as AlertDialogFooter,a as AlertDialogTitle,p as AlertDialogTrigger,g as AlertDialogTriggerClose,D 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{a}from"./chunk-E6C5RTGB.mjs";export{a 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{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-NY3FHVFZ.mjs";import"./chunk-E6C5RTGB.mjs";export{a 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.13",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"react": ">=19"
|
|
6
6
|
},
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@
|
|
9
|
-
"
|
|
10
|
-
"@jamsrui/
|
|
11
|
-
"@jamsrui/
|
|
12
|
-
"@jamsrui/
|
|
13
|
-
"@jamsrui/
|
|
8
|
+
"@floating-ui/react": ">=0.27",
|
|
9
|
+
"motion": ">=12",
|
|
10
|
+
"@jamsrui/core": "^0.0.11",
|
|
11
|
+
"@jamsrui/button": "^0.0.13",
|
|
12
|
+
"@jamsrui/hooks": "^0.0.13",
|
|
13
|
+
"@jamsrui/text": "^0.0.13",
|
|
14
|
+
"@jamsrui/utils": "^0.0.13"
|
|
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};
|