@cleartrip/ct-design-typography
Advanced tools
Comparing version 3.12.0 to 3.13.0-SNAPSHORT-cfw.0
@@ -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";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;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,T=void 0===m?"":m,C=r.showInItalics,z=void 0!==C&&C,b=r.width,v=r.lineClamp,D=r.containerClassName,k=void 0===D?"":D,B=r.componentNode,L=r.isDisabled,I=void 0!==L&&L,A=r.css,W=r.styleConfig,N=void 0===W?{}:W,V=e.__rest(r,["children","variant","color","isClickable","isStriked","onClick","className","colorCode","showInItalics","width","lineClamp","containerClassName","componentNode","isDisabled","css","styleConfig"]),R=o.useTheme(),_=c({theme:R,variant:p,color:s,isClickable:f,isStriked:u,colorCode:T,showInItalics:z,lineClamp:v,isDisabled:I}),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=N.className,X=N.css,Z=N.containerClassName,$=N.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:$||A},{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},V,{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";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; | ||
//# 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,H=i.letterSpacing,u=i.css,m=void 0===u?{}:u;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,H=void 0===d?{}:d,u=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},u),H)}({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:H})),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"}(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;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,H=void 0!==d&&d,u=r.isStriked,m=void 0!==u&&u,w=r.onClick,S=void 0===w?function(){}:w,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,I=void 0===L?"":L,A=r.componentNode,W=r.isDisabled,N=void 0!==W&&W,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"]),T=o(),O=s({theme:T,variant:c,color:f,isClickable:H,isStriked:m,colorCode:x,showInItalics:k,lineClamp:B,isDisabled:N}),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=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]}(c);return i(n,t({condition:H,wrap:function(e){return i(a,t({onClick:S,className:ee||I,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,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}; | ||
//# sourceMappingURL=ct-design-typography.browser.esm.js.map |
@@ -79,2 +79,3 @@ 'use strict'; | ||
TypographyColor["PRIMARY2"] = "primary2"; | ||
TypographyColor["SECONDARY2"] = "secondary2"; | ||
})(exports.TypographyColor || (exports.TypographyColor = {})); | ||
@@ -286,2 +287,5 @@ | ||
} | ||
case exports.TypographyColor.SECONDARY2: { | ||
return theme.color.text.secondary2; | ||
} | ||
default: { | ||
@@ -288,0 +292,0 @@ return theme.color.text.primary; |
@@ -72,2 +72,3 @@ import { __rest, __assign } from 'tslib'; | ||
TypographyColor["PRIMARY2"] = "primary2"; | ||
TypographyColor["SECONDARY2"] = "secondary2"; | ||
})(TypographyColor || (TypographyColor = {})); | ||
@@ -279,2 +280,5 @@ | ||
} | ||
case TypographyColor.SECONDARY2: { | ||
return theme.color.text.secondary2; | ||
} | ||
default: { | ||
@@ -281,0 +285,0 @@ return theme.color.text.primary; |
@@ -115,2 +115,3 @@ (function (global, factory) { | ||
TypographyColor["PRIMARY2"] = "primary2"; | ||
TypographyColor["SECONDARY2"] = "secondary2"; | ||
})(exports.TypographyColor || (exports.TypographyColor = {})); | ||
@@ -322,2 +323,5 @@ | ||
} | ||
case exports.TypographyColor.SECONDARY2: { | ||
return theme.color.text.secondary2; | ||
} | ||
default: { | ||
@@ -324,0 +328,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" | undefined; | ||
color?: "disabled" | "link" | "alert" | "heading" | "primary" | "secondary" | "tertiary" | "subheading" | "success" | "warning" | "neutral" | "link2" | "primary2" | "secondary2" | undefined; | ||
isClickable?: boolean | undefined; | ||
@@ -130,0 +130,0 @@ isStriked?: boolean | undefined; |
@@ -41,3 +41,4 @@ import { ReactNode } from 'react'; | ||
LINK2 = "link2", | ||
PRIMARY2 = "primary2" | ||
PRIMARY2 = "primary2", | ||
SECONDARY2 = "secondary2" | ||
} | ||
@@ -44,0 +45,0 @@ export type TypographyColorType = `${TypographyColor}`; |
{ | ||
"name": "@cleartrip/ct-design-typography", | ||
"version": "3.12.0", | ||
"version": "3.13.0-SNAPSHORT-cfw.0", | ||
"description": "", | ||
@@ -18,6 +18,6 @@ "types": "dist/index.d.ts", | ||
"dependencies": { | ||
"@cleartrip/ct-design-types": "3.12.0", | ||
"@cleartrip/ct-design-container": "3.12.0", | ||
"@cleartrip/ct-design-theme": "3.12.0", | ||
"@cleartrip/ct-design-conditional-wrap": "3.12.0" | ||
"@cleartrip/ct-design-types": "3.13.0-SNAPSHORT-cfw.0", | ||
"@cleartrip/ct-design-conditional-wrap": "3.13.0-SNAPSHORT-cfw.0", | ||
"@cleartrip/ct-design-container": "3.13.0-SNAPSHORT-cfw.0", | ||
"@cleartrip/ct-design-theme": "3.13.0-SNAPSHORT-cfw.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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
184082
1902
3
+ Added@cleartrip/ct-design-conditional-wrap@3.13.0-SNAPSHORT-cfw.0(transitive)
+ Added@cleartrip/ct-design-container@3.13.0-SNAPSHORT-cfw.0(transitive)
+ Added@cleartrip/ct-design-theme@3.13.0-SNAPSHORT-cfw.0(transitive)
+ Added@cleartrip/ct-design-tokens@3.13.0-SNAPSHORT-cfw.0(transitive)
+ Added@cleartrip/ct-design-types@3.13.0-SNAPSHORT-cfw.0(transitive)
- Removed@cleartrip/ct-design-conditional-wrap@3.12.0(transitive)
- Removed@cleartrip/ct-design-container@3.12.0(transitive)
- Removed@cleartrip/ct-design-theme@3.12.0(transitive)
- Removed@cleartrip/ct-design-tokens@3.12.0(transitive)
- Removed@cleartrip/ct-design-types@3.12.0(transitive)
Updated@cleartrip/ct-design-conditional-wrap@3.13.0-SNAPSHORT-cfw.0
Updated@cleartrip/ct-design-container@3.13.0-SNAPSHORT-cfw.0