@ctlyst.id/internal-ui 2.0.7 → 2.0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. package/dist/components/button/__stories__/button.stories.d.ts +1 -1
  2. package/dist/components/button/index.d.ts +1 -0
  3. package/dist/components/data-table/__stories__/datatable.stories.d.ts +3 -17
  4. package/dist/components/data-table/components/data-table.d.ts +10 -20
  5. package/dist/components/data-table/components/indeterminate-checkbox.d.ts +7 -4
  6. package/dist/components/image/index.d.ts +1 -0
  7. package/dist/components/index.d.ts +5 -0
  8. package/dist/components/layouting/index.d.ts +1 -16
  9. package/dist/components/list/index.d.ts +1 -0
  10. package/dist/components/loader/components/loader.d.ts +1 -0
  11. package/dist/components/popover/index.d.ts +1 -0
  12. package/dist/components/text/index.d.ts +1 -2
  13. package/dist/components/tooltip/__stories__/tooltip.stories.d.ts +10 -0
  14. package/dist/components/tooltip/index.d.ts +1 -0
  15. package/dist/config/theme/components/checkbox.d.ts +15 -1
  16. package/dist/config/theme/components/radio.d.ts +3 -0
  17. package/dist/hooks/index.d.ts +1 -2
  18. package/dist/index.d.ts +2 -0
  19. package/dist/internal-ui.cjs.development.js +420 -72
  20. package/dist/internal-ui.cjs.development.js.map +1 -1
  21. package/dist/internal-ui.cjs.production.min.js +13 -13
  22. package/dist/internal-ui.cjs.production.min.js.map +1 -1
  23. package/dist/internal-ui.esm.js +218 -67
  24. package/dist/internal-ui.esm.js.map +1 -1
  25. package/dist/provider/index.d.ts +1 -0
  26. package/package.json +2 -2
  27. package/dist/components/layouting/components/box.d.ts +0 -4
  28. package/dist/components/layouting/components/button-group.d.ts +0 -4
  29. package/dist/components/layouting/components/container.d.ts +0 -4
  30. package/dist/components/layouting/components/flex.d.ts +0 -4
  31. package/dist/components/layouting/components/grid.d.ts +0 -4
  32. package/dist/components/layouting/components/list.d.ts +0 -6
  33. package/dist/components/layouting/components/stack.d.ts +0 -5
  34. package/dist/components/layouting/components/wrap.d.ts +0 -4
  35. package/dist/components/text/components/text.d.ts +0 -4
  36. package/dist/hooks/useDisclosure.d.ts +0 -4
@@ -1,11 +1,11 @@
1
1
  import { cx, dataAttr } from '@chakra-ui/shared-utils';
2
2
  import { forwardRef, omitThemingProps, useMultiStyleConfig, chakra, useColorMode } from '@chakra-ui/system';
3
- import React__default, { createElement, forwardRef as forwardRef$2, useRef, useEffect, useState, useMemo, Fragment, useCallback, createContext as createContext$1, useContext } from 'react';
3
+ import React__default, { createElement, forwardRef as forwardRef$2, useMemo, useRef, useEffect, useState, useImperativeHandle, Fragment, useCallback, createContext as createContext$1, useContext } from 'react';
4
4
  import { createContext } from '@chakra-ui/react-context';
5
5
  import { CheckCircle, Info, AlertTriangle, Close, EyeOff, Eye, Rating as Rating$1, Check } from '@ctlyst.id/internal-icon';
6
6
  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, Text, useColorModeValue, Breadcrumb, BreadcrumbItem, BreadcrumbLink, Card, Checkbox as Checkbox$1, FormControl, FormLabel as FormLabel$1, FormHelperText, FormErrorMessage, CheckboxGroup, Stack, Flex, Spinner, Table, Thead, Tr, Th, Tbody, Td, defineStyle, InputGroup, Input as Input$1, InputRightAddon, InputRightElement, theme as theme$1, InputLeftAddon, Textarea as Textarea$1, Image, useDisclosure, Popover as Popover$1, HStack, VStack, PopoverTrigger, Avatar, PopoverContent, PopoverArrow, PopoverBody, useColorMode as useColorMode$1, ButtonGroup, Container, Grid, List, Wrap, 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, 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, Drawer, ModalBody as DrawerBody, ModalCloseButton as DrawerCloseButton, DrawerContent, ModalFooter as DrawerFooter, ModalHeader as DrawerHeader, ModalOverlay as DrawerOverlay, HStack, InputLeftElement as InputElementLeft, InputRightElement as InputElementRight, ListItem, Modal, ModalContent, ModalContextProvider, ModalFocusScope, ModalOverlay, TabIndicator, TabPanels, Tabs, TabsDescendantsProvider, TabsProvider, VStack, useDrawerContext, useModal, useModalContext, useModalStyles, useTab, useTabIndicator, useTabList, useTabPanel, useTabPanels, useTabs, useTabsContext, useTabsDescendant, useTabsDescendants, useTabsDescendantsContext, useTabsStyles } from '@chakra-ui/react';
7
+ import { forwardRef as forwardRef$1, useStyleConfig, Box, Button as Button$2, Badge as Badge$2, useToken, Text, useColorModeValue, Breadcrumb, BreadcrumbItem, BreadcrumbLink, Card, Checkbox as Checkbox$1, FormControl, FormLabel as FormLabel$1, FormHelperText, FormErrorMessage, CheckboxGroup, Stack, Flex, Spinner, Table, Thead, Tr, Th, Tbody, Td, defineStyle, InputGroup, Input as Input$1, InputRightAddon, InputRightElement, theme as theme$1, 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, ChakraProvider, CloseButton, Container, Divider, Drawer, ModalBody as DrawerBody, ModalCloseButton as DrawerCloseButton, DrawerContent, ModalFooter as DrawerFooter, ModalHeader as DrawerHeader, ModalOverlay as DrawerOverlay, Flex, Grid, GridItem, HStack, Heading, Icon, Image, InputLeftElement as InputElementLeft, InputRightElement as InputElementRight, List, ListIcon, ListItem, Modal, ModalContent, ModalContextProvider, ModalFocusScope, ModalOverlay, OrderedList, Popover, PopoverAnchor, PopoverArrow, PopoverBody, PopoverCloseButton, PopoverContent, PopoverFooter, PopoverHeader, PopoverTrigger, Portal, Stack, TabIndicator, TabPanels, Tabs, TabsDescendantsProvider, TabsProvider, Text, Tooltip, UnorderedList, VStack, Wrap, WrapItem, extendTheme, useColorModeValue, useDisclosure, useDrawerContext, useModal, useModalContext, useModalStyles, useTab, useTabIndicator, useTabList, useTabPanel, useTabPanels, useTabs, useTabsContext, useTabsDescendant, useTabsDescendants, useTabsDescendantsContext, useTabsStyles } from '@chakra-ui/react';
9
9
  import { FiChevronsRight, FiHome, FiCalendar, FiX, FiPower, FiMoon, FiSun, FiShoppingBag, FiShoppingCart, FiRepeat, FiBox, FiLayers, FiDollarSign, FiUsers, FiRotateCcw, FiSettings, FiLayout, FiGift, FiChevronDown } from 'react-icons/fi';
10
10
  import { ChevronUpIcon, ChevronDownIcon, UpDownIcon, ArrowLeftIcon, ChevronLeftIcon, ChevronRightIcon, ArrowRightIcon } from '@chakra-ui/icons';
11
11
  import { css, Global, keyframes } from '@emotion/react';
@@ -399,15 +399,21 @@ function CheckboxComponent({
399
399
  }, rest, {
400
400
  isDisabled: isDisabled
401
401
  }), children && /*#__PURE__*/React__default.createElement(Text, {
402
+ as: "span",
403
+ display: "block",
402
404
  textStyle: "text.sm",
403
- color: isDisabled ? 'black.low' : 'black.high'
405
+ color: isDisabled ? 'black.medium' : 'black.high'
404
406
  }, children))), /*#__PURE__*/React__default.createElement(Box, {
405
407
  mt: "5px",
406
408
  ml: "24px"
407
409
  }, isError ? /*#__PURE__*/React__default.createElement(Text, {
410
+ as: "span",
411
+ display: "block",
408
412
  textStyle: "text.xs",
409
413
  color: "danger.500"
410
414
  }, errorText) : /*#__PURE__*/React__default.createElement(Text, {
415
+ as: "span",
416
+ display: "block",
411
417
  textStyle: "text.xs",
412
418
  color: "black.medium"
413
419
  }, helpText)));
@@ -508,37 +514,104 @@ CheckboxGroupComponent.defaultProps = {
508
514
  errorMessage: ''
509
515
  };
510
516
 
511
- const IndeterminateCheckbox = ({
512
- indeterminate = false,
517
+ const Chips = ({
518
+ children,
513
519
  ...rest
514
520
  }) => {
515
- const ref = useRef(null);
521
+ const {
522
+ isActive,
523
+ isDisabled,
524
+ onClose
525
+ } = rest;
526
+ const styles = useStyleConfig('Chips', rest);
527
+ const closeColor = useMemo(() => {
528
+ if (isActive) return 'white.high';
529
+ if (isDisabled) return 'black.low';
530
+ return 'primary.500';
531
+ }, [isActive, isDisabled]);
532
+ return /*#__PURE__*/React__default.createElement(Box, Object.assign({
533
+ __css: styles,
534
+ display: "inline-flex",
535
+ alignItems: "center",
536
+ justifyContent: "center"
537
+ }, rest), children, onClose && /*#__PURE__*/React__default.createElement(Box, {
538
+ onClick: isDisabled ? undefined : onClose,
539
+ cursor: isDisabled ? 'not-allowed' : 'pointer',
540
+ ml: 2,
541
+ display: "flex",
542
+ alignItems: "center",
543
+ justifyContent: "center"
544
+ }, /*#__PURE__*/React__default.createElement(Close, {
545
+ color: closeColor,
546
+ size: 4
547
+ })));
548
+ };
549
+ Chips.defaultProps = {
550
+ isDisabled: false,
551
+ isActive: false,
552
+ onClose: undefined,
553
+ children: undefined,
554
+ size: 'sm'
555
+ };
556
+
557
+ const useCombinedRefs = (...refs) => {
558
+ const targetRef = useRef();
516
559
  useEffect(() => {
517
- if (ref.current && typeof indeterminate === 'boolean') {
518
- ref.current.indeterminate = !rest.checked && indeterminate;
560
+ refs.forEach(ref => {
561
+ /* eslint-disable no-param-reassign */
562
+ if (!ref) return;
563
+ if (typeof ref === 'function') {
564
+ ref(targetRef.current);
565
+ } else {
566
+ ref.current = targetRef.current;
567
+ }
568
+ });
569
+ }, [refs]);
570
+ return targetRef;
571
+ };
572
+ const IndeterminateCheckbox = /*#__PURE__*/forwardRef$2(({
573
+ isIndeterminate,
574
+ isChecked,
575
+ ...rest
576
+ }, ref) => {
577
+ const defaultRef = useRef(null);
578
+ const combinedRef = useCombinedRefs(ref, defaultRef);
579
+ useEffect(() => {
580
+ if (combinedRef !== null && combinedRef !== void 0 && combinedRef.current) {
581
+ combinedRef.current.indeterminate = isIndeterminate !== null && isIndeterminate !== void 0 ? isIndeterminate : false;
519
582
  }
520
- }, [ref, indeterminate]);
521
- return /*#__PURE__*/createElement(Flex, {
522
- align: "center"
523
- }, /*#__PURE__*/createElement("input", Object.assign({
524
- type: "checkbox",
525
- ref: ref
526
- }, rest)));
583
+ }, [combinedRef, isIndeterminate]);
584
+ return /*#__PURE__*/React__default.createElement(Checkbox$1, Object.assign({
585
+ ref: combinedRef,
586
+ focusBorderColor: "0",
587
+ isIndeterminate: isIndeterminate,
588
+ isChecked: isChecked,
589
+ inputProps: {
590
+ 'data-test-id': `CT_component_indeterminate-checkbox_${rest.id || rest.name}`
591
+ }
592
+ }, rest));
593
+ });
594
+ IndeterminateCheckbox.displayName = 'IndeterminateCheckbox';
595
+ IndeterminateCheckbox.defaultProps = {
596
+ isIndeterminate: false
527
597
  };
528
598
 
529
599
  /* eslint-disable react-hooks/rules-of-hooks */
530
- const DataTable = ({
531
- columns,
532
- dataSource = [],
533
- isLoading,
534
- withSelectedRow,
535
- onSelectedRow,
536
- onSort,
537
- manualSorting,
538
- sortingState,
539
- styles,
540
- ...props
541
- }) => {
600
+ const DataTable = /*#__PURE__*/forwardRef$2((props, ref) => {
601
+ const {
602
+ columns,
603
+ dataSource = [],
604
+ isLoading,
605
+ withSelectedRow,
606
+ onSelectedRow,
607
+ onSort,
608
+ sortDescFirst,
609
+ styles,
610
+ sortingState,
611
+ headerSticky,
612
+ manualSorting,
613
+ onRowClick
614
+ } = props;
542
615
  const [sorting, setSorting] = useState(sortingState !== null && sortingState !== void 0 ? sortingState : []);
543
616
  const [rowSelection, onRowSelectionChange] = useState({});
544
617
  const dataColumns = useMemo(() => columns, [columns]);
@@ -546,14 +619,18 @@ const DataTable = ({
546
619
  id: 'select',
547
620
  header: ({
548
621
  table
549
- }) => /*#__PURE__*/createElement(IndeterminateCheckbox, Object.assign({}, {
622
+ }) => /*#__PURE__*/createElement(IndeterminateCheckbox, Object.assign({
623
+ name: "select-header"
624
+ }, {
550
625
  checked: table.getIsAllRowsSelected(),
551
626
  indeterminate: table.getIsSomeRowsSelected(),
552
627
  onChange: table.getToggleAllRowsSelectedHandler()
553
628
  })),
554
629
  cell: ({
555
630
  row
556
- }) => /*#__PURE__*/createElement(IndeterminateCheckbox, Object.assign({}, {
631
+ }) => /*#__PURE__*/createElement(IndeterminateCheckbox, Object.assign({
632
+ name: `select-${row.index}`
633
+ }, {
557
634
  checked: row.getIsSelected(),
558
635
  indeterminate: row.getIsSomeSelected(),
559
636
  onChange: row.getToggleSelectedHandler()
@@ -577,24 +654,31 @@ const DataTable = ({
577
654
  getCoreRowModel: getCoreRowModel(),
578
655
  getSortedRowModel: getSortedRowModel(),
579
656
  manualPagination: true,
580
- sortDescFirst: true,
657
+ manualSorting,
658
+ sortDescFirst,
581
659
  state: {
582
660
  sorting,
583
661
  rowSelection
584
662
  },
585
663
  onRowSelectionChange,
586
- onSortingChange,
587
- manualSorting
664
+ onSortingChange
588
665
  });
666
+ const {
667
+ getSelectedRowModel,
668
+ toggleAllRowsSelected
669
+ } = table;
589
670
  const {
590
671
  flatRows
591
- } = table.getSelectedRowModel();
672
+ } = getSelectedRowModel();
592
673
  useEffect(() => {
593
674
  const rowData = flatRows.map(row => row.original);
594
675
  if (onSelectedRow) {
595
676
  onSelectedRow(rowData);
596
677
  }
597
678
  }, [flatRows]);
679
+ useImperativeHandle(ref, () => ({
680
+ toggleAllRowsSelected
681
+ }));
598
682
  return /*#__PURE__*/createElement(Box, Object.assign({}, props), isLoading && /*#__PURE__*/createElement(Flex, {
599
683
  w: "100%",
600
684
  h: "100%",
@@ -607,7 +691,12 @@ const DataTable = ({
607
691
  color: "primary.500",
608
692
  thickness: "4px",
609
693
  size: "lg"
610
- })), /*#__PURE__*/createElement(Table, Object.assign({}, styles === null || styles === void 0 ? void 0 : styles.table), /*#__PURE__*/createElement(Thead, Object.assign({}, styles === null || styles === void 0 ? void 0 : styles.tableHead), table.getHeaderGroups().map(headerGroup => /*#__PURE__*/createElement(Tr, Object.assign({
694
+ })), /*#__PURE__*/createElement(Table, Object.assign({}, styles === null || styles === void 0 ? void 0 : styles.table), /*#__PURE__*/createElement(Thead, Object.assign({}, (headerSticky ? {
695
+ position: 'sticky',
696
+ top: 0,
697
+ bg: 'white',
698
+ zIndex: 1
699
+ } : {})), table.getHeaderGroups().map(headerGroup => /*#__PURE__*/createElement(Tr, Object.assign({
611
700
  key: headerGroup.id,
612
701
  bg: useColorModeValue('initial', 'ebony-clay.700')
613
702
  }, styles === null || styles === void 0 ? void 0 : styles.tableRow), headerGroup.headers.map(header => {
@@ -639,21 +728,27 @@ const DataTable = ({
639
728
  h: 2
640
729
  }))));
641
730
  })))), /*#__PURE__*/createElement(Tbody, Object.assign({}, styles === null || styles === void 0 ? void 0 : styles.tableBody), table.getRowModel().rows.map(row => /*#__PURE__*/createElement(Tr, Object.assign({
731
+ "data-test-id": "6aZAeefGHBA2oG1wLuv-L",
642
732
  key: row.id
643
733
  }, styles === null || styles === void 0 ? void 0 : styles.tableRow, {
644
734
  css: css`
645
- &:last-child {
646
- td {
647
- border-bottom: none;
735
+ &:last-child {
736
+ td {
737
+ border-bottom: none;
738
+ }
648
739
  }
649
- }
650
- `
740
+ `,
741
+ onClick: () => {
742
+ if (onRowClick) {
743
+ onRowClick(row.original);
744
+ }
745
+ }
651
746
  }), row.getVisibleCells().map(cell => /*#__PURE__*/createElement(Td, Object.assign({
652
747
  key: cell.id,
653
748
  fontSize: "text.sm",
654
749
  color: useColorModeValue('dark.800', 'dark.300')
655
750
  }, styles === null || styles === void 0 ? void 0 : styles.tableCell), flexRender(cell.column.columnDef.cell, cell.getContext()))))))));
656
- };
751
+ });
657
752
  /* eslint-disable react/default-props-match-prop-types */
658
753
  DataTable.defaultProps = {
659
754
  withSelectedRow: false,
@@ -667,7 +762,10 @@ DataTable.defaultProps = {
667
762
  onSelectedRow: undefined,
668
763
  onSort: undefined,
669
764
  manualSorting: false,
670
- sortingState: []
765
+ sortingState: [],
766
+ sortDescFirst: false,
767
+ headerSticky: false,
768
+ onRowClick: undefined
671
769
  };
672
770
 
673
771
  const getProperties = props => {
@@ -2900,15 +2998,21 @@ function RadioComponent({
2900
2998
  }, rest, {
2901
2999
  isDisabled: isDisabled
2902
3000
  }), children && /*#__PURE__*/React__default.createElement(Text, {
3001
+ as: "span",
3002
+ display: "block",
2903
3003
  textStyle: "text.sm",
2904
- color: isDisabled ? 'black.low' : 'black.high'
3004
+ color: isDisabled ? 'black.medium' : 'black.high'
2905
3005
  }, children))), /*#__PURE__*/React__default.createElement(Box, {
2906
3006
  mt: "5px",
2907
3007
  ml: "24px"
2908
3008
  }, isError ? /*#__PURE__*/React__default.createElement(Text, {
3009
+ as: "span",
3010
+ display: "block",
2909
3011
  textStyle: "text.xs",
2910
3012
  color: "danger.500"
2911
3013
  }, errorText) : /*#__PURE__*/React__default.createElement(Text, {
3014
+ as: "span",
3015
+ display: "block",
2912
3016
  textStyle: "text.xs",
2913
3017
  color: "black.medium"
2914
3018
  }, helpText)));
@@ -3834,8 +3938,7 @@ const baseStyle$1 = /*#__PURE__*/definePartsStyle$1({
3834
3938
  border: '1px solid'
3835
3939
  },
3836
3940
  icon: {
3837
- color: 'neutral.50',
3838
- width: '9px'
3941
+ color: 'neutral.50'
3839
3942
  },
3840
3943
  label: {
3841
3944
  fontWeight: '400',
@@ -3844,8 +3947,8 @@ const baseStyle$1 = /*#__PURE__*/definePartsStyle$1({
3844
3947
  ml: '8px'
3845
3948
  },
3846
3949
  _disabled: {
3847
- background: 'neutral.500',
3848
- border: '1px solid',
3950
+ background: 'neutral.200',
3951
+ border: '0',
3849
3952
  borderColor: 'neutral.500',
3850
3953
  cursor: 'not-allowed'
3851
3954
  }
@@ -3868,11 +3971,14 @@ const errors = /*#__PURE__*/definePartsStyle$1({
3868
3971
  },
3869
3972
  label: {
3870
3973
  fontSize: '12px'
3974
+ },
3975
+ icon: {
3976
+ fontSize: '7px'
3871
3977
  }
3872
3978
  });
3873
3979
  const unstyled = /*#__PURE__*/definePartsStyle$1({
3874
3980
  control: {
3875
- borderColor: 'neutral.500',
3981
+ borderColor: 'neutral.600',
3876
3982
  _checked: {
3877
3983
  borderColor: 'primary.500',
3878
3984
  backgroundColor: 'primary.500',
@@ -3881,21 +3987,33 @@ const unstyled = /*#__PURE__*/definePartsStyle$1({
3881
3987
  backgroundColor: 'primary.600'
3882
3988
  },
3883
3989
  _disabled: {
3884
- backgroundColor: 'neutral.500',
3885
- borderColor: 'neutral.500'
3990
+ backgroundColor: 'primary.500',
3991
+ borderColor: 'primary.500',
3992
+ opacity: 0.3
3886
3993
  }
3887
3994
  },
3888
3995
  _disabled: {
3889
- backgroundColor: 'neutral.500',
3890
- borderColor: 'neutral.500'
3996
+ backgroundColor: 'neutral.200',
3997
+ borderColor: 'neutral.200'
3891
3998
  },
3892
3999
  _indeterminate: {
3893
4000
  borderColor: 'primary.500',
3894
- backgroundColor: 'primary.500'
4001
+ backgroundColor: 'primary.500',
4002
+ _disabled: {
4003
+ backgroundColor: 'primary.500',
4004
+ borderColor: 'primary.500',
4005
+ opacity: 0.3
4006
+ }
3895
4007
  }
3896
4008
  },
3897
4009
  label: {
3898
- fontSize: '12px'
4010
+ fontSize: '12px',
4011
+ _disabled: {
4012
+ opacity: 1
4013
+ }
4014
+ },
4015
+ icon: {
4016
+ fontSize: '7px'
3899
4017
  }
3900
4018
  });
3901
4019
  const variants$1 = {
@@ -3910,7 +4028,7 @@ const Checkbox = /*#__PURE__*/defineMultiStyleConfig$1({
3910
4028
  }
3911
4029
  });
3912
4030
 
3913
- const Chips = /*#__PURE__*/defineStyleConfig({
4031
+ const Chips$1 = /*#__PURE__*/defineStyleConfig({
3914
4032
  baseStyle: props => {
3915
4033
  const {
3916
4034
  isDisabled,
@@ -4097,6 +4215,7 @@ const rotate = /*#__PURE__*/keyframes({
4097
4215
  const getLoaderColor = color => {
4098
4216
  if (color === 'primary') return colors.primary[600];
4099
4217
  if (color === 'danger') return colors.danger[500];
4218
+ if (color === 'warning') return colors.warning[700];
4100
4219
  return colors.white.high;
4101
4220
  };
4102
4221
  const LoaderStyle = /*#__PURE__*/defineStyleConfig({
@@ -4208,7 +4327,8 @@ const baseStyle$4 = /*#__PURE__*/definePartsStyle$4({
4208
4327
  textStyle: 'text.sm',
4209
4328
  color: 'black.high',
4210
4329
  _disabled: {
4211
- color: 'black.low'
4330
+ opacity: 1,
4331
+ color: 'black.medium'
4212
4332
  }
4213
4333
  }
4214
4334
  });
@@ -4225,21 +4345,22 @@ const errors$1 = /*#__PURE__*/definePartsStyle$4({
4225
4345
  },
4226
4346
  _hover: {
4227
4347
  borderColor: 'danger.500',
4228
- bg: 'gray.200'
4348
+ bg: 'neutral.200'
4229
4349
  },
4230
4350
  _disabled: {
4231
4351
  borderColor: 'danger.500',
4232
- bg: 'white',
4352
+ bg: 'white.high',
4233
4353
  _before: {
4234
4354
  h: '10px',
4235
4355
  w: '10px',
4236
- bg: 'neutral.500'
4356
+ bg: 'primary.500',
4357
+ opacity: 0.3
4237
4358
  }
4238
4359
  }
4239
4360
  },
4240
4361
  _disabled: {
4241
4362
  borderColor: 'danger.500',
4242
- bg: 'neutral.500'
4363
+ bg: 'neutral.200'
4243
4364
  }
4244
4365
  },
4245
4366
  label: {
@@ -4262,18 +4383,19 @@ const unstyled$2 = /*#__PURE__*/definePartsStyle$4({
4262
4383
  bg: 'gray.200'
4263
4384
  },
4264
4385
  _disabled: {
4265
- borderColor: 'neutral.500',
4266
- bg: 'white',
4386
+ borderColor: 'primary.500',
4387
+ bg: 'white.high',
4388
+ opacity: 0.3,
4267
4389
  _before: {
4268
4390
  h: '10px',
4269
4391
  w: '10px',
4270
- bg: 'neutral.500'
4392
+ bg: 'primary.500'
4271
4393
  }
4272
4394
  }
4273
4395
  },
4274
4396
  _disabled: {
4275
- borderColor: 'neutral.500',
4276
- bg: 'neutral.500'
4397
+ borderColor: 'neutral.200',
4398
+ bg: 'neutral.200'
4277
4399
  }
4278
4400
  },
4279
4401
  label: {
@@ -4452,7 +4574,7 @@ var components = {
4452
4574
  Button: Button$1,
4453
4575
  Card: CardStyle,
4454
4576
  Checkbox: Checkbox,
4455
- Chips: Chips,
4577
+ Chips: Chips$1,
4456
4578
  FormLabel: FormLabel,
4457
4579
  Input: Input,
4458
4580
  LoaderStyle: LoaderStyle,
@@ -4520,5 +4642,34 @@ const Provider = ({
4520
4642
  };
4521
4643
  Provider.displayName = 'Provider';
4522
4644
 
4523
- export { Alert, AlertAction, AlertClose, AlertDescription, AlertIcon, AlertTitle, Badge, Box, BreadCrumb, Button, ButtonGroup, CardCustom as Card, CheckboxComponent as Checkbox, CheckboxGroupComponent as CheckboxGroup, Container, DataTable, DatePickerMonth, Datepicker, Field, Flex, Grid, Header, InputAddonLeft, InputAddonRight, InputField, List, Loader, Navigation as MainMenu, ModalBody, ModalCloseButton, ModalFooter, ModalHeader, MultiDatePickerMonth, Pagination, PaginationDetail, PaginationFilter, Provider, ProviderContext, RadioComponent as Radio, RadioGroupComponent as RadioGroup, Rating, Select, SelectAsync, SelectAsyncCreatable, SelectCreatable, Stack, Switch, Tab, TabList, TabPanel, Text, TextareaField, Uploader, Wrap, foundations, theme, useAlertStyles, useInternalUI };
4645
+ function useFetcher() {
4646
+ const {
4647
+ instance
4648
+ } = useInternalUI();
4649
+ const axiosInstance = useMemo(() => instance || axios, [instance]);
4650
+ const fetcher = async ({
4651
+ url,
4652
+ data,
4653
+ method,
4654
+ headers,
4655
+ ...config
4656
+ }) => {
4657
+ const response = await axiosInstance.request({
4658
+ data,
4659
+ url,
4660
+ method,
4661
+ headers: {
4662
+ 'Content-Type': 'application/json; charset=utf-8',
4663
+ ...headers
4664
+ },
4665
+ ...config
4666
+ });
4667
+ return response;
4668
+ };
4669
+ return {
4670
+ fetcher
4671
+ };
4672
+ }
4673
+
4674
+ 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, Pagination, PaginationDetail, PaginationFilter, Provider, ProviderContext, RadioComponent as Radio, RadioGroupComponent as RadioGroup, Rating, Select, SelectAsync, SelectAsyncCreatable, SelectCreatable, Switch, Tab, TabList, TabPanel, TextareaField, Uploader, foundations, theme, useAlertStyles, useFetcher, useInternalUI };
4524
4675
  //# sourceMappingURL=internal-ui.esm.js.map