sag_components 2.0.0-beta173 → 2.0.0-beta175

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.js CHANGED
@@ -459,6 +459,25 @@ const Calendar = () => /*#__PURE__*/React__default["default"].createElement("svg
459
459
  fill: "#568202"
460
460
  }));
461
461
 
462
+ // eslint-disable-next-line react/prop-types
463
+ const ErrorIcon = _ref => {
464
+ let {
465
+ color = '#FF3949',
466
+ width = '18',
467
+ height = '18'
468
+ } = _ref;
469
+ return /*#__PURE__*/React__default["default"].createElement("svg", {
470
+ width: width,
471
+ height: height,
472
+ viewBox: "0 0 14 13",
473
+ fill: "none",
474
+ xmlns: "http://www.w3.org/2000/svg"
475
+ }, /*#__PURE__*/React__default["default"].createElement("path", {
476
+ d: "M7 1.625C5.24219 1.625 3.64844 2.5625 2.75781 4.0625C1.89062 5.58594 1.89062 7.4375 2.75781 8.9375C3.64844 10.4609 5.24219 11.375 7 11.375C8.73438 11.375 10.3281 10.4609 11.2188 8.9375C12.0859 7.4375 12.0859 5.58594 11.2188 4.0625C10.3281 2.5625 8.73438 1.625 7 1.625ZM7 12.5C4.84375 12.5 2.875 11.375 1.79688 9.5C0.71875 7.64844 0.71875 5.375 1.79688 3.5C2.875 1.64844 4.84375 0.5 7 0.5C9.13281 0.5 11.1016 1.64844 12.1797 3.5C13.2578 5.375 13.2578 7.64844 12.1797 9.5C11.1016 11.375 9.13281 12.5 7 12.5ZM7 3.5C7.30469 3.5 7.5625 3.75781 7.5625 4.0625V6.6875C7.5625 7.01562 7.30469 7.25 7 7.25C6.67188 7.25 6.4375 7.01562 6.4375 6.6875V4.0625C6.4375 3.75781 6.67188 3.5 7 3.5ZM7.75 8.75C7.75 9.17188 7.39844 9.5 7 9.5C6.57812 9.5 6.25 9.17188 6.25 8.75C6.25 8.35156 6.57812 8 7 8C7.39844 8 7.75 8.35156 7.75 8.75Z",
477
+ fill: color
478
+ }));
479
+ };
480
+
462
481
  const ChervronRightIcon = _ref => {
463
482
  let {
464
483
  width = "8",
@@ -10439,23 +10458,24 @@ const QuarterPopupPicker = ({
10439
10458
  };
10440
10459
 
10441
10460
  /* eslint-disable import/no-extraneous-dependencies */
10442
- const QuarterPicker = ({
10443
- availableQuarters,
10444
- // ["Q1-2024"]
10445
- label,
10446
- onChange,
10447
- borderRadius,
10448
- required,
10449
- width,
10450
- height,
10451
- placeholder,
10452
- disabled,
10453
- borderColor,
10454
- borderColorFocus,
10455
- textColor,
10456
- selectedValue,
10457
- startYear
10458
- }) => {
10461
+ const QuarterPicker = _ref => {
10462
+ let {
10463
+ availableQuarters,
10464
+ // ["Q1-2024"]
10465
+ label,
10466
+ onChange,
10467
+ borderRadius,
10468
+ required,
10469
+ width,
10470
+ height,
10471
+ placeholder,
10472
+ disabled,
10473
+ borderColor,
10474
+ borderColorFocus,
10475
+ textColor,
10476
+ selectedValue,
10477
+ startYear
10478
+ } = _ref;
10459
10479
  const [isFocused, setIsFocused] = React$1.useState(false);
10460
10480
  const [isOpen, setIsOpen] = React$1.useState(false);
10461
10481
  const [value, setValue] = React$1.useState('');
@@ -10897,22 +10917,23 @@ const MonthPopupPicker = ({
10897
10917
  };
10898
10918
 
10899
10919
  /* eslint-disable import/no-extraneous-dependencies */
10900
- const MonthPicker = ({
10901
- availableMonths,
10902
- label,
10903
- onChange,
10904
- borderRadius,
10905
- required,
10906
- width,
10907
- height,
10908
- placeholder,
10909
- disabled,
10910
- borderColor,
10911
- borderColorFocus,
10912
- textColor,
10913
- selectedValue,
10914
- startYear
10915
- }) => {
10920
+ const MonthPicker = _ref => {
10921
+ let {
10922
+ availableMonths,
10923
+ label,
10924
+ onChange,
10925
+ borderRadius,
10926
+ required,
10927
+ width,
10928
+ height,
10929
+ placeholder,
10930
+ disabled,
10931
+ borderColor,
10932
+ borderColorFocus,
10933
+ textColor,
10934
+ selectedValue,
10935
+ startYear
10936
+ } = _ref;
10916
10937
  const [isFocused, setIsFocused] = React$1.useState(false);
10917
10938
  const [isOpen, setIsOpen] = React$1.useState(false);
10918
10939
  const [value, setValue] = React$1.useState('');
@@ -34209,25 +34230,6 @@ const InsightsCarousel = _ref => {
34209
34230
  })))));
34210
34231
  };
34211
34232
 
34212
- // eslint-disable-next-line react/prop-types
34213
- const ErrorIcon = _ref => {
34214
- let {
34215
- color = '#FF3949',
34216
- width = '18',
34217
- height = '18'
34218
- } = _ref;
34219
- return /*#__PURE__*/React__default["default"].createElement("svg", {
34220
- width: width,
34221
- height: height,
34222
- viewBox: "0 0 14 13",
34223
- fill: "none",
34224
- xmlns: "http://www.w3.org/2000/svg"
34225
- }, /*#__PURE__*/React__default["default"].createElement("path", {
34226
- d: "M7 1.625C5.24219 1.625 3.64844 2.5625 2.75781 4.0625C1.89062 5.58594 1.89062 7.4375 2.75781 8.9375C3.64844 10.4609 5.24219 11.375 7 11.375C8.73438 11.375 10.3281 10.4609 11.2188 8.9375C12.0859 7.4375 12.0859 5.58594 11.2188 4.0625C10.3281 2.5625 8.73438 1.625 7 1.625ZM7 12.5C4.84375 12.5 2.875 11.375 1.79688 9.5C0.71875 7.64844 0.71875 5.375 1.79688 3.5C2.875 1.64844 4.84375 0.5 7 0.5C9.13281 0.5 11.1016 1.64844 12.1797 3.5C13.2578 5.375 13.2578 7.64844 12.1797 9.5C11.1016 11.375 9.13281 12.5 7 12.5ZM7 3.5C7.30469 3.5 7.5625 3.75781 7.5625 4.0625V6.6875C7.5625 7.01562 7.30469 7.25 7 7.25C6.67188 7.25 6.4375 7.01562 6.4375 6.6875V4.0625C6.4375 3.75781 6.67188 3.5 7 3.5ZM7.75 8.75C7.75 9.17188 7.39844 9.5 7 9.5C6.57812 9.5 6.25 9.17188 6.25 8.75C6.25 8.35156 6.57812 8 7 8C7.39844 8 7.75 8.35156 7.75 8.75Z",
34227
- fill: color
34228
- }));
34229
- };
34230
-
34231
34233
  // eslint-disable-next-line react/prop-types
34232
34234
  const SucceededIcon = _ref => {
34233
34235
  let {
@@ -35624,9 +35626,12 @@ const ToggleSwitchLabel = styled__default["default"].label`
35624
35626
  position: relative;
35625
35627
  cursor: pointer;
35626
35628
  user-select: none;
35627
- opacity: ${({
35628
- disabled
35629
- }) => disabled ? 0.5 : 1};
35629
+ opacity: ${_ref => {
35630
+ let {
35631
+ disabled
35632
+ } = _ref;
35633
+ return disabled ? 0.5 : 1;
35634
+ }};
35630
35635
  `;
35631
35636
  const ToggleInput = styled__default["default"].input`
35632
35637
  display: none;
@@ -35634,15 +35639,19 @@ const ToggleInput = styled__default["default"].input`
35634
35639
  const ToggleSlider = styled__default["default"].span`
35635
35640
  display: block;
35636
35641
  position: relative;
35637
- background: ${({
35638
- checked,
35639
- disabled
35640
- }) => checked ? disabled ? "#7bb1b0" : "#006d6a" : "#cfd8dc"};
35642
+ background: ${_ref2 => {
35643
+ let {
35644
+ checked,
35645
+ disabled
35646
+ } = _ref2;
35647
+ return checked ? disabled ? "#7bb1b0" : "#006d6a" : "#cfd8dc";
35648
+ }};
35641
35649
  border-radius: 999px;
35642
35650
  transition: background 0.2s;
35643
- ${({
35644
- size
35645
- }) => {
35651
+ ${_ref3 => {
35652
+ let {
35653
+ size
35654
+ } = _ref3;
35646
35655
  switch (size) {
35647
35656
  case "s":
35648
35657
  return styled.css`width: 40px; height: 20px;`;
@@ -35661,9 +35670,10 @@ const ToggleSlider = styled__default["default"].span`
35661
35670
  background: #fff;
35662
35671
  border-radius: 50%;
35663
35672
  transition: left 0.2s, width 0.2s, height 0.2s;
35664
- ${({
35665
- size
35666
- }) => {
35673
+ ${_ref4 => {
35674
+ let {
35675
+ size
35676
+ } = _ref4;
35667
35677
  switch (size) {
35668
35678
  case "s":
35669
35679
  return styled.css`width: 14px; height: 14px;`;
@@ -35673,10 +35683,11 @@ const ToggleSlider = styled__default["default"].span`
35673
35683
  return styled.css`width: 20px; height: 20px;`;
35674
35684
  }
35675
35685
  }}
35676
- left: ${({
35677
- checked,
35678
- size
35679
- }) => {
35686
+ left: ${_ref5 => {
35687
+ let {
35688
+ checked,
35689
+ size
35690
+ } = _ref5;
35680
35691
  if (!checked) return "3px";
35681
35692
  switch (size) {
35682
35693
  case "s":
@@ -38741,13 +38752,13 @@ const ExpandedContent = styled__default["default"].div`
38741
38752
  `;
38742
38753
 
38743
38754
  // DROPDOWN STYLES
38744
- const DropdownContainer$1 = styled__default["default"].div`
38755
+ styled__default["default"].div`
38745
38756
  position: relative;
38746
38757
  display: inline-block;
38747
38758
  width: 100%;
38748
38759
  font-family: "Poppins", sans-serif;
38749
38760
  `;
38750
- const DropdownButton$1 = styled__default["default"].button`
38761
+ styled__default["default"].button`
38751
38762
  display: flex;
38752
38763
  align-items: center;
38753
38764
  justify-content: space-between;
@@ -38780,7 +38791,7 @@ const DropdownButton$1 = styled__default["default"].button`
38780
38791
  flex: 1;
38781
38792
  }
38782
38793
  `;
38783
- const DropdownIcon = styled__default["default"].div`
38794
+ styled__default["default"].div`
38784
38795
  display: flex;
38785
38796
  align-items: center;
38786
38797
  justify-content: center;
@@ -38795,7 +38806,7 @@ const DropdownIcon = styled__default["default"].div`
38795
38806
  transform: rotate(180deg);
38796
38807
  `}
38797
38808
  `;
38798
- const DropdownMenu = styled__default["default"].div`
38809
+ styled__default["default"].div`
38799
38810
  position: absolute;
38800
38811
  top: calc(100%);
38801
38812
  left: 0;
@@ -38828,7 +38839,7 @@ const DropdownMenu = styled__default["default"].div`
38828
38839
  background: #94a3b8;
38829
38840
  }
38830
38841
  `;
38831
- const DropdownOption = styled__default["default"].div`
38842
+ styled__default["default"].div`
38832
38843
  display: flex;
38833
38844
  align-items: center;
38834
38845
  justify-content: space-between;
@@ -39076,6 +39087,177 @@ const DisabledTrashIcon = ({
39076
39087
  }));
39077
39088
  };
39078
39089
 
39090
+ // DROPDOWN STYLES
39091
+ const DropdownContainer$1 = styled__default["default"].div`
39092
+ position: relative;
39093
+ display: inline-block;
39094
+ width: 100%;
39095
+ font-family: "Poppins", sans-serif;
39096
+ `;
39097
+ const DropdownButton$1 = styled__default["default"].button`
39098
+ display: flex;
39099
+ align-items: center;
39100
+ justify-content: space-between;
39101
+ width: 100%;
39102
+ min-width: 120px;
39103
+ background-color: ${props => props.$isRowFocused || props.$isRowHovered ? props.$selectedColor : "white"};
39104
+ border: none;
39105
+ border-radius: 0;
39106
+ font-family: "Poppins", sans-serif;
39107
+ font-size: 14px;
39108
+ font-weight: 400;
39109
+ color: #212121;
39110
+ cursor: pointer;
39111
+ transition: all 0.2s ease;
39112
+
39113
+ &:hover {
39114
+ background-color: #D1E7E7;
39115
+ }
39116
+
39117
+ &:focus {
39118
+ outline: none;
39119
+ background-color: #E6F0F0;
39120
+ }
39121
+
39122
+ span {
39123
+ overflow: hidden;
39124
+ text-overflow: ellipsis;
39125
+ white-space: nowrap;
39126
+ text-align: left;
39127
+ flex: 1;
39128
+ }
39129
+ `;
39130
+ const DropdownIcon = styled__default["default"].div`
39131
+ display: flex;
39132
+ align-items: center;
39133
+ justify-content: center;
39134
+ width: 20px;
39135
+ height: 20px;
39136
+ background-color: ${props => props.$isRowFocused || props.$isRowHovered ? '#B4D1D2' : 'white'};
39137
+ border-radius: 4px;
39138
+ margin-left: 8px;
39139
+ transition: all 0.2s ease;
39140
+
39141
+ ${props => props.$isOpen && `
39142
+ transform: rotate(180deg);
39143
+ `}
39144
+ `;
39145
+ const DropdownMenu = styled__default["default"].div`
39146
+ position: absolute;
39147
+ top: calc(100%);
39148
+ left: 0;
39149
+ right: 0;
39150
+ z-index: 1000;
39151
+ background-color: white;
39152
+ border: none;
39153
+ border-radius: 0;
39154
+ box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
39155
+ font-family: "Poppins", sans-serif;
39156
+ max-height: ${props => props.$maxDropdownHeight || '200px'};
39157
+ overflow-y: auto;
39158
+ padding: 16px;
39159
+
39160
+ /* Custom scrollbar */
39161
+ &::-webkit-scrollbar {
39162
+ width: 4px;
39163
+ }
39164
+
39165
+ &::-webkit-scrollbar-track {
39166
+ background: transparent;
39167
+ }
39168
+
39169
+ &::-webkit-scrollbar-thumb {
39170
+ background: #cbd5e1;
39171
+ border-radius: 2px;
39172
+ }
39173
+
39174
+ &::-webkit-scrollbar-thumb:hover {
39175
+ background: #94a3b8;
39176
+ }
39177
+ `;
39178
+ const DropdownOption = styled__default["default"].div`
39179
+ display: flex;
39180
+ align-items: center;
39181
+ justify-content: space-between;
39182
+ padding: 8px;
39183
+ font-size: 14px;
39184
+ font-weight: 400;
39185
+ color: #374151;
39186
+ cursor: pointer;
39187
+ transition: all 0.15s ease;
39188
+ border-radius: 0;
39189
+ border-left: 3px solid transparent;
39190
+ background-color: white;
39191
+
39192
+ &:hover {
39193
+ background-color: #E6F0F0;
39194
+ }
39195
+
39196
+ ${props => props.$isSelected && `
39197
+ background-color: #B4D1D2;
39198
+ color: #374151;
39199
+ font-weight: 500;
39200
+ border-left: 3px solid #066768;
39201
+
39202
+ &:hover {
39203
+ background-color: #A3C9CA;
39204
+ }
39205
+ `}
39206
+ `;
39207
+
39208
+ const Dropdown = ({
39209
+ isOpen,
39210
+ options,
39211
+ selectedValue,
39212
+ displayText,
39213
+ onToggle,
39214
+ onOptionSelect,
39215
+ maxDropdownHeight,
39216
+ isRowFocused = false,
39217
+ isRowHovered = false,
39218
+ selectedColor
39219
+ }) => {
39220
+ return /*#__PURE__*/React__default["default"].createElement(DropdownContainer$1, null, /*#__PURE__*/React__default["default"].createElement(DropdownButton$1, {
39221
+ onClick: onToggle,
39222
+ $isOpen: isOpen,
39223
+ $isRowFocused: isRowFocused,
39224
+ $selectedColor: selectedColor
39225
+ }, /*#__PURE__*/React__default["default"].createElement("span", null, displayText), /*#__PURE__*/React__default["default"].createElement(DropdownIcon, {
39226
+ $isOpen: isOpen,
39227
+ $isRowFocused: isRowFocused,
39228
+ $isRowHovered: isRowHovered
39229
+ }, /*#__PURE__*/React__default["default"].createElement(MenuItemOpenIcon, {
39230
+ width: "10",
39231
+ height: "6",
39232
+ color: "#212121"
39233
+ }))), isOpen && /*#__PURE__*/React__default["default"].createElement(DropdownMenu, {
39234
+ $maxDropdownHeight: maxDropdownHeight
39235
+ }, options.map((option, index) => /*#__PURE__*/React__default["default"].createElement(DropdownOption, {
39236
+ key: index,
39237
+ onClick: e => onOptionSelect(option, e),
39238
+ $isSelected: option.value === selectedValue
39239
+ }, /*#__PURE__*/React__default["default"].createElement("span", null, option.label), option.value === selectedValue && /*#__PURE__*/React__default["default"].createElement(OkIcon, {
39240
+ width: "24",
39241
+ height: "24",
39242
+ color: "#066768"
39243
+ })))));
39244
+ };
39245
+ Dropdown.propTypes = {
39246
+ isOpen: PropTypes.bool.isRequired,
39247
+ options: PropTypes.arrayOf(PropTypes.shape({
39248
+ value: PropTypes.string.isRequired,
39249
+ label: PropTypes.string.isRequired
39250
+ })).isRequired,
39251
+ selectedValue: PropTypes.string,
39252
+ displayText: PropTypes.string.isRequired,
39253
+ onToggle: PropTypes.func.isRequired,
39254
+ onOptionSelect: PropTypes.func.isRequired,
39255
+ maxDropdownHeight: PropTypes.string,
39256
+ isRowFocused: PropTypes.bool,
39257
+ isRowHovered: PropTypes.bool,
39258
+ selectedColor: PropTypes.string
39259
+ };
39260
+
39079
39261
  // TableBody.jsx
39080
39262
  const TableBody = ({
39081
39263
  columns,
@@ -39465,30 +39647,18 @@ const TableBody = ({
39465
39647
  // Find the current selected option to display its label
39466
39648
  const currentOption = dropdownOptions.find(option => option.value === value);
39467
39649
  const displayText = currentOption ? currentOption.label : value || 'Select...';
39468
- return /*#__PURE__*/React__default["default"].createElement(DropdownContainer$1, null, /*#__PURE__*/React__default["default"].createElement(DropdownButton$1, {
39469
- onClick: e => handleDropdownClick(rowIndex, column.key, e),
39470
- $isOpen: isOpen,
39471
- $isRowFocused: focusedRowIndex === rowIndex,
39472
- $selectedColor: selectedColor
39473
- }, /*#__PURE__*/React__default["default"].createElement("span", null, displayText), /*#__PURE__*/React__default["default"].createElement(DropdownIcon, {
39474
- $isOpen: isOpen,
39475
- $isRowFocused: focusedRowIndex === rowIndex,
39476
- $isRowHovered: hoveredRowIndex === rowIndex
39477
- }, /*#__PURE__*/React__default["default"].createElement(MenuItemOpenIcon, {
39478
- width: "10",
39479
- height: "6",
39480
- color: "#212121"
39481
- }))), isOpen && /*#__PURE__*/React__default["default"].createElement(DropdownMenu, {
39482
- $maxDropdownHeight: maxDropdownHeight
39483
- }, dropdownOptions.map((option, index) => /*#__PURE__*/React__default["default"].createElement(DropdownOption, {
39484
- key: index,
39485
- onClick: e => handleDropdownOptionClick(row, rowIndex, column.key, option, e),
39486
- $isSelected: option.value === value
39487
- }, /*#__PURE__*/React__default["default"].createElement("span", null, option.label), option.value === value && /*#__PURE__*/React__default["default"].createElement(OkIcon, {
39488
- width: "24",
39489
- height: "24",
39490
- color: "#066768"
39491
- })))));
39650
+ return /*#__PURE__*/React__default["default"].createElement(Dropdown, {
39651
+ isOpen: isOpen,
39652
+ options: dropdownOptions,
39653
+ selectedValue: value,
39654
+ displayText: displayText,
39655
+ onToggle: e => handleDropdownClick(rowIndex, column.key, e),
39656
+ onOptionSelect: (option, e) => handleDropdownOptionClick(row, rowIndex, column.key, option, e),
39657
+ maxDropdownHeight: maxDropdownHeight,
39658
+ isRowFocused: focusedRowIndex === rowIndex,
39659
+ isRowHovered: hoveredRowIndex === rowIndex,
39660
+ selectedColor: selectedColor
39661
+ });
39492
39662
  default:
39493
39663
  // Treat default as text
39494
39664
  return value.toString();
@@ -39529,9 +39699,9 @@ const TableBody = ({
39529
39699
  [dropdownKey]: false
39530
39700
  }));
39531
39701
 
39532
- // Fire the onDropdownSelected event
39702
+ // Fire the onDropdownSelected event with columnKey instead of columnName
39533
39703
  if (onDropdownSelected) {
39534
- onDropdownSelected(row, selectedOption);
39704
+ onDropdownSelected(row, selectedOption, columnKey);
39535
39705
  }
39536
39706
  };
39537
39707
 
@@ -54133,7 +54303,7 @@ const tagTemplates = {
54133
54303
  received: {
54134
54304
  backgroundColor: '#B9D5D54D',
54135
54305
  borderColor: '#B9D5D5',
54136
- textColor: '#000000',
54306
+ textColor: '#084141',
54137
54307
  text: 'Received'
54138
54308
  },
54139
54309
  approved: {
@@ -54142,16 +54312,16 @@ const tagTemplates = {
54142
54312
  textColor: '#074310',
54143
54313
  text: 'Approved'
54144
54314
  },
54145
- canceled: {
54315
+ cancelled: {
54146
54316
  backgroundColor: '#EBA6AF4D',
54147
54317
  borderColor: '#EBA6AF',
54148
54318
  textColor: '#44070F',
54149
- text: 'Canceled'
54319
+ text: 'Cancelled'
54150
54320
  }
54151
54321
  };
54152
54322
  const Tag = props => {
54153
54323
  const {
54154
- type = 'pending',
54324
+ type,
54155
54325
  size = 'small',
54156
54326
  backgroundColor,
54157
54327
  borderColor,
@@ -54159,15 +54329,15 @@ const Tag = props => {
54159
54329
  borderRadius = "62px",
54160
54330
  text
54161
54331
  } = props;
54162
- const template = tagTemplates[type];
54332
+ const template = type ? tagTemplates[type] : null;
54163
54333
  const height = size === 'small' ? '21px' : size === 'medium' ? '32px' : '35px';
54164
54334
  return /*#__PURE__*/React__default["default"].createElement(StatusCell, {
54165
- backgroundColor: backgroundColor || template.backgroundColor,
54166
- borderColor: borderColor || template.borderColor,
54167
- color: textColor || template.textColor,
54335
+ backgroundColor: backgroundColor || template?.backgroundColor,
54336
+ borderColor: borderColor || template?.borderColor,
54337
+ color: textColor || template?.textColor,
54168
54338
  height: height,
54169
54339
  borderRadius: borderRadius
54170
- }, /*#__PURE__*/React__default["default"].createElement("span", null, text || template.text));
54340
+ }, /*#__PURE__*/React__default["default"].createElement("span", null, text || template?.text));
54171
54341
  };
54172
54342
 
54173
54343
  exports.AdvancedThresholds = AdvancedThresholds;