@constructive-io/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/dist/components/alert-dialog.d.ts +31 -0
- package/dist/components/alert-dialog.js +314 -0
- package/dist/components/alert-dialog.js.map +1 -0
- package/dist/components/alert.d.ts +14 -0
- package/dist/components/alert.js +38 -0
- package/dist/components/alert.js.map +1 -0
- package/dist/components/autocomplete.d.ts +28 -0
- package/dist/components/autocomplete.js +395 -0
- package/dist/components/autocomplete.js.map +1 -0
- package/dist/components/avatar.d.ts +13 -0
- package/dist/components/avatar.js +37 -0
- package/dist/components/avatar.js.map +1 -0
- package/dist/components/badge.d.ts +15 -0
- package/dist/components/badge.js +43 -0
- package/dist/components/badge.js.map +1 -0
- package/dist/components/breadcrumb.d.ts +14 -0
- package/dist/components/breadcrumb.js +154 -0
- package/dist/components/breadcrumb.js.map +1 -0
- package/dist/components/button.d.ts +17 -0
- package/dist/components/button.js +62 -0
- package/dist/components/button.js.map +1 -0
- package/dist/components/calendar-rac.d.ts +13 -0
- package/dist/components/calendar-rac.js +82 -0
- package/dist/components/calendar-rac.js.map +1 -0
- package/dist/components/card.d.ts +19 -0
- package/dist/components/card.js +75 -0
- package/dist/components/card.js.map +1 -0
- package/dist/components/checkbox-group.d.ts +7 -0
- package/dist/components/checkbox-group.js +16 -0
- package/dist/components/checkbox-group.js.map +1 -0
- package/dist/components/checkbox.d.ts +8 -0
- package/dist/components/checkbox.js +67 -0
- package/dist/components/checkbox.js.map +1 -0
- package/dist/components/collapsible.d.ts +54 -0
- package/dist/components/collapsible.js +121 -0
- package/dist/components/collapsible.js.map +1 -0
- package/dist/components/combobox.d.ts +44 -0
- package/dist/components/combobox.js +486 -0
- package/dist/components/combobox.js.map +1 -0
- package/dist/components/command.d.ts +43 -0
- package/dist/components/command.js +690 -0
- package/dist/components/command.js.map +1 -0
- package/dist/components/dialog.d.ts +35 -0
- package/dist/components/dialog.js +440 -0
- package/dist/components/dialog.js.map +1 -0
- package/dist/components/dock.d.ts +31 -0
- package/dist/components/dock.js +111 -0
- package/dist/components/dock.js.map +1 -0
- package/dist/components/drawer.d.ts +16 -0
- package/dist/components/drawer.js +147 -0
- package/dist/components/drawer.js.map +1 -0
- package/dist/components/dropdown-menu.d.ts +50 -0
- package/dist/components/dropdown-menu.js +380 -0
- package/dist/components/dropdown-menu.js.map +1 -0
- package/dist/components/field.d.ts +51 -0
- package/dist/components/field.js +115 -0
- package/dist/components/field.js.map +1 -0
- package/dist/components/flickering-grid.d.ts +15 -0
- package/dist/components/flickering-grid.js +147 -0
- package/dist/components/flickering-grid.js.map +1 -0
- package/dist/components/form-control.d.ts +15 -0
- package/dist/components/form-control.js +173 -0
- package/dist/components/form-control.js.map +1 -0
- package/dist/components/form.d.ts +37 -0
- package/dist/components/form.js +179 -0
- package/dist/components/form.js.map +1 -0
- package/dist/components/input-group.d.ts +18 -0
- package/dist/components/input-group.js +177 -0
- package/dist/components/input-group.js.map +1 -0
- package/dist/components/input.d.ts +11 -0
- package/dist/components/input.js +60 -0
- package/dist/components/input.js.map +1 -0
- package/dist/components/json-input.d.ts +25 -0
- package/dist/components/json-input.js +351 -0
- package/dist/components/json-input.js.map +1 -0
- package/dist/components/label.d.ts +11 -0
- package/dist/components/label.js +27 -0
- package/dist/components/label.js.map +1 -0
- package/dist/components/motion-grid.d.ts +20 -0
- package/dist/components/motion-grid.js +81 -0
- package/dist/components/motion-grid.js.map +1 -0
- package/dist/components/multi-select.d.ts +198 -0
- package/dist/components/multi-select.js +882 -0
- package/dist/components/multi-select.js.map +1 -0
- package/dist/components/page-header.d.ts +17 -0
- package/dist/components/page-header.js +17 -0
- package/dist/components/page-header.js.map +1 -0
- package/dist/components/pagination.d.ts +19 -0
- package/dist/components/pagination.js +144 -0
- package/dist/components/pagination.js.map +1 -0
- package/dist/components/popover.d.ts +35 -0
- package/dist/components/popover.js +188 -0
- package/dist/components/popover.js.map +1 -0
- package/dist/components/portal.d.ts +108 -0
- package/dist/components/portal.js +75 -0
- package/dist/components/portal.js.map +1 -0
- package/dist/components/progress.d.ts +10 -0
- package/dist/components/progress.js +30 -0
- package/dist/components/progress.js.map +1 -0
- package/dist/components/progressive-blur-scroll-container.d.ts +25 -0
- package/dist/components/progressive-blur-scroll-container.js +142 -0
- package/dist/components/progressive-blur-scroll-container.js.map +1 -0
- package/dist/components/progressive-blur.d.ts +16 -0
- package/dist/components/progressive-blur.js +68 -0
- package/dist/components/progressive-blur.js.map +1 -0
- package/dist/components/radio-group.d.ts +10 -0
- package/dist/components/radio-group.js +37 -0
- package/dist/components/radio-group.js.map +1 -0
- package/dist/components/record-picker.d.ts +16 -0
- package/dist/components/record-picker.js +366 -0
- package/dist/components/record-picker.js.map +1 -0
- package/dist/components/resizable.d.ts +11 -0
- package/dist/components/resizable.js +52 -0
- package/dist/components/resizable.js.map +1 -0
- package/dist/components/responsive-diagram.d.ts +10 -0
- package/dist/components/responsive-diagram.js +63 -0
- package/dist/components/responsive-diagram.js.map +1 -0
- package/dist/components/scroll-area.d.ts +12 -0
- package/dist/components/scroll-area.js +69 -0
- package/dist/components/scroll-area.js.map +1 -0
- package/dist/components/select.d.ts +47 -0
- package/dist/components/select.js +287 -0
- package/dist/components/select.js.map +1 -0
- package/dist/components/separator.d.ts +11 -0
- package/dist/components/separator.js +24 -0
- package/dist/components/separator.js.map +1 -0
- package/dist/components/sheet.d.ts +112 -0
- package/dist/components/sheet.js +600 -0
- package/dist/components/sheet.js.map +1 -0
- package/dist/components/sidebar.d.ts +77 -0
- package/dist/components/sidebar.js +1217 -0
- package/dist/components/sidebar.js.map +1 -0
- package/dist/components/skeleton.d.ts +7 -0
- package/dist/components/skeleton.js +16 -0
- package/dist/components/skeleton.js.map +1 -0
- package/dist/components/sonner.d.ts +10 -0
- package/dist/components/sonner.js +23 -0
- package/dist/components/sonner.js.map +1 -0
- package/dist/components/stack/index.d.ts +663 -0
- package/dist/components/stack/index.js +1418 -0
- package/dist/components/stack/index.js.map +1 -0
- package/dist/components/stepper.d.ts +30 -0
- package/dist/components/stepper.js +280 -0
- package/dist/components/stepper.js.map +1 -0
- package/dist/components/switch.d.ts +8 -0
- package/dist/components/switch.js +40 -0
- package/dist/components/switch.js.map +1 -0
- package/dist/components/table.d.ts +15 -0
- package/dist/components/table.js +65 -0
- package/dist/components/table.js.map +1 -0
- package/dist/components/tabs.d.ts +10 -0
- package/dist/components/tabs.js +48 -0
- package/dist/components/tabs.js.map +1 -0
- package/dist/components/tags.d.ts +42 -0
- package/dist/components/tags.js +728 -0
- package/dist/components/tags.js.map +1 -0
- package/dist/components/textarea.d.ts +10 -0
- package/dist/components/textarea.js +54 -0
- package/dist/components/textarea.js.map +1 -0
- package/dist/components/toast/index.d.ts +52 -0
- package/dist/components/toast/index.js +221 -0
- package/dist/components/toast/index.js.map +1 -0
- package/dist/components/tooltip.d.ts +29 -0
- package/dist/components/tooltip.js +174 -0
- package/dist/components/tooltip.js.map +1 -0
- package/dist/components/unlink-button.d.ts +14 -0
- package/dist/components/unlink-button.js +91 -0
- package/dist/components/unlink-button.js.map +1 -0
- package/dist/index.cjs +7692 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +2157 -0
- package/dist/index.d.ts +2157 -0
- package/dist/index.js +7375 -0
- package/dist/index.js.map +1 -0
- package/package.json +490 -0
- package/src/styles/globals.css +397 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,2157 @@
|
|
|
1
|
+
import { ClassValue } from 'clsx';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
+
import * as React$1 from 'react';
|
|
4
|
+
import React__default, { ReactNode, ComponentProps, PropsWithChildren, ComponentType } from 'react';
|
|
5
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
6
|
+
import { VariantProps } from 'class-variance-authority';
|
|
7
|
+
import { Separator as Separator$1 } from '@base-ui/react/separator';
|
|
8
|
+
import { Input as Input$1 } from '@base-ui/react/input';
|
|
9
|
+
import * as _base_ui_react_checkbox from '@base-ui/react/checkbox';
|
|
10
|
+
import { Checkbox as Checkbox$1 } from '@base-ui/react/checkbox';
|
|
11
|
+
import { CheckboxGroup as CheckboxGroup$1 } from '@base-ui/react/checkbox-group';
|
|
12
|
+
import { Radio as Radio$1 } from '@base-ui/react/radio';
|
|
13
|
+
import { RadioGroup as RadioGroup$1 } from '@base-ui/react/radio-group';
|
|
14
|
+
import { Switch as Switch$1 } from '@base-ui/react/switch';
|
|
15
|
+
import * as _base_ui_react_select from '@base-ui/react/select';
|
|
16
|
+
import { Select as Select$1 } from '@base-ui/react/select';
|
|
17
|
+
import { Progress as Progress$1 } from '@base-ui/react/progress';
|
|
18
|
+
import * as react_hook_form from 'react-hook-form';
|
|
19
|
+
import { FieldValues, FieldPath, ControllerProps } from 'react-hook-form';
|
|
20
|
+
import { Tooltip as Tooltip$1 } from '@base-ui/react/tooltip';
|
|
21
|
+
import { Popover as Popover$1 } from '@base-ui/react/popover';
|
|
22
|
+
import { Dialog as Dialog$1 } from '@base-ui/react/dialog';
|
|
23
|
+
import { AlertDialog as AlertDialog$1 } from '@base-ui/react/alert-dialog';
|
|
24
|
+
import { Menu } from '@base-ui/react/menu';
|
|
25
|
+
import { HTMLMotionProps, Transition, MotionProps, MotionValue, Variants } from 'motion/react';
|
|
26
|
+
import { Drawer as Drawer$1 } from 'vaul';
|
|
27
|
+
import { Tabs as Tabs$1 } from '@base-ui/react/tabs';
|
|
28
|
+
import * as _base_ui_react_collapsible from '@base-ui/react/collapsible';
|
|
29
|
+
import { Collapsible as Collapsible$1 } from '@base-ui/react/collapsible';
|
|
30
|
+
import * as _base_ui_react_scroll_area from '@base-ui/react/scroll-area';
|
|
31
|
+
import { ScrollArea as ScrollArea$1 } from '@base-ui/react/scroll-area';
|
|
32
|
+
import * as ResizablePrimitive from 'react-resizable-panels';
|
|
33
|
+
import { Avatar as Avatar$1 } from '@base-ui/react/avatar';
|
|
34
|
+
import { Autocomplete as Autocomplete$1, AutocompleteRootProps } from '@base-ui/react/autocomplete';
|
|
35
|
+
import { Combobox as Combobox$1 } from '@base-ui/react/combobox';
|
|
36
|
+
import { Calendar as Calendar$1, RangeCalendar as RangeCalendar$1 } from 'react-aria-components';
|
|
37
|
+
import { ToasterProps } from 'sonner';
|
|
38
|
+
import * as _use_gesture_react from '@use-gesture/react';
|
|
39
|
+
import { useDrag } from '@use-gesture/react';
|
|
40
|
+
|
|
41
|
+
declare function cn(...inputs: ClassValue[]): string;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Merges refs into a single callback ref.
|
|
45
|
+
* React 19 compatible - handles refs as regular props.
|
|
46
|
+
*/
|
|
47
|
+
declare function composeRefs<T>(...refs: (React$1.Ref<T> | undefined)[]): React$1.RefCallback<T>;
|
|
48
|
+
/**
|
|
49
|
+
* Merges props, handling special cases for className, style, and event handlers.
|
|
50
|
+
* Excludes 'ref' from merging as it's handled separately.
|
|
51
|
+
*/
|
|
52
|
+
declare function mergeProps(slotProps: Record<string, unknown>, childProps: Record<string, unknown>): Record<string, unknown>;
|
|
53
|
+
interface SlotProps extends React$1.HTMLAttributes<HTMLElement> {
|
|
54
|
+
children?: React$1.ReactNode;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Slot component - renders its child element with merged props.
|
|
58
|
+
* Used for the `asChild` pattern where parent props are passed to child.
|
|
59
|
+
* React 19 compatible - accesses ref from props instead of element.ref.
|
|
60
|
+
*/
|
|
61
|
+
declare const Slot: React$1.ForwardRefExoticComponent<SlotProps & React$1.RefAttributes<HTMLElement>>;
|
|
62
|
+
/**
|
|
63
|
+
* Slottable component - marks content that should receive slot props.
|
|
64
|
+
* Used when Slot has multiple children and you want to specify which one receives props.
|
|
65
|
+
*/
|
|
66
|
+
declare function Slottable({ children }: {
|
|
67
|
+
children: React$1.ReactNode;
|
|
68
|
+
}): react_jsx_runtime.JSX.Element;
|
|
69
|
+
|
|
70
|
+
type UseControllableStateParams<T> = {
|
|
71
|
+
prop?: T;
|
|
72
|
+
defaultProp?: T;
|
|
73
|
+
onChange?: (value: T) => void;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* Hook for managing controlled/uncontrolled state.
|
|
77
|
+
* Supports both controlled (prop-driven) and uncontrolled (internal state) patterns.
|
|
78
|
+
*/
|
|
79
|
+
declare function useControllableState<T>({ prop, defaultProp, onChange, }: UseControllableStateParams<T>): [T, (value: T) => void];
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Shared motion configuration for consistent animations across the app.
|
|
83
|
+
* Based on practical animation tips from https://emilkowal.ski/ui/7-practical-animation-tips
|
|
84
|
+
*
|
|
85
|
+
* Key principles:
|
|
86
|
+
* 1. Keep UI animations under 300ms
|
|
87
|
+
* 2. Never animate from scale(0) - use 0.9+ for natural feel
|
|
88
|
+
* 3. Use custom easing curves for more impactful animations
|
|
89
|
+
* 4. Make animations origin-aware when possible
|
|
90
|
+
* 5. Use blur to smooth transitions when needed
|
|
91
|
+
*/
|
|
92
|
+
/**
|
|
93
|
+
* Standard easing curves for UI animations.
|
|
94
|
+
* Reference: https://easings.co/
|
|
95
|
+
*/
|
|
96
|
+
declare const easings: {
|
|
97
|
+
/** Smooth deceleration - good for elements entering the screen */
|
|
98
|
+
readonly easeOut: readonly [0.25, 0.1, 0.25, 1];
|
|
99
|
+
/** Smooth acceleration - good for elements leaving the screen */
|
|
100
|
+
readonly easeIn: readonly [0.42, 0, 1, 1];
|
|
101
|
+
/** Smooth both ways - good for hover states and toggles */
|
|
102
|
+
readonly easeInOut: readonly [0.42, 0, 0.58, 1];
|
|
103
|
+
/** Snappy entrance with soft landing - great for modals/dialogs */
|
|
104
|
+
readonly snappy: readonly [0.2, 0, 0, 1];
|
|
105
|
+
/** Bouncy feel - use sparingly for playful interactions */
|
|
106
|
+
readonly bounce: readonly [0.34, 1.56, 0.64, 1];
|
|
107
|
+
/** Quick start, gradual stop - good for quick feedback */
|
|
108
|
+
readonly emphasized: readonly [0.4, 0, 0.2, 1];
|
|
109
|
+
/** Physical feel for exit animations */
|
|
110
|
+
readonly physicalExit: readonly [0.4, 0, 0.6, 1];
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* Duration presets in seconds.
|
|
114
|
+
* Rule: UI animations should be under 300ms (0.3s)
|
|
115
|
+
*/
|
|
116
|
+
declare const durations: {
|
|
117
|
+
/** Instant feedback (button press, toggle) */
|
|
118
|
+
readonly instant: 0.1;
|
|
119
|
+
/** Quick transitions (tooltips, small elements) */
|
|
120
|
+
readonly fast: 0.15;
|
|
121
|
+
/** Standard UI transitions (modals, panels) */
|
|
122
|
+
readonly normal: 0.2;
|
|
123
|
+
/** Deliberate animations (page transitions, complex reveals) */
|
|
124
|
+
readonly slow: 0.3;
|
|
125
|
+
/** Maximum for UI - use rarely */
|
|
126
|
+
readonly deliberate: 0.4;
|
|
127
|
+
};
|
|
128
|
+
/**
|
|
129
|
+
* Spring configurations for physics-based animations.
|
|
130
|
+
* These create more natural, organic motion.
|
|
131
|
+
*/
|
|
132
|
+
declare const springs: {
|
|
133
|
+
/** Snappy spring - good for quick interactions */
|
|
134
|
+
readonly snappy: {
|
|
135
|
+
readonly type: "spring";
|
|
136
|
+
readonly stiffness: 400;
|
|
137
|
+
readonly damping: 30;
|
|
138
|
+
readonly mass: 0.8;
|
|
139
|
+
};
|
|
140
|
+
/** Bouncy spring - good for playful elements */
|
|
141
|
+
readonly bouncy: {
|
|
142
|
+
readonly type: "spring";
|
|
143
|
+
readonly stiffness: 300;
|
|
144
|
+
readonly damping: 20;
|
|
145
|
+
readonly mass: 0.6;
|
|
146
|
+
};
|
|
147
|
+
/** Gentle spring - good for large elements */
|
|
148
|
+
readonly gentle: {
|
|
149
|
+
readonly type: "spring";
|
|
150
|
+
readonly stiffness: 150;
|
|
151
|
+
readonly damping: 25;
|
|
152
|
+
readonly mass: 1;
|
|
153
|
+
};
|
|
154
|
+
/** Stiff spring - good for precise movements */
|
|
155
|
+
readonly stiff: {
|
|
156
|
+
readonly type: "spring";
|
|
157
|
+
readonly stiffness: 500;
|
|
158
|
+
readonly damping: 35;
|
|
159
|
+
readonly mass: 0.5;
|
|
160
|
+
};
|
|
161
|
+
/** Panel/sheet animations */
|
|
162
|
+
readonly panel: {
|
|
163
|
+
readonly type: "spring";
|
|
164
|
+
readonly stiffness: 150;
|
|
165
|
+
readonly damping: 25;
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
/**
|
|
169
|
+
* Pre-configured transitions for common animation patterns.
|
|
170
|
+
*/
|
|
171
|
+
declare const transitions: {
|
|
172
|
+
/** Fast fade for overlays and simple elements */
|
|
173
|
+
readonly fade: {
|
|
174
|
+
duration: 0.15;
|
|
175
|
+
ease: readonly [0.25, 0.1, 0.25, 1];
|
|
176
|
+
};
|
|
177
|
+
/** Standard enter/exit for UI elements */
|
|
178
|
+
readonly enterExit: {
|
|
179
|
+
duration: 0.2;
|
|
180
|
+
ease: readonly [0.25, 0.1, 0.25, 1];
|
|
181
|
+
};
|
|
182
|
+
/** Snappy transition for interactive elements */
|
|
183
|
+
readonly snappy: {
|
|
184
|
+
duration: 0.15;
|
|
185
|
+
ease: readonly [0.2, 0, 0, 1];
|
|
186
|
+
};
|
|
187
|
+
/** Panel slide transition */
|
|
188
|
+
readonly panel: {
|
|
189
|
+
type: "spring";
|
|
190
|
+
stiffness: number;
|
|
191
|
+
damping: number;
|
|
192
|
+
};
|
|
193
|
+
/** Exit transition with physical feel */
|
|
194
|
+
readonly exit: {
|
|
195
|
+
type: "tween";
|
|
196
|
+
duration: 0.2;
|
|
197
|
+
ease: readonly [0.4, 0, 0.6, 1];
|
|
198
|
+
};
|
|
199
|
+
/** Layout animations */
|
|
200
|
+
readonly layout: {
|
|
201
|
+
type: "spring";
|
|
202
|
+
stiffness: number;
|
|
203
|
+
damping: number;
|
|
204
|
+
};
|
|
205
|
+
};
|
|
206
|
+
/**
|
|
207
|
+
* Common animation variants for AnimatePresence patterns.
|
|
208
|
+
* Follows the rule: never animate from scale(0), use 0.9+ instead.
|
|
209
|
+
*/
|
|
210
|
+
declare const variants: {
|
|
211
|
+
/** Fade with subtle scale - good for modals, cards */
|
|
212
|
+
readonly fadeScale: {
|
|
213
|
+
readonly initial: {
|
|
214
|
+
readonly opacity: 0;
|
|
215
|
+
readonly scale: 0.95;
|
|
216
|
+
};
|
|
217
|
+
readonly animate: {
|
|
218
|
+
readonly opacity: 1;
|
|
219
|
+
readonly scale: 1;
|
|
220
|
+
};
|
|
221
|
+
readonly exit: {
|
|
222
|
+
readonly opacity: 0;
|
|
223
|
+
readonly scale: 0.95;
|
|
224
|
+
};
|
|
225
|
+
};
|
|
226
|
+
/** Fade with subtle slide up - good for content reveals */
|
|
227
|
+
readonly fadeSlideUp: {
|
|
228
|
+
readonly initial: {
|
|
229
|
+
readonly opacity: 0;
|
|
230
|
+
readonly y: 8;
|
|
231
|
+
};
|
|
232
|
+
readonly animate: {
|
|
233
|
+
readonly opacity: 1;
|
|
234
|
+
readonly y: 0;
|
|
235
|
+
};
|
|
236
|
+
readonly exit: {
|
|
237
|
+
readonly opacity: 0;
|
|
238
|
+
readonly y: -8;
|
|
239
|
+
};
|
|
240
|
+
};
|
|
241
|
+
/** Fade with subtle slide down - good for dropdowns */
|
|
242
|
+
readonly fadeSlideDown: {
|
|
243
|
+
readonly initial: {
|
|
244
|
+
readonly opacity: 0;
|
|
245
|
+
readonly y: -8;
|
|
246
|
+
};
|
|
247
|
+
readonly animate: {
|
|
248
|
+
readonly opacity: 1;
|
|
249
|
+
readonly y: 0;
|
|
250
|
+
};
|
|
251
|
+
readonly exit: {
|
|
252
|
+
readonly opacity: 0;
|
|
253
|
+
readonly y: 8;
|
|
254
|
+
};
|
|
255
|
+
};
|
|
256
|
+
/** Simple fade - for overlays */
|
|
257
|
+
readonly fade: {
|
|
258
|
+
readonly initial: {
|
|
259
|
+
readonly opacity: 0;
|
|
260
|
+
};
|
|
261
|
+
readonly animate: {
|
|
262
|
+
readonly opacity: 1;
|
|
263
|
+
};
|
|
264
|
+
readonly exit: {
|
|
265
|
+
readonly opacity: 0;
|
|
266
|
+
};
|
|
267
|
+
};
|
|
268
|
+
/** Dock/floating element - scales from bottom */
|
|
269
|
+
readonly floatUp: {
|
|
270
|
+
readonly initial: {
|
|
271
|
+
readonly opacity: 0;
|
|
272
|
+
readonly y: 8;
|
|
273
|
+
readonly scale: 0.98;
|
|
274
|
+
};
|
|
275
|
+
readonly animate: {
|
|
276
|
+
readonly opacity: 1;
|
|
277
|
+
readonly y: 0;
|
|
278
|
+
readonly scale: 1;
|
|
279
|
+
};
|
|
280
|
+
readonly exit: {
|
|
281
|
+
readonly opacity: 0;
|
|
282
|
+
readonly y: 8;
|
|
283
|
+
readonly scale: 0.98;
|
|
284
|
+
};
|
|
285
|
+
};
|
|
286
|
+
};
|
|
287
|
+
|
|
288
|
+
declare const buttonVariants: (props?: ({
|
|
289
|
+
size?: "default" | "icon" | "icon-lg" | "icon-sm" | "icon-xl" | "icon-xs" | "lg" | "sm" | "xl" | "xs" | null | undefined;
|
|
290
|
+
variant?: "link" | "outline" | "default" | "destructive" | "destructive-outline" | "ghost" | "secondary" | null | undefined;
|
|
291
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
292
|
+
interface ButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
293
|
+
variant?: VariantProps<typeof buttonVariants>['variant'];
|
|
294
|
+
size?: VariantProps<typeof buttonVariants>['size'];
|
|
295
|
+
/** When true, merges props onto the child element instead of rendering a button */
|
|
296
|
+
asChild?: boolean;
|
|
297
|
+
}
|
|
298
|
+
declare const Button: React$1.ForwardRefExoticComponent<ButtonProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
299
|
+
|
|
300
|
+
declare const badgeVariants: (props?: ({
|
|
301
|
+
size?: "default" | "lg" | "sm" | null | undefined;
|
|
302
|
+
variant?: "outline" | "default" | "destructive" | "secondary" | "error" | "info" | "success" | "warning" | null | undefined;
|
|
303
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
304
|
+
type BadgeProps = React$1.HTMLAttributes<HTMLSpanElement> & VariantProps<typeof badgeVariants>;
|
|
305
|
+
declare const Badge: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLSpanElement> & VariantProps<(props?: ({
|
|
306
|
+
size?: "default" | "lg" | "sm" | null | undefined;
|
|
307
|
+
variant?: "outline" | "default" | "destructive" | "secondary" | "error" | "info" | "success" | "warning" | null | undefined;
|
|
308
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string> & React$1.RefAttributes<HTMLSpanElement>>;
|
|
309
|
+
|
|
310
|
+
type LabelProps = React$1.ComponentProps<'label'>;
|
|
311
|
+
/**
|
|
312
|
+
* Label component for form controls.
|
|
313
|
+
* Uses a standard HTML label element for maximum compatibility.
|
|
314
|
+
*/
|
|
315
|
+
declare function Label({ className, ...props }: LabelProps): react_jsx_runtime.JSX.Element;
|
|
316
|
+
|
|
317
|
+
type SkeletonProps = React$1.ComponentProps<'div'>;
|
|
318
|
+
declare function Skeleton({ className, ...props }: SkeletonProps): react_jsx_runtime.JSX.Element;
|
|
319
|
+
|
|
320
|
+
declare const cardVariants: (props?: ({
|
|
321
|
+
variant?: "flat" | "default" | "ghost" | "elevated" | "interactive" | null | undefined;
|
|
322
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
323
|
+
interface CardProps extends React$1.ComponentProps<'div'>, VariantProps<typeof cardVariants> {
|
|
324
|
+
}
|
|
325
|
+
declare function Card({ className, variant, ...props }: CardProps): react_jsx_runtime.JSX.Element;
|
|
326
|
+
declare function CardHeader({ className, ...props }: React$1.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
327
|
+
declare function CardTitle({ className, ...props }: React$1.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
328
|
+
declare function CardDescription({ className, ...props }: React$1.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
329
|
+
declare function CardAction({ className, ...props }: React$1.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
330
|
+
declare function CardContent({ className, ...props }: React$1.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
331
|
+
declare function CardFooter({ className, ...props }: React$1.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
332
|
+
|
|
333
|
+
type SeparatorProps = React$1.ComponentProps<typeof Separator$1> & {
|
|
334
|
+
/** @deprecated Base UI handles accessibility automatically */
|
|
335
|
+
decorative?: boolean;
|
|
336
|
+
};
|
|
337
|
+
declare function Separator({ className, orientation, decorative: _decorative, ...props }: SeparatorProps): react_jsx_runtime.JSX.Element;
|
|
338
|
+
|
|
339
|
+
declare const alertVariants: (props?: ({
|
|
340
|
+
variant?: "default" | "destructive" | null | undefined;
|
|
341
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
342
|
+
declare const Alert: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLDivElement> & VariantProps<(props?: ({
|
|
343
|
+
variant?: "default" | "destructive" | null | undefined;
|
|
344
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string> & React$1.RefAttributes<HTMLDivElement>>;
|
|
345
|
+
declare const AlertTitle: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLHeadingElement> & React$1.RefAttributes<HTMLParagraphElement>>;
|
|
346
|
+
declare const AlertDescription: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLParagraphElement> & React$1.RefAttributes<HTMLParagraphElement>>;
|
|
347
|
+
|
|
348
|
+
type InputProps = Omit<Input$1.Props & React$1.RefAttributes<HTMLInputElement>, 'size'> & {
|
|
349
|
+
size?: 'sm' | 'default' | 'lg' | number;
|
|
350
|
+
unstyled?: boolean;
|
|
351
|
+
};
|
|
352
|
+
declare function Input({ className, size, unstyled, ...props }: InputProps): react_jsx_runtime.JSX.Element;
|
|
353
|
+
|
|
354
|
+
type TextareaProps = React$1.ComponentProps<'textarea'> & {
|
|
355
|
+
size?: 'sm' | 'default' | 'lg' | number;
|
|
356
|
+
unstyled?: boolean;
|
|
357
|
+
};
|
|
358
|
+
declare function Textarea({ className, size, unstyled, ...props }: TextareaProps): react_jsx_runtime.JSX.Element;
|
|
359
|
+
|
|
360
|
+
type CheckboxProps = Checkbox$1.Root.Props;
|
|
361
|
+
declare const Checkbox: React$1.ForwardRefExoticComponent<_base_ui_react_checkbox.CheckboxRootProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
362
|
+
|
|
363
|
+
type CheckboxGroupProps = CheckboxGroup$1.Props;
|
|
364
|
+
declare function CheckboxGroup({ className, ...props }: CheckboxGroupProps): react_jsx_runtime.JSX.Element;
|
|
365
|
+
|
|
366
|
+
type RadioGroupProps = RadioGroup$1.Props;
|
|
367
|
+
type RadioProps = Radio$1.Root.Props;
|
|
368
|
+
declare function RadioGroup({ className, ...props }: RadioGroupProps): react_jsx_runtime.JSX.Element;
|
|
369
|
+
declare function Radio({ className, ...props }: RadioProps): react_jsx_runtime.JSX.Element;
|
|
370
|
+
|
|
371
|
+
type SwitchProps = React$1.ComponentProps<typeof Switch$1.Root>;
|
|
372
|
+
declare function Switch({ className, ...props }: SwitchProps): react_jsx_runtime.JSX.Element;
|
|
373
|
+
|
|
374
|
+
type SelectProps = Omit<Select$1.Root.Props<string>, "onValueChange"> & {
|
|
375
|
+
/** Callback when value changes */
|
|
376
|
+
onValueChange?: (value: string) => void;
|
|
377
|
+
};
|
|
378
|
+
declare function Select({ onValueChange, ...props }: SelectProps): react_jsx_runtime.JSX.Element;
|
|
379
|
+
declare const SelectTrigger: React$1.ForwardRefExoticComponent<_base_ui_react_select.SelectTriggerProps & {
|
|
380
|
+
size?: "sm" | "default" | "lg";
|
|
381
|
+
} & React$1.RefAttributes<HTMLButtonElement>>;
|
|
382
|
+
type SelectValueProps = React$1.ComponentProps<typeof Select$1.Value> & {
|
|
383
|
+
/** Text to display when no value is selected */
|
|
384
|
+
placeholder?: string;
|
|
385
|
+
};
|
|
386
|
+
declare function SelectValue({ className, placeholder, children, ...props }: SelectValueProps): react_jsx_runtime.JSX.Element;
|
|
387
|
+
type SelectPopupProps = Select$1.Popup.Props & {
|
|
388
|
+
sideOffset?: Select$1.Positioner.Props["sideOffset"];
|
|
389
|
+
alignItemWithTrigger?: Select$1.Positioner.Props["alignItemWithTrigger"];
|
|
390
|
+
/** @deprecated Not used in Base UI. Kept for backward compatibility. */
|
|
391
|
+
position?: "item-aligned" | "popper";
|
|
392
|
+
};
|
|
393
|
+
declare function SelectPopup({ className, children, sideOffset, alignItemWithTrigger, position: _position, ...props }: SelectPopupProps): react_jsx_runtime.JSX.Element;
|
|
394
|
+
declare function SelectItem({ className, children, ...props }: Select$1.Item.Props): react_jsx_runtime.JSX.Element;
|
|
395
|
+
declare function SelectSeparator({ className, ...props }: Select$1.Separator.Props): react_jsx_runtime.JSX.Element;
|
|
396
|
+
declare function SelectGroup(props: Select$1.Group.Props): react_jsx_runtime.JSX.Element;
|
|
397
|
+
declare function SelectGroupLabel(props: Select$1.GroupLabel.Props): react_jsx_runtime.JSX.Element;
|
|
398
|
+
type SelectRichItemProps = Select$1.Item.Props & {
|
|
399
|
+
/** Main label text */
|
|
400
|
+
label?: React$1.ReactNode;
|
|
401
|
+
/** Optional description text below the label */
|
|
402
|
+
description?: React$1.ReactNode;
|
|
403
|
+
/** Optional icon element */
|
|
404
|
+
icon?: React$1.ReactNode;
|
|
405
|
+
};
|
|
406
|
+
declare function SelectRichItem({ className, children, label, description, icon, ...props }: SelectRichItemProps): react_jsx_runtime.JSX.Element;
|
|
407
|
+
type SelectFieldItemProps = Select$1.Item.Props & {
|
|
408
|
+
/** Field name to display */
|
|
409
|
+
name: string;
|
|
410
|
+
/** Field type to display as muted text */
|
|
411
|
+
type?: string;
|
|
412
|
+
};
|
|
413
|
+
declare function SelectFieldItem({ className, name, type, ...props }: SelectFieldItemProps): react_jsx_runtime.JSX.Element;
|
|
414
|
+
|
|
415
|
+
type ProgressProps = Omit<React$1.ComponentProps<typeof Progress$1.Root>, 'children'> & {
|
|
416
|
+
className?: string;
|
|
417
|
+
};
|
|
418
|
+
declare function Progress({ className, value, ...props }: ProgressProps): react_jsx_runtime.JSX.Element;
|
|
419
|
+
|
|
420
|
+
declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: react_hook_form.FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React$1.JSX.Element;
|
|
421
|
+
declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => react_jsx_runtime.JSX.Element;
|
|
422
|
+
declare const useFormField: () => {
|
|
423
|
+
invalid: boolean;
|
|
424
|
+
isDirty: boolean;
|
|
425
|
+
isTouched: boolean;
|
|
426
|
+
isValidating: boolean;
|
|
427
|
+
error?: react_hook_form.FieldError;
|
|
428
|
+
id: string;
|
|
429
|
+
name: string;
|
|
430
|
+
formItemId: string;
|
|
431
|
+
formDescriptionId: string;
|
|
432
|
+
formMessageId: string;
|
|
433
|
+
};
|
|
434
|
+
declare function FormItem({ className, ...props }: React$1.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
435
|
+
declare function FormLabel({ className, ...props }: React$1.ComponentProps<typeof Label>): react_jsx_runtime.JSX.Element;
|
|
436
|
+
declare function FormControl$1({ ...props }: React$1.ComponentProps<typeof Slot>): react_jsx_runtime.JSX.Element;
|
|
437
|
+
declare function FormDescription({ className, ...props }: React$1.ComponentProps<'p'>): react_jsx_runtime.JSX.Element;
|
|
438
|
+
declare function FormMessage({ className, ...props }: React$1.ComponentProps<'p'>): react_jsx_runtime.JSX.Element | null;
|
|
439
|
+
|
|
440
|
+
type FormControlLayout = 'stacked' | 'floating';
|
|
441
|
+
interface FormControlProps {
|
|
442
|
+
children: React$1.ReactElement;
|
|
443
|
+
label: string;
|
|
444
|
+
id?: string;
|
|
445
|
+
layout?: FormControlLayout;
|
|
446
|
+
error?: string;
|
|
447
|
+
className?: string;
|
|
448
|
+
}
|
|
449
|
+
declare function FormControl({ children, label, id, layout, error, className }: FormControlProps): react_jsx_runtime.JSX.Element;
|
|
450
|
+
|
|
451
|
+
declare function InputGroup({ className, ...props }: React$1.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
452
|
+
declare const inputGroupAddonVariants: (props?: ({
|
|
453
|
+
align?: "inline-end" | "inline-start" | "block-end" | "block-start" | null | undefined;
|
|
454
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
455
|
+
declare function InputGroupAddon({ className, align, ...props }: React$1.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>): react_jsx_runtime.JSX.Element;
|
|
456
|
+
declare function InputGroupText({ className, ...props }: React$1.ComponentProps<"span">): react_jsx_runtime.JSX.Element;
|
|
457
|
+
declare function InputGroupInput({ className, ...props }: InputProps): react_jsx_runtime.JSX.Element;
|
|
458
|
+
declare function InputGroupTextarea({ className, ...props }: TextareaProps): react_jsx_runtime.JSX.Element;
|
|
459
|
+
|
|
460
|
+
interface FieldProps {
|
|
461
|
+
/** Field label text */
|
|
462
|
+
label: string;
|
|
463
|
+
/** Optional description text shown below the control */
|
|
464
|
+
description?: string;
|
|
465
|
+
/** Error message - shows in destructive color */
|
|
466
|
+
error?: string;
|
|
467
|
+
/** Shows required indicator (*) after label */
|
|
468
|
+
required?: boolean;
|
|
469
|
+
/** HTML id for the form control - used for label's htmlFor */
|
|
470
|
+
htmlFor?: string;
|
|
471
|
+
/** Additional className for the wrapper */
|
|
472
|
+
className?: string;
|
|
473
|
+
/** The form control (InputGroup, Input, Select, etc.) */
|
|
474
|
+
children: React.ReactNode;
|
|
475
|
+
}
|
|
476
|
+
/**
|
|
477
|
+
* Field wraps a form control with label, description, and error message.
|
|
478
|
+
* Works standalone without any form library dependency.
|
|
479
|
+
*
|
|
480
|
+
* @example
|
|
481
|
+
* ```tsx
|
|
482
|
+
* <Field label="Email" required error={errors.email} htmlFor="email">
|
|
483
|
+
* <InputGroup>
|
|
484
|
+
* <InputGroupAddon><Mail /></InputGroupAddon>
|
|
485
|
+
* <InputGroupInput id="email" type="email" placeholder="name@example.com" />
|
|
486
|
+
* </InputGroup>
|
|
487
|
+
* </Field>
|
|
488
|
+
* ```
|
|
489
|
+
*/
|
|
490
|
+
declare function Field({ label, description, error, required, htmlFor, className, children, }: FieldProps): react_jsx_runtime.JSX.Element;
|
|
491
|
+
/**
|
|
492
|
+
* FieldRow is a horizontal layout variant for inline controls like checkboxes and switches.
|
|
493
|
+
* Places label beside the control instead of above.
|
|
494
|
+
*
|
|
495
|
+
* @example
|
|
496
|
+
* ```tsx
|
|
497
|
+
* <FieldRow label="Enable notifications" description="Receive email updates" htmlFor="notifications">
|
|
498
|
+
* <Switch id="notifications" />
|
|
499
|
+
* </FieldRow>
|
|
500
|
+
* ```
|
|
501
|
+
*/
|
|
502
|
+
interface FieldRowProps extends Omit<FieldProps, 'required'> {
|
|
503
|
+
/** Position of the label relative to the control */
|
|
504
|
+
labelPosition?: 'start' | 'end';
|
|
505
|
+
}
|
|
506
|
+
declare function FieldRow({ label, description, error, labelPosition, htmlFor, className, children, }: FieldRowProps): react_jsx_runtime.JSX.Element;
|
|
507
|
+
|
|
508
|
+
type TooltipProviderProps = React$1.ComponentProps<typeof Tooltip$1.Provider> & {
|
|
509
|
+
/** @deprecated Use delay instead */
|
|
510
|
+
delayDuration?: number;
|
|
511
|
+
};
|
|
512
|
+
declare function TooltipProvider({ delay, delayDuration, ...props }: TooltipProviderProps): react_jsx_runtime.JSX.Element;
|
|
513
|
+
type TooltipProps = React$1.ComponentProps<typeof Tooltip$1.Root> & {
|
|
514
|
+
/** @deprecated Use delay on Trigger instead */
|
|
515
|
+
delayDuration?: number;
|
|
516
|
+
};
|
|
517
|
+
declare function Tooltip({ delayDuration: _delayDuration, ...props }: TooltipProps): react_jsx_runtime.JSX.Element;
|
|
518
|
+
type TooltipTriggerProps = Omit<React$1.ComponentProps<typeof Tooltip$1.Trigger>, 'render'> & {
|
|
519
|
+
delay?: number;
|
|
520
|
+
/** When true, merges props onto the child element instead of rendering a button */
|
|
521
|
+
asChild?: boolean;
|
|
522
|
+
};
|
|
523
|
+
declare function TooltipTrigger({ delay, asChild, children, ...props }: TooltipTriggerProps): react_jsx_runtime.JSX.Element;
|
|
524
|
+
type TooltipContentProps = React$1.ComponentProps<typeof Tooltip$1.Popup> & {
|
|
525
|
+
sideOffset?: number;
|
|
526
|
+
showArrow?: boolean;
|
|
527
|
+
side?: 'top' | 'bottom' | 'left' | 'right';
|
|
528
|
+
align?: 'start' | 'center' | 'end';
|
|
529
|
+
};
|
|
530
|
+
declare function TooltipContent({ className, sideOffset, showArrow, side, align, children, ...props }: TooltipContentProps): react_jsx_runtime.JSX.Element;
|
|
531
|
+
|
|
532
|
+
declare function Popover({ ...props }: React$1.ComponentProps<typeof Popover$1.Root>): react_jsx_runtime.JSX.Element;
|
|
533
|
+
type PopoverTriggerProps = Omit<React$1.ComponentProps<typeof Popover$1.Trigger>, 'render' | 'nativeButton'> & {
|
|
534
|
+
/** When true, merges props onto the child element instead of rendering a button */
|
|
535
|
+
asChild?: boolean;
|
|
536
|
+
/** Whether the child renders a native button. Defaults to true when asChild is used. */
|
|
537
|
+
nativeButton?: boolean;
|
|
538
|
+
};
|
|
539
|
+
declare function PopoverTrigger({ asChild, nativeButton, children, ...props }: PopoverTriggerProps): react_jsx_runtime.JSX.Element;
|
|
540
|
+
type PopoverContentProps = React$1.ComponentProps<typeof Popover$1.Popup> & {
|
|
541
|
+
align?: 'start' | 'center' | 'end';
|
|
542
|
+
sideOffset?: number;
|
|
543
|
+
showArrow?: boolean;
|
|
544
|
+
side?: 'top' | 'bottom' | 'left' | 'right';
|
|
545
|
+
/** @deprecated Base UI uses different focus management */
|
|
546
|
+
onOpenAutoFocus?: (e: Event) => void;
|
|
547
|
+
/** @deprecated Base UI uses different focus management */
|
|
548
|
+
onCloseAutoFocus?: (e: Event) => void;
|
|
549
|
+
/** @deprecated Use onOpenChange on Root instead */
|
|
550
|
+
onFocusOutside?: (e: Event) => void;
|
|
551
|
+
/** @deprecated Use onOpenChange on Root instead */
|
|
552
|
+
onEscapeKeyDown?: () => void;
|
|
553
|
+
};
|
|
554
|
+
declare function PopoverContent({ className, align, sideOffset, showArrow, side, children, onOpenAutoFocus: _onOpenAutoFocus, onCloseAutoFocus: _onCloseAutoFocus, onFocusOutside: _onFocusOutside, onEscapeKeyDown: _onEscapeKeyDown, ...props }: PopoverContentProps): react_jsx_runtime.JSX.Element;
|
|
555
|
+
/**
|
|
556
|
+
* PopoverAnchor - placeholder for positioning anchor.
|
|
557
|
+
* @deprecated Base UI Popover positions relative to Trigger by default.
|
|
558
|
+
* For custom anchoring, use Popover.Positioner with anchor prop.
|
|
559
|
+
*/
|
|
560
|
+
declare function PopoverAnchor({ ...props }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
561
|
+
|
|
562
|
+
declare const Dialog: typeof Dialog$1.Root;
|
|
563
|
+
declare function DialogPortal({ keepMounted, ...props }: Dialog$1.Portal.Props): react_jsx_runtime.JSX.Element;
|
|
564
|
+
type DialogTriggerProps = Omit<React$1.ComponentProps<typeof Dialog$1.Trigger>, "render" | "nativeButton"> & {
|
|
565
|
+
/** When true, merges props onto the child element instead of rendering a button */
|
|
566
|
+
asChild?: boolean;
|
|
567
|
+
/** Whether the child renders a native button. Defaults to true when asChild is used. */
|
|
568
|
+
nativeButton?: boolean;
|
|
569
|
+
};
|
|
570
|
+
declare function DialogTrigger({ asChild, nativeButton, children, ...props }: DialogTriggerProps): react_jsx_runtime.JSX.Element;
|
|
571
|
+
type DialogCloseProps = Omit<React$1.ComponentProps<typeof Dialog$1.Close>, "render" | "nativeButton"> & {
|
|
572
|
+
/** When true, merges props onto the child element instead of rendering a button */
|
|
573
|
+
asChild?: boolean;
|
|
574
|
+
/** Whether the child renders a native button. Defaults to true when asChild is used. */
|
|
575
|
+
nativeButton?: boolean;
|
|
576
|
+
};
|
|
577
|
+
declare function DialogClose({ asChild, nativeButton, children, ...props }: DialogCloseProps): react_jsx_runtime.JSX.Element;
|
|
578
|
+
declare function DialogBackdrop({ className, ...props }: Dialog$1.Backdrop.Props): react_jsx_runtime.JSX.Element;
|
|
579
|
+
declare function DialogPopup({ className, children, showCloseButton, bottomStickOnMobile, ...props }: Dialog$1.Popup.Props & {
|
|
580
|
+
showCloseButton?: boolean;
|
|
581
|
+
bottomStickOnMobile?: boolean;
|
|
582
|
+
}): react_jsx_runtime.JSX.Element;
|
|
583
|
+
declare function DialogHeader({ className, ...props }: React$1.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
584
|
+
declare function DialogFooter({ className, variant, ...props }: React$1.ComponentProps<"div"> & {
|
|
585
|
+
variant?: "default" | "bare";
|
|
586
|
+
}): react_jsx_runtime.JSX.Element;
|
|
587
|
+
declare function DialogTitle({ className, ...props }: Dialog$1.Title.Props): react_jsx_runtime.JSX.Element;
|
|
588
|
+
declare function DialogDescription({ className, ...props }: Dialog$1.Description.Props): react_jsx_runtime.JSX.Element;
|
|
589
|
+
|
|
590
|
+
declare function AlertDialog({ ...props }: React$1.ComponentProps<typeof AlertDialog$1.Root>): react_jsx_runtime.JSX.Element;
|
|
591
|
+
type AlertDialogTriggerProps = Omit<React$1.ComponentProps<typeof AlertDialog$1.Trigger>, 'render' | 'nativeButton'> & {
|
|
592
|
+
/** When true, merges props onto the child element instead of rendering a button */
|
|
593
|
+
asChild?: boolean;
|
|
594
|
+
/** Whether the child renders a native button. Defaults to true when asChild is used. */
|
|
595
|
+
nativeButton?: boolean;
|
|
596
|
+
};
|
|
597
|
+
declare function AlertDialogTrigger({ asChild, nativeButton, children, ...props }: AlertDialogTriggerProps): react_jsx_runtime.JSX.Element;
|
|
598
|
+
declare function AlertDialogPortal({ keepMounted, ...props }: React$1.ComponentProps<typeof AlertDialog$1.Portal>): react_jsx_runtime.JSX.Element;
|
|
599
|
+
declare function AlertDialogContent({ className, children, ...props }: React$1.ComponentProps<typeof AlertDialog$1.Popup>): react_jsx_runtime.JSX.Element;
|
|
600
|
+
declare function AlertDialogHeader({ className, ...props }: React$1.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
601
|
+
declare function AlertDialogFooter({ className, ...props }: React$1.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
602
|
+
declare function AlertDialogTitle({ className, ...props }: React$1.ComponentProps<typeof AlertDialog$1.Title>): react_jsx_runtime.JSX.Element;
|
|
603
|
+
declare function AlertDialogDescription({ className, ...props }: React$1.ComponentProps<typeof AlertDialog$1.Description>): react_jsx_runtime.JSX.Element;
|
|
604
|
+
/**
|
|
605
|
+
* AlertDialogAction - A button that performs the primary action and closes the dialog.
|
|
606
|
+
* Wraps AlertDialogPrimitive.Close with primary button styling.
|
|
607
|
+
*/
|
|
608
|
+
declare function AlertDialogAction({ className, ...props }: React$1.ComponentProps<typeof AlertDialog$1.Close>): react_jsx_runtime.JSX.Element;
|
|
609
|
+
/**
|
|
610
|
+
* AlertDialogCancel - A button that cancels the action and closes the dialog.
|
|
611
|
+
* Wraps AlertDialogPrimitive.Close with outline button styling.
|
|
612
|
+
*/
|
|
613
|
+
declare function AlertDialogCancel({ className, ...props }: React$1.ComponentProps<typeof AlertDialog$1.Close>): react_jsx_runtime.JSX.Element;
|
|
614
|
+
|
|
615
|
+
declare function DropdownMenu({ ...props }: React$1.ComponentProps<typeof Menu.Root>): react_jsx_runtime.JSX.Element;
|
|
616
|
+
declare function DropdownMenuPortal({ ...props }: React$1.ComponentProps<typeof Menu.Portal>): react_jsx_runtime.JSX.Element;
|
|
617
|
+
type DropdownMenuTriggerProps = Omit<React$1.ComponentProps<typeof Menu.Trigger>, 'render' | 'nativeButton'> & {
|
|
618
|
+
/** When true, merges props onto the child element instead of rendering a button */
|
|
619
|
+
asChild?: boolean;
|
|
620
|
+
/** Whether the child renders a native button. Defaults to true when asChild is used. */
|
|
621
|
+
nativeButton?: boolean;
|
|
622
|
+
};
|
|
623
|
+
declare function DropdownMenuTrigger({ asChild, nativeButton, children, ...props }: DropdownMenuTriggerProps): react_jsx_runtime.JSX.Element;
|
|
624
|
+
type DropdownMenuContentProps = React$1.ComponentProps<typeof Menu.Popup> & {
|
|
625
|
+
sideOffset?: number;
|
|
626
|
+
side?: 'top' | 'bottom' | 'left' | 'right';
|
|
627
|
+
align?: 'start' | 'center' | 'end';
|
|
628
|
+
/** @deprecated Not supported in Base UI */
|
|
629
|
+
onPointerDown?: (e: React$1.PointerEvent) => void;
|
|
630
|
+
/** @deprecated Not supported in Base UI */
|
|
631
|
+
onPointerDownOutside?: (e: Event) => void;
|
|
632
|
+
/** @deprecated Not supported in Base UI */
|
|
633
|
+
onCloseAutoFocus?: (e: Event) => void;
|
|
634
|
+
/** @deprecated Base UI menus mount on open automatically */
|
|
635
|
+
forceMount?: boolean;
|
|
636
|
+
};
|
|
637
|
+
declare function DropdownMenuContent({ className, sideOffset, side, align, onPointerDown: _onPointerDown, onPointerDownOutside: _onPointerDownOutside, onCloseAutoFocus: _onCloseAutoFocus, forceMount: _forceMount, ...props }: DropdownMenuContentProps): react_jsx_runtime.JSX.Element;
|
|
638
|
+
declare function DropdownMenuGroup({ ...props }: React$1.ComponentProps<typeof Menu.Group>): react_jsx_runtime.JSX.Element;
|
|
639
|
+
type DropdownMenuItemProps = Omit<React$1.ComponentProps<typeof Menu.Item>, 'render'> & {
|
|
640
|
+
inset?: boolean;
|
|
641
|
+
variant?: 'default' | 'destructive';
|
|
642
|
+
/** When true, merges props onto the child element instead of rendering a div */
|
|
643
|
+
asChild?: boolean;
|
|
644
|
+
};
|
|
645
|
+
declare function DropdownMenuItem({ className, inset, variant, asChild, children, onClick, ...props }: DropdownMenuItemProps): react_jsx_runtime.JSX.Element;
|
|
646
|
+
declare function DropdownMenuCheckboxItem({ className, children, checked, ...props }: React$1.ComponentProps<typeof Menu.CheckboxItem>): react_jsx_runtime.JSX.Element;
|
|
647
|
+
declare function DropdownMenuRadioGroup({ ...props }: React$1.ComponentProps<typeof Menu.RadioGroup>): react_jsx_runtime.JSX.Element;
|
|
648
|
+
declare function DropdownMenuRadioItem({ className, children, ...props }: React$1.ComponentProps<typeof Menu.RadioItem>): react_jsx_runtime.JSX.Element;
|
|
649
|
+
declare function DropdownMenuLabel({ className, inset, ...props }: React$1.ComponentProps<typeof Menu.GroupLabel> & {
|
|
650
|
+
inset?: boolean;
|
|
651
|
+
}): react_jsx_runtime.JSX.Element;
|
|
652
|
+
declare function DropdownMenuSeparator({ className, ...props }: React$1.ComponentProps<typeof Menu.Separator>): react_jsx_runtime.JSX.Element;
|
|
653
|
+
declare function DropdownMenuShortcut({ className, ...props }: React$1.ComponentProps<'span'>): react_jsx_runtime.JSX.Element;
|
|
654
|
+
declare function DropdownMenuSub({ ...props }: React$1.ComponentProps<typeof Menu.SubmenuRoot>): react_jsx_runtime.JSX.Element;
|
|
655
|
+
declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: React$1.ComponentProps<typeof Menu.SubmenuTrigger> & {
|
|
656
|
+
inset?: boolean;
|
|
657
|
+
}): react_jsx_runtime.JSX.Element;
|
|
658
|
+
declare function DropdownMenuSubContent({ className, ...props }: React$1.ComponentProps<typeof Menu.Popup>): react_jsx_runtime.JSX.Element;
|
|
659
|
+
|
|
660
|
+
type SheetProps = Omit<React$1.ComponentProps<typeof Dialog$1.Root>, 'onOpenChange'> & {
|
|
661
|
+
/** Unique identifier for this sheet in a stack. Auto-generated if not provided. */
|
|
662
|
+
sheetId?: string;
|
|
663
|
+
/** Callback when open state changes - simplified to just boolean for backwards compatibility */
|
|
664
|
+
onOpenChange?: (open: boolean) => void;
|
|
665
|
+
};
|
|
666
|
+
declare function Sheet({ children, sheetId: providedId, ...props }: SheetProps): react_jsx_runtime.JSX.Element;
|
|
667
|
+
type SheetTriggerProps = Omit<React$1.ComponentProps<typeof Dialog$1.Trigger>, 'render' | 'nativeButton'> & {
|
|
668
|
+
/** When true, merges props onto the child element instead of rendering a button */
|
|
669
|
+
asChild?: boolean;
|
|
670
|
+
/** Whether the child renders a native button. Defaults to true when asChild is used. */
|
|
671
|
+
nativeButton?: boolean;
|
|
672
|
+
};
|
|
673
|
+
declare function SheetTrigger({ asChild, nativeButton, children, ...props }: SheetTriggerProps): react_jsx_runtime.JSX.Element;
|
|
674
|
+
type SheetCloseProps = Omit<React$1.ComponentProps<typeof Dialog$1.Close>, 'render' | 'nativeButton'> & {
|
|
675
|
+
/** When true, merges props onto the child element instead of rendering a button */
|
|
676
|
+
asChild?: boolean;
|
|
677
|
+
/** Whether the child renders a native button. Defaults to true when asChild is used. */
|
|
678
|
+
nativeButton?: boolean;
|
|
679
|
+
};
|
|
680
|
+
declare function SheetClose({ asChild, nativeButton, children, ...props }: SheetCloseProps): react_jsx_runtime.JSX.Element;
|
|
681
|
+
declare const sheetVariants: (props?: ({
|
|
682
|
+
side?: "bottom" | "left" | "right" | "top" | null | undefined;
|
|
683
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
684
|
+
type SheetContentProps = Omit<React$1.ComponentProps<typeof Dialog$1.Popup>, 'children'> & VariantProps<typeof sheetVariants> & HTMLMotionProps<'div'> & {
|
|
685
|
+
transition?: Transition;
|
|
686
|
+
overlay?: boolean;
|
|
687
|
+
/** Whether to show the close button. Defaults to true. */
|
|
688
|
+
showClose?: boolean;
|
|
689
|
+
children?: React$1.ReactNode;
|
|
690
|
+
/** @deprecated Base UI manages mounting automatically */
|
|
691
|
+
forceMount?: boolean;
|
|
692
|
+
/** @deprecated Use onOpenChange on Root instead */
|
|
693
|
+
onInteractOutside?: (e: Event) => void;
|
|
694
|
+
/** @deprecated Use onOpenChange on Root instead */
|
|
695
|
+
onPointerDownOutside?: (e: Event) => void;
|
|
696
|
+
/** @deprecated Use onOpenChange on Root instead */
|
|
697
|
+
onEscapeKeyDown?: (e: KeyboardEvent) => void;
|
|
698
|
+
/** @deprecated Use onOpenChange on Root instead */
|
|
699
|
+
onFocusOutside?: (e: Event) => void;
|
|
700
|
+
};
|
|
701
|
+
declare function SheetContent({ side, className, transition, overlay, showClose, children, forceMount: _forceMount, onInteractOutside: _onInteractOutside, onPointerDownOutside: _onPointerDownOutside, onEscapeKeyDown: _onEscapeKeyDown, onFocusOutside: _onFocusOutside, ...props }: SheetContentProps): react_jsx_runtime.JSX.Element;
|
|
702
|
+
type SheetHeaderProps = React$1.ComponentProps<'div'>;
|
|
703
|
+
declare function SheetHeader({ className, ...props }: SheetHeaderProps): react_jsx_runtime.JSX.Element;
|
|
704
|
+
type SheetFooterProps = React$1.ComponentProps<'div'>;
|
|
705
|
+
declare function SheetFooter({ className, ...props }: SheetFooterProps): react_jsx_runtime.JSX.Element;
|
|
706
|
+
type SheetTitleProps = React$1.ComponentProps<typeof Dialog$1.Title>;
|
|
707
|
+
declare function SheetTitle({ className, ...props }: SheetTitleProps): react_jsx_runtime.JSX.Element;
|
|
708
|
+
type SheetDescriptionProps = React$1.ComponentProps<typeof Dialog$1.Description>;
|
|
709
|
+
declare function SheetDescription({ className, ...props }: SheetDescriptionProps): react_jsx_runtime.JSX.Element;
|
|
710
|
+
|
|
711
|
+
declare function Drawer({ ...props }: React$1.ComponentProps<typeof Drawer$1.Root>): react_jsx_runtime.JSX.Element;
|
|
712
|
+
declare function DrawerTrigger({ ...props }: React$1.ComponentProps<typeof Drawer$1.Trigger>): react_jsx_runtime.JSX.Element;
|
|
713
|
+
declare function DrawerPortal({ ...props }: React$1.ComponentProps<typeof Drawer$1.Portal>): react_jsx_runtime.JSX.Element;
|
|
714
|
+
declare function DrawerClose({ ...props }: React$1.ComponentProps<typeof Drawer$1.Close>): react_jsx_runtime.JSX.Element;
|
|
715
|
+
declare function DrawerOverlay({ className, ...props }: React$1.ComponentProps<typeof Drawer$1.Overlay>): react_jsx_runtime.JSX.Element;
|
|
716
|
+
declare function DrawerContent({ className, children, ...props }: React$1.ComponentProps<typeof Drawer$1.Content>): react_jsx_runtime.JSX.Element;
|
|
717
|
+
declare function DrawerHeader({ className, ...props }: React$1.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
718
|
+
declare function DrawerFooter({ className, ...props }: React$1.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
719
|
+
declare function DrawerTitle({ className, ...props }: React$1.ComponentProps<typeof Drawer$1.Title>): react_jsx_runtime.JSX.Element;
|
|
720
|
+
declare function DrawerDescription({ className, ...props }: React$1.ComponentProps<typeof Drawer$1.Description>): react_jsx_runtime.JSX.Element;
|
|
721
|
+
|
|
722
|
+
declare function Tabs({ className, ...props }: React$1.ComponentProps<typeof Tabs$1.Root>): react_jsx_runtime.JSX.Element;
|
|
723
|
+
declare function TabsList({ className, ...props }: React$1.ComponentProps<typeof Tabs$1.List>): react_jsx_runtime.JSX.Element;
|
|
724
|
+
declare function TabsTrigger({ className, ...props }: React$1.ComponentProps<typeof Tabs$1.Tab>): react_jsx_runtime.JSX.Element;
|
|
725
|
+
declare function TabsContent({ className, ...props }: React$1.ComponentProps<typeof Tabs$1.Panel>): react_jsx_runtime.JSX.Element;
|
|
726
|
+
|
|
727
|
+
/**
|
|
728
|
+
* Collapsible Root
|
|
729
|
+
* Container for collapsible content with open/close state management.
|
|
730
|
+
*/
|
|
731
|
+
declare function Collapsible({ className, ...props }: Collapsible$1.Root.Props): react_jsx_runtime.JSX.Element;
|
|
732
|
+
/**
|
|
733
|
+
* CollapsibleTrigger
|
|
734
|
+
* Button that toggles the collapsible open/closed state.
|
|
735
|
+
* Supports asChild pattern for custom trigger elements.
|
|
736
|
+
*/
|
|
737
|
+
declare const CollapsibleTrigger: React$1.ForwardRefExoticComponent<Omit<_base_ui_react_collapsible.CollapsibleTriggerProps, "render" | "nativeButton"> & {
|
|
738
|
+
/** When true, merges props onto the child element instead of rendering a button */
|
|
739
|
+
asChild?: boolean;
|
|
740
|
+
/** Whether the child renders a native button. Defaults to true when asChild is used. */
|
|
741
|
+
nativeButton?: boolean;
|
|
742
|
+
} & React$1.RefAttributes<HTMLButtonElement>>;
|
|
743
|
+
/**
|
|
744
|
+
* CollapsiblePanel
|
|
745
|
+
* Animated container for collapsible content.
|
|
746
|
+
* Uses CSS height transitions with Base UI's data attributes.
|
|
747
|
+
*/
|
|
748
|
+
declare const CollapsiblePanel: React$1.ForwardRefExoticComponent<_base_ui_react_collapsible.CollapsiblePanelProps & {
|
|
749
|
+
/** Additional className for the inner content wrapper */
|
|
750
|
+
innerClassName?: string;
|
|
751
|
+
} & React$1.RefAttributes<HTMLDivElement>>;
|
|
752
|
+
|
|
753
|
+
declare const ScrollArea: React$1.ForwardRefExoticComponent<_base_ui_react_scroll_area.ScrollAreaRootProps & {
|
|
754
|
+
scrollFade?: boolean;
|
|
755
|
+
scrollbarGutter?: boolean;
|
|
756
|
+
} & React$1.RefAttributes<HTMLDivElement>>;
|
|
757
|
+
declare function ScrollBar({ className, orientation, ...props }: ScrollArea$1.Scrollbar.Props): react_jsx_runtime.JSX.Element;
|
|
758
|
+
|
|
759
|
+
declare function ResizablePanelGroup({ className, ...props }: React$1.ComponentProps<typeof ResizablePrimitive.PanelGroup>): react_jsx_runtime.JSX.Element;
|
|
760
|
+
declare function ResizablePanel({ ...props }: React$1.ComponentProps<typeof ResizablePrimitive.Panel>): react_jsx_runtime.JSX.Element;
|
|
761
|
+
declare function ResizableHandle({ withHandle, className, ...props }: React$1.ComponentProps<typeof ResizablePrimitive.PanelResizeHandle> & {
|
|
762
|
+
withHandle?: boolean;
|
|
763
|
+
}): react_jsx_runtime.JSX.Element;
|
|
764
|
+
|
|
765
|
+
declare function Table({ className, ...props }: React$1.ComponentProps<'table'> & {
|
|
766
|
+
containerProps?: React$1.ComponentProps<'div'>;
|
|
767
|
+
}): react_jsx_runtime.JSX.Element;
|
|
768
|
+
declare function TableHeader({ className, ...props }: React$1.ComponentProps<'thead'>): react_jsx_runtime.JSX.Element;
|
|
769
|
+
declare function TableBody({ className, ...props }: React$1.ComponentProps<'tbody'>): react_jsx_runtime.JSX.Element;
|
|
770
|
+
declare function TableFooter({ className, ...props }: React$1.ComponentProps<'tfoot'>): react_jsx_runtime.JSX.Element;
|
|
771
|
+
declare function TableRow({ className, ...props }: React$1.ComponentProps<'tr'>): react_jsx_runtime.JSX.Element;
|
|
772
|
+
declare function TableHead({ className, ...props }: React$1.ComponentProps<'th'>): react_jsx_runtime.JSX.Element;
|
|
773
|
+
declare function TableCell({ className, ...props }: React$1.ComponentProps<'td'>): react_jsx_runtime.JSX.Element;
|
|
774
|
+
declare function TableCaption({ className, ...props }: React$1.ComponentProps<'caption'>): react_jsx_runtime.JSX.Element;
|
|
775
|
+
|
|
776
|
+
declare function Pagination({ className, ...props }: React$1.ComponentProps<'nav'>): react_jsx_runtime.JSX.Element;
|
|
777
|
+
declare function PaginationContent({ className, ...props }: React$1.ComponentProps<'ul'>): react_jsx_runtime.JSX.Element;
|
|
778
|
+
declare function PaginationItem({ ...props }: React$1.ComponentProps<'li'>): react_jsx_runtime.JSX.Element;
|
|
779
|
+
type PaginationLinkProps = {
|
|
780
|
+
isActive?: boolean;
|
|
781
|
+
isDisabled?: boolean;
|
|
782
|
+
} & Pick<React$1.ComponentProps<typeof Button>, 'size'> & React$1.ComponentProps<'a'>;
|
|
783
|
+
declare function PaginationLink({ className, isActive, size, ...props }: PaginationLinkProps): react_jsx_runtime.JSX.Element;
|
|
784
|
+
declare function PaginationPrevious({ className, ...props }: React$1.ComponentProps<typeof PaginationLink>): react_jsx_runtime.JSX.Element;
|
|
785
|
+
declare function PaginationNext({ className, ...props }: React$1.ComponentProps<typeof PaginationLink>): react_jsx_runtime.JSX.Element;
|
|
786
|
+
declare function PaginationEllipsis({ className, ...props }: React$1.ComponentProps<'span'>): react_jsx_runtime.JSX.Element;
|
|
787
|
+
|
|
788
|
+
declare function Breadcrumb({ ...props }: React$1.ComponentProps<'nav'>): react_jsx_runtime.JSX.Element;
|
|
789
|
+
declare function BreadcrumbList({ className, ...props }: React$1.ComponentProps<'ol'>): react_jsx_runtime.JSX.Element;
|
|
790
|
+
declare function BreadcrumbItem({ className, ...props }: React$1.ComponentProps<'li'>): react_jsx_runtime.JSX.Element;
|
|
791
|
+
declare function BreadcrumbLink({ asChild, className, ...props }: React$1.ComponentProps<'a'> & {
|
|
792
|
+
asChild?: boolean;
|
|
793
|
+
}): react_jsx_runtime.JSX.Element;
|
|
794
|
+
declare function BreadcrumbPage({ className, ...props }: React$1.ComponentProps<'span'>): react_jsx_runtime.JSX.Element;
|
|
795
|
+
declare function BreadcrumbSeparator({ children, className, ...props }: React$1.ComponentProps<'li'>): react_jsx_runtime.JSX.Element;
|
|
796
|
+
declare function BreadcrumbEllipsis({ className, ...props }: React$1.ComponentProps<'span'>): react_jsx_runtime.JSX.Element;
|
|
797
|
+
|
|
798
|
+
declare function Avatar({ className, ...props }: React$1.ComponentProps<typeof Avatar$1.Root>): react_jsx_runtime.JSX.Element;
|
|
799
|
+
declare function AvatarImage({ className, ...props }: React$1.ComponentProps<typeof Avatar$1.Image>): react_jsx_runtime.JSX.Element;
|
|
800
|
+
type AvatarFallbackProps = React$1.ComponentProps<typeof Avatar$1.Fallback> & {
|
|
801
|
+
/** @deprecated Use delay prop instead */
|
|
802
|
+
delayMs?: number;
|
|
803
|
+
};
|
|
804
|
+
declare function AvatarFallback({ className, delayMs, delay, ...props }: AvatarFallbackProps): react_jsx_runtime.JSX.Element;
|
|
805
|
+
|
|
806
|
+
declare const Autocomplete: typeof Autocomplete$1.Root;
|
|
807
|
+
declare function AutocompleteInput({ className, showTrigger, showClear, startAddon, size, ...props }: Omit<Autocomplete$1.Input.Props, "size"> & {
|
|
808
|
+
showTrigger?: boolean;
|
|
809
|
+
showClear?: boolean;
|
|
810
|
+
startAddon?: React.ReactNode;
|
|
811
|
+
size?: "sm" | "default" | "lg";
|
|
812
|
+
ref?: React.Ref<HTMLInputElement>;
|
|
813
|
+
}): react_jsx_runtime.JSX.Element;
|
|
814
|
+
declare function AutocompletePopup({ className, children, sideOffset, ...props }: Autocomplete$1.Popup.Props & {
|
|
815
|
+
sideOffset?: number;
|
|
816
|
+
}): react_jsx_runtime.JSX.Element;
|
|
817
|
+
declare function AutocompleteItem({ className, children, ...props }: Autocomplete$1.Item.Props): react_jsx_runtime.JSX.Element;
|
|
818
|
+
declare function AutocompleteSeparator({ className, ...props }: Autocomplete$1.Separator.Props): react_jsx_runtime.JSX.Element;
|
|
819
|
+
declare function AutocompleteGroup({ className, ...props }: Autocomplete$1.Group.Props): react_jsx_runtime.JSX.Element;
|
|
820
|
+
declare function AutocompleteEmpty({ className, ...props }: Autocomplete$1.Empty.Props): react_jsx_runtime.JSX.Element;
|
|
821
|
+
declare function AutocompleteList({ className, ...props }: Autocomplete$1.List.Props): react_jsx_runtime.JSX.Element;
|
|
822
|
+
|
|
823
|
+
type CommandProps<ItemValue> = Omit<AutocompleteRootProps<ItemValue>, "autoHighlight" | "keepHighlight" | "open"> & {
|
|
824
|
+
className?: string;
|
|
825
|
+
autoHighlight?: boolean | "always";
|
|
826
|
+
keepHighlight?: boolean;
|
|
827
|
+
open?: boolean;
|
|
828
|
+
};
|
|
829
|
+
declare function Command<ItemValue>({ autoHighlight, keepHighlight, open, ...props }: CommandProps<ItemValue>): react_jsx_runtime.JSX.Element;
|
|
830
|
+
type CommandInputProps = Omit<React$1.ComponentProps<typeof AutocompleteInput>, "onChange"> & {
|
|
831
|
+
value?: string;
|
|
832
|
+
onValueChange?: (value: string) => void;
|
|
833
|
+
};
|
|
834
|
+
declare function CommandInput({ className, placeholder, value, onValueChange, ...props }: CommandInputProps): react_jsx_runtime.JSX.Element;
|
|
835
|
+
declare function CommandList({ className, ...props }: React$1.ComponentProps<typeof AutocompleteList>): react_jsx_runtime.JSX.Element;
|
|
836
|
+
declare function CommandEmpty({ className, ...props }: React$1.ComponentProps<typeof AutocompleteEmpty>): react_jsx_runtime.JSX.Element;
|
|
837
|
+
type CommandGroupProps = React$1.ComponentProps<typeof AutocompleteGroup> & {
|
|
838
|
+
/** Group heading label */
|
|
839
|
+
heading?: React$1.ReactNode;
|
|
840
|
+
};
|
|
841
|
+
declare function CommandGroup({ className, heading, children, ...props }: CommandGroupProps): react_jsx_runtime.JSX.Element;
|
|
842
|
+
declare function CommandItem({ className, ...props }: React$1.ComponentProps<typeof AutocompleteItem>): react_jsx_runtime.JSX.Element;
|
|
843
|
+
|
|
844
|
+
declare function Combobox<ItemValue, Multiple extends boolean | undefined = false>(props: Combobox$1.Root.Props<ItemValue, Multiple>): react_jsx_runtime.JSX.Element;
|
|
845
|
+
declare function ComboboxInput({ className, showTrigger, showClear, startAddon, size, ...props }: Omit<Combobox$1.Input.Props, "size"> & {
|
|
846
|
+
showTrigger?: boolean;
|
|
847
|
+
showClear?: boolean;
|
|
848
|
+
startAddon?: React$1.ReactNode;
|
|
849
|
+
size?: "sm" | "default" | "lg" | number;
|
|
850
|
+
ref?: React$1.Ref<HTMLInputElement>;
|
|
851
|
+
}): react_jsx_runtime.JSX.Element;
|
|
852
|
+
declare function ComboboxTrigger({ className, ...props }: Combobox$1.Trigger.Props): react_jsx_runtime.JSX.Element;
|
|
853
|
+
declare function ComboboxPopup({ className, children, sideOffset, ...props }: Combobox$1.Popup.Props & {
|
|
854
|
+
sideOffset?: number;
|
|
855
|
+
}): react_jsx_runtime.JSX.Element;
|
|
856
|
+
declare function ComboboxItem({ className, children, ...props }: Combobox$1.Item.Props): react_jsx_runtime.JSX.Element;
|
|
857
|
+
declare function ComboboxSeparator({ className, ...props }: Combobox$1.Separator.Props): react_jsx_runtime.JSX.Element;
|
|
858
|
+
declare function ComboboxGroup({ className, ...props }: Combobox$1.Group.Props): react_jsx_runtime.JSX.Element;
|
|
859
|
+
declare function ComboboxEmpty({ className, ...props }: Combobox$1.Empty.Props): react_jsx_runtime.JSX.Element;
|
|
860
|
+
declare function ComboboxList({ className, ...props }: Combobox$1.List.Props): react_jsx_runtime.JSX.Element;
|
|
861
|
+
declare const ComboboxContent: typeof ComboboxPopup;
|
|
862
|
+
type ComboboxProps<ItemValue = unknown, Multiple extends boolean | undefined = false> = Combobox$1.Root.Props<ItemValue, Multiple>;
|
|
863
|
+
type ComboboxTriggerProps = Combobox$1.Trigger.Props;
|
|
864
|
+
type ComboboxContentProps = React$1.ComponentProps<typeof ComboboxPopup>;
|
|
865
|
+
type ComboboxInputProps = React$1.ComponentProps<typeof ComboboxInput>;
|
|
866
|
+
type ComboboxListProps = React$1.ComponentProps<typeof ComboboxList>;
|
|
867
|
+
type ComboboxEmptyProps = React$1.ComponentProps<typeof ComboboxEmpty>;
|
|
868
|
+
type ComboboxGroupProps = React$1.ComponentProps<typeof ComboboxGroup>;
|
|
869
|
+
type ComboboxItemProps = React$1.ComponentProps<typeof ComboboxItem>;
|
|
870
|
+
type ComboboxSeparatorProps = React$1.ComponentProps<typeof ComboboxSeparator>;
|
|
871
|
+
|
|
872
|
+
/**
|
|
873
|
+
* Variants for the multi-select component to handle different styles.
|
|
874
|
+
* Uses class-variance-authority (cva) to define different styles based on "variant" prop.
|
|
875
|
+
*/
|
|
876
|
+
declare const multiSelectVariants: (props?: ({
|
|
877
|
+
variant?: "default" | "destructive" | "secondary" | "inverted" | null | undefined;
|
|
878
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
879
|
+
/**
|
|
880
|
+
* Option interface for MultiSelect component
|
|
881
|
+
*/
|
|
882
|
+
interface MultiSelectOption {
|
|
883
|
+
/** The text to display for the option. */
|
|
884
|
+
label: string;
|
|
885
|
+
/** The unique value associated with the option. */
|
|
886
|
+
value: string;
|
|
887
|
+
/** Optional description shown in dropdown but not in selected badge. */
|
|
888
|
+
description?: string | null;
|
|
889
|
+
/** Optional icon component to display alongside the option. */
|
|
890
|
+
icon?: React$1.ComponentType<{
|
|
891
|
+
className?: string;
|
|
892
|
+
}>;
|
|
893
|
+
/** Whether this option is disabled */
|
|
894
|
+
disabled?: boolean;
|
|
895
|
+
/** Custom styling for the option */
|
|
896
|
+
style?: {
|
|
897
|
+
/** Custom badge color */
|
|
898
|
+
badgeColor?: string;
|
|
899
|
+
/** Custom icon color */
|
|
900
|
+
iconColor?: string;
|
|
901
|
+
/** Gradient background for badge */
|
|
902
|
+
gradient?: string;
|
|
903
|
+
};
|
|
904
|
+
}
|
|
905
|
+
/**
|
|
906
|
+
* Group interface for organizing options
|
|
907
|
+
*/
|
|
908
|
+
interface MultiSelectGroup {
|
|
909
|
+
/** Group heading */
|
|
910
|
+
heading: string;
|
|
911
|
+
/** Options in this group */
|
|
912
|
+
options: MultiSelectOption[];
|
|
913
|
+
}
|
|
914
|
+
/**
|
|
915
|
+
* Props for MultiSelect component
|
|
916
|
+
*/
|
|
917
|
+
interface MultiSelectProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof multiSelectVariants> {
|
|
918
|
+
/**
|
|
919
|
+
* An array of option objects or groups to be displayed in the multi-select component.
|
|
920
|
+
*/
|
|
921
|
+
options: MultiSelectOption[] | MultiSelectGroup[];
|
|
922
|
+
/**
|
|
923
|
+
* Callback function triggered when the selected values change.
|
|
924
|
+
* Receives an array of the new selected values.
|
|
925
|
+
*/
|
|
926
|
+
onValueChange: (value: string[]) => void;
|
|
927
|
+
/** The default selected values when the component mounts. */
|
|
928
|
+
defaultValue?: string[];
|
|
929
|
+
/**
|
|
930
|
+
* Placeholder text to be displayed when no values are selected.
|
|
931
|
+
* Optional, defaults to "Select options".
|
|
932
|
+
*/
|
|
933
|
+
placeholder?: string;
|
|
934
|
+
/**
|
|
935
|
+
* Maximum number of items to display. Extra selected items will be summarized.
|
|
936
|
+
* Optional, defaults to 3.
|
|
937
|
+
*/
|
|
938
|
+
maxCount?: number;
|
|
939
|
+
/**
|
|
940
|
+
* If true, shows search functionality in the popover.
|
|
941
|
+
* If false, hides the search input completely.
|
|
942
|
+
* Optional, defaults to true.
|
|
943
|
+
*/
|
|
944
|
+
searchable?: boolean;
|
|
945
|
+
/**
|
|
946
|
+
* Custom empty state message when no options match search.
|
|
947
|
+
* Optional, defaults to "No results found."
|
|
948
|
+
*/
|
|
949
|
+
emptyIndicator?: React$1.ReactNode;
|
|
950
|
+
/**
|
|
951
|
+
* If true, allows the component to grow and shrink with its content.
|
|
952
|
+
* If false, uses fixed width behavior.
|
|
953
|
+
* Optional, defaults to false.
|
|
954
|
+
*/
|
|
955
|
+
autoSize?: boolean;
|
|
956
|
+
/**
|
|
957
|
+
* If true, shows badges in a single line with horizontal scroll.
|
|
958
|
+
* If false, badges wrap to multiple lines.
|
|
959
|
+
* Optional, defaults to false.
|
|
960
|
+
*/
|
|
961
|
+
singleLine?: boolean;
|
|
962
|
+
/**
|
|
963
|
+
* Custom CSS class for the popover content.
|
|
964
|
+
* Optional, can be used to customize popover appearance.
|
|
965
|
+
*/
|
|
966
|
+
popoverClassName?: string;
|
|
967
|
+
/**
|
|
968
|
+
* If true, disables the component completely.
|
|
969
|
+
* Optional, defaults to false.
|
|
970
|
+
*/
|
|
971
|
+
disabled?: boolean;
|
|
972
|
+
/**
|
|
973
|
+
* Responsive configuration for different screen sizes.
|
|
974
|
+
* Allows customizing maxCount and other properties based on viewport.
|
|
975
|
+
* Can be boolean true for default responsive behavior or an object for custom configuration.
|
|
976
|
+
*/
|
|
977
|
+
responsive?: boolean | {
|
|
978
|
+
/** Configuration for mobile devices (< 640px) */
|
|
979
|
+
mobile?: {
|
|
980
|
+
maxCount?: number;
|
|
981
|
+
hideIcons?: boolean;
|
|
982
|
+
compactMode?: boolean;
|
|
983
|
+
};
|
|
984
|
+
/** Configuration for tablet devices (640px - 1024px) */
|
|
985
|
+
tablet?: {
|
|
986
|
+
maxCount?: number;
|
|
987
|
+
hideIcons?: boolean;
|
|
988
|
+
compactMode?: boolean;
|
|
989
|
+
};
|
|
990
|
+
/** Configuration for desktop devices (> 1024px) */
|
|
991
|
+
desktop?: {
|
|
992
|
+
maxCount?: number;
|
|
993
|
+
hideIcons?: boolean;
|
|
994
|
+
compactMode?: boolean;
|
|
995
|
+
};
|
|
996
|
+
};
|
|
997
|
+
/**
|
|
998
|
+
* Minimum width for the component.
|
|
999
|
+
* Optional, defaults to auto-sizing based on content.
|
|
1000
|
+
* When set, component will not shrink below this width.
|
|
1001
|
+
*/
|
|
1002
|
+
minWidth?: string;
|
|
1003
|
+
/**
|
|
1004
|
+
* Maximum width for the component.
|
|
1005
|
+
* Optional, defaults to 100% of container.
|
|
1006
|
+
* Component will not exceed container boundaries.
|
|
1007
|
+
*/
|
|
1008
|
+
maxWidth?: string;
|
|
1009
|
+
/**
|
|
1010
|
+
* Maximum height for the dropdown list area.
|
|
1011
|
+
* Optional, defaults to responsive viewport-based heights.
|
|
1012
|
+
*/
|
|
1013
|
+
dropdownMaxHeight?: string;
|
|
1014
|
+
/**
|
|
1015
|
+
* If true, automatically removes duplicate options based on their value.
|
|
1016
|
+
* Optional, defaults to false (shows warning in dev mode instead).
|
|
1017
|
+
*/
|
|
1018
|
+
deduplicateOptions?: boolean;
|
|
1019
|
+
/**
|
|
1020
|
+
* If true, the component will reset its internal state when defaultValue changes.
|
|
1021
|
+
* Useful for React Hook Form integration and form reset functionality.
|
|
1022
|
+
* Optional, defaults to true.
|
|
1023
|
+
*/
|
|
1024
|
+
resetOnDefaultValueChange?: boolean;
|
|
1025
|
+
/**
|
|
1026
|
+
* If true, automatically closes the popover after selecting an option.
|
|
1027
|
+
* Useful for single-selection-like behavior or mobile UX.
|
|
1028
|
+
* Optional, defaults to false.
|
|
1029
|
+
*/
|
|
1030
|
+
closeOnSelect?: boolean;
|
|
1031
|
+
/**
|
|
1032
|
+
* Custom footer content to display at the bottom of the dropdown.
|
|
1033
|
+
* Useful for adding action buttons like "Add new item".
|
|
1034
|
+
* Optional.
|
|
1035
|
+
*/
|
|
1036
|
+
footerContent?: React$1.ReactNode;
|
|
1037
|
+
}
|
|
1038
|
+
/**
|
|
1039
|
+
* Imperative methods exposed through ref
|
|
1040
|
+
*/
|
|
1041
|
+
interface MultiSelectRef {
|
|
1042
|
+
/**
|
|
1043
|
+
* Programmatically reset the component to its default value
|
|
1044
|
+
*/
|
|
1045
|
+
reset: () => void;
|
|
1046
|
+
/**
|
|
1047
|
+
* Get current selected values
|
|
1048
|
+
*/
|
|
1049
|
+
getSelectedValues: () => string[];
|
|
1050
|
+
/**
|
|
1051
|
+
* Set selected values programmatically
|
|
1052
|
+
*/
|
|
1053
|
+
setSelectedValues: (values: string[]) => void;
|
|
1054
|
+
/**
|
|
1055
|
+
* Clear all selected values
|
|
1056
|
+
*/
|
|
1057
|
+
clear: () => void;
|
|
1058
|
+
/**
|
|
1059
|
+
* Focus the component
|
|
1060
|
+
*/
|
|
1061
|
+
focus: () => void;
|
|
1062
|
+
}
|
|
1063
|
+
declare const MultiSelect: React$1.ForwardRefExoticComponent<MultiSelectProps & React$1.RefAttributes<MultiSelectRef>>;
|
|
1064
|
+
|
|
1065
|
+
type TagsProps = {
|
|
1066
|
+
value?: string;
|
|
1067
|
+
setValue?: (value: string) => void;
|
|
1068
|
+
open?: boolean;
|
|
1069
|
+
onOpenChange?: (open: boolean) => void;
|
|
1070
|
+
children?: ReactNode;
|
|
1071
|
+
className?: string;
|
|
1072
|
+
};
|
|
1073
|
+
declare const Tags: ({ value, setValue, open: controlledOpen, onOpenChange: controlledOnOpenChange, children, className, }: TagsProps) => react_jsx_runtime.JSX.Element;
|
|
1074
|
+
type TagsTriggerProps = ComponentProps<typeof Button>;
|
|
1075
|
+
declare const TagsTrigger: ({ className, children, ...props }: TagsTriggerProps) => react_jsx_runtime.JSX.Element;
|
|
1076
|
+
type TagsValueProps = ComponentProps<typeof Badge>;
|
|
1077
|
+
declare const TagsValue: ({ className, children, onRemove, ...props }: TagsValueProps & {
|
|
1078
|
+
onRemove?: () => void;
|
|
1079
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
1080
|
+
type TagsContentProps = ComponentProps<typeof PopoverContent>;
|
|
1081
|
+
declare const TagsContent: ({ className, children, ...props }: TagsContentProps) => react_jsx_runtime.JSX.Element;
|
|
1082
|
+
type TagsInputProps = ComponentProps<typeof CommandInput>;
|
|
1083
|
+
declare const TagsInput: ({ className, ...props }: TagsInputProps) => react_jsx_runtime.JSX.Element;
|
|
1084
|
+
type TagsListProps = ComponentProps<typeof CommandList>;
|
|
1085
|
+
declare const TagsList: ({ className, ...props }: TagsListProps) => react_jsx_runtime.JSX.Element;
|
|
1086
|
+
type TagsEmptyProps = ComponentProps<typeof CommandEmpty>;
|
|
1087
|
+
declare const TagsEmpty: ({ children, className: _className, ...props }: TagsEmptyProps) => react_jsx_runtime.JSX.Element;
|
|
1088
|
+
type TagsGroupProps = ComponentProps<typeof CommandGroup>;
|
|
1089
|
+
declare const TagsGroup: typeof CommandGroup;
|
|
1090
|
+
type TagsItemProps = ComponentProps<typeof CommandItem>;
|
|
1091
|
+
declare const TagsItem: ({ className, ...props }: TagsItemProps) => react_jsx_runtime.JSX.Element;
|
|
1092
|
+
|
|
1093
|
+
interface RecordPickerProps {
|
|
1094
|
+
records: any[];
|
|
1095
|
+
linkedRecordIds: Set<string>;
|
|
1096
|
+
onLink: (record: any) => void;
|
|
1097
|
+
isLinking: boolean;
|
|
1098
|
+
getRecordLabel: (record: any) => string;
|
|
1099
|
+
getRecordId: (record: any) => string;
|
|
1100
|
+
searchFields?: string[];
|
|
1101
|
+
placeholder?: string;
|
|
1102
|
+
maxHeight?: string;
|
|
1103
|
+
}
|
|
1104
|
+
declare function RecordPicker({ records, linkedRecordIds, onLink, isLinking, getRecordLabel, getRecordId, searchFields, placeholder, maxHeight, }: RecordPickerProps): react_jsx_runtime.JSX.Element;
|
|
1105
|
+
|
|
1106
|
+
interface StepperProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
1107
|
+
defaultValue?: number;
|
|
1108
|
+
value?: number;
|
|
1109
|
+
onValueChange?: (value: number) => void;
|
|
1110
|
+
orientation?: 'horizontal' | 'vertical';
|
|
1111
|
+
}
|
|
1112
|
+
declare function Stepper({ defaultValue, value, onValueChange, orientation, className, ...props }: StepperProps): react_jsx_runtime.JSX.Element;
|
|
1113
|
+
interface StepperItemProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
1114
|
+
step: number;
|
|
1115
|
+
completed?: boolean;
|
|
1116
|
+
disabled?: boolean;
|
|
1117
|
+
loading?: boolean;
|
|
1118
|
+
}
|
|
1119
|
+
declare function StepperItem({ step, completed, disabled, loading, className, children, ...props }: StepperItemProps): react_jsx_runtime.JSX.Element;
|
|
1120
|
+
interface StepperTriggerProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
1121
|
+
asChild?: boolean;
|
|
1122
|
+
}
|
|
1123
|
+
declare function StepperTrigger({ asChild, className, children, ...props }: StepperTriggerProps): react_jsx_runtime.JSX.Element;
|
|
1124
|
+
interface StepperIndicatorProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
1125
|
+
asChild?: boolean;
|
|
1126
|
+
}
|
|
1127
|
+
declare function StepperIndicator({ asChild, className, children, ...props }: StepperIndicatorProps): react_jsx_runtime.JSX.Element;
|
|
1128
|
+
declare function StepperTitle({ className, ...props }: React$1.HTMLAttributes<HTMLHeadingElement>): react_jsx_runtime.JSX.Element;
|
|
1129
|
+
declare function StepperDescription({ className, ...props }: React$1.HTMLAttributes<HTMLParagraphElement>): react_jsx_runtime.JSX.Element;
|
|
1130
|
+
declare function StepperSeparator({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
1131
|
+
|
|
1132
|
+
type SidebarContextProps = {
|
|
1133
|
+
state: 'expanded' | 'collapsed';
|
|
1134
|
+
open: boolean;
|
|
1135
|
+
setOpen: (open: boolean) => void;
|
|
1136
|
+
openMobile: boolean;
|
|
1137
|
+
setOpenMobile: (open: boolean) => void;
|
|
1138
|
+
isMobile: boolean;
|
|
1139
|
+
toggleSidebar: () => void;
|
|
1140
|
+
isHovered: boolean;
|
|
1141
|
+
setIsHovered: (hovered: boolean) => void;
|
|
1142
|
+
};
|
|
1143
|
+
declare function useSidebar(): SidebarContextProps;
|
|
1144
|
+
declare function SidebarProvider({ defaultOpen, open: openProp, onOpenChange: setOpenProp, className, style, children, ...props }: React$1.ComponentProps<'div'> & {
|
|
1145
|
+
defaultOpen?: boolean;
|
|
1146
|
+
open?: boolean;
|
|
1147
|
+
onOpenChange?: (open: boolean) => void;
|
|
1148
|
+
}): react_jsx_runtime.JSX.Element;
|
|
1149
|
+
declare function Sidebar({ side, variant, collapsible, className, children, ...props }: React$1.ComponentProps<'div'> & {
|
|
1150
|
+
side?: 'left' | 'right';
|
|
1151
|
+
variant?: 'sidebar' | 'floating' | 'inset';
|
|
1152
|
+
collapsible?: 'offcanvas' | 'icon' | 'none';
|
|
1153
|
+
}): react_jsx_runtime.JSX.Element;
|
|
1154
|
+
declare function SidebarTrigger({ className, onClick, ...props }: React$1.ComponentProps<typeof Button>): react_jsx_runtime.JSX.Element;
|
|
1155
|
+
declare function SidebarInset({ className, ...props }: React$1.ComponentProps<'main'>): react_jsx_runtime.JSX.Element;
|
|
1156
|
+
declare function SidebarInput({ className, ...props }: React$1.ComponentProps<typeof Input>): react_jsx_runtime.JSX.Element;
|
|
1157
|
+
declare function SidebarHeader({ className, ...props }: React$1.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
1158
|
+
declare function SidebarFooter({ className, ...props }: React$1.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
1159
|
+
declare function SidebarSeparator({ className, ...props }: React$1.ComponentProps<typeof Separator>): react_jsx_runtime.JSX.Element;
|
|
1160
|
+
declare function SidebarContent({ className, ...props }: React$1.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
1161
|
+
declare function SidebarGroup({ className, ...props }: React$1.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
1162
|
+
declare function SidebarGroupLabel({ className, asChild, ...props }: React$1.ComponentProps<'div'> & {
|
|
1163
|
+
asChild?: boolean;
|
|
1164
|
+
}): react_jsx_runtime.JSX.Element;
|
|
1165
|
+
declare function SidebarGroupAction({ className, asChild, ...props }: React$1.ComponentProps<'button'> & {
|
|
1166
|
+
asChild?: boolean;
|
|
1167
|
+
}): react_jsx_runtime.JSX.Element;
|
|
1168
|
+
declare function SidebarGroupContent({ className, ...props }: React$1.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
1169
|
+
declare function SidebarMenu({ className, ...props }: React$1.ComponentProps<'ul'>): react_jsx_runtime.JSX.Element;
|
|
1170
|
+
declare function SidebarMenuItem({ className, ...props }: React$1.ComponentProps<'li'>): react_jsx_runtime.JSX.Element;
|
|
1171
|
+
declare const sidebarMenuButtonVariants: (props?: ({
|
|
1172
|
+
variant?: "outline" | "default" | null | undefined;
|
|
1173
|
+
size?: "default" | "lg" | "sm" | null | undefined;
|
|
1174
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1175
|
+
declare function SidebarMenuButton({ asChild, isActive, variant, size, tooltip, className, ...props }: React$1.ComponentProps<'button'> & {
|
|
1176
|
+
asChild?: boolean;
|
|
1177
|
+
isActive?: boolean;
|
|
1178
|
+
tooltip?: string | React$1.ComponentProps<typeof TooltipContent>;
|
|
1179
|
+
} & VariantProps<typeof sidebarMenuButtonVariants>): react_jsx_runtime.JSX.Element;
|
|
1180
|
+
declare function SidebarMenuAction({ className, asChild, showOnHover, ...props }: React$1.ComponentProps<'button'> & {
|
|
1181
|
+
asChild?: boolean;
|
|
1182
|
+
showOnHover?: boolean;
|
|
1183
|
+
}): react_jsx_runtime.JSX.Element;
|
|
1184
|
+
declare function SidebarMenuBadge({ className, ...props }: React$1.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
1185
|
+
declare function SidebarMenuSkeleton({ className, showIcon, ...props }: React$1.ComponentProps<'div'> & {
|
|
1186
|
+
showIcon?: boolean;
|
|
1187
|
+
}): react_jsx_runtime.JSX.Element;
|
|
1188
|
+
declare function SidebarMenuSub({ className, ...props }: React$1.ComponentProps<'ul'>): react_jsx_runtime.JSX.Element;
|
|
1189
|
+
declare function SidebarMenuSubItem({ className, ...props }: React$1.ComponentProps<'li'>): react_jsx_runtime.JSX.Element;
|
|
1190
|
+
declare function SidebarMenuSubButton({ asChild, size, isActive, className, ...props }: React$1.ComponentProps<'a'> & {
|
|
1191
|
+
asChild?: boolean;
|
|
1192
|
+
size?: 'sm' | 'md';
|
|
1193
|
+
isActive?: boolean;
|
|
1194
|
+
}): react_jsx_runtime.JSX.Element;
|
|
1195
|
+
|
|
1196
|
+
interface BaseCalendarProps {
|
|
1197
|
+
className?: string;
|
|
1198
|
+
}
|
|
1199
|
+
type CalendarProps = ComponentProps<typeof Calendar$1> & BaseCalendarProps;
|
|
1200
|
+
type RangeCalendarProps = ComponentProps<typeof RangeCalendar$1> & BaseCalendarProps;
|
|
1201
|
+
declare function Calendar({ className, ...props }: CalendarProps): react_jsx_runtime.JSX.Element;
|
|
1202
|
+
declare function RangeCalendar({ className, ...props }: RangeCalendarProps): react_jsx_runtime.JSX.Element;
|
|
1203
|
+
|
|
1204
|
+
type JsonInputProps = {
|
|
1205
|
+
value: string;
|
|
1206
|
+
setValue: (value: string) => void;
|
|
1207
|
+
minLines?: number;
|
|
1208
|
+
className?: string;
|
|
1209
|
+
/** Theme for the editor: 'light' or 'dark'. Defaults to 'light'. */
|
|
1210
|
+
theme?: 'light' | 'dark';
|
|
1211
|
+
};
|
|
1212
|
+
declare const JsonInput: ({ value, setValue, minLines, className, theme }: JsonInputProps) => react_jsx_runtime.JSX.Element;
|
|
1213
|
+
type JsonEditorProps = {
|
|
1214
|
+
value: string;
|
|
1215
|
+
lines: number;
|
|
1216
|
+
setValue?: (value: string) => void;
|
|
1217
|
+
readOnly?: boolean;
|
|
1218
|
+
isValid?: boolean;
|
|
1219
|
+
enableFolding?: boolean;
|
|
1220
|
+
/** Theme for the editor: 'light' or 'dark'. Defaults to 'light'. */
|
|
1221
|
+
theme?: 'light' | 'dark';
|
|
1222
|
+
};
|
|
1223
|
+
declare const JsonEditor: ({ value, setValue, lines, readOnly, isValid, enableFolding, theme, }: JsonEditorProps) => react_jsx_runtime.JSX.Element;
|
|
1224
|
+
declare const validateJson: (text: string) => string | null;
|
|
1225
|
+
|
|
1226
|
+
type ToasterComponentProps = ToasterProps & {
|
|
1227
|
+
/** Theme for the toaster. Pass from your app's theme context. Defaults to 'system'. */
|
|
1228
|
+
theme?: 'light' | 'dark' | 'system';
|
|
1229
|
+
};
|
|
1230
|
+
declare const Toaster: ({ theme, ...props }: ToasterComponentProps) => react_jsx_runtime.JSX.Element;
|
|
1231
|
+
|
|
1232
|
+
interface DockProps extends VariantProps<typeof dockVariants> {
|
|
1233
|
+
className?: string;
|
|
1234
|
+
iconSize?: number;
|
|
1235
|
+
iconMagnification?: number;
|
|
1236
|
+
iconDistance?: number;
|
|
1237
|
+
direction?: 'top' | 'middle' | 'bottom';
|
|
1238
|
+
children: React__default.ReactNode;
|
|
1239
|
+
}
|
|
1240
|
+
declare const dockVariants: (props?: class_variance_authority_types.ClassProp | undefined) => string;
|
|
1241
|
+
declare const Dock: React__default.ForwardRefExoticComponent<DockProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
1242
|
+
interface DockIconProps extends Omit<MotionProps & React__default.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
1243
|
+
size?: number;
|
|
1244
|
+
magnification?: number;
|
|
1245
|
+
distance?: number;
|
|
1246
|
+
mouseX?: MotionValue<number>;
|
|
1247
|
+
className?: string;
|
|
1248
|
+
children?: React__default.ReactNode;
|
|
1249
|
+
props?: PropsWithChildren;
|
|
1250
|
+
}
|
|
1251
|
+
declare const DockIcon: {
|
|
1252
|
+
({ size, magnification, distance, mouseX, className, children, ...props }: DockIconProps): react_jsx_runtime.JSX.Element;
|
|
1253
|
+
displayName: string;
|
|
1254
|
+
};
|
|
1255
|
+
|
|
1256
|
+
interface PageHeaderProps {
|
|
1257
|
+
/** Page title */
|
|
1258
|
+
title: string;
|
|
1259
|
+
/** Optional description */
|
|
1260
|
+
description?: string;
|
|
1261
|
+
/** Optional actions to display on the right */
|
|
1262
|
+
actions?: ReactNode;
|
|
1263
|
+
}
|
|
1264
|
+
/**
|
|
1265
|
+
* Consistent page header component
|
|
1266
|
+
*/
|
|
1267
|
+
declare function PageHeader({ title, description, actions }: PageHeaderProps): react_jsx_runtime.JSX.Element;
|
|
1268
|
+
|
|
1269
|
+
interface FlickeringGridProps extends React__default.HTMLAttributes<HTMLDivElement> {
|
|
1270
|
+
squareSize?: number;
|
|
1271
|
+
gridGap?: number;
|
|
1272
|
+
flickerChance?: number;
|
|
1273
|
+
color?: string;
|
|
1274
|
+
width?: number;
|
|
1275
|
+
height?: number;
|
|
1276
|
+
className?: string;
|
|
1277
|
+
maxOpacity?: number;
|
|
1278
|
+
}
|
|
1279
|
+
declare const FlickeringGrid: React__default.FC<FlickeringGridProps>;
|
|
1280
|
+
|
|
1281
|
+
type FrameDot = [number, number];
|
|
1282
|
+
type Frame = FrameDot[];
|
|
1283
|
+
type Frames = Frame[];
|
|
1284
|
+
type MotionGridProps = {
|
|
1285
|
+
gridSize: [number, number];
|
|
1286
|
+
/** Duration in milliseconds for each frame of the animation */
|
|
1287
|
+
duration?: number;
|
|
1288
|
+
animate?: boolean;
|
|
1289
|
+
cellClassName?: string;
|
|
1290
|
+
cellProps?: HTMLMotionProps<'div'>;
|
|
1291
|
+
cellActiveClassName?: string;
|
|
1292
|
+
cellInactiveClassName?: string;
|
|
1293
|
+
} & React$1.ComponentProps<'div'>;
|
|
1294
|
+
declare const MotionGrid: ({ gridSize, duration, animate, cellClassName, cellProps, cellActiveClassName, cellInactiveClassName, className, style, ...props }: MotionGridProps) => react_jsx_runtime.JSX.Element;
|
|
1295
|
+
|
|
1296
|
+
interface ProgressiveBlurProps {
|
|
1297
|
+
className?: string;
|
|
1298
|
+
height?: string;
|
|
1299
|
+
position?: 'top' | 'bottom' | 'both';
|
|
1300
|
+
/** Strength of the blur kernel in pixels (simpler, fewer artifacts) */
|
|
1301
|
+
blurPx?: number;
|
|
1302
|
+
surface?: 'background' | 'card' | 'sidebar';
|
|
1303
|
+
intensity?: number;
|
|
1304
|
+
/** Optional horizontal inset to avoid edge bleeding (e.g. '0.5rem') */
|
|
1305
|
+
insetX?: string;
|
|
1306
|
+
}
|
|
1307
|
+
declare function ProgressiveBlur({ className, height, position, blurPx, surface, intensity, insetX, }: ProgressiveBlurProps): react_jsx_runtime.JSX.Element;
|
|
1308
|
+
|
|
1309
|
+
interface ProgressiveBlurScrollContainerProps {
|
|
1310
|
+
children: ReactNode;
|
|
1311
|
+
className?: string;
|
|
1312
|
+
/** Class name for the scrollable inner div */
|
|
1313
|
+
scrollClassName?: string;
|
|
1314
|
+
/** Minimum number of items to show blur (prevents blur on sparse content) */
|
|
1315
|
+
minItemsForBlur?: number;
|
|
1316
|
+
/** Current item count for minItemsForBlur check */
|
|
1317
|
+
itemCount?: number;
|
|
1318
|
+
/** Props to pass to ProgressiveBlur */
|
|
1319
|
+
blurProps?: Partial<ProgressiveBlurProps>;
|
|
1320
|
+
/** Whether to show blur (in addition to overflow check) */
|
|
1321
|
+
showBlur?: boolean;
|
|
1322
|
+
}
|
|
1323
|
+
/**
|
|
1324
|
+
* A scrollable container that shows progressive blur effects at the top and bottom
|
|
1325
|
+
* when content overflows. Top blur appears when scrolled, bottom blur when more content below.
|
|
1326
|
+
*/
|
|
1327
|
+
declare function ProgressiveBlurScrollContainer({ children, className, scrollClassName, minItemsForBlur, itemCount, blurProps, showBlur, }: ProgressiveBlurScrollContainerProps): react_jsx_runtime.JSX.Element;
|
|
1328
|
+
|
|
1329
|
+
interface ResponsiveDiagramProps {
|
|
1330
|
+
children: React.ReactNode;
|
|
1331
|
+
targetRatio?: number;
|
|
1332
|
+
className?: string;
|
|
1333
|
+
}
|
|
1334
|
+
declare function ResponsiveDiagram({ children, targetRatio, className }: ResponsiveDiagramProps): react_jsx_runtime.JSX.Element;
|
|
1335
|
+
|
|
1336
|
+
/**
|
|
1337
|
+
* Overlay layer type:
|
|
1338
|
+
* - 'base': Root level (page content, base floating elements)
|
|
1339
|
+
* - 'modal': Inside a modal overlay (dialog, sheet, drawer)
|
|
1340
|
+
*/
|
|
1341
|
+
type OverlayLayer = 'base' | 'modal';
|
|
1342
|
+
/**
|
|
1343
|
+
* Where floating overlays should portal:
|
|
1344
|
+
* - 'root': always portal into #portal-root
|
|
1345
|
+
* - 'nested': let Base UI nest portals into the nearest Base UI portal node
|
|
1346
|
+
*/
|
|
1347
|
+
type FloatingPortalStrategy = 'root' | 'nested';
|
|
1348
|
+
/**
|
|
1349
|
+
* Z-index mode for floating overlays.
|
|
1350
|
+
* - 'default': --z-layer-floating
|
|
1351
|
+
* - 'elevated': --z-layer-floating-elevated
|
|
1352
|
+
*/
|
|
1353
|
+
type FloatingZIndex = 'default' | 'elevated';
|
|
1354
|
+
interface PortalContextValue {
|
|
1355
|
+
/** Current overlay layer */
|
|
1356
|
+
layer: OverlayLayer;
|
|
1357
|
+
/** Modal nesting depth (0 for first modal, 1 for nested, etc.) */
|
|
1358
|
+
depth: number;
|
|
1359
|
+
/** Strategy for where floating overlays should portal */
|
|
1360
|
+
floatingPortalStrategy: FloatingPortalStrategy;
|
|
1361
|
+
/** Z-index mode for floating overlays */
|
|
1362
|
+
floatingZIndex: FloatingZIndex;
|
|
1363
|
+
}
|
|
1364
|
+
declare const PORTAL_ROOT_ID = "portal-root";
|
|
1365
|
+
/**
|
|
1366
|
+
* Provider for modal overlays (Dialog, Sheet, Drawer, etc.)
|
|
1367
|
+
*
|
|
1368
|
+
* Wraps modal content to:
|
|
1369
|
+
* 1. Create a scoped portal container for nested floating elements
|
|
1370
|
+
* 2. Track the overlay layer (so floating elements know to use elevated z-index)
|
|
1371
|
+
* 3. Track nesting depth for stacked modals
|
|
1372
|
+
*
|
|
1373
|
+
* Usage:
|
|
1374
|
+
* ```tsx
|
|
1375
|
+
* <DialogPopup>
|
|
1376
|
+
* <ModalPortalScope>
|
|
1377
|
+
* {children} // Popovers inside here will render in the scoped container
|
|
1378
|
+
* </ModalPortalScope>
|
|
1379
|
+
* </DialogPopup>
|
|
1380
|
+
* ```
|
|
1381
|
+
*/
|
|
1382
|
+
declare function ModalPortalScope({ children, floatingPortalStrategy, floatingZIndex, }: {
|
|
1383
|
+
children: React$1.ReactNode;
|
|
1384
|
+
floatingPortalStrategy?: FloatingPortalStrategy;
|
|
1385
|
+
floatingZIndex?: FloatingZIndex;
|
|
1386
|
+
}): react_jsx_runtime.JSX.Element;
|
|
1387
|
+
/**
|
|
1388
|
+
* Get the current portal context value.
|
|
1389
|
+
* Used internally by other hooks.
|
|
1390
|
+
*/
|
|
1391
|
+
declare function usePortalContext(): PortalContextValue;
|
|
1392
|
+
declare function useInModalOverlay(): boolean;
|
|
1393
|
+
/**
|
|
1394
|
+
* Get the root portal container element.
|
|
1395
|
+
* Used by modal components (Dialog, Sheet, etc.) to render their portals.
|
|
1396
|
+
*
|
|
1397
|
+
* @returns The root portal container, or null during SSR/before mount
|
|
1398
|
+
*/
|
|
1399
|
+
declare function useRootPortalContainer(): HTMLElement | null;
|
|
1400
|
+
/**
|
|
1401
|
+
* Centralized portal + z-index policy for floating overlays.
|
|
1402
|
+
*
|
|
1403
|
+
* - When `floatingPortalStrategy` is 'nested', Base UI will automatically portal
|
|
1404
|
+
* into the nearest Base UI portal node (so dialog "inert" behavior includes it).
|
|
1405
|
+
* - When it's 'root', we portal into #portal-root.
|
|
1406
|
+
*/
|
|
1407
|
+
declare function useFloatingOverlayPortalProps(): {
|
|
1408
|
+
container?: HTMLElement | null;
|
|
1409
|
+
zIndexClass: string;
|
|
1410
|
+
};
|
|
1411
|
+
/**
|
|
1412
|
+
* Portal root component to render in app layout.
|
|
1413
|
+
* All overlay components will render their portals inside this container.
|
|
1414
|
+
*
|
|
1415
|
+
* Usage in layout.tsx:
|
|
1416
|
+
* ```tsx
|
|
1417
|
+
* import { PortalRoot } from '@constructive-io/ui/portal';
|
|
1418
|
+
*
|
|
1419
|
+
* export default function RootLayout({ children }) {
|
|
1420
|
+
* return (
|
|
1421
|
+
* <html>
|
|
1422
|
+
* <body>
|
|
1423
|
+
* {children}
|
|
1424
|
+
* <PortalRoot />
|
|
1425
|
+
* </body>
|
|
1426
|
+
* </html>
|
|
1427
|
+
* );
|
|
1428
|
+
* }
|
|
1429
|
+
* ```
|
|
1430
|
+
*/
|
|
1431
|
+
declare function PortalRoot(): react_jsx_runtime.JSX.Element;
|
|
1432
|
+
/**
|
|
1433
|
+
* Hook to get the portal container element for rendering floating UI elements.
|
|
1434
|
+
* Returns the element with id="portal-root" if it exists in the DOM.
|
|
1435
|
+
*
|
|
1436
|
+
* @deprecated Use useRootPortalContainer or useFloatingOverlayPortalProps instead
|
|
1437
|
+
*/
|
|
1438
|
+
declare function usePortalContainer(): HTMLElement | undefined;
|
|
1439
|
+
|
|
1440
|
+
interface UnlinkButtonProps {
|
|
1441
|
+
onUnlink: () => void;
|
|
1442
|
+
isUnlinking?: boolean;
|
|
1443
|
+
disabled?: boolean;
|
|
1444
|
+
size?: 'sm' | 'xs';
|
|
1445
|
+
variant?: 'destructive' | 'ghost';
|
|
1446
|
+
className?: string;
|
|
1447
|
+
'aria-label'?: string;
|
|
1448
|
+
}
|
|
1449
|
+
declare function UnlinkButton({ onUnlink, isUnlinking, disabled, size, variant, className, 'aria-label': ariaLabel, }: UnlinkButtonProps): react_jsx_runtime.JSX.Element;
|
|
1450
|
+
|
|
1451
|
+
type CardId = string;
|
|
1452
|
+
type CardComponent<P = unknown> = ComponentType<P & CardInjectedProps>;
|
|
1453
|
+
/** Configuration for the stack backdrop overlay */
|
|
1454
|
+
type BackdropConfig = {
|
|
1455
|
+
/** Enable backdrop blur effect (default: false) */
|
|
1456
|
+
blur?: boolean;
|
|
1457
|
+
/** Custom class name for full styling control */
|
|
1458
|
+
className?: string;
|
|
1459
|
+
};
|
|
1460
|
+
/** Props injected into every card component */
|
|
1461
|
+
type CardInjectedProps = {
|
|
1462
|
+
card: {
|
|
1463
|
+
id: CardId;
|
|
1464
|
+
/**
|
|
1465
|
+
* Push a new card from this card.
|
|
1466
|
+
* Default: replaces all cards above this card, then pushes the new card.
|
|
1467
|
+
* Use { append: true } to just push on top of the entire stack.
|
|
1468
|
+
*/
|
|
1469
|
+
push: <P>(card: Omit<CardSpec<P>, 'id'> & {
|
|
1470
|
+
id?: CardId;
|
|
1471
|
+
}, options?: CardPushOptions) => CardId;
|
|
1472
|
+
close: () => void;
|
|
1473
|
+
setTitle: (title?: string) => void;
|
|
1474
|
+
setDescription: (description?: string) => void;
|
|
1475
|
+
setWidth: (width?: string | number) => void;
|
|
1476
|
+
updateProps: <P>(patch: Partial<P> | ((prev: P) => P)) => void;
|
|
1477
|
+
};
|
|
1478
|
+
};
|
|
1479
|
+
type CardSpec<P = unknown> = {
|
|
1480
|
+
/** Unique identifier for this card instance */
|
|
1481
|
+
id: CardId;
|
|
1482
|
+
/** Display title in card header */
|
|
1483
|
+
title?: string;
|
|
1484
|
+
/** Display description/subtitle in card header */
|
|
1485
|
+
description?: string;
|
|
1486
|
+
/** Header size variant - controls title/description size, weight, and height */
|
|
1487
|
+
headerSize?: 'sm' | 'md' | 'lg';
|
|
1488
|
+
/** React component to render */
|
|
1489
|
+
Component: CardComponent<P>;
|
|
1490
|
+
/** Props passed to Component (excluding injected card props) */
|
|
1491
|
+
props?: P;
|
|
1492
|
+
/** Width override (CSS value) - default: 480px */
|
|
1493
|
+
width?: string | number;
|
|
1494
|
+
/** Custom peek offset for this card when cards stack above it (default: 24px) */
|
|
1495
|
+
peekOffset?: number;
|
|
1496
|
+
/**
|
|
1497
|
+
* When true, this card can be fully covered by cards above it (no guaranteed peek).
|
|
1498
|
+
* Use this escape hatch for cards where visibility isn't required when buried in stack.
|
|
1499
|
+
* Default: false (card always peeks past cards above it)
|
|
1500
|
+
*/
|
|
1501
|
+
allowCover?: boolean;
|
|
1502
|
+
/**
|
|
1503
|
+
* Show backdrop behind the stack when this card is the first card.
|
|
1504
|
+
* Default: inherits from CardStackViewport's backdrop prop (true).
|
|
1505
|
+
* Set to false for panel/sidebar-like cards that shouldn't obscure background.
|
|
1506
|
+
* Pass an object to configure blur and styling.
|
|
1507
|
+
*/
|
|
1508
|
+
backdrop?: boolean | BackdropConfig;
|
|
1509
|
+
/**
|
|
1510
|
+
* Callback fired when this card is removed from the stack.
|
|
1511
|
+
* Fires regardless of how the card was closed (swipe, backdrop, escape, api.dismiss, etc.)
|
|
1512
|
+
*/
|
|
1513
|
+
onClose?: () => void;
|
|
1514
|
+
/** Arbitrary metadata for analytics/debugging */
|
|
1515
|
+
meta?: Record<string, unknown>;
|
|
1516
|
+
};
|
|
1517
|
+
type CardRouteDefinition<P = unknown> = {
|
|
1518
|
+
/** Component to render for this route */
|
|
1519
|
+
Component: CardComponent<P>;
|
|
1520
|
+
/** Generate unique ID from props (default: route key) */
|
|
1521
|
+
getId?: (props?: P) => CardId;
|
|
1522
|
+
/** Default title for cards opened via this route */
|
|
1523
|
+
defaultTitle?: string;
|
|
1524
|
+
/** Default width for cards opened via this route */
|
|
1525
|
+
defaultWidth?: string | number;
|
|
1526
|
+
/** Default peek offset for cards opened via this route */
|
|
1527
|
+
defaultPeekOffset?: number;
|
|
1528
|
+
};
|
|
1529
|
+
type CardRouteMap = Record<string, CardRouteDefinition<unknown>>;
|
|
1530
|
+
type LayoutMode = 'cascade' | 'side-by-side';
|
|
1531
|
+
/** Options for dismiss operation */
|
|
1532
|
+
type DismissOptions = {
|
|
1533
|
+
/**
|
|
1534
|
+
* When true (default), dismissing a card also dismisses all cards above it.
|
|
1535
|
+
* When false, only the specified card is removed (escape hatch).
|
|
1536
|
+
*/
|
|
1537
|
+
cascade?: boolean;
|
|
1538
|
+
};
|
|
1539
|
+
/** Options for push operation */
|
|
1540
|
+
type PushOptions = {
|
|
1541
|
+
/**
|
|
1542
|
+
* If provided, removes all cards above this card ID before pushing.
|
|
1543
|
+
* Used internally by card.push() to implement replace-from-current behavior.
|
|
1544
|
+
*/
|
|
1545
|
+
replaceFrom?: CardId;
|
|
1546
|
+
};
|
|
1547
|
+
/** Options for push from within a card (injected card.push) */
|
|
1548
|
+
type CardPushOptions = {
|
|
1549
|
+
/**
|
|
1550
|
+
* When true, just push on top of the entire stack (escape hatch).
|
|
1551
|
+
* When false (default), replace cards above the current card first.
|
|
1552
|
+
*/
|
|
1553
|
+
append?: boolean;
|
|
1554
|
+
};
|
|
1555
|
+
type CardStackApi = {
|
|
1556
|
+
/** Get the topmost card spec, or null if empty */
|
|
1557
|
+
top: () => CardSpec | null;
|
|
1558
|
+
/** Get the ID of the topmost card, or null if empty */
|
|
1559
|
+
currentId: () => CardId | null;
|
|
1560
|
+
/** Check if stack has cards that can be popped */
|
|
1561
|
+
canPop: () => boolean;
|
|
1562
|
+
/** Get total number of cards in stack */
|
|
1563
|
+
size: () => number;
|
|
1564
|
+
/** Get a specific card by ID, or null if not found */
|
|
1565
|
+
get: (id: CardId) => CardSpec | null;
|
|
1566
|
+
/** Get all cards in stack (bottom to top order) */
|
|
1567
|
+
getAll: () => CardSpec[];
|
|
1568
|
+
/** Check if a specific card exists in the stack */
|
|
1569
|
+
has: (id: CardId) => boolean;
|
|
1570
|
+
/**
|
|
1571
|
+
* Push a new card onto the stack. Returns the card ID.
|
|
1572
|
+
* Use { replaceFrom: cardId } to remove cards above that card first.
|
|
1573
|
+
*/
|
|
1574
|
+
push: <P>(card: CardSpec<P>, options?: PushOptions) => CardId;
|
|
1575
|
+
/** Push a card by registered route key. Returns the card ID. */
|
|
1576
|
+
pushRoute: <P>(route: string, props?: P, opts?: {
|
|
1577
|
+
id?: CardId;
|
|
1578
|
+
title?: string;
|
|
1579
|
+
width?: string | number;
|
|
1580
|
+
}) => CardId;
|
|
1581
|
+
/** Pop one or more cards from the stack */
|
|
1582
|
+
pop: (count?: number) => void;
|
|
1583
|
+
/** Pop cards until the specified ID is on top */
|
|
1584
|
+
popTo: (id: CardId) => void;
|
|
1585
|
+
/** Replace the top card with a new one. Returns the new card ID. */
|
|
1586
|
+
replaceTop: <P>(card: CardSpec<P>) => CardId;
|
|
1587
|
+
/** Reset the entire stack to a specific set of cards */
|
|
1588
|
+
reset: (cards: CardSpec[]) => void;
|
|
1589
|
+
/** Clear all cards from the stack */
|
|
1590
|
+
clear: () => void;
|
|
1591
|
+
/** Update props for a specific card */
|
|
1592
|
+
updateProps: <P>(id: CardId, patch: Partial<P> | ((prev: P) => P)) => void;
|
|
1593
|
+
/** Update the title for a specific card */
|
|
1594
|
+
setTitle: (id: CardId, title?: string) => void;
|
|
1595
|
+
/** Update the description for a specific card */
|
|
1596
|
+
setDescription: (id: CardId, description?: string) => void;
|
|
1597
|
+
/** Update the width for a specific card */
|
|
1598
|
+
setWidth: (id: CardId, width?: string | number) => void;
|
|
1599
|
+
/**
|
|
1600
|
+
* Remove a card from the stack.
|
|
1601
|
+
* By default (cascade: true), also removes all cards above it.
|
|
1602
|
+
* Use { cascade: false } to remove only the specified card.
|
|
1603
|
+
*/
|
|
1604
|
+
dismiss: (id: CardId, options?: DismissOptions) => void;
|
|
1605
|
+
/** Insert a card at a specific index (0 = bottom) */
|
|
1606
|
+
insertAt: <P>(index: number, card: CardSpec<P>) => CardId;
|
|
1607
|
+
};
|
|
1608
|
+
type CardStackProviderProps = {
|
|
1609
|
+
children: React.ReactNode;
|
|
1610
|
+
/** Route registry for string-based navigation */
|
|
1611
|
+
routes?: CardRouteMap;
|
|
1612
|
+
/** Initial stack state */
|
|
1613
|
+
initial?: CardSpec[];
|
|
1614
|
+
/** Callback when stack changes */
|
|
1615
|
+
onChange?: (stack: CardSpec[]) => void;
|
|
1616
|
+
/** Z-index base for the stack (default: 100) */
|
|
1617
|
+
zIndexBase?: number;
|
|
1618
|
+
/**
|
|
1619
|
+
* Layout mode for visible cards:
|
|
1620
|
+
* - 'cascade': Cards peek behind each other with offset (default)
|
|
1621
|
+
* - 'side-by-side': Second card pushed fully left, creating master-detail layout
|
|
1622
|
+
*/
|
|
1623
|
+
layoutMode?: LayoutMode;
|
|
1624
|
+
/** Default peek offset in pixels (default: 24) */
|
|
1625
|
+
defaultPeekOffset?: number;
|
|
1626
|
+
/** Default card width (default: 480) */
|
|
1627
|
+
defaultWidth?: string | number;
|
|
1628
|
+
};
|
|
1629
|
+
type AnimationConfig = {
|
|
1630
|
+
/** Entry/exit duration in seconds (default: 0.2) */
|
|
1631
|
+
duration?: number;
|
|
1632
|
+
/** Entry easing (default: [0.32, 0.72, 0, 1]) */
|
|
1633
|
+
enterEase?: number[];
|
|
1634
|
+
/** Exit easing (default: [0.4, 0, 0.6, 1]) */
|
|
1635
|
+
exitEase?: number[];
|
|
1636
|
+
};
|
|
1637
|
+
type GestureConfig = {
|
|
1638
|
+
/** Enable swipe-right-to-pop gesture (default: true on mobile) */
|
|
1639
|
+
swipeToPop?: boolean;
|
|
1640
|
+
/** Minimum swipe distance to trigger pop (default: 35% of viewport width, min 120px) */
|
|
1641
|
+
swipeThreshold?: number;
|
|
1642
|
+
/** Velocity threshold for quick swipe (default: 600px/s, requires minimum distance) */
|
|
1643
|
+
velocityThreshold?: number;
|
|
1644
|
+
/** Auto-dismiss X position while dragging (default: 80% of viewport width) */
|
|
1645
|
+
autoDismissThreshold?: number;
|
|
1646
|
+
};
|
|
1647
|
+
type PeekGestureConfig = {
|
|
1648
|
+
/** Enable peek zone interactions (default: true) */
|
|
1649
|
+
enabled?: boolean;
|
|
1650
|
+
/** Enable drag-to-dismiss on peek zone (default: true) */
|
|
1651
|
+
dragToDismiss?: boolean;
|
|
1652
|
+
/** Hover expansion in pixels (default: 48) */
|
|
1653
|
+
hoverExpansion?: number;
|
|
1654
|
+
/** Minimum drag distance to trigger dismiss (default: 80px) */
|
|
1655
|
+
dragThreshold?: number;
|
|
1656
|
+
/** Velocity threshold for quick drag dismiss (default: 400px/s) */
|
|
1657
|
+
dragVelocityThreshold?: number;
|
|
1658
|
+
};
|
|
1659
|
+
type MobileConfig = {
|
|
1660
|
+
/** Breakpoint for mobile behavior in pixels (default: 768) */
|
|
1661
|
+
breakpoint?: number;
|
|
1662
|
+
/** Force full-screen cards on mobile (default: true) */
|
|
1663
|
+
fullScreen?: boolean;
|
|
1664
|
+
/** Gesture configuration for mobile */
|
|
1665
|
+
gestures?: GestureConfig;
|
|
1666
|
+
};
|
|
1667
|
+
type CardStackViewportProps = {
|
|
1668
|
+
/** Show backdrop behind first card (default: true). Pass object to configure blur/styling. */
|
|
1669
|
+
backdrop?: boolean | BackdropConfig;
|
|
1670
|
+
/** Custom backdrop element */
|
|
1671
|
+
renderBackdrop?: () => React.ReactNode;
|
|
1672
|
+
/** Custom header renderer per card */
|
|
1673
|
+
renderHeader?: (card: CardSpec, api: CardStackApi) => React.ReactNode;
|
|
1674
|
+
/** Custom empty state when stack is empty */
|
|
1675
|
+
renderEmpty?: () => React.ReactNode;
|
|
1676
|
+
/** Number of previous cards to render for peek effect (default: 2) */
|
|
1677
|
+
peekDepth?: number;
|
|
1678
|
+
/** Animation configuration */
|
|
1679
|
+
animation?: AnimationConfig;
|
|
1680
|
+
/** Mobile-specific configuration */
|
|
1681
|
+
mobile?: MobileConfig;
|
|
1682
|
+
/** Peek zone gesture configuration */
|
|
1683
|
+
peekGestures?: PeekGestureConfig;
|
|
1684
|
+
/** Additional class for viewport container */
|
|
1685
|
+
className?: string;
|
|
1686
|
+
};
|
|
1687
|
+
type StackState = {
|
|
1688
|
+
cards: CardSpec[];
|
|
1689
|
+
};
|
|
1690
|
+
type StackAction = {
|
|
1691
|
+
type: 'PUSH';
|
|
1692
|
+
card: CardSpec;
|
|
1693
|
+
} | {
|
|
1694
|
+
type: 'POP';
|
|
1695
|
+
count: number;
|
|
1696
|
+
} | {
|
|
1697
|
+
type: 'POP_TO';
|
|
1698
|
+
id: CardId;
|
|
1699
|
+
} | {
|
|
1700
|
+
type: 'REPLACE_TOP';
|
|
1701
|
+
card: CardSpec;
|
|
1702
|
+
} | {
|
|
1703
|
+
type: 'RESET';
|
|
1704
|
+
cards: CardSpec[];
|
|
1705
|
+
} | {
|
|
1706
|
+
type: 'CLEAR';
|
|
1707
|
+
} | {
|
|
1708
|
+
type: 'UPDATE_PROPS';
|
|
1709
|
+
id: CardId;
|
|
1710
|
+
patch: unknown;
|
|
1711
|
+
} | {
|
|
1712
|
+
type: 'SET_TITLE';
|
|
1713
|
+
id: CardId;
|
|
1714
|
+
title?: string;
|
|
1715
|
+
} | {
|
|
1716
|
+
type: 'SET_DESCRIPTION';
|
|
1717
|
+
id: CardId;
|
|
1718
|
+
description?: string;
|
|
1719
|
+
} | {
|
|
1720
|
+
type: 'SET_WIDTH';
|
|
1721
|
+
id: CardId;
|
|
1722
|
+
width?: string | number;
|
|
1723
|
+
} | {
|
|
1724
|
+
type: 'DISMISS';
|
|
1725
|
+
id: CardId;
|
|
1726
|
+
cascade: boolean;
|
|
1727
|
+
} | {
|
|
1728
|
+
type: 'INSERT_AT';
|
|
1729
|
+
index: number;
|
|
1730
|
+
card: CardSpec;
|
|
1731
|
+
};
|
|
1732
|
+
type StackContextValue = {
|
|
1733
|
+
state: StackState;
|
|
1734
|
+
api: CardStackApi;
|
|
1735
|
+
config: {
|
|
1736
|
+
routes: CardRouteMap;
|
|
1737
|
+
zIndexBase: number;
|
|
1738
|
+
layoutMode: LayoutMode;
|
|
1739
|
+
defaultPeekOffset: number;
|
|
1740
|
+
defaultWidth: string | number;
|
|
1741
|
+
};
|
|
1742
|
+
};
|
|
1743
|
+
|
|
1744
|
+
declare function CardStackProvider({ children, routes, initial, onChange, zIndexBase, layoutMode, defaultPeekOffset, defaultWidth, }: CardStackProviderProps): react_jsx_runtime.JSX.Element;
|
|
1745
|
+
declare function useCardStack(): CardStackApi;
|
|
1746
|
+
declare function useStackContext(): StackContextValue;
|
|
1747
|
+
/** Hook to get current layout mode */
|
|
1748
|
+
declare function useStackLayoutMode(): LayoutMode;
|
|
1749
|
+
/** Hook to get stack cards (triggers re-render on change) */
|
|
1750
|
+
declare function useStackCards(): CardSpec[];
|
|
1751
|
+
/** Hook to check if a card is the top card */
|
|
1752
|
+
declare function useIsTopCard(id: CardId): boolean;
|
|
1753
|
+
/** Hook to get card index in stack */
|
|
1754
|
+
declare function useCardIndex(id: CardId): number;
|
|
1755
|
+
/** Create injected card props for a specific card */
|
|
1756
|
+
declare function useCardInjectedProps(id: CardId): {
|
|
1757
|
+
card: {
|
|
1758
|
+
id: string;
|
|
1759
|
+
push: <P>(card: Omit<CardSpec<P>, "id"> & {
|
|
1760
|
+
id?: CardId;
|
|
1761
|
+
}, options?: CardPushOptions) => CardId;
|
|
1762
|
+
close: () => void;
|
|
1763
|
+
setTitle: (title?: string) => void;
|
|
1764
|
+
setDescription: (description?: string) => void;
|
|
1765
|
+
setWidth: (width?: string | number) => void;
|
|
1766
|
+
updateProps: <P>(patch: Partial<P> | ((prev: P) => P)) => void;
|
|
1767
|
+
};
|
|
1768
|
+
};
|
|
1769
|
+
/**
|
|
1770
|
+
* Hook to check if the card's enter animation is complete.
|
|
1771
|
+
* Use this to defer data fetching until after the slide-in animation.
|
|
1772
|
+
*
|
|
1773
|
+
* @example
|
|
1774
|
+
* ```tsx
|
|
1775
|
+
* function MyCard() {
|
|
1776
|
+
* const { isReady } = useCardReady();
|
|
1777
|
+
*
|
|
1778
|
+
* // Data query that only runs after animation completes
|
|
1779
|
+
* const { data, isLoading } = useQuery({
|
|
1780
|
+
* queryKey: ['myData'],
|
|
1781
|
+
* queryFn: fetchData,
|
|
1782
|
+
* enabled: isReady, // Don't fetch until animation done
|
|
1783
|
+
* });
|
|
1784
|
+
*
|
|
1785
|
+
* return (
|
|
1786
|
+
* <Select disabled={isLoading || !isReady}>
|
|
1787
|
+
* {data?.map(item => <SelectItem key={item.id}>{item.name}</SelectItem>)}
|
|
1788
|
+
* </Select>
|
|
1789
|
+
* );
|
|
1790
|
+
* }
|
|
1791
|
+
* ```
|
|
1792
|
+
*/
|
|
1793
|
+
declare function useCardReady(): {
|
|
1794
|
+
isReady: boolean;
|
|
1795
|
+
};
|
|
1796
|
+
|
|
1797
|
+
declare function CardStackViewport({ backdrop, renderBackdrop, renderHeader, renderEmpty, peekDepth, animation, mobile, peekGestures, className, }: CardStackViewportProps): string | number | bigint | boolean | Iterable<React$1.ReactNode> | Promise<string | number | bigint | boolean | React$1.ReactPortal | React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | Iterable<React$1.ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null | undefined;
|
|
1798
|
+
|
|
1799
|
+
type StackBackdropProps = {
|
|
1800
|
+
/** Additional class names */
|
|
1801
|
+
className?: string;
|
|
1802
|
+
/** Click handler (typically closes the stack) */
|
|
1803
|
+
onClick?: () => void;
|
|
1804
|
+
/** Backdrop configuration (blur, custom className) */
|
|
1805
|
+
config?: BackdropConfig;
|
|
1806
|
+
};
|
|
1807
|
+
declare function StackBackdrop({ className, onClick, config: backdropConfig }: StackBackdropProps): react_jsx_runtime.JSX.Element;
|
|
1808
|
+
|
|
1809
|
+
type StackHeaderProps = {
|
|
1810
|
+
/** The card spec */
|
|
1811
|
+
card: CardSpec;
|
|
1812
|
+
/** Close handler */
|
|
1813
|
+
onClose: () => void;
|
|
1814
|
+
/** Additional class names */
|
|
1815
|
+
className?: string;
|
|
1816
|
+
/** Custom title renderer */
|
|
1817
|
+
renderTitle?: (card: CardSpec) => React$1.ReactNode;
|
|
1818
|
+
};
|
|
1819
|
+
declare function StackHeader({ card, onClose, className, renderTitle }: StackHeaderProps): react_jsx_runtime.JSX.Element;
|
|
1820
|
+
type StackHeaderSlotProps = {
|
|
1821
|
+
/** Additional class names */
|
|
1822
|
+
className?: string;
|
|
1823
|
+
children: React$1.ReactNode;
|
|
1824
|
+
};
|
|
1825
|
+
/** Slot for custom header content */
|
|
1826
|
+
declare function StackHeaderSlot({ className, children }: StackHeaderSlotProps): react_jsx_runtime.JSX.Element;
|
|
1827
|
+
|
|
1828
|
+
type StackCardProps = {
|
|
1829
|
+
/** The card specification */
|
|
1830
|
+
card: CardSpec;
|
|
1831
|
+
/** Index of this card in the stack */
|
|
1832
|
+
index: number;
|
|
1833
|
+
/** Total number of cards in the stack */
|
|
1834
|
+
totalCards: number;
|
|
1835
|
+
/** Width of the top card (for side-by-side calculations) */
|
|
1836
|
+
topCardWidth: number;
|
|
1837
|
+
/** Animation configuration */
|
|
1838
|
+
animation?: AnimationConfig;
|
|
1839
|
+
/** Whether this is a mobile viewport */
|
|
1840
|
+
isMobile?: boolean;
|
|
1841
|
+
/** Gesture configuration for mobile */
|
|
1842
|
+
gestureConfig?: GestureConfig;
|
|
1843
|
+
/** Peek gesture configuration */
|
|
1844
|
+
peekGestureConfig?: PeekGestureConfig;
|
|
1845
|
+
/** Custom header renderer */
|
|
1846
|
+
renderHeader?: (card: CardSpec, api: CardStackApi) => React$1.ReactNode;
|
|
1847
|
+
/** Compression ratio for responsive offset (1 = full, 0 = collapsed) */
|
|
1848
|
+
compressionRatio?: number;
|
|
1849
|
+
/** Adjusted peek offset after compression */
|
|
1850
|
+
adjustedPeekOffset?: number;
|
|
1851
|
+
/** Drag state from gesture hook (for top card swipe-to-dismiss) */
|
|
1852
|
+
dragX?: number;
|
|
1853
|
+
/** Gesture bind from @use-gesture/react */
|
|
1854
|
+
gestureBind?: ReturnType<typeof _use_gesture_react.useDrag>;
|
|
1855
|
+
/** Whether this card's peek zone is hovered (viewport-coordinated) */
|
|
1856
|
+
isPeekHovered?: boolean;
|
|
1857
|
+
/** Callback when peek hover starts */
|
|
1858
|
+
onPeekHoverStart?: (cardIndex: number) => void;
|
|
1859
|
+
/** Callback when peek hover ends */
|
|
1860
|
+
onPeekHoverEnd?: (cardIndex: number) => void;
|
|
1861
|
+
/** Peek drag offset applied to this card (when cards above are being dragged via peek zone) */
|
|
1862
|
+
peekDragOffset?: number;
|
|
1863
|
+
/** Callback when peek drag starts on this card's peek zone */
|
|
1864
|
+
onPeekDragStart?: (cardIndex: number) => void;
|
|
1865
|
+
/** Callback during peek drag on this card's peek zone */
|
|
1866
|
+
onPeekDrag?: (cardIndex: number, offset: number) => void;
|
|
1867
|
+
/** Callback when peek drag ends on this card's peek zone */
|
|
1868
|
+
onPeekDragEnd?: (cardIndex: number, shouldDismiss: boolean) => void;
|
|
1869
|
+
/** Whether this is the last card (for exit animation with fade) */
|
|
1870
|
+
isLastCard?: boolean;
|
|
1871
|
+
/** Additional class name for the card */
|
|
1872
|
+
className?: string;
|
|
1873
|
+
};
|
|
1874
|
+
declare function StackCardInner({ card, index, totalCards, topCardWidth, animation, isMobile, renderHeader, peekGestureConfig, compressionRatio, adjustedPeekOffset, dragX, gestureBind, isPeekHovered, onPeekHoverStart, onPeekHoverEnd, peekDragOffset, onPeekDragStart, onPeekDrag, onPeekDragEnd, isLastCard, className, }: StackCardProps): react_jsx_runtime.JSX.Element;
|
|
1875
|
+
declare const StackCard: React$1.MemoExoticComponent<typeof StackCardInner>;
|
|
1876
|
+
|
|
1877
|
+
interface DeferredCardContentProps {
|
|
1878
|
+
children: React.ReactNode;
|
|
1879
|
+
/** Custom placeholder while waiting for animation to complete */
|
|
1880
|
+
placeholder?: React.ReactNode;
|
|
1881
|
+
/** Delay in ms before showing content (default: 220, slightly after 200ms animation) */
|
|
1882
|
+
delay?: number;
|
|
1883
|
+
/** Whether to show content immediately (useful for edit mode where data is cached) */
|
|
1884
|
+
immediate?: boolean;
|
|
1885
|
+
/**
|
|
1886
|
+
* Priority level for scheduling content render:
|
|
1887
|
+
* - 'high': Uses half the delay for faster content display
|
|
1888
|
+
* - 'normal': Standard delay with rAF (default)
|
|
1889
|
+
* - 'low': Uses requestIdleCallback when available for non-critical content
|
|
1890
|
+
*/
|
|
1891
|
+
priority?: 'high' | 'normal' | 'low';
|
|
1892
|
+
/** Callback when content becomes ready to render */
|
|
1893
|
+
onReady?: () => void;
|
|
1894
|
+
}
|
|
1895
|
+
/**
|
|
1896
|
+
* Defers rendering of heavy content until after Stack card animation completes.
|
|
1897
|
+
* This prevents layout thrashing and dropped frames during the slide-in animation.
|
|
1898
|
+
*
|
|
1899
|
+
* Usage:
|
|
1900
|
+
* ```tsx
|
|
1901
|
+
* <DeferredCardContent placeholder={<MySkeleton />}>
|
|
1902
|
+
* <HeavyContent />
|
|
1903
|
+
* </DeferredCardContent>
|
|
1904
|
+
* ```
|
|
1905
|
+
*
|
|
1906
|
+
* With priority:
|
|
1907
|
+
* ```tsx
|
|
1908
|
+
* <DeferredCardContent priority="low" placeholder={<MySkeleton />}>
|
|
1909
|
+
* <NonCriticalContent />
|
|
1910
|
+
* </DeferredCardContent>
|
|
1911
|
+
* ```
|
|
1912
|
+
*/
|
|
1913
|
+
declare function DeferredCardContent({ children, placeholder, delay, immediate, priority, onReady, }: DeferredCardContentProps): string | number | bigint | boolean | Iterable<React$1.ReactNode> | Promise<string | number | bigint | boolean | React$1.ReactPortal | React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | Iterable<React$1.ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element;
|
|
1914
|
+
|
|
1915
|
+
type UseStackResponsiveOptions = MobileConfig;
|
|
1916
|
+
type UseStackResponsiveResult = {
|
|
1917
|
+
/** Whether the current viewport is mobile-sized */
|
|
1918
|
+
isMobile: boolean;
|
|
1919
|
+
/** Current viewport width */
|
|
1920
|
+
viewportWidth: number;
|
|
1921
|
+
/** The breakpoint being used */
|
|
1922
|
+
breakpoint: number;
|
|
1923
|
+
};
|
|
1924
|
+
/**
|
|
1925
|
+
* Hook to detect mobile viewport and provide responsive information.
|
|
1926
|
+
*/
|
|
1927
|
+
declare function useStackResponsive(options?: UseStackResponsiveOptions): UseStackResponsiveResult;
|
|
1928
|
+
/**
|
|
1929
|
+
* Simple hook to just get isMobile boolean.
|
|
1930
|
+
*/
|
|
1931
|
+
declare function useIsMobile(breakpoint?: number): boolean;
|
|
1932
|
+
|
|
1933
|
+
type UseStackGesturesOptions = GestureConfig & {
|
|
1934
|
+
/** Whether gestures are enabled */
|
|
1935
|
+
enabled?: boolean;
|
|
1936
|
+
/** Callback when swipe completes and should dismiss */
|
|
1937
|
+
onDismiss: () => void;
|
|
1938
|
+
};
|
|
1939
|
+
type UseStackGesturesResult = {
|
|
1940
|
+
/** Current drag X offset */
|
|
1941
|
+
dragX: number;
|
|
1942
|
+
/** Whether currently dragging */
|
|
1943
|
+
isDragging: boolean;
|
|
1944
|
+
/** Bind function to attach to the draggable element */
|
|
1945
|
+
bind: ReturnType<typeof useDrag>;
|
|
1946
|
+
};
|
|
1947
|
+
/**
|
|
1948
|
+
* Hook for swipe-to-dismiss gesture on stack cards using @use-gesture/react.
|
|
1949
|
+
*
|
|
1950
|
+
* Features:
|
|
1951
|
+
* - Only allows swiping to the right (positive X direction)
|
|
1952
|
+
* - Ignores touches near left edge (avoids iOS Safari back gesture conflict)
|
|
1953
|
+
* - Requires horizontal intent before activating (won't interfere with scroll)
|
|
1954
|
+
* - Dismisses on release after distance or velocity threshold
|
|
1955
|
+
* - Auto-dismisses near the end of the drag (configurable)
|
|
1956
|
+
* - 1:1 finger tracking for responsive feel
|
|
1957
|
+
*/
|
|
1958
|
+
declare function useStackGestures(options: UseStackGesturesOptions): UseStackGesturesResult;
|
|
1959
|
+
|
|
1960
|
+
type UsePeekGesturesOptions = PeekGestureConfig & {
|
|
1961
|
+
/** Card index in the stack */
|
|
1962
|
+
cardIndex: number;
|
|
1963
|
+
/** Total cards in stack */
|
|
1964
|
+
totalCards: number;
|
|
1965
|
+
/** Callback when click on peek zone (dismiss cards above) */
|
|
1966
|
+
onPeekClick: () => void;
|
|
1967
|
+
/** Callback when drag completes dismiss threshold */
|
|
1968
|
+
onPeekDragDismiss: () => void;
|
|
1969
|
+
/** Callback during drag to update multi-card offset */
|
|
1970
|
+
onPeekDrag?: (dragOffset: number) => void;
|
|
1971
|
+
/** Callback when drag ends without dismiss */
|
|
1972
|
+
onPeekDragCancel?: () => void;
|
|
1973
|
+
};
|
|
1974
|
+
type UsePeekGesturesResult = {
|
|
1975
|
+
/** Whether peek zone is hovered */
|
|
1976
|
+
isHovered: boolean;
|
|
1977
|
+
/** Whether actively dragging */
|
|
1978
|
+
isDragging: boolean;
|
|
1979
|
+
/** Current drag offset (positive = dragging right/dismiss direction) */
|
|
1980
|
+
dragOffset: number;
|
|
1981
|
+
/** Hover expansion amount in px */
|
|
1982
|
+
hoverExpansion: number;
|
|
1983
|
+
/** Handlers for the peek zone element */
|
|
1984
|
+
handlers: {
|
|
1985
|
+
onMouseEnter: () => void;
|
|
1986
|
+
onMouseLeave: () => void;
|
|
1987
|
+
onClick: (e: React.MouseEvent) => void;
|
|
1988
|
+
onPointerDown: (e: React.PointerEvent) => void;
|
|
1989
|
+
onPointerMove: (e: React.PointerEvent) => void;
|
|
1990
|
+
onPointerUp: (e: React.PointerEvent) => void;
|
|
1991
|
+
onPointerCancel: (e: React.PointerEvent) => void;
|
|
1992
|
+
};
|
|
1993
|
+
};
|
|
1994
|
+
/**
|
|
1995
|
+
* Hook for peek zone interactions: hover expansion, click-to-dismiss, drag-to-dismiss.
|
|
1996
|
+
* Works on both mobile and desktop.
|
|
1997
|
+
*/
|
|
1998
|
+
declare function usePeekGestures(options: UsePeekGesturesOptions): UsePeekGesturesResult;
|
|
1999
|
+
|
|
2000
|
+
/**
|
|
2001
|
+
* Calculate the X offset for a card in cascade mode.
|
|
2002
|
+
* Cards below the top are pushed left by (cardsAbove * peekOffset).
|
|
2003
|
+
*/
|
|
2004
|
+
declare function getCascadeOffset(cardIndex: number, totalCards: number, cards: CardSpec[], defaultPeekOffset: number): number;
|
|
2005
|
+
/**
|
|
2006
|
+
* Calculate the X offset for a card in side-by-side mode.
|
|
2007
|
+
* - Top card: no offset
|
|
2008
|
+
* - Second card: pushed by top card's width (fully visible side-by-side)
|
|
2009
|
+
* - Deeper cards: cascade further with peekOffset increments
|
|
2010
|
+
*/
|
|
2011
|
+
declare function getSideBySideOffset(cardIndex: number, totalCards: number, topCardWidth: number, defaultPeekOffset: number): number;
|
|
2012
|
+
/**
|
|
2013
|
+
* Get the offset for a card based on layout mode.
|
|
2014
|
+
*/
|
|
2015
|
+
declare function getCardOffset(cardIndex: number, totalCards: number, cards: CardSpec[], layoutMode: LayoutMode, topCardWidth: number, defaultPeekOffset: number): number;
|
|
2016
|
+
type ResponsiveOffsetConfig = {
|
|
2017
|
+
viewportWidth: number;
|
|
2018
|
+
topCardWidth: number;
|
|
2019
|
+
secondCardWidth: number;
|
|
2020
|
+
totalCards: number;
|
|
2021
|
+
defaultPeekOffset: number;
|
|
2022
|
+
layoutMode: LayoutMode;
|
|
2023
|
+
};
|
|
2024
|
+
type ResponsiveOffsetResult = {
|
|
2025
|
+
/** Compression ratio (1 = full, 0 = fully compressed) */
|
|
2026
|
+
compressionRatio: number;
|
|
2027
|
+
/** Whether cards should collapse to mobile/single-card mode */
|
|
2028
|
+
shouldCollapse: boolean;
|
|
2029
|
+
/** Adjusted peek offset after compression */
|
|
2030
|
+
adjustedPeekOffset: number;
|
|
2031
|
+
/** Available space for peek offsets */
|
|
2032
|
+
availableSpace: number;
|
|
2033
|
+
};
|
|
2034
|
+
/**
|
|
2035
|
+
* Calculate responsive offset compression based on viewport width.
|
|
2036
|
+
* As viewport shrinks, offsets compress until hitting mobile breakpoint.
|
|
2037
|
+
*
|
|
2038
|
+
* The algorithm:
|
|
2039
|
+
* 1. Calculate space needed: topCardWidth + secondCardWidth (for side-by-side)
|
|
2040
|
+
* 2. Calculate available space: viewportWidth - padding
|
|
2041
|
+
* 3. If not enough space, compress the second card's offset
|
|
2042
|
+
* 4. When compression reaches threshold, trigger collapse to mobile
|
|
2043
|
+
*/
|
|
2044
|
+
declare function calculateResponsiveOffset(config: ResponsiveOffsetConfig): ResponsiveOffsetResult;
|
|
2045
|
+
/**
|
|
2046
|
+
* Get responsive card offset that compresses based on viewport.
|
|
2047
|
+
* Ensures every card has at least MIN_VISIBLE_PEEK visible past cards above it.
|
|
2048
|
+
*/
|
|
2049
|
+
declare function getResponsiveCardOffset(cardIndex: number, totalCards: number, cards: CardSpec[], layoutMode: LayoutMode, topCardWidth: number, adjustedPeekOffset: number, compressionRatio: number, defaultWidth?: number): number;
|
|
2050
|
+
/**
|
|
2051
|
+
* Normalize width to CSS value.
|
|
2052
|
+
*/
|
|
2053
|
+
declare function normalizeWidth(width: string | number | undefined, defaultWidth: string | number): string;
|
|
2054
|
+
/**
|
|
2055
|
+
* Parse width to pixels (for offset calculations).
|
|
2056
|
+
* Returns undefined if width cannot be parsed to pixels.
|
|
2057
|
+
*/
|
|
2058
|
+
declare function parseWidthToPixels(width: string | number | undefined): number | undefined;
|
|
2059
|
+
/**
|
|
2060
|
+
* Calculate z-index for a card based on its position in the stack.
|
|
2061
|
+
*/
|
|
2062
|
+
declare function getCardZIndex(cardIndex: number, zIndexBase: number): number;
|
|
2063
|
+
/**
|
|
2064
|
+
* Determine which cards should be rendered based on peekDepth.
|
|
2065
|
+
* Returns indices of cards that should be rendered (from bottom to top).
|
|
2066
|
+
*/
|
|
2067
|
+
declare function getVisibleCardIndices(totalCards: number, peekDepth: number): number[];
|
|
2068
|
+
/**
|
|
2069
|
+
* Check if a card should be rendered based on peekDepth.
|
|
2070
|
+
*/
|
|
2071
|
+
declare function isCardVisible(cardIndex: number, totalCards: number, peekDepth: number): boolean;
|
|
2072
|
+
|
|
2073
|
+
declare const DEFAULT_ANIMATION_CONFIG: Required<AnimationConfig>;
|
|
2074
|
+
/**
|
|
2075
|
+
* Create motion variants for card enter/exit animations.
|
|
2076
|
+
* Uses transform-only properties for GPU compositing.
|
|
2077
|
+
*/
|
|
2078
|
+
declare function createCardVariants(config?: AnimationConfig): Variants;
|
|
2079
|
+
/**
|
|
2080
|
+
* Create transition for offset animations (when cards above change).
|
|
2081
|
+
* Uses spring for playful slide-back feel when cards are dismissed.
|
|
2082
|
+
*/
|
|
2083
|
+
declare function createOffsetTransition(_config?: AnimationConfig): Transition;
|
|
2084
|
+
declare const backdropVariants: Variants;
|
|
2085
|
+
/**
|
|
2086
|
+
* Create spring config for snap-back animation after cancelled swipe.
|
|
2087
|
+
*/
|
|
2088
|
+
declare const snapBackSpring: Transition;
|
|
2089
|
+
/**
|
|
2090
|
+
* Create transition for swipe-to-dismiss.
|
|
2091
|
+
*/
|
|
2092
|
+
declare const swipeDismissTransition: Transition;
|
|
2093
|
+
/** Spring config for peek hover expansion - playful and bouncy */
|
|
2094
|
+
declare const peekHoverSpring: Transition;
|
|
2095
|
+
/** Spring config for peek drag - responsive during interaction */
|
|
2096
|
+
declare const peekDragSpring: Transition;
|
|
2097
|
+
/** Spring config for multi-card slide during peek drag */
|
|
2098
|
+
declare const peekSlideSpring: Transition;
|
|
2099
|
+
/**
|
|
2100
|
+
* Create variants with reduced motion support.
|
|
2101
|
+
* Instant transitions when user prefers reduced motion.
|
|
2102
|
+
*/
|
|
2103
|
+
declare function createReducedMotionVariants(): Variants;
|
|
2104
|
+
declare const reducedMotionBackdropVariants: Variants;
|
|
2105
|
+
|
|
2106
|
+
interface ToastErrorProps {
|
|
2107
|
+
message: string;
|
|
2108
|
+
description?: string;
|
|
2109
|
+
action?: {
|
|
2110
|
+
label: string;
|
|
2111
|
+
onClick: () => void;
|
|
2112
|
+
};
|
|
2113
|
+
onDismiss?: () => void;
|
|
2114
|
+
}
|
|
2115
|
+
declare function showErrorToast(props: ToastErrorProps): string | number;
|
|
2116
|
+
|
|
2117
|
+
interface ToastInfoProps {
|
|
2118
|
+
message: string;
|
|
2119
|
+
description?: string;
|
|
2120
|
+
action?: {
|
|
2121
|
+
label: string;
|
|
2122
|
+
onClick: () => void;
|
|
2123
|
+
};
|
|
2124
|
+
onDismiss?: () => void;
|
|
2125
|
+
}
|
|
2126
|
+
declare function showInfoToast(props: ToastInfoProps): string | number;
|
|
2127
|
+
|
|
2128
|
+
interface ToastSuccessProps {
|
|
2129
|
+
message: string;
|
|
2130
|
+
description?: string;
|
|
2131
|
+
action?: {
|
|
2132
|
+
label: string;
|
|
2133
|
+
onClick: () => void;
|
|
2134
|
+
};
|
|
2135
|
+
onDismiss?: () => void;
|
|
2136
|
+
}
|
|
2137
|
+
declare function showSuccessToast(props: ToastSuccessProps): string | number;
|
|
2138
|
+
|
|
2139
|
+
interface ToastWarningProps {
|
|
2140
|
+
message: string;
|
|
2141
|
+
description?: string;
|
|
2142
|
+
action?: {
|
|
2143
|
+
label: string;
|
|
2144
|
+
onClick: () => void;
|
|
2145
|
+
};
|
|
2146
|
+
onDismiss?: () => void;
|
|
2147
|
+
}
|
|
2148
|
+
declare function showWarningToast(props: ToastWarningProps): string | number;
|
|
2149
|
+
|
|
2150
|
+
declare const toast: {
|
|
2151
|
+
error: typeof showErrorToast;
|
|
2152
|
+
info: typeof showInfoToast;
|
|
2153
|
+
success: typeof showSuccessToast;
|
|
2154
|
+
warning: typeof showWarningToast;
|
|
2155
|
+
};
|
|
2156
|
+
|
|
2157
|
+
export { Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, type AnimationConfig, Autocomplete, AutocompleteEmpty, AutocompleteInput, AutocompleteItem, AutocompletePopup, AutocompleteSeparator, Avatar, AvatarFallback, AvatarImage, type BackdropConfig, Badge, type BadgeProps, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, type ButtonProps, Calendar, Card, CardAction, type CardComponent, CardContent, CardDescription, CardFooter, CardHeader, type CardId, type CardInjectedProps, type CardProps, type CardPushOptions, type CardRouteDefinition, type CardRouteMap, type CardSpec, type CardStackApi, CardStackProvider, type CardStackProviderProps, CardStackViewport, type CardStackViewportProps, CardTitle, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, Collapsible, CollapsiblePanel as CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxContent, type ComboboxContentProps, ComboboxEmpty, type ComboboxEmptyProps, ComboboxGroup, type ComboboxGroupProps, ComboboxInput, type ComboboxInputProps, ComboboxItem, type ComboboxItemProps, ComboboxList, type ComboboxListProps, type ComboboxProps, ComboboxSeparator, type ComboboxSeparatorProps, ComboboxTrigger, type ComboboxTriggerProps, Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, DEFAULT_ANIMATION_CONFIG, DeferredCardContent, type DeferredCardContentProps, Dialog, DialogBackdrop, DialogClose, DialogPopup as DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogPortal, DialogTitle, DialogTrigger, type DismissOptions, Dock, DockIcon, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Field, type FieldProps, FieldRow, type FieldRowProps, FlickeringGrid, type FloatingPortalStrategy, type FloatingZIndex, Form, FormControl$1 as FormControl, FormControl as FormControlComponent, type FormControlLayout, FormDescription, FormField, FormItem, FormLabel, FormMessage, type Frame, type FrameDot, type Frames, type GestureConfig, Input, InputGroup, InputGroupAddon, InputGroupInput, InputGroupText, InputGroupTextarea, type InputProps, JsonEditor, JsonInput, Label, type LabelProps, type LayoutMode, type MobileConfig, ModalPortalScope, MotionGrid, type MotionGridProps, MultiSelect, type MultiSelectGroup, type MultiSelectOption, type MultiSelectProps, type MultiSelectRef, type OverlayLayer, PORTAL_ROOT_ID, PageHeader, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, type PeekGestureConfig, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PortalRoot, Progress, type ProgressProps, ProgressiveBlur, ProgressiveBlurScrollContainer, type PushOptions, Radio, RadioGroup, Radio as RadioGroupItem, type RadioGroupProps, type RadioProps, RangeCalendar, RecordPicker, ResizableHandle, ResizablePanel, ResizablePanelGroup, ResponsiveDiagram, type ResponsiveOffsetConfig, type ResponsiveOffsetResult, ScrollArea, ScrollBar, Select, SelectPopup as SelectContent, SelectFieldItem, SelectGroup, SelectGroupLabel, SelectItem, SelectGroupLabel as SelectLabel, SelectPopup, SelectRichItem, SelectSeparator, SelectTrigger, SelectValue, Separator, type SeparatorProps, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarSeparator, SidebarTrigger, Skeleton, type SkeletonProps, Slot, Slottable, type StackAction, StackBackdrop, type StackBackdropProps, StackCard, type StackCardProps, type StackContextValue, StackHeader, type StackHeaderProps, StackHeaderSlot, type StackHeaderSlotProps, type StackState, Stepper, StepperDescription, StepperIndicator, StepperItem, StepperSeparator, StepperTitle, StepperTrigger, Switch, type SwitchProps, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tags, TagsContent, type TagsContentProps, TagsEmpty, type TagsEmptyProps, TagsGroup, type TagsGroupProps, TagsInput, type TagsInputProps, TagsItem, type TagsItemProps, TagsList, type TagsListProps, type TagsProps, TagsTrigger, type TagsTriggerProps, TagsValue, type TagsValueProps, Textarea, type TextareaProps, type ToastErrorProps, type ToastInfoProps, type ToastSuccessProps, type ToastWarningProps, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, UnlinkButton, type UsePeekGesturesOptions, type UsePeekGesturesResult, type UseStackGesturesResult, type UseStackResponsiveResult, alertVariants, backdropVariants, badgeVariants, buttonVariants, calculateResponsiveOffset, cardVariants, cn, composeRefs, createCardVariants, createOffsetTransition, createReducedMotionVariants, dockVariants, durations, easings, getCardOffset, getCardZIndex, getCascadeOffset, getResponsiveCardOffset, getSideBySideOffset, getVisibleCardIndices, isCardVisible, mergeProps, normalizeWidth, parseWidthToPixels, peekDragSpring, peekHoverSpring, peekSlideSpring, reducedMotionBackdropVariants, showErrorToast, showInfoToast, showSuccessToast, showWarningToast, snapBackSpring, springs, swipeDismissTransition, toast, transitions, useCardIndex, useCardInjectedProps, useCardReady, useCardStack, useControllableState, useFloatingOverlayPortalProps, useFormField, useInModalOverlay, useIsMobile, useIsTopCard, usePeekGestures, usePortalContainer, usePortalContext, useRootPortalContainer, useSidebar, useStackCards, useStackContext, useStackGestures, useStackLayoutMode, useStackResponsive, validateJson, variants };
|