gridsmith-ui 0.26.0 → 0.27.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.
- package/CHANGELOG.md +969 -0
- package/README.md +21 -5
- package/dist/charts.d.ts +2 -2
- package/dist/charts.js +58 -43
- package/dist/charts.js.map +1 -1
- package/dist/chat.js +4 -3
- package/dist/chat.js.map +1 -1
- package/dist/{chunk-CYN5O567.js → chunk-2CKSSWYG.js} +9 -5
- package/dist/chunk-2CKSSWYG.js.map +1 -0
- package/dist/chunk-3BRQRKDO.js +1 -0
- package/dist/chunk-3BRQRKDO.js.map +1 -1
- package/dist/{chunk-RWKCAKN3.js → chunk-5TUVX4B2.js} +6 -5
- package/dist/chunk-5TUVX4B2.js.map +1 -0
- package/dist/{chunk-X2HEV7FB.js → chunk-64TXZ4L7.js} +23 -33
- package/dist/chunk-64TXZ4L7.js.map +1 -0
- package/dist/chunk-7Q46JXSK.js +1 -0
- package/dist/chunk-7Q46JXSK.js.map +1 -1
- package/dist/chunk-CRQ6KCRD.js +1 -0
- package/dist/chunk-CRQ6KCRD.js.map +1 -1
- package/dist/{chunk-ZYVXV4WC.js → chunk-EKBWWA6P.js} +53 -6
- package/dist/chunk-EKBWWA6P.js.map +1 -0
- package/dist/chunk-HP7WUZPK.js +1 -0
- package/dist/chunk-HP7WUZPK.js.map +1 -1
- package/dist/{chunk-MYIJNVTK.js → chunk-IXR4UEF4.js} +5 -4
- package/dist/chunk-IXR4UEF4.js.map +1 -0
- package/dist/chunk-M2QRNBDQ.js +1 -0
- package/dist/chunk-M2QRNBDQ.js.map +1 -1
- package/dist/chunk-MD2EFMES.js +1 -0
- package/dist/chunk-MD2EFMES.js.map +1 -1
- package/dist/chunk-NRHIYS5W.js +1 -0
- package/dist/chunk-NRHIYS5W.js.map +1 -1
- package/dist/chunk-OTCEJN64.js +1 -0
- package/dist/chunk-OTCEJN64.js.map +1 -1
- package/dist/chunk-OYNUU346.js +78 -0
- package/dist/chunk-OYNUU346.js.map +1 -0
- package/dist/{chunk-EX64MN2U.js → chunk-PO65I3MQ.js} +4 -3
- package/dist/chunk-PO65I3MQ.js.map +1 -0
- package/dist/chunk-QM4SJKWV.js +1 -0
- package/dist/chunk-QM4SJKWV.js.map +1 -1
- package/dist/{chunk-KWLNEH53.js → chunk-R5NFCEZ3.js} +10 -7
- package/dist/chunk-R5NFCEZ3.js.map +1 -0
- package/dist/chunk-SFY2KMHG.js +1 -0
- package/dist/chunk-SFY2KMHG.js.map +1 -1
- package/dist/{chunk-HXVXJUGV.js → chunk-TJEV7YAY.js} +38 -10
- package/dist/chunk-TJEV7YAY.js.map +1 -0
- package/dist/chunk-WH2FUFAC.js +1 -0
- package/dist/chunk-WH2FUFAC.js.map +1 -1
- package/dist/chunk-XVB55M3N.js +1 -0
- package/dist/chunk-XVB55M3N.js.map +1 -1
- package/dist/chunk-ZI3OQDET.js +1 -0
- package/dist/chunk-ZI3OQDET.js.map +1 -1
- package/dist/data-grid.d.ts +1 -1
- package/dist/data-grid.js +5 -3
- package/dist/data-grid.js.map +1 -1
- package/dist/editor-mentions.js +2 -1
- package/dist/editor-mentions.js.map +1 -1
- package/dist/editor.js +3 -2
- package/dist/editor.js.map +1 -1
- package/dist/{feather-VFWLAILO.js → feather-FNBQ74RR.js} +10 -17
- package/dist/feather-FNBQ74RR.js.map +1 -0
- package/dist/{heroicons-H3Z7DFCF.js → heroicons-DODCSYWD.js} +9 -8
- package/dist/heroicons-DODCSYWD.js.map +1 -0
- package/dist/icons.d.ts +31 -4
- package/dist/icons.js +2 -1
- package/dist/icons.js.map +1 -1
- package/dist/index.d.ts +418 -65
- package/dist/index.js +1893 -838
- package/dist/index.js.map +1 -1
- package/dist/kanban.js +3 -2
- package/dist/kanban.js.map +1 -1
- package/dist/{lucide-MR32KM4G.js → lucide-ZWE3EPGP.js} +9 -8
- package/dist/lucide-ZWE3EPGP.js.map +1 -0
- package/dist/{phosphor-ABQQL5N5.js → phosphor-DIHPA4AJ.js} +9 -8
- package/dist/phosphor-DIHPA4AJ.js.map +1 -0
- package/dist/resizable.js +7 -5
- package/dist/resizable.js.map +1 -1
- package/dist/roots.css +25 -7
- package/dist/{tabler-ANUSY4D2.js → tabler-D3VYTSGI.js} +9 -8
- package/dist/tabler-D3VYTSGI.js.map +1 -0
- package/dist/tokens.css +11 -8
- package/dist/{use-pagination-BnKOnBdz.d.ts → use-pagination-BxcRlNQG.d.ts} +6 -0
- package/dist/utils.d.ts +275 -1
- package/dist/utils.js +875 -1
- package/dist/utils.js.map +1 -1
- package/dist/virtualized.d.ts +1 -1
- package/dist/virtualized.js +5 -3
- package/dist/virtualized.js.map +1 -1
- package/dist-static/tokens.css +11 -8
- package/package.json +5 -3
- package/dist/chunk-CYN5O567.js.map +0 -1
- package/dist/chunk-EX64MN2U.js.map +0 -1
- package/dist/chunk-HXVXJUGV.js.map +0 -1
- package/dist/chunk-KWLNEH53.js.map +0 -1
- package/dist/chunk-MYIJNVTK.js.map +0 -1
- package/dist/chunk-RWKCAKN3.js.map +0 -1
- package/dist/chunk-X2HEV7FB.js.map +0 -1
- package/dist/chunk-ZYVXV4WC.js.map +0 -1
- package/dist/feather-VFWLAILO.js.map +0 -1
- package/dist/heroicons-H3Z7DFCF.js.map +0 -1
- package/dist/lucide-MR32KM4G.js.map +0 -1
- package/dist/phosphor-ABQQL5N5.js.map +0 -1
- package/dist/tabler-ANUSY4D2.js.map +0 -1
package/dist/utils.d.ts
CHANGED
|
@@ -10,4 +10,278 @@ declare const FOCUS_RING = "focus-visible:outline-none focus-visible:border-[var
|
|
|
10
10
|
declare const FOCUS_WITHIN_RING = "focus-within:border-[var(--ds-border-focus)] focus-within:ring-2 focus-within:ring-[var(--ds-ring-active)]";
|
|
11
11
|
declare const HAS_FOCUS_RING = "has-[:focus-visible]:border-[var(--ds-border-focus)] has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-[var(--ds-ring-active)]";
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
/**
|
|
14
|
+
* The locale LocaleProvider writes in on the server for a page language and a request's Accept-Language header (Sprint
|
|
15
|
+
* 25.22's review), for server code's own dates and numbers: a server page passes it to the helpers from
|
|
16
|
+
* `gridsmith-ui/utils`, so its words read as the components' beside them. `requestLocale(LANG, (await
|
|
17
|
+
* headers()).get('accept-language'))`.
|
|
18
|
+
*/
|
|
19
|
+
declare function requestLocale(lang: string | undefined, acceptLanguage?: string | null): string;
|
|
20
|
+
|
|
21
|
+
/** A day of the week as `Date.getDay()` counts them: Sunday 0, Monday 1 … Saturday 6. */
|
|
22
|
+
type Weekday = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* How something repeats (Sprint 25.19 R1): the iCalendar standard's rule (RFC 5545 `RRULE`), in the subset Outlook's and
|
|
26
|
+
* Google's menus write (P5), read in the event's local time. The quick choices are stored in the standard's implied form
|
|
27
|
+
* (P6): a weekly rule with no `weekdays`, a monthly rule with no `day` or `nth` and a bare yearly rule repeat on the
|
|
28
|
+
* start's own weekday, date or anniversary, so moving the event moves them. The event's own start is always its first
|
|
29
|
+
* occurrence.
|
|
30
|
+
*/
|
|
31
|
+
type RecurrenceFrequency = "daily" | "weekly" | "monthly" | "yearly";
|
|
32
|
+
/** An nth weekday of a month: the first to the fourth, or the last (−1). A fifth weekday is the last. */
|
|
33
|
+
type WeekOfMonth = 1 | 2 | 3 | 4 | -1;
|
|
34
|
+
interface Recurrence {
|
|
35
|
+
freq: RecurrenceFrequency;
|
|
36
|
+
/** Every n days, weeks, months or years. Default 1. */
|
|
37
|
+
interval?: number;
|
|
38
|
+
/** Weekly: the days it repeats on, Sunday 0 to Saturday 6. Left out, the start's own weekday. */
|
|
39
|
+
weekdays?: Weekday[];
|
|
40
|
+
/** Monthly, or yearly with `month`: a day of the month, 1 to 31, or −1 for the last day. A month without the day is skipped. */
|
|
41
|
+
day?: number;
|
|
42
|
+
/** Monthly, or yearly with `month`: an nth weekday, `{ week: 1, weekday: 2 }` the first Tuesday. */
|
|
43
|
+
nth?: {
|
|
44
|
+
week: WeekOfMonth;
|
|
45
|
+
weekday: Weekday;
|
|
46
|
+
};
|
|
47
|
+
/** Yearly: the month, 1 to 12, with `day` or `nth`. A bare yearly rule repeats on the start's anniversary. */
|
|
48
|
+
month?: number;
|
|
49
|
+
/** The week's first day (WKST), which places a weekly rule's weeks. Default Monday, as RFC 5545 says. */
|
|
50
|
+
weekStart?: Weekday;
|
|
51
|
+
/**
|
|
52
|
+
* The last moment it occurs. A date at midnight includes its whole day ("until 30 November"); an all-day event's is a
|
|
53
|
+
* date. RecurrencePicker stores the end of the chosen day, which other apps read exactly. Left out with `count`, it
|
|
54
|
+
* never ends. A rule read back from JSON may carry it as a string: the library reads it as the date it was.
|
|
55
|
+
*/
|
|
56
|
+
until?: Date;
|
|
57
|
+
/** How many times it occurs, the first included, and the excluded dates among them (RFC 5545). */
|
|
58
|
+
count?: number;
|
|
59
|
+
}
|
|
60
|
+
/** The fields a repeating event carries; a Calendar event has them as `repeat` and `exceptions` (P12: never `recurrence`). */
|
|
61
|
+
interface RepeatingEvent {
|
|
62
|
+
id: string;
|
|
63
|
+
start: Date;
|
|
64
|
+
end?: Date;
|
|
65
|
+
allDay?: boolean;
|
|
66
|
+
/** The rule, or a rule string `parseRRule` reads ("RRULE:FREQ=WEEKLY;BYDAY=TU,TH"). */
|
|
67
|
+
repeat?: Recurrence | string;
|
|
68
|
+
/** The dates left out, as day keys in local time ("2026-10-20"): the original date of each occurrence removed or moved. */
|
|
69
|
+
exceptions?: string[];
|
|
70
|
+
/**
|
|
71
|
+
* On an occurrence, its series' id and its original date (a day key), as RFC 5545's RECURRENCE-ID links an edited
|
|
72
|
+
* instance to its series. Each occurrence `occurrences` gives carries it, and so does an occurrence changed on its own
|
|
73
|
+
* ("This event"), which the page stores under an id of its own: the series leaves the date out, and the edit helpers
|
|
74
|
+
* find it by its link.
|
|
75
|
+
*/
|
|
76
|
+
series?: {
|
|
77
|
+
id: string;
|
|
78
|
+
date: string;
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
/** Which occurrences a change or a deletion applies to: this one, it and the ones after it, or the whole series. */
|
|
82
|
+
type RecurrenceScope = "this" | "following" | "all";
|
|
83
|
+
/**
|
|
84
|
+
* What a choice in RecurrenceScopeDialog does to the page's events: `events`, the list as it now is, for a page that
|
|
85
|
+
* keeps its events in state; or `save`, the events to write (new or changed, each by its id), and `remove`, the ids to
|
|
86
|
+
* delete, for a page that stores them elsewhere.
|
|
87
|
+
*/
|
|
88
|
+
interface RepeatChange<T> {
|
|
89
|
+
events: T[];
|
|
90
|
+
save: T[];
|
|
91
|
+
remove: string[];
|
|
92
|
+
}
|
|
93
|
+
/** One occurrence of a series: the event without its repeat fields, its own id, start and end, and where it came from. */
|
|
94
|
+
type Occurrence<T extends RepeatingEvent> = Omit<T, "repeat" | "exceptions"> & {
|
|
95
|
+
id: string;
|
|
96
|
+
start: Date;
|
|
97
|
+
end?: Date;
|
|
98
|
+
/** The series' id and this occurrence's original date (a day key), which the edit helpers take. */
|
|
99
|
+
series: {
|
|
100
|
+
id: string;
|
|
101
|
+
date: string;
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* The rule a string holds, or null when it is outside P5's subset (the event is then drawn once, its rule kept as written):
|
|
106
|
+
* FREQ, INTERVAL and WKST; weekly BYDAY days; a monthly or yearly BYMONTHDAY, or one nth BYDAY ("1TU", or "TU" with
|
|
107
|
+
* BYSETPOS=1); a yearly BYMONTH with either; UNTIL (a date, a floating or a UTC date-time) or COUNT. The "RRULE:" prefix
|
|
108
|
+
* is optional. A daily rule with days (every weekday, as some apps write it) reads as weekly on them.
|
|
109
|
+
*/
|
|
110
|
+
declare function parseRRule(text: string): Recurrence | null;
|
|
111
|
+
/**
|
|
112
|
+
* The rule as an RRULE string, "RRULE:FREQ=…", for an iCalendar file or another app. UNTIL is written as a date for an
|
|
113
|
+
* all-day event and in UTC for a timed one, as RFC 5545 asks.
|
|
114
|
+
*/
|
|
115
|
+
declare function toRRule(rule: Recurrence, { allDay }?: {
|
|
116
|
+
allDay?: boolean;
|
|
117
|
+
}): string;
|
|
118
|
+
/**
|
|
119
|
+
* A rule from a value: the object itself, the rule a string holds, or null for an unreadable string or none. A rule read
|
|
120
|
+
* back from JSON (storage, an API) has its end as a string, which is read as the date it was; an end that isn't a date
|
|
121
|
+
* makes the rule unreadable, so the event is drawn once rather than guessed at.
|
|
122
|
+
*/
|
|
123
|
+
declare function readRecurrence(value: Recurrence | string | undefined | null): Recurrence | null;
|
|
124
|
+
/** The nth weekday a date is: the last when it is in its month's last seven days (a fifth Tuesday is the last). */
|
|
125
|
+
declare function nthOf(date: Date): {
|
|
126
|
+
week: WeekOfMonth;
|
|
127
|
+
weekday: Weekday;
|
|
128
|
+
};
|
|
129
|
+
/**
|
|
130
|
+
* Every occurrence of a repeating event that overlaps [from, to), in order: the event without its repeat fields, each
|
|
131
|
+
* with the id "<id>::<date>", its own start and end (the same wall-clock times and number of days) and `series`, its
|
|
132
|
+
* original date. Its excluded dates are left out. An event that doesn't repeat, or whose rule can't be read, is itself,
|
|
133
|
+
* when it overlaps.
|
|
134
|
+
*/
|
|
135
|
+
declare function occurrences<T extends RepeatingEvent>(event: T, from: Date, to: Date): Array<T | Occurrence<T>>;
|
|
136
|
+
/**
|
|
137
|
+
* The occurrence of a series on a day (a day key), or undefined when it has none that day (the rule skips it, or it is
|
|
138
|
+
* excluded): for a page whose Edit has an address of its own, which carries the series' id and the date. Given the
|
|
139
|
+
* page's events, an occurrence changed on its own on that date ("This event") is found too.
|
|
140
|
+
*/
|
|
141
|
+
declare function occurrenceOn<T extends RepeatingEvent>(series: T, date: string, events?: readonly T[]): Occurrence<T> | undefined;
|
|
142
|
+
/**
|
|
143
|
+
* Saves the user's edit to an occurrence, for the scope they chose in RecurrenceScopeDialog: the page stores what it
|
|
144
|
+
* returns. `occurrence` is the event they opened, one the Calendar handed over or one changed on its own before (the
|
|
145
|
+
* page's own); `changes` the form's fields, every one or only those changed (only what differs from the opened event
|
|
146
|
+
* applies); `newId` an id of the page's, for the event or the series a choice makes.
|
|
147
|
+
* - "This event": the occurrence becomes an event of its own, linked to its series by `series`, its date left out of the
|
|
148
|
+
* series; one changed on its own before just takes the edit.
|
|
149
|
+
* - "This and following events": the series ends the day before and a new one starts on the date, under `newId`, with
|
|
150
|
+
* the edit; the events changed on their own from the date on go with it.
|
|
151
|
+
* - "All events": the series takes the edit, and a moved time or day moves it and its rule, so every earlier date stays.
|
|
152
|
+
* The events changed on their own keep what they changed themselves (a field, another day, other times) and follow the
|
|
153
|
+
* rest. A changed repeat removes them, as Outlook does, and their dates go back to the new rule (RecurrenceScopeDialog's
|
|
154
|
+
* `edited` says so first); a deleted date stays deleted.
|
|
155
|
+
*/
|
|
156
|
+
declare function saveOccurrence<T extends RepeatingEvent>(events: readonly T[], occurrence: Occurrence<T> | T, scope: RecurrenceScope, changes: Partial<T>, newId: string): RepeatChange<T>;
|
|
157
|
+
/**
|
|
158
|
+
* Deletes an occurrence, for the scope the user chose in RecurrenceScopeDialog: the page stores what it returns. "This
|
|
159
|
+
* event" leaves its date out of the series (an event changed on its own is removed, and its date stays empty); "This
|
|
160
|
+
* and following events" ends the series the day before and removes the events changed on their own from the date on;
|
|
161
|
+
* "All events" removes the series and every event changed on its own.
|
|
162
|
+
*/
|
|
163
|
+
declare function deleteOccurrence<T extends RepeatingEvent>(events: readonly T[], occurrence: Occurrence<T> | T, scope: RecurrenceScope): RepeatChange<T>;
|
|
164
|
+
/**
|
|
165
|
+
* How many of a series' events changed on their own each scope covers, for RecurrenceScopeDialog's `edited`: "This and
|
|
166
|
+
* following events" those from the occurrence's date on, "All events" every one.
|
|
167
|
+
*/
|
|
168
|
+
declare function countEdited<T extends RepeatingEvent>(events: readonly T[], occurrence: Occurrence<T> | T): {
|
|
169
|
+
following: number;
|
|
170
|
+
all: number;
|
|
171
|
+
};
|
|
172
|
+
/**
|
|
173
|
+
* The rule in words, for its date: "Every week on Tuesday and Thursday, until 30 November 2026", "Every month on the
|
|
174
|
+
* first Tuesday", "Every year on 6 October". The days and dates are written in the locale given (a component's
|
|
175
|
+
* useFormatLocale(), Sprint 25.20), else the browser's reading of the page's language.
|
|
176
|
+
*/
|
|
177
|
+
declare function describeRecurrence(rule: Recurrence, start: Date, locale?: string | undefined): string;
|
|
178
|
+
interface RecurrencePreset {
|
|
179
|
+
/** The choice in words, as describeRecurrence writes it for the date. */
|
|
180
|
+
label: string;
|
|
181
|
+
rule: Recurrence;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* The quick choices for a date, each one including it (P6): every day; every weekday, for a weekday; every week on its
|
|
185
|
+
* weekday; every month on its nth weekday (the fourth and "the last" both for a fourth one in a month's last seven days,
|
|
186
|
+
* only "the last" for a fifth); every month on its date, and on the last day when it is one; every year on its
|
|
187
|
+
* anniversary. The weekly, monthly-by-date and yearly choices are the
|
|
188
|
+
* implied form, so they follow the date when the event moves.
|
|
189
|
+
*/
|
|
190
|
+
declare function recurrencePresets(start: Date, locale?: string | undefined): RecurrencePreset[];
|
|
191
|
+
/** Whether two rules repeat the same way (an `until` compared by its moment). */
|
|
192
|
+
declare function sameRecurrence(a: Recurrence | null | undefined, b: Recurrence | null | undefined): boolean;
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Time zones by the browser's own names, and their offsets (Sprint 25.17 A28), apart from the TimezoneSelect component since
|
|
196
|
+
* Sprint 25.22 so a server can call them: nothing here needs React. `gridsmith-ui/utils` exports canonicalTimeZone and
|
|
197
|
+
* timeZoneOffset for server code; browserTimeZone reads the zone of whatever runs it, a server's own there.
|
|
198
|
+
*/
|
|
199
|
+
/**
|
|
200
|
+
* The browser's own name for a zone (Sprint 25.17 A28, R28-51): one browser always names a zone one way, so a stored
|
|
201
|
+
* "Asia/Calcutta" and a listed "Asia/Kolkata" are one zone, with no alias table shipped. An id the browser doesn't know
|
|
202
|
+
* stays as given.
|
|
203
|
+
*/
|
|
204
|
+
declare function canonicalTimeZone(zone: string): string;
|
|
205
|
+
/**
|
|
206
|
+
* A zone's offset from UTC at an instant, as the locale given names it ("GMT+1", "GMT-5", "GMT+5:30"; a component's
|
|
207
|
+
* useFormatLocale(), else the browser's reading): read at that instant, so it follows daylight saving.
|
|
208
|
+
*/
|
|
209
|
+
declare function timeZoneOffset(zone: string, at?: Date, locale?: string | undefined): string;
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Calendar days, and ranges of them in words (Sprint 25.7, Part D). A calendar day is a whole-number day index: days since
|
|
213
|
+
* 1970-01-01, counted on UTC day boundaries, so every day is the same width and a clock change never stretches or shrinks
|
|
214
|
+
* one. A "YYYY-MM-DD" string is a calendar day in the user's zone and is never parsed as UTC (new Date("2026-03-03") is
|
|
215
|
+
* 2 March, 19:00 in New York). Apart from the time scale (lib/time-scale.ts) since Sprint 25.22, so a server can call
|
|
216
|
+
* them: nothing here needs React or a browser, and `gridsmith-ui/utils` exports them for server code. On a server a Date
|
|
217
|
+
* or a date-time string is read in the server's time zone; a calendar day or a day index is the same everywhere.
|
|
218
|
+
*/
|
|
219
|
+
/** A Date, or a string: "YYYY-MM-DD" is a calendar day; any other string is a date-time. */
|
|
220
|
+
type DateInput = Date | string;
|
|
221
|
+
type TimeZoom = "day" | "week" | "month" | "quarter";
|
|
222
|
+
/** Narrow to wide. */
|
|
223
|
+
declare const TIME_ZOOMS: readonly TimeZoom[];
|
|
224
|
+
/**
|
|
225
|
+
* The day index of a date: "2026-03-03" → that calendar day's index; a Date or a date-time string → its local calendar
|
|
226
|
+
* day plus the fraction of the day its local clock shows (a day's first instant is the whole day); a number is a day
|
|
227
|
+
* index already, as the scale's own functions take it. NaN for anything else: null from JSON, a string that is no date.
|
|
228
|
+
*/
|
|
229
|
+
declare function dayOf(value: DateInput | number): number;
|
|
230
|
+
/** Local midnight of that calendar day; a fraction adds that much of the day on the local clock. */
|
|
231
|
+
declare function dateOfDay(day: number): Date;
|
|
232
|
+
/**
|
|
233
|
+
* Where a range that ends at `value` stops. A whole-day end is inclusive: "2026-03-14" (or a Date at local midnight,
|
|
234
|
+
* as the date pickers give) → the start of 15 March. A date-time end is half-open: it stops at that moment, as a day
|
|
235
|
+
* index does. A range's start can make a midnight Date half-open too (scale.span, formatDateRange, timeExtent).
|
|
236
|
+
*/
|
|
237
|
+
declare function endDayOf(value: DateInput | number): number;
|
|
238
|
+
/**
|
|
239
|
+
* The earliest start and the latest end of some ranges, as day indices for useTimeScale: the end is where the last
|
|
240
|
+
* range stops (inclusive for a whole day, as endDayOf), and a range with no end ends where it starts (a milestone).
|
|
241
|
+
* NaN for no dated range, which the scale shows as today. A range, a start or an end that is null is skipped.
|
|
242
|
+
*/
|
|
243
|
+
declare function timeExtent(ranges: Iterable<{
|
|
244
|
+
start: DateInput;
|
|
245
|
+
end?: DateInput;
|
|
246
|
+
}>): {
|
|
247
|
+
start: number;
|
|
248
|
+
end: number;
|
|
249
|
+
};
|
|
250
|
+
interface DateRangeWords {
|
|
251
|
+
locale?: string;
|
|
252
|
+
/** Joins the two ends in place of Intl's separator. Default " to " in English, and Intl's own separator elsewhere. */
|
|
253
|
+
to?: string;
|
|
254
|
+
/** Intl options for the days. Default { day: "numeric", month: "long" }; the year is added when the ends' years differ. */
|
|
255
|
+
day?: Intl.DateTimeFormatOptions;
|
|
256
|
+
/** Intl options for the times of a date-time range. Default { hour: "2-digit", minute: "2-digit" }. */
|
|
257
|
+
time?: Intl.DateTimeFormatOptions;
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* A range in words, in the locale, for accessible names: "3 to 14 March", "28 September to 3 October", "16 September"
|
|
261
|
+
* for one day. The end is inclusive for a whole day, as scale.span (a day index is where the range stops). A date-time
|
|
262
|
+
* range is named by its times, and the end's day only when it differs: "Friday 23 October, 06:00 to 14:00". Intl
|
|
263
|
+
* joins each day and time in the locale's own way, and outside English the two ends too ("10/31(土曜日)~11/01(日曜日)");
|
|
264
|
+
* the year shows when the two ends are in different years. A null end is the start's own day; a start that is no date
|
|
265
|
+
* gives "".
|
|
266
|
+
*/
|
|
267
|
+
declare function formatDateRange(start: DateInput | number, end?: DateInput | number, words?: DateRangeWords): string;
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Sprint 25.9, A3 — what a chart's category axis holds, and how its labels fit. No Recharts here: the charts entry and
|
|
271
|
+
* the tests import it, and it never measures on its own (the measurer is handed in).
|
|
272
|
+
*
|
|
273
|
+
* - `categoryKind(labels)`: "scale" when every non-empty label is a date, a time, a period or a number, else "names".
|
|
274
|
+
* Anchored patterns only — never `Date.parse`, which V8 lets read "Tier 1", "Sprint 1" and "Northern Region 2" as dates.
|
|
275
|
+
* - `createAxisMeasurer(el)`: canvas text widths in the axis's resolved font, read from a probe that carries
|
|
276
|
+
* `font-size: var(--ds-font-size-xs)`, so a `calc()` token (`calc(16px * .75)`, a 14 px base) measures right.
|
|
277
|
+
* - `fitLabel(name, width, measure)`: one line; else two lines split at a space; else "…" on the second. Never drops it.
|
|
278
|
+
*/
|
|
279
|
+
type CategoryKind = "names" | "scale";
|
|
280
|
+
/**
|
|
281
|
+
* Whether a category axis holds names or a scale (dates, times, periods, numbers). Every non-empty label must match an
|
|
282
|
+
* anchored pattern to be "scale"; an all-empty set is "scale". LineChart and AreaChart are always "scale"; BarChart and
|
|
283
|
+
* CompositeChart guess with this, and their `categoryKind` prop overrides the guess.
|
|
284
|
+
*/
|
|
285
|
+
declare function categoryKind(labels: ReadonlyArray<unknown>, locale?: string): CategoryKind;
|
|
286
|
+
|
|
287
|
+
export { ACTIVE_RING, type CategoryKind, type DateInput, type DateRangeWords, FOCUS_RING, FOCUS_WITHIN_RING, GLASS_BACKDROP, GLASS_DROPDOWN, GLASS_OVERLAY, GLASS_SURFACE, HAS_FOCUS_RING, type Occurrence, type Recurrence, type RecurrenceFrequency, type RecurrencePreset, type RecurrenceScope, type RepeatChange, type RepeatingEvent, TIME_ZOOMS, type TimeZoom, type WeekOfMonth, type Weekday, canonicalTimeZone, categoryKind, cn, countEdited, dateOfDay, dayOf, deleteOccurrence, describeRecurrence, endDayOf, formatDateRange, nthOf, occurrenceOn, occurrences, parseRRule, readRecurrence, recurrencePresets, requestLocale, sameRecurrence, saveOccurrence, timeExtent, timeZoneOffset, toRRule };
|