@chayns-components/date 5.0.0-beta.1000

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.
Files changed (173) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +34 -0
  3. package/lib/cjs/components/calendar/Calendar.js +314 -0
  4. package/lib/cjs/components/calendar/Calendar.js.map +1 -0
  5. package/lib/cjs/components/calendar/Calendar.styles.js +34 -0
  6. package/lib/cjs/components/calendar/Calendar.styles.js.map +1 -0
  7. package/lib/cjs/components/calendar/month-wrapper/MonthWrapper.js +158 -0
  8. package/lib/cjs/components/calendar/month-wrapper/MonthWrapper.js.map +1 -0
  9. package/lib/cjs/components/calendar/month-wrapper/MonthWrapper.styles.js +23 -0
  10. package/lib/cjs/components/calendar/month-wrapper/MonthWrapper.styles.js.map +1 -0
  11. package/lib/cjs/components/calendar/month-wrapper/month/Month.js +65 -0
  12. package/lib/cjs/components/calendar/month-wrapper/month/Month.js.map +1 -0
  13. package/lib/cjs/components/calendar/month-wrapper/month/Month.styles.js +26 -0
  14. package/lib/cjs/components/calendar/month-wrapper/month/Month.styles.js.map +1 -0
  15. package/lib/cjs/components/calendar/month-wrapper/month/day-wrapper/DayWrapper.js +129 -0
  16. package/lib/cjs/components/calendar/month-wrapper/month/day-wrapper/DayWrapper.js.map +1 -0
  17. package/lib/cjs/components/calendar/month-wrapper/month/day-wrapper/DayWrapper.styles.js +16 -0
  18. package/lib/cjs/components/calendar/month-wrapper/month/day-wrapper/DayWrapper.styles.js.map +1 -0
  19. package/lib/cjs/components/calendar/month-wrapper/month/day-wrapper/day/Day.js +63 -0
  20. package/lib/cjs/components/calendar/month-wrapper/month/day-wrapper/day/Day.js.map +1 -0
  21. package/lib/cjs/components/calendar/month-wrapper/month/day-wrapper/day/Day.styles.js +114 -0
  22. package/lib/cjs/components/calendar/month-wrapper/month/day-wrapper/day/Day.styles.js.map +1 -0
  23. package/lib/cjs/components/calendar/month-wrapper/month/day-wrapper/day/category/Category.js +17 -0
  24. package/lib/cjs/components/calendar/month-wrapper/month/day-wrapper/day/category/Category.js.map +1 -0
  25. package/lib/cjs/components/calendar/month-wrapper/month/day-wrapper/day/category/Category.styles.js +18 -0
  26. package/lib/cjs/components/calendar/month-wrapper/month/day-wrapper/day/category/Category.styles.js.map +1 -0
  27. package/lib/cjs/components/calendar/month-wrapper/month/weekday-wrapper/WeekdayWrapper.js +42 -0
  28. package/lib/cjs/components/calendar/month-wrapper/month/weekday-wrapper/WeekdayWrapper.js.map +1 -0
  29. package/lib/cjs/components/calendar/month-wrapper/month/weekday-wrapper/WeekdayWrapper.styles.js +16 -0
  30. package/lib/cjs/components/calendar/month-wrapper/month/weekday-wrapper/WeekdayWrapper.styles.js.map +1 -0
  31. package/lib/cjs/components/calendar/month-wrapper/month/weekday-wrapper/weekday/Weekday.js +15 -0
  32. package/lib/cjs/components/calendar/month-wrapper/month/weekday-wrapper/weekday/Weekday.js.map +1 -0
  33. package/lib/cjs/components/calendar/month-wrapper/month/weekday-wrapper/weekday/Weekday.styles.js +17 -0
  34. package/lib/cjs/components/calendar/month-wrapper/month/weekday-wrapper/weekday/Weekday.styles.js.map +1 -0
  35. package/lib/cjs/components/calendar/month-year-pickers/MonthYearPickers.js +86 -0
  36. package/lib/cjs/components/calendar/month-year-pickers/MonthYearPickers.js.map +1 -0
  37. package/lib/cjs/components/date-info/DateInfo.js +35 -0
  38. package/lib/cjs/components/date-info/DateInfo.js.map +1 -0
  39. package/lib/cjs/components/opening-times/OpeningTimes.js +246 -0
  40. package/lib/cjs/components/opening-times/OpeningTimes.js.map +1 -0
  41. package/lib/cjs/components/opening-times/OpeningTimes.styles.js +28 -0
  42. package/lib/cjs/components/opening-times/OpeningTimes.styles.js.map +1 -0
  43. package/lib/cjs/components/opening-times/hint-text/HintText.js +19 -0
  44. package/lib/cjs/components/opening-times/hint-text/HintText.js.map +1 -0
  45. package/lib/cjs/components/opening-times/hint-text/HintText.styles.js +24 -0
  46. package/lib/cjs/components/opening-times/hint-text/HintText.styles.js.map +1 -0
  47. package/lib/cjs/components/opening-times/opening-inputs/OpeningInputs.js +153 -0
  48. package/lib/cjs/components/opening-times/opening-inputs/OpeningInputs.js.map +1 -0
  49. package/lib/cjs/components/opening-times/opening-inputs/OpeningInputs.styles.js +24 -0
  50. package/lib/cjs/components/opening-times/opening-inputs/OpeningInputs.styles.js.map +1 -0
  51. package/lib/cjs/components/opening-times/opening-inputs/opening-input/OpeningInput.js +106 -0
  52. package/lib/cjs/components/opening-times/opening-inputs/opening-input/OpeningInput.js.map +1 -0
  53. package/lib/cjs/components/opening-times/opening-inputs/opening-input/OpeningInput.styles.js +41 -0
  54. package/lib/cjs/components/opening-times/opening-inputs/opening-input/OpeningInput.styles.js.map +1 -0
  55. package/lib/cjs/hooks/useDateInfo.js +63 -0
  56. package/lib/cjs/hooks/useDateInfo.js.map +1 -0
  57. package/lib/cjs/index.js +177 -0
  58. package/lib/cjs/index.js.map +1 -0
  59. package/lib/cjs/types/calendar.js +28 -0
  60. package/lib/cjs/types/calendar.js.map +1 -0
  61. package/lib/cjs/types/dateinfo.js +2 -0
  62. package/lib/cjs/types/dateinfo.js.map +1 -0
  63. package/lib/cjs/types/openingTimes.js +18 -0
  64. package/lib/cjs/types/openingTimes.js.map +1 -0
  65. package/lib/cjs/utils/calendar.js +73 -0
  66. package/lib/cjs/utils/calendar.js.map +1 -0
  67. package/lib/cjs/utils/date.js +114 -0
  68. package/lib/cjs/utils/date.js.map +1 -0
  69. package/lib/cjs/utils/dateInfo.js +126 -0
  70. package/lib/cjs/utils/dateInfo.js.map +1 -0
  71. package/lib/esm/components/calendar/Calendar.js +306 -0
  72. package/lib/esm/components/calendar/Calendar.js.map +1 -0
  73. package/lib/esm/components/calendar/Calendar.styles.js +33 -0
  74. package/lib/esm/components/calendar/Calendar.styles.js.map +1 -0
  75. package/lib/esm/components/calendar/month-wrapper/MonthWrapper.js +150 -0
  76. package/lib/esm/components/calendar/month-wrapper/MonthWrapper.js.map +1 -0
  77. package/lib/esm/components/calendar/month-wrapper/MonthWrapper.styles.js +22 -0
  78. package/lib/esm/components/calendar/month-wrapper/MonthWrapper.styles.js.map +1 -0
  79. package/lib/esm/components/calendar/month-wrapper/month/Month.js +61 -0
  80. package/lib/esm/components/calendar/month-wrapper/month/Month.js.map +1 -0
  81. package/lib/esm/components/calendar/month-wrapper/month/Month.styles.js +22 -0
  82. package/lib/esm/components/calendar/month-wrapper/month/Month.styles.js.map +1 -0
  83. package/lib/esm/components/calendar/month-wrapper/month/day-wrapper/DayWrapper.js +121 -0
  84. package/lib/esm/components/calendar/month-wrapper/month/day-wrapper/DayWrapper.js.map +1 -0
  85. package/lib/esm/components/calendar/month-wrapper/month/day-wrapper/DayWrapper.styles.js +9 -0
  86. package/lib/esm/components/calendar/month-wrapper/month/day-wrapper/DayWrapper.styles.js.map +1 -0
  87. package/lib/esm/components/calendar/month-wrapper/month/day-wrapper/day/Day.js +54 -0
  88. package/lib/esm/components/calendar/month-wrapper/month/day-wrapper/day/Day.js.map +1 -0
  89. package/lib/esm/components/calendar/month-wrapper/month/day-wrapper/day/Day.styles.js +123 -0
  90. package/lib/esm/components/calendar/month-wrapper/month/day-wrapper/day/Day.styles.js.map +1 -0
  91. package/lib/esm/components/calendar/month-wrapper/month/day-wrapper/day/category/Category.js +13 -0
  92. package/lib/esm/components/calendar/month-wrapper/month/day-wrapper/day/category/Category.js.map +1 -0
  93. package/lib/esm/components/calendar/month-wrapper/month/day-wrapper/day/category/Category.styles.js +14 -0
  94. package/lib/esm/components/calendar/month-wrapper/month/day-wrapper/day/category/Category.styles.js.map +1 -0
  95. package/lib/esm/components/calendar/month-wrapper/month/weekday-wrapper/WeekdayWrapper.js +34 -0
  96. package/lib/esm/components/calendar/month-wrapper/month/weekday-wrapper/WeekdayWrapper.js.map +1 -0
  97. package/lib/esm/components/calendar/month-wrapper/month/weekday-wrapper/WeekdayWrapper.styles.js +9 -0
  98. package/lib/esm/components/calendar/month-wrapper/month/weekday-wrapper/WeekdayWrapper.styles.js.map +1 -0
  99. package/lib/esm/components/calendar/month-wrapper/month/weekday-wrapper/weekday/Weekday.js +11 -0
  100. package/lib/esm/components/calendar/month-wrapper/month/weekday-wrapper/weekday/Weekday.js.map +1 -0
  101. package/lib/esm/components/calendar/month-wrapper/month/weekday-wrapper/weekday/Weekday.styles.js +13 -0
  102. package/lib/esm/components/calendar/month-wrapper/month/weekday-wrapper/weekday/Weekday.styles.js.map +1 -0
  103. package/lib/esm/components/calendar/month-year-pickers/MonthYearPickers.js +79 -0
  104. package/lib/esm/components/calendar/month-year-pickers/MonthYearPickers.js.map +1 -0
  105. package/lib/esm/components/date-info/DateInfo.js +28 -0
  106. package/lib/esm/components/date-info/DateInfo.js.map +1 -0
  107. package/lib/esm/components/opening-times/OpeningTimes.js +240 -0
  108. package/lib/esm/components/opening-times/OpeningTimes.js.map +1 -0
  109. package/lib/esm/components/opening-times/OpeningTimes.styles.js +24 -0
  110. package/lib/esm/components/opening-times/OpeningTimes.styles.js.map +1 -0
  111. package/lib/esm/components/opening-times/hint-text/HintText.js +12 -0
  112. package/lib/esm/components/opening-times/hint-text/HintText.js.map +1 -0
  113. package/lib/esm/components/opening-times/hint-text/HintText.styles.js +23 -0
  114. package/lib/esm/components/opening-times/hint-text/HintText.styles.js.map +1 -0
  115. package/lib/esm/components/opening-times/opening-inputs/OpeningInputs.js +149 -0
  116. package/lib/esm/components/opening-times/opening-inputs/OpeningInputs.js.map +1 -0
  117. package/lib/esm/components/opening-times/opening-inputs/OpeningInputs.styles.js +22 -0
  118. package/lib/esm/components/opening-times/opening-inputs/OpeningInputs.styles.js.map +1 -0
  119. package/lib/esm/components/opening-times/opening-inputs/opening-input/OpeningInput.js +99 -0
  120. package/lib/esm/components/opening-times/opening-inputs/opening-input/OpeningInput.js.map +1 -0
  121. package/lib/esm/components/opening-times/opening-inputs/opening-input/OpeningInput.styles.js +40 -0
  122. package/lib/esm/components/opening-times/opening-inputs/opening-input/OpeningInput.styles.js.map +1 -0
  123. package/lib/esm/hooks/useDateInfo.js +57 -0
  124. package/lib/esm/hooks/useDateInfo.js.map +1 -0
  125. package/lib/esm/index.js +15 -0
  126. package/lib/esm/index.js.map +1 -0
  127. package/lib/esm/types/calendar.js +22 -0
  128. package/lib/esm/types/calendar.js.map +1 -0
  129. package/lib/esm/types/dateinfo.js +2 -0
  130. package/lib/esm/types/dateinfo.js.map +1 -0
  131. package/lib/esm/types/openingTimes.js +12 -0
  132. package/lib/esm/types/openingTimes.js.map +1 -0
  133. package/lib/esm/utils/calendar.js +63 -0
  134. package/lib/esm/utils/calendar.js.map +1 -0
  135. package/lib/esm/utils/date.js +89 -0
  136. package/lib/esm/utils/date.js.map +1 -0
  137. package/lib/esm/utils/dateInfo.js +120 -0
  138. package/lib/esm/utils/dateInfo.js.map +1 -0
  139. package/lib/types/components/calendar/Calendar.d.ts +97 -0
  140. package/lib/types/components/calendar/Calendar.styles.d.ts +8 -0
  141. package/lib/types/components/calendar/month-wrapper/MonthWrapper.d.ts +26 -0
  142. package/lib/types/components/calendar/month-wrapper/MonthWrapper.styles.d.ts +274 -0
  143. package/lib/types/components/calendar/month-wrapper/month/Month.d.ts +26 -0
  144. package/lib/types/components/calendar/month-wrapper/month/Month.styles.d.ts +8 -0
  145. package/lib/types/components/calendar/month-wrapper/month/day-wrapper/DayWrapper.d.ts +20 -0
  146. package/lib/types/components/calendar/month-wrapper/month/day-wrapper/DayWrapper.styles.d.ts +1 -0
  147. package/lib/types/components/calendar/month-wrapper/month/day-wrapper/day/Day.d.ts +19 -0
  148. package/lib/types/components/calendar/month-wrapper/month/day-wrapper/day/Day.styles.d.ts +20 -0
  149. package/lib/types/components/calendar/month-wrapper/month/day-wrapper/day/category/Category.d.ts +6 -0
  150. package/lib/types/components/calendar/month-wrapper/month/day-wrapper/day/category/Category.styles.d.ts +7 -0
  151. package/lib/types/components/calendar/month-wrapper/month/weekday-wrapper/WeekdayWrapper.d.ts +7 -0
  152. package/lib/types/components/calendar/month-wrapper/month/weekday-wrapper/WeekdayWrapper.styles.d.ts +1 -0
  153. package/lib/types/components/calendar/month-wrapper/month/weekday-wrapper/weekday/Weekday.d.ts +6 -0
  154. package/lib/types/components/calendar/month-wrapper/month/weekday-wrapper/weekday/Weekday.styles.d.ts +3 -0
  155. package/lib/types/components/calendar/month-year-pickers/MonthYearPickers.d.ts +19 -0
  156. package/lib/types/components/date-info/DateInfo.d.ts +5 -0
  157. package/lib/types/components/opening-times/OpeningTimes.d.ts +51 -0
  158. package/lib/types/components/opening-times/OpeningTimes.styles.d.ts +11 -0
  159. package/lib/types/components/opening-times/hint-text/HintText.d.ts +6 -0
  160. package/lib/types/components/opening-times/hint-text/HintText.styles.d.ts +3 -0
  161. package/lib/types/components/opening-times/opening-inputs/OpeningInputs.d.ts +46 -0
  162. package/lib/types/components/opening-times/opening-inputs/OpeningInputs.styles.d.ts +272 -0
  163. package/lib/types/components/opening-times/opening-inputs/opening-input/OpeningInput.d.ts +15 -0
  164. package/lib/types/components/opening-times/opening-inputs/opening-input/OpeningInput.styles.d.ts +273 -0
  165. package/lib/types/hooks/useDateInfo.d.ts +2 -0
  166. package/lib/types/index.d.ts +10 -0
  167. package/lib/types/types/calendar.d.ts +55 -0
  168. package/lib/types/types/dateinfo.d.ts +34 -0
  169. package/lib/types/types/openingTimes.d.ts +33 -0
  170. package/lib/types/utils/calendar.d.ts +18 -0
  171. package/lib/types/utils/date.d.ts +27 -0
  172. package/lib/types/utils/dateInfo.d.ts +14 -0
  173. package/package.json +86 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MonthWrapper.js","names":["_react","_interopRequireWildcard","require","_calendar","_Month","_interopRequireDefault","_MonthWrapper","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","MonthWrapper","locale","currentDate","highlightedDates","selectedDate","onSelect","categories","direction","onAnimationFinished","shouldRenderTwo","width","customThumbColors","isDisabled","minDate","maxDate","shouldShowHighlightsInMonthOverlay","type","disabledDates","setCurrentDate","showMonthYearPickers","content","setContent","useState","hoveringDay","setHoveringDay","monthHeight","useMemo","useEffect","items","date","getNewDate","month","year","getMonthAndYear","push","createElement","height","key","displayIndex","prevState","map","element","index","props","animate","x","StyledMonthWrapper","$height","$width","StyledMotionWrapper","$isDisabled","transition","duration","onAnimationComplete","displayName","_default","exports"],"sources":["../../../../../src/components/calendar/month-wrapper/MonthWrapper.tsx"],"sourcesContent":["import type { MotionProps } from 'framer-motion';\nimport React, { FC, useEffect, useMemo, useState, type ReactElement } from 'react';\nimport {\n CalendarType,\n Categories, CustomThumbColors,\n DateInterval,\n HighlightedDates,\n} from '../../../types/calendar';\nimport { getMonthAndYear, getNewDate } from '../../../utils/calendar';\nimport Month from './month/Month';\nimport { StyledMonthWrapper, StyledMotionWrapper } from './MonthWrapper.styles';\nimport {Language} from \"chayns-api\";\n\nexport type MonthWrapperProps = {\n locale: Language;\n highlightedDates?: HighlightedDates[];\n onSelect: (date: Date) => void;\n selectedDate?: Date | Date[] | DateInterval;\n categories?: Categories[];\n currentDate: Date;\n direction?: 'left' | 'right';\n onAnimationFinished: () => void;\n shouldRenderTwo: boolean;\n width: number;\n isDisabled?: boolean;\n maxDate: Date;\n minDate: Date;\n type: CalendarType;\n disabledDates: Date[];\n setCurrentDate: (date: Date) => void;\n shouldShowHighlightsInMonthOverlay: boolean;\n showMonthYearPickers: boolean;\n customThumbColors?: CustomThumbColors;\n};\n\nconst MonthWrapper: FC<MonthWrapperProps> = ({\n locale,\n currentDate,\n highlightedDates,\n selectedDate,\n onSelect,\n categories,\n direction,\n onAnimationFinished,\n shouldRenderTwo,\n width,customThumbColors,\n isDisabled,\n minDate,\n maxDate,\n shouldShowHighlightsInMonthOverlay,\n type,\n disabledDates,\n setCurrentDate,\n showMonthYearPickers,\n}) => {\n const [content, setContent] = useState<ReactElement[]>();\n\n const [hoveringDay, setHoveringDay] = useState<Date | null>(null);\n\n const monthHeight = useMemo(() => width / (shouldRenderTwo ? 2 : 1), [width, shouldRenderTwo]);\n\n useEffect(() => {\n setContent(() => {\n // Initial render of months\n const items: ReactElement[] = [];\n\n for (let i = -1; i < 3; i++) {\n const date = getNewDate(i, currentDate);\n\n const { month, year } = getMonthAndYear(date);\n\n items.push(\n <Month\n height={monthHeight}\n key={`${month}-${year}`}\n month={month}\n year={year}\n locale={locale}\n onSelect={onSelect}\n highlightedDates={highlightedDates}\n shouldShowHighlightsInMonthOverlay={shouldShowHighlightsInMonthOverlay}\n categories={categories}\n selectedDate={selectedDate}\n minDate={minDate}\n maxDate={maxDate}\n type={type}\n customThumbColors={customThumbColors}\n hoveringDay={hoveringDay}\n setHoveringDay={setHoveringDay}\n disabledDates={disabledDates}\n setCurrentDate={setCurrentDate}\n displayIndex={i}\n showMonthYearPickers={showMonthYearPickers}\n />,\n );\n }\n\n return items;\n });\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [monthHeight]);\n\n useEffect(() => {\n // Doesn't update props until animation is completed\n if (direction) return;\n\n setContent((prevState) =>\n (prevState ?? []).map((element, index) => {\n const date = getNewDate(index - 1, currentDate);\n\n const { month, year } = getMonthAndYear(date);\n\n return {\n ...element,\n props: {\n ...element.props,\n categories,\n disabledDates,\n displayIndex: index - 1,\n highlightedDates,\n hoveringDay,\n locale,\n onSelect,\n shouldShowHighlightsInMonthOverlay,\n maxDate,\n minDate,\n month,\n customThumbColors,\n selectedDate,\n setCurrentDate,\n setHoveringDay,\n showMonthYearPickers,\n type,\n year,\n } as ReactElement,\n };\n }),\n );\n }, [\n customThumbColors,\n categories,\n currentDate,\n direction,\n disabledDates,\n highlightedDates,\n hoveringDay,\n locale,\n onAnimationFinished,\n onSelect,\n maxDate,\n minDate,\n selectedDate,\n setCurrentDate,\n setHoveringDay,\n showMonthYearPickers,\n type,\n shouldShowHighlightsInMonthOverlay,\n ]);\n\n const animate: MotionProps['animate'] = useMemo(() => {\n if (shouldRenderTwo) {\n switch (true) {\n case direction === 'left':\n return { x: '0%' };\n case direction === 'right':\n return { x: '-100%' };\n default:\n return { x: '-50%' };\n }\n } else {\n switch (true) {\n case direction === 'left':\n return { x: '0%' };\n case direction === 'right':\n return { x: '-200%' };\n default:\n return { x: '-100%' };\n }\n }\n }, [direction, shouldRenderTwo]);\n\n return (\n <StyledMonthWrapper $height={monthHeight} $width={width}>\n <StyledMotionWrapper\n animate={animate}\n $isDisabled={isDisabled}\n transition={{\n type: 'tween',\n duration: !direction ? 0 : 0.2,\n }}\n onAnimationComplete={onAnimationFinished}\n >\n {content}\n </StyledMotionWrapper>\n </StyledMonthWrapper>\n );\n};\n\nMonthWrapper.displayName = 'MonthWrapper';\n\nexport default MonthWrapper;\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAOA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AAAgF,SAAAG,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,yBAAAH,CAAA,6BAAAI,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAD,wBAAA,YAAAA,CAAAH,CAAA,WAAAA,CAAA,GAAAM,CAAA,GAAAD,CAAA,KAAAL,CAAA;AAAA,SAAAN,wBAAAM,CAAA,EAAAK,CAAA,SAAAA,CAAA,IAAAL,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAE,OAAA,EAAAF,CAAA,QAAAM,CAAA,GAAAH,wBAAA,CAAAE,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAC,GAAA,CAAAP,CAAA,UAAAM,CAAA,CAAAE,GAAA,CAAAR,CAAA,OAAAS,CAAA,KAAAC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C;QACtB,KAAKtC,SAAS,KAAK,OAAO;UACtB,OAAO;YAAEsC,CAAC,EAAE;UAAQ,CAAC;QACzB;UACI,OAAO;YAAEA,CAAC,EAAE;UAAQ,CAAC;MAC7B;IACJ;EACJ,CAAC,EAAE,CAACtC,SAAS,EAAEE,eAAe,CAAC,CAAC;EAEhC,oBACIpC,MAAA,CAAAS,OAAA,CAAAqD,aAAA,CAACxD,aAAA,CAAAmE,kBAAkB;IAACC,OAAO,EAAEtB,WAAY;IAACuB,MAAM,EAAEtC;EAAM,gBACpDrC,MAAA,CAAAS,OAAA,CAAAqD,aAAA,CAACxD,aAAA,CAAAsE,mBAAmB;IAChBL,OAAO,EAAEA,OAAQ;IACjBM,WAAW,EAAEtC,UAAW;IACxBuC,UAAU,EAAE;MACRnC,IAAI,EAAE,OAAO;MACboC,QAAQ,EAAE,CAAC7C,SAAS,GAAG,CAAC,GAAG;IAC/B,CAAE;IACF8C,mBAAmB,EAAE7C;EAAoB,GAExCY,OACgB,CACL,CAAC;AAE7B,CAAC;AAEDpB,YAAY,CAACsD,WAAW,GAAG,cAAc;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA1E,OAAA,GAE3BkB,YAAY","ignoreList":[]}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.StyledMotionWrapper = exports.StyledMonthWrapper = void 0;
7
+ var _framerMotion = require("framer-motion");
8
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
+ const StyledMonthWrapper = exports.StyledMonthWrapper = _styledComponents.default.div`
11
+ width: ${({
12
+ $width
13
+ }) => $width}px;
14
+ overflow-x: clip;
15
+ height: ${({
16
+ $height
17
+ }) => $height}px;
18
+ `;
19
+ const StyledMotionWrapper = exports.StyledMotionWrapper = (0, _styledComponents.default)(_framerMotion.motion.div)`
20
+ display: flex;
21
+ height: 100%;
22
+ `;
23
+ //# sourceMappingURL=MonthWrapper.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MonthWrapper.styles.js","names":["_framerMotion","require","_styledComponents","_interopRequireDefault","e","__esModule","default","StyledMonthWrapper","exports","styled","div","$width","$height","StyledMotionWrapper","motion"],"sources":["../../../../../src/components/calendar/month-wrapper/MonthWrapper.styles.ts"],"sourcesContent":["import type { WithTheme } from '@chayns-components/core';\nimport { motion } from 'framer-motion';\nimport styled from 'styled-components';\n\ntype StyledMonthWrapperProps = WithTheme<{ $height: number; $width: number }>;\n\nexport const StyledMonthWrapper = styled.div<StyledMonthWrapperProps>`\n width: ${({ $width }) => $width}px;\n overflow-x: clip;\n height: ${({ $height }) => $height}px;\n`;\n\ntype StyledMotionWrapperProps = { $isDisabled?: boolean };\n\nexport const StyledMotionWrapper = styled(motion.div)<StyledMotionWrapperProps>`\n display: flex;\n height: 100%;\n`;\n"],"mappings":";;;;;;AACA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAAuC,SAAAE,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAIhC,MAAMG,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAGE,yBAAM,CAACC,GAA4B;AACrE,aAAa,CAAC;EAAEC;AAAO,CAAC,KAAKA,MAAM;AACnC;AACA,cAAc,CAAC;EAAEC;AAAQ,CAAC,KAAKA,OAAO;AACtC,CAAC;AAIM,MAAMC,mBAAmB,GAAAL,OAAA,CAAAK,mBAAA,GAAG,IAAAJ,yBAAM,EAACK,oBAAM,CAACJ,GAAG,CAA2B;AAC/E;AACA;AACA,CAAC","ignoreList":[]}
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _MonthYearPickers = _interopRequireDefault(require("../../month-year-pickers/MonthYearPickers"));
9
+ var _DayWrapper = _interopRequireDefault(require("./day-wrapper/DayWrapper"));
10
+ var _Month = require("./Month.styles");
11
+ var _WeekdayWrapper = _interopRequireDefault(require("./weekday-wrapper/WeekdayWrapper"));
12
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
+ const Month = ({
14
+ month,
15
+ year,
16
+ locale,
17
+ highlightedDates,
18
+ selectedDate,
19
+ onSelect,
20
+ categories,
21
+ height,
22
+ minDate,
23
+ maxDate,
24
+ customThumbColors,
25
+ shouldShowHighlightsInMonthOverlay,
26
+ type,
27
+ hoveringDay,
28
+ setHoveringDay,
29
+ disabledDates,
30
+ setCurrentDate,
31
+ displayIndex,
32
+ showMonthYearPickers
33
+ }) => /*#__PURE__*/_react.default.createElement(_Month.StyledMonth, {
34
+ $height: height
35
+ }, /*#__PURE__*/_react.default.createElement(_Month.StyledMonthHead, null, /*#__PURE__*/_react.default.createElement(_MonthYearPickers.default, {
36
+ month: month,
37
+ year: year,
38
+ locale: locale,
39
+ minDate: minDate,
40
+ maxDate: maxDate,
41
+ setCurrentDate: setCurrentDate,
42
+ displayIndex: displayIndex,
43
+ showMonthYearPickers: showMonthYearPickers
44
+ })), /*#__PURE__*/_react.default.createElement(_WeekdayWrapper.default, {
45
+ locale: locale
46
+ }), /*#__PURE__*/_react.default.createElement(_DayWrapper.default, {
47
+ key: `day-wrapper-${month}`,
48
+ categories: categories,
49
+ selectedDate: selectedDate,
50
+ customThumbColors: customThumbColors,
51
+ month: month,
52
+ year: year,
53
+ onSelect: onSelect,
54
+ shouldShowHighlightsInMonthOverlay: shouldShowHighlightsInMonthOverlay,
55
+ highlightedDates: highlightedDates,
56
+ minDate: minDate,
57
+ maxDate: maxDate,
58
+ type: type,
59
+ hoveringDay: hoveringDay,
60
+ setHoveringDay: setHoveringDay,
61
+ disabledDates: disabledDates
62
+ }));
63
+ Month.displayName = 'Month';
64
+ var _default = exports.default = Month;
65
+ //# sourceMappingURL=Month.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Month.js","names":["_react","_interopRequireDefault","require","_MonthYearPickers","_DayWrapper","_Month","_WeekdayWrapper","e","__esModule","default","Month","month","year","locale","highlightedDates","selectedDate","onSelect","categories","height","minDate","maxDate","customThumbColors","shouldShowHighlightsInMonthOverlay","type","hoveringDay","setHoveringDay","disabledDates","setCurrentDate","displayIndex","showMonthYearPickers","createElement","StyledMonth","$height","StyledMonthHead","key","displayName","_default","exports"],"sources":["../../../../../../src/components/calendar/month-wrapper/month/Month.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport {\n CalendarType,\n Categories, CustomThumbColors,\n DateInterval,\n EMonth,\n HighlightedDates,\n} from '../../../../types/calendar';\nimport MonthYearPickers from '../../month-year-pickers/MonthYearPickers';\nimport DayWrapper from './day-wrapper/DayWrapper';\nimport { StyledMonth, StyledMonthHead } from './Month.styles';\nimport WeekdayWrapper from './weekday-wrapper/WeekdayWrapper';\nimport {Language} from \"chayns-api\";\n\nexport type MonthProps = {\n month: EMonth;\n year: number;\n locale: Language;\n highlightedDates?: HighlightedDates[];\n onSelect: (date: Date) => void;\n selectedDate?: Date | Date[] | DateInterval;\n categories?: Categories[];\n height: number;\n minDate: Date;\n maxDate: Date;\n type: CalendarType;\n hoveringDay: Date | null;\n setHoveringDay: (date: Date | null) => void;\n disabledDates: Date[];\n setCurrentDate: (date: Date) => void;\n displayIndex?: number;\n shouldShowHighlightsInMonthOverlay: boolean;\n customThumbColors?: CustomThumbColors;\n showMonthYearPickers: boolean;\n};\n\nconst Month: FC<MonthProps> = ({\n month,\n year,\n locale,\n highlightedDates,\n selectedDate,\n onSelect,\n categories,\n height,\n minDate,\n maxDate,customThumbColors,\n shouldShowHighlightsInMonthOverlay,\n type,\n hoveringDay,\n setHoveringDay,\n disabledDates,\n setCurrentDate,\n displayIndex,\n showMonthYearPickers,\n}) => (\n <StyledMonth $height={height}>\n <StyledMonthHead>\n <MonthYearPickers\n month={month}\n year={year}\n locale={locale}\n minDate={minDate}\n maxDate={maxDate}\n setCurrentDate={setCurrentDate}\n displayIndex={displayIndex}\n showMonthYearPickers={showMonthYearPickers}\n />\n </StyledMonthHead>\n <WeekdayWrapper locale={locale} />\n <DayWrapper\n key={`day-wrapper-${month}`}\n categories={categories}\n selectedDate={selectedDate}\n customThumbColors={customThumbColors}\n month={month}\n year={year}\n onSelect={onSelect}\n shouldShowHighlightsInMonthOverlay={shouldShowHighlightsInMonthOverlay}\n highlightedDates={highlightedDates}\n minDate={minDate}\n maxDate={maxDate}\n type={type}\n hoveringDay={hoveringDay}\n setHoveringDay={setHoveringDay}\n disabledDates={disabledDates}\n />\n </StyledMonth>\n);\n\nMonth.displayName = 'Month';\n\nexport default Month;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAQA,IAAAC,iBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,WAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,eAAA,GAAAL,sBAAA,CAAAC,OAAA;AAA8D,SAAAD,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAyB9D,MAAMG,KAAqB,GAAGA,CAAC;EAC3BC,KAAK;EACLC,IAAI;EACJC,MAAM;EACNC,gBAAgB;EAChBC,YAAY;EACZC,QAAQ;EACRC,UAAU;EACVC,MAAM;EACNC,OAAO;EACPC,OAAO;EAACC,iBAAiB;EACzBC,kCAAkC;EAClCC,IAAI;EACJC,WAAW;EACXC,cAAc;EACdC,aAAa;EACbC,cAAc;EACdC,YAAY;EACZC;AACJ,CAAC,kBACG7B,MAAA,CAAAS,OAAA,CAAAqB,aAAA,CAACzB,MAAA,CAAA0B,WAAW;EAACC,OAAO,EAAEd;AAAO,gBACzBlB,MAAA,CAAAS,OAAA,CAAAqB,aAAA,CAACzB,MAAA,CAAA4B,eAAe,qBACZjC,MAAA,CAAAS,OAAA,CAAAqB,aAAA,CAAC3B,iBAAA,CAAAM,OAAgB;EACbE,KAAK,EAAEA,KAAM;EACbC,IAAI,EAAEA,IAAK;EACXC,MAAM,EAAEA,MAAO;EACfM,OAAO,EAAEA,OAAQ;EACjBC,OAAO,EAAEA,OAAQ;EACjBO,cAAc,EAAEA,cAAe;EAC/BC,YAAY,EAAEA,YAAa;EAC3BC,oBAAoB,EAAEA;AAAqB,CAC9C,CACY,CAAC,eAClB7B,MAAA,CAAAS,OAAA,CAAAqB,aAAA,CAACxB,eAAA,CAAAG,OAAc;EAACI,MAAM,EAAEA;AAAO,CAAE,CAAC,eAClCb,MAAA,CAAAS,OAAA,CAAAqB,aAAA,CAAC1B,WAAA,CAAAK,OAAU;EACPyB,GAAG,EAAE,eAAevB,KAAK,EAAG;EAC5BM,UAAU,EAAEA,UAAW;EACvBF,YAAY,EAAEA,YAAa;EAC3BM,iBAAiB,EAAEA,iBAAkB;EACrCV,KAAK,EAAEA,KAAM;EACbC,IAAI,EAAEA,IAAK;EACXI,QAAQ,EAAEA,QAAS;EACnBM,kCAAkC,EAAEA,kCAAmC;EACvER,gBAAgB,EAAEA,gBAAiB;EACnCK,OAAO,EAAEA,OAAQ;EACjBC,OAAO,EAAEA,OAAQ;EACjBG,IAAI,EAAEA,IAAK;EACXC,WAAW,EAAEA,WAAY;EACzBC,cAAc,EAAEA,cAAe;EAC/BC,aAAa,EAAEA;AAAc,CAChC,CACQ,CAChB;AAEDhB,KAAK,CAACyB,WAAW,GAAG,OAAO;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA5B,OAAA,GAEbC,KAAK","ignoreList":[]}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.StyledMonthName = exports.StyledMonthHead = exports.StyledMonth = void 0;
7
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
+ const StyledMonth = exports.StyledMonth = _styledComponents.default.div`
10
+ height: ${({
11
+ $height
12
+ }) => $height}px;
13
+ aspect-ratio: 1;
14
+ `;
15
+ const StyledMonthHead = exports.StyledMonthHead = _styledComponents.default.div`
16
+ display: flex;
17
+ align-items: center;
18
+ justify-content: center;
19
+ column-gap: 7px;
20
+ `;
21
+ const StyledMonthName = exports.StyledMonthName = _styledComponents.default.div`
22
+ font-weight: bold;
23
+ text-align: center;
24
+ user-select: none;
25
+ `;
26
+ //# sourceMappingURL=Month.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Month.styles.js","names":["_styledComponents","_interopRequireDefault","require","e","__esModule","default","StyledMonth","exports","styled","div","$height","StyledMonthHead","StyledMonthName"],"sources":["../../../../../../src/components/calendar/month-wrapper/month/Month.styles.ts"],"sourcesContent":["import type { WithTheme } from '@chayns-components/core';\nimport styled from 'styled-components';\n\ntype StyledMonthProps = WithTheme<{ $height: number }>;\n\nexport const StyledMonth = styled.div<StyledMonthProps>`\n height: ${({ $height }) => $height}px;\n aspect-ratio: 1;\n`;\n\nexport const StyledMonthHead = styled.div`\n display: flex;\n align-items: center;\n justify-content: center;\n column-gap: 7px;\n`;\n\nexport const StyledMonthName = styled.div`\n font-weight: bold;\n text-align: center;\n user-select: none;\n`;\n"],"mappings":";;;;;;AACA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAuC,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAIhC,MAAMG,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAGE,yBAAM,CAACC,GAAqB;AACvD,cAAc,CAAC;EAAEC;AAAQ,CAAC,KAAKA,OAAO;AACtC;AACA,CAAC;AAEM,MAAMC,eAAe,GAAAJ,OAAA,CAAAI,eAAA,GAAGH,yBAAM,CAACC,GAAG;AACzC;AACA;AACA;AACA;AACA,CAAC;AAEM,MAAMG,eAAe,GAAAL,OAAA,CAAAK,eAAA,GAAGJ,yBAAM,CAACC,GAAG;AACzC;AACA;AACA;AACA,CAAC","ignoreList":[]}
@@ -0,0 +1,129 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _calendar = require("../../../../../types/calendar");
9
+ var _calendar2 = require("../../../../../utils/calendar");
10
+ var _Day = _interopRequireDefault(require("./day/Day"));
11
+ var _DayWrapper = require("./DayWrapper.styles");
12
+ var _date = require("../../../../../utils/date");
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
15
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
16
+ const DayWrapper = ({
17
+ month,
18
+ year,
19
+ highlightedDates,
20
+ onSelect,
21
+ selectedDate,
22
+ categories,
23
+ minDate,
24
+ maxDate,
25
+ customThumbColors,
26
+ type,
27
+ hoveringDay,
28
+ shouldShowHighlightsInMonthOverlay,
29
+ setHoveringDay,
30
+ disabledDates
31
+ }) => {
32
+ const dayOfCurrentMonth = (0, _react.useMemo)(() => new Date(year, month - 1, 13), [month, year]);
33
+ const days = (0, _react.useMemo)(() => {
34
+ const dateArray = [];
35
+ const currentDate = (0, _date.startOfMonth)(dayOfCurrentMonth);
36
+ const startDay = (0, _date.startOfWeek)(currentDate);
37
+ for (let i = 0; i < 42; i++) {
38
+ const newDate = (0, _date.addDays)(startDay, i);
39
+ dateArray.push(newDate);
40
+ }
41
+ return dateArray;
42
+ }, [dayOfCurrentMonth]);
43
+ const handleDayClick = (0, _react.useCallback)((date, shouldFireEvent) => {
44
+ if (shouldFireEvent) {
45
+ onSelect(date);
46
+ }
47
+ }, [onSelect]);
48
+ const dayElements = (0, _react.useMemo)(() => {
49
+ const items = [];
50
+ const {
51
+ start,
52
+ end
53
+ } = selectedDate || {};
54
+ const firstDisabledDateAfterStart = (0, _calendar2.findNextDate)(start, disabledDates);
55
+ days.forEach(day => {
56
+ let isSelected = false;
57
+ let isIntervalStart = false;
58
+ let isIntervalEnd = false;
59
+ let isWithinIntervalSelection = false;
60
+ const showHoverEffect = false;
61
+ let isDisabled =
62
+ // Disables dates, that are not between minDate and maxDate.
63
+ !(0, _date.isWithinInterval)(day, {
64
+ start: minDate,
65
+ end: maxDate
66
+ }) ||
67
+ // Disables
68
+ disabledDates.some(disabledDate => (0, _date.isSameDay)(disabledDate, day));
69
+ if (type === _calendar.CalendarType.Single && selectedDate instanceof Date) {
70
+ isSelected = (0, _date.isSameDay)(selectedDate, day);
71
+ } else if (type === _calendar.CalendarType.Multiple && Array.isArray(selectedDate)) {
72
+ isSelected = selectedDate.some(date => (0, _date.isSameDay)(date, day));
73
+ } else if (type === _calendar.CalendarType.Interval && start) {
74
+ isIntervalStart = (0, _date.isSameDay)(start, day);
75
+ if (end) {
76
+ isIntervalEnd = (0, _date.isSameDay)(end, day);
77
+ isWithinIntervalSelection = (0, _date.isWithinInterval)(day, {
78
+ start,
79
+ end
80
+ });
81
+ } else if (firstDisabledDateAfterStart && !isDisabled && (0, _date.isAfter)(day, firstDisabledDateAfterStart)) {
82
+ // Ensures, that the interval end can't be set in a way, that the interval includes disabled dates.
83
+ isDisabled = true;
84
+ }
85
+ }
86
+ if (type === _calendar.CalendarType.Interval && hoveringDay && !isIntervalStart && !isIntervalEnd && !isWithinIntervalSelection) {
87
+ if (!start) {
88
+ isIntervalStart = (0, _date.isSameDay)(day, hoveringDay);
89
+ } else if (start && !end) {
90
+ if (start > day) {
91
+ isIntervalStart = (0, _date.isSameDay)(day, hoveringDay);
92
+ } else {
93
+ isWithinIntervalSelection = (0, _date.isWithinInterval)(day, {
94
+ start,
95
+ end: hoveringDay
96
+ });
97
+ isIntervalEnd = (0, _date.isSameDay)(hoveringDay, day);
98
+ }
99
+ } else if (start && end && (0, _date.isSameDay)(hoveringDay, day)) {
100
+ isIntervalStart = !(0, _date.isWithinInterval)(day, {
101
+ start,
102
+ end
103
+ });
104
+ }
105
+ }
106
+ items.push(/*#__PURE__*/_react.default.createElement(_Day.default, {
107
+ key: `single-day-${day.toDateString()}`,
108
+ categories: categories,
109
+ date: day,
110
+ isSelected: isSelected,
111
+ customThumbColors: customThumbColors,
112
+ isIntervalStart: isIntervalStart,
113
+ isIntervalEnd: isIntervalEnd,
114
+ isWithinIntervalSelection: isWithinIntervalSelection,
115
+ isDisabled: isDisabled,
116
+ shouldShowHighlightsInMonthOverlay: shouldShowHighlightsInMonthOverlay,
117
+ isSameMonth: (0, _date.isSameMonth)(day, dayOfCurrentMonth),
118
+ onClick: handleDayClick,
119
+ highlightedDates: highlightedDates,
120
+ setHoveringDay: setHoveringDay
121
+ }));
122
+ });
123
+ return items;
124
+ }, [selectedDate, disabledDates, days, minDate, maxDate, type, hoveringDay, categories, customThumbColors, shouldShowHighlightsInMonthOverlay, dayOfCurrentMonth, handleDayClick, highlightedDates, setHoveringDay]);
125
+ return /*#__PURE__*/_react.default.createElement(_DayWrapper.StyledDayWrapper, null, dayElements);
126
+ };
127
+ DayWrapper.displayName = 'DayWrapper';
128
+ var _default = exports.default = DayWrapper;
129
+ //# sourceMappingURL=DayWrapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DayWrapper.js","names":["_react","_interopRequireWildcard","require","_calendar","_calendar2","_Day","_interopRequireDefault","_DayWrapper","_date","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","DayWrapper","month","year","highlightedDates","onSelect","selectedDate","categories","minDate","maxDate","customThumbColors","type","hoveringDay","shouldShowHighlightsInMonthOverlay","setHoveringDay","disabledDates","dayOfCurrentMonth","useMemo","Date","days","dateArray","currentDate","startOfMonth","startDay","startOfWeek","newDate","addDays","push","handleDayClick","useCallback","date","shouldFireEvent","dayElements","items","start","end","firstDisabledDateAfterStart","findNextDate","forEach","day","isSelected","isIntervalStart","isIntervalEnd","isWithinIntervalSelection","showHoverEffect","isDisabled","isWithinInterval","some","disabledDate","isSameDay","CalendarType","Single","Multiple","Array","isArray","Interval","isAfter","createElement","key","toDateString","isSameMonth","onClick","StyledDayWrapper","displayName","_default","exports"],"sources":["../../../../../../../src/components/calendar/month-wrapper/month/day-wrapper/DayWrapper.tsx"],"sourcesContent":["import React, { FC, useCallback, useMemo, type ReactElement } from 'react';\nimport {\n CalendarType,\n type Categories, CustomThumbColors,\n type DateInterval,\n type EMonth,\n type HighlightedDates,\n} from '../../../../../types/calendar';\nimport { findNextDate } from '../../../../../utils/calendar';\nimport Day from './day/Day';\nimport { StyledDayWrapper } from './DayWrapper.styles';\nimport {\n addDays,\n isAfter,\n isSameDay,\n isSameMonth,\n isWithinInterval,\n startOfMonth,\n startOfWeek\n} from \"../../../../../utils/date\";\n\nexport type DayWrapperProps = {\n month: EMonth;\n year: number;\n highlightedDates?: HighlightedDates[];\n onSelect: (date: Date) => void;\n selectedDate?: Date | Date[] | DateInterval;\n categories?: Categories[];\n minDate: Date;\n maxDate: Date;\n type: CalendarType;\n hoveringDay: Date | null;\n setHoveringDay: (date: Date | null) => void;\n disabledDates: Date[];\n customThumbColors?: CustomThumbColors;\n shouldShowHighlightsInMonthOverlay: boolean;\n};\n\nconst DayWrapper: FC<DayWrapperProps> = ({\n month,\n year,\n highlightedDates,\n onSelect,\n selectedDate,\n categories,\n minDate,\n maxDate,customThumbColors,\n type,\n hoveringDay,\n shouldShowHighlightsInMonthOverlay,\n setHoveringDay,\n disabledDates,\n}) => {\n const dayOfCurrentMonth = useMemo(() => new Date(year, month - 1, 13), [month, year]);\n\n const days = useMemo(() => {\n const dateArray: Date[] = [];\n\n const currentDate = startOfMonth(dayOfCurrentMonth);\n\n const startDay = startOfWeek(currentDate);\n\n for (let i = 0; i < 42; i++) {\n const newDate = addDays(startDay, i);\n dateArray.push(newDate);\n }\n\n return dateArray;\n }, [dayOfCurrentMonth]);\n\n const handleDayClick = useCallback(\n (date: Date, shouldFireEvent: boolean) => {\n if (shouldFireEvent) {\n onSelect(date);\n }\n },\n [onSelect],\n );\n\n const dayElements = useMemo(() => {\n const items: ReactElement[] = [];\n\n const { start, end } = (selectedDate || {}) as DateInterval;\n const firstDisabledDateAfterStart = findNextDate(start, disabledDates);\n\n days.forEach((day) => {\n let isSelected = false;\n let isIntervalStart = false;\n let isIntervalEnd = false;\n let isWithinIntervalSelection = false;\n const showHoverEffect = false;\n\n let isDisabled =\n // Disables dates, that are not between minDate and maxDate.\n !isWithinInterval(day, { start: minDate, end: maxDate }) ||\n // Disables\n disabledDates.some((disabledDate) => isSameDay(disabledDate, day));\n\n if (type === CalendarType.Single && selectedDate instanceof Date) {\n isSelected = isSameDay(selectedDate, day);\n } else if (type === CalendarType.Multiple && Array.isArray(selectedDate)) {\n isSelected = selectedDate.some((date) => isSameDay(date, day));\n } else if (type === CalendarType.Interval && start) {\n isIntervalStart = isSameDay(start, day);\n if (end) {\n isIntervalEnd = isSameDay(end, day);\n\n isWithinIntervalSelection = isWithinInterval(day, {\n start,\n end,\n });\n } else if (\n firstDisabledDateAfterStart &&\n !isDisabled &&\n isAfter(day, firstDisabledDateAfterStart)\n ) {\n // Ensures, that the interval end can't be set in a way, that the interval includes disabled dates.\n isDisabled = true;\n }\n }\n\n if (\n type === CalendarType.Interval &&\n hoveringDay &&\n !isIntervalStart &&\n !isIntervalEnd &&\n !isWithinIntervalSelection\n ) {\n if (!start) {\n isIntervalStart = isSameDay(day, hoveringDay);\n } else if (start && !end) {\n if (start > day) {\n isIntervalStart = isSameDay(day, hoveringDay);\n } else {\n isWithinIntervalSelection = isWithinInterval(day, {\n start,\n end: hoveringDay,\n });\n isIntervalEnd = isSameDay(hoveringDay, day);\n }\n } else if (start && end && isSameDay(hoveringDay, day)) {\n isIntervalStart = !isWithinInterval(day, { start, end });\n }\n }\n\n items.push(\n <Day\n key={`single-day-${day.toDateString()}`}\n categories={categories}\n date={day}\n isSelected={isSelected}\n customThumbColors={customThumbColors}\n isIntervalStart={isIntervalStart}\n isIntervalEnd={isIntervalEnd}\n isWithinIntervalSelection={isWithinIntervalSelection}\n isDisabled={isDisabled}\n shouldShowHighlightsInMonthOverlay={shouldShowHighlightsInMonthOverlay}\n isSameMonth={isSameMonth(day, dayOfCurrentMonth)}\n onClick={handleDayClick}\n highlightedDates={highlightedDates}\n setHoveringDay={setHoveringDay}\n />,\n );\n });\n\n return items;\n }, [selectedDate, disabledDates, days, minDate, maxDate, type, hoveringDay, categories, customThumbColors, shouldShowHighlightsInMonthOverlay, dayOfCurrentMonth, handleDayClick, highlightedDates, setHoveringDay]);\n\n return <StyledDayWrapper>{dayElements}</StyledDayWrapper>;\n};\n\nDayWrapper.displayName = 'DayWrapper';\n\nexport default DayWrapper;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAOA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,IAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AAQmC,SAAAI,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,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C,kCAAkC,EAAEA,kCAAmC;QACvE+C,WAAW,EAAE,IAAAA,iBAAW,EAACrB,GAAG,EAAEvB,iBAAiB,CAAE;QACjD6C,OAAO,EAAEjC,cAAe;QACxBxB,gBAAgB,EAAEA,gBAAiB;QACnCU,cAAc,EAAEA;MAAe,CAClC,CACL,CAAC;IACL,CAAC,CAAC;IAEF,OAAOmB,KAAK;EAChB,CAAC,EAAE,CAAC3B,YAAY,EAAES,aAAa,EAAEI,IAAI,EAAEX,OAAO,EAAEC,OAAO,EAAEE,IAAI,EAAEC,WAAW,EAAEL,UAAU,EAAEG,iBAAiB,EAAEG,kCAAkC,EAAEG,iBAAiB,EAAEY,cAAc,EAAExB,gBAAgB,EAAEU,cAAc,CAAC,CAAC;EAEpN,oBAAO1C,MAAA,CAAAW,OAAA,CAAA0E,aAAA,CAAC9E,WAAA,CAAAmF,gBAAgB,QAAE9B,WAA8B,CAAC;AAC7D,CAAC;AAED/B,UAAU,CAAC8D,WAAW,GAAG,YAAY;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAlF,OAAA,GAEvBkB,UAAU","ignoreList":[]}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.StyledDayWrapper = void 0;
7
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
+ const StyledDayWrapper = exports.StyledDayWrapper = _styledComponents.default.div`
10
+ display: grid;
11
+ grid-template-rows: repeat(6, 1fr);
12
+ grid-template-columns: repeat(7, 1fr);
13
+ padding-top: 6px;
14
+ margin: 0 15px;
15
+ `;
16
+ //# sourceMappingURL=DayWrapper.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DayWrapper.styles.js","names":["_styledComponents","_interopRequireDefault","require","e","__esModule","default","StyledDayWrapper","exports","styled","div"],"sources":["../../../../../../../src/components/calendar/month-wrapper/month/day-wrapper/DayWrapper.styles.ts"],"sourcesContent":["import styled from 'styled-components';\n\nexport const StyledDayWrapper = styled.div`\n display: grid;\n grid-template-rows: repeat(6, 1fr);\n grid-template-columns: repeat(7, 1fr);\n padding-top: 6px;\n margin: 0 15px;\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAuC,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEhC,MAAMG,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAGE,yBAAM,CAACC,GAAG;AAC1C;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _Category = _interopRequireDefault(require("./category/Category"));
9
+ var _Day = require("./Day.styles");
10
+ var _date = require("../../../../../../utils/date");
11
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
13
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
14
+ const Day = ({
15
+ date,
16
+ highlightedDates,
17
+ categories,
18
+ isSameMonth,
19
+ isSelected,
20
+ onClick,
21
+ isDisabled,
22
+ isIntervalStart,
23
+ isIntervalEnd,
24
+ customThumbColors,
25
+ isWithinIntervalSelection,
26
+ shouldShowHighlightsInMonthOverlay,
27
+ setHoveringDay
28
+ }) => {
29
+ const dayRef = (0, _react.useRef)(null);
30
+ const styles = (0, _react.useMemo)(() => {
31
+ var _highlightedDates$fin;
32
+ if (!highlightedDates || !shouldShowHighlightsInMonthOverlay && !isSameMonth) {
33
+ return undefined;
34
+ }
35
+ return (_highlightedDates$fin = highlightedDates.find(highlightedDate => highlightedDate.dates.some(highlighted => (0, _date.isSameDay)(highlighted, date)))) === null || _highlightedDates$fin === void 0 ? void 0 : _highlightedDates$fin.style;
36
+ }, [date, highlightedDates, isSameMonth, shouldShowHighlightsInMonthOverlay]);
37
+ const categoryElements = (0, _react.useMemo)(() => {
38
+ if (!categories || !shouldShowHighlightsInMonthOverlay && !isSameMonth) return [];
39
+ return categories.flatMap(category => category.dates.filter(day => (0, _date.isSameDay)(day, date)).map(day => /*#__PURE__*/_react.default.createElement(_Category.default, {
40
+ key: day.getTime() * Math.random(),
41
+ color: category.color
42
+ })));
43
+ }, [categories, date, isSameMonth, shouldShowHighlightsInMonthOverlay]);
44
+ return /*#__PURE__*/_react.default.createElement(_Day.StyledDay, {
45
+ ref: dayRef,
46
+ onClick: () => onClick(date, isSameMonth && !isDisabled),
47
+ $isSameMonth: isSameMonth,
48
+ $isDisabled: isDisabled,
49
+ $backgroundColor: styles === null || styles === void 0 ? void 0 : styles.backgroundColor,
50
+ $textColor: styles === null || styles === void 0 ? void 0 : styles.textColor,
51
+ onMouseEnter: () => setHoveringDay(date),
52
+ onMouseLeave: () => setHoveringDay(null)
53
+ }, /*#__PURE__*/_react.default.createElement(_Day.StyledDayNumber, {
54
+ $customThumbColors: customThumbColors,
55
+ $isSelected: shouldShowHighlightsInMonthOverlay ? isSelected : isSelected && isSameMonth,
56
+ $isIntervalStart: shouldShowHighlightsInMonthOverlay ? isIntervalStart : isIntervalStart && isSameMonth,
57
+ $isIntervalEnd: shouldShowHighlightsInMonthOverlay ? isIntervalEnd : isIntervalEnd && isSameMonth,
58
+ $isWithinIntervalSelection: shouldShowHighlightsInMonthOverlay ? isWithinIntervalSelection : isWithinIntervalSelection && isSameMonth
59
+ }, date.getDate()), categoryElements && /*#__PURE__*/_react.default.createElement(_Day.StyledDayCategoryWrapper, null, categoryElements));
60
+ };
61
+ Day.displayName = 'Day';
62
+ var _default = exports.default = Day;
63
+ //# sourceMappingURL=Day.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Day.js","names":["_react","_interopRequireWildcard","require","_Category","_interopRequireDefault","_Day","_date","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","Day","date","highlightedDates","categories","isSameMonth","isSelected","onClick","isDisabled","isIntervalStart","isIntervalEnd","customThumbColors","isWithinIntervalSelection","shouldShowHighlightsInMonthOverlay","setHoveringDay","dayRef","useRef","styles","useMemo","_highlightedDates$fin","undefined","find","highlightedDate","dates","some","highlighted","isSameDay","style","categoryElements","flatMap","category","filter","day","map","createElement","key","getTime","Math","random","color","StyledDay","ref","$isSameMonth","$isDisabled","$backgroundColor","backgroundColor","$textColor","textColor","onMouseEnter","onMouseLeave","StyledDayNumber","$customThumbColors","$isSelected","$isIntervalStart","$isIntervalEnd","$isWithinIntervalSelection","getDate","StyledDayCategoryWrapper","displayName","_default","exports"],"sources":["../../../../../../../../src/components/calendar/month-wrapper/month/day-wrapper/day/Day.tsx"],"sourcesContent":["import React, { FC, useMemo, useRef } from 'react';\nimport {\n Categories, CustomThumbColors,\n HighlightedDates,\n HighlightedDateStyles,\n} from '../../../../../../types/calendar';\nimport Category from './category/Category';\nimport { StyledDay, StyledDayCategoryWrapper, StyledDayNumber } from './Day.styles';\nimport {isSameDay} from \"../../../../../../utils/date\";\n\nexport type DayProps = {\n date: Date;\n isSameMonth: boolean;\n isSelected: boolean;\n onClick: (date: Date, shouldFireEvent: boolean) => void;\n highlightedDates?: HighlightedDates[];\n categories?: Categories[];\n isDisabled: boolean;\n isIntervalStart: boolean;\n isIntervalEnd: boolean;\n isWithinIntervalSelection: boolean;\n setHoveringDay: (date: Date | null) => void;\n shouldShowHighlightsInMonthOverlay: boolean;\n customThumbColors?: CustomThumbColors;\n};\n\nconst Day: FC<DayProps> = ({\n date,\n highlightedDates,\n categories,\n isSameMonth,\n isSelected,\n onClick,\n isDisabled,\n isIntervalStart,\n isIntervalEnd,customThumbColors,\n isWithinIntervalSelection,\n shouldShowHighlightsInMonthOverlay,\n setHoveringDay,\n}) => {\n const dayRef = useRef<HTMLDivElement>(null);\n\n const styles: HighlightedDateStyles | undefined = useMemo(() => {\n if (!highlightedDates || (!shouldShowHighlightsInMonthOverlay && !isSameMonth)) {\n return undefined;\n }\n\n return highlightedDates.find((highlightedDate) =>\n highlightedDate.dates.some((highlighted) => isSameDay(highlighted, date)),\n )?.style;\n }, [date, highlightedDates, isSameMonth, shouldShowHighlightsInMonthOverlay]);\n\n const categoryElements = useMemo(() => {\n if (!categories || (!shouldShowHighlightsInMonthOverlay && !isSameMonth)) return [];\n\n return categories.flatMap((category) =>\n category.dates\n .filter((day) => isSameDay(day, date))\n .map((day) => (\n <Category key={day.getTime() * Math.random()} color={category.color} />\n )),\n );\n }, [categories, date, isSameMonth, shouldShowHighlightsInMonthOverlay]);\n\n return (\n <StyledDay\n ref={dayRef}\n onClick={() => onClick(date, isSameMonth && !isDisabled)}\n $isSameMonth={isSameMonth}\n $isDisabled={isDisabled}\n $backgroundColor={styles?.backgroundColor}\n $textColor={styles?.textColor}\n onMouseEnter={() => setHoveringDay(date)}\n onMouseLeave={() => setHoveringDay(null)}\n >\n <StyledDayNumber\n $customThumbColors={customThumbColors}\n $isSelected={\n shouldShowHighlightsInMonthOverlay ? isSelected : isSelected && isSameMonth\n }\n $isIntervalStart={\n shouldShowHighlightsInMonthOverlay\n ? isIntervalStart\n : isIntervalStart && isSameMonth\n }\n $isIntervalEnd={\n shouldShowHighlightsInMonthOverlay\n ? isIntervalEnd\n : isIntervalEnd && isSameMonth\n }\n $isWithinIntervalSelection={\n shouldShowHighlightsInMonthOverlay\n ? isWithinIntervalSelection\n : isWithinIntervalSelection && isSameMonth\n }\n >\n {date.getDate()}\n </StyledDayNumber>\n {categoryElements && (\n <StyledDayCategoryWrapper>{categoryElements}</StyledDayCategoryWrapper>\n )}\n </StyledDay>\n );\n};\n\nDay.displayName = 'Day';\n\nexport default Day;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAMA,IAAAC,SAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,IAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAAuD,SAAAE,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,yBAAAH,CAAA,6BAAAI,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAD,wBAAA,YAAAA,CAAAH,CAAA,WAAAA,CAAA,GAAAM,CAAA,GAAAD,CAAA,KAAAL,CAAA;AAAA,SAAAN,wBAAAM,CAAA,EAAAK,CAAA,SAAAA,CAAA,IAAAL,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAE,OAAA,EAAAF,CAAA,QAAAM,CAAA,GAAAH,wBAAA,CAAAE,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAC,GAAA,CAAAP,CAAA,UAAAM,CAAA,CAAAE,GAAA,CAAAR,CAAA,OAAAS,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAf,CAAA,oBAAAe,C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EACPvC,kCAAkC,GAAGP,UAAU,GAAGA,UAAU,IAAID,WACnE;IACDgD,gBAAgB,EACZxC,kCAAkC,GAC5BJ,eAAe,GACfA,eAAe,IAAIJ,WAC5B;IACDiD,cAAc,EACVzC,kCAAkC,GAC5BH,aAAa,GACbA,aAAa,IAAIL,WAC1B;IACDkD,0BAA0B,EACtB1C,kCAAkC,GAC5BD,yBAAyB,GACzBA,yBAAyB,IAAIP;EACtC,GAEAH,IAAI,CAACsD,OAAO,CAAC,CACD,CAAC,EACjB5B,gBAAgB,iBACbtD,MAAA,CAAAS,OAAA,CAAAmD,aAAA,CAACvD,IAAA,CAAA8E,wBAAwB,QAAE7B,gBAA2C,CAEnE,CAAC;AAEpB,CAAC;AAED3B,GAAG,CAACyD,WAAW,GAAG,KAAK;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA7E,OAAA,GAETkB,GAAG","ignoreList":[]}
@@ -0,0 +1,114 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.StyledDayNumber = exports.StyledDayCategoryWrapper = exports.StyledDay = void 0;
7
+ var _styledComponents = _interopRequireWildcard(require("styled-components"));
8
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
9
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
10
+ const StyledDay = exports.StyledDay = _styledComponents.default.div`
11
+ position: relative;
12
+ cursor: ${({
13
+ $isSameMonth,
14
+ $isDisabled
15
+ }) => $isSameMonth && !$isDisabled ? 'pointer' : 'default'};
16
+ color: ${({
17
+ theme
18
+ }) => theme.text};
19
+ opacity: ${({
20
+ $isSameMonth,
21
+ $isDisabled
22
+ }) => {
23
+ if ($isSameMonth && !$isDisabled) {
24
+ return '1';
25
+ }
26
+ if ($isDisabled) {
27
+ return '0.2';
28
+ }
29
+ return '0.5';
30
+ }};
31
+ display: flex;
32
+ flex-direction: column;
33
+ align-items: center;
34
+ justify-content: center;
35
+ aspect-ratio: 1;
36
+ pointer-events: ${({
37
+ $isSameMonth,
38
+ $isDisabled
39
+ }) => $isSameMonth && !$isDisabled ? 'auto' : 'none'};
40
+
41
+ ${({
42
+ $backgroundColor,
43
+ $textColor
44
+ }) => $backgroundColor && $textColor && (0, _styledComponents.css)`
45
+ color: ${$textColor};
46
+ background-color: ${$backgroundColor};
47
+ `}
48
+ `;
49
+ const StyledDayNumber = exports.StyledDayNumber = _styledComponents.default.div`
50
+ border-radius: 50%;
51
+ display: flex;
52
+ align-items: center;
53
+ justify-content: center;
54
+ width: 80%;
55
+ height: 80%;
56
+ font-size: 90%;
57
+
58
+ ${({
59
+ $isSelected,
60
+ $isIntervalEnd,
61
+ $isIntervalStart,
62
+ $isWithinIntervalSelection,
63
+ $customThumbColors,
64
+ theme
65
+ }) => !!($isSelected || $isIntervalStart || $isIntervalEnd || $isWithinIntervalSelection) && (0, _styledComponents.css)`
66
+ background-color: ${($customThumbColors === null || $customThumbColors === void 0 ? void 0 : $customThumbColors.mainBackgroundColor) ?? theme['404']};
67
+ color: ${($customThumbColors === null || $customThumbColors === void 0 ? void 0 : $customThumbColors.mainTextColor) ?? theme['409']};
68
+ `}
69
+
70
+ ${({
71
+ $isIntervalStart,
72
+ $isIntervalEnd,
73
+ $isWithinIntervalSelection,
74
+ $customThumbColors,
75
+ theme
76
+ }) => {
77
+ if ($isIntervalStart && $isIntervalEnd) {
78
+ return (0, _styledComponents.css)`
79
+ border-radius: 5px;
80
+ width: 100%;
81
+ `;
82
+ }
83
+ if ($isIntervalStart) {
84
+ return (0, _styledComponents.css)`
85
+ border-radius: 5px 0 0 5px;
86
+ width: 100%;
87
+ `;
88
+ }
89
+ if ($isIntervalEnd) {
90
+ return (0, _styledComponents.css)`
91
+ border-radius: 0 5px 5px 0;
92
+ width: 100%;
93
+ `;
94
+ }
95
+ if ($isWithinIntervalSelection) {
96
+ return (0, _styledComponents.css)`
97
+ border-radius: 0;
98
+ width: 100%;
99
+ background-color: ${($customThumbColors === null || $customThumbColors === void 0 ? void 0 : $customThumbColors.secondaryBackgroundColor) ?? theme['403']};
100
+ `;
101
+ }
102
+ return '';
103
+ }}
104
+ `;
105
+ const StyledDayCategoryWrapper = exports.StyledDayCategoryWrapper = _styledComponents.default.div`
106
+ display: flex;
107
+ align-items: center;
108
+ justify-content: center;
109
+ gap: 6%;
110
+ width: 100%;
111
+ position: absolute;
112
+ bottom: 2px;
113
+ `;
114
+ //# sourceMappingURL=Day.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Day.styles.js","names":["_styledComponents","_interopRequireWildcard","require","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","StyledDay","exports","styled","div","$isSameMonth","$isDisabled","theme","text","$backgroundColor","$textColor","css","StyledDayNumber","$isSelected","$isIntervalEnd","$isIntervalStart","$isWithinIntervalSelection","$customThumbColors","mainBackgroundColor","mainTextColor","secondaryBackgroundColor","StyledDayCategoryWrapper"],"sources":["../../../../../../../../src/components/calendar/month-wrapper/month/day-wrapper/day/Day.styles.ts"],"sourcesContent":["import type { WithTheme } from '@chayns-components/core';\nimport type { CSSProperties } from 'react';\nimport styled, { css } from 'styled-components';\nimport {CustomThumbColors} from \"../../../../../../types/calendar\";\n\ntype StyledDayProps = WithTheme<{\n $isSameMonth: boolean;\n $backgroundColor?: CSSProperties['backgroundColor'];\n $textColor?: CSSProperties['color'];\n $isDisabled: boolean;\n}>;\n\nexport const StyledDay = styled.div<StyledDayProps>`\n position: relative;\n cursor: ${({ $isSameMonth, $isDisabled }) =>\n $isSameMonth && !$isDisabled ? 'pointer' : 'default'};\n color: ${({ theme }: StyledDayProps) => theme.text};\n opacity: ${({ $isSameMonth, $isDisabled }) => {\n if ($isSameMonth && !$isDisabled) {\n return '1';\n }\n if ($isDisabled) {\n return '0.2';\n }\n return '0.5';\n }};\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n aspect-ratio: 1;\n pointer-events: ${({ $isSameMonth, $isDisabled }) =>\n $isSameMonth && !$isDisabled ? 'auto' : 'none'};\n\n ${({ $backgroundColor, $textColor }) =>\n $backgroundColor &&\n $textColor &&\n css`\n color: ${$textColor};\n background-color: ${$backgroundColor};\n `}\n`;\n\ntype StyledDayNumberProps = WithTheme<{\n $isSelected: boolean;\n $isIntervalEnd: boolean;\n $isIntervalStart: boolean;\n $isWithinIntervalSelection: boolean;\n $customThumbColors?: CustomThumbColors;\n}>;\n\nexport const StyledDayNumber = styled.div<StyledDayNumberProps>`\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 80%;\n height: 80%;\n font-size: 90%;\n\n ${({ $isSelected, $isIntervalEnd, $isIntervalStart, $isWithinIntervalSelection, $customThumbColors, theme }) =>\n !!($isSelected || $isIntervalStart || $isIntervalEnd || $isWithinIntervalSelection) &&\n css`\n background-color: ${$customThumbColors?.mainBackgroundColor ?? theme['404']};\n color: ${$customThumbColors?.mainTextColor ?? theme['409']};\n `}\n\n ${({ $isIntervalStart, $isIntervalEnd, $isWithinIntervalSelection, $customThumbColors, theme }) => {\n if ($isIntervalStart && $isIntervalEnd) {\n return css`\n border-radius: 5px;\n width: 100%;\n `;\n }\n if ($isIntervalStart) {\n return css`\n border-radius: 5px 0 0 5px;\n width: 100%;\n `;\n }\n if ($isIntervalEnd) {\n return css`\n border-radius: 0 5px 5px 0;\n width: 100%;\n `;\n }\n if ($isWithinIntervalSelection) {\n return css`\n border-radius: 0;\n width: 100%;\n background-color: ${$customThumbColors?.secondaryBackgroundColor ?? theme['403']};\n `;\n }\n\n return '';\n }}\n`;\n\nexport const StyledDayCategoryWrapper = styled.div`\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 6%;\n width: 100%;\n position: absolute;\n bottom: 2px;\n`;\n"],"mappings":";;;;;;AAEA,IAAAA,iBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAgD,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAH,wBAAAG,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAG,CAAA,IAAAT,CAAA,CAAAM,CA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CAAgC,CAAAM,kBAAkB,aAAlBA,kBAAkB,uBAAlBA,kBAAkB,CAAEC,mBAAmB,KAAIX,KAAK,CAAC,KAAK,CAAC;AACvF,qBAAqB,CAAAU,kBAAkB,aAAlBA,kBAAkB,uBAAlBA,kBAAkB,CAAEE,aAAa,KAAIZ,KAAK,CAAC,KAAK,CAAC;AACtE,SAAS;AACT;AACA,MAAM,CAAC;EAAEQ,gBAAgB;EAAED,cAAc;EAAEE,0BAA0B;EAAEC,kBAAkB;EAAEV;AAAM,CAAC,KAAK;EAC/F,IAAIQ,gBAAgB,IAAID,cAAc,EAAE;IACpC,OAAO,IAAAH,qBAAG;AACtB;AACA;AACA,aAAa;EACL;EACA,IAAII,gBAAgB,EAAE;IAClB,OAAO,IAAAJ,qBAAG;AACtB;AACA;AACA,aAAa;EACL;EACA,IAAIG,cAAc,EAAE;IAChB,OAAO,IAAAH,qBAAG;AACtB;AACA;AACA,aAAa;EACL;EACA,IAAIK,0BAA0B,EAAE;IAC5B,OAAO,IAAAL,qBAAG;AACtB;AACA;AACA,oCAAoC,CAAAM,kBAAkB,aAAlBA,kBAAkB,uBAAlBA,kBAAkB,CAAEG,wBAAwB,KAAIb,KAAK,CAAC,KAAK,CAAC;AAChG,aAAa;EACL;EAEA,OAAO,EAAE;AACb,CAAC;AACL,CAAC;AAEM,MAAMc,wBAAwB,GAAAnB,OAAA,CAAAmB,wBAAA,GAAGlB,yBAAM,CAACC,GAAG;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _Category = require("./Category.styles");
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
+ const Category = ({
11
+ color
12
+ }) => /*#__PURE__*/_react.default.createElement(_Category.StyledCategory, {
13
+ $color: color
14
+ });
15
+ Category.displayName = 'Category';
16
+ var _default = exports.default = Category;
17
+ //# sourceMappingURL=Category.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Category.js","names":["_react","_interopRequireDefault","require","_Category","e","__esModule","default","Category","color","createElement","StyledCategory","$color","displayName","_default","exports"],"sources":["../../../../../../../../../src/components/calendar/month-wrapper/month/day-wrapper/day/category/Category.tsx"],"sourcesContent":["import React, { FC, type CSSProperties } from 'react';\nimport { StyledCategory } from './Category.styles';\n\nexport type CategoryProps = {\n color: CSSProperties['color'];\n};\n\nconst Category: FC<CategoryProps> = ({ color }) => <StyledCategory $color={color} />;\n\nCategory.displayName = 'Category';\n\nexport default Category;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAAmD,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAMnD,MAAMG,QAA2B,GAAGA,CAAC;EAAEC;AAAM,CAAC,kBAAKR,MAAA,CAAAM,OAAA,CAAAG,aAAA,CAACN,SAAA,CAAAO,cAAc;EAACC,MAAM,EAAEH;AAAM,CAAE,CAAC;AAEpFD,QAAQ,CAACK,WAAW,GAAG,UAAU;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAR,OAAA,GAEnBC,QAAQ","ignoreList":[]}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.StyledCategory = void 0;
7
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
+ const StyledCategory = exports.StyledCategory = _styledComponents.default.div`
10
+ border-radius: 50%;
11
+ width: 24%;
12
+ aspect-ratio: 1;
13
+ background-color: ${({
14
+ $color
15
+ }) => $color};
16
+ border: 1px solid white;
17
+ `;
18
+ //# sourceMappingURL=Category.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Category.styles.js","names":["_styledComponents","_interopRequireDefault","require","e","__esModule","default","StyledCategory","exports","styled","div","$color"],"sources":["../../../../../../../../../src/components/calendar/month-wrapper/month/day-wrapper/day/category/Category.styles.ts"],"sourcesContent":["import type { WithTheme } from '@chayns-components/core';\nimport type { CSSProperties } from 'react';\nimport styled from 'styled-components';\n\ntype StyledCategoryProps = WithTheme<{ $color: CSSProperties['color'] }>;\n\nexport const StyledCategory = styled.div<StyledCategoryProps>`\n border-radius: 50%;\n width: 24%;\n aspect-ratio: 1;\n background-color: ${({ $color }) => $color};\n border: 1px solid white;\n`;\n"],"mappings":";;;;;;AAEA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAuC,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAIhC,MAAMG,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAGE,yBAAM,CAACC,GAAwB;AAC7D;AACA;AACA;AACA,wBAAwB,CAAC;EAAEC;AAAO,CAAC,KAAKA,MAAM;AAC9C;AACA,CAAC","ignoreList":[]}