@paubox/ui 3.4.0 → 3.5.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.
package/index.esm.js CHANGED
@@ -1981,7 +1981,7 @@ function _templateObject3$h() {
1981
1981
  };
1982
1982
  return data;
1983
1983
  }
1984
- function _templateObject4$e() {
1984
+ function _templateObject4$f() {
1985
1985
  var data = _tagged_template_literal$v([
1986
1986
  "\n ",
1987
1987
  "\n font-size: ",
@@ -1989,12 +1989,12 @@ function _templateObject4$e() {
1989
1989
  "rem;\n letter-spacing: ",
1990
1990
  "px;\n font-weight: 600;\n"
1991
1991
  ]);
1992
- _templateObject4$e = function _templateObject() {
1992
+ _templateObject4$f = function _templateObject() {
1993
1993
  return data;
1994
1994
  };
1995
1995
  return data;
1996
1996
  }
1997
- function _templateObject5$8() {
1997
+ function _templateObject5$9() {
1998
1998
  var data = _tagged_template_literal$v([
1999
1999
  "\n ",
2000
2000
  "\n font-size: ",
@@ -2002,7 +2002,7 @@ function _templateObject5$8() {
2002
2002
  "rem;\n letter-spacing: ",
2003
2003
  "px;\n font-weight: 400;\n"
2004
2004
  ]);
2005
- _templateObject5$8 = function _templateObject() {
2005
+ _templateObject5$9 = function _templateObject() {
2006
2006
  return data;
2007
2007
  };
2008
2008
  return data;
@@ -2272,8 +2272,8 @@ var commonStyles = css(_templateObject$v());
2272
2272
  var $headline100Regular = css(_templateObject1$l(), commonStyles, headline100FontSize / BASE_FONT_SIZE, headline100LineHeight / BASE_FONT_SIZE, headline100LetterSpacing);
2273
2273
  var $headline100Semibold = css(_templateObject2$l(), commonStyles, headline100FontSize / BASE_FONT_SIZE, headline100LineHeight / BASE_FONT_SIZE, headline100LetterSpacing);
2274
2274
  var $headline200Regular = css(_templateObject3$h(), commonStyles, headline200FontSize / BASE_FONT_SIZE, headline200LineHeight / BASE_FONT_SIZE, headline200LetterSpacing);
2275
- var $headline200Semibold = css(_templateObject4$e(), commonStyles, headline200FontSize / BASE_FONT_SIZE, headline200LineHeight / BASE_FONT_SIZE, headline200LetterSpacing);
2276
- var $headline300Regular = css(_templateObject5$8(), commonStyles, headline300FontSize / BASE_FONT_SIZE, headline300LineHeight / BASE_FONT_SIZE, headline300LetterSpacing);
2275
+ var $headline200Semibold = css(_templateObject4$f(), commonStyles, headline200FontSize / BASE_FONT_SIZE, headline200LineHeight / BASE_FONT_SIZE, headline200LetterSpacing);
2276
+ var $headline300Regular = css(_templateObject5$9(), commonStyles, headline300FontSize / BASE_FONT_SIZE, headline300LineHeight / BASE_FONT_SIZE, headline300LetterSpacing);
2277
2277
  var $headline300Semibold = css(_templateObject6$4(), commonStyles, headline300FontSize / BASE_FONT_SIZE, headline300LineHeight / BASE_FONT_SIZE, headline300LetterSpacing);
2278
2278
  // PARAGRAPH
2279
2279
  var $paragraph100Regular = css(_templateObject7$3(), commonStyles, paragraph100FontSize / BASE_FONT_SIZE, paragraph100LineHeight / BASE_FONT_SIZE, paragraph100LetterSpacing);
@@ -2452,22 +2452,22 @@ function _templateObject3$g() {
2452
2452
  };
2453
2453
  return data;
2454
2454
  }
2455
- function _templateObject4$d() {
2455
+ function _templateObject4$e() {
2456
2456
  var data = _tagged_template_literal$u([
2457
2457
  "\n display: flex;\n flex-direction: column;\n gap: 0.25rem;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 100%;\n"
2458
2458
  ]);
2459
- _templateObject4$d = function _templateObject() {
2459
+ _templateObject4$e = function _templateObject() {
2460
2460
  return data;
2461
2461
  };
2462
2462
  return data;
2463
2463
  }
2464
- function _templateObject5$7() {
2464
+ function _templateObject5$8() {
2465
2465
  var data = _tagged_template_literal$u([
2466
2466
  "\n background-color: transparent;\n border: none;\n color: ",
2467
2467
  ";\n cursor: pointer;\n padding: 0.25rem;\n font-size: 0.75rem;\n margin-left: ",
2468
2468
  ";\n"
2469
2469
  ]);
2470
- _templateObject5$7 = function _templateObject() {
2470
+ _templateObject5$8 = function _templateObject() {
2471
2471
  return data;
2472
2472
  };
2473
2473
  return data;
@@ -2488,8 +2488,8 @@ var StyledIcon = styled.div(_templateObject3$g(), function(param) {
2488
2488
  var type = param.type;
2489
2489
  return type === 'info' ? primary700$1 : type === 'error' ? danger700$1 : type === 'success' ? success700$1 : warning700$1;
2490
2490
  });
2491
- var TextWrapper = styled.div(_templateObject4$d());
2492
- var TruncaterButton = styled.button(_templateObject5$7(), primary700$1, function(param) {
2491
+ var TextWrapper = styled.div(_templateObject4$e());
2492
+ var TruncaterButton = styled.button(_templateObject5$8(), primary700$1, function(param) {
2493
2493
  var isExpanded = param.isExpanded;
2494
2494
  return !isExpanded ? '0' : '0.25rem';
2495
2495
  });
@@ -23431,21 +23431,21 @@ function _templateObject3$e() {
23431
23431
  };
23432
23432
  return data;
23433
23433
  }
23434
- function _templateObject4$c() {
23434
+ function _templateObject4$d() {
23435
23435
  var data = _tagged_template_literal$k([
23436
23436
  "\n width: 100%;\n border-radius: 0.5rem;\n border: 4px dashed #e5e7eb;\n background-color: #f9fafb;\n padding: 2rem;\n\n &:hover {\n cursor: pointer;\n &:not(:disabled) {\n background-color: ",
23437
23437
  ";\n }\n &:disabled {\n cursor: not-allowed;\n }\n }\n"
23438
23438
  ]);
23439
- _templateObject4$c = function _templateObject() {
23439
+ _templateObject4$d = function _templateObject() {
23440
23440
  return data;
23441
23441
  };
23442
23442
  return data;
23443
23443
  }
23444
- function _templateObject5$6() {
23444
+ function _templateObject5$7() {
23445
23445
  var data = _tagged_template_literal$k([
23446
23446
  "\n display: flex;\n flex-direction: row;\n gap: 0.5rem;\n"
23447
23447
  ]);
23448
- _templateObject5$6 = function _templateObject() {
23448
+ _templateObject5$7 = function _templateObject() {
23449
23449
  return data;
23450
23450
  };
23451
23451
  return data;
@@ -23469,8 +23469,8 @@ var FilterGroup = styled.div(_templateObject1$h(), function(param) {
23469
23469
  });
23470
23470
  var CloseButton$1 = styled.button(_templateObject2$h());
23471
23471
  var FilterRowsContainer = styled.div(_templateObject3$e());
23472
- var OrButton = styled.button(_templateObject4$c(), neutral100$1);
23473
- var ButtonGroup = styled.div(_templateObject5$6());
23472
+ var OrButton = styled.button(_templateObject4$d(), neutral100$1);
23473
+ var ButtonGroup = styled.div(_templateObject5$7());
23474
23474
  var AndButtonContainer = styled.div(_templateObject6$3());
23475
23475
  var FilterForm = function(param) {
23476
23476
  var values = param.values, fieldOptions = param.fieldOptions, operatorOptions = param.operatorOptions, onSubmit = param.onSubmit, onClear = param.onClear, onChange = param.onChange, errors = param.errors, touched = param.touched;
@@ -23839,14 +23839,14 @@ function _templateObject3$d() {
23839
23839
  };
23840
23840
  return data;
23841
23841
  }
23842
- function _templateObject4$b() {
23842
+ function _templateObject4$c() {
23843
23843
  var data = _tagged_template_literal$j([
23844
23844
  "\n ",
23845
23845
  "\n background: ",
23846
23846
  ";\n\n html.dark & {\n background: ",
23847
23847
  ";\n }\n"
23848
23848
  ]);
23849
- _templateObject4$b = function _templateObject() {
23849
+ _templateObject4$c = function _templateObject() {
23850
23850
  return data;
23851
23851
  };
23852
23852
  return data;
@@ -23861,7 +23861,7 @@ var StyledItem = styled.button(_templateObject3$d(), buttonStyles, function(para
23861
23861
  var selected = param.selected;
23862
23862
  return selected ? primary200 : 'transparent';
23863
23863
  });
23864
- var StyledLink = styled.a(_templateObject4$b(), buttonStyles, function(param) {
23864
+ var StyledLink = styled.a(_templateObject4$c(), buttonStyles, function(param) {
23865
23865
  var selected = param.selected;
23866
23866
  return selected ? primary200$1 : 'transparent';
23867
23867
  }, function(param) {
@@ -24112,23 +24112,23 @@ function _templateObject3$c() {
24112
24112
  };
24113
24113
  return data;
24114
24114
  }
24115
- function _templateObject4$a() {
24115
+ function _templateObject4$b() {
24116
24116
  var data = _tagged_template_literal$i([
24117
24117
  "\n padding: 0.5rem 0.75rem;\n color: ",
24118
24118
  ";\n ",
24119
24119
  "\n\n html.dark & {\n color: ",
24120
24120
  ";\n }\n"
24121
24121
  ]);
24122
- _templateObject4$a = function _templateObject() {
24122
+ _templateObject4$b = function _templateObject() {
24123
24123
  return data;
24124
24124
  };
24125
24125
  return data;
24126
24126
  }
24127
- function _templateObject5$5() {
24127
+ function _templateObject5$6() {
24128
24128
  var data = _tagged_template_literal$i([
24129
24129
  '\n /* role="option" wrapper — visual state is delegated to inner MenuItem */\n'
24130
24130
  ]);
24131
- _templateObject5$5 = function _templateObject() {
24131
+ _templateObject5$6 = function _templateObject() {
24132
24132
  return data;
24133
24133
  };
24134
24134
  return data;
@@ -24158,8 +24158,8 @@ var BaseInput$2 = styled.input(_templateObject1$f(), textPrimary$1, neutral500$1
24158
24158
  });
24159
24159
  var Chip$2 = styled.button(_templateObject2$f(), neutral100$1, $label200Medium, primary600$1, surfaceRaised, textPrimaryWhite, primary500);
24160
24160
  var RightIconWrapper = styled.div(_templateObject3$c(), neutral600$1, surfaceMuted);
24161
- var EmptyState = styled.div(_templateObject4$a(), neutral500$1, $paragraph200Regular, surfaceMuted);
24162
- var OptionWrapper = styled.div(_templateObject5$5());
24161
+ var EmptyState = styled.div(_templateObject4$b(), neutral500$1, $paragraph200Regular, surfaceMuted);
24162
+ var OptionWrapper = styled.div(_templateObject5$6());
24163
24163
  /**
24164
24164
  * AutoComplete: single-line input that filters a closed list of options as
24165
24165
  * the user types. Selected items render as removable chips. Multi-select.
@@ -24878,24 +24878,24 @@ function _templateObject3$b() {
24878
24878
  };
24879
24879
  return data;
24880
24880
  }
24881
- function _templateObject4$9() {
24881
+ function _templateObject4$a() {
24882
24882
  var data = _tagged_template_literal$g([
24883
24883
  "\n position: absolute;\n display: flex;\n gap: 0.25rem;\n width: min-content;\n max-width: 85%;\n height: auto;\n overflow-x: auto;\n\n /* Always show scrollbar when overflowing */\n &::-webkit-scrollbar {\n height: 4px;\n display: block;\n }\n\n &::-webkit-scrollbar-track {\n background: ",
24884
24884
  ";\n border-radius: 2px;\n display: block;\n width: 95%;\n }\n\n &::-webkit-scrollbar-thumb {\n background: ",
24885
24885
  ";\n border-radius: 2px;\n display: block;\n }\n\n padding: ",
24886
24886
  ";\n"
24887
24887
  ]);
24888
- _templateObject4$9 = function _templateObject() {
24888
+ _templateObject4$a = function _templateObject() {
24889
24889
  return data;
24890
24890
  };
24891
24891
  return data;
24892
24892
  }
24893
- function _templateObject5$4() {
24893
+ function _templateObject5$5() {
24894
24894
  var data = _tagged_template_literal$g([
24895
24895
  "\n position: absolute;\n right: 0rem;\n width: 2rem;\n background-color: inherit;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 0;\n border: none;\n cursor: pointer;\n z-index: 0;\n transition: all 150ms ease-in-out;\n transform: ",
24896
24896
  ";\n"
24897
24897
  ]);
24898
- _templateObject5$4 = function _templateObject() {
24898
+ _templateObject5$5 = function _templateObject() {
24899
24899
  return data;
24900
24900
  };
24901
24901
  return data;
@@ -24961,7 +24961,7 @@ var Chip$1 = styled.button(_templateObject3$b(), function(param) {
24961
24961
  var sz = param.sz;
24962
24962
  return sz === 'lg' ? $label100Medium : $label200Medium;
24963
24963
  });
24964
- var ChipWrapper$1 = styled.div(_templateObject4$9(), neutral100$1, neutral300$1, function(param) {
24964
+ var ChipWrapper$1 = styled.div(_templateObject4$a(), neutral100$1, neutral300$1, function(param) {
24965
24965
  var sz = param.sz;
24966
24966
  return sz === 'lg' ? '0.5rem 0.563rem' : '0.375rem 0.563rem';
24967
24967
  });
@@ -24981,7 +24981,7 @@ var MultiSelectChip = function(option) {
24981
24981
  });
24982
24982
  };
24983
24983
  // Style for the Icons
24984
- var IconWrapper$2 = styled.div(_templateObject5$4(), function(param) {
24984
+ var IconWrapper$2 = styled.div(_templateObject5$5(), function(param) {
24985
24985
  var open = param.open;
24986
24986
  return open ? 'rotate(180deg)' : 'rotate(0deg)';
24987
24987
  });
@@ -25293,12 +25293,12 @@ function _templateObject3$a() {
25293
25293
  };
25294
25294
  return data;
25295
25295
  }
25296
- function _templateObject4$8() {
25296
+ function _templateObject4$9() {
25297
25297
  var data = _tagged_template_literal$f([
25298
25298
  "\n position: absolute;\n right: 0.5rem;\n opacity: 0.8;\n\n ",
25299
25299
  "\n"
25300
25300
  ]);
25301
- _templateObject4$8 = function _templateObject() {
25301
+ _templateObject4$9 = function _templateObject() {
25302
25302
  return data;
25303
25303
  };
25304
25304
  return data;
@@ -25320,7 +25320,7 @@ var Chip = styled.button(_templateObject2$c(), function(param) {
25320
25320
  return secondary ? neutral300$1 : neutral100$1;
25321
25321
  }, $label200Medium);
25322
25322
  var ChipWrapper = styled.div(_templateObject3$a());
25323
- var ChipCounter = styled.p(_templateObject4$8(), function(param) {
25323
+ var ChipCounter = styled.p(_templateObject4$9(), function(param) {
25324
25324
  var sz = param.sz, type = param.type;
25325
25325
  return type === 'primary' ? sz === 'lg' ? $paragraph100Regular : $paragraph200Regular : sz === 'lg' ? $paragraph100Semibold : $paragraph200Semibold;
25326
25326
  });
@@ -25629,14 +25629,14 @@ function _templateObject3$9() {
25629
25629
  };
25630
25630
  return data;
25631
25631
  }
25632
- function _templateObject4$7() {
25632
+ function _templateObject4$8() {
25633
25633
  var data = _tagged_template_literal$e([
25634
25634
  "\n ",
25635
25635
  "\n color: ",
25636
25636
  ";\n\n html.dark & {\n color: ",
25637
25637
  ";\n }\n"
25638
25638
  ]);
25639
- _templateObject4$7 = function _templateObject() {
25639
+ _templateObject4$8 = function _templateObject() {
25640
25640
  return data;
25641
25641
  };
25642
25642
  return data;
@@ -25689,7 +25689,7 @@ var IconWrapper$1 = styled.div(_templateObject3$9(), function(param) {
25689
25689
  var open = param.open;
25690
25690
  return open ? 'rotate(180deg)' : 'rotate(0deg)';
25691
25691
  }, neutral200$1);
25692
- var SelectOption = styled.option(_templateObject4$7(), $paragraph100Semibold, textPrimary$1, neutral200$1);
25692
+ var SelectOption = styled.option(_templateObject4$8(), $paragraph100Semibold, textPrimary$1, neutral200$1);
25693
25693
  var Select = function(_param) {
25694
25694
  var _param_sz = _param.sz, sz = _param_sz === void 0 ? 'sm' : _param_sz, _param_error = _param.error, error = _param_error === void 0 ? false : _param_error, _param_options = _param.options, options = _param_options === void 0 ? [] : _param_options; _param.checkbox; var _param_placeholder = _param.placeholder, placeholder = _param_placeholder === void 0 ? 'Please select...' : _param_placeholder, value = _param.value, setValue = _param.setValue; _param.initialValue; var _param_type = _param.type, type = _param_type === void 0 ? 'primary' : _param_type, style = _param.style, _param_maxHeight = _param.maxHeight, maxHeight = _param_maxHeight === void 0 ? '14rem' : _param_maxHeight, _param_disabled = _param.disabled, disabled = _param_disabled === void 0 ? false : _param_disabled, _param_addClearOption = _param.addClearOption, addClearOption = _param_addClearOption === void 0 ? false : _param_addClearOption, _param_clearOptionLabel = _param.clearOptionLabel, clearOptionLabel = _param_clearOptionLabel === void 0 ? 'Clear' : _param_clearOptionLabel, fullWidth = _param.fullWidth, props = _object_without_properties$b(_param, [
25695
25695
  "sz",
@@ -29851,12 +29851,12 @@ function _templateObject3$8() {
29851
29851
  };
29852
29852
  return data;
29853
29853
  }
29854
- function _templateObject4$6() {
29854
+ function _templateObject4$7() {
29855
29855
  var data = _tagged_template_literal$a([
29856
29856
  "\n display: flex;\n justify-content: end;\n gap: ",
29857
29857
  "px;\n"
29858
29858
  ]);
29859
- _templateObject4$6 = function _templateObject() {
29859
+ _templateObject4$7 = function _templateObject() {
29860
29860
  return data;
29861
29861
  };
29862
29862
  return data;
@@ -29865,7 +29865,7 @@ var StyledModal = styled(Modal$1)(_templateObject$a());
29865
29865
  var ModalContent = styled.div(_templateObject1$9(), spacing(2), spacing(1), spacing(3), elevation400, surfacePrimary);
29866
29866
  var ModalHeader = styled.div(_templateObject2$9());
29867
29867
  var ModalBody = styled.div(_templateObject3$8());
29868
- var ModalFooter = styled.div(_templateObject4$6(), spacing(1));
29868
+ var ModalFooter = styled.div(_templateObject4$7(), spacing(1));
29869
29869
  var Modal = function(param) {
29870
29870
  var open = param.open, onClose = param.onClose, loading = param.loading, title = param.title, header = param.header, children = param.children, actions = param.actions, style = param.style, _param_testId = param.testId, testId = _param_testId === void 0 ? 'modal' : _param_testId;
29871
29871
  return /*#__PURE__*/ jsx(StyledModal, {
@@ -30016,20 +30016,42 @@ function _templateObject2$8() {
30016
30016
  }
30017
30017
  function _templateObject3$7() {
30018
30018
  var data = _tagged_template_literal$9([
30019
- "\n width: 45px;\n text-align: center;\n padding-top: 0.3rem;\n padding-bottom: 0.3rem;\n line-height: 1rem;\n"
30019
+ "\n display: flex;\n align-items: center;\n gap: ",
30020
+ "px;\n"
30020
30021
  ]);
30021
30022
  _templateObject3$7 = function _templateObject() {
30022
30023
  return data;
30023
30024
  };
30024
30025
  return data;
30025
30026
  }
30027
+ function _templateObject4$6() {
30028
+ var data = _tagged_template_literal$9([
30029
+ "\n width: 45px;\n text-align: center;\n padding-top: 0.3rem;\n padding-bottom: 0.3rem;\n line-height: 1rem;\n"
30030
+ ]);
30031
+ _templateObject4$6 = function _templateObject() {
30032
+ return data;
30033
+ };
30034
+ return data;
30035
+ }
30036
+ var DEFAULT_PAGE_SIZE_OPTIONS = [
30037
+ 50,
30038
+ 100,
30039
+ 150
30040
+ ];
30026
30041
  var PaginationContainer = styled.div(_templateObject$9(), spacing(2));
30027
30042
  var PageControls = styled.div(_templateObject1$8(), spacing(1));
30028
30043
  var PageInputWrapper = styled.div(_templateObject2$8(), spacing(0.5));
30029
- var PageInput = styled(Input)(_templateObject3$7());
30044
+ var PageSizeWrapper = styled.div(_templateObject3$7(), spacing(1));
30045
+ var PageInput = styled(Input)(_templateObject4$6());
30030
30046
  var Pagination = function(param) {
30031
- var mode = param.mode, pageInfo = param.pageInfo, _param_isLoading = param.isLoading, isLoading = _param_isLoading === void 0 ? false : _param_isLoading; param.onPageSizeChange; var subText = param.subText, onPageChange = param.onPageChange, _param_testId = param.testId, testId = _param_testId === void 0 ? 'pagination' : _param_testId;
30047
+ var mode = param.mode, pageInfo = param.pageInfo, _param_isLoading = param.isLoading, isLoading = _param_isLoading === void 0 ? false : _param_isLoading, onPageSizeChange = param.onPageSizeChange, _param_pageSizeOptions = param.pageSizeOptions, pageSizeOptions = _param_pageSizeOptions === void 0 ? DEFAULT_PAGE_SIZE_OPTIONS : _param_pageSizeOptions, subText = param.subText, onPageChange = param.onPageChange, _param_testId = param.testId, testId = _param_testId === void 0 ? 'pagination' : _param_testId;
30032
30048
  var _useState = _sliced_to_array$5(useState(''), 2), pageInputValue = _useState[0], setPageInputValue = _useState[1];
30049
+ var sizeOptions = pageSizeOptions.map(function(size) {
30050
+ return {
30051
+ value: String(size),
30052
+ label: String(size)
30053
+ };
30054
+ });
30033
30055
  var formatNumber = function(num) {
30034
30056
  return num.toLocaleString('en-US');
30035
30057
  };
@@ -30076,6 +30098,26 @@ var Pagination = function(param) {
30076
30098
  }),
30077
30099
  /*#__PURE__*/ jsxs(PageControls, {
30078
30100
  children: [
30101
+ /*#__PURE__*/ jsxs(PageSizeWrapper, {
30102
+ children: [
30103
+ /*#__PURE__*/ jsx(Typography, {
30104
+ variant: "paragraph300Regular",
30105
+ as: "span",
30106
+ children: "Rows per page"
30107
+ }),
30108
+ /*#__PURE__*/ jsx(Select, {
30109
+ "aria-label": "Rows per page",
30110
+ sz: "sm",
30111
+ value: String(pageInfo.pageSize),
30112
+ setValue: function(value) {
30113
+ return value && onPageSizeChange(Number(value));
30114
+ },
30115
+ options: sizeOptions,
30116
+ disabled: isLoading,
30117
+ "data-testid": "".concat(testId, "-page-size-select")
30118
+ })
30119
+ ]
30120
+ }),
30079
30121
  mode === 'page' && /*#__PURE__*/ jsxs(Fragment, {
30080
30122
  children: [
30081
30123
  /*#__PURE__*/ jsx(Typography, {
@@ -30895,11 +30937,11 @@ function _templateObject4$5() {
30895
30937
  };
30896
30938
  return data;
30897
30939
  }
30898
- function _templateObject5$3() {
30940
+ function _templateObject5$4() {
30899
30941
  var data = _tagged_template_literal$6([
30900
30942
  "\n width: 100%;\n max-height: 420px;\n overflow-y: auto;\n"
30901
30943
  ]);
30902
- _templateObject5$3 = function _templateObject() {
30944
+ _templateObject5$4 = function _templateObject() {
30903
30945
  return data;
30904
30946
  };
30905
30947
  return data;
@@ -30998,7 +31040,7 @@ var ClearButton = styled(IconButton)(_templateObject3$5(), spacing(1));
30998
31040
  * Inner content of the dropdown. Popper provides the outer container
30999
31041
  * (positioning, portal, elevation, dark-mode background). We just lay out
31000
31042
  * the rows full-width inside it, with our own max-height + scroll behavior.
31001
- */ var DropdownContent = styled.div(_templateObject5$3());
31043
+ */ var DropdownContent = styled.div(_templateObject5$4());
31002
31044
  var DropdownRow = styled.button(_templateObject6$1(), spacing(1), spacing(1), spacing(2), function(param) {
31003
31045
  var highlighted = param.highlighted;
31004
31046
  return highlighted ? neutral100$1 : 'transparent';
@@ -32019,13 +32061,13 @@ function _templateObject4$4() {
32019
32061
  };
32020
32062
  return data;
32021
32063
  }
32022
- function _templateObject5$2() {
32064
+ function _templateObject5$3() {
32023
32065
  var data = _tagged_template_literal$5([
32024
32066
  "\n color: ",
32025
32067
  ";\n font-size: 12px;\n line-height: 1.2;\n font-family: 'Roboto', sans-serif;\n\n html.dark & {\n color: ",
32026
32068
  ";\n }\n"
32027
32069
  ]);
32028
- _templateObject5$2 = function _templateObject() {
32070
+ _templateObject5$3 = function _templateObject() {
32029
32071
  return data;
32030
32072
  };
32031
32073
  return data;
@@ -32055,7 +32097,7 @@ var IconBadge = styled.div(_templateObject1$5(), function(param) {
32055
32097
  var TextBlock = styled.div(_templateObject2$5());
32056
32098
  var Label = styled.div(_templateObject3$4(), neutral500$1, neutral400$1);
32057
32099
  var Value = styled.div(_templateObject4$4(), neutral900$1, neutral100$1);
32058
- var Caption = styled.div(_templateObject5$2(), neutral400$1, neutral500$1);
32100
+ var Caption = styled.div(_templateObject5$3(), neutral400$1, neutral500$1);
32059
32101
  var StatCard = function(param) {
32060
32102
  var label = param.label, value = param.value, icon = param.icon, _param_variant = param.variant, variant = _param_variant === void 0 ? 'blue' : _param_variant, className = param.className, caption = param.caption;
32061
32103
  var _variantMap_variant = variantMap[variant], bg = _variantMap_variant.bg, color = _variantMap_variant.color;
@@ -36151,12 +36193,12 @@ function _templateObject4$3() {
36151
36193
  };
36152
36194
  return data;
36153
36195
  }
36154
- function _templateObject5$1() {
36196
+ function _templateObject5$2() {
36155
36197
  var data = _tagged_template_literal$4([
36156
36198
  "\n font-size: 9px;\n display: inline-flex;\n flex-direction: column;\n margin-left: ",
36157
36199
  "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"
36158
36200
  ]);
36159
- _templateObject5$1 = function _templateObject() {
36201
+ _templateObject5$2 = function _templateObject() {
36160
36202
  return data;
36161
36203
  };
36162
36204
  return data;
@@ -36166,7 +36208,7 @@ var Th = styled(Typography)(_templateObject1$4(), spacing(1), neutral100$1, neut
36166
36208
  var HeaderContent = styled.div(_templateObject2$4());
36167
36209
  var ResizeHandleContainer = styled.div(_templateObject3$3());
36168
36210
  var ResizeHandle = styled.div(_templateObject4$3(), neutral300$1);
36169
- var SortIcon = styled.span(_templateObject5$1(), spacing(1));
36211
+ var SortIcon = styled.span(_templateObject5$2(), spacing(1));
36170
36212
  var TableHeader = function(param) {
36171
36213
  var table = param.table, disableControls = param.disableControls, dense = param.dense, _param_testId = param.testId, testId = _param_testId === void 0 ? 'table' : _param_testId;
36172
36214
  return /*#__PURE__*/ jsx(StyledHeader, {
@@ -36297,11 +36339,11 @@ function _templateObject4$2() {
36297
36339
  };
36298
36340
  return data;
36299
36341
  }
36300
- function _templateObject5() {
36342
+ function _templateObject5$1() {
36301
36343
  var data = _tagged_template_literal$3([
36302
36344
  "\n white-space: normal;\n "
36303
36345
  ]);
36304
- _templateObject5 = function _templateObject() {
36346
+ _templateObject5$1 = function _templateObject() {
36305
36347
  return data;
36306
36348
  };
36307
36349
  return data;
@@ -36355,7 +36397,7 @@ var Td = styled(Typography)(_templateObject7(), neutral300$1, function(props) {
36355
36397
  }
36356
36398
  if (overflow === 'clamp') {
36357
36399
  // For clamp, don't apply display styles to td - content wrapper will handle it
36358
- return css(_templateObject5());
36400
+ return css(_templateObject5$1());
36359
36401
  }
36360
36402
  // Default: truncate
36361
36403
  return css(_templateObject6());
@@ -36617,8 +36659,8 @@ function _templateObject2$2() {
36617
36659
  }
36618
36660
  function _templateObject3$1() {
36619
36661
  var data = _tagged_template_literal$2([
36620
- "\n display: flex;\n flex-wrap: wrap;\n gap: ",
36621
- "px;\n align-items: center;\n"
36662
+ "\n display: flex;\n justify-content: flex-end;\n align-items: center;\n padding: ",
36663
+ "px 0 0 0;\n\n @media (max-width: 768px) {\n justify-content: stretch;\n }\n"
36622
36664
  ]);
36623
36665
  _templateObject3$1 = function _templateObject() {
36624
36666
  return data;
@@ -36626,11 +36668,21 @@ function _templateObject3$1() {
36626
36668
  return data;
36627
36669
  }
36628
36670
  function _templateObject4$1() {
36671
+ var data = _tagged_template_literal$2([
36672
+ "\n display: flex;\n flex-wrap: wrap;\n gap: ",
36673
+ "px;\n align-items: center;\n"
36674
+ ]);
36675
+ _templateObject4$1 = function _templateObject() {
36676
+ return data;
36677
+ };
36678
+ return data;
36679
+ }
36680
+ function _templateObject5() {
36629
36681
  var data = _tagged_template_literal$2([
36630
36682
  "\n display: flex;\n align-items: center;\n justify-content: center;\n /* The kebab icon is 1em (20px here) — already equal to a cell's text\n line-height (paragraph200Regular = 20px). The BaseButton's border (2px) and\n vertical padding (8px) were the only things making rows with a context menu\n ~10px taller than rows without one. Drop both so the trigger occupies exactly\n one text line and row height matches a table with no context column. Keep the\n horizontal padding for a comfortable hit area. */\n padding: 0 ",
36631
36683
  "px;\n border: none;\n background: none;\n font-size: 20px;\n"
36632
36684
  ]);
36633
- _templateObject4$1 = function _templateObject() {
36685
+ _templateObject5 = function _templateObject() {
36634
36686
  return data;
36635
36687
  };
36636
36688
  return data;
@@ -36642,10 +36694,11 @@ var TableContainer = styled(/*#__PURE__*/ forwardRef(function(props, ref) {
36642
36694
  }))(_templateObject$2(), neutral300$1, spacing(1), surfaceRaised);
36643
36695
  var TableWrapper = styled.table(_templateObject1$2());
36644
36696
  var TopBar = styled.div(_templateObject2$2(), spacing(2), spacing(2));
36645
- var TopBarElement = styled.div(_templateObject3$1(), spacing(1));
36646
- var ContextMenuButton = styled(Button)(_templateObject4$1(), spacing(0.5));
36697
+ var BottomBar = styled.div(_templateObject3$1(), spacing(2));
36698
+ var TopBarElement = styled.div(_templateObject4$1(), spacing(1));
36699
+ var ContextMenuButton = styled(Button)(_templateObject5(), spacing(0.5));
36647
36700
  var Table = function(param) {
36648
- 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_paginationMode = param.paginationMode, paginationMode = _param_paginationMode === void 0 ? 'page' : _param_paginationMode, pageInfo = param.pageInfo, subText = param.subText, onPageSizeChange = param.onPageSizeChange, onPageChange = param.onPageChange, sortBy = param.sortBy, sortOrder = param.sortOrder, onSortChange = param.onSortChange, _param_enableRowSelection = param.enableRowSelection, enableRowSelection = _param_enableRowSelection === void 0 ? false : _param_enableRowSelection, _param_selectedRows = param.selectedRows, selectedRows = _param_selectedRows === void 0 ? {} : _param_selectedRows, onRowSelectionChange = param.onRowSelectionChange, getRowDisabled = param.getRowDisabled, onRowClick = param.onRowClick, contextMenuActions = param.contextMenuActions, _param_dense = param.dense, dense = _param_dense === void 0 ? false : _param_dense, height = param.height, containerStyle = param.containerStyle, error = param.error, _param_testId = param.testId, testId = _param_testId === void 0 ? 'table' : _param_testId, toolbar = param.toolbar;
36701
+ 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_paginationMode = param.paginationMode, paginationMode = _param_paginationMode === void 0 ? 'page' : _param_paginationMode, pageInfo = param.pageInfo, subText = param.subText, onPageSizeChange = param.onPageSizeChange, pageSizeOptions = param.pageSizeOptions, onPageChange = param.onPageChange, sortBy = param.sortBy, sortOrder = param.sortOrder, onSortChange = param.onSortChange, _param_enableRowSelection = param.enableRowSelection, enableRowSelection = _param_enableRowSelection === void 0 ? false : _param_enableRowSelection, _param_selectedRows = param.selectedRows, selectedRows = _param_selectedRows === void 0 ? {} : _param_selectedRows, onRowSelectionChange = param.onRowSelectionChange, getRowDisabled = param.getRowDisabled, onRowClick = param.onRowClick, contextMenuActions = param.contextMenuActions, _param_dense = param.dense, dense = _param_dense === void 0 ? false : _param_dense, height = param.height, containerStyle = param.containerStyle, error = param.error, _param_testId = param.testId, testId = _param_testId === void 0 ? 'table' : _param_testId, toolbar = param.toolbar;
36649
36702
  var containerRef = useRef(null);
36650
36703
  var ctxMenuAnchorRef = useRef(null);
36651
36704
  var _useState = _sliced_to_array$1(useState({}), 2), columnSizing = _useState[0], setColumnSizing = _useState[1];
@@ -36829,6 +36882,36 @@ var Table = function(param) {
36829
36882
  onColumnSizingChange: setColumnSizing,
36830
36883
  columnResizeMode: 'onChange'
36831
36884
  });
36885
+ var renderPagination = function() {
36886
+ if (!hasPaginationHandlers || !pageInfo) return null;
36887
+ var sharedProps = {
36888
+ subText: subText,
36889
+ isLoading: isLoading,
36890
+ pageSizeOptions: pageSizeOptions,
36891
+ onPageSizeChange: function(size) {
36892
+ resetContainerScroll();
36893
+ onPageSizeChange(size);
36894
+ },
36895
+ testId: "".concat(testId, "-pagination")
36896
+ };
36897
+ return paginationMode === 'page' && 'currentPage' in pageInfo ? /*#__PURE__*/ jsx(Pagination, _object_spread_props$2(_object_spread$2({
36898
+ mode: "page",
36899
+ pageInfo: pageInfo
36900
+ }, sharedProps), {
36901
+ onPageChange: function(page) {
36902
+ resetContainerScroll();
36903
+ onPageChange(page);
36904
+ }
36905
+ })) : /*#__PURE__*/ jsx(Pagination, _object_spread_props$2(_object_spread$2({
36906
+ mode: "cursor",
36907
+ pageInfo: pageInfo
36908
+ }, sharedProps), {
36909
+ onPageChange: function(page) {
36910
+ resetContainerScroll();
36911
+ onPageChange(page);
36912
+ }
36913
+ }));
36914
+ };
36832
36915
  var showTopBar = hasPaginationHandlers || toolbar;
36833
36916
  return /*#__PURE__*/ jsxs("div", {
36834
36917
  children: [
@@ -36847,35 +36930,7 @@ var Table = function(param) {
36847
36930
  style: {
36848
36931
  marginLeft: 'auto'
36849
36932
  },
36850
- children: paginationMode === 'page' && pageInfo && 'currentPage' in pageInfo ? /*#__PURE__*/ jsx(Pagination, {
36851
- mode: "page",
36852
- pageInfo: pageInfo,
36853
- subText: subText,
36854
- isLoading: isLoading,
36855
- onPageSizeChange: function(size) {
36856
- resetContainerScroll();
36857
- onPageSizeChange(size);
36858
- },
36859
- onPageChange: function(page) {
36860
- resetContainerScroll();
36861
- onPageChange(page);
36862
- },
36863
- testId: "".concat(testId, "-pagination")
36864
- }) : /*#__PURE__*/ jsx(Pagination, {
36865
- mode: "cursor",
36866
- pageInfo: pageInfo,
36867
- subText: subText,
36868
- isLoading: isLoading,
36869
- onPageSizeChange: function(size) {
36870
- resetContainerScroll();
36871
- onPageSizeChange(size);
36872
- },
36873
- onPageChange: function(page) {
36874
- resetContainerScroll();
36875
- onPageChange(page);
36876
- },
36877
- testId: "".concat(testId, "-pagination")
36878
- })
36933
+ children: renderPagination()
36879
36934
  })
36880
36935
  ]
36881
36936
  }),
@@ -36939,6 +36994,9 @@ var Table = function(param) {
36939
36994
  isLoading && /*#__PURE__*/ jsx(LoadingOverlay, {})
36940
36995
  ]
36941
36996
  }),
36997
+ hasPaginationHandlers && pageInfo && /*#__PURE__*/ jsx(BottomBar, {
36998
+ children: renderPagination()
36999
+ }),
36942
37000
  /*#__PURE__*/ jsx(RowContextMenu, {
36943
37001
  anchorRef: ctxMenuAnchorRef,
36944
37002
  actions: contextMenuActions,
@@ -37334,4 +37392,4 @@ var Tooltip = function(_param) {
37334
37392
  });
37335
37393
  };
37336
37394
 
37337
- export { Add, AlertBar, AutoComplete, BaseInput$1 as BaseInput, BaseTextArea, Button, Calendar, CalendarIcon$1 as CalendarIcon, Cancel, Checkbox, ChevronDown, ChevronLeft, ChevronRight, ChevronUp, Close, DEFAULT_SPACING, DatePicker, Delete, DropdownMenu, Edit, Error$1 as Error, FilterForm, FilterList, IconButton, IconWrapper$3 as IconWrapper, Info, Input, InputWrapper$3 as InputWrapper, LoadingWheel, LockClosed, LockOpen, MenuItem, Modal, MoreVertical, MultiInput, MultiSelect, OpenInNew, Pagination, PauboxUIThemeProvider, Popper, RadioButton, RadioGroup, Return, SearchBar, SearchIcon, SearchOmnibox, Select, StatCard, Success, Table, TableContainer, TableWrapper, TextArea, Toggle, Tooltip, Typography, Warning, Wrapper, baseTypography, colors, darkColors, elevation, spacing, typography, useTheme };
37395
+ export { Add, AlertBar, AutoComplete, BaseInput$1 as BaseInput, BaseTextArea, Button, Calendar, CalendarIcon$1 as CalendarIcon, Cancel, Checkbox, ChevronDown, ChevronLeft, ChevronRight, ChevronUp, Close, DEFAULT_PAGE_SIZE_OPTIONS, DEFAULT_SPACING, DatePicker, Delete, DropdownMenu, Edit, Error$1 as Error, FilterForm, FilterList, IconButton, IconWrapper$3 as IconWrapper, Info, Input, InputWrapper$3 as InputWrapper, LoadingWheel, LockClosed, LockOpen, MenuItem, Modal, MoreVertical, MultiInput, MultiSelect, OpenInNew, Pagination, PauboxUIThemeProvider, Popper, RadioButton, RadioGroup, Return, SearchBar, SearchIcon, SearchOmnibox, Select, StatCard, Success, Table, TableContainer, TableWrapper, TextArea, Toggle, Tooltip, Typography, Warning, Wrapper, baseTypography, colors, darkColors, elevation, spacing, typography, useTheme };
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": "3.4.0",
5
+ "version": "3.5.0",
6
6
  "type": "module",
7
7
  "private": false,
8
8
  "publishConfig": {
@@ -1,3 +1,4 @@
1
+ export declare const DEFAULT_PAGE_SIZE_OPTIONS: number[];
1
2
  export interface PageInfoPageBased {
2
3
  currentPage: number;
3
4
  pageSize: number;
@@ -16,6 +17,7 @@ interface BasePaginationProps {
16
17
  isLoading: boolean;
17
18
  subText?: string;
18
19
  onPageSizeChange: (size: number) => void;
20
+ pageSizeOptions?: number[];
19
21
  testId?: string;
20
22
  }
21
23
  interface PagePaginationProps extends BasePaginationProps {
@@ -29,5 +31,5 @@ interface CursorPaginationProps extends BasePaginationProps {
29
31
  onPageChange: (page: 'next' | 'prev') => void;
30
32
  }
31
33
  export type PaginationProps = PagePaginationProps | CursorPaginationProps;
32
- export declare const Pagination: ({ mode, pageInfo, isLoading, onPageSizeChange, subText, onPageChange, testId, }: PaginationProps) => import("@emotion/react/jsx-runtime").JSX.Element;
34
+ export declare const Pagination: ({ mode, pageInfo, isLoading, onPageSizeChange, pageSizeOptions, subText, onPageChange, testId, }: PaginationProps) => import("@emotion/react/jsx-runtime").JSX.Element;
33
35
  export {};
@@ -48,6 +48,7 @@ interface PaginationProps {
48
48
  pageInfo?: PageInfoPageBased | PageInfoCursorBased;
49
49
  subText?: string;
50
50
  onPageSizeChange?: (size: number) => void;
51
+ pageSizeOptions?: number[];
51
52
  onPageChange?: (page: number | 'next' | 'prev') => void;
52
53
  }
53
54
  interface TableDataProps<T> {
@@ -64,5 +65,5 @@ interface TableDataProps<T> {
64
65
  }
65
66
  export interface TableProps<T extends object> extends TableStyleProps, TableRowProps<T>, TableDataProps<T>, PaginationProps {
66
67
  }
67
- export declare const Table: <T extends object>({ columns, data, getRowId, isLoading, paginationMode, pageInfo, subText, onPageSizeChange, onPageChange, sortBy, sortOrder, onSortChange, enableRowSelection, selectedRows, onRowSelectionChange, getRowDisabled, onRowClick, contextMenuActions, dense, height, containerStyle, error, testId, toolbar, }: TableProps<T>) => import("@emotion/react/jsx-runtime").JSX.Element;
68
+ export declare const Table: <T extends object>({ columns, data, getRowId, isLoading, paginationMode, pageInfo, subText, onPageSizeChange, pageSizeOptions, onPageChange, sortBy, sortOrder, onSortChange, enableRowSelection, selectedRows, onRowSelectionChange, getRowDisabled, onRowClick, contextMenuActions, dense, height, containerStyle, error, testId, toolbar, }: TableProps<T>) => import("@emotion/react/jsx-runtime").JSX.Element;
68
69
  export {};