@legion-ui-kit/react-core
Version:
<div align="center"> <img height="108" width="116" src="https://legion.digitaltelkom.id/favicon.svg?v=4643a71fb65fa61a5f2b266b769ea7b1" /> <h1 align="center">Legion UI Kit - React Core</h1> </div>
1 lines • 3.95 kB
Source Map (JSON)
{"version":3,"file":"index.cjs","sources":["../../../../src/components/Divider/index.tsx"],"sourcesContent":["// Modules\r\nimport cn from 'classnames';\r\n\r\n// Types\r\nimport type { TDividerProps } from './Divider.type';\r\n\r\n// Styles\r\nimport styles from './styles.module.scss';\r\n\r\n// Constants\r\nimport {\r\n DIVIDER_DEFAULT_PROPS,\r\n DIVIDER_HORIZONTAL_LABEL_POSITION,\r\n DIVIDER_ORIENTATION,\r\n DIVIDER_VERTICAL_LABEL_POSITION\r\n} from './Divider.constant';\r\n\r\nconst Divider = (props: TDividerProps) => {\r\n const {\r\n className,\r\n firstLineClassName,\r\n firstLineStyle,\r\n label,\r\n labelClassName,\r\n labelPosition = DIVIDER_DEFAULT_PROPS.labelPosition,\r\n labelStyle,\r\n lineType = DIVIDER_DEFAULT_PROPS.lineType,\r\n secondLineClassName,\r\n secondLineStyle,\r\n orientation = DIVIDER_DEFAULT_PROPS.orientation,\r\n ...restProps\r\n } = props;\r\n const hasFirstLine =\r\n (orientation === DIVIDER_ORIENTATION.horizontal && labelPosition !== DIVIDER_HORIZONTAL_LABEL_POSITION.left) ||\r\n (orientation === DIVIDER_ORIENTATION.vertical && labelPosition !== DIVIDER_VERTICAL_LABEL_POSITION.top);\r\n const hasSecondLine =\r\n (orientation === DIVIDER_ORIENTATION.horizontal && labelPosition !== DIVIDER_HORIZONTAL_LABEL_POSITION.right) ||\r\n (orientation === DIVIDER_ORIENTATION.vertical && labelPosition !== DIVIDER_VERTICAL_LABEL_POSITION.bottom);\r\n\r\n const dividerCN = cn(styles.legion_divider, className, styles[orientation!],\r\n label ? styles[labelPosition!] : styles.no_label\r\n );\r\n const labelCN = cn(styles.label, labelClassName);\r\n const firstLineCN = cn(styles.first_line, firstLineClassName);\r\n const secondLineCN = cn(styles.second_line, secondLineClassName);\r\n\r\n return (\r\n <div className={dividerCN} {...restProps}>\r\n {hasFirstLine && (\r\n <span\r\n className={firstLineCN}\r\n style={{\r\n borderStyle: lineType,\r\n ...firstLineStyle,\r\n }}\r\n />\r\n )}\r\n <span className={labelCN} style={labelStyle}>{label}</span>\r\n {hasSecondLine && (\r\n <span\r\n className={secondLineCN}\r\n style={{\r\n borderStyle: lineType,\r\n ...secondLineStyle,\r\n }}\r\n />\r\n )}\r\n </div>\r\n );\r\n};\r\n\r\nexport default Divider;\r\n"],"names":["props","className","firstLineClassName","firstLineStyle","label","labelClassName","labelPosition","DIVIDER_DEFAULT_PROPS","labelStyle","lineType","secondLineClassName","secondLineStyle","orientation","restProps","hasFirstLine","DIVIDER_ORIENTATION","horizontal","DIVIDER_HORIZONTAL_LABEL_POSITION","left","vertical","DIVIDER_VERTICAL_LABEL_POSITION","top","hasSecondLine","right","bottom","dividerCN","cn","styles","legion_divider","no_label","labelCN","firstLineCN","first_line","secondLineCN","second_line","_jsxs","children","_jsx","style","borderStyle"],"mappings":"uRAiBiBA,IACf,MAAMC,UACJA,EAASC,mBACTA,EAAkBC,eAClBA,EAAcC,MACdA,EAAKC,eACLA,EAAcC,cACdA,EAAgBC,wBAAsBD,cAAaE,WACnDA,EAAUC,SACVA,EAAWF,wBAAsBE,SAAQC,oBACzCA,EAAmBC,gBACnBA,EAAeC,YACfA,EAAcL,EAAAA,sBAAsBK,eACjCC,GACDb,EACEc,EACHF,IAAgBG,EAAAA,oBAAoBC,YAAcV,IAAkBW,EAAAA,kCAAkCC,MACtGN,IAAgBG,EAAAA,oBAAoBI,UAAYb,IAAkBc,EAAAA,gCAAgCC,IAC/FC,EACHV,IAAgBG,EAAAA,oBAAoBC,YAAcV,IAAkBW,EAAAA,kCAAkCM,OACtGX,IAAgBG,EAAAA,oBAAoBI,UAAYb,IAAkBc,EAAAA,gCAAgCI,OAE/FC,EAAYC,EAAAA,QAAGC,EAAAA,QAAOC,eAAgB3B,EAAW0B,EAAAA,QAAOf,GAC5DR,EAAQuB,EAAAA,QAAOrB,GAAkBqB,EAAAA,QAAOE,UAEpCC,EAAUJ,EAAAA,QAAGC,UAAOvB,MAAOC,GAC3B0B,EAAcL,EAAAA,QAAGC,UAAOK,WAAY9B,GACpC+B,EAAeP,EAAAA,QAAGC,UAAOO,YAAaxB,GAE5C,OACEyB,EAAAA,KAAA,MAAA,CAAKlC,UAAWwB,KAAeZ,EAASuB,SAAA,CACrCtB,GACCuB,EAAAA,IAAA,OAAA,CACEpC,UAAW8B,EACXO,MAAO,CACLC,YAAa9B,KACVN,KAITkC,MAAA,OAAA,CAAMpC,UAAW6B,EAASQ,MAAO9B,EAAU4B,SAAGhC,IAC7CkB,GACCe,EAAAA,IAAA,OAAA,CACEpC,UAAWgC,EACXK,MAAO,CACLC,YAAa9B,KACVE"}