@paubox/ui 1.7.0 → 1.9.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
@@ -2,7 +2,7 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import styled from '@emotion/styled';
3
3
  import { css } from '@emotion/react';
4
4
  import * as React from 'react';
5
- import React__default, { useState, useRef, forwardRef, useLayoutEffect, useEffect, createElement, cloneElement, Component, createRef, useCallback, useId as useId$1, useMemo } from 'react';
5
+ import React__default, { useState, useRef, forwardRef, useLayoutEffect, useEffect, createElement, cloneElement, Component, createRef, useCallback, useId as useId$1, useMemo, Fragment as Fragment$1 } from 'react';
6
6
  import * as ReactDOM from 'react-dom';
7
7
  import ReactDOM__default, { createPortal } from 'react-dom';
8
8
 
@@ -1720,11 +1720,11 @@ function _templateObject2$i() {
1720
1720
  };
1721
1721
  return data;
1722
1722
  }
1723
- function _templateObject3$d() {
1723
+ function _templateObject3$e() {
1724
1724
  var data = _tagged_template_literal$u([
1725
1725
  "\n box-shadow: 0px 8px 32px 0px #00000029;\n"
1726
1726
  ]);
1727
- _templateObject3$d = function _templateObject() {
1727
+ _templateObject3$e = function _templateObject() {
1728
1728
  return data;
1729
1729
  };
1730
1730
  return data;
@@ -1732,7 +1732,7 @@ function _templateObject3$d() {
1732
1732
  var elevation100 = css(_templateObject$u());
1733
1733
  var elevation200 = css(_templateObject1$j());
1734
1734
  var elevation300 = css(_templateObject2$i());
1735
- var elevation400 = css(_templateObject3$d());
1735
+ var elevation400 = css(_templateObject3$e());
1736
1736
 
1737
1737
  var elevation = /*#__PURE__*/Object.freeze({
1738
1738
  __proto__: null,
@@ -1792,7 +1792,7 @@ function _templateObject2$h() {
1792
1792
  };
1793
1793
  return data;
1794
1794
  }
1795
- function _templateObject3$c() {
1795
+ function _templateObject3$d() {
1796
1796
  var data = _tagged_template_literal$t([
1797
1797
  "\n ",
1798
1798
  "\n font-size: ",
@@ -1800,12 +1800,12 @@ function _templateObject3$c() {
1800
1800
  "rem;\n letter-spacing: ",
1801
1801
  "px;\n font-weight: 400;\n"
1802
1802
  ]);
1803
- _templateObject3$c = function _templateObject() {
1803
+ _templateObject3$d = function _templateObject() {
1804
1804
  return data;
1805
1805
  };
1806
1806
  return data;
1807
1807
  }
1808
- function _templateObject4$9() {
1808
+ function _templateObject4$b() {
1809
1809
  var data = _tagged_template_literal$t([
1810
1810
  "\n ",
1811
1811
  "\n font-size: ",
@@ -1813,12 +1813,12 @@ function _templateObject4$9() {
1813
1813
  "rem;\n letter-spacing: ",
1814
1814
  "px;\n font-weight: 600;\n"
1815
1815
  ]);
1816
- _templateObject4$9 = function _templateObject() {
1816
+ _templateObject4$b = function _templateObject() {
1817
1817
  return data;
1818
1818
  };
1819
1819
  return data;
1820
1820
  }
1821
- function _templateObject5$4() {
1821
+ function _templateObject5$5() {
1822
1822
  var data = _tagged_template_literal$t([
1823
1823
  "\n ",
1824
1824
  "\n font-size: ",
@@ -1826,12 +1826,12 @@ function _templateObject5$4() {
1826
1826
  "rem;\n letter-spacing: ",
1827
1827
  "px;\n font-weight: 400;\n"
1828
1828
  ]);
1829
- _templateObject5$4 = function _templateObject() {
1829
+ _templateObject5$5 = function _templateObject() {
1830
1830
  return data;
1831
1831
  };
1832
1832
  return data;
1833
1833
  }
1834
- function _templateObject6$2() {
1834
+ function _templateObject6$3() {
1835
1835
  var data = _tagged_template_literal$t([
1836
1836
  "\n ",
1837
1837
  "\n font-size: ",
@@ -1839,12 +1839,12 @@ function _templateObject6$2() {
1839
1839
  "rem;\n letter-spacing: ",
1840
1840
  "px;\n font-weight: 600;\n"
1841
1841
  ]);
1842
- _templateObject6$2 = function _templateObject() {
1842
+ _templateObject6$3 = function _templateObject() {
1843
1843
  return data;
1844
1844
  };
1845
1845
  return data;
1846
1846
  }
1847
- function _templateObject7$1() {
1847
+ function _templateObject7$2() {
1848
1848
  var data = _tagged_template_literal$t([
1849
1849
  "\n ",
1850
1850
  "\n font-size: ",
@@ -1852,7 +1852,7 @@ function _templateObject7$1() {
1852
1852
  "rem;\n letter-spacing: ",
1853
1853
  "px;\n font-weight: 400;\n"
1854
1854
  ]);
1855
- _templateObject7$1 = function _templateObject() {
1855
+ _templateObject7$2 = function _templateObject() {
1856
1856
  return data;
1857
1857
  };
1858
1858
  return data;
@@ -2095,12 +2095,12 @@ var commonStyles = css(_templateObject$t());
2095
2095
  // HEADLINES
2096
2096
  var $headline100Regular = css(_templateObject1$i(), commonStyles, headline100FontSize / BASE_FONT_SIZE, headline100LineHeight / BASE_FONT_SIZE, headline100LetterSpacing);
2097
2097
  var $headline100Semibold = css(_templateObject2$h(), commonStyles, headline100FontSize / BASE_FONT_SIZE, headline100LineHeight / BASE_FONT_SIZE, headline100LetterSpacing);
2098
- var $headline200Regular = css(_templateObject3$c(), commonStyles, headline200FontSize / BASE_FONT_SIZE, headline200LineHeight / BASE_FONT_SIZE, headline200LetterSpacing);
2099
- var $headline200Semibold = css(_templateObject4$9(), commonStyles, headline200FontSize / BASE_FONT_SIZE, headline200LineHeight / BASE_FONT_SIZE, headline200LetterSpacing);
2100
- var $headline300Regular = css(_templateObject5$4(), commonStyles, headline300FontSize / BASE_FONT_SIZE, headline300LineHeight / BASE_FONT_SIZE, headline300LetterSpacing);
2101
- var $headline300Semibold = css(_templateObject6$2(), commonStyles, headline300FontSize / BASE_FONT_SIZE, headline300LineHeight / BASE_FONT_SIZE, headline300LetterSpacing);
2098
+ var $headline200Regular = css(_templateObject3$d(), commonStyles, headline200FontSize / BASE_FONT_SIZE, headline200LineHeight / BASE_FONT_SIZE, headline200LetterSpacing);
2099
+ var $headline200Semibold = css(_templateObject4$b(), commonStyles, headline200FontSize / BASE_FONT_SIZE, headline200LineHeight / BASE_FONT_SIZE, headline200LetterSpacing);
2100
+ var $headline300Regular = css(_templateObject5$5(), commonStyles, headline300FontSize / BASE_FONT_SIZE, headline300LineHeight / BASE_FONT_SIZE, headline300LetterSpacing);
2101
+ var $headline300Semibold = css(_templateObject6$3(), commonStyles, headline300FontSize / BASE_FONT_SIZE, headline300LineHeight / BASE_FONT_SIZE, headline300LetterSpacing);
2102
2102
  // PARAGRAPH
2103
- var $paragraph100Regular = css(_templateObject7$1(), commonStyles, paragraph100FontSize / BASE_FONT_SIZE, paragraph100LineHeight / BASE_FONT_SIZE, paragraph100LetterSpacing);
2103
+ var $paragraph100Regular = css(_templateObject7$2(), commonStyles, paragraph100FontSize / BASE_FONT_SIZE, paragraph100LineHeight / BASE_FONT_SIZE, paragraph100LetterSpacing);
2104
2104
  var $paragraph100Semibold = css(_templateObject8(), commonStyles, paragraph100FontSize / BASE_FONT_SIZE, paragraph100LineHeight / BASE_FONT_SIZE, paragraph100LetterSpacing);
2105
2105
  var $paragraph200Regular = css(_templateObject9(), commonStyles, paragraph200FontSize / BASE_FONT_SIZE, paragraph200LineHeight / BASE_FONT_SIZE, paragraph200LetterSpacing);
2106
2106
  var $paragraph200Semibold = css(_templateObject10(), commonStyles, paragraph200FontSize / BASE_FONT_SIZE, paragraph200LineHeight / BASE_FONT_SIZE, paragraph200LetterSpacing);
@@ -2239,32 +2239,32 @@ function _templateObject2$g() {
2239
2239
  };
2240
2240
  return data;
2241
2241
  }
2242
- function _templateObject3$b() {
2242
+ function _templateObject3$c() {
2243
2243
  var data = _tagged_template_literal$s([
2244
2244
  "\n font-size: 1.5rem;\n color: ",
2245
2245
  ";\n margin-bottom: auto;\n flex-shrink: 0;\n"
2246
2246
  ]);
2247
- _templateObject3$b = function _templateObject() {
2247
+ _templateObject3$c = function _templateObject() {
2248
2248
  return data;
2249
2249
  };
2250
2250
  return data;
2251
2251
  }
2252
- function _templateObject4$8() {
2252
+ function _templateObject4$a() {
2253
2253
  var data = _tagged_template_literal$s([
2254
2254
  "\n display: flex;\n flex-direction: column;\n gap: 0.25rem;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 100%;\n"
2255
2255
  ]);
2256
- _templateObject4$8 = function _templateObject() {
2256
+ _templateObject4$a = function _templateObject() {
2257
2257
  return data;
2258
2258
  };
2259
2259
  return data;
2260
2260
  }
2261
- function _templateObject5$3() {
2261
+ function _templateObject5$4() {
2262
2262
  var data = _tagged_template_literal$s([
2263
2263
  "\n background-color: transparent;\n border: none;\n color: ",
2264
2264
  ";\n cursor: pointer;\n padding: 0.25rem;\n font-size: 0.75rem;\n margin-left: ",
2265
2265
  ";\n"
2266
2266
  ]);
2267
- _templateObject5$3 = function _templateObject() {
2267
+ _templateObject5$4 = function _templateObject() {
2268
2268
  return data;
2269
2269
  };
2270
2270
  return data;
@@ -2281,12 +2281,12 @@ var Title = styled.h1(_templateObject1$h(), function(param) {
2281
2281
  return size === 'large' ? $paragraph100Semibold : $paragraph200Regular;
2282
2282
  });
2283
2283
  var Text = styled.p(_templateObject2$g(), $paragraph200Regular);
2284
- var StyledIcon = styled.div(_templateObject3$b(), function(param) {
2284
+ var StyledIcon = styled.div(_templateObject3$c(), function(param) {
2285
2285
  var type = param.type;
2286
2286
  return type === 'info' ? primary700 : type === 'error' ? danger700 : type === 'success' ? success700 : warning700;
2287
2287
  });
2288
- var TextWrapper = styled.div(_templateObject4$8());
2289
- var TruncaterButton = styled.button(_templateObject5$3(), primary700, function(param) {
2288
+ var TextWrapper = styled.div(_templateObject4$a());
2289
+ var TruncaterButton = styled.button(_templateObject5$4(), primary700, function(param) {
2290
2290
  var isExpanded = param.isExpanded;
2291
2291
  return !isExpanded ? '0' : '0.25rem';
2292
2292
  });
@@ -22898,11 +22898,11 @@ function _templateObject2$e() {
22898
22898
  };
22899
22899
  return data;
22900
22900
  }
22901
- function _templateObject3$a() {
22901
+ function _templateObject3$b() {
22902
22902
  var data = _tagged_template_literal$j([
22903
22903
  "\n width: 100%;\n min-width: 0;\n"
22904
22904
  ]);
22905
- _templateObject3$a = function _templateObject() {
22905
+ _templateObject3$b = function _templateObject() {
22906
22906
  return data;
22907
22907
  };
22908
22908
  return data;
@@ -22913,7 +22913,7 @@ var RowContainer = styled.div(_templateObject$j(), function(param) {
22913
22913
  });
22914
22914
  var ContentContainer = styled.div(_templateObject1$f());
22915
22915
  var SelectContainer = styled.div(_templateObject2$e());
22916
- var MultiInputContainer = styled.div(_templateObject3$a());
22916
+ var MultiInputContainer = styled.div(_templateObject3$b());
22917
22917
  var FilterRow = function(param) {
22918
22918
  var filterKey = param.filterKey, rowIndex = param.rowIndex, values = param.values, errors = param.errors, touched = param.touched, onChange = param.onChange, onRemove = param.onRemove, fieldOptions = param.fieldOptions, operatorOptions = param.operatorOptions, showRemove = param.showRemove;
22919
22919
  var _touched_filters_filterKey_rowIndex, _touched_filters_filterKey, _touched_filters, _errors_filters_filterKey_rowIndex, _errors_filters_filterKey, _errors_filters, _touched_filters_filterKey_rowIndex1, _touched_filters_filterKey1, _touched_filters1, _errors_filters_filterKey_rowIndex1, _errors_filters_filterKey1, _errors_filters1, _touched_filters_filterKey_rowIndex2, _touched_filters_filterKey2, _touched_filters2, _errors_filters_filterKey_rowIndex2, _errors_filters_filterKey2, _errors_filters2;
@@ -23136,39 +23136,39 @@ function _templateObject2$d() {
23136
23136
  };
23137
23137
  return data;
23138
23138
  }
23139
- function _templateObject3$9() {
23139
+ function _templateObject3$a() {
23140
23140
  var data = _tagged_template_literal$i([
23141
23141
  "\n display: flex;\n width: 100%;\n flex-direction: column;\n flex-wrap: wrap;\n gap: 1rem;\n border-color: #e5e7eb;\n"
23142
23142
  ]);
23143
- _templateObject3$9 = function _templateObject() {
23143
+ _templateObject3$a = function _templateObject() {
23144
23144
  return data;
23145
23145
  };
23146
23146
  return data;
23147
23147
  }
23148
- function _templateObject4$7() {
23148
+ function _templateObject4$9() {
23149
23149
  var data = _tagged_template_literal$i([
23150
23150
  "\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: ",
23151
23151
  ";\n }\n &:disabled {\n cursor: not-allowed;\n }\n }\n"
23152
23152
  ]);
23153
- _templateObject4$7 = function _templateObject() {
23153
+ _templateObject4$9 = function _templateObject() {
23154
23154
  return data;
23155
23155
  };
23156
23156
  return data;
23157
23157
  }
23158
- function _templateObject5$2() {
23158
+ function _templateObject5$3() {
23159
23159
  var data = _tagged_template_literal$i([
23160
23160
  "\n display: flex;\n flex-direction: row;\n gap: 0.5rem;\n"
23161
23161
  ]);
23162
- _templateObject5$2 = function _templateObject() {
23162
+ _templateObject5$3 = function _templateObject() {
23163
23163
  return data;
23164
23164
  };
23165
23165
  return data;
23166
23166
  }
23167
- function _templateObject6$1() {
23167
+ function _templateObject6$2() {
23168
23168
  var data = _tagged_template_literal$i([
23169
23169
  "\n width: 100%;\n padding: 1rem;\n padding-top: 0;\n box-sizing: border-box;\n"
23170
23170
  ]);
23171
- _templateObject6$1 = function _templateObject() {
23171
+ _templateObject6$2 = function _templateObject() {
23172
23172
  return data;
23173
23173
  };
23174
23174
  return data;
@@ -23182,10 +23182,10 @@ var FilterGroup = styled.div(_templateObject1$e(), function(param) {
23182
23182
  return isHovered ? danger200 : '#e5e7eb';
23183
23183
  });
23184
23184
  var CloseButton$1 = styled.button(_templateObject2$d());
23185
- var FilterRowsContainer = styled.div(_templateObject3$9());
23186
- var OrButton = styled.button(_templateObject4$7(), neutral100);
23187
- var ButtonGroup = styled.div(_templateObject5$2());
23188
- var AndButtonContainer = styled.div(_templateObject6$1());
23185
+ var FilterRowsContainer = styled.div(_templateObject3$a());
23186
+ var OrButton = styled.button(_templateObject4$9(), neutral100);
23187
+ var ButtonGroup = styled.div(_templateObject5$3());
23188
+ var AndButtonContainer = styled.div(_templateObject6$2());
23189
23189
  var FilterForm = function(param) {
23190
23190
  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;
23191
23191
  var _useState = _sliced_to_array$c(useState(undefined), 2), isHovered = _useState[0], setIsHovered = _useState[1];
@@ -23778,7 +23778,8 @@ function _templateObject$g() {
23778
23778
  }
23779
23779
  function _templateObject1$c() {
23780
23780
  var data = _tagged_template_literal$g([
23781
- "\n display: flex;\n align-items: center;\n\n width: 100%;\n position: relative;\n cursor: pointer;\n &:hover {\n background-color: ",
23781
+ "\n display: flex;\n align-items: center;\n\n width: 100%;\n position: relative;\n cursor: ",
23782
+ ";\n &:hover {\n background-color: ",
23782
23783
  ";\n }\n transition: all 150ms ease-in-out;\n\n &:focus-within {\n border-color: ",
23783
23784
  ";\n }\n\n &:focus {\n background-color: ",
23784
23785
  ";\n }\n\n border: 1px solid\n ",
@@ -23792,7 +23793,7 @@ function _templateObject1$c() {
23792
23793
  }
23793
23794
  function _templateObject2$b() {
23794
23795
  var data = _tagged_template_literal$g([
23795
- "\n flex: 1;\n z-index: 2;\n cursor: pointer;\n border: none;\n background-color: transparent;\n\n -webkit-appearance: none;\n -moz-appearance: none;\n &::-ms-expand {\n display: none;\n }\n &::placeholder {\n color: ",
23796
+ "\n flex: 1;\n z-index: 2;\n pointer-events: none;\n border: none;\n background-color: transparent;\n\n -webkit-appearance: none;\n -moz-appearance: none;\n &::-ms-expand {\n display: none;\n }\n &::placeholder {\n color: ",
23796
23797
  ";\n }\n color: ",
23797
23798
  ";\n padding: ",
23798
23799
  ";\n padding-right: 2rem;\n outline: none;\n &::placeholder {\n color: ",
@@ -23804,57 +23805,57 @@ function _templateObject2$b() {
23804
23805
  };
23805
23806
  return data;
23806
23807
  }
23807
- function _templateObject3$8() {
23808
+ function _templateObject3$9() {
23808
23809
  var data = _tagged_template_literal$g([
23809
23810
  "\n background-color: ",
23810
23811
  ";\n border-radius: 1rem;\n border: none;\n cursor: pointer;\n padding: 0.25rem 0.313rem;\n white-space: nowrap;\n display: flex;\n gap: 0.25rem;\n ",
23811
23812
  "\n align-items: center;\n justify-content: center;\n"
23812
23813
  ]);
23813
- _templateObject3$8 = function _templateObject() {
23814
+ _templateObject3$9 = function _templateObject() {
23814
23815
  return data;
23815
23816
  };
23816
23817
  return data;
23817
23818
  }
23818
- function _templateObject4$6() {
23819
+ function _templateObject4$8() {
23819
23820
  var data = _tagged_template_literal$g([
23820
23821
  "\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: ",
23821
23822
  ";\n border-radius: 2px;\n display: block;\n width: 95%;\n }\n\n &::-webkit-scrollbar-thumb {\n background: ",
23822
23823
  ";\n border-radius: 2px;\n display: block;\n }\n\n padding: ",
23823
23824
  ";\n"
23824
23825
  ]);
23825
- _templateObject4$6 = function _templateObject() {
23826
+ _templateObject4$8 = function _templateObject() {
23826
23827
  return data;
23827
23828
  };
23828
23829
  return data;
23829
23830
  }
23830
- function _templateObject5$1() {
23831
+ function _templateObject5$2() {
23831
23832
  var data = _tagged_template_literal$g([
23832
23833
  "\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: ",
23833
23834
  ";\n"
23834
23835
  ]);
23835
- _templateObject5$1 = function _templateObject() {
23836
+ _templateObject5$2 = function _templateObject() {
23836
23837
  return data;
23837
23838
  };
23838
23839
  return data;
23839
23840
  }
23840
- function _templateObject6() {
23841
+ function _templateObject6$1() {
23841
23842
  var data = _tagged_template_literal$g([
23842
23843
  "\n ",
23843
23844
  "\n color: ",
23844
23845
  "/80;\n"
23845
23846
  ]);
23846
- _templateObject6 = function _templateObject() {
23847
+ _templateObject6$1 = function _templateObject() {
23847
23848
  return data;
23848
23849
  };
23849
23850
  return data;
23850
23851
  }
23851
- function _templateObject7() {
23852
+ function _templateObject7$1() {
23852
23853
  var data = _tagged_template_literal$g([
23853
23854
  "\n ",
23854
23855
  "\n color: ",
23855
23856
  ";\n"
23856
23857
  ]);
23857
- _templateObject7 = function _templateObject() {
23858
+ _templateObject7$1 = function _templateObject() {
23858
23859
  return data;
23859
23860
  };
23860
23861
  return data;
@@ -23862,6 +23863,9 @@ function _templateObject7() {
23862
23863
  // Wrapper for the Input and Icons
23863
23864
  var InputWrapper$2 = styled.div(_templateObject$g());
23864
23865
  var MultiSelectWrapper = styled.div(_templateObject1$c(), function(param) {
23866
+ var disabled = param.disabled;
23867
+ return disabled ? 'not-allowed' : 'pointer';
23868
+ }, function(param) {
23865
23869
  var disabled = param.disabled, type = param.type;
23866
23870
  return disabled || type === 'secondary' ? neutral100 : 'white';
23867
23871
  }, function(param) {
@@ -23888,21 +23892,24 @@ var BaseSelect$1 = styled.select(_templateObject2$b(), neutral500, function(para
23888
23892
  var sz = param.sz, type = param.type;
23889
23893
  return type === 'primary' ? sz === 'lg' ? $paragraph100Regular : $paragraph200Regular : sz === 'lg' ? $paragraph100Semibold : $paragraph200Semibold;
23890
23894
  });
23891
- var Chip$1 = styled.button(_templateObject3$8(), function(param) {
23895
+ var Chip$1 = styled.button(_templateObject3$9(), function(param) {
23892
23896
  var secondary = param.secondary;
23893
23897
  return secondary ? neutral300 : neutral100;
23894
23898
  }, function(param) {
23895
23899
  var sz = param.sz;
23896
23900
  return sz === 'lg' ? $label100Medium : $label200Medium;
23897
23901
  });
23898
- var ChipWrapper$1 = styled.div(_templateObject4$6(), neutral100, neutral300, function(param) {
23902
+ var ChipWrapper$1 = styled.div(_templateObject4$8(), neutral100, neutral300, function(param) {
23899
23903
  var sz = param.sz;
23900
23904
  return sz === 'lg' ? '0.5rem 0.563rem' : '0.375rem 0.563rem';
23901
23905
  });
23902
23906
  var MultiSelectChip = function(option) {
23903
23907
  var label = option.label, onClick = option.onClick, _option_type = option.type, type = _option_type === void 0 ? 'primary' : _option_type, _option_sz = option.sz, sz = _option_sz === void 0 ? 'sm' : _option_sz;
23904
23908
  return /*#__PURE__*/ jsxs(Chip$1, {
23905
- onClick: onClick,
23909
+ onClick: function(e) {
23910
+ e.stopPropagation();
23911
+ onClick();
23912
+ },
23906
23913
  secondary: type === 'secondary',
23907
23914
  sz: sz,
23908
23915
  children: [
@@ -23912,12 +23919,12 @@ var MultiSelectChip = function(option) {
23912
23919
  });
23913
23920
  };
23914
23921
  // Style for the Icons
23915
- var IconWrapper$2 = styled.div(_templateObject5$1(), function(param) {
23922
+ var IconWrapper$2 = styled.div(_templateObject5$2(), function(param) {
23916
23923
  var open = param.open;
23917
23924
  return open ? 'rotate(180deg)' : 'rotate(0deg)';
23918
23925
  });
23919
- var PlaceholderOption = styled.option(_templateObject6(), $paragraph100Semibold, textSecondary);
23920
- var SelectedOption = styled.option(_templateObject7(), $paragraph200Regular, textPrimary);
23926
+ var PlaceholderOption = styled.option(_templateObject6$1(), $paragraph100Semibold, textSecondary);
23927
+ var SelectedOption = styled.option(_templateObject7$1(), $paragraph200Regular, textPrimary);
23921
23928
  var MultiSelect = function(_param) {
23922
23929
  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 placeholder = _param.placeholder, label = _param.label, _param_chips = _param.chips, chips = _param_chips === void 0 ? false : _param_chips, className = _param.className, values = _param.values, setValues = _param.setValues, _param_disabled = _param.disabled, disabled = _param_disabled === void 0 ? false : _param_disabled, _param_type = _param.type, type = _param_type === void 0 ? 'primary' : _param_type, props = _object_without_properties$e(_param, [
23923
23930
  "sz",
@@ -23934,7 +23941,7 @@ var MultiSelect = function(_param) {
23934
23941
  "type"
23935
23942
  ]);
23936
23943
  var _useState = _sliced_to_array$b(useState(false), 2), open = _useState[0], setOpen = _useState[1];
23937
- var selectRef = useRef(null);
23944
+ var wrapperRef = useRef(null);
23938
23945
  var toggleSelect = function(option) {
23939
23946
  setValues(values.some(function(val) {
23940
23947
  return val === option.value;
@@ -23945,22 +23952,21 @@ var MultiSelect = function(_param) {
23945
23952
  ]), option);
23946
23953
  };
23947
23954
  return /*#__PURE__*/ jsxs(MultiSelectWrapper, {
23955
+ ref: wrapperRef,
23948
23956
  disabled: disabled,
23949
23957
  type: type,
23950
23958
  error: error,
23951
23959
  open: open,
23952
23960
  className: className,
23961
+ onClick: function() {
23962
+ return !disabled && setOpen(function(prev) {
23963
+ return !prev;
23964
+ });
23965
+ },
23953
23966
  children: [
23954
23967
  /*#__PURE__*/ jsxs(InputWrapper$2, {
23955
23968
  children: [
23956
- /*#__PURE__*/ jsx(BaseSelect$1, _object_spread_props$j(_object_spread$n({
23957
- ref: selectRef,
23958
- onClick: function() {
23959
- setOpen(function(prev) {
23960
- return !prev;
23961
- });
23962
- }
23963
- }, props), {
23969
+ /*#__PURE__*/ jsx(BaseSelect$1, _object_spread_props$j(_object_spread$n({}, props), {
23964
23970
  type: type,
23965
23971
  sz: sz,
23966
23972
  value: values,
@@ -24009,7 +24015,7 @@ var MultiSelect = function(_param) {
24009
24015
  onClose: function() {
24010
24016
  return setOpen(false);
24011
24017
  },
24012
- anchorRef: selectRef,
24018
+ anchorRef: wrapperRef,
24013
24019
  align: "start",
24014
24020
  offset: 4,
24015
24021
  maxHeight: 400,
@@ -24025,8 +24031,9 @@ var MultiSelect = function(_param) {
24025
24031
  return val === option.value;
24026
24032
  })
24027
24033
  }, option), {
24028
- onClick: function() {
24029
- return toggleSelect(option);
24034
+ onClick: function(e) {
24035
+ e.stopPropagation();
24036
+ toggleSelect(option);
24030
24037
  }
24031
24038
  }), option.value);
24032
24039
  })
@@ -24377,21 +24384,21 @@ function _templateObject2$a() {
24377
24384
  };
24378
24385
  return data;
24379
24386
  }
24380
- function _templateObject3$7() {
24387
+ function _templateObject3$8() {
24381
24388
  var data = _tagged_template_literal$e([
24382
24389
  "\n display: flex;\n gap: 0.25rem;\n flex-wrap: wrap;\n height: auto;\n"
24383
24390
  ]);
24384
- _templateObject3$7 = function _templateObject() {
24391
+ _templateObject3$8 = function _templateObject() {
24385
24392
  return data;
24386
24393
  };
24387
24394
  return data;
24388
24395
  }
24389
- function _templateObject4$5() {
24396
+ function _templateObject4$7() {
24390
24397
  var data = _tagged_template_literal$e([
24391
24398
  "\n position: absolute;\n right: 0.5rem;\n opacity: 0.8;\n\n ",
24392
24399
  "\n"
24393
24400
  ]);
24394
- _templateObject4$5 = function _templateObject() {
24401
+ _templateObject4$7 = function _templateObject() {
24395
24402
  return data;
24396
24403
  };
24397
24404
  return data;
@@ -24412,8 +24419,8 @@ var Chip = styled.button(_templateObject2$a(), function(param) {
24412
24419
  var secondary = param.secondary;
24413
24420
  return secondary ? neutral300 : neutral100;
24414
24421
  }, $label200Medium);
24415
- var ChipWrapper = styled.div(_templateObject3$7());
24416
- var ChipCounter = styled.p(_templateObject4$5(), function(param) {
24422
+ var ChipWrapper = styled.div(_templateObject3$8());
24423
+ var ChipCounter = styled.p(_templateObject4$7(), function(param) {
24417
24424
  var sz = param.sz, type = param.type;
24418
24425
  return type === 'primary' ? sz === 'lg' ? $paragraph100Regular : $paragraph200Regular : sz === 'lg' ? $paragraph100Semibold : $paragraph200Semibold;
24419
24426
  });
@@ -24679,7 +24686,8 @@ function _templateObject$d() {
24679
24686
  }
24680
24687
  function _templateObject1$a() {
24681
24688
  var data = _tagged_template_literal$d([
24682
- "\n display: flex;\n align-items: center;\n width: max-content;\n position: relative;\n cursor: pointer;\n &:hover {\n background-color: ",
24689
+ "\n display: flex;\n align-items: center;\n width: max-content;\n position: relative;\n cursor: ",
24690
+ ";\n &:hover {\n background-color: ",
24683
24691
  ";\n }\n transition: all 150ms ease-in-out;\n\n &:focus-within {\n border-color: ",
24684
24692
  ";\n }\n\n &:focus {\n background-color: ",
24685
24693
  ";\n }\n\n border: 1px solid\n ",
@@ -24694,7 +24702,7 @@ function _templateObject1$a() {
24694
24702
  }
24695
24703
  function _templateObject2$9() {
24696
24704
  var data = _tagged_template_literal$d([
24697
- "\n flex: 1;\n cursor: pointer;\n border: none;\n width: 100%;\n text-overflow: ellipsis;\n white-space: nowrap;\n background-color: transparent;\n z-index: 1;\n -webkit-appearance: none;\n -moz-appearance: none;\n &::-ms-expand {\n display: none;\n }\n color: ",
24705
+ "\n flex: 1;\n pointer-events: none;\n border: none;\n width: 100%;\n text-overflow: ellipsis;\n white-space: nowrap;\n background-color: transparent;\n z-index: 1;\n -webkit-appearance: none;\n -moz-appearance: none;\n &::-ms-expand {\n display: none;\n }\n color: ",
24698
24706
  ";\n padding: ",
24699
24707
  ";\n padding-right: 2rem;\n outline: none;\n\n ",
24700
24708
  "\n"
@@ -24704,24 +24712,24 @@ function _templateObject2$9() {
24704
24712
  };
24705
24713
  return data;
24706
24714
  }
24707
- function _templateObject3$6() {
24715
+ function _templateObject3$7() {
24708
24716
  var data = _tagged_template_literal$d([
24709
24717
  "\n position: absolute;\n right: 0rem;\n width: 2rem;\n font-size: ",
24710
24718
  "rem;\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 transition: all 150ms ease-in-out;\n transform: ",
24711
24719
  ";\n"
24712
24720
  ]);
24713
- _templateObject3$6 = function _templateObject() {
24721
+ _templateObject3$7 = function _templateObject() {
24714
24722
  return data;
24715
24723
  };
24716
24724
  return data;
24717
24725
  }
24718
- function _templateObject4$4() {
24726
+ function _templateObject4$6() {
24719
24727
  var data = _tagged_template_literal$d([
24720
24728
  "\n ",
24721
24729
  "\n color: ",
24722
24730
  ";\n"
24723
24731
  ]);
24724
- _templateObject4$4 = function _templateObject() {
24732
+ _templateObject4$6 = function _templateObject() {
24725
24733
  return data;
24726
24734
  };
24727
24735
  return data;
@@ -24729,6 +24737,9 @@ function _templateObject4$4() {
24729
24737
  // Wrapper for the Input and Icons
24730
24738
  var InputWrapper = styled.div(_templateObject$d());
24731
24739
  var SelectWrapper = styled.div(_templateObject1$a(), function(param) {
24740
+ var disabled = param.disabled;
24741
+ return disabled ? 'not-allowed' : 'pointer';
24742
+ }, function(param) {
24732
24743
  var disabled = param.disabled, type = param.type;
24733
24744
  return disabled || type === 'secondary' ? neutral100 : 'white';
24734
24745
  }, function(param) {
@@ -24752,14 +24763,14 @@ var BaseSelect = styled.select(_templateObject2$9(), textPrimary, function(param
24752
24763
  var sz = param.sz, type = param.type;
24753
24764
  return type === 'primary' ? sz === 'lg' ? $paragraph100Regular : $paragraph200Regular : sz === 'lg' ? $paragraph100Semibold : $paragraph200Semibold;
24754
24765
  });
24755
- var IconWrapper$1 = styled.div(_templateObject3$6(), function(param) {
24766
+ var IconWrapper$1 = styled.div(_templateObject3$7(), function(param) {
24756
24767
  var sz = param.sz;
24757
24768
  return sz === 'lg' ? 1 : 0.75;
24758
24769
  }, function(param) {
24759
24770
  var open = param.open;
24760
24771
  return open ? 'rotate(180deg)' : 'rotate(0deg)';
24761
24772
  });
24762
- var SelectOption = styled.option(_templateObject4$4(), $paragraph100Semibold, textPrimary);
24773
+ var SelectOption = styled.option(_templateObject4$6(), $paragraph100Semibold, textPrimary);
24763
24774
  var Select = function(_param) {
24764
24775
  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, props = _object_without_properties$b(_param, [
24765
24776
  "sz",
@@ -24797,16 +24808,15 @@ var Select = function(_param) {
24797
24808
  error: error,
24798
24809
  open: open,
24799
24810
  style: style,
24811
+ onClick: function() {
24812
+ return !disabled && setOpen(function(prev) {
24813
+ return !prev;
24814
+ });
24815
+ },
24800
24816
  children: [
24801
24817
  /*#__PURE__*/ jsxs(InputWrapper, {
24802
24818
  children: [
24803
- /*#__PURE__*/ jsx(BaseSelect, _object_spread_props$h(_object_spread$k({
24804
- onClick: function() {
24805
- return setOpen(function(prev) {
24806
- return !prev;
24807
- });
24808
- }
24809
- }, props), {
24819
+ /*#__PURE__*/ jsx(BaseSelect, _object_spread_props$h(_object_spread$k({}, props), {
24810
24820
  type: type,
24811
24821
  disabled: disabled,
24812
24822
  sz: sz,
@@ -24852,8 +24862,9 @@ var Select = function(_param) {
24852
24862
  return /*#__PURE__*/ jsx(MenuItem, _object_spread_props$h(_object_spread$k({
24853
24863
  selected: value === option.value
24854
24864
  }, option), {
24855
- onClick: function() {
24856
- return handleSelect(option);
24865
+ onClick: function(e) {
24866
+ e.stopPropagation();
24867
+ handleSelect(option);
24857
24868
  }
24858
24869
  }), option.value);
24859
24870
  })
@@ -25168,22 +25179,22 @@ function _templateObject2$7() {
25168
25179
  };
25169
25180
  return data;
25170
25181
  }
25171
- function _templateObject3$5() {
25182
+ function _templateObject3$6() {
25172
25183
  var data = _tagged_template_literal$b([
25173
25184
  "\n ",
25174
25185
  "\n"
25175
25186
  ]);
25176
- _templateObject3$5 = function _templateObject() {
25187
+ _templateObject3$6 = function _templateObject() {
25177
25188
  return data;
25178
25189
  };
25179
25190
  return data;
25180
25191
  }
25181
- function _templateObject4$3() {
25192
+ function _templateObject4$5() {
25182
25193
  var data = _tagged_template_literal$b([
25183
25194
  "\n ",
25184
25195
  "\n"
25185
25196
  ]);
25186
- _templateObject4$3 = function _templateObject() {
25197
+ _templateObject4$5 = function _templateObject() {
25187
25198
  return data;
25188
25199
  };
25189
25200
  return data;
@@ -25191,8 +25202,8 @@ function _templateObject4$3() {
25191
25202
  var MenuItemContainer = styled.div(_templateObject$b(), primary100);
25192
25203
  var IconContainer = styled.div(_templateObject1$8());
25193
25204
  var buttonStyles = css(_templateObject2$7(), spacing(1), spacing(2), $paragraph200Regular);
25194
- var StyledItem = styled.button(_templateObject3$5(), buttonStyles);
25195
- var StyledLink = styled.a(_templateObject4$3(), buttonStyles);
25205
+ var StyledItem = styled.button(_templateObject3$6(), buttonStyles);
25206
+ var StyledLink = styled.a(_templateObject4$5(), buttonStyles);
25196
25207
  var MenuItem = function(_param) {
25197
25208
  var label = _param.label, href = _param.href, selected = _param.selected, checkbox = _param.checkbox, onClick = _param.onClick, icon = _param.icon, disabled = _param.disabled, _param_size = _param.size, size = _param_size === void 0 ? 'small' : _param_size, props = _object_without_properties$9(_param, [
25198
25209
  "label",
@@ -29091,21 +29102,21 @@ function _templateObject2$6() {
29091
29102
  };
29092
29103
  return data;
29093
29104
  }
29094
- function _templateObject3$4() {
29105
+ function _templateObject3$5() {
29095
29106
  var data = _tagged_template_literal$8([
29096
29107
  "\n overflow-y: auto;\n"
29097
29108
  ]);
29098
- _templateObject3$4 = function _templateObject() {
29109
+ _templateObject3$5 = function _templateObject() {
29099
29110
  return data;
29100
29111
  };
29101
29112
  return data;
29102
29113
  }
29103
- function _templateObject4$2() {
29114
+ function _templateObject4$4() {
29104
29115
  var data = _tagged_template_literal$8([
29105
29116
  "\n display: flex;\n justify-content: end;\n gap: ",
29106
29117
  "px;\n"
29107
29118
  ]);
29108
- _templateObject4$2 = function _templateObject() {
29119
+ _templateObject4$4 = function _templateObject() {
29109
29120
  return data;
29110
29121
  };
29111
29122
  return data;
@@ -29113,8 +29124,8 @@ function _templateObject4$2() {
29113
29124
  var StyledModal = styled(Modal$1)(_templateObject$8());
29114
29125
  var ModalContent = styled.div(_templateObject1$7(), spacing(2), spacing(1), spacing(3), elevation400);
29115
29126
  var ModalHeader = styled.div(_templateObject2$6());
29116
- var ModalBody = styled.div(_templateObject3$4());
29117
- var ModalFooter = styled.div(_templateObject4$2(), spacing(1));
29127
+ var ModalBody = styled.div(_templateObject3$5());
29128
+ var ModalFooter = styled.div(_templateObject4$4(), spacing(1));
29118
29129
  var Modal = function(param) {
29119
29130
  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;
29120
29131
  return /*#__PURE__*/ jsx(StyledModal, {
@@ -29188,9 +29199,7 @@ function _tagged_template_literal$7(strings, raw) {
29188
29199
  }
29189
29200
  function _templateObject$7() {
29190
29201
  var data = _tagged_template_literal$7([
29191
- "\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: ",
29192
- "px ",
29193
- "px ",
29202
+ "\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: ",
29194
29203
  "px;\n"
29195
29204
  ]);
29196
29205
  _templateObject$7 = function _templateObject() {
@@ -29207,7 +29216,7 @@ function _templateObject1$6() {
29207
29216
  };
29208
29217
  return data;
29209
29218
  }
29210
- var PaginationContainer = styled.div(_templateObject$7(), spacing(2), spacing(1), spacing(1));
29219
+ var PaginationContainer = styled.div(_templateObject$7(), spacing(2));
29211
29220
  var PageControls = styled.div(_templateObject1$6());
29212
29221
  var Pagination = function(param) {
29213
29222
  var mode = param.mode, pageInfo = param.pageInfo, _param_isLoading = param.isLoading, isLoading = _param_isLoading === void 0 ? false : _param_isLoading, onPageSizeChange = param.onPageSizeChange, subText = param.subText, onPageChange = param.onPageChange, _param_testId = param.testId, testId = _param_testId === void 0 ? 'pagination' : _param_testId;
@@ -29663,13 +29672,13 @@ function _templateObject2$5() {
29663
29672
  };
29664
29673
  return data;
29665
29674
  }
29666
- function _templateObject3$3() {
29675
+ function _templateObject3$4() {
29667
29676
  var data = _tagged_template_literal$5([
29668
29677
  "\n position: absolute;\n right: 0;\n top: 0;\n bottom: 0;\n border-radius: 0px ",
29669
29678
  "px ",
29670
29679
  "px 0px;\n padding: 0 1.5rem;\n"
29671
29680
  ]);
29672
- _templateObject3$3 = function _templateObject() {
29681
+ _templateObject3$4 = function _templateObject() {
29673
29682
  return data;
29674
29683
  };
29675
29684
  return data;
@@ -29677,7 +29686,7 @@ function _templateObject3$3() {
29677
29686
  var Container$1 = styled.div(_templateObject$5(), spacing(1));
29678
29687
  var IconWrapper = styled(IconWrapper$3)(_templateObject1$5(), neutral200, neutral600);
29679
29688
  var StyledInput = styled(BaseInput$1)(_templateObject2$5());
29680
- var GoButton = styled(Button)(_templateObject3$3(), spacing(1), spacing(1));
29689
+ var GoButton = styled(Button)(_templateObject3$4(), spacing(1), spacing(1));
29681
29690
  var SearchBar = function(_param) {
29682
29691
  var placeholder = _param.placeholder, _param_error = _param.error, error = _param_error === void 0 ? false : _param_error, onClear = _param.onClear, onSubmit = _param.onSubmit, _param_showButton = _param.showButton, showButton = _param_showButton === void 0 ? true : _param_showButton, _param_showFilters = _param.showFilters, showFilters = _param_showFilters === void 0 ? false : _param_showFilters, _param_testId = _param.testId, testId = _param_testId === void 0 ? 'search' : _param_testId, props = _object_without_properties$2(_param, [
29683
29692
  "placeholder",
@@ -33794,31 +33803,31 @@ function _templateObject2$4() {
33794
33803
  };
33795
33804
  return data;
33796
33805
  }
33797
- function _templateObject3$2() {
33806
+ function _templateObject3$3() {
33798
33807
  var data = _tagged_template_literal$4([
33799
33808
  "\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"
33800
33809
  ]);
33801
- _templateObject3$2 = function _templateObject() {
33810
+ _templateObject3$3 = function _templateObject() {
33802
33811
  return data;
33803
33812
  };
33804
33813
  return data;
33805
33814
  }
33806
- function _templateObject4$1() {
33815
+ function _templateObject4$3() {
33807
33816
  var data = _tagged_template_literal$4([
33808
33817
  "\n position: absolute;\n height: 0%;\n width: 6px;\n background-color: ",
33809
33818
  ";\n cursor: col-resize;\n user-select: none;\n touch-action: none;\n transition: height ease 0.25s;\n"
33810
33819
  ]);
33811
- _templateObject4$1 = function _templateObject() {
33820
+ _templateObject4$3 = function _templateObject() {
33812
33821
  return data;
33813
33822
  };
33814
33823
  return data;
33815
33824
  }
33816
- function _templateObject5() {
33825
+ function _templateObject5$1() {
33817
33826
  var data = _tagged_template_literal$4([
33818
33827
  "\n font-size: 9px;\n display: inline-flex;\n flex-direction: column;\n margin-left: ",
33819
33828
  "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"
33820
33829
  ]);
33821
- _templateObject5 = function _templateObject() {
33830
+ _templateObject5$1 = function _templateObject() {
33822
33831
  return data;
33823
33832
  };
33824
33833
  return data;
@@ -33826,9 +33835,9 @@ function _templateObject5() {
33826
33835
  var StyledHeader = styled.thead(_templateObject$4());
33827
33836
  var Th = styled(Typography)(_templateObject1$4(), spacing(1), neutral100, neutral300);
33828
33837
  var HeaderContent = styled.div(_templateObject2$4());
33829
- var ResizeHandleContainer = styled.div(_templateObject3$2());
33830
- var ResizeHandle = styled.div(_templateObject4$1(), neutral300);
33831
- var SortIcon = styled.span(_templateObject5(), spacing(1));
33838
+ var ResizeHandleContainer = styled.div(_templateObject3$3());
33839
+ var ResizeHandle = styled.div(_templateObject4$3(), neutral300);
33840
+ var SortIcon = styled.span(_templateObject5$1(), spacing(1));
33832
33841
  var TableHeader = function(param) {
33833
33842
  var table = param.table, disableControls = param.disableControls, dense = param.dense, _param_testId = param.testId, testId = _param_testId === void 0 ? 'table' : _param_testId;
33834
33843
  return /*#__PURE__*/ jsx(StyledHeader, {
@@ -33846,9 +33855,9 @@ var TableHeader = function(param) {
33846
33855
  variant: "paragraph200Semibold",
33847
33856
  as: "th",
33848
33857
  style: {
33849
- width: columnDef.width && !autoWidth ? "".concat(columnDef.width, "px") : "".concat(!autoWidth ? "".concat(header.getSize(), "px") : 'auto'),
33850
- minWidth: columnDef.minSize && !autoWidth ? "".concat(columnDef.minSize, "px") : "auto",
33851
- maxWidth: columnDef.maxSize && !autoWidth ? "".concat(columnDef.maxSize, "px") : 'auto',
33858
+ width: autoWidth ? 'auto' : "".concat(header.getSize(), "px"),
33859
+ minWidth: autoWidth ? 'auto' : undefined,
33860
+ maxWidth: autoWidth ? 'auto' : undefined,
33852
33861
  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")
33853
33862
  },
33854
33863
  children: [
@@ -33932,12 +33941,50 @@ function _templateObject2$3() {
33932
33941
  };
33933
33942
  return data;
33934
33943
  }
33935
- function _templateObject3$1() {
33944
+ function _templateObject3$2() {
33945
+ var data = _tagged_template_literal$3([
33946
+ "\n white-space: normal;\n word-break: break-word;\n overflow-wrap: break-word;\n "
33947
+ ]);
33948
+ _templateObject3$2 = function _templateObject() {
33949
+ return data;
33950
+ };
33951
+ return data;
33952
+ }
33953
+ function _templateObject4$2() {
33954
+ var data = _tagged_template_literal$3([
33955
+ "\n white-space: normal;\n "
33956
+ ]);
33957
+ _templateObject4$2 = function _templateObject() {
33958
+ return data;
33959
+ };
33960
+ return data;
33961
+ }
33962
+ function _templateObject5() {
33963
+ var data = _tagged_template_literal$3([
33964
+ "\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n "
33965
+ ]);
33966
+ _templateObject5 = function _templateObject() {
33967
+ return data;
33968
+ };
33969
+ return data;
33970
+ }
33971
+ function _templateObject6() {
33936
33972
  var data = _tagged_template_literal$3([
33937
33973
  "\n border-bottom: 1px solid ",
33938
- ";\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n"
33974
+ ";\n\n ",
33975
+ "\n"
33939
33976
  ]);
33940
- _templateObject3$1 = function _templateObject() {
33977
+ _templateObject6 = function _templateObject() {
33978
+ return data;
33979
+ };
33980
+ return data;
33981
+ }
33982
+ function _templateObject7() {
33983
+ var data = _tagged_template_literal$3([
33984
+ "\n display: -webkit-box;\n -webkit-line-clamp: ",
33985
+ ";\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n word-break: break-word;\n"
33986
+ ]);
33987
+ _templateObject7 = function _templateObject() {
33941
33988
  return data;
33942
33989
  };
33943
33990
  return data;
@@ -33946,15 +33993,28 @@ var StyledTableBody = styled.tbody(_templateObject$3());
33946
33993
  var Tr = styled.tr(_templateObject2$3(), function(props) {
33947
33994
  return props.enableHover && css(_templateObject1$3(), props.disabled ? neutral100 : primary100);
33948
33995
  });
33949
- var Td = styled(Typography)(_templateObject3$1(), neutral300);
33996
+ var Td = styled(Typography)(_templateObject6(), neutral300, function(props) {
33997
+ var overflow = props.cellOverflow || 'truncate';
33998
+ if (overflow === 'wrap') {
33999
+ return css(_templateObject3$2());
34000
+ }
34001
+ if (overflow === 'clamp') {
34002
+ // For clamp, don't apply display styles to td - content wrapper will handle it
34003
+ return css(_templateObject4$2());
34004
+ }
34005
+ // Default: truncate
34006
+ return css(_templateObject5());
34007
+ });
34008
+ var ClampWrapper = styled.div(_templateObject7(), function(props) {
34009
+ return props.maxLines;
34010
+ });
33950
34011
  var TableBody = function(param) {
33951
- var table = param.table, columnWidths = param.columnWidths, enableRowSelection = param.enableRowSelection, onRowClick = param.onRowClick, getRowDisabled = param.getRowDisabled, dense = param.dense, _param_testId = param.testId, testId = _param_testId === void 0 ? 'table' : _param_testId;
34012
+ var table = param.table, enableRowSelection = param.enableRowSelection, onRowClick = param.onRowClick, getRowDisabled = param.getRowDisabled, dense = param.dense, _param_testId = param.testId, testId = _param_testId === void 0 ? 'table' : _param_testId;
33952
34013
  return /*#__PURE__*/ jsxs(StyledTableBody, {
33953
34014
  children: [
33954
34015
  /*#__PURE__*/ jsx("colgroup", {
33955
- children: columnWidths.map(function(param) {
33956
- var id = param.id;
33957
- return /*#__PURE__*/ jsx("col", {}, id);
34016
+ children: table.getAllColumns().map(function(column) {
34017
+ return /*#__PURE__*/ jsx("col", {}, column.id);
33958
34018
  })
33959
34019
  }),
33960
34020
  table.getRowModel().rows.map(function(row) {
@@ -33974,15 +34034,24 @@ var TableBody = function(param) {
33974
34034
  "data-testid": "".concat(testId, "-row-").concat(row.id),
33975
34035
  children: row.getVisibleCells().map(function(cell) {
33976
34036
  var cellValue = cell.getValue();
34037
+ var columnDef = cell.column.columnDef;
34038
+ var overflow = columnDef.overflow;
34039
+ var maxLines = columnDef.maxLines;
34040
+ var autoWidth = columnDef.autoWidth;
34041
+ var cellContent = flexRender(cell.column.columnDef.cell, cell.getContext());
33977
34042
  return /*#__PURE__*/ jsx(Td, {
33978
34043
  variant: "paragraph200Regular",
33979
34044
  as: "td",
33980
34045
  title: typeof cellValue === 'string' ? cellValue : undefined,
34046
+ cellOverflow: overflow,
33981
34047
  style: {
33982
- width: "".concat(cell.column.getSize(), "px"),
34048
+ width: autoWidth ? 'auto' : "".concat(cell.column.getSize(), "px"),
33983
34049
  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")
33984
34050
  },
33985
- children: flexRender(cell.column.columnDef.cell, cell.getContext())
34051
+ children: overflow === 'clamp' && maxLines ? /*#__PURE__*/ jsx(ClampWrapper, {
34052
+ maxLines: maxLines,
34053
+ children: cellContent
34054
+ }) : cellContent
33986
34055
  }, cell.id);
33987
34056
  })
33988
34057
  }, row.id);
@@ -34155,11 +34224,32 @@ function _templateObject1$2() {
34155
34224
  return data;
34156
34225
  }
34157
34226
  function _templateObject2$2() {
34227
+ var data = _tagged_template_literal$2([
34228
+ "\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 0 0 ",
34229
+ "px 0;\n gap: ",
34230
+ "px;\n\n @media (max-width: 768px) {\n flex-direction: column;\n align-items: stretch;\n }\n"
34231
+ ]);
34232
+ _templateObject2$2 = function _templateObject() {
34233
+ return data;
34234
+ };
34235
+ return data;
34236
+ }
34237
+ function _templateObject3$1() {
34238
+ var data = _tagged_template_literal$2([
34239
+ "\n display: flex;\n gap: ",
34240
+ "px;\n align-items: center;\n"
34241
+ ]);
34242
+ _templateObject3$1 = function _templateObject() {
34243
+ return data;
34244
+ };
34245
+ return data;
34246
+ }
34247
+ function _templateObject4$1() {
34158
34248
  var data = _tagged_template_literal$2([
34159
34249
  "\n display: flex;\n align-items: center;\n justify-content: center;\n padding: ",
34160
34250
  "px;\n background: none;\n font-size: 20px;\n"
34161
34251
  ]);
34162
- _templateObject2$2 = function _templateObject() {
34252
+ _templateObject4$1 = function _templateObject() {
34163
34253
  return data;
34164
34254
  };
34165
34255
  return data;
@@ -34170,27 +34260,29 @@ var TableContainer = styled(/*#__PURE__*/ forwardRef(function(props, ref) {
34170
34260
  }));
34171
34261
  }))(_templateObject$2(), neutral300, spacing(1));
34172
34262
  var TableWrapper = styled.table(_templateObject1$2());
34173
- var ContextMenuButton = styled(Button)(_templateObject2$2(), spacing(0.5));
34263
+ var TopBar = styled.div(_templateObject2$2(), spacing(2), spacing(2));
34264
+ var TopBarElement = styled.div(_templateObject3$1(), spacing(1));
34265
+ var ContextMenuButton = styled(Button)(_templateObject4$1(), spacing(0.5));
34174
34266
  var Table = function(param) {
34175
- 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;
34267
+ 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;
34176
34268
  var containerRef = useRef(null);
34177
34269
  var ctxMenuAnchorRef = useRef(null);
34178
34270
  var _useState = _sliced_to_array$1(useState({}), 2), columnSizing = _useState[0], setColumnSizing = _useState[1];
34179
34271
  var _useState1 = _sliced_to_array$1(useState(null), 2), ctxMenuRow = _useState1[0], setCtxMenuRow = _useState1[1];
34180
34272
  var disableControls = isLoading || !(data === null || data === void 0 ? void 0 : data.length) || !!error;
34181
34273
  var hasSomePageProps = !!(pageInfo || onPageSizeChange || onPageChange);
34182
- var hasAllPageProps = !!(pageInfo && onPageSizeChange && onPageChange);
34183
- if (hasSomePageProps && !hasAllPageProps) {
34184
- console.warn('Table: Pagination requires all pagination props to be provided: pageInfo, onPageSizeChange, and onPageChange');
34274
+ var hasPaginationHandlers = !!(onPageSizeChange && onPageChange);
34275
+ if (hasSomePageProps && !hasPaginationHandlers) {
34276
+ console.warn('Table: Pagination requires both onPageSizeChange and onPageChange handlers to be provided');
34185
34277
  }
34186
34278
  var tableColumns = useMemo(function() {
34187
34279
  return columns.map(function(col) {
34188
34280
  return _object_spread$2({
34189
34281
  id: col.key,
34190
34282
  accessorKey: col.key,
34191
- size: col.width,
34192
34283
  accessorFn: col.getter,
34193
- enableSorting: col.sortable
34284
+ enableSorting: col.sortable,
34285
+ enableResizing: !col.autoWidth
34194
34286
  }, col);
34195
34287
  });
34196
34288
  }, [
@@ -34311,8 +34403,6 @@ var Table = function(param) {
34311
34403
  columns: allColumns,
34312
34404
  getRowId: getRowId,
34313
34405
  defaultColumn: {
34314
- minSize: 100,
34315
- maxSize: 500,
34316
34406
  size: 200,
34317
34407
  sortDescFirst: false
34318
34408
  },
@@ -34339,14 +34429,51 @@ var Table = function(param) {
34339
34429
  onColumnSizingChange: setColumnSizing,
34340
34430
  columnResizeMode: 'onChange'
34341
34431
  });
34342
- var columnWidths = table.getAllColumns().map(function(column) {
34343
- return {
34344
- id: column.id,
34345
- width: column.getSize()
34346
- };
34347
- });
34432
+ var showTopBar = hasPaginationHandlers || toolbar;
34348
34433
  return /*#__PURE__*/ jsxs("div", {
34349
34434
  children: [
34435
+ showTopBar && /*#__PURE__*/ jsxs(TopBar, {
34436
+ children: [
34437
+ /*#__PURE__*/ jsx("div", {
34438
+ children: Array.isArray(toolbar) ? /*#__PURE__*/ jsx(TopBarElement, {
34439
+ children: toolbar.map(function(item, i) {
34440
+ return /*#__PURE__*/ jsx(Fragment$1, {
34441
+ children: item
34442
+ }, i);
34443
+ })
34444
+ }) : toolbar
34445
+ }),
34446
+ hasPaginationHandlers && pageInfo && (paginationMode === 'page' && pageInfo && 'currentPage' in pageInfo ? /*#__PURE__*/ jsx(Pagination, {
34447
+ mode: "page",
34448
+ pageInfo: pageInfo,
34449
+ subText: subText,
34450
+ isLoading: isLoading,
34451
+ onPageSizeChange: function(size) {
34452
+ resetContainerScroll();
34453
+ onPageSizeChange(size);
34454
+ },
34455
+ onPageChange: function(page) {
34456
+ resetContainerScroll();
34457
+ onPageChange(page);
34458
+ },
34459
+ testId: "".concat(testId, "-pagination")
34460
+ }) : /*#__PURE__*/ jsx(Pagination, {
34461
+ mode: "cursor",
34462
+ pageInfo: pageInfo,
34463
+ subText: subText,
34464
+ isLoading: isLoading,
34465
+ onPageSizeChange: function(size) {
34466
+ resetContainerScroll();
34467
+ onPageSizeChange(size);
34468
+ },
34469
+ onPageChange: function(page) {
34470
+ resetContainerScroll();
34471
+ onPageChange(page);
34472
+ },
34473
+ testId: "".concat(testId, "-pagination")
34474
+ }))
34475
+ ]
34476
+ }),
34350
34477
  /*#__PURE__*/ jsxs("div", {
34351
34478
  style: {
34352
34479
  position: 'relative',
@@ -34375,14 +34502,12 @@ var Table = function(param) {
34375
34502
  children: [
34376
34503
  /*#__PURE__*/ jsx(TableHeader, {
34377
34504
  table: table,
34378
- columnWidths: columnWidths,
34379
34505
  disableControls: disableControls,
34380
34506
  dense: dense,
34381
34507
  testId: testId
34382
34508
  }),
34383
34509
  /*#__PURE__*/ jsx(TableBody, {
34384
34510
  table: table,
34385
- columnWidths: columnWidths,
34386
34511
  enableRowSelection: enableRowSelection,
34387
34512
  onRowClick: onRowClick,
34388
34513
  getRowDisabled: getRowDisabled,
@@ -34396,35 +34521,6 @@ var Table = function(param) {
34396
34521
  isLoading && /*#__PURE__*/ jsx(LoadingOverlay, {})
34397
34522
  ]
34398
34523
  }),
34399
- onPageSizeChange && onPageChange && pageInfo && (paginationMode === 'page' && 'currentPage' in pageInfo ? /*#__PURE__*/ jsx(Pagination, {
34400
- mode: "page",
34401
- pageInfo: pageInfo,
34402
- subText: subText,
34403
- isLoading: isLoading,
34404
- onPageSizeChange: function(size) {
34405
- resetContainerScroll();
34406
- onPageSizeChange(size);
34407
- },
34408
- onPageChange: function(page) {
34409
- resetContainerScroll();
34410
- onPageChange(page);
34411
- },
34412
- testId: "".concat(testId, "-pagination")
34413
- }) : /*#__PURE__*/ jsx(Pagination, {
34414
- mode: "cursor",
34415
- pageInfo: pageInfo,
34416
- subText: subText,
34417
- isLoading: isLoading,
34418
- onPageSizeChange: function(size) {
34419
- resetContainerScroll();
34420
- onPageSizeChange(size);
34421
- },
34422
- onPageChange: function(page) {
34423
- resetContainerScroll();
34424
- onPageChange(page);
34425
- },
34426
- testId: "".concat(testId, "-pagination")
34427
- })),
34428
34524
  /*#__PURE__*/ jsx(RowContextMenu, {
34429
34525
  anchorRef: ctxMenuAnchorRef,
34430
34526
  actions: contextMenuActions,
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": "1.7.0",
5
+ "version": "1.9.0",
6
6
  "type": "module",
7
7
  "private": false,
8
8
  "publishConfig": {
@@ -1,6 +1,7 @@
1
- import { CSSProperties, HTMLProps } from 'react';
1
+ import { CSSProperties, HTMLProps, ReactNode } from 'react';
2
2
  import { ColumnDef, OnChangeFn, Row } from '@tanstack/react-table';
3
3
  import { PageInfoPageBased, PageInfoCursorBased } from '../Pagination/Pagination';
4
+ export type CellOverflow = 'truncate' | 'wrap' | 'clamp';
4
5
  export declare const TableContainer: import("@emotion/styled").StyledComponent<Omit<HTMLProps<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
5
6
  theme?: import("@emotion/react").Theme;
6
7
  }, {}, {}>;
@@ -8,17 +9,14 @@ export declare const TableWrapper: import("@emotion/styled").StyledComponent<{
8
9
  theme?: import("@emotion/react").Theme;
9
10
  as?: React.ElementType;
10
11
  }, import("react").DetailedHTMLProps<import("react").TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>, {}>;
11
- export interface ColumnWidth {
12
- id: string;
13
- width: number;
14
- }
15
12
  export type TableColumn<T> = ColumnDef<T> & {
16
13
  key: string;
17
14
  header: string;
18
- width?: number;
19
15
  sortable?: boolean;
20
16
  getter?: () => unknown;
21
17
  autoWidth?: boolean;
18
+ overflow?: CellOverflow;
19
+ maxLines?: number;
22
20
  };
23
21
  export interface RowSelectState {
24
22
  [x: string]: boolean;
@@ -59,8 +57,9 @@ interface TableDataProps<T> {
59
57
  sortOrder?: string;
60
58
  onSortChange?: (sortBy: string, sortOrder: string) => void;
61
59
  error?: string;
60
+ toolbar?: ReactNode | ReactNode[];
62
61
  }
63
62
  export interface TableProps<T extends object> extends TableStyleProps, TableRowProps<T>, TableDataProps<T>, PaginationProps {
64
63
  }
65
- 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, }: TableProps<T>) => import("@emotion/react/jsx-runtime").JSX.Element;
64
+ 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;
66
65
  export {};
@@ -1,8 +1,6 @@
1
1
  import { Table } from '@tanstack/react-table';
2
- import { ColumnWidth } from './Table';
3
2
  interface TableBodyProps<T extends object> {
4
3
  table: Table<T>;
5
- columnWidths: ColumnWidth[];
6
4
  enableRowSelection?: boolean;
7
5
  onRowClick?: (row: T) => void;
8
6
  title?: string;
@@ -10,5 +8,5 @@ interface TableBodyProps<T extends object> {
10
8
  getRowDisabled?: (row: T) => boolean;
11
9
  testId?: string;
12
10
  }
13
- export declare const TableBody: <T extends object>({ table, columnWidths, enableRowSelection, onRowClick, getRowDisabled, dense, testId, }: TableBodyProps<T>) => import("@emotion/react/jsx-runtime").JSX.Element;
11
+ export declare const TableBody: <T extends object>({ table, enableRowSelection, onRowClick, getRowDisabled, dense, testId, }: TableBodyProps<T>) => import("@emotion/react/jsx-runtime").JSX.Element;
14
12
  export {};
@@ -1,8 +1,6 @@
1
1
  import { Table } from '@tanstack/react-table';
2
- import { ColumnWidth } from './Table';
3
2
  interface TableHeaderProps<T> {
4
3
  table: Table<T>;
5
- columnWidths: ColumnWidth[];
6
4
  disableControls: boolean;
7
5
  dense: boolean;
8
6
  testId?: string;