sag_components 2.0.0-beta103 → 2.0.0-beta104

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
@@ -426,21 +426,19 @@ const RedDot = ({
426
426
  fill: "#F00021"
427
427
  }));
428
428
 
429
- const CalendarInOpen = () => /*#__PURE__*/React__default["default"].createElement("svg", {
430
- width: "21",
431
- height: "21",
432
- viewBox: "0 0 21 21",
429
+ const CalendarInOpen = ({
430
+ width = "16",
431
+ height = "17",
432
+ fill = "#726F6F"
433
+ }) => /*#__PURE__*/React__default["default"].createElement("svg", {
434
+ width: width,
435
+ height: height,
436
+ viewBox: "0 0 16 17",
433
437
  fill: "none",
434
438
  xmlns: "http://www.w3.org/2000/svg"
435
- }, /*#__PURE__*/React__default["default"].createElement("rect", {
436
- width: "21",
437
- height: "21",
438
- rx: "4",
439
- fill: "#229E38",
440
- fillOpacity: "0.1"
441
- }), /*#__PURE__*/React__default["default"].createElement("path", {
442
- d: "M7.625 5C7.8125 5 8 5.1875 8 5.375V6.5H12.5V5.375C12.5 5.1875 12.6641 5 12.875 5C13.0625 5 13.25 5.1875 13.25 5.375V6.5H14C14.8203 6.5 15.5 7.17969 15.5 8V8.75V9.5V15.5C15.5 16.3438 14.8203 17 14 17H6.5C5.65625 17 5 16.3438 5 15.5V9.5V8.75V8C5 7.17969 5.65625 6.5 6.5 6.5H7.25V5.375C7.25 5.1875 7.41406 5 7.625 5ZM14.75 9.5H5.75V15.5C5.75 15.9219 6.07812 16.25 6.5 16.25H14C14.3984 16.25 14.75 15.9219 14.75 15.5V9.5ZM14 7.25H6.5C6.07812 7.25 5.75 7.60156 5.75 8V8.75H14.75V8C14.75 7.60156 14.3984 7.25 14 7.25Z",
443
- fill: "#066768"
439
+ }, /*#__PURE__*/React__default["default"].createElement("path", {
440
+ d: "M5.375 2.7002C5.5625 2.7002 5.75 2.87327 5.75 3.04635V4.08481H10.25V3.04635C10.25 2.87327 10.4141 2.7002 10.625 2.7002C10.8125 2.7002 11 2.87327 11 3.04635V4.08481H11.75C12.5703 4.08481 13.25 4.71222 13.25 5.46943V6.16173V6.85404V12.3925C13.25 13.1714 12.5703 13.7771 11.75 13.7771H4.25C3.40625 13.7771 2.75 13.1714 2.75 12.3925V6.85404V6.16173V5.46943C2.75 4.71222 3.40625 4.08481 4.25 4.08481H5V3.04635C5 2.87327 5.16406 2.7002 5.375 2.7002ZM12.5 6.85404H10.0625V8.41173H12.5V6.85404ZM12.5 9.10404H10.0625V10.8348H12.5V9.10404ZM12.5 11.5271H10.0625V13.0848H11.75C12.1484 13.0848 12.5 12.7819 12.5 12.3925V11.5271ZM9.3125 10.8348V9.10404H6.6875V10.8348H9.3125ZM6.6875 11.5271V13.0848H9.3125V11.5271H6.6875ZM5.9375 10.8348V9.10404H3.5V10.8348H5.9375ZM3.5 11.5271V12.3925C3.5 12.7819 3.82812 13.0848 4.25 13.0848H5.9375V11.5271H3.5ZM3.5 8.41173H5.9375V6.85404H3.5V8.41173ZM6.6875 8.41173H9.3125V6.85404H6.6875V8.41173ZM11.75 4.77712H4.25C3.82812 4.77712 3.5 5.10164 3.5 5.46943V6.16173H12.5V5.46943C12.5 5.10164 12.1484 4.77712 11.75 4.77712Z",
441
+ fill: fill
444
442
  }));
445
443
 
446
444
  const Calendar = () => /*#__PURE__*/React__default["default"].createElement("svg", {
@@ -23931,22 +23929,21 @@ const DeleteIcon = styled__default["default"].div`
23931
23929
  position: absolute;
23932
23930
  `;
23933
23931
 
23934
- const QuickFilterDropdownSingle = _ref => {
23935
- let {
23936
- label,
23937
- hoverColor,
23938
- options,
23939
- selectedValue,
23940
- placeHolder,
23941
- onChange,
23942
- disabled,
23943
- width,
23944
- error,
23945
- errorMessage,
23946
- xIconShow,
23947
- labelColor,
23948
- showLabelOnTop
23949
- } = _ref;
23932
+ const QuickFilterDropdownSingle = ({
23933
+ label,
23934
+ hoverColor,
23935
+ options,
23936
+ selectedValue,
23937
+ placeHolder,
23938
+ onChange,
23939
+ disabled,
23940
+ width,
23941
+ error,
23942
+ errorMessage,
23943
+ xIconShow,
23944
+ labelColor,
23945
+ showLabelOnTop
23946
+ }) => {
23950
23947
  const [isFocused, setIsFocused] = React$1.useState(false);
23951
23948
  const [showOptions, setShowOptions] = React$1.useState(false);
23952
23949
  const [inputValue, setInputValue] = React$1.useState("");
@@ -34373,6 +34370,7 @@ const Modal = styled__default["default"].div`
34373
34370
  display: flex;
34374
34371
  gap: 20px;
34375
34372
  padding: 20px;
34373
+ margin-top: 50px;
34376
34374
  flex-direction: column;
34377
34375
  background-color: white;
34378
34376
  border-radius: 12px;
@@ -34492,15 +34490,10 @@ const CalendarWrapper = styled__default["default"].div`
34492
34490
 
34493
34491
  /* ───────────────────────── header */
34494
34492
  const Header$2 = styled__default["default"].h4`
34495
- margin: 0 0 12px;
34493
+ margin: 0 0 20px;
34496
34494
  color: ${c.text};
34497
-
34498
- /* Content/P3 Regular */
34499
- font-family: Poppins;
34500
34495
  font-size: 12px;
34501
- font-style: normal;
34502
34496
  font-weight: 400;
34503
- line-height: normal;
34504
34497
  `;
34505
34498
 
34506
34499
  /* ───────────────────────── grid */
@@ -34652,20 +34645,24 @@ const WeeksCalendar = ({
34652
34645
  onClick: () => handleCellClick(wk)
34653
34646
  }, wk);
34654
34647
  })), /*#__PURE__*/React__default["default"].createElement(Footer, null, /*#__PURE__*/React__default["default"].createElement(Button$1, {
34648
+ text: "CLEAR",
34655
34649
  type: "secondary",
34656
34650
  disabled: !hasSelection,
34657
- onClick: clearAll,
34658
- text: "CLEAR"
34651
+ borderRadius: "8px",
34652
+ onClick: clearAll
34659
34653
  }), /*#__PURE__*/React__default["default"].createElement(Button$1, {
34660
34654
  type: "primary",
34655
+ text: "APPLY",
34661
34656
  disabled: !hasSelection,
34657
+ borderRadius: "8px",
34658
+ borderColor: backgroundColor,
34662
34659
  backgroundColor: backgroundColor,
34660
+ hoverBorderColor: hoverBackgroundColor,
34663
34661
  hoverBackgroundColor: hoverBackgroundColor,
34664
34662
  hoverTextColor: "#212121",
34665
34663
  onClick: () => {
34666
34664
  if (hasSelection) onApply(startWeek, endWeek ?? startWeek);
34667
- },
34668
- text: "APPLY"
34665
+ }
34669
34666
  }), onCancel && /*#__PURE__*/React__default["default"].createElement("button", {
34670
34667
  style: {
34671
34668
  display: "none"
@@ -34688,9 +34685,10 @@ const WeeksPickerContainer = styled__default["default"].div`
34688
34685
  margin-bottom: ${props => props.withMarginBottom ? '10px' : '0'};
34689
34686
  width: ${props => props.width || '100%'};
34690
34687
  height: ${props => props.height || 'auto'};
34688
+ font-family: "Poppins", sans-serif;
34691
34689
  `;
34692
34690
  const StyledInput$1 = styled__default["default"].input`
34693
- padding: 20px;
34691
+ padding: 16px;
34694
34692
  font-size: 14px;
34695
34693
  border-radius: ${props => props.borderRadius || '4px'};
34696
34694
  border: none;
@@ -34705,8 +34703,8 @@ const StyledInput$1 = styled__default["default"].input`
34705
34703
  cursor: ${props => props.disabled ? 'not-allowed' : 'text'};
34706
34704
  `;
34707
34705
  const StyledLabel = styled__default["default"].label`
34708
- font-size: ${props => props.isFocused || props.hasValue ? '14px' : '14px'};
34709
- width: ${props => props.isFocused || props.hasValue ? 'auto' : '150px'};
34706
+ font-size: 14px;
34707
+ /* width: ${props => props.isFocused || props.hasValue ? 'auto' : '150px'}; */
34710
34708
  color: ${props => props.disabled ? '#888' : (props.isFocused || props.hasValue ? props.borderColorFocus : '#757575') || '#333'};
34711
34709
  position: absolute;
34712
34710
  top: ${props => props.isFocused || props.hasValue ? '0px' : '50%'};
@@ -34730,11 +34728,15 @@ styled__default["default"].div`
34730
34728
  margin-top: 5px;
34731
34729
  `;
34732
34730
  const OptionsContainer = styled__default["default"].div`
34733
- position: relative;
34731
+ position: absolute;
34734
34732
  z-index: 999;
34733
+ ${props => props.showAbove ? `
34734
+ bottom: 100%;
34735
+ ` : `
34736
+ top: 100%;
34737
+ `}
34735
34738
  `;
34736
34739
  const InputContainer$1 = styled__default["default"].div`
34737
- position: relative;
34738
34740
  display: flex;
34739
34741
  flex-wrap: nowrap;
34740
34742
  justify-content: flex-start;
@@ -34747,7 +34749,6 @@ const InputContainer$1 = styled__default["default"].div`
34747
34749
  box-sizing: border-box;
34748
34750
  background-color: transparent;
34749
34751
  border: 1px solid ${props => props.disabled ? '#bdbdbd' : props.error ? 'red' : '#B1B1B1'};
34750
- font-family: "Poppins", sans-serif;
34751
34752
  font-weight: 400;
34752
34753
  font-size: 14px;
34753
34754
  border-radius: 12px;
@@ -34792,8 +34793,46 @@ const WeeksPicker = _ref => {
34792
34793
  } = _ref;
34793
34794
  const [value, setValue] = React$1.useState("");
34794
34795
  const inputRef = React$1.useRef(null);
34796
+ const containerRef = React$1.useRef(null);
34797
+ const optionsRef = React$1.useRef(null);
34795
34798
  const [isFocused, setIsFocused] = React$1.useState(false);
34796
34799
  const [isOpen, setIsOpen] = React$1.useState(false);
34800
+ const [showAbove, setShowAbove] = React$1.useState(false);
34801
+
34802
+ // Handle click outside to close calendar
34803
+ React$1.useEffect(() => {
34804
+ const handleClickOutside = event => {
34805
+ if (containerRef.current && !containerRef.current.contains(event.target)) {
34806
+ setIsOpen(false);
34807
+ }
34808
+ };
34809
+ if (isOpen) {
34810
+ document.addEventListener('mousedown', handleClickOutside);
34811
+ }
34812
+ return () => {
34813
+ document.removeEventListener('mousedown', handleClickOutside);
34814
+ };
34815
+ }, [isOpen]);
34816
+
34817
+ // Handle positioning when calendar opens
34818
+ React$1.useEffect(() => {
34819
+ if (isOpen && optionsRef.current && containerRef.current) {
34820
+ const containerRect = containerRef.current.getBoundingClientRect();
34821
+ const viewportHeight = window.innerHeight;
34822
+ const calendarHeight = 400; // Approximate height of the calendar
34823
+
34824
+ // Check if there's enough space below
34825
+ const spaceBelow = viewportHeight - containerRect.bottom;
34826
+ const spaceAbove = containerRect.top;
34827
+
34828
+ // Show above if there's not enough space below but enough space above
34829
+ if (spaceBelow < calendarHeight && spaceAbove > calendarHeight) {
34830
+ setShowAbove(true);
34831
+ } else {
34832
+ setShowAbove(false);
34833
+ }
34834
+ }
34835
+ }, [isOpen]);
34797
34836
  const handleToggle = () => {
34798
34837
  setIsOpen(!isOpen);
34799
34838
  };
@@ -34819,11 +34858,16 @@ const WeeksPicker = _ref => {
34819
34858
  setIsFocused(false);
34820
34859
  };
34821
34860
  return /*#__PURE__*/React__default["default"].createElement(WeeksPickerContainer, {
34861
+ ref: containerRef,
34822
34862
  width: width,
34823
34863
  height: height,
34824
34864
  withMarginBottom: withMarginBottom
34825
34865
  }, /*#__PURE__*/React__default["default"].createElement(InputContainer$1, {
34826
- onClick: handleToggle,
34866
+ onClick: () => {
34867
+ if (!disabled) {
34868
+ handleToggle();
34869
+ }
34870
+ },
34827
34871
  className: "InputContainer",
34828
34872
  isFocused: isFocused,
34829
34873
  hasValue: value,
@@ -34833,7 +34877,11 @@ const WeeksPicker = _ref => {
34833
34877
  borderColorFocus: borderColorFocus
34834
34878
  }, /*#__PURE__*/React__default["default"].createElement(StyledLabel, {
34835
34879
  className: "StyledLabel",
34836
- onClick: handleFocus,
34880
+ onClick: () => {
34881
+ if (!disabled) {
34882
+ handleFocus();
34883
+ }
34884
+ },
34837
34885
  isFocused: isFocused,
34838
34886
  hasValue: value,
34839
34887
  disabled: disabled,
@@ -34857,8 +34905,13 @@ const WeeksPicker = _ref => {
34857
34905
  borderColor: borderColor,
34858
34906
  textColor: textColor
34859
34907
  }), /*#__PURE__*/React__default["default"].createElement(CalendarDiv, {
34860
- onClick: handleToggle
34861
- }, isOpen === true ? /*#__PURE__*/React__default["default"].createElement(CalendarInOpen, null) : /*#__PURE__*/React__default["default"].createElement(Calendar, null))), isOpen && /*#__PURE__*/React__default["default"].createElement(OptionsContainer, null, /*#__PURE__*/React__default["default"].createElement(WeeksCalendar, {
34908
+ onClick: disabled ? undefined : handleToggle
34909
+ }, /*#__PURE__*/React__default["default"].createElement(CalendarInOpen, {
34910
+ fill: isOpen === true ? "#726F6F" : "#B1B1B1"
34911
+ }))), isOpen && /*#__PURE__*/React__default["default"].createElement(OptionsContainer, {
34912
+ ref: optionsRef,
34913
+ showAbove: showAbove
34914
+ }, /*#__PURE__*/React__default["default"].createElement(WeeksCalendar, {
34862
34915
  year: year,
34863
34916
  backgroundColor: borderColorFocus,
34864
34917
  hoverBackgroundColor: hoverColor,
@@ -37375,6 +37428,10 @@ const tooltipStyles = styled.css`
37375
37428
  top: calc(var(--tooltip-top, 0px) - var(--tooltip-offset, 60px));
37376
37429
  left: calc(var(--tooltip-left, 0px) + var(--tooltip-width, 0px) / 2);
37377
37430
  transform: translateX(-50%);
37431
+
37432
+ /* Add delay */
37433
+ opacity: 0;
37434
+ animation: showTooltip 0.3s ease-in-out 0.5s forwards;
37378
37435
  }
37379
37436
 
37380
37437
  /* Tooltip arrow */
@@ -37388,6 +37445,16 @@ const tooltipStyles = styled.css`
37388
37445
  border-top-color: white;
37389
37446
  z-index: 1001;
37390
37447
  pointer-events: none;
37448
+
37449
+ /* Add delay */
37450
+ opacity: 0;
37451
+ animation: showTooltip 0.3s ease-in-out 0.5s forwards;
37452
+ }
37453
+
37454
+ @keyframes showTooltip {
37455
+ to {
37456
+ opacity: 1;
37457
+ }
37391
37458
  }
37392
37459
  `;
37393
37460
  const StyledTableBody = styled__default["default"].tbody`
@@ -37477,6 +37544,10 @@ const TableCell = styled__default["default"].td`
37477
37544
  top: calc(var(--cell-top, 0px) - var(--cell-offset, 40px));
37478
37545
  left: calc(var(--cell-left, 0px) + var(--cell-width, 0px) / 2);
37479
37546
  transform: translateX(-50%);
37547
+
37548
+ /* Add delay */
37549
+ opacity: 0;
37550
+ animation: showTooltip 0.3s ease-in-out 0.5s forwards;
37480
37551
  }
37481
37552
 
37482
37553
  /* Tooltip arrow */
@@ -37490,6 +37561,10 @@ const TableCell = styled__default["default"].td`
37490
37561
  border-top-color: white;
37491
37562
  z-index: 1001;
37492
37563
  pointer-events: none;
37564
+
37565
+ /* Add delay */
37566
+ opacity: 0;
37567
+ animation: showTooltip 0.3s ease-in-out 0.5s forwards;
37493
37568
  }
37494
37569
 
37495
37570
  &[title] {