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

25 lines 1.44 kB
import { jsx as _jsx } from "react/jsx-runtime"; import React from 'react'; import { STYLES_NAME } from '../../constants/stylesName/stylesName'; import { useStyles } from '../../hooks/useStyles/useStyles'; import { ErrorBoundary } from '../../provider/errorBoundary/errorBoundary'; import { FallbackComponent } from '../../provider/errorBoundary/fallbackComponent'; import { TagStandAlone } from './tagStandAlone'; const TagComponent = React.forwardRef(({ variant, ctv, extraCt, ...props }, ref) => { const optionsStyles = useStyles(STYLES_NAME.TAG, props.option, extraCt); const variantStyles = useStyles(STYLES_NAME.TAG, variant, ctv) || {}; const variantStatusStyles = variantStyles[props.status]; return (_jsx(TagStandAlone, { ...props, ref: ref, optionStyles: optionsStyles, variant: variant, variantStatusStyles: variantStatusStyles, children: props.children })); }); TagComponent.displayName = 'TagComponent'; const TagBoundary = (props, ref) => (_jsx(ErrorBoundary, { fallBackComponent: _jsx(FallbackComponent, { children: _jsx(TagStandAlone, { ...props, ref: ref }) }), children: _jsx(TagComponent, { ...props, ref: ref }) })); /** * @deprecated Try TagV2 component that will override this component in the next major */ const Tag = React.forwardRef(TagBoundary); /** * @description * Tag component is used to highlight or categorize important information. */ export { Tag }; //# sourceMappingURL=tag.js.map