@ctlyst.id/internal-ui 2.0.3 → 2.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
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
- 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';
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, InputLeftElement as InputElementLeft, InputRightElement as InputElementRight, 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';
5
5
  import { ChevronUpIcon, ChevronDownIcon, UpDownIcon, ArrowLeftIcon, ChevronLeftIcon, ChevronRightIcon, ArrowRightIcon } from '@chakra-ui/icons';
@@ -223,7 +223,6 @@ CheckboxComponent.defaultProps = {
223
223
  errorText: ''
224
224
  };
225
225
 
226
- /* eslint-disable no-nested-ternary */
227
226
  const Field = props => {
228
227
  const {
229
228
  label,
@@ -233,7 +232,8 @@ const Field = props => {
233
232
  rightHelperText,
234
233
  isRequired,
235
234
  children,
236
- isSuccess
235
+ isSuccess,
236
+ boxProps = {}
237
237
  } = props;
238
238
  const getHelperColor = () => {
239
239
  if (isError) return 'danger.500';
@@ -246,9 +246,9 @@ const Field = props => {
246
246
  };
247
247
  const helperColor = getHelperColor();
248
248
  const justifyHelper = getJustifyContentHelper();
249
- return /*#__PURE__*/React__default.createElement(FormControl, {
249
+ return /*#__PURE__*/React__default.createElement(FormControl, Object.assign({
250
250
  isInvalid: isError
251
- }, label && (typeof label === 'string' ? /*#__PURE__*/React__default.createElement(FormLabel$1, {
251
+ }, boxProps), label && (typeof label === 'string' ? /*#__PURE__*/React__default.createElement(FormLabel$1, {
252
252
  mb: 1,
253
253
  fontSize: "text.sm",
254
254
  requiredIndicator: undefined
@@ -261,19 +261,19 @@ const Field = props => {
261
261
  display: "flex",
262
262
  width: "full",
263
263
  justifyContent: justifyHelper
264
- }, !isError ? leftHelperText && /*#__PURE__*/React__default.createElement(FormHelperText, {
264
+ }, !isError ? leftHelperText && (typeof leftHelperText === 'string' ? /*#__PURE__*/React__default.createElement(FormHelperText, {
265
265
  fontSize: "text.xs",
266
266
  color: helperColor,
267
267
  mt: 1
268
- }, leftHelperText) : typeof errorMessage === 'string' ? /*#__PURE__*/React__default.createElement(FormErrorMessage, {
268
+ }, leftHelperText) : leftHelperText) : typeof errorMessage === 'string' ? /*#__PURE__*/React__default.createElement(FormErrorMessage, {
269
269
  fontSize: "text.xs",
270
270
  color: "danger.500",
271
271
  mt: 1
272
- }, errorMessage) : errorMessage, rightHelperText && /*#__PURE__*/React__default.createElement(FormHelperText, {
272
+ }, errorMessage) : errorMessage, rightHelperText && (typeof rightHelperText === 'string' ? /*#__PURE__*/React__default.createElement(FormHelperText, {
273
273
  fontSize: "text.xs",
274
274
  color: helperColor,
275
275
  mt: 1
276
- }, rightHelperText)));
276
+ }, rightHelperText) : rightHelperText)));
277
277
  };
278
278
  Field.defaultProps = {
279
279
  label: '',
@@ -282,7 +282,8 @@ Field.defaultProps = {
282
282
  errorMessage: undefined,
283
283
  leftHelperText: undefined,
284
284
  rightHelperText: undefined,
285
- isRequired: false
285
+ isRequired: false,
286
+ boxProps: {}
286
287
  };
287
288
 
288
289
  function CheckboxGroupComponent(props) {