sag_components 2.0.0-beta127 → 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.js CHANGED
@@ -64,7 +64,7 @@ const ButtonItem = styled__default["default"].div`
64
64
  transition: background-color 0.3s, color 0.3s;
65
65
  }
66
66
  `;
67
- const Label$a = styled__default["default"].label`
67
+ const Label$b = styled__default["default"].label`
68
68
  font-family: "Poppins";
69
69
  font-size: 14px;
70
70
  font-weight: 400;
@@ -536,7 +536,7 @@ const Button$1 = props => {
536
536
  onMouseEnter: () => setHover(true),
537
537
  onMouseLeave: () => setHover(false),
538
538
  borderRadius: borderRadius
539
- }, commonProps), getIcon(leftIcon), /*#__PURE__*/React__default["default"].createElement(Label$a, {
539
+ }, commonProps), getIcon(leftIcon), /*#__PURE__*/React__default["default"].createElement(Label$b, {
540
540
  className: "Label",
541
541
  disabled: disabled
542
542
  }, text), getIcon(rightIcon)));
@@ -2978,7 +2978,7 @@ const LinkButtonItem = styled__default["default"].div`
2978
2978
  transition: background-color 0.3s, color 0.3s;
2979
2979
  }
2980
2980
  `;
2981
- const Label$9 = styled__default["default"].label`
2981
+ const Label$a = styled__default["default"].label`
2982
2982
  user-select: none;
2983
2983
  pointer-events: none;
2984
2984
  `;
@@ -3241,7 +3241,7 @@ const LinkButton = _ref => {
3241
3241
  disabled: disabled,
3242
3242
  text_color: textColor || (type === 'secondary' ? '#212121' : '#229E38'),
3243
3243
  font_size: size === 'small' ? '14px' : '16px'
3244
- }, getLeftIcon(), /*#__PURE__*/React__default["default"].createElement(Label$9, {
3244
+ }, getLeftIcon(), /*#__PURE__*/React__default["default"].createElement(Label$a, {
3245
3245
  className: "Label",
3246
3246
  disabled: disabled,
3247
3247
  font_size: size === 'small' ? '14px' : '16px'
@@ -3650,7 +3650,7 @@ const Body = styled__default["default"].div`
3650
3650
  border-radius: ${props => props.setBackground ? '12px' : '0'};
3651
3651
  box-shadow: ${props => props.setBackground ? '0px 0px 20px 0px rgba(0, 0, 0, 0.10)' : 'unset'};
3652
3652
  `;
3653
- const Label$8 = styled__default["default"].div`
3653
+ const Label$9 = styled__default["default"].div`
3654
3654
  font-size: 12px;
3655
3655
  font-weight: 400;
3656
3656
  padding: 8px;
@@ -3901,7 +3901,7 @@ const TabMenu = props => {
3901
3901
  hoverBorderColor: buttonHoverColor
3902
3902
  })), showActions && /*#__PURE__*/React__default["default"].createElement(ActionsWrapper, {
3903
3903
  className: "ActionsWrapper"
3904
- }, showLabel && /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(Label$8, {
3904
+ }, showLabel && /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(Label$9, {
3905
3905
  className: "Label"
3906
3906
  }, /*#__PURE__*/React__default["default"].createElement("span", null, "Platform: "), "Total"), /*#__PURE__*/React__default["default"].createElement("span", {
3907
3907
  className: "separator"
@@ -8535,7 +8535,7 @@ const DropdownWrapper$2 = styled__default["default"].div`
8535
8535
  pointer-events: none;
8536
8536
  }
8537
8537
  `;
8538
- const Label$7 = styled__default["default"].label`
8538
+ const Label$8 = styled__default["default"].label`
8539
8539
  font-size: ${props => props.isFocused || props.hasValue ? '14px' : '14px'};
8540
8540
  font-weight: 400;
8541
8541
  padding-inline-end: 5px;
@@ -8857,7 +8857,7 @@ const DropdownSingleNew = ({
8857
8857
  disabled: disabled,
8858
8858
  error: error,
8859
8859
  onClick: handleLabelClick
8860
- }, /*#__PURE__*/React__default["default"].createElement(Label$7, {
8860
+ }, /*#__PURE__*/React__default["default"].createElement(Label$8, {
8861
8861
  className: "Label",
8862
8862
  isFocused: isFocused,
8863
8863
  labelColor: labelColor,
@@ -8994,7 +8994,7 @@ const DropdownWrapper$1 = styled__default["default"].div`
8994
8994
  pointer-events: none;
8995
8995
  }
8996
8996
  `;
8997
- const Label$6 = styled__default["default"].label`
8997
+ const Label$7 = styled__default["default"].label`
8998
8998
  font-size: ${props => props.isFocused || props.hasValue ? '14px' : '14px'};
8999
8999
  font-weight: 400;
9000
9000
  padding-inline-end: 5px;
@@ -9365,7 +9365,7 @@ const DropdownMultiNew = ({
9365
9365
  disabled: disabled,
9366
9366
  error: error,
9367
9367
  onClick: handleLabelClick
9368
- }, /*#__PURE__*/React__default["default"].createElement(Label$6, {
9368
+ }, /*#__PURE__*/React__default["default"].createElement(Label$7, {
9369
9369
  className: "Label",
9370
9370
  isFocused: isFocused,
9371
9371
  labelColor: labelColor,
@@ -9883,21 +9883,20 @@ const DatePicker = ({
9883
9883
  };
9884
9884
 
9885
9885
  /* eslint-disable import/no-extraneous-dependencies */
9886
- const RangePicker = _ref => {
9887
- let {
9888
- label,
9889
- onChange,
9890
- borderRadius,
9891
- required,
9892
- width,
9893
- height,
9894
- placeholder,
9895
- disabled,
9896
- borderColor,
9897
- borderColorFocus,
9898
- textColor,
9899
- selectedValue
9900
- } = _ref;
9886
+ const RangePicker = ({
9887
+ label,
9888
+ onChange,
9889
+ borderRadius,
9890
+ required,
9891
+ width,
9892
+ height,
9893
+ placeholder,
9894
+ disabled,
9895
+ borderColor,
9896
+ borderColorFocus,
9897
+ textColor,
9898
+ selectedValue
9899
+ }) => {
9901
9900
  const [isFocused, setIsFocused] = React$1.useState(false);
9902
9901
  const [isOpen, setIsOpen] = React$1.useState(false);
9903
9902
  const [value, setValue] = React$1.useState(''); // Added value state
@@ -10321,24 +10320,23 @@ const QuarterPopupPicker = ({
10321
10320
  };
10322
10321
 
10323
10322
  /* eslint-disable import/no-extraneous-dependencies */
10324
- const QuarterPicker = _ref => {
10325
- let {
10326
- availableQuarters,
10327
- // ["Q1-2024"]
10328
- label,
10329
- onChange,
10330
- borderRadius,
10331
- required,
10332
- width,
10333
- height,
10334
- placeholder,
10335
- disabled,
10336
- borderColor,
10337
- borderColorFocus,
10338
- textColor,
10339
- selectedValue,
10340
- startYear
10341
- } = _ref;
10323
+ const QuarterPicker = ({
10324
+ availableQuarters,
10325
+ // ["Q1-2024"]
10326
+ label,
10327
+ onChange,
10328
+ borderRadius,
10329
+ required,
10330
+ width,
10331
+ height,
10332
+ placeholder,
10333
+ disabled,
10334
+ borderColor,
10335
+ borderColorFocus,
10336
+ textColor,
10337
+ selectedValue,
10338
+ startYear
10339
+ }) => {
10342
10340
  const [isFocused, setIsFocused] = React$1.useState(false);
10343
10341
  const [isOpen, setIsOpen] = React$1.useState(false);
10344
10342
  const [value, setValue] = React$1.useState('');
@@ -10780,23 +10778,22 @@ const MonthPopupPicker = ({
10780
10778
  };
10781
10779
 
10782
10780
  /* eslint-disable import/no-extraneous-dependencies */
10783
- const MonthPicker = _ref => {
10784
- let {
10785
- availableMonths,
10786
- label,
10787
- onChange,
10788
- borderRadius,
10789
- required,
10790
- width,
10791
- height,
10792
- placeholder,
10793
- disabled,
10794
- borderColor,
10795
- borderColorFocus,
10796
- textColor,
10797
- selectedValue,
10798
- startYear
10799
- } = _ref;
10781
+ const MonthPicker = ({
10782
+ availableMonths,
10783
+ label,
10784
+ onChange,
10785
+ borderRadius,
10786
+ required,
10787
+ width,
10788
+ height,
10789
+ placeholder,
10790
+ disabled,
10791
+ borderColor,
10792
+ borderColorFocus,
10793
+ textColor,
10794
+ selectedValue,
10795
+ startYear
10796
+ }) => {
10800
10797
  const [isFocused, setIsFocused] = React$1.useState(false);
10801
10798
  const [isOpen, setIsOpen] = React$1.useState(false);
10802
10799
  const [value, setValue] = React$1.useState('');
@@ -23797,7 +23794,7 @@ const QuickFilterInput = styled__default["default"].div`
23797
23794
  font-size: 14px;
23798
23795
  border-radius: 8px;
23799
23796
  `;
23800
- const Label$5 = styled__default["default"].label`
23797
+ const Label$6 = styled__default["default"].label`
23801
23798
  font-size: 14px;
23802
23799
  font-weight: 500;
23803
23800
  color: ${props => props.disabled ? '#D0D0D0' : '212121'};
@@ -24045,7 +24042,7 @@ const QuickFilterDropdownSingle = _ref => {
24045
24042
  disabled: disabled,
24046
24043
  error: error,
24047
24044
  onClick: handleLabelClick
24048
- }, /*#__PURE__*/React__default["default"].createElement(Label$5, {
24045
+ }, /*#__PURE__*/React__default["default"].createElement(Label$6, {
24049
24046
  className: "Label",
24050
24047
  isFocused: isFocused,
24051
24048
  labelColor: labelColor,
@@ -24152,7 +24149,7 @@ const DropdownWrapper = styled__default["default"].div`
24152
24149
  font-size: 14px;
24153
24150
  border-radius: 10px;
24154
24151
  `;
24155
- const Label$4 = styled__default["default"].label`
24152
+ const Label$5 = styled__default["default"].label`
24156
24153
  font-size: ${props => props.isFocused || props.hasValue ? '14px' : '14px'};
24157
24154
  font-weight: 400;
24158
24155
  padding-inline-end: 5px;
@@ -24509,7 +24506,7 @@ const QuickFilterDropdownMultiSelection = _ref => {
24509
24506
  disabled: disabled,
24510
24507
  error: error,
24511
24508
  onClick: handleLabelClick
24512
- }, /*#__PURE__*/React__default["default"].createElement(Label$4, {
24509
+ }, /*#__PURE__*/React__default["default"].createElement(Label$5, {
24513
24510
  className: "Label",
24514
24511
  isFocused: isFocused,
24515
24512
  labelColor: labelColor,
@@ -29105,7 +29102,7 @@ const Controls$5 = styled__default["default"].div`
29105
29102
  display: flex;
29106
29103
  align-items: center;
29107
29104
  `;
29108
- const Label$3 = styled__default["default"].div`
29105
+ const Label$4 = styled__default["default"].div`
29109
29106
  display: flex;
29110
29107
  padding: 0 10px 0 10px;
29111
29108
  white-space: nowrap;
@@ -29185,7 +29182,7 @@ const CheckBox = props => {
29185
29182
  width: iconSize,
29186
29183
  height: iconSize,
29187
29184
  color: disabled ? colorDisabled : colorUnchecked
29188
- })), /*#__PURE__*/React__default["default"].createElement(Label$3, {
29185
+ })), /*#__PURE__*/React__default["default"].createElement(Label$4, {
29189
29186
  className: "Label",
29190
29187
  "data-testid": "label"
29191
29188
  }, label)));
@@ -35199,7 +35196,7 @@ const MainContainer = styled__default["default"].div`
35199
35196
  padding: 0;
35200
35197
  cursor: ${props => props.disabled ? 'not-allowed' : 'default'};
35201
35198
  `;
35202
- const Label$2 = styled__default["default"].label`
35199
+ const Label$3 = styled__default["default"].label`
35203
35200
 
35204
35201
  font-size: ${props => props.isFocused || props.hasValue ? '14px' : '14px'};
35205
35202
  font-weight: 400;
@@ -35421,7 +35418,7 @@ const Input$2 = _ref => {
35421
35418
  error: error,
35422
35419
  onClick: handleLabelClick,
35423
35420
  size: size
35424
- }, /*#__PURE__*/React__default["default"].createElement(Label$2, {
35421
+ }, /*#__PURE__*/React__default["default"].createElement(Label$3, {
35425
35422
  className: "Label",
35426
35423
  isFocused: isFocused,
35427
35424
  labelColor: labelColor,
@@ -36675,7 +36672,7 @@ const FieldRow$1 = styled__default["default"].div`
36675
36672
  justify-content: center;
36676
36673
  padding: 16px;
36677
36674
  `;
36678
- const Label$1 = styled__default["default"].label`
36675
+ const Label$2 = styled__default["default"].label`
36679
36676
  color: #222;
36680
36677
  display: flex;
36681
36678
  align-items: center;
@@ -36765,7 +36762,7 @@ const RangePop = props => {
36765
36762
  e.preventDefault();
36766
36763
  if (isValid) onApply(fields);
36767
36764
  }
36768
- }, /*#__PURE__*/React__default["default"].createElement(RadioWrapper, null, radioOptions.map((option, idx) => /*#__PURE__*/React__default["default"].createElement(Label$1, {
36765
+ }, /*#__PURE__*/React__default["default"].createElement(RadioWrapper, null, radioOptions.map((option, idx) => /*#__PURE__*/React__default["default"].createElement(Label$2, {
36769
36766
  key: option
36770
36767
  }, /*#__PURE__*/React__default["default"].createElement(Radio, {
36771
36768
  type: "radio",
@@ -36778,7 +36775,7 @@ const RangePop = props => {
36778
36775
  }
36779
36776
  }), option))), /*#__PURE__*/React__default["default"].createElement(FieldRow$1, null, params.map((param, idx) => /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, {
36780
36777
  key: param.label
36781
- }, /*#__PURE__*/React__default["default"].createElement(Label$1, {
36778
+ }, /*#__PURE__*/React__default["default"].createElement(Label$2, {
36782
36779
  htmlFor: `param-${idx}`
36783
36780
  }, param.label), /*#__PURE__*/React__default["default"].createElement(Input$1, {
36784
36781
  id: `param-${idx}`,
@@ -36789,7 +36786,7 @@ const RangePop = props => {
36789
36786
  onBlur: () => handleBlur(idx),
36790
36787
  min: 0,
36791
36788
  max: param.type === 'percent' ? 100 : undefined
36792
- }))), /*#__PURE__*/React__default["default"].createElement(Label$1, null, paramType)), /*#__PURE__*/React__default["default"].createElement(Actions$1, null, /*#__PURE__*/React__default["default"].createElement(ClearButton, {
36789
+ }))), /*#__PURE__*/React__default["default"].createElement(Label$2, null, paramType)), /*#__PURE__*/React__default["default"].createElement(Actions$1, null, /*#__PURE__*/React__default["default"].createElement(ClearButton, {
36793
36790
  type: "button",
36794
36791
  onClick: () => {
36795
36792
  setFields(params.map(() => ''));
@@ -51361,7 +51358,7 @@ const TruncatedText = styled__default["default"].span`
51361
51358
  line-height: 21px;
51362
51359
  font-size: 14px;
51363
51360
  font-weight: 400;
51364
- color: inherit;
51361
+ color: ${props => props.color};
51365
51362
  max-width: 340px;
51366
51363
  white-space: nowrap;
51367
51364
  overflow: hidden;
@@ -51383,6 +51380,28 @@ styled__default["default"].div`
51383
51380
  /* max-width: 320px; */
51384
51381
  white-space: pre-line;
51385
51382
  `;
51383
+ const Label$1 = styled__default["default"].label`
51384
+ font-size: ${props => props.isFocused || props.hasValue ? '14px' : '14px'};
51385
+ font-weight: 400;
51386
+ padding-inline-end: 5px;
51387
+ padding-inline-start: 5px;
51388
+ margin-right: 10px;
51389
+ z-index: 2;
51390
+ color: ${props => props.error ? 'red' : props.disabled ? '#888' : props.labelColor};
51391
+ background-color: ${props => props.showLabelOnTop ? 'white' : 'transparent'} ;
51392
+ position: absolute;
51393
+ top: ${props => props.isFocused || props.hasValue ? '0px' : '24px'};
51394
+ left: ${props => props.isFocused || props.hasValue ? '23px' : '14px'};
51395
+ transform: translateY(-50%);
51396
+ transition: ${props => props.showLabelOnTop ? 'top 0.3s ease, font-size 0.3s ease, color 0.3s ease' : ''} ;
51397
+ display: flex;
51398
+ align-items: center;
51399
+ box-sizing: border-box;
51400
+ gap: 4px;
51401
+ &:hover {
51402
+ cursor: ${props => props.disabled ? 'not-allowed' : 'pointer'};
51403
+ }
51404
+ `;
51386
51405
 
51387
51406
  const DialogOverlay = styled__default["default"].div`
51388
51407
  position: fixed;
@@ -51607,6 +51626,12 @@ const OverlayDropdown = _ref => {
51607
51626
  hoverColor = '#E6F0F0',
51608
51627
  dropdownMaxHeight = '600px',
51609
51628
  width = '100%',
51629
+ label,
51630
+ labelEmptyValue,
51631
+ showLabelOnTop,
51632
+ placeHolder,
51633
+ labelColor,
51634
+ placeHolderColor,
51610
51635
  ...props
51611
51636
  } = _ref;
51612
51637
  const [open, setOpen] = React$1.useState(false);
@@ -51677,6 +51702,7 @@ const OverlayDropdown = _ref => {
51677
51702
  return null;
51678
51703
  };
51679
51704
  const selected = findSelectedItem();
51705
+ const hasValue = !!selected;
51680
51706
 
51681
51707
  // Tooltip logic for long string
51682
51708
  const getDisplayText = text => {
@@ -51790,10 +51816,42 @@ const OverlayDropdown = _ref => {
51790
51816
  setOpen(prev => !prev);
51791
51817
  };
51792
51818
  const dataToRender = getDataWithLastDefined();
51819
+ const getLabel = () => {
51820
+ if (!showLabelOnTop && open) {
51821
+ return "";
51822
+ }
51823
+ if (hasValue) {
51824
+ return label;
51825
+ }
51826
+ return labelEmptyValue;
51827
+ };
51828
+ const getRequired = () => {
51829
+ if (!showLabelOnTop && open) {
51830
+ return "";
51831
+ }
51832
+ if (!showLabelOnTop && !label && hasValue) {
51833
+ return "";
51834
+ }
51835
+ if (required) {
51836
+ return /*#__PURE__*/React__default["default"].createElement("span", {
51837
+ style: {
51838
+ color: "red"
51839
+ }
51840
+ }, "*");
51841
+ }
51842
+ return "";
51843
+ };
51793
51844
  return /*#__PURE__*/React__default["default"].createElement(DropdownContainer, {
51794
51845
  width: width,
51795
51846
  ref: containerRef
51796
- }, /*#__PURE__*/React__default["default"].createElement(DropdownButton, {
51847
+ }, /*#__PURE__*/React__default["default"].createElement(Label$1, {
51848
+ className: "Label",
51849
+ isFocused: open,
51850
+ labelColor: labelColor,
51851
+ hasValue: hasValue,
51852
+ disabled: disabled,
51853
+ showLabelOnTop: showLabelOnTop
51854
+ }, getLabel(), getRequired()), /*#__PURE__*/React__default["default"].createElement(DropdownButton, {
51797
51855
  ref: buttonRef,
51798
51856
  onClick: toggleDropdown,
51799
51857
  disabled: disabled,
@@ -51801,13 +51859,9 @@ const OverlayDropdown = _ref => {
51801
51859
  type: "button"
51802
51860
  }, /*#__PURE__*/React__default["default"].createElement(TruncatedText, {
51803
51861
  onMouseEnter: () => setHoveredText(selected?.label),
51804
- onMouseLeave: () => setHoveredText(null)
51805
- }, selected ? getDisplayText(selected.label) : 'Choose Overlay', required && /*#__PURE__*/React__default["default"].createElement("span", {
51806
- style: {
51807
- color: 'red',
51808
- marginLeft: '2px'
51809
- }
51810
- }, "*")), open ? /*#__PURE__*/React__default["default"].createElement(MenuItemUpIcon, {
51862
+ onMouseLeave: () => setHoveredText(null),
51863
+ color: !selected && open ? placeHolderColor : "inherit"
51864
+ }, selected ? getDisplayText(selected.label) : open ? placeHolder : ''), open ? /*#__PURE__*/React__default["default"].createElement(MenuItemUpIcon, {
51811
51865
  width: "12px",
51812
51866
  height: "12px",
51813
51867
  color: "#B1B1B1"