@nxgt/material 3.43.0 → 3.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +1 -1
  3. package/dist/{async-slice-Dj0tAKRI.js → async-slice-D9LAUgth.js} +2 -2
  4. package/dist/{button-CTsT_LqL.js → button-b_kruV_L.js} +1 -1
  5. package/dist/charts.js +3 -3
  6. package/dist/{chip-DP7EyhtT.js → chip-6O3t9GXt.js} +1 -1
  7. package/dist/{code-editor-BWn0AXBf.js → code-editor-BtDOgUET.js} +4 -4
  8. package/dist/code-editor.js +4 -4
  9. package/dist/{code-language-items-CCRuLYpA.js → code-language-items-374m-OK8.js} +2 -2
  10. package/dist/{components-DSCK_Ohm.js → components-BG-BTfJP.js} +21135 -20542
  11. package/dist/components.js +15 -15
  12. package/dist/{dialog-uQld1gKm.js → dialog-8Ua9uuJW.js} +1 -1
  13. package/dist/dnd.js +1 -1
  14. package/dist/{dropdown-menu-BA70o7HC.js → dropdown-menu-DJEeT1XT.js} +1 -1
  15. package/dist/editor.js +7 -7
  16. package/dist/{empty-state-BzwyRX5J.js → empty-state-CrhrmNqn.js} +1 -1
  17. package/dist/hooks.js +2 -2
  18. package/dist/{i18n-provider-DkeMr5bw.js → i18n-provider-hrtFm9jD.js} +1 -1
  19. package/dist/i18n.js +5 -5
  20. package/dist/{icon-badge-D_z5BGbc.js → icon-badge-Cpke1tCf.js} +1 -1
  21. package/dist/lib/components/ui/dates/now-indicator/now-indicator.d.ts +9 -1
  22. package/dist/lib/components/ui/dates/now-indicator/now-indicator.utils.d.ts +2 -0
  23. package/dist/lib/components/ui/display/event-chip/event-chip.d.ts +3 -1
  24. package/dist/lib/components/ui/fields/contacts/placeholders.d.ts +1 -1
  25. package/dist/lib/components/ui/tone-color.d.ts +2 -0
  26. package/dist/lib/components/ui/widgets/event-calendar/event-calendar-context.d.ts +2 -0
  27. package/dist/lib/components/ui/widgets/event-calendar/event-calendar-events.utils.d.ts +8 -15
  28. package/dist/lib/components/ui/widgets/event-calendar/event-calendar.axis.d.ts +49 -0
  29. package/dist/lib/components/ui/widgets/event-calendar/event-calendar.d.ts +1 -1
  30. package/dist/lib/components/ui/widgets/event-calendar/event-calendar.drop.d.ts +27 -0
  31. package/dist/lib/components/ui/widgets/event-calendar/event-calendar.ids.d.ts +9 -2
  32. package/dist/lib/components/ui/widgets/event-calendar/event-calendar.labels.d.ts +18 -0
  33. package/dist/lib/components/ui/widgets/event-calendar/event-calendar.layout.d.ts +17 -0
  34. package/dist/lib/components/ui/widgets/event-calendar/event-calendar.resources.d.ts +36 -0
  35. package/dist/lib/components/ui/widgets/event-calendar/event-calendar.scroll.d.ts +7 -0
  36. package/dist/lib/components/ui/widgets/event-calendar/event-calendar.slice.d.ts +28 -0
  37. package/dist/lib/components/ui/widgets/event-calendar/event-calendar.utils.d.ts +0 -3
  38. package/dist/lib/components/ui/widgets/event-calendar/event-calendar.zone.d.ts +35 -0
  39. package/dist/lib/components/ui/widgets/event-calendar/index.d.ts +1 -1
  40. package/dist/lib/components/ui/widgets/event-calendar/partials/calendar-event-chip.d.ts +3 -1
  41. package/dist/lib/components/ui/widgets/event-calendar/partials/event-preview-resource.d.ts +6 -0
  42. package/dist/lib/components/ui/widgets/event-calendar/partials/event-preview-title.d.ts +11 -0
  43. package/dist/lib/components/ui/widgets/event-calendar/partials/event-preview.d.ts +3 -2
  44. package/dist/lib/components/ui/widgets/event-calendar/partials/event-resize-handle.d.ts +3 -2
  45. package/dist/lib/components/ui/widgets/event-calendar/partials/resource-all-day-lane.d.ts +6 -0
  46. package/dist/lib/components/ui/widgets/event-calendar/partials/resource-header.d.ts +12 -0
  47. package/dist/lib/components/ui/widgets/event-calendar/partials/resource-switcher.d.ts +9 -0
  48. package/dist/lib/components/ui/widgets/event-calendar/partials/time-column-now.d.ts +10 -0
  49. package/dist/lib/components/ui/widgets/event-calendar/partials/time-column.d.ts +12 -1
  50. package/dist/lib/components/ui/widgets/event-calendar/partials/time-grid-event.d.ts +6 -2
  51. package/dist/lib/components/ui/widgets/event-calendar/partials/time-grid-header-day.d.ts +9 -0
  52. package/dist/lib/components/ui/widgets/event-calendar/partials/time-grid-header.d.ts +4 -1
  53. package/dist/lib/components/ui/widgets/event-calendar/partials/time-grid-hours.d.ts +6 -0
  54. package/dist/lib/components/ui/widgets/event-calendar/partials/time-grid.d.ts +11 -4
  55. package/dist/lib/components/ui/widgets/event-calendar/partials/time-gutter.d.ts +9 -4
  56. package/dist/lib/components/ui/widgets/event-calendar/partials/tone-mark.d.ts +5 -0
  57. package/dist/lib/components/ui/widgets/event-calendar/partials/zone-corner.d.ts +10 -0
  58. package/dist/lib/components/ui/widgets/event-calendar/types.d.ts +42 -0
  59. package/dist/lib/components/ui/widgets/event-calendar/use-calendar-drag.d.ts +3 -0
  60. package/dist/lib/components/ui/widgets/event-calendar/use-calendar-keys.d.ts +3 -0
  61. package/dist/lib/components/ui/widgets/event-calendar/use-calendar-nav.d.ts +15 -0
  62. package/dist/lib/components/ui/widgets/event-calendar/use-chip-event.d.ts +13 -0
  63. package/dist/lib/components/ui/widgets/event-calendar/use-drawn-events.d.ts +9 -0
  64. package/dist/lib/components/ui/widgets/event-calendar/use-event-calendar.d.ts +9 -25
  65. package/dist/lib/components/ui/widgets/event-calendar/use-event-list.d.ts +18 -0
  66. package/dist/lib/components/ui/widgets/event-calendar/use-slot-create.d.ts +5 -4
  67. package/dist/lib/components/ui/widgets/event-calendar/use-time-column.d.ts +22 -0
  68. package/dist/lib/components/ui/widgets/event-calendar/use-time-grid.d.ts +36 -0
  69. package/dist/lib/i18n/resources/en/en.d.ts +3 -0
  70. package/dist/lib/i18n/resources/en/material.json.d.ts +4 -1
  71. package/dist/lib/i18n/resources/fr/fr.d.ts +3 -0
  72. package/dist/lib/i18n/resources/fr/material.json.d.ts +4 -1
  73. package/dist/lib/i18n/resources/resources.d.ts +6 -0
  74. package/dist/lib/i18n/translator.d.ts +1 -1
  75. package/dist/lib.js +1 -1
  76. package/dist/main.js +21 -21
  77. package/dist/map.js +4 -4
  78. package/dist/material.css +1 -1
  79. package/dist/pdf-reader.js +1 -1
  80. package/dist/print.js +2 -2
  81. package/dist/{public-ib0sK0Hr.js → public-DPPmNtZB.js} +6 -6
  82. package/dist/{rich-code-block-D_PTTZWQ.js → rich-code-block-KQYR0qt3.js} +4 -4
  83. package/dist/{sortable-provider-CrS51nKB.js → sortable-provider-hPPTMtJA.js} +632 -631
  84. package/dist/{spinner-DLd_IHev.js → spinner-Dd0os4cb.js} +1 -1
  85. package/dist/{stored-language-B5SMR-W2.js → stored-language-Blyb68vN.js} +8 -2
  86. package/dist/theme-picker.js +2 -2
  87. package/dist/{theme-toggle-wJYmnwgu.js → theme-toggle-BDRRkkiA.js} +1 -1
  88. package/dist/{toolbar-items-BLjrk8uU.js → toolbar-items-D3hw7XZE.js} +2 -2
  89. package/dist/{translate-material-BYRDtSEk.js → translate-material-CdJBbURx.js} +2 -2
  90. package/dist/{translator-C-_M57ZA.js → translator-38JuN_VD.js} +1 -1
  91. package/dist/{use-chat-composer-D_hfO99B.js → use-chat-composer-utGkZQ6X.js} +12 -12
  92. package/dist/{use-heading-spy-wElRpO2G.js → use-heading-spy-bTccmEMF.js} +1 -1
  93. package/dist/{use-material-translation-CFF73jk5.js → use-material-translation-DLsfkMxp.js} +2 -2
  94. package/docs/components/data-table-filter-and-lists.md +6 -2
  95. package/docs/components/date-and-time.md +2 -0
  96. package/docs/components/rich-widgets.md +105 -2
  97. package/docs/troubleshooting.md +14 -0
  98. package/package.json +1 -1
@@ -0,0 +1,27 @@
1
+ import { CalendarEvent, EventCalendarResource } from './types.js';
2
+ /** Where a drag ended, once read from the ids of what it was dropped on. */
3
+ export type Drop = {
4
+ kind: 'time';
5
+ at: Date;
6
+ } | {
7
+ kind: 'all-day';
8
+ day: string;
9
+ } | {
10
+ kind: 'month';
11
+ day: string;
12
+ } | {
13
+ kind: 'event';
14
+ start: string;
15
+ };
16
+ /**
17
+ * The event after a drop: moved to the day or time, in the zone when there is
18
+ * one, and, for a drop on a resource column, assigned to it. Dropped back on
19
+ * its own column it keeps its `resourceId` as it was.
20
+ */
21
+ export declare function applyDrop(entry: CalendarEvent, drop: Drop, { zone, resources, target, }: {
22
+ zone?: string;
23
+ resources?: EventCalendarResource[];
24
+ target?: {
25
+ resourceId?: string | null;
26
+ };
27
+ }): CalendarEvent;
@@ -5,7 +5,14 @@ export declare const RESIZE_PREFIX = "resize:";
5
5
  export declare function toDayKey(date: Date): string;
6
6
  export declare function parseDayKey(key: string): Date;
7
7
  export declare function dayDropId(date: Date): string;
8
- export declare function allDayDropId(date: Date): string;
9
- export declare function timeDropId(date: Date): string;
8
+ /** An all-day lane's drop id; a resource's lane adds its id after a `#`, as `timeDropId`. */
9
+ export declare function allDayDropId(date: Date, resourceId?: string | null): string;
10
+ /** A time column's drop id; a resource column adds its id (`''` for the unassigned one) after a `#`. */
11
+ export declare function timeDropId(date: Date, resourceId?: string | null): string;
12
+ /** The day of a time column's or an all-day lane's drop id (what `parsePrefixed` gives, without the resource). */
13
+ export declare function dropDay(rest: string): string;
10
14
  export declare function resizeDragId(eventId: string): string;
11
15
  export declare function parsePrefixed(id: string, prefix: string): string | null;
16
+ /** The `YYYY-MM-DD` key `days` after `key`. */
17
+ export declare function addKeyDays(key: string, days: number): string;
18
+ export declare function keyDiff(from: string, to: string): number;
@@ -0,0 +1,18 @@
1
+ import { Locale } from 'date-fns';
2
+ import { CalendarEvent } from './types.js';
3
+ /**
4
+ * The times a chip or an agenda row shows. In a zone they are read from the
5
+ * true instants with the zone's own clock (`wallOf`), never through the
6
+ * browser's date maths, which would move a wall time its own clock skips.
7
+ * `drawn` is the event as drawn (the zone's wall clock), `source` as stored.
8
+ */
9
+ export declare function eventTimes(drawn: CalendarEvent, source: CalendarEvent, zone: string | undefined, format: (value?: string | null, formatStr?: string) => string): {
10
+ time?: string;
11
+ endTime?: string;
12
+ };
13
+ /**
14
+ * The range label of the popover, in the zone: the day is read at noon and
15
+ * the time on a fixed day, so a wall time the browser's own clock skips never
16
+ * shifts what is said.
17
+ */
18
+ export declare function zonedRangeLabel(event: CalendarEvent, locale: Locale, zone: string): string;
@@ -0,0 +1,17 @@
1
+ import { DayAxis } from './event-calendar.axis.js';
2
+ import { CalendarEvent, LaidOutEvent } from './types.js';
3
+ /** The shortest an event is drawn, in px: WCAG 2.5.8's 24px target. */
4
+ export declare const MIN_EVENT_HEIGHT = 24;
5
+ /** The minutes an event draws over at least, at `hourHeight` px an hour. */
6
+ export declare function minEventMinutes(hourHeight: number): number;
7
+ /**
8
+ * Lays the day's timed events out in columns by the time they really take:
9
+ * events that do not overlap in time share a column and keep the full width.
10
+ * A short event is drawn at least `minMinutes` long (`MIN_EVENT_HEIGHT`
11
+ * tall) only into free space: its `drawEndMin` stops at the next event of its
12
+ * column and never falls under its real end, so back-to-back events sit
13
+ * flush at their true heights. `axis` (a time zone's day, see `dayAxis`)
14
+ * replaces the local day: the events are clipped to its window and placed by
15
+ * its minutes.
16
+ */
17
+ export declare function layoutTimedEvents(events: CalendarEvent[], day: Date, startHour: number, endHour: number, minMinutes?: number, axis?: DayAxis): LaidOutEvent[];
@@ -0,0 +1,36 @@
1
+ import { Tone } from '../../tones.js';
2
+ import { CalendarEvent, EventCalendarResource } from './types.js';
3
+ /** A column of the day view: a resource, or the events that have none (`id` is `null`). */
4
+ export type ResourceColumn = {
5
+ id: string | null;
6
+ label: string;
7
+ description?: string;
8
+ tone?: Tone;
9
+ };
10
+ /** The id of the resource an event belongs to; `null` when it has none or an unknown one. */
11
+ export declare function resourceKey(event: CalendarEvent, resources: EventCalendarResource[]): string | null;
12
+ /**
13
+ * The day view's columns: one per resource, in order, behind a leading
14
+ * "Unassigned" one that exists only while an event has no resource.
15
+ */
16
+ export declare function resourceColumns(resources: EventCalendarResource[], events: CalendarEvent[], unassignedLabel: string): ResourceColumn[];
17
+ /** The column a phone shows: the one picked, else the first. */
18
+ export declare function shownColumn(columns: ResourceColumn[], picked: string | null): ResourceColumn | undefined;
19
+ /** The events of one column. */
20
+ export declare function eventsOfColumn(events: CalendarEvent[], column: ResourceColumn, resources: EventCalendarResource[]): CalendarEvent[];
21
+ /** The event with its resource set to a column's (the unassigned one clears it). */
22
+ export declare function withColumn(event: CalendarEvent, column: string | null): CalendarEvent;
23
+ /** A React key for a column that no resource id can collide with. */
24
+ export declare function columnKey(column: ResourceColumn): string;
25
+ /** The resource an event belongs to; none when it has none or an unknown one. */
26
+ export declare function ownerOf(event: CalendarEvent, resources?: EventCalendarResource[]): EventCalendarResource | undefined;
27
+ /** The event drawn in its resource's tone when it sets no colour of its own. */
28
+ export declare function withOwnerTone(event: CalendarEvent, owner?: EventCalendarResource): CalendarEvent;
29
+ /**
30
+ * The column an event is dropped into, or the event itself when it is already
31
+ * there: an event of an unknown resource, moved inside "Unassigned", keeps
32
+ * its `resourceId`.
33
+ */
34
+ export declare function assignColumn(event: CalendarEvent, target: {
35
+ resourceId?: string | null;
36
+ } | undefined, resources?: EventCalendarResource[]): CalendarEvent;
@@ -0,0 +1,7 @@
1
+ import { DayAxis } from './event-calendar.axis.js';
2
+ /**
3
+ * Minutes from the axis start to the first line labelled `hour` (the wall-clock
4
+ * hour of the axis, so a day the clocks change opens on the right line), else
5
+ * counted from `startHour` by the clock.
6
+ */
7
+ export declare function scrollOffset(axis: DayAxis | undefined, hour: number, startHour: number): number;
@@ -7,6 +7,7 @@ export declare const eventCalendarSlice: import('@reduxjs/toolkit').Slice<EventC
7
7
  direction: -1 | 0 | 1;
8
8
  viewPicked: boolean;
9
9
  dayFocus: boolean;
10
+ resourceId: string | null;
10
11
  }, action: PayloadAction<string | null>) => void;
11
12
  setQuery: (state: {
12
13
  focusedEventId: string | null;
@@ -14,6 +15,7 @@ export declare const eventCalendarSlice: import('@reduxjs/toolkit').Slice<EventC
14
15
  direction: -1 | 0 | 1;
15
16
  viewPicked: boolean;
16
17
  dayFocus: boolean;
18
+ resourceId: string | null;
17
19
  }, action: PayloadAction<string>) => void;
18
20
  setDirection: (state: {
19
21
  focusedEventId: string | null;
@@ -21,6 +23,7 @@ export declare const eventCalendarSlice: import('@reduxjs/toolkit').Slice<EventC
21
23
  direction: -1 | 0 | 1;
22
24
  viewPicked: boolean;
23
25
  dayFocus: boolean;
26
+ resourceId: string | null;
24
27
  }, action: PayloadAction<-1 | 0 | 1>) => void;
25
28
  /** The keyboard moved the cursor: the month view focuses its day. */
26
29
  requestDayFocus: (state: {
@@ -29,13 +32,24 @@ export declare const eventCalendarSlice: import('@reduxjs/toolkit').Slice<EventC
29
32
  direction: -1 | 0 | 1;
30
33
  viewPicked: boolean;
31
34
  dayFocus: boolean;
35
+ resourceId: string | null;
32
36
  }, action: PayloadAction<boolean>) => void;
37
+ /** The phone's resource switcher picked a column. */
38
+ setResourceId: (state: {
39
+ focusedEventId: string | null;
40
+ query: string;
41
+ direction: -1 | 0 | 1;
42
+ viewPicked: boolean;
43
+ dayFocus: boolean;
44
+ resourceId: string | null;
45
+ }, action: PayloadAction<string | null>) => void;
33
46
  pickView: (state: {
34
47
  focusedEventId: string | null;
35
48
  query: string;
36
49
  direction: -1 | 0 | 1;
37
50
  viewPicked: boolean;
38
51
  dayFocus: boolean;
52
+ resourceId: string | null;
39
53
  }) => void;
40
54
  }, "event-calendar", "event-calendar", import('@reduxjs/toolkit').SliceSelectors<EventCalendarChromeState>>;
41
55
  export declare const eventCalendarActions: import('@reduxjs/toolkit').CaseReducerActions<{
@@ -45,6 +59,7 @@ export declare const eventCalendarActions: import('@reduxjs/toolkit').CaseReduce
45
59
  direction: -1 | 0 | 1;
46
60
  viewPicked: boolean;
47
61
  dayFocus: boolean;
62
+ resourceId: string | null;
48
63
  }, action: PayloadAction<string | null>) => void;
49
64
  setQuery: (state: {
50
65
  focusedEventId: string | null;
@@ -52,6 +67,7 @@ export declare const eventCalendarActions: import('@reduxjs/toolkit').CaseReduce
52
67
  direction: -1 | 0 | 1;
53
68
  viewPicked: boolean;
54
69
  dayFocus: boolean;
70
+ resourceId: string | null;
55
71
  }, action: PayloadAction<string>) => void;
56
72
  setDirection: (state: {
57
73
  focusedEventId: string | null;
@@ -59,6 +75,7 @@ export declare const eventCalendarActions: import('@reduxjs/toolkit').CaseReduce
59
75
  direction: -1 | 0 | 1;
60
76
  viewPicked: boolean;
61
77
  dayFocus: boolean;
78
+ resourceId: string | null;
62
79
  }, action: PayloadAction<-1 | 0 | 1>) => void;
63
80
  /** The keyboard moved the cursor: the month view focuses its day. */
64
81
  requestDayFocus: (state: {
@@ -67,12 +84,23 @@ export declare const eventCalendarActions: import('@reduxjs/toolkit').CaseReduce
67
84
  direction: -1 | 0 | 1;
68
85
  viewPicked: boolean;
69
86
  dayFocus: boolean;
87
+ resourceId: string | null;
70
88
  }, action: PayloadAction<boolean>) => void;
89
+ /** The phone's resource switcher picked a column. */
90
+ setResourceId: (state: {
91
+ focusedEventId: string | null;
92
+ query: string;
93
+ direction: -1 | 0 | 1;
94
+ viewPicked: boolean;
95
+ dayFocus: boolean;
96
+ resourceId: string | null;
97
+ }, action: PayloadAction<string | null>) => void;
71
98
  pickView: (state: {
72
99
  focusedEventId: string | null;
73
100
  query: string;
74
101
  direction: -1 | 0 | 1;
75
102
  viewPicked: boolean;
76
103
  dayFocus: boolean;
104
+ resourceId: string | null;
77
105
  }) => void;
78
106
  }, "event-calendar">;
@@ -11,14 +11,11 @@ export declare function shiftCursor(cursor: Date, view: EventCalendarView, delta
11
11
  export declare function viewLabel(cursor: Date, view: EventCalendarView, locale?: Locale, weekStartsOn?: WeekStart, short?: boolean): string;
12
12
  export declare function weekdayLabels(cursor: Date, locale?: Locale, weekStartsOn?: WeekStart): string[];
13
13
  export declare function agendaDays(cursor: Date, count?: number): Date[];
14
- export declare function hoursList(startHour: number, endHour: number): number[];
15
14
  export declare function allDaySlot(day: Date): EventCalendarSlot;
16
15
  export declare function allDayRange(from: Date, to: Date): EventCalendarSlot;
17
16
  export declare function dayInInclusiveRange(day: Date, from: Date, to: Date): boolean;
18
- export declare function timedSlot(day: Date, minutes: number, durationMinutes?: number): EventCalendarSlot;
19
17
  export declare function eventChanged(a: CalendarEvent, b: CalendarEvent): boolean;
20
18
  export declare function matchesEventQuery(event: CalendarEvent, query: string): boolean;
21
19
  export declare function eventSpanDays(event: CalendarEvent): number;
22
20
  export declare function shiftEvent(event: CalendarEvent, days: number, minutes?: number): CalendarEvent;
23
- export declare function formatHour(hour: number, locale?: Locale): string;
24
21
  export {};
@@ -0,0 +1,35 @@
1
+ import { CalendarEvent, EventCalendarSlot } from './types.js';
2
+ /**
3
+ * The event as the zone's wall clock reads it: `start` and `end` become
4
+ * offset-less ISO strings (`2026-03-12T09:00:00`), which every day-level
5
+ * helper of the calendar (the month, the agenda, the lanes, the labels)
6
+ * reads as plain local fields. The originals stay the source of truth: only
7
+ * what is drawn is projected, never what is stored or reported.
8
+ */
9
+ export declare function projectEvent(event: CalendarEvent, timeZone: string): CalendarEvent;
10
+ /** The `YYYY-MM-DD` day an instant falls on in the zone. */
11
+ export declare function zonedDayKey(iso: string, timeZone: string): string;
12
+ /** The event as an all-day one over the zone's day `key`, keeping its span in days. */
13
+ export declare function toZonedAllDay(event: CalendarEvent, key: string, timeZone: string): CalendarEvent;
14
+ /**
15
+ * The event moved to the zone's day `key`, at the same wall-clock time and
16
+ * for the same real duration (an all-day one keeps its span in days). A time
17
+ * the day skips lands the length of the skip later; the first occurrence of a
18
+ * repeated one is kept unless the event already sits on the second.
19
+ */
20
+ export declare function moveEventToZonedDay(event: CalendarEvent, key: string, timeZone: string): CalendarEvent;
21
+ /**
22
+ * The keyboard's move: `days` on the zone's calendar (the wall-clock time is
23
+ * kept), then `minutes` of real time, on the 15-minute grid.
24
+ */
25
+ export declare function shiftEventInZone(event: CalendarEvent, days: number, minutes: number, timeZone: string): CalendarEvent;
26
+ /**
27
+ * An all-day slot the grids built over local days, as the zone's days: the
28
+ * first instant of the first day to the first instant after the last.
29
+ */
30
+ export declare function zonedAllDaySlot(slot: EventCalendarSlot, timeZone: string): EventCalendarSlot;
31
+ /**
32
+ * An `onSlotClick` that tells an all-day slot as the zone's days (its start
33
+ * and end as that zone's midnights), and leaves the others as they are.
34
+ */
35
+ export declare function zonedSlotClick(onSlotClick: ((slot: EventCalendarSlot) => void) | undefined, zone: string | undefined): ((slot: EventCalendarSlot) => void) | undefined;
@@ -1,5 +1,5 @@
1
1
  export type { EventCalendarProps } from './event-calendar.js';
2
2
  export { EventCalendar } from './event-calendar.js';
3
3
  export { EventCalendarProvider, useEventCalendarContext, } from './event-calendar-context.js';
4
- export type { CalendarEvent, EventCalendarChange, EventCalendarDensity, EventCalendarRenderEvent, EventCalendarSlot, EventCalendarView, } from './types.js';
4
+ export type { CalendarEvent, EventCalendarChange, EventCalendarDensity, EventCalendarRenderEvent, EventCalendarResource, EventCalendarSlot, EventCalendarView, } from './types.js';
5
5
  export { useEventCalendar } from './use-event-calendar.js';
@@ -1,7 +1,9 @@
1
1
  import { CalendarEvent } from '../types.js';
2
- export declare function CalendarEventChip({ event, compact, className, continuesBefore, continuesAfter, appearance, }: {
2
+ export declare function CalendarEventChip({ event: drawn, compact, tight, className, continuesBefore, continuesAfter, appearance, }: {
3
3
  event: CalendarEvent;
4
4
  compact?: boolean;
5
+ /** The chip's box is under 20px tall (back-to-back short events). */
6
+ tight?: boolean;
5
7
  className?: string;
6
8
  continuesBefore?: boolean;
7
9
  continuesAfter?: boolean;
@@ -0,0 +1,6 @@
1
+ import { CalendarEvent } from '../types.js';
2
+ /** The popover's Resource select: moves the event to another column (or to none). */
3
+ export declare function EventPreviewResource({ event, locked, }: {
4
+ event: CalendarEvent;
5
+ locked: boolean;
6
+ }): import("react").JSX.Element | null;
@@ -0,0 +1,11 @@
1
+ import { CalendarEvent, EventCalendarResource } from '../types.js';
2
+ /**
3
+ * The popover's first line: the event's colour (its resource's tone when it
4
+ * sets none), the title to edit in place and the delete button.
5
+ */
6
+ export declare function EventPreviewTitle({ event, owner, locked, onDelete, }: {
7
+ event: CalendarEvent;
8
+ owner?: EventCalendarResource;
9
+ locked: boolean;
10
+ onDelete: () => void;
11
+ }): import("react").JSX.Element;
@@ -1,4 +1,5 @@
1
- import { CalendarEvent } from '../types.js';
2
- export declare function EventPreview({ event }: {
1
+ import { CalendarEvent, EventCalendarResource } from '../types.js';
2
+ export declare function EventPreview({ event, owner, }: {
3
3
  event: CalendarEvent;
4
+ owner?: EventCalendarResource;
4
5
  }): import("react").JSX.Element;
@@ -1,5 +1,6 @@
1
+ import { DayAxis } from '../event-calendar.axis.js';
1
2
  import { CalendarEvent } from '../types.js';
2
- export declare function EventResizeHandle({ event, day, }: {
3
+ export declare function EventResizeHandle({ event, axis, }: {
3
4
  event: CalendarEvent;
4
- day: Date;
5
+ axis: DayAxis;
5
6
  }): import("react").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { ResourceColumn } from '../event-calendar.resources.js';
2
+ /** The all-day lane of the day view with `resources`: one lane per resource column, as tall as the fullest. */
3
+ export declare function ResourceAllDayLane({ day, columns, }: {
4
+ day: Date;
5
+ columns: ResourceColumn[];
6
+ }): import("react").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { ReactNode } from 'react';
2
+ import { ResourceColumn } from '../event-calendar.resources.js';
3
+ /**
4
+ * The day view's header with `resources`: one cell per resource over its
5
+ * column, its label and description. It stays above the hours while they
6
+ * scroll, and the gutter's corner names the zone's offset when there is one.
7
+ */
8
+ export declare function ResourceHeader({ columns, zoneLabel, zone, }: {
9
+ columns: ResourceColumn[];
10
+ zoneLabel?: ReactNode;
11
+ zone?: string;
12
+ }): import("react").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { ResourceColumn } from '../event-calendar.resources.js';
2
+ /**
3
+ * The phone's replacement for the resource columns: one resource shows at a
4
+ * time, picked here, so no column is squeezed.
5
+ */
6
+ export declare function ResourceSwitcher({ columns, value, }: {
7
+ columns: ResourceColumn[];
8
+ value: ResourceColumn | undefined;
9
+ }): import("react").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { DayAxis } from '../event-calendar.axis.js';
2
+ /**
3
+ * The strong now line of today's column. In a zone it sits at the axis'
4
+ * minute and reads the zone's clock (nothing until the live clock is there);
5
+ * without one it reads the machine's.
6
+ */
7
+ export declare function TimeColumnNow({ axis, clock, }: {
8
+ axis: DayAxis;
9
+ clock: Date | null;
10
+ }): import("react").JSX.Element | null;
@@ -1,3 +1,14 @@
1
- export declare function TimeColumn({ day }: {
1
+ import { DayAxis } from '../event-calendar.axis.js';
2
+ import { ResourceColumn } from '../event-calendar.resources.js';
3
+ /**
4
+ * One column of hours: a day, or in the day view with `resources` a resource's
5
+ * day. `clock` is the live time (null on the server); `showNow` draws the
6
+ * strong now line in this column.
7
+ */
8
+ export declare function TimeColumn({ day, axis, resource, clock, showNow, }: {
2
9
  day: Date;
10
+ axis: DayAxis;
11
+ resource?: ResourceColumn;
12
+ clock: Date | null;
13
+ showNow?: boolean;
3
14
  }): import("react").JSX.Element;
@@ -1,5 +1,9 @@
1
+ import { DayAxis } from '../event-calendar.axis.js';
2
+ import { ResourceColumn } from '../event-calendar.resources.js';
1
3
  import { LaidOutEvent } from '../types.js';
2
- export declare function TimeGridEvent({ laid, day, }: {
4
+ export declare function TimeGridEvent({ laid, axis, resource, }: {
3
5
  laid: LaidOutEvent;
4
- day: Date;
6
+ axis: DayAxis;
7
+ /** The resource column it sits in, in the day view. */
8
+ resource?: ResourceColumn;
5
9
  }): import("react").JSX.Element;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * One day of the grid's header: the weekday and a large date, today's filled.
3
+ * With `canOpen` (a week that offers the day view) it is a button that opens
4
+ * that day.
5
+ */
6
+ export declare function HeaderDay({ day, canOpen }: {
7
+ day: Date;
8
+ canOpen: boolean;
9
+ }): import("react").JSX.Element;
@@ -2,6 +2,9 @@
2
2
  * The days above the grid: the weekday and a large date, today's filled. In a
3
3
  * week, a day opens the day view (when it is offered).
4
4
  */
5
- export declare function TimeGridHeader({ days }: {
5
+ export declare function TimeGridHeader({ days, zoneLabel, zone, }: {
6
6
  days: Date[];
7
+ /** The zone's offset (`UTC+1`), named in the gutter's corner when the calendar has a `timeZone`. */
8
+ zoneLabel?: string;
9
+ zone?: string;
7
10
  }): import("react").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { TimeGridState } from '../use-time-grid.js';
2
+ /** The hours of the grid in a scroll area: the gutter, a column per day (or resource) and the now line. */
3
+ export declare function TimeGridHours({ days, grid, }: {
4
+ days: Date[];
5
+ grid: TimeGridState;
6
+ }): import("react").JSX.Element;
@@ -1,9 +1,16 @@
1
1
  /**
2
2
  * The week and day views: the days' header, the all-day lane, then the hours
3
- * in a scroll area — opened on the current time when today is shown, else on
4
- * `scrollToHour`. The hour height reaches the grid as CSS custom properties
5
- * set from script, never as inline style in server markup.
3
+ * in a scroll area (see `useTimeGrid`).
4
+ *
5
+ * With `resources` the day view is one column per resource under a sticky
6
+ * header, scrolling sideways when they do not fit; on a phone one resource
7
+ * shows at a time. Resources are the day view's only: a week keeps its days.
8
+ * With a `timeZone` the hours are the zone's: the day view (`real`) draws the
9
+ * day's real length, 23 or 25 hours on a day the clocks change, while a week
10
+ * keeps 24 wall-clock rows a day.
6
11
  */
7
- export declare function TimeGrid({ days }: {
12
+ export declare function TimeGrid({ days, real, }: {
8
13
  days: Date[];
14
+ /** Draw each day's real elapsed time in a zone (the day view). */
15
+ real?: boolean;
9
16
  }): import("react").JSX.Element;
@@ -1,8 +1,13 @@
1
+ import { AxisTick } from '../event-calendar.axis.js';
1
2
  /**
2
3
  * The hours beside the grid, each label centred on its line (the first one
3
- * just below the top). Each row is `--hour-h` tall, as the columns' rows.
4
+ * just below the top). Each row is `--hour-h` tall, as the columns' rows. The
5
+ * ticks come from the axis: on a day with a clock change, a label is missing
6
+ * (the hour skipped) or twice there (the hour repeated).
4
7
  */
5
- export declare function TimeGutter({ nowMinutes, }: {
6
- /** The minute of the day the current-time pill sits at, when it shows: the hour under it is hidden. */
7
- nowMinutes?: number | null;
8
+ export declare function TimeGutter({ ticks, nowOffset, className, }: {
9
+ ticks: AxisTick[];
10
+ /** The minute from the grid's top the current-time pill sits at, when it shows: the hour under it is hidden. */
11
+ nowOffset?: number | null;
12
+ className?: string;
8
13
  }): import("react").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { Tone } from '../../../tones.js';
2
+ /** A resource's tone as a small dot: decorative, its name is next to it. */
3
+ export declare function ToneMark({ tone }: {
4
+ tone: Tone;
5
+ }): import("react").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { ReactNode } from 'react';
2
+ /**
3
+ * The gutter's corner above the hours: it names the zone's offset (`UTC+1`)
4
+ * when the calendar has a `timeZone`, and stays an empty cell otherwise.
5
+ */
6
+ export declare function ZoneCorner({ zoneLabel, zone, className, }: {
7
+ zoneLabel?: ReactNode;
8
+ zone?: string;
9
+ className?: string;
10
+ }): import("react").JSX.Element;
@@ -1,5 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { EventChipVariant } from '../../display/event-chip/event-chip.classes.js';
3
+ import { Tone } from '../../tones.js';
3
4
  export type EventCalendarView = 'month' | 'week' | 'workweek' | 'day' | 'agenda';
4
5
  export type CalendarEvent = {
5
6
  id: string;
@@ -10,6 +11,24 @@ export type CalendarEvent = {
10
11
  color?: string;
11
12
  description?: string;
12
13
  disabled?: boolean;
14
+ /**
15
+ * The `id` of the resource (a room, a person, a team) the event belongs to,
16
+ * when the calendar has `resources`. One with none, or an unknown one, is
17
+ * unassigned.
18
+ */
19
+ resourceId?: string;
20
+ };
21
+ /** A column of the day view: a room, a person, a team. */
22
+ export type EventCalendarResource = {
23
+ id: string;
24
+ label: string;
25
+ description?: string;
26
+ /**
27
+ * A tone of the library (`'success'`, or one an app declared), never a raw
28
+ * colour. A small mark on the column's header and on the phone switcher
29
+ * shows it, and it is the colour of the column's events that set none.
30
+ */
31
+ tone?: Tone;
13
32
  };
14
33
  export type EventCalendarChange = {
15
34
  events: CalendarEvent[];
@@ -20,6 +39,8 @@ export type EventCalendarSlot = {
20
39
  start: Date;
21
40
  end: Date;
22
41
  allDay: boolean;
42
+ /** The resource column a timed slot or an all-day slot was made in, in the day view. */
43
+ resourceId?: string;
23
44
  };
24
45
  /** `comfortable` (the default) or `compact`: shorter hours and month cells. */
25
46
  export type EventCalendarDensity = 'comfortable' | 'compact';
@@ -32,6 +53,8 @@ export type EventCalendarChromeState = {
32
53
  viewPicked: boolean;
33
54
  /** The keyboard moved the cursor: its day takes the focus once rendered. */
34
55
  dayFocus: boolean;
56
+ /** The resource the phone's switcher shows; `null` is the first. */
57
+ resourceId: string | null;
35
58
  };
36
59
  export type EventCalendarRenderEvent = (event: CalendarEvent) => ReactNode;
37
60
  export type EventCalendarProps = {
@@ -76,6 +99,23 @@ export type EventCalendarProps = {
76
99
  now?: Date;
77
100
  /** The hour the week and day views open on when today is not shown. Default 7. */
78
101
  scrollToHour?: number;
102
+ /**
103
+ * The columns of the day view, one per resource, under a sticky header.
104
+ * Events go in the column of their `resourceId`; those with none (or an
105
+ * unknown one) share a leading "Unassigned" column, drawn only when one
106
+ * exists. Dragging an event to another column changes its `resourceId`
107
+ * through `onChange`. On a phone one resource shows at a time, picked in a
108
+ * switcher. The week, workweek, month and agenda views ignore it.
109
+ */
110
+ resources?: EventCalendarResource[];
111
+ /**
112
+ * An IANA zone (`Africa/Lagos`) to read the calendar in. The grid, "today",
113
+ * the day boundaries, the now line and the times shown follow it;
114
+ * `start` and `end` stay true instants, and so do the dates given to
115
+ * `onSlotClick` and `onChange`. An unknown name reads `UTC` (a warning in
116
+ * development). Without it, the machine's clock.
117
+ */
118
+ timeZone?: string;
79
119
  };
80
120
  export type LaidOutEvent = {
81
121
  event: CalendarEvent;
@@ -83,4 +123,6 @@ export type LaidOutEvent = {
83
123
  columns: number;
84
124
  startMin: number;
85
125
  endMin: number;
126
+ /** Where it is drawn to: `endMin`, or further into free space up to the minimum height. */
127
+ drawEndMin: number;
86
128
  };
@@ -0,0 +1,3 @@
1
+ import { DragEndEvent } from '@dnd-kit/core';
2
+ /** The `onDragEnd` of the board: reads what was dropped where, and replaces the event. */
3
+ export declare function useCalendarDrag(): (event: DragEndEvent) => void;
@@ -0,0 +1,3 @@
1
+ import { KeyboardEvent } from 'react';
2
+ /** The board's `onKeyDown`: the arrows shift the period or the focused event. */
3
+ export declare function useCalendarKeys(): (event: KeyboardEvent<HTMLDivElement>) => void;
@@ -0,0 +1,15 @@
1
+ import { EventCalendarProps, EventCalendarView } from './types.js';
2
+ /**
3
+ * The view and the day the calendar shows, each controlled or not. Choosing a
4
+ * view by hand (`onPickView`) stops the phone's own view from taking over.
5
+ */
6
+ export declare function useCalendarNav({ view: viewProp, defaultView, onViewChange, date: dateProp, defaultDate, onDateChange, onPickView, }: Pick<EventCalendarProps, 'view' | 'defaultView' | 'onViewChange' | 'date' | 'onDateChange'> & {
7
+ defaultDate: string;
8
+ onPickView: () => void;
9
+ }): {
10
+ view: EventCalendarView;
11
+ cursor: string;
12
+ cursorDate: Date;
13
+ setView: (next: EventCalendarView) => void;
14
+ setCursor: (next: string) => void;
15
+ };
@@ -0,0 +1,13 @@
1
+ import { CalendarEvent } from './types.js';
2
+ /**
3
+ * What a chip shows of the event drawn (the zone's wall clock when the
4
+ * calendar has a `timeZone`): the event as stored (the one callbacks get), its
5
+ * resource, the event in that resource's tone, and its times read in the zone.
6
+ */
7
+ export declare function useChipEvent(drawn: CalendarEvent): {
8
+ time?: string;
9
+ endTime?: string;
10
+ source: CalendarEvent;
11
+ owner: import('./types.js').EventCalendarResource | undefined;
12
+ event: CalendarEvent;
13
+ };
@@ -0,0 +1,9 @@
1
+ import { EventCalendarModel } from './use-event-calendar.js';
2
+ /**
3
+ * The events the search keeps, as stored (true instants), and as drawn: in a
4
+ * zone, the zone's wall clock; otherwise the same list.
5
+ */
6
+ export declare function useDrawnEvents({ events, chrome, zone, project, }: EventCalendarModel): {
7
+ sourceEvents: import('./types.js').CalendarEvent[];
8
+ visibleEvents: import('./types.js').CalendarEvent[];
9
+ };