@patterninc/pattern-ui 0.0.0-main.202610270604.4840a5ef50e5 → 0.0.0-main.202610270629.b17c96835fc3
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"../../_chunks/rolldown-runtime-BWaJ3C7D.js";import{d as t,m as n,u as r}from"../../_chunks/transitions-Cn0Tw_ua.js";import{t as i}from"../../_chunks/react-CUaU2Z9V.js";import{t as a}from"../../_chunks/ChevronRightIcon-Dgm8qBR8.js";import{t as o}from"../../_chunks/ArrowRightIcon-OEjQROCT.js";import{t as s}from"../../_chunks/compiler-runtime-B3BlmaWz.js";import{t as c}from"../../_chunks/jsx-runtime-Dgn0yPdi.js";import{t as l}from"../../_chunks/dist-BNSTMZct.js";import{t as u}from"../../_chunks/Prefix-DknizWb3.js";import{n as d}from"../../_chunks/react-CqECE5Y5.js";import{t as f}from"../../_chunks/AnimatePresence-DOl8NYHq.js";import{t as p}from"../../_chunks/use-reduced-motion-CNBdBisf.js";import{t as m}from"../../_chunks/Button-BfpdYdpq.js";import{t as h}from"../../_chunks/button-constants-BRLmyaWg.js";import{i as g}from"../../_chunks/dist-BRMXKypj.js";import{t as _}from"../../_chunks/Avatar-BMklFAjX.js";import{t as v}from"../../_chunks/TextareaField-t1AdxrBG.js";import{t as y}from"../../_chunks/Tag-ORoY16Bh.js";import{t as b}from"../../_chunks/Suffix-DHDwsJuQ.js";import{t as x}from"../../_chunks/Divider-LTM2QzTF.js";import{t as S}from"../../_chunks/CalendarIcon-bZZA4ofp.js";import{t as C}from"../../_chunks/SpeechBubbleIcon-Dfrb59ah.js";import{t as w}from"../../_chunks/Section-OCRRh47S.js";import{t as T}from"../../_chunks/Skeleton-Cgi33Fpd.js";import{t as E}from"../../_chunks/ChevronLeftIcon-DixrWUUO.js";import{t as D}from"../../_chunks/ButtonGroup-B2wKhqwt.js";import{t as O}from"../../_chunks/ThumbsDownAlt-ginNWj6S.js";import{t as k}from"../../_chunks/ThumbsUpAlt-Cz4utpd3.js";import{t as A}from"../../_chunks/StopFillIcon-BHTuKSSq.js";var j=s(),M=/* @__PURE__ */ e(c(),1);function N(e){let i=(0,j.c)(40),{variations:o,variationIndex:s,onVariationChange:c,qaTestId:u}=e,m=s===void 0?0:s,h=u===void 0?`activity-card-variations-carousel`:u,g=p(),_=o.length,v=m<=0,y=m>=_-1,b;i[0]!==v||i[1]!==c||i[2]!==m?(b=()=>!v&&c?.(m-1),i[0]=v,i[1]=c,i[2]=m,i[3]=b):b=i[3];let x=b,S;i[4]!==y||i[5]!==c||i[6]!==m?(S=()=>!y&&c?.(m+1),i[4]=y,i[5]=c,i[6]=m,i[7]=S):S=i[7];let C=S,w=v?`icon-disabled`:`icon-strong`,T;i[8]===w?T=i[9]:(T=/* @__PURE__ */ (0,M.jsx)(E,{color:w,size:20}),i[8]=w,i[9]=T);let D;i[10]!==v||i[11]!==x||i[12]!==T?(D=/* @__PURE__ */ (0,M.jsx)(`button`,{type:`button`,"aria-label":`Previous variation`,onClick:x,disabled:v,className:`flex w-6 shrink-0 items-center justify-center rounded-lg bg-depth-black-4 transition-colors hover:bg-depth-black-8 disabled:cursor-not-allowed disabled:hover:bg-depth-black-4`,children:T}),i[10]=v,i[11]=x,i[12]=T,i[13]=D):D=i[13];let O=g?void 0:t,k;i[14]===Symbol.for(`react.memo_cache_sentinel`)?(k={willChange:`opacity, transform`,transform:`translate3d(0, 0, 0)`,backfaceVisibility:`hidden`},i[14]=k):k=i[14];let A=o[m],N;i[15]!==A||i[16]!==O||i[17]!==m?(N=/* @__PURE__ */ (0,M.jsx)(`div`,{className:`relative flex flex-1 items-center overflow-hidden rounded-xl border border-depth-black-4 bg-base-inverse p-2.5 group-data-[selected]:border-transparent group-data-[selected]:bg-depth-black-4`,children:/* @__PURE__ */ (0,M.jsx)(f,{mode:`popLayout`,initial:!1,children:/* @__PURE__ */ (0,M.jsx)(d.p,{className:`pui-text-body-medium-compact text-text-strong`,variants:O,initial:`enter`,animate:`center`,exit:`exit`,transition:r,style:k,children:A},m)})}),i[15]=A,i[16]=O,i[17]=m,i[18]=N):N=i[18];let F=y?`icon-disabled`:`icon-strong`,I;i[19]===F?I=i[20]:(I=/* @__PURE__ */ (0,M.jsx)(a,{color:F,size:20}),i[19]=F,i[20]=I);let L;i[21]!==y||i[22]!==C||i[23]!==I?(L=/* @__PURE__ */ (0,M.jsx)(`button`,{type:`button`,"aria-label":`Next variation`,onClick:C,disabled:y,className:`flex w-6 shrink-0 items-center justify-center rounded-lg bg-depth-black-4 transition-colors hover:bg-depth-black-8 disabled:cursor-not-allowed disabled:hover:bg-depth-black-4`,children:I}),i[21]=y,i[22]=C,i[23]=I,i[24]=L):L=i[24];let R;i[25]!==N||i[26]!==L||i[27]!==D?(R=/* @__PURE__ */ (0,M.jsxs)(`div`,{className:`flex h-24 w-full items-stretch gap-2`,children:[D,N,L]}),i[25]=N,i[26]=L,i[27]=D,i[28]=R):R=i[28];let z;if(i[29]!==m||i[30]!==o){let e;i[32]===m?e=i[33]:(e=(e,t)=>/* @__PURE__ */ (0,M.jsx)(d.div,{className:l(`h-1.5 rounded-full`,t===m?`bg-depth-black-100`:`bg-depth-black-4`),animate:{width:t===m?16:6},transition:n},t),i[32]=m,i[33]=e),z=o.map(e),i[29]=m,i[30]=o,i[31]=z}else z=i[31];let B;i[34]===z?B=i[35]:(B=/* @__PURE__ */ (0,M.jsx)(`div`,{className:`flex w-full items-center justify-center gap-1`,children:z}),i[34]=z,i[35]=B);let V;return i[36]!==h||i[37]!==R||i[38]!==B?(V=/* @__PURE__ */ (0,M.jsxs)(`div`,{className:`flex w-full flex-col gap-2`,role:`group`,"aria-label":`Navigate variations`,onClick:P,"qa-test-id":h,children:[R,B]}),i[36]=h,i[37]=R,i[38]=B,i[39]=V):V=i[39],V}function P(e){return e.stopPropagation()}i();function F(e){let t=e.trim().split(/\s+/).filter(Boolean),n=t[0];if(!n)return``;let r=t.at(-1);return`${n[0]??``}${t.length>1?r?.[0]??``:n[1]??``}`.toUpperCase()}function I(e){let t=(0,j.c)(29),{name:n,role:r,avatarSrc:i,date:a,commentCount:o,onCommentCountClick:s}=e,{i18n:c,_:l}=g(),u=r??a,f=o!=null&&o>0,p;t[0]!==o||t[1]!==c?(p=o==null?void 0:c.number(o),t[0]=o,t[1]=c,t[2]=p):p=t[2];let m;t[3]===p?m=t[4]:(m=/* @__PURE__ */ (0,M.jsx)(b,{variant:`tag`,tagText:p,tagIcon:C,tagVariant:`stroke`,tagSize:`medium`,className:`shrink-0`}),t[3]=p,t[4]=m);let v=m,x;t[5]===n?x=t[6]:(x=F(n),t[5]=n,t[6]=x);let w;t[7]!==i||t[8]!==n||t[9]!==x?(w=/* @__PURE__ */ (0,M.jsx)(_,{src:i,alt:n,initials:x}),t[7]=i,t[8]=n,t[9]=x,t[10]=w):w=t[10];let T;t[11]===n?T=t[12]:(T=/* @__PURE__ */ (0,M.jsx)(`p`,{className:`pui-text-label-medium truncate text-text-strong`,children:n}),t[11]=n,t[12]=T);let E;t[13]===u?E=t[14]:(E=u?/* @__PURE__ */ (0,M.jsx)(`p`,{className:`pui-text-mono-small truncate text-text-soft`,children:u}):null,t[13]=u,t[14]=E);let D;t[15]!==T||t[16]!==E?(D=/* @__PURE__ */ (0,M.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[T,E]}),t[15]=T,t[16]=E,t[17]=D):D=t[17];let O;t[18]!==l||t[19]!==v||t[20]!==a||t[21]!==s||t[22]!==r||t[23]!==f?(O=f?s?/* @__PURE__ */ (0,M.jsx)(d.button,{type:`button`,className:`inline-flex shrink-0 cursor-pointer items-center border-0 bg-transparent p-0`,whileTap:{scale:h},"aria-label":l({id:`Dd6j2Q`}),"qa-test-id":`activity-card-ownership-comments`,onClick:e=>{e.stopPropagation(),s()},onPointerDown:L,children:v}):v:a&&r?/* @__PURE__ */ (0,M.jsx)(y,{variant:`stroke`,size:`medium`,icon:S,className:`shrink-0`,children:a}):null,t[18]=l,t[19]=v,t[20]=a,t[21]=s,t[22]=r,t[23]=f,t[24]=O):O=t[24];let k;return t[25]!==w||t[26]!==D||t[27]!==O?(k=/* @__PURE__ */ (0,M.jsxs)(`div`,{className:`flex w-full items-center gap-2 overflow-hidden rounded-xl bg-depth-black-4 p-2.5`,"qa-test-id":`activity-card-ownership`,children:[w,D,O]}),t[25]=w,t[26]=D,t[27]=O,t[28]=k):k=t[28],k}function L(e){return e.stopPropagation()}function R(e){let t=(0,j.c)(18),{note:n,author:r,timestamp:i,className:a,isSwapVisible:o,swapNode:s}=e,{_:c}=g(),u;t[0]===a?u=t[1]:(u=l(`flex w-full flex-col gap-1 overflow-hidden rounded-xl border border-depth-black-4 px-3 py-2.5`,a),t[0]=a,t[1]=u);let d;t[2]!==c||t[3]!==r?(d=r?/* @__PURE__ */ (0,M.jsxs)(M.Fragment,{children:[/* @__PURE__ */ (0,M.jsx)(_,{size:`small`,alt:r,initials:F(r)}),/* @__PURE__ */ (0,M.jsx)(`p`,{className:`pui-text-mono-small min-w-0 flex-1 truncate text-depth-black-48`,"qa-test-id":`activity-card-note-author`,children:r})]}):/* @__PURE__ */ (0,M.jsx)(`p`,{className:`pui-text-mono-small-alt-bold min-w-0 flex-1 truncate text-text-sub uppercase`,"qa-test-id":`activity-card-note-label`,children:c({id:`KiJn9B`})}),t[2]=c,t[3]=r,t[4]=d):d=t[4];let f;t[5]!==o||t[6]!==s||t[7]!==i?(f=i?/* @__PURE__ */ (0,M.jsx)(`div`,{className:`shrink-0`,onClick:B,onPointerDown:z,children:/* @__PURE__ */ (0,M.jsx)(b,{variant:`text`,text:i,className:`shrink-0`,isSwapVisible:o,swapNode:s})}):null,t[5]=o,t[6]=s,t[7]=i,t[8]=f):f=t[8];let p;t[9]!==d||t[10]!==f?(p=/* @__PURE__ */ (0,M.jsxs)(`div`,{className:`flex h-6 w-full items-center gap-2`,children:[d,f]}),t[9]=d,t[10]=f,t[11]=p):p=t[11];let m;t[12]===n?m=t[13]:(m=/* @__PURE__ */ (0,M.jsx)(`p`,{className:`pui-text-body-medium-compact text-depth-black-64`,children:n}),t[12]=n,t[13]=m);let h;return t[14]!==u||t[15]!==p||t[16]!==m?(h=/* @__PURE__ */ (0,M.jsxs)(`div`,{className:u,"qa-test-id":`activity-card-note`,children:[p,m]}),t[14]=u,t[15]=p,t[16]=m,t[17]=h):h=t[17],h}function z(e){return e.stopPropagation()}function B(e){return e.stopPropagation()}function V(e){let t=(0,j.c)(15),{notes:n}=e,{_:r}=g(),i,a,o,s,c;if(t[0]!==r||t[1]!==n){let e=n.slice(-2).toReversed();i=w,a=!0,t[7]===r?o=t[8]:(o=r({id:`VbyRUy`}),t[7]=r,t[8]=o),s=`activity-card-notes`,c=e.map(ee),t[0]=r,t[1]=n,t[2]=i,t[3]=a,t[4]=o,t[5]=s,t[6]=c}else i=t[2],a=t[3],o=t[4],s=t[5],c=t[6];let l;return t[9]!==i||t[10]!==a||t[11]!==o||t[12]!==s||t[13]!==c?(l=/* @__PURE__ */ (0,M.jsx)(i,{hideHeader:a,label:o,qaTestId:s,children:c}),t[9]=i,t[10]=a,t[11]=o,t[12]=s,t[13]=c,t[14]=l):l=t[14],l}function ee(e,t){return/* @__PURE__ */ (0,M.jsxs)(`div`,{children:[t>0?/* @__PURE__ */ (0,M.jsx)(`div`,{className:`px-3`,children:/* @__PURE__ */ (0,M.jsx)(x,{type:`line`,qaTestId:`activity-card-notes-divider`})}):null,/* @__PURE__ */ (0,M.jsx)(R,{note:e.body,author:e.author,timestamp:e.timestamp,className:`rounded-none border-0`,isSwapVisible:e.isSwapVisible,swapNode:e.swapNode})]},e.id??`${e.author??``}-${e.timestamp??``}-${t}`)}function H(e){let t=(0,j.c)(43),{skeleton:n,text:r,body:i,textareaFieldProps:a,variations:o,variationIndex:s,onVariationChange:c,ownership:u,note:d,noteAuthor:f,noteTimestamp:p,notes:m,media:h,qaTestId:_}=e,y=_===void 0?`activity-card-content`:_,{_:b}=g();if(n){let e,n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=/* @__PURE__ */ (0,M.jsx)(T,{className:`h-2.5 w-full`}),n=/* @__PURE__ */ (0,M.jsx)(T,{className:`h-2.5 w-11/12`}),r=/* @__PURE__ */ (0,M.jsx)(T,{className:`h-2.5 w-2/3`}),t[0]=e,t[1]=n,t[2]=r):(e=t[0],n=t[1],r=t[2]);let i;return t[3]===y?i=t[4]:(i=/* @__PURE__ */ (0,M.jsxs)(`div`,{className:`flex w-full flex-col gap-2`,"qa-test-id":y,children:[e,n,r]}),t[3]=y,t[4]=i),i}if(a){let e;t[5]===u?e=t[6]:(e=u?/* @__PURE__ */ (0,M.jsx)(I,{...u}):null,t[5]=u,t[6]=e);let n;t[7]!==b||t[8]!==r?(n=r??b({id:`zqPbyw`}),t[7]=b,t[8]=r,t[9]=n):n=t[9];let i=a?.textareaControlProps,o;t[10]===i?o=t[11]:(o={variant:`stroke`,maxLength:200,...i},t[10]=i,t[11]=o);let s;t[12]!==n||t[13]!==o||t[14]!==a?(s=/* @__PURE__ */ (0,M.jsx)(v,{className:`w-full`,fieldLabel:n,...a,textareaControlProps:o}),t[12]=n,t[13]=o,t[14]=a,t[15]=s):s=t[15];let c;return t[16]!==y||t[17]!==e||t[18]!==s?(c=/* @__PURE__ */ (0,M.jsxs)(`div`,{className:`flex w-full flex-col gap-3`,"qa-test-id":y,onClick:K,onPointerDown:G,children:[e,s]}),t[16]=y,t[17]=e,t[18]=s,t[19]=c):c=t[19],c}if(o&&o.length>0){let e;return t[20]!==c||t[21]!==y||t[22]!==s||t[23]!==o?(e=/* @__PURE__ */ (0,M.jsx)(N,{variations:o,variationIndex:s,onVariationChange:c,qaTestId:y}),t[20]=c,t[21]=y,t[22]=s,t[23]=o,t[24]=e):e=t[24],e}let x;t[25]!==i||t[26]!==r?(x=i??(r?/* @__PURE__ */ (0,M.jsx)(`p`,{className:`pui-text-body-medium-compact w-full text-depth-black-48`,children:r}):null),t[25]=i,t[26]=r,t[27]=x):x=t[27];let S;t[28]===h?S=t[29]:(S=h?/* @__PURE__ */ (0,M.jsx)(`div`,{className:l(`w-full overflow-hidden rounded-2xl`,`has-[>[data-slot=image-compare]]:overflow-visible [&>[data-slot=image-compare]]:rounded-2xl!`),"data-slot":`activity-card-media`,"qa-test-id":`activity-card-media`,onClick:W,onPointerDown:U,children:h}):null,t[28]=h,t[29]=S);let C;t[30]===u?C=t[31]:(C=u&&/* @__PURE__ */ (0,M.jsx)(I,{...u}),t[30]=u,t[31]=C);let w;t[32]!==d||t[33]!==f||t[34]!==p||t[35]!==m?(w=m&&m.length>0?/* @__PURE__ */ (0,M.jsx)(V,{notes:m}):d?/* @__PURE__ */ (0,M.jsx)(R,{note:d,author:f,timestamp:p}):null,t[32]=d,t[33]=f,t[34]=p,t[35]=m,t[36]=w):w=t[36];let E;return t[37]!==y||t[38]!==x||t[39]!==S||t[40]!==C||t[41]!==w?(E=/* @__PURE__ */ (0,M.jsxs)(`div`,{className:`flex w-full flex-col gap-3 overflow-visible`,"qa-test-id":y,children:[x,S,C,w]}),t[37]=y,t[38]=x,t[39]=S,t[40]=C,t[41]=w,t[42]=E):E=t[42],E}function U(e){return e.stopPropagation()}function W(e){return e.stopPropagation()}function G(e){return e.stopPropagation()}function K(e){return e.stopPropagation()}const q={suggested:{secondary:{label:{id:`6Uau97`},variant:`weak`},primary:{label:{id:`PZ_kxo`},variant:`weak`},equalButtons:!0},variations:{secondary:{label:{id:`1t_NnN`},variant:`stroke`},primary:{label:{id:`DB8zMK`},variant:`strong`,icon:`arrow`}},editing:{secondary:{label:{id:`dEgA5A`},variant:`stroke`},primary:{label:{id:`hQRttt`},variant:`strong`,icon:`arrow`}},regenerating:{secondary:{label:{id:`dEgA5A`},variant:`stroke`},primary:{label:{id:`ygCKqB`},variant:`weak`,icon:`stop`},equalButtons:!0},rejected:{secondary:{label:{id:`ePK91l`},variant:`stroke`},primary:{label:{id:`9uI_rE`},variant:`weak`}},"in-approval":{secondary:{label:{id:`1t_NnN`},variant:`stroke`},primary:{label:{id:`Z7ZXbT`},variant:`strong`,icon:`arrow`}}};function J(e){let t=(0,j.c)(64),{variant:n,onPrimaryAction:r,onSecondaryAction:i,primaryLabel:a,secondaryLabel:s,timestamp:c,onLike:u,onDislike:d,qaTestId:f}=e,p=n===void 0?`suggested`:n,h=f===void 0?`activity-card-footer`:f,{i18n:_,_:v}=g();if(p===`view`){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e={icon:o,color:`icon-sub`},t[0]=e):e=t[0];let n;t[1]!==v||t[2]!==a?(n=a??v({id:`jpctdh`}),t[1]=v,t[2]=a,t[3]=n):n=t[3];let i;t[4]!==r||t[5]!==n?(i=/* @__PURE__ */ (0,M.jsx)(m,{variant:`weak`,size:`medium`,className:`min-w-20 flex-1`,suffix:e,animateIcon:!0,onClick:r,children:n}),t[4]=r,t[5]=n,t[6]=i):i=t[6];let s;return t[7]!==h||t[8]!==i?(s=/* @__PURE__ */ (0,M.jsx)(`div`,{className:`flex w-full items-center gap-2`,onClick:te,onPointerDown:$,"qa-test-id":h,children:i}),t[7]=h,t[8]=i,t[9]=s):s=t[9],s}if(p===`comment`){let e;t[10]===v?e=t[11]:(e=v({id:`W9FRBT`}),t[10]=v,t[11]=e);let n;t[12]!==u||t[13]!==e?(n={icon:k,"aria-label":e,onClick:u},t[12]=u,t[13]=e,t[14]=n):n=t[14];let i;t[15]===v?i=t[16]:(i=v({id:`0JJQ_e`}),t[15]=v,t[16]=i);let o;t[17]!==d||t[18]!==i?(o={icon:O,"aria-label":i,onClick:d},t[17]=d,t[18]=i,t[19]=o):o=t[19];let s;t[20]!==n||t[21]!==o?(s=/* @__PURE__ */ (0,M.jsx)(D,{variant:`stroke`,size:`large`,actions:[n,o]}),t[20]=n,t[21]=o,t[22]=s):s=t[22];let c;t[23]!==v||t[24]!==a?(c=a??v({id:`ImOQa9`}),t[23]=v,t[24]=a,t[25]=c):c=t[25];let l;t[26]!==r||t[27]!==c?(l=/* @__PURE__ */ (0,M.jsx)(m,{variant:`weak`,size:`large`,className:`min-w-20`,onClick:r,children:c}),t[26]=r,t[27]=c,t[28]=l):l=t[28];let f;return t[29]!==h||t[30]!==s||t[31]!==l?(f=/* @__PURE__ */ (0,M.jsxs)(`div`,{className:`flex w-full items-center gap-2`,onClick:Q,onPointerDown:Z,"qa-test-id":h,children:[s,l]}),t[29]=h,t[30]=s,t[31]=l,t[32]=f):f=t[32],f}let y=q[p],b;t[33]!==y.secondary.label||t[34]!==_||t[35]!==s?(b=s??_.t(y.secondary.label),t[33]=y.secondary.label,t[34]=_,t[35]=s,t[36]=b):b=t[36];let x=b,S;t[37]!==y.primary.label||t[38]!==_||t[39]!==a?(S=a??_.t(y.primary.label),t[37]=y.primary.label,t[38]=_,t[39]=a,t[40]=S):S=t[40];let C=S,w=y.secondary.variant,T=y.equalButtons?`flex-1`:`shrink-0`,E;t[41]===T?E=t[42]:(E=l(`min-w-20`,T),t[41]=T,t[42]=E);let N;t[43]!==y.secondary.variant||t[44]!==i||t[45]!==x||t[46]!==E?(N=/* @__PURE__ */ (0,M.jsx)(m,{variant:w,size:`medium`,className:E,onClick:i,children:x}),t[43]=y.secondary.variant,t[44]=i,t[45]=x,t[46]=E,t[47]=N):N=t[47];let P;t[48]===y.primary.icon?P=t[49]:(P=y.primary.icon===`arrow`?{icon:o,color:`icon-inverse`}:y.primary.icon===`stop`?{icon:A,color:`icon-sub`}:void 0,t[48]=y.primary.icon,t[49]=P);let F=y.primary.icon===`arrow`,I;t[50]!==y.primary.variant||t[51]!==r||t[52]!==C||t[53]!==F||t[54]!==P?(I=/* @__PURE__ */ (0,M.jsx)(m,{variant:y.primary.variant,size:`medium`,className:`min-w-20 flex-1`,suffix:P,animateIcon:F,onClick:r,children:C}),t[50]=y.primary.variant,t[51]=r,t[52]=C,t[53]=F,t[54]=P,t[55]=I):I=t[55];let L;t[56]!==c||t[57]!==p?(L=p===`rejected`&&c&&/* @__PURE__ */ (0,M.jsx)(`span`,{className:`pui-text-mono-small flex-1 text-right text-text-soft`,children:c}),t[56]=c,t[57]=p,t[58]=L):L=t[58];let R;return t[59]!==h||t[60]!==I||t[61]!==L||t[62]!==N?(R=/* @__PURE__ */ (0,M.jsxs)(`div`,{className:`flex w-full items-center gap-2`,onClick:X,onPointerDown:Y,"qa-test-id":h,children:[N,I,L]}),t[59]=h,t[60]=I,t[61]=L,t[62]=N,t[63]=R):R=t[63],R}function Y(e){return e.stopPropagation()}function X(e){return e.stopPropagation()}function Z(e){return e.stopPropagation()}function Q(e){return e.stopPropagation()}function $(e){return e.stopPropagation()}function te(e){return e.stopPropagation()}function ne(e){let t=(0,j.c)(13),{suffix:n}=e,r,i;t[0]===n?(r=t[1],i=t[2]):({onClick:r,...i}=n,t[0]=n,t[1]=r,t[2]=i);let a;t[3]===n.className?a=t[4]:(a=l(`shrink-0`,n.className),t[3]=n.className,t[4]=a);let o;t[5]!==i||t[6]!==a?(o=/* @__PURE__ */ (0,M.jsx)(b,{...i,className:a}),t[5]=i,t[6]=a,t[7]=o):o=t[7];let s=o;if(!r)return s;let c;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(c={scale:h},t[8]=c):c=t[8];let u=r,f=typeof i[`aria-label`]==`string`?i[`aria-label`]:void 0,p;return t[9]!==s||t[10]!==u||t[11]!==f?(p=/* @__PURE__ */ (0,M.jsx)(d.button,{type:`button`,className:`inline-flex cursor-pointer items-center border-0 bg-transparent p-0`,whileTap:c,onClick:u,"aria-label":f,children:s}),t[9]=s,t[10]=u,t[11]=f,t[12]=p):p=t[12],p}function re(){let e=(0,j.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=/* @__PURE__ */ (0,M.jsx)(`span`,{className:`pui-text-mono-small-alt-bold inline-flex h-6 min-w-6 shrink-0 items-center justify-center rounded-lg bg-depth-black-4 text-text-strong`,"aria-hidden":!0,children:`--`}),e[0]=t):t=e[0],t}function ie(e){let t=(0,j.c)(15),{title:n,prefix:r,suffix:i,strikethrough:a,qaTestId:o}=e,s=a!==void 0&&a,c=o===void 0?`activity-card-header`:o,d;t[0]!==r||t[1]!==s?(d=r?/* @__PURE__ */ (0,M.jsx)(u,{...r,className:l(`shrink-0`,r.className)}):s?/* @__PURE__ */ (0,M.jsx)(re,{}):null,t[0]=r,t[1]=s,t[2]=d):d=t[2];let f=d,p=s?`text-text-sub line-through`:`text-text-strong`,m;t[3]===p?m=t[4]:(m=l(`pui-text-label-medium min-w-0 flex-1 truncate`,p),t[3]=p,t[4]=m);let h;t[5]!==m||t[6]!==n?(h=/* @__PURE__ */ (0,M.jsx)(`p`,{className:m,children:n}),t[5]=m,t[6]=n,t[7]=h):h=t[7];let g;t[8]===i?g=t[9]:(g=i?/* @__PURE__ */ (0,M.jsx)(`div`,{className:`flex h-6 shrink-0 items-center`,onClick:oe,onPointerDown:ae,children:/* @__PURE__ */ (0,M.jsx)(ne,{suffix:i})}):null,t[8]=i,t[9]=g);let _;return t[10]!==c||t[11]!==f||t[12]!==h||t[13]!==g?(_=/* @__PURE__ */ (0,M.jsxs)(`div`,{className:`flex h-6 w-full items-center gap-2`,"qa-test-id":c,children:[f,h,g]}),t[10]=c,t[11]=f,t[12]=h,t[13]=g,t[14]=_):_=t[14],_}function ae(e){return e.stopPropagation()}function oe(e){return e.stopPropagation()}const se={duration:.18,ease:[.32,.72,0,1]};function ce(e,t,n){let r=t?.skeleton?`skeleton`:t?.textareaFieldProps?`compose`:t?.variations&&t.variations.length>0?`variations`:t?`copy`:`empty`;return[e?.prefix?.variant??``,e?.suffix?.variant??``,e?.strikethrough?`struck`:``,r,t?.notes&&t.notes.length>0?`notes`:t?.note?`note`:``,t?.ownership?`own`:``,n?.variant??`none`].join(`:`)}function le(e){let t=(0,j.c)(50),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({header:a,content:r,footer:i,selection:s,className:n,qaTestId:c,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let u=c===void 0?`activity-card`:c,m=s?.selected??!1,h=p()??!1,g;t[8]===h?g=t[9]:(g=h?void 0:{scale:.99},t[8]=h,t[9]=g);let _=g,v=!h,y;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(y={scale:{duration:.12}},t[10]=y):y=t[10];let b=m?`border-transparent bg-secondary-lighter`:`border-depth-black-4 bg-base-inverse hover:border-transparent hover:bg-base-weak`,x;t[11]!==n||t[12]!==b?(x=l(`group flex w-full cursor-pointer flex-col items-start gap-3 overflow-visible p-4 transition-colors`,`rounded-[20px] border`,b,n),t[11]=n,t[12]=b,t[13]=x):x=t[13];let S=m||void 0,C;t[14]!==m||t[15]!==s?(C=()=>s?.onChange?.(!m),t[14]=m,t[15]=s,t[16]=C):C=t[16];let w;t[17]===a?w=t[18]:(w=a?/* @__PURE__ */ (0,M.jsx)(ie,{...a}):null,t[17]=a,t[18]=w);let T;t[19]!==r||t[20]!==i||t[21]!==a?(T=ce(a,r,i),t[19]=r,t[20]=i,t[21]=a,t[22]=T):T=t[22];let E;t[23]===v?E=t[24]:(E=v?{opacity:0,y:6}:!1,t[23]=v,t[24]=E);let D;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(D={opacity:1,y:0},t[25]=D):D=t[25];let O,k;t[26]===v?(O=t[27],k=t[28]):(O=v?{opacity:0,y:-6}:{opacity:1},k=v?se:{duration:0},t[26]=v,t[27]=O,t[28]=k);let A;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(A={willChange:`opacity, transform`,backfaceVisibility:`hidden`},t[29]=A):A=t[29];let N;t[30]===r?N=t[31]:(N=r?/* @__PURE__ */ (0,M.jsx)(H,{...r}):null,t[30]=r,t[31]=N);let P;t[32]===i?P=t[33]:(P=i?/* @__PURE__ */ (0,M.jsx)(J,{...i}):null,t[32]=i,t[33]=P);let F;t[34]!==E||t[35]!==O||t[36]!==k||t[37]!==N||t[38]!==P||t[39]!==T?(F=/* @__PURE__ */ (0,M.jsx)(f,{mode:`popLayout`,initial:!1,children:/* @__PURE__ */ (0,M.jsxs)(d.div,{initial:E,animate:D,exit:O,transition:k,className:`flex w-full min-w-0 flex-col gap-3 overflow-visible`,style:A,children:[N,P]},T)}),t[34]=E,t[35]=O,t[36]=k,t[37]=N,t[38]=P,t[39]=T,t[40]=F):F=t[40];let I;return t[41]!==o||t[42]!==u||t[43]!==F||t[44]!==x||t[45]!==S||t[46]!==C||t[47]!==w||t[48]!==_?(I=/* @__PURE__ */ (0,M.jsxs)(d.div,{whileTap:_,transition:y,className:x,"data-slot":`activity-card`,"data-selected":S,onClick:C,"qa-test-id":u,...o,children:[w,F]}),t[41]=o,t[42]=u,t[43]=F,t[44]=x,t[45]=S,t[46]=C,t[47]=w,t[48]=_,t[49]=I):I=t[49],I}export{le as ActivityCard,R as NoteBlock};
|
|
1
|
+
import{a as e}from"../../_chunks/rolldown-runtime-BWaJ3C7D.js";import{d as t,m as n,u as r}from"../../_chunks/transitions-Cn0Tw_ua.js";import{t as i}from"../../_chunks/react-CUaU2Z9V.js";import{t as a}from"../../_chunks/ChevronRightIcon-Dgm8qBR8.js";import{t as o}from"../../_chunks/ArrowRightIcon-OEjQROCT.js";import{t as s}from"../../_chunks/compiler-runtime-B3BlmaWz.js";import{t as c}from"../../_chunks/jsx-runtime-Dgn0yPdi.js";import{t as l}from"../../_chunks/dist-BNSTMZct.js";import{t as u}from"../../_chunks/Prefix-DknizWb3.js";import{n as d}from"../../_chunks/react-CqECE5Y5.js";import{t as f}from"../../_chunks/AnimatePresence-DOl8NYHq.js";import{t as p}from"../../_chunks/use-reduced-motion-CNBdBisf.js";import{t as m}from"../../_chunks/Button-BfpdYdpq.js";import{t as h}from"../../_chunks/button-constants-BRLmyaWg.js";import{i as g}from"../../_chunks/dist-BRMXKypj.js";import{t as _}from"../../_chunks/Avatar-BMklFAjX.js";import{t as v}from"../../_chunks/TextareaField-t1AdxrBG.js";import{t as y}from"../../_chunks/Tag-ORoY16Bh.js";import{t as b}from"../../_chunks/Suffix-DHDwsJuQ.js";import{t as x}from"../../_chunks/Divider-LTM2QzTF.js";import{t as S}from"../../_chunks/CalendarIcon-bZZA4ofp.js";import{t as C}from"../../_chunks/SpeechBubbleIcon-Dfrb59ah.js";import{t as w}from"../../_chunks/Section-OCRRh47S.js";import{t as T}from"../../_chunks/Skeleton-Cgi33Fpd.js";import{t as E}from"../../_chunks/ChevronLeftIcon-DixrWUUO.js";import{t as D}from"../../_chunks/ButtonGroup-B2wKhqwt.js";import{t as O}from"../../_chunks/ThumbsDownAlt-ginNWj6S.js";import{t as k}from"../../_chunks/ThumbsUpAlt-Cz4utpd3.js";import{t as A}from"../../_chunks/StopFillIcon-BHTuKSSq.js";var j=s(),M=/* @__PURE__ */ e(c(),1);function N(e){let i=(0,j.c)(40),{variations:o,variationIndex:s,onVariationChange:c,qaTestId:u}=e,m=s===void 0?0:s,h=u===void 0?`activity-card-variations-carousel`:u,g=p(),_=o.length,v=m<=0,y=m>=_-1,b;i[0]!==v||i[1]!==c||i[2]!==m?(b=()=>!v&&c?.(m-1),i[0]=v,i[1]=c,i[2]=m,i[3]=b):b=i[3];let x=b,S;i[4]!==y||i[5]!==c||i[6]!==m?(S=()=>!y&&c?.(m+1),i[4]=y,i[5]=c,i[6]=m,i[7]=S):S=i[7];let C=S,w=v?`icon-disabled`:`icon-strong`,T;i[8]===w?T=i[9]:(T=/* @__PURE__ */ (0,M.jsx)(E,{color:w,size:20}),i[8]=w,i[9]=T);let D;i[10]!==v||i[11]!==x||i[12]!==T?(D=/* @__PURE__ */ (0,M.jsx)(`button`,{type:`button`,"aria-label":`Previous variation`,onClick:x,disabled:v,className:`flex w-6 shrink-0 items-center justify-center rounded-lg bg-depth-black-4 transition-colors hover:bg-depth-black-8 disabled:cursor-not-allowed disabled:hover:bg-depth-black-4`,children:T}),i[10]=v,i[11]=x,i[12]=T,i[13]=D):D=i[13];let O=g?void 0:t,k;i[14]===Symbol.for(`react.memo_cache_sentinel`)?(k={willChange:`opacity, transform`,transform:`translate3d(0, 0, 0)`,backfaceVisibility:`hidden`},i[14]=k):k=i[14];let A=o[m],N;i[15]!==A||i[16]!==O||i[17]!==m?(N=/* @__PURE__ */ (0,M.jsx)(`div`,{className:`relative flex flex-1 items-center overflow-hidden rounded-xl border border-depth-black-4 bg-base-inverse p-2.5 group-data-[selected]:border-transparent group-data-[selected]:bg-depth-black-4`,children:/* @__PURE__ */ (0,M.jsx)(f,{mode:`popLayout`,initial:!1,children:/* @__PURE__ */ (0,M.jsx)(d.p,{className:`pui-text-body-medium-compact text-text-strong`,variants:O,initial:`enter`,animate:`center`,exit:`exit`,transition:r,style:k,children:A},m)})}),i[15]=A,i[16]=O,i[17]=m,i[18]=N):N=i[18];let F=y?`icon-disabled`:`icon-strong`,I;i[19]===F?I=i[20]:(I=/* @__PURE__ */ (0,M.jsx)(a,{color:F,size:20}),i[19]=F,i[20]=I);let L;i[21]!==y||i[22]!==C||i[23]!==I?(L=/* @__PURE__ */ (0,M.jsx)(`button`,{type:`button`,"aria-label":`Next variation`,onClick:C,disabled:y,className:`flex w-6 shrink-0 items-center justify-center rounded-lg bg-depth-black-4 transition-colors hover:bg-depth-black-8 disabled:cursor-not-allowed disabled:hover:bg-depth-black-4`,children:I}),i[21]=y,i[22]=C,i[23]=I,i[24]=L):L=i[24];let R;i[25]!==N||i[26]!==L||i[27]!==D?(R=/* @__PURE__ */ (0,M.jsxs)(`div`,{className:`flex h-24 w-full items-stretch gap-2`,children:[D,N,L]}),i[25]=N,i[26]=L,i[27]=D,i[28]=R):R=i[28];let z;if(i[29]!==m||i[30]!==o){let e;i[32]===m?e=i[33]:(e=(e,t)=>/* @__PURE__ */ (0,M.jsx)(d.div,{className:l(`h-1.5 rounded-full`,t===m?`bg-depth-black-100`:`bg-depth-black-4`),animate:{width:t===m?16:6},transition:n},t),i[32]=m,i[33]=e),z=o.map(e),i[29]=m,i[30]=o,i[31]=z}else z=i[31];let B;i[34]===z?B=i[35]:(B=/* @__PURE__ */ (0,M.jsx)(`div`,{className:`flex w-full items-center justify-center gap-1`,children:z}),i[34]=z,i[35]=B);let V;return i[36]!==h||i[37]!==R||i[38]!==B?(V=/* @__PURE__ */ (0,M.jsxs)(`div`,{className:`flex w-full flex-col gap-2`,role:`group`,"aria-label":`Navigate variations`,onClick:P,"qa-test-id":h,children:[R,B]}),i[36]=h,i[37]=R,i[38]=B,i[39]=V):V=i[39],V}function P(e){return e.stopPropagation()}i();function F(e){let t=e.trim().split(/\s+/).filter(Boolean),n=t[0];if(!n)return``;let r=t.at(-1);return`${n[0]??``}${t.length>1?r?.[0]??``:n[1]??``}`.toUpperCase()}function I(e){let t=(0,j.c)(29),{name:n,role:r,avatarSrc:i,date:a,commentCount:o,onCommentCountClick:s}=e,{i18n:c,_:l}=g(),u=r??a,f=o!=null&&o>0,p;t[0]!==o||t[1]!==c?(p=o==null?void 0:c.number(o),t[0]=o,t[1]=c,t[2]=p):p=t[2];let m;t[3]===p?m=t[4]:(m=/* @__PURE__ */ (0,M.jsx)(b,{variant:`tag`,tagText:p,tagIcon:C,tagVariant:`stroke`,tagSize:`medium`,className:`shrink-0`}),t[3]=p,t[4]=m);let v=m,x;t[5]===n?x=t[6]:(x=F(n),t[5]=n,t[6]=x);let w;t[7]!==i||t[8]!==n||t[9]!==x?(w=/* @__PURE__ */ (0,M.jsx)(_,{src:i,alt:n,initials:x}),t[7]=i,t[8]=n,t[9]=x,t[10]=w):w=t[10];let T;t[11]===n?T=t[12]:(T=/* @__PURE__ */ (0,M.jsx)(`p`,{className:`pui-text-label-medium truncate text-text-strong`,children:n}),t[11]=n,t[12]=T);let E;t[13]===u?E=t[14]:(E=u?/* @__PURE__ */ (0,M.jsx)(`p`,{className:`pui-text-mono-small truncate text-text-soft`,children:u}):null,t[13]=u,t[14]=E);let D;t[15]!==T||t[16]!==E?(D=/* @__PURE__ */ (0,M.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[T,E]}),t[15]=T,t[16]=E,t[17]=D):D=t[17];let O;t[18]!==l||t[19]!==v||t[20]!==a||t[21]!==s||t[22]!==r||t[23]!==f?(O=f?s?/* @__PURE__ */ (0,M.jsx)(d.button,{type:`button`,className:`inline-flex shrink-0 cursor-pointer items-center border-0 bg-transparent p-0`,whileTap:{scale:h},"aria-label":l({id:`Dd6j2Q`}),"qa-test-id":`activity-card-ownership-comments`,onClick:e=>{e.stopPropagation(),s()},onPointerDown:L,children:v}):v:a&&r?/* @__PURE__ */ (0,M.jsx)(y,{variant:`stroke`,size:`medium`,icon:S,className:`shrink-0`,children:a}):null,t[18]=l,t[19]=v,t[20]=a,t[21]=s,t[22]=r,t[23]=f,t[24]=O):O=t[24];let k;return t[25]!==w||t[26]!==D||t[27]!==O?(k=/* @__PURE__ */ (0,M.jsxs)(`div`,{className:`flex w-full items-center gap-2 overflow-hidden rounded-xl bg-depth-black-4 p-2.5`,"qa-test-id":`activity-card-ownership`,children:[w,D,O]}),t[25]=w,t[26]=D,t[27]=O,t[28]=k):k=t[28],k}function L(e){return e.stopPropagation()}function R(e){let t=(0,j.c)(18),{note:n,author:r,timestamp:i,className:a,isSwapVisible:o,swapNode:s}=e,{_:c}=g(),u;t[0]===a?u=t[1]:(u=l(`flex w-full flex-col gap-1 overflow-hidden rounded-xl border border-depth-black-4 px-3 py-2.5`,a),t[0]=a,t[1]=u);let d;t[2]!==c||t[3]!==r?(d=r?/* @__PURE__ */ (0,M.jsxs)(M.Fragment,{children:[/* @__PURE__ */ (0,M.jsx)(_,{size:`small`,alt:r,initials:F(r)}),/* @__PURE__ */ (0,M.jsx)(`p`,{className:`pui-text-mono-small min-w-0 flex-1 truncate text-depth-black-48`,"qa-test-id":`activity-card-note-author`,children:r})]}):/* @__PURE__ */ (0,M.jsx)(`p`,{className:`pui-text-mono-small-alt-bold min-w-0 flex-1 truncate text-text-sub uppercase`,"qa-test-id":`activity-card-note-label`,children:c({id:`KiJn9B`})}),t[2]=c,t[3]=r,t[4]=d):d=t[4];let f;t[5]!==o||t[6]!==s||t[7]!==i?(f=i?/* @__PURE__ */ (0,M.jsx)(`div`,{className:`shrink-0`,onClick:B,onPointerDown:z,children:/* @__PURE__ */ (0,M.jsx)(b,{variant:`text`,text:i,className:`shrink-0`,isSwapVisible:o,swapNode:s})}):null,t[5]=o,t[6]=s,t[7]=i,t[8]=f):f=t[8];let p;t[9]!==d||t[10]!==f?(p=/* @__PURE__ */ (0,M.jsxs)(`div`,{className:`flex h-6 w-full items-center gap-2`,children:[d,f]}),t[9]=d,t[10]=f,t[11]=p):p=t[11];let m;t[12]===n?m=t[13]:(m=/* @__PURE__ */ (0,M.jsx)(`p`,{className:`pui-text-body-medium-compact text-depth-black-64`,children:n}),t[12]=n,t[13]=m);let h;return t[14]!==u||t[15]!==p||t[16]!==m?(h=/* @__PURE__ */ (0,M.jsxs)(`div`,{className:u,"qa-test-id":`activity-card-note`,children:[p,m]}),t[14]=u,t[15]=p,t[16]=m,t[17]=h):h=t[17],h}function z(e){return e.stopPropagation()}function B(e){return e.stopPropagation()}function V(e){let t=(0,j.c)(15),{notes:n}=e,{_:r}=g(),i,a,o,s,c;if(t[0]!==r||t[1]!==n){let e=n.slice(-2).toReversed();i=w,a=!0,t[7]===r?o=t[8]:(o=r({id:`VbyRUy`}),t[7]=r,t[8]=o),s=`activity-card-notes`,c=e.map(H),t[0]=r,t[1]=n,t[2]=i,t[3]=a,t[4]=o,t[5]=s,t[6]=c}else i=t[2],a=t[3],o=t[4],s=t[5],c=t[6];let l;return t[9]!==i||t[10]!==a||t[11]!==o||t[12]!==s||t[13]!==c?(l=/* @__PURE__ */ (0,M.jsx)(i,{hideHeader:a,label:o,qaTestId:s,children:c}),t[9]=i,t[10]=a,t[11]=o,t[12]=s,t[13]=c,t[14]=l):l=t[14],l}function H(e,t){return/* @__PURE__ */ (0,M.jsxs)(`div`,{children:[t>0?/* @__PURE__ */ (0,M.jsx)(`div`,{className:`px-3`,children:/* @__PURE__ */ (0,M.jsx)(x,{type:`line`,qaTestId:`activity-card-notes-divider`})}):null,/* @__PURE__ */ (0,M.jsx)(R,{note:e.body,author:e.author,timestamp:e.timestamp,className:`rounded-none border-0`,isSwapVisible:e.isSwapVisible,swapNode:e.swapNode})]},e.id??`${e.author??``}-${e.timestamp??``}-${t}`)}function ee(e){let t=(0,j.c)(43),{skeleton:n,text:r,body:i,textareaFieldProps:a,variations:o,variationIndex:s,onVariationChange:c,ownership:u,note:d,noteAuthor:f,noteTimestamp:p,notes:m,media:h,qaTestId:_}=e,y=_===void 0?`activity-card-content`:_,{_:b}=g();if(n){let e,n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=/* @__PURE__ */ (0,M.jsx)(T,{className:`h-2.5 w-full`}),n=/* @__PURE__ */ (0,M.jsx)(T,{className:`h-2.5 w-11/12`}),r=/* @__PURE__ */ (0,M.jsx)(T,{className:`h-2.5 w-2/3`}),t[0]=e,t[1]=n,t[2]=r):(e=t[0],n=t[1],r=t[2]);let i;return t[3]===y?i=t[4]:(i=/* @__PURE__ */ (0,M.jsxs)(`div`,{className:`flex w-full flex-col gap-2`,"qa-test-id":y,children:[e,n,r]}),t[3]=y,t[4]=i),i}if(a){let e;t[5]===u?e=t[6]:(e=u?/* @__PURE__ */ (0,M.jsx)(I,{...u}):null,t[5]=u,t[6]=e);let n;t[7]!==b||t[8]!==r?(n=r??b({id:`zqPbyw`}),t[7]=b,t[8]=r,t[9]=n):n=t[9];let i=a?.textareaControlProps,o;t[10]===i?o=t[11]:(o={variant:`stroke`,maxLength:200,...i},t[10]=i,t[11]=o);let s;t[12]!==n||t[13]!==o||t[14]!==a?(s=/* @__PURE__ */ (0,M.jsx)(v,{className:`w-full`,fieldLabel:n,...a,textareaControlProps:o}),t[12]=n,t[13]=o,t[14]=a,t[15]=s):s=t[15];let c;return t[16]!==y||t[17]!==e||t[18]!==s?(c=/* @__PURE__ */ (0,M.jsxs)(`div`,{className:`flex w-full flex-col gap-3`,"qa-test-id":y,onClick:K,onPointerDown:G,children:[e,s]}),t[16]=y,t[17]=e,t[18]=s,t[19]=c):c=t[19],c}if(o&&o.length>0){let e;return t[20]!==c||t[21]!==y||t[22]!==s||t[23]!==o?(e=/* @__PURE__ */ (0,M.jsx)(N,{variations:o,variationIndex:s,onVariationChange:c,qaTestId:y}),t[20]=c,t[21]=y,t[22]=s,t[23]=o,t[24]=e):e=t[24],e}let x;t[25]!==i||t[26]!==r?(x=i??(r?/* @__PURE__ */ (0,M.jsx)(`p`,{className:`pui-text-body-medium-compact w-full text-depth-black-48`,children:r}):null),t[25]=i,t[26]=r,t[27]=x):x=t[27];let S;t[28]===h?S=t[29]:(S=h?/* @__PURE__ */ (0,M.jsx)(`div`,{className:l(`w-full overflow-hidden rounded-2xl`,`has-[>[data-slot=image-compare]]:overflow-visible [&>[data-slot=image-compare]]:rounded-2xl!`),"data-slot":`activity-card-media`,"qa-test-id":`activity-card-media`,onClick:W,onPointerDown:U,children:h}):null,t[28]=h,t[29]=S);let C;t[30]===u?C=t[31]:(C=u&&/* @__PURE__ */ (0,M.jsx)(I,{...u}),t[30]=u,t[31]=C);let w;t[32]!==d||t[33]!==f||t[34]!==p||t[35]!==m?(w=m&&m.length>0?/* @__PURE__ */ (0,M.jsx)(V,{notes:m}):d?/* @__PURE__ */ (0,M.jsx)(R,{note:d,author:f,timestamp:p}):null,t[32]=d,t[33]=f,t[34]=p,t[35]=m,t[36]=w):w=t[36];let E;return t[37]!==y||t[38]!==x||t[39]!==S||t[40]!==C||t[41]!==w?(E=/* @__PURE__ */ (0,M.jsxs)(`div`,{className:`flex w-full flex-col gap-3 overflow-visible`,"qa-test-id":y,children:[x,S,C,w]}),t[37]=y,t[38]=x,t[39]=S,t[40]=C,t[41]=w,t[42]=E):E=t[42],E}function U(e){return e.stopPropagation()}function W(e){return e.stopPropagation()}function G(e){return e.stopPropagation()}function K(e){return e.stopPropagation()}const q={suggested:{secondary:{label:{id:`6Uau97`},variant:`weak`},primary:{label:{id:`PZ_kxo`},variant:`weak`},equalButtons:!0},variations:{secondary:{label:{id:`1t_NnN`},variant:`stroke`},primary:{label:{id:`DB8zMK`},variant:`strong`,icon:`arrow`}},editing:{secondary:{label:{id:`dEgA5A`},variant:`stroke`},primary:{label:{id:`hQRttt`},variant:`strong`,icon:`arrow`}},regenerating:{secondary:{label:{id:`dEgA5A`},variant:`stroke`},primary:{label:{id:`ygCKqB`},variant:`weak`,icon:`stop`},equalButtons:!0},rejected:{secondary:{label:{id:`ePK91l`},variant:`stroke`},primary:{label:{id:`9uI_rE`},variant:`weak`}},"in-approval":{secondary:{label:{id:`1t_NnN`},variant:`stroke`},primary:{label:{id:`Z7ZXbT`},variant:`strong`,icon:`arrow`}}};function J(e){let t=(0,j.c)(64),{variant:n,onPrimaryAction:r,onSecondaryAction:i,primaryLabel:a,secondaryLabel:s,timestamp:c,onLike:u,onDislike:d,qaTestId:f}=e,p=n===void 0?`suggested`:n,h=f===void 0?`activity-card-footer`:f,{i18n:_,_:v}=g();if(p===`view`){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e={icon:o,color:`icon-sub`},t[0]=e):e=t[0];let n;t[1]!==v||t[2]!==a?(n=a??v({id:`jpctdh`}),t[1]=v,t[2]=a,t[3]=n):n=t[3];let i;t[4]!==r||t[5]!==n?(i=/* @__PURE__ */ (0,M.jsx)(m,{variant:`weak`,size:`medium`,className:`min-w-20 flex-1`,suffix:e,animateIcon:!0,onClick:r,children:n}),t[4]=r,t[5]=n,t[6]=i):i=t[6];let s;return t[7]!==h||t[8]!==i?(s=/* @__PURE__ */ (0,M.jsx)(`div`,{className:`flex w-full items-center gap-2`,onClick:ne,onPointerDown:te,"qa-test-id":h,children:i}),t[7]=h,t[8]=i,t[9]=s):s=t[9],s}if(p===`comment`){let e;t[10]===v?e=t[11]:(e=v({id:`W9FRBT`}),t[10]=v,t[11]=e);let n;t[12]!==u||t[13]!==e?(n={icon:k,"aria-label":e,onClick:u},t[12]=u,t[13]=e,t[14]=n):n=t[14];let i;t[15]===v?i=t[16]:(i=v({id:`0JJQ_e`}),t[15]=v,t[16]=i);let o;t[17]!==d||t[18]!==i?(o={icon:O,"aria-label":i,onClick:d},t[17]=d,t[18]=i,t[19]=o):o=t[19];let s;t[20]!==n||t[21]!==o?(s=/* @__PURE__ */ (0,M.jsx)(D,{variant:`stroke`,size:`large`,actions:[n,o]}),t[20]=n,t[21]=o,t[22]=s):s=t[22];let c;t[23]!==v||t[24]!==a?(c=a??v({id:`ImOQa9`}),t[23]=v,t[24]=a,t[25]=c):c=t[25];let l;t[26]!==r||t[27]!==c?(l=/* @__PURE__ */ (0,M.jsx)(m,{variant:`weak`,size:`large`,className:`min-w-20`,onClick:r,children:c}),t[26]=r,t[27]=c,t[28]=l):l=t[28];let f;return t[29]!==h||t[30]!==s||t[31]!==l?(f=/* @__PURE__ */ (0,M.jsxs)(`div`,{className:`flex w-full items-center gap-2`,onClick:Q,onPointerDown:Z,"qa-test-id":h,children:[s,l]}),t[29]=h,t[30]=s,t[31]=l,t[32]=f):f=t[32],f}let y=q[p],b;t[33]!==y.secondary.label||t[34]!==_||t[35]!==s?(b=s??_.t(y.secondary.label),t[33]=y.secondary.label,t[34]=_,t[35]=s,t[36]=b):b=t[36];let x=b,S;t[37]!==y.primary.label||t[38]!==_||t[39]!==a?(S=a??_.t(y.primary.label),t[37]=y.primary.label,t[38]=_,t[39]=a,t[40]=S):S=t[40];let C=S,w=y.secondary.variant,T=y.equalButtons?`flex-1`:`shrink-0`,E;t[41]===T?E=t[42]:(E=l(`min-w-20`,T),t[41]=T,t[42]=E);let N;t[43]!==y.secondary.variant||t[44]!==i||t[45]!==x||t[46]!==E?(N=/* @__PURE__ */ (0,M.jsx)(m,{variant:w,size:`medium`,className:E,onClick:i,children:x}),t[43]=y.secondary.variant,t[44]=i,t[45]=x,t[46]=E,t[47]=N):N=t[47];let P;t[48]===y.primary.icon?P=t[49]:(P=y.primary.icon===`arrow`?{icon:o,color:`icon-inverse`}:y.primary.icon===`stop`?{icon:A,color:`icon-sub`}:void 0,t[48]=y.primary.icon,t[49]=P);let F=y.primary.icon===`arrow`,I;t[50]!==y.primary.variant||t[51]!==r||t[52]!==C||t[53]!==F||t[54]!==P?(I=/* @__PURE__ */ (0,M.jsx)(m,{variant:y.primary.variant,size:`medium`,className:`min-w-20 flex-1`,suffix:P,animateIcon:F,onClick:r,children:C}),t[50]=y.primary.variant,t[51]=r,t[52]=C,t[53]=F,t[54]=P,t[55]=I):I=t[55];let L;t[56]!==c||t[57]!==p?(L=p===`rejected`&&c&&/* @__PURE__ */ (0,M.jsx)(`span`,{className:`pui-text-mono-small flex-1 text-right text-text-soft`,children:c}),t[56]=c,t[57]=p,t[58]=L):L=t[58];let R;return t[59]!==h||t[60]!==I||t[61]!==L||t[62]!==N?(R=/* @__PURE__ */ (0,M.jsxs)(`div`,{className:`flex w-full items-center gap-2`,onClick:X,onPointerDown:Y,"qa-test-id":h,children:[N,I,L]}),t[59]=h,t[60]=I,t[61]=L,t[62]=N,t[63]=R):R=t[63],R}function Y(e){return e.stopPropagation()}function X(e){return e.stopPropagation()}function Z(e){return e.stopPropagation()}function Q(e){return e.stopPropagation()}function te(e){return e.stopPropagation()}function ne(e){return e.stopPropagation()}function re(e){let t=(0,j.c)(13),{suffix:n}=e,r,i;t[0]===n?(r=t[1],i=t[2]):({onClick:r,...i}=n,t[0]=n,t[1]=r,t[2]=i);let a;t[3]===n.className?a=t[4]:(a=l(`shrink-0`,n.className),t[3]=n.className,t[4]=a);let o;t[5]!==i||t[6]!==a?(o=/* @__PURE__ */ (0,M.jsx)(b,{...i,className:a}),t[5]=i,t[6]=a,t[7]=o):o=t[7];let s=o;if(!r)return s;let c;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(c={scale:h},t[8]=c):c=t[8];let u=r,f=typeof i[`aria-label`]==`string`?i[`aria-label`]:void 0,p;return t[9]!==s||t[10]!==u||t[11]!==f?(p=/* @__PURE__ */ (0,M.jsx)(d.button,{type:`button`,className:`inline-flex cursor-pointer items-center border-0 bg-transparent p-0`,whileTap:c,onClick:u,"aria-label":f,children:s}),t[9]=s,t[10]=u,t[11]=f,t[12]=p):p=t[12],p}function ie(){let e=(0,j.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=/* @__PURE__ */ (0,M.jsx)(`span`,{className:`pui-text-mono-small-alt-bold inline-flex h-6 min-w-6 shrink-0 items-center justify-center rounded-lg bg-depth-black-4 text-text-strong`,"aria-hidden":!0,children:`--`}),e[0]=t):t=e[0],t}function ae(e){let t=(0,j.c)(15),{title:n,prefix:r,suffix:i,strikethrough:a,qaTestId:o}=e,s=a!==void 0&&a,c=o===void 0?`activity-card-header`:o,d;t[0]!==r||t[1]!==s?(d=r?/* @__PURE__ */ (0,M.jsx)(u,{...r,className:l(`shrink-0`,r.className)}):s?/* @__PURE__ */ (0,M.jsx)(ie,{}):null,t[0]=r,t[1]=s,t[2]=d):d=t[2];let f=d,p=s?`text-text-sub line-through`:`text-text-strong`,m;t[3]===p?m=t[4]:(m=l(`pui-text-label-medium min-w-0 flex-1 truncate`,p),t[3]=p,t[4]=m);let h;t[5]!==m||t[6]!==n?(h=/* @__PURE__ */ (0,M.jsx)(`p`,{className:m,children:n}),t[5]=m,t[6]=n,t[7]=h):h=t[7];let g;t[8]===i?g=t[9]:(g=i?/* @__PURE__ */ (0,M.jsx)(`div`,{className:`flex h-6 shrink-0 items-center`,onClick:oe,onPointerDown:$,children:/* @__PURE__ */ (0,M.jsx)(re,{suffix:i})}):null,t[8]=i,t[9]=g);let _;return t[10]!==c||t[11]!==f||t[12]!==h||t[13]!==g?(_=/* @__PURE__ */ (0,M.jsxs)(`div`,{className:`flex h-6 w-full items-center gap-2`,"qa-test-id":c,children:[f,h,g]}),t[10]=c,t[11]=f,t[12]=h,t[13]=g,t[14]=_):_=t[14],_}function $(e){return e.stopPropagation()}function oe(e){return e.stopPropagation()}const se={duration:.18,ease:[.32,.72,0,1]};function ce(e,t,n){let r=t?.skeleton?`skeleton`:t?.textareaFieldProps?`compose`:t?.variations&&t.variations.length>0?`variations`:t?`copy`:`empty`;return[e?.prefix?.variant??``,e?.suffix?.variant??``,e?.strikethrough?`struck`:``,r,t?.notes&&t.notes.length>0?`notes`:t?.note?`note`:``,t?.ownership?`own`:``,n?.variant??`none`].join(`:`)}function le(e){let t=(0,j.c)(62),n,r,i,a,o,s,c,u;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],u=t[8]):({header:a,content:r,footer:i,selection:c,className:n,qaTestId:u,onKeyDown:o,...s}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=u);let m=u===void 0?`activity-card`:u,h=c?.selected??!1,g=!!c?.onChange,_=p()??!1,v;t[9]!==g||t[10]!==_?(v=_||!g?void 0:{scale:.99},t[9]=g,t[10]=_,t[11]=v):v=t[11];let y=v,b=!_,x;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(x={scale:{duration:.12}},t[12]=x):x=t[12];let S=h?`border-transparent bg-secondary-lighter`:`border-depth-black-4 bg-base-inverse hover:border-transparent hover:bg-base-weak`,C;t[13]!==n||t[14]!==S?(C=l(`group flex w-full cursor-pointer flex-col items-start gap-3 overflow-visible p-4 transition-colors`,`rounded-[20px] border focus-visible:shadow-outline-primary focus-visible:outline-hidden`,S,n),t[13]=n,t[14]=S,t[15]=C):C=t[15];let w=h||void 0,T=g?`button`:void 0,E=g?0:void 0,D=g?h:void 0,O=g?a?.title:void 0,k;t[16]!==h||t[17]!==c?(k=()=>c?.onChange?.(!h),t[16]=h,t[17]=c,t[18]=k):k=t[18];let A;t[19]!==g||t[20]!==h||t[21]!==o||t[22]!==c?(A=e=>{o?.(e),!e.defaultPrevented&&g&&e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),c?.onChange?.(!h))},t[19]=g,t[20]=h,t[21]=o,t[22]=c,t[23]=A):A=t[23];let N;t[24]===a?N=t[25]:(N=a?/* @__PURE__ */ (0,M.jsx)(ae,{...a}):null,t[24]=a,t[25]=N);let P;t[26]!==r||t[27]!==i||t[28]!==a?(P=ce(a,r,i),t[26]=r,t[27]=i,t[28]=a,t[29]=P):P=t[29];let F;t[30]===b?F=t[31]:(F=b?{opacity:0,y:6}:!1,t[30]=b,t[31]=F);let I;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(I={opacity:1,y:0},t[32]=I):I=t[32];let L,R;t[33]===b?(L=t[34],R=t[35]):(L=b?{opacity:0,y:-6}:{opacity:1},R=b?se:{duration:0},t[33]=b,t[34]=L,t[35]=R);let z;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(z={willChange:`opacity, transform`,backfaceVisibility:`hidden`},t[36]=z):z=t[36];let B;t[37]===r?B=t[38]:(B=r?/* @__PURE__ */ (0,M.jsx)(ee,{...r}):null,t[37]=r,t[38]=B);let V;t[39]===i?V=t[40]:(V=i?/* @__PURE__ */ (0,M.jsx)(J,{...i}):null,t[39]=i,t[40]=V);let H;t[41]!==P||t[42]!==F||t[43]!==L||t[44]!==R||t[45]!==B||t[46]!==V?(H=/* @__PURE__ */ (0,M.jsx)(f,{mode:`popLayout`,initial:!1,children:/* @__PURE__ */ (0,M.jsxs)(d.div,{initial:F,animate:I,exit:L,transition:R,className:`flex w-full min-w-0 flex-col gap-3 overflow-visible`,style:z,children:[B,V]},P)}),t[41]=P,t[42]=F,t[43]=L,t[44]=R,t[45]=B,t[46]=V,t[47]=H):H=t[47];let U;return t[48]!==s||t[49]!==m||t[50]!==O||t[51]!==k||t[52]!==A||t[53]!==N||t[54]!==H||t[55]!==C||t[56]!==w||t[57]!==T||t[58]!==E||t[59]!==D||t[60]!==y?(U=/* @__PURE__ */ (0,M.jsxs)(d.div,{whileTap:y,transition:x,className:C,"data-slot":`activity-card`,"data-selected":w,role:T,tabIndex:E,"aria-pressed":D,"aria-label":O,onClick:k,onKeyDown:A,"qa-test-id":m,...s,children:[N,H]}),t[48]=s,t[49]=m,t[50]=O,t[51]=k,t[52]=A,t[53]=N,t[54]=H,t[55]=C,t[56]=w,t[57]=T,t[58]=E,t[59]=D,t[60]=y,t[61]=U):U=t[61],U}export{le as ActivityCard,R as NoteBlock};
|
|
@@ -33,178 +33,214 @@ function activityCardMorphKey(header, content, footer) {
|
|
|
33
33
|
].join(":");
|
|
34
34
|
}
|
|
35
35
|
function ActivityCard(t0) {
|
|
36
|
-
const $ = c(
|
|
36
|
+
const $ = c(62);
|
|
37
37
|
let className;
|
|
38
38
|
let content;
|
|
39
39
|
let footer;
|
|
40
40
|
let header;
|
|
41
|
+
let onKeyDown;
|
|
41
42
|
let props;
|
|
42
43
|
let selection;
|
|
43
44
|
let t1;
|
|
44
45
|
if ($[0] !== t0) {
|
|
45
|
-
({header, content, footer, selection, className, qaTestId: t1, ...props} = t0);
|
|
46
|
+
({header, content, footer, selection, className, qaTestId: t1, onKeyDown, ...props} = t0);
|
|
46
47
|
$[0] = t0;
|
|
47
48
|
$[1] = className;
|
|
48
49
|
$[2] = content;
|
|
49
50
|
$[3] = footer;
|
|
50
51
|
$[4] = header;
|
|
51
|
-
$[5] =
|
|
52
|
-
$[6] =
|
|
53
|
-
$[7] =
|
|
52
|
+
$[5] = onKeyDown;
|
|
53
|
+
$[6] = props;
|
|
54
|
+
$[7] = selection;
|
|
55
|
+
$[8] = t1;
|
|
54
56
|
} else {
|
|
55
57
|
className = $[1];
|
|
56
58
|
content = $[2];
|
|
57
59
|
footer = $[3];
|
|
58
60
|
header = $[4];
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
onKeyDown = $[5];
|
|
62
|
+
props = $[6];
|
|
63
|
+
selection = $[7];
|
|
64
|
+
t1 = $[8];
|
|
62
65
|
}
|
|
63
66
|
const qaTestId = t1 === void 0 ? "activity-card" : t1;
|
|
64
67
|
const isSelected = selection?.selected ?? false;
|
|
68
|
+
const isSelectable = Boolean(selection?.onChange);
|
|
65
69
|
const prefersReducedMotion = useReducedMotion() ?? false;
|
|
66
70
|
let t2;
|
|
67
|
-
if ($[
|
|
68
|
-
t2 = prefersReducedMotion ? void 0 : { scale: .99 };
|
|
69
|
-
$[
|
|
70
|
-
$[
|
|
71
|
-
|
|
71
|
+
if ($[9] !== isSelectable || $[10] !== prefersReducedMotion) {
|
|
72
|
+
t2 = prefersReducedMotion || !isSelectable ? void 0 : { scale: .99 };
|
|
73
|
+
$[9] = isSelectable;
|
|
74
|
+
$[10] = prefersReducedMotion;
|
|
75
|
+
$[11] = t2;
|
|
76
|
+
} else t2 = $[11];
|
|
72
77
|
const tapAnimation = t2;
|
|
73
78
|
const shouldAnimate = !prefersReducedMotion;
|
|
74
79
|
let t3;
|
|
75
|
-
if ($[
|
|
80
|
+
if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
|
|
76
81
|
t3 = { scale: { duration: .12 } };
|
|
77
|
-
$[
|
|
78
|
-
} else t3 = $[
|
|
82
|
+
$[12] = t3;
|
|
83
|
+
} else t3 = $[12];
|
|
79
84
|
const t4 = isSelected ? "border-transparent bg-secondary-lighter" : "border-depth-black-4 bg-base-inverse hover:border-transparent hover:bg-base-weak";
|
|
80
85
|
let t5;
|
|
81
|
-
if ($[
|
|
82
|
-
t5 = cn("group flex w-full cursor-pointer flex-col items-start gap-3 overflow-visible p-4 transition-colors", "rounded-[20px] border", t4, className);
|
|
83
|
-
$[
|
|
84
|
-
$[
|
|
85
|
-
$[
|
|
86
|
-
} else t5 = $[
|
|
86
|
+
if ($[13] !== className || $[14] !== t4) {
|
|
87
|
+
t5 = cn("group flex w-full cursor-pointer flex-col items-start gap-3 overflow-visible p-4 transition-colors", "rounded-[20px] border focus-visible:shadow-outline-primary focus-visible:outline-hidden", t4, className);
|
|
88
|
+
$[13] = className;
|
|
89
|
+
$[14] = t4;
|
|
90
|
+
$[15] = t5;
|
|
91
|
+
} else t5 = $[15];
|
|
87
92
|
const t6 = isSelected || void 0;
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
93
|
+
const t7 = isSelectable ? "button" : void 0;
|
|
94
|
+
const t8 = isSelectable ? 0 : void 0;
|
|
95
|
+
const t9 = isSelectable ? isSelected : void 0;
|
|
96
|
+
const t10 = isSelectable ? header?.title : void 0;
|
|
97
|
+
let t11;
|
|
98
|
+
if ($[16] !== isSelected || $[17] !== selection) {
|
|
99
|
+
t11 = () => selection?.onChange?.(!isSelected);
|
|
100
|
+
$[16] = isSelected;
|
|
101
|
+
$[17] = selection;
|
|
102
|
+
$[18] = t11;
|
|
103
|
+
} else t11 = $[18];
|
|
104
|
+
let t12;
|
|
105
|
+
if ($[19] !== isSelectable || $[20] !== isSelected || $[21] !== onKeyDown || $[22] !== selection) {
|
|
106
|
+
t12 = (event) => {
|
|
107
|
+
onKeyDown?.(event);
|
|
108
|
+
if (event.defaultPrevented) return;
|
|
109
|
+
if (!isSelectable || event.target !== event.currentTarget) return;
|
|
110
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
111
|
+
event.preventDefault();
|
|
112
|
+
selection?.onChange?.(!isSelected);
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
$[19] = isSelectable;
|
|
116
|
+
$[20] = isSelected;
|
|
117
|
+
$[21] = onKeyDown;
|
|
118
|
+
$[22] = selection;
|
|
119
|
+
$[23] = t12;
|
|
120
|
+
} else t12 = $[23];
|
|
121
|
+
let t13;
|
|
122
|
+
if ($[24] !== header) {
|
|
123
|
+
t13 = header ? /* @__PURE__ */ jsx(ActivityCardHeader, { ...header }) : null;
|
|
124
|
+
$[24] = header;
|
|
125
|
+
$[25] = t13;
|
|
126
|
+
} else t13 = $[25];
|
|
127
|
+
let t14;
|
|
128
|
+
if ($[26] !== content || $[27] !== footer || $[28] !== header) {
|
|
129
|
+
t14 = activityCardMorphKey(header, content, footer);
|
|
130
|
+
$[26] = content;
|
|
131
|
+
$[27] = footer;
|
|
132
|
+
$[28] = header;
|
|
133
|
+
$[29] = t14;
|
|
134
|
+
} else t14 = $[29];
|
|
135
|
+
let t15;
|
|
136
|
+
if ($[30] !== shouldAnimate) {
|
|
137
|
+
t15 = shouldAnimate ? {
|
|
112
138
|
opacity: 0,
|
|
113
139
|
y: 6
|
|
114
140
|
} : false;
|
|
115
|
-
$[
|
|
116
|
-
$[
|
|
117
|
-
} else
|
|
118
|
-
let
|
|
119
|
-
if ($[
|
|
120
|
-
|
|
141
|
+
$[30] = shouldAnimate;
|
|
142
|
+
$[31] = t15;
|
|
143
|
+
} else t15 = $[31];
|
|
144
|
+
let t16;
|
|
145
|
+
if ($[32] === Symbol.for("react.memo_cache_sentinel")) {
|
|
146
|
+
t16 = {
|
|
121
147
|
opacity: 1,
|
|
122
148
|
y: 0
|
|
123
149
|
};
|
|
124
|
-
$[
|
|
125
|
-
} else
|
|
126
|
-
let
|
|
127
|
-
let
|
|
128
|
-
if ($[
|
|
129
|
-
|
|
150
|
+
$[32] = t16;
|
|
151
|
+
} else t16 = $[32];
|
|
152
|
+
let t17;
|
|
153
|
+
let t18;
|
|
154
|
+
if ($[33] !== shouldAnimate) {
|
|
155
|
+
t17 = shouldAnimate ? {
|
|
130
156
|
opacity: 0,
|
|
131
157
|
y: -6
|
|
132
158
|
} : { opacity: 1 };
|
|
133
|
-
|
|
134
|
-
$[
|
|
135
|
-
$[
|
|
136
|
-
$[
|
|
159
|
+
t18 = shouldAnimate ? cardMorphTransition : { duration: 0 };
|
|
160
|
+
$[33] = shouldAnimate;
|
|
161
|
+
$[34] = t17;
|
|
162
|
+
$[35] = t18;
|
|
137
163
|
} else {
|
|
138
|
-
|
|
139
|
-
|
|
164
|
+
t17 = $[34];
|
|
165
|
+
t18 = $[35];
|
|
140
166
|
}
|
|
141
|
-
let
|
|
142
|
-
if ($[
|
|
143
|
-
|
|
167
|
+
let t19;
|
|
168
|
+
if ($[36] === Symbol.for("react.memo_cache_sentinel")) {
|
|
169
|
+
t19 = {
|
|
144
170
|
willChange: "opacity, transform",
|
|
145
171
|
backfaceVisibility: "hidden"
|
|
146
172
|
};
|
|
147
|
-
$[
|
|
148
|
-
} else
|
|
149
|
-
let
|
|
150
|
-
if ($[
|
|
151
|
-
|
|
152
|
-
$[
|
|
153
|
-
$[
|
|
154
|
-
} else
|
|
155
|
-
let
|
|
156
|
-
if ($[
|
|
157
|
-
|
|
158
|
-
$[
|
|
159
|
-
$[
|
|
160
|
-
} else
|
|
161
|
-
let
|
|
162
|
-
if ($[
|
|
163
|
-
|
|
173
|
+
$[36] = t19;
|
|
174
|
+
} else t19 = $[36];
|
|
175
|
+
let t20;
|
|
176
|
+
if ($[37] !== content) {
|
|
177
|
+
t20 = content ? /* @__PURE__ */ jsx(ActivityCardContent, { ...content }) : null;
|
|
178
|
+
$[37] = content;
|
|
179
|
+
$[38] = t20;
|
|
180
|
+
} else t20 = $[38];
|
|
181
|
+
let t21;
|
|
182
|
+
if ($[39] !== footer) {
|
|
183
|
+
t21 = footer ? /* @__PURE__ */ jsx(ActivityCardFooter, { ...footer }) : null;
|
|
184
|
+
$[39] = footer;
|
|
185
|
+
$[40] = t21;
|
|
186
|
+
} else t21 = $[40];
|
|
187
|
+
let t22;
|
|
188
|
+
if ($[41] !== t14 || $[42] !== t15 || $[43] !== t17 || $[44] !== t18 || $[45] !== t20 || $[46] !== t21) {
|
|
189
|
+
t22 = /* @__PURE__ */ jsx(AnimatePresence, {
|
|
164
190
|
mode: "popLayout",
|
|
165
191
|
initial: false,
|
|
166
192
|
children: /* @__PURE__ */ jsxs(motion.div, {
|
|
167
|
-
initial:
|
|
168
|
-
animate:
|
|
169
|
-
exit:
|
|
170
|
-
transition:
|
|
193
|
+
initial: t15,
|
|
194
|
+
animate: t16,
|
|
195
|
+
exit: t17,
|
|
196
|
+
transition: t18,
|
|
171
197
|
className: "flex w-full min-w-0 flex-col gap-3 overflow-visible",
|
|
172
|
-
style:
|
|
173
|
-
children: [
|
|
174
|
-
},
|
|
198
|
+
style: t19,
|
|
199
|
+
children: [t20, t21]
|
|
200
|
+
}, t14)
|
|
175
201
|
});
|
|
176
|
-
$[
|
|
177
|
-
$[
|
|
178
|
-
$[
|
|
179
|
-
$[
|
|
180
|
-
$[
|
|
181
|
-
$[
|
|
182
|
-
$[
|
|
183
|
-
} else
|
|
184
|
-
let
|
|
185
|
-
if ($[
|
|
186
|
-
|
|
202
|
+
$[41] = t14;
|
|
203
|
+
$[42] = t15;
|
|
204
|
+
$[43] = t17;
|
|
205
|
+
$[44] = t18;
|
|
206
|
+
$[45] = t20;
|
|
207
|
+
$[46] = t21;
|
|
208
|
+
$[47] = t22;
|
|
209
|
+
} else t22 = $[47];
|
|
210
|
+
let t23;
|
|
211
|
+
if ($[48] !== props || $[49] !== qaTestId || $[50] !== t10 || $[51] !== t11 || $[52] !== t12 || $[53] !== t13 || $[54] !== t22 || $[55] !== t5 || $[56] !== t6 || $[57] !== t7 || $[58] !== t8 || $[59] !== t9 || $[60] !== tapAnimation) {
|
|
212
|
+
t23 = /* @__PURE__ */ jsxs(motion.div, {
|
|
187
213
|
whileTap: tapAnimation,
|
|
188
214
|
transition: t3,
|
|
189
215
|
className: t5,
|
|
190
216
|
"data-slot": "activity-card",
|
|
191
217
|
"data-selected": t6,
|
|
192
|
-
|
|
218
|
+
role: t7,
|
|
219
|
+
tabIndex: t8,
|
|
220
|
+
"aria-pressed": t9,
|
|
221
|
+
"aria-label": t10,
|
|
222
|
+
onClick: t11,
|
|
223
|
+
onKeyDown: t12,
|
|
193
224
|
"qa-test-id": qaTestId,
|
|
194
225
|
...props,
|
|
195
|
-
children: [
|
|
226
|
+
children: [t13, t22]
|
|
196
227
|
});
|
|
197
|
-
$[
|
|
198
|
-
$[
|
|
199
|
-
$[
|
|
200
|
-
$[
|
|
201
|
-
$[
|
|
202
|
-
$[
|
|
203
|
-
$[
|
|
204
|
-
$[
|
|
205
|
-
$[
|
|
206
|
-
|
|
207
|
-
|
|
228
|
+
$[48] = props;
|
|
229
|
+
$[49] = qaTestId;
|
|
230
|
+
$[50] = t10;
|
|
231
|
+
$[51] = t11;
|
|
232
|
+
$[52] = t12;
|
|
233
|
+
$[53] = t13;
|
|
234
|
+
$[54] = t22;
|
|
235
|
+
$[55] = t5;
|
|
236
|
+
$[56] = t6;
|
|
237
|
+
$[57] = t7;
|
|
238
|
+
$[58] = t8;
|
|
239
|
+
$[59] = t9;
|
|
240
|
+
$[60] = tapAnimation;
|
|
241
|
+
$[61] = t23;
|
|
242
|
+
} else t23 = $[61];
|
|
243
|
+
return t23;
|
|
208
244
|
}
|
|
209
245
|
|
|
210
246
|
//#endregion
|
package/dist/play-cdn-claude.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
const NPM_CDN = "https://cdn.jsdelivr.net/npm/";
|
|
3
3
|
const SHARED = /^(@patterninc\/pattern-ui\/|(react|react-dom|@lingui\/core|@lingui\/react|sucrase)(\/|$))/;
|
|
4
4
|
const scriptUrl = document.currentScript instanceof HTMLScriptElement ? document.currentScript.src : "";
|
|
5
|
-
const packageUrl = new URL("../", scriptUrl || location.href).href.replace(/\/@patterninc\/pattern-ui(@[^/]*)?\//, `/@patterninc/pattern-ui@0.0.0-main.
|
|
5
|
+
const packageUrl = new URL("../", scriptUrl || location.href).href.replace(/\/@patterninc\/pattern-ui(@[^/]*)?\//, `/@patterninc/pattern-ui@0.0.0-main.202610270629.b17c96835fc3/`);
|
|
6
6
|
const browserUrl = `${packageUrl}dist/browser/`;
|
|
7
7
|
globalThis.patternPlayCdnUrl = (specifier) => {
|
|
8
8
|
if (specifier.endsWith(".css")) return `${browserUrl}${specifier}`;
|
package/package.json
CHANGED
|
@@ -77,14 +77,17 @@ export function ActivityCard({
|
|
|
77
77
|
selection,
|
|
78
78
|
className,
|
|
79
79
|
qaTestId = 'activity-card',
|
|
80
|
+
onKeyDown,
|
|
80
81
|
...props
|
|
81
82
|
}: ActivityCardProps) {
|
|
82
83
|
const isSelected = selection?.selected ?? false
|
|
84
|
+
const isSelectable = Boolean(selection?.onChange)
|
|
83
85
|
const prefersReducedMotion = useReducedMotion() ?? false
|
|
84
86
|
// Subtle 0.99 press affordance — the card is large, so anything stronger
|
|
85
87
|
// looks jumpy. Disabled under reduced-motion. Matches the PI playground's
|
|
86
|
-
// ActivityCardShell.
|
|
87
|
-
|
|
88
|
+
// ActivityCardShell. motion makes any `whileTap` element tabbable, so only
|
|
89
|
+
// selectable cards opt in; read-only cards must stay out of the tab order.
|
|
90
|
+
const tapAnimation = prefersReducedMotion || !isSelectable ? undefined : { scale: 0.99 }
|
|
88
91
|
const shouldAnimate = !prefersReducedMotion
|
|
89
92
|
|
|
90
93
|
return (
|
|
@@ -94,7 +97,7 @@ export function ActivityCard({
|
|
|
94
97
|
className={cn(
|
|
95
98
|
'group flex w-full cursor-pointer flex-col items-start gap-3 overflow-visible p-4 transition-colors',
|
|
96
99
|
// rounded-[20px]: --radius-20 token sits between rounded-2xl (16px) and rounded-3xl (24px)
|
|
97
|
-
'rounded-[20px] border',
|
|
100
|
+
'rounded-[20px] border focus-visible:shadow-outline-primary focus-visible:outline-hidden',
|
|
98
101
|
isSelected
|
|
99
102
|
? 'border-transparent bg-secondary-lighter'
|
|
100
103
|
: 'border-depth-black-4 bg-base-inverse hover:border-transparent hover:bg-base-weak',
|
|
@@ -102,7 +105,24 @@ export function ActivityCard({
|
|
|
102
105
|
)}
|
|
103
106
|
data-slot='activity-card'
|
|
104
107
|
data-selected={isSelected || undefined}
|
|
108
|
+
role={isSelectable ? 'button' : undefined}
|
|
109
|
+
tabIndex={isSelectable ? 0 : undefined}
|
|
110
|
+
aria-pressed={isSelectable ? isSelected : undefined}
|
|
111
|
+
// Name the toggle from the title so nested control labels (Keep, Comment, ...) aren't
|
|
112
|
+
// concatenated into its accessible name. Consumers can override via `aria-label(ledby)`.
|
|
113
|
+
aria-label={isSelectable ? header?.title : undefined}
|
|
105
114
|
onClick={() => selection?.onChange?.(!isSelected)}
|
|
115
|
+
onKeyDown={(event) => {
|
|
116
|
+
onKeyDown?.(event)
|
|
117
|
+
if (event.defaultPrevented) return
|
|
118
|
+
// Only react when the card itself is focused so Enter/Space inside nested
|
|
119
|
+
// controls (footer buttons, composer textarea) keep their own behaviour.
|
|
120
|
+
if (!isSelectable || event.target !== event.currentTarget) return
|
|
121
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
122
|
+
event.preventDefault()
|
|
123
|
+
selection?.onChange?.(!isSelected)
|
|
124
|
+
}
|
|
125
|
+
}}
|
|
106
126
|
qa-test-id={qaTestId}
|
|
107
127
|
{...props}
|
|
108
128
|
>
|