@ctlyst.id/internal-ui 1.0.2-canary.4 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
- import { useToken, Box, Text, useColorModeValue, Breadcrumb, BreadcrumbItem, BreadcrumbLink, Flex, Spinner, Table, Thead, Tr, Th, Tbody, Td, InputGroup, Input as Input$1, InputRightAddon, FormControl, FormLabel as FormLabel$1, InputRightElement, FormHelperText, FormErrorMessage, InputLeftAddon, InputLeftElement, Textarea as Textarea$1, Image, useDisclosure, Popover as Popover$1, HStack, VStack, PopoverTrigger, Avatar, PopoverContent, PopoverArrow, PopoverBody, useColorMode as useColorMode$1, Badge, ModalCloseButton as ModalCloseButton$1, ModalFooter as ModalFooter$1, ModalHeader as ModalHeader$1, Icon, Portal, Link, forwardRef as forwardRef$1, Button as Button$1, VisuallyHidden, Select as Select$1, theme as theme$1, useTab, useMultiStyleConfig, TabList as TabList$1, TabPanel as TabPanel$1, Stack, Heading, createMultiStyleConfigHelpers as createMultiStyleConfigHelpers$1, extendTheme } from '@chakra-ui/react';
2
- 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, Modal, ModalBody, ModalContent, ModalContextProvider, ModalFocusScope, ModalOverlay, TabIndicator, TabPanels, Tabs, TabsDescendantsProvider, TabsProvider, useDrawerContext, useModal, useModalContext, useModalStyles, useTab, useTabIndicator, useTabList, useTabPanel, useTabPanels, useTabs, useTabsContext, useTabsDescendant, useTabsDescendants, useTabsDescendantsContext, useTabsStyles } from '@chakra-ui/react';
1
+ import { useToken, Box, Text, useColorModeValue, Breadcrumb, BreadcrumbItem, BreadcrumbLink, Flex, Spinner, Table, Thead, Tr, Th, Tbody, Td, InputGroup, Input as Input$1, InputRightAddon, FormControl, FormLabel as FormLabel$1, InputRightElement, FormHelperText, FormErrorMessage, InputLeftAddon, InputLeftElement, Textarea as Textarea$1, Image, useDisclosure, Popover as Popover$1, HStack, VStack, PopoverTrigger, Avatar, PopoverContent, PopoverArrow, PopoverBody, useColorMode as useColorMode$1, Badge, ModalBody as ModalBody$1, ModalCloseButton as ModalCloseButton$1, ModalFooter as ModalFooter$1, ModalHeader as ModalHeader$1, Icon, Portal, Link, forwardRef as forwardRef$1, Button as Button$1, VisuallyHidden, Select as Select$1, theme as theme$1, useTab, useMultiStyleConfig, TabList as TabList$1, TabPanel as TabPanel$1, Stack, Heading, createMultiStyleConfigHelpers as createMultiStyleConfigHelpers$1, extendTheme } from '@chakra-ui/react';
2
+ 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, Modal, ModalContent, ModalContextProvider, ModalFocusScope, ModalOverlay, TabIndicator, TabPanels, Tabs, TabsDescendantsProvider, TabsProvider, useDrawerContext, useModal, useModalContext, useModalStyles, useTab, useTabIndicator, useTabList, useTabPanel, useTabPanels, useTabs, useTabsContext, useTabsDescendant, useTabsDescendants, useTabsDescendantsContext, useTabsStyles } from '@chakra-ui/react';
3
3
  import React__default, { createElement, useRef, useEffect, useState, useMemo, Fragment, forwardRef, useCallback, createContext, useContext } from 'react';
4
4
  import { FiChevronsRight, FiHome, FiCalendar, FiX, FiPower, FiMoon, FiSun, FiChevronDown } from 'react-icons/fi';
5
5
  import { ChevronUpIcon, ChevronDownIcon, UpDownIcon, ArrowLeftIcon, ChevronLeftIcon, ChevronRightIcon, ArrowRightIcon } from '@chakra-ui/icons';
@@ -10,8 +10,8 @@ import ReactDatePicker from 'react-datepicker';
10
10
  import { useColorMode } from '@chakra-ui/system';
11
11
  import ReactSelect from 'react-select';
12
12
  import { AsyncPaginate } from 'react-select-async-paginate';
13
- import ReactSelectCreatable from 'react-select/creatable';
14
13
  import ReactSelectAsyncCreatable from 'react-select/async-creatable';
14
+ import ReactSelectCreatable from 'react-select/creatable';
15
15
  import { useDropzone } from 'react-dropzone';
16
16
  import { mode, getColor } from '@chakra-ui/theme-tools';
17
17
  import { checkboxAnatomy, inputAnatomy, radioAnatomy, switchAnatomy, popoverAnatomy } from '@chakra-ui/anatomy';
@@ -225,9 +225,7 @@ const DataTable = ({
225
225
  textTransform: "capitalize",
226
226
  userSelect: "none",
227
227
  align: "center",
228
- justifyContent: "space-between",
229
- onClick: header.column.getToggleSortingHandler(),
230
- cursor: header.column.getCanSort() ? 'pointer' : 'default'
228
+ justifyContent: "space-between"
231
229
  }, /*#__PURE__*/createElement(Text, {
232
230
  fontSize: "text.sm",
233
231
  fontWeight: 400,
@@ -236,7 +234,9 @@ const DataTable = ({
236
234
  }, flexRender(header.column.columnDef.header, header.getContext())), /*#__PURE__*/createElement(Box, {
237
235
  as: "span",
238
236
  pl: "2",
239
- "data-test-id": `CT_Container_SortingIcon_${header.id}`
237
+ cursor: header.column.getCanSort() ? 'pointer' : 'default',
238
+ "data-test-id": `CT_Container_SortingIcon_${header.id}`,
239
+ onClick: header.column.getToggleSortingHandler()
240
240
  }, (_ref = header.column.getCanSort() && {
241
241
  asc: /*#__PURE__*/createElement(ChevronUpIcon, null),
242
242
  desc: /*#__PURE__*/createElement(ChevronDownIcon, null)
@@ -279,7 +279,7 @@ const Styles = () => {
279
279
  const {
280
280
  colorMode
281
281
  } = useColorMode();
282
- return React.createElement(Global, {
282
+ return /*#__PURE__*/React__default.createElement(Global, {
283
283
  styles: `
284
284
  @charset "UTF-8";
285
285
  .react-datepicker__year-read-view--down-arrow,
@@ -1202,19 +1202,19 @@ const Field = props => {
1202
1202
  isRequired,
1203
1203
  children
1204
1204
  } = props;
1205
- return React.createElement(FormControl, {
1205
+ return /*#__PURE__*/React__default.createElement(FormControl, {
1206
1206
  isInvalid: isError
1207
- }, label && (typeof label === 'string' ? React.createElement(FormLabel$1, {
1207
+ }, label && (typeof label === 'string' ? /*#__PURE__*/React__default.createElement(FormLabel$1, {
1208
1208
  fontSize: "field.sm",
1209
1209
  requiredIndicator: undefined
1210
- }, isRequired && React.createElement(Box, {
1210
+ }, isRequired && /*#__PURE__*/React__default.createElement(Box, {
1211
1211
  as: "span",
1212
1212
  color: "red.500",
1213
1213
  ml: 0,
1214
1214
  mr: 1
1215
- }, "*"), label) : label), children, !isError ? helperText && React.createElement(FormHelperText, {
1215
+ }, "*"), label) : label), children, !isError ? helperText && /*#__PURE__*/React__default.createElement(FormHelperText, {
1216
1216
  fontSize: "field.sm"
1217
- }, helperText) : typeof error === 'string' ? React.createElement(FormErrorMessage, {
1217
+ }, helperText) : typeof error === 'string' ? /*#__PURE__*/React__default.createElement(FormErrorMessage, {
1218
1218
  textStyle: "field.sm",
1219
1219
  fontSize: "field.sm",
1220
1220
  mt: 1,
@@ -1283,11 +1283,11 @@ TextareaField.defaultProps = {
1283
1283
  elementRight: undefined
1284
1284
  };
1285
1285
 
1286
- const XMSLogo = () => React.createElement(Image, {
1286
+ const XMSLogo = () => /*#__PURE__*/React__default.createElement(Image, {
1287
1287
  height: 8,
1288
1288
  src: useColorModeValue('https://assets.voila.id/xms/logo-xms.jpg', 'https://assets.voila.id/xms/logo-xms-dark.png')
1289
1289
  });
1290
- const VoilaLogo = () => React.createElement(Image, {
1290
+ const VoilaLogo = () => /*#__PURE__*/React__default.createElement(Image, {
1291
1291
  src: "https://s3.ap-southeast-1.amazonaws.com/assets.voila.id/xms/logo-voila-black.png?v=1",
1292
1292
  filter: useColorModeValue('none', 'invert(1)'),
1293
1293
  maxW: 24
@@ -1376,6 +1376,7 @@ const SwitchMode = () => {
1376
1376
  toggleColorMode
1377
1377
  } = useColorMode$1();
1378
1378
  return /*#__PURE__*/createElement(Box, {
1379
+ "data-test-id": "rhYuTDCiWkFqr96upiEEh",
1379
1380
  mx: 5,
1380
1381
  onClick: toggleColorMode,
1381
1382
  cursor: "pointer"
@@ -1464,8 +1465,18 @@ Header.defaultProps = {
1464
1465
  onOpenModalRelease: undefined
1465
1466
  };
1466
1467
 
1468
+ const ModalBody = /*#__PURE__*/React__default.forwardRef(({
1469
+ children,
1470
+ ...rest
1471
+ }, ref) => {
1472
+ return /*#__PURE__*/React__default.createElement(ModalBody$1, Object.assign({
1473
+ ref: ref,
1474
+ background: useColorModeValue('white', 'mirage.900')
1475
+ }, rest), children);
1476
+ });
1477
+
1467
1478
  const ModalCloseButton = /*#__PURE__*/forwardRef((props, ref) => {
1468
- return React.createElement(ModalCloseButton$1, Object.assign({
1479
+ return /*#__PURE__*/React__default.createElement(ModalCloseButton$1, Object.assign({
1469
1480
  ref: ref,
1470
1481
  top: 4,
1471
1482
  right: 4,
@@ -1478,7 +1489,7 @@ const ModalFooter = /*#__PURE__*/forwardRef(({
1478
1489
  children,
1479
1490
  ...rest
1480
1491
  }, ref) => {
1481
- return React.createElement(ModalFooter$1, Object.assign({
1492
+ return /*#__PURE__*/React__default.createElement(ModalFooter$1, Object.assign({
1482
1493
  ref: ref,
1483
1494
  background: useColorModeValue('neutral.200', 'mirage.900'),
1484
1495
  borderBottomRadius: "md"
@@ -1489,7 +1500,7 @@ const ModalHeader = /*#__PURE__*/forwardRef(({
1489
1500
  children,
1490
1501
  ...rest
1491
1502
  }, ref) => {
1492
- return React.createElement(ModalHeader$1, Object.assign({
1503
+ return /*#__PURE__*/React__default.createElement(ModalHeader$1, Object.assign({
1493
1504
  ref: ref,
1494
1505
  background: useColorModeValue('neutral.200', 'mirage.900'),
1495
1506
  borderTopRadius: 'md',
@@ -1618,7 +1629,7 @@ const PaginationButton = /*#__PURE__*/forwardRef$1(({
1618
1629
  const btnColor = useColorModeValue('black.high', 'primary.300');
1619
1630
  const btnNotActiveBg = useColorModeValue('secondary.50', 'primary.500');
1620
1631
  const btnNotActiveColor = useColorModeValue('primary.500', 'white');
1621
- return React.createElement(Button$1, Object.assign({
1632
+ return /*#__PURE__*/React__default.createElement(Button$1, Object.assign({
1622
1633
  "data-test-id": "Pagination-Button",
1623
1634
  ref: ref,
1624
1635
  className: className,
@@ -2312,7 +2323,7 @@ function Select({
2312
2323
  const {
2313
2324
  colorMode
2314
2325
  } = useColorMode();
2315
- return React.createElement(ReactSelect, Object.assign({}, rest, {
2326
+ return /*#__PURE__*/React__default.createElement(ReactSelect, Object.assign({}, rest, {
2316
2327
  styles: {
2317
2328
  ...selectStyles(colorMode),
2318
2329
  ...styles
@@ -2328,7 +2339,7 @@ function SelectAsync({
2328
2339
  const {
2329
2340
  colorMode
2330
2341
  } = useColorMode();
2331
- return React.createElement(AsyncPaginate, Object.assign({}, rest, {
2342
+ return /*#__PURE__*/React__default.createElement(AsyncPaginate, Object.assign({}, rest, {
2332
2343
  styles: {
2333
2344
  ...selectStyles(colorMode),
2334
2345
  ...styles
@@ -2337,14 +2348,14 @@ function SelectAsync({
2337
2348
  }));
2338
2349
  }
2339
2350
 
2340
- function SelectCreatable({
2351
+ function SelectAsyncCreatable({
2341
2352
  styles,
2342
2353
  ...rest
2343
2354
  }) {
2344
2355
  const {
2345
2356
  colorMode
2346
2357
  } = useColorMode();
2347
- return React.createElement(ReactSelectCreatable, Object.assign({}, rest, {
2358
+ return /*#__PURE__*/React__default.createElement(ReactSelectAsyncCreatable, Object.assign({}, rest, {
2348
2359
  styles: {
2349
2360
  ...selectStyles(colorMode),
2350
2361
  ...styles
@@ -2353,14 +2364,14 @@ function SelectCreatable({
2353
2364
  }));
2354
2365
  }
2355
2366
 
2356
- function SelectAsyncCreatable({
2367
+ function SelectCreatable({
2357
2368
  styles,
2358
2369
  ...rest
2359
2370
  }) {
2360
2371
  const {
2361
2372
  colorMode
2362
2373
  } = useColorMode();
2363
- return React.createElement(ReactSelectAsyncCreatable, Object.assign({}, rest, {
2374
+ return /*#__PURE__*/React__default.createElement(ReactSelectCreatable, Object.assign({}, rest, {
2364
2375
  styles: {
2365
2376
  ...selectStyles(colorMode),
2366
2377
  ...styles
@@ -2397,13 +2408,13 @@ const Tab = /*#__PURE__*/forwardRef$1((props, ref) => {
2397
2408
  })));
2398
2409
  });
2399
2410
 
2400
- const TabList = /*#__PURE__*/forwardRef$1((props, ref) => React.createElement(TabList$1, {
2411
+ const TabList = /*#__PURE__*/forwardRef$1((props, ref) => /*#__PURE__*/React__default.createElement(TabList$1, {
2401
2412
  borderBottom: "1px solid",
2402
2413
  borderColor: useColorModeValue('gray.200', 'bright-gray.800'),
2403
2414
  ref: ref
2404
2415
  }, props.children));
2405
2416
 
2406
- const TabPanel = /*#__PURE__*/forwardRef$1((props, ref) => React.createElement(TabPanel$1, {
2417
+ const TabPanel = /*#__PURE__*/forwardRef$1((props, ref) => /*#__PURE__*/React__default.createElement(TabPanel$1, {
2407
2418
  px: 0,
2408
2419
  ref: ref
2409
2420
  }, props.children));
@@ -2998,11 +3009,11 @@ const Provider = ({
2998
3009
  const provider = useMemo(() => ({
2999
3010
  instance: instanceRef.current
3000
3011
  }), []);
3001
- return React.createElement(ProviderContext.Provider, {
3012
+ return /*#__PURE__*/React__default.createElement(ProviderContext.Provider, {
3002
3013
  value: provider
3003
3014
  }, children);
3004
3015
  };
3005
3016
  Provider.displayName = 'Provider';
3006
3017
 
3007
- export { BreadCrumb, DataTable, Datepicker, Field, Header, InputField, Navigation as MainMenu, ModalCloseButton, ModalFooter, ModalHeader, Pagination, PaginationDetail, PaginationFilter, Provider, ProviderContext, Select, SelectAsync, SelectAsyncCreatable, SelectCreatable, Tab, TabList, TabPanel, TextareaField, Uploader, theme, useInternalUI };
3018
+ export { BreadCrumb, DataTable, Datepicker, Field, Header, InputField, Navigation as MainMenu, ModalBody, ModalCloseButton, ModalFooter, ModalHeader, Pagination, PaginationDetail, PaginationFilter, Provider, ProviderContext, Select, SelectAsync, SelectAsyncCreatable, SelectCreatable, Tab, TabList, TabPanel, TextareaField, Uploader, theme, useInternalUI };
3008
3019
  //# sourceMappingURL=internal-ui.esm.js.map