@refraction-ui/react 0.4.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -1
- package/dist/chunk-ZWRGVWUY.js +120 -0
- package/dist/chunk-ZWRGVWUY.js.map +1 -0
- package/dist/form.cjs +315 -0
- package/dist/form.cjs.map +1 -0
- package/dist/form.d.cts +1 -0
- package/dist/form.d.ts +1 -0
- package/dist/form.js +196 -0
- package/dist/form.js.map +1 -0
- package/dist/index.cjs +45 -258
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +74 -76
- package/dist/index.d.ts +74 -76
- package/dist/index.js +47 -334
- package/dist/index.js.map +1 -1
- package/dist/internal/animated-text/index.d.cts +47 -0
- package/dist/internal/animated-text/index.d.ts +47 -0
- package/dist/internal/app-shell/index.d.cts +128 -0
- package/dist/internal/app-shell/index.d.ts +128 -0
- package/dist/internal/auth/index.d.cts +74 -0
- package/dist/internal/auth/index.d.ts +74 -0
- package/dist/internal/avatar/index.d.cts +53 -0
- package/dist/internal/avatar/index.d.ts +53 -0
- package/dist/internal/avatar-group/index.d.cts +70 -0
- package/dist/internal/avatar-group/index.d.ts +70 -0
- package/dist/internal/badge/index.d.cts +26 -0
- package/dist/internal/badge/index.d.ts +26 -0
- package/dist/internal/bottom-nav/index.d.cts +29 -0
- package/dist/internal/bottom-nav/index.d.ts +29 -0
- package/dist/internal/breadcrumbs/index.d.cts +38 -0
- package/dist/internal/breadcrumbs/index.d.ts +38 -0
- package/dist/internal/button/index.d.cts +34 -0
- package/dist/internal/button/index.d.ts +34 -0
- package/dist/internal/calendar/index.d.cts +73 -0
- package/dist/internal/calendar/index.d.ts +73 -0
- package/dist/internal/card/index.d.cts +62 -0
- package/dist/internal/card/index.d.ts +62 -0
- package/dist/internal/card-grid/index.d.cts +10 -0
- package/dist/internal/card-grid/index.d.ts +10 -0
- package/dist/internal/checkbox/index.d.cts +40 -0
- package/dist/internal/checkbox/index.d.ts +40 -0
- package/dist/internal/code-editor/index.d.cts +47 -0
- package/dist/internal/code-editor/index.d.ts +47 -0
- package/dist/internal/collapsible/index.d.cts +43 -0
- package/dist/internal/collapsible/index.d.ts +43 -0
- package/dist/internal/command/index.d.cts +80 -0
- package/dist/internal/command/index.d.ts +80 -0
- package/dist/internal/content-protection/index.d.cts +47 -0
- package/dist/internal/content-protection/index.d.ts +47 -0
- package/dist/internal/data-table/index.d.cts +73 -0
- package/dist/internal/data-table/index.d.ts +73 -0
- package/dist/internal/date-picker/index.d.cts +98 -0
- package/dist/internal/date-picker/index.d.ts +98 -0
- package/dist/internal/device-frame/index.d.cts +40 -0
- package/dist/internal/device-frame/index.d.ts +40 -0
- package/dist/internal/dialog/index.d.cts +54 -0
- package/dist/internal/dialog/index.d.ts +54 -0
- package/dist/internal/dropdown-menu/index.d.cts +55 -0
- package/dist/internal/dropdown-menu/index.d.ts +55 -0
- package/dist/internal/emoji-picker/index.d.cts +77 -0
- package/dist/internal/emoji-picker/index.d.ts +77 -0
- package/dist/internal/feedback-dialog/index.d.cts +55 -0
- package/dist/internal/feedback-dialog/index.d.ts +55 -0
- package/dist/internal/file-upload/index.d.cts +91 -0
- package/dist/internal/file-upload/index.d.ts +91 -0
- package/dist/internal/footer/index.d.cts +30 -0
- package/dist/internal/footer/index.d.ts +30 -0
- package/dist/internal/inline-editor/index.d.cts +52 -0
- package/dist/internal/inline-editor/index.d.ts +52 -0
- package/dist/internal/input/index.d.cts +38 -0
- package/dist/internal/input/index.d.ts +38 -0
- package/dist/internal/input-group/index.d.cts +35 -0
- package/dist/internal/input-group/index.d.ts +35 -0
- package/dist/internal/install-prompt/index.d.cts +36 -0
- package/dist/internal/install-prompt/index.d.ts +36 -0
- package/dist/internal/keyboard-shortcut/index.d.cts +49 -0
- package/dist/internal/keyboard-shortcut/index.d.ts +49 -0
- package/dist/internal/language-selector/index.d.cts +63 -0
- package/dist/internal/language-selector/index.d.ts +63 -0
- package/dist/internal/markdown-renderer/index.d.cts +40 -0
- package/dist/internal/markdown-renderer/index.d.ts +40 -0
- package/dist/internal/mobile-nav/index.d.cts +45 -0
- package/dist/internal/mobile-nav/index.d.ts +45 -0
- package/dist/internal/navbar/index.d.cts +30 -0
- package/dist/internal/navbar/index.d.ts +30 -0
- package/dist/internal/otp-input/index.d.cts +66 -0
- package/dist/internal/otp-input/index.d.ts +66 -0
- package/dist/internal/payment/index.d.cts +9 -0
- package/dist/internal/payment/index.d.ts +9 -0
- package/dist/internal/popover/index.d.cts +46 -0
- package/dist/internal/popover/index.d.ts +46 -0
- package/dist/internal/presence-indicator/index.d.cts +38 -0
- package/dist/internal/presence-indicator/index.d.ts +38 -0
- package/dist/internal/progress-display/index.d.cts +60 -0
- package/dist/internal/progress-display/index.d.ts +60 -0
- package/dist/internal/radio/index.d.ts +43 -0
- package/dist/internal/react-accordion/index.d.ts +22 -0
- package/dist/internal/react-animated-text/index.d.cts +12 -0
- package/dist/internal/react-animated-text/index.d.ts +12 -0
- package/dist/internal/react-app-shell/index.d.cts +169 -0
- package/dist/internal/react-app-shell/index.d.ts +169 -0
- package/dist/internal/react-auth/index.d.cts +59 -0
- package/dist/internal/react-auth/index.d.ts +59 -0
- package/dist/internal/react-avatar/index.d.cts +20 -0
- package/dist/internal/react-avatar/index.d.ts +20 -0
- package/dist/internal/react-avatar-group/index.d.cts +33 -0
- package/dist/internal/react-avatar-group/index.d.ts +33 -0
- package/dist/internal/react-badge/index.d.cts +17 -0
- package/dist/internal/react-badge/index.d.ts +17 -0
- package/dist/internal/react-bottom-nav/index.d.cts +19 -0
- package/dist/internal/react-bottom-nav/index.d.ts +19 -0
- package/dist/internal/react-breadcrumbs/index.d.cts +24 -0
- package/dist/internal/react-breadcrumbs/index.d.ts +24 -0
- package/dist/internal/react-button/index.d.cts +21 -0
- package/dist/internal/react-button/index.d.ts +21 -0
- package/dist/internal/react-calendar/index.d.cts +44 -0
- package/dist/internal/react-calendar/index.d.ts +44 -0
- package/dist/internal/react-callout/index.d.cts +12 -0
- package/dist/internal/react-callout/index.d.ts +12 -0
- package/dist/internal/react-card/index.d.cts +29 -0
- package/dist/internal/react-card/index.d.ts +29 -0
- package/dist/internal/react-card-grid/index.d.cts +8 -0
- package/dist/internal/react-card-grid/index.d.ts +8 -0
- package/dist/internal/react-carousel/index.d.ts +22 -0
- package/dist/internal/react-checkbox/index.d.cts +18 -0
- package/dist/internal/react-checkbox/index.d.ts +18 -0
- package/dist/internal/react-code-block/index.d.cts +7 -0
- package/dist/internal/react-code-block/index.d.ts +7 -0
- package/dist/internal/react-code-editor/index.d.cts +28 -0
- package/dist/internal/react-code-editor/index.d.ts +28 -0
- package/dist/internal/react-collapsible/index.d.cts +29 -0
- package/dist/internal/react-collapsible/index.d.ts +29 -0
- package/dist/internal/react-combobox/index.d.cts +94 -0
- package/dist/internal/react-combobox/index.d.ts +94 -0
- package/dist/internal/react-command/index.d.cts +51 -0
- package/dist/internal/react-command/index.d.ts +51 -0
- package/dist/internal/react-content-protection/index.d.cts +22 -0
- package/dist/internal/react-content-protection/index.d.ts +22 -0
- package/dist/internal/react-data-table/index.d.cts +22 -0
- package/dist/internal/react-data-table/index.d.ts +22 -0
- package/dist/internal/react-date-picker/index.d.cts +23 -0
- package/dist/internal/react-date-picker/index.d.ts +23 -0
- package/dist/internal/react-device-frame/index.d.cts +37 -0
- package/dist/internal/react-device-frame/index.d.ts +37 -0
- package/dist/internal/react-dialog/index.d.cts +49 -0
- package/dist/internal/react-dialog/index.d.ts +49 -0
- package/dist/internal/react-dropdown-menu/index.d.cts +37 -0
- package/dist/internal/react-dropdown-menu/index.d.ts +37 -0
- package/dist/internal/react-emoji-picker/index.d.cts +32 -0
- package/dist/internal/react-emoji-picker/index.d.ts +32 -0
- package/dist/internal/react-feedback-dialog/index.d.cts +40 -0
- package/dist/internal/react-feedback-dialog/index.d.ts +40 -0
- package/dist/internal/react-file-tree/index.d.cts +5 -0
- package/dist/internal/react-file-tree/index.d.ts +5 -0
- package/dist/internal/react-file-upload/index.d.cts +22 -0
- package/dist/internal/react-file-upload/index.d.ts +22 -0
- package/dist/internal/react-footer/index.d.cts +20 -0
- package/dist/internal/react-footer/index.d.ts +20 -0
- package/dist/internal/react-form/index.d.cts +85 -0
- package/dist/internal/react-form/index.d.ts +85 -0
- package/dist/internal/react-icon-system/index.d.cts +5 -0
- package/dist/internal/react-icon-system/index.d.ts +5 -0
- package/dist/internal/react-inline-editor/index.d.cts +17 -0
- package/dist/internal/react-inline-editor/index.d.ts +17 -0
- package/dist/internal/react-input/index.d.cts +31 -0
- package/dist/internal/react-input/index.d.ts +31 -0
- package/dist/internal/react-input-group/index.d.cts +34 -0
- package/dist/internal/react-input-group/index.d.ts +34 -0
- package/dist/internal/react-install-prompt/index.d.cts +24 -0
- package/dist/internal/react-install-prompt/index.d.ts +24 -0
- package/dist/internal/react-keyboard-shortcut/index.d.cts +57 -0
- package/dist/internal/react-keyboard-shortcut/index.d.ts +57 -0
- package/dist/internal/react-language-selector/index.d.cts +26 -0
- package/dist/internal/react-language-selector/index.d.ts +26 -0
- package/dist/internal/react-link-card/index.d.cts +5 -0
- package/dist/internal/react-link-card/index.d.ts +5 -0
- package/dist/internal/react-markdown-renderer/index.d.cts +20 -0
- package/dist/internal/react-markdown-renderer/index.d.ts +20 -0
- package/dist/internal/react-mobile-nav/index.d.cts +33 -0
- package/dist/internal/react-mobile-nav/index.d.ts +33 -0
- package/dist/internal/react-navbar/index.d.cts +25 -0
- package/dist/internal/react-navbar/index.d.ts +25 -0
- package/dist/internal/react-otp-input/index.d.cts +21 -0
- package/dist/internal/react-otp-input/index.d.ts +21 -0
- package/dist/internal/react-pagination/index.d.ts +7 -0
- package/dist/internal/react-payment/index.d.cts +9 -0
- package/dist/internal/react-payment/index.d.ts +9 -0
- package/dist/internal/react-popover/index.d.cts +33 -0
- package/dist/internal/react-popover/index.d.ts +33 -0
- package/dist/internal/react-presence-indicator/index.d.cts +34 -0
- package/dist/internal/react-presence-indicator/index.d.ts +34 -0
- package/dist/internal/react-progress-display/index.d.cts +21 -0
- package/dist/internal/react-progress-display/index.d.ts +21 -0
- package/dist/internal/react-radio/index.d.ts +33 -0
- package/dist/internal/react-reaction-bar/index.d.cts +34 -0
- package/dist/internal/react-reaction-bar/index.d.ts +34 -0
- package/dist/internal/react-resizable-layout/index.d.cts +36 -0
- package/dist/internal/react-resizable-layout/index.d.ts +36 -0
- package/dist/internal/react-rich-editor/index.d.cts +2 -0
- package/dist/internal/react-rich-editor/index.d.ts +2 -0
- package/dist/internal/react-search-bar/index.d.cts +32 -0
- package/dist/internal/react-search-bar/index.d.ts +32 -0
- package/dist/internal/react-select/index.d.cts +30 -0
- package/dist/internal/react-select/index.d.ts +30 -0
- package/dist/internal/react-sheet/index.d.cts +67 -0
- package/dist/internal/react-sheet/index.d.ts +67 -0
- package/dist/internal/react-sidebar/index.d.cts +23 -0
- package/dist/internal/react-sidebar/index.d.ts +23 -0
- package/dist/internal/react-skeleton/index.d.cts +31 -0
- package/dist/internal/react-skeleton/index.d.ts +31 -0
- package/dist/internal/react-skip-to-content/index.d.cts +9 -0
- package/dist/internal/react-skip-to-content/index.d.ts +9 -0
- package/dist/internal/react-slide-viewer/index.d.cts +23 -0
- package/dist/internal/react-slide-viewer/index.d.ts +23 -0
- package/dist/internal/react-slider/index.d.cts +1 -0
- package/dist/internal/react-slider/index.d.ts +1 -0
- package/dist/internal/react-status-indicator/index.d.cts +34 -0
- package/dist/internal/react-status-indicator/index.d.ts +34 -0
- package/dist/internal/react-steps/index.d.cts +19 -0
- package/dist/internal/react-steps/index.d.ts +19 -0
- package/dist/internal/react-switch/index.d.cts +17 -0
- package/dist/internal/react-switch/index.d.ts +17 -0
- package/dist/internal/react-table-of-contents/index.d.ts +10 -0
- package/dist/internal/react-tabs/index.d.cts +31 -0
- package/dist/internal/react-tabs/index.d.ts +31 -0
- package/dist/internal/react-textarea/index.d.cts +16 -0
- package/dist/internal/react-textarea/index.d.ts +16 -0
- package/dist/internal/react-theme/index.d.cts +44 -0
- package/dist/internal/react-theme/index.d.ts +44 -0
- package/dist/internal/react-thread-view/index.d.cts +34 -0
- package/dist/internal/react-thread-view/index.d.ts +34 -0
- package/dist/internal/react-toast/index.d.cts +36 -0
- package/dist/internal/react-toast/index.d.ts +36 -0
- package/dist/internal/react-tooltip/index.d.cts +33 -0
- package/dist/internal/react-tooltip/index.d.ts +33 -0
- package/dist/internal/react-version-selector/index.d.cts +24 -0
- package/dist/internal/react-version-selector/index.d.ts +24 -0
- package/dist/internal/react-video-player/index.d.cts +9 -0
- package/dist/internal/react-video-player/index.d.ts +9 -0
- package/dist/internal/react-voice-pill/index.d.cts +10 -0
- package/dist/internal/react-voice-pill/index.d.ts +10 -0
- package/dist/internal/react-waveform/index.d.cts +9 -0
- package/dist/internal/react-waveform/index.d.ts +9 -0
- package/dist/internal/reaction-bar/index.d.cts +50 -0
- package/dist/internal/reaction-bar/index.d.ts +50 -0
- package/dist/internal/resizable-layout/index.d.cts +47 -0
- package/dist/internal/resizable-layout/index.d.ts +47 -0
- package/dist/internal/search-bar/index.d.cts +51 -0
- package/dist/internal/search-bar/index.d.ts +51 -0
- package/dist/internal/select/index.d.cts +69 -0
- package/dist/internal/select/index.d.ts +69 -0
- package/dist/internal/shared/index.d.cts +249 -0
- package/dist/internal/shared/index.d.ts +249 -0
- package/dist/internal/sidebar/index.d.cts +40 -0
- package/dist/internal/sidebar/index.d.ts +40 -0
- package/dist/internal/skeleton/index.d.cts +27 -0
- package/dist/internal/skeleton/index.d.ts +27 -0
- package/dist/internal/slide-viewer/index.d.cts +72 -0
- package/dist/internal/slide-viewer/index.d.ts +72 -0
- package/dist/internal/slider/index.d.cts +4 -0
- package/dist/internal/slider/index.d.ts +4 -0
- package/dist/internal/status-indicator/index.d.cts +42 -0
- package/dist/internal/status-indicator/index.d.ts +42 -0
- package/dist/internal/switch/index.d.cts +41 -0
- package/dist/internal/switch/index.d.ts +41 -0
- package/dist/internal/tabs/index.d.cts +45 -0
- package/dist/internal/tabs/index.d.ts +45 -0
- package/dist/internal/textarea/index.d.cts +28 -0
- package/dist/internal/textarea/index.d.ts +28 -0
- package/dist/internal/theme/index.d.cts +60 -0
- package/dist/internal/theme/index.d.ts +60 -0
- package/dist/internal/thread-view/index.d.cts +95 -0
- package/dist/internal/thread-view/index.d.ts +95 -0
- package/dist/internal/toast/index.d.cts +64 -0
- package/dist/internal/toast/index.d.ts +64 -0
- package/dist/internal/tooltip/index.d.cts +45 -0
- package/dist/internal/tooltip/index.d.ts +45 -0
- package/dist/internal/version-selector/index.d.cts +68 -0
- package/dist/internal/version-selector/index.d.ts +68 -0
- package/dist/internal/video-player/index.d.cts +50 -0
- package/dist/internal/video-player/index.d.ts +50 -0
- package/dist/internal/voice-pill/index.d.cts +86 -0
- package/dist/internal/voice-pill/index.d.ts +86 -0
- package/dist/internal/waveform/index.d.cts +83 -0
- package/dist/internal/waveform/index.d.ts +83 -0
- package/dist/theme.d.cts +1 -1
- package/dist/theme.d.ts +1 -1
- package/package.json +7 -6
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { AccessibilityProps, KeyboardHandlerMap } from '../shared/index.cjs';
|
|
2
|
+
|
|
3
|
+
type DatePickerView = 'calendar' | 'time';
|
|
4
|
+
interface DatePickerProps {
|
|
5
|
+
/** Selected date (controlled) */
|
|
6
|
+
value?: Date;
|
|
7
|
+
/** Callback when value changes */
|
|
8
|
+
onChange?: (date: Date) => void;
|
|
9
|
+
/** Minimum selectable date */
|
|
10
|
+
minDate?: Date;
|
|
11
|
+
/** Maximum selectable date */
|
|
12
|
+
maxDate?: Date;
|
|
13
|
+
/** Show time selection */
|
|
14
|
+
showTime?: boolean;
|
|
15
|
+
/** Display format string */
|
|
16
|
+
format?: string;
|
|
17
|
+
/** Placeholder text */
|
|
18
|
+
placeholder?: string;
|
|
19
|
+
/** Whether the picker is open (controlled) */
|
|
20
|
+
open?: boolean;
|
|
21
|
+
/** Default open state */
|
|
22
|
+
defaultOpen?: boolean;
|
|
23
|
+
/** Callback when open changes */
|
|
24
|
+
onOpenChange?: (open: boolean) => void;
|
|
25
|
+
}
|
|
26
|
+
interface DatePickerState {
|
|
27
|
+
open: boolean;
|
|
28
|
+
selectedDate: Date | undefined;
|
|
29
|
+
view: DatePickerView;
|
|
30
|
+
hours: number;
|
|
31
|
+
minutes: number;
|
|
32
|
+
currentMonth: Date;
|
|
33
|
+
}
|
|
34
|
+
interface CalendarDay {
|
|
35
|
+
date: Date;
|
|
36
|
+
isToday: boolean;
|
|
37
|
+
isSelected: boolean;
|
|
38
|
+
isCurrentMonth: boolean;
|
|
39
|
+
isDisabled: boolean;
|
|
40
|
+
}
|
|
41
|
+
interface DatePickerAPI {
|
|
42
|
+
/** Current state */
|
|
43
|
+
state: DatePickerState;
|
|
44
|
+
/** Calendar days grid (42 cells) */
|
|
45
|
+
days: CalendarDay[];
|
|
46
|
+
/** Open the picker */
|
|
47
|
+
openPicker(): void;
|
|
48
|
+
/** Close the picker */
|
|
49
|
+
closePicker(): void;
|
|
50
|
+
/** Toggle the picker */
|
|
51
|
+
togglePicker(): void;
|
|
52
|
+
/** Select a date from calendar */
|
|
53
|
+
selectDate(date: Date): void;
|
|
54
|
+
/** Set hours */
|
|
55
|
+
setHours(hours: number): void;
|
|
56
|
+
/** Set minutes */
|
|
57
|
+
setMinutes(minutes: number): void;
|
|
58
|
+
/** Navigate to previous month */
|
|
59
|
+
prevMonth(): void;
|
|
60
|
+
/** Navigate to next month */
|
|
61
|
+
nextMonth(): void;
|
|
62
|
+
/** Switch between calendar and time views */
|
|
63
|
+
setView(view: DatePickerView): void;
|
|
64
|
+
/** Format the selected date for display */
|
|
65
|
+
formatDisplay(): string;
|
|
66
|
+
/** ARIA attributes for the trigger input */
|
|
67
|
+
triggerProps: Partial<AccessibilityProps> & Record<string, unknown>;
|
|
68
|
+
/** ARIA attributes for the dropdown */
|
|
69
|
+
dropdownProps: Partial<AccessibilityProps> & Record<string, unknown>;
|
|
70
|
+
/** ARIA props for the calendar grid */
|
|
71
|
+
gridProps: Partial<AccessibilityProps> & Record<string, unknown>;
|
|
72
|
+
/** Get ARIA props for a day cell */
|
|
73
|
+
getDayAriaProps(day: CalendarDay): Partial<AccessibilityProps> & Record<string, unknown>;
|
|
74
|
+
/** Keyboard handlers */
|
|
75
|
+
keyboardHandlers: KeyboardHandlerMap;
|
|
76
|
+
/** Generated IDs */
|
|
77
|
+
ids: {
|
|
78
|
+
trigger: string;
|
|
79
|
+
dropdown: string;
|
|
80
|
+
grid: string;
|
|
81
|
+
label: string;
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
declare function formatDate(date: Date | undefined, format: string, showTime: boolean): string;
|
|
85
|
+
declare function createDatePicker(props?: DatePickerProps): DatePickerAPI;
|
|
86
|
+
|
|
87
|
+
declare const datePickerTriggerStyles = "inline-flex items-center gap-2 rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring cursor-pointer";
|
|
88
|
+
declare const datePickerDropdownStyles = "absolute z-50 mt-1 rounded-md border bg-popover p-4 text-popover-foreground shadow-md";
|
|
89
|
+
declare const datePickerGridStyles = "w-full border-collapse";
|
|
90
|
+
declare const datePickerDayVariants: (props?: ({
|
|
91
|
+
state?: "default" | "selected" | "today" | "disabled" | "outside" | undefined;
|
|
92
|
+
} & {
|
|
93
|
+
className?: string;
|
|
94
|
+
}) | undefined) => string;
|
|
95
|
+
declare const datePickerTimeStyles = "flex items-center gap-2 mt-3 pt-3 border-t";
|
|
96
|
+
declare const datePickerTimeInputStyles = "w-14 rounded-md border border-input bg-background px-2 py-1 text-sm text-center";
|
|
97
|
+
|
|
98
|
+
export { type CalendarDay, type DatePickerAPI, type DatePickerProps, type DatePickerState, type DatePickerView, createDatePicker, datePickerDayVariants, datePickerDropdownStyles, datePickerGridStyles, datePickerTimeInputStyles, datePickerTimeStyles, datePickerTriggerStyles, formatDate };
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { AccessibilityProps, KeyboardHandlerMap } from '../shared/index.js';
|
|
2
|
+
|
|
3
|
+
type DatePickerView = 'calendar' | 'time';
|
|
4
|
+
interface DatePickerProps {
|
|
5
|
+
/** Selected date (controlled) */
|
|
6
|
+
value?: Date;
|
|
7
|
+
/** Callback when value changes */
|
|
8
|
+
onChange?: (date: Date) => void;
|
|
9
|
+
/** Minimum selectable date */
|
|
10
|
+
minDate?: Date;
|
|
11
|
+
/** Maximum selectable date */
|
|
12
|
+
maxDate?: Date;
|
|
13
|
+
/** Show time selection */
|
|
14
|
+
showTime?: boolean;
|
|
15
|
+
/** Display format string */
|
|
16
|
+
format?: string;
|
|
17
|
+
/** Placeholder text */
|
|
18
|
+
placeholder?: string;
|
|
19
|
+
/** Whether the picker is open (controlled) */
|
|
20
|
+
open?: boolean;
|
|
21
|
+
/** Default open state */
|
|
22
|
+
defaultOpen?: boolean;
|
|
23
|
+
/** Callback when open changes */
|
|
24
|
+
onOpenChange?: (open: boolean) => void;
|
|
25
|
+
}
|
|
26
|
+
interface DatePickerState {
|
|
27
|
+
open: boolean;
|
|
28
|
+
selectedDate: Date | undefined;
|
|
29
|
+
view: DatePickerView;
|
|
30
|
+
hours: number;
|
|
31
|
+
minutes: number;
|
|
32
|
+
currentMonth: Date;
|
|
33
|
+
}
|
|
34
|
+
interface CalendarDay {
|
|
35
|
+
date: Date;
|
|
36
|
+
isToday: boolean;
|
|
37
|
+
isSelected: boolean;
|
|
38
|
+
isCurrentMonth: boolean;
|
|
39
|
+
isDisabled: boolean;
|
|
40
|
+
}
|
|
41
|
+
interface DatePickerAPI {
|
|
42
|
+
/** Current state */
|
|
43
|
+
state: DatePickerState;
|
|
44
|
+
/** Calendar days grid (42 cells) */
|
|
45
|
+
days: CalendarDay[];
|
|
46
|
+
/** Open the picker */
|
|
47
|
+
openPicker(): void;
|
|
48
|
+
/** Close the picker */
|
|
49
|
+
closePicker(): void;
|
|
50
|
+
/** Toggle the picker */
|
|
51
|
+
togglePicker(): void;
|
|
52
|
+
/** Select a date from calendar */
|
|
53
|
+
selectDate(date: Date): void;
|
|
54
|
+
/** Set hours */
|
|
55
|
+
setHours(hours: number): void;
|
|
56
|
+
/** Set minutes */
|
|
57
|
+
setMinutes(minutes: number): void;
|
|
58
|
+
/** Navigate to previous month */
|
|
59
|
+
prevMonth(): void;
|
|
60
|
+
/** Navigate to next month */
|
|
61
|
+
nextMonth(): void;
|
|
62
|
+
/** Switch between calendar and time views */
|
|
63
|
+
setView(view: DatePickerView): void;
|
|
64
|
+
/** Format the selected date for display */
|
|
65
|
+
formatDisplay(): string;
|
|
66
|
+
/** ARIA attributes for the trigger input */
|
|
67
|
+
triggerProps: Partial<AccessibilityProps> & Record<string, unknown>;
|
|
68
|
+
/** ARIA attributes for the dropdown */
|
|
69
|
+
dropdownProps: Partial<AccessibilityProps> & Record<string, unknown>;
|
|
70
|
+
/** ARIA props for the calendar grid */
|
|
71
|
+
gridProps: Partial<AccessibilityProps> & Record<string, unknown>;
|
|
72
|
+
/** Get ARIA props for a day cell */
|
|
73
|
+
getDayAriaProps(day: CalendarDay): Partial<AccessibilityProps> & Record<string, unknown>;
|
|
74
|
+
/** Keyboard handlers */
|
|
75
|
+
keyboardHandlers: KeyboardHandlerMap;
|
|
76
|
+
/** Generated IDs */
|
|
77
|
+
ids: {
|
|
78
|
+
trigger: string;
|
|
79
|
+
dropdown: string;
|
|
80
|
+
grid: string;
|
|
81
|
+
label: string;
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
declare function formatDate(date: Date | undefined, format: string, showTime: boolean): string;
|
|
85
|
+
declare function createDatePicker(props?: DatePickerProps): DatePickerAPI;
|
|
86
|
+
|
|
87
|
+
declare const datePickerTriggerStyles = "inline-flex items-center gap-2 rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring cursor-pointer";
|
|
88
|
+
declare const datePickerDropdownStyles = "absolute z-50 mt-1 rounded-md border bg-popover p-4 text-popover-foreground shadow-md";
|
|
89
|
+
declare const datePickerGridStyles = "w-full border-collapse";
|
|
90
|
+
declare const datePickerDayVariants: (props?: ({
|
|
91
|
+
state?: "default" | "selected" | "today" | "disabled" | "outside" | undefined;
|
|
92
|
+
} & {
|
|
93
|
+
className?: string;
|
|
94
|
+
}) | undefined) => string;
|
|
95
|
+
declare const datePickerTimeStyles = "flex items-center gap-2 mt-3 pt-3 border-t";
|
|
96
|
+
declare const datePickerTimeInputStyles = "w-14 rounded-md border border-input bg-background px-2 py-1 text-sm text-center";
|
|
97
|
+
|
|
98
|
+
export { type CalendarDay, type DatePickerAPI, type DatePickerProps, type DatePickerState, type DatePickerView, createDatePicker, datePickerDayVariants, datePickerDropdownStyles, datePickerGridStyles, datePickerTimeInputStyles, datePickerTimeStyles, datePickerTriggerStyles, formatDate };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { AccessibilityProps } from '../shared/index.cjs';
|
|
2
|
+
|
|
3
|
+
type DeviceType = 'iphone' | 'ipad' | 'android-phone' | 'android-tablet';
|
|
4
|
+
type DeviceOrientation = 'portrait' | 'landscape';
|
|
5
|
+
interface DeviceFrameProps {
|
|
6
|
+
/** The type of device to display */
|
|
7
|
+
device: DeviceType;
|
|
8
|
+
/** The orientation of the device */
|
|
9
|
+
orientation?: DeviceOrientation;
|
|
10
|
+
}
|
|
11
|
+
interface DeviceDimensions {
|
|
12
|
+
/** Width in pixels */
|
|
13
|
+
width: number;
|
|
14
|
+
/** Height in pixels */
|
|
15
|
+
height: number;
|
|
16
|
+
/** Border radius in pixels */
|
|
17
|
+
radius: number;
|
|
18
|
+
/** Whether the device has a notch */
|
|
19
|
+
notch: boolean;
|
|
20
|
+
/** Whether the device has a home indicator bar */
|
|
21
|
+
homeIndicator: boolean;
|
|
22
|
+
}
|
|
23
|
+
interface DeviceFrameAPI {
|
|
24
|
+
/** Computed dimensions for the device */
|
|
25
|
+
dimensions: DeviceDimensions;
|
|
26
|
+
/** ARIA attributes for the device frame */
|
|
27
|
+
ariaProps: Partial<AccessibilityProps> & Record<string, unknown>;
|
|
28
|
+
/** Data attributes for styling hooks */
|
|
29
|
+
dataAttributes: Record<string, string>;
|
|
30
|
+
}
|
|
31
|
+
declare function createDeviceFrame(props: DeviceFrameProps): DeviceFrameAPI;
|
|
32
|
+
|
|
33
|
+
declare const deviceFrameVariants: (props?: ({
|
|
34
|
+
device?: "iphone" | "ipad" | "android-phone" | "android-tablet" | undefined;
|
|
35
|
+
orientation?: "portrait" | "landscape" | undefined;
|
|
36
|
+
} & {
|
|
37
|
+
className?: string;
|
|
38
|
+
}) | undefined) => string;
|
|
39
|
+
|
|
40
|
+
export { type DeviceDimensions, type DeviceFrameAPI, type DeviceFrameProps, type DeviceOrientation, type DeviceType, createDeviceFrame, deviceFrameVariants };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { AccessibilityProps } from '../shared/index.js';
|
|
2
|
+
|
|
3
|
+
type DeviceType = 'iphone' | 'ipad' | 'android-phone' | 'android-tablet';
|
|
4
|
+
type DeviceOrientation = 'portrait' | 'landscape';
|
|
5
|
+
interface DeviceFrameProps {
|
|
6
|
+
/** The type of device to display */
|
|
7
|
+
device: DeviceType;
|
|
8
|
+
/** The orientation of the device */
|
|
9
|
+
orientation?: DeviceOrientation;
|
|
10
|
+
}
|
|
11
|
+
interface DeviceDimensions {
|
|
12
|
+
/** Width in pixels */
|
|
13
|
+
width: number;
|
|
14
|
+
/** Height in pixels */
|
|
15
|
+
height: number;
|
|
16
|
+
/** Border radius in pixels */
|
|
17
|
+
radius: number;
|
|
18
|
+
/** Whether the device has a notch */
|
|
19
|
+
notch: boolean;
|
|
20
|
+
/** Whether the device has a home indicator bar */
|
|
21
|
+
homeIndicator: boolean;
|
|
22
|
+
}
|
|
23
|
+
interface DeviceFrameAPI {
|
|
24
|
+
/** Computed dimensions for the device */
|
|
25
|
+
dimensions: DeviceDimensions;
|
|
26
|
+
/** ARIA attributes for the device frame */
|
|
27
|
+
ariaProps: Partial<AccessibilityProps> & Record<string, unknown>;
|
|
28
|
+
/** Data attributes for styling hooks */
|
|
29
|
+
dataAttributes: Record<string, string>;
|
|
30
|
+
}
|
|
31
|
+
declare function createDeviceFrame(props: DeviceFrameProps): DeviceFrameAPI;
|
|
32
|
+
|
|
33
|
+
declare const deviceFrameVariants: (props?: ({
|
|
34
|
+
device?: "iphone" | "ipad" | "android-phone" | "android-tablet" | undefined;
|
|
35
|
+
orientation?: "portrait" | "landscape" | undefined;
|
|
36
|
+
} & {
|
|
37
|
+
className?: string;
|
|
38
|
+
}) | undefined) => string;
|
|
39
|
+
|
|
40
|
+
export { type DeviceDimensions, type DeviceFrameAPI, type DeviceFrameProps, type DeviceOrientation, type DeviceType, createDeviceFrame, deviceFrameVariants };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { AccessibilityProps, KeyboardHandlerMap, FocusTrapConfig } from '../shared/index.cjs';
|
|
2
|
+
|
|
3
|
+
interface DialogProps {
|
|
4
|
+
/** Whether the dialog is open (controlled) */
|
|
5
|
+
open?: boolean;
|
|
6
|
+
/** Whether the dialog starts open (uncontrolled) */
|
|
7
|
+
defaultOpen?: boolean;
|
|
8
|
+
/** Callback when open state changes */
|
|
9
|
+
onOpenChange?: (open: boolean) => void;
|
|
10
|
+
/** Whether the dialog is modal (default: true) */
|
|
11
|
+
modal?: boolean;
|
|
12
|
+
}
|
|
13
|
+
interface DialogState {
|
|
14
|
+
open: boolean;
|
|
15
|
+
}
|
|
16
|
+
interface DialogAPI {
|
|
17
|
+
/** Current dialog state */
|
|
18
|
+
state: DialogState;
|
|
19
|
+
/** ARIA attributes for the trigger button */
|
|
20
|
+
triggerProps: Partial<AccessibilityProps> & Record<string, unknown>;
|
|
21
|
+
/** ARIA attributes for the dialog content */
|
|
22
|
+
contentProps: Partial<AccessibilityProps> & Record<string, unknown>;
|
|
23
|
+
/** Data attributes for the overlay */
|
|
24
|
+
overlayProps: Record<string, string>;
|
|
25
|
+
/** Open the dialog */
|
|
26
|
+
open(): void;
|
|
27
|
+
/** Close the dialog */
|
|
28
|
+
close(): void;
|
|
29
|
+
/** Toggle the dialog */
|
|
30
|
+
toggle(): void;
|
|
31
|
+
/** Keyboard handlers (Escape to close) */
|
|
32
|
+
keyboardHandlers: KeyboardHandlerMap;
|
|
33
|
+
/** Generated IDs for aria linking */
|
|
34
|
+
ids: {
|
|
35
|
+
content: string;
|
|
36
|
+
title: string;
|
|
37
|
+
description: string;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Focus trap configuration for framework wrappers.
|
|
41
|
+
* Pass this to createFocusTrap() with a container element.
|
|
42
|
+
*/
|
|
43
|
+
focusTrapConfig: Omit<FocusTrapConfig, 'container'>;
|
|
44
|
+
}
|
|
45
|
+
declare function createDialog(props?: DialogProps): DialogAPI;
|
|
46
|
+
|
|
47
|
+
declare const overlayStyles = "fixed inset-0 z-50 bg-black/80";
|
|
48
|
+
declare const dialogContentVariants: (props?: ({
|
|
49
|
+
[x: string]: string | undefined;
|
|
50
|
+
} & {
|
|
51
|
+
className?: string;
|
|
52
|
+
}) | undefined) => string;
|
|
53
|
+
|
|
54
|
+
export { type DialogAPI, type DialogProps, type DialogState, createDialog, dialogContentVariants, overlayStyles };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { AccessibilityProps, KeyboardHandlerMap, FocusTrapConfig } from '../shared/index.js';
|
|
2
|
+
|
|
3
|
+
interface DialogProps {
|
|
4
|
+
/** Whether the dialog is open (controlled) */
|
|
5
|
+
open?: boolean;
|
|
6
|
+
/** Whether the dialog starts open (uncontrolled) */
|
|
7
|
+
defaultOpen?: boolean;
|
|
8
|
+
/** Callback when open state changes */
|
|
9
|
+
onOpenChange?: (open: boolean) => void;
|
|
10
|
+
/** Whether the dialog is modal (default: true) */
|
|
11
|
+
modal?: boolean;
|
|
12
|
+
}
|
|
13
|
+
interface DialogState {
|
|
14
|
+
open: boolean;
|
|
15
|
+
}
|
|
16
|
+
interface DialogAPI {
|
|
17
|
+
/** Current dialog state */
|
|
18
|
+
state: DialogState;
|
|
19
|
+
/** ARIA attributes for the trigger button */
|
|
20
|
+
triggerProps: Partial<AccessibilityProps> & Record<string, unknown>;
|
|
21
|
+
/** ARIA attributes for the dialog content */
|
|
22
|
+
contentProps: Partial<AccessibilityProps> & Record<string, unknown>;
|
|
23
|
+
/** Data attributes for the overlay */
|
|
24
|
+
overlayProps: Record<string, string>;
|
|
25
|
+
/** Open the dialog */
|
|
26
|
+
open(): void;
|
|
27
|
+
/** Close the dialog */
|
|
28
|
+
close(): void;
|
|
29
|
+
/** Toggle the dialog */
|
|
30
|
+
toggle(): void;
|
|
31
|
+
/** Keyboard handlers (Escape to close) */
|
|
32
|
+
keyboardHandlers: KeyboardHandlerMap;
|
|
33
|
+
/** Generated IDs for aria linking */
|
|
34
|
+
ids: {
|
|
35
|
+
content: string;
|
|
36
|
+
title: string;
|
|
37
|
+
description: string;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Focus trap configuration for framework wrappers.
|
|
41
|
+
* Pass this to createFocusTrap() with a container element.
|
|
42
|
+
*/
|
|
43
|
+
focusTrapConfig: Omit<FocusTrapConfig, 'container'>;
|
|
44
|
+
}
|
|
45
|
+
declare function createDialog(props?: DialogProps): DialogAPI;
|
|
46
|
+
|
|
47
|
+
declare const overlayStyles = "fixed inset-0 z-50 bg-black/80";
|
|
48
|
+
declare const dialogContentVariants: (props?: ({
|
|
49
|
+
[x: string]: string | undefined;
|
|
50
|
+
} & {
|
|
51
|
+
className?: string;
|
|
52
|
+
}) | undefined) => string;
|
|
53
|
+
|
|
54
|
+
export { type DialogAPI, type DialogProps, type DialogState, createDialog, dialogContentVariants, overlayStyles };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { AccessibilityProps, KeyboardHandlerMap } from '../shared/index.cjs';
|
|
2
|
+
|
|
3
|
+
interface DropdownMenuProps {
|
|
4
|
+
/** Whether the menu is open (controlled) */
|
|
5
|
+
open?: boolean;
|
|
6
|
+
/** Whether the menu starts open (uncontrolled) */
|
|
7
|
+
defaultOpen?: boolean;
|
|
8
|
+
/** Callback when open state changes */
|
|
9
|
+
onOpenChange?: (open: boolean) => void;
|
|
10
|
+
}
|
|
11
|
+
interface MenuItemProps {
|
|
12
|
+
/** Whether the item is disabled */
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
/** Callback when the item is selected */
|
|
15
|
+
onSelect?: () => void;
|
|
16
|
+
}
|
|
17
|
+
interface DropdownMenuState {
|
|
18
|
+
open: boolean;
|
|
19
|
+
}
|
|
20
|
+
interface DropdownMenuAPI {
|
|
21
|
+
/** Current menu state */
|
|
22
|
+
state: DropdownMenuState;
|
|
23
|
+
/** ARIA attributes for the trigger button */
|
|
24
|
+
triggerProps: Partial<AccessibilityProps> & Record<string, unknown>;
|
|
25
|
+
/** ARIA attributes for the menu content */
|
|
26
|
+
contentProps: Partial<AccessibilityProps> & Record<string, unknown>;
|
|
27
|
+
/** Factory for menu item props */
|
|
28
|
+
getItemProps(item: MenuItemProps): Partial<AccessibilityProps> & Record<string, unknown>;
|
|
29
|
+
/** Open the menu */
|
|
30
|
+
open(): void;
|
|
31
|
+
/** Close the menu */
|
|
32
|
+
close(): void;
|
|
33
|
+
/** Toggle the menu */
|
|
34
|
+
toggle(): void;
|
|
35
|
+
/** Keyboard handlers for the menu */
|
|
36
|
+
keyboardHandlers: KeyboardHandlerMap;
|
|
37
|
+
/** Generated IDs for aria linking */
|
|
38
|
+
ids: {
|
|
39
|
+
content: string;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
declare function createDropdownMenu(props?: DropdownMenuProps): DropdownMenuAPI;
|
|
43
|
+
|
|
44
|
+
declare const menuContentVariants: (props?: ({
|
|
45
|
+
[x: string]: string | undefined;
|
|
46
|
+
} & {
|
|
47
|
+
className?: string;
|
|
48
|
+
}) | undefined) => string;
|
|
49
|
+
declare const menuItemVariants: (props?: ({
|
|
50
|
+
[x: string]: string | undefined;
|
|
51
|
+
} & {
|
|
52
|
+
className?: string;
|
|
53
|
+
}) | undefined) => string;
|
|
54
|
+
|
|
55
|
+
export { type DropdownMenuAPI, type DropdownMenuProps, type DropdownMenuState, type MenuItemProps, createDropdownMenu, menuContentVariants, menuItemVariants };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { AccessibilityProps, KeyboardHandlerMap } from '../shared/index.js';
|
|
2
|
+
|
|
3
|
+
interface DropdownMenuProps {
|
|
4
|
+
/** Whether the menu is open (controlled) */
|
|
5
|
+
open?: boolean;
|
|
6
|
+
/** Whether the menu starts open (uncontrolled) */
|
|
7
|
+
defaultOpen?: boolean;
|
|
8
|
+
/** Callback when open state changes */
|
|
9
|
+
onOpenChange?: (open: boolean) => void;
|
|
10
|
+
}
|
|
11
|
+
interface MenuItemProps {
|
|
12
|
+
/** Whether the item is disabled */
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
/** Callback when the item is selected */
|
|
15
|
+
onSelect?: () => void;
|
|
16
|
+
}
|
|
17
|
+
interface DropdownMenuState {
|
|
18
|
+
open: boolean;
|
|
19
|
+
}
|
|
20
|
+
interface DropdownMenuAPI {
|
|
21
|
+
/** Current menu state */
|
|
22
|
+
state: DropdownMenuState;
|
|
23
|
+
/** ARIA attributes for the trigger button */
|
|
24
|
+
triggerProps: Partial<AccessibilityProps> & Record<string, unknown>;
|
|
25
|
+
/** ARIA attributes for the menu content */
|
|
26
|
+
contentProps: Partial<AccessibilityProps> & Record<string, unknown>;
|
|
27
|
+
/** Factory for menu item props */
|
|
28
|
+
getItemProps(item: MenuItemProps): Partial<AccessibilityProps> & Record<string, unknown>;
|
|
29
|
+
/** Open the menu */
|
|
30
|
+
open(): void;
|
|
31
|
+
/** Close the menu */
|
|
32
|
+
close(): void;
|
|
33
|
+
/** Toggle the menu */
|
|
34
|
+
toggle(): void;
|
|
35
|
+
/** Keyboard handlers for the menu */
|
|
36
|
+
keyboardHandlers: KeyboardHandlerMap;
|
|
37
|
+
/** Generated IDs for aria linking */
|
|
38
|
+
ids: {
|
|
39
|
+
content: string;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
declare function createDropdownMenu(props?: DropdownMenuProps): DropdownMenuAPI;
|
|
43
|
+
|
|
44
|
+
declare const menuContentVariants: (props?: ({
|
|
45
|
+
[x: string]: string | undefined;
|
|
46
|
+
} & {
|
|
47
|
+
className?: string;
|
|
48
|
+
}) | undefined) => string;
|
|
49
|
+
declare const menuItemVariants: (props?: ({
|
|
50
|
+
[x: string]: string | undefined;
|
|
51
|
+
} & {
|
|
52
|
+
className?: string;
|
|
53
|
+
}) | undefined) => string;
|
|
54
|
+
|
|
55
|
+
export { type DropdownMenuAPI, type DropdownMenuProps, type DropdownMenuState, type MenuItemProps, createDropdownMenu, menuContentVariants, menuItemVariants };
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { AccessibilityProps } from '../shared/index.cjs';
|
|
2
|
+
|
|
3
|
+
type EmojiCategory = 'smileys' | 'people' | 'nature' | 'food' | 'travel' | 'activities' | 'objects' | 'symbols' | 'flags';
|
|
4
|
+
interface EmojiEntry {
|
|
5
|
+
emoji: string;
|
|
6
|
+
name: string;
|
|
7
|
+
category: EmojiCategory;
|
|
8
|
+
keywords: string[];
|
|
9
|
+
}
|
|
10
|
+
declare const EMOJI_DATA: Record<EmojiCategory, EmojiEntry[]>;
|
|
11
|
+
/** All categories in display order */
|
|
12
|
+
declare const EMOJI_CATEGORIES: EmojiCategory[];
|
|
13
|
+
/** Category display labels */
|
|
14
|
+
declare const CATEGORY_LABELS: Record<EmojiCategory, string>;
|
|
15
|
+
/** Get all emojis as a flat array */
|
|
16
|
+
declare function getAllEmojis(): EmojiEntry[];
|
|
17
|
+
|
|
18
|
+
interface EmojiPickerProps {
|
|
19
|
+
/** Callback when an emoji is selected */
|
|
20
|
+
onSelect?: (emoji: EmojiEntry) => void;
|
|
21
|
+
/** Initial search query */
|
|
22
|
+
search?: string;
|
|
23
|
+
/** List of recently used emojis */
|
|
24
|
+
recentEmojis?: EmojiEntry[];
|
|
25
|
+
/** Maximum recent emojis to show */
|
|
26
|
+
maxRecent?: number;
|
|
27
|
+
}
|
|
28
|
+
interface EmojiPickerState {
|
|
29
|
+
search: string;
|
|
30
|
+
activeCategory: EmojiCategory;
|
|
31
|
+
filteredEmojis: EmojiEntry[];
|
|
32
|
+
recentEmojis: EmojiEntry[];
|
|
33
|
+
}
|
|
34
|
+
interface EmojiPickerAPI {
|
|
35
|
+
/** Current state */
|
|
36
|
+
state: EmojiPickerState;
|
|
37
|
+
/** Set search query */
|
|
38
|
+
setSearch(query: string): void;
|
|
39
|
+
/** Select an emoji */
|
|
40
|
+
select(emoji: EmojiEntry): void;
|
|
41
|
+
/** Set active category tab */
|
|
42
|
+
setCategory(category: EmojiCategory): void;
|
|
43
|
+
/** Category tabs with labels */
|
|
44
|
+
categoryTabs: {
|
|
45
|
+
category: EmojiCategory;
|
|
46
|
+
label: string;
|
|
47
|
+
emoji: string;
|
|
48
|
+
}[];
|
|
49
|
+
/** ARIA props for the picker container */
|
|
50
|
+
ariaProps: Partial<AccessibilityProps> & Record<string, unknown>;
|
|
51
|
+
/** ARIA props for the search input */
|
|
52
|
+
searchInputProps: Record<string, unknown>;
|
|
53
|
+
/** Get ARIA props for an emoji button */
|
|
54
|
+
getEmojiAriaProps(emoji: EmojiEntry): Record<string, unknown>;
|
|
55
|
+
/** Generated IDs */
|
|
56
|
+
ids: {
|
|
57
|
+
container: string;
|
|
58
|
+
search: string;
|
|
59
|
+
grid: string;
|
|
60
|
+
label: string;
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
declare function createEmojiPicker(props?: EmojiPickerProps): EmojiPickerAPI;
|
|
64
|
+
|
|
65
|
+
declare const emojiPickerContainerStyles = "w-80 rounded-lg border bg-popover text-popover-foreground shadow-md";
|
|
66
|
+
declare const emojiPickerSearchStyles = "w-full border-b px-3 py-2 text-sm bg-transparent outline-none placeholder:text-muted-foreground";
|
|
67
|
+
declare const emojiPickerCategoryBarStyles = "flex border-b px-1";
|
|
68
|
+
declare const emojiPickerCategoryTabVariants: (props?: ({
|
|
69
|
+
state?: "active" | "inactive" | undefined;
|
|
70
|
+
} & {
|
|
71
|
+
className?: string;
|
|
72
|
+
}) | undefined) => string;
|
|
73
|
+
declare const emojiPickerGridStyles = "grid grid-cols-8 gap-0.5 p-2 max-h-64 overflow-y-auto";
|
|
74
|
+
declare const emojiPickerEmojiButtonStyles = "flex items-center justify-center h-8 w-8 rounded cursor-pointer text-lg hover:bg-accent transition-colors";
|
|
75
|
+
declare const emojiPickerSectionLabelStyles = "px-2 py-1 text-xs font-medium text-muted-foreground";
|
|
76
|
+
|
|
77
|
+
export { CATEGORY_LABELS, EMOJI_CATEGORIES, EMOJI_DATA, type EmojiCategory, type EmojiEntry, type EmojiPickerAPI, type EmojiPickerProps, type EmojiPickerState, createEmojiPicker, emojiPickerCategoryBarStyles, emojiPickerCategoryTabVariants, emojiPickerContainerStyles, emojiPickerEmojiButtonStyles, emojiPickerGridStyles, emojiPickerSearchStyles, emojiPickerSectionLabelStyles, getAllEmojis };
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { AccessibilityProps } from '../shared/index.js';
|
|
2
|
+
|
|
3
|
+
type EmojiCategory = 'smileys' | 'people' | 'nature' | 'food' | 'travel' | 'activities' | 'objects' | 'symbols' | 'flags';
|
|
4
|
+
interface EmojiEntry {
|
|
5
|
+
emoji: string;
|
|
6
|
+
name: string;
|
|
7
|
+
category: EmojiCategory;
|
|
8
|
+
keywords: string[];
|
|
9
|
+
}
|
|
10
|
+
declare const EMOJI_DATA: Record<EmojiCategory, EmojiEntry[]>;
|
|
11
|
+
/** All categories in display order */
|
|
12
|
+
declare const EMOJI_CATEGORIES: EmojiCategory[];
|
|
13
|
+
/** Category display labels */
|
|
14
|
+
declare const CATEGORY_LABELS: Record<EmojiCategory, string>;
|
|
15
|
+
/** Get all emojis as a flat array */
|
|
16
|
+
declare function getAllEmojis(): EmojiEntry[];
|
|
17
|
+
|
|
18
|
+
interface EmojiPickerProps {
|
|
19
|
+
/** Callback when an emoji is selected */
|
|
20
|
+
onSelect?: (emoji: EmojiEntry) => void;
|
|
21
|
+
/** Initial search query */
|
|
22
|
+
search?: string;
|
|
23
|
+
/** List of recently used emojis */
|
|
24
|
+
recentEmojis?: EmojiEntry[];
|
|
25
|
+
/** Maximum recent emojis to show */
|
|
26
|
+
maxRecent?: number;
|
|
27
|
+
}
|
|
28
|
+
interface EmojiPickerState {
|
|
29
|
+
search: string;
|
|
30
|
+
activeCategory: EmojiCategory;
|
|
31
|
+
filteredEmojis: EmojiEntry[];
|
|
32
|
+
recentEmojis: EmojiEntry[];
|
|
33
|
+
}
|
|
34
|
+
interface EmojiPickerAPI {
|
|
35
|
+
/** Current state */
|
|
36
|
+
state: EmojiPickerState;
|
|
37
|
+
/** Set search query */
|
|
38
|
+
setSearch(query: string): void;
|
|
39
|
+
/** Select an emoji */
|
|
40
|
+
select(emoji: EmojiEntry): void;
|
|
41
|
+
/** Set active category tab */
|
|
42
|
+
setCategory(category: EmojiCategory): void;
|
|
43
|
+
/** Category tabs with labels */
|
|
44
|
+
categoryTabs: {
|
|
45
|
+
category: EmojiCategory;
|
|
46
|
+
label: string;
|
|
47
|
+
emoji: string;
|
|
48
|
+
}[];
|
|
49
|
+
/** ARIA props for the picker container */
|
|
50
|
+
ariaProps: Partial<AccessibilityProps> & Record<string, unknown>;
|
|
51
|
+
/** ARIA props for the search input */
|
|
52
|
+
searchInputProps: Record<string, unknown>;
|
|
53
|
+
/** Get ARIA props for an emoji button */
|
|
54
|
+
getEmojiAriaProps(emoji: EmojiEntry): Record<string, unknown>;
|
|
55
|
+
/** Generated IDs */
|
|
56
|
+
ids: {
|
|
57
|
+
container: string;
|
|
58
|
+
search: string;
|
|
59
|
+
grid: string;
|
|
60
|
+
label: string;
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
declare function createEmojiPicker(props?: EmojiPickerProps): EmojiPickerAPI;
|
|
64
|
+
|
|
65
|
+
declare const emojiPickerContainerStyles = "w-80 rounded-lg border bg-popover text-popover-foreground shadow-md";
|
|
66
|
+
declare const emojiPickerSearchStyles = "w-full border-b px-3 py-2 text-sm bg-transparent outline-none placeholder:text-muted-foreground";
|
|
67
|
+
declare const emojiPickerCategoryBarStyles = "flex border-b px-1";
|
|
68
|
+
declare const emojiPickerCategoryTabVariants: (props?: ({
|
|
69
|
+
state?: "active" | "inactive" | undefined;
|
|
70
|
+
} & {
|
|
71
|
+
className?: string;
|
|
72
|
+
}) | undefined) => string;
|
|
73
|
+
declare const emojiPickerGridStyles = "grid grid-cols-8 gap-0.5 p-2 max-h-64 overflow-y-auto";
|
|
74
|
+
declare const emojiPickerEmojiButtonStyles = "flex items-center justify-center h-8 w-8 rounded cursor-pointer text-lg hover:bg-accent transition-colors";
|
|
75
|
+
declare const emojiPickerSectionLabelStyles = "px-2 py-1 text-xs font-medium text-muted-foreground";
|
|
76
|
+
|
|
77
|
+
export { CATEGORY_LABELS, EMOJI_CATEGORIES, EMOJI_DATA, type EmojiCategory, type EmojiEntry, type EmojiPickerAPI, type EmojiPickerProps, type EmojiPickerState, createEmojiPicker, emojiPickerCategoryBarStyles, emojiPickerCategoryTabVariants, emojiPickerContainerStyles, emojiPickerEmojiButtonStyles, emojiPickerGridStyles, emojiPickerSearchStyles, emojiPickerSectionLabelStyles, getAllEmojis };
|