@goodhood-web/ui 2.1.0-development.4 → 2.1.0-development.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js
CHANGED
|
@@ -61,7 +61,7 @@ Valid keys: `+JSON.stringify(Object.keys(re),null," "));var fe=ze(we,Ee,Le,Pe,k
|
|
|
61
61
|
top: ${d}px !important;
|
|
62
62
|
left: ${p}px !important;
|
|
63
63
|
}
|
|
64
|
-
`),()=>{document.head.removeChild(y)}},[e]),A.jsx(x9,{isPresent:e,childRef:r,sizeRef:i,children:b.cloneElement(t,{ref:r})})}const C9=({children:t,initial:e,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:l})=>{const f=qh(k9),d=L.useId(),p=L.useMemo(()=>({id:d,initial:e,isPresent:n,custom:i,onExitComplete:y=>{f.set(y,!0);for(const m of f.values())if(!m)return;r&&r()},register:y=>(f.set(y,!1),()=>f.delete(y))}),a?[Math.random()]:[n]);return L.useMemo(()=>{f.forEach((y,m)=>f.set(m,!1))},[n]),b.useEffect(()=>{!n&&!f.size&&r&&r()},[n]),l==="popLayout"&&(t=A.jsx(_9,{isPresent:n,children:t})),A.jsx(Xu.Provider,{value:p,children:t})};function k9(){return new Map}const Gc=t=>t.key||"";function s0(t){const e=[];return L.Children.forEach(t,n=>{L.isValidElement(n)&&e.push(n)}),e}const S9=({children:t,exitBeforeEnter:e,custom:n,initial:r=!0,onExitComplete:i,presenceAffectsLayout:a=!0,mode:l="sync"})=>{vo(!e,"Replace exitBeforeEnter with mode='wait'");const f=L.useMemo(()=>s0(t),[t]),d=f.map(Gc),p=L.useRef(!0),y=L.useRef(f),m=qh(()=>new Map),[k,T]=L.useState(f),[P,B]=L.useState(f);I2(()=>{p.current=!1,y.current=f;for(let V=0;V<P.length;V++){const j=Gc(P[V]);d.includes(j)?m.delete(j):m.get(j)!==!0&&m.set(j,!1)}},[P,d.length,d.join("-")]);const I=[];if(f!==k){let V=[...f];for(let j=0;j<P.length;j++){const H=P[j],$=Gc(H);d.includes($)||(V.splice(j,0,H),I.push(H))}l==="wait"&&I.length&&(V=I),B(s0(V)),T(f);return}process.env.NODE_ENV!=="production"&&l==="wait"&&P.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:M}=L.useContext(Nh);return A.jsx(A.Fragment,{children:P.map(V=>{const j=Gc(V),H=f===P||d.includes(j),$=()=>{if(m.has(j))m.set(j,!0);else return;let Y=!0;m.forEach(J=>{J||(Y=!1)}),Y&&(M==null||M(),B(y.current),i&&i())};return A.jsx(C9,{isPresent:H,initial:!p.current||r?void 0:!1,custom:H?void 0:n,presenceAffectsLayout:a,mode:l,onExitComplete:H?void 0:$,children:V},j)})})},E9="_tooltip_16xd4_120",T9="_container_16xd4_170",ml={tooltip:E9,"tooltip--top":"_tooltip--top_16xd4_137","tooltip--bottom":"_tooltip--bottom_16xd4_145","tooltip--hasPointer":"_tooltip--hasPointer_16xd4_153","tooltip--hasPointer-top":"_tooltip--hasPointer-top_16xd4_163","tooltip--hasPointer-bottom":"_tooltip--hasPointer-bottom_16xd4_166",container:T9},R9=({children:t,className:e,hasPointer:n=!1,id:r,position:i="top",text:a})=>{const[l,f]=L.useState(!1),[d,p]=L.useState(i),y=L.useRef(null),m=L.useRef(null),k=()=>{var $,Y,J;const T=($=m.current)==null?void 0:$.getClientRects()[0],P=(J=(Y=y.current)==null?void 0:Y.getClientRects()[0])==null?void 0:J.height;if(!T||!P)return;const{bottom:B,top:I}=T,M=i==="top",V=i==="bottom",j=I-P,H=B-P;p(M&&j>=0?"top":V&&H>=0||M?"bottom":"top")};return L.useEffect(()=>{l&&k()},[l]),A.jsxs("div",{className:ml.container,ref:m,children:[A.jsx("div",{onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),onFocus:()=>f(!0),onBlur:()=>f(!1),children:t}),A.jsx(S9,{children:l&&A.jsx(w9.div,{ref:y,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{delay:.2},role:"tooltip",id:r,"aria-hidden":!0,className:pe(ml.tooltip,ml[`tooltip--${d}`],e,{[ml["tooltip--hasPointer"]]:n,[ml[`tooltip--hasPointer-${d}`]]:n}),children:typeof a=="string"?A.jsx(Fe,{type:"detail-medium",children:a}):a})})]})},P9="_primaryButton_3e8rl_120",gl={primaryButton:P9,"primaryButton--fullWidth":"_primaryButton--fullWidth_3e8rl_129","primaryButton--extraLarge":"_primaryButton--extraLarge_3e8rl_132","primaryButton--large":"_primaryButton--large_3e8rl_137","primaryButton--medium":"_primaryButton--medium_3e8rl_142","primaryButton--small":"_primaryButton--small_3e8rl_142","primaryButton--highlight":"_primaryButton--highlight_3e8rl_147","primaryButton--primary":"_primaryButton--primary_3e8rl_153","primaryButton--transparent":"_primaryButton--transparent_3e8rl_159","primaryButton--loading":"_primaryButton--loading_3e8rl_167"},G2=({children:t,className:e,color:n="primary",disabled:r,fullWidth:i,leftIcon:a,loading:l,rightIcon:f,size:d="extraLarge",text:p,...y})=>{const m=ar(a,[rt]),k=ar(f,[rt]),T=gl[`primaryButton--${n}`],P=gl[`primaryButton--${d}`],B={extraLarge:"h5",large:"h5",medium:"body-semibold",small:"detail-medium"};return A.jsxs(Qt,{...y,disabled:r,className:pe(gl.primaryButton,T,P,e,{[gl["primaryButton--loading"]]:l,[gl["primaryButton--fullWidth"]]:i}),children:[m,p&&A.jsx(Fe,{type:B[d],as:"span",children:p}),t,k]})},M9="_secondaryButton_195if_120",vl={secondaryButton:M9,"secondaryButton--fullWidth":"_secondaryButton--fullWidth_195if_132","secondaryButton--large":"_secondaryButton--large_195if_135","secondaryButton--medium":"_secondaryButton--medium_195if_140","secondaryButton--small":"_secondaryButton--small_195if_140","secondaryButton--green":"_secondaryButton--green_195if_145","secondaryButton--pink":"_secondaryButton--pink_195if_151","secondaryButton--grey":"_secondaryButton--grey_195if_159","secondaryButton--teal":"_secondaryButton--teal_195if_165","secondaryButton--lavender":"_secondaryButton--lavender_195if_171","secondaryButton--orange":"_secondaryButton--orange_195if_178","secondaryButton--loading":"_secondaryButton--loading_195if_184"},Y2=({children:t,className:e,color:n="green",disabled:r,fullWidth:i,leftIcon:a,loading:l,rightIcon:f,size:d="extraLarge",text:p,...y})=>{const m=ar(a,[rt]),k=ar(f,[rt]),T=vl[`secondaryButton--${n}`],P=vl[`secondaryButton--${d}`],B={extraLarge:"h5",large:"h5",medium:"body-semibold",small:"detail-medium"};return A.jsxs(Qt,{...y,disabled:r,className:pe(vl.secondaryButton,T,P,e,{[vl["secondaryButton--loading"]]:l,[vl["secondaryButton--fullWidth"]]:i}),children:[m,p&&A.jsx(Fe,{type:B[d],as:"span",children:p}),t,k]})},A9="_tertiaryButton_1asmh_120",yl={tertiaryButton:A9,"tertiaryButton--fullWidth":"_tertiaryButton--fullWidth_1asmh_133","tertiaryButton--large":"_tertiaryButton--large_1asmh_136","tertiaryButton--medium":"_tertiaryButton--medium_1asmh_141","tertiaryButton--small":"_tertiaryButton--small_1asmh_141","tertiaryButton--green":"_tertiaryButton--green_1asmh_146","tertiaryButton--pink":"_tertiaryButton--pink_1asmh_158","tertiaryButton--blue":"_tertiaryButton--blue_1asmh_170","tertiaryButton--deepPurple":"_tertiaryButton--deepPurple_1asmh_182","tertiaryButton--loading":"_tertiaryButton--loading_1asmh_194"},Kh=({children:t,className:e,color:n="green",disabled:r,fullWidth:i,leftIcon:a,loading:l,rightIcon:f,size:d="extraLarge",text:p,...y})=>{const m=ar(a,[rt]),k=ar(f,[rt]),T=yl[`tertiaryButton--${n}`],P=yl[`tertiaryButton--${d}`],B={extraLarge:"h5",large:"h5",medium:"body-semibold",small:"detail-medium"};return A.jsxs(Qt,{...y,disabled:r,className:pe(yl.tertiaryButton,T,P,e,{[yl["tertiaryButton--loading"]]:l,[yl["tertiaryButton--fullWidth"]]:i}),children:[m,p&&A.jsx(Fe,{type:B[d],as:"span",children:p}),t,k]})};function I9(){const[t,e]=L.useState(!1);return[t,r=>{navigator.clipboard.writeText(r).then(()=>{e(!0),setTimeout(()=>e(!1),2e3)}).catch(i=>{console.error("Failed to copy text: ",i)})}]}const L9="_root_1ydja_120",D9="_root__label_1ydja_130",Ef={root:L9,root__label:D9,"root--filled":"_root--filled_1ydja_139","root--outline":"_root--outline_1ydja_149"},F9=({ariaLabel:t,iconSize:e="32",link:n,onClick:r,style:i="filled"})=>{const[a,l]=I9();L.useEffect(()=>{a&&r()},[a,r]);const f=()=>{l(n)};return A.jsxs(Qt,{className:pe(Ef.root,Ef[`root--${i}`]),onClick:f,ariaLabel:t,disabled:a,children:[A.jsx(Fe,{type:"body-large",className:Ef.root__label,children:n}),A.jsx(rt,{name:"copy",size:e})]})},B9="_iconButton_gbjr7_120",Yc={iconButton:B9,"iconButton--loading":"_iconButton--loading_gbjr7_152","iconButton--small":"_iconButton--small_gbjr7_158","iconButton--medium":"_iconButton--medium_gbjr7_162","iconButton--large":"_iconButton--large_gbjr7_166","iconButton--green":"_iconButton--green_gbjr7_170","iconButton--white":"_iconButton--white_gbjr7_191"},O9=t=>t==="small"?"24":"32",Qo=({className:t,icon:e,iconClassName:n,loading:r,size:i="medium",variant:a,...l})=>{const f=O9(i);return A.jsx(Qt,{...l,className:pe(Yc.iconButton,t,{[Yc["iconButton--loading"]]:r,[Yc[`iconButton--${a}`]]:a,[Yc[`iconButton--${i}`]]:a}),children:A.jsx(rt,{size:f,name:e,className:n})})},V9="_button_9zk5b_120",j9="_button__icon_9zk5b_128",Xc={button:V9,"button--selected":"_button--selected_9zk5b_125",button__icon:j9,"button__icon--selected":"_button__icon--selected_9zk5b_131"};function X2({iconSelected:t,iconUnselected:e,selected:n,...r}){const i=pe(Xc.button__icon,{[Xc["button__icon--selected"]]:n});return A.jsx(Qt,{...r,className:pe(Xc.button,{[Xc["button--selected"]]:n},r.className),children:A.jsx(rt,{className:i,size:"24",name:n?t:e})})}const N9="_feedTile_6bet6_120",$9="_feedTile__icon_6bet6_133",bl={feedTile:N9,feedTile__icon:$9,"feedTile--fullWidth":"_feedTile--fullWidth_6bet6_157"},W9=({fullWidth:t,icon:e,onClick:n,text:r})=>A.jsxs(Qt,{onClick:n,className:pe(bl.feedTile,{[bl["feedTile--fullWidth"]]:t}),children:[A.jsx(rt,{className:bl.feedTile__icon,name:e}),typeof r=="string"?A.jsx(Fe,{type:"body-regular",className:bl.feedTile__text,children:r}):A.jsx("span",{className:bl.feedTile__text,children:r})]}),H9="_menuTile_ufhng_120",U9="_menuTile__value_ufhng_140",Kc={menuTile:H9,"menuTile--fullWidth":"_menuTile--fullWidth_ufhng_133","menuTile--icon":"_menuTile--icon_ufhng_136",menuTile__value:U9},z9=({fullWidth:t=!1,icon:e,primaryText:n,secondaryText:r,...i})=>A.jsxs(Qt,{...i,className:pe(Kc.menuTile,{[Kc["menuTile--icon"]]:e,[Kc["menuTile--fullWidth"]]:t}),children:[e&&A.jsx(rt,{name:e}),n&&A.jsx(Fe,{type:"detail-bold",className:Kc.menuTile__value,children:n}),r&&A.jsx(Fe,{type:"detail-medium",children:r})]});var q9="Expected a function",a0=NaN,Z9="[object Symbol]",G9=/^\s+|\s+$/g,Y9=/^[-+]0x[0-9a-f]+$/i,X9=/^0b[01]+$/i,K9=/^0o[0-7]+$/i,J9=parseInt,Q9=typeof ra=="object"&&ra&&ra.Object===Object&&ra,e8=typeof self=="object"&&self&&self.Object===Object&&self,t8=Q9||e8||Function("return this")(),n8=Object.prototype,r8=n8.toString,o8=Math.max,i8=Math.min,Tf=function(){return t8.Date.now()};function s8(t,e,n){var r,i,a,l,f,d,p=0,y=!1,m=!1,k=!0;if(typeof t!="function")throw new TypeError(q9);e=l0(e)||0,nh(n)&&(y=!!n.leading,m="maxWait"in n,a=m?o8(l0(n.maxWait)||0,e):a,k="trailing"in n?!!n.trailing:k);function T(Y){var J=r,K=i;return r=i=void 0,p=Y,l=t.apply(K,J),l}function P(Y){return p=Y,f=setTimeout(M,e),y?T(Y):l}function B(Y){var J=Y-d,K=Y-p,le=e-J;return m?i8(le,a-K):le}function I(Y){var J=Y-d,K=Y-p;return d===void 0||J>=e||J<0||m&&K>=a}function M(){var Y=Tf();if(I(Y))return V(Y);f=setTimeout(M,B(Y))}function V(Y){return f=void 0,k&&r?T(Y):(r=i=void 0,l)}function j(){f!==void 0&&clearTimeout(f),p=0,r=d=i=f=void 0}function H(){return f===void 0?l:V(Tf())}function $(){var Y=Tf(),J=I(Y);if(r=arguments,i=this,d=Y,J){if(f===void 0)return P(d);if(m)return f=setTimeout(M,e),T(d)}return f===void 0&&(f=setTimeout(M,e)),l}return $.cancel=j,$.flush=H,$}function nh(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function a8(t){return!!t&&typeof t=="object"}function l8(t){return typeof t=="symbol"||a8(t)&&r8.call(t)==Z9}function l0(t){if(typeof t=="number")return t;if(l8(t))return a0;if(nh(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=nh(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(G9,"");var n=X9.test(t);return n||K9.test(t)?J9(t.slice(2),n?2:8):Y9.test(t)?a0:+t}var c8=s8;const u8=D0(c8);function d8(t,{lines:e}){let[n,r]=L.useState(!0);return L.useEffect(()=>{let i=()=>{if(!t.current)return;let l={webkitLineClamp:t.current.style.webkitLineClamp,display:t.current.style.display,webkitBoxOrient:t.current.style.webkitBoxOrient,overflow:t.current.style.overflow};t.current.style.webkitLineClamp=e.toString(),t.current.style.display="-webkit-box",t.current.style.webkitBoxOrient="vertical",t.current.style.overflow="hidden",r(t.current.clientHeight!==t.current.scrollHeight),t.current.style.webkitLineClamp=l.webkitLineClamp,t.current.style.display=l.display,t.current.style.webkitBoxOrient=l.webkitBoxOrient,t.current.style.overflow=l.overflow},a=u8(i,50);return i(),window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)},[t]),n}const f8="_bodyText_1rmu0_120",h8="_bodyText__textButton_1rmu0_147",p8="_bodyText__showMore_1rmu0_158",Uo={bodyText:f8,"bodyText--notClickable":"_bodyText--notClickable_1rmu0_125","bodyText--post":"_bodyText--post_1rmu0_128","bodyText--modal":"_bodyText--modal_1rmu0_132","bodyText__text--collapsed":"_bodyText__text--collapsed_1rmu0_139",bodyText__textButton:h8,bodyText__showMore:p8};var Li={};/**
|
|
64
|
+
`),()=>{document.head.removeChild(y)}},[e]),A.jsx(x9,{isPresent:e,childRef:r,sizeRef:i,children:b.cloneElement(t,{ref:r})})}const C9=({children:t,initial:e,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:l})=>{const f=qh(k9),d=L.useId(),p=L.useMemo(()=>({id:d,initial:e,isPresent:n,custom:i,onExitComplete:y=>{f.set(y,!0);for(const m of f.values())if(!m)return;r&&r()},register:y=>(f.set(y,!1),()=>f.delete(y))}),a?[Math.random()]:[n]);return L.useMemo(()=>{f.forEach((y,m)=>f.set(m,!1))},[n]),b.useEffect(()=>{!n&&!f.size&&r&&r()},[n]),l==="popLayout"&&(t=A.jsx(_9,{isPresent:n,children:t})),A.jsx(Xu.Provider,{value:p,children:t})};function k9(){return new Map}const Gc=t=>t.key||"";function s0(t){const e=[];return L.Children.forEach(t,n=>{L.isValidElement(n)&&e.push(n)}),e}const S9=({children:t,exitBeforeEnter:e,custom:n,initial:r=!0,onExitComplete:i,presenceAffectsLayout:a=!0,mode:l="sync"})=>{vo(!e,"Replace exitBeforeEnter with mode='wait'");const f=L.useMemo(()=>s0(t),[t]),d=f.map(Gc),p=L.useRef(!0),y=L.useRef(f),m=qh(()=>new Map),[k,T]=L.useState(f),[P,B]=L.useState(f);I2(()=>{p.current=!1,y.current=f;for(let V=0;V<P.length;V++){const j=Gc(P[V]);d.includes(j)?m.delete(j):m.get(j)!==!0&&m.set(j,!1)}},[P,d.length,d.join("-")]);const I=[];if(f!==k){let V=[...f];for(let j=0;j<P.length;j++){const H=P[j],$=Gc(H);d.includes($)||(V.splice(j,0,H),I.push(H))}l==="wait"&&I.length&&(V=I),B(s0(V)),T(f);return}process.env.NODE_ENV!=="production"&&l==="wait"&&P.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:M}=L.useContext(Nh);return A.jsx(A.Fragment,{children:P.map(V=>{const j=Gc(V),H=f===P||d.includes(j),$=()=>{if(m.has(j))m.set(j,!0);else return;let Y=!0;m.forEach(J=>{J||(Y=!1)}),Y&&(M==null||M(),B(y.current),i&&i())};return A.jsx(C9,{isPresent:H,initial:!p.current||r?void 0:!1,custom:H?void 0:n,presenceAffectsLayout:a,mode:l,onExitComplete:H?void 0:$,children:V},j)})})},E9="_tooltip_16xd4_120",T9="_container_16xd4_170",ml={tooltip:E9,"tooltip--top":"_tooltip--top_16xd4_137","tooltip--bottom":"_tooltip--bottom_16xd4_145","tooltip--hasPointer":"_tooltip--hasPointer_16xd4_153","tooltip--hasPointer-top":"_tooltip--hasPointer-top_16xd4_163","tooltip--hasPointer-bottom":"_tooltip--hasPointer-bottom_16xd4_166",container:T9},R9=({children:t,className:e,hasPointer:n=!1,id:r,position:i="top",showTooltip:a,text:l})=>{const[f,d]=L.useState(!1),[p,y]=L.useState(i),m=L.useRef(null),k=L.useRef(null),T=()=>{var Y,J,K;const P=(Y=k.current)==null?void 0:Y.getClientRects()[0],B=(K=(J=m.current)==null?void 0:J.getClientRects()[0])==null?void 0:K.height;if(!P||!B)return;const{bottom:I,top:M}=P,V=i==="top",j=i==="bottom",H=M-B,$=I-B;y(V&&H>=0?"top":j&&$>=0||V?"bottom":"top")};return L.useEffect(()=>{(f||a)&&T()},[f,a]),A.jsxs("div",{className:ml.container,ref:k,children:[A.jsx("div",{onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),onFocus:()=>d(!0),onBlur:()=>d(!1),children:t}),A.jsx(S9,{children:(f||a)&&A.jsx(w9.div,{ref:m,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{delay:.2},role:"tooltip",id:r,"aria-hidden":!0,className:pe(ml.tooltip,ml[`tooltip--${p}`],e,{[ml["tooltip--hasPointer"]]:n,[ml[`tooltip--hasPointer-${p}`]]:n}),children:typeof l=="string"?A.jsx(Fe,{type:"detail-medium",children:l}):l})})]})},P9="_primaryButton_3e8rl_120",gl={primaryButton:P9,"primaryButton--fullWidth":"_primaryButton--fullWidth_3e8rl_129","primaryButton--extraLarge":"_primaryButton--extraLarge_3e8rl_132","primaryButton--large":"_primaryButton--large_3e8rl_137","primaryButton--medium":"_primaryButton--medium_3e8rl_142","primaryButton--small":"_primaryButton--small_3e8rl_142","primaryButton--highlight":"_primaryButton--highlight_3e8rl_147","primaryButton--primary":"_primaryButton--primary_3e8rl_153","primaryButton--transparent":"_primaryButton--transparent_3e8rl_159","primaryButton--loading":"_primaryButton--loading_3e8rl_167"},G2=({children:t,className:e,color:n="primary",disabled:r,fullWidth:i,leftIcon:a,loading:l,rightIcon:f,size:d="extraLarge",text:p,...y})=>{const m=ar(a,[rt]),k=ar(f,[rt]),T=gl[`primaryButton--${n}`],P=gl[`primaryButton--${d}`],B={extraLarge:"h5",large:"h5",medium:"body-semibold",small:"detail-medium"};return A.jsxs(Qt,{...y,disabled:r,className:pe(gl.primaryButton,T,P,e,{[gl["primaryButton--loading"]]:l,[gl["primaryButton--fullWidth"]]:i}),children:[m,p&&A.jsx(Fe,{type:B[d],as:"span",children:p}),t,k]})},M9="_secondaryButton_195if_120",vl={secondaryButton:M9,"secondaryButton--fullWidth":"_secondaryButton--fullWidth_195if_132","secondaryButton--large":"_secondaryButton--large_195if_135","secondaryButton--medium":"_secondaryButton--medium_195if_140","secondaryButton--small":"_secondaryButton--small_195if_140","secondaryButton--green":"_secondaryButton--green_195if_145","secondaryButton--pink":"_secondaryButton--pink_195if_151","secondaryButton--grey":"_secondaryButton--grey_195if_159","secondaryButton--teal":"_secondaryButton--teal_195if_165","secondaryButton--lavender":"_secondaryButton--lavender_195if_171","secondaryButton--orange":"_secondaryButton--orange_195if_178","secondaryButton--loading":"_secondaryButton--loading_195if_184"},Y2=({children:t,className:e,color:n="green",disabled:r,fullWidth:i,leftIcon:a,loading:l,rightIcon:f,size:d="extraLarge",text:p,...y})=>{const m=ar(a,[rt]),k=ar(f,[rt]),T=vl[`secondaryButton--${n}`],P=vl[`secondaryButton--${d}`],B={extraLarge:"h5",large:"h5",medium:"body-semibold",small:"detail-medium"};return A.jsxs(Qt,{...y,disabled:r,className:pe(vl.secondaryButton,T,P,e,{[vl["secondaryButton--loading"]]:l,[vl["secondaryButton--fullWidth"]]:i}),children:[m,p&&A.jsx(Fe,{type:B[d],as:"span",children:p}),t,k]})},A9="_tertiaryButton_1asmh_120",yl={tertiaryButton:A9,"tertiaryButton--fullWidth":"_tertiaryButton--fullWidth_1asmh_133","tertiaryButton--large":"_tertiaryButton--large_1asmh_136","tertiaryButton--medium":"_tertiaryButton--medium_1asmh_141","tertiaryButton--small":"_tertiaryButton--small_1asmh_141","tertiaryButton--green":"_tertiaryButton--green_1asmh_146","tertiaryButton--pink":"_tertiaryButton--pink_1asmh_158","tertiaryButton--blue":"_tertiaryButton--blue_1asmh_170","tertiaryButton--deepPurple":"_tertiaryButton--deepPurple_1asmh_182","tertiaryButton--loading":"_tertiaryButton--loading_1asmh_194"},Kh=({children:t,className:e,color:n="green",disabled:r,fullWidth:i,leftIcon:a,loading:l,rightIcon:f,size:d="extraLarge",text:p,...y})=>{const m=ar(a,[rt]),k=ar(f,[rt]),T=yl[`tertiaryButton--${n}`],P=yl[`tertiaryButton--${d}`],B={extraLarge:"h5",large:"h5",medium:"body-semibold",small:"detail-medium"};return A.jsxs(Qt,{...y,disabled:r,className:pe(yl.tertiaryButton,T,P,e,{[yl["tertiaryButton--loading"]]:l,[yl["tertiaryButton--fullWidth"]]:i}),children:[m,p&&A.jsx(Fe,{type:B[d],as:"span",children:p}),t,k]})};function I9(){const[t,e]=L.useState(!1);return[t,r=>{navigator.clipboard.writeText(r).then(()=>{e(!0),setTimeout(()=>e(!1),2e3)}).catch(i=>{console.error("Failed to copy text: ",i)})}]}const L9="_root_1ydja_120",D9="_root__label_1ydja_130",Ef={root:L9,root__label:D9,"root--filled":"_root--filled_1ydja_139","root--outline":"_root--outline_1ydja_149"},F9=({ariaLabel:t,iconSize:e="32",link:n,onClick:r,style:i="filled"})=>{const[a,l]=I9();L.useEffect(()=>{a&&r()},[a,r]);const f=()=>{l(n)};return A.jsxs(Qt,{className:pe(Ef.root,Ef[`root--${i}`]),onClick:f,ariaLabel:t,disabled:a,children:[A.jsx(Fe,{type:"body-large",className:Ef.root__label,children:n}),A.jsx(rt,{name:"copy",size:e})]})},B9="_iconButton_gbjr7_120",Yc={iconButton:B9,"iconButton--loading":"_iconButton--loading_gbjr7_152","iconButton--small":"_iconButton--small_gbjr7_158","iconButton--medium":"_iconButton--medium_gbjr7_162","iconButton--large":"_iconButton--large_gbjr7_166","iconButton--green":"_iconButton--green_gbjr7_170","iconButton--white":"_iconButton--white_gbjr7_191"},O9=t=>t==="small"?"24":"32",Qo=({className:t,icon:e,iconClassName:n,loading:r,size:i="medium",variant:a,...l})=>{const f=O9(i);return A.jsx(Qt,{...l,className:pe(Yc.iconButton,t,{[Yc["iconButton--loading"]]:r,[Yc[`iconButton--${a}`]]:a,[Yc[`iconButton--${i}`]]:a}),children:A.jsx(rt,{size:f,name:e,className:n})})},V9="_button_9zk5b_120",j9="_button__icon_9zk5b_128",Xc={button:V9,"button--selected":"_button--selected_9zk5b_125",button__icon:j9,"button__icon--selected":"_button__icon--selected_9zk5b_131"};function X2({iconSelected:t,iconUnselected:e,selected:n,...r}){const i=pe(Xc.button__icon,{[Xc["button__icon--selected"]]:n});return A.jsx(Qt,{...r,className:pe(Xc.button,{[Xc["button--selected"]]:n},r.className),children:A.jsx(rt,{className:i,size:"24",name:n?t:e})})}const N9="_feedTile_6bet6_120",$9="_feedTile__icon_6bet6_133",bl={feedTile:N9,feedTile__icon:$9,"feedTile--fullWidth":"_feedTile--fullWidth_6bet6_157"},W9=({fullWidth:t,icon:e,onClick:n,text:r})=>A.jsxs(Qt,{onClick:n,className:pe(bl.feedTile,{[bl["feedTile--fullWidth"]]:t}),children:[A.jsx(rt,{className:bl.feedTile__icon,name:e}),typeof r=="string"?A.jsx(Fe,{type:"body-regular",className:bl.feedTile__text,children:r}):A.jsx("span",{className:bl.feedTile__text,children:r})]}),H9="_menuTile_ufhng_120",U9="_menuTile__value_ufhng_140",Kc={menuTile:H9,"menuTile--fullWidth":"_menuTile--fullWidth_ufhng_133","menuTile--icon":"_menuTile--icon_ufhng_136",menuTile__value:U9},z9=({fullWidth:t=!1,icon:e,primaryText:n,secondaryText:r,...i})=>A.jsxs(Qt,{...i,className:pe(Kc.menuTile,{[Kc["menuTile--icon"]]:e,[Kc["menuTile--fullWidth"]]:t}),children:[e&&A.jsx(rt,{name:e}),n&&A.jsx(Fe,{type:"detail-bold",className:Kc.menuTile__value,children:n}),r&&A.jsx(Fe,{type:"detail-medium",children:r})]});var q9="Expected a function",a0=NaN,Z9="[object Symbol]",G9=/^\s+|\s+$/g,Y9=/^[-+]0x[0-9a-f]+$/i,X9=/^0b[01]+$/i,K9=/^0o[0-7]+$/i,J9=parseInt,Q9=typeof ra=="object"&&ra&&ra.Object===Object&&ra,e8=typeof self=="object"&&self&&self.Object===Object&&self,t8=Q9||e8||Function("return this")(),n8=Object.prototype,r8=n8.toString,o8=Math.max,i8=Math.min,Tf=function(){return t8.Date.now()};function s8(t,e,n){var r,i,a,l,f,d,p=0,y=!1,m=!1,k=!0;if(typeof t!="function")throw new TypeError(q9);e=l0(e)||0,nh(n)&&(y=!!n.leading,m="maxWait"in n,a=m?o8(l0(n.maxWait)||0,e):a,k="trailing"in n?!!n.trailing:k);function T(Y){var J=r,K=i;return r=i=void 0,p=Y,l=t.apply(K,J),l}function P(Y){return p=Y,f=setTimeout(M,e),y?T(Y):l}function B(Y){var J=Y-d,K=Y-p,le=e-J;return m?i8(le,a-K):le}function I(Y){var J=Y-d,K=Y-p;return d===void 0||J>=e||J<0||m&&K>=a}function M(){var Y=Tf();if(I(Y))return V(Y);f=setTimeout(M,B(Y))}function V(Y){return f=void 0,k&&r?T(Y):(r=i=void 0,l)}function j(){f!==void 0&&clearTimeout(f),p=0,r=d=i=f=void 0}function H(){return f===void 0?l:V(Tf())}function $(){var Y=Tf(),J=I(Y);if(r=arguments,i=this,d=Y,J){if(f===void 0)return P(d);if(m)return f=setTimeout(M,e),T(d)}return f===void 0&&(f=setTimeout(M,e)),l}return $.cancel=j,$.flush=H,$}function nh(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function a8(t){return!!t&&typeof t=="object"}function l8(t){return typeof t=="symbol"||a8(t)&&r8.call(t)==Z9}function l0(t){if(typeof t=="number")return t;if(l8(t))return a0;if(nh(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=nh(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(G9,"");var n=X9.test(t);return n||K9.test(t)?J9(t.slice(2),n?2:8):Y9.test(t)?a0:+t}var c8=s8;const u8=D0(c8);function d8(t,{lines:e}){let[n,r]=L.useState(!0);return L.useEffect(()=>{let i=()=>{if(!t.current)return;let l={webkitLineClamp:t.current.style.webkitLineClamp,display:t.current.style.display,webkitBoxOrient:t.current.style.webkitBoxOrient,overflow:t.current.style.overflow};t.current.style.webkitLineClamp=e.toString(),t.current.style.display="-webkit-box",t.current.style.webkitBoxOrient="vertical",t.current.style.overflow="hidden",r(t.current.clientHeight!==t.current.scrollHeight),t.current.style.webkitLineClamp=l.webkitLineClamp,t.current.style.display=l.display,t.current.style.webkitBoxOrient=l.webkitBoxOrient,t.current.style.overflow=l.overflow},a=u8(i,50);return i(),window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)},[t]),n}const f8="_bodyText_1rmu0_120",h8="_bodyText__textButton_1rmu0_147",p8="_bodyText__showMore_1rmu0_158",Uo={bodyText:f8,"bodyText--notClickable":"_bodyText--notClickable_1rmu0_125","bodyText--post":"_bodyText--post_1rmu0_128","bodyText--modal":"_bodyText--modal_1rmu0_132","bodyText__text--collapsed":"_bodyText__text--collapsed_1rmu0_139",bodyText__textButton:h8,bodyText__showMore:p8};var Li={};/**
|
|
65
65
|
* @license React
|
|
66
66
|
* react-dom-server-legacy.browser.production.min.js
|
|
67
67
|
*
|
package/index.mjs
CHANGED
|
@@ -11022,34 +11022,35 @@ const R9 = ({ children: t, exitBeforeEnter: e, custom: n, initial: r = !0, onExi
|
|
|
11022
11022
|
hasPointer: n = !1,
|
|
11023
11023
|
id: r,
|
|
11024
11024
|
position: i = "top",
|
|
11025
|
-
|
|
11025
|
+
showTooltip: a,
|
|
11026
|
+
text: l
|
|
11026
11027
|
}) => {
|
|
11027
|
-
const [
|
|
11028
|
-
var
|
|
11029
|
-
const
|
|
11030
|
-
if (!
|
|
11031
|
-
const { bottom:
|
|
11032
|
-
|
|
11033
|
-
|
|
11028
|
+
const [f, d] = jn(!1), [p, y] = jn(i), m = ur(null), C = ur(null), T = () => {
|
|
11029
|
+
var Y, J, K;
|
|
11030
|
+
const P = (Y = C.current) == null ? void 0 : Y.getClientRects()[0], F = (K = (J = m.current) == null ? void 0 : J.getClientRects()[0]) == null ? void 0 : K.height;
|
|
11031
|
+
if (!P || !F) return;
|
|
11032
|
+
const { bottom: I, top: M } = P, B = i === "top", V = i === "bottom", W = M - F, N = I - F;
|
|
11033
|
+
y(
|
|
11034
|
+
B && W >= 0 ? "top" : V && N >= 0 || B ? "bottom" : "top"
|
|
11034
11035
|
);
|
|
11035
11036
|
};
|
|
11036
11037
|
return ei(() => {
|
|
11037
|
-
|
|
11038
|
-
}, [
|
|
11038
|
+
(f || a) && T();
|
|
11039
|
+
}, [f, a]), /* @__PURE__ */ A.jsxs("div", { className: _l.container, ref: C, children: [
|
|
11039
11040
|
/* @__PURE__ */ A.jsx(
|
|
11040
11041
|
"div",
|
|
11041
11042
|
{
|
|
11042
|
-
onMouseEnter: () =>
|
|
11043
|
-
onMouseLeave: () =>
|
|
11044
|
-
onFocus: () =>
|
|
11045
|
-
onBlur: () =>
|
|
11043
|
+
onMouseEnter: () => d(!0),
|
|
11044
|
+
onMouseLeave: () => d(!1),
|
|
11045
|
+
onFocus: () => d(!0),
|
|
11046
|
+
onBlur: () => d(!1),
|
|
11046
11047
|
children: t
|
|
11047
11048
|
}
|
|
11048
11049
|
),
|
|
11049
|
-
/* @__PURE__ */ A.jsx(R9, { children:
|
|
11050
|
+
/* @__PURE__ */ A.jsx(R9, { children: (f || a) && /* @__PURE__ */ A.jsx(
|
|
11050
11051
|
k9.div,
|
|
11051
11052
|
{
|
|
11052
|
-
ref:
|
|
11053
|
+
ref: m,
|
|
11053
11054
|
initial: { opacity: 0 },
|
|
11054
11055
|
animate: { opacity: 1 },
|
|
11055
11056
|
exit: { opacity: 0 },
|
|
@@ -11057,11 +11058,11 @@ const R9 = ({ children: t, exitBeforeEnter: e, custom: n, initial: r = !0, onExi
|
|
|
11057
11058
|
role: "tooltip",
|
|
11058
11059
|
id: r,
|
|
11059
11060
|
"aria-hidden": !0,
|
|
11060
|
-
className: pe(_l.tooltip, _l[`tooltip--${
|
|
11061
|
+
className: pe(_l.tooltip, _l[`tooltip--${p}`], e, {
|
|
11061
11062
|
[_l["tooltip--hasPointer"]]: n,
|
|
11062
|
-
[_l[`tooltip--hasPointer-${
|
|
11063
|
+
[_l[`tooltip--hasPointer-${p}`]]: n
|
|
11063
11064
|
}),
|
|
11064
|
-
children: typeof
|
|
11065
|
+
children: typeof l == "string" ? /* @__PURE__ */ A.jsx(Fe, { type: "detail-medium", children: l }) : l
|
|
11065
11066
|
}
|
|
11066
11067
|
) })
|
|
11067
11068
|
] });
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { default as TooltipProps } from './Tooltip.types';
|
|
2
|
-
declare const Tooltip: ({ children, className, hasPointer, id, position, text, }: TooltipProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const Tooltip: ({ children, className, hasPointer, id, position, showTooltip, text, }: TooltipProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default Tooltip;
|