@1d1s/design-system 0.2.32 → 0.2.33
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/dist/index.es.js +1 -1
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -10520,7 +10520,7 @@ function $s({
|
|
|
10520
10520
|
T,
|
|
10521
10521
|
{
|
|
10522
10522
|
as: "p",
|
|
10523
|
-
size: "
|
|
10523
|
+
size: "body2",
|
|
10524
10524
|
weight: "regular",
|
|
10525
10525
|
className: "mt-0.5 leading-relaxed break-words whitespace-pre-wrap text-gray-800",
|
|
10526
10526
|
children: e.content
|
package/dist/index.umd.js
CHANGED
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
`)},bi=function(){var e=parseInt(document.body.getAttribute(Tt)||"0",10);return isFinite(e)?e:0},jm=function(){h.useEffect(function(){return document.body.setAttribute(Tt,(bi()+1).toString()),function(){var e=bi()-1;e<=0?document.body.removeAttribute(Tt):document.body.setAttribute(Tt,e.toString())}},[])},Gm=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;jm();var a=h.useMemo(function(){return Hm(o)},[o]);return h.createElement(Vm,{styles:Ym(a,!t,o,n?"":"!important")})},Co=!1;if(typeof window<"u")try{var jn=Object.defineProperty({},"passive",{get:function(){return Co=!0,!0}});window.addEventListener("test",jn,jn),window.removeEventListener("test",jn,jn)}catch{Co=!1}var Dt=Co?{passive:!1}:!1,Um=function(e){return e.tagName==="TEXTAREA"},yi=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Um(e)&&n[t]==="visible")},Km=function(e){return yi(e,"overflowY")},Qm=function(e){return yi(e,"overflowX")},wi=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=xi(e,r);if(o){var a=Ci(e,r),i=a[1],l=a[2];if(i>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},qm=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Xm=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},xi=function(e,t){return e==="v"?Km(t):Qm(t)},Ci=function(e,t){return e==="v"?qm(t):Xm(t)},Zm=function(e,t){return e==="h"&&t==="rtl"?-1:1},Jm=function(e,t,n,r,o){var a=Zm(e,window.getComputedStyle(t).direction),i=a*r,l=n.target,c=t.contains(l),d=!1,u=i>0,f=0,p=0;do{if(!l)break;var v=Ci(e,l),b=v[0],g=v[1],m=v[2],w=g-m-a*b;(b||w)&&xi(e,l)&&(f+=w,p+=b);var y=l.parentNode;l=y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?y.host:y}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(u&&Math.abs(f)<1||!u&&Math.abs(p)<1)&&(d=!0),d},Gn=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ni=function(e){return[e.deltaX,e.deltaY]},Si=function(e){return e&&"current"in e?e.current:e},Rm=function(e,t){return e[0]===t[0]&&e[1]===t[1]},ev=function(e){return`
|
|
39
39
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
40
40
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
41
|
-
`)},tv=0,Ot=[];function nv(e){var t=h.useRef([]),n=h.useRef([0,0]),r=h.useRef(),o=h.useState(tv++)[0],a=h.useState(vi)[0],i=h.useRef(e);h.useEffect(function(){i.current=e},[e]),h.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var g=Nm([e.lockRef.current],(e.shards||[]).map(Si),!0).filter(Boolean);return g.forEach(function(m){return m.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),g.forEach(function(m){return m.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=h.useCallback(function(g,m){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!i.current.allowPinchZoom;var w=Gn(g),y=n.current,C="deltaX"in g?g.deltaX:y[0]-w[0],N="deltaY"in g?g.deltaY:y[1]-w[1],S,_=g.target,E=Math.abs(C)>Math.abs(N)?"h":"v";if("touches"in g&&E==="h"&&_.type==="range")return!1;var A=window.getSelection(),B=A&&A.anchorNode,V=B?B===_||B.contains(_):!1;if(V)return!1;var z=wi(E,_);if(!z)return!0;if(z?S=E:(S=E==="v"?"h":"v",z=wi(E,_)),!z)return!1;if(!r.current&&"changedTouches"in g&&(C||N)&&(r.current=S),!S)return!0;var G=r.current||S;return Jm(G,m,g,G==="h"?C:N)},[]),c=h.useCallback(function(g){var m=g;if(!(!Ot.length||Ot[Ot.length-1]!==a)){var w="deltaY"in m?Ni(m):Gn(m),y=t.current.filter(function(S){return S.name===m.type&&(S.target===m.target||m.target===S.shadowParent)&&Rm(S.delta,w)})[0];if(y&&y.should){m.cancelable&&m.preventDefault();return}if(!y){var C=(i.current.shards||[]).map(Si).filter(Boolean).filter(function(S){return S.contains(m.target)}),N=C.length>0?l(m,C[0]):!i.current.noIsolation;N&&m.cancelable&&m.preventDefault()}}},[]),d=h.useCallback(function(g,m,w,y){var C={name:g,delta:m,target:w,should:y,shadowParent:rv(w)};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(N){return N!==C})},1)},[]),u=h.useCallback(function(g){n.current=Gn(g),r.current=void 0},[]),f=h.useCallback(function(g){d(g.type,Ni(g),g.target,l(g,e.lockRef.current))},[]),p=h.useCallback(function(g){d(g.type,Gn(g),g.target,l(g,e.lockRef.current))},[]);h.useEffect(function(){return Ot.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",c,Dt),document.addEventListener("touchmove",c,Dt),document.addEventListener("touchstart",u,Dt),function(){Ot=Ot.filter(function(g){return g!==a}),document.removeEventListener("wheel",c,Dt),document.removeEventListener("touchmove",c,Dt),document.removeEventListener("touchstart",u,Dt)}},[]);var v=e.removeScrollBar,b=e.inert;return h.createElement(h.Fragment,null,b?h.createElement(a,{styles:ev(o)}):null,v?h.createElement(Gm,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function rv(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const ov=Dm(mi,nv);var Un=h.forwardRef(function(e,t){return h.createElement(Yn,Ue({},e,{ref:t,sideCar:ov}))});Un.classNames=Yn.classNames;var Kn="Popover",[Ai]=ke(Kn,[_t]),Zt=_t(),[av,ot]=Ai(Kn),ki=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:a,modal:i=!1}=e,l=Zt(t),c=h.useRef(null),[d,u]=h.useState(!1),[f,p]=Ne({prop:r,defaultProp:o??!1,onChange:a,caller:Kn});return s.jsx(po,{...l,children:s.jsx(av,{scope:t,contentId:Pe(),triggerRef:c,open:f,onOpenChange:p,onOpenToggle:h.useCallback(()=>p(v=>!v),[p]),hasCustomAnchor:d,onCustomAnchorAdd:h.useCallback(()=>u(!0),[]),onCustomAnchorRemove:h.useCallback(()=>u(!1),[]),modal:i,children:n})})};ki.displayName=Kn;var Pi="PopoverAnchor",sv=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=ot(Pi,n),a=Zt(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:l}=o;return h.useEffect(()=>(i(),()=>l()),[i,l]),s.jsx(zn,{...a,...r,ref:t})});sv.displayName=Pi;var Ei="PopoverTrigger",_i=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=ot(Ei,n),a=Zt(n),i=ee(t,o.triggerRef),l=s.jsx(j.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Ii(o.open),...r,ref:i,onClick:H(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?l:s.jsx(zn,{asChild:!0,...a,children:l})});_i.displayName=Ei;var No="PopoverPortal",[iv,lv]=Ai(No,{forceMount:void 0}),Mi=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,a=ot(No,t);return s.jsx(iv,{scope:t,forceMount:n,children:s.jsx(We,{present:n||a.open,children:s.jsx(Xt,{asChild:!0,container:o,children:r})})})};Mi.displayName=No;var It="PopoverContent",Ti=h.forwardRef((e,t)=>{const n=lv(It,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,a=ot(It,e.__scopePopover);return s.jsx(We,{present:r||a.open,children:a.modal?s.jsx(dv,{...o,ref:t}):s.jsx(uv,{...o,ref:t})})});Ti.displayName=It;var cv=mt("PopoverContent.RemoveScroll"),dv=h.forwardRef((e,t)=>{const n=ot(It,e.__scopePopover),r=h.useRef(null),o=ee(t,r),a=h.useRef(!1);return h.useEffect(()=>{const i=r.current;if(i)return bo(i)},[]),s.jsx(Un,{as:cv,allowPinchZoom:!0,children:s.jsx(Di,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:H(e.onCloseAutoFocus,i=>{i.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:H(e.onPointerDownOutside,i=>{const l=i.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;a.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:H(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),uv=h.forwardRef((e,t)=>{const n=ot(It,e.__scopePopover),r=h.useRef(!1),o=h.useRef(!1);return s.jsx(Di,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{e.onCloseAutoFocus?.(a),a.defaultPrevented||(r.current||n.triggerRef.current?.focus(),a.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:a=>{e.onInteractOutside?.(a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=a.target;n.triggerRef.current?.contains(i)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&o.current&&a.preventDefault()}})}),Di=h.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:i,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:u,...f}=e,p=ot(It,n),v=Zt(n);return Zr(),s.jsx(Pn,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:a,children:s.jsx(Ut,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:u,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>p.onOpenChange(!1),children:s.jsx(go,{"data-state":Ii(p.open),role:"dialog",id:p.contentId,...v,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Oi="PopoverClose",fv=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=ot(Oi,n);return s.jsx(j.button,{type:"button",...r,ref:t,onClick:H(e.onClick,()=>o.onOpenChange(!1))})});fv.displayName=Oi;var hv="PopoverArrow",pv=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Zt(n);return s.jsx(mo,{...o,...r,ref:t})});pv.displayName=hv;function Ii(e){return e?"open":"closed"}var Qn=ki,qn=_i,Xn=Mi,Zn=Ti;const Li=ct(["w-full transition-all duration-200 outline-none","disabled:cursor-not-allowed disabled:opacity-50","placeholder:text-gray-500","focus-visible:outline-none"],{variants:{variant:{default:["rounded-3 border border-gray-300 bg-white px-5 text-gray-900 shadow-none","hover:border-gray-400","focus-visible:border-main-500 focus-visible:ring-3 focus-visible:ring-main-300/60"],search:["rounded-3 !h-10 border border-gray-300 bg-white pl-11 pr-4 text-gray-700 placeholder:text-gray-500","hover:border-gray-400","focus-visible:border-main-500 focus-visible:ring-3 focus-visible:ring-main-300/60"]},multiline:{false:"h-10 py-0",true:"min-h-[120px] resize-none py-3 align-top leading-relaxed"}},defaultVariants:{variant:"default",multiline:!1}});function gv(e,t){return"body2"}function mv({label:e,labelHint:t,required:n,htmlFor:r}){return e?s.jsxs("label",{htmlFor:r,className:"mb-2 inline-flex items-center gap-2",children:[s.jsx(O,{size:"body1",weight:"bold",className:"text-gray-900",children:e}),n?s.jsx(O,{size:"body1",weight:"bold",className:"text-main-800",children:"*"}):null,t?s.jsx(O,{size:"body1",weight:"regular",className:"text-gray-500",children:t}):null]}):null}const Jn=h.forwardRef(({className:e,variant:t="default",label:n,labelHint:r,error:o,type:a,multiline:i=!1,rows:l=8,cols:c,required:d,id:u,...f},p)=>{const v=t==="search",b=gv(t,i);return s.jsxs("div",{className:"flex w-full flex-col",children:[s.jsx(mv,{label:n,labelHint:r,required:d,htmlFor:u}),s.jsxs("div",{className:"relative w-full",children:[i?s.jsx("textarea",{id:u,rows:l,cols:c,required:d,className:k(bn({size:b,weight:"regular"}),Li({variant:t,multiline:!0}),e),ref:p,...f}):s.jsx("input",{id:u,type:a,required:d,className:k(bn({size:b,weight:v?"light":"regular"}),Li({variant:t,multiline:!1}),e),ref:p,...f}),v&&!i?s.jsx(Wa,{width:20,height:20,className:"pointer-events-none absolute top-1/2 left-3.5 -translate-y-1/2 text-gray-500"}):null]}),o?s.jsx(O,{size:"caption1",weight:"regular",className:"mt-2 text-warning",children:o}):null]})});Jn.displayName="TextField";const So=h.forwardRef((e,t)=>s.jsx(Jn,{...e,ref:t,multiline:!0}));So.displayName="TextArea";function vv({comment:e,isAuthor:t,onDelete:n,onReport:r}){const[o,a]=P.useState(!1),i=t?[{key:"delete",label:"삭제",onClick:()=>n?.(e),className:"text-red-600"}]:[{key:"report",label:"신고",onClick:()=>r?.(e),className:"text-red-600"}];return s.jsxs(Qn,{open:o,onOpenChange:a,children:[s.jsx(qn,{asChild:!0,children:s.jsxs("button",{type:"button","aria-label":"댓글 더보기 메뉴",onClick:l=>l.stopPropagation(),className:k("inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full","text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-700"),children:[s.jsx("span",{className:"sr-only",children:"더보기"}),s.jsxs("span",{className:"flex items-center gap-0.5",children:[s.jsx("span",{className:"h-1 w-1 rounded-full bg-current"}),s.jsx("span",{className:"h-1 w-1 rounded-full bg-current"}),s.jsx("span",{className:"h-1 w-1 rounded-full bg-current"})]})]})}),s.jsx(Xn,{children:s.jsx(Zn,{align:"end",sideOffset:6,className:k("z-50 min-w-[120px] overflow-hidden rounded-3 border border-gray-200 bg-white p-1.5 shadow-sm","data-[state=closed]:animate-out data-[state=open]:animate-in","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95"),children:s.jsx("div",{className:"flex flex-col gap-0.5",children:i.map(l=>s.jsx("button",{type:"button",className:k("rounded-2 px-3 py-2 text-left transition-colors hover:bg-gray-100",l.className),onClick:()=>{l.onClick(),a(!1)},children:s.jsx(O,{size:"caption1",weight:"medium",children:l.label})},l.key))})})})]})}function Fi({comment:e,depth:t,currentUserId:n,activeReplyTargetId:r,draftReplyContent:o,replyPlaceholder:a,replySubmitLabel:i,replyCancelLabel:l,loadMoreRepliesLabel:c,onReplyOpen:d,onReplyChange:u,onReplySubmit:f,onReplyCancel:p,onLoadMoreReplies:v,onDelete:b,onReport:g}){const m=typeof e.isAuthor=="boolean"?e.isAuthor:!!(n&&e.author.id===n),w=!!e.replies?.length,y=r===e.id,C=!!e.hasMoreReplies;return s.jsx("li",{children:s.jsxs("article",{onClick:()=>d(e),className:k("flex cursor-text gap-3 rounded-3 border px-3.5 py-3",t===0?"border-gray-200 bg-white":"border-gray-100 bg-gray-50/70"),children:[s.jsx(wt,{imageUrl:e.author.profileImageUrl,size:t>0?"sm":"md",className:"shrink-0"}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"relative pr-10",children:[s.jsx("div",{className:"flex items-start gap-2",children:s.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1",children:[s.jsx(O,{size:"caption1",weight:"bold",className:"text-gray-900",children:e.author.nickname}),s.jsx(O,{size:"caption2",weight:"regular",className:"text-gray-500",children:e.createdAt})]})}),s.jsx("div",{className:"absolute top-0 right-0",children:s.jsx(vv,{comment:e,isAuthor:m,onDelete:b,onReport:g})}),s.jsx(O,{as:"p",size:"caption1",weight:"regular",className:"mt-0.5 leading-relaxed break-words whitespace-pre-wrap text-gray-800",children:e.content})]}),w?s.jsx("ul",{className:"mt-3 space-y-2.5",children:e.replies?.map(N=>s.jsx(Fi,{comment:N,depth:t+1,currentUserId:n,activeReplyTargetId:r,draftReplyContent:o,replyPlaceholder:a,replySubmitLabel:i,replyCancelLabel:l,loadMoreRepliesLabel:c,onReplyOpen:d,onReplyChange:u,onReplySubmit:f,onReplyCancel:p,onLoadMoreReplies:v,onDelete:b,onReport:g},N.id))}):null,s.jsx("div",{"aria-hidden":!y,className:k("overflow-hidden transition-all duration-250 ease-out",y?"mt-2.5 max-h-[260px] opacity-100":"mt-0 max-h-0 opacity-0 pointer-events-none"),onClick:N=>N.stopPropagation(),children:s.jsxs("div",{className:"rounded-2 border border-gray-200 bg-white p-2.5",children:[s.jsx(So,{value:o,onChange:N=>u(N.target.value),placeholder:a,rows:4,className:"min-h-[84px]"}),s.jsxs("div",{className:"mt-2 flex items-center justify-end gap-2",children:[s.jsx("button",{type:"button",className:"rounded-2 px-2.5 py-1.5 text-gray-600 transition-colors hover:bg-gray-100 hover:text-gray-800",onClick:p,children:s.jsx(O,{size:"caption2",weight:"medium",children:l})}),s.jsx("button",{type:"button",className:k("rounded-2 bg-main-800 px-2.5 py-1.5 text-white transition-colors hover:bg-main-700",!o.trim()&&"cursor-not-allowed bg-main-400 hover:bg-main-400"),onClick:()=>f(e),disabled:!o.trim(),children:s.jsx(O,{size:"caption2",weight:"bold",children:i})})]})]})}),C?s.jsx("button",{type:"button",className:"mt-2.5 inline-flex rounded-2 px-2 py-1 text-gray-600 transition-colors hover:bg-gray-100 hover:text-gray-800",onClick:N=>{N.stopPropagation(),v?.(e)},disabled:e.isLoadingReplies,children:s.jsx(O,{size:"caption2",weight:"medium",children:e.isLoadingReplies?"불러오는 중...":`${c}${typeof e.remainingReplyCount=="number"?` (${e.remainingReplyCount})`:""}`})}):null]})]})})}function bv({comments:e,currentUserId:t,className:n,replyPlaceholder:r="댓글을 입력하세요.",replySubmitLabel:o="등록",replyCancelLabel:a="취소",loadMoreRepliesLabel:i="대댓글 더보기",onReplySubmit:l,onLoadMoreReplies:c,onDelete:d,onReport:u}){const[f,p]=P.useState(null),[v,b]=P.useState(""),g=y=>{p(y.id),b("")},m=()=>{p(null),b("")},w=y=>{const C=v.trim();C&&(l?.(y,C),b(""),p(null))};return e.length?s.jsx("ul",{className:k("space-y-4",n),children:e.map(y=>s.jsx(Fi,{comment:y,depth:0,currentUserId:t,activeReplyTargetId:f,draftReplyContent:v,replyPlaceholder:r,replySubmitLabel:o,replyCancelLabel:a,loadMoreRepliesLabel:i,onReplyOpen:g,onReplyChange:b,onReplySubmit:w,onReplyCancel:m,onLoadMoreReplies:c,onDelete:d,onReport:u},y.id))}):s.jsx("div",{className:k("rounded-3 border border-gray-200 bg-white px-4 py-5",n),children:s.jsx(O,{size:"caption1",weight:"regular",className:"text-gray-500",children:"아직 댓글이 없습니다."})})}const Ao=P.forwardRef(({label:e,placeholder:t,className:n,type:r="button",...o},a)=>s.jsxs("button",{ref:a,type:r,className:k("group flex h-10 w-full items-center justify-between gap-3 rounded-3 border border-gray-300 bg-white px-5","transition-colors duration-200","data-[state=open]:border-main-500 hover:border-gray-400 focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-main-300/60",n),...o,children:[s.jsx(O,{size:"body2",weight:"medium",className:k(e?"text-gray-900":"text-gray-500"),children:e??t}),s.jsx(Oa,{className:"h-6 w-6 text-gray-600",strokeWidth:2.2})]}));Ao.displayName="PickerTrigger";function Wi(e){return e?{onMouseDownCapture:t=>t.stopPropagation()}:{}}function yv({value:e,onChange:t,className:n,placeholder:r="YYYY/MM/DD",disableClickPropagation:o=!1}){const[a,i]=P.useState(!1),l=e?Me(e,"yyyy/MM/dd"):void 0;return s.jsxs(Qn,{open:a,onOpenChange:i,children:[s.jsx(qn,{asChild:!0,children:s.jsx(Ao,{label:l,placeholder:r,className:n})}),s.jsx(Xn,{children:s.jsx(Zn,{className:k("z-50 w-auto rounded-4 border border-gray-300 bg-white p-2 text-gray-900","shadow-[0_10px_20px_rgba(34,34,34,0.12)] outline-none","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2"),align:"start",sideOffset:8,...Wi(o),children:s.jsx(Gr,{mode:"single",selected:e,onSelect:c=>{t(c),c&&i(!1)},initialFocus:!0})})})]})}function wv({value:e,onChange:t,className:n,placeholder:r="기간을 선택해주세요",disableClickPropagation:o=!1}){const[a,i]=P.useState(!1),l=P.useRef(!1),c=e?.from&&e?.to?`${Me(e.from,"yyyy/MM/dd")} - ${Me(e.to,"yyyy/MM/dd")}`:e?.from?`${Me(e.from,"yyyy/MM/dd")} -`:void 0;return s.jsxs(Qn,{open:a,onOpenChange:d=>{if(i(d),d){l.current=!!(e?.from&&e?.to);return}l.current=!1},children:[s.jsx(qn,{asChild:!0,children:s.jsx(Ao,{label:c,placeholder:r,className:n})}),s.jsx(Xn,{children:s.jsx(Zn,{className:k("z-50 w-auto rounded-4 border border-gray-300 bg-white p-2 text-gray-900","shadow-[0_10px_20px_rgba(34,34,34,0.12)] outline-none","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2"),align:"start",sideOffset:8,...Wi(o),children:s.jsx(Gr,{mode:"range",selected:e,onSelect:(d,u)=>{if(l.current&&u){t({from:u,to:void 0}),l.current=!1;return}t(d),d?.from&&d?.to&&(i(!1),l.current=!1)},initialFocus:!0})})})]})}var Rn="Dialog",[zi]=ke(Rn),[xv,Ie]=zi(Rn),Bi=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:a,modal:i=!0}=e,l=h.useRef(null),c=h.useRef(null),[d,u]=Ne({prop:r,defaultProp:o??!1,onChange:a,caller:Rn});return s.jsx(xv,{scope:t,triggerRef:l,contentRef:c,contentId:Pe(),titleId:Pe(),descriptionId:Pe(),open:d,onOpenChange:u,onOpenToggle:h.useCallback(()=>u(f=>!f),[u]),modal:i,children:n})};Bi.displayName=Rn;var $i="DialogTrigger",Hi=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ie($i,n),a=ee(t,o.triggerRef);return s.jsx(j.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Eo(o.open),...r,ref:a,onClick:H(e.onClick,o.onOpenToggle)})});Hi.displayName=$i;var ko="DialogPortal",[Cv,Vi]=zi(ko,{forceMount:void 0}),Yi=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,a=Ie(ko,t);return s.jsx(Cv,{scope:t,forceMount:n,children:h.Children.map(r,i=>s.jsx(We,{present:n||a.open,children:s.jsx(Xt,{asChild:!0,container:o,children:i})}))})};Yi.displayName=ko;var er="DialogOverlay",ji=h.forwardRef((e,t)=>{const n=Vi(er,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,a=Ie(er,e.__scopeDialog);return a.modal?s.jsx(We,{present:r||a.open,children:s.jsx(Sv,{...o,ref:t})}):null});ji.displayName=er;var Nv=mt("DialogOverlay.RemoveScroll"),Sv=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ie(er,n);return s.jsx(Un,{as:Nv,allowPinchZoom:!0,shards:[o.contentRef],children:s.jsx(j.div,{"data-state":Eo(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),ht="DialogContent",Gi=h.forwardRef((e,t)=>{const n=Vi(ht,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,a=Ie(ht,e.__scopeDialog);return s.jsx(We,{present:r||a.open,children:a.modal?s.jsx(Av,{...o,ref:t}):s.jsx(kv,{...o,ref:t})})});Gi.displayName=ht;var Av=h.forwardRef((e,t)=>{const n=Ie(ht,e.__scopeDialog),r=h.useRef(null),o=ee(t,n.contentRef,r);return h.useEffect(()=>{const a=r.current;if(a)return bo(a)},[]),s.jsx(Ui,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:H(e.onCloseAutoFocus,a=>{a.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:H(e.onPointerDownOutside,a=>{const i=a.detail.originalEvent,l=i.button===0&&i.ctrlKey===!0;(i.button===2||l)&&a.preventDefault()}),onFocusOutside:H(e.onFocusOutside,a=>a.preventDefault())})}),kv=h.forwardRef((e,t)=>{const n=Ie(ht,e.__scopeDialog),r=h.useRef(!1),o=h.useRef(!1);return s.jsx(Ui,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{e.onCloseAutoFocus?.(a),a.defaultPrevented||(r.current||n.triggerRef.current?.focus(),a.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:a=>{e.onInteractOutside?.(a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=a.target;n.triggerRef.current?.contains(i)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&o.current&&a.preventDefault()}})}),Ui=h.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:a,...i}=e,l=Ie(ht,n),c=h.useRef(null),d=ee(t,c);return Zr(),s.jsxs(s.Fragment,{children:[s.jsx(Pn,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:a,children:s.jsx(Ut,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Eo(l.open),...i,ref:d,onDismiss:()=>l.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(Pv,{titleId:l.titleId}),s.jsx(_v,{contentRef:c,descriptionId:l.descriptionId})]})]})}),Po="DialogTitle",Ki=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ie(Po,n);return s.jsx(j.h2,{id:o.titleId,...r,ref:t})});Ki.displayName=Po;var Qi="DialogDescription",qi=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ie(Qi,n);return s.jsx(j.p,{id:o.descriptionId,...r,ref:t})});qi.displayName=Qi;var Xi="DialogClose",Zi=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ie(Xi,n);return s.jsx(j.button,{type:"button",...r,ref:t,onClick:H(e.onClick,()=>o.onOpenChange(!1))})});Zi.displayName=Xi;function Eo(e){return e?"open":"closed"}var Ji="DialogTitleWarning",[my,Ri]=ic(Ji,{contentName:ht,titleName:Po,docsSlug:"dialog"}),Pv=({titleId:e})=>{const t=Ri(Ji),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
41
|
+
`)},tv=0,Ot=[];function nv(e){var t=h.useRef([]),n=h.useRef([0,0]),r=h.useRef(),o=h.useState(tv++)[0],a=h.useState(vi)[0],i=h.useRef(e);h.useEffect(function(){i.current=e},[e]),h.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var g=Nm([e.lockRef.current],(e.shards||[]).map(Si),!0).filter(Boolean);return g.forEach(function(m){return m.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),g.forEach(function(m){return m.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=h.useCallback(function(g,m){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!i.current.allowPinchZoom;var w=Gn(g),y=n.current,C="deltaX"in g?g.deltaX:y[0]-w[0],N="deltaY"in g?g.deltaY:y[1]-w[1],S,_=g.target,E=Math.abs(C)>Math.abs(N)?"h":"v";if("touches"in g&&E==="h"&&_.type==="range")return!1;var A=window.getSelection(),B=A&&A.anchorNode,V=B?B===_||B.contains(_):!1;if(V)return!1;var z=wi(E,_);if(!z)return!0;if(z?S=E:(S=E==="v"?"h":"v",z=wi(E,_)),!z)return!1;if(!r.current&&"changedTouches"in g&&(C||N)&&(r.current=S),!S)return!0;var G=r.current||S;return Jm(G,m,g,G==="h"?C:N)},[]),c=h.useCallback(function(g){var m=g;if(!(!Ot.length||Ot[Ot.length-1]!==a)){var w="deltaY"in m?Ni(m):Gn(m),y=t.current.filter(function(S){return S.name===m.type&&(S.target===m.target||m.target===S.shadowParent)&&Rm(S.delta,w)})[0];if(y&&y.should){m.cancelable&&m.preventDefault();return}if(!y){var C=(i.current.shards||[]).map(Si).filter(Boolean).filter(function(S){return S.contains(m.target)}),N=C.length>0?l(m,C[0]):!i.current.noIsolation;N&&m.cancelable&&m.preventDefault()}}},[]),d=h.useCallback(function(g,m,w,y){var C={name:g,delta:m,target:w,should:y,shadowParent:rv(w)};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(N){return N!==C})},1)},[]),u=h.useCallback(function(g){n.current=Gn(g),r.current=void 0},[]),f=h.useCallback(function(g){d(g.type,Ni(g),g.target,l(g,e.lockRef.current))},[]),p=h.useCallback(function(g){d(g.type,Gn(g),g.target,l(g,e.lockRef.current))},[]);h.useEffect(function(){return Ot.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",c,Dt),document.addEventListener("touchmove",c,Dt),document.addEventListener("touchstart",u,Dt),function(){Ot=Ot.filter(function(g){return g!==a}),document.removeEventListener("wheel",c,Dt),document.removeEventListener("touchmove",c,Dt),document.removeEventListener("touchstart",u,Dt)}},[]);var v=e.removeScrollBar,b=e.inert;return h.createElement(h.Fragment,null,b?h.createElement(a,{styles:ev(o)}):null,v?h.createElement(Gm,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function rv(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const ov=Dm(mi,nv);var Un=h.forwardRef(function(e,t){return h.createElement(Yn,Ue({},e,{ref:t,sideCar:ov}))});Un.classNames=Yn.classNames;var Kn="Popover",[Ai]=ke(Kn,[_t]),Zt=_t(),[av,ot]=Ai(Kn),ki=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:a,modal:i=!1}=e,l=Zt(t),c=h.useRef(null),[d,u]=h.useState(!1),[f,p]=Ne({prop:r,defaultProp:o??!1,onChange:a,caller:Kn});return s.jsx(po,{...l,children:s.jsx(av,{scope:t,contentId:Pe(),triggerRef:c,open:f,onOpenChange:p,onOpenToggle:h.useCallback(()=>p(v=>!v),[p]),hasCustomAnchor:d,onCustomAnchorAdd:h.useCallback(()=>u(!0),[]),onCustomAnchorRemove:h.useCallback(()=>u(!1),[]),modal:i,children:n})})};ki.displayName=Kn;var Pi="PopoverAnchor",sv=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=ot(Pi,n),a=Zt(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:l}=o;return h.useEffect(()=>(i(),()=>l()),[i,l]),s.jsx(zn,{...a,...r,ref:t})});sv.displayName=Pi;var Ei="PopoverTrigger",_i=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=ot(Ei,n),a=Zt(n),i=ee(t,o.triggerRef),l=s.jsx(j.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Ii(o.open),...r,ref:i,onClick:H(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?l:s.jsx(zn,{asChild:!0,...a,children:l})});_i.displayName=Ei;var No="PopoverPortal",[iv,lv]=Ai(No,{forceMount:void 0}),Mi=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,a=ot(No,t);return s.jsx(iv,{scope:t,forceMount:n,children:s.jsx(We,{present:n||a.open,children:s.jsx(Xt,{asChild:!0,container:o,children:r})})})};Mi.displayName=No;var It="PopoverContent",Ti=h.forwardRef((e,t)=>{const n=lv(It,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,a=ot(It,e.__scopePopover);return s.jsx(We,{present:r||a.open,children:a.modal?s.jsx(dv,{...o,ref:t}):s.jsx(uv,{...o,ref:t})})});Ti.displayName=It;var cv=mt("PopoverContent.RemoveScroll"),dv=h.forwardRef((e,t)=>{const n=ot(It,e.__scopePopover),r=h.useRef(null),o=ee(t,r),a=h.useRef(!1);return h.useEffect(()=>{const i=r.current;if(i)return bo(i)},[]),s.jsx(Un,{as:cv,allowPinchZoom:!0,children:s.jsx(Di,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:H(e.onCloseAutoFocus,i=>{i.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:H(e.onPointerDownOutside,i=>{const l=i.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;a.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:H(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),uv=h.forwardRef((e,t)=>{const n=ot(It,e.__scopePopover),r=h.useRef(!1),o=h.useRef(!1);return s.jsx(Di,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{e.onCloseAutoFocus?.(a),a.defaultPrevented||(r.current||n.triggerRef.current?.focus(),a.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:a=>{e.onInteractOutside?.(a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=a.target;n.triggerRef.current?.contains(i)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&o.current&&a.preventDefault()}})}),Di=h.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:i,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:u,...f}=e,p=ot(It,n),v=Zt(n);return Zr(),s.jsx(Pn,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:a,children:s.jsx(Ut,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:u,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>p.onOpenChange(!1),children:s.jsx(go,{"data-state":Ii(p.open),role:"dialog",id:p.contentId,...v,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Oi="PopoverClose",fv=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=ot(Oi,n);return s.jsx(j.button,{type:"button",...r,ref:t,onClick:H(e.onClick,()=>o.onOpenChange(!1))})});fv.displayName=Oi;var hv="PopoverArrow",pv=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Zt(n);return s.jsx(mo,{...o,...r,ref:t})});pv.displayName=hv;function Ii(e){return e?"open":"closed"}var Qn=ki,qn=_i,Xn=Mi,Zn=Ti;const Li=ct(["w-full transition-all duration-200 outline-none","disabled:cursor-not-allowed disabled:opacity-50","placeholder:text-gray-500","focus-visible:outline-none"],{variants:{variant:{default:["rounded-3 border border-gray-300 bg-white px-5 text-gray-900 shadow-none","hover:border-gray-400","focus-visible:border-main-500 focus-visible:ring-3 focus-visible:ring-main-300/60"],search:["rounded-3 !h-10 border border-gray-300 bg-white pl-11 pr-4 text-gray-700 placeholder:text-gray-500","hover:border-gray-400","focus-visible:border-main-500 focus-visible:ring-3 focus-visible:ring-main-300/60"]},multiline:{false:"h-10 py-0",true:"min-h-[120px] resize-none py-3 align-top leading-relaxed"}},defaultVariants:{variant:"default",multiline:!1}});function gv(e,t){return"body2"}function mv({label:e,labelHint:t,required:n,htmlFor:r}){return e?s.jsxs("label",{htmlFor:r,className:"mb-2 inline-flex items-center gap-2",children:[s.jsx(O,{size:"body1",weight:"bold",className:"text-gray-900",children:e}),n?s.jsx(O,{size:"body1",weight:"bold",className:"text-main-800",children:"*"}):null,t?s.jsx(O,{size:"body1",weight:"regular",className:"text-gray-500",children:t}):null]}):null}const Jn=h.forwardRef(({className:e,variant:t="default",label:n,labelHint:r,error:o,type:a,multiline:i=!1,rows:l=8,cols:c,required:d,id:u,...f},p)=>{const v=t==="search",b=gv(t,i);return s.jsxs("div",{className:"flex w-full flex-col",children:[s.jsx(mv,{label:n,labelHint:r,required:d,htmlFor:u}),s.jsxs("div",{className:"relative w-full",children:[i?s.jsx("textarea",{id:u,rows:l,cols:c,required:d,className:k(bn({size:b,weight:"regular"}),Li({variant:t,multiline:!0}),e),ref:p,...f}):s.jsx("input",{id:u,type:a,required:d,className:k(bn({size:b,weight:v?"light":"regular"}),Li({variant:t,multiline:!1}),e),ref:p,...f}),v&&!i?s.jsx(Wa,{width:20,height:20,className:"pointer-events-none absolute top-1/2 left-3.5 -translate-y-1/2 text-gray-500"}):null]}),o?s.jsx(O,{size:"caption1",weight:"regular",className:"mt-2 text-warning",children:o}):null]})});Jn.displayName="TextField";const So=h.forwardRef((e,t)=>s.jsx(Jn,{...e,ref:t,multiline:!0}));So.displayName="TextArea";function vv({comment:e,isAuthor:t,onDelete:n,onReport:r}){const[o,a]=P.useState(!1),i=t?[{key:"delete",label:"삭제",onClick:()=>n?.(e),className:"text-red-600"}]:[{key:"report",label:"신고",onClick:()=>r?.(e),className:"text-red-600"}];return s.jsxs(Qn,{open:o,onOpenChange:a,children:[s.jsx(qn,{asChild:!0,children:s.jsxs("button",{type:"button","aria-label":"댓글 더보기 메뉴",onClick:l=>l.stopPropagation(),className:k("inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full","text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-700"),children:[s.jsx("span",{className:"sr-only",children:"더보기"}),s.jsxs("span",{className:"flex items-center gap-0.5",children:[s.jsx("span",{className:"h-1 w-1 rounded-full bg-current"}),s.jsx("span",{className:"h-1 w-1 rounded-full bg-current"}),s.jsx("span",{className:"h-1 w-1 rounded-full bg-current"})]})]})}),s.jsx(Xn,{children:s.jsx(Zn,{align:"end",sideOffset:6,className:k("z-50 min-w-[120px] overflow-hidden rounded-3 border border-gray-200 bg-white p-1.5 shadow-sm","data-[state=closed]:animate-out data-[state=open]:animate-in","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95"),children:s.jsx("div",{className:"flex flex-col gap-0.5",children:i.map(l=>s.jsx("button",{type:"button",className:k("rounded-2 px-3 py-2 text-left transition-colors hover:bg-gray-100",l.className),onClick:()=>{l.onClick(),a(!1)},children:s.jsx(O,{size:"caption1",weight:"medium",children:l.label})},l.key))})})})]})}function Fi({comment:e,depth:t,currentUserId:n,activeReplyTargetId:r,draftReplyContent:o,replyPlaceholder:a,replySubmitLabel:i,replyCancelLabel:l,loadMoreRepliesLabel:c,onReplyOpen:d,onReplyChange:u,onReplySubmit:f,onReplyCancel:p,onLoadMoreReplies:v,onDelete:b,onReport:g}){const m=typeof e.isAuthor=="boolean"?e.isAuthor:!!(n&&e.author.id===n),w=!!e.replies?.length,y=r===e.id,C=!!e.hasMoreReplies;return s.jsx("li",{children:s.jsxs("article",{onClick:()=>d(e),className:k("flex cursor-text gap-3 rounded-3 border px-3.5 py-3",t===0?"border-gray-200 bg-white":"border-gray-100 bg-gray-50/70"),children:[s.jsx(wt,{imageUrl:e.author.profileImageUrl,size:t>0?"sm":"md",className:"shrink-0"}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"relative pr-10",children:[s.jsx("div",{className:"flex items-start gap-2",children:s.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1",children:[s.jsx(O,{size:"caption1",weight:"bold",className:"text-gray-900",children:e.author.nickname}),s.jsx(O,{size:"caption2",weight:"regular",className:"text-gray-500",children:e.createdAt})]})}),s.jsx("div",{className:"absolute top-0 right-0",children:s.jsx(vv,{comment:e,isAuthor:m,onDelete:b,onReport:g})}),s.jsx(O,{as:"p",size:"body2",weight:"regular",className:"mt-0.5 leading-relaxed break-words whitespace-pre-wrap text-gray-800",children:e.content})]}),w?s.jsx("ul",{className:"mt-3 space-y-2.5",children:e.replies?.map(N=>s.jsx(Fi,{comment:N,depth:t+1,currentUserId:n,activeReplyTargetId:r,draftReplyContent:o,replyPlaceholder:a,replySubmitLabel:i,replyCancelLabel:l,loadMoreRepliesLabel:c,onReplyOpen:d,onReplyChange:u,onReplySubmit:f,onReplyCancel:p,onLoadMoreReplies:v,onDelete:b,onReport:g},N.id))}):null,s.jsx("div",{"aria-hidden":!y,className:k("overflow-hidden transition-all duration-250 ease-out",y?"mt-2.5 max-h-[260px] opacity-100":"mt-0 max-h-0 opacity-0 pointer-events-none"),onClick:N=>N.stopPropagation(),children:s.jsxs("div",{className:"rounded-2 border border-gray-200 bg-white p-2.5",children:[s.jsx(So,{value:o,onChange:N=>u(N.target.value),placeholder:a,rows:4,className:"min-h-[84px]"}),s.jsxs("div",{className:"mt-2 flex items-center justify-end gap-2",children:[s.jsx("button",{type:"button",className:"rounded-2 px-2.5 py-1.5 text-gray-600 transition-colors hover:bg-gray-100 hover:text-gray-800",onClick:p,children:s.jsx(O,{size:"caption2",weight:"medium",children:l})}),s.jsx("button",{type:"button",className:k("rounded-2 bg-main-800 px-2.5 py-1.5 text-white transition-colors hover:bg-main-700",!o.trim()&&"cursor-not-allowed bg-main-400 hover:bg-main-400"),onClick:()=>f(e),disabled:!o.trim(),children:s.jsx(O,{size:"caption2",weight:"bold",children:i})})]})]})}),C?s.jsx("button",{type:"button",className:"mt-2.5 inline-flex rounded-2 px-2 py-1 text-gray-600 transition-colors hover:bg-gray-100 hover:text-gray-800",onClick:N=>{N.stopPropagation(),v?.(e)},disabled:e.isLoadingReplies,children:s.jsx(O,{size:"caption2",weight:"medium",children:e.isLoadingReplies?"불러오는 중...":`${c}${typeof e.remainingReplyCount=="number"?` (${e.remainingReplyCount})`:""}`})}):null]})]})})}function bv({comments:e,currentUserId:t,className:n,replyPlaceholder:r="댓글을 입력하세요.",replySubmitLabel:o="등록",replyCancelLabel:a="취소",loadMoreRepliesLabel:i="대댓글 더보기",onReplySubmit:l,onLoadMoreReplies:c,onDelete:d,onReport:u}){const[f,p]=P.useState(null),[v,b]=P.useState(""),g=y=>{p(y.id),b("")},m=()=>{p(null),b("")},w=y=>{const C=v.trim();C&&(l?.(y,C),b(""),p(null))};return e.length?s.jsx("ul",{className:k("space-y-4",n),children:e.map(y=>s.jsx(Fi,{comment:y,depth:0,currentUserId:t,activeReplyTargetId:f,draftReplyContent:v,replyPlaceholder:r,replySubmitLabel:o,replyCancelLabel:a,loadMoreRepliesLabel:i,onReplyOpen:g,onReplyChange:b,onReplySubmit:w,onReplyCancel:m,onLoadMoreReplies:c,onDelete:d,onReport:u},y.id))}):s.jsx("div",{className:k("rounded-3 border border-gray-200 bg-white px-4 py-5",n),children:s.jsx(O,{size:"caption1",weight:"regular",className:"text-gray-500",children:"아직 댓글이 없습니다."})})}const Ao=P.forwardRef(({label:e,placeholder:t,className:n,type:r="button",...o},a)=>s.jsxs("button",{ref:a,type:r,className:k("group flex h-10 w-full items-center justify-between gap-3 rounded-3 border border-gray-300 bg-white px-5","transition-colors duration-200","data-[state=open]:border-main-500 hover:border-gray-400 focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-main-300/60",n),...o,children:[s.jsx(O,{size:"body2",weight:"medium",className:k(e?"text-gray-900":"text-gray-500"),children:e??t}),s.jsx(Oa,{className:"h-6 w-6 text-gray-600",strokeWidth:2.2})]}));Ao.displayName="PickerTrigger";function Wi(e){return e?{onMouseDownCapture:t=>t.stopPropagation()}:{}}function yv({value:e,onChange:t,className:n,placeholder:r="YYYY/MM/DD",disableClickPropagation:o=!1}){const[a,i]=P.useState(!1),l=e?Me(e,"yyyy/MM/dd"):void 0;return s.jsxs(Qn,{open:a,onOpenChange:i,children:[s.jsx(qn,{asChild:!0,children:s.jsx(Ao,{label:l,placeholder:r,className:n})}),s.jsx(Xn,{children:s.jsx(Zn,{className:k("z-50 w-auto rounded-4 border border-gray-300 bg-white p-2 text-gray-900","shadow-[0_10px_20px_rgba(34,34,34,0.12)] outline-none","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2"),align:"start",sideOffset:8,...Wi(o),children:s.jsx(Gr,{mode:"single",selected:e,onSelect:c=>{t(c),c&&i(!1)},initialFocus:!0})})})]})}function wv({value:e,onChange:t,className:n,placeholder:r="기간을 선택해주세요",disableClickPropagation:o=!1}){const[a,i]=P.useState(!1),l=P.useRef(!1),c=e?.from&&e?.to?`${Me(e.from,"yyyy/MM/dd")} - ${Me(e.to,"yyyy/MM/dd")}`:e?.from?`${Me(e.from,"yyyy/MM/dd")} -`:void 0;return s.jsxs(Qn,{open:a,onOpenChange:d=>{if(i(d),d){l.current=!!(e?.from&&e?.to);return}l.current=!1},children:[s.jsx(qn,{asChild:!0,children:s.jsx(Ao,{label:c,placeholder:r,className:n})}),s.jsx(Xn,{children:s.jsx(Zn,{className:k("z-50 w-auto rounded-4 border border-gray-300 bg-white p-2 text-gray-900","shadow-[0_10px_20px_rgba(34,34,34,0.12)] outline-none","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2"),align:"start",sideOffset:8,...Wi(o),children:s.jsx(Gr,{mode:"range",selected:e,onSelect:(d,u)=>{if(l.current&&u){t({from:u,to:void 0}),l.current=!1;return}t(d),d?.from&&d?.to&&(i(!1),l.current=!1)},initialFocus:!0})})})]})}var Rn="Dialog",[zi]=ke(Rn),[xv,Ie]=zi(Rn),Bi=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:a,modal:i=!0}=e,l=h.useRef(null),c=h.useRef(null),[d,u]=Ne({prop:r,defaultProp:o??!1,onChange:a,caller:Rn});return s.jsx(xv,{scope:t,triggerRef:l,contentRef:c,contentId:Pe(),titleId:Pe(),descriptionId:Pe(),open:d,onOpenChange:u,onOpenToggle:h.useCallback(()=>u(f=>!f),[u]),modal:i,children:n})};Bi.displayName=Rn;var $i="DialogTrigger",Hi=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ie($i,n),a=ee(t,o.triggerRef);return s.jsx(j.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Eo(o.open),...r,ref:a,onClick:H(e.onClick,o.onOpenToggle)})});Hi.displayName=$i;var ko="DialogPortal",[Cv,Vi]=zi(ko,{forceMount:void 0}),Yi=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,a=Ie(ko,t);return s.jsx(Cv,{scope:t,forceMount:n,children:h.Children.map(r,i=>s.jsx(We,{present:n||a.open,children:s.jsx(Xt,{asChild:!0,container:o,children:i})}))})};Yi.displayName=ko;var er="DialogOverlay",ji=h.forwardRef((e,t)=>{const n=Vi(er,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,a=Ie(er,e.__scopeDialog);return a.modal?s.jsx(We,{present:r||a.open,children:s.jsx(Sv,{...o,ref:t})}):null});ji.displayName=er;var Nv=mt("DialogOverlay.RemoveScroll"),Sv=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ie(er,n);return s.jsx(Un,{as:Nv,allowPinchZoom:!0,shards:[o.contentRef],children:s.jsx(j.div,{"data-state":Eo(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),ht="DialogContent",Gi=h.forwardRef((e,t)=>{const n=Vi(ht,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,a=Ie(ht,e.__scopeDialog);return s.jsx(We,{present:r||a.open,children:a.modal?s.jsx(Av,{...o,ref:t}):s.jsx(kv,{...o,ref:t})})});Gi.displayName=ht;var Av=h.forwardRef((e,t)=>{const n=Ie(ht,e.__scopeDialog),r=h.useRef(null),o=ee(t,n.contentRef,r);return h.useEffect(()=>{const a=r.current;if(a)return bo(a)},[]),s.jsx(Ui,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:H(e.onCloseAutoFocus,a=>{a.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:H(e.onPointerDownOutside,a=>{const i=a.detail.originalEvent,l=i.button===0&&i.ctrlKey===!0;(i.button===2||l)&&a.preventDefault()}),onFocusOutside:H(e.onFocusOutside,a=>a.preventDefault())})}),kv=h.forwardRef((e,t)=>{const n=Ie(ht,e.__scopeDialog),r=h.useRef(!1),o=h.useRef(!1);return s.jsx(Ui,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{e.onCloseAutoFocus?.(a),a.defaultPrevented||(r.current||n.triggerRef.current?.focus(),a.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:a=>{e.onInteractOutside?.(a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=a.target;n.triggerRef.current?.contains(i)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&o.current&&a.preventDefault()}})}),Ui=h.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:a,...i}=e,l=Ie(ht,n),c=h.useRef(null),d=ee(t,c);return Zr(),s.jsxs(s.Fragment,{children:[s.jsx(Pn,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:a,children:s.jsx(Ut,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Eo(l.open),...i,ref:d,onDismiss:()=>l.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(Pv,{titleId:l.titleId}),s.jsx(_v,{contentRef:c,descriptionId:l.descriptionId})]})]})}),Po="DialogTitle",Ki=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ie(Po,n);return s.jsx(j.h2,{id:o.titleId,...r,ref:t})});Ki.displayName=Po;var Qi="DialogDescription",qi=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ie(Qi,n);return s.jsx(j.p,{id:o.descriptionId,...r,ref:t})});qi.displayName=Qi;var Xi="DialogClose",Zi=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ie(Xi,n);return s.jsx(j.button,{type:"button",...r,ref:t,onClick:H(e.onClick,()=>o.onOpenChange(!1))})});Zi.displayName=Xi;function Eo(e){return e?"open":"closed"}var Ji="DialogTitleWarning",[my,Ri]=ic(Ji,{contentName:ht,titleName:Po,docsSlug:"dialog"}),Pv=({titleId:e})=>{const t=Ri(Ji),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
42
42
|
|
|
43
43
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
44
44
|
|