@midnight-owl/ui 1.0.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 (69) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +68 -0
  3. package/dist/components/buttons/Button.vue.d.ts +44 -0
  4. package/dist/components/buttons/ButtonGroup.vue.d.ts +19 -0
  5. package/dist/components/data-display/Badge.vue.d.ts +34 -0
  6. package/dist/components/data-display/BubbleChat.vue.d.ts +52 -0
  7. package/dist/components/data-display/Image.vue.d.ts +56 -0
  8. package/dist/components/data-display/Pagination.vue.d.ts +60 -0
  9. package/dist/components/data-display/ProgressBar.vue.d.ts +34 -0
  10. package/dist/components/data-display/SkeletonLoader.vue.d.ts +14 -0
  11. package/dist/components/data-display/Table.vue.d.ts +182 -0
  12. package/dist/components/data-display/calendar/Calendar.vue.d.ts +116 -0
  13. package/dist/components/data-display/calendar/CalendarAgendaView.vue.d.ts +31 -0
  14. package/dist/components/data-display/calendar/CalendarEventDetails.vue.d.ts +23 -0
  15. package/dist/components/data-display/calendar/CalendarEventPill.vue.d.ts +39 -0
  16. package/dist/components/data-display/calendar/CalendarEventPopover.vue.d.ts +68 -0
  17. package/dist/components/data-display/calendar/CalendarMonthView.vue.d.ts +54 -0
  18. package/dist/components/data-display/calendar/CalendarTimeGridView.vue.d.ts +47 -0
  19. package/dist/components/data-display/calendar/CalendarYearView.vue.d.ts +17 -0
  20. package/dist/components/data-display/calendar/layout.d.ts +39 -0
  21. package/dist/components/data-display/calendar/providers/google.d.ts +16 -0
  22. package/dist/components/data-display/calendar/providers/ics.d.ts +23 -0
  23. package/dist/components/data-display/calendar/recurrence.d.ts +12 -0
  24. package/dist/components/data-display/calendar/types.d.ts +154 -0
  25. package/dist/components/data-display/calendar/tz.d.ts +17 -0
  26. package/dist/components/data-display/calendar/useCalendar.d.ts +75 -0
  27. package/dist/components/form-element/Autocomplete.vue.d.ts +78 -0
  28. package/dist/components/form-element/Checkbox.vue.d.ts +47 -0
  29. package/dist/components/form-element/DatePicker.vue.d.ts +75 -0
  30. package/dist/components/form-element/FileUpload.vue.d.ts +125 -0
  31. package/dist/components/form-element/InputGroup.vue.d.ts +26 -0
  32. package/dist/components/form-element/InputMask.vue.d.ts +43 -0
  33. package/dist/components/form-element/InputNumber.vue.d.ts +50 -0
  34. package/dist/components/form-element/InputOtp.vue.d.ts +44 -0
  35. package/dist/components/form-element/InputPassword.vue.d.ts +44 -0
  36. package/dist/components/form-element/InputText.vue.d.ts +42 -0
  37. package/dist/components/form-element/Radio.vue.d.ts +42 -0
  38. package/dist/components/form-element/TextEditor.vue.d.ts +44 -0
  39. package/dist/components/form-element/Textarea.vue.d.ts +46 -0
  40. package/dist/components/form-element/Toggle.vue.d.ts +25 -0
  41. package/dist/components/form-element/select/Select.vue.d.ts +168 -0
  42. package/dist/components/form-element/select/SelectOption.vue.d.ts +23 -0
  43. package/dist/components/form-element/text-editor-toolbar.d.ts +5 -0
  44. package/dist/components/panel/Breadcrumb.vue.d.ts +50 -0
  45. package/dist/components/panel/Card.vue.d.ts +28 -0
  46. package/dist/components/panel/Divider.vue.d.ts +28 -0
  47. package/dist/components/panel/DropDown.vue.d.ts +26 -0
  48. package/dist/components/panel/Modal.vue.d.ts +80 -0
  49. package/dist/components/panel/Popover.vue.d.ts +68 -0
  50. package/dist/components/panel/ScrollPanel.vue.d.ts +26 -0
  51. package/dist/components/panel/Stepper.vue.d.ts +179 -0
  52. package/dist/components/panel/Tabs.vue.d.ts +31 -0
  53. package/dist/components/panel/Toolbar.vue.d.ts +30 -0
  54. package/dist/components/panel/accordion/Accordion.vue.d.ts +31 -0
  55. package/dist/components/panel/accordion/AccordionPanel.vue.d.ts +35 -0
  56. package/dist/components/panel/toast/ToastErrorNode.vue.d.ts +10 -0
  57. package/dist/components/panel/toast/ToastItem.vue.d.ts +14 -0
  58. package/dist/components/panel/toast/ToastProvider.vue.d.ts +3 -0
  59. package/dist/components/panel/toast/errorTree.d.ts +12 -0
  60. package/dist/components/panel/toast/useToast.d.ts +164 -0
  61. package/dist/index.d.ts +60 -0
  62. package/dist/plugins/init-icons.d.ts +1 -0
  63. package/dist/plugins/init-theme.d.ts +4 -0
  64. package/dist/theme/presets.d.ts +75 -0
  65. package/dist/theme/remote.d.ts +2 -0
  66. package/dist/ui.css +3 -0
  67. package/dist/ui.es.js +29640 -0
  68. package/dist/ui.umd.js +234 -0
  69. package/package.json +82 -0
@@ -0,0 +1,116 @@
1
+ import { type Locale } from 'date-fns';
2
+ import type { BusinessHours, CalendarEvent, CalendarProvider, CalendarSize, CalendarView, EventChange, NormalizedEvent, RangeSelection, WeekdayIndex } from './types';
3
+ interface Props {
4
+ /** Active view. Also emits `update:view` so it works with v-model:view. */
5
+ view?: CalendarView;
6
+ /** Focal date. Emits `update:date` on navigation for v-model:date. */
7
+ date?: Date | string;
8
+ events?: CalendarEvent[];
9
+ size?: CalendarSize;
10
+ firstDayOfWeek?: WeekdayIndex;
11
+ timeZone?: string;
12
+ locale?: Locale;
13
+ provider?: CalendarProvider;
14
+ dayStartHour?: number;
15
+ dayEndHour?: number;
16
+ agendaDayCount?: number;
17
+ businessHours?: BusinessHours | boolean;
18
+ /** Which view buttons to show in the toolbar. Defaults to all five. */
19
+ availableViews?: CalendarView[];
20
+ /** Show the built-in toolbar (nav + title + view switcher). */
21
+ showToolbar?: boolean;
22
+ /** Show the toolbar's prev/next navigation buttons. */
23
+ showNav?: boolean;
24
+ /** Show the toolbar's Today button. */
25
+ showToday?: boolean;
26
+ /** Show the toolbar's period title (cal.title). */
27
+ showTitle?: boolean;
28
+ /** Below the `sm` breakpoint, swap month→agenda and week→day for readability. */
29
+ mobileFallback?: boolean;
30
+ /** Master switch for drag/resize/edit/delete affordances. */
31
+ editable?: boolean;
32
+ /** Open the built-in event popover on click (else just emit `event-click`). */
33
+ showPopover?: boolean;
34
+ /** Show the toolbar's print button. */
35
+ printable?: boolean;
36
+ /** Show the built-in loading spinner (ORed with a provider fetch's own isLoading). */
37
+ loading?: boolean;
38
+ /** Show the built-in error banner (ORed with a provider fetch's own error). */
39
+ error?: string | Error | null;
40
+ /** T = today, ←/→ = prev/next, M/W/D = switch view. Scoped to this instance's own focus. */
41
+ keyboardShortcuts?: boolean;
42
+ }
43
+ declare var __VLS_1: {
44
+ cal: import("./useCalendar").UseCalendarReturn;
45
+ title: string;
46
+ view: CalendarView;
47
+ next: () => void;
48
+ prev: () => void;
49
+ today: () => void;
50
+ setView: (view: CalendarView) => void;
51
+ }, __VLS_79: any, __VLS_82: any, __VLS_85: {}, __VLS_97: {
52
+ event: NormalizedEvent;
53
+ close: () => void;
54
+ edit: () => void;
55
+ delete: () => void;
56
+ };
57
+ type __VLS_Slots = {} & {
58
+ toolbar?: (props: typeof __VLS_1) => any;
59
+ } & {
60
+ event?: (props: typeof __VLS_79) => any;
61
+ } & {
62
+ dayCell?: (props: typeof __VLS_82) => any;
63
+ } & {
64
+ empty?: (props: typeof __VLS_85) => any;
65
+ } & {
66
+ eventPopover?: (props: typeof __VLS_97) => any;
67
+ };
68
+ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
69
+ "event-click": (event: NormalizedEvent, native: MouseEvent) => any;
70
+ "date-click": (date: Date) => any;
71
+ "event-drag": (event: NormalizedEvent, change: EventChange) => any;
72
+ "event-resize": (event: NormalizedEvent, change: EventChange) => any;
73
+ "range-select": (range: RangeSelection) => any;
74
+ "update:view": (view: CalendarView) => any;
75
+ "update:date": (date: Date) => any;
76
+ "view-change": (view: CalendarView) => any;
77
+ "event-edit": (event: NormalizedEvent) => any;
78
+ "event-delete": (event: NormalizedEvent) => any;
79
+ retry: () => any;
80
+ }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
81
+ "onEvent-click"?: ((event: NormalizedEvent, native: MouseEvent) => any) | undefined;
82
+ "onDate-click"?: ((date: Date) => any) | undefined;
83
+ "onEvent-drag"?: ((event: NormalizedEvent, change: EventChange) => any) | undefined;
84
+ "onEvent-resize"?: ((event: NormalizedEvent, change: EventChange) => any) | undefined;
85
+ "onRange-select"?: ((range: RangeSelection) => any) | undefined;
86
+ "onUpdate:view"?: ((view: CalendarView) => any) | undefined;
87
+ "onUpdate:date"?: ((date: Date) => any) | undefined;
88
+ "onView-change"?: ((view: CalendarView) => any) | undefined;
89
+ "onEvent-edit"?: ((event: NormalizedEvent) => any) | undefined;
90
+ "onEvent-delete"?: ((event: NormalizedEvent) => any) | undefined;
91
+ onRetry?: (() => any) | undefined;
92
+ }>, {
93
+ size: CalendarSize;
94
+ loading: boolean;
95
+ view: CalendarView;
96
+ error: string | Error | null;
97
+ editable: boolean;
98
+ firstDayOfWeek: WeekdayIndex;
99
+ availableViews: CalendarView[];
100
+ showToolbar: boolean;
101
+ showNav: boolean;
102
+ showToday: boolean;
103
+ showTitle: boolean;
104
+ mobileFallback: boolean;
105
+ showPopover: boolean;
106
+ printable: boolean;
107
+ keyboardShortcuts: boolean;
108
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
109
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
110
+ declare const _default: typeof __VLS_export;
111
+ export default _default;
112
+ type __VLS_WithSlots<T, S> = T & {
113
+ new (): {
114
+ $slots: S;
115
+ };
116
+ };
@@ -0,0 +1,31 @@
1
+ import type { CalendarSize, NormalizedEvent } from './types';
2
+ import type { UseCalendarReturn } from './useCalendar';
3
+ interface Props {
4
+ cal: UseCalendarReturn;
5
+ size?: CalendarSize;
6
+ }
7
+ declare var __VLS_1: {
8
+ event: NormalizedEvent;
9
+ timeLabel: string;
10
+ display: string;
11
+ }, __VLS_8: {};
12
+ type __VLS_Slots = {} & {
13
+ event?: (props: typeof __VLS_1) => any;
14
+ } & {
15
+ empty?: (props: typeof __VLS_8) => any;
16
+ };
17
+ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
18
+ "event-click": (event: NormalizedEvent, native: MouseEvent) => any;
19
+ "date-click": (date: Date) => any;
20
+ }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
21
+ "onEvent-click"?: ((event: NormalizedEvent, native: MouseEvent) => any) | undefined;
22
+ "onDate-click"?: ((date: Date) => any) | undefined;
23
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
24
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
25
+ declare const _default: typeof __VLS_export;
26
+ export default _default;
27
+ type __VLS_WithSlots<T, S> = T & {
28
+ new (): {
29
+ $slots: S;
30
+ };
31
+ };
@@ -0,0 +1,23 @@
1
+ import type { NormalizedEvent } from './types';
2
+ interface Props {
3
+ event: NormalizedEvent;
4
+ /** Pre-formatted, timezone-aware date/time range from the parent. */
5
+ whenText?: string;
6
+ /** Show the Edit/Delete footer (event is editable and the source allows it). */
7
+ editable?: boolean;
8
+ /** Whether a delete affordance is available (provider supports it, etc.). */
9
+ canDelete?: boolean;
10
+ }
11
+ declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
12
+ delete: () => any;
13
+ edit: () => any;
14
+ }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
15
+ onDelete?: (() => any) | undefined;
16
+ onEdit?: (() => any) | undefined;
17
+ }>, {
18
+ editable: boolean;
19
+ whenText: string;
20
+ canDelete: boolean;
21
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
22
+ declare const _default: typeof __VLS_export;
23
+ export default _default;
@@ -0,0 +1,39 @@
1
+ import type { NormalizedEvent } from './types';
2
+ interface Props {
3
+ event: NormalizedEvent;
4
+ /**
5
+ * dot = compact month chip, block = time-grid fill, list = agenda row,
6
+ * bar = continuous multi-day/all-day span (month grid + all-day gutter).
7
+ */
8
+ display?: 'dot' | 'block' | 'list' | 'bar';
9
+ /** Localized time label, computed by the parent (timezone-aware). */
10
+ timeLabel?: string;
11
+ size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
12
+ /**
13
+ * For `block` display: the rendered band is too short for the stacked
14
+ * title/time/location layout, so collapse to a single truncated line. Set by
15
+ * the time-grid view from the event's actual pixel height.
16
+ */
17
+ compact?: boolean;
18
+ /** For `bar` display: the span is clipped at this row's start edge (earlier). */
19
+ continuesBefore?: boolean;
20
+ /** For `bar` display: the span is clipped at this row's end edge (later). */
21
+ continuesAfter?: boolean;
22
+ /**
23
+ * Show timeLabel even when event.allDay — used by the month-grid drag
24
+ * ghost, which always wants its live date-range text regardless of the
25
+ * real event's own all-day-ness.
26
+ */
27
+ forceShowTimeLabel?: boolean;
28
+ }
29
+ declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
30
+ size: "xs" | "sm" | "md" | "lg" | "xl";
31
+ compact: boolean;
32
+ display: "dot" | "block" | "list" | "bar";
33
+ timeLabel: string;
34
+ continuesBefore: boolean;
35
+ continuesAfter: boolean;
36
+ forceShowTimeLabel: boolean;
37
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
38
+ declare const _default: typeof __VLS_export;
39
+ export default _default;
@@ -0,0 +1,68 @@
1
+ import type { PopoverVirtualReference } from '../../panel/Popover.vue';
2
+ import type { Boundary } from '@floating-ui/vue';
3
+ import type { CalendarSize, NormalizedEvent } from './types';
4
+ interface Props {
5
+ /** Virtual anchor (the clicked pill's rect). Passed straight to Popover. */
6
+ reference?: PopoverVirtualReference | null;
7
+ event?: NormalizedEvent | null;
8
+ /** Pre-formatted, timezone-aware date/time range from the parent. */
9
+ whenText?: string;
10
+ editable?: boolean;
11
+ canDelete?: boolean;
12
+ /**
13
+ * Present as a bottom sheet instead of a floating popover. Driven by the
14
+ * parent's existing mobile detection — presentational only, no forked state.
15
+ */
16
+ mobile?: boolean;
17
+ size?: CalendarSize;
18
+ /** Forwarded to the underlying Popover's collision boundary. */
19
+ boundary?: Boundary;
20
+ }
21
+ type __VLS_Props = Props;
22
+ type __VLS_ModelProps = {
23
+ modelValue?: boolean;
24
+ };
25
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
26
+ declare var __VLS_9: {
27
+ event: NormalizedEvent;
28
+ close: () => void;
29
+ edit: () => void;
30
+ delete: () => void;
31
+ }, __VLS_37: {
32
+ event: NormalizedEvent;
33
+ close: () => void;
34
+ edit: () => void;
35
+ delete: () => void;
36
+ };
37
+ type __VLS_Slots = {} & {
38
+ default?: (props: typeof __VLS_9) => any;
39
+ } & {
40
+ default?: (props: typeof __VLS_37) => any;
41
+ };
42
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
43
+ "update:modelValue": (value: boolean) => any;
44
+ } & {
45
+ close: () => any;
46
+ delete: (event: NormalizedEvent) => any;
47
+ edit: (event: NormalizedEvent) => any;
48
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
49
+ "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
50
+ onClose?: (() => any) | undefined;
51
+ onDelete?: ((event: NormalizedEvent) => any) | undefined;
52
+ onEdit?: ((event: NormalizedEvent) => any) | undefined;
53
+ }>, {
54
+ mobile: boolean;
55
+ reference: PopoverVirtualReference | null;
56
+ editable: boolean;
57
+ event: NormalizedEvent | null;
58
+ whenText: string;
59
+ canDelete: boolean;
60
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
61
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
62
+ declare const _default: typeof __VLS_export;
63
+ export default _default;
64
+ type __VLS_WithSlots<T, S> = T & {
65
+ new (): {
66
+ $slots: S;
67
+ };
68
+ };
@@ -0,0 +1,54 @@
1
+ import type { CalendarDayCell, CalendarSize, EventChange, NormalizedEvent, RangeSelection } from './types';
2
+ import type { UseCalendarReturn } from './useCalendar';
3
+ interface Props {
4
+ cal: UseCalendarReturn;
5
+ size?: CalendarSize;
6
+ editable?: boolean;
7
+ /** Max stacked rows (spanning bars + chips) per cell before a "+N more" row. */
8
+ maxPerCell?: number;
9
+ }
10
+ declare var __VLS_1: {
11
+ cell: CalendarDayCell;
12
+ }, __VLS_3: {
13
+ event: NormalizedEvent;
14
+ timeLabel: string;
15
+ compact: boolean;
16
+ display: string;
17
+ }, __VLS_23: {
18
+ event: NormalizedEvent;
19
+ timeLabel: string;
20
+ compact: boolean;
21
+ display: string;
22
+ };
23
+ type __VLS_Slots = {} & {
24
+ dayCell?: (props: typeof __VLS_1) => any;
25
+ } & {
26
+ event?: (props: typeof __VLS_3) => any;
27
+ } & {
28
+ event?: (props: typeof __VLS_23) => any;
29
+ };
30
+ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
31
+ "event-click": (event: NormalizedEvent, native: MouseEvent) => any;
32
+ "date-click": (date: Date) => any;
33
+ "event-drag": (event: NormalizedEvent, change: EventChange) => any;
34
+ "event-resize": (event: NormalizedEvent, change: EventChange) => any;
35
+ "range-select": (range: RangeSelection) => any;
36
+ }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
37
+ "onEvent-click"?: ((event: NormalizedEvent, native: MouseEvent) => any) | undefined;
38
+ "onDate-click"?: ((date: Date) => any) | undefined;
39
+ "onEvent-drag"?: ((event: NormalizedEvent, change: EventChange) => any) | undefined;
40
+ "onEvent-resize"?: ((event: NormalizedEvent, change: EventChange) => any) | undefined;
41
+ "onRange-select"?: ((range: RangeSelection) => any) | undefined;
42
+ }>, {
43
+ size: CalendarSize;
44
+ editable: boolean;
45
+ maxPerCell: number;
46
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
47
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
48
+ declare const _default: typeof __VLS_export;
49
+ export default _default;
50
+ type __VLS_WithSlots<T, S> = T & {
51
+ new (): {
52
+ $slots: S;
53
+ };
54
+ };
@@ -0,0 +1,47 @@
1
+ import type { CalendarSize, EventChange, NormalizedEvent, RangeSelection } from './types';
2
+ import type { UseCalendarReturn } from './useCalendar';
3
+ interface Props {
4
+ cal: UseCalendarReturn;
5
+ size?: CalendarSize;
6
+ editable?: boolean;
7
+ }
8
+ declare var __VLS_1: {
9
+ event: NormalizedEvent;
10
+ timeLabel: string;
11
+ compact: boolean;
12
+ display: string;
13
+ }, __VLS_8: {
14
+ event: NormalizedEvent;
15
+ timeLabel: string;
16
+ compact: boolean;
17
+ display: string;
18
+ };
19
+ type __VLS_Slots = {} & {
20
+ event?: (props: typeof __VLS_1) => any;
21
+ } & {
22
+ event?: (props: typeof __VLS_8) => any;
23
+ };
24
+ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
25
+ "event-click": (event: NormalizedEvent, native: MouseEvent) => any;
26
+ "date-click": (date: Date) => any;
27
+ "event-drag": (event: NormalizedEvent, change: EventChange) => any;
28
+ "event-resize": (event: NormalizedEvent, change: EventChange) => any;
29
+ "range-select": (range: RangeSelection) => any;
30
+ }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
31
+ "onEvent-click"?: ((event: NormalizedEvent, native: MouseEvent) => any) | undefined;
32
+ "onDate-click"?: ((date: Date) => any) | undefined;
33
+ "onEvent-drag"?: ((event: NormalizedEvent, change: EventChange) => any) | undefined;
34
+ "onEvent-resize"?: ((event: NormalizedEvent, change: EventChange) => any) | undefined;
35
+ "onRange-select"?: ((range: RangeSelection) => any) | undefined;
36
+ }>, {
37
+ size: CalendarSize;
38
+ editable: boolean;
39
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
40
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
41
+ declare const _default: typeof __VLS_export;
42
+ export default _default;
43
+ type __VLS_WithSlots<T, S> = T & {
44
+ new (): {
45
+ $slots: S;
46
+ };
47
+ };
@@ -0,0 +1,17 @@
1
+ import type { CalendarSize } from './types';
2
+ import type { UseCalendarReturn } from './useCalendar';
3
+ interface Props {
4
+ cal: UseCalendarReturn;
5
+ size?: CalendarSize;
6
+ }
7
+ declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
8
+ "date-click": (date: Date) => any;
9
+ "month-click": (date: Date) => any;
10
+ }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
11
+ "onDate-click"?: ((date: Date) => any) | undefined;
12
+ "onMonth-click"?: ((date: Date) => any) | undefined;
13
+ }>, {
14
+ size: CalendarSize;
15
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
+ declare const _default: typeof __VLS_export;
17
+ export default _default;
@@ -0,0 +1,39 @@
1
+ import type { NormalizedEvent } from './types';
2
+ export interface PositionedEvent {
3
+ event: NormalizedEvent;
4
+ /** Top offset as a 0–100 percentage of the visible grid height. */
5
+ top: number;
6
+ /** Height as a 0–100 percentage of the visible grid height. */
7
+ height: number;
8
+ /** 0-based column within its overlap cluster. */
9
+ lane: number;
10
+ /** Total columns in this event's overlap cluster. */
11
+ lanes: number;
12
+ }
13
+ export interface DayLayoutOptions {
14
+ dayStartHour: number;
15
+ dayEndHour: number;
16
+ timeZone?: string;
17
+ /** Minimum band height in percent so a short event stays clickable. */
18
+ minHeightPct?: number;
19
+ }
20
+ export declare function layoutDayEvents(events: NormalizedEvent[], options: DayLayoutOptions): PositionedEvent[];
21
+ export interface SpanSegment {
22
+ event: NormalizedEvent;
23
+ /** First covered column within this row (0-based, inclusive). */
24
+ startCol: number;
25
+ /** Last covered column within this row (0-based, inclusive). */
26
+ endCol: number;
27
+ /** Vertical lane within the row; bars on the same lane never overlap. */
28
+ lane: number;
29
+ /** The event's true start is earlier than this row — clip/chevron the left edge. */
30
+ continuesBefore: boolean;
31
+ /** The event's true end is later than this row — clip/chevron the right edge. */
32
+ continuesAfter: boolean;
33
+ }
34
+ export interface SpanLayout {
35
+ segments: SpanSegment[];
36
+ /** Highest lane index used + 1 (0 when the row has no spanning events). */
37
+ laneCount: number;
38
+ }
39
+ export declare function layoutSpanRow(days: Date[], events: NormalizedEvent[]): SpanLayout;
@@ -0,0 +1,16 @@
1
+ import type { CalendarProvider, CalendarProviderAuth } from '../types';
2
+ export interface GoogleAdapterOptions {
3
+ /** Returns a valid OAuth 2.0 access token (Calendar scope). You own the flow. */
4
+ getAccessToken: () => string | Promise<string>;
5
+ /** Target calendar. Defaults to the signed-in user's `primary` calendar. */
6
+ calendarId?: string;
7
+ name?: string;
8
+ /** Optional sign-in/out surface, forwarded to the composable's connect/disconnect. */
9
+ auth?: CalendarProviderAuth;
10
+ }
11
+ /**
12
+ * Build a read/write CalendarProvider for Google Calendar. Requires a
13
+ * `getAccessToken` — see the file header on why the OAuth flow itself is
14
+ * out of scope for this PR.
15
+ */
16
+ export declare function createGoogleAdapter(options: GoogleAdapterOptions): CalendarProvider;
@@ -0,0 +1,23 @@
1
+ import type { CalendarEvent, CalendarProvider } from '../types';
2
+ /** Parse a full ICS document into CalendarEvents. */
3
+ export declare function parseIcs(text: string): CalendarEvent[];
4
+ /** Serialize CalendarEvents into a complete ICS document. */
5
+ export declare function generateIcs(events: CalendarEvent[], meta?: {
6
+ prodId?: string;
7
+ calName?: string;
8
+ }): string;
9
+ export interface IcsAdapterOptions {
10
+ /**
11
+ * The ICS document. A string, or a (possibly async) getter — e.g. one that
12
+ * `fetch`es a subscription URL. Called on every `fetchEvents`, so a getter
13
+ * can return fresh data.
14
+ */
15
+ source: string | (() => string | Promise<string>);
16
+ name?: string;
17
+ }
18
+ /**
19
+ * Build a read-only CalendarProvider backed by an ICS document. Mutation hooks
20
+ * are intentionally omitted — a `.ics` file/feed is a snapshot, not a writable
21
+ * store — so the UI hides create/edit/delete affordances automatically.
22
+ */
23
+ export declare function createIcsAdapter(options: IcsAdapterOptions): CalendarProvider;
@@ -0,0 +1,12 @@
1
+ import type { DateRange, RecurrenceRule } from './types';
2
+ /**
3
+ * Expand a recurring series into the concrete occurrence **start** dates that
4
+ * fall within `range` (padded by the caller for multi-day overlap). Returns an
5
+ * ascending list; the caller reapplies the event's duration to derive each end.
6
+ *
7
+ * `count` is measured from the true series start, so when it's set we generate
8
+ * from `dtstart` to honor it exactly. When it's absent, we fast-forward close to
9
+ * the range first — otherwise a long-running rule would generate every
10
+ * occurrence since its start just to reach the visible range.
11
+ */
12
+ export declare function expandRecurrence(dtstart: Date, rule: RecurrenceRule, range: DateRange): Date[];
@@ -0,0 +1,154 @@
1
+ /** The five first-class layouts. Keyed everywhere as a Record, never branched. */
2
+ export type CalendarView = 'month' | 'week' | 'day' | 'agenda' | 'year';
3
+ /** Density scale, shared with the rest of the library's `size` convention. */
4
+ export type CalendarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
5
+ /**
6
+ * Event color intent. The six standard library severities only — the calendar
7
+ * deliberately does not introduce its own color system (see PROJECT.md's
8
+ * theming rule); an event's color is always one of these semantic tokens.
9
+ */
10
+ export type EventSeverity = 'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'info';
11
+ /** 0 = Sunday … 6 = Saturday, matching JS `Date.getDay()` and date-fns. */
12
+ export type WeekdayIndex = 0 | 1 | 2 | 3 | 4 | 5 | 6;
13
+ /** Accepted anywhere a weekday is named — numeric index or the iCal 2-letter code. */
14
+ export type WeekdayCode = 'su' | 'mo' | 'tu' | 'we' | 'th' | 'fr' | 'sa';
15
+ export type Weekday = WeekdayIndex | WeekdayCode;
16
+ /**
17
+ * Hand-rolled recurrence rule — a pragmatic subset of RFC 5545's RRULE that
18
+ * covers the overwhelming majority of real calendars without pulling in the
19
+ * `rrule` dependency. Expanded by `expandRecurrence()`; unsupported edge cases
20
+ * (BYSETPOS, BYYEARDAY, nested FREQ) are intentionally out of scope.
21
+ */
22
+ export interface RecurrenceRule {
23
+ freq: 'daily' | 'weekly' | 'monthly' | 'yearly';
24
+ /** Step between occurrences in `freq` units. Defaults to 1. */
25
+ interval?: number;
26
+ /** Total number of occurrences, counted from the series start (inclusive). */
27
+ count?: number;
28
+ /** Last date an occurrence may fall on (inclusive). Date or ISO string. */
29
+ until?: Date | string;
30
+ /** For `weekly` (and as a filter for `monthly`/`yearly`): which weekdays. */
31
+ byWeekday?: Weekday[];
32
+ /** For `monthly`/`yearly`: which day-of-month numbers (1–31). */
33
+ byMonthday?: number[];
34
+ /** Dates to skip even though the rule would otherwise generate them (EXDATE). */
35
+ exceptions?: (Date | string)[];
36
+ }
37
+ /**
38
+ * The event shape a consumer passes in. `start`/`end` accept a `Date` or an ISO
39
+ * string; everything is normalized internally to `NormalizedEvent`.
40
+ */
41
+ export interface CalendarEvent {
42
+ id: string;
43
+ title: string;
44
+ start: Date | string;
45
+ /** Omit for a zero-length / point-in-time event. */
46
+ end?: Date | string;
47
+ /** All-day (and multi-day all-day) events render in the all-day gutter. */
48
+ allDay?: boolean;
49
+ severity?: EventSeverity;
50
+ location?: string;
51
+ description?: string;
52
+ /** When set, the event is a recurring series expanded across the visible range. */
53
+ recurrence?: RecurrenceRule;
54
+ /** Gates drag-to-move / drag-to-resize per event once those land. Defaults true. */
55
+ editable?: boolean;
56
+ /** Arbitrary passthrough — provider ids, attendee lists, etc. Never touched by core. */
57
+ meta?: Record<string, unknown>;
58
+ }
59
+ /**
60
+ * Internal, render-ready form of an event: real `Date` instants, and — for a
61
+ * recurring series — the specific occurrence this instance represents. One
62
+ * source `CalendarEvent` fans out into many `NormalizedEvent`s.
63
+ */
64
+ export interface NormalizedEvent {
65
+ /** Stable per-occurrence id (`<event.id>` or `<event.id>__<occurrence-ISO>`). */
66
+ key: string;
67
+ /** The source event id — identical across every occurrence of a series. */
68
+ id: string;
69
+ title: string;
70
+ start: Date;
71
+ end: Date;
72
+ allDay: boolean;
73
+ severity: EventSeverity;
74
+ location?: string;
75
+ description?: string;
76
+ editable: boolean;
77
+ /** True when this instance was generated from a recurrence rule. */
78
+ isOccurrence: boolean;
79
+ /** True when the event spans more than one calendar day. */
80
+ isMultiDay: boolean;
81
+ source: CalendarEvent;
82
+ }
83
+ /** Half-open date window `[start, end)` used for fetching/expansion. */
84
+ export interface DateRange {
85
+ start: Date;
86
+ end: Date;
87
+ }
88
+ /**
89
+ * Optional auth surface a provider can expose so the UI can drive a
90
+ * connect/disconnect affordance without knowing the provider's mechanism.
91
+ */
92
+ export interface CalendarProviderAuth {
93
+ isAuthenticated?: () => boolean | Promise<boolean>;
94
+ authenticate?: () => Promise<void>;
95
+ signOut?: () => Promise<void>;
96
+ }
97
+ /**
98
+ * Pluggable event source. `useCalendar()` accepts one optional provider; the
99
+ * shipped ICS and Google adapters both implement this. Only `fetchEvents` is
100
+ * required — a read-only source may omit the mutation hooks, and the UI hides
101
+ * the corresponding affordances when they're absent.
102
+ */
103
+ export interface CalendarProvider {
104
+ /** Human label for connect UIs / debugging (e.g. "Google Calendar"). */
105
+ name: string;
106
+ fetchEvents: (range: DateRange) => Promise<CalendarEvent[]>;
107
+ createEvent?: (event: CalendarEvent) => Promise<CalendarEvent>;
108
+ updateEvent?: (event: CalendarEvent) => Promise<CalendarEvent>;
109
+ deleteEvent?: (eventId: string) => Promise<void>;
110
+ auth?: CalendarProviderAuth;
111
+ }
112
+ /** One day in a month grid or agenda list, with the events overlapping it. */
113
+ export interface CalendarDayCell {
114
+ date: Date;
115
+ /** `YYYY-MM-DD` identity, cheap key for lists and lookups. */
116
+ key: string;
117
+ isToday: boolean;
118
+ /** Belongs to the month currently in focus (false for leading/trailing days). */
119
+ isCurrentMonth: boolean;
120
+ isWeekend: boolean;
121
+ events: NormalizedEvent[];
122
+ }
123
+ /** A week row in the month grid. */
124
+ export interface CalendarWeekRow {
125
+ key: string;
126
+ days: CalendarDayCell[];
127
+ }
128
+ /**
129
+ * The new start/end an interaction produced. Emitted by drag-to-move and
130
+ * drag-to-resize; the consumer (or a provider's `updateEvent`) persists it —
131
+ * the source `CalendarEvent` is never mutated in place.
132
+ */
133
+ export interface EventChange {
134
+ start: Date;
135
+ end: Date;
136
+ }
137
+ /**
138
+ * A time/day span the user swept out on empty space (drag-to-create). `allDay`
139
+ * is true when the sweep was over a month day cell or the all-day gutter.
140
+ */
141
+ export interface RangeSelection {
142
+ start: Date;
143
+ end: Date;
144
+ allDay: boolean;
145
+ }
146
+ /** `{ start, end }` in minutes-from-midnight for the business-hours highlight. */
147
+ export interface BusinessHours {
148
+ /** Weekdays the highlight applies to. Defaults to Mon–Fri. */
149
+ daysOfWeek?: WeekdayIndex[];
150
+ /** Minutes from midnight, e.g. 540 = 09:00. */
151
+ startMinute: number;
152
+ /** Minutes from midnight, e.g. 1020 = 17:00. */
153
+ endMinute: number;
154
+ }
@@ -0,0 +1,17 @@
1
+ export interface ZonedParts {
2
+ year: number;
3
+ month: number;
4
+ day: number;
5
+ hour: number;
6
+ minute: number;
7
+ /** 0 = Sunday … 6 = Saturday. */
8
+ weekday: number;
9
+ }
10
+ /** Wall-clock parts of `date` in `timeZone` (or local time when omitted). */
11
+ export declare function getZonedParts(date: Date, timeZone?: string): ZonedParts;
12
+ /** `YYYY-MM-DD` identity of the calendar day `date` lands on in `timeZone`. */
13
+ export declare function dayKey(date: Date, timeZone?: string): string;
14
+ /** `YYYY-MM-DD` identity of a calendar-date cell (always read in local time). */
15
+ export declare function cellKey(date: Date): string;
16
+ /** Minutes-from-midnight of `date`'s wall-clock time in `timeZone`. */
17
+ export declare function minutesInDay(date: Date, timeZone?: string): number;