@optilogic/core 1.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +107 -0
- package/dist/index.cjs +6003 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +2310 -0
- package/dist/index.d.ts +2310 -0
- package/dist/index.js +5828 -0
- package/dist/index.js.map +1 -0
- package/dist/styles.css +96 -0
- package/dist/tailwind-preset.cjs +106 -0
- package/dist/tailwind-preset.cjs.map +1 -0
- package/dist/tailwind-preset.d.cts +23 -0
- package/dist/tailwind-preset.d.ts +23 -0
- package/dist/tailwind-preset.js +101 -0
- package/dist/tailwind-preset.js.map +1 -0
- package/package.json +154 -0
- package/src/components/accordion.tsx +187 -0
- package/src/components/alert-dialog.tsx +143 -0
- package/src/components/autocomplete.tsx +271 -0
- package/src/components/badge.tsx +62 -0
- package/src/components/button.tsx +85 -0
- package/src/components/calendar.tsx +235 -0
- package/src/components/card.tsx +94 -0
- package/src/components/checkbox.tsx +77 -0
- package/src/components/chip.tsx +77 -0
- package/src/components/confirmation-modal.tsx +195 -0
- package/src/components/context-menu.tsx +406 -0
- package/src/components/copy-button.tsx +84 -0
- package/src/components/data-grid/DataGrid.tsx +1027 -0
- package/src/components/data-grid/components/CellEditor.tsx +346 -0
- package/src/components/data-grid/components/FilterPopover.tsx +459 -0
- package/src/components/data-grid/components/HeaderCell.tsx +207 -0
- package/src/components/data-grid/components/index.ts +14 -0
- package/src/components/data-grid/hooks/index.ts +28 -0
- package/src/components/data-grid/hooks/useColumnResize.ts +378 -0
- package/src/components/data-grid/hooks/useDataGridState.ts +346 -0
- package/src/components/data-grid/hooks/useKeyboardNavigation.ts +361 -0
- package/src/components/data-grid/index.ts +71 -0
- package/src/components/data-grid/types.ts +478 -0
- package/src/components/data-grid/utils/dataProcessing.ts +277 -0
- package/src/components/data-grid/utils/index.ts +12 -0
- package/src/components/date-picker.tsx +366 -0
- package/src/components/dropdown-menu.tsx +230 -0
- package/src/components/icon-button.tsx +157 -0
- package/src/components/input.tsx +40 -0
- package/src/components/label.tsx +37 -0
- package/src/components/loading-spinner.tsx +113 -0
- package/src/components/modal.tsx +207 -0
- package/src/components/popover.tsx +62 -0
- package/src/components/progress.tsx +41 -0
- package/src/components/resizable-panel.tsx +434 -0
- package/src/components/resize-handle.tsx +187 -0
- package/src/components/select.tsx +160 -0
- package/src/components/separator.tsx +50 -0
- package/src/components/skeleton.tsx +37 -0
- package/src/components/switch.tsx +59 -0
- package/src/components/table.tsx +136 -0
- package/src/components/tabs.tsx +102 -0
- package/src/components/textarea.tsx +36 -0
- package/src/components/theme-picker.tsx +245 -0
- package/src/components/toaster.tsx +84 -0
- package/src/components/tooltip.tsx +199 -0
- package/src/index.ts +318 -0
- package/src/styles.css +96 -0
- package/src/tailwind-preset.ts +129 -0
- package/src/theme/index.ts +41 -0
- package/src/theme/presets.ts +502 -0
- package/src/theme/types.ts +164 -0
- package/src/theme/utils.ts +309 -0
- package/src/utils/cn.ts +14 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,2310 @@
|
|
|
1
|
+
import { ClassValue } from 'clsx';
|
|
2
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
3
|
+
import * as React$1 from 'react';
|
|
4
|
+
import { VariantProps } from 'class-variance-authority';
|
|
5
|
+
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
6
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
7
|
+
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
8
|
+
import * as SwitchPrimitive from '@radix-ui/react-switch';
|
|
9
|
+
import * as ProgressPrimitive from '@radix-ui/react-progress';
|
|
10
|
+
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
11
|
+
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
12
|
+
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
13
|
+
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
14
|
+
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
15
|
+
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
16
|
+
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
17
|
+
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
|
|
18
|
+
import { DayPickerProps } from 'react-day-picker';
|
|
19
|
+
import { LucideIcon } from 'lucide-react';
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Utility function to merge Tailwind CSS classes with proper precedence.
|
|
23
|
+
* Combines clsx for conditional classes with tailwind-merge for deduplication.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* cn("px-4 py-2", "px-6") // => "py-2 px-6"
|
|
27
|
+
* cn("text-red-500", isActive && "text-blue-500") // => conditional
|
|
28
|
+
*/
|
|
29
|
+
declare function cn(...inputs: ClassValue[]): string;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Button variant styles using class-variance-authority.
|
|
33
|
+
* Provides consistent button styling across the application.
|
|
34
|
+
*/
|
|
35
|
+
declare const buttonVariants: (props?: ({
|
|
36
|
+
variant?: "default" | "primary" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
|
|
37
|
+
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
38
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
39
|
+
interface ButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
40
|
+
/**
|
|
41
|
+
* If true, the button will render as its child element (Slot pattern).
|
|
42
|
+
* Useful for wrapping other components like links.
|
|
43
|
+
*/
|
|
44
|
+
asChild?: boolean;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Button Component
|
|
48
|
+
*
|
|
49
|
+
* A versatile button component with multiple variants and sizes.
|
|
50
|
+
* Supports the Slot pattern for composing with other elements.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* <Button variant="primary">Click me</Button>
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* <Button variant="ghost" size="icon">
|
|
57
|
+
* <Icon />
|
|
58
|
+
* </Button>
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* <Button asChild>
|
|
62
|
+
* <a href="/link">Link Button</a>
|
|
63
|
+
* </Button>
|
|
64
|
+
*/
|
|
65
|
+
declare const Button: React$1.ForwardRefExoticComponent<ButtonProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
66
|
+
|
|
67
|
+
interface InputProps extends React$1.InputHTMLAttributes<HTMLInputElement> {
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Input Component
|
|
71
|
+
*
|
|
72
|
+
* A styled text input with consistent theming.
|
|
73
|
+
* Supports all native input attributes.
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* <Input placeholder="Enter your name" />
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* <Input type="email" placeholder="email@example.com" />
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* <Input disabled value="Disabled input" />
|
|
83
|
+
*/
|
|
84
|
+
declare const Input: React$1.ForwardRefExoticComponent<InputProps & React$1.RefAttributes<HTMLInputElement>>;
|
|
85
|
+
|
|
86
|
+
declare const labelVariants: (props?: class_variance_authority_types.ClassProp | undefined) => string;
|
|
87
|
+
interface LabelProps extends React$1.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>, VariantProps<typeof labelVariants> {
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Label Component
|
|
91
|
+
*
|
|
92
|
+
* A form label component with consistent styling.
|
|
93
|
+
* Automatically associates with form controls via htmlFor.
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* <Label htmlFor="email">Email</Label>
|
|
97
|
+
* <Input id="email" type="email" />
|
|
98
|
+
*/
|
|
99
|
+
declare const Label: React$1.ForwardRefExoticComponent<LabelProps & React$1.RefAttributes<HTMLLabelElement>>;
|
|
100
|
+
|
|
101
|
+
interface TextareaProps extends React$1.TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Textarea Component
|
|
105
|
+
*
|
|
106
|
+
* A styled multi-line text input with consistent theming.
|
|
107
|
+
* Supports all native textarea attributes.
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* <Textarea placeholder="Enter description..." />
|
|
111
|
+
*
|
|
112
|
+
* @example
|
|
113
|
+
* <Textarea rows={5} placeholder="Write your message..." />
|
|
114
|
+
*/
|
|
115
|
+
declare const Textarea: React$1.ForwardRefExoticComponent<TextareaProps & React$1.RefAttributes<HTMLTextAreaElement>>;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Badge variant styles using class-variance-authority.
|
|
119
|
+
*/
|
|
120
|
+
declare const badgeVariants: (props?: ({
|
|
121
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | "muted" | "success" | "warning" | "accent" | null | undefined;
|
|
122
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
123
|
+
interface BadgeProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Badge Component
|
|
127
|
+
*
|
|
128
|
+
* A small status indicator with various semantic variants.
|
|
129
|
+
* Use for tags, labels, counts, or status indicators.
|
|
130
|
+
*
|
|
131
|
+
* @example
|
|
132
|
+
* <Badge>Default</Badge>
|
|
133
|
+
*
|
|
134
|
+
* @example
|
|
135
|
+
* <Badge variant="success">Active</Badge>
|
|
136
|
+
*
|
|
137
|
+
* @example
|
|
138
|
+
* <Badge variant="destructive">Error</Badge>
|
|
139
|
+
*/
|
|
140
|
+
declare function Badge({ className, variant, ...props }: BadgeProps): react_jsx_runtime.JSX.Element;
|
|
141
|
+
|
|
142
|
+
interface CheckboxProps extends React$1.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root> {
|
|
143
|
+
/**
|
|
144
|
+
* Whether to show a visible border around the checkbox.
|
|
145
|
+
* @default true
|
|
146
|
+
*/
|
|
147
|
+
showBorder?: boolean;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Checkbox Component
|
|
151
|
+
*
|
|
152
|
+
* An accessible checkbox input built on Radix UI primitives.
|
|
153
|
+
* Supports controlled and uncontrolled modes.
|
|
154
|
+
*
|
|
155
|
+
* @example
|
|
156
|
+
* <Checkbox id="terms" />
|
|
157
|
+
* <Label htmlFor="terms">Accept terms</Label>
|
|
158
|
+
*
|
|
159
|
+
* @example
|
|
160
|
+
* <Checkbox checked={isChecked} onCheckedChange={setIsChecked} />
|
|
161
|
+
*/
|
|
162
|
+
declare const Checkbox: React$1.ForwardRefExoticComponent<CheckboxProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
163
|
+
|
|
164
|
+
interface SwitchProps extends React$1.ComponentPropsWithoutRef<typeof SwitchPrimitive.Root> {
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Switch Component
|
|
168
|
+
*
|
|
169
|
+
* A toggle switch for boolean on/off states.
|
|
170
|
+
* Accessible alternative to checkbox for settings.
|
|
171
|
+
*
|
|
172
|
+
* @example
|
|
173
|
+
* <Switch id="notifications" />
|
|
174
|
+
* <Label htmlFor="notifications">Enable notifications</Label>
|
|
175
|
+
*
|
|
176
|
+
* @example
|
|
177
|
+
* <Switch checked={isEnabled} onCheckedChange={setIsEnabled} />
|
|
178
|
+
*/
|
|
179
|
+
declare const Switch: React$1.ForwardRefExoticComponent<SwitchProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
180
|
+
|
|
181
|
+
interface ProgressProps extends React$1.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root> {
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Progress Component
|
|
185
|
+
*
|
|
186
|
+
* A progress bar showing completion percentage.
|
|
187
|
+
* Use for loading states, file uploads, or task progress.
|
|
188
|
+
*
|
|
189
|
+
* @example
|
|
190
|
+
* <Progress value={50} />
|
|
191
|
+
*
|
|
192
|
+
* @example
|
|
193
|
+
* <Progress value={progress} className="w-[60%]" />
|
|
194
|
+
*/
|
|
195
|
+
declare const Progress: React$1.ForwardRefExoticComponent<ProgressProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
196
|
+
|
|
197
|
+
interface SeparatorProps extends React$1.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root> {
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Separator Component
|
|
201
|
+
*
|
|
202
|
+
* A visual divider between content sections.
|
|
203
|
+
* Can be horizontal (default) or vertical.
|
|
204
|
+
*
|
|
205
|
+
* @example
|
|
206
|
+
* <div>Content above</div>
|
|
207
|
+
* <Separator />
|
|
208
|
+
* <div>Content below</div>
|
|
209
|
+
*
|
|
210
|
+
* @example
|
|
211
|
+
* <div className="flex items-center gap-4">
|
|
212
|
+
* <span>Left</span>
|
|
213
|
+
* <Separator orientation="vertical" className="h-4" />
|
|
214
|
+
* <span>Right</span>
|
|
215
|
+
* </div>
|
|
216
|
+
*/
|
|
217
|
+
declare const Separator: React$1.ForwardRefExoticComponent<SeparatorProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
218
|
+
|
|
219
|
+
interface SkeletonProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Skeleton Component
|
|
223
|
+
*
|
|
224
|
+
* A loading placeholder with shimmer animation.
|
|
225
|
+
* Use to indicate content that is loading.
|
|
226
|
+
*
|
|
227
|
+
* @example
|
|
228
|
+
* // Text placeholder
|
|
229
|
+
* <Skeleton className="h-4 w-[250px]" />
|
|
230
|
+
*
|
|
231
|
+
* @example
|
|
232
|
+
* // Avatar placeholder
|
|
233
|
+
* <Skeleton className="h-12 w-12 rounded-full" />
|
|
234
|
+
*
|
|
235
|
+
* @example
|
|
236
|
+
* // Card placeholder
|
|
237
|
+
* <div className="space-y-2">
|
|
238
|
+
* <Skeleton className="h-4 w-[250px]" />
|
|
239
|
+
* <Skeleton className="h-4 w-[200px]" />
|
|
240
|
+
* </div>
|
|
241
|
+
*/
|
|
242
|
+
declare function Skeleton({ className, ...props }: SkeletonProps): react_jsx_runtime.JSX.Element;
|
|
243
|
+
|
|
244
|
+
declare const Select: React$1.FC<SelectPrimitive.SelectProps>;
|
|
245
|
+
declare const SelectGroup: React$1.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
246
|
+
declare const SelectValue: React$1.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React$1.RefAttributes<HTMLSpanElement>>;
|
|
247
|
+
interface SelectTriggerProps extends React$1.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger> {
|
|
248
|
+
}
|
|
249
|
+
declare const SelectTrigger: React$1.ForwardRefExoticComponent<SelectTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
250
|
+
declare const SelectScrollUpButton: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollUpButtonProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
251
|
+
declare const SelectScrollDownButton: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollDownButtonProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
252
|
+
declare const SelectContent: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
253
|
+
declare const SelectLabel: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectLabelProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
254
|
+
declare const SelectItem: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
255
|
+
declare const SelectSeparator: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectSeparatorProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* Tabs Root
|
|
259
|
+
*
|
|
260
|
+
* Container for tabbed content. Controls which tab is active.
|
|
261
|
+
*
|
|
262
|
+
* @example
|
|
263
|
+
* <Tabs defaultValue="tab1">
|
|
264
|
+
* <TabsList>
|
|
265
|
+
* <TabsTrigger value="tab1">Tab 1</TabsTrigger>
|
|
266
|
+
* <TabsTrigger value="tab2">Tab 2</TabsTrigger>
|
|
267
|
+
* </TabsList>
|
|
268
|
+
* <TabsContent value="tab1">Content 1</TabsContent>
|
|
269
|
+
* <TabsContent value="tab2">Content 2</TabsContent>
|
|
270
|
+
* </Tabs>
|
|
271
|
+
*/
|
|
272
|
+
declare const Tabs: React$1.ForwardRefExoticComponent<TabsPrimitive.TabsProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
273
|
+
/**
|
|
274
|
+
* TabsList
|
|
275
|
+
*
|
|
276
|
+
* Container for tab triggers. Provides the tab header bar.
|
|
277
|
+
*/
|
|
278
|
+
declare const TabsList: React$1.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsListProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
279
|
+
/**
|
|
280
|
+
* TabsTrigger
|
|
281
|
+
*
|
|
282
|
+
* Individual tab button that activates its associated content.
|
|
283
|
+
*/
|
|
284
|
+
declare const TabsTrigger: React$1.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsTriggerProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
285
|
+
/**
|
|
286
|
+
* TabsContent
|
|
287
|
+
*
|
|
288
|
+
* Container for the content associated with a tab.
|
|
289
|
+
*/
|
|
290
|
+
declare const TabsContent: React$1.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* Accordion variant styles using class-variance-authority.
|
|
294
|
+
* Provides consistent accordion styling across the application.
|
|
295
|
+
*/
|
|
296
|
+
declare const accordionItemVariants: (props?: ({
|
|
297
|
+
variant?: "default" | "ghost" | "bordered" | "card" | "filled" | null | undefined;
|
|
298
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
299
|
+
declare const accordionTriggerVariants: (props?: ({
|
|
300
|
+
variant?: "default" | "ghost" | "bordered" | "card" | "filled" | null | undefined;
|
|
301
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
302
|
+
declare const accordionContentVariants: (props?: ({
|
|
303
|
+
variant?: "default" | "ghost" | "bordered" | "card" | "filled" | null | undefined;
|
|
304
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
305
|
+
/**
|
|
306
|
+
* Accordion Root
|
|
307
|
+
*
|
|
308
|
+
* Container for accordion items. Can be single or multiple mode.
|
|
309
|
+
*
|
|
310
|
+
* @example
|
|
311
|
+
* <Accordion type="single" collapsible>
|
|
312
|
+
* <AccordionItem value="item-1">
|
|
313
|
+
* <AccordionTrigger>Section 1</AccordionTrigger>
|
|
314
|
+
* <AccordionContent>Content 1</AccordionContent>
|
|
315
|
+
* </AccordionItem>
|
|
316
|
+
* </Accordion>
|
|
317
|
+
*/
|
|
318
|
+
declare const Accordion: React$1.ForwardRefExoticComponent<(AccordionPrimitive.AccordionSingleProps | AccordionPrimitive.AccordionMultipleProps) & React$1.RefAttributes<HTMLDivElement>>;
|
|
319
|
+
type AccordionVariant = "default" | "bordered" | "card" | "filled" | "ghost";
|
|
320
|
+
interface AccordionItemProps extends React$1.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>, VariantProps<typeof accordionItemVariants> {
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* AccordionItem
|
|
324
|
+
*
|
|
325
|
+
* Individual accordion section containing a trigger and content.
|
|
326
|
+
* Supports variants: default, bordered, card, filled, ghost
|
|
327
|
+
*/
|
|
328
|
+
declare const AccordionItem: React$1.ForwardRefExoticComponent<AccordionItemProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
329
|
+
interface AccordionTriggerProps extends React$1.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>, VariantProps<typeof accordionTriggerVariants> {
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* AccordionTrigger
|
|
333
|
+
*
|
|
334
|
+
* Button that toggles the accordion item open/closed.
|
|
335
|
+
* Includes animated chevron indicator.
|
|
336
|
+
* Supports variants: default, bordered, card, filled, ghost
|
|
337
|
+
*/
|
|
338
|
+
declare const AccordionTrigger: React$1.ForwardRefExoticComponent<AccordionTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
339
|
+
interface AccordionContentProps extends React$1.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>, VariantProps<typeof accordionContentVariants> {
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* AccordionContent
|
|
343
|
+
*
|
|
344
|
+
* Animated content area that expands/collapses.
|
|
345
|
+
* Supports variants: default, bordered, card, filled, ghost
|
|
346
|
+
*/
|
|
347
|
+
declare const AccordionContent: React$1.ForwardRefExoticComponent<AccordionContentProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* TooltipProvider - Wrap your app with this for shared tooltip delay behavior
|
|
351
|
+
*/
|
|
352
|
+
declare const TooltipProvider: React$1.FC<TooltipPrimitive.TooltipProviderProps>;
|
|
353
|
+
/**
|
|
354
|
+
* TooltipRoot - The root component for controlled usage
|
|
355
|
+
*/
|
|
356
|
+
declare const TooltipRoot: React$1.FC<TooltipPrimitive.TooltipProps>;
|
|
357
|
+
/**
|
|
358
|
+
* TooltipTrigger - The element that triggers the tooltip
|
|
359
|
+
*/
|
|
360
|
+
declare const TooltipTrigger: React$1.ForwardRefExoticComponent<TooltipPrimitive.TooltipTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
361
|
+
/**
|
|
362
|
+
* TooltipPortal - Portals the content to document.body
|
|
363
|
+
*/
|
|
364
|
+
declare const TooltipPortal: React$1.FC<TooltipPrimitive.TooltipPortalProps>;
|
|
365
|
+
/**
|
|
366
|
+
* TooltipContent - The styled tooltip content
|
|
367
|
+
*/
|
|
368
|
+
declare const TooltipContent: React$1.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
369
|
+
/**
|
|
370
|
+
* TooltipArrow - Optional arrow pointing to the trigger
|
|
371
|
+
*/
|
|
372
|
+
declare const TooltipArrow: React$1.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipArrowProps & React$1.RefAttributes<SVGSVGElement>, "ref"> & React$1.RefAttributes<SVGSVGElement>>;
|
|
373
|
+
interface TooltipProps {
|
|
374
|
+
/**
|
|
375
|
+
* Tooltip content - can be string or ReactNode for rich content
|
|
376
|
+
*/
|
|
377
|
+
content: React$1.ReactNode;
|
|
378
|
+
/**
|
|
379
|
+
* Element to wrap with tooltip
|
|
380
|
+
*/
|
|
381
|
+
children: React$1.ReactElement;
|
|
382
|
+
/**
|
|
383
|
+
* Position of the tooltip relative to the trigger
|
|
384
|
+
* @default "top"
|
|
385
|
+
*/
|
|
386
|
+
position?: "top" | "bottom" | "left" | "right";
|
|
387
|
+
/**
|
|
388
|
+
* Delay before showing tooltip (in milliseconds)
|
|
389
|
+
* @default 200
|
|
390
|
+
*/
|
|
391
|
+
delayDuration?: number;
|
|
392
|
+
/**
|
|
393
|
+
* Offset from the trigger element (in pixels)
|
|
394
|
+
* @default 6
|
|
395
|
+
*/
|
|
396
|
+
sideOffset?: number;
|
|
397
|
+
/**
|
|
398
|
+
* Maximum width of the tooltip
|
|
399
|
+
* @default 250
|
|
400
|
+
*/
|
|
401
|
+
maxWidth?: number;
|
|
402
|
+
/**
|
|
403
|
+
* Whether the tooltip is disabled
|
|
404
|
+
* @default false
|
|
405
|
+
*/
|
|
406
|
+
disabled?: boolean;
|
|
407
|
+
/**
|
|
408
|
+
* Additional class names for the tooltip content
|
|
409
|
+
*/
|
|
410
|
+
className?: string;
|
|
411
|
+
}
|
|
412
|
+
/**
|
|
413
|
+
* Tooltip component
|
|
414
|
+
*
|
|
415
|
+
* Simple wrapper around Radix Tooltip for ease of use.
|
|
416
|
+
* Renders in a portal so it's never clipped by containers.
|
|
417
|
+
*
|
|
418
|
+
* @example
|
|
419
|
+
* <Tooltip content="Hello world">
|
|
420
|
+
* <button>Hover me</button>
|
|
421
|
+
* </Tooltip>
|
|
422
|
+
*
|
|
423
|
+
* @example
|
|
424
|
+
* <Tooltip content="Click to save" position="bottom" delayDuration={0}>
|
|
425
|
+
* <button>Save</button>
|
|
426
|
+
* </Tooltip>
|
|
427
|
+
*/
|
|
428
|
+
declare function Tooltip({ content, children, position, delayDuration, sideOffset, maxWidth, disabled, className, }: TooltipProps): react_jsx_runtime.JSX.Element;
|
|
429
|
+
|
|
430
|
+
/**
|
|
431
|
+
* Popover - Root component for popover behavior
|
|
432
|
+
*/
|
|
433
|
+
declare const Popover: React$1.FC<PopoverPrimitive.PopoverProps>;
|
|
434
|
+
/**
|
|
435
|
+
* PopoverTrigger - Element that triggers the popover
|
|
436
|
+
*/
|
|
437
|
+
declare const PopoverTrigger: React$1.ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
438
|
+
/**
|
|
439
|
+
* PopoverAnchor - Custom anchor element for positioning
|
|
440
|
+
*/
|
|
441
|
+
declare const PopoverAnchor: React$1.ForwardRefExoticComponent<PopoverPrimitive.PopoverAnchorProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
442
|
+
interface PopoverContentProps extends React$1.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content> {
|
|
443
|
+
}
|
|
444
|
+
/**
|
|
445
|
+
* PopoverContent - The popover content panel
|
|
446
|
+
*
|
|
447
|
+
* @example
|
|
448
|
+
* <Popover>
|
|
449
|
+
* <PopoverTrigger asChild>
|
|
450
|
+
* <Button>Open</Button>
|
|
451
|
+
* </PopoverTrigger>
|
|
452
|
+
* <PopoverContent>
|
|
453
|
+
* <p>Popover content here</p>
|
|
454
|
+
* </PopoverContent>
|
|
455
|
+
* </Popover>
|
|
456
|
+
*/
|
|
457
|
+
declare const PopoverContent: React$1.ForwardRefExoticComponent<PopoverContentProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
458
|
+
|
|
459
|
+
declare const DropdownMenu: React$1.FC<DropdownMenuPrimitive.DropdownMenuProps>;
|
|
460
|
+
declare const DropdownMenuTrigger: React$1.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
461
|
+
declare const DropdownMenuGroup: React$1.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
462
|
+
declare const DropdownMenuPortal: React$1.FC<DropdownMenuPrimitive.DropdownMenuPortalProps>;
|
|
463
|
+
declare const DropdownMenuSub: React$1.FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
|
|
464
|
+
declare const DropdownMenuRadioGroup: React$1.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
465
|
+
interface DropdownMenuSubTriggerProps extends React$1.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> {
|
|
466
|
+
inset?: boolean;
|
|
467
|
+
}
|
|
468
|
+
declare const DropdownMenuSubTrigger: React$1.ForwardRefExoticComponent<DropdownMenuSubTriggerProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
469
|
+
declare const DropdownMenuSubContent: React$1.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
470
|
+
declare const DropdownMenuContent: React$1.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
471
|
+
interface DropdownMenuItemProps extends React$1.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> {
|
|
472
|
+
inset?: boolean;
|
|
473
|
+
destructive?: boolean;
|
|
474
|
+
}
|
|
475
|
+
declare const DropdownMenuItem: React$1.ForwardRefExoticComponent<DropdownMenuItemProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
476
|
+
declare const DropdownMenuCheckboxItem: React$1.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuCheckboxItemProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
477
|
+
declare const DropdownMenuRadioItem: React$1.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuRadioItemProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
478
|
+
interface DropdownMenuLabelProps extends React$1.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> {
|
|
479
|
+
inset?: boolean;
|
|
480
|
+
}
|
|
481
|
+
declare const DropdownMenuLabel: React$1.ForwardRefExoticComponent<DropdownMenuLabelProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
482
|
+
declare const DropdownMenuSeparator: React$1.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSeparatorProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
483
|
+
interface DropdownMenuShortcutProps extends React$1.HTMLAttributes<HTMLSpanElement> {
|
|
484
|
+
}
|
|
485
|
+
declare const DropdownMenuShortcut: {
|
|
486
|
+
({ className, ...props }: DropdownMenuShortcutProps): react_jsx_runtime.JSX.Element;
|
|
487
|
+
displayName: string;
|
|
488
|
+
};
|
|
489
|
+
|
|
490
|
+
declare const AlertDialog: React$1.FC<AlertDialogPrimitive.AlertDialogProps>;
|
|
491
|
+
declare const AlertDialogTrigger: React$1.ForwardRefExoticComponent<AlertDialogPrimitive.AlertDialogTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
492
|
+
declare const AlertDialogPortal: React$1.FC<AlertDialogPrimitive.AlertDialogPortalProps>;
|
|
493
|
+
declare const AlertDialogOverlay: React$1.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogOverlayProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
494
|
+
declare const AlertDialogContent: React$1.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
495
|
+
interface AlertDialogHeaderProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
496
|
+
}
|
|
497
|
+
declare const AlertDialogHeader: {
|
|
498
|
+
({ className, ...props }: AlertDialogHeaderProps): react_jsx_runtime.JSX.Element;
|
|
499
|
+
displayName: string;
|
|
500
|
+
};
|
|
501
|
+
interface AlertDialogFooterProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
502
|
+
}
|
|
503
|
+
declare const AlertDialogFooter: {
|
|
504
|
+
({ className, ...props }: AlertDialogFooterProps): react_jsx_runtime.JSX.Element;
|
|
505
|
+
displayName: string;
|
|
506
|
+
};
|
|
507
|
+
declare const AlertDialogTitle: React$1.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogTitleProps & React$1.RefAttributes<HTMLHeadingElement>, "ref"> & React$1.RefAttributes<HTMLHeadingElement>>;
|
|
508
|
+
declare const AlertDialogDescription: React$1.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogDescriptionProps & React$1.RefAttributes<HTMLParagraphElement>, "ref"> & React$1.RefAttributes<HTMLParagraphElement>>;
|
|
509
|
+
declare const AlertDialogAction: React$1.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogActionProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
510
|
+
declare const AlertDialogCancel: React$1.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogCancelProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
511
|
+
|
|
512
|
+
interface CardProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
513
|
+
}
|
|
514
|
+
/**
|
|
515
|
+
* Card - Container component for grouped content
|
|
516
|
+
*/
|
|
517
|
+
declare const Card: React$1.ForwardRefExoticComponent<CardProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
518
|
+
interface CardHeaderProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
519
|
+
}
|
|
520
|
+
declare const CardHeader: React$1.ForwardRefExoticComponent<CardHeaderProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
521
|
+
interface CardTitleProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
522
|
+
}
|
|
523
|
+
declare const CardTitle: React$1.ForwardRefExoticComponent<CardTitleProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
524
|
+
interface CardDescriptionProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
525
|
+
}
|
|
526
|
+
declare const CardDescription: React$1.ForwardRefExoticComponent<CardDescriptionProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
527
|
+
interface CardContentProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
528
|
+
}
|
|
529
|
+
declare const CardContent: React$1.ForwardRefExoticComponent<CardContentProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
530
|
+
interface CardFooterProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
531
|
+
}
|
|
532
|
+
declare const CardFooter: React$1.ForwardRefExoticComponent<CardFooterProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
533
|
+
|
|
534
|
+
interface TableProps extends React$1.HTMLAttributes<HTMLTableElement> {
|
|
535
|
+
}
|
|
536
|
+
declare const Table: React$1.ForwardRefExoticComponent<TableProps & React$1.RefAttributes<HTMLTableElement>>;
|
|
537
|
+
interface TableHeaderProps extends React$1.HTMLAttributes<HTMLTableSectionElement> {
|
|
538
|
+
}
|
|
539
|
+
declare const TableHeader: React$1.ForwardRefExoticComponent<TableHeaderProps & React$1.RefAttributes<HTMLTableSectionElement>>;
|
|
540
|
+
interface TableBodyProps extends React$1.HTMLAttributes<HTMLTableSectionElement> {
|
|
541
|
+
}
|
|
542
|
+
declare const TableBody: React$1.ForwardRefExoticComponent<TableBodyProps & React$1.RefAttributes<HTMLTableSectionElement>>;
|
|
543
|
+
interface TableFooterProps extends React$1.HTMLAttributes<HTMLTableSectionElement> {
|
|
544
|
+
}
|
|
545
|
+
declare const TableFooter: React$1.ForwardRefExoticComponent<TableFooterProps & React$1.RefAttributes<HTMLTableSectionElement>>;
|
|
546
|
+
interface TableRowProps extends React$1.HTMLAttributes<HTMLTableRowElement> {
|
|
547
|
+
}
|
|
548
|
+
declare const TableRow: React$1.ForwardRefExoticComponent<TableRowProps & React$1.RefAttributes<HTMLTableRowElement>>;
|
|
549
|
+
interface TableHeadProps extends React$1.ThHTMLAttributes<HTMLTableCellElement> {
|
|
550
|
+
}
|
|
551
|
+
declare const TableHead: React$1.ForwardRefExoticComponent<TableHeadProps & React$1.RefAttributes<HTMLTableCellElement>>;
|
|
552
|
+
interface TableCellProps extends React$1.TdHTMLAttributes<HTMLTableCellElement> {
|
|
553
|
+
}
|
|
554
|
+
declare const TableCell: React$1.ForwardRefExoticComponent<TableCellProps & React$1.RefAttributes<HTMLTableCellElement>>;
|
|
555
|
+
interface TableCaptionProps extends React$1.HTMLAttributes<HTMLTableCaptionElement> {
|
|
556
|
+
}
|
|
557
|
+
declare const TableCaption: React$1.ForwardRefExoticComponent<TableCaptionProps & React$1.RefAttributes<HTMLTableCaptionElement>>;
|
|
558
|
+
|
|
559
|
+
interface ModalProps {
|
|
560
|
+
/**
|
|
561
|
+
* Whether the modal is open
|
|
562
|
+
*/
|
|
563
|
+
isOpen: boolean;
|
|
564
|
+
/**
|
|
565
|
+
* Callback when modal should close
|
|
566
|
+
*/
|
|
567
|
+
onClose: () => void;
|
|
568
|
+
/**
|
|
569
|
+
* Modal title
|
|
570
|
+
*/
|
|
571
|
+
title: string;
|
|
572
|
+
/**
|
|
573
|
+
* Modal content
|
|
574
|
+
*/
|
|
575
|
+
children: React$1.ReactNode;
|
|
576
|
+
/**
|
|
577
|
+
* Footer content (buttons, actions, etc.)
|
|
578
|
+
*/
|
|
579
|
+
footer?: React$1.ReactNode;
|
|
580
|
+
/**
|
|
581
|
+
* Size variant
|
|
582
|
+
*/
|
|
583
|
+
size?: "sm" | "md" | "lg";
|
|
584
|
+
/**
|
|
585
|
+
* Z-index for stacking modals (default: 50)
|
|
586
|
+
*/
|
|
587
|
+
zIndex?: number;
|
|
588
|
+
/**
|
|
589
|
+
* Additional class names for modal content
|
|
590
|
+
*/
|
|
591
|
+
className?: string;
|
|
592
|
+
}
|
|
593
|
+
/**
|
|
594
|
+
* Modal component
|
|
595
|
+
*
|
|
596
|
+
* Extensible modal base for dialogs, confirmations, and forms.
|
|
597
|
+
* Features:
|
|
598
|
+
* - Backdrop overlay
|
|
599
|
+
* - Escape key to close
|
|
600
|
+
* - Click outside to close
|
|
601
|
+
* - Customizable footer with action buttons
|
|
602
|
+
* - Multiple size variants
|
|
603
|
+
*
|
|
604
|
+
* @example
|
|
605
|
+
* <Modal isOpen={open} onClose={() => setOpen(false)} title="Confirm">
|
|
606
|
+
* <p>Are you sure?</p>
|
|
607
|
+
* <footer slot="footer">
|
|
608
|
+
* <Button onClick={() => setOpen(false)}>Cancel</Button>
|
|
609
|
+
* <Button variant="primary" onClick={handleConfirm}>Confirm</Button>
|
|
610
|
+
* </footer>
|
|
611
|
+
* </Modal>
|
|
612
|
+
*/
|
|
613
|
+
declare function Modal({ isOpen, onClose, title, children, footer, size, zIndex, className, }: ModalProps): react_jsx_runtime.JSX.Element | null;
|
|
614
|
+
/**
|
|
615
|
+
* ModalButton component
|
|
616
|
+
* @deprecated Use Button component from @optilogic/core instead
|
|
617
|
+
*
|
|
618
|
+
* Wrapper around Button for backward compatibility
|
|
619
|
+
*/
|
|
620
|
+
interface ModalButtonProps {
|
|
621
|
+
/**
|
|
622
|
+
* Button label
|
|
623
|
+
*/
|
|
624
|
+
label: string;
|
|
625
|
+
/**
|
|
626
|
+
* Click handler
|
|
627
|
+
*/
|
|
628
|
+
onClick: () => void;
|
|
629
|
+
/**
|
|
630
|
+
* Button variant
|
|
631
|
+
*/
|
|
632
|
+
variant?: "default" | "primary" | "destructive";
|
|
633
|
+
/**
|
|
634
|
+
* Whether the button is disabled
|
|
635
|
+
*/
|
|
636
|
+
disabled?: boolean;
|
|
637
|
+
/**
|
|
638
|
+
* Additional class names
|
|
639
|
+
*/
|
|
640
|
+
className?: string;
|
|
641
|
+
}
|
|
642
|
+
declare function ModalButton({ label, onClick, variant, disabled, className, }: ModalButtonProps): react_jsx_runtime.JSX.Element;
|
|
643
|
+
|
|
644
|
+
interface ConfirmationModalProps {
|
|
645
|
+
/** Whether the modal is open */
|
|
646
|
+
open: boolean;
|
|
647
|
+
/** Callback when open state changes */
|
|
648
|
+
onOpenChange: (open: boolean) => void;
|
|
649
|
+
/** Title of the confirmation dialog */
|
|
650
|
+
title: string;
|
|
651
|
+
/** Description/message to display */
|
|
652
|
+
description: string;
|
|
653
|
+
/** Label for the confirm button */
|
|
654
|
+
confirmLabel?: string;
|
|
655
|
+
/** Label for the cancel button */
|
|
656
|
+
cancelLabel?: string;
|
|
657
|
+
/** Whether this is a destructive action (styles confirm button as destructive) */
|
|
658
|
+
destructive?: boolean;
|
|
659
|
+
/** Callback when confirmed */
|
|
660
|
+
onConfirm: () => void;
|
|
661
|
+
/** Callback when cancelled (optional, defaults to closing) */
|
|
662
|
+
onCancel?: () => void;
|
|
663
|
+
}
|
|
664
|
+
/**
|
|
665
|
+
* ConfirmationModal
|
|
666
|
+
*
|
|
667
|
+
* A simple yes/no confirmation dialog built on AlertDialog.
|
|
668
|
+
* Use for actions that need user confirmation before proceeding.
|
|
669
|
+
*
|
|
670
|
+
* @example
|
|
671
|
+
* <ConfirmationModal
|
|
672
|
+
* open={isOpen}
|
|
673
|
+
* onOpenChange={setIsOpen}
|
|
674
|
+
* title="Delete Item"
|
|
675
|
+
* description="Are you sure you want to delete this item?"
|
|
676
|
+
* destructive
|
|
677
|
+
* onConfirm={handleDelete}
|
|
678
|
+
* />
|
|
679
|
+
*/
|
|
680
|
+
declare function ConfirmationModal({ open, onOpenChange, title, description, confirmLabel, cancelLabel, destructive, onConfirm, onCancel, }: ConfirmationModalProps): react_jsx_runtime.JSX.Element;
|
|
681
|
+
/**
|
|
682
|
+
* useConfirmation Hook
|
|
683
|
+
*
|
|
684
|
+
* A hook that provides imperative confirmation dialogs.
|
|
685
|
+
* Returns a confirm function that shows a dialog and returns a promise.
|
|
686
|
+
*
|
|
687
|
+
* @example
|
|
688
|
+
* const { confirm, ConfirmationDialog } = useConfirmation();
|
|
689
|
+
*
|
|
690
|
+
* const handleDelete = async () => {
|
|
691
|
+
* const confirmed = await confirm({
|
|
692
|
+
* title: "Delete Item",
|
|
693
|
+
* description: "Are you sure you want to delete this item?",
|
|
694
|
+
* destructive: true,
|
|
695
|
+
* });
|
|
696
|
+
* if (confirmed) {
|
|
697
|
+
* // perform delete
|
|
698
|
+
* }
|
|
699
|
+
* };
|
|
700
|
+
*
|
|
701
|
+
* return (
|
|
702
|
+
* <>
|
|
703
|
+
* <button onClick={handleDelete}>Delete</button>
|
|
704
|
+
* {ConfirmationDialog}
|
|
705
|
+
* </>
|
|
706
|
+
* );
|
|
707
|
+
*/
|
|
708
|
+
declare function useConfirmation(): {
|
|
709
|
+
confirm: (options: {
|
|
710
|
+
title: string;
|
|
711
|
+
description: string;
|
|
712
|
+
confirmLabel?: string;
|
|
713
|
+
cancelLabel?: string;
|
|
714
|
+
destructive?: boolean;
|
|
715
|
+
}) => Promise<boolean>;
|
|
716
|
+
ConfirmationDialog: react_jsx_runtime.JSX.Element;
|
|
717
|
+
};
|
|
718
|
+
|
|
719
|
+
interface ResizeHandleProps {
|
|
720
|
+
/**
|
|
721
|
+
* Orientation of the resize handle
|
|
722
|
+
*/
|
|
723
|
+
orientation: "left" | "right";
|
|
724
|
+
/**
|
|
725
|
+
* Whether the handle is resizable (draggable)
|
|
726
|
+
*/
|
|
727
|
+
resizable?: boolean;
|
|
728
|
+
/**
|
|
729
|
+
* Show/hide the handle UI
|
|
730
|
+
*/
|
|
731
|
+
showHandle?: boolean;
|
|
732
|
+
/**
|
|
733
|
+
* Callback when drag starts
|
|
734
|
+
*/
|
|
735
|
+
onDragStart?: () => void;
|
|
736
|
+
/**
|
|
737
|
+
* Callback during drag; receives pixel delta
|
|
738
|
+
*/
|
|
739
|
+
onDrag?: (deltaX: number) => void;
|
|
740
|
+
/**
|
|
741
|
+
* Callback when drag ends
|
|
742
|
+
*/
|
|
743
|
+
onDragEnd?: () => void;
|
|
744
|
+
/**
|
|
745
|
+
* Callback for keyboard resize (arrow keys)
|
|
746
|
+
*/
|
|
747
|
+
onKeyboardResize?: (direction: 1 | -1) => void;
|
|
748
|
+
/**
|
|
749
|
+
* ARIA label for accessibility
|
|
750
|
+
*/
|
|
751
|
+
ariaLabel?: string;
|
|
752
|
+
/**
|
|
753
|
+
* Additional class names
|
|
754
|
+
*/
|
|
755
|
+
className?: string;
|
|
756
|
+
}
|
|
757
|
+
/**
|
|
758
|
+
* ResizeHandle component
|
|
759
|
+
*
|
|
760
|
+
* A draggable handle for resizing panels with full keyboard and mouse support.
|
|
761
|
+
* Includes visual feedback, accessibility features, and smooth interactions.
|
|
762
|
+
*/
|
|
763
|
+
declare function ResizeHandle({ orientation, resizable, showHandle, onDragStart, onDrag, onDragEnd, onKeyboardResize, ariaLabel, className, }: ResizeHandleProps): react_jsx_runtime.JSX.Element | null;
|
|
764
|
+
|
|
765
|
+
interface ResizablePanelProps {
|
|
766
|
+
/**
|
|
767
|
+
* Which edge the panel anchors to
|
|
768
|
+
*/
|
|
769
|
+
orientation: "left" | "right";
|
|
770
|
+
/**
|
|
771
|
+
* Default collapsed width in vw
|
|
772
|
+
*/
|
|
773
|
+
collapsedSizeVW: number;
|
|
774
|
+
/**
|
|
775
|
+
* Current expanded width in vw (controlled prop)
|
|
776
|
+
*/
|
|
777
|
+
expandedWidthVW?: number;
|
|
778
|
+
/**
|
|
779
|
+
* Minimum width in vw
|
|
780
|
+
*/
|
|
781
|
+
minWidthVW?: number;
|
|
782
|
+
/**
|
|
783
|
+
* Maximum width in vw
|
|
784
|
+
*/
|
|
785
|
+
maxWidthVW?: number;
|
|
786
|
+
/**
|
|
787
|
+
* Whether the panel is expanded (drawer) vs collapsed
|
|
788
|
+
*/
|
|
789
|
+
isExpanded: boolean;
|
|
790
|
+
/**
|
|
791
|
+
* Whether the panel is in overlay mode
|
|
792
|
+
*/
|
|
793
|
+
isOverlay?: boolean;
|
|
794
|
+
/**
|
|
795
|
+
* When in overlay mode, the outer panel width in vw
|
|
796
|
+
*/
|
|
797
|
+
outerWidthVW?: number;
|
|
798
|
+
/**
|
|
799
|
+
* When in overlay mode, the inner panel width in vw
|
|
800
|
+
*/
|
|
801
|
+
innerWidthVW?: number;
|
|
802
|
+
/**
|
|
803
|
+
* Current left panel width in vw (needed for overlay positioning and dynamic constraints)
|
|
804
|
+
*/
|
|
805
|
+
leftWidthVW?: number;
|
|
806
|
+
/**
|
|
807
|
+
* Whether the panel is resizable
|
|
808
|
+
*/
|
|
809
|
+
resizable?: boolean;
|
|
810
|
+
/**
|
|
811
|
+
* Show/hide the resize handle
|
|
812
|
+
*/
|
|
813
|
+
showHandle?: boolean;
|
|
814
|
+
/**
|
|
815
|
+
* Callback during resize; emits clamped value in vw
|
|
816
|
+
*/
|
|
817
|
+
onResize?: (widthVW: number) => void;
|
|
818
|
+
/**
|
|
819
|
+
* Callback for collapse/expand toggle
|
|
820
|
+
*/
|
|
821
|
+
onToggle?: (next: boolean) => void;
|
|
822
|
+
/**
|
|
823
|
+
* Callback to promote to overlay mode
|
|
824
|
+
*/
|
|
825
|
+
onPromoteToOverlay?: () => void;
|
|
826
|
+
/**
|
|
827
|
+
* Callback to demote from overlay mode
|
|
828
|
+
*/
|
|
829
|
+
onDemoteFromOverlay?: () => void;
|
|
830
|
+
/**
|
|
831
|
+
* Callback when resizing the overlay outer/inner split
|
|
832
|
+
*/
|
|
833
|
+
onResizeOverlay?: (outerWidthVW: number) => void;
|
|
834
|
+
/**
|
|
835
|
+
* ARIA label for the resize handle
|
|
836
|
+
*/
|
|
837
|
+
handleAriaLabel?: string;
|
|
838
|
+
/**
|
|
839
|
+
* Optional header slot
|
|
840
|
+
*/
|
|
841
|
+
slotHeader?: React$1.ReactNode;
|
|
842
|
+
/**
|
|
843
|
+
* Optional footer slot
|
|
844
|
+
*/
|
|
845
|
+
slotFooter?: React$1.ReactNode;
|
|
846
|
+
/**
|
|
847
|
+
* Optional inner panel content (for overlay mode)
|
|
848
|
+
*/
|
|
849
|
+
innerPanelContent?: React$1.ReactNode;
|
|
850
|
+
/**
|
|
851
|
+
* Panel content
|
|
852
|
+
*/
|
|
853
|
+
children: React$1.ReactNode;
|
|
854
|
+
/**
|
|
855
|
+
* Additional class names
|
|
856
|
+
*/
|
|
857
|
+
className?: string;
|
|
858
|
+
/**
|
|
859
|
+
* Data attributes for styling/state
|
|
860
|
+
*/
|
|
861
|
+
dataAttributes?: Record<string, string>;
|
|
862
|
+
}
|
|
863
|
+
/**
|
|
864
|
+
* ResizablePanel component
|
|
865
|
+
*
|
|
866
|
+
* A generic, framework-agnostic panel that can collapse, expand, resize,
|
|
867
|
+
* and promote to overlay mode. Backs both left (search) and right (preview) panels.
|
|
868
|
+
*/
|
|
869
|
+
declare function ResizablePanel({ orientation, collapsedSizeVW, expandedWidthVW, minWidthVW, maxWidthVW, isExpanded, isOverlay, outerWidthVW, innerWidthVW, leftWidthVW, resizable, showHandle, onResize, onToggle: _onToggle, onPromoteToOverlay: _onPromoteToOverlay, onDemoteFromOverlay, onResizeOverlay, handleAriaLabel, slotHeader, slotFooter, innerPanelContent, children, className, dataAttributes, }: ResizablePanelProps): react_jsx_runtime.JSX.Element;
|
|
870
|
+
|
|
871
|
+
interface ChipProps {
|
|
872
|
+
/**
|
|
873
|
+
* Chip label text
|
|
874
|
+
*/
|
|
875
|
+
label: string;
|
|
876
|
+
/**
|
|
877
|
+
* Click handler
|
|
878
|
+
*/
|
|
879
|
+
onClick?: () => void;
|
|
880
|
+
/**
|
|
881
|
+
* Whether the chip is disabled
|
|
882
|
+
*/
|
|
883
|
+
disabled?: boolean;
|
|
884
|
+
/**
|
|
885
|
+
* Additional class names
|
|
886
|
+
*/
|
|
887
|
+
className?: string;
|
|
888
|
+
}
|
|
889
|
+
/**
|
|
890
|
+
* Chip component
|
|
891
|
+
*
|
|
892
|
+
* A clickable pill-shaped component for tags, filters, or suggested actions.
|
|
893
|
+
* Uses the theme chip colors.
|
|
894
|
+
*
|
|
895
|
+
* @example
|
|
896
|
+
* <Chip label="React" onClick={() => console.log('clicked')} />
|
|
897
|
+
*
|
|
898
|
+
* @example
|
|
899
|
+
* <Chip label="Disabled" disabled />
|
|
900
|
+
*/
|
|
901
|
+
declare function Chip({ label, onClick, disabled, className, }: ChipProps): react_jsx_runtime.JSX.Element;
|
|
902
|
+
|
|
903
|
+
declare const loadingSpinnerVariants: (props?: ({
|
|
904
|
+
size?: "default" | "sm" | "lg" | "xl" | null | undefined;
|
|
905
|
+
variant?: "default" | "inherit" | "muted" | "accent" | null | undefined;
|
|
906
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
907
|
+
interface LoadingSpinnerProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantProps<typeof loadingSpinnerVariants> {
|
|
908
|
+
/**
|
|
909
|
+
* Optional label shown below the spinner
|
|
910
|
+
*/
|
|
911
|
+
label?: string;
|
|
912
|
+
/**
|
|
913
|
+
* Show animated dots after the label
|
|
914
|
+
*/
|
|
915
|
+
showDots?: boolean;
|
|
916
|
+
}
|
|
917
|
+
/**
|
|
918
|
+
* LoadingSpinner Component
|
|
919
|
+
*
|
|
920
|
+
* A circular loading spinner with size and color variants.
|
|
921
|
+
*
|
|
922
|
+
* @example
|
|
923
|
+
* // Basic spinner
|
|
924
|
+
* <LoadingSpinner />
|
|
925
|
+
*
|
|
926
|
+
* @example
|
|
927
|
+
* // Large spinner with label
|
|
928
|
+
* <LoadingSpinner size="lg" label="Loading..." />
|
|
929
|
+
*
|
|
930
|
+
* @example
|
|
931
|
+
* // Small accent spinner
|
|
932
|
+
* <LoadingSpinner size="sm" variant="accent" />
|
|
933
|
+
*
|
|
934
|
+
* @example
|
|
935
|
+
* // Inherit parent text color
|
|
936
|
+
* <LoadingSpinner variant="inherit" />
|
|
937
|
+
*/
|
|
938
|
+
declare const LoadingSpinner: React$1.ForwardRefExoticComponent<LoadingSpinnerProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
939
|
+
|
|
940
|
+
interface ToasterProps {
|
|
941
|
+
/**
|
|
942
|
+
* Position of the toaster
|
|
943
|
+
* @default "top-right"
|
|
944
|
+
*/
|
|
945
|
+
position?: "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
|
|
946
|
+
/**
|
|
947
|
+
* Whether to expand toasts on hover
|
|
948
|
+
* @default false
|
|
949
|
+
*/
|
|
950
|
+
expand?: boolean;
|
|
951
|
+
/**
|
|
952
|
+
* Whether to use rich colors
|
|
953
|
+
* @default true
|
|
954
|
+
*/
|
|
955
|
+
richColors?: boolean;
|
|
956
|
+
/**
|
|
957
|
+
* Whether to show close button
|
|
958
|
+
* @default true
|
|
959
|
+
*/
|
|
960
|
+
closeButton?: boolean;
|
|
961
|
+
/**
|
|
962
|
+
* Theme mode
|
|
963
|
+
* @default "system"
|
|
964
|
+
*/
|
|
965
|
+
theme?: "light" | "dark" | "system";
|
|
966
|
+
}
|
|
967
|
+
/**
|
|
968
|
+
* Toaster component using Sonner
|
|
969
|
+
*
|
|
970
|
+
* Provides toast notifications throughout the app.
|
|
971
|
+
* Add this component once at the root of your app.
|
|
972
|
+
*
|
|
973
|
+
* Usage:
|
|
974
|
+
* import { toast } from "sonner";
|
|
975
|
+
* toast.success("Success!");
|
|
976
|
+
* toast.error("Error!");
|
|
977
|
+
* toast.info("Info!");
|
|
978
|
+
* toast.warning("Warning!");
|
|
979
|
+
*
|
|
980
|
+
* @example
|
|
981
|
+
* // In your app root
|
|
982
|
+
* <Toaster />
|
|
983
|
+
*
|
|
984
|
+
* // Then anywhere in your app
|
|
985
|
+
* toast.success("Saved successfully!");
|
|
986
|
+
*/
|
|
987
|
+
declare function Toaster({ position, expand, richColors, closeButton, theme, }?: ToasterProps): react_jsx_runtime.JSX.Element;
|
|
988
|
+
|
|
989
|
+
/**
|
|
990
|
+
* DataGrid Types
|
|
991
|
+
*
|
|
992
|
+
* Enhanced type definitions for the DataGrid component with support for
|
|
993
|
+
* resizable columns, filtering, sorting, cell editing, and keyboard navigation.
|
|
994
|
+
*/
|
|
995
|
+
|
|
996
|
+
/**
|
|
997
|
+
* Filter operators for different filter types
|
|
998
|
+
*/
|
|
999
|
+
type TextFilterOperator = "contains" | "notContains" | "equals" | "notEquals" | "startsWith" | "endsWith" | "isEmpty" | "isNotEmpty";
|
|
1000
|
+
type NumberFilterOperator = "equals" | "notEquals" | "gt" | "gte" | "lt" | "lte" | "between" | "isEmpty" | "isNotEmpty";
|
|
1001
|
+
type DateFilterOperator = "equals" | "notEquals" | "before" | "after" | "between" | "isEmpty" | "isNotEmpty";
|
|
1002
|
+
type FilterOperator = TextFilterOperator | NumberFilterOperator | DateFilterOperator;
|
|
1003
|
+
/**
|
|
1004
|
+
* Filter type options
|
|
1005
|
+
*/
|
|
1006
|
+
type FilterType = "text" | "number" | "date" | "select" | "boolean";
|
|
1007
|
+
/**
|
|
1008
|
+
* Editor type options
|
|
1009
|
+
*/
|
|
1010
|
+
type EditorType = "text" | "number" | "date" | "select" | "boolean";
|
|
1011
|
+
/**
|
|
1012
|
+
* Option for select-type filters and editors
|
|
1013
|
+
*/
|
|
1014
|
+
interface SelectOption {
|
|
1015
|
+
value: string;
|
|
1016
|
+
label: string;
|
|
1017
|
+
}
|
|
1018
|
+
/**
|
|
1019
|
+
* Represents possible cell values in the DataGrid.
|
|
1020
|
+
* Used for filter values, editing values, and cell accessors.
|
|
1021
|
+
*/
|
|
1022
|
+
type CellValue = string | number | boolean | Date | null | undefined;
|
|
1023
|
+
/**
|
|
1024
|
+
* Filter value type - includes array for multi-select filters
|
|
1025
|
+
*/
|
|
1026
|
+
type FilterValue = CellValue | CellValue[];
|
|
1027
|
+
/**
|
|
1028
|
+
* Filter configuration for a single column
|
|
1029
|
+
*/
|
|
1030
|
+
interface FilterConfig {
|
|
1031
|
+
/** Column key this filter applies to */
|
|
1032
|
+
columnKey: string;
|
|
1033
|
+
/** Filter operator */
|
|
1034
|
+
operator: FilterOperator;
|
|
1035
|
+
/** Filter value */
|
|
1036
|
+
value: FilterValue;
|
|
1037
|
+
/** Secondary value for 'between' operator */
|
|
1038
|
+
valueTo?: FilterValue;
|
|
1039
|
+
}
|
|
1040
|
+
/**
|
|
1041
|
+
* Sort configuration for a single column
|
|
1042
|
+
*/
|
|
1043
|
+
interface SortConfig {
|
|
1044
|
+
/** Column key to sort by */
|
|
1045
|
+
field: string;
|
|
1046
|
+
/** Sort direction */
|
|
1047
|
+
direction: "asc" | "desc";
|
|
1048
|
+
}
|
|
1049
|
+
/**
|
|
1050
|
+
* Focused cell position
|
|
1051
|
+
*/
|
|
1052
|
+
interface CellPosition {
|
|
1053
|
+
/** Row index */
|
|
1054
|
+
rowIndex: number;
|
|
1055
|
+
/** Column key */
|
|
1056
|
+
columnKey: string;
|
|
1057
|
+
}
|
|
1058
|
+
/**
|
|
1059
|
+
* Cell editing state
|
|
1060
|
+
*/
|
|
1061
|
+
interface EditingCell extends CellPosition {
|
|
1062
|
+
/** Current editing value */
|
|
1063
|
+
value: CellValue;
|
|
1064
|
+
/** Original value before editing */
|
|
1065
|
+
originalValue: CellValue;
|
|
1066
|
+
}
|
|
1067
|
+
/**
|
|
1068
|
+
* Column definition for the grid
|
|
1069
|
+
*/
|
|
1070
|
+
interface ColumnDef<T = Record<string, CellValue>> {
|
|
1071
|
+
/** Unique key for the column */
|
|
1072
|
+
key: string;
|
|
1073
|
+
/** Column header (can be string or React node) */
|
|
1074
|
+
header: string | React$1.ReactNode;
|
|
1075
|
+
/** Column width (number for px) */
|
|
1076
|
+
width?: number;
|
|
1077
|
+
/** Minimum column width when resizing */
|
|
1078
|
+
minWidth?: number;
|
|
1079
|
+
/** Maximum column width when resizing */
|
|
1080
|
+
maxWidth?: number;
|
|
1081
|
+
/** Custom cell renderer */
|
|
1082
|
+
cell?: (row: T, rowIndex: number) => React$1.ReactNode;
|
|
1083
|
+
/** Accessor function to get cell value (defaults to row[key]) */
|
|
1084
|
+
accessor?: (row: T) => CellValue;
|
|
1085
|
+
/** Whether this column is sortable */
|
|
1086
|
+
sortable?: boolean;
|
|
1087
|
+
/** Custom sort comparator function */
|
|
1088
|
+
sortComparator?: (a: T, b: T) => number;
|
|
1089
|
+
/** Whether this column is resizable (overrides global setting) */
|
|
1090
|
+
resizable?: boolean;
|
|
1091
|
+
/** Whether this column is filterable */
|
|
1092
|
+
filterable?: boolean;
|
|
1093
|
+
/** Filter type for this column */
|
|
1094
|
+
filterType?: FilterType;
|
|
1095
|
+
/** Options for select-type filters */
|
|
1096
|
+
filterOptions?: SelectOption[];
|
|
1097
|
+
/** Custom filter function for uncontrolled filtering */
|
|
1098
|
+
filterFn?: (row: T, filterValue: FilterValue, operator: FilterOperator) => boolean;
|
|
1099
|
+
/** Whether this column is editable */
|
|
1100
|
+
editable?: boolean;
|
|
1101
|
+
/** Editor type for this column */
|
|
1102
|
+
editorType?: EditorType;
|
|
1103
|
+
/** Options for select-type editors */
|
|
1104
|
+
editorOptions?: SelectOption[];
|
|
1105
|
+
/** Validator function - returns true if valid, or error message string */
|
|
1106
|
+
validator?: (value: CellValue, row: T) => boolean | string;
|
|
1107
|
+
/** Whether column is hidden */
|
|
1108
|
+
hidden?: boolean;
|
|
1109
|
+
/** Pin column to left or right */
|
|
1110
|
+
pinned?: "left" | "right";
|
|
1111
|
+
/** Text alignment */
|
|
1112
|
+
align?: "left" | "center" | "right";
|
|
1113
|
+
}
|
|
1114
|
+
/**
|
|
1115
|
+
* Pagination configuration
|
|
1116
|
+
*/
|
|
1117
|
+
interface PaginationConfig {
|
|
1118
|
+
/** Current page (0-indexed) */
|
|
1119
|
+
currentPage: number;
|
|
1120
|
+
/** Number of rows per page */
|
|
1121
|
+
pageSize: number;
|
|
1122
|
+
/** Total number of pages */
|
|
1123
|
+
totalPages: number;
|
|
1124
|
+
/** Total number of items */
|
|
1125
|
+
totalItems?: number;
|
|
1126
|
+
/** Callback when page changes */
|
|
1127
|
+
onPageChange: (page: number) => void;
|
|
1128
|
+
/** Callback when page size changes */
|
|
1129
|
+
onPageSizeChange: (size: number) => void;
|
|
1130
|
+
/** Available page size options */
|
|
1131
|
+
pageSizeOptions?: number[];
|
|
1132
|
+
/** Show "go to page" input */
|
|
1133
|
+
showGoToPage?: boolean;
|
|
1134
|
+
}
|
|
1135
|
+
/**
|
|
1136
|
+
* Search configuration (global search)
|
|
1137
|
+
*/
|
|
1138
|
+
interface SearchConfig {
|
|
1139
|
+
/** Current search query */
|
|
1140
|
+
searchQuery: string;
|
|
1141
|
+
/** Callback when search query changes */
|
|
1142
|
+
onSearchChange: (query: string) => void;
|
|
1143
|
+
/** Search input placeholder */
|
|
1144
|
+
placeholder?: string;
|
|
1145
|
+
}
|
|
1146
|
+
/**
|
|
1147
|
+
* Complete grid state for controlled/uncontrolled modes
|
|
1148
|
+
*/
|
|
1149
|
+
interface DataGridState {
|
|
1150
|
+
/** Current sorting configuration */
|
|
1151
|
+
sorting?: SortConfig[];
|
|
1152
|
+
/** Current filter configuration */
|
|
1153
|
+
filters?: FilterConfig[];
|
|
1154
|
+
/** Current column widths */
|
|
1155
|
+
columnWidths?: Record<string, number>;
|
|
1156
|
+
/** Hidden column keys */
|
|
1157
|
+
hiddenColumns?: string[];
|
|
1158
|
+
/** Current pagination state (for uncontrolled mode) */
|
|
1159
|
+
pagination?: {
|
|
1160
|
+
page: number;
|
|
1161
|
+
pageSize: number;
|
|
1162
|
+
};
|
|
1163
|
+
/** Currently focused cell */
|
|
1164
|
+
focusedCell?: CellPosition | null;
|
|
1165
|
+
/** Currently editing cell */
|
|
1166
|
+
editingCell?: EditingCell | null;
|
|
1167
|
+
}
|
|
1168
|
+
/**
|
|
1169
|
+
* Callback for cell edit events
|
|
1170
|
+
*/
|
|
1171
|
+
interface CellEditEvent<T = Record<string, CellValue>> {
|
|
1172
|
+
/** Row index */
|
|
1173
|
+
rowIndex: number;
|
|
1174
|
+
/** Column key */
|
|
1175
|
+
columnKey: string;
|
|
1176
|
+
/** New value */
|
|
1177
|
+
newValue: CellValue;
|
|
1178
|
+
/** Original value */
|
|
1179
|
+
oldValue: CellValue;
|
|
1180
|
+
/** The row data */
|
|
1181
|
+
row: T;
|
|
1182
|
+
}
|
|
1183
|
+
/**
|
|
1184
|
+
* DataGrid props
|
|
1185
|
+
*/
|
|
1186
|
+
interface DataGridProps<T = Record<string, CellValue>> {
|
|
1187
|
+
/** Data to display in the grid */
|
|
1188
|
+
data: T[];
|
|
1189
|
+
/** Column definitions */
|
|
1190
|
+
columns: ColumnDef<T>[];
|
|
1191
|
+
/** Key accessor for row identification */
|
|
1192
|
+
getRowKey?: (row: T, index: number) => string;
|
|
1193
|
+
/** Enable column resizing globally (default: false) */
|
|
1194
|
+
resizableColumns?: boolean;
|
|
1195
|
+
/** Enable virtualization for large datasets (default: true if data.length > 100) */
|
|
1196
|
+
virtualized?: boolean;
|
|
1197
|
+
/** Make header sticky (default: true) */
|
|
1198
|
+
stickyHeader?: boolean;
|
|
1199
|
+
/** Enable hover tooltips for long content (default: true) */
|
|
1200
|
+
showTooltips?: boolean;
|
|
1201
|
+
/** Minimum cell content length to show tooltip (default: 30) */
|
|
1202
|
+
tooltipMinLength?: number;
|
|
1203
|
+
/** Show column dividing borders between cells (default: true) */
|
|
1204
|
+
showColumnBorders?: boolean;
|
|
1205
|
+
/** Enable internal sorting when in uncontrolled mode (default: true) */
|
|
1206
|
+
enableInternalSorting?: boolean;
|
|
1207
|
+
/** Enable internal filtering when in uncontrolled mode (default: true) */
|
|
1208
|
+
enableInternalFiltering?: boolean;
|
|
1209
|
+
/** Current sorting configuration */
|
|
1210
|
+
sorting?: SortConfig[];
|
|
1211
|
+
/** Callback when sorting changes */
|
|
1212
|
+
onSortChange?: (sorting: SortConfig[]) => void;
|
|
1213
|
+
/** Current filter configuration */
|
|
1214
|
+
filters?: FilterConfig[];
|
|
1215
|
+
/** Callback when filters change */
|
|
1216
|
+
onFilterChange?: (filters: FilterConfig[]) => void;
|
|
1217
|
+
/** Current column widths */
|
|
1218
|
+
columnWidths?: Record<string, number>;
|
|
1219
|
+
/** Callback when a column is resized */
|
|
1220
|
+
onColumnResize?: (columnKey: string, width: number) => void;
|
|
1221
|
+
/** Callback when column resize starts */
|
|
1222
|
+
onColumnResizeStart?: (columnKey: string) => void;
|
|
1223
|
+
/** Callback when column resize ends */
|
|
1224
|
+
onColumnResizeEnd?: (columnKey: string, width: number) => void;
|
|
1225
|
+
/** Default sorting for uncontrolled mode */
|
|
1226
|
+
defaultSorting?: SortConfig[];
|
|
1227
|
+
/** Default filters for uncontrolled mode */
|
|
1228
|
+
defaultFilters?: FilterConfig[];
|
|
1229
|
+
/** Default column widths for uncontrolled mode */
|
|
1230
|
+
defaultColumnWidths?: Record<string, number>;
|
|
1231
|
+
/** Callback when any internal state changes (for uncontrolled mode) */
|
|
1232
|
+
onStateChange?: (state: DataGridState) => void;
|
|
1233
|
+
/** Row click handler */
|
|
1234
|
+
onRowClick?: (row: T, rowIndex: number) => void;
|
|
1235
|
+
/** Row double-click handler */
|
|
1236
|
+
onRowDoubleClick?: (row: T, rowIndex: number) => void;
|
|
1237
|
+
/** Selected row keys/ids */
|
|
1238
|
+
selectedRows?: string[];
|
|
1239
|
+
/** Callback when row selection changes */
|
|
1240
|
+
onSelectedRowsChange?: (selectedKeys: string[]) => void;
|
|
1241
|
+
/** Row class name function */
|
|
1242
|
+
rowClassName?: (row: T, rowIndex: number) => string;
|
|
1243
|
+
/** Cell edit handler - called when cell value changes */
|
|
1244
|
+
onCellEdit?: (rowIndex: number, columnKey: string, newValue: CellValue, oldValue: CellValue) => void;
|
|
1245
|
+
/** Callback before cell edit starts - return false to prevent */
|
|
1246
|
+
onCellEditStart?: (rowIndex: number, columnKey: string) => boolean | void;
|
|
1247
|
+
/** Callback when cell edit is cancelled */
|
|
1248
|
+
onCellEditCancel?: (rowIndex: number, columnKey: string) => void;
|
|
1249
|
+
/** Currently focused cell (controlled) */
|
|
1250
|
+
focusedCell?: CellPosition | null;
|
|
1251
|
+
/** Callback when focused cell changes */
|
|
1252
|
+
onFocusedCellChange?: (cell: CellPosition | null) => void;
|
|
1253
|
+
/** Enable keyboard navigation (default: true) */
|
|
1254
|
+
enableKeyboardNavigation?: boolean;
|
|
1255
|
+
/** Pagination configuration */
|
|
1256
|
+
pagination?: PaginationConfig;
|
|
1257
|
+
/** Search configuration */
|
|
1258
|
+
search?: SearchConfig;
|
|
1259
|
+
/** Loading state */
|
|
1260
|
+
loading?: boolean;
|
|
1261
|
+
/** Custom loading component */
|
|
1262
|
+
loadingComponent?: React$1.ReactNode;
|
|
1263
|
+
/** Empty state message */
|
|
1264
|
+
emptyMessage?: string;
|
|
1265
|
+
/** Custom empty state component */
|
|
1266
|
+
emptyComponent?: React$1.ReactNode;
|
|
1267
|
+
/** Additional class name for container */
|
|
1268
|
+
className?: string;
|
|
1269
|
+
/** Additional class name for table */
|
|
1270
|
+
tableClassName?: string;
|
|
1271
|
+
/** Enable infinite scroll mode */
|
|
1272
|
+
infiniteScroll?: boolean;
|
|
1273
|
+
/** Callback when more data should be loaded */
|
|
1274
|
+
onLoadMore?: () => void;
|
|
1275
|
+
/** Whether more data is available */
|
|
1276
|
+
hasMore?: boolean;
|
|
1277
|
+
/** Whether currently loading more data */
|
|
1278
|
+
loadingMore?: boolean;
|
|
1279
|
+
}
|
|
1280
|
+
/**
|
|
1281
|
+
* Internal state for the DataGrid
|
|
1282
|
+
*/
|
|
1283
|
+
interface DataGridInternalState {
|
|
1284
|
+
sorting: SortConfig[];
|
|
1285
|
+
filters: FilterConfig[];
|
|
1286
|
+
columnWidths: Record<string, number>;
|
|
1287
|
+
focusedCell: CellPosition | null;
|
|
1288
|
+
editingCell: EditingCell | null;
|
|
1289
|
+
}
|
|
1290
|
+
/**
|
|
1291
|
+
* Context for DataGrid sub-components
|
|
1292
|
+
*/
|
|
1293
|
+
interface DataGridContextValue<T = Record<string, CellValue>> {
|
|
1294
|
+
data: T[];
|
|
1295
|
+
columns: ColumnDef<T>[];
|
|
1296
|
+
getRowKey: (row: T, index: number) => string;
|
|
1297
|
+
state: DataGridInternalState;
|
|
1298
|
+
setFocusedCell: (cell: CellPosition | null) => void;
|
|
1299
|
+
startEditing: (rowIndex: number, columnKey: string) => void;
|
|
1300
|
+
commitEdit: (value: CellValue) => void;
|
|
1301
|
+
cancelEdit: () => void;
|
|
1302
|
+
updateColumnWidth: (columnKey: string, width: number) => void;
|
|
1303
|
+
updateSorting: (sorting: SortConfig[]) => void;
|
|
1304
|
+
updateFilters: (filters: FilterConfig[]) => void;
|
|
1305
|
+
resizableColumns: boolean;
|
|
1306
|
+
enableKeyboardNavigation: boolean;
|
|
1307
|
+
}
|
|
1308
|
+
/**
|
|
1309
|
+
* Props for HeaderCell component
|
|
1310
|
+
*/
|
|
1311
|
+
interface HeaderCellProps$1<T = Record<string, CellValue>> {
|
|
1312
|
+
column: ColumnDef<T>;
|
|
1313
|
+
columnIndex: number;
|
|
1314
|
+
width: number;
|
|
1315
|
+
sorting?: SortConfig;
|
|
1316
|
+
filter?: FilterConfig;
|
|
1317
|
+
isResizable: boolean;
|
|
1318
|
+
onSort?: () => void;
|
|
1319
|
+
onFilterChange?: (filter: FilterConfig | null) => void;
|
|
1320
|
+
onResize?: (width: number) => void;
|
|
1321
|
+
onResizeStart?: () => void;
|
|
1322
|
+
onResizeEnd?: (width: number) => void;
|
|
1323
|
+
}
|
|
1324
|
+
/**
|
|
1325
|
+
* Props for FilterPopover component
|
|
1326
|
+
*/
|
|
1327
|
+
interface FilterPopoverProps$1 {
|
|
1328
|
+
column: ColumnDef;
|
|
1329
|
+
filter?: FilterConfig;
|
|
1330
|
+
onFilterChange: (filter: FilterConfig | null) => void;
|
|
1331
|
+
}
|
|
1332
|
+
/**
|
|
1333
|
+
* Props for CellEditor component
|
|
1334
|
+
*/
|
|
1335
|
+
interface CellEditorProps$1<T = Record<string, CellValue>> {
|
|
1336
|
+
column: ColumnDef<T>;
|
|
1337
|
+
value: CellValue;
|
|
1338
|
+
row: T;
|
|
1339
|
+
rowIndex: number;
|
|
1340
|
+
onCommit: (value: CellValue) => void;
|
|
1341
|
+
onCancel: () => void;
|
|
1342
|
+
}
|
|
1343
|
+
/**
|
|
1344
|
+
* Props for GridCell component
|
|
1345
|
+
*/
|
|
1346
|
+
interface GridCellProps<T = Record<string, CellValue>> {
|
|
1347
|
+
column: ColumnDef<T>;
|
|
1348
|
+
row: T;
|
|
1349
|
+
rowIndex: number;
|
|
1350
|
+
columnIndex: number;
|
|
1351
|
+
width: number;
|
|
1352
|
+
isEditing: boolean;
|
|
1353
|
+
isFocused: boolean;
|
|
1354
|
+
onStartEdit: () => void;
|
|
1355
|
+
onCommitEdit: (value: CellValue) => void;
|
|
1356
|
+
onCancelEdit: () => void;
|
|
1357
|
+
onFocus: () => void;
|
|
1358
|
+
}
|
|
1359
|
+
|
|
1360
|
+
/**
|
|
1361
|
+
* DataGrid Component
|
|
1362
|
+
*/
|
|
1363
|
+
declare function DataGrid<T = Record<string, CellValue>>({ data, columns, getRowKey, resizableColumns, virtualized, stickyHeader, showTooltips, tooltipMinLength, enableKeyboardNavigation, showColumnBorders, enableInternalSorting, enableInternalFiltering, sorting: controlledSorting, onSortChange, filters: controlledFilters, onFilterChange, columnWidths: controlledColumnWidths, onColumnResize, onColumnResizeStart, onColumnResizeEnd, defaultSorting, defaultFilters, defaultColumnWidths, onStateChange, onRowClick, onRowDoubleClick, selectedRows, onSelectedRowsChange, rowClassName, onCellEdit, onCellEditStart, onCellEditCancel, focusedCell: controlledFocusedCell, onFocusedCellChange, pagination, search, loading, loadingComponent, emptyMessage, emptyComponent, className, tableClassName, infiniteScroll, onLoadMore, hasMore, loadingMore, }: DataGridProps<T>): react_jsx_runtime.JSX.Element;
|
|
1364
|
+
|
|
1365
|
+
interface HeaderCellProps<T = any> {
|
|
1366
|
+
/** Column definition */
|
|
1367
|
+
column: ColumnDef<T>;
|
|
1368
|
+
/** Column index */
|
|
1369
|
+
columnIndex: number;
|
|
1370
|
+
/** Current width of the column */
|
|
1371
|
+
width: number;
|
|
1372
|
+
/** Current sort config for this column (if sorted) */
|
|
1373
|
+
sorting?: SortConfig;
|
|
1374
|
+
/** Current filter config for this column (if filtered) */
|
|
1375
|
+
filter?: FilterConfig;
|
|
1376
|
+
/** Whether this column is resizable */
|
|
1377
|
+
isResizable: boolean;
|
|
1378
|
+
/** Callback when sort is toggled */
|
|
1379
|
+
onSort?: () => void;
|
|
1380
|
+
/** Callback when filter changes */
|
|
1381
|
+
onFilterChange?: (filter: FilterConfig | null) => void;
|
|
1382
|
+
/** Resize handle mouse down handler */
|
|
1383
|
+
onResizeMouseDown?: (event: React$1.MouseEvent) => void;
|
|
1384
|
+
/** Resize handle double click handler */
|
|
1385
|
+
onResizeDoubleClick?: (event: React$1.MouseEvent) => void;
|
|
1386
|
+
/** Whether currently resizing this column */
|
|
1387
|
+
isResizing?: boolean;
|
|
1388
|
+
}
|
|
1389
|
+
/**
|
|
1390
|
+
* HeaderCell Component
|
|
1391
|
+
*/
|
|
1392
|
+
declare function HeaderCell<T = any>({ column, columnIndex, width, sorting, filter, isResizable, onSort, onFilterChange, onResizeMouseDown, onResizeDoubleClick, isResizing, }: HeaderCellProps<T>): react_jsx_runtime.JSX.Element;
|
|
1393
|
+
|
|
1394
|
+
interface FilterPopoverProps<T = Record<string, CellValue>> {
|
|
1395
|
+
/** Column definition */
|
|
1396
|
+
column: ColumnDef<T>;
|
|
1397
|
+
/** Current filter value */
|
|
1398
|
+
filter?: FilterConfig;
|
|
1399
|
+
/** Callback when filter changes */
|
|
1400
|
+
onFilterChange: (filter: FilterConfig | null) => void;
|
|
1401
|
+
}
|
|
1402
|
+
/**
|
|
1403
|
+
* FilterPopover Component
|
|
1404
|
+
*/
|
|
1405
|
+
declare function FilterPopover<T = Record<string, CellValue>>({ column, filter, onFilterChange, }: FilterPopoverProps<T>): react_jsx_runtime.JSX.Element;
|
|
1406
|
+
|
|
1407
|
+
interface CellEditorProps<T = Record<string, CellValue>> {
|
|
1408
|
+
/** Column definition */
|
|
1409
|
+
column: ColumnDef<T>;
|
|
1410
|
+
/** Current value being edited */
|
|
1411
|
+
value: CellValue;
|
|
1412
|
+
/** The row data */
|
|
1413
|
+
row: T;
|
|
1414
|
+
/** Row index */
|
|
1415
|
+
rowIndex: number;
|
|
1416
|
+
/** Callback to commit the edit */
|
|
1417
|
+
onCommit: (value: CellValue) => void;
|
|
1418
|
+
/** Callback to cancel the edit */
|
|
1419
|
+
onCancel: () => void;
|
|
1420
|
+
/** Callback when value changes (for controlled updates) */
|
|
1421
|
+
onChange?: (value: CellValue) => void;
|
|
1422
|
+
/** Additional class name */
|
|
1423
|
+
className?: string;
|
|
1424
|
+
}
|
|
1425
|
+
declare function CellEditor<T = Record<string, CellValue>>({ column, value, row, rowIndex, onCommit, onCancel, onChange, className, }: CellEditorProps<T>): react_jsx_runtime.JSX.Element;
|
|
1426
|
+
|
|
1427
|
+
/**
|
|
1428
|
+
* useDataGridState Hook
|
|
1429
|
+
*
|
|
1430
|
+
* Manages internal state for the DataGrid component, supporting both
|
|
1431
|
+
* controlled and uncontrolled modes for sorting, filtering, column widths,
|
|
1432
|
+
* cell focus, and cell editing.
|
|
1433
|
+
*/
|
|
1434
|
+
|
|
1435
|
+
interface UseDataGridStateOptions<T = Record<string, CellValue>> {
|
|
1436
|
+
sorting?: SortConfig[];
|
|
1437
|
+
filters?: FilterConfig[];
|
|
1438
|
+
columnWidths?: Record<string, number>;
|
|
1439
|
+
focusedCell?: CellPosition | null;
|
|
1440
|
+
defaultSorting?: SortConfig[];
|
|
1441
|
+
defaultFilters?: FilterConfig[];
|
|
1442
|
+
defaultColumnWidths?: Record<string, number>;
|
|
1443
|
+
onSortChange?: (sorting: SortConfig[]) => void;
|
|
1444
|
+
onFilterChange?: (filters: FilterConfig[]) => void;
|
|
1445
|
+
onColumnResize?: (columnKey: string, width: number) => void;
|
|
1446
|
+
onFocusedCellChange?: (cell: CellPosition | null) => void;
|
|
1447
|
+
onStateChange?: (state: DataGridState) => void;
|
|
1448
|
+
onCellEdit?: (rowIndex: number, columnKey: string, newValue: CellValue, oldValue: CellValue) => void;
|
|
1449
|
+
onCellEditStart?: (rowIndex: number, columnKey: string) => boolean | void;
|
|
1450
|
+
onCellEditCancel?: (rowIndex: number, columnKey: string) => void;
|
|
1451
|
+
columns: ColumnDef<T>[];
|
|
1452
|
+
data: T[];
|
|
1453
|
+
getCellValue: (row: T, column: ColumnDef<T>) => CellValue;
|
|
1454
|
+
}
|
|
1455
|
+
interface UseDataGridStateReturn {
|
|
1456
|
+
state: DataGridInternalState;
|
|
1457
|
+
actions: {
|
|
1458
|
+
setSorting: (sorting: SortConfig[]) => void;
|
|
1459
|
+
toggleSort: (columnKey: string) => void;
|
|
1460
|
+
setFilters: (filters: FilterConfig[]) => void;
|
|
1461
|
+
setFilter: (filter: FilterConfig | null, columnKey: string) => void;
|
|
1462
|
+
clearFilters: () => void;
|
|
1463
|
+
setColumnWidth: (columnKey: string, width: number) => void;
|
|
1464
|
+
setFocusedCell: (cell: CellPosition | null) => void;
|
|
1465
|
+
startEditing: (rowIndex: number, columnKey: string) => void;
|
|
1466
|
+
updateEditingValue: (value: CellValue) => void;
|
|
1467
|
+
/** Commit the current edit. Optionally pass a value to commit immediately (for async editors like checkbox/date) */
|
|
1468
|
+
commitEdit: (value?: CellValue) => void;
|
|
1469
|
+
cancelEdit: () => void;
|
|
1470
|
+
};
|
|
1471
|
+
isControlled: {
|
|
1472
|
+
sorting: boolean;
|
|
1473
|
+
filters: boolean;
|
|
1474
|
+
columnWidths: boolean;
|
|
1475
|
+
focusedCell: boolean;
|
|
1476
|
+
};
|
|
1477
|
+
}
|
|
1478
|
+
/**
|
|
1479
|
+
* Hook to manage DataGrid state with controlled/uncontrolled support
|
|
1480
|
+
*/
|
|
1481
|
+
declare function useDataGridState<T = Record<string, CellValue>>(options: UseDataGridStateOptions<T>): UseDataGridStateReturn;
|
|
1482
|
+
|
|
1483
|
+
/**
|
|
1484
|
+
* useKeyboardNavigation Hook
|
|
1485
|
+
*
|
|
1486
|
+
* Handles keyboard navigation for the DataGrid component including:
|
|
1487
|
+
* - Arrow keys: Move between cells
|
|
1488
|
+
* - Enter: Start editing / commit edit
|
|
1489
|
+
* - Escape: Cancel edit
|
|
1490
|
+
* - Tab/Shift+Tab: Move to next/previous cell
|
|
1491
|
+
* - Home/End: Jump to first/last cell in row
|
|
1492
|
+
* - Ctrl+Home/End: Jump to first/last cell in grid
|
|
1493
|
+
* - Page Up/Down: Scroll by visible page
|
|
1494
|
+
*/
|
|
1495
|
+
|
|
1496
|
+
interface UseKeyboardNavigationOptions<T = any> {
|
|
1497
|
+
/** Whether keyboard navigation is enabled */
|
|
1498
|
+
enabled: boolean;
|
|
1499
|
+
/** Current focused cell */
|
|
1500
|
+
focusedCell: CellPosition | null;
|
|
1501
|
+
/** Current editing cell */
|
|
1502
|
+
editingCell: EditingCell | null;
|
|
1503
|
+
/** Column definitions (for determining visible columns) */
|
|
1504
|
+
columns: ColumnDef<T>[];
|
|
1505
|
+
/** Total number of rows */
|
|
1506
|
+
rowCount: number;
|
|
1507
|
+
/** Number of visible rows (for page up/down) */
|
|
1508
|
+
visibleRowCount?: number;
|
|
1509
|
+
/** Callback to set focused cell */
|
|
1510
|
+
onFocusedCellChange: (cell: CellPosition | null) => void;
|
|
1511
|
+
/** Callback to start editing */
|
|
1512
|
+
onStartEditing: (rowIndex: number, columnKey: string) => void;
|
|
1513
|
+
/** Callback to commit edit */
|
|
1514
|
+
onCommitEdit: () => void;
|
|
1515
|
+
/** Callback to cancel edit */
|
|
1516
|
+
onCancelEdit: () => void;
|
|
1517
|
+
/** Callback to scroll a row into view */
|
|
1518
|
+
onScrollToRow?: (rowIndex: number) => void;
|
|
1519
|
+
/** Callback to scroll a column into view */
|
|
1520
|
+
onScrollToColumn?: (columnKey: string) => void;
|
|
1521
|
+
}
|
|
1522
|
+
interface UseKeyboardNavigationReturn {
|
|
1523
|
+
/** Handler to attach to the grid container */
|
|
1524
|
+
handleKeyDown: (event: React.KeyboardEvent) => void;
|
|
1525
|
+
/** Ref to attach to the grid container for focus management */
|
|
1526
|
+
containerRef: React.RefObject<HTMLDivElement>;
|
|
1527
|
+
/** Focus the container (useful after clicking a cell) */
|
|
1528
|
+
focusContainer: () => void;
|
|
1529
|
+
}
|
|
1530
|
+
/**
|
|
1531
|
+
* Hook to handle keyboard navigation in the DataGrid
|
|
1532
|
+
*/
|
|
1533
|
+
declare function useKeyboardNavigation<T = any>(options: UseKeyboardNavigationOptions<T>): UseKeyboardNavigationReturn;
|
|
1534
|
+
|
|
1535
|
+
/**
|
|
1536
|
+
* useColumnResize Hook
|
|
1537
|
+
*
|
|
1538
|
+
* Handles column resizing logic with:
|
|
1539
|
+
* - Mouse drag support
|
|
1540
|
+
* - Min/max width constraints
|
|
1541
|
+
* - Callbacks for resize start/end
|
|
1542
|
+
* - Double-click to auto-fit (optional)
|
|
1543
|
+
*/
|
|
1544
|
+
|
|
1545
|
+
interface UseColumnResizeOptions {
|
|
1546
|
+
/** Column key being resized */
|
|
1547
|
+
columnKey: string;
|
|
1548
|
+
/** Column definition (for min/max width) */
|
|
1549
|
+
column: ColumnDef;
|
|
1550
|
+
/** Current column width */
|
|
1551
|
+
currentWidth: number;
|
|
1552
|
+
/** Whether resizing is enabled */
|
|
1553
|
+
enabled: boolean;
|
|
1554
|
+
/** Callback when width changes during resize */
|
|
1555
|
+
onResize: (width: number) => void;
|
|
1556
|
+
/** Callback when resize starts */
|
|
1557
|
+
onResizeStart?: () => void;
|
|
1558
|
+
/** Callback when resize ends */
|
|
1559
|
+
onResizeEnd?: (width: number) => void;
|
|
1560
|
+
}
|
|
1561
|
+
interface UseColumnResizeReturn {
|
|
1562
|
+
/** Whether currently dragging */
|
|
1563
|
+
isDragging: boolean;
|
|
1564
|
+
/** Props to spread on the resize handle element */
|
|
1565
|
+
resizeHandleProps: {
|
|
1566
|
+
onMouseDown: (event: React.MouseEvent) => void;
|
|
1567
|
+
onDoubleClick: (event: React.MouseEvent) => void;
|
|
1568
|
+
style: React.CSSProperties;
|
|
1569
|
+
role: string;
|
|
1570
|
+
"aria-label": string;
|
|
1571
|
+
tabIndex: number;
|
|
1572
|
+
};
|
|
1573
|
+
}
|
|
1574
|
+
/**
|
|
1575
|
+
* Hook to handle column resize drag interactions
|
|
1576
|
+
*/
|
|
1577
|
+
declare function useColumnResize(options: UseColumnResizeOptions): UseColumnResizeReturn;
|
|
1578
|
+
/**
|
|
1579
|
+
* Hook to manage resize state for all columns
|
|
1580
|
+
*/
|
|
1581
|
+
interface UseColumnResizeManagerOptions<T = any> {
|
|
1582
|
+
/** Column definitions */
|
|
1583
|
+
columns: ColumnDef<T>[];
|
|
1584
|
+
/** Current column widths */
|
|
1585
|
+
columnWidths: Record<string, number>;
|
|
1586
|
+
/** Whether resizing is enabled globally */
|
|
1587
|
+
resizableColumns: boolean;
|
|
1588
|
+
/** Callback when a column width changes */
|
|
1589
|
+
onColumnResize: (columnKey: string, width: number) => void;
|
|
1590
|
+
/** Callback when resize starts */
|
|
1591
|
+
onColumnResizeStart?: (columnKey: string) => void;
|
|
1592
|
+
/** Callback when resize ends */
|
|
1593
|
+
onColumnResizeEnd?: (columnKey: string, width: number) => void;
|
|
1594
|
+
}
|
|
1595
|
+
interface UseColumnResizeManagerReturn {
|
|
1596
|
+
/** Currently resizing column key */
|
|
1597
|
+
resizingColumn: string | null;
|
|
1598
|
+
/** Get resize props for a specific column */
|
|
1599
|
+
getResizeProps: (columnKey: string) => {
|
|
1600
|
+
isDragging: boolean;
|
|
1601
|
+
handleMouseDown: (event: React.MouseEvent) => void;
|
|
1602
|
+
handleDoubleClick: (event: React.MouseEvent) => void;
|
|
1603
|
+
};
|
|
1604
|
+
}
|
|
1605
|
+
/**
|
|
1606
|
+
* Hook to manage column resize state across all columns
|
|
1607
|
+
*/
|
|
1608
|
+
declare function useColumnResizeManager<T = any>(options: UseColumnResizeManagerOptions<T>): UseColumnResizeManagerReturn;
|
|
1609
|
+
|
|
1610
|
+
/**
|
|
1611
|
+
* Data Processing Utilities
|
|
1612
|
+
*
|
|
1613
|
+
* Functions for sorting and filtering data internally in uncontrolled mode.
|
|
1614
|
+
* Also exports helper functions for use in controlled mode.
|
|
1615
|
+
*/
|
|
1616
|
+
|
|
1617
|
+
/**
|
|
1618
|
+
* Get a value from a row using column accessor or key
|
|
1619
|
+
*/
|
|
1620
|
+
declare function getCellValue<T>(row: T, column: ColumnDef<T>): CellValue;
|
|
1621
|
+
/**
|
|
1622
|
+
* Apply sorting to data
|
|
1623
|
+
*/
|
|
1624
|
+
declare function applySorting<T>(data: T[], sorting: SortConfig[], columns: ColumnDef<T>[]): T[];
|
|
1625
|
+
/**
|
|
1626
|
+
* Apply a single filter operator to a value.
|
|
1627
|
+
* Can be used in controlled mode to filter data with the same logic as internal filtering.
|
|
1628
|
+
*
|
|
1629
|
+
* @param value - The cell value to test
|
|
1630
|
+
* @param filterValue - The filter value to compare against
|
|
1631
|
+
* @param filterValueTo - Secondary value for 'between' operator
|
|
1632
|
+
* @param operator - The filter operator to apply
|
|
1633
|
+
* @param filterType - Optional filter type hint (text, number, date, boolean)
|
|
1634
|
+
* @returns true if the value passes the filter, false otherwise
|
|
1635
|
+
*
|
|
1636
|
+
* @example
|
|
1637
|
+
* // Using in controlled mode
|
|
1638
|
+
* const filteredData = data.filter(row =>
|
|
1639
|
+
* applyFilterOperator(row.name, "john", undefined, "contains", "text")
|
|
1640
|
+
* );
|
|
1641
|
+
*/
|
|
1642
|
+
declare function applyFilterOperator(value: CellValue, filterValue: FilterValue, filterValueTo: FilterValue, operator: FilterOperator, filterType?: string): boolean;
|
|
1643
|
+
/**
|
|
1644
|
+
* Apply filters to data
|
|
1645
|
+
*/
|
|
1646
|
+
declare function applyFilters<T>(data: T[], filters: FilterConfig[], columns: ColumnDef<T>[]): T[];
|
|
1647
|
+
|
|
1648
|
+
interface AutocompleteOption {
|
|
1649
|
+
/** Unique value for the option */
|
|
1650
|
+
value: string;
|
|
1651
|
+
/** Display label for the option */
|
|
1652
|
+
label: string;
|
|
1653
|
+
/** Optional description shown below the label */
|
|
1654
|
+
description?: string;
|
|
1655
|
+
/** Whether this option is disabled */
|
|
1656
|
+
disabled?: boolean;
|
|
1657
|
+
/** Optional group/category for the option */
|
|
1658
|
+
group?: string;
|
|
1659
|
+
}
|
|
1660
|
+
interface AutocompleteProps {
|
|
1661
|
+
/** Array of options to display */
|
|
1662
|
+
options: AutocompleteOption[];
|
|
1663
|
+
/** Currently selected value */
|
|
1664
|
+
value?: string;
|
|
1665
|
+
/** Callback when selection changes */
|
|
1666
|
+
onChange?: (value: string | undefined) => void;
|
|
1667
|
+
/** Placeholder text when no selection */
|
|
1668
|
+
placeholder?: string;
|
|
1669
|
+
/** Placeholder for the search input */
|
|
1670
|
+
searchPlaceholder?: string;
|
|
1671
|
+
/** Text to show when no options match the search */
|
|
1672
|
+
emptyText?: string;
|
|
1673
|
+
/** Whether the autocomplete is disabled */
|
|
1674
|
+
disabled?: boolean;
|
|
1675
|
+
/** Additional class name for the trigger */
|
|
1676
|
+
className?: string;
|
|
1677
|
+
/** Whether to allow clearing the selection */
|
|
1678
|
+
clearable?: boolean;
|
|
1679
|
+
}
|
|
1680
|
+
/**
|
|
1681
|
+
* Autocomplete component - a searchable dropdown/select
|
|
1682
|
+
*
|
|
1683
|
+
* Features:
|
|
1684
|
+
* - Search filtering
|
|
1685
|
+
* - Grouped options support
|
|
1686
|
+
* - Clearable selection
|
|
1687
|
+
* - Keyboard navigation
|
|
1688
|
+
*
|
|
1689
|
+
* @example
|
|
1690
|
+
* <Autocomplete
|
|
1691
|
+
* options={[
|
|
1692
|
+
* { value: 'react', label: 'React' },
|
|
1693
|
+
* { value: 'vue', label: 'Vue' },
|
|
1694
|
+
* ]}
|
|
1695
|
+
* value={selected}
|
|
1696
|
+
* onChange={setSelected}
|
|
1697
|
+
* placeholder="Select a framework..."
|
|
1698
|
+
* />
|
|
1699
|
+
*/
|
|
1700
|
+
declare function Autocomplete({ options, value, onChange, placeholder, searchPlaceholder, emptyText, disabled, className, clearable, }: AutocompleteProps): react_jsx_runtime.JSX.Element;
|
|
1701
|
+
|
|
1702
|
+
declare const iconButtonVariants: (props?: ({
|
|
1703
|
+
variant?: "default" | "outline" | "ghost" | "muted" | "filled" | null | undefined;
|
|
1704
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
1705
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1706
|
+
interface IconButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof iconButtonVariants> {
|
|
1707
|
+
/**
|
|
1708
|
+
* Whether the button is in an active/selected state
|
|
1709
|
+
*/
|
|
1710
|
+
isActive?: boolean;
|
|
1711
|
+
/**
|
|
1712
|
+
* Icon element to display (typically from lucide-react)
|
|
1713
|
+
*/
|
|
1714
|
+
icon?: React$1.ReactNode;
|
|
1715
|
+
/**
|
|
1716
|
+
* Accessibility label (required if no children)
|
|
1717
|
+
*/
|
|
1718
|
+
"aria-label": string;
|
|
1719
|
+
}
|
|
1720
|
+
/**
|
|
1721
|
+
* IconButton component
|
|
1722
|
+
*
|
|
1723
|
+
* A versatile icon button for toolbars and action buttons.
|
|
1724
|
+
* Uses consistent hover states across all themes.
|
|
1725
|
+
*
|
|
1726
|
+
* @example
|
|
1727
|
+
* <IconButton
|
|
1728
|
+
* icon={<RefreshCw className="w-4 h-4" />}
|
|
1729
|
+
* aria-label="Refresh"
|
|
1730
|
+
* onClick={handleRefresh}
|
|
1731
|
+
* />
|
|
1732
|
+
*
|
|
1733
|
+
* @example With active state
|
|
1734
|
+
* <IconButton
|
|
1735
|
+
* icon={<Grid className="w-4 h-4" />}
|
|
1736
|
+
* aria-label="Grid view"
|
|
1737
|
+
* isActive={viewMode === 'grid'}
|
|
1738
|
+
* onClick={() => setViewMode('grid')}
|
|
1739
|
+
* />
|
|
1740
|
+
*/
|
|
1741
|
+
declare const IconButton: React$1.ForwardRefExoticComponent<IconButtonProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
1742
|
+
|
|
1743
|
+
interface CopyButtonProps {
|
|
1744
|
+
/**
|
|
1745
|
+
* Content to copy to clipboard
|
|
1746
|
+
*/
|
|
1747
|
+
content: string;
|
|
1748
|
+
/**
|
|
1749
|
+
* Additional class names
|
|
1750
|
+
*/
|
|
1751
|
+
className?: string;
|
|
1752
|
+
/**
|
|
1753
|
+
* Size of the button
|
|
1754
|
+
*/
|
|
1755
|
+
size?: "sm" | "md" | "lg";
|
|
1756
|
+
}
|
|
1757
|
+
/**
|
|
1758
|
+
* CopyButton component
|
|
1759
|
+
*
|
|
1760
|
+
* A button that copies content to clipboard and shows feedback.
|
|
1761
|
+
*
|
|
1762
|
+
* @example
|
|
1763
|
+
* <CopyButton content="Text to copy" />
|
|
1764
|
+
*
|
|
1765
|
+
* @example
|
|
1766
|
+
* <div className="group relative">
|
|
1767
|
+
* <pre>some code</pre>
|
|
1768
|
+
* <CopyButton content="some code" className="absolute top-2 right-2" />
|
|
1769
|
+
* </div>
|
|
1770
|
+
*/
|
|
1771
|
+
declare function CopyButton({ content, className, size }: CopyButtonProps): react_jsx_runtime.JSX.Element;
|
|
1772
|
+
|
|
1773
|
+
/**
|
|
1774
|
+
* Theme Types
|
|
1775
|
+
*
|
|
1776
|
+
* Type definitions for the JSON-based theme system.
|
|
1777
|
+
* Ported from platform-leapfrog for consistent theming across projects.
|
|
1778
|
+
*/
|
|
1779
|
+
/**
|
|
1780
|
+
* Theme interface mapping all color properties to CSS variables
|
|
1781
|
+
*/
|
|
1782
|
+
interface Theme {
|
|
1783
|
+
/** Theme metadata */
|
|
1784
|
+
id: string;
|
|
1785
|
+
name: string;
|
|
1786
|
+
description?: string;
|
|
1787
|
+
author?: string;
|
|
1788
|
+
/** Base colors */
|
|
1789
|
+
background: string;
|
|
1790
|
+
foreground: string;
|
|
1791
|
+
/** Surface colors */
|
|
1792
|
+
card: string;
|
|
1793
|
+
cardForeground: string;
|
|
1794
|
+
popover: string;
|
|
1795
|
+
popoverForeground: string;
|
|
1796
|
+
/** Accent & interactive colors */
|
|
1797
|
+
primary: string;
|
|
1798
|
+
primaryForeground: string;
|
|
1799
|
+
accent: string;
|
|
1800
|
+
accentForeground: string;
|
|
1801
|
+
/** Secondary & utility colors */
|
|
1802
|
+
secondary: string;
|
|
1803
|
+
secondaryForeground: string;
|
|
1804
|
+
muted: string;
|
|
1805
|
+
mutedForeground: string;
|
|
1806
|
+
/** State colors */
|
|
1807
|
+
destructive: string;
|
|
1808
|
+
destructiveForeground: string;
|
|
1809
|
+
success: string;
|
|
1810
|
+
successForeground: string;
|
|
1811
|
+
warning: string;
|
|
1812
|
+
warningForeground: string;
|
|
1813
|
+
/** Chip/badge colors */
|
|
1814
|
+
chip: string;
|
|
1815
|
+
chipForeground: string;
|
|
1816
|
+
/** Borders & inputs */
|
|
1817
|
+
border: string;
|
|
1818
|
+
input: string;
|
|
1819
|
+
ring: string;
|
|
1820
|
+
/** Chart colors */
|
|
1821
|
+
chart1: string;
|
|
1822
|
+
chart2: string;
|
|
1823
|
+
chart3: string;
|
|
1824
|
+
chart4: string;
|
|
1825
|
+
chart5: string;
|
|
1826
|
+
/** Border radius */
|
|
1827
|
+
radius?: string;
|
|
1828
|
+
}
|
|
1829
|
+
/**
|
|
1830
|
+
* Theme with colors in hex format (for editing/display)
|
|
1831
|
+
*/
|
|
1832
|
+
type ThemeHex = Theme;
|
|
1833
|
+
/**
|
|
1834
|
+
* Theme with colors in HSL format (for CSS variables)
|
|
1835
|
+
*/
|
|
1836
|
+
interface ThemeHSL extends Omit<Theme, keyof ThemeColorFields> {
|
|
1837
|
+
id: string;
|
|
1838
|
+
name: string;
|
|
1839
|
+
description?: string;
|
|
1840
|
+
author?: string;
|
|
1841
|
+
radius?: string;
|
|
1842
|
+
background: string;
|
|
1843
|
+
foreground: string;
|
|
1844
|
+
card: string;
|
|
1845
|
+
cardForeground: string;
|
|
1846
|
+
popover: string;
|
|
1847
|
+
popoverForeground: string;
|
|
1848
|
+
primary: string;
|
|
1849
|
+
primaryForeground: string;
|
|
1850
|
+
accent: string;
|
|
1851
|
+
accentForeground: string;
|
|
1852
|
+
secondary: string;
|
|
1853
|
+
secondaryForeground: string;
|
|
1854
|
+
muted: string;
|
|
1855
|
+
mutedForeground: string;
|
|
1856
|
+
destructive: string;
|
|
1857
|
+
destructiveForeground: string;
|
|
1858
|
+
success: string;
|
|
1859
|
+
successForeground: string;
|
|
1860
|
+
warning: string;
|
|
1861
|
+
warningForeground: string;
|
|
1862
|
+
chip: string;
|
|
1863
|
+
chipForeground: string;
|
|
1864
|
+
border: string;
|
|
1865
|
+
input: string;
|
|
1866
|
+
ring: string;
|
|
1867
|
+
chart1: string;
|
|
1868
|
+
chart2: string;
|
|
1869
|
+
chart3: string;
|
|
1870
|
+
chart4: string;
|
|
1871
|
+
chart5: string;
|
|
1872
|
+
}
|
|
1873
|
+
type ThemeColorFields = {
|
|
1874
|
+
background: string;
|
|
1875
|
+
foreground: string;
|
|
1876
|
+
card: string;
|
|
1877
|
+
cardForeground: string;
|
|
1878
|
+
popover: string;
|
|
1879
|
+
popoverForeground: string;
|
|
1880
|
+
primary: string;
|
|
1881
|
+
primaryForeground: string;
|
|
1882
|
+
accent: string;
|
|
1883
|
+
accentForeground: string;
|
|
1884
|
+
secondary: string;
|
|
1885
|
+
secondaryForeground: string;
|
|
1886
|
+
muted: string;
|
|
1887
|
+
mutedForeground: string;
|
|
1888
|
+
destructive: string;
|
|
1889
|
+
destructiveForeground: string;
|
|
1890
|
+
success: string;
|
|
1891
|
+
successForeground: string;
|
|
1892
|
+
warning: string;
|
|
1893
|
+
warningForeground: string;
|
|
1894
|
+
chip: string;
|
|
1895
|
+
chipForeground: string;
|
|
1896
|
+
border: string;
|
|
1897
|
+
input: string;
|
|
1898
|
+
ring: string;
|
|
1899
|
+
chart1: string;
|
|
1900
|
+
chart2: string;
|
|
1901
|
+
chart3: string;
|
|
1902
|
+
chart4: string;
|
|
1903
|
+
chart5: string;
|
|
1904
|
+
};
|
|
1905
|
+
/**
|
|
1906
|
+
* Color field configuration for editors
|
|
1907
|
+
*/
|
|
1908
|
+
interface ColorFieldConfig {
|
|
1909
|
+
key: keyof ThemeColorFields;
|
|
1910
|
+
label: string;
|
|
1911
|
+
description?: string;
|
|
1912
|
+
group: "base" | "surface" | "accent" | "secondary" | "state" | "chip" | "border" | "chart";
|
|
1913
|
+
}
|
|
1914
|
+
|
|
1915
|
+
/**
|
|
1916
|
+
* Theme Presets
|
|
1917
|
+
*
|
|
1918
|
+
* Built-in theme definitions for opti-ui.
|
|
1919
|
+
* Ported from platform-leapfrog for consistent theming.
|
|
1920
|
+
*/
|
|
1921
|
+
|
|
1922
|
+
/**
|
|
1923
|
+
* Green Theme - Alternative theme option
|
|
1924
|
+
*/
|
|
1925
|
+
declare const GREEN_THEME: Theme;
|
|
1926
|
+
/**
|
|
1927
|
+
* Optilogic Legacy Theme - Default theme
|
|
1928
|
+
*/
|
|
1929
|
+
declare const OPTILOGIC_LEGACY_THEME: Theme;
|
|
1930
|
+
/**
|
|
1931
|
+
* Futuristic Theme - Neon cyberpunk aesthetic
|
|
1932
|
+
*/
|
|
1933
|
+
declare const FUTURISTIC_THEME: Theme;
|
|
1934
|
+
/**
|
|
1935
|
+
* Nature Inspired Theme - Earthy greens and browns
|
|
1936
|
+
*/
|
|
1937
|
+
declare const NATURE_THEME: Theme;
|
|
1938
|
+
/**
|
|
1939
|
+
* Sci-Fi Theme - Deep space with vibrant accents
|
|
1940
|
+
*/
|
|
1941
|
+
declare const SCIFI_THEME: Theme;
|
|
1942
|
+
/**
|
|
1943
|
+
* Ocean Theme - Calming blues and teals
|
|
1944
|
+
*/
|
|
1945
|
+
declare const OCEAN_THEME: Theme;
|
|
1946
|
+
/**
|
|
1947
|
+
* Sunset Theme - Warm oranges and purples
|
|
1948
|
+
*/
|
|
1949
|
+
declare const SUNSET_THEME: Theme;
|
|
1950
|
+
/**
|
|
1951
|
+
* Forest Theme - Deep greens and browns
|
|
1952
|
+
*/
|
|
1953
|
+
declare const FOREST_THEME: Theme;
|
|
1954
|
+
/**
|
|
1955
|
+
* Cyberpunk Theme - Neon pinks and cyans
|
|
1956
|
+
*/
|
|
1957
|
+
declare const CYBERPUNK_THEME: Theme;
|
|
1958
|
+
/**
|
|
1959
|
+
* Minimalist Light Theme - Clean and simple
|
|
1960
|
+
*/
|
|
1961
|
+
declare const MINIMALIST_LIGHT_THEME: Theme;
|
|
1962
|
+
/**
|
|
1963
|
+
* Dark Elegant Theme - Sophisticated dark mode
|
|
1964
|
+
*/
|
|
1965
|
+
declare const DARK_ELEGANT_THEME: Theme;
|
|
1966
|
+
/**
|
|
1967
|
+
* All available preset themes
|
|
1968
|
+
*/
|
|
1969
|
+
declare const PRESET_THEMES: Theme[];
|
|
1970
|
+
/**
|
|
1971
|
+
* All theme suggestions for preview
|
|
1972
|
+
*/
|
|
1973
|
+
declare const ALL_THEMES: Theme[];
|
|
1974
|
+
/**
|
|
1975
|
+
* Get a preset theme by ID
|
|
1976
|
+
*/
|
|
1977
|
+
declare function getPresetTheme(id: string): Theme | undefined;
|
|
1978
|
+
/**
|
|
1979
|
+
* Get the default theme (fallback)
|
|
1980
|
+
*/
|
|
1981
|
+
declare function getDefaultTheme(): Theme;
|
|
1982
|
+
/**
|
|
1983
|
+
* Check if a theme is a preset (not user-created)
|
|
1984
|
+
*/
|
|
1985
|
+
declare function isPresetTheme(themeId: string): boolean;
|
|
1986
|
+
|
|
1987
|
+
/**
|
|
1988
|
+
* Theme Utilities
|
|
1989
|
+
*
|
|
1990
|
+
* Functions for theme conversion and application.
|
|
1991
|
+
* Ported from platform-leapfrog for consistent theming.
|
|
1992
|
+
*/
|
|
1993
|
+
|
|
1994
|
+
/**
|
|
1995
|
+
* Convert hex color to HSL format for CSS variables
|
|
1996
|
+
*/
|
|
1997
|
+
declare function hexToHsl(hex: string): string;
|
|
1998
|
+
/**
|
|
1999
|
+
* Convert hex theme to HSL theme
|
|
2000
|
+
*/
|
|
2001
|
+
declare function themeToHsl(theme: Theme): ThemeHSL;
|
|
2002
|
+
/**
|
|
2003
|
+
* Apply a theme to the DOM
|
|
2004
|
+
*
|
|
2005
|
+
* @param theme - The theme to apply
|
|
2006
|
+
* @param targetElement - Optional element to apply theme to (defaults to document.documentElement)
|
|
2007
|
+
*/
|
|
2008
|
+
declare function applyTheme(theme: Theme, targetElement?: HTMLElement): void;
|
|
2009
|
+
/**
|
|
2010
|
+
* Get the currently active theme (uses default)
|
|
2011
|
+
*/
|
|
2012
|
+
declare function getCurrentTheme(): Theme;
|
|
2013
|
+
/**
|
|
2014
|
+
* Validate theme object structure
|
|
2015
|
+
*/
|
|
2016
|
+
declare function validateTheme(theme: unknown): theme is Theme;
|
|
2017
|
+
/**
|
|
2018
|
+
* Clone a theme (for editing)
|
|
2019
|
+
*/
|
|
2020
|
+
declare function cloneTheme(theme: Theme, newName?: string): Theme;
|
|
2021
|
+
/**
|
|
2022
|
+
* Deep comparison of two themes
|
|
2023
|
+
*/
|
|
2024
|
+
declare function areThemesEqual(theme1: Theme, theme2: Theme): boolean;
|
|
2025
|
+
/**
|
|
2026
|
+
* Export theme as JSON string
|
|
2027
|
+
*/
|
|
2028
|
+
declare function exportTheme(theme: Theme): string;
|
|
2029
|
+
/**
|
|
2030
|
+
* Import theme from JSON string
|
|
2031
|
+
*/
|
|
2032
|
+
declare function importTheme(jsonString: string): {
|
|
2033
|
+
success: boolean;
|
|
2034
|
+
theme?: Theme;
|
|
2035
|
+
error?: string;
|
|
2036
|
+
};
|
|
2037
|
+
|
|
2038
|
+
interface ThemePickerProps {
|
|
2039
|
+
/** Currently selected theme (controlled) */
|
|
2040
|
+
value?: Theme;
|
|
2041
|
+
/** Callback when theme changes */
|
|
2042
|
+
onValueChange?: (theme: Theme) => void;
|
|
2043
|
+
/** Available themes to choose from */
|
|
2044
|
+
themes?: Theme[];
|
|
2045
|
+
/** Trigger style variant */
|
|
2046
|
+
triggerVariant?: "icon" | "button";
|
|
2047
|
+
/** Size of the trigger */
|
|
2048
|
+
triggerSize?: "sm" | "default" | "lg";
|
|
2049
|
+
/** Whether to apply the theme to the DOM when selected */
|
|
2050
|
+
applyOnSelect?: boolean;
|
|
2051
|
+
/** Additional class name for the trigger */
|
|
2052
|
+
className?: string;
|
|
2053
|
+
/** Alignment of the popover */
|
|
2054
|
+
align?: "start" | "center" | "end";
|
|
2055
|
+
/** Side of the popover */
|
|
2056
|
+
side?: "top" | "right" | "bottom" | "left";
|
|
2057
|
+
}
|
|
2058
|
+
/**
|
|
2059
|
+
* ThemePicker Component
|
|
2060
|
+
*
|
|
2061
|
+
* A theme selection dropdown that displays available themes as visual swatches.
|
|
2062
|
+
*
|
|
2063
|
+
* @example Basic usage
|
|
2064
|
+
* ```tsx
|
|
2065
|
+
* <ThemePicker onValueChange={(theme) => console.log(theme)} />
|
|
2066
|
+
* ```
|
|
2067
|
+
*
|
|
2068
|
+
* @example Controlled with custom themes
|
|
2069
|
+
* ```tsx
|
|
2070
|
+
* const [theme, setTheme] = useState(OPTILOGIC_LEGACY_THEME);
|
|
2071
|
+
* <ThemePicker
|
|
2072
|
+
* value={theme}
|
|
2073
|
+
* onValueChange={setTheme}
|
|
2074
|
+
* themes={[OPTILOGIC_LEGACY_THEME, DARK_ELEGANT_THEME]}
|
|
2075
|
+
* />
|
|
2076
|
+
* ```
|
|
2077
|
+
*/
|
|
2078
|
+
declare function ThemePicker({ value, onValueChange, themes, triggerVariant, triggerSize, applyOnSelect, className, align, side, }: ThemePickerProps): react_jsx_runtime.JSX.Element;
|
|
2079
|
+
|
|
2080
|
+
type CalendarProps = DayPickerProps;
|
|
2081
|
+
/**
|
|
2082
|
+
* Calendar Component
|
|
2083
|
+
*
|
|
2084
|
+
* A fully styled calendar using react-day-picker with library design tokens.
|
|
2085
|
+
*
|
|
2086
|
+
* @example Single date selection
|
|
2087
|
+
* ```tsx
|
|
2088
|
+
* const [date, setDate] = useState<Date>();
|
|
2089
|
+
* <Calendar mode="single" selected={date} onSelect={setDate} />
|
|
2090
|
+
* ```
|
|
2091
|
+
*
|
|
2092
|
+
* @example Date range selection
|
|
2093
|
+
* ```tsx
|
|
2094
|
+
* const [range, setRange] = useState<DateRange>();
|
|
2095
|
+
* <Calendar mode="range" selected={range} onSelect={setRange} />
|
|
2096
|
+
* ```
|
|
2097
|
+
*
|
|
2098
|
+
* @example Quick navigation with month/year selectors
|
|
2099
|
+
* ```tsx
|
|
2100
|
+
* <Calendar
|
|
2101
|
+
* mode="single"
|
|
2102
|
+
* selected={date}
|
|
2103
|
+
* onSelect={setDate}
|
|
2104
|
+
* fromYear={2020}
|
|
2105
|
+
* toYear={2030}
|
|
2106
|
+
* />
|
|
2107
|
+
* ```
|
|
2108
|
+
*/
|
|
2109
|
+
declare function Calendar({ className, classNames, showOutsideDays, month: controlledMonth, defaultMonth, onMonthChange, ...props }: CalendarProps): react_jsx_runtime.JSX.Element;
|
|
2110
|
+
declare namespace Calendar {
|
|
2111
|
+
var displayName: string;
|
|
2112
|
+
}
|
|
2113
|
+
|
|
2114
|
+
/**
|
|
2115
|
+
* DatePicker Component
|
|
2116
|
+
*
|
|
2117
|
+
* A complete date picker combining an input field with a calendar popover.
|
|
2118
|
+
* Built using library primitives for consistent styling.
|
|
2119
|
+
*
|
|
2120
|
+
* Features:
|
|
2121
|
+
* - Input field with formatted date display
|
|
2122
|
+
* - Calendar popover for date selection
|
|
2123
|
+
* - Controlled and uncontrolled modes
|
|
2124
|
+
* - Clearable option
|
|
2125
|
+
* - Min/max date constraints
|
|
2126
|
+
* - Custom date formatting
|
|
2127
|
+
* - Keyboard accessible
|
|
2128
|
+
*/
|
|
2129
|
+
interface DatePickerProps {
|
|
2130
|
+
/** Selected date value */
|
|
2131
|
+
value?: Date;
|
|
2132
|
+
/** Default value for uncontrolled mode */
|
|
2133
|
+
defaultValue?: Date;
|
|
2134
|
+
/** Callback when date changes */
|
|
2135
|
+
onChange?: (date: Date | undefined) => void;
|
|
2136
|
+
/** Placeholder text when no date selected */
|
|
2137
|
+
placeholder?: string;
|
|
2138
|
+
/** Whether the picker is disabled */
|
|
2139
|
+
disabled?: boolean;
|
|
2140
|
+
/** Minimum selectable date */
|
|
2141
|
+
minDate?: Date;
|
|
2142
|
+
/** Maximum selectable date */
|
|
2143
|
+
maxDate?: Date;
|
|
2144
|
+
/** Date format string (date-fns format) */
|
|
2145
|
+
dateFormat?: string;
|
|
2146
|
+
/** Whether to show a clear button */
|
|
2147
|
+
clearable?: boolean;
|
|
2148
|
+
/** Additional class name */
|
|
2149
|
+
className?: string;
|
|
2150
|
+
/** Input ID for label association */
|
|
2151
|
+
id?: string;
|
|
2152
|
+
/** Input name for form submission */
|
|
2153
|
+
name?: string;
|
|
2154
|
+
/** Alignment of the popover */
|
|
2155
|
+
align?: "start" | "center" | "end";
|
|
2156
|
+
/** Side of the popover */
|
|
2157
|
+
side?: "top" | "right" | "bottom" | "left";
|
|
2158
|
+
/** Whether the popover should match the trigger width */
|
|
2159
|
+
matchTriggerWidth?: boolean;
|
|
2160
|
+
/** Callback when the popover opens/closes */
|
|
2161
|
+
onOpenChange?: (open: boolean) => void;
|
|
2162
|
+
}
|
|
2163
|
+
/**
|
|
2164
|
+
* DatePicker Component
|
|
2165
|
+
*
|
|
2166
|
+
* A date input with calendar popover for easy date selection.
|
|
2167
|
+
*
|
|
2168
|
+
* @example Basic usage
|
|
2169
|
+
* ```tsx
|
|
2170
|
+
* const [date, setDate] = useState<Date>();
|
|
2171
|
+
* <DatePicker value={date} onChange={setDate} />
|
|
2172
|
+
* ```
|
|
2173
|
+
*
|
|
2174
|
+
* @example With constraints
|
|
2175
|
+
* ```tsx
|
|
2176
|
+
* <DatePicker
|
|
2177
|
+
* value={date}
|
|
2178
|
+
* onChange={setDate}
|
|
2179
|
+
* minDate={new Date()}
|
|
2180
|
+
* maxDate={addMonths(new Date(), 3)}
|
|
2181
|
+
* placeholder="Select a date"
|
|
2182
|
+
* />
|
|
2183
|
+
* ```
|
|
2184
|
+
*
|
|
2185
|
+
* @example Custom format
|
|
2186
|
+
* ```tsx
|
|
2187
|
+
* <DatePicker
|
|
2188
|
+
* value={date}
|
|
2189
|
+
* onChange={setDate}
|
|
2190
|
+
* dateFormat="dd/MM/yyyy"
|
|
2191
|
+
* />
|
|
2192
|
+
* ```
|
|
2193
|
+
*/
|
|
2194
|
+
declare function DatePicker({ value, defaultValue, onChange, placeholder, disabled, minDate, maxDate, dateFormat, clearable, className, id, name, align, side, matchTriggerWidth, onOpenChange, }: DatePickerProps): react_jsx_runtime.JSX.Element;
|
|
2195
|
+
declare namespace DatePicker {
|
|
2196
|
+
var displayName: string;
|
|
2197
|
+
}
|
|
2198
|
+
/**
|
|
2199
|
+
* DatePickerInput Component
|
|
2200
|
+
*
|
|
2201
|
+
* A variant that looks more like a traditional input field.
|
|
2202
|
+
* Useful for inline editing or compact layouts.
|
|
2203
|
+
*/
|
|
2204
|
+
interface DatePickerInputProps extends Omit<DatePickerProps, "className"> {
|
|
2205
|
+
/** Additional class name for the input wrapper */
|
|
2206
|
+
className?: string;
|
|
2207
|
+
/** Size variant */
|
|
2208
|
+
size?: "sm" | "default" | "lg";
|
|
2209
|
+
}
|
|
2210
|
+
declare function DatePickerInput({ value, defaultValue, onChange, placeholder, disabled, minDate, maxDate, dateFormat, clearable, className, id, name, align, side, onOpenChange, size, }: DatePickerInputProps): react_jsx_runtime.JSX.Element;
|
|
2211
|
+
declare namespace DatePickerInput {
|
|
2212
|
+
var displayName: string;
|
|
2213
|
+
}
|
|
2214
|
+
|
|
2215
|
+
/**
|
|
2216
|
+
* Context menu item definition
|
|
2217
|
+
*/
|
|
2218
|
+
interface ContextMenuItem {
|
|
2219
|
+
/** Unique identifier */
|
|
2220
|
+
id: string;
|
|
2221
|
+
/** Display label */
|
|
2222
|
+
label: string;
|
|
2223
|
+
/** Optional icon component */
|
|
2224
|
+
icon?: LucideIcon;
|
|
2225
|
+
/** Click handler (ignored if has submenu) */
|
|
2226
|
+
action?: () => void;
|
|
2227
|
+
/** Keyboard shortcut display text */
|
|
2228
|
+
shortcut?: string;
|
|
2229
|
+
/** Whether item is disabled */
|
|
2230
|
+
disabled?: boolean;
|
|
2231
|
+
/** Whether to show as destructive/danger action */
|
|
2232
|
+
destructive?: boolean;
|
|
2233
|
+
/** Show divider line after this item */
|
|
2234
|
+
divider?: boolean;
|
|
2235
|
+
/** Nested submenu items */
|
|
2236
|
+
submenu?: ContextMenuItem[];
|
|
2237
|
+
}
|
|
2238
|
+
interface ContextMenuProps {
|
|
2239
|
+
/** Menu items */
|
|
2240
|
+
items: ContextMenuItem[];
|
|
2241
|
+
/** Whether menu is open */
|
|
2242
|
+
isOpen: boolean;
|
|
2243
|
+
/** Close handler */
|
|
2244
|
+
onClose: () => void;
|
|
2245
|
+
/** Menu position (x, y) */
|
|
2246
|
+
position: {
|
|
2247
|
+
x: number;
|
|
2248
|
+
y: number;
|
|
2249
|
+
};
|
|
2250
|
+
/** Anchor element (alternative to position) */
|
|
2251
|
+
anchorEl?: HTMLElement | null;
|
|
2252
|
+
/** Additional class names */
|
|
2253
|
+
className?: string;
|
|
2254
|
+
}
|
|
2255
|
+
/**
|
|
2256
|
+
* ContextMenu component
|
|
2257
|
+
*
|
|
2258
|
+
* A unified context menu with support for icons, shortcuts, submenus, and more.
|
|
2259
|
+
*
|
|
2260
|
+
* @example
|
|
2261
|
+
* const { isOpen, position, openMenu, closeMenu } = useContextMenu();
|
|
2262
|
+
*
|
|
2263
|
+
* <div onContextMenu={(e) => {
|
|
2264
|
+
* e.preventDefault();
|
|
2265
|
+
* openMenu(e.clientX, e.clientY, item);
|
|
2266
|
+
* }}>
|
|
2267
|
+
* Right click me
|
|
2268
|
+
* </div>
|
|
2269
|
+
*
|
|
2270
|
+
* <ContextMenu
|
|
2271
|
+
* isOpen={isOpen}
|
|
2272
|
+
* position={position}
|
|
2273
|
+
* onClose={closeMenu}
|
|
2274
|
+
* items={[
|
|
2275
|
+
* { id: 'edit', label: 'Edit', icon: Edit, action: handleEdit },
|
|
2276
|
+
* { id: 'delete', label: 'Delete', icon: Trash, destructive: true, action: handleDelete },
|
|
2277
|
+
* ]}
|
|
2278
|
+
* />
|
|
2279
|
+
*/
|
|
2280
|
+
declare function ContextMenu({ items, isOpen, onClose, position, anchorEl, className, }: ContextMenuProps): react_jsx_runtime.JSX.Element | null;
|
|
2281
|
+
/**
|
|
2282
|
+
* Hook to manage context menu state
|
|
2283
|
+
*/
|
|
2284
|
+
interface UseContextMenuResult<T = unknown> {
|
|
2285
|
+
/** Whether menu is open */
|
|
2286
|
+
isOpen: boolean;
|
|
2287
|
+
/** Menu position */
|
|
2288
|
+
position: {
|
|
2289
|
+
x: number;
|
|
2290
|
+
y: number;
|
|
2291
|
+
};
|
|
2292
|
+
/** Target item that was right-clicked */
|
|
2293
|
+
targetItem: T | null;
|
|
2294
|
+
/** Ref for the menu element */
|
|
2295
|
+
menuRef: React$1.RefObject<HTMLDivElement>;
|
|
2296
|
+
/** Open the context menu */
|
|
2297
|
+
openMenu: (x: number, y: number, item: T) => void;
|
|
2298
|
+
/** Close the context menu */
|
|
2299
|
+
closeMenu: () => void;
|
|
2300
|
+
}
|
|
2301
|
+
declare function useContextMenu<T = unknown>(): UseContextMenuResult<T>;
|
|
2302
|
+
|
|
2303
|
+
/** @deprecated Use SortConfig instead */
|
|
2304
|
+
type SortingConfig = {
|
|
2305
|
+
field: string;
|
|
2306
|
+
direction: "asc" | "desc";
|
|
2307
|
+
onSort: (field: string) => void;
|
|
2308
|
+
};
|
|
2309
|
+
|
|
2310
|
+
export { ALL_THEMES, Accordion, AccordionContent, type AccordionContentProps, AccordionItem, type AccordionItemProps, AccordionTrigger, type AccordionTriggerProps, type AccordionVariant, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, type AlertDialogFooterProps, AlertDialogHeader, type AlertDialogHeaderProps, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Autocomplete, type AutocompleteOption, type AutocompleteProps, Badge, type BadgeProps, Button, type ButtonProps, CYBERPUNK_THEME, Calendar, type CalendarProps, Card, CardContent, type CardContentProps, CardDescription, type CardDescriptionProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, CardTitle, type CardTitleProps, type CellEditEvent, CellEditor, type CellEditorProps$1 as CellEditorProps, type CellPosition, Checkbox, type CheckboxProps, Chip, type ChipProps, type ColorFieldConfig, type ColumnDef, ConfirmationModal, type ConfirmationModalProps, ContextMenu, type ContextMenuItem, type ContextMenuProps, CopyButton, type CopyButtonProps, DARK_ELEGANT_THEME, DataGrid, type DataGridContextValue, type DataGridInternalState, type DataGridProps, type DataGridState, type DateFilterOperator, DatePicker, DatePickerInput, type DatePickerInputProps, type DatePickerProps, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuLabel, type DropdownMenuLabelProps, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, type DropdownMenuShortcutProps, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, type DropdownMenuSubTriggerProps, DropdownMenuTrigger, type EditingCell, type EditorType, FOREST_THEME, FUTURISTIC_THEME, type FilterConfig, type FilterOperator, FilterPopover, type FilterPopoverProps$1 as FilterPopoverProps, type FilterType, GREEN_THEME, type GridCellProps, HeaderCell, type HeaderCellProps$1 as HeaderCellProps, IconButton, type IconButtonProps, Input, type InputProps, Label, type LabelProps, LoadingSpinner, type LoadingSpinnerProps, MINIMALIST_LIGHT_THEME, Modal, ModalButton, type ModalButtonProps, type ModalProps, NATURE_THEME, type NumberFilterOperator, OCEAN_THEME, OPTILOGIC_LEGACY_THEME, PRESET_THEMES, type PaginationConfig, Popover, PopoverAnchor, PopoverContent, type PopoverContentProps, PopoverTrigger, Progress, type ProgressProps, ResizablePanel, type ResizablePanelProps, ResizeHandle, type ResizeHandleProps, SCIFI_THEME, SUNSET_THEME, type SearchConfig, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, type SelectOption, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, type SelectTriggerProps, SelectValue, Separator, type SeparatorProps, Skeleton, type SkeletonProps, type SortConfig, type SortingConfig, Switch, type SwitchProps, Table, TableBody, type TableBodyProps, TableCaption, type TableCaptionProps, TableCell, type TableCellProps, TableFooter, type TableFooterProps, TableHead, type TableHeadProps, TableHeader, type TableHeaderProps, type TableProps, TableRow, type TableRowProps, Tabs, TabsContent, TabsList, TabsTrigger, type TextFilterOperator, Textarea, type TextareaProps, type Theme, type ThemeHSL, type ThemeHex, ThemePicker, type ThemePickerProps, Toaster, type ToasterProps, Tooltip, TooltipArrow, TooltipContent, TooltipPortal, type TooltipProps, TooltipProvider, TooltipRoot, TooltipTrigger, type UseContextMenuResult, accordionContentVariants, accordionItemVariants, accordionTriggerVariants, applyFilterOperator, applyFilters, applySorting, applyTheme, areThemesEqual, badgeVariants, buttonVariants, cloneTheme, cn, exportTheme, getCellValue, getCurrentTheme, getDefaultTheme, getPresetTheme, hexToHsl, iconButtonVariants, importTheme, isPresetTheme, labelVariants, loadingSpinnerVariants, themeToHsl, useColumnResize, useColumnResizeManager, useConfirmation, useContextMenu, useDataGridState, useKeyboardNavigation, validateTheme };
|