@larose-ui/react 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,462 @@
1
+ import * as react from 'react';
2
+ import { ButtonHTMLAttributes, ReactNode, InputHTMLAttributes, TextareaHTMLAttributes, SelectHTMLAttributes } from 'react';
3
+ import { Variant, Size, UIState, ThemeMode, Density } from '@larose-ui/core';
4
+ export { ApiError, AsyncState, Density, Environment, LAROSE_VERSION, Permission, Size, ThemeMode, UIState, Variant } from '@larose-ui/core';
5
+ import { ColorTokens } from '@larose-ui/tokens';
6
+ export { ColorTokens, TokenSet, applyTokensToElement, getTokens, tokensToCSSVariables } from '@larose-ui/tokens';
7
+
8
+ interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
9
+ variant?: Variant;
10
+ size?: Size;
11
+ state?: UIState;
12
+ loading?: boolean;
13
+ error?: string | null;
14
+ leftIcon?: ReactNode;
15
+ rightIcon?: ReactNode;
16
+ }
17
+ declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement>>;
18
+
19
+ interface AsyncButtonProps extends Omit<ButtonProps, 'onClick' | 'loading' | 'error'> {
20
+ action: () => Promise<void>;
21
+ onSuccess?: () => void;
22
+ onError?: (error: unknown) => void;
23
+ variant?: Variant;
24
+ size?: Size;
25
+ children: ReactNode;
26
+ }
27
+ declare function AsyncButton({ action, onSuccess, onError, children, variant, size, disabled, ...props }: AsyncButtonProps): react.JSX.Element;
28
+
29
+ interface LaRoseConfig {
30
+ theme?: ThemeMode;
31
+ density?: Density;
32
+ tenantId?: string;
33
+ brandColors?: Partial<ColorTokens>;
34
+ }
35
+ declare function useLaRose(): LaRoseConfig;
36
+ interface LaRoseProviderProps extends LaRoseConfig {
37
+ children: ReactNode;
38
+ }
39
+ declare function LaRoseProvider({ children, theme, density, tenantId, brandColors, }: LaRoseProviderProps): react.JSX.Element;
40
+
41
+ interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
42
+ label?: string;
43
+ hint?: string;
44
+ state?: UIState;
45
+ loading?: boolean;
46
+ error?: string | null;
47
+ inputSize?: Size;
48
+ }
49
+ declare const Input: react.ForwardRefExoticComponent<InputProps & react.RefAttributes<HTMLInputElement>>;
50
+
51
+ interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
52
+ label?: string;
53
+ hint?: string;
54
+ state?: UIState;
55
+ loading?: boolean;
56
+ error?: string | null;
57
+ inputSize?: Size;
58
+ }
59
+ declare const Textarea: react.ForwardRefExoticComponent<TextareaProps & react.RefAttributes<HTMLTextAreaElement>>;
60
+
61
+ interface SelectOption {
62
+ label: string;
63
+ value: string;
64
+ }
65
+ interface SelectProps extends SelectHTMLAttributes<HTMLSelectElement> {
66
+ label?: string;
67
+ hint?: string;
68
+ options: SelectOption[];
69
+ placeholder?: string;
70
+ state?: UIState;
71
+ loading?: boolean;
72
+ error?: string | null;
73
+ inputSize?: Size;
74
+ }
75
+ declare const Select: react.ForwardRefExoticComponent<SelectProps & react.RefAttributes<HTMLSelectElement>>;
76
+
77
+ interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'size'> {
78
+ label: string;
79
+ hint?: string;
80
+ error?: string | null;
81
+ boxSize?: Size;
82
+ }
83
+ declare const Checkbox: react.ForwardRefExoticComponent<CheckboxProps & react.RefAttributes<HTMLInputElement>>;
84
+
85
+ interface RadioProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'size'> {
86
+ label: string;
87
+ hint?: string;
88
+ error?: string | null;
89
+ boxSize?: Size;
90
+ }
91
+ declare const Radio: react.ForwardRefExoticComponent<RadioProps & react.RefAttributes<HTMLInputElement>>;
92
+
93
+ interface SwitchProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onChange'> {
94
+ label: string;
95
+ checked?: boolean;
96
+ defaultChecked?: boolean;
97
+ onCheckedChange?: (checked: boolean) => void;
98
+ hint?: string;
99
+ switchSize?: Size;
100
+ }
101
+ declare function Switch({ label, checked, defaultChecked, onCheckedChange, hint, disabled, switchSize, className, id, ...props }: SwitchProps): react.JSX.Element;
102
+
103
+ type ProgressVariant = 'default' | 'success' | 'error';
104
+ interface ProgressProps {
105
+ value: number;
106
+ max?: number;
107
+ label?: string;
108
+ variant?: ProgressVariant;
109
+ state?: UIState;
110
+ showValue?: boolean;
111
+ }
112
+ declare function Progress({ value, max, label, variant, state, showValue, }: ProgressProps): react.JSX.Element;
113
+
114
+ interface SpinnerProps {
115
+ size?: Size;
116
+ label?: string;
117
+ }
118
+ declare function Spinner({ size, label }: SpinnerProps): react.JSX.Element;
119
+
120
+ type AlertVariant = 'info' | 'success' | 'warning' | 'error';
121
+ interface AlertProps {
122
+ variant?: AlertVariant;
123
+ title?: string;
124
+ children: ReactNode;
125
+ onDismiss?: () => void;
126
+ }
127
+ declare function Alert({ variant, title, children, onDismiss, }: AlertProps): react.JSX.Element;
128
+
129
+ interface ModalProps {
130
+ open: boolean;
131
+ onClose: () => void;
132
+ children: ReactNode;
133
+ title?: string;
134
+ description?: string;
135
+ closeOnOverlay?: boolean;
136
+ }
137
+ declare function Modal({ open, onClose, children, title, description, closeOnOverlay, }: ModalProps): react.ReactPortal | null;
138
+
139
+ interface DialogProps {
140
+ open: boolean;
141
+ onClose: () => void;
142
+ title: string;
143
+ description?: string;
144
+ children?: ReactNode;
145
+ confirmLabel?: string;
146
+ cancelLabel?: string;
147
+ onConfirm?: () => void;
148
+ loading?: boolean;
149
+ variant?: 'default' | 'destructive';
150
+ }
151
+ declare function Dialog({ open, onClose, title, description, children, confirmLabel, cancelLabel, onConfirm, loading, variant, }: DialogProps): react.JSX.Element;
152
+
153
+ interface CardProps {
154
+ title?: string;
155
+ description?: string;
156
+ children?: ReactNode;
157
+ footer?: ReactNode;
158
+ padding?: 'none' | 'sm' | 'md' | 'lg';
159
+ }
160
+ declare function Card({ title, description, children, footer, padding, }: CardProps): react.JSX.Element;
161
+
162
+ type BadgeVariant = 'default' | 'success' | 'warning' | 'error' | 'info';
163
+ interface BadgeProps {
164
+ variant?: BadgeVariant;
165
+ children: ReactNode;
166
+ }
167
+ declare function Badge({ variant, children }: BadgeProps): react.JSX.Element;
168
+
169
+ interface SkeletonProps {
170
+ width?: string | number;
171
+ height?: string | number;
172
+ variant?: 'text' | 'circular' | 'rectangular';
173
+ lines?: number;
174
+ }
175
+ declare function Skeleton({ width, height, variant, lines, }: SkeletonProps): react.JSX.Element;
176
+
177
+ interface EmptyStateProps {
178
+ title: string;
179
+ description?: string;
180
+ icon?: ReactNode;
181
+ actionLabel?: string;
182
+ onAction?: () => void;
183
+ state?: UIState;
184
+ }
185
+ declare function EmptyState({ title, description, icon, actionLabel, onAction, state, }: EmptyStateProps): react.JSX.Element;
186
+
187
+ type TooltipSide = 'top' | 'bottom' | 'left' | 'right';
188
+ interface TooltipProps {
189
+ content: ReactNode;
190
+ children: ReactNode;
191
+ side?: TooltipSide;
192
+ }
193
+ declare function Tooltip({ content, children, side }: TooltipProps): react.JSX.Element;
194
+
195
+ type ToastVariant = AlertVariant;
196
+ interface ToastInput {
197
+ title?: string;
198
+ message: string;
199
+ variant?: ToastVariant;
200
+ duration?: number;
201
+ }
202
+ interface ToastItem extends ToastInput {
203
+ id: string;
204
+ }
205
+ interface ToastContextValue {
206
+ toast: (input: ToastInput) => string;
207
+ dismiss: (id: string) => void;
208
+ }
209
+ interface ToastProviderProps {
210
+ children: ReactNode;
211
+ placement?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
212
+ }
213
+ declare function ToastProvider({ children, placement, }: ToastProviderProps): react.JSX.Element;
214
+ declare function useToast(): ToastContextValue;
215
+
216
+ interface TabsProps {
217
+ value?: string;
218
+ defaultValue?: string;
219
+ onValueChange?: (value: string) => void;
220
+ children: ReactNode;
221
+ className?: string;
222
+ }
223
+ declare function Tabs({ value, defaultValue, onValueChange, children, className, }: TabsProps): react.JSX.Element;
224
+ interface TabsListProps {
225
+ children: ReactNode;
226
+ 'aria-label'?: string;
227
+ }
228
+ declare function TabsList({ children, 'aria-label': ariaLabel }: TabsListProps): react.JSX.Element;
229
+ interface TabsTriggerProps {
230
+ value: string;
231
+ children: ReactNode;
232
+ disabled?: boolean;
233
+ }
234
+ declare function TabsTrigger({ value, children, disabled }: TabsTriggerProps): react.JSX.Element;
235
+ interface TabsPanelProps {
236
+ value: string;
237
+ children: ReactNode;
238
+ }
239
+ declare function TabsPanel({ value, children }: TabsPanelProps): react.JSX.Element | null;
240
+
241
+ type DrawerSide = 'left' | 'right';
242
+ interface DrawerProps {
243
+ open: boolean;
244
+ onClose: () => void;
245
+ children: ReactNode;
246
+ title?: string;
247
+ description?: string;
248
+ side?: DrawerSide;
249
+ closeOnOverlay?: boolean;
250
+ }
251
+ declare function Drawer({ open, onClose, children, title, description, side, closeOnOverlay, }: DrawerProps): react.ReactPortal | null;
252
+
253
+ type PopoverSide = 'top' | 'bottom' | 'left' | 'right';
254
+ interface PopoverProps {
255
+ trigger: ReactNode;
256
+ content: ReactNode;
257
+ open?: boolean;
258
+ defaultOpen?: boolean;
259
+ onOpenChange?: (open: boolean) => void;
260
+ side?: PopoverSide;
261
+ 'aria-label'?: string;
262
+ }
263
+ declare function Popover({ trigger, content, open, defaultOpen, onOpenChange, side, 'aria-label': ariaLabel, }: PopoverProps): react.JSX.Element;
264
+
265
+ interface BreadcrumbItem {
266
+ label: string;
267
+ href?: string;
268
+ onClick?: () => void;
269
+ current?: boolean;
270
+ }
271
+ interface BreadcrumbProps {
272
+ items: BreadcrumbItem[];
273
+ 'aria-label'?: string;
274
+ }
275
+ declare function Breadcrumb({ items, 'aria-label': ariaLabel }: BreadcrumbProps): react.JSX.Element;
276
+
277
+ interface AccordionProps {
278
+ type?: 'single' | 'multiple';
279
+ collapsible?: boolean;
280
+ value?: string[];
281
+ defaultValue?: string[];
282
+ onValueChange?: (value: string[]) => void;
283
+ children: ReactNode;
284
+ className?: string;
285
+ }
286
+ declare function Accordion({ type, collapsible, value, defaultValue, onValueChange, children, className, }: AccordionProps): react.JSX.Element;
287
+ interface AccordionItemProps {
288
+ value: string;
289
+ children: ReactNode;
290
+ disabled?: boolean;
291
+ }
292
+ declare function AccordionItem({ value, children, disabled }: AccordionItemProps): react.JSX.Element;
293
+ interface AccordionTriggerProps {
294
+ children: ReactNode;
295
+ }
296
+ declare function AccordionTrigger({ children }: AccordionTriggerProps): react.JSX.Element;
297
+ interface AccordionContentProps {
298
+ children: ReactNode;
299
+ }
300
+ declare function AccordionContent({ children }: AccordionContentProps): react.JSX.Element;
301
+
302
+ interface PaginationProps {
303
+ page: number;
304
+ totalPages: number;
305
+ onPageChange: (page: number) => void;
306
+ siblingCount?: number;
307
+ previousLabel?: string;
308
+ nextLabel?: string;
309
+ 'aria-label'?: string;
310
+ className?: string;
311
+ }
312
+ declare function Pagination({ page, totalPages, onPageChange, siblingCount, previousLabel, nextLabel, 'aria-label': ariaLabel, className, }: PaginationProps): react.JSX.Element | null;
313
+
314
+ interface DataTableColumn<T> {
315
+ key: string;
316
+ header: string;
317
+ accessor?: (row: T) => ReactNode;
318
+ render?: (row: T) => ReactNode;
319
+ }
320
+ interface DataTableProps<T> {
321
+ data: T[];
322
+ columns: DataTableColumn<T>[];
323
+ keyExtractor: (row: T) => string;
324
+ caption?: string;
325
+ 'aria-label'?: string;
326
+ loading?: boolean;
327
+ emptyTitle?: string;
328
+ emptyDescription?: string;
329
+ emptyMessage?: string;
330
+ striped?: boolean;
331
+ skeletonRows?: number;
332
+ className?: string;
333
+ }
334
+ declare function DataTable<T>({ data, columns, keyExtractor, caption, 'aria-label': ariaLabel, loading, emptyTitle, emptyDescription, emptyMessage, striped, skeletonRows, className, }: DataTableProps<T>): react.JSX.Element;
335
+
336
+ interface FileUploadProps {
337
+ label?: string;
338
+ hint?: string;
339
+ error?: string | null;
340
+ accept?: string;
341
+ multiple?: boolean;
342
+ disabled?: boolean;
343
+ buttonLabel?: string;
344
+ onFilesChange?: (files: File[]) => void;
345
+ className?: string;
346
+ }
347
+ declare function FileUpload({ label, hint, error, accept, multiple, disabled, buttonLabel, onFilesChange, className, }: FileUploadProps): react.JSX.Element;
348
+
349
+ interface SidebarProps {
350
+ children: ReactNode;
351
+ 'aria-label'?: string;
352
+ className?: string;
353
+ }
354
+ declare function Sidebar({ children, 'aria-label': ariaLabel, className, }: SidebarProps): react.JSX.Element;
355
+ interface SidebarHeaderProps {
356
+ children: ReactNode;
357
+ }
358
+ declare function SidebarHeader({ children }: SidebarHeaderProps): react.JSX.Element;
359
+ interface SidebarNavProps {
360
+ children: ReactNode;
361
+ 'aria-label'?: string;
362
+ }
363
+ declare function SidebarNav({ children, 'aria-label': ariaLabel }: SidebarNavProps): react.JSX.Element;
364
+ interface SidebarGroupProps {
365
+ label: string;
366
+ children: ReactNode;
367
+ }
368
+ declare function SidebarGroup({ label, children }: SidebarGroupProps): react.JSX.Element;
369
+ interface SidebarItemProps {
370
+ children: ReactNode;
371
+ href?: string;
372
+ active?: boolean;
373
+ disabled?: boolean;
374
+ onClick?: () => void;
375
+ }
376
+ declare function SidebarItem({ children, href, active, disabled, onClick, }: SidebarItemProps): react.JSX.Element;
377
+
378
+ interface HeaderProps {
379
+ children: ReactNode;
380
+ className?: string;
381
+ }
382
+ declare function Header({ children, className }: HeaderProps): react.JSX.Element;
383
+ interface HeaderTitleProps {
384
+ children: ReactNode;
385
+ }
386
+ declare function HeaderTitle({ children }: HeaderTitleProps): react.JSX.Element;
387
+ interface HeaderBrandProps {
388
+ children: ReactNode;
389
+ }
390
+ declare function HeaderBrand({ children }: HeaderBrandProps): react.JSX.Element;
391
+ interface HeaderActionsProps {
392
+ children: ReactNode;
393
+ }
394
+ declare function HeaderActions({ children }: HeaderActionsProps): react.JSX.Element;
395
+
396
+ interface CommandPaletteItem {
397
+ id: string;
398
+ label: string;
399
+ group?: string;
400
+ keywords?: string[];
401
+ onSelect: () => void;
402
+ }
403
+ interface CommandPaletteProps {
404
+ open: boolean;
405
+ onOpenChange: (open: boolean) => void;
406
+ items: CommandPaletteItem[];
407
+ placeholder?: string;
408
+ emptyMessage?: string;
409
+ 'aria-label'?: string;
410
+ }
411
+ declare function CommandPalette({ open, onOpenChange, items, placeholder, emptyMessage, 'aria-label': ariaLabel, }: CommandPaletteProps): react.JSX.Element | null;
412
+ declare function useCommandPaletteShortcut(onOpen: () => void, enabled?: boolean): void;
413
+
414
+ interface DatePickerProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'value' | 'onChange'> {
415
+ label?: string;
416
+ hint?: string;
417
+ state?: UIState;
418
+ loading?: boolean;
419
+ error?: string | null;
420
+ inputSize?: Size;
421
+ value?: string;
422
+ onChange?: (value: string) => void;
423
+ }
424
+ declare const DatePicker: react.ForwardRefExoticComponent<DatePickerProps & react.RefAttributes<HTMLInputElement>>;
425
+
426
+ interface TimePickerProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'value' | 'onChange'> {
427
+ label?: string;
428
+ hint?: string;
429
+ state?: UIState;
430
+ loading?: boolean;
431
+ error?: string | null;
432
+ inputSize?: Size;
433
+ value?: string;
434
+ onChange?: (value: string) => void;
435
+ }
436
+ declare const TimePicker: react.ForwardRefExoticComponent<TimePickerProps & react.RefAttributes<HTMLInputElement>>;
437
+
438
+ interface DateRange {
439
+ startDate: string;
440
+ endDate: string;
441
+ }
442
+ interface DateRangePickerProps {
443
+ label?: string;
444
+ startLabel?: string;
445
+ endLabel?: string;
446
+ hint?: string;
447
+ state?: UIState;
448
+ loading?: boolean;
449
+ error?: string | null;
450
+ inputSize?: Size;
451
+ value?: DateRange;
452
+ onChange?: (value: DateRange) => void;
453
+ min?: string;
454
+ max?: string;
455
+ disabled?: boolean;
456
+ readOnly?: boolean;
457
+ className?: string;
458
+ id?: string;
459
+ }
460
+ declare function DateRangePicker({ label, startLabel, endLabel, hint, state, loading, error, inputSize, value, onChange, min, max, disabled, readOnly, className, id, }: DateRangePickerProps): react.JSX.Element;
461
+
462
+ export { Accordion, AccordionContent, type AccordionContentProps, AccordionItem, type AccordionItemProps, type AccordionProps, AccordionTrigger, type AccordionTriggerProps, Alert, type AlertProps, type AlertVariant, AsyncButton, type AsyncButtonProps, Badge, type BadgeProps, type BadgeVariant, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, type ButtonProps, Card, type CardProps, Checkbox, type CheckboxProps, CommandPalette, type CommandPaletteItem, type CommandPaletteProps, DataTable, type DataTableColumn, type DataTableProps, DatePicker, type DatePickerProps, type DateRange, DateRangePicker, type DateRangePickerProps, Dialog, type DialogProps, Drawer, type DrawerProps, type DrawerSide, EmptyState, type EmptyStateProps, FileUpload, type FileUploadProps, Header, HeaderActions, type HeaderActionsProps, HeaderBrand, type HeaderBrandProps, type HeaderProps, HeaderTitle, type HeaderTitleProps, Input, type InputProps, type LaRoseConfig, LaRoseProvider, type LaRoseProviderProps, Modal, type ModalProps, Pagination, type PaginationProps, Popover, type PopoverProps, type PopoverSide, Progress, type ProgressProps, type ProgressVariant, Radio, type RadioProps, Select, type SelectOption, type SelectProps, Sidebar, SidebarGroup, type SidebarGroupProps, SidebarHeader, type SidebarHeaderProps, SidebarItem, type SidebarItemProps, SidebarNav, type SidebarNavProps, type SidebarProps, Skeleton, type SkeletonProps, Spinner, type SpinnerProps, Switch, type SwitchProps, Tabs, TabsList, type TabsListProps, TabsPanel, type TabsPanelProps, type TabsProps, TabsTrigger, type TabsTriggerProps, Textarea, type TextareaProps, TimePicker, type TimePickerProps, type ToastInput, type ToastItem, ToastProvider, type ToastProviderProps, type ToastVariant, Tooltip, type TooltipProps, type TooltipSide, useCommandPaletteShortcut, useLaRose, useToast };