@yakad/ui 1.2.110-beta → 1.2.112-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/button/button.d.ts +1 -0
- package/button/button.js +1 -1
- package/button/button.js.map +1 -1
- package/button/button.tsx +6 -1
- package/checkbox/checkbox.d.ts +1 -0
- package/checkbox/checkbox.js +5 -6
- package/checkbox/checkbox.js.map +1 -1
- package/checkbox/checkbox.module.css +12 -17
- package/checkbox/checkbox.tsx +9 -8
- package/form/form.js +1 -4
- package/form/form.js.map +1 -1
- package/form/form.tsx +1 -9
- package/package.json +1 -1
package/button/button.d.ts
CHANGED
|
@@ -9,5 +9,6 @@ export interface ButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
|
9
9
|
loadingPosition?: "auto" | "center";
|
|
10
10
|
loadingVariant?: "scaleOut" | "dots" | "spinner";
|
|
11
11
|
disabled?: boolean;
|
|
12
|
+
submit?: boolean;
|
|
12
13
|
}
|
|
13
14
|
export default function Button(props: ButtonProps): JSX.Element;
|
package/button/button.js
CHANGED
|
@@ -15,7 +15,7 @@ export default function Button(props) {
|
|
|
15
15
|
const joinedClassNames = joinClassNames(styles.button, props.variant ? styles[props.variant] : styles.text, props.loadingVariant ? styles.loading : "", props.loadingVariant && centerLoading
|
|
16
16
|
? styles.loadingPositionCenter
|
|
17
17
|
: "", props.size ? styles[props.size] : styles.medium, props.borderStyle ? styles[props.borderStyle] : styles.rounded, props.icon && !props.children ? styles.iconButton : "", props.className);
|
|
18
|
-
return (React.createElement("button", { ...props, className: joinedClassNames },
|
|
18
|
+
return (React.createElement("button", { type: props.submit ? "submit" : "button", ...props, className: joinedClassNames },
|
|
19
19
|
startWithChildren ? props.children : null,
|
|
20
20
|
props.loadingVariant ? (React.createElement("div", { className: joinClassNames(centerLoading ? styles.positionCenter : "", styles.displayOnDisabled) },
|
|
21
21
|
React.createElement(Loading, { size: props.size, variant: props.loadingVariant }))) : null,
|
package/button/button.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","sourceRoot":"","sources":["button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,OAAO,MAAM,oBAAoB,CAAC;AACzC,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAEzC,OAAO,MAAM,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"button.js","sourceRoot":"","sources":["button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,OAAO,MAAM,oBAAoB,CAAC;AACzC,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAEzC,OAAO,MAAM,MAAM,gBAAgB,CAAC;AA4BpC,MAAM,YAAY,GAAgB;IAC9B,KAAK,EAAE,CAAC;IACR,MAAM,EAAE,GAAG;IACX,KAAK,EAAE,GAAG;CACb,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAkB;IAC7C,MAAM,iBAAiB,GAAG,KAAK,CAAC,YAAY,KAAK,KAAK,CAAC;IACvD,MAAM,aAAa,GACf,CAAC,KAAK,CAAC,IAAI;QACX,CAAC,KAAK,CAAC,cAAc,IAAI,KAAK,CAAC,eAAe,KAAK,QAAQ,CAAC,CAAC;IAEjE,MAAM,gBAAgB,GAAG,cAAc,CACnC,MAAM,CAAC,MAAM,EACb,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,EACnD,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAC1C,KAAK,CAAC,cAAc,IAAI,aAAa;QACjC,CAAC,CAAC,MAAM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,CAAC,IAAI;QACP,CAAC,iBAAiB,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CACtC,CACZ,CAAC;AACN,CAAC"}
|
package/button/button.tsx
CHANGED
|
@@ -22,6 +22,7 @@ export interface ButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
|
22
22
|
loadingPosition?: "auto" | "center";
|
|
23
23
|
loadingVariant?: "scaleOut" | "dots" | "spinner";
|
|
24
24
|
disabled?: boolean;
|
|
25
|
+
submit?: boolean;
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
interface iconSizeMap {
|
|
@@ -56,7 +57,11 @@ export default function Button(props: ButtonProps) {
|
|
|
56
57
|
);
|
|
57
58
|
|
|
58
59
|
return (
|
|
59
|
-
<button
|
|
60
|
+
<button
|
|
61
|
+
type={props.submit ? "submit" : "button"}
|
|
62
|
+
{...props}
|
|
63
|
+
className={joinedClassNames}
|
|
64
|
+
>
|
|
60
65
|
{startWithChildren ? props.children : null}
|
|
61
66
|
{props.loadingVariant ? (
|
|
62
67
|
<div
|
package/checkbox/checkbox.d.ts
CHANGED
package/checkbox/checkbox.js
CHANGED
|
@@ -5,14 +5,13 @@ import styles from "./checkbox.module.css";
|
|
|
5
5
|
import { joinClassNames } from "@yakad/lib";
|
|
6
6
|
export default function Chekbox(props) {
|
|
7
7
|
const joinedClassNames = joinClassNames(styles.checkbox, props.label ? styles.labeled : "");
|
|
8
|
-
const [checked, setChecked] = React.useState();
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
setChecked(targetInputElement.checked);
|
|
8
|
+
const [checked, setChecked] = React.useState(props.checked ? props.checked : false);
|
|
9
|
+
const onClickCheckboxHandler = () => {
|
|
10
|
+
setChecked((value) => !value);
|
|
12
11
|
};
|
|
13
12
|
return (React.createElement("div", { className: joinedClassNames },
|
|
14
13
|
props.label ? (React.createElement("label", { className: styles.label, htmlFor: props.name }, props.label)) : null,
|
|
15
|
-
React.createElement(Button, {
|
|
16
|
-
React.createElement("input", { ...props, className: styles.input, type: "checkbox", name: props.name, disabled: props.disabled
|
|
14
|
+
React.createElement(Button, { icon: checked ? "check_box" : "check_box_outline_blank", onClick: (event) => onClickCheckboxHandler(), disabled: props.disabled }),
|
|
15
|
+
React.createElement("input", { ...props, className: styles.input, type: "checkbox", name: props.name, checked: checked, disabled: props.disabled })));
|
|
17
16
|
}
|
|
18
17
|
//# sourceMappingURL=checkbox.js.map
|
package/checkbox/checkbox.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.js","sourceRoot":"","sources":["checkbox.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,MAAM,MAAM,kBAAkB,CAAC;AACtC,OAAO,MAAM,MAAM,uBAAuB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"checkbox.js","sourceRoot":"","sources":["checkbox.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,MAAM,MAAM,kBAAkB,CAAC;AACtC,OAAO,MAAM,MAAM,uBAAuB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAS5C,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,KAAoB;IAChD,MAAM,gBAAgB,GAAG,cAAc,CACnC,MAAM,CAAC,QAAQ,EACf,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CACpC,CAAC;IAEF,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,KAAK,CAAC,QAAQ,CACxC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CACxC,CAAC;IACF,MAAM,sBAAsB,GAAG,GAAG,EAAE;QAChC,UAAU,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC,CAAC;IAEF,OAAO,CACH,6BAAK,SAAS,EAAE,gBAAgB;QAC3B,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CACX,+BAAO,SAAS,EAAE,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,IAAI,IAC9C,KAAK,CAAC,KAAK,CACR,CACX,CAAC,CAAC,CAAC,IAAI;QACR,oBAAC,MAAM,IACH,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,yBAAyB,EACvD,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,sBAAsB,EAAE,EAC5C,QAAQ,EAAE,KAAK,CAAC,QAAQ,GAC1B;QACF,kCACQ,KAAK,EACT,SAAS,EAAE,MAAM,CAAC,KAAK,EACvB,IAAI,EAAC,UAAU,EACf,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,KAAK,CAAC,QAAQ,GAC1B,CACA,CACT,CAAC;AACN,CAAC"}
|
|
@@ -1,27 +1,22 @@
|
|
|
1
1
|
.checkbox {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
height: 4rem;
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: row;
|
|
4
|
+
width: 4rem;
|
|
5
|
+
height: 4rem;
|
|
7
6
|
}
|
|
8
7
|
.checkbox.labeled {
|
|
9
|
-
|
|
8
|
+
width: 100%;
|
|
10
9
|
}
|
|
11
10
|
|
|
12
11
|
.input {
|
|
13
|
-
|
|
14
|
-
opacity: 0;
|
|
15
|
-
width: 100%;
|
|
16
|
-
height: 100%;
|
|
17
|
-
margin: 0;
|
|
12
|
+
display: none;
|
|
18
13
|
}
|
|
19
14
|
|
|
20
15
|
.label {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
16
|
+
display: block;
|
|
17
|
+
width: auto;
|
|
18
|
+
margin: 0.9rem 1rem;
|
|
19
|
+
margin-inline-end: auto;
|
|
20
|
+
line-height: 2.2rem;
|
|
21
|
+
font-size: 1.4rem;
|
|
27
22
|
}
|
package/checkbox/checkbox.tsx
CHANGED
|
@@ -8,6 +8,7 @@ import { joinClassNames } from "@yakad/lib";
|
|
|
8
8
|
export interface CheckboxProps extends React.HTMLAttributes<HTMLInputElement> {
|
|
9
9
|
name?: string;
|
|
10
10
|
label?: string;
|
|
11
|
+
checked?: boolean;
|
|
11
12
|
disabled?: boolean;
|
|
12
13
|
}
|
|
13
14
|
|
|
@@ -17,12 +18,11 @@ export default function Chekbox(props: CheckboxProps) {
|
|
|
17
18
|
props.label ? styles.labeled : ""
|
|
18
19
|
);
|
|
19
20
|
|
|
20
|
-
const [checked, setChecked] = React.useState<boolean>(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
) => {
|
|
24
|
-
|
|
25
|
-
setChecked(targetInputElement.checked);
|
|
21
|
+
const [checked, setChecked] = React.useState<boolean>(
|
|
22
|
+
props.checked ? props.checked : false
|
|
23
|
+
);
|
|
24
|
+
const onClickCheckboxHandler = () => {
|
|
25
|
+
setChecked((value) => !value);
|
|
26
26
|
};
|
|
27
27
|
|
|
28
28
|
return (
|
|
@@ -33,16 +33,17 @@ export default function Chekbox(props: CheckboxProps) {
|
|
|
33
33
|
</label>
|
|
34
34
|
) : null}
|
|
35
35
|
<Button
|
|
36
|
-
disabled={props.disabled}
|
|
37
36
|
icon={checked ? "check_box" : "check_box_outline_blank"}
|
|
37
|
+
onClick={(event) => onClickCheckboxHandler()}
|
|
38
|
+
disabled={props.disabled}
|
|
38
39
|
/>
|
|
39
40
|
<input
|
|
40
41
|
{...props}
|
|
41
42
|
className={styles.input}
|
|
42
43
|
type="checkbox"
|
|
43
44
|
name={props.name}
|
|
45
|
+
checked={checked}
|
|
44
46
|
disabled={props.disabled}
|
|
45
|
-
onChange={(event) => onChangeCheckboxHandler(event)}
|
|
46
47
|
/>
|
|
47
48
|
</div>
|
|
48
49
|
);
|
package/form/form.js
CHANGED
|
@@ -3,9 +3,6 @@ import { joinClassNames } from "@yakad/lib";
|
|
|
3
3
|
import styles from "./form.module.css";
|
|
4
4
|
export default function Form(props) {
|
|
5
5
|
const joinedClassNames = joinClassNames(styles.form, props.className);
|
|
6
|
-
return (React.createElement("form", { ...props, className: joinedClassNames,
|
|
7
|
-
e.preventDefault();
|
|
8
|
-
props.onSubmit(null);
|
|
9
|
-
} }, props.children));
|
|
6
|
+
return (React.createElement("form", { ...props, className: joinedClassNames }, props.children));
|
|
10
7
|
}
|
|
11
8
|
//# sourceMappingURL=form.js.map
|
package/form/form.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.js","sourceRoot":"","sources":["form.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAc,MAAM,YAAY,CAAC;AACxD,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,KAA4C;IACrE,MAAM,gBAAgB,GAAG,cAAc,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,SAAU,CAAC,CAAC;IAEvE,OAAO,CACH,
|
|
1
|
+
{"version":3,"file":"form.js","sourceRoot":"","sources":["form.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAc,MAAM,YAAY,CAAC;AACxD,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,KAA4C;IACrE,MAAM,gBAAgB,GAAG,cAAc,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,SAAU,CAAC,CAAC;IAEvE,OAAO,CACH,iCAAU,KAAK,EAAE,SAAS,EAAE,gBAAgB,IACvC,KAAK,CAAC,QAAe,CACnB,CACV,CAAC;AACN,CAAC"}
|
package/form/form.tsx
CHANGED
|
@@ -6,15 +6,7 @@ export default function Form(props: React.HTMLAttributes<HTMLFormElement>) {
|
|
|
6
6
|
const joinedClassNames = joinClassNames(styles.form, props.className!);
|
|
7
7
|
|
|
8
8
|
return (
|
|
9
|
-
<form
|
|
10
|
-
{...props}
|
|
11
|
-
className={joinedClassNames}
|
|
12
|
-
onSubmit={(e) => {
|
|
13
|
-
e.preventDefault();
|
|
14
|
-
|
|
15
|
-
props.onSubmit!(null as any);
|
|
16
|
-
}}
|
|
17
|
-
>
|
|
9
|
+
<form {...props} className={joinedClassNames}>
|
|
18
10
|
{props.children as any}
|
|
19
11
|
</form>
|
|
20
12
|
);
|