@ctlyst.id/internal-ui 1.0.4-canary.2 → 1.0.4-canary.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
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, theme as theme$1, 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, useTab, useMultiStyleConfig, TabList as TabList$1, TabPanel as TabPanel$1, Stack, Heading, createMultiStyleConfigHelpers as createMultiStyleConfigHelpers$1, extendTheme } 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, theme as theme$1, 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, createIcon, Icon, Portal, Link, forwardRef as forwardRef$1, Button as Button$1, VisuallyHidden, Select as Select$1, useTab, useMultiStyleConfig, TabList as TabList$1, TabPanel as TabPanel$1, Stack, Heading, createMultiStyleConfigHelpers as createMultiStyleConfigHelpers$1, extendTheme } from '@chakra-ui/react';
2
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
- import { FiChevronsRight, FiHome, FiCalendar, FiX, FiPower, FiMoon, FiSun, FiChevronDown } from 'react-icons/fi';
4
+ import { FiChevronsRight, FiHome, FiCalendar, FiX, FiPower, FiMoon, FiSun, FiShoppingBag, FiShoppingCart, FiRepeat, FiBox, FiLayers, FiDollarSign, FiUsers, FiRotateCcw, FiSettings, FiLayout, FiGift, FiChevronDown } from 'react-icons/fi';
5
5
  import { ChevronUpIcon, ChevronDownIcon, UpDownIcon, ArrowLeftIcon, ChevronLeftIcon, ChevronRightIcon, ArrowRightIcon } from '@chakra-ui/icons';
6
6
  import { css, Global } from '@emotion/react';
7
7
  import { useReactTable, getCoreRowModel, getSortedRowModel, flexRender } from '@tanstack/react-table';
@@ -1202,6 +1202,8 @@ const DatePickerMonth = ({
1202
1202
  onChange,
1203
1203
  min,
1204
1204
  max,
1205
+ widthEmpty,
1206
+ widthFilled,
1205
1207
  ...props
1206
1208
  }) => {
1207
1209
  const [date, setDate] = React__default.useState(null);
@@ -1214,14 +1216,11 @@ const DatePickerMonth = ({
1214
1216
  display: none;
1215
1217
  -webkit-appearance: none;
1216
1218
  }
1217
- input[value=''] {
1218
- width: 58px;
1219
- }
1220
1219
  `
1221
1220
  }, /*#__PURE__*/React__default.createElement(Input$1, {
1222
1221
  "data-test-id": props['data-test-id'],
1223
1222
  type: "date",
1224
- width: date ? '51px' : '58px',
1223
+ width: date ? widthFilled : widthEmpty,
1225
1224
  onChange: e => {
1226
1225
  onChange(e.target.value);
1227
1226
  setDate(e.target.value);
@@ -1246,7 +1245,9 @@ const DatePickerMonth = ({
1246
1245
  }));
1247
1246
  };
1248
1247
  DatePickerMonth.defaultProps = {
1249
- 'data-test-id': ''
1248
+ 'data-test-id': '',
1249
+ widthEmpty: '58px',
1250
+ widthFilled: '51px'
1250
1251
  };
1251
1252
 
1252
1253
  const transparent = 'transparent';
@@ -1656,7 +1657,9 @@ const MultiDatePickerMonth = ({
1656
1657
  onChange,
1657
1658
  isError = false,
1658
1659
  min = '2020-01-01',
1659
- max = '2020-12-31'
1660
+ max = '2020-12-31',
1661
+ widthEmpty,
1662
+ widthFilled
1660
1663
  }) => {
1661
1664
  const [date, setDate] = React__default.useState([null, null]);
1662
1665
  return /*#__PURE__*/React__default.createElement(MultiDateWrapper, {
@@ -1668,7 +1671,9 @@ const MultiDatePickerMonth = ({
1668
1671
  setDate([val, date[1]]);
1669
1672
  },
1670
1673
  min: min,
1671
- max: max
1674
+ max: max,
1675
+ widthEmpty: widthEmpty,
1676
+ widthFilled: widthFilled
1672
1677
  }), /*#__PURE__*/React__default.createElement(Box, null, "-"), /*#__PURE__*/React__default.createElement(DatePickerMonth, {
1673
1678
  "data-test-id": "CT_DatePickerMonth_EndDate",
1674
1679
  onChange: val => {
@@ -1676,13 +1681,17 @@ const MultiDatePickerMonth = ({
1676
1681
  setDate([date[0], val]);
1677
1682
  },
1678
1683
  min: min,
1679
- max: max
1684
+ max: max,
1685
+ widthEmpty: widthEmpty,
1686
+ widthFilled: widthFilled
1680
1687
  }));
1681
1688
  };
1682
1689
  MultiDatePickerMonth.defaultProps = {
1683
1690
  min: '2020-01-01',
1684
1691
  max: '2020-12-31',
1685
- isError: false
1692
+ isError: false,
1693
+ widthEmpty: '58px',
1694
+ widthFilled: '51px'
1686
1695
  };
1687
1696
 
1688
1697
  /* eslint-disable no-nested-ternary */
@@ -2001,6 +2010,28 @@ const ModalHeader = /*#__PURE__*/forwardRef(({
2001
2010
  }, rest), children);
2002
2011
  });
2003
2012
 
2013
+ const CustomerIcon = /*#__PURE__*/createIcon({
2014
+ displayName: 'CustomerIcon',
2015
+ viewBox: '0 0 16 16',
2016
+ path: [/*#__PURE__*/React__default.createElement("path", {
2017
+ fill: "currentColor",
2018
+ fillRule: "inherit",
2019
+ d: "M8 2a6 6 0 1 0 0 12A6 6 0 0 0 8 2ZM.667 8a7.333 7.333 0 1 1 14.666 0A7.333 7.333 0 0 1 .667 8Z",
2020
+ clipRule: "inherit"
2021
+ }), /*#__PURE__*/React__default.createElement("path", {
2022
+ fill: "currentColor",
2023
+ d: "M12.416 12.698a1.997 1.997 0 0 0-1.75-1.031H5.334a2 2 0 0 0-1.864 1.277 7.722 7.722 0 0 1-.943-1.074 3.329 3.329 0 0 1 2.807-1.537h5.334a3.333 3.333 0 0 1 2.703 1.384c-.275.325-.594.66-.954.98Z"
2024
+ }), /*#__PURE__*/React__default.createElement("path", {
2025
+ fill: "currentColor",
2026
+ fillRule: "inherit",
2027
+ d: "M8 5.333A1.333 1.333 0 1 0 8 8a1.333 1.333 0 0 0 0-2.667ZM5.333 6.667a2.667 2.667 0 1 1 5.334 0 2.667 2.667 0 0 1-5.334 0Z",
2028
+ clipRule: "inherit"
2029
+ })]
2030
+ });
2031
+
2032
+ /* eslint-disable import/prefer-default-export */
2033
+ const mappingIcon = /*#__PURE__*/new Map([['Order', FiShoppingBag], ['Fulfillment', FiShoppingCart], ['Transfer Stock', FiRepeat], ['Stock', FiBox], ['Product Database', FiLayers], ['Purchasing', FiDollarSign], ['Reseller', FiUsers], ['Retur', FiRotateCcw], ['Other', FiSettings], ['Content', FiLayout], ['Voucher', FiGift], ['Customer', CustomerIcon]]);
2034
+
2004
2035
  /* eslint-disable react-hooks/rules-of-hooks */
2005
2036
  const Navigation = ({
2006
2037
  navigations,
@@ -2040,7 +2071,7 @@ const Navigation = ({
2040
2071
  color: isActive ? 'white' : 'inherit',
2041
2072
  p: 2
2042
2073
  }, /*#__PURE__*/createElement(Icon, {
2043
- as: navigation.icon,
2074
+ as: mappingIcon.get(navigation.title),
2044
2075
  mr: 2
2045
2076
  }), /*#__PURE__*/createElement(Text, {
2046
2077
  whiteSpace: "nowrap",
@@ -2060,8 +2091,7 @@ const Navigation = ({
2060
2091
  }, navigation.children.map(({
2061
2092
  title,
2062
2093
  navHost,
2063
- navLink,
2064
- icon
2094
+ navLink
2065
2095
  }) => {
2066
2096
  const link = navHost ? `${navHost}${navLink}` : navLink;
2067
2097
  const isLocalLink = host === navHost;
@@ -2098,7 +2128,7 @@ const Navigation = ({
2098
2128
  px: 6,
2099
2129
  py: 4
2100
2130
  }, /*#__PURE__*/createElement(Icon, {
2101
- as: icon,
2131
+ as: mappingIcon.get(navigation.title),
2102
2132
  mr: 3
2103
2133
  }), /*#__PURE__*/createElement(Text, {
2104
2134
  fontSize: "text.sm"