@tiny-design/react 1.0.11 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/auto-complete/index.js +9 -0
- package/es/auto-complete/index.js.map +1 -0
- package/es/date-picker/style/_index.scss +0 -1
- package/es/date-picker/style/index.css +0 -1
- package/es/index.d.ts +2 -1
- package/es/index.js +3 -2
- package/es/input-otp/index.d.ts +1 -0
- package/es/input-otp/index.js +9 -0
- package/es/input-otp/index.js.map +1 -0
- package/es/input-otp/input-otp.d.ts +13 -0
- package/es/input-otp/input-otp.js +128 -0
- package/es/input-otp/input-otp.js.map +1 -0
- package/es/input-otp/otp-input.js +60 -0
- package/es/input-otp/otp-input.js.map +1 -0
- package/es/input-otp/style/_index.scss +53 -0
- package/es/input-otp/style/index.css +71 -0
- package/es/input-otp/style/index.d.ts +1 -0
- package/es/input-otp/style/index.js +1 -0
- package/es/input-otp/types.d.ts +31 -0
- package/es/loader/style/_index.scss +3 -3
- package/es/loader/style/index.css +1 -3
- package/es/style/_component.scss +2 -1
- package/es/time-picker/style/_index.scss +0 -1
- package/es/time-picker/style/index.css +0 -1
- package/lib/auto-complete/index.js +8 -0
- package/lib/auto-complete/index.js.map +1 -0
- package/lib/date-picker/style/_index.scss +0 -1
- package/lib/date-picker/style/index.css +0 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.js +152 -150
- package/lib/input-otp/index.js +8 -0
- package/lib/input-otp/index.js.map +1 -0
- package/lib/input-otp/input-otp.d.ts +13 -0
- package/lib/input-otp/input-otp.js +131 -0
- package/lib/input-otp/input-otp.js.map +1 -0
- package/lib/input-otp/otp-input.js +63 -0
- package/lib/input-otp/otp-input.js.map +1 -0
- package/lib/input-otp/style/_index.scss +53 -0
- package/lib/input-otp/style/index.css +71 -0
- package/lib/input-otp/style/index.d.ts +1 -0
- package/lib/input-otp/style/index.js +1 -0
- package/lib/input-otp/types.d.ts +31 -0
- package/lib/loader/style/_index.scss +3 -3
- package/lib/loader/style/index.css +1 -3
- package/lib/style/_component.scss +2 -1
- package/lib/time-picker/style/_index.scss +0 -1
- package/lib/time-picker/style/index.css +0 -1
- package/package.json +3 -3
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
.ty-input-otp {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
gap: 8px;
|
|
5
|
+
}
|
|
6
|
+
.ty-input-otp__cell {
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
width: 100%;
|
|
9
|
+
margin: 0;
|
|
10
|
+
color: var(--ty-color-text);
|
|
11
|
+
border: 1px solid var(--ty-input-border);
|
|
12
|
+
transition: all 0.3s;
|
|
13
|
+
outline: 0;
|
|
14
|
+
border-radius: 2px;
|
|
15
|
+
font-size: 1rem;
|
|
16
|
+
background-color: var(--ty-input-bg);
|
|
17
|
+
}
|
|
18
|
+
.ty-input-otp__cell:hover {
|
|
19
|
+
border-color: var(--ty-color-primary);
|
|
20
|
+
}
|
|
21
|
+
.ty-input-otp__cell:focus {
|
|
22
|
+
border-color: var(--ty-input-focus-border);
|
|
23
|
+
box-shadow: var(--ty-input-focus-shadow);
|
|
24
|
+
}
|
|
25
|
+
.ty-input-otp__cell::-moz-placeholder {
|
|
26
|
+
color: var(--ty-color-text-placeholder);
|
|
27
|
+
}
|
|
28
|
+
.ty-input-otp__cell::placeholder {
|
|
29
|
+
color: var(--ty-color-text-placeholder);
|
|
30
|
+
}
|
|
31
|
+
.ty-input-otp__cell {
|
|
32
|
+
width: 36px;
|
|
33
|
+
height: 36px;
|
|
34
|
+
text-align: center;
|
|
35
|
+
padding: 0;
|
|
36
|
+
font-size: 1rem;
|
|
37
|
+
border-radius: 2px;
|
|
38
|
+
caret-color: currentcolor;
|
|
39
|
+
}
|
|
40
|
+
.ty-input-otp__cell_sm {
|
|
41
|
+
width: 28px;
|
|
42
|
+
height: 28px;
|
|
43
|
+
font-size: 0.875rem;
|
|
44
|
+
}
|
|
45
|
+
.ty-input-otp__cell_md {
|
|
46
|
+
width: 36px;
|
|
47
|
+
height: 36px;
|
|
48
|
+
font-size: 1rem;
|
|
49
|
+
}
|
|
50
|
+
.ty-input-otp__cell_lg {
|
|
51
|
+
width: 44px;
|
|
52
|
+
height: 44px;
|
|
53
|
+
font-size: 1.25rem;
|
|
54
|
+
}
|
|
55
|
+
.ty-input-otp__cell_disabled {
|
|
56
|
+
cursor: not-allowed;
|
|
57
|
+
background-color: var(--ty-input-disabled-bg);
|
|
58
|
+
color: var(--ty-input-disabled-color);
|
|
59
|
+
}
|
|
60
|
+
.ty-input-otp__cell_disabled:hover {
|
|
61
|
+
border-color: var(--ty-input-border);
|
|
62
|
+
}
|
|
63
|
+
.ty-input-otp__separator {
|
|
64
|
+
display: inline-flex;
|
|
65
|
+
align-items: center;
|
|
66
|
+
color: var(--ty-color-text-secondary);
|
|
67
|
+
font-size: 1rem;
|
|
68
|
+
}
|
|
69
|
+
.ty-input-otp_disabled {
|
|
70
|
+
cursor: not-allowed;
|
|
71
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require("./index.css");
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { BaseProps, SizeType } from "../_utils/props.js";
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/input-otp/types.d.ts
|
|
5
|
+
interface InputOTPProps extends BaseProps, Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'onInput'> {
|
|
6
|
+
/** Number of OTP input cells */
|
|
7
|
+
length?: number;
|
|
8
|
+
/** Size of the input */
|
|
9
|
+
size?: SizeType;
|
|
10
|
+
/** Default value of the OTP input */
|
|
11
|
+
defaultValue?: string;
|
|
12
|
+
/** Controlled value of the OTP input */
|
|
13
|
+
value?: string;
|
|
14
|
+
/** Callback when all cells are filled */
|
|
15
|
+
onChange?: (value: string) => void;
|
|
16
|
+
/** Custom formatter to restrict/modify input */
|
|
17
|
+
formatter?: (value: string) => string;
|
|
18
|
+
/** Separator element between cells */
|
|
19
|
+
separator?: ((index: number) => React.ReactNode) | React.ReactNode;
|
|
20
|
+
/** Whether the input is disabled */
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
/** Whether to mask the values, or a custom mask character */
|
|
23
|
+
mask?: boolean | string;
|
|
24
|
+
/** Auto focus the first cell on mount */
|
|
25
|
+
autoFocus?: boolean;
|
|
26
|
+
/** Autocomplete attribute */
|
|
27
|
+
autoComplete?: string;
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
export { InputOTPProps };
|
|
31
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
@use '../../style/mixins' as *;
|
|
3
3
|
|
|
4
4
|
.#{$prefix}-loader {
|
|
5
|
-
font-family: $font-family;
|
|
6
5
|
position: relative;
|
|
7
6
|
display: inline-block;
|
|
8
7
|
color: var(--ty-color-primary);
|
|
@@ -21,7 +20,7 @@
|
|
|
21
20
|
position: absolute;
|
|
22
21
|
display: block;
|
|
23
22
|
transform: scale(0.75);
|
|
24
|
-
background-color:
|
|
23
|
+
background-color: currentcolor;
|
|
25
24
|
border-radius: 50%;
|
|
26
25
|
transform-origin: 50% 50%;
|
|
27
26
|
opacity: 0.5;
|
|
@@ -53,7 +52,6 @@
|
|
|
53
52
|
|
|
54
53
|
&__label {
|
|
55
54
|
margin: 5px 0;
|
|
56
|
-
font-family: $font-family;
|
|
57
55
|
user-select: none;
|
|
58
56
|
opacity: 0.8;
|
|
59
57
|
font-size: 16px;
|
|
@@ -133,9 +131,11 @@
|
|
|
133
131
|
0% {
|
|
134
132
|
opacity: 0.2;
|
|
135
133
|
}
|
|
134
|
+
|
|
136
135
|
50% {
|
|
137
136
|
opacity: 0.9;
|
|
138
137
|
}
|
|
138
|
+
|
|
139
139
|
100% {
|
|
140
140
|
opacity: 0.2;
|
|
141
141
|
}
|
|
@@ -25,7 +25,6 @@
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
.ty-loader {
|
|
28
|
-
font-family: -apple-system, blinkmacsystemfont, "Segoe UI", roboto, "Helvetica Neue", arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
|
29
28
|
position: relative;
|
|
30
29
|
display: inline-block;
|
|
31
30
|
color: var(--ty-color-primary);
|
|
@@ -43,7 +42,7 @@
|
|
|
43
42
|
position: absolute;
|
|
44
43
|
display: block;
|
|
45
44
|
transform: scale(0.75);
|
|
46
|
-
background-color:
|
|
45
|
+
background-color: currentcolor;
|
|
47
46
|
border-radius: 50%;
|
|
48
47
|
transform-origin: 50% 50%;
|
|
49
48
|
opacity: 0.5;
|
|
@@ -70,7 +69,6 @@
|
|
|
70
69
|
}
|
|
71
70
|
.ty-loader__label {
|
|
72
71
|
margin: 5px 0;
|
|
73
|
-
font-family: -apple-system, blinkmacsystemfont, "Segoe UI", roboto, "Helvetica Neue", arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
|
74
72
|
-webkit-user-select: none;
|
|
75
73
|
-moz-user-select: none;
|
|
76
74
|
user-select: none;
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
@use "../image/style/index" as *;
|
|
29
29
|
@use "../input/style/index" as *;
|
|
30
30
|
@use "../input-number/style/index" as *;
|
|
31
|
+
@use "../input-otp/style/index" as *;
|
|
31
32
|
@use "../input-password/style/index" as *;
|
|
32
33
|
@use "../layout/style/index" as *;
|
|
33
34
|
@use "../link/style/index" as *;
|
|
@@ -75,4 +76,4 @@
|
|
|
75
76
|
@use "../tree/style/index" as *;
|
|
76
77
|
@use "../typography/style/index" as *;
|
|
77
78
|
@use "../upload/style/index" as *;
|
|
78
|
-
@use "../with-spin/style/index" as *;
|
|
79
|
+
@use "../with-spin/style/index" as *;
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
display: inline-flex;
|
|
3
3
|
position: relative;
|
|
4
4
|
font-size: 1rem;
|
|
5
|
-
font-family: -apple-system, blinkmacsystemfont, "Segoe UI", roboto, "Helvetica Neue", arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
|
6
5
|
}
|
|
7
6
|
.ty-time-picker__input {
|
|
8
7
|
display: inline-flex;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tiny-design/react",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "A friendly UI component set for React",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -55,8 +55,8 @@
|
|
|
55
55
|
"classnames": "^2.3.1",
|
|
56
56
|
"react-transition-group": "^4.4.2",
|
|
57
57
|
"tslib": "^2.3.1",
|
|
58
|
-
"@tiny-design/
|
|
59
|
-
"@tiny-design/
|
|
58
|
+
"@tiny-design/tokens": "1.1.1",
|
|
59
|
+
"@tiny-design/icons": "1.1.1"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@testing-library/jest-dom": "^6.0.0",
|