@pedidopago/ui 1.17.58 → 1.17.60
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/components/DatePicker/components/DatePickerContent.d.ts.map +1 -1
- package/dist/components/DatePicker/components/DatePickerContent.js +1 -1
- package/dist/components/DatePicker/hooks/useDatePicker/index.d.ts +0 -1
- package/dist/components/DatePicker/hooks/useDatePicker/index.d.ts.map +1 -1
- package/dist/components/DatePicker/hooks/useDatePicker/index.js +2 -2
- package/dist/components/DatePicker/hooks/useDatePicker/utils.d.ts +2 -1
- package/dist/components/DatePicker/hooks/useDatePicker/utils.d.ts.map +1 -1
- package/dist/components/DatePicker/hooks/useDatePicker/utils.js +1 -1
- package/dist/components/DatePicker/index.d.ts.map +1 -1
- package/dist/components/DatePicker/index.js +1 -1
- package/dist/components/DatePicker/styles.d.ts.map +1 -1
- package/dist/components/DatePicker/styles.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePickerContent.d.ts","sourceRoot":"","sources":["../../../../src/components/DatePicker/components/DatePickerContent.tsx"],"names":[],"mappings":"AA+BA,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAKlD,eAAO,MAAM,iBAAiB,yTAsB3B,sBAAsB,
|
|
1
|
+
{"version":3,"file":"DatePickerContent.d.ts","sourceRoot":"","sources":["../../../../src/components/DatePicker/components/DatePickerContent.tsx"],"names":[],"mappings":"AA+BA,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAKlD,eAAO,MAAM,iBAAiB,yTAsB3B,sBAAsB,4CA4IxB,CAAC"}
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
// Styles
|
|
5
5
|
// Types
|
|
6
6
|
// Constants
|
|
7
|
-
var DatePickerContent=function(_ref){function handleChangeMonth(direction){var offset="up"===direction?1:-1,newMonth=month+offset,adjustedMonth=11<newMonth?0:0>newMonth?11:newMonth,adjustedYear=11<newMonth?year+1:0>newMonth?year-1:year;handleChangeDate((0,_dateUtils.createDate)(adjustedYear,adjustedMonth))}var type=_ref.type,dateProp=_ref.date,startDate=_ref.startDate,endDate=_ref.endDate,isInTheRange=_ref.isInTheRange,maxDate=_ref.maxDate,minDate=_ref.minDate,handleChange=_ref.handleChange,handleMouseOver=_ref.handleMouseOver,handleChangeDate=_ref.handleChangeDate,variant=_ref.variant,enableYearPicker=_ref.enableYearPicker,handleToggleYearPicker=_ref.handleToggleYearPicker,hideNextMonthButton=_ref.hideNextMonthButton,hidePrevMonthButton=_ref.hidePrevMonthButton,disableWeekendDays=_ref.disableWeekendDays,showSelectedDate=_ref.showSelectedDate,_ref$fullSize=_ref.fullSize,fullSize=void 0!==_ref$fullSize&&_ref$fullSize,rangeLimit=_ref.rangeLimit,isFirstClick=_ref.isFirstClick,availableDays=_ref.availableDays,date=dateProp||new Date,month=date.getMonth(),year=date.getFullYear(),isExtended="extended"===variant,isRange="range"===type,calendarDays=(0,_dateUtils.getCalendarDays)(month,year,isExtended),isHiddenArrowBack
|
|
7
|
+
var DatePickerContent=function(_ref){function handleChangeMonth(direction){var offset="up"===direction?1:-1,newMonth=month+offset,adjustedMonth=11<newMonth?0:0>newMonth?11:newMonth,adjustedYear=11<newMonth?year+1:0>newMonth?year-1:year;handleChangeDate((0,_dateUtils.createDate)(adjustedYear,adjustedMonth))}var type=_ref.type,dateProp=_ref.date,startDate=_ref.startDate,endDate=_ref.endDate,isInTheRange=_ref.isInTheRange,maxDate=_ref.maxDate,minDate=_ref.minDate,handleChange=_ref.handleChange,handleMouseOver=_ref.handleMouseOver,handleChangeDate=_ref.handleChangeDate,variant=_ref.variant,enableYearPicker=_ref.enableYearPicker,handleToggleYearPicker=_ref.handleToggleYearPicker,hideNextMonthButton=_ref.hideNextMonthButton,hidePrevMonthButton=_ref.hidePrevMonthButton,disableWeekendDays=_ref.disableWeekendDays,showSelectedDate=_ref.showSelectedDate,_ref$fullSize=_ref.fullSize,fullSize=void 0!==_ref$fullSize&&_ref$fullSize,rangeLimit=_ref.rangeLimit,isFirstClick=_ref.isFirstClick,availableDays=_ref.availableDays,date=dateProp||new Date,month=date.getMonth(),year=date.getFullYear(),isExtended="extended"===variant,isRange="range"===type,calendarDays=(0,_dateUtils.getCalendarDays)(month,year,isExtended),isHiddenArrowBack=!!minDate&&minDate.getMonth()===month&&minDate.getFullYear()===year,isHiddenArrowNext=!!maxDate&&maxDate.getMonth()===month&&maxDate.getFullYear()===year;return/*#__PURE__*/(0,_jsxRuntime.jsx)(_framerMotion.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:/*#__PURE__*/(0,_jsxRuntime.jsxs)(_styles.DatePickerContainer,{tabIndex:-1,fullSize:fullSize,children:[/*#__PURE__*/(0,_jsxRuntime.jsxs)(_styles.DatePickerHeader,{fullSize:fullSize,children:[/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.DatePickerHeaderButton,{type:"button",onClick:function onClick(){return handleChangeMonth("down")},isHidden:isHiddenArrowBack||hidePrevMonthButton,children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_Icon.default,{name:"arrow-left"})}),/*#__PURE__*/(0,_jsxRuntime.jsxs)(_styles.DatePickerHeaderTitle,{onClick:function onClick(){return enableYearPicker&&(null===handleToggleYearPicker||void 0===handleToggleYearPicker?void 0:handleToggleYearPicker())},enableYearPicker:enableYearPicker,children:[(0,_getMonthName.getMonthName)(month)," ",year,enableYearPicker&&/*#__PURE__*/(0,_jsxRuntime.jsx)(_Icon.default,{name:"edit",size:"15px"})]}),/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.DatePickerHeaderButton,{type:"button",onClick:function onClick(){return handleChangeMonth("up")},isHidden:isHiddenArrowNext||hideNextMonthButton,children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_Icon.default,{name:"arrow-right"})})]}),/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.DatePickerBody,{fullSize:fullSize,children:/*#__PURE__*/(0,_jsxRuntime.jsxs)(_styles.DatePickerBodyTable,{role:"table",fullSize:fullSize,children:[/*#__PURE__*/(0,_jsxRuntime.jsx)("thead",{children:/*#__PURE__*/(0,_jsxRuntime.jsx)("tr",{children:_constants.WEEK_DAYS.map(function(day,i){return/*#__PURE__*/(0,_jsxRuntime.jsx)("th",{children:day},i)})})}),/*#__PURE__*/(0,_jsxRuntime.jsx)("tbody",{children:calendarDays.map(function(week,rowIndex){return/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.DatePickerTableRow,{role:"row",isRange:isRange,fullSize:fullSize,children:week.map(function(day,dayIndex){var isPrevMonth=0===rowIndex&&7<day,isNextMonth=rowIndex===calendarDays.length-1&&7>day,cellMonth=isPrevMonth?month-1:isNextMonth?month+1:month,cellDate=(0,_dateUtils.createDate)(year,cellMonth,day),isStartDate=(0,_dateUtils.isSameDay)(cellDate,startDate),isEndDate=(0,_dateUtils.isSameDay)(cellDate,endDate),outOfCurrentMonth=isRange&&(isPrevMonth||isNextMonth),isDisabled=0===day||outOfCurrentMonth||(0,_dateUtils.isDateDisabled)(cellDate,minDate,maxDate)||(0,_dateUtils.isOutOfRangeLimit)(cellDate,startDate,rangeLimit,isFirstClick)||disableWeekendDays&&(0,_dateUtils.isWeekend)(cellDate),nonZeroDays=week.filter(function(d){return 0!==d}),isLastDay=day===nonZeroDays[nonZeroDays.length-1],today=new Date,isToday=0!==day&&(0,_dateUtils.isSameDay)(cellDate,today);return/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.DatePickerTableCell,{role:"gridcell",title:cellDate.toLocaleDateString(),"data-date":cellDate,fullSize:fullSize,isTheSameDate:isStartDate&&isEndDate&&!!endDate,tabIndex:-1,disabled:isDisabled,"aria-label":cellDate.toLocaleDateString("pt-BR",{weekday:"short",year:"2-digit",month:"2-digit",day:"2-digit"}),"aria-selected":isRange?isStartDate||isEndDate||isInTheRange(cellDate):isStartDate,"aria-disabled":isDisabled,isInTheRange:isRange&&isInTheRange(cellDate),isStartDateOfRange:isRange&&isStartDate,isEndDateOfRange:isRange&&isEndDate,isToday:isToday,isSelected:isStartDate,isPrevNextMonth:isPrevMonth||isNextMonth,isFirstDayOfMonth:isExtended&&0===rowIndex&&1===day,showSelectedDate:showSelectedDate,isLastDayOfMonth:isExtended&&rowIndex===calendarDays.length-1&&isLastDay,onMouseEnter:function onMouseEnter(){return isRange&&handleMouseOver(cellDate)},onClick:function onClick(){return handleChange(cellDate)},children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.DatePickerTableCellSpan,{children:0!==day&&!outOfCurrentMonth&&day})},dayIndex)})},rowIndex)})})]})})]})})};exports.DatePickerContent=DatePickerContent;
|
|
@@ -16,6 +16,5 @@ export declare function useDatePicker({ value, onChange, minDate: minDateProp, m
|
|
|
16
16
|
handleChange: (newDate: Date) => void;
|
|
17
17
|
isInTheRange: (date: Date) => boolean;
|
|
18
18
|
handleToggleYearPicker: () => void;
|
|
19
|
-
shouldHidePrevButton: (first: Date, second: Date) => boolean;
|
|
20
19
|
};
|
|
21
20
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/DatePicker/hooks/useDatePicker/index.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/DatePicker/hooks/useDatePicker/index.ts"],"names":[],"mappings":";AAaA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,QAAQ,EACR,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,WAAW,EACpB,OAAmB,EACnB,IAAa,EACb,iBAAiB,EACjB,eAAe,GAChB,EAAE,eAAe;;;;;;;;;;oCAiF4B,IAAI;qCAQH,IAAI;;4BA5DlB,IAAI;yBAsBP,IAAI;;EA+DjC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.useDatePicker=useDatePicker;var _react=require("react"),_dateUtils=require("../../utils/dateUtils"),_utils=require("./utils");function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(o,minLen):void 0}}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null!=_i){var _s,_e,_x,_r,_arr=[],_n=!0,_d=!1;try{if(_x=(_i=_i.call(arr)).next,0===i){if(Object(_i)!==_i)return;_n=!1}else for(;!(_n=(_s=_x.call(_i)).done)&&(_arr.push(_s.value),_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{if(!_n&&null!=_i.return&&(_r=_i.return(),Object(_r)!==_r))return}finally{if(_d)throw _e}}return _arr}}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}// Libs
|
|
1
|
+
"use strict";function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_typeof(obj)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.useDatePicker=useDatePicker;var _react=require("react"),_dateUtils=require("../../utils/dateUtils"),_utils=require("./utils");function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})),keys.push.apply(keys,symbols)}return keys}function _objectSpread(target){for(var source,i=1;i<arguments.length;i++)source=null==arguments[i]?{}:arguments[i],i%2?ownKeys(Object(source),!0).forEach(function(key){_defineProperty(target,key,source[key])}):Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))});return target}function _defineProperty(obj,key,value){return key=_toPropertyKey(key),key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return"symbol"===_typeof(key)?key:key+""}function _toPrimitive(input,hint){if("object"!==_typeof(input)||null===input)return input;var prim=input[Symbol.toPrimitive];if(prim!==void 0){var res=prim.call(input,hint||"default");if("object"!==_typeof(res))return res;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===hint?String:Number)(input)}function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(o,minLen):void 0}}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null!=_i){var _s,_e,_x,_r,_arr=[],_n=!0,_d=!1;try{if(_x=(_i=_i.call(arr)).next,0===i){if(Object(_i)!==_i)return;_n=!1}else for(;!(_n=(_s=_x.call(_i)).done)&&(_arr.push(_s.value),_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{if(!_n&&null!=_i.return&&(_r=_i.return(),Object(_r)!==_r))return}finally{if(_d)throw _e}}return _arr}}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}// Libs
|
|
2
2
|
// Utils
|
|
3
3
|
// Types
|
|
4
|
-
function useDatePicker(_ref){var value=_ref.value,onChange=_ref.onChange,minDateProp=_ref.minDate,maxDateProp=_ref.maxDate,_ref$variant=_ref.variant,variant=void 0===_ref$variant?"compact":_ref$variant,_ref$type=_ref.type,type=void 0===_ref$type?"date":_ref$type,onChangeStartDate=_ref.onChangeStartDate,onChangeEndDate=_ref.onChangeEndDate,minDate=minDateProp?new Date(minDateProp):void 0,maxDate=maxDateProp?new Date(maxDateProp):void 0,_useState=(0,_react.useState)(!1),_useState2=_slicedToArray(_useState,2),openYearPicker=_useState2[0],setOpenYearPicker=_useState2[1],_useState3=(0,_react.useState)(function(){return(0,_utils.getInitialStartDate)(value,minDate,maxDate)}),_useState4=_slicedToArray(_useState3,2),startDate=_useState4[0],setStartDate=_useState4[1],_useState5=(0,_react.useState)(function(){return value?(0,_utils.parseInitialDate)(value,Array.isArray(value)?1:0):startDate}),_useState6=_slicedToArray(_useState5,2),endDate=_useState6[0],setEndDate=_useState6[1],_useState7=(0,_react.useState)(function(){
|
|
4
|
+
function useDatePicker(_ref){function handleCalendarNavigation(direction){var offset="next"===direction?1:-1;setCalendarDates(function(prev){var newFirst=(0,_utils.addMonths)(prev.first,offset),newSecond=(0,_utils.addMonths)(prev.second,offset);return{first:newFirst,second:newSecond}})}var value=_ref.value,onChange=_ref.onChange,minDateProp=_ref.minDate,maxDateProp=_ref.maxDate,_ref$variant=_ref.variant,variant=void 0===_ref$variant?"compact":_ref$variant,_ref$type=_ref.type,type=void 0===_ref$type?"date":_ref$type,onChangeStartDate=_ref.onChangeStartDate,onChangeEndDate=_ref.onChangeEndDate,minDate=minDateProp?new Date(minDateProp):void 0,maxDate=maxDateProp?new Date(maxDateProp):void 0,_useState=(0,_react.useState)(!1),_useState2=_slicedToArray(_useState,2),openYearPicker=_useState2[0],setOpenYearPicker=_useState2[1],_useState3=(0,_react.useState)(function(){return(0,_utils.getInitialStartDate)(value,minDate,maxDate)}),_useState4=_slicedToArray(_useState3,2),startDate=_useState4[0],setStartDate=_useState4[1],_useState5=(0,_react.useState)(function(){return value?(0,_utils.parseInitialDate)(value,Array.isArray(value)?1:0):startDate}),_useState6=_slicedToArray(_useState5,2),endDate=_useState6[0],setEndDate=_useState6[1],_useState7=(0,_react.useState)(function(){if("extended"===variant){var second=(0,_utils.getInitialSecondCalendar)(startDate,endDate,maxDate),_first=new Date(second.getFullYear(),second.getMonth()-1,1);return{first:_first,second:second}}var first=startDate?new Date(startDate.getFullYear(),startDate.getMonth(),1):new Date(new Date().getFullYear(),new Date().getMonth(),1);return{first:first,second:first}}),_useState8=_slicedToArray(_useState7,2),calendarDates=_useState8[0],setCalendarDates=_useState8[1],firstCalendarLimit=new Date(calendarDates.second.getFullYear(),calendarDates.second.getMonth(),0),secondCalendarMinLimit=new Date(calendarDates.first.getFullYear(),calendarDates.first.getMonth()+1,1);return{minDate:minDate,maxDate:maxDate,startDate:startDate,endDate:endDate,openYearPicker:openYearPicker,firstCalendarDate:calendarDates.first,secondCalendarDate:calendarDates.second,firstCalendarLimit:firstCalendarLimit,secondCalendarMinLimit:secondCalendarMinLimit,setFirstCalendarDate:function(newDate){return"extended"===variant?void handleCalendarNavigation(newDate>calendarDates.first?"next":"prev"):void setCalendarDates(function(prev){return _objectSpread(_objectSpread({},prev),{},{first:newDate})})},setSecondCalendarDate:function(newDate){return"extended"===variant?void handleCalendarNavigation(newDate>calendarDates.second?"next":"prev"):void setCalendarDates(function(prev){return _objectSpread(_objectSpread({},prev),{},{second:newDate})})},setOpenYearPicker:setOpenYearPicker,handleChange:function(newDate){if("date"===type)return setStartDate(newDate),void(null===onChange||void 0===onChange?void 0:onChange(newDate));return!startDate||endDate||startDate&&newDate<startDate?(null===onChangeStartDate||void 0===onChangeStartDate?void 0:onChangeStartDate(newDate),setStartDate(newDate),void setEndDate(null)):void(null===onChangeEndDate||void 0===onChangeEndDate?void 0:onChangeEndDate(newDate),setEndDate(newDate),null===onChange||void 0===onChange?void 0:onChange([startDate,newDate]))},isInTheRange:function(date){return(0,_dateUtils.isDateInRange)(date,startDate,endDate)},handleToggleYearPicker:function(){setOpenYearPicker(function(prev){return!prev})}}}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DateValue } from './types';
|
|
2
2
|
export declare function parseInitialDate(value: DateValue, index?: 0 | 1): Date | null;
|
|
3
3
|
export declare function getInitialStartDate(value: DateValue, minDate?: Date, maxDate?: Date): Date | null;
|
|
4
|
-
export declare function getInitialSecondCalendar(startDate: Date | null, endDate: Date | null, maxDate?: Date
|
|
4
|
+
export declare function getInitialSecondCalendar(startDate: Date | null, endDate: Date | null, maxDate?: Date): Date;
|
|
5
|
+
export declare function addMonths(date: Date, months: number): Date;
|
|
5
6
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/components/DatePicker/hooks/useDatePicker/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,GAAE,CAAC,GAAG,CAAK,GAAG,IAAI,GAAG,IAAI,CAIhF;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAMjG;AAED,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,IAAI,GAAG,IAAI,EACtB,OAAO,EAAE,IAAI,GAAG,IAAI,EACpB,OAAO,CAAC,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/components/DatePicker/hooks/useDatePicker/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,GAAE,CAAC,GAAG,CAAK,GAAG,IAAI,GAAG,IAAI,CAIhF;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAMjG;AAED,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,IAAI,GAAG,IAAI,EACtB,OAAO,EAAE,IAAI,GAAG,IAAI,EACpB,OAAO,CAAC,EAAE,IAAI,GACb,IAAI,CAiBN;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAI1D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getInitialSecondCalendar=getInitialSecondCalendar,exports.getInitialStartDate=getInitialStartDate,exports.parseInitialDate=parseInitialDate;function parseInitialDate(value){var index=1<arguments.length&&arguments[1]!==void 0?arguments[1]:0;return value?Array.isArray(value)?new Date(value[index]):new Date(value):null}function getInitialStartDate(value,minDate,maxDate){if(value)return parseInitialDate(value,0);var now=new Date;return maxDate&&minDate&&maxDate<=now?maxDate:minDate&&minDate>now?minDate:null}function getInitialSecondCalendar(startDate,endDate,maxDate
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.addMonths=addMonths,exports.getInitialSecondCalendar=getInitialSecondCalendar,exports.getInitialStartDate=getInitialStartDate,exports.parseInitialDate=parseInitialDate;function parseInitialDate(value){var index=1<arguments.length&&arguments[1]!==void 0?arguments[1]:0;return value?Array.isArray(value)?new Date(value[index]):new Date(value):null}function getInitialStartDate(value,minDate,maxDate){if(value)return parseInitialDate(value,0);var now=new Date;return maxDate&&minDate&&maxDate<=now?maxDate:minDate&&minDate>now?minDate:null}function getInitialSecondCalendar(startDate,endDate,maxDate){var now=new Date,defaultSecond=new Date(now.getFullYear(),now.getMonth()+1,1);if(!startDate)return maxDate&&maxDate<=defaultSecond?maxDate:defaultSecond;var startMonth=startDate.getMonth(),endMonth=null===endDate||void 0===endDate?void 0:endDate.getMonth();return endDate&&endMonth?new Date(endDate.getFullYear(),endMonth,1):new Date(startDate.getFullYear(),startMonth+1,1)}function addMonths(date,months){var newDate=new Date(date);return newDate.setMonth(newDate.getMonth()+months),newDate}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DatePicker/index.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EACjC,KAAK,EACL,QAAQ,EACR,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,WAAW,EACpB,OAAmB,EACnB,KAAK,EACL,IAAa,EACb,kBAAkB,EAClB,gBAAgB,EAChB,QAAgB,EAChB,UAAU,EACV,iBAAiB,EACjB,eAAe,GAChB,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DatePicker/index.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EACjC,KAAK,EACL,QAAQ,EACR,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,WAAW,EACpB,OAAmB,EACnB,KAAK,EACL,IAAa,EACb,kBAAkB,EAClB,gBAAgB,EAChB,QAAgB,EAChB,UAAU,EACV,iBAAiB,EACjB,eAAe,GAChB,EAAE,eAAe,2CA4GjB"}
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
// Hooks
|
|
4
4
|
// Styles
|
|
5
5
|
// Types
|
|
6
|
-
function DatePicker(_ref){var value=_ref.value,onChange=_ref.onChange,minDateProp=_ref.minDate,maxDateProp=_ref.maxDate,_ref$variant=_ref.variant,variant=void 0===_ref$variant?"compact":_ref$variant,color=_ref.color,_ref$type=_ref.type,type=void 0===_ref$type?"date":_ref$type,disableWeekendDays=_ref.disableWeekendDays,enableYearPicker=_ref.enableYearPicker,_ref$fullSize=_ref.fullSize,fullSize=void 0!==_ref$fullSize&&_ref$fullSize,rangeLimit=_ref.rangeLimit,onChangeStartDate=_ref.onChangeStartDate,onChangeEndDate=_ref.onChangeEndDate,_useDatePicker=(0,_useDatePicker2.useDatePicker)({value:value,onChange:onChange,minDate:minDateProp,maxDate:maxDateProp,variant:variant,type:type,onChangeStartDate:onChangeStartDate,onChangeEndDate:onChangeEndDate}),minDate=_useDatePicker.minDate,maxDate=_useDatePicker.maxDate,startDate=_useDatePicker.startDate,endDate=_useDatePicker.endDate,openYearPicker=_useDatePicker.openYearPicker,firstCalendarDate=_useDatePicker.firstCalendarDate,secondCalendarDate=_useDatePicker.secondCalendarDate,firstCalendarLimit=_useDatePicker.firstCalendarLimit,secondCalendarMinLimit=_useDatePicker.secondCalendarMinLimit,setFirstCalendarDate=_useDatePicker.setFirstCalendarDate,setSecondCalendarDate=_useDatePicker.setSecondCalendarDate,setOpenYearPicker=_useDatePicker.setOpenYearPicker,handleChange=_useDatePicker.handleChange,isInTheRange=_useDatePicker.isInTheRange,handleToggleYearPicker=_useDatePicker.handleToggleYearPicker,
|
|
6
|
+
function DatePicker(_ref){var value=_ref.value,onChange=_ref.onChange,minDateProp=_ref.minDate,maxDateProp=_ref.maxDate,_ref$variant=_ref.variant,variant=void 0===_ref$variant?"compact":_ref$variant,color=_ref.color,_ref$type=_ref.type,type=void 0===_ref$type?"date":_ref$type,disableWeekendDays=_ref.disableWeekendDays,enableYearPicker=_ref.enableYearPicker,_ref$fullSize=_ref.fullSize,fullSize=void 0!==_ref$fullSize&&_ref$fullSize,rangeLimit=_ref.rangeLimit,onChangeStartDate=_ref.onChangeStartDate,onChangeEndDate=_ref.onChangeEndDate,_useDatePicker=(0,_useDatePicker2.useDatePicker)({value:value,onChange:onChange,minDate:minDateProp,maxDate:maxDateProp,variant:variant,type:type,onChangeStartDate:onChangeStartDate,onChangeEndDate:onChangeEndDate}),minDate=_useDatePicker.minDate,maxDate=_useDatePicker.maxDate,startDate=_useDatePicker.startDate,endDate=_useDatePicker.endDate,openYearPicker=_useDatePicker.openYearPicker,firstCalendarDate=_useDatePicker.firstCalendarDate,secondCalendarDate=_useDatePicker.secondCalendarDate,firstCalendarLimit=_useDatePicker.firstCalendarLimit,secondCalendarMinLimit=_useDatePicker.secondCalendarMinLimit,setFirstCalendarDate=_useDatePicker.setFirstCalendarDate,setSecondCalendarDate=_useDatePicker.setSecondCalendarDate,setOpenYearPicker=_useDatePicker.setOpenYearPicker,handleChange=_useDatePicker.handleChange,isInTheRange=_useDatePicker.isInTheRange,handleToggleYearPicker=_useDatePicker.handleToggleYearPicker,handleMouseOver=(0,_useRangeHover.useRangeHover)(startDate,endDate),isExtended="extended"===variant,contentProps={variant:variant,type:type,startDate:startDate,endDate:endDate,isInTheRange:isInTheRange,handleMouseOver:handleMouseOver,handleChange:handleChange,minDate:minDate,handleToggleYearPicker:handleToggleYearPicker,enableYearPicker:enableYearPicker,rangeLimit:rangeLimit,disableWeekendDays:disableWeekendDays,fullSize:fullSize,showSelectedDate:!!startDate};return/*#__PURE__*/(0,_jsxRuntime.jsx)(_react.ThemeProvider,{theme:{colorSelected:color||"primary.default"},children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.DatePickerContentContainer,{isExtended:isExtended,fullSize:fullSize,children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_framerMotion.AnimatePresence,{mode:"wait",children:openYearPicker?/*#__PURE__*/(0,_jsxRuntime.jsx)(_DateYearPicker.DateYearPicker,{date:firstCalendarDate,minDate:minDateProp,maxDate:maxDateProp,handleChangeDate:function handleChangeDate(newDate){setFirstCalendarDate(new Date(newDate.getFullYear(),newDate.getMonth(),1)),setOpenYearPicker(!1)}}):/*#__PURE__*/(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[/*#__PURE__*/(0,_jsxRuntime.jsx)(_DatePickerContent.DatePickerContent,_objectSpread(_objectSpread({},contentProps),{},{date:firstCalendarDate,hidePrevMonthButton:function(){return!!(isExtended&&minDate)&&minDate.getMonth()>=firstCalendarDate.getMonth()&&minDate.getFullYear()>=firstCalendarDate.getFullYear()}(),maxDate:function getFirstCalendarMaxDate(){return isExtended?maxDate?maxDate.getTime()<firstCalendarLimit.getTime()?maxDate:firstCalendarLimit:firstCalendarLimit:maxDate}(),handleChangeDate:setFirstCalendarDate,hideNextMonthButton:isExtended})),isExtended&&/*#__PURE__*/(0,_jsxRuntime.jsx)(_DatePickerContent.DatePickerContent,_objectSpread(_objectSpread({},contentProps),{},{date:secondCalendarDate,minDate:minDate&&minDate>secondCalendarMinLimit?minDate:secondCalendarMinLimit,maxDate:maxDate,handleChangeDate:setSecondCalendarDate,hidePrevMonthButton:!0}))]})})})})}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/components/DatePicker/styles.ts"],"names":[],"mappings":";AASA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE7C,eAAO,MAAM,0BAA0B;;;;gBACzB,OAAO;cACT,OAAO;
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/components/DatePicker/styles.ts"],"names":[],"mappings":";AASA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE7C,eAAO,MAAM,0BAA0B;;;;gBACzB,OAAO;cACT,OAAO;yGA0BlB,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;cAA0B,OAAO;yGAUhE,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;;cAA0B,OAAO;yGAO7D,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;;;yGAsBjC,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;;qHAqBlC,CAAC;AAEF,eAAO,MAAM,cAAc;;;;cAA0B,OAAO;yGAK3D,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;cAAiD,OAAO;kHAoDvF,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;;;cAGjB,OAAO;mHAyBpB,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;+HAqK/B,CAAC;AAEF,eAAO,MAAM,uBAAuB;;;gIAGnC,CAAC;AAEF,eAAO,MAAM,uBAAuB;;;yGAGnC,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;yGAG9B,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;;;;yGAkC9B,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.DateYearPickerContainer=exports.DateYearPickerCell=exports.DateYearPickerBody=exports.DatePickerTableRow=exports.DatePickerTableCellSpan=exports.DatePickerTableCell=exports.DatePickerHeaderTitle=exports.DatePickerHeaderButton=exports.DatePickerHeader=exports.DatePickerContentContainer=exports.DatePickerContainer=exports.DatePickerBodyTable=exports.DatePickerBody=void 0;var _templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,_templateObject8,_templateObject9,_templateObject10,_templateObject11,_templateObject12,_templateObject13,_react=require("@emotion/react"),_styled=_interopRequireDefault(require("@emotion/styled")),_colorCheck=require("../../utils/colorCheck"),_getColorValue=require("../../utils/getColorValue");// Libs
|
|
2
2
|
// Utils
|
|
3
3
|
function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _taggedTemplateLiteral(strings,raw){return raw||(raw=strings.slice(0)),Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}))}// Types
|
|
4
|
-
var DatePickerContentContainer=_styled.default.div(function(_ref){var theme=_ref.theme,fullSize=_ref.fullSize;return(0,_react.css)(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n display: flex;\n justify-content: center;\n width: ",";\n height: ",";\n max-width: ",";\n min-width: ",";\n\n gap: 20px;\n padding: 24px 18px;\n border-radius: 8px;\n background-color: ",";\n box-shadow: ",";\n\n @media (max-width: 750px) {\n flex-wrap: wrap;\n }\n\n & > div {\n width: ",";\n }\n "])),fullSize?"100%":"unset",fullSize?"100%":"unset",fullSize?"unset":"fit-content",fullSize?"290px":"unset",theme.colors.neutral.white,"0px 16px 32px ".concat(theme.shadow.level3),fullSize?"100%":"290px")});exports.DatePickerContentContainer=DatePickerContentContainer;var DatePickerContainer=_styled.default.div(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n\n ",";\n"])),function(_ref2){var fullSize=_ref2.fullSize;return fullSize&&"\n height: 100%;\n gap: 2.5%;\n "});exports.DatePickerContainer=DatePickerContainer;var DatePickerHeader=_styled.default.div(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 15px;\n width: 100%;\n min-width: ",";\n"])),function(_ref3){var fullSize=_ref3.fullSize;return fullSize?"320px":"unset"});exports.DatePickerHeader=DatePickerHeader;var DatePickerHeaderTitle=_styled.default.div(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n font-family: inherit;\n font-size: 0.875rem;\n font-weight: 600;\n gap: 0.875rem;\n line-height: 1rem;\n\n color: ",";\n\n ","\n\n user-select: none;\n"])),function(_ref4){var colors=_ref4.theme.colors;return colors.neutral.black},function(props){return props.enableYearPicker&&"\n cursor: pointer;\n "});exports.DatePickerHeaderTitle=DatePickerHeaderTitle;var DatePickerHeaderButton=_styled.default.button(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["\n color: ",";\n cursor: pointer;\n border: none;\n outline: 0;\n background-color: transparent;\n\n ","\n\n & svg {\n stroke-width: 10px;\n }\n"])),function(_ref5){var colors=_ref5.theme.colors;return colors.neutral.neutral5},function(_ref6){var isHidden=_ref6.isHidden;return isHidden&&"\n visibility: hidden;\n pointer-events: none;\n "});exports.DatePickerHeaderButton=DatePickerHeaderButton;var DatePickerBody=_styled.default.div(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["\n width: 100%;\n min-width: ",";\n\n height: ",";\n"])),function(_ref7){var fullSize=_ref7.fullSize;return fullSize?"320px":"unset"},function(_ref8){var fullSize=_ref8.fullSize;return fullSize?"100%":"unset"});exports.DatePickerBody=DatePickerBody;var DatePickerBodyTable=_styled.default.table(function(_ref9){var theme=_ref9.theme,fullSize=_ref9.fullSize;return(0,_react.css)(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["\n width: 100%;\n border-collapse: collapse;\n border-spacing: 10px;\n table-layout: fixed;\n\n ",";\n\n & thead tr th {\n padding: 0.75rem;\n font-family: inherit;\n font-size: 0.75rem;\n font-weight: 500;\n color: ",";\n user-select: none;\n }\n\n & tbody {\n ","\n }\n\n & thead tr {\n ","\n }\n "])),fullSize&&"\n display: flex;\n flex-direction: column;\n height: 100%;\n gap: 5%;\n ",theme.colors.neutral.black,fullSize&&"\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n height: 100%;\n ",fullSize&&"\n display: flex;\n justify-content: space-between;\n\n th {\n width: 100%;\n max-width: 50px;\n aspect-ratio: 1 / 1;\n display: flex;\n justify-content: center;\n align-items: center;\n font-size: 0.875rem;\n }\n ")});exports.DatePickerBodyTable=DatePickerBodyTable;var DatePickerTableRow=_styled.default.tr(_templateObject8||(_templateObject8=_taggedTemplateLiteral(["\n ",";\n\n ",";\n"])),function(_ref10){var fullSize=_ref10.fullSize;return fullSize&&"\n display: flex;\n width: 100%;\n min-width: 320px;\n justify-content: space-between;\n "},function(props){return props.isRange&&"\n & td:first-of-type:before {\n border-top-left-radius: 4px;\n border-bottom-left-radius: 4px;\n }\n\n & td:last-of-type:before {\n border-top-right-radius: 4px;\n border-bottom-right-radius: 4px;\n }\n "});exports.DatePickerTableRow=DatePickerTableRow;var DatePickerTableCell=_styled.default.td(function(props){return(0,_react.css)(_templateObject9||(_templateObject9=_taggedTemplateLiteral(["\n position: relative;\n height: 0;\n padding: 12px;\n text-align: center;\n font-family: inherit;\n font-size: ",";\n max-width: ",";\n aspect-ratio: ",";\n font-weight: 600;\n border-radius: 50%;\n cursor: pointer;\n background-color: ",";\n\n color: ",";\n\n user-select: none;\n\n transition: background 150ms ease;\n\n ","\n\n ","\n\n ","\n\n ","\n\n &:hover {\n background-color: ",";\n }\n\n ","\n\n &.is-current[aria-selected='false']:before {\n border-radius: 0 50% 50% 0 !important;\n }\n\n &.is-current[aria-selected='true']:before {\n display: none;\n }\n "])),props.fullSize?"100%":"0.75rem",props.fullSize?"50px":"unset",props.fullSize?"1 / 1":"unset",!props.isPrevNextMonth&&!props.disabled&&props.showSelectedDate&&(props.isSelected||props.isEndDateOfRange)?(0,_getColorValue.getColorValue)(props.theme.colorSelected,props.theme):"transparent",props.isPrevNextMonth?props.theme.colors.neutral.neutral2:props.isSelected||props.isEndDateOfRange?props.showSelectedDate?props.theme.lightColors.neutral.white:props.theme.colors.neutral.black:props["aria-selected"]?(0,_getColorValue.getColorValue)(props.theme.colorSelected,props.theme):props.theme.colors.neutral.black,props.fullSize&&"\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n\n ",props.disabled&&"\n pointer-events: none;\n cursor: default;\n color: ".concat(props.theme.colors.neutral.neutral1,";\n "),props.isToday&&!props.isSelected&&!props.isEndDateOfRange&&"\n &:after {\n content: '';\n position: absolute;\n top: 50%;\n left: 50%;\n width: 100%;\n height: 100%;\n border-radius: 50%;\n border: solid 1px ".concat(props.theme.colors.neutral.neutral2,";\n transform: translate(-50%, -50%);\n }\n "),!props.isTheSameDate&&(props.isInTheRange||props.isEndDateOfRange||props.isStartDateOfRange)&&"\n \n &:before {\n content: '';\n position: absolute;\n top: 50%;\n left: 50%;\n width: 100%;\n height: 96%;\n border-radius: ".concat(props.isStartDateOfRange?"50% 0 0 50% !important":props.isEndDateOfRange?"0 50% 50% 0 !important":props.isFirstDayOfMonth?"4px 0 0 4px":props.isLastDayOfMonth?"0 4px 4px 0":"0",";\n \n background-color: ").concat(props.isPrevNextMonth||props.disabled?"transparent":(0,_colorCheck.parseHexColorToRgba)((0,_getColorValue.getColorValue)(props.theme.colorSelected,props.theme),.1),"; \n\n transform: translate(-50%, -50%);\n }\n "),!props.isSelected&&!props.isEndDateOfRange&&props.theme.colors.neutral.neutral1,("true"!==props["aria-selected"]||props.isStartDateOfRange||props.isFirstDayOfMonth||props.isSelected||props.isLastDayOfMonth)&&"\n &.is-hover {\n &:before {\n content: '';\n position: absolute;\n top: 50%;\n left: 50%;\n width: 100%;\n border-radius: ".concat(props.isStartDateOfRange?"50% 0 0 50% !important":props.isEndDateOfRange?"50%":props.isFirstDayOfMonth?"4px 0 0 4px":props.isLastDayOfMonth?"0 4px 4px 0":"0",";\n height: 96%;\n background-color: ").concat(!props.isPrevNextMonth&&!props.disabled&&(0,_colorCheck.parseHexColorToRgba)((0,_getColorValue.getColorValue)(props.theme.colorSelected,props.theme),.1),"; \n transform: translate(-50%, -50%);\n }\n }\n }"))});exports.DatePickerTableCell=DatePickerTableCell;var DatePickerTableCellSpan=_styled.default.span(_templateObject10||(_templateObject10=_taggedTemplateLiteral(["\n position: relative;\n z-index: ",";\n"])),function(props){return props.theme.zIndex.level24});exports.DatePickerTableCellSpan=DatePickerTableCellSpan;var DateYearPickerContainer=_styled.default.div(_templateObject11||(_templateObject11=_taggedTemplateLiteral(["\n width: 100%;\n height: 100%;\n"])));exports.DateYearPickerContainer=DateYearPickerContainer;var DateYearPickerBody=_styled.default.div(_templateObject12||(_templateObject12=_taggedTemplateLiteral(["\n display: grid;\n grid-template-columns: repeat(4, 1fr);\n"])));exports.DateYearPickerBody=DateYearPickerBody;var DateYearPickerCell=_styled.default.div(_templateObject13||(_templateObject13=_taggedTemplateLiteral(["\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 0.75rem 0;\n font-family: inherit;\n font-size: 0.875rem;\n font-weight: 500;\n cursor: pointer;\n border-radius: 4px;\n color: ",";\n pointer-events: ",";\n transition: background 150ms ease;\n\n ",";\n\n &:hover {\n background-color: ",";\n }\n"])),function(_ref11){var isSelected=_ref11.isSelected,theme=_ref11.theme,disabled=_ref11.disabled;return isSelected?theme.colors.neutral.white:disabled?theme.colors.neutral.neutral2:theme.colors.neutral.black},function(_ref12){var disabled=_ref12.disabled;return disabled&&"none"},function(props){return props.isSelected&&"\n background-color: ".concat((0,_getColorValue.getColorValue)(props.theme.colorSelected,props.theme),";\n color: white;\n ")},function(props){return!props.isSelected&&props.theme.colors.neutral.neutral1});exports.DateYearPickerCell=DateYearPickerCell;
|
|
4
|
+
var DatePickerContentContainer=_styled.default.div(function(_ref){var theme=_ref.theme,fullSize=_ref.fullSize;return(0,_react.css)(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n display: flex;\n justify-content: center;\n\n width: ",";\n height: ",";\n\n max-width: ",";\n min-width: ",";\n\n gap: 20px;\n padding: 24px 18px;\n border-radius: 8px;\n background-color: ",";\n box-shadow: ",";\n\n @media (max-width: 750px) {\n flex-wrap: wrap;\n }\n\n & > div {\n width: ",";\n }\n "])),fullSize?"100%":"unset",fullSize?"100%":"378px",fullSize?"unset":"fit-content",fullSize?"290px":"unset",theme.colors.neutral.white,"0px 16px 32px ".concat(theme.shadow.level3),fullSize?"100%":"290px")});exports.DatePickerContentContainer=DatePickerContentContainer;var DatePickerContainer=_styled.default.div(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n\n ",";\n"])),function(_ref2){var fullSize=_ref2.fullSize;return fullSize&&"\n height: 100%;\n gap: 2.5%;\n "});exports.DatePickerContainer=DatePickerContainer;var DatePickerHeader=_styled.default.div(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 15px;\n width: 100%;\n min-width: ",";\n"])),function(_ref3){var fullSize=_ref3.fullSize;return fullSize?"320px":"unset"});exports.DatePickerHeader=DatePickerHeader;var DatePickerHeaderTitle=_styled.default.div(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n font-family: inherit;\n font-size: 0.875rem;\n font-weight: 600;\n gap: 0.875rem;\n line-height: 1rem;\n\n color: ",";\n\n ","\n\n user-select: none;\n"])),function(_ref4){var colors=_ref4.theme.colors;return colors.neutral.black},function(props){return props.enableYearPicker&&"\n cursor: pointer;\n "});exports.DatePickerHeaderTitle=DatePickerHeaderTitle;var DatePickerHeaderButton=_styled.default.button(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["\n color: ",";\n cursor: pointer;\n border: none;\n outline: 0;\n background-color: transparent;\n\n ","\n\n & svg {\n stroke-width: 10px;\n }\n"])),function(_ref5){var colors=_ref5.theme.colors;return colors.neutral.neutral5},function(_ref6){var isHidden=_ref6.isHidden;return isHidden&&"\n visibility: hidden;\n pointer-events: none;\n "});exports.DatePickerHeaderButton=DatePickerHeaderButton;var DatePickerBody=_styled.default.div(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["\n width: 100%;\n min-width: ",";\n\n height: ",";\n"])),function(_ref7){var fullSize=_ref7.fullSize;return fullSize?"320px":"unset"},function(_ref8){var fullSize=_ref8.fullSize;return fullSize?"100%":"unset"});exports.DatePickerBody=DatePickerBody;var DatePickerBodyTable=_styled.default.table(function(_ref9){var theme=_ref9.theme,fullSize=_ref9.fullSize;return(0,_react.css)(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["\n width: 100%;\n border-collapse: collapse;\n border-spacing: 10px;\n table-layout: fixed;\n\n ",";\n\n & thead tr th {\n padding: 0.75rem;\n font-family: inherit;\n font-size: 0.75rem;\n font-weight: 500;\n color: ",";\n user-select: none;\n }\n\n & tbody {\n ","\n }\n\n & thead tr {\n ","\n }\n "])),fullSize&&"\n display: flex;\n flex-direction: column;\n height: 100%;\n gap: 5%;\n ",theme.colors.neutral.black,fullSize&&"\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n height: 100%;\n ",fullSize&&"\n display: flex;\n justify-content: space-between;\n\n th {\n width: 100%;\n max-width: 50px;\n aspect-ratio: 1 / 1;\n display: flex;\n justify-content: center;\n align-items: center;\n font-size: 0.875rem;\n }\n ")});exports.DatePickerBodyTable=DatePickerBodyTable;var DatePickerTableRow=_styled.default.tr(_templateObject8||(_templateObject8=_taggedTemplateLiteral(["\n ",";\n\n ",";\n"])),function(_ref10){var fullSize=_ref10.fullSize;return fullSize&&"\n display: flex;\n width: 100%;\n min-width: 320px;\n justify-content: space-between;\n "},function(props){return props.isRange&&"\n & td:first-of-type:before {\n border-top-left-radius: 4px;\n border-bottom-left-radius: 4px;\n }\n\n & td:last-of-type:before {\n border-top-right-radius: 4px;\n border-bottom-right-radius: 4px;\n }\n "});exports.DatePickerTableRow=DatePickerTableRow;var DatePickerTableCell=_styled.default.td(function(props){return(0,_react.css)(_templateObject9||(_templateObject9=_taggedTemplateLiteral(["\n position: relative;\n height: 0;\n padding: 12px;\n text-align: center;\n font-family: inherit;\n font-size: ",";\n max-width: ",";\n aspect-ratio: ",";\n font-weight: 600;\n border-radius: 50%;\n cursor: pointer;\n background-color: ",";\n\n color: ",";\n\n user-select: none;\n\n transition: background 150ms ease;\n\n ","\n\n ","\n\n ","\n\n ","\n\n &:hover {\n background-color: ",";\n }\n\n ","\n\n &.is-current[aria-selected='false']:before {\n border-radius: 0 50% 50% 0 !important;\n }\n\n &.is-current[aria-selected='true']:before {\n display: none;\n }\n "])),props.fullSize?"100%":"0.75rem",props.fullSize?"50px":"unset",props.fullSize?"1 / 1":"unset",!props.isPrevNextMonth&&!props.disabled&&props.showSelectedDate&&(props.isSelected||props.isEndDateOfRange)?(0,_getColorValue.getColorValue)(props.theme.colorSelected,props.theme):"transparent",props.isPrevNextMonth?props.theme.colors.neutral.neutral2:props.isSelected||props.isEndDateOfRange?props.showSelectedDate?props.theme.lightColors.neutral.white:props.theme.colors.neutral.black:props["aria-selected"]?(0,_getColorValue.getColorValue)(props.theme.colorSelected,props.theme):props.theme.colors.neutral.black,props.fullSize&&"\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n\n ",props.disabled&&"\n pointer-events: none;\n cursor: default;\n color: ".concat(props.theme.colors.neutral.neutral1,";\n "),props.isToday&&!props.isSelected&&!props.isEndDateOfRange&&"\n &:after {\n content: '';\n position: absolute;\n top: 50%;\n left: 50%;\n width: 100%;\n height: 100%;\n border-radius: 50%;\n border: solid 1px ".concat(props.theme.colors.neutral.neutral2,";\n transform: translate(-50%, -50%);\n }\n "),!props.isTheSameDate&&(props.isInTheRange||props.isEndDateOfRange||props.isStartDateOfRange)&&"\n \n &:before {\n content: '';\n position: absolute;\n top: 50%;\n left: 50%;\n width: 100%;\n height: 96%;\n border-radius: ".concat(props.isStartDateOfRange?"50% 0 0 50% !important":props.isEndDateOfRange?"0 50% 50% 0 !important":props.isFirstDayOfMonth?"4px 0 0 4px":props.isLastDayOfMonth?"0 4px 4px 0":"0",";\n \n background-color: ").concat(props.isPrevNextMonth||props.disabled?"transparent":(0,_colorCheck.parseHexColorToRgba)((0,_getColorValue.getColorValue)(props.theme.colorSelected,props.theme),.1),"; \n\n transform: translate(-50%, -50%);\n }\n "),!props.isSelected&&!props.isEndDateOfRange&&props.theme.colors.neutral.neutral2,("true"!==props["aria-selected"]||props.isStartDateOfRange||props.isFirstDayOfMonth||props.isSelected||props.isLastDayOfMonth)&&"\n &.is-hover {\n &:before {\n content: '';\n position: absolute;\n top: 50%;\n left: 50%;\n width: 100%;\n border-radius: ".concat(props.isStartDateOfRange?"50% 0 0 50% !important":props.isEndDateOfRange?"50%":props.isFirstDayOfMonth?"4px 0 0 4px":props.isLastDayOfMonth?"0 4px 4px 0":"0",";\n height: 96%;\n background-color: ").concat(!props.isPrevNextMonth&&!props.disabled&&(0,_colorCheck.parseHexColorToRgba)((0,_getColorValue.getColorValue)(props.theme.colorSelected,props.theme),.1),"; \n transform: translate(-50%, -50%);\n }\n }\n }"))});exports.DatePickerTableCell=DatePickerTableCell;var DatePickerTableCellSpan=_styled.default.span(_templateObject10||(_templateObject10=_taggedTemplateLiteral(["\n position: relative;\n z-index: ",";\n"])),function(props){return props.theme.zIndex.level24});exports.DatePickerTableCellSpan=DatePickerTableCellSpan;var DateYearPickerContainer=_styled.default.div(_templateObject11||(_templateObject11=_taggedTemplateLiteral(["\n width: 100%;\n height: 100%;\n"])));exports.DateYearPickerContainer=DateYearPickerContainer;var DateYearPickerBody=_styled.default.div(_templateObject12||(_templateObject12=_taggedTemplateLiteral(["\n display: grid;\n grid-template-columns: repeat(4, 1fr);\n"])));exports.DateYearPickerBody=DateYearPickerBody;var DateYearPickerCell=_styled.default.div(_templateObject13||(_templateObject13=_taggedTemplateLiteral(["\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 0.75rem 0;\n font-family: inherit;\n font-size: 0.875rem;\n font-weight: 500;\n cursor: pointer;\n border-radius: 4px;\n color: ",";\n pointer-events: ",";\n transition: background 150ms ease;\n\n ",";\n\n &:hover {\n background-color: ",";\n }\n"])),function(_ref11){var isSelected=_ref11.isSelected,theme=_ref11.theme,disabled=_ref11.disabled;return isSelected?theme.colors.neutral.white:disabled?theme.colors.neutral.neutral2:theme.colors.neutral.black},function(_ref12){var disabled=_ref12.disabled;return disabled&&"none"},function(props){return props.isSelected&&"\n background-color: ".concat((0,_getColorValue.getColorValue)(props.theme.colorSelected,props.theme),";\n color: white;\n ")},function(props){return!props.isSelected&&props.theme.colors.neutral.neutral1});exports.DateYearPickerCell=DateYearPickerCell;
|