@cocso-ui/react 0.0.1-beta.41 → 0.0.1-beta.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import * as SwitchPrimitive from '@radix-ui/react-switch';
3
3
  export type SwitchProps = {
4
- asChild?: boolean;
5
4
  id: string;
6
5
  size?: 'lg' | 'md';
7
6
  disabled?: boolean;
@@ -9,7 +8,6 @@ export type SwitchProps = {
9
8
  position?: 'left' | 'right';
10
9
  } & React.ComponentPropsWithoutRef<typeof SwitchPrimitive.Root>;
11
10
  export declare const Switch: React.ForwardRefExoticComponent<{
12
- asChild?: boolean;
13
11
  id: string;
14
12
  size?: "lg" | "md";
15
13
  disabled?: boolean;
package/lib/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var Fo=Object.create;var I=Object.defineProperty;var Do=Object.getOwnPropertyDescriptor;var Oo=Object.getOwnPropertyNames;var Eo=Object.getPrototypeOf,Bo=Object.prototype.hasOwnProperty;var Ao=(o,e)=>{for(var t in e)I(o,t,{get:e[t],enumerable:!0})},no=(o,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Oo(e))!Bo.call(o,n)&&n!==t&&I(o,n,{get:()=>e[n],enumerable:!(r=Do(e,n))||r.enumerable});return o};var g=(o,e,t)=>(t=o!=null?Fo(Eo(o)):{},no(e||!o||!o.__esModule?I(t,"default",{value:o,enumerable:!0}):t,o)),Ho=o=>no(I({},"__esModule",{value:!0}),o);var ve={};Ao(ve,{Accordion:()=>_o,Body:()=>B,Button:()=>qo,Checkbox:()=>he,Display:()=>Qo,FileUpload:()=>oe,Heading:()=>Y,Label:()=>F,Link:()=>re,Modal:()=>ae,OneTimePasswordField:()=>le,Pagination:()=>de,Spinner:()=>Q,Switch:()=>ue,Toaster:()=>Ce,toast:()=>V.toast});module.exports=Ho(ve);var S=g(require("@radix-ui/react-accordion"),1),z=require("react");var Io=(...o)=>o.filter(Boolean).join(" ").trim(),c=(o,e,t=[],...r)=>{let n=Object.entries(e).filter(([,a])=>a!==!1&&a!==null&&a!==void 0).map(([a,m])=>`${o}--${a}_${m}`).join(" "),s=t.filter(a=>Object.entries(a).every(([m,p])=>e[m]===p)).map(a=>{let m=Object.entries(a).map(([p,l])=>`${p}_${l}`).join("-");return`${o}--${m}`}).join(" ");return Io(o,n,s,...r)};var io=require("@radix-ui/react-slot"),M=require("react/jsx-runtime"),zo=(0,z.forwardRef)(({className:o,...e},t)=>{let r=c("cocso-accordion-item",{},[],o);return(0,M.jsx)(S.Item,{ref:t,className:r,...e})}),jo=(0,z.forwardRef)(({className:o,children:e,chevron:t=!0,...r},n)=>{let s=c("cocso-accordion-trigger",{},[],o);return(0,M.jsx)(S.Trigger,{ref:n,className:s,...r,children:(0,M.jsxs)(io.Slottable,{children:[e,t&&(0,M.jsx)("div",{className:"cocso-accordion-chevron",children:(0,M.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,M.jsx)("path",{d:"m6 9 6 6 6-6"})})})]})})}),$o=(0,z.forwardRef)(({className:o,...e},t)=>{let r=c("cocso-accordion-content",{},[],o);return(0,M.jsx)(S.Content,{ref:t,className:r,...e})}),_o=Object.assign(S.Root,{Item:zo,Header:S.Header,Trigger:jo,Content:$o});var ao=g(require("react"),1),co=require("@radix-ui/react-slot");function y(o){if(o)return o.includes(".")?`var(--color-${o.replace(/\./g,"-")})`:o}var so={thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"};function R(o){if(o)return o in so?so[o]:o}var mo=require("react/jsx-runtime"),Uo=ao.forwardRef(({asChild:o=!1,size:e="md",color:t,weight:r="normal",className:n,style:s,...a},m)=>{let l=c("cocso-body",{size:e},[],n);return(0,mo.jsx)(o?co.Slot:"p",{ref:m,className:l,style:{"--cocso-body-color":y(t),"--cocso-body-weight":R(r),...s},...a})}),B=Object.assign(Uo,{displayName:"Body"});var A=g(require("react"),1),po=require("@radix-ui/react-slot");var lo=g(require("react"),1);var E=require("react/jsx-runtime"),Vo=["div"],Go=lo.forwardRef(({as:o=Vo[0],size:e="md",color:t="palette.primary-500",bg:r="palette.gray-200",className:n,style:s,...a},m)=>{let p=o,d=c("cocso-spinner",{size:e},[],n);return(0,E.jsx)(p,{ref:m,className:d,style:{"--cocso-spinner-bg":y(r),"--cocso-spinner-color":y(t),...s},...a,children:(0,E.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,E.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"9",stroke:"var(--cocso-spinner-bg, currentColor)",strokeWidth:"3"}),(0,E.jsx)("path",{className:"opacity-75",fill:"var(--cocso-spinner-color, currentColor)",d:"M12 2a10 10 0 0110 10 10 10 0 01-5 8.66l-1-1.73a8 8 0 004-6.93 8 8 0 00-8-8V2z"})]})})}),Q=Object.assign(Go,{displayName:"Spinner"});var X=require("react/jsx-runtime"),Ko=o=>({"2xs":"xs",xs:"xs",sm:"xs",md:"sm",lg:"md",xl:"md"})[o],Zo=A.forwardRef(({asChild:o=!1,variant:e="primary",size:t="md",disabled:r=!1,loading:n=!1,color:s,weight:a="normal",className:m,style:p,children:l,onClick:d,onKeyDown:f,...N},W)=>{let P=r||n,x=A.useCallback(T=>{if(P){T.preventDefault();return}d?.(T)},[P,d]),G=A.useCallback(T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),P||T.currentTarget.click()),f?.(T)},[P,f]),K={variant:e,size:t,loading:n,disabled:P},Z=[...r?[{variant:e,disabled:r}]:[],...n?[{variant:e,loading:n}]:[]],q=c("cocso-button",K,Z,m),J={"--cocso-button-color":y(s),"--cocso-button-weight":R(a),...p};return(0,X.jsx)(o?po.Slot:"button",{ref:W,className:q,onClick:x,onKeyDown:G,role:"button",disabled:P,"aria-disabled":P,"aria-busy":n,style:J,...N,children:n?(0,X.jsx)(Q,{className:"cocso-button-spinner",size:Ko(t),color:"currentColor"}):l})}),qo=Object.assign(Zo,{displayName:"Button"});var fo=g(require("react"),1),ho=require("@radix-ui/react-slot");var go=require("react/jsx-runtime"),Jo=fo.forwardRef(({asChild:o=!1,size:e="md",color:t,weight:r="bold",className:n,style:s,...a},m)=>{let l=c("cocso-display",{size:e},[],n);return(0,go.jsx)(o?ho.Slot:"h1",{ref:m,className:l,style:{"--cocso-display-color":y(t),"--cocso-display-weight":R(r),...s},...a})}),Qo=Object.assign(Jo,{displayName:"Display"});var bo=g(require("react"),1),u=require("react");var uo=g(require("react"),1),Co=require("@radix-ui/react-slot");var vo=require("react/jsx-runtime"),Xo=uo.forwardRef(({asChild:o=!1,size:e="md",color:t="text.basic",weight:r="normal",className:n,style:s,...a},m)=>{let l=c("cocso-label",{size:e},[],n);return(0,vo.jsx)(o?Co.Slot:"label",{ref:m,className:l,style:{"--cocso-label-color":y(t),"--cocso-label-weight":R(r),...s},...a})}),F=Object.assign(Xo,{displayName:"Label"});var h=require("react/jsx-runtime"),Yo=bo.forwardRef(({maxFiles:o=2,files:e,onFilesChange:t,onRemove:r,multiple:n=!0,accept:s,...a},m)=>{let[p,l]=(0,u.useState)(!1),d=(0,u.useRef)(null),f=(0,u.useRef)(null),N=3*1024*1024,W=(0,u.useCallback)(i=>s?s.split(",").map(w=>w.trim()).some(w=>{if(w.endsWith("/*")){let H=w.slice(0,-2);return i.type.startsWith(H)}return i.type===w||i.name.toLowerCase().endsWith(w)}):!0,[s]),P=(0,u.useCallback)(i=>i.size>N?(alert(`${i.name}\uC740(\uB294) 3MB\uB97C \uCD08\uACFC\uD569\uB2C8\uB2E4.`),!1):!0,[]),x=(0,u.useCallback)(i=>{let w=Array.from(i).filter(D=>W(D)?P(D):(alert(`${D.name}\uC740(\uB294) \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uB294 \uD30C\uC77C \uD0C0\uC785\uC785\uB2C8\uB2E4.`),!1));if(w.length===0)return;let H=o-e.length;if(H<=0){alert(`\uCD5C\uB300 ${o}\uAC1C\uC758 \uD30C\uC77C\uB9CC \uC5C5\uB85C\uB4DC\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.`);return}let Mo=w.slice(0,H).map(D=>({file:D,name:D.name,size:D.size}));t([...e,...Mo])},[e,o,t,W,P]),G=(0,u.useCallback)(i=>{i.preventDefault(),i.stopPropagation(),l(!0)},[]),K=(0,u.useCallback)(i=>{i.preventDefault(),i.stopPropagation(),f.current&&!f.current.contains(i.relatedTarget)&&l(!1)},[]),Z=(0,u.useCallback)(i=>{i.preventDefault(),i.stopPropagation()},[]),q=(0,u.useCallback)(i=>{i.preventDefault(),i.stopPropagation(),l(!1);let{files:L}=i.dataTransfer;L&&x(L)},[x]),J=(0,u.useCallback)(i=>{let{files:L}=i.target;L&&x(L)},[x]),to=(0,u.useCallback)(i=>{let L=e.filter(w=>w.name!==i);t(L),r?.(i)},[e,t,r]),T=(0,u.useCallback)(()=>{d.current?.click()},[]),ro=e.length>=o||!n&&e.length>=1;return(0,h.jsxs)("div",{className:"cocso-file-upload-wrapper",children:[!ro&&(0,h.jsxs)("div",{ref:f,onDragEnter:G,onDragOver:Z,onDragLeave:K,onDrop:q,onClick:T,className:"cocso-file-upload","data-drag-active":p,children:[(0,h.jsx)("input",{ref:i=>{d.current=i,typeof m=="function"?m(i):m&&(m.current=i)},type:"file",onChange:J,multiple:n,accept:s,style:{display:"none"},...a}),(0,h.jsxs)(F,{size:"xs",color:"palette.gray-600",children:["\uD30C\uC77C\uC744 \uC5EC\uAE30\uC5D0 \uB04C\uC5B4\uB2E4 \uB193\uAC70\uB098, \uD074\uB9AD\uD558\uC5EC \uD30C\uC77C\uC744 \uC120\uD0DD\uD558\uC138\uC694",(0,h.jsx)("br",{}),"(\uCD5C\uB300 3MB)"]}),(0,h.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,h.jsx)("path",{d:"M5 12h14"}),(0,h.jsx)("path",{d:"M12 5v14"})]})]}),e.length>0&&(0,h.jsx)("div",{className:"cocso-file-upload-list",children:e.map(i=>(0,h.jsxs)("div",{className:"cocso-file-upload-item",children:[(0,h.jsx)(B,{size:"xs",children:i.name}),(0,h.jsx)("button",{type:"button",onClick:()=>to(i.name),className:"cocso-file-upload-remove",children:(0,h.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,h.jsx)("path",{d:"M18 6 6 18"}),(0,h.jsx)("path",{d:"m6 6 12 12"})]})})]},i.name))})]})}),oe=Object.assign(Yo,{displayName:"FileUpload"});var Po=g(require("react"),1),yo=require("@radix-ui/react-slot");var Ro=require("react/jsx-runtime"),ee=Po.forwardRef(({asChild:o=!1,size:e="md",color:t,weight:r="bold",className:n,style:s,...a},m)=>{let l=c("cocso-heading",{size:e},[],n);return(0,Ro.jsx)(o?yo.Slot:"h2",{ref:m,className:l,style:{"--cocso-heading-color":y(t),"--cocso-heading-weight":R(r),...s},...a})}),Y=Object.assign(ee,{displayName:"Heading"});var xo=g(require("react"),1),wo=require("@radix-ui/react-slot");var ko=require("react/jsx-runtime"),te=xo.forwardRef(({asChild:o=!1,size:e="md",weight:t="normal",indicator:r=!0,className:n,style:s,...a},m)=>{let l=c("cocso-link",{size:e,indicator:r},[],n);return(0,ko.jsx)(o?wo.Slot:"a",{ref:m,className:l,style:{"--cocso-link-weight":R(t),...s},...a})}),re=Object.assign(te,{displayName:"Link"});var C=g(require("@radix-ui/react-dialog"),1),j=require("react");var b=require("react/jsx-runtime"),ne=(0,j.forwardRef)(({className:o,children:e,...t},r)=>{let n=c("cocso-modal-content",{},[],o);return(0,b.jsxs)(C.Portal,{children:[(0,b.jsx)(C.Overlay,{className:"cocso-modal-overlay"}),(0,b.jsxs)(C.Content,{ref:r,className:n,...t,children:[(0,b.jsx)("div",{className:"cocso-modal-close-wrapper",children:(0,b.jsx)(C.Close,{className:"cocso-modal-close",children:(0,b.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,b.jsx)("path",{d:"M18 6 6 18"}),(0,b.jsx)("path",{d:"m6 6 12 12"})]})})}),e]})]})}),ie=(0,j.forwardRef)(({className:o,children:e,...t},r)=>{let n=c("cocso-modal-title",{},[],o);return(0,b.jsx)(C.Title,{ref:r,className:n,asChild:!0,...t,children:(0,b.jsx)(Y,{color:"text.basic",children:e})})}),se=(0,j.forwardRef)(({className:o,children:e,...t},r)=>{let n=c("cocso-modal-description",{},[],o);return(0,b.jsx)(C.Description,{ref:r,className:n,asChild:!0,...t,children:(0,b.jsx)(B,{size:"sm",color:"text.subtle",children:e})})}),ae=Object.assign(C.Root,{Trigger:C.Trigger,Content:ne,Title:ie,Description:se});var $=g(require("@radix-ui/react-one-time-password-field"),1),oo=require("react");var eo=require("react/jsx-runtime"),ce=(0,oo.forwardRef)(({className:o,...e},t)=>{let r=c("cocso-otp",{},[],o);return(0,eo.jsx)($.Root,{ref:t,className:r,...e})}),me=(0,oo.forwardRef)(({className:o,...e},t)=>{let r=c("cocso-otp-input",{},[],o);return(0,eo.jsx)($.Input,{ref:t,className:r,...e})}),le=Object.assign(ce,{Input:me});var No=g(require("react"),1),To=require("@radix-ui/react-slot"),v=require("react/jsx-runtime"),pe=No.forwardRef(({asChild:o=!1,page:e,totalPages:t,maxVisible:r=5,onChange:n,className:s,...a},m)=>{let p=Math.ceil(r/2),l=f=>(0,v.jsx)("button",{className:"cocso-pagination-item",onClick:()=>n(f),"data-active":e===f,children:f},f);return(0,v.jsxs)(o?To.Slot:"div",{ref:m,className:`cocso-pagination ${s||""}`,...a,children:[t>1&&(0,v.jsx)("button",{className:"cocso-pagination-arrow",disabled:e===1,onClick:()=>e>1&&n(e-1),children:(0,v.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,v.jsx)("path",{d:"m15 18-6-6 6-6"})})}),t<=r+2?Array(t).fill(0).map((f,N)=>l(N+1)):(0,v.jsxs)(v.Fragment,{children:[l(1),e>1+p&&(0,v.jsx)("span",{className:"cocso-pagination-trunc",children:"..."}),Array(r).fill(0).map((f,N)=>{let W=e-p+N+1;return W>1&&W<t?l(W):""}),e<t-p&&(0,v.jsx)("span",{className:"cocso-pagination-trunc",children:"..."}),l(t)]}),t>1&&(0,v.jsx)("button",{className:"cocso-pagination-arrow",disabled:e===t,onClick:()=>e<t&&n(e+1),children:(0,v.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,v.jsx)("path",{d:"m9 18 6-6-6-6"})})})]})}),de=Object.assign(pe,{displayName:"Pagination"});var So=g(require("react"),1),_=g(require("@radix-ui/react-checkbox"),1);var k=require("react/jsx-runtime"),fe=So.forwardRef(({id:o,size:e="md",status:t,onChange:r,label:n,disabled:s=!1,className:a,...m},p)=>{let l={size:e,disabled:s,status:t},d=[...s?[{status:t,disabled:s}]:[]],f=c("cocso-checkbox",l,d,a),N=P=>{if(!s){let x;P===!0?x="on":P==="indeterminate"?x="intermediate":x="off",r(x)}};return(0,k.jsxs)("div",{className:"cocso-checkbox-wrapper",children:[(0,k.jsxs)(_.Root,{ref:p,id:o,className:f,checked:(()=>{switch(t){case"on":return!0;case"intermediate":return"indeterminate";case"off":default:return!1}})(),onCheckedChange:N,disabled:s,...m,children:[(0,k.jsx)(_.Indicator,{className:"cocso-checkbox-indicator",style:{opacity:t==="on"?1:0},children:(0,k.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,k.jsx)("path",{d:"M20 6 9 17l-5-5"})})}),(0,k.jsx)("div",{className:"cocso-checkbox-indicator",style:{opacity:t==="intermediate"?1:0},children:(0,k.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:(0,k.jsx)("path",{d:"M5 12h14"})})})]}),n&&(0,k.jsx)(F,{className:c("cocso-checkbox-label",{disabled:s}),size:e,htmlFor:o,children:n})]})}),he=Object.assign(fe,{displayName:"Checkbox"});var Wo=g(require("react"),1),Lo=require("@radix-ui/react-slot"),U=g(require("@radix-ui/react-switch"),1);var O=require("react/jsx-runtime"),ge=Wo.forwardRef(({asChild:o=!1,id:e,size:t="md",disabled:r=!1,label:n,position:s="right",className:a,children:m,...p},l)=>{let d=c("cocso-switch",{size:t,disabled:r},[],a),f=c("cocso-switch-thumb",{size:t});return(0,O.jsxs)(o?Lo.Slot:"div",{className:"cocso-switch-wrapper",children:[s==="left"&&(0,O.jsx)(F,{size:t,htmlFor:e,children:n}),(0,O.jsx)(U.Root,{ref:l,className:d,...p,children:(0,O.jsx)(U.Thumb,{className:f})}),s==="right"&&(0,O.jsx)(F,{size:t,htmlFor:e,children:n})]})}),ue=Object.assign(ge,{displayName:"Switch"});var V=require("sonner"),Ce=Object.assign(V.Toaster,{displayName:"Toast"});
1
+ "use strict";var Mo=Object.create;var I=Object.defineProperty;var Fo=Object.getOwnPropertyDescriptor;var Do=Object.getOwnPropertyNames;var Oo=Object.getPrototypeOf,Eo=Object.prototype.hasOwnProperty;var Bo=(e,o)=>{for(var t in o)I(e,t,{get:o[t],enumerable:!0})},no=(e,o,t,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of Do(o))!Eo.call(e,n)&&n!==t&&I(e,n,{get:()=>o[n],enumerable:!(r=Fo(o,n))||r.enumerable});return e};var h=(e,o,t)=>(t=e!=null?Mo(Oo(e)):{},no(o||!e||!e.__esModule?I(t,"default",{value:e,enumerable:!0}):t,e)),Ao=e=>no(I({},"__esModule",{value:!0}),e);var Ce={};Bo(Ce,{Accordion:()=>$o,Body:()=>B,Button:()=>Zo,Checkbox:()=>fe,Display:()=>Jo,FileUpload:()=>Yo,Heading:()=>Y,Label:()=>F,Link:()=>te,Modal:()=>se,OneTimePasswordField:()=>me,Pagination:()=>pe,Spinner:()=>Q,Switch:()=>ge,Toaster:()=>ue,toast:()=>V.toast});module.exports=Ao(Ce);var T=h(require("@radix-ui/react-accordion"),1),z=require("react");var Ho=(...e)=>e.filter(Boolean).join(" ").trim(),a=(e,o,t=[],...r)=>{let n=Object.entries(o).filter(([,c])=>c!==!1&&c!==null&&c!==void 0).map(([c,m])=>`${e}--${c}_${m}`).join(" "),s=t.filter(c=>Object.entries(c).every(([m,p])=>o[m]===p)).map(c=>{let m=Object.entries(c).map(([p,l])=>`${p}_${l}`).join("-");return`${e}--${m}`}).join(" ");return Ho(e,n,s,...r)};var io=require("@radix-ui/react-slot"),M=require("react/jsx-runtime"),Io=(0,z.forwardRef)(({className:e,...o},t)=>{let r=a("cocso-accordion-item",{},[],e);return(0,M.jsx)(T.Item,{ref:t,className:r,...o})}),zo=(0,z.forwardRef)(({className:e,children:o,chevron:t=!0,...r},n)=>{let s=a("cocso-accordion-trigger",{},[],e);return(0,M.jsx)(T.Trigger,{ref:n,className:s,...r,children:(0,M.jsxs)(io.Slottable,{children:[o,t&&(0,M.jsx)("div",{className:"cocso-accordion-chevron",children:(0,M.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,M.jsx)("path",{d:"m6 9 6 6 6-6"})})})]})})}),jo=(0,z.forwardRef)(({className:e,...o},t)=>{let r=a("cocso-accordion-content",{},[],e);return(0,M.jsx)(T.Content,{ref:t,className:r,...o})}),$o=Object.assign(T.Root,{Item:Io,Header:T.Header,Trigger:zo,Content:jo});var ao=h(require("react"),1),co=require("@radix-ui/react-slot");function y(e){if(e)return e.includes(".")?`var(--color-${e.replace(/\./g,"-")})`:e}var so={thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"};function R(e){if(e)return e in so?so[e]:e}var mo=require("react/jsx-runtime"),_o=ao.forwardRef(({asChild:e=!1,size:o="md",color:t,weight:r="normal",className:n,style:s,...c},m)=>{let l=a("cocso-body",{size:o},[],n);return(0,mo.jsx)(e?co.Slot:"p",{ref:m,className:l,style:{"--cocso-body-color":y(t),"--cocso-body-weight":R(r),...s},...c})}),B=Object.assign(_o,{displayName:"Body"});var A=h(require("react"),1),po=require("@radix-ui/react-slot");var lo=h(require("react"),1);var E=require("react/jsx-runtime"),Uo=["div"],Vo=lo.forwardRef(({as:e=Uo[0],size:o="md",color:t="palette.primary-500",bg:r="palette.gray-200",className:n,style:s,...c},m)=>{let p=e,d=a("cocso-spinner",{size:o},[],n);return(0,E.jsx)(p,{ref:m,className:d,style:{"--cocso-spinner-bg":y(r),"--cocso-spinner-color":y(t),...s},...c,children:(0,E.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,E.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"9",stroke:"var(--cocso-spinner-bg, currentColor)",strokeWidth:"3"}),(0,E.jsx)("path",{className:"opacity-75",fill:"var(--cocso-spinner-color, currentColor)",d:"M12 2a10 10 0 0110 10 10 10 0 01-5 8.66l-1-1.73a8 8 0 004-6.93 8 8 0 00-8-8V2z"})]})})}),Q=Object.assign(Vo,{displayName:"Spinner"});var X=require("react/jsx-runtime"),Go=e=>({"2xs":"xs",xs:"xs",sm:"xs",md:"sm",lg:"md",xl:"md"})[e],Ko=A.forwardRef(({asChild:e=!1,variant:o="primary",size:t="md",disabled:r=!1,loading:n=!1,color:s,weight:c="normal",className:m,style:p,children:l,onClick:d,onKeyDown:C,...S},W)=>{let P=r||n,x=A.useCallback(N=>{if(P){N.preventDefault();return}d?.(N)},[P,d]),G=A.useCallback(N=>{(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),P||N.currentTarget.click()),C?.(N)},[P,C]),K={variant:o,size:t,loading:n,disabled:P},Z=[...r?[{variant:o,disabled:r}]:[],...n?[{variant:o,loading:n}]:[]],q=a("cocso-button",K,Z,m),J={"--cocso-button-color":y(s),"--cocso-button-weight":R(c),...p};return(0,X.jsx)(e?po.Slot:"button",{ref:W,className:q,onClick:x,onKeyDown:G,role:"button",disabled:P,"aria-disabled":P,"aria-busy":n,style:J,...S,children:n?(0,X.jsx)(Q,{className:"cocso-button-spinner",size:Go(t),color:"currentColor"}):l})}),Zo=Object.assign(Ko,{displayName:"Button"});var fo=h(require("react"),1),ho=require("@radix-ui/react-slot");var go=require("react/jsx-runtime"),qo=fo.forwardRef(({asChild:e=!1,size:o="md",color:t,weight:r="bold",className:n,style:s,...c},m)=>{let l=a("cocso-display",{size:o},[],n);return(0,go.jsx)(e?ho.Slot:"h1",{ref:m,className:l,style:{"--cocso-display-color":y(t),"--cocso-display-weight":R(r),...s},...c})}),Jo=Object.assign(qo,{displayName:"Display"});var bo=h(require("react"),1),g=require("react");var uo=h(require("react"),1),Co=require("@radix-ui/react-slot");var vo=require("react/jsx-runtime"),Qo=uo.forwardRef(({asChild:e=!1,size:o="md",color:t="text.basic",weight:r="normal",className:n,style:s,...c},m)=>{let l=a("cocso-label",{size:o},[],n);return(0,vo.jsx)(e?Co.Slot:"label",{ref:m,className:l,style:{"--cocso-label-color":y(t),"--cocso-label-weight":R(r),...s},...c})}),F=Object.assign(Qo,{displayName:"Label"});var f=require("react/jsx-runtime"),Xo=bo.forwardRef(({maxFiles:e=2,files:o,onFilesChange:t,onRemove:r,multiple:n=!0,accept:s,...c},m)=>{let[p,l]=(0,g.useState)(!1),d=(0,g.useRef)(null),C=(0,g.useRef)(null),S=3*1024*1024,W=(0,g.useCallback)(i=>s?s.split(",").map(w=>w.trim()).some(w=>{if(w.endsWith("/*")){let H=w.slice(0,-2);return i.type.startsWith(H)}return i.type===w||i.name.toLowerCase().endsWith(w)}):!0,[s]),P=(0,g.useCallback)(i=>i.size>S?(alert(`${i.name}\uC740(\uB294) 3MB\uB97C \uCD08\uACFC\uD569\uB2C8\uB2E4.`),!1):!0,[]),x=(0,g.useCallback)(i=>{let w=Array.from(i).filter(D=>W(D)?P(D):(alert(`${D.name}\uC740(\uB294) \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uB294 \uD30C\uC77C \uD0C0\uC785\uC785\uB2C8\uB2E4.`),!1));if(w.length===0)return;let H=e-o.length;if(H<=0){alert(`\uCD5C\uB300 ${e}\uAC1C\uC758 \uD30C\uC77C\uB9CC \uC5C5\uB85C\uB4DC\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.`);return}let Lo=w.slice(0,H).map(D=>({file:D,name:D.name,size:D.size}));t([...o,...Lo])},[o,e,t,W,P]),G=(0,g.useCallback)(i=>{i.preventDefault(),i.stopPropagation(),l(!0)},[]),K=(0,g.useCallback)(i=>{i.preventDefault(),i.stopPropagation(),C.current&&!C.current.contains(i.relatedTarget)&&l(!1)},[]),Z=(0,g.useCallback)(i=>{i.preventDefault(),i.stopPropagation()},[]),q=(0,g.useCallback)(i=>{i.preventDefault(),i.stopPropagation(),l(!1);let{files:L}=i.dataTransfer;L&&x(L)},[x]),J=(0,g.useCallback)(i=>{let{files:L}=i.target;L&&x(L)},[x]),to=(0,g.useCallback)(i=>{let L=o.filter(w=>w.name!==i);t(L),r?.(i)},[o,t,r]),N=(0,g.useCallback)(()=>{d.current?.click()},[]),ro=o.length>=e||!n&&o.length>=1;return(0,f.jsxs)("div",{className:"cocso-file-upload-wrapper",children:[!ro&&(0,f.jsxs)("div",{ref:C,onDragEnter:G,onDragOver:Z,onDragLeave:K,onDrop:q,onClick:N,className:"cocso-file-upload","data-drag-active":p,children:[(0,f.jsx)("input",{ref:i=>{d.current=i,typeof m=="function"?m(i):m&&(m.current=i)},type:"file",onChange:J,multiple:n,accept:s,style:{display:"none"},...c}),(0,f.jsxs)(F,{size:"xs",color:"palette.gray-600",children:["\uD30C\uC77C\uC744 \uC5EC\uAE30\uC5D0 \uB04C\uC5B4\uB2E4 \uB193\uAC70\uB098, \uD074\uB9AD\uD558\uC5EC \uD30C\uC77C\uC744 \uC120\uD0DD\uD558\uC138\uC694",(0,f.jsx)("br",{}),"(\uCD5C\uB300 3MB)"]}),(0,f.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,f.jsx)("path",{d:"M5 12h14"}),(0,f.jsx)("path",{d:"M12 5v14"})]})]}),o.length>0&&(0,f.jsx)("div",{className:"cocso-file-upload-list",children:o.map(i=>(0,f.jsxs)("div",{className:"cocso-file-upload-item",children:[(0,f.jsx)(B,{size:"xs",children:i.name}),(0,f.jsx)("button",{type:"button",onClick:()=>to(i.name),className:"cocso-file-upload-remove",children:(0,f.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,f.jsx)("path",{d:"M18 6 6 18"}),(0,f.jsx)("path",{d:"m6 6 12 12"})]})})]},i.name))})]})}),Yo=Object.assign(Xo,{displayName:"FileUpload"});var Po=h(require("react"),1),yo=require("@radix-ui/react-slot");var Ro=require("react/jsx-runtime"),oe=Po.forwardRef(({asChild:e=!1,size:o="md",color:t,weight:r="bold",className:n,style:s,...c},m)=>{let l=a("cocso-heading",{size:o},[],n);return(0,Ro.jsx)(e?yo.Slot:"h2",{ref:m,className:l,style:{"--cocso-heading-color":y(t),"--cocso-heading-weight":R(r),...s},...c})}),Y=Object.assign(oe,{displayName:"Heading"});var xo=h(require("react"),1),wo=require("@radix-ui/react-slot");var ko=require("react/jsx-runtime"),ee=xo.forwardRef(({asChild:e=!1,size:o="md",weight:t="normal",indicator:r=!0,className:n,style:s,...c},m)=>{let l=a("cocso-link",{size:o,indicator:r},[],n);return(0,ko.jsx)(e?wo.Slot:"a",{ref:m,className:l,style:{"--cocso-link-weight":R(t),...s},...c})}),te=Object.assign(ee,{displayName:"Link"});var u=h(require("@radix-ui/react-dialog"),1),j=require("react");var b=require("react/jsx-runtime"),re=(0,j.forwardRef)(({className:e,children:o,...t},r)=>{let n=a("cocso-modal-content",{},[],e);return(0,b.jsxs)(u.Portal,{children:[(0,b.jsx)(u.Overlay,{className:"cocso-modal-overlay"}),(0,b.jsxs)(u.Content,{ref:r,className:n,...t,children:[(0,b.jsx)("div",{className:"cocso-modal-close-wrapper",children:(0,b.jsx)(u.Close,{className:"cocso-modal-close",children:(0,b.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,b.jsx)("path",{d:"M18 6 6 18"}),(0,b.jsx)("path",{d:"m6 6 12 12"})]})})}),o]})]})}),ne=(0,j.forwardRef)(({className:e,children:o,...t},r)=>{let n=a("cocso-modal-title",{},[],e);return(0,b.jsx)(u.Title,{ref:r,className:n,asChild:!0,...t,children:(0,b.jsx)(Y,{color:"text.basic",children:o})})}),ie=(0,j.forwardRef)(({className:e,children:o,...t},r)=>{let n=a("cocso-modal-description",{},[],e);return(0,b.jsx)(u.Description,{ref:r,className:n,asChild:!0,...t,children:(0,b.jsx)(B,{size:"sm",color:"text.subtle",children:o})})}),se=Object.assign(u.Root,{Trigger:u.Trigger,Content:re,Title:ne,Description:ie});var $=h(require("@radix-ui/react-one-time-password-field"),1),oo=require("react");var eo=require("react/jsx-runtime"),ae=(0,oo.forwardRef)(({className:e,...o},t)=>{let r=a("cocso-otp",{},[],e);return(0,eo.jsx)($.Root,{ref:t,className:r,...o})}),ce=(0,oo.forwardRef)(({className:e,...o},t)=>{let r=a("cocso-otp-input",{},[],e);return(0,eo.jsx)($.Input,{ref:t,className:r,...o})}),me=Object.assign(ae,{Input:ce});var No=h(require("react"),1),To=require("@radix-ui/react-slot"),v=require("react/jsx-runtime"),le=No.forwardRef(({asChild:e=!1,page:o,totalPages:t,maxVisible:r=5,onChange:n,className:s,...c},m)=>{let p=Math.ceil(r/2),l=C=>(0,v.jsx)("button",{className:"cocso-pagination-item",onClick:()=>n(C),"data-active":o===C,children:C},C);return(0,v.jsxs)(e?To.Slot:"div",{ref:m,className:`cocso-pagination ${s||""}`,...c,children:[t>1&&(0,v.jsx)("button",{className:"cocso-pagination-arrow",disabled:o===1,onClick:()=>o>1&&n(o-1),children:(0,v.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,v.jsx)("path",{d:"m15 18-6-6 6-6"})})}),t<=r+2?Array(t).fill(0).map((C,S)=>l(S+1)):(0,v.jsxs)(v.Fragment,{children:[l(1),o>1+p&&(0,v.jsx)("span",{className:"cocso-pagination-trunc",children:"..."}),Array(r).fill(0).map((C,S)=>{let W=o-p+S+1;return W>1&&W<t?l(W):""}),o<t-p&&(0,v.jsx)("span",{className:"cocso-pagination-trunc",children:"..."}),l(t)]}),t>1&&(0,v.jsx)("button",{className:"cocso-pagination-arrow",disabled:o===t,onClick:()=>o<t&&n(o+1),children:(0,v.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,v.jsx)("path",{d:"m9 18 6-6-6-6"})})})]})}),pe=Object.assign(le,{displayName:"Pagination"});var So=h(require("react"),1),_=h(require("@radix-ui/react-checkbox"),1);var k=require("react/jsx-runtime"),de=So.forwardRef(({id:e,size:o="md",status:t,onChange:r,label:n,disabled:s=!1,className:c,...m},p)=>{let l={size:o,disabled:s,status:t},d=[...s?[{status:t,disabled:s}]:[]],C=a("cocso-checkbox",l,d,c),S=P=>{if(!s){let x;P===!0?x="on":P==="indeterminate"?x="intermediate":x="off",r(x)}};return(0,k.jsxs)("div",{className:"cocso-checkbox-wrapper",children:[(0,k.jsxs)(_.Root,{ref:p,id:e,className:C,checked:(()=>{switch(t){case"on":return!0;case"intermediate":return"indeterminate";case"off":default:return!1}})(),onCheckedChange:S,disabled:s,...m,children:[(0,k.jsx)(_.Indicator,{className:"cocso-checkbox-indicator",style:{opacity:t==="on"?1:0},children:(0,k.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,k.jsx)("path",{d:"M20 6 9 17l-5-5"})})}),(0,k.jsx)("div",{className:"cocso-checkbox-indicator",style:{opacity:t==="intermediate"?1:0},children:(0,k.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:(0,k.jsx)("path",{d:"M5 12h14"})})})]}),n&&(0,k.jsx)(F,{className:a("cocso-checkbox-label",{disabled:s}),size:o,htmlFor:e,children:n})]})}),fe=Object.assign(de,{displayName:"Checkbox"});var Wo=h(require("react"),1),U=h(require("@radix-ui/react-switch"),1);var O=require("react/jsx-runtime"),he=Wo.forwardRef(({id:e,size:o="md",disabled:t=!1,label:r,position:n="right",className:s,children:c,...m},p)=>{let l=a("cocso-switch",{size:o,disabled:t},[],s),d=a("cocso-switch-thumb",{size:o});return(0,O.jsxs)("div",{className:"cocso-switch-wrapper",children:[n==="left"&&(0,O.jsx)(F,{size:o,htmlFor:e,children:r}),(0,O.jsx)(U.Root,{ref:p,className:l,...m,children:(0,O.jsx)(U.Thumb,{className:d})}),n==="right"&&(0,O.jsx)(F,{size:o,htmlFor:e,children:r})]})}),ge=Object.assign(he,{displayName:"Switch"});var V=require("sonner"),ue=Object.assign(V.Toaster,{displayName:"Toast"});
package/lib/index.js CHANGED
@@ -1 +1 @@
1
- import*as R from"@radix-ui/react-accordion";import{forwardRef as G}from"react";var bo=(...e)=>e.filter(Boolean).join(" ").trim(),c=(e,o,t=[],...r)=>{let n=Object.entries(o).filter(([,a])=>a!==!1&&a!==null&&a!==void 0).map(([a,m])=>`${e}--${a}_${m}`).join(" "),s=t.filter(a=>Object.entries(a).every(([m,p])=>o[m]===p)).map(a=>{let m=Object.entries(a).map(([p,l])=>`${p}_${l}`).join("-");return`${e}--${m}`}).join(" ");return bo(e,n,s,...r)};import{Slottable as Po}from"@radix-ui/react-slot";import{jsx as F,jsxs as wo}from"react/jsx-runtime";var yo=G(({className:e,...o},t)=>{let r=c("cocso-accordion-item",{},[],e);return F(R.Item,{ref:t,className:r,...o})}),Ro=G(({className:e,children:o,chevron:t=!0,...r},n)=>{let s=c("cocso-accordion-trigger",{},[],e);return F(R.Trigger,{ref:n,className:s,...r,children:wo(Po,{children:[o,t&&F("div",{className:"cocso-accordion-chevron",children:F("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:F("path",{d:"m6 9 6 6 6-6"})})})]})})}),xo=G(({className:e,...o},t)=>{let r=c("cocso-accordion-content",{},[],e);return F(R.Content,{ref:t,className:r,...o})}),fe=Object.assign(R.Root,{Item:yo,Header:R.Header,Trigger:Ro,Content:xo});import*as Y from"react";import{Slot as ko}from"@radix-ui/react-slot";function u(e){if(e)return e.includes(".")?`var(--color-${e.replace(/\./g,"-")})`:e}var X={thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"};function C(e){if(e)return e in X?X[e]:e}import{jsx as To}from"react/jsx-runtime";var No=Y.forwardRef(({asChild:e=!1,size:o="md",color:t,weight:r="normal",className:n,style:s,...a},m)=>{let l=c("cocso-body",{size:o},[],n);return To(e?ko:"p",{ref:m,className:l,style:{"--cocso-body-color":u(t),"--cocso-body-weight":C(r),...s},...a})}),B=Object.assign(No,{displayName:"Body"});import*as O from"react";import{Slot as Mo}from"@radix-ui/react-slot";import*as oo from"react";import{jsx as K,jsxs as Lo}from"react/jsx-runtime";var So=["div"],Wo=oo.forwardRef(({as:e=So[0],size:o="md",color:t="palette.primary-500",bg:r="palette.gray-200",className:n,style:s,...a},m)=>{let p=e,d=c("cocso-spinner",{size:o},[],n);return K(p,{ref:m,className:d,style:{"--cocso-spinner-bg":u(r),"--cocso-spinner-color":u(t),...s},...a,children:Lo("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[K("circle",{className:"opacity-25",cx:"12",cy:"12",r:"9",stroke:"var(--cocso-spinner-bg, currentColor)",strokeWidth:"3"}),K("path",{className:"opacity-75",fill:"var(--cocso-spinner-color, currentColor)",d:"M12 2a10 10 0 0110 10 10 10 0 01-5 8.66l-1-1.73a8 8 0 004-6.93 8 8 0 00-8-8V2z"})]})})}),eo=Object.assign(Wo,{displayName:"Spinner"});import{jsx as to}from"react/jsx-runtime";var Fo=e=>({"2xs":"xs",xs:"xs",sm:"xs",md:"sm",lg:"md",xl:"md"})[e],Do=O.forwardRef(({asChild:e=!1,variant:o="primary",size:t="md",disabled:r=!1,loading:n=!1,color:s,weight:a="normal",className:m,style:p,children:l,onClick:d,onKeyDown:f,...P},w)=>{let g=r||n,v=O.useCallback(y=>{if(g){y.preventDefault();return}d?.(y)},[g,d]),j=O.useCallback(y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),g||y.currentTarget.click()),f?.(y)},[g,f]),$={variant:o,size:t,loading:n,disabled:g},_=[...r?[{variant:o,disabled:r}]:[],...n?[{variant:o,loading:n}]:[]],U=c("cocso-button",$,_,m),V={"--cocso-button-color":u(s),"--cocso-button-weight":C(a),...p};return to(e?Mo:"button",{ref:w,className:U,onClick:v,onKeyDown:j,role:"button",disabled:g,"aria-disabled":g,"aria-busy":n,style:V,...P,children:n?to(eo,{className:"cocso-button-spinner",size:Fo(t),color:"currentColor"}):l})}),Be=Object.assign(Do,{displayName:"Button"});import*as ro from"react";import{Slot as Oo}from"@radix-ui/react-slot";import{jsx as Bo}from"react/jsx-runtime";var Eo=ro.forwardRef(({asChild:e=!1,size:o="md",color:t,weight:r="bold",className:n,style:s,...a},m)=>{let l=c("cocso-display",{size:o},[],n);return Bo(e?Oo:"h1",{ref:m,className:l,style:{"--cocso-display-color":u(t),"--cocso-display-weight":C(r),...s},...a})}),Ue=Object.assign(Eo,{displayName:"Display"});import*as so from"react";import{useRef as io,useState as zo,useCallback as x}from"react";import*as no from"react";import{Slot as Ao}from"@radix-ui/react-slot";import{jsx as Io}from"react/jsx-runtime";var Ho=no.forwardRef(({asChild:e=!1,size:o="md",color:t="text.basic",weight:r="normal",className:n,style:s,...a},m)=>{let l=c("cocso-label",{size:o},[],n);return Io(e?Ao:"label",{ref:m,className:l,style:{"--cocso-label-color":u(t),"--cocso-label-weight":C(r),...s},...a})}),L=Object.assign(Ho,{displayName:"Label"});import{jsx as N,jsxs as D}from"react/jsx-runtime";var jo=so.forwardRef(({maxFiles:e=2,files:o,onFilesChange:t,onRemove:r,multiple:n=!0,accept:s,...a},m)=>{let[p,l]=zo(!1),d=io(null),f=io(null),P=3*1024*1024,w=x(i=>s?s.split(",").map(b=>b.trim()).some(b=>{if(b.endsWith("/*")){let E=b.slice(0,-2);return i.type.startsWith(E)}return i.type===b||i.name.toLowerCase().endsWith(b)}):!0,[s]),g=x(i=>i.size>P?(alert(`${i.name}\uC740(\uB294) 3MB\uB97C \uCD08\uACFC\uD569\uB2C8\uB2E4.`),!1):!0,[]),v=x(i=>{let b=Array.from(i).filter(W=>w(W)?g(W):(alert(`${W.name}\uC740(\uB294) \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uB294 \uD30C\uC77C \uD0C0\uC785\uC785\uB2C8\uB2E4.`),!1));if(b.length===0)return;let E=e-o.length;if(E<=0){alert(`\uCD5C\uB300 ${e}\uAC1C\uC758 \uD30C\uC77C\uB9CC \uC5C5\uB85C\uB4DC\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.`);return}let vo=b.slice(0,E).map(W=>({file:W,name:W.name,size:W.size}));t([...o,...vo])},[o,e,t,w,g]),j=x(i=>{i.preventDefault(),i.stopPropagation(),l(!0)},[]),$=x(i=>{i.preventDefault(),i.stopPropagation(),f.current&&!f.current.contains(i.relatedTarget)&&l(!1)},[]),_=x(i=>{i.preventDefault(),i.stopPropagation()},[]),U=x(i=>{i.preventDefault(),i.stopPropagation(),l(!1);let{files:k}=i.dataTransfer;k&&v(k)},[v]),V=x(i=>{let{files:k}=i.target;k&&v(k)},[v]),J=x(i=>{let k=o.filter(b=>b.name!==i);t(k),r?.(i)},[o,t,r]),y=x(()=>{d.current?.click()},[]),Q=o.length>=e||!n&&o.length>=1;return D("div",{className:"cocso-file-upload-wrapper",children:[!Q&&D("div",{ref:f,onDragEnter:j,onDragOver:_,onDragLeave:$,onDrop:U,onClick:y,className:"cocso-file-upload","data-drag-active":p,children:[N("input",{ref:i=>{d.current=i,typeof m=="function"?m(i):m&&(m.current=i)},type:"file",onChange:V,multiple:n,accept:s,style:{display:"none"},...a}),D(L,{size:"xs",color:"palette.gray-600",children:["\uD30C\uC77C\uC744 \uC5EC\uAE30\uC5D0 \uB04C\uC5B4\uB2E4 \uB193\uAC70\uB098, \uD074\uB9AD\uD558\uC5EC \uD30C\uC77C\uC744 \uC120\uD0DD\uD558\uC138\uC694",N("br",{}),"(\uCD5C\uB300 3MB)"]}),D("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[N("path",{d:"M5 12h14"}),N("path",{d:"M12 5v14"})]})]}),o.length>0&&N("div",{className:"cocso-file-upload-list",children:o.map(i=>D("div",{className:"cocso-file-upload-item",children:[N(B,{size:"xs",children:i.name}),N("button",{type:"button",onClick:()=>J(i.name),className:"cocso-file-upload-remove",children:D("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[N("path",{d:"M18 6 6 18"}),N("path",{d:"m6 6 12 12"})]})})]},i.name))})]})}),it=Object.assign(jo,{displayName:"FileUpload"});import*as ao from"react";import{Slot as $o}from"@radix-ui/react-slot";import{jsx as Uo}from"react/jsx-runtime";var _o=ao.forwardRef(({asChild:e=!1,size:o="md",color:t,weight:r="bold",className:n,style:s,...a},m)=>{let l=c("cocso-heading",{size:o},[],n);return Uo(e?$o:"h2",{ref:m,className:l,style:{"--cocso-heading-color":u(t),"--cocso-heading-weight":C(r),...s},...a})}),co=Object.assign(_o,{displayName:"Heading"});import*as mo from"react";import{Slot as Vo}from"@radix-ui/react-slot";import{jsx as Ko}from"react/jsx-runtime";var Go=mo.forwardRef(({asChild:e=!1,size:o="md",weight:t="normal",indicator:r=!0,className:n,style:s,...a},m)=>{let l=c("cocso-link",{size:o,indicator:r},[],n);return Ko(e?Vo:"a",{ref:m,className:l,style:{"--cocso-link-weight":C(t),...s},...a})}),Pt=Object.assign(Go,{displayName:"Link"});import*as h from"@radix-ui/react-dialog";import{forwardRef as q}from"react";import{jsx as T,jsxs as Z}from"react/jsx-runtime";var Zo=q(({className:e,children:o,...t},r)=>{let n=c("cocso-modal-content",{},[],e);return Z(h.Portal,{children:[T(h.Overlay,{className:"cocso-modal-overlay"}),Z(h.Content,{ref:r,className:n,...t,children:[T("div",{className:"cocso-modal-close-wrapper",children:T(h.Close,{className:"cocso-modal-close",children:Z("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[T("path",{d:"M18 6 6 18"}),T("path",{d:"m6 6 12 12"})]})})}),o]})]})}),qo=q(({className:e,children:o,...t},r)=>{let n=c("cocso-modal-title",{},[],e);return T(h.Title,{ref:r,className:n,asChild:!0,...t,children:T(co,{color:"text.basic",children:o})})}),Jo=q(({className:e,children:o,...t},r)=>{let n=c("cocso-modal-description",{},[],e);return T(h.Description,{ref:r,className:n,asChild:!0,...t,children:T(B,{size:"sm",color:"text.subtle",children:o})})}),Mt=Object.assign(h.Root,{Trigger:h.Trigger,Content:Zo,Title:qo,Description:Jo});import*as A from"@radix-ui/react-one-time-password-field";import{forwardRef as lo}from"react";import{jsx as po}from"react/jsx-runtime";var Qo=lo(({className:e,...o},t)=>{let r=c("cocso-otp",{},[],e);return po(A.Root,{ref:t,className:r,...o})}),Xo=lo(({className:e,...o},t)=>{let r=c("cocso-otp-input",{},[],e);return po(A.Input,{ref:t,className:r,...o})}),zt=Object.assign(Qo,{Input:Xo});import*as ho from"react";import{Slot as Yo}from"@radix-ui/react-slot";import{Fragment as ee,jsx as S,jsxs as fo}from"react/jsx-runtime";var oe=ho.forwardRef(({asChild:e=!1,page:o,totalPages:t,maxVisible:r=5,onChange:n,className:s,...a},m)=>{let p=Math.ceil(r/2),l=f=>S("button",{className:"cocso-pagination-item",onClick:()=>n(f),"data-active":o===f,children:f},f);return fo(e?Yo:"div",{ref:m,className:`cocso-pagination ${s||""}`,...a,children:[t>1&&S("button",{className:"cocso-pagination-arrow",disabled:o===1,onClick:()=>o>1&&n(o-1),children:S("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:S("path",{d:"m15 18-6-6 6-6"})})}),t<=r+2?Array(t).fill(0).map((f,P)=>l(P+1)):fo(ee,{children:[l(1),o>1+p&&S("span",{className:"cocso-pagination-trunc",children:"..."}),Array(r).fill(0).map((f,P)=>{let w=o-p+P+1;return w>1&&w<t?l(w):""}),o<t-p&&S("span",{className:"cocso-pagination-trunc",children:"..."}),l(t)]}),t>1&&S("button",{className:"cocso-pagination-arrow",disabled:o===t,onClick:()=>o<t&&n(o+1),children:S("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:S("path",{d:"m9 18 6-6-6-6"})})})]})}),Gt=Object.assign(oe,{displayName:"Pagination"});import*as uo from"react";import*as H from"@radix-ui/react-checkbox";import{jsx as M,jsxs as go}from"react/jsx-runtime";var te=uo.forwardRef(({id:e,size:o="md",status:t,onChange:r,label:n,disabled:s=!1,className:a,...m},p)=>{let l={size:o,disabled:s,status:t},d=[...s?[{status:t,disabled:s}]:[]],f=c("cocso-checkbox",l,d,a),P=g=>{if(!s){let v;g===!0?v="on":g==="indeterminate"?v="intermediate":v="off",r(v)}};return go("div",{className:"cocso-checkbox-wrapper",children:[go(H.Root,{ref:p,id:e,className:f,checked:(()=>{switch(t){case"on":return!0;case"intermediate":return"indeterminate";case"off":default:return!1}})(),onCheckedChange:P,disabled:s,...m,children:[M(H.Indicator,{className:"cocso-checkbox-indicator",style:{opacity:t==="on"?1:0},children:M("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:M("path",{d:"M20 6 9 17l-5-5"})})}),M("div",{className:"cocso-checkbox-indicator",style:{opacity:t==="intermediate"?1:0},children:M("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:M("path",{d:"M5 12h14"})})})]}),n&&M(L,{className:c("cocso-checkbox-label",{disabled:s}),size:o,htmlFor:e,children:n})]})}),Yt=Object.assign(te,{displayName:"Checkbox"});import*as Co from"react";import{Slot as re}from"@radix-ui/react-slot";import*as z from"@radix-ui/react-switch";import{jsx as I,jsxs as ie}from"react/jsx-runtime";var ne=Co.forwardRef(({asChild:e=!1,id:o,size:t="md",disabled:r=!1,label:n,position:s="right",className:a,children:m,...p},l)=>{let d=c("cocso-switch",{size:t,disabled:r},[],a),f=c("cocso-switch-thumb",{size:t});return ie(e?re:"div",{className:"cocso-switch-wrapper",children:[s==="left"&&I(L,{size:t,htmlFor:o,children:n}),I(z.Root,{ref:l,className:d,...p,children:I(z.Thumb,{className:f})}),s==="right"&&I(L,{size:t,htmlFor:o,children:n})]})}),ar=Object.assign(ne,{displayName:"Switch"});import{Toaster as se,toast as fr}from"sonner";var hr=Object.assign(se,{displayName:"Toast"});export{fe as Accordion,B as Body,Be as Button,Yt as Checkbox,Ue as Display,it as FileUpload,co as Heading,L as Label,Pt as Link,Mt as Modal,zt as OneTimePasswordField,Gt as Pagination,eo as Spinner,ar as Switch,hr as Toaster,fr as toast};
1
+ import*as y from"@radix-ui/react-accordion";import{forwardRef as G}from"react";var bo=(...e)=>e.filter(Boolean).join(" ").trim(),a=(e,o,t=[],...r)=>{let n=Object.entries(o).filter(([,c])=>c!==!1&&c!==null&&c!==void 0).map(([c,m])=>`${e}--${c}_${m}`).join(" "),s=t.filter(c=>Object.entries(c).every(([m,p])=>o[m]===p)).map(c=>{let m=Object.entries(c).map(([p,l])=>`${p}_${l}`).join("-");return`${e}--${m}`}).join(" ");return bo(e,n,s,...r)};import{Slottable as Po}from"@radix-ui/react-slot";import{jsx as F,jsxs as wo}from"react/jsx-runtime";var yo=G(({className:e,...o},t)=>{let r=a("cocso-accordion-item",{},[],e);return F(y.Item,{ref:t,className:r,...o})}),Ro=G(({className:e,children:o,chevron:t=!0,...r},n)=>{let s=a("cocso-accordion-trigger",{},[],e);return F(y.Trigger,{ref:n,className:s,...r,children:wo(Po,{children:[o,t&&F("div",{className:"cocso-accordion-chevron",children:F("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:F("path",{d:"m6 9 6 6 6-6"})})})]})})}),xo=G(({className:e,...o},t)=>{let r=a("cocso-accordion-content",{},[],e);return F(y.Content,{ref:t,className:r,...o})}),de=Object.assign(y.Root,{Item:yo,Header:y.Header,Trigger:Ro,Content:xo});import*as Y from"react";import{Slot as ko}from"@radix-ui/react-slot";function u(e){if(e)return e.includes(".")?`var(--color-${e.replace(/\./g,"-")})`:e}var X={thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"};function C(e){if(e)return e in X?X[e]:e}import{jsx as To}from"react/jsx-runtime";var No=Y.forwardRef(({asChild:e=!1,size:o="md",color:t,weight:r="normal",className:n,style:s,...c},m)=>{let l=a("cocso-body",{size:o},[],n);return To(e?ko:"p",{ref:m,className:l,style:{"--cocso-body-color":u(t),"--cocso-body-weight":C(r),...s},...c})}),B=Object.assign(No,{displayName:"Body"});import*as O from"react";import{Slot as Mo}from"@radix-ui/react-slot";import*as oo from"react";import{jsx as K,jsxs as Lo}from"react/jsx-runtime";var So=["div"],Wo=oo.forwardRef(({as:e=So[0],size:o="md",color:t="palette.primary-500",bg:r="palette.gray-200",className:n,style:s,...c},m)=>{let p=e,d=a("cocso-spinner",{size:o},[],n);return K(p,{ref:m,className:d,style:{"--cocso-spinner-bg":u(r),"--cocso-spinner-color":u(t),...s},...c,children:Lo("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[K("circle",{className:"opacity-25",cx:"12",cy:"12",r:"9",stroke:"var(--cocso-spinner-bg, currentColor)",strokeWidth:"3"}),K("path",{className:"opacity-75",fill:"var(--cocso-spinner-color, currentColor)",d:"M12 2a10 10 0 0110 10 10 10 0 01-5 8.66l-1-1.73a8 8 0 004-6.93 8 8 0 00-8-8V2z"})]})})}),eo=Object.assign(Wo,{displayName:"Spinner"});import{jsx as to}from"react/jsx-runtime";var Fo=e=>({"2xs":"xs",xs:"xs",sm:"xs",md:"sm",lg:"md",xl:"md"})[e],Do=O.forwardRef(({asChild:e=!1,variant:o="primary",size:t="md",disabled:r=!1,loading:n=!1,color:s,weight:c="normal",className:m,style:p,children:l,onClick:d,onKeyDown:h,...x},w)=>{let g=r||n,v=O.useCallback(P=>{if(g){P.preventDefault();return}d?.(P)},[g,d]),j=O.useCallback(P=>{(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),g||P.currentTarget.click()),h?.(P)},[g,h]),$={variant:o,size:t,loading:n,disabled:g},_=[...r?[{variant:o,disabled:r}]:[],...n?[{variant:o,loading:n}]:[]],U=a("cocso-button",$,_,m),V={"--cocso-button-color":u(s),"--cocso-button-weight":C(c),...p};return to(e?Mo:"button",{ref:w,className:U,onClick:v,onKeyDown:j,role:"button",disabled:g,"aria-disabled":g,"aria-busy":n,style:V,...x,children:n?to(eo,{className:"cocso-button-spinner",size:Fo(t),color:"currentColor"}):l})}),Ee=Object.assign(Do,{displayName:"Button"});import*as ro from"react";import{Slot as Oo}from"@radix-ui/react-slot";import{jsx as Bo}from"react/jsx-runtime";var Eo=ro.forwardRef(({asChild:e=!1,size:o="md",color:t,weight:r="bold",className:n,style:s,...c},m)=>{let l=a("cocso-display",{size:o},[],n);return Bo(e?Oo:"h1",{ref:m,className:l,style:{"--cocso-display-color":u(t),"--cocso-display-weight":C(r),...s},...c})}),_e=Object.assign(Eo,{displayName:"Display"});import*as so from"react";import{useRef as io,useState as zo,useCallback as R}from"react";import*as no from"react";import{Slot as Ao}from"@radix-ui/react-slot";import{jsx as Io}from"react/jsx-runtime";var Ho=no.forwardRef(({asChild:e=!1,size:o="md",color:t="text.basic",weight:r="normal",className:n,style:s,...c},m)=>{let l=a("cocso-label",{size:o},[],n);return Io(e?Ao:"label",{ref:m,className:l,style:{"--cocso-label-color":u(t),"--cocso-label-weight":C(r),...s},...c})}),L=Object.assign(Ho,{displayName:"Label"});import{jsx as N,jsxs as D}from"react/jsx-runtime";var jo=so.forwardRef(({maxFiles:e=2,files:o,onFilesChange:t,onRemove:r,multiple:n=!0,accept:s,...c},m)=>{let[p,l]=zo(!1),d=io(null),h=io(null),x=3*1024*1024,w=R(i=>s?s.split(",").map(b=>b.trim()).some(b=>{if(b.endsWith("/*")){let E=b.slice(0,-2);return i.type.startsWith(E)}return i.type===b||i.name.toLowerCase().endsWith(b)}):!0,[s]),g=R(i=>i.size>x?(alert(`${i.name}\uC740(\uB294) 3MB\uB97C \uCD08\uACFC\uD569\uB2C8\uB2E4.`),!1):!0,[]),v=R(i=>{let b=Array.from(i).filter(W=>w(W)?g(W):(alert(`${W.name}\uC740(\uB294) \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uB294 \uD30C\uC77C \uD0C0\uC785\uC785\uB2C8\uB2E4.`),!1));if(b.length===0)return;let E=e-o.length;if(E<=0){alert(`\uCD5C\uB300 ${e}\uAC1C\uC758 \uD30C\uC77C\uB9CC \uC5C5\uB85C\uB4DC\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.`);return}let vo=b.slice(0,E).map(W=>({file:W,name:W.name,size:W.size}));t([...o,...vo])},[o,e,t,w,g]),j=R(i=>{i.preventDefault(),i.stopPropagation(),l(!0)},[]),$=R(i=>{i.preventDefault(),i.stopPropagation(),h.current&&!h.current.contains(i.relatedTarget)&&l(!1)},[]),_=R(i=>{i.preventDefault(),i.stopPropagation()},[]),U=R(i=>{i.preventDefault(),i.stopPropagation(),l(!1);let{files:k}=i.dataTransfer;k&&v(k)},[v]),V=R(i=>{let{files:k}=i.target;k&&v(k)},[v]),J=R(i=>{let k=o.filter(b=>b.name!==i);t(k),r?.(i)},[o,t,r]),P=R(()=>{d.current?.click()},[]),Q=o.length>=e||!n&&o.length>=1;return D("div",{className:"cocso-file-upload-wrapper",children:[!Q&&D("div",{ref:h,onDragEnter:j,onDragOver:_,onDragLeave:$,onDrop:U,onClick:P,className:"cocso-file-upload","data-drag-active":p,children:[N("input",{ref:i=>{d.current=i,typeof m=="function"?m(i):m&&(m.current=i)},type:"file",onChange:V,multiple:n,accept:s,style:{display:"none"},...c}),D(L,{size:"xs",color:"palette.gray-600",children:["\uD30C\uC77C\uC744 \uC5EC\uAE30\uC5D0 \uB04C\uC5B4\uB2E4 \uB193\uAC70\uB098, \uD074\uB9AD\uD558\uC5EC \uD30C\uC77C\uC744 \uC120\uD0DD\uD558\uC138\uC694",N("br",{}),"(\uCD5C\uB300 3MB)"]}),D("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[N("path",{d:"M5 12h14"}),N("path",{d:"M12 5v14"})]})]}),o.length>0&&N("div",{className:"cocso-file-upload-list",children:o.map(i=>D("div",{className:"cocso-file-upload-item",children:[N(B,{size:"xs",children:i.name}),N("button",{type:"button",onClick:()=>J(i.name),className:"cocso-file-upload-remove",children:D("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[N("path",{d:"M18 6 6 18"}),N("path",{d:"m6 6 12 12"})]})})]},i.name))})]})}),nt=Object.assign(jo,{displayName:"FileUpload"});import*as ao from"react";import{Slot as $o}from"@radix-ui/react-slot";import{jsx as Uo}from"react/jsx-runtime";var _o=ao.forwardRef(({asChild:e=!1,size:o="md",color:t,weight:r="bold",className:n,style:s,...c},m)=>{let l=a("cocso-heading",{size:o},[],n);return Uo(e?$o:"h2",{ref:m,className:l,style:{"--cocso-heading-color":u(t),"--cocso-heading-weight":C(r),...s},...c})}),co=Object.assign(_o,{displayName:"Heading"});import*as mo from"react";import{Slot as Vo}from"@radix-ui/react-slot";import{jsx as Ko}from"react/jsx-runtime";var Go=mo.forwardRef(({asChild:e=!1,size:o="md",weight:t="normal",indicator:r=!0,className:n,style:s,...c},m)=>{let l=a("cocso-link",{size:o,indicator:r},[],n);return Ko(e?Vo:"a",{ref:m,className:l,style:{"--cocso-link-weight":C(t),...s},...c})}),bt=Object.assign(Go,{displayName:"Link"});import*as f from"@radix-ui/react-dialog";import{forwardRef as q}from"react";import{jsx as T,jsxs as Z}from"react/jsx-runtime";var Zo=q(({className:e,children:o,...t},r)=>{let n=a("cocso-modal-content",{},[],e);return Z(f.Portal,{children:[T(f.Overlay,{className:"cocso-modal-overlay"}),Z(f.Content,{ref:r,className:n,...t,children:[T("div",{className:"cocso-modal-close-wrapper",children:T(f.Close,{className:"cocso-modal-close",children:Z("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[T("path",{d:"M18 6 6 18"}),T("path",{d:"m6 6 12 12"})]})})}),o]})]})}),qo=q(({className:e,children:o,...t},r)=>{let n=a("cocso-modal-title",{},[],e);return T(f.Title,{ref:r,className:n,asChild:!0,...t,children:T(co,{color:"text.basic",children:o})})}),Jo=q(({className:e,children:o,...t},r)=>{let n=a("cocso-modal-description",{},[],e);return T(f.Description,{ref:r,className:n,asChild:!0,...t,children:T(B,{size:"sm",color:"text.subtle",children:o})})}),Lt=Object.assign(f.Root,{Trigger:f.Trigger,Content:Zo,Title:qo,Description:Jo});import*as A from"@radix-ui/react-one-time-password-field";import{forwardRef as lo}from"react";import{jsx as po}from"react/jsx-runtime";var Qo=lo(({className:e,...o},t)=>{let r=a("cocso-otp",{},[],e);return po(A.Root,{ref:t,className:r,...o})}),Xo=lo(({className:e,...o},t)=>{let r=a("cocso-otp-input",{},[],e);return po(A.Input,{ref:t,className:r,...o})}),It=Object.assign(Qo,{Input:Xo});import*as ho from"react";import{Slot as Yo}from"@radix-ui/react-slot";import{Fragment as ee,jsx as S,jsxs as fo}from"react/jsx-runtime";var oe=ho.forwardRef(({asChild:e=!1,page:o,totalPages:t,maxVisible:r=5,onChange:n,className:s,...c},m)=>{let p=Math.ceil(r/2),l=h=>S("button",{className:"cocso-pagination-item",onClick:()=>n(h),"data-active":o===h,children:h},h);return fo(e?Yo:"div",{ref:m,className:`cocso-pagination ${s||""}`,...c,children:[t>1&&S("button",{className:"cocso-pagination-arrow",disabled:o===1,onClick:()=>o>1&&n(o-1),children:S("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:S("path",{d:"m15 18-6-6 6-6"})})}),t<=r+2?Array(t).fill(0).map((h,x)=>l(x+1)):fo(ee,{children:[l(1),o>1+p&&S("span",{className:"cocso-pagination-trunc",children:"..."}),Array(r).fill(0).map((h,x)=>{let w=o-p+x+1;return w>1&&w<t?l(w):""}),o<t-p&&S("span",{className:"cocso-pagination-trunc",children:"..."}),l(t)]}),t>1&&S("button",{className:"cocso-pagination-arrow",disabled:o===t,onClick:()=>o<t&&n(o+1),children:S("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:S("path",{d:"m9 18 6-6-6-6"})})})]})}),Vt=Object.assign(oe,{displayName:"Pagination"});import*as uo from"react";import*as H from"@radix-ui/react-checkbox";import{jsx as M,jsxs as go}from"react/jsx-runtime";var te=uo.forwardRef(({id:e,size:o="md",status:t,onChange:r,label:n,disabled:s=!1,className:c,...m},p)=>{let l={size:o,disabled:s,status:t},d=[...s?[{status:t,disabled:s}]:[]],h=a("cocso-checkbox",l,d,c),x=g=>{if(!s){let v;g===!0?v="on":g==="indeterminate"?v="intermediate":v="off",r(v)}};return go("div",{className:"cocso-checkbox-wrapper",children:[go(H.Root,{ref:p,id:e,className:h,checked:(()=>{switch(t){case"on":return!0;case"intermediate":return"indeterminate";case"off":default:return!1}})(),onCheckedChange:x,disabled:s,...m,children:[M(H.Indicator,{className:"cocso-checkbox-indicator",style:{opacity:t==="on"?1:0},children:M("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:M("path",{d:"M20 6 9 17l-5-5"})})}),M("div",{className:"cocso-checkbox-indicator",style:{opacity:t==="intermediate"?1:0},children:M("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:M("path",{d:"M5 12h14"})})})]}),n&&M(L,{className:a("cocso-checkbox-label",{disabled:s}),size:o,htmlFor:e,children:n})]})}),Xt=Object.assign(te,{displayName:"Checkbox"});import*as Co from"react";import*as z from"@radix-ui/react-switch";import{jsx as I,jsxs as ne}from"react/jsx-runtime";var re=Co.forwardRef(({id:e,size:o="md",disabled:t=!1,label:r,position:n="right",className:s,children:c,...m},p)=>{let l=a("cocso-switch",{size:o,disabled:t},[],s),d=a("cocso-switch-thumb",{size:o});return ne("div",{className:"cocso-switch-wrapper",children:[n==="left"&&I(L,{size:o,htmlFor:e,children:r}),I(z.Root,{ref:p,className:l,...m,children:I(z.Thumb,{className:d})}),n==="right"&&I(L,{size:o,htmlFor:e,children:r})]})}),ir=Object.assign(re,{displayName:"Switch"});import{Toaster as ie,toast as pr}from"sonner";var dr=Object.assign(ie,{displayName:"Toast"});export{de as Accordion,B as Body,Ee as Button,Xt as Checkbox,_e as Display,nt as FileUpload,co as Heading,L as Label,bt as Link,Lt as Modal,It as OneTimePasswordField,Vt as Pagination,eo as Spinner,ir as Switch,dr as Toaster,pr as toast};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocso-ui/react",
3
- "version": "0.0.1-beta.41",
3
+ "version": "0.0.1-beta.42",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/cocso/cocso-ui.git",