@wizleap-inc/wiz-ui-react 3.0.0 → 3.0.1

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/wiz-ui.es.js CHANGED
@@ -8999,7 +8999,7 @@ const qo = Tt, It = U1({
8999
8999
  showSnackbar: () => {
9000
9000
  }
9001
9001
  }), Hd = () => x1(It), se = (() => {
9002
- if (!window) return 0;
9002
+ if (typeof window > "u") return 0;
9003
9003
  const r = q1("md");
9004
9004
  return !r || r === "auto" ? 0 : r === "9999px" ? 9999 : parseFloat(r) * parseFloat(window.getComputedStyle(document.documentElement).fontSize);
9005
9005
  })(), po = ({ children: r }) => {
@@ -39,7 +39,7 @@ React keys must be passed directly to JSX without using spread:
39
39
  rotate(-${i}rad)
40
40
  `},z=new ResizeObserver(x);return z.observe(w),()=>{z.disconnect()}},[n,i]),h.useEffect(()=>{const f=v.current,w=u.current;if(!f||!w)return;const x=()=>{f.forEach((T,g)=>{const q=w[g];if(!q||!T)return;const j=8;if(q.offsetHeight+j*2<T.offsetHeight){q.style.padding=`${j}px 0`;return}if(q.style.padding="0",q.offsetHeight<T.offsetHeight){q.style.top=(T.offsetHeight-q.offsetHeight)/2+"px";return}q.style.top=q.offsetHeight*-1+"px",q.style.color="#606166"})},z=new ResizeObserver(x);return f.forEach(T=>{T&&z.observe(T)}),()=>{z.disconnect()}},[]),e.jsxs("div",{className:y(a,Cn),style:t,ref:d,children:[e.jsx("span",{className:Zn,ref:c,children:r.label}),p.map((f,w)=>e.jsx("div",{className:y(Bn,f.bgColorStyle),style:f.elementStyle,ref:x=>{v.current[w]=x},children:f.frequency!==0&&e.jsx("span",{className:y(Nn,f.numberColorStyle),ref:x=>{u.current[w]=x},children:f.frequency})},f.id))]})},N6=({className:a,style:t,data:r,maxFrequency:l,ceilN:s=0,barGap:n=.1,barGroupWidth:i=.8,unit:d,unitPosition:c="no",isTilted:v=!1,children:u})=>{const p=c==="intersection"?d:void 0,f=c==="vertical"?d:void 0,w=v?Math.PI/4:0,x=h.useMemo(()=>{if(l)return l;const z=r.map(q=>q.data).flat(),T=Math.max(...z.map(q=>q.frequency)),g=Math.pow(10,s);return Math.ceil(T/g)*g},[s,r,l]);return e.jsxs("div",{className:y(a,bn),style:t,children:[e.jsxs("div",{className:Sn,children:[p&&e.jsxs("span",{className:y(E0,F0.unit),children:["(",p,")"]}),e.jsx("span",{className:y(E0,F0.max),children:x}),e.jsxs("span",{className:y(E0,F0.half),children:[Math.ceil(x/2),f]})]}),e.jsxs("div",{className:_n,children:[e.jsx("div",{className:In,children:r.map((z,T)=>e.jsx(kn,{data:z,maxFrequency:x,barGap:n,barGroupWidth:i,theta:w},`${T}-${z.label}`))}),e.jsx("div",{className:Wn,children:u})]})]})};N6.displayName=I.CompareGraph;const Mn=N6;var _1=["#3DB783","#84D6B3","#D1F0E2","#E4FBF4","#FAFAFA"],c0=1.8,Z6=36,H0=18,d0=15.915494309189533,k6=31.830988618379067,Ln=2.0845056908104667,En="_1oth5nf0",Fn="_1oth5nf2",Hn="_1oth5nf3",Rn="_1oth5nf4",Dn="_1oth5nf5",Pn="_1oth5nf6",Qn="_1oth5nf7",M6="_1oth5nf8",L6="_1oth5nf9",E6="_1oth5nfa";const An=({className:a,style:t,percentages:r,children:l})=>{const s=h.useMemo(()=>{let i=0;return r.map(d=>{const c=i;return i+=d,{width:d-c0,startPercentage:c}}).filter(d=>d.width>0)},[r]),n=`M${H0} ${Ln}
41
41
  a ${d0} ${d0} 0 0 1 0 ${k6}
42
- a ${d0} ${d0} 0 0 1 0 ${-1*k6}`;return e.jsxs("div",{className:y(a,Hn),style:t,children:[e.jsxs("svg",{className:Rn,viewBox:`0 0 ${Z6} ${Z6}`,children:[e.jsx("path",{className:En,strokeWidth:c0,d:n}),s.map((i,d)=>e.jsx("path",{className:Fn,style:{stroke:_1[d]||_1[_1.length-1]},strokeDasharray:`${i.width}, 100`,strokeWidth:c0,d:n,transform:`rotate(${(i.startPercentage+c0/2)*360/100}, ${H0}, ${H0})`},`${d}-${i.startPercentage}-${i.width}`))]}),e.jsx("div",{className:Dn,children:l})]})},F6=({className:a,style:t,data:r,otherLabel:l="その他",children:s})=>{const n=h.useMemo(()=>r.map(i=>i.percentage),[r]);return e.jsxs("div",{className:y(a,Pn),style:t,children:[e.jsx(An,{percentages:n,children:s}),e.jsxs("div",{className:Qn,children:[r.map((i,d)=>e.jsxs("div",{className:M6,children:[e.jsx("span",{className:E6,style:{backgroundColor:_1[d]||_1[_1.length-1]}}),e.jsx("span",{className:L6,children:i.label})]},d)),e.jsxs("div",{className:M6,children:[e.jsx("span",{className:E6,style:{backgroundColor:_1[_1.length-1]}}),e.jsx("span",{className:L6,children:l})]})]})]})};F6.displayName=I.CircleGraph;const On=F6;var Vn="_1nylme50",Un="_1nylme51",Gn="_1nylme52",Yn="_1nylme53",Kn={top:"_1nylme54",bottom:"_1nylme55",left:"_1nylme56",right:"_1nylme57"},Xn={top:"_1nylme58",bottom:"_1nylme59",left:"_1nylme5a",right:"_1nylme5b"};const H6=({className:a,style:t,direction:r="top",isOpen:l=!1,isDirectionFixed:s=!1,children:n,content:i,expand:d=!1})=>{const[c,v]=h.useState(!1),u=h.useRef(null);return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:y(a,Vn),style:{...t,width:d?"100%":"initial"},onMouseEnter:()=>v(!0),onMouseLeave:()=>v(!1),ref:u,children:n}),e.jsx(p1,{anchorElement:u,isOpen:c||l,onClose:h.useCallback(()=>v(!1),[]),direction:r,shadow:!1,animation:!0,gap:"xs2",layer:"tooltip",isDirectionFixed:s,children:e.jsxs("div",{className:y(Xn[r],Un),children:[e.jsx("div",{className:y(Gn),children:i}),e.jsx("div",{className:y(Yn,Kn[r]),children:e.jsx(j0,{})})]})})]})};H6.displayName=I.Tooltip;const h0=H6;var Jn="bkxabb0";const $n={1:"xl2",2:"xl",3:"md",4:"sm",5:"xs",6:"xs2"},eo={1:"gray.900",2:"gray.800",3:"gray.700",4:"gray.700",5:"gray.700",6:"gray.700"},R6=({className:a,style:t,level:r=1,color:l=eo[r],fontSize:s=$n[r],children:n})=>{const i=y(a,Jn,W1[s],N1[l]);switch(r){case 1:return e.jsx("h1",{className:i,style:t,children:n});case 2:return e.jsx("h2",{className:i,style:t,children:n});case 3:return e.jsx("h3",{className:i,style:t,children:n});case 4:return e.jsx("h4",{className:i,style:t,children:n});case 5:return e.jsx("h5",{className:i,style:t,children:n});case 6:return e.jsx("h6",{className:i,style:t,children:n})}};R6.displayName=I.Heading;const to=R6;var ao="_1d1n4wd0",D6="_1d1n4wd1",ro={no:"_1d1n4wd2",xs2:"_1d1n4wd3",xs:"_1d1n4wd4",sm:"_1d1n4wd5",md:"_1d1n4wd6",lg:"_1d1n4wd7",xl:"_1d1n4wd8",xl2:"_1d1n4wd9",xl3:"_1d1n4wda",xl4:"_1d1n4wdb",max:"_1d1n4wdc",at:"_1d1n4wdd"},lo="_1d1n4wde",P6={enabled:"_1d1n4wdf",disabled:"_1d1n4wdg"},so="_1d1n4wdh",Q6={enabled:"_1d1n4wdi",disabled:"_1d1n4wdj"},io="_1d1n4wdk",no="_1d1n4wdl";const oo=({className:a,style:t,item:r,disabled:l,depth:s})=>{const[n,i]=h.useState(!1),[d,c]=h.useState(!1),v=l||r.option.disabled,u=h.useMemo(()=>n?"white.800":v?"gray.400":d?"green.800":r.option.iconDefaultColor??"gray.500",[n,v,d,r.option.iconDefaultColor]),p=()=>{v||r.option.onClick()},f=()=>{v||c(!0)},w=()=>{v||c(!1)},x=T=>{T.key==="Enter"&&(v||r.option.onClick())},z=()=>{if(v)return;i(!0);const T=()=>{i(!1),document.removeEventListener("mouseup",T)};document.addEventListener("mouseup",T)};return e.jsx("div",{className:a,style:t,children:e.jsxs("div",{className:y(lo,v?P6.disabled:P6.enabled,r.option.disabled&&D6),style:{paddingLeft:`calc(${K.spacing.xs2} + ${s} * ${K.spacing.lg})`},"aria-label":`popup-button-group-${r.option.label}`,onClick:p,onMouseOver:f,onMouseOut:w,onMouseDown:z,onKeyDown:x,tabIndex:0,children:[e.jsxs("span",{className:no,children:[e.jsx("span",{children:r.option.label}),r.option.icon&&e.jsx(L,{icon:r.option.icon,color:u,size:"md"})]}),r.option.exLabel&&e.jsx("span",{children:r.option.exLabel})]})})},co=()=>e.jsx("div",{children:e.jsx("hr",{className:io})}),ho=({className:a,style:t,item:r,disabled:l,depth:s})=>e.jsxs("div",{className:a,style:t,children:[e.jsx("span",{className:y(so,l?Q6.disabled:Q6.enabled),style:{paddingLeft:`calc(${K.spacing.xs2} + ${s} * ${K.spacing.lg})`},children:r.title}),e.jsx(R0,{options:r.items,groupDivider:r.groupDivider,buttonDivider:r.buttonDivider,disabled:l,depth:s+1})]}),A6=({className:a,style:t,options:r,width:l="10rem",p:s="no",borderRadius:n="no",disabled:i=!1,expand:d=!1,groupDivider:c=!1,buttonDivider:v=!1,depth:u=0,...p})=>{const f=h.useMemo(()=>{const w={kind:"divider"};return r.map((z,T)=>{if(z.kind==="divider")return[w];const g={kind:"item",item:z};if(T+1===r.length)return[g];switch(r[T].kind){case"group":return c?[g,w]:[g];case"button":return v&&r[T+1].kind==="button"?[g,w]:[g];case"divider":return[]}}).flat()},[v,c,r]);return e.jsx("div",{...p,className:y(a,ao,i&&D6,u===0&&ro[n]),style:{...t,minWidth:d?"100%":l},children:e.jsx(U,{gap:"xs2",p:u===0?s:"no",children:f.map((w,x)=>{if(w.kind==="divider")return e.jsx(co,{},`divider-${x}`);if(w.item.kind==="group")return e.jsx(ho,{item:w.item,disabled:i,depth:u},`group-${x}-${w.item.title}`);if(w.item.kind==="button")return e.jsx(oo,{item:w.item,disabled:i,depth:u},`button-${x}-${w.item.option.value}`)})})})};A6.displayName=I.PopupButtonGroup;const R0=A6;var mo="sz1rv30",vo="sz1rv31",uo="sz1rv32",xo="sz1rv33",qo="sz1rv34",po="sz1rv35",go="sz1rv36",fo="sz1rv37",wo="sz1rv38",yo="sz1rv39",zo="sz1rv3a",To="sz1rv3b";const O6=({style:a,icon:t,label:r,active:l,disabled:s=!1,tooltipText:n,buttons:i,isPopupOpen:d=!1,href:c,as:v,asProps:u,onTogglePopup:p,...f})=>{const w=c&&v===void 0,x=v||"a",z=!!(c!=null&&c.startsWith("http")),T=w?{href:s?void 0:c??"",target:!s&&z?"_blank":void 0}:{...u,style:{cursor:s?"not-allowed":"pointer",...u==null?void 0:u.style}},g=h.useRef(null),q=i&&i.length>0,j=h.useCallback(()=>{p==null||p(!1)},[p]),S=()=>{p==null||p(!d)},C=h.useCallback(B=>B.map(b=>b.kind==="divider"?b:b.kind==="button"?{kind:"button",option:{...b.option,onClick:()=>{b.option.onClick(),j()}}}:{...b,items:C(b.items)}),[j]),N=h.useMemo(()=>i?C(i):[],[i,C]),Z=e.jsx("div",{...f,ref:g,onClick:S,style:{...a,display:n?"block":"inline-block"},children:e.jsx(x,{...T,className:y(xo,s?po:l&&qo),children:e.jsxs(k,{justify:"between",align:"center",width:"100%",nowrap:!0,children:[e.jsxs(k,{nowrap:!0,gap:"sm",children:[e.jsx("div",{className:y(go,s?wo:l&&fo),style:{display:"flex",alignItems:"center"},children:e.jsx(L,{icon:t,color:"inherit"})}),e.jsx("div",{className:y(yo,!s&&l&&zo),children:r})]}),q&&e.jsx(L,{icon:T1,color:!s&&l?"green.800":"gray.700"})]})})});return e.jsxs(e.Fragment,{children:[n?e.jsx(h0,{content:e.jsx("div",{children:n}),children:Z}):e.jsxs(e.Fragment,{children:[" ",Z," "]}),q&&e.jsx(p1,{anchorElement:g,isOpen:d,onClose:j,direction:"rightTop",layer:"popover",isDirectionFixed:!0,children:e.jsx("div",{className:To,children:e.jsx(R0,{options:N,p:"xs",borderRadius:"xs2",disabled:s})})})]})};O6.displayName=I.NavigationItem;const jo=O6,V6=({className:a,style:t,isOpen:r,width:l="180px",sticky:s=!1,children:n,footer:i})=>{const d=r?l:`calc(${K.spacing.xl} * 2 + ${K.spacing.sm})`,c=s?{position:"sticky",top:`calc(${K.share.HEADER_HEIGHT} + 1px)`,left:0,borderRight:`${K.borderWidth.xs} solid ${K.color.gray[400]}`,height:`calc(100vh - ${K.share.HEADER_HEIGHT} - 1px)`}:{};return e.jsxs("div",{className:y(a,mo),style:{...t,...c,width:d},children:[e.jsx("div",{className:vo,children:n}),r&&i&&e.jsx("div",{className:uo,children:i})]})};V6.displayName=I.NavigationContainer;const Io=V6;var Wo="_1tqo4fx0",bo="_1tqo4fx1",So="_1tqo4fx2";const U6=({className:a,style:t,isOpen:r,children:l,options:s,skeleton:n,gap:i,isDirectionFixed:d,onClose:c})=>{const v=h.useRef(null);return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:a,ref:v,style:{...t,width:"fit-content",height:"fit-content"},children:l}),e.jsx(p1,{isOpen:r,onClose:()=>c==null?void 0:c(),anchorElement:v,gap:i,isDirectionFixed:d,children:e.jsx("div",{className:y(Wo,n&&bo),children:e.jsx(U,{p:"xs",gap:"xs2",children:s})})})]})};U6.displayName=I.Dropdown;const _o=U6,G6=({className:a,icon:t,onClick:r,children:l,...s})=>{const[n,i]=h.useState(!1),[d,c]=h.useState(!1);function v(){if(d)return"white.800";if(n)return"green.800"}return e.jsx("button",{...s,type:"button",className:y(a,So),onClick:r,onMouseOver:()=>i(!0),onMouseOut:()=>i(!1),onMouseDown:()=>c(!0),onMouseUp:()=>c(!1),children:e.jsxs(k,{align:"center",children:[l,t&&e.jsx(L,{icon:t,size:"md",color:v()})]})})};G6.displayName=I.DropdownItem;const Co=G6;var Bo="_1lgeoz80",No="_1lgeoz82",Zo="_1lgeoz83",ko="_1lgeoz84",Mo={default:"_1lgeoz85",expand:"_1lgeoz86"},Lo="_1lgeoz87",Eo="_1lgeoz88";const Fo=200,Ho=3e3,Y6=({className:a,style:t,message:r,expand:l=!1,enableAnimation:s=!1,autoClose:n=!1,onClose:i})=>{const[d,c]=h.useState(!!s),v=l?"expand":"default";h.useEffect(()=>{s&&c(!1)},[s]);const u=h.useCallback(()=>{if(!s){i==null||i();return}c(!0),setTimeout(()=>{i==null||i()},Fo)},[s,i]);return h.useEffect(()=>{n&&setTimeout(()=>{u()},Ho)},[]),e.jsx("div",{className:y(a,Bo,Mo[v],d&&Zo),style:t,children:e.jsxs("div",{className:No,children:[e.jsx(L,{icon:K1,color:"white.800"}),e.jsx("div",{className:ko,children:e.jsx(e1,{color:"white.800",fontSize:"sm",children:r})}),e.jsx("button",{type:"button",className:Lo,onClick:u,children:e.jsx(L,{icon:b1,color:"white.800"})})]})})};Y6.displayName=I.SnackBar;const K6=Y6,X6=h.createContext({showSnackbar:()=>{}}),Ro=()=>h.useContext(X6),J6=(()=>{if(!window)return 0;const a=h1("md");return!a||a==="auto"?0:a==="9999px"?9999:parseFloat(a)*parseFloat(window.getComputedStyle(document.documentElement).fontSize)})(),Do=({children:a})=>{const[t,r]=h.useState([]),l=h.useRef([]),s=h.useRef(0);h.useEffect(()=>{l.current=l.current.slice(0,t.length)},[t.length]);const n=d=>l.current.slice(0,d).reduce((c,v)=>{const u=v==null?void 0:v.getBoundingClientRect();return c+((u==null?void 0:u.height)??0)+J6},J6),i=(d,c)=>{r(v=>[...v,{message:d,options:c,id:`${new Date().toISOString()}-${s.current++}`}])};return e.jsxs(X6.Provider,{value:{showSnackbar:i},children:[a,t.map((d,c)=>{var v;return e.jsx("div",{className:Eo,ref:u=>l.current[c]=u,style:{transitionDuration:"0.2s",bottom:n(c)},children:e.jsx(K6,{message:d.message,expand:(v=d.options)==null?void 0:v.expand,onClose:()=>{r(u=>u.filter(p=>p.id!==d.id))},enableAnimation:!0,autoClose:!0})},d.id)})]})};var Po="_1fl1cku0",Qo="_1fl1cku1";function Ao(a){return a?"error":"default"}const $6=h.forwardRef(({className:a,style:t,value:r,expand:l,rows:s=3,error:n,resize:i="none",maxWidth:d,minWidth:c,maxHeight:v,minHeight:u,onChange:p,...f},w)=>{const x=h.useContext(x1),z=n||x.error;return e.jsx("textarea",{...f,ref:w,value:r,rows:s,style:{...t,resize:i,maxWidth:d,minWidth:c,maxHeight:v,minHeight:u},className:y(a,Po,l&&Qo,u1[Ao(z)]),onChange:p})});$6.displayName=I.TextArea;const e7=$6;var D0="v2atas1",t7="v2atas2",Oo={last:"v2atas3",noLast:"v2atas4"},Vo="v2atas5",Uo={no:"v2atas6",xs2:"v2atas7",xs:"v2atas8",sm:"v2atas9",md:"v2atasa",lg:"v2atasb",xl:"v2atasc",xl2:"v2atasd",xl3:"v2atase",xl4:"v2atasf",max:"v2atasg",at:"v2atash"};const a7=({className:a,style:t,width:r="100%",height:l="100%",borderRadius:s="no",isLoading:n=!0,children:i})=>{const d=n?y(a,D0,t7,Uo[s]):a;return e.jsx("div",{className:d,style:{...t,width:r,height:l},children:i})};a7.displayName=I.Skeleton;const Go=a7,r7=({className:a,style:t,size:r="2.5rem",isLoading:l=!0,children:s})=>{const n=l?y(a,D0,Vo):a;return e.jsx("div",{className:n,style:{...t,width:r,height:r},children:s})};r7.displayName=I.SkeletonCircle;const Yo=r7,l7=({className:a,style:t,fontSize:r="lg",gap:l="sm",lines:s=1,isLoading:n=!0,children:i})=>{const d=c=>s===1?"noLast":c===s-1?"last":"noLast";return n?e.jsx(U,{className:a,style:t,gap:l,children:Array.from({length:s},(c,v)=>e.jsx("div",{className:y(D0,t7,Oo[d(v)],A8[r])},v))}):e.jsx(e.Fragment,{children:i})};l7.displayName=I.SkeletonText;const Ko=l7;var Xo="a4jm6v0",Jo="a4jm6v1",$o="a4jm6v3",ec="a4jm6v4";const s7=({className:a,style:t,isLoading:r})=>e.jsx("div",{className:y(a,Xo,!r&&ec),style:t,children:e.jsx("div",{className:Jo,children:e.jsx("div",{className:$o})})});s7.displayName=I.LoadingOverlay;const tc=s7;var ac="_1p7y12v0",i7={left:"_1p7y12v1",right:"_1p7y12v2"},P0="_1p7y12v3",Q0={default:"_1p7y12v4",active:"_1p7y12v5"};const A0=({onKeyDown:a,...t})=>e.jsx("div",{role:"button",tabIndex:0,...t,onKeyDown:r=>{a==null||a(r),(r.key==="Enter"||r.key===" ")&&r.target instanceof HTMLElement&&(r.stopPropagation(),r.target.click())}}),n7=({className:a,currentPage:t,length:r,onChangePage:l,sideLength:s=2,...n})=>{const i=Math.max(0,s),d=2*i+1,c=u=>{if(u<1)return l==null?void 0:l(1);if(u>r)return l==null?void 0:l(r);l==null||l(u)},v=()=>{if(r<d)return Array.from({length:r}).map((p,f)=>f+1);function u(){return t<=i?1:t>r-i?r-2*i:t-i}return Array.from({length:d}).map((p,f)=>u()+f)};return e.jsxs("nav",{...n,className:y(a,ac,t<=1&&i7.left,t>=r&&i7.right),"aria-label":a1.PAGINATION,children:[t>1&&e.jsx(A0,{onClick:()=>c(t-1),className:y(P0,Q0.default),"aria-label":a1.PAGINATION_PREV,children:e.jsx(L,{icon:Y1,size:"xl2"})}),v().map(u=>{const p=t===u;return e.jsx(A0,{onClick:()=>c(u),className:y(P0,Q0[p?"active":"default"]),"aria-current":p?"page":void 0,children:u},u)}),t<r&&e.jsx(A0,{onClick:()=>c(t+1),className:y(P0,Q0.default),"aria-label":a1.PAGINATION_NEXT,children:e.jsx(L,{icon:T1,size:"xl2"})})]})};n7.displayName=I.Pagination;const rc=n7;var lc="_5a74da0",sc="_5a74da1",ic="_5a74da2",nc="_5a74da3";const o7=({isOpen:a,title:t,header:r,children:l,onClose:s})=>{const n=h.useRef(null),[i,d]=h.useState(a);return h.useEffect(()=>{var c,v;if(a)d(!0),(c=n.current)==null||c.animate([{transform:"translateY(100vh)"},{transform:"translateY(0)"}],{duration:300,easing:"ease",fill:"forwards"});else{const u=(v=n.current)==null?void 0:v.animate([{transform:"translateY(0)"},{transform:"translateY(100vh)"}],{duration:300,easing:"ease",fill:"forwards"});u&&(u.onfinish=()=>{d(!1)})}},[a]),e.jsx(r0,{container:document.body,children:e.jsx("div",{ref:n,className:y([sc,!i&&lc]),children:e.jsxs(U,{children:[e.jsx("div",{className:ic,children:e.jsxs(k,{justify:"between",align:"center",height:h1("xl3"),children:[e.jsx(e1,{bold:!0,children:t}),e.jsxs(k,{gap:"md",children:[r,e.jsx(E1,{onClick:()=>s==null?void 0:s(),icon:b1,variant:"transparent","aria-label":a1.FULL_MODAL_VIEW.CLOSE})]})]})}),e.jsx(z1,{color:"gray.300"}),e.jsx("div",{className:nc,children:l})]})})})};o7.displayName=I.FullModalView;const oc=o7;var cc="srvtgq0",dc="srvtgq1",hc="srvtgq2",mc="srvtgq3",vc="srvtgq4",uc="srvtgq5",xc={default:"srvtgq6",active:"srvtgq7"},qc="srvtgq8";const c7=({className:a,style:t,value:r,items:l,width:s,onChange:n,...i})=>{const d=h.useId();return e.jsx("div",{...i,className:y(a,cc),style:{...t,...s?{width:s}:{}},children:l.map((c,v)=>{const u=`${d}-${c.value}`,p=v===0,f=v===l.length-1,w=r&&r===c.value;return e.jsxs("label",{className:y(dc,!f&&mc,p&&vc,f&&uc,w&&hc,xc[w?"active":"default"]),htmlFor:u,tabIndex:0,onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&(n==null||n(c.value))},children:[c.label,e.jsx("input",{className:qc,type:"radio",id:u,name:c.name,value:c.value,onClick:()=>n==null?void 0:n(c.value)})]},c.value)})})};c7.displayName=I.PanelSwitch;const pc=c7;var gc="b6d2ts0";const fc=a=>{const t=a.getHours(),r=a.getMinutes();return[t,r].map(l=>String(l).padStart(2,"0")).join(":")},wc=a=>{const t=a.getFullYear(),r=a.getMonth()+1,l=a.getDate(),s=a.getHours(),n=a.getMinutes(),i=[t,r,l].map(c=>String(c).padStart(2,"0")).join("/"),d=[s,n].map(c=>String(c).padStart(2,"0")).join(":");return`${i} ${d}`},g1={year:31536e6,month:2592e6,day:864e5,hour:36e5,minute:6e4},yc=a=>{const t=new Date().getTime()-a.getTime(),r=(l,s)=>Math.floor(t/l)+s;return t<g1.minute?"たった今":t<g1.hour?r(g1.minute,"分前"):t<g1.day?r(g1.hour,"時間前"):t<g1.month?r(g1.day,"日前"):t<g1.year?r(g1.month,"ヶ月前"):r(g1.year,"年前")},zc=(a,t=!1)=>{const r=a.getMonth()+1,l=a.getDate(),s=["日","月","火","水","木","金","土"][a.getDay()];return[r,l].map(n=>t?String(n).padStart(2,"0"):String(n)).join("/").concat(`(${s})`)},Tc=a=>{const t=Math.floor(a),r=Math.floor((a-t)*60);return[t,r.toString().padStart(2,"0")].join(":")},jc=a=>{let t=a;return t=t.replace(/&/g,"&amp;"),t=t.replace(/</g,"&lt;"),t=t.replace(/>/g,"&gt;"),t},d7=/(https?:\/\/[\w/:%#\$&\?\(\)~\.=\+\-]+)/g,Ic=a=>jc(a).split(d7).map(t=>t===""?null:{type:t.match(d7)?"link":"text",content:t}).filter(t=>t!==null),h7=300,m7=({isOpen:a,textValue:t,username:r,placeholder:l,messages:s,haveNewMessage:n,formRows:i,typingUsername:d,status:c,statusOptions:v,statusPlaceholder:u,onChangeStatus:p,onChangeTextValue:f,onSubmit:w,onToggle:x,...z})=>{const T=h.useRef(null),g=h.useRef(null),q=h.useRef(null),[j,S]=h.useState(0),C=h.useMemo(()=>{const b=[];return s.forEach(Q=>{const F=new Date(Q.time),A=b.find(R=>R.date.getFullYear()===F.getFullYear()&&R.date.getMonth()===F.getMonth()&&R.date.getDate()===F.getDate());A?A.contents.push(Q):b.push({date:F,contents:[Q]})}),b},[s]),[N,Z]=h.useState(!1),B=h.useCallback(()=>{x==null||x(),Z(!0),setTimeout(()=>{Z(!1)},h7)},[x]);return h.useLayoutEffect(()=>{const b=T.current,Q=g.current;if(!b||!Q)return;const F=()=>{const R=b.getBoundingClientRect(),V=Q.getBoundingClientRect();S(V.top-R.top-R.height)};F();const A=new ResizeObserver(()=>{F()});return A.observe(b),()=>{A.disconnect()}},[]),h.useEffect(()=>{const b=q.current;b&&a&&b.scrollTo(0,b.scrollHeight)},[a,s]),e.jsxs(k1,{...z,ref:T,position:"fixed",right:"1.5rem",bottom:a?"0":`${j}px`,transition:N?`bottom ${h7}ms ease-in-out`:void 0,width:"20rem",zIndex:"floating",children:[e.jsxs(V1,{shadow:!0,align:"stretch",mainHeaderArea:e.jsxs(k,{align:"center",gap:"xs2",nowrap:!0,children:[e.jsx(e1,{color:"gray.700",as:"span",bold:!0,children:r}),n&&e.jsx(k1,{width:K.fontSize.md,height:K.fontSize.md,bgColor:"red.800",round:"max"})]}),subHeaderArea:e.jsx(L,{size:"xl2",color:"gray.500",icon:a?S1:H1}),footerArea:e.jsxs(U,{width:"100%",justify:"end",gap:"xs",children:[e.jsx(q7,{value:t,onChange:f,onSubmit:w,placeholder:l,formRows:i}),c!==void 0&&v!==void 0&&e.jsxs(k,{nowrap:!0,children:[e.jsx(I3,{options:v,value:c,onChange:b=>p==null?void 0:p(b),placeholder:u,expand:!0}),e.jsx("div",{style:{width:K.spacing.xl4,flexShrink:0}})]}),d&&e.jsxs(e1,{color:"gray.600",as:"p",fontSize:"xs2",children:[e.jsx(e1,{as:"span",bold:!0,fontSize:"xs2",color:"gray.700",children:d})," さんが入力しています..."]})]}),children:[e.jsx("div",{ref:g,children:e.jsx(z1,{})}),e.jsx(k1,{overflowY:"scroll",ref:q,children:e.jsx(U,{gap:"xs",py:"xs",height:"320px",nowrap:!0,children:C.map(({date:b,contents:Q},F)=>{const A=`${b.toDateString()}-${F}`;return e.jsxs(h.Fragment,{children:[e.jsx(k,{justify:"center",children:e.jsx(y1,{label:zc(b),variant:"mono",fontSize:"xs2"})}),Q.map((R,V)=>e.jsx(u7,{content:R,maxChatItemWidth:"192px"},`${A}-${F}-${V}`))]},A)})})})]}),e.jsx("button",{type:"button",className:gc,onClick:B})]})};m7.displayName=I.ChatCard;const Wc=m7;function bc(a){return a<1?"未読":a===1?"既読":`既読${a}`}const v7=({className:a,style:t,content:r,maxChatItemWidth:l})=>{const s=Ic(r.message),n=r.sender==="me";return e.jsxs(U,{className:a,style:t,align:n?"end":"start",children:[r.username&&e.jsx(e1,{as:"span",fontSize:"xs2",color:"gray.600",children:r.username}),e.jsxs(k,{align:"end",gap:"xs2",reverse:n,children:[e.jsx(V1,{border:!0,fit:!0,px:"md",py:"xs",maxWidth:l,children:s.map((i,d)=>i.type==="link"?e.jsx(xe,{href:i.content,openInNewTab:!0,fontSize:"xs",children:i.content},`anchor-${d}`):e.jsx(e1,{as:"span",fontSize:"xs",color:"gray.700",whiteSpace:"preLine",breakAll:!0,children:i.content},`text-${d}`))}),e.jsxs(U,{align:n?"end":"start",children:[r.readers&&e.jsx(h0,{content:r.readers.join(`
42
+ a ${d0} ${d0} 0 0 1 0 ${-1*k6}`;return e.jsxs("div",{className:y(a,Hn),style:t,children:[e.jsxs("svg",{className:Rn,viewBox:`0 0 ${Z6} ${Z6}`,children:[e.jsx("path",{className:En,strokeWidth:c0,d:n}),s.map((i,d)=>e.jsx("path",{className:Fn,style:{stroke:_1[d]||_1[_1.length-1]},strokeDasharray:`${i.width}, 100`,strokeWidth:c0,d:n,transform:`rotate(${(i.startPercentage+c0/2)*360/100}, ${H0}, ${H0})`},`${d}-${i.startPercentage}-${i.width}`))]}),e.jsx("div",{className:Dn,children:l})]})},F6=({className:a,style:t,data:r,otherLabel:l="その他",children:s})=>{const n=h.useMemo(()=>r.map(i=>i.percentage),[r]);return e.jsxs("div",{className:y(a,Pn),style:t,children:[e.jsx(An,{percentages:n,children:s}),e.jsxs("div",{className:Qn,children:[r.map((i,d)=>e.jsxs("div",{className:M6,children:[e.jsx("span",{className:E6,style:{backgroundColor:_1[d]||_1[_1.length-1]}}),e.jsx("span",{className:L6,children:i.label})]},d)),e.jsxs("div",{className:M6,children:[e.jsx("span",{className:E6,style:{backgroundColor:_1[_1.length-1]}}),e.jsx("span",{className:L6,children:l})]})]})]})};F6.displayName=I.CircleGraph;const On=F6;var Vn="_1nylme50",Un="_1nylme51",Gn="_1nylme52",Yn="_1nylme53",Kn={top:"_1nylme54",bottom:"_1nylme55",left:"_1nylme56",right:"_1nylme57"},Xn={top:"_1nylme58",bottom:"_1nylme59",left:"_1nylme5a",right:"_1nylme5b"};const H6=({className:a,style:t,direction:r="top",isOpen:l=!1,isDirectionFixed:s=!1,children:n,content:i,expand:d=!1})=>{const[c,v]=h.useState(!1),u=h.useRef(null);return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:y(a,Vn),style:{...t,width:d?"100%":"initial"},onMouseEnter:()=>v(!0),onMouseLeave:()=>v(!1),ref:u,children:n}),e.jsx(p1,{anchorElement:u,isOpen:c||l,onClose:h.useCallback(()=>v(!1),[]),direction:r,shadow:!1,animation:!0,gap:"xs2",layer:"tooltip",isDirectionFixed:s,children:e.jsxs("div",{className:y(Xn[r],Un),children:[e.jsx("div",{className:y(Gn),children:i}),e.jsx("div",{className:y(Yn,Kn[r]),children:e.jsx(j0,{})})]})})]})};H6.displayName=I.Tooltip;const h0=H6;var Jn="bkxabb0";const $n={1:"xl2",2:"xl",3:"md",4:"sm",5:"xs",6:"xs2"},eo={1:"gray.900",2:"gray.800",3:"gray.700",4:"gray.700",5:"gray.700",6:"gray.700"},R6=({className:a,style:t,level:r=1,color:l=eo[r],fontSize:s=$n[r],children:n})=>{const i=y(a,Jn,W1[s],N1[l]);switch(r){case 1:return e.jsx("h1",{className:i,style:t,children:n});case 2:return e.jsx("h2",{className:i,style:t,children:n});case 3:return e.jsx("h3",{className:i,style:t,children:n});case 4:return e.jsx("h4",{className:i,style:t,children:n});case 5:return e.jsx("h5",{className:i,style:t,children:n});case 6:return e.jsx("h6",{className:i,style:t,children:n})}};R6.displayName=I.Heading;const to=R6;var ao="_1d1n4wd0",D6="_1d1n4wd1",ro={no:"_1d1n4wd2",xs2:"_1d1n4wd3",xs:"_1d1n4wd4",sm:"_1d1n4wd5",md:"_1d1n4wd6",lg:"_1d1n4wd7",xl:"_1d1n4wd8",xl2:"_1d1n4wd9",xl3:"_1d1n4wda",xl4:"_1d1n4wdb",max:"_1d1n4wdc",at:"_1d1n4wdd"},lo="_1d1n4wde",P6={enabled:"_1d1n4wdf",disabled:"_1d1n4wdg"},so="_1d1n4wdh",Q6={enabled:"_1d1n4wdi",disabled:"_1d1n4wdj"},io="_1d1n4wdk",no="_1d1n4wdl";const oo=({className:a,style:t,item:r,disabled:l,depth:s})=>{const[n,i]=h.useState(!1),[d,c]=h.useState(!1),v=l||r.option.disabled,u=h.useMemo(()=>n?"white.800":v?"gray.400":d?"green.800":r.option.iconDefaultColor??"gray.500",[n,v,d,r.option.iconDefaultColor]),p=()=>{v||r.option.onClick()},f=()=>{v||c(!0)},w=()=>{v||c(!1)},x=T=>{T.key==="Enter"&&(v||r.option.onClick())},z=()=>{if(v)return;i(!0);const T=()=>{i(!1),document.removeEventListener("mouseup",T)};document.addEventListener("mouseup",T)};return e.jsx("div",{className:a,style:t,children:e.jsxs("div",{className:y(lo,v?P6.disabled:P6.enabled,r.option.disabled&&D6),style:{paddingLeft:`calc(${K.spacing.xs2} + ${s} * ${K.spacing.lg})`},"aria-label":`popup-button-group-${r.option.label}`,onClick:p,onMouseOver:f,onMouseOut:w,onMouseDown:z,onKeyDown:x,tabIndex:0,children:[e.jsxs("span",{className:no,children:[e.jsx("span",{children:r.option.label}),r.option.icon&&e.jsx(L,{icon:r.option.icon,color:u,size:"md"})]}),r.option.exLabel&&e.jsx("span",{children:r.option.exLabel})]})})},co=()=>e.jsx("div",{children:e.jsx("hr",{className:io})}),ho=({className:a,style:t,item:r,disabled:l,depth:s})=>e.jsxs("div",{className:a,style:t,children:[e.jsx("span",{className:y(so,l?Q6.disabled:Q6.enabled),style:{paddingLeft:`calc(${K.spacing.xs2} + ${s} * ${K.spacing.lg})`},children:r.title}),e.jsx(R0,{options:r.items,groupDivider:r.groupDivider,buttonDivider:r.buttonDivider,disabled:l,depth:s+1})]}),A6=({className:a,style:t,options:r,width:l="10rem",p:s="no",borderRadius:n="no",disabled:i=!1,expand:d=!1,groupDivider:c=!1,buttonDivider:v=!1,depth:u=0,...p})=>{const f=h.useMemo(()=>{const w={kind:"divider"};return r.map((z,T)=>{if(z.kind==="divider")return[w];const g={kind:"item",item:z};if(T+1===r.length)return[g];switch(r[T].kind){case"group":return c?[g,w]:[g];case"button":return v&&r[T+1].kind==="button"?[g,w]:[g];case"divider":return[]}}).flat()},[v,c,r]);return e.jsx("div",{...p,className:y(a,ao,i&&D6,u===0&&ro[n]),style:{...t,minWidth:d?"100%":l},children:e.jsx(U,{gap:"xs2",p:u===0?s:"no",children:f.map((w,x)=>{if(w.kind==="divider")return e.jsx(co,{},`divider-${x}`);if(w.item.kind==="group")return e.jsx(ho,{item:w.item,disabled:i,depth:u},`group-${x}-${w.item.title}`);if(w.item.kind==="button")return e.jsx(oo,{item:w.item,disabled:i,depth:u},`button-${x}-${w.item.option.value}`)})})})};A6.displayName=I.PopupButtonGroup;const R0=A6;var mo="sz1rv30",vo="sz1rv31",uo="sz1rv32",xo="sz1rv33",qo="sz1rv34",po="sz1rv35",go="sz1rv36",fo="sz1rv37",wo="sz1rv38",yo="sz1rv39",zo="sz1rv3a",To="sz1rv3b";const O6=({style:a,icon:t,label:r,active:l,disabled:s=!1,tooltipText:n,buttons:i,isPopupOpen:d=!1,href:c,as:v,asProps:u,onTogglePopup:p,...f})=>{const w=c&&v===void 0,x=v||"a",z=!!(c!=null&&c.startsWith("http")),T=w?{href:s?void 0:c??"",target:!s&&z?"_blank":void 0}:{...u,style:{cursor:s?"not-allowed":"pointer",...u==null?void 0:u.style}},g=h.useRef(null),q=i&&i.length>0,j=h.useCallback(()=>{p==null||p(!1)},[p]),S=()=>{p==null||p(!d)},C=h.useCallback(B=>B.map(b=>b.kind==="divider"?b:b.kind==="button"?{kind:"button",option:{...b.option,onClick:()=>{b.option.onClick(),j()}}}:{...b,items:C(b.items)}),[j]),N=h.useMemo(()=>i?C(i):[],[i,C]),Z=e.jsx("div",{...f,ref:g,onClick:S,style:{...a,display:n?"block":"inline-block"},children:e.jsx(x,{...T,className:y(xo,s?po:l&&qo),children:e.jsxs(k,{justify:"between",align:"center",width:"100%",nowrap:!0,children:[e.jsxs(k,{nowrap:!0,gap:"sm",children:[e.jsx("div",{className:y(go,s?wo:l&&fo),style:{display:"flex",alignItems:"center"},children:e.jsx(L,{icon:t,color:"inherit"})}),e.jsx("div",{className:y(yo,!s&&l&&zo),children:r})]}),q&&e.jsx(L,{icon:T1,color:!s&&l?"green.800":"gray.700"})]})})});return e.jsxs(e.Fragment,{children:[n?e.jsx(h0,{content:e.jsx("div",{children:n}),children:Z}):e.jsxs(e.Fragment,{children:[" ",Z," "]}),q&&e.jsx(p1,{anchorElement:g,isOpen:d,onClose:j,direction:"rightTop",layer:"popover",isDirectionFixed:!0,children:e.jsx("div",{className:To,children:e.jsx(R0,{options:N,p:"xs",borderRadius:"xs2",disabled:s})})})]})};O6.displayName=I.NavigationItem;const jo=O6,V6=({className:a,style:t,isOpen:r,width:l="180px",sticky:s=!1,children:n,footer:i})=>{const d=r?l:`calc(${K.spacing.xl} * 2 + ${K.spacing.sm})`,c=s?{position:"sticky",top:`calc(${K.share.HEADER_HEIGHT} + 1px)`,left:0,borderRight:`${K.borderWidth.xs} solid ${K.color.gray[400]}`,height:`calc(100vh - ${K.share.HEADER_HEIGHT} - 1px)`}:{};return e.jsxs("div",{className:y(a,mo),style:{...t,...c,width:d},children:[e.jsx("div",{className:vo,children:n}),r&&i&&e.jsx("div",{className:uo,children:i})]})};V6.displayName=I.NavigationContainer;const Io=V6;var Wo="_1tqo4fx0",bo="_1tqo4fx1",So="_1tqo4fx2";const U6=({className:a,style:t,isOpen:r,children:l,options:s,skeleton:n,gap:i,isDirectionFixed:d,onClose:c})=>{const v=h.useRef(null);return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:a,ref:v,style:{...t,width:"fit-content",height:"fit-content"},children:l}),e.jsx(p1,{isOpen:r,onClose:()=>c==null?void 0:c(),anchorElement:v,gap:i,isDirectionFixed:d,children:e.jsx("div",{className:y(Wo,n&&bo),children:e.jsx(U,{p:"xs",gap:"xs2",children:s})})})]})};U6.displayName=I.Dropdown;const _o=U6,G6=({className:a,icon:t,onClick:r,children:l,...s})=>{const[n,i]=h.useState(!1),[d,c]=h.useState(!1);function v(){if(d)return"white.800";if(n)return"green.800"}return e.jsx("button",{...s,type:"button",className:y(a,So),onClick:r,onMouseOver:()=>i(!0),onMouseOut:()=>i(!1),onMouseDown:()=>c(!0),onMouseUp:()=>c(!1),children:e.jsxs(k,{align:"center",children:[l,t&&e.jsx(L,{icon:t,size:"md",color:v()})]})})};G6.displayName=I.DropdownItem;const Co=G6;var Bo="_1lgeoz80",No="_1lgeoz82",Zo="_1lgeoz83",ko="_1lgeoz84",Mo={default:"_1lgeoz85",expand:"_1lgeoz86"},Lo="_1lgeoz87",Eo="_1lgeoz88";const Fo=200,Ho=3e3,Y6=({className:a,style:t,message:r,expand:l=!1,enableAnimation:s=!1,autoClose:n=!1,onClose:i})=>{const[d,c]=h.useState(!!s),v=l?"expand":"default";h.useEffect(()=>{s&&c(!1)},[s]);const u=h.useCallback(()=>{if(!s){i==null||i();return}c(!0),setTimeout(()=>{i==null||i()},Fo)},[s,i]);return h.useEffect(()=>{n&&setTimeout(()=>{u()},Ho)},[]),e.jsx("div",{className:y(a,Bo,Mo[v],d&&Zo),style:t,children:e.jsxs("div",{className:No,children:[e.jsx(L,{icon:K1,color:"white.800"}),e.jsx("div",{className:ko,children:e.jsx(e1,{color:"white.800",fontSize:"sm",children:r})}),e.jsx("button",{type:"button",className:Lo,onClick:u,children:e.jsx(L,{icon:b1,color:"white.800"})})]})})};Y6.displayName=I.SnackBar;const K6=Y6,X6=h.createContext({showSnackbar:()=>{}}),Ro=()=>h.useContext(X6),J6=(()=>{if(typeof window>"u")return 0;const a=h1("md");return!a||a==="auto"?0:a==="9999px"?9999:parseFloat(a)*parseFloat(window.getComputedStyle(document.documentElement).fontSize)})(),Do=({children:a})=>{const[t,r]=h.useState([]),l=h.useRef([]),s=h.useRef(0);h.useEffect(()=>{l.current=l.current.slice(0,t.length)},[t.length]);const n=d=>l.current.slice(0,d).reduce((c,v)=>{const u=v==null?void 0:v.getBoundingClientRect();return c+((u==null?void 0:u.height)??0)+J6},J6),i=(d,c)=>{r(v=>[...v,{message:d,options:c,id:`${new Date().toISOString()}-${s.current++}`}])};return e.jsxs(X6.Provider,{value:{showSnackbar:i},children:[a,t.map((d,c)=>{var v;return e.jsx("div",{className:Eo,ref:u=>l.current[c]=u,style:{transitionDuration:"0.2s",bottom:n(c)},children:e.jsx(K6,{message:d.message,expand:(v=d.options)==null?void 0:v.expand,onClose:()=>{r(u=>u.filter(p=>p.id!==d.id))},enableAnimation:!0,autoClose:!0})},d.id)})]})};var Po="_1fl1cku0",Qo="_1fl1cku1";function Ao(a){return a?"error":"default"}const $6=h.forwardRef(({className:a,style:t,value:r,expand:l,rows:s=3,error:n,resize:i="none",maxWidth:d,minWidth:c,maxHeight:v,minHeight:u,onChange:p,...f},w)=>{const x=h.useContext(x1),z=n||x.error;return e.jsx("textarea",{...f,ref:w,value:r,rows:s,style:{...t,resize:i,maxWidth:d,minWidth:c,maxHeight:v,minHeight:u},className:y(a,Po,l&&Qo,u1[Ao(z)]),onChange:p})});$6.displayName=I.TextArea;const e7=$6;var D0="v2atas1",t7="v2atas2",Oo={last:"v2atas3",noLast:"v2atas4"},Vo="v2atas5",Uo={no:"v2atas6",xs2:"v2atas7",xs:"v2atas8",sm:"v2atas9",md:"v2atasa",lg:"v2atasb",xl:"v2atasc",xl2:"v2atasd",xl3:"v2atase",xl4:"v2atasf",max:"v2atasg",at:"v2atash"};const a7=({className:a,style:t,width:r="100%",height:l="100%",borderRadius:s="no",isLoading:n=!0,children:i})=>{const d=n?y(a,D0,t7,Uo[s]):a;return e.jsx("div",{className:d,style:{...t,width:r,height:l},children:i})};a7.displayName=I.Skeleton;const Go=a7,r7=({className:a,style:t,size:r="2.5rem",isLoading:l=!0,children:s})=>{const n=l?y(a,D0,Vo):a;return e.jsx("div",{className:n,style:{...t,width:r,height:r},children:s})};r7.displayName=I.SkeletonCircle;const Yo=r7,l7=({className:a,style:t,fontSize:r="lg",gap:l="sm",lines:s=1,isLoading:n=!0,children:i})=>{const d=c=>s===1?"noLast":c===s-1?"last":"noLast";return n?e.jsx(U,{className:a,style:t,gap:l,children:Array.from({length:s},(c,v)=>e.jsx("div",{className:y(D0,t7,Oo[d(v)],A8[r])},v))}):e.jsx(e.Fragment,{children:i})};l7.displayName=I.SkeletonText;const Ko=l7;var Xo="a4jm6v0",Jo="a4jm6v1",$o="a4jm6v3",ec="a4jm6v4";const s7=({className:a,style:t,isLoading:r})=>e.jsx("div",{className:y(a,Xo,!r&&ec),style:t,children:e.jsx("div",{className:Jo,children:e.jsx("div",{className:$o})})});s7.displayName=I.LoadingOverlay;const tc=s7;var ac="_1p7y12v0",i7={left:"_1p7y12v1",right:"_1p7y12v2"},P0="_1p7y12v3",Q0={default:"_1p7y12v4",active:"_1p7y12v5"};const A0=({onKeyDown:a,...t})=>e.jsx("div",{role:"button",tabIndex:0,...t,onKeyDown:r=>{a==null||a(r),(r.key==="Enter"||r.key===" ")&&r.target instanceof HTMLElement&&(r.stopPropagation(),r.target.click())}}),n7=({className:a,currentPage:t,length:r,onChangePage:l,sideLength:s=2,...n})=>{const i=Math.max(0,s),d=2*i+1,c=u=>{if(u<1)return l==null?void 0:l(1);if(u>r)return l==null?void 0:l(r);l==null||l(u)},v=()=>{if(r<d)return Array.from({length:r}).map((p,f)=>f+1);function u(){return t<=i?1:t>r-i?r-2*i:t-i}return Array.from({length:d}).map((p,f)=>u()+f)};return e.jsxs("nav",{...n,className:y(a,ac,t<=1&&i7.left,t>=r&&i7.right),"aria-label":a1.PAGINATION,children:[t>1&&e.jsx(A0,{onClick:()=>c(t-1),className:y(P0,Q0.default),"aria-label":a1.PAGINATION_PREV,children:e.jsx(L,{icon:Y1,size:"xl2"})}),v().map(u=>{const p=t===u;return e.jsx(A0,{onClick:()=>c(u),className:y(P0,Q0[p?"active":"default"]),"aria-current":p?"page":void 0,children:u},u)}),t<r&&e.jsx(A0,{onClick:()=>c(t+1),className:y(P0,Q0.default),"aria-label":a1.PAGINATION_NEXT,children:e.jsx(L,{icon:T1,size:"xl2"})})]})};n7.displayName=I.Pagination;const rc=n7;var lc="_5a74da0",sc="_5a74da1",ic="_5a74da2",nc="_5a74da3";const o7=({isOpen:a,title:t,header:r,children:l,onClose:s})=>{const n=h.useRef(null),[i,d]=h.useState(a);return h.useEffect(()=>{var c,v;if(a)d(!0),(c=n.current)==null||c.animate([{transform:"translateY(100vh)"},{transform:"translateY(0)"}],{duration:300,easing:"ease",fill:"forwards"});else{const u=(v=n.current)==null?void 0:v.animate([{transform:"translateY(0)"},{transform:"translateY(100vh)"}],{duration:300,easing:"ease",fill:"forwards"});u&&(u.onfinish=()=>{d(!1)})}},[a]),e.jsx(r0,{container:document.body,children:e.jsx("div",{ref:n,className:y([sc,!i&&lc]),children:e.jsxs(U,{children:[e.jsx("div",{className:ic,children:e.jsxs(k,{justify:"between",align:"center",height:h1("xl3"),children:[e.jsx(e1,{bold:!0,children:t}),e.jsxs(k,{gap:"md",children:[r,e.jsx(E1,{onClick:()=>s==null?void 0:s(),icon:b1,variant:"transparent","aria-label":a1.FULL_MODAL_VIEW.CLOSE})]})]})}),e.jsx(z1,{color:"gray.300"}),e.jsx("div",{className:nc,children:l})]})})})};o7.displayName=I.FullModalView;const oc=o7;var cc="srvtgq0",dc="srvtgq1",hc="srvtgq2",mc="srvtgq3",vc="srvtgq4",uc="srvtgq5",xc={default:"srvtgq6",active:"srvtgq7"},qc="srvtgq8";const c7=({className:a,style:t,value:r,items:l,width:s,onChange:n,...i})=>{const d=h.useId();return e.jsx("div",{...i,className:y(a,cc),style:{...t,...s?{width:s}:{}},children:l.map((c,v)=>{const u=`${d}-${c.value}`,p=v===0,f=v===l.length-1,w=r&&r===c.value;return e.jsxs("label",{className:y(dc,!f&&mc,p&&vc,f&&uc,w&&hc,xc[w?"active":"default"]),htmlFor:u,tabIndex:0,onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&(n==null||n(c.value))},children:[c.label,e.jsx("input",{className:qc,type:"radio",id:u,name:c.name,value:c.value,onClick:()=>n==null?void 0:n(c.value)})]},c.value)})})};c7.displayName=I.PanelSwitch;const pc=c7;var gc="b6d2ts0";const fc=a=>{const t=a.getHours(),r=a.getMinutes();return[t,r].map(l=>String(l).padStart(2,"0")).join(":")},wc=a=>{const t=a.getFullYear(),r=a.getMonth()+1,l=a.getDate(),s=a.getHours(),n=a.getMinutes(),i=[t,r,l].map(c=>String(c).padStart(2,"0")).join("/"),d=[s,n].map(c=>String(c).padStart(2,"0")).join(":");return`${i} ${d}`},g1={year:31536e6,month:2592e6,day:864e5,hour:36e5,minute:6e4},yc=a=>{const t=new Date().getTime()-a.getTime(),r=(l,s)=>Math.floor(t/l)+s;return t<g1.minute?"たった今":t<g1.hour?r(g1.minute,"分前"):t<g1.day?r(g1.hour,"時間前"):t<g1.month?r(g1.day,"日前"):t<g1.year?r(g1.month,"ヶ月前"):r(g1.year,"年前")},zc=(a,t=!1)=>{const r=a.getMonth()+1,l=a.getDate(),s=["日","月","火","水","木","金","土"][a.getDay()];return[r,l].map(n=>t?String(n).padStart(2,"0"):String(n)).join("/").concat(`(${s})`)},Tc=a=>{const t=Math.floor(a),r=Math.floor((a-t)*60);return[t,r.toString().padStart(2,"0")].join(":")},jc=a=>{let t=a;return t=t.replace(/&/g,"&amp;"),t=t.replace(/</g,"&lt;"),t=t.replace(/>/g,"&gt;"),t},d7=/(https?:\/\/[\w/:%#\$&\?\(\)~\.=\+\-]+)/g,Ic=a=>jc(a).split(d7).map(t=>t===""?null:{type:t.match(d7)?"link":"text",content:t}).filter(t=>t!==null),h7=300,m7=({isOpen:a,textValue:t,username:r,placeholder:l,messages:s,haveNewMessage:n,formRows:i,typingUsername:d,status:c,statusOptions:v,statusPlaceholder:u,onChangeStatus:p,onChangeTextValue:f,onSubmit:w,onToggle:x,...z})=>{const T=h.useRef(null),g=h.useRef(null),q=h.useRef(null),[j,S]=h.useState(0),C=h.useMemo(()=>{const b=[];return s.forEach(Q=>{const F=new Date(Q.time),A=b.find(R=>R.date.getFullYear()===F.getFullYear()&&R.date.getMonth()===F.getMonth()&&R.date.getDate()===F.getDate());A?A.contents.push(Q):b.push({date:F,contents:[Q]})}),b},[s]),[N,Z]=h.useState(!1),B=h.useCallback(()=>{x==null||x(),Z(!0),setTimeout(()=>{Z(!1)},h7)},[x]);return h.useLayoutEffect(()=>{const b=T.current,Q=g.current;if(!b||!Q)return;const F=()=>{const R=b.getBoundingClientRect(),V=Q.getBoundingClientRect();S(V.top-R.top-R.height)};F();const A=new ResizeObserver(()=>{F()});return A.observe(b),()=>{A.disconnect()}},[]),h.useEffect(()=>{const b=q.current;b&&a&&b.scrollTo(0,b.scrollHeight)},[a,s]),e.jsxs(k1,{...z,ref:T,position:"fixed",right:"1.5rem",bottom:a?"0":`${j}px`,transition:N?`bottom ${h7}ms ease-in-out`:void 0,width:"20rem",zIndex:"floating",children:[e.jsxs(V1,{shadow:!0,align:"stretch",mainHeaderArea:e.jsxs(k,{align:"center",gap:"xs2",nowrap:!0,children:[e.jsx(e1,{color:"gray.700",as:"span",bold:!0,children:r}),n&&e.jsx(k1,{width:K.fontSize.md,height:K.fontSize.md,bgColor:"red.800",round:"max"})]}),subHeaderArea:e.jsx(L,{size:"xl2",color:"gray.500",icon:a?S1:H1}),footerArea:e.jsxs(U,{width:"100%",justify:"end",gap:"xs",children:[e.jsx(q7,{value:t,onChange:f,onSubmit:w,placeholder:l,formRows:i}),c!==void 0&&v!==void 0&&e.jsxs(k,{nowrap:!0,children:[e.jsx(I3,{options:v,value:c,onChange:b=>p==null?void 0:p(b),placeholder:u,expand:!0}),e.jsx("div",{style:{width:K.spacing.xl4,flexShrink:0}})]}),d&&e.jsxs(e1,{color:"gray.600",as:"p",fontSize:"xs2",children:[e.jsx(e1,{as:"span",bold:!0,fontSize:"xs2",color:"gray.700",children:d})," さんが入力しています..."]})]}),children:[e.jsx("div",{ref:g,children:e.jsx(z1,{})}),e.jsx(k1,{overflowY:"scroll",ref:q,children:e.jsx(U,{gap:"xs",py:"xs",height:"320px",nowrap:!0,children:C.map(({date:b,contents:Q},F)=>{const A=`${b.toDateString()}-${F}`;return e.jsxs(h.Fragment,{children:[e.jsx(k,{justify:"center",children:e.jsx(y1,{label:zc(b),variant:"mono",fontSize:"xs2"})}),Q.map((R,V)=>e.jsx(u7,{content:R,maxChatItemWidth:"192px"},`${A}-${F}-${V}`))]},A)})})})]}),e.jsx("button",{type:"button",className:gc,onClick:B})]})};m7.displayName=I.ChatCard;const Wc=m7;function bc(a){return a<1?"未読":a===1?"既読":`既読${a}`}const v7=({className:a,style:t,content:r,maxChatItemWidth:l})=>{const s=Ic(r.message),n=r.sender==="me";return e.jsxs(U,{className:a,style:t,align:n?"end":"start",children:[r.username&&e.jsx(e1,{as:"span",fontSize:"xs2",color:"gray.600",children:r.username}),e.jsxs(k,{align:"end",gap:"xs2",reverse:n,children:[e.jsx(V1,{border:!0,fit:!0,px:"md",py:"xs",maxWidth:l,children:s.map((i,d)=>i.type==="link"?e.jsx(xe,{href:i.content,openInNewTab:!0,fontSize:"xs",children:i.content},`anchor-${d}`):e.jsx(e1,{as:"span",fontSize:"xs",color:"gray.700",whiteSpace:"preLine",breakAll:!0,children:i.content},`text-${d}`))}),e.jsxs(U,{align:n?"end":"start",children:[r.readers&&e.jsx(h0,{content:r.readers.join(`
43
43
  `),children:e.jsx(e1,{as:"span",fontSize:"xs2",color:"gray.500",children:bc(r.readers.length)})}),e.jsx(e1,{as:"span",fontSize:"xs2",color:"gray.500",children:fc(r.time)})]})]})]})};v7.displayName=I.ChatItem;const u7=v7,x7=({className:a,style:t,value:r,disabled:l,placeholder:s,formRows:n,onChange:i,onSubmit:d})=>e.jsxs(k,{className:a,style:t,align:"center",gap:"xs",nowrap:!0,children:[e.jsx(e7,{value:r,placeholder:s,disabled:l,rows:n,expand:!0,onChange:c=>i==null?void 0:i(c.target.value)}),e.jsx("div",{children:e.jsx(E1,{icon:Z0,disabled:l,onClick:d})})]});x7.displayName=I.ChatForm;const q7=x7;var Sc="etiz6n0",_c="etiz6n1";const p7=h.createContext({}),g7=({className:a,style:t,htmlFor:r,label:l,required:s,error:n,direction:i="horizontal",children:d,borderLeft:c=!1,borderColor:v="green.800",labelTagPosition:u,labelSuffix:p})=>{const{labelWidth:f="8rem",labelColor:w,labelFontSize:x,labelTagPosition:z}=h.useContext(p7),T=u||z||"right",g=h.useMemo(()=>i==="horizontal"?f:void 0,[f,i]);return e.jsx(x1.Provider,{value:{error:n!==void 0},children:e.jsxs(U,{nowrap:!0,style:{...t,paddingBottom:n===void 0?K.fontSize.sm:void 0},children:[e.jsxs(F1,{className:a,direction:i,nowrap:!0,align:i==="horizontal"?"center":void 0,children:[e.jsxs(k,{width:f,gap:"xs2",my:"xs2",nowrap:!0,children:[e.jsxs(k,{align:"center",reverse:T==="left",justify:T==="left"?"end":"start",gap:"xs",className:y({[Sc]:c,[u5[v]]:c}),children:[e.jsx(e1,{as:"label",htmlFor:r,color:w,fontSize:x,bold:c,className:y({[_c]:c}),children:l}),s&&e.jsx(y1,{fontSize:"xs2",label:"必須"})]}),p]}),d]}),e.jsx(e1,{fontSize:"xs2",lineHeight:"sm",color:"red.800",style:{marginInlineStart:g},children:n})]})})};g7.displayName=I.FormControl;const Cc=g7,f7=({className:a,style:t,labelWidth:r,labelColor:l="gray.900",labelFontSize:s="md",labelTagPosition:n,gap:i="md",children:d})=>e.jsx(p7.Provider,{value:{labelWidth:r,labelColor:l,labelFontSize:s,labelTagPosition:n},children:e.jsx(U,{className:a,style:t,gap:i,children:d})});f7.displayName=I.FormGroup;const Bc=f7,w7=({title:a,timestamp:t,variant:r="primary",read:l,tableInfo:s,width:n,onClick:i,...d})=>{const[c,v]=h.useState(!1),[u,p]=h.useState(!1),[f,w]=h.useState(window.innerWidth);h.useEffect(()=>{function q(){w(window.innerWidth)}return window.addEventListener("resize",q),()=>{window.removeEventListener("resize",q)}},[]);const x=h.useMemo(()=>wc(t),[t]),z=h.useMemo(()=>yc(t),[t]),T=f>768,g=()=>{if(T){if(u)return"green.300";if(c)return"gray.200"}return"white.800"};return e.jsx(k1,{...d,onMouseOver:h.useCallback(()=>v(!0),[]),onMouseLeave:h.useCallback(()=>v(!1),[]),onPointerDown:h.useCallback(()=>p(!0),[]),onPointerUp:h.useCallback(()=>p(!1),[]),onClick:i,bgColor:g(),height:"fit-content",cursor:"pointer",width:n,children:e.jsxs(k,{px:"md",py:"xs",justify:"between",align:"center",nowrap:!0,children:[e.jsxs(U,{position:"relative",width:"100%",children:[r==="primary"&&e.jsxs(k,{justify:"between",align:"start",children:[e.jsx($5,{children:e.jsx(ae,{children:s==null?void 0:s.map((q,j)=>e.jsxs(le,{children:[e.jsx(f0,{align:"left",style:{paddingRight:K.spacing.xl,paddingBottom:K.spacing.xs},children:e.jsx(e1,{bold:!l,fontSize:"xs",color:"gray.700",children:q.title})}),e.jsx(f0,{align:"left",style:{paddingBottom:K.spacing.xs},children:e.jsx(e1,{bold:!l,fontSize:"xs",color:"gray.700",children:q.content})})]},`${q.title}_${j}`))})}),e.jsx(e1,{color:"gray.600",fontSize:"xs2",children:z})]}),e.jsxs(U,{gap:"xs",children:[e.jsx(e1,{color:"gray.700",fontSize:"xs",maxLines:2,bold:!l,children:a}),r==="secondary"&&e.jsx(e1,{color:"gray.600",fontSize:"xs2",children:x})]})]}),e.jsx(L,{icon:T1,color:"green.800"})]})})};w7.displayName=I.NotificationPanel;const y7=w7,z7=({variant:a,notifications:t,height:r,emptyMessage:l,onClick:s,...n})=>e.jsxs(k1,{...n,height:r,overflowY:"scroll",children:[t.map((i,d)=>e.jsxs(h.Fragment,{children:[e.jsx(y7,{variant:a,read:i.read,title:i.title,timestamp:i.timestamp,tableInfo:i.tableInfo,onClick:()=>s==null?void 0:s(i.id)}),d!==t.length-1&&e.jsx(z1,{})]},i.id)),t.length===0&&e.jsx(k,{align:"center",justify:"center",height:"100%",children:e.jsx(e1,{color:"gray.600",fontSize:"sm",children:l})})]});z7.displayName=I.NotificationList;const T7=z7,j7=({tabs:a,notifications:t,height:r,emptyMessage:l,onClick:s,...n})=>{const[i,d]=h.useState(a[0].name??""),c=h.useMemo(()=>t.filter(u=>u.tabName===i),[i,t]),v=h.useMemo(()=>{var u;return(u=a.find(p=>p.name===i))==null?void 0:u.variant},[i,a]);return e.jsxs("div",{...n,children:[e.jsx(E5,{items:a,activeTabName:i,onClickTab:u=>d(u)}),e.jsx(k1,{bgColor:"white.800",roundB:"xs2",overflow:"hidden",children:e.jsx(T7,{notifications:c,variant:v,height:r,emptyMessage:l,onClick:s})})]})};j7.displayName=I.Notification;const Nc=j7;var Zc="dev1450",I7={primary:"dev1452 dev1451",secondary:"dev1453 dev1451",tertiary:"dev1454 dev1451"},kc="dev1455",Mc="dev1456",Lc="dev1457",Ec="dev1458",Fc="dev1459",Hc="dev145a";const O0=({className:a,style:t,id:r,variant:l="primary",text:s,gridRow:n,gridColumn:i,show:d=!0,onScheduleClick:c})=>{const v=()=>{const[u,p]=n.split("/").map(f=>f.trim()).map(Number);return p-u>2?s:""};return c?e.jsx("button",{type:"button",className:y(a,I7[l],kc),style:{...t,gridRow:n,gridColumn:i},hidden:!d,onClick:()=>c(r),children:v()}):e.jsx("div",{className:I7[l],style:{gridRow:n,gridColumn:i},hidden:!d,children:v()})};O0.displayName=I.ScheduleCard;const V0=0,U0=23,Rc=8,Dc=22,m0=4,Pc=(a,t)=>`startHourはendHour以下の値を指定してください。
44
44
  startHour: ${a}, endHour: ${t}`,W7=(a,t)=>`${a}Hourは${V0}以上${U0}以下の値を指定してください。
45
45
  ${a}Hour: ${t}`,Qc=(a,t)=>`Scheduleは${a}時以降から始まる必要があります
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wizleap-inc/wiz-ui-react",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "description": "A React UI Framework for Wizleap Inc.",
5
5
  "devDependencies": {
6
6
  "@storybook/react": "^8.6.12",
@@ -26,9 +26,9 @@
26
26
  "clsx": "^1.2.1",
27
27
  "react": "^18.2.0",
28
28
  "react-dom": "^18.2.0",
29
- "@wizleap-inc/wiz-ui-utils": "0.3.0",
30
29
  "@wizleap-inc/wiz-ui-constants": "0.54.0",
31
- "@wizleap-inc/wiz-ui-styles": "0.57.0"
30
+ "@wizleap-inc/wiz-ui-styles": "0.57.0",
31
+ "@wizleap-inc/wiz-ui-utils": "0.3.0"
32
32
  },
33
33
  "scripts": {
34
34
  "build": "tsc --noEmit && vite build",