@yakad/ui 1.2.80-beta → 1.2.81-beta
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/codeField/codeField.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ interface CodeFieldsProps extends React.HTMLAttributes<HTMLInputElement> {
|
|
|
3
3
|
length?: number;
|
|
4
4
|
name?: string;
|
|
5
5
|
type?: string;
|
|
6
|
+
size?: "small" | "medium" | "large";
|
|
6
7
|
}
|
|
7
8
|
declare function CodeField(this: any, props: CodeFieldsProps): JSX.Element;
|
|
8
9
|
export default CodeField;
|
package/codeField/codeField.js
CHANGED
|
@@ -10,7 +10,7 @@ function sliceOverLength(event, length) {
|
|
|
10
10
|
}
|
|
11
11
|
function CodeField(props) {
|
|
12
12
|
const length = props.length ? props.length : 6;
|
|
13
|
-
const joinedClassNames = joinClassNames(styles.input, props.className);
|
|
13
|
+
const joinedClassNames = joinClassNames(styles.input, props.size ? styles[props.size] : styles.medium, props.className);
|
|
14
14
|
const joinedStyles = joinStyles({ width: "calc(1.5ch * " + props.length + ")" }, props.style);
|
|
15
15
|
return (React.createElement("input", { name: props.name, type: "number", minLength: length, maxLength: length, className: joinedClassNames, style: joinedStyles, onInput: (event) => sliceOverLength(event, length), autoComplete: "off", pattern: "[0-9]" }));
|
|
16
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codeField.js","sourceRoot":"","sources":["codeField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,MAAM,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"codeField.js","sourceRoot":"","sources":["codeField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC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OAAO,GACjB,CACL,CAAC;AACN,CAAC;AAED,eAAe,SAAS,CAAC"}
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
display: block;
|
|
4
4
|
border: none;
|
|
5
5
|
padding: 0;
|
|
6
|
-
margin:
|
|
7
|
-
margin-left: 0.5ch;
|
|
6
|
+
margin: auto;
|
|
8
7
|
background: repeating-linear-gradient(
|
|
9
8
|
90deg,
|
|
10
9
|
#7d7d7d 0,
|
|
@@ -15,7 +14,6 @@
|
|
|
15
14
|
0 100%/100% 0.2rem no-repeat;
|
|
16
15
|
color: transparent;
|
|
17
16
|
text-shadow: 0 0 0 rgb(var(--secondaryColor, 98 91 113));
|
|
18
|
-
font: 5ch consolas, monospace;
|
|
19
17
|
letter-spacing: 0.5ch;
|
|
20
18
|
}
|
|
21
19
|
.input:focus {
|
|
@@ -26,3 +24,12 @@ input::-webkit-inner-spin-button {
|
|
|
26
24
|
-webkit-appearance: none;
|
|
27
25
|
margin: 0;
|
|
28
26
|
}
|
|
27
|
+
.small {
|
|
28
|
+
font: 5ch consolas, monospace;
|
|
29
|
+
}
|
|
30
|
+
.medium {
|
|
31
|
+
font: 7ch consolas, monospace;
|
|
32
|
+
}
|
|
33
|
+
.large {
|
|
34
|
+
font: 11ch consolas, monospace;
|
|
35
|
+
}
|
package/codeField/codeField.tsx
CHANGED
|
@@ -6,6 +6,7 @@ interface CodeFieldsProps extends React.HTMLAttributes<HTMLInputElement> {
|
|
|
6
6
|
length?: number;
|
|
7
7
|
name?: string;
|
|
8
8
|
type?: string;
|
|
9
|
+
size?: "small" | "medium" | "large";
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
function sliceOverLength(
|
|
@@ -23,7 +24,11 @@ function sliceOverLength(
|
|
|
23
24
|
function CodeField(this: any, props: CodeFieldsProps) {
|
|
24
25
|
const length: number = props.length ? props.length : 6;
|
|
25
26
|
|
|
26
|
-
const joinedClassNames = joinClassNames(
|
|
27
|
+
const joinedClassNames = joinClassNames(
|
|
28
|
+
styles.input,
|
|
29
|
+
props.size ? styles[props.size] : styles.medium,
|
|
30
|
+
props.className!
|
|
31
|
+
);
|
|
27
32
|
|
|
28
33
|
const joinedStyles = joinStyles(
|
|
29
34
|
{ width: "calc(1.5ch * " + props.length + ")" },
|