@app-studio/web 0.9.33 → 0.9.34
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.
- package/dist/components/Accordion/Accordion/Accordion.style.d.ts +8 -0
- package/dist/components/Calendar/Calendar/Calendar.props.d.ts +57 -53
- package/dist/components/Calendar/Calendar/Calendar.style.d.ts +103 -0
- package/dist/components/Calendar/Calendar/Calendar.utils.d.ts +89 -8
- package/dist/components/Calendar/Calendar/Calendar.view.d.ts +2 -19
- package/dist/components/Calendar/Calendar.d.ts +1 -3
- package/dist/components/CalendarWeek/CalendarWeek/CalendarWeek.props.d.ts +51 -0
- package/dist/components/CalendarWeek/CalendarWeek/CalendarWeek.style.d.ts +90 -0
- package/dist/components/CalendarWeek/CalendarWeek/CalendarWeek.utils.d.ts +51 -0
- package/dist/components/CalendarWeek/CalendarWeek/CalendarWeek.view.d.ts +3 -0
- package/dist/components/CalendarWeek/CalendarWeek.d.ts +1 -0
- package/dist/components/Chart/Chart/BarChart.d.ts +1 -1
- package/dist/components/Chart/Chart/Chart.state.d.ts +3 -3
- package/dist/components/Chart/Chart/ChartTooltip.d.ts +14 -0
- package/dist/components/Chart/Chart/LineChart.d.ts +1 -1
- package/dist/components/Chart/Chart/PieChart.d.ts +1 -1
- package/dist/components/ChatInput/ChatInput/ChatInput.style.d.ts +31 -0
- package/dist/components/Form/Checkbox/Checkbox/Checkbox.style.d.ts +20 -4
- package/dist/components/Form/Select/Select/Select.style.d.ts +4 -0
- package/dist/components/Form/Switch/Switch/Switch.style.d.ts +25 -5
- package/dist/components/Input/Input.style.d.ts +16 -0
- package/dist/components/KanbanBoard/KanbanBoard/KanbanBoard.props.d.ts +1 -0
- package/dist/components/KanbanBoard/KanbanBoard/KanbanBoard.state.d.ts +3 -2
- package/dist/components/Link/Link/Link.style.d.ts +5 -0
- package/dist/components/Modal/Modal/Modal.style.d.ts +9 -0
- package/dist/components/NavigationMenu/NavigationMenu/NavigationMenu.state.d.ts +1 -0
- package/dist/components/NavigationMenu/NavigationMenu/NavigationMenu.type.d.ts +1 -0
- package/dist/components/Separator/Separator/Separator.style.d.ts +7 -0
- package/dist/components/Slider/Slider/Slider.style.d.ts +12 -0
- package/dist/components/Table/Table/Table.style.d.ts +1 -0
- package/dist/components/Text/Text/Text.props.d.ts +4 -0
- package/dist/components/Text/Text/Text.style.d.ts +1 -0
- package/dist/components/Toast/Toast/Toast.style.d.ts +5 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/web.cjs.development.js +2873 -1033
- package/dist/web.cjs.development.js.map +1 -1
- package/dist/web.cjs.production.min.js +1 -1
- package/dist/web.cjs.production.min.js.map +1 -1
- package/dist/web.esm.js +2876 -1037
- package/dist/web.esm.js.map +1 -1
- package/dist/web.umd.development.js +2873 -1031
- package/dist/web.umd.development.js.map +1 -1
- package/dist/web.umd.production.min.js +1 -1
- package/dist/web.umd.production.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,3 +2,11 @@ import { ViewProps } from 'app-studio';
|
|
|
2
2
|
import { Shape, Variant } from './Accordion.type';
|
|
3
3
|
export declare const AccordionShapes: Record<Shape, ViewProps>;
|
|
4
4
|
export declare const AccordionVariants: Record<Variant, ViewProps>;
|
|
5
|
+
/**
|
|
6
|
+
* Accordion trigger styles matching shadcn/ui patterns
|
|
7
|
+
*/
|
|
8
|
+
export declare const AccordionTriggerStyles: ViewProps;
|
|
9
|
+
/**
|
|
10
|
+
* Accordion content styles with smooth animation
|
|
11
|
+
*/
|
|
12
|
+
export declare const AccordionContentStyles: ViewProps;
|
|
@@ -1,70 +1,74 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { ViewProps } from 'app-studio';
|
|
3
|
-
|
|
4
|
-
import { TextProps } from '../../Text/Text/Text.props';
|
|
5
|
-
export declare type CalendarView = 'day' | 'week' | 'month';
|
|
2
|
+
export declare type CalendarView = 'month' | 'week' | 'day';
|
|
6
3
|
export interface CalendarEvent {
|
|
7
|
-
/** Unique identifier for the event
|
|
8
|
-
id
|
|
9
|
-
/** Event title
|
|
4
|
+
/** Unique identifier for the event */
|
|
5
|
+
id: string;
|
|
6
|
+
/** Event title/label */
|
|
10
7
|
title: string;
|
|
11
|
-
/** Start date
|
|
12
|
-
start:
|
|
13
|
-
/**
|
|
14
|
-
end
|
|
15
|
-
/**
|
|
16
|
-
|
|
17
|
-
/** Additional metadata the consumer wants to keep with the event. */
|
|
18
|
-
metadata?: Record<string, unknown>;
|
|
19
|
-
}
|
|
20
|
-
export interface CalendarRenderEventContext {
|
|
21
|
-
/** Date of the cell currently being rendered. */
|
|
22
|
-
day: Date;
|
|
23
|
-
/** Active calendar view. */
|
|
24
|
-
view: CalendarView;
|
|
25
|
-
/** Whether the given day is today. */
|
|
26
|
-
isToday: boolean;
|
|
8
|
+
/** Start date in ISO format (YYYY-MM-DD) or datetime (YYYY-MM-DDTHH:MM) */
|
|
9
|
+
start: string;
|
|
10
|
+
/** End date in ISO format (YYYY-MM-DD) or datetime (YYYY-MM-DDTHH:MM) */
|
|
11
|
+
end: string;
|
|
12
|
+
/** Color variant for the event */
|
|
13
|
+
color?: 'blue' | 'red' | 'green' | 'purple' | 'orange';
|
|
27
14
|
}
|
|
28
15
|
export interface CalendarViews {
|
|
16
|
+
/** Style overrides for the main container */
|
|
29
17
|
container?: ViewProps;
|
|
18
|
+
/** Style overrides for the header (navigation) */
|
|
30
19
|
header?: ViewProps;
|
|
31
|
-
|
|
32
|
-
|
|
20
|
+
/** Style overrides for the month/year title */
|
|
21
|
+
monthTitle?: ViewProps;
|
|
22
|
+
/** Style overrides for navigation buttons */
|
|
23
|
+
navButton?: ViewProps;
|
|
24
|
+
/** Style overrides for view switcher buttons */
|
|
33
25
|
viewSwitcher?: ViewProps;
|
|
34
|
-
grid
|
|
35
|
-
|
|
26
|
+
/** Style overrides for the month grid */
|
|
27
|
+
monthGrid?: ViewProps;
|
|
28
|
+
/** Style overrides for weekday header row */
|
|
36
29
|
weekdayHeader?: ViewProps;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
events
|
|
30
|
+
/** Style overrides for individual weekday labels */
|
|
31
|
+
weekdayLabel?: ViewProps;
|
|
32
|
+
/** Style overrides for individual day cells */
|
|
33
|
+
dayCell?: ViewProps;
|
|
34
|
+
/** Style overrides for day numbers */
|
|
35
|
+
dayNumber?: ViewProps;
|
|
36
|
+
/** Style overrides for the events area */
|
|
37
|
+
eventsArea?: ViewProps;
|
|
38
|
+
/** Style overrides for individual events */
|
|
44
39
|
event?: ViewProps;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
viewButton?: Partial<ButtonProps>;
|
|
40
|
+
/** Style overrides for time column (day view) */
|
|
41
|
+
timeColumn?: ViewProps;
|
|
42
|
+
/** Style overrides for time slot */
|
|
43
|
+
timeSlot?: ViewProps;
|
|
50
44
|
}
|
|
51
45
|
export interface CalendarProps {
|
|
52
|
-
/**
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
initialDate?: Date | string;
|
|
56
|
-
/** Initial visible view. */
|
|
46
|
+
/** Initial date to display in ISO format (YYYY-MM-DD) or Date object */
|
|
47
|
+
initialDate?: string | Date;
|
|
48
|
+
/** Initial view to display */
|
|
57
49
|
initialView?: CalendarView;
|
|
58
|
-
/**
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
|
|
64
|
-
/**
|
|
50
|
+
/** Array of events to display */
|
|
51
|
+
events?: CalendarEvent[];
|
|
52
|
+
/** Today's date in ISO format (defaults to current date) */
|
|
53
|
+
today?: string;
|
|
54
|
+
/** Callback when an event is dragged to a new position */
|
|
55
|
+
onEventDrop?: (event: CalendarEvent) => void;
|
|
56
|
+
/** Callback when an event is resized */
|
|
57
|
+
onEventResize?: (event: CalendarEvent) => void;
|
|
58
|
+
/** Callback when a date is clicked */
|
|
59
|
+
onDateClick?: (date: string) => void;
|
|
60
|
+
/** Callback when date/time changes */
|
|
65
61
|
onDateChange?: (date: Date) => void;
|
|
66
|
-
/**
|
|
62
|
+
/** Callback when view changes */
|
|
67
63
|
onViewChange?: (view: CalendarView) => void;
|
|
68
|
-
/**
|
|
64
|
+
/** Callback when double-clicking to add new event */
|
|
65
|
+
onEventAdd?: (start: string, end: string) => void;
|
|
66
|
+
/** Style overrides for various parts of the component */
|
|
69
67
|
views?: CalendarViews;
|
|
68
|
+
/** Width of the calendar (default: '100%') */
|
|
69
|
+
width?: number | string;
|
|
70
|
+
/** Maximum width of the calendar (default: 1200) */
|
|
71
|
+
maxWidth?: number | string;
|
|
72
|
+
/** First day of the week (0 = Sunday, 1 = Monday, etc.) */
|
|
73
|
+
weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
70
74
|
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { ViewProps } from 'app-studio';
|
|
2
|
+
/**
|
|
3
|
+
* Event color configurations
|
|
4
|
+
*/
|
|
5
|
+
export declare const EVENT_COLORS: {
|
|
6
|
+
readonly blue: {
|
|
7
|
+
readonly background: "color.blue.50";
|
|
8
|
+
readonly border: "color.blue.500";
|
|
9
|
+
readonly text: "color.blue.700";
|
|
10
|
+
};
|
|
11
|
+
readonly red: {
|
|
12
|
+
readonly background: "color.red.50";
|
|
13
|
+
readonly border: "color.red.500";
|
|
14
|
+
readonly text: "color.red.700";
|
|
15
|
+
};
|
|
16
|
+
readonly green: {
|
|
17
|
+
readonly background: "color.green.50";
|
|
18
|
+
readonly border: "color.green.500";
|
|
19
|
+
readonly text: "color.green.700";
|
|
20
|
+
};
|
|
21
|
+
readonly purple: {
|
|
22
|
+
readonly background: "color.purple.50";
|
|
23
|
+
readonly border: "color.purple.500";
|
|
24
|
+
readonly text: "color.purple.700";
|
|
25
|
+
};
|
|
26
|
+
readonly orange: {
|
|
27
|
+
readonly background: "color.orange.50";
|
|
28
|
+
readonly border: "color.orange.500";
|
|
29
|
+
readonly text: "color.orange.700";
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Base styles for the calendar container
|
|
34
|
+
*/
|
|
35
|
+
export declare const containerStyles: ViewProps;
|
|
36
|
+
/**
|
|
37
|
+
* Header styles (navigation bar)
|
|
38
|
+
*/
|
|
39
|
+
export declare const headerStyles: ViewProps;
|
|
40
|
+
/**
|
|
41
|
+
* Month title styles
|
|
42
|
+
*/
|
|
43
|
+
export declare const monthTitleStyles: ViewProps;
|
|
44
|
+
/**
|
|
45
|
+
* Navigation button styles
|
|
46
|
+
*/
|
|
47
|
+
export declare const navButtonStyles: ViewProps;
|
|
48
|
+
/**
|
|
49
|
+
* Month grid styles (7 columns for days)
|
|
50
|
+
*/
|
|
51
|
+
export declare const monthGridStyles: ViewProps;
|
|
52
|
+
/**
|
|
53
|
+
* Weekday header row styles
|
|
54
|
+
*/
|
|
55
|
+
export declare const weekdayHeaderStyles: ViewProps;
|
|
56
|
+
/**
|
|
57
|
+
* Individual weekday label styles
|
|
58
|
+
*/
|
|
59
|
+
export declare const weekdayLabelStyles: ViewProps;
|
|
60
|
+
/**
|
|
61
|
+
* Individual day cell styles
|
|
62
|
+
*/
|
|
63
|
+
export declare const dayCellStyles: ViewProps;
|
|
64
|
+
/**
|
|
65
|
+
* Day cell from different month
|
|
66
|
+
*/
|
|
67
|
+
export declare const otherMonthDayCellStyles: ViewProps;
|
|
68
|
+
/**
|
|
69
|
+
* Day number styles
|
|
70
|
+
*/
|
|
71
|
+
export declare const dayNumberStyles: ViewProps;
|
|
72
|
+
/**
|
|
73
|
+
* Today day number styles
|
|
74
|
+
*/
|
|
75
|
+
export declare const todayDayNumberStyles: ViewProps;
|
|
76
|
+
/**
|
|
77
|
+
* Selected day number styles
|
|
78
|
+
*/
|
|
79
|
+
export declare const selectedDayNumberStyles: ViewProps;
|
|
80
|
+
/**
|
|
81
|
+
* Events area styles (container for events in a day)
|
|
82
|
+
*/
|
|
83
|
+
export declare const eventsAreaStyles: ViewProps;
|
|
84
|
+
/**
|
|
85
|
+
* Base event styles
|
|
86
|
+
*/
|
|
87
|
+
export declare const eventStyles: ViewProps;
|
|
88
|
+
/**
|
|
89
|
+
* Drop target indicator styles
|
|
90
|
+
*/
|
|
91
|
+
export declare const dropTargetStyles: ViewProps;
|
|
92
|
+
/**
|
|
93
|
+
* Calculate event position styles for multi-day events
|
|
94
|
+
*/
|
|
95
|
+
export declare const getEventPositionStyles: (startDay: number, endDay: number, weekIndex: number, dayOfWeek: number) => React.CSSProperties;
|
|
96
|
+
/**
|
|
97
|
+
* Button base styles
|
|
98
|
+
*/
|
|
99
|
+
export declare const buttonStyles: ViewProps;
|
|
100
|
+
/**
|
|
101
|
+
* Icon button styles
|
|
102
|
+
*/
|
|
103
|
+
export declare const iconButtonStyles: ViewProps;
|
|
@@ -1,10 +1,91 @@
|
|
|
1
1
|
import { CalendarEvent } from './Calendar.props';
|
|
2
|
-
export interface
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
export interface PositionedEvent extends CalendarEvent {
|
|
3
|
+
/** Starting day index (0-41, representing 6 weeks * 7 days) */
|
|
4
|
+
startDay: number;
|
|
5
|
+
/** Ending day index (0-41) */
|
|
6
|
+
endDay: number;
|
|
7
|
+
/** Number of days the event spans */
|
|
8
|
+
duration: number;
|
|
9
|
+
/** Row index for vertical positioning (to avoid overlaps) */
|
|
10
|
+
row: number;
|
|
11
|
+
/** Week index (0-5) */
|
|
12
|
+
weekIndex: number;
|
|
13
|
+
/** Day of week (0-6) */
|
|
14
|
+
dayOfWeek: number;
|
|
5
15
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export declare const
|
|
10
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Convert an ISO date string to a UTC Date object
|
|
18
|
+
*/
|
|
19
|
+
export declare const dateUTC: (iso: string) => Date;
|
|
20
|
+
/**
|
|
21
|
+
* Calculate the number of days between two ISO date strings
|
|
22
|
+
*/
|
|
23
|
+
export declare const daysBetweenUTC: (a: string, b: string) => number;
|
|
24
|
+
/**
|
|
25
|
+
* Add a number of days to an ISO date string
|
|
26
|
+
*/
|
|
27
|
+
export declare const addDateDays: (dateISO: string, days: number) => string;
|
|
28
|
+
/**
|
|
29
|
+
* Get the day of the week (0-6) from an ISO date string
|
|
30
|
+
*/
|
|
31
|
+
export declare const getDayOfWeek: (dateISO: string) => number;
|
|
32
|
+
/**
|
|
33
|
+
* Get the date number (1-31) from an ISO date string
|
|
34
|
+
*/
|
|
35
|
+
export declare const getDateNumber: (dateISO: string) => number;
|
|
36
|
+
/**
|
|
37
|
+
* Get the month (0-11) from an ISO date string
|
|
38
|
+
*/
|
|
39
|
+
export declare const getMonth: (dateISO: string) => number;
|
|
40
|
+
/**
|
|
41
|
+
* Get the year from an ISO date string
|
|
42
|
+
*/
|
|
43
|
+
export declare const getYear: (dateISO: string) => number;
|
|
44
|
+
/**
|
|
45
|
+
* Get the first day of the month for a given date
|
|
46
|
+
*/
|
|
47
|
+
export declare const getFirstDayOfMonth: (dateISO: string) => string;
|
|
48
|
+
/**
|
|
49
|
+
* Get the last day of the month for a given date
|
|
50
|
+
*/
|
|
51
|
+
export declare const getLastDayOfMonth: (dateISO: string) => string;
|
|
52
|
+
/**
|
|
53
|
+
* Get the start date of the calendar grid (may be in previous month)
|
|
54
|
+
*/
|
|
55
|
+
export declare const getCalendarStartDate: (monthDateISO: string, weekStartsOn?: number) => string;
|
|
56
|
+
/**
|
|
57
|
+
* Generate array of dates for the calendar grid (42 days = 6 weeks)
|
|
58
|
+
*/
|
|
59
|
+
export declare const getCalendarDates: (monthDateISO: string, weekStartsOn?: number) => string[];
|
|
60
|
+
/**
|
|
61
|
+
* Get month name from date
|
|
62
|
+
*/
|
|
63
|
+
export declare const getMonthName: (dateISO: string) => string;
|
|
64
|
+
/**
|
|
65
|
+
* Get the previous month date
|
|
66
|
+
*/
|
|
67
|
+
export declare const getPreviousMonth: (dateISO: string) => string;
|
|
68
|
+
/**
|
|
69
|
+
* Get the next month date
|
|
70
|
+
*/
|
|
71
|
+
export declare const getNextMonth: (dateISO: string) => string;
|
|
72
|
+
/**
|
|
73
|
+
* Day names array (Sunday to Saturday)
|
|
74
|
+
*/
|
|
75
|
+
export declare const DAY_NAMES: string[];
|
|
76
|
+
/**
|
|
77
|
+
* Get day names starting from specified day
|
|
78
|
+
*/
|
|
79
|
+
export declare const getDayNames: (weekStartsOn?: number) => string[];
|
|
80
|
+
/**
|
|
81
|
+
* Layout events with proper positioning to avoid overlaps
|
|
82
|
+
* Returns positioned events for each week
|
|
83
|
+
*/
|
|
84
|
+
export declare const layoutEvents: (events: CalendarEvent[], calendarDates: string[]) => {
|
|
85
|
+
items: PositionedEvent[];
|
|
86
|
+
rowCountByWeek: number[];
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Check if a date is in the current month
|
|
90
|
+
*/
|
|
91
|
+
export declare const isInMonth: (dateISO: string, monthDateISO: string) => boolean;
|
|
@@ -1,20 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
interface CalendarViewProps {
|
|
5
|
-
currentDate: Date;
|
|
6
|
-
view: CalendarView;
|
|
7
|
-
label: string;
|
|
8
|
-
weeks: Date[][];
|
|
9
|
-
weekdayLabels: Date[];
|
|
10
|
-
eventsByDay: Map<string, CalendarEventInternal[]>;
|
|
11
|
-
onPrevious: () => void;
|
|
12
|
-
onNext: () => void;
|
|
13
|
-
onToday: () => void;
|
|
14
|
-
onViewChange: (view: CalendarView) => void;
|
|
15
|
-
renderEvent?: (event: CalendarEvent, context: CalendarRenderEventContext) => React.ReactNode;
|
|
16
|
-
views?: CalendarViews;
|
|
17
|
-
height?: string | number;
|
|
18
|
-
}
|
|
19
|
-
declare const CalendarViewComponent: React.FC<CalendarViewProps>;
|
|
20
|
-
export default CalendarViewComponent;
|
|
2
|
+
import { CalendarProps } from './Calendar.props';
|
|
3
|
+
export declare const Calendar: React.FC<CalendarProps>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { ViewProps } from 'app-studio';
|
|
2
|
+
export interface CalendarWeekEvent {
|
|
3
|
+
/** Unique identifier for the event */
|
|
4
|
+
id: string;
|
|
5
|
+
/** Event title/label */
|
|
6
|
+
title: string;
|
|
7
|
+
/** Start date in ISO format (YYYY-MM-DD) */
|
|
8
|
+
start: string;
|
|
9
|
+
/** End date in ISO format (YYYY-MM-DD) */
|
|
10
|
+
end: string;
|
|
11
|
+
/** Color variant for the event */
|
|
12
|
+
color?: 'blue' | 'red' | 'green' | 'purple' | 'orange';
|
|
13
|
+
}
|
|
14
|
+
export interface CalendarWeekViews {
|
|
15
|
+
/** Style overrides for the main container */
|
|
16
|
+
container?: ViewProps;
|
|
17
|
+
/** Style overrides for the week grid */
|
|
18
|
+
weekGrid?: ViewProps;
|
|
19
|
+
/** Style overrides for individual day columns */
|
|
20
|
+
dayColumn?: ViewProps;
|
|
21
|
+
/** Style overrides for day column headers */
|
|
22
|
+
dayHeader?: ViewProps;
|
|
23
|
+
/** Style overrides for day names (e.g., "Mon", "Tue") */
|
|
24
|
+
dayName?: ViewProps;
|
|
25
|
+
/** Style overrides for day dates (the circular number) */
|
|
26
|
+
dayDate?: ViewProps;
|
|
27
|
+
/** Style overrides for the events area */
|
|
28
|
+
eventsArea?: ViewProps;
|
|
29
|
+
/** Style overrides for individual events */
|
|
30
|
+
event?: ViewProps;
|
|
31
|
+
}
|
|
32
|
+
export interface CalendarWeekProps {
|
|
33
|
+
/** Start date of the week in ISO format (YYYY-MM-DD) */
|
|
34
|
+
startDate: string;
|
|
35
|
+
/** Array of events to display */
|
|
36
|
+
events?: CalendarWeekEvent[];
|
|
37
|
+
/** Today's date in ISO format (defaults to current date) */
|
|
38
|
+
today?: string;
|
|
39
|
+
/** Callback when an event is dragged to a new position */
|
|
40
|
+
onEventDrop?: (event: CalendarWeekEvent) => void;
|
|
41
|
+
/** Callback when an event is resized */
|
|
42
|
+
onEventResize?: (event: CalendarWeekEvent) => void;
|
|
43
|
+
/** Callback when a date is clicked */
|
|
44
|
+
onDateClick?: (date: string) => void;
|
|
45
|
+
/** Style overrides for various parts of the component */
|
|
46
|
+
views?: CalendarWeekViews;
|
|
47
|
+
/** Width of the calendar (default: '100%') */
|
|
48
|
+
width?: number | string;
|
|
49
|
+
/** Maximum width of the calendar (default: 1200) */
|
|
50
|
+
maxWidth?: number | string;
|
|
51
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ViewProps } from 'app-studio';
|
|
3
|
+
/**
|
|
4
|
+
* Event color configurations
|
|
5
|
+
*/
|
|
6
|
+
export declare const EVENT_COLORS: {
|
|
7
|
+
readonly blue: {
|
|
8
|
+
readonly background: "color.blue.50";
|
|
9
|
+
readonly border: "color.blue.500";
|
|
10
|
+
readonly text: "color.blue.700";
|
|
11
|
+
};
|
|
12
|
+
readonly red: {
|
|
13
|
+
readonly background: "color.red.50";
|
|
14
|
+
readonly border: "color.red.500";
|
|
15
|
+
readonly text: "color.red.700";
|
|
16
|
+
};
|
|
17
|
+
readonly green: {
|
|
18
|
+
readonly background: "color.green.50";
|
|
19
|
+
readonly border: "color.green.500";
|
|
20
|
+
readonly text: "color.green.700";
|
|
21
|
+
};
|
|
22
|
+
readonly purple: {
|
|
23
|
+
readonly background: "color.purple.50";
|
|
24
|
+
readonly border: "color.purple.500";
|
|
25
|
+
readonly text: "color.purple.700";
|
|
26
|
+
};
|
|
27
|
+
readonly orange: {
|
|
28
|
+
readonly background: "color.orange.50";
|
|
29
|
+
readonly border: "color.orange.500";
|
|
30
|
+
readonly text: "color.orange.700";
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Base styles for the calendar container
|
|
35
|
+
*/
|
|
36
|
+
export declare const containerStyles: ViewProps;
|
|
37
|
+
/**
|
|
38
|
+
* Week grid styles (7 columns)
|
|
39
|
+
*/
|
|
40
|
+
export declare const weekGridStyles: ViewProps;
|
|
41
|
+
/**
|
|
42
|
+
* Individual day column styles
|
|
43
|
+
*/
|
|
44
|
+
export declare const dayColumnStyles: ViewProps;
|
|
45
|
+
/**
|
|
46
|
+
* Day header styles
|
|
47
|
+
*/
|
|
48
|
+
export declare const dayHeaderStyles: ViewProps;
|
|
49
|
+
/**
|
|
50
|
+
* Day name styles (e.g., "Mon", "Tue")
|
|
51
|
+
*/
|
|
52
|
+
export declare const dayNameStyles: ViewProps;
|
|
53
|
+
/**
|
|
54
|
+
* Day date styles (the circular number)
|
|
55
|
+
*/
|
|
56
|
+
export declare const dayDateStyles: ViewProps;
|
|
57
|
+
/**
|
|
58
|
+
* Today date styles
|
|
59
|
+
*/
|
|
60
|
+
export declare const todayDateStyles: ViewProps;
|
|
61
|
+
/**
|
|
62
|
+
* Selected date styles
|
|
63
|
+
*/
|
|
64
|
+
export declare const selectedDateStyles: ViewProps;
|
|
65
|
+
/**
|
|
66
|
+
* Events area styles
|
|
67
|
+
*/
|
|
68
|
+
export declare const eventsAreaStyles: ViewProps;
|
|
69
|
+
/**
|
|
70
|
+
* Events layer styles (absolute positioned over the grid)
|
|
71
|
+
*/
|
|
72
|
+
export declare const eventsLayerStyles: ViewProps;
|
|
73
|
+
/**
|
|
74
|
+
* Base event styles
|
|
75
|
+
*/
|
|
76
|
+
export declare const eventStyles: ViewProps;
|
|
77
|
+
/**
|
|
78
|
+
* Drop target indicator styles
|
|
79
|
+
*/
|
|
80
|
+
export declare const dropTargetStyles: ViewProps;
|
|
81
|
+
/**
|
|
82
|
+
* Calculate event position styles
|
|
83
|
+
*/
|
|
84
|
+
export declare const getEventPositionStyles: (startDay: number, duration: number, row: number) => React.CSSProperties;
|
|
85
|
+
/**
|
|
86
|
+
* Resize handle styles
|
|
87
|
+
*/
|
|
88
|
+
export declare const resizeHandleStyles: React.CSSProperties;
|
|
89
|
+
export declare const leftResizeHandleStyles: React.CSSProperties;
|
|
90
|
+
export declare const rightResizeHandleStyles: React.CSSProperties;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { CalendarWeekEvent } from './CalendarWeek.props';
|
|
2
|
+
export interface PositionedEvent extends CalendarWeekEvent {
|
|
3
|
+
/** Starting day index (0-6) within the week */
|
|
4
|
+
startDay: number;
|
|
5
|
+
/** Ending day index (0-6) within the week */
|
|
6
|
+
endDay: number;
|
|
7
|
+
/** Number of days the event spans */
|
|
8
|
+
duration: number;
|
|
9
|
+
/** Row index for vertical positioning (to avoid overlaps) */
|
|
10
|
+
row: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Convert an ISO date string to a UTC Date object
|
|
14
|
+
*/
|
|
15
|
+
export declare const dateUTC: (iso: string) => Date;
|
|
16
|
+
/**
|
|
17
|
+
* Calculate the number of days between two ISO date strings
|
|
18
|
+
*/
|
|
19
|
+
export declare const daysBetweenUTC: (a: string, b: string) => number;
|
|
20
|
+
/**
|
|
21
|
+
* Add a number of days to an ISO date string
|
|
22
|
+
*/
|
|
23
|
+
export declare const addDateDays: (dateISO: string, days: number) => string;
|
|
24
|
+
/**
|
|
25
|
+
* Get the day of the week (0-6) from an ISO date string
|
|
26
|
+
*/
|
|
27
|
+
export declare const getDayOfWeek: (dateISO: string) => number;
|
|
28
|
+
/**
|
|
29
|
+
* Get the date number (1-31) from an ISO date string
|
|
30
|
+
*/
|
|
31
|
+
export declare const getDateNumber: (dateISO: string) => number;
|
|
32
|
+
/**
|
|
33
|
+
* Layout events with proper positioning to avoid overlaps
|
|
34
|
+
* Returns positioned events and the total number of rows needed
|
|
35
|
+
*/
|
|
36
|
+
export declare const layoutEvents: (events: CalendarWeekEvent[], weekStart: string) => {
|
|
37
|
+
items: PositionedEvent[];
|
|
38
|
+
rowCount: number;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Day names array (Sunday to Saturday)
|
|
42
|
+
*/
|
|
43
|
+
export declare const DAY_NAMES: string[];
|
|
44
|
+
/**
|
|
45
|
+
* Get the date ISO string for a specific day in the week
|
|
46
|
+
*/
|
|
47
|
+
export declare const getDateForDay: (weekStart: string, dayIndex: number) => string;
|
|
48
|
+
/**
|
|
49
|
+
* Get the day index (0-6) from a clientX position within a week grid element
|
|
50
|
+
*/
|
|
51
|
+
export declare const getDayFromX: (x: number, weekGridRect: DOMRect) => number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CalendarWeek } from './CalendarWeek/CalendarWeek.view';
|
|
@@ -7,7 +7,7 @@ interface BarChartProps {
|
|
|
7
7
|
animationProgress: number;
|
|
8
8
|
showGrid?: boolean;
|
|
9
9
|
onBarClick?: (seriesName: string, index: number) => void;
|
|
10
|
-
showTooltip: (x: number, y: number, content:
|
|
10
|
+
showTooltip: (x: number, y: number, content: React.ReactNode) => void;
|
|
11
11
|
hideTooltip: () => void;
|
|
12
12
|
views?: any;
|
|
13
13
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
import { ChartData, ChartDataPoint } from './Chart.type';
|
|
3
3
|
export interface ChartStateProps {
|
|
4
4
|
data?: ChartData;
|
|
@@ -13,7 +13,7 @@ export declare const useChartState: ({ data, dataPoints, animated, animationDura
|
|
|
13
13
|
visible: boolean;
|
|
14
14
|
x: number;
|
|
15
15
|
y: number;
|
|
16
|
-
content:
|
|
16
|
+
content: ReactNode;
|
|
17
17
|
};
|
|
18
18
|
containerRef: import("react").RefObject<HTMLDivElement>;
|
|
19
19
|
processedData: () => {
|
|
@@ -28,7 +28,7 @@ export declare const useChartState: ({ data, dataPoints, animated, animationDura
|
|
|
28
28
|
}[];
|
|
29
29
|
labels: string[];
|
|
30
30
|
} | null;
|
|
31
|
-
showTooltip: (x: number, y: number, content:
|
|
31
|
+
showTooltip: (x: number, y: number, content: ReactNode) => void;
|
|
32
32
|
hideTooltip: () => void;
|
|
33
33
|
getChartDimensions: () => {
|
|
34
34
|
width: number;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ViewProps } from 'app-studio';
|
|
3
|
+
interface ChartTooltipProps {
|
|
4
|
+
visible: boolean;
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
content: React.ReactNode;
|
|
8
|
+
maxDistance?: number;
|
|
9
|
+
views?: {
|
|
10
|
+
tooltip?: ViewProps;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export declare const ChartTooltip: React.FC<ChartTooltipProps>;
|
|
14
|
+
export {};
|
|
@@ -7,7 +7,7 @@ interface LineChartProps {
|
|
|
7
7
|
animationProgress: number;
|
|
8
8
|
showGrid?: boolean;
|
|
9
9
|
onPointClick?: (seriesName: string, index: number) => void;
|
|
10
|
-
showTooltip: (x: number, y: number, content:
|
|
10
|
+
showTooltip: (x: number, y: number, content: React.ReactNode) => void;
|
|
11
11
|
hideTooltip: () => void;
|
|
12
12
|
views?: any;
|
|
13
13
|
}
|
|
@@ -7,7 +7,7 @@ interface PieChartProps {
|
|
|
7
7
|
animationProgress: number;
|
|
8
8
|
isDonut?: boolean;
|
|
9
9
|
onSliceClick?: (dataPoint: ChartDataPoint, index: number) => void;
|
|
10
|
-
showTooltip: (x: number, y: number, content:
|
|
10
|
+
showTooltip: (x: number, y: number, content: React.ReactNode) => void;
|
|
11
11
|
hideTooltip: () => void;
|
|
12
12
|
views?: any;
|
|
13
13
|
}
|