@cocso-ui/react 0.1.8 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var So=Object.create;var G=Object.defineProperty;var Ro=Object.getOwnPropertyDescriptor;var zo=Object.getOwnPropertyNames;var To=Object.getPrototypeOf,Ho=Object.prototype.hasOwnProperty;var Wo=(t,o)=>{for(var e in o)G(t,e,{get:o[e],enumerable:!0})},Ht=(t,o,e,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let s of zo(o))!Ho.call(t,s)&&s!==e&&G(t,s,{get:()=>o[s],enumerable:!(r=Ro(o,s))||r.enumerable});return t};var R=(t,o,e)=>(e=t!=null?So(To(t)):{},Ht(o||!t||!t.__esModule?G(e,"default",{value:t,enumerable:!0}):e,t)),Bo=t=>Ht(G({},"__esModule",{value:!0}),t);var Ze={};Wo(Ze,{Accordion:()=>No,Body:()=>v,Button:()=>qo,Checkbox:()=>te,Display:()=>ie,Dropdown:()=>pe,Heading:()=>yt,Link:()=>he,Modal:()=>we,OneTimePasswordField:()=>Ce,Pagination:()=>ke,Popover:()=>ze,Select:()=>He,Spinner:()=>lt,StockQuantityStatus:()=>Le,Switch:()=>Me,Tab:()=>Ee,Toaster:()=>ct.Toaster,Typography:()=>W,colors:()=>i,fontSize:()=>E,fontWeight:()=>Z,getColor:()=>bo,lineHeight:()=>pt,spacing:()=>n,toast:()=>ct.toast});module.exports=Bo(Ze);var Wt=require("@cocso-ui/react-icons"),b=R(require("@radix-ui/react-accordion"),1),J=require("clsx"),U=require("react");var V={item:"C",content:"c","slide-down":"g","slide-up":"b",trigger:"s",chevron:"d"};var M=require("react/jsx-runtime"),Fo=(0,U.forwardRef)(({className:t,...o},e)=>(0,M.jsx)(b.Item,{ref:e,className:(0,J.clsx)(V.item,t),...o})),Mo=(0,U.forwardRef)(({className:t,children:o,chevron:e=!0,...r},s)=>(0,M.jsxs)(b.Trigger,{ref:s,className:(0,J.clsx)(V.trigger,t),...r,children:[o,e&&(0,M.jsx)(Wt.KeyboardArrowDownIcon,{className:V.chevron})]})),Do=(0,U.forwardRef)(({className:t,...o},e)=>(0,M.jsx)(b.Content,{ref:e,className:(0,J.clsx)(V.content,t),...o})),No=Object.assign(b.Root,{Item:Fo,Header:b.Header,Trigger:Mo,Content:Do});var At=require("react"),Ot=require("ts-pattern");var Lt=require("@radix-ui/react-primitive"),Ft=require("@radix-ui/react-slot"),Mt=require("clsx"),Dt=require("react");var i={transparent:"var(--ds-transparent)",white:"var(--ds-white)",whiteAlpha5:"var(--ds-white-alpha-5)",whiteAlpha10:"var(--ds-white-alpha-10)",whiteAlpha20:"var(--ds-white-alpha-20)",whiteAlpha30:"var(--ds-white-alpha-30)",whiteAlpha40:"var(--ds-white-alpha-40)",whiteAlpha50:"var(--ds-white-alpha-50)",whiteAlpha60:"var(--ds-white-alpha-60)",whiteAlpha70:"var(--ds-white-alpha-70)",whiteAlpha80:"var(--ds-white-alpha-80)",whiteAlpha90:"var(--ds-white-alpha-90)",black:"var(--ds-black)",blackAlpha5:"var(--ds-black-alpha-5)",blackAlpha10:"var(--ds-black-alpha-10)",blackAlpha20:"var(--ds-black-alpha-20)",blackAlpha30:"var(--ds-black-alpha-30)",blackAlpha40:"var(--ds-black-alpha-40)",blackAlpha50:"var(--ds-black-alpha-50)",blackAlpha60:"var(--ds-black-alpha-60)",blackAlpha70:"var(--ds-black-alpha-70)",blackAlpha80:"var(--ds-black-alpha-80)",blackAlpha90:"var(--ds-black-alpha-90)",neutral50:"var(--ds-neutral-50)",neutral100:"var(--ds-neutral-100)",neutral200:"var(--ds-neutral-200)",neutral300:"var(--ds-neutral-300)",neutral400:"var(--ds-neutral-400)",neutral500:"var(--ds-neutral-500)",neutral600:"var(--ds-neutral-600)",neutral700:"var(--ds-neutral-700)",neutral800:"var(--ds-neutral-800)",neutral900:"var(--ds-neutral-900)",neutral950:"var(--ds-neutral-950)",primary50:"var(--ds-primary-50)",primary100:"var(--ds-primary-100)",primary200:"var(--ds-primary-200)",primary300:"var(--ds-primary-300)",primary400:"var(--ds-primary-400)",primary500:"var(--ds-primary-500)",primary600:"var(--ds-primary-600)",primary700:"var(--ds-primary-700)",primary800:"var(--ds-primary-800)",primary900:"var(--ds-primary-900)",primary950:"var(--ds-primary-950)",danger50:"var(--ds-danger-50)",danger100:"var(--ds-danger-100)",danger200:"var(--ds-danger-200)",danger300:"var(--ds-danger-300)",danger400:"var(--ds-danger-400)",danger500:"var(--ds-danger-500)",danger600:"var(--ds-danger-600)",danger700:"var(--ds-danger-700)",danger800:"var(--ds-danger-800)",danger900:"var(--ds-danger-900)",danger950:"var(--ds-danger-950)",warning50:"var(--ds-warning-50)",warning100:"var(--ds-warning-100)",warning200:"var(--ds-warning-200)",warning300:"var(--ds-warning-300)",warning400:"var(--ds-warning-400)",warning500:"var(--ds-warning-500)",warning600:"var(--ds-warning-600)",warning700:"var(--ds-warning-700)",warning800:"var(--ds-warning-800)",warning900:"var(--ds-warning-900)",warning950:"var(--ds-warning-950)",success50:"var(--ds-success-50)",success100:"var(--ds-success-100)",success200:"var(--ds-success-200)",success300:"var(--ds-success-300)",success400:"var(--ds-success-400)",success500:"var(--ds-success-500)",success600:"var(--ds-success-600)",success700:"var(--ds-success-700)",success800:"var(--ds-success-800)",success900:"var(--ds-success-900)",success950:"var(--ds-success-950)"};var n={s0:"var(--ds-spacing-0)",s1:"var(--ds-spacing-1)",s2:"var(--ds-spacing-2)",s3:"var(--ds-spacing-3)",s4:"var(--ds-spacing-4)",s5:"var(--ds-spacing-5)",s6:"var(--ds-spacing-6)",s7:"var(--ds-spacing-7)",s8:"var(--ds-spacing-8)",s9:"var(--ds-spacing-9)",s10:"var(--ds-spacing-10)",s11:"var(--ds-spacing-11)",s12:"var(--ds-spacing-12)",s13:"var(--ds-spacing-13)",s14:"var(--ds-spacing-14)",s15:"var(--ds-spacing-15)",s16:"var(--ds-spacing-16)",s17:"var(--ds-spacing-17)",s18:"var(--ds-spacing-18)",s19:"var(--ds-spacing-19)",s20:"var(--ds-spacing-20)",s21:"var(--ds-spacing-21)",max:"var(--ds-spacing-max)"};var E={10:10,11:11,12:12,13:13,14:14,15:15,16:16,18:18,20:20,24:24,28:28,32:32,36:36,44:44,60:60},Z={thin:100,extralight:200,light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800,black:900},pt={none:1,tight:1.25,snug:1.375,normal:1.5,relaxed:1.625,loose:2};var Bt={typography:"i"};var Nt=require("react/jsx-runtime"),W=(0,Dt.forwardRef)(({asChild:t,className:o,style:e,color:r,size:s=16,weight:a="normal",lineHeight:c="normal",...p},l)=>{let d=t?Ft.Slot:Lt.Primitive.p,f,g,k;Array.isArray(s)?[f,g,k]=s:typeof s=="object"?{base:f,tablet:g,desktop:k}=s:f=s;let F={...e,"--cocso-typography-font-color":r,"--cocso-typography-font-size":`${E[f]}px`,...g!==void 0&&{"--cocso-tablet-typography-font-size":`${E[g]}px`},...k!==void 0&&{"--cocso-desktop-typography-font-size":`${E[k]}px`},"--cocso-typography-font-weight":Z[a],"--cocso-typography-line-height":pt[c]};return(0,Nt.jsx)(d,{ref:l,className:(0,Mt.clsx)(Bt.typography,o),style:F,...p})});var It=require("react/jsx-runtime"),v=(0,At.forwardRef)(({asChild:t,style:o,color:e,size:r="md",weight:s,lineHeight:a,...c},p)=>{let l=Oo(r);return(0,It.jsx)(W,{ref:p,color:e,size:l,weight:s,lineHeight:a,asChild:t,...c})}),Oo=t=>(0,Ot.match)(t).with("lg",()=>18).with("md",()=>16).with("sm",()=>14).with("xs",()=>12).exhaustive();var Qt=require("@radix-ui/react-primitive"),dt=require("clsx"),D=require("react"),w=require("ts-pattern");var Et=require("@radix-ui/react-primitive"),Zt=require("@radix-ui/react-slot"),$t=require("clsx"),Yt=require("react"),$=require("ts-pattern");var Vt={"donut-spin":"u",spinner:"D"};var qt=require("react/jsx-runtime"),lt=(0,Yt.forwardRef)(({asChild:t,className:o,style:e,size:r="md",color:s="primary",...a},c)=>{let p=t?Zt.Slot:Et.Primitive.div,l={...e,"--cocso-spinner-size":Vo(r),"--cocso-spinner-border-width":Eo(r),"--cocso-spinner-border-color":Zo(s),"--cocso-spinner-bg-color":$o(s)};return(0,qt.jsx)(p,{ref:c,className:(0,$t.clsx)(Vt.spinner,o),style:l,...a})}),Vo=t=>(0,$.match)(t).with("xl",()=>"40px").with("lg",()=>"32px").with("md",()=>"24px").with("sm",()=>"20px").exhaustive(),Eo=t=>(0,$.match)(t).with("xl",()=>"5px").with("lg",()=>"4px").with("md",()=>"3px").with("sm",()=>"2px").exhaustive(),Zo=t=>(0,$.match)(t).with("primary",()=>i.primary500).with("neutral",()=>i.neutral600).with("white",()=>i.white).exhaustive(),$o=t=>(0,$.match)(t).with("primary",()=>i.primary100).with("neutral",()=>i.neutral100).with("white",()=>i.whiteAlpha20).exhaustive();var B={button:"l",disabled:"h",content:"E",prefix:"F",suffix:"G",svgOnly:"H"};var x=require("react/jsx-runtime"),qo=(0,D.forwardRef)(({asChild:t,className:o,style:e,children:r,size:s="md",variant:a="primary",weight:c="medium",shape:p="square",prefix:l,suffix:d,svgOnly:f=!1,disabled:g=!1,loading:k=!1,...F},_)=>{let j={...e,...Qo(s),"--cocso-button-font-color":_o(a),"--cocso-button-font-weight":Z[c],"--cocso-button-border":jo(a),"--cocso-button-border-radius":Xo(p,s),"--cocso-button-bg-color":Ko(a),"--cocso-button-bg-color-hover":Go(a),"--cocso-button-bg-color-active":Jo(a)},K=g||k,zt=(0,dt.clsx)(B.button,K&&B.disabled,f&&B.svgOnly,o),Tt=H=>(0,x.jsxs)(x.Fragment,{children:[k&&(0,x.jsx)(lt,{size:"sm",color:"white"}),l&&(0,x.jsx)("span",{className:B.prefix,children:l}),(0,x.jsx)("span",{className:B.content,children:H}),d&&(0,x.jsx)("span",{className:B.suffix,children:d})]});if(t){if(!(0,D.isValidElement)(r))throw new Error("Button: asChild requires a single React element as a child");let H=r,ko=H.props.children;return(0,D.cloneElement)(H,{ref:_,...F,...H.props,className:(0,dt.clsx)(zt,H.props.className),style:{...j,...H.props.style},children:Tt(ko)})}return(0,x.jsx)(Qt.Primitive.button,{ref:_,className:zt,disabled:K,style:j,...F,children:Tt(r)})}),Qo=t=>{let o=(0,w.match)(t).with("xl",()=>56).with("lg",()=>48).with("md",()=>40).with("sm",()=>32).with("xs",()=>24).exhaustive(),e=(0,w.match)(t).with("xl",()=>16).with("lg",()=>14).with("md",()=>10).with("sm",()=>6).with("xs",()=>0).exhaustive(),r=(0,w.match)(t).with("xl",()=>16).with("lg",()=>16).with("xs",()=>12).otherwise(()=>14);return{"--cocso-button-height":`${o}px`,"--cocso-button-padding-inline":`${e}px`,"--cocso-button-font-size":`${r}px`}},Xo=(t,o)=>(0,w.match)(t).with("square",()=>(0,w.match)(o).with("xs",()=>"4px").otherwise(()=>"6px")).with("circle",()=>"100%").with("rounded",()=>"100px").exhaustive(),_o=t=>(0,w.match)(t).with("primary","success","error","neutral",()=>i.white).with("secondary","tertiary","warning",()=>i.neutral950).exhaustive(),jo=t=>(0,w.match)(t).with("tertiary",()=>`1px solid ${i.neutral100}`).otherwise(()=>"none"),Ko=t=>(0,w.match)(t).with("primary",()=>i.primary500).with("secondary",()=>i.white).with("tertiary",()=>i.transparent).with("success",()=>i.success500).with("error",()=>i.danger500).with("warning",()=>i.warning300).with("neutral",()=>i.neutral950).exhaustive(),Go=t=>(0,w.match)(t).with("primary",()=>i.primary600).with("secondary",()=>i.neutral50).with("tertiary",()=>i.neutral50).with("success",()=>i.success600).with("error",()=>i.danger600).with("warning",()=>i.warning400).with("neutral",()=>i.neutral800).exhaustive(),Jo=t=>(0,w.match)(t).with("primary",()=>i.primary700).with("secondary",()=>i.neutral100).with("tertiary",()=>i.neutral100).with("success",()=>i.success700).with("error",()=>i.danger700).with("warning",()=>i.warning500).with("neutral",()=>i.neutral700).exhaustive();var ht=require("@cocso-ui/react-icons"),tt=R(require("@radix-ui/react-checkbox"),1),Xt=require("clsx"),ot=require("react"),A=require("ts-pattern");var N={wrapper:"I",checkbox:"r",indicator:"J",label:"v"};var C=require("react/jsx-runtime"),te=(0,ot.forwardRef)(({id:t,className:o,style:e,size:r="md",status:s,onChange:a,label:c,disabled:p,...l},d)=>{let f=(0,ot.useId)(),g=t??f,k=j=>{if(!p){let K=(0,A.match)(j).with(!0,()=>"on").with("indeterminate",()=>"intermediate").with(!1,()=>"off").exhaustive();a(K)}},F=()=>(0,A.match)(s).with("on",()=>!0).with("intermediate",()=>"indeterminate").with("off",()=>!1).exhaustive(),_={...e,"--cocso-checkbox-size":oe(r),"--cocso-checkbox-color":i.white,"--cocso-checkbox-border-color":ee(s),"--cocso-checkbox-bg-color":re(s)};return(0,C.jsxs)("div",{className:(0,Xt.clsx)(N.wrapper,o),style:_,children:[(0,C.jsxs)(tt.Root,{ref:d,id:g,className:N.checkbox,checked:F(),onCheckedChange:k,disabled:p,...l,children:[(0,C.jsx)(tt.Indicator,{className:N.indicator,style:{opacity:s==="on"?1:0},"aria-hidden":"true",children:(0,C.jsx)(ht.CheckIcon,{size:24})}),(0,C.jsx)("div",{className:N.indicator,style:{opacity:s==="intermediate"?1:0},"aria-hidden":"true",children:(0,C.jsx)(ht.CheckIcon,{size:24})})]}),c&&(0,C.jsx)(v,{className:N.label,size:r,"aria-disabled":p,asChild:!0,children:(0,C.jsx)("label",{htmlFor:g,children:c})})]})}),oe=t=>(0,A.match)(t).with("lg",()=>n.s10).with("md",()=>n.s9).with("sm",()=>n.s8).exhaustive(),ee=t=>(0,A.match)(t).with("on",()=>i.primary500).with("intermediate",()=>i.primary500).with("off",()=>i.neutral100).exhaustive(),re=t=>(0,A.match)(t).with("on",()=>i.primary500).with("intermediate",()=>i.primary500).with("off",()=>i.white).exhaustive();var _t=require("@radix-ui/react-slot"),jt=require("react"),Kt=require("ts-pattern");var mt=require("react/jsx-runtime"),ie=(0,jt.forwardRef)(({asChild:t,className:o,color:e,size:r="md",weight:s,lineHeight:a,...c},p)=>{let l=t?_t.Slot:"h1",d=ne(r);return(0,mt.jsx)(W,{ref:p,color:e,size:d,weight:s,lineHeight:a,asChild:!0,children:(0,mt.jsx)(l,{...c})})}),ne=t=>(0,Kt.match)(t).with("lg",()=>({base:44,tablet:60})).with("md",()=>({base:32,tablet:44})).with("sm",()=>({base:28,tablet:36})).exhaustive();var P=R(require("@radix-ui/react-dropdown-menu"),1),gt=require("clsx"),ut=require("react");var ft={"dropdown-slide-up":"f","dropdown-slide-down":"m",content:"p",item:"K"};var vt=require("react/jsx-runtime"),ae=(0,ut.forwardRef)(({className:t,...o},e)=>(0,vt.jsx)(P.Content,{ref:e,className:(0,gt.clsx)(ft.content,t),...o})),ce=(0,ut.forwardRef)(({className:t,...o},e)=>(0,vt.jsx)(P.Item,{ref:e,className:(0,gt.clsx)(ft.item,t),...o})),pe=Object.assign(P.Root,{Trigger:P.Trigger,Portal:P.Portal,Content:ae,Item:ce});var Gt=require("@radix-ui/react-primitive"),Jt=require("@radix-ui/react-slot"),Ut=require("react"),to=require("ts-pattern");var wt=require("react/jsx-runtime"),yt=(0,Ut.forwardRef)(({asChild:t,className:o,color:e,size:r="md",weight:s="bold",lineHeight:a,...c},p)=>{let l=t?Jt.Slot:Gt.Primitive.h2,d=le(r);return(0,wt.jsx)(W,{ref:p,color:e,size:d,weight:s,lineHeight:a,asChild:!0,children:(0,wt.jsx)(l,{...c})})}),le=t=>(0,to.match)(t).with("xl",()=>({base:28,tablet:40})).with("lg",()=>({base:24,tablet:32})).with("md",()=>({base:22,tablet:24})).with("sm",()=>18).with("xs",()=>16).exhaustive();var oo=require("@radix-ui/react-primitive"),eo=require("@radix-ui/react-slot"),ro=require("clsx"),io=require("react");var bt={link:"y",indicator:"L"};var xt=require("react/jsx-runtime"),he=(0,io.forwardRef)(({asChild:t,className:o,size:e,weight:r,lineHeight:s,indicator:a=!0,...c},p)=>{let l=t?eo.Slot:oo.Primitive.a;return(0,xt.jsx)(v,{size:e,weight:r,lineHeight:s,asChild:!0,children:(0,xt.jsx)(l,{ref:p,className:(0,ro.clsx)(bt.link,a&&bt.indicator,o),...c})})});var no=require("@cocso-ui/react-icons"),m=R(require("@radix-ui/react-dialog"),1),Y=require("clsx"),q=require("react");var O={"overlay-show":"w",overlay:"M","content-show":"x",content:"N",close:"O",title:"P",description:"Q"};var y=require("react/jsx-runtime"),fe=(0,q.forwardRef)(({className:t,children:o,...e},r)=>(0,y.jsxs)(m.Portal,{children:[(0,y.jsx)(m.Overlay,{className:O.overlay}),(0,y.jsx)(m.Content,{ref:r,className:(0,Y.clsx)(O.content,t),...e,children:o})]})),ge=(0,q.forwardRef)(({className:t,children:o,...e},r)=>(0,y.jsx)(m.Close,{ref:r,className:(0,Y.clsx)(O.close,t),...e,children:(0,y.jsx)(no.CloseIcon,{size:24})})),ue=(0,q.forwardRef)(({className:t,children:o,...e},r)=>(0,y.jsx)(m.Title,{ref:r,className:(0,Y.clsx)(O.title,t),asChild:!0,...e,children:(0,y.jsx)(yt,{color:"text.basic",children:o})})),ve=(0,q.forwardRef)(({className:t,children:o,...e},r)=>(0,y.jsx)(m.Description,{ref:r,className:(0,Y.clsx)(O.description,t),asChild:!0,...e,children:(0,y.jsx)(v,{size:"sm",color:"text.subtle",children:o})})),we=Object.assign(m.Root,{Trigger:m.Trigger,Content:fe,Close:ge,Title:ue,Description:ve});var et=R(require("@radix-ui/react-one-time-password-field"),1),Pt=require("clsx"),kt=require("react");var Ct={otp:"R",input:"a"};var St=require("react/jsx-runtime"),be=(0,kt.forwardRef)(({className:t,...o},e)=>(0,St.jsx)(et.Root,{ref:e,className:(0,Pt.clsx)(Ct.otp,t),...o})),xe=(0,kt.forwardRef)(({className:t,...o},e)=>(0,St.jsx)(et.Input,{ref:e,className:(0,Pt.clsx)(Ct.input,t),...o})),Ce=Object.assign(be,{Input:xe});var so=require("clsx"),ao=require("react");var L={pagination:"S",arrow:"o",item:"e",trunc:"T"};var u=require("react/jsx-runtime"),ke=(0,ao.forwardRef)(({className:t,page:o,totalPages:e,maxVisible:r=5,onChange:s,...a},c)=>{let p=Math.ceil(r/2),l=d=>(0,u.jsx)("button",{type:"button",className:L.item,onClick:()=>s(d),"data-active":o===d,children:d},d);return(0,u.jsxs)("div",{ref:c,className:(0,so.clsx)(L.pagination,t),...a,children:[e>1&&(0,u.jsx)("button",{className:L.arrow,type:"button",disabled:o===1,onClick:()=>o>1&&s(o-1),children:(0,u.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","aria-hidden":"true",children:(0,u.jsx)("path",{d:"m15 18-6-6 6-6"})})}),e<=r+2?Array(e).fill(0).map((d,f)=>l(f+1)):(0,u.jsxs)(u.Fragment,{children:[l(1),o>1+p&&(0,u.jsx)("span",{className:L.trunc,children:"..."}),Array(r).fill(0).map((d,f)=>{let g=o-p+f+1;return g>1&&g<e?l(g):""}),o<e-p&&(0,u.jsx)("span",{className:L.trunc,children:"..."}),l(e)]}),e>1&&(0,u.jsx)("button",{className:L.arrow,type:"button",disabled:o===e,onClick:()=>o<e&&s(o+1),children:(0,u.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","aria-hidden":"true",children:(0,u.jsx)("path",{d:"m9 18 6-6-6-6"})})})]})});var z=R(require("@radix-ui/react-popover"),1),po=require("clsx"),lo=require("react");var co={"slide-up-and-fade":"k","slide-right-and-fade":"z","slide-down-and-fade":"j","slide-left-and-fade":"Y",content:"t"};var ho=require("react/jsx-runtime"),Re=(0,lo.forwardRef)(({className:t,...o},e)=>(0,ho.jsx)(z.Content,{ref:e,className:(0,po.clsx)(co.content,t),...o})),ze=Object.assign(z.Root,{Trigger:z.Trigger,Portal:z.Portal,Content:Re});var mo=require("@cocso-ui/react-icons"),fo=require("clsx"),go=require("react"),uo=require("ts-pattern");var rt={wrapper:"U",select:"X",icon:"q"};var I=require("react/jsx-runtime"),He=(0,go.forwardRef)(({className:t,style:o,size:e="md",disabled:r=!1,children:s,...a},c)=>{let p={...o,...We(e)};return(0,I.jsxs)("div",{className:rt.wrapper,children:[(0,I.jsx)("select",{ref:c,className:(0,fo.clsx)(rt.select,t),style:p,disabled:r,...a,children:s}),(0,I.jsx)("span",{className:rt.icon,children:(0,I.jsx)(mo.KeyboardArrowDownIcon,{size:20})})]})}),We=t=>(0,uo.match)(t).with("2xs",()=>({"--cocso-select-min-width":n.s11,"--cocso-select-height":n.s11,"--cocso-select-padding-left":n.s5,"--cocso-select-padding-right":`calc(${n.s8} + 16px)`,"--cocso-select-font-size":"12px","--cocso-select-border-radius":n.s3})).with("xs",()=>({"--cocso-select-min-width":n.s12,"--cocso-select-height":n.s12,"--cocso-select-padding-left":n.s6,"--cocso-select-padding-right":`calc(${n.s7} + 16px)`,"--cocso-select-font-size":"14px","--cocso-select-border-radius":n.s3})).with("sm",()=>({"--cocso-select-min-width":n.s14,"--cocso-select-height":n.s14,"--cocso-select-padding-left":n.s7,"--cocso-select-padding-right":`calc(${n.s7} + 16px)`,"--cocso-select-font-size":"14px","--cocso-select-border-radius":n.s3})).with("md",()=>({"--cocso-select-min-width":n.s16,"--cocso-select-height":n.s16,"--cocso-select-padding-left":n.s8,"--cocso-select-padding-right":`calc(${n.s8} + 16px)`,"--cocso-select-font-size":"16px","--cocso-select-border-radius":n.s4})).with("lg",()=>({"--cocso-select-min-width":n.s17,"--cocso-select-height":n.s17,"--cocso-select-padding-left":n.s9,"--cocso-select-padding-right":`calc(${n.s9} + 16px)`,"--cocso-select-font-size":"18px","--cocso-select-border-radius":n.s4})).with("xl",()=>({"--cocso-select-min-width":n.s18,"--cocso-select-height":n.s18,"--cocso-select-padding-left":n.s10,"--cocso-select-padding-right":`calc(${n.s10} + 16px)`,"--cocso-select-font-size":"18px","--cocso-select-border-radius":n.s4})).exhaustive();var vo=require("clsx"),wo=require("react"),yo=require("ts-pattern");var Rt={stock:"V",indicator:"Z"};var h=require("react/jsx-runtime"),Le=(0,wo.forwardRef)(({className:t,style:o,onChange:e,quantity:r,...s},a)=>{let c={...o,"--cocso-stock-quantity-status-color":bo(r),"--cocso-stock-quantity-status-indicator-width":n.s9};return(0,h.jsxs)("div",{ref:a,className:(0,vo.clsx)(Rt.stock,t),style:c,...s,children:[(0,h.jsx)("span",{className:Rt.indicator,children:r==="\uC5EC\uC720"?(0,h.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[(0,h.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,h.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,h.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"})]}):r==="\uBCF4\uD1B5"?(0,h.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[(0,h.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,h.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,h.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,h.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[(0,h.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,h.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,h.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,h.jsx)(v,{size:"sm",color:"currentColor",children:r})]})}),bo=t=>(0,yo.match)(t).with("\uC5EC\uC720",()=>i.primary500).with("\uBCF4\uD1B5",()=>i.success400).with("\uBD80\uC871",()=>i.danger500).exhaustive();var Co=require("@radix-ui/react-primitive"),nt=R(require("@radix-ui/react-switch"),1),Po=require("clsx"),st=require("react"),at=require("ts-pattern");var it={wrapper:"A",switch:"n",thumb:"B"};var S=require("react/jsx-runtime"),Me=(0,st.forwardRef)(({id:t,className:o,style:e,size:r="md",position:s="right",disabled:a,label:c,...p},l)=>{let d=(0,st.useId)(),f=t??d,g={...e,"--cocso-switch-width":De(r),"--cocso-switch-height":Ne(r),"--cocso-switch-thumb-width":xo(r),"--cocso-switch-thumb-height":xo(r),"--cocso-switch-bg-color":i.neutral100};return(0,S.jsxs)(Co.Primitive.div,{className:(0,Po.clsx)(it.wrapper,o),"aria-disabled":a,style:g,children:[s==="left"&&(0,S.jsx)(v,{size:r,asChild:!0,children:(0,S.jsx)("label",{htmlFor:f,children:c})}),(0,S.jsx)(nt.Root,{ref:l,className:it.switch,disabled:a,...p,children:(0,S.jsx)(nt.Thumb,{className:it.thumb})}),s==="right"&&(0,S.jsx)(v,{size:r,"aria-disabled":a,asChild:!0,children:(0,S.jsx)("label",{htmlFor:f,children:c})})]})}),De=t=>(0,at.match)(t).with("lg",()=>n.s14).with("md",()=>n.s12).exhaustive(),Ne=t=>(0,at.match)(t).with("lg",()=>n.s10).with("md",()=>n.s9).exhaustive(),xo=t=>(0,at.match)(t).with("lg",()=>n.s9).with("md",()=>n.s8).exhaustive();var T=R(require("@radix-ui/react-tabs"),1),Q=require("react"),X=require("react/jsx-runtime"),Ae=(0,Q.forwardRef)(({...t},o)=>(0,X.jsx)(T.Root,{ref:o,...t})),Oe=(0,Q.forwardRef)(({...t},o)=>(0,X.jsx)(T.List,{ref:o,...t})),Ie=(0,Q.forwardRef)(({...t},o)=>(0,X.jsx)(T.Trigger,{ref:o,...t})),Ve=(0,Q.forwardRef)(({...t},o)=>(0,X.jsx)(T.Content,{ref:o,...t})),Ee=Object.assign(Ae,{List:Oe,Trigger:Ie,Content:Ve});var ct=require("sonner");
|
|
1
|
+
"use strict";var St=Object.create;var G=Object.defineProperty;var Rt=Object.getOwnPropertyDescriptor;var zt=Object.getOwnPropertyNames;var Tt=Object.getPrototypeOf,Ht=Object.prototype.hasOwnProperty;var Wt=(o,t)=>{for(var e in t)G(o,e,{get:t[e],enumerable:!0})},Wo=(o,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of zt(t))!Ht.call(o,s)&&s!==e&&G(o,s,{get:()=>t[s],enumerable:!(r=Rt(t,s))||r.enumerable});return o};var R=(o,t,e)=>(e=o!=null?St(Tt(o)):{},Wo(t||!o||!o.__esModule?G(e,"default",{value:o,enumerable:!0}):e,o)),Bt=o=>Wo(G({},"__esModule",{value:!0}),o);var Ze={};Wt(Ze,{Accordion:()=>Nt,Body:()=>v,Button:()=>qt,Checkbox:()=>oe,Display:()=>ie,Dropdown:()=>pe,Heading:()=>bo,Link:()=>he,Modal:()=>we,OneTimePasswordField:()=>Ce,Pagination:()=>ke,Popover:()=>ze,Select:()=>He,Spinner:()=>lo,StockQuantityStatus:()=>Le,Switch:()=>Me,Tab:()=>Ee,Toaster:()=>co.Toaster,Typography:()=>W,colors:()=>i,fontSize:()=>E,fontWeight:()=>Z,getColor:()=>bt,lineHeight:()=>po,spacing:()=>n,toast:()=>co.toast});module.exports=Bt(Ze);var Bo=require("@cocso-ui/react-icons"),b=R(require("@radix-ui/react-accordion"),1),J=require("clsx"),U=require("react");var V={item:"C",content:"c","slide-down":"g","slide-up":"b",trigger:"s",chevron:"d"};var M=require("react/jsx-runtime"),Ft=(0,U.forwardRef)(({className:o,...t},e)=>(0,M.jsx)(b.Item,{ref:e,className:(0,J.clsx)(V.item,o),...t})),Mt=(0,U.forwardRef)(({className:o,children:t,chevron:e=!0,...r},s)=>(0,M.jsxs)(b.Trigger,{ref:s,className:(0,J.clsx)(V.trigger,o),...r,children:[t,e&&(0,M.jsx)(Bo.KeyboardArrowDownIcon,{className:V.chevron})]})),Dt=(0,U.forwardRef)(({className:o,...t},e)=>(0,M.jsx)(b.Content,{ref:e,className:(0,J.clsx)(V.content,o),...t})),Nt=Object.assign(b.Root,{Item:Ft,Header:b.Header,Trigger:Mt,Content:Dt});var Oo=require("react"),Io=require("ts-pattern");var Fo=require("@radix-ui/react-primitive"),Mo=require("@radix-ui/react-slot"),Do=require("clsx"),No=require("react");var i={transparent:"var(--ds-color-transparent)",white:"var(--ds-color-white)",whiteAlpha5:"var(--ds-color-white-alpha-5)",whiteAlpha10:"var(--ds-color-white-alpha-10)",whiteAlpha20:"var(--ds-color-white-alpha-20)",whiteAlpha30:"var(--ds-color-white-alpha-30)",whiteAlpha40:"var(--ds-color-white-alpha-40)",whiteAlpha50:"var(--ds-color-white-alpha-50)",whiteAlpha60:"var(--ds-color-white-alpha-60)",whiteAlpha70:"var(--ds-color-white-alpha-70)",whiteAlpha80:"var(--ds-color-white-alpha-80)",whiteAlpha90:"var(--ds-color-white-alpha-90)",black:"var(--ds-color-black)",blackAlpha5:"var(--ds-color-black-alpha-5)",blackAlpha10:"var(--ds-color-black-alpha-10)",blackAlpha20:"var(--ds-color-black-alpha-20)",blackAlpha30:"var(--ds-color-black-alpha-30)",blackAlpha40:"var(--ds-color-black-alpha-40)",blackAlpha50:"var(--ds-color-black-alpha-50)",blackAlpha60:"var(--ds-color-black-alpha-60)",blackAlpha70:"var(--ds-color-black-alpha-70)",blackAlpha80:"var(--ds-color-black-alpha-80)",blackAlpha90:"var(--ds-color-black-alpha-90)",neutral50:"var(--ds-color-neutral-50)",neutral100:"var(--ds-color-neutral-100)",neutral200:"var(--ds-color-neutral-200)",neutral300:"var(--ds-color-neutral-300)",neutral400:"var(--ds-color-neutral-400)",neutral500:"var(--ds-color-neutral-500)",neutral600:"var(--ds-color-neutral-600)",neutral700:"var(--ds-color-neutral-700)",neutral800:"var(--ds-color-neutral-800)",neutral900:"var(--ds-color-neutral-900)",neutral950:"var(--ds-color-neutral-950)",primary50:"var(--ds-color-primary-50)",primary100:"var(--ds-color-primary-100)",primary200:"var(--ds-color-primary-200)",primary300:"var(--ds-color-primary-300)",primary400:"var(--ds-color-primary-400)",primary500:"var(--ds-color-primary-500)",primary600:"var(--ds-color-primary-600)",primary700:"var(--ds-color-primary-700)",primary800:"var(--ds-color-primary-800)",primary900:"var(--ds-color-primary-900)",primary950:"var(--ds-color-primary-950)",danger50:"var(--ds-color-danger-50)",danger100:"var(--ds-color-danger-100)",danger200:"var(--ds-color-danger-200)",danger300:"var(--ds-color-danger-300)",danger400:"var(--ds-color-danger-400)",danger500:"var(--ds-color-danger-500)",danger600:"var(--ds-color-danger-600)",danger700:"var(--ds-color-danger-700)",danger800:"var(--ds-color-danger-800)",danger900:"var(--ds-color-danger-900)",danger950:"var(--ds-color-danger-950)",warning50:"var(--ds-color-warning-50)",warning100:"var(--ds-color-warning-100)",warning200:"var(--ds-color-warning-200)",warning300:"var(--ds-color-warning-300)",warning400:"var(--ds-color-warning-400)",warning500:"var(--ds-color-warning-500)",warning600:"var(--ds-color-warning-600)",warning700:"var(--ds-color-warning-700)",warning800:"var(--ds-color-warning-800)",warning900:"var(--ds-color-warning-900)",warning950:"var(--ds-color-warning-950)",success50:"var(--ds-color-success-50)",success100:"var(--ds-color-success-100)",success200:"var(--ds-color-success-200)",success300:"var(--ds-color-success-300)",success400:"var(--ds-color-success-400)",success500:"var(--ds-color-success-500)",success600:"var(--ds-color-success-600)",success700:"var(--ds-color-success-700)",success800:"var(--ds-color-success-800)",success900:"var(--ds-color-success-900)",success950:"var(--ds-color-success-950)"};var n={s0:"var(--ds-spacing-0)",s1:"var(--ds-spacing-1)",s2:"var(--ds-spacing-2)",s3:"var(--ds-spacing-3)",s4:"var(--ds-spacing-4)",s5:"var(--ds-spacing-5)",s6:"var(--ds-spacing-6)",s7:"var(--ds-spacing-7)",s8:"var(--ds-spacing-8)",s9:"var(--ds-spacing-9)",s10:"var(--ds-spacing-10)",s11:"var(--ds-spacing-11)",s12:"var(--ds-spacing-12)",s13:"var(--ds-spacing-13)",s14:"var(--ds-spacing-14)",s15:"var(--ds-spacing-15)",s16:"var(--ds-spacing-16)",s17:"var(--ds-spacing-17)",s18:"var(--ds-spacing-18)",s19:"var(--ds-spacing-19)",s20:"var(--ds-spacing-20)",s21:"var(--ds-spacing-21)",max:"var(--ds-spacing-max)"};var E={10:10,11:11,12:12,13:13,14:14,15:15,16:16,18:18,20:20,24:24,28:28,32:32,36:36,44:44,60:60},Z={thin:100,extralight:200,light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800,black:900},po={none:1,tight:1.25,snug:1.375,normal:1.5,relaxed:1.625,loose:2};var Lo={typography:"i"};var Ao=require("react/jsx-runtime"),W=(0,No.forwardRef)(({asChild:o,className:t,style:e,color:r,size:s=16,weight:a="normal",lineHeight:c="normal",...p},l)=>{let d=o?Mo.Slot:Fo.Primitive.p,f,g,k;Array.isArray(s)?[f,g,k]=s:typeof s=="object"?{base:f,tablet:g,desktop:k}=s:f=s;let F={...e,"--cocso-typography-font-color":r,"--cocso-typography-font-size":`${E[f]}px`,...g!==void 0&&{"--cocso-tablet-typography-font-size":`${E[g]}px`},...k!==void 0&&{"--cocso-desktop-typography-font-size":`${E[k]}px`},"--cocso-typography-font-weight":Z[a],"--cocso-typography-line-height":po[c]};return(0,Ao.jsx)(d,{ref:l,className:(0,Do.clsx)(Lo.typography,t),style:F,...p})});var Vo=require("react/jsx-runtime"),v=(0,Oo.forwardRef)(({asChild:o,style:t,color:e,size:r="md",weight:s,lineHeight:a,...c},p)=>{let l=Ot(r);return(0,Vo.jsx)(W,{ref:p,color:e,size:l,weight:s,lineHeight:a,asChild:o,...c})}),Ot=o=>(0,Io.match)(o).with("lg",()=>18).with("md",()=>16).with("sm",()=>14).with("xs",()=>12).exhaustive();var Xo=require("@radix-ui/react-primitive"),ho=require("clsx"),D=require("react"),w=require("ts-pattern");var Zo=require("@radix-ui/react-primitive"),$o=require("@radix-ui/react-slot"),Yo=require("clsx"),qo=require("react"),$=require("ts-pattern");var Eo={"donut-spin":"u",spinner:"D"};var Qo=require("react/jsx-runtime"),lo=(0,qo.forwardRef)(({asChild:o,className:t,style:e,size:r="md",color:s="primary",...a},c)=>{let p=o?$o.Slot:Zo.Primitive.div,l={...e,"--cocso-spinner-size":Vt(r),"--cocso-spinner-border-width":Et(r),"--cocso-spinner-border-color":Zt(s),"--cocso-spinner-bg-color":$t(s)};return(0,Qo.jsx)(p,{ref:c,className:(0,Yo.clsx)(Eo.spinner,t),style:l,...a})}),Vt=o=>(0,$.match)(o).with("xl",()=>"40px").with("lg",()=>"32px").with("md",()=>"24px").with("sm",()=>"20px").exhaustive(),Et=o=>(0,$.match)(o).with("xl",()=>"5px").with("lg",()=>"4px").with("md",()=>"3px").with("sm",()=>"2px").exhaustive(),Zt=o=>(0,$.match)(o).with("primary",()=>i.primary500).with("neutral",()=>i.neutral600).with("white",()=>i.white).exhaustive(),$t=o=>(0,$.match)(o).with("primary",()=>i.primary100).with("neutral",()=>i.neutral100).with("white",()=>i.whiteAlpha20).exhaustive();var B={button:"l",disabled:"h",content:"E",prefix:"F",suffix:"G",svgOnly:"H"};var x=require("react/jsx-runtime"),qt=(0,D.forwardRef)(({asChild:o,className:t,style:e,children:r,size:s="md",variant:a="primary",weight:c="medium",shape:p="square",prefix:l,suffix:d,svgOnly:f=!1,disabled:g=!1,loading:k=!1,...F},_)=>{let j={...e,...Qt(s),"--cocso-button-font-color":_t(a),"--cocso-button-font-weight":Z[c],"--cocso-button-border":jt(a),"--cocso-button-border-radius":Xt(p,s),"--cocso-button-bg-color":Kt(a),"--cocso-button-bg-color-hover":Gt(a),"--cocso-button-bg-color-active":Jt(a)},K=g||k,To=(0,ho.clsx)(B.button,K&&B.disabled,f&&B.svgOnly,t),Ho=H=>(0,x.jsxs)(x.Fragment,{children:[k&&(0,x.jsx)(lo,{size:"sm",color:"white"}),l&&(0,x.jsx)("span",{className:B.prefix,children:l}),(0,x.jsx)("span",{className:B.content,children:H}),d&&(0,x.jsx)("span",{className:B.suffix,children:d})]});if(o){if(!(0,D.isValidElement)(r))throw new Error("Button: asChild requires a single React element as a child");let H=r,kt=H.props.children;return(0,D.cloneElement)(H,{ref:_,...F,...H.props,className:(0,ho.clsx)(To,H.props.className),style:{...j,...H.props.style},children:Ho(kt)})}return(0,x.jsx)(Xo.Primitive.button,{ref:_,className:To,disabled:K,style:j,...F,children:Ho(r)})}),Qt=o=>{let t=(0,w.match)(o).with("xl",()=>56).with("lg",()=>48).with("md",()=>40).with("sm",()=>32).with("xs",()=>24).exhaustive(),e=(0,w.match)(o).with("xl",()=>16).with("lg",()=>14).with("md",()=>10).with("sm",()=>6).with("xs",()=>0).exhaustive(),r=(0,w.match)(o).with("xl",()=>16).with("lg",()=>16).with("xs",()=>12).otherwise(()=>14);return{"--cocso-button-height":`${t}px`,"--cocso-button-padding-inline":`${e}px`,"--cocso-button-font-size":`${r}px`}},Xt=(o,t)=>(0,w.match)(o).with("square",()=>(0,w.match)(t).with("xs",()=>"4px").otherwise(()=>"6px")).with("circle",()=>"100%").with("rounded",()=>"100px").exhaustive(),_t=o=>(0,w.match)(o).with("primary","success","error","neutral",()=>i.white).with("secondary","tertiary","warning",()=>i.neutral950).exhaustive(),jt=o=>(0,w.match)(o).with("tertiary",()=>`1px solid ${i.neutral100}`).otherwise(()=>"none"),Kt=o=>(0,w.match)(o).with("primary",()=>i.primary500).with("secondary",()=>i.white).with("tertiary",()=>i.transparent).with("success",()=>i.success500).with("error",()=>i.danger500).with("warning",()=>i.warning300).with("neutral",()=>i.neutral950).exhaustive(),Gt=o=>(0,w.match)(o).with("primary",()=>i.primary600).with("secondary",()=>i.neutral50).with("tertiary",()=>i.neutral50).with("success",()=>i.success600).with("error",()=>i.danger600).with("warning",()=>i.warning400).with("neutral",()=>i.neutral800).exhaustive(),Jt=o=>(0,w.match)(o).with("primary",()=>i.primary700).with("secondary",()=>i.neutral100).with("tertiary",()=>i.neutral100).with("success",()=>i.success700).with("error",()=>i.danger700).with("warning",()=>i.warning500).with("neutral",()=>i.neutral700).exhaustive();var mo=require("@cocso-ui/react-icons"),oo=R(require("@radix-ui/react-checkbox"),1),_o=require("clsx"),to=require("react"),A=require("ts-pattern");var N={wrapper:"I",checkbox:"r",indicator:"J",label:"v"};var C=require("react/jsx-runtime"),oe=(0,to.forwardRef)(({id:o,className:t,style:e,size:r="md",status:s,onChange:a,label:c,disabled:p,...l},d)=>{let f=(0,to.useId)(),g=o??f,k=j=>{if(!p){let K=(0,A.match)(j).with(!0,()=>"on").with("indeterminate",()=>"intermediate").with(!1,()=>"off").exhaustive();a(K)}},F=()=>(0,A.match)(s).with("on",()=>!0).with("intermediate",()=>"indeterminate").with("off",()=>!1).exhaustive(),_={...e,"--cocso-checkbox-size":te(r),"--cocso-checkbox-color":i.white,"--cocso-checkbox-border-color":ee(s),"--cocso-checkbox-bg-color":re(s)};return(0,C.jsxs)("div",{className:(0,_o.clsx)(N.wrapper,t),style:_,children:[(0,C.jsxs)(oo.Root,{ref:d,id:g,className:N.checkbox,checked:F(),onCheckedChange:k,disabled:p,...l,children:[(0,C.jsx)(oo.Indicator,{className:N.indicator,style:{opacity:s==="on"?1:0},"aria-hidden":"true",children:(0,C.jsx)(mo.CheckIcon,{size:24})}),(0,C.jsx)("div",{className:N.indicator,style:{opacity:s==="intermediate"?1:0},"aria-hidden":"true",children:(0,C.jsx)(mo.CheckIcon,{size:24})})]}),c&&(0,C.jsx)(v,{className:N.label,size:r,"aria-disabled":p,asChild:!0,children:(0,C.jsx)("label",{htmlFor:g,children:c})})]})}),te=o=>(0,A.match)(o).with("lg",()=>n.s10).with("md",()=>n.s9).with("sm",()=>n.s8).exhaustive(),ee=o=>(0,A.match)(o).with("on",()=>i.primary500).with("intermediate",()=>i.primary500).with("off",()=>i.neutral100).exhaustive(),re=o=>(0,A.match)(o).with("on",()=>i.primary500).with("intermediate",()=>i.primary500).with("off",()=>i.white).exhaustive();var jo=require("@radix-ui/react-slot"),Ko=require("react"),Go=require("ts-pattern");var fo=require("react/jsx-runtime"),ie=(0,Ko.forwardRef)(({asChild:o,className:t,color:e,size:r="md",weight:s,lineHeight:a,...c},p)=>{let l=o?jo.Slot:"h1",d=ne(r);return(0,fo.jsx)(W,{ref:p,color:e,size:d,weight:s,lineHeight:a,asChild:!0,children:(0,fo.jsx)(l,{...c})})}),ne=o=>(0,Go.match)(o).with("lg",()=>({base:44,tablet:60})).with("md",()=>({base:32,tablet:44})).with("sm",()=>({base:28,tablet:36})).exhaustive();var P=R(require("@radix-ui/react-dropdown-menu"),1),uo=require("clsx"),vo=require("react");var go={"dropdown-slide-up":"f","dropdown-slide-down":"m",content:"p",item:"K"};var wo=require("react/jsx-runtime"),ae=(0,vo.forwardRef)(({className:o,...t},e)=>(0,wo.jsx)(P.Content,{ref:e,className:(0,uo.clsx)(go.content,o),...t})),ce=(0,vo.forwardRef)(({className:o,...t},e)=>(0,wo.jsx)(P.Item,{ref:e,className:(0,uo.clsx)(go.item,o),...t})),pe=Object.assign(P.Root,{Trigger:P.Trigger,Portal:P.Portal,Content:ae,Item:ce});var Jo=require("@radix-ui/react-primitive"),Uo=require("@radix-ui/react-slot"),ot=require("react"),tt=require("ts-pattern");var yo=require("react/jsx-runtime"),bo=(0,ot.forwardRef)(({asChild:o,className:t,color:e,size:r="md",weight:s="bold",lineHeight:a,...c},p)=>{let l=o?Uo.Slot:Jo.Primitive.h2,d=le(r);return(0,yo.jsx)(W,{ref:p,color:e,size:d,weight:s,lineHeight:a,asChild:!0,children:(0,yo.jsx)(l,{...c})})}),le=o=>(0,tt.match)(o).with("xl",()=>({base:28,tablet:40})).with("lg",()=>({base:24,tablet:32})).with("md",()=>({base:22,tablet:24})).with("sm",()=>18).with("xs",()=>16).exhaustive();var et=require("@radix-ui/react-primitive"),rt=require("@radix-ui/react-slot"),it=require("clsx"),nt=require("react");var xo={link:"y",indicator:"L"};var Co=require("react/jsx-runtime"),he=(0,nt.forwardRef)(({asChild:o,className:t,size:e,weight:r,lineHeight:s,indicator:a=!0,...c},p)=>{let l=o?rt.Slot:et.Primitive.a;return(0,Co.jsx)(v,{size:e,weight:r,lineHeight:s,asChild:!0,children:(0,Co.jsx)(l,{ref:p,className:(0,it.clsx)(xo.link,a&&xo.indicator,t),...c})})});var st=require("@cocso-ui/react-icons"),m=R(require("@radix-ui/react-dialog"),1),Y=require("clsx"),q=require("react");var O={"overlay-show":"w",overlay:"M","content-show":"x",content:"N",close:"O",title:"P",description:"Q"};var y=require("react/jsx-runtime"),fe=(0,q.forwardRef)(({className:o,children:t,...e},r)=>(0,y.jsxs)(m.Portal,{children:[(0,y.jsx)(m.Overlay,{className:O.overlay}),(0,y.jsx)(m.Content,{ref:r,className:(0,Y.clsx)(O.content,o),...e,children:t})]})),ge=(0,q.forwardRef)(({className:o,children:t,...e},r)=>(0,y.jsx)(m.Close,{ref:r,className:(0,Y.clsx)(O.close,o),...e,children:(0,y.jsx)(st.CloseIcon,{size:24})})),ue=(0,q.forwardRef)(({className:o,children:t,...e},r)=>(0,y.jsx)(m.Title,{ref:r,className:(0,Y.clsx)(O.title,o),asChild:!0,...e,children:(0,y.jsx)(bo,{color:"text.basic",children:t})})),ve=(0,q.forwardRef)(({className:o,children:t,...e},r)=>(0,y.jsx)(m.Description,{ref:r,className:(0,Y.clsx)(O.description,o),asChild:!0,...e,children:(0,y.jsx)(v,{size:"sm",color:"text.subtle",children:t})})),we=Object.assign(m.Root,{Trigger:m.Trigger,Content:fe,Close:ge,Title:ue,Description:ve});var eo=R(require("@radix-ui/react-one-time-password-field"),1),ko=require("clsx"),So=require("react");var Po={otp:"R",input:"a"};var Ro=require("react/jsx-runtime"),be=(0,So.forwardRef)(({className:o,...t},e)=>(0,Ro.jsx)(eo.Root,{ref:e,className:(0,ko.clsx)(Po.otp,o),...t})),xe=(0,So.forwardRef)(({className:o,...t},e)=>(0,Ro.jsx)(eo.Input,{ref:e,className:(0,ko.clsx)(Po.input,o),...t})),Ce=Object.assign(be,{Input:xe});var at=require("clsx"),ct=require("react");var L={pagination:"S",arrow:"o",item:"e",trunc:"T"};var u=require("react/jsx-runtime"),ke=(0,ct.forwardRef)(({className:o,page:t,totalPages:e,maxVisible:r=5,onChange:s,...a},c)=>{let p=Math.ceil(r/2),l=d=>(0,u.jsx)("button",{type:"button",className:L.item,onClick:()=>s(d),"data-active":t===d,children:d},d);return(0,u.jsxs)("div",{ref:c,className:(0,at.clsx)(L.pagination,o),...a,children:[e>1&&(0,u.jsx)("button",{className:L.arrow,type:"button",disabled:t===1,onClick:()=>t>1&&s(t-1),children:(0,u.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","aria-hidden":"true",children:(0,u.jsx)("path",{d:"m15 18-6-6 6-6"})})}),e<=r+2?Array(e).fill(0).map((d,f)=>l(f+1)):(0,u.jsxs)(u.Fragment,{children:[l(1),t>1+p&&(0,u.jsx)("span",{className:L.trunc,children:"..."}),Array(r).fill(0).map((d,f)=>{let g=t-p+f+1;return g>1&&g<e?l(g):""}),t<e-p&&(0,u.jsx)("span",{className:L.trunc,children:"..."}),l(e)]}),e>1&&(0,u.jsx)("button",{className:L.arrow,type:"button",disabled:t===e,onClick:()=>t<e&&s(t+1),children:(0,u.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","aria-hidden":"true",children:(0,u.jsx)("path",{d:"m9 18 6-6-6-6"})})})]})});var z=R(require("@radix-ui/react-popover"),1),lt=require("clsx"),dt=require("react");var pt={"slide-up-and-fade":"k","slide-right-and-fade":"z","slide-down-and-fade":"j","slide-left-and-fade":"Y",content:"t"};var ht=require("react/jsx-runtime"),Re=(0,dt.forwardRef)(({className:o,...t},e)=>(0,ht.jsx)(z.Content,{ref:e,className:(0,lt.clsx)(pt.content,o),...t})),ze=Object.assign(z.Root,{Trigger:z.Trigger,Portal:z.Portal,Content:Re});var mt=require("@cocso-ui/react-icons"),ft=require("clsx"),gt=require("react"),ut=require("ts-pattern");var ro={wrapper:"U",select:"X",icon:"q"};var I=require("react/jsx-runtime"),He=(0,gt.forwardRef)(({className:o,style:t,size:e="md",disabled:r=!1,children:s,...a},c)=>{let p={...t,...We(e)};return(0,I.jsxs)("div",{className:ro.wrapper,children:[(0,I.jsx)("select",{ref:c,className:(0,ft.clsx)(ro.select,o),style:p,disabled:r,...a,children:s}),(0,I.jsx)("span",{className:ro.icon,children:(0,I.jsx)(mt.KeyboardArrowDownIcon,{size:20})})]})}),We=o=>(0,ut.match)(o).with("2xs",()=>({"--cocso-select-min-width":n.s11,"--cocso-select-height":n.s11,"--cocso-select-padding-left":n.s5,"--cocso-select-padding-right":`calc(${n.s8} + 16px)`,"--cocso-select-font-size":"12px","--cocso-select-border-radius":n.s3})).with("xs",()=>({"--cocso-select-min-width":n.s12,"--cocso-select-height":n.s12,"--cocso-select-padding-left":n.s6,"--cocso-select-padding-right":`calc(${n.s7} + 16px)`,"--cocso-select-font-size":"14px","--cocso-select-border-radius":n.s3})).with("sm",()=>({"--cocso-select-min-width":n.s14,"--cocso-select-height":n.s14,"--cocso-select-padding-left":n.s7,"--cocso-select-padding-right":`calc(${n.s7} + 16px)`,"--cocso-select-font-size":"14px","--cocso-select-border-radius":n.s3})).with("md",()=>({"--cocso-select-min-width":n.s16,"--cocso-select-height":n.s16,"--cocso-select-padding-left":n.s8,"--cocso-select-padding-right":`calc(${n.s8} + 16px)`,"--cocso-select-font-size":"16px","--cocso-select-border-radius":n.s4})).with("lg",()=>({"--cocso-select-min-width":n.s17,"--cocso-select-height":n.s17,"--cocso-select-padding-left":n.s9,"--cocso-select-padding-right":`calc(${n.s9} + 16px)`,"--cocso-select-font-size":"18px","--cocso-select-border-radius":n.s4})).with("xl",()=>({"--cocso-select-min-width":n.s18,"--cocso-select-height":n.s18,"--cocso-select-padding-left":n.s10,"--cocso-select-padding-right":`calc(${n.s10} + 16px)`,"--cocso-select-font-size":"18px","--cocso-select-border-radius":n.s4})).exhaustive();var vt=require("clsx"),wt=require("react"),yt=require("ts-pattern");var zo={stock:"V",indicator:"Z"};var h=require("react/jsx-runtime"),Le=(0,wt.forwardRef)(({className:o,style:t,onChange:e,quantity:r,...s},a)=>{let c={...t,"--cocso-stock-quantity-status-color":bt(r),"--cocso-stock-quantity-status-indicator-width":n.s9};return(0,h.jsxs)("div",{ref:a,className:(0,vt.clsx)(zo.stock,o),style:c,...s,children:[(0,h.jsx)("span",{className:zo.indicator,children:r==="\uC5EC\uC720"?(0,h.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[(0,h.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,h.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,h.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"})]}):r==="\uBCF4\uD1B5"?(0,h.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[(0,h.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,h.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,h.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,h.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[(0,h.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,h.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,h.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,h.jsx)(v,{size:"sm",color:"currentColor",children:r})]})}),bt=o=>(0,yt.match)(o).with("\uC5EC\uC720",()=>i.primary500).with("\uBCF4\uD1B5",()=>i.success400).with("\uBD80\uC871",()=>i.danger500).exhaustive();var Ct=require("@radix-ui/react-primitive"),no=R(require("@radix-ui/react-switch"),1),Pt=require("clsx"),so=require("react"),ao=require("ts-pattern");var io={wrapper:"A",switch:"n",thumb:"B"};var S=require("react/jsx-runtime"),Me=(0,so.forwardRef)(({id:o,className:t,style:e,size:r="md",position:s="right",disabled:a,label:c,...p},l)=>{let d=(0,so.useId)(),f=o??d,g={...e,"--cocso-switch-width":De(r),"--cocso-switch-height":Ne(r),"--cocso-switch-thumb-width":xt(r),"--cocso-switch-thumb-height":xt(r),"--cocso-switch-bg-color":i.neutral100};return(0,S.jsxs)(Ct.Primitive.div,{className:(0,Pt.clsx)(io.wrapper,t),"aria-disabled":a,style:g,children:[s==="left"&&(0,S.jsx)(v,{size:r,asChild:!0,children:(0,S.jsx)("label",{htmlFor:f,children:c})}),(0,S.jsx)(no.Root,{ref:l,className:io.switch,disabled:a,...p,children:(0,S.jsx)(no.Thumb,{className:io.thumb})}),s==="right"&&(0,S.jsx)(v,{size:r,"aria-disabled":a,asChild:!0,children:(0,S.jsx)("label",{htmlFor:f,children:c})})]})}),De=o=>(0,ao.match)(o).with("lg",()=>n.s14).with("md",()=>n.s12).exhaustive(),Ne=o=>(0,ao.match)(o).with("lg",()=>n.s10).with("md",()=>n.s9).exhaustive(),xt=o=>(0,ao.match)(o).with("lg",()=>n.s9).with("md",()=>n.s8).exhaustive();var T=R(require("@radix-ui/react-tabs"),1),Q=require("react"),X=require("react/jsx-runtime"),Ae=(0,Q.forwardRef)(({...o},t)=>(0,X.jsx)(T.Root,{ref:t,...o})),Oe=(0,Q.forwardRef)(({...o},t)=>(0,X.jsx)(T.List,{ref:t,...o})),Ie=(0,Q.forwardRef)(({...o},t)=>(0,X.jsx)(T.Trigger,{ref:t,...o})),Ve=(0,Q.forwardRef)(({...o},t)=>(0,X.jsx)(T.Content,{ref:t,...o})),Ee=Object.assign(Ae,{List:Oe,Trigger:Ie,Content:Ve});var co=require("sonner");
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{KeyboardArrowDownIcon as Lt}from"@cocso-ui/react-icons";import*as v from"@radix-ui/react-accordion";import{clsx as U}from"clsx";import{forwardRef as tt}from"react";var M={item:"C",content:"c","slide-down":"g","slide-up":"b",trigger:"s",chevron:"d"};import{jsx as ot,jsxs as Nt}from"react/jsx-runtime";var Ft=tt(({className:t,...o},e)=>ot(v.Item,{ref:e,className:U(M.item,t),...o})),Mt=tt(({className:t,children:o,chevron:e=!0,...r},s)=>Nt(v.Trigger,{ref:s,className:U(M.trigger,t),...r,children:[o,e&&ot(Lt,{className:M.chevron})]})),Dt=tt(({className:t,...o},e)=>ot(v.Content,{ref:e,className:U(M.content,t),...o})),Ne=Object.assign(v.Root,{Item:Ft,Header:v.Header,Trigger:Mt,Content:Dt});import{forwardRef as $t}from"react";import{match as Yt}from"ts-pattern";import{Primitive as Ot}from"@radix-ui/react-primitive";import{Slot as It}from"@radix-ui/react-slot";import{clsx as Vt}from"clsx";import{forwardRef as Et}from"react";var i={transparent:"var(--ds-transparent)",white:"var(--ds-white)",whiteAlpha5:"var(--ds-white-alpha-5)",whiteAlpha10:"var(--ds-white-alpha-10)",whiteAlpha20:"var(--ds-white-alpha-20)",whiteAlpha30:"var(--ds-white-alpha-30)",whiteAlpha40:"var(--ds-white-alpha-40)",whiteAlpha50:"var(--ds-white-alpha-50)",whiteAlpha60:"var(--ds-white-alpha-60)",whiteAlpha70:"var(--ds-white-alpha-70)",whiteAlpha80:"var(--ds-white-alpha-80)",whiteAlpha90:"var(--ds-white-alpha-90)",black:"var(--ds-black)",blackAlpha5:"var(--ds-black-alpha-5)",blackAlpha10:"var(--ds-black-alpha-10)",blackAlpha20:"var(--ds-black-alpha-20)",blackAlpha30:"var(--ds-black-alpha-30)",blackAlpha40:"var(--ds-black-alpha-40)",blackAlpha50:"var(--ds-black-alpha-50)",blackAlpha60:"var(--ds-black-alpha-60)",blackAlpha70:"var(--ds-black-alpha-70)",blackAlpha80:"var(--ds-black-alpha-80)",blackAlpha90:"var(--ds-black-alpha-90)",neutral50:"var(--ds-neutral-50)",neutral100:"var(--ds-neutral-100)",neutral200:"var(--ds-neutral-200)",neutral300:"var(--ds-neutral-300)",neutral400:"var(--ds-neutral-400)",neutral500:"var(--ds-neutral-500)",neutral600:"var(--ds-neutral-600)",neutral700:"var(--ds-neutral-700)",neutral800:"var(--ds-neutral-800)",neutral900:"var(--ds-neutral-900)",neutral950:"var(--ds-neutral-950)",primary50:"var(--ds-primary-50)",primary100:"var(--ds-primary-100)",primary200:"var(--ds-primary-200)",primary300:"var(--ds-primary-300)",primary400:"var(--ds-primary-400)",primary500:"var(--ds-primary-500)",primary600:"var(--ds-primary-600)",primary700:"var(--ds-primary-700)",primary800:"var(--ds-primary-800)",primary900:"var(--ds-primary-900)",primary950:"var(--ds-primary-950)",danger50:"var(--ds-danger-50)",danger100:"var(--ds-danger-100)",danger200:"var(--ds-danger-200)",danger300:"var(--ds-danger-300)",danger400:"var(--ds-danger-400)",danger500:"var(--ds-danger-500)",danger600:"var(--ds-danger-600)",danger700:"var(--ds-danger-700)",danger800:"var(--ds-danger-800)",danger900:"var(--ds-danger-900)",danger950:"var(--ds-danger-950)",warning50:"var(--ds-warning-50)",warning100:"var(--ds-warning-100)",warning200:"var(--ds-warning-200)",warning300:"var(--ds-warning-300)",warning400:"var(--ds-warning-400)",warning500:"var(--ds-warning-500)",warning600:"var(--ds-warning-600)",warning700:"var(--ds-warning-700)",warning800:"var(--ds-warning-800)",warning900:"var(--ds-warning-900)",warning950:"var(--ds-warning-950)",success50:"var(--ds-success-50)",success100:"var(--ds-success-100)",success200:"var(--ds-success-200)",success300:"var(--ds-success-300)",success400:"var(--ds-success-400)",success500:"var(--ds-success-500)",success600:"var(--ds-success-600)",success700:"var(--ds-success-700)",success800:"var(--ds-success-800)",success900:"var(--ds-success-900)",success950:"var(--ds-success-950)"};var n={s0:"var(--ds-spacing-0)",s1:"var(--ds-spacing-1)",s2:"var(--ds-spacing-2)",s3:"var(--ds-spacing-3)",s4:"var(--ds-spacing-4)",s5:"var(--ds-spacing-5)",s6:"var(--ds-spacing-6)",s7:"var(--ds-spacing-7)",s8:"var(--ds-spacing-8)",s9:"var(--ds-spacing-9)",s10:"var(--ds-spacing-10)",s11:"var(--ds-spacing-11)",s12:"var(--ds-spacing-12)",s13:"var(--ds-spacing-13)",s14:"var(--ds-spacing-14)",s15:"var(--ds-spacing-15)",s16:"var(--ds-spacing-16)",s17:"var(--ds-spacing-17)",s18:"var(--ds-spacing-18)",s19:"var(--ds-spacing-19)",s20:"var(--ds-spacing-20)",s21:"var(--ds-spacing-21)",max:"var(--ds-spacing-max)"};var V={10:10,11:11,12:12,13:13,14:14,15:15,16:16,18:18,20:20,24:24,28:28,32:32,36:36,44:44,60:60},E={thin:100,extralight:200,light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800,black:900},lt={none:1,tight:1.25,snug:1.375,normal:1.5,relaxed:1.625,loose:2};var dt={typography:"i"};import{jsx as Zt}from"react/jsx-runtime";var H=Et(({asChild:t,className:o,style:e,color:r,size:s=16,weight:a="normal",lineHeight:c="normal",...p},l)=>{let d=t?It:Ot.p,m,f,b;Array.isArray(s)?[m,f,b]=s:typeof s=="object"?{base:m,tablet:f,desktop:b}=s:m=s;let T={...e,"--cocso-typography-font-color":r,"--cocso-typography-font-size":`${V[m]}px`,...f!==void 0&&{"--cocso-tablet-typography-font-size":`${V[f]}px`},...b!==void 0&&{"--cocso-desktop-typography-font-size":`${V[b]}px`},"--cocso-typography-font-weight":E[a],"--cocso-typography-line-height":lt[c]};return Zt(d,{ref:l,className:Vt(dt.typography,o),style:T,...p})});import{jsx as Qt}from"react/jsx-runtime";var g=$t(({asChild:t,style:o,color:e,size:r="md",weight:s,lineHeight:a,...c},p)=>{let l=qt(r);return Qt(H,{ref:p,color:e,size:l,weight:s,lineHeight:a,asChild:t,...c})}),qt=t=>Yt(t).with("lg",()=>18).with("md",()=>16).with("sm",()=>14).with("xs",()=>12).exhaustive();import{Primitive as io}from"@radix-ui/react-primitive";import{clsx as ft}from"clsx";import{cloneElement as no,forwardRef as so,isValidElement as ao}from"react";import{match as w}from"ts-pattern";import{Primitive as _t}from"@radix-ui/react-primitive";import{Slot as jt}from"@radix-ui/react-slot";import{clsx as Kt}from"clsx";import{forwardRef as Gt}from"react";import{match as Z}from"ts-pattern";var ht={"donut-spin":"u",spinner:"D"};import{jsx as eo}from"react/jsx-runtime";var mt=Gt(({asChild:t,className:o,style:e,size:r="md",color:s="primary",...a},c)=>{let p=t?jt:_t.div,l={...e,"--cocso-spinner-size":Jt(r),"--cocso-spinner-border-width":Ut(r),"--cocso-spinner-border-color":to(s),"--cocso-spinner-bg-color":oo(s)};return eo(p,{ref:c,className:Kt(ht.spinner,o),style:l,...a})}),Jt=t=>Z(t).with("xl",()=>"40px").with("lg",()=>"32px").with("md",()=>"24px").with("sm",()=>"20px").exhaustive(),Ut=t=>Z(t).with("xl",()=>"5px").with("lg",()=>"4px").with("md",()=>"3px").with("sm",()=>"2px").exhaustive(),to=t=>Z(t).with("primary",()=>i.primary500).with("neutral",()=>i.neutral600).with("white",()=>i.white).exhaustive(),oo=t=>Z(t).with("primary",()=>i.primary100).with("neutral",()=>i.neutral100).with("white",()=>i.whiteAlpha20).exhaustive();var R={button:"l",disabled:"h",content:"E",prefix:"F",suffix:"G",svgOnly:"H"};import{Fragment as uo,jsx as D,jsxs as vo}from"react/jsx-runtime";var Lr=so(({asChild:t,className:o,style:e,children:r,size:s="md",variant:a="primary",weight:c="medium",shape:p="square",prefix:l,suffix:d,svgOnly:m=!1,disabled:f=!1,loading:b=!1,...T},A)=>{let O={...e,...co(s),"--cocso-button-font-color":lo(a),"--cocso-button-font-weight":E[c],"--cocso-button-border":ho(a),"--cocso-button-border-radius":po(p,s),"--cocso-button-bg-color":mo(a),"--cocso-button-bg-color-hover":fo(a),"--cocso-button-bg-color-active":go(a)},I=f||b,ct=ft(R.button,I&&R.disabled,m&&R.svgOnly,o),pt=S=>vo(uo,{children:[b&&D(mt,{size:"sm",color:"white"}),l&&D("span",{className:R.prefix,children:l}),D("span",{className:R.content,children:S}),d&&D("span",{className:R.suffix,children:d})]});if(t){if(!ao(r))throw new Error("Button: asChild requires a single React element as a child");let S=r,Wt=S.props.children;return no(S,{ref:A,...T,...S.props,className:ft(ct,S.props.className),style:{...O,...S.props.style},children:pt(Wt)})}return D(io.button,{ref:A,className:ct,disabled:I,style:O,...T,children:pt(r)})}),co=t=>{let o=w(t).with("xl",()=>56).with("lg",()=>48).with("md",()=>40).with("sm",()=>32).with("xs",()=>24).exhaustive(),e=w(t).with("xl",()=>16).with("lg",()=>14).with("md",()=>10).with("sm",()=>6).with("xs",()=>0).exhaustive(),r=w(t).with("xl",()=>16).with("lg",()=>16).with("xs",()=>12).otherwise(()=>14);return{"--cocso-button-height":`${o}px`,"--cocso-button-padding-inline":`${e}px`,"--cocso-button-font-size":`${r}px`}},po=(t,o)=>w(t).with("square",()=>w(o).with("xs",()=>"4px").otherwise(()=>"6px")).with("circle",()=>"100%").with("rounded",()=>"100px").exhaustive(),lo=t=>w(t).with("primary","success","error","neutral",()=>i.white).with("secondary","tertiary","warning",()=>i.neutral950).exhaustive(),ho=t=>w(t).with("tertiary",()=>`1px solid ${i.neutral100}`).otherwise(()=>"none"),mo=t=>w(t).with("primary",()=>i.primary500).with("secondary",()=>i.white).with("tertiary",()=>i.transparent).with("success",()=>i.success500).with("error",()=>i.danger500).with("warning",()=>i.warning300).with("neutral",()=>i.neutral950).exhaustive(),fo=t=>w(t).with("primary",()=>i.primary600).with("secondary",()=>i.neutral50).with("tertiary",()=>i.neutral50).with("success",()=>i.success600).with("error",()=>i.danger600).with("warning",()=>i.warning400).with("neutral",()=>i.neutral800).exhaustive(),go=t=>w(t).with("primary",()=>i.primary700).with("secondary",()=>i.neutral100).with("tertiary",()=>i.neutral100).with("success",()=>i.success700).with("error",()=>i.danger700).with("warning",()=>i.warning500).with("neutral",()=>i.neutral700).exhaustive();import{CheckIcon as gt}from"@cocso-ui/react-icons";import*as $ from"@radix-ui/react-checkbox";import{clsx as yo}from"clsx";import{forwardRef as bo,useId as xo}from"react";import{match as N}from"ts-pattern";var W={wrapper:"I",checkbox:"r",indicator:"J",label:"v"};import{jsx as B,jsxs as ut}from"react/jsx-runtime";var qr=bo(({id:t,className:o,style:e,size:r="md",status:s,onChange:a,label:c,disabled:p,...l},d)=>{let m=xo(),f=t??m,b=O=>{if(!p){let I=N(O).with(!0,()=>"on").with("indeterminate",()=>"intermediate").with(!1,()=>"off").exhaustive();a(I)}},T=()=>N(s).with("on",()=>!0).with("intermediate",()=>"indeterminate").with("off",()=>!1).exhaustive(),A={...e,"--cocso-checkbox-size":Co(r),"--cocso-checkbox-color":i.white,"--cocso-checkbox-border-color":Po(s),"--cocso-checkbox-bg-color":ko(s)};return ut("div",{className:yo(W.wrapper,o),style:A,children:[ut($.Root,{ref:d,id:f,className:W.checkbox,checked:T(),onCheckedChange:b,disabled:p,...l,children:[B($.Indicator,{className:W.indicator,style:{opacity:s==="on"?1:0},"aria-hidden":"true",children:B(gt,{size:24})}),B("div",{className:W.indicator,style:{opacity:s==="intermediate"?1:0},"aria-hidden":"true",children:B(gt,{size:24})})]}),c&&B(g,{className:W.label,size:r,"aria-disabled":p,asChild:!0,children:B("label",{htmlFor:f,children:c})})]})}),Co=t=>N(t).with("lg",()=>n.s10).with("md",()=>n.s9).with("sm",()=>n.s8).exhaustive(),Po=t=>N(t).with("on",()=>i.primary500).with("intermediate",()=>i.primary500).with("off",()=>i.neutral100).exhaustive(),ko=t=>N(t).with("on",()=>i.primary500).with("intermediate",()=>i.primary500).with("off",()=>i.white).exhaustive();import{Slot as So}from"@radix-ui/react-slot";import{forwardRef as Ro}from"react";import{match as zo}from"ts-pattern";import{jsx as vt}from"react/jsx-runtime";var ti=Ro(({asChild:t,className:o,color:e,size:r="md",weight:s,lineHeight:a,...c},p)=>{let l=t?So:"h1",d=To(r);return vt(H,{ref:p,color:e,size:d,weight:s,lineHeight:a,asChild:!0,children:vt(l,{...c})})}),To=t=>zo(t).with("lg",()=>({base:44,tablet:60})).with("md",()=>({base:32,tablet:44})).with("sm",()=>({base:28,tablet:36})).exhaustive();import*as y from"@radix-ui/react-dropdown-menu";import{clsx as wt}from"clsx";import{forwardRef as yt}from"react";var et={"dropdown-slide-up":"f","dropdown-slide-down":"m",content:"p",item:"K"};import{jsx as bt}from"react/jsx-runtime";var Wo=yt(({className:t,...o},e)=>bt(y.Content,{ref:e,className:wt(et.content,t),...o})),Bo=yt(({className:t,...o},e)=>bt(y.Item,{ref:e,className:wt(et.item,t),...o})),pi=Object.assign(y.Root,{Trigger:y.Trigger,Portal:y.Portal,Content:Wo,Item:Bo});import{Primitive as Lo}from"@radix-ui/react-primitive";import{Slot as Fo}from"@radix-ui/react-slot";import{forwardRef as Mo}from"react";import{match as Do}from"ts-pattern";import{jsx as xt}from"react/jsx-runtime";var Ct=Mo(({asChild:t,className:o,color:e,size:r="md",weight:s="bold",lineHeight:a,...c},p)=>{let l=t?Fo:Lo.h2,d=No(r);return xt(H,{ref:p,color:e,size:d,weight:s,lineHeight:a,asChild:!0,children:xt(l,{...c})})}),No=t=>Do(t).with("xl",()=>({base:28,tablet:40})).with("lg",()=>({base:24,tablet:32})).with("md",()=>({base:22,tablet:24})).with("sm",()=>18).with("xs",()=>16).exhaustive();import{Primitive as Oo}from"@radix-ui/react-primitive";import{Slot as Io}from"@radix-ui/react-slot";import{clsx as Vo}from"clsx";import{forwardRef as Eo}from"react";var rt={link:"y",indicator:"L"};import{jsx as Pt}from"react/jsx-runtime";var Wi=Eo(({asChild:t,className:o,size:e,weight:r,lineHeight:s,indicator:a=!0,...c},p)=>{let l=t?Io:Oo.a;return Pt(g,{size:e,weight:r,lineHeight:s,asChild:!0,children:Pt(l,{ref:p,className:Vo(rt.link,a&&rt.indicator,o),...c})})});import{CloseIcon as $o}from"@cocso-ui/react-icons";import*as h from"@radix-ui/react-dialog";import{clsx as Y}from"clsx";import{forwardRef as q}from"react";var L={"overlay-show":"w",overlay:"M","content-show":"x",content:"N",close:"O",title:"P",description:"Q"};import{jsx as C,jsxs as _o}from"react/jsx-runtime";var Yo=q(({className:t,children:o,...e},r)=>_o(h.Portal,{children:[C(h.Overlay,{className:L.overlay}),C(h.Content,{ref:r,className:Y(L.content,t),...e,children:o})]})),qo=q(({className:t,children:o,...e},r)=>C(h.Close,{ref:r,className:Y(L.close,t),...e,children:C($o,{size:24})})),Qo=q(({className:t,children:o,...e},r)=>C(h.Title,{ref:r,className:Y(L.title,t),asChild:!0,...e,children:C(Ct,{color:"text.basic",children:o})})),Xo=q(({className:t,children:o,...e},r)=>C(h.Description,{ref:r,className:Y(L.description,t),asChild:!0,...e,children:C(g,{size:"sm",color:"text.subtle",children:o})})),Zi=Object.assign(h.Root,{Trigger:h.Trigger,Content:Yo,Close:qo,Title:Qo,Description:Xo});import*as Q from"@radix-ui/react-one-time-password-field";import{clsx as kt}from"clsx";import{forwardRef as St}from"react";var it={otp:"R",input:"a"};import{jsx as Rt}from"react/jsx-runtime";var Ko=St(({className:t,...o},e)=>Rt(Q.Root,{ref:e,className:kt(it.otp,t),...o})),Go=St(({className:t,...o},e)=>Rt(Q.Input,{ref:e,className:kt(it.input,t),...o})),Gi=Object.assign(Ko,{Input:Go});import{clsx as Uo}from"clsx";import{forwardRef as te}from"react";var z={pagination:"S",arrow:"o",item:"e",trunc:"T"};import{Fragment as oe,jsx as x,jsxs as zt}from"react/jsx-runtime";var an=te(({className:t,page:o,totalPages:e,maxVisible:r=5,onChange:s,...a},c)=>{let p=Math.ceil(r/2),l=d=>x("button",{type:"button",className:z.item,onClick:()=>s(d),"data-active":o===d,children:d},d);return zt("div",{ref:c,className:Uo(z.pagination,t),...a,children:[e>1&&x("button",{className:z.arrow,type:"button",disabled:o===1,onClick:()=>o>1&&s(o-1),children:x("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","aria-hidden":"true",children:x("path",{d:"m15 18-6-6 6-6"})})}),e<=r+2?Array(e).fill(0).map((d,m)=>l(m+1)):zt(oe,{children:[l(1),o>1+p&&x("span",{className:z.trunc,children:"..."}),Array(r).fill(0).map((d,m)=>{let f=o-p+m+1;return f>1&&f<e?l(f):""}),o<e-p&&x("span",{className:z.trunc,children:"..."}),l(e)]}),e>1&&x("button",{className:z.arrow,type:"button",disabled:o===e,onClick:()=>o<e&&s(o+1),children:x("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","aria-hidden":"true",children:x("path",{d:"m9 18 6-6-6-6"})})})]})});import*as P from"@radix-ui/react-popover";import{clsx as re}from"clsx";import{forwardRef as ie}from"react";var Tt={"slide-up-and-fade":"k","slide-right-and-fade":"z","slide-down-and-fade":"j","slide-left-and-fade":"Y",content:"t"};import{jsx as se}from"react/jsx-runtime";var ne=ie(({className:t,...o},e)=>se(P.Content,{ref:e,className:re(Tt.content,t),...o})),un=Object.assign(P.Root,{Trigger:P.Trigger,Portal:P.Portal,Content:ne});import{KeyboardArrowDownIcon as ce}from"@cocso-ui/react-icons";import{clsx as pe}from"clsx";import{forwardRef as le}from"react";import{match as de}from"ts-pattern";var X={wrapper:"U",select:"X",icon:"q"};import{jsx as nt,jsxs as me}from"react/jsx-runtime";var Tn=le(({className:t,style:o,size:e="md",disabled:r=!1,children:s,...a},c)=>{let p={...o,...he(e)};return me("div",{className:X.wrapper,children:[nt("select",{ref:c,className:pe(X.select,t),style:p,disabled:r,...a,children:s}),nt("span",{className:X.icon,children:nt(ce,{size:20})})]})}),he=t=>de(t).with("2xs",()=>({"--cocso-select-min-width":n.s11,"--cocso-select-height":n.s11,"--cocso-select-padding-left":n.s5,"--cocso-select-padding-right":`calc(${n.s8} + 16px)`,"--cocso-select-font-size":"12px","--cocso-select-border-radius":n.s3})).with("xs",()=>({"--cocso-select-min-width":n.s12,"--cocso-select-height":n.s12,"--cocso-select-padding-left":n.s6,"--cocso-select-padding-right":`calc(${n.s7} + 16px)`,"--cocso-select-font-size":"14px","--cocso-select-border-radius":n.s3})).with("sm",()=>({"--cocso-select-min-width":n.s14,"--cocso-select-height":n.s14,"--cocso-select-padding-left":n.s7,"--cocso-select-padding-right":`calc(${n.s7} + 16px)`,"--cocso-select-font-size":"14px","--cocso-select-border-radius":n.s3})).with("md",()=>({"--cocso-select-min-width":n.s16,"--cocso-select-height":n.s16,"--cocso-select-padding-left":n.s8,"--cocso-select-padding-right":`calc(${n.s8} + 16px)`,"--cocso-select-font-size":"16px","--cocso-select-border-radius":n.s4})).with("lg",()=>({"--cocso-select-min-width":n.s17,"--cocso-select-height":n.s17,"--cocso-select-padding-left":n.s9,"--cocso-select-padding-right":`calc(${n.s9} + 16px)`,"--cocso-select-font-size":"18px","--cocso-select-border-radius":n.s4})).with("xl",()=>({"--cocso-select-min-width":n.s18,"--cocso-select-height":n.s18,"--cocso-select-padding-left":n.s10,"--cocso-select-padding-right":`calc(${n.s10} + 16px)`,"--cocso-select-font-size":"18px","--cocso-select-border-radius":n.s4})).exhaustive();import{clsx as ge}from"clsx";import{forwardRef as ue}from"react";import{match as ve}from"ts-pattern";var st={stock:"V",indicator:"Z"};import{jsx as u,jsxs as _}from"react/jsx-runtime";var Vn=ue(({className:t,style:o,onChange:e,quantity:r,...s},a)=>{let c={...o,"--cocso-stock-quantity-status-color":we(r),"--cocso-stock-quantity-status-indicator-width":n.s9};return _("div",{ref:a,className:ge(st.stock,t),style:c,...s,children:[u("span",{className:st.indicator,children:r==="\uC5EC\uC720"?_("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[u("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"}),u("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"}),u("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"})]}):r==="\uBCF4\uD1B5"?_("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[u("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"}),u("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"}),u("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"})]}):_("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[u("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"}),u("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"}),u("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"})]})}),u(g,{size:"sm",color:"currentColor",children:r})]})}),we=t=>ve(t).with("\uC5EC\uC720",()=>i.primary500).with("\uBCF4\uD1B5",()=>i.success400).with("\uBD80\uC871",()=>i.danger500).exhaustive();import{Primitive as be}from"@radix-ui/react-primitive";import*as K from"@radix-ui/react-switch";import{clsx as xe}from"clsx";import{forwardRef as Ce,useId as Pe}from"react";import{match as at}from"ts-pattern";var j={wrapper:"A",switch:"n",thumb:"B"};import{jsx as F,jsxs as Re}from"react/jsx-runtime";var Un=Ce(({id:t,className:o,style:e,size:r="md",position:s="right",disabled:a,label:c,...p},l)=>{let d=Pe(),m=t??d,f={...e,"--cocso-switch-width":ke(r),"--cocso-switch-height":Se(r),"--cocso-switch-thumb-width":Ht(r),"--cocso-switch-thumb-height":Ht(r),"--cocso-switch-bg-color":i.neutral100};return Re(be.div,{className:xe(j.wrapper,o),"aria-disabled":a,style:f,children:[s==="left"&&F(g,{size:r,asChild:!0,children:F("label",{htmlFor:m,children:c})}),F(K.Root,{ref:l,className:j.switch,disabled:a,...p,children:F(K.Thumb,{className:j.thumb})}),s==="right"&&F(g,{size:r,"aria-disabled":a,asChild:!0,children:F("label",{htmlFor:m,children:c})})]})}),ke=t=>at(t).with("lg",()=>n.s14).with("md",()=>n.s12).exhaustive(),Se=t=>at(t).with("lg",()=>n.s10).with("md",()=>n.s9).exhaustive(),Ht=t=>at(t).with("lg",()=>n.s9).with("md",()=>n.s8).exhaustive();import*as k from"@radix-ui/react-tabs";import{forwardRef as G}from"react";import{jsx as J}from"react/jsx-runtime";var ze=G(({...t},o)=>J(k.Root,{ref:o,...t})),Te=G(({...t},o)=>J(k.List,{ref:o,...t})),He=G(({...t},o)=>J(k.Trigger,{ref:o,...t})),We=G(({...t},o)=>J(k.Content,{ref:o,...t})),ns=Object.assign(ze,{List:Te,Trigger:He,Content:We});import{Toaster as hs,toast as ms}from"sonner";export{Ne as Accordion,g as Body,Lr as Button,qr as Checkbox,ti as Display,pi as Dropdown,Ct as Heading,Wi as Link,Zi as Modal,Gi as OneTimePasswordField,an as Pagination,un as Popover,Tn as Select,mt as Spinner,Vn as StockQuantityStatus,Un as Switch,ns as Tab,hs as Toaster,H as Typography,i as colors,V as fontSize,E as fontWeight,we as getColor,lt as lineHeight,n as spacing,ms as toast};
|
|
1
|
+
import{KeyboardArrowDownIcon as Fo}from"@cocso-ui/react-icons";import*as v from"@radix-ui/react-accordion";import{clsx as U}from"clsx";import{forwardRef as oo}from"react";var M={item:"C",content:"c","slide-down":"g","slide-up":"b",trigger:"s",chevron:"d"};import{jsx as to,jsxs as Ao}from"react/jsx-runtime";var Mo=oo(({className:o,...t},e)=>to(v.Item,{ref:e,className:U(M.item,o),...t})),Do=oo(({className:o,children:t,chevron:e=!0,...r},s)=>Ao(v.Trigger,{ref:s,className:U(M.trigger,o),...r,children:[t,e&&to(Fo,{className:M.chevron})]})),No=oo(({className:o,...t},e)=>to(v.Content,{ref:e,className:U(M.content,o),...t})),Ne=Object.assign(v.Root,{Item:Mo,Header:v.Header,Trigger:Do,Content:No});import{forwardRef as Yo}from"react";import{match as qo}from"ts-pattern";import{Primitive as Io}from"@radix-ui/react-primitive";import{Slot as Vo}from"@radix-ui/react-slot";import{clsx as Eo}from"clsx";import{forwardRef as Zo}from"react";var i={transparent:"var(--ds-color-transparent)",white:"var(--ds-color-white)",whiteAlpha5:"var(--ds-color-white-alpha-5)",whiteAlpha10:"var(--ds-color-white-alpha-10)",whiteAlpha20:"var(--ds-color-white-alpha-20)",whiteAlpha30:"var(--ds-color-white-alpha-30)",whiteAlpha40:"var(--ds-color-white-alpha-40)",whiteAlpha50:"var(--ds-color-white-alpha-50)",whiteAlpha60:"var(--ds-color-white-alpha-60)",whiteAlpha70:"var(--ds-color-white-alpha-70)",whiteAlpha80:"var(--ds-color-white-alpha-80)",whiteAlpha90:"var(--ds-color-white-alpha-90)",black:"var(--ds-color-black)",blackAlpha5:"var(--ds-color-black-alpha-5)",blackAlpha10:"var(--ds-color-black-alpha-10)",blackAlpha20:"var(--ds-color-black-alpha-20)",blackAlpha30:"var(--ds-color-black-alpha-30)",blackAlpha40:"var(--ds-color-black-alpha-40)",blackAlpha50:"var(--ds-color-black-alpha-50)",blackAlpha60:"var(--ds-color-black-alpha-60)",blackAlpha70:"var(--ds-color-black-alpha-70)",blackAlpha80:"var(--ds-color-black-alpha-80)",blackAlpha90:"var(--ds-color-black-alpha-90)",neutral50:"var(--ds-color-neutral-50)",neutral100:"var(--ds-color-neutral-100)",neutral200:"var(--ds-color-neutral-200)",neutral300:"var(--ds-color-neutral-300)",neutral400:"var(--ds-color-neutral-400)",neutral500:"var(--ds-color-neutral-500)",neutral600:"var(--ds-color-neutral-600)",neutral700:"var(--ds-color-neutral-700)",neutral800:"var(--ds-color-neutral-800)",neutral900:"var(--ds-color-neutral-900)",neutral950:"var(--ds-color-neutral-950)",primary50:"var(--ds-color-primary-50)",primary100:"var(--ds-color-primary-100)",primary200:"var(--ds-color-primary-200)",primary300:"var(--ds-color-primary-300)",primary400:"var(--ds-color-primary-400)",primary500:"var(--ds-color-primary-500)",primary600:"var(--ds-color-primary-600)",primary700:"var(--ds-color-primary-700)",primary800:"var(--ds-color-primary-800)",primary900:"var(--ds-color-primary-900)",primary950:"var(--ds-color-primary-950)",danger50:"var(--ds-color-danger-50)",danger100:"var(--ds-color-danger-100)",danger200:"var(--ds-color-danger-200)",danger300:"var(--ds-color-danger-300)",danger400:"var(--ds-color-danger-400)",danger500:"var(--ds-color-danger-500)",danger600:"var(--ds-color-danger-600)",danger700:"var(--ds-color-danger-700)",danger800:"var(--ds-color-danger-800)",danger900:"var(--ds-color-danger-900)",danger950:"var(--ds-color-danger-950)",warning50:"var(--ds-color-warning-50)",warning100:"var(--ds-color-warning-100)",warning200:"var(--ds-color-warning-200)",warning300:"var(--ds-color-warning-300)",warning400:"var(--ds-color-warning-400)",warning500:"var(--ds-color-warning-500)",warning600:"var(--ds-color-warning-600)",warning700:"var(--ds-color-warning-700)",warning800:"var(--ds-color-warning-800)",warning900:"var(--ds-color-warning-900)",warning950:"var(--ds-color-warning-950)",success50:"var(--ds-color-success-50)",success100:"var(--ds-color-success-100)",success200:"var(--ds-color-success-200)",success300:"var(--ds-color-success-300)",success400:"var(--ds-color-success-400)",success500:"var(--ds-color-success-500)",success600:"var(--ds-color-success-600)",success700:"var(--ds-color-success-700)",success800:"var(--ds-color-success-800)",success900:"var(--ds-color-success-900)",success950:"var(--ds-color-success-950)"};var n={s0:"var(--ds-spacing-0)",s1:"var(--ds-spacing-1)",s2:"var(--ds-spacing-2)",s3:"var(--ds-spacing-3)",s4:"var(--ds-spacing-4)",s5:"var(--ds-spacing-5)",s6:"var(--ds-spacing-6)",s7:"var(--ds-spacing-7)",s8:"var(--ds-spacing-8)",s9:"var(--ds-spacing-9)",s10:"var(--ds-spacing-10)",s11:"var(--ds-spacing-11)",s12:"var(--ds-spacing-12)",s13:"var(--ds-spacing-13)",s14:"var(--ds-spacing-14)",s15:"var(--ds-spacing-15)",s16:"var(--ds-spacing-16)",s17:"var(--ds-spacing-17)",s18:"var(--ds-spacing-18)",s19:"var(--ds-spacing-19)",s20:"var(--ds-spacing-20)",s21:"var(--ds-spacing-21)",max:"var(--ds-spacing-max)"};var V={10:10,11:11,12:12,13:13,14:14,15:15,16:16,18:18,20:20,24:24,28:28,32:32,36:36,44:44,60:60},E={thin:100,extralight:200,light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800,black:900},lo={none:1,tight:1.25,snug:1.375,normal:1.5,relaxed:1.625,loose:2};var ho={typography:"i"};import{jsx as $o}from"react/jsx-runtime";var H=Zo(({asChild:o,className:t,style:e,color:r,size:s=16,weight:a="normal",lineHeight:c="normal",...p},l)=>{let d=o?Vo:Io.p,m,f,b;Array.isArray(s)?[m,f,b]=s:typeof s=="object"?{base:m,tablet:f,desktop:b}=s:m=s;let T={...e,"--cocso-typography-font-color":r,"--cocso-typography-font-size":`${V[m]}px`,...f!==void 0&&{"--cocso-tablet-typography-font-size":`${V[f]}px`},...b!==void 0&&{"--cocso-desktop-typography-font-size":`${V[b]}px`},"--cocso-typography-font-weight":E[a],"--cocso-typography-line-height":lo[c]};return $o(d,{ref:l,className:Eo(ho.typography,t),style:T,...p})});import{jsx as Xo}from"react/jsx-runtime";var g=Yo(({asChild:o,style:t,color:e,size:r="md",weight:s,lineHeight:a,...c},p)=>{let l=Qo(r);return Xo(H,{ref:p,color:e,size:l,weight:s,lineHeight:a,asChild:o,...c})}),Qo=o=>qo(o).with("lg",()=>18).with("md",()=>16).with("sm",()=>14).with("xs",()=>12).exhaustive();import{Primitive as nt}from"@radix-ui/react-primitive";import{clsx as go}from"clsx";import{cloneElement as st,forwardRef as at,isValidElement as ct}from"react";import{match as w}from"ts-pattern";import{Primitive as jo}from"@radix-ui/react-primitive";import{Slot as Ko}from"@radix-ui/react-slot";import{clsx as Go}from"clsx";import{forwardRef as Jo}from"react";import{match as Z}from"ts-pattern";var mo={"donut-spin":"u",spinner:"D"};import{jsx as rt}from"react/jsx-runtime";var fo=Jo(({asChild:o,className:t,style:e,size:r="md",color:s="primary",...a},c)=>{let p=o?Ko:jo.div,l={...e,"--cocso-spinner-size":Uo(r),"--cocso-spinner-border-width":ot(r),"--cocso-spinner-border-color":tt(s),"--cocso-spinner-bg-color":et(s)};return rt(p,{ref:c,className:Go(mo.spinner,t),style:l,...a})}),Uo=o=>Z(o).with("xl",()=>"40px").with("lg",()=>"32px").with("md",()=>"24px").with("sm",()=>"20px").exhaustive(),ot=o=>Z(o).with("xl",()=>"5px").with("lg",()=>"4px").with("md",()=>"3px").with("sm",()=>"2px").exhaustive(),tt=o=>Z(o).with("primary",()=>i.primary500).with("neutral",()=>i.neutral600).with("white",()=>i.white).exhaustive(),et=o=>Z(o).with("primary",()=>i.primary100).with("neutral",()=>i.neutral100).with("white",()=>i.whiteAlpha20).exhaustive();var R={button:"l",disabled:"h",content:"E",prefix:"F",suffix:"G",svgOnly:"H"};import{Fragment as ut,jsx as D,jsxs as vt}from"react/jsx-runtime";var Lr=at(({asChild:o,className:t,style:e,children:r,size:s="md",variant:a="primary",weight:c="medium",shape:p="square",prefix:l,suffix:d,svgOnly:m=!1,disabled:f=!1,loading:b=!1,...T},A)=>{let O={...e,...pt(s),"--cocso-button-font-color":dt(a),"--cocso-button-font-weight":E[c],"--cocso-button-border":ht(a),"--cocso-button-border-radius":lt(p,s),"--cocso-button-bg-color":mt(a),"--cocso-button-bg-color-hover":ft(a),"--cocso-button-bg-color-active":gt(a)},I=f||b,co=go(R.button,I&&R.disabled,m&&R.svgOnly,t),po=S=>vt(ut,{children:[b&&D(fo,{size:"sm",color:"white"}),l&&D("span",{className:R.prefix,children:l}),D("span",{className:R.content,children:S}),d&&D("span",{className:R.suffix,children:d})]});if(o){if(!ct(r))throw new Error("Button: asChild requires a single React element as a child");let S=r,Bo=S.props.children;return st(S,{ref:A,...T,...S.props,className:go(co,S.props.className),style:{...O,...S.props.style},children:po(Bo)})}return D(nt.button,{ref:A,className:co,disabled:I,style:O,...T,children:po(r)})}),pt=o=>{let t=w(o).with("xl",()=>56).with("lg",()=>48).with("md",()=>40).with("sm",()=>32).with("xs",()=>24).exhaustive(),e=w(o).with("xl",()=>16).with("lg",()=>14).with("md",()=>10).with("sm",()=>6).with("xs",()=>0).exhaustive(),r=w(o).with("xl",()=>16).with("lg",()=>16).with("xs",()=>12).otherwise(()=>14);return{"--cocso-button-height":`${t}px`,"--cocso-button-padding-inline":`${e}px`,"--cocso-button-font-size":`${r}px`}},lt=(o,t)=>w(o).with("square",()=>w(t).with("xs",()=>"4px").otherwise(()=>"6px")).with("circle",()=>"100%").with("rounded",()=>"100px").exhaustive(),dt=o=>w(o).with("primary","success","error","neutral",()=>i.white).with("secondary","tertiary","warning",()=>i.neutral950).exhaustive(),ht=o=>w(o).with("tertiary",()=>`1px solid ${i.neutral100}`).otherwise(()=>"none"),mt=o=>w(o).with("primary",()=>i.primary500).with("secondary",()=>i.white).with("tertiary",()=>i.transparent).with("success",()=>i.success500).with("error",()=>i.danger500).with("warning",()=>i.warning300).with("neutral",()=>i.neutral950).exhaustive(),ft=o=>w(o).with("primary",()=>i.primary600).with("secondary",()=>i.neutral50).with("tertiary",()=>i.neutral50).with("success",()=>i.success600).with("error",()=>i.danger600).with("warning",()=>i.warning400).with("neutral",()=>i.neutral800).exhaustive(),gt=o=>w(o).with("primary",()=>i.primary700).with("secondary",()=>i.neutral100).with("tertiary",()=>i.neutral100).with("success",()=>i.success700).with("error",()=>i.danger700).with("warning",()=>i.warning500).with("neutral",()=>i.neutral700).exhaustive();import{CheckIcon as uo}from"@cocso-ui/react-icons";import*as $ from"@radix-ui/react-checkbox";import{clsx as yt}from"clsx";import{forwardRef as bt,useId as xt}from"react";import{match as N}from"ts-pattern";var W={wrapper:"I",checkbox:"r",indicator:"J",label:"v"};import{jsx as B,jsxs as vo}from"react/jsx-runtime";var qr=bt(({id:o,className:t,style:e,size:r="md",status:s,onChange:a,label:c,disabled:p,...l},d)=>{let m=xt(),f=o??m,b=O=>{if(!p){let I=N(O).with(!0,()=>"on").with("indeterminate",()=>"intermediate").with(!1,()=>"off").exhaustive();a(I)}},T=()=>N(s).with("on",()=>!0).with("intermediate",()=>"indeterminate").with("off",()=>!1).exhaustive(),A={...e,"--cocso-checkbox-size":Ct(r),"--cocso-checkbox-color":i.white,"--cocso-checkbox-border-color":Pt(s),"--cocso-checkbox-bg-color":kt(s)};return vo("div",{className:yt(W.wrapper,t),style:A,children:[vo($.Root,{ref:d,id:f,className:W.checkbox,checked:T(),onCheckedChange:b,disabled:p,...l,children:[B($.Indicator,{className:W.indicator,style:{opacity:s==="on"?1:0},"aria-hidden":"true",children:B(uo,{size:24})}),B("div",{className:W.indicator,style:{opacity:s==="intermediate"?1:0},"aria-hidden":"true",children:B(uo,{size:24})})]}),c&&B(g,{className:W.label,size:r,"aria-disabled":p,asChild:!0,children:B("label",{htmlFor:f,children:c})})]})}),Ct=o=>N(o).with("lg",()=>n.s10).with("md",()=>n.s9).with("sm",()=>n.s8).exhaustive(),Pt=o=>N(o).with("on",()=>i.primary500).with("intermediate",()=>i.primary500).with("off",()=>i.neutral100).exhaustive(),kt=o=>N(o).with("on",()=>i.primary500).with("intermediate",()=>i.primary500).with("off",()=>i.white).exhaustive();import{Slot as St}from"@radix-ui/react-slot";import{forwardRef as Rt}from"react";import{match as zt}from"ts-pattern";import{jsx as wo}from"react/jsx-runtime";var oi=Rt(({asChild:o,className:t,color:e,size:r="md",weight:s,lineHeight:a,...c},p)=>{let l=o?St:"h1",d=Tt(r);return wo(H,{ref:p,color:e,size:d,weight:s,lineHeight:a,asChild:!0,children:wo(l,{...c})})}),Tt=o=>zt(o).with("lg",()=>({base:44,tablet:60})).with("md",()=>({base:32,tablet:44})).with("sm",()=>({base:28,tablet:36})).exhaustive();import*as y from"@radix-ui/react-dropdown-menu";import{clsx as yo}from"clsx";import{forwardRef as bo}from"react";var eo={"dropdown-slide-up":"f","dropdown-slide-down":"m",content:"p",item:"K"};import{jsx as xo}from"react/jsx-runtime";var Wt=bo(({className:o,...t},e)=>xo(y.Content,{ref:e,className:yo(eo.content,o),...t})),Bt=bo(({className:o,...t},e)=>xo(y.Item,{ref:e,className:yo(eo.item,o),...t})),pi=Object.assign(y.Root,{Trigger:y.Trigger,Portal:y.Portal,Content:Wt,Item:Bt});import{Primitive as Lt}from"@radix-ui/react-primitive";import{Slot as Ft}from"@radix-ui/react-slot";import{forwardRef as Mt}from"react";import{match as Dt}from"ts-pattern";import{jsx as Co}from"react/jsx-runtime";var Po=Mt(({asChild:o,className:t,color:e,size:r="md",weight:s="bold",lineHeight:a,...c},p)=>{let l=o?Ft:Lt.h2,d=Nt(r);return Co(H,{ref:p,color:e,size:d,weight:s,lineHeight:a,asChild:!0,children:Co(l,{...c})})}),Nt=o=>Dt(o).with("xl",()=>({base:28,tablet:40})).with("lg",()=>({base:24,tablet:32})).with("md",()=>({base:22,tablet:24})).with("sm",()=>18).with("xs",()=>16).exhaustive();import{Primitive as Ot}from"@radix-ui/react-primitive";import{Slot as It}from"@radix-ui/react-slot";import{clsx as Vt}from"clsx";import{forwardRef as Et}from"react";var ro={link:"y",indicator:"L"};import{jsx as ko}from"react/jsx-runtime";var Wi=Et(({asChild:o,className:t,size:e,weight:r,lineHeight:s,indicator:a=!0,...c},p)=>{let l=o?It:Ot.a;return ko(g,{size:e,weight:r,lineHeight:s,asChild:!0,children:ko(l,{ref:p,className:Vt(ro.link,a&&ro.indicator,t),...c})})});import{CloseIcon as $t}from"@cocso-ui/react-icons";import*as h from"@radix-ui/react-dialog";import{clsx as Y}from"clsx";import{forwardRef as q}from"react";var L={"overlay-show":"w",overlay:"M","content-show":"x",content:"N",close:"O",title:"P",description:"Q"};import{jsx as C,jsxs as _t}from"react/jsx-runtime";var Yt=q(({className:o,children:t,...e},r)=>_t(h.Portal,{children:[C(h.Overlay,{className:L.overlay}),C(h.Content,{ref:r,className:Y(L.content,o),...e,children:t})]})),qt=q(({className:o,children:t,...e},r)=>C(h.Close,{ref:r,className:Y(L.close,o),...e,children:C($t,{size:24})})),Qt=q(({className:o,children:t,...e},r)=>C(h.Title,{ref:r,className:Y(L.title,o),asChild:!0,...e,children:C(Po,{color:"text.basic",children:t})})),Xt=q(({className:o,children:t,...e},r)=>C(h.Description,{ref:r,className:Y(L.description,o),asChild:!0,...e,children:C(g,{size:"sm",color:"text.subtle",children:t})})),Zi=Object.assign(h.Root,{Trigger:h.Trigger,Content:Yt,Close:qt,Title:Qt,Description:Xt});import*as Q from"@radix-ui/react-one-time-password-field";import{clsx as So}from"clsx";import{forwardRef as Ro}from"react";var io={otp:"R",input:"a"};import{jsx as zo}from"react/jsx-runtime";var Kt=Ro(({className:o,...t},e)=>zo(Q.Root,{ref:e,className:So(io.otp,o),...t})),Gt=Ro(({className:o,...t},e)=>zo(Q.Input,{ref:e,className:So(io.input,o),...t})),Gi=Object.assign(Kt,{Input:Gt});import{clsx as Ut}from"clsx";import{forwardRef as oe}from"react";var z={pagination:"S",arrow:"o",item:"e",trunc:"T"};import{Fragment as te,jsx as x,jsxs as To}from"react/jsx-runtime";var an=oe(({className:o,page:t,totalPages:e,maxVisible:r=5,onChange:s,...a},c)=>{let p=Math.ceil(r/2),l=d=>x("button",{type:"button",className:z.item,onClick:()=>s(d),"data-active":t===d,children:d},d);return To("div",{ref:c,className:Ut(z.pagination,o),...a,children:[e>1&&x("button",{className:z.arrow,type:"button",disabled:t===1,onClick:()=>t>1&&s(t-1),children:x("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","aria-hidden":"true",children:x("path",{d:"m15 18-6-6 6-6"})})}),e<=r+2?Array(e).fill(0).map((d,m)=>l(m+1)):To(te,{children:[l(1),t>1+p&&x("span",{className:z.trunc,children:"..."}),Array(r).fill(0).map((d,m)=>{let f=t-p+m+1;return f>1&&f<e?l(f):""}),t<e-p&&x("span",{className:z.trunc,children:"..."}),l(e)]}),e>1&&x("button",{className:z.arrow,type:"button",disabled:t===e,onClick:()=>t<e&&s(t+1),children:x("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","aria-hidden":"true",children:x("path",{d:"m9 18 6-6-6-6"})})})]})});import*as P from"@radix-ui/react-popover";import{clsx as re}from"clsx";import{forwardRef as ie}from"react";var Ho={"slide-up-and-fade":"k","slide-right-and-fade":"z","slide-down-and-fade":"j","slide-left-and-fade":"Y",content:"t"};import{jsx as se}from"react/jsx-runtime";var ne=ie(({className:o,...t},e)=>se(P.Content,{ref:e,className:re(Ho.content,o),...t})),un=Object.assign(P.Root,{Trigger:P.Trigger,Portal:P.Portal,Content:ne});import{KeyboardArrowDownIcon as ce}from"@cocso-ui/react-icons";import{clsx as pe}from"clsx";import{forwardRef as le}from"react";import{match as de}from"ts-pattern";var X={wrapper:"U",select:"X",icon:"q"};import{jsx as no,jsxs as me}from"react/jsx-runtime";var Tn=le(({className:o,style:t,size:e="md",disabled:r=!1,children:s,...a},c)=>{let p={...t,...he(e)};return me("div",{className:X.wrapper,children:[no("select",{ref:c,className:pe(X.select,o),style:p,disabled:r,...a,children:s}),no("span",{className:X.icon,children:no(ce,{size:20})})]})}),he=o=>de(o).with("2xs",()=>({"--cocso-select-min-width":n.s11,"--cocso-select-height":n.s11,"--cocso-select-padding-left":n.s5,"--cocso-select-padding-right":`calc(${n.s8} + 16px)`,"--cocso-select-font-size":"12px","--cocso-select-border-radius":n.s3})).with("xs",()=>({"--cocso-select-min-width":n.s12,"--cocso-select-height":n.s12,"--cocso-select-padding-left":n.s6,"--cocso-select-padding-right":`calc(${n.s7} + 16px)`,"--cocso-select-font-size":"14px","--cocso-select-border-radius":n.s3})).with("sm",()=>({"--cocso-select-min-width":n.s14,"--cocso-select-height":n.s14,"--cocso-select-padding-left":n.s7,"--cocso-select-padding-right":`calc(${n.s7} + 16px)`,"--cocso-select-font-size":"14px","--cocso-select-border-radius":n.s3})).with("md",()=>({"--cocso-select-min-width":n.s16,"--cocso-select-height":n.s16,"--cocso-select-padding-left":n.s8,"--cocso-select-padding-right":`calc(${n.s8} + 16px)`,"--cocso-select-font-size":"16px","--cocso-select-border-radius":n.s4})).with("lg",()=>({"--cocso-select-min-width":n.s17,"--cocso-select-height":n.s17,"--cocso-select-padding-left":n.s9,"--cocso-select-padding-right":`calc(${n.s9} + 16px)`,"--cocso-select-font-size":"18px","--cocso-select-border-radius":n.s4})).with("xl",()=>({"--cocso-select-min-width":n.s18,"--cocso-select-height":n.s18,"--cocso-select-padding-left":n.s10,"--cocso-select-padding-right":`calc(${n.s10} + 16px)`,"--cocso-select-font-size":"18px","--cocso-select-border-radius":n.s4})).exhaustive();import{clsx as ge}from"clsx";import{forwardRef as ue}from"react";import{match as ve}from"ts-pattern";var so={stock:"V",indicator:"Z"};import{jsx as u,jsxs as _}from"react/jsx-runtime";var Vn=ue(({className:o,style:t,onChange:e,quantity:r,...s},a)=>{let c={...t,"--cocso-stock-quantity-status-color":we(r),"--cocso-stock-quantity-status-indicator-width":n.s9};return _("div",{ref:a,className:ge(so.stock,o),style:c,...s,children:[u("span",{className:so.indicator,children:r==="\uC5EC\uC720"?_("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[u("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"}),u("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"}),u("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"})]}):r==="\uBCF4\uD1B5"?_("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[u("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"}),u("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"}),u("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"})]}):_("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[u("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"}),u("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"}),u("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"})]})}),u(g,{size:"sm",color:"currentColor",children:r})]})}),we=o=>ve(o).with("\uC5EC\uC720",()=>i.primary500).with("\uBCF4\uD1B5",()=>i.success400).with("\uBD80\uC871",()=>i.danger500).exhaustive();import{Primitive as be}from"@radix-ui/react-primitive";import*as K from"@radix-ui/react-switch";import{clsx as xe}from"clsx";import{forwardRef as Ce,useId as Pe}from"react";import{match as ao}from"ts-pattern";var j={wrapper:"A",switch:"n",thumb:"B"};import{jsx as F,jsxs as Re}from"react/jsx-runtime";var Un=Ce(({id:o,className:t,style:e,size:r="md",position:s="right",disabled:a,label:c,...p},l)=>{let d=Pe(),m=o??d,f={...e,"--cocso-switch-width":ke(r),"--cocso-switch-height":Se(r),"--cocso-switch-thumb-width":Wo(r),"--cocso-switch-thumb-height":Wo(r),"--cocso-switch-bg-color":i.neutral100};return Re(be.div,{className:xe(j.wrapper,t),"aria-disabled":a,style:f,children:[s==="left"&&F(g,{size:r,asChild:!0,children:F("label",{htmlFor:m,children:c})}),F(K.Root,{ref:l,className:j.switch,disabled:a,...p,children:F(K.Thumb,{className:j.thumb})}),s==="right"&&F(g,{size:r,"aria-disabled":a,asChild:!0,children:F("label",{htmlFor:m,children:c})})]})}),ke=o=>ao(o).with("lg",()=>n.s14).with("md",()=>n.s12).exhaustive(),Se=o=>ao(o).with("lg",()=>n.s10).with("md",()=>n.s9).exhaustive(),Wo=o=>ao(o).with("lg",()=>n.s9).with("md",()=>n.s8).exhaustive();import*as k from"@radix-ui/react-tabs";import{forwardRef as G}from"react";import{jsx as J}from"react/jsx-runtime";var ze=G(({...o},t)=>J(k.Root,{ref:t,...o})),Te=G(({...o},t)=>J(k.List,{ref:t,...o})),He=G(({...o},t)=>J(k.Trigger,{ref:t,...o})),We=G(({...o},t)=>J(k.Content,{ref:t,...o})),ns=Object.assign(ze,{List:Te,Trigger:He,Content:We});import{Toaster as hs,toast as ms}from"sonner";export{Ne as Accordion,g as Body,Lr as Button,qr as Checkbox,oi as Display,pi as Dropdown,Po as Heading,Wi as Link,Zi as Modal,Gi as OneTimePasswordField,an as Pagination,un as Popover,Tn as Select,fo as Spinner,Vn as StockQuantityStatus,Un as Switch,ns as Tab,hs as Toaster,H as Typography,i as colors,V as fontSize,E as fontWeight,we as getColor,lo as lineHeight,n as spacing,ms as toast};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocso-ui/react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/cocso/cocso-ui.git",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"dist"
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@cocso-ui/react-icons": "
|
|
34
|
+
"@cocso-ui/react-icons": "^0.0.13",
|
|
35
35
|
"@radix-ui/react-accordion": "^1.2.12",
|
|
36
36
|
"@radix-ui/react-checkbox": "^1.3.3",
|
|
37
37
|
"@radix-ui/react-dialog": "^1.1.15",
|