@korsolutions/ui 0.0.72 → 0.0.75

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 (168) hide show
  1. package/dist/module/components/calendar/calendar/calendar-root.js +57 -0
  2. package/dist/module/components/calendar/calendar/calendar-root.js.map +1 -0
  3. package/dist/module/components/calendar/{components → calendar}/calendar-weeks.js +12 -5
  4. package/dist/module/components/calendar/calendar/calendar-weeks.js.map +1 -0
  5. package/dist/module/components/calendar/calendar/index.js +19 -0
  6. package/dist/module/components/calendar/calendar/index.js.map +1 -0
  7. package/dist/module/components/calendar/calendar/types.js.map +1 -0
  8. package/dist/module/components/calendar/{variants → calendar/variants}/default.js +29 -13
  9. package/dist/module/components/calendar/calendar/variants/default.js.map +1 -0
  10. package/dist/module/components/calendar/calendar/variants/index.js.map +1 -0
  11. package/dist/module/components/calendar/index.js +3 -16
  12. package/dist/module/components/calendar/index.js.map +1 -1
  13. package/dist/module/components/calendar/{context.js → shared/calendar-context.js} +2 -2
  14. package/dist/module/components/calendar/shared/calendar-context.js.map +1 -0
  15. package/dist/module/components/calendar/{components → shared}/calendar-day.js +12 -11
  16. package/dist/module/components/calendar/shared/calendar-day.js.map +1 -0
  17. package/dist/module/components/calendar/{components → shared}/calendar-header.js +1 -1
  18. package/dist/module/components/calendar/shared/calendar-header.js.map +1 -0
  19. package/dist/module/components/calendar/shared/calendar-nav-buttons.js +63 -0
  20. package/dist/module/components/calendar/shared/calendar-nav-buttons.js.map +1 -0
  21. package/dist/module/components/calendar/{components → shared}/calendar-title.js +2 -2
  22. package/dist/module/components/calendar/shared/calendar-title.js.map +1 -0
  23. package/dist/module/components/calendar/{components → shared}/calendar-week-labels.js +1 -1
  24. package/dist/module/components/calendar/shared/calendar-week-labels.js.map +1 -0
  25. package/dist/module/components/calendar/shared/types.js +4 -0
  26. package/dist/module/components/calendar/shared/types.js.map +1 -0
  27. package/dist/module/components/calendar/timeline/calendar-timeline.js +138 -0
  28. package/dist/module/components/calendar/timeline/calendar-timeline.js.map +1 -0
  29. package/dist/module/components/calendar/timeline/index.js +4 -0
  30. package/dist/module/components/calendar/timeline/index.js.map +1 -0
  31. package/dist/module/components/calendar/timeline/types.js +4 -0
  32. package/dist/module/components/calendar/timeline/types.js.map +1 -0
  33. package/dist/module/components/calendar/timeline/variants/default.js +62 -0
  34. package/dist/module/components/calendar/timeline/variants/default.js.map +1 -0
  35. package/dist/module/components/calendar/timeline/variants/index.js +7 -0
  36. package/dist/module/components/calendar/timeline/variants/index.js.map +1 -0
  37. package/dist/module/components/calendar/week-calendar/index.js +4 -0
  38. package/dist/module/components/calendar/week-calendar/index.js.map +1 -0
  39. package/dist/module/components/calendar/week-calendar/types.js +4 -0
  40. package/dist/module/components/calendar/week-calendar/types.js.map +1 -0
  41. package/dist/module/components/calendar/week-calendar/variants/default.js +145 -0
  42. package/dist/module/components/calendar/week-calendar/variants/default.js.map +1 -0
  43. package/dist/module/components/calendar/week-calendar/variants/index.js +7 -0
  44. package/dist/module/components/calendar/week-calendar/variants/index.js.map +1 -0
  45. package/dist/module/components/calendar/week-calendar/week-calendar.js +170 -0
  46. package/dist/module/components/calendar/week-calendar/week-calendar.js.map +1 -0
  47. package/dist/module/components/index.js +1 -1
  48. package/dist/module/index.js +2 -1
  49. package/dist/module/index.js.map +1 -1
  50. package/dist/module/themes/provider.js.map +1 -1
  51. package/dist/module/utils/date-utils.js +45 -17
  52. package/dist/module/utils/date-utils.js.map +1 -1
  53. package/dist/typescript/src/components/calendar/{components → calendar}/calendar-root.d.ts +2 -1
  54. package/dist/typescript/src/components/calendar/calendar/calendar-root.d.ts.map +1 -0
  55. package/dist/typescript/src/components/calendar/calendar/calendar-weeks.d.ts.map +1 -0
  56. package/dist/typescript/src/components/calendar/calendar/index.d.ts +25 -0
  57. package/dist/typescript/src/components/calendar/calendar/index.d.ts.map +1 -0
  58. package/dist/typescript/src/components/calendar/calendar/types.d.ts +7 -0
  59. package/dist/typescript/src/components/calendar/calendar/types.d.ts.map +1 -0
  60. package/dist/typescript/src/components/calendar/calendar/variants/default.d.ts +3 -0
  61. package/dist/typescript/src/components/calendar/calendar/variants/default.d.ts.map +1 -0
  62. package/dist/typescript/src/components/calendar/calendar/variants/index.d.ts.map +1 -0
  63. package/dist/typescript/src/components/calendar/index.d.ts +7 -24
  64. package/dist/typescript/src/components/calendar/index.d.ts.map +1 -1
  65. package/dist/typescript/src/components/calendar/{context.d.ts → shared/calendar-context.d.ts} +10 -4
  66. package/dist/typescript/src/components/calendar/shared/calendar-context.d.ts.map +1 -0
  67. package/dist/typescript/src/components/calendar/shared/calendar-day.d.ts.map +1 -0
  68. package/dist/typescript/src/components/calendar/shared/calendar-header.d.ts.map +1 -0
  69. package/dist/typescript/src/components/calendar/shared/calendar-nav-buttons.d.ts +7 -0
  70. package/dist/typescript/src/components/calendar/shared/calendar-nav-buttons.d.ts.map +1 -0
  71. package/dist/typescript/src/components/calendar/shared/calendar-title.d.ts.map +1 -0
  72. package/dist/typescript/src/components/calendar/shared/calendar-week-labels.d.ts.map +1 -0
  73. package/dist/typescript/src/components/calendar/shared/types.d.ts +18 -0
  74. package/dist/typescript/src/components/calendar/shared/types.d.ts.map +1 -0
  75. package/dist/typescript/src/components/calendar/timeline/calendar-timeline.d.ts +23 -0
  76. package/dist/typescript/src/components/calendar/timeline/calendar-timeline.d.ts.map +1 -0
  77. package/dist/typescript/src/components/calendar/timeline/index.d.ts +4 -0
  78. package/dist/typescript/src/components/calendar/timeline/index.d.ts.map +1 -0
  79. package/dist/typescript/src/components/calendar/timeline/types.d.ts +13 -0
  80. package/dist/typescript/src/components/calendar/timeline/types.d.ts.map +1 -0
  81. package/dist/typescript/src/components/calendar/timeline/variants/default.d.ts +3 -0
  82. package/dist/typescript/src/components/calendar/timeline/variants/default.d.ts.map +1 -0
  83. package/dist/typescript/src/components/calendar/timeline/variants/index.d.ts +4 -0
  84. package/dist/typescript/src/components/calendar/timeline/variants/index.d.ts.map +1 -0
  85. package/dist/typescript/src/components/calendar/week-calendar/index.d.ts +4 -0
  86. package/dist/typescript/src/components/calendar/week-calendar/index.d.ts.map +1 -0
  87. package/dist/typescript/src/components/calendar/week-calendar/types.d.ts +7 -0
  88. package/dist/typescript/src/components/calendar/week-calendar/types.d.ts.map +1 -0
  89. package/dist/typescript/src/components/calendar/week-calendar/variants/default.d.ts +3 -0
  90. package/dist/typescript/src/components/calendar/week-calendar/variants/default.d.ts.map +1 -0
  91. package/dist/typescript/src/components/calendar/week-calendar/variants/index.d.ts +4 -0
  92. package/dist/typescript/src/components/calendar/week-calendar/variants/index.d.ts.map +1 -0
  93. package/dist/typescript/src/components/calendar/week-calendar/week-calendar.d.ts +16 -0
  94. package/dist/typescript/src/components/calendar/week-calendar/week-calendar.d.ts.map +1 -0
  95. package/dist/typescript/src/components/index.d.ts +1 -1
  96. package/dist/typescript/src/index.d.ts.map +1 -1
  97. package/dist/typescript/src/themes/provider.d.ts +4 -0
  98. package/dist/typescript/src/themes/provider.d.ts.map +1 -1
  99. package/dist/typescript/src/utils/date-utils.d.ts +8 -1
  100. package/dist/typescript/src/utils/date-utils.d.ts.map +1 -1
  101. package/package.json +1 -1
  102. package/src/components/calendar/calendar/calendar-root.tsx +73 -0
  103. package/src/components/calendar/{components → calendar}/calendar-weeks.tsx +22 -8
  104. package/src/components/calendar/calendar/index.ts +26 -0
  105. package/src/components/calendar/calendar/types.ts +7 -0
  106. package/src/components/calendar/{variants → calendar/variants}/default.tsx +30 -14
  107. package/src/components/calendar/index.ts +21 -24
  108. package/src/components/calendar/shared/calendar-context.ts +35 -0
  109. package/src/components/calendar/{components → shared}/calendar-day.tsx +41 -13
  110. package/src/components/calendar/{components → shared}/calendar-header.tsx +7 -2
  111. package/src/components/calendar/shared/calendar-nav-buttons.tsx +81 -0
  112. package/src/components/calendar/{components → shared}/calendar-title.tsx +8 -3
  113. package/src/components/calendar/{components → shared}/calendar-week-labels.tsx +8 -2
  114. package/src/components/calendar/shared/types.ts +24 -0
  115. package/src/components/calendar/timeline/calendar-timeline.tsx +204 -0
  116. package/src/components/calendar/timeline/index.ts +6 -0
  117. package/src/components/calendar/timeline/types.ts +13 -0
  118. package/src/components/calendar/timeline/variants/default.tsx +59 -0
  119. package/src/components/calendar/timeline/variants/index.ts +5 -0
  120. package/src/components/calendar/week-calendar/index.ts +3 -0
  121. package/src/components/calendar/week-calendar/types.ts +7 -0
  122. package/src/components/calendar/week-calendar/variants/default.tsx +141 -0
  123. package/src/components/calendar/week-calendar/variants/index.ts +5 -0
  124. package/src/components/calendar/week-calendar/week-calendar.tsx +256 -0
  125. package/src/components/index.ts +1 -1
  126. package/src/index.tsx +2 -0
  127. package/src/themes/provider.tsx +4 -0
  128. package/src/utils/date-utils.ts +53 -21
  129. package/dist/module/components/calendar/components/calendar-day.js.map +0 -1
  130. package/dist/module/components/calendar/components/calendar-header.js.map +0 -1
  131. package/dist/module/components/calendar/components/calendar-nav-button.js +0 -61
  132. package/dist/module/components/calendar/components/calendar-nav-button.js.map +0 -1
  133. package/dist/module/components/calendar/components/calendar-root.js +0 -39
  134. package/dist/module/components/calendar/components/calendar-root.js.map +0 -1
  135. package/dist/module/components/calendar/components/calendar-title.js.map +0 -1
  136. package/dist/module/components/calendar/components/calendar-week-labels.js.map +0 -1
  137. package/dist/module/components/calendar/components/calendar-weeks.js.map +0 -1
  138. package/dist/module/components/calendar/context.js.map +0 -1
  139. package/dist/module/components/calendar/types.js.map +0 -1
  140. package/dist/module/components/calendar/variants/default.js.map +0 -1
  141. package/dist/module/components/calendar/variants/index.js.map +0 -1
  142. package/dist/typescript/src/components/calendar/components/calendar-day.d.ts.map +0 -1
  143. package/dist/typescript/src/components/calendar/components/calendar-header.d.ts.map +0 -1
  144. package/dist/typescript/src/components/calendar/components/calendar-nav-button.d.ts +0 -10
  145. package/dist/typescript/src/components/calendar/components/calendar-nav-button.d.ts.map +0 -1
  146. package/dist/typescript/src/components/calendar/components/calendar-root.d.ts.map +0 -1
  147. package/dist/typescript/src/components/calendar/components/calendar-title.d.ts.map +0 -1
  148. package/dist/typescript/src/components/calendar/components/calendar-week-labels.d.ts.map +0 -1
  149. package/dist/typescript/src/components/calendar/components/calendar-weeks.d.ts.map +0 -1
  150. package/dist/typescript/src/components/calendar/context.d.ts.map +0 -1
  151. package/dist/typescript/src/components/calendar/types.d.ts +0 -37
  152. package/dist/typescript/src/components/calendar/types.d.ts.map +0 -1
  153. package/dist/typescript/src/components/calendar/variants/default.d.ts +0 -3
  154. package/dist/typescript/src/components/calendar/variants/default.d.ts.map +0 -1
  155. package/dist/typescript/src/components/calendar/variants/index.d.ts.map +0 -1
  156. package/src/components/calendar/components/calendar-nav-button.tsx +0 -60
  157. package/src/components/calendar/components/calendar-root.tsx +0 -42
  158. package/src/components/calendar/context.ts +0 -23
  159. package/src/components/calendar/types.ts +0 -39
  160. /package/dist/module/components/calendar/{types.js → calendar/types.js} +0 -0
  161. /package/dist/module/components/calendar/{variants → calendar/variants}/index.js +0 -0
  162. /package/dist/typescript/src/components/calendar/{components → calendar}/calendar-weeks.d.ts +0 -0
  163. /package/dist/typescript/src/components/calendar/{variants → calendar/variants}/index.d.ts +0 -0
  164. /package/dist/typescript/src/components/calendar/{components → shared}/calendar-day.d.ts +0 -0
  165. /package/dist/typescript/src/components/calendar/{components → shared}/calendar-header.d.ts +0 -0
  166. /package/dist/typescript/src/components/calendar/{components → shared}/calendar-title.d.ts +0 -0
  167. /package/dist/typescript/src/components/calendar/{components → shared}/calendar-week-labels.d.ts +0 -0
  168. /package/src/components/calendar/{variants → calendar/variants}/index.ts +0 -0
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+
3
+ import React, { useCallback, useMemo, useState } from "react";
4
+ import { View } from "react-native";
5
+ import { addMonths, subMonths } from "../../../utils/date-utils.js";
6
+ import { CalendarContext } from "../shared/calendar-context.js";
7
+ import { CalendarVariants } from "./variants/index.js";
8
+ import { jsx as _jsx } from "react/jsx-runtime";
9
+ export function CalendarRoot(props) {
10
+ const {
11
+ children,
12
+ value,
13
+ onChange,
14
+ defaultMonth = new Date(),
15
+ minDate,
16
+ maxDate,
17
+ markedDates,
18
+ style
19
+ } = props;
20
+ const variantStyles = CalendarVariants[props.variant || "default"]();
21
+ const [currentMonth, setCurrentMonth] = useState(defaultMonth);
22
+ const goToPrev = useCallback(() => {
23
+ setCurrentMonth(prev => subMonths(prev, 1));
24
+ }, []);
25
+ const goToNext = useCallback(() => {
26
+ setCurrentMonth(prev => addMonths(prev, 1));
27
+ }, []);
28
+ const isPrevDisabled = useMemo(() => {
29
+ if (!minDate) return false;
30
+ return subMonths(currentMonth, 1) < minDate;
31
+ }, [currentMonth, minDate]);
32
+ const isNextDisabled = useMemo(() => {
33
+ if (!maxDate) return false;
34
+ return addMonths(currentMonth, 1) > maxDate;
35
+ }, [currentMonth, maxDate]);
36
+ const containerStyle = [variantStyles.root, style];
37
+ return /*#__PURE__*/_jsx(CalendarContext.Provider, {
38
+ value: {
39
+ value,
40
+ onChange,
41
+ currentMonth,
42
+ goToPrev,
43
+ goToNext,
44
+ isPrevDisabled,
45
+ isNextDisabled,
46
+ styles: variantStyles,
47
+ minDate,
48
+ maxDate,
49
+ markedDates
50
+ },
51
+ children: /*#__PURE__*/_jsx(View, {
52
+ style: containerStyle,
53
+ children: children
54
+ })
55
+ });
56
+ }
57
+ //# sourceMappingURL=calendar-root.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","useCallback","useMemo","useState","View","addMonths","subMonths","CalendarContext","CalendarVariants","jsx","_jsx","CalendarRoot","props","children","value","onChange","defaultMonth","Date","minDate","maxDate","markedDates","style","variantStyles","variant","currentMonth","setCurrentMonth","goToPrev","prev","goToNext","isPrevDisabled","isNextDisabled","containerStyle","root","Provider","styles"],"sourceRoot":"../../../../../src","sources":["components/calendar/calendar/calendar-root.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAC7D,SAASC,IAAI,QAAwC,cAAc;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AAY,EAAEL,OAAO,CAAC,CAAC;EAE3B,MAAMY,cAAc,GAAG,CAACT,aAAa,CAACU,IAAI,EAAEX,KAAK,CAAC;EAElD,oBACEX,IAAA,CAACH,eAAe,CAAC0B,QAAQ;IACvBnB,KAAK,EAAE;MACLA,KAAK;MACLC,QAAQ;MACRS,YAAY;MACZE,QAAQ;MACRE,QAAQ;MACRC,cAAc;MACdC,cAAc;MACdI,MAAM,EAAEZ,aAAa;MACrBJ,OAAO;MACPC,OAAO;MACPC;IACF,CAAE;IAAAP,QAAA,eAEFH,IAAA,CAACN,IAAI;MAACiB,KAAK,EAAEU,cAAe;MAAAlB,QAAA,EAAEA;IAAQ,CAAO;EAAC,CACtB,CAAC;AAE/B","ignoreList":[]}
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
 
3
- import { getWeekDays, getWeeksInMonth } from "../../../utils/date-utils.js";
4
3
  import React from "react";
5
4
  import { View } from "react-native";
6
- import { useCalendarContext } from "../context.js";
7
- import { CalendarDay } from "./calendar-day.js";
5
+ import { getWeekDays, getWeeksInMonth } from "../../../utils/date-utils.js";
6
+ import { useCalendarContext } from "../shared/calendar-context.js";
7
+ import { CalendarDay } from "../shared/calendar-day.js";
8
8
  import { jsx as _jsx } from "react/jsx-runtime";
9
9
  function CalendarWeek(props) {
10
10
  const {
@@ -15,12 +15,18 @@ function CalendarWeek(props) {
15
15
  currentMonth,
16
16
  styles
17
17
  } = useCalendarContext();
18
+ const calStyles = styles;
18
19
  const days = getWeekDays(currentMonth.getMonth(), currentMonth.getFullYear(), props.index);
19
- const composedStyle = [styles?.week, style];
20
+ const composedStyle = [calStyles?.week, style];
20
21
  return /*#__PURE__*/_jsx(View, {
21
22
  ...viewProps,
22
23
  style: composedStyle,
23
24
  children: days.map((day, index) => {
25
+ if (!day) {
26
+ return /*#__PURE__*/_jsx(View, {
27
+ style: styles?.dayButton?.default
28
+ }, index);
29
+ }
24
30
  return /*#__PURE__*/_jsx(CalendarDay, {
25
31
  date: day
26
32
  }, index);
@@ -32,8 +38,9 @@ export function CalendarWeeks(props) {
32
38
  currentMonth,
33
39
  styles
34
40
  } = useCalendarContext();
41
+ const calStyles = styles;
35
42
  const weeks = getWeeksInMonth(currentMonth);
36
- const composedStyle = [styles?.weeks, props.style];
43
+ const composedStyle = [calStyles?.weeks, props.style];
37
44
  return /*#__PURE__*/_jsx(View, {
38
45
  style: composedStyle,
39
46
  children: Array.from({
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","View","getWeekDays","getWeeksInMonth","useCalendarContext","CalendarDay","jsx","_jsx","CalendarWeek","props","style","viewProps","currentMonth","styles","calStyles","days","getMonth","getFullYear","index","composedStyle","week","children","map","day","dayButton","default","date","CalendarWeeks","weeks","Array","from","length","_"],"sourceRoot":"../../../../../src","sources":["components/calendar/calendar/calendar-weeks.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SACEC,IAAI,QAIC,cAAc;AACrB,SAASC,WAAW,EAAEC,eAAe,QAAQ,8BAA2B;AACxE,SAASC,kBAAkB,QAAQ,+BAA4B;AAC/D,SAASC,WAAW,QAAQ,2BAAwB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAQrD,SAASC,YAAYA,CAACC,KAAwB,EAAE;EAC9C,MAAM;IAAEC,KAAK;IAAE,GAAGC;EAAU,CAAC,GAAGF,KAAK;EACrC,MAAM;IAAEG,YAAY;IAAEC;EAAO,CAAC,GAAGT,kBAAkB,CAAC,CAAC;EACrD,MAAMU,SAAS,GAAGD,MAAwB;EAE1C,MAAME,IAAI,GAAGb,WAAW,CACtBU,YAAY,CAACI,QAAQ,CAAC,CAAC,EACvBJ,YAAY,CAACK,WAAW,CAAC,CAAC,EAC1BR,KAAK,CAACS,KACR,CAAC;EAED,MAAMC,aAAa,GAAG,CAACL,SAAS,EAAEM,IAAI,EAAEV,KAAK,CAAC;EAC9C,oBACEH,IAAA,CAACN,IAAI;IAAA,GAAKU,SAAS;IAAED,KAAK,EAAES,aAAc;IAAAE,QAAA,EACvCN,IAAI,CAACO,GAAG,CAAC,CAACC,GAAG,EAAEL,KAAK,KAAK;MACxB,IAAI,CAACK,GAAG,EAAE;QACR,oBAAOhB,IAAA,CAACN,IAAI;UAAaS,KAAK,EAAEG,MAAM,EAAEW,SAAS,EAAEC;QAAQ,GAAzCP,KAA2C,CAAC;MAChE;MACA,oBAAOX,IAAA,CAACF,WAAW;QAAaqB,IAAI,EAAEH;MAAI,GAAjBL,KAAmB,CAAC;IAC/C,CAAC;EAAC,CACE,CAAC;AAEX;AAMA,OAAO,SAASS,aAAaA,CAAClB,KAAyB,EAAE;EACvD,MAAM;IAAEG,YAAY;IAAEC;EAAO,CAAC,GAAGT,kBAAkB,CAAC,CAAC;EACrD,MAAMU,SAAS,GAAGD,MAAwB;EAE1C,MAAMe,KAAK,GAAGzB,eAAe,CAACS,YAAY,CAAC;EAE3C,MAAMO,aAAa,GAAG,CAACL,SAAS,EAAEc,KAAK,EAAEnB,KAAK,CAACC,KAAK,CAAC;EAErD,oBACEH,IAAA,CAACN,IAAI;IAACS,KAAK,EAAES,aAAc;IAAAE,QAAA,EACxBQ,KAAK,CAACC,IAAI,CAAC;MAAEC,MAAM,EAAEH;IAAM,CAAC,CAAC,CAACN,GAAG,CAAC,CAACU,CAAC,EAAEd,KAAK,KAAK;MAC/C,oBAAOX,IAAA,CAACC,YAAY;QAAaU,KAAK,EAAEA;MAAM,GAApBA,KAAsB,CAAC;IACnD,CAAC;EAAC,CACE,CAAC;AAEX","ignoreList":[]}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ import { CalendarDay } from "../shared/calendar-day.js";
4
+ import { CalendarHeader } from "../shared/calendar-header.js";
5
+ import { CalendarNavButtons } from "../shared/calendar-nav-buttons.js";
6
+ import { CalendarTitle } from "../shared/calendar-title.js";
7
+ import { CalendarWeekLabels } from "../shared/calendar-week-labels.js";
8
+ import { CalendarRoot } from "./calendar-root.js";
9
+ import { CalendarWeeks } from "./calendar-weeks.js";
10
+ export const Calendar = {
11
+ Root: CalendarRoot,
12
+ Header: CalendarHeader,
13
+ Title: CalendarTitle,
14
+ NavButtons: CalendarNavButtons,
15
+ CalendarWeekLabels: CalendarWeekLabels,
16
+ Weeks: CalendarWeeks,
17
+ Day: CalendarDay
18
+ };
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["CalendarDay","CalendarHeader","CalendarNavButtons","CalendarTitle","CalendarWeekLabels","CalendarRoot","CalendarWeeks","Calendar","Root","Header","Title","NavButtons","Weeks","Day"],"sourceRoot":"../../../../../src","sources":["components/calendar/calendar/index.ts"],"mappings":";;AAAA,SAASA,WAAW,QAAQ,2BAAwB;AACpD,SAASC,cAAc,QAAQ,8BAA2B;AAC1D,SAASC,kBAAkB,QAAQ,mCAAgC;AACnE,SAASC,aAAa,QAAQ,6BAA0B;AACxD,SAASC,kBAAkB,QAAQ,mCAAgC;AACnE,SAASC,YAAY,QAAQ,oBAAiB;AAC9C,SAASC,aAAa,QAAQ,qBAAkB;AAEhD,OAAO,MAAMC,QAAQ,GAAG;EACtBC,IAAI,EAAEH,YAAY;EAClBI,MAAM,EAAER,cAAc;EACtBS,KAAK,EAAEP,aAAa;EACpBQ,UAAU,EAAET,kBAAkB;EAC9BE,kBAAkB,EAAEA,kBAAkB;EACtCQ,KAAK,EAAEN,aAAa;EACpBO,GAAG,EAAEb;AACP,CAAC","ignoreList":[]}
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["components/calendar/calendar/types.ts"],"mappings":"","ignoreList":[]}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
 
3
- import { useThemedStyles } from "../../../utils/use-themed-styles.js";
3
+ import { hslaSetRelativeLightness } from "../../../../utils/hsla-utils.js";
4
+ import { useThemedStyles } from "../../../../utils/use-themed-styles.js";
4
5
  export const useCalendarVariantDefault = () => {
5
6
  return useThemedStyles(({
6
7
  colors,
@@ -29,24 +30,38 @@ export const useCalendarVariantDefault = () => {
29
30
  fontFamily,
30
31
  color: colors.foreground
31
32
  },
33
+ navButtons: {
34
+ flexDirection: "row",
35
+ gap: 4
36
+ },
32
37
  navButton: {
33
38
  default: {
34
39
  width: 32,
35
40
  height: 32,
36
- borderRadius: radius * 0.5,
41
+ borderRadius: radius,
37
42
  alignItems: "center",
38
43
  justifyContent: "center",
39
44
  backgroundColor: "transparent"
40
45
  },
41
46
  disabled: {
42
- opacity: 0.3
47
+ opacity: 0.5
48
+ },
49
+ hovered: {
50
+ backgroundColor: hslaSetRelativeLightness(colors.secondary, -1)
43
51
  }
44
52
  },
45
- navButtonText: {
53
+ navButtonIcon: {
46
54
  default: {
47
- fontSize: fontSize * 1.5,
48
55
  color: colors.foreground,
49
- fontWeight: "500"
56
+ size: fontSize * 1.25,
57
+ style: {
58
+ color: colors.foreground,
59
+ fontSize: fontSize * 1.25,
60
+ lineHeight: fontSize * 1.25,
61
+ textAlign: "center",
62
+ fontWeight: "500",
63
+ pointerEvents: "none"
64
+ }
50
65
  },
51
66
  disabled: {
52
67
  color: colors.mutedForeground
@@ -95,9 +110,6 @@ export const useCalendarVariantDefault = () => {
95
110
  disabled: {
96
111
  opacity: 0.3
97
112
  },
98
- deprioritized: {
99
- backgroundColor: "transparent"
100
- },
101
113
  hovered: {
102
114
  backgroundColor: colors.muted
103
115
  }
@@ -120,11 +132,15 @@ export const useCalendarVariantDefault = () => {
120
132
  },
121
133
  disabled: {
122
134
  color: colors.mutedForeground
123
- },
124
- deprioritized: {
125
- color: colors.mutedForeground,
126
- opacity: 0.5
127
135
  }
136
+ },
137
+ dayMarker: {
138
+ width: 5,
139
+ height: 5,
140
+ borderRadius: 2.5,
141
+ backgroundColor: colors.primary,
142
+ marginTop: 2,
143
+ alignSelf: "center"
128
144
  }
129
145
  }));
130
146
  };
@@ -0,0 +1 @@
1
+ {"version":3,"names":["hslaSetRelativeLightness","useThemedStyles","useCalendarVariantDefault","colors","radius","fontFamily","fontSize","root","padding","backgroundColor","background","borderRadius","borderWidth","borderColor","border","width","header","flexDirection","justifyContent","alignItems","marginBottom","paddingHorizontal","headerTitle","fontWeight","color","foreground","navButtons","gap","navButton","default","height","disabled","opacity","hovered","secondary","navButtonIcon","size","style","lineHeight","textAlign","pointerEvents","mutedForeground","weekLabels","paddingVertical","weekLabel","weeks","week","dayButton","selected","primary","today","muted","dayText","primaryForeground","dayMarker","marginTop","alignSelf"],"sourceRoot":"../../../../../../src","sources":["components/calendar/calendar/variants/default.tsx"],"mappings":";;AAAA,SAASA,wBAAwB,QAAQ,iCAA8B;AACvE,SAASC,eAAe,QAAQ,wCAAqC;AAGrE,OAAO,MAAMC,yBAAyB,GAAGA,CAAA,KAAsB;EAC7D,OAAOD,eAAe,CACpB,CAAC;IAAEE,MAAM;IAAEC,MAAM;IAAEC,UAAU;IAAEC;EAAS,CAAC,MAAsB;IAC7DC,IAAI,EAAE;MACJC,OAAO,EAAE,EAAE;MACXC,eAAe,EAAEN,MAAM,CAACO,UAAU;MAClCC,YAAY,EAAEP,MAAM;MACpBQ,WAAW,EAAE,CAAC;MACdC,WAAW,EAAEV,MAAM,CAACW,MAAM;MAC1BC,KAAK,EAAE;IACT,CAAC;IACDC,MAAM,EAAE;MACNC,aAAa,EAAE,KAAK;MACpBC,cAAc,EAAE,eAAe;MAC/BC,UAAU,EAAE,QAAQ;MACpBC,YAAY,EAAE,EAAE;MAChBC,iBAAiB,EAAE;IACrB,CAAC;IACDC,WAAW,EAAE;MACXhB,QAAQ,EAAEA,QAAQ,GAAG,KAAK;MAC1BiB,UAAU,EAAE,KAAK;MACjBlB,UAAU;MACVmB,KAAK,EAAErB,MAAM,CAACsB;IAChB,CAAC;IACDC,UAAU,EAAE;MACVT,aAAa,EAAE,KAAK;MACpBU,GAAG,EAAE;IACP,CAAC;IACDC,SAAS,EAAE;MACTC,OAAO,EAAE;QACPd,KAAK,EAAE,EAAE;QACTe,MAAM,EAAE,EAAE;QACVnB,YAAY,EAAEP,MAAM;QACpBe,UAAU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,EAAE;QACTe,MAAM,EAAE,EAAE;QACVnB,YAAY,EAAEP,MAAM,GAAG,GAAG;QAC1Be,UAAU,EAAE,QAAQ;QACpBD,cAAc,EAAE,QAAQ;QACxBT,eAAe,EAAE;MACnB,CAAC;MACDuC,QAAQ,EAAE;QACRvC,eAAe,EAAEN,MAAM,CAAC8C;MAC1B,CAAC;MACDC,KAAK,EAAE;QACLtC,WAAW,EAAE,CAAC;QACdC,WAAW,EAAEV,MAAM,CAAC8C;MACtB,CAAC;MACDlB,QAAQ,EAAE;QACRC,OAAO,EAAE;MACX,CAAC;MACDC,OAAO,EAAE;QACPxB,eAAe,EAAEN,MAAM,CAACgD;MAC1B;IACF,CAAC;IACDC,OAAO,EAAE;MACPvB,OAAO,EAAE;QACPvB,QAAQ;QACRD,UAAU;QACVmB,KAAK,EAAErB,MAAM,CAACsB,UAAU;QACxBF,UAAU,EAAE,KAAK;QACjBiB,aAAa,EAAE;MACjB,CAAC;MACDQ,QAAQ,EAAE;QACRxB,KAAK,EAAErB,MAAM,CAACkD,iBAAiB;QAC/B9B,UAAU,EAAE;MACd,CAAC;MACD2B,KAAK,EAAE;QACL1B,KAAK,EAAErB,MAAM,CAAC8C,OAAO;QACrB1B,UAAU,EAAE;MACd,CAAC;MACDQ,QAAQ,EAAE;QACRP,KAAK,EAAErB,MAAM,CAACsC;MAChB;IACF,CAAC;IACDa,SAAS,EAAE;MACTvC,KAAK,EAAE,CAAC;MACRe,MAAM,EAAE,CAAC;MACTnB,YAAY,EAAE,GAAG;MACjBF,eAAe,EAAEN,MAAM,CAAC8C,OAAO;MAC/BM,SAAS,EAAE,CAAC;MACZC,SAAS,EAAE;IACb;EACF,CAAC,CACH,CAAC;AACH,CAAC","ignoreList":[]}
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useCalendarVariantDefault","CalendarVariants","default"],"sourceRoot":"../../../../../../src","sources":["components/calendar/calendar/variants/index.ts"],"mappings":";;AAAA,SAASA,yBAAyB,QAAQ,cAAW;AAErD,OAAO,MAAMC,gBAAgB,GAAG;EAC9BC,OAAO,EAAEF;AACX,CAAC","ignoreList":[]}
@@ -1,19 +1,6 @@
1
1
  "use strict";
2
2
 
3
- import { CalendarDay } from "./components/calendar-day.js";
4
- import { CalendarHeader } from "./components/calendar-header.js";
5
- import { CalendarNavButton } from "./components/calendar-nav-button.js";
6
- import { CalendarRoot } from "./components/calendar-root.js";
7
- import { CalendarTitle } from "./components/calendar-title.js";
8
- import { CalendarWeekLabels } from "./components/calendar-week-labels.js";
9
- import { CalendarWeeks } from "./components/calendar-weeks.js";
10
- export const Calendar = {
11
- Root: CalendarRoot,
12
- Header: CalendarHeader,
13
- Title: CalendarTitle,
14
- NavButton: CalendarNavButton,
15
- CalendarWeekLabels: CalendarWeekLabels,
16
- Weeks: CalendarWeeks,
17
- Day: CalendarDay
18
- };
3
+ export { Calendar } from "./calendar/index.js";
4
+ export { WeekCalendar } from "./week-calendar/index.js";
5
+ export { CalendarTimeline } from "./timeline/index.js";
19
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["CalendarDay","CalendarHeader","CalendarNavButton","CalendarRoot","CalendarTitle","CalendarWeekLabels","CalendarWeeks","Calendar","Root","Header","Title","NavButton","Weeks","Day"],"sourceRoot":"../../../../src","sources":["components/calendar/index.ts"],"mappings":";;AAAA,SAASA,WAAW,QAAQ,8BAA2B;AACvD,SAASC,cAAc,QAAQ,iCAA8B;AAC7D,SAASC,iBAAiB,QAAQ,qCAAkC;AACpE,SAASC,YAAY,QAAQ,+BAA4B;AACzD,SAASC,aAAa,QAAQ,gCAA6B;AAC3D,SAASC,kBAAkB,QAAQ,sCAAmC;AACtE,SAASC,aAAa,QAAQ,gCAA6B;AAE3D,OAAO,MAAMC,QAAQ,GAAG;EACtBC,IAAI,EAAEL,YAAY;EAClBM,MAAM,EAAER,cAAc;EACtBS,KAAK,EAAEN,aAAa;EACpBO,SAAS,EAAET,iBAAiB;EAC5BG,kBAAkB,EAAEA,kBAAkB;EACtCO,KAAK,EAAEN,aAAa;EACpBO,GAAG,EAAEb;AACP,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["Calendar","WeekCalendar","CalendarTimeline"],"sourceRoot":"../../../../src","sources":["components/calendar/index.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,qBAAY;AAYrC,SAASC,YAAY,QAAQ,0BAAiB;AAG9C,SAASC,gBAAgB,QAAQ,qBAAY","ignoreList":[]}
@@ -5,8 +5,8 @@ export const CalendarContext = /*#__PURE__*/React.createContext(undefined);
5
5
  export const useCalendarContext = () => {
6
6
  const context = React.useContext(CalendarContext);
7
7
  if (!context) {
8
- throw new Error("Calendar components must be used within CalendarRoot");
8
+ throw new Error("Calendar components must be used within a Calendar or WeekCalendar Root");
9
9
  }
10
10
  return context;
11
11
  };
12
- //# sourceMappingURL=context.js.map
12
+ //# sourceMappingURL=calendar-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","CalendarContext","createContext","undefined","useCalendarContext","context","useContext","Error"],"sourceRoot":"../../../../../src","sources":["components/calendar/shared/calendar-context.ts"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AAsBzB,OAAO,MAAMC,eAAe,gBAAGD,KAAK,CAACE,aAAa,CAEhDC,SAAS,CAAC;AAEZ,OAAO,MAAMC,kBAAkB,GAAGA,CAAA,KAAM;EACtC,MAAMC,OAAO,GAAGL,KAAK,CAACM,UAAU,CAACL,eAAe,CAAC;EACjD,IAAI,CAACI,OAAO,EAAE;IACZ,MAAM,IAAIE,KAAK,CACb,yEACF,CAAC;EACH;EACA,OAAOF,OAAO;AAChB,CAAC","ignoreList":[]}
@@ -1,44 +1,45 @@
1
1
  "use strict";
2
2
 
3
- import { formatDate, isDateAfter, isDateBefore, isDateSameDay, isDateToday, isSameMonth } from "../../../utils/date-utils.js";
4
3
  import React, { useMemo, useState } from "react";
5
- import { Pressable, Text } from "react-native";
6
- import { useCalendarContext } from "../context.js";
7
- import { jsx as _jsx } from "react/jsx-runtime";
8
- const calculateState = (date, selected, isCurrentMonth, isDisabled, isHovered) => {
4
+ import { Pressable, Text, View } from "react-native";
5
+ import { formatDate, isDateAfter, isDateBefore, isDateSameDay, isDateToday } from "../../../utils/date-utils.js";
6
+ import { useCalendarContext } from "./calendar-context.js";
7
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
8
+ const calculateState = (date, selected, isDisabled, isHovered) => {
9
9
  if (isDisabled) return "disabled";
10
10
  if (selected && isDateSameDay(date, selected)) return "selected";
11
11
  if (isDateToday(date)) return "today";
12
12
  if (isHovered) return "hovered";
13
- if (!isCurrentMonth) return "deprioritized";
14
13
  return "default";
15
14
  };
16
15
  export function CalendarDay(props) {
17
16
  const calendar = useCalendarContext();
18
17
  const [isHovered, setIsHovered] = useState(false);
19
- const isCurrentMonth = isSameMonth(props.date, calendar.currentMonth);
20
18
  const isDisabled = useMemo(() => {
21
19
  if (calendar.minDate && isDateBefore(props.date, calendar.minDate)) return true;
22
20
  if (calendar.maxDate && isDateAfter(props.date, calendar.maxDate)) return true;
23
21
  return false;
24
22
  }, [props.date, calendar.minDate, calendar.maxDate]);
25
- const state = calculateState(props.date, calendar.value, isCurrentMonth, isDisabled, isHovered);
23
+ const isMarked = calendar.markedDates?.some(d => isDateSameDay(d, props.date)) ?? false;
24
+ const state = calculateState(props.date, calendar.value, isDisabled, isHovered);
26
25
  const handlePress = () => {
27
26
  if (isDisabled || !calendar.onChange) return;
28
27
  calendar.onChange(props.date);
29
28
  };
30
29
  const composedStyle = [calendar.styles?.dayButton?.default, calendar.styles?.dayButton?.[state], props.style];
31
30
  const composedTextStyle = [calendar.styles?.dayText?.default, calendar.styles?.dayText?.[state], props.textStyle];
32
- return /*#__PURE__*/_jsx(Pressable, {
31
+ return /*#__PURE__*/_jsxs(Pressable, {
33
32
  onPress: handlePress,
34
33
  onHoverIn: () => setIsHovered(true),
35
34
  onHoverOut: () => setIsHovered(false),
36
35
  disabled: isDisabled,
37
36
  style: composedStyle,
38
- children: /*#__PURE__*/_jsx(Text, {
37
+ children: [/*#__PURE__*/_jsx(Text, {
39
38
  style: composedTextStyle,
40
39
  children: formatDate(props.date, "d")
41
- })
40
+ }), isMarked && /*#__PURE__*/_jsx(View, {
41
+ style: calendar.styles?.dayMarker
42
+ })]
42
43
  });
43
44
  }
44
45
  //# sourceMappingURL=calendar-day.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","useMemo","useState","Pressable","Text","View","formatDate","isDateAfter","isDateBefore","isDateSameDay","isDateToday","useCalendarContext","jsx","_jsx","jsxs","_jsxs","calculateState","date","selected","isDisabled","isHovered","CalendarDay","props","calendar","setIsHovered","minDate","maxDate","isMarked","markedDates","some","d","state","value","handlePress","onChange","composedStyle","styles","dayButton","default","style","composedTextStyle","dayText","textStyle","onPress","onHoverIn","onHoverOut","disabled","children","dayMarker"],"sourceRoot":"../../../../../src","sources":["components/calendar/shared/calendar-day.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAChD,SACEC,SAAS,EACTC,IAAI,EACJC,IAAI,QAIC,cAAc;AACrB,SACEC,UAAU,EACVC,WAAW,EACXC,YAAY,EACZC,aAAa,EACbC,WAAW,QACN,8BAA2B;AAClC,SAASC,kBAAkB,QAAQ,uBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAWxD,MAAMC,cAAc,GAAGA,CACrBC,IAAU,EACVC,QAAiC,EACjCC,UAAmB,EACnBC,SAAkB,KACG;EACrB,IAAID,UAAU,EAAE,OAAO,UAAU;EACjC,IAAID,QAAQ,IAAIT,aAAa,CAACQ,IAAI,EAAEC,QAAQ,CAAC,EAAE,OAAO,UAAU;EAChE,IAAIR,WAAW,CAACO,IAAI,CAAC,EAAE,OAAO,OAAO;EACrC,IAAIG,SAAS,EAAE,OAAO,SAAS;EAC/B,OAAO,SAAS;AAClB,CAAC;AAED,OAAO,SA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EK,OAAO,EAAEH,OAAO,EACjCf,QAAQ,CAACa,MAAM,EAAEK,OAAO,GAAGV,KAAK,CAAC,EACjCT,KAAK,CAACoB,SAAS,CAChB;EAED,oBACE3B,KAAA,CAACZ,SAAS;IACRwC,OAAO,EAAEV,WAAY;IACrBW,SAAS,EAAEA,CAAA,KAAMpB,YAAY,CAAC,IAAI,CAAE;IACpCqB,UAAU,EAAEA,CAAA,KAAMrB,YAAY,CAAC,KAAK,CAAE;IACtCsB,QAAQ,EAAE3B,UAAW;IACrBoB,KAAK,EAAEJ,aAAc;IAAAY,QAAA,gBAErBlC,IAAA,CAACT,IAAI;MAACmC,KAAK,EAAEC,iBAAkB;MAAAO,QAAA,EAAEzC,UAAU,CAACgB,KAAK,CAACL,IAAI,EAAE,GAAG;IAAC,CAAO,CAAC,EACnEU,QAAQ,iBAAId,IAAA,CAACR,IAAI;MAACkC,KAAK,EAAEhB,QAAQ,CAACa,MAAM,EAAEY;IAAU,CAAE,CAAC;EAAA,CAC/C,CAAC;AAEhB","ignoreList":[]}
@@ -2,7 +2,7 @@
2
2
 
3
3
  import React from "react";
4
4
  import { View } from "react-native";
5
- import { useCalendarContext } from "../context.js";
5
+ import { useCalendarContext } from "./calendar-context.js";
6
6
  import { jsx as _jsx } from "react/jsx-runtime";
7
7
  export function CalendarHeader(props) {
8
8
  const {
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","View","useCalendarContext","jsx","_jsx","CalendarHeader","props","children","style","viewProps","styles","headerStyle","header"],"sourceRoot":"../../../../../src","sources":["components/calendar/shared/calendar-header.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SACEC,IAAI,QAIC,cAAc;AACrB,SAASC,kBAAkB,QAAQ,uBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAOxD,OAAO,SAASC,cAAcA,CAACC,KAA0B,EAAE;EACzD,MAAM;IAAEC,QAAQ;IAAEC,KAAK;IAAE,GAAGC;EAAU,CAAC,GAAGH,KAAK;EAC/C,MAAM;IAAEI;EAAO,CAAC,GAAGR,kBAAkB,CAAC,CAAC;EAEvC,MAAMS,WAAW,GAAG,CAACD,MAAM,EAAEE,MAAM,EAAEJ,KAAK,CAAC;EAE3C,oBACEJ,IAAA,CAACH,IAAI;IAAA,GAAKQ,SAAS;IAAED,KAAK,EAAEG,WAAY;IAAAJ,QAAA,EACrCA;EAAQ,CACL,CAAC;AAEX","ignoreList":[]}
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+
3
+ import React, { useState } from "react";
4
+ import { Pressable, StyleSheet, Text, View } from "react-native";
5
+ import { useComponentsConfig } from "../../../themes/index.js";
6
+ import { useCalendarContext } from "./calendar-context.js";
7
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
8
+ const calculateState = (isDisabled, isHovered) => {
9
+ if (isDisabled) return "disabled";
10
+ if (isHovered) return "hovered";
11
+ return "default";
12
+ };
13
+ export function CalendarNavButtons(props) {
14
+ const {
15
+ style
16
+ } = props;
17
+ const {
18
+ goToPrev,
19
+ goToNext,
20
+ isPrevDisabled,
21
+ isNextDisabled,
22
+ styles
23
+ } = useCalendarContext();
24
+ const config = useComponentsConfig();
25
+ const PrevIcon = config?.calendar?.prevIcon;
26
+ const NextIcon = config?.calendar?.nextIcon;
27
+ const [prevHovered, setPrevHovered] = useState(false);
28
+ const [nextHovered, setNextHovered] = useState(false);
29
+ const prevState = calculateState(isPrevDisabled, prevHovered);
30
+ const nextState = calculateState(isNextDisabled, nextHovered);
31
+ const prevIconProps = StyleSheet.flatten([styles?.navButtonIcon?.default, styles?.navButtonIcon?.[prevState]]);
32
+ const nextIconProps = StyleSheet.flatten([styles?.navButtonIcon?.default, styles?.navButtonIcon?.[nextState]]);
33
+ const composedStyle = [styles?.navButtons, style];
34
+ return /*#__PURE__*/_jsxs(View, {
35
+ style: composedStyle,
36
+ children: [/*#__PURE__*/_jsx(Pressable, {
37
+ onPress: goToPrev,
38
+ onHoverIn: () => setPrevHovered(true),
39
+ onHoverOut: () => setPrevHovered(false),
40
+ disabled: isPrevDisabled,
41
+ style: [styles?.navButton?.default, styles?.navButton?.[prevState]],
42
+ children: PrevIcon ? /*#__PURE__*/_jsx(PrevIcon, {
43
+ ...prevIconProps
44
+ }) : /*#__PURE__*/_jsx(Text, {
45
+ style: prevIconProps?.style,
46
+ children: "\u2039"
47
+ })
48
+ }), /*#__PURE__*/_jsx(Pressable, {
49
+ onPress: goToNext,
50
+ onHoverIn: () => setNextHovered(true),
51
+ onHoverOut: () => setNextHovered(false),
52
+ disabled: isNextDisabled,
53
+ style: [styles?.navButton?.default, styles?.navButton?.[nextState]],
54
+ children: NextIcon ? /*#__PURE__*/_jsx(NextIcon, {
55
+ ...nextIconProps
56
+ }) : /*#__PURE__*/_jsx(Text, {
57
+ style: nextIconProps?.style,
58
+ children: "\u203A"
59
+ })
60
+ })]
61
+ });
62
+ }
63
+ //# sourceMappingURL=calendar-nav-buttons.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","useState","Pressable","StyleSheet","Text","View","useComponentsConfig","useCalendarContext","jsx","_jsx","jsxs","_jsxs","calculateState","isDisabled","isHovered","CalendarNavButtons","props","style","goToPrev","goToNext","isPrevDisabled","isNextDisabled","styles","config","PrevIcon","calendar","prevIcon","NextIcon","nextIcon","prevHovered","setPrevHovered","nextHovered","setNextHovered","prevState","nextState","prevIconProps","flatten","navButtonIcon","default","nextIconProps","composedStyle","navButtons","children","onPress","onHoverIn","onHoverOut","disabled","navButton"],"sourceRoot":"../../../../../src","sources":["components/calendar/shared/calendar-nav-buttons.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SACEC,SAAS,EACTC,UAAU,EACVC,IAAI,EACJC,IAAI,QAGC,cAAc;AACrB,SAASC,mBAAmB,QAAQ,0BAAiB;AACrD,SAASC,kBAAkB,QAAQ,uBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,K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  import { Text } from "react-native";
6
- import { useCalendarContext } from "../context.js";
5
+ import { formatDate } from "../../../utils/date-utils.js";
6
+ import { useCalendarContext } from "./calendar-context.js";
7
7
  import { jsx as _jsx } from "react/jsx-runtime";
8
8
  export function CalendarTitle(props) {
9
9
  const {
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","Text","formatDate","useCalendarContext","jsx","_jsx","CalendarTitle","props","children","style","formatStr","textProps","currentMonth","styles","titleStyle","headerTitle"],"sourceRoot":"../../../../../src","sources":["components/calendar/shared/calendar-title.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SACEC,IAAI,QAIC,cAAc;AACrB,SAASC,UAAU,QAAQ,8BAA2B;AACtD,SAASC,kBAAkB,QAAQ,uBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAQxD,OAAO,SAASC,aAAaA,CAACC,KAAyB,EAAE;EACvD,MAAM;IAAEC,QAAQ;IAAEC,KAAK;IAAEC,SAAS,GAAG,WAAW;IAAE,GAAGC;EAAU,CAAC,GAAGJ,KAAK;EACxE,MAAM;IAAEK,YAAY;IAAEC;EAAO,CAAC,GAAGV,kBAAkB,CAAC,CAAC;EAErD,MAAMW,UAAU,GAAG,CAACD,MAAM,EAAEE,WAAW,EAAEN,KAAK,CAAC;EAE/C,oBACEJ,IAAA,CAACJ,IAAI;IAAA,GAAKU,SAAS;IAAEF,KAAK,EAAEK,UAAW;IAAAN,QAAA,EACpCA,QAAQ,IAAIN,UAAU,CAACU,YAAY,EAAEF,SAAS;EAAC,CAC5C,CAAC;AAEX","ignoreList":[]}
@@ -2,7 +2,7 @@
2
2
 
3
3
  import React from "react";
4
4
  import { Text, View } from "react-native";
5
- import { useCalendarContext } from "../context.js";
5
+ import { useCalendarContext } from "./calendar-context.js";
6
6
  import { jsx as _jsx } from "react/jsx-runtime";
7
7
  function CalendarWeekLabel(props) {
8
8
  const {
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","Text","View","useCalendarContext","jsx","_jsx","CalendarWeekLabel","props","styles","composedStyle","weekLabel","style","numberOfLines","children","DEFAULT_WEEK_DAYS","CalendarWeekLabels","weekDays","weekLabels","map","day","index"],"sourceRoot":"../../../../../src","sources":["components/calendar/shared/calendar-week-labels.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SACEC,IAAI,EACJC,IAAI,QAIC,cAAc;AACrB,SAASC,kBAAkB,QAAQ,uBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAOxD,SAASC,iBAAiBA,CAACC,KAA6B,EAAE;EACxD,MAAM;IAAEC;EAAO,CAAC,GAAGL,kBAAkB,CAAC,CAAC;EAEvC,MAAMM,aAAa,GAAG,CAACD,MAAM,EAAEE,SAAS,EAAEH,KAAK,CAACI,KAAK,CAAC;EAEtD,oBACEN,IAAA,CAACJ,IAAI;IAACW,aAAa,EAAE,CAAE;IAACD,KAAK,EAAEF,aAAc;IAAAI,QAAA,EAC1CN,KAAK,CAACM;EAAQ,CACX,CAAC;AAEX;AAQA,MAAMC,iBAAiB,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;AAEpE,OAAO,SAASC,kBAAkBA,CAACR,KAA8B,EAAE;EACjE,MAAM;IAAES,QAAQ,GAAGF,iBAAiB;IAAEH;EAAM,CAAC,GAAGJ,KAAK;EACrD,MAAM;IAAEC;EAAO,CAAC,GAAGL,kBAAkB,CAAC,CAAC;EAEvC,MAAMM,aAAa,GAAG,CAACD,MAAM,EAAES,UAAU,EAAEN,KAAK,CAAC;EAEjD,oBACEN,IAAA,CAACH,IAAI;IAACS,KAAK,EAAEF,aAAc;IAAAI,QAAA,EACxBG,QAAQ,CAACE,GAAG,CAAC,CAACC,GAAG,EAAEC,KAAK,kBACvBf,IAAA,CAACC,iBAAiB;MAAaK,KAAK,EAAEH,MAAM,EAAEE,SAAU;MAAAG,QAAA,EACrDM;IAAG,GADkBC,KAEL,CACpB;EAAC,CACE,CAAC;AAEX","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ export {};
4
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["components/calendar/shared/types.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,138 @@
1
+ "use strict";
2
+
3
+ import React, { useMemo } from "react";
4
+ import { ScrollView, Text, View } from "react-native";
5
+ import { isDateSameDay } from "../../../utils/date-utils.js";
6
+ import { TimelineVariants } from "./variants/index.js";
7
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
8
+ const HOUR_HEIGHT = 60;
9
+ function formatHour(hour) {
10
+ if (hour === 0) return "12 AM";
11
+ if (hour < 12) return `${hour} AM`;
12
+ if (hour === 12) return "12 PM";
13
+ return `${hour - 12} PM`;
14
+ }
15
+ function getMinutesFromStartOfDay(date) {
16
+ return date.getHours() * 60 + date.getMinutes();
17
+ }
18
+ function groupOverlappingEvents(events, getStart, getEnd) {
19
+ const sorted = [...events].sort((a, b) => getStart(a).getTime() - getStart(b).getTime());
20
+ const groups = [];
21
+ for (const event of sorted) {
22
+ let placed = false;
23
+ const eStart = getStart(event);
24
+ const eEnd = getEnd(event);
25
+ for (const group of groups) {
26
+ const overlaps = group.some(g => {
27
+ const gStart = getStart(g);
28
+ const gEnd = getEnd(g);
29
+ return eStart >= gStart && eStart < gEnd || eEnd > gStart && eEnd <= gEnd || eStart <= gStart && eEnd >= gEnd;
30
+ });
31
+ if (overlaps) {
32
+ group.push(event);
33
+ placed = true;
34
+ break;
35
+ }
36
+ }
37
+ if (!placed) {
38
+ groups.push([event]);
39
+ }
40
+ }
41
+ return groups;
42
+ }
43
+ export function CalendarTimeline(props) {
44
+ const {
45
+ date,
46
+ startHour = 0,
47
+ endHour = 24,
48
+ getStart,
49
+ getEnd,
50
+ keyExtractor,
51
+ renderEvent,
52
+ style
53
+ } = props;
54
+ const variantStyles = TimelineVariants[props.variant || "default"]();
55
+ const hours = useMemo(() => {
56
+ const arr = [];
57
+ for (let i = startHour; i < endHour; i++) {
58
+ arr.push(i);
59
+ }
60
+ return arr;
61
+ }, [startHour, endHour]);
62
+ const allEvents = props.events ?? [];
63
+ const dayEvents = useMemo(() => {
64
+ return allEvents.filter(event => isDateSameDay(getStart(event), date));
65
+ }, [allEvents, date, getStart]);
66
+ const eventGroups = useMemo(() => groupOverlappingEvents(dayEvents, getStart, getEnd), [dayEvents, getStart, getEnd]);
67
+ const now = new Date();
68
+ const isToday = isDateSameDay(now, date);
69
+ const currentTimePosition = isToday ? (getMinutesFromStartOfDay(now) - startHour * 60) / 60 * HOUR_HEIGHT : null;
70
+ return /*#__PURE__*/_jsx(ScrollView, {
71
+ style: [variantStyles.container, style],
72
+ showsVerticalScrollIndicator: true,
73
+ children: /*#__PURE__*/_jsxs(View, {
74
+ style: variantStyles.timeline,
75
+ children: [/*#__PURE__*/_jsx(View, {
76
+ style: variantStyles.timeColumn,
77
+ children: hours.map(hour => /*#__PURE__*/_jsx(View, {
78
+ style: variantStyles.timeSlot,
79
+ children: /*#__PURE__*/_jsx(Text, {
80
+ style: variantStyles.timeText,
81
+ children: formatHour(hour)
82
+ })
83
+ }, hour))
84
+ }), /*#__PURE__*/_jsxs(View, {
85
+ style: variantStyles.eventsColumn,
86
+ children: [hours.map(hour => /*#__PURE__*/_jsx(View, {
87
+ style: variantStyles.hourLine
88
+ }, hour)), currentTimePosition != null && currentTimePosition >= 0 && /*#__PURE__*/_jsxs(View, {
89
+ style: {
90
+ position: "absolute",
91
+ left: 0,
92
+ right: 0,
93
+ top: currentTimePosition,
94
+ flexDirection: "row",
95
+ alignItems: "center",
96
+ zIndex: 1000
97
+ },
98
+ children: [/*#__PURE__*/_jsx(View, {
99
+ style: variantStyles.currentTimeDot
100
+ }), /*#__PURE__*/_jsx(View, {
101
+ style: variantStyles.currentTimeLineBar
102
+ })]
103
+ }), eventGroups.map(group => group.map(event => {
104
+ const startMinutes = getMinutesFromStartOfDay(getStart(event));
105
+ let endMinutes = getMinutesFromStartOfDay(getEnd(event));
106
+ // Handle midnight (0:00) or end times on the next day
107
+ if (endMinutes <= startMinutes) {
108
+ endMinutes = endHour * 60;
109
+ }
110
+ const duration = endMinutes - startMinutes;
111
+ const top = (startMinutes - startHour * 60) / 60 * HOUR_HEIGHT + 1;
112
+ const height = duration / 60 * HOUR_HEIGHT - 3;
113
+ const indexInGroup = group.indexOf(event);
114
+ const totalInGroup = group.length;
115
+ const eventWidth = `${100 / totalInGroup - 1}%`;
116
+ const left = `${100 / totalInGroup * indexInGroup}%`;
117
+ const layout = {
118
+ top,
119
+ height: Math.max(height, 20),
120
+ left,
121
+ width: eventWidth
122
+ };
123
+ return /*#__PURE__*/_jsx(View, {
124
+ style: {
125
+ position: "absolute",
126
+ top: layout.top,
127
+ height: layout.height,
128
+ left: layout.left,
129
+ width: layout.width
130
+ },
131
+ children: renderEvent(event, layout)
132
+ }, keyExtractor(event));
133
+ }))]
134
+ })]
135
+ })
136
+ });
137
+ }
138
+ //# sourceMappingURL=calendar-timeline.js.map