Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@cleartrip/ct-design-typography

Package Overview
Dependencies
Maintainers
0
Versions
163
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cleartrip/ct-design-typography - npm Package Compare versions

Comparing version 3.14.0-SNAPSHORT-mevc.0 to 3.14.0-SNAPSHOT-mevc-common.0

2

dist/ct-design-typography.browser.cjs.js

@@ -1,2 +0,2 @@

"use strict";var e=require("tslib"),t=require("react/jsx-runtime"),o=require("@cleartrip/ct-design-theme"),r=require("styled-components"),i=require("@cleartrip/ct-design-conditional-wrap"),a=require("@cleartrip/ct-design-container");function n(e){return e&&e.__esModule?e:{default:e}}var p,y,s=n(r),h=n(i),g=s.default.div((function(t){var o=t.color,r=t.cursor,i=t.fontSize,a=t.fontWeight,n=t.lineHeight,p=t.textDecoration,y=t.fontStyle,s=t.width,h=t.display,g=t.webkitLineClamp,l=t.webkitBoxOrient,c=t.overflow,f=t.textTransform,d=t.letterSpacing,u=t.css,x=void 0===u?{}:u;return e.__assign(e.__assign({},function(t){var o=t.fontSize,r=t.fontWeight,i=t.lineHeight,a=t.color,n=t.textDecoration,p=t.fontStyle,y=t.width,s=t.display,h=t.webkitLineClamp,g=t.webkitBoxOrient,l=t.overflow,c=t.cursor,f=t.css,d=void 0===f?{}:f,u=e.__rest(t,["fontSize","fontWeight","lineHeight","color","textDecoration","fontStyle","width","display","webkitLineClamp","webkitBoxOrient","overflow","cursor","css"]);return e.__assign(e.__assign({fontSize:o,fontWeight:r,lineHeight:i,color:a,textDecoration:n,fontStyle:p,width:y,display:s,"-webkit-line-clamp":"".concat(h),"-webkit-box-orient":g,overflow:l,cursor:c},u),d)}({color:o,cursor:r,fontSize:i,fontWeight:a,lineHeight:n,textDecoration:p,fontStyle:y,width:s,display:h,webkitLineClamp:g,webkitBoxOrient:l,overflow:c,textTransform:f,letterSpacing:d})),x)}));exports.TypographyVariant=void 0,(p=exports.TypographyVariant||(exports.TypographyVariant={})).HD1="HD1",p.HD2="HD2",p.HD3="HD3",p.HM1="HM1",p.HM2="HM2",p.HM3="HM3",p.HM4="HM4",p.B1="B1",p.B2="B2",p.B3="B3",p.B3CAPS="B3CAPS",p.B4="B4",p.B4CAPS="B4CAPS",p.P1="P1",p.P2="P2",p.P3="P3",p.L1="L1",p.L2="L2",p.L3="L3",p.OVERLINE="OVERLINE",p.TAG="TAG",exports.TypographyColor=void 0,(y=exports.TypographyColor||(exports.TypographyColor={})).PRIMARY="primary",y.SECONDARY="secondary",y.TERTIARY="tertiary",y.HEADING="heading",y.SUBHEADING="subheading",y.SUCCESS="success",y.ALERT="alert",y.WARNING="warning",y.DISABLED="disabled",y.LINK="link",y.NEUTRAL="neutral",y.LINK2="link2",y.PRIMARY2="primary2",y.SECONDARY2="secondary2";var l=function(e,t){switch(t){case exports.TypographyColor.PRIMARY:return e.color.text.primary;case exports.TypographyColor.SECONDARY:return e.color.text.secondary;case exports.TypographyColor.TERTIARY:return e.color.text.tertiary;case exports.TypographyColor.ALERT:return e.color.text.alert;case exports.TypographyColor.DISABLED:return e.color.text.disabled;case exports.TypographyColor.HEADING:return e.color.text.heading;case exports.TypographyColor.LINK:return e.color.text.link;case exports.TypographyColor.SUBHEADING:return e.color.text.subHeading;case exports.TypographyColor.SUCCESS:return e.color.text.success;case exports.TypographyColor.WARNING:return e.color.text.warning;case exports.TypographyColor.NEUTRAL:return e.color.text.neutral;case exports.TypographyColor.LINK2:return e.color.text.link2;case exports.TypographyColor.PRIMARY2:return e.color.text.primary2;case exports.TypographyColor.SECONDARY2:return e.color.text.secondary2;default:return e.color.text.primary}},c=function(t){var o=t.theme,r=t.variant,i=t.color,a=t.isClickable,n=t.isStriked,p=t.colorCode,y=t.showInItalics,s=t.lineClamp,h=t.isDisabled;return e.__assign(e.__assign(e.__assign({},function(e,t){switch(t){case exports.TypographyVariant.HD1:return{fontSize:e.typography.size[48],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[56]};case exports.TypographyVariant.HD2:return{fontSize:e.typography.size[40],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[48]};case exports.TypographyVariant.HD3:return{fontSize:e.typography.size[32],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[40]};case exports.TypographyVariant.HM1:return{fontSize:e.typography.size[24],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[32]};case exports.TypographyVariant.HM2:return{fontSize:e.typography.size[20],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[28]};case exports.TypographyVariant.HM3:return{fontSize:e.typography.size[16],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[24]};case exports.TypographyVariant.HM4:return{fontSize:e.typography.size[14],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[20]};case exports.TypographyVariant.B1:return{fontSize:e.typography.size[16],fontWeight:e.typography.weight.medium,lineHeight:e.typography.lineHeight[24]};case exports.TypographyVariant.B2:return{fontSize:e.typography.size[14],fontWeight:e.typography.weight.medium,lineHeight:e.typography.lineHeight[20]};case exports.TypographyVariant.B3:return{fontSize:e.typography.size[12],fontWeight:e.typography.weight.medium,lineHeight:e.typography.lineHeight[16]};case exports.TypographyVariant.B3CAPS:return{fontSize:e.typography.size[12],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[16],letterSpacing:e.typography.letterSpacing.point4,textTransform:"uppercase"};case exports.TypographyVariant.B4:return{fontSize:e.typography.size[10],fontWeight:e.typography.weight.medium,lineHeight:e.typography.lineHeight[14]};case exports.TypographyVariant.B4CAPS:return{fontSize:e.typography.size[10],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[12],letterSpacing:e.typography.letterSpacing.point4,textTransform:"uppercase"};case exports.TypographyVariant.P1:return{fontSize:e.typography.size[16],fontWeight:e.typography.weight.normal,lineHeight:e.typography.lineHeight[22]};case exports.TypographyVariant.P2:return{fontSize:e.typography.size[14],fontWeight:e.typography.weight.normal,lineHeight:e.typography.lineHeight[20]};case exports.TypographyVariant.P3:return{fontSize:e.typography.size[12],fontWeight:e.typography.weight.normal,lineHeight:e.typography.lineHeight[16]};case exports.TypographyVariant.L1:return{fontSize:e.typography.size[16],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[24]};case exports.TypographyVariant.L2:return{fontSize:e.typography.size[14],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[20]};case exports.TypographyVariant.L3:case exports.TypographyVariant.OVERLINE:return{fontSize:e.typography.size[12],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[16]};case exports.TypographyVariant.TAG:return{fontSize:e.typography.size[10],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[12],letterSpacing:e.typography.letterSpacing.point4};default:return{fontSize:e.typography.size[20],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[28]}}}(o,null!=r?r:exports.TypographyVariant.HM2)),function(e){return e?{display:"-webkit-box",webkitLineClamp:e,webkitBoxOrient:"vertical",overflow:"hidden"}:{}}(s)),{color:p||l(o,null!=i?i:exports.TypographyColor.PRIMARY),textDecoration:n?"line-through":"none",cursor:h?"not-allowed":a?"pointer":"auto",fontStyle:y?"italic":"none"})};exports.Typography=function(r){var i=r.children,n=void 0===i?null:i,p=r.variant,y=r.color,s=void 0===y?exports.TypographyColor.PRIMARY:y,l=r.isClickable,f=void 0!==l&&l,d=r.isStriked,u=void 0!==d&&d,x=r.onClick,H=void 0===x?function(){}:x,S=r.className,w=void 0===S?"":S,m=r.colorCode,C=void 0===m?"":m,T=r.showInItalics,z=void 0!==T&&T,b=r.width,v=r.lineClamp,D=r.containerClassName,k=void 0===D?"":D,B=r.componentNode,L=r.isDisabled,A=void 0!==L&&L,I=r.css,N=r.styleConfig,W=void 0===N?{}:N,R=e.__rest(r,["children","variant","color","isClickable","isStriked","onClick","className","colorCode","showInItalics","width","lineClamp","containerClassName","componentNode","isDisabled","css","styleConfig"]),V=o.useTheme(),_=c({theme:V,variant:p,color:s,isClickable:f,isStriked:u,colorCode:C,showInItalics:z,lineClamp:v,isDisabled:A}),E=_.color,M=_.cursor,P=_.textDecoration,O=_.fontSize,Y=_.fontWeight,G=_.lineHeight,q=_.fontStyle,U=_.display,j=_.webkitLineClamp,K=_.webkitBoxOrient,F=_.overflow,J=e.__rest(_,["color","cursor","textDecoration","fontSize","fontWeight","lineHeight","fontStyle","display","webkitLineClamp","webkitBoxOrient","overflow"]),Q=W.className,X=W.css,Z=W.containerClassName,$=W.containerCss,ee=B||function(e){return{HD1:"h1",HD2:"h2",HD3:"h3",HM1:"h1",HM2:"h2",HM3:"h3",HM4:"h4",B1:"p",B2:"p",B3:"p",B4:"p",P1:"p",P2:"p",P3:"p",L1:"p",L2:"p",L3:"p",OVERLINE:"p"}[e]}(p);return t.jsx(h.default,e.__assign({condition:f,wrap:function(o){return t.jsx(a.Container,e.__assign({onClick:H,className:Z||k,css:$||I},{children:o}))}},{children:t.jsx(g,e.__assign({as:ee,color:E,cursor:M,textDecoration:P,fontSize:O,fontStyle:q,lineHeight:G,fontWeight:Y,className:Q||w,width:b,display:U,webkitLineClamp:j,webkitBoxOrient:K,overflow:F},J,{css:X},R,{children:n}))}))},exports.getTypographyStyles=c;
"use strict";var e=require("tslib"),t=require("react/jsx-runtime"),o=require("@cleartrip/ct-design-theme"),r=require("styled-components"),i=require("@cleartrip/ct-design-conditional-wrap"),a=require("@cleartrip/ct-design-container");function n(e){return e&&e.__esModule?e:{default:e}}var p,y,s=n(r),h=n(i),g=s.default.div((function(t){var o=t.color,r=t.cursor,i=t.fontSize,a=t.fontWeight,n=t.lineHeight,p=t.textDecoration,y=t.fontStyle,s=t.width,h=t.display,g=t.webkitLineClamp,l=t.webkitBoxOrient,c=t.overflow,f=t.textTransform,d=t.letterSpacing,u=t.css,x=void 0===u?{}:u;return e.__assign(e.__assign({},function(t){var o=t.fontSize,r=t.fontWeight,i=t.lineHeight,a=t.color,n=t.textDecoration,p=t.fontStyle,y=t.width,s=t.display,h=t.webkitLineClamp,g=t.webkitBoxOrient,l=t.overflow,c=t.cursor,f=t.css,d=void 0===f?{}:f,u=e.__rest(t,["fontSize","fontWeight","lineHeight","color","textDecoration","fontStyle","width","display","webkitLineClamp","webkitBoxOrient","overflow","cursor","css"]);return e.__assign(e.__assign({fontSize:o,fontWeight:r,lineHeight:i,color:a,textDecoration:n,fontStyle:p,width:y,display:s,"-webkit-line-clamp":"".concat(h),"-webkit-box-orient":g,overflow:l,cursor:c},u),d)}({color:o,cursor:r,fontSize:i,fontWeight:a,lineHeight:n,textDecoration:p,fontStyle:y,width:s,display:h,webkitLineClamp:g,webkitBoxOrient:l,overflow:c,textTransform:f,letterSpacing:d})),x)}));exports.TypographyVariant=void 0,(p=exports.TypographyVariant||(exports.TypographyVariant={})).HD1="HD1",p.HD2="HD2",p.HD3="HD3",p.HM1="HM1",p.HM2="HM2",p.HM3="HM3",p.HM4="HM4",p.B1="B1",p.B2="B2",p.B3="B3",p.B3CAPS="B3CAPS",p.B4="B4",p.B4CAPS="B4CAPS",p.P1="P1",p.P2="P2",p.P3="P3",p.L1="L1",p.L2="L2",p.L3="L3",p.OVERLINE="OVERLINE",p.TAG="TAG",exports.TypographyColor=void 0,(y=exports.TypographyColor||(exports.TypographyColor={})).PRIMARY="primary",y.SECONDARY="secondary",y.TERTIARY="tertiary",y.HEADING="heading",y.SUBHEADING="subheading",y.SUCCESS="success",y.ALERT="alert",y.WARNING="warning",y.DISABLED="disabled",y.LINK="link",y.NEUTRAL="neutral",y.LINK2="link2",y.PRIMARY2="primary2",y.SECONDARY2="secondary2",y.GRAPETINI="grapetini900";var l=function(e,t){switch(t){case exports.TypographyColor.PRIMARY:return e.color.text.primary;case exports.TypographyColor.SECONDARY:return e.color.text.secondary;case exports.TypographyColor.TERTIARY:return e.color.text.tertiary;case exports.TypographyColor.ALERT:return e.color.text.alert;case exports.TypographyColor.DISABLED:return e.color.text.disabled;case exports.TypographyColor.HEADING:return e.color.text.heading;case exports.TypographyColor.LINK:return e.color.text.link;case exports.TypographyColor.SUBHEADING:return e.color.text.subHeading;case exports.TypographyColor.SUCCESS:return e.color.text.success;case exports.TypographyColor.WARNING:return e.color.text.warning;case exports.TypographyColor.NEUTRAL:return e.color.text.neutral;case exports.TypographyColor.LINK2:return e.color.text.link2;case exports.TypographyColor.PRIMARY2:return e.color.text.primary2;case exports.TypographyColor.SECONDARY2:return e.color.text.secondary2;case exports.TypographyColor.GRAPETINI:return e.color.text.grapetini900;default:return e.color.text.primary}},c=function(t){var o=t.theme,r=t.variant,i=t.color,a=t.isClickable,n=t.isStriked,p=t.colorCode,y=t.showInItalics,s=t.lineClamp,h=t.isDisabled;return e.__assign(e.__assign(e.__assign({},function(e,t){switch(t){case exports.TypographyVariant.HD1:return{fontSize:e.typography.size[48],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[56]};case exports.TypographyVariant.HD2:return{fontSize:e.typography.size[40],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[48]};case exports.TypographyVariant.HD3:return{fontSize:e.typography.size[32],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[40]};case exports.TypographyVariant.HM1:return{fontSize:e.typography.size[24],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[32]};case exports.TypographyVariant.HM2:return{fontSize:e.typography.size[20],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[28]};case exports.TypographyVariant.HM3:return{fontSize:e.typography.size[16],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[24]};case exports.TypographyVariant.HM4:return{fontSize:e.typography.size[14],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[20]};case exports.TypographyVariant.B1:return{fontSize:e.typography.size[16],fontWeight:e.typography.weight.medium,lineHeight:e.typography.lineHeight[24]};case exports.TypographyVariant.B2:return{fontSize:e.typography.size[14],fontWeight:e.typography.weight.medium,lineHeight:e.typography.lineHeight[20]};case exports.TypographyVariant.B3:return{fontSize:e.typography.size[12],fontWeight:e.typography.weight.medium,lineHeight:e.typography.lineHeight[16]};case exports.TypographyVariant.B3CAPS:return{fontSize:e.typography.size[12],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[16],letterSpacing:e.typography.letterSpacing.point4,textTransform:"uppercase"};case exports.TypographyVariant.B4:return{fontSize:e.typography.size[10],fontWeight:e.typography.weight.medium,lineHeight:e.typography.lineHeight[14]};case exports.TypographyVariant.B4CAPS:return{fontSize:e.typography.size[10],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[12],letterSpacing:e.typography.letterSpacing.point4,textTransform:"uppercase"};case exports.TypographyVariant.P1:return{fontSize:e.typography.size[16],fontWeight:e.typography.weight.normal,lineHeight:e.typography.lineHeight[22]};case exports.TypographyVariant.P2:return{fontSize:e.typography.size[14],fontWeight:e.typography.weight.normal,lineHeight:e.typography.lineHeight[20]};case exports.TypographyVariant.P3:return{fontSize:e.typography.size[12],fontWeight:e.typography.weight.normal,lineHeight:e.typography.lineHeight[16]};case exports.TypographyVariant.L1:return{fontSize:e.typography.size[16],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[24]};case exports.TypographyVariant.L2:return{fontSize:e.typography.size[14],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[20]};case exports.TypographyVariant.L3:case exports.TypographyVariant.OVERLINE:return{fontSize:e.typography.size[12],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[16]};case exports.TypographyVariant.TAG:return{fontSize:e.typography.size[10],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[12],letterSpacing:e.typography.letterSpacing.point4};default:return{fontSize:e.typography.size[20],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[28]}}}(o,null!=r?r:exports.TypographyVariant.HM2)),function(e){return e?{display:"-webkit-box",webkitLineClamp:e,webkitBoxOrient:"vertical",overflow:"hidden"}:{}}(s)),{color:p||l(o,null!=i?i:exports.TypographyColor.PRIMARY),textDecoration:n?"line-through":"none",cursor:h?"not-allowed":a?"pointer":"auto",fontStyle:y?"italic":"none"})};exports.Typography=function(r){var i=r.children,n=void 0===i?null:i,p=r.variant,y=r.color,s=void 0===y?exports.TypographyColor.PRIMARY:y,l=r.isClickable,f=void 0!==l&&l,d=r.isStriked,u=void 0!==d&&d,x=r.onClick,H=void 0===x?function(){}:x,S=r.className,w=void 0===S?"":S,T=r.colorCode,C=void 0===T?"":T,m=r.showInItalics,z=void 0!==m&&m,b=r.width,v=r.lineClamp,D=r.containerClassName,I=void 0===D?"":D,A=r.componentNode,k=r.isDisabled,B=void 0!==k&&k,L=r.css,N=r.styleConfig,R=void 0===N?{}:N,W=e.__rest(r,["children","variant","color","isClickable","isStriked","onClick","className","colorCode","showInItalics","width","lineClamp","containerClassName","componentNode","isDisabled","css","styleConfig"]),V=o.useTheme(),E=c({theme:V,variant:p,color:s,isClickable:f,isStriked:u,colorCode:C,showInItalics:z,lineClamp:v,isDisabled:B}),_=E.color,P=E.cursor,M=E.textDecoration,O=E.fontSize,Y=E.fontWeight,G=E.lineHeight,q=E.fontStyle,U=E.display,j=E.webkitLineClamp,K=E.webkitBoxOrient,F=E.overflow,J=e.__rest(E,["color","cursor","textDecoration","fontSize","fontWeight","lineHeight","fontStyle","display","webkitLineClamp","webkitBoxOrient","overflow"]),Q=R.className,X=R.css,Z=R.containerClassName,$=R.containerCss,ee=A||function(e){return{HD1:"h1",HD2:"h2",HD3:"h3",HM1:"h1",HM2:"h2",HM3:"h3",HM4:"h4",B1:"p",B2:"p",B3:"p",B4:"p",P1:"p",P2:"p",P3:"p",L1:"p",L2:"p",L3:"p",OVERLINE:"p"}[e]}(p);return t.jsx(h.default,e.__assign({condition:f,wrap:function(o){return t.jsx(a.Container,e.__assign({onClick:H,className:Z||I,css:$||L},{children:o}))}},{children:t.jsx(g,e.__assign({as:ee,color:_,cursor:P,textDecoration:M,fontSize:O,fontStyle:q,lineHeight:G,fontWeight:Y,className:Q||w,width:b,display:U,webkitLineClamp:j,webkitBoxOrient:K,overflow:F},J,{css:X},W,{children:n}))}))},exports.getTypographyStyles=c;
//# sourceMappingURL=ct-design-typography.browser.cjs.js.map

@@ -1,2 +0,2 @@

import{__rest as e,__assign as t}from"tslib";import{jsx as i}from"react/jsx-runtime";import{useTheme as o}from"@cleartrip/ct-design-theme";import r from"styled-components";import n from"@cleartrip/ct-design-conditional-wrap";import{Container as a}from"@cleartrip/ct-design-container";var l,h,p=r.div((function(i){var o=i.color,r=i.cursor,n=i.fontSize,a=i.fontWeight,l=i.lineHeight,h=i.textDecoration,p=i.fontStyle,g=i.width,s=i.display,c=i.webkitLineClamp,y=i.webkitBoxOrient,f=i.overflow,d=i.textTransform,u=i.letterSpacing,H=i.css,m=void 0===H?{}:H;return t(t({},function(i){var o=i.fontSize,r=i.fontWeight,n=i.lineHeight,a=i.color,l=i.textDecoration,h=i.fontStyle,p=i.width,g=i.display,s=i.webkitLineClamp,c=i.webkitBoxOrient,y=i.overflow,f=i.cursor,d=i.css,u=void 0===d?{}:d,H=e(i,["fontSize","fontWeight","lineHeight","color","textDecoration","fontStyle","width","display","webkitLineClamp","webkitBoxOrient","overflow","cursor","css"]);return t(t({fontSize:o,fontWeight:r,lineHeight:n,color:a,textDecoration:l,fontStyle:h,width:p,display:g,"-webkit-line-clamp":"".concat(s),"-webkit-box-orient":c,overflow:y,cursor:f},H),u)}({color:o,cursor:r,fontSize:n,fontWeight:a,lineHeight:l,textDecoration:h,fontStyle:p,width:g,display:s,webkitLineClamp:c,webkitBoxOrient:y,overflow:f,textTransform:d,letterSpacing:u})),m)}));!function(e){e.HD1="HD1",e.HD2="HD2",e.HD3="HD3",e.HM1="HM1",e.HM2="HM2",e.HM3="HM3",e.HM4="HM4",e.B1="B1",e.B2="B2",e.B3="B3",e.B3CAPS="B3CAPS",e.B4="B4",e.B4CAPS="B4CAPS",e.P1="P1",e.P2="P2",e.P3="P3",e.L1="L1",e.L2="L2",e.L3="L3",e.OVERLINE="OVERLINE",e.TAG="TAG"}(l||(l={})),function(e){e.PRIMARY="primary",e.SECONDARY="secondary",e.TERTIARY="tertiary",e.HEADING="heading",e.SUBHEADING="subheading",e.SUCCESS="success",e.ALERT="alert",e.WARNING="warning",e.DISABLED="disabled",e.LINK="link",e.NEUTRAL="neutral",e.LINK2="link2",e.PRIMARY2="primary2",e.SECONDARY2="secondary2"}(h||(h={}));var g=function(e,t){switch(t){case h.PRIMARY:return e.color.text.primary;case h.SECONDARY:return e.color.text.secondary;case h.TERTIARY:return e.color.text.tertiary;case h.ALERT:return e.color.text.alert;case h.DISABLED:return e.color.text.disabled;case h.HEADING:return e.color.text.heading;case h.LINK:return e.color.text.link;case h.SUBHEADING:return e.color.text.subHeading;case h.SUCCESS:return e.color.text.success;case h.WARNING:return e.color.text.warning;case h.NEUTRAL:return e.color.text.neutral;case h.LINK2:return e.color.text.link2;case h.PRIMARY2:return e.color.text.primary2;case h.SECONDARY2:return e.color.text.secondary2;default:return e.color.text.primary}},s=function(e){var i=e.theme,o=e.variant,r=e.color,n=e.isClickable,a=e.isStriked,p=e.colorCode,s=e.showInItalics,c=e.lineClamp,y=e.isDisabled;return t(t(t({},function(e,t){switch(t){case l.HD1:return{fontSize:e.typography.size[48],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[56]};case l.HD2:return{fontSize:e.typography.size[40],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[48]};case l.HD3:return{fontSize:e.typography.size[32],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[40]};case l.HM1:return{fontSize:e.typography.size[24],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[32]};case l.HM2:return{fontSize:e.typography.size[20],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[28]};case l.HM3:return{fontSize:e.typography.size[16],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[24]};case l.HM4:return{fontSize:e.typography.size[14],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[20]};case l.B1:return{fontSize:e.typography.size[16],fontWeight:e.typography.weight.medium,lineHeight:e.typography.lineHeight[24]};case l.B2:return{fontSize:e.typography.size[14],fontWeight:e.typography.weight.medium,lineHeight:e.typography.lineHeight[20]};case l.B3:return{fontSize:e.typography.size[12],fontWeight:e.typography.weight.medium,lineHeight:e.typography.lineHeight[16]};case l.B3CAPS:return{fontSize:e.typography.size[12],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[16],letterSpacing:e.typography.letterSpacing.point4,textTransform:"uppercase"};case l.B4:return{fontSize:e.typography.size[10],fontWeight:e.typography.weight.medium,lineHeight:e.typography.lineHeight[14]};case l.B4CAPS:return{fontSize:e.typography.size[10],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[12],letterSpacing:e.typography.letterSpacing.point4,textTransform:"uppercase"};case l.P1:return{fontSize:e.typography.size[16],fontWeight:e.typography.weight.normal,lineHeight:e.typography.lineHeight[22]};case l.P2:return{fontSize:e.typography.size[14],fontWeight:e.typography.weight.normal,lineHeight:e.typography.lineHeight[20]};case l.P3:return{fontSize:e.typography.size[12],fontWeight:e.typography.weight.normal,lineHeight:e.typography.lineHeight[16]};case l.L1:return{fontSize:e.typography.size[16],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[24]};case l.L2:return{fontSize:e.typography.size[14],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[20]};case l.L3:case l.OVERLINE:return{fontSize:e.typography.size[12],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[16]};case l.TAG:return{fontSize:e.typography.size[10],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[12],letterSpacing:e.typography.letterSpacing.point4};default:return{fontSize:e.typography.size[20],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[28]}}}(i,null!=o?o:l.HM2)),function(e){return e?{display:"-webkit-box",webkitLineClamp:e,webkitBoxOrient:"vertical",overflow:"hidden"}:{}}(c)),{color:p||g(i,null!=r?r:h.PRIMARY),textDecoration:a?"line-through":"none",cursor:y?"not-allowed":n?"pointer":"auto",fontStyle:s?"italic":"none"})},c=function(r){var l=r.children,g=void 0===l?null:l,c=r.variant,y=r.color,f=void 0===y?h.PRIMARY:y,d=r.isClickable,u=void 0!==d&&d,H=r.isStriked,m=void 0!==H&&H,S=r.onClick,w=void 0===S?function(){}:S,z=r.className,b=void 0===z?"":z,C=r.colorCode,x=void 0===C?"":C,D=r.showInItalics,k=void 0!==D&&D,v=r.width,B=r.lineClamp,L=r.containerClassName,A=void 0===L?"":L,I=r.componentNode,N=r.isDisabled,W=void 0!==N&&N,R=r.css,E=r.styleConfig,P=void 0===E?{}:E,M=e(r,["children","variant","color","isClickable","isStriked","onClick","className","colorCode","showInItalics","width","lineClamp","containerClassName","componentNode","isDisabled","css","styleConfig"]),O=o(),T=s({theme:O,variant:c,color:f,isClickable:u,isStriked:m,colorCode:x,showInItalics:k,lineClamp:B,isDisabled:W}),Y=T.color,G=T.cursor,U=T.textDecoration,K=T.fontSize,V=T.fontWeight,j=T.lineHeight,q=T.fontStyle,F=T.display,J=T.webkitLineClamp,Q=T.webkitBoxOrient,X=T.overflow,Z=e(T,["color","cursor","textDecoration","fontSize","fontWeight","lineHeight","fontStyle","display","webkitLineClamp","webkitBoxOrient","overflow"]),$=P.className,_=P.css,ee=P.containerClassName,te=P.containerCss,ie=I||function(e){return{HD1:"h1",HD2:"h2",HD3:"h3",HM1:"h1",HM2:"h2",HM3:"h3",HM4:"h4",B1:"p",B2:"p",B3:"p",B4:"p",P1:"p",P2:"p",P3:"p",L1:"p",L2:"p",L3:"p",OVERLINE:"p"}[e]}(c);return i(n,t({condition:u,wrap:function(e){return i(a,t({onClick:w,className:ee||A,css:te||R},{children:e}))}},{children:i(p,t({as:ie,color:Y,cursor:G,textDecoration:U,fontSize:K,fontStyle:q,lineHeight:j,fontWeight:V,className:$||b,width:v,display:F,webkitLineClamp:J,webkitBoxOrient:Q,overflow:X},Z,{css:_},M,{children:g}))}))};export{c as Typography,h as TypographyColor,l as TypographyVariant,s as getTypographyStyles};
import{__rest as e,__assign as t}from"tslib";import{jsx as i}from"react/jsx-runtime";import{useTheme as o}from"@cleartrip/ct-design-theme";import r from"styled-components";import n from"@cleartrip/ct-design-conditional-wrap";import{Container as a}from"@cleartrip/ct-design-container";var l,p,h=r.div((function(i){var o=i.color,r=i.cursor,n=i.fontSize,a=i.fontWeight,l=i.lineHeight,p=i.textDecoration,h=i.fontStyle,g=i.width,s=i.display,c=i.webkitLineClamp,y=i.webkitBoxOrient,f=i.overflow,d=i.textTransform,u=i.letterSpacing,H=i.css,m=void 0===H?{}:H;return t(t({},function(i){var o=i.fontSize,r=i.fontWeight,n=i.lineHeight,a=i.color,l=i.textDecoration,p=i.fontStyle,h=i.width,g=i.display,s=i.webkitLineClamp,c=i.webkitBoxOrient,y=i.overflow,f=i.cursor,d=i.css,u=void 0===d?{}:d,H=e(i,["fontSize","fontWeight","lineHeight","color","textDecoration","fontStyle","width","display","webkitLineClamp","webkitBoxOrient","overflow","cursor","css"]);return t(t({fontSize:o,fontWeight:r,lineHeight:n,color:a,textDecoration:l,fontStyle:p,width:h,display:g,"-webkit-line-clamp":"".concat(s),"-webkit-box-orient":c,overflow:y,cursor:f},H),u)}({color:o,cursor:r,fontSize:n,fontWeight:a,lineHeight:l,textDecoration:p,fontStyle:h,width:g,display:s,webkitLineClamp:c,webkitBoxOrient:y,overflow:f,textTransform:d,letterSpacing:u})),m)}));!function(e){e.HD1="HD1",e.HD2="HD2",e.HD3="HD3",e.HM1="HM1",e.HM2="HM2",e.HM3="HM3",e.HM4="HM4",e.B1="B1",e.B2="B2",e.B3="B3",e.B3CAPS="B3CAPS",e.B4="B4",e.B4CAPS="B4CAPS",e.P1="P1",e.P2="P2",e.P3="P3",e.L1="L1",e.L2="L2",e.L3="L3",e.OVERLINE="OVERLINE",e.TAG="TAG"}(l||(l={})),function(e){e.PRIMARY="primary",e.SECONDARY="secondary",e.TERTIARY="tertiary",e.HEADING="heading",e.SUBHEADING="subheading",e.SUCCESS="success",e.ALERT="alert",e.WARNING="warning",e.DISABLED="disabled",e.LINK="link",e.NEUTRAL="neutral",e.LINK2="link2",e.PRIMARY2="primary2",e.SECONDARY2="secondary2",e.GRAPETINI="grapetini900"}(p||(p={}));var g=function(e,t){switch(t){case p.PRIMARY:return e.color.text.primary;case p.SECONDARY:return e.color.text.secondary;case p.TERTIARY:return e.color.text.tertiary;case p.ALERT:return e.color.text.alert;case p.DISABLED:return e.color.text.disabled;case p.HEADING:return e.color.text.heading;case p.LINK:return e.color.text.link;case p.SUBHEADING:return e.color.text.subHeading;case p.SUCCESS:return e.color.text.success;case p.WARNING:return e.color.text.warning;case p.NEUTRAL:return e.color.text.neutral;case p.LINK2:return e.color.text.link2;case p.PRIMARY2:return e.color.text.primary2;case p.SECONDARY2:return e.color.text.secondary2;case p.GRAPETINI:return e.color.text.grapetini900;default:return e.color.text.primary}},s=function(e){var i=e.theme,o=e.variant,r=e.color,n=e.isClickable,a=e.isStriked,h=e.colorCode,s=e.showInItalics,c=e.lineClamp,y=e.isDisabled;return t(t(t({},function(e,t){switch(t){case l.HD1:return{fontSize:e.typography.size[48],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[56]};case l.HD2:return{fontSize:e.typography.size[40],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[48]};case l.HD3:return{fontSize:e.typography.size[32],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[40]};case l.HM1:return{fontSize:e.typography.size[24],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[32]};case l.HM2:return{fontSize:e.typography.size[20],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[28]};case l.HM3:return{fontSize:e.typography.size[16],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[24]};case l.HM4:return{fontSize:e.typography.size[14],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[20]};case l.B1:return{fontSize:e.typography.size[16],fontWeight:e.typography.weight.medium,lineHeight:e.typography.lineHeight[24]};case l.B2:return{fontSize:e.typography.size[14],fontWeight:e.typography.weight.medium,lineHeight:e.typography.lineHeight[20]};case l.B3:return{fontSize:e.typography.size[12],fontWeight:e.typography.weight.medium,lineHeight:e.typography.lineHeight[16]};case l.B3CAPS:return{fontSize:e.typography.size[12],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[16],letterSpacing:e.typography.letterSpacing.point4,textTransform:"uppercase"};case l.B4:return{fontSize:e.typography.size[10],fontWeight:e.typography.weight.medium,lineHeight:e.typography.lineHeight[14]};case l.B4CAPS:return{fontSize:e.typography.size[10],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[12],letterSpacing:e.typography.letterSpacing.point4,textTransform:"uppercase"};case l.P1:return{fontSize:e.typography.size[16],fontWeight:e.typography.weight.normal,lineHeight:e.typography.lineHeight[22]};case l.P2:return{fontSize:e.typography.size[14],fontWeight:e.typography.weight.normal,lineHeight:e.typography.lineHeight[20]};case l.P3:return{fontSize:e.typography.size[12],fontWeight:e.typography.weight.normal,lineHeight:e.typography.lineHeight[16]};case l.L1:return{fontSize:e.typography.size[16],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[24]};case l.L2:return{fontSize:e.typography.size[14],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[20]};case l.L3:case l.OVERLINE:return{fontSize:e.typography.size[12],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[16]};case l.TAG:return{fontSize:e.typography.size[10],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[12],letterSpacing:e.typography.letterSpacing.point4};default:return{fontSize:e.typography.size[20],fontWeight:e.typography.weight.semibold,lineHeight:e.typography.lineHeight[28]}}}(i,null!=o?o:l.HM2)),function(e){return e?{display:"-webkit-box",webkitLineClamp:e,webkitBoxOrient:"vertical",overflow:"hidden"}:{}}(c)),{color:h||g(i,null!=r?r:p.PRIMARY),textDecoration:a?"line-through":"none",cursor:y?"not-allowed":n?"pointer":"auto",fontStyle:s?"italic":"none"})},c=function(r){var l=r.children,g=void 0===l?null:l,c=r.variant,y=r.color,f=void 0===y?p.PRIMARY:y,d=r.isClickable,u=void 0!==d&&d,H=r.isStriked,m=void 0!==H&&H,S=r.onClick,w=void 0===S?function(){}:S,z=r.className,b=void 0===z?"":z,C=r.colorCode,x=void 0===C?"":C,D=r.showInItalics,I=void 0!==D&&D,A=r.width,k=r.lineClamp,v=r.containerClassName,B=void 0===v?"":v,L=r.componentNode,N=r.isDisabled,R=void 0!==N&&N,W=r.css,E=r.styleConfig,P=void 0===E?{}:E,M=e(r,["children","variant","color","isClickable","isStriked","onClick","className","colorCode","showInItalics","width","lineClamp","containerClassName","componentNode","isDisabled","css","styleConfig"]),T=o(),O=s({theme:T,variant:c,color:f,isClickable:u,isStriked:m,colorCode:x,showInItalics:I,lineClamp:k,isDisabled:R}),Y=O.color,G=O.cursor,U=O.textDecoration,K=O.fontSize,V=O.fontWeight,j=O.lineHeight,q=O.fontStyle,F=O.display,J=O.webkitLineClamp,Q=O.webkitBoxOrient,X=O.overflow,Z=e(O,["color","cursor","textDecoration","fontSize","fontWeight","lineHeight","fontStyle","display","webkitLineClamp","webkitBoxOrient","overflow"]),$=P.className,_=P.css,ee=P.containerClassName,te=P.containerCss,ie=L||function(e){return{HD1:"h1",HD2:"h2",HD3:"h3",HM1:"h1",HM2:"h2",HM3:"h3",HM4:"h4",B1:"p",B2:"p",B3:"p",B4:"p",P1:"p",P2:"p",P3:"p",L1:"p",L2:"p",L3:"p",OVERLINE:"p"}[e]}(c);return i(n,t({condition:u,wrap:function(e){return i(a,t({onClick:w,className:ee||B,css:te||W},{children:e}))}},{children:i(h,t({as:ie,color:Y,cursor:G,textDecoration:U,fontSize:K,fontStyle:q,lineHeight:j,fontWeight:V,className:$||b,width:A,display:F,webkitLineClamp:J,webkitBoxOrient:Q,overflow:X},Z,{css:_},M,{children:g}))}))};export{c as Typography,p as TypographyColor,l as TypographyVariant,s as getTypographyStyles};
//# sourceMappingURL=ct-design-typography.browser.esm.js.map

@@ -80,2 +80,3 @@ 'use strict';

TypographyColor["SECONDARY2"] = "secondary2";
TypographyColor["GRAPETINI"] = "grapetini900";
})(exports.TypographyColor || (exports.TypographyColor = {}));

@@ -290,2 +291,5 @@

}
case exports.TypographyColor.GRAPETINI: {
return theme.color.text.grapetini900;
}
default: {

@@ -292,0 +296,0 @@ return theme.color.text.primary;

@@ -73,2 +73,3 @@ import { __rest, __assign } from 'tslib';

TypographyColor["SECONDARY2"] = "secondary2";
TypographyColor["GRAPETINI"] = "grapetini900";
})(TypographyColor || (TypographyColor = {}));

@@ -283,2 +284,5 @@

}
case TypographyColor.GRAPETINI: {
return theme.color.text.grapetini900;
}
default: {

@@ -285,0 +289,0 @@ return theme.color.text.primary;

@@ -116,2 +116,3 @@ (function (global, factory) {

TypographyColor["SECONDARY2"] = "secondary2";
TypographyColor["GRAPETINI"] = "grapetini900";
})(exports.TypographyColor || (exports.TypographyColor = {}));

@@ -326,2 +327,5 @@

}
case exports.TypographyColor.GRAPETINI: {
return theme.color.text.grapetini900;
}
default: {

@@ -328,0 +332,0 @@ return theme.color.text.primary;

@@ -127,3 +127,3 @@ import type { Theme } from '@cleartrip/ct-design-theme';

variant?: "HD1" | "HD2" | "HD3" | "HM1" | "HM2" | "HM3" | "HM4" | "B1" | "B2" | "B3" | "B3CAPS" | "B4" | "B4CAPS" | "P1" | "P2" | "P3" | "L1" | "L2" | "L3" | "OVERLINE" | "TAG" | undefined;
color?: "disabled" | "link" | "alert" | "heading" | "primary" | "secondary" | "tertiary" | "subheading" | "success" | "warning" | "neutral" | "link2" | "primary2" | "secondary2" | undefined;
color?: "disabled" | "link" | "alert" | "heading" | "primary" | "secondary" | "tertiary" | "subheading" | "success" | "warning" | "neutral" | "link2" | "primary2" | "secondary2" | "grapetini900" | undefined;
isClickable?: boolean | undefined;

@@ -130,0 +130,0 @@ isStriked?: boolean | undefined;

@@ -42,3 +42,4 @@ import { ReactNode } from 'react';

PRIMARY2 = "primary2",
SECONDARY2 = "secondary2"
SECONDARY2 = "secondary2",
GRAPETINI = "grapetini900"
}

@@ -45,0 +46,0 @@ export type TypographyColorType = `${TypographyColor}`;

{
"name": "@cleartrip/ct-design-typography",
"version": "3.14.0-SNAPSHORT-mevc.0",
"version": "3.14.0-SNAPSHOT-mevc-common.0",
"description": "",

@@ -18,6 +18,6 @@ "types": "dist/index.d.ts",

"dependencies": {
"@cleartrip/ct-design-theme": "3.14.0-SNAPSHORT-mevc.0",
"@cleartrip/ct-design-container": "3.14.0-SNAPSHORT-mevc.0",
"@cleartrip/ct-design-types": "3.14.0-SNAPSHORT-mevc.0",
"@cleartrip/ct-design-conditional-wrap": "3.14.0-SNAPSHORT-mevc.0"
"@cleartrip/ct-design-types": "3.13.1-SNAPSHOT-mevc-common.0",
"@cleartrip/ct-design-theme": "3.14.0-SNAPSHOT-mevc-common.0",
"@cleartrip/ct-design-conditional-wrap": "3.13.0",
"@cleartrip/ct-design-container": "3.13.0"
},

@@ -24,0 +24,0 @@ "devDependencies": {},

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc