@pop-ui/core 0.0.34 → 0.0.36
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/core.css +1 -1
- package/dist/core.js +466 -457
- package/dist/core.umd.cjs +5 -5
- package/dist/types/index.d.ts +3 -4
- package/package.json +3 -3
package/dist/core.umd.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
(function(g,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("react/jsx-runtime"),require("@mantine/core"),require("react"),require("@pop-ui/foundation"),require("@mantine/notifications"),require("@mantine/dates"),require("dayjs"),require("dayjs/locale/ko"),require("@mantine/dropzone")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@mantine/core","react","@pop-ui/foundation","@mantine/notifications","@mantine/dates","dayjs","dayjs/locale/ko","@mantine/dropzone"],t):(g=typeof globalThis<"u"?globalThis:g||self,t(g.Core={},g.jsxRuntime,g.MantineCore,g.React,g.foundation,g.notifications,g.dates,g.dayjs,null,g.dropzone))})(this,function(g,t,m,T,o,w,E,L,Pe,J){"use strict";const X={primary:o.TextColorButtonTextPrimaryDefault,primaryLine:o.TextColorButtonTextPrimarylineDefault,basic:o.TextColorButtonTextBasicDefault,danger:o.TextColorButtonTextPrimaryDefault,setting:o.TextColorButtonTextPrimaryDefault,warning:o.TextColorButtonTextPrimaryDefault},R={primary:{default:{backgroundColor:o.BgColorButtonBgPrimaryDefault,color:o.TextColorButtonTextPrimaryDefault,border:"none"},hover:{backgroundColor:o.BgColorButtonBgPrimaryHover,color:o.TextColorButtonTextPrimaryHover},active:{backgroundColor:o.BgColorButtonBgPrimaryPressed,color:o.TextColorButtonTextPrimaryPressed},focus:{backgroundColor:o.BgColorButtonBgPrimaryFocused,color:o.TextColorButtonTextPrimaryFocused},disabled:{backgroundColor:o.BgColorButtonBgPrimaryDisabled,color:o.TextColorButtonTextPrimaryDisabled,cursor:"not-allowed"}},primaryLine:{default:{backgroundColor:o.BgColorButtonBgPrimarylineDefault,color:o.TextColorButtonTextPrimarylineDefault,border:`1px solid ${o.BorderColorButtonBorderPrimarylineDefault}`},hover:{backgroundColor:o.BgColorButtonBgPrimarylineHover,color:o.TextColorButtonTextPrimarylineHover,borderColor:o.BorderColorButtonBorderPrimarylineHover},active:{backgroundColor:o.BgColorButtonBgPrimarylinePressed,color:o.TextColorButtonTextPrimarylinePressed,borderColor:o.BorderColorButtonBorderPrimarylinePressed},focus:{backgroundColor:o.BgColorButtonBgPrimarylineFocused,color:o.TextColorButtonTextPrimarylineFocused,borderColor:o.BorderColorButtonBorderPrimarylineFocused},disabled:{backgroundColor:o.BgColorButtonBgPrimarylineDisabled,color:o.TextColorButtonTextPrimarylineDisabled,cursor:"not-allowed"}},basic:{default:{backgroundColor:o.BgColorButtonBgBasicDefault,color:o.TextColorButtonTextBasicDefault,border:`1px solid ${o.BorderColorButtonBorderBasicDefault}`},hover:{backgroundColor:o.BgColorButtonBgBasicHover,color:o.TextColorButtonTextBasicHover,borderColor:o.BorderColorButtonBorderBasicHover},active:{backgroundColor:o.BgColorButtonBgBasicPreseed,color:o.TextColorButtonTextBasicPressed,borderColor:o.BorderColorButtonBorderBasicPressed},focus:{backgroundColor:o.BgColorButtonBgBasicFocused,color:o.TextColorButtonTextBasicFocused,borderColor:o.BorderColorButtonBorderBasicFocused},disabled:{backgroundColor:o.BgColorButtonBgBasicDisabled,color:o.TextColorButtonTextBasicDisabled,cursor:"not-allowed"}},danger:{default:{backgroundColor:o.BgColorButtonBgWarningDefault,color:o.TextColorButtonTextWarningDefault,border:"none"},hover:{backgroundColor:o.BgColorButtonBgWarningHover,color:o.TextColorButtonTextWarningHover},active:{backgroundColor:o.BgColorButtonBgWarningPressed,color:o.TextColorButtonTextWarningPressed},focus:{backgroundColor:o.BgColorButtonBgWarningFocused,color:o.TextColorButtonTextWarningFocused},disabled:{backgroundColor:o.BgColorButtonBgWarningDisabled,color:o.TextColorButtonTextWarningDisabled,cursor:"not-allowed"}},setting:{default:{backgroundColor:o.BgColorButtonBgSettingDefault,color:o.TextColorButtonTextSettingDefault,border:"none"},hover:{backgroundColor:o.BgColorButtonBgSettingHover,color:o.TextColorButtonTextSettingHover},active:{backgroundColor:o.BgColorButtonBgSettingPressed,color:o.TextColorButtonTextSettingPressed},focus:{backgroundColor:o.BgColorButtonBgSettingFocused,color:o.TextColorButtonTextSettingFocused},disabled:{backgroundColor:o.BgColorButtonBgSettingDisabled,color:o.TextColorButtonTextSettingDisabled,cursor:"not-allowed"}},warning:{default:{backgroundColor:o.BgColorButtonBgWarningDefault,color:o.TextColorButtonTextWarningDefault,border:"none"},hover:{backgroundColor:o.BgColorButtonBgWarningHover,color:o.TextColorButtonTextWarningHover},active:{backgroundColor:o.BgColorButtonBgWarningPressed,color:o.TextColorButtonTextWarningPressed},focus:{backgroundColor:o.BgColorButtonBgWarningFocused,color:o.TextColorButtonTextWarningFocused},disabled:{backgroundColor:o.BgColorButtonBgWarningDisabled,color:o.TextColorButtonTextWarningDisabled,cursor:"not-allowed"}}},ee={lg:{height:"50px",padding:"0 20px",fontSize:"18px",fontWeight:700,borderRadius:"6px",lineHeight:"130%",fontFamily:"Pretendard"},md:{height:"40px",padding:"0 16px",fontSize:"16px",fontWeight:600,borderRadius:"6px",lineHeight:"130%",fontFamily:"Pretendard"},sm:{height:"30px",padding:"0 12px",fontSize:"14px",fontWeight:600,borderRadius:"4px",lineHeight:"130%",fontFamily:"Pretendard"}};function oe(r,l){const e=R[r];return{root:{...ee[l],...e.default,"&:hover:not(:disabled)":e.hover,"&:active:not(:disabled)":e.active,"&:focus:not(:disabled)":e.focus,"&:disabled":e.disabled}}}function re({children:r,size:l="md",variant:e="primary",isLoading:a=!1,disabled:_=!1,...n}){const s=T.useMemo(()=>oe(e,l),[e,l]),i=X[e],d=T.useMemo(()=>{switch(l){case"lg":return 18;case"sm":return 14;case"md":default:return 16}},[l]);return t.jsx(m.Button,{type:"button",styles:s,disabled:_||a,...n,children:a?t.jsx(m.Loader,{color:i,size:d}):r})}const U={"Checkbox--Small":"styles-module__Checkbox--Small___VZGlw","Checkbox--Medium":"styles-module__Checkbox--Medium___Vwpa3","Checkbox--Large":"styles-module__Checkbox--Large___ybTGE"},te=({size:r="md",...l})=>{let e=U["Checkbox--Medium"],a=24;return r==="sm"?(e=U["Checkbox--Small"],a=18):r==="lg"&&(e=U["Checkbox--Large"],a=32),t.jsx(m.Checkbox,{className:e,styles:{inner:{width:a,height:a}},...l})},f={datePickerWrapper:"styles-module__datePickerWrapper___8Bdcn",dayWrapper:"styles-module__dayWrapper___3teuV",todayIndicator:"styles-module__todayIndicator___Zl0e4",withoutTodayIndicator:"styles-module__withoutTodayIndicator___l6Vxh",day:"styles-module__day___DaYHh",calendarHeader:"styles-module__calendarHeader___9j1oi",calendarHeaderLevel:"styles-module__calendarHeaderLevel___wHs50",calendarHeaderControl:"styles-module__calendarHeaderControl___k317W",month:"styles-module__month___doF-A"},le=({excludedDays:r=[],excludedDates:l=[]})=>{const e=[],a=[];for(const s of l)typeof s=="string"?e.push(s):a.push(s);const _=e.map(s=>L(s)).filter(s=>s.isValid()).map(s=>s.format("YYYY-MM-DD")),n=a.map(([s,i])=>[L(s),L(i)]).filter(([s,i])=>s.isValid()&&i.isValid());return s=>{const i=L(s);if(!i.isValid())return!1;if(Array.isArray(r)&&r.includes(i.day())||_.includes(i.format("YYYY-MM-DD")))return!0;for(const[d,u]of n)if((i.isSame(d,"day")||i.isAfter(d,"day"))&&(i.isSame(u,"day")||i.isBefore(u,"day")))return!0;return!1}},ae=(r,l,e,a)=>{const _=L(r),n=L(l);for(const s of e)if(Array.isArray(s)){const i=L(s[0]),d=L(s[1]);if(!i.isValid()||!d.isValid())continue;if(!(n.isBefore(i,"day")||_.isAfter(d,"day")))return!0}for(const s of e)if(typeof s=="string"){const i=L(s);if(!i.isValid())continue;if((i.isSame(_,"day")||i.isAfter(_,"day"))&&(i.isSame(n,"day")||i.isBefore(n,"day")))return!0}if(a.length>0){let s=_;for(;s.isBefore(n,"day")||s.isSame(n,"day");){if(a.includes(s.day()))return!0;s=s.add(1,"day")}}return!1},N=(r="default")=>{switch(r){case"range":return[null,null];case"multiple":return[];default:return null}},Z=(r="default",l)=>l==null?N(r):r==="range"?Array.isArray(l)?l:N("range"):r==="multiple"?Array.isArray(l)?l:N("multiple"):Array.isArray(l)?l[0]??null:l,se=({type:r,externalValue:l,internalValue:e})=>l!==void 0?Z(r,l):e!==void 0?Z(r,e):N(r),_e=({excludedDates:r=[],excludedDays:l=[],type:e="default",value:a,onChange:_,showTodayIndicator:n=!1,...s})=>{const[i,d]=T.useState(()=>a??N(e)),u=T.useMemo(()=>le({excludedDays:l,excludedDates:r}),[l,r]),c=b=>{_&&_(b)},B=b=>{if(e==="range"&&Array.isArray(b)){const[P,M]=b;if(P&&M&&ae(P,M,r,l)){const v=[null,null];d(v),c(v);return}}d(b),c(b)},D=se({type:e,externalValue:a,internalValue:i}),p=T.useCallback(b=>{const P=L(b),M=P.date(),v=P.isSame(L(),"day"),A=v&&u(b),I=v&&n;return t.jsxs("div",{className:f.dayWrapper,children:[t.jsx("span",{children:M}),I&&t.jsx("span",{className:f.todayIndicator,"data-disabled":A||void 0,children:"오늘"})]})},[u,n]),{classNames:y,...S}=s;return t.jsx(E.DatePicker,{className:n?void 0:f.withoutTodayIndicator,classNames:{levelsGroup:f.datePickerWrapper,calendarHeader:f.calendarHeader,calendarHeaderLevel:f.calendarHeaderLevel,calendarHeaderControl:f.calendarHeaderControl,month:f.month,day:f.day,monthCell:f.monthCell,...typeof y=="object"&&y?y:{}},locale:"ko",firstDayOfWeek:0,monthLabelFormat:"YYYY년 M월",maxLevel:"month",type:e,value:D,size:"lg",onChange:B,...S,excludeDate:u,renderDay:p,weekendDays:[0],previousIcon:t.jsx(o.IconChevronLeft,{}),nextIcon:t.jsx(o.IconChevronRight,{})})},V={"DatePicker--Small":"styles-module__DatePicker--Small___m8asv","DatePicker--Medium":"styles-module__DatePicker--Medium___Po2-B","DatePicker--Large":"styles-module__DatePicker--Large___oQ6EM"},ie=({size:r="md",type:l="default",withTime:e,...a})=>{let _=V["DatePicker--Medium"],n=18;return r==="sm"?(_=V["DatePicker--Small"],n=14):r==="lg"&&(_=V["DatePicker--Large"],n=24),e?t.jsx(E.DateTimePicker,{className:_,size:r,locale:"ko",firstDayOfWeek:0,monthLabelFormat:"YYYY년 MM월",valueFormat:"YYYY-MM-DD | a hh:mm",rightSection:t.jsx(o.IconCalendar,{size:n}),...a}):t.jsx(E.DatePickerInput,{className:_,type:l,size:r,locale:"ko",firstDayOfWeek:0,monthLabelFormat:"YYYY년 MM월",valueFormat:"YYYY-MM-DD",rightSection:t.jsx(o.IconCalendar,{size:n}),...a})},x={"Dropdown--LeftLabel":"styles-module__Dropdown--LeftLabel___SFObq","Dropdown--TopLabel":"styles-module__Dropdown--TopLabel___-lPhr","Dropdown__Label--Small":"styles-module__Dropdown__Label--Small___xbzOR","Dropdown__Label--Medium":"styles-module__Dropdown__Label--Medium___YtJ2-","Dropdown__Label--Large":"styles-module__Dropdown__Label--Large___sCiJv","Dropdown__Tooltip--Small":"styles-module__Dropdown__Tooltip--Small___rkmaO","Dropdown__Tooltip--Medium":"styles-module__Dropdown__Tooltip--Medium___JTfzy","Dropdown__Tooltip--Large":"styles-module__Dropdown__Tooltip--Large___W-sUq","Dropdown--Small":"styles-module__Dropdown--Small___dRIK7","Dropdown--Medium":"styles-module__Dropdown--Medium___-HZoU","Dropdown--Large":"styles-module__Dropdown--Large___BvV3M",Dropdown__Description:"styles-module__Dropdown__Description___OQ8bF",Dropdown__ErrorMsg:"styles-module__Dropdown__ErrorMsg___xTP0Y"},ne=({label:r,labelPosition:l="top",size:e="md",required:a,tooltip:_,tooltipPosition:n="top",errorMsg:s,description:i,...d})=>{const[u,c]=T.useState(!1);let B=x["Dropdown__Label--Medium"],D=x["Dropdown--Medium"],p=x["Dropdown__Tooltip--Medium"],y=18;return e==="sm"?(B=x["Dropdown__Label--Small"],D=x["Dropdown--Small"],p=x["Dropdown__Tooltip--Small"],y=14):e==="lg"&&(B=x["Dropdown__Label--Large"],D=x["Dropdown--Large"],p=x["Dropdown__Tooltip--Large"],y=24),t.jsxs("div",{className:l==="top"?x["Dropdown--TopLabel"]:x["Dropdown--LeftLabel"],children:[t.jsxs("div",{children:[r&&t.jsx(m.Input.Label,{required:a,className:B,children:r}),_&&t.jsx(m.Tooltip,{label:_,position:n,children:t.jsx("div",{className:p,children:t.jsx(o.IconInfoCircle,{size:e==="sm"?14:e==="lg"?20:16})})})]}),t.jsxs("div",{children:[t.jsx(m.Select,{...d,size:e,error:s,className:D,rightSection:u?t.jsx(o.IconChevronUp,{size:y}):t.jsx(o.IconChevronDown,{size:y}),onDropdownOpen:()=>c(!0),onDropdownClose:()=>c(!1),styles:{option:{"&[data-selected]":{"&, &:hover":{backgroundColor:"#e7e7e7",color:"#000000"}}}}}),i&&t.jsx(m.Input.Description,{className:x.Dropdown__Description,children:i}),s&&t.jsx(m.Input.Error,{className:x.Dropdown__ErrorMsg,children:s})]})]})},H={ImageUploader:"styles-module__ImageUploader___pO3AP",ImageUploader__Preview:"styles-module__ImageUploader__Preview___DI5K4",ImageUploader__Wrapper:"styles-module__ImageUploader__Wrapper___SpAGM",ImageUploader__FileClearButton:"styles-module__ImageUploader__FileClearButton___w1HyS"},de=({width:r,height:l,defaultMsg:e="이미지 업로드",file:a,onDrop:_,showClearButton:n,onClear:s,...i})=>{const[d,u]=T.useState(a),c=T.useCallback(()=>{u(void 0),s&&s()},[s]);return t.jsxs("div",{className:H.ImageUploader__Wrapper,children:[n&&d?t.jsx("div",{className:H.ImageUploader__FileClearButton,onClick:c,children:t.jsx(o.IconCloseCircle,{size:24})}):null,t.jsx(J.Dropzone,{...i,maxFiles:1,className:H.ImageUploader,accept:J.IMAGE_MIME_TYPE,onDrop:B=>{u(B[0]),_&&_(B)},style:{width:r,height:l},children:t.jsx(t.Fragment,{children:d?t.jsx("img",{className:H.ImageUploader__Preview,src:typeof d=="string"?d:URL.createObjectURL(d),alt:`파일명: ${typeof d=="string"?d:d.name}`,title:`파일명: ${typeof d=="string"?d:d.name}`}):t.jsxs("div",{children:[t.jsx(o.IconPhoto,{size:48}),t.jsx("span",{children:e})]})})})]})},ce=({size:r="md",width:l,withCloseButton:e=!1,...a})=>{let _=768;return r==="xs"?_=360:r==="sm"?_=544:r==="lg"?_=1e3:r==="xl"&&(_=1200),t.jsx(m.Modal,{size:l||_,withCloseButton:e,...a})},W={Pagination:"style-module__Pagination___xcR-Q",Pagination__PageIndex:"style-module__Pagination__PageIndex___50SZJ","Pagination__PageIndex--Active":"style-module__Pagination__PageIndex--Active___mSIwS",Pagination__Arrow:"style-module__Pagination__Arrow___74vp3"},ge=({currentPageIdx:r,rowsPerPage:l,totalLength:e,paginationSize:a,onPageChange:_,...n})=>{const[s,i]=T.useState(r),d=l||50,u=e||1,c=a||5;T.useEffect(()=>{i(r)},[r]);const B=()=>{_&&_(s-(s%c+1)),i(p=>p-(p%c+1))},D=()=>{_&&_(s+c-s%c),i(p=>p+c-p%c)};return t.jsxs("div",{...n,className:W.Pagination,children:[s>=c?t.jsx("button",{className:W.Pagination__Arrow,onClick:B,children:t.jsx(o.IconChevronLeft,{size:20})}):null,new Array(c).fill(0).map((p,y)=>{const S=Math.floor(s/c)*c+y+1;if(!(S>Math.ceil(u/d)))return t.jsx("button",{className:s===S-1?W["Pagination__PageIndex--Active"]:W.Pagination__PageIndex,onClick:()=>{i(S-1),_&&_(S-1)},children:S},`pagination_${y}`)}),Math.floor(s/c)*c+c<Math.ceil(u/d)?t.jsx("button",{className:W.Pagination__Arrow,onClick:D,children:t.jsx(o.IconChevronRight,{size:20})}):null]})},$={"Radio--Small":"styles-module__Radio--Small___izWI2","Radio--Medium":"styles-module__Radio--Medium___dwZfV","Radio--Large":"styles-module__Radio--Large___1gLra"},me=({size:r="md",...l})=>{let e=$["Radio--Medium"];return r==="sm"?e=$["Radio--Small"]:r==="lg"&&(e=$["Radio--Large"]),t.jsx(m.Radio,{className:e,size:r,...l})},C={"SearchBar--LeftLabel":"styles-module__SearchBar--LeftLabel___CeYTM","SearchBar--TopLabel":"styles-module__SearchBar--TopLabel___spN3I","SearchBar__Label--Small":"styles-module__SearchBar__Label--Small___zS1L2","SearchBar__Label--Medium":"styles-module__SearchBar__Label--Medium___Fk0Ao","SearchBar__Label--Large":"styles-module__SearchBar__Label--Large___xTOYL","SearchBar__Tooltip--Small":"styles-module__SearchBar__Tooltip--Small___YhmEr","SearchBar__Tooltip--Medium":"styles-module__SearchBar__Tooltip--Medium___4JhOv","SearchBar__Tooltip--Large":"styles-module__SearchBar__Tooltip--Large___IEoPv",SearchBar__Wrapper:"styles-module__SearchBar__Wrapper___oq49s","SearchBar--Small":"styles-module__SearchBar--Small___SY9CN","SearchBar--Medium":"styles-module__SearchBar--Medium___vLP08","SearchBar--Large":"styles-module__SearchBar--Large___JHfHP",SearchBar__Description:"styles-module__SearchBar__Description___vucS-",SearchBar__ErrorMsg:"styles-module__SearchBar__ErrorMsg___TOeoy",SearchBar__ClearButton:"styles-module__SearchBar__ClearButton___S-y4P"},ue=({label:r,labelPosition:l="top",size:e="md",required:a,tooltip:_,tooltipPosition:n="top",errorMsg:s,description:i,onChange:d,onClear:u,...c})=>{const[B,D]=T.useState(0);let p=C["SearchBar__Label--Medium"],y=C["SearchBar--Medium"],S=C["SearchBar__Tooltip--Medium"];e==="sm"?(p=C["SearchBar__Label--Small"],y=C["SearchBar--Small"],S=C["SearchBar__Tooltip--Small"]):e==="lg"&&(p=C["SearchBar__Label--Large"],y=C["SearchBar--Large"],S=C["SearchBar__Tooltip--Large"]);const b=T.useCallback(P=>{d&&(D(P?.length),d(P))},[d]);return t.jsxs("div",{className:l==="top"?C["SearchBar--TopLabel"]:C["SearchBar--LeftLabel"],children:[t.jsxs("div",{children:[r&&t.jsx(m.Input.Label,{required:a,className:p,children:r}),_&&t.jsx(m.Tooltip,{label:_,position:n,children:t.jsx("div",{className:S,children:t.jsx(o.IconInfoCircle,{size:e==="sm"?14:e==="lg"?20:16})})})]}),t.jsxs("div",{children:[t.jsx("div",{className:C.SearchBar__Wrapper,children:t.jsx(m.Autocomplete,{...c,size:e,error:s,className:y,onChange:b,leftSection:t.jsx(o.IconSearch,{size:e==="sm"?16:e==="lg"?24:20}),rightSection:u&&B>0?t.jsx("div",{className:C.SearchBar__ClearButton,onClick:u,children:t.jsx(o.IconClose,{size:e==="sm"?16:e==="lg"?24:20})}):void 0})}),i&&t.jsx(m.Input.Description,{className:C.SearchBar__Description,children:i}),s&&t.jsx(m.Input.Error,{className:C.SearchBar__ErrorMsg,children:s})]})]})},O={"SegmentButton--Small":"styles-module__SegmentButton--Small___o0Y3t","SegmentButton--Medium":"styles-module__SegmentButton--Medium___EgCJm","SegmentButton--Large":"styles-module__SegmentButton--Large___Ym86C"},Te=({size:r="md",radius:l=6,...e})=>{let a=O["SegmentButton--Medium"];return r==="sm"?a=O["SegmentButton--Small"]:r==="lg"&&(a=O["SegmentButton--Large"]),t.jsx(m.SegmentedControl,{className:a,size:r,radius:l,styles:{control:{borderWidth:"0 !important"}},...e})},G={Tab__TitleList:"styles-module__Tab__TitleList___urHWH",Tab__BorderBottom:"styles-module__Tab__BorderBottom___eMTpl"},pe=({tabList:r=[],containerPaddingTop:l,...e})=>t.jsxs(m.Tabs,{...e,children:[t.jsx(m.Tabs.List,{className:G.Tab__TitleList,children:r?.map((a,_)=>t.jsxs(m.Tabs.Tab,{value:a.value,leftSection:a.icon,children:[a.title,t.jsx("div",{className:G.Tab__BorderBottom})]},`tab_${_}`))}),r?.map((a,_)=>t.jsx(m.Tabs.Panel,{value:a.value,pt:l,children:a.body},`tab_panel_${_}`))]}),h={"TextField--LeftLabel":"styles-module__TextField--LeftLabel___hiNn3","TextField--TopLabel":"styles-module__TextField--TopLabel___V2otc","TextField__Label--Small":"styles-module__TextField__Label--Small___NkKKA","TextField__Label--Medium":"styles-module__TextField__Label--Medium___IoJd-","TextField__Label--Large":"styles-module__TextField__Label--Large___GMy74","TextField__Tooltip--Small":"styles-module__TextField__Tooltip--Small___GmQHE","TextField__Tooltip--Medium":"styles-module__TextField__Tooltip--Medium___5P3nA","TextField__Tooltip--Large":"styles-module__TextField__Tooltip--Large___YSCfu",TextField__Wrapper:"styles-module__TextField__Wrapper___u6p5Z",TextField__TextCounter:"styles-module__TextField__TextCounter___u1jM5","TextField--Textarea":"styles-module__TextField--Textarea___C2DL5","TextField--Small":"styles-module__TextField--Small___iuH4t","TextField--Medium":"styles-module__TextField--Medium___snYod","TextField--Large":"styles-module__TextField--Large___JoSYk",TextField__Description:"styles-module__TextField__Description___J-kXP",TextField__ErrorMsg:"styles-module__TextField__ErrorMsg___fa6f6",TextField__ClearButton:"styles-module__TextField__ClearButton___bB5Ew"},Be=r=>{const{label:l,labelPosition:e="top",size:a="md",required:_,tooltip:n,tooltipPosition:s="top",errorMsg:i,description:d,textarea:u=!1,maxTextCount:c,onChange:B,onClear:D,...p}=r,y="minRows"in r?r.minRows:void 0,[S,b]=T.useState(0);let P=h["TextField__Label--Medium"],M=h["TextField--Medium"],v=h["TextField__Tooltip--Medium"];a==="sm"?(P=h["TextField__Label--Small"],M=h["TextField--Small"],v=h["TextField__Tooltip--Small"]):a==="lg"&&(P=h["TextField__Label--Large"],M=h["TextField--Large"],v=h["TextField__Tooltip--Large"]);const A=T.useCallback(I=>{if(c){if(I.currentTarget?.value?.length>c)return;b(I.currentTarget?.value?.length),B&&B(I)}B&&(b(I.currentTarget?.value?.length),B(I))},[c,B]);return t.jsxs("div",{className:e==="top"?h["TextField--TopLabel"]:h["TextField--LeftLabel"],children:[t.jsxs("div",{children:[l&&t.jsx(m.Input.Label,{required:_,className:P,children:l}),n&&t.jsx(m.Tooltip,{label:n,position:s,children:t.jsx("div",{className:v,children:t.jsx(o.IconInfoCircle,{size:a==="sm"?14:a==="lg"?20:16})})})]}),t.jsxs("div",{children:[t.jsxs("div",{className:h.TextField__Wrapper,children:[u?t.jsx(m.Textarea,{className:h["TextField--Textarea"],size:a,minRows:y,error:i,onChange:A,disabled:p?.disabled,...p}):t.jsx(m.Input,{className:M,error:i,onChange:A,rightSection:D&&S>0?t.jsx("div",{className:h.TextField__ClearButton,onClick:D,children:t.jsx(o.IconClose,{size:a==="sm"?16:a==="lg"?24:20})}):void 0,...p}),c&&c>0&&t.jsx("span",{className:h.TextField__TextCounter,children:`${S}/${c}`})]}),d&&t.jsx(m.Input.Description,{className:h.TextField__Description,children:d}),i&&t.jsx(m.Input.Error,{className:h.TextField__ErrorMsg,children:i})]})]})},q={"TimePicker--Small":"styles-module__TimePicker--Small___nHQa1","TimePicker--Medium":"styles-module__TimePicker--Medium___E9-rF","TimePicker--Large":"styles-module__TimePicker--Large___I0M7V"},he=({size:r="md",...l})=>{const e=T.useRef(null);let a=q["TimePicker--Medium"],_=18;return r==="sm"?(a=q["TimePicker--Small"],_=14):r==="lg"&&(a=q["TimePicker--Large"],_=24),t.jsx(E.TimeInput,{ref:e,className:a,size:r,...l,rightSection:t.jsx(m.ActionIcon,{onClick:()=>{e&&e?.current?.showPicker()},children:t.jsx(o.IconClock,{size:_})})})},F={Toast:"styles-module__Toast___ZqZzU",Toast__Icon:"styles-module__Toast__Icon___PWXSy",Toast__Body:"styles-module__Toast__Body___wezPs",Toast__Message:"styles-module__Toast__Message___NFsgm"},Y=r=>{const l=typeof r=="string"?{message:r}:r,{message:e,id:a,icon:_,autoClose:n}=l;w.notifications.show({id:a,message:t.jsx("div",{className:F.Toast__Message,children:e}),icon:_,autoClose:n,classNames:{root:F.Toast,body:F.Toast__Body,icon:F.Toast__Icon},withCloseButton:!1,withBorder:!1})};Y.update=(r,l)=>{const e=typeof l=="string"?{message:l}:l,{message:a,icon:_,autoClose:n}=e;w.notifications.update({id:r,message:t.jsx("div",{className:F.Toast__Message,children:a}),icon:_,autoClose:n,classNames:{root:F.Toast,body:F.Toast__Body,icon:F.Toast__Icon},withCloseButton:!1,withBorder:!1})},Y.hide=r=>{w.notifications.hide(r)},Y.clean=()=>{w.notifications.clean()};const z={"Toggle--Small":"styles-module__Toggle--Small___sOjUd","Toggle--Medium":"styles-module__Toggle--Medium___yIb8v","Toggle--Large":"styles-module__Toggle--Large___ZOJj1"},ye=({size:r="md",labelPosition:l="right",disabled:e,onChange:a,..._})=>{const[n,s]=T.useState(_?.checked||!1);let i=z["Toggle--Medium"],d=50;r==="sm"?(i=z["Toggle--Small"],d=38):r==="lg"&&(i=z["Toggle--Large"],d=67);const u=T.useCallback(c=>{a&&a(c),s(c?.target?.checked)},[a]);return t.jsx(m.Switch,{className:i,size:r,labelPosition:l,disabled:e,onChange:u,styles:()=>({track:{backgroundColor:!e&&n?"#0fd3d8 !important":void 0,borderColor:!e&&n?"#0fd3d8 !important":void 0,width:d}}),..._})},j={Tooltip__Body:"styles-module__Tooltip__Body___i1OTG",Tooltip__Title:"styles-module__Tooltip__Title___E0LoV",Tooltip__Content:"styles-module__Tooltip__Content___lU5gr"},Ce=({title:r,content:l,maw:e=280,multiline:a=!0,..._})=>t.jsx(m.Tooltip,{..._,maw:e,multiline:a,label:t.jsxs("div",{className:j.Tooltip__Body,children:[r&&t.jsx("span",{className:j.Tooltip__Title,children:r}),t.jsx("span",{className:j.Tooltip__Content,children:l})]})}),K=(r="light")=>{const l=[];return Object.entries(o.colors).forEach(([e,a])=>{Object.entries(a).forEach(([_,n])=>{const s=o.getCSSVariableName(e,_);l.push(`${s}: ${n};`)})}),l.join(`
|
|
2
|
-
`)},
|
|
1
|
+
(function(g,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("react/jsx-runtime"),require("@mantine/core"),require("react"),require("@pop-ui/foundation"),require("@mantine/notifications"),require("@mantine/dates"),require("dayjs"),require("dayjs/locale/ko"),require("@mantine/dropzone")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@mantine/core","react","@pop-ui/foundation","@mantine/notifications","@mantine/dates","dayjs","dayjs/locale/ko","@mantine/dropzone"],t):(g=typeof globalThis<"u"?globalThis:g||self,t(g.Core={},g.jsxRuntime,g.MantineCore,g.React,g.foundation,g.notifications,g.dates,g.dayjs,null,g.dropzone))})(this,function(g,t,m,T,o,I,N,D,fe,j){"use strict";const X={primary:o.TextColorButtonTextPrimaryDefault,primaryLine:o.TextColorButtonTextPrimarylineDefault,basic:o.TextColorButtonTextBasicDefault,danger:o.TextColorButtonTextPrimaryDefault,setting:o.TextColorButtonTextPrimaryDefault,warning:o.TextColorButtonTextPrimaryDefault},R={primary:{default:{backgroundColor:o.BgColorButtonBgPrimaryDefault,color:o.TextColorButtonTextPrimaryDefault,border:"none"},hover:{backgroundColor:o.BgColorButtonBgPrimaryHover,color:o.TextColorButtonTextPrimaryHover},active:{backgroundColor:o.BgColorButtonBgPrimaryPressed,color:o.TextColorButtonTextPrimaryPressed},focus:{backgroundColor:o.BgColorButtonBgPrimaryFocused,color:o.TextColorButtonTextPrimaryFocused},disabled:{backgroundColor:o.BgColorButtonBgPrimaryDisabled,color:o.TextColorButtonTextPrimaryDisabled,cursor:"not-allowed"}},primaryLine:{default:{backgroundColor:o.BgColorButtonBgPrimarylineDefault,color:o.TextColorButtonTextPrimarylineDefault,border:`1px solid ${o.BorderColorButtonBorderPrimarylineDefault}`},hover:{backgroundColor:o.BgColorButtonBgPrimarylineHover,color:o.TextColorButtonTextPrimarylineHover,borderColor:o.BorderColorButtonBorderPrimarylineHover},active:{backgroundColor:o.BgColorButtonBgPrimarylinePressed,color:o.TextColorButtonTextPrimarylinePressed,borderColor:o.BorderColorButtonBorderPrimarylinePressed},focus:{backgroundColor:o.BgColorButtonBgPrimarylineFocused,color:o.TextColorButtonTextPrimarylineFocused,borderColor:o.BorderColorButtonBorderPrimarylineFocused},disabled:{backgroundColor:o.BgColorButtonBgPrimarylineDisabled,color:o.TextColorButtonTextPrimarylineDisabled,cursor:"not-allowed"}},basic:{default:{backgroundColor:o.BgColorButtonBgBasicDefault,color:o.TextColorButtonTextBasicDefault,border:`1px solid ${o.BorderColorButtonBorderBasicDefault}`},hover:{backgroundColor:o.BgColorButtonBgBasicHover,color:o.TextColorButtonTextBasicHover,borderColor:o.BorderColorButtonBorderBasicHover},active:{backgroundColor:o.BgColorButtonBgBasicPreseed,color:o.TextColorButtonTextBasicPressed,borderColor:o.BorderColorButtonBorderBasicPressed},focus:{backgroundColor:o.BgColorButtonBgBasicFocused,color:o.TextColorButtonTextBasicFocused,borderColor:o.BorderColorButtonBorderBasicFocused},disabled:{backgroundColor:o.BgColorButtonBgBasicDisabled,color:o.TextColorButtonTextBasicDisabled,cursor:"not-allowed"}},danger:{default:{backgroundColor:o.BgColorButtonBgWarningDefault,color:o.TextColorButtonTextWarningDefault,border:"none"},hover:{backgroundColor:o.BgColorButtonBgWarningHover,color:o.TextColorButtonTextWarningHover},active:{backgroundColor:o.BgColorButtonBgWarningPressed,color:o.TextColorButtonTextWarningPressed},focus:{backgroundColor:o.BgColorButtonBgWarningFocused,color:o.TextColorButtonTextWarningFocused},disabled:{backgroundColor:o.BgColorButtonBgWarningDisabled,color:o.TextColorButtonTextWarningDisabled,cursor:"not-allowed"}},setting:{default:{backgroundColor:o.BgColorButtonBgSettingDefault,color:o.TextColorButtonTextSettingDefault,border:"none"},hover:{backgroundColor:o.BgColorButtonBgSettingHover,color:o.TextColorButtonTextSettingHover},active:{backgroundColor:o.BgColorButtonBgSettingPressed,color:o.TextColorButtonTextSettingPressed},focus:{backgroundColor:o.BgColorButtonBgSettingFocused,color:o.TextColorButtonTextSettingFocused},disabled:{backgroundColor:o.BgColorButtonBgSettingDisabled,color:o.TextColorButtonTextSettingDisabled,cursor:"not-allowed"}},warning:{default:{backgroundColor:o.BgColorButtonBgWarningDefault,color:o.TextColorButtonTextWarningDefault,border:"none"},hover:{backgroundColor:o.BgColorButtonBgWarningHover,color:o.TextColorButtonTextWarningHover},active:{backgroundColor:o.BgColorButtonBgWarningPressed,color:o.TextColorButtonTextWarningPressed},focus:{backgroundColor:o.BgColorButtonBgWarningFocused,color:o.TextColorButtonTextWarningFocused},disabled:{backgroundColor:o.BgColorButtonBgWarningDisabled,color:o.TextColorButtonTextWarningDisabled,cursor:"not-allowed"}}},ee={lg:{height:"50px",padding:"0 20px",fontSize:"18px",fontWeight:700,borderRadius:"6px",lineHeight:"130%",fontFamily:"Pretendard"},md:{height:"40px",padding:"0 16px",fontSize:"16px",fontWeight:600,borderRadius:"6px",lineHeight:"130%",fontFamily:"Pretendard"},sm:{height:"30px",padding:"0 12px",fontSize:"14px",fontWeight:600,borderRadius:"4px",lineHeight:"130%",fontFamily:"Pretendard"}};function oe(r,l){const e=R[r];return{root:{...ee[l],...e.default,"&:hover:not(:disabled)":e.hover,"&:active:not(:disabled)":e.active,"&:focus:not(:disabled)":e.focus,"&:disabled":e.disabled}}}function re({children:r,size:l="md",variant:e="primary",isLoading:a=!1,disabled:s=!1,...n}){const _=T.useMemo(()=>oe(e,l),[e,l]),i=X[e],d=T.useMemo(()=>{switch(l){case"lg":return 18;case"sm":return 14;case"md":default:return 16}},[l]);return t.jsx(m.Button,{type:"button",styles:_,disabled:s||a,...n,children:a?t.jsx(m.Loader,{color:i,size:d}):r})}const Y={"Checkbox--Small":"styles-module__Checkbox--Small___VZGlw","Checkbox--Medium":"styles-module__Checkbox--Medium___Vwpa3","Checkbox--Large":"styles-module__Checkbox--Large___ybTGE"},te=({size:r="md",...l})=>{let e=Y["Checkbox--Medium"],a=24;return r==="sm"?(e=Y["Checkbox--Small"],a=18):r==="lg"&&(e=Y["Checkbox--Large"],a=32),t.jsx(m.Checkbox,{className:e,styles:{inner:{width:a,height:a}},...l})},f={datePickerWrapper:"styles-module__datePickerWrapper___8Bdcn",todayIndicator:"styles-module__todayIndicator___Zl0e4",day:"styles-module__day___DaYHh",calendarHeader:"styles-module__calendarHeader___9j1oi",calendarHeaderLevel:"styles-module__calendarHeaderLevel___wHs50",calendarHeaderControl:"styles-module__calendarHeaderControl___k317W",month:"styles-module__month___doF-A",monthRow:"styles-module__monthRow___ksziO",weekday:"styles-module__weekday___PVnxV"},le=({excludedDays:r=[],excludedDates:l=[]})=>{const e=[],a=[];for(const _ of l)typeof _=="string"?e.push(_):a.push(_);const s=e.map(_=>D(_)).filter(_=>_.isValid()).map(_=>_.format("YYYY-MM-DD")),n=a.map(([_,i])=>[D(_),D(i)]).filter(([_,i])=>_.isValid()&&i.isValid());return _=>{const i=D(_);if(!i.isValid())return!1;if(Array.isArray(r)&&r.includes(i.day())||s.includes(i.format("YYYY-MM-DD")))return!0;for(const[d,u]of n)if((i.isSame(d,"day")||i.isAfter(d,"day"))&&(i.isSame(u,"day")||i.isBefore(u,"day")))return!0;return!1}},ae=(r,l,e,a)=>{const s=D(r),n=D(l);for(const _ of e)if(Array.isArray(_)){const i=D(_[0]),d=D(_[1]);if(!i.isValid()||!d.isValid())continue;if(!(n.isBefore(i,"day")||s.isAfter(d,"day")))return!0}for(const _ of e)if(typeof _=="string"){const i=D(_);if(!i.isValid())continue;if((i.isSame(s,"day")||i.isAfter(s,"day"))&&(i.isSame(n,"day")||i.isBefore(n,"day")))return!0}if(a.length>0){let _=s;for(;_.isBefore(n,"day")||_.isSame(n,"day");){if(a.includes(_.day()))return!0;_=_.add(1,"day")}}return!1},M=(r="default")=>{switch(r){case"range":return[null,null];case"multiple":return[];default:return null}},J=(r="default",l)=>l==null?M(r):r==="range"?Array.isArray(l)?l:M("range"):r==="multiple"?Array.isArray(l)?l:M("multiple"):Array.isArray(l)?l[0]??null:l,se=({type:r,externalValue:l,internalValue:e})=>l!==void 0?J(r,l):e!==void 0?J(r,e):M(r),_e=(r,l)=>{const e=(a,s)=>{const n=Object.keys(a).reduce((_,i)=>{const d=i,u=a[d],c=s[d],p=[u,c].filter(Boolean).join(" ");return p&&(_[d]=p),_},{});return Object.keys(s).forEach(_=>{const i=_,d=s[i];!(i in a)&&d&&(n[i]=d)}),n};return typeof l=="function"?(a,s,n)=>e(r,l(a,s,n)):typeof l=="object"&&l!==null&&!Array.isArray(l)?e(r,l):r},ie={levelsGroup:f.datePickerWrapper,calendarHeader:f.calendarHeader,calendarHeaderLevel:f.calendarHeaderLevel,calendarHeaderControl:f.calendarHeaderControl,month:f.month,day:f.day,monthRow:f.monthRow,weekday:f.weekday},ne=({excludedDates:r=[],excludedDays:l=[],type:e="default",value:a,onChange:s,highlightToday:n=!1,..._})=>{const[i,d]=T.useState(()=>a??M(e)),u=T.useMemo(()=>le({excludedDays:l,excludedDates:r}),[l,r]),c=x=>{if(e==="range"&&Array.isArray(x)&&x.length===2){const[L,v]=x;if(L&&v&&ae(L,v,r,l)){const F=M("range");d(F),s?.(F);return}}d(x),s?.(x)},p=se({type:e,externalValue:a,internalValue:i}),P=T.useCallback(x=>{const L=D(x).date(),F=D(x).isSame(D(),"day")&&n;return t.jsxs(t.Fragment,{children:[L,F&&t.jsx("span",{className:f.todayIndicator,children:"오늘"})]})},[n]),{classNames:B,...C}=_,S=_e(ie,B);return t.jsx(N.DatePicker,{locale:"ko",firstDayOfWeek:0,monthLabelFormat:"YYYY년 M월",maxLevel:"month",previousIcon:t.jsx(o.IconChevronLeft,{}),nextIcon:t.jsx(o.IconChevronRight,{}),...C,size:"lg",onChange:c,weekendDays:[0],highlightToday:n,classNames:S,value:p,excludeDate:u,renderDay:P})},U={"DatePicker--Small":"styles-module__DatePicker--Small___m8asv","DatePicker--Medium":"styles-module__DatePicker--Medium___Po2-B","DatePicker--Large":"styles-module__DatePicker--Large___oQ6EM"},de=({size:r="md",type:l="default",withTime:e,...a})=>{let s=U["DatePicker--Medium"],n=18;return r==="sm"?(s=U["DatePicker--Small"],n=14):r==="lg"&&(s=U["DatePicker--Large"],n=24),e?t.jsx(N.DateTimePicker,{className:s,size:r,locale:"ko",firstDayOfWeek:0,monthLabelFormat:"YYYY년 MM월",valueFormat:"YYYY-MM-DD | a hh:mm",rightSection:t.jsx(o.IconCalendar,{size:n}),...a}):t.jsx(N.DatePickerInput,{className:s,type:l,size:r,locale:"ko",firstDayOfWeek:0,monthLabelFormat:"YYYY년 MM월",valueFormat:"YYYY-MM-DD",rightSection:t.jsx(o.IconCalendar,{size:n}),...a})},b={"Dropdown--LeftLabel":"styles-module__Dropdown--LeftLabel___SFObq","Dropdown--TopLabel":"styles-module__Dropdown--TopLabel___-lPhr","Dropdown__Label--Small":"styles-module__Dropdown__Label--Small___xbzOR","Dropdown__Label--Medium":"styles-module__Dropdown__Label--Medium___YtJ2-","Dropdown__Label--Large":"styles-module__Dropdown__Label--Large___sCiJv","Dropdown__Tooltip--Small":"styles-module__Dropdown__Tooltip--Small___rkmaO","Dropdown__Tooltip--Medium":"styles-module__Dropdown__Tooltip--Medium___JTfzy","Dropdown__Tooltip--Large":"styles-module__Dropdown__Tooltip--Large___W-sUq","Dropdown--Small":"styles-module__Dropdown--Small___dRIK7","Dropdown--Medium":"styles-module__Dropdown--Medium___-HZoU","Dropdown--Large":"styles-module__Dropdown--Large___BvV3M",Dropdown__Description:"styles-module__Dropdown__Description___OQ8bF",Dropdown__ErrorMsg:"styles-module__Dropdown__ErrorMsg___xTP0Y"},ce=({label:r,labelPosition:l="top",size:e="md",required:a,tooltip:s,tooltipPosition:n="top",errorMsg:_,description:i,...d})=>{const[u,c]=T.useState(!1);let p=b["Dropdown__Label--Medium"],P=b["Dropdown--Medium"],B=b["Dropdown__Tooltip--Medium"],C=18;return e==="sm"?(p=b["Dropdown__Label--Small"],P=b["Dropdown--Small"],B=b["Dropdown__Tooltip--Small"],C=14):e==="lg"&&(p=b["Dropdown__Label--Large"],P=b["Dropdown--Large"],B=b["Dropdown__Tooltip--Large"],C=24),t.jsxs("div",{className:l==="top"?b["Dropdown--TopLabel"]:b["Dropdown--LeftLabel"],children:[t.jsxs("div",{children:[r&&t.jsx(m.Input.Label,{required:a,className:p,children:r}),s&&t.jsx(m.Tooltip,{label:s,position:n,children:t.jsx("div",{className:B,children:t.jsx(o.IconInfoCircle,{size:e==="sm"?14:e==="lg"?20:16})})})]}),t.jsxs("div",{children:[t.jsx(m.Select,{...d,size:e,error:_,className:P,rightSection:u?t.jsx(o.IconChevronUp,{size:C}):t.jsx(o.IconChevronDown,{size:C}),onDropdownOpen:()=>c(!0),onDropdownClose:()=>c(!1),styles:{option:{"&[data-selected]":{"&, &:hover":{backgroundColor:"#e7e7e7",color:"#000000"}}}}}),i&&t.jsx(m.Input.Description,{className:b.Dropdown__Description,children:i}),_&&t.jsx(m.Input.Error,{className:b.Dropdown__ErrorMsg,children:_})]})]})},H={ImageUploader:"styles-module__ImageUploader___pO3AP",ImageUploader__Preview:"styles-module__ImageUploader__Preview___DI5K4",ImageUploader__Wrapper:"styles-module__ImageUploader__Wrapper___SpAGM",ImageUploader__FileClearButton:"styles-module__ImageUploader__FileClearButton___w1HyS"},ge=({width:r,height:l,defaultMsg:e="이미지 업로드",file:a,onDrop:s,showClearButton:n,onClear:_,...i})=>{const[d,u]=T.useState(a),c=T.useCallback(()=>{u(void 0),_&&_()},[_]);return t.jsxs("div",{className:H.ImageUploader__Wrapper,children:[n&&d?t.jsx("div",{className:H.ImageUploader__FileClearButton,onClick:c,children:t.jsx(o.IconCloseCircle,{size:24})}):null,t.jsx(j.Dropzone,{...i,maxFiles:1,className:H.ImageUploader,accept:j.IMAGE_MIME_TYPE,onDrop:p=>{u(p[0]),s&&s(p)},style:{width:r,height:l},children:t.jsx(t.Fragment,{children:d?t.jsx("img",{className:H.ImageUploader__Preview,src:typeof d=="string"?d:URL.createObjectURL(d),alt:`파일명: ${typeof d=="string"?d:d.name}`,title:`파일명: ${typeof d=="string"?d:d.name}`}):t.jsxs("div",{children:[t.jsx(o.IconPhoto,{size:48}),t.jsx("span",{children:e})]})})})]})},me=({size:r="md",width:l,withCloseButton:e=!1,...a})=>{let s=768;return r==="xs"?s=360:r==="sm"?s=544:r==="lg"?s=1e3:r==="xl"&&(s=1200),t.jsx(m.Modal,{size:l||s,withCloseButton:e,...a})},W={Pagination:"style-module__Pagination___xcR-Q",Pagination__PageIndex:"style-module__Pagination__PageIndex___50SZJ","Pagination__PageIndex--Active":"style-module__Pagination__PageIndex--Active___mSIwS",Pagination__Arrow:"style-module__Pagination__Arrow___74vp3"},ue=({currentPageIdx:r,rowsPerPage:l,totalLength:e,paginationSize:a,onPageChange:s,...n})=>{const[_,i]=T.useState(r),d=l||50,u=e||1,c=a||5;T.useEffect(()=>{i(r)},[r]);const p=()=>{s&&s(_-(_%c+1)),i(B=>B-(B%c+1))},P=()=>{s&&s(_+c-_%c),i(B=>B+c-B%c)};return t.jsxs("div",{...n,className:W.Pagination,children:[_>=c?t.jsx("button",{className:W.Pagination__Arrow,onClick:p,children:t.jsx(o.IconChevronLeft,{size:20})}):null,new Array(c).fill(0).map((B,C)=>{const S=Math.floor(_/c)*c+C+1;if(!(S>Math.ceil(u/d)))return t.jsx("button",{className:_===S-1?W["Pagination__PageIndex--Active"]:W.Pagination__PageIndex,onClick:()=>{i(S-1),s&&s(S-1)},children:S},`pagination_${C}`)}),Math.floor(_/c)*c+c<Math.ceil(u/d)?t.jsx("button",{className:W.Pagination__Arrow,onClick:P,children:t.jsx(o.IconChevronRight,{size:20})}):null]})},V={"Radio--Small":"styles-module__Radio--Small___izWI2","Radio--Medium":"styles-module__Radio--Medium___dwZfV","Radio--Large":"styles-module__Radio--Large___1gLra"},Te=({size:r="md",...l})=>{let e=V["Radio--Medium"];return r==="sm"?e=V["Radio--Small"]:r==="lg"&&(e=V["Radio--Large"]),t.jsx(m.Radio,{className:e,size:r,...l})},y={"SearchBar--LeftLabel":"styles-module__SearchBar--LeftLabel___CeYTM","SearchBar--TopLabel":"styles-module__SearchBar--TopLabel___spN3I","SearchBar__Label--Small":"styles-module__SearchBar__Label--Small___zS1L2","SearchBar__Label--Medium":"styles-module__SearchBar__Label--Medium___Fk0Ao","SearchBar__Label--Large":"styles-module__SearchBar__Label--Large___xTOYL","SearchBar__Tooltip--Small":"styles-module__SearchBar__Tooltip--Small___YhmEr","SearchBar__Tooltip--Medium":"styles-module__SearchBar__Tooltip--Medium___4JhOv","SearchBar__Tooltip--Large":"styles-module__SearchBar__Tooltip--Large___IEoPv",SearchBar__Wrapper:"styles-module__SearchBar__Wrapper___oq49s","SearchBar--Small":"styles-module__SearchBar--Small___SY9CN","SearchBar--Medium":"styles-module__SearchBar--Medium___vLP08","SearchBar--Large":"styles-module__SearchBar--Large___JHfHP",SearchBar__Description:"styles-module__SearchBar__Description___vucS-",SearchBar__ErrorMsg:"styles-module__SearchBar__ErrorMsg___TOeoy",SearchBar__ClearButton:"styles-module__SearchBar__ClearButton___S-y4P"},pe=({label:r,labelPosition:l="top",size:e="md",required:a,tooltip:s,tooltipPosition:n="top",errorMsg:_,description:i,onChange:d,onClear:u,...c})=>{const[p,P]=T.useState(0);let B=y["SearchBar__Label--Medium"],C=y["SearchBar--Medium"],S=y["SearchBar__Tooltip--Medium"];e==="sm"?(B=y["SearchBar__Label--Small"],C=y["SearchBar--Small"],S=y["SearchBar__Tooltip--Small"]):e==="lg"&&(B=y["SearchBar__Label--Large"],C=y["SearchBar--Large"],S=y["SearchBar__Tooltip--Large"]);const x=T.useCallback(L=>{d&&(P(L?.length),d(L))},[d]);return t.jsxs("div",{className:l==="top"?y["SearchBar--TopLabel"]:y["SearchBar--LeftLabel"],children:[t.jsxs("div",{children:[r&&t.jsx(m.Input.Label,{required:a,className:B,children:r}),s&&t.jsx(m.Tooltip,{label:s,position:n,children:t.jsx("div",{className:S,children:t.jsx(o.IconInfoCircle,{size:e==="sm"?14:e==="lg"?20:16})})})]}),t.jsxs("div",{children:[t.jsx("div",{className:y.SearchBar__Wrapper,children:t.jsx(m.Autocomplete,{...c,size:e,error:_,className:C,onChange:x,leftSection:t.jsx(o.IconSearch,{size:e==="sm"?16:e==="lg"?24:20}),rightSection:u&&p>0?t.jsx("div",{className:y.SearchBar__ClearButton,onClick:u,children:t.jsx(o.IconClose,{size:e==="sm"?16:e==="lg"?24:20})}):void 0})}),i&&t.jsx(m.Input.Description,{className:y.SearchBar__Description,children:i}),_&&t.jsx(m.Input.Error,{className:y.SearchBar__ErrorMsg,children:_})]})]})},O={"SegmentButton--Small":"styles-module__SegmentButton--Small___o0Y3t","SegmentButton--Medium":"styles-module__SegmentButton--Medium___EgCJm","SegmentButton--Large":"styles-module__SegmentButton--Large___Ym86C"},Be=({size:r="md",radius:l=6,...e})=>{let a=O["SegmentButton--Medium"];return r==="sm"?a=O["SegmentButton--Small"]:r==="lg"&&(a=O["SegmentButton--Large"]),t.jsx(m.SegmentedControl,{className:a,size:r,radius:l,styles:{control:{borderWidth:"0 !important"}},...e})},Z={Tab__TitleList:"styles-module__Tab__TitleList___urHWH",Tab__BorderBottom:"styles-module__Tab__BorderBottom___eMTpl"},he=({tabList:r=[],containerPaddingTop:l,...e})=>t.jsxs(m.Tabs,{...e,children:[t.jsx(m.Tabs.List,{className:Z.Tab__TitleList,children:r?.map((a,s)=>t.jsxs(m.Tabs.Tab,{value:a.value,leftSection:a.icon,children:[a.title,t.jsx("div",{className:Z.Tab__BorderBottom})]},`tab_${s}`))}),r?.map((a,s)=>t.jsx(m.Tabs.Panel,{value:a.value,pt:l,children:a.body},`tab_panel_${s}`))]}),h={"TextField--LeftLabel":"styles-module__TextField--LeftLabel___hiNn3","TextField--TopLabel":"styles-module__TextField--TopLabel___V2otc","TextField__Label--Small":"styles-module__TextField__Label--Small___NkKKA","TextField__Label--Medium":"styles-module__TextField__Label--Medium___IoJd-","TextField__Label--Large":"styles-module__TextField__Label--Large___GMy74","TextField__Tooltip--Small":"styles-module__TextField__Tooltip--Small___GmQHE","TextField__Tooltip--Medium":"styles-module__TextField__Tooltip--Medium___5P3nA","TextField__Tooltip--Large":"styles-module__TextField__Tooltip--Large___YSCfu",TextField__Wrapper:"styles-module__TextField__Wrapper___u6p5Z",TextField__TextCounter:"styles-module__TextField__TextCounter___u1jM5","TextField--Textarea":"styles-module__TextField--Textarea___C2DL5","TextField--Small":"styles-module__TextField--Small___iuH4t","TextField--Medium":"styles-module__TextField--Medium___snYod","TextField--Large":"styles-module__TextField--Large___JoSYk",TextField__Description:"styles-module__TextField__Description___J-kXP",TextField__ErrorMsg:"styles-module__TextField__ErrorMsg___fa6f6",TextField__ClearButton:"styles-module__TextField__ClearButton___bB5Ew"},ye=r=>{const{label:l,labelPosition:e="top",size:a="md",required:s,tooltip:n,tooltipPosition:_="top",errorMsg:i,description:d,textarea:u=!1,maxTextCount:c,onChange:p,onClear:P,...B}=r,C="minRows"in r?r.minRows:void 0,[S,x]=T.useState(0);let L=h["TextField__Label--Medium"],v=h["TextField--Medium"],F=h["TextField__Tooltip--Medium"];a==="sm"?(L=h["TextField__Label--Small"],v=h["TextField--Small"],F=h["TextField__Tooltip--Small"]):a==="lg"&&(L=h["TextField__Label--Large"],v=h["TextField--Large"],F=h["TextField__Tooltip--Large"]);const Q=T.useCallback(E=>{if(c){if(E.currentTarget?.value?.length>c)return;x(E.currentTarget?.value?.length),p&&p(E)}p&&(x(E.currentTarget?.value?.length),p(E))},[c,p]);return t.jsxs("div",{className:e==="top"?h["TextField--TopLabel"]:h["TextField--LeftLabel"],children:[t.jsxs("div",{children:[l&&t.jsx(m.Input.Label,{required:s,className:L,children:l}),n&&t.jsx(m.Tooltip,{label:n,position:_,children:t.jsx("div",{className:F,children:t.jsx(o.IconInfoCircle,{size:a==="sm"?14:a==="lg"?20:16})})})]}),t.jsxs("div",{children:[t.jsxs("div",{className:h.TextField__Wrapper,children:[u?t.jsx(m.Textarea,{className:h["TextField--Textarea"],size:a,minRows:C,error:i,onChange:Q,disabled:B?.disabled,...B}):t.jsx(m.Input,{className:v,error:i,onChange:Q,rightSection:P&&S>0?t.jsx("div",{className:h.TextField__ClearButton,onClick:P,children:t.jsx(o.IconClose,{size:a==="sm"?16:a==="lg"?24:20})}):void 0,...B}),c&&c>0&&t.jsx("span",{className:h.TextField__TextCounter,children:`${S}/${c}`})]}),d&&t.jsx(m.Input.Description,{className:h.TextField__Description,children:d}),i&&t.jsx(m.Input.Error,{className:h.TextField__ErrorMsg,children:i})]})]})},$={"TimePicker--Small":"styles-module__TimePicker--Small___nHQa1","TimePicker--Medium":"styles-module__TimePicker--Medium___E9-rF","TimePicker--Large":"styles-module__TimePicker--Large___I0M7V"},Ce=({size:r="md",...l})=>{const e=T.useRef(null);let a=$["TimePicker--Medium"],s=18;return r==="sm"?(a=$["TimePicker--Small"],s=14):r==="lg"&&(a=$["TimePicker--Large"],s=24),t.jsx(N.TimeInput,{ref:e,className:a,size:r,...l,rightSection:t.jsx(m.ActionIcon,{onClick:()=>{e&&e?.current?.showPicker()},children:t.jsx(o.IconClock,{size:s})})})},w={Toast:"styles-module__Toast___ZqZzU",Toast__Icon:"styles-module__Toast__Icon___PWXSy",Toast__Body:"styles-module__Toast__Body___wezPs",Toast__Message:"styles-module__Toast__Message___NFsgm"},A=r=>{const l=typeof r=="string"?{message:r}:r,{message:e,id:a,icon:s,autoClose:n}=l;I.notifications.show({id:a,message:t.jsx("div",{className:w.Toast__Message,children:e}),icon:s,autoClose:n,classNames:{root:w.Toast,body:w.Toast__Body,icon:w.Toast__Icon},withCloseButton:!1,withBorder:!1})};A.update=(r,l)=>{const e=typeof l=="string"?{message:l}:l,{message:a,icon:s,autoClose:n}=e;I.notifications.update({id:r,message:t.jsx("div",{className:w.Toast__Message,children:a}),icon:s,autoClose:n,classNames:{root:w.Toast,body:w.Toast__Body,icon:w.Toast__Icon},withCloseButton:!1,withBorder:!1})},A.hide=r=>{I.notifications.hide(r)},A.clean=()=>{I.notifications.clean()};const z={"Toggle--Small":"styles-module__Toggle--Small___sOjUd","Toggle--Medium":"styles-module__Toggle--Medium___yIb8v","Toggle--Large":"styles-module__Toggle--Large___ZOJj1"},Se=({size:r="md",labelPosition:l="right",disabled:e,onChange:a,...s})=>{const[n,_]=T.useState(s?.checked||!1);let i=z["Toggle--Medium"],d=50;r==="sm"?(i=z["Toggle--Small"],d=38):r==="lg"&&(i=z["Toggle--Large"],d=67);const u=T.useCallback(c=>{a&&a(c),_(c?.target?.checked)},[a]);return t.jsx(m.Switch,{className:i,size:r,labelPosition:l,disabled:e,onChange:u,styles:()=>({track:{backgroundColor:!e&&n?"#0fd3d8 !important":void 0,borderColor:!e&&n?"#0fd3d8 !important":void 0,width:d}}),...s})},q={Tooltip__Body:"styles-module__Tooltip__Body___i1OTG",Tooltip__Title:"styles-module__Tooltip__Title___E0LoV",Tooltip__Content:"styles-module__Tooltip__Content___lU5gr"},be=({title:r,content:l,maw:e=280,multiline:a=!0,...s})=>t.jsx(m.Tooltip,{...s,maw:e,multiline:a,label:t.jsxs("div",{className:q.Tooltip__Body,children:[r&&t.jsx("span",{className:q.Tooltip__Title,children:r}),t.jsx("span",{className:q.Tooltip__Content,children:l})]})}),G=(r="light")=>{const l=[];return Object.entries(o.colors).forEach(([e,a])=>{Object.entries(a).forEach(([s,n])=>{const _=o.getCSSVariableName(e,s);l.push(`${_}: ${n};`)})}),l.join(`
|
|
2
|
+
`)},xe=(r="light")=>{const l=document.getElementById("pop-ui-theme-vars");l&&l.remove();const e=document.createElement("style");e.id="pop-ui-theme-vars",e.textContent=`
|
|
3
3
|
:root {
|
|
4
|
-
${
|
|
4
|
+
${G("light")}
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
[data-theme="dark"] {
|
|
8
|
-
${
|
|
8
|
+
${G("dark")}
|
|
9
9
|
}
|
|
10
|
-
`,document.head.appendChild(e)},k=r=>{const l=o.colors[r],e=Object.keys(l).sort((
|
|
10
|
+
`,document.head.appendChild(e)},k=r=>{const l=o.colors[r],e=Object.keys(l).sort((s,n)=>Number(s)-Number(n));return[o.getCSSVariableRef(r,e[0]||e[e.length-1]),o.getCSSVariableRef(r,e[1]||e[e.length-1]),o.getCSSVariableRef(r,e[2]||e[e.length-1]),o.getCSSVariableRef(r,e[3]||e[e.length-1]),o.getCSSVariableRef(r,e[4]||e[e.length-1]),o.getCSSVariableRef(r,e[5]||e[e.length-1]),o.getCSSVariableRef(r,e[6]||e[e.length-1]),o.getCSSVariableRef(r,e[7]||e[e.length-1]),o.getCSSVariableRef(r,e[8]||e[e.length-1]),o.getCSSVariableRef(r,e[9]||e[e.length-1])]},De=m.createTheme({colors:{gray:k("gray"),aqua:k("aqua"),red:k("red"),orange:k("orange"),yellow:k("yellow"),green:k("green"),blue:k("blue"),purple:k("purple"),grape:k("grape")},primaryColor:"aqua",primaryShade:5,fontFamily:'Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif'}),K=T.createContext(void 0),Pe=({children:r,defaultTheme:l="light",notificationPosition:e="bottom-center",notificationLimit:a=5,notificationAutoClose:s,notificationZIndex:n})=>{const[_,i]=T.useState(l);T.useEffect(()=>{xe(_),document.documentElement.setAttribute("data-theme",_)},[_]);const d=()=>{i(u=>u==="light"?"dark":"light")};return t.jsx(K.Provider,{value:{theme:_,setTheme:i,toggleTheme:d},children:t.jsxs(m.MantineProvider,{theme:De,children:[t.jsx(I.Notifications,{position:e,limit:a,autoClose:s,zIndex:n}),r]})})},Le=()=>{const r=T.useContext(K);if(!r)throw new Error("useTheme must be used within ThemeProvider");return r};g.Button=re,g.CalendarDatePicker=ne,g.Checkbox=te,g.DatePicker=de,g.Dropdown=ce,g.ImageUploader=ge,g.Modal=me,g.Pagination=ue,g.PopUiProvider=Pe,g.Radio=Te,g.SearchBar=pe,g.SegmentButton=Be,g.Tab=he,g.TextField=ye,g.TimePicker=Ce,g.Toggle=Se,g.Tooltip=be,g.toast=A,g.useTheme=Le,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});
|
package/dist/types/index.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ export declare function Button({ children, size, variant, isLoading, disabled, .
|
|
|
32
32
|
*
|
|
33
33
|
* @see README.md for detailed documentation
|
|
34
34
|
*/
|
|
35
|
-
export declare const CalendarDatePicker: ({ excludedDates, excludedDays, type, value, onChange,
|
|
35
|
+
export declare const CalendarDatePicker: ({ excludedDates, excludedDays, type, value, onChange, highlightToday, ...props }: ICalendarDatePickerProps) => JSX.Element;
|
|
36
36
|
|
|
37
37
|
export declare const Checkbox: ({ size, ...props }: ICheckboxProps) => JSX.Element;
|
|
38
38
|
|
|
@@ -55,9 +55,8 @@ declare interface IButtonProps extends Omit<ButtonProps, 'variant' | 'styles'> {
|
|
|
55
55
|
* excludedDays: [0,1,2,...,6] (0=일요일, 5=금요일 등)
|
|
56
56
|
* excludedDates: ['2025-12-01', ['2025-12-24','2025-12-26'], ...] (각 요소는 [start, end] 문자열, YYYY-MM-DD 권장)
|
|
57
57
|
*/
|
|
58
|
-
declare interface ICalendarDatePickerProps extends Omit<DatePickerProps, 'excludeDate' | 'onChange'> {
|
|
58
|
+
export declare interface ICalendarDatePickerProps extends Omit<DatePickerProps, 'excludeDate' | 'onChange'> {
|
|
59
59
|
type?: 'default' | 'multiple' | 'range';
|
|
60
|
-
showTodayIndicator?: boolean;
|
|
61
60
|
/**
|
|
62
61
|
* onChange callback
|
|
63
62
|
* - Receives DateValue which can be Date, Date[], or [Date, Date] depending on the type prop
|
|
@@ -229,7 +228,7 @@ declare type TButtonSize = "sm" | "md" | "lg";
|
|
|
229
228
|
|
|
230
229
|
declare type TButtonVariant = "primary" | "primaryLine" | "basic" | "danger" | "setting" | "warning";
|
|
231
230
|
|
|
232
|
-
declare type TDayOfWeek = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
231
|
+
export declare type TDayOfWeek = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
233
232
|
|
|
234
233
|
export declare const TextField: (allProps: TTextFieldProps) => JSX.Element;
|
|
235
234
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pop-ui/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.36",
|
|
5
5
|
"main": "./dist/core.umd.cjs",
|
|
6
6
|
"module": "./dist/core.js",
|
|
7
7
|
"types": "./dist/types/index.d.ts",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@mantine/dropzone": "^8.3.6",
|
|
50
50
|
"@mantine/hooks": "^8.3.6",
|
|
51
51
|
"@mantine/notifications": "^8.3.6",
|
|
52
|
-
"@pop-ui/foundation": "0.0.
|
|
52
|
+
"@pop-ui/foundation": "0.0.30",
|
|
53
53
|
"dayjs": "^1.11.18"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
@@ -97,5 +97,5 @@
|
|
|
97
97
|
"typescript": "^5.9.3",
|
|
98
98
|
"vite": "^7.1.12"
|
|
99
99
|
},
|
|
100
|
-
"gitHead": "
|
|
100
|
+
"gitHead": "55fa481ff2884a6a093e0c1f604c5ca5995b0626"
|
|
101
101
|
}
|