@ninna-ui/overlays 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/LICENSE +21 -0
- package/README.md +116 -0
- package/dist/index.d.ts +376 -0
- package/dist/index.js +12530 -0
- package/dist/index.js.map +1 -0
- package/package.json +71 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ninna-UI Team
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# @ninna-ui/overlays
|
|
2
|
+
|
|
3
|
+
> 5 overlay components for Ninna-UI — Modal, Drawer, Popover, Tooltip, and DropdownMenu.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@ninna-ui/overlays)
|
|
6
|
+
[](../../LICENSE)
|
|
7
|
+
|
|
8
|
+
📖 **[Full Documentation →](https://ninna-ui.dev/overlays)** | 📦 **[npm →](https://www.npmjs.com/package/@ninna-ui/overlays)** | 🐙 **[GitHub →](https://github.com/ninna-ui/ninna-ui/tree/main/packages/overlays)**
|
|
9
|
+
|
|
10
|
+
Overlay and portal components for [Ninna UI](../../README.md). All powered by [Radix UI](https://www.radix-ui.com/) under the hood for bulletproof accessibility — focus trapping, scroll locking, escape-to-close, and click-outside dismissal are all handled automatically. Radix types never leak into the public API.
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
pnpm add @ninna-ui/overlays @ninna-ui/core
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## CSS Setup
|
|
19
|
+
|
|
20
|
+
```css
|
|
21
|
+
@import "tailwindcss";
|
|
22
|
+
@import "@ninna-ui/core/theme/presets/default.css";
|
|
23
|
+
@source "../node_modules/@ninna-ui/*";
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Components
|
|
27
|
+
|
|
28
|
+
| Component | Description | Radix Engine |
|
|
29
|
+
|-----------|-------------|-------------|
|
|
30
|
+
| `Modal` | Dialog with backdrop overlay, focus trap, and scroll lock | DialogEngine |
|
|
31
|
+
| `Drawer` | Slide-in panel from any edge (top, right, bottom, left) | DialogEngine |
|
|
32
|
+
| `Popover` | Floating content anchored to a trigger element | PopoverEngine |
|
|
33
|
+
| `Tooltip` | Lightweight hover/focus hint | TooltipEngine |
|
|
34
|
+
| `DropdownMenu` | Accessible dropdown menu with keyboard navigation | DropdownEngine |
|
|
35
|
+
|
|
36
|
+
## Quick Start
|
|
37
|
+
|
|
38
|
+
```tsx
|
|
39
|
+
import { Modal, Tooltip, DropdownMenu } from "@ninna-ui/overlays";
|
|
40
|
+
import { Button } from "@ninna-ui/primitives";
|
|
41
|
+
|
|
42
|
+
function App() {
|
|
43
|
+
return (
|
|
44
|
+
<>
|
|
45
|
+
{/* Tooltip */}
|
|
46
|
+
<Tooltip>
|
|
47
|
+
<Tooltip.Trigger asChild>
|
|
48
|
+
<Button color="primary">Save</Button>
|
|
49
|
+
</Tooltip.Trigger>
|
|
50
|
+
<Tooltip.Content>Save your changes</Tooltip.Content>
|
|
51
|
+
</Tooltip>
|
|
52
|
+
|
|
53
|
+
{/* Modal */}
|
|
54
|
+
<Modal>
|
|
55
|
+
<Modal.Trigger asChild>
|
|
56
|
+
<Button>Open Modal</Button>
|
|
57
|
+
</Modal.Trigger>
|
|
58
|
+
<Modal.Content>
|
|
59
|
+
<Modal.Header>Confirm</Modal.Header>
|
|
60
|
+
<Modal.Body>
|
|
61
|
+
<p>Are you sure you want to continue?</p>
|
|
62
|
+
</Modal.Body>
|
|
63
|
+
</Modal.Content>
|
|
64
|
+
</Modal>
|
|
65
|
+
|
|
66
|
+
{/* Dropdown */}
|
|
67
|
+
<DropdownMenu>
|
|
68
|
+
<DropdownMenu.Trigger asChild>
|
|
69
|
+
<Button variant="outline">Options</Button>
|
|
70
|
+
</DropdownMenu.Trigger>
|
|
71
|
+
<DropdownMenu.Content>
|
|
72
|
+
<DropdownMenu.Item>Edit</DropdownMenu.Item>
|
|
73
|
+
<DropdownMenu.Item>Duplicate</DropdownMenu.Item>
|
|
74
|
+
<DropdownMenu.Separator />
|
|
75
|
+
<DropdownMenu.Item destructive>Delete</DropdownMenu.Item>
|
|
76
|
+
</DropdownMenu.Content>
|
|
77
|
+
</DropdownMenu>
|
|
78
|
+
</>
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Built-in Behavior
|
|
84
|
+
|
|
85
|
+
Overlay components include these accessibility features out of the box:
|
|
86
|
+
|
|
87
|
+
- **Focus trapping** — Modal and Drawer trap keyboard focus
|
|
88
|
+
- **Scroll locking** — Modal and Drawer lock background scroll while open
|
|
89
|
+
- **Escape to close** — Press Escape to dismiss (component-configurable)
|
|
90
|
+
- **Click outside** — Click outside to dismiss (component-configurable)
|
|
91
|
+
- **Portal rendering** — Overlay content renders in a portal to avoid z-index conflicts
|
|
92
|
+
- **Animation** — Enter/exit animations via CSS keyframes (ninna-enter, ninna-exit)
|
|
93
|
+
- **z-index layering** — Tooltip > DropdownMenu > Popover > Modal/Drawer
|
|
94
|
+
|
|
95
|
+
## All Exports
|
|
96
|
+
|
|
97
|
+
```typescript
|
|
98
|
+
import {
|
|
99
|
+
Modal,
|
|
100
|
+
Drawer,
|
|
101
|
+
Popover,
|
|
102
|
+
Tooltip,
|
|
103
|
+
DropdownMenu,
|
|
104
|
+
} from "@ninna-ui/overlays";
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Related Packages
|
|
108
|
+
|
|
109
|
+
- [`@ninna-ui/core`](../core/README.md) — Design tokens and theme presets (required)
|
|
110
|
+
- [`@ninna-ui/primitives`](../primitives/README.md) — Button, Badge, and other trigger components
|
|
111
|
+
- [`@ninna-ui/feedback`](../feedback/README.md) — Toast notifications for overlay actions
|
|
112
|
+
- [All packages](../../README.md#packages) — Complete package list
|
|
113
|
+
|
|
114
|
+
## License
|
|
115
|
+
|
|
116
|
+
[MIT](../../LICENSE)
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode, ComponentPropsWithoutRef } from 'react';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
/** Size options for the Modal */
|
|
6
|
+
type ModalSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
7
|
+
/** Props for the Modal root component */
|
|
8
|
+
interface ModalProps {
|
|
9
|
+
/** Modal content */
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
/** Controlled open state */
|
|
12
|
+
open?: boolean | undefined;
|
|
13
|
+
/** Default open state (uncontrolled) */
|
|
14
|
+
defaultOpen?: boolean | undefined;
|
|
15
|
+
/** Callback when open state changes */
|
|
16
|
+
onOpenChange?: ((open: boolean) => void) | undefined;
|
|
17
|
+
/** Whether the modal is modal (blocks interaction with rest of page) */
|
|
18
|
+
modal?: boolean | undefined;
|
|
19
|
+
}
|
|
20
|
+
/** Props for the Modal trigger button */
|
|
21
|
+
interface ModalTriggerProps extends ComponentPropsWithoutRef<'button'> {
|
|
22
|
+
/** Render as child element instead of button */
|
|
23
|
+
asChild?: boolean | undefined;
|
|
24
|
+
}
|
|
25
|
+
/** Props for the Modal content panel */
|
|
26
|
+
interface ModalContentProps extends ComponentPropsWithoutRef<'div'> {
|
|
27
|
+
/** Size of the modal content */
|
|
28
|
+
size?: ModalSize;
|
|
29
|
+
/** Whether the modal is centered vertically */
|
|
30
|
+
centered?: boolean;
|
|
31
|
+
/** Accessible description for the modal. Only rendered when provided. */
|
|
32
|
+
description?: string;
|
|
33
|
+
/** Whether clicking the overlay closes the modal @default true */
|
|
34
|
+
closeOnOverlayClick?: boolean | undefined;
|
|
35
|
+
/** Whether pressing Escape closes the modal @default true */
|
|
36
|
+
closeOnEscape?: boolean | undefined;
|
|
37
|
+
/** Callback when escape key is pressed */
|
|
38
|
+
onEscapeKeyDown?: ((event: KeyboardEvent) => void) | undefined;
|
|
39
|
+
/** Callback when pointer clicks outside content */
|
|
40
|
+
onPointerDownOutside?: ((event: Event) => void) | undefined;
|
|
41
|
+
/** Callback when focus moves outside content */
|
|
42
|
+
onInteractOutside?: ((event: Event) => void) | undefined;
|
|
43
|
+
}
|
|
44
|
+
/** Props for the Modal header section */
|
|
45
|
+
interface ModalHeaderProps extends ComponentPropsWithoutRef<'div'> {
|
|
46
|
+
}
|
|
47
|
+
/** Props for the Modal body section */
|
|
48
|
+
interface ModalBodyProps extends ComponentPropsWithoutRef<'div'> {
|
|
49
|
+
}
|
|
50
|
+
/** Props for the Modal footer section */
|
|
51
|
+
interface ModalFooterProps extends ComponentPropsWithoutRef<'div'> {
|
|
52
|
+
}
|
|
53
|
+
/** Props for the Modal close button */
|
|
54
|
+
interface ModalCloseProps extends ComponentPropsWithoutRef<'button'> {
|
|
55
|
+
/** Render as child element instead of button */
|
|
56
|
+
asChild?: boolean | undefined;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
declare const Modal: {
|
|
60
|
+
({ children, open, defaultOpen, onOpenChange, modal }: ModalProps): react_jsx_runtime.JSX.Element;
|
|
61
|
+
displayName: string;
|
|
62
|
+
} & {
|
|
63
|
+
Trigger: react.ForwardRefExoticComponent<ModalTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
64
|
+
Content: react.ForwardRefExoticComponent<ModalContentProps & react.RefAttributes<HTMLDivElement>>;
|
|
65
|
+
Header: react.ForwardRefExoticComponent<ModalHeaderProps & react.RefAttributes<HTMLDivElement>>;
|
|
66
|
+
Body: react.ForwardRefExoticComponent<ModalBodyProps & react.RefAttributes<HTMLDivElement>>;
|
|
67
|
+
Footer: react.ForwardRefExoticComponent<ModalFooterProps & react.RefAttributes<HTMLDivElement>>;
|
|
68
|
+
Close: react.ForwardRefExoticComponent<ModalCloseProps & react.RefAttributes<HTMLButtonElement>>;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
/** Placement options for the Drawer */
|
|
72
|
+
type DrawerPlacement = 'left' | 'right' | 'top' | 'bottom';
|
|
73
|
+
/** Size options for the Drawer */
|
|
74
|
+
type DrawerSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
75
|
+
/** Props for the Drawer root component */
|
|
76
|
+
interface DrawerProps {
|
|
77
|
+
/** Drawer content */
|
|
78
|
+
children: ReactNode;
|
|
79
|
+
/** Controlled open state */
|
|
80
|
+
open?: boolean | undefined;
|
|
81
|
+
/** Default open state (uncontrolled) */
|
|
82
|
+
defaultOpen?: boolean | undefined;
|
|
83
|
+
/** Callback when open state changes */
|
|
84
|
+
onOpenChange?: ((open: boolean) => void) | undefined;
|
|
85
|
+
/** Whether the drawer is modal (blocks interaction with rest of page) */
|
|
86
|
+
modal?: boolean | undefined;
|
|
87
|
+
}
|
|
88
|
+
/** Props for the Drawer trigger button */
|
|
89
|
+
interface DrawerTriggerProps extends ComponentPropsWithoutRef<'button'> {
|
|
90
|
+
/** Render as child element instead of button */
|
|
91
|
+
asChild?: boolean | undefined;
|
|
92
|
+
}
|
|
93
|
+
/** Props for the Drawer content panel */
|
|
94
|
+
interface DrawerContentProps extends ComponentPropsWithoutRef<'div'> {
|
|
95
|
+
/** Which edge the drawer slides from @default 'right' */
|
|
96
|
+
placement?: DrawerPlacement;
|
|
97
|
+
/** Size of the drawer @default 'md' */
|
|
98
|
+
size?: DrawerSize;
|
|
99
|
+
/** Accessible description for the drawer. Only rendered when provided. */
|
|
100
|
+
description?: string;
|
|
101
|
+
/** Whether clicking the overlay closes the drawer @default true */
|
|
102
|
+
closeOnOverlayClick?: boolean | undefined;
|
|
103
|
+
/** Whether pressing Escape closes the drawer @default true */
|
|
104
|
+
closeOnEscape?: boolean | undefined;
|
|
105
|
+
/** Callback when escape key is pressed */
|
|
106
|
+
onEscapeKeyDown?: ((event: KeyboardEvent) => void) | undefined;
|
|
107
|
+
/** Callback when pointer clicks outside content */
|
|
108
|
+
onPointerDownOutside?: ((event: Event) => void) | undefined;
|
|
109
|
+
}
|
|
110
|
+
/** Props for the Drawer header section */
|
|
111
|
+
interface DrawerHeaderProps extends ComponentPropsWithoutRef<'div'> {
|
|
112
|
+
}
|
|
113
|
+
/** Props for the Drawer body section */
|
|
114
|
+
interface DrawerBodyProps extends ComponentPropsWithoutRef<'div'> {
|
|
115
|
+
}
|
|
116
|
+
/** Props for the Drawer footer section */
|
|
117
|
+
interface DrawerFooterProps extends ComponentPropsWithoutRef<'div'> {
|
|
118
|
+
}
|
|
119
|
+
/** Props for the Drawer close button */
|
|
120
|
+
interface DrawerCloseProps extends ComponentPropsWithoutRef<'button'> {
|
|
121
|
+
/** Render as child element instead of button */
|
|
122
|
+
asChild?: boolean | undefined;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
declare const Drawer: {
|
|
126
|
+
({ children, open, defaultOpen, onOpenChange, modal }: DrawerProps): react_jsx_runtime.JSX.Element;
|
|
127
|
+
displayName: string;
|
|
128
|
+
} & {
|
|
129
|
+
Trigger: react.ForwardRefExoticComponent<DrawerTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
130
|
+
Content: react.ForwardRefExoticComponent<DrawerContentProps & react.RefAttributes<HTMLDivElement>>;
|
|
131
|
+
Header: react.ForwardRefExoticComponent<DrawerHeaderProps & react.RefAttributes<HTMLDivElement>>;
|
|
132
|
+
Body: react.ForwardRefExoticComponent<DrawerBodyProps & react.RefAttributes<HTMLDivElement>>;
|
|
133
|
+
Footer: react.ForwardRefExoticComponent<DrawerFooterProps & react.RefAttributes<HTMLDivElement>>;
|
|
134
|
+
Close: react.ForwardRefExoticComponent<DrawerCloseProps & react.RefAttributes<HTMLButtonElement>>;
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
/** Placement options for the Popover */
|
|
138
|
+
type PopoverPlacement = 'top' | 'right' | 'bottom' | 'left';
|
|
139
|
+
/** Alignment options for the Popover */
|
|
140
|
+
type PopoverAlign = 'start' | 'center' | 'end';
|
|
141
|
+
/** Props for the Popover root component */
|
|
142
|
+
interface PopoverProps {
|
|
143
|
+
/** Popover content */
|
|
144
|
+
children: ReactNode;
|
|
145
|
+
/** Controlled open state */
|
|
146
|
+
open?: boolean | undefined;
|
|
147
|
+
/** Default open state (uncontrolled) */
|
|
148
|
+
defaultOpen?: boolean | undefined;
|
|
149
|
+
/** Callback when open state changes */
|
|
150
|
+
onOpenChange?: ((open: boolean) => void) | undefined;
|
|
151
|
+
/** Whether the popover is modal */
|
|
152
|
+
modal?: boolean | undefined;
|
|
153
|
+
}
|
|
154
|
+
/** Props for the Popover trigger */
|
|
155
|
+
interface PopoverTriggerProps extends ComponentPropsWithoutRef<'button'> {
|
|
156
|
+
/** Render as child element instead of button */
|
|
157
|
+
asChild?: boolean | undefined;
|
|
158
|
+
}
|
|
159
|
+
/** Props for the Popover content panel */
|
|
160
|
+
interface PopoverContentProps extends ComponentPropsWithoutRef<'div'> {
|
|
161
|
+
/** Which side to place the popover @default 'bottom' */
|
|
162
|
+
side?: PopoverPlacement;
|
|
163
|
+
/** Distance from trigger in pixels @default 4 */
|
|
164
|
+
sideOffset?: number;
|
|
165
|
+
/** Alignment along the side @default 'center' */
|
|
166
|
+
align?: PopoverAlign;
|
|
167
|
+
/** Whether to avoid collisions with viewport boundary @default true */
|
|
168
|
+
avoidCollisions?: boolean | undefined;
|
|
169
|
+
/** Callback when escape key is pressed */
|
|
170
|
+
onEscapeKeyDown?: ((event: KeyboardEvent) => void) | undefined;
|
|
171
|
+
/** Callback when pointer clicks outside content */
|
|
172
|
+
onPointerDownOutside?: ((event: Event) => void) | undefined;
|
|
173
|
+
/** Callback when focus moves outside content */
|
|
174
|
+
onFocusOutside?: ((event: Event) => void) | undefined;
|
|
175
|
+
}
|
|
176
|
+
/** Props for the Popover arrow */
|
|
177
|
+
interface PopoverArrowProps extends ComponentPropsWithoutRef<'svg'> {
|
|
178
|
+
/** Width of the arrow in pixels @default 10 */
|
|
179
|
+
width?: number;
|
|
180
|
+
/** Height of the arrow in pixels @default 5 */
|
|
181
|
+
height?: number;
|
|
182
|
+
}
|
|
183
|
+
/** Props for the Popover close button */
|
|
184
|
+
interface PopoverCloseProps extends ComponentPropsWithoutRef<'button'> {
|
|
185
|
+
/** Render as child element instead of button */
|
|
186
|
+
asChild?: boolean | undefined;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
declare const Popover: {
|
|
190
|
+
({ children, open, defaultOpen, onOpenChange, modal }: PopoverProps): react_jsx_runtime.JSX.Element;
|
|
191
|
+
displayName: string;
|
|
192
|
+
} & {
|
|
193
|
+
Trigger: react.ForwardRefExoticComponent<PopoverTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
194
|
+
Content: react.ForwardRefExoticComponent<PopoverContentProps & react.RefAttributes<HTMLDivElement>>;
|
|
195
|
+
Arrow: react.ForwardRefExoticComponent<PopoverArrowProps & react.RefAttributes<SVGSVGElement>>;
|
|
196
|
+
Close: react.ForwardRefExoticComponent<PopoverCloseProps & react.RefAttributes<HTMLButtonElement>>;
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
/** Placement options for the Tooltip */
|
|
200
|
+
type TooltipPlacement = 'top' | 'right' | 'bottom' | 'left';
|
|
201
|
+
/** Props for the Tooltip root component */
|
|
202
|
+
interface TooltipProps {
|
|
203
|
+
/** Tooltip content */
|
|
204
|
+
children: ReactNode;
|
|
205
|
+
/** Controlled open state */
|
|
206
|
+
open?: boolean | undefined;
|
|
207
|
+
/** Default open state (uncontrolled) */
|
|
208
|
+
defaultOpen?: boolean | undefined;
|
|
209
|
+
/** Callback when open state changes */
|
|
210
|
+
onOpenChange?: ((open: boolean) => void) | undefined;
|
|
211
|
+
/** Delay in ms before showing the tooltip @default 200 */
|
|
212
|
+
delayDuration?: number | undefined;
|
|
213
|
+
/** Whether to disable hoverable content */
|
|
214
|
+
disableHoverableContent?: boolean | undefined;
|
|
215
|
+
}
|
|
216
|
+
/** Props for the Tooltip trigger */
|
|
217
|
+
interface TooltipTriggerProps extends ComponentPropsWithoutRef<'button'> {
|
|
218
|
+
/** Render as child element instead of button */
|
|
219
|
+
asChild?: boolean | undefined;
|
|
220
|
+
}
|
|
221
|
+
/** Props for the Tooltip content */
|
|
222
|
+
interface TooltipContentProps extends ComponentPropsWithoutRef<'div'> {
|
|
223
|
+
/** Which side to place the tooltip @default 'top' */
|
|
224
|
+
side?: TooltipPlacement;
|
|
225
|
+
/** Distance from trigger in pixels @default 4 */
|
|
226
|
+
sideOffset?: number;
|
|
227
|
+
/** Alignment along the side @default 'center' */
|
|
228
|
+
align?: 'start' | 'center' | 'end';
|
|
229
|
+
/** Whether to show an arrow @default false */
|
|
230
|
+
hasArrow?: boolean | undefined;
|
|
231
|
+
/** Whether to avoid collisions with viewport boundary @default true */
|
|
232
|
+
avoidCollisions?: boolean | undefined;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
declare const Tooltip: {
|
|
236
|
+
({ children, open, defaultOpen, onOpenChange, delayDuration, disableHoverableContent, }: TooltipProps): react_jsx_runtime.JSX.Element;
|
|
237
|
+
displayName: string;
|
|
238
|
+
} & {
|
|
239
|
+
Trigger: react.ForwardRefExoticComponent<TooltipTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
240
|
+
Content: react.ForwardRefExoticComponent<TooltipContentProps & react.RefAttributes<HTMLDivElement>>;
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
/** Props for the DropdownMenu root component */
|
|
244
|
+
interface DropdownMenuProps {
|
|
245
|
+
/** DropdownMenu content */
|
|
246
|
+
children: ReactNode;
|
|
247
|
+
/** Controlled open state */
|
|
248
|
+
open?: boolean | undefined;
|
|
249
|
+
/** Default open state (uncontrolled) */
|
|
250
|
+
defaultOpen?: boolean | undefined;
|
|
251
|
+
/** Callback when open state changes */
|
|
252
|
+
onOpenChange?: ((open: boolean) => void) | undefined;
|
|
253
|
+
/** Whether the dropdown is modal @default true */
|
|
254
|
+
modal?: boolean | undefined;
|
|
255
|
+
/** Reading direction @default 'ltr' */
|
|
256
|
+
dir?: 'ltr' | 'rtl' | undefined;
|
|
257
|
+
}
|
|
258
|
+
/** Props for the DropdownMenu trigger */
|
|
259
|
+
interface DropdownMenuTriggerProps extends ComponentPropsWithoutRef<'button'> {
|
|
260
|
+
/** Render as child element instead of button */
|
|
261
|
+
asChild?: boolean | undefined;
|
|
262
|
+
}
|
|
263
|
+
/** Props for the DropdownMenu content */
|
|
264
|
+
interface DropdownMenuContentProps extends ComponentPropsWithoutRef<'div'> {
|
|
265
|
+
/** Which side to place the menu @default 'bottom' */
|
|
266
|
+
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
267
|
+
/** Distance from trigger in pixels @default 4 */
|
|
268
|
+
sideOffset?: number;
|
|
269
|
+
/** Alignment along the side @default 'start' */
|
|
270
|
+
align?: 'start' | 'center' | 'end';
|
|
271
|
+
/** Whether to loop keyboard navigation @default true */
|
|
272
|
+
loop?: boolean | undefined;
|
|
273
|
+
/** Whether to avoid collisions with viewport boundary */
|
|
274
|
+
avoidCollisions?: boolean | undefined;
|
|
275
|
+
}
|
|
276
|
+
/** Props for a DropdownMenu item */
|
|
277
|
+
interface DropdownMenuItemProps extends Omit<ComponentPropsWithoutRef<'div'>, 'onSelect'> {
|
|
278
|
+
/** Whether the item is disabled */
|
|
279
|
+
disabled?: boolean | undefined;
|
|
280
|
+
/** Callback when the item is selected */
|
|
281
|
+
onSelect?: ((event: Event) => void) | undefined;
|
|
282
|
+
/** Text value for typeahead */
|
|
283
|
+
textValue?: string | undefined;
|
|
284
|
+
/** Whether the item is destructive (danger styling) */
|
|
285
|
+
destructive?: boolean | undefined;
|
|
286
|
+
}
|
|
287
|
+
/** Props for a DropdownMenu checkbox item */
|
|
288
|
+
interface DropdownMenuCheckboxItemProps extends Omit<ComponentPropsWithoutRef<'div'>, 'onSelect'> {
|
|
289
|
+
/** Whether the item is checked */
|
|
290
|
+
checked?: boolean | 'indeterminate' | undefined;
|
|
291
|
+
/** Callback when checked state changes */
|
|
292
|
+
onCheckedChange?: ((checked: boolean) => void) | undefined;
|
|
293
|
+
/** Whether the item is disabled */
|
|
294
|
+
disabled?: boolean | undefined;
|
|
295
|
+
/** Callback when the item is selected */
|
|
296
|
+
onSelect?: ((event: Event) => void) | undefined;
|
|
297
|
+
/** Text value for typeahead */
|
|
298
|
+
textValue?: string | undefined;
|
|
299
|
+
}
|
|
300
|
+
/** Props for a DropdownMenu radio group */
|
|
301
|
+
interface DropdownMenuRadioGroupProps extends ComponentPropsWithoutRef<'div'> {
|
|
302
|
+
/** Current value */
|
|
303
|
+
value?: string | undefined;
|
|
304
|
+
/** Callback when value changes */
|
|
305
|
+
onValueChange?: ((value: string) => void) | undefined;
|
|
306
|
+
}
|
|
307
|
+
/** Props for a DropdownMenu radio item */
|
|
308
|
+
interface DropdownMenuRadioItemProps extends Omit<ComponentPropsWithoutRef<'div'>, 'onSelect'> {
|
|
309
|
+
/** Value of the radio item */
|
|
310
|
+
value: string;
|
|
311
|
+
/** Whether the item is disabled */
|
|
312
|
+
disabled?: boolean | undefined;
|
|
313
|
+
/** Callback when the item is selected */
|
|
314
|
+
onSelect?: ((event: Event) => void) | undefined;
|
|
315
|
+
/** Text value for typeahead */
|
|
316
|
+
textValue?: string | undefined;
|
|
317
|
+
}
|
|
318
|
+
/** Props for a DropdownMenu label */
|
|
319
|
+
interface DropdownMenuLabelProps extends ComponentPropsWithoutRef<'div'> {
|
|
320
|
+
/** Whether the label is inset (indented to align with items) */
|
|
321
|
+
inset?: boolean | undefined;
|
|
322
|
+
}
|
|
323
|
+
/** Props for a DropdownMenu separator */
|
|
324
|
+
interface DropdownMenuSeparatorProps extends ComponentPropsWithoutRef<'div'> {
|
|
325
|
+
}
|
|
326
|
+
/** Props for a DropdownMenu group */
|
|
327
|
+
interface DropdownMenuGroupProps extends ComponentPropsWithoutRef<'div'> {
|
|
328
|
+
}
|
|
329
|
+
/** Props for the DropdownMenu sub menu */
|
|
330
|
+
interface DropdownMenuSubProps {
|
|
331
|
+
/** Sub menu content */
|
|
332
|
+
children: ReactNode;
|
|
333
|
+
/** Controlled open state */
|
|
334
|
+
open?: boolean | undefined;
|
|
335
|
+
/** Default open state */
|
|
336
|
+
defaultOpen?: boolean | undefined;
|
|
337
|
+
/** Callback when open state changes */
|
|
338
|
+
onOpenChange?: ((open: boolean) => void) | undefined;
|
|
339
|
+
}
|
|
340
|
+
/** Props for the DropdownMenu sub trigger */
|
|
341
|
+
interface DropdownMenuSubTriggerProps extends ComponentPropsWithoutRef<'div'> {
|
|
342
|
+
/** Whether the item is disabled */
|
|
343
|
+
disabled?: boolean | undefined;
|
|
344
|
+
/** Text value for typeahead */
|
|
345
|
+
textValue?: string | undefined;
|
|
346
|
+
}
|
|
347
|
+
/** Props for the DropdownMenu sub content */
|
|
348
|
+
interface DropdownMenuSubContentProps extends ComponentPropsWithoutRef<'div'> {
|
|
349
|
+
/** Distance from trigger in pixels @default 2 */
|
|
350
|
+
sideOffset?: number | undefined;
|
|
351
|
+
/** Whether to loop keyboard navigation */
|
|
352
|
+
loop?: boolean | undefined;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
declare const DropdownMenu: {
|
|
356
|
+
({ children, open, defaultOpen, onOpenChange, modal, dir }: DropdownMenuProps): react_jsx_runtime.JSX.Element;
|
|
357
|
+
displayName: string;
|
|
358
|
+
} & {
|
|
359
|
+
Trigger: react.ForwardRefExoticComponent<DropdownMenuTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
360
|
+
Content: react.ForwardRefExoticComponent<DropdownMenuContentProps & react.RefAttributes<HTMLDivElement>>;
|
|
361
|
+
Item: react.ForwardRefExoticComponent<DropdownMenuItemProps & react.RefAttributes<HTMLDivElement>>;
|
|
362
|
+
CheckboxItem: react.ForwardRefExoticComponent<DropdownMenuCheckboxItemProps & react.RefAttributes<HTMLDivElement>>;
|
|
363
|
+
RadioGroup: react.ForwardRefExoticComponent<DropdownMenuRadioGroupProps & react.RefAttributes<HTMLDivElement>>;
|
|
364
|
+
RadioItem: react.ForwardRefExoticComponent<DropdownMenuRadioItemProps & react.RefAttributes<HTMLDivElement>>;
|
|
365
|
+
Label: react.ForwardRefExoticComponent<DropdownMenuLabelProps & react.RefAttributes<HTMLDivElement>>;
|
|
366
|
+
Separator: react.ForwardRefExoticComponent<DropdownMenuSeparatorProps & react.RefAttributes<HTMLDivElement>>;
|
|
367
|
+
Group: react.ForwardRefExoticComponent<DropdownMenuGroupProps & react.RefAttributes<HTMLDivElement>>;
|
|
368
|
+
Sub: {
|
|
369
|
+
({ children, open, defaultOpen, onOpenChange }: DropdownMenuSubProps): react_jsx_runtime.JSX.Element;
|
|
370
|
+
displayName: string;
|
|
371
|
+
};
|
|
372
|
+
SubTrigger: react.ForwardRefExoticComponent<DropdownMenuSubTriggerProps & react.RefAttributes<HTMLDivElement>>;
|
|
373
|
+
SubContent: react.ForwardRefExoticComponent<DropdownMenuSubContentProps & react.RefAttributes<HTMLDivElement>>;
|
|
374
|
+
};
|
|
375
|
+
|
|
376
|
+
export { Drawer, type DrawerBodyProps, type DrawerCloseProps, type DrawerContentProps, type DrawerFooterProps, type DrawerHeaderProps, type DrawerPlacement, type DrawerProps, type DrawerSize, type DrawerTriggerProps, DropdownMenu, type DropdownMenuCheckboxItemProps, type DropdownMenuContentProps, type DropdownMenuGroupProps, type DropdownMenuItemProps, type DropdownMenuLabelProps, type DropdownMenuProps, type DropdownMenuRadioGroupProps, type DropdownMenuRadioItemProps, type DropdownMenuSeparatorProps, type DropdownMenuSubContentProps, type DropdownMenuSubProps, type DropdownMenuSubTriggerProps, type DropdownMenuTriggerProps, Modal, type ModalBodyProps, type ModalCloseProps, type ModalContentProps, type ModalFooterProps, type ModalHeaderProps, type ModalProps, type ModalSize, type ModalTriggerProps, Popover, type PopoverAlign, type PopoverArrowProps, type PopoverCloseProps, type PopoverContentProps, type PopoverPlacement, type PopoverProps, type PopoverTriggerProps, Tooltip, type TooltipContentProps, type TooltipPlacement, type TooltipProps, type TooltipTriggerProps };
|