mimir-ui-kit 0.0.12 → 0.0.14

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. package/dist/{index4.css → assets/Button.css} +1 -1
  2. package/dist/assets/Input.css +1 -0
  3. package/dist/assets/InputPassword.css +1 -0
  4. package/dist/assets/OtpInput.css +1 -0
  5. package/dist/assets/index.css +1 -0
  6. package/dist/components/Button/Button.d.ts +84 -0
  7. package/dist/components/Button/Button.js +86 -0
  8. package/dist/components/Button/constants.js +33 -5
  9. package/dist/components/Button/index.d.ts +2 -84
  10. package/dist/components/Button/index.js +7 -51
  11. package/dist/components/Button/types.d.ts +2 -2
  12. package/dist/components/Input/Input.d.ts +63 -0
  13. package/dist/components/Input/Input.js +109 -0
  14. package/dist/components/Input/constants.js +16 -3
  15. package/dist/components/Input/index.d.ts +3 -29
  16. package/dist/components/Input/index.js +5 -59
  17. package/dist/components/Input/types.d.ts +11 -0
  18. package/dist/components/Input/types.js +1 -0
  19. package/dist/components/InputPassword/InputPassword.d.ts +12 -0
  20. package/dist/components/InputPassword/InputPassword.js +38 -0
  21. package/dist/components/InputPassword/index.d.ts +2 -306
  22. package/dist/components/InputPassword/index.js +2 -20
  23. package/dist/components/InputPhoneNumber/InputPhoneNumber.d.ts +12 -0
  24. package/dist/components/InputPhoneNumber/InputPhoneNumber.js +38 -0
  25. package/dist/components/InputPhoneNumber/index.d.ts +1 -306
  26. package/dist/components/InputPhoneNumber/index.js +2 -26
  27. package/dist/components/InputPhoneNumber/utils.js +24 -7
  28. package/dist/components/OtpInput/OtpInput.d.ts +28 -0
  29. package/dist/components/OtpInput/OtpInput.js +133 -0
  30. package/dist/components/OtpInput/constants.d.ts +1 -0
  31. package/dist/components/OtpInput/constants.js +6 -3
  32. package/dist/components/OtpInput/index.d.ts +1 -18
  33. package/dist/components/OtpInput/index.js +2 -85
  34. package/dist/components/icons/Eye.js +31 -20
  35. package/dist/components/icons/index.js +2 -2
  36. package/dist/components/index.d.ts +4 -4
  37. package/dist/components/index.js +18 -18
  38. package/dist/hooks/index.js +4 -4
  39. package/dist/hooks/useMediaQuery/constants.js +9 -2
  40. package/dist/hooks/useMediaQuery/index.js +4 -4
  41. package/dist/hooks/useMediaQuery/useMediaQuery.js +13 -10
  42. package/dist/index-CweZ_OcN.js +65 -0
  43. package/dist/index.d.ts +2 -1
  44. package/dist/index.js +23 -21
  45. package/package.json +91 -91
  46. package/dist/assets/styles/index.css +0 -1
  47. package/dist/components/Button/Button.stories.d.ts +0 -67
  48. package/dist/components/Input/Input.stories.d.ts +0 -13
  49. package/dist/components/InputPassword/Input.stories.d.ts +0 -7
  50. package/dist/components/InputPhoneNumber/Input.stories.d.ts +0 -335
  51. package/dist/components/OtpInput/Input.stories.d.ts +0 -26
  52. package/dist/index-DIxK0V-G.js +0 -44
  53. package/dist/index.css +0 -1
  54. package/dist/index2.css +0 -1
  55. package/dist/index3.css +0 -1
  56. package/dist/utils/getLog.d.ts +0 -1
  57. package/dist/utils/getLog.js +0 -4
  58. package/dist/utils/index.d.ts +0 -1
  59. package/dist/utils/index.js +0 -4
@@ -1,306 +1 @@
1
- export type ImperativeHandle = Partial<HTMLInputElement> & {
2
- getPhoneNumber: () => string;
3
- };
4
- export declare const InputPhoneNumber: import('react').MemoExoticComponent<import('react').ForwardRefExoticComponent<{
5
- form?: string | undefined;
6
- slot?: string | undefined;
7
- style?: import('react').CSSProperties | undefined;
8
- title?: string | undefined;
9
- pattern?: string | undefined;
10
- disabled?: boolean | undefined;
11
- formAction?: string | import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS[keyof import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS] | undefined;
12
- formEncType?: string | undefined;
13
- formMethod?: string | undefined;
14
- formNoValidate?: boolean | undefined;
15
- formTarget?: string | undefined;
16
- name?: string | undefined;
17
- type?: import('react').HTMLInputTypeAttribute | undefined;
18
- value?: string | readonly string[] | number | undefined;
19
- defaultChecked?: boolean | undefined;
20
- defaultValue?: string | number | readonly string[] | undefined;
21
- suppressContentEditableWarning?: boolean | undefined;
22
- suppressHydrationWarning?: boolean | undefined;
23
- accessKey?: string | undefined;
24
- autoFocus?: boolean | undefined;
25
- className?: string | undefined;
26
- contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
27
- contextMenu?: string | undefined;
28
- dir?: string | undefined;
29
- draggable?: (boolean | "true" | "false") | undefined;
30
- hidden?: boolean | undefined;
31
- id?: string | undefined;
32
- lang?: string | undefined;
33
- nonce?: string | undefined;
34
- spellCheck?: (boolean | "true" | "false") | undefined;
35
- tabIndex?: number | undefined;
36
- translate?: "yes" | "no" | undefined;
37
- radioGroup?: string | undefined;
38
- role?: import('react').AriaRole | undefined;
39
- about?: string | undefined;
40
- content?: string | undefined;
41
- datatype?: string | undefined;
42
- inlist?: any;
43
- prefix?: string | undefined;
44
- property?: string | undefined;
45
- rel?: string | undefined;
46
- resource?: string | undefined;
47
- rev?: string | undefined;
48
- typeof?: string | undefined;
49
- vocab?: string | undefined;
50
- autoCapitalize?: string | undefined;
51
- autoCorrect?: string | undefined;
52
- autoSave?: string | undefined;
53
- color?: string | undefined;
54
- itemProp?: string | undefined;
55
- itemScope?: boolean | undefined;
56
- itemType?: string | undefined;
57
- itemID?: string | undefined;
58
- itemRef?: string | undefined;
59
- results?: number | undefined;
60
- security?: string | undefined;
61
- unselectable?: "on" | "off" | undefined;
62
- inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined;
63
- is?: string | undefined;
64
- "aria-activedescendant"?: string | undefined;
65
- "aria-atomic"?: (boolean | "true" | "false") | undefined;
66
- "aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined;
67
- "aria-braillelabel"?: string | undefined;
68
- "aria-brailleroledescription"?: string | undefined;
69
- "aria-busy"?: (boolean | "true" | "false") | undefined;
70
- "aria-checked"?: boolean | "false" | "mixed" | "true" | undefined;
71
- "aria-colcount"?: number | undefined;
72
- "aria-colindex"?: number | undefined;
73
- "aria-colindextext"?: string | undefined;
74
- "aria-colspan"?: number | undefined;
75
- "aria-controls"?: string | undefined;
76
- "aria-current"?: boolean | "false" | "true" | "page" | "step" | "location" | "date" | "time" | undefined;
77
- "aria-describedby"?: string | undefined;
78
- "aria-description"?: string | undefined;
79
- "aria-details"?: string | undefined;
80
- "aria-disabled"?: (boolean | "true" | "false") | undefined;
81
- "aria-dropeffect"?: "none" | "copy" | "execute" | "link" | "move" | "popup" | undefined;
82
- "aria-errormessage"?: string | undefined;
83
- "aria-expanded"?: (boolean | "true" | "false") | undefined;
84
- "aria-flowto"?: string | undefined;
85
- "aria-grabbed"?: (boolean | "true" | "false") | undefined;
86
- "aria-haspopup"?: boolean | "false" | "true" | "menu" | "listbox" | "tree" | "grid" | "dialog" | undefined;
87
- "aria-hidden"?: (boolean | "true" | "false") | undefined;
88
- "aria-invalid"?: boolean | "false" | "true" | "grammar" | "spelling" | undefined;
89
- "aria-keyshortcuts"?: string | undefined;
90
- "aria-label"?: string | undefined;
91
- "aria-labelledby"?: string | undefined;
92
- "aria-level"?: number | undefined;
93
- "aria-live"?: "off" | "assertive" | "polite" | undefined;
94
- "aria-modal"?: (boolean | "true" | "false") | undefined;
95
- "aria-multiline"?: (boolean | "true" | "false") | undefined;
96
- "aria-multiselectable"?: (boolean | "true" | "false") | undefined;
97
- "aria-orientation"?: "horizontal" | "vertical" | undefined;
98
- "aria-owns"?: string | undefined;
99
- "aria-placeholder"?: string | undefined;
100
- "aria-posinset"?: number | undefined;
101
- "aria-pressed"?: boolean | "false" | "mixed" | "true" | undefined;
102
- "aria-readonly"?: (boolean | "true" | "false") | undefined;
103
- "aria-relevant"?: "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text" | "text additions" | "text removals" | undefined;
104
- "aria-required"?: (boolean | "true" | "false") | undefined;
105
- "aria-roledescription"?: string | undefined;
106
- "aria-rowcount"?: number | undefined;
107
- "aria-rowindex"?: number | undefined;
108
- "aria-rowindextext"?: string | undefined;
109
- "aria-rowspan"?: number | undefined;
110
- "aria-selected"?: (boolean | "true" | "false") | undefined;
111
- "aria-setsize"?: number | undefined;
112
- "aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined;
113
- "aria-valuemax"?: number | undefined;
114
- "aria-valuemin"?: number | undefined;
115
- "aria-valuenow"?: number | undefined;
116
- "aria-valuetext"?: string | undefined;
117
- children?: import('react').ReactNode | undefined;
118
- dangerouslySetInnerHTML?: {
119
- __html: string | TrustedHTML;
120
- } | undefined;
121
- onCopy?: import('react').ClipboardEventHandler<HTMLInputElement> | undefined;
122
- onCopyCapture?: import('react').ClipboardEventHandler<HTMLInputElement> | undefined;
123
- onCut?: import('react').ClipboardEventHandler<HTMLInputElement> | undefined;
124
- onCutCapture?: import('react').ClipboardEventHandler<HTMLInputElement> | undefined;
125
- onPaste?: import('react').ClipboardEventHandler<HTMLInputElement> | undefined;
126
- onPasteCapture?: import('react').ClipboardEventHandler<HTMLInputElement> | undefined;
127
- onCompositionEnd?: import('react').CompositionEventHandler<HTMLInputElement> | undefined;
128
- onCompositionEndCapture?: import('react').CompositionEventHandler<HTMLInputElement> | undefined;
129
- onCompositionStart?: import('react').CompositionEventHandler<HTMLInputElement> | undefined;
130
- onCompositionStartCapture?: import('react').CompositionEventHandler<HTMLInputElement> | undefined;
131
- onCompositionUpdate?: import('react').CompositionEventHandler<HTMLInputElement> | undefined;
132
- onCompositionUpdateCapture?: import('react').CompositionEventHandler<HTMLInputElement> | undefined;
133
- onFocus?: import('react').FocusEventHandler<HTMLInputElement> | undefined;
134
- onFocusCapture?: import('react').FocusEventHandler<HTMLInputElement> | undefined;
135
- onBlur?: import('react').FocusEventHandler<HTMLInputElement> | undefined;
136
- onBlurCapture?: import('react').FocusEventHandler<HTMLInputElement> | undefined;
137
- onChange?: import('react').ChangeEventHandler<HTMLInputElement> | undefined;
138
- onChangeCapture?: import('react').FormEventHandler<HTMLInputElement> | undefined;
139
- onBeforeInput?: import('react').FormEventHandler<HTMLInputElement> | undefined;
140
- onBeforeInputCapture?: import('react').FormEventHandler<HTMLInputElement> | undefined;
141
- onInput?: import('react').FormEventHandler<HTMLInputElement> | undefined;
142
- onInputCapture?: import('react').FormEventHandler<HTMLInputElement> | undefined;
143
- onReset?: import('react').FormEventHandler<HTMLInputElement> | undefined;
144
- onResetCapture?: import('react').FormEventHandler<HTMLInputElement> | undefined;
145
- onSubmit?: import('react').FormEventHandler<HTMLInputElement> | undefined;
146
- onSubmitCapture?: import('react').FormEventHandler<HTMLInputElement> | undefined;
147
- onInvalid?: import('react').FormEventHandler<HTMLInputElement> | undefined;
148
- onInvalidCapture?: import('react').FormEventHandler<HTMLInputElement> | undefined;
149
- onLoad?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
150
- onLoadCapture?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
151
- onError?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
152
- onErrorCapture?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
153
- onKeyDown?: import('react').KeyboardEventHandler<HTMLInputElement> | undefined;
154
- onKeyDownCapture?: import('react').KeyboardEventHandler<HTMLInputElement> | undefined;
155
- onKeyPress?: import('react').KeyboardEventHandler<HTMLInputElement> | undefined;
156
- onKeyPressCapture?: import('react').KeyboardEventHandler<HTMLInputElement> | undefined;
157
- onKeyUp?: import('react').KeyboardEventHandler<HTMLInputElement> | undefined;
158
- onKeyUpCapture?: import('react').KeyboardEventHandler<HTMLInputElement> | undefined;
159
- onAbort?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
160
- onAbortCapture?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
161
- onCanPlay?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
162
- onCanPlayCapture?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
163
- onCanPlayThrough?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
164
- onCanPlayThroughCapture?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
165
- onDurationChange?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
166
- onDurationChangeCapture?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
167
- onEmptied?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
168
- onEmptiedCapture?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
169
- onEncrypted?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
170
- onEncryptedCapture?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
171
- onEnded?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
172
- onEndedCapture?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
173
- onLoadedData?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
174
- onLoadedDataCapture?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
175
- onLoadedMetadata?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
176
- onLoadedMetadataCapture?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
177
- onLoadStart?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
178
- onLoadStartCapture?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
179
- onPause?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
180
- onPauseCapture?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
181
- onPlay?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
182
- onPlayCapture?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
183
- onPlaying?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
184
- onPlayingCapture?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
185
- onProgress?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
186
- onProgressCapture?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
187
- onRateChange?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
188
- onRateChangeCapture?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
189
- onResize?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
190
- onResizeCapture?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
191
- onSeeked?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
192
- onSeekedCapture?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
193
- onSeeking?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
194
- onSeekingCapture?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
195
- onStalled?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
196
- onStalledCapture?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
197
- onSuspend?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
198
- onSuspendCapture?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
199
- onTimeUpdate?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
200
- onTimeUpdateCapture?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
201
- onVolumeChange?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
202
- onVolumeChangeCapture?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
203
- onWaiting?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
204
- onWaitingCapture?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
205
- onAuxClick?: import('react').MouseEventHandler<HTMLInputElement> | undefined;
206
- onAuxClickCapture?: import('react').MouseEventHandler<HTMLInputElement> | undefined;
207
- onClick?: import('react').MouseEventHandler<HTMLInputElement> | undefined;
208
- onClickCapture?: import('react').MouseEventHandler<HTMLInputElement> | undefined;
209
- onContextMenu?: import('react').MouseEventHandler<HTMLInputElement> | undefined;
210
- onContextMenuCapture?: import('react').MouseEventHandler<HTMLInputElement> | undefined;
211
- onDoubleClick?: import('react').MouseEventHandler<HTMLInputElement> | undefined;
212
- onDoubleClickCapture?: import('react').MouseEventHandler<HTMLInputElement> | undefined;
213
- onDrag?: import('react').DragEventHandler<HTMLInputElement> | undefined;
214
- onDragCapture?: import('react').DragEventHandler<HTMLInputElement> | undefined;
215
- onDragEnd?: import('react').DragEventHandler<HTMLInputElement> | undefined;
216
- onDragEndCapture?: import('react').DragEventHandler<HTMLInputElement> | undefined;
217
- onDragEnter?: import('react').DragEventHandler<HTMLInputElement> | undefined;
218
- onDragEnterCapture?: import('react').DragEventHandler<HTMLInputElement> | undefined;
219
- onDragExit?: import('react').DragEventHandler<HTMLInputElement> | undefined;
220
- onDragExitCapture?: import('react').DragEventHandler<HTMLInputElement> | undefined;
221
- onDragLeave?: import('react').DragEventHandler<HTMLInputElement> | undefined;
222
- onDragLeaveCapture?: import('react').DragEventHandler<HTMLInputElement> | undefined;
223
- onDragOver?: import('react').DragEventHandler<HTMLInputElement> | undefined;
224
- onDragOverCapture?: import('react').DragEventHandler<HTMLInputElement> | undefined;
225
- onDragStart?: import('react').DragEventHandler<HTMLInputElement> | undefined;
226
- onDragStartCapture?: import('react').DragEventHandler<HTMLInputElement> | undefined;
227
- onDrop?: import('react').DragEventHandler<HTMLInputElement> | undefined;
228
- onDropCapture?: import('react').DragEventHandler<HTMLInputElement> | undefined;
229
- onMouseDown?: import('react').MouseEventHandler<HTMLInputElement> | undefined;
230
- onMouseDownCapture?: import('react').MouseEventHandler<HTMLInputElement> | undefined;
231
- onMouseEnter?: import('react').MouseEventHandler<HTMLInputElement> | undefined;
232
- onMouseLeave?: import('react').MouseEventHandler<HTMLInputElement> | undefined;
233
- onMouseMove?: import('react').MouseEventHandler<HTMLInputElement> | undefined;
234
- onMouseMoveCapture?: import('react').MouseEventHandler<HTMLInputElement> | undefined;
235
- onMouseOut?: import('react').MouseEventHandler<HTMLInputElement> | undefined;
236
- onMouseOutCapture?: import('react').MouseEventHandler<HTMLInputElement> | undefined;
237
- onMouseOver?: import('react').MouseEventHandler<HTMLInputElement> | undefined;
238
- onMouseOverCapture?: import('react').MouseEventHandler<HTMLInputElement> | undefined;
239
- onMouseUp?: import('react').MouseEventHandler<HTMLInputElement> | undefined;
240
- onMouseUpCapture?: import('react').MouseEventHandler<HTMLInputElement> | undefined;
241
- onSelect?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
242
- onSelectCapture?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
243
- onTouchCancel?: import('react').TouchEventHandler<HTMLInputElement> | undefined;
244
- onTouchCancelCapture?: import('react').TouchEventHandler<HTMLInputElement> | undefined;
245
- onTouchEnd?: import('react').TouchEventHandler<HTMLInputElement> | undefined;
246
- onTouchEndCapture?: import('react').TouchEventHandler<HTMLInputElement> | undefined;
247
- onTouchMove?: import('react').TouchEventHandler<HTMLInputElement> | undefined;
248
- onTouchMoveCapture?: import('react').TouchEventHandler<HTMLInputElement> | undefined;
249
- onTouchStart?: import('react').TouchEventHandler<HTMLInputElement> | undefined;
250
- onTouchStartCapture?: import('react').TouchEventHandler<HTMLInputElement> | undefined;
251
- onPointerDown?: import('react').PointerEventHandler<HTMLInputElement> | undefined;
252
- onPointerDownCapture?: import('react').PointerEventHandler<HTMLInputElement> | undefined;
253
- onPointerMove?: import('react').PointerEventHandler<HTMLInputElement> | undefined;
254
- onPointerMoveCapture?: import('react').PointerEventHandler<HTMLInputElement> | undefined;
255
- onPointerUp?: import('react').PointerEventHandler<HTMLInputElement> | undefined;
256
- onPointerUpCapture?: import('react').PointerEventHandler<HTMLInputElement> | undefined;
257
- onPointerCancel?: import('react').PointerEventHandler<HTMLInputElement> | undefined;
258
- onPointerCancelCapture?: import('react').PointerEventHandler<HTMLInputElement> | undefined;
259
- onPointerEnter?: import('react').PointerEventHandler<HTMLInputElement> | undefined;
260
- onPointerLeave?: import('react').PointerEventHandler<HTMLInputElement> | undefined;
261
- onPointerOver?: import('react').PointerEventHandler<HTMLInputElement> | undefined;
262
- onPointerOverCapture?: import('react').PointerEventHandler<HTMLInputElement> | undefined;
263
- onPointerOut?: import('react').PointerEventHandler<HTMLInputElement> | undefined;
264
- onPointerOutCapture?: import('react').PointerEventHandler<HTMLInputElement> | undefined;
265
- onGotPointerCapture?: import('react').PointerEventHandler<HTMLInputElement> | undefined;
266
- onGotPointerCaptureCapture?: import('react').PointerEventHandler<HTMLInputElement> | undefined;
267
- onLostPointerCapture?: import('react').PointerEventHandler<HTMLInputElement> | undefined;
268
- onLostPointerCaptureCapture?: import('react').PointerEventHandler<HTMLInputElement> | undefined;
269
- onScroll?: import('react').UIEventHandler<HTMLInputElement> | undefined;
270
- onScrollCapture?: import('react').UIEventHandler<HTMLInputElement> | undefined;
271
- onWheel?: import('react').WheelEventHandler<HTMLInputElement> | undefined;
272
- onWheelCapture?: import('react').WheelEventHandler<HTMLInputElement> | undefined;
273
- onAnimationStart?: import('react').AnimationEventHandler<HTMLInputElement> | undefined;
274
- onAnimationStartCapture?: import('react').AnimationEventHandler<HTMLInputElement> | undefined;
275
- onAnimationEnd?: import('react').AnimationEventHandler<HTMLInputElement> | undefined;
276
- onAnimationEndCapture?: import('react').AnimationEventHandler<HTMLInputElement> | undefined;
277
- onAnimationIteration?: import('react').AnimationEventHandler<HTMLInputElement> | undefined;
278
- onAnimationIterationCapture?: import('react').AnimationEventHandler<HTMLInputElement> | undefined;
279
- onTransitionEnd?: import('react').TransitionEventHandler<HTMLInputElement> | undefined;
280
- onTransitionEndCapture?: import('react').TransitionEventHandler<HTMLInputElement> | undefined;
281
- list?: string | undefined;
282
- accept?: string | undefined;
283
- alt?: string | undefined;
284
- autoComplete?: import('react').HTMLInputAutoCompleteAttribute | undefined;
285
- capture?: boolean | "user" | "environment" | undefined;
286
- checked?: boolean | undefined;
287
- enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined;
288
- height?: number | string | undefined;
289
- max?: number | string | undefined;
290
- maxLength?: number | undefined;
291
- min?: number | string | undefined;
292
- minLength?: number | undefined;
293
- multiple?: boolean | undefined;
294
- placeholder?: string | undefined;
295
- required?: boolean | undefined;
296
- src?: string | undefined;
297
- step?: number | string | undefined;
298
- width?: number | string | undefined;
299
- } & {
300
- className?: string;
301
- label?: string;
302
- variant?: `${import('..').EInputVariant}` | import('..').EInputVariant;
303
- autofocus?: boolean;
304
- readonly?: boolean;
305
- size?: `${import('..').EInputSize}` | import('..').EInputSize;
306
- } & import('react').RefAttributes<HTMLInputElement>>>;
1
+ export { InputPhoneNumber } from './InputPhoneNumber';
@@ -1,28 +1,4 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import { memo as d, forwardRef as i, useState as I, useCallback as c, useImperativeHandle as f } from "react";
3
- import { Input as P } from "../Input/index.js";
4
- import { getMaskedInputPhoneValue as m, getUnmaskedInputValue as b } from "./utils.js";
5
- const h = d(
6
- i(({ value: o = "", onChange: e, ...p }, r) => {
7
- const [a, s] = I(() => m(o)), l = c(
8
- (t) => {
9
- const u = m(t.target.value);
10
- s(u), e == null || e({
11
- ...t,
12
- target: {
13
- ...t.target,
14
- value: u
15
- }
16
- });
17
- },
18
- [e]
19
- );
20
- return f(r, () => ({
21
- getPhoneNumber: () => b(a)
22
- })), /* @__PURE__ */ n(P, { ref: r, ...p, value: a, onChange: l });
23
- })
24
- );
25
- h.displayName = "InputPhoneNumber";
1
+ import { InputPhoneNumber } from "./InputPhoneNumber.js";
26
2
  export {
27
- h as InputPhoneNumber
3
+ InputPhoneNumber
28
4
  };
@@ -1,9 +1,26 @@
1
- const n = (s) => {
2
- const t = s.replace(/\D/g, "");
3
- let e = "+7 ";
4
- return t.startsWith("7") ? e += "(" + t.substring(1, 4) : e += t.substring(0, 3), t.length > 4 && (e += ") " + t.substring(4, 7)), t.length > 7 && (e += "-" + t.substring(7, 9)), t.length > 9 && (e += "-" + t.substring(9, 11)), e;
5
- }, r = (s) => s.replace(/\D/g, "");
1
+ const getMaskedInputPhoneValue = (value) => {
2
+ const rawValue = value.replace(/\D/g, "");
3
+ let formattedValue = "+7 ";
4
+ if (rawValue.startsWith("7")) {
5
+ formattedValue += "(" + rawValue.substring(1, 4);
6
+ } else {
7
+ formattedValue += rawValue.substring(0, 3);
8
+ }
9
+ if (rawValue.length > 4) {
10
+ formattedValue += ") " + rawValue.substring(4, 7);
11
+ }
12
+ if (rawValue.length > 7) {
13
+ formattedValue += "-" + rawValue.substring(7, 9);
14
+ }
15
+ if (rawValue.length > 9) {
16
+ formattedValue += "-" + rawValue.substring(9, 11);
17
+ }
18
+ return formattedValue;
19
+ };
20
+ const getUnmaskedInputValue = (value) => {
21
+ return value.replace(/\D/g, "");
22
+ };
6
23
  export {
7
- n as getMaskedInputPhoneValue,
8
- r as getUnmaskedInputValue
24
+ getMaskedInputPhoneValue,
25
+ getUnmaskedInputValue
9
26
  };
@@ -0,0 +1,28 @@
1
+ import { TInputProps } from '../Input';
2
+
3
+ type TProps = Omit<TInputProps, 'onChange' | 'label'> & {
4
+ value?: string;
5
+ /**
6
+ * Количество полей ввода.
7
+ */
8
+ valueLength?: number;
9
+ /**
10
+ * Функция, для изменения значения поля ввода.
11
+ */
12
+ onChange?: (value: string) => void;
13
+ /**
14
+ * Флаг, показывающий нужно ли отображать разделитель между вводами.
15
+ */
16
+ needSeparator?: boolean;
17
+ };
18
+ /**
19
+ * Компонент ввода одноразового пароля (OTP).
20
+ *
21
+ * Компонент представляет собой набор вводов, каждый из которых может содержать только цифры.
22
+ * Пользователь может вводить цифры в каждый ввод, и при вводе каждой цифры происходит автоматическое переключение на следующий ввод.
23
+ */
24
+ export declare const OtpInput: {
25
+ ({ value, valueLength, needSeparator, onChange, ...props }: TProps): import("react/jsx-runtime").JSX.Element;
26
+ displayName: string;
27
+ };
28
+ export {};
@@ -0,0 +1,133 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { useRef, useMemo, Fragment } from "react";
3
+ import { c as classNames } from "../../index-CweZ_OcN.js";
4
+ import { Input } from "../Input/Input.js";
5
+ import { RE_DIGIT, ITEMS_PER_SEPARATOR, DEFAULT_VALUE_LENGTH } from "./constants.js";
6
+ import '../../assets/OtpInput.css';const otp = "_otp_f763c_1";
7
+ const input = "_input_f763c_7";
8
+ const separator = "_separator_f763c_16";
9
+ const cls = {
10
+ otp,
11
+ "input-wrapper": "_input-wrapper_f763c_7",
12
+ input,
13
+ separator
14
+ };
15
+ const OtpInput = ({
16
+ value = "",
17
+ valueLength = DEFAULT_VALUE_LENGTH,
18
+ needSeparator = true,
19
+ onChange,
20
+ ...props
21
+ }) => {
22
+ const inputRefs = useRef([]);
23
+ const valueItems = useMemo(() => {
24
+ const valueArray = value.split("");
25
+ const items = [];
26
+ for (let i = 0; i < valueLength; i++) {
27
+ const char = valueArray[i];
28
+ if (RE_DIGIT.test(char)) {
29
+ items.push(char);
30
+ } else {
31
+ items.push("");
32
+ }
33
+ }
34
+ return items;
35
+ }, [value, valueLength]);
36
+ const handleFocusToNextInput = (index) => {
37
+ var _a;
38
+ if (index < valueLength - 1) {
39
+ (_a = inputRefs.current[index + 1]) == null ? void 0 : _a.focus();
40
+ }
41
+ };
42
+ const handleFocusToPrevInput = (index) => {
43
+ var _a;
44
+ if (index > 0) {
45
+ (_a = inputRefs.current[index - 1]) == null ? void 0 : _a.focus();
46
+ }
47
+ };
48
+ const handleChange = (e, index) => {
49
+ const target = e.target;
50
+ let targetValue = target.value.trim();
51
+ const isTargetValueDigit = RE_DIGIT.test(targetValue);
52
+ if (!isTargetValueDigit && targetValue !== "") {
53
+ return;
54
+ }
55
+ const nextInputEl = inputRefs.current[index + 1];
56
+ if (!isTargetValueDigit && nextInputEl && nextInputEl.value !== "") {
57
+ return;
58
+ }
59
+ targetValue = isTargetValueDigit ? targetValue : " ";
60
+ const targetValueLength = targetValue.length;
61
+ if (targetValueLength === 1) {
62
+ const newValue = value.substring(0, index) + targetValue + value.substring(index + 1);
63
+ onChange == null ? void 0 : onChange(newValue);
64
+ if (isTargetValueDigit) {
65
+ handleFocusToNextInput(index);
66
+ }
67
+ } else if (targetValueLength === valueLength) {
68
+ onChange == null ? void 0 : onChange(targetValue);
69
+ target.blur();
70
+ }
71
+ };
72
+ const handleKeyDown = (e, index) => {
73
+ const { key } = e;
74
+ const target = e.target;
75
+ switch (key) {
76
+ case "ArrowRight":
77
+ case "ArrowDown": {
78
+ e.preventDefault();
79
+ return handleFocusToNextInput(index);
80
+ }
81
+ case "ArrowLeft":
82
+ case "ArrowUp": {
83
+ e.preventDefault();
84
+ return handleFocusToPrevInput(index);
85
+ }
86
+ }
87
+ const targetValue = target.value;
88
+ target.setSelectionRange(0, targetValue.length);
89
+ if (e.key !== "Backspace" || targetValue !== "") {
90
+ return;
91
+ }
92
+ const newValue = `${value.substring(0, index - 1)} ${value.substring(index)}`;
93
+ onChange == null ? void 0 : onChange(newValue);
94
+ handleFocusToPrevInput(index);
95
+ };
96
+ const handleFocus = (e, index) => {
97
+ const target = e.target;
98
+ const prevInputEl = inputRefs.current[index - 1];
99
+ if (prevInputEl && prevInputEl.value === "") {
100
+ prevInputEl.focus();
101
+ }
102
+ target.setSelectionRange(0, target.value.length);
103
+ };
104
+ return /* @__PURE__ */ jsx("div", { className: classNames(cls.otp), children: valueItems.map((digit, idx) => {
105
+ const nextIndex = idx + 1;
106
+ const showSeparator = needSeparator && nextIndex % ITEMS_PER_SEPARATOR === 0 && nextIndex !== valueItems.length;
107
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
108
+ /* @__PURE__ */ jsx(
109
+ Input,
110
+ {
111
+ ref: (el) => inputRefs.current[idx] = el,
112
+ type: "text",
113
+ inputMode: "numeric",
114
+ autoComplete: "one-time-code",
115
+ pattern: "\\d{1}",
116
+ maxLength: 1,
117
+ value: digit,
118
+ className: cls.input,
119
+ wrapperClassName: cls["input-wrapper"],
120
+ onChange: (e) => handleChange(e, idx),
121
+ onKeyDown: (e) => handleKeyDown(e, idx),
122
+ onFocus: (e) => handleFocus(e, idx),
123
+ ...props
124
+ }
125
+ ),
126
+ showSeparator && /* @__PURE__ */ jsx("span", { className: classNames(cls.separator) })
127
+ ] }, `otp-input-${idx}-${digit}`);
128
+ }) });
129
+ };
130
+ OtpInput.displayName = "OtpInput";
131
+ export {
132
+ OtpInput
133
+ };
@@ -1,2 +1,3 @@
1
1
  export declare const RE_DIGIT: RegExp;
2
2
  export declare const DEFAULT_VALUE_LENGTH = 6;
3
+ export declare const ITEMS_PER_SEPARATOR = 3;
@@ -1,5 +1,8 @@
1
- const E = new RegExp(/^\d+$/), e = 6;
1
+ const RE_DIGIT = new RegExp(/^\d+$/);
2
+ const DEFAULT_VALUE_LENGTH = 6;
3
+ const ITEMS_PER_SEPARATOR = 3;
2
4
  export {
3
- e as DEFAULT_VALUE_LENGTH,
4
- E as RE_DIGIT
5
+ DEFAULT_VALUE_LENGTH,
6
+ ITEMS_PER_SEPARATOR,
7
+ RE_DIGIT
5
8
  };
@@ -1,18 +1 @@
1
- import { TProps as TInputProps } from '../Input';
2
-
3
- export type TProps = Omit<TInputProps, 'onChange'> & {
4
- value?: string;
5
- valueLength?: number;
6
- onChange?: (value: string) => void;
7
- /**
8
- * Флаг, показывающий нужно ли отображать разделитель между вводами
9
- */
10
- needSeparator?: boolean;
11
- };
12
- /**
13
- * Компонент ввода одноразового пароля (OTP).
14
- *
15
- * Компонент представляет собой набор вводов, каждый из которых может содержать только цифры.
16
- * Пользователь может вводить цифры в каждый ввод, и при вводе каждой цифры происходит автоматическое переключение на следующий ввод.
17
- */
18
- export declare const OtpInput: ({ value, valueLength, needSeparator, onChange, ...props }: TProps) => import("react/jsx-runtime").JSX.Element;
1
+ export { OtpInput } from './OtpInput';