@kubit-ui-web/react-components
Version:
Kubit React Components is a customizable, accessible library of React web components, designed to enhance your application's user experience
26 lines • 1.95 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ConfirmationMessage = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const react_1 = __importDefault(require("react"));
const useStyles_1 = require("../../hooks/useStyles/useStyles");
const errorBoundary_1 = require("../../provider/errorBoundary/errorBoundary");
const fallbackComponent_1 = require("../../provider/errorBoundary/fallbackComponent");
const confirmationMessageStandAlone_1 = require("./confirmationMessageStandAlone");
const state_1 = require("./types/state");
const CONFIRMATION_MESSAGE_STYLES = 'CONFIRMATION_MESSAGE_STYLES';
const ConfirmationMessageComponent = react_1.default.forwardRef(({ state = state_1.ConfirmationMessageStateType.SUCCESS, variant, ctv, ...props }, ref) => {
const styles = (0, useStyles_1.useStyles)(CONFIRMATION_MESSAGE_STYLES, variant, ctv);
return (0, jsx_runtime_1.jsx)(confirmationMessageStandAlone_1.ConfirmationMessageStandAlone, { ...props, ref: ref, stylesState: styles[state] });
});
ConfirmationMessageComponent.displayName = 'ConfirmationMessageComponent';
const ConfirmationMessageBoundary = (props, ref) => ((0, jsx_runtime_1.jsx)(errorBoundary_1.ErrorBoundary, { fallBackComponent: (0, jsx_runtime_1.jsx)(fallbackComponent_1.FallbackComponent, { children: (0, jsx_runtime_1.jsx)(confirmationMessageStandAlone_1.ConfirmationMessageStandAlone, { ...props, ref: ref }) }), children: (0, jsx_runtime_1.jsx)(ConfirmationMessageComponent, { ...props, ref: ref }) }));
/**
* @deprecated This component has been deprecated and will be removed in the next MAJOR release.
*/
const ConfirmationMessage = react_1.default.forwardRef(ConfirmationMessageBoundary);
exports.ConfirmationMessage = ConfirmationMessage;
//# sourceMappingURL=confirmationMessage.js.map