mimir-ui-kit 1.8.0 → 1.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. package/dist/{DatePickerModal-ByEDSY5o.js → DatePickerModal-DUUCHAWF.js} +17 -17
  2. package/dist/assets/DatePickerModal.css +1 -1
  3. package/dist/assets/SelectSearch.css +1 -1
  4. package/dist/assets/Timer.css +1 -0
  5. package/dist/components/DatePicker/DatePicker.d.ts +5 -5
  6. package/dist/components/DatePicker/DatePicker.js +1 -1
  7. package/dist/components/DatePicker/DatePickerModal.js +1 -1
  8. package/dist/components/DatePicker/index.d.ts +1 -1
  9. package/dist/components/Input/Input.d.ts +2 -2
  10. package/dist/components/RadioGroup/RadioGroup.d.ts +18 -2
  11. package/dist/components/RadioGroup/RadioGroup.js +50 -44
  12. package/dist/components/RadioGroup/index.d.ts +1 -1
  13. package/dist/components/SelectSearch/SelectSearch.d.ts +10 -16
  14. package/dist/components/SelectSearch/SelectSearch.js +100 -104
  15. package/dist/components/SelectSearch/index.d.ts +1 -2
  16. package/dist/components/Switch/Switch.d.ts +293 -3
  17. package/dist/components/Switch/Switch.js +27 -22
  18. package/dist/components/Switch/index.d.ts +1 -1
  19. package/dist/components/Timer/Timer.d.ts +24 -0
  20. package/dist/components/Timer/Timer.js +29 -0
  21. package/dist/components/Timer/index.d.ts +1 -0
  22. package/dist/components/Timer/index.js +4 -0
  23. package/dist/components/index.d.ts +4 -3
  24. package/dist/components/index.js +2 -0
  25. package/dist/hooks/index.d.ts +2 -0
  26. package/dist/hooks/index.js +5 -1
  27. package/dist/hooks/useInterval/index.d.ts +1 -0
  28. package/dist/hooks/useInterval/index.js +4 -0
  29. package/dist/hooks/useInterval/useInterval.d.ts +1 -0
  30. package/dist/hooks/useInterval/useInterval.js +17 -0
  31. package/dist/hooks/useTimer/index.d.ts +18 -0
  32. package/dist/hooks/useTimer/index.js +83 -0
  33. package/dist/hooks/useTimer/useTimer.d.ts +18 -0
  34. package/dist/hooks/useTimer/useTimer.js +83 -0
  35. package/dist/hooks/useTimer/utils.d.ts +20 -0
  36. package/dist/hooks/useTimer/utils.js +78 -0
  37. package/dist/index.js +7 -1
  38. package/package.json +1 -1
  39. package/dist/components/SelectSearch/types.d.ts +0 -17
  40. package/dist/components/SelectSearch/types.js +0 -1
  41. package/dist/components/Switch/types.d.ts +0 -4
  42. package/dist/components/Switch/types.js +0 -1
@@ -1,4 +1,294 @@
1
- import { FC } from 'react';
2
- import { TSwitchProps } from './types';
1
+ import { CheckboxProps } from '@headlessui/react';
3
2
 
4
- export declare const Switch: FC<TSwitchProps>;
3
+ export type TSwitchProps = CheckboxProps;
4
+ export declare const Switch: import('react').ForwardRefExoticComponent<{
5
+ suppressHydrationWarning?: boolean | undefined;
6
+ color?: string | undefined;
7
+ id?: string | undefined;
8
+ lang?: string | undefined;
9
+ style?: import('react').CSSProperties | undefined;
10
+ "aria-activedescendant"?: string | undefined;
11
+ "aria-atomic"?: (boolean | "true" | "false") | undefined;
12
+ "aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined;
13
+ "aria-braillelabel"?: string | undefined;
14
+ "aria-brailleroledescription"?: string | undefined;
15
+ "aria-busy"?: (boolean | "true" | "false") | undefined;
16
+ "aria-colcount"?: number | undefined;
17
+ "aria-colindex"?: number | undefined;
18
+ "aria-colindextext"?: string | undefined;
19
+ "aria-colspan"?: number | undefined;
20
+ "aria-controls"?: string | undefined;
21
+ "aria-current"?: boolean | "false" | "true" | "page" | "step" | "location" | "date" | "time" | undefined;
22
+ "aria-description"?: string | undefined;
23
+ "aria-details"?: string | undefined;
24
+ "aria-dropeffect"?: "none" | "copy" | "execute" | "link" | "move" | "popup" | undefined;
25
+ "aria-errormessage"?: string | undefined;
26
+ "aria-expanded"?: (boolean | "true" | "false") | undefined;
27
+ "aria-flowto"?: string | undefined;
28
+ "aria-grabbed"?: (boolean | "true" | "false") | undefined;
29
+ "aria-haspopup"?: boolean | "false" | "true" | "menu" | "listbox" | "tree" | "grid" | "dialog" | undefined;
30
+ "aria-hidden"?: (boolean | "true" | "false") | undefined;
31
+ "aria-invalid"?: boolean | "false" | "true" | "grammar" | "spelling" | undefined;
32
+ "aria-keyshortcuts"?: string | undefined;
33
+ "aria-label"?: string | undefined;
34
+ "aria-level"?: number | undefined;
35
+ "aria-live"?: "off" | "assertive" | "polite" | undefined;
36
+ "aria-modal"?: (boolean | "true" | "false") | undefined;
37
+ "aria-multiline"?: (boolean | "true" | "false") | undefined;
38
+ "aria-multiselectable"?: (boolean | "true" | "false") | undefined;
39
+ "aria-orientation"?: "horizontal" | "vertical" | undefined;
40
+ "aria-owns"?: string | undefined;
41
+ "aria-placeholder"?: string | undefined;
42
+ "aria-posinset"?: number | undefined;
43
+ "aria-pressed"?: boolean | "false" | "mixed" | "true" | undefined;
44
+ "aria-readonly"?: (boolean | "true" | "false") | undefined;
45
+ "aria-relevant"?: "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text" | "text additions" | "text removals" | undefined;
46
+ "aria-required"?: (boolean | "true" | "false") | undefined;
47
+ "aria-roledescription"?: string | undefined;
48
+ "aria-rowcount"?: number | undefined;
49
+ "aria-rowindex"?: number | undefined;
50
+ "aria-rowindextext"?: string | undefined;
51
+ "aria-rowspan"?: number | undefined;
52
+ "aria-selected"?: (boolean | "true" | "false") | undefined;
53
+ "aria-setsize"?: number | undefined;
54
+ "aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined;
55
+ "aria-valuemax"?: number | undefined;
56
+ "aria-valuemin"?: number | undefined;
57
+ "aria-valuenow"?: number | undefined;
58
+ "aria-valuetext"?: string | undefined;
59
+ dangerouslySetInnerHTML?: {
60
+ __html: string | TrustedHTML;
61
+ } | undefined;
62
+ onCopy?: import('react').ClipboardEventHandler<HTMLSpanElement> | undefined;
63
+ onCopyCapture?: import('react').ClipboardEventHandler<HTMLSpanElement> | undefined;
64
+ onCut?: import('react').ClipboardEventHandler<HTMLSpanElement> | undefined;
65
+ onCutCapture?: import('react').ClipboardEventHandler<HTMLSpanElement> | undefined;
66
+ onPaste?: import('react').ClipboardEventHandler<HTMLSpanElement> | undefined;
67
+ onPasteCapture?: import('react').ClipboardEventHandler<HTMLSpanElement> | undefined;
68
+ onCompositionEnd?: import('react').CompositionEventHandler<HTMLSpanElement> | undefined;
69
+ onCompositionEndCapture?: import('react').CompositionEventHandler<HTMLSpanElement> | undefined;
70
+ onCompositionStart?: import('react').CompositionEventHandler<HTMLSpanElement> | undefined;
71
+ onCompositionStartCapture?: import('react').CompositionEventHandler<HTMLSpanElement> | undefined;
72
+ onCompositionUpdate?: import('react').CompositionEventHandler<HTMLSpanElement> | undefined;
73
+ onCompositionUpdateCapture?: import('react').CompositionEventHandler<HTMLSpanElement> | undefined;
74
+ onFocus?: import('react').FocusEventHandler<HTMLSpanElement> | undefined;
75
+ onFocusCapture?: import('react').FocusEventHandler<HTMLSpanElement> | undefined;
76
+ onBlur?: import('react').FocusEventHandler<HTMLSpanElement> | undefined;
77
+ onBlurCapture?: import('react').FocusEventHandler<HTMLSpanElement> | undefined;
78
+ onChangeCapture?: import('react').FormEventHandler<HTMLSpanElement> | undefined;
79
+ onBeforeInput?: import('react').FormEventHandler<HTMLSpanElement> | undefined;
80
+ onBeforeInputCapture?: import('react').FormEventHandler<HTMLSpanElement> | undefined;
81
+ onInput?: import('react').FormEventHandler<HTMLSpanElement> | undefined;
82
+ onInputCapture?: import('react').FormEventHandler<HTMLSpanElement> | undefined;
83
+ onReset?: import('react').FormEventHandler<HTMLSpanElement> | undefined;
84
+ onResetCapture?: import('react').FormEventHandler<HTMLSpanElement> | undefined;
85
+ onSubmit?: import('react').FormEventHandler<HTMLSpanElement> | undefined;
86
+ onSubmitCapture?: import('react').FormEventHandler<HTMLSpanElement> | undefined;
87
+ onInvalid?: import('react').FormEventHandler<HTMLSpanElement> | undefined;
88
+ onInvalidCapture?: import('react').FormEventHandler<HTMLSpanElement> | undefined;
89
+ onLoad?: import('react').ReactEventHandler<HTMLSpanElement> | undefined;
90
+ onLoadCapture?: import('react').ReactEventHandler<HTMLSpanElement> | undefined;
91
+ onError?: import('react').ReactEventHandler<HTMLSpanElement> | undefined;
92
+ onErrorCapture?: import('react').ReactEventHandler<HTMLSpanElement> | undefined;
93
+ onKeyDown?: import('react').KeyboardEventHandler<HTMLSpanElement> | undefined;
94
+ onKeyDownCapture?: import('react').KeyboardEventHandler<HTMLSpanElement> | undefined;
95
+ onKeyPress?: import('react').KeyboardEventHandler<HTMLSpanElement> | undefined;
96
+ onKeyPressCapture?: import('react').KeyboardEventHandler<HTMLSpanElement> | undefined;
97
+ onKeyUp?: import('react').KeyboardEventHandler<HTMLSpanElement> | undefined;
98
+ onKeyUpCapture?: import('react').KeyboardEventHandler<HTMLSpanElement> | undefined;
99
+ onAbort?: import('react').ReactEventHandler<HTMLSpanElement> | undefined;
100
+ onAbortCapture?: import('react').ReactEventHandler<HTMLSpanElement> | undefined;
101
+ onCanPlay?: import('react').ReactEventHandler<HTMLSpanElement> | undefined;
102
+ onCanPlayCapture?: import('react').ReactEventHandler<HTMLSpanElement> | undefined;
103
+ onCanPlayThrough?: import('react').ReactEventHandler<HTMLSpanElement> | undefined;
104
+ onCanPlayThroughCapture?: import('react').ReactEventHandler<HTMLSpanElement> | undefined;
105
+ onDurationChange?: import('react').ReactEventHandler<HTMLSpanElement> | undefined;
106
+ onDurationChangeCapture?: import('react').ReactEventHandler<HTMLSpanElement> | undefined;
107
+ onEmptied?: import('react').ReactEventHandler<HTMLSpanElement> | undefined;
108
+ onEmptiedCapture?: import('react').ReactEventHandler<HTMLSpanElement> | undefined;
109
+ onEncrypted?: import('react').ReactEventHandler<HTMLSpanElement> | undefined;
110
+ onEncryptedCapture?: import('react').ReactEventHandler<HTMLSpanElement> | undefined;
111
+ onEnded?: import('react').ReactEventHandler<HTMLSpanElement> | undefined;
112
+ onEndedCapture?: import('react').ReactEventHandler<HTMLSpanElement> | undefined;
113
+ onLoadedData?: import('react').ReactEventHandler<HTMLSpanElement> | undefined;
114
+ onLoadedDataCapture?: import('react').ReactEventHandler<HTMLSpanElement> | undefined;
115
+ onLoadedMetadata?: import('react').ReactEventHandler<HTMLSpanElement> | undefined;
116
+ onLoadedMetadataCapture?: import('react').ReactEventHandler<HTMLSpanElement> | undefined;
117
+ onLoadStart?: import('react').ReactEventHandler<HTMLSpanElement> | undefined;
118
+ onLoadStartCapture?: import('react').ReactEventHandler<HTMLSpanElement> | undefined;
119
+ onPause?: import('react').ReactEventHandler<HTMLSpanElement> | undefined;
120
+ onPauseCapture?: import('react').ReactEventHandler<HTMLSpanElement> | undefined;
121
+ onPlay?: import('react').ReactEventHandler<HTMLSpanElement> | undefined;
122
+ onPlayCapture?: import('react').ReactEventHandler<HTMLSpanElement> | undefined;
123
+ onPlaying?: import('react').ReactEventHandler<HTMLSpanElement> | undefined;
124
+ onPlayingCapture?: import('react').ReactEventHandler<HTMLSpanElement> | undefined;
125
+ onProgress?: import('react').ReactEventHandler<HTMLSpanElement> | undefined;
126
+ onProgressCapture?: import('react').ReactEventHandler<HTMLSpanElement> | undefined;
127
+ onRateChange?: import('react').ReactEventHandler<HTMLSpanElement> | undefined;
128
+ onRateChangeCapture?: import('react').ReactEventHandler<HTMLSpanElement> | undefined;
129
+ onResize?: import('react').ReactEventHandler<HTMLSpanElement> | undefined;
130
+ onResizeCapture?: import('react').ReactEventHandler<HTMLSpanElement> | undefined;
131
+ onSeeked?: import('react').ReactEventHandler<HTMLSpanElement> | undefined;
132
+ onSeekedCapture?: import('react').ReactEventHandler<HTMLSpanElement> | undefined;
133
+ onSeeking?: import('react').ReactEventHandler<HTMLSpanElement> | undefined;
134
+ onSeekingCapture?: import('react').ReactEventHandler<HTMLSpanElement> | undefined;
135
+ onStalled?: import('react').ReactEventHandler<HTMLSpanElement> | undefined;
136
+ onStalledCapture?: import('react').ReactEventHandler<HTMLSpanElement> | undefined;
137
+ onSuspend?: import('react').ReactEventHandler<HTMLSpanElement> | undefined;
138
+ onSuspendCapture?: import('react').ReactEventHandler<HTMLSpanElement> | undefined;
139
+ onTimeUpdate?: import('react').ReactEventHandler<HTMLSpanElement> | undefined;
140
+ onTimeUpdateCapture?: import('react').ReactEventHandler<HTMLSpanElement> | undefined;
141
+ onVolumeChange?: import('react').ReactEventHandler<HTMLSpanElement> | undefined;
142
+ onVolumeChangeCapture?: import('react').ReactEventHandler<HTMLSpanElement> | undefined;
143
+ onWaiting?: import('react').ReactEventHandler<HTMLSpanElement> | undefined;
144
+ onWaitingCapture?: import('react').ReactEventHandler<HTMLSpanElement> | undefined;
145
+ onAuxClick?: import('react').MouseEventHandler<HTMLSpanElement> | undefined;
146
+ onAuxClickCapture?: import('react').MouseEventHandler<HTMLSpanElement> | undefined;
147
+ onClick?: import('react').MouseEventHandler<HTMLSpanElement> | undefined;
148
+ onClickCapture?: import('react').MouseEventHandler<HTMLSpanElement> | undefined;
149
+ onContextMenu?: import('react').MouseEventHandler<HTMLSpanElement> | undefined;
150
+ onContextMenuCapture?: import('react').MouseEventHandler<HTMLSpanElement> | undefined;
151
+ onDoubleClick?: import('react').MouseEventHandler<HTMLSpanElement> | undefined;
152
+ onDoubleClickCapture?: import('react').MouseEventHandler<HTMLSpanElement> | undefined;
153
+ onDrag?: import('react').DragEventHandler<HTMLSpanElement> | undefined;
154
+ onDragCapture?: import('react').DragEventHandler<HTMLSpanElement> | undefined;
155
+ onDragEnd?: import('react').DragEventHandler<HTMLSpanElement> | undefined;
156
+ onDragEndCapture?: import('react').DragEventHandler<HTMLSpanElement> | undefined;
157
+ onDragEnter?: import('react').DragEventHandler<HTMLSpanElement> | undefined;
158
+ onDragEnterCapture?: import('react').DragEventHandler<HTMLSpanElement> | undefined;
159
+ onDragExit?: import('react').DragEventHandler<HTMLSpanElement> | undefined;
160
+ onDragExitCapture?: import('react').DragEventHandler<HTMLSpanElement> | undefined;
161
+ onDragLeave?: import('react').DragEventHandler<HTMLSpanElement> | undefined;
162
+ onDragLeaveCapture?: import('react').DragEventHandler<HTMLSpanElement> | undefined;
163
+ onDragOver?: import('react').DragEventHandler<HTMLSpanElement> | undefined;
164
+ onDragOverCapture?: import('react').DragEventHandler<HTMLSpanElement> | undefined;
165
+ onDragStart?: import('react').DragEventHandler<HTMLSpanElement> | undefined;
166
+ onDragStartCapture?: import('react').DragEventHandler<HTMLSpanElement> | undefined;
167
+ onDrop?: import('react').DragEventHandler<HTMLSpanElement> | undefined;
168
+ onDropCapture?: import('react').DragEventHandler<HTMLSpanElement> | undefined;
169
+ onMouseDown?: import('react').MouseEventHandler<HTMLSpanElement> | undefined;
170
+ onMouseDownCapture?: import('react').MouseEventHandler<HTMLSpanElement> | undefined;
171
+ onMouseEnter?: import('react').MouseEventHandler<HTMLSpanElement> | undefined;
172
+ onMouseLeave?: import('react').MouseEventHandler<HTMLSpanElement> | undefined;
173
+ onMouseMove?: import('react').MouseEventHandler<HTMLSpanElement> | undefined;
174
+ onMouseMoveCapture?: import('react').MouseEventHandler<HTMLSpanElement> | undefined;
175
+ onMouseOut?: import('react').MouseEventHandler<HTMLSpanElement> | undefined;
176
+ onMouseOutCapture?: import('react').MouseEventHandler<HTMLSpanElement> | undefined;
177
+ onMouseOver?: import('react').MouseEventHandler<HTMLSpanElement> | undefined;
178
+ onMouseOverCapture?: import('react').MouseEventHandler<HTMLSpanElement> | undefined;
179
+ onMouseUp?: import('react').MouseEventHandler<HTMLSpanElement> | undefined;
180
+ onMouseUpCapture?: import('react').MouseEventHandler<HTMLSpanElement> | undefined;
181
+ onSelect?: import('react').ReactEventHandler<HTMLSpanElement> | undefined;
182
+ onSelectCapture?: import('react').ReactEventHandler<HTMLSpanElement> | undefined;
183
+ onTouchCancel?: import('react').TouchEventHandler<HTMLSpanElement> | undefined;
184
+ onTouchCancelCapture?: import('react').TouchEventHandler<HTMLSpanElement> | undefined;
185
+ onTouchEnd?: import('react').TouchEventHandler<HTMLSpanElement> | undefined;
186
+ onTouchEndCapture?: import('react').TouchEventHandler<HTMLSpanElement> | undefined;
187
+ onTouchMove?: import('react').TouchEventHandler<HTMLSpanElement> | undefined;
188
+ onTouchMoveCapture?: import('react').TouchEventHandler<HTMLSpanElement> | undefined;
189
+ onTouchStart?: import('react').TouchEventHandler<HTMLSpanElement> | undefined;
190
+ onTouchStartCapture?: import('react').TouchEventHandler<HTMLSpanElement> | undefined;
191
+ onPointerDown?: import('react').PointerEventHandler<HTMLSpanElement> | undefined;
192
+ onPointerDownCapture?: import('react').PointerEventHandler<HTMLSpanElement> | undefined;
193
+ onPointerMove?: import('react').PointerEventHandler<HTMLSpanElement> | undefined;
194
+ onPointerMoveCapture?: import('react').PointerEventHandler<HTMLSpanElement> | undefined;
195
+ onPointerUp?: import('react').PointerEventHandler<HTMLSpanElement> | undefined;
196
+ onPointerUpCapture?: import('react').PointerEventHandler<HTMLSpanElement> | undefined;
197
+ onPointerCancel?: import('react').PointerEventHandler<HTMLSpanElement> | undefined;
198
+ onPointerCancelCapture?: import('react').PointerEventHandler<HTMLSpanElement> | undefined;
199
+ onPointerEnter?: import('react').PointerEventHandler<HTMLSpanElement> | undefined;
200
+ onPointerLeave?: import('react').PointerEventHandler<HTMLSpanElement> | undefined;
201
+ onPointerOver?: import('react').PointerEventHandler<HTMLSpanElement> | undefined;
202
+ onPointerOverCapture?: import('react').PointerEventHandler<HTMLSpanElement> | undefined;
203
+ onPointerOut?: import('react').PointerEventHandler<HTMLSpanElement> | undefined;
204
+ onPointerOutCapture?: import('react').PointerEventHandler<HTMLSpanElement> | undefined;
205
+ onGotPointerCapture?: import('react').PointerEventHandler<HTMLSpanElement> | undefined;
206
+ onGotPointerCaptureCapture?: import('react').PointerEventHandler<HTMLSpanElement> | undefined;
207
+ onLostPointerCapture?: import('react').PointerEventHandler<HTMLSpanElement> | undefined;
208
+ onLostPointerCaptureCapture?: import('react').PointerEventHandler<HTMLSpanElement> | undefined;
209
+ onScroll?: import('react').UIEventHandler<HTMLSpanElement> | undefined;
210
+ onScrollCapture?: import('react').UIEventHandler<HTMLSpanElement> | undefined;
211
+ onWheel?: import('react').WheelEventHandler<HTMLSpanElement> | undefined;
212
+ onWheelCapture?: import('react').WheelEventHandler<HTMLSpanElement> | undefined;
213
+ onAnimationStart?: import('react').AnimationEventHandler<HTMLSpanElement> | undefined;
214
+ onAnimationStartCapture?: import('react').AnimationEventHandler<HTMLSpanElement> | undefined;
215
+ onAnimationEnd?: import('react').AnimationEventHandler<HTMLSpanElement> | undefined;
216
+ onAnimationEndCapture?: import('react').AnimationEventHandler<HTMLSpanElement> | undefined;
217
+ onAnimationIteration?: import('react').AnimationEventHandler<HTMLSpanElement> | undefined;
218
+ onAnimationIterationCapture?: import('react').AnimationEventHandler<HTMLSpanElement> | undefined;
219
+ onTransitionEnd?: import('react').TransitionEventHandler<HTMLSpanElement> | undefined;
220
+ onTransitionEndCapture?: import('react').TransitionEventHandler<HTMLSpanElement> | undefined;
221
+ key?: import('react').Key | null | undefined;
222
+ slot?: string | undefined;
223
+ title?: string | undefined;
224
+ defaultValue?: string | number | readonly string[] | undefined;
225
+ suppressContentEditableWarning?: boolean | undefined;
226
+ accessKey?: string | undefined;
227
+ contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
228
+ contextMenu?: string | undefined;
229
+ dir?: string | undefined;
230
+ draggable?: (boolean | "true" | "false") | undefined;
231
+ hidden?: boolean | undefined;
232
+ nonce?: string | undefined;
233
+ spellCheck?: (boolean | "true" | "false") | undefined;
234
+ translate?: "yes" | "no" | undefined;
235
+ radioGroup?: string | undefined;
236
+ about?: string | undefined;
237
+ content?: string | undefined;
238
+ datatype?: string | undefined;
239
+ inlist?: any;
240
+ prefix?: string | undefined;
241
+ property?: string | undefined;
242
+ rel?: string | undefined;
243
+ resource?: string | undefined;
244
+ rev?: string | undefined;
245
+ typeof?: string | undefined;
246
+ vocab?: string | undefined;
247
+ autoCapitalize?: string | undefined;
248
+ autoCorrect?: string | undefined;
249
+ autoSave?: string | undefined;
250
+ itemProp?: string | undefined;
251
+ itemScope?: boolean | undefined;
252
+ itemType?: string | undefined;
253
+ itemID?: string | undefined;
254
+ itemRef?: string | undefined;
255
+ results?: number | undefined;
256
+ security?: string | undefined;
257
+ unselectable?: "on" | "off" | undefined;
258
+ inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined;
259
+ is?: string | undefined;
260
+ } & {
261
+ as?: "span" | undefined;
262
+ children?: import('react').ReactNode | ((bag: {
263
+ checked: boolean;
264
+ changing: boolean;
265
+ focus: boolean;
266
+ active: boolean;
267
+ hover: boolean;
268
+ autofocus: boolean;
269
+ disabled: boolean;
270
+ indeterminate: boolean;
271
+ }) => import('react').ReactElement);
272
+ refName?: string;
273
+ } & {
274
+ className?: string | ((bag: {
275
+ checked: boolean;
276
+ changing: boolean;
277
+ focus: boolean;
278
+ active: boolean;
279
+ hover: boolean;
280
+ autofocus: boolean;
281
+ disabled: boolean;
282
+ indeterminate: boolean;
283
+ }) => string) | undefined;
284
+ } & {
285
+ value?: string | undefined;
286
+ disabled?: boolean;
287
+ indeterminate?: boolean;
288
+ checked?: boolean;
289
+ defaultChecked?: boolean;
290
+ autoFocus?: boolean;
291
+ form?: string;
292
+ name?: string;
293
+ onChange?: (checked: boolean) => void;
294
+ } & import('react').RefAttributes<HTMLInputElement>>;
@@ -1,6 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { c as classNames } from "../../index-CweZ_OcN.js";
3
- import React__default, { useId, useState, useMemo, useCallback } from "react";
3
+ import React__default, { useId, useState, useMemo, useCallback, forwardRef, useEffect } from "react";
4
4
  import { Icon } from "../../icons/Icon.js";
5
5
  import { W, d as u, b as a, l, T, I, G, p, o, $ as $f7dceffc5ad7768b$export$4e328f61c538687f, c as $6179b936705e76d3$export$ae780daf29e6d456, D, j, H, r, e as o$1, f as p$1 } from "../../label-BXAcSLy0.js";
6
6
  import { w } from "../../use-active-press-9MCrfRZk.js";
@@ -26,27 +26,32 @@ const cls = {
26
26
  "switch": "_switch_1g34c_2",
27
27
  enabled
28
28
  };
29
- const Switch = ({
30
- checked,
31
- onChange
32
- }) => {
33
- const [enabled2, setEnabled] = useState(checked);
34
- const handleChange = (value) => {
35
- setEnabled(value);
36
- onChange == null ? void 0 : onChange(value);
37
- };
38
- return /* @__PURE__ */ jsx(
39
- Re,
40
- {
41
- checked: enabled2,
42
- onChange: handleChange,
43
- className: classNames(cls.switch, {
44
- [cls.enabled]: enabled2
45
- }),
46
- children: /* @__PURE__ */ jsx(Icon, { iconName: "Done16px" })
47
- }
48
- );
49
- };
29
+ const Switch = forwardRef(
30
+ (props, ref) => {
31
+ const { checked, onChange, ...restProps } = props;
32
+ const [enabled2, setEnabled] = useState(checked);
33
+ const handleChange = (value) => {
34
+ setEnabled(value);
35
+ onChange == null ? void 0 : onChange(value);
36
+ };
37
+ useEffect(() => {
38
+ setEnabled(!!checked);
39
+ }, [checked]);
40
+ return /* @__PURE__ */ jsx(
41
+ Re,
42
+ {
43
+ ref,
44
+ checked: enabled2,
45
+ onChange: handleChange,
46
+ className: classNames(cls.switch, {
47
+ [cls.enabled]: enabled2
48
+ }),
49
+ ...restProps,
50
+ children: /* @__PURE__ */ jsx(Icon, { iconName: "Done16px" })
51
+ }
52
+ );
53
+ }
54
+ );
50
55
  export {
51
56
  Switch
52
57
  };
@@ -1,2 +1,2 @@
1
1
  export { Switch } from './Switch';
2
- export type { TSwitchProps } from './types';
2
+ export type { TSwitchProps } from './Switch';
@@ -0,0 +1,24 @@
1
+ type TProps = {
2
+ /**
3
+ * число, которое представляет собой временную метку, указывающую время, когда истекает таймер.
4
+ * const timer = new Date().getTime() + 60000; => таймер на 1 минуту
5
+ */
6
+ expiryTimestamp: number;
7
+ /**
8
+ * необязательное свойство типа boolean, которое указывает, должен ли таймер начинаться автоматически при создании компонента.
9
+ */
10
+ autoStart?: boolean;
11
+ /**
12
+ * необязательная функция, которая вызывается, когда таймер истекает.
13
+ */
14
+ onTimerEnd?: () => void;
15
+ /**
16
+ * Дополнительный класс.
17
+ */
18
+ className?: string;
19
+ };
20
+ /**
21
+ * Компонент Timer отображает таймер с отсчетом времени в минутах и секундах.
22
+ */
23
+ export declare const Timer: ({ expiryTimestamp, autoStart, onTimerEnd, className }: TProps) => import("react/jsx-runtime").JSX.Element;
24
+ export {};
@@ -0,0 +1,29 @@
1
+ import { jsxs } from "react/jsx-runtime";
2
+ import { c as classNames } from "../../index-CweZ_OcN.js";
3
+ import { useTimer } from "../../hooks/useTimer/index.js";
4
+ import '../../assets/Timer.css';const timer = "_timer_llwad_3";
5
+ const cls = {
6
+ timer
7
+ };
8
+ const Timer = ({
9
+ expiryTimestamp,
10
+ autoStart = false,
11
+ onTimerEnd,
12
+ className
13
+ }) => {
14
+ const { minutes, seconds } = useTimer({
15
+ expiryTimestamp,
16
+ onExpire: onTimerEnd,
17
+ autoStart
18
+ });
19
+ const formattedMinutes = String(minutes).padStart(2, "0");
20
+ const formattedSeconds = String(seconds).padStart(2, "0");
21
+ return /* @__PURE__ */ jsxs("div", { className: classNames(cls.timer, className), children: [
22
+ formattedMinutes,
23
+ ":",
24
+ formattedSeconds
25
+ ] });
26
+ };
27
+ export {
28
+ Timer
29
+ };
@@ -0,0 +1 @@
1
+ export { Timer } from './Timer';
@@ -0,0 +1,4 @@
1
+ import { Timer } from "./Timer.js";
2
+ export {
3
+ Timer
4
+ };
@@ -6,9 +6,9 @@ export type { TInputPasswordProps } from './InputPassword';
6
6
  export { InputPhoneNumber, getMaskedInputPhoneValue, getUnmaskedInputValue } from './InputPhoneNumber';
7
7
  export { OtpInput } from './OtpInput';
8
8
  export { RadioGroup } from './RadioGroup';
9
- export type { TRadioOption } from './RadioGroup';
9
+ export type { TRadioOption, TRadioGroupProps } from './RadioGroup';
10
10
  export { DatePicker } from './DatePicker';
11
- export type { TDatePickerProps } from './DatePicker';
11
+ export type { TDatePickerProps, TDatePickerValue } from './DatePicker';
12
12
  export { MergedButton } from './MergedButton';
13
13
  export { EMergedButtonVariantRound } from './MergedButton';
14
14
  export type { TButtonPropsWithoutStyles } from './MergedButton';
@@ -20,6 +20,7 @@ export { EDrawerPosition } from './Drawer';
20
20
  export { Steps, EStepsPrimaryColor, EStepsSecondaryColor, EStepsSize, type TCommonStepsProps } from './Steps';
21
21
  export { Vote, EVoteSize, type TCommonVoteProps } from './Vote';
22
22
  export { SelectSearch, ESelectSearchSize } from './SelectSearch';
23
- export type { TSelectSearchItem, TSelectSearchProps, TSelectSearchSize } from './SelectSearch';
23
+ export type { TSelectSearchItem, TSelectSearchProps } from './SelectSearch';
24
24
  export { Switch } from './Switch';
25
25
  export type { TSwitchProps } from './Switch';
26
+ export { Timer } from './Timer';
@@ -22,6 +22,7 @@ import { EVoteSize } from "./Vote/constants.js";
22
22
  import { SelectSearch } from "./SelectSearch/SelectSearch.js";
23
23
  import { ESelectSearchSize } from "./SelectSearch/constants.js";
24
24
  import { Switch } from "./Switch/Switch.js";
25
+ import { Timer } from "./Timer/Timer.js";
25
26
  export {
26
27
  Button,
27
28
  DatePicker,
@@ -51,6 +52,7 @@ export {
51
52
  Slider,
52
53
  Steps,
53
54
  Switch,
55
+ Timer,
54
56
  Vote,
55
57
  getMaskedInputPhoneValue,
56
58
  getUnmaskedInputValue
@@ -1,2 +1,4 @@
1
1
  export { useMediaQuery, EMediaQuery } from './useMediaQuery';
2
2
  export { useLockBodyScroll } from './useLockBodyScroll';
3
+ export { useInterval } from './useInterval';
4
+ export { useTimer } from './useTimer';
@@ -1,8 +1,12 @@
1
1
  import { useMediaQuery } from "./useMediaQuery/useMediaQuery.js";
2
2
  import { EMediaQuery } from "./useMediaQuery/constants.js";
3
3
  import { useLockBodyScroll } from "./useLockBodyScroll/useLockBodyScroll.js";
4
+ import { useInterval } from "./useInterval/useInterval.js";
5
+ import { useTimer } from "./useTimer/index.js";
4
6
  export {
5
7
  EMediaQuery,
8
+ useInterval,
6
9
  useLockBodyScroll,
7
- useMediaQuery
10
+ useMediaQuery,
11
+ useTimer
8
12
  };
@@ -0,0 +1 @@
1
+ export { useInterval } from './useInterval';
@@ -0,0 +1,4 @@
1
+ import { useInterval } from "./useInterval.js";
2
+ export {
3
+ useInterval
4
+ };
@@ -0,0 +1 @@
1
+ export declare function useInterval(callback: VoidFunction, delay: number | null): void;
@@ -0,0 +1,17 @@
1
+ import { useRef, useEffect } from "react";
2
+ function useInterval(callback, delay) {
3
+ const callbackRef = useRef();
4
+ callbackRef.current = callback;
5
+ useEffect(() => {
6
+ if (!delay) {
7
+ return;
8
+ }
9
+ const interval = setInterval(() => {
10
+ callbackRef.current && callbackRef.current();
11
+ }, delay);
12
+ return () => clearInterval(interval);
13
+ }, [delay]);
14
+ }
15
+ export {
16
+ useInterval
17
+ };
@@ -0,0 +1,18 @@
1
+ export type TUserTimer = ReturnType<typeof useTimer>;
2
+ export type TUseTimerProps = {
3
+ expiryTimestamp?: number;
4
+ onExpire?: VoidFunction;
5
+ autoStart?: boolean;
6
+ };
7
+ export declare function useTimer({ expiryTimestamp: expiry, onExpire, autoStart }: TUseTimerProps): {
8
+ start: () => void;
9
+ pause: () => void;
10
+ resume: () => void;
11
+ restart: (newExpiryTimestamp: number, newAutoStart?: boolean) => void;
12
+ isRunning: boolean;
13
+ totalSeconds: number;
14
+ days: number;
15
+ hours: number;
16
+ minutes: number;
17
+ seconds: number;
18
+ };
@@ -0,0 +1,83 @@
1
+ import { useState, useCallback } from "react";
2
+ import { Time, Validate } from "./utils.js";
3
+ import { useInterval } from "../useInterval/useInterval.js";
4
+ const DEFAULT_DELAY = 1e3;
5
+ function getDelayFromExpiryTimestamp(expiryTimestamp) {
6
+ if (!Validate.expiryTimestamp(expiryTimestamp)) {
7
+ return null;
8
+ }
9
+ const seconds = Time.getSecondsFromExpiry(expiryTimestamp);
10
+ const extraMilliSeconds = Math.floor((seconds - Math.floor(seconds)) * 1e3);
11
+ return extraMilliSeconds > 0 ? extraMilliSeconds : DEFAULT_DELAY;
12
+ }
13
+ function useTimer({
14
+ expiryTimestamp: expiry,
15
+ onExpire,
16
+ autoStart = false
17
+ }) {
18
+ const [expiryTimestamp, setExpiryTimestamp] = useState(expiry);
19
+ const [seconds, setSeconds] = useState(
20
+ Time.getSecondsFromExpiry(expiry ?? 0)
21
+ );
22
+ const [isRunning, setIsRunning] = useState(autoStart);
23
+ const [didStart, setDidStart] = useState(autoStart);
24
+ const [delay, setDelay] = useState(getDelayFromExpiryTimestamp(expiry ?? 0));
25
+ const handleExpire = useCallback(() => {
26
+ Validate.onExpire(onExpire) && (onExpire == null ? void 0 : onExpire());
27
+ setIsRunning(false);
28
+ setDelay(null);
29
+ }, [onExpire]);
30
+ const pause = useCallback(() => {
31
+ setIsRunning(false);
32
+ }, []);
33
+ const restart = useCallback(
34
+ (newExpiryTimestamp, newAutoStart = true) => {
35
+ setDelay(getDelayFromExpiryTimestamp(newExpiryTimestamp));
36
+ setDidStart(newAutoStart);
37
+ setIsRunning(newAutoStart);
38
+ setExpiryTimestamp(newExpiryTimestamp);
39
+ setSeconds(Time.getSecondsFromExpiry(newExpiryTimestamp));
40
+ },
41
+ []
42
+ );
43
+ const resume = useCallback(() => {
44
+ const time = /* @__PURE__ */ new Date();
45
+ time.setMilliseconds(time.getMilliseconds() + seconds * 1e3);
46
+ restart(time.getTime(), true);
47
+ }, [seconds, restart]);
48
+ const start = useCallback(() => {
49
+ if (didStart) {
50
+ setSeconds(Time.getSecondsFromExpiry(expiryTimestamp ?? 0, false));
51
+ setIsRunning(true);
52
+ } else {
53
+ resume();
54
+ }
55
+ }, [expiryTimestamp, didStart, resume]);
56
+ useInterval(
57
+ () => {
58
+ if (delay !== DEFAULT_DELAY) {
59
+ setDelay(DEFAULT_DELAY);
60
+ }
61
+ const secondsValue = Time.getSecondsFromExpiry(
62
+ expiryTimestamp ?? 0,
63
+ false
64
+ );
65
+ setSeconds(secondsValue);
66
+ if (secondsValue <= 0) {
67
+ handleExpire();
68
+ }
69
+ },
70
+ isRunning ? delay : null
71
+ );
72
+ return {
73
+ ...Time.getTimeFromSeconds(seconds),
74
+ start,
75
+ pause,
76
+ resume,
77
+ restart,
78
+ isRunning
79
+ };
80
+ }
81
+ export {
82
+ useTimer
83
+ };
@@ -0,0 +1,18 @@
1
+ export type TUserTimer = ReturnType<typeof useTimer>;
2
+ export type TUseTimerProps = {
3
+ expiryTimestamp?: number;
4
+ onExpire?: VoidFunction;
5
+ autoStart?: boolean;
6
+ };
7
+ export declare function useTimer({ expiryTimestamp: expiry, onExpire, autoStart }: TUseTimerProps): {
8
+ start: () => void;
9
+ pause: () => void;
10
+ resume: () => void;
11
+ restart: (newExpiryTimestamp: number, newAutoStart?: boolean) => void;
12
+ isRunning: boolean;
13
+ totalSeconds: number;
14
+ days: number;
15
+ hours: number;
16
+ minutes: number;
17
+ seconds: number;
18
+ };