@ctlyst.id/internal-ui 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/config/theme/components/badge.d.ts +3 -0
- package/dist/config/theme/components/index.d.ts +1 -0
- package/dist/internal-ui.cjs.development.js +68 -3
- package/dist/internal-ui.cjs.development.js.map +1 -1
- package/dist/internal-ui.cjs.production.min.js +2 -2
- package/dist/internal-ui.cjs.production.min.js.map +1 -1
- package/dist/internal-ui.esm.js +71 -6
- package/dist/internal-ui.esm.js.map +1 -1
- package/package.json +2 -2
@@ -1,4 +1,4 @@
|
|
1
|
-
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@chakra-ui/react"),r=require("react"),n=e(r),a=require("react-icons/fi"),o=require("@chakra-ui/icons"),i=require("@emotion/react"),c=require("@tanstack/react-table"),l=e(require("classnames")),d=e(require("react-datepicker")),s=require("@chakra-ui/system"),p=e(require("@emotion/styled")),m=require("@ctlyst.id/internal-icon"),u=e(require("react-select")),g=require("react-select-async-paginate"),h=e(require("react-select/async-creatable")),_=e(require("react-select/creatable")),b=require("@chakra-ui/shared-utils"),x=require("react-dropzone"),k=require("@chakra-ui/anatomy"),f=require("@chakra-ui/styled-system"),y=require("@chakra-ui/theme-tools"),v=e(require("axios"));const w=e=>{const{children:r,pill:a,...o}=e;return n.createElement(t.Badge,Object.assign({borderRadius:a?10:4,variant:"solid",
|
1
|
+
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@chakra-ui/react"),r=require("react"),n=e(r),a=require("react-icons/fi"),o=require("@chakra-ui/icons"),i=require("@emotion/react"),c=require("@tanstack/react-table"),l=e(require("classnames")),d=e(require("react-datepicker")),s=require("@chakra-ui/system"),p=e(require("@emotion/styled")),m=require("@ctlyst.id/internal-icon"),u=e(require("react-select")),g=require("react-select-async-paginate"),h=e(require("react-select/async-creatable")),_=e(require("react-select/creatable")),b=require("@chakra-ui/shared-utils"),x=require("react-dropzone"),k=require("@chakra-ui/anatomy"),f=require("@chakra-ui/styled-system"),y=require("@chakra-ui/theme-tools"),v=e(require("axios"));const w=e=>{const{children:r,pill:a,...o}=e;return n.createElement(t.Badge,Object.assign({borderRadius:a?10:4,variant:"primary-solid",padding:"0 8px",height:"18px",display:"flex",alignItems:"center",justifyContent:"space-between",textTransform:"none"},o),r)};w.defaultProps={pill:!1};const C=e=>{const{title:n,children:o,parents:i,className:c,disableHome:l,spacing:d=2}=e,[s,p]=t.useToken("colors",["neutral.600","dark.500"]);return r.createElement(t.Box,{"data-test-id":"CT_component_breadcrumb_breadcrumb",className:c,display:"flex",justifyContent:"space-between",alignItems:"center",paddingY:2},r.createElement(t.Box,{display:"flex",alignItems:"center"},r.createElement(t.Text,{pr:2,fontWeight:600,textStyle:"heading.4",color:t.useColorModeValue("neutral.700","white")},n),r.createElement(t.Box,{h:"22px",borderLeft:"1px solid",borderColor:t.useColorModeValue(s,"white")}),r.createElement(t.Breadcrumb,{separator:r.createElement(a.FiChevronsRight,{color:t.useColorModeValue(s,p),size:14}),pl:2.5,pr:4,spacing:d,sx:{ol:{display:"flex",alignItems:"center"}},display:"flex",alignItems:"center",className:"breadcrumb-wrapper"},r.createElement(t.BreadcrumbItem,null,r.createElement(t.BreadcrumbLink,{href:l?void 0:"/",style:{...l&&{cursor:"default"}}},r.createElement(a.FiHome,{className:"align-top",size:16,color:t.useColorModeValue("#12784A","#ffffff")}))),null==i?void 0:i.map(e=>r.createElement(t.BreadcrumbItem,{key:e.name},r.createElement(t.BreadcrumbLink,{"data-test-id":"iadKcMAul3QAdvmfIQjRE",href:e.disable?void 0:e.link,onClick:e.onClick,style:{...e.disable&&{cursor:"default"}},_hover:{textDecoration:"none"}},r.createElement(t.Text,{color:e.disable?"dark.600":t.useColorModeValue("primary.500","white"),fontSize:"text.sm",fontWeight:400},e.name)))),r.createElement(t.BreadcrumbItem,null,r.createElement(t.BreadcrumbLink,{_hover:{textDecor:"none",cursor:"default"}},r.createElement(t.Text,{color:t.useColorModeValue(s,"white"),fontSize:"text.sm",fontWeight:400},n))))),o&&r.createElement(t.Box,null,o))};C.defaultProps={children:void 0,parents:void 0,className:void 0,disableHome:void 0,spacing:2};const E=t.forwardRef((e,r)=>{const a=t.useStyleConfig("LoaderStyle",e);return n.createElement(t.Box,{ref:r,__css:a})}),S=r.forwardRef(({children:e,...r},a)=>{const o=t.useStyleConfig("Card",r);return n.createElement(t.Card,Object.assign({__css:o,backgroundColor:"white.high",ref:a},r),e)});function F({isError:e=!1,helpText:r="",errorText:a="",children:o,isDisabled:i,...c}){return n.createElement(t.Box,null,n.createElement(t.Box,{display:"flex"},n.createElement(t.Checkbox,Object.assign({variant:e?"errors":"unstyled"},c,{isDisabled:i}),o&&n.createElement(t.Text,{textStyle:"text.sm",color:i?"black.low":"black.high"},o))),n.createElement(t.Box,{mt:"5px",ml:"24px"},e?n.createElement(t.Text,{textStyle:"text.xs",color:"danger.500"},a):n.createElement(t.Text,{textStyle:"text.xs",color:"black.medium"},r)))}S.defaultProps={withShadow:!0,isRounded:!0},F.defaultProps={isError:!1,helpText:"",errorText:""};const M=e=>{const{label:r,isError:a,errorMessage:o,leftHelperText:i,rightHelperText:c,isRequired:l,children:d,isSuccess:s}=e,p=a?"danger.500":s?"success.500":"black.medium",m=c&&(!i||a&&!o)?"flex-end":"space-between";return n.createElement(t.FormControl,{isInvalid:a},r&&("string"==typeof r?n.createElement(t.FormLabel,{mb:1,fontSize:"text.sm",requiredIndicator:void 0},l&&n.createElement(t.Box,{as:"span",color:"danger.500",ml:0,mr:1},"*"),r):r),d,(a&&o||i||c)&&n.createElement(t.Box,{display:"flex",width:"full",justifyContent:m},a?"string"==typeof o?n.createElement(t.FormErrorMessage,{fontSize:"text.xs",color:"danger.500",mt:1},o):o:i&&n.createElement(t.FormHelperText,{fontSize:"text.xs",color:p,mt:1},i),c&&n.createElement(t.FormHelperText,{fontSize:"text.xs",color:p,mt:1},c)))};function P(e){const{children:r,label:a,helpText:o,isError:i,errorMessage:c,...l}=e;return n.createElement(M,Object.assign({},l,{label:a,leftHelperText:o,isError:i,errorMessage:c}),n.createElement(t.Box,{mt:"12px"},n.createElement(t.CheckboxGroup,Object.assign({},l),n.createElement(t.Stack,{spacing:[1,"16px"],direction:["column","row"]},r))))}M.defaultProps={label:"",isError:!1,isSuccess:!1,errorMessage:void 0,leftHelperText:void 0,rightHelperText:void 0,isRequired:!1},P.defaultProps={helpText:"",isError:!1,errorMessage:""};const D=({indeterminate:e=!1,...n})=>{const a=r.useRef(null);return r.useEffect(()=>{a.current&&"boolean"==typeof e&&(a.current.indeterminate=!n.checked&&e)},[a,e]),r.createElement(t.Flex,{align:"center"},r.createElement("input",Object.assign({type:"checkbox",ref:a},n)))},B=({columns:e,dataSource:n=[],isLoading:a,withSelectedRow:l,onSelectedRow:d,onSort:s,manualSorting:p,sortingState:m,styles:u,...g})=>{const[h,_]=r.useState(null!=m?m:[]),[b,x]=r.useState({}),k=r.useMemo(()=>e,[e]),f=r.useMemo(()=>[{id:"select",header:({table:e})=>r.createElement(D,Object.assign({},{checked:e.getIsAllRowsSelected(),indeterminate:e.getIsSomeRowsSelected(),onChange:e.getToggleAllRowsSelectedHandler()})),cell:({row:e})=>r.createElement(D,Object.assign({},{checked:e.getIsSelected(),indeterminate:e.getIsSomeSelected(),onChange:e.getToggleSelectedHandler()}))}],[]),y=c.useReactTable({data:n,columns:l?[...f,...k]:k,getCoreRowModel:c.getCoreRowModel(),getSortedRowModel:c.getSortedRowModel(),manualPagination:!0,sortDescFirst:!0,state:{sorting:h,rowSelection:b},onRowSelectionChange:x,onSortingChange:e=>{_(e),s&&s(e)},manualSorting:p}),{flatRows:v}=y.getSelectedRowModel();return r.useEffect(()=>{const e=v.map(e=>e.original);d&&d(e)},[v]),r.createElement(t.Box,Object.assign({},g),a&&r.createElement(t.Flex,{w:"100%",h:"100%",pos:"absolute",bg:"white",align:"center",justify:"center",zIndex:2},r.createElement(t.Spinner,{color:"primary.500",thickness:"4px",size:"lg"})),r.createElement(t.Table,Object.assign({},null==u?void 0:u.table),r.createElement(t.Thead,Object.assign({},null==u?void 0:u.tableHead),y.getHeaderGroups().map(e=>r.createElement(t.Tr,Object.assign({key:e.id,bg:t.useColorModeValue("initial","ebony-clay.700")},null==u?void 0:u.tableRow),e.headers.map(e=>{var n;return r.createElement(t.Th,Object.assign({key:e.id,colSpan:e.colSpan},null==u?void 0:u.tableColumnHeader),r.createElement(t.Flex,{"data-test-id":"CT_Container_TableHeader_"+e.id,textTransform:"capitalize",userSelect:"none",align:"center",justifyContent:"space-between"},r.createElement(t.Text,{fontSize:"text.sm",fontWeight:400,lineHeight:"18px",color:t.useColorModeValue("neutral.900","white")},c.flexRender(e.column.columnDef.header,e.getContext())),r.createElement(t.Box,{as:"span",pl:"2",cursor:e.column.getCanSort()?"pointer":"default","data-test-id":"CT_Container_SortingIcon_"+e.id,onClick:e.column.getToggleSortingHandler()},null!==(n=e.column.getCanSort()&&{asc:r.createElement(o.ChevronUpIcon,null),desc:r.createElement(o.ChevronDownIcon,null)}[e.column.getIsSorted()])&&void 0!==n?n:r.createElement(o.UpDownIcon,{h:2}))))})))),r.createElement(t.Tbody,Object.assign({},null==u?void 0:u.tableBody),y.getRowModel().rows.map(e=>r.createElement(t.Tr,Object.assign({key:e.id},null==u?void 0:u.tableRow,{css:i.css`
|
2
2
|
&:last-child {
|
3
3
|
td {
|
4
4
|
border-bottom: none;
|
@@ -42,5 +42,5 @@
|
|
42
42
|
.react-select__control:hover {
|
43
43
|
border-color: ${r?A.danger[500]:A.primary[500]} !important;
|
44
44
|
}
|
45
|
-
`},e);_e.defaultProps={isError:!1};const be=L.text.sm,xe={fontSize:be.fontSize,lineHeight:be.lineHeight,letterSpacing:0};function ke(e,t){return{control:(t,r)=>"dark"===e?{...t,...xe,background:"transparent",color:A.primary[300],borderColor:A.secondary[500],boxShadow:r.isFocused?"none":"inherit"}:{...t,...xe,boxShadow:r.isFocused?"none":A.neutral[500]},option:(t,{isSelected:r})=>"dark"===e?{...t,...xe,background:r?A.primary[700]:A.dark[800],color:"white"}:{...t,...xe},menu:t=>"dark"===e?{...t,...xe,background:A.dark[800],zIndex:5}:{...t,...xe,zIndex:5},singleValue:t=>"dark"===e?{...t,...xe,color:"white"}:{...t,...xe},input:t=>"dark"===e?{...t,...xe,color:"white"}:{...t,...xe},dropdownIndicator:t=>"dark"===e?{...t,...xe,color:A.secondary[500]}:{...t,...xe},indicatorSeparator:t=>"dark"===e?{...t,...xe,backgroundColor:A.secondary[500]}:{...t,...xe}}}const fe=e=>({...e,colors:{...e.colors,primary:A.primary[500],primary25:A.primary[50],primary50:A.primary[100],primary75:A.primary[200]}}),ye=t.forwardRef((function(e,a){const o=t.useMultiStyleConfig("Switch",e),{size:i="md"}=e,{spacing:c="0.5rem",children:l,...d}=t.omitThemingProps(e),{state:s,getInputProps:p,getCheckboxProps:u,getRootProps:g,getLabelProps:h}=t.useCheckbox(d),_=r.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"middle",lineHeight:0,...o.container}),[o.container]),x=r.useMemo(()=>({display:"inline-flex",flexShrink:0,justifyContent:"flex-start",boxSizing:"content-box",cursor:"pointer",width:200,...o.track}),[o.track]),k=r.useMemo(()=>({userSelect:"none",marginStart:c,...o.label}),[c,o.label]),f=e=>({sm:3,md:4,lg:5}[e]);return n.createElement(t.chakra.label,Object.assign({},g(),{display:"flex",alignItems:"center",className:b.cx("chakra-switch",e.className),__css:_}),n.createElement("input",Object.assign({"data-test-id":"",className:"chakra-switch__input"},p({},a))),n.createElement(t.chakra.span,Object.assign({},u(),{className:"chakra-switch__track",pos:"relative",__css:x}),n.createElement(t.Flex,{gap:2,pos:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"},n.createElement(m.Check,{color:"white",size:f(i)}),n.createElement(m.Close,{color:s.isDisabled?"neutral.600":"neutral.900",size:f(i)})),n.createElement(t.chakra.span,{__css:o.thumb,className:"chakra-switch__thumb","data-checked":b.dataAttr(s.isChecked),"data-hover":b.dataAttr(s.isHovered)})),l&&n.createElement(t.chakra.span,Object.assign({className:"chakra-switch__label",color:s.isDisabled?"black.low":"black.high"},h(),{__css:k}),l))})),ve=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})))}),we=t.forwardRef((e,r)=>n.createElement(t.TabList,{borderBottom:"1px solid",borderColor:t.useColorModeValue("gray.200","bright-gray.800"),ref:r},e.children)),Ce=t.forwardRef((e,r)=>n.createElement(t.TabPanel,{px:0,ref:r},e.children)),Ee=({onHandleUploadFile:e,onHandleRejections:n,accept:a,multiple:o,selected:i,maxFiles:c=1,renderError:l,validator:d,...s})=>{const[p,m]=r.useState(),[u,g]=r.useState(i||!1),h=r.useCallback(t=>{t.length>0&&(null==e||e(t),o||(g(!0),m(t[0])))},[o,e]),{getRootProps:_,getInputProps:b,isDragActive:k,fileRejections:f}=x.useDropzone({onDrop:h,accept:a,maxFiles:c,multiple:o,validator:d});r.useEffect(()=>{f.length>0&&n&&n(f)},[f,n]);const y=r.useMemo(()=>{const e=f.length>0;return e&&g(!1),e},[f]);return r.useEffect(()=>{g(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"},s,_()),r.createElement("input",Object.assign({},b())),k?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==p?void 0:p.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(f))};Ee.defaultProps={onHandleUploadFile:void 0,onHandleRejections:void 0,renderError:void 0,selected:!1};const{definePartsStyle:Se,defineMultiStyleConfig:Fe}=f.createMultiStyleConfigHelpers(k.alertAnatomy.keys),Me=f.cssVar("alert-fg"),Pe=f.cssVar("alert-bg"),De=Fe({baseStyle:Se({container:{bg:Pe.reference,px:"4",py:"2",borderRadius:"md"},title:{fontWeight:"400",lineHeight:"18px",marginEnd:"2"},description:{lineHeight:"6"},icon:{color:Me.reference,flexShrink:0,marginEnd:"3",w:"4",h:"4"},action:{"& +.chakra-alert__close":{ml:"3"}},close:{color:Me.reference,w:"4",h:"4"},spinner:{color:Me.reference,flexShrink:0,marginEnd:"3",w:"5",h:"5"}}),variants:{subtle:Se(e=>{const{colorScheme:t}=e,r=function(e){const{theme:t,colorScheme:r}=e;return{light:`colors.${r}.50`,dark:y.transparentize(r+".200",.16)(t)}}(e);return{container:{[Me.variable]:`colors.${t}.700`,[Pe.variable]:r.light,_dark:{[Me.variable]:`colors.${t}.200`,[Pe.variable]:r.dark},color:Me.reference}}}),solid:Se(e=>{const{colorScheme:t}=e;return{container:{[Me.variable]:"colors.white.high",[Pe.variable]:`colors.${t}.500`,_dark:{[Me.variable]:"colors.gray.900",[Pe.variable]:`colors.${t}.200`},color:Me.reference}}})},defaultProps:{variant:"subtle",colorScheme:"info"}}),Be=f.defineStyleConfig({baseStyle:{fontSize:"body.1",fontWeight:"normal",px:4,py:2.5,borderRadius:"md",_disabled:{opacity:1,bg:"neutral.300",color:"black.low"},_hover:{_disabled:{bg:"neutral.300",color:"black.low"}}},sizes:{lg:e=>{const{variant:t}=e;return"icon"===t?{h:10,w:10,p:0}:{fontSize:"text.xl",h:12,px:4,py:2.5}},md:e=>{const{variant:t}=e;return"icon"===t?{h:9,w:9,p:0}:{fontSize:"text.md",h:9,px:3,py:"7px"}},sm:e=>{const{variant:t}=e;return"icon"===t?{h:"26px",w:"26px",p:0}:{fontSize:"text.sm",h:"26px",lineHeight:4,px:2,py:"5px"}}},variants:{primary:e=>{const{isLoading:t}=e;return t?{_disabled:{bg:"primary.500"},_hover:{_disabled:{bg:"primary.500"}}}:{color:"white.high",bg:"primary.500",_hover:{bg:"primary.600"},_active:{bg:"primary.700"}}},secondary:e=>{const{isLoading:t}=e,r={color:"primary.500",borderWidth:1,borderStyle:"inside",bg:"white.high",borderColor:"primary.500",_hover:{bg:"primary.50"},_active:{bg:"primary.100"},_disabled:{border:0}},n={...r,_disabled:{bg:"white.high"},_hover:{_disabled:{bg:"white.high"}}};return t?n:r},tertiary:e=>{const{isLoading:t}=e,r={color:"primary.500",_hover:{bg:"primary.50"},_active:{bg:"primary.100"}},n={...r,_disabled:{bg:"transparent"},_hover:{_disabled:{bg:"transparent"}}};return t?n:r},danger:e=>{const{isLoading:t}=e,r={bg:"danger.500",color:"white.high",_hover:{bg:"danger.600"},_active:{bg:"danger.700"}},n={...r,_disabled:{bg:"danger.500"},_hover:{_disabled:{bg:"danger.500"}}};return t?n:r},"outline-danger":e=>{const{isLoading:t}=e,r={color:"danger.500",borderWidth:1,borderStyle:"inside",bg:"white.high",borderColor:"danger.500",_hover:{bg:"danger.50"},_active:{bg:"danger.100"},_disabled:{border:0}},n={...r,_disabled:{bg:"white.high"},_hover:{_disabled:{bg:"white.high"}}};return t?n:r},link:{bg:"transparent",color:"primary.500",_disabled:{opacity:"1",bg:"transparent",color:"black.medium"},_hover:{_disabled:{bg:"transparent",color:"black.medium"}}},icon:{bg:"neutral.50",minW:0,borderColor:"neutral.200",borderWidth:"1px",_active:{bg:"neutral.500",borderColor:"neutral.50"},_disabled:{bg:"neutral.500",opacity:.3,borderColor:"neutral.50"},_hover:{bg:"neutral.400",_disabled:{bg:"neutral.500",opacity:.3,borderColor:"neutral.50"}}}},defaultProps:{size:"md",variant:"primary",colorScheme:"primary"}}),Te=f.defineStyleConfig({baseStyle:e=>({shadow:e.withShadow?"raised":"none",borderRadius:e.isRounded?"lg":"none"})}),{definePartsStyle:ze,defineMultiStyleConfig:je}=t.createMultiStyleConfigHelpers(k.checkboxAnatomy.keys),Re=je({baseStyle:ze({control:{borderRadius:"4px",width:"16px",height:"16px",border:"1px solid"},icon:{color:"neutral.50",width:"9px"},label:{fontWeight:"400",lineHeight:"18px",color:"black.high",ml:"8px"},_disabled:{background:"neutral.500",border:"1px solid",borderColor:"neutral.500",cursor:"not-allowed"}}),variants:{errors:ze({control:{borderColor:"danger.500",_checked:{borderColor:"danger.500",backgroundColor:"danger.500",_hover:{borderColor:"danger.600",backgroundColor:"danger.600"}},_indeterminate:{borderColor:"danger.500",backgroundColor:"danger.500"}},label:{fontSize:"12px"}}),unstyled:ze({control:{borderColor:"neutral.500",_checked:{borderColor:"primary.500",backgroundColor:"primary.500",_hover:{borderColor:"primary.600",backgroundColor:"primary.600"},_disabled:{backgroundColor:"neutral.500",borderColor:"neutral.500"}},_disabled:{backgroundColor:"neutral.500",borderColor:"neutral.500"},_indeterminate:{borderColor:"primary.500",backgroundColor:"primary.500"}},label:{fontSize:"12px"}})},defaultProps:{variant:"unstyled"}}),Ae=f.defineStyleConfig({baseStyle:e=>{const{isDisabled:t,isActive:r}=e;let n={color:"primary.500",fontSize:"text.small",borderRadius:"24px",borderWidth:"1px",borderColor:"primary.500",bg:"white.high",paddingX:3,paddingY:1,cursor:"default"};if(r){const e={bg:"primary.500",color:"white.high"};n={...n,...e}}if(t){const e={bg:"neutral.200",color:"black.low",borderColor:"neutral.200",cursor:"not-allowed"};n={...n,...e}}return{...n}},sizes:{sm:{fontSize:"12px"},md:{fontSize:"14px"}},defaultProps:{size:"sm"}}),Oe=f.defineStyleConfig({baseStyle:f.defineStyle({fontSize:"field.sm",marginEnd:1,mb:1})}),{definePartsStyle:He,defineMultiStyleConfig:Ie}=f.createMultiStyleConfigHelpers(k.inputAnatomy.keys),qe=He({field:{width:"100%",minWidth:0,outline:0,px:2,py:2.5,paddingInlineStart:2,paddingInlineEnd:2,position:"relative",appearance:"none",color:"black.high",_disabled:{bg:"neutral.300",border:0,cursor:"not-allowed",opacity:1,boxShadow:"none",color:"black.medium"},_placeholder:{color:"black.low"}}}),We={lg:f.defineStyle({fontSize:"text.lg",h:12,borderRadius:"md"}),md:f.defineStyle({fontSize:"text.md",h:10,borderRadius:"md"}),sm:f.defineStyle({fontSize:"text.sm",h:9.5,borderRadius:"md"})},Ve=Ie({baseStyle:qe,sizes:{lg:He({field:We.lg,addon:We.lg}),md:He({field:We.md,addon:We.md}),sm:He({field:We.sm,addon:We.sm})},variants:{outline:He(e=>({field:{border:0,outline:0,bg:y.mode("white","inherit")(e),color:y.mode("inherit","white")(e),_invalid:{boxShadow:"none"},_focusVisible:{zIndex:1,boxShadow:"none"}}})),unstyled:He({field:{bg:"transparent",px:"0",height:"auto"},addon:{bg:"transparent",px:"0",height:"auto"}})},defaultProps:{size:"sm",variant:"outline"}}),Le=i.keyframes({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),$e=e=>"primary"===e?A.primary[600]:"danger"===e?A.danger[500]:A.white.high,Ne=f.defineStyleConfig({baseStyle:e=>{const t=$e(e.color);return{borderRadius:"50%",display:"flex",justifyContent:"center",alignItems:"center",animation:Le+" 1s linear infinite",background:`conic-gradient(from 180deg at 50% 50%, ${t} 0deg, rgba(217, 217, 217, 0) 360deg);`,":before":{content:"''",display:"block",borderRadius:"50%",width:"6px",height:"6px",position:"absolute",bottom:0,background:t}}},sizes:{xs:{width:"12px",height:"12px",WebkitMask:"radial-gradient(farthest-side,#0000 calc(100% - 1.4px),#000 0);",":before":{width:"1.4px",height:"1.4px"}},sm:{width:"16px",height:"16px",WebkitMask:"radial-gradient(farthest-side,#0000 calc(100% - 1.87px),#000 0);",":before":{width:"1.87px",height:"1.87px"}},md:{width:"24px",height:"24px",WebkitMask:"radial-gradient(farthest-side,#0000 calc(100% - 2.8px),#000 0);",":before":{width:"2.8px",height:"2.8px"}},lg:{width:"50px",height:"50px",WebkitMask:"radial-gradient(farthest-side,#0000 calc(100% - 5.83px),#000 0);",":before":{width:"5.83px",height:"5.83px"}},xl:{width:"75px",height:"75px",WebkitMask:"radial-gradient(farthest-side,#0000 calc(100% - 8.75px),#000 0);",":before":{width:"8.75px",height:"8.75px"}},xxl:{width:"100px",height:"100px",WebkitMask:"radial-gradient(farthest-side,#0000 calc(100% - 11.67px),#000 0);",":before":{width:"11.67px",height:"11.67px"}}},defaultProps:{size:"lg"}}),{definePartsStyle:Ge}=f.createMultiStyleConfigHelpers(k.popoverAnatomy.keys),Ue={baseStyle:e=>Ge({popper:{background:y.mode("white","inherit")(e)}})},{definePartsStyle:Xe,defineMultiStyleConfig:Ze}=t.createMultiStyleConfigHelpers(k.radioAnatomy.keys),Ye=Ze({baseStyle:Xe({control:{border:"1px solid",width:"16px",height:"16px"},label:{marginLeft:"8px",textStyle:"text.sm",color:"black.high",_disabled:{color:"black.low"}}}),variants:{errors:Xe({control:{borderColor:"danger.500",_checked:{borderColor:"danger.500",bg:"white",_before:{h:"10px",w:"10px",bg:"danger.500"},_hover:{borderColor:"danger.500",bg:"gray.200"},_disabled:{borderColor:"danger.500",bg:"white",_before:{h:"10px",w:"10px",bg:"neutral.500"}}},_disabled:{borderColor:"danger.500",bg:"neutral.500"}},label:{fontSize:"12px"}}),unstyled:Xe({control:{borderColor:"neutral.600",_checked:{borderColor:"primary.500",bg:"white",_before:{h:"10px",w:"10px",bg:"primary.500"},_hover:{borderColor:"primary.500",bg:"gray.200"},_disabled:{borderColor:"neutral.500",bg:"white",_before:{h:"10px",w:"10px",bg:"neutral.500"}}},_disabled:{borderColor:"neutral.500",bg:"neutral.500"}},label:{fontSize:"12px"}})},defaultProps:{variant:"unstyled"}}),{defineMultiStyleConfig:Ke,definePartsStyle:Qe}=f.createMultiStyleConfigHelpers(k.switchAnatomy.keys),Je=y.cssVar("switch-track-width"),et=y.cssVar("switch-track-height"),tt=y.cssVar("switch-track-diff"),rt=y.calc.subtract(Je,et),nt=y.cssVar("switch-thumb-x"),at=f.defineStyle({bg:"white",transitionProperty:"transform",transitionDuration:"normal",borderRadius:"inherit",width:[et.reference],height:[et.reference],_checked:{transform:`translateX(${nt.reference})`}});var ot={__proto__:null,Alert:De,Button:Be,Card:Te,Checkbox:Re,Chips:Ae,FormLabel:Oe,Input:Ve,LoaderStyle:Ne,Popover:Ue,Radio:Ye,Switch:Ke({baseStyle:Qe(()=>({container:{[tt.variable]:rt,[nt.variable]:tt.reference,_rtl:{[nt.variable]:y.calc(tt).negate().toString()}},track:{bg:"neutral.400",p:1,_checked:{bg:"primary.500",_disabled:{bg:"neutral.600"}},_disabled:{bg:"neutral.500",opacity:"100%"}},thumb:at})),sizes:{sm:Qe({container:{[Je.variable]:"2.125rem",[et.variable]:"1.063rem"}}),md:Qe({container:{[Je.variable]:"2.875rem",[et.variable]:"1.5rem"}}),lg:Qe({container:{[Je.variable]:"3.625rem",[et.variable]:"1.813rem"}})},defaultProps:{size:"md"}}),Textarea:t.defineStyleConfig({variants:{outline:t.defineStyle(e=>{const{focusBorderColor:t,borderColor:r}=(e=>{const{isError:t,isSuccess:r,isDisabled:n}=e;let a="neutral.400",o="primary.500";return t?(a="danger.500",o="danger.500"):r?(a="success.500",o="success.500"):!n||t||r||(a="neutral.400",o="danger.500"),{focusBorderColor:o,borderColor:a}})(e);return{background:"white.high",color:"black.high",borderColor:r,fontSize:"text.sm",padding:2,borderRadius:"md",borderWidth:"1px",outline:"none",_disabled:{opacity:1,color:"black.medium",background:"neutral.300"},_placeholder:{color:"black.low"},_hover:{borderColor:r},_focus:{outline:"none",borderColor:t,boxShadow:"none"},_focusVisible:{outline:"none",borderColor:t,boxShadow:"none"},_focusWithin:{outline:"none",borderColor:t,boxShadow:"none"},_invalid:{outline:"none",borderColor:"danger.500",boxShadow:"none"}}})},defaultProps:{variant:"outline"}})};const it=t.extendTheme({...$,components:{...ot},styles:{global:{"*::-webkit-scrollbar-thumb":{background:"neutral.400"},body:{fontSize:"text.sm",color:"black.high"}}},config:{initialColorMode:"light",useSystemColorMode:!1}}),ct=r.createContext({instance:void 0}),lt=({children:e,config:t,requestInterceptors:a,responseInterceptors:o})=>{const i=r.useRef(v.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(ct.Provider,{value:c},e)};lt.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.Badge=w,exports.Box=t.Box,exports.BreadCrumb=C,exports.Button=e=>{const{children:r,variant:a,size:o,...i}=e;return n.createElement(t.Button,Object.assign({size:o,variant:a,spinner:n.createElement(E,{size:"lg"===o?"md":"md"===o?"sm":"xs",color:"primary"===a||"danger"===a?"white":"outline-danger"===a?"danger":"primary"})},i),r)},exports.Card=S,exports.Checkbox=F,exports.CheckboxGroup=P,exports.Container=t.Container,exports.DataTable=B,exports.DatePickerMonth=R,exports.Datepicker=j,exports.Field=M,exports.Flex=t.Flex,exports.Grid=t.Grid,exports.Header=ne,exports.InputField=Z,exports.Loader=E,exports.MainMenu=de,exports.ModalBody=ae,exports.ModalCloseButton=oe,exports.ModalFooter=ie,exports.ModalHeader=ce,exports.MultiDatePickerMonth=G,exports.Pagination=me,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=ue,exports.Provider=lt,exports.ProviderContext=ct,exports.Radio=ge,exports.RadioGroup=he,exports.Select=function({isError:e=!1,...t}){const{colorMode:r}=s.useColorMode();return n.createElement(_e,{isError:e},n.createElement(u,Object.assign({classNamePrefix:"react-select"},t,{styles:{...ke(r)},theme:fe})))},exports.SelectAsync=function({styles:e,isError:t=!1,...r}){const{colorMode:a}=s.useColorMode();return n.createElement(_e,{isError:t},n.createElement(g.AsyncPaginate,Object.assign({classNamePrefix:"react-select"},r,{styles:{...ke(a),...e},theme:fe})))},exports.SelectAsyncCreatable=function({styles:e,isError:t=!1,...r}){const{colorMode:a}=s.useColorMode();return n.createElement(_e,{isError:t},n.createElement(h,Object.assign({classNamePrefix:"react-select"},r,{styles:{...ke(a),...e},theme:fe})))},exports.SelectCreatable=function({styles:e,isError:t=!1,...r}){const{colorMode:a}=s.useColorMode();return n.createElement(_e,{isError:t},n.createElement(_,Object.assign({classNamePrefix:"react-select"},r,{styles:{...ke(a),...e},theme:fe})))},exports.Stack=t.Stack,exports.Switch=ye,exports.Tab=ve,exports.TabList=we,exports.TabPanel=Ce,exports.Text=t.Text,exports.TextareaField=Y,exports.Uploader=Ee,exports.Wrap=t.Wrap,exports.foundations=$,exports.theme=it,exports.useInternalUI=()=>{const{instance:e}=r.useContext(ct);return{instance:e}};
|
45
|
+
`},e);_e.defaultProps={isError:!1};const be=L.text.sm,xe={fontSize:be.fontSize,lineHeight:be.lineHeight,letterSpacing:0};function ke(e,t){return{control:(t,r)=>"dark"===e?{...t,...xe,background:"transparent",color:A.primary[300],borderColor:A.secondary[500],boxShadow:r.isFocused?"none":"inherit"}:{...t,...xe,boxShadow:r.isFocused?"none":A.neutral[500]},option:(t,{isSelected:r})=>"dark"===e?{...t,...xe,background:r?A.primary[700]:A.dark[800],color:"white"}:{...t,...xe},menu:t=>"dark"===e?{...t,...xe,background:A.dark[800],zIndex:5}:{...t,...xe,zIndex:5},singleValue:t=>"dark"===e?{...t,...xe,color:"white"}:{...t,...xe},input:t=>"dark"===e?{...t,...xe,color:"white"}:{...t,...xe},dropdownIndicator:t=>"dark"===e?{...t,...xe,color:A.secondary[500]}:{...t,...xe},indicatorSeparator:t=>"dark"===e?{...t,...xe,backgroundColor:A.secondary[500]}:{...t,...xe}}}const fe=e=>({...e,colors:{...e.colors,primary:A.primary[500],primary25:A.primary[50],primary50:A.primary[100],primary75:A.primary[200]}}),ye=t.forwardRef((function(e,a){const o=t.useMultiStyleConfig("Switch",e),{size:i="md"}=e,{spacing:c="0.5rem",children:l,...d}=t.omitThemingProps(e),{state:s,getInputProps:p,getCheckboxProps:u,getRootProps:g,getLabelProps:h}=t.useCheckbox(d),_=r.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"middle",lineHeight:0,...o.container}),[o.container]),x=r.useMemo(()=>({display:"inline-flex",flexShrink:0,justifyContent:"flex-start",boxSizing:"content-box",cursor:"pointer",width:200,...o.track}),[o.track]),k=r.useMemo(()=>({userSelect:"none",marginStart:c,...o.label}),[c,o.label]),f=e=>({sm:3,md:4,lg:5}[e]);return n.createElement(t.chakra.label,Object.assign({},g(),{display:"flex",alignItems:"center",className:b.cx("chakra-switch",e.className),__css:_}),n.createElement("input",Object.assign({"data-test-id":"",className:"chakra-switch__input"},p({},a))),n.createElement(t.chakra.span,Object.assign({},u(),{className:"chakra-switch__track",pos:"relative",__css:x}),n.createElement(t.Flex,{gap:2,pos:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"},n.createElement(m.Check,{color:"white",size:f(i)}),n.createElement(m.Close,{color:s.isDisabled?"neutral.600":"neutral.900",size:f(i)})),n.createElement(t.chakra.span,{__css:o.thumb,className:"chakra-switch__thumb","data-checked":b.dataAttr(s.isChecked),"data-hover":b.dataAttr(s.isHovered)})),l&&n.createElement(t.chakra.span,Object.assign({className:"chakra-switch__label",color:s.isDisabled?"black.low":"black.high"},h(),{__css:k}),l))})),ve=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})))}),we=t.forwardRef((e,r)=>n.createElement(t.TabList,{borderBottom:"1px solid",borderColor:t.useColorModeValue("gray.200","bright-gray.800"),ref:r},e.children)),Ce=t.forwardRef((e,r)=>n.createElement(t.TabPanel,{px:0,ref:r},e.children)),Ee=({onHandleUploadFile:e,onHandleRejections:n,accept:a,multiple:o,selected:i,maxFiles:c=1,renderError:l,validator:d,...s})=>{const[p,m]=r.useState(),[u,g]=r.useState(i||!1),h=r.useCallback(t=>{t.length>0&&(null==e||e(t),o||(g(!0),m(t[0])))},[o,e]),{getRootProps:_,getInputProps:b,isDragActive:k,fileRejections:f}=x.useDropzone({onDrop:h,accept:a,maxFiles:c,multiple:o,validator:d});r.useEffect(()=>{f.length>0&&n&&n(f)},[f,n]);const y=r.useMemo(()=>{const e=f.length>0;return e&&g(!1),e},[f]);return r.useEffect(()=>{g(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"},s,_()),r.createElement("input",Object.assign({},b())),k?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==p?void 0:p.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(f))};Ee.defaultProps={onHandleUploadFile:void 0,onHandleRejections:void 0,renderError:void 0,selected:!1};const{definePartsStyle:Se,defineMultiStyleConfig:Fe}=f.createMultiStyleConfigHelpers(k.alertAnatomy.keys),Me=f.cssVar("alert-fg"),Pe=f.cssVar("alert-bg"),De=Fe({baseStyle:Se({container:{bg:Pe.reference,px:"4",py:"2",borderRadius:"md"},title:{fontWeight:"400",lineHeight:"18px",marginEnd:"2"},description:{lineHeight:"6"},icon:{color:Me.reference,flexShrink:0,marginEnd:"3",w:"4",h:"4"},action:{"& +.chakra-alert__close":{ml:"3"}},close:{color:Me.reference,w:"4",h:"4"},spinner:{color:Me.reference,flexShrink:0,marginEnd:"3",w:"5",h:"5"}}),variants:{subtle:Se(e=>{const{colorScheme:t}=e,r=function(e){const{theme:t,colorScheme:r}=e;return{light:`colors.${r}.50`,dark:y.transparentize(r+".200",.16)(t)}}(e);return{container:{[Me.variable]:`colors.${t}.700`,[Pe.variable]:r.light,_dark:{[Me.variable]:`colors.${t}.200`,[Pe.variable]:r.dark},color:Me.reference}}}),solid:Se(e=>{const{colorScheme:t}=e;return{container:{[Me.variable]:"colors.white.high",[Pe.variable]:`colors.${t}.500`,_dark:{[Me.variable]:"colors.gray.900",[Pe.variable]:`colors.${t}.200`},color:Me.reference}}})},defaultProps:{variant:"subtle",colorScheme:"info"}}),Be=f.defineStyleConfig({baseStyle:{fontSize:"body.1",fontWeight:"normal",px:4,py:2.5,borderRadius:"md",_disabled:{opacity:1,bg:"neutral.300",color:"black.low"},_hover:{_disabled:{bg:"neutral.300",color:"black.low"}}},sizes:{lg:e=>{const{variant:t}=e;return"icon"===t?{h:10,w:10,p:0}:{fontSize:"text.xl",h:12,px:4,py:2.5}},md:e=>{const{variant:t}=e;return"icon"===t?{h:9,w:9,p:0}:{fontSize:"text.md",h:9,px:3,py:"7px"}},sm:e=>{const{variant:t}=e;return"icon"===t?{h:"26px",w:"26px",p:0}:{fontSize:"text.sm",h:"26px",lineHeight:4,px:2,py:"5px"}}},variants:{primary:e=>{const{isLoading:t}=e;return t?{_disabled:{bg:"primary.500"},_hover:{_disabled:{bg:"primary.500"}}}:{color:"white.high",bg:"primary.500",_hover:{bg:"primary.600"},_active:{bg:"primary.700"}}},secondary:e=>{const{isLoading:t}=e,r={color:"primary.500",borderWidth:1,borderStyle:"inside",bg:"white.high",borderColor:"primary.500",_hover:{bg:"primary.50"},_active:{bg:"primary.100"},_disabled:{border:0}},n={...r,_disabled:{bg:"white.high"},_hover:{_disabled:{bg:"white.high"}}};return t?n:r},tertiary:e=>{const{isLoading:t}=e,r={color:"primary.500",_hover:{bg:"primary.50"},_active:{bg:"primary.100"}},n={...r,_disabled:{bg:"transparent"},_hover:{_disabled:{bg:"transparent"}}};return t?n:r},danger:e=>{const{isLoading:t}=e,r={bg:"danger.500",color:"white.high",_hover:{bg:"danger.600"},_active:{bg:"danger.700"}},n={...r,_disabled:{bg:"danger.500"},_hover:{_disabled:{bg:"danger.500"}}};return t?n:r},"outline-danger":e=>{const{isLoading:t}=e,r={color:"danger.500",borderWidth:1,borderStyle:"inside",bg:"white.high",borderColor:"danger.500",_hover:{bg:"danger.50"},_active:{bg:"danger.100"},_disabled:{border:0}},n={...r,_disabled:{bg:"white.high"},_hover:{_disabled:{bg:"white.high"}}};return t?n:r},link:{bg:"transparent",color:"primary.500",_disabled:{opacity:"1",bg:"transparent",color:"black.medium"},_hover:{_disabled:{bg:"transparent",color:"black.medium"}}},icon:{bg:"neutral.50",minW:0,borderColor:"neutral.200",borderWidth:"1px",_active:{bg:"neutral.500",borderColor:"neutral.50"},_disabled:{bg:"neutral.500",opacity:.3,borderColor:"neutral.50"},_hover:{bg:"neutral.400",_disabled:{bg:"neutral.500",opacity:.3,borderColor:"neutral.50"}}}},defaultProps:{size:"md",variant:"primary",colorScheme:"primary"}}),Te=f.defineStyleConfig({baseStyle:e=>({shadow:e.withShadow?"raised":"none",borderRadius:e.isRounded?"lg":"none"})}),{definePartsStyle:ze,defineMultiStyleConfig:je}=t.createMultiStyleConfigHelpers(k.checkboxAnatomy.keys),Re=je({baseStyle:ze({control:{borderRadius:"4px",width:"16px",height:"16px",border:"1px solid"},icon:{color:"neutral.50",width:"9px"},label:{fontWeight:"400",lineHeight:"18px",color:"black.high",ml:"8px"},_disabled:{background:"neutral.500",border:"1px solid",borderColor:"neutral.500",cursor:"not-allowed"}}),variants:{errors:ze({control:{borderColor:"danger.500",_checked:{borderColor:"danger.500",backgroundColor:"danger.500",_hover:{borderColor:"danger.600",backgroundColor:"danger.600"}},_indeterminate:{borderColor:"danger.500",backgroundColor:"danger.500"}},label:{fontSize:"12px"}}),unstyled:ze({control:{borderColor:"neutral.500",_checked:{borderColor:"primary.500",backgroundColor:"primary.500",_hover:{borderColor:"primary.600",backgroundColor:"primary.600"},_disabled:{backgroundColor:"neutral.500",borderColor:"neutral.500"}},_disabled:{backgroundColor:"neutral.500",borderColor:"neutral.500"},_indeterminate:{borderColor:"primary.500",backgroundColor:"primary.500"}},label:{fontSize:"12px"}})},defaultProps:{variant:"unstyled"}}),Ae=f.defineStyleConfig({baseStyle:e=>{const{isDisabled:t,isActive:r}=e;let n={color:"primary.500",fontSize:"text.small",borderRadius:"24px",borderWidth:"1px",borderColor:"primary.500",bg:"white.high",paddingX:3,paddingY:1,cursor:"default"};if(r){const e={bg:"primary.500",color:"white.high"};n={...n,...e}}if(t){const e={bg:"neutral.200",color:"black.low",borderColor:"neutral.200",cursor:"not-allowed"};n={...n,...e}}return{...n}},sizes:{sm:{fontSize:"12px"},md:{fontSize:"14px"}},defaultProps:{size:"sm"}}),Oe=f.defineStyleConfig({baseStyle:f.defineStyle({fontSize:"field.sm",marginEnd:1,mb:1})}),{definePartsStyle:He,defineMultiStyleConfig:Ie}=f.createMultiStyleConfigHelpers(k.inputAnatomy.keys),qe=He({field:{width:"100%",minWidth:0,outline:0,px:2,py:2.5,paddingInlineStart:2,paddingInlineEnd:2,position:"relative",appearance:"none",color:"black.high",_disabled:{bg:"neutral.300",border:0,cursor:"not-allowed",opacity:1,boxShadow:"none",color:"black.medium"},_placeholder:{color:"black.low"}}}),We={lg:f.defineStyle({fontSize:"text.lg",h:12,borderRadius:"md"}),md:f.defineStyle({fontSize:"text.md",h:10,borderRadius:"md"}),sm:f.defineStyle({fontSize:"text.sm",h:9.5,borderRadius:"md"})},Ve=Ie({baseStyle:qe,sizes:{lg:He({field:We.lg,addon:We.lg}),md:He({field:We.md,addon:We.md}),sm:He({field:We.sm,addon:We.sm})},variants:{outline:He(e=>({field:{border:0,outline:0,bg:y.mode("white","inherit")(e),color:y.mode("inherit","white")(e),_invalid:{boxShadow:"none"},_focusVisible:{zIndex:1,boxShadow:"none"}}})),unstyled:He({field:{bg:"transparent",px:"0",height:"auto"},addon:{bg:"transparent",px:"0",height:"auto"}})},defaultProps:{size:"sm",variant:"outline"}}),Le=i.keyframes({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),$e=e=>"primary"===e?A.primary[600]:"danger"===e?A.danger[500]:A.white.high,Ne=f.defineStyleConfig({baseStyle:e=>{const t=$e(e.color);return{borderRadius:"50%",display:"flex",justifyContent:"center",alignItems:"center",animation:Le+" 1s linear infinite",background:`conic-gradient(from 180deg at 50% 50%, ${t} 0deg, rgba(217, 217, 217, 0) 360deg);`,":before":{content:"''",display:"block",borderRadius:"50%",width:"6px",height:"6px",position:"absolute",bottom:0,background:t}}},sizes:{xs:{width:"12px",height:"12px",WebkitMask:"radial-gradient(farthest-side,#0000 calc(100% - 1.4px),#000 0);",":before":{width:"1.4px",height:"1.4px"}},sm:{width:"16px",height:"16px",WebkitMask:"radial-gradient(farthest-side,#0000 calc(100% - 1.87px),#000 0);",":before":{width:"1.87px",height:"1.87px"}},md:{width:"24px",height:"24px",WebkitMask:"radial-gradient(farthest-side,#0000 calc(100% - 2.8px),#000 0);",":before":{width:"2.8px",height:"2.8px"}},lg:{width:"50px",height:"50px",WebkitMask:"radial-gradient(farthest-side,#0000 calc(100% - 5.83px),#000 0);",":before":{width:"5.83px",height:"5.83px"}},xl:{width:"75px",height:"75px",WebkitMask:"radial-gradient(farthest-side,#0000 calc(100% - 8.75px),#000 0);",":before":{width:"8.75px",height:"8.75px"}},xxl:{width:"100px",height:"100px",WebkitMask:"radial-gradient(farthest-side,#0000 calc(100% - 11.67px),#000 0);",":before":{width:"11.67px",height:"11.67px"}}},defaultProps:{size:"lg"}}),{definePartsStyle:Ge}=f.createMultiStyleConfigHelpers(k.popoverAnatomy.keys),Ue={baseStyle:e=>Ge({popper:{background:y.mode("white","inherit")(e)}})},{definePartsStyle:Xe,defineMultiStyleConfig:Ze}=t.createMultiStyleConfigHelpers(k.radioAnatomy.keys),Ye=Ze({baseStyle:Xe({control:{border:"1px solid",width:"16px",height:"16px"},label:{marginLeft:"8px",textStyle:"text.sm",color:"black.high",_disabled:{color:"black.low"}}}),variants:{errors:Xe({control:{borderColor:"danger.500",_checked:{borderColor:"danger.500",bg:"white",_before:{h:"10px",w:"10px",bg:"danger.500"},_hover:{borderColor:"danger.500",bg:"gray.200"},_disabled:{borderColor:"danger.500",bg:"white",_before:{h:"10px",w:"10px",bg:"neutral.500"}}},_disabled:{borderColor:"danger.500",bg:"neutral.500"}},label:{fontSize:"12px"}}),unstyled:Xe({control:{borderColor:"neutral.600",_checked:{borderColor:"primary.500",bg:"white",_before:{h:"10px",w:"10px",bg:"primary.500"},_hover:{borderColor:"primary.500",bg:"gray.200"},_disabled:{borderColor:"neutral.500",bg:"white",_before:{h:"10px",w:"10px",bg:"neutral.500"}}},_disabled:{borderColor:"neutral.500",bg:"neutral.500"}},label:{fontSize:"12px"}})},defaultProps:{variant:"unstyled"}}),{defineMultiStyleConfig:Ke,definePartsStyle:Qe}=f.createMultiStyleConfigHelpers(k.switchAnatomy.keys),Je=y.cssVar("switch-track-width"),et=y.cssVar("switch-track-height"),tt=y.cssVar("switch-track-diff"),rt=y.calc.subtract(Je,et),nt=y.cssVar("switch-thumb-x"),at=f.defineStyle({bg:"white",transitionProperty:"transform",transitionDuration:"normal",borderRadius:"inherit",width:[et.reference],height:[et.reference],_checked:{transform:`translateX(${nt.reference})`}});var ot={__proto__:null,Alert:De,Badge:{baseStyle:{display:"inline-block",fontSize:10,fontWeight:600,lineHeight:"1.25",textTransform:"none",px:2,py:"0.5"},variants:{"primary-solid":{bg:"primary.500",color:"white"},"success-solid":{bg:"success.500",color:"white"},"info-solid":{bg:"info.500",color:"white"},"warning-solid":{bg:"warning.500",color:"white"},"danger-solid":{bg:"danger.500",color:"white"},"neutral-solid":{bg:"neutral.600",color:"white"},"primary-light":{bg:"primary.50",color:"primary.500"},"success-light":{bg:"success.50",color:"success.500"},"info-light":{bg:"info.50",color:"info.500"},"warning-light":{bg:"warning.50",color:"warning.500"},"danger-light":{bg:"danger.50",color:"danger.500"},"neutral-light":{bg:"neutral.100",color:"neutral.600"}},defaultProps:{variant:"primary-solid"}},Button:Be,Card:Te,Checkbox:Re,Chips:Ae,FormLabel:Oe,Input:Ve,LoaderStyle:Ne,Popover:Ue,Radio:Ye,Switch:Ke({baseStyle:Qe(()=>({container:{[tt.variable]:rt,[nt.variable]:tt.reference,_rtl:{[nt.variable]:y.calc(tt).negate().toString()}},track:{bg:"neutral.400",p:1,_checked:{bg:"primary.500",_disabled:{bg:"neutral.600"}},_disabled:{bg:"neutral.500",opacity:"100%"}},thumb:at})),sizes:{sm:Qe({container:{[Je.variable]:"2.125rem",[et.variable]:"1.063rem"}}),md:Qe({container:{[Je.variable]:"2.875rem",[et.variable]:"1.5rem"}}),lg:Qe({container:{[Je.variable]:"3.625rem",[et.variable]:"1.813rem"}})},defaultProps:{size:"md"}}),Textarea:t.defineStyleConfig({variants:{outline:t.defineStyle(e=>{const{focusBorderColor:t,borderColor:r}=(e=>{const{isError:t,isSuccess:r,isDisabled:n}=e;let a="neutral.400",o="primary.500";return t?(a="danger.500",o="danger.500"):r?(a="success.500",o="success.500"):!n||t||r||(a="neutral.400",o="danger.500"),{focusBorderColor:o,borderColor:a}})(e);return{background:"white.high",color:"black.high",borderColor:r,fontSize:"text.sm",padding:2,borderRadius:"md",borderWidth:"1px",outline:"none",_disabled:{opacity:1,color:"black.medium",background:"neutral.300"},_placeholder:{color:"black.low"},_hover:{borderColor:r},_focus:{outline:"none",borderColor:t,boxShadow:"none"},_focusVisible:{outline:"none",borderColor:t,boxShadow:"none"},_focusWithin:{outline:"none",borderColor:t,boxShadow:"none"},_invalid:{outline:"none",borderColor:"danger.500",boxShadow:"none"}}})},defaultProps:{variant:"outline"}})};const it=t.extendTheme({...$,components:{...ot},styles:{global:{"*::-webkit-scrollbar-thumb":{background:"neutral.400"},body:{fontSize:"text.sm",color:"black.high"}}},config:{initialColorMode:"light",useSystemColorMode:!1}}),ct=r.createContext({instance:void 0}),lt=({children:e,config:t,requestInterceptors:a,responseInterceptors:o})=>{const i=r.useRef(v.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(ct.Provider,{value:c},e)};lt.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.Badge=w,exports.Box=t.Box,exports.BreadCrumb=C,exports.Button=e=>{const{children:r,variant:a,size:o,...i}=e;return n.createElement(t.Button,Object.assign({size:o,variant:a,spinner:n.createElement(E,{size:"lg"===o?"md":"md"===o?"sm":"xs",color:"primary"===a||"danger"===a?"white":"outline-danger"===a?"danger":"primary"})},i),r)},exports.Card=S,exports.Checkbox=F,exports.CheckboxGroup=P,exports.Container=t.Container,exports.DataTable=B,exports.DatePickerMonth=R,exports.Datepicker=j,exports.Field=M,exports.Flex=t.Flex,exports.Grid=t.Grid,exports.Header=ne,exports.InputField=Z,exports.Loader=E,exports.MainMenu=de,exports.ModalBody=ae,exports.ModalCloseButton=oe,exports.ModalFooter=ie,exports.ModalHeader=ce,exports.MultiDatePickerMonth=G,exports.Pagination=me,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=ue,exports.Provider=lt,exports.ProviderContext=ct,exports.Radio=ge,exports.RadioGroup=he,exports.Select=function({isError:e=!1,...t}){const{colorMode:r}=s.useColorMode();return n.createElement(_e,{isError:e},n.createElement(u,Object.assign({classNamePrefix:"react-select"},t,{styles:{...ke(r)},theme:fe})))},exports.SelectAsync=function({styles:e,isError:t=!1,...r}){const{colorMode:a}=s.useColorMode();return n.createElement(_e,{isError:t},n.createElement(g.AsyncPaginate,Object.assign({classNamePrefix:"react-select"},r,{styles:{...ke(a),...e},theme:fe})))},exports.SelectAsyncCreatable=function({styles:e,isError:t=!1,...r}){const{colorMode:a}=s.useColorMode();return n.createElement(_e,{isError:t},n.createElement(h,Object.assign({classNamePrefix:"react-select"},r,{styles:{...ke(a),...e},theme:fe})))},exports.SelectCreatable=function({styles:e,isError:t=!1,...r}){const{colorMode:a}=s.useColorMode();return n.createElement(_e,{isError:t},n.createElement(_,Object.assign({classNamePrefix:"react-select"},r,{styles:{...ke(a),...e},theme:fe})))},exports.Stack=t.Stack,exports.Switch=ye,exports.Tab=ve,exports.TabList=we,exports.TabPanel=Ce,exports.Text=t.Text,exports.TextareaField=Y,exports.Uploader=Ee,exports.Wrap=t.Wrap,exports.foundations=$,exports.theme=it,exports.useInternalUI=()=>{const{instance:e}=r.useContext(ct);return{instance:e}};
|
46
46
|
//# sourceMappingURL=internal-ui.cjs.production.min.js.map
|