@spark-ui/components 12.2.0 → 13.0.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.
@@ -1,104 +1,144 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { e as DialogProps, C as CloseProps, h as BodyProps, f as ContentProps, n as DescriptionProps, i as FooterProps, g as HeaderProps, k as OverlayProps, l as PortalProps, m as TitleProps, j as TriggerProps } from '../DialogTrigger-woU7vsJi.mjs';
3
- import { Ref, MutableRefObject } from 'react';
4
- import 'radix-ui';
5
- import 'class-variance-authority/types';
6
- import 'class-variance-authority';
2
+ import { AlertDialog as AlertDialog$2 } from '@base-ui-components/react/alert-dialog';
3
+ import { ComponentProps, Ref, ReactNode, ReactElement, MutableRefObject } from 'react';
7
4
 
8
- type AlertDialogProps = Omit<DialogProps, 'modal'>;
5
+ interface AlertDialogProps extends Omit<ComponentProps<typeof AlertDialog$2.Root>, 'onOpenChange' | 'render'> {
6
+ /**
7
+ * Specifies if the dialog is open or not.
8
+ */
9
+ open?: boolean;
10
+ /**
11
+ * Default open state.
12
+ */
13
+ defaultOpen?: boolean;
14
+ /**
15
+ * Handler executed on every dialog open state change.
16
+ */
17
+ onOpenChange?: (open: boolean) => void;
18
+ /**
19
+ * Specifies if the dialog should have a fade animation on its body (in case it is scrollable).
20
+ */
21
+ withFade?: boolean;
22
+ /**
23
+ * Change the default rendered element for the one passed as a child, merging their props and behavior.
24
+ */
25
+ asChild?: boolean;
26
+ ref?: Ref<HTMLDivElement>;
27
+ }
9
28
  declare const AlertDialog$1: {
10
- (props: AlertDialogProps): react_jsx_runtime.JSX.Element;
29
+ ({ onOpenChange, withFade, ...props }: AlertDialogProps): react_jsx_runtime.JSX.Element;
11
30
  displayName: string;
12
31
  };
13
32
 
14
- type AlertDialogActionProps = CloseProps & {
33
+ interface AlertDialogActionProps extends Omit<ComponentProps<typeof AlertDialog$2.Close>, 'render'> {
34
+ /**
35
+ * Change the default rendered element for the one passed as a child, merging their props and behavior.
36
+ */
37
+ asChild?: boolean;
15
38
  ref?: Ref<HTMLButtonElement>;
16
- };
39
+ }
17
40
  declare const AlertDialogAction: {
18
- (props: AlertDialogActionProps): react_jsx_runtime.JSX.Element;
41
+ ({ asChild, ...props }: AlertDialogActionProps): react_jsx_runtime.JSX.Element;
19
42
  displayName: string;
20
43
  };
21
44
 
22
- type AlertDialogBodyProps = BodyProps & {
45
+ interface AlertDialogBodyProps {
46
+ children: ReactNode;
47
+ className?: string;
48
+ tabIndex?: number;
23
49
  ref?: Ref<HTMLDivElement>;
24
- };
50
+ inset?: boolean;
51
+ }
25
52
  declare const AlertDialogBody: {
26
- (props: AlertDialogBodyProps): react_jsx_runtime.JSX.Element;
53
+ ({ children, className, inset, ref: forwardedRef, ...rest }: AlertDialogBodyProps): ReactElement;
27
54
  displayName: string;
28
55
  };
29
56
 
30
- type AlertDialogCancelProps = CloseProps & {
57
+ interface AlertDialogCancelProps extends Omit<ComponentProps<typeof AlertDialog$2.Close>, 'render'> {
58
+ /**
59
+ * Change the default rendered element for the one passed as a child, merging their props and behavior.
60
+ */
61
+ asChild?: boolean;
31
62
  ref?: Ref<HTMLButtonElement>;
32
- };
63
+ }
33
64
  declare const AlertDialogCancel: {
34
- ({ ref: forwardedRef, ...props }: AlertDialogCancelProps): react_jsx_runtime.JSX.Element;
65
+ ({ asChild, ref: forwardedRef, ...props }: AlertDialogCancelProps): react_jsx_runtime.JSX.Element;
35
66
  displayName: string;
36
67
  };
37
68
 
38
- type AlertDialogContentProps = Omit<ContentProps, 'size' | 'isNarrow' | 'onPointerDownOutside' | 'onInteractOutside'> & {
69
+ interface AlertDialogContentProps extends Omit<ComponentProps<typeof AlertDialog$2.Popup>, 'render'> {
39
70
  ref?: Ref<HTMLDivElement>;
40
- };
71
+ }
41
72
  declare const AlertDialogContent: {
42
- ({ className, onOpenAutoFocus, ref, ...others }: AlertDialogContentProps): react_jsx_runtime.JSX.Element;
73
+ ({ className, ref, initialFocus, ...others }: AlertDialogContentProps): react_jsx_runtime.JSX.Element;
43
74
  displayName: string;
44
75
  };
45
76
 
46
- type AlertDialogDescriptionProps = DescriptionProps & {
77
+ interface AlertDialogDescriptionProps extends Omit<ComponentProps<typeof AlertDialog$2.Description>, 'render'> {
47
78
  ref?: Ref<HTMLParagraphElement>;
48
- };
79
+ }
49
80
  declare const AlertDialogDescription: {
50
81
  (props: AlertDialogDescriptionProps): react_jsx_runtime.JSX.Element;
51
82
  displayName: string;
52
83
  };
53
84
 
54
- type AlertDialogFooterProps = FooterProps & {
85
+ interface AlertDialogFooterProps {
86
+ children: ReactNode;
87
+ className?: string;
55
88
  ref?: Ref<HTMLDivElement>;
56
- };
89
+ }
57
90
  declare const AlertDialogFooter: {
58
- (props: AlertDialogFooterProps): react_jsx_runtime.JSX.Element;
91
+ ({ children, className, ref, ...rest }: AlertDialogFooterProps): ReactElement;
59
92
  displayName: string;
60
93
  };
61
94
 
62
- type AlertDialogHeaderProps = HeaderProps & {
95
+ interface AlertDialogHeaderProps {
96
+ children: ReactNode;
97
+ className?: string;
63
98
  ref?: Ref<HTMLDivElement>;
64
- };
99
+ }
65
100
  declare const AlertDialogHeader: {
66
- (props: AlertDialogHeaderProps): react_jsx_runtime.JSX.Element;
101
+ ({ children, className, ref, ...rest }: AlertDialogHeaderProps): ReactElement;
67
102
  displayName: string;
68
103
  };
69
104
 
70
- type AlertDialogOverlayProps = OverlayProps & {
105
+ interface AlertDialogOverlayProps extends Omit<ComponentProps<typeof AlertDialog$2.Backdrop>, 'render'> {
71
106
  ref?: Ref<HTMLDivElement>;
72
- };
107
+ }
73
108
  declare const AlertDialogOverlay: {
74
- (props: AlertDialogOverlayProps): react_jsx_runtime.JSX.Element;
109
+ ({ className, ...props }: AlertDialogOverlayProps): react_jsx_runtime.JSX.Element;
75
110
  displayName: string;
76
111
  };
77
112
 
78
- type AlertDialogPortalProps = PortalProps;
113
+ type AlertDialogPortalProps = ComponentProps<typeof AlertDialog$2.Portal>;
79
114
  declare const AlertDialogPortal: {
80
115
  (props: AlertDialogPortalProps): react_jsx_runtime.JSX.Element;
81
116
  displayName: string;
82
117
  };
83
118
 
84
- type AlertDialogTitleProps = TitleProps & {
85
- ref?: Ref<HTMLParagraphElement>;
86
- };
119
+ interface AlertDialogTitleProps extends Omit<ComponentProps<typeof AlertDialog$2.Title>, 'render'> {
120
+ ref?: Ref<HTMLHeadingElement>;
121
+ }
87
122
  declare const AlertDialogTitle: {
88
- (props: AlertDialogTitleProps): react_jsx_runtime.JSX.Element;
123
+ ({ className, ...props }: AlertDialogTitleProps): react_jsx_runtime.JSX.Element;
89
124
  displayName: string;
90
125
  };
91
126
 
92
- type AlertDialogTriggerProps = TriggerProps & {
127
+ interface AlertDialogTriggerProps extends Omit<ComponentProps<typeof AlertDialog$2.Trigger>, 'render'> {
128
+ /**
129
+ * Change the default rendered element for the one passed as a child, merging their props and behavior.
130
+ */
131
+ asChild?: boolean;
93
132
  ref?: Ref<HTMLButtonElement>;
94
- };
133
+ }
95
134
  declare const AlertDialogTrigger: {
96
- (props: AlertDialogTriggerProps): react_jsx_runtime.JSX.Element;
135
+ ({ asChild, ...props }: AlertDialogTriggerProps): react_jsx_runtime.JSX.Element;
97
136
  displayName: string;
98
137
  };
99
138
 
100
139
  interface AlertDialogContextValue {
101
140
  cancelRef: MutableRefObject<HTMLButtonElement | null>;
141
+ withFade: boolean;
102
142
  }
103
143
  declare const useAlertDialog: () => AlertDialogContextValue;
104
144
 
@@ -1,104 +1,144 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { e as DialogProps, C as CloseProps, h as BodyProps, f as ContentProps, n as DescriptionProps, i as FooterProps, g as HeaderProps, k as OverlayProps, l as PortalProps, m as TitleProps, j as TriggerProps } from '../DialogTrigger-woU7vsJi.js';
3
- import { Ref, MutableRefObject } from 'react';
4
- import 'radix-ui';
5
- import 'class-variance-authority/types';
6
- import 'class-variance-authority';
2
+ import { AlertDialog as AlertDialog$2 } from '@base-ui-components/react/alert-dialog';
3
+ import { ComponentProps, Ref, ReactNode, ReactElement, MutableRefObject } from 'react';
7
4
 
8
- type AlertDialogProps = Omit<DialogProps, 'modal'>;
5
+ interface AlertDialogProps extends Omit<ComponentProps<typeof AlertDialog$2.Root>, 'onOpenChange' | 'render'> {
6
+ /**
7
+ * Specifies if the dialog is open or not.
8
+ */
9
+ open?: boolean;
10
+ /**
11
+ * Default open state.
12
+ */
13
+ defaultOpen?: boolean;
14
+ /**
15
+ * Handler executed on every dialog open state change.
16
+ */
17
+ onOpenChange?: (open: boolean) => void;
18
+ /**
19
+ * Specifies if the dialog should have a fade animation on its body (in case it is scrollable).
20
+ */
21
+ withFade?: boolean;
22
+ /**
23
+ * Change the default rendered element for the one passed as a child, merging their props and behavior.
24
+ */
25
+ asChild?: boolean;
26
+ ref?: Ref<HTMLDivElement>;
27
+ }
9
28
  declare const AlertDialog$1: {
10
- (props: AlertDialogProps): react_jsx_runtime.JSX.Element;
29
+ ({ onOpenChange, withFade, ...props }: AlertDialogProps): react_jsx_runtime.JSX.Element;
11
30
  displayName: string;
12
31
  };
13
32
 
14
- type AlertDialogActionProps = CloseProps & {
33
+ interface AlertDialogActionProps extends Omit<ComponentProps<typeof AlertDialog$2.Close>, 'render'> {
34
+ /**
35
+ * Change the default rendered element for the one passed as a child, merging their props and behavior.
36
+ */
37
+ asChild?: boolean;
15
38
  ref?: Ref<HTMLButtonElement>;
16
- };
39
+ }
17
40
  declare const AlertDialogAction: {
18
- (props: AlertDialogActionProps): react_jsx_runtime.JSX.Element;
41
+ ({ asChild, ...props }: AlertDialogActionProps): react_jsx_runtime.JSX.Element;
19
42
  displayName: string;
20
43
  };
21
44
 
22
- type AlertDialogBodyProps = BodyProps & {
45
+ interface AlertDialogBodyProps {
46
+ children: ReactNode;
47
+ className?: string;
48
+ tabIndex?: number;
23
49
  ref?: Ref<HTMLDivElement>;
24
- };
50
+ inset?: boolean;
51
+ }
25
52
  declare const AlertDialogBody: {
26
- (props: AlertDialogBodyProps): react_jsx_runtime.JSX.Element;
53
+ ({ children, className, inset, ref: forwardedRef, ...rest }: AlertDialogBodyProps): ReactElement;
27
54
  displayName: string;
28
55
  };
29
56
 
30
- type AlertDialogCancelProps = CloseProps & {
57
+ interface AlertDialogCancelProps extends Omit<ComponentProps<typeof AlertDialog$2.Close>, 'render'> {
58
+ /**
59
+ * Change the default rendered element for the one passed as a child, merging their props and behavior.
60
+ */
61
+ asChild?: boolean;
31
62
  ref?: Ref<HTMLButtonElement>;
32
- };
63
+ }
33
64
  declare const AlertDialogCancel: {
34
- ({ ref: forwardedRef, ...props }: AlertDialogCancelProps): react_jsx_runtime.JSX.Element;
65
+ ({ asChild, ref: forwardedRef, ...props }: AlertDialogCancelProps): react_jsx_runtime.JSX.Element;
35
66
  displayName: string;
36
67
  };
37
68
 
38
- type AlertDialogContentProps = Omit<ContentProps, 'size' | 'isNarrow' | 'onPointerDownOutside' | 'onInteractOutside'> & {
69
+ interface AlertDialogContentProps extends Omit<ComponentProps<typeof AlertDialog$2.Popup>, 'render'> {
39
70
  ref?: Ref<HTMLDivElement>;
40
- };
71
+ }
41
72
  declare const AlertDialogContent: {
42
- ({ className, onOpenAutoFocus, ref, ...others }: AlertDialogContentProps): react_jsx_runtime.JSX.Element;
73
+ ({ className, ref, initialFocus, ...others }: AlertDialogContentProps): react_jsx_runtime.JSX.Element;
43
74
  displayName: string;
44
75
  };
45
76
 
46
- type AlertDialogDescriptionProps = DescriptionProps & {
77
+ interface AlertDialogDescriptionProps extends Omit<ComponentProps<typeof AlertDialog$2.Description>, 'render'> {
47
78
  ref?: Ref<HTMLParagraphElement>;
48
- };
79
+ }
49
80
  declare const AlertDialogDescription: {
50
81
  (props: AlertDialogDescriptionProps): react_jsx_runtime.JSX.Element;
51
82
  displayName: string;
52
83
  };
53
84
 
54
- type AlertDialogFooterProps = FooterProps & {
85
+ interface AlertDialogFooterProps {
86
+ children: ReactNode;
87
+ className?: string;
55
88
  ref?: Ref<HTMLDivElement>;
56
- };
89
+ }
57
90
  declare const AlertDialogFooter: {
58
- (props: AlertDialogFooterProps): react_jsx_runtime.JSX.Element;
91
+ ({ children, className, ref, ...rest }: AlertDialogFooterProps): ReactElement;
59
92
  displayName: string;
60
93
  };
61
94
 
62
- type AlertDialogHeaderProps = HeaderProps & {
95
+ interface AlertDialogHeaderProps {
96
+ children: ReactNode;
97
+ className?: string;
63
98
  ref?: Ref<HTMLDivElement>;
64
- };
99
+ }
65
100
  declare const AlertDialogHeader: {
66
- (props: AlertDialogHeaderProps): react_jsx_runtime.JSX.Element;
101
+ ({ children, className, ref, ...rest }: AlertDialogHeaderProps): ReactElement;
67
102
  displayName: string;
68
103
  };
69
104
 
70
- type AlertDialogOverlayProps = OverlayProps & {
105
+ interface AlertDialogOverlayProps extends Omit<ComponentProps<typeof AlertDialog$2.Backdrop>, 'render'> {
71
106
  ref?: Ref<HTMLDivElement>;
72
- };
107
+ }
73
108
  declare const AlertDialogOverlay: {
74
- (props: AlertDialogOverlayProps): react_jsx_runtime.JSX.Element;
109
+ ({ className, ...props }: AlertDialogOverlayProps): react_jsx_runtime.JSX.Element;
75
110
  displayName: string;
76
111
  };
77
112
 
78
- type AlertDialogPortalProps = PortalProps;
113
+ type AlertDialogPortalProps = ComponentProps<typeof AlertDialog$2.Portal>;
79
114
  declare const AlertDialogPortal: {
80
115
  (props: AlertDialogPortalProps): react_jsx_runtime.JSX.Element;
81
116
  displayName: string;
82
117
  };
83
118
 
84
- type AlertDialogTitleProps = TitleProps & {
85
- ref?: Ref<HTMLParagraphElement>;
86
- };
119
+ interface AlertDialogTitleProps extends Omit<ComponentProps<typeof AlertDialog$2.Title>, 'render'> {
120
+ ref?: Ref<HTMLHeadingElement>;
121
+ }
87
122
  declare const AlertDialogTitle: {
88
- (props: AlertDialogTitleProps): react_jsx_runtime.JSX.Element;
123
+ ({ className, ...props }: AlertDialogTitleProps): react_jsx_runtime.JSX.Element;
89
124
  displayName: string;
90
125
  };
91
126
 
92
- type AlertDialogTriggerProps = TriggerProps & {
127
+ interface AlertDialogTriggerProps extends Omit<ComponentProps<typeof AlertDialog$2.Trigger>, 'render'> {
128
+ /**
129
+ * Change the default rendered element for the one passed as a child, merging their props and behavior.
130
+ */
131
+ asChild?: boolean;
93
132
  ref?: Ref<HTMLButtonElement>;
94
- };
133
+ }
95
134
  declare const AlertDialogTrigger: {
96
- (props: AlertDialogTriggerProps): react_jsx_runtime.JSX.Element;
135
+ ({ asChild, ...props }: AlertDialogTriggerProps): react_jsx_runtime.JSX.Element;
97
136
  displayName: string;
98
137
  };
99
138
 
100
139
  interface AlertDialogContextValue {
101
140
  cancelRef: MutableRefObject<HTMLButtonElement | null>;
141
+ withFade: boolean;
102
142
  }
103
143
  declare const useAlertDialog: () => AlertDialogContextValue;
104
144