@capillarytech/blaze-ui 6.0.0 → 6.0.4

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 (271) hide show
  1. package/CapActionBar/styles.module.scss.js +1 -1
  2. package/CapAdvancedIcon/styles.module.scss.js +1 -1
  3. package/CapAlert/styles.module.scss.js +1 -1
  4. package/CapAppNotEnabled/styles.module.scss.js +1 -1
  5. package/CapAskAira/AudienceFilterBot/styles.module.scss.js +1 -1
  6. package/CapAskAira/CapAiMediaGeneration/styles.module.scss.js +1 -1
  7. package/CapAskAira/ConfigurationBot/PromptAttachmentButton.js +1 -1
  8. package/CapAskAira/ConfigurationBot/styles.module.scss.js +1 -1
  9. package/CapAskAira/ContentGenerationBot/styles.module.scss.js +1 -1
  10. package/CapAskAira/DocumentationBot/styles.module.scss.js +1 -1
  11. package/CapAskAira/DocumentationChatBot/styles.module.scss.js +1 -1
  12. package/CapAskAira/RuleGenerationBot/styles.module.scss.js +1 -1
  13. package/CapAskAira/RuleSummarizationBot/styles.module.scss.js +1 -1
  14. package/CapAskAira/styles.module.scss.js +1 -1
  15. package/CapBanner/styles.module.scss.js +1 -1
  16. package/CapBlock/styles.module.scss.js +1 -1
  17. package/CapButton/styles.module.scss.js +1 -1
  18. package/CapCSVFileUploader/styles.module.scss.js +1 -1
  19. package/CapCalendarDatePicker/styles.module.scss.js +1 -1
  20. package/CapCard/styles.module.scss.js +1 -1
  21. package/CapCardBox/styles.module.scss.js +1 -1
  22. package/CapCarousel/styles.module.scss.js +1 -1
  23. package/CapCheckbox/styles.module.scss.js +1 -1
  24. package/CapColorPicker/styles.module.scss.js +1 -1
  25. package/CapColoredTag/styles.module.scss.js +1 -1
  26. package/CapColumn/styles.module.scss.js +1 -1
  27. package/CapConditionPreview/styles.module.scss.js +1 -1
  28. package/CapCustomCard/styles.module.scss.js +1 -1
  29. package/CapCustomCarousel/styles.module.scss.js +1 -1
  30. package/CapCustomCheckboxList/styles.module.scss.js +1 -1
  31. package/CapCustomList/styles.module.scss.js +1 -1
  32. package/CapCustomSelect/styles.module.scss.js +1 -1
  33. package/CapDatePicker/styles.module.scss.js +1 -1
  34. package/CapDateRangePicker/styles.module.scss.js +1 -1
  35. package/CapDateTimePicker/styles.module.scss.js +1 -1
  36. package/CapDateTimeRangePicker/styles.module.scss.js +1 -1
  37. package/CapDnDGraph/reportingBlock.js +1 -1
  38. package/CapDropdown/styles.module.scss.js +1 -1
  39. package/CapEmptyDivWithBorder/styles.module.scss.js +1 -1
  40. package/CapError/styles.module.scss.js +1 -1
  41. package/CapErrorBoundary/styles.module.scss.js +1 -1
  42. package/CapErrorStateIllustration/styles.module.scss.js +1 -1
  43. package/CapEventCalendar/CalendarCanvas/calendarCanvasStyles.css +21 -0
  44. package/CapEventCalendar/CalendarCanvas/calendarCanvasStyles.module.scss.js +8 -0
  45. package/CapEventCalendar/CalendarCanvas/calendarCanvasStyles.scss +17 -0
  46. package/CapEventCalendar/CalendarCanvas/index.d.ts +3 -52
  47. package/CapEventCalendar/CalendarCanvas/index.d.ts.map +1 -1
  48. package/CapEventCalendar/CalendarCanvas/index.js +31 -50
  49. package/CapEventCalendar/CalendarCanvas/utils.d.ts +5 -9
  50. package/CapEventCalendar/CalendarCanvas/utils.d.ts.map +1 -1
  51. package/CapEventCalendar/CalendarCanvas/utils.js +6 -6
  52. package/CapEventCalendar/components/DayDropdown/index.d.ts +3 -13
  53. package/CapEventCalendar/components/DayDropdown/index.d.ts.map +1 -1
  54. package/CapEventCalendar/components/DayDropdown/index.js +32 -14
  55. package/CapEventCalendar/components/MonthHeader/index.d.ts +3 -9
  56. package/CapEventCalendar/components/MonthHeader/index.d.ts.map +1 -1
  57. package/CapEventCalendar/components/MonthHeader/index.js +4 -9
  58. package/CapEventCalendar/components/MonthHeader/monthHeaderStyles.css +20 -0
  59. package/CapEventCalendar/components/MonthHeader/monthHeaderStyles.module.scss.js +7 -0
  60. package/CapEventCalendar/components/MonthHeader/monthHeaderStyles.scss +15 -0
  61. package/CapEventCalendar/drawUtils.d.ts +9 -71
  62. package/CapEventCalendar/drawUtils.d.ts.map +1 -1
  63. package/CapEventCalendar/drawUtils.js +12 -4
  64. package/CapEventCalendar/index.d.ts +4 -80
  65. package/CapEventCalendar/index.d.ts.map +1 -1
  66. package/CapEventCalendar/index.js +60 -85
  67. package/CapEventCalendar/messages.d.ts +25 -0
  68. package/CapEventCalendar/messages.d.ts.map +1 -0
  69. package/CapEventCalendar/messages.js +28 -0
  70. package/CapEventCalendar/styles.css +9 -81
  71. package/CapEventCalendar/styles.module.scss.js +12 -0
  72. package/CapEventCalendar/styles.scss +34 -107
  73. package/CapEventCalendar/tests/types.d.ts +26 -0
  74. package/CapEventCalendar/tests/types.d.ts.map +1 -0
  75. package/CapEventCalendar/types.d.ts +188 -0
  76. package/CapEventCalendar/types.d.ts.map +1 -0
  77. package/CapEventCalendar/types.js +1 -0
  78. package/CapEventCalendar/utils.d.ts +11 -9
  79. package/CapEventCalendar/utils.d.ts.map +1 -1
  80. package/CapEventCalendar/utils.js +10 -7
  81. package/CapExpressionEditor/styles.module.scss.js +1 -1
  82. package/CapForm/styles.module.scss.js +1 -1
  83. package/CapFormItem/styles.module.scss.js +1 -1
  84. package/CapGraph/styles.module.scss.js +1 -1
  85. package/CapHamburgerMenu/styles.module.scss.js +1 -1
  86. package/CapHeader/styles.module.scss.js +1 -1
  87. package/CapHeading/styles.module.scss.js +1 -1
  88. package/CapIcon/styles.module.scss.js +1 -1
  89. package/CapIllustration/styles.module.scss.js +1 -1
  90. package/CapImage/styles.module.scss.js +1 -1
  91. package/CapImportMFEComponent/styles.module.scss.js +1 -1
  92. package/CapInfoNote/styles.module.scss.js +1 -1
  93. package/CapInput/styles.module.scss.js +1 -1
  94. package/CapLabel/styles.module.scss.js +1 -1
  95. package/CapLanguageProvider/index.d.ts +0 -1
  96. package/CapLanguageProvider/index.d.ts.map +1 -1
  97. package/CapLanguageProvider/index.js +0 -3
  98. package/CapLevelGraphRenderer/styles.module.scss.js +1 -1
  99. package/CapLink/styles.module.scss.js +1 -1
  100. package/CapList/styles.module.scss.js +1 -1
  101. package/CapListLayout/styles.module.scss.js +1 -1
  102. package/CapLogin/styles.module.scss.js +1 -1
  103. package/CapMenu/styles.module.scss.js +1 -1
  104. package/CapModal/styles.module.scss.js +1 -1
  105. package/CapMultiSelect/styles.module.scss.js +1 -1
  106. package/CapMultiSelectDatePicker/styles.module.scss.js +1 -1
  107. package/CapNavigation/styles.module.scss.js +1 -1
  108. package/CapNotification/styles.module.scss.js +1 -1
  109. package/CapNotificationDropdown/styles.module.scss.js +1 -1
  110. package/CapPopover/styles.module.scss.js +1 -1
  111. package/CapProgress/styles.module.scss.js +1 -1
  112. package/CapRadio/styles.module.scss.js +1 -1
  113. package/CapRadioButton/styles.module.scss.js +1 -1
  114. package/CapRadioCard/styles.module.scss.js +1 -1
  115. package/CapRadioGroup/styles.module.scss.js +1 -1
  116. package/CapReorderComponent/styles.module.scss.js +1 -1
  117. package/CapRoadMap/styles.module.scss.js +1 -1
  118. package/CapRow/styles.module.scss.js +1 -1
  119. package/CapSKUUploader/styles.module.scss.js +1 -1
  120. package/CapSecondaryTopBar/styles.module.scss.js +1 -1
  121. package/CapSelect/styles.module.scss.js +1 -1
  122. package/CapSelectFilter/{styles.module.css → styles.css} +3 -3
  123. package/CapSelectFilter/styles.module.scss.js +1 -1
  124. package/CapSelectFilter/styles.scss +3 -3
  125. package/CapShape/styles.module.scss.js +1 -1
  126. package/CapSideBar/_menuSearch.module.scss.js +1 -1
  127. package/CapSideBar/styles.module.scss.js +1 -1
  128. package/CapSlideBox/styles.module.scss.js +1 -1
  129. package/CapSlider/styles.module.scss.js +1 -1
  130. package/CapSnackBar/styles.module.scss.js +1 -1
  131. package/CapSomethingWentWrong/styles.module.scss.js +1 -1
  132. package/CapSplit/styles.module.scss.js +1 -1
  133. package/CapStatisticCard/styles.module.scss.js +1 -1
  134. package/CapStatus/styles.module.scss.js +1 -1
  135. package/CapSteps/styles.module.scss.js +1 -1
  136. package/CapStepsAccordian/styles.module.scss.js +1 -1
  137. package/CapSupportVideosWrapper/index.js +1 -1
  138. package/CapSupportVideosWrapper/styles.module.scss.js +1 -1
  139. package/CapSwitch/styles.module.scss.js +1 -1
  140. package/CapTab/styles.module.scss.js +1 -1
  141. package/CapTabV3/styles.module.scss.js +1 -1
  142. package/CapTabV3/tests/CapTabV3.mockData.d.ts +26 -26
  143. package/CapTabV3/tests/CapTabV3.mockData.d.ts.map +1 -1
  144. package/CapTable/styles.module.scss.js +1 -1
  145. package/CapTag/styles.module.scss.js +1 -1
  146. package/CapTagDropdown/styles.module.scss.js +1 -1
  147. package/CapTimePicker/styles.module.scss.js +1 -1
  148. package/CapTooltip/styles.module.scss.js +1 -1
  149. package/CapTooltipWithInfo/styles.module.scss.js +1 -1
  150. package/CapTopBar/CapOrgSelect.module.scss.js +1 -1
  151. package/CapTopBar/styles.module.scss.js +1 -1
  152. package/CapTree/styles.module.scss.js +1 -1
  153. package/CapTreeSelect/styles.module.scss.js +1 -1
  154. package/CapUnifiedSelect/styles.module.scss.js +1 -1
  155. package/CapUploader/styles.module.scss.js +1 -1
  156. package/CapUserProfile/styles.module.scss.js +1 -1
  157. package/assets/HOCs/ComponentWithLabelHOC/styles.module.scss.js +1 -1
  158. package/index.d.ts +2 -0
  159. package/index.d.ts.map +1 -1
  160. package/index.js +223 -221
  161. package/package.json +1 -2
  162. package/utils/dayjs.d.ts +1 -0
  163. package/utils/dayjs.d.ts.map +1 -1
  164. package/utils/dayjs.js +1 -0
  165. /package/CapActionBar/{styles.module.css → styles.css} +0 -0
  166. /package/CapAdvancedIcon/{styles.module.css → styles.css} +0 -0
  167. /package/CapAlert/{styles.module.css → styles.css} +0 -0
  168. /package/CapAppNotEnabled/{styles.module.css → styles.css} +0 -0
  169. /package/CapAskAira/AudienceFilterBot/{styles.module.css → styles.css} +0 -0
  170. /package/CapAskAira/CapAiMediaGeneration/{styles.module.css → styles.css} +0 -0
  171. /package/CapAskAira/ConfigurationBot/{styles.module.css → styles.css} +0 -0
  172. /package/CapAskAira/ContentGenerationBot/{styles.module.css → styles.css} +0 -0
  173. /package/CapAskAira/DocumentationBot/{styles.module.css → styles.css} +0 -0
  174. /package/CapAskAira/DocumentationChatBot/{styles.module.css → styles.css} +0 -0
  175. /package/CapAskAira/RuleGenerationBot/{styles.module.css → styles.css} +0 -0
  176. /package/CapAskAira/RuleSummarizationBot/{styles.module.css → styles.css} +0 -0
  177. /package/CapAskAira/{styles.module.css → styles.css} +0 -0
  178. /package/CapBanner/{styles.module.css → styles.css} +0 -0
  179. /package/CapBlock/{styles.module.css → styles.css} +0 -0
  180. /package/CapButton/{styles.module.css → styles.css} +0 -0
  181. /package/CapCSVFileUploader/{styles.module.css → styles.css} +0 -0
  182. /package/CapCalendarDatePicker/{styles.module.css → styles.css} +0 -0
  183. /package/CapCard/{styles.module.css → styles.css} +0 -0
  184. /package/CapCardBox/{styles.module.css → styles.css} +0 -0
  185. /package/CapCarousel/{styles.module.css → styles.css} +0 -0
  186. /package/CapCheckbox/{styles.module.css → styles.css} +0 -0
  187. /package/CapColorPicker/{styles.module.css → styles.css} +0 -0
  188. /package/CapColoredTag/{styles.module.css → styles.css} +0 -0
  189. /package/CapColumn/{styles.module.css → styles.css} +0 -0
  190. /package/CapConditionPreview/{styles.module.css → styles.css} +0 -0
  191. /package/CapCustomCard/{styles.module.css → styles.css} +0 -0
  192. /package/CapCustomCarousel/{styles.module.css → styles.css} +0 -0
  193. /package/CapCustomCheckboxList/{styles.module.css → styles.css} +0 -0
  194. /package/CapCustomList/{styles.module.css → styles.css} +0 -0
  195. /package/CapCustomSelect/{styles.module.css → styles.css} +0 -0
  196. /package/CapDatePicker/{styles.module.css → styles.css} +0 -0
  197. /package/CapDateRangePicker/{styles.module.css → styles.css} +0 -0
  198. /package/CapDateTimePicker/{styles.module.css → styles.css} +0 -0
  199. /package/CapDateTimeRangePicker/{styles.module.css → styles.css} +0 -0
  200. /package/CapDropdown/{styles.module.css → styles.css} +0 -0
  201. /package/CapEmptyDivWithBorder/{styles.module.css → styles.css} +0 -0
  202. /package/CapError/{styles.module.css → styles.css} +0 -0
  203. /package/CapErrorBoundary/{styles.module.css → styles.css} +0 -0
  204. /package/CapErrorStateIllustration/{styles.module.css → styles.css} +0 -0
  205. /package/CapExpressionEditor/{styles.module.css → styles.css} +0 -0
  206. /package/CapForm/{styles.module.css → styles.css} +0 -0
  207. /package/CapFormItem/{styles.module.css → styles.css} +0 -0
  208. /package/CapGraph/{styles.module.css → styles.css} +0 -0
  209. /package/CapHamburgerMenu/{styles.module.css → styles.css} +0 -0
  210. /package/CapHeader/{styles.module.css → styles.css} +0 -0
  211. /package/CapHeading/{styles.module.css → styles.css} +0 -0
  212. /package/CapIcon/{styles.module.css → styles.css} +0 -0
  213. /package/CapIllustration/{styles.module.css → styles.css} +0 -0
  214. /package/CapImage/{styles.module.css → styles.css} +0 -0
  215. /package/CapImportMFEComponent/{styles.module.css → styles.css} +0 -0
  216. /package/CapInfoNote/{styles.module.css → styles.css} +0 -0
  217. /package/CapInput/{styles.module.css → styles.css} +0 -0
  218. /package/CapLabel/{styles.module.css → styles.css} +0 -0
  219. /package/CapLevelGraphRenderer/{styles.module.css → styles.css} +0 -0
  220. /package/CapLink/{styles.module.css → styles.css} +0 -0
  221. /package/CapList/{styles.module.css → styles.css} +0 -0
  222. /package/CapListLayout/{styles.module.css → styles.css} +0 -0
  223. /package/CapLogin/{styles.module.css → styles.css} +0 -0
  224. /package/CapModal/{styles.module.css → styles.css} +0 -0
  225. /package/CapMultiSelect/{styles.module.css → styles.css} +0 -0
  226. /package/CapMultiSelectDatePicker/{styles.module.css → styles.css} +0 -0
  227. /package/CapNavigation/{styles.module.css → styles.css} +0 -0
  228. /package/CapNotification/{styles.module.css → styles.css} +0 -0
  229. /package/CapNotificationDropdown/{styles.module.css → styles.css} +0 -0
  230. /package/CapPopover/{styles.module.css → styles.css} +0 -0
  231. /package/CapProgress/{styles.module.css → styles.css} +0 -0
  232. /package/CapRadio/{styles.module.css → styles.css} +0 -0
  233. /package/CapRadioButton/{styles.module.css → styles.css} +0 -0
  234. /package/CapRadioCard/{styles.module.css → styles.css} +0 -0
  235. /package/CapRadioGroup/{styles.module.css → styles.css} +0 -0
  236. /package/CapReorderComponent/{styles.module.css → styles.css} +0 -0
  237. /package/CapRoadMap/{styles.module.css → styles.css} +0 -0
  238. /package/CapRow/{styles.module.css → styles.css} +0 -0
  239. /package/CapSKUUploader/{styles.module.css → styles.css} +0 -0
  240. /package/CapSecondaryTopBar/{styles.module.css → styles.css} +0 -0
  241. /package/CapSelect/{styles.module.css → styles.css} +0 -0
  242. /package/CapShape/{styles.module.css → styles.css} +0 -0
  243. /package/CapSideBar/{_menuSearch.module.css → _menuSearch.css} +0 -0
  244. /package/CapSideBar/{styles.module.css → styles.css} +0 -0
  245. /package/CapSlideBox/{styles.module.css → styles.css} +0 -0
  246. /package/CapSlider/{styles.module.css → styles.css} +0 -0
  247. /package/CapSnackBar/{styles.module.css → styles.css} +0 -0
  248. /package/CapSomethingWentWrong/{styles.module.css → styles.css} +0 -0
  249. /package/CapSplit/{styles.module.css → styles.css} +0 -0
  250. /package/CapStatisticCard/{styles.module.css → styles.css} +0 -0
  251. /package/CapStatus/{styles.module.css → styles.css} +0 -0
  252. /package/CapSteps/{styles.module.css → styles.css} +0 -0
  253. /package/CapStepsAccordian/{styles.module.css → styles.css} +0 -0
  254. /package/CapSupportVideosWrapper/{styles.module.css → styles.css} +0 -0
  255. /package/CapSwitch/{styles.module.css → styles.css} +0 -0
  256. /package/CapTab/{styles.module.css → styles.css} +0 -0
  257. /package/CapTabV3/{styles.module.css → styles.css} +0 -0
  258. /package/CapTable/{styles.module.css → styles.css} +0 -0
  259. /package/CapTag/{styles.module.css → styles.css} +0 -0
  260. /package/CapTagDropdown/{styles.module.css → styles.css} +0 -0
  261. /package/CapTimePicker/{styles.module.css → styles.css} +0 -0
  262. /package/CapTooltip/{styles.module.css → styles.css} +0 -0
  263. /package/CapTooltipWithInfo/{styles.module.css → styles.css} +0 -0
  264. /package/CapTopBar/{CapOrgSelect.module.css → CapOrgSelect.css} +0 -0
  265. /package/CapTopBar/{styles.module.css → styles.css} +0 -0
  266. /package/CapTree/{styles.module.css → styles.css} +0 -0
  267. /package/CapTreeSelect/{styles.module.css → styles.css} +0 -0
  268. /package/CapUnifiedSelect/{styles.module.css → styles.css} +0 -0
  269. /package/CapUploader/{styles.module.css → styles.css} +0 -0
  270. /package/CapUserProfile/{styles.module.css → styles.css} +0 -0
  271. /package/assets/HOCs/ComponentWithLabelHOC/{styles.module.css → styles.css} +0 -0
@@ -9,7 +9,7 @@ const toggleTooltip = (visible, isTooltipVisible, todayTooltipProps, rootTooltip
9
9
  }
10
10
  if (visible) {
11
11
  rootTooltipRef.current.render(
12
- /* @__PURE__ */ jsx(CapTooltip, { visible: true, ...todayTooltipProps, children: /* @__PURE__ */ jsx("div", {}) })
12
+ /* @__PURE__ */ jsx(CapTooltip, { open: true, ...todayTooltipProps, children: /* @__PURE__ */ jsx("div", {}) })
13
13
  );
14
14
  isTooltipVisible.current = true;
15
15
  } else if (isTooltipVisible.current) {
@@ -31,18 +31,18 @@ const togglePopover = ({
31
31
  if (!rootPopoverRef.current) {
32
32
  rootPopoverRef.current = createRoot(knobElement);
33
33
  }
34
- if (visible) {
34
+ if (visible && popoverContent) {
35
35
  const Component = popoverContent;
36
36
  const body = (_a = document.getElementsByTagName("body")) == null ? void 0 : _a[0];
37
37
  rootPopoverRef.current.render(
38
38
  /* @__PURE__ */ jsx(
39
39
  CapPopover,
40
40
  {
41
- visible: true,
42
- arrowPointAtCenter: true,
41
+ open: true,
42
+ arrow: { pointAtCenter: true },
43
43
  placement: popoverPlacement,
44
- content: /* @__PURE__ */ jsx(Component, { ...popoverContentProps }),
45
- overlayClassName: "event-calendar-popover-overlay",
44
+ content: /* @__PURE__ */ jsx(Component, { ...popoverContentProps ?? {} }),
45
+ classNames: { root: "event-calendar-popover-overlay" },
46
46
  getPopupContainer: () => body,
47
47
  children: /* @__PURE__ */ jsx("div", {})
48
48
  }
@@ -1,15 +1,5 @@
1
- import PropTypes from 'prop-types';
2
- declare const DayDropdown: {
3
- ({ fetchDay, dayLabels, day }: {
4
- fetchDay: any;
5
- dayLabels: any;
6
- day: any;
7
- }): import("react/jsx-runtime").JSX.Element;
8
- propTypes: {
9
- fetchDay: PropTypes.Requireable<(...args: any[]) => any>;
10
- day: PropTypes.Requireable<number>;
11
- dayLabels: PropTypes.Requireable<any[]>;
12
- };
13
- };
1
+ import React from 'react';
2
+ import type { DayDropdownProps } from '../../types';
3
+ declare const DayDropdown: React.FC<DayDropdownProps>;
14
4
  export default DayDropdown;
15
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../components/CapEventCalendar/components/DayDropdown/index.tsx"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AASnC,QAAA,MAAM,WAAW;;;;;;;;;;;CAmBhB,CAAC;AAQF,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../components/CapEventCalendar/components/DayDropdown/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAKvC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAiC3C,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -1,19 +1,37 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import PropTypes from "prop-types";
3
- import CapButton from "../../../CapButton/index.js";
4
- import CapDropdown from "../../../CapDropdown/index.js";
5
- import CapIcon from "../../../CapIcon/index.js";
6
- import CapMenu from "../../../CapMenu/index.js";
7
- import { CAP_G01 } from "../../../styles/_variables.js";
2
+ import { useMemo } from "react";
3
+ import CapUnifiedSelect from "../../../CapUnifiedSelect/index.js";
4
+ import { SELECT_TYPES } from "../../../CapUnifiedSelect/constants.js";
8
5
  const DayDropdown = ({ fetchDay, dayLabels, day }) => {
9
- const handleMenuItemClick = (dayNum) => fetchDay(dayNum);
10
- const menu = /* @__PURE__ */ jsx(CapMenu, { selectable: true, children: dayLabels.map((label, index) => /* @__PURE__ */ jsx(CapMenu.Item, { onClick: () => handleMenuItemClick(index), children: label }, label)) });
11
- return /* @__PURE__ */ jsx(CapDropdown, { overlay: menu, placement: "bottomCenter", children: /* @__PURE__ */ jsx(CapButton, { type: "flat", suffix: /* @__PURE__ */ jsx(CapIcon, { size: "m", type: "chevron-down", color: CAP_G01 }), children: dayLabels[day] }) });
12
- };
13
- DayDropdown.propTypes = {
14
- fetchDay: PropTypes.func,
15
- day: PropTypes.number,
16
- dayLabels: PropTypes.array
6
+ const options = useMemo(
7
+ () => dayLabels.map((label, index) => ({
8
+ label,
9
+ value: index,
10
+ key: index
11
+ })),
12
+ [dayLabels]
13
+ );
14
+ const selectedDayLabel = useMemo(() => {
15
+ return dayLabels[day] || "";
16
+ }, [dayLabels, day]);
17
+ const handleChange = (value) => {
18
+ if (typeof value === "number") {
19
+ fetchDay(value);
20
+ }
21
+ };
22
+ return /* @__PURE__ */ jsx(
23
+ CapUnifiedSelect,
24
+ {
25
+ className: "cap-event-calendar__day-dropdown",
26
+ type: SELECT_TYPES.SELECT,
27
+ options,
28
+ value: day,
29
+ onChange: handleChange,
30
+ showSearch: false,
31
+ "aria-label": selectedDayLabel,
32
+ size: "middle"
33
+ }
34
+ );
17
35
  };
18
36
  export {
19
37
  DayDropdown as default
@@ -1,11 +1,5 @@
1
- import PropTypes from 'prop-types';
2
- declare const MonthHeader: {
3
- ({ displayMonths }: {
4
- displayMonths: any;
5
- }): import("react/jsx-runtime").JSX.Element;
6
- propTypes: {
7
- displayMonths: PropTypes.Requireable<any[]>;
8
- };
9
- };
1
+ import React from 'react';
2
+ import type { MonthHeaderProps } from '../../types';
3
+ declare const MonthHeader: React.FC<MonthHeaderProps>;
10
4
  export default MonthHeader;
11
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../components/CapEventCalendar/components/MonthHeader/index.tsx"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAGnC,QAAA,MAAM,WAAW;;;;;;;CAWhB,CAAC;AAMF,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../components/CapEventCalendar/components/MonthHeader/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAIpD,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAS3C,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -1,12 +1,7 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import PropTypes from "prop-types";
3
- const MonthHeader = ({ displayMonths }) => /* @__PURE__ */ jsx("div", { className: "event-calendar__month-header", children: (displayMonths == null ? void 0 : displayMonths.length) && displayMonths.map((month, index) => /* @__PURE__ */ jsxs("div", { className: "event-calendar__month-header__label", children: [
4
- " ",
5
- month.name
6
- ] }, index + month)) });
7
- MonthHeader.propTypes = {
8
- displayMonths: PropTypes.array
9
- };
1
+ import { jsx } from "react/jsx-runtime";
2
+ import CapLabelWithStatic from "../../../CapLabel/index.js";
3
+ import styles from "./monthHeaderStyles.module.scss.js";
4
+ const MonthHeader = ({ displayMonths }) => /* @__PURE__ */ jsx("div", { className: styles["month-header"], children: (displayMonths == null ? void 0 : displayMonths.length) && displayMonths.map((month, index) => /* @__PURE__ */ jsx(CapLabelWithStatic, { className: styles["month-header__label"], type: "label16", children: month.name }, index + month.name)) });
10
5
  export {
11
6
  MonthHeader as default
12
7
  };
@@ -0,0 +1,20 @@
1
+ /* Color Palette */
2
+ /* Fonts */
3
+ /* Backward Compatibility Aliases */
4
+ /* Component Heights */
5
+ /* Border Radius */
6
+ /* Border Width */
7
+ /* Transition */
8
+ /* Timezones Footer */
9
+ .month-header {
10
+ display: flex;
11
+ justify-content: center;
12
+ position: relative;
13
+ text-align: center;
14
+ top: 0;
15
+ margin-bottom: 0.714rem;
16
+ margin-top: 1.785rem;
17
+ }
18
+ .month-header__label {
19
+ width: 33.33%;
20
+ }
@@ -0,0 +1,7 @@
1
+ import './monthHeaderStyles.css';const styles = {
2
+ "month-header": "month-header",
3
+ "month-header__label": "month-header__label"
4
+ };
5
+ export {
6
+ styles as default
7
+ };
@@ -0,0 +1,15 @@
1
+ @import '../../../styles/_variables.scss';
2
+
3
+ .month-header {
4
+ display: flex;
5
+ justify-content: center;
6
+ position: relative;
7
+ text-align: center;
8
+ top: 0;
9
+ margin-bottom: 0.714rem;
10
+ margin-top: 1.785rem;
11
+
12
+ &__label {
13
+ width: 33.33%;
14
+ }
15
+ }
@@ -1,72 +1,10 @@
1
- export declare const drawHeadingText: ({ context, x, y, height, text }: {
2
- context: any;
3
- x: any;
4
- y: any;
5
- height: any;
6
- text: any;
7
- }) => void;
8
- export declare const drawCircle: ({ context, x, y, radius, color }: {
9
- context: any;
10
- x: any;
11
- y: any;
12
- radius: any;
13
- color: any;
14
- }) => void;
15
- export declare const drawDashedLines: ({ context, x, y, x1, y1 }: {
16
- context: any;
17
- x: any;
18
- y: any;
19
- x1: any;
20
- y1: any;
21
- }) => void;
22
- export declare const drawTodayLine: ({ context, x, y, x1, y1, mouseX, mouseY }: {
23
- context: any;
24
- x: any;
25
- y: any;
26
- x1: any;
27
- y1: any;
28
- mouseX: any;
29
- mouseY: any;
30
- }) => any;
31
- export declare const drawLineSeperator: ({ context, x, y, x1, y1 }: {
32
- context: any;
33
- x: any;
34
- y: any;
35
- x1: any;
36
- y1: any;
37
- }) => void;
38
- export declare const drawRoundRect: ({ context, x, y, width, height, radius: radiusParam, openLeft, openRight, fillStyle, mouseX, mouseY, }: {
39
- context: any;
40
- x: any;
41
- y: any;
42
- width: any;
43
- height: any;
44
- radius: any;
45
- openLeft: any;
46
- openRight: any;
47
- fillStyle: any;
48
- mouseX: any;
49
- mouseY: any;
50
- }) => any;
51
- export declare const doEllipsis: ({ context, text, maxWidth }: {
52
- context: any;
53
- text: any;
54
- maxWidth: any;
55
- }) => any;
56
- export declare const drawRoundRectWithText: ({ context, x, y, width, height, bgColor, borderRadius, text, color, textPadding, openLeft, openRight, mouseX, mouseY, }: {
57
- context: any;
58
- x: any;
59
- y: any;
60
- width: any;
61
- height: any;
62
- bgColor: any;
63
- borderRadius?: number;
64
- text: any;
65
- color: any;
66
- textPadding: any;
67
- openLeft: any;
68
- openRight: any;
69
- mouseX: any;
70
- mouseY: any;
71
- }) => any;
1
+ import type { DrawHeadingTextParams, DrawCircleParams, DrawDashedLinesParams, DrawTodayLineParams, DrawLineSeperatorParams, DrawRoundRectParams, DoEllipsisParams, DrawRoundRectWithTextParams } from './types';
2
+ export declare const drawHeadingText: ({ context, x, y, height, text }: DrawHeadingTextParams) => void;
3
+ export declare const drawCircle: ({ context, x, y, radius, color }: DrawCircleParams) => void;
4
+ export declare const drawDashedLines: ({ context, x, y, x1, y1 }: DrawDashedLinesParams) => void;
5
+ export declare const drawTodayLine: ({ context, x, y, x1, y1, mouseX, mouseY, }: DrawTodayLineParams) => boolean | void;
6
+ export declare const drawLineSeperator: ({ context, x, y, x1, y1 }: DrawLineSeperatorParams) => void;
7
+ export declare const drawRoundRect: ({ context, x, y, width, height, radius: radiusParam, openLeft, openRight, fillStyle, mouseX, mouseY, }: DrawRoundRectParams) => boolean | void;
8
+ export declare const doEllipsis: ({ context, text, maxWidth }: DoEllipsisParams) => string;
9
+ export declare const drawRoundRectWithText: ({ context, x, y, width, height, bgColor, borderRadius, text, color, textPadding, openLeft, openRight, mouseX, mouseY, }: DrawRoundRectWithTextParams) => boolean | void;
72
10
  //# sourceMappingURL=drawUtils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"drawUtils.d.ts","sourceRoot":"","sources":["../../components/CapEventCalendar/drawUtils.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,GAAI;;;;;;CAA+B,SAW9D,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI;;;;;;CAAgC,SAO1D,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI;;;;;;CAAyB,SAWxD,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI;;;;;;;;CAAyC,QAmBtE,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI;;;;;;CAAyB,SAS1D,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI;;;;;;;;;;;;CAY7B,QA0CA,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI;;;;CAA2B,QAarD,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI;;;;;;;;;;;;;;;CAerC,QA0CA,CAAC"}
1
+ {"version":3,"file":"drawUtils.d.ts","sourceRoot":"","sources":["../../components/CapEventCalendar/drawUtils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,EACrB,mBAAmB,EACnB,uBAAuB,EACvB,mBAAmB,EACnB,gBAAgB,EAChB,2BAA2B,EAC5B,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,eAAe,GAAI,iCAAiC,qBAAqB,SAWrF,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,kCAAkC,gBAAgB,SAO5E,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,2BAA2B,qBAAqB,SAW/E,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,4CAQ3B,mBAAmB,KAAG,OAAO,GAAG,IAmBlC,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,2BAA2B,uBAAuB,SASnF,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,wGAY3B,mBAAmB,KAAG,OAAO,GAAG,IA0ClC,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,6BAA6B,gBAAgB,KAAG,MAa1E,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,yHAenC,2BAA2B,KAAG,OAAO,GAAG,IA0C1C,CAAC"}
@@ -1,4 +1,4 @@
1
- import { CAP_G06, CAP_WHITE, CAP_G01, CAP_G11, FONT_COLOR_05 } from "../styles/_variables.js";
1
+ import { CAP_WHITE, CAP_G01, CAP_G06, CAP_G11, FONT_COLOR_05 } from "../styles/_variables.js";
2
2
  const drawHeadingText = ({ context, x, y, height, text }) => {
3
3
  context.beginPath();
4
4
  context.fillStyle = CAP_WHITE;
@@ -27,7 +27,15 @@ const drawDashedLines = ({ context, x, y, x1, y1 }) => {
27
27
  context.setLineDash([]);
28
28
  context.closePath();
29
29
  };
30
- const drawTodayLine = ({ context, x, y, x1, y1, mouseX, mouseY }) => {
30
+ const drawTodayLine = ({
31
+ context,
32
+ x,
33
+ y,
34
+ x1,
35
+ y1,
36
+ mouseX,
37
+ mouseY
38
+ }) => {
31
39
  context.beginPath();
32
40
  const radius = 4;
33
41
  drawCircle({
@@ -40,7 +48,7 @@ const drawTodayLine = ({ context, x, y, x1, y1, mouseX, mouseY }) => {
40
48
  context.strokeStyle = FONT_COLOR_05;
41
49
  context.moveTo(x, y);
42
50
  context.lineTo(x1, y1);
43
- if (mouseX) {
51
+ if (mouseX && mouseY) {
44
52
  context.rect(x - 3, y, 6, y1);
45
53
  return context.isPointInPath(mouseX, mouseY);
46
54
  }
@@ -91,7 +99,7 @@ const drawRoundRect = ({
91
99
  context.quadraticCurveTo(x, y + height, x, y + height - radius.bl);
92
100
  context.lineTo(x, y + radius.tl);
93
101
  context.quadraticCurveTo(x, y, x + radius.tl, y);
94
- if (mouseX) {
102
+ if (mouseX && mouseY) {
95
103
  return context.isPointInPath(mouseX, mouseY);
96
104
  }
97
105
  context.fill();
@@ -1,81 +1,5 @@
1
- import PropTypes from 'prop-types';
2
- import './styles.scss';
3
- declare const CapEventCalendar: {
4
- ({ calendarDate, events, popoverContent, onQuarterChange, selectedQuarter, calendarGridLineLabel, dayLabels, allQuartersLabel, monthLabels, todayTooltipProps, dashLineOffsetY, eventHeight, eventRowGap, textPadding, eventStartYOffset, minCanvasHeight, canvasFont, popoverPlacement, emptyState, emptyStateTitle, emptyStateDescription, emptyStateButtonLabel, onEmptyStateButtonClick, isButtonDisabled, }: {
5
- calendarDate?: string;
6
- events: any;
7
- popoverContent: any;
8
- onQuarterChange: any;
9
- selectedQuarter: any;
10
- calendarGridLineLabel: any;
11
- dayLabels: any;
12
- allQuartersLabel: any;
13
- monthLabels: any;
14
- todayTooltipProps: any;
15
- dashLineOffsetY: any;
16
- eventHeight: any;
17
- eventRowGap: any;
18
- textPadding: any;
19
- eventStartYOffset: any;
20
- minCanvasHeight: any;
21
- canvasFont: any;
22
- popoverPlacement: any;
23
- emptyState: any;
24
- emptyStateTitle: any;
25
- emptyStateDescription: any;
26
- emptyStateButtonLabel: any;
27
- onEmptyStateButtonClick: any;
28
- isButtonDisabled: any;
29
- }): import("react/jsx-runtime").JSX.Element;
30
- propTypes: {
31
- calendarDate: PropTypes.Requireable<string>;
32
- events: PropTypes.Requireable<any[]>;
33
- popoverContent: PropTypes.Requireable<any>;
34
- onQuarterChange: PropTypes.Requireable<(...args: any[]) => any>;
35
- selectedQuarter: PropTypes.Requireable<string>;
36
- calendarGridLineLabel: PropTypes.Requireable<string>;
37
- dayLabels: PropTypes.Requireable<any[]>;
38
- allQuartersLabel: PropTypes.Requireable<any[]>;
39
- monthLabels: PropTypes.Requireable<any[]>;
40
- todayTooltipProps: PropTypes.Requireable<object>;
41
- dashLineOffsetY: PropTypes.Requireable<number>;
42
- eventHeight: PropTypes.Requireable<number>;
43
- eventRowGap: PropTypes.Requireable<number>;
44
- textPadding: PropTypes.Requireable<number>;
45
- eventStartYOffset: PropTypes.Requireable<number>;
46
- minCanvasHeight: PropTypes.Requireable<number>;
47
- canvasFont: PropTypes.Requireable<string>;
48
- popoverPlacement: PropTypes.Requireable<string>;
49
- };
50
- defaultProps: {
51
- popoverContent: {
52
- ({ title }: {
53
- title: any;
54
- }): import("react/jsx-runtime").JSX.Element;
55
- propTypes: {
56
- title: PropTypes.Requireable<string>;
57
- };
58
- };
59
- dashLineOffsetY: number;
60
- eventHeight: number;
61
- eventRowGap: number;
62
- textPadding: number;
63
- eventStartYOffset: number;
64
- minCanvasHeight: number;
65
- todayTooltipProps: {
66
- title: string;
67
- };
68
- allQuartersLabel: string[];
69
- dayLabels: string[];
70
- monthLabels: string[];
71
- canvasFont: string;
72
- calendarGridLineLabel: string;
73
- popoverPlacement: string;
74
- emptyStateTitle: string;
75
- emptyStateDescription: string;
76
- emptyStateButtonLabel: string;
77
- isButtonDisabled: boolean;
78
- };
79
- };
80
- export default CapEventCalendar;
1
+ import React from 'react';
2
+ import type { CapEventCalendarProps } from './types';
3
+ declare const _default: React.ComponentType<Omit<CapEventCalendarProps, "intl">>;
4
+ export default _default;
81
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../components/CapEventCalendar/index.tsx"],"names":[],"mappings":"AACA,OAAO,SAAS,MAAM,YAAY,CAAC;AAenC,OAAO,eAAe,CAAC;AAcvB,QAAA,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsKrB,CAAC;AA2CF,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../components/CapEventCalendar/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAkBnD,OAAO,KAAK,EAAE,qBAAqB,EAAoC,MAAM,SAAS,CAAC;;AAyMvF,wBAA4C"}
@@ -1,49 +1,49 @@
1
1
  import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
2
  import classNames from "classnames";
3
- import PropTypes from "prop-types";
4
3
  import { useState, useEffect } from "react";
4
+ import { injectIntl } from "react-intl";
5
5
  import "../utils/dayjs.js";
6
6
  import EmptyStateIllustrationForPromos from "../assets/images/EmptyStateIllustrationForPromos.png.js";
7
7
  import CapIcon from "../CapIcon/index.js";
8
8
  import CapIllustration from "../CapIllustration/index.js";
9
+ import CapLabelWithStatic from "../CapLabel/index.js";
9
10
  import CapRow from "../CapRow/index.js";
10
11
  import { FONT_SIZE_S, FONT_FAMILY } from "../styles/_variables.js";
11
12
  import CalendarCanvas from "./CalendarCanvas/index.js";
12
13
  import DayDropdown from "./components/DayDropdown/index.js";
13
14
  import MonthHeader from "./components/MonthHeader/index.js";
14
- import { QUARTERS, MONTH_LABELS, DAY_LABELS, QUARTER_LABELS } from "./constants.js";
15
- import './styles.css';/* empty css */
15
+ import { QUARTERS, QUARTER_LABELS, DAY_LABELS, MONTH_LABELS } from "./constants.js";
16
+ import messages from "./messages.js";
17
+ import styles from "./styles.module.scss.js";
16
18
  import { splitMonthsArrayToQuarterChunks, getMonthsForQuarter, formatDataToSuitCanvas, handleYearChange } from "./utils.js";
17
19
  import dayjs from "dayjs";
18
20
  const DefaultPopover = ({ title }) => /* @__PURE__ */ jsx("div", { children: title });
19
- DefaultPopover.propTypes = {
20
- title: PropTypes.string
21
- };
22
21
  const CapEventCalendar = ({
22
+ intl: { formatMessage },
23
23
  calendarDate = dayjs().format(),
24
- events,
25
- popoverContent,
24
+ events = [],
25
+ popoverContent = DefaultPopover,
26
26
  onQuarterChange,
27
27
  selectedQuarter,
28
28
  calendarGridLineLabel,
29
- dayLabels,
30
- allQuartersLabel,
31
- monthLabels,
29
+ dayLabels = DAY_LABELS,
30
+ allQuartersLabel = QUARTER_LABELS,
31
+ monthLabels = MONTH_LABELS,
32
32
  todayTooltipProps,
33
- dashLineOffsetY,
34
- eventHeight,
35
- eventRowGap,
36
- textPadding,
37
- eventStartYOffset,
38
- minCanvasHeight,
39
- canvasFont,
40
- popoverPlacement,
33
+ dashLineOffsetY = 20,
34
+ eventHeight = 24,
35
+ eventRowGap = 12,
36
+ textPadding = 12,
37
+ eventStartYOffset = 40,
38
+ minCanvasHeight = 0,
39
+ canvasFont = `normal ${FONT_SIZE_S} ${FONT_FAMILY}`,
40
+ popoverPlacement = "leftTop",
41
41
  emptyState,
42
42
  emptyStateTitle,
43
43
  emptyStateDescription,
44
44
  emptyStateButtonLabel,
45
45
  onEmptyStateButtonClick,
46
- isButtonDisabled
46
+ isButtonDisabled = false
47
47
  }) => {
48
48
  const [carouselDate, setCarouselDate] = useState(calendarDate);
49
49
  const [quarter, setQuarter] = useState(
@@ -54,25 +54,27 @@ const CapEventCalendar = ({
54
54
  const [error, showError] = useState(false);
55
55
  const [dayGrid, setDayGrid] = useState(1);
56
56
  const [quarterMonths] = useState(splitMonthsArrayToQuarterChunks(monthLabels));
57
+ const resolvedCalendarGridLineLabel = calendarGridLineLabel || formatMessage(messages.calendarGridLineLabel);
58
+ const resolvedEmptyStateTitle = emptyStateTitle || formatMessage(messages.emptyStateTitle);
59
+ const resolvedEmptyStateDescription = emptyStateDescription || formatMessage(messages.emptyStateDescription);
60
+ const resolvedEmptyStateButtonLabel = emptyStateButtonLabel || formatMessage(messages.emptyStateButtonLabel);
61
+ const resolvedTodayTooltipProps = todayTooltipProps || {
62
+ title: formatMessage(messages.todayLabel)
63
+ };
57
64
  useEffect(() => {
58
65
  const _quarter = selectedQuarter ? QUARTERS[selectedQuarter] : quarter;
59
66
  setDisplayMonths(
60
67
  getMonthsForQuarter(_quarter, quarterMonths)
61
68
  //show months of the quarter
62
69
  );
63
- setFormattedEvents(
64
- formatDataToSuitCanvas(
65
- events,
66
- selectedQuarter ? QUARTERS[selectedQuarter] : quarter || dayjs().quarter()
67
- )
68
- );
70
+ setFormattedEvents(formatDataToSuitCanvas(events));
69
71
  }, [events]);
70
72
  const handleCarouselClick = (currentQuarter, date, increment, referenceDate) => {
71
73
  if (increment) showError(false);
72
74
  const values = handleYearChange(currentQuarter, date, increment, referenceDate);
73
75
  if (values) {
74
76
  setCarouselDate(values[1]);
75
- onQuarterChange(values[0], dayjs(values[1]));
77
+ onQuarterChange == null ? void 0 : onQuarterChange(values[0], dayjs(values[1]));
76
78
  if (values[2]) showError(true);
77
79
  return values[0];
78
80
  }
@@ -94,26 +96,30 @@ const CapEventCalendar = ({
94
96
  const onClickQuarterRight = () => handleQuarterSelection(false);
95
97
  const getIllustrationProps = (hasAccess) => ({
96
98
  illustrationImage: EmptyStateIllustrationForPromos,
97
- title: emptyStateTitle,
99
+ title: resolvedEmptyStateTitle,
98
100
  hasAccess,
99
- description: emptyStateDescription,
101
+ description: resolvedEmptyStateDescription,
100
102
  descriptionPosition: "bottom",
101
- buttonLabel: emptyStateButtonLabel,
103
+ buttonLabel: resolvedEmptyStateButtonLabel,
102
104
  //prevents the required warning in the console
103
- onClick: onEmptyStateButtonClick,
105
+ onClick: onEmptyStateButtonClick ?? (() => {
106
+ }),
104
107
  //prevents the required warning in the console
105
108
  disabled: isButtonDisabled
106
109
  });
107
110
  return /* @__PURE__ */ jsxs(Fragment, { children: [
108
- /* @__PURE__ */ jsxs("div", { className: "event-calendar__header", children: [
109
- /* @__PURE__ */ jsxs("div", { className: "event-calendar__header__left", children: [
111
+ /* @__PURE__ */ jsxs("div", { className: styles["event-calendar__header"], children: [
112
+ /* @__PURE__ */ jsxs("div", { className: styles["event-calendar__header__left"], children: [
110
113
  /* @__PURE__ */ jsxs("div", { children: [
111
114
  /* @__PURE__ */ jsx(
112
115
  CapIcon,
113
116
  {
114
117
  type: "chevron-left",
115
118
  style: { cursor: "pointer" },
116
- className: classNames({ "disable-left": error, "carousel-icon": true }),
119
+ className: classNames({
120
+ [styles["disable-left"]]: error,
121
+ [styles["carousel-icon"]]: true
122
+ }),
117
123
  onClick: onClickQuarterLeft,
118
124
  "data-testid": "event-calander-left-chevron"
119
125
  }
@@ -122,30 +128,38 @@ const CapEventCalendar = ({
122
128
  CapIcon,
123
129
  {
124
130
  type: "chevron-right",
125
- className: "carousel-icon",
131
+ className: styles["carousel-icon"],
126
132
  onClick: onClickQuarterRight,
127
133
  "data-testid": "event-calander-right-chevron"
128
134
  }
129
135
  )
130
136
  ] }),
131
- /* @__PURE__ */ jsxs("div", { className: "quarter-label", children: [
132
- /* @__PURE__ */ jsx("span", { children: allQuartersLabel[quarter - 1] }),
133
- dayjs(carouselDate).year()
137
+ /* @__PURE__ */ jsxs(CapRow, { className: styles["quarter-label"], align: "middle", justify: "center", children: [
138
+ /* @__PURE__ */ jsx(CapLabelWithStatic, { className: styles["quarter-label__text"], type: "label17", children: allQuartersLabel[quarter - 1] }),
139
+ /* @__PURE__ */ jsx(CapLabelWithStatic, { className: styles["quarter-label__text"], type: "label17", children: dayjs(carouselDate).year() })
134
140
  ] })
135
141
  ] }),
136
- /* @__PURE__ */ jsxs("div", { className: "event-calendar__header__right", children: [
137
- calendarGridLineLabel,
138
- /* @__PURE__ */ jsx(DayDropdown, { fetchDay: handleDayGridSelection, day: dayGrid, dayLabels })
139
- ] })
142
+ /* @__PURE__ */ jsxs(
143
+ CapRow,
144
+ {
145
+ className: styles["event-calendar__header__right"],
146
+ justify: "space-between",
147
+ align: "middle",
148
+ children: [
149
+ /* @__PURE__ */ jsx(CapLabelWithStatic, { type: "label15", children: resolvedCalendarGridLineLabel }),
150
+ /* @__PURE__ */ jsx(DayDropdown, { fetchDay: handleDayGridSelection, day: dayGrid, dayLabels })
151
+ ]
152
+ }
153
+ )
140
154
  ] }),
141
- emptyState && !formattedEvents.length && /* @__PURE__ */ jsx(CapRow, { children: /* @__PURE__ */ jsx(CapIllustration, { ...getIllustrationProps(true) }) }),
155
+ emptyState && !formattedEvents.length && /* @__PURE__ */ jsx(CapRow, { align: "middle", justify: "center", children: /* @__PURE__ */ jsx(CapIllustration, { ...getIllustrationProps(true) }) }),
142
156
  formattedEvents.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
143
157
  /* @__PURE__ */ jsx(MonthHeader, { displayMonths }),
144
158
  /* @__PURE__ */ jsx(
145
159
  CalendarCanvas,
146
160
  {
147
161
  ...{
148
- todayTooltipProps,
162
+ todayTooltipProps: resolvedTodayTooltipProps,
149
163
  formattedEvents,
150
164
  dayGrid,
151
165
  displayMonths,
@@ -165,46 +179,7 @@ const CapEventCalendar = ({
165
179
  ] })
166
180
  ] });
167
181
  };
168
- CapEventCalendar.propTypes = {
169
- calendarDate: PropTypes.string,
170
- events: PropTypes.array,
171
- popoverContent: PropTypes.any,
172
- onQuarterChange: PropTypes.func,
173
- selectedQuarter: PropTypes.string,
174
- calendarGridLineLabel: PropTypes.string,
175
- dayLabels: PropTypes.array,
176
- allQuartersLabel: PropTypes.array,
177
- monthLabels: PropTypes.array,
178
- todayTooltipProps: PropTypes.object,
179
- dashLineOffsetY: PropTypes.number,
180
- eventHeight: PropTypes.number,
181
- eventRowGap: PropTypes.number,
182
- textPadding: PropTypes.number,
183
- eventStartYOffset: PropTypes.number,
184
- minCanvasHeight: PropTypes.number,
185
- canvasFont: PropTypes.string,
186
- popoverPlacement: PropTypes.string
187
- };
188
- CapEventCalendar.defaultProps = {
189
- popoverContent: DefaultPopover,
190
- dashLineOffsetY: 20,
191
- eventHeight: 24,
192
- eventRowGap: 12,
193
- textPadding: 12,
194
- eventStartYOffset: 40,
195
- minCanvasHeight: 0,
196
- todayTooltipProps: { title: "Today" },
197
- allQuartersLabel: QUARTER_LABELS,
198
- dayLabels: DAY_LABELS,
199
- monthLabels: MONTH_LABELS,
200
- canvasFont: `normal ${FONT_SIZE_S} ${FONT_FAMILY}`,
201
- calendarGridLineLabel: "Calendar Grid Line",
202
- popoverPlacement: "leftTop",
203
- emptyStateTitle: "You have no events for this quarter",
204
- emptyStateDescription: "Please create an event to view it here",
205
- emptyStateButtonLabel: "Create Event",
206
- isButtonDisabled: false
207
- };
182
+ const index = injectIntl(CapEventCalendar);
208
183
  export {
209
- CapEventCalendar as default
184
+ index as default
210
185
  };