@paubox/ui 0.8.3 → 0.8.4

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,110 @@ 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
+ return /*#__PURE__*/ jsxs(Th, {
31669
+ variant: "paragraph200Semibold",
31670
+ as: "th",
31671
+ style: {
31672
+ width: "".concat(header.column.getSize(), "px"),
31673
+ 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")
31674
+ },
31675
+ children: [
31676
+ header.isPlaceholder ? null : /*#__PURE__*/ jsxs(HeaderContent, {
31677
+ role: header.column.getCanSort() ? 'button' : undefined,
31678
+ onClick: !disableControls ? header.column.getToggleSortingHandler() : undefined,
31679
+ style: {
31680
+ cursor: header.column.getCanSort() ? 'pointer' : 'default'
31681
+ },
31682
+ children: [
31683
+ flexRender(header.column.columnDef.header, header.getContext()),
31684
+ header.column.getCanSort() && /*#__PURE__*/ jsxs(SortIcon, {
31685
+ children: [
31686
+ /*#__PURE__*/ jsx(ChevronUp, {
31687
+ color: header.column.getIsSorted() === 'desc' ? neutral400 : undefined
31688
+ }),
31689
+ /*#__PURE__*/ jsx(ChevronDown, {
31690
+ color: header.column.getIsSorted() === 'asc' ? neutral400 : undefined
31704
31691
  })
31705
- })
31706
- ]
31707
- }, header.id);
31692
+ ]
31693
+ })
31694
+ ]
31695
+ }),
31696
+ header.column.getCanResize() && /*#__PURE__*/ jsx(ResizeHandleContainer, {
31697
+ children: /*#__PURE__*/ jsx(ResizeHandle, {
31698
+ onMouseDown: header.getResizeHandler(),
31699
+ onTouchStart: header.getResizeHandler(),
31700
+ className: "pbui-table-resize-handle",
31701
+ onClick: function(e) {
31702
+ e.stopPropagation();
31703
+ e.preventDefault();
31704
+ }
31705
+ })
31708
31706
  })
31709
- }, headerGroup.id);
31710
- })
31707
+ ]
31708
+ }, header.id);
31711
31709
  })
31712
- ]
31710
+ }, headerGroup.id);
31713
31711
  })
31714
31712
  });
31715
31713
  };
@@ -31726,7 +31724,7 @@ function _tagged_template_literal$3(strings, raw) {
31726
31724
  }
31727
31725
  function _templateObject$3() {
31728
31726
  var data = _tagged_template_literal$3([
31729
- "\n width: 100%;\n table-layout: fixed;\n border-collapse: separate;\n border-spacing: 0;\n"
31727
+ "\n width: 100%;\n border-collapse: separate;\n border-spacing: 0;\n"
31730
31728
  ]);
31731
31729
  _templateObject$3 = function _templateObject() {
31732
31730
  return data;
@@ -31763,50 +31761,45 @@ function _templateObject3() {
31763
31761
  };
31764
31762
  return data;
31765
31763
  }
31766
- var StyledTable = styled.table(_templateObject$3());
31764
+ var StyledTableBody = styled.tbody(_templateObject$3());
31767
31765
  var Tr = styled.tr(_templateObject2$1(), function(props) {
31768
31766
  return props.enableHover && css(_templateObject1$3(), primary100);
31769
31767
  });
31770
31768
  var Td = styled(Typography)(_templateObject3(), neutral300);
31771
31769
  var TableBody = function(param) {
31772
31770
  var table = param.table, columnWidths = param.columnWidths, enableRowSelection = param.enableRowSelection, onRowClick = param.onRowClick, dense = param.dense;
31773
- return /*#__PURE__*/ jsxs(StyledTable, {
31771
+ return /*#__PURE__*/ jsxs(StyledTableBody, {
31774
31772
  children: [
31775
31773
  /*#__PURE__*/ jsx("colgroup", {
31776
31774
  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);
31775
+ var id = param.id; param.width;
31776
+ return /*#__PURE__*/ jsx("col", {}, id);
31783
31777
  })
31784
31778
  }),
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
- })
31779
+ table.getRowModel().rows.map(function(row) {
31780
+ var rowClickEnabled = enableRowSelection || !!onRowClick;
31781
+ return /*#__PURE__*/ jsx(Tr, {
31782
+ role: rowClickEnabled ? 'button' : undefined,
31783
+ onClick: onRowClick ? function() {
31784
+ return onRowClick(row.original);
31785
+ } : row.getToggleSelectedHandler(),
31786
+ style: {
31787
+ cursor: rowClickEnabled ? 'pointer' : undefined,
31788
+ background: row.getIsSelected() ? primary100 : undefined
31789
+ },
31790
+ enableHover: rowClickEnabled,
31791
+ children: row.getVisibleCells().map(function(cell) {
31792
+ return /*#__PURE__*/ jsx(Td, {
31793
+ variant: "paragraph200Regular",
31794
+ as: "td",
31795
+ style: {
31796
+ width: "".concat(cell.column.getSize(), "px"),
31797
+ 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")
31798
+ },
31799
+ children: flexRender(cell.column.columnDef.cell, cell.getContext())
31800
+ }, cell.id);
31801
+ })
31802
+ }, row.id);
31810
31803
  })
31811
31804
  ]
31812
31805
  });
@@ -31994,7 +31987,7 @@ function _templateObject$1() {
31994
31987
  var data = _tagged_template_literal$1([
31995
31988
  "\n position: relative;\n display: flex;\n flex-direction: column;\n min-height: 400px;\n z-index: 1;\n border: 1px solid ",
31996
31989
  ";\n border-radius: ",
31997
- "px;\n overflow: hidden;\n"
31990
+ "px;\n overflow: scroll;\n"
31998
31991
  ]);
31999
31992
  _templateObject$1 = function _templateObject() {
32000
31993
  return data;
@@ -32003,7 +31996,7 @@ function _templateObject$1() {
32003
31996
  }
32004
31997
  function _templateObject1$1() {
32005
31998
  var data = _tagged_template_literal$1([
32006
- "\n position: relative;\n flex: 1;\n min-height: 0;\n overflow-x: auto;\n"
31999
+ "\n position: relative;\n border-collapse: collapse;\n flex: 1;\n table-layout: fixed;\n min-height: 0;\n width: 100%;\n overflow-x: auto;\n"
32007
32000
  ]);
32008
32001
  _templateObject1$1 = function _templateObject() {
32009
32002
  return data;
@@ -32011,7 +32004,7 @@ function _templateObject1$1() {
32011
32004
  return data;
32012
32005
  }
32013
32006
  var TableContainer = styled.div(_templateObject$1(), neutral300, spacing(1));
32014
- var TableWrapper = styled.div(_templateObject1$1());
32007
+ var TableWrapper = styled.table(_templateObject1$1());
32015
32008
  var Table = function(param) {
32016
32009
  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
32010
  pageCount: 1,
@@ -32039,9 +32032,11 @@ var Table = function(param) {
32039
32032
  if (enableRowSelection) {
32040
32033
  cols.unshift({
32041
32034
  id: 'row-select',
32035
+ size: 30,
32042
32036
  header: function(param) {
32043
32037
  var table = param.table;
32044
32038
  return /*#__PURE__*/ jsx(Checkbox, {
32039
+ width: 'min-content',
32045
32040
  checked: table.getIsAllRowsSelected(),
32046
32041
  indeterminate: table.getIsSomeRowsSelected(),
32047
32042
  onChange: table.getToggleAllPageRowsSelectedHandler(),
@@ -32050,23 +32045,16 @@ var Table = function(param) {
32050
32045
  },
32051
32046
  cell: function(param) {
32052
32047
  var row = param.row;
32053
- return /*#__PURE__*/ jsx("div", {
32054
- style: {
32055
- display: 'flex'
32048
+ return /*#__PURE__*/ jsx(Checkbox, {
32049
+ width: 'min-content',
32050
+ checked: row.getIsSelected(),
32051
+ disabled: disableControls || !row.getCanSelect(),
32052
+ onClick: function(e) {
32053
+ return e.stopPropagation();
32056
32054
  },
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
- })
32055
+ onChange: row.getToggleSelectedHandler()
32065
32056
  });
32066
32057
  },
32067
- size: 40,
32068
- minSize: 40,
32069
- maxSize: 40,
32070
32058
  enableResizing: false
32071
32059
  });
32072
32060
  }
@@ -32083,9 +32071,7 @@ var Table = function(param) {
32083
32071
  contextMenuActions: contextMenuActions
32084
32072
  });
32085
32073
  },
32086
- size: 50,
32087
- minSize: 50,
32088
- maxSize: 50,
32074
+ size: 20,
32089
32075
  enableResizing: false
32090
32076
  });
32091
32077
  }
@@ -32118,9 +32104,9 @@ var Table = function(param) {
32118
32104
  columns: allColumns,
32119
32105
  getRowId: getRowId,
32120
32106
  defaultColumn: {
32121
- minSize: 80,
32107
+ minSize: 20,
32122
32108
  maxSize: 1000,
32123
- size: 150
32109
+ size: 20
32124
32110
  },
32125
32111
  state: {
32126
32112
  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.4",
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;
@@ -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 {};