UNPKG

@legion-ui-kit/react-core

Version:

To install the package into your project:

3 lines (2 loc) 991 B
import{jsxs as e,jsx as l}from"react/jsx-runtime";import s from"classnames";import t from"./styles.module.scss.js";import{DIVIDER_DEFAULT_PROPS as a,DIVIDER_ORIENTATION as i,DIVIDER_HORIZONTAL_LABEL_POSITION as o,DIVIDER_VERTICAL_LABEL_POSITION as n}from"./Divider.constant.js";const r=r=>{const{className:m,firstLineClassName:c,firstLineStyle:d,label:p,labelClassName:y,labelPosition:b=a.labelPosition,labelStyle:f,lineType:N=a.lineType,secondLineClassName:h,secondLineStyle:v,orientation:S=a.orientation,...u}=r,L=S===i.horizontal&&b!==o.left||S===i.vertical&&b!==n.top,_=S===i.horizontal&&b!==o.right||S===i.vertical&&b!==n.bottom,j=s(t.legion_divider,m,t[S],p?t[b]:t.no_label),C=s(t.label,y),g=s(t.first_line,c),x=s(t.second_line,h);return e("div",{className:j,...u,children:[L&&l("span",{className:g,style:{borderStyle:N,...d}}),l("span",{className:C,style:f,children:p}),_&&l("span",{className:x,style:{borderStyle:N,...v}})]})};export{r as default}; //# sourceMappingURL=index.js.map