@nice2dev/ui-mobile 1.0.10
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 +41 -0
- package/dist/index.cjs +26 -0
- package/dist/index.d.ts +3430 -0
- package/dist/index.mjs +7835 -0
- package/dist/style.css +1 -0
- package/package.json +66 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,3430 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes } from 'react';
|
|
2
|
+
import { CSSProperties } from 'react';
|
|
3
|
+
import { default as default_2 } from 'react';
|
|
4
|
+
import { HTMLAttributes } from 'react';
|
|
5
|
+
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
6
|
+
import { PointerEvent as PointerEvent_2 } from 'react';
|
|
7
|
+
import { ReactNode } from 'react';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Action sheet preset – list of actions
|
|
11
|
+
*/
|
|
12
|
+
export declare interface ActionSheetAction {
|
|
13
|
+
id: string;
|
|
14
|
+
label: string;
|
|
15
|
+
icon?: ReactNode;
|
|
16
|
+
destructive?: boolean;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
onClick?: () => void;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Badge variant
|
|
23
|
+
*/
|
|
24
|
+
export declare type BadgeVariant = 'dot' | 'count' | 'text';
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Breakpoint definition
|
|
28
|
+
*/
|
|
29
|
+
export declare interface Breakpoint {
|
|
30
|
+
name: BreakpointName;
|
|
31
|
+
minWidth: number;
|
|
32
|
+
maxWidth: number | null;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Context value
|
|
37
|
+
*/
|
|
38
|
+
export declare type BreakpointContextValue = UseBreakpointReturn;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Breakpoint name
|
|
42
|
+
*/
|
|
43
|
+
export declare type BreakpointName = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Breakpoint values configuration
|
|
47
|
+
*/
|
|
48
|
+
export declare interface BreakpointValues {
|
|
49
|
+
xs: number;
|
|
50
|
+
sm: number;
|
|
51
|
+
md: number;
|
|
52
|
+
lg: number;
|
|
53
|
+
xl: number;
|
|
54
|
+
'2xl': number;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Calendar event
|
|
59
|
+
*/
|
|
60
|
+
export declare interface CalendarEvent {
|
|
61
|
+
id: string;
|
|
62
|
+
title: string;
|
|
63
|
+
date: Date;
|
|
64
|
+
color?: string;
|
|
65
|
+
allDay?: boolean;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Calendar view mode
|
|
70
|
+
*/
|
|
71
|
+
export declare type CalendarView = 'day' | 'month' | 'year';
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Cancel any ongoing vibration
|
|
75
|
+
*/
|
|
76
|
+
export declare function cancelVibration(): void;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Header collapse behavior
|
|
80
|
+
*/
|
|
81
|
+
export declare type CollapseMode = 'scroll' | 'pin' | 'enterAlways' | 'exitUntilCollapsed';
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Color format
|
|
85
|
+
*/
|
|
86
|
+
export declare type ColorFormat = 'hex' | 'rgb' | 'hsl';
|
|
87
|
+
|
|
88
|
+
export declare const colorUtils: {
|
|
89
|
+
hslToRgb: typeof hslToRgb;
|
|
90
|
+
rgbToHsl: typeof rgbToHsl;
|
|
91
|
+
hexToRgb: typeof hexToRgb;
|
|
92
|
+
rgbToHex: typeof rgbToHex;
|
|
93
|
+
hexToHsl: typeof hexToHsl;
|
|
94
|
+
hslToHex: typeof hslToHex;
|
|
95
|
+
formatColor: typeof formatColor;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Create a pattern builder
|
|
100
|
+
*/
|
|
101
|
+
export declare function createHapticPattern(): HapticPatternBuilder;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Generate CSS media query string
|
|
105
|
+
*/
|
|
106
|
+
export declare function createMediaQuery(breakpoint: BreakpointName, type?: 'min' | 'max' | 'only', breakpoints?: BreakpointValues): string;
|
|
107
|
+
|
|
108
|
+
export declare interface CustomLayout {
|
|
109
|
+
rows: KeyboardRow[];
|
|
110
|
+
name?: string;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Date range
|
|
115
|
+
*/
|
|
116
|
+
export declare interface DateRange {
|
|
117
|
+
start: Date | null;
|
|
118
|
+
end: Date | null;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Day cell data
|
|
123
|
+
*/
|
|
124
|
+
export declare interface DayCell {
|
|
125
|
+
date: Date;
|
|
126
|
+
dayOfMonth: number;
|
|
127
|
+
isCurrentMonth: boolean;
|
|
128
|
+
isToday: boolean;
|
|
129
|
+
isSelected: boolean;
|
|
130
|
+
isInRange: boolean;
|
|
131
|
+
isRangeStart: boolean;
|
|
132
|
+
isRangeEnd: boolean;
|
|
133
|
+
isDisabled: boolean;
|
|
134
|
+
isWeekend: boolean;
|
|
135
|
+
events?: CalendarEvent[];
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Default breakpoint values (Tailwind-like)
|
|
140
|
+
*/
|
|
141
|
+
export declare const DEFAULT_BREAKPOINTS: BreakpointValues;
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Device type based on screen size
|
|
145
|
+
*/
|
|
146
|
+
export declare type DeviceType = 'mobile' | 'tablet' | 'desktop';
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Modal dismiss trigger
|
|
150
|
+
*/
|
|
151
|
+
export declare type DismissTrigger = 'drag' | 'overlay' | 'close' | 'escape';
|
|
152
|
+
|
|
153
|
+
/** Lottie-style animated dots indicator */
|
|
154
|
+
export declare const DotsIndicator: default_2.FC<PullToRefreshIndicatorProps>;
|
|
155
|
+
|
|
156
|
+
export declare const DrawerIcons: {
|
|
157
|
+
home: JSX_2.Element;
|
|
158
|
+
settings: JSX_2.Element;
|
|
159
|
+
user: JSX_2.Element;
|
|
160
|
+
search: JSX_2.Element;
|
|
161
|
+
inbox: JSX_2.Element;
|
|
162
|
+
heart: JSX_2.Element;
|
|
163
|
+
folder: JSX_2.Element;
|
|
164
|
+
help: JSX_2.Element;
|
|
165
|
+
logout: JSX_2.Element;
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
export declare interface DrawerNavItem {
|
|
169
|
+
id: string;
|
|
170
|
+
label: string;
|
|
171
|
+
icon?: ReactNode;
|
|
172
|
+
badge?: string | number;
|
|
173
|
+
badgeColor?: string;
|
|
174
|
+
href?: string;
|
|
175
|
+
onClick?: () => void;
|
|
176
|
+
disabled?: boolean;
|
|
177
|
+
children?: DrawerNavItem[];
|
|
178
|
+
divider?: boolean;
|
|
179
|
+
section?: string;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export declare type DrawerPosition = 'left' | 'right' | 'top' | 'bottom';
|
|
183
|
+
|
|
184
|
+
export declare type DrawerVariant = 'overlay' | 'push' | 'persistent';
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Drawing tool types
|
|
188
|
+
*/
|
|
189
|
+
export declare type DrawingTool = 'pen' | 'brush' | 'marker' | 'eraser' | 'fill' | 'line' | 'rectangle' | 'circle';
|
|
190
|
+
|
|
191
|
+
/** Custom emoji indicator */
|
|
192
|
+
export declare const EmojiIndicator: default_2.FC<PullToRefreshIndicatorProps>;
|
|
193
|
+
|
|
194
|
+
declare function formatColor(hsl: HSLColor, format: ColorFormat): string;
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Generate number items
|
|
198
|
+
*/
|
|
199
|
+
export declare function generateNumberItems(start: number, end: number, step?: number, pad?: number): PickerItem<number>[];
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Gesture handlers
|
|
203
|
+
*/
|
|
204
|
+
export declare interface GestureHandlers {
|
|
205
|
+
onPinchStart?: () => void;
|
|
206
|
+
onPinch?: (event: PinchEvent) => void;
|
|
207
|
+
onPinchEnd?: (event: PinchEvent) => void;
|
|
208
|
+
onRotateStart?: () => void;
|
|
209
|
+
onRotate?: (event: RotateEvent) => void;
|
|
210
|
+
onRotateEnd?: (event: RotateEvent) => void;
|
|
211
|
+
onPanStart?: () => void;
|
|
212
|
+
onPan?: (event: PanEvent) => void;
|
|
213
|
+
onPanEnd?: (event: PanEvent) => void;
|
|
214
|
+
onSwipe?: (event: SwipeEvent) => void;
|
|
215
|
+
onTap?: (event: TapEvent) => void;
|
|
216
|
+
onDoubleTap?: (event: TapEvent) => void;
|
|
217
|
+
onLongPress?: (event: LongPressEvent) => void;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Context value
|
|
222
|
+
*/
|
|
223
|
+
export declare interface GesturesContextValue {
|
|
224
|
+
state: GestureState;
|
|
225
|
+
reset: () => void;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Gesture state
|
|
230
|
+
*/
|
|
231
|
+
export declare interface GestureState {
|
|
232
|
+
/** Current scale (1 = normal) */
|
|
233
|
+
scale: number;
|
|
234
|
+
/** Current rotation in degrees */
|
|
235
|
+
rotation: number;
|
|
236
|
+
/** Current translation */
|
|
237
|
+
translation: Point;
|
|
238
|
+
/** Velocity of pan gesture */
|
|
239
|
+
velocity: Point;
|
|
240
|
+
/** Center point of gesture */
|
|
241
|
+
center: Point;
|
|
242
|
+
/** Whether gesture is active */
|
|
243
|
+
isActive: boolean;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* Get current breakpoint (client-side only)
|
|
248
|
+
*/
|
|
249
|
+
export declare function getCurrentBreakpoint(breakpoints?: BreakpointValues): BreakpointName | null;
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Predefined haptic patterns
|
|
253
|
+
*/
|
|
254
|
+
export declare const HAPTIC_PATTERNS: Record<HapticsHapticFeedbackType, VibrationPattern>;
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* Trigger haptic feedback type
|
|
258
|
+
*/
|
|
259
|
+
export declare function hapticFeedback(type: HapticsHapticFeedbackType): boolean;
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Haptic feedback intensity
|
|
263
|
+
*/
|
|
264
|
+
export declare type HapticIntensity = 'light' | 'medium' | 'heavy';
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* Haptic pattern definition
|
|
268
|
+
*/
|
|
269
|
+
export declare interface HapticPattern {
|
|
270
|
+
/** Pattern name */
|
|
271
|
+
name: string;
|
|
272
|
+
/** Vibration durations in ms */
|
|
273
|
+
pattern: number[];
|
|
274
|
+
/** Description */
|
|
275
|
+
description?: string;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* Build custom vibration pattern
|
|
280
|
+
*/
|
|
281
|
+
export declare class HapticPatternBuilder {
|
|
282
|
+
private pattern;
|
|
283
|
+
/**
|
|
284
|
+
* Add vibration pulse
|
|
285
|
+
*/
|
|
286
|
+
vibrate(duration: number): this;
|
|
287
|
+
/**
|
|
288
|
+
* Add pause
|
|
289
|
+
*/
|
|
290
|
+
pause(duration: number): this;
|
|
291
|
+
/**
|
|
292
|
+
* Add multiple pulses
|
|
293
|
+
*/
|
|
294
|
+
pulses(count: number, vibrateMs: number, pauseMs: number): this;
|
|
295
|
+
/**
|
|
296
|
+
* Add ramp up effect
|
|
297
|
+
*/
|
|
298
|
+
rampUp(steps: number, maxDuration: number): this;
|
|
299
|
+
/**
|
|
300
|
+
* Add ramp down effect
|
|
301
|
+
*/
|
|
302
|
+
rampDown(steps: number, maxDuration: number): this;
|
|
303
|
+
/**
|
|
304
|
+
* Build and return pattern
|
|
305
|
+
*/
|
|
306
|
+
build(): number[];
|
|
307
|
+
/**
|
|
308
|
+
* Execute pattern immediately
|
|
309
|
+
*/
|
|
310
|
+
execute(): boolean;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* Context value
|
|
315
|
+
*/
|
|
316
|
+
export declare type HapticsContextValue = UseHapticsReturn;
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* Predefined haptic feedback type
|
|
320
|
+
*/
|
|
321
|
+
export declare type HapticsHapticFeedbackType = 'selection' | 'impact-light' | 'impact-medium' | 'impact-heavy' | 'notification-success' | 'notification-warning' | 'notification-error' | 'button-press' | 'toggle-on' | 'toggle-off' | 'swipe' | 'pull-to-refresh' | 'keyboard';
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* Action button config
|
|
325
|
+
*/
|
|
326
|
+
export declare interface HeaderAction {
|
|
327
|
+
id: string;
|
|
328
|
+
icon: ReactNode;
|
|
329
|
+
label: string;
|
|
330
|
+
onClick?: () => void;
|
|
331
|
+
badge?: number | boolean;
|
|
332
|
+
disabled?: boolean;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* Preset header icons
|
|
337
|
+
*/
|
|
338
|
+
export declare const HeaderIcons: {
|
|
339
|
+
back: JSX_2.Element;
|
|
340
|
+
menu: JSX_2.Element;
|
|
341
|
+
search: JSX_2.Element;
|
|
342
|
+
more: JSX_2.Element;
|
|
343
|
+
};
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* Header variant
|
|
347
|
+
*/
|
|
348
|
+
export declare type HeaderVariant = 'default' | 'transparent' | 'blur' | 'solid';
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* Hero header with background image
|
|
352
|
+
*/
|
|
353
|
+
export declare const HeroHeader: default_2.ForwardRefExoticComponent<Omit<NiceMobileHeaderProps, "mode" | "parallax"> & default_2.RefAttributes<HTMLElement>>;
|
|
354
|
+
|
|
355
|
+
declare function hexToHsl(hex: string): HSLColor;
|
|
356
|
+
|
|
357
|
+
declare function hexToRgb(hex: string): RGBColor;
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* HSL color
|
|
361
|
+
*/
|
|
362
|
+
declare interface HSLColor {
|
|
363
|
+
h: number;
|
|
364
|
+
s: number;
|
|
365
|
+
l: number;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
declare function hslToHex(h: number, s: number, l: number): string;
|
|
369
|
+
|
|
370
|
+
declare function hslToRgb(h: number, s: number, l: number): RGBColor;
|
|
371
|
+
|
|
372
|
+
export declare interface ImageGalleryItem {
|
|
373
|
+
/** Full image URL */
|
|
374
|
+
src: string;
|
|
375
|
+
/** Thumbnail URL (optional, defaults to src) */
|
|
376
|
+
thumbnail?: string;
|
|
377
|
+
/** Alt text for accessibility */
|
|
378
|
+
alt?: string;
|
|
379
|
+
/** Image title/caption */
|
|
380
|
+
title?: string;
|
|
381
|
+
/** Optional description */
|
|
382
|
+
description?: string;
|
|
383
|
+
/** Loading placeholder (blur hash or color) */
|
|
384
|
+
placeholder?: string;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
declare interface InfiniteScrollContextValue {
|
|
388
|
+
status: InfiniteScrollStatus;
|
|
389
|
+
loadMore: () => Promise<void>;
|
|
390
|
+
hasMore: boolean;
|
|
391
|
+
itemCount: number;
|
|
392
|
+
scrollToTop: () => void;
|
|
393
|
+
scrollToBottom: () => void;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
export declare interface InfiniteScrollPage<T = unknown> {
|
|
397
|
+
items: T[];
|
|
398
|
+
nextCursor?: string | number;
|
|
399
|
+
hasMore: boolean;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
export declare type InfiniteScrollStatus = 'idle' | 'loading' | 'success' | 'error' | 'end';
|
|
403
|
+
|
|
404
|
+
/**
|
|
405
|
+
* iOS-style navigation bar with large title
|
|
406
|
+
*/
|
|
407
|
+
export declare const IOSHeader: default_2.ForwardRefExoticComponent<Omit<NiceMobileHeaderProps, "variant" | "mode"> & default_2.RefAttributes<HTMLElement>>;
|
|
408
|
+
|
|
409
|
+
/** iOS-style activity indicator */
|
|
410
|
+
export declare const IOSIndicator: default_2.FC<PullToRefreshIndicatorProps>;
|
|
411
|
+
|
|
412
|
+
/**
|
|
413
|
+
* Check if running on mobile device
|
|
414
|
+
*/
|
|
415
|
+
export declare function isMobileDevice(): boolean;
|
|
416
|
+
|
|
417
|
+
/**
|
|
418
|
+
* Check if running on touch device
|
|
419
|
+
*/
|
|
420
|
+
export declare function isTouch(): boolean;
|
|
421
|
+
|
|
422
|
+
/**
|
|
423
|
+
* Check if Vibration API is supported
|
|
424
|
+
*/
|
|
425
|
+
export declare function isVibrationSupported(): boolean;
|
|
426
|
+
|
|
427
|
+
/** Supported language codes */
|
|
428
|
+
export declare type KeyboardLanguage = 'en' | 'pl' | 'de' | 'fr' | 'es' | 'it' | 'pt' | 'ru' | 'uk' | 'cs' | 'tr' | 'nl' | 'sv' | 'no' | 'da' | 'fi' | 'ro' | 'hr' | 'el' | 'hu' | 'sk' | 'bg' | 'sr' | 'ja' | 'ko' | 'zh' | 'ar' | 'he';
|
|
429
|
+
|
|
430
|
+
export declare type KeyboardLayout = 'qwerty' | 'numeric' | 'numpad' | 'phone' | 'pin' | 'custom';
|
|
431
|
+
|
|
432
|
+
/** Display mode — from minimal (numbers-only) to full (QWERTY + number row + symbols + fn row) */
|
|
433
|
+
export declare type KeyboardMode = 'minimal' | 'compact' | 'standard' | 'full';
|
|
434
|
+
|
|
435
|
+
declare type KeyboardRow = KeyDefinition[];
|
|
436
|
+
|
|
437
|
+
export declare type KeyboardTheme = 'light' | 'dark' | 'system';
|
|
438
|
+
|
|
439
|
+
export declare interface KeyDefinition {
|
|
440
|
+
value: string;
|
|
441
|
+
label?: string;
|
|
442
|
+
width?: number;
|
|
443
|
+
type?: 'char' | 'space' | 'backspace' | 'enter' | 'shift' | 'special' | 'fn' | 'tab' | 'caps' | 'lang';
|
|
444
|
+
icon?: default_2.ReactNode;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
/**
|
|
448
|
+
* Thumb label display mode
|
|
449
|
+
*/
|
|
450
|
+
declare type LabelDisplay = 'auto' | 'on' | 'off';
|
|
451
|
+
|
|
452
|
+
/** Language layout definition */
|
|
453
|
+
export declare interface LanguageLayout {
|
|
454
|
+
code: KeyboardLanguage;
|
|
455
|
+
name: string;
|
|
456
|
+
nativeName: string;
|
|
457
|
+
/** Main letter rows (3 rows for QWERTY-like) */
|
|
458
|
+
rows: [string[], string[], string[]];
|
|
459
|
+
/** Extra chars available via long-press or special layer */
|
|
460
|
+
accents?: Record<string, string[]>;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
/**
|
|
464
|
+
* Line cap style
|
|
465
|
+
*/
|
|
466
|
+
export declare type LineCap = 'round' | 'square' | 'butt';
|
|
467
|
+
|
|
468
|
+
/** Minimal line indicator */
|
|
469
|
+
export declare const LineIndicator: default_2.FC<PullToRefreshIndicatorProps>;
|
|
470
|
+
|
|
471
|
+
/**
|
|
472
|
+
* Long press event
|
|
473
|
+
*/
|
|
474
|
+
export declare interface LongPressEvent {
|
|
475
|
+
position: Point;
|
|
476
|
+
duration: number;
|
|
477
|
+
target: EventTarget | null;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
/**
|
|
481
|
+
* Material Design app bar
|
|
482
|
+
*/
|
|
483
|
+
export declare const MaterialHeader: default_2.ForwardRefExoticComponent<Omit<NiceMobileHeaderProps, "variant" | "mode"> & default_2.RefAttributes<HTMLElement>>;
|
|
484
|
+
|
|
485
|
+
/** Material Design circular progress */
|
|
486
|
+
export declare const MaterialIndicator: default_2.FC<PullToRefreshIndicatorProps>;
|
|
487
|
+
|
|
488
|
+
/**
|
|
489
|
+
* Menu position
|
|
490
|
+
*/
|
|
491
|
+
export declare interface MenuPosition {
|
|
492
|
+
x: number;
|
|
493
|
+
y: number;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
/**
|
|
497
|
+
* Context value
|
|
498
|
+
*/
|
|
499
|
+
export declare interface MobileCalendarContextValue {
|
|
500
|
+
viewDate: Date;
|
|
501
|
+
selectedDate: Date | null;
|
|
502
|
+
selectedDates: Date[];
|
|
503
|
+
selectedRange: DateRange;
|
|
504
|
+
selectionMode: SelectionMode_2;
|
|
505
|
+
view: CalendarView;
|
|
506
|
+
selectDate: (date: Date) => void;
|
|
507
|
+
setView: (view: CalendarView) => void;
|
|
508
|
+
goToDate: (date: Date) => void;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
export declare interface MobileDrawerContextValue {
|
|
512
|
+
isOpen: boolean;
|
|
513
|
+
position: DrawerPosition;
|
|
514
|
+
close: () => void;
|
|
515
|
+
activeNavId?: string;
|
|
516
|
+
setActiveNavId: (id: string) => void;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
/**
|
|
520
|
+
* Context value
|
|
521
|
+
*/
|
|
522
|
+
export declare interface MobileHeaderContextValue {
|
|
523
|
+
progress: number;
|
|
524
|
+
isCollapsed: boolean;
|
|
525
|
+
height: number;
|
|
526
|
+
expandedHeight: number;
|
|
527
|
+
collapsedHeight: number;
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
/**
|
|
531
|
+
* Modal context value
|
|
532
|
+
*/
|
|
533
|
+
export declare interface MobileModalContextValue {
|
|
534
|
+
isOpen: boolean;
|
|
535
|
+
snapPoints: ModalSnapPoint[];
|
|
536
|
+
currentSnapIndex: number;
|
|
537
|
+
setSnapIndex: (index: number) => void;
|
|
538
|
+
close: (trigger?: DismissTrigger) => void;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
/**
|
|
542
|
+
* Context value
|
|
543
|
+
*/
|
|
544
|
+
export declare interface MobilePickerContextValue {
|
|
545
|
+
visibleItems: number;
|
|
546
|
+
itemHeight: number;
|
|
547
|
+
isScrolling: boolean;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
/**
|
|
551
|
+
* Tab context value
|
|
552
|
+
*/
|
|
553
|
+
export declare interface MobileTabsContextValue {
|
|
554
|
+
activeTab: string;
|
|
555
|
+
setActiveTab: (id: string) => void;
|
|
556
|
+
tabs: TabItem[];
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
/**
|
|
560
|
+
* Modal snap point – where the modal can "land"
|
|
561
|
+
*/
|
|
562
|
+
export declare type ModalSnapPoint = number | 'content' | 'full';
|
|
563
|
+
|
|
564
|
+
export declare const NiceBottomSheet: default_2.ForwardRefExoticComponent<NiceBottomSheetProps & default_2.RefAttributes<NiceBottomSheetRef>>;
|
|
565
|
+
|
|
566
|
+
export declare interface NiceBottomSheetProps {
|
|
567
|
+
/** Sheet content */
|
|
568
|
+
children: ReactNode;
|
|
569
|
+
/** Whether the sheet is open */
|
|
570
|
+
open: boolean;
|
|
571
|
+
/** Called when the sheet should close */
|
|
572
|
+
onClose: () => void;
|
|
573
|
+
/** Called when snap point changes */
|
|
574
|
+
onSnapChange?: (snapIndex: number, snapValue: number) => void;
|
|
575
|
+
/** Snap points as percentages (0-100) or 'content'/'full' */
|
|
576
|
+
snapPoints?: SnapPoint[];
|
|
577
|
+
/** Initial snap point index (default: 0) */
|
|
578
|
+
initialSnap?: number;
|
|
579
|
+
/** Header content (fixed at top) */
|
|
580
|
+
header?: ReactNode;
|
|
581
|
+
/** Footer content (fixed at bottom) */
|
|
582
|
+
footer?: ReactNode;
|
|
583
|
+
/** Show drag handle indicator */
|
|
584
|
+
showHandle?: boolean;
|
|
585
|
+
/** Show backdrop overlay */
|
|
586
|
+
showBackdrop?: boolean;
|
|
587
|
+
/** Close on backdrop click */
|
|
588
|
+
closeOnBackdrop?: boolean;
|
|
589
|
+
/** Close on escape key */
|
|
590
|
+
closeOnEscape?: boolean;
|
|
591
|
+
/** Allow dismiss by dragging down past lowest snap */
|
|
592
|
+
dismissible?: boolean;
|
|
593
|
+
/** Velocity threshold to trigger snap (px/ms, default: 0.5) */
|
|
594
|
+
velocityThreshold?: number;
|
|
595
|
+
/** Enable haptic feedback */
|
|
596
|
+
hapticFeedback?: boolean;
|
|
597
|
+
/** Custom handle color */
|
|
598
|
+
handleColor?: string;
|
|
599
|
+
/** Border radius for top corners */
|
|
600
|
+
borderRadius?: number;
|
|
601
|
+
/** Z-index for the sheet */
|
|
602
|
+
zIndex?: number;
|
|
603
|
+
/** Custom class name */
|
|
604
|
+
className?: string;
|
|
605
|
+
/** Custom styles */
|
|
606
|
+
style?: CSSProperties;
|
|
607
|
+
/** Accessibility label */
|
|
608
|
+
ariaLabel?: string;
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
export declare interface NiceBottomSheetRef {
|
|
612
|
+
/** Snap to a specific point */
|
|
613
|
+
snapTo: (index: number) => void;
|
|
614
|
+
/** Close the sheet */
|
|
615
|
+
close: () => void;
|
|
616
|
+
/** Get current snap index */
|
|
617
|
+
getCurrentSnap: () => number;
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
/**
|
|
621
|
+
* Breakpoint provider for app-wide responsive access
|
|
622
|
+
*
|
|
623
|
+
* @example
|
|
624
|
+
* ```tsx
|
|
625
|
+
* <NiceBreakpointProvider breakpoints={{ md: 800, lg: 1100 }}>
|
|
626
|
+
* <App />
|
|
627
|
+
* </NiceBreakpointProvider>
|
|
628
|
+
* ```
|
|
629
|
+
*/
|
|
630
|
+
export declare function NiceBreakpointProvider({ breakpoints, debounceDelay, children, }: NiceBreakpointProviderProps): JSX.Element;
|
|
631
|
+
|
|
632
|
+
/**
|
|
633
|
+
* Provider props
|
|
634
|
+
*/
|
|
635
|
+
export declare interface NiceBreakpointProviderProps {
|
|
636
|
+
/** Custom breakpoint values */
|
|
637
|
+
breakpoints?: Partial<BreakpointValues>;
|
|
638
|
+
/** Debounce delay */
|
|
639
|
+
debounceDelay?: number;
|
|
640
|
+
/** Children */
|
|
641
|
+
children: ReactNode;
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
export declare const NiceCalculatorKeyboard: default_2.ForwardRefExoticComponent<Omit<NiceTouchKeyboardProps, "layout"> & default_2.RefAttributes<HTMLDivElement>>;
|
|
645
|
+
|
|
646
|
+
export declare const NiceConfirmSheet: default_2.ForwardRefExoticComponent<NiceConfirmSheetProps & default_2.RefAttributes<HTMLDivElement>>;
|
|
647
|
+
|
|
648
|
+
/**
|
|
649
|
+
* Confirmation sheet preset
|
|
650
|
+
*/
|
|
651
|
+
export declare interface NiceConfirmSheetProps extends Omit<NiceMobileModalProps, 'children' | 'footer'> {
|
|
652
|
+
message: ReactNode;
|
|
653
|
+
confirmLabel?: string;
|
|
654
|
+
cancelLabel?: string;
|
|
655
|
+
confirmDestructive?: boolean;
|
|
656
|
+
onConfirm?: () => void;
|
|
657
|
+
onCancel?: () => void;
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
/**
|
|
661
|
+
* Date range picker preset
|
|
662
|
+
*/
|
|
663
|
+
export declare const NiceDateRangePicker: default_2.ForwardRefExoticComponent<Omit<NiceMobileCalendarProps, "selectionMode"> & default_2.RefAttributes<HTMLDivElement>>;
|
|
664
|
+
|
|
665
|
+
/**
|
|
666
|
+
* Toolbar for drawing canvas
|
|
667
|
+
*/
|
|
668
|
+
export declare const NiceDrawingToolbar: default_2.ForwardRefExoticComponent<NiceDrawingToolbarProps & default_2.RefAttributes<HTMLDivElement>>;
|
|
669
|
+
|
|
670
|
+
/**
|
|
671
|
+
* Drawing toolbar props
|
|
672
|
+
*/
|
|
673
|
+
export declare interface NiceDrawingToolbarProps extends HTMLAttributes<HTMLDivElement> {
|
|
674
|
+
/** Current tool */
|
|
675
|
+
tool: DrawingTool;
|
|
676
|
+
/** Tool change handler */
|
|
677
|
+
onToolChange: (tool: DrawingTool) => void;
|
|
678
|
+
/** Current color */
|
|
679
|
+
color: string;
|
|
680
|
+
/** Color change handler */
|
|
681
|
+
onColorChange: (color: string) => void;
|
|
682
|
+
/** Current stroke width */
|
|
683
|
+
strokeWidth: number;
|
|
684
|
+
/** Stroke width change handler */
|
|
685
|
+
onStrokeWidthChange: (width: number) => void;
|
|
686
|
+
/** Undo handler */
|
|
687
|
+
onUndo?: () => void;
|
|
688
|
+
/** Redo handler */
|
|
689
|
+
onRedo?: () => void;
|
|
690
|
+
/** Clear handler */
|
|
691
|
+
onClear?: () => void;
|
|
692
|
+
/** Can undo */
|
|
693
|
+
canUndo?: boolean;
|
|
694
|
+
/** Can redo */
|
|
695
|
+
canRedo?: boolean;
|
|
696
|
+
/** Preset colors */
|
|
697
|
+
colors?: string[];
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
/**
|
|
701
|
+
* Floating action button (FAB)
|
|
702
|
+
*/
|
|
703
|
+
export declare const NiceFAB: default_2.ForwardRefExoticComponent<Omit<NiceTouchButtonProps, "size" | "shape"> & {
|
|
704
|
+
position?: "bottom-right" | "bottom-left" | "bottom-center" | "top-right" | "top-left";
|
|
705
|
+
mini?: boolean;
|
|
706
|
+
} & default_2.RefAttributes<HTMLButtonElement>>;
|
|
707
|
+
|
|
708
|
+
/**
|
|
709
|
+
* Multi-touch gesture container
|
|
710
|
+
*
|
|
711
|
+
* @example
|
|
712
|
+
* ```tsx
|
|
713
|
+
* // Basic pinch to zoom
|
|
714
|
+
* <NiceGestures
|
|
715
|
+
* enablePinch
|
|
716
|
+
* applyTransform
|
|
717
|
+
* onPinch={(e) => console.log('Scale:', e.scale)}
|
|
718
|
+
* >
|
|
719
|
+
* <img src="photo.jpg" alt="Zoomable" />
|
|
720
|
+
* </NiceGestures>
|
|
721
|
+
*
|
|
722
|
+
* // Swipe detection
|
|
723
|
+
* <NiceGestures
|
|
724
|
+
* enableSwipe
|
|
725
|
+
* onSwipe={(e) => {
|
|
726
|
+
* if (e.direction === 'left') nextSlide();
|
|
727
|
+
* if (e.direction === 'right') prevSlide();
|
|
728
|
+
* }}
|
|
729
|
+
* >
|
|
730
|
+
* <SlideContent />
|
|
731
|
+
* </NiceGestures>
|
|
732
|
+
*
|
|
733
|
+
* // All gestures
|
|
734
|
+
* <NiceGestures
|
|
735
|
+
* enablePinch
|
|
736
|
+
* enableRotation
|
|
737
|
+
* enablePan
|
|
738
|
+
* enableSwipe
|
|
739
|
+
* applyTransform
|
|
740
|
+
* onPinch={(e) => console.log('Pinch', e.scale)}
|
|
741
|
+
* onRotate={(e) => console.log('Rotate', e.rotation)}
|
|
742
|
+
* onPan={(e) => console.log('Pan', e.translation)}
|
|
743
|
+
* onSwipe={(e) => console.log('Swipe', e.direction)}
|
|
744
|
+
* onDoubleTap={() => reset()}
|
|
745
|
+
* >
|
|
746
|
+
* <TransformableContent />
|
|
747
|
+
* </NiceGestures>
|
|
748
|
+
* ```
|
|
749
|
+
*/
|
|
750
|
+
export declare const NiceGestures: default_2.ForwardRefExoticComponent<NiceGesturesProps & default_2.RefAttributes<HTMLDivElement>>;
|
|
751
|
+
|
|
752
|
+
/**
|
|
753
|
+
* Main props
|
|
754
|
+
*/
|
|
755
|
+
export declare interface NiceGesturesProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onTap'>, GestureHandlers {
|
|
756
|
+
/** Enable pinch to zoom */
|
|
757
|
+
enablePinch?: boolean;
|
|
758
|
+
/** Enable rotation */
|
|
759
|
+
enableRotation?: boolean;
|
|
760
|
+
/** Enable pan/drag */
|
|
761
|
+
enablePan?: boolean;
|
|
762
|
+
/** Enable swipe detection */
|
|
763
|
+
enableSwipe?: boolean;
|
|
764
|
+
/** Enable tap detection */
|
|
765
|
+
enableTap?: boolean;
|
|
766
|
+
/** Enable double tap */
|
|
767
|
+
enableDoubleTap?: boolean;
|
|
768
|
+
/** Enable long press */
|
|
769
|
+
enableLongPress?: boolean;
|
|
770
|
+
/** Minimum scale */
|
|
771
|
+
minScale?: number;
|
|
772
|
+
/** Maximum scale */
|
|
773
|
+
maxScale?: number;
|
|
774
|
+
/** Apply transform to children */
|
|
775
|
+
applyTransform?: boolean;
|
|
776
|
+
/** Initial scale */
|
|
777
|
+
initialScale?: number;
|
|
778
|
+
/** Controlled scale */
|
|
779
|
+
scale?: number;
|
|
780
|
+
/** Initial rotation */
|
|
781
|
+
initialRotation?: number;
|
|
782
|
+
/** Controlled rotation */
|
|
783
|
+
rotation?: number;
|
|
784
|
+
/** Initial translation */
|
|
785
|
+
initialTranslation?: Point;
|
|
786
|
+
/** Controlled translation */
|
|
787
|
+
translation?: Point;
|
|
788
|
+
/** Callback when transform changes */
|
|
789
|
+
onTransformChange?: (state: GestureState) => void;
|
|
790
|
+
/** Children */
|
|
791
|
+
children?: ReactNode;
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
/**
|
|
795
|
+
* Haptics provider for app-wide vibration feedback
|
|
796
|
+
*
|
|
797
|
+
* @example
|
|
798
|
+
* ```tsx
|
|
799
|
+
* <NiceHapticsProvider enabled intensity="medium">
|
|
800
|
+
* <App />
|
|
801
|
+
* </NiceHapticsProvider>
|
|
802
|
+
* ```
|
|
803
|
+
*/
|
|
804
|
+
export declare function NiceHapticsProvider({ enabled, intensity, respectReducedMotion, customPatterns, children, }: NiceHapticsProviderProps): JSX.Element;
|
|
805
|
+
|
|
806
|
+
/**
|
|
807
|
+
* Provider props
|
|
808
|
+
*/
|
|
809
|
+
export declare interface NiceHapticsProviderProps {
|
|
810
|
+
/** Enable haptics globally */
|
|
811
|
+
enabled?: boolean;
|
|
812
|
+
/** Global intensity */
|
|
813
|
+
intensity?: HapticIntensity;
|
|
814
|
+
/** Disable haptics for reduced motion */
|
|
815
|
+
respectReducedMotion?: boolean;
|
|
816
|
+
/** Custom patterns */
|
|
817
|
+
customPatterns?: Record<string, VibrationPattern>;
|
|
818
|
+
/** Children */
|
|
819
|
+
children: ReactNode;
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
/**
|
|
823
|
+
* Conditionally hide content based on breakpoint
|
|
824
|
+
*
|
|
825
|
+
* @example
|
|
826
|
+
* ```tsx
|
|
827
|
+
* <NiceHide below="md">
|
|
828
|
+
* <DesktopFeature />
|
|
829
|
+
* </NiceHide>
|
|
830
|
+
*
|
|
831
|
+
* <NiceHide device="desktop">
|
|
832
|
+
* <MobileOnlyContent />
|
|
833
|
+
* </NiceHide>
|
|
834
|
+
* ```
|
|
835
|
+
*/
|
|
836
|
+
export declare function NiceHide({ on, above, below, device, orientation, children, }: NiceHideProps): ReactNode;
|
|
837
|
+
|
|
838
|
+
/**
|
|
839
|
+
* Hide props
|
|
840
|
+
*/
|
|
841
|
+
export declare type NiceHideProps = Omit<NiceShowProps, 'fallback'>;
|
|
842
|
+
|
|
843
|
+
export declare const NiceImageGallery: default_2.ForwardRefExoticComponent<NiceImageGalleryProps & default_2.RefAttributes<NiceImageGalleryRef>>;
|
|
844
|
+
|
|
845
|
+
export declare interface NiceImageGalleryProps {
|
|
846
|
+
/** Gallery images */
|
|
847
|
+
items: ImageGalleryItem[];
|
|
848
|
+
/** Currently selected image index */
|
|
849
|
+
selectedIndex?: number;
|
|
850
|
+
/** Called when image changes */
|
|
851
|
+
onIndexChange?: (index: number, item: ImageGalleryItem) => void;
|
|
852
|
+
/** Called when gallery closes */
|
|
853
|
+
onClose?: () => void;
|
|
854
|
+
/** Show close button */
|
|
855
|
+
showClose?: boolean;
|
|
856
|
+
/** Show image counter */
|
|
857
|
+
showCounter?: boolean;
|
|
858
|
+
/** Show caption/title */
|
|
859
|
+
showCaption?: boolean;
|
|
860
|
+
/** Show thumbnail strip */
|
|
861
|
+
showThumbnails?: boolean;
|
|
862
|
+
/** Enable pinch-to-zoom */
|
|
863
|
+
enablePinchZoom?: boolean;
|
|
864
|
+
/** Enable double-tap zoom */
|
|
865
|
+
enableDoubleTapZoom?: boolean;
|
|
866
|
+
/** Enable swipe navigation */
|
|
867
|
+
enableSwipe?: boolean;
|
|
868
|
+
/** Enable keyboard navigation */
|
|
869
|
+
enableKeyboard?: boolean;
|
|
870
|
+
/** Min zoom level */
|
|
871
|
+
minZoom?: number;
|
|
872
|
+
/** Max zoom level */
|
|
873
|
+
maxZoom?: number;
|
|
874
|
+
/** Double-tap zoom level */
|
|
875
|
+
doubleTapZoom?: number;
|
|
876
|
+
/** Swipe threshold (px) */
|
|
877
|
+
swipeThreshold?: number;
|
|
878
|
+
/** Enable infinite loop */
|
|
879
|
+
loop?: boolean;
|
|
880
|
+
/** Enable haptic feedback */
|
|
881
|
+
hapticFeedback?: boolean;
|
|
882
|
+
/** Background color/opacity */
|
|
883
|
+
backgroundColor?: string;
|
|
884
|
+
/** Z-index */
|
|
885
|
+
zIndex?: number;
|
|
886
|
+
/** Custom class name */
|
|
887
|
+
className?: string;
|
|
888
|
+
/** Custom styles */
|
|
889
|
+
style?: CSSProperties;
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
export declare interface NiceImageGalleryRef {
|
|
893
|
+
goTo: (index: number) => void;
|
|
894
|
+
goNext: () => void;
|
|
895
|
+
goPrev: () => void;
|
|
896
|
+
zoomIn: () => void;
|
|
897
|
+
zoomOut: () => void;
|
|
898
|
+
resetZoom: () => void;
|
|
899
|
+
close: () => void;
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
export declare const NiceInfiniteScroll: <T>(props: NiceInfiniteScrollProps<T> & {
|
|
903
|
+
ref?: default_2.ForwardedRef<HTMLDivElement>;
|
|
904
|
+
}) => default_2.ReactElement;
|
|
905
|
+
|
|
906
|
+
export declare interface NiceInfiniteScrollProps<T = unknown> {
|
|
907
|
+
/** Items to display */
|
|
908
|
+
items: T[];
|
|
909
|
+
/** Render function for each item */
|
|
910
|
+
renderItem: (item: T, index: number) => ReactNode;
|
|
911
|
+
/** Function to fetch more items */
|
|
912
|
+
onLoadMore: () => Promise<void>;
|
|
913
|
+
/** Whether there are more items to load */
|
|
914
|
+
hasMore: boolean;
|
|
915
|
+
/** Loading state */
|
|
916
|
+
isLoading?: boolean;
|
|
917
|
+
/** Error message */
|
|
918
|
+
error?: string | null;
|
|
919
|
+
/** Distance from bottom to trigger load (px) */
|
|
920
|
+
threshold?: number;
|
|
921
|
+
/** Custom loading indicator */
|
|
922
|
+
loadingIndicator?: ReactNode;
|
|
923
|
+
/** Custom end-of-list indicator */
|
|
924
|
+
endIndicator?: ReactNode;
|
|
925
|
+
/** Custom error indicator */
|
|
926
|
+
errorIndicator?: ReactNode;
|
|
927
|
+
/** Called when retry is clicked */
|
|
928
|
+
onRetry?: () => void;
|
|
929
|
+
/** Enable pull-to-refresh at top */
|
|
930
|
+
pullToRefresh?: boolean;
|
|
931
|
+
/** Pull-to-refresh handler */
|
|
932
|
+
onRefresh?: () => Promise<void>;
|
|
933
|
+
/** Scroll direction */
|
|
934
|
+
direction?: 'vertical' | 'horizontal';
|
|
935
|
+
/** Reverse order (for chat-like layouts) */
|
|
936
|
+
reverse?: boolean;
|
|
937
|
+
/** Initial scroll position */
|
|
938
|
+
initialScrollPosition?: 'top' | 'bottom';
|
|
939
|
+
/** Enable keyboard navigation */
|
|
940
|
+
keyboardNav?: boolean;
|
|
941
|
+
/** Unique key extractor for items */
|
|
942
|
+
keyExtractor?: (item: T, index: number) => string;
|
|
943
|
+
/** Empty state content */
|
|
944
|
+
emptyContent?: ReactNode;
|
|
945
|
+
/** Header content (sticky) */
|
|
946
|
+
header?: ReactNode;
|
|
947
|
+
/** Footer content (sticky) */
|
|
948
|
+
footer?: ReactNode;
|
|
949
|
+
/** Gap between items */
|
|
950
|
+
gap?: number;
|
|
951
|
+
/** Custom class name */
|
|
952
|
+
className?: string;
|
|
953
|
+
/** Custom styles */
|
|
954
|
+
style?: CSSProperties;
|
|
955
|
+
/** ARIA label */
|
|
956
|
+
ariaLabel?: string;
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
export declare const NiceMobileActionSheet: default_2.ForwardRefExoticComponent<NiceMobileActionSheetProps & default_2.RefAttributes<HTMLDivElement>>;
|
|
960
|
+
|
|
961
|
+
export declare interface NiceMobileActionSheetProps extends Omit<NiceMobileModalProps, 'children'> {
|
|
962
|
+
actions: ActionSheetAction[];
|
|
963
|
+
cancelLabel?: string;
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
/**
|
|
967
|
+
* Touch-friendly calendar with swipe navigation
|
|
968
|
+
*
|
|
969
|
+
* @example
|
|
970
|
+
* ```tsx
|
|
971
|
+
* // Single date selection
|
|
972
|
+
* <NiceMobileCalendar
|
|
973
|
+
* selectedDate={selectedDate}
|
|
974
|
+
* onChange={(date) => setSelectedDate(date as Date)}
|
|
975
|
+
* />
|
|
976
|
+
*
|
|
977
|
+
* // Date range selection
|
|
978
|
+
* <NiceMobileCalendar
|
|
979
|
+
* selectionMode="range"
|
|
980
|
+
* selectedRange={range}
|
|
981
|
+
* onChange={(range) => setRange(range as DateRange)}
|
|
982
|
+
* />
|
|
983
|
+
*
|
|
984
|
+
* // With events
|
|
985
|
+
* <NiceMobileCalendar
|
|
986
|
+
* events={[
|
|
987
|
+
* { id: '1', title: 'Meeting', date: new Date(), color: 'var(--color-accent, #6366f1)' }
|
|
988
|
+
* ]}
|
|
989
|
+
* renderDay={(cell) => (
|
|
990
|
+
* <CustomDayCell cell={cell} />
|
|
991
|
+
* )}
|
|
992
|
+
* />
|
|
993
|
+
* ```
|
|
994
|
+
*/
|
|
995
|
+
export declare const NiceMobileCalendar: default_2.ForwardRefExoticComponent<NiceMobileCalendarProps & default_2.RefAttributes<HTMLDivElement>>;
|
|
996
|
+
|
|
997
|
+
/**
|
|
998
|
+
* Main props
|
|
999
|
+
*/
|
|
1000
|
+
export declare interface NiceMobileCalendarProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
1001
|
+
/** Initial view date */
|
|
1002
|
+
defaultDate?: Date;
|
|
1003
|
+
/** Controlled view date */
|
|
1004
|
+
viewDate?: Date;
|
|
1005
|
+
/** Controlled selected date (single mode) */
|
|
1006
|
+
selectedDate?: Date;
|
|
1007
|
+
/** Controlled selected dates (multiple mode) */
|
|
1008
|
+
selectedDates?: Date[];
|
|
1009
|
+
/** Controlled selected range (range mode) */
|
|
1010
|
+
selectedRange?: DateRange;
|
|
1011
|
+
/** Selection mode */
|
|
1012
|
+
selectionMode?: SelectionMode_2;
|
|
1013
|
+
/** Minimum selectable date */
|
|
1014
|
+
minDate?: Date;
|
|
1015
|
+
/** Maximum selectable date */
|
|
1016
|
+
maxDate?: Date;
|
|
1017
|
+
/** Specific disabled dates */
|
|
1018
|
+
disabledDates?: Date[];
|
|
1019
|
+
/** Disable weekends */
|
|
1020
|
+
disableWeekends?: boolean;
|
|
1021
|
+
/** Calendar events */
|
|
1022
|
+
events?: CalendarEvent[];
|
|
1023
|
+
/** First day of week (0=Sun, 1=Mon) */
|
|
1024
|
+
weekStartDay?: WeekStartDay;
|
|
1025
|
+
/** Locale for formatting */
|
|
1026
|
+
locale?: string;
|
|
1027
|
+
/** Show week numbers */
|
|
1028
|
+
showWeekNumbers?: boolean;
|
|
1029
|
+
/** Show adjacent month days */
|
|
1030
|
+
showAdjacentMonths?: boolean;
|
|
1031
|
+
/** Enable swipe navigation */
|
|
1032
|
+
enableSwipe?: boolean;
|
|
1033
|
+
/** Callback when selection changes */
|
|
1034
|
+
onChange?: (value: Date | Date[] | DateRange) => void;
|
|
1035
|
+
/** Callback when view date changes */
|
|
1036
|
+
onViewChange?: (date: Date, view: CalendarView) => void;
|
|
1037
|
+
/** Callback when month changes */
|
|
1038
|
+
onMonthChange?: (date: Date) => void;
|
|
1039
|
+
/** Custom day cell renderer */
|
|
1040
|
+
renderDay?: (cell: DayCell) => ReactNode;
|
|
1041
|
+
/** Custom header renderer */
|
|
1042
|
+
renderHeader?: (date: Date, view: CalendarView, actions: {
|
|
1043
|
+
prev: () => void;
|
|
1044
|
+
next: () => void;
|
|
1045
|
+
setView: (v: CalendarView) => void;
|
|
1046
|
+
}) => ReactNode;
|
|
1047
|
+
/** Show today button */
|
|
1048
|
+
showTodayButton?: boolean;
|
|
1049
|
+
/** Today button label */
|
|
1050
|
+
todayLabel?: string;
|
|
1051
|
+
/** Compact mode */
|
|
1052
|
+
compact?: boolean;
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
export declare const NiceMobileDatePicker: default_2.ForwardRefExoticComponent<NiceMobileDatePickerProps & default_2.RefAttributes<HTMLDivElement>>;
|
|
1056
|
+
|
|
1057
|
+
/**
|
|
1058
|
+
* Date picker preset
|
|
1059
|
+
*/
|
|
1060
|
+
export declare interface NiceMobileDatePickerProps extends Omit<NiceMobilePickerProps, 'columns' | 'value' | 'onChange' | 'defaultValue'> {
|
|
1061
|
+
value?: Date;
|
|
1062
|
+
defaultValue?: Date;
|
|
1063
|
+
onChange?: (value: Date) => void;
|
|
1064
|
+
minYear?: number;
|
|
1065
|
+
maxYear?: number;
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
/**
|
|
1069
|
+
* Draggable wrapper
|
|
1070
|
+
*/
|
|
1071
|
+
export declare const NiceMobileDraggable: default_2.ForwardRefExoticComponent<Omit<NiceGesturesProps, "enablePan" | "applyTransform"> & default_2.RefAttributes<HTMLDivElement>>;
|
|
1072
|
+
|
|
1073
|
+
export declare const NiceMobileDrawer: default_2.ForwardRefExoticComponent<NiceMobileDrawerProps & default_2.RefAttributes<HTMLDivElement>>;
|
|
1074
|
+
|
|
1075
|
+
export declare interface NiceMobileDrawerProps {
|
|
1076
|
+
/** Whether drawer is open */
|
|
1077
|
+
open: boolean;
|
|
1078
|
+
/** Called when drawer should close */
|
|
1079
|
+
onClose: () => void;
|
|
1080
|
+
/** Drawer position */
|
|
1081
|
+
position?: DrawerPosition;
|
|
1082
|
+
/** Drawer variant */
|
|
1083
|
+
variant?: DrawerVariant;
|
|
1084
|
+
/** Width/height of drawer (px or %) */
|
|
1085
|
+
size?: number | string;
|
|
1086
|
+
/** Custom drawer content */
|
|
1087
|
+
children?: ReactNode;
|
|
1088
|
+
/** Navigation items (alternative to children) */
|
|
1089
|
+
navItems?: DrawerNavItem[];
|
|
1090
|
+
/** Header content */
|
|
1091
|
+
header?: ReactNode;
|
|
1092
|
+
/** Footer content */
|
|
1093
|
+
footer?: ReactNode;
|
|
1094
|
+
/** Enable swipe to open from edge */
|
|
1095
|
+
swipeToOpen?: boolean;
|
|
1096
|
+
/** Enable swipe to close */
|
|
1097
|
+
swipeToClose?: boolean;
|
|
1098
|
+
/** Edge swipe detection width (px) */
|
|
1099
|
+
edgeSwipeWidth?: number;
|
|
1100
|
+
/** Velocity threshold to trigger close (px/ms) */
|
|
1101
|
+
velocityThreshold?: number;
|
|
1102
|
+
/** Show overlay backdrop */
|
|
1103
|
+
showOverlay?: boolean;
|
|
1104
|
+
/** Close on overlay click */
|
|
1105
|
+
closeOnOverlayClick?: boolean;
|
|
1106
|
+
/** Close on escape key */
|
|
1107
|
+
closeOnEscape?: boolean;
|
|
1108
|
+
/** Disable body scroll when open */
|
|
1109
|
+
disableBodyScroll?: boolean;
|
|
1110
|
+
/** Custom overlay color */
|
|
1111
|
+
overlayColor?: string;
|
|
1112
|
+
/** Z-index */
|
|
1113
|
+
zIndex?: number;
|
|
1114
|
+
/** Called when nav item is selected */
|
|
1115
|
+
onNavSelect?: (item: DrawerNavItem) => void;
|
|
1116
|
+
/** Active nav item id */
|
|
1117
|
+
activeNavId?: string;
|
|
1118
|
+
/** Custom class name */
|
|
1119
|
+
className?: string;
|
|
1120
|
+
/** Custom styles */
|
|
1121
|
+
style?: CSSProperties;
|
|
1122
|
+
/** ARIA label */
|
|
1123
|
+
ariaLabel?: string;
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1126
|
+
/**
|
|
1127
|
+
* Collapsing app bar header with scroll effects
|
|
1128
|
+
*
|
|
1129
|
+
* @example
|
|
1130
|
+
* ```tsx
|
|
1131
|
+
* // Basic usage
|
|
1132
|
+
* <NiceMobileHeader
|
|
1133
|
+
* title="Settings"
|
|
1134
|
+
* leftAction={<button onClick={goBack}>{HeaderIcons.back}</button>}
|
|
1135
|
+
* />
|
|
1136
|
+
*
|
|
1137
|
+
* // With large title (iOS style)
|
|
1138
|
+
* <NiceMobileHeader
|
|
1139
|
+
* title="Messages"
|
|
1140
|
+
* largeTitle="Messages"
|
|
1141
|
+
* expandedHeight={140}
|
|
1142
|
+
* mode="scroll"
|
|
1143
|
+
* />
|
|
1144
|
+
*
|
|
1145
|
+
* // With background image
|
|
1146
|
+
* <NiceMobileHeader
|
|
1147
|
+
* title="Profile"
|
|
1148
|
+
* expandedHeight={280}
|
|
1149
|
+
* parallax
|
|
1150
|
+
* background={
|
|
1151
|
+
* <img src="/cover.jpg" alt="" style={{ width: '100%', height: '100%', objectFit: 'cover' }} />
|
|
1152
|
+
* }
|
|
1153
|
+
* />
|
|
1154
|
+
*
|
|
1155
|
+
* // Transparent with blur
|
|
1156
|
+
* <NiceMobileHeader
|
|
1157
|
+
* title="Gallery"
|
|
1158
|
+
* variant="blur"
|
|
1159
|
+
* sticky
|
|
1160
|
+
* />
|
|
1161
|
+
* ```
|
|
1162
|
+
*/
|
|
1163
|
+
export declare const NiceMobileHeader: default_2.ForwardRefExoticComponent<NiceMobileHeaderProps & default_2.RefAttributes<HTMLElement>>;
|
|
1164
|
+
|
|
1165
|
+
/**
|
|
1166
|
+
* Main props
|
|
1167
|
+
*/
|
|
1168
|
+
export declare interface NiceMobileHeaderProps extends Omit<HTMLAttributes<HTMLElement>, 'title'> {
|
|
1169
|
+
/** Header title */
|
|
1170
|
+
title?: ReactNode;
|
|
1171
|
+
/** Large title (shown when expanded) */
|
|
1172
|
+
largeTitle?: ReactNode;
|
|
1173
|
+
/** Subtitle */
|
|
1174
|
+
subtitle?: ReactNode;
|
|
1175
|
+
/** Left action (usually back button) */
|
|
1176
|
+
leftAction?: ReactNode;
|
|
1177
|
+
/** Right actions */
|
|
1178
|
+
rightActions?: HeaderAction[];
|
|
1179
|
+
/** Background image/content for expanded state */
|
|
1180
|
+
background?: ReactNode;
|
|
1181
|
+
/** Collapse mode */
|
|
1182
|
+
mode?: CollapseMode;
|
|
1183
|
+
/** Visual variant */
|
|
1184
|
+
variant?: HeaderVariant;
|
|
1185
|
+
/** Minimum height when collapsed */
|
|
1186
|
+
collapsedHeight?: number;
|
|
1187
|
+
/** Maximum height when expanded */
|
|
1188
|
+
expandedHeight?: number;
|
|
1189
|
+
/** Enable parallax effect for background */
|
|
1190
|
+
parallax?: boolean;
|
|
1191
|
+
/** Parallax multiplier (0-1) */
|
|
1192
|
+
parallaxSpeed?: number;
|
|
1193
|
+
/** Show shadow when collapsed */
|
|
1194
|
+
showShadow?: boolean;
|
|
1195
|
+
/** Sticky position */
|
|
1196
|
+
sticky?: boolean;
|
|
1197
|
+
/** Z-index */
|
|
1198
|
+
zIndex?: number;
|
|
1199
|
+
/** Custom scroll element */
|
|
1200
|
+
scrollElement?: HTMLElement | null;
|
|
1201
|
+
/** Callback when collapse state changes */
|
|
1202
|
+
onCollapseChange?: (collapsed: boolean, progress: number) => void;
|
|
1203
|
+
/** Safe area padding */
|
|
1204
|
+
safeArea?: boolean;
|
|
1205
|
+
/** Background color */
|
|
1206
|
+
backgroundColor?: string;
|
|
1207
|
+
/** Text color */
|
|
1208
|
+
textColor?: string;
|
|
1209
|
+
/** Border bottom */
|
|
1210
|
+
showBorder?: boolean;
|
|
1211
|
+
/** Custom collapsed content */
|
|
1212
|
+
collapsedContent?: ReactNode;
|
|
1213
|
+
/** Custom expanded content */
|
|
1214
|
+
expandedContent?: ReactNode;
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
/**
|
|
1218
|
+
* Mobile-first bottom sheet modal with snap points and drag-to-dismiss
|
|
1219
|
+
*
|
|
1220
|
+
* @example
|
|
1221
|
+
* ```tsx
|
|
1222
|
+
* // Basic usage
|
|
1223
|
+
* <NiceMobileModal
|
|
1224
|
+
* open={open}
|
|
1225
|
+
* onClose={() => setOpen(false)}
|
|
1226
|
+
* title="Settings"
|
|
1227
|
+
* >
|
|
1228
|
+
* <p>Modal content goes here</p>
|
|
1229
|
+
* </NiceMobileModal>
|
|
1230
|
+
*
|
|
1231
|
+
* // With snap points
|
|
1232
|
+
* <NiceMobileModal
|
|
1233
|
+
* open={open}
|
|
1234
|
+
* onClose={() => setOpen(false)}
|
|
1235
|
+
* snapPoints={[0.25, 0.5, 'content', 'full']}
|
|
1236
|
+
* defaultSnapPoint={1}
|
|
1237
|
+
* >
|
|
1238
|
+
* Content that can be dragged between snap points
|
|
1239
|
+
* </NiceMobileModal>
|
|
1240
|
+
*
|
|
1241
|
+
* // Non-dismissible
|
|
1242
|
+
* <NiceMobileModal
|
|
1243
|
+
* open={open}
|
|
1244
|
+
* onClose={() => setOpen(false)}
|
|
1245
|
+
* preventDismiss
|
|
1246
|
+
* showClose={false}
|
|
1247
|
+
* >
|
|
1248
|
+
* You must complete this action
|
|
1249
|
+
* <button onClick={() => setOpen(false)}>Done</button>
|
|
1250
|
+
* </NiceMobileModal>
|
|
1251
|
+
* ```
|
|
1252
|
+
*/
|
|
1253
|
+
export declare const NiceMobileModal: default_2.ForwardRefExoticComponent<NiceMobileModalProps & default_2.RefAttributes<HTMLDivElement>>;
|
|
1254
|
+
|
|
1255
|
+
/**
|
|
1256
|
+
* Main modal props
|
|
1257
|
+
*/
|
|
1258
|
+
export declare interface NiceMobileModalProps extends Omit<HTMLAttributes<HTMLDivElement>, 'content' | 'title'> {
|
|
1259
|
+
/** Is the modal open */
|
|
1260
|
+
open: boolean;
|
|
1261
|
+
/** Callback when modal should close */
|
|
1262
|
+
onClose?: (trigger?: DismissTrigger) => void;
|
|
1263
|
+
/** Modal title */
|
|
1264
|
+
title?: ReactNode;
|
|
1265
|
+
/** Modal content */
|
|
1266
|
+
children: ReactNode;
|
|
1267
|
+
/** Footer content */
|
|
1268
|
+
footer?: ReactNode;
|
|
1269
|
+
/** Snap points as heights (0-1 for percentage, >1 for pixels) */
|
|
1270
|
+
snapPoints?: ModalSnapPoint[];
|
|
1271
|
+
/** Initial snap point index */
|
|
1272
|
+
defaultSnapPoint?: number;
|
|
1273
|
+
/** Show drag handle indicator */
|
|
1274
|
+
showHandle?: boolean;
|
|
1275
|
+
/** Show close button */
|
|
1276
|
+
showClose?: boolean;
|
|
1277
|
+
/** Show overlay backdrop */
|
|
1278
|
+
showOverlay?: boolean;
|
|
1279
|
+
/** Can dismiss by dragging down */
|
|
1280
|
+
dismissOnDrag?: boolean;
|
|
1281
|
+
/** Can dismiss by clicking overlay */
|
|
1282
|
+
dismissOnOverlay?: boolean;
|
|
1283
|
+
/** Can dismiss with Escape key */
|
|
1284
|
+
dismissOnEscape?: boolean;
|
|
1285
|
+
/** Block all dismiss methods */
|
|
1286
|
+
preventDismiss?: boolean;
|
|
1287
|
+
/** Callback when snap point changes */
|
|
1288
|
+
onSnapChange?: (index: number, point: ModalSnapPoint) => void;
|
|
1289
|
+
/** Custom overlay className */
|
|
1290
|
+
overlayClassName?: string;
|
|
1291
|
+
/** Custom header className */
|
|
1292
|
+
headerClassName?: string;
|
|
1293
|
+
/** Custom content className */
|
|
1294
|
+
contentClassName?: string;
|
|
1295
|
+
/** Custom footer className */
|
|
1296
|
+
footerClassName?: string;
|
|
1297
|
+
/** Disable body scroll when open */
|
|
1298
|
+
lockScroll?: boolean;
|
|
1299
|
+
/** Border radius for top corners */
|
|
1300
|
+
borderRadius?: number;
|
|
1301
|
+
/** Z-index override */
|
|
1302
|
+
zIndex?: number;
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1305
|
+
/**
|
|
1306
|
+
* Multi-column wheel picker
|
|
1307
|
+
*
|
|
1308
|
+
* @example
|
|
1309
|
+
* ```tsx
|
|
1310
|
+
* // Simple picker
|
|
1311
|
+
* <NiceMobilePicker
|
|
1312
|
+
* columns={[
|
|
1313
|
+
* {
|
|
1314
|
+
* id: 'fruit',
|
|
1315
|
+
* items: [
|
|
1316
|
+
* { value: 'apple', label: 'Apple' },
|
|
1317
|
+
* { value: 'banana', label: 'Banana' },
|
|
1318
|
+
* { value: 'orange', label: 'Orange' }
|
|
1319
|
+
* ]
|
|
1320
|
+
* }
|
|
1321
|
+
* ]}
|
|
1322
|
+
* value={{ fruit: 'apple' }}
|
|
1323
|
+
* onChange={(value) => console.log(value)}
|
|
1324
|
+
* />
|
|
1325
|
+
*
|
|
1326
|
+
* // Date picker
|
|
1327
|
+
* <NiceMobilePicker
|
|
1328
|
+
* columns={[
|
|
1329
|
+
* { id: 'day', items: days, label: 'Day' },
|
|
1330
|
+
* { id: 'month', items: months, label: 'Month' },
|
|
1331
|
+
* { id: 'year', items: years, label: 'Year' }
|
|
1332
|
+
* ]}
|
|
1333
|
+
* showLabels
|
|
1334
|
+
* />
|
|
1335
|
+
* ```
|
|
1336
|
+
*/
|
|
1337
|
+
export declare const NiceMobilePicker: default_2.ForwardRefExoticComponent<NiceMobilePickerProps<Record<string, unknown>> & default_2.RefAttributes<HTMLDivElement>>;
|
|
1338
|
+
|
|
1339
|
+
/**
|
|
1340
|
+
* Multi-column picker props
|
|
1341
|
+
*/
|
|
1342
|
+
export declare interface NiceMobilePickerProps<T = Record<string, unknown>> extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
|
|
1343
|
+
/** Columns configuration */
|
|
1344
|
+
columns: PickerColumn[];
|
|
1345
|
+
/** Current values (keyed by column id) */
|
|
1346
|
+
value?: T;
|
|
1347
|
+
/** Default values */
|
|
1348
|
+
defaultValue?: T;
|
|
1349
|
+
/** Callback when value changes */
|
|
1350
|
+
onChange?: (value: T, columnId: string) => void;
|
|
1351
|
+
/** Height of each item */
|
|
1352
|
+
itemHeight?: number;
|
|
1353
|
+
/** Number of visible items */
|
|
1354
|
+
visibleItems?: number;
|
|
1355
|
+
/** Enable looping */
|
|
1356
|
+
loop?: boolean;
|
|
1357
|
+
/** Show column labels */
|
|
1358
|
+
showLabels?: boolean;
|
|
1359
|
+
/** Custom item renderer */
|
|
1360
|
+
renderItem?: (item: PickerItem, columnId: string, isSelected: boolean) => ReactNode;
|
|
1361
|
+
/** Show selection indicator */
|
|
1362
|
+
showIndicator?: boolean;
|
|
1363
|
+
/** Custom indicator className */
|
|
1364
|
+
indicatorClassName?: string;
|
|
1365
|
+
}
|
|
1366
|
+
|
|
1367
|
+
/**
|
|
1368
|
+
* Mobile bottom navigation with badges and animations
|
|
1369
|
+
*
|
|
1370
|
+
* @example
|
|
1371
|
+
* ```tsx
|
|
1372
|
+
* // Basic usage
|
|
1373
|
+
* <NiceMobileTabs
|
|
1374
|
+
* tabs={[
|
|
1375
|
+
* { id: 'home', label: 'Home', icon: <HomeIcon /> },
|
|
1376
|
+
* { id: 'search', label: 'Search', icon: <SearchIcon /> },
|
|
1377
|
+
* { id: 'profile', label: 'Profile', icon: <UserIcon /> }
|
|
1378
|
+
* ]}
|
|
1379
|
+
* activeTab={activeTab}
|
|
1380
|
+
* onChange={setActiveTab}
|
|
1381
|
+
* />
|
|
1382
|
+
*
|
|
1383
|
+
* // With badges
|
|
1384
|
+
* <NiceMobileTabs
|
|
1385
|
+
* tabs={[
|
|
1386
|
+
* { id: 'home', label: 'Home', icon: TabIcons.home },
|
|
1387
|
+
* { id: 'inbox', label: 'Inbox', icon: TabIcons.inbox, badge: 5 },
|
|
1388
|
+
* { id: 'notifications', label: 'Alerts', icon: TabIcons.bell, badge: true }
|
|
1389
|
+
* ]}
|
|
1390
|
+
* activeTab="home"
|
|
1391
|
+
* onChange={handleTabChange}
|
|
1392
|
+
* />
|
|
1393
|
+
*
|
|
1394
|
+
* // Floating variant
|
|
1395
|
+
* <NiceMobileTabs
|
|
1396
|
+
* tabs={tabs}
|
|
1397
|
+
* activeTab={activeTab}
|
|
1398
|
+
* onChange={setActiveTab}
|
|
1399
|
+
* variant="floating"
|
|
1400
|
+
* animation="scale"
|
|
1401
|
+
* />
|
|
1402
|
+
* ```
|
|
1403
|
+
*/
|
|
1404
|
+
export declare const NiceMobileTabs: default_2.ForwardRefExoticComponent<NiceMobileTabsProps & default_2.RefAttributes<HTMLElement>>;
|
|
1405
|
+
|
|
1406
|
+
/**
|
|
1407
|
+
* Main props
|
|
1408
|
+
*/
|
|
1409
|
+
export declare interface NiceMobileTabsProps extends Omit<HTMLAttributes<HTMLElement>, 'onChange'> {
|
|
1410
|
+
/** Tab items */
|
|
1411
|
+
tabs: TabItem[];
|
|
1412
|
+
/** Active tab ID */
|
|
1413
|
+
activeTab?: string;
|
|
1414
|
+
/** Default active tab (uncontrolled) */
|
|
1415
|
+
defaultTab?: string;
|
|
1416
|
+
/** Callback when tab changes */
|
|
1417
|
+
onChange?: (id: string) => void;
|
|
1418
|
+
/** Show labels */
|
|
1419
|
+
showLabels?: boolean;
|
|
1420
|
+
/** Always show labels (not just active) */
|
|
1421
|
+
showAllLabels?: boolean;
|
|
1422
|
+
/** Tab bar position */
|
|
1423
|
+
position?: 'bottom' | 'top';
|
|
1424
|
+
/** Visual variant */
|
|
1425
|
+
variant?: 'default' | 'minimal' | 'floating' | 'shifted';
|
|
1426
|
+
/** Use haptic feedback on tab change */
|
|
1427
|
+
haptic?: boolean;
|
|
1428
|
+
/** Animation style */
|
|
1429
|
+
animation?: 'none' | 'scale' | 'slide' | 'fade';
|
|
1430
|
+
/** Maximum number of visible tabs (rest go to "more") */
|
|
1431
|
+
maxTabs?: number;
|
|
1432
|
+
/** Custom "more" tab label */
|
|
1433
|
+
moreLabel?: string;
|
|
1434
|
+
/** Custom "more" tab icon */
|
|
1435
|
+
moreIcon?: ReactNode;
|
|
1436
|
+
/** Safe area padding (for iPhone X+) */
|
|
1437
|
+
safeArea?: boolean;
|
|
1438
|
+
/** Custom active indicator color */
|
|
1439
|
+
activeColor?: string;
|
|
1440
|
+
/** Custom inactive color */
|
|
1441
|
+
inactiveColor?: string;
|
|
1442
|
+
/** Background color */
|
|
1443
|
+
backgroundColor?: string;
|
|
1444
|
+
/** Hide on scroll direction */
|
|
1445
|
+
hideOnScroll?: 'up' | 'down' | 'none';
|
|
1446
|
+
/** Lock scroll to prevent horizontal overflow */
|
|
1447
|
+
lockScroll?: boolean;
|
|
1448
|
+
}
|
|
1449
|
+
|
|
1450
|
+
export declare const NiceMobileTimePicker: default_2.ForwardRefExoticComponent<NiceMobileTimePickerProps & default_2.RefAttributes<HTMLDivElement>>;
|
|
1451
|
+
|
|
1452
|
+
/**
|
|
1453
|
+
* Time picker preset
|
|
1454
|
+
*/
|
|
1455
|
+
export declare interface NiceMobileTimePickerProps extends Omit<NiceMobilePickerProps, 'columns' | 'value' | 'onChange' | 'defaultValue'> {
|
|
1456
|
+
value?: {
|
|
1457
|
+
hour: number;
|
|
1458
|
+
minute: number;
|
|
1459
|
+
};
|
|
1460
|
+
defaultValue?: {
|
|
1461
|
+
hour: number;
|
|
1462
|
+
minute: number;
|
|
1463
|
+
};
|
|
1464
|
+
onChange?: (value: {
|
|
1465
|
+
hour: number;
|
|
1466
|
+
minute: number;
|
|
1467
|
+
}) => void;
|
|
1468
|
+
/** Use 24-hour format */
|
|
1469
|
+
use24Hour?: boolean;
|
|
1470
|
+
/** Minute step */
|
|
1471
|
+
minuteStep?: number;
|
|
1472
|
+
}
|
|
1473
|
+
|
|
1474
|
+
/**
|
|
1475
|
+
* Multi-date picker preset
|
|
1476
|
+
*/
|
|
1477
|
+
export declare const NiceMultiDatePicker: default_2.ForwardRefExoticComponent<Omit<NiceMobileCalendarProps, "selectionMode"> & default_2.RefAttributes<HTMLDivElement>>;
|
|
1478
|
+
|
|
1479
|
+
export declare const NicePhoneKeyboard: default_2.ForwardRefExoticComponent<Omit<NiceTouchKeyboardProps, "layout"> & default_2.RefAttributes<HTMLDivElement>>;
|
|
1480
|
+
|
|
1481
|
+
/**
|
|
1482
|
+
* Single picker column (wheel)
|
|
1483
|
+
*/
|
|
1484
|
+
export declare const NicePickerColumn: <T = string>(props: NicePickerColumnProps<T> & {
|
|
1485
|
+
ref?: default_2.Ref<HTMLDivElement>;
|
|
1486
|
+
}) => JSX.Element;
|
|
1487
|
+
|
|
1488
|
+
/**
|
|
1489
|
+
* Single column props
|
|
1490
|
+
*/
|
|
1491
|
+
export declare interface NicePickerColumnProps<T = unknown> extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
|
|
1492
|
+
items: PickerItem<T>[];
|
|
1493
|
+
value?: T;
|
|
1494
|
+
defaultValue?: T;
|
|
1495
|
+
onChange?: (value: T, item: PickerItem<T>) => void;
|
|
1496
|
+
itemHeight?: number;
|
|
1497
|
+
visibleItems?: number;
|
|
1498
|
+
loop?: boolean;
|
|
1499
|
+
renderItem?: (item: PickerItem<T>, isSelected: boolean) => ReactNode;
|
|
1500
|
+
}
|
|
1501
|
+
|
|
1502
|
+
/**
|
|
1503
|
+
* Pinch-to-zoom wrapper
|
|
1504
|
+
*/
|
|
1505
|
+
export declare const NicePinchZoom: default_2.ForwardRefExoticComponent<Omit<NiceGesturesProps, "enablePinch" | "applyTransform"> & default_2.RefAttributes<HTMLDivElement>>;
|
|
1506
|
+
|
|
1507
|
+
export declare const NicePINKeyboard: default_2.ForwardRefExoticComponent<Omit<NiceTouchKeyboardProps, "layout" | "masked"> & default_2.RefAttributes<HTMLDivElement>>;
|
|
1508
|
+
|
|
1509
|
+
declare const NicePullToRefresh: default_2.ForwardRefExoticComponent<NicePullToRefreshProps & default_2.RefAttributes<HTMLDivElement>>;
|
|
1510
|
+
export { NicePullToRefresh as NiceMobilePullToRefresh }
|
|
1511
|
+
export { NicePullToRefresh }
|
|
1512
|
+
|
|
1513
|
+
declare interface NicePullToRefreshProps {
|
|
1514
|
+
/** Content to wrap with pull-to-refresh */
|
|
1515
|
+
children: ReactNode;
|
|
1516
|
+
/** Async function called on refresh */
|
|
1517
|
+
onRefresh: () => Promise<void>;
|
|
1518
|
+
/** Custom indicator component */
|
|
1519
|
+
indicator?: default_2.ComponentType<PullToRefreshIndicatorProps>;
|
|
1520
|
+
/** Pull threshold in px (default: 80) */
|
|
1521
|
+
threshold?: number;
|
|
1522
|
+
/** Max pull distance (default: 150) */
|
|
1523
|
+
maxPull?: number;
|
|
1524
|
+
/** Pull resistance 0-1 (default: 0.4) */
|
|
1525
|
+
resistance?: number;
|
|
1526
|
+
/** How long to show success/error (default: 1000ms) */
|
|
1527
|
+
completionDuration?: number;
|
|
1528
|
+
/** Enable haptic feedback (default: true) */
|
|
1529
|
+
hapticFeedback?: boolean;
|
|
1530
|
+
/** Disable pull-to-refresh (default: false) */
|
|
1531
|
+
disabled?: boolean;
|
|
1532
|
+
/** Called when pull starts */
|
|
1533
|
+
onPullStart?: () => void;
|
|
1534
|
+
/** Called during pull with progress 0-1 */
|
|
1535
|
+
onPullProgress?: (progress: number) => void;
|
|
1536
|
+
/** Called when refresh succeeds */
|
|
1537
|
+
onRefreshSuccess?: () => void;
|
|
1538
|
+
/** Called when refresh fails */
|
|
1539
|
+
onRefreshError?: (error: Error) => void;
|
|
1540
|
+
/** Custom class name */
|
|
1541
|
+
className?: string;
|
|
1542
|
+
/** Custom styles */
|
|
1543
|
+
style?: CSSProperties;
|
|
1544
|
+
/** Accessibility label */
|
|
1545
|
+
ariaLabel?: string;
|
|
1546
|
+
}
|
|
1547
|
+
export { NicePullToRefreshProps as NiceMobilePullToRefreshProps }
|
|
1548
|
+
export { NicePullToRefreshProps }
|
|
1549
|
+
|
|
1550
|
+
/**
|
|
1551
|
+
* Conditionally show content based on breakpoint
|
|
1552
|
+
*
|
|
1553
|
+
* @example
|
|
1554
|
+
* ```tsx
|
|
1555
|
+
* <NiceShow above="md">
|
|
1556
|
+
* <DesktopSidebar />
|
|
1557
|
+
* </NiceShow>
|
|
1558
|
+
*
|
|
1559
|
+
* <NiceShow on="sm" fallback={<MobileNav />}>
|
|
1560
|
+
* <TabletNav />
|
|
1561
|
+
* </NiceShow>
|
|
1562
|
+
*
|
|
1563
|
+
* <NiceShow device="mobile">
|
|
1564
|
+
* <MobileOnlyFeature />
|
|
1565
|
+
* </NiceShow>
|
|
1566
|
+
* ```
|
|
1567
|
+
*/
|
|
1568
|
+
export declare function NiceShow({ on, above, below, device, orientation, children, fallback, }: NiceShowProps): ReactNode;
|
|
1569
|
+
|
|
1570
|
+
/**
|
|
1571
|
+
* Show props (conditional render)
|
|
1572
|
+
*/
|
|
1573
|
+
export declare interface NiceShowProps {
|
|
1574
|
+
/** Show only on specific breakpoint */
|
|
1575
|
+
on?: BreakpointName;
|
|
1576
|
+
/** Show above breakpoint (inclusive) */
|
|
1577
|
+
above?: BreakpointName;
|
|
1578
|
+
/** Show below breakpoint (exclusive) */
|
|
1579
|
+
below?: BreakpointName;
|
|
1580
|
+
/** Show only on device type */
|
|
1581
|
+
device?: DeviceType;
|
|
1582
|
+
/** Show only in orientation */
|
|
1583
|
+
orientation?: Orientation;
|
|
1584
|
+
/** Children to render */
|
|
1585
|
+
children: ReactNode;
|
|
1586
|
+
/** Fallback content */
|
|
1587
|
+
fallback?: ReactNode;
|
|
1588
|
+
}
|
|
1589
|
+
|
|
1590
|
+
/**
|
|
1591
|
+
* Touch-optimized signature pad
|
|
1592
|
+
*
|
|
1593
|
+
* @example
|
|
1594
|
+
* ```tsx
|
|
1595
|
+
* // Basic usage
|
|
1596
|
+
* const padRef = useRef<SignaturePadRef>(null);
|
|
1597
|
+
*
|
|
1598
|
+
* <NiceSignaturePad
|
|
1599
|
+
* ref={padRef}
|
|
1600
|
+
* width={400}
|
|
1601
|
+
* height={200}
|
|
1602
|
+
* strokeColor="#1f2937"
|
|
1603
|
+
* onChange={(isEmpty) => setHasSignature(!isEmpty)}
|
|
1604
|
+
* />
|
|
1605
|
+
*
|
|
1606
|
+
* // Get signature
|
|
1607
|
+
* const dataUrl = padRef.current?.toDataURL('png');
|
|
1608
|
+
*
|
|
1609
|
+
* // Clear
|
|
1610
|
+
* padRef.current?.clear();
|
|
1611
|
+
* ```
|
|
1612
|
+
*/
|
|
1613
|
+
declare const NiceSignaturePad: default_2.ForwardRefExoticComponent<NiceSignaturePadProps & default_2.RefAttributes<SignaturePadRef>>;
|
|
1614
|
+
export { NiceSignaturePad }
|
|
1615
|
+
export { NiceSignaturePad as NiceTouchSignaturePad }
|
|
1616
|
+
|
|
1617
|
+
/**
|
|
1618
|
+
* Main props
|
|
1619
|
+
*/
|
|
1620
|
+
declare interface NiceSignaturePadProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
1621
|
+
/** Canvas width */
|
|
1622
|
+
width?: number | string;
|
|
1623
|
+
/** Canvas height */
|
|
1624
|
+
height?: number | string;
|
|
1625
|
+
/** Stroke color */
|
|
1626
|
+
strokeColor?: string;
|
|
1627
|
+
/** Stroke width */
|
|
1628
|
+
strokeWidth?: number;
|
|
1629
|
+
/** Minimum stroke width */
|
|
1630
|
+
minWidth?: number;
|
|
1631
|
+
/** Maximum stroke width */
|
|
1632
|
+
maxWidth?: number;
|
|
1633
|
+
/** Velocity filter weight (0-1) */
|
|
1634
|
+
velocityFilterWeight?: number;
|
|
1635
|
+
/** Background color */
|
|
1636
|
+
backgroundColor?: string;
|
|
1637
|
+
/** Draw guidelines */
|
|
1638
|
+
showGuideline?: boolean;
|
|
1639
|
+
/** Guideline color */
|
|
1640
|
+
guidelineColor?: string;
|
|
1641
|
+
/** Disable input */
|
|
1642
|
+
disabled?: boolean;
|
|
1643
|
+
/** Enable pen pressure */
|
|
1644
|
+
penPressure?: boolean;
|
|
1645
|
+
/** Enable haptic feedback */
|
|
1646
|
+
haptic?: boolean;
|
|
1647
|
+
/** Placeholder text when empty */
|
|
1648
|
+
placeholder?: string;
|
|
1649
|
+
/** Callback when signature changes */
|
|
1650
|
+
onChange?: (isEmpty: boolean) => void;
|
|
1651
|
+
/** Callback when drawing starts */
|
|
1652
|
+
onBegin?: () => void;
|
|
1653
|
+
/** Callback when drawing ends */
|
|
1654
|
+
onEnd?: () => void;
|
|
1655
|
+
}
|
|
1656
|
+
export { NiceSignaturePadProps }
|
|
1657
|
+
export { NiceSignaturePadProps as NiceTouchSignaturePadProps }
|
|
1658
|
+
|
|
1659
|
+
/**
|
|
1660
|
+
* Swipeable wrapper
|
|
1661
|
+
*/
|
|
1662
|
+
export declare const NiceSwipeable: default_2.ForwardRefExoticComponent<Omit<NiceGesturesProps, "enableSwipe"> & default_2.RefAttributes<HTMLDivElement>>;
|
|
1663
|
+
|
|
1664
|
+
export declare const NiceSwipeActions: default_2.ForwardRefExoticComponent<NiceSwipeActionsProps & default_2.RefAttributes<HTMLDivElement>>;
|
|
1665
|
+
|
|
1666
|
+
export declare interface NiceSwipeActionsProps {
|
|
1667
|
+
/** Content to wrap */
|
|
1668
|
+
children: ReactNode;
|
|
1669
|
+
/** Actions revealed on left swipe (appear on right side) */
|
|
1670
|
+
leftActions?: SwipeActionsAction[];
|
|
1671
|
+
/** Actions revealed on right swipe (appear on left side) */
|
|
1672
|
+
rightActions?: SwipeActionsAction[];
|
|
1673
|
+
/** Width of each action button in px (default: 72) */
|
|
1674
|
+
actionWidth?: number;
|
|
1675
|
+
/** Threshold percentage to trigger action (0-1, default: 0.4) */
|
|
1676
|
+
threshold?: number;
|
|
1677
|
+
/** Enable swipe in both directions (default: based on actions) */
|
|
1678
|
+
direction?: SwipeDirection;
|
|
1679
|
+
/** Close other open swipe items when opening this one */
|
|
1680
|
+
exclusive?: boolean;
|
|
1681
|
+
/** Called when swipe starts */
|
|
1682
|
+
onSwipeStart?: (direction: 'left' | 'right') => void;
|
|
1683
|
+
/** Called when swipe ends */
|
|
1684
|
+
onSwipeEnd?: (direction: 'left' | 'right' | null) => void;
|
|
1685
|
+
/** Called when any action is triggered */
|
|
1686
|
+
onAction?: (action: SwipeActionsAction, direction: 'left' | 'right') => void;
|
|
1687
|
+
/** Disable swipe interaction */
|
|
1688
|
+
disabled?: boolean;
|
|
1689
|
+
/** Custom class name */
|
|
1690
|
+
className?: string;
|
|
1691
|
+
/** Custom styles */
|
|
1692
|
+
style?: CSSProperties;
|
|
1693
|
+
/** Item ID for exclusive group management */
|
|
1694
|
+
itemId?: string;
|
|
1695
|
+
/** Haptic feedback on threshold crossing */
|
|
1696
|
+
hapticFeedback?: boolean;
|
|
1697
|
+
}
|
|
1698
|
+
|
|
1699
|
+
/** Wrap NiceSwipeActions items for exclusive mode */
|
|
1700
|
+
export declare const NiceSwipeList: default_2.FC<NiceSwipeListProps>;
|
|
1701
|
+
|
|
1702
|
+
export declare interface NiceSwipeListProps {
|
|
1703
|
+
children: ReactNode;
|
|
1704
|
+
className?: string;
|
|
1705
|
+
style?: CSSProperties;
|
|
1706
|
+
}
|
|
1707
|
+
|
|
1708
|
+
/**
|
|
1709
|
+
* iOS-style action sheet
|
|
1710
|
+
*
|
|
1711
|
+
* @example
|
|
1712
|
+
* ```tsx
|
|
1713
|
+
* <NiceActionSheet
|
|
1714
|
+
* open={showSheet}
|
|
1715
|
+
* onClose={() => setShowSheet(false)}
|
|
1716
|
+
* title="Choose an action"
|
|
1717
|
+
* items={[
|
|
1718
|
+
* { id: 'share', label: 'Share', icon: '🔗' },
|
|
1719
|
+
* { id: 'save', label: 'Save to Photos', icon: '📷' },
|
|
1720
|
+
* { id: 'delete', label: 'Delete', danger: true }
|
|
1721
|
+
* ]}
|
|
1722
|
+
* />
|
|
1723
|
+
* ```
|
|
1724
|
+
*/
|
|
1725
|
+
export declare const NiceTouchActionSheet: default_2.ForwardRefExoticComponent<NiceTouchActionSheetProps & default_2.RefAttributes<HTMLDivElement>>;
|
|
1726
|
+
|
|
1727
|
+
/**
|
|
1728
|
+
* Action sheet props
|
|
1729
|
+
*/
|
|
1730
|
+
export declare interface NiceTouchActionSheetProps extends HTMLAttributes<HTMLDivElement> {
|
|
1731
|
+
/** Sheet items */
|
|
1732
|
+
items: TouchMenuItem[];
|
|
1733
|
+
/** Open state */
|
|
1734
|
+
open: boolean;
|
|
1735
|
+
/** Close handler */
|
|
1736
|
+
onClose: () => void;
|
|
1737
|
+
/** Title */
|
|
1738
|
+
title?: string;
|
|
1739
|
+
/** Cancel button label */
|
|
1740
|
+
cancelLabel?: string;
|
|
1741
|
+
/** Enable haptic feedback */
|
|
1742
|
+
haptic?: boolean;
|
|
1743
|
+
}
|
|
1744
|
+
|
|
1745
|
+
/**
|
|
1746
|
+
* Touch-friendly button with 44px minimum touch target
|
|
1747
|
+
*
|
|
1748
|
+
* @example
|
|
1749
|
+
* ```tsx
|
|
1750
|
+
* // Basic usage
|
|
1751
|
+
* <NiceTouchButton variant="primary" size="lg">
|
|
1752
|
+
* Click Me
|
|
1753
|
+
* </NiceTouchButton>
|
|
1754
|
+
*
|
|
1755
|
+
* // With icons
|
|
1756
|
+
* <NiceTouchButton
|
|
1757
|
+
* leftIcon={<SaveIcon />}
|
|
1758
|
+
* variant="success"
|
|
1759
|
+
* >
|
|
1760
|
+
* Save
|
|
1761
|
+
* </NiceTouchButton>
|
|
1762
|
+
*
|
|
1763
|
+
* // Icon only
|
|
1764
|
+
* <NiceTouchButton
|
|
1765
|
+
* iconOnly
|
|
1766
|
+
* shape="circle"
|
|
1767
|
+
* leftIcon={<PlusIcon />}
|
|
1768
|
+
* aria-label="Add item"
|
|
1769
|
+
* />
|
|
1770
|
+
*
|
|
1771
|
+
* // Loading state
|
|
1772
|
+
* <NiceTouchButton loading>
|
|
1773
|
+
* Processing...
|
|
1774
|
+
* </NiceTouchButton>
|
|
1775
|
+
* ```
|
|
1776
|
+
*/
|
|
1777
|
+
export declare const NiceTouchButton: default_2.ForwardRefExoticComponent<NiceTouchButtonProps & default_2.RefAttributes<HTMLButtonElement>>;
|
|
1778
|
+
|
|
1779
|
+
/**
|
|
1780
|
+
* Main props
|
|
1781
|
+
*/
|
|
1782
|
+
export declare interface NiceTouchButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
1783
|
+
/** Visual variant */
|
|
1784
|
+
variant?: TouchButtonVariant;
|
|
1785
|
+
/** Size (all meet 44px minimum) */
|
|
1786
|
+
size?: TouchButtonSize;
|
|
1787
|
+
/** Shape */
|
|
1788
|
+
shape?: TouchButtonShape;
|
|
1789
|
+
/** Full width */
|
|
1790
|
+
fullWidth?: boolean;
|
|
1791
|
+
/** Loading state */
|
|
1792
|
+
loading?: boolean;
|
|
1793
|
+
/** Left icon */
|
|
1794
|
+
leftIcon?: ReactNode;
|
|
1795
|
+
/** Right icon */
|
|
1796
|
+
rightIcon?: ReactNode;
|
|
1797
|
+
/** Icon only (no text) */
|
|
1798
|
+
iconOnly?: boolean;
|
|
1799
|
+
/** Enable haptic feedback */
|
|
1800
|
+
haptic?: boolean;
|
|
1801
|
+
/** Haptic intensity */
|
|
1802
|
+
hapticIntensity?: 'light' | 'medium' | 'heavy';
|
|
1803
|
+
/** Show press ripple effect */
|
|
1804
|
+
ripple?: boolean;
|
|
1805
|
+
/** Active/pressed state */
|
|
1806
|
+
active?: boolean;
|
|
1807
|
+
/** Children */
|
|
1808
|
+
children?: ReactNode;
|
|
1809
|
+
}
|
|
1810
|
+
|
|
1811
|
+
/**
|
|
1812
|
+
* Touch-optimized HSL color picker wheel
|
|
1813
|
+
*
|
|
1814
|
+
* @example
|
|
1815
|
+
* ```tsx
|
|
1816
|
+
* // Basic usage
|
|
1817
|
+
* <NiceTouchColorPicker
|
|
1818
|
+
* value={color}
|
|
1819
|
+
* onChange={setColor}
|
|
1820
|
+
* />
|
|
1821
|
+
*
|
|
1822
|
+
* // With presets
|
|
1823
|
+
* <NiceTouchColorPicker
|
|
1824
|
+
* presetColors={['#ff0000', '#00ff00', '#0000ff']}
|
|
1825
|
+
* showInput
|
|
1826
|
+
* showPreview
|
|
1827
|
+
* />
|
|
1828
|
+
* ```
|
|
1829
|
+
*/
|
|
1830
|
+
export declare const NiceTouchColorPicker: default_2.ForwardRefExoticComponent<NiceTouchColorPickerProps & default_2.RefAttributes<HTMLDivElement>>;
|
|
1831
|
+
|
|
1832
|
+
/**
|
|
1833
|
+
* Main props
|
|
1834
|
+
*/
|
|
1835
|
+
export declare interface NiceTouchColorPickerProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
|
|
1836
|
+
/** Current color (hex string) */
|
|
1837
|
+
value?: string;
|
|
1838
|
+
/** Default color */
|
|
1839
|
+
defaultValue?: string;
|
|
1840
|
+
/** Color format for output */
|
|
1841
|
+
format?: ColorFormat;
|
|
1842
|
+
/** Show alpha slider */
|
|
1843
|
+
showAlpha?: boolean;
|
|
1844
|
+
/** Show color preview */
|
|
1845
|
+
showPreview?: boolean;
|
|
1846
|
+
/** Show hex input */
|
|
1847
|
+
showInput?: boolean;
|
|
1848
|
+
/** Show preset colors */
|
|
1849
|
+
presetColors?: string[];
|
|
1850
|
+
/** Wheel size */
|
|
1851
|
+
wheelSize?: number;
|
|
1852
|
+
/** Enable haptic feedback */
|
|
1853
|
+
haptic?: boolean;
|
|
1854
|
+
/** Change callback */
|
|
1855
|
+
onChange?: (color: string) => void;
|
|
1856
|
+
/** Preset label */
|
|
1857
|
+
presetLabel?: string;
|
|
1858
|
+
}
|
|
1859
|
+
|
|
1860
|
+
/**
|
|
1861
|
+
* Touch-optimized drawing canvas
|
|
1862
|
+
*
|
|
1863
|
+
* @example
|
|
1864
|
+
* ```tsx
|
|
1865
|
+
* // Basic finger painting
|
|
1866
|
+
* const drawingRef = useRef<TouchDrawingRef>(null);
|
|
1867
|
+
*
|
|
1868
|
+
* <NiceTouchDrawing
|
|
1869
|
+
* ref={drawingRef}
|
|
1870
|
+
* width={400}
|
|
1871
|
+
* height={300}
|
|
1872
|
+
* strokeColor="#ff5722"
|
|
1873
|
+
* strokeWidth={8}
|
|
1874
|
+
* tool="brush"
|
|
1875
|
+
* />
|
|
1876
|
+
*
|
|
1877
|
+
* // Get image
|
|
1878
|
+
* const imageUrl = drawingRef.current?.toDataURL();
|
|
1879
|
+
*
|
|
1880
|
+
* // Undo
|
|
1881
|
+
* drawingRef.current?.undo();
|
|
1882
|
+
* ```
|
|
1883
|
+
*/
|
|
1884
|
+
export declare const NiceTouchDrawing: default_2.ForwardRefExoticComponent<NiceTouchDrawingProps & default_2.RefAttributes<TouchDrawingRef>>;
|
|
1885
|
+
|
|
1886
|
+
/**
|
|
1887
|
+
* Main props
|
|
1888
|
+
*/
|
|
1889
|
+
export declare interface NiceTouchDrawingProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
1890
|
+
/** Canvas width */
|
|
1891
|
+
width?: number | string;
|
|
1892
|
+
/** Canvas height */
|
|
1893
|
+
height?: number | string;
|
|
1894
|
+
/** Initial background color */
|
|
1895
|
+
backgroundColor?: string;
|
|
1896
|
+
/** Current stroke color */
|
|
1897
|
+
strokeColor?: string;
|
|
1898
|
+
/** Current stroke width */
|
|
1899
|
+
strokeWidth?: number;
|
|
1900
|
+
/** Current tool */
|
|
1901
|
+
tool?: DrawingTool;
|
|
1902
|
+
/** Line cap style */
|
|
1903
|
+
lineCap?: LineCap;
|
|
1904
|
+
/** Opacity (0-1) */
|
|
1905
|
+
opacity?: number;
|
|
1906
|
+
/** Enable pen pressure */
|
|
1907
|
+
penPressure?: boolean;
|
|
1908
|
+
/** Enable haptic feedback */
|
|
1909
|
+
haptic?: boolean;
|
|
1910
|
+
/** Max undo history */
|
|
1911
|
+
maxHistory?: number;
|
|
1912
|
+
/** Disable input */
|
|
1913
|
+
disabled?: boolean;
|
|
1914
|
+
/** Callback on change */
|
|
1915
|
+
onChange?: () => void;
|
|
1916
|
+
/** Callback on tool change */
|
|
1917
|
+
onToolChange?: (tool: DrawingTool) => void;
|
|
1918
|
+
}
|
|
1919
|
+
|
|
1920
|
+
/**
|
|
1921
|
+
* Touch-optimized form field
|
|
1922
|
+
*/
|
|
1923
|
+
export declare const NiceTouchField: default_2.ForwardRefExoticComponent<NiceTouchFieldProps & default_2.RefAttributes<HTMLDivElement>>;
|
|
1924
|
+
|
|
1925
|
+
/**
|
|
1926
|
+
* Touch field props
|
|
1927
|
+
*/
|
|
1928
|
+
export declare interface NiceTouchFieldProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
1929
|
+
/** Field name */
|
|
1930
|
+
name: string;
|
|
1931
|
+
/** Field label */
|
|
1932
|
+
label?: string;
|
|
1933
|
+
/** Input type */
|
|
1934
|
+
type?: 'text' | 'email' | 'password' | 'tel' | 'number' | 'url' | 'search' | 'date' | 'time' | 'datetime-local';
|
|
1935
|
+
/** Placeholder */
|
|
1936
|
+
placeholder?: string;
|
|
1937
|
+
/** Helper text */
|
|
1938
|
+
helperText?: string;
|
|
1939
|
+
/** Disabled */
|
|
1940
|
+
disabled?: boolean;
|
|
1941
|
+
/** Read only */
|
|
1942
|
+
readOnly?: boolean;
|
|
1943
|
+
/** Auto-complete */
|
|
1944
|
+
autoComplete?: string;
|
|
1945
|
+
/** Input mode */
|
|
1946
|
+
inputMode?: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';
|
|
1947
|
+
/** Icon left */
|
|
1948
|
+
iconLeft?: ReactNode;
|
|
1949
|
+
/** Icon right */
|
|
1950
|
+
iconRight?: ReactNode;
|
|
1951
|
+
/** Max length */
|
|
1952
|
+
maxLength?: number;
|
|
1953
|
+
/** On change callback */
|
|
1954
|
+
onChange?: (value: string) => void;
|
|
1955
|
+
/** Required indicator */
|
|
1956
|
+
required?: boolean;
|
|
1957
|
+
}
|
|
1958
|
+
|
|
1959
|
+
/**
|
|
1960
|
+
* Touch-optimized form container
|
|
1961
|
+
*
|
|
1962
|
+
* @example
|
|
1963
|
+
* ```tsx
|
|
1964
|
+
* <NiceTouchForm
|
|
1965
|
+
* initialValues={{ email: '', password: '' }}
|
|
1966
|
+
* validation={{
|
|
1967
|
+
* email: [
|
|
1968
|
+
* { type: 'required', message: 'Email is required' },
|
|
1969
|
+
* { type: 'email', message: 'Invalid email format' }
|
|
1970
|
+
* ],
|
|
1971
|
+
* password: [
|
|
1972
|
+
* { type: 'required', message: 'Password is required' },
|
|
1973
|
+
* { type: 'minLength', value: 8, message: 'Min 8 characters' }
|
|
1974
|
+
* ]
|
|
1975
|
+
* }}
|
|
1976
|
+
* onSubmit={(values) => login(values)}
|
|
1977
|
+
* enableNavigation
|
|
1978
|
+
* >
|
|
1979
|
+
* <NiceTouchField name="email" label="Email" type="email" />
|
|
1980
|
+
* <NiceTouchField name="password" label="Password" type="password" />
|
|
1981
|
+
* <NiceTouchSubmit>Login</NiceTouchSubmit>
|
|
1982
|
+
* </NiceTouchForm>
|
|
1983
|
+
* ```
|
|
1984
|
+
*/
|
|
1985
|
+
export declare const NiceTouchForm: default_2.ForwardRefExoticComponent<NiceTouchFormProps & default_2.RefAttributes<HTMLFormElement>>;
|
|
1986
|
+
|
|
1987
|
+
/**
|
|
1988
|
+
* Main form props
|
|
1989
|
+
*/
|
|
1990
|
+
export declare interface NiceTouchFormProps extends Omit<HTMLAttributes<HTMLFormElement>, 'onSubmit' | 'onChange' | 'onError'> {
|
|
1991
|
+
/** Initial form values */
|
|
1992
|
+
initialValues?: Record<string, any>;
|
|
1993
|
+
/** Validation rules per field */
|
|
1994
|
+
validation?: Record<string, TouchFormValidationRule[]>;
|
|
1995
|
+
/** Submit handler */
|
|
1996
|
+
onSubmit?: (values: Record<string, any>) => void | Promise<void>;
|
|
1997
|
+
/** Change handler */
|
|
1998
|
+
onChange?: (values: Record<string, any>) => void;
|
|
1999
|
+
/** Error handler */
|
|
2000
|
+
onError?: (errors: TouchFormFieldError[]) => void;
|
|
2001
|
+
/** Enable field navigation */
|
|
2002
|
+
enableNavigation?: boolean;
|
|
2003
|
+
/** Enable haptic feedback */
|
|
2004
|
+
haptic?: boolean;
|
|
2005
|
+
/** Auto-focus first field */
|
|
2006
|
+
autoFocus?: boolean;
|
|
2007
|
+
/** Show validation on blur */
|
|
2008
|
+
validateOnBlur?: boolean;
|
|
2009
|
+
/** Show validation on change */
|
|
2010
|
+
validateOnChange?: boolean;
|
|
2011
|
+
/** Disable form */
|
|
2012
|
+
disabled?: boolean;
|
|
2013
|
+
}
|
|
2014
|
+
|
|
2015
|
+
/**
|
|
2016
|
+
* Icon button with 44px minimum touch target
|
|
2017
|
+
*/
|
|
2018
|
+
export declare const NiceTouchIconButton: default_2.ForwardRefExoticComponent<Omit<NiceTouchButtonProps, "children" | "leftIcon" | "iconOnly"> & {
|
|
2019
|
+
icon: ReactNode;
|
|
2020
|
+
} & default_2.RefAttributes<HTMLButtonElement>>;
|
|
2021
|
+
|
|
2022
|
+
export declare const NiceTouchKeyboard: default_2.ForwardRefExoticComponent<NiceTouchKeyboardProps & default_2.RefAttributes<HTMLDivElement>>;
|
|
2023
|
+
|
|
2024
|
+
export declare interface NiceTouchKeyboardProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'onSubmit' | 'onKeyPress'> {
|
|
2025
|
+
/** Keyboard layout type */
|
|
2026
|
+
layout?: KeyboardLayout;
|
|
2027
|
+
/** Custom layout definition */
|
|
2028
|
+
customLayout?: CustomLayout;
|
|
2029
|
+
/** Display mode: minimal | compact | standard | full */
|
|
2030
|
+
mode?: KeyboardMode;
|
|
2031
|
+
/** Language(s) to support — pass multiple for language switching */
|
|
2032
|
+
languages?: KeyboardLanguage[];
|
|
2033
|
+
/** Active language (controlled) */
|
|
2034
|
+
activeLanguage?: KeyboardLanguage;
|
|
2035
|
+
/** Language change callback */
|
|
2036
|
+
onLanguageChange?: (lang: KeyboardLanguage) => void;
|
|
2037
|
+
/** Current value */
|
|
2038
|
+
value?: string;
|
|
2039
|
+
/** Max length */
|
|
2040
|
+
maxLength?: number;
|
|
2041
|
+
/** Keyboard theme */
|
|
2042
|
+
theme?: KeyboardTheme;
|
|
2043
|
+
/** Enable haptic feedback */
|
|
2044
|
+
haptic?: boolean;
|
|
2045
|
+
/** Enable sound feedback */
|
|
2046
|
+
sound?: boolean;
|
|
2047
|
+
/** Key press callback */
|
|
2048
|
+
onKeyPress?: (key: string) => void;
|
|
2049
|
+
/** Value change callback */
|
|
2050
|
+
onChange?: (value: string) => void;
|
|
2051
|
+
/** Enter/submit callback */
|
|
2052
|
+
onSubmit?: (value: string) => void;
|
|
2053
|
+
/** Disabled state */
|
|
2054
|
+
disabled?: boolean;
|
|
2055
|
+
/** Show value preview */
|
|
2056
|
+
showPreview?: boolean;
|
|
2057
|
+
/** Preview placeholder */
|
|
2058
|
+
previewPlaceholder?: string;
|
|
2059
|
+
/** Mask input (for PIN) */
|
|
2060
|
+
masked?: boolean;
|
|
2061
|
+
/** Show language switcher */
|
|
2062
|
+
showLanguageSwitcher?: boolean;
|
|
2063
|
+
/** Enter key label override */
|
|
2064
|
+
enterLabel?: string;
|
|
2065
|
+
}
|
|
2066
|
+
|
|
2067
|
+
/**
|
|
2068
|
+
* Touch-optimized context menu
|
|
2069
|
+
*
|
|
2070
|
+
* @example
|
|
2071
|
+
* ```tsx
|
|
2072
|
+
* // Long-press menu
|
|
2073
|
+
* <NiceTouchMenu
|
|
2074
|
+
* trigger={<div>Long press me</div>}
|
|
2075
|
+
* longPress
|
|
2076
|
+
* items={[
|
|
2077
|
+
* { id: 'copy', label: 'Copy', icon: '📋' },
|
|
2078
|
+
* { id: 'paste', label: 'Paste', icon: '📄' },
|
|
2079
|
+
* { id: 'delete', label: 'Delete', icon: '🗑️', danger: true }
|
|
2080
|
+
* ]}
|
|
2081
|
+
* />
|
|
2082
|
+
*
|
|
2083
|
+
* // Click menu
|
|
2084
|
+
* <NiceTouchMenu
|
|
2085
|
+
* trigger={<button>Options ▾</button>}
|
|
2086
|
+
* onClick
|
|
2087
|
+
* items={menuItems}
|
|
2088
|
+
* />
|
|
2089
|
+
* ```
|
|
2090
|
+
*/
|
|
2091
|
+
export declare const NiceTouchMenu: default_2.ForwardRefExoticComponent<NiceTouchMenuProps & default_2.RefAttributes<HTMLDivElement>>;
|
|
2092
|
+
|
|
2093
|
+
/**
|
|
2094
|
+
* Standalone menu popover
|
|
2095
|
+
*/
|
|
2096
|
+
export declare const NiceTouchMenuPopover: default_2.ForwardRefExoticComponent<NiceTouchMenuPopoverProps & default_2.RefAttributes<HTMLDivElement>>;
|
|
2097
|
+
|
|
2098
|
+
/**
|
|
2099
|
+
* Popover menu props (standalone)
|
|
2100
|
+
*/
|
|
2101
|
+
export declare interface NiceTouchMenuPopoverProps extends HTMLAttributes<HTMLDivElement> {
|
|
2102
|
+
/** Menu items */
|
|
2103
|
+
items: TouchMenuItem[];
|
|
2104
|
+
/** Open state */
|
|
2105
|
+
open: boolean;
|
|
2106
|
+
/** Position */
|
|
2107
|
+
position: MenuPosition;
|
|
2108
|
+
/** Close handler */
|
|
2109
|
+
onClose: () => void;
|
|
2110
|
+
/** Enable haptic feedback */
|
|
2111
|
+
haptic?: boolean;
|
|
2112
|
+
}
|
|
2113
|
+
|
|
2114
|
+
/**
|
|
2115
|
+
* Main props
|
|
2116
|
+
*/
|
|
2117
|
+
export declare interface NiceTouchMenuProps extends Omit<HTMLAttributes<HTMLDivElement>, 'contextMenu' | 'onClick'> {
|
|
2118
|
+
/** Menu items */
|
|
2119
|
+
items: TouchMenuItem[];
|
|
2120
|
+
/** Trigger element */
|
|
2121
|
+
trigger: ReactNode;
|
|
2122
|
+
/** Trigger on long press */
|
|
2123
|
+
longPress?: boolean;
|
|
2124
|
+
/** Long press delay (ms) */
|
|
2125
|
+
longPressDelay?: number;
|
|
2126
|
+
/** Trigger on right click */
|
|
2127
|
+
enableContextMenu?: boolean;
|
|
2128
|
+
/** Trigger on click */
|
|
2129
|
+
enableClick?: boolean;
|
|
2130
|
+
/** Enable haptic feedback */
|
|
2131
|
+
haptic?: boolean;
|
|
2132
|
+
/** Disabled state */
|
|
2133
|
+
disabled?: boolean;
|
|
2134
|
+
/** Callback when menu opens */
|
|
2135
|
+
onOpen?: () => void;
|
|
2136
|
+
/** Callback when menu closes */
|
|
2137
|
+
onClose?: () => void;
|
|
2138
|
+
}
|
|
2139
|
+
|
|
2140
|
+
/**
|
|
2141
|
+
* Field navigation bar (Prev/Next/Done)
|
|
2142
|
+
*/
|
|
2143
|
+
export declare const NiceTouchNavBar: default_2.ForwardRefExoticComponent<NiceTouchNavBarProps & default_2.RefAttributes<HTMLDivElement>>;
|
|
2144
|
+
|
|
2145
|
+
/**
|
|
2146
|
+
* Navigation bar above keyboard
|
|
2147
|
+
*/
|
|
2148
|
+
export declare interface NiceTouchNavBarProps extends HTMLAttributes<HTMLDivElement> {
|
|
2149
|
+
/** Done button text */
|
|
2150
|
+
doneText?: string;
|
|
2151
|
+
/** Show done button */
|
|
2152
|
+
showDone?: boolean;
|
|
2153
|
+
/** Done click handler */
|
|
2154
|
+
onDone?: () => void;
|
|
2155
|
+
}
|
|
2156
|
+
|
|
2157
|
+
/**
|
|
2158
|
+
* Touch-optimized range slider
|
|
2159
|
+
*
|
|
2160
|
+
* @example
|
|
2161
|
+
* ```tsx
|
|
2162
|
+
* // Basic slider
|
|
2163
|
+
* <NiceTouchSlider
|
|
2164
|
+
* min={0}
|
|
2165
|
+
* max={100}
|
|
2166
|
+
* value={volume}
|
|
2167
|
+
* onChange={setVolume}
|
|
2168
|
+
* />
|
|
2169
|
+
*
|
|
2170
|
+
* // Range slider
|
|
2171
|
+
* <NiceTouchSlider
|
|
2172
|
+
* min={0}
|
|
2173
|
+
* max={1000}
|
|
2174
|
+
* value={[minPrice, maxPrice]}
|
|
2175
|
+
* onChange={([min, max]) => setPriceRange(min, max)}
|
|
2176
|
+
* formatLabel={(v) => `$${v}`}
|
|
2177
|
+
* />
|
|
2178
|
+
*
|
|
2179
|
+
* // With marks
|
|
2180
|
+
* <NiceTouchSlider
|
|
2181
|
+
* min={0}
|
|
2182
|
+
* max={100}
|
|
2183
|
+
* step={10}
|
|
2184
|
+
* marks
|
|
2185
|
+
* labelDisplay="on"
|
|
2186
|
+
* />
|
|
2187
|
+
* ```
|
|
2188
|
+
*/
|
|
2189
|
+
export declare const NiceTouchSlider: default_2.ForwardRefExoticComponent<NiceTouchSliderProps & default_2.RefAttributes<HTMLDivElement>>;
|
|
2190
|
+
|
|
2191
|
+
/**
|
|
2192
|
+
* Main props
|
|
2193
|
+
*/
|
|
2194
|
+
export declare interface NiceTouchSliderProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
|
|
2195
|
+
/** Current value (controlled) */
|
|
2196
|
+
value?: number | [number, number];
|
|
2197
|
+
/** Default value (uncontrolled) */
|
|
2198
|
+
defaultValue?: number | [number, number];
|
|
2199
|
+
/** Minimum value */
|
|
2200
|
+
min?: number;
|
|
2201
|
+
/** Maximum value */
|
|
2202
|
+
max?: number;
|
|
2203
|
+
/** Step increment */
|
|
2204
|
+
step?: number;
|
|
2205
|
+
/** Orientation */
|
|
2206
|
+
orientation?: SliderOrientation;
|
|
2207
|
+
/** Disabled state */
|
|
2208
|
+
disabled?: boolean;
|
|
2209
|
+
/** Show marks */
|
|
2210
|
+
marks?: boolean | SliderMark[];
|
|
2211
|
+
/** Mark step (auto-generate marks) */
|
|
2212
|
+
markStep?: number;
|
|
2213
|
+
/** Show value label on thumb */
|
|
2214
|
+
labelDisplay?: LabelDisplay;
|
|
2215
|
+
/** Format label value */
|
|
2216
|
+
formatLabel?: (value: number) => string;
|
|
2217
|
+
/** Show min/max values */
|
|
2218
|
+
showRange?: boolean;
|
|
2219
|
+
/** Track color (CSS color) */
|
|
2220
|
+
trackColor?: string;
|
|
2221
|
+
/** Filled track color */
|
|
2222
|
+
fillColor?: string;
|
|
2223
|
+
/** Thumb size in px */
|
|
2224
|
+
thumbSize?: number;
|
|
2225
|
+
/** Track height in px */
|
|
2226
|
+
trackHeight?: number;
|
|
2227
|
+
/** Enable haptic feedback */
|
|
2228
|
+
haptic?: boolean;
|
|
2229
|
+
/** Snap to marks only */
|
|
2230
|
+
snapToMarks?: boolean;
|
|
2231
|
+
/** Change callback */
|
|
2232
|
+
onChange?: (value: number | [number, number]) => void;
|
|
2233
|
+
/** Change committed callback (on release) */
|
|
2234
|
+
onChangeCommitted?: (value: number | [number, number]) => void;
|
|
2235
|
+
/** Accessibility label */
|
|
2236
|
+
'aria-label'?: string;
|
|
2237
|
+
/** Accessibility label for range slider */
|
|
2238
|
+
'aria-labelledby'?: string;
|
|
2239
|
+
}
|
|
2240
|
+
|
|
2241
|
+
/**
|
|
2242
|
+
* Touch-optimized submit button
|
|
2243
|
+
*/
|
|
2244
|
+
export declare const NiceTouchSubmit: default_2.ForwardRefExoticComponent<NiceTouchSubmitProps & default_2.RefAttributes<HTMLButtonElement>>;
|
|
2245
|
+
|
|
2246
|
+
/**
|
|
2247
|
+
* Submit button props
|
|
2248
|
+
*/
|
|
2249
|
+
export declare interface NiceTouchSubmitProps extends HTMLAttributes<HTMLButtonElement> {
|
|
2250
|
+
/** Loading state */
|
|
2251
|
+
loading?: boolean;
|
|
2252
|
+
/** Disabled state */
|
|
2253
|
+
disabled?: boolean;
|
|
2254
|
+
/** Full width */
|
|
2255
|
+
fullWidth?: boolean;
|
|
2256
|
+
}
|
|
2257
|
+
|
|
2258
|
+
/**
|
|
2259
|
+
* Touch-optimized table with horizontal scroll and swipe actions
|
|
2260
|
+
*
|
|
2261
|
+
* @example
|
|
2262
|
+
* ```tsx
|
|
2263
|
+
* // Basic table
|
|
2264
|
+
* <NiceTouchTable
|
|
2265
|
+
* data={users}
|
|
2266
|
+
* rowKey="id"
|
|
2267
|
+
* columns={[
|
|
2268
|
+
* { id: 'name', header: 'Name', accessor: 'name', sticky: true },
|
|
2269
|
+
* { id: 'email', header: 'Email', accessor: 'email', minWidth: 200 },
|
|
2270
|
+
* { id: 'role', header: 'Role', accessor: 'role' }
|
|
2271
|
+
* ]}
|
|
2272
|
+
* />
|
|
2273
|
+
*
|
|
2274
|
+
* // With swipe actions
|
|
2275
|
+
* <NiceTouchTable
|
|
2276
|
+
* data={items}
|
|
2277
|
+
* rowKey="id"
|
|
2278
|
+
* columns={columns}
|
|
2279
|
+
* swipeActionsRight={[
|
|
2280
|
+
* {
|
|
2281
|
+
* id: 'delete',
|
|
2282
|
+
* label: 'Delete',
|
|
2283
|
+
* icon: '🗑️',
|
|
2284
|
+
* color: 'var(--color-error, #ef4444)',
|
|
2285
|
+
* onAction: (row) => handleDelete(row.id)
|
|
2286
|
+
* }
|
|
2287
|
+
* ]}
|
|
2288
|
+
* />
|
|
2289
|
+
* ```
|
|
2290
|
+
*/
|
|
2291
|
+
export declare const NiceTouchTable: <T>(props: NiceTouchTableProps<T> & {
|
|
2292
|
+
ref?: default_2.ForwardedRef<HTMLDivElement>;
|
|
2293
|
+
}) => default_2.ReactElement;
|
|
2294
|
+
|
|
2295
|
+
/**
|
|
2296
|
+
* Main props
|
|
2297
|
+
*/
|
|
2298
|
+
export declare interface NiceTouchTableProps<T = any> extends Omit<HTMLAttributes<HTMLDivElement>, 'onSelect'> {
|
|
2299
|
+
/** Table data */
|
|
2300
|
+
data: T[];
|
|
2301
|
+
/** Column definitions */
|
|
2302
|
+
columns: TouchTableColumn<T>[];
|
|
2303
|
+
/** Row key accessor */
|
|
2304
|
+
rowKey: keyof T | ((row: T) => string | number);
|
|
2305
|
+
/** Left swipe actions */
|
|
2306
|
+
swipeActionsLeft?: TouchTableSwipeAction<T>[];
|
|
2307
|
+
/** Right swipe actions */
|
|
2308
|
+
swipeActionsRight?: TouchTableSwipeAction<T>[];
|
|
2309
|
+
/** Enable row selection */
|
|
2310
|
+
selectable?: boolean;
|
|
2311
|
+
/** Selected row keys */
|
|
2312
|
+
selectedKeys?: (string | number)[];
|
|
2313
|
+
/** Selection change handler */
|
|
2314
|
+
onSelect?: (keys: (string | number)[]) => void;
|
|
2315
|
+
/** Row click handler */
|
|
2316
|
+
onRowClick?: (row: T, rowIndex: number) => void;
|
|
2317
|
+
/** Sort state */
|
|
2318
|
+
sortState?: SortState;
|
|
2319
|
+
/** Sort change handler */
|
|
2320
|
+
onSort?: (state: SortState) => void;
|
|
2321
|
+
/** Empty state content */
|
|
2322
|
+
emptyContent?: ReactNode;
|
|
2323
|
+
/** Loading state */
|
|
2324
|
+
loading?: boolean;
|
|
2325
|
+
/** Enable haptic feedback */
|
|
2326
|
+
haptic?: boolean;
|
|
2327
|
+
/** Swipe threshold (px) */
|
|
2328
|
+
swipeThreshold?: number;
|
|
2329
|
+
}
|
|
2330
|
+
|
|
2331
|
+
/**
|
|
2332
|
+
* Orientation type
|
|
2333
|
+
*/
|
|
2334
|
+
export declare type Orientation = 'portrait' | 'landscape';
|
|
2335
|
+
|
|
2336
|
+
/**
|
|
2337
|
+
* Pan gesture event
|
|
2338
|
+
*/
|
|
2339
|
+
export declare interface PanEvent {
|
|
2340
|
+
translation: Point;
|
|
2341
|
+
delta: Point;
|
|
2342
|
+
velocity: Point;
|
|
2343
|
+
center: Point;
|
|
2344
|
+
direction: 'left' | 'right' | 'up' | 'down' | null;
|
|
2345
|
+
}
|
|
2346
|
+
|
|
2347
|
+
/**
|
|
2348
|
+
* Column configuration
|
|
2349
|
+
*/
|
|
2350
|
+
export declare interface PickerColumn<T = unknown> {
|
|
2351
|
+
id: string;
|
|
2352
|
+
items: PickerItem<T>[];
|
|
2353
|
+
width?: number | string;
|
|
2354
|
+
label?: string;
|
|
2355
|
+
}
|
|
2356
|
+
|
|
2357
|
+
/**
|
|
2358
|
+
* Picker item
|
|
2359
|
+
*/
|
|
2360
|
+
export declare interface PickerItem<T = unknown> {
|
|
2361
|
+
value: T;
|
|
2362
|
+
label: string;
|
|
2363
|
+
disabled?: boolean;
|
|
2364
|
+
}
|
|
2365
|
+
|
|
2366
|
+
/**
|
|
2367
|
+
* Pinch gesture event
|
|
2368
|
+
*/
|
|
2369
|
+
export declare interface PinchEvent {
|
|
2370
|
+
scale: number;
|
|
2371
|
+
deltaScale: number;
|
|
2372
|
+
center: Point;
|
|
2373
|
+
distance: number;
|
|
2374
|
+
initialDistance: number;
|
|
2375
|
+
}
|
|
2376
|
+
|
|
2377
|
+
/**
|
|
2378
|
+
* Point in 2D space
|
|
2379
|
+
*/
|
|
2380
|
+
export declare interface Point {
|
|
2381
|
+
x: number;
|
|
2382
|
+
y: number;
|
|
2383
|
+
}
|
|
2384
|
+
|
|
2385
|
+
export declare interface PullToRefreshConfig {
|
|
2386
|
+
/** Distance in px to trigger refresh */
|
|
2387
|
+
threshold: number;
|
|
2388
|
+
/** Maximum pull distance in px */
|
|
2389
|
+
maxPull: number;
|
|
2390
|
+
/** Resistance factor (0-1, higher = harder to pull) */
|
|
2391
|
+
resistance: number;
|
|
2392
|
+
/** Duration to show success/error state in ms */
|
|
2393
|
+
completionDuration: number;
|
|
2394
|
+
/** Enable haptic feedback on supported devices */
|
|
2395
|
+
hapticFeedback: boolean;
|
|
2396
|
+
/** Disable pull-to-refresh */
|
|
2397
|
+
disabled: boolean;
|
|
2398
|
+
}
|
|
2399
|
+
|
|
2400
|
+
declare interface PullToRefreshContextValue {
|
|
2401
|
+
state: RefreshState;
|
|
2402
|
+
progress: number;
|
|
2403
|
+
isRefreshing: boolean;
|
|
2404
|
+
triggerRefresh: () => Promise<void>;
|
|
2405
|
+
}
|
|
2406
|
+
|
|
2407
|
+
export declare const PullToRefreshDefaultIndicator: default_2.FC<PullToRefreshIndicatorProps>;
|
|
2408
|
+
|
|
2409
|
+
export declare interface PullToRefreshIndicatorProps {
|
|
2410
|
+
state: RefreshState;
|
|
2411
|
+
progress: number;
|
|
2412
|
+
pullDistance: number;
|
|
2413
|
+
threshold: number;
|
|
2414
|
+
}
|
|
2415
|
+
|
|
2416
|
+
export declare type RefreshState = 'idle' | 'pulling' | 'ready' | 'refreshing' | 'success' | 'error';
|
|
2417
|
+
|
|
2418
|
+
/**
|
|
2419
|
+
* Create responsive object from breakpoint values
|
|
2420
|
+
*/
|
|
2421
|
+
export declare function responsive<T>(values: Partial<Record<BreakpointName | 'base', T>>): ResponsiveValue<T>;
|
|
2422
|
+
|
|
2423
|
+
/**
|
|
2424
|
+
* Responsive value object
|
|
2425
|
+
*/
|
|
2426
|
+
export declare type ResponsiveValue<T> = {
|
|
2427
|
+
base?: T;
|
|
2428
|
+
xs?: T;
|
|
2429
|
+
sm?: T;
|
|
2430
|
+
md?: T;
|
|
2431
|
+
lg?: T;
|
|
2432
|
+
xl?: T;
|
|
2433
|
+
'2xl'?: T;
|
|
2434
|
+
};
|
|
2435
|
+
|
|
2436
|
+
/**
|
|
2437
|
+
* RGB color
|
|
2438
|
+
*/
|
|
2439
|
+
declare interface RGBColor {
|
|
2440
|
+
r: number;
|
|
2441
|
+
g: number;
|
|
2442
|
+
b: number;
|
|
2443
|
+
}
|
|
2444
|
+
|
|
2445
|
+
declare function rgbToHex(r: number, g: number, b: number): string;
|
|
2446
|
+
|
|
2447
|
+
declare function rgbToHsl(r: number, g: number, b: number): HSLColor;
|
|
2448
|
+
|
|
2449
|
+
/**
|
|
2450
|
+
* Rotate gesture event
|
|
2451
|
+
*/
|
|
2452
|
+
export declare interface RotateEvent {
|
|
2453
|
+
rotation: number;
|
|
2454
|
+
deltaRotation: number;
|
|
2455
|
+
center: Point;
|
|
2456
|
+
}
|
|
2457
|
+
|
|
2458
|
+
/**
|
|
2459
|
+
* Screen info
|
|
2460
|
+
*/
|
|
2461
|
+
export declare interface ScreenInfo {
|
|
2462
|
+
width: number;
|
|
2463
|
+
height: number;
|
|
2464
|
+
breakpoint: BreakpointName;
|
|
2465
|
+
deviceType: DeviceType;
|
|
2466
|
+
orientation: Orientation;
|
|
2467
|
+
isMobile: boolean;
|
|
2468
|
+
isTablet: boolean;
|
|
2469
|
+
isDesktop: boolean;
|
|
2470
|
+
isPortrait: boolean;
|
|
2471
|
+
isLandscape: boolean;
|
|
2472
|
+
isTouchDevice: boolean;
|
|
2473
|
+
pixelRatio: number;
|
|
2474
|
+
}
|
|
2475
|
+
|
|
2476
|
+
/**
|
|
2477
|
+
* Selection mode
|
|
2478
|
+
*/
|
|
2479
|
+
declare type SelectionMode_2 = 'single' | 'multiple' | 'range';
|
|
2480
|
+
export { SelectionMode_2 as SelectionMode }
|
|
2481
|
+
|
|
2482
|
+
/**
|
|
2483
|
+
* Signature data format
|
|
2484
|
+
*/
|
|
2485
|
+
export declare type SignatureFormat = 'png' | 'jpeg' | 'svg' | 'json';
|
|
2486
|
+
|
|
2487
|
+
/**
|
|
2488
|
+
* Ref methods
|
|
2489
|
+
*/
|
|
2490
|
+
export declare interface SignaturePadRef {
|
|
2491
|
+
/** Clear the signature */
|
|
2492
|
+
clear: () => void;
|
|
2493
|
+
/** Check if signature is empty */
|
|
2494
|
+
isEmpty: () => boolean;
|
|
2495
|
+
/** Get signature data */
|
|
2496
|
+
toData: () => SignaturePoint[][];
|
|
2497
|
+
/** Load signature data */
|
|
2498
|
+
fromData: (data: SignaturePoint[][]) => void;
|
|
2499
|
+
/** Get as data URL */
|
|
2500
|
+
toDataURL: (format?: SignatureFormat, quality?: number) => string;
|
|
2501
|
+
/** Get as SVG string */
|
|
2502
|
+
toSVG: () => string;
|
|
2503
|
+
/** Get as Blob */
|
|
2504
|
+
toBlob: (format?: 'png' | 'jpeg', quality?: number) => Promise<Blob | null>;
|
|
2505
|
+
/** Undo last stroke */
|
|
2506
|
+
undo: () => void;
|
|
2507
|
+
/** Redo undone stroke */
|
|
2508
|
+
redo: () => void;
|
|
2509
|
+
}
|
|
2510
|
+
|
|
2511
|
+
/**
|
|
2512
|
+
* Point with optional pressure
|
|
2513
|
+
*/
|
|
2514
|
+
export declare interface SignaturePoint {
|
|
2515
|
+
x: number;
|
|
2516
|
+
y: number;
|
|
2517
|
+
pressure?: number;
|
|
2518
|
+
time: number;
|
|
2519
|
+
}
|
|
2520
|
+
|
|
2521
|
+
/**
|
|
2522
|
+
* Slider mark
|
|
2523
|
+
*/
|
|
2524
|
+
export declare interface SliderMark {
|
|
2525
|
+
value: number;
|
|
2526
|
+
label?: ReactNode;
|
|
2527
|
+
}
|
|
2528
|
+
|
|
2529
|
+
/**
|
|
2530
|
+
* Slider orientation
|
|
2531
|
+
*/
|
|
2532
|
+
export declare type SliderOrientation = 'horizontal' | 'vertical';
|
|
2533
|
+
|
|
2534
|
+
export declare type SnapPoint = number | 'content' | 'full';
|
|
2535
|
+
|
|
2536
|
+
/**
|
|
2537
|
+
* Sort state
|
|
2538
|
+
*/
|
|
2539
|
+
export declare interface SortState {
|
|
2540
|
+
columnId: string;
|
|
2541
|
+
direction: 'asc' | 'desc';
|
|
2542
|
+
}
|
|
2543
|
+
|
|
2544
|
+
export declare const SwipeActionPresets: {
|
|
2545
|
+
delete: (onClick: () => void) => SwipeActionsAction;
|
|
2546
|
+
edit: (onClick: () => void) => SwipeActionsAction;
|
|
2547
|
+
archive: (onClick: () => void) => SwipeActionsAction;
|
|
2548
|
+
star: (onClick: () => void) => SwipeActionsAction;
|
|
2549
|
+
share: (onClick: () => void) => SwipeActionsAction;
|
|
2550
|
+
pin: (onClick: () => void) => SwipeActionsAction;
|
|
2551
|
+
mute: (onClick: () => void) => SwipeActionsAction;
|
|
2552
|
+
reply: (onClick: () => void) => SwipeActionsAction;
|
|
2553
|
+
};
|
|
2554
|
+
|
|
2555
|
+
export declare interface SwipeActionsAction {
|
|
2556
|
+
id: string;
|
|
2557
|
+
label: string;
|
|
2558
|
+
icon?: ReactNode;
|
|
2559
|
+
color?: string;
|
|
2560
|
+
background?: string;
|
|
2561
|
+
/** If true, continues past the action threshold to trigger immediately */
|
|
2562
|
+
destructive?: boolean;
|
|
2563
|
+
/** Called when action is triggered */
|
|
2564
|
+
onClick: () => void | Promise<void>;
|
|
2565
|
+
}
|
|
2566
|
+
|
|
2567
|
+
export declare type SwipeDirection = 'left' | 'right' | 'both';
|
|
2568
|
+
|
|
2569
|
+
/**
|
|
2570
|
+
* Swipe gesture event
|
|
2571
|
+
*/
|
|
2572
|
+
export declare interface SwipeEvent {
|
|
2573
|
+
direction: 'left' | 'right' | 'up' | 'down';
|
|
2574
|
+
velocity: number;
|
|
2575
|
+
distance: number;
|
|
2576
|
+
duration: number;
|
|
2577
|
+
}
|
|
2578
|
+
|
|
2579
|
+
declare interface SwipeGroupContextValue {
|
|
2580
|
+
activeItemId: string | null;
|
|
2581
|
+
setActiveItemId: (id: string | null) => void;
|
|
2582
|
+
}
|
|
2583
|
+
|
|
2584
|
+
/** Provider for exclusive swipe mode - only one item open at a time */
|
|
2585
|
+
export declare const SwipeGroupProvider: default_2.FC<{
|
|
2586
|
+
children: ReactNode;
|
|
2587
|
+
}>;
|
|
2588
|
+
|
|
2589
|
+
/**
|
|
2590
|
+
* Built-in tab icons for common use cases
|
|
2591
|
+
*/
|
|
2592
|
+
export declare const TabIcons: {
|
|
2593
|
+
home: JSX_2.Element;
|
|
2594
|
+
homeFilled: JSX_2.Element;
|
|
2595
|
+
search: JSX_2.Element;
|
|
2596
|
+
plus: JSX_2.Element;
|
|
2597
|
+
heart: JSX_2.Element;
|
|
2598
|
+
heartFilled: JSX_2.Element;
|
|
2599
|
+
user: JSX_2.Element;
|
|
2600
|
+
userFilled: JSX_2.Element;
|
|
2601
|
+
bell: JSX_2.Element;
|
|
2602
|
+
bellFilled: JSX_2.Element;
|
|
2603
|
+
cart: JSX_2.Element;
|
|
2604
|
+
inbox: JSX_2.Element;
|
|
2605
|
+
settings: JSX_2.Element;
|
|
2606
|
+
more: JSX_2.Element;
|
|
2607
|
+
};
|
|
2608
|
+
|
|
2609
|
+
/**
|
|
2610
|
+
* Tab item configuration
|
|
2611
|
+
*/
|
|
2612
|
+
export declare interface TabItem {
|
|
2613
|
+
/** Unique identifier */
|
|
2614
|
+
id: string;
|
|
2615
|
+
/** Tab label */
|
|
2616
|
+
label: string;
|
|
2617
|
+
/** Tab icon (active state uses same if no activeIcon) */
|
|
2618
|
+
icon: ReactNode;
|
|
2619
|
+
/** Icon when tab is active (optional) */
|
|
2620
|
+
activeIcon?: ReactNode;
|
|
2621
|
+
/** Badge content (number, string, or true for dot) */
|
|
2622
|
+
badge?: number | string | boolean;
|
|
2623
|
+
/** Badge variant */
|
|
2624
|
+
badgeVariant?: BadgeVariant;
|
|
2625
|
+
/** Badge color */
|
|
2626
|
+
badgeColor?: string;
|
|
2627
|
+
/** Is tab disabled */
|
|
2628
|
+
disabled?: boolean;
|
|
2629
|
+
/** Custom className */
|
|
2630
|
+
className?: string;
|
|
2631
|
+
/** Href for link tabs */
|
|
2632
|
+
href?: string;
|
|
2633
|
+
/** onClick handler */
|
|
2634
|
+
onClick?: () => void;
|
|
2635
|
+
}
|
|
2636
|
+
|
|
2637
|
+
/**
|
|
2638
|
+
* Common tab configurations for quick setup
|
|
2639
|
+
*/
|
|
2640
|
+
export declare const TabPresets: {
|
|
2641
|
+
/** Basic 4-tab layout */
|
|
2642
|
+
basic: TabItem[];
|
|
2643
|
+
/** Social app layout */
|
|
2644
|
+
social: TabItem[];
|
|
2645
|
+
/** E-commerce layout */
|
|
2646
|
+
ecommerce: TabItem[];
|
|
2647
|
+
/** Messaging app layout */
|
|
2648
|
+
messaging: TabItem[];
|
|
2649
|
+
};
|
|
2650
|
+
|
|
2651
|
+
/**
|
|
2652
|
+
* Tap gesture event
|
|
2653
|
+
*/
|
|
2654
|
+
export declare interface TapEvent {
|
|
2655
|
+
position: Point;
|
|
2656
|
+
target: EventTarget | null;
|
|
2657
|
+
}
|
|
2658
|
+
|
|
2659
|
+
/**
|
|
2660
|
+
* Button shape
|
|
2661
|
+
*/
|
|
2662
|
+
export declare type TouchButtonShape = 'rounded' | 'pill' | 'square' | 'circle';
|
|
2663
|
+
|
|
2664
|
+
/**
|
|
2665
|
+
* Button size
|
|
2666
|
+
*/
|
|
2667
|
+
export declare type TouchButtonSize = 'sm' | 'md' | 'lg' | 'xl';
|
|
2668
|
+
|
|
2669
|
+
/**
|
|
2670
|
+
* Button variant
|
|
2671
|
+
*/
|
|
2672
|
+
export declare type TouchButtonVariant = 'primary' | 'secondary' | 'outline' | 'ghost' | 'danger' | 'success' | 'warning';
|
|
2673
|
+
|
|
2674
|
+
/**
|
|
2675
|
+
* Ref methods
|
|
2676
|
+
*/
|
|
2677
|
+
export declare interface TouchDrawingRef {
|
|
2678
|
+
/** Clear the canvas */
|
|
2679
|
+
clear: () => void;
|
|
2680
|
+
/** Undo last action */
|
|
2681
|
+
undo: () => void;
|
|
2682
|
+
/** Redo undone action */
|
|
2683
|
+
redo: () => void;
|
|
2684
|
+
/** Check if can undo */
|
|
2685
|
+
canUndo: () => boolean;
|
|
2686
|
+
/** Check if can redo */
|
|
2687
|
+
canRedo: () => boolean;
|
|
2688
|
+
/** Get as data URL */
|
|
2689
|
+
toDataURL: (format?: 'png' | 'jpeg', quality?: number) => string;
|
|
2690
|
+
/** Get as Blob */
|
|
2691
|
+
toBlob: (format?: 'png' | 'jpeg', quality?: number) => Promise<Blob | null>;
|
|
2692
|
+
/** Load from data URL */
|
|
2693
|
+
fromDataURL: (url: string) => Promise<void>;
|
|
2694
|
+
/** Fill canvas with color */
|
|
2695
|
+
fill: (color: string) => void;
|
|
2696
|
+
/** Get current tool */
|
|
2697
|
+
getTool: () => DrawingTool;
|
|
2698
|
+
/** Set current tool */
|
|
2699
|
+
setTool: (tool: DrawingTool) => void;
|
|
2700
|
+
}
|
|
2701
|
+
|
|
2702
|
+
/**
|
|
2703
|
+
* Form context
|
|
2704
|
+
*/
|
|
2705
|
+
declare interface TouchFormContextType {
|
|
2706
|
+
values: Record<string, any>;
|
|
2707
|
+
errors: TouchFormFieldError[];
|
|
2708
|
+
touched: Set<string>;
|
|
2709
|
+
setFieldValue: (name: string, value: any) => void;
|
|
2710
|
+
setFieldTouched: (name: string) => void;
|
|
2711
|
+
focusField: (name: string) => void;
|
|
2712
|
+
focusNext: () => void;
|
|
2713
|
+
focusPrev: () => void;
|
|
2714
|
+
registerField: (name: string, ref: HTMLElement | null) => void;
|
|
2715
|
+
unregisterField: (name: string) => void;
|
|
2716
|
+
}
|
|
2717
|
+
|
|
2718
|
+
/**
|
|
2719
|
+
* Field error
|
|
2720
|
+
*/
|
|
2721
|
+
export declare interface TouchFormFieldError {
|
|
2722
|
+
field: string;
|
|
2723
|
+
message: string;
|
|
2724
|
+
}
|
|
2725
|
+
|
|
2726
|
+
/**
|
|
2727
|
+
* Field validation rule
|
|
2728
|
+
*/
|
|
2729
|
+
export declare interface TouchFormValidationRule {
|
|
2730
|
+
/** Validation type */
|
|
2731
|
+
type: 'required' | 'email' | 'minLength' | 'maxLength' | 'pattern' | 'custom';
|
|
2732
|
+
/** Rule value */
|
|
2733
|
+
value?: any;
|
|
2734
|
+
/** Error message */
|
|
2735
|
+
message: string;
|
|
2736
|
+
/** Custom validator function */
|
|
2737
|
+
validator?: (value: any) => boolean;
|
|
2738
|
+
}
|
|
2739
|
+
|
|
2740
|
+
/**
|
|
2741
|
+
* Menu item definition
|
|
2742
|
+
*/
|
|
2743
|
+
export declare interface TouchMenuItem {
|
|
2744
|
+
/** Unique ID */
|
|
2745
|
+
id: string;
|
|
2746
|
+
/** Label text */
|
|
2747
|
+
label: string;
|
|
2748
|
+
/** Icon element */
|
|
2749
|
+
icon?: ReactNode;
|
|
2750
|
+
/** Shortcut text */
|
|
2751
|
+
shortcut?: string;
|
|
2752
|
+
/** Disabled state */
|
|
2753
|
+
disabled?: boolean;
|
|
2754
|
+
/** Danger/destructive */
|
|
2755
|
+
danger?: boolean;
|
|
2756
|
+
/** Submenu items */
|
|
2757
|
+
children?: TouchMenuItem[];
|
|
2758
|
+
/** Divider after this item */
|
|
2759
|
+
divider?: boolean;
|
|
2760
|
+
/** Click handler */
|
|
2761
|
+
onClick?: () => void;
|
|
2762
|
+
}
|
|
2763
|
+
|
|
2764
|
+
/**
|
|
2765
|
+
* Column definition
|
|
2766
|
+
*/
|
|
2767
|
+
export declare interface TouchTableColumn<T = any> {
|
|
2768
|
+
/** Unique column ID */
|
|
2769
|
+
id: string;
|
|
2770
|
+
/** Header text */
|
|
2771
|
+
header: ReactNode;
|
|
2772
|
+
/** Cell accessor (key or function) */
|
|
2773
|
+
accessor: keyof T | ((row: T) => ReactNode);
|
|
2774
|
+
/** Column width */
|
|
2775
|
+
width?: string | number;
|
|
2776
|
+
/** Minimum width */
|
|
2777
|
+
minWidth?: number;
|
|
2778
|
+
/** Sticky left */
|
|
2779
|
+
sticky?: boolean;
|
|
2780
|
+
/** Text alignment */
|
|
2781
|
+
align?: 'left' | 'center' | 'right';
|
|
2782
|
+
/** Sortable */
|
|
2783
|
+
sortable?: boolean;
|
|
2784
|
+
/** Custom cell renderer */
|
|
2785
|
+
cell?: (value: any, row: T, rowIndex: number) => ReactNode;
|
|
2786
|
+
}
|
|
2787
|
+
|
|
2788
|
+
/**
|
|
2789
|
+
* Swipe action
|
|
2790
|
+
*/
|
|
2791
|
+
export declare interface TouchTableSwipeAction<T = any> {
|
|
2792
|
+
/** Unique ID */
|
|
2793
|
+
id: string;
|
|
2794
|
+
/** Label */
|
|
2795
|
+
label: string;
|
|
2796
|
+
/** Icon */
|
|
2797
|
+
icon?: ReactNode;
|
|
2798
|
+
/** Background color */
|
|
2799
|
+
color?: string;
|
|
2800
|
+
/** Text color */
|
|
2801
|
+
textColor?: string;
|
|
2802
|
+
/** Handler */
|
|
2803
|
+
onAction: (row: T, rowIndex: number) => void;
|
|
2804
|
+
}
|
|
2805
|
+
|
|
2806
|
+
/**
|
|
2807
|
+
* Hook for responsive breakpoint detection
|
|
2808
|
+
*
|
|
2809
|
+
* @example
|
|
2810
|
+
* ```tsx
|
|
2811
|
+
* function MyComponent() {
|
|
2812
|
+
* const { breakpoint, isMobile, isDesktop, getResponsive } = useBreakpoint();
|
|
2813
|
+
*
|
|
2814
|
+
* const columns = getResponsive({ base: 1, md: 2, lg: 3 }, 1);
|
|
2815
|
+
* const padding = getResponsive({ xs: 16, md: 24, xl: 32 }, 16);
|
|
2816
|
+
*
|
|
2817
|
+
* return (
|
|
2818
|
+
* <div style={{ padding }}>
|
|
2819
|
+
* <Grid columns={columns}>
|
|
2820
|
+
* {isMobile && <MobileNav />}
|
|
2821
|
+
* {isDesktop && <DesktopNav />}
|
|
2822
|
+
* </Grid>
|
|
2823
|
+
* </div>
|
|
2824
|
+
* );
|
|
2825
|
+
* }
|
|
2826
|
+
* ```
|
|
2827
|
+
*/
|
|
2828
|
+
declare function useBreakpoint(options?: UseBreakpointOptions): UseBreakpointReturn;
|
|
2829
|
+
export { useBreakpoint }
|
|
2830
|
+
export { useBreakpoint as useMobileBreakpoint }
|
|
2831
|
+
|
|
2832
|
+
/**
|
|
2833
|
+
* Hook to access breakpoint context
|
|
2834
|
+
*/
|
|
2835
|
+
export declare function useBreakpointContext(): BreakpointContextValue;
|
|
2836
|
+
|
|
2837
|
+
/**
|
|
2838
|
+
* Hook options
|
|
2839
|
+
*/
|
|
2840
|
+
export declare interface UseBreakpointOptions {
|
|
2841
|
+
/** Custom breakpoint values */
|
|
2842
|
+
breakpoints?: Partial<BreakpointValues>;
|
|
2843
|
+
/** Debounce delay for resize events */
|
|
2844
|
+
debounceDelay?: number;
|
|
2845
|
+
/** SSR default width */
|
|
2846
|
+
ssrDefaultWidth?: number;
|
|
2847
|
+
}
|
|
2848
|
+
|
|
2849
|
+
/**
|
|
2850
|
+
* Hook return
|
|
2851
|
+
*/
|
|
2852
|
+
export declare interface UseBreakpointReturn extends ScreenInfo {
|
|
2853
|
+
/** Check if current breakpoint matches */
|
|
2854
|
+
is: (breakpoint: BreakpointName) => boolean;
|
|
2855
|
+
/** Check if current width is above breakpoint */
|
|
2856
|
+
isAbove: (breakpoint: BreakpointName) => boolean;
|
|
2857
|
+
/** Check if current width is below breakpoint */
|
|
2858
|
+
isBelow: (breakpoint: BreakpointName) => boolean;
|
|
2859
|
+
/** Check if current width is between breakpoints */
|
|
2860
|
+
isBetween: (min: BreakpointName, max: BreakpointName) => boolean;
|
|
2861
|
+
/** Get responsive value for current breakpoint */
|
|
2862
|
+
getResponsive: <T>(values: ResponsiveValue<T>, defaultValue: T) => T;
|
|
2863
|
+
/** Generate media query string */
|
|
2864
|
+
mediaQuery: (breakpoint: BreakpointName, type?: 'min' | 'max' | 'only') => string;
|
|
2865
|
+
}
|
|
2866
|
+
|
|
2867
|
+
/**
|
|
2868
|
+
* Hook for button press feedback
|
|
2869
|
+
*/
|
|
2870
|
+
export declare function useButtonHaptic(): () => void;
|
|
2871
|
+
|
|
2872
|
+
/**
|
|
2873
|
+
* Hook for calendar logic
|
|
2874
|
+
*/
|
|
2875
|
+
export declare function useCalendar(options?: UseCalendarOptions): UseCalendarReturn;
|
|
2876
|
+
|
|
2877
|
+
/**
|
|
2878
|
+
* Hook options
|
|
2879
|
+
*/
|
|
2880
|
+
export declare interface UseCalendarOptions {
|
|
2881
|
+
defaultDate?: Date;
|
|
2882
|
+
selectedDate?: Date;
|
|
2883
|
+
selectedDates?: Date[];
|
|
2884
|
+
selectedRange?: DateRange;
|
|
2885
|
+
selectionMode?: SelectionMode_2;
|
|
2886
|
+
minDate?: Date;
|
|
2887
|
+
maxDate?: Date;
|
|
2888
|
+
disabledDates?: Date[];
|
|
2889
|
+
events?: CalendarEvent[];
|
|
2890
|
+
weekStartDay?: WeekStartDay;
|
|
2891
|
+
onChange?: (date: Date | Date[] | DateRange) => void;
|
|
2892
|
+
}
|
|
2893
|
+
|
|
2894
|
+
/**
|
|
2895
|
+
* Hook return
|
|
2896
|
+
*/
|
|
2897
|
+
export declare interface UseCalendarReturn {
|
|
2898
|
+
viewDate: Date;
|
|
2899
|
+
selectedDate: Date | null;
|
|
2900
|
+
selectedDates: Date[];
|
|
2901
|
+
selectedRange: DateRange;
|
|
2902
|
+
view: CalendarView;
|
|
2903
|
+
setView: (view: CalendarView) => void;
|
|
2904
|
+
goToDate: (date: Date) => void;
|
|
2905
|
+
goToPrevMonth: () => void;
|
|
2906
|
+
goToNextMonth: () => void;
|
|
2907
|
+
goToPrevYear: () => void;
|
|
2908
|
+
goToNextYear: () => void;
|
|
2909
|
+
goToToday: () => void;
|
|
2910
|
+
selectDate: (date: Date) => void;
|
|
2911
|
+
isDateSelected: (date: Date) => boolean;
|
|
2912
|
+
isDateDisabled: (date: Date) => boolean;
|
|
2913
|
+
getDaysInMonth: () => DayCell[];
|
|
2914
|
+
getMonths: () => {
|
|
2915
|
+
month: number;
|
|
2916
|
+
label: string;
|
|
2917
|
+
}[];
|
|
2918
|
+
getYears: () => number[];
|
|
2919
|
+
}
|
|
2920
|
+
|
|
2921
|
+
/**
|
|
2922
|
+
* Hook for custom collapsing header behavior
|
|
2923
|
+
*
|
|
2924
|
+
* @example
|
|
2925
|
+
* ```tsx
|
|
2926
|
+
* function MyScreen() {
|
|
2927
|
+
* const header = useCollapsingHeader({
|
|
2928
|
+
* collapsedHeight: 56,
|
|
2929
|
+
* expandedHeight: 200,
|
|
2930
|
+
* mode: 'scroll'
|
|
2931
|
+
* });
|
|
2932
|
+
*
|
|
2933
|
+
* return (
|
|
2934
|
+
* <>
|
|
2935
|
+
* <div style={{ height: header.height }}>
|
|
2936
|
+
* Progress: {header.progress}
|
|
2937
|
+
* </div>
|
|
2938
|
+
* <div ref={header.scrollRef} style={{ overflow: 'auto' }}>
|
|
2939
|
+
* Content...
|
|
2940
|
+
* </div>
|
|
2941
|
+
* </>
|
|
2942
|
+
* );
|
|
2943
|
+
* }
|
|
2944
|
+
* ```
|
|
2945
|
+
*/
|
|
2946
|
+
export declare function useCollapsingHeader(options?: UseCollapsingHeaderOptions): UseCollapsingHeaderReturn;
|
|
2947
|
+
|
|
2948
|
+
/**
|
|
2949
|
+
* Hook options
|
|
2950
|
+
*/
|
|
2951
|
+
export declare interface UseCollapsingHeaderOptions {
|
|
2952
|
+
/** Minimum height when collapsed */
|
|
2953
|
+
collapsedHeight?: number;
|
|
2954
|
+
/** Maximum height when expanded */
|
|
2955
|
+
expandedHeight?: number;
|
|
2956
|
+
/** Scroll element (default: window) */
|
|
2957
|
+
scrollElement?: HTMLElement | null;
|
|
2958
|
+
/** Collapse mode */
|
|
2959
|
+
mode?: CollapseMode;
|
|
2960
|
+
/** Threshold to trigger collapse */
|
|
2961
|
+
threshold?: number;
|
|
2962
|
+
}
|
|
2963
|
+
|
|
2964
|
+
/**
|
|
2965
|
+
* Hook return type
|
|
2966
|
+
*/
|
|
2967
|
+
export declare interface UseCollapsingHeaderReturn {
|
|
2968
|
+
/** Current collapse progress (0 = expanded, 1 = collapsed) */
|
|
2969
|
+
progress: number;
|
|
2970
|
+
/** Current height */
|
|
2971
|
+
height: number;
|
|
2972
|
+
/** Is header collapsed */
|
|
2973
|
+
isCollapsed: boolean;
|
|
2974
|
+
/** Is header visible (for enterAlways mode) */
|
|
2975
|
+
isVisible: boolean;
|
|
2976
|
+
/** Ref to attach to scroll container */
|
|
2977
|
+
scrollRef: default_2.RefObject<HTMLElement>;
|
|
2978
|
+
/** Manual expand */
|
|
2979
|
+
expand: () => void;
|
|
2980
|
+
/** Manual collapse */
|
|
2981
|
+
collapse: () => void;
|
|
2982
|
+
}
|
|
2983
|
+
|
|
2984
|
+
export declare function useDrawer(options?: UseDrawerOptions): UseDrawerResult;
|
|
2985
|
+
|
|
2986
|
+
declare interface UseDrawerOptions {
|
|
2987
|
+
defaultOpen?: boolean;
|
|
2988
|
+
onOpenChange?: (open: boolean) => void;
|
|
2989
|
+
}
|
|
2990
|
+
|
|
2991
|
+
export declare interface UseDrawerResult {
|
|
2992
|
+
isOpen: boolean;
|
|
2993
|
+
open: () => void;
|
|
2994
|
+
close: () => void;
|
|
2995
|
+
toggle: () => void;
|
|
2996
|
+
setOpen: (open: boolean) => void;
|
|
2997
|
+
}
|
|
2998
|
+
|
|
2999
|
+
/**
|
|
3000
|
+
* Hook for gesture detection and handling
|
|
3001
|
+
*/
|
|
3002
|
+
export declare function useGestures(options?: UseGesturesOptions): UseGesturesReturn;
|
|
3003
|
+
|
|
3004
|
+
export declare function useGesturesContext(): GesturesContextValue;
|
|
3005
|
+
|
|
3006
|
+
/**
|
|
3007
|
+
* Hook options
|
|
3008
|
+
*/
|
|
3009
|
+
export declare interface UseGesturesOptions extends GestureHandlers {
|
|
3010
|
+
/** Enable pinch gesture */
|
|
3011
|
+
enablePinch?: boolean;
|
|
3012
|
+
/** Enable rotation gesture */
|
|
3013
|
+
enableRotation?: boolean;
|
|
3014
|
+
/** Enable pan gesture */
|
|
3015
|
+
enablePan?: boolean;
|
|
3016
|
+
/** Enable swipe gesture */
|
|
3017
|
+
enableSwipe?: boolean;
|
|
3018
|
+
/** Enable tap gesture */
|
|
3019
|
+
enableTap?: boolean;
|
|
3020
|
+
/** Enable double tap */
|
|
3021
|
+
enableDoubleTap?: boolean;
|
|
3022
|
+
/** Enable long press */
|
|
3023
|
+
enableLongPress?: boolean;
|
|
3024
|
+
/** Minimum scale */
|
|
3025
|
+
minScale?: number;
|
|
3026
|
+
/** Maximum scale */
|
|
3027
|
+
maxScale?: number;
|
|
3028
|
+
/** Pan threshold in px */
|
|
3029
|
+
panThreshold?: number;
|
|
3030
|
+
/** Swipe velocity threshold */
|
|
3031
|
+
swipeVelocityThreshold?: number;
|
|
3032
|
+
/** Swipe distance threshold */
|
|
3033
|
+
swipeDistanceThreshold?: number;
|
|
3034
|
+
/** Long press duration in ms */
|
|
3035
|
+
longPressDuration?: number;
|
|
3036
|
+
/** Double tap max delay */
|
|
3037
|
+
doubleTapDelay?: number;
|
|
3038
|
+
}
|
|
3039
|
+
|
|
3040
|
+
/**
|
|
3041
|
+
* Hook return
|
|
3042
|
+
*/
|
|
3043
|
+
export declare interface UseGesturesReturn {
|
|
3044
|
+
bind: () => {
|
|
3045
|
+
onPointerDown: (e: PointerEvent_2) => void;
|
|
3046
|
+
onPointerMove: (e: PointerEvent_2) => void;
|
|
3047
|
+
onPointerUp: (e: PointerEvent_2) => void;
|
|
3048
|
+
onPointerCancel: (e: PointerEvent_2) => void;
|
|
3049
|
+
style: default_2.CSSProperties;
|
|
3050
|
+
};
|
|
3051
|
+
state: GestureState;
|
|
3052
|
+
reset: () => void;
|
|
3053
|
+
}
|
|
3054
|
+
|
|
3055
|
+
/**
|
|
3056
|
+
* Hook for haptic feedback
|
|
3057
|
+
*
|
|
3058
|
+
* @example
|
|
3059
|
+
* ```tsx
|
|
3060
|
+
* function MyComponent() {
|
|
3061
|
+
* const haptics = useHaptics();
|
|
3062
|
+
*
|
|
3063
|
+
* return (
|
|
3064
|
+
* <button onClick={() => {
|
|
3065
|
+
* haptics.trigger('button-press');
|
|
3066
|
+
* doSomething();
|
|
3067
|
+
* }}>
|
|
3068
|
+
* Click Me
|
|
3069
|
+
* </button>
|
|
3070
|
+
* );
|
|
3071
|
+
* }
|
|
3072
|
+
* ```
|
|
3073
|
+
*/
|
|
3074
|
+
export declare function useHaptics(options?: UseHapticsOptions): UseHapticsReturn;
|
|
3075
|
+
|
|
3076
|
+
/**
|
|
3077
|
+
* Hook to access haptics context
|
|
3078
|
+
*/
|
|
3079
|
+
export declare function useHapticsContext(): HapticsContextValue;
|
|
3080
|
+
|
|
3081
|
+
/**
|
|
3082
|
+
* Hook options
|
|
3083
|
+
*/
|
|
3084
|
+
export declare interface UseHapticsOptions {
|
|
3085
|
+
/** Enable haptics (default: true) */
|
|
3086
|
+
enabled?: boolean;
|
|
3087
|
+
/** Global intensity multiplier */
|
|
3088
|
+
intensity?: HapticIntensity;
|
|
3089
|
+
/** Custom patterns */
|
|
3090
|
+
customPatterns?: Record<string, VibrationPattern>;
|
|
3091
|
+
}
|
|
3092
|
+
|
|
3093
|
+
/**
|
|
3094
|
+
* Hook return
|
|
3095
|
+
*/
|
|
3096
|
+
export declare interface UseHapticsReturn {
|
|
3097
|
+
/** Whether haptics are supported */
|
|
3098
|
+
isSupported: boolean;
|
|
3099
|
+
/** Whether haptics are enabled */
|
|
3100
|
+
isEnabled: boolean;
|
|
3101
|
+
/** Enable/disable haptics */
|
|
3102
|
+
setEnabled: (enabled: boolean) => void;
|
|
3103
|
+
/** Trigger vibration with pattern */
|
|
3104
|
+
vibrate: (pattern?: VibrationPattern) => boolean;
|
|
3105
|
+
/** Stop vibration */
|
|
3106
|
+
cancel: () => void;
|
|
3107
|
+
/** Trigger predefined haptic feedback */
|
|
3108
|
+
trigger: (type: HapticsHapticFeedbackType) => boolean;
|
|
3109
|
+
/** Trigger custom pattern by name */
|
|
3110
|
+
triggerPattern: (name: string) => boolean;
|
|
3111
|
+
/** Get intensity multiplier */
|
|
3112
|
+
getIntensityMultiplier: () => number;
|
|
3113
|
+
}
|
|
3114
|
+
|
|
3115
|
+
/**
|
|
3116
|
+
* Hook for impact feedback
|
|
3117
|
+
*/
|
|
3118
|
+
export declare function useImpactHaptic(): (intensity?: HapticIntensity) => void;
|
|
3119
|
+
|
|
3120
|
+
export declare function useInfiniteData<T, C = string | number>(options: UseInfiniteDataOptions<T, C>): UseInfiniteDataResult<T>;
|
|
3121
|
+
|
|
3122
|
+
export declare interface UseInfiniteDataOptions<T, C = string | number> {
|
|
3123
|
+
/** Function to fetch a page of data */
|
|
3124
|
+
fetchPage: (cursor?: C) => Promise<InfiniteScrollPage<T>>;
|
|
3125
|
+
/** Initial cursor */
|
|
3126
|
+
initialCursor?: C;
|
|
3127
|
+
/** Enable automatic refetch on window focus */
|
|
3128
|
+
refetchOnFocus?: boolean;
|
|
3129
|
+
}
|
|
3130
|
+
|
|
3131
|
+
export declare interface UseInfiniteDataResult<T> {
|
|
3132
|
+
items: T[];
|
|
3133
|
+
isLoading: boolean;
|
|
3134
|
+
error: string | null;
|
|
3135
|
+
hasMore: boolean;
|
|
3136
|
+
loadMore: () => Promise<void>;
|
|
3137
|
+
refresh: () => Promise<void>;
|
|
3138
|
+
reset: () => void;
|
|
3139
|
+
}
|
|
3140
|
+
|
|
3141
|
+
export declare function useInfiniteScroll(): InfiniteScrollContextValue;
|
|
3142
|
+
|
|
3143
|
+
/**
|
|
3144
|
+
* Hook for matching media queries
|
|
3145
|
+
*
|
|
3146
|
+
* @example
|
|
3147
|
+
* ```tsx
|
|
3148
|
+
* const isLarge = useMediaQuery('(min-width: 1024px)');
|
|
3149
|
+
* const isDark = useMediaQuery('(prefers-color-scheme: dark)');
|
|
3150
|
+
* const isReducedMotion = useMediaQuery('(prefers-reduced-motion: reduce)');
|
|
3151
|
+
* ```
|
|
3152
|
+
*/
|
|
3153
|
+
declare function useMediaQuery(query: string): boolean;
|
|
3154
|
+
export { useMediaQuery }
|
|
3155
|
+
export { useMediaQuery as useMobileMediaQuery }
|
|
3156
|
+
|
|
3157
|
+
export declare function useMobileCalendar(): MobileCalendarContextValue;
|
|
3158
|
+
|
|
3159
|
+
export declare function useMobileDrawer(): MobileDrawerContextValue;
|
|
3160
|
+
|
|
3161
|
+
/**
|
|
3162
|
+
* Access header context from children
|
|
3163
|
+
*/
|
|
3164
|
+
export declare function useMobileHeader(): MobileHeaderContextValue;
|
|
3165
|
+
|
|
3166
|
+
/**
|
|
3167
|
+
* Access modal context inside modal content
|
|
3168
|
+
*/
|
|
3169
|
+
export declare function useMobileModal(): MobileModalContextValue;
|
|
3170
|
+
|
|
3171
|
+
export declare function useMobilePicker(): MobilePickerContextValue;
|
|
3172
|
+
|
|
3173
|
+
/**
|
|
3174
|
+
* Access tabs context from children
|
|
3175
|
+
*/
|
|
3176
|
+
export declare function useMobileTabs(): MobileTabsContextValue;
|
|
3177
|
+
|
|
3178
|
+
/**
|
|
3179
|
+
* Hook to manage modal open/close state
|
|
3180
|
+
*
|
|
3181
|
+
* @example
|
|
3182
|
+
* ```tsx
|
|
3183
|
+
* function MyScreen() {
|
|
3184
|
+
* const modal = useModal();
|
|
3185
|
+
*
|
|
3186
|
+
* return (
|
|
3187
|
+
* <>
|
|
3188
|
+
* <button onClick={modal.openModal}>Open</button>
|
|
3189
|
+
* <NiceMobileModal
|
|
3190
|
+
* open={modal.open}
|
|
3191
|
+
* onClose={modal.closeModal}
|
|
3192
|
+
* >
|
|
3193
|
+
* Modal content
|
|
3194
|
+
* </NiceMobileModal>
|
|
3195
|
+
* </>
|
|
3196
|
+
* );
|
|
3197
|
+
* }
|
|
3198
|
+
* ```
|
|
3199
|
+
*/
|
|
3200
|
+
export declare function useModal(options?: UseModalOptions): UseModalReturn;
|
|
3201
|
+
|
|
3202
|
+
/**
|
|
3203
|
+
* Modal configuration for hook
|
|
3204
|
+
*/
|
|
3205
|
+
export declare interface UseModalOptions {
|
|
3206
|
+
/** Initial open state */
|
|
3207
|
+
defaultOpen?: boolean;
|
|
3208
|
+
/** Controlled open state */
|
|
3209
|
+
open?: boolean;
|
|
3210
|
+
/** Callback when open state changes */
|
|
3211
|
+
onOpenChange?: (open: boolean, trigger?: DismissTrigger) => void;
|
|
3212
|
+
/** Block dismiss on drag/overlay */
|
|
3213
|
+
preventDismiss?: boolean;
|
|
3214
|
+
}
|
|
3215
|
+
|
|
3216
|
+
/**
|
|
3217
|
+
* Hook return type
|
|
3218
|
+
*/
|
|
3219
|
+
export declare interface UseModalReturn {
|
|
3220
|
+
open: boolean;
|
|
3221
|
+
openModal: () => void;
|
|
3222
|
+
closeModal: (trigger?: DismissTrigger) => void;
|
|
3223
|
+
toggle: () => void;
|
|
3224
|
+
setOpen: (open: boolean) => void;
|
|
3225
|
+
}
|
|
3226
|
+
|
|
3227
|
+
/**
|
|
3228
|
+
* Hook for notification feedback
|
|
3229
|
+
*/
|
|
3230
|
+
export declare function useNotificationHaptic(): (type: "success" | "warning" | "error") => void;
|
|
3231
|
+
|
|
3232
|
+
declare function usePullToRefresh(): PullToRefreshContextValue;
|
|
3233
|
+
export { usePullToRefresh as useMobilePullToRefresh }
|
|
3234
|
+
export { usePullToRefresh }
|
|
3235
|
+
|
|
3236
|
+
/**
|
|
3237
|
+
* Hook for selection feedback
|
|
3238
|
+
*/
|
|
3239
|
+
export declare function useSelectionHaptic(): () => void;
|
|
3240
|
+
|
|
3241
|
+
/**
|
|
3242
|
+
* Hook options
|
|
3243
|
+
*/
|
|
3244
|
+
export declare interface UseSliderOptions {
|
|
3245
|
+
min: number;
|
|
3246
|
+
max: number;
|
|
3247
|
+
step: number;
|
|
3248
|
+
value?: number | [number, number];
|
|
3249
|
+
defaultValue?: number | [number, number];
|
|
3250
|
+
onChange?: (value: number | [number, number]) => void;
|
|
3251
|
+
onChangeCommitted?: (value: number | [number, number]) => void;
|
|
3252
|
+
}
|
|
3253
|
+
|
|
3254
|
+
/**
|
|
3255
|
+
* Hook return
|
|
3256
|
+
*/
|
|
3257
|
+
export declare interface UseSliderReturn {
|
|
3258
|
+
value: number | [number, number];
|
|
3259
|
+
isRange: boolean;
|
|
3260
|
+
percentage: number | [number, number];
|
|
3261
|
+
setValue: (value: number | [number, number]) => void;
|
|
3262
|
+
setValueByPercentage: (percentage: number, thumbIndex?: number) => void;
|
|
3263
|
+
commitValue: () => void;
|
|
3264
|
+
clamp: (value: number) => number;
|
|
3265
|
+
snap: (value: number) => number;
|
|
3266
|
+
}
|
|
3267
|
+
|
|
3268
|
+
export declare function useSwipeGroup(): SwipeGroupContextValue | null;
|
|
3269
|
+
|
|
3270
|
+
/**
|
|
3271
|
+
* Hook to manage tab state
|
|
3272
|
+
*
|
|
3273
|
+
* @example
|
|
3274
|
+
* ```tsx
|
|
3275
|
+
* function MyApp() {
|
|
3276
|
+
* const tabs = useTabs({
|
|
3277
|
+
* tabs: [
|
|
3278
|
+
* { id: 'home', label: 'Home', icon: <HomeIcon /> },
|
|
3279
|
+
* { id: 'search', label: 'Search', icon: <SearchIcon /> },
|
|
3280
|
+
* ],
|
|
3281
|
+
* defaultTab: 'home'
|
|
3282
|
+
* });
|
|
3283
|
+
*
|
|
3284
|
+
* return (
|
|
3285
|
+
* <>
|
|
3286
|
+
* {tabs.activeTab === 'home' && <HomeScreen />}
|
|
3287
|
+
* {tabs.activeTab === 'search' && <SearchScreen />}
|
|
3288
|
+
* <NiceMobileTabs {...tabs} />
|
|
3289
|
+
* </>
|
|
3290
|
+
* );
|
|
3291
|
+
* }
|
|
3292
|
+
* ```
|
|
3293
|
+
*/
|
|
3294
|
+
export declare function useTabs(options: UseTabsOptions): UseTabsReturn;
|
|
3295
|
+
|
|
3296
|
+
/**
|
|
3297
|
+
* Hook options
|
|
3298
|
+
*/
|
|
3299
|
+
export declare interface UseTabsOptions {
|
|
3300
|
+
/** Tab items */
|
|
3301
|
+
tabs: TabItem[];
|
|
3302
|
+
/** Default active tab ID */
|
|
3303
|
+
defaultTab?: string;
|
|
3304
|
+
/** Controlled active tab */
|
|
3305
|
+
activeTab?: string;
|
|
3306
|
+
/** Callback when tab changes */
|
|
3307
|
+
onChange?: (id: string) => void;
|
|
3308
|
+
}
|
|
3309
|
+
|
|
3310
|
+
/**
|
|
3311
|
+
* Hook return
|
|
3312
|
+
*/
|
|
3313
|
+
export declare interface UseTabsReturn {
|
|
3314
|
+
activeTab: string;
|
|
3315
|
+
setActiveTab: (id: string) => void;
|
|
3316
|
+
tabs: TabItem[];
|
|
3317
|
+
isActive: (id: string) => boolean;
|
|
3318
|
+
}
|
|
3319
|
+
|
|
3320
|
+
/**
|
|
3321
|
+
* Hook for toggle switch feedback
|
|
3322
|
+
*/
|
|
3323
|
+
export declare function useToggleHaptic(): (isOn: boolean) => void;
|
|
3324
|
+
|
|
3325
|
+
/**
|
|
3326
|
+
* Hook to use form context
|
|
3327
|
+
*/
|
|
3328
|
+
export declare function useTouchForm(): TouchFormContextType;
|
|
3329
|
+
|
|
3330
|
+
/**
|
|
3331
|
+
* Hook for slider logic
|
|
3332
|
+
*/
|
|
3333
|
+
export declare function useTouchSlider(options: UseSliderOptions): UseSliderReturn;
|
|
3334
|
+
|
|
3335
|
+
export declare function useVirtualList(options: UseVirtualListOptions): UseVirtualListResult;
|
|
3336
|
+
|
|
3337
|
+
export declare interface UseVirtualListOptions {
|
|
3338
|
+
itemCount: number;
|
|
3339
|
+
itemHeight: number | ((index: number) => number);
|
|
3340
|
+
overscan?: number;
|
|
3341
|
+
containerRef: default_2.RefObject<HTMLElement>;
|
|
3342
|
+
}
|
|
3343
|
+
|
|
3344
|
+
export declare interface UseVirtualListResult {
|
|
3345
|
+
virtualItems: VirtualItem[];
|
|
3346
|
+
totalSize: number;
|
|
3347
|
+
scrollToIndex: (index: number) => void;
|
|
3348
|
+
}
|
|
3349
|
+
|
|
3350
|
+
/**
|
|
3351
|
+
* Hook for custom wheel picker implementations
|
|
3352
|
+
*
|
|
3353
|
+
* @example
|
|
3354
|
+
* ```tsx
|
|
3355
|
+
* const picker = useWheelPicker({
|
|
3356
|
+
* items: [
|
|
3357
|
+
* { value: '1', label: 'Option 1' },
|
|
3358
|
+
* { value: '2', label: 'Option 2' },
|
|
3359
|
+
* ],
|
|
3360
|
+
* defaultValue: '1',
|
|
3361
|
+
* onChange: (value) => console.log(value)
|
|
3362
|
+
* });
|
|
3363
|
+
*
|
|
3364
|
+
* return (
|
|
3365
|
+
* <div ref={picker.containerRef}>
|
|
3366
|
+
* {items.map((item, i) => (
|
|
3367
|
+
* <div key={item.value} onClick={() => picker.scrollToIndex(i)}>
|
|
3368
|
+
* {item.label}
|
|
3369
|
+
* </div>
|
|
3370
|
+
* ))}
|
|
3371
|
+
* </div>
|
|
3372
|
+
* );
|
|
3373
|
+
* ```
|
|
3374
|
+
*/
|
|
3375
|
+
export declare function useWheelPicker<T = string>(options: UseWheelPickerOptions<T>): UseWheelPickerReturn<T>;
|
|
3376
|
+
|
|
3377
|
+
/**
|
|
3378
|
+
* Wheel hook options
|
|
3379
|
+
*/
|
|
3380
|
+
export declare interface UseWheelPickerOptions<T = string> {
|
|
3381
|
+
items: PickerItem<T>[];
|
|
3382
|
+
defaultValue?: T;
|
|
3383
|
+
value?: T;
|
|
3384
|
+
onChange?: (value: T, item: PickerItem<T>) => void;
|
|
3385
|
+
itemHeight?: number;
|
|
3386
|
+
visibleItems?: number;
|
|
3387
|
+
loop?: boolean;
|
|
3388
|
+
}
|
|
3389
|
+
|
|
3390
|
+
/**
|
|
3391
|
+
* Wheel hook return
|
|
3392
|
+
*/
|
|
3393
|
+
export declare interface UseWheelPickerReturn<T = string> {
|
|
3394
|
+
selectedValue: T | undefined;
|
|
3395
|
+
selectedIndex: number;
|
|
3396
|
+
setSelectedIndex: (index: number) => void;
|
|
3397
|
+
scrollToIndex: (index: number, animated?: boolean) => void;
|
|
3398
|
+
containerRef: default_2.RefObject<HTMLDivElement>;
|
|
3399
|
+
}
|
|
3400
|
+
|
|
3401
|
+
/**
|
|
3402
|
+
* Simple one-off vibration
|
|
3403
|
+
*/
|
|
3404
|
+
export declare function vibrate(duration?: number): boolean;
|
|
3405
|
+
|
|
3406
|
+
/**
|
|
3407
|
+
* Vibration pattern type
|
|
3408
|
+
*/
|
|
3409
|
+
export declare type VibrationPattern = number | number[];
|
|
3410
|
+
|
|
3411
|
+
export declare interface VirtualItem {
|
|
3412
|
+
index: number;
|
|
3413
|
+
start: number;
|
|
3414
|
+
size: number;
|
|
3415
|
+
end: number;
|
|
3416
|
+
}
|
|
3417
|
+
|
|
3418
|
+
/**
|
|
3419
|
+
* Day of week (0 = Sunday, 6 = Saturday)
|
|
3420
|
+
*/
|
|
3421
|
+
export declare type WeekStartDay = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
3422
|
+
|
|
3423
|
+
/**
|
|
3424
|
+
* Higher-order component that adds haptics prop
|
|
3425
|
+
*/
|
|
3426
|
+
export declare function withHaptics<P extends object>(Component: default_2.ComponentType<P & {
|
|
3427
|
+
haptics: UseHapticsReturn;
|
|
3428
|
+
}>): default_2.FC<P>;
|
|
3429
|
+
|
|
3430
|
+
export { }
|