@capillarytech/blaze-ui 6.1.0 → 6.1.2

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 (92) hide show
  1. package/.npmrc +3 -0
  2. package/CapCustomCheckboxList/styles.css +3 -3
  3. package/CapCustomCheckboxList/styles.scss +7 -8
  4. package/CapEventCalendar/CalendarCanvas/calendarCanvasStyles.css +21 -0
  5. package/CapEventCalendar/CalendarCanvas/calendarCanvasStyles.module.scss.js +8 -0
  6. package/CapEventCalendar/CalendarCanvas/calendarCanvasStyles.scss +17 -0
  7. package/CapEventCalendar/CalendarCanvas/index.d.ts +3 -52
  8. package/CapEventCalendar/CalendarCanvas/index.d.ts.map +1 -1
  9. package/CapEventCalendar/CalendarCanvas/index.js +31 -50
  10. package/CapEventCalendar/CalendarCanvas/utils.d.ts +5 -9
  11. package/CapEventCalendar/CalendarCanvas/utils.d.ts.map +1 -1
  12. package/CapEventCalendar/CalendarCanvas/utils.js +6 -6
  13. package/CapEventCalendar/components/DayDropdown/index.d.ts +3 -13
  14. package/CapEventCalendar/components/DayDropdown/index.d.ts.map +1 -1
  15. package/CapEventCalendar/components/DayDropdown/index.js +32 -14
  16. package/CapEventCalendar/components/MonthHeader/index.d.ts +3 -9
  17. package/CapEventCalendar/components/MonthHeader/index.d.ts.map +1 -1
  18. package/CapEventCalendar/components/MonthHeader/index.js +4 -9
  19. package/CapEventCalendar/components/MonthHeader/monthHeaderStyles.css +20 -0
  20. package/CapEventCalendar/components/MonthHeader/monthHeaderStyles.module.scss.js +7 -0
  21. package/CapEventCalendar/components/MonthHeader/monthHeaderStyles.scss +15 -0
  22. package/CapEventCalendar/drawUtils.d.ts +9 -71
  23. package/CapEventCalendar/drawUtils.d.ts.map +1 -1
  24. package/CapEventCalendar/drawUtils.js +12 -4
  25. package/CapEventCalendar/index.d.ts +4 -80
  26. package/CapEventCalendar/index.d.ts.map +1 -1
  27. package/CapEventCalendar/index.js +60 -85
  28. package/CapEventCalendar/messages.d.ts +25 -0
  29. package/CapEventCalendar/messages.d.ts.map +1 -0
  30. package/CapEventCalendar/messages.js +28 -0
  31. package/CapEventCalendar/styles.css +9 -81
  32. package/CapEventCalendar/styles.module.scss.js +12 -0
  33. package/CapEventCalendar/styles.scss +34 -107
  34. package/CapEventCalendar/tests/types.d.ts +26 -0
  35. package/CapEventCalendar/tests/types.d.ts.map +1 -0
  36. package/CapEventCalendar/types.d.ts +188 -0
  37. package/CapEventCalendar/types.d.ts.map +1 -0
  38. package/CapEventCalendar/types.js +1 -0
  39. package/CapEventCalendar/utils.d.ts +11 -9
  40. package/CapEventCalendar/utils.d.ts.map +1 -1
  41. package/CapEventCalendar/utils.js +10 -7
  42. package/CapProductSelection/index.d.ts +7 -29
  43. package/CapProductSelection/index.d.ts.map +1 -1
  44. package/CapProductSelection/index.js +52 -89
  45. package/CapProductSelection/messages.d.ts +76 -0
  46. package/CapProductSelection/messages.d.ts.map +1 -0
  47. package/CapProductSelection/messages.js +79 -0
  48. package/CapProductSelection/styles.css +81 -0
  49. package/CapProductSelection/styles.module.scss.js +8 -0
  50. package/CapProductSelection/styles.scss +82 -40
  51. package/CapProductSelection/tests/CapProductSelection.mockData.d.ts +36 -0
  52. package/CapProductSelection/tests/CapProductSelection.mockData.d.ts.map +1 -0
  53. package/CapProductSelection/types.d.ts +34 -0
  54. package/CapProductSelection/types.d.ts.map +1 -0
  55. package/CapProductSelection/types.js +1 -0
  56. package/CapRadioCard/index.d.ts.map +1 -1
  57. package/CapRadioCard/index.js +52 -20
  58. package/CapRadioCard/styles.css +25 -25
  59. package/CapRadioCard/styles.module.scss.js +14 -40
  60. package/CapRadioCard/styles.scss +20 -20
  61. package/CapRadioCard/types.d.ts +20 -0
  62. package/CapRadioCard/types.d.ts.map +1 -1
  63. package/CapStaticTemplates/index.d.ts +3 -1
  64. package/CapStaticTemplates/index.d.ts.map +1 -1
  65. package/CapStaticTemplates/index.js +185 -144
  66. package/CapStaticTemplates/messages.d.ts +32 -0
  67. package/CapStaticTemplates/messages.d.ts.map +1 -0
  68. package/CapStaticTemplates/messages.js +35 -0
  69. package/CapStaticTemplates/styles.css +220 -0
  70. package/CapStaticTemplates/styles.module.scss.js +55 -0
  71. package/CapStaticTemplates/styles.scss +291 -0
  72. package/CapStaticTemplates/tests/CapStaticTemplates.mockData.d.ts +54 -0
  73. package/CapStaticTemplates/tests/CapStaticTemplates.mockData.d.ts.map +1 -0
  74. package/CapStaticTemplates/types.d.ts +97 -0
  75. package/CapStaticTemplates/types.d.ts.map +1 -0
  76. package/CapStaticTemplates/types.js +1 -0
  77. package/CapTabV3/tests/CapTabV3.mockData.d.ts +26 -26
  78. package/CapTabV3/tests/CapTabV3.mockData.d.ts.map +1 -1
  79. package/index.d.ts +6 -0
  80. package/index.d.ts.map +1 -1
  81. package/index.js +227 -221
  82. package/package.json +1 -1
  83. package/styles/_variables.scss +2 -0
  84. package/utils/dayjs.d.ts +1 -0
  85. package/utils/dayjs.d.ts.map +1 -1
  86. package/utils/dayjs.js +1 -0
  87. package/CapProductSelection/style.d.ts +0 -3
  88. package/CapProductSelection/style.d.ts.map +0 -1
  89. package/CapProductSelection/style.js +0 -38
  90. package/CapStaticTemplates/style.d.ts +0 -13
  91. package/CapStaticTemplates/style.d.ts.map +0 -1
  92. package/CapStaticTemplates/style.js +0 -216
package/.npmrc ADDED
@@ -0,0 +1,3 @@
1
+ npm config set scope capillarytech
2
+ //registry.npmjs.org/:_authToken=${NPM_TOKEN}
3
+ legacy-peer-deps=true
@@ -13,9 +13,9 @@
13
13
  background-color: #ffffff;
14
14
  margin-right: 0.857rem;
15
15
  }
16
- .div-icon {
17
- width: 208px;
18
- height: 92px;
16
+ .cap-customCheckboxList-v2 .div-icon {
17
+ width: 14.857rem;
18
+ height: 6.571rem;
19
19
  padding: 1.614rem 5.714rem;
20
20
  border-radius: 0.285rem;
21
21
  background-color: #e9f0fe;
@@ -6,14 +6,13 @@
6
6
  border: solid 1px $CAP_G07;
7
7
  background-color: $CAP_WHITE;
8
8
  margin-right: $CAP_SPACE_12;
9
- }
10
-
11
- .div-icon {
12
- width: 208px;
13
- height: 92px;
14
- padding: $CAP_SPACE_23 $CAP_SPACE_80;
15
- border-radius: $CAP_SPACE_04;
16
- background-color: $CAP_PALE_GREY;
9
+ .div-icon {
10
+ width: 14.857rem; // 208px
11
+ height: 6.571rem; // 92px
12
+ padding: $CAP_SPACE_23 $CAP_SPACE_80;
13
+ border-radius: $CAP_SPACE_04;
14
+ background-color: $CAP_PALE_GREY;
15
+ }
17
16
  }
18
17
 
19
18
  .customCheckbox-icon {
@@ -0,0 +1,21 @@
1
+ /* Color Palette */
2
+ /* Fonts */
3
+ /* Backward Compatibility Aliases */
4
+ /* Component Heights */
5
+ /* Border Radius */
6
+ /* Border Width */
7
+ /* Transition */
8
+ /* Timezones Footer */
9
+ .canvas-container {
10
+ width: 100%;
11
+ height: 100%;
12
+ position: relative;
13
+ }
14
+ .tooltip-knob {
15
+ position: absolute;
16
+ display: none;
17
+ }
18
+ .popover-knob {
19
+ position: absolute;
20
+ display: none;
21
+ }
@@ -0,0 +1,8 @@
1
+ import './calendarCanvasStyles.css';const styles = {
2
+ "canvas-container": "canvas-container",
3
+ "tooltip-knob": "tooltip-knob",
4
+ "popover-knob": "popover-knob"
5
+ };
6
+ export {
7
+ styles as default
8
+ };
@@ -0,0 +1,17 @@
1
+ @import '../../styles/_variables.scss';
2
+
3
+ .canvas-container {
4
+ width: 100%;
5
+ height: 100%;
6
+ position: relative;
7
+ }
8
+
9
+ .tooltip-knob {
10
+ position: absolute;
11
+ display: none;
12
+ }
13
+
14
+ .popover-knob {
15
+ position: absolute;
16
+ display: none;
17
+ }
@@ -1,54 +1,5 @@
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
- };
1
+ import React from 'react';
2
+ import type { CalendarCanvasProps } from '../types';
3
+ declare const CalendarCanvas: React.FC<CalendarCanvasProps>;
53
4
  export default CalendarCanvas;
54
5
  //# 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,SAAS,MAAM,YAAY,CAAC;AAwBnC,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAudnB,CAAC;AA4BF,eAAe,cAAc,CAAC"}
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,32 +1,29 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
- import PropTypes from "prop-types";
3
2
  import { useState, useRef, useEffect, useLayoutEffect, useMemo } from "react";
4
3
  import { FORMAT_TOKENS } from "../../utils/dayjs.js";
5
- import { FONT_COLOR_01, FONT_SIZE_S, FONT_FAMILY } from "../../styles/_variables.js";
4
+ import { FONT_SIZE_S, FONT_FAMILY, FONT_COLOR_01 } from "../../styles/_variables.js";
6
5
  import { DATE_KEY_FORMAT } from "../constants.js";
7
6
  import { drawHeadingText, drawDashedLines, drawLineSeperator, drawTodayLine, drawRoundRectWithText } from "../drawUtils.js";
8
7
  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
- };
15
12
  const CalendarCanvas = ({
16
13
  displayMonths,
17
14
  dayGrid,
18
15
  formattedEvents,
19
16
  todayTooltipProps,
20
- dashLineOffsetY,
21
- eventHeight,
22
- eventRowGap,
23
- textPadding,
24
- eventStartYOffset,
25
- minCanvasHeight,
26
- canvasFont,
27
- popoverPlacement,
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",
28
25
  carouselDate,
29
- popoverContent
26
+ popoverContent = DefaultPopover
30
27
  }) => {
31
28
  const [width, setWidth] = useState(0);
32
29
  const [height, setHeight] = useState(0);
@@ -62,12 +59,13 @@ const CalendarCanvas = ({
62
59
  }
63
60
  }, []);
64
61
  useEffect(() => {
62
+ var _a;
65
63
  if (width > 0 && height > 0) {
66
- contextRef.current.scale(pixelRatio, pixelRatio);
64
+ (_a = contextRef.current) == null ? void 0 : _a.scale(pixelRatio, pixelRatio);
67
65
  }
68
66
  }, [width, height]);
69
67
  const hidePopoverAndToolTip = () => {
70
- toggleTooltip(false, isTooltipVisible, todayTooltipProps, rootTooltipRef);
68
+ toggleTooltip(false, isTooltipVisible, todayTooltipProps ?? {}, rootTooltipRef);
71
69
  togglePopover({ visible: false, rootPopoverRef, isPopoverVisible });
72
70
  };
73
71
  useEffect(() => {
@@ -87,6 +85,7 @@ const CalendarCanvas = ({
87
85
  return false;
88
86
  };
89
87
  const handleDimension = () => {
88
+ if (!canvasContainerRef.current) return;
90
89
  const minHeight = minCanvasHeight || canvasContainerRef.current.clientHeight;
91
90
  const { y: rectY } = getRectInitDimension();
92
91
  const estimatedHeight = rectY + eventStartYOffset + (eventHeight + eventRowGap) * totalEventRowsPerQuater.current;
@@ -187,10 +186,16 @@ const CalendarCanvas = ({
187
186
  startX += rectWidth;
188
187
  });
189
188
  });
190
- drawObject.current = { ...drawObject.current, day: dayObject };
189
+ drawObject.current = { ...drawObject.current ?? { day: {} }, day: dayObject };
191
190
  return dayObject;
192
191
  };
193
- const updatePosition = ({ mouseX, mouseY, knob, offsetX = 0 }) => {
192
+ const updatePosition = ({
193
+ mouseX,
194
+ mouseY,
195
+ knob,
196
+ offsetX = 0
197
+ }) => {
198
+ if (!knob) return;
194
199
  const { style: style2 } = knob;
195
200
  if (mouseX) {
196
201
  style2.display = "block";
@@ -221,7 +226,7 @@ const CalendarCanvas = ({
221
226
  const handleTodayLine = ({ mouseX, mouseY } = {}) => {
222
227
  const context = contextRef.current;
223
228
  const currentDayObj = getTodayRectObj();
224
- if (!currentDayObj) {
229
+ if (!currentDayObj || !context) {
225
230
  return null;
226
231
  }
227
232
  const { y, midX, height: currentDayRectHeight } = currentDayObj;
@@ -262,7 +267,7 @@ const CalendarCanvas = ({
262
267
  };
263
268
  if (date) {
264
269
  drawObject.current = {
265
- ...drawObject.current,
270
+ ...drawObject.current ?? { day: {} },
266
271
  day: { ...day, [date]: dayObject }
267
272
  };
268
273
  }
@@ -370,7 +375,7 @@ const CalendarCanvas = ({
370
375
  isPopoverVisible,
371
376
  popoverContent,
372
377
  popoverPlacement,
373
- popoverContentProps: { ...hoverEvent, ...hoverEvent.popoverProps }
378
+ popoverContentProps: { ...hoverEvent, ...hoverEvent.popoverProps ?? {} }
374
379
  });
375
380
  currentHoverEvent.current = {
376
381
  ...currentHoverEvent.current,
@@ -389,14 +394,14 @@ const CalendarCanvas = ({
389
394
  mouseX: midX,
390
395
  mouseY: mouseY / pixelRatio
391
396
  });
392
- toggleTooltip(mouseEvent, isTooltipVisible, todayTooltipProps, rootTooltipRef);
397
+ toggleTooltip(mouseEvent, isTooltipVisible, todayTooltipProps ?? {}, rootTooltipRef);
393
398
  }
394
399
  } else {
395
- toggleTooltip(void 0, isTooltipVisible, todayTooltipProps, rootTooltipRef);
400
+ toggleTooltip(void 0, isTooltipVisible, todayTooltipProps ?? {}, rootTooltipRef);
396
401
  }
397
402
  toggleCursor(isTodayLineHovered || currentHoverEvent.current);
398
403
  };
399
- return /* @__PURE__ */ jsxs("div", { style: { width: "100%", height: "100%", position: "relative" }, ref: canvasContainerRef, children: [
404
+ return /* @__PURE__ */ jsxs("div", { className: styles["canvas-container"], ref: canvasContainerRef, children: [
400
405
  /* @__PURE__ */ jsx(
401
406
  "canvas",
402
407
  {
@@ -408,34 +413,10 @@ const CalendarCanvas = ({
408
413
  onMouseMove
409
414
  }
410
415
  ),
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" })
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" })
413
418
  ] });
414
419
  };
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
- };
439
420
  export {
440
421
  CalendarCanvas as default
441
422
  };
@@ -1,10 +1,6 @@
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;
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;
10
6
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
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"}
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"}
@@ -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"}