@ctlyst.id/internal-ui 2.0.21 → 2.0.22
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/checkbox/components/checkbox.d.ts +3 -9
- package/dist/internal-ui.cjs.development.js +9 -6
- package/dist/internal-ui.cjs.development.js.map +1 -1
- package/dist/internal-ui.cjs.production.min.js +1 -1
- package/dist/internal-ui.cjs.production.min.js.map +1 -1
- package/dist/internal-ui.esm.js +9 -6
- package/dist/internal-ui.esm.js.map +1 -1
- package/package.json +2 -2
@@ -1,16 +1,10 @@
|
|
1
|
-
import type { CheckboxProps } from '@chakra-ui/react';
|
1
|
+
import type { BoxProps, CheckboxProps } from '@chakra-ui/react';
|
2
2
|
import type { PropsWithChildren } from 'react';
|
3
3
|
export interface CheckboxComponentProps extends CheckboxProps, PropsWithChildren {
|
4
4
|
isError?: boolean;
|
5
5
|
helpText?: string;
|
6
6
|
errorText?: string;
|
7
|
+
boxProps?: BoxProps;
|
7
8
|
}
|
8
|
-
declare
|
9
|
-
declare namespace CheckboxComponent {
|
10
|
-
var defaultProps: {
|
11
|
-
isError: boolean;
|
12
|
-
helpText: string;
|
13
|
-
errorText: string;
|
14
|
-
};
|
15
|
-
}
|
9
|
+
declare const CheckboxComponent: import("@chakra-ui/system/dist/system.types").ComponentWithAs<"input", CheckboxComponentProps>;
|
16
10
|
export default CheckboxComponent;
|
@@ -390,19 +390,21 @@ CardCustom.defaultProps = {
|
|
390
390
|
isRounded: true
|
391
391
|
};
|
392
392
|
|
393
|
-
|
393
|
+
const CheckboxComponent = /*#__PURE__*/react.forwardRef(({
|
394
394
|
isError = false,
|
395
395
|
helpText = '',
|
396
396
|
errorText = '',
|
397
|
+
boxProps,
|
397
398
|
children,
|
398
399
|
isDisabled,
|
399
400
|
...rest
|
400
|
-
}) {
|
401
|
+
}, ref) => {
|
401
402
|
const variant = isError ? 'errors' : 'unstyled';
|
402
|
-
return /*#__PURE__*/React__default.createElement(react.Box,
|
403
|
+
return /*#__PURE__*/React__default.createElement(react.Box, Object.assign({}, boxProps), /*#__PURE__*/React__default.createElement(react.Box, {
|
403
404
|
display: "flex"
|
404
405
|
}, /*#__PURE__*/React__default.createElement(react.Checkbox, Object.assign({
|
405
|
-
variant: variant
|
406
|
+
variant: variant,
|
407
|
+
ref: ref
|
406
408
|
}, rest, {
|
407
409
|
isDisabled: isDisabled
|
408
410
|
}), children && /*#__PURE__*/React__default.createElement(react.Text, {
|
@@ -424,11 +426,12 @@ function CheckboxComponent({
|
|
424
426
|
textStyle: "text.xs",
|
425
427
|
color: "black.medium"
|
426
428
|
}, helpText)));
|
427
|
-
}
|
429
|
+
});
|
428
430
|
CheckboxComponent.defaultProps = {
|
429
431
|
isError: false,
|
430
432
|
helpText: '',
|
431
|
-
errorText: ''
|
433
|
+
errorText: '',
|
434
|
+
boxProps: {}
|
432
435
|
};
|
433
436
|
|
434
437
|
const Field = props => {
|