@nick-skriabin/glyph 0.1.37 → 0.1.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts DELETED
@@ -1,680 +0,0 @@
1
- import React, { ReactElement, ReactNode } from 'react';
2
- import { Node } from 'yoga-layout';
3
-
4
- type NamedColor = "black" | "red" | "green" | "yellow" | "blue" | "magenta" | "cyan" | "white" | "blackBright" | "redBright" | "greenBright" | "yellowBright" | "blueBright" | "magentaBright" | "cyanBright" | "whiteBright";
5
- type HexColor = `#${string}`;
6
- type RGBColor = {
7
- r: number;
8
- g: number;
9
- b: number;
10
- };
11
- type Color = NamedColor | HexColor | RGBColor | number;
12
- type DimensionValue = number | `${number}%`;
13
- type BorderStyle = "none" | "single" | "double" | "round" | "ascii";
14
- type WrapMode = "wrap" | "truncate" | "ellipsis" | "none";
15
- type TextAlign = "left" | "center" | "right";
16
- interface Style {
17
- width?: DimensionValue;
18
- height?: DimensionValue;
19
- minWidth?: number;
20
- minHeight?: number;
21
- maxWidth?: number;
22
- maxHeight?: number;
23
- padding?: number;
24
- paddingX?: number;
25
- paddingY?: number;
26
- paddingTop?: number;
27
- paddingRight?: number;
28
- paddingBottom?: number;
29
- paddingLeft?: number;
30
- gap?: number;
31
- flexDirection?: "row" | "column";
32
- flexWrap?: "nowrap" | "wrap";
33
- justifyContent?: "flex-start" | "center" | "flex-end" | "space-between" | "space-around";
34
- alignItems?: "flex-start" | "center" | "flex-end" | "stretch";
35
- flexGrow?: number;
36
- flexShrink?: number;
37
- position?: "relative" | "absolute";
38
- top?: DimensionValue;
39
- right?: DimensionValue;
40
- bottom?: DimensionValue;
41
- left?: DimensionValue;
42
- inset?: DimensionValue;
43
- zIndex?: number;
44
- pointerEvents?: "auto" | "none";
45
- bg?: Color;
46
- border?: BorderStyle;
47
- borderColor?: Color;
48
- clip?: boolean;
49
- color?: Color;
50
- bold?: boolean;
51
- dim?: boolean;
52
- italic?: boolean;
53
- underline?: boolean;
54
- wrap?: WrapMode;
55
- textAlign?: TextAlign;
56
- }
57
- interface LayoutRect {
58
- x: number;
59
- y: number;
60
- width: number;
61
- height: number;
62
- innerX: number;
63
- innerY: number;
64
- innerWidth: number;
65
- innerHeight: number;
66
- }
67
- interface Key {
68
- name: string;
69
- sequence: string;
70
- ctrl?: boolean;
71
- alt?: boolean;
72
- shift?: boolean;
73
- meta?: boolean;
74
- }
75
- interface RenderOptions {
76
- stdout?: NodeJS.WriteStream;
77
- stdin?: NodeJS.ReadStream;
78
- debug?: boolean;
79
- /** Use the terminal's native cursor instead of a simulated one. Enables cursor shaders/animations in supported terminals. Default: true */
80
- useNativeCursor?: boolean;
81
- }
82
- interface AppHandle {
83
- unmount(): void;
84
- exit(code?: number): void;
85
- }
86
-
87
- declare function render(element: ReactElement, opts?: RenderOptions): AppHandle;
88
-
89
- type GlyphNodeType = "box" | "text" | "input";
90
- interface GlyphNode {
91
- type: GlyphNodeType;
92
- props: Record<string, any>;
93
- style: Style;
94
- children: GlyphNode[];
95
- rawTextChildren: GlyphTextInstance[];
96
- parent: GlyphNode | null;
97
- yogaNode: Node | null;
98
- text: string | null;
99
- layout: LayoutRect;
100
- focusId: string | null;
101
- hidden: boolean;
102
- }
103
- interface GlyphTextInstance {
104
- type: "raw-text";
105
- text: string;
106
- parent: GlyphNode | null;
107
- }
108
-
109
- interface BoxProps {
110
- style?: Style;
111
- children?: ReactNode;
112
- focusable?: boolean;
113
- }
114
- declare const Box: React.ForwardRefExoticComponent<BoxProps & React.RefAttributes<GlyphNode>>;
115
-
116
- interface TextProps {
117
- style?: Style;
118
- children?: ReactNode;
119
- wrap?: Style["wrap"];
120
- }
121
- declare const Text: React.ForwardRefExoticComponent<TextProps & React.RefAttributes<GlyphNode>>;
122
-
123
- type InputType = "text" | "number";
124
- interface InputProps {
125
- value?: string;
126
- defaultValue?: string;
127
- onChange?: (value: string) => void;
128
- /** Called on every key press. Return `true` to prevent default handling. */
129
- onKeyPress?: (key: Key) => boolean | void;
130
- /**
131
- * Called before a value change is applied. Useful for input masking/validation.
132
- * @param newValue - The proposed new value
133
- * @param oldValue - The current value
134
- * @returns
135
- * - `string` to use a different value (and cursor moves to end of returned string)
136
- * - `false` to reject the change entirely
137
- * - `undefined` to accept the change as-is
138
- */
139
- onBeforeChange?: (newValue: string, oldValue: string) => string | false | void;
140
- placeholder?: string;
141
- style?: Style;
142
- /** Style when focused (merged with style) */
143
- focusedStyle?: Style;
144
- /** Enable multiline editing (Enter inserts newlines, Up/Down navigate lines). */
145
- multiline?: boolean;
146
- /** Automatically focus this input when mounted */
147
- autoFocus?: boolean;
148
- /**
149
- * Input type for validation:
150
- * - "text" (default): accepts any character
151
- * - "number": only accepts digits, decimal point, and minus sign
152
- */
153
- type?: InputType;
154
- }
155
- declare function Input(props: InputProps): React.JSX.Element;
156
-
157
- interface FocusScopeProps {
158
- trap?: boolean;
159
- children?: ReactNode;
160
- }
161
- declare function FocusScope({ trap, children }: FocusScopeProps): React.JSX.Element;
162
-
163
- interface SpacerProps {
164
- size?: number;
165
- }
166
- declare function Spacer({ size }: SpacerProps): React.JSX.Element;
167
-
168
- interface KeybindProps {
169
- /** Key descriptor, e.g. "q", "escape", "ctrl+c", "ctrl+shift+a" */
170
- keypress: string;
171
- /** Handler called when the key matches */
172
- onPress: () => void;
173
- /** Only fire when this focus ID is active */
174
- whenFocused?: string;
175
- /** Only fire when nothing is focused or the focused element doesn't consume the key */
176
- global?: boolean;
177
- /**
178
- * If true, this keybind runs BEFORE focused input handlers.
179
- * Use for keybinds that should work even when an Input is focused (e.g., Ctrl+Enter to submit).
180
- */
181
- priority?: boolean;
182
- /** Disabled state */
183
- disabled?: boolean;
184
- }
185
- declare function Keybind({ keypress, onPress, whenFocused, priority, disabled, }: KeybindProps): null;
186
-
187
- interface PortalProps {
188
- children?: ReactNode;
189
- zIndex?: number;
190
- }
191
- /**
192
- * Portal renders children as a fullscreen absolute overlay on top of the main tree.
193
- * Useful for modals, notifications, and dropdowns that should paint above all other content.
194
- */
195
- declare function Portal({ children, zIndex }: PortalProps): React.JSX.Element;
196
-
197
- interface ButtonProps {
198
- onPress?: () => void;
199
- style?: Style;
200
- focusedStyle?: Style;
201
- children?: ReactNode;
202
- disabled?: boolean;
203
- }
204
- declare function Button({ onPress, style, focusedStyle, children, disabled, }: ButtonProps): React.JSX.Element;
205
-
206
- interface ScrollViewProps {
207
- children?: ReactNode;
208
- style?: Style;
209
- /** Controlled scroll offset (rows from top) */
210
- scrollOffset?: number;
211
- /** Callback when scroll offset should change (controlled mode) */
212
- onScroll?: (offset: number) => void;
213
- /** Initial offset for uncontrolled mode */
214
- defaultScrollOffset?: number;
215
- /** Lines to scroll per arrow key press (default: 1) */
216
- scrollStep?: number;
217
- /** Disable keyboard scrolling */
218
- disableKeyboard?: boolean;
219
- /** Auto-scroll to focused element (default: true) */
220
- scrollToFocus?: boolean;
221
- /** Show scrollbar when content is scrollable (default: true) */
222
- showScrollbar?: boolean;
223
- /** Make ScrollView itself focusable. Default: true. Set to false if you want scroll to follow child focus only. */
224
- focusable?: boolean;
225
- /** Style applied when ScrollView is focused */
226
- focusedStyle?: Style;
227
- }
228
- declare function ScrollView({ children, style, scrollOffset: controlledOffset, onScroll, defaultScrollOffset, scrollStep, disableKeyboard, scrollToFocus, showScrollbar, focusable, focusedStyle, }: ScrollViewProps): React.JSX.Element;
229
-
230
- interface ListItemInfo {
231
- index: number;
232
- selected: boolean;
233
- focused: boolean;
234
- }
235
- interface ListProps {
236
- /** Total number of items */
237
- count: number;
238
- /** Render function for each item */
239
- renderItem: (info: ListItemInfo) => ReactNode;
240
- /** Controlled selected index */
241
- selectedIndex?: number;
242
- /** Callback when selected index should change */
243
- onSelectionChange?: (index: number) => void;
244
- /** Callback when enter is pressed on selected item */
245
- onSelect?: (index: number) => void;
246
- /** Initial index for uncontrolled mode */
247
- defaultSelectedIndex?: number;
248
- /** Set of disabled indices that are skipped during navigation */
249
- disabledIndices?: Set<number>;
250
- /** Outer box style */
251
- style?: Style;
252
- /** Whether the list is focusable (default: true) */
253
- focusable?: boolean;
254
- }
255
- declare function List({ count, renderItem, selectedIndex: controlledIndex, onSelectionChange, onSelect, defaultSelectedIndex, disabledIndices, style, focusable, }: ListProps): React.JSX.Element;
256
-
257
- interface MenuItem {
258
- label: string;
259
- value: string;
260
- disabled?: boolean;
261
- }
262
- interface MenuProps {
263
- items: MenuItem[];
264
- /** Controlled selected index */
265
- selectedIndex?: number;
266
- /** Callback when selected index changes */
267
- onSelectionChange?: (index: number) => void;
268
- /** Callback when enter is pressed on item */
269
- onSelect?: (value: string, index: number) => void;
270
- /** Initial index for uncontrolled mode */
271
- defaultSelectedIndex?: number;
272
- /** Outer box style */
273
- style?: Style;
274
- /** Color for the selected item indicator and text (default: "cyan") */
275
- highlightColor?: Color;
276
- /** Whether the menu is focusable (default: true) */
277
- focusable?: boolean;
278
- }
279
- declare function Menu({ items, selectedIndex, onSelectionChange, onSelect, defaultSelectedIndex, style, highlightColor, focusable, }: MenuProps): React.JSX.Element;
280
-
281
- interface ProgressProps {
282
- /** Progress value 0..1. Omit when indeterminate. */
283
- value?: number;
284
- /** Animate as indeterminate (marquee). Default false. */
285
- indeterminate?: boolean;
286
- /** Width of the progress bar. Default "100%". */
287
- width?: DimensionValue;
288
- /** Optional label text displayed before the bar. */
289
- label?: string;
290
- /** Show percentage text after the bar. Default false. */
291
- showPercent?: boolean;
292
- /** Outer container style. */
293
- style?: Style;
294
- /** Character(s) for the filled portion. Default "█". */
295
- filled?: string;
296
- /** Character(s) for the empty portion. Default "░". */
297
- empty?: string;
298
- }
299
- declare function Progress({ value, indeterminate, width, label, showPercent, style, filled, empty, }: ProgressProps): React.JSX.Element;
300
-
301
- interface SpinnerProps {
302
- /** Animation frames. Defaults to braille dots. */
303
- frames?: string[];
304
- /** Interval between frames in ms. Default 80. */
305
- intervalMs?: number;
306
- /** Optional label text next to the spinner. */
307
- label?: string;
308
- /** Style applied to the spinner character. */
309
- style?: Style;
310
- }
311
- declare function Spinner({ frames, intervalMs, label, style, }: SpinnerProps): React.JSX.Element;
312
-
313
- type ToastVariant = "info" | "success" | "warning" | "error";
314
- interface Toast {
315
- id: string;
316
- message: string;
317
- title?: string;
318
- variant?: ToastVariant;
319
- durationMs?: number;
320
- }
321
- type ToastPosition = "top-right" | "top-left" | "bottom-right" | "bottom-left";
322
- interface ToastHostProps {
323
- /** Where toasts appear. Default "bottom-right". */
324
- position?: ToastPosition;
325
- /** Max visible toasts. Default 5. */
326
- maxVisible?: number;
327
- children?: ReactNode;
328
- }
329
- declare function useToast(): (toast: Omit<Toast, "id">) => void;
330
- declare function ToastHost({ position, maxVisible, children, }: ToastHostProps): React.JSX.Element;
331
-
332
- interface SelectItem {
333
- label: string;
334
- value: string;
335
- disabled?: boolean;
336
- }
337
- interface SelectProps {
338
- /** List of selectable items */
339
- items: SelectItem[];
340
- /** Currently selected value (controlled) */
341
- value?: string;
342
- /** Callback when selection changes */
343
- onChange?: (value: string) => void;
344
- /** Placeholder text when nothing is selected */
345
- placeholder?: string;
346
- /** Trigger box style */
347
- style?: Style;
348
- /** Trigger style when focused */
349
- focusedStyle?: Style;
350
- /** Dropdown overlay style overrides */
351
- dropdownStyle?: Style;
352
- /** Highlight color for the selected item in the dropdown (default: "cyan") */
353
- highlightColor?: Color;
354
- /** Max visible items in the dropdown before scrolling (default: 8) */
355
- maxVisible?: number;
356
- /** Enable type-to-filter when dropdown is open (default: true) */
357
- searchable?: boolean;
358
- /** Disabled state */
359
- disabled?: boolean;
360
- }
361
- declare function Select({ items, value, onChange, placeholder, style, focusedStyle, dropdownStyle, highlightColor, maxVisible, searchable, disabled, }: SelectProps): React.JSX.Element;
362
-
363
- interface CheckboxProps {
364
- /** Whether the checkbox is checked */
365
- checked: boolean;
366
- /** Called when the checkbox is toggled */
367
- onChange: (checked: boolean) => void;
368
- /** Label text displayed next to the checkbox */
369
- label?: string;
370
- /** Style for the checkbox container */
371
- style?: Style;
372
- /** Style when focused */
373
- focusedStyle?: Style;
374
- /** Whether the checkbox is disabled */
375
- disabled?: boolean;
376
- /** Custom character for checked state (default: "✓") */
377
- checkedChar?: string;
378
- /** Custom character for unchecked state (default: " ") */
379
- uncheckedChar?: string;
380
- }
381
- declare function Checkbox({ checked, onChange, label, style, focusedStyle, disabled, checkedChar, uncheckedChar, }: CheckboxProps): React.JSX.Element;
382
-
383
- interface RadioItem<T = string> {
384
- /** Display label */
385
- label: string;
386
- /** Value returned on selection */
387
- value: T;
388
- /** Whether this option is disabled */
389
- disabled?: boolean;
390
- }
391
- interface RadioProps<T = string> {
392
- /** Radio options */
393
- items: RadioItem<T>[];
394
- /** Currently selected value */
395
- value: T | undefined;
396
- /** Called when selection changes */
397
- onChange: (value: T) => void;
398
- /** Style for the radio group container */
399
- style?: Style;
400
- /** Style for each radio item */
401
- itemStyle?: Style;
402
- /** Style for the focused item */
403
- focusedItemStyle?: Style;
404
- /** Style for the selected item */
405
- selectedItemStyle?: Style;
406
- /** Whether the entire group is disabled */
407
- disabled?: boolean;
408
- /** Layout direction (default: "column") */
409
- direction?: "row" | "column";
410
- /** Gap between items (default: 0) */
411
- gap?: number;
412
- /** Custom character for selected state (default: "●") */
413
- selectedChar?: string;
414
- /** Custom character for unselected state (default: "○") */
415
- unselectedChar?: string;
416
- }
417
- declare function Radio<T = string>({ items, value, onChange, style, itemStyle, focusedItemStyle, selectedItemStyle, disabled, direction, gap, selectedChar, unselectedChar, }: RadioProps<T>): React.JSX.Element;
418
-
419
- interface AlertOptions {
420
- /** Text for the OK button (default: "OK") */
421
- okText?: string;
422
- /** Style for the dialog box */
423
- style?: Style;
424
- }
425
- interface ConfirmOptions extends AlertOptions {
426
- /** Text for the Cancel button (default: "Cancel") */
427
- cancelText?: string;
428
- }
429
- interface DialogContextValue {
430
- /** Show an alert dialog. Returns a promise that resolves when dismissed. */
431
- alert: (content: ReactNode, options?: AlertOptions) => Promise<void>;
432
- /** Show a confirm dialog. Returns a promise that resolves to true (OK) or false (Cancel). */
433
- confirm: (content: ReactNode, options?: ConfirmOptions) => Promise<boolean>;
434
- }
435
- /**
436
- * Hook to show alert and confirm dialogs.
437
- * Must be used within a DialogHost.
438
- *
439
- * @example
440
- * ```tsx
441
- * const { alert, confirm } = useDialog();
442
- *
443
- * // Alert
444
- * await alert("Something happened!");
445
- *
446
- * // Confirm
447
- * const ok = await confirm("Delete this item?", {
448
- * okText: "Delete",
449
- * cancelText: "Keep"
450
- * });
451
- * ```
452
- */
453
- declare function useDialog(): DialogContextValue;
454
- interface DialogHostProps {
455
- children?: ReactNode;
456
- }
457
- /**
458
- * Host component for dialogs. Place this at the root of your app.
459
- * Provides the useDialog hook to children.
460
- *
461
- * @example
462
- * ```tsx
463
- * function App() {
464
- * return (
465
- * <DialogHost>
466
- * <MyApp />
467
- * </DialogHost>
468
- * );
469
- * }
470
- * ```
471
- */
472
- declare function DialogHost({ children }: DialogHostProps): React.JSX.Element;
473
-
474
- interface JumpNavProps {
475
- children?: ReactNode;
476
- /** Keybind to activate jump mode (default: "ctrl+o") */
477
- activationKey?: string;
478
- /** Style for the hint labels */
479
- hintStyle?: Style;
480
- /** Color for hint background (default: "yellow") */
481
- hintBg?: Color;
482
- /** Color for hint text (default: "black") */
483
- hintFg?: Color;
484
- /** Characters to use for hints (default: "asdfghjklqwertyuiopzxcvbnm") */
485
- hintChars?: string;
486
- /** Whether jump nav is enabled (default: true) */
487
- enabled?: boolean;
488
- /** Enable debug logging */
489
- debug?: boolean;
490
- }
491
- /**
492
- * JumpNav provides vim-style quick navigation to focusable elements.
493
- * Press the activation key (default: Ctrl+O) to show hints next to each
494
- * focusable element, then press the hint key to jump to that element.
495
- *
496
- * When nested, only the innermost JumpNav will respond to the activation key.
497
- */
498
- declare function JumpNav({ children, activationKey, hintStyle, hintBg, hintFg, hintChars, enabled, debug, }: JumpNavProps): React.JSX.Element;
499
-
500
- declare function useInput(handler: (key: Key) => void, deps?: any[]): void;
501
-
502
- interface UseFocusResult {
503
- focused: boolean;
504
- focus(): void;
505
- }
506
- declare function useFocus(nodeRef?: {
507
- current: GlyphNode | null;
508
- }): UseFocusResult;
509
-
510
- interface UseFocusableOptions {
511
- /** Whether the element is currently disabled (skipped in tab order) */
512
- disabled?: boolean;
513
- /** Called when the element receives focus */
514
- onFocus?: () => void;
515
- /** Called when the element loses focus */
516
- onBlur?: () => void;
517
- /**
518
- * Key handler when focused. Return `true` to consume the key.
519
- * This runs after priority handlers but before global handlers.
520
- */
521
- onKeyPress?: (key: Key) => boolean | void;
522
- }
523
- interface UseFocusableResult {
524
- /** Ref to attach to your focusable element */
525
- ref: (node: GlyphNode | null) => void;
526
- /** Whether this element is currently focused */
527
- isFocused: boolean;
528
- /** Programmatically request focus on this element */
529
- focus: () => void;
530
- /** The focus ID (useful for conditional logic) */
531
- focusId: string | null;
532
- }
533
- /**
534
- * Hook to make any element focusable with keyboard support.
535
- *
536
- * @example
537
- * ```tsx
538
- * function CustomPicker({ onSelect }) {
539
- * const { ref, isFocused, focus } = useFocusable({
540
- * onKeyPress: (key) => {
541
- * if (key.name === "return") {
542
- * onSelect();
543
- * return true;
544
- * }
545
- * return false;
546
- * },
547
- * });
548
- *
549
- * return (
550
- * <Box
551
- * ref={ref}
552
- * focusable
553
- * style={{
554
- * border: "round",
555
- * borderColor: isFocused ? "cyan" : "gray"
556
- * }}
557
- * >
558
- * <Text>Custom Picker</Text>
559
- * </Box>
560
- * );
561
- * }
562
- * ```
563
- */
564
- declare function useFocusable(options?: UseFocusableOptions): UseFocusableResult;
565
-
566
- declare function useLayout(nodeRef?: {
567
- current: GlyphNode | null;
568
- }): LayoutRect;
569
-
570
- interface UseAppResult {
571
- exit(code?: number): void;
572
- columns: number;
573
- rows: number;
574
- }
575
- declare function useApp(): UseAppResult;
576
-
577
- interface FocusableElement {
578
- /** Unique focus ID */
579
- id: string;
580
- /** The GlyphNode */
581
- node: GlyphNode;
582
- /** Current layout (position, size) */
583
- layout: LayoutRect;
584
- /** Node type (box, input, etc.) */
585
- type: string;
586
- }
587
- interface FocusRegistryValue {
588
- /** All currently registered focusable elements */
589
- elements: FocusableElement[];
590
- /** Currently focused element ID */
591
- focusedId: string | null;
592
- /** Request focus on a specific element */
593
- requestFocus: (id: string) => void;
594
- /** Move to next focusable element */
595
- focusNext: () => void;
596
- /** Move to previous focusable element */
597
- focusPrev: () => void;
598
- /** Manually refresh the element list (useful after layout updates) */
599
- refresh: () => void;
600
- }
601
- /**
602
- * Hook to access all registered focusable elements in the current focus context.
603
- * Useful for building custom navigation UIs like jump-to overlays.
604
- */
605
- declare function useFocusRegistry(): FocusRegistryValue | null;
606
-
607
- /**
608
- * Input mask utilities for Glyph Input component.
609
- *
610
- * Mask pattern characters:
611
- * - `9` - Digit (0-9)
612
- * - `a` - Letter (a-z, A-Z)
613
- * - `*` - Alphanumeric (a-z, A-Z, 0-9)
614
- * - Any other character is treated as a literal (separator)
615
- *
616
- * @example
617
- * ```tsx
618
- * import { createMask } from "@nick-skriabin/glyph";
619
- *
620
- * // Phone: (123) 456-7890
621
- * const phoneMask = createMask("(999) 999-9999");
622
- * <Input onBeforeChange={phoneMask} />
623
- *
624
- * // Date: 12/31/2024
625
- * const dateMask = createMask("99/99/9999");
626
- * <Input onBeforeChange={dateMask} />
627
- *
628
- * // License plate: ABC-1234
629
- * const plateMask = createMask("aaa-9999");
630
- * <Input onBeforeChange={plateMask} />
631
- * ```
632
- */
633
- interface MaskOptions {
634
- /** The mask pattern */
635
- mask: string;
636
- /** Placeholder character for unfilled positions (default: "_") */
637
- placeholder?: string;
638
- /** Show placeholder in output (default: false) */
639
- showPlaceholder?: boolean;
640
- }
641
- /**
642
- * Creates a mask handler for use with Input's onBeforeChange prop.
643
- *
644
- * @param maskOrOptions - Mask pattern string or options object
645
- * @returns onBeforeChange handler function
646
- */
647
- declare function createMask(maskOrOptions: string | MaskOptions): (newValue: string, oldValue: string) => string | false | void;
648
- /**
649
- * Pre-built mask patterns for common use cases.
650
- */
651
- declare const masks: {
652
- /** US Phone: (123) 456-7890 */
653
- usPhone: (newValue: string, oldValue: string) => string | false | void;
654
- /** International Phone: +1 234 567 8900 */
655
- intlPhone: (newValue: string, oldValue: string) => string | false | void;
656
- /** Date MM/DD/YYYY */
657
- dateUS: (newValue: string, oldValue: string) => string | false | void;
658
- /** Date DD/MM/YYYY */
659
- dateEU: (newValue: string, oldValue: string) => string | false | void;
660
- /** Date YYYY-MM-DD */
661
- dateISO: (newValue: string, oldValue: string) => string | false | void;
662
- /** Time HH:MM */
663
- time: (newValue: string, oldValue: string) => string | false | void;
664
- /** Time HH:MM:SS */
665
- timeFull: (newValue: string, oldValue: string) => string | false | void;
666
- /** Credit Card: 1234 5678 9012 3456 */
667
- creditCard: (newValue: string, oldValue: string) => string | false | void;
668
- /** SSN: 123-45-6789 */
669
- ssn: (newValue: string, oldValue: string) => string | false | void;
670
- /** ZIP Code: 12345 */
671
- zip: (newValue: string, oldValue: string) => string | false | void;
672
- /** ZIP+4: 12345-6789 */
673
- zipPlus4: (newValue: string, oldValue: string) => string | false | void;
674
- /** IPv4: 192.168.001.001 */
675
- ipv4: (newValue: string, oldValue: string) => string | false | void;
676
- /** MAC Address: AA:BB:CC:DD:EE:FF */
677
- mac: (newValue: string, oldValue: string) => string | false | void;
678
- };
679
-
680
- export { type AlertOptions, type AppHandle, type BorderStyle, Box, type BoxProps, Button, type ButtonProps, Checkbox, type CheckboxProps, type Color, type ConfirmOptions, type DialogContextValue, DialogHost, type DialogHostProps, type DimensionValue, type FocusRegistryValue, FocusScope, type FocusScopeProps, type FocusableElement, type HexColor, Input, type InputProps, type InputType, JumpNav, type JumpNavProps, type Key, Keybind, type KeybindProps, type LayoutRect, List, type ListItemInfo, type ListProps, type MaskOptions, Menu, type MenuItem, type MenuProps, type NamedColor, Portal, type PortalProps, Progress, type ProgressProps, type RGBColor, Radio, type RadioItem, type RadioProps, type RenderOptions, ScrollView, type ScrollViewProps, Select, type SelectItem, type SelectProps, Spacer, type SpacerProps, Spinner, type SpinnerProps, type Style, Text, type TextAlign, type TextProps, type Toast, ToastHost, type ToastHostProps, type ToastPosition, type ToastVariant, type UseFocusableOptions, type UseFocusableResult, type WrapMode, createMask, masks, render, useApp, useDialog, useFocus, useFocusRegistry, useFocusable, useInput, useLayout, useToast };