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

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,13 +1,11 @@
1
1
  import * as React from 'react';
2
2
  export type PaginationProps = {
3
- asChild?: boolean;
4
3
  page: number;
5
4
  totalPages: number;
6
5
  maxVisible?: number;
7
6
  onChange: (pageNumber: number) => void;
8
7
  } & Omit<React.ComponentPropsWithoutRef<'div'>, 'onChange'>;
9
8
  export declare const Pagination: React.ForwardRefExoticComponent<{
10
- asChild?: boolean;
11
9
  page: number;
12
10
  totalPages: number;
13
11
  maxVisible?: number;
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ export type QuantityStatus = '보통' | '여유' | '부족';
3
+ export type QuantityStatusProps = {
4
+ quantity: QuantityStatus;
5
+ } & React.ComponentPropsWithoutRef<'div'>;
6
+ export declare const StockQuantityStatus: React.ForwardRefExoticComponent<{
7
+ quantity: QuantityStatus;
8
+ } & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>> & {
9
+ displayName: string;
10
+ };
@@ -0,0 +1 @@
1
+ export * from './StockQuantityStatus';
@@ -0,0 +1,6 @@
1
+ import * as TabPrimitive from '@radix-ui/react-tabs';
2
+ export declare const Tab: import("react").ForwardRefExoticComponent<Omit<TabPrimitive.TabsProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<never>> & {
3
+ List: import("react").ForwardRefExoticComponent<Omit<TabPrimitive.TabsListProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<never>>;
4
+ Trigger: import("react").ForwardRefExoticComponent<Omit<TabPrimitive.TabsTriggerProps & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<never>>;
5
+ Content: import("react").ForwardRefExoticComponent<Omit<TabPrimitive.TabsContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<never>>;
6
+ };
@@ -0,0 +1 @@
1
+ export * from './Tab';
package/lib/index.cjs CHANGED
@@ -1 +1 @@
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"});
1
+ "use strict";var Oo=Object.create;var Z=Object.defineProperty;var Bo=Object.getOwnPropertyDescriptor;var Eo=Object.getOwnPropertyNames;var Ao=Object.getPrototypeOf,Io=Object.prototype.hasOwnProperty;var zo=(o,e)=>{for(var t in e)Z(o,t,{get:e[t],enumerable:!0})},co=(o,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Eo(e))!Io.call(o,i)&&i!==t&&Z(o,i,{get:()=>e[i],enumerable:!(r=Bo(e,i))||r.enumerable});return o};var f=(o,e,t)=>(t=o!=null?Oo(Ao(o)):{},co(e||!o||!o.__esModule?Z(t,"default",{value:o,enumerable:!0}):t,o)),Vo=o=>co(Z({},"__esModule",{value:!0}),o);var Le={};zo(Le,{Accordion:()=>Qo,Body:()=>A,Button:()=>Xo,Checkbox:()=>Ce,Display:()=>oe,FileUpload:()=>re,Heading:()=>ro,Label:()=>M,Link:()=>se,Modal:()=>le,OneTimePasswordField:()=>fe,Pagination:()=>ge,Spinner:()=>eo,StockQuantityStatus:()=>be,Switch:()=>ye,Tab:()=>Ne,Toaster:()=>Te,toast:()=>K.toast});module.exports=Vo(Le);var L=f(require("@radix-ui/react-accordion"),1),$=require("react");var jo=(...o)=>o.filter(Boolean).join(" ").trim(),n=(o,e,t=[],...r)=>{let i=Object.entries(e).filter(([,m])=>m!==!1&&m!==null&&m!==void 0).map(([m,c])=>`${o}--${m}_${c}`).join(" "),s=t.filter(m=>Object.entries(m).every(([c,p])=>e[c]===p)).map(m=>{let c=Object.entries(m).map(([p,l])=>`${p}_${l}`).join("-");return`${o}--${c}`}).join(" ");return jo(o,i,s,...r)};var mo=require("@radix-ui/react-slot"),D=require("react/jsx-runtime"),Zo=(0,$.forwardRef)(({className:o,...e},t)=>{let r=n("cocso-accordion-item",{},[],o);return(0,D.jsx)(L.Item,{ref:t,className:r,...e})}),$o=(0,$.forwardRef)(({className:o,children:e,chevron:t=!0,...r},i)=>{let s=n("cocso-accordion-trigger",{},[],o);return(0,D.jsx)(L.Trigger,{ref:i,className:s,...r,children:(0,D.jsxs)(mo.Slottable,{children:[e,t&&(0,D.jsx)("div",{className:"cocso-accordion-chevron",children:(0,D.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,D.jsx)("path",{d:"m6 9 6 6 6-6"})})})]})})}),_o=(0,$.forwardRef)(({className:o,...e},t)=>{let r=n("cocso-accordion-content",{},[],o);return(0,D.jsx)(L.Content,{ref:t,className:r,...e})}),Qo=Object.assign(L.Root,{Item:Zo,Header:L.Header,Trigger:$o,Content:_o});var po=f(require("react"),1),fo=require("@radix-ui/react-slot");function y(o){if(o)return o.includes(".")?`var(--color-${o.replace(/\./g,"-")})`:o}var lo={thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"};function w(o){if(o)return o in lo?lo[o]:o}var ho=require("react/jsx-runtime"),Uo=po.forwardRef(({asChild:o=!1,size:e="md",color:t,weight:r="normal",className:i,style:s,...m},c)=>{let l=n("cocso-body",{size:e},[],i);return(0,ho.jsx)(o?fo.Slot:"p",{ref:c,className:l,style:{"--cocso-body-color":y(t),"--cocso-body-weight":w(r),...s},...m})}),A=Object.assign(Uo,{displayName:"Body"});var I=f(require("react"),1),uo=require("@radix-ui/react-slot");var go=f(require("react"),1);var B=require("react/jsx-runtime"),Go=["div"],Ko=go.forwardRef(({as:o=Go[0],size:e="md",color:t="palette.primary-500",bg:r="palette.gray-200",className:i,style:s,...m},c)=>{let p=o,d=n("cocso-spinner",{size:e},[],i);return(0,B.jsx)(p,{ref:c,className:d,style:{"--cocso-spinner-bg":y(r),"--cocso-spinner-color":y(t),...s},...m,children:(0,B.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,B.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"9",stroke:"var(--cocso-spinner-bg, currentColor)",strokeWidth:"3"}),(0,B.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"})]})})}),eo=Object.assign(Ko,{displayName:"Spinner"});var to=require("react/jsx-runtime"),qo=o=>({"2xs":"xs",xs:"xs",sm:"xs",md:"sm",lg:"md",xl:"md"})[o],Jo=I.forwardRef(({asChild:o=!1,variant:e="primary",size:t="md",disabled:r=!1,loading:i=!1,color:s,weight:m="normal",className:c,style:p,children:l,onClick:d,onKeyDown:R,...S},E)=>{let P=r||i,x=I.useCallback(T=>{if(P){T.preventDefault();return}d?.(T)},[P,d]),q=I.useCallback(T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),P||T.currentTarget.click()),R?.(T)},[P,R]),J={variant:e,size:t,loading:i,disabled:P},X=[...r?[{variant:e,disabled:r}]:[],...i?[{variant:e,loading:i}]:[]],Y=n("cocso-button",J,X,c),oo={"--cocso-button-color":y(s),"--cocso-button-weight":w(m),...p};return(0,to.jsx)(o?uo.Slot:"button",{ref:E,className:Y,onClick:x,onKeyDown:q,role:"button",disabled:P,"aria-disabled":P,"aria-busy":i,style:oo,...S,children:i?(0,to.jsx)(eo,{className:"cocso-button-spinner",size:qo(t),color:"currentColor"}):l})}),Xo=Object.assign(Jo,{displayName:"Button"});var Co=f(require("react"),1),vo=require("@radix-ui/react-slot");var bo=require("react/jsx-runtime"),Yo=Co.forwardRef(({asChild:o=!1,size:e="md",color:t,weight:r="bold",className:i,style:s,...m},c)=>{let l=n("cocso-display",{size:e},[],i);return(0,bo.jsx)(o?vo.Slot:"h1",{ref:c,className:l,style:{"--cocso-display-color":y(t),"--cocso-display-weight":w(r),...s},...m})}),oe=Object.assign(Yo,{displayName:"Display"});var wo=f(require("react"),1),u=require("react");var Po=f(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="text.basic",weight:r="normal",className:i,style:s,...m},c)=>{let l=n("cocso-label",{size:e},[],i);return(0,Ro.jsx)(o?yo.Slot:"label",{ref:c,className:l,style:{"--cocso-label-color":y(t),"--cocso-label-weight":w(r),...s},...m})}),M=Object.assign(ee,{displayName:"Label"});var h=require("react/jsx-runtime"),te=wo.forwardRef(({maxFiles:o=2,files:e,onFilesChange:t,onRemove:r,multiple:i=!0,accept:s,...m},c)=>{let[p,l]=(0,u.useState)(!1),d=(0,u.useRef)(null),R=(0,u.useRef)(null),S=3*1024*1024,E=(0,u.useCallback)(a=>s?s.split(",").map(k=>k.trim()).some(k=>{if(k.endsWith("/*")){let j=k.slice(0,-2);return a.type.startsWith(j)}return a.type===k||a.name.toLowerCase().endsWith(k)}):!0,[s]),P=(0,u.useCallback)(a=>a.size>S?(alert(`${a.name}\uC740(\uB294) 3MB\uB97C \uCD08\uACFC\uD569\uB2C8\uB2E4.`),!1):!0,[]),x=(0,u.useCallback)(a=>{let k=Array.from(a).filter(H=>E(H)?P(H):(alert(`${H.name}\uC740(\uB294) \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uB294 \uD30C\uC77C \uD0C0\uC785\uC785\uB2C8\uB2E4.`),!1));if(k.length===0)return;let j=o-e.length;if(j<=0){alert(`\uCD5C\uB300 ${o}\uAC1C\uC758 \uD30C\uC77C\uB9CC \uC5C5\uB85C\uB4DC\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.`);return}let Ho=k.slice(0,j).map(H=>({file:H,name:H.name,size:H.size}));t([...e,...Ho])},[e,o,t,E,P]),q=(0,u.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),l(!0)},[]),J=(0,u.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),R.current&&!R.current.contains(a.relatedTarget)&&l(!1)},[]),X=(0,u.useCallback)(a=>{a.preventDefault(),a.stopPropagation()},[]),Y=(0,u.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),l(!1);let{files:W}=a.dataTransfer;W&&x(W)},[x]),oo=(0,u.useCallback)(a=>{let{files:W}=a.target;W&&x(W)},[x]),so=(0,u.useCallback)(a=>{let W=e.filter(k=>k.name!==a);t(W),r?.(a)},[e,t,r]),T=(0,u.useCallback)(()=>{d.current?.click()},[]),ao=e.length>=o||!i&&e.length>=1;return(0,h.jsxs)("div",{className:"cocso-file-upload-wrapper",children:[!ao&&(0,h.jsxs)("div",{ref:R,onDragEnter:q,onDragOver:X,onDragLeave:J,onDrop:Y,onClick:T,className:"cocso-file-upload","data-drag-active":p,children:[(0,h.jsx)("input",{ref:a=>{d.current=a,typeof c=="function"?c(a):c&&(c.current=a)},type:"file",onChange:oo,multiple:i,accept:s,style:{display:"none"},...m}),(0,h.jsxs)(M,{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(a=>(0,h.jsxs)("div",{className:"cocso-file-upload-item",children:[(0,h.jsx)(A,{size:"xs",children:a.name}),(0,h.jsx)("button",{type:"button",onClick:()=>so(a.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"})]})})]},a.name))})]})}),re=Object.assign(te,{displayName:"FileUpload"});var xo=f(require("react"),1),ko=require("@radix-ui/react-slot");var No=require("react/jsx-runtime"),ie=xo.forwardRef(({asChild:o=!1,size:e="md",color:t,weight:r="bold",className:i,style:s,...m},c)=>{let l=n("cocso-heading",{size:e},[],i);return(0,No.jsx)(o?ko.Slot:"h2",{ref:c,className:l,style:{"--cocso-heading-color":y(t),"--cocso-heading-weight":w(r),...s},...m})}),ro=Object.assign(ie,{displayName:"Heading"});var To=f(require("react"),1),Lo=require("@radix-ui/react-slot");var Mo=require("react/jsx-runtime"),ne=To.forwardRef(({asChild:o=!1,size:e="md",weight:t="normal",indicator:r=!0,className:i,style:s,...m},c)=>{let l=n("cocso-link",{size:e,indicator:r},[],i);return(0,Mo.jsx)(o?Lo.Slot:"a",{ref:c,className:l,style:{"--cocso-link-weight":w(t),...s},...m})}),se=Object.assign(ne,{displayName:"Link"});var C=f(require("@radix-ui/react-dialog"),1),_=require("react");var b=require("react/jsx-runtime"),ae=(0,_.forwardRef)(({className:o,children:e,...t},r)=>{let i=n("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:i,...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]})]})}),ce=(0,_.forwardRef)(({className:o,children:e,...t},r)=>{let i=n("cocso-modal-title",{},[],o);return(0,b.jsx)(C.Title,{ref:r,className:i,asChild:!0,...t,children:(0,b.jsx)(ro,{color:"text.basic",children:e})})}),me=(0,_.forwardRef)(({className:o,children:e,...t},r)=>{let i=n("cocso-modal-description",{},[],o);return(0,b.jsx)(C.Description,{ref:r,className:i,asChild:!0,...t,children:(0,b.jsx)(A,{size:"sm",color:"text.subtle",children:e})})}),le=Object.assign(C.Root,{Trigger:C.Trigger,Content:ae,Title:ce,Description:me});var Q=f(require("@radix-ui/react-one-time-password-field"),1),io=require("react");var no=require("react/jsx-runtime"),pe=(0,io.forwardRef)(({className:o,...e},t)=>{let r=n("cocso-otp",{},[],o);return(0,no.jsx)(Q.Root,{ref:t,className:r,...e})}),de=(0,io.forwardRef)(({className:o,...e},t)=>{let r=n("cocso-otp-input",{},[],o);return(0,no.jsx)(Q.Input,{ref:t,className:r,...e})}),fe=Object.assign(pe,{Input:de});var So=f(require("react"),1);var v=require("react/jsx-runtime"),he=So.forwardRef(({className:o,page:e,totalPages:t,maxVisible:r=5,onChange:i,...s},m)=>{let c=Math.ceil(r/2),p=d=>(0,v.jsx)("button",{className:"cocso-pagination-item",onClick:()=>i(d),"data-active":e===d,children:d},d),l=n("cocso-pagination",{},[],o);return(0,v.jsxs)("div",{ref:m,className:l,...s,children:[t>1&&(0,v.jsx)("button",{className:"cocso-pagination-arrow",disabled:e===1,onClick:()=>e>1&&i(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((d,R)=>p(R+1)):(0,v.jsxs)(v.Fragment,{children:[p(1),e>1+c&&(0,v.jsx)("span",{className:"cocso-pagination-trunc",children:"..."}),Array(r).fill(0).map((d,R)=>{let S=e-c+R+1;return S>1&&S<t?p(S):""}),e<t-c&&(0,v.jsx)("span",{className:"cocso-pagination-trunc",children:"..."}),p(t)]}),t>1&&(0,v.jsx)("button",{className:"cocso-pagination-arrow",disabled:e===t,onClick:()=>e<t&&i(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"})})})]})}),ge=Object.assign(he,{displayName:"Pagination"});var Wo=f(require("react"),1),U=f(require("@radix-ui/react-checkbox"),1);var N=require("react/jsx-runtime"),ue=Wo.forwardRef(({id:o,size:e="md",status:t,onChange:r,label:i,disabled:s=!1,className:m,...c},p)=>{let l={size:e,disabled:s,status:t},d=[...s?[{status:t,disabled:s}]:[]],R=n("cocso-checkbox",l,d,m),S=P=>{if(!s){let x;P===!0?x="on":P==="indeterminate"?x="intermediate":x="off",r(x)}};return(0,N.jsxs)("div",{className:"cocso-checkbox-wrapper",children:[(0,N.jsxs)(U.Root,{ref:p,id:o,className:R,checked:(()=>{switch(t){case"on":return!0;case"intermediate":return"indeterminate";case"off":default:return!1}})(),onCheckedChange:S,disabled:s,...c,children:[(0,N.jsx)(U.Indicator,{className:"cocso-checkbox-indicator",style:{opacity:t==="on"?1:0},children:(0,N.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,N.jsx)("path",{d:"M20 6 9 17l-5-5"})})}),(0,N.jsx)("div",{className:"cocso-checkbox-indicator",style:{opacity:t==="intermediate"?1:0},children:(0,N.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,N.jsx)("path",{d:"M5 12h14"})})})]}),i&&(0,N.jsx)(M,{className:n("cocso-checkbox-label",{disabled:s}),size:e,htmlFor:o,children:i})]})}),Ce=Object.assign(ue,{displayName:"Checkbox"});var Do=f(require("react"),1);var g=require("react/jsx-runtime"),ve=Do.forwardRef(({quantity:o,className:e,onChange:t,...r},i)=>{let s=n("cocso-stock-quantity-status",{},[],e);return(0,g.jsxs)("div",{ref:i,className:s,"data-status":o,...r,children:[(0,g.jsx)("span",{className:"cocso-stock-quantity-status-indicator",children:o==="\uC5EC\uC720"?(0,g.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,g.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.06494 13.0754C4.26764 13.0754 1.99999 10.8199 2 8.03765C2.00001 5.25543 4.26766 3 7.06494 3L9.48051 3V6.10011L7.06494 6.10011C5.98906 6.10011 5.11689 6.96758 5.11689 8.03767C5.11688 9.10776 5.98906 9.97524 7.06494 9.97524L9.48051 9.97524V13.0754H7.06494Z",fill:"#D9D9D9",fillOpacity:"0.85098"}),(0,g.jsx)("path",{d:"M9.48051 9.97524L9.48051 6.10011L12.0519 6.10026C13.1278 6.10026 14 6.96774 14 8.03783C14 9.10792 13.1278 9.9754 12.0519 9.9754L9.48051 9.97524Z",fill:"#D9D9D9",fillOpacity:"0.85098"}),(0,g.jsx)("path",{d:"M9.48047 6.10059H7.06543C5.98955 6.10059 5.11719 6.968 5.11719 8.03809C5.11741 9.10782 5.98893 9.97532 7.06445 9.97559H9.48047V13.0752H7.06445C4.35911 13.0749 2.14983 10.9652 2.00781 8.30957V7.76465C2.15041 5.10939 4.36025 3 7.06543 3H9.48047V6.10059ZM12.0518 6.10059C13.1276 6.10059 14 6.968 14 8.03809C13.9999 9.10806 13.1276 9.97559 12.0518 9.97559H9.48047V6.10059H12.0518Z",fill:"currentColor"})]}):o==="\uBCF4\uD1B5"?(0,g.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,g.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.06494 13.0754C4.26764 13.0754 1.99999 10.8199 2 8.03765C2.00001 5.25543 4.26766 3 7.06494 3L9.48051 3V6.10011L7.06494 6.10011C5.98906 6.10011 5.11689 6.96758 5.11689 8.03767C5.11688 9.10776 5.98906 9.97524 7.06494 9.97524L9.48051 9.97524V13.0754H7.06494Z",fill:"#D9D9D9",fillOpacity:"0.85098"}),(0,g.jsx)("path",{d:"M9.48051 9.97524L9.48051 6.10011L12.0519 6.10026C13.1278 6.10026 14 6.96774 14 8.03783C14 9.10792 13.1278 9.9754 12.0519 9.9754L9.48051 9.97524Z",fill:"#D9D9D9",fillOpacity:"0.85098"}),(0,g.jsx)("path",{d:"M9.48145 6.0752V6.10059H7.06641C5.99053 6.10059 5.11817 6.968 5.11816 8.03809C5.11839 9.10782 5.98991 9.97532 7.06543 9.97559H9.48145V13.0752H7.06543C4.35577 13.0749 2.14345 10.9585 2.00781 8.29688V7.77832C2.03849 7.17662 2.17568 6.60303 2.40039 6.0752H9.48145ZM12.0527 6.10059C13.1286 6.10059 14.001 6.968 14.001 8.03809C14.0008 9.10806 13.1285 9.97559 12.0527 9.97559H9.48145V6.10059H12.0527Z",fill:"currentColor"})]}):(0,g.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,g.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.06494 13.0754C4.26764 13.0754 1.99999 10.8199 2 8.03765C2.00001 5.25543 4.26766 3 7.06494 3L9.48051 3V6.10011L7.06494 6.10011C5.98906 6.10011 5.11689 6.96758 5.11689 8.03767C5.11688 9.10776 5.98906 9.97524 7.06494 9.97524L9.48051 9.97524V13.0754H7.06494Z",fill:"#D9D9D9",fillOpacity:"0.85098"}),(0,g.jsx)("path",{d:"M9.48051 9.97524L9.48051 6.10011L12.0519 6.10026C13.1278 6.10026 14 6.96774 14 8.03783C14 9.10792 13.1278 9.9754 12.0519 9.9754L9.48051 9.97524Z",fill:"#D9D9D9",fillOpacity:"0.85098"}),(0,g.jsx)("path",{d:"M7.04688 9.97461C7.05273 9.97466 7.05859 9.97558 7.06445 9.97559H9.48047V13.0752H7.06445C4.95754 13.075 3.15182 11.7952 2.38867 9.97461H7.04688ZM12.0713 9.97461C12.0648 9.97467 12.0582 9.97559 12.0518 9.97559H9.48047V9.97461H12.0713Z",fill:"currentColor"})]})}),(0,g.jsx)(M,{size:"sm",color:"currentColor",children:o})]})}),be=Object.assign(ve,{displayName:"StockQuantityStatus"});var Fo=f(require("react"),1),G=f(require("@radix-ui/react-switch"),1);var O=require("react/jsx-runtime"),Pe=Fo.forwardRef(({id:o,size:e="md",disabled:t=!1,label:r,position:i="right",className:s,children:m,...c},p)=>{let l=n("cocso-switch",{size:e,disabled:t},[],s),d=n("cocso-switch-thumb",{size:e});return(0,O.jsxs)("div",{className:"cocso-switch-wrapper",children:[i==="left"&&(0,O.jsx)(M,{size:e,htmlFor:o,children:r}),(0,O.jsx)(G.Root,{ref:p,className:l,...c,children:(0,O.jsx)(G.Thumb,{className:d})}),i==="right"&&(0,O.jsx)(M,{size:e,htmlFor:o,children:r})]})}),ye=Object.assign(Pe,{displayName:"Switch"});var F=f(require("@radix-ui/react-tabs"),1),z=require("react");var V=require("react/jsx-runtime"),Re=(0,z.forwardRef)(({className:o,...e},t)=>{let r=n("cocso-tab",{},[],o);return(0,V.jsx)(F.Root,{ref:t,className:r,...e})}),we=(0,z.forwardRef)(({className:o,...e},t)=>{let r=n("cocso-tab-list",{},[],o);return(0,V.jsx)(F.List,{ref:t,className:r,...e})}),xe=(0,z.forwardRef)(({className:o,...e},t)=>{let r=n("cocso-tab-trigger",{},[],o);return(0,V.jsx)(F.Trigger,{ref:t,className:r,...e})}),ke=(0,z.forwardRef)(({className:o,...e},t)=>{let r=n("cocso-tab-content",{},[],o);return(0,V.jsx)(F.Content,{ref:t,className:r,...e})}),Ne=Object.assign(Re,{List:we,Trigger:xe,Content:ke});var K=require("sonner"),Te=Object.assign(K.Toaster,{displayName:"Toast"});
package/lib/index.d.ts CHANGED
@@ -11,5 +11,7 @@ export * from './components/OneTimePasswordField';
11
11
  export * from './components/Pagination';
12
12
  export * from './components/Checkbox';
13
13
  export * from './components/Spinner';
14
+ export * from './components/StockQuantityStatus';
14
15
  export * from './components/Switch';
16
+ export * from './components/Tab';
15
17
  export * from './components/Toast';
package/lib/index.js CHANGED
@@ -1 +1 @@
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};
1
+ import*as R from"@radix-ui/react-accordion";import{forwardRef as J}from"react";var ko=(...e)=>e.filter(Boolean).join(" ").trim(),n=(e,o,t=[],...r)=>{let i=Object.entries(o).filter(([,m])=>m!==!1&&m!==null&&m!==void 0).map(([m,c])=>`${e}--${m}_${c}`).join(" "),s=t.filter(m=>Object.entries(m).every(([c,p])=>o[c]===p)).map(m=>{let c=Object.entries(m).map(([p,l])=>`${p}_${l}`).join("-");return`${e}--${c}`}).join(" ");return ko(e,i,s,...r)};import{Slottable as No}from"@radix-ui/react-slot";import{jsx as F,jsxs as So}from"react/jsx-runtime";var To=J(({className:e,...o},t)=>{let r=n("cocso-accordion-item",{},[],e);return F(R.Item,{ref:t,className:r,...o})}),Lo=J(({className:e,children:o,chevron:t=!0,...r},i)=>{let s=n("cocso-accordion-trigger",{},[],e);return F(R.Trigger,{ref:i,className:s,...r,children:So(No,{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"})})})]})})}),Mo=J(({className:e,...o},t)=>{let r=n("cocso-accordion-content",{},[],e);return F(R.Content,{ref:t,className:r,...o})}),Re=Object.assign(R.Root,{Item:To,Header:R.Header,Trigger:Lo,Content:Mo});import*as io from"react";import{Slot as Wo}from"@radix-ui/react-slot";function g(e){if(e)return e.includes(".")?`var(--color-${e.replace(/\./g,"-")})`:e}var ro={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 ro?ro[e]:e}import{jsx as Fo}from"react/jsx-runtime";var Do=io.forwardRef(({asChild:e=!1,size:o="md",color:t,weight:r="normal",className:i,style:s,...m},c)=>{let l=n("cocso-body",{size:o},[],i);return Fo(e?Wo:"p",{ref:c,className:l,style:{"--cocso-body-color":g(t),"--cocso-body-weight":C(r),...s},...m})}),A=Object.assign(Do,{displayName:"Body"});import*as B from"react";import{Slot as Eo}from"@radix-ui/react-slot";import*as no from"react";import{jsx as X,jsxs as Bo}from"react/jsx-runtime";var Ho=["div"],Oo=no.forwardRef(({as:e=Ho[0],size:o="md",color:t="palette.primary-500",bg:r="palette.gray-200",className:i,style:s,...m},c)=>{let p=e,d=n("cocso-spinner",{size:o},[],i);return X(p,{ref:c,className:d,style:{"--cocso-spinner-bg":g(r),"--cocso-spinner-color":g(t),...s},...m,children:Bo("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[X("circle",{className:"opacity-25",cx:"12",cy:"12",r:"9",stroke:"var(--cocso-spinner-bg, currentColor)",strokeWidth:"3"}),X("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"})]})})}),so=Object.assign(Oo,{displayName:"Spinner"});import{jsx as ao}from"react/jsx-runtime";var Ao=e=>({"2xs":"xs",xs:"xs",sm:"xs",md:"sm",lg:"md",xl:"md"})[e],Io=B.forwardRef(({asChild:e=!1,variant:o="primary",size:t="md",disabled:r=!1,loading:i=!1,color:s,weight:m="normal",className:c,style:p,children:l,onClick:d,onKeyDown:u,...x},O)=>{let h=r||i,v=B.useCallback(y=>{if(h){y.preventDefault();return}d?.(y)},[h,d]),Q=B.useCallback(y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),h||y.currentTarget.click()),u?.(y)},[h,u]),U={variant:o,size:t,loading:i,disabled:h},G=[...r?[{variant:o,disabled:r}]:[],...i?[{variant:o,loading:i}]:[]],K=n("cocso-button",U,G,c),q={"--cocso-button-color":g(s),"--cocso-button-weight":C(m),...p};return ao(e?Eo:"button",{ref:O,className:K,onClick:v,onKeyDown:Q,role:"button",disabled:h,"aria-disabled":h,"aria-busy":i,style:q,...x,children:i?ao(so,{className:"cocso-button-spinner",size:Ao(t),color:"currentColor"}):l})}),_e=Object.assign(Io,{displayName:"Button"});import*as co from"react";import{Slot as zo}from"@radix-ui/react-slot";import{jsx as jo}from"react/jsx-runtime";var Vo=co.forwardRef(({asChild:e=!1,size:o="md",color:t,weight:r="bold",className:i,style:s,...m},c)=>{let l=n("cocso-display",{size:o},[],i);return jo(e?zo:"h1",{ref:c,className:l,style:{"--cocso-display-color":g(t),"--cocso-display-weight":C(r),...s},...m})}),Ye=Object.assign(Vo,{displayName:"Display"});import*as po from"react";import{useRef as lo,useState as Qo,useCallback as w}from"react";import*as mo from"react";import{Slot as Zo}from"@radix-ui/react-slot";import{jsx as _o}from"react/jsx-runtime";var $o=mo.forwardRef(({asChild:e=!1,size:o="md",color:t="text.basic",weight:r="normal",className:i,style:s,...m},c)=>{let l=n("cocso-label",{size:o},[],i);return _o(e?Zo:"label",{ref:c,className:l,style:{"--cocso-label-color":g(t),"--cocso-label-weight":C(r),...s},...m})}),N=Object.assign($o,{displayName:"Label"});import{jsx as T,jsxs as H}from"react/jsx-runtime";var Uo=po.forwardRef(({maxFiles:e=2,files:o,onFilesChange:t,onRemove:r,multiple:i=!0,accept:s,...m},c)=>{let[p,l]=Qo(!1),d=lo(null),u=lo(null),x=3*1024*1024,O=w(a=>s?s.split(",").map(b=>b.trim()).some(b=>{if(b.endsWith("/*")){let E=b.slice(0,-2);return a.type.startsWith(E)}return a.type===b||a.name.toLowerCase().endsWith(b)}):!0,[s]),h=w(a=>a.size>x?(alert(`${a.name}\uC740(\uB294) 3MB\uB97C \uCD08\uACFC\uD569\uB2C8\uB2E4.`),!1):!0,[]),v=w(a=>{let b=Array.from(a).filter(W=>O(W)?h(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 xo=b.slice(0,E).map(W=>({file:W,name:W.name,size:W.size}));t([...o,...xo])},[o,e,t,O,h]),Q=w(a=>{a.preventDefault(),a.stopPropagation(),l(!0)},[]),U=w(a=>{a.preventDefault(),a.stopPropagation(),u.current&&!u.current.contains(a.relatedTarget)&&l(!1)},[]),G=w(a=>{a.preventDefault(),a.stopPropagation()},[]),K=w(a=>{a.preventDefault(),a.stopPropagation(),l(!1);let{files:k}=a.dataTransfer;k&&v(k)},[v]),q=w(a=>{let{files:k}=a.target;k&&v(k)},[v]),eo=w(a=>{let k=o.filter(b=>b.name!==a);t(k),r?.(a)},[o,t,r]),y=w(()=>{d.current?.click()},[]),to=o.length>=e||!i&&o.length>=1;return H("div",{className:"cocso-file-upload-wrapper",children:[!to&&H("div",{ref:u,onDragEnter:Q,onDragOver:G,onDragLeave:U,onDrop:K,onClick:y,className:"cocso-file-upload","data-drag-active":p,children:[T("input",{ref:a=>{d.current=a,typeof c=="function"?c(a):c&&(c.current=a)},type:"file",onChange:q,multiple:i,accept:s,style:{display:"none"},...m}),H(N,{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",T("br",{}),"(\uCD5C\uB300 3MB)"]}),H("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:[T("path",{d:"M5 12h14"}),T("path",{d:"M12 5v14"})]})]}),o.length>0&&T("div",{className:"cocso-file-upload-list",children:o.map(a=>H("div",{className:"cocso-file-upload-item",children:[T(A,{size:"xs",children:a.name}),T("button",{type:"button",onClick:()=>eo(a.name),className:"cocso-file-upload-remove",children:H("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"})]})})]},a.name))})]})}),ht=Object.assign(Uo,{displayName:"FileUpload"});import*as fo from"react";import{Slot as Go}from"@radix-ui/react-slot";import{jsx as qo}from"react/jsx-runtime";var Ko=fo.forwardRef(({asChild:e=!1,size:o="md",color:t,weight:r="bold",className:i,style:s,...m},c)=>{let l=n("cocso-heading",{size:o},[],i);return qo(e?Go:"h2",{ref:c,className:l,style:{"--cocso-heading-color":g(t),"--cocso-heading-weight":C(r),...s},...m})}),ho=Object.assign(Ko,{displayName:"Heading"});import*as go from"react";import{Slot as Jo}from"@radix-ui/react-slot";import{jsx as Yo}from"react/jsx-runtime";var Xo=go.forwardRef(({asChild:e=!1,size:o="md",weight:t="normal",indicator:r=!0,className:i,style:s,...m},c)=>{let l=n("cocso-link",{size:o,indicator:r},[],i);return Yo(e?Jo:"a",{ref:c,className:l,style:{"--cocso-link-weight":C(t),...s},...m})}),Mt=Object.assign(Xo,{displayName:"Link"});import*as f from"@radix-ui/react-dialog";import{forwardRef as oo}from"react";import{jsx as L,jsxs as Y}from"react/jsx-runtime";var oe=oo(({className:e,children:o,...t},r)=>{let i=n("cocso-modal-content",{},[],e);return Y(f.Portal,{children:[L(f.Overlay,{className:"cocso-modal-overlay"}),Y(f.Content,{ref:r,className:i,...t,children:[L("div",{className:"cocso-modal-close-wrapper",children:L(f.Close,{className:"cocso-modal-close",children:Y("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:[L("path",{d:"M18 6 6 18"}),L("path",{d:"m6 6 12 12"})]})})}),o]})]})}),ee=oo(({className:e,children:o,...t},r)=>{let i=n("cocso-modal-title",{},[],e);return L(f.Title,{ref:r,className:i,asChild:!0,...t,children:L(ho,{color:"text.basic",children:o})})}),te=oo(({className:e,children:o,...t},r)=>{let i=n("cocso-modal-description",{},[],e);return L(f.Description,{ref:r,className:i,asChild:!0,...t,children:L(A,{size:"sm",color:"text.subtle",children:o})})}),zt=Object.assign(f.Root,{Trigger:f.Trigger,Content:oe,Title:ee,Description:te});import*as I from"@radix-ui/react-one-time-password-field";import{forwardRef as uo}from"react";import{jsx as Co}from"react/jsx-runtime";var re=uo(({className:e,...o},t)=>{let r=n("cocso-otp",{},[],e);return Co(I.Root,{ref:t,className:r,...o})}),ie=uo(({className:e,...o},t)=>{let r=n("cocso-otp-input",{},[],e);return Co(I.Input,{ref:t,className:r,...o})}),Kt=Object.assign(re,{Input:ie});import*as bo from"react";import{Fragment as se,jsx as M,jsxs as vo}from"react/jsx-runtime";var ne=bo.forwardRef(({className:e,page:o,totalPages:t,maxVisible:r=5,onChange:i,...s},m)=>{let c=Math.ceil(r/2),p=d=>M("button",{className:"cocso-pagination-item",onClick:()=>i(d),"data-active":o===d,children:d},d),l=n("cocso-pagination",{},[],e);return vo("div",{ref:m,className:l,...s,children:[t>1&&M("button",{className:"cocso-pagination-arrow",disabled:o===1,onClick:()=>o>1&&i(o-1),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:"m15 18-6-6 6-6"})})}),t<=r+2?Array(t).fill(0).map((d,u)=>p(u+1)):vo(se,{children:[p(1),o>1+c&&M("span",{className:"cocso-pagination-trunc",children:"..."}),Array(r).fill(0).map((d,u)=>{let x=o-c+u+1;return x>1&&x<t?p(x):""}),o<t-c&&M("span",{className:"cocso-pagination-trunc",children:"..."}),p(t)]}),t>1&&M("button",{className:"cocso-pagination-arrow",disabled:o===t,onClick:()=>o<t&&i(o+1),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:"m9 18 6-6-6-6"})})})]})}),er=Object.assign(ne,{displayName:"Pagination"});import*as yo from"react";import*as z from"@radix-ui/react-checkbox";import{jsx as D,jsxs as Po}from"react/jsx-runtime";var ae=yo.forwardRef(({id:e,size:o="md",status:t,onChange:r,label:i,disabled:s=!1,className:m,...c},p)=>{let l={size:o,disabled:s,status:t},d=[...s?[{status:t,disabled:s}]:[]],u=n("cocso-checkbox",l,d,m),x=h=>{if(!s){let v;h===!0?v="on":h==="indeterminate"?v="intermediate":v="off",r(v)}};return Po("div",{className:"cocso-checkbox-wrapper",children:[Po(z.Root,{ref:p,id:e,className:u,checked:(()=>{switch(t){case"on":return!0;case"intermediate":return"indeterminate";case"off":default:return!1}})(),onCheckedChange:x,disabled:s,...c,children:[D(z.Indicator,{className:"cocso-checkbox-indicator",style:{opacity:t==="on"?1:0},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:D("path",{d:"M20 6 9 17l-5-5"})})}),D("div",{className:"cocso-checkbox-indicator",style:{opacity:t==="intermediate"?1:0},children:D("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:D("path",{d:"M5 12h14"})})})]}),i&&D(N,{className:n("cocso-checkbox-label",{disabled:s}),size:o,htmlFor:e,children:i})]})}),cr=Object.assign(ae,{displayName:"Checkbox"});import*as Ro from"react";import{jsx as P,jsxs as V}from"react/jsx-runtime";var ce=Ro.forwardRef(({quantity:e,className:o,onChange:t,...r},i)=>{let s=n("cocso-stock-quantity-status",{},[],o);return V("div",{ref:i,className:s,"data-status":e,...r,children:[P("span",{className:"cocso-stock-quantity-status-indicator",children:e==="\uC5EC\uC720"?V("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[P("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.06494 13.0754C4.26764 13.0754 1.99999 10.8199 2 8.03765C2.00001 5.25543 4.26766 3 7.06494 3L9.48051 3V6.10011L7.06494 6.10011C5.98906 6.10011 5.11689 6.96758 5.11689 8.03767C5.11688 9.10776 5.98906 9.97524 7.06494 9.97524L9.48051 9.97524V13.0754H7.06494Z",fill:"#D9D9D9",fillOpacity:"0.85098"}),P("path",{d:"M9.48051 9.97524L9.48051 6.10011L12.0519 6.10026C13.1278 6.10026 14 6.96774 14 8.03783C14 9.10792 13.1278 9.9754 12.0519 9.9754L9.48051 9.97524Z",fill:"#D9D9D9",fillOpacity:"0.85098"}),P("path",{d:"M9.48047 6.10059H7.06543C5.98955 6.10059 5.11719 6.968 5.11719 8.03809C5.11741 9.10782 5.98893 9.97532 7.06445 9.97559H9.48047V13.0752H7.06445C4.35911 13.0749 2.14983 10.9652 2.00781 8.30957V7.76465C2.15041 5.10939 4.36025 3 7.06543 3H9.48047V6.10059ZM12.0518 6.10059C13.1276 6.10059 14 6.968 14 8.03809C13.9999 9.10806 13.1276 9.97559 12.0518 9.97559H9.48047V6.10059H12.0518Z",fill:"currentColor"})]}):e==="\uBCF4\uD1B5"?V("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[P("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.06494 13.0754C4.26764 13.0754 1.99999 10.8199 2 8.03765C2.00001 5.25543 4.26766 3 7.06494 3L9.48051 3V6.10011L7.06494 6.10011C5.98906 6.10011 5.11689 6.96758 5.11689 8.03767C5.11688 9.10776 5.98906 9.97524 7.06494 9.97524L9.48051 9.97524V13.0754H7.06494Z",fill:"#D9D9D9",fillOpacity:"0.85098"}),P("path",{d:"M9.48051 9.97524L9.48051 6.10011L12.0519 6.10026C13.1278 6.10026 14 6.96774 14 8.03783C14 9.10792 13.1278 9.9754 12.0519 9.9754L9.48051 9.97524Z",fill:"#D9D9D9",fillOpacity:"0.85098"}),P("path",{d:"M9.48145 6.0752V6.10059H7.06641C5.99053 6.10059 5.11817 6.968 5.11816 8.03809C5.11839 9.10782 5.98991 9.97532 7.06543 9.97559H9.48145V13.0752H7.06543C4.35577 13.0749 2.14345 10.9585 2.00781 8.29688V7.77832C2.03849 7.17662 2.17568 6.60303 2.40039 6.0752H9.48145ZM12.0527 6.10059C13.1286 6.10059 14.001 6.968 14.001 8.03809C14.0008 9.10806 13.1285 9.97559 12.0527 9.97559H9.48145V6.10059H12.0527Z",fill:"currentColor"})]}):V("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[P("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.06494 13.0754C4.26764 13.0754 1.99999 10.8199 2 8.03765C2.00001 5.25543 4.26766 3 7.06494 3L9.48051 3V6.10011L7.06494 6.10011C5.98906 6.10011 5.11689 6.96758 5.11689 8.03767C5.11688 9.10776 5.98906 9.97524 7.06494 9.97524L9.48051 9.97524V13.0754H7.06494Z",fill:"#D9D9D9",fillOpacity:"0.85098"}),P("path",{d:"M9.48051 9.97524L9.48051 6.10011L12.0519 6.10026C13.1278 6.10026 14 6.96774 14 8.03783C14 9.10792 13.1278 9.9754 12.0519 9.9754L9.48051 9.97524Z",fill:"#D9D9D9",fillOpacity:"0.85098"}),P("path",{d:"M7.04688 9.97461C7.05273 9.97466 7.05859 9.97558 7.06445 9.97559H9.48047V13.0752H7.06445C4.95754 13.075 3.15182 11.7952 2.38867 9.97461H7.04688ZM12.0713 9.97461C12.0648 9.97467 12.0582 9.97559 12.0518 9.97559H9.48047V9.97461H12.0713Z",fill:"currentColor"})]})}),P(N,{size:"sm",color:"currentColor",children:e})]})}),gr=Object.assign(ce,{displayName:"StockQuantityStatus"});import*as wo from"react";import*as Z from"@radix-ui/react-switch";import{jsx as j,jsxs as le}from"react/jsx-runtime";var me=wo.forwardRef(({id:e,size:o="md",disabled:t=!1,label:r,position:i="right",className:s,children:m,...c},p)=>{let l=n("cocso-switch",{size:o,disabled:t},[],s),d=n("cocso-switch-thumb",{size:o});return le("div",{className:"cocso-switch-wrapper",children:[i==="left"&&j(N,{size:o,htmlFor:e,children:r}),j(Z.Root,{ref:p,className:l,...c,children:j(Z.Thumb,{className:d})}),i==="right"&&j(N,{size:o,htmlFor:e,children:r})]})}),Rr=Object.assign(me,{displayName:"Switch"});import*as S from"@radix-ui/react-tabs";import{forwardRef as $}from"react";import{jsx as _}from"react/jsx-runtime";var pe=$(({className:e,...o},t)=>{let r=n("cocso-tab",{},[],e);return _(S.Root,{ref:t,className:r,...o})}),de=$(({className:e,...o},t)=>{let r=n("cocso-tab-list",{},[],e);return _(S.List,{ref:t,className:r,...o})}),fe=$(({className:e,...o},t)=>{let r=n("cocso-tab-trigger",{},[],e);return _(S.Trigger,{ref:t,className:r,...o})}),he=$(({className:e,...o},t)=>{let r=n("cocso-tab-content",{},[],e);return _(S.Content,{ref:t,className:r,...o})}),Wr=Object.assign(pe,{List:de,Trigger:fe,Content:he});import{Toaster as ge,toast as Er}from"sonner";var Ar=Object.assign(ge,{displayName:"Toast"});export{Re as Accordion,A as Body,_e as Button,cr as Checkbox,Ye as Display,ht as FileUpload,ho as Heading,N as Label,Mt as Link,zt as Modal,Kt as OneTimePasswordField,er as Pagination,so as Spinner,gr as StockQuantityStatus,Rr as Switch,Wr as Tab,Ar as Toaster,Er as toast};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocso-ui/react",
3
- "version": "0.0.1-beta.42",
3
+ "version": "0.0.1-beta.44",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/cocso/cocso-ui.git",
@@ -31,6 +31,7 @@
31
31
  "@radix-ui/react-one-time-password-field": "^0.1.7",
32
32
  "@radix-ui/react-slot": "^1.2.3",
33
33
  "@radix-ui/react-switch": "^1.2.5",
34
+ "@radix-ui/react-tabs": "^1.1.12",
34
35
  "sonner": "^2.0.6"
35
36
  },
36
37
  "peerDependencies": {