@cocso-ui/react 0.0.1-beta.45 → 0.0.1-beta.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/Modal/Modal.d.ts +1 -0
- package/lib/index.cjs +1 -1
- package/lib/index.js +1 -1
- package/package.json +2 -2
|
@@ -2,6 +2,7 @@ import * as ModalPrimitive from '@radix-ui/react-dialog';
|
|
|
2
2
|
export declare const Modal: import("react").FC<ModalPrimitive.DialogProps> & {
|
|
3
3
|
Trigger: import("react").ForwardRefExoticComponent<ModalPrimitive.DialogTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
4
4
|
Content: import("react").ForwardRefExoticComponent<Omit<ModalPrimitive.DialogContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
5
|
+
Close: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
5
6
|
Title: import("react").ForwardRefExoticComponent<Omit<ModalPrimitive.DialogTitleProps & import("react").RefAttributes<HTMLHeadingElement>, "ref"> & import("react").RefAttributes<HTMLHeadingElement>>;
|
|
6
7
|
Description: import("react").ForwardRefExoticComponent<Omit<ModalPrimitive.DialogDescriptionProps & import("react").RefAttributes<HTMLParagraphElement>, "ref"> & import("react").RefAttributes<HTMLParagraphElement>>;
|
|
7
8
|
};
|
package/lib/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var Io=Object.create;var $=Object.defineProperty;var Ao=Object.getOwnPropertyDescriptor;var zo=Object.getOwnPropertyNames;var Vo=Object.getPrototypeOf,jo=Object.prototype.hasOwnProperty;var Zo=(o,e)=>{for(var t in e)$(o,t,{get:e[t],enumerable:!0})},po=(o,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of zo(e))!jo.call(o,i)&&i!==t&&$(o,i,{get:()=>e[i],enumerable:!(r=Ao(e,i))||r.enumerable});return o};var f=(o,e,t)=>(t=o!=null?Io(Vo(o)):{},po(e||!o||!o.__esModule?$(t,"default",{value:o,enumerable:!0}):t,o)),$o=o=>po($({},"__esModule",{value:!0}),o);var He={};Zo(He,{Accordion:()=>Ko,Body:()=>A,Button:()=>ee,Checkbox:()=>we,Display:()=>re,Dropdown:()=>se,FileUpload:()=>me,Heading:()=>so,Label:()=>M,Link:()=>de,Modal:()=>ue,OneTimePasswordField:()=>Pe,Pagination:()=>be,Spinner:()=>to,StockQuantityStatus:()=>Ne,Switch:()=>ke,Tab:()=>We,Toaster:()=>Fe,toast:()=>q.toast});module.exports=$o(He);var L=f(require("@radix-ui/react-accordion"),1),_=require("react");var _o=(...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 _o(o,i,s,...r)};var fo=require("@radix-ui/react-slot"),F=require("react/jsx-runtime"),Qo=(0,_.forwardRef)(({className:o,...e},t)=>{let r=n("cocso-accordion-item",{},[],o);return(0,F.jsx)(L.Item,{ref:t,className:r,...e})}),Uo=(0,_.forwardRef)(({className:o,children:e,chevron:t=!0,...r},i)=>{let s=n("cocso-accordion-trigger",{},[],o);return(0,F.jsx)(L.Trigger,{ref:i,className:s,...r,children:(0,F.jsxs)(fo.Slottable,{children:[e,t&&(0,F.jsx)("div",{className:"cocso-accordion-chevron",children:(0,F.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,F.jsx)("path",{d:"m6 9 6 6 6-6"})})})]})})}),Go=(0,_.forwardRef)(({className:o,...e},t)=>{let r=n("cocso-accordion-content",{},[],o);return(0,F.jsx)(L.Content,{ref:t,className:r,...e})}),Ko=Object.assign(L.Root,{Item:Qo,Header:L.Header,Trigger:Uo,Content:Go});var go=f(require("react"),1),uo=require("@radix-ui/react-slot");function b(o){if(o)return o.includes(".")?`var(--color-${o.replace(/\./g,"-")})`:o}var ho={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 ho?ho[o]:o}var Co=require("react/jsx-runtime"),qo=go.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,Co.jsx)(o?uo.Slot:"p",{ref:c,className:l,style:{"--cocso-body-color":b(t),"--cocso-body-weight":w(r),...s},...m})}),A=Object.assign(qo,{displayName:"Body"});var z=f(require("react"),1),Po=require("@radix-ui/react-slot");var vo=f(require("react"),1);var E=require("react/jsx-runtime"),Jo=["div"],Xo=vo.forwardRef(({as:o=Jo[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,E.jsx)(p,{ref:c,className:d,style:{"--cocso-spinner-bg":b(r),"--cocso-spinner-color":b(t),...s},...m,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"})]})})}),to=Object.assign(Xo,{displayName:"Spinner"});var ro=require("react/jsx-runtime"),Yo=o=>({"2xs":"xs",xs:"xs",sm:"xs",md:"sm",lg:"md",xl:"md"})[o],oe=z.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:y,...S},I)=>{let R=r||i,x=z.useCallback(k=>{if(R){k.preventDefault();return}d?.(k)},[R,d]),J=z.useCallback(k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),R||k.currentTarget.click()),y?.(k)},[R,y]),X={variant:e,size:t,loading:i,disabled:R},Y=[...r?[{variant:e,disabled:r}]:[],...i?[{variant:e,loading:i}]:[]],oo=n("cocso-button",X,Y,c),eo={"--cocso-button-color":b(s),"--cocso-button-weight":w(m),...p};return(0,ro.jsx)(o?Po.Slot:"button",{ref:I,className:oo,onClick:x,onKeyDown:J,role:"button",disabled:R,"aria-disabled":R,"aria-busy":i,style:eo,...S,children:i?(0,ro.jsx)(to,{className:"cocso-button-spinner",size:Yo(t),color:"currentColor"}):l})}),ee=Object.assign(oe,{displayName:"Button"});var Ro=f(require("react"),1),bo=require("@radix-ui/react-slot");var yo=require("react/jsx-runtime"),te=Ro.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,yo.jsx)(o?bo.Slot:"h1",{ref:c,className:l,style:{"--cocso-display-color":b(t),"--cocso-display-weight":w(r),...s},...m})}),re=Object.assign(te,{displayName:"Display"});var D=f(require("@radix-ui/react-dropdown-menu"),1),io=require("react");var no=require("react/jsx-runtime"),ie=(0,io.forwardRef)(({className:o,...e},t)=>{let r=n("cocso-dropdown-content",{},[],o);return(0,no.jsx)(D.Content,{ref:t,className:r,...e})}),ne=(0,io.forwardRef)(({className:o,...e},t)=>{let r=n("cocso-dropdown-item",{},[],o);return(0,no.jsx)(D.Item,{ref:t,className:r,...e})}),se=Object.assign(D.Root,{Trigger:D.Trigger,Portal:D.Portal,Content:ie,Item:ne});var To=f(require("react"),1),u=require("react");var wo=f(require("react"),1),xo=require("@radix-ui/react-slot");var No=require("react/jsx-runtime"),ae=wo.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,No.jsx)(o?xo.Slot:"label",{ref:c,className:l,style:{"--cocso-label-color":b(t),"--cocso-label-weight":w(r),...s},...m})}),M=Object.assign(ae,{displayName:"Label"});var h=require("react/jsx-runtime"),ce=To.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),y=(0,u.useRef)(null),S=3*1024*1024,I=(0,u.useCallback)(a=>s?s.split(",").map(N=>N.trim()).some(N=>{if(N.endsWith("/*")){let Z=N.slice(0,-2);return a.type.startsWith(Z)}return a.type===N||a.name.toLowerCase().endsWith(N)}):!0,[s]),R=(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 N=Array.from(a).filter(O=>I(O)?R(O):(alert(`${O.name}\uC740(\uB294) \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uB294 \uD30C\uC77C \uD0C0\uC785\uC785\uB2C8\uB2E4.`),!1));if(N.length===0)return;let Z=o-e.length;if(Z<=0){alert(`\uCD5C\uB300 ${o}\uAC1C\uC758 \uD30C\uC77C\uB9CC \uC5C5\uB85C\uB4DC\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.`);return}let Eo=N.slice(0,Z).map(O=>({file:O,name:O.name,size:O.size}));t([...e,...Eo])},[e,o,t,I,R]),J=(0,u.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),l(!0)},[]),X=(0,u.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),y.current&&!y.current.contains(a.relatedTarget)&&l(!1)},[]),Y=(0,u.useCallback)(a=>{a.preventDefault(),a.stopPropagation()},[]),oo=(0,u.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),l(!1);let{files:W}=a.dataTransfer;W&&x(W)},[x]),eo=(0,u.useCallback)(a=>{let{files:W}=a.target;W&&x(W)},[x]),mo=(0,u.useCallback)(a=>{let W=e.filter(N=>N.name!==a);t(W),r?.(a)},[e,t,r]),k=(0,u.useCallback)(()=>{d.current?.click()},[]),lo=e.length>=o||!i&&e.length>=1;return(0,h.jsxs)("div",{className:"cocso-file-upload-wrapper",children:[!lo&&(0,h.jsxs)("div",{ref:y,onDragEnter:J,onDragOver:Y,onDragLeave:X,onDrop:oo,onClick:k,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:eo,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:()=>mo(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))})]})}),me=Object.assign(ce,{displayName:"FileUpload"});var ko=f(require("react"),1),Lo=require("@radix-ui/react-slot");var Do=require("react/jsx-runtime"),le=ko.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,Do.jsx)(o?Lo.Slot:"h2",{ref:c,className:l,style:{"--cocso-heading-color":b(t),"--cocso-heading-weight":w(r),...s},...m})}),so=Object.assign(le,{displayName:"Heading"});var Mo=f(require("react"),1),So=require("@radix-ui/react-slot");var Wo=require("react/jsx-runtime"),pe=Mo.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,Wo.jsx)(o?So.Slot:"a",{ref:c,className:l,style:{"--cocso-link-weight":w(t),...s},...m})}),de=Object.assign(pe,{displayName:"Link"});var C=f(require("@radix-ui/react-dialog"),1),Q=require("react");var P=require("react/jsx-runtime"),fe=(0,Q.forwardRef)(({className:o,children:e,...t},r)=>{let i=n("cocso-modal-content",{},[],o);return(0,P.jsxs)(C.Portal,{children:[(0,P.jsx)(C.Overlay,{className:"cocso-modal-overlay"}),(0,P.jsxs)(C.Content,{ref:r,className:i,...t,children:[(0,P.jsx)("div",{className:"cocso-modal-close-wrapper",children:(0,P.jsx)(C.Close,{className:"cocso-modal-close",children:(0,P.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,P.jsx)("path",{d:"M18 6 6 18"}),(0,P.jsx)("path",{d:"m6 6 12 12"})]})})}),e]})]})}),he=(0,Q.forwardRef)(({className:o,children:e,...t},r)=>{let i=n("cocso-modal-title",{},[],o);return(0,P.jsx)(C.Title,{ref:r,className:i,asChild:!0,...t,children:(0,P.jsx)(so,{color:"text.basic",children:e})})}),ge=(0,Q.forwardRef)(({className:o,children:e,...t},r)=>{let i=n("cocso-modal-description",{},[],o);return(0,P.jsx)(C.Description,{ref:r,className:i,asChild:!0,...t,children:(0,P.jsx)(A,{size:"sm",color:"text.subtle",children:e})})}),ue=Object.assign(C.Root,{Trigger:C.Trigger,Content:fe,Title:he,Description:ge});var U=f(require("@radix-ui/react-one-time-password-field"),1),ao=require("react");var co=require("react/jsx-runtime"),Ce=(0,ao.forwardRef)(({className:o,...e},t)=>{let r=n("cocso-otp",{},[],o);return(0,co.jsx)(U.Root,{ref:t,className:r,...e})}),ve=(0,ao.forwardRef)(({className:o,...e},t)=>{let r=n("cocso-otp-input",{},[],o);return(0,co.jsx)(U.Input,{ref:t,className:r,...e})}),Pe=Object.assign(Ce,{Input:ve});var Fo=f(require("react"),1);var v=require("react/jsx-runtime"),Re=Fo.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,y)=>p(y+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,y)=>{let S=e-c+y+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"})})})]})}),be=Object.assign(Re,{displayName:"Pagination"});var Ho=f(require("react"),1),G=f(require("@radix-ui/react-checkbox"),1);var T=require("react/jsx-runtime"),ye=Ho.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}]:[]],y=n("cocso-checkbox",l,d,m),S=R=>{if(!s){let x;R===!0?x="on":R==="indeterminate"?x="intermediate":x="off",r(x)}};return(0,T.jsxs)("div",{className:"cocso-checkbox-wrapper",children:[(0,T.jsxs)(G.Root,{ref:p,id:o,className:y,checked:(()=>{switch(t){case"on":return!0;case"intermediate":return"indeterminate";case"off":default:return!1}})(),onCheckedChange:S,disabled:s,...c,children:[(0,T.jsx)(G.Indicator,{className:"cocso-checkbox-indicator",style:{opacity:t==="on"?1:0},children:(0,T.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,T.jsx)("path",{d:"M20 6 9 17l-5-5"})})}),(0,T.jsx)("div",{className:"cocso-checkbox-indicator",style:{opacity:t==="intermediate"?1:0},children:(0,T.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,T.jsx)("path",{d:"M5 12h14"})})})]}),i&&(0,T.jsx)(M,{className:n("cocso-checkbox-label",{disabled:s}),size:e,htmlFor:o,children:i})]})}),we=Object.assign(ye,{displayName:"Checkbox"});var Oo=f(require("react"),1);var g=require("react/jsx-runtime"),xe=Oo.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})]})}),Ne=Object.assign(xe,{displayName:"StockQuantityStatus"});var Bo=f(require("react"),1),K=f(require("@radix-ui/react-switch"),1);var B=require("react/jsx-runtime"),Te=Bo.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,B.jsxs)("div",{className:"cocso-switch-wrapper",children:[i==="left"&&(0,B.jsx)(M,{size:e,htmlFor:o,children:r}),(0,B.jsx)(K.Root,{ref:p,className:l,...c,children:(0,B.jsx)(K.Thumb,{className:d})}),i==="right"&&(0,B.jsx)(M,{size:e,htmlFor:o,children:r})]})}),ke=Object.assign(Te,{displayName:"Switch"});var H=f(require("@radix-ui/react-tabs"),1),V=require("react");var j=require("react/jsx-runtime"),Le=(0,V.forwardRef)(({className:o,...e},t)=>{let r=n("cocso-tab",{},[],o);return(0,j.jsx)(H.Root,{ref:t,className:r,...e})}),De=(0,V.forwardRef)(({className:o,...e},t)=>{let r=n("cocso-tab-list",{},[],o);return(0,j.jsx)(H.List,{ref:t,className:r,...e})}),Me=(0,V.forwardRef)(({className:o,...e},t)=>{let r=n("cocso-tab-trigger",{},[],o);return(0,j.jsx)(H.Trigger,{ref:t,className:r,...e})}),Se=(0,V.forwardRef)(({className:o,...e},t)=>{let r=n("cocso-tab-content",{},[],o);return(0,j.jsx)(H.Content,{ref:t,className:r,...e})}),We=Object.assign(Le,{List:De,Trigger:Me,Content:Se});var q=require("sonner"),Fe=Object.assign(q.Toaster,{displayName:"Toast"});
|
|
1
|
+
"use strict";var Io=Object.create;var _=Object.defineProperty;var Ao=Object.getOwnPropertyDescriptor;var zo=Object.getOwnPropertyNames;var Vo=Object.getPrototypeOf,jo=Object.prototype.hasOwnProperty;var Zo=(o,e)=>{for(var t in e)_(o,t,{get:e[t],enumerable:!0})},po=(o,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of zo(e))!jo.call(o,i)&&i!==t&&_(o,i,{get:()=>e[i],enumerable:!(r=Ao(e,i))||r.enumerable});return o};var f=(o,e,t)=>(t=o!=null?Io(Vo(o)):{},po(e||!o||!o.__esModule?_(t,"default",{value:o,enumerable:!0}):t,o)),$o=o=>po(_({},"__esModule",{value:!0}),o);var Oe={};Zo(Oe,{Accordion:()=>Ko,Body:()=>A,Button:()=>ee,Checkbox:()=>xe,Display:()=>re,Dropdown:()=>se,FileUpload:()=>me,Heading:()=>so,Label:()=>M,Link:()=>de,Modal:()=>ue,OneTimePasswordField:()=>Re,Pagination:()=>ye,Spinner:()=>to,StockQuantityStatus:()=>Te,Switch:()=>Le,Tab:()=>Fe,Toaster:()=>He,toast:()=>q.toast});module.exports=$o(Oe);var L=f(require("@radix-ui/react-accordion"),1),Q=require("react");var _o=(...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 _o(o,i,s,...r)};var fo=require("@radix-ui/react-slot"),F=require("react/jsx-runtime"),Qo=(0,Q.forwardRef)(({className:o,...e},t)=>{let r=n("cocso-accordion-item",{},[],o);return(0,F.jsx)(L.Item,{ref:t,className:r,...e})}),Uo=(0,Q.forwardRef)(({className:o,children:e,chevron:t=!0,...r},i)=>{let s=n("cocso-accordion-trigger",{},[],o);return(0,F.jsx)(L.Trigger,{ref:i,className:s,...r,children:(0,F.jsxs)(fo.Slottable,{children:[e,t&&(0,F.jsx)("div",{className:"cocso-accordion-chevron",children:(0,F.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,F.jsx)("path",{d:"m6 9 6 6 6-6"})})})]})})}),Go=(0,Q.forwardRef)(({className:o,...e},t)=>{let r=n("cocso-accordion-content",{},[],o);return(0,F.jsx)(L.Content,{ref:t,className:r,...e})}),Ko=Object.assign(L.Root,{Item:Qo,Header:L.Header,Trigger:Uo,Content:Go});var go=f(require("react"),1),Co=require("@radix-ui/react-slot");function b(o){if(o)return o.includes(".")?`var(--color-${o.replace(/\./g,"-")})`:o}var ho={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 ho?ho[o]:o}var uo=require("react/jsx-runtime"),qo=go.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,uo.jsx)(o?Co.Slot:"p",{ref:c,className:l,style:{"--cocso-body-color":b(t),"--cocso-body-weight":w(r),...s},...m})}),A=Object.assign(qo,{displayName:"Body"});var z=f(require("react"),1),Po=require("@radix-ui/react-slot");var vo=f(require("react"),1);var E=require("react/jsx-runtime"),Jo=["div"],Xo=vo.forwardRef(({as:o=Jo[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,E.jsx)(p,{ref:c,className:d,style:{"--cocso-spinner-bg":b(r),"--cocso-spinner-color":b(t),...s},...m,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"})]})})}),to=Object.assign(Xo,{displayName:"Spinner"});var ro=require("react/jsx-runtime"),Yo=o=>({"2xs":"xs",xs:"xs",sm:"xs",md:"sm",lg:"md",xl:"md"})[o],oe=z.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:y,...W},I)=>{let R=r||i,x=z.useCallback(k=>{if(R){k.preventDefault();return}d?.(k)},[R,d]),J=z.useCallback(k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),R||k.currentTarget.click()),y?.(k)},[R,y]),X={variant:e,size:t,loading:i,disabled:R},Y=[...r?[{variant:e,disabled:r}]:[],...i?[{variant:e,loading:i}]:[]],oo=n("cocso-button",X,Y,c),eo={"--cocso-button-color":b(s),"--cocso-button-weight":w(m),...p};return(0,ro.jsx)(o?Po.Slot:"button",{ref:I,className:oo,onClick:x,onKeyDown:J,role:"button",disabled:R,"aria-disabled":R,"aria-busy":i,style:eo,...W,children:i?(0,ro.jsx)(to,{className:"cocso-button-spinner",size:Yo(t),color:"currentColor"}):l})}),ee=Object.assign(oe,{displayName:"Button"});var Ro=f(require("react"),1),bo=require("@radix-ui/react-slot");var yo=require("react/jsx-runtime"),te=Ro.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,yo.jsx)(o?bo.Slot:"h1",{ref:c,className:l,style:{"--cocso-display-color":b(t),"--cocso-display-weight":w(r),...s},...m})}),re=Object.assign(te,{displayName:"Display"});var D=f(require("@radix-ui/react-dropdown-menu"),1),io=require("react");var no=require("react/jsx-runtime"),ie=(0,io.forwardRef)(({className:o,...e},t)=>{let r=n("cocso-dropdown-content",{},[],o);return(0,no.jsx)(D.Content,{ref:t,className:r,...e})}),ne=(0,io.forwardRef)(({className:o,...e},t)=>{let r=n("cocso-dropdown-item",{},[],o);return(0,no.jsx)(D.Item,{ref:t,className:r,...e})}),se=Object.assign(D.Root,{Trigger:D.Trigger,Portal:D.Portal,Content:ie,Item:ne});var To=f(require("react"),1),C=require("react");var wo=f(require("react"),1),xo=require("@radix-ui/react-slot");var No=require("react/jsx-runtime"),ae=wo.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,No.jsx)(o?xo.Slot:"label",{ref:c,className:l,style:{"--cocso-label-color":b(t),"--cocso-label-weight":w(r),...s},...m})}),M=Object.assign(ae,{displayName:"Label"});var h=require("react/jsx-runtime"),ce=To.forwardRef(({maxFiles:o=2,files:e,onFilesChange:t,onRemove:r,multiple:i=!0,accept:s,...m},c)=>{let[p,l]=(0,C.useState)(!1),d=(0,C.useRef)(null),y=(0,C.useRef)(null),W=3*1024*1024,I=(0,C.useCallback)(a=>s?s.split(",").map(N=>N.trim()).some(N=>{if(N.endsWith("/*")){let $=N.slice(0,-2);return a.type.startsWith($)}return a.type===N||a.name.toLowerCase().endsWith(N)}):!0,[s]),R=(0,C.useCallback)(a=>a.size>W?(alert(`${a.name}\uC740(\uB294) 3MB\uB97C \uCD08\uACFC\uD569\uB2C8\uB2E4.`),!1):!0,[]),x=(0,C.useCallback)(a=>{let N=Array.from(a).filter(O=>I(O)?R(O):(alert(`${O.name}\uC740(\uB294) \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uB294 \uD30C\uC77C \uD0C0\uC785\uC785\uB2C8\uB2E4.`),!1));if(N.length===0)return;let $=o-e.length;if($<=0){alert(`\uCD5C\uB300 ${o}\uAC1C\uC758 \uD30C\uC77C\uB9CC \uC5C5\uB85C\uB4DC\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.`);return}let Eo=N.slice(0,$).map(O=>({file:O,name:O.name,size:O.size}));t([...e,...Eo])},[e,o,t,I,R]),J=(0,C.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),l(!0)},[]),X=(0,C.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),y.current&&!y.current.contains(a.relatedTarget)&&l(!1)},[]),Y=(0,C.useCallback)(a=>{a.preventDefault(),a.stopPropagation()},[]),oo=(0,C.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),l(!1);let{files:S}=a.dataTransfer;S&&x(S)},[x]),eo=(0,C.useCallback)(a=>{let{files:S}=a.target;S&&x(S)},[x]),mo=(0,C.useCallback)(a=>{let S=e.filter(N=>N.name!==a);t(S),r?.(a)},[e,t,r]),k=(0,C.useCallback)(()=>{d.current?.click()},[]),lo=e.length>=o||!i&&e.length>=1;return(0,h.jsxs)("div",{className:"cocso-file-upload-wrapper",children:[!lo&&(0,h.jsxs)("div",{ref:y,onDragEnter:J,onDragOver:Y,onDragLeave:X,onDrop:oo,onClick:k,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:eo,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:()=>mo(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))})]})}),me=Object.assign(ce,{displayName:"FileUpload"});var ko=f(require("react"),1),Lo=require("@radix-ui/react-slot");var Do=require("react/jsx-runtime"),le=ko.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,Do.jsx)(o?Lo.Slot:"h2",{ref:c,className:l,style:{"--cocso-heading-color":b(t),"--cocso-heading-weight":w(r),...s},...m})}),so=Object.assign(le,{displayName:"Heading"});var Mo=f(require("react"),1),Wo=require("@radix-ui/react-slot");var So=require("react/jsx-runtime"),pe=Mo.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,So.jsx)(o?Wo.Slot:"a",{ref:c,className:l,style:{"--cocso-link-weight":w(t),...s},...m})}),de=Object.assign(pe,{displayName:"Link"});var u=f(require("@radix-ui/react-dialog"),1),V=require("react");var P=require("react/jsx-runtime"),fe=(0,V.forwardRef)(({className:o,children:e,...t},r)=>{let i=n("cocso-modal-content",{},[],o);return(0,P.jsxs)(u.Portal,{children:[(0,P.jsx)(u.Overlay,{className:"cocso-modal-overlay"}),(0,P.jsx)(u.Content,{ref:r,className:i,...t,children:e})]})}),he=(0,V.forwardRef)(({className:o,children:e,...t},r)=>{let i=n("cocso-modal-close-wrapper",{},[],o);return(0,P.jsx)("div",{className:i,...t,children:(0,P.jsx)(u.Close,{className:"cocso-modal-close",children:(0,P.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,P.jsx)("path",{d:"M18 6 6 18"}),(0,P.jsx)("path",{d:"m6 6 12 12"})]})})})}),ge=(0,V.forwardRef)(({className:o,children:e,...t},r)=>{let i=n("cocso-modal-title",{},[],o);return(0,P.jsx)(u.Title,{ref:r,className:i,asChild:!0,...t,children:(0,P.jsx)(so,{color:"text.basic",children:e})})}),Ce=(0,V.forwardRef)(({className:o,children:e,...t},r)=>{let i=n("cocso-modal-description",{},[],o);return(0,P.jsx)(u.Description,{ref:r,className:i,asChild:!0,...t,children:(0,P.jsx)(A,{size:"sm",color:"text.subtle",children:e})})}),ue=Object.assign(u.Root,{Trigger:u.Trigger,Content:fe,Close:he,Title:ge,Description:Ce});var U=f(require("@radix-ui/react-one-time-password-field"),1),ao=require("react");var co=require("react/jsx-runtime"),ve=(0,ao.forwardRef)(({className:o,...e},t)=>{let r=n("cocso-otp",{},[],o);return(0,co.jsx)(U.Root,{ref:t,className:r,...e})}),Pe=(0,ao.forwardRef)(({className:o,...e},t)=>{let r=n("cocso-otp-input",{},[],o);return(0,co.jsx)(U.Input,{ref:t,className:r,...e})}),Re=Object.assign(ve,{Input:Pe});var Fo=f(require("react"),1);var v=require("react/jsx-runtime"),be=Fo.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,y)=>p(y+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,y)=>{let W=e-c+y+1;return W>1&&W<t?p(W):""}),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"})})})]})}),ye=Object.assign(be,{displayName:"Pagination"});var Ho=f(require("react"),1),G=f(require("@radix-ui/react-checkbox"),1);var T=require("react/jsx-runtime"),we=Ho.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}]:[]],y=n("cocso-checkbox",l,d,m),W=R=>{if(!s){let x;R===!0?x="on":R==="indeterminate"?x="intermediate":x="off",r(x)}};return(0,T.jsxs)("div",{className:"cocso-checkbox-wrapper",children:[(0,T.jsxs)(G.Root,{ref:p,id:o,className:y,checked:(()=>{switch(t){case"on":return!0;case"intermediate":return"indeterminate";case"off":default:return!1}})(),onCheckedChange:W,disabled:s,...c,children:[(0,T.jsx)(G.Indicator,{className:"cocso-checkbox-indicator",style:{opacity:t==="on"?1:0},children:(0,T.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,T.jsx)("path",{d:"M20 6 9 17l-5-5"})})}),(0,T.jsx)("div",{className:"cocso-checkbox-indicator",style:{opacity:t==="intermediate"?1:0},children:(0,T.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,T.jsx)("path",{d:"M5 12h14"})})})]}),i&&(0,T.jsx)(M,{className:n("cocso-checkbox-label",{disabled:s}),size:e,htmlFor:o,children:i})]})}),xe=Object.assign(we,{displayName:"Checkbox"});var Oo=f(require("react"),1);var g=require("react/jsx-runtime"),Ne=Oo.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})]})}),Te=Object.assign(Ne,{displayName:"StockQuantityStatus"});var Bo=f(require("react"),1),K=f(require("@radix-ui/react-switch"),1);var B=require("react/jsx-runtime"),ke=Bo.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,B.jsxs)("div",{className:"cocso-switch-wrapper",children:[i==="left"&&(0,B.jsx)(M,{size:e,htmlFor:o,children:r}),(0,B.jsx)(K.Root,{ref:p,className:l,...c,children:(0,B.jsx)(K.Thumb,{className:d})}),i==="right"&&(0,B.jsx)(M,{size:e,htmlFor:o,children:r})]})}),Le=Object.assign(ke,{displayName:"Switch"});var H=f(require("@radix-ui/react-tabs"),1),j=require("react");var Z=require("react/jsx-runtime"),De=(0,j.forwardRef)(({className:o,...e},t)=>{let r=n("cocso-tab",{},[],o);return(0,Z.jsx)(H.Root,{ref:t,className:r,...e})}),Me=(0,j.forwardRef)(({className:o,...e},t)=>{let r=n("cocso-tab-list",{},[],o);return(0,Z.jsx)(H.List,{ref:t,className:r,...e})}),We=(0,j.forwardRef)(({className:o,...e},t)=>{let r=n("cocso-tab-trigger",{},[],o);return(0,Z.jsx)(H.Trigger,{ref:t,className:r,...e})}),Se=(0,j.forwardRef)(({className:o,...e},t)=>{let r=n("cocso-tab-content",{},[],o);return(0,Z.jsx)(H.Content,{ref:t,className:r,...e})}),Fe=Object.assign(De,{List:Me,Trigger:We,Content:Se});var q=require("sonner"),He=Object.assign(q.Toaster,{displayName:"Toast"});
|
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as y from"@radix-ui/react-accordion";import{forwardRef as X}from"react";var Lo=(...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 Lo(e,i,s,...r)};import{Slottable as Do}from"@radix-ui/react-slot";import{jsx as H,jsxs as Fo}from"react/jsx-runtime";var Mo=X(({className:e,...o},t)=>{let r=n("cocso-accordion-item",{},[],e);return H(y.Item,{ref:t,className:r,...o})}),So=X(({className:e,children:o,chevron:t=!0,...r},i)=>{let s=n("cocso-accordion-trigger",{},[],e);return H(y.Trigger,{ref:i,className:s,...r,children:Fo(Do,{children:[o,t&&H("div",{className:"cocso-accordion-chevron",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:H("path",{d:"m6 9 6 6 6-6"})})})]})})}),Wo=X(({className:e,...o},t)=>{let r=n("cocso-accordion-content",{},[],e);return H(y.Content,{ref:t,className:r,...o})}),ke=Object.assign(y.Root,{Item:Mo,Header:y.Header,Trigger:So,Content:Wo});import*as no from"react";import{Slot as Ho}from"@radix-ui/react-slot";function g(e){if(e)return e.includes(".")?`var(--color-${e.replace(/\./g,"-")})`:e}var io={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 io?io[e]:e}import{jsx as Bo}from"react/jsx-runtime";var Oo=no.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 Bo(e?Ho:"p",{ref:c,className:l,style:{"--cocso-body-color":g(t),"--cocso-body-weight":C(r),...s},...m})}),A=Object.assign(Oo,{displayName:"Body"});import*as E from"react";import{Slot as zo}from"@radix-ui/react-slot";import*as so from"react";import{jsx as Y,jsxs as Ao}from"react/jsx-runtime";var Eo=["div"],Io=so.forwardRef(({as:e=Eo[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 Y(p,{ref:c,className:d,style:{"--cocso-spinner-bg":g(r),"--cocso-spinner-color":g(t),...s},...m,children:Ao("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Y("circle",{className:"opacity-25",cx:"12",cy:"12",r:"9",stroke:"var(--cocso-spinner-bg, currentColor)",strokeWidth:"3"}),Y("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"})]})})}),ao=Object.assign(Io,{displayName:"Spinner"});import{jsx as co}from"react/jsx-runtime";var Vo=e=>({"2xs":"xs",xs:"xs",sm:"xs",md:"sm",lg:"md",xl:"md"})[e],jo=E.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,...N},B)=>{let h=r||i,v=E.useCallback(b=>{if(h){b.preventDefault();return}d?.(b)},[h,d]),U=E.useCallback(b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),h||b.currentTarget.click()),u?.(b)},[h,u]),G={variant:o,size:t,loading:i,disabled:h},K=[...r?[{variant:o,disabled:r}]:[],...i?[{variant:o,loading:i}]:[]],q=n("cocso-button",G,K,c),J={"--cocso-button-color":g(s),"--cocso-button-weight":C(m),...p};return co(e?zo:"button",{ref:B,className:q,onClick:v,onKeyDown:U,role:"button",disabled:h,"aria-disabled":h,"aria-busy":i,style:J,...N,children:i?co(ao,{className:"cocso-button-spinner",size:Vo(t),color:"currentColor"}):l})}),qe=Object.assign(jo,{displayName:"Button"});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,weight:r="bold",className:i,style:s,...m},c)=>{let l=n("cocso-display",{size:o},[],i);return _o(e?Zo:"h1",{ref:c,className:l,style:{"--cocso-display-color":g(t),"--cocso-display-weight":C(r),...s},...m})}),it=Object.assign($o,{displayName:"Display"});import*as w from"@radix-ui/react-dropdown-menu";import{forwardRef as lo}from"react";import{jsx as po}from"react/jsx-runtime";var Qo=lo(({className:e,...o},t)=>{let r=n("cocso-dropdown-content",{},[],e);return po(w.Content,{ref:t,className:r,...o})}),Uo=lo(({className:e,...o},t)=>{let r=n("cocso-dropdown-item",{},[],e);return po(w.Item,{ref:t,className:r,...o})}),ft=Object.assign(w.Root,{Trigger:w.Trigger,Portal:w.Portal,Content:Qo,Item:Uo});import*as go from"react";import{useRef as ho,useState as Jo,useCallback as x}from"react";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="text.basic",weight:r="normal",className:i,style:s,...m},c)=>{let l=n("cocso-label",{size:o},[],i);return qo(e?Go:"label",{ref:c,className:l,style:{"--cocso-label-color":g(t),"--cocso-label-weight":C(r),...s},...m})}),k=Object.assign(Ko,{displayName:"Label"});import{jsx as L,jsxs as O}from"react/jsx-runtime";var Xo=go.forwardRef(({maxFiles:e=2,files:o,onFilesChange:t,onRemove:r,multiple:i=!0,accept:s,...m},c)=>{let[p,l]=Jo(!1),d=ho(null),u=ho(null),N=3*1024*1024,B=x(a=>s?s.split(",").map(P=>P.trim()).some(P=>{if(P.endsWith("/*")){let I=P.slice(0,-2);return a.type.startsWith(I)}return a.type===P||a.name.toLowerCase().endsWith(P)}):!0,[s]),h=x(a=>a.size>N?(alert(`${a.name}\uC740(\uB294) 3MB\uB97C \uCD08\uACFC\uD569\uB2C8\uB2E4.`),!1):!0,[]),v=x(a=>{let P=Array.from(a).filter(W=>B(W)?h(W):(alert(`${W.name}\uC740(\uB294) \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uB294 \uD30C\uC77C \uD0C0\uC785\uC785\uB2C8\uB2E4.`),!1));if(P.length===0)return;let I=e-o.length;if(I<=0){alert(`\uCD5C\uB300 ${e}\uAC1C\uC758 \uD30C\uC77C\uB9CC \uC5C5\uB85C\uB4DC\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.`);return}let ko=P.slice(0,I).map(W=>({file:W,name:W.name,size:W.size}));t([...o,...ko])},[o,e,t,B,h]),U=x(a=>{a.preventDefault(),a.stopPropagation(),l(!0)},[]),G=x(a=>{a.preventDefault(),a.stopPropagation(),u.current&&!u.current.contains(a.relatedTarget)&&l(!1)},[]),K=x(a=>{a.preventDefault(),a.stopPropagation()},[]),q=x(a=>{a.preventDefault(),a.stopPropagation(),l(!1);let{files:T}=a.dataTransfer;T&&v(T)},[v]),J=x(a=>{let{files:T}=a.target;T&&v(T)},[v]),to=x(a=>{let T=o.filter(P=>P.name!==a);t(T),r?.(a)},[o,t,r]),b=x(()=>{d.current?.click()},[]),ro=o.length>=e||!i&&o.length>=1;return O("div",{className:"cocso-file-upload-wrapper",children:[!ro&&O("div",{ref:u,onDragEnter:U,onDragOver:K,onDragLeave:G,onDrop:q,onClick:b,className:"cocso-file-upload","data-drag-active":p,children:[L("input",{ref:a=>{d.current=a,typeof c=="function"?c(a):c&&(c.current=a)},type:"file",onChange:J,multiple:i,accept:s,style:{display:"none"},...m}),O(k,{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",L("br",{}),"(\uCD5C\uB300 3MB)"]}),O("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:[L("path",{d:"M5 12h14"}),L("path",{d:"M12 5v14"})]})]}),o.length>0&&L("div",{className:"cocso-file-upload-list",children:o.map(a=>O("div",{className:"cocso-file-upload-item",children:[L(A,{size:"xs",children:a.name}),L("button",{type:"button",onClick:()=>to(a.name),className:"cocso-file-upload-remove",children:O("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"})]})})]},a.name))})]})}),Lt=Object.assign(Xo,{displayName:"FileUpload"});import*as uo from"react";import{Slot as Yo}from"@radix-ui/react-slot";import{jsx as ee}from"react/jsx-runtime";var oe=uo.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 ee(e?Yo:"h2",{ref:c,className:l,style:{"--cocso-heading-color":g(t),"--cocso-heading-weight":C(r),...s},...m})}),Co=Object.assign(oe,{displayName:"Heading"});import*as vo from"react";import{Slot as te}from"@radix-ui/react-slot";import{jsx as ie}from"react/jsx-runtime";var re=vo.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 ie(e?te:"a",{ref:c,className:l,style:{"--cocso-link-weight":C(t),...s},...m})}),Zt=Object.assign(re,{displayName:"Link"});import*as f from"@radix-ui/react-dialog";import{forwardRef as eo}from"react";import{jsx as D,jsxs as oo}from"react/jsx-runtime";var ne=eo(({className:e,children:o,...t},r)=>{let i=n("cocso-modal-content",{},[],e);return oo(f.Portal,{children:[D(f.Overlay,{className:"cocso-modal-overlay"}),oo(f.Content,{ref:r,className:i,...t,children:[D("div",{className:"cocso-modal-close-wrapper",children:D(f.Close,{className:"cocso-modal-close",children:oo("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:"M18 6 6 18"}),D("path",{d:"m6 6 12 12"})]})})}),o]})]})}),se=eo(({className:e,children:o,...t},r)=>{let i=n("cocso-modal-title",{},[],e);return D(f.Title,{ref:r,className:i,asChild:!0,...t,children:D(Co,{color:"text.basic",children:o})})}),ae=eo(({className:e,children:o,...t},r)=>{let i=n("cocso-modal-description",{},[],e);return D(f.Description,{ref:r,className:i,asChild:!0,...t,children:D(A,{size:"sm",color:"text.subtle",children:o})})}),or=Object.assign(f.Root,{Trigger:f.Trigger,Content:ne,Title:se,Description:ae});import*as z from"@radix-ui/react-one-time-password-field";import{forwardRef as Po}from"react";import{jsx as Ro}from"react/jsx-runtime";var ce=Po(({className:e,...o},t)=>{let r=n("cocso-otp",{},[],e);return Ro(z.Root,{ref:t,className:r,...o})}),me=Po(({className:e,...o},t)=>{let r=n("cocso-otp-input",{},[],e);return Ro(z.Input,{ref:t,className:r,...o})}),mr=Object.assign(ce,{Input:me});import*as yo from"react";import{Fragment as pe,jsx as M,jsxs as bo}from"react/jsx-runtime";var le=yo.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 bo("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)):bo(pe,{children:[p(1),o>1+c&&M("span",{className:"cocso-pagination-trunc",children:"..."}),Array(r).fill(0).map((d,u)=>{let N=o-c+u+1;return N>1&&N<t?p(N):""}),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"})})})]})}),gr=Object.assign(le,{displayName:"Pagination"});import*as xo from"react";import*as V from"@radix-ui/react-checkbox";import{jsx as F,jsxs as wo}from"react/jsx-runtime";var de=xo.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),N=h=>{if(!s){let v;h===!0?v="on":h==="indeterminate"?v="intermediate":v="off",r(v)}};return wo("div",{className:"cocso-checkbox-wrapper",children:[wo(V.Root,{ref:p,id:e,className:u,checked:(()=>{switch(t){case"on":return!0;case"intermediate":return"indeterminate";case"off":default:return!1}})(),onCheckedChange:N,disabled:s,...c,children:[F(V.Indicator,{className:"cocso-checkbox-indicator",style:{opacity:t==="on"?1:0},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:"M20 6 9 17l-5-5"})})}),F("div",{className:"cocso-checkbox-indicator",style:{opacity:t==="intermediate"?1:0},children:F("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:F("path",{d:"M5 12h14"})})})]}),i&&F(k,{className:n("cocso-checkbox-label",{disabled:s}),size:o,htmlFor:e,children:i})]})}),yr=Object.assign(de,{displayName:"Checkbox"});import*as No from"react";import{jsx as R,jsxs as j}from"react/jsx-runtime";var fe=No.forwardRef(({quantity:e,className:o,onChange:t,...r},i)=>{let s=n("cocso-stock-quantity-status",{},[],o);return j("div",{ref:i,className:s,"data-status":e,...r,children:[R("span",{className:"cocso-stock-quantity-status-indicator",children:e==="\uC5EC\uC720"?j("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[R("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"}),R("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"}),R("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"?j("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[R("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"}),R("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"}),R("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"})]}):j("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[R("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"}),R("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"}),R("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"})]})}),R(k,{size:"sm",color:"currentColor",children:e})]})}),Dr=Object.assign(fe,{displayName:"StockQuantityStatus"});import*as To from"react";import*as $ from"@radix-ui/react-switch";import{jsx as Z,jsxs as ge}from"react/jsx-runtime";var he=To.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 ge("div",{className:"cocso-switch-wrapper",children:[i==="left"&&Z(k,{size:o,htmlFor:e,children:r}),Z($.Root,{ref:p,className:l,...c,children:Z($.Thumb,{className:d})}),i==="right"&&Z(k,{size:o,htmlFor:e,children:r})]})}),Br=Object.assign(he,{displayName:"Switch"});import*as S from"@radix-ui/react-tabs";import{forwardRef as _}from"react";import{jsx as Q}from"react/jsx-runtime";var ue=_(({className:e,...o},t)=>{let r=n("cocso-tab",{},[],e);return Q(S.Root,{ref:t,className:r,...o})}),Ce=_(({className:e,...o},t)=>{let r=n("cocso-tab-list",{},[],e);return Q(S.List,{ref:t,className:r,...o})}),ve=_(({className:e,...o},t)=>{let r=n("cocso-tab-trigger",{},[],e);return Q(S.Trigger,{ref:t,className:r,...o})}),Pe=_(({className:e,...o},t)=>{let r=n("cocso-tab-content",{},[],e);return Q(S.Content,{ref:t,className:r,...o})}),_r=Object.assign(ue,{List:Ce,Trigger:ve,Content:Pe});import{Toaster as Re,toast as Jr}from"sonner";var Xr=Object.assign(Re,{displayName:"Toast"});export{ke as Accordion,A as Body,qe as Button,yr as Checkbox,it as Display,ft as Dropdown,Lt as FileUpload,Co as Heading,k as Label,Zt as Link,or as Modal,mr as OneTimePasswordField,gr as Pagination,ao as Spinner,Dr as StockQuantityStatus,Br as Switch,_r as Tab,Xr as Toaster,Jr as toast};
|
|
1
|
+
import*as y from"@radix-ui/react-accordion";import{forwardRef as Y}from"react";var Lo=(...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 Lo(o,i,s,...r)};import{Slottable as Do}from"@radix-ui/react-slot";import{jsx as H,jsxs as Fo}from"react/jsx-runtime";var Mo=Y(({className:o,...e},t)=>{let r=n("cocso-accordion-item",{},[],o);return H(y.Item,{ref:t,className:r,...e})}),Wo=Y(({className:o,children:e,chevron:t=!0,...r},i)=>{let s=n("cocso-accordion-trigger",{},[],o);return H(y.Trigger,{ref:i,className:s,...r,children:Fo(Do,{children:[e,t&&H("div",{className:"cocso-accordion-chevron",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:H("path",{d:"m6 9 6 6 6-6"})})})]})})}),So=Y(({className:o,...e},t)=>{let r=n("cocso-accordion-content",{},[],o);return H(y.Content,{ref:t,className:r,...e})}),Le=Object.assign(y.Root,{Item:Mo,Header:y.Header,Trigger:Wo,Content:So});import*as io from"react";import{Slot as Ho}from"@radix-ui/react-slot";function g(o){if(o)return o.includes(".")?`var(--color-${o.replace(/\./g,"-")})`:o}var ro={thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"};function u(o){if(o)return o in ro?ro[o]:o}import{jsx as Bo}from"react/jsx-runtime";var Oo=io.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 Bo(o?Ho:"p",{ref:c,className:l,style:{"--cocso-body-color":g(t),"--cocso-body-weight":u(r),...s},...m})}),A=Object.assign(Oo,{displayName:"Body"});import*as E from"react";import{Slot as zo}from"@radix-ui/react-slot";import*as no from"react";import{jsx as oo,jsxs as Ao}from"react/jsx-runtime";var Eo=["div"],Io=no.forwardRef(({as:o=Eo[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 oo(p,{ref:c,className:d,style:{"--cocso-spinner-bg":g(r),"--cocso-spinner-color":g(t),...s},...m,children:Ao("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[oo("circle",{className:"opacity-25",cx:"12",cy:"12",r:"9",stroke:"var(--cocso-spinner-bg, currentColor)",strokeWidth:"3"}),oo("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(Io,{displayName:"Spinner"});import{jsx as ao}from"react/jsx-runtime";var Vo=o=>({"2xs":"xs",xs:"xs",sm:"xs",md:"sm",lg:"md",xl:"md"})[o],jo=E.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:C,...T},B)=>{let h=r||i,v=E.useCallback(b=>{if(h){b.preventDefault();return}d?.(b)},[h,d]),G=E.useCallback(b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),h||b.currentTarget.click()),C?.(b)},[h,C]),K={variant:e,size:t,loading:i,disabled:h},q=[...r?[{variant:e,disabled:r}]:[],...i?[{variant:e,loading:i}]:[]],J=n("cocso-button",K,q,c),X={"--cocso-button-color":g(s),"--cocso-button-weight":u(m),...p};return ao(o?zo:"button",{ref:B,className:J,onClick:v,onKeyDown:G,role:"button",disabled:h,"aria-disabled":h,"aria-busy":i,style:X,...T,children:i?ao(so,{className:"cocso-button-spinner",size:Vo(t),color:"currentColor"}):l})}),Je=Object.assign(jo,{displayName:"Button"});import*as co from"react";import{Slot as Zo}from"@radix-ui/react-slot";import{jsx as _o}from"react/jsx-runtime";var $o=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 _o(o?Zo:"h1",{ref:c,className:l,style:{"--cocso-display-color":g(t),"--cocso-display-weight":u(r),...s},...m})}),nt=Object.assign($o,{displayName:"Display"});import*as w from"@radix-ui/react-dropdown-menu";import{forwardRef as mo}from"react";import{jsx as lo}from"react/jsx-runtime";var Qo=mo(({className:o,...e},t)=>{let r=n("cocso-dropdown-content",{},[],o);return lo(w.Content,{ref:t,className:r,...e})}),Uo=mo(({className:o,...e},t)=>{let r=n("cocso-dropdown-item",{},[],o);return lo(w.Item,{ref:t,className:r,...e})}),ht=Object.assign(w.Root,{Trigger:w.Trigger,Portal:w.Portal,Content:Qo,Item:Uo});import*as ho from"react";import{useRef as fo,useState as Jo,useCallback as x}from"react";import*as po from"react";import{Slot as Go}from"@radix-ui/react-slot";import{jsx as qo}from"react/jsx-runtime";var Ko=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 qo(o?Go:"label",{ref:c,className:l,style:{"--cocso-label-color":g(t),"--cocso-label-weight":u(r),...s},...m})}),L=Object.assign(Ko,{displayName:"Label"});import{jsx as D,jsxs as O}from"react/jsx-runtime";var Xo=ho.forwardRef(({maxFiles:o=2,files:e,onFilesChange:t,onRemove:r,multiple:i=!0,accept:s,...m},c)=>{let[p,l]=Jo(!1),d=fo(null),C=fo(null),T=3*1024*1024,B=x(a=>s?s.split(",").map(P=>P.trim()).some(P=>{if(P.endsWith("/*")){let I=P.slice(0,-2);return a.type.startsWith(I)}return a.type===P||a.name.toLowerCase().endsWith(P)}):!0,[s]),h=x(a=>a.size>T?(alert(`${a.name}\uC740(\uB294) 3MB\uB97C \uCD08\uACFC\uD569\uB2C8\uB2E4.`),!1):!0,[]),v=x(a=>{let P=Array.from(a).filter(S=>B(S)?h(S):(alert(`${S.name}\uC740(\uB294) \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uB294 \uD30C\uC77C \uD0C0\uC785\uC785\uB2C8\uB2E4.`),!1));if(P.length===0)return;let I=o-e.length;if(I<=0){alert(`\uCD5C\uB300 ${o}\uAC1C\uC758 \uD30C\uC77C\uB9CC \uC5C5\uB85C\uB4DC\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.`);return}let ko=P.slice(0,I).map(S=>({file:S,name:S.name,size:S.size}));t([...e,...ko])},[e,o,t,B,h]),G=x(a=>{a.preventDefault(),a.stopPropagation(),l(!0)},[]),K=x(a=>{a.preventDefault(),a.stopPropagation(),C.current&&!C.current.contains(a.relatedTarget)&&l(!1)},[]),q=x(a=>{a.preventDefault(),a.stopPropagation()},[]),J=x(a=>{a.preventDefault(),a.stopPropagation(),l(!1);let{files:k}=a.dataTransfer;k&&v(k)},[v]),X=x(a=>{let{files:k}=a.target;k&&v(k)},[v]),eo=x(a=>{let k=e.filter(P=>P.name!==a);t(k),r?.(a)},[e,t,r]),b=x(()=>{d.current?.click()},[]),to=e.length>=o||!i&&e.length>=1;return O("div",{className:"cocso-file-upload-wrapper",children:[!to&&O("div",{ref:C,onDragEnter:G,onDragOver:q,onDragLeave:K,onDrop:J,onClick:b,className:"cocso-file-upload","data-drag-active":p,children:[D("input",{ref:a=>{d.current=a,typeof c=="function"?c(a):c&&(c.current=a)},type:"file",onChange:X,multiple:i,accept:s,style:{display:"none"},...m}),O(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",D("br",{}),"(\uCD5C\uB300 3MB)"]}),O("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:[D("path",{d:"M5 12h14"}),D("path",{d:"M12 5v14"})]})]}),e.length>0&&D("div",{className:"cocso-file-upload-list",children:e.map(a=>O("div",{className:"cocso-file-upload-item",children:[D(A,{size:"xs",children:a.name}),D("button",{type:"button",onClick:()=>eo(a.name),className:"cocso-file-upload-remove",children:O("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:"M18 6 6 18"}),D("path",{d:"m6 6 12 12"})]})})]},a.name))})]})}),Dt=Object.assign(Xo,{displayName:"FileUpload"});import*as go from"react";import{Slot as Yo}from"@radix-ui/react-slot";import{jsx as ee}from"react/jsx-runtime";var oe=go.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 ee(o?Yo:"h2",{ref:c,className:l,style:{"--cocso-heading-color":g(t),"--cocso-heading-weight":u(r),...s},...m})}),Co=Object.assign(oe,{displayName:"Heading"});import*as uo from"react";import{Slot as te}from"@radix-ui/react-slot";import{jsx as ie}from"react/jsx-runtime";var re=uo.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 ie(o?te:"a",{ref:c,className:l,style:{"--cocso-link-weight":u(t),...s},...m})}),$t=Object.assign(re,{displayName:"Link"});import*as f from"@radix-ui/react-dialog";import{forwardRef as z}from"react";import{jsx as N,jsxs as vo}from"react/jsx-runtime";var ne=z(({className:o,children:e,...t},r)=>{let i=n("cocso-modal-content",{},[],o);return vo(f.Portal,{children:[N(f.Overlay,{className:"cocso-modal-overlay"}),N(f.Content,{ref:r,className:i,...t,children:e})]})}),se=z(({className:o,children:e,...t},r)=>{let i=n("cocso-modal-close-wrapper",{},[],o);return N("div",{className:i,...t,children:N(f.Close,{className:"cocso-modal-close",children:vo("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"})]})})})}),ae=z(({className:o,children:e,...t},r)=>{let i=n("cocso-modal-title",{},[],o);return N(f.Title,{ref:r,className:i,asChild:!0,...t,children:N(Co,{color:"text.basic",children:e})})}),ce=z(({className:o,children:e,...t},r)=>{let i=n("cocso-modal-description",{},[],o);return N(f.Description,{ref:r,className:i,asChild:!0,...t,children:N(A,{size:"sm",color:"text.subtle",children:e})})}),er=Object.assign(f.Root,{Trigger:f.Trigger,Content:ne,Close:se,Title:ae,Description:ce});import*as V from"@radix-ui/react-one-time-password-field";import{forwardRef as Po}from"react";import{jsx as Ro}from"react/jsx-runtime";var me=Po(({className:o,...e},t)=>{let r=n("cocso-otp",{},[],o);return Ro(V.Root,{ref:t,className:r,...e})}),le=Po(({className:o,...e},t)=>{let r=n("cocso-otp-input",{},[],o);return Ro(V.Input,{ref:t,className:r,...e})}),lr=Object.assign(me,{Input:le});import*as yo from"react";import{Fragment as de,jsx as M,jsxs as bo}from"react/jsx-runtime";var pe=yo.forwardRef(({className:o,page:e,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":e===d,children:d},d),l=n("cocso-pagination",{},[],o);return bo("div",{ref:m,className:l,...s,children:[t>1&&M("button",{className:"cocso-pagination-arrow",disabled:e===1,onClick:()=>e>1&&i(e-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,C)=>p(C+1)):bo(de,{children:[p(1),e>1+c&&M("span",{className:"cocso-pagination-trunc",children:"..."}),Array(r).fill(0).map((d,C)=>{let T=e-c+C+1;return T>1&&T<t?p(T):""}),e<t-c&&M("span",{className:"cocso-pagination-trunc",children:"..."}),p(t)]}),t>1&&M("button",{className:"cocso-pagination-arrow",disabled:e===t,onClick:()=>e<t&&i(e+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"})})})]})}),Cr=Object.assign(pe,{displayName:"Pagination"});import*as xo from"react";import*as j from"@radix-ui/react-checkbox";import{jsx as F,jsxs as wo}from"react/jsx-runtime";var fe=xo.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}]:[]],C=n("cocso-checkbox",l,d,m),T=h=>{if(!s){let v;h===!0?v="on":h==="indeterminate"?v="intermediate":v="off",r(v)}};return wo("div",{className:"cocso-checkbox-wrapper",children:[wo(j.Root,{ref:p,id:o,className:C,checked:(()=>{switch(t){case"on":return!0;case"intermediate":return"indeterminate";case"off":default:return!1}})(),onCheckedChange:T,disabled:s,...c,children:[F(j.Indicator,{className:"cocso-checkbox-indicator",style:{opacity:t==="on"?1:0},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:"M20 6 9 17l-5-5"})})}),F("div",{className:"cocso-checkbox-indicator",style:{opacity:t==="intermediate"?1:0},children:F("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:F("path",{d:"M5 12h14"})})})]}),i&&F(L,{className:n("cocso-checkbox-label",{disabled:s}),size:e,htmlFor:o,children:i})]})}),wr=Object.assign(fe,{displayName:"Checkbox"});import*as No from"react";import{jsx as R,jsxs as Z}from"react/jsx-runtime";var he=No.forwardRef(({quantity:o,className:e,onChange:t,...r},i)=>{let s=n("cocso-stock-quantity-status",{},[],e);return Z("div",{ref:i,className:s,"data-status":o,...r,children:[R("span",{className:"cocso-stock-quantity-status-indicator",children:o==="\uC5EC\uC720"?Z("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[R("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"}),R("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"}),R("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"?Z("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[R("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"}),R("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"}),R("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"})]}):Z("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[R("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"}),R("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"}),R("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"})]})}),R(L,{size:"sm",color:"currentColor",children:o})]})}),Mr=Object.assign(he,{displayName:"StockQuantityStatus"});import*as To from"react";import*as _ from"@radix-ui/react-switch";import{jsx as $,jsxs as Ce}from"react/jsx-runtime";var ge=To.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 Ce("div",{className:"cocso-switch-wrapper",children:[i==="left"&&$(L,{size:e,htmlFor:o,children:r}),$(_.Root,{ref:p,className:l,...c,children:$(_.Thumb,{className:d})}),i==="right"&&$(L,{size:e,htmlFor:o,children:r})]})}),Er=Object.assign(ge,{displayName:"Switch"});import*as W from"@radix-ui/react-tabs";import{forwardRef as Q}from"react";import{jsx as U}from"react/jsx-runtime";var ue=Q(({className:o,...e},t)=>{let r=n("cocso-tab",{},[],o);return U(W.Root,{ref:t,className:r,...e})}),ve=Q(({className:o,...e},t)=>{let r=n("cocso-tab-list",{},[],o);return U(W.List,{ref:t,className:r,...e})}),Pe=Q(({className:o,...e},t)=>{let r=n("cocso-tab-trigger",{},[],o);return U(W.Trigger,{ref:t,className:r,...e})}),Re=Q(({className:o,...e},t)=>{let r=n("cocso-tab-content",{},[],o);return U(W.Content,{ref:t,className:r,...e})}),Qr=Object.assign(ue,{List:ve,Trigger:Pe,Content:Re});import{Toaster as be,toast as Xr}from"sonner";var Yr=Object.assign(be,{displayName:"Toast"});export{Le as Accordion,A as Body,Je as Button,wr as Checkbox,nt as Display,ht as Dropdown,Dt as FileUpload,Co as Heading,L as Label,$t as Link,er as Modal,lr as OneTimePasswordField,Cr as Pagination,so as Spinner,Mr as StockQuantityStatus,Er as Switch,Qr as Tab,Yr as Toaster,Xr as toast};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocso-ui/react",
|
|
3
|
-
"version": "0.0.1-beta.
|
|
3
|
+
"version": "0.0.1-beta.46",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/cocso/cocso-ui.git",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/react": "^19.1.8",
|
|
44
44
|
"@types/react-dom": "^19.1.6",
|
|
45
|
-
"esbuild": "^0.25.
|
|
45
|
+
"esbuild": "^0.25.8",
|
|
46
46
|
"typescript": "^5.8.3"
|
|
47
47
|
},
|
|
48
48
|
"publishConfig": {
|