@ctlyst.id/internal-ui 2.0.2 → 2.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
- import { Badge as Badge$2, useToken, Box, Text, useColorModeValue, Breadcrumb, BreadcrumbItem, BreadcrumbLink, forwardRef, useStyleConfig, Button as Button$2, Card, Checkbox as Checkbox$1, FormControl, FormLabel as FormLabel$1, FormHelperText, FormErrorMessage, CheckboxGroup, Stack, Flex, Spinner, Table, Thead, Tr, Th, Tbody, Td, InputGroup, Input as Input$1, InputRightAddon, InputRightElement, theme as theme$1, defineStyle, Textarea as Textarea$1, Image, useDisclosure, Popover as Popover$1, HStack, VStack, PopoverTrigger, Avatar, PopoverContent, PopoverArrow, PopoverBody, useColorMode as useColorMode$1, Container, Grid, 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, omitThemingProps, useCheckbox, chakra, useTab, TabList as TabList$1, TabPanel as TabPanel$1, Heading, createMultiStyleConfigHelpers as createMultiStyleConfigHelpers$1, defineStyleConfig as defineStyleConfig$1, extendTheme } from '@chakra-ui/react';
1
+ import { Badge as Badge$2, useToken, Box, Text, useColorModeValue, Breadcrumb, BreadcrumbItem, BreadcrumbLink, forwardRef, useStyleConfig, Button as Button$2, 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, Container, Grid, 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, omitThemingProps, useCheckbox, chakra, useTab, TabList as TabList$1, TabPanel as TabPanel$1, Heading, createMultiStyleConfigHelpers as createMultiStyleConfigHelpers$1, defineStyleConfig as defineStyleConfig$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, forwardRef as forwardRef$1, useRef, useEffect, useState, useMemo, Fragment, useCallback, createContext, useContext } from 'react';
4
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';
@@ -474,6 +474,41 @@ DataTable.defaultProps = {
474
474
  sortingState: []
475
475
  };
476
476
 
477
+ const getProperties = props => {
478
+ const {
479
+ isError,
480
+ isDisabled,
481
+ isSuccess
482
+ } = props;
483
+ let outlineColor = 'neutral.400';
484
+ let focusColor = 'primary.500';
485
+ if (isError || isDisabled || isSuccess) {
486
+ if (isError) outlineColor = 'danger.500';else if (isSuccess) outlineColor = 'success.500';
487
+ focusColor = outlineColor;
488
+ }
489
+ return {
490
+ outlineColor,
491
+ focusColor
492
+ };
493
+ };
494
+ const getWrapperStyle = props => {
495
+ const {
496
+ outlineColor,
497
+ focusColor
498
+ } = getProperties(props);
499
+ const style = {
500
+ border: '1px solid',
501
+ borderColor: outlineColor,
502
+ borderRadius: 'md',
503
+ transition: 'all 0.15s',
504
+ boxShadow: 'none',
505
+ _focusWithin: {
506
+ borderColor: focusColor
507
+ }
508
+ };
509
+ return defineStyle(style);
510
+ };
511
+
477
512
  const Styles = () => {
478
513
  const {
479
514
  colorMode
@@ -1345,6 +1380,7 @@ const Datepicker = ({
1345
1380
  var _props$dateFormat;
1346
1381
  const selected = value ? new Date(value) : undefined;
1347
1382
  const dateFormat = ((_props$dateFormat = props.dateFormat) !== null && _props$dateFormat !== void 0 ? _props$dateFormat : withTime) ? 'yyyy-MM-dd HH:mm' : 'yyyy-MM-dd';
1383
+ const wrapperStyle = getWrapperStyle({});
1348
1384
  const getTimeProps = () => {
1349
1385
  if (!withTime) return {};
1350
1386
  return {
@@ -1357,9 +1393,9 @@ const Datepicker = ({
1357
1393
  id: id,
1358
1394
  name: name,
1359
1395
  selected: selected,
1360
- customInput: /*#__PURE__*/React__default.createElement(Input$1, {
1396
+ customInput: /*#__PURE__*/React__default.createElement(Input$1, Object.assign({
1361
1397
  autoComplete: "off"
1362
- }),
1398
+ }, wrapperStyle)),
1363
1399
  dateFormat: dateFormat,
1364
1400
  showPopperArrow: false,
1365
1401
  calendarClassName: classnames({
@@ -1908,45 +1944,10 @@ MultiDatePickerMonth.defaultProps = {
1908
1944
  isError: false
1909
1945
  };
1910
1946
 
1911
- const getProperties = props => {
1912
- const {
1913
- isError,
1914
- isDisabled,
1915
- isSuccess
1916
- } = props;
1917
- let outlineColor = 'neutral.400';
1918
- let focusColor = 'primary.500';
1919
- if (isError || isDisabled || isSuccess) {
1920
- if (isError) outlineColor = 'danger.500';else if (isSuccess) outlineColor = 'success.500';
1921
- focusColor = outlineColor;
1922
- }
1923
- return {
1924
- outlineColor,
1925
- focusColor
1926
- };
1927
- };
1928
- const getWrapperStyle = props => {
1929
- const {
1930
- outlineColor,
1931
- focusColor
1932
- } = getProperties(props);
1933
- const style = {
1934
- border: '1px solid',
1935
- borderColor: outlineColor,
1936
- borderRadius: 'md',
1937
- transition: 'all 0.15s',
1938
- boxShadow: 'none',
1939
- _focusWithin: {
1940
- borderColor: focusColor
1941
- }
1942
- };
1943
- return defineStyle(style);
1944
- };
1945
-
1946
1947
  const InputAddonLeft = ({
1947
1948
  children
1948
1949
  }) => {
1949
- return /*#__PURE__*/React__default.createElement(Box, {
1950
+ return /*#__PURE__*/React__default.createElement(InputLeftAddon, {
1950
1951
  borderLeftRadius: "md",
1951
1952
  backgroundColor: "neutral.200",
1952
1953
  px: 3,
@@ -1956,7 +1957,7 @@ const InputAddonLeft = ({
1956
1957
  const InputAddonRight = ({
1957
1958
  children
1958
1959
  }) => {
1959
- return /*#__PURE__*/React__default.createElement(Box, {
1960
+ return /*#__PURE__*/React__default.createElement(InputRightAddon, {
1960
1961
  borderRightRadius: "md",
1961
1962
  backgroundColor: "neutral.200",
1962
1963
  px: 3,
@@ -1970,8 +1971,6 @@ const InputField = /*#__PURE__*/React__default.forwardRef((props, ref) => {
1970
1971
  type,
1971
1972
  addOnLeft,
1972
1973
  addOnRight,
1973
- elementLeft,
1974
- elementRight,
1975
1974
  size,
1976
1975
  isRequired,
1977
1976
  label,
@@ -2015,7 +2014,7 @@ const InputField = /*#__PURE__*/React__default.forwardRef((props, ref) => {
2015
2014
  borderRadius: "md",
2016
2015
  backgroundColor: isDisabled ? 'neutral.300' : 'white.high',
2017
2016
  cursor: isDisabled ? 'not-allowed' : 'default'
2018
- }, addOnLeft && /*#__PURE__*/React__default.createElement(InputAddonLeft, null, addOnLeft), /*#__PURE__*/React__default.createElement(Input$1, Object.assign({
2017
+ }, addOnLeft, /*#__PURE__*/React__default.createElement(Input$1, Object.assign({
2019
2018
  ref: ref,
2020
2019
  type: inputType,
2021
2020
  value: value,
@@ -2062,13 +2061,11 @@ const InputField = /*#__PURE__*/React__default.forwardRef((props, ref) => {
2062
2061
  color: iconColor
2063
2062
  })), isLoading && /*#__PURE__*/React__default.createElement(Loader, {
2064
2063
  size: "sm"
2065
- })), "(", addOnRight && /*#__PURE__*/React__default.createElement(InputAddonRight, null, addOnRight))));
2064
+ })), addOnRight)));
2066
2065
  });
2067
2066
  InputField.defaultProps = {
2068
2067
  addOnLeft: undefined,
2069
2068
  addOnRight: undefined,
2070
- elementLeft: undefined,
2071
- elementRight: undefined,
2072
2069
  withClear: undefined,
2073
2070
  isLoading: undefined,
2074
2071
  onClear: undefined
@@ -4296,5 +4293,5 @@ const Provider = ({
4296
4293
  };
4297
4294
  Provider.displayName = 'Provider';
4298
4295
 
4299
- export { Badge, Box, BreadCrumb, Button, CardCustom as Card, CheckboxComponent as Checkbox, CheckboxGroupComponent as CheckboxGroup, Container, DataTable, DatePickerMonth, Datepicker, Field, Flex, Grid, Header, InputField, Loader, Navigation as MainMenu, ModalBody, ModalCloseButton, ModalFooter, ModalHeader, MultiDatePickerMonth, Pagination, PaginationDetail, PaginationFilter, Provider, ProviderContext, RadioComponent as Radio, RadioGroupComponent as RadioGroup, Select, SelectAsync, SelectAsyncCreatable, SelectCreatable, Stack, Switch, Tab, TabList, TabPanel, Text, TextareaField, Uploader, Wrap, foundations, theme, useInternalUI };
4296
+ export { Badge, Box, BreadCrumb, Button, CardCustom as Card, CheckboxComponent as Checkbox, CheckboxGroupComponent as CheckboxGroup, Container, DataTable, DatePickerMonth, Datepicker, Field, Flex, Grid, Header, InputAddonLeft, InputAddonRight, InputField, Loader, Navigation as MainMenu, ModalBody, ModalCloseButton, ModalFooter, ModalHeader, MultiDatePickerMonth, Pagination, PaginationDetail, PaginationFilter, Provider, ProviderContext, RadioComponent as Radio, RadioGroupComponent as RadioGroup, Select, SelectAsync, SelectAsyncCreatable, SelectCreatable, Stack, Switch, Tab, TabList, TabPanel, Text, TextareaField, Uploader, Wrap, foundations, theme, useInternalUI };
4300
4297
  //# sourceMappingURL=internal-ui.esm.js.map