@televet/kibble-ui 1.12.6 → 1.12.8
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/build/components/Overlay/Modal/{modalCloseButton.component.d.ts → components/ModalCloseButton/modalCloseButton.component.d.ts} +1 -1
- package/build/components/Overlay/Modal/{modalFooterButtons.component.d.ts → components/ModalFooterButtons/modalFooterButtons.component.d.ts} +2 -1
- package/build/components/Overlay/Modal/{modalHeader.component.d.ts → components/ModalHeader/modalHeader.component.d.ts} +1 -1
- package/build/components/Overlay/Modal/index.d.ts +5 -5
- package/build/index.js +5 -4
- package/build/index.js.map +1 -1
- package/package.json +1 -1
- /package/build/components/Overlay/Modal/{modalBody.component.d.ts → components/ModalBody/modalBody.component.d.ts} +0 -0
- /package/build/components/Overlay/Modal/{modalFooter.component.d.ts → components/ModalFooter/modalFooter.component.d.ts} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ButtonProps } from '
|
|
1
|
+
import { ButtonProps } from '../../../../Forms';
|
|
2
2
|
export declare const ModalCloseButton: ({ right, left, size, ...rest }: ButtonProps) => JSX.Element;
|
|
@@ -2,9 +2,10 @@ import { ModalFooterProps as ChakraModalFooterProps } from '@chakra-ui/react';
|
|
|
2
2
|
export interface ModalFooterButtonProps extends ChakraModalFooterProps {
|
|
3
3
|
submitText?: string;
|
|
4
4
|
isLoading?: boolean;
|
|
5
|
+
isDisabled?: boolean;
|
|
5
6
|
isDestructive?: boolean;
|
|
6
7
|
onSubmit?: () => void;
|
|
7
8
|
allowCancel?: boolean;
|
|
8
9
|
onCancel?: () => void;
|
|
9
10
|
}
|
|
10
|
-
export declare const ModalFooterButtons: ({ submitText, isLoading, isDestructive, children, onSubmit, allowCancel, onCancel, ...rest }: ModalFooterButtonProps) => JSX.Element;
|
|
11
|
+
export declare const ModalFooterButtons: ({ submitText, isLoading, isDisabled, isDestructive, children, onSubmit, allowCancel, onCancel, ...rest }: ModalFooterButtonProps) => JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ModalHeaderProps as ChakraModalHeaderProps } from '@chakra-ui/react';
|
|
2
|
-
import { HeadingSize } from '
|
|
2
|
+
import { HeadingSize } from '../../../../Typography';
|
|
3
3
|
export interface ModalHeaderProps extends ChakraModalHeaderProps {
|
|
4
4
|
size?: HeadingSize;
|
|
5
5
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * from './modal.types';
|
|
2
2
|
export * as BetaModal from './modal.component';
|
|
3
|
-
export * from './modalHeader.component';
|
|
4
|
-
export * from './modalCloseButton.component';
|
|
5
|
-
export * from './modalBody.component';
|
|
6
|
-
export * from './modalFooter.component';
|
|
7
|
-
export * from './modalFooterButtons.component';
|
|
3
|
+
export * from './components/ModalHeader/modalHeader.component';
|
|
4
|
+
export * from './components/ModalCloseButton/modalCloseButton.component';
|
|
5
|
+
export * from './components/ModalBody/modalBody.component';
|
|
6
|
+
export * from './components/ModalFooter/modalFooter.component';
|
|
7
|
+
export * from './components/ModalFooterButtons/modalFooterButtons.component';
|
package/build/index.js
CHANGED
|
@@ -3592,12 +3592,13 @@ function withFormControl(Component) {
|
|
|
3592
3592
|
var _b = _a.errorText, errorText = _b === void 0 ? 'Field is invalid' : _b, helperText = _a.helperText, isDisabled = _a.isDisabled, _c = _a.isFieldInline, isFieldInline = _c === void 0 ? false : _c, isInvalid = _a.isInvalid, isReadOnly = _a.isReadOnly, isRequired = _a.isRequired, label = _a.label, labelStyle = _a.labelStyle, formControlStyle = _a.formControlStyle, _d = _a.helperTextAlignment, helperTextAlignment = _d === void 0 ? 'start' : _d, props = __rest(_a, ["errorText", "helperText", "isDisabled", "isFieldInline", "isInvalid", "isReadOnly", "isRequired", "label", "labelStyle", "formControlStyle", "helperTextAlignment"]);
|
|
3593
3593
|
var _e = useTheme(), colors = _e.colors, fontSizes = _e.fontSizes;
|
|
3594
3594
|
var alignment = isInvalid && helperText ? 'space-between' : helperTextAlignment;
|
|
3595
|
+
var shouldShowBottomContent = isInvalid || helperText;
|
|
3595
3596
|
return (React__default["default"].createElement(react.FormControl, __assign({}, formControlStyle, { isInvalid: isInvalid, isRequired: isRequired, isReadOnly: isReadOnly, isDisabled: isDisabled }),
|
|
3596
3597
|
label && (React__default["default"].createElement(react.FormLabel, __assign({ display: isFieldInline ? 'inline-block' : 'block', color: colors.text.light.default }, labelStyle), label)),
|
|
3597
3598
|
React__default["default"].createElement(Component, __assign({}, props, { "$isFieldInline": isFieldInline, errorBorderColor: colors.border.light.error, focusBorderColor: colors.border.light.focus })),
|
|
3598
|
-
React__default["default"].createElement(react.Flex, { mt:
|
|
3599
|
+
shouldShowBottomContent && (React__default["default"].createElement(react.Flex, { mt: 2, w: "100%", justifyContent: alignment, alignItems: "center" },
|
|
3599
3600
|
React__default["default"].createElement(react.FormErrorMessage, { m: 0, fontSize: fontSizes.xs, color: colors.text.light.error }, errorText),
|
|
3600
|
-
helperText && (React__default["default"].createElement(react.FormHelperText, { m: 0, color: isInvalid ? colors.text.light.error : colors.text.light.subtle, fontSize: fontSizes.xs }, helperText)))));
|
|
3601
|
+
helperText && (React__default["default"].createElement(react.FormHelperText, { m: 0, color: isInvalid ? colors.text.light.error : colors.text.light.subtle, fontSize: fontSizes.xs }, helperText))))));
|
|
3601
3602
|
}
|
|
3602
3603
|
WithFormControl.displayName = "withFormControl(".concat(Component.displayName || Component.name);
|
|
3603
3604
|
return WithFormControl;
|
|
@@ -6834,7 +6835,7 @@ var ModalFooter = function (_a) {
|
|
|
6834
6835
|
};
|
|
6835
6836
|
|
|
6836
6837
|
var ModalFooterButtons = function (_a) {
|
|
6837
|
-
var _b = _a.submitText, submitText = _b === void 0 ? 'Submit' : _b, isLoading = _a.isLoading, isDestructive = _a.isDestructive; _a.children; var onSubmit = _a.onSubmit, _c = _a.allowCancel, allowCancel = _c === void 0 ? true : _c, onCancel = _a.onCancel, rest = __rest(_a, ["submitText", "isLoading", "isDestructive", "children", "onSubmit", "allowCancel", "onCancel"]);
|
|
6838
|
+
var _b = _a.submitText, submitText = _b === void 0 ? 'Submit' : _b, isLoading = _a.isLoading, isDisabled = _a.isDisabled, isDestructive = _a.isDestructive; _a.children; var onSubmit = _a.onSubmit, _c = _a.allowCancel, allowCancel = _c === void 0 ? true : _c, onCancel = _a.onCancel, rest = __rest(_a, ["submitText", "isLoading", "isDisabled", "isDestructive", "children", "onSubmit", "allowCancel", "onCancel"]);
|
|
6838
6839
|
var onClose = react.useModalContext().onClose;
|
|
6839
6840
|
var handleCancel = function () {
|
|
6840
6841
|
if (onCancel) {
|
|
@@ -6846,7 +6847,7 @@ var ModalFooterButtons = function (_a) {
|
|
|
6846
6847
|
React__default["default"].createElement(react.Flex, { w: "100%" },
|
|
6847
6848
|
allowCancel && (React__default["default"].createElement(Button, { variant: "tertiary", onClick: handleCancel }, "Cancel")),
|
|
6848
6849
|
React__default["default"].createElement(react.Spacer, null),
|
|
6849
|
-
React__default["default"].createElement(Button, { onClick: onSubmit, isLoading: isLoading, variant: isDestructive ? 'primaryDestructive' : 'primary' }, submitText))));
|
|
6850
|
+
React__default["default"].createElement(Button, { onClick: onSubmit, isLoading: isLoading, isDisabled: isDisabled, variant: isDestructive ? 'primaryDestructive' : 'primary' }, submitText))));
|
|
6850
6851
|
};
|
|
6851
6852
|
|
|
6852
6853
|
// @ts-ignore
|