pixelize-design-library 1.1.88 → 1.1.89
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.
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { CheckboxProps } from "./CheckboxProps";
|
|
3
|
-
export default function CheckBox({ label, spacing, isInvalid, color, iconColor, iconSize, isChecked, isIndeterminate, onChange, isDisabled, size, value, defaultChecked, sx, }: CheckboxProps): React.JSX.Element;
|
|
3
|
+
export default function CheckBox({ label, spacing, isInvalid, color, iconColor, iconSize, isChecked, isIndeterminate, onChange, isDisabled, size, value, defaultChecked, sx, isRequired, error, errorMessage, isInformation, informationMessage, id, helperText, }: CheckboxProps): React.JSX.Element;
|
|
@@ -6,9 +6,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
var react_1 = __importDefault(require("react"));
|
|
7
7
|
var react_2 = require("@chakra-ui/react");
|
|
8
8
|
var useCustomTheme_1 = require("../../Theme/useCustomTheme");
|
|
9
|
+
var FormLabel_1 = require("../Common/FormLabel");
|
|
10
|
+
var ErrorMessage_1 = __importDefault(require("../Common/ErrorMessage"));
|
|
11
|
+
var HelperText_1 = __importDefault(require("../Common/HelperText"));
|
|
9
12
|
function CheckBox(_a) {
|
|
10
|
-
var label = _a.label, spacing = _a.spacing, isInvalid = _a.isInvalid, color = _a.color, iconColor = _a.iconColor, iconSize = _a.iconSize, isChecked = _a.isChecked, isIndeterminate = _a.isIndeterminate, onChange = _a.onChange, isDisabled = _a.isDisabled, size = _a.size, value = _a.value, defaultChecked = _a.defaultChecked, sx = _a.sx;
|
|
13
|
+
var label = _a.label, spacing = _a.spacing, isInvalid = _a.isInvalid, color = _a.color, iconColor = _a.iconColor, iconSize = _a.iconSize, isChecked = _a.isChecked, isIndeterminate = _a.isIndeterminate, onChange = _a.onChange, isDisabled = _a.isDisabled, size = _a.size, value = _a.value, defaultChecked = _a.defaultChecked, sx = _a.sx, isRequired = _a.isRequired, error = _a.error, errorMessage = _a.errorMessage, isInformation = _a.isInformation, informationMessage = _a.informationMessage, id = _a.id, helperText = _a.helperText;
|
|
11
14
|
var theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
12
|
-
return (react_1.default.createElement(react_2.
|
|
15
|
+
return (react_1.default.createElement(react_2.FormControl, { isInvalid: error },
|
|
16
|
+
react_1.default.createElement(react_2.Checkbox, { spacing: spacing, isInvalid: isInvalid, isRequired: isRequired, colorScheme: color, iconColor: iconColor, iconSize: iconSize, isChecked: isChecked, isIndeterminate: isIndeterminate, onChange: onChange, isDisabled: isDisabled, size: size, value: value, defaultChecked: defaultChecked, borderColor: theme.colors.gray[500], sx: sx }, label && (react_1.default.createElement(FormLabel_1.TextLabel, { label: label, id: id, isInformation: isInformation, informationMessage: informationMessage, isRequired: isRequired }))),
|
|
17
|
+
error && react_1.default.createElement(ErrorMessage_1.default, { errorMessage: errorMessage }),
|
|
18
|
+
helperText && !error && react_1.default.createElement(HelperText_1.default, { helperText: helperText })));
|
|
13
19
|
}
|
|
14
20
|
exports.default = CheckBox;
|
|
@@ -5,4 +5,11 @@ export type CheckboxProps = Pick<ChakraButtonProps, "spacing" | "isInvalid" | "s
|
|
|
5
5
|
variant?: "solid" | "outline" | "ghost" | "link" | "unstyled";
|
|
6
6
|
color?: "gray" | "red" | "orange" | "yellow" | "green" | "teal" | "blue" | "cyan" | "purple" | "pink" | "whiteAlpha" | "blackAlpha";
|
|
7
7
|
size?: "sm" | "md" | "lg";
|
|
8
|
+
isRequired?: boolean;
|
|
9
|
+
error?: boolean;
|
|
10
|
+
errorMessage?: string;
|
|
11
|
+
isInformation?: boolean;
|
|
12
|
+
informationMessage?: string;
|
|
13
|
+
id?: string;
|
|
14
|
+
helperText?: string;
|
|
8
15
|
};
|