@arkyn/components 3.0.1-beta.144 → 3.0.1-beta.146

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 (71) hide show
  1. package/dist/bundle.css +1 -1
  2. package/dist/bundle.js +748 -243
  3. package/dist/components/fullCalendar/_fullCalendarProvider.d.ts +35 -0
  4. package/dist/components/fullCalendar/_fullCalendarProvider.d.ts.map +1 -0
  5. package/dist/components/fullCalendar/_fullCalendarProvider.js +33 -0
  6. package/dist/components/fullCalendar/_viewService.d.ts +28 -0
  7. package/dist/components/fullCalendar/_viewService.d.ts.map +1 -0
  8. package/dist/components/fullCalendar/_viewService.js +144 -0
  9. package/dist/components/fullCalendar/dayCalendar/dayCalendarContainer/index.d.ts +8 -0
  10. package/dist/components/fullCalendar/dayCalendar/dayCalendarContainer/index.d.ts.map +1 -0
  11. package/dist/components/fullCalendar/dayCalendar/dayCalendarContainer/index.js +6 -0
  12. package/dist/components/fullCalendar/dayCalendar/dayCalendarEvent/index.d.ts +7 -0
  13. package/dist/components/fullCalendar/dayCalendar/dayCalendarEvent/index.d.ts.map +1 -0
  14. package/dist/components/fullCalendar/dayCalendar/dayCalendarEvent/index.js +101 -0
  15. package/dist/components/fullCalendar/dayCalendar/dayCalendarRow/index.d.ts +8 -0
  16. package/dist/components/fullCalendar/dayCalendar/dayCalendarRow/index.d.ts.map +1 -0
  17. package/dist/components/fullCalendar/dayCalendar/dayCalendarRow/index.js +9 -0
  18. package/dist/components/fullCalendar/dayCalendar/index.d.ts +3 -0
  19. package/dist/components/fullCalendar/dayCalendar/index.d.ts.map +1 -0
  20. package/dist/components/fullCalendar/dayCalendar/index.js +9 -0
  21. package/dist/components/fullCalendar/fullCalendarContainer/index.d.ts +8 -0
  22. package/dist/components/fullCalendar/fullCalendarContainer/index.d.ts.map +1 -0
  23. package/dist/components/fullCalendar/fullCalendarContainer/index.js +6 -0
  24. package/dist/components/fullCalendar/fullCalendarHeader/index.d.ts +8 -0
  25. package/dist/components/fullCalendar/fullCalendarHeader/index.d.ts.map +1 -0
  26. package/dist/components/fullCalendar/fullCalendarHeader/index.js +37 -0
  27. package/dist/components/fullCalendar/index.d.ts +78 -0
  28. package/dist/components/fullCalendar/index.d.ts.map +1 -0
  29. package/dist/components/fullCalendar/index.js +62 -0
  30. package/dist/components/fullCalendar/monthlyCalendar/index.d.ts +3 -0
  31. package/dist/components/fullCalendar/monthlyCalendar/index.d.ts.map +1 -0
  32. package/dist/components/fullCalendar/monthlyCalendar/index.js +8 -0
  33. package/dist/components/fullCalendar/monthlyCalendar/monthlyCalendarEvent/index.d.ts +9 -0
  34. package/dist/components/fullCalendar/monthlyCalendar/monthlyCalendarEvent/index.d.ts.map +1 -0
  35. package/dist/components/fullCalendar/monthlyCalendar/monthlyCalendarEvent/index.js +25 -0
  36. package/dist/components/fullCalendar/monthlyCalendar/monthlyCalendarTableBody/index.d.ts +4 -0
  37. package/dist/components/fullCalendar/monthlyCalendar/monthlyCalendarTableBody/index.d.ts.map +1 -0
  38. package/dist/components/fullCalendar/monthlyCalendar/monthlyCalendarTableBody/index.js +9 -0
  39. package/dist/components/fullCalendar/monthlyCalendar/monthlyCalendarTableContainer/index.d.ts +8 -0
  40. package/dist/components/fullCalendar/monthlyCalendar/monthlyCalendarTableContainer/index.d.ts.map +1 -0
  41. package/dist/components/fullCalendar/monthlyCalendar/monthlyCalendarTableContainer/index.js +6 -0
  42. package/dist/components/fullCalendar/monthlyCalendar/monthlyCalendarTableHeader/index.d.ts +4 -0
  43. package/dist/components/fullCalendar/monthlyCalendar/monthlyCalendarTableHeader/index.d.ts.map +1 -0
  44. package/dist/components/fullCalendar/monthlyCalendar/monthlyCalendarTableHeader/index.js +9 -0
  45. package/dist/components/fullCalendar/monthlyCalendar/monthlyCalendarTableTd/index.d.ts +10 -0
  46. package/dist/components/fullCalendar/monthlyCalendar/monthlyCalendarTableTd/index.d.ts.map +1 -0
  47. package/dist/components/fullCalendar/monthlyCalendar/monthlyCalendarTableTd/index.js +14 -0
  48. package/dist/components/fullCalendar/weekCalendar/index.d.ts +3 -0
  49. package/dist/components/fullCalendar/weekCalendar/index.d.ts.map +1 -0
  50. package/dist/components/fullCalendar/weekCalendar/index.js +8 -0
  51. package/dist/components/fullCalendar/weekCalendar/weekCalendarEvent/index.d.ts +10 -0
  52. package/dist/components/fullCalendar/weekCalendar/weekCalendarEvent/index.d.ts.map +1 -0
  53. package/dist/components/fullCalendar/weekCalendar/weekCalendarEvent/index.js +98 -0
  54. package/dist/components/fullCalendar/weekCalendar/weekCalendarTableBody/index.d.ts +4 -0
  55. package/dist/components/fullCalendar/weekCalendar/weekCalendarTableBody/index.d.ts.map +1 -0
  56. package/dist/components/fullCalendar/weekCalendar/weekCalendarTableBody/index.js +11 -0
  57. package/dist/components/fullCalendar/weekCalendar/weekCalendarTableContainer/index.d.ts +8 -0
  58. package/dist/components/fullCalendar/weekCalendar/weekCalendarTableContainer/index.d.ts.map +1 -0
  59. package/dist/components/fullCalendar/weekCalendar/weekCalendarTableContainer/index.js +6 -0
  60. package/dist/components/fullCalendar/weekCalendar/weekCalendarTableHeader/index.d.ts +4 -0
  61. package/dist/components/fullCalendar/weekCalendar/weekCalendarTableHeader/index.d.ts.map +1 -0
  62. package/dist/components/fullCalendar/weekCalendar/weekCalendarTableHeader/index.js +10 -0
  63. package/dist/components/fullCalendar/weekCalendar/weekCalendarTableTd/index.d.ts +11 -0
  64. package/dist/components/fullCalendar/weekCalendar/weekCalendarTableTd/index.d.ts.map +1 -0
  65. package/dist/components/fullCalendar/weekCalendar/weekCalendarTableTd/index.js +14 -0
  66. package/dist/components/phoneInput/index.d.ts +2 -2
  67. package/dist/components/phoneInput/index.js +2 -2
  68. package/dist/index.d.ts +1 -0
  69. package/dist/index.d.ts.map +1 -1
  70. package/dist/index.js +1 -0
  71. package/package.json +1 -1
@@ -0,0 +1,35 @@
1
+ import { type ReactNode } from "react";
2
+ import { type FullCalendarMatrix, type FullCalendarWeekMatrix } from "./_viewService";
3
+ type FullCalendarEvent = {
4
+ date: Date;
5
+ endDate?: Date;
6
+ title: string;
7
+ data?: any;
8
+ scheme?: "primary" | "success" | "warning" | "danger" | "info";
9
+ onClick?: (data: any) => void;
10
+ };
11
+ type FullCalendarContextProps = {
12
+ events: FullCalendarEvent[];
13
+ viewDate: Date;
14
+ listHours: number[];
15
+ listWeek: string[];
16
+ listMonthlyMatrix: FullCalendarMatrix;
17
+ listWeeklyMatrix: FullCalendarWeekMatrix;
18
+ nextMonth: () => void;
19
+ nextWeek: () => void;
20
+ nextDay: () => void;
21
+ previousMonth: () => void;
22
+ previousWeek: () => void;
23
+ previousDay: () => void;
24
+ };
25
+ type FullCalendarProviderProps = {
26
+ events: FullCalendarEvent[];
27
+ children: ReactNode;
28
+ language?: string;
29
+ defaultValue?: Date;
30
+ onChangeView?: (date: Date) => void;
31
+ };
32
+ declare function useFullCalendar(): FullCalendarContextProps;
33
+ declare function FullCalendarProvider(props: FullCalendarProviderProps): import("react/jsx-runtime").JSX.Element;
34
+ export { FullCalendarProvider, useFullCalendar };
35
+ //# sourceMappingURL=_fullCalendarProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_fullCalendarProvider.d.ts","sourceRoot":"","sources":["../../../src/components/fullCalendar/_fullCalendarProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5E,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC5B,MAAM,gBAAgB,CAAC;AAExB,KAAK,iBAAiB,GAAG;IACvB,IAAI,EAAE,IAAI,CAAC;IACX,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,MAAM,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC/D,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;CAC/B,CAAC;AAEF,KAAK,wBAAwB,GAAG;IAC9B,MAAM,EAAE,iBAAiB,EAAE,CAAC;IAC5B,QAAQ,EAAE,IAAI,CAAC;IACf,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,iBAAiB,EAAE,kBAAkB,CAAC;IACtC,gBAAgB,EAAE,sBAAsB,CAAC;IACzC,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB,CAAC;AAEF,KAAK,yBAAyB,GAAG;IAC/B,MAAM,EAAE,iBAAiB,EAAE,CAAC;IAC5B,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,IAAI,CAAC;IACpB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;CACrC,CAAC;AAIF,iBAAS,eAAe,6BAEvB;AAED,iBAAS,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,2CAgC7D;AAED,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { createContext, useContext, useState } from "react";
3
+ import { ViewService, } from "./_viewService";
4
+ const FullCalendarContext = createContext({});
5
+ function useFullCalendar() {
6
+ return useContext(FullCalendarContext);
7
+ }
8
+ function FullCalendarProvider(props) {
9
+ const language = props.language || "pt-BR";
10
+ const viewService = new ViewService();
11
+ const listHours = viewService.listHours([8, 18]);
12
+ const [viewDate, rawSetViewDate] = useState(props.defaultValue || new Date());
13
+ function setViewDate(date) {
14
+ if (props.onChangeView)
15
+ props.onChangeView(date);
16
+ rawSetViewDate(date);
17
+ }
18
+ return (_jsx(FullCalendarContext.Provider, { value: {
19
+ events: props.events,
20
+ viewDate,
21
+ listHours,
22
+ listWeek: viewService.listWeek(viewDate, language),
23
+ listMonthlyMatrix: viewService.listMonthlyMatrix(viewDate),
24
+ listWeeklyMatrix: viewService.listWeeklyMatrix(viewDate, listHours),
25
+ nextMonth: () => viewService.nextMonth(viewDate, setViewDate),
26
+ nextWeek: () => viewService.nextWeek(viewDate, setViewDate),
27
+ nextDay: () => viewService.nextDay(viewDate, setViewDate),
28
+ previousMonth: () => viewService.previousMonth(viewDate, setViewDate),
29
+ previousWeek: () => viewService.previousWeek(viewDate, setViewDate),
30
+ previousDay: () => viewService.previousDay(viewDate, setViewDate),
31
+ }, children: props.children }));
32
+ }
33
+ export { FullCalendarProvider, useFullCalendar };
@@ -0,0 +1,28 @@
1
+ type FullCalendarCell = {
2
+ day: number;
3
+ month: number;
4
+ year: number;
5
+ dayOwner: "previous" | "current" | "next";
6
+ };
7
+ type FullCalendarMatrix = FullCalendarCell[][];
8
+ type FullCalendarWeekCell = FullCalendarCell & {
9
+ timeInMinutes: number;
10
+ };
11
+ type FullCalendarWeekMatrix = FullCalendarWeekCell[][];
12
+ declare class ViewService {
13
+ capitalize(text: string): string;
14
+ listHours(range: [number, number]): number[];
15
+ formatHourLabel(timeInMinutes: number): string;
16
+ getStartOfWeek(viewDate: Date): Date;
17
+ listWeek(viewDate: Date, language: string): string[];
18
+ listWeeklyMatrix(viewDate: Date, hours: number[]): FullCalendarWeekMatrix;
19
+ listMonthlyMatrix(viewDate: Date): FullCalendarMatrix;
20
+ nextMonth(viewDate: Date, setViewDate: (date: Date) => void): void;
21
+ nextWeek(viewDate: Date, setViewDate: (date: Date) => void): void;
22
+ nextDay(viewDate: Date, setViewDate: (date: Date) => void): void;
23
+ previousMonth(viewDate: Date, setViewDate: (date: Date) => void): void;
24
+ previousWeek(viewDate: Date, setViewDate: (date: Date) => void): void;
25
+ previousDay(viewDate: Date, setViewDate: (date: Date) => void): void;
26
+ }
27
+ export { ViewService, type FullCalendarMatrix, type FullCalendarWeekMatrix };
28
+ //# sourceMappingURL=_viewService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_viewService.d.ts","sourceRoot":"","sources":["../../../src/components/fullCalendar/_viewService.ts"],"names":[],"mappings":"AAEA,KAAK,gBAAgB,GAAG;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,UAAU,GAAG,SAAS,GAAG,MAAM,CAAC;CAC3C,CAAC;AAEF,KAAK,kBAAkB,GAAG,gBAAgB,EAAE,EAAE,CAAC;AAC/C,KAAK,oBAAoB,GAAG,gBAAgB,GAAG;IAC7C,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,KAAK,sBAAsB,GAAG,oBAAoB,EAAE,EAAE,CAAC;AAEvD,cAAM,WAAW;IACf,UAAU,CAAC,IAAI,EAAE,MAAM;IAIvB,SAAS,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;IAejC,eAAe,CAAC,aAAa,EAAE,MAAM;IAOrC,cAAc,CAAC,QAAQ,EAAE,IAAI;IAQ7B,QAAQ,CAAC,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM;IAgBzC,gBAAgB,CAAC,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,sBAAsB;IAoCzE,iBAAiB,CAAC,QAAQ,EAAE,IAAI;IAwDhC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI;IAM3D,QAAQ,CAAC,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI;IAM1D,OAAO,CAAC,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI;IAMzD,aAAa,CAAC,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI;IAM/D,YAAY,CAAC,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI;IAM9D,WAAW,CAAC,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI;CAK9D;AAED,OAAO,EAAE,WAAW,EAAE,KAAK,kBAAkB,EAAE,KAAK,sBAAsB,EAAE,CAAC"}
@@ -0,0 +1,144 @@
1
+ import { formatToCapitalizeFirstWordLetter } from "@arkyn/shared";
2
+ class ViewService {
3
+ capitalize(text) {
4
+ return formatToCapitalizeFirstWordLetter(text);
5
+ }
6
+ listHours(range) {
7
+ const [startHour, endHour] = range;
8
+ const hours = [];
9
+ for (let timeInMinutes = startHour * 60; timeInMinutes <= endHour * 60; timeInMinutes += 30) {
10
+ hours.push(timeInMinutes);
11
+ }
12
+ return hours;
13
+ }
14
+ formatHourLabel(timeInMinutes) {
15
+ const hour = Math.floor(timeInMinutes / 60);
16
+ const minutes = timeInMinutes % 60;
17
+ return `${String(hour).padStart(2, "0")}:${String(minutes).padStart(2, "0")}`;
18
+ }
19
+ getStartOfWeek(viewDate) {
20
+ const firstDayOfWeek = new Date(viewDate);
21
+ firstDayOfWeek.setHours(0, 0, 0, 0);
22
+ firstDayOfWeek.setDate(firstDayOfWeek.getDate() - firstDayOfWeek.getDay());
23
+ return firstDayOfWeek;
24
+ }
25
+ listWeek(viewDate, language) {
26
+ const weekDays = [];
27
+ const firstDayOfWeek = this.getStartOfWeek(viewDate);
28
+ for (let i = 0; i < 7; i++) {
29
+ const day = new Date(firstDayOfWeek);
30
+ day.setDate(firstDayOfWeek.getDate() + i);
31
+ const dayName = day.toLocaleDateString(language, {
32
+ weekday: "short",
33
+ });
34
+ weekDays.push(dayName);
35
+ }
36
+ return weekDays;
37
+ }
38
+ listWeeklyMatrix(viewDate, hours) {
39
+ const firstDayOfWeek = this.getStartOfWeek(viewDate);
40
+ const viewMonth = viewDate.getMonth();
41
+ return hours.map((hour) => {
42
+ return Array.from({ length: 7 }, (_, index) => {
43
+ const cellDate = new Date(firstDayOfWeek);
44
+ cellDate.setDate(firstDayOfWeek.getDate() + index);
45
+ let dayOwner = "current";
46
+ if (cellDate.getMonth() < viewMonth ||
47
+ cellDate.getFullYear() < viewDate.getFullYear()) {
48
+ dayOwner = "previous";
49
+ }
50
+ if (cellDate.getMonth() > viewMonth ||
51
+ cellDate.getFullYear() > viewDate.getFullYear()) {
52
+ dayOwner = "next";
53
+ }
54
+ return {
55
+ day: cellDate.getDate(),
56
+ month: cellDate.getMonth(),
57
+ year: cellDate.getFullYear(),
58
+ dayOwner,
59
+ timeInMinutes: hour,
60
+ };
61
+ });
62
+ });
63
+ }
64
+ listMonthlyMatrix(viewDate) {
65
+ const year = viewDate.getFullYear();
66
+ const monthIndex = viewDate.getMonth();
67
+ const firstDayOfMonth = new Date(year, monthIndex, 1);
68
+ const firstWeekday = firstDayOfMonth.getDay();
69
+ const daysInCurrentMonth = new Date(year, monthIndex + 1, 0).getDate();
70
+ const daysInPreviousMonth = new Date(year, monthIndex, 0).getDate();
71
+ const totalCells = Math.ceil((firstWeekday + daysInCurrentMonth) / 7) * 7;
72
+ const weeks = [];
73
+ let currentMonthDay = 1;
74
+ let nextMonthDay = 1;
75
+ for (let i = 0; i < totalCells; i++) {
76
+ const weekIndex = Math.floor(i / 7);
77
+ if (!weeks[weekIndex])
78
+ weeks[weekIndex] = [];
79
+ if (i < firstWeekday) {
80
+ const day = daysInPreviousMonth - (firstWeekday - i - 1);
81
+ const month = monthIndex === 0 ? 11 : monthIndex - 1;
82
+ const cellYear = monthIndex === 0 ? year - 1 : year;
83
+ weeks[weekIndex].push({
84
+ day,
85
+ month,
86
+ year: cellYear,
87
+ dayOwner: "previous",
88
+ });
89
+ }
90
+ else if (currentMonthDay <= daysInCurrentMonth) {
91
+ weeks[weekIndex].push({
92
+ day: currentMonthDay,
93
+ month: monthIndex,
94
+ year: year,
95
+ dayOwner: "current",
96
+ });
97
+ currentMonthDay++;
98
+ }
99
+ else {
100
+ const month = monthIndex === 11 ? 0 : monthIndex + 1;
101
+ const cellYear = monthIndex === 11 ? year + 1 : year;
102
+ weeks[weekIndex].push({
103
+ day: nextMonthDay,
104
+ month,
105
+ year: cellYear,
106
+ dayOwner: "next",
107
+ });
108
+ nextMonthDay++;
109
+ }
110
+ }
111
+ return weeks;
112
+ }
113
+ nextMonth(viewDate, setViewDate) {
114
+ const nextViewDate = new Date(viewDate);
115
+ nextViewDate.setMonth(nextViewDate.getMonth() + 1);
116
+ setViewDate(nextViewDate);
117
+ }
118
+ nextWeek(viewDate, setViewDate) {
119
+ const nextViewDate = new Date(viewDate);
120
+ nextViewDate.setDate(nextViewDate.getDate() + 7);
121
+ setViewDate(nextViewDate);
122
+ }
123
+ nextDay(viewDate, setViewDate) {
124
+ const nextViewDate = new Date(viewDate);
125
+ nextViewDate.setDate(nextViewDate.getDate() + 1);
126
+ setViewDate(nextViewDate);
127
+ }
128
+ previousMonth(viewDate, setViewDate) {
129
+ const nextViewDate = new Date(viewDate);
130
+ nextViewDate.setMonth(nextViewDate.getMonth() - 1);
131
+ setViewDate(nextViewDate);
132
+ }
133
+ previousWeek(viewDate, setViewDate) {
134
+ const nextViewDate = new Date(viewDate);
135
+ nextViewDate.setDate(nextViewDate.getDate() - 7);
136
+ setViewDate(nextViewDate);
137
+ }
138
+ previousDay(viewDate, setViewDate) {
139
+ const nextViewDate = new Date(viewDate);
140
+ nextViewDate.setDate(nextViewDate.getDate() - 1);
141
+ setViewDate(nextViewDate);
142
+ }
143
+ }
144
+ export { ViewService };
@@ -0,0 +1,8 @@
1
+ import type { ReactNode } from "react";
2
+ import "./styles.css";
3
+ type DayCalendarContainerProps = {
4
+ children: ReactNode;
5
+ };
6
+ declare function DayCalendarContainer({ children }: DayCalendarContainerProps): import("react/jsx-runtime").JSX.Element;
7
+ export { DayCalendarContainer };
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/fullCalendar/dayCalendar/dayCalendarContainer/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,cAAc,CAAC;AAEtB,KAAK,yBAAyB,GAAG;IAC/B,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF,iBAAS,oBAAoB,CAAC,EAAE,QAAQ,EAAE,EAAE,yBAAyB,2CAEpE;AAED,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import "./styles.css";
3
+ function DayCalendarContainer({ children }) {
4
+ return _jsx("div", { className: "arkynDayCalendarContainer", children: children });
5
+ }
6
+ export { DayCalendarContainer };
@@ -0,0 +1,7 @@
1
+ import "./styles.css";
2
+ type DayCalendarEventProps = {
3
+ timeInMinutes: number;
4
+ };
5
+ declare function DayCalendarEvent(props: DayCalendarEventProps): import("react/jsx-runtime").JSX.Element | import("react/jsx-runtime").JSX.Element[];
6
+ export { DayCalendarEvent };
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/fullCalendar/dayCalendar/dayCalendarEvent/index.tsx"],"names":[],"mappings":"AACA,OAAO,cAAc,CAAC;AAEtB,KAAK,qBAAqB,GAAG;IAC3B,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAKF,iBAAS,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,uFA2IrD;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
@@ -0,0 +1,101 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useFullCalendar } from "../../_fullCalendarProvider";
3
+ import "./styles.css";
4
+ const SLOT_DURATION_MINUTES = 30;
5
+ const OVERLAP_OFFSET_PX = 205;
6
+ function DayCalendarEvent(props) {
7
+ const { events, viewDate } = useFullCalendar();
8
+ const day = viewDate.getDate();
9
+ const month = viewDate.getMonth();
10
+ const year = viewDate.getFullYear();
11
+ const dayEvents = events
12
+ .map((event, sourceIndex) => ({ event, sourceIndex }))
13
+ .filter(({ event }) => {
14
+ return (event.date.getDate() === day &&
15
+ event.date.getMonth() === month &&
16
+ event.date.getFullYear() === year);
17
+ })
18
+ .sort((a, b) => {
19
+ const startA = a.event.date.getTime();
20
+ const startB = b.event.date.getTime();
21
+ if (startA !== startB)
22
+ return startA - startB;
23
+ const endA = a.event.endDate?.getTime() ?? startA + SLOT_DURATION_MINUTES * 60_000;
24
+ const endB = b.event.endDate?.getTime() ?? startB + SLOT_DURATION_MINUTES * 60_000;
25
+ if (endA !== endB)
26
+ return endA - endB;
27
+ return a.sourceIndex - b.sourceIndex;
28
+ });
29
+ const dayEventOrderBySourceIndex = new Map(dayEvents.map((item, orderIndex) => [item.sourceIndex, orderIndex]));
30
+ const filteredEvents = dayEvents.filter(({ event }) => {
31
+ const dayHour = Math.floor(props.timeInMinutes / 60);
32
+ const dayMinute = props.timeInMinutes % 60;
33
+ function isEventInInterval() {
34
+ const eventHour = event.date.getHours();
35
+ const eventMinute = event.date.getMinutes();
36
+ if (eventHour !== dayHour)
37
+ return false;
38
+ if (dayMinute === 0)
39
+ return eventMinute < 30 && eventMinute >= 0;
40
+ if (dayMinute === 30)
41
+ return eventMinute >= 30 && eventMinute < 60;
42
+ }
43
+ return (isEventInInterval() &&
44
+ event.date.getDate() === day &&
45
+ event.date.getMonth() === month &&
46
+ event.date.getFullYear() === year);
47
+ });
48
+ if (filteredEvents.length === 0)
49
+ return _jsx(_Fragment, {});
50
+ function makeEventKey(index, sourceIndex) {
51
+ return `${day}-${month}-${year}-${sourceIndex}-${index}`;
52
+ }
53
+ function makeHour(date) {
54
+ const hours = date.getHours();
55
+ const minutes = date.getMinutes();
56
+ if (minutes === 0)
57
+ return `${hours}h`;
58
+ return `${hours}h${minutes}`;
59
+ }
60
+ function getEventRangeInMinutes(event) {
61
+ const startMinutes = event.date.getHours() * 60 + event.date.getMinutes();
62
+ const endMinutes = event.endDate
63
+ ? event.endDate.getHours() * 60 + event.endDate.getMinutes()
64
+ : startMinutes + SLOT_DURATION_MINUTES;
65
+ return {
66
+ startMinutes,
67
+ endMinutes: Math.max(endMinutes, startMinutes + 1),
68
+ };
69
+ }
70
+ function countOverlappingPreviousEvents(currentEvent, sourceIndex) {
71
+ const current = getEventRangeInMinutes(currentEvent);
72
+ const currentOrderIndex = dayEventOrderBySourceIndex.get(sourceIndex);
73
+ if (currentOrderIndex == null)
74
+ return 0;
75
+ return dayEvents.reduce((count, item, orderIndex) => {
76
+ if (orderIndex >= currentOrderIndex)
77
+ return count;
78
+ const candidate = getEventRangeInMinutes(item.event);
79
+ const intersects = candidate.startMinutes < current.endMinutes &&
80
+ candidate.endMinutes > current.startMinutes;
81
+ if (!intersects)
82
+ return count;
83
+ return count + 1;
84
+ }, 0);
85
+ }
86
+ function getEventStyle(event, sourceIndex) {
87
+ const { startMinutes, endMinutes } = getEventRangeInMinutes(event);
88
+ const startOffsetInCell = startMinutes - props.timeInMinutes;
89
+ const durationInMinutes = Math.max(endMinutes - startMinutes, 1);
90
+ const top = (startOffsetInCell / SLOT_DURATION_MINUTES) * 100;
91
+ const height = (durationInMinutes / SLOT_DURATION_MINUTES) * 100;
92
+ const overlapOffset = countOverlappingPreviousEvents(event, sourceIndex) * OVERLAP_OFFSET_PX;
93
+ return {
94
+ top: `${top}%`,
95
+ height: `${height}%`,
96
+ left: `${overlapOffset}px`,
97
+ };
98
+ }
99
+ return filteredEvents.map(({ event, sourceIndex }, index) => (_jsxs("div", { className: `arkynDayCalendarEvent ${event?.scheme || "primary"}`, style: getEventStyle(event, sourceIndex), onClick: () => event.onClick?.(event.data), children: [_jsxs("strong", { children: [makeHour(event.date), " ", event?.endDate && `- ${makeHour(event.endDate)}`] }), _jsx("p", { children: event.title })] }, makeEventKey(index, sourceIndex))));
100
+ }
101
+ export { DayCalendarEvent };
@@ -0,0 +1,8 @@
1
+ import "./styles.css";
2
+ type DayCalendarRowProps = {
3
+ hour: number;
4
+ timeInMinutes: number;
5
+ };
6
+ declare function DayCalendarRow({ hour, timeInMinutes }: DayCalendarRowProps): import("react/jsx-runtime").JSX.Element;
7
+ export { DayCalendarRow, type DayCalendarRowProps };
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/fullCalendar/dayCalendar/dayCalendarRow/index.tsx"],"names":[],"mappings":"AAEA,OAAO,cAAc,CAAC;AAEtB,KAAK,mBAAmB,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,iBAAS,cAAc,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,EAAE,mBAAmB,2CAYnE;AAED,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { ViewService } from "../../_viewService";
3
+ import { DayCalendarEvent } from "../dayCalendarEvent";
4
+ import "./styles.css";
5
+ function DayCalendarRow({ hour, timeInMinutes }) {
6
+ const viewService = new ViewService();
7
+ return (_jsxs("div", { className: "arkynDayCalendarRow", "data-time": timeInMinutes, children: [_jsx("p", { children: viewService.formatHourLabel(hour) }), _jsx("div", { className: "arkynDayCalendarRowContent", children: _jsx(DayCalendarEvent, { timeInMinutes: timeInMinutes }) })] }));
8
+ }
9
+ export { DayCalendarRow };
@@ -0,0 +1,3 @@
1
+ declare function DayCalendar(): import("react/jsx-runtime").JSX.Element;
2
+ export { DayCalendar };
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/fullCalendar/dayCalendar/index.tsx"],"names":[],"mappings":"AAIA,iBAAS,WAAW,4CASnB;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useFullCalendar } from "../_fullCalendarProvider";
3
+ import { DayCalendarContainer } from "./dayCalendarContainer";
4
+ import { DayCalendarRow } from "./dayCalendarRow";
5
+ function DayCalendar() {
6
+ const { listHours } = useFullCalendar();
7
+ return (_jsx(DayCalendarContainer, { children: listHours.map((hour) => (_jsx(DayCalendarRow, { hour: hour, timeInMinutes: hour }))) }));
8
+ }
9
+ export { DayCalendar };
@@ -0,0 +1,8 @@
1
+ import type { ReactNode } from "react";
2
+ import "./styles.css";
3
+ type FullCalendarContainerProps = {
4
+ children?: ReactNode;
5
+ };
6
+ declare function FullCalendarContainer({ children }: FullCalendarContainerProps): import("react/jsx-runtime").JSX.Element;
7
+ export { FullCalendarContainer };
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/fullCalendar/fullCalendarContainer/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,cAAc,CAAC;AAEtB,KAAK,0BAA0B,GAAG;IAChC,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF,iBAAS,qBAAqB,CAAC,EAAE,QAAQ,EAAE,EAAE,0BAA0B,2CAEtE;AAED,OAAO,EAAE,qBAAqB,EAAE,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import "./styles.css";
3
+ function FullCalendarContainer({ children }) {
4
+ return _jsx("div", { className: "arkynFullCalendarContainer", children: children });
5
+ }
6
+ export { FullCalendarContainer };
@@ -0,0 +1,8 @@
1
+ import "./styles.css";
2
+ type FullCalendarHeaderProps = {
3
+ viewType: "day" | "week" | "month";
4
+ setViewType: (viewType: "day" | "week" | "month") => void;
5
+ };
6
+ declare function FullCalendarHeader(props: FullCalendarHeaderProps): import("react/jsx-runtime").JSX.Element;
7
+ export { FullCalendarHeader };
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/fullCalendar/fullCalendarHeader/index.tsx"],"names":[],"mappings":"AAOA,OAAO,cAAc,CAAC;AAEtB,KAAK,uBAAuB,GAAG;IAC7B,QAAQ,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,CAAC;IACnC,WAAW,EAAE,CAAC,QAAQ,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,KAAK,IAAI,CAAC;CAC3D,CAAC;AAEF,iBAAS,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,2CA8DzD;AAED,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
@@ -0,0 +1,37 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { ChevronLeft, ChevronRight } from "lucide-react";
3
+ import { CardTabButton } from "../../../components/cardTab/cardTabButton";
4
+ import { CardTabContainer } from "../../../components/cardTab/cardTabContainer";
5
+ import { IconButton } from "../../../components/iconButton";
6
+ import { useFullCalendar } from "../_fullCalendarProvider";
7
+ import "./styles.css";
8
+ function FullCalendarHeader(props) {
9
+ const { setViewType, viewType } = props;
10
+ const fullCalendar = useFullCalendar();
11
+ function handlePrevious() {
12
+ switch (viewType) {
13
+ case "day":
14
+ return fullCalendar.previousDay();
15
+ case "week":
16
+ return fullCalendar.previousWeek();
17
+ case "month":
18
+ return fullCalendar.previousMonth();
19
+ }
20
+ }
21
+ function handleNext() {
22
+ switch (viewType) {
23
+ case "day":
24
+ return fullCalendar.nextDay();
25
+ case "week":
26
+ return fullCalendar.nextWeek();
27
+ case "month":
28
+ return fullCalendar.nextMonth();
29
+ }
30
+ }
31
+ return (_jsxs("div", { className: "arkynFullCalendarHeader", children: [_jsxs(CardTabContainer, { defaultValue: viewType, onChange: (value) => setViewType(value), children: [_jsx(CardTabButton, { value: "day", children: "Dia" }), _jsx(CardTabButton, { value: "week", children: "Semana" }), _jsx(CardTabButton, { value: "month", children: "M\u00EAs" })] }), _jsxs("div", { className: "arkynFullCalendarHeaderActions", children: [_jsx(IconButton, { variant: "outline", icon: ChevronLeft, "aria-label": "Handle previous", onClick: () => handlePrevious() }), _jsx("p", { children: fullCalendar.viewDate.toLocaleDateString("pt-BR", {
32
+ day: "2-digit",
33
+ month: "long",
34
+ year: "numeric",
35
+ }) }), _jsx(IconButton, { variant: "outline", icon: ChevronRight, "aria-label": "Handle next", onClick: () => handleNext() })] })] }));
36
+ }
37
+ export { FullCalendarHeader };
@@ -0,0 +1,78 @@
1
+ type FullCalendarEvent = {
2
+ /** Event label shown on the calendar chip. Required. */
3
+ title: string;
4
+ /** Event start date/time. Required. */
5
+ date: Date;
6
+ /** Event end date/time. When omitted the event is treated as a point in time. */
7
+ endDate?: Date;
8
+ /** Arbitrary payload forwarded to `onClick`. */
9
+ data?: any;
10
+ /** Color scheme for the event chip. @default "primary" */
11
+ scheme?: "primary" | "success" | "warning" | "danger" | "info";
12
+ /** Callback fired when the user clicks the event chip. Receives `data`. */
13
+ onClick?: (data: any) => void;
14
+ };
15
+ type FullCalendarProps = {
16
+ /** Initial view to render. @default "month" */
17
+ defaultView?: "day" | "week" | "month";
18
+ /** Initial selected date. Defaults to today. */
19
+ defaultValue?: Date;
20
+ /** Array of events to display on the calendar. */
21
+ events?: FullCalendarEvent[];
22
+ /** Callback fired when the selected date changes. Receives the new `Date`. */
23
+ onChange?: (date: Date) => void;
24
+ /** Callback fired when the user navigates to a different period. Receives the current `Date`. */
25
+ onChangeView?: (date: Date) => void;
26
+ };
27
+ /**
28
+ * FullCalendar — interactive calendar with day, week, and month views.
29
+ *
30
+ * Renders a navigable calendar that displays a list of events. The active view
31
+ * can be switched at runtime via the built-in header controls.
32
+ *
33
+ * @param props.defaultView - Initial view to render (`"day"` | `"week"` | `"month"`). Default: `"month"`
34
+ * @param props.defaultValue - Initial selected date. Defaults to today.
35
+ * @param props.events - Array of events to display on the calendar.
36
+ * @param props.events[].title - Event label shown on the calendar.
37
+ * @param props.events[].date - Event start date/time.
38
+ * @param props.events[].endDate - Event end date/time (optional).
39
+ * @param props.events[].data - Arbitrary payload forwarded to `onClick`.
40
+ * @param props.events[].scheme - Color scheme for the event chip (`"primary"` | `"success"` | `"warning"` | `"danger"` | `"info"`).
41
+ * @param props.events[].onClick - Fires when the user clicks the event — receives `data`.
42
+ * @param props.onChange - Fires when the selected date changes — receives the new `Date`.
43
+ * @param props.onChangeView - Fires when the user navigates to a different period — receives the current `Date`.
44
+ *
45
+ * @returns FullCalendar JSX element.
46
+ *
47
+ * @example
48
+ * ```tsx
49
+ * // Basic monthly calendar
50
+ * <FullCalendar />
51
+ *
52
+ * // Start on week view with a pre-selected date
53
+ * <FullCalendar defaultView="week" defaultValue={new Date("2025-06-01")} />
54
+ *
55
+ * // With events
56
+ * <FullCalendar
57
+ * events={[
58
+ * {
59
+ * title: "Team meeting",
60
+ * date: new Date("2025-06-13T10:00:00"),
61
+ * endDate: new Date("2025-06-13T11:00:00"),
62
+ * scheme: "primary",
63
+ * data: { meetingId: 42 },
64
+ * onClick: ({ meetingId }) => openMeeting(meetingId),
65
+ * },
66
+ * {
67
+ * title: "Deadline",
68
+ * date: new Date("2025-06-20"),
69
+ * scheme: "danger",
70
+ * },
71
+ * ]}
72
+ * onChangeView={(date) => fetchEventsForMonth(date)}
73
+ * />
74
+ * ```
75
+ */
76
+ declare function FullCalendar(props: FullCalendarProps): import("react/jsx-runtime").JSX.Element;
77
+ export { FullCalendar };
78
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/fullCalendar/index.tsx"],"names":[],"mappings":"AAQA,KAAK,iBAAiB,GAAG;IACvB,wDAAwD;IACxD,KAAK,EAAE,MAAM,CAAC;IACd,uCAAuC;IACvC,IAAI,EAAE,IAAI,CAAC;IACX,iFAAiF;IACjF,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,gDAAgD;IAChD,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,0DAA0D;IAC1D,MAAM,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC/D,2EAA2E;IAC3E,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;CAC/B,CAAC;AAEF,KAAK,iBAAiB,GAAG;IACvB,+CAA+C;IAC/C,WAAW,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,CAAC;IACvC,gDAAgD;IAChD,YAAY,CAAC,EAAE,IAAI,CAAC;IACpB,kDAAkD;IAClD,MAAM,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC7B,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IAChC,iGAAiG;IACjG,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;CACrC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,iBAAS,YAAY,CAAC,KAAK,EAAE,iBAAiB,2CAiB7C;AAED,OAAO,EAAE,YAAY,EAAE,CAAC"}