colibri-ui 0.7.29 → 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 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.jsxs(jsxRuntime.Fragment, {
23
- children: [jsxRuntime.jsx(styles.Control, {
24
- className: className,
25
- type: "checkbox",
26
- id: id,
27
- variant: variant,
28
- name: name,
29
- value: value,
30
- checked: checked,
31
- onChange: onChange,
32
- onFocus: onFocus,
33
- onBlur: onBlur,
34
- disabled: disabled
35
- }), jsxRuntime.jsx(styles.FakeCheckbox, {
36
- variant: variant,
37
- checked: checked,
38
- isError: isError
39
- }), jsxRuntime.jsx(styles.Text, {
40
- children: label
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.jsx(styles.Label, {
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;
@@ -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;