@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 @@
1
+ {"version":3,"names":["React","useMemo","ScrollView","Text","View","isDateSameDay","TimelineVariants","jsx","_jsx","jsxs","_jsxs","HOUR_HEIGHT","formatHour","hour","getMinutesFromStartOfDay","date","getHours","getMinutes","groupOverlappingEvents","events","getStart","getEnd","sorted","sort","a","b","getTime","groups","event","placed","eStart","eEnd","group","overlaps","some","g","gStart","gEnd","push","CalendarTimeline","props","startHour","endHour","keyExtractor","renderEvent","style","variantStyles","variant","hours","arr","i","allEvents","dayEvents","filter","eventGroups","now","Date","isToday","currentTimePosition","container","showsVerticalScrollIndicator","children","timeline","timeColumn","map","timeSlot","timeText","eventsColumn","hourLine","position","left","right","top","flexDirection","alignItems","zIndex","currentTimeDot","currentTimeLineBar","startMinutes","endMinutes","duration","height","indexInGroup","indexOf","totalInGroup","length","eventWidth","layout","Math","max","width"],"sourceRoot":"../../../../../src","sources":["components/calendar/timeline/calendar-timeline.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,OAAO,QAAQ,OAAO;AACtC,SAASC,UAAU,EAAEC,IAAI,EAAEC,IAAI,QAAwC,cAAc;AACrF,SAASC,aAAa,QAAQ,8BAA2B;AACzD,SAASC,gBAAgB,QAAQ,qBAAY;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAE9C,MAAMC,WAAW,GAAG,EAAE;AAEtB,SAASC,UAAUA,CAACC,IAAY,EAAU;EACxC,IAAIA,IAAI,KAAK,CAAC,EAAE,OAAO,OAAO;EAC9B,IAAIA,IAAI,GAAG,EAAE,EAAE,OAAO,GAAGA,IAAI,KAAK;EAClC,IAAIA,IAAI,KAAK,EAAE,EAAE,OAAO,OAAO;EAC/B,OAAO,GAAGA,IAAI,GAAG,EAAE,KAAK;AAC1B;AAEA,SAASC,wBAAwBA,CAACC,IAAU,EAAU;EACpD,OAAOA,IAAI,CAACC,QAAQ,CAAC,CAAC,GAAG,EAAE,GAAGD,IAAI,CAACE,UAAU,CAAC,CAAC;AACjD;AAsBA,SAASC,sBAAsBA,CAC7BC,MAAW,EACXC,QAAwB,EACxBC,MAAsB,EACf;EACP,MAAMC,MAAM,GAAG,CAAC,GAAGH,MAAM,CAAC,CAACI,IAAI,CAC7B,CAACC,CAAC,EAAEC,CAAC,KAAKL,QAAQ,CAACI,CAAC,CAAC,CAACE,OAAO,CAAC,CAAC,GAAGN,QAAQ,CAACK,CAAC,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+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["CalendarTimeline"],"sourceRoot":"../../../../../src","sources":["components/calendar/timeline/index.ts"],"mappings":";;AAAA,SAASA,gBAAgB,QAAQ,wBAAqB","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/timeline/types.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+
3
+ import { useThemedStyles } from "../../../../utils/use-themed-styles.js";
4
+ const HOUR_HEIGHT = 60;
5
+ const TIME_COLUMN_WIDTH = 60;
6
+ export const useTimelineVariantDefault = () => {
7
+ return useThemedStyles(({
8
+ colors,
9
+ radius,
10
+ fontFamily,
11
+ fontSize
12
+ }) => ({
13
+ container: {
14
+ backgroundColor: colors.background,
15
+ borderRadius: radius,
16
+ borderWidth: 1,
17
+ borderColor: colors.border
18
+ },
19
+ timeline: {
20
+ flexDirection: "row",
21
+ minHeight: HOUR_HEIGHT * 24
22
+ },
23
+ timeColumn: {
24
+ width: TIME_COLUMN_WIDTH,
25
+ borderRightWidth: 1,
26
+ borderRightColor: colors.border
27
+ },
28
+ timeSlot: {
29
+ height: HOUR_HEIGHT,
30
+ paddingHorizontal: 8,
31
+ alignItems: "flex-end"
32
+ },
33
+ timeText: {
34
+ fontSize: fontSize * 0.75,
35
+ fontWeight: "500",
36
+ fontFamily,
37
+ color: colors.mutedForeground
38
+ },
39
+ eventsColumn: {
40
+ flex: 1,
41
+ position: "relative"
42
+ },
43
+ hourLine: {
44
+ height: HOUR_HEIGHT,
45
+ borderBottomWidth: 1,
46
+ borderBottomColor: colors.border
47
+ },
48
+ currentTimeDot: {
49
+ width: 10,
50
+ height: 10,
51
+ borderRadius: 5,
52
+ marginLeft: -5,
53
+ backgroundColor: colors.danger
54
+ },
55
+ currentTimeLineBar: {
56
+ flex: 1,
57
+ height: 2,
58
+ backgroundColor: colors.danger
59
+ }
60
+ }));
61
+ };
62
+ //# sourceMappingURL=default.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useThemedStyles","HOUR_HEIGHT","TIME_COLUMN_WIDTH","useTimelineVariantDefault","colors","radius","fontFamily","fontSize","container","backgroundColor","background","borderRadius","borderWidth","borderColor","border","timeline","flexDirection","minHeight","timeColumn","width","borderRightWidth","borderRightColor","timeSlot","height","paddingHorizontal","alignItems","timeText","fontWeight","color","mutedForeground","eventsColumn","flex","position","hourLine","borderBottomWidth","borderBottomColor","currentTimeDot","marginLeft","danger","currentTimeLineBar"],"sourceRoot":"../../../../../../src","sources":["components/calendar/timeline/variants/default.tsx"],"mappings":";;AAAA,SAASA,eAAe,QAAQ,wCAAqC;AAGrE,MAAMC,WAAW,GAAG,EAAE;AACtB,MAAMC,iBAAiB,GAAG,EAAE;AAE5B,OAAO,MAAMC,yBAAyB,GAAGA,CAAA,KAAsB;EAC7D,OAAOH,eAAe,CACpB,CAAC;IAAEI,MAAM;IAAEC,MAAM;IAAEC,UAAU;IAAEC;EAAS,CAAC,MAAsB;IAC7DC,SAAS,EAAE;MACTC,eAAe,EAAEL,MAAM,CAACM,UAAU;MAClCC,YAAY,EAAEN,MAAM;MACpBO,WAAW,EAAE,CAAC;MACdC,WAAW,EAAET,MAAM,CAACU;IACtB,CAAC;IACDC,QAAQ,EAAE;MACRC,aAAa,EAAE,KAAK;MACpBC,SAAS,EAAEhB,WAAW,GAAG;IAC3B,CAAC;IACDiB,UAAU,EAAE;MACVC,KAAK,EAAEjB,iBAAiB;MACxBkB,gBAAgB,EAAE,CAAC;MACnBC,gBAAgB,EAAEjB,MAAM,CAACU;IAC3B,CAAC;IACDQ,QAAQ,EAAE;MACRC,MAAM,EAAEtB,WAAW;MACnBuB,iBAAiB,EAAE,CAAC;MACpBC,UAAU,EAAE;IACd,CAAC;IACDC,QAAQ,EAAE;MACRnB,QAAQ,EAAEA,QAAQ,GAAG,IAAI;MACzBoB,UAAU,EAAE,KAAK;MACjBrB,UAAU;MACVsB,KAAK,EAAExB,MAAM,CAACyB;IAChB,CAAC;IACDC,YAAY,EAAE;MACZC,IAAI,EAAE,CAAC;MACPC,QAAQ,EAAE;IACZ,CAAC;IACDC,QAAQ,EAAE;MACRV,MAAM,EAAEtB,WAAW;MACnBiC,iBAAiB,EAAE,CAAC;MACpBC,iBAAiB,EAAE/B,MAAM,CAACU;IAC5B,CAAC;IACDsB,cAAc,EAAE;MACdjB,KAAK,EAAE,EAAE;MACTI,MAAM,EAAE,EAAE;MACVZ,YAAY,EAAE,CAAC;MACf0B,UAAU,EAAE,CAAC,CAAC;MACd5B,eAAe,EAAEL,MAAM,CAACkC;IAC1B,CAAC;IACDC,kBAAkB,EAAE;MAClBR,IAAI,EAAE,CAAC;MACPR,MAAM,EAAE,CAAC;MACTd,eAAe,EAAEL,MAAM,CAACkC;IAC1B;EACF,CAAC,CACH,CAAC;AACH,CAAC","ignoreList":[]}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+
3
+ import { useTimelineVariantDefault } from "./default.js";
4
+ export const TimelineVariants = {
5
+ default: useTimelineVariantDefault
6
+ };
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useTimelineVariantDefault","TimelineVariants","default"],"sourceRoot":"../../../../../../src","sources":["components/calendar/timeline/variants/index.ts"],"mappings":";;AAAA,SAASA,yBAAyB,QAAQ,cAAW;AAErD,OAAO,MAAMC,gBAAgB,GAAG;EAC9BC,OAAO,EAAEF;AACX,CAAC","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ export { WeekCalendar } from "./week-calendar.js";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["WeekCalendar"],"sourceRoot":"../../../../../src","sources":["components/calendar/week-calendar/index.ts"],"mappings":";;AACA,SAASA,YAAY,QAAQ,oBAAiB","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/week-calendar/types.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,145 @@
1
+ "use strict";
2
+
3
+ import { hslaSetRelativeLightness } from "../../../../utils/hsla-utils.js";
4
+ import { useThemedStyles } from "../../../../utils/use-themed-styles.js";
5
+ export const useWeekCalendarVariantDefault = () => {
6
+ return useThemedStyles(({
7
+ colors,
8
+ radius,
9
+ fontFamily,
10
+ fontSize
11
+ }) => ({
12
+ root: {
13
+ padding: 16,
14
+ backgroundColor: colors.background,
15
+ borderRadius: radius,
16
+ borderWidth: 1,
17
+ borderColor: colors.border
18
+ },
19
+ header: {
20
+ flexDirection: "row",
21
+ justifyContent: "space-between",
22
+ alignItems: "center",
23
+ marginBottom: 16,
24
+ paddingHorizontal: 8
25
+ },
26
+ headerTitle: {
27
+ fontSize: fontSize * 1.125,
28
+ fontWeight: "600",
29
+ fontFamily,
30
+ color: colors.foreground
31
+ },
32
+ navButtons: {
33
+ flexDirection: "row",
34
+ gap: 4
35
+ },
36
+ navButton: {
37
+ default: {
38
+ width: 32,
39
+ height: 32,
40
+ borderRadius: radius,
41
+ alignItems: "center",
42
+ justifyContent: "center",
43
+ backgroundColor: "transparent"
44
+ },
45
+ disabled: {
46
+ opacity: 0.5
47
+ },
48
+ hovered: {
49
+ backgroundColor: hslaSetRelativeLightness(colors.secondary, -1)
50
+ }
51
+ },
52
+ navButtonIcon: {
53
+ default: {
54
+ color: colors.foreground,
55
+ size: fontSize * 1.25,
56
+ style: {
57
+ color: colors.foreground,
58
+ fontSize: fontSize * 1.25,
59
+ lineHeight: fontSize * 1.25,
60
+ textAlign: "center",
61
+ fontWeight: "500",
62
+ pointerEvents: "none"
63
+ }
64
+ },
65
+ disabled: {
66
+ color: colors.mutedForeground
67
+ }
68
+ },
69
+ weekLabels: {
70
+ flexDirection: "row",
71
+ justifyContent: "space-between",
72
+ marginBottom: 8,
73
+ paddingVertical: 8,
74
+ gap: 2
75
+ },
76
+ weekLabel: {
77
+ fontSize: fontSize * 0.875,
78
+ fontWeight: "500",
79
+ fontFamily,
80
+ color: colors.mutedForeground,
81
+ width: 40,
82
+ textAlign: "center"
83
+ },
84
+ swipeContainer: {
85
+ overflow: "hidden"
86
+ },
87
+ weekStrip: {
88
+ flexDirection: "row",
89
+ justifyContent: "space-between",
90
+ gap: 2
91
+ },
92
+ dayButton: {
93
+ default: {
94
+ width: 40,
95
+ height: 40,
96
+ borderRadius: radius * 0.5,
97
+ alignItems: "center",
98
+ justifyContent: "center",
99
+ backgroundColor: "transparent"
100
+ },
101
+ selected: {
102
+ backgroundColor: colors.primary
103
+ },
104
+ today: {
105
+ borderWidth: 1,
106
+ borderColor: colors.primary
107
+ },
108
+ disabled: {
109
+ opacity: 0.3
110
+ },
111
+ hovered: {
112
+ backgroundColor: colors.muted
113
+ }
114
+ },
115
+ dayText: {
116
+ default: {
117
+ fontSize,
118
+ fontFamily,
119
+ color: colors.foreground,
120
+ fontWeight: "400",
121
+ pointerEvents: "none"
122
+ },
123
+ selected: {
124
+ color: colors.primaryForeground,
125
+ fontWeight: "600"
126
+ },
127
+ today: {
128
+ color: colors.primary,
129
+ fontWeight: "600"
130
+ },
131
+ disabled: {
132
+ color: colors.mutedForeground
133
+ }
134
+ },
135
+ dayMarker: {
136
+ width: 5,
137
+ height: 5,
138
+ borderRadius: 2.5,
139
+ backgroundColor: colors.primary,
140
+ marginTop: 2,
141
+ alignSelf: "center"
142
+ }
143
+ }));
144
+ };
145
+ //# sourceMappingURL=default.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["hslaSetRelativeLightness","useThemedStyles","useWeekCalendarVariantDefault","colors","radius","fontFamily","fontSize","root","padding","backgroundColor","background","borderRadius","borderWidth","borderColor","border","header","flexDirection","justifyContent","alignItems","marginBottom","paddingHorizontal","headerTitle","fontWeight","color","foreground","navButtons","gap","navButton","default","width","height","disabled","opacity","hovered","secondary","navButtonIcon","size","style","lineHeight","textAlign","pointerEvents","mutedForeground","weekLabels","paddingVertical","weekLabel","swipeContainer","overflow","weekStrip","dayButton","selected","primary","today","muted","dayText","primaryForeground","dayMarker","marginTop","alignSelf"],"sourceRoot":"../../../../../../src","sources":["components/calendar/week-calendar/variants/default.tsx"],"mappings":";;AAAA,SAASA,wBAAwB,QAAQ,iCAA8B;AACvE,SAASC,eAAe,QAAQ,wCAAqC;AAGrE,OAAO,MAAMC,6BAA6B,GAAGA,CAAA,KAA0B;EACrE,OAAOD,eAAe,CACpB,CAAC;IAAEE,MAAM;IAAEC,MAAM;IAAEC,UAAU;IAAEC;EAAS,CAAC,MAA0B;IACjEC,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;IACtB,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;MACXf,QAAQ,EAAEA,QAAQ,GAAG,KAAK;MAC1BgB,UAAU,EAAE,KAAK;MACjBjB,UAAU;MACVkB,KAAK,EAAEpB,MAAM,CAACqB;IAChB,CAAC;IACDC,UAAU,EAAE;MACVT,aAAa,EAAE,KAAK;MACpBU,GAAG,EAAE;IACP,CAAC;IACDC,SAAS,EAAE;MACTC,OAAO,EAAE;QACPC,KAAK,EAAE,EAAE;QACTC,MAAM,EAAE,EAAE;QACVnB,YAAY,EAAEP,MAAM;QACpBc,UAAU,EAAE,QAAQ;QACpBD,cAAc,EAAE,QAAQ;QACxBR,eAAe,EAAE;MACnB,CAAC;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;QACpBD,cAAc,EAAE,QAAQ;QACxBR,eAAe,EAAE;MACnB,CAAC;MACDwC,QAAQ,EAAE;QACRxC,eAAe,EAAEN,MAAM,CAAC+C;MAC1B,CAAC;MACDC,KAAK,EAAE;QACLvC,WAAW,EAAE,CAAC;QACdC,WAAW,EAAEV,MAAM,CAAC+C;MACtB,CAAC;MACDnB,QAAQ,EAAE;QACRC,OAAO,EAAE;MACX,CAAC;MACDC,OAAO,EAAE;QACPxB,eAAe,EAAEN,MAAM,CAACiD;MAC1B;IACF,CAAC;IACDC,OAAO,EAAE;MACPzB,OAAO,EAAE;QACPtB,QAAQ;QACRD,UAAU;QACVkB,KAAK,EAAEpB,MAAM,CAACqB,UAAU;QACxBF,UAAU,EAAE,KAAK;QACjBkB,aAAa,EAAE;MACjB,CAAC;MACDS,QAAQ,EAAE;QACR1B,KAAK,EAAEpB,MAAM,CAACmD,iBAAiB;QAC/BhC,UAAU,EAAE;MACd,CAAC;MACD6B,KAAK,EAAE;QACL5B,KAAK,EAAEpB,MAAM,CAAC+C,OAAO;QACrB5B,UAAU,EAAE;MACd,CAAC;MACDS,QAAQ,EAAE;QACRR,KAAK,EAAEpB,MAAM,CAACsC;MAChB;IACF,CAAC;IACDc,SAAS,EAAE;MACT1B,KAAK,EAAE,CAAC;MACRC,MAAM,EAAE,CAAC;MACTnB,YAAY,EAAE,GAAG;MACjBF,eAAe,EAAEN,MAAM,CAAC+C,OAAO;MAC/BM,SAAS,EAAE,CAAC;MACZC,SAAS,EAAE;IACb;EACF,CAAC,CACH,CAAC;AACH,CAAC","ignoreList":[]}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+
3
+ import { useWeekCalendarVariantDefault } from "./default.js";
4
+ export const WeekCalendarVariants = {
5
+ default: useWeekCalendarVariantDefault
6
+ };
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useWeekCalendarVariantDefault","WeekCalendarVariants","default"],"sourceRoot":"../../../../../../src","sources":["components/calendar/week-calendar/variants/index.ts"],"mappings":";;AAAA,SAASA,6BAA6B,QAAQ,cAAW;AAEzD,OAAO,MAAMC,oBAAoB,GAAG;EAClCC,OAAO,EAAEF;AACX,CAAC","ignoreList":[]}
@@ -0,0 +1,170 @@
1
+ "use strict";
2
+
3
+ import React, { useCallback, useMemo, useRef, useState } from "react";
4
+ import { Platform, Pressable, ScrollView, StyleSheet, Text, View } from "react-native";
5
+ import { useComponentsConfig } from "../../../themes/index.js";
6
+ import { addWeeks, endOfWeek, formatDate, getWeekDates, isDateAfter, isDateBefore, startOfWeek, subWeeks } from "../../../utils/date-utils.js";
7
+ import { CalendarContext } from "../shared/calendar-context.js";
8
+ import { CalendarDay } from "../shared/calendar-day.js";
9
+ import { WeekCalendarVariants } from "./variants/index.js";
10
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
+ const DEFAULT_WEEK_DAYS = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
12
+ const calculateNavState = (isDisabled, isHovered) => {
13
+ if (isDisabled) return "disabled";
14
+ if (isHovered) return "hovered";
15
+ return "default";
16
+ };
17
+ export function WeekCalendar(props) {
18
+ const {
19
+ value,
20
+ onChange,
21
+ defaultWeek = new Date(),
22
+ minDate,
23
+ maxDate,
24
+ markedDates,
25
+ weekDays = DEFAULT_WEEK_DAYS,
26
+ style
27
+ } = props;
28
+ const styles = WeekCalendarVariants[props.variant || "default"]();
29
+ const config = useComponentsConfig();
30
+ const PrevIcon = config?.calendar?.prevIcon;
31
+ const NextIcon = config?.calendar?.nextIcon;
32
+ const [currentWeekStart, setCurrentWeekStart] = useState(startOfWeek(defaultWeek));
33
+ const [containerWidth, setContainerWidth] = useState(0);
34
+ const scrollRef = useRef(null);
35
+ const [prevHovered, setPrevHovered] = useState(false);
36
+ const [nextHovered, setNextHovered] = useState(false);
37
+ const currentMonth = currentWeekStart;
38
+ const goToPrev = useCallback(() => {
39
+ setCurrentWeekStart(prev => subWeeks(prev, 1));
40
+ }, []);
41
+ const goToNext = useCallback(() => {
42
+ setCurrentWeekStart(prev => addWeeks(prev, 1));
43
+ }, []);
44
+ const isPrevDisabled = useMemo(() => {
45
+ if (!minDate) return false;
46
+ const prevWeekEnd = endOfWeek(subWeeks(currentWeekStart, 1));
47
+ return isDateBefore(prevWeekEnd, minDate);
48
+ }, [currentWeekStart, minDate]);
49
+ const isNextDisabled = useMemo(() => {
50
+ if (!maxDate) return false;
51
+ const nextWeekStart = addWeeks(currentWeekStart, 1);
52
+ return isDateAfter(nextWeekStart, maxDate);
53
+ }, [currentWeekStart, maxDate]);
54
+ const prevState = calculateNavState(isPrevDisabled, prevHovered);
55
+ const nextState = calculateNavState(isNextDisabled, nextHovered);
56
+ const prevIconProps = StyleSheet.flatten([styles.navButtonIcon?.default, styles.navButtonIcon?.[prevState]]);
57
+ const nextIconProps = StyleSheet.flatten([styles.navButtonIcon?.default, styles.navButtonIcon?.[nextState]]);
58
+
59
+ // Strip logic
60
+ const prevWeekDates = getWeekDates(subWeeks(currentWeekStart, 1));
61
+ const currentWeekDates = getWeekDates(currentWeekStart);
62
+ const nextWeekDates = getWeekDates(addWeeks(currentWeekStart, 1));
63
+ const weeks = [prevWeekDates, currentWeekDates, nextWeekDates];
64
+ const scrollKey = currentWeekStart.getTime();
65
+ const handleScrollEnd = useCallback(event => {
66
+ const offsetX = event.nativeEvent.contentOffset.x;
67
+ const pageIndex = Math.round(offsetX / containerWidth);
68
+ if (pageIndex === 0) {
69
+ setCurrentWeekStart(subWeeks(currentWeekStart, 1));
70
+ } else if (pageIndex === 2) {
71
+ setCurrentWeekStart(addWeeks(currentWeekStart, 1));
72
+ }
73
+ }, [containerWidth, currentWeekStart]);
74
+ const contextValue = useMemo(() => ({
75
+ value,
76
+ onChange,
77
+ currentMonth,
78
+ goToPrev,
79
+ goToNext,
80
+ isPrevDisabled,
81
+ isNextDisabled,
82
+ minDate,
83
+ maxDate,
84
+ markedDates,
85
+ styles,
86
+ currentWeekStart,
87
+ setCurrentWeekStart
88
+ }), [value, onChange, currentMonth, goToPrev, goToNext, isPrevDisabled, isNextDisabled, minDate, maxDate, markedDates, styles, currentWeekStart]);
89
+ return /*#__PURE__*/_jsx(CalendarContext.Provider, {
90
+ value: contextValue,
91
+ children: /*#__PURE__*/_jsxs(View, {
92
+ style: [styles.root, style],
93
+ children: [/*#__PURE__*/_jsxs(View, {
94
+ style: styles.header,
95
+ children: [/*#__PURE__*/_jsx(Text, {
96
+ style: styles.headerTitle,
97
+ children: formatDate(currentMonth, "MMMM yyyy")
98
+ }), /*#__PURE__*/_jsxs(View, {
99
+ style: styles.navButtons,
100
+ children: [/*#__PURE__*/_jsx(Pressable, {
101
+ onPress: goToPrev,
102
+ onHoverIn: () => setPrevHovered(true),
103
+ onHoverOut: () => setPrevHovered(false),
104
+ disabled: isPrevDisabled,
105
+ style: [styles.navButton?.default, styles.navButton?.[prevState]],
106
+ children: PrevIcon ? /*#__PURE__*/_jsx(PrevIcon, {
107
+ ...prevIconProps
108
+ }) : /*#__PURE__*/_jsx(Text, {
109
+ style: prevIconProps?.style,
110
+ children: "\u2039"
111
+ })
112
+ }), /*#__PURE__*/_jsx(Pressable, {
113
+ onPress: goToNext,
114
+ onHoverIn: () => setNextHovered(true),
115
+ onHoverOut: () => setNextHovered(false),
116
+ disabled: isNextDisabled,
117
+ style: [styles.navButton?.default, styles.navButton?.[nextState]],
118
+ children: NextIcon ? /*#__PURE__*/_jsx(NextIcon, {
119
+ ...nextIconProps
120
+ }) : /*#__PURE__*/_jsx(Text, {
121
+ style: nextIconProps?.style,
122
+ children: "\u203A"
123
+ })
124
+ })]
125
+ })]
126
+ }), /*#__PURE__*/_jsx(View, {
127
+ style: styles.weekLabels,
128
+ children: weekDays.map((day, index) => /*#__PURE__*/_jsx(Text, {
129
+ numberOfLines: 1,
130
+ style: styles.weekLabel,
131
+ children: day
132
+ }, index))
133
+ }), /*#__PURE__*/_jsx(View, {
134
+ style: styles.swipeContainer,
135
+ onLayout: e => setContainerWidth(e.nativeEvent.layout.width),
136
+ children: containerWidth > 0 && /*#__PURE__*/_jsx(ScrollView, {
137
+ ref: scrollRef,
138
+ horizontal: true,
139
+ pagingEnabled: true,
140
+ showsHorizontalScrollIndicator: false,
141
+ scrollEventThrottle: 16,
142
+ onMomentumScrollEnd: handleScrollEnd,
143
+ onLayout: () => {
144
+ if (Platform.OS === "web") {
145
+ scrollRef.current?.scrollTo({
146
+ x: containerWidth,
147
+ animated: false
148
+ });
149
+ }
150
+ },
151
+ ...(Platform.OS !== "web" ? {
152
+ contentOffset: {
153
+ x: containerWidth,
154
+ y: 0
155
+ }
156
+ } : {}),
157
+ children: weeks.map((weekDates, weekIndex) => /*#__PURE__*/_jsx(View, {
158
+ style: [styles.weekStrip, {
159
+ width: containerWidth
160
+ }],
161
+ children: weekDates.map((date, dayIndex) => /*#__PURE__*/_jsx(CalendarDay, {
162
+ date: date
163
+ }, dayIndex))
164
+ }, weekIndex))
165
+ }, scrollKey)
166
+ })]
167
+ })
168
+ });
169
+ }
170
+ //# sourceMappingURL=week-calendar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","useCallback","useMemo","useRef","useState","Platform","Pressable","ScrollView","StyleSheet","Text","View","useComponentsConfig","addWeeks","endOfWeek","formatDate","getWeekDates","isDateAfter","isDateBefore","startOfWeek","subWeeks","CalendarContext","CalendarDay","WeekCalendarVariants","jsx","_jsx","jsxs","_jsxs","DEFAULT_WEEK_DAYS","calculateNavState","isDisabled","isHovered","WeekCalendar","props","value","onChange","defaultWeek","Date","minDate","maxDate","markedDates","weekDays","style","styles","variant","config","PrevIcon","calendar","prevIcon","NextIcon","nextIcon","currentWeekStart","setCurrentWeekStart","containerWidth","setContainerWidth","scrollRef","prevHovered","setPrevHovered","nextHovered","setNextHovered","currentMonth","goToPrev","prev","goToNext","isPrevDisabled","prevWeekEnd","isNextDisabled","nextWeekStart","prevState","nextState","prevIconProps","flatten","navButtonIcon","default","nextIconProps","prevWeekDates","currentWeekDates","nextWeekDates","weeks","scrollKey","getTime","handleScrollEnd","event","offsetX","nativeEvent","contentOffset","x","pageIndex","Math","round","contextValue","Provider","children","root","header","headerTitle","navButtons","onPress","onHoverIn","onHoverOut","disabled","navButton","weekLabels","map","day","index","numberOfLines","weekLabel","swipeContainer","onLayout","e","layout","width","ref","horizontal","pagingEnabled","showsHorizontalScrollIndicator","scrollEventThrottle","onMomentumScrollEnd","OS","current","scrollTo","animated","y","weekDates","weekIndex","weekStrip","date","dayIndex"],"sourceRoot":"../../../../../src","sources":["components/calendar/week-calendar/week-calendar.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AACrE,SACEC,QAAQ,EACRC,SAAS,EACTC,UAAU,EACVC,UAAU,EACVC,IAAI,EACJC,IAAI,QAKC,cAAc;AACrB,SAASC,mBAAmB,QAAQ,0BAAiB;AACrD,SACEC,QAAQ,EACRC,SAAS,EACTC,UAAU,EACVC,YAAY,EACZC,WAAW,EACXC,YAAY,EACZC,WAAW,EACXC,QAAQ,QACH,8BAA2B;AAClC,SACEC,eAAe,QAEV,+BAA4B;AACnC,SAASC,WAAW,QAAQ,2BAAwB;AAEpD,SAASC,oBAAoB,QAAQ,qBAAY;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAElD,MAAMC,iBAAiB,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;AAcpE,MAAMC,iBAAiB,GAAGA,CACxBC,UAAmB,EACnBC,SAAkB,KACS;EAC3B,IAAID,UAAU,EAAE,OAAO,UAAU;EACjC,IAAIC,SAAS,EAAE,OAAO,SAAS;EAC/B,OAAO,SAAS;AAClB,CAAC;AAED,OAAO,SAASC,YAAYA,CAACC,KAAwB,EAAE;EACrD,MAAM;IACJC,KAAK;IACLC,QAAQ;IACRC,WA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AC,CAACqB,SAAS,EAAEC,SAAS,kBAC9BpG,IAAA,CAACd,IAAI;YAEH+B,KAAK,EAAE,CAACC,MAAM,CAACmF,SAAS,EAAE;cAAEd,KAAK,EAAE3D;YAAe,CAAC,CAAE;YAAAuC,QAAA,EAEpDgC,SAAS,CAACrB,GAAG,CAAC,CAACwB,IAAI,EAAEC,QAAQ,kBAC5BvG,IAAA,CAACH,WAAW;cAAgByG,IAAI,EAAEA;YAAK,GAArBC,QAAuB,CAC1C;UAAC,GALGH,SAMD,CACP;QAAC,GA3BG9C,SA4BK;MACb,CACG,CAAC;IAAA,CACH;EAAC,CACiB,CAAC;AAE/B","ignoreList":[]}
@@ -7,8 +7,8 @@ export * from "./badge/index.js";
7
7
  export * from "./button/index.js";
8
8
  export * from "./calendar/index.js";
9
9
  export * from "./card/index.js";
10
- export * from "./combobox/index.js";
11
10
  export * from "./checkbox/index.js";
11
+ export * from "./combobox/index.js";
12
12
  export * from "./empty/index.js";
13
13
  export * from "./field/index.js";
14
14
  export * from "./icon/index.js";
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
 
3
+ import { ScrollBar } from "./components/index.js";
3
4
  import { AsyncAlertDialogManager } from "./components/alert-dialog/async-alert-dialog.js";
4
5
  import { PortalHost } from "./components/portal/index.js";
5
6
  import { ToastContainer } from "./components/toast/manager.js";
@@ -21,7 +22,7 @@ export const UIProvider = ({
21
22
  children: /*#__PURE__*/_jsxs(ThemeProvider, {
22
23
  theme: theme,
23
24
  components: components,
24
- children: [/*#__PURE__*/_jsx(ToastContainer, {}), children, /*#__PURE__*/_jsx(PortalHost, {
25
+ children: [/*#__PURE__*/_jsx(ScrollBar, {}), /*#__PURE__*/_jsx(ToastContainer, {}), children, /*#__PURE__*/_jsx(PortalHost, {
25
26
  container: portalContainer
26
27
  }), /*#__PURE__*/_jsx(AsyncAlertDialogManager, {})]
27
28
  })
@@ -1 +1 @@
1
- {"version":3,"names":["AsyncAlertDialogManager","PortalHost","ToastContainer","useInitializeNavigationContainerRef","SafeAreaProvider","ThemeProvider","jsx","_jsx","jsxs","_jsxs","UIProvider","children","portalContainer","theme","safeAreaInsets","components","insets","container","useTheme"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,uBAAuB,QAAQ,iDAA8C;AACtF,SAASC,UAAU,QAAQ,8BAAqB;AAEhD,SAASC,cAAc,QAAQ,+BAA4B;AAC3D,SAASC,mCAAmC,QAAQ,0CAAuC;AAC3F,SAASC,gBAAgB,QAA6B,sBAAa;AACnE,SACEC,aAAa,QAGR,mBAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAUlB,OAAO,MAAMC,UAAU,GAAGA,CAAC;EACzBC,QAAQ;EACRC,eAAe;EACfC,KAAK;EACLC,cAAc;EACdC;AACa,CAAC,KAAK;EACnB;EACAZ,mCAAmC,CAAC,CAAC;EAErC,oBACEI,IAAA,CAACH,gBAAgB;IAACY,MAAM,EAAEF,cAAe;IAAAH,QAAA,eACvCF,KAAA,CAACJ,aAAa;MAACQ,KAAK,EAAEA,KAAM;MAACE,UAAU,EAAEA,UAAW;MAAAJ,QAAA,gBAClDJ,IAAA,CAACL,cAAc,IAAE,CAAC,EACjBS,QAAQ,eACTJ,IAAA,CAACN,UAAU;QAACgB,SAAS,EAAEL;MAAgB,CAAE,CAAC,eAC1CL,IAAA,CAACP,uBAAuB,IAAE,CAAC;IAAA,CACd;EAAC,CACA,CAAC;AAEvB,CAAC;AAED,cAAc,4BAAyB;AAEvC,cAAc,4BAAmB;AACjC,cAAc,2BAAkB;AAChC,SAASkB,QAAQ,QAA+B,sBAAmB;AACnE,cAAc,mBAAgB;AAE9B,cAAc,uBAAc;AAE5B,cAAc,sBAAa","ignoreList":[]}
1
+ {"version":3,"names":["ScrollBar","AsyncAlertDialogManager","PortalHost","ToastContainer","useInitializeNavigationContainerRef","SafeAreaProvider","ThemeProvider","jsx","_jsx","jsxs","_jsxs","UIProvider","children","portalContainer","theme","safeAreaInsets","components","insets","container","useTheme"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,SAAS,QAAQ,uBAAc;AACxC,SAASC,uBAAuB,QAAQ,iDAA8C;AACtF,SAASC,UAAU,QAAQ,8BAAqB;AAEhD,SAASC,cAAc,QAAQ,+BAA4B;AAC3D,SAASC,mCAAmC,QAAQ,0CAAuC;AAC3F,SAASC,gBAAgB,QAA6B,sBAAa;AACnE,SACEC,aAAa,QAGR,mBAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAUlB,OAAO,MAAMC,UAAU,GAAGA,CAAC;EACzBC,QAAQ;EACRC,eAAe;EACfC,KAAK;EACLC,cAAc;EACdC;AACa,CAAC,KAAK;EACnB;EACAZ,mCAAmC,CAAC,CAAC;EAErC,oBACEI,IAAA,CAACH,gBAAgB;IAACY,MAAM,EAAEF,cAAe;IAAAH,QAAA,eACvCF,KAAA,CAACJ,aAAa;MAACQ,KAAK,EAAEA,KAAM;MAACE,UAAU,EAAEA,UAAW;MAAAJ,QAAA,gBAClDJ,IAAA,CAACR,SAAS,IAAE,CAAC,eACbQ,IAAA,CAACL,cAAc,IAAE,CAAC,EACjBS,QAAQ,eACTJ,IAAA,CAACN,UAAU;QAACgB,SAAS,EAAEL;MAAgB,CAAE,CAAC,eAC1CL,IAAA,CAACP,uBAAuB,IAAE,CAAC;IAAA,CACd;EAAC,CACA,CAAC;AAEvB,CAAC;AAED,cAAc,4BAAyB;AAEvC,cAAc,4BAAmB;AACjC,cAAc,2BAAkB;AAChC,SAASkB,QAAQ,QAA+B,sBAAmB;AACnE,cAAc,mBAAgB;AAE9B,cAAc,uBAAc;AAE5B,cAAc,sBAAa","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["createContext","useContext","useEffect","useState","useColorScheme","defaultThemeAssets","mergeThemeAssets","jsx","_jsx","ThemeContext","ThemeProvider","props","children","theme","components","systemColorScheme","colorScheme","setColorScheme","themeAssets","colors","Provider","value","radius","fontFamily","letterSpacing","fontSize","useTheme","context","Error","useComponentsConfig"],"sourceRoot":"../../../src","sources":["themes/provider.tsx"],"mappings":";;AAAA,SACEA,aAAa,EAEbC,UAAU,EACVC,SAAS,EACTC,QAAQ,QACH,OAAO;AACd,SAASC,cAAc,QAAQ,cAAc;AAI7C,SAASC,kBAAkB,QAAQ,oBAAW;AAU9C,SAASC,gBAAgB,QAAQ,YAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAwB3C,MAAMC,YAAY,gBAAGT,aAAa,CAAsB,IAAI,CAAC;AAO7D,OAAO,MAAMU,aAAa,GAAIC,KAAyB,IAAK;EAC1D,MAAM;IAAEC,QAAQ;IAAEC,KAAK;IAAEC;EAAW,CAAC,GAAGH,KAAK;EAE7C,MAAMI,iBAAiB,GAAGX,cAAc,CAAC,CAAC;EAC1C,MAAM,CAACY,WAAW,EAAEC,cAAc,CAAC,GAAGd,QAAQ,CAC5CY,iBAAiB,KAAK,MAAM,GAAG,MAAM,GAAG,OAC1C,CAAC;EAED,MAAMG,WAAW,GAAGL,KAAK,GACrBP,gBAAgB,CAACD,kBAAkB,EAAEQ,KAAK,CAAC,GAC3CR,kBAAkB;EAEtB,MAAMc,MAAM,GAAGD,WAAW,CAACC,MAAM,CAACH,WAAW,CAAC;EAE9Cd,SAAS,CAAC,MAAM;IACd,IAAIa,iBAAiB,EAAE;MACrBE,cAAc,CAACF,iBAAiB,KAAK,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;IACjE;EACF,CAAC,EAAE,CAACA,iBAAiB,CAAC,CAAC;EAEvB,oBACEP,IAAA,CAACC,YAAY,CAACW,QAAQ;IACpBC,KAAK,EAAE;MACLL,WAAW;MACXC,cAAc;MACdE,MAAM;MACNG,MAAM,EAAEJ,WAAW,CAACI,MAAM;MAC1BC,UAAU,EAAEL,WAAW,CAACK,UAAU;MAClCC,aAAa,EAAEN,WAAW,CAACM,aAAa;MACxCC,QAAQ,EAAEP,WAAW,CAACO,QAAQ;MAC9BX;IACF,CAAE;IAAAF,QAAA,EAEDA;EAAQ,CACY,CAAC;AAE5B,CAAC;AAED,OAAO,MAAMc,QAAQ,GAAGA,CAAA,KAAM;EAC5B,MAAMC,OAAO,GAAG1B,UAAU,CAACQ,YAAY,CAAC;EACxC,IAAI,CAACkB,OAAO,EAAE;IACZ,MAAM,IAAIC,KAAK,CAAC,8CAA8C,CAAC;EACjE;EACA,OAAOD,OAAO;AAChB,CAAC;AAED,OAAO,MAAME,mBAAmB,GAAGA,CAAA,KAAM;EACvC,MAAMF,OAAO,GAAG1B,UAAU,CAACQ,YAAY,CAAC;EACxC,IAAI,CAACkB,OAAO,EAAE;IACZ,MAAM,IAAIC,KAAK,CAAC,yDAAyD,CAAC;EAC5E;EACA,OAAOD,OAAO,CAACb,UAAU;AAC3B,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["createContext","useContext","useEffect","useState","useColorScheme","defaultThemeAssets","mergeThemeAssets","jsx","_jsx","ThemeContext","ThemeProvider","props","children","theme","components","systemColorScheme","colorScheme","setColorScheme","themeAssets","colors","Provider","value","radius","fontFamily","letterSpacing","fontSize","useTheme","context","Error","useComponentsConfig"],"sourceRoot":"../../../src","sources":["themes/provider.tsx"],"mappings":";;AAAA,SACEA,aAAa,EAEbC,UAAU,EACVC,SAAS,EACTC,QAAQ,QACH,OAAO;AACd,SAASC,cAAc,QAAQ,cAAc;AAI7C,SAASC,kBAAkB,QAAQ,oBAAW;AAU9C,SAASC,gBAAgB,QAAQ,YAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA;AA4B3C,MAAMC,YAAY,gBAAGT,aAAa,CAAsB,IAAI,CAAC;AAO7D,OAAO,MAAMU,aAAa,GAAIC,KAAyB,IAAK;EAC1D,MAAM;IAAEC,QAAQ;IAAEC,KAAK;IAAEC;EAAW,CAAC,GAAGH,KAAK;EAE7C,MAAMI,iBAAiB,GAAGX,cAAc,CAAC,CAAC;EAC1C,MAAM,CAACY,WAAW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atDate = (date, format) => {
8
8
  if (format === "MMMM yyyy") {
9
9
  return `${month} ${year}`;
10
10
  }
11
+ if (format === "MMMM d, yyyy") {
12
+ return `${month} ${day}, ${year}`;
13
+ }
11
14
  if (format === "d") {
12
15
  return day.toString();
13
16
  }
@@ -61,27 +64,16 @@ export const getWeekDays = (month, year, week) => {
61
64
  const firstDayOfMonth = new Date(year, month, 1).getDay();
62
65
  const daysInMonth = getDaysInMonth(new Date(year, month));
63
66
 
64
- // Calculate the date of the first day in the week
65
- const startDay = week * 7 - (firstDayOfMonth === 0 ? 6 : firstDayOfMonth - 1);
67
+ // Calculate the date of the first day in the week (Sunday-start)
68
+ const startDay = week * 7 - firstDayOfMonth + 1;
66
69
  for (let i = 0; i < 7; i++) {
67
70
  const day = startDay + i;
68
- let date;
69
- if (day < 1) {
70
- // Days from previous month
71
- const prevMonth = month === 0 ? 11 : month - 1;
72
- const prevYear = month === 0 ? year - 1 : year;
73
- const daysInPrevMonth = getDaysInMonth(new Date(prevYear, prevMonth));
74
- date = new Date(prevYear, prevMonth, daysInPrevMonth + day);
75
- } else if (day > daysInMonth) {
76
- // Days from next month
77
- const nextMonth = month === 11 ? 0 : month + 1;
78
- const nextYear = month === 11 ? year + 1 : year;
79
- date = new Date(nextYear, nextMonth, day - daysInMonth);
71
+ if (day < 1 || day > daysInMonth) {
72
+ // Outside current month — empty cell
73
+ days.push(null);
80
74
  } else {
81
- // Days from current month
82
- date = new Date(year, month, day);
75
+ days.push(new Date(year, month, day));
83
76
  }
84
- days.push(date);
85
77
  }
86
78
  return days;
87
79
  };
@@ -92,4 +84,40 @@ export const getWeeksInMonth = date => {
92
84
  // Calculate total number of weeks
93
85
  return Math.ceil((firstDayOfMonth + daysInMonth) / 7);
94
86
  };
87
+ export const startOfWeek = date => {
88
+ const d = new Date(date.getFullYear(), date.getMonth(), date.getDate());
89
+ d.setDate(d.getDate() - d.getDay());
90
+ return d;
91
+ };
92
+ export const endOfWeek = date => {
93
+ const d = startOfWeek(date);
94
+ d.setDate(d.getDate() + 6);
95
+ return d;
96
+ };
97
+ export const getWeekDates = date => {
98
+ const start = startOfWeek(date);
99
+ return Array.from({
100
+ length: 7
101
+ }, (_, i) => {
102
+ const d = new Date(start);
103
+ d.setDate(start.getDate() + i);
104
+ return d;
105
+ });
106
+ };
107
+ export const addWeeks = (date, weeks) => {
108
+ const d = new Date(date);
109
+ d.setDate(d.getDate() + weeks * 7);
110
+ return d;
111
+ };
112
+ export const subWeeks = (date, weeks) => {
113
+ return addWeeks(date, -weeks);
114
+ };
115
+ export const addDays = (date, days) => {
116
+ const d = new Date(date);
117
+ d.setDate(d.getDate() + days);
118
+ return d;
119
+ };
120
+ export const subDays = (date, days) => {
121
+ return addDays(date, -days);
122
+ };
95
123
  //# sourceMappingURL=date-utils.js.map