@ctlyst.id/internal-ui 1.0.4-canary.5 → 1.0.4-canary.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -36,11 +36,11 @@
36
36
  border-spacing: 4px;
37
37
  `,px:6,py:4},r.createElement(t.Icon,{as:K.get(e.title),mr:3}),r.createElement(t.Text,{fontSize:"text.sm"},o),p&&r.createElement(t.Box,{width:.5,height:8,position:"absolute",bg:"primary.500",right:0,zIndex:"popover"})))}))))))}))));J.defaultProps={navigations:void 0,as:"a",host:void 0};const Q=t.forwardRef(({className:e,style:r,isActive:a,children:o,...i},c)=>{const l=t.useColorModeValue("neutral.300","mirage.900"),d=t.useColorModeValue("black.high","primary.300"),p=t.useColorModeValue("secondary.50","primary.500"),s=t.useColorModeValue("primary.500","white");return n.createElement(t.Button,Object.assign({"data-test-id":"Pagination-Button",ref:c,className:e,style:r,borderRadius:50,fontWeight:700,m:0,px:3,py:2,h:8,minW:"auto",background:a?"primary.500":l,color:a?"white":d,_hover:a?{}:{background:p,color:s},_disabled:{background:t.useColorModeValue("neutral.300","mirage.900"),color:"neutral.600",pointerEvents:"none"}},i),o)});Q.displayName="PaginationButton",Q.defaultProps={isActive:void 0};const ee=({color:e,isDisabled:n,onClick:a,visuallyHidden:o,icon:i})=>r.createElement(Q,{"data-test-id":"DLVCc_fBK35spHm5WxjcJ",color:e,isDisabled:n,onClick:a},r.createElement(t.VisuallyHidden,null,o),i);ee.defaultProps={color:void 0,isDisabled:void 0,onClick:void 0,visuallyHidden:void 0,icon:void 0};const te=({className:e,current:n,total:a,onSelect:i})=>{const c=t.useColorModeValue("secondary.100","primary.500"),l=t.useColorModeValue("primary.500","secondary.100"),d=1===n,p=d?c:l,s=n===a,m=s?c:l,u=e=>{i&&i(e)};return r.createElement(t.Box,{className:e,display:"inline-flex",alignItems:"center"},r.createElement(t.Box,{mr:1},r.createElement(ee,{"data-test-id":"Pagination-Button",color:p,isDisabled:d,onClick:()=>u(1),visuallyHidden:"First Page",icon:r.createElement(o.ArrowLeftIcon,{width:2})})),r.createElement(t.Box,{backgroundColor:t.useColorModeValue("neutral.300","mirage.900"),borderRadius:50},r.createElement(ee,{"data-test-id":"Pagination-Button",color:p,isDisabled:d,onClick:()=>u(n-1),visuallyHidden:"Previous Page",icon:r.createElement(o.ChevronLeftIcon,null)}),(()=>{const e=[];let t,r;5<a?(t=Math.max(Math.min(n-Math.floor(2.5),a-5+1),1),r=t+5-1):(t=1,r=a);for(let n=t;n<=r;++n)e.push(n);return e})().map(e=>r.createElement(Q,{"data-test-id":"Pagination-Button",key:e,isActive:e===n,onClick:()=>"number"==typeof e?u(e):null},r.createElement(t.Text,{scale:300,fontSize:"text.sm",lineHeight:18,fontWeight:500},e))),r.createElement(ee,{"data-test-id":"Pagination-Button",color:m,isDisabled:s,onClick:()=>u(n+1),visuallyHidden:"Next Page",icon:r.createElement(o.ChevronRightIcon,null)})),r.createElement(t.Box,{ml:1},r.createElement(ee,{"data-test-id":"Pagination-Button",color:m,isDisabled:s,onClick:()=>u(a),visuallyHidden:"Last Page",icon:r.createElement(o.ArrowRightIcon,{width:2})})))};te.defaultProps={className:void 0,onSelect:void 0},te.displayName="Pagination";const re=({limit:e,label:n="Baris per halaman:",items:o,onChange:i,...c})=>{const[l,d]=r.useState(e);return r.createElement(t.Box,{display:"flex",flexDirection:"row",alignItems:"center"},r.createElement(t.Text,Object.assign({fontSize:"text.sm",lineHeight:18,color:t.useColorModeValue("neutral.900","white")},c),n),r.createElement(t.Select,{textAlign:"center",size:"xs",outline:"none",border:"none",boxShadow:"none",width:18,icon:r.createElement(a.FiChevronDown,null),_focusVisible:{boxShadow:"none"},onChange:e=>{const t=Number(e.target.value);i(t),d(t)},value:l},o.map(e=>r.createElement("option",{key:e,value:e},e))))};re.defaultProps={limit:10,label:void 0};const ne=({children:e,isError:r=!1})=>n.createElement(t.Box,{css:i.css`
38
38
  .react-select__control {
39
- border-color: ${r?M.danger[500]:M.neutral[400]} !important;
39
+ border-color: ${r?M.danger[500]:M.neutral[500]} !important;
40
40
  }
41
41
 
42
42
  .react-select__control:hover {
43
43
  border-color: ${r?M.danger[500]:M.primary[500]} !important;
44
44
  }
45
- `},e);ne.defaultProps={isError:!1};const ae=A.text.sm,oe={fontSize:ae.fontSize,lineHeight:ae.lineHeight,letterSpacing:0};function ie(e,t){const r=t?"0 0 0 1px "+M.danger[500]:"0 0 0 1px "+M.primary[500];return{control:(t,n)=>"dark"===e?{...t,...oe,background:"transparent",color:M.primary[300],borderColor:M.secondary[500],boxShadow:n.isFocused?r:"inherit"}:{...t,...oe,boxShadow:n.isFocused?r:M.neutral[500]},option:(t,{isSelected:r})=>"dark"===e?{...t,...oe,background:r?M.primary[700]:M.dark[800],color:"white"}:{...t,...oe},menu:t=>"dark"===e?{...t,...oe,background:M.dark[800],zIndex:5}:{...t,...oe,zIndex:5},singleValue:t=>"dark"===e?{...t,...oe,color:"white"}:{...t,...oe},input:t=>"dark"===e?{...t,...oe,color:"white"}:{...t,...oe},dropdownIndicator:t=>"dark"===e?{...t,...oe,color:M.secondary[500]}:{...t,...oe},indicatorSeparator:t=>"dark"===e?{...t,...oe,backgroundColor:M.secondary[500]}:{...t,...oe}}}const ce=e=>({...e,colors:{...e.colors,primary:M.primary[500],primary25:M.primary[50],primary50:M.primary[100],primary75:M.primary[200]}}),le=t.forwardRef((e,n)=>{var a,o;const i=t.useTab({...e,ref:n}),c=!!i["aria-selected"],l=t.useMultiStyleConfig("Tabs",i);return r.createElement(t.Button,Object.assign({p:3,fontSize:"text.md",_selected:{borderColor:t.useColorModeValue("primary.400","primary.300"),color:t.useColorModeValue("primary.500","primary.300"),transform:"translateY(-2px)"},color:t.useColorModeValue("black.high","primary.300"),_focus:{bg:"none"},__css:l.tab},i),r.createElement(t.Flex,null,null===(a=e.leftAddon)||void 0===a?void 0:a.call(e,{isSelected:c}),i.children,null===(o=e.rightAddon)||void 0===o?void 0:o.call(e,{isSelected:c})))}),de=t.forwardRef((e,r)=>n.createElement(t.TabList,{borderBottom:"1px solid",borderColor:t.useColorModeValue("gray.200","bright-gray.800"),ref:r},e.children)),pe=t.forwardRef((e,r)=>n.createElement(t.TabPanel,{px:0,ref:r},e.children)),se=({onHandleUploadFile:e,onHandleRejections:n,accept:a,multiple:o,selected:i,maxFiles:c=1,renderError:l,validator:d,...p})=>{const[s,m]=r.useState(),[u,_]=r.useState(i||!1),g=r.useCallback(t=>{t.length>0&&(null==e||e(t),o||(_(!0),m(t[0])))},[o,e]),{getRootProps:b,getInputProps:k,isDragActive:f,fileRejections:x}=h.useDropzone({onDrop:g,accept:a,maxFiles:c,multiple:o,validator:d});r.useEffect(()=>{x.length>0&&n&&n(x)},[x,n]);const y=r.useMemo(()=>{const e=x.length>0;return e&&_(!1),e},[x]);return r.useEffect(()=>{_(null!=i&&i)},[i]),r.createElement(t.Stack,{direction:"column"},r.createElement(t.Flex,Object.assign({minH:200,border:"1px dashed",borderColor:y?"danger.500":"primary.500",alignItems:"center",justifyContent:"center",cursor:"pointer"},p,b()),r.createElement("input",Object.assign({},k())),f?r.createElement(t.Text,null,"Drop file disini..."):r.createElement(t.Flex,{flexDirection:"column",alignItems:"center",color:y?"danger.500":"primary.500"},!o&&u&&r.createElement(t.Heading,{fontWeight:400,fontSize:"18px",lineHeight:28,color:"black.high",mb:2},null==s?void 0:s.name),!u&&r.createElement(t.Heading,{fontWeight:400,fontSize:"18px",lineHeight:28,mb:2},"Upload File"),r.createElement(t.Text,null,u?"(Klik atau drag untuk mengganti file)":"(Klik atau drag untuk input file)"))),null==l?void 0:l(x))};se.defaultProps={onHandleUploadFile:void 0,onHandleRejections:void 0,renderError:void 0,selected:!1};const me={baseStyle:{fontSize:"body.1",fontWeight:"normal",lineHeight:"1.25",minW:24,px:4,py:2,borderRadius:"md",_disabled:{opacity:.3},_hover:{_disabled:{opacity:.3}},_active:{_disabled:{opacity:.3}},_loading:{opacity:.7}},sizes:{lg:{fontSize:"button.lg",h:12},md:{fontSize:"button.md",h:9},sm:{fontSize:"button.sm",h:6}},variants:{solid:{color:"white",bg:"primary.500",_disabled:{bg:"primary.700"},_hover:{bg:"primary.600"},_active:{bg:"primary.700"},_focus:{bg:"primary.700"}},outline:e=>({color:"primary.500",borderWidth:1,borderStyle:"inside",bg:b.mode("white","transparent")(e),borderColor:b.mode("primary.500","primary.500")(e),_hover:{bg:"primary.50"},_active:{bg:"primary.100"},_focus:{bg:"primary.100"}}),"outline-danger":{color:"danger.500",bg:"white",borderStyle:"inside",borderWidth:1,borderColor:"danger.500"},ghost:{color:"primary.500",_disabled:{bg:"primary.100"}},link:{bg:"transparent",color:"primary.500"}},defaultProps:{size:"md",variant:"solid",orientation:"vertical",colorScheme:"primary"}},{definePartsStyle:ue}=f.createMultiStyleConfigHelpers(k.checkboxAnatomy.keys),_e=f.cssVar("checkbox-size"),ge={baseStyle:{borderRadius:"sm"},sizes:{sm:ue({control:{[_e.variable]:"sizes.4",borderRadius:"md"},label:{fontSize:"text.sm"},icon:{fontSize:"3xs"}}),md:ue({control:{[_e.variable]:"sizes.5",borderRadius:"md"},label:{fontSize:"text.md"},icon:{fontSize:"2xs"}}),lg:ue({control:{[_e.variable]:"sizes.6",borderRadius:"md"},label:{fontSize:"text.lg"},icon:{fontSize:"xs"}})},variants:{},defaultProps:{size:"sm",variant:"solid",orientation:"vertical",colorScheme:"primary"}},he=f.defineStyleConfig({baseStyle:f.defineStyle({fontSize:"field.sm",marginEnd:1,mb:1})}),{definePartsStyle:be,defineMultiStyleConfig:ke}=f.createMultiStyleConfigHelpers(k.inputAnatomy.keys),fe=be({field:{width:"100%",minWidth:0,outline:0,px:2.5,py:2,position:"relative",appearance:"none",transitionProperty:"common",transitionDuration:"normal",color:"black.high",_disabled:{bg:"neutral.300",border:"1px solid",borderColor:"neutral.400",cursor:"not-allowed"},_placeholder:{color:"black.low"}}}),xe={lg:f.defineStyle({fontSize:"field.lg",h:12,borderRadius:"md"}),md:f.defineStyle({fontSize:"field.md",h:10,borderRadius:"md"}),sm:f.defineStyle({fontSize:"field.sm",h:9.5,borderRadius:"md"})},ye=ke({baseStyle:fe,sizes:{lg:be({field:xe.lg,addon:xe.lg}),md:be({field:xe.md,addon:xe.md}),sm:be({field:xe.sm,addon:xe.sm})},variants:{outline:be(e=>{const{theme:t}=e,{focusBorderColor:r,errorBorderColor:n,readOnlyBorderColor:a}=function(e){const{focusBorderColor:t,errorBorderColor:r,readOnlyBorderColor:n}=e;return{focusBorderColor:t||b.mode("primary.500","primary.300")(e),errorBorderColor:r||b.mode("danger.500","danger.300")(e),readOnlyBorderColor:n||b.mode(".500","danger.300")(e)}}(e);return{field:{border:"1px solid",borderColor:b.mode("dark.200","inherit")(e),bg:b.mode("white","inherit")(e),color:b.mode("inherit","white")(e),_hover:{borderColor:b.mode("gray.300","whiteAlpha.400")(e)},_readOnly:{userSelect:"all",borderColor:b.getColor(t,a),boxShadow:"0 0 0 0 "+b.getColor(t,a)},_invalid:{borderColor:b.getColor(t,n),boxShadow:"0 0 0 0 "+b.getColor(t,n)},_focusVisible:{zIndex:1,borderColor:b.getColor(t,r),boxShadow:"0 0 0 0 "+b.getColor(t,r)}},addon:{border:"1px solid",borderColor:b.mode("inherit","whiteAlpha.50")(e),bg:b.mode("gray.100","whiteAlpha.300")(e)}}}),unstyled:be({field:{bg:"transparent",px:"0",height:"auto"},addon:{bg:"transparent",px:"0",height:"auto"}})},defaultProps:{size:"sm",variant:"outline"}}),{definePartsStyle:ve}=f.createMultiStyleConfigHelpers(k.radioAnatomy.keys),we={baseStyle:ve({control:{_checked:{borderColor:"primary.500",bg:"white",_before:{h:"72%",w:"72%",bg:"primary.500"},_hover:{borderColor:"primary.500",bg:"gray.200"}}}}),sizes:{sm:ve({control:{w:"3",h:"3"},label:{fontSize:"text.sm"}}),md:ve({control:{w:"4",h:"4"},label:{fontSize:"text.md"}}),lg:ve({control:{w:"5",h:"5"},label:{fontSize:"text.lg"}})},variants:{},defaultProps:{size:"sm",variant:"solid",orientation:"vertical",colorScheme:"primary"}},{definePartsStyle:Ee,defineMultiStyleConfig:Ce}=t.createMultiStyleConfigHelpers(k.switchAnatomy.keys),Se=Ce({baseStyle:Ee({container:{},thumb:{bg:"white"},track:{bg:"neutral.400",p:1,_checked:{bg:"primary.500"}}})}),{definePartsStyle:Fe}=f.createMultiStyleConfigHelpers(k.popoverAnatomy.keys),Me=t.extendTheme({...T,components:{__proto__:null,Button:me,Checkbox:ge,FormLabel:he,Input:ye,Radio:we,Switch:Se,Popover:{baseStyle:e=>Fe({popper:{background:b.mode("white","inherit")(e)}})},Textarea:{baseStyle:{_hover:{borderColor:"primary.500",boxShadow:"none",outline:"none"},_focus:{borderColor:"primary.500",boxShadow:"none",outline:"none"},_focusVisible:{borderColor:"primary.500",boxShadow:"none",outline:"none"},_focusWithin:{borderColor:"primary.500",boxShadow:"none",outline:"none"}}}},styles:{global:{"*::-webkit-scrollbar-thumb":{background:"neutral.400"},body:{fontSize:"text.sm"}}},config:{initialColorMode:"light",useSystemColorMode:!1}}),Pe=r.createContext({instance:void 0}),De=({children:e,config:t,requestInterceptors:a,responseInterceptors:o})=>{const i=r.useRef(x.create(t));r.useEffect(()=>{null==a||a.forEach(e=>{i.current.interceptors.request.use(e)}),null==o||o.forEach(e=>{i.current.interceptors.response.use(e)})},[a,o]);const c=r.useMemo(()=>({instance:i.current}),[]);return n.createElement(Pe.Provider,{value:c},e)};De.displayName="Provider",Object.defineProperty(exports,"AlertDialog",{enumerable:!0,get:function(){return t.AlertDialog}}),Object.defineProperty(exports,"AlertDialogBody",{enumerable:!0,get:function(){return t.ModalBody}}),Object.defineProperty(exports,"AlertDialogCloseButton",{enumerable:!0,get:function(){return t.ModalCloseButton}}),Object.defineProperty(exports,"AlertDialogContent",{enumerable:!0,get:function(){return t.AlertDialogContent}}),Object.defineProperty(exports,"AlertDialogFooter",{enumerable:!0,get:function(){return t.ModalFooter}}),Object.defineProperty(exports,"AlertDialogHeader",{enumerable:!0,get:function(){return t.ModalHeader}}),Object.defineProperty(exports,"AlertDialogOverlay",{enumerable:!0,get:function(){return t.ModalOverlay}}),Object.defineProperty(exports,"Drawer",{enumerable:!0,get:function(){return t.Drawer}}),Object.defineProperty(exports,"DrawerBody",{enumerable:!0,get:function(){return t.ModalBody}}),Object.defineProperty(exports,"DrawerCloseButton",{enumerable:!0,get:function(){return t.ModalCloseButton}}),Object.defineProperty(exports,"DrawerContent",{enumerable:!0,get:function(){return t.DrawerContent}}),Object.defineProperty(exports,"DrawerFooter",{enumerable:!0,get:function(){return t.ModalFooter}}),Object.defineProperty(exports,"DrawerHeader",{enumerable:!0,get:function(){return t.ModalHeader}}),Object.defineProperty(exports,"DrawerOverlay",{enumerable:!0,get:function(){return t.ModalOverlay}}),Object.defineProperty(exports,"Modal",{enumerable:!0,get:function(){return t.Modal}}),Object.defineProperty(exports,"ModalContent",{enumerable:!0,get:function(){return t.ModalContent}}),Object.defineProperty(exports,"ModalContextProvider",{enumerable:!0,get:function(){return t.ModalContextProvider}}),Object.defineProperty(exports,"ModalFocusScope",{enumerable:!0,get:function(){return t.ModalFocusScope}}),Object.defineProperty(exports,"ModalOverlay",{enumerable:!0,get:function(){return t.ModalOverlay}}),Object.defineProperty(exports,"TabIndicator",{enumerable:!0,get:function(){return t.TabIndicator}}),Object.defineProperty(exports,"TabPanels",{enumerable:!0,get:function(){return t.TabPanels}}),Object.defineProperty(exports,"Tabs",{enumerable:!0,get:function(){return t.Tabs}}),Object.defineProperty(exports,"TabsDescendantsProvider",{enumerable:!0,get:function(){return t.TabsDescendantsProvider}}),Object.defineProperty(exports,"TabsProvider",{enumerable:!0,get:function(){return t.TabsProvider}}),Object.defineProperty(exports,"useDrawerContext",{enumerable:!0,get:function(){return t.useDrawerContext}}),Object.defineProperty(exports,"useModal",{enumerable:!0,get:function(){return t.useModal}}),Object.defineProperty(exports,"useModalContext",{enumerable:!0,get:function(){return t.useModalContext}}),Object.defineProperty(exports,"useModalStyles",{enumerable:!0,get:function(){return t.useModalStyles}}),Object.defineProperty(exports,"useTab",{enumerable:!0,get:function(){return t.useTab}}),Object.defineProperty(exports,"useTabIndicator",{enumerable:!0,get:function(){return t.useTabIndicator}}),Object.defineProperty(exports,"useTabList",{enumerable:!0,get:function(){return t.useTabList}}),Object.defineProperty(exports,"useTabPanel",{enumerable:!0,get:function(){return t.useTabPanel}}),Object.defineProperty(exports,"useTabPanels",{enumerable:!0,get:function(){return t.useTabPanels}}),Object.defineProperty(exports,"useTabs",{enumerable:!0,get:function(){return t.useTabs}}),Object.defineProperty(exports,"useTabsContext",{enumerable:!0,get:function(){return t.useTabsContext}}),Object.defineProperty(exports,"useTabsDescendant",{enumerable:!0,get:function(){return t.useTabsDescendant}}),Object.defineProperty(exports,"useTabsDescendants",{enumerable:!0,get:function(){return t.useTabsDescendants}}),Object.defineProperty(exports,"useTabsDescendantsContext",{enumerable:!0,get:function(){return t.useTabsDescendantsContext}}),Object.defineProperty(exports,"useTabsStyles",{enumerable:!0,get:function(){return t.useTabsStyles}}),exports.BreadCrumb=y,exports.DataTable=w,exports.DatePickerMonth=F,exports.Datepicker=S,exports.Field=j,exports.Header=U,exports.InputField=I,exports.MainMenu=J,exports.ModalBody=G,exports.ModalCloseButton=Z,exports.ModalFooter=X,exports.ModalHeader=Y,exports.MultiDatePickerMonth=R,exports.Pagination=te,exports.PaginationDetail=({page:e,limit:n,length:a,scale:o=300,fontSize:i="xs",lineHeight:c=18,...l})=>r.createElement(t.Text,Object.assign({scale:o,fontSize:i,lineHeight:c},l),`${(e-1)*n+1}-${n*e<a?n*e:a} dari ${a} item`),exports.PaginationFilter=re,exports.Provider=De,exports.ProviderContext=Pe,exports.Select=function({isError:e=!1,...t}){const{colorMode:r}=p.useColorMode();return n.createElement(ne,{isError:e},n.createElement(m,Object.assign({classNamePrefix:"react-select"},t,{styles:{...ie(r,e)},theme:ce})))},exports.SelectAsync=function({styles:e,isError:t=!1,...r}){const{colorMode:a}=p.useColorMode();return n.createElement(ne,{isError:t},n.createElement(u.AsyncPaginate,Object.assign({classNamePrefix:"react-select"},r,{styles:{...ie(a,t),...e},theme:ce})))},exports.SelectAsyncCreatable=function({styles:e,isError:t=!1,...r}){const{colorMode:a}=p.useColorMode();return n.createElement(ne,{isError:t},n.createElement(_,Object.assign({classNamePrefix:"react-select"},r,{styles:{...ie(a,t),...e},theme:ce})))},exports.SelectCreatable=function({styles:e,isError:t=!1,...r}){const{colorMode:a}=p.useColorMode();return n.createElement(ne,{isError:t},n.createElement(g,Object.assign({classNamePrefix:"react-select"},r,{styles:{...ie(a,t),...e},theme:ce})))},exports.Tab=le,exports.TabList=de,exports.TabPanel=pe,exports.TextareaField=H,exports.Uploader=se,exports.theme=Me,exports.useInternalUI=()=>{const{instance:e}=r.useContext(Pe);return{instance:e}};
45
+ `},e);ne.defaultProps={isError:!1};const ae=A.text.sm,oe={fontSize:ae.fontSize,lineHeight:ae.lineHeight,letterSpacing:0};function ie(e,t){return{control:(t,r)=>"dark"===e?{...t,...oe,background:"transparent",color:M.primary[300],borderColor:M.secondary[500],boxShadow:r.isFocused?"none":"inherit"}:{...t,...oe,boxShadow:r.isFocused?"none":M.neutral[500]},option:(t,{isSelected:r})=>"dark"===e?{...t,...oe,background:r?M.primary[700]:M.dark[800],color:"white"}:{...t,...oe},menu:t=>"dark"===e?{...t,...oe,background:M.dark[800],zIndex:5}:{...t,...oe,zIndex:5},singleValue:t=>"dark"===e?{...t,...oe,color:"white"}:{...t,...oe},input:t=>"dark"===e?{...t,...oe,color:"white"}:{...t,...oe},dropdownIndicator:t=>"dark"===e?{...t,...oe,color:M.secondary[500]}:{...t,...oe},indicatorSeparator:t=>"dark"===e?{...t,...oe,backgroundColor:M.secondary[500]}:{...t,...oe}}}const ce=e=>({...e,colors:{...e.colors,primary:M.primary[500],primary25:M.primary[50],primary50:M.primary[100],primary75:M.primary[200]}}),le=t.forwardRef((e,n)=>{var a,o;const i=t.useTab({...e,ref:n}),c=!!i["aria-selected"],l=t.useMultiStyleConfig("Tabs",i);return r.createElement(t.Button,Object.assign({p:3,fontSize:"text.md",_selected:{borderColor:t.useColorModeValue("primary.400","primary.300"),color:t.useColorModeValue("primary.500","primary.300"),transform:"translateY(-2px)"},color:t.useColorModeValue("black.high","primary.300"),_focus:{bg:"none"},__css:l.tab},i),r.createElement(t.Flex,null,null===(a=e.leftAddon)||void 0===a?void 0:a.call(e,{isSelected:c}),i.children,null===(o=e.rightAddon)||void 0===o?void 0:o.call(e,{isSelected:c})))}),de=t.forwardRef((e,r)=>n.createElement(t.TabList,{borderBottom:"1px solid",borderColor:t.useColorModeValue("gray.200","bright-gray.800"),ref:r},e.children)),pe=t.forwardRef((e,r)=>n.createElement(t.TabPanel,{px:0,ref:r},e.children)),se=({onHandleUploadFile:e,onHandleRejections:n,accept:a,multiple:o,selected:i,maxFiles:c=1,renderError:l,validator:d,...p})=>{const[s,m]=r.useState(),[u,_]=r.useState(i||!1),g=r.useCallback(t=>{t.length>0&&(null==e||e(t),o||(_(!0),m(t[0])))},[o,e]),{getRootProps:b,getInputProps:k,isDragActive:f,fileRejections:x}=h.useDropzone({onDrop:g,accept:a,maxFiles:c,multiple:o,validator:d});r.useEffect(()=>{x.length>0&&n&&n(x)},[x,n]);const y=r.useMemo(()=>{const e=x.length>0;return e&&_(!1),e},[x]);return r.useEffect(()=>{_(null!=i&&i)},[i]),r.createElement(t.Stack,{direction:"column"},r.createElement(t.Flex,Object.assign({minH:200,border:"1px dashed",borderColor:y?"danger.500":"primary.500",alignItems:"center",justifyContent:"center",cursor:"pointer"},p,b()),r.createElement("input",Object.assign({},k())),f?r.createElement(t.Text,null,"Drop file disini..."):r.createElement(t.Flex,{flexDirection:"column",alignItems:"center",color:y?"danger.500":"primary.500"},!o&&u&&r.createElement(t.Heading,{fontWeight:400,fontSize:"18px",lineHeight:28,color:"black.high",mb:2},null==s?void 0:s.name),!u&&r.createElement(t.Heading,{fontWeight:400,fontSize:"18px",lineHeight:28,mb:2},"Upload File"),r.createElement(t.Text,null,u?"(Klik atau drag untuk mengganti file)":"(Klik atau drag untuk input file)"))),null==l?void 0:l(x))};se.defaultProps={onHandleUploadFile:void 0,onHandleRejections:void 0,renderError:void 0,selected:!1};const me={baseStyle:{fontSize:"body.1",fontWeight:"normal",lineHeight:"1.25",minW:24,px:4,py:2,borderRadius:"md",_disabled:{opacity:.3},_hover:{_disabled:{opacity:.3}},_active:{_disabled:{opacity:.3}},_loading:{opacity:.7}},sizes:{lg:{fontSize:"button.lg",h:12},md:{fontSize:"button.md",h:9},sm:{fontSize:"button.sm",h:6}},variants:{solid:{color:"white",bg:"primary.500",_disabled:{bg:"primary.700"},_hover:{bg:"primary.600"},_active:{bg:"primary.700"},_focus:{bg:"primary.700"}},outline:e=>({color:"primary.500",borderWidth:1,borderStyle:"inside",bg:b.mode("white","transparent")(e),borderColor:b.mode("primary.500","primary.500")(e),_hover:{bg:"primary.50"},_active:{bg:"primary.100"},_focus:{bg:"primary.100"}}),"outline-danger":{color:"danger.500",bg:"white",borderStyle:"inside",borderWidth:1,borderColor:"danger.500"},ghost:{color:"primary.500",_disabled:{bg:"primary.100"}},link:{bg:"transparent",color:"primary.500"}},defaultProps:{size:"md",variant:"solid",orientation:"vertical",colorScheme:"primary"}},{definePartsStyle:ue}=f.createMultiStyleConfigHelpers(k.checkboxAnatomy.keys),_e=f.cssVar("checkbox-size"),ge={baseStyle:{borderRadius:"sm"},sizes:{sm:ue({control:{[_e.variable]:"sizes.4",borderRadius:"md"},label:{fontSize:"text.sm"},icon:{fontSize:"3xs"}}),md:ue({control:{[_e.variable]:"sizes.5",borderRadius:"md"},label:{fontSize:"text.md"},icon:{fontSize:"2xs"}}),lg:ue({control:{[_e.variable]:"sizes.6",borderRadius:"md"},label:{fontSize:"text.lg"},icon:{fontSize:"xs"}})},variants:{},defaultProps:{size:"sm",variant:"solid",orientation:"vertical",colorScheme:"primary"}},he=f.defineStyleConfig({baseStyle:f.defineStyle({fontSize:"field.sm",marginEnd:1,mb:1})}),{definePartsStyle:be,defineMultiStyleConfig:ke}=f.createMultiStyleConfigHelpers(k.inputAnatomy.keys),fe=be({field:{width:"100%",minWidth:0,outline:0,px:2.5,py:2,position:"relative",appearance:"none",transitionProperty:"common",transitionDuration:"normal",color:"black.high",_disabled:{bg:"neutral.300",border:"1px solid",borderColor:"neutral.400",cursor:"not-allowed"},_placeholder:{color:"black.low"}}}),xe={lg:f.defineStyle({fontSize:"field.lg",h:12,borderRadius:"md"}),md:f.defineStyle({fontSize:"field.md",h:10,borderRadius:"md"}),sm:f.defineStyle({fontSize:"field.sm",h:9.5,borderRadius:"md"})},ye=ke({baseStyle:fe,sizes:{lg:be({field:xe.lg,addon:xe.lg}),md:be({field:xe.md,addon:xe.md}),sm:be({field:xe.sm,addon:xe.sm})},variants:{outline:be(e=>{const{theme:t}=e,{focusBorderColor:r,errorBorderColor:n,readOnlyBorderColor:a}=function(e){const{focusBorderColor:t,errorBorderColor:r,readOnlyBorderColor:n}=e;return{focusBorderColor:t||b.mode("primary.500","primary.300")(e),errorBorderColor:r||b.mode("danger.500","danger.300")(e),readOnlyBorderColor:n||b.mode(".500","danger.300")(e)}}(e);return{field:{border:"1px solid",borderColor:b.mode("dark.200","inherit")(e),bg:b.mode("white","inherit")(e),color:b.mode("inherit","white")(e),_hover:{borderColor:b.mode("gray.300","whiteAlpha.400")(e)},_readOnly:{userSelect:"all",borderColor:b.getColor(t,a),boxShadow:"0 0 0 0 "+b.getColor(t,a)},_invalid:{borderColor:b.getColor(t,n),boxShadow:"0 0 0 0 "+b.getColor(t,n)},_focusVisible:{zIndex:1,borderColor:b.getColor(t,r),boxShadow:"0 0 0 0 "+b.getColor(t,r)}},addon:{border:"1px solid",borderColor:b.mode("inherit","whiteAlpha.50")(e),bg:b.mode("gray.100","whiteAlpha.300")(e)}}}),unstyled:be({field:{bg:"transparent",px:"0",height:"auto"},addon:{bg:"transparent",px:"0",height:"auto"}})},defaultProps:{size:"sm",variant:"outline"}}),{definePartsStyle:ve}=f.createMultiStyleConfigHelpers(k.radioAnatomy.keys),we={baseStyle:ve({control:{_checked:{borderColor:"primary.500",bg:"white",_before:{h:"72%",w:"72%",bg:"primary.500"},_hover:{borderColor:"primary.500",bg:"gray.200"}}}}),sizes:{sm:ve({control:{w:"3",h:"3"},label:{fontSize:"text.sm"}}),md:ve({control:{w:"4",h:"4"},label:{fontSize:"text.md"}}),lg:ve({control:{w:"5",h:"5"},label:{fontSize:"text.lg"}})},variants:{},defaultProps:{size:"sm",variant:"solid",orientation:"vertical",colorScheme:"primary"}},{definePartsStyle:Ee,defineMultiStyleConfig:Ce}=t.createMultiStyleConfigHelpers(k.switchAnatomy.keys),Se=Ce({baseStyle:Ee({container:{},thumb:{bg:"white"},track:{bg:"neutral.400",p:1,_checked:{bg:"primary.500"}}})}),{definePartsStyle:Fe}=f.createMultiStyleConfigHelpers(k.popoverAnatomy.keys),Me=t.extendTheme({...T,components:{__proto__:null,Button:me,Checkbox:ge,FormLabel:he,Input:ye,Radio:we,Switch:Se,Popover:{baseStyle:e=>Fe({popper:{background:b.mode("white","inherit")(e)}})},Textarea:{baseStyle:{_hover:{borderColor:"primary.500",boxShadow:"none",outline:"none"},_focus:{borderColor:"primary.500",boxShadow:"none",outline:"none"},_focusVisible:{borderColor:"primary.500",boxShadow:"none",outline:"none"},_focusWithin:{borderColor:"primary.500",boxShadow:"none",outline:"none"}}}},styles:{global:{"*::-webkit-scrollbar-thumb":{background:"neutral.400"},body:{fontSize:"text.sm"}}},config:{initialColorMode:"light",useSystemColorMode:!1}}),Pe=r.createContext({instance:void 0}),De=({children:e,config:t,requestInterceptors:a,responseInterceptors:o})=>{const i=r.useRef(x.create(t));r.useEffect(()=>{null==a||a.forEach(e=>{i.current.interceptors.request.use(e)}),null==o||o.forEach(e=>{i.current.interceptors.response.use(e)})},[a,o]);const c=r.useMemo(()=>({instance:i.current}),[]);return n.createElement(Pe.Provider,{value:c},e)};De.displayName="Provider",Object.defineProperty(exports,"AlertDialog",{enumerable:!0,get:function(){return t.AlertDialog}}),Object.defineProperty(exports,"AlertDialogBody",{enumerable:!0,get:function(){return t.ModalBody}}),Object.defineProperty(exports,"AlertDialogCloseButton",{enumerable:!0,get:function(){return t.ModalCloseButton}}),Object.defineProperty(exports,"AlertDialogContent",{enumerable:!0,get:function(){return t.AlertDialogContent}}),Object.defineProperty(exports,"AlertDialogFooter",{enumerable:!0,get:function(){return t.ModalFooter}}),Object.defineProperty(exports,"AlertDialogHeader",{enumerable:!0,get:function(){return t.ModalHeader}}),Object.defineProperty(exports,"AlertDialogOverlay",{enumerable:!0,get:function(){return t.ModalOverlay}}),Object.defineProperty(exports,"Drawer",{enumerable:!0,get:function(){return t.Drawer}}),Object.defineProperty(exports,"DrawerBody",{enumerable:!0,get:function(){return t.ModalBody}}),Object.defineProperty(exports,"DrawerCloseButton",{enumerable:!0,get:function(){return t.ModalCloseButton}}),Object.defineProperty(exports,"DrawerContent",{enumerable:!0,get:function(){return t.DrawerContent}}),Object.defineProperty(exports,"DrawerFooter",{enumerable:!0,get:function(){return t.ModalFooter}}),Object.defineProperty(exports,"DrawerHeader",{enumerable:!0,get:function(){return t.ModalHeader}}),Object.defineProperty(exports,"DrawerOverlay",{enumerable:!0,get:function(){return t.ModalOverlay}}),Object.defineProperty(exports,"Modal",{enumerable:!0,get:function(){return t.Modal}}),Object.defineProperty(exports,"ModalContent",{enumerable:!0,get:function(){return t.ModalContent}}),Object.defineProperty(exports,"ModalContextProvider",{enumerable:!0,get:function(){return t.ModalContextProvider}}),Object.defineProperty(exports,"ModalFocusScope",{enumerable:!0,get:function(){return t.ModalFocusScope}}),Object.defineProperty(exports,"ModalOverlay",{enumerable:!0,get:function(){return t.ModalOverlay}}),Object.defineProperty(exports,"TabIndicator",{enumerable:!0,get:function(){return t.TabIndicator}}),Object.defineProperty(exports,"TabPanels",{enumerable:!0,get:function(){return t.TabPanels}}),Object.defineProperty(exports,"Tabs",{enumerable:!0,get:function(){return t.Tabs}}),Object.defineProperty(exports,"TabsDescendantsProvider",{enumerable:!0,get:function(){return t.TabsDescendantsProvider}}),Object.defineProperty(exports,"TabsProvider",{enumerable:!0,get:function(){return t.TabsProvider}}),Object.defineProperty(exports,"useDrawerContext",{enumerable:!0,get:function(){return t.useDrawerContext}}),Object.defineProperty(exports,"useModal",{enumerable:!0,get:function(){return t.useModal}}),Object.defineProperty(exports,"useModalContext",{enumerable:!0,get:function(){return t.useModalContext}}),Object.defineProperty(exports,"useModalStyles",{enumerable:!0,get:function(){return t.useModalStyles}}),Object.defineProperty(exports,"useTab",{enumerable:!0,get:function(){return t.useTab}}),Object.defineProperty(exports,"useTabIndicator",{enumerable:!0,get:function(){return t.useTabIndicator}}),Object.defineProperty(exports,"useTabList",{enumerable:!0,get:function(){return t.useTabList}}),Object.defineProperty(exports,"useTabPanel",{enumerable:!0,get:function(){return t.useTabPanel}}),Object.defineProperty(exports,"useTabPanels",{enumerable:!0,get:function(){return t.useTabPanels}}),Object.defineProperty(exports,"useTabs",{enumerable:!0,get:function(){return t.useTabs}}),Object.defineProperty(exports,"useTabsContext",{enumerable:!0,get:function(){return t.useTabsContext}}),Object.defineProperty(exports,"useTabsDescendant",{enumerable:!0,get:function(){return t.useTabsDescendant}}),Object.defineProperty(exports,"useTabsDescendants",{enumerable:!0,get:function(){return t.useTabsDescendants}}),Object.defineProperty(exports,"useTabsDescendantsContext",{enumerable:!0,get:function(){return t.useTabsDescendantsContext}}),Object.defineProperty(exports,"useTabsStyles",{enumerable:!0,get:function(){return t.useTabsStyles}}),exports.BreadCrumb=y,exports.DataTable=w,exports.DatePickerMonth=F,exports.Datepicker=S,exports.Field=j,exports.Header=U,exports.InputField=I,exports.MainMenu=J,exports.ModalBody=G,exports.ModalCloseButton=Z,exports.ModalFooter=X,exports.ModalHeader=Y,exports.MultiDatePickerMonth=R,exports.Pagination=te,exports.PaginationDetail=({page:e,limit:n,length:a,scale:o=300,fontSize:i="xs",lineHeight:c=18,...l})=>r.createElement(t.Text,Object.assign({scale:o,fontSize:i,lineHeight:c},l),`${(e-1)*n+1}-${n*e<a?n*e:a} dari ${a} item`),exports.PaginationFilter=re,exports.Provider=De,exports.ProviderContext=Pe,exports.Select=function({isError:e=!1,...t}){const{colorMode:r}=p.useColorMode();return n.createElement(ne,{isError:e},n.createElement(m,Object.assign({classNamePrefix:"react-select"},t,{styles:{...ie(r)},theme:ce})))},exports.SelectAsync=function({styles:e,isError:t=!1,...r}){const{colorMode:a}=p.useColorMode();return n.createElement(ne,{isError:t},n.createElement(u.AsyncPaginate,Object.assign({classNamePrefix:"react-select"},r,{styles:{...ie(a),...e},theme:ce})))},exports.SelectAsyncCreatable=function({styles:e,isError:t=!1,...r}){const{colorMode:a}=p.useColorMode();return n.createElement(ne,{isError:t},n.createElement(_,Object.assign({classNamePrefix:"react-select"},r,{styles:{...ie(a),...e},theme:ce})))},exports.SelectCreatable=function({styles:e,isError:t=!1,...r}){const{colorMode:a}=p.useColorMode();return n.createElement(ne,{isError:t},n.createElement(g,Object.assign({classNamePrefix:"react-select"},r,{styles:{...ie(a),...e},theme:ce})))},exports.Tab=le,exports.TabList=de,exports.TabPanel=pe,exports.TextareaField=H,exports.Uploader=se,exports.theme=Me,exports.useInternalUI=()=>{const{instance:e}=r.useContext(Pe);return{instance:e}};
46
46
  //# sourceMappingURL=internal-ui.cjs.production.min.js.map