@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 • 3.25 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.DividerStandAlone = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const react_1 = __importDefault(require("react"));
const text_1 = require("../../components/text/text");
const component_1 = require("../../components/text/types/component");
const elementOrIcon_1 = require("../elementOrIcon/elementOrIcon");
const tooltipUnControlled_1 = require("../tooltip/tooltipUnControlled");
const tooltipAlign_1 = require("../tooltip/types/tooltipAlign");
const divider_styled_1 = require("./divider.styled");
const DividerStandAloneComponent = ({ styles, dataTestId = 'divider', customComponent, embebed, ...props }, ref) => {
return ((0, jsx_runtime_1.jsxs)(divider_styled_1.DividerStyled, { ref: ref, "data-testid": dataTestId, embebed: embebed, styles: styles, children: [(0, jsx_runtime_1.jsxs)(divider_styled_1.DividerRowStyled, { styles: styles, children: [(0, jsx_runtime_1.jsxs)(divider_styled_1.DividerRowLabelIconGroupStyled, { styles: styles, children: [props.leftIcon?.icon && ((0, jsx_runtime_1.jsx)(elementOrIcon_1.ElementOrIcon, { customIconStyles: styles.icon, ...props.leftIcon })), customComponent, (0, jsx_runtime_1.jsx)(text_1.Text, { color: styles.label?.color, component: component_1.TextComponentType.PARAGRAPH, variant: styles.label?.font_variant, weight: styles.label?.font_weight, ...props.leftLabel, children: props.leftLabel?.content }), props.icon?.icon && ((0, jsx_runtime_1.jsx)(tooltipUnControlled_1.TooltipUnControlled, { align: tooltipAlign_1.TooltipAlignType.RIGHT, variant: styles.tooltipVariant, ...props.iconTooltip, children: (0, jsx_runtime_1.jsx)(elementOrIcon_1.ElementOrIcon, { color: styles.icon?.color, height: styles.icon?.height, width: styles.icon?.width, ...props.icon }) }))] }), (0, jsx_runtime_1.jsx)(text_1.Text, { color: styles.label?.color, component: component_1.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 : ((0, jsx_runtime_1.jsxs)(divider_styled_1.DividerRowStyled, { styles: styles, children: [(0, jsx_runtime_1.jsx)(text_1.Text, { color: styles.sublabel?.color, component: component_1.TextComponentType.PARAGRAPH, variant: styles.sublabel?.font_variant, weight: styles.sublabel?.font_weight, ...props.leftSublabel, children: props.leftSublabel?.content }), (0, jsx_runtime_1.jsx)(text_1.Text, { color: styles.sublabel?.color, component: component_1.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
*/
exports.DividerStandAlone = react_1.default.forwardRef(DividerStandAloneComponent);
//# sourceMappingURL=dividerStandAlone.js.map