@rokoyfa/calendar 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (218) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/LICENSE +21 -0
  3. package/README.md +194 -3
  4. package/api/openapi.yaml +911 -0
  5. package/dist-lib/cdn/calendar-widget.js +14 -0
  6. package/dist-lib/cdn/calendar-widget.js.map +1 -0
  7. package/dist-lib/npm/index.d.ts +1 -0
  8. package/dist-lib/npm/index.js +13055 -0
  9. package/dist-lib/npm/index.js.map +1 -0
  10. package/dist-lib/npm/types/components/Button.d.ts +17 -0
  11. package/dist-lib/npm/types/components/ChoiceChip.d.ts +13 -0
  12. package/dist-lib/npm/types/components/ConfirmModal.d.ts +11 -0
  13. package/dist-lib/npm/types/components/DateTimeField.d.ts +14 -0
  14. package/dist-lib/npm/types/components/Form.d.ts +8 -0
  15. package/dist-lib/npm/types/components/FormField.d.ts +10 -0
  16. package/dist-lib/npm/types/components/IconButton.d.ts +11 -0
  17. package/dist-lib/npm/types/components/Icons.d.ts +10 -0
  18. package/dist-lib/npm/types/components/Modal.d.ts +10 -0
  19. package/dist-lib/npm/types/components/NumberField.d.ts +12 -0
  20. package/dist-lib/npm/types/components/PageLayout.d.ts +13 -0
  21. package/dist-lib/npm/types/components/PageSection.d.ts +9 -0
  22. package/dist-lib/npm/types/components/PasswordField.d.ts +4 -0
  23. package/dist-lib/npm/types/components/SegmentedControl.d.ts +11 -0
  24. package/dist-lib/npm/types/components/SegmentedField.d.ts +11 -0
  25. package/dist-lib/npm/types/components/SelectField.d.ts +13 -0
  26. package/dist-lib/npm/types/components/StatusMessage.d.ts +13 -0
  27. package/dist-lib/npm/types/components/Stepper.d.ts +9 -0
  28. package/dist-lib/npm/types/components/Switch.d.ts +8 -0
  29. package/dist-lib/npm/types/components/Tabs.d.ts +14 -0
  30. package/dist-lib/npm/types/components/TeamsGate.d.ts +4 -0
  31. package/dist-lib/npm/types/components/TextField.d.ts +9 -0
  32. package/dist-lib/npm/types/config/calendars.d.ts +1 -0
  33. package/dist-lib/npm/types/config/routes.d.ts +17 -0
  34. package/dist-lib/npm/types/context/HostContext.d.ts +9 -0
  35. package/dist-lib/npm/types/context/RootElementContext.d.ts +2 -0
  36. package/dist-lib/npm/types/data/index.d.ts +4 -0
  37. package/dist-lib/npm/types/data/localDataSource.d.ts +3 -0
  38. package/dist-lib/npm/types/data/restDataSource.d.ts +11 -0
  39. package/dist-lib/npm/types/data/tenantDataSource.d.ts +10 -0
  40. package/dist-lib/npm/types/data/types.d.ts +21 -0
  41. package/dist-lib/npm/types/features/authorization/components/AccountMenu.d.ts +6 -0
  42. package/dist-lib/npm/types/features/authorization/components/AuthFields.d.ts +26 -0
  43. package/dist-lib/npm/types/features/authorization/components/AuthGate.d.ts +7 -0
  44. package/dist-lib/npm/types/features/authorization/components/ContinueLink.d.ts +1 -0
  45. package/dist-lib/npm/types/features/authorization/components/EmailVerificationBanner.d.ts +1 -0
  46. package/dist-lib/npm/types/features/authorization/components/ForgotPasswordPage.d.ts +1 -0
  47. package/dist-lib/npm/types/features/authorization/components/LoginPage.d.ts +1 -0
  48. package/dist-lib/npm/types/features/authorization/components/RegisterPage.d.ts +1 -0
  49. package/dist-lib/npm/types/features/authorization/components/ResendVerificationButton.d.ts +4 -0
  50. package/dist-lib/npm/types/features/authorization/components/ResetPasswordPage.d.ts +1 -0
  51. package/dist-lib/npm/types/features/authorization/components/VerifyEmailPage.d.ts +1 -0
  52. package/dist-lib/npm/types/features/authorization/components/account/AccountSettings.d.ts +1 -0
  53. package/dist-lib/npm/types/features/authorization/components/account/DeleteAccountSection.d.ts +1 -0
  54. package/dist-lib/npm/types/features/authorization/components/account/EmailSection.d.ts +4 -0
  55. package/dist-lib/npm/types/features/authorization/components/account/PasswordSection.d.ts +1 -0
  56. package/dist-lib/npm/types/features/authorization/components/account/ProfileSection.d.ts +4 -0
  57. package/dist-lib/npm/types/features/authorization/context/AuthContext.d.ts +2 -0
  58. package/dist-lib/npm/types/features/authorization/context/AuthProvider.d.ts +8 -0
  59. package/dist-lib/npm/types/features/authorization/hooks/useAuth.d.ts +18 -0
  60. package/dist-lib/npm/types/features/authorization/index.d.ts +14 -0
  61. package/dist-lib/npm/types/features/authorization/repositories/HostTokenAuthRepository.d.ts +18 -0
  62. package/dist-lib/npm/types/features/authorization/repositories/RemoteAuthRepository.d.ts +18 -0
  63. package/dist-lib/npm/types/features/authorization/types/auth.d.ts +52 -0
  64. package/dist-lib/npm/types/features/authorization/utils/validation.d.ts +22 -0
  65. package/dist-lib/npm/types/features/calendar/components/Calendar.d.ts +14 -0
  66. package/dist-lib/npm/types/features/calendar/components/CalendarHeader.d.ts +16 -0
  67. package/dist-lib/npm/types/features/calendar/components/DayColumn.d.ts +18 -0
  68. package/dist-lib/npm/types/features/calendar/components/EventBlock.d.ts +10 -0
  69. package/dist-lib/npm/types/features/calendar/components/EventChip.d.ts +8 -0
  70. package/dist-lib/npm/types/features/calendar/components/EventTitle.d.ts +8 -0
  71. package/dist-lib/npm/types/features/calendar/components/MiniMonth.d.ts +9 -0
  72. package/dist-lib/npm/types/features/calendar/components/MonthGrid.d.ts +8 -0
  73. package/dist-lib/npm/types/features/calendar/components/MonthView.d.ts +2 -0
  74. package/dist-lib/npm/types/features/calendar/components/NowIndicator.d.ts +6 -0
  75. package/dist-lib/npm/types/features/calendar/components/TimeColumn.d.ts +1 -0
  76. package/dist-lib/npm/types/features/calendar/components/TimeGridView.d.ts +2 -0
  77. package/dist-lib/npm/types/features/calendar/components/YearView.d.ts +2 -0
  78. package/dist-lib/npm/types/features/calendar/constants/grid.d.ts +4 -0
  79. package/dist-lib/npm/types/features/calendar/constants/views.d.ts +7 -0
  80. package/dist-lib/npm/types/features/calendar/context/EventSourcesContext.d.ts +3 -0
  81. package/dist-lib/npm/types/features/calendar/hooks/useCalendarView.d.ts +19 -0
  82. package/dist-lib/npm/types/features/calendar/hooks/useEventSource.d.ts +2 -0
  83. package/dist-lib/npm/types/features/calendar/hooks/useNow.d.ts +1 -0
  84. package/dist-lib/npm/types/features/calendar/hooks/useSlotSelection.d.ts +6 -0
  85. package/dist-lib/npm/types/features/calendar/index.d.ts +4 -0
  86. package/dist-lib/npm/types/features/calendar/types/editor.d.ts +5 -0
  87. package/dist-lib/npm/types/features/calendar/types/eventLayout.d.ts +14 -0
  88. package/dist-lib/npm/types/features/calendar/types/eventSource.d.ts +6 -0
  89. package/dist-lib/npm/types/features/calendar/types/view.d.ts +26 -0
  90. package/dist-lib/npm/types/features/calendar/utils/eventGeometry.d.ts +3 -0
  91. package/dist-lib/npm/types/features/calendar/utils/eventLabels.d.ts +15 -0
  92. package/dist-lib/npm/types/features/calendar/utils/layoutEvents.d.ts +3 -0
  93. package/dist-lib/npm/types/features/calendar/utils/segmentEvents.d.ts +5 -0
  94. package/dist-lib/npm/types/features/calendar/utils/slotSelection.d.ts +17 -0
  95. package/dist-lib/npm/types/features/calendars/components/ActiveCalendarIndicator.d.ts +1 -0
  96. package/dist-lib/npm/types/features/calendars/components/CalendarPreview.d.ts +4 -0
  97. package/dist-lib/npm/types/features/calendars/components/CalendarSettings.d.ts +1 -0
  98. package/dist-lib/npm/types/features/calendars/components/CalendarSwitcher.d.ts +1 -0
  99. package/dist-lib/npm/types/features/calendars/components/InvitationList.d.ts +1 -0
  100. package/dist-lib/npm/types/features/calendars/components/create/ColorStep.d.ts +7 -0
  101. package/dist-lib/npm/types/features/calendars/components/create/CreateCalendarPage.d.ts +1 -0
  102. package/dist-lib/npm/types/features/calendars/components/create/DetailsStep.d.ts +12 -0
  103. package/dist-lib/npm/types/features/calendars/components/create/MembersStep.d.ts +8 -0
  104. package/dist-lib/npm/types/features/calendars/components/create/ReviewStep.d.ts +4 -0
  105. package/dist-lib/npm/types/features/calendars/components/settings/CalendarSettingsPage.d.ts +1 -0
  106. package/dist-lib/npm/types/features/calendars/components/settings/DangerSection.d.ts +9 -0
  107. package/dist-lib/npm/types/features/calendars/components/settings/GeneralSection.d.ts +4 -0
  108. package/dist-lib/npm/types/features/calendars/components/settings/MembersSection.d.ts +11 -0
  109. package/dist-lib/npm/types/features/calendars/components/settings/TeamInvitationsSection.d.ts +12 -0
  110. package/dist-lib/npm/types/features/calendars/components/settings/TransferOwnershipModal.d.ts +8 -0
  111. package/dist-lib/npm/types/features/calendars/constants/calendars.d.ts +9 -0
  112. package/dist-lib/npm/types/features/calendars/context/CalendarsContext.d.ts +2 -0
  113. package/dist-lib/npm/types/features/calendars/context/CalendarsProvider.d.ts +8 -0
  114. package/dist-lib/npm/types/features/calendars/hooks/useCalendars.d.ts +1 -0
  115. package/dist-lib/npm/types/features/calendars/hooks/useTeam.d.ts +12 -0
  116. package/dist-lib/npm/types/features/calendars/index.d.ts +11 -0
  117. package/dist-lib/npm/types/features/calendars/repositories/LocalCalendarRepository.d.ts +20 -0
  118. package/dist-lib/npm/types/features/calendars/repositories/RemoteCalendarRepository.d.ts +23 -0
  119. package/dist-lib/npm/types/features/calendars/types/calendar.d.ts +91 -0
  120. package/dist-lib/npm/types/features/calendars/utils/draft.d.ts +7 -0
  121. package/dist-lib/npm/types/features/calendars/utils/permissions.d.ts +13 -0
  122. package/dist-lib/npm/types/features/events/components/ColorPicker.d.ts +7 -0
  123. package/dist-lib/npm/types/features/events/components/CustomColorSettings.d.ts +1 -0
  124. package/dist-lib/npm/types/features/events/components/DeleteEventModal.d.ts +8 -0
  125. package/dist-lib/npm/types/features/events/components/EventModal.d.ts +11 -0
  126. package/dist-lib/npm/types/features/events/components/RecurrenceFields.d.ts +9 -0
  127. package/dist-lib/npm/types/features/events/components/RecurrenceScopeModal.d.ts +8 -0
  128. package/dist-lib/npm/types/features/events/components/ScopeButtons.d.ts +10 -0
  129. package/dist-lib/npm/types/features/events/constants/colors.d.ts +3 -0
  130. package/dist-lib/npm/types/features/events/hooks/useCustomColors.d.ts +8 -0
  131. package/dist-lib/npm/types/features/events/hooks/useEvents.d.ts +15 -0
  132. package/dist-lib/npm/types/features/events/index.d.ts +5 -0
  133. package/dist-lib/npm/types/features/events/types/eventModal.d.ts +1 -0
  134. package/dist-lib/npm/types/features/events/utils/scopeOptions.d.ts +3 -0
  135. package/dist-lib/npm/types/features/events/utils/seriesActions.d.ts +4 -0
  136. package/dist-lib/npm/types/features/preferences/components/PreferencesSettings.d.ts +1 -0
  137. package/dist-lib/npm/types/features/preferences/context/PreferencesContext.d.ts +6 -0
  138. package/dist-lib/npm/types/features/preferences/context/PreferencesProvider.d.ts +4 -0
  139. package/dist-lib/npm/types/features/preferences/hooks/usePreferences.d.ts +1 -0
  140. package/dist-lib/npm/types/features/preferences/index.d.ts +3 -0
  141. package/dist-lib/npm/types/features/storage/components/LocalImportPrompt.d.ts +5 -0
  142. package/dist-lib/npm/types/features/storage/context/StorageContext.d.ts +2 -0
  143. package/dist-lib/npm/types/features/storage/context/StorageProvider.d.ts +8 -0
  144. package/dist-lib/npm/types/features/storage/hooks/useStorage.d.ts +7 -0
  145. package/dist-lib/npm/types/features/storage/index.d.ts +10 -0
  146. package/dist-lib/npm/types/features/storage/repositories/LocalColorRepository.d.ts +9 -0
  147. package/dist-lib/npm/types/features/storage/repositories/LocalEventRepository.d.ts +13 -0
  148. package/dist-lib/npm/types/features/storage/repositories/LocalPreferencesRepository.d.ts +8 -0
  149. package/dist-lib/npm/types/features/storage/repositories/RemoteColorRepository.d.ts +10 -0
  150. package/dist-lib/npm/types/features/storage/repositories/RemoteEventRepository.d.ts +12 -0
  151. package/dist-lib/npm/types/features/storage/repositories/RemotePreferencesRepository.d.ts +9 -0
  152. package/dist-lib/npm/types/features/storage/types/storage.d.ts +35 -0
  153. package/dist-lib/npm/types/features/storage/utils/copyEvents.d.ts +3 -0
  154. package/dist-lib/npm/types/features/storage/utils/localStorageList.d.ts +5 -0
  155. package/dist-lib/npm/types/features/storage/utils/localStorageValue.d.ts +9 -0
  156. package/dist-lib/npm/types/hooks/useArrowKeyNavigation.d.ts +6 -0
  157. package/dist-lib/npm/types/hooks/useAsyncAction.d.ts +6 -0
  158. package/dist-lib/npm/types/hooks/useAsyncResource.d.ts +9 -0
  159. package/dist-lib/npm/types/hooks/useForm.d.ts +21 -0
  160. package/dist-lib/npm/types/hooks/useFormState.d.ts +8 -0
  161. package/dist-lib/npm/types/hooks/useRequiredContext.d.ts +2 -0
  162. package/dist-lib/npm/types/hooks/useTabParam.d.ts +3 -0
  163. package/dist-lib/npm/types/i18n/I18nContext.d.ts +15 -0
  164. package/dist-lib/npm/types/i18n/I18nProvider.d.ts +7 -0
  165. package/dist-lib/npm/types/i18n/errorMessage.d.ts +2 -0
  166. package/dist-lib/npm/types/i18n/format.d.ts +28 -0
  167. package/dist-lib/npm/types/i18n/index.d.ts +8 -0
  168. package/dist-lib/npm/types/i18n/locale.d.ts +14 -0
  169. package/dist-lib/npm/types/i18n/messages/de/auth.d.ts +2 -0
  170. package/dist-lib/npm/types/i18n/messages/de/calendar.d.ts +3 -0
  171. package/dist-lib/npm/types/i18n/messages/de/calendars.d.ts +2 -0
  172. package/dist-lib/npm/types/i18n/messages/de/core.d.ts +7 -0
  173. package/dist-lib/npm/types/i18n/messages/de/events.d.ts +2 -0
  174. package/dist-lib/npm/types/i18n/messages/de/index.d.ts +2 -0
  175. package/dist-lib/npm/types/i18n/messages/de/settings.d.ts +2 -0
  176. package/dist-lib/npm/types/i18n/messages/de/storage.d.ts +2 -0
  177. package/dist-lib/npm/types/i18n/messages/en/auth.d.ts +97 -0
  178. package/dist-lib/npm/types/i18n/messages/en/calendar.d.ts +34 -0
  179. package/dist-lib/npm/types/i18n/messages/en/calendars.d.ts +177 -0
  180. package/dist-lib/npm/types/i18n/messages/en/core.d.ts +86 -0
  181. package/dist-lib/npm/types/i18n/messages/en/events.d.ts +42 -0
  182. package/dist-lib/npm/types/i18n/messages/en/index.d.ts +466 -0
  183. package/dist-lib/npm/types/i18n/messages/en/settings.d.ts +23 -0
  184. package/dist-lib/npm/types/i18n/messages/en/storage.d.ts +7 -0
  185. package/dist-lib/npm/types/i18n/messages/index.d.ts +4 -0
  186. package/dist-lib/npm/types/i18n/messages/types.d.ts +2 -0
  187. package/dist-lib/npm/types/i18n/useI18n.d.ts +3 -0
  188. package/dist-lib/npm/types/i18n/useLocaleGetter.d.ts +1 -0
  189. package/dist-lib/npm/types/i18n/weekInfo.d.ts +5 -0
  190. package/dist-lib/npm/types/lib/CalendarApp.d.ts +14 -0
  191. package/dist-lib/npm/types/lib/CalendarWidget.d.ts +2 -0
  192. package/dist-lib/npm/types/lib/IsolatedRoot.d.ts +9 -0
  193. package/dist-lib/npm/types/lib/config.d.ts +28 -0
  194. package/dist-lib/npm/types/lib/defaults.d.ts +13 -0
  195. package/dist-lib/npm/types/lib/element.d.ts +16 -0
  196. package/dist-lib/npm/types/lib/eventCallbacks.d.ts +11 -0
  197. package/dist-lib/npm/types/lib/index.d.ts +16 -0
  198. package/dist-lib/npm/types/lib/linkParam.d.ts +2 -0
  199. package/dist-lib/npm/types/lib/version.d.ts +1 -0
  200. package/dist-lib/npm/types/pages/CalendarPage.d.ts +1 -0
  201. package/dist-lib/npm/types/pages/SettingsPage.d.ts +1 -0
  202. package/dist-lib/npm/types/router.d.ts +7 -0
  203. package/dist-lib/npm/types/utils/api.d.ts +32 -0
  204. package/dist-lib/npm/types/utils/apiError.d.ts +26 -0
  205. package/dist-lib/npm/types/utils/appError.d.ts +10 -0
  206. package/dist-lib/npm/types/utils/calendarView.d.ts +3 -0
  207. package/dist-lib/npm/types/utils/classNames.d.ts +2 -0
  208. package/dist-lib/npm/types/utils/color.d.ts +5 -0
  209. package/dist-lib/npm/types/utils/date.d.ts +44 -0
  210. package/dist-lib/npm/types/utils/dom.d.ts +3 -0
  211. package/dist-lib/npm/types/utils/event.d.ts +74 -0
  212. package/dist-lib/npm/types/utils/number.d.ts +1 -0
  213. package/dist-lib/npm/types/utils/object.d.ts +3 -0
  214. package/dist-lib/npm/types/utils/preferences.d.ts +15 -0
  215. package/dist-lib/npm/types/utils/recurrence.d.ts +33 -0
  216. package/dist-lib/npm/types/utils/series.d.ts +9 -0
  217. package/dist-lib/npm/types/utils/validation.d.ts +6 -0
  218. package/package.json +82 -6
@@ -0,0 +1,22 @@
1
+ import type { Messages } from '../../../i18n/index.js';
2
+ import { type FieldErrors } from '../../../utils/validation.js';
3
+ import type { AccountDeletionInput, LoginInput, PasswordResetRequestInput, ProfileInput, RegisterInput } from '../types/auth.js';
4
+ export { EMAIL_MAX_LENGTH, normalizeEmail } from '../../../utils/validation.js';
5
+ export declare const NAME_MAX_LENGTH = 80;
6
+ export declare const PASSWORD_MIN_LENGTH = 8;
7
+ export declare const PASSWORD_MAX_LENGTH = 128;
8
+ export type NewPasswordValues = {
9
+ password: string;
10
+ passwordConfirmation: string;
11
+ };
12
+ export type RegisterFormValues = RegisterInput & NewPasswordValues;
13
+ export type PasswordChangeFormValues = NewPasswordValues & {
14
+ currentPassword: string;
15
+ };
16
+ export declare const validateLogin: ({ email, password }: LoginInput, m: Messages) => FieldErrors<LoginInput>;
17
+ export declare const validateRegister: (values: RegisterFormValues, m: Messages) => FieldErrors<RegisterFormValues>;
18
+ export declare const validateProfile: ({ name }: ProfileInput, m: Messages) => FieldErrors<ProfileInput>;
19
+ export declare const validatePasswordResetRequest: ({ email }: PasswordResetRequestInput, m: Messages) => FieldErrors<PasswordResetRequestInput>;
20
+ export declare const validatePasswordReset: ({ password, passwordConfirmation }: NewPasswordValues, m: Messages) => FieldErrors<NewPasswordValues>;
21
+ export declare const validatePasswordChange: (values: PasswordChangeFormValues, m: Messages) => FieldErrors<PasswordChangeFormValues>;
22
+ export declare const validateAccountDeletion: ({ password }: AccountDeletionInput, m: Messages) => FieldErrors<AccountDeletionInput>;
@@ -0,0 +1,14 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { EventSources } from '../types/eventSource.js';
3
+ import type { CalendarView } from '../types/view.js';
4
+ type CalendarProps = {
5
+ calendarIds: readonly string[];
6
+ targetCalendarId: string;
7
+ canCreate?: boolean;
8
+ eventSources?: EventSources;
9
+ initialView?: CalendarView;
10
+ headerContext?: ReactNode;
11
+ headerAccessory?: ReactNode;
12
+ };
13
+ export declare function Calendar({ calendarIds, targetCalendarId, canCreate, eventSources, initialView, headerContext, headerAccessory, }: CalendarProps): import("react").JSX.Element;
14
+ export {};
@@ -0,0 +1,16 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { CalendarView } from '../types/view.js';
3
+ type CalendarHeaderProps = {
4
+ view: CalendarView;
5
+ title: string;
6
+ subtitle?: string;
7
+ onViewChange: (view: CalendarView) => void;
8
+ onPrevious: () => void;
9
+ onNext: () => void;
10
+ onToday: () => void;
11
+ onCreateEvent?: () => void;
12
+ context?: ReactNode;
13
+ accessory?: ReactNode;
14
+ };
15
+ export declare function CalendarHeader({ view, title, subtitle, onViewChange, onPrevious, onNext, onToday, onCreateEvent, context, accessory, }: CalendarHeaderProps): import("react").JSX.Element;
16
+ export {};
@@ -0,0 +1,18 @@
1
+ import type { EventOccurrence } from '../../../utils/event.js';
2
+ import type { EventSegment } from '../types/eventLayout.js';
3
+ type DayColumnProps = {
4
+ date: string;
5
+ isToday: boolean;
6
+ nowMinutes: number | null;
7
+ segments: readonly EventSegment[];
8
+ selection?: {
9
+ fromHour: number;
10
+ toHour: number;
11
+ label: string | null;
12
+ } | null;
13
+ onSlotSelect: (date: string, hour: number) => void;
14
+ onEventSelect: (event: EventOccurrence) => void;
15
+ onHeaderSelect?: (date: string) => void;
16
+ };
17
+ export declare function DayColumn({ date, isToday, nowMinutes, segments, selection, onSlotSelect, onEventSelect, onHeaderSelect, }: DayColumnProps): import("react").JSX.Element;
18
+ export {};
@@ -0,0 +1,10 @@
1
+ import { type EventOccurrence } from '../../../utils/event.js';
2
+ import type { EventSegment } from '../types/eventLayout.js';
3
+ type EventBlockProps = {
4
+ segment: EventSegment;
5
+ column: number;
6
+ columns: number;
7
+ onSelect: (event: EventOccurrence) => void;
8
+ };
9
+ export declare function EventBlock({ segment, column, columns, onSelect }: EventBlockProps): import("react").JSX.Element;
10
+ export {};
@@ -0,0 +1,8 @@
1
+ import type { EventOccurrence } from '../../../utils/event.js';
2
+ import type { EventSegment } from '../types/eventLayout.js';
3
+ type EventChipProps = {
4
+ segment: EventSegment;
5
+ onSelect: (event: EventOccurrence) => void;
6
+ };
7
+ export declare function EventChip({ segment, onSelect }: EventChipProps): import("react").JSX.Element;
8
+ export {};
@@ -0,0 +1,8 @@
1
+ import type { EventOccurrence } from '../../../utils/event.js';
2
+ import type { EventSource } from '../types/eventSource.js';
3
+ type EventTitleProps = {
4
+ event: EventOccurrence;
5
+ source?: EventSource;
6
+ };
7
+ export declare function EventTitle({ event, source }: EventTitleProps): import("react").JSX.Element;
8
+ export {};
@@ -0,0 +1,9 @@
1
+ type MiniMonthProps = {
2
+ month: string;
3
+ today: string;
4
+ className?: string;
5
+ hasEvents?: (date: string) => boolean;
6
+ onSelectDay?: (date: string) => void;
7
+ };
8
+ export declare function MiniMonth({ month, today, className, hasEvents, onSelectDay }: MiniMonthProps): import("react").JSX.Element;
9
+ export {};
@@ -0,0 +1,8 @@
1
+ import type { ReactNode } from 'react';
2
+ type MonthGridProps = {
3
+ month: string;
4
+ className?: string;
5
+ renderDay: (date: string, isInMonth: boolean) => ReactNode;
6
+ };
7
+ export declare function MonthGrid({ month, className, renderDay }: MonthGridProps): import("react").JSX.Element;
8
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { CalendarViewProps } from '../types/view.js';
2
+ export declare function MonthView({ anchor, today, segmentsByDate, onCreate, onEventSelect, onShowDay }: CalendarViewProps): import("react").JSX.Element;
@@ -0,0 +1,6 @@
1
+ type NowIndicatorProps = {
2
+ minutes: number;
3
+ isToday: boolean;
4
+ };
5
+ export declare function NowIndicator({ minutes, isToday }: NowIndicatorProps): import("react").JSX.Element;
6
+ export {};
@@ -0,0 +1 @@
1
+ export declare function TimeColumn(): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import type { CalendarViewProps } from '../types/view.js';
2
+ export declare function TimeGridView({ dates, today, currentMinutes, segmentsByDate, canCreate, onCreate, onCreateRange, onEventSelect, onShowDay, }: CalendarViewProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import type { CalendarViewProps } from '../types/view.js';
2
+ export declare function YearView({ anchor, today, segmentsByDate, onShowDay, onShowMonth }: CalendarViewProps): import("react").JSX.Element;
@@ -0,0 +1,4 @@
1
+ export declare const HOURS: number[];
2
+ export declare const MIN_VISIBLE_DURATION = 15;
3
+ export declare const DEFAULT_EVENT_HOUR = 9;
4
+ export declare const MAX_EVENTS_PER_MONTH_CELL = 3;
@@ -0,0 +1,7 @@
1
+ import type { Messages } from '../../../i18n/index.js';
2
+ import { type CalendarView, type ViewDefinition } from '../types/view.js';
3
+ export declare const VIEW_DEFINITIONS: Record<CalendarView, ViewDefinition>;
4
+ export declare const getViewOptions: (m: Messages) => {
5
+ value: "day" | "week" | "month" | "year";
6
+ label: string;
7
+ }[];
@@ -0,0 +1,3 @@
1
+ import type { EventSources } from '../types/eventSource.js';
2
+ export declare const NO_EVENT_SOURCES: EventSources;
3
+ export declare const EventSourcesContext: import("react").Context<EventSources>;
@@ -0,0 +1,19 @@
1
+ import type { CalendarView } from '../types/view.js';
2
+ export declare function useCalendarView(initialView?: CalendarView, initialDate?: string): {
3
+ view: "day" | "week" | "month" | "year";
4
+ setView: import("react").Dispatch<import("react").SetStateAction<"day" | "week" | "month" | "year">>;
5
+ anchor: string;
6
+ range: {
7
+ from: string;
8
+ to: string;
9
+ };
10
+ dates: string[];
11
+ definition: import("../types/view.ts").ViewDefinition;
12
+ title: string;
13
+ subtitle: string | undefined;
14
+ previous: () => void;
15
+ next: () => void;
16
+ goToToday: () => void;
17
+ goToDate: (date: string) => void;
18
+ show: (nextView: CalendarView, date: string) => void;
19
+ };
@@ -0,0 +1,2 @@
1
+ import type { CalendarEvent } from '../../../utils/event.js';
2
+ export declare const useEventSource: ({ calendarId }: Pick<CalendarEvent, "calendarId">) => import("../index.ts").EventSource | undefined;
@@ -0,0 +1 @@
1
+ export declare function useNow(): Date;
@@ -0,0 +1,6 @@
1
+ import { type RefObject } from 'react';
2
+ import { type SlotRange, type SlotSelection } from '../utils/slotSelection.js';
3
+ export declare function useSlotSelection(containerRef: RefObject<HTMLElement | null>, enabled: boolean, onSelect: (range: SlotRange) => void): {
4
+ selection: SlotSelection | null;
5
+ isClickSuppressed: () => boolean;
6
+ };
@@ -0,0 +1,4 @@
1
+ export { Calendar } from './components/Calendar.js';
2
+ export { getViewOptions } from './constants/views.js';
3
+ export { MiniMonth } from './components/MiniMonth.js';
4
+ export type { EventSource, EventSources } from './types/eventSource.js';
@@ -0,0 +1,5 @@
1
+ import type { EventInput, EventOccurrence } from '../../../utils/event.js';
2
+ export type EditorState = {
3
+ initialValue: EventInput;
4
+ occurrence: EventOccurrence | null;
5
+ };
@@ -0,0 +1,14 @@
1
+ import type { EventOccurrence } from '../../../utils/event.js';
2
+ export type EventSegment = {
3
+ event: EventOccurrence;
4
+ date: string;
5
+ start: number;
6
+ end: number;
7
+ continuesBefore: boolean;
8
+ continuesAfter: boolean;
9
+ };
10
+ export type PositionedSegment = {
11
+ segment: EventSegment;
12
+ column: number;
13
+ columns: number;
14
+ };
@@ -0,0 +1,6 @@
1
+ import type { EventColor } from '../../../utils/event.js';
2
+ export type EventSource = {
3
+ name: string;
4
+ color: EventColor;
5
+ };
6
+ export type EventSources = ReadonlyMap<string, EventSource>;
@@ -0,0 +1,26 @@
1
+ import type { I18n } from '../../../i18n/index.js';
2
+ import type { DateRange } from '../../../utils/date.js';
3
+ import type { EventOccurrence } from '../../../utils/event.js';
4
+ import type { SlotRange } from '../utils/slotSelection.js';
5
+ import type { EventSegment } from './eventLayout.js';
6
+ export { CALENDAR_VIEWS, type CalendarView } from '../../../utils/calendarView.js';
7
+ export type ViewI18n = Pick<I18n, 'm' | 'format' | 'weekInfo'>;
8
+ export type ViewDefinition = {
9
+ getRange: (anchor: string, firstDay: number) => DateRange;
10
+ step: (anchor: string, direction: 1 | -1) => string;
11
+ getTitle: (anchor: string, i18n: ViewI18n) => string;
12
+ getSubtitle?: (anchor: string, i18n: ViewI18n) => string;
13
+ };
14
+ export type CalendarViewProps = {
15
+ anchor: string;
16
+ dates: readonly string[];
17
+ today: string;
18
+ currentMinutes: number;
19
+ segmentsByDate: ReadonlyMap<string, readonly EventSegment[]>;
20
+ onCreate: (date: string, hour: number) => void;
21
+ onCreateRange: (range: SlotRange) => void;
22
+ canCreate: boolean;
23
+ onEventSelect: (event: EventOccurrence) => void;
24
+ onShowDay: (date: string) => void;
25
+ onShowMonth: (date: string) => void;
26
+ };
@@ -0,0 +1,3 @@
1
+ import type { EventSegment } from '../types/eventLayout.js';
2
+ export declare const getVisibleEnd: ({ start, end }: Pick<EventSegment, "start" | "end">) => number;
3
+ export declare const getVisibleDuration: (segment: Pick<EventSegment, "start" | "end">) => number;
@@ -0,0 +1,15 @@
1
+ import type { I18n } from '../../../i18n/index.js';
2
+ import { type EventOccurrence } from '../../../utils/event.js';
3
+ import type { ClassNameValue } from '../../../utils/classNames.js';
4
+ import type { EventSegment } from '../types/eventLayout.js';
5
+ import type { EventSource } from '../types/eventSource.js';
6
+ type LabelI18n = Pick<I18n, 'm' | 'format'>;
7
+ export declare const getRecurrenceText: (event: EventOccurrence, i18n: LabelI18n) => string | null;
8
+ export declare const getSourceText: (source: EventSource, { m }: LabelI18n) => string;
9
+ export declare const getEventTooltip: (event: EventOccurrence, source: EventSource | undefined, i18n: LabelI18n) => string;
10
+ export declare const getSegmentAttributes: ({ event, continuesBefore, continuesAfter }: EventSegment, source: EventSource | undefined, i18n: LabelI18n, ...classNamesToMerge: ClassNameValue[]) => {
11
+ title: string;
12
+ className?: string;
13
+ style?: import("react").CSSProperties;
14
+ };
15
+ export {};
@@ -0,0 +1,3 @@
1
+ import type { EventSegment, PositionedSegment } from '../types/eventLayout.js';
2
+ export declare const sortSegments: (segments: readonly EventSegment[]) => EventSegment[];
3
+ export declare function layoutEvents(segments: readonly EventSegment[]): PositionedSegment[];
@@ -0,0 +1,5 @@
1
+ import { type DateRange } from '../../../utils/date.js';
2
+ import { type EventOccurrence } from '../../../utils/event.js';
3
+ import type { EventSegment } from '../types/eventLayout.js';
4
+ export declare function splitEventIntoSegments(event: EventOccurrence, { from, to }: DateRange): EventSegment[];
5
+ export declare function groupSegmentsByDate(events: readonly EventOccurrence[], range: DateRange): Map<string, EventSegment[]>;
@@ -0,0 +1,17 @@
1
+ import type { HourSlot } from '../../../utils/event.js';
2
+ export type SlotSelection = {
3
+ anchor: HourSlot;
4
+ current: HourSlot;
5
+ };
6
+ export type SlotRange = {
7
+ first: HourSlot;
8
+ last: HourSlot;
9
+ };
10
+ export declare const isSameSlot: (a: HourSlot | null, b: HourSlot | null) => boolean;
11
+ export declare const toSlotRange: ({ anchor, current }: SlotSelection) => SlotRange;
12
+ export declare const getHoursOnDate: ({ first, last }: SlotRange, date: string) => {
13
+ fromHour: number;
14
+ toHour: number;
15
+ } | null;
16
+ export declare const findSlotAt: (scope: Document | ShadowRoot, x: number, y: number) => HourSlot | null;
17
+ export declare const getSlotFromTarget: (target: EventTarget | null) => HourSlot | null;
@@ -0,0 +1 @@
1
+ export declare function ActiveCalendarIndicator(): import("react").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { type EventColor } from '../../../utils/event.js';
2
+ export declare function CalendarPreview({ color }: {
3
+ color: EventColor;
4
+ }): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function CalendarSettings(): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function CalendarSwitcher(): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function InvitationList(): import("react").JSX.Element | null;
@@ -0,0 +1,7 @@
1
+ import type { EventColor } from '../../../../utils/event.js';
2
+ type ColorStepProps = {
3
+ color: EventColor;
4
+ onChange: (color: EventColor) => void;
5
+ };
6
+ export declare function ColorStep({ color, onChange }: ColorStepProps): import("react").JSX.Element;
7
+ export {};
@@ -0,0 +1 @@
1
+ export declare function CreateCalendarPage(): import("react").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import type { FieldErrors } from '../../../../utils/validation.js';
2
+ import type { DetailsValues } from '../../utils/draft.js';
3
+ type DetailsStepProps = {
4
+ values: DetailsValues;
5
+ errors: FieldErrors<DetailsValues>;
6
+ disabled?: Partial<Record<keyof DetailsValues, boolean>>;
7
+ hideDescription?: boolean;
8
+ autoFocus?: boolean;
9
+ onChange: (changes: Partial<DetailsValues>) => void;
10
+ };
11
+ export declare function DetailsStep({ values, errors, disabled, hideDescription, autoFocus, onChange, }: DetailsStepProps): import("react").JSX.Element;
12
+ export {};
@@ -0,0 +1,8 @@
1
+ import type { Invitation } from '../../types/calendar.js';
2
+ type MembersStepProps = {
3
+ invitations: readonly Invitation[];
4
+ ownEmail: string | null;
5
+ onChange: (invitations: Invitation[]) => void;
6
+ };
7
+ export declare function MembersStep({ invitations, ownEmail, onChange }: MembersStepProps): import("react").JSX.Element;
8
+ export {};
@@ -0,0 +1,4 @@
1
+ import type { CalendarDraft } from '../../types/calendar.js';
2
+ export declare function ReviewStep({ draft }: {
3
+ draft: CalendarDraft;
4
+ }): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function CalendarSettingsPage(): import("react").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import type { CalendarSummary, TeamMember } from '../../types/calendar.js';
2
+ type DangerSectionProps = {
3
+ calendar: CalendarSummary;
4
+ members: readonly TeamMember[];
5
+ currentUserId: string | null;
6
+ onOwnershipTransferred: () => void;
7
+ };
8
+ export declare function DangerSection({ calendar, members, currentUserId, onOwnershipTransferred }: DangerSectionProps): import("react").JSX.Element;
9
+ export {};
@@ -0,0 +1,4 @@
1
+ import type { CalendarSummary } from '../../types/calendar.js';
2
+ export declare function GeneralSection({ calendar }: {
3
+ calendar: CalendarSummary;
4
+ }): import("react").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import type { CalendarSummary, TeamMember, TeamRole } from '../../types/calendar.js';
2
+ type MembersSectionProps = {
3
+ calendar: CalendarSummary;
4
+ members: readonly TeamMember[];
5
+ error: string | null;
6
+ currentUserId: string | null;
7
+ onChangeRole: (userId: string, role: TeamRole) => Promise<void>;
8
+ onRemove: (userId: string) => Promise<void>;
9
+ };
10
+ export declare function MembersSection({ calendar, members, error, currentUserId, onChangeRole, onRemove, }: MembersSectionProps): import("react").JSX.Element;
11
+ export {};
@@ -0,0 +1,12 @@
1
+ import type { CalendarSummary, Invitation, TeamInvitation, TeamMember } from '../../types/calendar.js';
2
+ type TeamInvitationsSectionProps = {
3
+ calendar: CalendarSummary;
4
+ invitations: readonly TeamInvitation[];
5
+ members: readonly TeamMember[];
6
+ error: string | null;
7
+ ownEmail: string | null;
8
+ onInvite: (invitation: Invitation) => Promise<void>;
9
+ onRevoke: (invitationId: string) => Promise<void>;
10
+ };
11
+ export declare function TeamInvitationsSection({ calendar, invitations, members, error, ownEmail, onInvite, onRevoke, }: TeamInvitationsSectionProps): import("react").JSX.Element;
12
+ export {};
@@ -0,0 +1,8 @@
1
+ import type { TeamMember } from '../../types/calendar.js';
2
+ type TransferOwnershipModalProps = {
3
+ candidates: readonly TeamMember[];
4
+ onSelect: (member: TeamMember) => void;
5
+ onClose: () => void;
6
+ };
7
+ export declare function TransferOwnershipModal({ candidates, onSelect, onClose }: TransferOwnershipModalProps): import("react").JSX.Element;
8
+ export {};
@@ -0,0 +1,9 @@
1
+ import type { CalendarDraft, CalendarSummary, InvitableRole, TeamRole } from '../types/calendar.js';
2
+ export declare const CALENDAR_NAME_MAX_LENGTH = 80;
3
+ export declare const CALENDAR_DESCRIPTION_MAX_LENGTH = 500;
4
+ export declare const MAX_INVITATIONS = 50;
5
+ export declare const PERSONAL_CALENDAR: CalendarSummary;
6
+ export declare const EMPTY_CALENDAR_DRAFT: CalendarDraft;
7
+ export declare const ROLE_HIERARCHY: Record<TeamRole, number>;
8
+ export declare const INVITABLE_ROLES: readonly InvitableRole[];
9
+ export declare const DEFAULT_INVITATION_ROLE: InvitableRole;
@@ -0,0 +1,2 @@
1
+ import type { CalendarsContextValue } from '../types/calendar.js';
2
+ export declare const CalendarsContext: import("react").Context<CalendarsContextValue | null>;
@@ -0,0 +1,8 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { CalendarRepository } from '../types/calendar.js';
3
+ type CalendarsProviderProps = {
4
+ repository: CalendarRepository;
5
+ children: ReactNode;
6
+ };
7
+ export declare function CalendarsProvider({ repository, children }: CalendarsProviderProps): import("react").JSX.Element;
8
+ export {};
@@ -0,0 +1 @@
1
+ export declare const useCalendars: () => import("../types/calendar.ts").CalendarsContextValue;
@@ -0,0 +1,12 @@
1
+ import type { CalendarSummary, Invitation, TeamInvitation, TeamMember, TeamRole } from '../types/calendar.js';
2
+ export declare function useTeam(calendar: CalendarSummary): {
3
+ reloadMembers: () => void;
4
+ members: TeamMember[];
5
+ membersError: string | null;
6
+ invitations: TeamInvitation[];
7
+ invitationsError: string | null;
8
+ changeRole: (userId: string, role: TeamRole) => Promise<void>;
9
+ removeMember: (userId: string) => Promise<void>;
10
+ invite: (invitation: Invitation) => Promise<void>;
11
+ revokeInvitation: (invitationId: string) => Promise<void>;
12
+ };
@@ -0,0 +1,11 @@
1
+ export { CalendarsProvider } from './context/CalendarsProvider.js';
2
+ export { useCalendars } from './hooks/useCalendars.js';
3
+ export { CalendarSettings } from './components/CalendarSettings.js';
4
+ export { CalendarSettingsPage } from './components/settings/CalendarSettingsPage.js';
5
+ export { CreateCalendarPage } from './components/create/CreateCalendarPage.js';
6
+ export { CalendarSwitcher } from './components/CalendarSwitcher.js';
7
+ export { ActiveCalendarIndicator } from './components/ActiveCalendarIndicator.js';
8
+ export { getSharedCalendars, getVisibleCalendarIds, hasPermission, isPersonalCalendar } from './utils/permissions.js';
9
+ export { LocalCalendarRepository } from './repositories/LocalCalendarRepository.js';
10
+ export { RemoteCalendarRepository } from './repositories/RemoteCalendarRepository.js';
11
+ export type { CalendarChanges, CalendarDraft, CalendarKind, CalendarRepository, CalendarSummary, InvitableRole, Invitation, PendingInvitation, Permission, TeamChanges, TeamInvitation, TeamMember, TeamRole, } from './types/calendar.js';
@@ -0,0 +1,20 @@
1
+ import type { CalendarRepository } from '../types/calendar.js';
2
+ export declare class LocalCalendarRepository implements CalendarRepository {
3
+ list(): Promise<import("../index.ts").CalendarSummary[]>;
4
+ listInvitations(): Promise<never[]>;
5
+ create: () => Promise<never>;
6
+ leave: () => Promise<never>;
7
+ setShowInPersonal: () => Promise<never>;
8
+ acceptInvitation: () => Promise<never>;
9
+ declineInvitation: () => Promise<never>;
10
+ updateCalendar: () => Promise<never>;
11
+ updateTeam: () => Promise<never>;
12
+ deleteTeam: () => Promise<never>;
13
+ transferOwnership: () => Promise<never>;
14
+ listMembers: () => Promise<never>;
15
+ changeMemberRole: () => Promise<never>;
16
+ removeMember: () => Promise<never>;
17
+ listTeamInvitations: () => Promise<never>;
18
+ invite: () => Promise<never>;
19
+ revokeInvitation: () => Promise<never>;
20
+ }
@@ -0,0 +1,23 @@
1
+ import { type ApiClient } from '../../../utils/api.js';
2
+ import type { CalendarChanges, CalendarDraft, CalendarRepository, CalendarSummary, Invitation, PendingInvitation, TeamChanges, TeamInvitation, TeamMember, TeamRole } from '../types/calendar.js';
3
+ export declare class RemoteCalendarRepository implements CalendarRepository {
4
+ #private;
5
+ constructor(api: ApiClient);
6
+ list(): Promise<CalendarSummary[]>;
7
+ create({ name, description, color, invitations }: CalendarDraft): Promise<CalendarSummary>;
8
+ leave(teamId: string): Promise<void>;
9
+ updateCalendar(calendarId: string, changes: CalendarChanges): Promise<CalendarSummary>;
10
+ updateTeam(teamId: string, changes: TeamChanges): Promise<CalendarSummary[]>;
11
+ deleteTeam(teamId: string): Promise<void>;
12
+ transferOwnership(teamId: string, userId: string): Promise<CalendarSummary[]>;
13
+ listMembers(teamId: string): Promise<TeamMember[]>;
14
+ changeMemberRole(teamId: string, userId: string, role: TeamRole): Promise<TeamMember>;
15
+ removeMember(teamId: string, userId: string): Promise<void>;
16
+ listTeamInvitations(teamId: string): Promise<TeamInvitation[]>;
17
+ invite(teamId: string, invitation: Invitation): Promise<TeamInvitation>;
18
+ revokeInvitation(teamId: string, invitationId: string): Promise<void>;
19
+ setShowInPersonal(calendarId: string, showInPersonal: boolean): Promise<CalendarSummary>;
20
+ listInvitations(): Promise<PendingInvitation[]>;
21
+ acceptInvitation(id: string): Promise<CalendarSummary[]>;
22
+ declineInvitation(id: string): Promise<void>;
23
+ }