colibri-ui 0.7.30 → 0.7.31
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/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/package.json +1 -1
package/Checkbox/index.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
6
|
+
var index = require('../Typography/index.js');
|
|
6
7
|
var styles = require('./styles.js');
|
|
7
8
|
|
|
8
9
|
var Checkbox = function Checkbox(_a) {
|
|
@@ -10,6 +11,7 @@ var Checkbox = function Checkbox(_a) {
|
|
|
10
11
|
name = _a.name,
|
|
11
12
|
value = _a.value,
|
|
12
13
|
label = _a.label,
|
|
14
|
+
hint = _a.hint,
|
|
13
15
|
checked = _a.checked,
|
|
14
16
|
onChange = _a.onChange,
|
|
15
17
|
onFocus = _a.onFocus,
|
|
@@ -19,29 +21,35 @@ var Checkbox = function Checkbox(_a) {
|
|
|
19
21
|
className = _a.className,
|
|
20
22
|
disabled = _a.disabled,
|
|
21
23
|
isError = _a.isError;
|
|
22
|
-
var control = jsxRuntime.
|
|
23
|
-
children:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
24
|
+
var control = jsxRuntime.jsx(styles.Label, {
|
|
25
|
+
children: jsxRuntime.jsxs(styles.Wrapper, {
|
|
26
|
+
children: [jsxRuntime.jsx(styles.Control, {
|
|
27
|
+
className: className,
|
|
28
|
+
type: "checkbox",
|
|
29
|
+
id: id,
|
|
30
|
+
variant: variant,
|
|
31
|
+
name: name,
|
|
32
|
+
value: value,
|
|
33
|
+
checked: checked,
|
|
34
|
+
onChange: onChange,
|
|
35
|
+
onFocus: onFocus,
|
|
36
|
+
onBlur: onBlur,
|
|
37
|
+
disabled: disabled
|
|
38
|
+
}), jsxRuntime.jsx(styles.FakeCheckbox, {
|
|
39
|
+
variant: variant,
|
|
40
|
+
checked: checked,
|
|
41
|
+
isError: isError
|
|
42
|
+
}), jsxRuntime.jsx(styles.Text, {
|
|
43
|
+
children: label
|
|
44
|
+
})]
|
|
45
|
+
})
|
|
42
46
|
});
|
|
43
|
-
return jsxRuntime.
|
|
44
|
-
children: control
|
|
47
|
+
return jsxRuntime.jsxs(styles.Root, {
|
|
48
|
+
children: [control, hint && jsxRuntime.jsx(index.default, {
|
|
49
|
+
variant: isError ? "alert" : "secondary",
|
|
50
|
+
tag: "span",
|
|
51
|
+
children: hint
|
|
52
|
+
})]
|
|
45
53
|
});
|
|
46
54
|
};
|
|
47
55
|
|
|
@@ -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/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;
|