@leafygreen-ui/typography
Advanced tools
Comparing version 16.3.0 to 16.4.0
# @leafygreen-ui/typography | ||
## 16.4.0 | ||
### Minor Changes | ||
- 9bcf8b925: Exports `OverlineProps` and `SubtitleProps` | ||
### Patch Changes | ||
- 73cbbd02c: Uses fontWeight token from `@leafygreen-ui/tokens` | ||
- Updated dependencies [73cbbd02c] | ||
- Updated dependencies [83fc5b31b] | ||
- Updated dependencies [8ece56980] | ||
- @leafygreen-ui/tokens@2.1.0 | ||
- @leafygreen-ui/icon@11.14.0 | ||
## 16.3.0 | ||
@@ -4,0 +19,0 @@ |
@@ -1,2 +0,2 @@ | ||
import e,{useState as n,useEffect as t,useMemo as r}from"react";import{css as a,cx as o}from"@leafygreen-ui/emotion";import{useBaseFontSize as i,useDarkMode as l}from"@leafygreen-ui/leafygreen-provider";import{Polymorphic as s,usePolymorphic as d,InferredPolymorphic as c,useInferredPolymorphic as h,Polymorph as m}from"@leafygreen-ui/polymorphic";import{Theme as f,createUniqueClassName as g,getNodeTextContent as p}from"@leafygreen-ui/lib";import{palette as u}from"@leafygreen-ui/palette";import{fontFamilies as b,typeScales as y,BaseFontSize as v,focusRing as x}from"@leafygreen-ui/tokens";import k from"prop-types";import N from"@leafygreen-ui/icon/dist/ArrowRight";import w from"@leafygreen-ui/icon/dist/OpenNewTab";function z(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function F(){return F=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},F.apply(this,arguments)}function D(e,n){if(null==e)return{};var t,r,a=function(e,n){if(null==e)return{};var t,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)t=o[r],n.indexOf(t)>=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)t=o[r],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}function E(e,n){return n||(n=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))}function S(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==t)return;var r,a,o=[],i=!0,l=!1;try{for(t=t.call(e);!(i=(r=t.next()).done)&&(o.push(r.value),!n||o.length!==n);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==t.return||t.return()}finally{if(l)throw a}}return o}(e,n)||function(e,n){if(!e)return;if("string"==typeof e)return M(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return M(e,n)}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function M(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}var O,L,B,C,j,H,A,I,P,W,T,U,_,R,K,$,q,G,J,Q,V,X=a(O||(O=E(["\n margin: unset;\n font-family: ",";\n color: ",";\n"])),b.default,u.black),Y=(z(C={},v.Body1,a(L||(L=E(["\n font-size: ","px;\n line-height: ","px;\n "])),y.body1.fontSize,y.body1.lineHeight)),z(C,v.Body2,a(B||(B=E(["\n font-size: ","px;\n line-height: ","px;\n "])),y.body2.fontSize,y.body2.lineHeight)),C),Z=(z(A={},v.Body1,a(j||(j=E(["\n font-size: ","px;\n line-height: ","px;\n "])),y.code1.fontSize,y.code1.lineHeight)),z(A,v.Body2,a(H||(H=E(["\n font-size: ","px;\n line-height: ","px;\n "])),y.code2.fontSize,y.code2.lineHeight)),A),ee=(z(W={},f.Light,a(I||(I=E(["\n color: ",";\n "])),u.black)),z(W,f.Dark,a(P||(P=E(["\n color: ",";\n "])),u.gray.light2)),W),ne=function(e){var n=i();return e?16===e?v.Body2:v.Body1:16===n?v.Body2:v.Body1},te=["baseFontSize","darkMode","className","weight","as"],re={default:{regular:400,medium:500},strong:{regular:700,medium:700}},ae=s((function(n){var t=n.baseFontSize,r=n.darkMode,i=n.className,s=n.weight,c=void 0===s?"regular":s,h=n.as,m=void 0===h?"p":h,f=D(n,te),g=l(r).theme,p=ne(t),u=d(m).Component,b=a(T||(T=E(["\n font-weight: ",";\n strong,\n b {\n font-weight: ",";\n }\n "])),re.default[c],re.strong[c]);return e.createElement(u,F({className:o(X,Y[p],ee[g],b,i)},f))}));ae.displayName="Body";var oe,ie,le,se,de=a(U||(U=E(["\n font-family: ",";\n font-weight: normal;\n margin-top: 0;\n margin-bottom: 0;\n"])),b.default),ce=(z(K={},f.Light,a(_||(_=E(["\n color: ",";\n "])),u.gray.dark1)),z(K,f.Dark,a(R||(R=E(["\n color: ",";\n "])),u.gray.light1)),K),he=(z(G={},f.Light,a($||($=E(["\n color: ",";\n "])),u.gray.dark1)),z(G,f.Dark,a(q||(q=E(["\n color: ",";\n "])),u.gray.base)),G),me=(z(V={},v.Body1,a(J||(J=E(["\n font-size: ","px;\n line-height: ","px;\n "])),y.body1.fontSize,y.body1.lineHeight)),z(V,v.Body2,a(Q||(Q=E(["\n font-size: ","px;\n line-height: 20px; // Hardcoding because it does not match body2 lineHeight\n "])),y.body2.fontSize)),V),fe=["baseFontSize","darkMode","disabled","children","className"],ge=function(n){var t=n.baseFontSize,r=n.darkMode,a=n.disabled,i=void 0!==a&&a,s=n.children,d=n.className,c=D(n,fe),h=l(r).theme,m=ne(t);return e.createElement("p",F({className:o(de,ce[h],me[m],z({},he[h],i),d)},c),s)};ge.displayName="Description";var pe,ue,be,ye,ve=(z(le={},f.Light,a(oe||(oe=E(["\n color: ",";\n "])),u.gray.dark1)),z(le,f.Dark,a(ie||(ie=E(["\n color: ",";\n "])),u.gray.light1)),le),xe=a(se||(se=E(["\n display: block;\n font-size: 11px;\n line-height: 16px;\n letter-spacing: 0.2px;\n"]))),ke=["darkMode","children","className"];function Ne(n){var t=n.darkMode,r=n.children,a=n.className,i=D(n,ke),s=l(t).theme;return e.createElement("small",F({},i,{className:o(X,xe,ve[s],a)}),r)}Ne.displayName="Disclaimer";var we,ze,Fe,De,Ee,Se,Me,Oe,Le=a(pe||(pe=E(["\n font-family: ",";\n font-weight: normal;\n font-size: inherit;\n line-height: inherit;\n\n // Unsets browser default margins\n margin-block-start: 0;\n margin-block-end: 0;\n"])),b.default),Be=(z(ye={},f.Light,a(ue||(ue=E(["\n color: ",";\n "])),u.red.base)),z(ye,f.Dark,a(be||(be=E(["\n color: ",";\n "])),u.red.light1)),ye),Ce=["as","darkMode","children","className"],je=s((function(n){var t=n.as,r=void 0===t?"p":t,a=n.darkMode,i=n.children,s=n.className,c=D(n,Ce),h=l(a).theme,m=d(r).Component;return e.createElement(m,F({},c,{className:o(Le,Be[h],s)}),i)})),He=a(we||(we=E(["\n font-weight: 400;\n font-size: 48px;\n line-height: 62px;\n font-family: ",";\n"])),b.serif),Ae=(z(De={},f.Light,a(ze||(ze=E(["\n color: ",";\n "])),u.green.dark2)),z(De,f.Dark,a(Fe||(Fe=E(["\n color: ",";\n "])),u.green.light1)),De),Ie=["darkMode","className","as"],Pe=s((function(n){var t=n.darkMode,r=n.className,a=n.as,i=void 0===a?"h1":a,s=D(n,Ie),c=l(t).theme,h=d(i).Component;return e.createElement(h,F({className:o(X,He,Ae[c],r)},s))}));Pe.displayName="H1";var We,Te=a(Ee||(Ee=E(["\n font-size: 32px;\n line-height: 40px;\n font-weight: 400;\n font-family: ",";\n"])),b.serif),Ue=(z(Oe={},f.Light,a(Se||(Se=E(["\n color: ",";\n "])),u.green.dark2)),z(Oe,f.Dark,a(Me||(Me=E(["\n color: ",";\n "])),u.green.light1)),Oe),_e=["darkMode","className","as"],Re=s((function(n){var t=n.darkMode,r=n.className,a=n.as,i=void 0===a?"h2":a,s=D(n,_e),c=l(t).theme,h=d(i).Component;return e.createElement(h,F({className:o(X,Te,Ue[c],r)},s))}));Re.displayName="H2";var Ke,$e,qe,Ge,Je,Qe,Ve,Xe,Ye,Ze,en,nn,tn,rn=a(We||(We=E(["\n font-size: 24px;\n line-height: 32px;\n font-weight: 500;\n"]))),an=["darkMode","className","as"],on=s((function(n){var t=n.darkMode,r=n.className,a=n.as,i=void 0===a?"h3":a,s=D(n,an),c=l(t).theme,h=d(i).Component;return e.createElement(h,F({className:o(X,rn,ee[c],r)},s))}));on.displayName="H3";var ln,sn,dn,cn,hn=g(),mn=a(Ke||(Ke=E(["\n display: inline;\n transition: all 0.15s ease-in-out;\n border-radius: 3px;\n font-family: ",";\n line-height: 20px;\n\n .",":hover > & {\n text-decoration: none;\n }\n"])),b.code,hn),fn=(z(Ge={},f.Light,a($e||($e=E(["\n background-color: ",";\n border: 1px solid ",";\n color: ",";\n\n .",":hover > & {\n box-shadow: 0 0 0 3px ",";\n border: 1px solid ",";\n }\n "])),u.gray.light3,u.gray.light2,u.gray.dark3,hn,u.gray.light2,u.gray.light1)),z(Ge,f.Dark,a(qe||(qe=E(["\n background-color: transparent;\n border: 1px solid ",";\n color: ",";\n\n .",":hover > & {\n box-shadow: 0 0 0 3px ",";\n border: 1px solid ",";\n }\n "])),u.gray.dark2,u.gray.light1,hn,u.gray.dark2,u.gray.dark1)),Ge),gn=(z(Ve={},f.Light,a(Je||(Je=E(["\n .",":focus-visible > & {\n box-shadow: ",";\n border: 1px solid ",";\n }\n "])),hn,x[f.Light].default,u.blue.base)),z(Ve,f.Dark,a(Qe||(Qe=E(["\n .",":focus-visible > & {\n box-shadow: ",";\n border: 1px solid ",";\n }\n "])),hn,x[f.Dark].default,u.blue.base)),Ve),pn=(z(Ze={},f.Light,a(Xe||(Xe=E(["\n color: ",";\n "])),u.blue.base)),z(Ze,f.Dark,a(Ye||(Ye=E(["\n color: ",";\n "])),u.blue.light1)),Ze),un=a(en||(en=E(["\n text-decoration: none;\n margin: 0;\n padding: 0;\n line-height: 20px;\n\n &:focus {\n outline: none;\n }\n"]))),bn=a(nn||(nn=E(["\n white-space: nowrap;\n"]))),yn=a(tn||(tn=E(["\n white-space: normal;\n"]))),vn=["children","className","darkMode","baseFontSize","as"],xn=c((function(n,t){var r,a,i=n.children,s=n.className,d=n.darkMode,c=n.baseFontSize,m=n.as,f=D(n,vn),g=l(d).theme,p=ne(c),u=h(m,f,"code").Component,b=(null!==(r="string"==typeof i&&(null===(a=i.match(/(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g))||void 0===a?void 0:a.length))&&void 0!==r?r:0)<=30?bn:yn,y="code"!==u,v=e.createElement("code",{ref:t,className:o(Z[p],mn,fn[g],gn[g],b,z({},pn[g],y),s)},i);return y?e.createElement(u,F({className:o(hn,un,s)},f),v):e.cloneElement(v,f)}));xn.displayName="InlineCode",xn.propTypes={children:k.node,className:k.string,darkMode:k.bool,baseFontSize:k.oneOf(Object.values(v))};var kn,Nn,wn,zn,Fn,Dn,En,Sn,Mn,On,Ln=a(ln||(ln=E(["\n font-family: ",";\n border: 1px solid;\n border-radius: 3px;\n padding-left: 5px;\n padding-right: 5px;\n"])),b.code),Bn=(z(cn={},f.Light,a(sn||(sn=E(["\n color: ",";\n border-color: ",";\n background-color: ",";\n "])),u.black,u.gray.dark3,u.white)),z(cn,f.Dark,a(dn||(dn=E(["\n color: ",";\n border-color: ",";\n background-color: ",";\n "])),u.gray.light2,u.gray.base,u.gray.dark3)),cn),Cn=["baseFontSize","darkMode","children","className"];function jn(n){var t=n.baseFontSize,r=n.darkMode,a=n.children,i=n.className,s=D(n,Cn),d=ne(t),c=l(r).theme;return e.createElement("code",F({className:o(Ln,Bn[c],Z[d],i)},s),a)}jn.displayName="InlineKeyCode";var Hn,An,In,Pn,Wn,Tn,Un,_n,Rn,Kn,$n,qn,Gn=a(kn||(kn=E(["\n font-family: ",";\n font-weight: bold;\n"])),b.default),Jn=(z(zn={},f.Light,a(Nn||(Nn=E(["\n color: ",";\n "])),u.black)),z(zn,f.Dark,a(wn||(wn=E(["\n color: ",";\n "])),u.gray.light2)),zn),Qn=(z(En={},f.Light,a(Fn||(Fn=E(["\n color: ",";\n "])),u.gray.dark1)),z(En,f.Dark,a(Dn||(Dn=E(["\n color: ",";\n "])),u.gray.base)),En),Vn=(z(On={},v.Body1,a(Sn||(Sn=E(["\n font-size: ","px;\n line-height: ","px;\n "])),y.body1.fontSize,y.body1.lineHeight)),z(On,v.Body2,a(Mn||(Mn=E(["\n font-size: ","px;\n line-height: 20px; // Hardcoding because it does not match body2 lineHeight\n "])),y.body2.fontSize)),On),Xn=["baseFontSize","darkMode","className","children","disabled","as"],Yn=s((function(n){var t=n.baseFontSize,r=n.darkMode,a=n.className,i=n.children,s=n.disabled,c=void 0!==s&&s,h=n.as,m=void 0===h?"label":h,f=D(n,Xn),g=l(r).theme,p=ne(t),u=d(m).Component;return e.createElement(u,F({className:o(Gn,Jn[g],Vn[p],z({},Qn[g],c),a)},f),i)}));Yn.displayName="Label";var Zn,et,nt=g(),tt=a(Hn||(Hn=E(["\n &:hover,\n &:focus,\n &:visited {\n text-decoration: none;\n }\n"]))),rt=a(An||(An=E(["\n font-family: ",";\n display: inline-flex;\n align-items: center;\n text-decoration: none;\n cursor: pointer;\n line-height: 13px;\n\n &:focus {\n outline: none;\n }\n"])),b.default),at=(z(Wn={},f.Light,a(In||(In=E(["\n color: ",";\n font-weight: 400;\n "])),u.blue.base)),z(Wn,f.Dark,a(Pn||(Pn=E(["\n color: ",";\n font-weight: 700;\n "])),u.blue.light1)),Wn),ot=a(Tn||(Tn=E(["\n position: relative;\n &::after {\n content: '';\n position: absolute;\n width: 100%;\n height: 2px;\n bottom: -4px;\n left: 0;\n border-radius: 2px;\n }\n\n .",":focus & {\n &::after {\n background-color: ",";\n }\n }\n"])),nt,u.blue.light1),it=(z(Rn={},f.Light,a(Un||(Un=E(["\n .",":hover & {\n &::after {\n background-color: ",";\n }\n }\n "])),nt,u.gray.light2)),z(Rn,f.Dark,a(_n||(_n=E(["\n .",":hover & {\n &::after {\n background-color: ",";\n }\n }\n "])),nt,u.gray.dark2)),Rn),lt=a(Kn||(Kn=E(["\n transform: translate3d(3px, 0, 0);\n"]))),st=a($n||($n=E(["\n opacity: 0;\n transform: translate3d(-3px, 0, 0);\n transition: all 100ms ease-in;\n\n .",":hover & {\n opacity: 1;\n transform: translate3d(3px, 0, 0);\n }\n"])),nt),dt=a(qn||(qn=E(["\n position: relative;\n bottom: 4px;\n left: -1px;\n height: 12px;\n"]))),ct="hover",ht="persist",mt="none",ft=["children","className","arrowAppearance","hideExternalIcon","baseFontSize","darkMode","as"],gt=c((function(a){var i=a.children,s=a.className,d=a.arrowAppearance,c=void 0===d?mt:d,m=a.hideExternalIcon,f=void 0!==m&&m,g=a.baseFontSize,p=a.darkMode,u=a.as,b=D(a,ft),y=S(n(""),2),v=y[0],x=y[1];t((function(){x(window.location.hostname)}),[]);var k,E=l(p).theme,M=ne(g),O=h(u,b,"span").Component,L=r((function(){if(void 0!==b.href){return/^http(s)?:\/\//.test(b.href)?new URL(b.href).hostname:v}}),[b,v]),B={target:void 0,rel:void 0};if(b.target||b.rel?(B.target=b.target,B.rel=b.rel):"a"===O&&(L===v?B.target="_self":(B.target="_blank",B.rel="noopener noreferrer")),"_blank"!==B.target||f){if(c!==mt){var C;k=e.createElement(N,{role:"presentation",size:12,className:o((C={},z(C,st,c===ct),z(C,lt,c===ht),C))})}}else k=e.createElement(w,{role:"presentation",className:dt});return e.createElement(O,F({className:o(nt,tt,Y[M],rt,at[E],s)},B,b),e.createElement("span",{className:o(ot,it[E])},i),k)})),pt=a(Zn||(Zn=E(["\n font-size: 12px;\n font-weight: 700;\n text-transform: uppercase;\n line-height: 20px;\n letter-spacing: 0.4px;\n"]))),ut=["darkMode","className","as"],bt=s((function(n){var t=n.darkMode,r=n.className,a=n.as,i=void 0===a?"div":a,s=D(n,ut),c=l(t).theme,h=d(i).Component;return e.createElement(h,F({className:o(X,pt,ee[c],r)},s))}));bt.displayName="Overline";var yt=a(et||(et=E(["\n font-size: 18px;\n line-height: 24px;\n font-weight: 700;\n"]))),vt=["darkMode","className","as"],xt=s((function(n){var t=n.darkMode,r=n.className,a=n.as,i=void 0===a?"h6":a,s=D(n,vt),c=l(t).theme,h=d(i).Component;return e.createElement(h,F({className:o(X,yt,ee[c],r)},s))}));xt.displayName="Subtitle";var kt,Nt,wt=["as","children","maxFontWeight","pseudoElement","className"],zt=function(e){var n=e.pseudoElement,t=e.maxFontWeight,r="&:".concat(n);return a(kt||(kt=E(["\n /* Inherit relevant properties from the parent */\n font-weight: inherit;\n font-size: inherit;\n\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n\n position: relative;\n display: inline-flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n text-decoration: none;\n min-width: 0;\n max-width: 100%;\n\n "," {\n content: attr(data-text);\n height: 0;\n font-weight: ",";\n visibility: hidden;\n overflow: hidden;\n user-select: none;\n pointer-events: none;\n }\n "])),r,t)},Ft=a(Nt||(Nt=E(["\n flex: 1;\n min-width: 0;\n max-width: 100%;\n\n white-space: inherit;\n overflow: inherit;\n text-overflow: inherit;\n"])));function Dt(n){var t=n.as,r=n.children,a=n.maxFontWeight,i=void 0===a?700:a,l=n.pseudoElement,s=void 0===l?"after":l,d=n.className,c=D(n,wt),h=p(r);return e.createElement(m,F({className:o(zt({pseudoElement:s,maxFontWeight:i}),d),as:null!=t?t:"span","data-text":h},c),e.createElement("span",{className:Ft},r))}export{ae as Body,ge as Description,Ne as Disclaimer,je as Error,Pe as H1,Re as H2,on as H3,xn as InlineCode,jn as InlineKeyCode,Yn as Label,gt as Link,bt as Overline,Dt as StaticWidthText,xt as Subtitle,nt as anchorClassName,Y as bodyTypeScaleStyles,Vn as labelTypeScaleStyles,ne as useUpdatedBaseFontSize}; | ||
import e,{useState as n,useEffect as t,useMemo as r}from"react";import{css as a,cx as o}from"@leafygreen-ui/emotion";import{useBaseFontSize as i,useDarkMode as l}from"@leafygreen-ui/leafygreen-provider";import{Polymorphic as s,usePolymorphic as d,InferredPolymorphic as c,useInferredPolymorphic as h,Polymorph as m}from"@leafygreen-ui/polymorphic";import{fontFamilies as f,typeScales as g,BaseFontSize as p,fontWeights as u,focusRing as b}from"@leafygreen-ui/tokens";import{Theme as y,createUniqueClassName as v,getNodeTextContent as x}from"@leafygreen-ui/lib";import{palette as k}from"@leafygreen-ui/palette";import N from"prop-types";import w from"@leafygreen-ui/icon/dist/ArrowRight";import z from"@leafygreen-ui/icon/dist/OpenNewTab";function F(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function D(){return D=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},D.apply(this,arguments)}function E(e,n){if(null==e)return{};var t,r,a=function(e,n){if(null==e)return{};var t,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)t=o[r],n.indexOf(t)>=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)t=o[r],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}function S(e,n){return n||(n=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))}function M(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==t)return;var r,a,o=[],i=!0,l=!1;try{for(t=t.call(e);!(i=(r=t.next()).done)&&(o.push(r.value),!n||o.length!==n);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==t.return||t.return()}finally{if(l)throw a}}return o}(e,n)||function(e,n){if(!e)return;if("string"==typeof e)return O(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return O(e,n)}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function O(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}var L,B,C,j,H,A,I,P,W,T,U,_,R,K,$,q,G,J,Q,V,X,Y=a(L||(L=S(["\n margin: unset;\n font-family: ",";\n color: ",";\n"])),f.default,k.black),Z=(F(j={},p.Body1,a(B||(B=S(["\n font-size: ","px;\n line-height: ","px;\n "])),g.body1.fontSize,g.body1.lineHeight)),F(j,p.Body2,a(C||(C=S(["\n font-size: ","px;\n line-height: ","px;\n "])),g.body2.fontSize,g.body2.lineHeight)),j),ee=(F(I={},p.Body1,a(H||(H=S(["\n font-size: ","px;\n line-height: ","px;\n "])),g.code1.fontSize,g.code1.lineHeight)),F(I,p.Body2,a(A||(A=S(["\n font-size: ","px;\n line-height: ","px;\n "])),g.code2.fontSize,g.code2.lineHeight)),I),ne=(F(T={},y.Light,a(P||(P=S(["\n color: ",";\n "])),k.black)),F(T,y.Dark,a(W||(W=S(["\n color: ",";\n "])),k.gray.light2)),T),te=function(e){var n=i();return e?16===e?p.Body2:p.Body1:16===n?p.Body2:p.Body1},re=["baseFontSize","darkMode","className","weight","as"],ae=s((function(n){var t=n.baseFontSize,r=n.darkMode,i=n.className,s=n.weight,c=void 0===s?"regular":s,h=n.as,m=void 0===h?"p":h,f=E(n,re),g=l(r).theme,p=te(t),b=d(m).Component,y=a(U||(U=S(["\n font-weight: ",";\n strong,\n b {\n font-weight: ",";\n }\n "])),u[c],u.bold);return e.createElement(b,D({className:o(Y,Z[p],ne[g],y,i)},f))}));ae.displayName="Body";var oe,ie,le,se,de=a(_||(_=S(["\n font-family: ",";\n font-weight: ",";\n margin-top: 0;\n margin-bottom: 0;\n"])),f.default,u.regular),ce=(F($={},y.Light,a(R||(R=S(["\n color: ",";\n "])),k.gray.dark1)),F($,y.Dark,a(K||(K=S(["\n color: ",";\n "])),k.gray.light1)),$),he=(F(J={},y.Light,a(q||(q=S(["\n color: ",";\n "])),k.gray.dark1)),F(J,y.Dark,a(G||(G=S(["\n color: ",";\n "])),k.gray.base)),J),me=(F(X={},p.Body1,a(Q||(Q=S(["\n font-size: ","px;\n line-height: ","px;\n "])),g.body1.fontSize,g.body1.lineHeight)),F(X,p.Body2,a(V||(V=S(["\n font-size: ","px;\n line-height: 20px; // Hardcoding because it does not match body2 lineHeight\n "])),g.body2.fontSize)),X),fe=["baseFontSize","darkMode","disabled","children","className"],ge=function(n){var t=n.baseFontSize,r=n.darkMode,a=n.disabled,i=void 0!==a&&a,s=n.children,d=n.className,c=E(n,fe),h=l(r).theme,m=te(t);return e.createElement("p",D({className:o(de,ce[h],me[m],F({},he[h],i),d)},c),s)};ge.displayName="Description";var pe,ue,be,ye,ve=(F(le={},y.Light,a(oe||(oe=S(["\n color: ",";\n "])),k.gray.dark1)),F(le,y.Dark,a(ie||(ie=S(["\n color: ",";\n "])),k.gray.light1)),le),xe=a(se||(se=S(["\n display: block;\n font-size: 11px;\n line-height: 16px;\n letter-spacing: 0.2px;\n"]))),ke=["darkMode","children","className"];function Ne(n){var t=n.darkMode,r=n.children,a=n.className,i=E(n,ke),s=l(t).theme;return e.createElement("small",D({},i,{className:o(Y,xe,ve[s],a)}),r)}Ne.displayName="Disclaimer";var we,ze,Fe,De,Ee,Se,Me,Oe,Le=a(pe||(pe=S(["\n font-family: ",";\n font-weight: ",";\n font-size: inherit;\n line-height: inherit;\n\n // Unsets browser default margins\n margin-block-start: 0;\n margin-block-end: 0;\n"])),f.default,u.regular),Be=(F(ye={},y.Light,a(ue||(ue=S(["\n color: ",";\n "])),k.red.base)),F(ye,y.Dark,a(be||(be=S(["\n color: ",";\n "])),k.red.light1)),ye),Ce=["as","darkMode","children","className"],je=s((function(n){var t=n.as,r=void 0===t?"p":t,a=n.darkMode,i=n.children,s=n.className,c=E(n,Ce),h=l(a).theme,m=d(r).Component;return e.createElement(m,D({},c,{className:o(Le,Be[h],s)}),i)})),He=a(we||(we=S(["\n font-weight: ",";\n font-size: 48px;\n line-height: 62px;\n font-family: ",";\n"])),u.regular,f.serif),Ae=(F(De={},y.Light,a(ze||(ze=S(["\n color: ",";\n "])),k.green.dark2)),F(De,y.Dark,a(Fe||(Fe=S(["\n color: ",";\n "])),k.green.light1)),De),Ie=["darkMode","className","as"],Pe=s((function(n){var t=n.darkMode,r=n.className,a=n.as,i=void 0===a?"h1":a,s=E(n,Ie),c=l(t).theme,h=d(i).Component;return e.createElement(h,D({className:o(Y,He,Ae[c],r)},s))}));Pe.displayName="H1";var We,Te=a(Ee||(Ee=S(["\n font-size: 32px;\n line-height: 40px;\n font-weight: ",";\n font-family: ",";\n"])),u.regular,f.serif),Ue=(F(Oe={},y.Light,a(Se||(Se=S(["\n color: ",";\n "])),k.green.dark2)),F(Oe,y.Dark,a(Me||(Me=S(["\n color: ",";\n "])),k.green.light1)),Oe),_e=["darkMode","className","as"],Re=s((function(n){var t=n.darkMode,r=n.className,a=n.as,i=void 0===a?"h2":a,s=E(n,_e),c=l(t).theme,h=d(i).Component;return e.createElement(h,D({className:o(Y,Te,Ue[c],r)},s))}));Re.displayName="H2";var Ke,$e,qe,Ge,Je,Qe,Ve,Xe,Ye,Ze,en,nn,tn,rn=a(We||(We=S(["\n font-size: 24px;\n line-height: 32px;\n font-weight: ",";\n"])),u.medium),an=["darkMode","className","as"],on=s((function(n){var t=n.darkMode,r=n.className,a=n.as,i=void 0===a?"h3":a,s=E(n,an),c=l(t).theme,h=d(i).Component;return e.createElement(h,D({className:o(Y,rn,ne[c],r)},s))}));on.displayName="H3";var ln,sn,dn,cn,hn=v(),mn=a(Ke||(Ke=S(["\n display: inline;\n transition: all 0.15s ease-in-out;\n border-radius: 3px;\n font-family: ",";\n line-height: 20px;\n\n .",":hover > & {\n text-decoration: none;\n }\n"])),f.code,hn),fn=(F(Ge={},y.Light,a($e||($e=S(["\n background-color: ",";\n border: 1px solid ",";\n color: ",";\n\n .",":hover > & {\n box-shadow: 0 0 0 3px ",";\n border: 1px solid ",";\n }\n "])),k.gray.light3,k.gray.light2,k.gray.dark3,hn,k.gray.light2,k.gray.light1)),F(Ge,y.Dark,a(qe||(qe=S(["\n background-color: transparent;\n border: 1px solid ",";\n color: ",";\n\n .",":hover > & {\n box-shadow: 0 0 0 3px ",";\n border: 1px solid ",";\n }\n "])),k.gray.dark2,k.gray.light1,hn,k.gray.dark2,k.gray.dark1)),Ge),gn=(F(Ve={},y.Light,a(Je||(Je=S(["\n .",":focus-visible > & {\n box-shadow: ",";\n border: 1px solid ",";\n }\n "])),hn,b[y.Light].default,k.blue.base)),F(Ve,y.Dark,a(Qe||(Qe=S(["\n .",":focus-visible > & {\n box-shadow: ",";\n border: 1px solid ",";\n }\n "])),hn,b[y.Dark].default,k.blue.base)),Ve),pn=(F(Ze={},y.Light,a(Xe||(Xe=S(["\n color: ",";\n "])),k.blue.base)),F(Ze,y.Dark,a(Ye||(Ye=S(["\n color: ",";\n "])),k.blue.light1)),Ze),un=a(en||(en=S(["\n text-decoration: none;\n margin: 0;\n padding: 0;\n line-height: 20px;\n\n &:focus {\n outline: none;\n }\n"]))),bn=a(nn||(nn=S(["\n white-space: nowrap;\n"]))),yn=a(tn||(tn=S(["\n white-space: normal;\n"]))),vn=["children","className","darkMode","baseFontSize","as"],xn=c((function(n,t){var r,a,i=n.children,s=n.className,d=n.darkMode,c=n.baseFontSize,m=n.as,f=E(n,vn),g=l(d).theme,p=te(c),u=h(m,f,"code").Component,b=(null!==(r="string"==typeof i&&(null===(a=i.match(/(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g))||void 0===a?void 0:a.length))&&void 0!==r?r:0)<=30?bn:yn,y="code"!==u,v=e.createElement("code",{ref:t,className:o(ee[p],mn,fn[g],gn[g],b,F({},pn[g],y),s)},i);return y?e.createElement(u,D({className:o(hn,un,s)},f),v):e.cloneElement(v,f)}));xn.displayName="InlineCode",xn.propTypes={children:N.node,className:N.string,darkMode:N.bool,baseFontSize:N.oneOf(Object.values(p))};var kn,Nn,wn,zn,Fn,Dn,En,Sn,Mn,On,Ln=a(ln||(ln=S(["\n font-family: ",";\n border: 1px solid;\n border-radius: 3px;\n padding-left: 5px;\n padding-right: 5px;\n"])),f.code),Bn=(F(cn={},y.Light,a(sn||(sn=S(["\n color: ",";\n border-color: ",";\n background-color: ",";\n "])),k.black,k.gray.dark3,k.white)),F(cn,y.Dark,a(dn||(dn=S(["\n color: ",";\n border-color: ",";\n background-color: ",";\n "])),k.gray.light2,k.gray.base,k.gray.dark3)),cn),Cn=["baseFontSize","darkMode","children","className"];function jn(n){var t=n.baseFontSize,r=n.darkMode,a=n.children,i=n.className,s=E(n,Cn),d=te(t),c=l(r).theme;return e.createElement("code",D({className:o(Ln,Bn[c],ee[d],i)},s),a)}jn.displayName="InlineKeyCode";var Hn,An,In,Pn,Wn,Tn,Un,_n,Rn,Kn,$n,qn,Gn=a(kn||(kn=S(["\n font-family: ",";\n font-weight: ",";\n"])),f.default,u.bold),Jn=(F(zn={},y.Light,a(Nn||(Nn=S(["\n color: ",";\n "])),k.black)),F(zn,y.Dark,a(wn||(wn=S(["\n color: ",";\n "])),k.gray.light2)),zn),Qn=(F(En={},y.Light,a(Fn||(Fn=S(["\n color: ",";\n "])),k.gray.dark1)),F(En,y.Dark,a(Dn||(Dn=S(["\n color: ",";\n "])),k.gray.base)),En),Vn=(F(On={},p.Body1,a(Sn||(Sn=S(["\n font-size: ","px;\n line-height: ","px;\n "])),g.body1.fontSize,g.body1.lineHeight)),F(On,p.Body2,a(Mn||(Mn=S(["\n font-size: ","px;\n line-height: 20px; // Hardcoding because it does not match body2 lineHeight\n "])),g.body2.fontSize)),On),Xn=["baseFontSize","darkMode","className","children","disabled","as"],Yn=s((function(n){var t=n.baseFontSize,r=n.darkMode,a=n.className,i=n.children,s=n.disabled,c=void 0!==s&&s,h=n.as,m=void 0===h?"label":h,f=E(n,Xn),g=l(r).theme,p=te(t),u=d(m).Component;return e.createElement(u,D({className:o(Gn,Jn[g],Vn[p],F({},Qn[g],c),a)},f),i)}));Yn.displayName="Label";var Zn,et,nt=v(),tt=a(Hn||(Hn=S(["\n &:hover,\n &:focus,\n &:visited {\n text-decoration: none;\n }\n"]))),rt=a(An||(An=S(["\n font-family: ",";\n display: inline-flex;\n align-items: center;\n text-decoration: none;\n cursor: pointer;\n line-height: 13px;\n\n &:focus {\n outline: none;\n }\n"])),f.default),at=(F(Wn={},y.Light,a(In||(In=S(["\n color: ",";\n font-weight: ",";\n "])),k.blue.base,u.regular)),F(Wn,y.Dark,a(Pn||(Pn=S(["\n color: ",";\n font-weight: ",";\n "])),k.blue.light1,u.bold)),Wn),ot=a(Tn||(Tn=S(["\n position: relative;\n &::after {\n content: '';\n position: absolute;\n width: 100%;\n height: 2px;\n bottom: -4px;\n left: 0;\n border-radius: 2px;\n }\n\n .",":focus & {\n &::after {\n background-color: ",";\n }\n }\n"])),nt,k.blue.light1),it=(F(Rn={},y.Light,a(Un||(Un=S(["\n .",":hover & {\n &::after {\n background-color: ",";\n }\n }\n "])),nt,k.gray.light2)),F(Rn,y.Dark,a(_n||(_n=S(["\n .",":hover & {\n &::after {\n background-color: ",";\n }\n }\n "])),nt,k.gray.dark2)),Rn),lt=a(Kn||(Kn=S(["\n transform: translate3d(3px, 0, 0);\n"]))),st=a($n||($n=S(["\n opacity: 0;\n transform: translate3d(-3px, 0, 0);\n transition: all 100ms ease-in;\n\n .",":hover & {\n opacity: 1;\n transform: translate3d(3px, 0, 0);\n }\n"])),nt),dt=a(qn||(qn=S(["\n position: relative;\n bottom: 4px;\n left: -1px;\n height: 12px;\n"]))),ct="hover",ht="persist",mt="none",ft=["children","className","arrowAppearance","hideExternalIcon","baseFontSize","darkMode","as"],gt=c((function(a){var i=a.children,s=a.className,d=a.arrowAppearance,c=void 0===d?mt:d,m=a.hideExternalIcon,f=void 0!==m&&m,g=a.baseFontSize,p=a.darkMode,u=a.as,b=E(a,ft),y=M(n(""),2),v=y[0],x=y[1];t((function(){x(window.location.hostname)}),[]);var k,N=l(p).theme,S=te(g),O=h(u,b,"span").Component,L=r((function(){if(void 0!==b.href){return/^http(s)?:\/\//.test(b.href)?new URL(b.href).hostname:v}}),[b,v]),B={target:void 0,rel:void 0};if(b.target||b.rel?(B.target=b.target,B.rel=b.rel):"a"===O&&(L===v?B.target="_self":(B.target="_blank",B.rel="noopener noreferrer")),"_blank"!==B.target||f){if(c!==mt){var C;k=e.createElement(w,{role:"presentation",size:12,className:o((C={},F(C,st,c===ct),F(C,lt,c===ht),C))})}}else k=e.createElement(z,{role:"presentation",className:dt});return e.createElement(O,D({className:o(nt,tt,Z[S],rt,at[N],s)},B,b),e.createElement("span",{className:o(ot,it[N])},i),k)})),pt=a(Zn||(Zn=S(["\n font-size: 12px;\n font-weight: ",";\n text-transform: uppercase;\n line-height: 20px;\n letter-spacing: 0.4px;\n"])),u.bold),ut=["darkMode","className","as"],bt=s((function(n){var t=n.darkMode,r=n.className,a=n.as,i=void 0===a?"div":a,s=E(n,ut),c=l(t).theme,h=d(i).Component;return e.createElement(h,D({className:o(Y,pt,ne[c],r)},s))}));bt.displayName="Overline";var yt=a(et||(et=S(["\n font-size: 18px;\n line-height: 24px;\n font-weight: ",";\n"])),u.bold),vt=["darkMode","className","as"],xt=s((function(n){var t=n.darkMode,r=n.className,a=n.as,i=void 0===a?"h6":a,s=E(n,vt),c=l(t).theme,h=d(i).Component;return e.createElement(h,D({className:o(Y,yt,ne[c],r)},s))}));xt.displayName="Subtitle";var kt,Nt,wt=["as","children","maxFontWeight","pseudoElement","className"],zt=function(e){var n=e.pseudoElement,t=e.maxFontWeight,r="&:".concat(n);return a(kt||(kt=S(["\n /* Inherit relevant properties from the parent */\n font-weight: inherit;\n font-size: inherit;\n\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n\n position: relative;\n display: inline-flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n text-decoration: none;\n min-width: 0;\n max-width: 100%;\n\n "," {\n content: attr(data-text);\n height: 0;\n font-weight: ",";\n visibility: hidden;\n overflow: hidden;\n user-select: none;\n pointer-events: none;\n }\n "])),r,t)},Ft=a(Nt||(Nt=S(["\n flex: 1;\n min-width: 0;\n max-width: 100%;\n\n white-space: inherit;\n overflow: inherit;\n text-overflow: inherit;\n"])));function Dt(n){var t=n.as,r=n.children,a=n.maxFontWeight,i=void 0===a?700:a,l=n.pseudoElement,s=void 0===l?"after":l,d=n.className,c=E(n,wt),h=x(r);return e.createElement(m,D({className:o(zt({pseudoElement:s,maxFontWeight:i}),d),as:null!=t?t:"span","data-text":h},c),e.createElement("span",{className:Ft},r))}export{ae as Body,ge as Description,Ne as Disclaimer,je as Error,Pe as H1,Re as H2,on as H3,xn as InlineCode,jn as InlineKeyCode,Yn as Label,gt as Link,bt as Overline,Dt as StaticWidthText,xt as Subtitle,nt as anchorClassName,Z as bodyTypeScaleStyles,Vn as labelTypeScaleStyles,te as useUpdatedBaseFontSize}; | ||
//# sourceMappingURL=index.js.map |
@@ -26,6 +26,8 @@ export { default as Body } from './Body/Body'; | ||
export { default as Overline } from './Overline/Overline'; | ||
export type { OverlineProps } from './Overline/Overline.types'; | ||
export { bodyTypeScaleStyles } from './styles'; | ||
export { default as Subtitle } from './Subtitle/Subtitle'; | ||
export type { SubtitleProps } from './Subtitle/Subtitle.types'; | ||
export { StaticWidthText } from './utils/StaticWidthText'; | ||
export { useUpdatedBaseFontSize } from './utils/useUpdatedBaseFontSize'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -1,2 +0,2 @@ | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("react"),require("@leafygreen-ui/emotion"),require("@leafygreen-ui/leafygreen-provider"),require("@leafygreen-ui/polymorphic"),require("@leafygreen-ui/lib"),require("@leafygreen-ui/palette"),require("@leafygreen-ui/tokens"),require("prop-types"),require("@leafygreen-ui/icon/dist/ArrowRight"),require("@leafygreen-ui/icon/dist/OpenNewTab")):"function"==typeof define&&define.amd?define(["exports","react","@leafygreen-ui/emotion","@leafygreen-ui/leafygreen-provider","@leafygreen-ui/polymorphic","@leafygreen-ui/lib","@leafygreen-ui/palette","@leafygreen-ui/tokens","prop-types","@leafygreen-ui/icon/dist/ArrowRight","@leafygreen-ui/icon/dist/OpenNewTab"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self)["@leafygreen-ui/typography"]={},e.React,e["@leafygreen-ui/emotion"],e["@leafygreen-ui/leafygreen-provider"],e["@leafygreen-ui/polymorphic"],e["@leafygreen-ui/lib"],e["@leafygreen-ui/palette"],e["@leafygreen-ui/tokens"],e.PropTypes,e.ArrowRight,e.OpenNewTab)}(this,(function(e,n,t,a,r,o,i,l,s,c,d){"use strict";function p(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u,h,f,m,g,y,b,x,v,k,N=p(n),S=p(s),F=p(c),w=p(d);function z(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function D(){return D=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},D.apply(this,arguments)}function T(e,n){if(null==e)return{};var t,a,r=function(e,n){if(null==e)return{};var t,a,r={},o=Object.keys(e);for(a=0;a<o.length;a++)t=o[a],n.indexOf(t)>=0||(r[t]=e[t]);return r}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)t=o[a],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}function M(e,n){return n||(n=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))}function B(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==t)return;var a,r,o=[],i=!0,l=!1;try{for(t=t.call(e);!(i=(a=t.next()).done)&&(o.push(a.value),!n||o.length!==n);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==t.return||t.return()}finally{if(l)throw r}}return o}(e,n)||function(e,n){if(!e)return;if("string"==typeof e)return E(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return E(e,n)}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function E(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,a=new Array(n);t<n;t++)a[t]=e[t];return a}var P,O,C,L,j,H,I,q,A,R,U,W=t.css(u||(u=M(["\n margin: unset;\n font-family: ",";\n color: ",";\n"])),l.fontFamilies.default,i.palette.black),_=(z(m={},l.BaseFontSize.Body1,t.css(h||(h=M(["\n font-size: ","px;\n line-height: ","px;\n "])),l.typeScales.body1.fontSize,l.typeScales.body1.lineHeight)),z(m,l.BaseFontSize.Body2,t.css(f||(f=M(["\n font-size: ","px;\n line-height: ","px;\n "])),l.typeScales.body2.fontSize,l.typeScales.body2.lineHeight)),m),K=(z(b={},l.BaseFontSize.Body1,t.css(g||(g=M(["\n font-size: ","px;\n line-height: ","px;\n "])),l.typeScales.code1.fontSize,l.typeScales.code1.lineHeight)),z(b,l.BaseFontSize.Body2,t.css(y||(y=M(["\n font-size: ","px;\n line-height: ","px;\n "])),l.typeScales.code2.fontSize,l.typeScales.code2.lineHeight)),b),$=(z(k={},o.Theme.Light,t.css(x||(x=M(["\n color: ",";\n "])),i.palette.black)),z(k,o.Theme.Dark,t.css(v||(v=M(["\n color: ",";\n "])),i.palette.gray.light2)),k),G=function(e){var n=a.useBaseFontSize();return e?16===e?l.BaseFontSize.Body2:l.BaseFontSize.Body1:16===n?l.BaseFontSize.Body2:l.BaseFontSize.Body1},J=["baseFontSize","darkMode","className","weight","as"],Q={default:{regular:400,medium:500},strong:{regular:700,medium:700}},V=r.Polymorphic((function(e){var n=e.baseFontSize,o=e.darkMode,i=e.className,l=e.weight,s=void 0===l?"regular":l,c=e.as,d=void 0===c?"p":c,p=T(e,J),u=a.useDarkMode(o).theme,h=G(n),f=r.usePolymorphic(d).Component,m=t.css(P||(P=M(["\n font-weight: ",";\n strong,\n b {\n font-weight: ",";\n }\n "])),Q.default[s],Q.strong[s]);return N.default.createElement(f,D({className:t.cx(W,_[h],$[u],m,i)},p))}));V.displayName="Body";var X,Y,Z,ee,ne=t.css(O||(O=M(["\n font-family: ",";\n font-weight: normal;\n margin-top: 0;\n margin-bottom: 0;\n"])),l.fontFamilies.default),te=(z(j={},o.Theme.Light,t.css(C||(C=M(["\n color: ",";\n "])),i.palette.gray.dark1)),z(j,o.Theme.Dark,t.css(L||(L=M(["\n color: ",";\n "])),i.palette.gray.light1)),j),ae=(z(q={},o.Theme.Light,t.css(H||(H=M(["\n color: ",";\n "])),i.palette.gray.dark1)),z(q,o.Theme.Dark,t.css(I||(I=M(["\n color: ",";\n "])),i.palette.gray.base)),q),re=(z(U={},l.BaseFontSize.Body1,t.css(A||(A=M(["\n font-size: ","px;\n line-height: ","px;\n "])),l.typeScales.body1.fontSize,l.typeScales.body1.lineHeight)),z(U,l.BaseFontSize.Body2,t.css(R||(R=M(["\n font-size: ","px;\n line-height: 20px; // Hardcoding because it does not match body2 lineHeight\n "])),l.typeScales.body2.fontSize)),U),oe=["baseFontSize","darkMode","disabled","children","className"],ie=function(e){var n=e.baseFontSize,r=e.darkMode,o=e.disabled,i=void 0!==o&&o,l=e.children,s=e.className,c=T(e,oe),d=a.useDarkMode(r).theme,p=G(n);return N.default.createElement("p",D({className:t.cx(ne,te[d],re[p],z({},ae[d],i),s)},c),l)};ie.displayName="Description";var le,se,ce,de,pe=(z(Z={},o.Theme.Light,t.css(X||(X=M(["\n color: ",";\n "])),i.palette.gray.dark1)),z(Z,o.Theme.Dark,t.css(Y||(Y=M(["\n color: ",";\n "])),i.palette.gray.light1)),Z),ue=t.css(ee||(ee=M(["\n display: block;\n font-size: 11px;\n line-height: 16px;\n letter-spacing: 0.2px;\n"]))),he=["darkMode","children","className"];function fe(e){var n=e.darkMode,r=e.children,o=e.className,i=T(e,he),l=a.useDarkMode(n).theme;return N.default.createElement("small",D({},i,{className:t.cx(W,ue,pe[l],o)}),r)}fe.displayName="Disclaimer";var me,ge,ye,be,xe,ve,ke,Ne,Se=t.css(le||(le=M(["\n font-family: ",";\n font-weight: normal;\n font-size: inherit;\n line-height: inherit;\n\n // Unsets browser default margins\n margin-block-start: 0;\n margin-block-end: 0;\n"])),l.fontFamilies.default),Fe=(z(de={},o.Theme.Light,t.css(se||(se=M(["\n color: ",";\n "])),i.palette.red.base)),z(de,o.Theme.Dark,t.css(ce||(ce=M(["\n color: ",";\n "])),i.palette.red.light1)),de),we=["as","darkMode","children","className"],ze=r.Polymorphic((function(e){var n=e.as,o=void 0===n?"p":n,i=e.darkMode,l=e.children,s=e.className,c=T(e,we),d=a.useDarkMode(i).theme,p=r.usePolymorphic(o).Component;return N.default.createElement(p,D({},c,{className:t.cx(Se,Fe[d],s)}),l)})),De=t.css(me||(me=M(["\n font-weight: 400;\n font-size: 48px;\n line-height: 62px;\n font-family: ",";\n"])),l.fontFamilies.serif),Te=(z(be={},o.Theme.Light,t.css(ge||(ge=M(["\n color: ",";\n "])),i.palette.green.dark2)),z(be,o.Theme.Dark,t.css(ye||(ye=M(["\n color: ",";\n "])),i.palette.green.light1)),be),Me=["darkMode","className","as"],Be=r.Polymorphic((function(e){var n=e.darkMode,o=e.className,i=e.as,l=void 0===i?"h1":i,s=T(e,Me),c=a.useDarkMode(n).theme,d=r.usePolymorphic(l).Component;return N.default.createElement(d,D({className:t.cx(W,De,Te[c],o)},s))}));Be.displayName="H1";var Ee,Pe=t.css(xe||(xe=M(["\n font-size: 32px;\n line-height: 40px;\n font-weight: 400;\n font-family: ",";\n"])),l.fontFamilies.serif),Oe=(z(Ne={},o.Theme.Light,t.css(ve||(ve=M(["\n color: ",";\n "])),i.palette.green.dark2)),z(Ne,o.Theme.Dark,t.css(ke||(ke=M(["\n color: ",";\n "])),i.palette.green.light1)),Ne),Ce=["darkMode","className","as"],Le=r.Polymorphic((function(e){var n=e.darkMode,o=e.className,i=e.as,l=void 0===i?"h2":i,s=T(e,Ce),c=a.useDarkMode(n).theme,d=r.usePolymorphic(l).Component;return N.default.createElement(d,D({className:t.cx(W,Pe,Oe[c],o)},s))}));Le.displayName="H2";var je,He,Ie,qe,Ae,Re,Ue,We,_e,Ke,$e,Ge,Je,Qe=t.css(Ee||(Ee=M(["\n font-size: 24px;\n line-height: 32px;\n font-weight: 500;\n"]))),Ve=["darkMode","className","as"],Xe=r.Polymorphic((function(e){var n=e.darkMode,o=e.className,i=e.as,l=void 0===i?"h3":i,s=T(e,Ve),c=a.useDarkMode(n).theme,d=r.usePolymorphic(l).Component;return N.default.createElement(d,D({className:t.cx(W,Qe,$[c],o)},s))}));Xe.displayName="H3";var Ye,Ze,en,nn,tn=o.createUniqueClassName(),an=t.css(je||(je=M(["\n display: inline;\n transition: all 0.15s ease-in-out;\n border-radius: 3px;\n font-family: ",";\n line-height: 20px;\n\n .",":hover > & {\n text-decoration: none;\n }\n"])),l.fontFamilies.code,tn),rn=(z(qe={},o.Theme.Light,t.css(He||(He=M(["\n background-color: ",";\n border: 1px solid ",";\n color: ",";\n\n .",":hover > & {\n box-shadow: 0 0 0 3px ",";\n border: 1px solid ",";\n }\n "])),i.palette.gray.light3,i.palette.gray.light2,i.palette.gray.dark3,tn,i.palette.gray.light2,i.palette.gray.light1)),z(qe,o.Theme.Dark,t.css(Ie||(Ie=M(["\n background-color: transparent;\n border: 1px solid ",";\n color: ",";\n\n .",":hover > & {\n box-shadow: 0 0 0 3px ",";\n border: 1px solid ",";\n }\n "])),i.palette.gray.dark2,i.palette.gray.light1,tn,i.palette.gray.dark2,i.palette.gray.dark1)),qe),on=(z(Ue={},o.Theme.Light,t.css(Ae||(Ae=M(["\n .",":focus-visible > & {\n box-shadow: ",";\n border: 1px solid ",";\n }\n "])),tn,l.focusRing[o.Theme.Light].default,i.palette.blue.base)),z(Ue,o.Theme.Dark,t.css(Re||(Re=M(["\n .",":focus-visible > & {\n box-shadow: ",";\n border: 1px solid ",";\n }\n "])),tn,l.focusRing[o.Theme.Dark].default,i.palette.blue.base)),Ue),ln=(z(Ke={},o.Theme.Light,t.css(We||(We=M(["\n color: ",";\n "])),i.palette.blue.base)),z(Ke,o.Theme.Dark,t.css(_e||(_e=M(["\n color: ",";\n "])),i.palette.blue.light1)),Ke),sn=t.css($e||($e=M(["\n text-decoration: none;\n margin: 0;\n padding: 0;\n line-height: 20px;\n\n &:focus {\n outline: none;\n }\n"]))),cn=t.css(Ge||(Ge=M(["\n white-space: nowrap;\n"]))),dn=t.css(Je||(Je=M(["\n white-space: normal;\n"]))),pn=["children","className","darkMode","baseFontSize","as"],un=r.InferredPolymorphic((function(e,n){var o,i,l=e.children,s=e.className,c=e.darkMode,d=e.baseFontSize,p=e.as,u=T(e,pn),h=a.useDarkMode(c).theme,f=G(d),m=r.useInferredPolymorphic(p,u,"code").Component,g=(null!==(o="string"==typeof l&&(null===(i=l.match(/(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g))||void 0===i?void 0:i.length))&&void 0!==o?o:0)<=30?cn:dn,y="code"!==m,b=N.default.createElement("code",{ref:n,className:t.cx(K[f],an,rn[h],on[h],g,z({},ln[h],y),s)},l);return y?N.default.createElement(m,D({className:t.cx(tn,sn,s)},u),b):N.default.cloneElement(b,u)}));un.displayName="InlineCode",un.propTypes={children:S.default.node,className:S.default.string,darkMode:S.default.bool,baseFontSize:S.default.oneOf(Object.values(l.BaseFontSize))};var hn,fn,mn,gn,yn,bn,xn,vn,kn,Nn,Sn=t.css(Ye||(Ye=M(["\n font-family: ",";\n border: 1px solid;\n border-radius: 3px;\n padding-left: 5px;\n padding-right: 5px;\n"])),l.fontFamilies.code),Fn=(z(nn={},o.Theme.Light,t.css(Ze||(Ze=M(["\n color: ",";\n border-color: ",";\n background-color: ",";\n "])),i.palette.black,i.palette.gray.dark3,i.palette.white)),z(nn,o.Theme.Dark,t.css(en||(en=M(["\n color: ",";\n border-color: ",";\n background-color: ",";\n "])),i.palette.gray.light2,i.palette.gray.base,i.palette.gray.dark3)),nn),wn=["baseFontSize","darkMode","children","className"];function zn(e){var n=e.baseFontSize,r=e.darkMode,o=e.children,i=e.className,l=T(e,wn),s=G(n),c=a.useDarkMode(r).theme;return N.default.createElement("code",D({className:t.cx(Sn,Fn[c],K[s],i)},l),o)}zn.displayName="InlineKeyCode";var Dn,Tn,Mn,Bn,En,Pn,On,Cn,Ln,jn,Hn,In,qn=t.css(hn||(hn=M(["\n font-family: ",";\n font-weight: bold;\n"])),l.fontFamilies.default),An=(z(gn={},o.Theme.Light,t.css(fn||(fn=M(["\n color: ",";\n "])),i.palette.black)),z(gn,o.Theme.Dark,t.css(mn||(mn=M(["\n color: ",";\n "])),i.palette.gray.light2)),gn),Rn=(z(xn={},o.Theme.Light,t.css(yn||(yn=M(["\n color: ",";\n "])),i.palette.gray.dark1)),z(xn,o.Theme.Dark,t.css(bn||(bn=M(["\n color: ",";\n "])),i.palette.gray.base)),xn),Un=(z(Nn={},l.BaseFontSize.Body1,t.css(vn||(vn=M(["\n font-size: ","px;\n line-height: ","px;\n "])),l.typeScales.body1.fontSize,l.typeScales.body1.lineHeight)),z(Nn,l.BaseFontSize.Body2,t.css(kn||(kn=M(["\n font-size: ","px;\n line-height: 20px; // Hardcoding because it does not match body2 lineHeight\n "])),l.typeScales.body2.fontSize)),Nn),Wn=["baseFontSize","darkMode","className","children","disabled","as"],_n=r.Polymorphic((function(e){var n=e.baseFontSize,o=e.darkMode,i=e.className,l=e.children,s=e.disabled,c=void 0!==s&&s,d=e.as,p=void 0===d?"label":d,u=T(e,Wn),h=a.useDarkMode(o).theme,f=G(n),m=r.usePolymorphic(p).Component;return N.default.createElement(m,D({className:t.cx(qn,An[h],Un[f],z({},Rn[h],c),i)},u),l)}));_n.displayName="Label";var Kn,$n,Gn=o.createUniqueClassName(),Jn=t.css(Dn||(Dn=M(["\n &:hover,\n &:focus,\n &:visited {\n text-decoration: none;\n }\n"]))),Qn=t.css(Tn||(Tn=M(["\n font-family: ",";\n display: inline-flex;\n align-items: center;\n text-decoration: none;\n cursor: pointer;\n line-height: 13px;\n\n &:focus {\n outline: none;\n }\n"])),l.fontFamilies.default),Vn=(z(En={},o.Theme.Light,t.css(Mn||(Mn=M(["\n color: ",";\n font-weight: 400;\n "])),i.palette.blue.base)),z(En,o.Theme.Dark,t.css(Bn||(Bn=M(["\n color: ",";\n font-weight: 700;\n "])),i.palette.blue.light1)),En),Xn=t.css(Pn||(Pn=M(["\n position: relative;\n &::after {\n content: '';\n position: absolute;\n width: 100%;\n height: 2px;\n bottom: -4px;\n left: 0;\n border-radius: 2px;\n }\n\n .",":focus & {\n &::after {\n background-color: ",";\n }\n }\n"])),Gn,i.palette.blue.light1),Yn=(z(Ln={},o.Theme.Light,t.css(On||(On=M(["\n .",":hover & {\n &::after {\n background-color: ",";\n }\n }\n "])),Gn,i.palette.gray.light2)),z(Ln,o.Theme.Dark,t.css(Cn||(Cn=M(["\n .",":hover & {\n &::after {\n background-color: ",";\n }\n }\n "])),Gn,i.palette.gray.dark2)),Ln),Zn=t.css(jn||(jn=M(["\n transform: translate3d(3px, 0, 0);\n"]))),et=t.css(Hn||(Hn=M(["\n opacity: 0;\n transform: translate3d(-3px, 0, 0);\n transition: all 100ms ease-in;\n\n .",":hover & {\n opacity: 1;\n transform: translate3d(3px, 0, 0);\n }\n"])),Gn),nt=t.css(In||(In=M(["\n position: relative;\n bottom: 4px;\n left: -1px;\n height: 12px;\n"]))),tt="hover",at="persist",rt="none",ot=["children","className","arrowAppearance","hideExternalIcon","baseFontSize","darkMode","as"],it=r.InferredPolymorphic((function(e){var o=e.children,i=e.className,l=e.arrowAppearance,s=void 0===l?rt:l,c=e.hideExternalIcon,d=void 0!==c&&c,p=e.baseFontSize,u=e.darkMode,h=e.as,f=T(e,ot),m=B(n.useState(""),2),g=m[0],y=m[1];n.useEffect((function(){y(window.location.hostname)}),[]);var b,x=a.useDarkMode(u).theme,v=G(p),k=r.useInferredPolymorphic(h,f,"span").Component,S=n.useMemo((function(){if(void 0!==f.href){return/^http(s)?:\/\//.test(f.href)?new URL(f.href).hostname:g}}),[f,g]),M={target:void 0,rel:void 0};if(f.target||f.rel?(M.target=f.target,M.rel=f.rel):"a"===k&&(S===g?M.target="_self":(M.target="_blank",M.rel="noopener noreferrer")),"_blank"!==M.target||d){if(s!==rt){var E;b=N.default.createElement(F.default,{role:"presentation",size:12,className:t.cx((E={},z(E,et,s===tt),z(E,Zn,s===at),E))})}}else b=N.default.createElement(w.default,{role:"presentation",className:nt});return N.default.createElement(k,D({className:t.cx(Gn,Jn,_[v],Qn,Vn[x],i)},M,f),N.default.createElement("span",{className:t.cx(Xn,Yn[x])},o),b)})),lt=t.css(Kn||(Kn=M(["\n font-size: 12px;\n font-weight: 700;\n text-transform: uppercase;\n line-height: 20px;\n letter-spacing: 0.4px;\n"]))),st=["darkMode","className","as"],ct=r.Polymorphic((function(e){var n=e.darkMode,o=e.className,i=e.as,l=void 0===i?"div":i,s=T(e,st),c=a.useDarkMode(n).theme,d=r.usePolymorphic(l).Component;return N.default.createElement(d,D({className:t.cx(W,lt,$[c],o)},s))}));ct.displayName="Overline";var dt=t.css($n||($n=M(["\n font-size: 18px;\n line-height: 24px;\n font-weight: 700;\n"]))),pt=["darkMode","className","as"],ut=r.Polymorphic((function(e){var n=e.darkMode,o=e.className,i=e.as,l=void 0===i?"h6":i,s=T(e,pt),c=a.useDarkMode(n).theme,d=r.usePolymorphic(l).Component;return N.default.createElement(d,D({className:t.cx(W,dt,$[c],o)},s))}));ut.displayName="Subtitle";var ht,ft,mt=["as","children","maxFontWeight","pseudoElement","className"],gt=function(e){var n=e.pseudoElement,a=e.maxFontWeight,r="&:".concat(n);return t.css(ht||(ht=M(["\n /* Inherit relevant properties from the parent */\n font-weight: inherit;\n font-size: inherit;\n\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n\n position: relative;\n display: inline-flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n text-decoration: none;\n min-width: 0;\n max-width: 100%;\n\n "," {\n content: attr(data-text);\n height: 0;\n font-weight: ",";\n visibility: hidden;\n overflow: hidden;\n user-select: none;\n pointer-events: none;\n }\n "])),r,a)},yt=t.css(ft||(ft=M(["\n flex: 1;\n min-width: 0;\n max-width: 100%;\n\n white-space: inherit;\n overflow: inherit;\n text-overflow: inherit;\n"])));e.Body=V,e.Description=ie,e.Disclaimer=fe,e.Error=ze,e.H1=Be,e.H2=Le,e.H3=Xe,e.InlineCode=un,e.InlineKeyCode=zn,e.Label=_n,e.Link=it,e.Overline=ct,e.StaticWidthText=function(e){var n=e.as,a=e.children,i=e.maxFontWeight,l=void 0===i?700:i,s=e.pseudoElement,c=void 0===s?"after":s,d=e.className,p=T(e,mt),u=o.getNodeTextContent(a);return N.default.createElement(r.Polymorph,D({className:t.cx(gt({pseudoElement:c,maxFontWeight:l}),d),as:null!=n?n:"span","data-text":u},p),N.default.createElement("span",{className:yt},a))},e.Subtitle=ut,e.anchorClassName=Gn,e.bodyTypeScaleStyles=_,e.labelTypeScaleStyles=Un,e.useUpdatedBaseFontSize=G,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("react"),require("@leafygreen-ui/emotion"),require("@leafygreen-ui/leafygreen-provider"),require("@leafygreen-ui/polymorphic"),require("@leafygreen-ui/tokens"),require("@leafygreen-ui/lib"),require("@leafygreen-ui/palette"),require("prop-types"),require("@leafygreen-ui/icon/dist/ArrowRight"),require("@leafygreen-ui/icon/dist/OpenNewTab")):"function"==typeof define&&define.amd?define(["exports","react","@leafygreen-ui/emotion","@leafygreen-ui/leafygreen-provider","@leafygreen-ui/polymorphic","@leafygreen-ui/tokens","@leafygreen-ui/lib","@leafygreen-ui/palette","prop-types","@leafygreen-ui/icon/dist/ArrowRight","@leafygreen-ui/icon/dist/OpenNewTab"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self)["@leafygreen-ui/typography"]={},e.React,e["@leafygreen-ui/emotion"],e["@leafygreen-ui/leafygreen-provider"],e["@leafygreen-ui/polymorphic"],e["@leafygreen-ui/tokens"],e["@leafygreen-ui/lib"],e["@leafygreen-ui/palette"],e.PropTypes,e.ArrowRight,e.OpenNewTab)}(this,(function(e,n,t,a,r,o,i,l,s,c,d){"use strict";function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p,u,f,m,g,y,b,x,v,k,N=h(n),S=h(s),F=h(c),w=h(d);function z(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function D(){return D=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},D.apply(this,arguments)}function T(e,n){if(null==e)return{};var t,a,r=function(e,n){if(null==e)return{};var t,a,r={},o=Object.keys(e);for(a=0;a<o.length;a++)t=o[a],n.indexOf(t)>=0||(r[t]=e[t]);return r}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)t=o[a],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}function M(e,n){return n||(n=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))}function B(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==t)return;var a,r,o=[],i=!0,l=!1;try{for(t=t.call(e);!(i=(a=t.next()).done)&&(o.push(a.value),!n||o.length!==n);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==t.return||t.return()}finally{if(l)throw r}}return o}(e,n)||function(e,n){if(!e)return;if("string"==typeof e)return E(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return E(e,n)}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function E(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,a=new Array(n);t<n;t++)a[t]=e[t];return a}var P,O,C,L,j,W,H,I,q,A,R,U=t.css(p||(p=M(["\n margin: unset;\n font-family: ",";\n color: ",";\n"])),o.fontFamilies.default,l.palette.black),_=(z(m={},o.BaseFontSize.Body1,t.css(u||(u=M(["\n font-size: ","px;\n line-height: ","px;\n "])),o.typeScales.body1.fontSize,o.typeScales.body1.lineHeight)),z(m,o.BaseFontSize.Body2,t.css(f||(f=M(["\n font-size: ","px;\n line-height: ","px;\n "])),o.typeScales.body2.fontSize,o.typeScales.body2.lineHeight)),m),K=(z(b={},o.BaseFontSize.Body1,t.css(g||(g=M(["\n font-size: ","px;\n line-height: ","px;\n "])),o.typeScales.code1.fontSize,o.typeScales.code1.lineHeight)),z(b,o.BaseFontSize.Body2,t.css(y||(y=M(["\n font-size: ","px;\n line-height: ","px;\n "])),o.typeScales.code2.fontSize,o.typeScales.code2.lineHeight)),b),$=(z(k={},i.Theme.Light,t.css(x||(x=M(["\n color: ",";\n "])),l.palette.black)),z(k,i.Theme.Dark,t.css(v||(v=M(["\n color: ",";\n "])),l.palette.gray.light2)),k),G=function(e){var n=a.useBaseFontSize();return e?16===e?o.BaseFontSize.Body2:o.BaseFontSize.Body1:16===n?o.BaseFontSize.Body2:o.BaseFontSize.Body1},J=["baseFontSize","darkMode","className","weight","as"],Q=r.Polymorphic((function(e){var n=e.baseFontSize,i=e.darkMode,l=e.className,s=e.weight,c=void 0===s?"regular":s,d=e.as,h=void 0===d?"p":d,p=T(e,J),u=a.useDarkMode(i).theme,f=G(n),m=r.usePolymorphic(h).Component,g=t.css(P||(P=M(["\n font-weight: ",";\n strong,\n b {\n font-weight: ",";\n }\n "])),o.fontWeights[c],o.fontWeights.bold);return N.default.createElement(m,D({className:t.cx(U,_[f],$[u],g,l)},p))}));Q.displayName="Body";var V,X,Y,Z,ee=t.css(O||(O=M(["\n font-family: ",";\n font-weight: ",";\n margin-top: 0;\n margin-bottom: 0;\n"])),o.fontFamilies.default,o.fontWeights.regular),ne=(z(j={},i.Theme.Light,t.css(C||(C=M(["\n color: ",";\n "])),l.palette.gray.dark1)),z(j,i.Theme.Dark,t.css(L||(L=M(["\n color: ",";\n "])),l.palette.gray.light1)),j),te=(z(I={},i.Theme.Light,t.css(W||(W=M(["\n color: ",";\n "])),l.palette.gray.dark1)),z(I,i.Theme.Dark,t.css(H||(H=M(["\n color: ",";\n "])),l.palette.gray.base)),I),ae=(z(R={},o.BaseFontSize.Body1,t.css(q||(q=M(["\n font-size: ","px;\n line-height: ","px;\n "])),o.typeScales.body1.fontSize,o.typeScales.body1.lineHeight)),z(R,o.BaseFontSize.Body2,t.css(A||(A=M(["\n font-size: ","px;\n line-height: 20px; // Hardcoding because it does not match body2 lineHeight\n "])),o.typeScales.body2.fontSize)),R),re=["baseFontSize","darkMode","disabled","children","className"],oe=function(e){var n=e.baseFontSize,r=e.darkMode,o=e.disabled,i=void 0!==o&&o,l=e.children,s=e.className,c=T(e,re),d=a.useDarkMode(r).theme,h=G(n);return N.default.createElement("p",D({className:t.cx(ee,ne[d],ae[h],z({},te[d],i),s)},c),l)};oe.displayName="Description";var ie,le,se,ce,de=(z(Y={},i.Theme.Light,t.css(V||(V=M(["\n color: ",";\n "])),l.palette.gray.dark1)),z(Y,i.Theme.Dark,t.css(X||(X=M(["\n color: ",";\n "])),l.palette.gray.light1)),Y),he=t.css(Z||(Z=M(["\n display: block;\n font-size: 11px;\n line-height: 16px;\n letter-spacing: 0.2px;\n"]))),pe=["darkMode","children","className"];function ue(e){var n=e.darkMode,r=e.children,o=e.className,i=T(e,pe),l=a.useDarkMode(n).theme;return N.default.createElement("small",D({},i,{className:t.cx(U,he,de[l],o)}),r)}ue.displayName="Disclaimer";var fe,me,ge,ye,be,xe,ve,ke,Ne=t.css(ie||(ie=M(["\n font-family: ",";\n font-weight: ",";\n font-size: inherit;\n line-height: inherit;\n\n // Unsets browser default margins\n margin-block-start: 0;\n margin-block-end: 0;\n"])),o.fontFamilies.default,o.fontWeights.regular),Se=(z(ce={},i.Theme.Light,t.css(le||(le=M(["\n color: ",";\n "])),l.palette.red.base)),z(ce,i.Theme.Dark,t.css(se||(se=M(["\n color: ",";\n "])),l.palette.red.light1)),ce),Fe=["as","darkMode","children","className"],we=r.Polymorphic((function(e){var n=e.as,o=void 0===n?"p":n,i=e.darkMode,l=e.children,s=e.className,c=T(e,Fe),d=a.useDarkMode(i).theme,h=r.usePolymorphic(o).Component;return N.default.createElement(h,D({},c,{className:t.cx(Ne,Se[d],s)}),l)})),ze=t.css(fe||(fe=M(["\n font-weight: ",";\n font-size: 48px;\n line-height: 62px;\n font-family: ",";\n"])),o.fontWeights.regular,o.fontFamilies.serif),De=(z(ye={},i.Theme.Light,t.css(me||(me=M(["\n color: ",";\n "])),l.palette.green.dark2)),z(ye,i.Theme.Dark,t.css(ge||(ge=M(["\n color: ",";\n "])),l.palette.green.light1)),ye),Te=["darkMode","className","as"],Me=r.Polymorphic((function(e){var n=e.darkMode,o=e.className,i=e.as,l=void 0===i?"h1":i,s=T(e,Te),c=a.useDarkMode(n).theme,d=r.usePolymorphic(l).Component;return N.default.createElement(d,D({className:t.cx(U,ze,De[c],o)},s))}));Me.displayName="H1";var Be,Ee=t.css(be||(be=M(["\n font-size: 32px;\n line-height: 40px;\n font-weight: ",";\n font-family: ",";\n"])),o.fontWeights.regular,o.fontFamilies.serif),Pe=(z(ke={},i.Theme.Light,t.css(xe||(xe=M(["\n color: ",";\n "])),l.palette.green.dark2)),z(ke,i.Theme.Dark,t.css(ve||(ve=M(["\n color: ",";\n "])),l.palette.green.light1)),ke),Oe=["darkMode","className","as"],Ce=r.Polymorphic((function(e){var n=e.darkMode,o=e.className,i=e.as,l=void 0===i?"h2":i,s=T(e,Oe),c=a.useDarkMode(n).theme,d=r.usePolymorphic(l).Component;return N.default.createElement(d,D({className:t.cx(U,Ee,Pe[c],o)},s))}));Ce.displayName="H2";var Le,je,We,He,Ie,qe,Ae,Re,Ue,_e,Ke,$e,Ge,Je=t.css(Be||(Be=M(["\n font-size: 24px;\n line-height: 32px;\n font-weight: ",";\n"])),o.fontWeights.medium),Qe=["darkMode","className","as"],Ve=r.Polymorphic((function(e){var n=e.darkMode,o=e.className,i=e.as,l=void 0===i?"h3":i,s=T(e,Qe),c=a.useDarkMode(n).theme,d=r.usePolymorphic(l).Component;return N.default.createElement(d,D({className:t.cx(U,Je,$[c],o)},s))}));Ve.displayName="H3";var Xe,Ye,Ze,en,nn=i.createUniqueClassName(),tn=t.css(Le||(Le=M(["\n display: inline;\n transition: all 0.15s ease-in-out;\n border-radius: 3px;\n font-family: ",";\n line-height: 20px;\n\n .",":hover > & {\n text-decoration: none;\n }\n"])),o.fontFamilies.code,nn),an=(z(He={},i.Theme.Light,t.css(je||(je=M(["\n background-color: ",";\n border: 1px solid ",";\n color: ",";\n\n .",":hover > & {\n box-shadow: 0 0 0 3px ",";\n border: 1px solid ",";\n }\n "])),l.palette.gray.light3,l.palette.gray.light2,l.palette.gray.dark3,nn,l.palette.gray.light2,l.palette.gray.light1)),z(He,i.Theme.Dark,t.css(We||(We=M(["\n background-color: transparent;\n border: 1px solid ",";\n color: ",";\n\n .",":hover > & {\n box-shadow: 0 0 0 3px ",";\n border: 1px solid ",";\n }\n "])),l.palette.gray.dark2,l.palette.gray.light1,nn,l.palette.gray.dark2,l.palette.gray.dark1)),He),rn=(z(Ae={},i.Theme.Light,t.css(Ie||(Ie=M(["\n .",":focus-visible > & {\n box-shadow: ",";\n border: 1px solid ",";\n }\n "])),nn,o.focusRing[i.Theme.Light].default,l.palette.blue.base)),z(Ae,i.Theme.Dark,t.css(qe||(qe=M(["\n .",":focus-visible > & {\n box-shadow: ",";\n border: 1px solid ",";\n }\n "])),nn,o.focusRing[i.Theme.Dark].default,l.palette.blue.base)),Ae),on=(z(_e={},i.Theme.Light,t.css(Re||(Re=M(["\n color: ",";\n "])),l.palette.blue.base)),z(_e,i.Theme.Dark,t.css(Ue||(Ue=M(["\n color: ",";\n "])),l.palette.blue.light1)),_e),ln=t.css(Ke||(Ke=M(["\n text-decoration: none;\n margin: 0;\n padding: 0;\n line-height: 20px;\n\n &:focus {\n outline: none;\n }\n"]))),sn=t.css($e||($e=M(["\n white-space: nowrap;\n"]))),cn=t.css(Ge||(Ge=M(["\n white-space: normal;\n"]))),dn=["children","className","darkMode","baseFontSize","as"],hn=r.InferredPolymorphic((function(e,n){var o,i,l=e.children,s=e.className,c=e.darkMode,d=e.baseFontSize,h=e.as,p=T(e,dn),u=a.useDarkMode(c).theme,f=G(d),m=r.useInferredPolymorphic(h,p,"code").Component,g=(null!==(o="string"==typeof l&&(null===(i=l.match(/(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g))||void 0===i?void 0:i.length))&&void 0!==o?o:0)<=30?sn:cn,y="code"!==m,b=N.default.createElement("code",{ref:n,className:t.cx(K[f],tn,an[u],rn[u],g,z({},on[u],y),s)},l);return y?N.default.createElement(m,D({className:t.cx(nn,ln,s)},p),b):N.default.cloneElement(b,p)}));hn.displayName="InlineCode",hn.propTypes={children:S.default.node,className:S.default.string,darkMode:S.default.bool,baseFontSize:S.default.oneOf(Object.values(o.BaseFontSize))};var pn,un,fn,mn,gn,yn,bn,xn,vn,kn,Nn=t.css(Xe||(Xe=M(["\n font-family: ",";\n border: 1px solid;\n border-radius: 3px;\n padding-left: 5px;\n padding-right: 5px;\n"])),o.fontFamilies.code),Sn=(z(en={},i.Theme.Light,t.css(Ye||(Ye=M(["\n color: ",";\n border-color: ",";\n background-color: ",";\n "])),l.palette.black,l.palette.gray.dark3,l.palette.white)),z(en,i.Theme.Dark,t.css(Ze||(Ze=M(["\n color: ",";\n border-color: ",";\n background-color: ",";\n "])),l.palette.gray.light2,l.palette.gray.base,l.palette.gray.dark3)),en),Fn=["baseFontSize","darkMode","children","className"];function wn(e){var n=e.baseFontSize,r=e.darkMode,o=e.children,i=e.className,l=T(e,Fn),s=G(n),c=a.useDarkMode(r).theme;return N.default.createElement("code",D({className:t.cx(Nn,Sn[c],K[s],i)},l),o)}wn.displayName="InlineKeyCode";var zn,Dn,Tn,Mn,Bn,En,Pn,On,Cn,Ln,jn,Wn,Hn=t.css(pn||(pn=M(["\n font-family: ",";\n font-weight: ",";\n"])),o.fontFamilies.default,o.fontWeights.bold),In=(z(mn={},i.Theme.Light,t.css(un||(un=M(["\n color: ",";\n "])),l.palette.black)),z(mn,i.Theme.Dark,t.css(fn||(fn=M(["\n color: ",";\n "])),l.palette.gray.light2)),mn),qn=(z(bn={},i.Theme.Light,t.css(gn||(gn=M(["\n color: ",";\n "])),l.palette.gray.dark1)),z(bn,i.Theme.Dark,t.css(yn||(yn=M(["\n color: ",";\n "])),l.palette.gray.base)),bn),An=(z(kn={},o.BaseFontSize.Body1,t.css(xn||(xn=M(["\n font-size: ","px;\n line-height: ","px;\n "])),o.typeScales.body1.fontSize,o.typeScales.body1.lineHeight)),z(kn,o.BaseFontSize.Body2,t.css(vn||(vn=M(["\n font-size: ","px;\n line-height: 20px; // Hardcoding because it does not match body2 lineHeight\n "])),o.typeScales.body2.fontSize)),kn),Rn=["baseFontSize","darkMode","className","children","disabled","as"],Un=r.Polymorphic((function(e){var n=e.baseFontSize,o=e.darkMode,i=e.className,l=e.children,s=e.disabled,c=void 0!==s&&s,d=e.as,h=void 0===d?"label":d,p=T(e,Rn),u=a.useDarkMode(o).theme,f=G(n),m=r.usePolymorphic(h).Component;return N.default.createElement(m,D({className:t.cx(Hn,In[u],An[f],z({},qn[u],c),i)},p),l)}));Un.displayName="Label";var _n,Kn,$n=i.createUniqueClassName(),Gn=t.css(zn||(zn=M(["\n &:hover,\n &:focus,\n &:visited {\n text-decoration: none;\n }\n"]))),Jn=t.css(Dn||(Dn=M(["\n font-family: ",";\n display: inline-flex;\n align-items: center;\n text-decoration: none;\n cursor: pointer;\n line-height: 13px;\n\n &:focus {\n outline: none;\n }\n"])),o.fontFamilies.default),Qn=(z(Bn={},i.Theme.Light,t.css(Tn||(Tn=M(["\n color: ",";\n font-weight: ",";\n "])),l.palette.blue.base,o.fontWeights.regular)),z(Bn,i.Theme.Dark,t.css(Mn||(Mn=M(["\n color: ",";\n font-weight: ",";\n "])),l.palette.blue.light1,o.fontWeights.bold)),Bn),Vn=t.css(En||(En=M(["\n position: relative;\n &::after {\n content: '';\n position: absolute;\n width: 100%;\n height: 2px;\n bottom: -4px;\n left: 0;\n border-radius: 2px;\n }\n\n .",":focus & {\n &::after {\n background-color: ",";\n }\n }\n"])),$n,l.palette.blue.light1),Xn=(z(Cn={},i.Theme.Light,t.css(Pn||(Pn=M(["\n .",":hover & {\n &::after {\n background-color: ",";\n }\n }\n "])),$n,l.palette.gray.light2)),z(Cn,i.Theme.Dark,t.css(On||(On=M(["\n .",":hover & {\n &::after {\n background-color: ",";\n }\n }\n "])),$n,l.palette.gray.dark2)),Cn),Yn=t.css(Ln||(Ln=M(["\n transform: translate3d(3px, 0, 0);\n"]))),Zn=t.css(jn||(jn=M(["\n opacity: 0;\n transform: translate3d(-3px, 0, 0);\n transition: all 100ms ease-in;\n\n .",":hover & {\n opacity: 1;\n transform: translate3d(3px, 0, 0);\n }\n"])),$n),et=t.css(Wn||(Wn=M(["\n position: relative;\n bottom: 4px;\n left: -1px;\n height: 12px;\n"]))),nt="hover",tt="persist",at="none",rt=["children","className","arrowAppearance","hideExternalIcon","baseFontSize","darkMode","as"],ot=r.InferredPolymorphic((function(e){var o=e.children,i=e.className,l=e.arrowAppearance,s=void 0===l?at:l,c=e.hideExternalIcon,d=void 0!==c&&c,h=e.baseFontSize,p=e.darkMode,u=e.as,f=T(e,rt),m=B(n.useState(""),2),g=m[0],y=m[1];n.useEffect((function(){y(window.location.hostname)}),[]);var b,x=a.useDarkMode(p).theme,v=G(h),k=r.useInferredPolymorphic(u,f,"span").Component,S=n.useMemo((function(){if(void 0!==f.href){return/^http(s)?:\/\//.test(f.href)?new URL(f.href).hostname:g}}),[f,g]),M={target:void 0,rel:void 0};if(f.target||f.rel?(M.target=f.target,M.rel=f.rel):"a"===k&&(S===g?M.target="_self":(M.target="_blank",M.rel="noopener noreferrer")),"_blank"!==M.target||d){if(s!==at){var E;b=N.default.createElement(F.default,{role:"presentation",size:12,className:t.cx((E={},z(E,Zn,s===nt),z(E,Yn,s===tt),E))})}}else b=N.default.createElement(w.default,{role:"presentation",className:et});return N.default.createElement(k,D({className:t.cx($n,Gn,_[v],Jn,Qn[x],i)},M,f),N.default.createElement("span",{className:t.cx(Vn,Xn[x])},o),b)})),it=t.css(_n||(_n=M(["\n font-size: 12px;\n font-weight: ",";\n text-transform: uppercase;\n line-height: 20px;\n letter-spacing: 0.4px;\n"])),o.fontWeights.bold),lt=["darkMode","className","as"],st=r.Polymorphic((function(e){var n=e.darkMode,o=e.className,i=e.as,l=void 0===i?"div":i,s=T(e,lt),c=a.useDarkMode(n).theme,d=r.usePolymorphic(l).Component;return N.default.createElement(d,D({className:t.cx(U,it,$[c],o)},s))}));st.displayName="Overline";var ct=t.css(Kn||(Kn=M(["\n font-size: 18px;\n line-height: 24px;\n font-weight: ",";\n"])),o.fontWeights.bold),dt=["darkMode","className","as"],ht=r.Polymorphic((function(e){var n=e.darkMode,o=e.className,i=e.as,l=void 0===i?"h6":i,s=T(e,dt),c=a.useDarkMode(n).theme,d=r.usePolymorphic(l).Component;return N.default.createElement(d,D({className:t.cx(U,ct,$[c],o)},s))}));ht.displayName="Subtitle";var pt,ut,ft=["as","children","maxFontWeight","pseudoElement","className"],mt=function(e){var n=e.pseudoElement,a=e.maxFontWeight,r="&:".concat(n);return t.css(pt||(pt=M(["\n /* Inherit relevant properties from the parent */\n font-weight: inherit;\n font-size: inherit;\n\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n\n position: relative;\n display: inline-flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n text-decoration: none;\n min-width: 0;\n max-width: 100%;\n\n "," {\n content: attr(data-text);\n height: 0;\n font-weight: ",";\n visibility: hidden;\n overflow: hidden;\n user-select: none;\n pointer-events: none;\n }\n "])),r,a)},gt=t.css(ut||(ut=M(["\n flex: 1;\n min-width: 0;\n max-width: 100%;\n\n white-space: inherit;\n overflow: inherit;\n text-overflow: inherit;\n"])));e.Body=Q,e.Description=oe,e.Disclaimer=ue,e.Error=we,e.H1=Me,e.H2=Ce,e.H3=Ve,e.InlineCode=hn,e.InlineKeyCode=wn,e.Label=Un,e.Link=ot,e.Overline=st,e.StaticWidthText=function(e){var n=e.as,a=e.children,o=e.maxFontWeight,l=void 0===o?700:o,s=e.pseudoElement,c=void 0===s?"after":s,d=e.className,h=T(e,ft),p=i.getNodeTextContent(a);return N.default.createElement(r.Polymorph,D({className:t.cx(mt({pseudoElement:c,maxFontWeight:l}),d),as:null!=n?n:"span","data-text":p},h),N.default.createElement("span",{className:gt},a))},e.Subtitle=ht,e.anchorClassName=$n,e.bodyTypeScaleStyles=_,e.labelTypeScaleStyles=An,e.useUpdatedBaseFontSize=G,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@leafygreen-ui/typography", | ||
"version": "16.3.0", | ||
"version": "16.4.0", | ||
"description": "leafyGreen UI Kit Typography", | ||
@@ -24,11 +24,8 @@ "main": "./dist/index.js", | ||
"@leafygreen-ui/emotion": "^4.0.4", | ||
"@leafygreen-ui/icon": "^11.13.1", | ||
"@leafygreen-ui/icon": "^11.14.0", | ||
"@leafygreen-ui/lib": "^10.3.3", | ||
"@leafygreen-ui/palette": "^4.0.4", | ||
"@leafygreen-ui/polymorphic": "^1.3.1", | ||
"@leafygreen-ui/tokens": "^2.0.3" | ||
"@leafygreen-ui/tokens": "^2.1.0" | ||
}, | ||
"devDependencies": { | ||
"@leafygreen-ui/inline-definition": "^6.0.4" | ||
}, | ||
"peerDependencies": { | ||
@@ -35,0 +32,0 @@ "@leafygreen-ui/leafygreen-provider": "^3.1.2" |
import { css } from '@leafygreen-ui/emotion'; | ||
import { Theme } from '@leafygreen-ui/lib'; | ||
import { palette } from '@leafygreen-ui/palette'; | ||
import { BaseFontSize, fontFamilies, typeScales } from '@leafygreen-ui/tokens'; | ||
import { | ||
BaseFontSize, | ||
fontFamilies, | ||
fontWeights, | ||
typeScales, | ||
} from '@leafygreen-ui/tokens'; | ||
export const descriptionStyle = css` | ||
font-family: ${fontFamilies.default}; | ||
font-weight: normal; | ||
font-weight: ${fontWeights.regular}; | ||
margin-top: 0; | ||
@@ -10,0 +15,0 @@ margin-bottom: 0; |
import { css } from '@leafygreen-ui/emotion'; | ||
import { Theme } from '@leafygreen-ui/lib'; | ||
import { palette } from '@leafygreen-ui/palette'; | ||
import { fontFamilies } from '@leafygreen-ui/tokens'; | ||
import { fontFamilies, fontWeights } from '@leafygreen-ui/tokens'; | ||
export const errorMessageStyle = css` | ||
font-family: ${fontFamilies.default}; | ||
font-weight: normal; | ||
font-weight: ${fontWeights.regular}; | ||
font-size: inherit; | ||
@@ -10,0 +10,0 @@ line-height: inherit; |
import { css } from '@leafygreen-ui/emotion'; | ||
import { Theme } from '@leafygreen-ui/lib'; | ||
import { palette } from '@leafygreen-ui/palette'; | ||
import { fontFamilies } from '@leafygreen-ui/tokens'; | ||
import { fontFamilies, fontWeights } from '@leafygreen-ui/tokens'; | ||
export const h1Styles = css` | ||
font-weight: 400; | ||
font-weight: ${fontWeights.regular}; | ||
font-size: 48px; | ||
@@ -9,0 +9,0 @@ line-height: 62px; |
import { css } from '@leafygreen-ui/emotion'; | ||
import { Theme } from '@leafygreen-ui/lib'; | ||
import { palette } from '@leafygreen-ui/palette'; | ||
import { fontFamilies } from '@leafygreen-ui/tokens'; | ||
import { fontFamilies, fontWeights } from '@leafygreen-ui/tokens'; | ||
@@ -9,3 +9,3 @@ export const h2Styles = css` | ||
line-height: 40px; | ||
font-weight: 400; | ||
font-weight: ${fontWeights.regular}; | ||
font-family: ${fontFamilies.serif}; | ||
@@ -12,0 +12,0 @@ `; |
import { css } from '@leafygreen-ui/emotion'; | ||
import { fontWeights } from '@leafygreen-ui/tokens'; | ||
@@ -6,3 +7,3 @@ export const h3Styles = css` | ||
line-height: 32px; | ||
font-weight: 500; | ||
font-weight: ${fontWeights.medium}; | ||
`; |
@@ -26,5 +26,7 @@ export { default as Body } from './Body/Body'; | ||
export { default as Overline } from './Overline/Overline'; | ||
export type { OverlineProps } from './Overline/Overline.types'; | ||
export { bodyTypeScaleStyles } from './styles'; | ||
export { default as Subtitle } from './Subtitle/Subtitle'; | ||
export type { SubtitleProps } from './Subtitle/Subtitle.types'; | ||
export { StaticWidthText } from './utils/StaticWidthText'; | ||
export { useUpdatedBaseFontSize } from './utils/useUpdatedBaseFontSize'; |
import { css } from '@leafygreen-ui/emotion'; | ||
import { Theme } from '@leafygreen-ui/lib'; | ||
import { palette } from '@leafygreen-ui/palette'; | ||
import { BaseFontSize, fontFamilies, typeScales } from '@leafygreen-ui/tokens'; | ||
import { | ||
BaseFontSize, | ||
fontFamilies, | ||
fontWeights, | ||
typeScales, | ||
} from '@leafygreen-ui/tokens'; | ||
export const labelStyle = css` | ||
font-family: ${fontFamilies.default}; | ||
font-weight: bold; | ||
font-weight: ${fontWeights.bold}; | ||
`; | ||
@@ -10,0 +15,0 @@ |
import { css } from '@leafygreen-ui/emotion'; | ||
import { createUniqueClassName, Theme } from '@leafygreen-ui/lib'; | ||
import { palette } from '@leafygreen-ui/palette'; | ||
import { fontFamilies } from '@leafygreen-ui/tokens'; | ||
import { fontFamilies, fontWeights } from '@leafygreen-ui/tokens'; | ||
@@ -32,7 +32,7 @@ export const anchorClassName = createUniqueClassName(); | ||
color: ${palette.blue.base}; | ||
font-weight: 400; | ||
font-weight: ${fontWeights.regular}; | ||
`, | ||
[Theme.Dark]: css` | ||
color: ${palette.blue.light1}; | ||
font-weight: 700; | ||
font-weight: ${fontWeights.bold}; | ||
`, | ||
@@ -39,0 +39,0 @@ }; |
import { css } from '@leafygreen-ui/emotion'; | ||
import { fontWeights } from '@leafygreen-ui/tokens'; | ||
export const overlineStyles = css` | ||
font-size: 12px; | ||
font-weight: 700; | ||
font-weight: ${fontWeights.bold}; | ||
text-transform: uppercase; | ||
@@ -7,0 +8,0 @@ line-height: 20px; |
import { css } from '@leafygreen-ui/emotion'; | ||
import { fontWeights } from '@leafygreen-ui/tokens'; | ||
@@ -6,3 +7,3 @@ export const subtitleStyles = css` | ||
line-height: 24px; | ||
font-weight: 700; | ||
font-weight: ${fontWeights.bold}; | ||
`; |
@@ -1,1 +0,1 @@ | ||
import e,{useState as n,useEffect as t,useMemo as r}from"react";import{css as a,cx as o}from"@leafygreen-ui/emotion";import l from"@leafygreen-ui/icon";import i from"@leafygreen-ui/inline-definition";import s,{useBaseFontSize as c,useDarkMode as d}from"@leafygreen-ui/leafygreen-provider";import{Theme as m,createUniqueClassName as h,getNodeTextContent as p,StoryMeta as f,storybookArgTypes as u}from"@leafygreen-ui/lib";import{palette as g}from"@leafygreen-ui/palette";import{Polymorphic as y,usePolymorphic as b,InferredPolymorphic as v,useInferredPolymorphic as x,Polymorph as E}from"@leafygreen-ui/polymorphic";import{fontFamilies as k,typeScales as N,BaseFontSize as w,focusRing as z}from"@leafygreen-ui/tokens";import S from"prop-types";import F from"@leafygreen-ui/icon/dist/ArrowRight";import D from"@leafygreen-ui/icon/dist/OpenNewTab";function O(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function M(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?O(Object(t),!0).forEach((function(n){j(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):O(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function j(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function C(){return C=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},C.apply(this,arguments)}function L(e,n){if(null==e)return{};var t,r,a=function(e,n){if(null==e)return{};var t,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)t=o[r],n.indexOf(t)>=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)t=o[r],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}function B(e,n){return n||(n=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))}function H(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==t)return;var r,a,o=[],l=!0,i=!1;try{for(t=t.call(e);!(l=(r=t.next()).done)&&(o.push(r.value),!n||o.length!==n);l=!0);}catch(e){i=!0,a=e}finally{try{l||null==t.return||t.return()}finally{if(i)throw a}}return o}(e,n)||function(e,n){if(!e)return;if("string"==typeof e)return A(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return A(e,n)}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function A(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}var I,P,T,W,R,U,_,K,$,q,G,J,Q,V,X,Y,Z,ee,ne,te,re,ae=a(I||(I=B(["\n margin: unset;\n font-family: ",";\n color: ",";\n"])),k.default,g.black),oe=(j(W={},w.Body1,a(P||(P=B(["\n font-size: ","px;\n line-height: ","px;\n "])),N.body1.fontSize,N.body1.lineHeight)),j(W,w.Body2,a(T||(T=B(["\n font-size: ","px;\n line-height: ","px;\n "])),N.body2.fontSize,N.body2.lineHeight)),W),le=(j(_={},w.Body1,a(R||(R=B(["\n font-size: ","px;\n line-height: ","px;\n "])),N.code1.fontSize,N.code1.lineHeight)),j(_,w.Body2,a(U||(U=B(["\n font-size: ","px;\n line-height: ","px;\n "])),N.code2.fontSize,N.code2.lineHeight)),_),ie=(j(q={},m.Light,a(K||(K=B(["\n color: ",";\n "])),g.black)),j(q,m.Dark,a($||($=B(["\n color: ",";\n "])),g.gray.light2)),q),se=function(e){var n=c();return e?16===e?w.Body2:w.Body1:16===n?w.Body2:w.Body1},ce=["baseFontSize","darkMode","className","weight","as"],de={default:{regular:400,medium:500},strong:{regular:700,medium:700}},me=y((function(n){var t=n.baseFontSize,r=n.darkMode,l=n.className,i=n.weight,s=void 0===i?"regular":i,c=n.as,m=void 0===c?"p":c,h=L(n,ce),p=d(r).theme,f=se(t),u=b(m).Component,g=a(G||(G=B(["\n font-weight: ",";\n strong,\n b {\n font-weight: ",";\n }\n "])),de.default[s],de.strong[s]);return e.createElement(u,C({className:o(ae,oe[f],ie[p],g,l)},h))}));me.displayName="Body";var he,pe,fe,ue,ge=a(J||(J=B(["\n font-family: ",";\n font-weight: normal;\n margin-top: 0;\n margin-bottom: 0;\n"])),k.default),ye=(j(X={},m.Light,a(Q||(Q=B(["\n color: ",";\n "])),g.gray.dark1)),j(X,m.Dark,a(V||(V=B(["\n color: ",";\n "])),g.gray.light1)),X),be=(j(ee={},m.Light,a(Y||(Y=B(["\n color: ",";\n "])),g.gray.dark1)),j(ee,m.Dark,a(Z||(Z=B(["\n color: ",";\n "])),g.gray.base)),ee),ve=(j(re={},w.Body1,a(ne||(ne=B(["\n font-size: ","px;\n line-height: ","px;\n "])),N.body1.fontSize,N.body1.lineHeight)),j(re,w.Body2,a(te||(te=B(["\n font-size: ","px;\n line-height: 20px; // Hardcoding because it does not match body2 lineHeight\n "])),N.body2.fontSize)),re),xe=["baseFontSize","darkMode","disabled","children","className"],Ee=function(n){var t=n.baseFontSize,r=n.darkMode,a=n.disabled,l=void 0!==a&&a,i=n.children,s=n.className,c=L(n,xe),m=d(r).theme,h=se(t);return e.createElement("p",C({className:o(ge,ye[m],ve[h],j({},be[m],l),s)},c),i)};Ee.displayName="Description";var ke,Ne,we,ze,Se=(j(fe={},m.Light,a(he||(he=B(["\n color: ",";\n "])),g.gray.dark1)),j(fe,m.Dark,a(pe||(pe=B(["\n color: ",";\n "])),g.gray.light1)),fe),Fe=a(ue||(ue=B(["\n display: block;\n font-size: 11px;\n line-height: 16px;\n letter-spacing: 0.2px;\n"]))),De=["darkMode","children","className"];function Oe(n){var t=n.darkMode,r=n.children,a=n.className,l=L(n,De),i=d(t).theme;return e.createElement("small",C({},l,{className:o(ae,Fe,Se[i],a)}),r)}Oe.displayName="Disclaimer";var Me,je,Ce,Le,Be,He,Ae,Ie,Pe=a(ke||(ke=B(["\n font-family: ",";\n font-weight: normal;\n font-size: inherit;\n line-height: inherit;\n\n // Unsets browser default margins\n margin-block-start: 0;\n margin-block-end: 0;\n"])),k.default),Te=(j(ze={},m.Light,a(Ne||(Ne=B(["\n color: ",";\n "])),g.red.base)),j(ze,m.Dark,a(we||(we=B(["\n color: ",";\n "])),g.red.light1)),ze),We=["as","darkMode","children","className"],Re=y((function(n){var t=n.as,r=void 0===t?"p":t,a=n.darkMode,l=n.children,i=n.className,s=L(n,We),c=d(a).theme,m=b(r).Component;return e.createElement(m,C({},s,{className:o(Pe,Te[c],i)}),l)})),Ue=a(Me||(Me=B(["\n font-weight: 400;\n font-size: 48px;\n line-height: 62px;\n font-family: ",";\n"])),k.serif),_e=(j(Le={},m.Light,a(je||(je=B(["\n color: ",";\n "])),g.green.dark2)),j(Le,m.Dark,a(Ce||(Ce=B(["\n color: ",";\n "])),g.green.light1)),Le),Ke=["darkMode","className","as"],$e=y((function(n){var t=n.darkMode,r=n.className,a=n.as,l=void 0===a?"h1":a,i=L(n,Ke),s=d(t).theme,c=b(l).Component;return e.createElement(c,C({className:o(ae,Ue,_e[s],r)},i))}));$e.displayName="H1";var qe,Ge=a(Be||(Be=B(["\n font-size: 32px;\n line-height: 40px;\n font-weight: 400;\n font-family: ",";\n"])),k.serif),Je=(j(Ie={},m.Light,a(He||(He=B(["\n color: ",";\n "])),g.green.dark2)),j(Ie,m.Dark,a(Ae||(Ae=B(["\n color: ",";\n "])),g.green.light1)),Ie),Qe=["darkMode","className","as"],Ve=y((function(n){var t=n.darkMode,r=n.className,a=n.as,l=void 0===a?"h2":a,i=L(n,Qe),s=d(t).theme,c=b(l).Component;return e.createElement(c,C({className:o(ae,Ge,Je[s],r)},i))}));Ve.displayName="H2";var Xe,Ye,Ze,en,nn,tn,rn,an,on,ln,sn,cn,dn,mn=a(qe||(qe=B(["\n font-size: 24px;\n line-height: 32px;\n font-weight: 500;\n"]))),hn=["darkMode","className","as"],pn=y((function(n){var t=n.darkMode,r=n.className,a=n.as,l=void 0===a?"h3":a,i=L(n,hn),s=d(t).theme,c=b(l).Component;return e.createElement(c,C({className:o(ae,mn,ie[s],r)},i))}));pn.displayName="H3";var fn,un,gn,yn,bn=h(),vn=a(Xe||(Xe=B(["\n display: inline;\n transition: all 0.15s ease-in-out;\n border-radius: 3px;\n font-family: ",";\n line-height: 20px;\n\n .",":hover > & {\n text-decoration: none;\n }\n"])),k.code,bn),xn=(j(en={},m.Light,a(Ye||(Ye=B(["\n background-color: ",";\n border: 1px solid ",";\n color: ",";\n\n .",":hover > & {\n box-shadow: 0 0 0 3px ",";\n border: 1px solid ",";\n }\n "])),g.gray.light3,g.gray.light2,g.gray.dark3,bn,g.gray.light2,g.gray.light1)),j(en,m.Dark,a(Ze||(Ze=B(["\n background-color: transparent;\n border: 1px solid ",";\n color: ",";\n\n .",":hover > & {\n box-shadow: 0 0 0 3px ",";\n border: 1px solid ",";\n }\n "])),g.gray.dark2,g.gray.light1,bn,g.gray.dark2,g.gray.dark1)),en),En=(j(rn={},m.Light,a(nn||(nn=B(["\n .",":focus-visible > & {\n box-shadow: ",";\n border: 1px solid ",";\n }\n "])),bn,z[m.Light].default,g.blue.base)),j(rn,m.Dark,a(tn||(tn=B(["\n .",":focus-visible > & {\n box-shadow: ",";\n border: 1px solid ",";\n }\n "])),bn,z[m.Dark].default,g.blue.base)),rn),kn=(j(ln={},m.Light,a(an||(an=B(["\n color: ",";\n "])),g.blue.base)),j(ln,m.Dark,a(on||(on=B(["\n color: ",";\n "])),g.blue.light1)),ln),Nn=a(sn||(sn=B(["\n text-decoration: none;\n margin: 0;\n padding: 0;\n line-height: 20px;\n\n &:focus {\n outline: none;\n }\n"]))),wn=a(cn||(cn=B(["\n white-space: nowrap;\n"]))),zn=a(dn||(dn=B(["\n white-space: normal;\n"]))),Sn=["children","className","darkMode","baseFontSize","as"],Fn=v((function(n,t){var r,a,l=n.children,i=n.className,s=n.darkMode,c=n.baseFontSize,m=n.as,h=L(n,Sn),p=d(s).theme,f=se(c),u=x(m,h,"code").Component,g=(null!==(r="string"==typeof l&&(null===(a=l.match(/(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g))||void 0===a?void 0:a.length))&&void 0!==r?r:0)<=30?wn:zn,y="code"!==u,b=e.createElement("code",{ref:t,className:o(le[f],vn,xn[p],En[p],g,j({},kn[p],y),i)},l);return y?e.createElement(u,C({className:o(bn,Nn,i)},h),b):e.cloneElement(b,h)}));Fn.displayName="InlineCode",Fn.propTypes={children:S.node,className:S.string,darkMode:S.bool,baseFontSize:S.oneOf(Object.values(w))};var Dn,On,Mn,jn,Cn,Ln,Bn,Hn,An,In,Pn=a(fn||(fn=B(["\n font-family: ",";\n border: 1px solid;\n border-radius: 3px;\n padding-left: 5px;\n padding-right: 5px;\n"])),k.code),Tn=(j(yn={},m.Light,a(un||(un=B(["\n color: ",";\n border-color: ",";\n background-color: ",";\n "])),g.black,g.gray.dark3,g.white)),j(yn,m.Dark,a(gn||(gn=B(["\n color: ",";\n border-color: ",";\n background-color: ",";\n "])),g.gray.light2,g.gray.base,g.gray.dark3)),yn),Wn=["baseFontSize","darkMode","children","className"];function Rn(n){var t=n.baseFontSize,r=n.darkMode,a=n.children,l=n.className,i=L(n,Wn),s=se(t),c=d(r).theme;return e.createElement("code",C({className:o(Pn,Tn[c],le[s],l)},i),a)}Rn.displayName="InlineKeyCode";var Un,_n,Kn,$n,qn,Gn,Jn,Qn,Vn,Xn,Yn,Zn,et=a(Dn||(Dn=B(["\n font-family: ",";\n font-weight: bold;\n"])),k.default),nt=(j(jn={},m.Light,a(On||(On=B(["\n color: ",";\n "])),g.black)),j(jn,m.Dark,a(Mn||(Mn=B(["\n color: ",";\n "])),g.gray.light2)),jn),tt=(j(Bn={},m.Light,a(Cn||(Cn=B(["\n color: ",";\n "])),g.gray.dark1)),j(Bn,m.Dark,a(Ln||(Ln=B(["\n color: ",";\n "])),g.gray.base)),Bn),rt=(j(In={},w.Body1,a(Hn||(Hn=B(["\n font-size: ","px;\n line-height: ","px;\n "])),N.body1.fontSize,N.body1.lineHeight)),j(In,w.Body2,a(An||(An=B(["\n font-size: ","px;\n line-height: 20px; // Hardcoding because it does not match body2 lineHeight\n "])),N.body2.fontSize)),In),at=["baseFontSize","darkMode","className","children","disabled","as"],ot=y((function(n){var t=n.baseFontSize,r=n.darkMode,a=n.className,l=n.children,i=n.disabled,s=void 0!==i&&i,c=n.as,m=void 0===c?"label":c,h=L(n,at),p=d(r).theme,f=se(t),u=b(m).Component;return e.createElement(u,C({className:o(et,nt[p],rt[f],j({},tt[p],s),a)},h),l)}));ot.displayName="Label";var lt,it,st=h(),ct=a(Un||(Un=B(["\n &:hover,\n &:focus,\n &:visited {\n text-decoration: none;\n }\n"]))),dt=a(_n||(_n=B(["\n font-family: ",";\n display: inline-flex;\n align-items: center;\n text-decoration: none;\n cursor: pointer;\n line-height: 13px;\n\n &:focus {\n outline: none;\n }\n"])),k.default),mt=(j(qn={},m.Light,a(Kn||(Kn=B(["\n color: ",";\n font-weight: 400;\n "])),g.blue.base)),j(qn,m.Dark,a($n||($n=B(["\n color: ",";\n font-weight: 700;\n "])),g.blue.light1)),qn),ht=a(Gn||(Gn=B(["\n position: relative;\n &::after {\n content: '';\n position: absolute;\n width: 100%;\n height: 2px;\n bottom: -4px;\n left: 0;\n border-radius: 2px;\n }\n\n .",":focus & {\n &::after {\n background-color: ",";\n }\n }\n"])),st,g.blue.light1),pt=(j(Vn={},m.Light,a(Jn||(Jn=B(["\n .",":hover & {\n &::after {\n background-color: ",";\n }\n }\n "])),st,g.gray.light2)),j(Vn,m.Dark,a(Qn||(Qn=B(["\n .",":hover & {\n &::after {\n background-color: ",";\n }\n }\n "])),st,g.gray.dark2)),Vn),ft=a(Xn||(Xn=B(["\n transform: translate3d(3px, 0, 0);\n"]))),ut=a(Yn||(Yn=B(["\n opacity: 0;\n transform: translate3d(-3px, 0, 0);\n transition: all 100ms ease-in;\n\n .",":hover & {\n opacity: 1;\n transform: translate3d(3px, 0, 0);\n }\n"])),st),gt=a(Zn||(Zn=B(["\n position: relative;\n bottom: 4px;\n left: -1px;\n height: 12px;\n"]))),yt="hover",bt="persist",vt="none",xt=["children","className","arrowAppearance","hideExternalIcon","baseFontSize","darkMode","as"],Et=v((function(a){var l=a.children,i=a.className,s=a.arrowAppearance,c=void 0===s?vt:s,m=a.hideExternalIcon,h=void 0!==m&&m,p=a.baseFontSize,f=a.darkMode,u=a.as,g=L(a,xt),y=H(n(""),2),b=y[0],v=y[1];t((function(){v(window.location.hostname)}),[]);var E,k=d(f).theme,N=se(p),w=x(u,g,"span").Component,z=r((function(){if(void 0!==g.href){return/^http(s)?:\/\//.test(g.href)?new URL(g.href).hostname:b}}),[g,b]),S={target:void 0,rel:void 0};if(g.target||g.rel?(S.target=g.target,S.rel=g.rel):"a"===w&&(z===b?S.target="_self":(S.target="_blank",S.rel="noopener noreferrer")),"_blank"!==S.target||h){if(c!==vt){var O;E=e.createElement(F,{role:"presentation",size:12,className:o((O={},j(O,ut,c===yt),j(O,ft,c===bt),O))})}}else E=e.createElement(D,{role:"presentation",className:gt});return e.createElement(w,C({className:o(st,ct,oe[N],dt,mt[k],i)},S,g),e.createElement("span",{className:o(ht,pt[k])},l),E)})),kt=a(lt||(lt=B(["\n font-size: 12px;\n font-weight: 700;\n text-transform: uppercase;\n line-height: 20px;\n letter-spacing: 0.4px;\n"]))),Nt=["darkMode","className","as"],wt=y((function(n){var t=n.darkMode,r=n.className,a=n.as,l=void 0===a?"div":a,i=L(n,Nt),s=d(t).theme,c=b(l).Component;return e.createElement(c,C({className:o(ae,kt,ie[s],r)},i))}));wt.displayName="Overline";var zt=a(it||(it=B(["\n font-size: 18px;\n line-height: 24px;\n font-weight: 700;\n"]))),St=["darkMode","className","as"],Ft=y((function(n){var t=n.darkMode,r=n.className,a=n.as,l=void 0===a?"h6":a,i=L(n,St),s=d(t).theme,c=b(l).Component;return e.createElement(c,C({className:o(ae,zt,ie[s],r)},i))}));Ft.displayName="Subtitle";var Dt,Ot,Mt,jt,Ct,Lt,Bt,Ht,At,It,Pt,Tt,Wt,Rt=["as","children","maxFontWeight","pseudoElement","className"],Ut=function(e){var n=e.pseudoElement,t=e.maxFontWeight,r="&:".concat(n);return a(Dt||(Dt=B(["\n /* Inherit relevant properties from the parent */\n font-weight: inherit;\n font-size: inherit;\n\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n\n position: relative;\n display: inline-flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n text-decoration: none;\n min-width: 0;\n max-width: 100%;\n\n "," {\n content: attr(data-text);\n height: 0;\n font-weight: ",";\n visibility: hidden;\n overflow: hidden;\n user-select: none;\n pointer-events: none;\n }\n "])),r,t)},_t=a(Ot||(Ot=B(["\n flex: 1;\n min-width: 0;\n max-width: 100%;\n\n white-space: inherit;\n overflow: inherit;\n text-overflow: inherit;\n"])));function Kt(n){var t=n.as,r=n.children,a=n.maxFontWeight,l=void 0===a?700:a,i=n.pseudoElement,s=void 0===i?"after":i,c=n.className,d=L(n,Rt),m=p(r);return e.createElement(E,C({className:o(Ut({pseudoElement:s,maxFontWeight:l}),c),as:null!=t?t:"span","data-text":m},d),e.createElement("span",{className:_t},r))}var $t=a(Mt||(Mt=B(["\n padding: 0;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n gap: 10px;\n"]))),qt=a(jt||(jt=B(["\n display: block;\n"]))),Gt=a(Ct||(Ct=B(["\n display: flex;\n gap: 8px;\n"]))),Jt=f({title:"Components/Typography",parameters:{default:"AllTypography",controls:{exclude:["className"]}}}),Qt=function(n){var t=n.baseFontSize,r=n.darkMode;return e.createElement(s,{baseFontSize:t,darkMode:r},e.createElement("div",{className:o($t)},e.createElement($e,null,"Heading 1"),e.createElement(Ve,null,"Heading 2"),e.createElement(pn,null,"Heading 3"),e.createElement(Ft,null,"Subtitle"),e.createElement("div",{className:o(Gt)},e.createElement(me,null,"Body"),e.createElement(me,null,e.createElement("strong",null,"Body (Semibold)"))),e.createElement("div",{className:o(Gt)},e.createElement(me,null,e.createElement("em",null,"Body (Italic)")),e.createElement(me,null,e.createElement("strong",null,e.createElement("em",null,"Body (Semibold Italic)")))),e.createElement("div",{className:o(Gt)},e.createElement(Fn,null,'"Inline Code"'),e.createElement(Fn,{href:"https://mongodb.github.io/leafygreen-ui/?path=/story/*"},'"Inline Code Link"')),e.createElement("div",{className:o(Gt)},e.createElement(Et,{href:"http://localhost:9001",arrowAppearance:"hover"},"Local (Arrow on Hover)"),e.createElement(Et,{href:"http://localhost:9001",arrowAppearance:"none"},"Local (No Arrow)"),e.createElement(Et,{href:"?path=/story/button--icon-only",arrowAppearance:"persist"},"Internal (Persist Arrow)"),e.createElement(Et,{href:"https://mongodb.github.io/leafygreen-ui/?path=/story/*"},"External")),e.createElement("div",{className:qt},e.createElement(Rn,null,"CTRL"),e.createElement("code",null," + "),e.createElement(Rn,null,"C")),e.createElement(wt,{className:qt},"Overline"),e.createElement(Oe,{className:qt},"Disclaimer"),e.createElement("div",{className:a(Lt||(Lt=B(["\n color: ",";\n "])),r?g.gray.light2:g.black)},e.createElement(i,{definition:"Tooltip Definition"},"Inline definition")),e.createElement(Re,null,"Hello I am an Error!"),e.createElement("div",{className:o(qt)},e.createElement(ot,{htmlFor:"id"},"This is a label"),e.createElement(Ee,null,"This is the description for said label"))))};Qt.argTypes={baseFontSize:M(M({},u.baseFontSize),{},{description:"Storybook prop only. This font size is passed into the LeafygreenProvider."}),darkMode:u.darkMode};var Vt=function(){var n=a(Bt||(Bt=B(["\n font-weight: 400;\n cursor: pointer;\n outline: 1px solid ",";\n outline-offset: -1px;\n\n &:hover {\n font-weight: 700;\n }\n "])),g.red.light2),t=a(Ht||(Ht=B(["\n outline: 1px solid ",";\n padding: 10px;\n width: max-content;\n max-width: 200px;\n "])),g.blue.light1),r=a(At||(At=B(["\n outline: 1px solid gray;\n padding: 10px;\n width: max-content;\n max-width: 148px;\n display: flex;\n align-items: center;\n "])));return e.createElement("div",{className:a(It||(It=B(["\n position: absolute;\n top: 0;\n left: 0;\n margin: 20px;\n "])))},e.createElement("div",{className:a(Pt||(Pt=B(["\n display: flex;\n "])))},e.createElement("div",{className:t},e.createElement(Kt,{className:n},"Some Tabs")),e.createElement("div",{className:t},e.createElement(Kt,{className:o(n,a(Tt||(Tt=B(["\n flex: 1;\n "]))))},"Some long text that will be truncated eventually because its long")),e.createElement("div",{className:t},e.createElement(Kt,{className:n},"Some more text"))),e.createElement("br",null),e.createElement("div",{className:o(n,r)},e.createElement(Kt,null,"Some button"),e.createElement(l,{glyph:"CaretDown"})),e.createElement("br",null),e.createElement("div",{className:o(n,r)},e.createElement(Kt,{className:o(a(Wt||(Wt=B(["\n flex: 1;\n "]))))},"Some long text button that should be truncated"),e.createElement(l,{glyph:"CaretDown"})))};export{Qt as AllTypography,Vt as StaticWidthTextStory,Jt as default}; | ||
import e,{useState as n,useEffect as t,useMemo as r}from"react";import{css as a,cx as o}from"@leafygreen-ui/emotion";import l from"@leafygreen-ui/icon";import i,{useBaseFontSize as s,useDarkMode as c}from"@leafygreen-ui/leafygreen-provider";import{Theme as d,createUniqueClassName as m,getNodeTextContent as h,StoryMeta as p,storybookArgTypes as u}from"@leafygreen-ui/lib";import{palette as f}from"@leafygreen-ui/palette";import{Polymorphic as g,usePolymorphic as b,InferredPolymorphic as y,useInferredPolymorphic as v,Polymorph as x}from"@leafygreen-ui/polymorphic";import{fontFamilies as E,typeScales as k,BaseFontSize as N,fontWeights as w,focusRing as z}from"@leafygreen-ui/tokens";import S from"prop-types";import F from"@leafygreen-ui/icon/dist/ArrowRight";import O from"@leafygreen-ui/icon/dist/OpenNewTab";function D(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function M(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?D(Object(t),!0).forEach((function(n){j(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):D(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function j(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function C(){return C=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},C.apply(this,arguments)}function L(e,n){if(null==e)return{};var t,r,a=function(e,n){if(null==e)return{};var t,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)t=o[r],n.indexOf(t)>=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)t=o[r],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}function B(e,n){return n||(n=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))}function H(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==t)return;var r,a,o=[],l=!0,i=!1;try{for(t=t.call(e);!(l=(r=t.next()).done)&&(o.push(r.value),!n||o.length!==n);l=!0);}catch(e){i=!0,a=e}finally{try{l||null==t.return||t.return()}finally{if(i)throw a}}return o}(e,n)||function(e,n){if(!e)return;if("string"==typeof e)return A(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return A(e,n)}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function A(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}var I,P,T,W,R,U,_,K,$,q,G,J,Q,V,X,Y,Z,ee,ne,te,re,ae=a(I||(I=B(["\n margin: unset;\n font-family: ",";\n color: ",";\n"])),E.default,f.black),oe=(j(W={},N.Body1,a(P||(P=B(["\n font-size: ","px;\n line-height: ","px;\n "])),k.body1.fontSize,k.body1.lineHeight)),j(W,N.Body2,a(T||(T=B(["\n font-size: ","px;\n line-height: ","px;\n "])),k.body2.fontSize,k.body2.lineHeight)),W),le=(j(_={},N.Body1,a(R||(R=B(["\n font-size: ","px;\n line-height: ","px;\n "])),k.code1.fontSize,k.code1.lineHeight)),j(_,N.Body2,a(U||(U=B(["\n font-size: ","px;\n line-height: ","px;\n "])),k.code2.fontSize,k.code2.lineHeight)),_),ie=(j(q={},d.Light,a(K||(K=B(["\n color: ",";\n "])),f.black)),j(q,d.Dark,a($||($=B(["\n color: ",";\n "])),f.gray.light2)),q),se=function(e){var n=s();return e?16===e?N.Body2:N.Body1:16===n?N.Body2:N.Body1},ce=["baseFontSize","darkMode","className","weight","as"],de=g((function(n){var t=n.baseFontSize,r=n.darkMode,l=n.className,i=n.weight,s=void 0===i?"regular":i,d=n.as,m=void 0===d?"p":d,h=L(n,ce),p=c(r).theme,u=se(t),f=b(m).Component,g=a(G||(G=B(["\n font-weight: ",";\n strong,\n b {\n font-weight: ",";\n }\n "])),w[s],w.bold);return e.createElement(f,C({className:o(ae,oe[u],ie[p],g,l)},h))}));de.displayName="Body";var me,he,pe,ue,fe=a(J||(J=B(["\n font-family: ",";\n font-weight: ",";\n margin-top: 0;\n margin-bottom: 0;\n"])),E.default,w.regular),ge=(j(X={},d.Light,a(Q||(Q=B(["\n color: ",";\n "])),f.gray.dark1)),j(X,d.Dark,a(V||(V=B(["\n color: ",";\n "])),f.gray.light1)),X),be=(j(ee={},d.Light,a(Y||(Y=B(["\n color: ",";\n "])),f.gray.dark1)),j(ee,d.Dark,a(Z||(Z=B(["\n color: ",";\n "])),f.gray.base)),ee),ye=(j(re={},N.Body1,a(ne||(ne=B(["\n font-size: ","px;\n line-height: ","px;\n "])),k.body1.fontSize,k.body1.lineHeight)),j(re,N.Body2,a(te||(te=B(["\n font-size: ","px;\n line-height: 20px; // Hardcoding because it does not match body2 lineHeight\n "])),k.body2.fontSize)),re),ve=["baseFontSize","darkMode","disabled","children","className"],xe=function(n){var t=n.baseFontSize,r=n.darkMode,a=n.disabled,l=void 0!==a&&a,i=n.children,s=n.className,d=L(n,ve),m=c(r).theme,h=se(t);return e.createElement("p",C({className:o(fe,ge[m],ye[h],j({},be[m],l),s)},d),i)};xe.displayName="Description";var Ee,ke,Ne,we,ze=(j(pe={},d.Light,a(me||(me=B(["\n color: ",";\n "])),f.gray.dark1)),j(pe,d.Dark,a(he||(he=B(["\n color: ",";\n "])),f.gray.light1)),pe),Se=a(ue||(ue=B(["\n display: block;\n font-size: 11px;\n line-height: 16px;\n letter-spacing: 0.2px;\n"]))),Fe=["darkMode","children","className"];function Oe(n){var t=n.darkMode,r=n.children,a=n.className,l=L(n,Fe),i=c(t).theme;return e.createElement("small",C({},l,{className:o(ae,Se,ze[i],a)}),r)}Oe.displayName="Disclaimer";var De,Me,je,Ce,Le,Be,He,Ae,Ie=a(Ee||(Ee=B(["\n font-family: ",";\n font-weight: ",";\n font-size: inherit;\n line-height: inherit;\n\n // Unsets browser default margins\n margin-block-start: 0;\n margin-block-end: 0;\n"])),E.default,w.regular),Pe=(j(we={},d.Light,a(ke||(ke=B(["\n color: ",";\n "])),f.red.base)),j(we,d.Dark,a(Ne||(Ne=B(["\n color: ",";\n "])),f.red.light1)),we),Te=["as","darkMode","children","className"],We=g((function(n){var t=n.as,r=void 0===t?"p":t,a=n.darkMode,l=n.children,i=n.className,s=L(n,Te),d=c(a).theme,m=b(r).Component;return e.createElement(m,C({},s,{className:o(Ie,Pe[d],i)}),l)})),Re=a(De||(De=B(["\n font-weight: ",";\n font-size: 48px;\n line-height: 62px;\n font-family: ",";\n"])),w.regular,E.serif),Ue=(j(Ce={},d.Light,a(Me||(Me=B(["\n color: ",";\n "])),f.green.dark2)),j(Ce,d.Dark,a(je||(je=B(["\n color: ",";\n "])),f.green.light1)),Ce),_e=["darkMode","className","as"],Ke=g((function(n){var t=n.darkMode,r=n.className,a=n.as,l=void 0===a?"h1":a,i=L(n,_e),s=c(t).theme,d=b(l).Component;return e.createElement(d,C({className:o(ae,Re,Ue[s],r)},i))}));Ke.displayName="H1";var $e,qe=a(Le||(Le=B(["\n font-size: 32px;\n line-height: 40px;\n font-weight: ",";\n font-family: ",";\n"])),w.regular,E.serif),Ge=(j(Ae={},d.Light,a(Be||(Be=B(["\n color: ",";\n "])),f.green.dark2)),j(Ae,d.Dark,a(He||(He=B(["\n color: ",";\n "])),f.green.light1)),Ae),Je=["darkMode","className","as"],Qe=g((function(n){var t=n.darkMode,r=n.className,a=n.as,l=void 0===a?"h2":a,i=L(n,Je),s=c(t).theme,d=b(l).Component;return e.createElement(d,C({className:o(ae,qe,Ge[s],r)},i))}));Qe.displayName="H2";var Ve,Xe,Ye,Ze,en,nn,tn,rn,an,on,ln,sn,cn,dn=a($e||($e=B(["\n font-size: 24px;\n line-height: 32px;\n font-weight: ",";\n"])),w.medium),mn=["darkMode","className","as"],hn=g((function(n){var t=n.darkMode,r=n.className,a=n.as,l=void 0===a?"h3":a,i=L(n,mn),s=c(t).theme,d=b(l).Component;return e.createElement(d,C({className:o(ae,dn,ie[s],r)},i))}));hn.displayName="H3";var pn,un,fn,gn,bn=m(),yn=a(Ve||(Ve=B(["\n display: inline;\n transition: all 0.15s ease-in-out;\n border-radius: 3px;\n font-family: ",";\n line-height: 20px;\n\n .",":hover > & {\n text-decoration: none;\n }\n"])),E.code,bn),vn=(j(Ze={},d.Light,a(Xe||(Xe=B(["\n background-color: ",";\n border: 1px solid ",";\n color: ",";\n\n .",":hover > & {\n box-shadow: 0 0 0 3px ",";\n border: 1px solid ",";\n }\n "])),f.gray.light3,f.gray.light2,f.gray.dark3,bn,f.gray.light2,f.gray.light1)),j(Ze,d.Dark,a(Ye||(Ye=B(["\n background-color: transparent;\n border: 1px solid ",";\n color: ",";\n\n .",":hover > & {\n box-shadow: 0 0 0 3px ",";\n border: 1px solid ",";\n }\n "])),f.gray.dark2,f.gray.light1,bn,f.gray.dark2,f.gray.dark1)),Ze),xn=(j(tn={},d.Light,a(en||(en=B(["\n .",":focus-visible > & {\n box-shadow: ",";\n border: 1px solid ",";\n }\n "])),bn,z[d.Light].default,f.blue.base)),j(tn,d.Dark,a(nn||(nn=B(["\n .",":focus-visible > & {\n box-shadow: ",";\n border: 1px solid ",";\n }\n "])),bn,z[d.Dark].default,f.blue.base)),tn),En=(j(on={},d.Light,a(rn||(rn=B(["\n color: ",";\n "])),f.blue.base)),j(on,d.Dark,a(an||(an=B(["\n color: ",";\n "])),f.blue.light1)),on),kn=a(ln||(ln=B(["\n text-decoration: none;\n margin: 0;\n padding: 0;\n line-height: 20px;\n\n &:focus {\n outline: none;\n }\n"]))),Nn=a(sn||(sn=B(["\n white-space: nowrap;\n"]))),wn=a(cn||(cn=B(["\n white-space: normal;\n"]))),zn=["children","className","darkMode","baseFontSize","as"],Sn=y((function(n,t){var r,a,l=n.children,i=n.className,s=n.darkMode,d=n.baseFontSize,m=n.as,h=L(n,zn),p=c(s).theme,u=se(d),f=v(m,h,"code").Component,g=(null!==(r="string"==typeof l&&(null===(a=l.match(/(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g))||void 0===a?void 0:a.length))&&void 0!==r?r:0)<=30?Nn:wn,b="code"!==f,y=e.createElement("code",{ref:t,className:o(le[u],yn,vn[p],xn[p],g,j({},En[p],b),i)},l);return b?e.createElement(f,C({className:o(bn,kn,i)},h),y):e.cloneElement(y,h)}));Sn.displayName="InlineCode",Sn.propTypes={children:S.node,className:S.string,darkMode:S.bool,baseFontSize:S.oneOf(Object.values(N))};var Fn,On,Dn,Mn,jn,Cn,Ln,Bn,Hn,An,In=a(pn||(pn=B(["\n font-family: ",";\n border: 1px solid;\n border-radius: 3px;\n padding-left: 5px;\n padding-right: 5px;\n"])),E.code),Pn=(j(gn={},d.Light,a(un||(un=B(["\n color: ",";\n border-color: ",";\n background-color: ",";\n "])),f.black,f.gray.dark3,f.white)),j(gn,d.Dark,a(fn||(fn=B(["\n color: ",";\n border-color: ",";\n background-color: ",";\n "])),f.gray.light2,f.gray.base,f.gray.dark3)),gn),Tn=["baseFontSize","darkMode","children","className"];function Wn(n){var t=n.baseFontSize,r=n.darkMode,a=n.children,l=n.className,i=L(n,Tn),s=se(t),d=c(r).theme;return e.createElement("code",C({className:o(In,Pn[d],le[s],l)},i),a)}Wn.displayName="InlineKeyCode";var Rn,Un,_n,Kn,$n,qn,Gn,Jn,Qn,Vn,Xn,Yn,Zn=a(Fn||(Fn=B(["\n font-family: ",";\n font-weight: ",";\n"])),E.default,w.bold),et=(j(Mn={},d.Light,a(On||(On=B(["\n color: ",";\n "])),f.black)),j(Mn,d.Dark,a(Dn||(Dn=B(["\n color: ",";\n "])),f.gray.light2)),Mn),nt=(j(Ln={},d.Light,a(jn||(jn=B(["\n color: ",";\n "])),f.gray.dark1)),j(Ln,d.Dark,a(Cn||(Cn=B(["\n color: ",";\n "])),f.gray.base)),Ln),tt=(j(An={},N.Body1,a(Bn||(Bn=B(["\n font-size: ","px;\n line-height: ","px;\n "])),k.body1.fontSize,k.body1.lineHeight)),j(An,N.Body2,a(Hn||(Hn=B(["\n font-size: ","px;\n line-height: 20px; // Hardcoding because it does not match body2 lineHeight\n "])),k.body2.fontSize)),An),rt=["baseFontSize","darkMode","className","children","disabled","as"],at=g((function(n){var t=n.baseFontSize,r=n.darkMode,a=n.className,l=n.children,i=n.disabled,s=void 0!==i&&i,d=n.as,m=void 0===d?"label":d,h=L(n,rt),p=c(r).theme,u=se(t),f=b(m).Component;return e.createElement(f,C({className:o(Zn,et[p],tt[u],j({},nt[p],s),a)},h),l)}));at.displayName="Label";var ot,lt,it=m(),st=a(Rn||(Rn=B(["\n &:hover,\n &:focus,\n &:visited {\n text-decoration: none;\n }\n"]))),ct=a(Un||(Un=B(["\n font-family: ",";\n display: inline-flex;\n align-items: center;\n text-decoration: none;\n cursor: pointer;\n line-height: 13px;\n\n &:focus {\n outline: none;\n }\n"])),E.default),dt=(j($n={},d.Light,a(_n||(_n=B(["\n color: ",";\n font-weight: ",";\n "])),f.blue.base,w.regular)),j($n,d.Dark,a(Kn||(Kn=B(["\n color: ",";\n font-weight: ",";\n "])),f.blue.light1,w.bold)),$n),mt=a(qn||(qn=B(["\n position: relative;\n &::after {\n content: '';\n position: absolute;\n width: 100%;\n height: 2px;\n bottom: -4px;\n left: 0;\n border-radius: 2px;\n }\n\n .",":focus & {\n &::after {\n background-color: ",";\n }\n }\n"])),it,f.blue.light1),ht=(j(Qn={},d.Light,a(Gn||(Gn=B(["\n .",":hover & {\n &::after {\n background-color: ",";\n }\n }\n "])),it,f.gray.light2)),j(Qn,d.Dark,a(Jn||(Jn=B(["\n .",":hover & {\n &::after {\n background-color: ",";\n }\n }\n "])),it,f.gray.dark2)),Qn),pt=a(Vn||(Vn=B(["\n transform: translate3d(3px, 0, 0);\n"]))),ut=a(Xn||(Xn=B(["\n opacity: 0;\n transform: translate3d(-3px, 0, 0);\n transition: all 100ms ease-in;\n\n .",":hover & {\n opacity: 1;\n transform: translate3d(3px, 0, 0);\n }\n"])),it),ft=a(Yn||(Yn=B(["\n position: relative;\n bottom: 4px;\n left: -1px;\n height: 12px;\n"]))),gt="hover",bt="persist",yt="none",vt=["children","className","arrowAppearance","hideExternalIcon","baseFontSize","darkMode","as"],xt=y((function(a){var l=a.children,i=a.className,s=a.arrowAppearance,d=void 0===s?yt:s,m=a.hideExternalIcon,h=void 0!==m&&m,p=a.baseFontSize,u=a.darkMode,f=a.as,g=L(a,vt),b=H(n(""),2),y=b[0],x=b[1];t((function(){x(window.location.hostname)}),[]);var E,k=c(u).theme,N=se(p),w=v(f,g,"span").Component,z=r((function(){if(void 0!==g.href){return/^http(s)?:\/\//.test(g.href)?new URL(g.href).hostname:y}}),[g,y]),S={target:void 0,rel:void 0};if(g.target||g.rel?(S.target=g.target,S.rel=g.rel):"a"===w&&(z===y?S.target="_self":(S.target="_blank",S.rel="noopener noreferrer")),"_blank"!==S.target||h){if(d!==yt){var D;E=e.createElement(F,{role:"presentation",size:12,className:o((D={},j(D,ut,d===gt),j(D,pt,d===bt),D))})}}else E=e.createElement(O,{role:"presentation",className:ft});return e.createElement(w,C({className:o(it,st,oe[N],ct,dt[k],i)},S,g),e.createElement("span",{className:o(mt,ht[k])},l),E)})),Et=a(ot||(ot=B(["\n font-size: 12px;\n font-weight: ",";\n text-transform: uppercase;\n line-height: 20px;\n letter-spacing: 0.4px;\n"])),w.bold),kt=["darkMode","className","as"],Nt=g((function(n){var t=n.darkMode,r=n.className,a=n.as,l=void 0===a?"div":a,i=L(n,kt),s=c(t).theme,d=b(l).Component;return e.createElement(d,C({className:o(ae,Et,ie[s],r)},i))}));Nt.displayName="Overline";var wt=a(lt||(lt=B(["\n font-size: 18px;\n line-height: 24px;\n font-weight: ",";\n"])),w.bold),zt=["darkMode","className","as"],St=g((function(n){var t=n.darkMode,r=n.className,a=n.as,l=void 0===a?"h6":a,i=L(n,zt),s=c(t).theme,d=b(l).Component;return e.createElement(d,C({className:o(ae,wt,ie[s],r)},i))}));St.displayName="Subtitle";var Ft,Ot,Dt,Mt,jt,Ct,Lt,Bt,Ht,At,It,Pt,Tt=["as","children","maxFontWeight","pseudoElement","className"],Wt=function(e){var n=e.pseudoElement,t=e.maxFontWeight,r="&:".concat(n);return a(Ft||(Ft=B(["\n /* Inherit relevant properties from the parent */\n font-weight: inherit;\n font-size: inherit;\n\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n\n position: relative;\n display: inline-flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n text-decoration: none;\n min-width: 0;\n max-width: 100%;\n\n "," {\n content: attr(data-text);\n height: 0;\n font-weight: ",";\n visibility: hidden;\n overflow: hidden;\n user-select: none;\n pointer-events: none;\n }\n "])),r,t)},Rt=a(Ot||(Ot=B(["\n flex: 1;\n min-width: 0;\n max-width: 100%;\n\n white-space: inherit;\n overflow: inherit;\n text-overflow: inherit;\n"])));function Ut(n){var t=n.as,r=n.children,a=n.maxFontWeight,l=void 0===a?700:a,i=n.pseudoElement,s=void 0===i?"after":i,c=n.className,d=L(n,Tt),m=h(r);return e.createElement(x,C({className:o(Wt({pseudoElement:s,maxFontWeight:l}),c),as:null!=t?t:"span","data-text":m},d),e.createElement("span",{className:Rt},r))}var _t=a(Dt||(Dt=B(["\n padding: 0;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n gap: 10px;\n"]))),Kt=a(Mt||(Mt=B(["\n display: block;\n"]))),$t=a(jt||(jt=B(["\n display: flex;\n gap: 8px;\n"]))),qt=p({title:"Components/Typography",parameters:{default:"AllTypography",controls:{exclude:["className"]}}}),Gt=function(n){var t=n.baseFontSize,r=n.darkMode;return e.createElement(i,{baseFontSize:t,darkMode:r},e.createElement("div",{className:o(_t)},e.createElement(Ke,null,"Heading 1"),e.createElement(Qe,null,"Heading 2"),e.createElement(hn,null,"Heading 3"),e.createElement(St,null,"Subtitle"),e.createElement("div",{className:o($t)},e.createElement(de,null,"Body"),e.createElement(de,null,e.createElement("strong",null,"Body (Semibold)"))),e.createElement("div",{className:o($t)},e.createElement(de,null,e.createElement("em",null,"Body (Italic)")),e.createElement(de,null,e.createElement("strong",null,e.createElement("em",null,"Body (Semibold Italic)")))),e.createElement("div",{className:o($t)},e.createElement(Sn,null,'"Inline Code"'),e.createElement(Sn,{href:"https://mongodb.github.io/leafygreen-ui/?path=/story/*"},'"Inline Code Link"')),e.createElement("div",{className:o($t)},e.createElement(xt,{href:"http://localhost:9001",arrowAppearance:"hover"},"Local (Arrow on Hover)"),e.createElement(xt,{href:"http://localhost:9001",arrowAppearance:"none"},"Local (No Arrow)"),e.createElement(xt,{href:"?path=/story/button--icon-only",arrowAppearance:"persist"},"Internal (Persist Arrow)"),e.createElement(xt,{href:"https://mongodb.github.io/leafygreen-ui/?path=/story/*"},"External")),e.createElement("div",{className:Kt},e.createElement(Wn,null,"CTRL"),e.createElement("code",null," + "),e.createElement(Wn,null,"C")),e.createElement(Nt,{className:Kt},"Overline"),e.createElement(Oe,{className:Kt},"Disclaimer"),e.createElement(We,null,"Hello I am an Error!"),e.createElement("div",{className:o(Kt)},e.createElement(at,{htmlFor:"id"},"This is a label"),e.createElement(xe,null,"This is the description for said label"))))};Gt.argTypes={baseFontSize:M(M({},u.baseFontSize),{},{description:"Storybook prop only. This font size is passed into the LeafygreenProvider."}),darkMode:u.darkMode};var Jt=function(){var n=a(Ct||(Ct=B(["\n font-weight: 400;\n cursor: pointer;\n outline: 1px solid ",";\n outline-offset: -1px;\n\n &:hover {\n font-weight: 700;\n }\n "])),f.red.light2),t=a(Lt||(Lt=B(["\n outline: 1px solid ",";\n padding: 10px;\n width: max-content;\n max-width: 200px;\n "])),f.blue.light1),r=a(Bt||(Bt=B(["\n outline: 1px solid gray;\n padding: 10px;\n width: max-content;\n max-width: 148px;\n display: flex;\n align-items: center;\n "])));return e.createElement("div",{className:a(Ht||(Ht=B(["\n position: absolute;\n top: 0;\n left: 0;\n margin: 20px;\n "])))},e.createElement("div",{className:a(At||(At=B(["\n display: flex;\n "])))},e.createElement("div",{className:t},e.createElement(Ut,{className:n},"Some Tabs")),e.createElement("div",{className:t},e.createElement(Ut,{className:o(n,a(It||(It=B(["\n flex: 1;\n "]))))},"Some long text that will be truncated eventually because its long")),e.createElement("div",{className:t},e.createElement(Ut,{className:n},"Some more text"))),e.createElement("br",null),e.createElement("div",{className:o(n,r)},e.createElement(Ut,null,"Some button"),e.createElement(l,{glyph:"CaretDown"})),e.createElement("br",null),e.createElement("div",{className:o(n,r)},e.createElement(Ut,{className:o(a(Pt||(Pt=B(["\n flex: 1;\n "]))))},"Some long text button that should be truncated"),e.createElement(l,{glyph:"CaretDown"})))};export{Gt as AllTypography,Jt as StaticWidthTextStory,qt as default}; |
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
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 too big to display
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
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
494961
0
8386
Updated@leafygreen-ui/icon@^11.14.0
Updated@leafygreen-ui/tokens@^2.1.0