sag_components 2.0.0-beta331 → 2.0.0-beta333
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +21 -1
- package/dist/index.esm.js +72 -23
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +72 -23
- package/dist/index.js.map +1 -1
- package/dist/types/components/RangePicker/RangeDatePicker.d.ts +5 -1
- package/dist/types/components/RangePicker/RangePicker.d.ts +21 -1
- package/dist/types/components/RangePicker/RangePicker.stories.d.ts +66 -0
- package/dist/types/icons/Calendar.d.ts +3 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -449,16 +449,21 @@ const CalendarInOpen = _ref => {
|
|
|
449
449
|
}));
|
|
450
450
|
};
|
|
451
451
|
|
|
452
|
-
const Calendar =
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
452
|
+
const Calendar = _ref => {
|
|
453
|
+
let {
|
|
454
|
+
fill = '#568202'
|
|
455
|
+
} = _ref;
|
|
456
|
+
return /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
457
|
+
width: "11",
|
|
458
|
+
height: "12",
|
|
459
|
+
viewBox: "0 0 11 12",
|
|
460
|
+
fill: "none",
|
|
461
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
462
|
+
}, /*#__PURE__*/React__default["default"].createElement("path", {
|
|
463
|
+
d: "M2.625 0C2.8125 0 3 0.1875 3 0.375V1.5H7.5V0.375C7.5 0.1875 7.66406 0 7.875 0C8.0625 0 8.25 0.1875 8.25 0.375V1.5H9C9.82031 1.5 10.5 2.17969 10.5 3V3.75V4.5V10.5C10.5 11.3438 9.82031 12 9 12H1.5C0.65625 12 0 11.3438 0 10.5V4.5V3.75V3C0 2.17969 0.65625 1.5 1.5 1.5H2.25V0.375C2.25 0.1875 2.41406 0 2.625 0ZM9.75 4.5H0.75V10.5C0.75 10.9219 1.07812 11.25 1.5 11.25H9C9.39844 11.25 9.75 10.9219 9.75 10.5V4.5ZM9 2.25H1.5C1.07812 2.25 0.75 2.60156 0.75 3V3.75H9.75V3C9.75 2.60156 9.39844 2.25 9 2.25Z",
|
|
464
|
+
fill: fill
|
|
465
|
+
}));
|
|
466
|
+
};
|
|
462
467
|
|
|
463
468
|
// eslint-disable-next-line react/prop-types
|
|
464
469
|
const ErrorIcon = _ref => {
|
|
@@ -10100,7 +10105,9 @@ const DatePickerFooter = styled__default["default"].div`
|
|
|
10100
10105
|
margin-top: 10px;
|
|
10101
10106
|
`;
|
|
10102
10107
|
const ClearButton$1 = styled__default["default"].button`
|
|
10103
|
-
color:
|
|
10108
|
+
color: ${({
|
|
10109
|
+
clearButtonColor
|
|
10110
|
+
}) => clearButtonColor || '#568202'};
|
|
10104
10111
|
text-align: center;
|
|
10105
10112
|
font-family: Poppins;
|
|
10106
10113
|
font-size: 12px;
|
|
@@ -10150,19 +10157,27 @@ const DateCell$2 = styled__default["default"].div`
|
|
|
10150
10157
|
transition: background-color 0.3s ease;
|
|
10151
10158
|
|
|
10152
10159
|
&:hover {
|
|
10153
|
-
background:
|
|
10160
|
+
background: ${({
|
|
10161
|
+
hoverColor
|
|
10162
|
+
}) => hoverColor || '#f4faf5'};
|
|
10154
10163
|
}
|
|
10155
10164
|
|
|
10156
10165
|
&.selected {
|
|
10157
|
-
background-color:
|
|
10166
|
+
background-color: ${({
|
|
10167
|
+
selectedColor
|
|
10168
|
+
}) => selectedColor || '#229e38'};
|
|
10158
10169
|
color: #fff;
|
|
10159
10170
|
}
|
|
10160
10171
|
&.startselected {
|
|
10161
|
-
border: 1px solid
|
|
10172
|
+
border: 1px solid ${({
|
|
10173
|
+
selectedColor
|
|
10174
|
+
}) => selectedColor || '#229e38'};
|
|
10162
10175
|
}
|
|
10163
10176
|
&.inrange {
|
|
10164
10177
|
border-radius: 0px;
|
|
10165
|
-
background-color:
|
|
10178
|
+
background-color: ${({
|
|
10179
|
+
inRangeColor
|
|
10180
|
+
}) => inRangeColor || '#effef2'};
|
|
10166
10181
|
}
|
|
10167
10182
|
`;
|
|
10168
10183
|
const daysOfWeek = ['S', 'M', 'T', 'W', 'T', 'F', 'S'];
|
|
@@ -10173,7 +10188,11 @@ const DatePicker = ({
|
|
|
10173
10188
|
value,
|
|
10174
10189
|
setValue,
|
|
10175
10190
|
startDateValue,
|
|
10176
|
-
endDateValue
|
|
10191
|
+
endDateValue,
|
|
10192
|
+
selectedColor,
|
|
10193
|
+
hoverColor,
|
|
10194
|
+
inRangeColor,
|
|
10195
|
+
clearButtonColor
|
|
10177
10196
|
}) => {
|
|
10178
10197
|
const [startDate, setStartDate] = React$1.useState(null);
|
|
10179
10198
|
const [endDate, setEndDate] = React$1.useState(null);
|
|
@@ -10244,12 +10263,15 @@ const DatePicker = ({
|
|
|
10244
10263
|
}, /*#__PURE__*/React__default["default"].createElement(ChervronRightIcon, null)))), /*#__PURE__*/React__default["default"].createElement(DatePickerCalendar$2, {
|
|
10245
10264
|
className: "DatePickerCalendar"
|
|
10246
10265
|
}, daysOfWeek.map(day => /*#__PURE__*/React__default["default"].createElement(DateCell$2, {
|
|
10247
|
-
key: day
|
|
10266
|
+
key: day,
|
|
10267
|
+
hoverColor: hoverColor
|
|
10248
10268
|
}, day)), dates.map(date => {
|
|
10249
10269
|
if (startDate && endDate && (date.getTime() === startDate.getTime() || date.getTime() === endDate.getTime())) {
|
|
10250
10270
|
return /*#__PURE__*/React__default["default"].createElement(DateCell$2, {
|
|
10251
10271
|
key: date.toISOString(),
|
|
10252
10272
|
className: "selected",
|
|
10273
|
+
selectedColor: selectedColor,
|
|
10274
|
+
hoverColor: hoverColor,
|
|
10253
10275
|
onClick: () => handleDateSelect(date)
|
|
10254
10276
|
}, date.getDate());
|
|
10255
10277
|
}
|
|
@@ -10257,6 +10279,8 @@ const DatePicker = ({
|
|
|
10257
10279
|
return /*#__PURE__*/React__default["default"].createElement(DateCell$2, {
|
|
10258
10280
|
key: date.toISOString(),
|
|
10259
10281
|
className: "inrange",
|
|
10282
|
+
inRangeColor: inRangeColor,
|
|
10283
|
+
hoverColor: hoverColor,
|
|
10260
10284
|
onClick: () => handleDateSelect(date)
|
|
10261
10285
|
}, date.getDate());
|
|
10262
10286
|
}
|
|
@@ -10264,12 +10288,15 @@ const DatePicker = ({
|
|
|
10264
10288
|
return /*#__PURE__*/React__default["default"].createElement(DateCell$2, {
|
|
10265
10289
|
key: date.toISOString(),
|
|
10266
10290
|
className: "startselected",
|
|
10291
|
+
selectedColor: selectedColor,
|
|
10292
|
+
hoverColor: hoverColor,
|
|
10267
10293
|
onClick: () => handleDateSelect(date)
|
|
10268
10294
|
}, date.getDate());
|
|
10269
10295
|
}
|
|
10270
10296
|
if (date.getMonth() === currentDate.getMonth()) {
|
|
10271
10297
|
return /*#__PURE__*/React__default["default"].createElement(DateCell$2, {
|
|
10272
10298
|
key: date.toISOString(),
|
|
10299
|
+
hoverColor: hoverColor,
|
|
10273
10300
|
onClick: () => handleDateSelect(date)
|
|
10274
10301
|
}, date.getDate());
|
|
10275
10302
|
}
|
|
@@ -10277,6 +10304,7 @@ const DatePicker = ({
|
|
|
10277
10304
|
key: date.toISOString()
|
|
10278
10305
|
});
|
|
10279
10306
|
})), /*#__PURE__*/React__default["default"].createElement(DatePickerFooter, null, /*#__PURE__*/React__default["default"].createElement(ClearButton$1, {
|
|
10307
|
+
clearButtonColor: clearButtonColor,
|
|
10280
10308
|
onClick: clearSelection
|
|
10281
10309
|
}, "Clear")));
|
|
10282
10310
|
};
|
|
@@ -10299,7 +10327,12 @@ const RangePicker = _ref => {
|
|
|
10299
10327
|
borderColor,
|
|
10300
10328
|
borderColorFocus,
|
|
10301
10329
|
textColor,
|
|
10302
|
-
selectedValue
|
|
10330
|
+
selectedValue,
|
|
10331
|
+
selectedColor,
|
|
10332
|
+
hoverColor,
|
|
10333
|
+
inRangeColor,
|
|
10334
|
+
clearButtonColor,
|
|
10335
|
+
calendarIconColor
|
|
10303
10336
|
} = _ref;
|
|
10304
10337
|
const [isFocused, setIsFocused] = React$1.useState(false);
|
|
10305
10338
|
const [isOpen, setIsOpen] = React$1.useState(false);
|
|
@@ -10415,9 +10448,11 @@ const RangePicker = _ref => {
|
|
|
10415
10448
|
className: "CalendarDiv",
|
|
10416
10449
|
onClick: toggleDatePicker
|
|
10417
10450
|
}, isOpen === true ? /*#__PURE__*/React__default["default"].createElement(CalendarInOpen, {
|
|
10418
|
-
className: "CalendarInOpen"
|
|
10451
|
+
className: "CalendarInOpen",
|
|
10452
|
+
fill: calendarIconColor
|
|
10419
10453
|
}) : /*#__PURE__*/React__default["default"].createElement(Calendar, {
|
|
10420
|
-
className: "Calendar"
|
|
10454
|
+
className: "Calendar",
|
|
10455
|
+
fill: calendarIconColor
|
|
10421
10456
|
}))), /*#__PURE__*/React__default["default"].createElement(OptionsContainer$5, {
|
|
10422
10457
|
className: "OptionsContainer",
|
|
10423
10458
|
onMouseEnter: () => setHoverOptionsContainer(true),
|
|
@@ -10429,7 +10464,11 @@ const RangePicker = _ref => {
|
|
|
10429
10464
|
value: value,
|
|
10430
10465
|
setValue: setValue,
|
|
10431
10466
|
startDateValue: startDateValue,
|
|
10432
|
-
endDateValue: endDateValue
|
|
10467
|
+
endDateValue: endDateValue,
|
|
10468
|
+
selectedColor: selectedColor,
|
|
10469
|
+
hoverColor: hoverColor,
|
|
10470
|
+
inRangeColor: inRangeColor,
|
|
10471
|
+
clearButtonColor: clearButtonColor
|
|
10433
10472
|
})));
|
|
10434
10473
|
};
|
|
10435
10474
|
RangePicker.propTypes = {
|
|
@@ -10446,7 +10485,12 @@ RangePicker.propTypes = {
|
|
|
10446
10485
|
borderColorFocus: PropTypes.string,
|
|
10447
10486
|
textColor: PropTypes.string,
|
|
10448
10487
|
// Added textColor prop
|
|
10449
|
-
selectedValue: PropTypes.string
|
|
10488
|
+
selectedValue: PropTypes.string,
|
|
10489
|
+
selectedColor: PropTypes.string,
|
|
10490
|
+
hoverColor: PropTypes.string,
|
|
10491
|
+
inRangeColor: PropTypes.string,
|
|
10492
|
+
clearButtonColor: PropTypes.string,
|
|
10493
|
+
calendarIconColor: PropTypes.string
|
|
10450
10494
|
};
|
|
10451
10495
|
|
|
10452
10496
|
// Adding defaultProps
|
|
@@ -10461,7 +10505,12 @@ RangePicker.defaultProps = {
|
|
|
10461
10505
|
borderColorFocus: '#000000',
|
|
10462
10506
|
textColor: '#000000',
|
|
10463
10507
|
// Default textColor prop value
|
|
10464
|
-
selectedValue: ''
|
|
10508
|
+
selectedValue: '',
|
|
10509
|
+
selectedColor: '#229e38',
|
|
10510
|
+
hoverColor: '#f4faf5',
|
|
10511
|
+
inRangeColor: '#effef2',
|
|
10512
|
+
clearButtonColor: '#568202',
|
|
10513
|
+
calendarIconColor: '#568202'
|
|
10465
10514
|
};
|
|
10466
10515
|
|
|
10467
10516
|
/* eslint-disable no-nested-ternary */
|