@paubox/ui 0.8.3 → 0.8.5

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.
package/index.esm.js CHANGED
@@ -1663,7 +1663,7 @@ function _templateObject5$3() {
1663
1663
  };
1664
1664
  return data;
1665
1665
  }
1666
- function _templateObject6$3() {
1666
+ function _templateObject6$2() {
1667
1667
  var data = _tagged_template_literal$o([
1668
1668
  "\n ",
1669
1669
  "\n font-size: ",
@@ -1671,7 +1671,7 @@ function _templateObject6$3() {
1671
1671
  "rem;\n letter-spacing: ",
1672
1672
  "px;\n font-weight: 600;\n"
1673
1673
  ]);
1674
- _templateObject6$3 = function _templateObject() {
1674
+ _templateObject6$2 = function _templateObject() {
1675
1675
  return data;
1676
1676
  };
1677
1677
  return data;
@@ -1930,7 +1930,7 @@ var $headline100Semibold = css(_templateObject2$a(), commonStyles, headline100Fo
1930
1930
  var $headline200Regular = css(_templateObject3$7(), commonStyles, headline200FontSize / BASE_FONT_SIZE, headline200LineHeight / BASE_FONT_SIZE, headline200LetterSpacing);
1931
1931
  var $headline200Semibold = css(_templateObject4$5(), commonStyles, headline200FontSize / BASE_FONT_SIZE, headline200LineHeight / BASE_FONT_SIZE, headline200LetterSpacing);
1932
1932
  var $headline300Regular = css(_templateObject5$3(), commonStyles, headline300FontSize / BASE_FONT_SIZE, headline300LineHeight / BASE_FONT_SIZE, headline300LetterSpacing);
1933
- var $headline300Semibold = css(_templateObject6$3(), commonStyles, headline300FontSize / BASE_FONT_SIZE, headline300LineHeight / BASE_FONT_SIZE, headline300LetterSpacing);
1933
+ var $headline300Semibold = css(_templateObject6$2(), commonStyles, headline300FontSize / BASE_FONT_SIZE, headline300LineHeight / BASE_FONT_SIZE, headline300LetterSpacing);
1934
1934
  // PARAGRAPH
1935
1935
  var $paragraph100Regular = css(_templateObject7$1(), commonStyles, paragraph100FontSize / BASE_FONT_SIZE, paragraph100LineHeight / BASE_FONT_SIZE, paragraph100LetterSpacing);
1936
1936
  var $paragraph100Semibold = css(_templateObject8$1(), commonStyles, paragraph100FontSize / BASE_FONT_SIZE, paragraph100LineHeight / BASE_FONT_SIZE, paragraph100LetterSpacing);
@@ -2100,12 +2100,12 @@ function _templateObject5$2() {
2100
2100
  };
2101
2101
  return data;
2102
2102
  }
2103
- function _templateObject6$2() {
2103
+ function _templateObject6$1() {
2104
2104
  var data = _tagged_template_literal$n([
2105
2105
  "\n background-color: ",
2106
2106
  ";\n "
2107
2107
  ]);
2108
- _templateObject6$2 = function _templateObject() {
2108
+ _templateObject6$1 = function _templateObject() {
2109
2109
  return data;
2110
2110
  };
2111
2111
  return data;
@@ -2154,7 +2154,7 @@ var AlertBar = function(props) {
2154
2154
  info: css(_templateObject3$6(), primary100),
2155
2155
  warning: css(_templateObject4$4(), warning100),
2156
2156
  error: css(_templateObject5$2(), danger100),
2157
- success: css(_templateObject6$2(), success100)
2157
+ success: css(_templateObject6$1(), success100)
2158
2158
  };
2159
2159
  var iconStyles = css(_templateObject7(), type === 'info' ? "".concat(primary700) : type === 'error' ? "".concat(danger700) : type === 'success' ? "".concat(success700) : "".concat(warning700));
2160
2160
  var textWrapperStyles = css(_templateObject8());
@@ -22539,15 +22539,16 @@ var IconButton = /*#__PURE__*/ forwardRef(function(_param, ref) {
22539
22539
  ]);
22540
22540
  return /*#__PURE__*/ jsx(BaseButton, _object_spread_props$f(_object_spread$j({
22541
22541
  style: _object_spread$j({
22542
- width: size === 'large' ? 40 : 32,
22543
- height: size === 'large' ? 40 : 32,
22542
+ width: size === 'large' ? 40 : size === 'small' ? 32 : 26,
22543
+ height: size === 'large' ? 40 : size === 'small' ? 32 : 26,
22544
22544
  padding: 0,
22545
- fontSize: fontSize || 16,
22546
22545
  borderRadius: circular ? '50%' : undefined
22547
22546
  }, style),
22548
22547
  ref: ref
22549
22548
  }, props), {
22550
- children: /*#__PURE__*/ jsx(Icon, {})
22549
+ children: /*#__PURE__*/ jsx(Icon, {
22550
+ fontSize: fontSize ? "".concat(fontSize, "px") : '16px'
22551
+ })
22551
22552
  }));
22552
22553
  });
22553
22554
 
@@ -22703,9 +22704,10 @@ var IconWrapper$2 = styled.span(_templateObject2$6(), function(param) {
22703
22704
  return position === 'right' ? '0.5rem' : 'auto';
22704
22705
  });
22705
22706
  var Input = function(_param) {
22706
- var LeftIcon = _param.leftIcon, RightIcon = _param.rightIcon, _param_sz = _param.sz, sz = _param_sz === void 0 ? 'sm' : _param_sz, _param_error = _param.error, error = _param_error === void 0 ? false : _param_error, style = _param.style, props = _object_without_properties$b(_param, [
22707
+ var LeftIcon = _param.leftIcon, RightIcon = _param.rightIcon, _param_clearable = _param.clearable, clearable = _param_clearable === void 0 ? false : _param_clearable, _param_sz = _param.sz, sz = _param_sz === void 0 ? 'sm' : _param_sz, _param_error = _param.error, error = _param_error === void 0 ? false : _param_error, style = _param.style, props = _object_without_properties$b(_param, [
22707
22708
  "leftIcon",
22708
22709
  "rightIcon",
22710
+ "clearable",
22709
22711
  "sz",
22710
22712
  "error",
22711
22713
  "style"
@@ -22724,6 +22726,25 @@ var Input = function(_param) {
22724
22726
  paddingRight: RightIcon ? '2.063rem' : '0.563rem'
22725
22727
  }, style)
22726
22728
  })),
22729
+ clearable && props.value && /*#__PURE__*/ jsx(IconButton, {
22730
+ onClick: function() {
22731
+ var _props_onChange;
22732
+ return props === null || props === void 0 ? void 0 : (_props_onChange = props.onChange) === null || _props_onChange === void 0 ? void 0 : _props_onChange.call(props, {
22733
+ target: {
22734
+ value: ''
22735
+ }
22736
+ });
22737
+ },
22738
+ icon: Close,
22739
+ circular: true,
22740
+ size: sz === 'lg' ? 'small' : 'xsmall',
22741
+ fontSize: sz === 'lg' ? 16 : 12,
22742
+ style: {
22743
+ position: 'absolute',
22744
+ right: RightIcon ? '2rem' : '0.5rem'
22745
+ },
22746
+ color: "secondary"
22747
+ }),
22727
22748
  RightIcon && /*#__PURE__*/ jsx(IconWrapper$2, {
22728
22749
  position: "right",
22729
22750
  children: /*#__PURE__*/ jsx(RightIcon, {})
@@ -22940,13 +22961,13 @@ function _templateObject5$1() {
22940
22961
  };
22941
22962
  return data;
22942
22963
  }
22943
- function _templateObject6$1() {
22964
+ function _templateObject6() {
22944
22965
  var data = _tagged_template_literal$d([
22945
22966
  "\n ",
22946
22967
  "\n color: ",
22947
22968
  "/80;\n"
22948
22969
  ]);
22949
- _templateObject6$1 = function _templateObject() {
22970
+ _templateObject6 = function _templateObject() {
22950
22971
  return data;
22951
22972
  };
22952
22973
  return data;
@@ -22998,7 +23019,7 @@ var MultiSelectChip = function(option) {
22998
23019
  };
22999
23020
  // Style for the Icons
23000
23021
  var IconWrapper$1 = styled.span(_templateObject5$1());
23001
- var PlaceholderOption = styled.option(_templateObject6$1(), $paragraph100Semibold, textSecondary);
23022
+ var PlaceholderOption = styled.option(_templateObject6(), $paragraph100Semibold, textSecondary);
23002
23023
  var MultiSelect = function(_param) {
23003
23024
  var _param_sz = _param.sz, sz = _param_sz === void 0 ? 'sm' : _param_sz; _param.error; var _param_options = _param.options, options = _param_options === void 0 ? [] : _param_options; _param.checkbox; var placeholder = _param.placeholder, initialValue = _param.initialValue, _param_type = _param.type, type = _param_type === void 0 ? 'primary' : _param_type, props = _object_without_properties$a(_param, [
23004
23025
  "sz",
@@ -23214,22 +23235,23 @@ var Loader = function() {
23214
23235
  });
23215
23236
  };
23216
23237
  var Search = function(_param) {
23217
- var loading = _param.loading, setLoading = _param.setLoading, setSearchValue = _param.setSearchValue, _param_sz = _param.sz, sz = _param_sz === void 0 ? 'sm' : _param_sz, props = _object_without_properties$9(_param, [
23238
+ var loading = _param.loading, setLoading = _param.setLoading, setSearchValue = _param.setSearchValue, _param_clearable = _param.clearable, clearable = _param_clearable === void 0 ? false : _param_clearable, _param_sz = _param.sz, sz = _param_sz === void 0 ? 'sm' : _param_sz, props = _object_without_properties$9(_param, [
23218
23239
  "loading",
23219
23240
  "setLoading",
23220
23241
  "setSearchValue",
23242
+ "clearable",
23221
23243
  "sz"
23222
23244
  ]);
23223
23245
  var _useState = _sliced_to_array$6(useState(''), 2), value = _useState[0], setValue = _useState[1];
23224
23246
  var debounceDelay = 1200;
23225
23247
  var handleChange = function(e) {
23226
- setLoading(true);
23248
+ setLoading === null || setLoading === void 0 ? void 0 : setLoading(true);
23227
23249
  setValue(e.target.value);
23228
23250
  };
23229
23251
  useEffect(function() {
23230
23252
  // Set a timeout for the debounce
23231
23253
  var handler = setTimeout(function() {
23232
- setLoading(false);
23254
+ setLoading === null || setLoading === void 0 ? void 0 : setLoading(false);
23233
23255
  setSearchValue(value);
23234
23256
  }, debounceDelay);
23235
23257
  return function() {
@@ -23242,6 +23264,7 @@ var Search = function(_param) {
23242
23264
  ]);
23243
23265
  return /*#__PURE__*/ jsx(Input, _object_spread$g({
23244
23266
  value: value,
23267
+ clearable: clearable,
23245
23268
  leftIcon: SearchIcon,
23246
23269
  rightIcon: loading ? Loader : undefined,
23247
23270
  onChange: handleChange,
@@ -31573,7 +31596,7 @@ function _tagged_template_literal$4(strings, raw) {
31573
31596
  }
31574
31597
  function _templateObject$4() {
31575
31598
  var data = _tagged_template_literal$4([
31576
- "\n width: 100%;\n table-layout: fixed;\n border-collapse: separate;\n border-spacing: 0;\n"
31599
+ "\n position: sticky;\n top: 0;\n z-index: 1;\n"
31577
31600
  ]);
31578
31601
  _templateObject$4 = function _templateObject() {
31579
31602
  return data;
@@ -31581,135 +31604,119 @@ function _templateObject$4() {
31581
31604
  return data;
31582
31605
  }
31583
31606
  function _templateObject1$4() {
31584
- var data = _tagged_template_literal$4([
31585
- "\n position: sticky;\n top: 0;\n z-index: 1;\n"
31586
- ]);
31587
- _templateObject1$4 = function _templateObject() {
31588
- return data;
31589
- };
31590
- return data;
31591
- }
31592
- function _templateObject2$2() {
31593
31607
  var data = _tagged_template_literal$4([
31594
31608
  "\n padding: ",
31595
31609
  "px;\n text-align: left;\n position: relative;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n background: ",
31596
31610
  ";\n border-bottom: 1px solid ",
31597
31611
  ";\n\n &:hover .pbui-table-resize-handle {\n height: 100%;\n }\n"
31598
31612
  ]);
31599
- _templateObject2$2 = function _templateObject() {
31613
+ _templateObject1$4 = function _templateObject() {
31600
31614
  return data;
31601
31615
  };
31602
31616
  return data;
31603
31617
  }
31604
- function _templateObject3$1() {
31618
+ function _templateObject2$2() {
31605
31619
  var data = _tagged_template_literal$4([
31606
31620
  "\n display: flex;\n align-items: center;\n overflow: hidden;\n text-overflow: ellipsis;\n"
31607
31621
  ]);
31608
- _templateObject3$1 = function _templateObject() {
31622
+ _templateObject2$2 = function _templateObject() {
31609
31623
  return data;
31610
31624
  };
31611
31625
  return data;
31612
31626
  }
31613
- function _templateObject4() {
31627
+ function _templateObject3$1() {
31614
31628
  var data = _tagged_template_literal$4([
31615
31629
  "\n position: absolute;\n right: 0;\n top: 0;\n display: flex;\n align-items: center;\n height: 100%;\n width: 6px;\n padding-right: 10px;\n"
31616
31630
  ]);
31617
- _templateObject4 = function _templateObject() {
31631
+ _templateObject3$1 = function _templateObject() {
31618
31632
  return data;
31619
31633
  };
31620
31634
  return data;
31621
31635
  }
31622
- function _templateObject5() {
31636
+ function _templateObject4() {
31623
31637
  var data = _tagged_template_literal$4([
31624
31638
  "\n position: absolute;\n height: 0%;\n width: 6px;\n background-color: ",
31625
31639
  ";\n cursor: col-resize;\n user-select: none;\n touch-action: none;\n transition: height ease 0.25s;\n"
31626
31640
  ]);
31627
- _templateObject5 = function _templateObject() {
31641
+ _templateObject4 = function _templateObject() {
31628
31642
  return data;
31629
31643
  };
31630
31644
  return data;
31631
31645
  }
31632
- function _templateObject6() {
31646
+ function _templateObject5() {
31633
31647
  var data = _tagged_template_literal$4([
31634
31648
  "\n font-size: 9px;\n display: inline-flex;\n flex-direction: column;\n margin-left: ",
31635
31649
  "px;\n align-items: center;\n\n & svg:first-of-type {\n margin-bottom: -1.5px;\n }\n & svg:last-of-type {\n margin-top: -1.5px;\n }\n"
31636
31650
  ]);
31637
- _templateObject6 = function _templateObject() {
31651
+ _templateObject5 = function _templateObject() {
31638
31652
  return data;
31639
31653
  };
31640
31654
  return data;
31641
31655
  }
31642
- var StyledTable$1 = styled.table(_templateObject$4());
31643
- var StyledHeader = styled.div(_templateObject1$4());
31644
- var Th = styled(Typography)(_templateObject2$2(), spacing(1), neutral100, neutral300);
31645
- var HeaderContent = styled.div(_templateObject3$1());
31646
- var ResizeHandleContainer = styled.div(_templateObject4());
31647
- var ResizeHandle = styled.div(_templateObject5(), neutral300);
31648
- var SortIcon = styled.span(_templateObject6(), spacing(1));
31656
+ var StyledHeader = styled.thead(_templateObject$4());
31657
+ var Th = styled(Typography)(_templateObject1$4(), spacing(1), neutral100, neutral300);
31658
+ var HeaderContent = styled.div(_templateObject2$2());
31659
+ var ResizeHandleContainer = styled.div(_templateObject3$1());
31660
+ var ResizeHandle = styled.div(_templateObject4(), neutral300);
31661
+ var SortIcon = styled.span(_templateObject5(), spacing(1));
31649
31662
  var TableHeader = function(param) {
31650
- var table = param.table, columnWidths = param.columnWidths, disableControls = param.disableControls, dense = param.dense;
31663
+ var table = param.table, disableControls = param.disableControls, dense = param.dense;
31651
31664
  return /*#__PURE__*/ jsx(StyledHeader, {
31652
- children: /*#__PURE__*/ jsxs(StyledTable$1, {
31653
- children: [
31654
- /*#__PURE__*/ jsx("colgroup", {
31655
- children: columnWidths.map(function(param) {
31656
- var id = param.id, width = param.width;
31657
- return /*#__PURE__*/ jsx("col", {
31658
- style: {
31659
- width: "".concat(width, "px")
31660
- }
31661
- }, id);
31662
- })
31663
- }),
31664
- /*#__PURE__*/ jsx("thead", {
31665
- children: table.getHeaderGroups().map(function(headerGroup) {
31666
- return /*#__PURE__*/ jsx("tr", {
31667
- children: headerGroup.headers.map(function(header) {
31668
- return /*#__PURE__*/ jsxs(Th, {
31669
- variant: "paragraph200Semibold",
31670
- as: "th",
31671
- style: {
31672
- padding: dense ? "".concat(spacing(1), "px ").concat(spacing(header.id === 'row-select' ? 1 : 1.5), "px") : "".concat(spacing(1.5), "px ").concat(spacing(header.id === 'row-select' ? 1 : 1.5), "px")
31673
- },
31674
- children: [
31675
- header.isPlaceholder ? null : /*#__PURE__*/ jsxs(HeaderContent, {
31676
- role: header.column.getCanSort() ? 'button' : undefined,
31677
- onClick: !disableControls ? header.column.getToggleSortingHandler() : undefined,
31678
- style: {
31679
- cursor: header.column.getCanSort() ? 'pointer' : 'default'
31680
- },
31681
- children: [
31682
- flexRender(header.column.columnDef.header, header.getContext()),
31683
- header.column.getCanSort() && /*#__PURE__*/ jsxs(SortIcon, {
31684
- children: [
31685
- /*#__PURE__*/ jsx(ChevronUp, {
31686
- color: header.column.getIsSorted() === 'desc' ? neutral400 : undefined
31687
- }),
31688
- /*#__PURE__*/ jsx(ChevronDown, {
31689
- color: header.column.getIsSorted() === 'asc' ? neutral400 : undefined
31690
- })
31691
- ]
31692
- })
31693
- ]
31694
- }),
31695
- header.column.getCanResize() && /*#__PURE__*/ jsx(ResizeHandleContainer, {
31696
- children: /*#__PURE__*/ jsx(ResizeHandle, {
31697
- onMouseDown: header.getResizeHandler(),
31698
- onTouchStart: header.getResizeHandler(),
31699
- className: "pbui-table-resize-handle",
31700
- onClick: function(e) {
31701
- e.stopPropagation();
31702
- e.preventDefault();
31703
- }
31665
+ children: table.getHeaderGroups().map(function(headerGroup) {
31666
+ return /*#__PURE__*/ jsx("tr", {
31667
+ children: headerGroup.headers.map(function(header) {
31668
+ var _header_column;
31669
+ var actionHeaders = [
31670
+ 'row-select',
31671
+ 'context'
31672
+ ];
31673
+ var autoWidth = !!(header === null || header === void 0 ? void 0 : (_header_column = header.column) === null || _header_column === void 0 ? void 0 : _header_column.columnDef).autoWidth;
31674
+ return /*#__PURE__*/ jsxs(Th, {
31675
+ variant: "paragraph200Semibold",
31676
+ as: "th",
31677
+ style: {
31678
+ width: header.getSize() && !autoWidth ? "".concat(header.getSize(), "px") : 'auto',
31679
+ minWidth: header.getSize() && !autoWidth ? "".concat(header.getSize(), "px") : 'auto',
31680
+ maxWidth: header.getSize() && !autoWidth ? "".concat(header.getSize(), "px") : 'auto',
31681
+ padding: dense ? "".concat(spacing(1), "px ").concat(spacing(header.id === 'row-select' ? 1 : 1.5), "px") : "".concat(spacing(1.5), "px ").concat(spacing(header.id === 'row-select' ? 1 : 1.5), "px")
31682
+ },
31683
+ children: [
31684
+ header.isPlaceholder ? null : /*#__PURE__*/ jsxs(HeaderContent, {
31685
+ role: header.column.getCanSort() ? 'button' : undefined,
31686
+ onClick: !disableControls ? header.column.getToggleSortingHandler() : undefined,
31687
+ style: {
31688
+ width: (actionHeaders === null || actionHeaders === void 0 ? void 0 : actionHeaders.includes(header === null || header === void 0 ? void 0 : header.id)) ? "".concat(header.getSize(), "px") : '100%',
31689
+ cursor: header.column.getCanSort() ? 'pointer' : 'default'
31690
+ },
31691
+ children: [
31692
+ flexRender(header.column.columnDef.header, header.getContext()),
31693
+ header.column.getCanSort() && /*#__PURE__*/ jsxs(SortIcon, {
31694
+ children: [
31695
+ /*#__PURE__*/ jsx(ChevronUp, {
31696
+ color: header.column.getIsSorted() === 'desc' ? neutral400 : undefined
31697
+ }),
31698
+ /*#__PURE__*/ jsx(ChevronDown, {
31699
+ color: header.column.getIsSorted() === 'asc' ? neutral400 : undefined
31704
31700
  })
31705
- })
31706
- ]
31707
- }, header.id);
31701
+ ]
31702
+ })
31703
+ ]
31704
+ }),
31705
+ header.column.getCanResize() && /*#__PURE__*/ jsx(ResizeHandleContainer, {
31706
+ children: /*#__PURE__*/ jsx(ResizeHandle, {
31707
+ onMouseDown: header.getResizeHandler(),
31708
+ onTouchStart: header.getResizeHandler(),
31709
+ className: !autoWidth ? 'pbui-table-resize-handle' : '',
31710
+ onClick: function(e) {
31711
+ e.stopPropagation();
31712
+ e.preventDefault();
31713
+ }
31714
+ })
31708
31715
  })
31709
- }, headerGroup.id);
31710
- })
31716
+ ]
31717
+ }, header.id);
31711
31718
  })
31712
- ]
31719
+ }, headerGroup.id);
31713
31720
  })
31714
31721
  });
31715
31722
  };
@@ -31726,7 +31733,7 @@ function _tagged_template_literal$3(strings, raw) {
31726
31733
  }
31727
31734
  function _templateObject$3() {
31728
31735
  var data = _tagged_template_literal$3([
31729
- "\n width: 100%;\n table-layout: fixed;\n border-collapse: separate;\n border-spacing: 0;\n"
31736
+ "\n width: 100%;\n border-collapse: separate;\n border-spacing: 0;\n"
31730
31737
  ]);
31731
31738
  _templateObject$3 = function _templateObject() {
31732
31739
  return data;
@@ -31763,50 +31770,45 @@ function _templateObject3() {
31763
31770
  };
31764
31771
  return data;
31765
31772
  }
31766
- var StyledTable = styled.table(_templateObject$3());
31773
+ var StyledTableBody = styled.tbody(_templateObject$3());
31767
31774
  var Tr = styled.tr(_templateObject2$1(), function(props) {
31768
31775
  return props.enableHover && css(_templateObject1$3(), primary100);
31769
31776
  });
31770
31777
  var Td = styled(Typography)(_templateObject3(), neutral300);
31771
31778
  var TableBody = function(param) {
31772
31779
  var table = param.table, columnWidths = param.columnWidths, enableRowSelection = param.enableRowSelection, onRowClick = param.onRowClick, dense = param.dense;
31773
- return /*#__PURE__*/ jsxs(StyledTable, {
31780
+ return /*#__PURE__*/ jsxs(StyledTableBody, {
31774
31781
  children: [
31775
31782
  /*#__PURE__*/ jsx("colgroup", {
31776
31783
  children: columnWidths.map(function(param) {
31777
- var id = param.id, width = param.width;
31778
- return /*#__PURE__*/ jsx("col", {
31779
- style: {
31780
- width: "".concat(width, "px")
31781
- }
31782
- }, id);
31784
+ var id = param.id; param.width;
31785
+ return /*#__PURE__*/ jsx("col", {}, id);
31783
31786
  })
31784
31787
  }),
31785
- /*#__PURE__*/ jsx("tbody", {
31786
- children: table.getRowModel().rows.map(function(row) {
31787
- var rowClickEnabled = enableRowSelection || !!onRowClick;
31788
- return /*#__PURE__*/ jsx(Tr, {
31789
- role: rowClickEnabled ? 'button' : undefined,
31790
- onClick: onRowClick ? function() {
31791
- return onRowClick(row.original);
31792
- } : row.getToggleSelectedHandler(),
31793
- style: {
31794
- cursor: rowClickEnabled ? 'pointer' : undefined,
31795
- background: row.getIsSelected() ? primary100 : undefined
31796
- },
31797
- enableHover: rowClickEnabled,
31798
- children: row.getVisibleCells().map(function(cell) {
31799
- return /*#__PURE__*/ jsx(Td, {
31800
- variant: "paragraph200Regular",
31801
- as: "td",
31802
- style: {
31803
- padding: dense ? "".concat(spacing(1), "px ").concat(spacing(cell.column.id === 'row-select' ? 1 : 1.5), "px") : "".concat(spacing(1.5), "px ").concat(spacing(cell.column.id === 'row-select' ? 1 : 1.5), "px")
31804
- },
31805
- children: flexRender(cell.column.columnDef.cell, cell.getContext())
31806
- }, cell.id);
31807
- })
31808
- }, row.id);
31809
- })
31788
+ table.getRowModel().rows.map(function(row) {
31789
+ var rowClickEnabled = enableRowSelection || !!onRowClick;
31790
+ return /*#__PURE__*/ jsx(Tr, {
31791
+ role: rowClickEnabled ? 'button' : undefined,
31792
+ onClick: onRowClick ? function() {
31793
+ return onRowClick(row.original);
31794
+ } : row.getToggleSelectedHandler(),
31795
+ style: {
31796
+ cursor: rowClickEnabled ? 'pointer' : undefined,
31797
+ background: row.getIsSelected() ? primary100 : undefined
31798
+ },
31799
+ enableHover: rowClickEnabled,
31800
+ children: row.getVisibleCells().map(function(cell) {
31801
+ return /*#__PURE__*/ jsx(Td, {
31802
+ variant: "paragraph200Regular",
31803
+ as: "td",
31804
+ style: {
31805
+ width: "".concat(cell.column.getSize(), "px"),
31806
+ padding: dense ? "".concat(spacing(1), "px ").concat(spacing(cell.column.id === 'row-select' ? 1 : 1.5), "px") : "".concat(spacing(1.5), "px ").concat(spacing(cell.column.id === 'row-select' ? 1 : 1.5), "px")
31807
+ },
31808
+ children: flexRender(cell.column.columnDef.cell, cell.getContext())
31809
+ }, cell.id);
31810
+ })
31811
+ }, row.id);
31810
31812
  })
31811
31813
  ]
31812
31814
  });
@@ -31994,7 +31996,7 @@ function _templateObject$1() {
31994
31996
  var data = _tagged_template_literal$1([
31995
31997
  "\n position: relative;\n display: flex;\n flex-direction: column;\n min-height: 400px;\n z-index: 1;\n border: 1px solid ",
31996
31998
  ";\n border-radius: ",
31997
- "px;\n overflow: hidden;\n"
31999
+ "px;\n overflow: scroll;\n"
31998
32000
  ]);
31999
32001
  _templateObject$1 = function _templateObject() {
32000
32002
  return data;
@@ -32003,7 +32005,7 @@ function _templateObject$1() {
32003
32005
  }
32004
32006
  function _templateObject1$1() {
32005
32007
  var data = _tagged_template_literal$1([
32006
- "\n position: relative;\n flex: 1;\n min-height: 0;\n overflow-x: auto;\n"
32008
+ "\n position: relative;\n border-collapse: collapse;\n table-layout: fixed;\n min-height: 0;\n width: 100%;\n overflow-x: auto;\n"
32007
32009
  ]);
32008
32010
  _templateObject1$1 = function _templateObject() {
32009
32011
  return data;
@@ -32011,7 +32013,7 @@ function _templateObject1$1() {
32011
32013
  return data;
32012
32014
  }
32013
32015
  var TableContainer = styled.div(_templateObject$1(), neutral300, spacing(1));
32014
- var TableWrapper = styled.div(_templateObject1$1());
32016
+ var TableWrapper = styled.table(_templateObject1$1());
32015
32017
  var Table = function(param) {
32016
32018
  var columns = param.columns, _param_data = param.data, data = _param_data === void 0 ? [] : _param_data, getRowId = param.getRowId, _param_isLoading = param.isLoading, isLoading = _param_isLoading === void 0 ? false : _param_isLoading, _param_pageInfo = param.pageInfo, pageInfo = _param_pageInfo === void 0 ? {
32017
32019
  pageCount: 1,
@@ -32039,9 +32041,13 @@ var Table = function(param) {
32039
32041
  if (enableRowSelection) {
32040
32042
  cols.unshift({
32041
32043
  id: 'row-select',
32044
+ size: 22,
32045
+ minSize: 22,
32046
+ maxSize: 22,
32042
32047
  header: function(param) {
32043
32048
  var table = param.table;
32044
32049
  return /*#__PURE__*/ jsx(Checkbox, {
32050
+ width: 'min-content',
32045
32051
  checked: table.getIsAllRowsSelected(),
32046
32052
  indeterminate: table.getIsSomeRowsSelected(),
32047
32053
  onChange: table.getToggleAllPageRowsSelectedHandler(),
@@ -32050,29 +32056,25 @@ var Table = function(param) {
32050
32056
  },
32051
32057
  cell: function(param) {
32052
32058
  var row = param.row;
32053
- return /*#__PURE__*/ jsx("div", {
32054
- style: {
32055
- display: 'flex'
32059
+ return /*#__PURE__*/ jsx(Checkbox, {
32060
+ width: 'min-content',
32061
+ checked: row.getIsSelected(),
32062
+ disabled: disableControls || !row.getCanSelect(),
32063
+ onClick: function(e) {
32064
+ return e.stopPropagation();
32056
32065
  },
32057
- children: /*#__PURE__*/ jsx(Checkbox, {
32058
- checked: row.getIsSelected(),
32059
- disabled: disableControls || !row.getCanSelect(),
32060
- onClick: function(e) {
32061
- return e.stopPropagation();
32062
- },
32063
- onChange: row.getToggleSelectedHandler()
32064
- })
32066
+ onChange: row.getToggleSelectedHandler()
32065
32067
  });
32066
32068
  },
32067
- size: 40,
32068
- minSize: 40,
32069
- maxSize: 40,
32070
32069
  enableResizing: false
32071
32070
  });
32072
32071
  }
32073
32072
  if (contextMenuActions === null || contextMenuActions === void 0 ? void 0 : contextMenuActions.length) {
32074
32073
  cols.push({
32075
32074
  id: 'context',
32075
+ size: 22,
32076
+ minSize: 22,
32077
+ maxSize: 22,
32076
32078
  header: '',
32077
32079
  cell: function(param) {
32078
32080
  var row = param.row;
@@ -32083,9 +32085,6 @@ var Table = function(param) {
32083
32085
  contextMenuActions: contextMenuActions
32084
32086
  });
32085
32087
  },
32086
- size: 50,
32087
- minSize: 50,
32088
- maxSize: 50,
32089
32088
  enableResizing: false
32090
32089
  });
32091
32090
  }
@@ -32118,9 +32117,9 @@ var Table = function(param) {
32118
32117
  columns: allColumns,
32119
32118
  getRowId: getRowId,
32120
32119
  defaultColumn: {
32121
- minSize: 80,
32122
- maxSize: 1000,
32123
- size: 150
32120
+ minSize: 50,
32121
+ maxSize: 500,
32122
+ size: 200
32124
32123
  },
32125
32124
  state: {
32126
32125
  pagination: {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@paubox/ui",
3
3
  "author": "Paubox, Inc.",
4
4
  "description": "Paubox Component Library",
5
- "version": "0.8.3",
5
+ "version": "0.8.5",
6
6
  "type": "module",
7
7
  "private": false,
8
8
  "publishConfig": {
@@ -2,7 +2,7 @@ import { CSSProperties, MouseEventHandler } from 'react';
2
2
  export interface BaseButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
3
3
  color?: 'primary' | 'secondary' | 'danger';
4
4
  disabled?: boolean;
5
- size?: 'large' | 'small';
5
+ size?: 'large' | 'small' | 'xsmall';
6
6
  round?: boolean;
7
7
  children: React.ReactNode;
8
8
  onClick?: MouseEventHandler<HTMLButtonElement>;
@@ -2,6 +2,7 @@ export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement>
2
2
  sz?: 'sm' | 'lg';
3
3
  error?: boolean;
4
4
  leftIcon?: React.ElementType;
5
+ clearable?: boolean;
5
6
  rightIcon?: React.ElementType;
6
7
  }
7
8
  export declare const InputWrapper: import("@emotion/styled").StyledComponent<{
@@ -18,4 +19,4 @@ export declare const IconWrapper: import("@emotion/styled").StyledComponent<{
18
19
  } & {
19
20
  position: "left" | "right";
20
21
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
21
- export declare const Input: ({ leftIcon: LeftIcon, rightIcon: RightIcon, sz, error, style, ...props }: InputProps) => import("@emotion/react/jsx-runtime").JSX.Element;
22
+ export declare const Input: ({ leftIcon: LeftIcon, rightIcon: RightIcon, clearable, sz, error, style, ...props }: InputProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1,8 +1,9 @@
1
1
  export interface SearchProps extends React.InputHTMLAttributes<HTMLInputElement> {
2
2
  sz?: 'sm' | 'lg';
3
+ clearable?: boolean;
3
4
  loading: boolean;
4
- setLoading: (value: boolean) => void;
5
+ setLoading?: (value: boolean) => void;
5
6
  setSearchValue: (value: string) => void;
6
7
  }
7
8
  export declare const loadingWheelStyle: import("@emotion/react").SerializedStyles;
8
- export declare const Search: ({ loading, setLoading, setSearchValue, sz, ...props }: SearchProps) => import("@emotion/react/jsx-runtime").JSX.Element;
9
+ export declare const Search: ({ loading, setLoading, setSearchValue, clearable, sz, ...props }: SearchProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -7,7 +7,7 @@ export declare const TableContainer: import("@emotion/styled").StyledComponent<{
7
7
  export declare const TableWrapper: import("@emotion/styled").StyledComponent<{
8
8
  theme?: import("@emotion/react").Theme;
9
9
  as?: React.ElementType;
10
- }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
10
+ }, import("react").DetailedHTMLProps<import("react").TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>, {}>;
11
11
  export interface ColumnWidth {
12
12
  id: string;
13
13
  width: number;
@@ -18,6 +18,7 @@ export type TableColumn<T> = ColumnDef<T> & {
18
18
  width?: number;
19
19
  sortable?: boolean;
20
20
  getter?: () => unknown;
21
+ autoWidth?: boolean;
21
22
  };
22
23
  export interface RowSelectState {
23
24
  [x: string]: boolean;
@@ -6,5 +6,5 @@ interface TableHeaderProps<T> {
6
6
  disableControls: boolean;
7
7
  dense: boolean;
8
8
  }
9
- export declare const TableHeader: <T extends object>({ table, columnWidths, disableControls, dense, }: TableHeaderProps<T>) => import("@emotion/react/jsx-runtime").JSX.Element;
9
+ export declare const TableHeader: <T extends object>({ table, disableControls, dense, }: TableHeaderProps<T>) => import("@emotion/react/jsx-runtime").JSX.Element;
10
10
  export {};