sag_components 1.0.835 → 1.0.836

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.
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+
3
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = void 0;
8
+ var _react = _interopRequireWildcard(require("react"));
9
+ var _MenuItemOpenIcon = require("./icons/MenuItemOpenIcon");
10
+ var _MenuItemUpIcon = require("./icons/MenuItemUpIcon");
11
+ var _SpotlightProductIcon = require("./icons/SpotlightProductIcon");
12
+ var _BannersDropdown = require("./BannersDropdown");
13
+ var _EventInfo = require("./EventInfo.style");
14
+ const EventInfo = props => {
15
+ const {
16
+ title,
17
+ subTitle,
18
+ productsData,
19
+ onSpotlightProductClick,
20
+ onClickBannersDropdown
21
+ } = props;
22
+ const [IsProductsListOpen, setIsProductsListOpen] = (0, _react.useState)(false);
23
+ const displayBannersDropdown = () => /*#__PURE__*/_react.default.createElement(_BannersDropdown.BannersDropdown, {
24
+ banners: [{
25
+ checked: true,
26
+ name: 'StopAndShop'
27
+ }, {
28
+ checked: true,
29
+ name: 'FoodLion'
30
+ }, {
31
+ checked: true,
32
+ name: 'GiantFood'
33
+ }, {
34
+ checked: true,
35
+ name: 'TheGiantCompany'
36
+ }, {
37
+ checked: true,
38
+ name: 'Hannaford'
39
+ }],
40
+ onClick: banners => {
41
+ onClickBannersDropdown({
42
+ banners
43
+ });
44
+ }
45
+ });
46
+ return /*#__PURE__*/_react.default.createElement(_EventInfo.EventInfoMainContainer, {
47
+ id: "EventInfoMainContainer"
48
+ }, /*#__PURE__*/_react.default.createElement(_EventInfo.EventInfoContainer, {
49
+ id: "EventInfoContainer"
50
+ }, /*#__PURE__*/_react.default.createElement(_EventInfo.EventInfoTitleContainer, {
51
+ id: "EventInfoTitleContainer"
52
+ }, /*#__PURE__*/_react.default.createElement(_EventInfo.EventInfoTitle, {
53
+ id: "EventInfoTitle"
54
+ }, title), /*#__PURE__*/_react.default.createElement(_EventInfo.EventInfoSubTitle, {
55
+ id: "EventInfoSubTitle"
56
+ }, "|"), /*#__PURE__*/_react.default.createElement(_EventInfo.EventInfoSubTitle, {
57
+ id: "EventInfoSubTitle"
58
+ }, productsData ? productsData === null || productsData === void 0 ? void 0 : productsData.length : ''), displayBannersDropdown()), /*#__PURE__*/_react.default.createElement(_EventInfo.ProductButtonContainer, {
59
+ id: "ProductButtonContainer",
60
+ onClick: () => {
61
+ setIsProductsListOpen(!IsProductsListOpen);
62
+ }
63
+ }, IsProductsListOpen ? /*#__PURE__*/_react.default.createElement(_MenuItemUpIcon.MenuItemUpIcon, {
64
+ color: "#212121"
65
+ }) : /*#__PURE__*/_react.default.createElement(_MenuItemOpenIcon.MenuItemOpenIcon, {
66
+ color: "#212121"
67
+ }))), IsProductsListOpen && /*#__PURE__*/_react.default.createElement(_EventInfo.EventInfoContentContainer, {
68
+ id: "EventInfoContentContainer"
69
+ }, /*#__PURE__*/_react.default.createElement(_EventInfo.ProductsTitle, {
70
+ id: "ProductsTitle"
71
+ }, subTitle), productsData === null || productsData === void 0 ? void 0 : productsData.map(item => /*#__PURE__*/_react.default.createElement(_EventInfo.ProductContainer, {
72
+ id: "ProductContainer"
73
+ }, /*#__PURE__*/_react.default.createElement(_EventInfo.Product, {
74
+ id: "Product"
75
+ }, item.label), item.ShowSpotlightProductButton ? /*#__PURE__*/_react.default.createElement(_EventInfo.ProductButtonContainer, {
76
+ id: "ProductButtonContainer",
77
+ background: "#F8CD00",
78
+ onClick: () => {
79
+ onSpotlightProductClick({
80
+ value: item.value,
81
+ label: item.label
82
+ });
83
+ }
84
+ }, /*#__PURE__*/_react.default.createElement(_SpotlightProductIcon.SpotlightProductIcon, null)) : ''))));
85
+ };
86
+ var _default = exports.default = EventInfo;
87
+ EventInfo.defaultProps = {
88
+ title: 'Products Variety',
89
+ subTitle: 'Product Name',
90
+ onSpotlightProductClick: () => {},
91
+ onClickBannersDropdown: () => {}
92
+ };
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.ProductsTitle = exports.ProductContainer = exports.ProductButtonContainer = exports.Product = exports.EventInfoTitleContainer = exports.EventInfoTitle = exports.EventInfoSubTitle = exports.EventInfoMainContainer = exports.EventInfoContentContainer = exports.EventInfoContainer = void 0;
8
+ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
9
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
10
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10;
11
+ const EventInfoMainContainer = exports.EventInfoMainContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n margin: 0;\n padding: 10px;\n border-radius: 12px;\n box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.2);\n"])));
12
+ const EventInfoContainer = exports.EventInfoContainer = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin: 0 10px;\n"])));
13
+ const EventInfoTitleContainer = exports.EventInfoTitleContainer = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n font-family: \"Poppins\", sans-serif;\n font-style: normal;\n font-size: 20px;\n line-height: 25px;\n display: flex;\n justify-content: flex-start;\n align-items: center;\n margin: 10px;\n gap: 15px;\n"])));
14
+ const EventInfoTitle = exports.EventInfoTitle = _styledComponents.default.h3(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n font-weight: 500;\n font-size: 20px;\n\n margin: 0;\n"])));
15
+ const EventInfoSubTitle = exports.EventInfoSubTitle = _styledComponents.default.h3(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n color: #757171;\n font-weight: 500;\n font-size: 20px;\n margin: 0;\n"])));
16
+ const EventInfoContentContainer = exports.EventInfoContentContainer = _styledComponents.default.div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n font-family: \"Poppins\", sans-serif;\n font-style: normal;\n font-size: 20px;\n line-height: 25px;\n display: flex;\n justify-content: flex-start;\n flex-direction: column;\n align-items: flex-start;\n margin: 10px;\n padding: 10px 20px 20px 50px;\n"])));
17
+ const ProductsTitle = exports.ProductsTitle = _styledComponents.default.h3(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n font-weight: 600;\n font-size: 14px;\n margin: 10px 0;\n"])));
18
+ const ProductContainer = exports.ProductContainer = _styledComponents.default.div(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n justify-content: flex-start;\n align-items: center;\n border-bottom: 1px solid #00000010;\n width: 100%;\n gap: 20px;\n"])));
19
+ const Product = exports.Product = _styledComponents.default.h3(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["\n font-weight: 400;\n font-size: 14px;\n border-radius: 12px;\n"])));
20
+ const ProductButtonContainer = exports.ProductButtonContainer = _styledComponents.default.div(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n background: ", ";\n border-radius: 12px;\n height: 25px;\n padding: 0 15px;\n user-select: none;\n &:hover {\n background-color: #f0f0f0;\n cursor: pointer;\n }\n gap: 10px;\n"])), props => props.background || '#ffffff');
@@ -1,33 +1,29 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = exports.FilterButton = void 0;
8
- var _react = _interopRequireWildcard(require("react"));
8
+ var _react = _interopRequireDefault(require("react"));
9
9
  var _FilterButton = require("./FilterButton.style");
10
10
  var _FilterIcon = require("./icons/FilterIcon");
11
11
  const FilterButton = props => {
12
12
  const {
13
13
  color,
14
- activeColor,
15
14
  height,
16
15
  buttonText,
17
16
  iconWidth,
18
17
  iconHeight,
19
18
  disabled,
20
- openState,
21
19
  onButtonClick
22
20
  } = props;
23
- const [activeState, setActiveState] = (0, _react.useState)(openState);
24
21
  const onClickHandler = event => {
25
22
  onButtonClick(event);
26
- setActiveState(!activeState);
27
23
  };
28
24
  return /*#__PURE__*/_react.default.createElement(_FilterButton.FilterButtonWrapper, {
29
25
  height: height,
30
- color: activeState ? activeColor : color,
26
+ color: color,
31
27
  disabled: disabled,
32
28
  onClick: event => {
33
29
  onClickHandler(event);
@@ -35,7 +31,7 @@ const FilterButton = props => {
35
31
  }, /*#__PURE__*/_react.default.createElement(_FilterIcon.FilterIcon, {
36
32
  width: iconWidth,
37
33
  height: iconHeight,
38
- color: activeState ? activeColor : color
34
+ color: color
39
35
  }), /*#__PURE__*/_react.default.createElement(_FilterButton.SpanText, null, buttonText));
40
36
  };
41
37
  exports.FilterButton = FilterButton;
@@ -44,10 +40,8 @@ FilterButton.defaultProps = {
44
40
  buttonText: 'Filter',
45
41
  height: '40px',
46
42
  color: '#212121',
47
- activeColor: '#229E38',
48
43
  iconHeight: 12,
49
44
  iconWidth: 12,
50
- openState: false,
51
45
  disabled: false,
52
46
  onButtonClick: () => {}
53
47
  };
@@ -8,5 +8,5 @@ exports.SpanText = exports.FilterButtonWrapper = void 0;
8
8
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
9
9
  var _styledComponents = _interopRequireDefault(require("styled-components"));
10
10
  var _templateObject, _templateObject2;
11
- const FilterButtonWrapper = exports.FilterButtonWrapper = _styledComponents.default.button(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n height: ", ";\n font-size: 14px;\n font-weight: 400;\n display: flex;\n gap: 8px;\n align-items: center;\n justify-content: center;\n padding: 8px 18px;\n color: ", ";\n border-radius: 8px;\n border: 1px solid ", ";\n background: transparent;\n transition: box-shadow 0.3s ease;\n &:hover, &:focus {\n cursor: pointer;\n box-shadow: 5px 5px 10px 0px rgba(0, 0, 0, 0.1);\n }\n"])), props => props.height, props => props.color, props => props.color);
11
+ const FilterButtonWrapper = exports.FilterButtonWrapper = _styledComponents.default.button(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n height: ", ";\n font-size: 14px;\n font-weight: 400;\n display: flex;\n gap: 8px;\n align-items: center;\n justify-content: center;\n padding: 8px 18px;\n color: ", ";\n border-radius: 8px;\n border: 1px solid #B1B1B1;\n background: transparent;\n transition: box-shadow 0.3s ease;\n &:hover, &:focus {\n cursor: pointer;\n box-shadow: 5px 5px 10px 0px rgba(0, 0, 0, 0.1);\n }\n"])), props => props.height, props => props.color);
12
12
  const SpanText = exports.SpanText = _styledComponents.default.span(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n"])));
@@ -15,7 +15,7 @@ const FieldsContainer = exports.FieldsContainer = _styledComponents.default.div(
15
15
  const FieldContainer = exports.FieldContainer = _styledComponents.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)([" \n margin: 0;\n"])));
16
16
  const DatePickerContainer = exports.DatePickerContainer = _styledComponents.default.div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n margin: 0;\n"])));
17
17
  const PeriodPickerContainer = exports.PeriodPickerContainer = _styledComponents.default.div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)([" \n display: flex;\n flex-direction: column;\n gap: 20px;\n"])));
18
- const PeriodPickerEmptyContainer = exports.PeriodPickerEmptyContainer = _styledComponents.default.div(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)([" \n display: flex; \n align-content: center;\n justify-content: flex-start;\n align-items: center; \n border-radius: 10px; \n border: 1px solid #E7E7E7;\n width: ", ";\n height: ", "; \n &:hover {\n cursor: pointer;\n } \n"])), props => props.width, props => props.height);
18
+ const PeriodPickerEmptyContainer = exports.PeriodPickerEmptyContainer = _styledComponents.default.div(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)([" \n display: flex; \n align-content: center;\n justify-content: flex-start;\n align-items: center; \n margin-bottom: 10px;\n border-radius: 10px; \n border: 1px solid #E7E7E7;\n width: ", ";\n height: ", "; \n &:hover {\n cursor: pointer;\n } \n"])), props => props.width, props => props.height);
19
19
  const PeriodPickerEmptyText = exports.PeriodPickerEmptyText = _styledComponents.default.div(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["\n margin: 0 20px;\n font-family: \"Poppins\", sans-serif;\n font-weight: 400;\n font-size: 14px;\n color: #8B8989;\n user-select: none; \n"])));
20
20
  const TooltipTextContainer = exports.TooltipTextContainer = _styledComponents.default.div(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2.default)([" \n margin: 5px;\n font-family: \"Poppins\", sans-serif;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n user-select: none;\n &:hover {\n cursor: pointer;\n }\n"])));
21
21
  const TooltipText = exports.TooltipText = _styledComponents.default.div(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2.default)([" \n margin: 0; \n"])));
@@ -37,6 +37,8 @@ const MonthPicker = _ref => {
37
37
  const [isOpen, setIsOpen] = (0, _react.useState)(false);
38
38
  const [value, setValue] = (0, _react.useState)('');
39
39
  const [startDateValue, setStartDateValue] = (0, _react.useState)(null);
40
+ const [hoverInputContainer, setHoverInputContainer] = (0, _react.useState)(false);
41
+ const [hoverOptionsContainer, setHoverOptionsContainer] = (0, _react.useState)(false);
40
42
  const inputRef = (0, _react.useRef)(null);
41
43
  (0, _react.useEffect)(() => {
42
44
  const handleClickOutside = event => {
@@ -60,6 +62,12 @@ const MonthPicker = _ref => {
60
62
  setValue(selectedValue);
61
63
  }
62
64
  }, [selectedValue]);
65
+ (0, _react.useEffect)(() => {
66
+ if (!hoverInputContainer && !hoverOptionsContainer) {
67
+ setIsFocused(false);
68
+ setIsOpen(false);
69
+ }
70
+ }, [hoverInputContainer, hoverOptionsContainer]);
63
71
  const onChangeDate = startDate => {
64
72
  if (startDate) {
65
73
  setIsOpen(!isOpen);
@@ -91,6 +99,16 @@ const MonthPicker = _ref => {
91
99
  onClick: handleFocus,
92
100
  width: width,
93
101
  height: height
102
+ }, /*#__PURE__*/_react.default.createElement(_MonthPicker.InputContainer, {
103
+ className: "InputContainer",
104
+ isFocused: isFocused,
105
+ hasValue: value,
106
+ disabled: disabled,
107
+ textColor: textColor,
108
+ borderColor: borderColor,
109
+ borderColorFocus: borderColorFocus,
110
+ onMouseEnter: () => setHoverInputContainer(true),
111
+ onMouseLeave: () => setHoverInputContainer(false)
94
112
  }, /*#__PURE__*/_react.default.createElement(_MonthPicker.StyledLabel, {
95
113
  className: "StyledLabel",
96
114
  onClick: handleFocus,
@@ -120,7 +138,11 @@ const MonthPicker = _ref => {
120
138
  className: "CalendarDiv",
121
139
  width: width,
122
140
  onClick: toggleDatePicker
123
- }, isOpen === true ? /*#__PURE__*/_react.default.createElement(_CalendarInOpen.default, null) : /*#__PURE__*/_react.default.createElement(_Calendar.default, null)), /*#__PURE__*/_react.default.createElement(_MonthPopupPicker.default, {
141
+ }, isOpen === true ? /*#__PURE__*/_react.default.createElement(_CalendarInOpen.default, null) : /*#__PURE__*/_react.default.createElement(_Calendar.default, null))), /*#__PURE__*/_react.default.createElement(_MonthPicker.OptionsContainer, {
142
+ className: "OptionsContainer",
143
+ onMouseEnter: () => setHoverOptionsContainer(true),
144
+ onMouseLeave: () => setHoverOptionsContainer(false)
145
+ }, /*#__PURE__*/_react.default.createElement(_MonthPopupPicker.default, {
124
146
  className: "MonthPopupPicker",
125
147
  isOpen: isOpen,
126
148
  onChangeDate: onChangeDate,
@@ -128,7 +150,7 @@ const MonthPicker = _ref => {
128
150
  setValue: setValue,
129
151
  startDateValue: startDateValue,
130
152
  availableMonths: availableMonths
131
- }));
153
+ })));
132
154
  };
133
155
  MonthPicker.defaultProps = {
134
156
  required: true,
@@ -4,15 +4,16 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.StyledLabel = exports.StyledInput = exports.RequiredIndicator = exports.MonthPickerContainer = exports.EyeIcon = exports.ErrorLabel = exports.CalendarDiv = void 0;
7
+ exports.StyledLabel = exports.StyledInput = exports.RequiredIndicator = exports.OptionsContainer = exports.MonthPickerContainer = exports.InputContainer = exports.ErrorLabel = exports.CalendarDiv = void 0;
8
8
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
9
9
  var _styledComponents = _interopRequireDefault(require("styled-components"));
10
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
10
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
11
11
  /* eslint-disable no-nested-ternary */
12
- const MonthPickerContainer = exports.MonthPickerContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n margin-bottom: 20px;\n width: ", ";\n height: ", ";\n"])), props => props.width || '100%', props => props.height || '60px');
12
+ const MonthPickerContainer = exports.MonthPickerContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n margin-bottom: 10px;\n width: ", ";\n height: ", ";\n"])), props => props.width || '100%', props => props.height || '60px');
13
13
  const CalendarDiv = exports.CalendarDiv = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n width: 11px;\n height: 11px;\n top: ", ";\n right: 25px;\n"])), props => parseInt(props.height, 10) / 2 || '20px');
14
- const StyledInput = exports.StyledInput = _styledComponents.default.input(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n padding: 20px;\n font-size: 14px;\n border:\n ", ";\n border-radius: ", ";\n outline: none;\n width: ", ";\n height: ", ";\n transition: border-color 0.3s ease;\n color: var(--General-Grey, #B1B1B1);\n font-family: Poppins;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n box-sizing: border-box;\n color: ", ";\n cursor: ", ";\n\n &:focus {\n border-color: ", ";\n }\n"])), props => props.disabled ? '1px solid \'#bdbdbd\'' : props.error ? '1px solid \'#red\'' : props.isFocused ? "2px solid ".concat(props.borderColorFocus) : "1px solid ".concat(props.borderColor) || '1px solid \'#bdbdbd\'', props => props.borderRadius || '4px', props => props.width || '90%', props => props.height || '60px', props => props.disabled ? '#888' : (props.isFocused || props.value ? props.textColor : '#757575') || '#333', props => props.disabled ? 'not-allowed' : 'text', props => props.disabled ? '#bdbdbd' : props.borderColor || '#1976d2');
15
- const StyledLabel = exports.StyledLabel = _styledComponents.default.label(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n font-size: ", ";\n padding-inline-end: 5px;\n padding-inline-start: 5px;\n margin-right: 20px;\n width: ", ";\n color: ", ";\n background-color: white;\n position: absolute;\n top: ", ";\n left: 15px;\n transform: translateY(-50%);\n transition: top 0.3s ease, font-size 0.3s ease;\n display: flex;\n font-family: Poppins;\n font-weight: 400;\n align-items: center;\n box-sizing: border-box;\n"])), props => props.isFocused || props.hasValue ? '14px' : '14px', props => props.isFocused || props.hasValue ? 'auto' : '150px', props => props.disabled ? '#888' : (props.isFocused || props.hasValue ? props.borderColorFocus : '#757575') || '#333', props => props.isFocused || props.hasValue ? '0px' : '50%');
16
- const RequiredIndicator = exports.RequiredIndicator = _styledComponents.default.span(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n color: red;\n margin-left: 5px;\n"])));
17
- const EyeIcon = exports.EyeIcon = _styledComponents.default.div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n top: 50%;\n right: 10px;\n transform: translateY(-50%);\n cursor: pointer;\n color: ", ";\n\n &:hover {\n color: ", ";\n }\n"])), props => props.textColor || '#888', props => props.textColor || '#333');
18
- const ErrorLabel = exports.ErrorLabel = _styledComponents.default.div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n font-size: 12px;\n color: red;\n margin-top: 5px;\n"])));
14
+ const InputContainer = exports.InputContainer = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n display: flex; \n flex-direction: row;\n flex-wrap: nowrap; \n justify-content: flex-start;\n align-content: center; \n white-space: pre-wrap;\n align-items: center;\n overflow: hidden; \n width: 100%;\n height: 100%; \n box-sizing: border-box;\n background-color: transparent; \n border: 1px solid ", ";\n font-family: \"Poppins\", sans-serif;\n font-weight: 400;\n font-size: 14px;\n border-radius: 12px;\n outline: none;\n color: ", ";\n \n &:hover {\n border: 1px solid ", ";\n cursor: ", ";\n }\n\n &:focus { \n border: 1px solid ", "; \n }\n"])), props => props.disabled ? '#bdbdbd' : props.error ? 'red' : '#B1B1B1', props => props.disabled ? '#888' : '#212121', props => props.disabled ? '#bdbdbd' : props.error ? 'red' : props.borderColorFocus || '#212121', props => props.disabled ? 'not-allowed' : 'pointer', props => props.disabled ? '#bdbdbd' : props.error ? 'red' : props.borderColorFocus || '#212121');
15
+ const StyledInput = exports.StyledInput = _styledComponents.default.input(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n padding: 20px;\n font-size: 14px;\n border-radius: ", ";\n border: none;\n outline: none;\n width: ", ";\n height: ", ";\n transition: border-color 0.3s ease;\n color: var(--General-Grey, #B1B1B1);\n font-family: Poppins;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n box-sizing: border-box;\n color: ", ";\n cursor: ", ";\n"])), props => props.borderRadius || '4px', props => props.width || '90%', props => props.height || '60px', props => props.disabled ? '#888' : (props.isFocused || props.value ? props.textColor : '#757575') || '#333', props => props.disabled ? 'not-allowed' : 'text');
16
+ const StyledLabel = exports.StyledLabel = _styledComponents.default.label(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n font-size: ", ";\n padding-inline-end: 5px;\n padding-inline-start: 5px;\n margin-right: 20px;\n width: ", ";\n color: ", ";\n background-color: white;\n position: absolute;\n top: ", ";\n left: 15px;\n transform: translateY(-50%);\n transition: top 0.3s ease, font-size 0.3s ease;\n display: flex;\n font-family: Poppins;\n font-weight: 400;\n align-items: center;\n box-sizing: border-box;\n cursor: pointer;\n"])), props => props.isFocused || props.hasValue ? '14px' : '14px', props => props.isFocused || props.hasValue ? 'auto' : '150px', props => props.disabled ? '#888' : (props.isFocused || props.hasValue ? props.borderColorFocus : '#757575') || '#333', props => props.isFocused || props.hasValue ? '0px' : '50%');
17
+ const RequiredIndicator = exports.RequiredIndicator = _styledComponents.default.span(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n color: red;\n margin-left: 5px;\n"])));
18
+ const ErrorLabel = exports.ErrorLabel = _styledComponents.default.div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n font-size: 12px;\n color: red;\n margin-top: 5px;\n"])));
19
+ const OptionsContainer = exports.OptionsContainer = _styledComponents.default.div(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n display: block;\n margin: 0;\n padding-top: 8px;\n"])));
@@ -15,7 +15,7 @@ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _temp
15
15
  /* eslint-disable react/prop-types */
16
16
  // Styled components for the date picker
17
17
  const DatePickerContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n"])));
18
- const DatePickerPopup = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n width: auto;\n margin: 5px;\n height: 250px;\n top: calc(100% + 5px);\n box-shadow: 0px 4px 20px 0px rgba(0, 0, 0, 0.15);\n left: 0;\n background-color: #fff;\n border: 1px solid #ccc;\n border-radius: 4px;\n padding: 10px;\n z-index: 1000;\n"])));
18
+ const DatePickerPopup = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n width: auto;\n // margin: 5px;\n height: 250px;\n top: 100%;\n box-shadow: 0px 4px 20px 0px rgba(0, 0, 0, 0.15);\n left: 0;\n background-color: #fff;\n border: 1px solid #ccc;\n border-radius: 4px;\n padding: 10px;\n z-index: 1000;\n"])));
19
19
  const DatePickerHeader = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n justify-content: space-between;\n margin-bottom: 10px;\n"])));
20
20
  const NavDiv = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n width: 80px;\n height: 30px;\n display: flex;\n padding: 5px;\n justify-content: space-around;\n"])));
21
21
  const DatePickerSelect = _styledComponents.default.select(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n padding: 4px;\n border: none;\n font-family: Poppins;\n font-size: 12px; \n font-style: normal;\n font-weight: 400;\n cursor: pointer;\n\n &:focus {\n border: none;\n }\n"])));
@@ -38,6 +38,8 @@ const QuarterPicker = _ref => {
38
38
  const [isOpen, setIsOpen] = (0, _react.useState)(false);
39
39
  const [value, setValue] = (0, _react.useState)('');
40
40
  const [startDateValue, setStartDateValue] = (0, _react.useState)(null);
41
+ const [hoverInputContainer, setHoverInputContainer] = (0, _react.useState)(false);
42
+ const [hoverOptionsContainer, setHoverOptionsContainer] = (0, _react.useState)(false);
41
43
  const inputRef = (0, _react.useRef)(null);
42
44
  (0, _react.useEffect)(() => {
43
45
  const handleClickOutside = event => {
@@ -62,6 +64,12 @@ const QuarterPicker = _ref => {
62
64
  setValue(selectedValue);
63
65
  }
64
66
  }, [selectedValue]);
67
+ (0, _react.useEffect)(() => {
68
+ if (!hoverInputContainer && !hoverOptionsContainer) {
69
+ setIsFocused(false);
70
+ setIsOpen(false);
71
+ }
72
+ }, [hoverInputContainer, hoverOptionsContainer]);
65
73
  const onChangeDate = startDate => {
66
74
  if (startDate) {
67
75
  setIsOpen(!isOpen);
@@ -93,6 +101,16 @@ const QuarterPicker = _ref => {
93
101
  onClick: handleFocus,
94
102
  width: width,
95
103
  height: height
104
+ }, /*#__PURE__*/_react.default.createElement(_QuarterPicker.InputContainer, {
105
+ className: "InputContainer",
106
+ isFocused: isFocused,
107
+ hasValue: value,
108
+ disabled: disabled,
109
+ textColor: textColor,
110
+ borderColor: borderColor,
111
+ borderColorFocus: borderColorFocus,
112
+ onMouseEnter: () => setHoverInputContainer(true),
113
+ onMouseLeave: () => setHoverInputContainer(false)
96
114
  }, /*#__PURE__*/_react.default.createElement(_QuarterPicker.StyledLabel, {
97
115
  className: "StyledLabel",
98
116
  onClick: handleFocus,
@@ -122,7 +140,11 @@ const QuarterPicker = _ref => {
122
140
  className: "CalendarDiv",
123
141
  width: width,
124
142
  onClick: toggleDatePicker
125
- }, isOpen === true ? /*#__PURE__*/_react.default.createElement(_CalendarInOpen.default, null) : /*#__PURE__*/_react.default.createElement(_Calendar.default, null)), /*#__PURE__*/_react.default.createElement(_QuarterPopupPicker.default, {
143
+ }, isOpen === true ? /*#__PURE__*/_react.default.createElement(_CalendarInOpen.default, null) : /*#__PURE__*/_react.default.createElement(_Calendar.default, null))), /*#__PURE__*/_react.default.createElement(_QuarterPicker.OptionsContainer, {
144
+ className: "OptionsContainer",
145
+ onMouseEnter: () => setHoverOptionsContainer(true),
146
+ onMouseLeave: () => setHoverOptionsContainer(false)
147
+ }, /*#__PURE__*/_react.default.createElement(_QuarterPopupPicker.default, {
126
148
  className: "QuarterPopupPicker",
127
149
  isOpen: isOpen,
128
150
  onChangeDate: onChangeDate,
@@ -130,7 +152,7 @@ const QuarterPicker = _ref => {
130
152
  setValue: setValue,
131
153
  startDateValue: startDateValue,
132
154
  availableQuarters: availableQuarters
133
- }));
155
+ })));
134
156
  };
135
157
  QuarterPicker.defaultProps = {
136
158
  required: true,
@@ -4,15 +4,16 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.StyledLabel = exports.StyledInput = exports.RequiredIndicator = exports.QuarterPickerContainer = exports.EyeIcon = exports.ErrorLabel = exports.CalendarDiv = void 0;
7
+ exports.StyledLabel = exports.StyledInput = exports.RequiredIndicator = exports.QuarterPickerContainer = exports.OptionsContainer = exports.InputContainer = exports.ErrorLabel = exports.CalendarDiv = void 0;
8
8
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
9
9
  var _styledComponents = _interopRequireDefault(require("styled-components"));
10
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
10
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
11
11
  /* eslint-disable no-nested-ternary */
12
- const QuarterPickerContainer = exports.QuarterPickerContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n margin-bottom: 20px;\n width: ", ";\n height: ", ";\n"])), props => props.width || '100%', props => props.height || '60px');
12
+ const QuarterPickerContainer = exports.QuarterPickerContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n margin-bottom: 10px;\n width: ", ";\n height: ", ";\n"])), props => props.width || '100%', props => props.height || '60px');
13
13
  const CalendarDiv = exports.CalendarDiv = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n width: 11px;\n height: 11px;\n top: ", ";\n right: 25px;\n"])), props => parseInt(props.height, 10) / 2 || '20px');
14
- const StyledInput = exports.StyledInput = _styledComponents.default.input(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n padding: 20px;\n font-size: 14px;\n border:\n ", ";\n border-radius: ", ";\n outline: none;\n width: ", ";\n height: ", ";\n transition: border-color 0.3s ease; \n font-family: Poppins;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n box-sizing: border-box;\n color: ", ";\n cursor: ", ";\n\n &:focus {\n border-color: ", ";\n }\n"])), props => props.disabled ? '1px solid \'#bdbdbd\'' : props.error ? '1px solid \'#red\'' : props.isFocused ? "2px solid ".concat(props.borderColorFocus) : "1px solid ".concat(props.borderColor) || '1px solid \'#bdbdbd\'', props => props.borderRadius || '4px', props => props.width || '90%', props => props.height || '60px', props => props.disabled ? '#888' : (props.isFocused || props.value ? props.textColor : '#757575') || '#333', props => props.disabled ? 'not-allowed' : 'text', props => props.disabled ? '#bdbdbd' : props.borderColor || '#1976d2');
15
- const StyledLabel = exports.StyledLabel = _styledComponents.default.label(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n font-size: ", ";\n padding-inline-end: 5px;\n padding-inline-start: 5px;\n margin-right: 20px;\n width: ", ";\n color: ", ";\n background-color: white;\n position: absolute;\n top: ", ";\n left: 15px;\n transform: translateY(-50%);\n transition: top 0.3s ease, font-size 0.3s ease;\n display: flex;\n font-family: Poppins;\n font-weight: 400;\n align-items: center;\n box-sizing: border-box;\n"])), props => props.isFocused || props.hasValue ? '14px' : '14px', props => props.isFocused || props.hasValue ? 'auto' : '150px', props => props.disabled ? '#888' : (props.isFocused || props.hasValue ? props.borderColorFocus : '#757575') || '#333', props => props.isFocused || props.hasValue ? '0px' : '50%');
16
- const RequiredIndicator = exports.RequiredIndicator = _styledComponents.default.span(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n color: red;\n margin-left: 5px;\n"])));
17
- const EyeIcon = exports.EyeIcon = _styledComponents.default.div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n top: 50%;\n right: 10px;\n transform: translateY(-50%);\n cursor: pointer;\n color: ", ";\n\n &:hover {\n color: ", ";\n }\n"])), props => props.textColor || '#888', props => props.textColor || '#333');
18
- const ErrorLabel = exports.ErrorLabel = _styledComponents.default.div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n font-size: 12px;\n color: red;\n margin-top: 5px;\n"])));
14
+ const InputContainer = exports.InputContainer = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n display: flex; \n flex-direction: row;\n flex-wrap: nowrap; \n justify-content: flex-start;\n align-content: center; \n white-space: pre-wrap;\n align-items: center;\n overflow: hidden; \n width: 100%;\n height: 100%; \n box-sizing: border-box;\n background-color: transparent; \n border: 1px solid ", ";\n font-family: \"Poppins\", sans-serif;\n font-weight: 400;\n font-size: 14px;\n border-radius: 12px;\n outline: none;\n color: ", ";\n \n &:hover {\n border: 1px solid ", ";\n cursor: ", ";\n }\n\n &:focus { \n border: 1px solid ", "; \n }\n"])), props => props.disabled ? '#bdbdbd' : props.error ? 'red' : '#B1B1B1', props => props.disabled ? '#888' : '#212121', props => props.disabled ? '#bdbdbd' : props.error ? 'red' : props.borderColorFocus || '#212121', props => props.disabled ? 'not-allowed' : 'pointer', props => props.disabled ? '#bdbdbd' : props.error ? 'red' : props.borderColorFocus || '#212121');
15
+ const StyledInput = exports.StyledInput = _styledComponents.default.input(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n padding: 20px;\n font-size: 14px;\n border-radius: ", ";\n border: none;\n outline: none;\n width: ", ";\n height: ", ";\n transition: border-color 0.3s ease; \n font-family: Poppins;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n box-sizing: border-box;\n color: ", ";\n cursor: ", ";\n"])), props => props.borderRadius || '4px', props => props.width || '90%', props => props.height || '60px', props => props.disabled ? '#888' : (props.isFocused || props.value ? props.textColor : '#757575') || '#333', props => props.disabled ? 'not-allowed' : 'text');
16
+ const StyledLabel = exports.StyledLabel = _styledComponents.default.label(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n font-size: ", ";\n padding-inline-end: 5px;\n padding-inline-start: 5px;\n margin-right: 20px;\n width: ", ";\n color: ", ";\n background-color: white;\n position: absolute;\n top: ", ";\n left: 15px;\n transform: translateY(-50%);\n transition: top 0.3s ease, font-size 0.3s ease;\n display: flex;\n font-family: Poppins;\n font-weight: 400;\n align-items: center;\n box-sizing: border-box;\n cursor: pointer;\n"])), props => props.isFocused || props.hasValue ? '14px' : '14px', props => props.isFocused || props.hasValue ? 'auto' : '150px', props => props.disabled ? '#888' : (props.isFocused || props.hasValue ? props.borderColorFocus : '#757575') || '#333', props => props.isFocused || props.hasValue ? '0px' : '50%');
17
+ const RequiredIndicator = exports.RequiredIndicator = _styledComponents.default.span(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n color: red;\n margin-left: 5px;\n"])));
18
+ const ErrorLabel = exports.ErrorLabel = _styledComponents.default.div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n font-size: 12px;\n color: red;\n margin-top: 5px;\n"])));
19
+ const OptionsContainer = exports.OptionsContainer = _styledComponents.default.div(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n display: block;\n margin: 0;\n padding-top: 8px;\n"])));
@@ -18,7 +18,7 @@ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _temp
18
18
 
19
19
  // Styled components for the date picker
20
20
  const DatePickerContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n"])));
21
- const DatePickerPopup = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n width: auto;\n margin: 5px;\n height: 120px;\n top: calc(100% + 5px);\n box-shadow: 0px 4px 20px 0px rgba(0, 0, 0, 0.15);\n left: 0;\n background-color: #fff;\n border: 1px solid #ccc;\n border-radius: 4px;\n padding: 10px;\n z-index: 1000;\n"])));
21
+ const DatePickerPopup = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n width: auto;\n // margin: 5px;\n height: 120px;\n top: 100%;\n box-shadow: 0px 4px 20px 0px rgba(0, 0, 0, 0.15);\n left: 0;\n background-color: #fff;\n border: 1px solid #ccc;\n border-radius: 4px;\n padding: 10px;\n z-index: 1000;\n"])));
22
22
  const DatePickerHeader = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n justify-content: space-between;\n margin-bottom: 10px;\n"])));
23
23
 
24
24
  // const NavDiv = styled.div`
@@ -15,7 +15,7 @@ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _temp
15
15
  /* eslint-disable react/prop-types */
16
16
  // Styled components for the date picker
17
17
  const DatePickerContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n"])));
18
- const DatePickerPopup = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n width: 320px;\n height: 410px;\n top: calc(100% + 5px);\n box-shadow: 0px 4px 20px 0px rgba(0, 0, 0, 0.15);\n left: 0;\n background-color: #fff;\n border: 1px solid #ccc;\n border-radius: 4px;\n padding: 10px;\n z-index: 1000;\n"])));
18
+ const DatePickerPopup = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n width: 320px;\n height: 410px;\n top: 100%;\n box-shadow: 0px 4px 20px 0px rgba(0, 0, 0, 0.15);\n left: 0;\n background-color: #fff;\n border: 1px solid #ccc;\n border-radius: 4px;\n padding: 10px;\n z-index: 1000;\n"])));
19
19
  const DatePickerHeader = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n justify-content: space-between;\n margin-bottom: 10px;\n"])));
20
20
  const DatePickerFooter = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n justify-content: end;\n margin-inline-end: 10px;\n margin-top: 10px;\n"])));
21
21
  const ClearButton = _styledComponents.default.button(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n color: #568202;\n text-align: center;\n font-family: Poppins;\n font-size: 12px;\n background-color: transparent;\n font-style: normal;\n border: none;\n font-weight: 400;\n line-height: normal;\n text-transform: uppercase;\n"])));
@@ -88,11 +88,21 @@ const DatePicker = _ref => {
88
88
  dates.push(new Date(tempDate));
89
89
  tempDate.setDate(tempDate.getDate() + 1);
90
90
  }
91
- return /*#__PURE__*/_react.default.createElement(DatePickerPopup, null, /*#__PURE__*/_react.default.createElement(DatePickerHeader, null, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(DatePickerSelect, null, "".concat(months[currentDate.getMonth()], " ").concat(currentDate === null || currentDate === void 0 ? void 0 : currentDate.getFullYear()))), /*#__PURE__*/_react.default.createElement(NavDiv, null, /*#__PURE__*/_react.default.createElement("div", {
91
+ return /*#__PURE__*/_react.default.createElement(DatePickerPopup, {
92
+ className: "DatePickerPopup"
93
+ }, /*#__PURE__*/_react.default.createElement(DatePickerHeader, {
94
+ className: "DatePickerHeader"
95
+ }, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(DatePickerSelect, {
96
+ className: "DatePickerSelect"
97
+ }, "".concat(months[currentDate.getMonth()], " ").concat(currentDate === null || currentDate === void 0 ? void 0 : currentDate.getFullYear()))), /*#__PURE__*/_react.default.createElement(NavDiv, {
98
+ className: "NavDiv"
99
+ }, /*#__PURE__*/_react.default.createElement("div", {
92
100
  onClick: handlePrevMonth
93
101
  }, /*#__PURE__*/_react.default.createElement(_ChervronLeftIcon.default, null)), /*#__PURE__*/_react.default.createElement("div", {
94
102
  onClick: handleNextMonth
95
- }, /*#__PURE__*/_react.default.createElement(_ChervronRightIcon.default, null)))), /*#__PURE__*/_react.default.createElement(DatePickerCalendar, null, daysOfWeek.map(day => /*#__PURE__*/_react.default.createElement(DateCell, {
103
+ }, /*#__PURE__*/_react.default.createElement(_ChervronRightIcon.default, null)))), /*#__PURE__*/_react.default.createElement(DatePickerCalendar, {
104
+ className: "DatePickerCalendar"
105
+ }, daysOfWeek.map(day => /*#__PURE__*/_react.default.createElement(DateCell, {
96
106
  key: day
97
107
  }, day)), dates.map(date => {
98
108
  if (startDate && endDate && (date.getTime() === startDate.getTime() || date.getTime() === endDate.getTime())) {
@@ -130,6 +140,8 @@ const DatePicker = _ref => {
130
140
  onClick: clearSelection
131
141
  }, "Clear")));
132
142
  };
133
- return /*#__PURE__*/_react.default.createElement(DatePickerContainer, null, isOpen && renderDatePicker());
143
+ return /*#__PURE__*/_react.default.createElement(DatePickerContainer, {
144
+ className: "DatePickerContainer"
145
+ }, isOpen && renderDatePicker());
134
146
  };
135
147
  var _default = exports.default = DatePicker;
@@ -38,6 +38,8 @@ const RangePicker = _ref => {
38
38
  const [startDateValue, setStartDateValue] = (0, _react.useState)(null); // Added value state
39
39
  const [endDateValue, setEndDateValue] = (0, _react.useState)(null); // Added value state
40
40
 
41
+ const [hoverInputContainer, setHoverInputContainer] = (0, _react.useState)(false);
42
+ const [hoverOptionsContainer, setHoverOptionsContainer] = (0, _react.useState)(false);
41
43
  const inputRef = (0, _react.useRef)(null);
42
44
  (0, _react.useEffect)(() => {
43
45
  const handleClickOutside = event => {
@@ -64,6 +66,12 @@ const RangePicker = _ref => {
64
66
  setValue(selectedValue);
65
67
  }
66
68
  }, [selectedValue]);
69
+ (0, _react.useEffect)(() => {
70
+ if (!hoverInputContainer && !hoverOptionsContainer) {
71
+ setIsFocused(false);
72
+ setIsOpen(false);
73
+ }
74
+ }, [hoverInputContainer, hoverOptionsContainer]);
67
75
  const onChangeDate = (startDate, endDate) => {
68
76
  if (startDate && endDate) {
69
77
  setIsOpen(!isOpen);
@@ -98,6 +106,16 @@ const RangePicker = _ref => {
98
106
  onClick: handleFocus,
99
107
  width: width,
100
108
  height: height
109
+ }, /*#__PURE__*/_react.default.createElement(_RangePicker.InputContainer, {
110
+ className: "InputContainer",
111
+ isFocused: isFocused,
112
+ hasValue: value,
113
+ disabled: disabled,
114
+ textColor: textColor,
115
+ borderColor: borderColor,
116
+ borderColorFocus: borderColorFocus,
117
+ onMouseEnter: () => setHoverInputContainer(true),
118
+ onMouseLeave: () => setHoverInputContainer(false)
101
119
  }, /*#__PURE__*/_react.default.createElement(_RangePicker.StyledLabel, {
102
120
  className: "StyledLabel",
103
121
  onClick: handleFocus,
@@ -126,7 +144,15 @@ const RangePicker = _ref => {
126
144
  }), /*#__PURE__*/_react.default.createElement(_RangePicker.CalendarDiv, {
127
145
  className: "CalendarDiv",
128
146
  onClick: toggleDatePicker
129
- }, isOpen === true ? /*#__PURE__*/_react.default.createElement(_CalendarInOpen.default, null) : /*#__PURE__*/_react.default.createElement(_Calendar.default, null)), /*#__PURE__*/_react.default.createElement(_RangeDatePicker.default, {
147
+ }, isOpen === true ? /*#__PURE__*/_react.default.createElement(_CalendarInOpen.default, {
148
+ className: "CalendarInOpen"
149
+ }) : /*#__PURE__*/_react.default.createElement(_Calendar.default, {
150
+ className: "Calendar"
151
+ }))), /*#__PURE__*/_react.default.createElement(_RangePicker.OptionsContainer, {
152
+ className: "OptionsContainer",
153
+ onMouseEnter: () => setHoverOptionsContainer(true),
154
+ onMouseLeave: () => setHoverOptionsContainer(false)
155
+ }, /*#__PURE__*/_react.default.createElement(_RangeDatePicker.default, {
130
156
  className: "DatePicker",
131
157
  isOpen: isOpen,
132
158
  onChangeDate: onChangeDate,
@@ -134,7 +160,7 @@ const RangePicker = _ref => {
134
160
  setValue: setValue,
135
161
  startDateValue: startDateValue,
136
162
  endDateValue: endDateValue
137
- }));
163
+ })));
138
164
  };
139
165
  // Adding defaultProps
140
166
  RangePicker.defaultProps = {
@@ -4,15 +4,16 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.StyledLabel = exports.StyledInput = exports.RequiredIndicator = exports.RangePickerContainer = exports.EyeIcon = exports.ErrorLabel = exports.CalendarDiv = void 0;
7
+ exports.StyledLabel = exports.StyledInput = exports.RequiredIndicator = exports.RangePickerContainer = exports.OptionsContainer = exports.InputContainer = exports.ErrorLabel = exports.CalendarDiv = void 0;
8
8
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
9
9
  var _styledComponents = _interopRequireDefault(require("styled-components"));
10
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
10
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
11
11
  /* eslint-disable no-nested-ternary */
12
- const RangePickerContainer = exports.RangePickerContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n margin-bottom: 20px;\n width: ", ";\n height: ", ";\n"])), props => props.width || '100%', props => props.height || '60px');
13
- const CalendarDiv = exports.CalendarDiv = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n width: 11px;\n height: 11px;\n top: ", ";\n right: 15px;\n"])), props => parseInt(props.height, 10) / 2 || '20px');
14
- const StyledInput = exports.StyledInput = _styledComponents.default.input(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n padding: 20px;\n font-size: 14px;\n border:\n ", ";\n border-radius: ", ";\n outline: none;\n width: ", ";\n height: ", ";\n transition: border-color 0.3s ease; \n font-family: Poppins;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n box-sizing: border-box;\n color: ", ";\n cursor: ", ";\n\n &:focus {\n border-color: ", ";\n }\n"])), props => props.disabled ? '1px solid \'#bdbdbd\'' : props.error ? '1px solid \'#red\'' : props.isFocused ? "2px solid ".concat(props.borderColorFocus) : "1px solid ".concat(props.borderColor) || '1px solid \'#bdbdbd\'', props => props.borderRadius || '4px', props => props.width || '90%', props => props.height || '60px', props => props.disabled ? '#888' : (props.isFocused || props.value ? props.textColor : '#757575') || '#333', props => props.disabled ? 'not-allowed' : 'text', props => props.disabled ? '#bdbdbd' : props.borderColor || '#1976d2');
15
- const StyledLabel = exports.StyledLabel = _styledComponents.default.label(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n font-size: ", ";\n padding-inline-end: 5px;\n padding-inline-start: 5px;\n margin-right: 20px;\n width: ", ";\n color: ", ";\n background-color: white;\n position: absolute;\n top: ", ";\n left: 15px;\n transform: translateY(-50%);\n transition: top 0.3s ease, font-size 0.3s ease;\n display: flex;\n font-family: Poppins;\n font-weight: 400;\n align-items: center;\n box-sizing: border-box;\n"])), props => props.isFocused || props.hasValue ? '14px' : '14px', props => props.isFocused || props.hasValue ? 'auto' : '150px', props => props.disabled ? '#888' : (props.isFocused || props.hasValue ? props.borderColorFocus : '#757575') || '#333', props => props.isFocused || props.hasValue ? '0px' : '50%');
16
- const RequiredIndicator = exports.RequiredIndicator = _styledComponents.default.span(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n color: red;\n margin-left: 5px;\n"])));
17
- const EyeIcon = exports.EyeIcon = _styledComponents.default.div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n top: 50%;\n right: 10px;\n transform: translateY(-50%);\n cursor: pointer;\n color: ", ";\n\n &:hover {\n color: ", ";\n }\n"])), props => props.textColor || '#888', props => props.textColor || '#333');
18
- const ErrorLabel = exports.ErrorLabel = _styledComponents.default.div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n font-size: 12px;\n color: red;\n margin-top: 5px;\n"])));
12
+ const RangePickerContainer = exports.RangePickerContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n margin-bottom: 10px;\n width: ", ";\n height: ", ";\n"])), props => props.width || '100%', props => props.height || '60px');
13
+ const CalendarDiv = exports.CalendarDiv = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n width: 11px;\n height: 11px;\n top: ", ";\n right: 15px;\n \n &:hover {\n cursor: ", ";\n }\n\n"])), props => parseInt(props.height, 10) / 2 || '20px', props => props.disabled ? 'not-allowed' : 'pointer');
14
+ const InputContainer = exports.InputContainer = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n display: flex; \n flex-direction: row;\n flex-wrap: nowrap; \n justify-content: flex-start;\n align-content: center; \n white-space: pre-wrap;\n align-items: center;\n overflow: hidden; \n width: 100%;\n height: 100%; \n box-sizing: border-box;\n background-color: transparent; \n border: 1px solid ", ";\n font-family: \"Poppins\", sans-serif;\n font-weight: 400;\n font-size: 14px;\n border-radius: 12px;\n outline: none;\n color: ", ";\n \n &:hover {\n border: 1px solid ", ";\n cursor: ", ";\n }\n\n &:focus { \n border: 1px solid ", "; \n }\n"])), props => props.disabled ? '#bdbdbd' : props.error ? 'red' : '#B1B1B1', props => props.disabled ? '#888' : '#212121', props => props.disabled ? '#bdbdbd' : props.error ? 'red' : props.borderColorFocus || '#212121', props => props.disabled ? 'not-allowed' : 'pointer', props => props.disabled ? '#bdbdbd' : props.error ? 'red' : props.borderColorFocus || '#212121');
15
+ const StyledInput = exports.StyledInput = _styledComponents.default.input(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n padding: 20px;\n font-size: 14px;\n border-radius: ", ";\n border: none;\n outline: none;\n width: ", ";\n height: ", ";\n transition: border-color 0.3s ease; \n font-family: Poppins;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n box-sizing: border-box;\n color: ", ";\n cursor: ", ";\n"])), props => props.borderRadius || '4px', props => props.width || '90%', props => props.height || '60px', props => props.disabled ? '#888' : (props.isFocused || props.value ? props.textColor : '#757575') || '#333', props => props.disabled ? 'not-allowed' : 'text');
16
+ const StyledLabel = exports.StyledLabel = _styledComponents.default.label(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n font-size: ", ";\n padding-inline-end: 5px;\n padding-inline-start: 5px;\n margin-right: 20px;\n width: ", ";\n color: ", ";\n background-color: white;\n position: absolute;\n top: ", ";\n left: 15px;\n transform: translateY(-50%);\n transition: top 0.3s ease, font-size 0.3s ease;\n display: flex;\n font-family: Poppins;\n font-weight: 400;\n align-items: center;\n box-sizing: border-box;\n cursor: pointer;\n"])), props => props.isFocused || props.hasValue ? '14px' : '14px', props => props.isFocused || props.hasValue ? 'auto' : '150px', props => props.disabled ? '#888' : (props.isFocused || props.hasValue ? props.borderColorFocus : '#757575') || '#333', props => props.isFocused || props.hasValue ? '0px' : '50%');
17
+ const RequiredIndicator = exports.RequiredIndicator = _styledComponents.default.span(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n color: red;\n margin-left: 5px;\n"])));
18
+ const ErrorLabel = exports.ErrorLabel = _styledComponents.default.div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n font-size: 12px;\n color: red;\n margin-top: 5px;\n"])));
19
+ const OptionsContainer = exports.OptionsContainer = _styledComponents.default.div(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n display: block;\n margin: 0;\n padding-top: 8px;\n"])));
@@ -25,7 +25,6 @@ const TotalHorizontalCharts = props => {
25
25
  currencyType,
26
26
  width,
27
27
  height,
28
- rightGap,
29
28
  textColor,
30
29
  chartsData,
31
30
  noDataText,
@@ -153,7 +152,7 @@ const TotalHorizontalCharts = props => {
153
152
  }
154
153
  }, /*#__PURE__*/_react.default.createElement(_recharts.XAxis, {
155
154
  type: "number",
156
- domain: [0, dataMax => dataMax * rightGap],
155
+ domain: [0, dataMax => dataMax * 1.25],
157
156
  allowDataOverflow: true,
158
157
  hide: true
159
158
  }), /*#__PURE__*/_react.default.createElement(_recharts.YAxis, {
@@ -205,7 +204,6 @@ TotalHorizontalCharts.defaultProps = {
205
204
  showDollarSign: true,
206
205
  width: '100%',
207
206
  height: '100%',
208
- rightGap: 1.25,
209
207
  textColor: '#212121',
210
208
  noDataText: 'No Data'
211
209
  };
@@ -11,7 +11,7 @@ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _temp
11
11
  const scrollableStyles = "\n overflow-y: auto;\n\n &::-webkit-scrollbar {\n width: 5px;\n }\n\n &::-webkit-scrollbar-track {\n background: #E8E8E8;\n border-radius: 5px;\n }\n\n &::-webkit-scrollbar-thumb {\n background: #D0D0D0;\n border-radius: 5px;\n }\n";
12
12
  const ControlsContainer = exports.ControlsContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n font-family: \"Poppins\", sans-serif; \n color: ", ";\n width: ", ";\n height: ", ";\n background-color: white;\n display: flex;\n flex-direction: column;\n // justify-content: center;\n .top {\n text-align: center;\n white-space: normal;\n &:before {\n display: none;\n }\n }\n"])), props => props.textColor, props => props.width, props => props.height);
13
13
  const ChartWrapper = exports.ChartWrapper = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n flex-grow: 1;\n width: 100%;\n ", "\n"])), scrollableStyles);
14
- const ChartInner = exports.ChartInner = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n min-height: 120%;\n width: 100%;\n"])));
14
+ const ChartInner = exports.ChartInner = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n min-height: 120%;\n width: 90%;\n"])));
15
15
  const TitleAndValueContainer = exports.TitleAndValueContainer = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n padding: 16px;\n"])));
16
16
  const Header = exports.Header = _styledComponents.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)([""])));
17
17
  const Title = exports.Title = _styledComponents.default.h4(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n font-size: 20px;\n font-weight: 400;\n line-height: 1;\n margin: 0 0 8px;\n @media (max-width: 1536px) {\n font-size: 14px;\n }\n @media (max-width: 1366px) {\n font-size: 12px;\n }\n"])));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sag_components",
3
- "version": "1.0.835",
3
+ "version": "1.0.836",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {