@astryxdesign/lab 0.7.9-canary.de1be1f → 0.7.9-canary.e2b522f
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/Chart/formatters.d.ts +9 -6
- package/dist/Chart/formatters.d.ts.map +1 -1
- package/dist/Chart/formatters.js +16 -11
- package/dist/Schedule/DayView.d.ts.map +1 -1
- package/dist/Schedule/DayView.js +7 -4
- package/dist/Schedule/ListView.d.ts.map +1 -1
- package/dist/Schedule/ListView.js +8 -9
- package/dist/Schedule/MonthlyView.d.ts.map +1 -1
- package/dist/Schedule/MonthlyView.js +25 -18
- package/dist/Schedule/TimeGridView.d.ts.map +1 -1
- package/dist/Schedule/TimeGridView.js +22 -16
- package/dist/Schedule/WeeklyView.d.ts.map +1 -1
- package/dist/Schedule/WeeklyView.js +4 -4
- package/dist/Schedule/shared.d.ts +19 -13
- package/dist/Schedule/shared.d.ts.map +1 -1
- package/dist/Schedule/shared.js +80 -62
- package/package.json +7 -6
- package/src/Chart/formatters.test.ts +36 -0
- package/src/Chart/formatters.ts +28 -16
- package/src/Schedule/DayView.tsx +4 -3
- package/src/Schedule/ListView.tsx +8 -14
- package/src/Schedule/MonthlyView.tsx +27 -18
- package/src/Schedule/Schedule.calendarSystems.test.tsx +317 -0
- package/src/Schedule/Schedule.doc.mjs +1 -1
- package/src/Schedule/Schedule.test.tsx +2 -2
- package/src/Schedule/TimeGridView.tsx +31 -9
- package/src/Schedule/WeeklyView.tsx +4 -6
- package/src/Schedule/shared.tsx +112 -68
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file formatters.ts
|
|
3
|
-
* @input Tick values
|
|
3
|
+
* @input Tick values, optional BCP 47 locale tags, and for dates an optional
|
|
4
|
+
* calendar
|
|
4
5
|
* @output Built-in tick format utilities for common data types
|
|
5
6
|
* @position Utility; consumed by ChartAxis via tickFormat prop
|
|
6
7
|
*/
|
|
7
|
-
import type { Locale } from '@astryxdesign/core/i18n';
|
|
8
|
+
import type { CalendarSystem, Locale } from '@astryxdesign/core/i18n';
|
|
8
9
|
/**
|
|
9
10
|
* Compact number formatter (e.g. 1200 → "1.2K", 1500000 → "1.5M")
|
|
10
11
|
*/
|
|
@@ -25,11 +26,13 @@ export declare function currency(symbol?: string, locale?: Locale): (value: unkn
|
|
|
25
26
|
*/
|
|
26
27
|
export declare function percent(value: unknown): string;
|
|
27
28
|
/**
|
|
28
|
-
* Date formatter — short date (e.g. "Jan 5", "Mar 12")
|
|
29
|
+
* Date formatter — short date (e.g. "Jan 5", "Mar 12"), in `calendar`
|
|
30
|
+
* (Gregorian by default)
|
|
29
31
|
*/
|
|
30
|
-
export declare function shortDate(value: unknown, locale?: Locale): string;
|
|
32
|
+
export declare function shortDate(value: unknown, locale?: Locale, calendar?: CalendarSystem): string;
|
|
31
33
|
/**
|
|
32
|
-
* Date formatter — month/year (e.g. "Jan 2024", "Mar 2025")
|
|
34
|
+
* Date formatter — month/year (e.g. "Jan 2024", "Mar 2025"), in `calendar`
|
|
35
|
+
* (Gregorian by default)
|
|
33
36
|
*/
|
|
34
|
-
export declare function monthYear(value: unknown, locale?: Locale): string;
|
|
37
|
+
export declare function monthYear(value: unknown, locale?: Locale, calendar?: CalendarSystem): string;
|
|
35
38
|
//# sourceMappingURL=formatters.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatters.d.ts","sourceRoot":"","sources":["../../src/Chart/formatters.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"formatters.d.ts","sourceRoot":"","sources":["../../src/Chart/formatters.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAC,cAAc,EAAE,MAAM,EAAC,MAAM,yBAAyB,CAAC;AAGpE;;GAEG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAepD;AAED;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,CACtB,MAAM,SAAM,EACZ,MAAM,GAAE,MAAa,GACpB,CAAC,KAAK,EAAE,OAAO,KAAK,MAAM,CAiB5B;AAQD;;GAEG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAM9C;AAED;;;GAGG;AACH,wBAAgB,SAAS,CACvB,KAAK,EAAE,OAAO,EACd,MAAM,GAAE,MAAa,EACrB,QAAQ,GAAE,cAA0B,GACnC,MAAM,CAUR;AAED;;;GAGG;AACH,wBAAgB,SAAS,CACvB,KAAK,EAAE,OAAO,EACd,MAAM,GAAE,MAAa,EACrB,QAAQ,GAAE,cAA0B,GACnC,MAAM,CAUR"}
|
package/dist/Chart/formatters.js
CHANGED
|
@@ -2,11 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @file formatters.ts
|
|
5
|
-
* @input Tick values
|
|
5
|
+
* @input Tick values, optional BCP 47 locale tags, and for dates an optional
|
|
6
|
+
* calendar
|
|
6
7
|
* @output Built-in tick format utilities for common data types
|
|
7
8
|
* @position Utility; consumed by ChartAxis via tickFormat prop
|
|
8
9
|
*/
|
|
9
10
|
|
|
11
|
+
import { plainDateFormat, plainDateFromDate } from '@astryxdesign/core/utils';
|
|
12
|
+
|
|
10
13
|
/**
|
|
11
14
|
* Compact number formatter (e.g. 1200 → "1.2K", 1500000 → "1.5M")
|
|
12
15
|
*/
|
|
@@ -74,31 +77,33 @@ export function percent(value) {
|
|
|
74
77
|
}
|
|
75
78
|
|
|
76
79
|
/**
|
|
77
|
-
* Date formatter — short date (e.g. "Jan 5", "Mar 12")
|
|
80
|
+
* Date formatter — short date (e.g. "Jan 5", "Mar 12"), in `calendar`
|
|
81
|
+
* (Gregorian by default)
|
|
78
82
|
*/
|
|
79
|
-
export function shortDate(value, locale = 'en') {
|
|
83
|
+
export function shortDate(value, locale = 'en', calendar = 'gregory') {
|
|
80
84
|
const d = value instanceof Date ? value : new Date(Number(value));
|
|
81
85
|
if (isNaN(d.getTime())) {
|
|
82
86
|
return String(value);
|
|
83
87
|
}
|
|
84
|
-
return
|
|
88
|
+
return plainDateFormat(plainDateFromDate(d), {
|
|
85
89
|
month: 'short',
|
|
86
90
|
day: 'numeric',
|
|
87
|
-
calendar
|
|
88
|
-
})
|
|
91
|
+
calendar
|
|
92
|
+
}, locale);
|
|
89
93
|
}
|
|
90
94
|
|
|
91
95
|
/**
|
|
92
|
-
* Date formatter — month/year (e.g. "Jan 2024", "Mar 2025")
|
|
96
|
+
* Date formatter — month/year (e.g. "Jan 2024", "Mar 2025"), in `calendar`
|
|
97
|
+
* (Gregorian by default)
|
|
93
98
|
*/
|
|
94
|
-
export function monthYear(value, locale = 'en') {
|
|
99
|
+
export function monthYear(value, locale = 'en', calendar = 'gregory') {
|
|
95
100
|
const d = value instanceof Date ? value : new Date(Number(value));
|
|
96
101
|
if (isNaN(d.getTime())) {
|
|
97
102
|
return String(value);
|
|
98
103
|
}
|
|
99
|
-
return
|
|
104
|
+
return plainDateFormat(plainDateFromDate(d), {
|
|
100
105
|
month: 'short',
|
|
101
106
|
year: 'numeric',
|
|
102
|
-
calendar
|
|
103
|
-
})
|
|
107
|
+
calendar
|
|
108
|
+
}, locale);
|
|
104
109
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DayView.d.ts","sourceRoot":"","sources":["../../src/Schedule/DayView.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EACV,2BAA2B,EAE3B,YAAY,EAEb,MAAM,SAAS,CAAC;AAEjB,MAAM,MAAM,sBAAsB,GAAG,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"DayView.d.ts","sourceRoot":"","sources":["../../src/Schedule/DayView.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EACV,2BAA2B,EAE3B,YAAY,EAEb,MAAM,SAAS,CAAC;AAEjB,MAAM,MAAM,sBAAsB,GAAG,2BAA2B,CAAC;AAqCjE,wBAAgB,qBAAqB,CAAC,EACpC,OAAW,EACX,OAAY,EACZ,UAAgB,EAChB,aAAa,GACd,GAAE,sBAA2B,GAAG,YAAY,CAAC,sBAAsB,CAAC,CAgCpE"}
|
package/dist/Schedule/DayView.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
import { DATE_FORMAT_WITH_WEEKDAY, plainDateAddDays, plainDateFormat } from '@astryxdesign/core/utils';
|
|
12
12
|
import { enumerateDates, getScheduleRangeFromDates } from "./dateMath.js";
|
|
13
13
|
import { useScheduleContext } from "./context.js";
|
|
14
|
-
import { ScheduleMonthTitle, ScheduleFrame } from "./shared.js";
|
|
14
|
+
import { ScheduleMonthTitle, ScheduleFrame, useScheduleCalendar } from "./shared.js";
|
|
15
15
|
import { TimeGridView } from "./TimeGridView.js";
|
|
16
16
|
import { scheduleRangeToZonedDateTimeRange } from "./zonedDateTime.js";
|
|
17
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -35,11 +35,14 @@ function ScheduleDayView({
|
|
|
35
35
|
} = options;
|
|
36
36
|
const rangeDate = date.toPlainDate();
|
|
37
37
|
const days = enumerateDates(range.startDate, range.endDate);
|
|
38
|
-
const
|
|
38
|
+
const calendar = useScheduleCalendar();
|
|
39
|
+
const titleLabel = plainDateFormat(rangeDate, {
|
|
40
|
+
...DATE_FORMAT_WITH_WEEKDAY,
|
|
41
|
+
calendar
|
|
42
|
+
}, locale);
|
|
39
43
|
return /*#__PURE__*/_jsx(ScheduleFrame, {
|
|
40
44
|
title: /*#__PURE__*/_jsx(ScheduleMonthTitle, {
|
|
41
|
-
date: rangeDate
|
|
42
|
-
timezoneID: timezoneID
|
|
45
|
+
date: rangeDate
|
|
43
46
|
}),
|
|
44
47
|
titleLabel: titleLabel,
|
|
45
48
|
isLoading: isLoading,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListView.d.ts","sourceRoot":"","sources":["../../src/Schedule/ListView.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ListView.d.ts","sourceRoot":"","sources":["../../src/Schedule/ListView.tsx"],"names":[],"mappings":"AAyCA,OAAO,KAAK,EAGV,YAAY,EAEb,MAAM,SAAS,CAAC;AAEjB,MAAM,WAAW,uBAAuB;IACtC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAwID,wBAAgB,sBAAsB,CAAC,EACrC,IAAI,EAAE,QAAY,GACnB,GAAE,uBAA4B,GAAG,YAAY,CAAC,uBAAuB,CAAC,CAmCtE"}
|
|
@@ -13,7 +13,7 @@ import { plainDateAddDays, plainDateFromInstant, plainDateIsEqual, plainDateToIS
|
|
|
13
13
|
import { Heading } from '@astryxdesign/core/Text';
|
|
14
14
|
import { enumerateDates, eventOccursOnDate, getScheduleRangeFromDates, isDayEvent } from "./dateMath.js";
|
|
15
15
|
import { useScheduleContext } from "./context.js";
|
|
16
|
-
import { formatDayNumber, formatFullDate, formatWeekday, formatWeekTitle, isEventInPast, ListEventRow, ScheduleFrame, ScheduleRangeMonthTitle, styles } from "./shared.js";
|
|
16
|
+
import { formatDayNumber, formatFullDate, formatWeekday, formatWeekTitle, isEventInPast, ListEventRow, ScheduleFrame, ScheduleRangeMonthTitle, styles, useScheduleCalendar } from "./shared.js";
|
|
17
17
|
import { useCurrentTime } from "./useCurrentTime.js";
|
|
18
18
|
import { scheduleRangeToZonedDateTimeRange } from "./zonedDateTime.js";
|
|
19
19
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -26,11 +26,12 @@ function ScheduleListView(_props) {
|
|
|
26
26
|
isLoading,
|
|
27
27
|
headingLevel
|
|
28
28
|
} = useScheduleContext();
|
|
29
|
+
const calendar = useScheduleCalendar();
|
|
29
30
|
const days = enumerateDates(range.startDate, range.endDate);
|
|
30
31
|
const currentTime = useCurrentTime();
|
|
31
32
|
const currentPlainDate = plainDateFromInstant(currentTime, timezoneID);
|
|
32
33
|
const endDate = plainDateAddDays(range.endDate, -1);
|
|
33
|
-
const titleLabel = formatWeekTitle(range.startDate, endDate,
|
|
34
|
+
const titleLabel = formatWeekTitle(range.startDate, endDate, locale, calendar);
|
|
34
35
|
const visibleDays = days.map(day => {
|
|
35
36
|
const isCurrentDay = plainDateIsEqual(day, currentPlainDate);
|
|
36
37
|
const isBaseDay = plainDateIsEqual(day, range.startDate);
|
|
@@ -45,8 +46,7 @@ function ScheduleListView(_props) {
|
|
|
45
46
|
return /*#__PURE__*/_jsx(ScheduleFrame, {
|
|
46
47
|
title: /*#__PURE__*/_jsx(ScheduleRangeMonthTitle, {
|
|
47
48
|
start: range.startDate,
|
|
48
|
-
end: endDate
|
|
49
|
-
timezoneID: timezoneID
|
|
49
|
+
end: endDate
|
|
50
50
|
}),
|
|
51
51
|
titleLabel: titleLabel,
|
|
52
52
|
isLoading: isLoading,
|
|
@@ -61,7 +61,6 @@ function ScheduleListView(_props) {
|
|
|
61
61
|
children: [/*#__PURE__*/_jsx(ListDayHeading, {
|
|
62
62
|
day: day,
|
|
63
63
|
isCurrentDay: isCurrentDay,
|
|
64
|
-
timezoneID: timezoneID,
|
|
65
64
|
headingLevel: headingLevel
|
|
66
65
|
}), /*#__PURE__*/_jsx("div", {
|
|
67
66
|
...stylex.props(styles.listEvents),
|
|
@@ -79,26 +78,26 @@ function ScheduleListView(_props) {
|
|
|
79
78
|
function ListDayHeading({
|
|
80
79
|
day,
|
|
81
80
|
isCurrentDay,
|
|
82
|
-
timezoneID,
|
|
83
81
|
headingLevel
|
|
84
82
|
}) {
|
|
85
83
|
const {
|
|
86
84
|
locale
|
|
87
85
|
} = useScheduleContext();
|
|
86
|
+
const calendar = useScheduleCalendar();
|
|
88
87
|
return /*#__PURE__*/_jsxs(Heading, {
|
|
89
88
|
level: headingLevel,
|
|
90
89
|
color: "secondary",
|
|
91
90
|
display: "block",
|
|
92
|
-
"aria-label": formatFullDate(day,
|
|
91
|
+
"aria-label": formatFullDate(day, locale, calendar),
|
|
93
92
|
"aria-current": isCurrentDay ? 'date' : undefined,
|
|
94
93
|
xstyle: styles.listDayHeading,
|
|
95
94
|
children: [/*#__PURE__*/_jsx("span", {
|
|
96
95
|
...stylex.props(styles.listDayNumber, isCurrentDay && styles.listDayNumberCurrent),
|
|
97
96
|
children: /*#__PURE__*/_jsx("span", {
|
|
98
97
|
...stylex.props(styles.listDayNumberText),
|
|
99
|
-
children: formatDayNumber(day,
|
|
98
|
+
children: formatDayNumber(day, locale, calendar)
|
|
100
99
|
})
|
|
101
|
-
}), formatWeekday(day,
|
|
100
|
+
}), formatWeekday(day, 'short', locale, calendar)]
|
|
102
101
|
});
|
|
103
102
|
}
|
|
104
103
|
function renderListRows({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MonthlyView.d.ts","sourceRoot":"","sources":["../../src/Schedule/MonthlyView.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AAEH,OAAO,EAAS,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"MonthlyView.d.ts","sourceRoot":"","sources":["../../src/Schedule/MonthlyView.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AAEH,OAAO,EAAS,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAqD7C,OAAO,KAAK,EACV,aAAa,EAEb,YAAY,EAEb,MAAM,SAAS,CAAC;AAEjB,MAAM,WAAW,0BAA0B;IACzC,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACzC;;;;OAIG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,SAAS,CAAC;CACrD;AA2lBD,wBAAgB,yBAAyB,CAAC,EACxC,YAAgB,EAChB,aAAa,GACd,GAAE,0BAA+B,GAAG,YAAY,CAAC,0BAA0B,CAAC,CAmC5E"}
|
|
@@ -21,7 +21,7 @@ import { Heading, Text } from '@astryxdesign/core/Text';
|
|
|
21
21
|
import { enumerateDates, getScheduleRangeFromDates, isDayEvent } from "./dateMath.js";
|
|
22
22
|
import { useScheduleContext } from "./context.js";
|
|
23
23
|
import { getEventDateSpan, layoutMonthEvents, MONTH_VISIBLE_LEVELS } from "./monthLayout.js";
|
|
24
|
-
import { formatDayNumber, formatEventAccessibilityLabel, formatEventTimeRange, formatFullDate,
|
|
24
|
+
import { formatDayNumber, formatEventAccessibilityLabel, formatEventTimeRange, formatFullDate, formatWeekday, formatWeekRange, formatWeekTitle, getEventCategory, isEventInPast, ListEventRow, MonthEventPill, ScheduleFrame, SchedulePopoverBody, ScheduleRangeMonthTitle, styles, useScheduleCalendar } from "./shared.js";
|
|
25
25
|
import { useCurrentTime } from "./useCurrentTime.js";
|
|
26
26
|
import { useScheduleViewPopover } from "./useScheduleViewPopover.js";
|
|
27
27
|
import { scheduleRangeToZonedDateTimeRange } from "./zonedDateTime.js";
|
|
@@ -87,6 +87,7 @@ function ScheduleMonthlyView({
|
|
|
87
87
|
isLoading,
|
|
88
88
|
headingLevel
|
|
89
89
|
} = useScheduleContext();
|
|
90
|
+
const calendar = useScheduleCalendar();
|
|
90
91
|
const rangeDate = date.toPlainDate();
|
|
91
92
|
const highlightedDate = focusDate.toPlainDate();
|
|
92
93
|
const currentTime = useCurrentTime();
|
|
@@ -113,7 +114,11 @@ function ScheduleMonthlyView({
|
|
|
113
114
|
// day's list named by its full date, or one event's content named by its
|
|
114
115
|
// title.
|
|
115
116
|
const dayByISO = new Map(days.map(day => [plainDateToISO(day), day]));
|
|
116
|
-
|
|
117
|
+
// The grid shows one Gregorian month, which can span two months of the
|
|
118
|
+
// calendar, so its title names both.
|
|
119
|
+
const monthStart = plainDateSetFirstOfMonth(rangeDate);
|
|
120
|
+
const monthEnd = plainDateAddDays(plainDateAddMonths(monthStart, 1), -1);
|
|
121
|
+
const monthTitle = formatWeekTitle(monthStart, monthEnd, locale, calendar);
|
|
117
122
|
const tableRef = useRef(null);
|
|
118
123
|
// Where each chip painted so far starts, so focus can land on that cell if
|
|
119
124
|
// the chip goes away while its popover is open.
|
|
@@ -131,7 +136,7 @@ function ScheduleMonthlyView({
|
|
|
131
136
|
}
|
|
132
137
|
if (parsed.kind === 'day') {
|
|
133
138
|
const day = dayByISO.get(parsed.dayISO);
|
|
134
|
-
return day == null ? monthTitle : formatFullDate(day,
|
|
139
|
+
return day == null ? monthTitle : formatFullDate(day, locale, calendar);
|
|
135
140
|
}
|
|
136
141
|
return eventByID.get(parsed.eventID)?.title ?? monthTitle;
|
|
137
142
|
},
|
|
@@ -163,7 +168,7 @@ function ScheduleMonthlyView({
|
|
|
163
168
|
if (openDay != null) {
|
|
164
169
|
const openDayISO = plainDateToISO(openDay);
|
|
165
170
|
openContent = /*#__PURE__*/_jsx(SchedulePopoverBody, {
|
|
166
|
-
label: `${formatFullDate(openDay,
|
|
171
|
+
label: `${formatFullDate(openDay, locale, calendar)} events`,
|
|
167
172
|
children: /*#__PURE__*/_jsx(MonthDayEvents, {
|
|
168
173
|
day: openDay,
|
|
169
174
|
events: eventsByDay.get(openDayISO) ?? EMPTY_EVENTS,
|
|
@@ -179,9 +184,9 @@ function ScheduleMonthlyView({
|
|
|
179
184
|
});
|
|
180
185
|
}
|
|
181
186
|
return /*#__PURE__*/_jsxs(ScheduleFrame, {
|
|
182
|
-
title: /*#__PURE__*/_jsx(
|
|
183
|
-
|
|
184
|
-
|
|
187
|
+
title: /*#__PURE__*/_jsx(ScheduleRangeMonthTitle, {
|
|
188
|
+
start: monthStart,
|
|
189
|
+
end: monthEnd
|
|
185
190
|
}),
|
|
186
191
|
titleLabel: monthTitle,
|
|
187
192
|
isLoading: isLoading,
|
|
@@ -202,7 +207,7 @@ function ScheduleMonthlyView({
|
|
|
202
207
|
children: "Week"
|
|
203
208
|
}), days.slice(0, 7).map((day, index) => /*#__PURE__*/_jsx("div", {
|
|
204
209
|
role: "columnheader",
|
|
205
|
-
"aria-label": formatWeekday(day,
|
|
210
|
+
"aria-label": formatWeekday(day, 'long', locale, calendar),
|
|
206
211
|
"aria-colindex": index + 2,
|
|
207
212
|
...stylex.props(styles.weekdayLabel),
|
|
208
213
|
children: /*#__PURE__*/_jsx(Heading, {
|
|
@@ -210,7 +215,7 @@ function ScheduleMonthlyView({
|
|
|
210
215
|
color: "secondary",
|
|
211
216
|
display: "block",
|
|
212
217
|
xstyle: styles.weekdayHeading,
|
|
213
|
-
children: formatWeekday(day,
|
|
218
|
+
children: formatWeekday(day, 'short', locale, calendar)
|
|
214
219
|
})
|
|
215
220
|
}, plainDateToISO(day)))]
|
|
216
221
|
}), /*#__PURE__*/_jsx("div", {
|
|
@@ -224,7 +229,7 @@ function ScheduleMonthlyView({
|
|
|
224
229
|
role: "rowheader",
|
|
225
230
|
"aria-colindex": 1,
|
|
226
231
|
...stylex.props(styles.visuallyHidden),
|
|
227
|
-
children: formatWeekRange(week[0], week[week.length - 1], timezoneID, locale)
|
|
232
|
+
children: formatWeekRange(week[0], week[week.length - 1], timezoneID, locale, calendar)
|
|
228
233
|
}), week.map((day, dayIndex) => {
|
|
229
234
|
const index = weekIndex * 7 + dayIndex;
|
|
230
235
|
const isOutsideMonth = day.month !== rangeDate.month;
|
|
@@ -233,7 +238,7 @@ function ScheduleMonthlyView({
|
|
|
233
238
|
const hiddenCount = overflowByDay.get(index);
|
|
234
239
|
return /*#__PURE__*/_jsxs("div", {
|
|
235
240
|
role: "cell",
|
|
236
|
-
"aria-label": formatFullDate(day,
|
|
241
|
+
"aria-label": formatFullDate(day, locale, calendar),
|
|
237
242
|
"aria-colindex": dayIndex + 2
|
|
238
243
|
// Focus lands here when the day's "+N more" goes away.
|
|
239
244
|
,
|
|
@@ -248,7 +253,7 @@ function ScheduleMonthlyView({
|
|
|
248
253
|
color: "inherit",
|
|
249
254
|
weight: "medium",
|
|
250
255
|
hasTabularNumbers: true,
|
|
251
|
-
children: formatDayNumber(day,
|
|
256
|
+
children: formatDayNumber(day, locale, calendar)
|
|
252
257
|
})
|
|
253
258
|
}), (chipsByDay.get(index) ?? EMPTY_CHIPS).map(chip => {
|
|
254
259
|
const key = chipKey(chip);
|
|
@@ -256,7 +261,7 @@ function ScheduleMonthlyView({
|
|
|
256
261
|
const startDay = days[chip.week * 7 + chip.columnStart];
|
|
257
262
|
return hasPopover && startDay != null ? /*#__PURE__*/_jsx("span", {
|
|
258
263
|
...stylex.props(styles.visuallyHidden),
|
|
259
|
-
children: formatMonthEventName(chip.event, `since ${formatFullDate(startDay,
|
|
264
|
+
children: formatMonthEventName(chip.event, `since ${formatFullDate(startDay, locale, calendar)}`, timezoneID, categories, locale)
|
|
260
265
|
}, key) : null;
|
|
261
266
|
}
|
|
262
267
|
chipStartDay.set(key, dayISO);
|
|
@@ -275,7 +280,7 @@ function ScheduleMonthlyView({
|
|
|
275
280
|
}, event.id))
|
|
276
281
|
}), hiddenCount != null && /*#__PURE__*/_jsx("button", {
|
|
277
282
|
type: "button",
|
|
278
|
-
"aria-label": `${hiddenCount} more ${hiddenCount === 1 ? 'event' : 'events'}, ${formatFullDate(day,
|
|
283
|
+
"aria-label": `${hiddenCount} more ${hiddenCount === 1 ? 'event' : 'events'}, ${formatFullDate(day, locale, calendar)}`,
|
|
279
284
|
...monthPopover.getTriggerProps(dayKey(dayISO),
|
|
280
285
|
// An event handed over from this day's list
|
|
281
286
|
// keeps "+N more" as its trigger while the
|
|
@@ -321,6 +326,7 @@ function MonthChip({
|
|
|
321
326
|
timezoneID,
|
|
322
327
|
locale
|
|
323
328
|
} = useScheduleContext();
|
|
329
|
+
const calendar = useScheduleCalendar();
|
|
324
330
|
const placement = [styles.monthChip(chip.columnEnd - chip.columnStart + 1, chip.level), isLastColumn && styles.monthChipInLastColumn];
|
|
325
331
|
const pill = /*#__PURE__*/_jsx(MonthEventPill, {
|
|
326
332
|
event: chip.event,
|
|
@@ -335,7 +341,7 @@ function MonthChip({
|
|
|
335
341
|
children: pill
|
|
336
342
|
});
|
|
337
343
|
}
|
|
338
|
-
const name = formatMonthEventName(chip.event, formatEventDays(chip.event, timezoneID, locale), timezoneID, categories, locale);
|
|
344
|
+
const name = formatMonthEventName(chip.event, formatEventDays(chip.event, timezoneID, locale, calendar), timezoneID, categories, locale);
|
|
339
345
|
if (renderPopover(chip.event) == null) {
|
|
340
346
|
return /*#__PURE__*/_jsxs("div", {
|
|
341
347
|
"data-schedule-month-chip": "",
|
|
@@ -375,8 +381,9 @@ function MonthDayEvents({
|
|
|
375
381
|
timezoneID,
|
|
376
382
|
locale
|
|
377
383
|
} = useScheduleContext();
|
|
384
|
+
const calendar = useScheduleCalendar();
|
|
378
385
|
const currentTime = useCurrentTime();
|
|
379
|
-
const fullDate = formatFullDate(day,
|
|
386
|
+
const fullDate = formatFullDate(day, locale, calendar);
|
|
380
387
|
return /*#__PURE__*/_jsxs("div", {
|
|
381
388
|
...stylex.props(styles.monthDayEvents),
|
|
382
389
|
children: [/*#__PURE__*/_jsx(Text, {
|
|
@@ -416,9 +423,9 @@ function formatMonthEventName(event, dayLabel, timezoneID, categories, locale) {
|
|
|
416
423
|
}
|
|
417
424
|
|
|
418
425
|
/** The event's day, or its date range when it covers several days. */
|
|
419
|
-
function formatEventDays(event, timezoneID, locale) {
|
|
426
|
+
function formatEventDays(event, timezoneID, locale, calendar) {
|
|
420
427
|
const [first, last] = getEventDateSpan(event, timezoneID);
|
|
421
|
-
return plainDateIsEqual(first, last) ? formatFullDate(first,
|
|
428
|
+
return plainDateIsEqual(first, last) ? formatFullDate(first, locale, calendar) : formatWeekRange(first, last, timezoneID, locale, calendar);
|
|
422
429
|
}
|
|
423
430
|
function getWeeks(days) {
|
|
424
431
|
const weeks = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimeGridView.d.ts","sourceRoot":"","sources":["../../src/Schedule/TimeGridView.tsx"],"names":[],"mappings":"AAIA;;;;;;GAMG;AAEH,OAAO,EASL,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"TimeGridView.d.ts","sourceRoot":"","sources":["../../src/Schedule/TimeGridView.tsx"],"names":[],"mappings":"AAIA;;;;;;GAMG;AAEH,OAAO,EASL,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AAOf,OAAO,EASL,KAAK,SAAS,EACf,MAAM,0BAA0B,CAAC;AAoClC,OAAO,KAAK,EACV,aAAa,EAGd,MAAM,SAAS,CAAC;AAEjB,wBAAgB,YAAY,CAAC,EAC3B,IAAI,EACJ,MAAM,EACN,SAAS,EACT,UAAU,EACV,OAAO,EACP,OAAO,EACP,UAAU,EACV,KAAK,EACL,aAAa,GACd,EAAE;IACD,IAAI,EAAE,SAAS,EAAE,CAAC;IAClB,MAAM,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC;IACrC,SAAS,EAAE,SAAS,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,wEAAwE;IACxE,KAAK,EAAE,MAAM,CAAC;IACd,gFAAgF;IAChF,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,SAAS,CAAC;CACrD,+BAglBA"}
|
|
@@ -20,7 +20,7 @@ import { Heading, Text } from '@astryxdesign/core/Text';
|
|
|
20
20
|
import { useScheduleContext } from "./context.js";
|
|
21
21
|
import { eventOccursOnDate, isAllDaySpan, isDayEvent } from "./dateMath.js";
|
|
22
22
|
import { timeGridViewportScope } from "./schedule.stylex.js";
|
|
23
|
-
import { clamp, EventPill, eventPastSurfaceColorStyle, eventSurfaceColorStyle, formatDayNumber, formatEventDateTimeRange, formatEventTime, formatEventTimeRange, formatFullDate, formatHour, formatTimezoneAbbreviation, formatWeekday, getEventCategory, getMinutesSinceStartOfDay, isEventInPast, SchedulePopoverBody, ScheduleTime, styles, TitleFirstPill } from "./shared.js";
|
|
23
|
+
import { clamp, EventPill, eventPastSurfaceColorStyle, eventSurfaceColorStyle, formatDayNumber, formatEventDateTimeRange, formatEventTime, formatEventTimeRange, formatFullDate, formatHour, formatTimezoneAbbreviation, formatWeekday, getEventCategory, getMinutesSinceStartOfDay, isEventInPast, SchedulePopoverBody, ScheduleTime, styles, TitleFirstPill, useScheduleCalendar } from "./shared.js";
|
|
24
24
|
import { layoutTimedEvents } from "./timeGridLayout.js";
|
|
25
25
|
import { getInitialTimeGridOffset, isSameRangeKey, TimeGridScrollMemoryContext } from "./timeGridScrollMemory.js";
|
|
26
26
|
import { useCurrentTime } from "./useCurrentTime.js";
|
|
@@ -42,6 +42,7 @@ export function TimeGridView({
|
|
|
42
42
|
locale,
|
|
43
43
|
range
|
|
44
44
|
} = useScheduleContext();
|
|
45
|
+
const calendar = useScheduleCalendar();
|
|
45
46
|
const hasPopover = renderPopover != null;
|
|
46
47
|
const normalizedMinHour = Math.max(0, Math.min(23, Math.floor(minHour)));
|
|
47
48
|
const normalizedMaxHour = Math.max(normalizedMinHour + 1, Math.min(24, Math.floor(maxHour)));
|
|
@@ -238,6 +239,7 @@ export function TimeGridView({
|
|
|
238
239
|
focusDate: focusDate,
|
|
239
240
|
hours: hours,
|
|
240
241
|
locale: locale,
|
|
242
|
+
calendar: calendar,
|
|
241
243
|
timezoneID: timezoneID,
|
|
242
244
|
timezoneLabel: timezoneLabel
|
|
243
245
|
}), /*#__PURE__*/_jsxs("div", {
|
|
@@ -259,9 +261,9 @@ export function TimeGridView({
|
|
|
259
261
|
xstyle: styles.timeGridHeaderHeading,
|
|
260
262
|
children: /*#__PURE__*/_jsxs("span", {
|
|
261
263
|
...stylex.props(styles.timeGridHeaderHeadingContent),
|
|
262
|
-
children: [formatWeekday(day,
|
|
264
|
+
children: [formatWeekday(day, 'short', locale, calendar), /*#__PURE__*/_jsx("span", {
|
|
263
265
|
...stylex.props(styles.timeGridDayNumber, plainDateIsEqual(day, focusDate) && styles.timeGridCurrentDayPill),
|
|
264
|
-
children: formatDayNumber(day,
|
|
266
|
+
children: formatDayNumber(day, locale, calendar)
|
|
265
267
|
})]
|
|
266
268
|
})
|
|
267
269
|
})
|
|
@@ -311,7 +313,7 @@ export function TimeGridView({
|
|
|
311
313
|
}
|
|
312
314
|
if (content == null) {
|
|
313
315
|
return /*#__PURE__*/_jsx("div", {
|
|
314
|
-
"aria-label": formatEventButtonLabel(segment.event, day, timezoneID, categories, locale),
|
|
316
|
+
"aria-label": formatEventButtonLabel(segment.event, day, timezoneID, categories, locale, calendar),
|
|
315
317
|
...stylex.props(placement),
|
|
316
318
|
children: pill
|
|
317
319
|
}, key);
|
|
@@ -324,7 +326,7 @@ export function TimeGridView({
|
|
|
324
326
|
}
|
|
325
327
|
return /*#__PURE__*/_jsx("button", {
|
|
326
328
|
type: "button",
|
|
327
|
-
"aria-label": formatEventButtonLabel(segment.event, day, timezoneID, categories, locale),
|
|
329
|
+
"aria-label": formatEventButtonLabel(segment.event, day, timezoneID, categories, locale, calendar),
|
|
328
330
|
"aria-haspopup": "dialog",
|
|
329
331
|
"aria-expanded": isOpen,
|
|
330
332
|
"aria-controls": popover.id,
|
|
@@ -354,7 +356,7 @@ export function TimeGridView({
|
|
|
354
356
|
return /*#__PURE__*/_jsxs("div", {
|
|
355
357
|
...(hasPopover ? {
|
|
356
358
|
role: 'group',
|
|
357
|
-
'aria-label': formatFullDate(day,
|
|
359
|
+
'aria-label': formatFullDate(day, locale, calendar)
|
|
358
360
|
} : {
|
|
359
361
|
'aria-hidden': true
|
|
360
362
|
}),
|
|
@@ -402,7 +404,7 @@ export function TimeGridView({
|
|
|
402
404
|
}, event.id);
|
|
403
405
|
}
|
|
404
406
|
const popoverContent = renderPopover(event);
|
|
405
|
-
const buttonLabel = formatEventButtonLabel(event, day, timezoneID, categories, locale);
|
|
407
|
+
const buttonLabel = formatEventButtonLabel(event, day, timezoneID, categories, locale, calendar);
|
|
406
408
|
if (popoverContent == null) {
|
|
407
409
|
return /*#__PURE__*/_jsx("div", {
|
|
408
410
|
"aria-label": buttonLabel,
|
|
@@ -458,6 +460,7 @@ function TimeGridAccessibilityGrid({
|
|
|
458
460
|
focusDate,
|
|
459
461
|
hours,
|
|
460
462
|
locale,
|
|
463
|
+
calendar,
|
|
461
464
|
timezoneID,
|
|
462
465
|
timezoneLabel
|
|
463
466
|
}) {
|
|
@@ -476,7 +479,7 @@ function TimeGridAccessibilityGrid({
|
|
|
476
479
|
role: "columnheader",
|
|
477
480
|
"aria-colindex": index + 2,
|
|
478
481
|
"aria-current": plainDateIsEqual(day, focusDate) ? 'date' : undefined,
|
|
479
|
-
children: formatFullDate(day,
|
|
482
|
+
children: formatFullDate(day, locale, calendar)
|
|
480
483
|
}, plainDateToISO(day)))]
|
|
481
484
|
}), /*#__PURE__*/_jsxs("div", {
|
|
482
485
|
role: "row",
|
|
@@ -493,8 +496,9 @@ function TimeGridAccessibilityGrid({
|
|
|
493
496
|
categories,
|
|
494
497
|
day,
|
|
495
498
|
events: cellEvents,
|
|
496
|
-
label: `${formatFullDate(day,
|
|
499
|
+
label: `${formatFullDate(day, locale, calendar)} all day`,
|
|
497
500
|
locale,
|
|
501
|
+
calendar,
|
|
498
502
|
timezoneID
|
|
499
503
|
})
|
|
500
504
|
}, plainDateToISO(day));
|
|
@@ -514,8 +518,9 @@ function TimeGridAccessibilityGrid({
|
|
|
514
518
|
categories,
|
|
515
519
|
day,
|
|
516
520
|
events: cellEvents,
|
|
517
|
-
label: `${formatFullDate(day,
|
|
521
|
+
label: `${formatFullDate(day, locale, calendar)} ${formatHour(hour, locale)}`,
|
|
518
522
|
locale,
|
|
523
|
+
calendar,
|
|
519
524
|
timezoneID
|
|
520
525
|
})
|
|
521
526
|
}, plainDateToISO(day));
|
|
@@ -529,12 +534,13 @@ function formatTimeGridAccessibilityCellLabel({
|
|
|
529
534
|
events,
|
|
530
535
|
label,
|
|
531
536
|
locale,
|
|
537
|
+
calendar,
|
|
532
538
|
timezoneID
|
|
533
539
|
}) {
|
|
534
540
|
if (events.length === 0) {
|
|
535
541
|
return label;
|
|
536
542
|
}
|
|
537
|
-
const eventLabels = events.map(event => `${event.title}, ${getEventCategory(event, categories).label}, ${formatTimeGridEventTime(event, day, timezoneID, locale)}`);
|
|
543
|
+
const eventLabels = events.map(event => `${event.title}, ${getEventCategory(event, categories).label}, ${formatTimeGridEventTime(event, day, timezoneID, locale, calendar)}`);
|
|
538
544
|
return `${label}. ${eventLabels.join('. ')}`;
|
|
539
545
|
}
|
|
540
546
|
|
|
@@ -548,10 +554,10 @@ function blockKeyOf(eventID, dayISO) {
|
|
|
548
554
|
* in its name. The visible text — title, then time — leads the name, then the
|
|
549
555
|
* category and the full date.
|
|
550
556
|
*/
|
|
551
|
-
function formatEventButtonLabel(event, day, timezoneID, categories, locale) {
|
|
557
|
+
function formatEventButtonLabel(event, day, timezoneID, categories, locale, calendar) {
|
|
552
558
|
const category = getEventCategory(event, categories);
|
|
553
|
-
const timeLabel = formatTimeGridEventTime(event, day, timezoneID, locale);
|
|
554
|
-
return `${event.title}, ${timeLabel}, ${category.label}, ${formatFullDate(day,
|
|
559
|
+
const timeLabel = formatTimeGridEventTime(event, day, timezoneID, locale, calendar);
|
|
560
|
+
return `${event.title}, ${timeLabel}, ${category.label}, ${formatFullDate(day, locale, calendar)}`;
|
|
555
561
|
}
|
|
556
562
|
|
|
557
563
|
/**
|
|
@@ -559,11 +565,11 @@ function formatEventButtonLabel(event, day, timezoneID, categories, locale) {
|
|
|
559
565
|
* timed span of a day or more, which no single day frames; otherwise the
|
|
560
566
|
* start and end times (component:Schedule AR2).
|
|
561
567
|
*/
|
|
562
|
-
function formatTimeGridEventTime(event, day, timezoneID, locale) {
|
|
568
|
+
function formatTimeGridEventTime(event, day, timezoneID, locale, calendar) {
|
|
563
569
|
if (isDayEvent(event)) {
|
|
564
570
|
return 'all day';
|
|
565
571
|
}
|
|
566
|
-
return isAllDaySpan(event) ? formatEventDateTimeRange(event, timezoneID, locale) : formatEventTime(event, day, timezoneID, locale);
|
|
572
|
+
return isAllDaySpan(event) ? formatEventDateTimeRange(event, timezoneID, locale, calendar) : formatEventTime(event, day, timezoneID, locale);
|
|
567
573
|
}
|
|
568
574
|
function eventOverlapsHour(event, day, hour, timezoneID) {
|
|
569
575
|
if (!eventOccursOnDate(event, day, timezoneID)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WeeklyView.d.ts","sourceRoot":"","sources":["../../src/Schedule/WeeklyView.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WeeklyView.d.ts","sourceRoot":"","sources":["../../src/Schedule/WeeklyView.tsx"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAEV,2BAA2B,EAC3B,YAAY,EAEb,MAAM,SAAS,CAAC;AAEjB,MAAM,WAAW,yBAA0B,SAAQ,2BAA2B;IAC5E,yDAAyD;IACzD,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;CAC1C;AAwCD,wBAAgB,wBAAwB,CAAC,EACvC,YAAgB,EAChB,OAAW,EACX,OAAY,EACZ,UAAgB,EAChB,aAAa,GACd,GAAE,yBAA8B,GAAG,YAAY,CAAC,yBAAyB,CAAC,CAmC1E"}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
import { plainDateAddDays, plainDateSetStartOfWeek } from '@astryxdesign/core/utils';
|
|
12
12
|
import { enumerateDates, getScheduleRangeFromDates } from "./dateMath.js";
|
|
13
13
|
import { useScheduleContext } from "./context.js";
|
|
14
|
-
import { formatWeekTitle, ScheduleFrame, ScheduleRangeMonthTitle } from "./shared.js";
|
|
14
|
+
import { formatWeekTitle, ScheduleFrame, ScheduleRangeMonthTitle, useScheduleCalendar } from "./shared.js";
|
|
15
15
|
import { TimeGridView } from "./TimeGridView.js";
|
|
16
16
|
import { scheduleRangeToZonedDateTimeRange } from "./zonedDateTime.js";
|
|
17
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -26,6 +26,7 @@ function ScheduleWeeklyView({
|
|
|
26
26
|
range,
|
|
27
27
|
isLoading
|
|
28
28
|
} = useScheduleContext();
|
|
29
|
+
const calendar = useScheduleCalendar();
|
|
29
30
|
const {
|
|
30
31
|
minHour = 0,
|
|
31
32
|
maxHour = 24,
|
|
@@ -34,12 +35,11 @@ function ScheduleWeeklyView({
|
|
|
34
35
|
} = options;
|
|
35
36
|
const days = enumerateDates(range.startDate, range.endDate);
|
|
36
37
|
const highlightedDate = focusDate.toPlainDate();
|
|
37
|
-
const titleLabel = formatWeekTitle(days[0], days[days.length - 1],
|
|
38
|
+
const titleLabel = formatWeekTitle(days[0], days[days.length - 1], locale, calendar);
|
|
38
39
|
return /*#__PURE__*/_jsx(ScheduleFrame, {
|
|
39
40
|
title: /*#__PURE__*/_jsx(ScheduleRangeMonthTitle, {
|
|
40
41
|
start: days[0],
|
|
41
|
-
end: days[days.length - 1]
|
|
42
|
-
timezoneID: timezoneID
|
|
42
|
+
end: days[days.length - 1]
|
|
43
43
|
}),
|
|
44
44
|
titleLabel: titleLabel,
|
|
45
45
|
isLoading: isLoading,
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file shared.tsx
|
|
3
|
-
* @input Schedule events, dates, timezone IDs, provider locale
|
|
3
|
+
* @input Schedule events, dates, timezone IDs, provider locale and calendar,
|
|
4
|
+
* and display metadata
|
|
4
5
|
* @output Shared rendering primitives, formatters, and styles for schedule views
|
|
5
6
|
* @position Internal view utility module; consumed by Monthly, Weekly, Day, and List views
|
|
6
7
|
*/
|
|
7
8
|
import { type ReactNode } from 'react';
|
|
8
9
|
import * as stylex from '@stylexjs/stylex';
|
|
9
10
|
import { type Locale } from '@astryxdesign/core/i18n';
|
|
11
|
+
import { type CalendarSystem } from '@astryxdesign/core/internal/calendar-system';
|
|
10
12
|
import { type PlainDate } from '@astryxdesign/core/utils';
|
|
11
13
|
import type { CalendarEvent, CalendarInstantEvent, Instant, ScheduleCategory, ScheduleEventColor } from './types.js';
|
|
12
14
|
export declare function ScheduleFrame({ title, titleLabel, isLoading, children, }: {
|
|
@@ -15,14 +17,18 @@ export declare function ScheduleFrame({ title, titleLabel, isLoading, children,
|
|
|
15
17
|
isLoading: boolean;
|
|
16
18
|
children: ReactNode;
|
|
17
19
|
}): import("react").JSX.Element;
|
|
18
|
-
|
|
20
|
+
/**
|
|
21
|
+
* The calendar that Schedule writes its date labels in: the provider's
|
|
22
|
+
* resolved calendar, as Core's date components resolve it. The views still lay
|
|
23
|
+
* out and step Gregorian days, weeks, and months.
|
|
24
|
+
*/
|
|
25
|
+
export declare function useScheduleCalendar(): CalendarSystem;
|
|
26
|
+
export declare function ScheduleMonthTitle({ date }: {
|
|
19
27
|
date: PlainDate;
|
|
20
|
-
timezoneID: string;
|
|
21
28
|
}): import("react").JSX.Element;
|
|
22
|
-
export declare function ScheduleRangeMonthTitle({ start, end,
|
|
29
|
+
export declare function ScheduleRangeMonthTitle({ start, end, }: {
|
|
23
30
|
start: PlainDate;
|
|
24
31
|
end: PlainDate;
|
|
25
|
-
timezoneID: string;
|
|
26
32
|
}): import("react").JSX.Element;
|
|
27
33
|
/**
|
|
28
34
|
* A painted time or time range, isolated in the locale's direction: it lays
|
|
@@ -175,14 +181,14 @@ export declare function eventPastSurfaceColorStyle(color: ScheduleEventColor | u
|
|
|
175
181
|
readonly borderColor: stylex.StyleXClassNameFor<"borderColor", `color-mix(in srgb, ${stylex.StyleXVar<"light-dark(#0064E0, #2694FE)">} 48%, ${stylex.StyleXVar<"light-dark(#05365919, #F2F4F619)">})`>;
|
|
176
182
|
readonly backgroundColor: stylex.StyleXClassNameFor<"backgroundColor", `color-mix(in srgb, ${stylex.StyleXVar<"light-dark(#0064E0, #2694FE)">} 10%, ${stylex.StyleXVar<"light-dark(#FFFFFF, #1F1F22)">})`>;
|
|
177
183
|
}>;
|
|
178
|
-
export declare function formatWithPlainDate(date: PlainDate,
|
|
179
|
-
export declare function formatMonthTitle(date: PlainDate,
|
|
180
|
-
export declare function formatWeekTitle(start: PlainDate, end: PlainDate,
|
|
181
|
-
export declare function formatFullDate(date: PlainDate,
|
|
184
|
+
export declare function formatWithPlainDate(date: PlainDate, options: Intl.DateTimeFormatOptions, locale: Locale, calendar: CalendarSystem): string;
|
|
185
|
+
export declare function formatMonthTitle(date: PlainDate, locale: Locale, calendar: CalendarSystem): string;
|
|
186
|
+
export declare function formatWeekTitle(start: PlainDate, end: PlainDate, locale: Locale, calendar: CalendarSystem): string;
|
|
187
|
+
export declare function formatFullDate(date: PlainDate, locale: Locale, calendar: CalendarSystem): string;
|
|
182
188
|
/** A week row's dates, such as "May 10 – 16, 2026", for its row header. */
|
|
183
|
-
export declare function formatWeekRange(start: PlainDate, end: PlainDate, timezoneID: string, locale: Locale): string;
|
|
184
|
-
export declare function formatWeekday(date: PlainDate,
|
|
185
|
-
export declare function formatDayNumber(date: PlainDate,
|
|
189
|
+
export declare function formatWeekRange(start: PlainDate, end: PlainDate, timezoneID: string, locale: Locale, calendar: CalendarSystem): string;
|
|
190
|
+
export declare function formatWeekday(date: PlainDate, weekday: 'short' | 'long', locale: Locale, calendar: CalendarSystem): string;
|
|
191
|
+
export declare function formatDayNumber(date: PlainDate, locale: Locale, calendar: CalendarSystem): string;
|
|
186
192
|
export declare function formatHour(hour: number, locale: Locale): string;
|
|
187
193
|
export declare function formatTimezoneAbbreviation(date: PlainDate, timezoneID: string, locale: Locale): string;
|
|
188
194
|
export declare function formatEventTime(event: CalendarInstantEvent, day: PlainDate, timezoneID: string, locale: Locale): string;
|
|
@@ -192,7 +198,7 @@ export declare function formatEventTimeRange(event: CalendarInstantEvent, timezo
|
|
|
192
198
|
* 13 at 9:00 AM" in en-US, for a timed span of a day or more
|
|
193
199
|
* (component:Schedule AR2).
|
|
194
200
|
*/
|
|
195
|
-
export declare function formatEventDateTimeRange(event: CalendarInstantEvent, timezoneID: string, locale: Locale): string;
|
|
201
|
+
export declare function formatEventDateTimeRange(event: CalendarInstantEvent, timezoneID: string, locale: Locale, calendar: CalendarSystem): string;
|
|
196
202
|
export declare function formatEventStartTime(event: CalendarInstantEvent, timezoneID: string, locale: Locale): string;
|
|
197
203
|
export declare function formatEventAccessibilityLabel(event: CalendarEvent, day: PlainDate, timezoneID: string, categories: ReadonlyArray<ScheduleCategory>, locale: Locale): string;
|
|
198
204
|
export declare function getMinutesSinceStartOfDay(instant: number, timezoneID: string): number;
|