@alankrit2/ui 0.1.0

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/README.md ADDED
@@ -0,0 +1,194 @@
1
+ # @alankrit/ui
2
+
3
+ Production-quality, headless, accessible React UI components built with TypeScript.
4
+
5
+ ## Features
6
+
7
+ - 🎨 **Headless** - Unstyled components that you can customize however you want
8
+ - ♿ **Accessible** - WAI-ARIA compliant with full keyboard navigation
9
+ - 🎯 **TypeScript** - Fully typed API with excellent IntelliSense support
10
+ - 🪶 **Lightweight** - Zero dependencies (except React peer deps)
11
+ - 🔧 **Flexible** - Controlled and uncontrolled modes, compound components, asChild pattern
12
+ - 🌙 **Theme-ready** - Works seamlessly with any styling solution
13
+
14
+ ## Installation
15
+
16
+ ```bash
17
+ npm install @alankrit/ui
18
+ # or
19
+ pnpm add @alankrit/ui
20
+ # or
21
+ yarn add @alankrit/ui
22
+ ```
23
+
24
+ ## Peer Dependencies
25
+
26
+ This library requires React 18+ or React 19+:
27
+
28
+ ```bash
29
+ npm install react react-dom
30
+ ```
31
+
32
+ ## Components
33
+
34
+ ### Dialog
35
+
36
+ A fully accessible modal dialog component.
37
+
38
+ ```tsx
39
+ import { Dialog } from '@alankrit/ui';
40
+
41
+ function MyApp() {
42
+ return (
43
+ <Dialog>
44
+ <Dialog.Trigger asChild>
45
+ <button>Open Dialog</button>
46
+ </Dialog.Trigger>
47
+
48
+ <Dialog.Portal>
49
+ <Dialog.Overlay className="fixed inset-0 bg-black/50" />
50
+
51
+ <Dialog.Content className="fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 bg-white p-6 rounded-lg">
52
+ <Dialog.Title className="text-xl font-bold">
53
+ Dialog Title
54
+ </Dialog.Title>
55
+
56
+ <Dialog.Description className="mt-2 text-gray-600">
57
+ Dialog description goes here.
58
+ </Dialog.Description>
59
+
60
+ <div className="mt-4 flex gap-2">
61
+ <Dialog.Close asChild>
62
+ <button>Cancel</button>
63
+ </Dialog.Close>
64
+ <button>Confirm</button>
65
+ </div>
66
+ </Dialog.Content>
67
+ </Dialog.Portal>
68
+ </Dialog>
69
+ );
70
+ }
71
+ ```
72
+
73
+ #### Controlled Mode
74
+
75
+ ```tsx
76
+ import { useState } from 'react';
77
+ import { Dialog } from '@alankrit/ui';
78
+
79
+ function ControlledDialog() {
80
+ const [open, setOpen] = useState(false);
81
+
82
+ return (
83
+ <>
84
+ <button onClick={() => setOpen(true)}>Open</button>
85
+
86
+ <Dialog open={open} onOpenChange={setOpen}>
87
+ <Dialog.Portal>
88
+ <Dialog.Overlay className="fixed inset-0 bg-black/50" />
89
+ <Dialog.Content className="fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 bg-white p-6">
90
+ <Dialog.Title>Controlled Dialog</Dialog.Title>
91
+ <Dialog.Close asChild>
92
+ <button>Close</button>
93
+ </Dialog.Close>
94
+ </Dialog.Content>
95
+ </Dialog.Portal>
96
+ </Dialog>
97
+ </>
98
+ );
99
+ }
100
+ ```
101
+
102
+ ## API Reference
103
+
104
+ ### Dialog
105
+
106
+ Root component that manages dialog state.
107
+
108
+ **Props:**
109
+ - `open?: boolean` - Controlled open state
110
+ - `defaultOpen?: boolean` - Default open state (uncontrolled)
111
+ - `onOpenChange?: (open: boolean) => void` - Callback when open state changes
112
+
113
+ ### Dialog.Trigger
114
+
115
+ Button that opens the dialog.
116
+
117
+ **Props:**
118
+ - `asChild?: boolean` - Merge props with child element instead of rendering a button
119
+
120
+ ### Dialog.Portal
121
+
122
+ Renders children in a portal outside the DOM hierarchy.
123
+
124
+ **Props:**
125
+ - `container?: HTMLElement` - Portal container (defaults to `document.body`)
126
+
127
+ ### Dialog.Overlay
128
+
129
+ Semi-transparent backdrop. Clicking it closes the dialog.
130
+
131
+ ### Dialog.Content
132
+
133
+ Main dialog content container with focus management and ARIA attributes.
134
+
135
+ **Props:**
136
+ - `onEscapeKeyDown?: (event: KeyboardEvent) => void` - Callback when Escape is pressed
137
+ - `onOverlayClick?: (event: MouseEvent) => void` - Callback when overlay is clicked
138
+
139
+ ### Dialog.Title
140
+
141
+ Dialog title, automatically linked via `aria-labelledby`.
142
+
143
+ ### Dialog.Description
144
+
145
+ Dialog description, automatically linked via `aria-describedby`.
146
+
147
+ ### Dialog.Close
148
+
149
+ Button that closes the dialog.
150
+
151
+ **Props:**
152
+ - `asChild?: boolean` - Merge props with child element instead of rendering a button
153
+
154
+ ## Accessibility
155
+
156
+ All components follow WAI-ARIA best practices:
157
+
158
+ - ✅ Focus trap - Focus stays inside dialog when open
159
+ - ✅ Focus return - Focus returns to trigger on close
160
+ - ✅ Keyboard navigation - Escape to close, Tab to cycle
161
+ - ✅ ARIA attributes - Proper roles and labels
162
+ - ✅ Screen reader support - Fully accessible to assistive technologies
163
+
164
+ ## Styling
165
+
166
+ This library is headless, meaning it provides zero styles. You can style components using:
167
+
168
+ - **Tailwind CSS** - Add utility classes directly
169
+ - **CSS Modules** - Import and apply CSS modules
170
+ - **Styled Components** - Wrap components with styled-components
171
+ - **Emotion** - Use the css prop or styled API
172
+ - **Plain CSS** - Add className and style with regular CSS
173
+
174
+ ## TypeScript
175
+
176
+ Full TypeScript support with exported types:
177
+
178
+ ```tsx
179
+ import type { DialogProps, DialogContentProps } from '@alankrit/ui';
180
+ ```
181
+
182
+ ## License
183
+
184
+ MIT © alankrit
185
+
186
+ ## Contributing
187
+
188
+ Contributions are welcome! Please open an issue or submit a pull request.
189
+
190
+ ## Links
191
+
192
+ - [GitHub Repository](https://github.com/alankrit/ui)
193
+ - [Documentation](https://github.com/alankrit/ui#readme)
194
+ - [Report Issues](https://github.com/alankrit/ui/issues)
@@ -0,0 +1,211 @@
1
+ import * as React$1 from 'react';
2
+
3
+ interface DialogProps {
4
+ /** Controlled open state */
5
+ open?: boolean;
6
+ /** Default open state for uncontrolled mode */
7
+ defaultOpen?: boolean;
8
+ /** Callback when open state changes */
9
+ onOpenChange?: (open: boolean) => void;
10
+ /** Dialog content */
11
+ children: React$1.ReactNode;
12
+ }
13
+ interface DialogTriggerProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement> {
14
+ /** Render as child element instead of button wrapper */
15
+ asChild?: boolean;
16
+ children: React$1.ReactNode;
17
+ }
18
+ interface DialogPortalProps {
19
+ /** Portal container element */
20
+ container?: HTMLElement;
21
+ children: React$1.ReactNode;
22
+ }
23
+ interface DialogOverlayProps extends React$1.HTMLAttributes<HTMLDivElement> {
24
+ children?: React$1.ReactNode;
25
+ }
26
+ interface DialogContentProps extends React$1.HTMLAttributes<HTMLDivElement> {
27
+ /** Callback when Escape key is pressed */
28
+ onEscapeKeyDown?: (event: KeyboardEvent) => void;
29
+ /** Callback when overlay is clicked */
30
+ onOverlayClick?: (event: React$1.MouseEvent) => void;
31
+ children: React$1.ReactNode;
32
+ }
33
+ interface DialogTitleProps extends React$1.HTMLAttributes<HTMLHeadingElement> {
34
+ children: React$1.ReactNode;
35
+ }
36
+ interface DialogDescriptionProps extends React$1.HTMLAttributes<HTMLParagraphElement> {
37
+ children: React$1.ReactNode;
38
+ }
39
+ interface DialogCloseProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement> {
40
+ /** Render as child element instead of button wrapper */
41
+ asChild?: boolean;
42
+ children: React$1.ReactNode;
43
+ }
44
+
45
+ /**
46
+ * Dialog Trigger Component
47
+ *
48
+ * Button that opens the dialog when clicked.
49
+ * Supports asChild pattern for custom elements.
50
+ *
51
+ * @example
52
+ * <Dialog.Trigger>Open Dialog</Dialog.Trigger>
53
+ *
54
+ * // With asChild
55
+ * <Dialog.Trigger asChild>
56
+ * <button className="custom-button">Open</button>
57
+ * </Dialog.Trigger>
58
+ */
59
+ declare const DialogTrigger: React$1.ForwardRefExoticComponent<DialogTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
60
+ /**
61
+ * Dialog Portal Component
62
+ *
63
+ * Renders children in a portal outside the DOM hierarchy.
64
+ * Only renders when dialog is open.
65
+ *
66
+ * @example
67
+ * <Dialog.Portal>
68
+ * <Dialog.Overlay />
69
+ * <Dialog.Content>...</Dialog.Content>
70
+ * </Dialog.Portal>
71
+ */
72
+ declare function DialogPortal({ container, children }: DialogPortalProps): React$1.ReactPortal | null;
73
+ /**
74
+ * Dialog Overlay Component
75
+ *
76
+ * Semi-transparent backdrop behind the dialog.
77
+ * Clicking it closes the dialog.
78
+ *
79
+ * @example
80
+ * <Dialog.Overlay style={{ backgroundColor: 'rgba(0, 0, 0, 0.5)' }} />
81
+ */
82
+ declare const DialogOverlay: React$1.ForwardRefExoticComponent<DialogOverlayProps & React$1.RefAttributes<HTMLDivElement>>;
83
+ /**
84
+ * Dialog Content Component
85
+ *
86
+ * Main container for dialog content.
87
+ * Implements focus trap, keyboard handling, and ARIA attributes.
88
+ *
89
+ * @example
90
+ * <Dialog.Content>
91
+ * <Dialog.Title>Title</Dialog.Title>
92
+ * <Dialog.Description>Description</Dialog.Description>
93
+ * <Dialog.Close>Close</Dialog.Close>
94
+ * </Dialog.Content>
95
+ */
96
+ declare const DialogContent: React$1.ForwardRefExoticComponent<DialogContentProps & React$1.RefAttributes<HTMLDivElement>>;
97
+ /**
98
+ * Dialog Title Component
99
+ *
100
+ * Title for the dialog, linked via aria-labelledby.
101
+ *
102
+ * @example
103
+ * <Dialog.Title>Confirm Action</Dialog.Title>
104
+ */
105
+ declare const DialogTitle: React$1.ForwardRefExoticComponent<DialogTitleProps & React$1.RefAttributes<HTMLHeadingElement>>;
106
+ /**
107
+ * Dialog Description Component
108
+ *
109
+ * Description for the dialog, linked via aria-describedby.
110
+ *
111
+ * @example
112
+ * <Dialog.Description>This action cannot be undone.</Dialog.Description>
113
+ */
114
+ declare const DialogDescription: React$1.ForwardRefExoticComponent<DialogDescriptionProps & React$1.RefAttributes<HTMLParagraphElement>>;
115
+ /**
116
+ * Dialog Close Component
117
+ *
118
+ * Button that closes the dialog when clicked.
119
+ * Supports asChild pattern for custom elements.
120
+ *
121
+ * @example
122
+ * <Dialog.Close>Cancel</Dialog.Close>
123
+ *
124
+ * // With asChild
125
+ * <Dialog.Close asChild>
126
+ * <button className="custom-button">Close</button>
127
+ * </Dialog.Close>
128
+ */
129
+ declare const DialogClose: React$1.ForwardRefExoticComponent<DialogCloseProps & React$1.RefAttributes<HTMLButtonElement>>;
130
+ interface DialogComponent extends React$1.FC<DialogProps> {
131
+ Trigger: typeof DialogTrigger;
132
+ Portal: typeof DialogPortal;
133
+ Overlay: typeof DialogOverlay;
134
+ Content: typeof DialogContent;
135
+ Title: typeof DialogTitle;
136
+ Description: typeof DialogDescription;
137
+ Close: typeof DialogClose;
138
+ }
139
+ declare const _default: DialogComponent;
140
+
141
+ interface ButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement> {
142
+ asChild?: boolean;
143
+ }
144
+
145
+ declare const Button: React$1.ForwardRefExoticComponent<ButtonProps & React$1.RefAttributes<HTMLButtonElement>>;
146
+
147
+ interface UseControlledOptions<T> {
148
+ /** Controlled value */
149
+ value?: T;
150
+ /** Default value for uncontrolled mode */
151
+ defaultValue?: T;
152
+ /** Change handler */
153
+ onChange?: (value: T) => void;
154
+ }
155
+ /**
156
+ * Hook for managing controlled/uncontrolled state pattern.
157
+ * Supports both controlled (value + onChange) and uncontrolled (defaultValue) modes.
158
+ *
159
+ * @example
160
+ * // Controlled
161
+ * const [value, setValue] = useControlled({ value: externalValue, onChange: setExternalValue });
162
+ *
163
+ * // Uncontrolled
164
+ * const [value, setValue] = useControlled({ defaultValue: false });
165
+ */
166
+ declare function useControlled<T>({ value: valueProp, defaultValue, onChange, }: UseControlledOptions<T>): [T, (newValue: T) => void];
167
+
168
+ /**
169
+ * Hook for trapping focus within a container.
170
+ * Handles Tab/Shift+Tab cycling and prevents focus escape.
171
+ *
172
+ * @param containerRef - Ref to the container element
173
+ * @param enabled - Whether the focus trap is active
174
+ * @param autoFocus - Whether to auto-focus the first element on mount
175
+ */
176
+ declare function useFocusTrap(containerRef: React$1.RefObject<HTMLElement | null>, enabled?: boolean, autoFocus?: boolean): void;
177
+
178
+ /**
179
+ * Hook for handling Escape key press events.
180
+ * Automatically cleans up event listener on unmount.
181
+ */
182
+ declare function useEscapeKeydown(handler: (event: KeyboardEvent) => void, enabled?: boolean): void;
183
+
184
+ /**
185
+ * Hook for preventing body scroll when a modal/dialog is open.
186
+ * This is an accessibility requirement to prevent background scrolling.
187
+ */
188
+ declare function useBodyScrollLock(enabled?: boolean): void;
189
+
190
+ /**
191
+ * Hook for generating stable, unique IDs.
192
+ * Uses React's useId when available, with a fallback for older versions.
193
+ */
194
+ declare function useStableId(idProp?: string): string;
195
+
196
+ interface SlotProps extends React$1.HTMLAttributes<HTMLElement> {
197
+ children?: React$1.ReactNode;
198
+ }
199
+ /**
200
+ * Slot component for the asChild pattern.
201
+ * When asChild is true, merges props with the child element instead of rendering a wrapper.
202
+ */
203
+ declare const Slot: React$1.ForwardRefExoticComponent<SlotProps & React$1.RefAttributes<HTMLElement>>;
204
+
205
+ /**
206
+ * Composes multiple refs into a single ref callback.
207
+ * Useful when you need to forward a ref while also using it internally.
208
+ */
209
+ declare function composeRefs<T>(...refs: Array<React.Ref<T> | undefined>): (node: T | null) => void;
210
+
211
+ export { Button, type ButtonProps, _default as Dialog, type DialogCloseProps, type DialogContentProps, type DialogDescriptionProps, type DialogOverlayProps, type DialogPortalProps, type DialogProps, type DialogTitleProps, type DialogTriggerProps, Slot, composeRefs, useBodyScrollLock, useControlled, useEscapeKeydown, useFocusTrap, useStableId };
@@ -0,0 +1,211 @@
1
+ import * as React$1 from 'react';
2
+
3
+ interface DialogProps {
4
+ /** Controlled open state */
5
+ open?: boolean;
6
+ /** Default open state for uncontrolled mode */
7
+ defaultOpen?: boolean;
8
+ /** Callback when open state changes */
9
+ onOpenChange?: (open: boolean) => void;
10
+ /** Dialog content */
11
+ children: React$1.ReactNode;
12
+ }
13
+ interface DialogTriggerProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement> {
14
+ /** Render as child element instead of button wrapper */
15
+ asChild?: boolean;
16
+ children: React$1.ReactNode;
17
+ }
18
+ interface DialogPortalProps {
19
+ /** Portal container element */
20
+ container?: HTMLElement;
21
+ children: React$1.ReactNode;
22
+ }
23
+ interface DialogOverlayProps extends React$1.HTMLAttributes<HTMLDivElement> {
24
+ children?: React$1.ReactNode;
25
+ }
26
+ interface DialogContentProps extends React$1.HTMLAttributes<HTMLDivElement> {
27
+ /** Callback when Escape key is pressed */
28
+ onEscapeKeyDown?: (event: KeyboardEvent) => void;
29
+ /** Callback when overlay is clicked */
30
+ onOverlayClick?: (event: React$1.MouseEvent) => void;
31
+ children: React$1.ReactNode;
32
+ }
33
+ interface DialogTitleProps extends React$1.HTMLAttributes<HTMLHeadingElement> {
34
+ children: React$1.ReactNode;
35
+ }
36
+ interface DialogDescriptionProps extends React$1.HTMLAttributes<HTMLParagraphElement> {
37
+ children: React$1.ReactNode;
38
+ }
39
+ interface DialogCloseProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement> {
40
+ /** Render as child element instead of button wrapper */
41
+ asChild?: boolean;
42
+ children: React$1.ReactNode;
43
+ }
44
+
45
+ /**
46
+ * Dialog Trigger Component
47
+ *
48
+ * Button that opens the dialog when clicked.
49
+ * Supports asChild pattern for custom elements.
50
+ *
51
+ * @example
52
+ * <Dialog.Trigger>Open Dialog</Dialog.Trigger>
53
+ *
54
+ * // With asChild
55
+ * <Dialog.Trigger asChild>
56
+ * <button className="custom-button">Open</button>
57
+ * </Dialog.Trigger>
58
+ */
59
+ declare const DialogTrigger: React$1.ForwardRefExoticComponent<DialogTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
60
+ /**
61
+ * Dialog Portal Component
62
+ *
63
+ * Renders children in a portal outside the DOM hierarchy.
64
+ * Only renders when dialog is open.
65
+ *
66
+ * @example
67
+ * <Dialog.Portal>
68
+ * <Dialog.Overlay />
69
+ * <Dialog.Content>...</Dialog.Content>
70
+ * </Dialog.Portal>
71
+ */
72
+ declare function DialogPortal({ container, children }: DialogPortalProps): React$1.ReactPortal | null;
73
+ /**
74
+ * Dialog Overlay Component
75
+ *
76
+ * Semi-transparent backdrop behind the dialog.
77
+ * Clicking it closes the dialog.
78
+ *
79
+ * @example
80
+ * <Dialog.Overlay style={{ backgroundColor: 'rgba(0, 0, 0, 0.5)' }} />
81
+ */
82
+ declare const DialogOverlay: React$1.ForwardRefExoticComponent<DialogOverlayProps & React$1.RefAttributes<HTMLDivElement>>;
83
+ /**
84
+ * Dialog Content Component
85
+ *
86
+ * Main container for dialog content.
87
+ * Implements focus trap, keyboard handling, and ARIA attributes.
88
+ *
89
+ * @example
90
+ * <Dialog.Content>
91
+ * <Dialog.Title>Title</Dialog.Title>
92
+ * <Dialog.Description>Description</Dialog.Description>
93
+ * <Dialog.Close>Close</Dialog.Close>
94
+ * </Dialog.Content>
95
+ */
96
+ declare const DialogContent: React$1.ForwardRefExoticComponent<DialogContentProps & React$1.RefAttributes<HTMLDivElement>>;
97
+ /**
98
+ * Dialog Title Component
99
+ *
100
+ * Title for the dialog, linked via aria-labelledby.
101
+ *
102
+ * @example
103
+ * <Dialog.Title>Confirm Action</Dialog.Title>
104
+ */
105
+ declare const DialogTitle: React$1.ForwardRefExoticComponent<DialogTitleProps & React$1.RefAttributes<HTMLHeadingElement>>;
106
+ /**
107
+ * Dialog Description Component
108
+ *
109
+ * Description for the dialog, linked via aria-describedby.
110
+ *
111
+ * @example
112
+ * <Dialog.Description>This action cannot be undone.</Dialog.Description>
113
+ */
114
+ declare const DialogDescription: React$1.ForwardRefExoticComponent<DialogDescriptionProps & React$1.RefAttributes<HTMLParagraphElement>>;
115
+ /**
116
+ * Dialog Close Component
117
+ *
118
+ * Button that closes the dialog when clicked.
119
+ * Supports asChild pattern for custom elements.
120
+ *
121
+ * @example
122
+ * <Dialog.Close>Cancel</Dialog.Close>
123
+ *
124
+ * // With asChild
125
+ * <Dialog.Close asChild>
126
+ * <button className="custom-button">Close</button>
127
+ * </Dialog.Close>
128
+ */
129
+ declare const DialogClose: React$1.ForwardRefExoticComponent<DialogCloseProps & React$1.RefAttributes<HTMLButtonElement>>;
130
+ interface DialogComponent extends React$1.FC<DialogProps> {
131
+ Trigger: typeof DialogTrigger;
132
+ Portal: typeof DialogPortal;
133
+ Overlay: typeof DialogOverlay;
134
+ Content: typeof DialogContent;
135
+ Title: typeof DialogTitle;
136
+ Description: typeof DialogDescription;
137
+ Close: typeof DialogClose;
138
+ }
139
+ declare const _default: DialogComponent;
140
+
141
+ interface ButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement> {
142
+ asChild?: boolean;
143
+ }
144
+
145
+ declare const Button: React$1.ForwardRefExoticComponent<ButtonProps & React$1.RefAttributes<HTMLButtonElement>>;
146
+
147
+ interface UseControlledOptions<T> {
148
+ /** Controlled value */
149
+ value?: T;
150
+ /** Default value for uncontrolled mode */
151
+ defaultValue?: T;
152
+ /** Change handler */
153
+ onChange?: (value: T) => void;
154
+ }
155
+ /**
156
+ * Hook for managing controlled/uncontrolled state pattern.
157
+ * Supports both controlled (value + onChange) and uncontrolled (defaultValue) modes.
158
+ *
159
+ * @example
160
+ * // Controlled
161
+ * const [value, setValue] = useControlled({ value: externalValue, onChange: setExternalValue });
162
+ *
163
+ * // Uncontrolled
164
+ * const [value, setValue] = useControlled({ defaultValue: false });
165
+ */
166
+ declare function useControlled<T>({ value: valueProp, defaultValue, onChange, }: UseControlledOptions<T>): [T, (newValue: T) => void];
167
+
168
+ /**
169
+ * Hook for trapping focus within a container.
170
+ * Handles Tab/Shift+Tab cycling and prevents focus escape.
171
+ *
172
+ * @param containerRef - Ref to the container element
173
+ * @param enabled - Whether the focus trap is active
174
+ * @param autoFocus - Whether to auto-focus the first element on mount
175
+ */
176
+ declare function useFocusTrap(containerRef: React$1.RefObject<HTMLElement | null>, enabled?: boolean, autoFocus?: boolean): void;
177
+
178
+ /**
179
+ * Hook for handling Escape key press events.
180
+ * Automatically cleans up event listener on unmount.
181
+ */
182
+ declare function useEscapeKeydown(handler: (event: KeyboardEvent) => void, enabled?: boolean): void;
183
+
184
+ /**
185
+ * Hook for preventing body scroll when a modal/dialog is open.
186
+ * This is an accessibility requirement to prevent background scrolling.
187
+ */
188
+ declare function useBodyScrollLock(enabled?: boolean): void;
189
+
190
+ /**
191
+ * Hook for generating stable, unique IDs.
192
+ * Uses React's useId when available, with a fallback for older versions.
193
+ */
194
+ declare function useStableId(idProp?: string): string;
195
+
196
+ interface SlotProps extends React$1.HTMLAttributes<HTMLElement> {
197
+ children?: React$1.ReactNode;
198
+ }
199
+ /**
200
+ * Slot component for the asChild pattern.
201
+ * When asChild is true, merges props with the child element instead of rendering a wrapper.
202
+ */
203
+ declare const Slot: React$1.ForwardRefExoticComponent<SlotProps & React$1.RefAttributes<HTMLElement>>;
204
+
205
+ /**
206
+ * Composes multiple refs into a single ref callback.
207
+ * Useful when you need to forward a ref while also using it internally.
208
+ */
209
+ declare function composeRefs<T>(...refs: Array<React.Ref<T> | undefined>): (node: T | null) => void;
210
+
211
+ export { Button, type ButtonProps, _default as Dialog, type DialogCloseProps, type DialogContentProps, type DialogDescriptionProps, type DialogOverlayProps, type DialogPortalProps, type DialogProps, type DialogTitleProps, type DialogTriggerProps, Slot, composeRefs, useBodyScrollLock, useControlled, useEscapeKeydown, useFocusTrap, useStableId };