@xqmsg/ui-core 0.11.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import React, { useMemo, useCallback, useRef, useState, useEffect } from 'react';
2
- import { Image, Alert as Alert$1, AlertDescription, Box, Flex, Button as Button$2, Text as Text$2, Icon as Icon$1, Spinner, InputGroup, Checkbox, Input as Input$2, RadioGroup, Radio, useOutsideClick, InputRightElement, Textarea as Textarea$1, Switch as Switch$1, FormLabel as FormLabel$1, FormControl, FormErrorMessage, FormHelperText, SimpleGrid, useMediaQuery, Grid, GridItem, IconButton, Collapse, TableContainer, Table as Table$1, Thead, Tr, Th, Tbody, Td, TableCaption, Tabs as Tabs$1, TabList, Tab, extendTheme, ChakraProvider } from '@chakra-ui/react';
2
+ import { Image, Alert as Alert$1, AlertDescription, Box, Flex, Button as Button$2, Text as Text$2, Icon as Icon$1, Spinner, InputGroup, Checkbox, Input as Input$2, RadioGroup, Radio, useOutsideClick, InputRightElement, Textarea as Textarea$1, Switch as Switch$1, FormLabel as FormLabel$1, FormControl, FormErrorMessage, FormHelperText, SimpleGrid, useMediaQuery, Grid, GridItem, IconButton, Collapse, TableContainer, Table as Table$2, Thead, Tr, Th, Tbody, Td, TableCaption, Tabs as Tabs$1, TabList, Tab, extendTheme, ChakraProvider } from '@chakra-ui/react';
3
3
  import colors$1 from 'src/theme/foundations/colors';
4
4
  import { FormProvider, useWatch, Controller } from 'react-hook-form';
5
5
  import { CloseIcon as CloseIcon$1, HamburgerIcon } from '@chakra-ui/icons';
@@ -1466,8 +1466,11 @@ var TableLoadingRows = function TableLoadingRows(_ref) {
1466
1466
  "aria-label": "Fetch more rows",
1467
1467
  icon: /*#__PURE__*/React.createElement(HiOutlineRefresh, null),
1468
1468
  fontSize: typography.fontSizes['3xl'],
1469
+ bg: "transparent",
1470
+ shadow: "none",
1471
+ color: colors.fill.action,
1469
1472
  type: "button",
1470
- variant: "link",
1473
+ variant: "outline",
1471
1474
  onClick: onLoadMore
1472
1475
  }));
1473
1476
  };
@@ -1483,24 +1486,19 @@ function Table(_ref) {
1483
1486
  _ref$placeholder = _ref.placeholder,
1484
1487
  placeholder = _ref$placeholder === void 0 ? 'There is currently no available data' : _ref$placeholder,
1485
1488
  loading = _ref.loading,
1486
- _ref$variant = _ref.variant,
1487
- variant = _ref$variant === void 0 ? 'simple' : _ref$variant,
1488
- colorScheme = _ref.colorScheme,
1489
1489
  _ref$borderTopRadius = _ref.borderTopRadius,
1490
1490
  borderTopRadius = _ref$borderTopRadius === void 0 ? true : _ref$borderTopRadius,
1491
1491
  loadMore = _ref.loadMore;
1492
1492
  var columnsAsConst = generateTableColumnsAsConst(columns);
1493
1493
  return /*#__PURE__*/React.createElement(TableContainer, {
1494
- border: "1px",
1495
- borderColor: colors.fill.light.quaternary,
1494
+ border: "none",
1496
1495
  overflowX: "auto",
1497
1496
  bg: "white",
1498
1497
  borderRadius: "md",
1499
1498
  borderTopLeftRadius: borderTopRadius ? 'md' : 0,
1500
1499
  borderTopRightRadius: borderTopRadius ? 'md' : 0
1501
- }, /*#__PURE__*/React.createElement(Table$1, {
1502
- variant: variant,
1503
- colorScheme: colorScheme
1500
+ }, /*#__PURE__*/React.createElement(Table$2, {
1501
+ variant: "unstyled"
1504
1502
  }, /*#__PURE__*/React.createElement(Thead, null, /*#__PURE__*/React.createElement(Tr, null, columnsAsConst.map(function (column) {
1505
1503
  return (
1506
1504
  /*#__PURE__*/
@@ -2358,7 +2356,37 @@ var Switch = {
2358
2356
  defaultProps: defaultProps$7
2359
2357
  };
2360
2358
 
2361
- var parts$7 = ['root', 'tablist', 'tab', 'tabpanel', 'indicator'];
2359
+ var parts$7 = ['th', 'td', 'tr', 'body'];
2360
+ var baseStyle$c = {
2361
+ th: {
2362
+ height: 'fit-content',
2363
+ width: '100%',
2364
+ bg: colors.label.primary.dark,
2365
+ padding: '5px 8px !important'
2366
+ },
2367
+ tr: {
2368
+ fontSize: '13px',
2369
+ display: 'flex',
2370
+ alignItems: 'center',
2371
+ width: '100%',
2372
+ height: 'fit-content',
2373
+ borderRadius: 'md',
2374
+ _odd: {
2375
+ background: colors.fill.light.tertiary
2376
+ }
2377
+ },
2378
+ td: {
2379
+ padding: '5px 8px !important',
2380
+ borderRadius: 'md',
2381
+ width: '100%'
2382
+ }
2383
+ };
2384
+ var Table$1 = {
2385
+ parts: parts$7,
2386
+ baseStyle: baseStyle$c
2387
+ };
2388
+
2389
+ var parts$8 = ['root', 'tablist', 'tab', 'tabpanel', 'indicator'];
2362
2390
 
2363
2391
  function baseStyleRoot(props) {
2364
2392
  var orientation = props.orientation;
@@ -2398,7 +2426,7 @@ var baseStyleTabpanel = {
2398
2426
  p: 4
2399
2427
  };
2400
2428
 
2401
- var baseStyle$c = function baseStyle(props) {
2429
+ var baseStyle$d = function baseStyle(props) {
2402
2430
  return {
2403
2431
  root: baseStyleRoot(props),
2404
2432
  tab: baseStyleTab(props),
@@ -2592,14 +2620,14 @@ var defaultProps$8 = {
2592
2620
  colorScheme: 'blue'
2593
2621
  };
2594
2622
  var Tabs = {
2595
- parts: parts$7,
2596
- baseStyle: baseStyle$c,
2623
+ parts: parts$8,
2624
+ baseStyle: baseStyle$d,
2597
2625
  sizes: sizes$2,
2598
2626
  variants: variants$8,
2599
2627
  defaultProps: defaultProps$8
2600
2628
  };
2601
2629
 
2602
- var baseStyle$d = /*#__PURE__*/_extends({}, Input$1.baseStyle.field, {
2630
+ var baseStyle$e = /*#__PURE__*/_extends({}, Input$1.baseStyle.field, {
2603
2631
  display: 'block',
2604
2632
  paddingY: '8px',
2605
2633
  height: '80px',
@@ -2610,12 +2638,12 @@ var defaultProps$9 = {
2610
2638
  variant: 'default'
2611
2639
  };
2612
2640
  var Textarea = {
2613
- baseStyle: baseStyle$d,
2641
+ baseStyle: baseStyle$e,
2614
2642
  defaultProps: defaultProps$9
2615
2643
  };
2616
2644
 
2617
2645
  var defaultProps$a = Text$2.defaultProps;
2618
- var baseStyle$e = {
2646
+ var baseStyle$f = {
2619
2647
  fontWeight: typography.fontWeights.normal,
2620
2648
  fontFamily: typography.fonts.base,
2621
2649
  fontSize: typography.fontSizes.sm,
@@ -2624,7 +2652,7 @@ var baseStyle$e = {
2624
2652
  };
2625
2653
 
2626
2654
  function variantHeader() {
2627
- return _extends({}, baseStyle$e, {
2655
+ return _extends({}, baseStyle$f, {
2628
2656
  fontWeight: typography.fontWeights.bold,
2629
2657
  fontSize: typography.fontSizes['3xl'],
2630
2658
  lineHeight: typography.lineHeights[8],
@@ -2633,7 +2661,7 @@ function variantHeader() {
2633
2661
  }
2634
2662
 
2635
2663
  function variantSubheader() {
2636
- return _extends({}, baseStyle$e, {
2664
+ return _extends({}, baseStyle$f, {
2637
2665
  fontWeight: typography.fontWeights.semibold,
2638
2666
  fontSize: typography.fontSizes['lg'],
2639
2667
  lineHeight: typography.lineHeights[5],
@@ -2642,7 +2670,7 @@ function variantSubheader() {
2642
2670
  }
2643
2671
 
2644
2672
  function variantParagraph() {
2645
- return baseStyle$e;
2673
+ return baseStyle$f;
2646
2674
  }
2647
2675
 
2648
2676
  var variants$9 = {
@@ -2651,7 +2679,7 @@ var variants$9 = {
2651
2679
  paragraph: variantParagraph
2652
2680
  };
2653
2681
  var Text$1 = {
2654
- baseStyle: baseStyle$e,
2682
+ baseStyle: baseStyle$f,
2655
2683
  variants: variants$9,
2656
2684
  defaultProps: /*#__PURE__*/_extends({}, defaultProps$a, {
2657
2685
  variant: variants$9.paragraph
@@ -2696,6 +2724,7 @@ var customXQChakraTheme = /*#__PURE__*/extendTheme( /*#__PURE__*/_extends({
2696
2724
  Modal: Modal,
2697
2725
  Select: Select,
2698
2726
  Switch: Switch,
2727
+ Table: Table$1,
2699
2728
  Tabs: Tabs,
2700
2729
  Textarea: Textarea,
2701
2730
  Text: Text$1