@jamsrui/alert-dialog 0.0.18 → 0.0.19

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.
@@ -0,0 +1,10 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { Button } from '@jamsrui/button';
3
+
4
+ declare const AlertDialogAction: (props: AlertDialogAction.Props) => react_jsx_runtime.JSX.Element;
5
+ declare namespace AlertDialogAction {
6
+ interface Props extends Button.Props {
7
+ }
8
+ }
9
+
10
+ export { AlertDialogAction };
@@ -0,0 +1 @@
1
+ "use client";import{jsx as n}from"react/jsx-runtime";import{Button as e}from"@jamsrui/button";import{useAlertDialogContext as r}from"./alert-dialog-context.mjs";const l=o=>{const{getActionProps:t}=r();return n(e,{...t(o)})};export{l as AlertDialogAction};
@@ -0,0 +1,10 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { Button } from '@jamsrui/button';
3
+
4
+ declare const AlertDialogCancel: (props: AlertDialogCancel.Props) => react_jsx_runtime.JSX.Element;
5
+ declare namespace AlertDialogCancel {
6
+ interface Props extends Button.Props {
7
+ }
8
+ }
9
+
10
+ export { AlertDialogCancel };
@@ -0,0 +1 @@
1
+ "use client";import{jsx as l}from"react/jsx-runtime";import{Button as t}from"@jamsrui/button";import{useAlertDialogContext as r}from"./alert-dialog-context.mjs";const p=e=>{const{getCancelProps:o}=r();return l(t,{...o(e)})};export{p as AlertDialogCancel};
@@ -1,19 +1,22 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { GlobalConfigProps } from '@jamsrui/core';
2
+ import { WithGlobalConfig } from '@jamsrui/core';
3
3
  import { AlertDialog } from './alert-dialog.mjs';
4
4
  import './use-alert-dialog.mjs';
5
- import 'react';
6
- import './styles.mjs';
7
- import '@jamsrui/utils';
8
- import '@jamsrui/text';
9
5
  import '@floating-ui/react';
6
+ import '@jamsrui/text';
7
+ import '@jamsrui/utils';
8
+ import 'react';
9
+ import './alert-dialog-action.mjs';
10
+ import '@jamsrui/button';
10
11
  import './alert-dialog-body.mjs';
12
+ import './alert-dialog-cancel.mjs';
11
13
  import './alert-dialog-container.mjs';
12
14
  import './alert-dialog-content.mjs';
13
15
  import './alert-dialog-content-inner.mjs';
14
16
  import 'motion/react';
15
17
  import './alert-dialog-footer.mjs';
16
18
  import './alert-dialog-title.mjs';
19
+ import './styles.mjs';
17
20
 
18
21
  declare const useAlertDialogConfig: () => AlertDialogConfig.Props;
19
22
  declare const AlertDialogConfig: (props: Omit<Partial<AlertDialogConfig.Props>, "children"> & {
@@ -21,7 +24,7 @@ declare const AlertDialogConfig: (props: Omit<Partial<AlertDialogConfig.Props>,
21
24
  children: React.ReactNode;
22
25
  }) => react_jsx_runtime.JSX.Element;
23
26
  declare namespace AlertDialogConfig {
24
- interface Props extends AlertDialog.Props, GlobalConfigProps<AlertDialog.Props> {
27
+ interface Props extends WithGlobalConfig<AlertDialog.Props> {
25
28
  }
26
29
  }
27
30
 
@@ -1 +1 @@
1
- "use client";import{createConfigContext as o}from"@jamsrui/utils";const[r,i]=o({displayName:"AlertDialogConfig"});export{r as AlertDialogConfig,i as useAlertDialogConfig};
1
+ "use client";import{createConfigContext as o}from"@jamsrui/utils";const[i,t]=o({displayName:"AlertDialogConfig"});export{i as AlertDialogConfig,t as useAlertDialogConfig};
@@ -1 +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};
1
+ "use client";import{jsx as e}from"react/jsx-runtime";import{FloatingFocusManager as l,FloatingOverlay as s,FloatingPortal as p}from"@floating-ui/react";import{useRenderElement as g}from"@jamsrui/hooks";import{AnimatePresence as m}from"motion/react";import{useAlertDialogContext as P}from"./alert-dialog-context.mjs";const A=o=>{const{getContainerProps:r,getOverlayProps:t,getFocusManagerProps:n,isOpen:a}=P(),i=g("div",{props:[r(o)]});return e(m,{children:a?e(p,{children:e(s,{...t(),children:e(l,{...n(),children:i})})}):null})};export{A as AlertDialogContainer};
@@ -1 +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};
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 a=t=>{const{getContentProps:o}=n();return i(e.div,{animate:{scale:1,opacity:1,filter:"blur(0px)"},initial:{scale:.9,opacity:0,filter:"blur(4px)"},transition:{type:"spring",stiffness:300,damping:25},exit:{scale:.95,opacity:0,filter:"blur(4px)",transition:{duration:.25}},...o(t)})};export{a as AlertDialogContentInner};
@@ -1,17 +1,20 @@
1
1
  import * as react from 'react';
2
2
  import { useAlertDialog } from './use-alert-dialog.mjs';
3
- import './styles.mjs';
4
- import '@jamsrui/utils';
5
- import '@jamsrui/text';
6
3
  import '@floating-ui/react';
4
+ import '@jamsrui/text';
5
+ import '@jamsrui/utils';
6
+ import './alert-dialog-action.mjs';
7
+ import 'react/jsx-runtime';
8
+ import '@jamsrui/button';
7
9
  import './alert-dialog-body.mjs';
10
+ import './alert-dialog-cancel.mjs';
8
11
  import './alert-dialog-container.mjs';
9
- import 'react/jsx-runtime';
10
12
  import './alert-dialog-content.mjs';
11
13
  import './alert-dialog-content-inner.mjs';
12
14
  import 'motion/react';
13
15
  import './alert-dialog-footer.mjs';
14
16
  import './alert-dialog-title.mjs';
17
+ import './styles.mjs';
15
18
 
16
19
  declare const AlertDialogContext: react.Context<AlertDialogContext.Props | null>;
17
20
  declare namespace AlertDialogContext {
@@ -1,17 +1,20 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { useAlertDialog } from './use-alert-dialog.mjs';
3
- import 'react';
4
- import './styles.mjs';
5
- import '@jamsrui/utils';
6
- import '@jamsrui/text';
7
3
  import '@floating-ui/react';
4
+ import '@jamsrui/text';
5
+ import '@jamsrui/utils';
6
+ import 'react';
7
+ import './alert-dialog-action.mjs';
8
+ import '@jamsrui/button';
8
9
  import './alert-dialog-body.mjs';
10
+ import './alert-dialog-cancel.mjs';
9
11
  import './alert-dialog-container.mjs';
10
12
  import './alert-dialog-content.mjs';
11
13
  import './alert-dialog-content-inner.mjs';
12
14
  import 'motion/react';
13
15
  import './alert-dialog-footer.mjs';
14
16
  import './alert-dialog-title.mjs';
17
+ import './styles.mjs';
15
18
 
16
19
  declare const AlertDialog: (props: AlertDialog.Props) => react_jsx_runtime.JSX.Element;
17
20
  declare namespace AlertDialog {
@@ -1 +1 @@
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};
1
+ "use client";import{jsx as s}from"react/jsx-runtime";import{mergeConfigProps as l}from"@jamsrui/utils";import{useAlertDialogConfig as i}from"./alert-dialog-config.mjs";import{AlertDialogContext as a}from"./alert-dialog-context.mjs";import{alertDialogVariant as n}from"./styles.mjs";import{useAlertDialog as g}from"./use-alert-dialog.mjs";const A=o=>{const e=i(),r=l(n.defaultVariants,e,o),t=g(r);return s(a,{value:t,children:o.children})};export{A as AlertDialog};
package/dist/index.d.mts CHANGED
@@ -1,26 +1,29 @@
1
1
  import * as react from 'react';
2
2
  import * as react_jsx_runtime from 'react/jsx-runtime';
3
3
  import { AlertDialog as AlertDialog$1 } from './alert-dialog.mjs';
4
+ import { AlertDialogAction } from './alert-dialog-action.mjs';
4
5
  import { AlertDialogBody } from './alert-dialog-body.mjs';
6
+ import { AlertDialogCancel } from './alert-dialog-cancel.mjs';
7
+ import { AlertDialogConfig } from './alert-dialog-config.mjs';
8
+ export { useAlertDialogConfig } from './alert-dialog-config.mjs';
5
9
  import { AlertDialogContainer } from './alert-dialog-container.mjs';
6
10
  import { AlertDialogContent } from './alert-dialog-content.mjs';
7
11
  import { AlertDialogContentInner } from './alert-dialog-content-inner.mjs';
12
+ export { AlertDialogContext, useAlertDialogContext } from './alert-dialog-context.mjs';
8
13
  import { AlertDialogDescription } from './alert-dialog-description.mjs';
9
14
  import { AlertDialogFooter } from './alert-dialog-footer.mjs';
10
15
  import { AlertDialogTitle } from './alert-dialog-title.mjs';
11
16
  import { AlertDialogTrigger } from './alert-dialog-trigger.mjs';
12
- import { AlertDialogTriggerClose } from './alert-dialog-trigger-close.mjs';
13
- export { AlertDialogConfig, useAlertDialogConfig } from './alert-dialog-config.mjs';
14
- import './use-alert-dialog.mjs';
15
- import './styles.mjs';
17
+ export { AlertDialogSlots, AlertDialogVariants, alertDialogVariant } from './styles.mjs';
18
+ export { useAlertDialog } from './use-alert-dialog.mjs';
19
+ import '@jamsrui/button';
16
20
  import '@jamsrui/utils';
21
+ import '@jamsrui/core';
22
+ import 'motion/react';
17
23
  import '@jamsrui/text';
18
24
  import '@floating-ui/react';
19
- import 'motion/react';
20
- import '@jamsrui/core';
21
25
 
22
26
  declare const AlertDialog: ((props: AlertDialog$1.Props) => react_jsx_runtime.JSX.Element) & {
23
- Root: (props: AlertDialog$1.Props) => react_jsx_runtime.JSX.Element;
24
27
  Trigger: (props: AlertDialogTrigger.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | null;
25
28
  Content: (props: AlertDialogContent.Props) => react_jsx_runtime.JSX.Element;
26
29
  Body: (props: AlertDialogBody.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
@@ -29,11 +32,14 @@ declare const AlertDialog: ((props: AlertDialog$1.Props) => react_jsx_runtime.JS
29
32
  Description: (props: AlertDialogDescription.Props) => react_jsx_runtime.JSX.Element;
30
33
  Container: (props: AlertDialogContainer.Props) => react_jsx_runtime.JSX.Element;
31
34
  ContentInner: (props: AlertDialogContentInner.Props) => react_jsx_runtime.JSX.Element;
32
- TriggerClose: (props: AlertDialogTriggerClose.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | null;
35
+ Cancel: (props: AlertDialogCancel.Props) => react_jsx_runtime.JSX.Element;
36
+ Action: (props: AlertDialogAction.Props) => react_jsx_runtime.JSX.Element;
33
37
  };
34
38
  declare namespace AlertDialog {
35
39
  interface Props extends AlertDialog$1.Props {
36
40
  }
41
+ interface Config extends AlertDialogConfig.Props {
42
+ }
37
43
  interface Trigger extends AlertDialogTrigger.Props {
38
44
  }
39
45
  interface Content extends AlertDialogContent.Props {
@@ -50,6 +56,10 @@ declare namespace AlertDialog {
50
56
  }
51
57
  interface ContentInner extends AlertDialogContentInner.Props {
52
58
  }
59
+ interface Cancel extends AlertDialogCancel.Props {
60
+ }
61
+ interface Action extends AlertDialogAction.Props {
62
+ }
53
63
  }
54
64
 
55
- export { AlertDialog, AlertDialogBody, AlertDialogContainer, AlertDialogContent, AlertDialogContentInner, AlertDialogDescription, AlertDialogFooter, AlertDialogTitle, AlertDialogTrigger, AlertDialogTriggerClose };
65
+ export { AlertDialog, AlertDialogAction, AlertDialogBody, AlertDialogCancel, AlertDialogConfig, AlertDialogContainer, AlertDialogContent, AlertDialogContentInner, AlertDialogDescription, AlertDialogFooter, AlertDialogTitle, AlertDialogTrigger };
package/dist/index.mjs CHANGED
@@ -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};
1
+ import{AlertDialog as s}from"./alert-dialog.mjs";import{AlertDialogAction as e}from"./alert-dialog-action.mjs";import{AlertDialogBody as t}from"./alert-dialog-body.mjs";import{AlertDialogCancel as o}from"./alert-dialog-cancel.mjs";import{AlertDialogConfig as D,useAlertDialogConfig as A}from"./alert-dialog-config.mjs";import{AlertDialogContainer as r}from"./alert-dialog-container.mjs";import{AlertDialogContent as i}from"./alert-dialog-content.mjs";import{AlertDialogContentInner as l}from"./alert-dialog-content-inner.mjs";import{AlertDialogContext as f,useAlertDialogContext as m}from"./alert-dialog-context.mjs";import{AlertDialogDescription as n}from"./alert-dialog-description.mjs";import{AlertDialogFooter as a}from"./alert-dialog-footer.mjs";import{AlertDialogTitle as p}from"./alert-dialog-title.mjs";import{AlertDialogTrigger as g}from"./alert-dialog-trigger.mjs";import{alertDialogVariant as x}from"./styles.mjs";import{useAlertDialog as c}from"./use-alert-dialog.mjs";const q=Object.assign(s,{Trigger:g,Content:i,Body:t,Footer:a,Title:p,Description:n,Container:r,ContentInner:l,Cancel:o,Action:e});export{q as AlertDialog,e as AlertDialogAction,t as AlertDialogBody,o as AlertDialogCancel,D as AlertDialogConfig,r as AlertDialogContainer,i as AlertDialogContent,l as AlertDialogContentInner,f as AlertDialogContext,n as AlertDialogDescription,a as AlertDialogFooter,p as AlertDialogTitle,g as AlertDialogTrigger,x as alertDialogVariant,c as useAlertDialog,A as useAlertDialogConfig,m as useAlertDialogContext};
package/dist/styles.d.mts CHANGED
@@ -12,12 +12,6 @@ declare const alertDialogVariant: _jamsrui_utils.TVReturnType<{
12
12
  full: {};
13
13
  none: {};
14
14
  };
15
- scrollBehavior: {
16
- inside: {
17
- body: string;
18
- };
19
- outside: {};
20
- };
21
15
  backdrop: {
22
16
  transparent: {
23
17
  backdrop: string;
@@ -30,7 +24,6 @@ declare const alertDialogVariant: _jamsrui_utils.TVReturnType<{
30
24
  };
31
25
  };
32
26
  }, {
33
- root: string;
34
27
  header: string;
35
28
  container: string;
36
29
  content: string;
@@ -40,6 +33,8 @@ declare const alertDialogVariant: _jamsrui_utils.TVReturnType<{
40
33
  title: string;
41
34
  description: string;
42
35
  backdrop: string;
36
+ cancel: string;
37
+ action: string;
43
38
  }, undefined, {
44
39
  radius: {
45
40
  sm: {};
@@ -51,12 +46,6 @@ declare const alertDialogVariant: _jamsrui_utils.TVReturnType<{
51
46
  full: {};
52
47
  none: {};
53
48
  };
54
- scrollBehavior: {
55
- inside: {
56
- body: string;
57
- };
58
- outside: {};
59
- };
60
49
  backdrop: {
61
50
  transparent: {
62
51
  backdrop: string;
@@ -69,7 +58,6 @@ declare const alertDialogVariant: _jamsrui_utils.TVReturnType<{
69
58
  };
70
59
  };
71
60
  }, {
72
- root: string;
73
61
  header: string;
74
62
  container: string;
75
63
  content: string;
@@ -79,6 +67,8 @@ declare const alertDialogVariant: _jamsrui_utils.TVReturnType<{
79
67
  title: string;
80
68
  description: string;
81
69
  backdrop: string;
70
+ cancel: string;
71
+ action: string;
82
72
  }, _jamsrui_utils.TVReturnType<{
83
73
  radius: {
84
74
  sm: {};
@@ -90,12 +80,6 @@ declare const alertDialogVariant: _jamsrui_utils.TVReturnType<{
90
80
  full: {};
91
81
  none: {};
92
82
  };
93
- scrollBehavior: {
94
- inside: {
95
- body: string;
96
- };
97
- outside: {};
98
- };
99
83
  backdrop: {
100
84
  transparent: {
101
85
  backdrop: string;
@@ -108,7 +92,6 @@ declare const alertDialogVariant: _jamsrui_utils.TVReturnType<{
108
92
  };
109
93
  };
110
94
  }, {
111
- root: string;
112
95
  header: string;
113
96
  container: string;
114
97
  content: string;
@@ -118,6 +101,8 @@ declare const alertDialogVariant: _jamsrui_utils.TVReturnType<{
118
101
  title: string;
119
102
  description: string;
120
103
  backdrop: string;
104
+ cancel: string;
105
+ action: string;
121
106
  }, undefined, unknown, unknown, undefined>>;
122
107
  type AlertDialogVariants = VariantProps<typeof alertDialogVariant>;
123
108
  type AlertDialogSlots = keyof ReturnType<typeof alertDialogVariant>;
package/dist/styles.mjs CHANGED
@@ -1 +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
+ import{radiusVariant as a,tv as r}from"@jamsrui/utils";const e=r({slots:{header:"alert-dialog__header p-4 text-base font-bold",container:"alert-dialog 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",cancel:"alert-dialog__cancel",action:"alert-dialog__action"},variants:{radius:a("content","alert-dialog"),backdrop:{transparent:{backdrop:"alert-dialog--backdrop-transparent"},opaque:{backdrop:"alert-dialog--backdrop-opaque bg-black/50"},blur:{backdrop:"alert-dialog--backdrop-blur bg-black/30 backdrop-blur-md backdrop-saturate-150"}}},defaultVariants:{scrollBehavior:"inside",backdrop:"opaque",radius:"md"}});export{e as alertDialogVariant};
@@ -1,14 +1,17 @@
1
- import { ComponentProps } from 'react';
2
- import { AlertDialogVariants } from './styles.mjs';
1
+ import { FloatingOverlay, FloatingFocusManagerProps } from '@floating-ui/react';
3
2
  import { Text } from '@jamsrui/text';
4
3
  import { PropGetter } from '@jamsrui/utils';
5
- import { FloatingOverlay, FloatingFocusManagerProps } from '@floating-ui/react';
4
+ import { ComponentProps } from 'react';
5
+ import { AlertDialogAction } from './alert-dialog-action.mjs';
6
6
  import { AlertDialogBody } from './alert-dialog-body.mjs';
7
+ import { AlertDialogCancel } from './alert-dialog-cancel.mjs';
7
8
  import { AlertDialogContainer } from './alert-dialog-container.mjs';
8
9
  import { AlertDialogContent } from './alert-dialog-content.mjs';
9
10
  import { AlertDialogFooter } from './alert-dialog-footer.mjs';
10
11
  import { AlertDialogTitle } from './alert-dialog-title.mjs';
12
+ import { AlertDialogVariants } from './styles.mjs';
11
13
  import 'react/jsx-runtime';
14
+ import '@jamsrui/button';
12
15
  import './alert-dialog-content-inner.mjs';
13
16
  import 'motion/react';
14
17
 
@@ -22,7 +25,8 @@ declare const useAlertDialog: (props: useAlertDialog.Props) => {
22
25
  getTriggerProps: (props: Partial<ComponentProps<"button">>) => ComponentProps<"button">;
23
26
  getOverlayProps: () => ComponentProps<typeof FloatingOverlay>;
24
27
  getFocusManagerProps: () => Omit<FloatingFocusManagerProps, "children">;
25
- getTriggerCloseProps: (props: Partial<ComponentProps<"button">>) => ComponentProps<"button">;
28
+ getCancelProps: PropGetter<AlertDialogCancel.Props>;
29
+ getActionProps: PropGetter<AlertDialogAction.Props>;
26
30
  isOpen: boolean;
27
31
  };
28
32
  declare namespace useAlertDialog {
@@ -32,7 +36,6 @@ declare namespace useAlertDialog {
32
36
  onOpenChange?: (open: boolean) => void;
33
37
  isDismissible?: boolean;
34
38
  isKeyboardDismissible?: boolean;
35
- disableAnimation?: boolean;
36
39
  }
37
40
  }
38
41
 
@@ -1 +1 @@
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};
1
+ "use client";import{useCallback as o,useMemo as j}from"react";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";import{dataAttrDev as a,mapPropsVariants as z,mergeProps as H}from"@jamsrui/utils";import{alertDialogVariant as O}from"./styles.mjs";const X=F=>{const[v,G]=z(F,O.variantKeys),{defaultOpen:h,isDismissible:x=!1,isKeyboardDismissible:k=!0,isOpen:T,onOpenChange:K}=v,t=O(G),[r,l]=w({defaultProp:h,onChange:K,prop:T}),{context:s,refs:{setFloating:n,setReference:i}}=E({open:r,onOpenChange:l}),M=I(s,{}),V=S(s,{escapeKey:k,outsidePress:x,outsidePressEvent:"click",enabled:!0}),B=q(s),R=_([M,V,B]),{getReferenceProps:c,getFloatingProps:p}=R,m=o(()=>{l(!1)},[l]),g=o(e=>({...e,"data-slot":a("container"),className:t.container({className:e.className}),ref:n,...p()}),[p,n,t]),P=o(e=>({...e,"data-slot":a("content"),className:t.content({className:e.className})}),[t]),d=o(e=>({...e,"data-slot":a("body"),className:t.body({className:e.className})}),[t]),f=o(e=>({...e,"data-slot":a("footer"),className:t.footer({className:e.className})}),[t]),u=o(e=>({variant:"h6","data-slot":a("title"),className:t.title({className:e.className}),...e}),[t]),y=o(e=>({variant:"paragraph2","data-slot":a("description"),className:t.description({className:e.className}),...e}),[t]),N=o(e=>({...e,className:t.trigger({className:e.className}),...c({ref:i})}),[c,i,t]),D=o(e=>({variant:"bordered",...H(e,{onClick:m}),className:t.cancel({className:e.className})}),[t,m]),A=o(e=>({color:"danger",variant:"solid",...e,className:t.action({className:e.className})}),[t]),C=o(()=>({className:t.backdrop(),lockScroll:!0}),[t]),b=o(()=>({context:s,modal:!0}),[s]);return j(()=>({getContainerProps:g,getContentProps:P,getBodyProps:d,getFooterProps:f,getTitleProps:u,getDescriptionProps:y,getTriggerProps:N,getOverlayProps:C,getFocusManagerProps:b,getCancelProps:D,getActionProps:A,isOpen:r}),[g,d,P,f,u,y,N,C,b,D,A,r])};export{X as useAlertDialog};
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@jamsrui/alert-dialog",
3
- "version": "0.0.18",
3
+ "version": "0.0.19",
4
4
  "peerDependencies": {
5
5
  "react": ">=19"
6
6
  },
7
7
  "dependencies": {
8
8
  "@floating-ui/react": ">=0.27",
9
9
  "motion": ">=12",
10
- "@jamsrui/hooks": "^0.0.16",
11
- "@jamsrui/text": "^0.0.16",
12
- "@jamsrui/utils": "^0.0.16",
13
- "@jamsrui/button": "^0.0.18",
14
- "@jamsrui/core": "^0.0.13"
10
+ "@jamsrui/button": "^0.0.19",
11
+ "@jamsrui/core": "^0.0.14",
12
+ "@jamsrui/hooks": "^0.0.17",
13
+ "@jamsrui/text": "^0.0.17",
14
+ "@jamsrui/utils": "^0.0.17"
15
15
  },
16
16
  "exports": {
17
17
  ".": {
@@ -1,10 +0,0 @@
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 };
@@ -1 +0,0 @@
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};