@emoo-ai/ui-react 0.1.13 → 0.1.15

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.
@@ -0,0 +1,56 @@
1
+ export type ScheduleView = "month" | "week" | "list";
2
+ export type ScheduleTone = "brand" | "success" | "warning" | "danger" | "info" | "neutral";
3
+ export type ScheduleEventKind = "meeting" | "todo" | "event" | (string & {});
4
+ export interface ScheduleCalendar {
5
+ id: string;
6
+ name: string;
7
+ owner?: string;
8
+ tone?: ScheduleTone;
9
+ visible?: boolean;
10
+ readonly?: boolean;
11
+ shareable?: boolean;
12
+ }
13
+ export interface ScheduleEvent {
14
+ id: string;
15
+ title: string;
16
+ start: string;
17
+ end?: string;
18
+ allDay?: boolean;
19
+ calendarId?: string;
20
+ kind?: ScheduleEventKind;
21
+ tone?: ScheduleTone;
22
+ status?: string;
23
+ statusTone?: ScheduleTone;
24
+ meta?: string;
25
+ description?: string;
26
+ done?: boolean;
27
+ }
28
+ export interface ScheduleEventMove {
29
+ event: ScheduleEvent;
30
+ fromDayKey: string;
31
+ dayKey: string;
32
+ deltaDays: number;
33
+ }
34
+ export declare function parseScheduleDate(input?: string | Date | null): Date | null;
35
+ export declare function scheduleDayKey(d: Date): string;
36
+ export declare function addScheduleDays(d: Date, n: number): Date;
37
+ export declare function addScheduleMonths(d: Date, n: number): Date;
38
+ export declare function startOfScheduleWeek(d: Date, weekStartsOn: number): Date;
39
+ export declare function buildMonthDays(anchor: Date, weekStartsOn?: number): Date[];
40
+ export declare function buildWeekDays(anchor: Date, weekStartsOn?: number): Date[];
41
+ export declare function scheduleDayDiff(fromKey: string, toKey: string): number;
42
+ export declare function shiftScheduleEventDates(ev: ScheduleEvent, deltaDays: number): {
43
+ start: string;
44
+ end?: string;
45
+ };
46
+ export interface ScheduleSegment {
47
+ event: ScheduleEvent;
48
+ dayKey: string;
49
+ isStart: boolean;
50
+ isEnd: boolean;
51
+ }
52
+ export declare function scheduleEventDaySpan(ev: ScheduleEvent): {
53
+ startKey: string;
54
+ endKey: string;
55
+ } | null;
56
+ export declare function segmentScheduleEvents(events: ScheduleEvent[], days: Date[], visibleCalendarIds?: Set<string> | null): Map<string, ScheduleSegment[]>;
@@ -0,0 +1,56 @@
1
+ import { type ReactNode } from "react";
2
+ import { type ScheduleCalendar, type ScheduleEvent, type ScheduleEventMove, type ScheduleView } from "./schedule-contract";
3
+ export interface ScheduleLabels {
4
+ ariaLabel: string;
5
+ legendLabel: string;
6
+ today: string;
7
+ prevPeriod: string;
8
+ nextPeriod: string;
9
+ viewSwitch: string;
10
+ monthView: string;
11
+ weekView: string;
12
+ listView: string;
13
+ allDay: string;
14
+ noArrangement: string;
15
+ emptyList: string;
16
+ moreItems: (n: number) => string;
17
+ dayCellEvents: (n: number) => string;
18
+ readonlyTag: string;
19
+ shareCalendar: (name: string) => string;
20
+ hideCalendar: (name: string) => string;
21
+ showCalendar: (name: string) => string;
22
+ detailTitle: string;
23
+ timeLabel: string;
24
+ calendarLabel: string;
25
+ kindMeeting: string;
26
+ kindTodo: string;
27
+ kindEvent: string;
28
+ readonlyNoDrag: string;
29
+ readonlyHint: string;
30
+ }
31
+ export interface ScheduleProps {
32
+ events: ScheduleEvent[];
33
+ calendars?: ScheduleCalendar[];
34
+ view?: ScheduleView;
35
+ date?: string;
36
+ weekStartsOn?: number;
37
+ maxDayItems?: number;
38
+ showCalendars?: boolean;
39
+ today?: string;
40
+ draggable?: boolean;
41
+ showDetail?: boolean;
42
+ renderDetailActions?: (event: ScheduleEvent, calendar?: ScheduleCalendar) => ReactNode;
43
+ labels?: Partial<ScheduleLabels>;
44
+ locale?: string;
45
+ onViewChange?: (view: ScheduleView) => void;
46
+ onDateChange?: (date: string) => void;
47
+ onCalendarsChange?: (calendars: ScheduleCalendar[]) => void;
48
+ onEventClick?: (event: ScheduleEvent) => void;
49
+ onEventMove?: (move: ScheduleEventMove) => void;
50
+ onDayClick?: (dayKey: string) => void;
51
+ onDayMore?: (dayKey: string) => void;
52
+ onShareCalendar?: (calendar: ScheduleCalendar) => void;
53
+ className?: string;
54
+ }
55
+ declare function Schedule({ events, calendars, view, date, weekStartsOn, maxDayItems, showCalendars, today, draggable, showDetail, renderDetailActions, labels, locale, onViewChange, onDateChange, onCalendarsChange, onEventClick, onEventMove, onDayClick, onDayMore, onShareCalendar, className, }: ScheduleProps): import("react/jsx-runtime").JSX.Element;
56
+ export { Schedule };
package/dist/index.d.ts CHANGED
@@ -94,6 +94,8 @@ export * from "./components/history-contract";
94
94
  export * from "./components/history-list";
95
95
  export * from "./components/value-diff";
96
96
  export * from "./components/segmented";
97
+ export * from "./components/schedule";
98
+ export * from "./components/schedule-contract";
97
99
  export * from "./components/tags-input";
98
100
  export * from "./components/chips";
99
101
  export * from "./components/ui/breadcrumb";