@rovula/ui 0.0.77 → 0.0.78

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,75 @@
1
+ import React from "react";
2
+ import { InputProps } from "../TextInput/TextInput";
3
+ export type MaskRule = {
4
+ pattern: RegExp;
5
+ placeholder: string;
6
+ isLiteral?: boolean;
7
+ validator?: (char: string) => boolean;
8
+ };
9
+ export type MaskedTextInputProps = InputProps & {
10
+ mask?: string;
11
+ maskChar?: string;
12
+ showMask?: boolean;
13
+ guide?: boolean;
14
+ keepCharPositions?: boolean;
15
+ rules?: Record<string, RegExp | ((char: string) => boolean)>;
16
+ onMaskedChange?: (value: string, rawValue: string) => void;
17
+ };
18
+ export declare const MASK_PATTERNS: {
19
+ readonly PHONE: "(000) 000-0000";
20
+ readonly PHONE_INTL: "+000 000 000 0000";
21
+ readonly CREDIT_CARD: "0000 0000 0000 0000";
22
+ readonly DATE: "00/00/0000";
23
+ readonly TIME: "00:00";
24
+ readonly SSN: "000-00-0000";
25
+ readonly ZIP_CODE: "00000";
26
+ readonly ZIP_CODE_EXT: "00000-0000";
27
+ readonly CURRENCY: "$000,000.00";
28
+ readonly PERCENTAGE: "000%";
29
+ readonly LICENSE_PLATE: "AAA-0000";
30
+ readonly PRODUCT_CODE: "AA-0000-AA";
31
+ readonly ALPHANUMERIC: "AAAA-0000";
32
+ };
33
+ export declare const MaskedTextInput: React.ForwardRefExoticComponent<{
34
+ id?: string;
35
+ label?: string;
36
+ size?: "sm" | "md" | "lg";
37
+ rounded?: "none" | "normal" | "full";
38
+ variant?: "flat" | "outline" | "underline";
39
+ iconMode?: "flat" | "solid";
40
+ type?: React.HTMLInputTypeAttribute;
41
+ helperText?: string;
42
+ errorMessage?: string;
43
+ fullwidth?: boolean;
44
+ disabled?: boolean;
45
+ error?: boolean;
46
+ required?: boolean;
47
+ isFloatingLabel?: boolean;
48
+ keepCloseIconOnValue?: boolean;
49
+ hasClearIcon?: boolean;
50
+ hasSearchIcon?: boolean;
51
+ startIcon?: React.ReactNode;
52
+ endIcon?: React.ReactNode;
53
+ className?: string;
54
+ labelClassName?: string;
55
+ classes?: {
56
+ iconWrapper?: string;
57
+ iconSearchWrapper?: string;
58
+ icon?: string;
59
+ startIconWrapper?: string;
60
+ endIconWrapper?: string;
61
+ };
62
+ onClickStartIcon?: () => void;
63
+ onClickEndIcon?: () => void;
64
+ renderStartIcon?: () => React.ReactNode;
65
+ renderEndIcon?: () => React.ReactNode;
66
+ } & Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> & {
67
+ mask?: string;
68
+ maskChar?: string;
69
+ showMask?: boolean;
70
+ guide?: boolean;
71
+ keepCharPositions?: boolean;
72
+ rules?: Record<string, RegExp | ((char: string) => boolean)>;
73
+ onMaskedChange?: (value: string, rawValue: string) => void;
74
+ } & React.RefAttributes<HTMLInputElement>>;
75
+ export default MaskedTextInput;
@@ -0,0 +1,491 @@
1
+ import React from "react";
2
+ declare const meta: {
3
+ title: string;
4
+ component: React.ForwardRefExoticComponent<{
5
+ id?: string;
6
+ label?: string;
7
+ size?: "sm" | "md" | "lg";
8
+ rounded?: "none" | "normal" | "full";
9
+ variant?: "flat" | "outline" | "underline";
10
+ iconMode?: "flat" | "solid";
11
+ type?: React.HTMLInputTypeAttribute;
12
+ helperText?: string;
13
+ errorMessage?: string;
14
+ fullwidth?: boolean;
15
+ disabled?: boolean;
16
+ error?: boolean;
17
+ required?: boolean;
18
+ isFloatingLabel?: boolean;
19
+ keepCloseIconOnValue?: boolean;
20
+ hasClearIcon?: boolean;
21
+ hasSearchIcon?: boolean;
22
+ startIcon?: React.ReactNode;
23
+ endIcon?: React.ReactNode;
24
+ className?: string;
25
+ labelClassName?: string;
26
+ classes?: {
27
+ iconWrapper?: string;
28
+ iconSearchWrapper?: string;
29
+ icon?: string;
30
+ startIconWrapper?: string;
31
+ endIconWrapper?: string;
32
+ };
33
+ onClickStartIcon?: () => void;
34
+ onClickEndIcon?: () => void;
35
+ renderStartIcon?: () => React.ReactNode;
36
+ renderEndIcon?: () => React.ReactNode;
37
+ } & Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> & {
38
+ mask?: string;
39
+ maskChar?: string;
40
+ showMask?: boolean;
41
+ guide?: boolean;
42
+ keepCharPositions?: boolean;
43
+ rules?: Record<string, RegExp | ((char: string) => boolean)>;
44
+ onMaskedChange?: (value: string, rawValue: string) => void;
45
+ } & React.RefAttributes<HTMLInputElement>>;
46
+ tags: string[];
47
+ parameters: {
48
+ layout: string;
49
+ };
50
+ decorators: ((Story: import("@storybook/csf").PartialStoryFn<import("@storybook/react").ReactRenderer, {
51
+ id?: string | undefined;
52
+ label?: string | undefined;
53
+ size?: "sm" | "md" | "lg" | undefined;
54
+ rounded?: "none" | "normal" | "full" | undefined;
55
+ variant?: "flat" | "outline" | "underline" | undefined;
56
+ iconMode?: "flat" | "solid" | undefined;
57
+ type?: React.HTMLInputTypeAttribute | undefined;
58
+ helperText?: string | undefined;
59
+ errorMessage?: string | undefined;
60
+ fullwidth?: boolean | undefined;
61
+ disabled?: boolean | undefined;
62
+ error?: boolean | undefined;
63
+ required?: boolean | undefined;
64
+ isFloatingLabel?: boolean | undefined;
65
+ keepCloseIconOnValue?: boolean | undefined;
66
+ hasClearIcon?: boolean | undefined;
67
+ hasSearchIcon?: boolean | undefined;
68
+ startIcon?: React.ReactNode;
69
+ endIcon?: React.ReactNode;
70
+ className?: string | undefined;
71
+ labelClassName?: string | undefined;
72
+ classes?: {
73
+ iconWrapper?: string;
74
+ iconSearchWrapper?: string;
75
+ icon?: string;
76
+ startIconWrapper?: string;
77
+ endIconWrapper?: string;
78
+ } | undefined;
79
+ onClickStartIcon?: (() => void) | undefined;
80
+ onClickEndIcon?: (() => void) | undefined;
81
+ renderStartIcon?: (() => React.ReactNode) | undefined;
82
+ renderEndIcon?: (() => React.ReactNode) | undefined;
83
+ suppressHydrationWarning?: boolean | undefined | undefined;
84
+ color?: string | undefined | undefined;
85
+ height?: number | string | undefined | undefined;
86
+ lang?: string | undefined | undefined;
87
+ max?: number | string | undefined | undefined;
88
+ min?: number | string | undefined | undefined;
89
+ name?: string | undefined | undefined;
90
+ style?: React.CSSProperties | undefined;
91
+ width?: number | string | undefined | undefined;
92
+ role?: React.AriaRole | undefined;
93
+ tabIndex?: number | undefined | undefined;
94
+ "aria-activedescendant"?: string | undefined | undefined;
95
+ "aria-atomic"?: (boolean | "true" | "false") | undefined;
96
+ "aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined | undefined;
97
+ "aria-braillelabel"?: string | undefined | undefined;
98
+ "aria-brailleroledescription"?: string | undefined | undefined;
99
+ "aria-busy"?: (boolean | "true" | "false") | undefined;
100
+ "aria-checked"?: boolean | "false" | "mixed" | "true" | undefined | undefined;
101
+ "aria-colcount"?: number | undefined | undefined;
102
+ "aria-colindex"?: number | undefined | undefined;
103
+ "aria-colindextext"?: string | undefined | undefined;
104
+ "aria-colspan"?: number | undefined | undefined;
105
+ "aria-controls"?: string | undefined | undefined;
106
+ "aria-current"?: boolean | "false" | "true" | "page" | "step" | "location" | "date" | "time" | undefined | undefined;
107
+ "aria-describedby"?: string | undefined | undefined;
108
+ "aria-description"?: string | undefined | undefined;
109
+ "aria-details"?: string | undefined | undefined;
110
+ "aria-disabled"?: (boolean | "true" | "false") | undefined;
111
+ "aria-dropeffect"?: "none" | "copy" | "execute" | "link" | "move" | "popup" | undefined | undefined;
112
+ "aria-errormessage"?: string | undefined | undefined;
113
+ "aria-expanded"?: (boolean | "true" | "false") | undefined;
114
+ "aria-flowto"?: string | undefined | undefined;
115
+ "aria-grabbed"?: (boolean | "true" | "false") | undefined;
116
+ "aria-haspopup"?: boolean | "false" | "true" | "menu" | "listbox" | "tree" | "grid" | "dialog" | undefined | undefined;
117
+ "aria-hidden"?: (boolean | "true" | "false") | undefined;
118
+ "aria-invalid"?: boolean | "false" | "true" | "grammar" | "spelling" | undefined | undefined;
119
+ "aria-keyshortcuts"?: string | undefined | undefined;
120
+ "aria-label"?: string | undefined | undefined;
121
+ "aria-labelledby"?: string | undefined | undefined;
122
+ "aria-level"?: number | undefined | undefined;
123
+ "aria-live"?: "off" | "assertive" | "polite" | undefined | undefined;
124
+ "aria-modal"?: (boolean | "true" | "false") | undefined;
125
+ "aria-multiline"?: (boolean | "true" | "false") | undefined;
126
+ "aria-multiselectable"?: (boolean | "true" | "false") | undefined;
127
+ "aria-orientation"?: "horizontal" | "vertical" | undefined | undefined;
128
+ "aria-owns"?: string | undefined | undefined;
129
+ "aria-placeholder"?: string | undefined | undefined;
130
+ "aria-posinset"?: number | undefined | undefined;
131
+ "aria-pressed"?: boolean | "false" | "mixed" | "true" | undefined | undefined;
132
+ "aria-readonly"?: (boolean | "true" | "false") | undefined;
133
+ "aria-relevant"?: "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text" | "text additions" | "text removals" | undefined | undefined;
134
+ "aria-required"?: (boolean | "true" | "false") | undefined;
135
+ "aria-roledescription"?: string | undefined | undefined;
136
+ "aria-rowcount"?: number | undefined | undefined;
137
+ "aria-rowindex"?: number | undefined | undefined;
138
+ "aria-rowindextext"?: string | undefined | undefined;
139
+ "aria-rowspan"?: number | undefined | undefined;
140
+ "aria-selected"?: (boolean | "true" | "false") | undefined;
141
+ "aria-setsize"?: number | undefined | undefined;
142
+ "aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined | undefined;
143
+ "aria-valuemax"?: number | undefined | undefined;
144
+ "aria-valuemin"?: number | undefined | undefined;
145
+ "aria-valuenow"?: number | undefined | undefined;
146
+ "aria-valuetext"?: string | undefined | undefined;
147
+ children?: React.ReactNode;
148
+ dangerouslySetInnerHTML?: {
149
+ __html: string | TrustedHTML;
150
+ } | undefined | undefined;
151
+ onCopy?: React.ClipboardEventHandler<HTMLInputElement> | undefined;
152
+ onCopyCapture?: React.ClipboardEventHandler<HTMLInputElement> | undefined;
153
+ onCut?: React.ClipboardEventHandler<HTMLInputElement> | undefined;
154
+ onCutCapture?: React.ClipboardEventHandler<HTMLInputElement> | undefined;
155
+ onPaste?: React.ClipboardEventHandler<HTMLInputElement> | undefined;
156
+ onPasteCapture?: React.ClipboardEventHandler<HTMLInputElement> | undefined;
157
+ onCompositionEnd?: React.CompositionEventHandler<HTMLInputElement> | undefined;
158
+ onCompositionEndCapture?: React.CompositionEventHandler<HTMLInputElement> | undefined;
159
+ onCompositionStart?: React.CompositionEventHandler<HTMLInputElement> | undefined;
160
+ onCompositionStartCapture?: React.CompositionEventHandler<HTMLInputElement> | undefined;
161
+ onCompositionUpdate?: React.CompositionEventHandler<HTMLInputElement> | undefined;
162
+ onCompositionUpdateCapture?: React.CompositionEventHandler<HTMLInputElement> | undefined;
163
+ onFocus?: React.FocusEventHandler<HTMLInputElement> | undefined;
164
+ onFocusCapture?: React.FocusEventHandler<HTMLInputElement> | undefined;
165
+ onBlur?: React.FocusEventHandler<HTMLInputElement> | undefined;
166
+ onBlurCapture?: React.FocusEventHandler<HTMLInputElement> | undefined;
167
+ onChange?: React.ChangeEventHandler<HTMLInputElement> | undefined;
168
+ onChangeCapture?: React.FormEventHandler<HTMLInputElement> | undefined;
169
+ onBeforeInput?: React.FormEventHandler<HTMLInputElement> | undefined;
170
+ onBeforeInputCapture?: React.FormEventHandler<HTMLInputElement> | undefined;
171
+ onInput?: React.FormEventHandler<HTMLInputElement> | undefined;
172
+ onInputCapture?: React.FormEventHandler<HTMLInputElement> | undefined;
173
+ onReset?: React.FormEventHandler<HTMLInputElement> | undefined;
174
+ onResetCapture?: React.FormEventHandler<HTMLInputElement> | undefined;
175
+ onSubmit?: React.FormEventHandler<HTMLInputElement> | undefined;
176
+ onSubmitCapture?: React.FormEventHandler<HTMLInputElement> | undefined;
177
+ onInvalid?: React.FormEventHandler<HTMLInputElement> | undefined;
178
+ onInvalidCapture?: React.FormEventHandler<HTMLInputElement> | undefined;
179
+ onLoad?: React.ReactEventHandler<HTMLInputElement> | undefined;
180
+ onLoadCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
181
+ onError?: React.ReactEventHandler<HTMLInputElement> | undefined;
182
+ onErrorCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
183
+ onKeyDown?: React.KeyboardEventHandler<HTMLInputElement> | undefined;
184
+ onKeyDownCapture?: React.KeyboardEventHandler<HTMLInputElement> | undefined;
185
+ onKeyPress?: React.KeyboardEventHandler<HTMLInputElement> | undefined;
186
+ onKeyPressCapture?: React.KeyboardEventHandler<HTMLInputElement> | undefined;
187
+ onKeyUp?: React.KeyboardEventHandler<HTMLInputElement> | undefined;
188
+ onKeyUpCapture?: React.KeyboardEventHandler<HTMLInputElement> | undefined;
189
+ onAbort?: React.ReactEventHandler<HTMLInputElement> | undefined;
190
+ onAbortCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
191
+ onCanPlay?: React.ReactEventHandler<HTMLInputElement> | undefined;
192
+ onCanPlayCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
193
+ onCanPlayThrough?: React.ReactEventHandler<HTMLInputElement> | undefined;
194
+ onCanPlayThroughCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
195
+ onDurationChange?: React.ReactEventHandler<HTMLInputElement> | undefined;
196
+ onDurationChangeCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
197
+ onEmptied?: React.ReactEventHandler<HTMLInputElement> | undefined;
198
+ onEmptiedCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
199
+ onEncrypted?: React.ReactEventHandler<HTMLInputElement> | undefined;
200
+ onEncryptedCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
201
+ onEnded?: React.ReactEventHandler<HTMLInputElement> | undefined;
202
+ onEndedCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
203
+ onLoadedData?: React.ReactEventHandler<HTMLInputElement> | undefined;
204
+ onLoadedDataCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
205
+ onLoadedMetadata?: React.ReactEventHandler<HTMLInputElement> | undefined;
206
+ onLoadedMetadataCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
207
+ onLoadStart?: React.ReactEventHandler<HTMLInputElement> | undefined;
208
+ onLoadStartCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
209
+ onPause?: React.ReactEventHandler<HTMLInputElement> | undefined;
210
+ onPauseCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
211
+ onPlay?: React.ReactEventHandler<HTMLInputElement> | undefined;
212
+ onPlayCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
213
+ onPlaying?: React.ReactEventHandler<HTMLInputElement> | undefined;
214
+ onPlayingCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
215
+ onProgress?: React.ReactEventHandler<HTMLInputElement> | undefined;
216
+ onProgressCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
217
+ onRateChange?: React.ReactEventHandler<HTMLInputElement> | undefined;
218
+ onRateChangeCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
219
+ onResize?: React.ReactEventHandler<HTMLInputElement> | undefined;
220
+ onResizeCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
221
+ onSeeked?: React.ReactEventHandler<HTMLInputElement> | undefined;
222
+ onSeekedCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
223
+ onSeeking?: React.ReactEventHandler<HTMLInputElement> | undefined;
224
+ onSeekingCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
225
+ onStalled?: React.ReactEventHandler<HTMLInputElement> | undefined;
226
+ onStalledCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
227
+ onSuspend?: React.ReactEventHandler<HTMLInputElement> | undefined;
228
+ onSuspendCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
229
+ onTimeUpdate?: React.ReactEventHandler<HTMLInputElement> | undefined;
230
+ onTimeUpdateCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
231
+ onVolumeChange?: React.ReactEventHandler<HTMLInputElement> | undefined;
232
+ onVolumeChangeCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
233
+ onWaiting?: React.ReactEventHandler<HTMLInputElement> | undefined;
234
+ onWaitingCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
235
+ onAuxClick?: React.MouseEventHandler<HTMLInputElement> | undefined;
236
+ onAuxClickCapture?: React.MouseEventHandler<HTMLInputElement> | undefined;
237
+ onClick?: React.MouseEventHandler<HTMLInputElement> | undefined;
238
+ onClickCapture?: React.MouseEventHandler<HTMLInputElement> | undefined;
239
+ onContextMenu?: React.MouseEventHandler<HTMLInputElement> | undefined;
240
+ onContextMenuCapture?: React.MouseEventHandler<HTMLInputElement> | undefined;
241
+ onDoubleClick?: React.MouseEventHandler<HTMLInputElement> | undefined;
242
+ onDoubleClickCapture?: React.MouseEventHandler<HTMLInputElement> | undefined;
243
+ onDrag?: React.DragEventHandler<HTMLInputElement> | undefined;
244
+ onDragCapture?: React.DragEventHandler<HTMLInputElement> | undefined;
245
+ onDragEnd?: React.DragEventHandler<HTMLInputElement> | undefined;
246
+ onDragEndCapture?: React.DragEventHandler<HTMLInputElement> | undefined;
247
+ onDragEnter?: React.DragEventHandler<HTMLInputElement> | undefined;
248
+ onDragEnterCapture?: React.DragEventHandler<HTMLInputElement> | undefined;
249
+ onDragExit?: React.DragEventHandler<HTMLInputElement> | undefined;
250
+ onDragExitCapture?: React.DragEventHandler<HTMLInputElement> | undefined;
251
+ onDragLeave?: React.DragEventHandler<HTMLInputElement> | undefined;
252
+ onDragLeaveCapture?: React.DragEventHandler<HTMLInputElement> | undefined;
253
+ onDragOver?: React.DragEventHandler<HTMLInputElement> | undefined;
254
+ onDragOverCapture?: React.DragEventHandler<HTMLInputElement> | undefined;
255
+ onDragStart?: React.DragEventHandler<HTMLInputElement> | undefined;
256
+ onDragStartCapture?: React.DragEventHandler<HTMLInputElement> | undefined;
257
+ onDrop?: React.DragEventHandler<HTMLInputElement> | undefined;
258
+ onDropCapture?: React.DragEventHandler<HTMLInputElement> | undefined;
259
+ onMouseDown?: React.MouseEventHandler<HTMLInputElement> | undefined;
260
+ onMouseDownCapture?: React.MouseEventHandler<HTMLInputElement> | undefined;
261
+ onMouseEnter?: React.MouseEventHandler<HTMLInputElement> | undefined;
262
+ onMouseLeave?: React.MouseEventHandler<HTMLInputElement> | undefined;
263
+ onMouseMove?: React.MouseEventHandler<HTMLInputElement> | undefined;
264
+ onMouseMoveCapture?: React.MouseEventHandler<HTMLInputElement> | undefined;
265
+ onMouseOut?: React.MouseEventHandler<HTMLInputElement> | undefined;
266
+ onMouseOutCapture?: React.MouseEventHandler<HTMLInputElement> | undefined;
267
+ onMouseOver?: React.MouseEventHandler<HTMLInputElement> | undefined;
268
+ onMouseOverCapture?: React.MouseEventHandler<HTMLInputElement> | undefined;
269
+ onMouseUp?: React.MouseEventHandler<HTMLInputElement> | undefined;
270
+ onMouseUpCapture?: React.MouseEventHandler<HTMLInputElement> | undefined;
271
+ onSelect?: React.ReactEventHandler<HTMLInputElement> | undefined;
272
+ onSelectCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
273
+ onTouchCancel?: React.TouchEventHandler<HTMLInputElement> | undefined;
274
+ onTouchCancelCapture?: React.TouchEventHandler<HTMLInputElement> | undefined;
275
+ onTouchEnd?: React.TouchEventHandler<HTMLInputElement> | undefined;
276
+ onTouchEndCapture?: React.TouchEventHandler<HTMLInputElement> | undefined;
277
+ onTouchMove?: React.TouchEventHandler<HTMLInputElement> | undefined;
278
+ onTouchMoveCapture?: React.TouchEventHandler<HTMLInputElement> | undefined;
279
+ onTouchStart?: React.TouchEventHandler<HTMLInputElement> | undefined;
280
+ onTouchStartCapture?: React.TouchEventHandler<HTMLInputElement> | undefined;
281
+ onPointerDown?: React.PointerEventHandler<HTMLInputElement> | undefined;
282
+ onPointerDownCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
283
+ onPointerMove?: React.PointerEventHandler<HTMLInputElement> | undefined;
284
+ onPointerMoveCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
285
+ onPointerUp?: React.PointerEventHandler<HTMLInputElement> | undefined;
286
+ onPointerUpCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
287
+ onPointerCancel?: React.PointerEventHandler<HTMLInputElement> | undefined;
288
+ onPointerCancelCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
289
+ onPointerEnter?: React.PointerEventHandler<HTMLInputElement> | undefined;
290
+ onPointerLeave?: React.PointerEventHandler<HTMLInputElement> | undefined;
291
+ onPointerOver?: React.PointerEventHandler<HTMLInputElement> | undefined;
292
+ onPointerOverCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
293
+ onPointerOut?: React.PointerEventHandler<HTMLInputElement> | undefined;
294
+ onPointerOutCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
295
+ onGotPointerCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
296
+ onGotPointerCaptureCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
297
+ onLostPointerCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
298
+ onLostPointerCaptureCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
299
+ onScroll?: React.UIEventHandler<HTMLInputElement> | undefined;
300
+ onScrollCapture?: React.UIEventHandler<HTMLInputElement> | undefined;
301
+ onWheel?: React.WheelEventHandler<HTMLInputElement> | undefined;
302
+ onWheelCapture?: React.WheelEventHandler<HTMLInputElement> | undefined;
303
+ onAnimationStart?: React.AnimationEventHandler<HTMLInputElement> | undefined;
304
+ onAnimationStartCapture?: React.AnimationEventHandler<HTMLInputElement> | undefined;
305
+ onAnimationEnd?: React.AnimationEventHandler<HTMLInputElement> | undefined;
306
+ onAnimationEndCapture?: React.AnimationEventHandler<HTMLInputElement> | undefined;
307
+ onAnimationIteration?: React.AnimationEventHandler<HTMLInputElement> | undefined;
308
+ onAnimationIterationCapture?: React.AnimationEventHandler<HTMLInputElement> | undefined;
309
+ onTransitionEnd?: React.TransitionEventHandler<HTMLInputElement> | undefined;
310
+ onTransitionEndCapture?: React.TransitionEventHandler<HTMLInputElement> | undefined;
311
+ form?: string | undefined | undefined;
312
+ list?: string | undefined | undefined;
313
+ step?: number | string | undefined | undefined;
314
+ title?: string | undefined | undefined;
315
+ formAction?: string | undefined;
316
+ formEncType?: string | undefined | undefined;
317
+ formMethod?: string | undefined | undefined;
318
+ formNoValidate?: boolean | undefined | undefined;
319
+ formTarget?: string | undefined | undefined;
320
+ value?: string | number | readonly string[] | undefined;
321
+ defaultChecked?: boolean | undefined | undefined;
322
+ defaultValue?: string | number | readonly string[] | undefined;
323
+ suppressContentEditableWarning?: boolean | undefined | undefined;
324
+ accessKey?: string | undefined | undefined;
325
+ autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {}) | undefined;
326
+ autoFocus?: boolean | undefined | undefined;
327
+ contentEditable?: "inherit" | (boolean | "true" | "false") | "plaintext-only" | undefined;
328
+ contextMenu?: string | undefined | undefined;
329
+ dir?: string | undefined | undefined;
330
+ draggable?: (boolean | "true" | "false") | undefined;
331
+ enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
332
+ hidden?: boolean | undefined | undefined;
333
+ nonce?: string | undefined | undefined;
334
+ slot?: string | undefined | undefined;
335
+ spellCheck?: (boolean | "true" | "false") | undefined;
336
+ translate?: "yes" | "no" | undefined | undefined;
337
+ radioGroup?: string | undefined | undefined;
338
+ about?: string | undefined | undefined;
339
+ content?: string | undefined | undefined;
340
+ datatype?: string | undefined | undefined;
341
+ inlist?: any;
342
+ prefix?: string | undefined | undefined;
343
+ property?: string | undefined | undefined;
344
+ rel?: string | undefined | undefined;
345
+ resource?: string | undefined | undefined;
346
+ rev?: string | undefined | undefined;
347
+ typeof?: string | undefined | undefined;
348
+ vocab?: string | undefined | undefined;
349
+ autoCorrect?: string | undefined | undefined;
350
+ autoSave?: string | undefined | undefined;
351
+ itemProp?: string | undefined | undefined;
352
+ itemScope?: boolean | undefined | undefined;
353
+ itemType?: string | undefined | undefined;
354
+ itemID?: string | undefined | undefined;
355
+ itemRef?: string | undefined | undefined;
356
+ results?: number | undefined | undefined;
357
+ security?: string | undefined | undefined;
358
+ unselectable?: "on" | "off" | undefined | undefined;
359
+ inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined | undefined;
360
+ is?: string | undefined | undefined;
361
+ accept?: string | undefined | undefined;
362
+ alt?: string | undefined | undefined;
363
+ autoComplete?: React.HTMLInputAutoCompleteAttribute | undefined;
364
+ capture?: boolean | "user" | "environment" | undefined | undefined;
365
+ checked?: boolean | undefined | undefined;
366
+ maxLength?: number | undefined | undefined;
367
+ minLength?: number | undefined | undefined;
368
+ multiple?: boolean | undefined | undefined;
369
+ pattern?: string | undefined | undefined;
370
+ placeholder?: string | undefined | undefined;
371
+ readOnly?: boolean | undefined | undefined;
372
+ src?: string | undefined | undefined;
373
+ mask?: string | undefined;
374
+ maskChar?: string | undefined;
375
+ showMask?: boolean | undefined;
376
+ guide?: boolean | undefined;
377
+ keepCharPositions?: boolean | undefined;
378
+ rules?: Record<string, RegExp | ((char: string) => boolean)> | undefined;
379
+ onMaskedChange?: ((value: string, rawValue: string) => void) | undefined;
380
+ ref?: React.LegacyRef<HTMLInputElement> | undefined;
381
+ key?: React.Key | null | undefined;
382
+ }>) => import("react/jsx-runtime").JSX.Element)[];
383
+ };
384
+ export default meta;
385
+ export declare const Default: {
386
+ args: {
387
+ label: string;
388
+ mask: "(000) 000-0000";
389
+ fullwidth: boolean;
390
+ };
391
+ render: (args: {}) => import("react/jsx-runtime").JSX.Element;
392
+ };
393
+ export declare const PhoneNumber: {
394
+ args: {
395
+ label: string;
396
+ mask: "(000) 000-0000";
397
+ fullwidth: boolean;
398
+ };
399
+ render: (args: {}) => import("react/jsx-runtime").JSX.Element;
400
+ };
401
+ export declare const CreditCard: {
402
+ args: {
403
+ label: string;
404
+ mask: "0000 0000 0000 0000";
405
+ fullwidth: boolean;
406
+ };
407
+ render: (args: {}) => import("react/jsx-runtime").JSX.Element;
408
+ };
409
+ export declare const DateAndTime: {
410
+ args: {
411
+ label: string;
412
+ mask: "00/00/0000";
413
+ fullwidth: boolean;
414
+ };
415
+ render: (args: {}) => import("react/jsx-runtime").JSX.Element;
416
+ };
417
+ export declare const SocialSecurityNumber: {
418
+ args: {
419
+ label: string;
420
+ mask: "000-00-0000";
421
+ fullwidth: boolean;
422
+ };
423
+ render: (args: {}) => import("react/jsx-runtime").JSX.Element;
424
+ };
425
+ export declare const ZipCode: {
426
+ args: {
427
+ label: string;
428
+ mask: "00000";
429
+ fullwidth: boolean;
430
+ };
431
+ render: (args: {}) => import("react/jsx-runtime").JSX.Element;
432
+ };
433
+ export declare const Currency: {
434
+ args: {
435
+ label: string;
436
+ mask: "$000,000.00";
437
+ fullwidth: boolean;
438
+ };
439
+ render: (args: {}) => import("react/jsx-runtime").JSX.Element;
440
+ };
441
+ export declare const CustomMask: {
442
+ args: {
443
+ label: string;
444
+ mask: string;
445
+ fullwidth: boolean;
446
+ };
447
+ render: (args: {}) => import("react/jsx-runtime").JSX.Element;
448
+ };
449
+ export declare const MaskOptions: {
450
+ args: {
451
+ label: string;
452
+ mask: "(000) 000-0000";
453
+ fullwidth: boolean;
454
+ };
455
+ render: (args: {}) => import("react/jsx-runtime").JSX.Element;
456
+ };
457
+ export declare const WithCallbacks: {
458
+ args: {
459
+ label: string;
460
+ mask: "(000) 000-0000";
461
+ fullwidth: boolean;
462
+ };
463
+ render: (args: {}) => import("react/jsx-runtime").JSX.Element;
464
+ };
465
+ export declare const AllPatterns: {
466
+ args: {
467
+ fullwidth: boolean;
468
+ };
469
+ render: (args: {}) => import("react/jsx-runtime").JSX.Element;
470
+ };
471
+ export declare const KendoRules: {
472
+ args: {
473
+ label: string;
474
+ fullwidth: boolean;
475
+ };
476
+ render: (args: {}) => import("react/jsx-runtime").JSX.Element;
477
+ };
478
+ export declare const OptionalRules: {
479
+ args: {
480
+ label: string;
481
+ fullwidth: boolean;
482
+ };
483
+ render: (args: {}) => import("react/jsx-runtime").JSX.Element;
484
+ };
485
+ export declare const CustomRules: {
486
+ args: {
487
+ label: string;
488
+ fullwidth: boolean;
489
+ };
490
+ render: (args: {}) => import("react/jsx-runtime").JSX.Element;
491
+ };
@@ -0,0 +1,3 @@
1
+ export { default } from "./MaskedTextInput";
2
+ export type { MaskedTextInputProps, MaskRule } from "./MaskedTextInput";
3
+ export { MASK_PATTERNS } from "./MaskedTextInput";
@@ -2,6 +2,7 @@ import "./theme/global.css";
2
2
  import "./icons/iconConfig";
3
3
  export { default as Button } from "./components/Button/Button";
4
4
  export { default as TextInput } from "./components/TextInput/TextInput";
5
+ export { default as MaskedTextInput } from "./components/MaskedTextInput";
5
6
  export { NumberInput } from "./components/NumberInput/NumberInput";
6
7
  export { default as TextArea } from "./components/TextArea/TextArea";
7
8
  export { default as Text } from "./components/Text/Text";
@@ -39,6 +40,7 @@ export * from "./components/FocusedScrollView/FocusedScrollView";
39
40
  export * from "./components/RadioGroup/RadioGroup";
40
41
  export type { ButtonProps } from "./components/Button/Button";
41
42
  export type { InputProps } from "./components/TextInput/TextInput";
43
+ export type { MaskedTextInputProps, MaskRule, } from "./components/MaskedTextInput";
42
44
  export type { NumberInputProps } from "./components/NumberInput/NumberInput";
43
45
  export type { TextAreaProps } from "./components/TextArea/TextArea";
44
46
  export type { DropdownProps, Options } from "./components/Dropdown/Dropdown";
package/dist/index.d.ts CHANGED
@@ -113,6 +113,64 @@ declare const TextInput: React__default.ForwardRefExoticComponent<{
113
113
  renderEndIcon?: () => ReactNode;
114
114
  } & Omit<React__default.InputHTMLAttributes<HTMLInputElement>, "size"> & React__default.RefAttributes<HTMLInputElement>>;
115
115
 
116
+ type MaskRule = {
117
+ pattern: RegExp;
118
+ placeholder: string;
119
+ isLiteral?: boolean;
120
+ validator?: (char: string) => boolean;
121
+ };
122
+ type MaskedTextInputProps = InputProps & {
123
+ mask?: string;
124
+ maskChar?: string;
125
+ showMask?: boolean;
126
+ guide?: boolean;
127
+ keepCharPositions?: boolean;
128
+ rules?: Record<string, RegExp | ((char: string) => boolean)>;
129
+ onMaskedChange?: (value: string, rawValue: string) => void;
130
+ };
131
+ declare const MaskedTextInput: React__default.ForwardRefExoticComponent<{
132
+ id?: string;
133
+ label?: string;
134
+ size?: "sm" | "md" | "lg";
135
+ rounded?: "none" | "normal" | "full";
136
+ variant?: "flat" | "outline" | "underline";
137
+ iconMode?: "flat" | "solid";
138
+ type?: React__default.HTMLInputTypeAttribute;
139
+ helperText?: string;
140
+ errorMessage?: string;
141
+ fullwidth?: boolean;
142
+ disabled?: boolean;
143
+ error?: boolean;
144
+ required?: boolean;
145
+ isFloatingLabel?: boolean;
146
+ keepCloseIconOnValue?: boolean;
147
+ hasClearIcon?: boolean;
148
+ hasSearchIcon?: boolean;
149
+ startIcon?: React__default.ReactNode;
150
+ endIcon?: React__default.ReactNode;
151
+ className?: string;
152
+ labelClassName?: string;
153
+ classes?: {
154
+ iconWrapper?: string;
155
+ iconSearchWrapper?: string;
156
+ icon?: string;
157
+ startIconWrapper?: string;
158
+ endIconWrapper?: string;
159
+ };
160
+ onClickStartIcon?: () => void;
161
+ onClickEndIcon?: () => void;
162
+ renderStartIcon?: () => React__default.ReactNode;
163
+ renderEndIcon?: () => React__default.ReactNode;
164
+ } & Omit<React__default.InputHTMLAttributes<HTMLInputElement>, "size"> & {
165
+ mask?: string;
166
+ maskChar?: string;
167
+ showMask?: boolean;
168
+ guide?: boolean;
169
+ keepCharPositions?: boolean;
170
+ rules?: Record<string, RegExp | ((char: string) => boolean)>;
171
+ onMaskedChange?: (value: string, rawValue: string) => void;
172
+ } & React__default.RefAttributes<HTMLInputElement>>;
173
+
116
174
  type NumberInputProps = Omit<InputProps, "type" | "value" | "defaultValue" | "onChange"> & {
117
175
  value?: number | string;
118
176
  defaultValue?: number | string;
@@ -860,4 +918,4 @@ declare function usePrevious<T>(value: T): T | undefined;
860
918
 
861
919
  declare function cn(...inputs: ClassValue[]): string;
862
920
 
863
- export { ActionButton, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, Button, type ButtonProps, Calendar, Checkbox, Collapsible, type CustomSliderProps, DataTable, type DataTableProps, DatePicker, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Dropdown, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, type DropdownProps, FocusedScrollView, Icon, Input, InputFilter, type InputFilterProps, type InputProps, Label, Loading, Navbar, type NavbarProps, NumberInput, type NumberInputProps, type Options$1 as Options, Popover, PopoverContent, PopoverTrigger, ProgressBar, RadioGroup, RadioGroupItem, Search, type SearchProps, Slider, type SliderProps, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, Text, TextArea, type TextAreaProps, TextInput, Toast$1 as Toast, ToastAction, type ToastActionElement, ToastClose, ToastDescription, type ToastProps, ToastProvider, ToastTitle, ToastViewport, Toaster, Tooltip, TooltipArrow, TooltipContent, TooltipProvider, TooltipSimple, TooltipTrigger, Tree, type TreeData, TreeItem, type TreeItemProps, type TreeProps, cn, getEndDateOfDay, getStartDateOfDay, getStartEndTimestampOfDay, getTimestampUTC, reducer, resloveTimestamp, toast, usePrevious, useToast };
921
+ export { ActionButton, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, Button, type ButtonProps, Calendar, Checkbox, Collapsible, type CustomSliderProps, DataTable, type DataTableProps, DatePicker, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Dropdown, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, type DropdownProps, FocusedScrollView, Icon, Input, InputFilter, type InputFilterProps, type InputProps, Label, Loading, type MaskRule, MaskedTextInput, type MaskedTextInputProps, Navbar, type NavbarProps, NumberInput, type NumberInputProps, type Options$1 as Options, Popover, PopoverContent, PopoverTrigger, ProgressBar, RadioGroup, RadioGroupItem, Search, type SearchProps, Slider, type SliderProps, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, Text, TextArea, type TextAreaProps, TextInput, Toast$1 as Toast, ToastAction, type ToastActionElement, ToastClose, ToastDescription, type ToastProps, ToastProvider, ToastTitle, ToastViewport, Toaster, Tooltip, TooltipArrow, TooltipContent, TooltipProvider, TooltipSimple, TooltipTrigger, Tree, type TreeData, TreeItem, type TreeItemProps, type TreeProps, cn, getEndDateOfDay, getStartDateOfDay, getStartEndTimestampOfDay, getTimestampUTC, reducer, resloveTimestamp, toast, usePrevious, useToast };