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

20 lines 2.61 kB
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import React from 'react'; import { Text } from '../../components/text/text'; import { TextComponentType } from '../../components/text/types/component'; import { ElementOrIcon } from '../elementOrIcon/elementOrIcon'; import { TooltipUnControlled as Tooltip } from '../tooltip/tooltipUnControlled'; import { TooltipAlignType } from '../tooltip/types/tooltipAlign'; import { DividerRowLabelIconGroupStyled, DividerRowStyled, DividerStyled } from './divider.styled'; const DividerStandAloneComponent = ({ styles, dataTestId = 'divider', customComponent, embebed, ...props }, ref) => { return (_jsxs(DividerStyled, { ref: ref, "data-testid": dataTestId, embebed: embebed, styles: styles, children: [_jsxs(DividerRowStyled, { styles: styles, children: [_jsxs(DividerRowLabelIconGroupStyled, { styles: styles, children: [props.leftIcon?.icon && (_jsx(ElementOrIcon, { customIconStyles: styles.icon, ...props.leftIcon })), customComponent, _jsx(Text, { color: styles.label?.color, component: TextComponentType.PARAGRAPH, variant: styles.label?.font_variant, weight: styles.label?.font_weight, ...props.leftLabel, children: props.leftLabel?.content }), props.icon?.icon && (_jsx(Tooltip, { align: TooltipAlignType.RIGHT, variant: styles.tooltipVariant, ...props.iconTooltip, children: _jsx(ElementOrIcon, { color: styles.icon?.color, height: styles.icon?.height, width: styles.icon?.width, ...props.icon }) }))] }), _jsx(Text, { color: styles.label?.color, component: TextComponentType.PARAGRAPH, variant: styles.label?.font_variant, weight: styles.label?.font_weight, ...props.rightLabel, children: props.rightLabel?.content })] }), !props.leftSublabel?.content && !props.rightSublabel?.content ? null : (_jsxs(DividerRowStyled, { styles: styles, children: [_jsx(Text, { color: styles.sublabel?.color, component: TextComponentType.PARAGRAPH, variant: styles.sublabel?.font_variant, weight: styles.sublabel?.font_weight, ...props.leftSublabel, children: props.leftSublabel?.content }), _jsx(Text, { color: styles.sublabel?.color, component: TextComponentType.PARAGRAPH, variant: styles.sublabel?.font_variant, weight: styles.sublabel?.font_weight, ...props.rightSublabel, children: props.rightSublabel?.content })] }))] })); }; /** * @description * DividerStandAlone component is a wrapper component that can be used to wrap other components. * @param {IDividerStandAlone} props * @returns {JSX.Element} * @constructor */ export const DividerStandAlone = React.forwardRef(DividerStandAloneComponent); //# sourceMappingURL=dividerStandAlone.js.map