@capillarytech/blaze-ui 6.0.4 → 6.1.0

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 (54) hide show
  1. package/CapEventCalendar/CalendarCanvas/index.d.ts +52 -3
  2. package/CapEventCalendar/CalendarCanvas/index.d.ts.map +1 -1
  3. package/CapEventCalendar/CalendarCanvas/index.js +50 -31
  4. package/CapEventCalendar/CalendarCanvas/utils.d.ts +9 -5
  5. package/CapEventCalendar/CalendarCanvas/utils.d.ts.map +1 -1
  6. package/CapEventCalendar/CalendarCanvas/utils.js +6 -6
  7. package/CapEventCalendar/components/DayDropdown/index.d.ts +13 -3
  8. package/CapEventCalendar/components/DayDropdown/index.d.ts.map +1 -1
  9. package/CapEventCalendar/components/DayDropdown/index.js +14 -32
  10. package/CapEventCalendar/components/MonthHeader/index.d.ts +9 -3
  11. package/CapEventCalendar/components/MonthHeader/index.d.ts.map +1 -1
  12. package/CapEventCalendar/components/MonthHeader/index.js +9 -4
  13. package/CapEventCalendar/drawUtils.d.ts +71 -9
  14. package/CapEventCalendar/drawUtils.d.ts.map +1 -1
  15. package/CapEventCalendar/drawUtils.js +4 -12
  16. package/CapEventCalendar/index.d.ts +80 -4
  17. package/CapEventCalendar/index.d.ts.map +1 -1
  18. package/CapEventCalendar/index.js +85 -60
  19. package/CapEventCalendar/styles.css +81 -9
  20. package/CapEventCalendar/styles.scss +107 -34
  21. package/CapEventCalendar/utils.d.ts +9 -11
  22. package/CapEventCalendar/utils.d.ts.map +1 -1
  23. package/CapEventCalendar/utils.js +7 -10
  24. package/CapSelectFilter/index.d.ts.map +1 -1
  25. package/CapSelectFilter/index.js +10 -11
  26. package/CapSelectFilter/styles.css +11 -10
  27. package/CapSelectFilter/styles.module.scss.js +8 -10
  28. package/CapSelectFilter/styles.scss +11 -8
  29. package/CapSelectFilter/types.d.ts +1 -1
  30. package/CapSelectFilter/types.d.ts.map +1 -1
  31. package/CapTabV3/tests/CapTabV3.mockData.d.ts +26 -26
  32. package/CapTabV3/tests/CapTabV3.mockData.d.ts.map +1 -1
  33. package/index.d.ts +0 -2
  34. package/index.d.ts.map +1 -1
  35. package/index.js +221 -223
  36. package/package.json +1 -1
  37. package/utils/dayjs.d.ts +0 -1
  38. package/utils/dayjs.d.ts.map +1 -1
  39. package/utils/dayjs.js +0 -1
  40. package/CapEventCalendar/CalendarCanvas/calendarCanvasStyles.css +0 -21
  41. package/CapEventCalendar/CalendarCanvas/calendarCanvasStyles.module.scss.js +0 -8
  42. package/CapEventCalendar/CalendarCanvas/calendarCanvasStyles.scss +0 -17
  43. package/CapEventCalendar/components/MonthHeader/monthHeaderStyles.css +0 -20
  44. package/CapEventCalendar/components/MonthHeader/monthHeaderStyles.module.scss.js +0 -7
  45. package/CapEventCalendar/components/MonthHeader/monthHeaderStyles.scss +0 -15
  46. package/CapEventCalendar/messages.d.ts +0 -25
  47. package/CapEventCalendar/messages.d.ts.map +0 -1
  48. package/CapEventCalendar/messages.js +0 -28
  49. package/CapEventCalendar/styles.module.scss.js +0 -12
  50. package/CapEventCalendar/tests/types.d.ts +0 -26
  51. package/CapEventCalendar/tests/types.d.ts.map +0 -1
  52. package/CapEventCalendar/types.d.ts +0 -188
  53. package/CapEventCalendar/types.d.ts.map +0 -1
  54. package/CapEventCalendar/types.js +0 -1
@@ -1,5 +1,54 @@
1
- import React from 'react';
2
- import type { CalendarCanvasProps } from '../types';
3
- declare const CalendarCanvas: React.FC<CalendarCanvasProps>;
1
+ import PropTypes from 'prop-types';
2
+ declare const CalendarCanvas: {
3
+ ({ displayMonths, dayGrid, formattedEvents, todayTooltipProps, dashLineOffsetY, eventHeight, eventRowGap, textPadding, eventStartYOffset, minCanvasHeight, canvasFont, popoverPlacement, carouselDate, popoverContent, }: {
4
+ displayMonths: any;
5
+ dayGrid: any;
6
+ formattedEvents: any;
7
+ todayTooltipProps: any;
8
+ dashLineOffsetY: any;
9
+ eventHeight: any;
10
+ eventRowGap: any;
11
+ textPadding: any;
12
+ eventStartYOffset: any;
13
+ minCanvasHeight: any;
14
+ canvasFont: any;
15
+ popoverPlacement: any;
16
+ carouselDate: any;
17
+ popoverContent: any;
18
+ }): import("react/jsx-runtime").JSX.Element;
19
+ propTypes: {
20
+ popoverContent: PropTypes.Requireable<any>;
21
+ todayTooltipProps: PropTypes.Requireable<object>;
22
+ dashLineOffsetY: PropTypes.Requireable<number>;
23
+ eventHeight: PropTypes.Requireable<number>;
24
+ eventRowGap: PropTypes.Requireable<number>;
25
+ textPadding: PropTypes.Requireable<number>;
26
+ eventStartYOffset: PropTypes.Requireable<number>;
27
+ minCanvasHeight: PropTypes.Requireable<number>;
28
+ canvasFont: PropTypes.Requireable<string>;
29
+ popoverPlacement: PropTypes.Requireable<string>;
30
+ };
31
+ defaultProps: {
32
+ popoverContent: {
33
+ ({ title }: {
34
+ title: any;
35
+ }): import("react/jsx-runtime").JSX.Element;
36
+ propTypes: {
37
+ title: PropTypes.Requireable<string>;
38
+ };
39
+ };
40
+ dashLineOffsetY: number;
41
+ eventHeight: number;
42
+ eventRowGap: number;
43
+ textPadding: number;
44
+ eventStartYOffset: number;
45
+ minCanvasHeight: number;
46
+ todayTooltipProps: {
47
+ title: string;
48
+ };
49
+ canvasFont: string;
50
+ popoverPlacement: string;
51
+ };
52
+ };
4
53
  export default CalendarCanvas;
5
54
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/CapEventCalendar/CalendarCanvas/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgE,MAAM,OAAO,CAAC;AAcrF,OAAO,KAAK,EACV,mBAAmB,EAMpB,MAAM,UAAU,CAAC;AASlB,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA4ejD,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/CapEventCalendar/CalendarCanvas/index.tsx"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAwBnC,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAudnB,CAAC;AA4BF,eAAe,cAAc,CAAC"}
@@ -1,29 +1,32 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
+ import PropTypes from "prop-types";
2
3
  import { useState, useRef, useEffect, useLayoutEffect, useMemo } from "react";
3
4
  import { FORMAT_TOKENS } from "../../utils/dayjs.js";
4
- import { FONT_SIZE_S, FONT_FAMILY, FONT_COLOR_01 } from "../../styles/_variables.js";
5
+ import { FONT_COLOR_01, FONT_SIZE_S, FONT_FAMILY } from "../../styles/_variables.js";
5
6
  import { DATE_KEY_FORMAT } from "../constants.js";
6
7
  import { drawHeadingText, drawDashedLines, drawLineSeperator, drawTodayLine, drawRoundRectWithText } from "../drawUtils.js";
7
8
  import { getDaysOfMonth } from "../utils.js";
8
- import styles from "./calendarCanvasStyles.module.scss.js";
9
9
  import { toggleTooltip, togglePopover } from "./utils.js";
10
10
  import dayjs from "dayjs";
11
11
  const DefaultPopover = ({ title }) => /* @__PURE__ */ jsx("div", { children: title });
12
+ DefaultPopover.propTypes = {
13
+ title: PropTypes.string
14
+ };
12
15
  const CalendarCanvas = ({
13
16
  displayMonths,
14
17
  dayGrid,
15
18
  formattedEvents,
16
19
  todayTooltipProps,
17
- dashLineOffsetY = 20,
18
- eventHeight = 24,
19
- eventRowGap = 12,
20
- textPadding = 12,
21
- eventStartYOffset = 40,
22
- minCanvasHeight = 0,
23
- canvasFont = `normal ${FONT_SIZE_S} ${FONT_FAMILY}`,
24
- popoverPlacement = "leftTop",
20
+ dashLineOffsetY,
21
+ eventHeight,
22
+ eventRowGap,
23
+ textPadding,
24
+ eventStartYOffset,
25
+ minCanvasHeight,
26
+ canvasFont,
27
+ popoverPlacement,
25
28
  carouselDate,
26
- popoverContent = DefaultPopover
29
+ popoverContent
27
30
  }) => {
28
31
  const [width, setWidth] = useState(0);
29
32
  const [height, setHeight] = useState(0);
@@ -59,13 +62,12 @@ const CalendarCanvas = ({
59
62
  }
60
63
  }, []);
61
64
  useEffect(() => {
62
- var _a;
63
65
  if (width > 0 && height > 0) {
64
- (_a = contextRef.current) == null ? void 0 : _a.scale(pixelRatio, pixelRatio);
66
+ contextRef.current.scale(pixelRatio, pixelRatio);
65
67
  }
66
68
  }, [width, height]);
67
69
  const hidePopoverAndToolTip = () => {
68
- toggleTooltip(false, isTooltipVisible, todayTooltipProps ?? {}, rootTooltipRef);
70
+ toggleTooltip(false, isTooltipVisible, todayTooltipProps, rootTooltipRef);
69
71
  togglePopover({ visible: false, rootPopoverRef, isPopoverVisible });
70
72
  };
71
73
  useEffect(() => {
@@ -85,7 +87,6 @@ const CalendarCanvas = ({
85
87
  return false;
86
88
  };
87
89
  const handleDimension = () => {
88
- if (!canvasContainerRef.current) return;
89
90
  const minHeight = minCanvasHeight || canvasContainerRef.current.clientHeight;
90
91
  const { y: rectY } = getRectInitDimension();
91
92
  const estimatedHeight = rectY + eventStartYOffset + (eventHeight + eventRowGap) * totalEventRowsPerQuater.current;
@@ -186,16 +187,10 @@ const CalendarCanvas = ({
186
187
  startX += rectWidth;
187
188
  });
188
189
  });
189
- drawObject.current = { ...drawObject.current ?? { day: {} }, day: dayObject };
190
+ drawObject.current = { ...drawObject.current, day: dayObject };
190
191
  return dayObject;
191
192
  };
192
- const updatePosition = ({
193
- mouseX,
194
- mouseY,
195
- knob,
196
- offsetX = 0
197
- }) => {
198
- if (!knob) return;
193
+ const updatePosition = ({ mouseX, mouseY, knob, offsetX = 0 }) => {
199
194
  const { style: style2 } = knob;
200
195
  if (mouseX) {
201
196
  style2.display = "block";
@@ -226,7 +221,7 @@ const CalendarCanvas = ({
226
221
  const handleTodayLine = ({ mouseX, mouseY } = {}) => {
227
222
  const context = contextRef.current;
228
223
  const currentDayObj = getTodayRectObj();
229
- if (!currentDayObj || !context) {
224
+ if (!currentDayObj) {
230
225
  return null;
231
226
  }
232
227
  const { y, midX, height: currentDayRectHeight } = currentDayObj;
@@ -267,7 +262,7 @@ const CalendarCanvas = ({
267
262
  };
268
263
  if (date) {
269
264
  drawObject.current = {
270
- ...drawObject.current ?? { day: {} },
265
+ ...drawObject.current,
271
266
  day: { ...day, [date]: dayObject }
272
267
  };
273
268
  }
@@ -375,7 +370,7 @@ const CalendarCanvas = ({
375
370
  isPopoverVisible,
376
371
  popoverContent,
377
372
  popoverPlacement,
378
- popoverContentProps: { ...hoverEvent, ...hoverEvent.popoverProps ?? {} }
373
+ popoverContentProps: { ...hoverEvent, ...hoverEvent.popoverProps }
379
374
  });
380
375
  currentHoverEvent.current = {
381
376
  ...currentHoverEvent.current,
@@ -394,14 +389,14 @@ const CalendarCanvas = ({
394
389
  mouseX: midX,
395
390
  mouseY: mouseY / pixelRatio
396
391
  });
397
- toggleTooltip(mouseEvent, isTooltipVisible, todayTooltipProps ?? {}, rootTooltipRef);
392
+ toggleTooltip(mouseEvent, isTooltipVisible, todayTooltipProps, rootTooltipRef);
398
393
  }
399
394
  } else {
400
- toggleTooltip(void 0, isTooltipVisible, todayTooltipProps ?? {}, rootTooltipRef);
395
+ toggleTooltip(void 0, isTooltipVisible, todayTooltipProps, rootTooltipRef);
401
396
  }
402
397
  toggleCursor(isTodayLineHovered || currentHoverEvent.current);
403
398
  };
404
- return /* @__PURE__ */ jsxs("div", { className: styles["canvas-container"], ref: canvasContainerRef, children: [
399
+ return /* @__PURE__ */ jsxs("div", { style: { width: "100%", height: "100%", position: "relative" }, ref: canvasContainerRef, children: [
405
400
  /* @__PURE__ */ jsx(
406
401
  "canvas",
407
402
  {
@@ -413,10 +408,34 @@ const CalendarCanvas = ({
413
408
  onMouseMove
414
409
  }
415
410
  ),
416
- /* @__PURE__ */ jsx("div", { className: styles["tooltip-knob"], id: "event-calendar-tool-tip-knob" }),
417
- /* @__PURE__ */ jsx("div", { className: styles["popover-knob"], id: "event-calendar-popover-knob" })
411
+ /* @__PURE__ */ jsx("div", { style: { position: "absolute" }, id: "event-calendar-tool-tip-knob" }),
412
+ /* @__PURE__ */ jsx("div", { style: { position: "absolute" }, id: "event-calendar-popover-knob" })
418
413
  ] });
419
414
  };
415
+ CalendarCanvas.propTypes = {
416
+ popoverContent: PropTypes.any,
417
+ todayTooltipProps: PropTypes.object,
418
+ dashLineOffsetY: PropTypes.number,
419
+ eventHeight: PropTypes.number,
420
+ eventRowGap: PropTypes.number,
421
+ textPadding: PropTypes.number,
422
+ eventStartYOffset: PropTypes.number,
423
+ minCanvasHeight: PropTypes.number,
424
+ canvasFont: PropTypes.string,
425
+ popoverPlacement: PropTypes.string
426
+ };
427
+ CalendarCanvas.defaultProps = {
428
+ popoverContent: DefaultPopover,
429
+ dashLineOffsetY: 20,
430
+ eventHeight: 24,
431
+ eventRowGap: 12,
432
+ textPadding: 12,
433
+ eventStartYOffset: 40,
434
+ minCanvasHeight: 0,
435
+ todayTooltipProps: { title: "Today" },
436
+ canvasFont: `normal ${FONT_SIZE_S} ${FONT_FAMILY}`,
437
+ popoverPlacement: "leftTop"
438
+ };
420
439
  export {
421
440
  CalendarCanvas as default
422
441
  };
@@ -1,6 +1,10 @@
1
- import type { MutableRefObject } from 'react';
2
- import type { Root } from 'react-dom/client';
3
- import type { TogglePopoverArgs } from '../types';
4
- export declare const toggleTooltip: (visible: unknown, isTooltipVisible: MutableRefObject<boolean | null>, todayTooltipProps: Record<string, unknown>, rootTooltipRef: MutableRefObject<Root | null>) => void;
5
- export declare const togglePopover: ({ visible, rootPopoverRef, isPopoverVisible, popoverContent, popoverPlacement, popoverContentProps, }: TogglePopoverArgs) => void;
1
+ export declare const toggleTooltip: (visible: any, isTooltipVisible: any, todayTooltipProps: any, rootTooltipRef: any) => void;
2
+ export declare const togglePopover: ({ visible, rootPopoverRef, isPopoverVisible, popoverContent, popoverPlacement, popoverContentProps, }: {
3
+ visible: any;
4
+ rootPopoverRef: any;
5
+ isPopoverVisible: any;
6
+ popoverContent: any;
7
+ popoverPlacement: any;
8
+ popoverContentProps: any;
9
+ }) => void;
6
10
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../components/CapEventCalendar/CalendarCanvas/utils.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAE9C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAI7C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD,eAAO,MAAM,aAAa,GACxB,SAAS,OAAO,EAChB,kBAAkB,gBAAgB,CAAC,OAAO,GAAG,IAAI,CAAC,EAClD,mBAAmB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC1C,gBAAgB,gBAAgB,CAAC,IAAI,GAAG,IAAI,CAAC,SAkB9C,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,uGAO3B,iBAAiB,SA4BnB,CAAC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../components/CapEventCalendar/CalendarCanvas/utils.tsx"],"names":[],"mappings":"AAMA,eAAO,MAAM,aAAa,GAAI,YAAO,EAAE,qBAAgB,EAAE,sBAAiB,EAAE,mBAAc,SAiBzF,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI;;;;;;;CAO7B,SA4BA,CAAC"}
@@ -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, { open: true, ...todayTooltipProps, children: /* @__PURE__ */ jsx("div", {}) })
12
+ /* @__PURE__ */ jsx(CapTooltip, { visible: 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 && popoverContent) {
34
+ if (visible) {
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
- open: true,
42
- arrow: { pointAtCenter: true },
41
+ visible: true,
42
+ arrowPointAtCenter: true,
43
43
  placement: popoverPlacement,
44
- content: /* @__PURE__ */ jsx(Component, { ...popoverContentProps ?? {} }),
45
- classNames: { root: "event-calendar-popover-overlay" },
44
+ content: /* @__PURE__ */ jsx(Component, { ...popoverContentProps }),
45
+ overlayClassName: "event-calendar-popover-overlay",
46
46
  getPopupContainer: () => body,
47
47
  children: /* @__PURE__ */ jsx("div", {})
48
48
  }
@@ -1,5 +1,15 @@
1
- import React from 'react';
2
- import type { DayDropdownProps } from '../../types';
3
- declare const DayDropdown: React.FC<DayDropdownProps>;
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
+ };
4
14
  export default DayDropdown;
5
15
  //# 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,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
+ {"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,37 +1,19 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { useMemo } from "react";
3
- import CapUnifiedSelect from "../../../CapUnifiedSelect/index.js";
4
- import { SELECT_TYPES } from "../../../CapUnifiedSelect/constants.js";
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";
5
8
  const DayDropdown = ({ fetchDay, dayLabels, day }) => {
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
- );
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
35
17
  };
36
18
  export {
37
19
  DayDropdown as default
@@ -1,5 +1,11 @@
1
- import React from 'react';
2
- import type { MonthHeaderProps } from '../../types';
3
- declare const MonthHeader: React.FC<MonthHeaderProps>;
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
+ };
4
10
  export default MonthHeader;
5
11
  //# 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,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
+ {"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,7 +1,12 @@
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)) });
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
+ };
5
10
  export {
6
11
  MonthHeader as default
7
12
  };
@@ -1,10 +1,72 @@
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;
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;
10
72
  //# sourceMappingURL=drawUtils.d.ts.map
@@ -1 +1 @@
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
+ {"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,4 +1,4 @@
1
- import { CAP_WHITE, CAP_G01, CAP_G06, CAP_G11, FONT_COLOR_05 } from "../styles/_variables.js";
1
+ import { CAP_G06, CAP_WHITE, CAP_G01, 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,15 +27,7 @@ const drawDashedLines = ({ context, x, y, x1, y1 }) => {
27
27
  context.setLineDash([]);
28
28
  context.closePath();
29
29
  };
30
- const drawTodayLine = ({
31
- context,
32
- x,
33
- y,
34
- x1,
35
- y1,
36
- mouseX,
37
- mouseY
38
- }) => {
30
+ const drawTodayLine = ({ context, x, y, x1, y1, mouseX, mouseY }) => {
39
31
  context.beginPath();
40
32
  const radius = 4;
41
33
  drawCircle({
@@ -48,7 +40,7 @@ const drawTodayLine = ({
48
40
  context.strokeStyle = FONT_COLOR_05;
49
41
  context.moveTo(x, y);
50
42
  context.lineTo(x1, y1);
51
- if (mouseX && mouseY) {
43
+ if (mouseX) {
52
44
  context.rect(x - 3, y, 6, y1);
53
45
  return context.isPointInPath(mouseX, mouseY);
54
46
  }
@@ -99,7 +91,7 @@ const drawRoundRect = ({
99
91
  context.quadraticCurveTo(x, y + height, x, y + height - radius.bl);
100
92
  context.lineTo(x, y + radius.tl);
101
93
  context.quadraticCurveTo(x, y, x + radius.tl, y);
102
- if (mouseX && mouseY) {
94
+ if (mouseX) {
103
95
  return context.isPointInPath(mouseX, mouseY);
104
96
  }
105
97
  context.fill();
@@ -1,5 +1,81 @@
1
- import React from 'react';
2
- import type { CapEventCalendarProps } from './types';
3
- declare const _default: React.ComponentType<Omit<CapEventCalendarProps, "intl">>;
4
- export default _default;
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;
5
81
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
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
+ {"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"}