colibri-ui 0.7.30 → 0.7.32
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/Checkbox/index.js +30 -22
- package/Checkbox/index.props.d.ts +1 -0
- package/Checkbox/styles.d.ts +8 -0
- package/Checkbox/styles.js +22 -8
- package/Typography/index.js +1 -4
- package/Typography/index.props.d.ts +0 -1
- package/Typography/styles.d.ts +0 -1
- package/Typography/styles.js +16 -19
- package/esm/Checkbox/index.js +32 -24
- package/esm/Checkbox/index.props.d.ts +1 -0
- package/esm/Checkbox/styles.d.ts +8 -0
- package/esm/Checkbox/styles.js +21 -9
- package/esm/Typography/index.js +1 -4
- package/esm/Typography/index.props.d.ts +0 -1
- package/esm/Typography/styles.d.ts +0 -1
- package/esm/Typography/styles.js +16 -19
- package/package.json +1 -1
package/esm/Checkbox/index.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { jsx, jsxs } from '@emotion/react/jsx-runtime';
|
|
2
|
+
import Typography from '../Typography/index.js';
|
|
3
|
+
import { Label, Wrapper, Control, FakeCheckbox, Text, Root } from './styles.js';
|
|
3
4
|
|
|
4
5
|
var Checkbox = function Checkbox(_a) {
|
|
5
6
|
var id = _a.id,
|
|
6
7
|
name = _a.name,
|
|
7
8
|
value = _a.value,
|
|
8
9
|
label = _a.label,
|
|
10
|
+
hint = _a.hint,
|
|
9
11
|
checked = _a.checked,
|
|
10
12
|
onChange = _a.onChange,
|
|
11
13
|
onFocus = _a.onFocus,
|
|
@@ -15,29 +17,35 @@ var Checkbox = function Checkbox(_a) {
|
|
|
15
17
|
className = _a.className,
|
|
16
18
|
disabled = _a.disabled,
|
|
17
19
|
isError = _a.isError;
|
|
18
|
-
var control =
|
|
19
|
-
children:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
20
|
+
var control = jsx(Label, {
|
|
21
|
+
children: jsxs(Wrapper, {
|
|
22
|
+
children: [jsx(Control, {
|
|
23
|
+
className: className,
|
|
24
|
+
type: "checkbox",
|
|
25
|
+
id: id,
|
|
26
|
+
variant: variant,
|
|
27
|
+
name: name,
|
|
28
|
+
value: value,
|
|
29
|
+
checked: checked,
|
|
30
|
+
onChange: onChange,
|
|
31
|
+
onFocus: onFocus,
|
|
32
|
+
onBlur: onBlur,
|
|
33
|
+
disabled: disabled
|
|
34
|
+
}), jsx(FakeCheckbox, {
|
|
35
|
+
variant: variant,
|
|
36
|
+
checked: checked,
|
|
37
|
+
isError: isError
|
|
38
|
+
}), jsx(Text, {
|
|
39
|
+
children: label
|
|
40
|
+
})]
|
|
41
|
+
})
|
|
38
42
|
});
|
|
39
|
-
return
|
|
40
|
-
children: control
|
|
43
|
+
return jsxs(Root, {
|
|
44
|
+
children: [control, hint && jsx(Typography, {
|
|
45
|
+
variant: isError ? "alert" : "secondary",
|
|
46
|
+
tag: "span",
|
|
47
|
+
children: hint
|
|
48
|
+
})]
|
|
41
49
|
});
|
|
42
50
|
};
|
|
43
51
|
|
|
@@ -23,6 +23,7 @@ export interface CheckboxProps {
|
|
|
23
23
|
name?: string;
|
|
24
24
|
value?: string | number;
|
|
25
25
|
label?: ReactNode;
|
|
26
|
+
hint?: ReactNode;
|
|
26
27
|
checked?: boolean;
|
|
27
28
|
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
28
29
|
onFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;
|
package/esm/Checkbox/styles.d.ts
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { CheckboxVariant } from "./index.props";
|
|
3
|
+
export declare const Root: import("@emotion/styled").StyledComponent<{
|
|
4
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
5
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
6
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
7
|
+
export declare const Wrapper: import("@emotion/styled").StyledComponent<{
|
|
8
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
9
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
10
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
3
11
|
export declare const Label: import("@emotion/styled").StyledComponent<{
|
|
4
12
|
theme?: import("@emotion/react").Theme | undefined;
|
|
5
13
|
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|