UNPKG

@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

28 lines 1.82 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.TextCount = 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 textCountStandAlone_1 = require("./textCountStandAlone"); const TEXT_COUNT_STYLES = 'TEXT_COUNT_STYLES'; const TextCountComponent = react_1.default.forwardRef(({ variant, ctv, ...props }, ref) => { const styles = (0, useStyles_1.useStyles)(TEXT_COUNT_STYLES, variant, ctv); return (0, jsx_runtime_1.jsx)(textCountStandAlone_1.TextCountStandAlone, { ...props, ref: ref, styles: styles }); }); TextCountComponent.displayName = 'TextCountComponent'; const TextCountBoundary = (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)(textCountStandAlone_1.TextCountStandAlone, { ...props, ref: ref }) }), children: (0, jsx_runtime_1.jsx)(TextCountComponent, { ...props, ref: ref }) })); /** * @deprecated This component has been deprecated and will be not exported in the next MAJOR release. * @description * TextCount component is a component that can be used to create a counter of characters. * @param {React.PropsWithChildren<ITextCountControlled>} props * @returns {JSX.Element} */ exports.TextCount = react_1.default.forwardRef(TextCountBoundary); //# sourceMappingURL=textCount.js.map