@ctlyst.id/internal-ui 2.1.9 → 2.1.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. package/dist/components/{checkbox/__stories__/checkbox-group.stories.d.ts → anchor/__stories__/anchor.stories.d.ts} +2 -3
  2. package/dist/components/anchor/components/anchor.d.ts +20 -0
  3. package/dist/components/anchor/components/index.d.ts +1 -0
  4. package/dist/components/anchor/index.d.ts +1 -0
  5. package/dist/components/badge/components/index.d.ts +1 -0
  6. package/dist/components/badge/index.d.ts +1 -2
  7. package/dist/components/checkbox/__stories__/checkbox.stories.d.ts +4 -0
  8. package/dist/components/checkbox/index.d.ts +1 -0
  9. package/dist/components/{base/__stories__/switch.stories.d.ts → collapse/__stories__/collapse.stories.d.ts} +1 -2
  10. package/dist/components/counter/__stories__/counter.stories.d.ts +10 -0
  11. package/dist/components/counter/components/counter.d.ts +15 -0
  12. package/dist/components/counter/index.d.ts +1 -0
  13. package/dist/components/dialog/__stories__/dialog.stories.d.ts +7 -0
  14. package/dist/components/dialog/components/dialog.d.ts +12 -0
  15. package/dist/components/dialog/index.d.ts +1 -0
  16. package/dist/components/empty-state/__stories__/dialog.stories.d.ts +7 -0
  17. package/dist/components/field/__stories__/field.stories.d.ts +7 -0
  18. package/dist/components/{radio/__stories__/radio-group.stories.d.ts → image/__stories__/image.stories.d.ts} +2 -3
  19. package/dist/components/index.d.ts +5 -0
  20. package/dist/components/layouting/index.d.ts +1 -1
  21. package/dist/components/loader/index.d.ts +1 -1
  22. package/dist/components/radio/__stories__/radio.stories.d.ts +4 -0
  23. package/dist/components/radio/components/radio-group.d.ts +6 -5
  24. package/dist/components/radio/components/radio.d.ts +8 -7
  25. package/dist/components/radio/index.d.ts +1 -2
  26. package/dist/components/tabs/index.d.ts +1 -3
  27. package/dist/components/toast/__stories__/toast.stories.d.ts +0 -1
  28. package/dist/components/toast/components/toast.d.ts +2 -0
  29. package/dist/config/theme/components/index.d.ts +1 -0
  30. package/dist/config/theme/components/tabs.d.ts +30 -0
  31. package/dist/hooks/index.d.ts +1 -1
  32. package/dist/internal-ui.cjs.development.js +748 -233
  33. package/dist/internal-ui.cjs.development.js.map +1 -1
  34. package/dist/internal-ui.cjs.production.min.js +6 -6
  35. package/dist/internal-ui.cjs.production.min.js.map +1 -1
  36. package/dist/internal-ui.esm.js +418 -235
  37. package/dist/internal-ui.esm.js.map +1 -1
  38. package/package.json +2 -2
  39. package/dist/components/tabs/components/tab-list.d.ts +0 -3
  40. package/dist/components/tabs/components/tab-panel.d.ts +0 -3
@@ -1,29 +1,50 @@
1
+ import { useAccordionItemState } from '@chakra-ui/accordion';
2
+ import { Box, forwardRef as forwardRef$1, useStyleConfig, Button as Button$2, Badge as Badge$2, useToken, theme as theme$1, Text, Breadcrumb, BreadcrumbItem, BreadcrumbLink, Card, Checkbox as Checkbox$1, FormControl, FormLabel as FormLabel$1, FormHelperText, FormErrorMessage, CheckboxGroup, Stack, InputLeftAddon, InputRightAddon, defineStyle, InputGroup, Input as Input$1, Textarea as Textarea$1, HStack, IconButton, Flex, Spinner, Table, Thead, Tr, useColorModeValue, Th, Tbody, Td, InputRightElement, Modal, ModalOverlay, ModalContent, ModalHeader as ModalHeader$1, ModalBody as ModalBody$1, ModalFooter as ModalFooter$1, Image, useDisclosure, Popover as Popover$1, VStack, PopoverTrigger, Avatar, PopoverContent, PopoverArrow, PopoverBody, useColorMode as useColorMode$1, ModalCloseButton as ModalCloseButton$1, createIcon, Icon, Portal, Link as Link$1, VisuallyHidden, Select as Select$1, Radio as Radio$2, RadioGroup as RadioGroup$1, Grid, useMultiStyleConfig as useMultiStyleConfig$1, omitThemingProps as omitThemingProps$1, useCheckbox, chakra as chakra$1, useTab, Heading, createMultiStyleConfigHelpers as createMultiStyleConfigHelpers$1, defineStyleConfig as defineStyleConfig$1, extendTheme } from '@chakra-ui/react';
3
+ export { Accordion, AccordionButton, AccordionIcon, AccordionItem, AccordionPanel, AccordionProvider, AlertDialog, ModalBody as AlertDialogBody, ModalCloseButton as AlertDialogCloseButton, AlertDialogContent, ModalFooter as AlertDialogFooter, ModalHeader as AlertDialogHeader, ModalOverlay as AlertDialogOverlay, Avatar, AvatarBadge, AvatarGroup, Box, ButtonGroup, Center, ChakraProvider, Table as ChakraTable, CloseButton, Code, Collapse, ColorModeScript, Container, Divider, Drawer, ModalBody as DrawerBody, ModalCloseButton as DrawerCloseButton, DrawerContent, ModalFooter as DrawerFooter, ModalHeader as DrawerHeader, ModalOverlay as DrawerOverlay, Fade, Flex, FormControl, FormErrorMessage, FormHelperText, FormLabel, Grid, GridItem, HStack, Heading, Hide, Icon, IconButton, Image, Img, InputLeftElement as InputElementLeft, InputRightElement as InputElementRight, InputGroup, InputLeftAddon, InputLeftElement, InputRightAddon, InputRightElement, Link, List, ListIcon, ListItem, Modal, ModalContent, ModalContextProvider, ModalFocusScope, ModalOverlay, OrderedList, Popover, PopoverAnchor, PopoverArrow, PopoverBody, PopoverCloseButton, PopoverContent, PopoverFooter, PopoverHeader, PopoverTrigger, Portal, RequiredIndicator, ScaleFade, Show, SimpleGrid, Skeleton, Slide, SlideFade, Spacer, Stack, Step, StepDescription, StepIcon, StepIndicator, StepNumber, StepSeparator, StepStatus, StepTitle, Stepper, TabIndicator, TabList, TabPanel, TabPanels, Tabs, TabsDescendantsProvider, TabsProvider, Tbody, Td, Text, Th, Thead, Tooltip, Tr, UnorderedList, VStack, VisuallyHidden, VisuallyHiddenInput, Wrap, WrapItem, extendTheme, forwardRef, useAccordion, useAccordionContext, useAccordionItem, useAccordionItemState, useAccordionStyles, useBoolean, useBreakpoint, useBreakpointValue, useClipboard, useColorMode, useColorModePreference, useColorModeValue, useConst, useControllableProp, useControllableState, useDimensions, useDisclosure, useDrawerContext, useImage, useMediaQuery, useMergeRefs, useModal, useModalContext, useModalStyles, useOutsideClick, usePrefersReducedMotion, useQuery, useSteps, useTab, useTabIndicator, useTabList, useTabPanel, useTabPanels, useTabs, useTabsContext, useTabsDescendant, useTabsDescendants, useTabsDescendantsContext, useTabsStyles, useTheme, useToken } from '@chakra-ui/react';
4
+ import React__default, { createElement, forwardRef as forwardRef$2, useMemo, useState, useEffect, useImperativeHandle, Fragment, useCallback, createContext as createContext$1, useContext, useRef } from 'react';
1
5
  import { cx, dataAttr } from '@chakra-ui/shared-utils';
2
6
  import { forwardRef, omitThemingProps, useMultiStyleConfig, chakra, useColorMode } from '@chakra-ui/system';
3
- import React__default, { createElement, forwardRef as forwardRef$2, useMemo, useState, useEffect, useImperativeHandle, Fragment, useCallback, createContext as createContext$1, useContext, useRef } from 'react';
4
7
  import { createContext } from '@chakra-ui/react-context';
5
8
  import { CheckCircle, Info, AlertTriangle, Close, EyeOff, Eye, ChevronDown, Rating as Rating$1, Check } from '@ctlyst.id/internal-icon';
6
9
  import { cx as cx$1 } from '@chakra-ui/utils';
7
- import { forwardRef as forwardRef$1, useStyleConfig, Box, Button as Button$2, Badge as Badge$2, useToken, theme as theme$1, Text, Breadcrumb, BreadcrumbItem, BreadcrumbLink, Card, Checkbox as Checkbox$1, FormControl, FormLabel as FormLabel$1, FormHelperText, FormErrorMessage, CheckboxGroup, Stack, Flex, Spinner, Table, Thead, Tr, useColorModeValue, Th, Tbody, Td, defineStyle, InputGroup, Input as Input$1, InputRightAddon, InputRightElement, InputLeftAddon, Textarea as Textarea$1, Image, useDisclosure, Popover as Popover$1, HStack, VStack, PopoverTrigger, Avatar, PopoverContent, PopoverArrow, PopoverBody, useColorMode as useColorMode$1, ModalBody as ModalBody$1, ModalCloseButton as ModalCloseButton$1, ModalFooter as ModalFooter$1, ModalHeader as ModalHeader$1, createIcon, Icon, Portal, Link, VisuallyHidden, Select as Select$1, Radio as Radio$1, RadioGroup, Grid, useMultiStyleConfig as useMultiStyleConfig$1, omitThemingProps as omitThemingProps$1, useCheckbox, chakra as chakra$1, useTab, TabList as TabList$1, TabPanel as TabPanel$1, Heading, createMultiStyleConfigHelpers as createMultiStyleConfigHelpers$1, defineStyleConfig as defineStyleConfig$1, extendTheme } from '@chakra-ui/react';
8
- export { AlertDialog, ModalBody as AlertDialogBody, ModalCloseButton as AlertDialogCloseButton, AlertDialogContent, ModalFooter as AlertDialogFooter, ModalHeader as AlertDialogHeader, ModalOverlay as AlertDialogOverlay, Box, ButtonGroup, Center, ChakraProvider, Table as ChakraTable, CloseButton, Code, Collapse, ColorModeScript, Container, Divider, Drawer, ModalBody as DrawerBody, ModalCloseButton as DrawerCloseButton, DrawerContent, ModalFooter as DrawerFooter, ModalHeader as DrawerHeader, ModalOverlay as DrawerOverlay, Flex, FormControl, FormErrorMessage, FormHelperText, FormLabel, Grid, GridItem, HStack, Heading, Icon, IconButton, Image, InputLeftElement as InputElementLeft, InputRightElement as InputElementRight, InputGroup, InputLeftAddon, InputLeftElement, InputRightAddon, InputRightElement, Link, List, ListIcon, ListItem, Modal, ModalContent, ModalContextProvider, ModalFocusScope, ModalOverlay, OrderedList, Popover, PopoverAnchor, PopoverArrow, PopoverBody, PopoverCloseButton, PopoverContent, PopoverFooter, PopoverHeader, PopoverTrigger, Portal, RequiredIndicator, ScaleFade, SimpleGrid, Skeleton, Spacer, Stack, TabIndicator, TabPanels, Tabs, TabsDescendantsProvider, TabsProvider, Tbody, Td, Text, Th, Thead, Tooltip, Tr, UnorderedList, VStack, Wrap, WrapItem, extendTheme, forwardRef, useBoolean, useColorMode, useColorModeValue, useDisclosure, useDrawerContext, useModal, useModalContext, useModalStyles, useTab, useTabIndicator, useTabList, useTabPanel, useTabPanels, useTabs, useTabsContext, useTabsDescendant, useTabsDescendants, useTabsDescendantsContext, useTabsStyles, useToken } from '@chakra-ui/react';
9
- import { FiChevronLeft, FiChevronsRight, FiHome, FiCalendar, FiX, FiPower, FiMoon, FiSun, FiShoppingBag, FiShoppingCart, FiRepeat, FiBox, FiLayers, FiDollarSign, FiUsers, FiRotateCcw, FiSettings, FiLayout, FiGift, FiChevronDown } from 'react-icons/fi';
10
+ import { Link } from '@chakra-ui/layout';
11
+ import { FiChevronLeft, FiChevronsRight, FiHome, FiMinus, FiPlus, FiCalendar, FiX, FiPower, FiMoon, FiSun, FiShoppingBag, FiShoppingCart, FiRepeat, FiBox, FiLayers, FiDollarSign, FiUsers, FiRotateCcw, FiSettings, FiLayout, FiGift, FiChevronDown } from 'react-icons/fi';
12
+ export { CheckboxIcon, useCheckbox, useCheckboxGroup } from '@chakra-ui/checkbox';
10
13
  import { ChevronUpIcon, ChevronDownIcon, UpDownIcon, ArrowLeftIcon, ChevronLeftIcon, ChevronRightIcon, ArrowRightIcon } from '@chakra-ui/icons';
11
14
  import { css, Global, keyframes } from '@emotion/react';
12
15
  import { useReactTable, getCoreRowModel, getSortedRowModel, flexRender } from '@tanstack/react-table';
13
16
  import classnames from 'classnames';
14
17
  import ReactDatePicker from 'react-datepicker';
15
18
  import styled from '@emotion/styled';
19
+ export { useRadio, useRadioGroup, useRadioGroupContext } from '@chakra-ui/radio';
16
20
  import ReactSelect from 'react-select';
17
21
  import { AsyncPaginate } from 'react-select-async-paginate';
18
22
  import ReactSelectAsyncCreatable from 'react-select/async-creatable';
19
23
  import ReactSelectCreatable from 'react-select/creatable';
20
24
  import { useDropzone } from 'react-dropzone';
21
- import { accordionAnatomy, alertAnatomy, checkboxAnatomy, inputAnatomy, popoverAnatomy, radioAnatomy, switchAnatomy, tableAnatomy } from '@chakra-ui/anatomy';
25
+ import { accordionAnatomy, alertAnatomy, checkboxAnatomy, inputAnatomy, popoverAnatomy, radioAnatomy, switchAnatomy, tableAnatomy, tabsAnatomy } from '@chakra-ui/anatomy';
22
26
  import { createMultiStyleConfigHelpers, defineStyle as defineStyle$1, cssVar, defineStyleConfig } from '@chakra-ui/styled-system';
23
27
  import { mode, calc, cssVar as cssVar$1 } from '@chakra-ui/theme-tools';
24
28
  import axios from 'axios';
25
29
  import { ToastContainer } from 'react-toastify';
26
30
 
31
+ // eslint-disable-next-line import/prefer-default-export
32
+ const AccordionIndicator = () => {
33
+ const {
34
+ isOpen
35
+ } = useAccordionItemState();
36
+ if (isOpen) {
37
+ return /*#__PURE__*/React__default.createElement(Box, {
38
+ position: "absolute",
39
+ left: 0,
40
+ width: "2px",
41
+ height: "100%",
42
+ bg: "primary.500"
43
+ });
44
+ }
45
+ return null;
46
+ };
47
+
27
48
  /* eslint-disable react/require-default-props */
28
49
  function CheckIcon() {
29
50
  return /*#__PURE__*/React__default.createElement(CheckCircle, {
@@ -259,6 +280,37 @@ const AlertTitle = /*#__PURE__*/forwardRef(function AlertTitle(props, ref) {
259
280
  });
260
281
  AlertTitle.displayName = 'AlertTitle';
261
282
 
283
+ const Anchor = ({
284
+ children,
285
+ leftIcon,
286
+ rightIcon,
287
+ isActive,
288
+ isChild,
289
+ ...props
290
+ }) => {
291
+ return /*#__PURE__*/createElement(Link, Object.assign({
292
+ display: "inline-block",
293
+ w: "full",
294
+ p: "4",
295
+ pl: isChild ? '10' : '4',
296
+ borderLeft: "1px solid",
297
+ borderLeftColor: isActive ? 'primary.500' : 'neutral.400',
298
+ color: isActive ? 'primary.500' : 'black.high',
299
+ bg: isActive ? 'neutral.100' : 'white',
300
+ className: cx('catalyst-anchor', props.className),
301
+ _hover: {
302
+ textDecoration: 'none'
303
+ }
304
+ }, props), leftIcon && leftIcon, children, rightIcon && rightIcon);
305
+ };
306
+ Anchor.displayName = 'Anchor';
307
+ Anchor.defaultProps = {
308
+ leftIcon: undefined,
309
+ rightIcon: undefined,
310
+ isActive: false,
311
+ isChild: false
312
+ };
313
+
262
314
  const Badge = props => {
263
315
  const {
264
316
  children,
@@ -569,6 +621,262 @@ Chips.defaultProps = {
569
621
  size: 'sm'
570
622
  };
571
623
 
624
+ const InputAddonLeft = ({
625
+ children
626
+ }) => {
627
+ return /*#__PURE__*/React__default.createElement(InputLeftAddon, {
628
+ backgroundColor: "neutral.200",
629
+ px: 3,
630
+ py: 2.5,
631
+ style: {
632
+ border: 0,
633
+ marginInlineEnd: 0
634
+ }
635
+ }, children);
636
+ };
637
+ const InputAddonRight = ({
638
+ children
639
+ }) => {
640
+ return /*#__PURE__*/React__default.createElement(InputRightAddon, {
641
+ backgroundColor: "neutral.200",
642
+ px: 3,
643
+ py: 2.5,
644
+ style: {
645
+ border: 0,
646
+ marginInlineStart: 0
647
+ }
648
+ }, children);
649
+ };
650
+
651
+ const getProperties = props => {
652
+ const {
653
+ isError,
654
+ isDisabled,
655
+ isSuccess
656
+ } = props;
657
+ let outlineColor = 'neutral.400';
658
+ let focusColor = 'primary.500';
659
+ if (isError || isDisabled || isSuccess) {
660
+ if (isError) outlineColor = 'danger.500';else if (isSuccess) outlineColor = 'success.500';
661
+ focusColor = outlineColor;
662
+ }
663
+ return {
664
+ outlineColor,
665
+ focusColor
666
+ };
667
+ };
668
+ const getWrapperStyle = props => {
669
+ const {
670
+ outlineColor,
671
+ focusColor
672
+ } = getProperties(props);
673
+ const style = {
674
+ border: '1px solid',
675
+ borderColor: outlineColor,
676
+ borderRadius: 'sm',
677
+ transition: 'all 0.15s',
678
+ boxShadow: 'none',
679
+ _focusWithin: {
680
+ borderColor: focusColor
681
+ }
682
+ };
683
+ return defineStyle(style);
684
+ };
685
+
686
+ const InputField = /*#__PURE__*/React__default.forwardRef((props, ref) => {
687
+ const {
688
+ value,
689
+ type,
690
+ addOnLeft,
691
+ addOnRight,
692
+ size,
693
+ isRequired,
694
+ label,
695
+ isError,
696
+ isSuccess,
697
+ isDisabled,
698
+ errorMessage,
699
+ leftHelperText,
700
+ rightHelperText,
701
+ withClear,
702
+ onClear,
703
+ isLoading,
704
+ ...inputProps
705
+ } = props;
706
+ const wrapperStyle = getWrapperStyle(props);
707
+ const [isShowPassword, setIsShowPassword] = useState(false);
708
+ const inputType = useMemo(() => {
709
+ return type === 'password' && isShowPassword ? 'text' : type;
710
+ }, [isShowPassword, type]);
711
+ const fontSize = useMemo(() => {
712
+ if (type === 'password') {
713
+ if (!isShowPassword && value) return 'text.xl';
714
+ }
715
+ return 'text.sm';
716
+ }, [isShowPassword, type, value]);
717
+ const iconColor = useMemo(() => {
718
+ return isDisabled ? 'black.low' : 'black.medium';
719
+ }, [isDisabled]);
720
+ return /*#__PURE__*/React__default.createElement(Field, {
721
+ label: label,
722
+ isSuccess: isSuccess,
723
+ isError: isError,
724
+ errorMessage: errorMessage,
725
+ leftHelperText: leftHelperText,
726
+ rightHelperText: rightHelperText,
727
+ isRequired: isRequired
728
+ }, /*#__PURE__*/React__default.createElement(Box, {
729
+ __css: wrapperStyle
730
+ }, /*#__PURE__*/React__default.createElement(InputGroup, {
731
+ size: size,
732
+ borderRadius: "sm",
733
+ backgroundColor: isDisabled ? 'neutral.300' : 'white.high',
734
+ cursor: isDisabled ? 'not-allowed' : 'default'
735
+ }, addOnLeft, /*#__PURE__*/React__default.createElement(Input$1, Object.assign({
736
+ ref: ref,
737
+ type: inputType,
738
+ value: value,
739
+ isDisabled: isDisabled,
740
+ isSuccess: isSuccess
741
+ }, inputProps, {
742
+ fontSize: fontSize
743
+ })), (withClear || isLoading || type === 'password') && /*#__PURE__*/React__default.createElement(Box, {
744
+ "data-test-id": "CT_Component_ClearInput",
745
+ display: "flex",
746
+ alignItems: "center",
747
+ justifyContent: "center",
748
+ width: "16px",
749
+ mr: "10px"
750
+ }, withClear && !isLoading && /*#__PURE__*/React__default.createElement(Box, {
751
+ display: "flex",
752
+ justifyContent: "center",
753
+ onClick: !isDisabled ? onClear : undefined,
754
+ cursor: isDisabled ? 'not-allowed' : 'pointer'
755
+ }, /*#__PURE__*/React__default.createElement(Close, {
756
+ size: 4,
757
+ color: iconColor
758
+ })), type === 'password' && !isShowPassword && !isLoading && /*#__PURE__*/React__default.createElement(Box, {
759
+ "data-test-id": "q2Bj2G4FlamXyHuRKMZ1Q",
760
+ onClick: () => {
761
+ if (!isDisabled) setIsShowPassword(true);
762
+ },
763
+ cursor: isDisabled ? 'not-allowed' : 'pointer',
764
+ display: "flex",
765
+ justifyContent: "center"
766
+ }, /*#__PURE__*/React__default.createElement(EyeOff, {
767
+ size: 4,
768
+ color: iconColor
769
+ })), type === 'password' && isShowPassword && !isLoading && /*#__PURE__*/React__default.createElement(Box, {
770
+ "data-test-id": "sfc2388bmeXBmdla45Ibk",
771
+ onClick: () => {
772
+ if (!isDisabled) setIsShowPassword(false);
773
+ },
774
+ cursor: isDisabled ? 'not-allowed' : 'pointer',
775
+ display: "flex",
776
+ justifyContent: "center"
777
+ }, /*#__PURE__*/React__default.createElement(Eye, {
778
+ size: 4,
779
+ color: iconColor
780
+ })), isLoading && /*#__PURE__*/React__default.createElement(Loader, {
781
+ size: "sm"
782
+ })), addOnRight)));
783
+ });
784
+ InputField.defaultProps = {
785
+ addOnLeft: undefined,
786
+ addOnRight: undefined,
787
+ withClear: undefined,
788
+ isLoading: undefined,
789
+ onClear: undefined
790
+ };
791
+
792
+ const TextareaField = /*#__PURE__*/React__default.forwardRef((props, ref) => {
793
+ const {
794
+ value,
795
+ isLoading,
796
+ ...inputProps
797
+ } = props;
798
+ return /*#__PURE__*/React__default.createElement(Field, Object.assign({}, inputProps), /*#__PURE__*/React__default.createElement(Box, {
799
+ position: "relative"
800
+ }, /*#__PURE__*/React__default.createElement(Textarea$1, Object.assign({
801
+ ref: ref,
802
+ value: value
803
+ }, inputProps)), isLoading && /*#__PURE__*/React__default.createElement(Box, {
804
+ zIndex: 999,
805
+ top: 2,
806
+ right: 2,
807
+ position: "absolute"
808
+ }, /*#__PURE__*/React__default.createElement(Loader, {
809
+ size: "sm"
810
+ }))));
811
+ });
812
+ TextareaField.defaultProps = {
813
+ isLoading: undefined
814
+ };
815
+
816
+ /* eslint-disable react/require-default-props */
817
+ const Counter = ({
818
+ value,
819
+ size = 'xs',
820
+ min = 0,
821
+ max = 9999,
822
+ onChange,
823
+ isError = false,
824
+ disabled = false,
825
+ error = '',
826
+ helperText = '',
827
+ isReadOnly = false
828
+ }) => {
829
+ const getFieldSize = () => {
830
+ if (size === 'xl') return 'lg';
831
+ if (size === 'lg') return 'md';
832
+ if (size === 'md') return 'sm';
833
+ return 'xs';
834
+ };
835
+ const decrement = () => {
836
+ onChange(value - 1);
837
+ };
838
+ const increment = () => {
839
+ onChange(value + 1);
840
+ };
841
+ const handleChange = e => {
842
+ onChange(+e.target.value);
843
+ };
844
+ return /*#__PURE__*/React__default.createElement(Box, null, /*#__PURE__*/React__default.createElement(HStack, null, /*#__PURE__*/React__default.createElement(IconButton, {
845
+ "aria-label": "minus",
846
+ "data-test-id": "CT_Component_Counter_decrement",
847
+ onClick: decrement,
848
+ isDisabled: disabled || +value <= min,
849
+ size: size,
850
+ icon: /*#__PURE__*/React__default.createElement(FiMinus, null)
851
+ }), /*#__PURE__*/React__default.createElement(InputField, {
852
+ "data-test-id": "CT_Component_Counter_input",
853
+ value: value,
854
+ isError: isError,
855
+ isDisabled: disabled || max === 0,
856
+ textAlign: "center",
857
+ size: getFieldSize(),
858
+ min: min,
859
+ max: max,
860
+ onChange: handleChange,
861
+ isReadOnly: isReadOnly,
862
+ width: 12,
863
+ type: "number"
864
+ }), /*#__PURE__*/React__default.createElement(IconButton, {
865
+ "aria-label": "plus",
866
+ "data-test-id": "CT_Component_Counter_decrement",
867
+ onClick: increment,
868
+ isDisabled: disabled || +value >= max,
869
+ size: size,
870
+ icon: /*#__PURE__*/React__default.createElement(FiPlus, null)
871
+ })), !isError ? /*#__PURE__*/React__default.createElement(Text, {
872
+ mt: 1,
873
+ color: "black.medium"
874
+ }, helperText) : /*#__PURE__*/React__default.createElement(Text, {
875
+ mt: 1,
876
+ color: "danger.500"
877
+ }, error));
878
+ };
879
+
572
880
  /* eslint-disable react-hooks/rules-of-hooks */
573
881
  const DataTable = /*#__PURE__*/forwardRef$2((props, ref) => {
574
882
  const {
@@ -741,41 +1049,6 @@ DataTable.defaultProps = {
741
1049
  onRowClick: undefined
742
1050
  };
743
1051
 
744
- const getProperties = props => {
745
- const {
746
- isError,
747
- isDisabled,
748
- isSuccess
749
- } = props;
750
- let outlineColor = 'neutral.400';
751
- let focusColor = 'primary.500';
752
- if (isError || isDisabled || isSuccess) {
753
- if (isError) outlineColor = 'danger.500';else if (isSuccess) outlineColor = 'success.500';
754
- focusColor = outlineColor;
755
- }
756
- return {
757
- outlineColor,
758
- focusColor
759
- };
760
- };
761
- const getWrapperStyle = props => {
762
- const {
763
- outlineColor,
764
- focusColor
765
- } = getProperties(props);
766
- const style = {
767
- border: '1px solid',
768
- borderColor: outlineColor,
769
- borderRadius: 'sm',
770
- transition: 'all 0.15s',
771
- boxShadow: 'none',
772
- _focusWithin: {
773
- borderColor: focusColor
774
- }
775
- };
776
- return defineStyle(style);
777
- };
778
-
779
1052
  const Styles = () => {
780
1053
  const {
781
1054
  colorMode
@@ -1797,161 +2070,42 @@ MultiDatePickerMonth.defaultProps = {
1797
2070
  isError: false
1798
2071
  };
1799
2072
 
1800
- const InputAddonLeft = ({
1801
- children
1802
- }) => {
1803
- return /*#__PURE__*/React__default.createElement(InputLeftAddon, {
1804
- backgroundColor: "neutral.200",
1805
- px: 3,
1806
- py: 2.5,
1807
- style: {
1808
- border: 0,
1809
- marginInlineEnd: 0
1810
- }
1811
- }, children);
1812
- };
1813
- const InputAddonRight = ({
1814
- children
2073
+ const Dialog = ({
2074
+ title,
2075
+ content,
2076
+ footer,
2077
+ isModalOverlay,
2078
+ width,
2079
+ isOverlayClickable,
2080
+ ...props
1815
2081
  }) => {
1816
- return /*#__PURE__*/React__default.createElement(InputRightAddon, {
1817
- backgroundColor: "neutral.200",
1818
- px: 3,
1819
- py: 2.5,
1820
- style: {
1821
- border: 0,
1822
- marginInlineStart: 0
1823
- }
1824
- }, children);
1825
- };
1826
-
1827
- const InputField = /*#__PURE__*/React__default.forwardRef((props, ref) => {
1828
- const {
1829
- value,
1830
- type,
1831
- addOnLeft,
1832
- addOnRight,
1833
- size,
1834
- isRequired,
1835
- label,
1836
- isError,
1837
- isSuccess,
1838
- isDisabled,
1839
- errorMessage,
1840
- leftHelperText,
1841
- rightHelperText,
1842
- withClear,
1843
- onClear,
1844
- isLoading,
1845
- ...inputProps
1846
- } = props;
1847
- const wrapperStyle = getWrapperStyle(props);
1848
- const [isShowPassword, setIsShowPassword] = useState(false);
1849
- const inputType = useMemo(() => {
1850
- return type === 'password' && isShowPassword ? 'text' : type;
1851
- }, [isShowPassword, type]);
1852
- const fontSize = useMemo(() => {
1853
- if (type === 'password') {
1854
- if (!isShowPassword && value) return 'text.xl';
1855
- }
1856
- return 'text.sm';
1857
- }, [isShowPassword, type, value]);
1858
- const iconColor = useMemo(() => {
1859
- return isDisabled ? 'black.low' : 'black.medium';
1860
- }, [isDisabled]);
1861
- return /*#__PURE__*/React__default.createElement(Field, {
1862
- label: label,
1863
- isSuccess: isSuccess,
1864
- isError: isError,
1865
- errorMessage: errorMessage,
1866
- leftHelperText: leftHelperText,
1867
- rightHelperText: rightHelperText,
1868
- isRequired: isRequired
1869
- }, /*#__PURE__*/React__default.createElement(Box, {
1870
- __css: wrapperStyle
1871
- }, /*#__PURE__*/React__default.createElement(InputGroup, {
1872
- size: size,
1873
- borderRadius: "sm",
1874
- backgroundColor: isDisabled ? 'neutral.300' : 'white.high',
1875
- cursor: isDisabled ? 'not-allowed' : 'default'
1876
- }, addOnLeft, /*#__PURE__*/React__default.createElement(Input$1, Object.assign({
1877
- ref: ref,
1878
- type: inputType,
1879
- value: value,
1880
- isDisabled: isDisabled,
1881
- isSuccess: isSuccess
1882
- }, inputProps, {
1883
- fontSize: fontSize
1884
- })), (withClear || isLoading || type === 'password') && /*#__PURE__*/React__default.createElement(Box, {
1885
- "data-test-id": "CT_Component_ClearInput",
1886
- display: "flex",
1887
- alignItems: "center",
1888
- justifyContent: "center",
1889
- width: "16px",
1890
- mr: "10px"
1891
- }, withClear && !isLoading && /*#__PURE__*/React__default.createElement(Box, {
1892
- display: "flex",
1893
- justifyContent: "center",
1894
- onClick: !isDisabled ? onClear : undefined,
1895
- cursor: isDisabled ? 'not-allowed' : 'pointer'
1896
- }, /*#__PURE__*/React__default.createElement(Close, {
1897
- size: 4,
1898
- color: iconColor
1899
- })), type === 'password' && !isShowPassword && !isLoading && /*#__PURE__*/React__default.createElement(Box, {
1900
- "data-test-id": "q2Bj2G4FlamXyHuRKMZ1Q",
1901
- onClick: () => {
1902
- if (!isDisabled) setIsShowPassword(true);
1903
- },
1904
- cursor: isDisabled ? 'not-allowed' : 'pointer',
1905
- display: "flex",
1906
- justifyContent: "center"
1907
- }, /*#__PURE__*/React__default.createElement(EyeOff, {
1908
- size: 4,
1909
- color: iconColor
1910
- })), type === 'password' && isShowPassword && !isLoading && /*#__PURE__*/React__default.createElement(Box, {
1911
- "data-test-id": "sfc2388bmeXBmdla45Ibk",
1912
- onClick: () => {
1913
- if (!isDisabled) setIsShowPassword(false);
1914
- },
1915
- cursor: isDisabled ? 'not-allowed' : 'pointer',
1916
- display: "flex",
1917
- justifyContent: "center"
1918
- }, /*#__PURE__*/React__default.createElement(Eye, {
1919
- size: 4,
1920
- color: iconColor
1921
- })), isLoading && /*#__PURE__*/React__default.createElement(Loader, {
1922
- size: "sm"
1923
- })), addOnRight)));
1924
- });
1925
- InputField.defaultProps = {
1926
- addOnLeft: undefined,
1927
- addOnRight: undefined,
1928
- withClear: undefined,
1929
- isLoading: undefined,
1930
- onClear: undefined
2082
+ return /*#__PURE__*/React__default.createElement(Modal, Object.assign({}, props), isModalOverlay && /*#__PURE__*/React__default.createElement(ModalOverlay, {
2083
+ pointerEvents: isOverlayClickable ? 'auto' : 'none'
2084
+ }), /*#__PURE__*/React__default.createElement(ModalContent, {
2085
+ bgColor: "neutral.50",
2086
+ fontFamily: "Poppins",
2087
+ width: width
2088
+ }, /*#__PURE__*/React__default.createElement(ModalHeader$1, {
2089
+ bgColor: "neutral.200",
2090
+ py: 2,
2091
+ px: 4,
2092
+ borderTopRadius: 'sm'
2093
+ }, /*#__PURE__*/React__default.createElement(Text, {
2094
+ textStyle: "text.lg",
2095
+ fontWeight: "normal"
2096
+ }, title)), /*#__PURE__*/React__default.createElement(ModalBody$1, {
2097
+ p: 4,
2098
+ textStyle: "text.md"
2099
+ }, content), /*#__PURE__*/React__default.createElement(ModalFooter$1, {
2100
+ bgColor: "neutral.200",
2101
+ p: 4,
2102
+ borderBottomRadius: 'sm'
2103
+ }, footer)));
1931
2104
  };
1932
-
1933
- const TextareaField = /*#__PURE__*/React__default.forwardRef((props, ref) => {
1934
- const {
1935
- value,
1936
- isLoading,
1937
- ...inputProps
1938
- } = props;
1939
- return /*#__PURE__*/React__default.createElement(Field, Object.assign({}, inputProps), /*#__PURE__*/React__default.createElement(Box, {
1940
- position: "relative"
1941
- }, /*#__PURE__*/React__default.createElement(Textarea$1, Object.assign({
1942
- ref: ref,
1943
- value: value
1944
- }, inputProps)), isLoading && /*#__PURE__*/React__default.createElement(Box, {
1945
- zIndex: 999,
1946
- top: 2,
1947
- right: 2,
1948
- position: "absolute"
1949
- }, /*#__PURE__*/React__default.createElement(Loader, {
1950
- size: "sm"
1951
- }))));
1952
- });
1953
- TextareaField.defaultProps = {
1954
- isLoading: undefined
2105
+ Dialog.defaultProps = {
2106
+ isModalOverlay: true,
2107
+ width: '400px',
2108
+ isOverlayClickable: true
1955
2109
  };
1956
2110
 
1957
2111
  const Logo = ({
@@ -2040,12 +2194,16 @@ const Profile = ({
2040
2194
  size: "sm",
2041
2195
  bg: brandColor,
2042
2196
  color: "white",
2043
- name: (_data$name = data === null || data === void 0 ? void 0 : data.name) !== null && _data$name !== void 0 ? _data$name : data === null || data === void 0 ? void 0 : data.email
2197
+ name: (_data$name = data === null || data === void 0 ? void 0 : data.name) !== null && _data$name !== void 0 ? _data$name : data === null || data === void 0 ? void 0 : data.email,
2198
+ border: "2px solid",
2199
+ _hover: {
2200
+ borderColor: 'primary.50'
2201
+ }
2044
2202
  })))), /*#__PURE__*/createElement(PopoverContent, {
2045
- bg: useColorModeValue('white', 'mirage.900'),
2203
+ bg: "white",
2046
2204
  maxW: 200
2047
2205
  }, /*#__PURE__*/createElement(PopoverArrow, {
2048
- bg: useColorModeValue('white', 'mirage.900')
2206
+ bg: "white"
2049
2207
  }), /*#__PURE__*/createElement(PopoverBody, {
2050
2208
  p: 1
2051
2209
  }, /*#__PURE__*/createElement(Flex, {
@@ -2108,6 +2266,7 @@ const Version = ({
2108
2266
  environment,
2109
2267
  onOpenModalRelease
2110
2268
  }) => /*#__PURE__*/createElement(Fragment, null, version && /*#__PURE__*/createElement(Badge, {
2269
+ fontSize: "8px",
2111
2270
  "data-test-id": "dzl3esjhCphobaaIXpiUE",
2112
2271
  variant: "neutral-light",
2113
2272
  onClick: onOpenModalRelease,
@@ -2142,11 +2301,11 @@ const Header = ({
2142
2301
  urlLogo,
2143
2302
  children,
2144
2303
  profile,
2304
+ bg = 'white',
2145
2305
  ...props
2146
2306
  }) => /*#__PURE__*/createElement(Flex, Object.assign({
2147
2307
  minH: 15,
2148
- bg: props.bg,
2149
- bgColor: props.bgColor,
2308
+ bg: bg,
2150
2309
  shadow: "raised",
2151
2310
  px: 6,
2152
2311
  py: 3,
@@ -2331,7 +2490,7 @@ const Navigation = ({
2331
2490
  const link = navHost ? `${navHost}${navLink}` : navLink;
2332
2491
  const isLocalLink = host === navHost;
2333
2492
  const isActiveSub = activePath === navLink;
2334
- return /*#__PURE__*/createElement(Link, {
2493
+ return /*#__PURE__*/createElement(Link$1, {
2335
2494
  as: isLocalLink ? as : undefined,
2336
2495
  key: title,
2337
2496
  href: link,
@@ -2448,7 +2607,7 @@ const NavigationBar = ({
2448
2607
  shadow: "raised",
2449
2608
  py: 1,
2450
2609
  width: 240
2451
- }, item.children.map(subMenu => /*#__PURE__*/React__default.createElement(Link, {
2610
+ }, item.children.map(subMenu => /*#__PURE__*/React__default.createElement(Link$1, {
2452
2611
  key: subMenu.id,
2453
2612
  href: urlMenu(subMenu),
2454
2613
  display: "flex",
@@ -2700,18 +2859,18 @@ PaginationFilter.defaultProps = {
2700
2859
  label: undefined
2701
2860
  };
2702
2861
 
2703
- function RadioComponent({
2862
+ const Radio = ({
2704
2863
  isError = false,
2705
2864
  helpText = '',
2706
2865
  errorText = '',
2707
2866
  children,
2708
2867
  isDisabled,
2709
2868
  ...rest
2710
- }) {
2869
+ }) => {
2711
2870
  const variant = isError ? 'errors' : 'unstyled';
2712
2871
  return /*#__PURE__*/React__default.createElement(Box, null, /*#__PURE__*/React__default.createElement(Box, {
2713
2872
  display: "flex"
2714
- }, /*#__PURE__*/React__default.createElement(Radio$1, Object.assign({
2873
+ }, /*#__PURE__*/React__default.createElement(Radio$2, Object.assign({
2715
2874
  variant: variant
2716
2875
  }, rest, {
2717
2876
  isDisabled: isDisabled
@@ -2734,35 +2893,36 @@ function RadioComponent({
2734
2893
  textStyle: "text.xs",
2735
2894
  color: "black.medium"
2736
2895
  }, helpText)));
2737
- }
2738
- RadioComponent.defaultProps = {
2896
+ };
2897
+ Radio.displayName = 'Radio';
2898
+ Radio.defaultProps = {
2739
2899
  isError: false,
2740
2900
  helpText: '',
2741
2901
  errorText: ''
2742
2902
  };
2743
2903
 
2744
- function RadioGroupComponent(props) {
2745
- const {
2746
- children,
2747
- label,
2748
- helpText,
2749
- isError,
2750
- errorMessage,
2751
- ...rest
2752
- } = props;
2753
- return /*#__PURE__*/React__default.createElement(Field, Object.assign({}, rest, {
2904
+ const RadioGroup = ({
2905
+ children,
2906
+ label,
2907
+ helpText,
2908
+ isError,
2909
+ errorMessage,
2910
+ ...props
2911
+ }) => {
2912
+ return /*#__PURE__*/React__default.createElement(Field, Object.assign({}, props, {
2754
2913
  label: label,
2755
2914
  leftHelperText: helpText,
2756
2915
  isError: isError,
2757
2916
  errorMessage: errorMessage
2758
2917
  }), /*#__PURE__*/React__default.createElement(Box, {
2759
2918
  mt: "12px"
2760
- }, /*#__PURE__*/React__default.createElement(RadioGroup, Object.assign({}, rest), /*#__PURE__*/React__default.createElement(Stack, {
2919
+ }, /*#__PURE__*/React__default.createElement(RadioGroup$1, Object.assign({}, props), /*#__PURE__*/React__default.createElement(Stack, {
2761
2920
  spacing: [1, '16px'],
2762
2921
  direction: ['column', 'row']
2763
2922
  }, children))));
2764
- }
2765
- RadioGroupComponent.defaultProps = {
2923
+ };
2924
+ RadioGroup.displayName = 'RadioGroup';
2925
+ RadioGroup.defaultProps = {
2766
2926
  helpText: '',
2767
2927
  isError: false,
2768
2928
  errorMessage: ''
@@ -3274,7 +3434,6 @@ const Tab = /*#__PURE__*/forwardRef$1((props, ref) => {
3274
3434
  _selected: {
3275
3435
  borderColor: 'primary.500',
3276
3436
  color: 'primary.500',
3277
- transform: 'translateY(-2px)',
3278
3437
  _hover: {
3279
3438
  '& .chakra-badge': {
3280
3439
  bg: 'primary.500'
@@ -3302,19 +3461,6 @@ const Tab = /*#__PURE__*/forwardRef$1((props, ref) => {
3302
3461
  })));
3303
3462
  });
3304
3463
 
3305
- const TabList = /*#__PURE__*/forwardRef$1((props, ref) => /*#__PURE__*/React__default.createElement(TabList$1, Object.assign({
3306
- borderBottom: "1px solid",
3307
- borderColor: useColorModeValue('gray.200', 'bright-gray.800')
3308
- }, props, {
3309
- ref: ref
3310
- }), props.children));
3311
-
3312
- const TabPanel = /*#__PURE__*/forwardRef$1((props, ref) => /*#__PURE__*/React__default.createElement(TabPanel$1, Object.assign({
3313
- px: 0
3314
- }, props, {
3315
- ref: ref
3316
- }), props.children));
3317
-
3318
3464
  const messages = {
3319
3465
  dragActive: 'Drop file disini...',
3320
3466
  dragInActive: `(Klik atau drag untuk input file)`,
@@ -4405,7 +4551,7 @@ const variants$3 = {
4405
4551
  errors: errors$1,
4406
4552
  unstyled: unstyled$2
4407
4553
  };
4408
- const Radio = /*#__PURE__*/defineMultiStyleConfig$4({
4554
+ const Radio$1 = /*#__PURE__*/defineMultiStyleConfig$4({
4409
4555
  baseStyle: baseStyle$5,
4410
4556
  variants: variants$3,
4411
4557
  defaultProps: {
@@ -4692,6 +4838,42 @@ const tableTheme = /*#__PURE__*/defineMultiStyleConfig$6({
4692
4838
  }
4693
4839
  });
4694
4840
 
4841
+ const {
4842
+ defineMultiStyleConfig: defineMultiStyleConfig$7,
4843
+ definePartsStyle: definePartsStyle$8
4844
+ } = /*#__PURE__*/createMultiStyleConfigHelpers(tabsAnatomy.keys);
4845
+ const variantLine = /*#__PURE__*/definePartsStyle$8(props => {
4846
+ const {
4847
+ orientation
4848
+ } = props;
4849
+ const isVertical = orientation === 'vertical';
4850
+ const borderProp = isVertical ? 'borderStart' : 'borderBottom';
4851
+ const marginProp = isVertical ? 'marginStart' : 'marginBottom';
4852
+ return {
4853
+ tablist: {
4854
+ [borderProp]: '1px solid',
4855
+ borderColor: 'inherit'
4856
+ },
4857
+ tab: {
4858
+ [borderProp]: '1px solid',
4859
+ borderColor: 'transparent',
4860
+ [marginProp]: '-1px'
4861
+ }
4862
+ };
4863
+ });
4864
+ const variantUnstyled = /*#__PURE__*/definePartsStyle$8({});
4865
+ const variants$5 = {
4866
+ line: variantLine,
4867
+ unstyled: variantUnstyled
4868
+ };
4869
+ const tabsTheme = /*#__PURE__*/defineMultiStyleConfig$7({
4870
+ variants: variants$5,
4871
+ defaultProps: {
4872
+ size: 'md',
4873
+ variant: 'line'
4874
+ }
4875
+ });
4876
+
4695
4877
  const getProps = props => {
4696
4878
  const {
4697
4879
  isError,
@@ -4786,9 +4968,10 @@ var components = {
4786
4968
  Input: Input,
4787
4969
  LoaderStyle: LoaderStyle,
4788
4970
  Popover: Popover,
4789
- Radio: Radio,
4971
+ Radio: Radio$1,
4790
4972
  Switch: Switch$1,
4791
4973
  Table: tableTheme,
4974
+ Tabs: tabsTheme,
4792
4975
  Textarea: Textarea
4793
4976
  };
4794
4977
 
@@ -4895,5 +5078,5 @@ function useFetcher() {
4895
5078
  };
4896
5079
  }
4897
5080
 
4898
- export { Alert, AlertAction, AlertClose, AlertDescription, AlertIcon, AlertTitle, Badge, BreadCrumb, Button, CardCustom as Card, CheckboxComponent as Checkbox, CheckboxGroupComponent as CheckboxGroup, Chips, DataTable, DatePickerMonth, Datepicker, Field, Header, InputAddonLeft, InputAddonRight, InputField, Loader, Navigation as MainMenu, ModalBody, ModalCloseButton, ModalFooter, ModalHeader, MultiDatePickerMonth, NavigationBar, Pagination, PaginationDetail, PaginationFilter, Provider, ProviderContext, RadioComponent as Radio, RadioGroupComponent as RadioGroup, Rating, Select, SelectAsync, SelectAsyncCreatable, SelectCreatable, Switch, Tab, TabList, TabPanel, TextareaField, Uploader, getTheme, theme, useAlertStyles, useFetcher, useInternalUI };
5081
+ export { AccordionIndicator, Alert, AlertAction, AlertClose, AlertDescription, AlertIcon, AlertTitle, Anchor, Badge, BreadCrumb, Button, CardCustom as Card, CheckboxComponent as Checkbox, CheckboxGroupComponent as CheckboxGroup, Chips, Counter, DataTable, DatePickerMonth, Datepicker, Dialog, Field, Header, InputAddonLeft, InputAddonRight, InputField, Loader, Navigation as MainMenu, ModalBody, ModalCloseButton, ModalFooter, ModalHeader, MultiDatePickerMonth, NavigationBar, Pagination, PaginationDetail, PaginationFilter, Provider, ProviderContext, Radio, RadioGroup, Rating, Select, SelectAsync, SelectAsyncCreatable, SelectCreatable, Switch, Tab, TextareaField, Uploader, getTheme, theme, useAlertStyles, useFetcher, useInternalUI };
4899
5082
  //# sourceMappingURL=internal-ui.esm.js.map