sag_components 2.0.0-beta126 → 2.0.0-beta128

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/dist/index.d.ts CHANGED
@@ -1424,7 +1424,7 @@ declare function Execute({ width, height, fill }: {
1424
1424
  fill?: string;
1425
1425
  }): react_jsx_runtime.JSX.Element;
1426
1426
 
1427
- declare function Table(props: any): react_jsx_runtime.JSX.Element;
1427
+ declare const Table: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
1428
1428
 
1429
1429
  declare function FilterPop(props: any): react_jsx_runtime.JSX.Element;
1430
1430
 
@@ -1464,7 +1464,7 @@ declare function ModalDrawer({ open, onClose, children, widthPercent }: {
1464
1464
  widthPercent?: number;
1465
1465
  }): react_jsx_runtime.JSX.Element;
1466
1466
 
1467
- declare function OverlayDropdown({ data, value, onSelectClick, disabled, isDarkerBackground, required, selectedColor, hoverColor, dropdownMaxHeight, width, ...props }: {
1467
+ declare function OverlayDropdown({ data, value, onSelectClick, disabled, isDarkerBackground, required, selectedColor, hoverColor, dropdownMaxHeight, width, label, labelEmptyValue, showLabelOnTop, placeHolder, labelColor, placeHolderColor, ...props }: {
1468
1468
  [x: string]: any;
1469
1469
  data?: any[];
1470
1470
  value: any;
@@ -1476,6 +1476,12 @@ declare function OverlayDropdown({ data, value, onSelectClick, disabled, isDarke
1476
1476
  hoverColor?: string;
1477
1477
  dropdownMaxHeight?: string;
1478
1478
  width?: string;
1479
+ label: any;
1480
+ labelEmptyValue: any;
1481
+ showLabelOnTop: any;
1482
+ placeHolder: any;
1483
+ labelColor: any;
1484
+ placeHolderColor: any;
1479
1485
  }): react_jsx_runtime.JSX.Element;
1480
1486
 
1481
1487
  declare function MessageBox({ isOpen, onClose, onConfirm, title, messageTitle, messageText, cancelText, confirmText, width, height }: {
package/dist/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import React$1, { useState, useRef, useEffect, useMemo, useCallback } from 'react';
1
+ import React$1, { useState, useRef, useEffect, useMemo, useCallback, forwardRef, useImperativeHandle } from 'react';
2
2
  import styled, { keyframes, css } from 'styled-components';
3
3
  import { ResponsiveContainer, PieChart as PieChart$1, Pie, Cell, Tooltip as Tooltip$3, BarChart as BarChart$1, CartesianGrid, XAxis, YAxis, Bar, LabelList, ReferenceLine, LineChart, Line, AreaChart as AreaChart$1, Legend, Area, ScatterChart, ZAxis, Scatter, Brush, ComposedChart } from 'recharts';
4
4
  import Skeleton, { SkeletonTheme } from 'react-loading-skeleton';
@@ -54,7 +54,7 @@ const ButtonItem = styled.div`
54
54
  transition: background-color 0.3s, color 0.3s;
55
55
  }
56
56
  `;
57
- const Label$a = styled.label`
57
+ const Label$b = styled.label`
58
58
  font-family: "Poppins";
59
59
  font-size: 14px;
60
60
  font-weight: 400;
@@ -526,7 +526,7 @@ const Button$1 = props => {
526
526
  onMouseEnter: () => setHover(true),
527
527
  onMouseLeave: () => setHover(false),
528
528
  borderRadius: borderRadius
529
- }, commonProps), getIcon(leftIcon), /*#__PURE__*/React$1.createElement(Label$a, {
529
+ }, commonProps), getIcon(leftIcon), /*#__PURE__*/React$1.createElement(Label$b, {
530
530
  className: "Label",
531
531
  disabled: disabled
532
532
  }, text), getIcon(rightIcon)));
@@ -2968,7 +2968,7 @@ const LinkButtonItem = styled.div`
2968
2968
  transition: background-color 0.3s, color 0.3s;
2969
2969
  }
2970
2970
  `;
2971
- const Label$9 = styled.label`
2971
+ const Label$a = styled.label`
2972
2972
  user-select: none;
2973
2973
  pointer-events: none;
2974
2974
  `;
@@ -3231,7 +3231,7 @@ const LinkButton = _ref => {
3231
3231
  disabled: disabled,
3232
3232
  text_color: textColor || (type === 'secondary' ? '#212121' : '#229E38'),
3233
3233
  font_size: size === 'small' ? '14px' : '16px'
3234
- }, getLeftIcon(), /*#__PURE__*/React$1.createElement(Label$9, {
3234
+ }, getLeftIcon(), /*#__PURE__*/React$1.createElement(Label$a, {
3235
3235
  className: "Label",
3236
3236
  disabled: disabled,
3237
3237
  font_size: size === 'small' ? '14px' : '16px'
@@ -3640,7 +3640,7 @@ const Body = styled.div`
3640
3640
  border-radius: ${props => props.setBackground ? '12px' : '0'};
3641
3641
  box-shadow: ${props => props.setBackground ? '0px 0px 20px 0px rgba(0, 0, 0, 0.10)' : 'unset'};
3642
3642
  `;
3643
- const Label$8 = styled.div`
3643
+ const Label$9 = styled.div`
3644
3644
  font-size: 12px;
3645
3645
  font-weight: 400;
3646
3646
  padding: 8px;
@@ -3891,7 +3891,7 @@ const TabMenu = props => {
3891
3891
  hoverBorderColor: buttonHoverColor
3892
3892
  })), showActions && /*#__PURE__*/React$1.createElement(ActionsWrapper, {
3893
3893
  className: "ActionsWrapper"
3894
- }, showLabel && /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement(Label$8, {
3894
+ }, showLabel && /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement(Label$9, {
3895
3895
  className: "Label"
3896
3896
  }, /*#__PURE__*/React$1.createElement("span", null, "Platform: "), "Total"), /*#__PURE__*/React$1.createElement("span", {
3897
3897
  className: "separator"
@@ -8525,7 +8525,7 @@ const DropdownWrapper$2 = styled.div`
8525
8525
  pointer-events: none;
8526
8526
  }
8527
8527
  `;
8528
- const Label$7 = styled.label`
8528
+ const Label$8 = styled.label`
8529
8529
  font-size: ${props => props.isFocused || props.hasValue ? '14px' : '14px'};
8530
8530
  font-weight: 400;
8531
8531
  padding-inline-end: 5px;
@@ -8847,7 +8847,7 @@ const DropdownSingleNew = ({
8847
8847
  disabled: disabled,
8848
8848
  error: error,
8849
8849
  onClick: handleLabelClick
8850
- }, /*#__PURE__*/React$1.createElement(Label$7, {
8850
+ }, /*#__PURE__*/React$1.createElement(Label$8, {
8851
8851
  className: "Label",
8852
8852
  isFocused: isFocused,
8853
8853
  labelColor: labelColor,
@@ -8984,7 +8984,7 @@ const DropdownWrapper$1 = styled.div`
8984
8984
  pointer-events: none;
8985
8985
  }
8986
8986
  `;
8987
- const Label$6 = styled.label`
8987
+ const Label$7 = styled.label`
8988
8988
  font-size: ${props => props.isFocused || props.hasValue ? '14px' : '14px'};
8989
8989
  font-weight: 400;
8990
8990
  padding-inline-end: 5px;
@@ -9355,7 +9355,7 @@ const DropdownMultiNew = ({
9355
9355
  disabled: disabled,
9356
9356
  error: error,
9357
9357
  onClick: handleLabelClick
9358
- }, /*#__PURE__*/React$1.createElement(Label$6, {
9358
+ }, /*#__PURE__*/React$1.createElement(Label$7, {
9359
9359
  className: "Label",
9360
9360
  isFocused: isFocused,
9361
9361
  labelColor: labelColor,
@@ -9873,21 +9873,20 @@ const DatePicker = ({
9873
9873
  };
9874
9874
 
9875
9875
  /* eslint-disable import/no-extraneous-dependencies */
9876
- const RangePicker = _ref => {
9877
- let {
9878
- label,
9879
- onChange,
9880
- borderRadius,
9881
- required,
9882
- width,
9883
- height,
9884
- placeholder,
9885
- disabled,
9886
- borderColor,
9887
- borderColorFocus,
9888
- textColor,
9889
- selectedValue
9890
- } = _ref;
9876
+ const RangePicker = ({
9877
+ label,
9878
+ onChange,
9879
+ borderRadius,
9880
+ required,
9881
+ width,
9882
+ height,
9883
+ placeholder,
9884
+ disabled,
9885
+ borderColor,
9886
+ borderColorFocus,
9887
+ textColor,
9888
+ selectedValue
9889
+ }) => {
9891
9890
  const [isFocused, setIsFocused] = useState(false);
9892
9891
  const [isOpen, setIsOpen] = useState(false);
9893
9892
  const [value, setValue] = useState(''); // Added value state
@@ -10311,24 +10310,23 @@ const QuarterPopupPicker = ({
10311
10310
  };
10312
10311
 
10313
10312
  /* eslint-disable import/no-extraneous-dependencies */
10314
- const QuarterPicker = _ref => {
10315
- let {
10316
- availableQuarters,
10317
- // ["Q1-2024"]
10318
- label,
10319
- onChange,
10320
- borderRadius,
10321
- required,
10322
- width,
10323
- height,
10324
- placeholder,
10325
- disabled,
10326
- borderColor,
10327
- borderColorFocus,
10328
- textColor,
10329
- selectedValue,
10330
- startYear
10331
- } = _ref;
10313
+ const QuarterPicker = ({
10314
+ availableQuarters,
10315
+ // ["Q1-2024"]
10316
+ label,
10317
+ onChange,
10318
+ borderRadius,
10319
+ required,
10320
+ width,
10321
+ height,
10322
+ placeholder,
10323
+ disabled,
10324
+ borderColor,
10325
+ borderColorFocus,
10326
+ textColor,
10327
+ selectedValue,
10328
+ startYear
10329
+ }) => {
10332
10330
  const [isFocused, setIsFocused] = useState(false);
10333
10331
  const [isOpen, setIsOpen] = useState(false);
10334
10332
  const [value, setValue] = useState('');
@@ -10770,23 +10768,22 @@ const MonthPopupPicker = ({
10770
10768
  };
10771
10769
 
10772
10770
  /* eslint-disable import/no-extraneous-dependencies */
10773
- const MonthPicker = _ref => {
10774
- let {
10775
- availableMonths,
10776
- label,
10777
- onChange,
10778
- borderRadius,
10779
- required,
10780
- width,
10781
- height,
10782
- placeholder,
10783
- disabled,
10784
- borderColor,
10785
- borderColorFocus,
10786
- textColor,
10787
- selectedValue,
10788
- startYear
10789
- } = _ref;
10771
+ const MonthPicker = ({
10772
+ availableMonths,
10773
+ label,
10774
+ onChange,
10775
+ borderRadius,
10776
+ required,
10777
+ width,
10778
+ height,
10779
+ placeholder,
10780
+ disabled,
10781
+ borderColor,
10782
+ borderColorFocus,
10783
+ textColor,
10784
+ selectedValue,
10785
+ startYear
10786
+ }) => {
10790
10787
  const [isFocused, setIsFocused] = useState(false);
10791
10788
  const [isOpen, setIsOpen] = useState(false);
10792
10789
  const [value, setValue] = useState('');
@@ -23787,7 +23784,7 @@ const QuickFilterInput = styled.div`
23787
23784
  font-size: 14px;
23788
23785
  border-radius: 8px;
23789
23786
  `;
23790
- const Label$5 = styled.label`
23787
+ const Label$6 = styled.label`
23791
23788
  font-size: 14px;
23792
23789
  font-weight: 500;
23793
23790
  color: ${props => props.disabled ? '#D0D0D0' : '212121'};
@@ -23897,21 +23894,22 @@ const DeleteIcon = styled.div`
23897
23894
  position: absolute;
23898
23895
  `;
23899
23896
 
23900
- const QuickFilterDropdownSingle = ({
23901
- label,
23902
- hoverColor,
23903
- options,
23904
- selectedValue,
23905
- placeHolder,
23906
- onChange,
23907
- disabled,
23908
- width,
23909
- error,
23910
- errorMessage,
23911
- xIconShow,
23912
- labelColor,
23913
- showLabelOnTop
23914
- }) => {
23897
+ const QuickFilterDropdownSingle = _ref => {
23898
+ let {
23899
+ label,
23900
+ hoverColor,
23901
+ options,
23902
+ selectedValue,
23903
+ placeHolder,
23904
+ onChange,
23905
+ disabled,
23906
+ width,
23907
+ error,
23908
+ errorMessage,
23909
+ xIconShow,
23910
+ labelColor,
23911
+ showLabelOnTop
23912
+ } = _ref;
23915
23913
  const [isFocused, setIsFocused] = useState(false);
23916
23914
  const [showOptions, setShowOptions] = useState(false);
23917
23915
  const [inputValue, setInputValue] = useState("");
@@ -24034,7 +24032,7 @@ const QuickFilterDropdownSingle = ({
24034
24032
  disabled: disabled,
24035
24033
  error: error,
24036
24034
  onClick: handleLabelClick
24037
- }, /*#__PURE__*/React$1.createElement(Label$5, {
24035
+ }, /*#__PURE__*/React$1.createElement(Label$6, {
24038
24036
  className: "Label",
24039
24037
  isFocused: isFocused,
24040
24038
  labelColor: labelColor,
@@ -24141,7 +24139,7 @@ const DropdownWrapper = styled.div`
24141
24139
  font-size: 14px;
24142
24140
  border-radius: 10px;
24143
24141
  `;
24144
- const Label$4 = styled.label`
24142
+ const Label$5 = styled.label`
24145
24143
  font-size: ${props => props.isFocused || props.hasValue ? '14px' : '14px'};
24146
24144
  font-weight: 400;
24147
24145
  padding-inline-end: 5px;
@@ -24498,7 +24496,7 @@ const QuickFilterDropdownMultiSelection = _ref => {
24498
24496
  disabled: disabled,
24499
24497
  error: error,
24500
24498
  onClick: handleLabelClick
24501
- }, /*#__PURE__*/React$1.createElement(Label$4, {
24499
+ }, /*#__PURE__*/React$1.createElement(Label$5, {
24502
24500
  className: "Label",
24503
24501
  isFocused: isFocused,
24504
24502
  labelColor: labelColor,
@@ -29094,7 +29092,7 @@ const Controls$5 = styled.div`
29094
29092
  display: flex;
29095
29093
  align-items: center;
29096
29094
  `;
29097
- const Label$3 = styled.div`
29095
+ const Label$4 = styled.div`
29098
29096
  display: flex;
29099
29097
  padding: 0 10px 0 10px;
29100
29098
  white-space: nowrap;
@@ -29174,7 +29172,7 @@ const CheckBox = props => {
29174
29172
  width: iconSize,
29175
29173
  height: iconSize,
29176
29174
  color: disabled ? colorDisabled : colorUnchecked
29177
- })), /*#__PURE__*/React$1.createElement(Label$3, {
29175
+ })), /*#__PURE__*/React$1.createElement(Label$4, {
29178
29176
  className: "Label",
29179
29177
  "data-testid": "label"
29180
29178
  }, label)));
@@ -34418,7 +34416,11 @@ const ModalWithOverlay = props => {
34418
34416
  leftIcon: cancelButtonLeftIcon,
34419
34417
  rightIcon: cancelButtonRightIcon,
34420
34418
  text: cancelButtonText,
34421
- onClick: onCancel
34419
+ onClick: onCancel,
34420
+ borderColor: "#D3D3D3",
34421
+ hoverTextColor: "#212121",
34422
+ hoverBackgroundColor: "#E6F0F0",
34423
+ hoverBorderColor: "#D3D3D3"
34422
34424
  }), showOkButton && (disableOkButton && tooltipContent !== '' ? /*#__PURE__*/React$1.createElement(Tooltip$2, {
34423
34425
  direction: "top",
34424
34426
  topFactor: -0.85,
@@ -35184,7 +35186,7 @@ const MainContainer = styled.div`
35184
35186
  padding: 0;
35185
35187
  cursor: ${props => props.disabled ? 'not-allowed' : 'default'};
35186
35188
  `;
35187
- const Label$2 = styled.label`
35189
+ const Label$3 = styled.label`
35188
35190
 
35189
35191
  font-size: ${props => props.isFocused || props.hasValue ? '14px' : '14px'};
35190
35192
  font-weight: 400;
@@ -35406,7 +35408,7 @@ const Input$2 = _ref => {
35406
35408
  error: error,
35407
35409
  onClick: handleLabelClick,
35408
35410
  size: size
35409
- }, /*#__PURE__*/React$1.createElement(Label$2, {
35411
+ }, /*#__PURE__*/React$1.createElement(Label$3, {
35410
35412
  className: "Label",
35411
35413
  isFocused: isFocused,
35412
35414
  labelColor: labelColor,
@@ -36660,7 +36662,7 @@ const FieldRow$1 = styled.div`
36660
36662
  justify-content: center;
36661
36663
  padding: 16px;
36662
36664
  `;
36663
- const Label$1 = styled.label`
36665
+ const Label$2 = styled.label`
36664
36666
  color: #222;
36665
36667
  display: flex;
36666
36668
  align-items: center;
@@ -36750,7 +36752,7 @@ const RangePop = props => {
36750
36752
  e.preventDefault();
36751
36753
  if (isValid) onApply(fields);
36752
36754
  }
36753
- }, /*#__PURE__*/React$1.createElement(RadioWrapper, null, radioOptions.map((option, idx) => /*#__PURE__*/React$1.createElement(Label$1, {
36755
+ }, /*#__PURE__*/React$1.createElement(RadioWrapper, null, radioOptions.map((option, idx) => /*#__PURE__*/React$1.createElement(Label$2, {
36754
36756
  key: option
36755
36757
  }, /*#__PURE__*/React$1.createElement(Radio, {
36756
36758
  type: "radio",
@@ -36763,7 +36765,7 @@ const RangePop = props => {
36763
36765
  }
36764
36766
  }), option))), /*#__PURE__*/React$1.createElement(FieldRow$1, null, params.map((param, idx) => /*#__PURE__*/React$1.createElement(React$1.Fragment, {
36765
36767
  key: param.label
36766
- }, /*#__PURE__*/React$1.createElement(Label$1, {
36768
+ }, /*#__PURE__*/React$1.createElement(Label$2, {
36767
36769
  htmlFor: `param-${idx}`
36768
36770
  }, param.label), /*#__PURE__*/React$1.createElement(Input$1, {
36769
36771
  id: `param-${idx}`,
@@ -36774,7 +36776,7 @@ const RangePop = props => {
36774
36776
  onBlur: () => handleBlur(idx),
36775
36777
  min: 0,
36776
36778
  max: param.type === 'percent' ? 100 : undefined
36777
- }))), /*#__PURE__*/React$1.createElement(Label$1, null, paramType)), /*#__PURE__*/React$1.createElement(Actions$1, null, /*#__PURE__*/React$1.createElement(ClearButton, {
36779
+ }))), /*#__PURE__*/React$1.createElement(Label$2, null, paramType)), /*#__PURE__*/React$1.createElement(Actions$1, null, /*#__PURE__*/React$1.createElement(ClearButton, {
36778
36780
  type: "button",
36779
36781
  onClick: () => {
36780
36782
  setFields(params.map(() => ''));
@@ -37888,17 +37890,39 @@ const DisabledTrashIcon = ({
37888
37890
  };
37889
37891
 
37890
37892
  // TableBody.jsx
37891
- const TableBody = ({
37893
+ const TableBody = /*#__PURE__*/forwardRef(({
37892
37894
  columns,
37893
37895
  data,
37894
37896
  onRowClick,
37895
37897
  onSendClick,
37896
37898
  buttonColor,
37897
- onDeleteClick
37898
- }) => {
37899
+ onDeleteClick,
37900
+ resetFocus = false,
37901
+ onFocusChange
37902
+ }, ref) => {
37899
37903
  const [hoveredRowIndex, setHoveredRowIndex] = useState(null);
37900
37904
  const [focusedRowIndex, setFocusedRowIndex] = useState(null);
37901
37905
 
37906
+ // Expose methods to parent components via ref
37907
+ useImperativeHandle(ref, () => ({
37908
+ clearFocus: () => setFocusedRowIndex(null),
37909
+ getFocusedRowIndex: () => focusedRowIndex
37910
+ }));
37911
+
37912
+ // Handle resetFocus prop
37913
+ useEffect(() => {
37914
+ if (resetFocus) {
37915
+ setFocusedRowIndex(null);
37916
+ }
37917
+ }, [resetFocus]);
37918
+
37919
+ // Notify parent of focus changes
37920
+ useEffect(() => {
37921
+ if (onFocusChange) {
37922
+ onFocusChange(focusedRowIndex);
37923
+ }
37924
+ }, [focusedRowIndex, onFocusChange]);
37925
+
37902
37926
  // Handle row click for focus state
37903
37927
  const handleRowClick = (row, rowIndex) => {
37904
37928
  setFocusedRowIndex(rowIndex);
@@ -38138,7 +38162,10 @@ const TableBody = ({
38138
38162
  $maxWidth: column.maxWidth
38139
38163
  }, formattedValue);
38140
38164
  }))));
38141
- };
38165
+ });
38166
+
38167
+ // Add displayName for better debugging
38168
+ TableBody.displayName = 'TableBody';
38142
38169
 
38143
38170
  var nm$1 = "calendar_lottie";
38144
38171
  var ddd$1 = 0;
@@ -41307,7 +41334,7 @@ var Lottie = function Lottie(props) {
41307
41334
  };
41308
41335
 
41309
41336
  // Table.jsx
41310
- const Table = props => {
41337
+ const Table = /*#__PURE__*/forwardRef((props, ref) => {
41311
41338
  const {
41312
41339
  width = '100%',
41313
41340
  height = 'auto',
@@ -41338,10 +41365,34 @@ const Table = props => {
41338
41365
  onDeleteClick = () => {},
41339
41366
  showNoDataInSearch = false,
41340
41367
  noDataInSearchTitle = "No Results Found",
41341
- noDataInSearchMessage = "Try to refine your query and search again"
41368
+ noDataInSearchMessage = "Try to refine your query and search again",
41369
+ // New props for focus management
41370
+ resetTableFocus = false,
41371
+ onTableFocusChange = () => {},
41372
+ clearFocusOnOutsideClick = true
41342
41373
  } = props;
41343
41374
  const scrollWrapperRef = useRef(null);
41375
+ const tableBodyRef = useRef(null);
41376
+ const tableContainerRef = useRef(null);
41344
41377
  const [hasTriggered, setHasTriggered] = useState(false);
41378
+
41379
+ // Expose method to clear table focus to parent components
41380
+ const clearTableFocus = () => {
41381
+ if (tableBodyRef.current) {
41382
+ tableBodyRef.current.clearFocus();
41383
+ }
41384
+ };
41385
+
41386
+ // Handle focus change from TableBody
41387
+ const handleTableFocusChange = focusedRowIndex => {
41388
+ onTableFocusChange(focusedRowIndex);
41389
+ };
41390
+
41391
+ // Expose methods to parent components via ref
41392
+ useImperativeHandle(ref, () => ({
41393
+ clearTableFocus,
41394
+ getTableBodyRef: () => tableBodyRef.current
41395
+ }));
41345
41396
  useEffect(() => {
41346
41397
  const scrollWrapper = scrollWrapperRef.current;
41347
41398
  if (!scrollWrapper || !onLastRowsReached) return;
@@ -41370,6 +41421,23 @@ const Table = props => {
41370
41421
  scrollWrapper.addEventListener('scroll', handleScroll);
41371
41422
  return () => scrollWrapper.removeEventListener('scroll', handleScroll);
41372
41423
  }, [onLastRowsReached, data.length, lastRowsThreshold, hasTriggered]);
41424
+
41425
+ // Handle outside click to clear focus
41426
+ useEffect(() => {
41427
+ if (!clearFocusOnOutsideClick) return;
41428
+ const handleOutsideClick = event => {
41429
+ if (tableContainerRef.current && !tableContainerRef.current.contains(event.target)) {
41430
+ // Click is outside the table container
41431
+ if (tableBodyRef.current) {
41432
+ tableBodyRef.current.clearFocus();
41433
+ }
41434
+ }
41435
+ };
41436
+ document.addEventListener('mousedown', handleOutsideClick);
41437
+ return () => {
41438
+ document.removeEventListener('mousedown', handleOutsideClick);
41439
+ };
41440
+ }, [clearFocusOnOutsideClick]);
41373
41441
  return /*#__PURE__*/React$1.createElement(TableWrapper, {
41374
41442
  width: width,
41375
41443
  height: height
@@ -41384,7 +41452,8 @@ const Table = props => {
41384
41452
  hoverBackgroundColor: sideButtonHoverColor,
41385
41453
  onClick: onSideButtonClick
41386
41454
  })), children, /*#__PURE__*/React$1.createElement(TableContainer, {
41387
- showHorizontalScroll: showHorizontalScroll
41455
+ showHorizontalScroll: showHorizontalScroll,
41456
+ ref: tableContainerRef
41388
41457
  }, /*#__PURE__*/React$1.createElement(TableBodyScrollWrapper, {
41389
41458
  tableBodyHeight: tableBodyHeight,
41390
41459
  showHorizontalScroll: showHorizontalScroll,
@@ -41395,12 +41464,15 @@ const Table = props => {
41395
41464
  onFilter: onFilter,
41396
41465
  onSelectAll: onSelectAll
41397
41466
  }), columns.length > 0 && data.length > 0 && /*#__PURE__*/React$1.createElement(TableBody, {
41467
+ ref: tableBodyRef,
41398
41468
  columns: columns,
41399
41469
  data: data,
41400
41470
  onRowClick: onRowClick,
41401
41471
  onSendClick: onSendClick,
41402
41472
  onDeleteClick: onDeleteClick,
41403
- buttonColor: buttonColor
41473
+ buttonColor: buttonColor,
41474
+ resetFocus: resetTableFocus,
41475
+ onFocusChange: handleTableFocusChange
41404
41476
  })), data.length === 0 && /*#__PURE__*/React$1.createElement(NoEventsParent, null, /*#__PURE__*/React$1.createElement(NoEventsWrapper, null, showNoDataInSearch ? /*#__PURE__*/React$1.createElement(NoDataInSearchIcon, null) : /*#__PURE__*/React$1.createElement(NoEvents, null)), /*#__PURE__*/React$1.createElement(NoEventsMessage, null, showNoDataInSearch ? /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement("strong", null, noDataInSearchTitle), /*#__PURE__*/React$1.createElement("br", null), noDataInSearchMessage) : /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement("strong", null, "You haven't created any events yet"), /*#__PURE__*/React$1.createElement("br", null), "Let's get started and create your first one!")), !showNoDataInSearch && /*#__PURE__*/React$1.createElement(Button$1, {
41405
41477
  height: "45px",
41406
41478
  leftIcon: "Plus",
@@ -41419,7 +41491,10 @@ const Table = props => {
41419
41491
  animationData: LoadingAnimation,
41420
41492
  loop: true
41421
41493
  }), /*#__PURE__*/React$1.createElement(LoadingText, null, isLoadingText)))));
41422
- };
41494
+ });
41495
+
41496
+ // Add displayName for better debugging
41497
+ Table.displayName = 'Table';
41423
41498
 
41424
41499
  const Card = styled.div`
41425
41500
  background: ${props => props.backgroundColor};
@@ -51273,7 +51348,7 @@ const TruncatedText = styled.span`
51273
51348
  line-height: 21px;
51274
51349
  font-size: 14px;
51275
51350
  font-weight: 400;
51276
- color: inherit;
51351
+ color: ${props => props.color};
51277
51352
  max-width: 340px;
51278
51353
  white-space: nowrap;
51279
51354
  overflow: hidden;
@@ -51295,6 +51370,28 @@ styled.div`
51295
51370
  /* max-width: 320px; */
51296
51371
  white-space: pre-line;
51297
51372
  `;
51373
+ const Label$1 = styled.label`
51374
+ font-size: ${props => props.isFocused || props.hasValue ? '14px' : '14px'};
51375
+ font-weight: 400;
51376
+ padding-inline-end: 5px;
51377
+ padding-inline-start: 5px;
51378
+ margin-right: 10px;
51379
+ z-index: 2;
51380
+ color: ${props => props.error ? 'red' : props.disabled ? '#888' : props.labelColor};
51381
+ background-color: ${props => props.showLabelOnTop ? 'white' : 'transparent'} ;
51382
+ position: absolute;
51383
+ top: ${props => props.isFocused || props.hasValue ? '0px' : '24px'};
51384
+ left: ${props => props.isFocused || props.hasValue ? '23px' : '14px'};
51385
+ transform: translateY(-50%);
51386
+ transition: ${props => props.showLabelOnTop ? 'top 0.3s ease, font-size 0.3s ease, color 0.3s ease' : ''} ;
51387
+ display: flex;
51388
+ align-items: center;
51389
+ box-sizing: border-box;
51390
+ gap: 4px;
51391
+ &:hover {
51392
+ cursor: ${props => props.disabled ? 'not-allowed' : 'pointer'};
51393
+ }
51394
+ `;
51298
51395
 
51299
51396
  const DialogOverlay = styled.div`
51300
51397
  position: fixed;
@@ -51519,6 +51616,12 @@ const OverlayDropdown = _ref => {
51519
51616
  hoverColor = '#E6F0F0',
51520
51617
  dropdownMaxHeight = '600px',
51521
51618
  width = '100%',
51619
+ label,
51620
+ labelEmptyValue,
51621
+ showLabelOnTop,
51622
+ placeHolder,
51623
+ labelColor,
51624
+ placeHolderColor,
51522
51625
  ...props
51523
51626
  } = _ref;
51524
51627
  const [open, setOpen] = useState(false);
@@ -51589,6 +51692,7 @@ const OverlayDropdown = _ref => {
51589
51692
  return null;
51590
51693
  };
51591
51694
  const selected = findSelectedItem();
51695
+ const hasValue = !!selected;
51592
51696
 
51593
51697
  // Tooltip logic for long string
51594
51698
  const getDisplayText = text => {
@@ -51702,10 +51806,42 @@ const OverlayDropdown = _ref => {
51702
51806
  setOpen(prev => !prev);
51703
51807
  };
51704
51808
  const dataToRender = getDataWithLastDefined();
51809
+ const getLabel = () => {
51810
+ if (!showLabelOnTop && open) {
51811
+ return "";
51812
+ }
51813
+ if (hasValue) {
51814
+ return label;
51815
+ }
51816
+ return labelEmptyValue;
51817
+ };
51818
+ const getRequired = () => {
51819
+ if (!showLabelOnTop && open) {
51820
+ return "";
51821
+ }
51822
+ if (!showLabelOnTop && !label && hasValue) {
51823
+ return "";
51824
+ }
51825
+ if (required) {
51826
+ return /*#__PURE__*/React$1.createElement("span", {
51827
+ style: {
51828
+ color: "red"
51829
+ }
51830
+ }, "*");
51831
+ }
51832
+ return "";
51833
+ };
51705
51834
  return /*#__PURE__*/React$1.createElement(DropdownContainer, {
51706
51835
  width: width,
51707
51836
  ref: containerRef
51708
- }, /*#__PURE__*/React$1.createElement(DropdownButton, {
51837
+ }, /*#__PURE__*/React$1.createElement(Label$1, {
51838
+ className: "Label",
51839
+ isFocused: open,
51840
+ labelColor: labelColor,
51841
+ hasValue: hasValue,
51842
+ disabled: disabled,
51843
+ showLabelOnTop: showLabelOnTop
51844
+ }, getLabel(), getRequired()), /*#__PURE__*/React$1.createElement(DropdownButton, {
51709
51845
  ref: buttonRef,
51710
51846
  onClick: toggleDropdown,
51711
51847
  disabled: disabled,
@@ -51713,13 +51849,9 @@ const OverlayDropdown = _ref => {
51713
51849
  type: "button"
51714
51850
  }, /*#__PURE__*/React$1.createElement(TruncatedText, {
51715
51851
  onMouseEnter: () => setHoveredText(selected?.label),
51716
- onMouseLeave: () => setHoveredText(null)
51717
- }, selected ? getDisplayText(selected.label) : 'Choose Overlay', required && /*#__PURE__*/React$1.createElement("span", {
51718
- style: {
51719
- color: 'red',
51720
- marginLeft: '2px'
51721
- }
51722
- }, "*")), open ? /*#__PURE__*/React$1.createElement(MenuItemUpIcon, {
51852
+ onMouseLeave: () => setHoveredText(null),
51853
+ color: !selected && open ? placeHolderColor : "inherit"
51854
+ }, selected ? getDisplayText(selected.label) : open ? placeHolder : ''), open ? /*#__PURE__*/React$1.createElement(MenuItemUpIcon, {
51723
51855
  width: "12px",
51724
51856
  height: "12px",
51725
51857
  color: "#B1B1B1"