@k2b/ui 0.22.0 → 0.24.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/dist/browser/content/Calendar.js +1122 -1065
- package/dist/browser/content/Calendar.js.map +1 -1
- package/dist/browser/content/CalendarDayView.js +1187 -0
- package/dist/browser/content/CalendarDayView.js.map +1 -0
- package/dist/browser/content/CalendarWeekView.js +1593 -0
- package/dist/browser/content/CalendarWeekView.js.map +1 -0
- package/dist/browser/content/ChartExplorer.js +174 -82
- package/dist/browser/content/ChartExplorer.js.map +1 -1
- package/dist/browser/content/ChartFilterControls.js +90 -33
- package/dist/browser/content/ChartFilterControls.js.map +1 -1
- package/dist/browser/content/DataTable.js +235 -197
- package/dist/browser/content/DataTable.js.map +1 -1
- package/dist/browser/content/calendar-day-scroll.js +111 -0
- package/dist/browser/content/calendar-day-scroll.js.map +1 -0
- package/dist/browser/content/calendar-days.js +408 -0
- package/dist/browser/content/calendar-days.js.map +1 -0
- package/dist/browser/content/calendar-dialogs.js +236 -0
- package/dist/browser/content/calendar-dialogs.js.map +1 -0
- package/dist/browser/content/calendar-messages.js +210 -2
- package/dist/browser/content/calendar-messages.js.map +1 -1
- package/dist/browser/content/calendar-pointer.js +15 -3
- package/dist/browser/content/calendar-pointer.js.map +1 -1
- package/dist/browser/content/calendar-shared.js +328 -0
- package/dist/browser/content/calendar-shared.js.map +1 -0
- package/dist/browser/content/calendar-time-view.js +1654 -0
- package/dist/browser/content/calendar-time-view.js.map +1 -0
- package/dist/browser/content/chart-messages.js +10 -0
- package/dist/browser/content/chart-messages.js.map +1 -1
- package/dist/browser/content/index.js.map +1 -1
- package/dist/browser/inputs/Combobox.js +0 -1
- package/dist/browser/inputs/Combobox.js.map +1 -1
- package/dist/browser/layout/AppWorkspace.js +125 -97
- package/dist/browser/layout/AppWorkspace.js.map +1 -1
- package/dist/browser/layout/Navigation.js +18 -3
- package/dist/browser/layout/Navigation.js.map +1 -1
- package/dist/browser/layout/PageTitle.js +18 -1
- package/dist/browser/layout/PageTitle.js.map +1 -1
- package/dist/browser/layout/SidebarSwitcher.js +505 -0
- package/dist/browser/layout/SidebarSwitcher.js.map +1 -0
- package/dist/browser/layout/app-workspace-controller.js +174 -86
- package/dist/browser/layout/app-workspace-controller.js.map +1 -1
- package/dist/browser/layout/index.js +1 -0
- package/dist/browser/layout/index.js.map +1 -1
- package/dist/browser/layout/navigation-model.js +1 -0
- package/dist/browser/layout/navigation-model.js.map +1 -1
- package/dist/browser/surfaces/StatCell.js +18 -6
- package/dist/browser/surfaces/StatCell.js.map +1 -1
- package/dist/ssr/content/Calendar.js +553 -341
- package/dist/ssr/content/Calendar.js.map +1 -1
- package/dist/ssr/content/CalendarDayView.js +800 -0
- package/dist/ssr/content/CalendarDayView.js.map +1 -0
- package/dist/ssr/content/CalendarWeekView.js +1090 -0
- package/dist/ssr/content/CalendarWeekView.js.map +1 -0
- package/dist/ssr/content/ChartExplorer.js +93 -34
- package/dist/ssr/content/ChartExplorer.js.map +1 -1
- package/dist/ssr/content/ChartFilterControls.js +49 -7
- package/dist/ssr/content/ChartFilterControls.js.map +1 -1
- package/dist/ssr/content/DataTable.js +88 -66
- package/dist/ssr/content/DataTable.js.map +1 -1
- package/dist/ssr/content/calendar-day-scroll.js +111 -0
- package/dist/ssr/content/calendar-day-scroll.js.map +1 -0
- package/dist/ssr/content/calendar-days.js +408 -0
- package/dist/ssr/content/calendar-days.js.map +1 -0
- package/dist/ssr/content/calendar-dialogs.js +159 -0
- package/dist/ssr/content/calendar-dialogs.js.map +1 -0
- package/dist/ssr/content/calendar-messages.js +210 -2
- package/dist/ssr/content/calendar-messages.js.map +1 -1
- package/dist/ssr/content/calendar-pointer.js +15 -3
- package/dist/ssr/content/calendar-pointer.js.map +1 -1
- package/dist/ssr/content/calendar-shared.js +261 -0
- package/dist/ssr/content/calendar-shared.js.map +1 -0
- package/dist/ssr/content/calendar-time-view.js +1311 -0
- package/dist/ssr/content/calendar-time-view.js.map +1 -0
- package/dist/ssr/content/chart-messages.js +10 -0
- package/dist/ssr/content/chart-messages.js.map +1 -1
- package/dist/ssr/content/index.js.map +1 -1
- package/dist/ssr/inputs/Combobox.js.map +1 -1
- package/dist/ssr/layout/AppWorkspace.js +40 -29
- package/dist/ssr/layout/AppWorkspace.js.map +1 -1
- package/dist/ssr/layout/Navigation.js +12 -2
- package/dist/ssr/layout/Navigation.js.map +1 -1
- package/dist/ssr/layout/PageTitle.js +18 -1
- package/dist/ssr/layout/PageTitle.js.map +1 -1
- package/dist/ssr/layout/SidebarSwitcher.js +271 -0
- package/dist/ssr/layout/SidebarSwitcher.js.map +1 -0
- package/dist/ssr/layout/app-workspace-controller.js +174 -86
- package/dist/ssr/layout/app-workspace-controller.js.map +1 -1
- package/dist/ssr/layout/index.js +1 -0
- package/dist/ssr/layout/index.js.map +1 -1
- package/dist/ssr/layout/navigation-model.js +1 -0
- package/dist/ssr/layout/navigation-model.js.map +1 -1
- package/dist/ssr/surfaces/StatCell.js +2 -2
- package/dist/ssr/surfaces/StatCell.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/content/Calendar.d.ts +95 -1
- package/dist/types/content/CalendarDayView.d.ts +7 -0
- package/dist/types/content/CalendarWeekView.d.ts +7 -0
- package/dist/types/content/ChartExplorer.d.ts +36 -1
- package/dist/types/content/ChartFilterControls.d.ts +6 -1
- package/dist/types/content/DataTable.d.ts +14 -0
- package/dist/types/content/calendar-day-scroll.d.ts +47 -0
- package/dist/types/content/calendar-days.d.ts +192 -0
- package/dist/types/content/calendar-dialogs.d.ts +22 -0
- package/dist/types/content/calendar-messages.d.ts +99 -0
- package/dist/types/content/calendar-pointer.d.ts +9 -0
- package/dist/types/content/calendar-shared.d.ts +69 -0
- package/dist/types/content/calendar-time-view.d.ts +252 -0
- package/dist/types/content/chart-messages.d.ts +5 -0
- package/dist/types/content/index.d.ts +2 -2
- package/dist/types/layout/AppWorkspace.d.ts +27 -3
- package/dist/types/layout/PageTitle.d.ts +2 -1
- package/dist/types/layout/SidebarSwitcher.d.ts +65 -0
- package/dist/types/layout/app-workspace-controller.d.ts +9 -1
- package/dist/types/layout/index.d.ts +1 -0
- package/dist/types/layout/navigation-model.d.ts +4 -0
- package/dist/types/surfaces/StatCell.d.ts +5 -0
- package/package.json +3 -3
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { type DateContext } from "@k2b/stdlib";
|
|
2
|
+
import type { JSX } from "solid-js";
|
|
3
|
+
import type { CalendarEvent, CalendarProps } from "./Calendar";
|
|
4
|
+
/** One piece of an event in one day, with the times of the whole event. */
|
|
5
|
+
export type NormalizedEvent = CalendarEvent & {
|
|
6
|
+
startDate: Date;
|
|
7
|
+
endDate: Date;
|
|
8
|
+
dayKey: string;
|
|
9
|
+
sourceStartDate: Date;
|
|
10
|
+
sourceEndDate: Date;
|
|
11
|
+
};
|
|
12
|
+
/** A keyboard stop of the week grid. */
|
|
13
|
+
export type CalendarStop = {
|
|
14
|
+
id: string;
|
|
15
|
+
column: number;
|
|
16
|
+
minute: number;
|
|
17
|
+
};
|
|
18
|
+
/** What the built-in views read from the props: they only ever link to built-in views. */
|
|
19
|
+
export type CalendarOwner = Omit<CalendarProps, "view" | "customViews" | "children">;
|
|
20
|
+
export declare const ownerDateConfig: (owner: CalendarOwner) => DateContext;
|
|
21
|
+
export declare const parseDate: (value: Date | string, context?: DateContext) => Date;
|
|
22
|
+
export declare const validDate: (value: Date) => boolean;
|
|
23
|
+
export declare const formatTime: (date: Date, context?: DateContext) => string;
|
|
24
|
+
export declare const eventHref: (props: CalendarOwner, event: CalendarEvent) => string | undefined;
|
|
25
|
+
/** Places a calendar popover below its anchor when there is room and above it otherwise, inside the viewport. */
|
|
26
|
+
export declare const placeCalendarPopover: (anchor: Element | DOMRect, popover: HTMLElement) => void;
|
|
27
|
+
/** Follows a calendar link the way the calendar's own links do: through the host's navigation when it has one. */
|
|
28
|
+
export declare const followCalendarHref: (owner: CalendarOwner, href: string) => void;
|
|
29
|
+
export declare const EventChip: (props: {
|
|
30
|
+
event: NormalizedEvent;
|
|
31
|
+
owner: CalendarOwner;
|
|
32
|
+
href?: string;
|
|
33
|
+
compact?: boolean;
|
|
34
|
+
fill?: boolean;
|
|
35
|
+
moving?: boolean;
|
|
36
|
+
/** Replaces the title and time at the start of the accessible name, for example with the dates a long event spans. */
|
|
37
|
+
label?: string;
|
|
38
|
+
/** A bar of a long event that goes on before or after the week row it sits in. */
|
|
39
|
+
continuesBefore?: boolean;
|
|
40
|
+
continuesAfter?: boolean;
|
|
41
|
+
/** Month view: an all-day or multi-day entry drawn as a bar. */
|
|
42
|
+
bar?: boolean;
|
|
43
|
+
/** Short dates at the torn ends of a bar, where it continues in another week row. */
|
|
44
|
+
hintStart?: string;
|
|
45
|
+
hintEnd?: string;
|
|
46
|
+
/** Month view: the start time before the title. */
|
|
47
|
+
leadingTime?: string;
|
|
48
|
+
/** Day and week views: what is left of a running event, such as "27 min left". */
|
|
49
|
+
remaining?: string;
|
|
50
|
+
/** Day and week views: the calendar draws the event's checkbox beside the chip. */
|
|
51
|
+
checkbox?: boolean;
|
|
52
|
+
/** Day and week views with `dayHours`: the chip is a band, a deadline, or an all-day entry of a timeline. */
|
|
53
|
+
timeline?: boolean;
|
|
54
|
+
/** Text after the content, such as the time of a deadline. */
|
|
55
|
+
trailing?: JSX.Element;
|
|
56
|
+
/** Day and week views: the time as they write it, such as "10:30–11:15", shown whatever the length. */
|
|
57
|
+
timeLabel?: string;
|
|
58
|
+
/** Day view: a band tall enough shows its place below the time. */
|
|
59
|
+
showLocation?: boolean;
|
|
60
|
+
/** Week view: the grid's one tab stop decides which chip takes Tab. */
|
|
61
|
+
tabIndex?: number;
|
|
62
|
+
/** A keyboard stop of the week grid: its id, its day column, and its minute for moving between columns. */
|
|
63
|
+
stop?: CalendarStop;
|
|
64
|
+
/** Day and week views: Space on the chip checks the box the calendar draws beside it, as on the box itself. */
|
|
65
|
+
onCheck?: () => void;
|
|
66
|
+
onMovePointerDown?: (event: PointerEvent, onActivate: () => void) => void;
|
|
67
|
+
}) => JSX.Element;
|
|
68
|
+
/** The width of a text in a font, from a canvas, so a bar can tell whether its title leaves room for a date hint. */
|
|
69
|
+
export declare const textWidth: (text: string, font: string) => number;
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import { type DateContext } from "@k2b/stdlib";
|
|
2
|
+
import type { CalendarController, CalendarEvent, CalendarEventTimeChange, CalendarExternalDrag, CalendarLabels } from "./Calendar";
|
|
3
|
+
import { type CalendarDayHours, type DayGap, type DayGeometry, type DayLane, type DayModel, type DaySpan } from "./calendar-days";
|
|
4
|
+
import { type CalendarOwner, type CalendarStop, type NormalizedEvent } from "./calendar-shared";
|
|
5
|
+
/**
|
|
6
|
+
* Shared state and parts of the day and week views with `dayHours`: the time model of the loaded days, the selection,
|
|
7
|
+
* the quick create, pointer gestures, and the pieces both views draw into a day's timeline.
|
|
8
|
+
*/
|
|
9
|
+
export type TodayDirection = "left" | "right" | "up" | "down" | "";
|
|
10
|
+
/** What the header and the calendar's controller ask of the active day or week view. */
|
|
11
|
+
export type TimeViewHandle = {
|
|
12
|
+
/** The first and last day the reader sees. */
|
|
13
|
+
visibleKeys: () => {
|
|
14
|
+
first: string;
|
|
15
|
+
last: string;
|
|
16
|
+
};
|
|
17
|
+
/** Moves by a day (day view) or a week (week view) when that is loaded; `false` leaves it to the header's link. */
|
|
18
|
+
step: (direction: -1 | 1) => boolean;
|
|
19
|
+
/** Shows a day when it is loaded; `false` leaves it to navigation. */
|
|
20
|
+
goTo: (key: string) => boolean;
|
|
21
|
+
/** Shows today and now when they are loaded. */
|
|
22
|
+
today: () => boolean;
|
|
23
|
+
todayDirection: () => TodayDirection;
|
|
24
|
+
controller: CalendarController;
|
|
25
|
+
};
|
|
26
|
+
export type TimeViewProps = {
|
|
27
|
+
owner: CalendarOwner;
|
|
28
|
+
view: "day" | "week";
|
|
29
|
+
date: Date;
|
|
30
|
+
now: Date;
|
|
31
|
+
events: readonly CalendarEvent[];
|
|
32
|
+
labels: Required<CalendarLabels>;
|
|
33
|
+
hours: CalendarDayHours;
|
|
34
|
+
register: (handle: TimeViewHandle | null) => void;
|
|
35
|
+
};
|
|
36
|
+
export type TimeSelection = {
|
|
37
|
+
key: string;
|
|
38
|
+
start?: number;
|
|
39
|
+
end?: number;
|
|
40
|
+
};
|
|
41
|
+
type Ghost = {
|
|
42
|
+
key: string;
|
|
43
|
+
start: number;
|
|
44
|
+
end: number;
|
|
45
|
+
title: string;
|
|
46
|
+
time: string;
|
|
47
|
+
colorHex?: string;
|
|
48
|
+
color?: string;
|
|
49
|
+
warn?: boolean;
|
|
50
|
+
fit?: {
|
|
51
|
+
fits: boolean;
|
|
52
|
+
text: string;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
type QuickCreate = {
|
|
56
|
+
range: CalendarEventTimeChange;
|
|
57
|
+
anchor: Element | DOMRect;
|
|
58
|
+
create?: string;
|
|
59
|
+
key: string;
|
|
60
|
+
start?: number;
|
|
61
|
+
end?: number;
|
|
62
|
+
};
|
|
63
|
+
export type BodyHit = {
|
|
64
|
+
key: string;
|
|
65
|
+
element: HTMLElement;
|
|
66
|
+
geometry: DayGeometry;
|
|
67
|
+
minute: number;
|
|
68
|
+
};
|
|
69
|
+
export declare const eventAccent: (event: Pick<CalendarEvent, "color" | "colorHex">) => string;
|
|
70
|
+
export declare const reducedMotion: () => boolean;
|
|
71
|
+
/** Swallows the click a browser sends right after a gesture ends, never the next one. */
|
|
72
|
+
export declare const swallowNextClick: () => void;
|
|
73
|
+
export declare const createTimeView: (props: TimeViewProps) => {
|
|
74
|
+
props: TimeViewProps;
|
|
75
|
+
messages: () => import("./calendar-messages").CalendarMessages;
|
|
76
|
+
dateConfig: import("solid-js").Accessor<DateContext>;
|
|
77
|
+
hours: () => CalendarDayHours;
|
|
78
|
+
wake: import("solid-js").Accessor<number>;
|
|
79
|
+
range: import("solid-js").Accessor<{
|
|
80
|
+
first: string;
|
|
81
|
+
last: string;
|
|
82
|
+
}>;
|
|
83
|
+
anchorKey: import("solid-js").Accessor<string>;
|
|
84
|
+
days: import("solid-js").Accessor<Map<string, DayModel<CalendarEvent>>>;
|
|
85
|
+
dayOf: (key: string) => DayModel<CalendarEvent>;
|
|
86
|
+
keyOf: (date: Date) => string;
|
|
87
|
+
parseKey: (key: string) => Date;
|
|
88
|
+
nowKey: import("solid-js").Accessor<string>;
|
|
89
|
+
nowMinute: import("solid-js").Accessor<number>;
|
|
90
|
+
nowIn: (key: string) => number;
|
|
91
|
+
calendarToday: import("solid-js").Accessor<string>;
|
|
92
|
+
clock: (minute: number) => string;
|
|
93
|
+
duration: (minutes: number) => string;
|
|
94
|
+
instant: (key: string, minute: number) => Date;
|
|
95
|
+
normalized: (event: CalendarEvent, key: string) => NormalizedEvent;
|
|
96
|
+
checkedOf: (event: CalendarEvent) => boolean | undefined;
|
|
97
|
+
toggleCheck: (event: CalendarEvent) => void;
|
|
98
|
+
checkOf: (event: CalendarEvent) => (() => void) | undefined;
|
|
99
|
+
justChecked: import("solid-js").Accessor<ReadonlySet<string>>;
|
|
100
|
+
cheered: import("solid-js").Accessor<string | null>;
|
|
101
|
+
selection: import("solid-js").Accessor<TimeSelection | null>;
|
|
102
|
+
setSelection: import("solid-js").Setter<TimeSelection | null>;
|
|
103
|
+
touchDraft: import("solid-js").Accessor<{
|
|
104
|
+
key: string;
|
|
105
|
+
start: number;
|
|
106
|
+
end: number;
|
|
107
|
+
} | null>;
|
|
108
|
+
setTouchDraft: import("solid-js").Setter<{
|
|
109
|
+
key: string;
|
|
110
|
+
start: number;
|
|
111
|
+
end: number;
|
|
112
|
+
} | null>;
|
|
113
|
+
activeKey: import("solid-js").Accessor<string | null>;
|
|
114
|
+
setActiveKey: import("solid-js").Setter<string | null>;
|
|
115
|
+
ghost: import("solid-js").Accessor<Ghost | null>;
|
|
116
|
+
gapHit: import("solid-js").Accessor<{
|
|
117
|
+
key: string;
|
|
118
|
+
start: number;
|
|
119
|
+
fits: boolean;
|
|
120
|
+
text: string;
|
|
121
|
+
} | null>;
|
|
122
|
+
movingId: import("solid-js").Accessor<string>;
|
|
123
|
+
dragging: import("solid-js").Accessor<"" | "draw" | "end" | "external" | "move" | "start">;
|
|
124
|
+
nightOpen: (key: string, model: DayModel<CalendarEvent>) => boolean;
|
|
125
|
+
setNight: (key: string, open: boolean) => {
|
|
126
|
+
[x: string]: boolean;
|
|
127
|
+
};
|
|
128
|
+
quick: import("solid-js").Accessor<QuickCreate | null>;
|
|
129
|
+
setQuick: import("solid-js").Setter<QuickCreate | null>;
|
|
130
|
+
openQuickCreate: (key: string, start: number | undefined, end: number | undefined, anchor: Element | DOMRect, create?: string) => void;
|
|
131
|
+
canCreate: () => boolean;
|
|
132
|
+
createTarget: (visible: {
|
|
133
|
+
first: string;
|
|
134
|
+
last: string;
|
|
135
|
+
}) => {
|
|
136
|
+
key: string;
|
|
137
|
+
start: number;
|
|
138
|
+
end: number;
|
|
139
|
+
};
|
|
140
|
+
rangeOfSelection: (value: TimeSelection) => CalendarEventTimeChange;
|
|
141
|
+
registerBody: (key: string, element: HTMLElement, expanded: () => boolean) => void;
|
|
142
|
+
bodyAt: (clientX: number, clientY: number) => BodyHit | null;
|
|
143
|
+
limitOf: (key: string) => number;
|
|
144
|
+
startMove: (pointerEvent: PointerEvent, event: CalendarEvent, key: string, start: number, end: number, scroller?: HTMLElement) => void;
|
|
145
|
+
startResize: (pointerEvent: PointerEvent, event: CalendarEvent, key: string, start: number, end: number, edge: "start" | "end", scroller?: HTMLElement) => void;
|
|
146
|
+
startDraw: (pointerEvent: PointerEvent, key: string, scroller?: HTMLElement) => void;
|
|
147
|
+
dragIn: (pointerEvent: PointerEvent, item: CalendarExternalDrag, onDrop: (slot: CalendarEventTimeChange) => void, scroller?: HTMLElement) => void;
|
|
148
|
+
dayStartMinute: (hour: number) => number;
|
|
149
|
+
};
|
|
150
|
+
export type TimeView = ReturnType<typeof createTimeView>;
|
|
151
|
+
/**
|
|
152
|
+
* German short dates read "Fr 9. Okt", without the dots of the abbreviations; with `comma`, a title such as
|
|
153
|
+
* "Fr, 9. Okt 2026" keeps the comma after the day.
|
|
154
|
+
*/
|
|
155
|
+
export declare const compactGermanDate: (text: string, locale: string | undefined, comma?: boolean) => string;
|
|
156
|
+
/** A short day such as "Fri 9" or "Fr 9.", in the calendar's locale. */
|
|
157
|
+
export declare const shortDay: (view: TimeView, key: string, withMonth?: boolean) => string;
|
|
158
|
+
/** A long day such as "Friday, October 9", with the year when it is not this year's. */
|
|
159
|
+
export declare const longDay: (view: TimeView, key: string) => string;
|
|
160
|
+
/** A to-do's checkbox: it draws its check, and the title beside it strikes through. */
|
|
161
|
+
export declare const TimeCheck: (props: {
|
|
162
|
+
view: TimeView;
|
|
163
|
+
event: CalendarEvent;
|
|
164
|
+
tabIndex?: number;
|
|
165
|
+
}) => import("solid-js").JSX.Element;
|
|
166
|
+
/** A timed entry in a day's timeline: a band as long as the entry, side by side with overlapping ones. */
|
|
167
|
+
export declare const TimeBand: (props: {
|
|
168
|
+
view: TimeView;
|
|
169
|
+
band: DayLane<CalendarEvent>;
|
|
170
|
+
dayKey: string;
|
|
171
|
+
expanded: boolean;
|
|
172
|
+
compact?: boolean;
|
|
173
|
+
/** Day view: a tall band shows its place. */
|
|
174
|
+
showLocation?: boolean;
|
|
175
|
+
/** The height of an hour on a wide screen, for the band's size class and title lines. */
|
|
176
|
+
hourPx: number;
|
|
177
|
+
tabIndex?: number;
|
|
178
|
+
stop?: CalendarStop;
|
|
179
|
+
scroller?: () => HTMLElement | undefined;
|
|
180
|
+
}) => import("solid-js").JSX.Element;
|
|
181
|
+
/** A point in time such as a deadline: a dashed line across the day and a pill with its checkbox and title. */
|
|
182
|
+
export declare const TimeMarker: (props: {
|
|
183
|
+
view: TimeView;
|
|
184
|
+
event: CalendarEvent;
|
|
185
|
+
minute: number;
|
|
186
|
+
dayKey: string;
|
|
187
|
+
expanded: boolean;
|
|
188
|
+
above: boolean;
|
|
189
|
+
/** The pill's place among deadlines whose pills would cover each other, from the left. */
|
|
190
|
+
lane: number;
|
|
191
|
+
lanes: number;
|
|
192
|
+
showTime: boolean;
|
|
193
|
+
tabIndex?: number;
|
|
194
|
+
stop?: CalendarStop;
|
|
195
|
+
scroller?: () => HTMLElement | undefined;
|
|
196
|
+
}) => import("solid-js").JSX.Element;
|
|
197
|
+
/** Free time between entries, labelled from an hour on; activating it creates there. */
|
|
198
|
+
export declare const TimeGap: (props: {
|
|
199
|
+
view: TimeView;
|
|
200
|
+
gap: DayGap;
|
|
201
|
+
dayKey: string;
|
|
202
|
+
expanded: boolean;
|
|
203
|
+
/** A deadline pill near the middle moves the label aside. */
|
|
204
|
+
aside: boolean;
|
|
205
|
+
tabIndex?: number;
|
|
206
|
+
stop?: CalendarStop;
|
|
207
|
+
}) => import("solid-js").JSX.Element;
|
|
208
|
+
/** The preview of a drag, a draw, or an entry dragged in, and the selected slot. */
|
|
209
|
+
export declare const TimeOverlays: (props: {
|
|
210
|
+
view: TimeView;
|
|
211
|
+
dayKey: string;
|
|
212
|
+
expanded: boolean;
|
|
213
|
+
}) => import("solid-js").JSX.Element;
|
|
214
|
+
/** Free time of a day with the gap of now trimmed, as both views draw it. */
|
|
215
|
+
export declare const dayGaps: (view: TimeView, key: string) => DayGap[];
|
|
216
|
+
/** The bands of a day with their lanes, cut to what its timeline draws. */
|
|
217
|
+
export declare const dayBands: (view: TimeView, key: string, expanded: boolean) => DayLane<CalendarEvent>[];
|
|
218
|
+
/** Entries the folded night hides, as chips with their time. */
|
|
219
|
+
export declare const foldedEntries: (view: TimeView, key: string) => {
|
|
220
|
+
event: CalendarEvent;
|
|
221
|
+
time: string;
|
|
222
|
+
}[];
|
|
223
|
+
/** The quick create at a slot or gap, as in the month view. */
|
|
224
|
+
export declare const TimeQuickCreate: (props: {
|
|
225
|
+
view: TimeView;
|
|
226
|
+
}) => import("solid-js").JSX.Element;
|
|
227
|
+
/** All-day entries of a day as chips: bars with torn ends where they go on, and points due that day. */
|
|
228
|
+
export declare const AllDayChips: (props: {
|
|
229
|
+
view: TimeView;
|
|
230
|
+
dayKey: string;
|
|
231
|
+
spans: readonly DaySpan<CalendarEvent>[];
|
|
232
|
+
}) => import("solid-js").JSX.Element;
|
|
233
|
+
/** Hour labels and lines of a day's timeline with the night open, and the date at midnight. */
|
|
234
|
+
export declare const nightHours: (wake: number) => number[];
|
|
235
|
+
export declare const isNearNow: (view: TimeView, key: string, minute: number) => boolean;
|
|
236
|
+
/** Whether a marker sits right above a band's start, so its pill goes above the line. */
|
|
237
|
+
export declare const markerAbove: (model: DayModel<CalendarEvent>, minute: number) => boolean;
|
|
238
|
+
/** Whether a deadline pill sits near the middle of a gap, so the gap's label moves aside. */
|
|
239
|
+
export declare const gapAside: (model: DayModel<CalendarEvent>, gap: DayGap) => boolean;
|
|
240
|
+
/** A day's counts for its header: events and all-day entries, to-dos and deadlines. */
|
|
241
|
+
export declare const daySummary: (view: TimeView, key: string) => string;
|
|
242
|
+
/** What starts within the next hour today, such as "Planning in 12 min". */
|
|
243
|
+
export declare const soonNote: (view: TimeView, key: string) => string;
|
|
244
|
+
/** The busy minutes of a day's waking hours, merged, with the color of the first entry, for the thin load line. */
|
|
245
|
+
export declare const dayLoad: (view: TimeView, key: string) => {
|
|
246
|
+
start: number;
|
|
247
|
+
end: number;
|
|
248
|
+
color: string;
|
|
249
|
+
}[];
|
|
250
|
+
/** Day keys of the week that holds a day, from its first day. */
|
|
251
|
+
export declare const weekKeysOf: (view: TimeView, key: string) => string[];
|
|
252
|
+
export {};
|
|
@@ -14,6 +14,11 @@ declare const chartMessages: import("@k2b/stdlib").Catalog<{
|
|
|
14
14
|
chartPreviousData: string;
|
|
15
15
|
chartCopyData: string;
|
|
16
16
|
chartCopyFailed: string;
|
|
17
|
+
chartLegend: string;
|
|
18
|
+
chartRowsShown: ({ shown, total }: {
|
|
19
|
+
shown: string;
|
|
20
|
+
total: string;
|
|
21
|
+
}) => string;
|
|
17
22
|
interactiveLineChart: string;
|
|
18
23
|
interactiveChart: string;
|
|
19
24
|
chartFields: ({ key }: {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export type { CalendarAttendee, CalendarCustomView, CalendarDayBadge, CalendarEvent, CalendarEventColor, CalendarEventRenderContext, CalendarEventTimeChange, CalendarLabels, CalendarProps, CalendarQuickCreateControls, CalendarRecurrence, CalendarResource, CalendarSelectionControls, CalendarView, } from "./Calendar";
|
|
1
|
+
export type { CalendarAttendee, CalendarCommand, CalendarController, CalendarCustomView, CalendarDayBadge, CalendarEvent, CalendarEventColor, CalendarEventRenderContext, CalendarEventTimeChange, CalendarExternalDrag, CalendarLabels, CalendarProps, CalendarQuickCreateControls, CalendarRange, CalendarRecurrence, CalendarResource, CalendarSelectionControls, CalendarView, } from "./Calendar";
|
|
2
2
|
export { default as Calendar } from "./Calendar";
|
|
3
3
|
export type { ChartKind, ChartLabels, ChartProps, ChartRenderOptions } from "./Chart";
|
|
4
4
|
export { default as Chart } from "./Chart";
|
|
5
|
-
export type { ChartExplorerColumn, ChartExplorerProps } from "./ChartExplorer";
|
|
5
|
+
export type { ChartExplorerColumn, ChartExplorerProps, ChartLegendEntry } from "./ChartExplorer";
|
|
6
6
|
export { ChartExplorer } from "./ChartExplorer";
|
|
7
7
|
export type { ChartExplorerControlsProps } from "./ChartExplorerControls";
|
|
8
8
|
export { ChartExplorerControls } from "./ChartExplorerControls";
|
|
@@ -2,11 +2,14 @@ import { type LinkNavigateEvent, type NavigationScrollMode } from "@k2b/ssr/nav"
|
|
|
2
2
|
import { type JSX } from "solid-js";
|
|
3
3
|
import { type AppWorkspaceLayoutState } from "./app-workspace-state";
|
|
4
4
|
import type { ScrollAreaProps } from "./ScrollArea";
|
|
5
|
+
import { type AppWorkspaceSidebarSwitcherProps } from "./SidebarSwitcher";
|
|
5
6
|
export type AppWorkspaceProps = {
|
|
6
7
|
children: JSX.Element;
|
|
7
8
|
class?: string;
|
|
8
9
|
/** A host with its own phone chrome can use the full canvas below 48rem (768 px). */
|
|
9
10
|
mobileSurface?: "contained" | "flush";
|
|
11
|
+
/** Draws no frame: no border, corner radius, or shadow, for an overview that is the page itself. */
|
|
12
|
+
flat?: boolean;
|
|
10
13
|
resizable?: boolean;
|
|
11
14
|
/**
|
|
12
15
|
* Restores a persisted layout when the workspace mounts. Persistence itself
|
|
@@ -77,8 +80,14 @@ export type AppWorkspaceDetailProps = {
|
|
|
77
80
|
* overlaying it as a drawer.
|
|
78
81
|
*/
|
|
79
82
|
onClose?: () => void;
|
|
80
|
-
/**
|
|
81
|
-
|
|
83
|
+
/**
|
|
84
|
+
* Shows the previous (`-1`) or next (`1`) item; J and K call it while the
|
|
85
|
+
* panel is open. Return the Main element that now shows the selection,
|
|
86
|
+
* usually its link: Escape and F6 then go there, and the workspace reveals
|
|
87
|
+
* it beside the panel or above the phone sheet. Returning nothing keeps the
|
|
88
|
+
* previous item.
|
|
89
|
+
*/
|
|
90
|
+
onStep?: (direction: 1 | -1) => HTMLElement | null | undefined | void;
|
|
82
91
|
};
|
|
83
92
|
export type AppWorkspaceBottomDrawerHeight = "sm" | "md" | "lg";
|
|
84
93
|
export type AppWorkspaceBottomDrawerProps = {
|
|
@@ -176,7 +185,12 @@ export type AppWorkspaceSidebarItemProps = {
|
|
|
176
185
|
scroll?: NavigationScrollMode;
|
|
177
186
|
onNavigate?: (event: LinkNavigateEvent) => void | Promise<void>;
|
|
178
187
|
onClick?: (event: MouseEvent) => void;
|
|
179
|
-
|
|
188
|
+
/**
|
|
189
|
+
* Marks the current page (`aria-current="page"`). On a page deeper than the
|
|
190
|
+
* sidebar lists, pass `"ancestor"` for the item that contains it: it keeps
|
|
191
|
+
* the highlight, and the page keeps its back link.
|
|
192
|
+
*/
|
|
193
|
+
active?: boolean | "ancestor";
|
|
180
194
|
activeClass?: string;
|
|
181
195
|
disabled?: boolean;
|
|
182
196
|
icon?: string;
|
|
@@ -256,6 +270,15 @@ export type AppWorkspaceSidebarItemStatusProps = {
|
|
|
256
270
|
mention?: boolean;
|
|
257
271
|
/** Shows a muted bell. */
|
|
258
272
|
muted?: boolean;
|
|
273
|
+
/**
|
|
274
|
+
* Items that wait for the person, such as requests to approve, in the unread slot instead of `unread`. `label` is
|
|
275
|
+
* the phrase a screen reader hears, for example "3 waiting". `0` stays as a muted count, for a count that dropped
|
|
276
|
+
* to zero while the row is still shown; leave the prop out when nothing waits.
|
|
277
|
+
*/
|
|
278
|
+
waiting?: {
|
|
279
|
+
count: number;
|
|
280
|
+
label: string;
|
|
281
|
+
};
|
|
259
282
|
};
|
|
260
283
|
export type AppWorkspaceNavTreeProps = {
|
|
261
284
|
children: JSX.Element;
|
|
@@ -332,6 +355,7 @@ type AppWorkspaceComponent = ((props: AppWorkspaceProps) => JSX.Element) & {
|
|
|
332
355
|
SidebarDesktop: (props: {
|
|
333
356
|
children: JSX.Element;
|
|
334
357
|
}) => JSX.Element;
|
|
358
|
+
SidebarSwitcher: (props: AppWorkspaceSidebarSwitcherProps) => JSX.Element;
|
|
335
359
|
SidebarSection: (props: AppWorkspaceSidebarSectionProps) => JSX.Element;
|
|
336
360
|
SidebarBody: (props: AppWorkspaceSidebarBodyProps) => JSX.Element;
|
|
337
361
|
SidebarFooter: (props: AppWorkspaceSidebarContentProps) => JSX.Element;
|
|
@@ -55,7 +55,8 @@ export declare const usePageTrail: () => (() => PageTrailState | undefined);
|
|
|
55
55
|
export declare function PageTitle(props: PageTitleProps): JSX.Element;
|
|
56
56
|
/**
|
|
57
57
|
* Keeps server-rendered titles of the host's trail current: a workspace head
|
|
58
|
-
* that never hydrates, and an app's own header title from the
|
|
58
|
+
* that never hydrates, its heading, and an app's own header title from the
|
|
59
|
+
* host's trail.
|
|
59
60
|
* When the host publishes a new trail, for example after `setPageTrail()`,
|
|
60
61
|
* each such title is replaced in place by a live one with the same element,
|
|
61
62
|
* class, and subtitle, and a head learns whether it now has a page above it.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
2
|
+
/** One container a person can switch to, such as a notebook, a space, or a mailbox. */
|
|
3
|
+
export type AppWorkspaceSwitcherOption = {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
/** One secondary fact, such as a mailbox's address. */
|
|
7
|
+
description?: string;
|
|
8
|
+
/** Tabler icon class; without it the row takes the switcher's icon. */
|
|
9
|
+
icon?: string;
|
|
10
|
+
/** Tints the icon; without it the app accent does. */
|
|
11
|
+
color?: string;
|
|
12
|
+
href: string;
|
|
13
|
+
};
|
|
14
|
+
/** A row below the containers, such as "New notebook" or "All notebooks". */
|
|
15
|
+
export type AppWorkspaceSwitcherAction = {
|
|
16
|
+
id: string;
|
|
17
|
+
label: string;
|
|
18
|
+
icon: string;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
} & ({
|
|
21
|
+
href: string;
|
|
22
|
+
action?: never;
|
|
23
|
+
} | {
|
|
24
|
+
action: () => void;
|
|
25
|
+
href?: never;
|
|
26
|
+
});
|
|
27
|
+
export type AppWorkspaceSidebarSwitcherProps = {
|
|
28
|
+
/** The current container's ID among `options`. */
|
|
29
|
+
currentId: string;
|
|
30
|
+
/** The current container's name. */
|
|
31
|
+
label: string;
|
|
32
|
+
/** One secondary fact under the name, such as a mailbox's address. */
|
|
33
|
+
description?: string;
|
|
34
|
+
icon: string;
|
|
35
|
+
/** Tints the icon; without it the app accent does. */
|
|
36
|
+
color?: string;
|
|
37
|
+
/** Names the button's purpose and its panel, such as "Switch notebook". */
|
|
38
|
+
switchLabel: string;
|
|
39
|
+
/** Every container the person can switch to, the current one included; `undefined` until they are loaded. */
|
|
40
|
+
options?: readonly AppWorkspaceSwitcherOption[];
|
|
41
|
+
/** Shown in place of the options when loading them failed; the panel offers to try again through `onLoad`. */
|
|
42
|
+
error?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Asks for `options` while they are `undefined`: when a pointer or the focus first reaches the button, so the list
|
|
45
|
+
* is usually there when the panel opens, on every opening, and from the panel's retry. Ignore repeated calls while a
|
|
46
|
+
* request runs.
|
|
47
|
+
*/
|
|
48
|
+
onLoad?: () => void;
|
|
49
|
+
actions?: readonly AppWorkspaceSwitcherAction[];
|
|
50
|
+
/**
|
|
51
|
+
* A host menu around the switcher, such as the phone menu, finishes dismissing itself before a chosen container
|
|
52
|
+
* opens or an action runs; `false` cancels the choice. Navigation passes its own.
|
|
53
|
+
*/
|
|
54
|
+
beforeSelect?: () => boolean | void | Promise<boolean | void>;
|
|
55
|
+
/** Sizes the switcher in its place, such as `flex-1` beside a button in one row. */
|
|
56
|
+
class?: string;
|
|
57
|
+
};
|
|
58
|
+
/** From this many containers the panel scrolls, so it offers a search field. */
|
|
59
|
+
export declare const APP_WORKSPACE_SWITCHER_SEARCH_FROM = 8;
|
|
60
|
+
/**
|
|
61
|
+
* The current container at the top of a sidebar: its icon, name, and an optional fact, with a chevron that opens the
|
|
62
|
+
* other containers, a search field when there are many, and actions such as "New …" and "All …". The rows are links,
|
|
63
|
+
* so a container also opens in a new tab. In a collapsed rail it shows only the icon and opens beside the rail.
|
|
64
|
+
*/
|
|
65
|
+
export declare function AppWorkspaceSidebarSwitcher(props: AppWorkspaceSidebarSwitcherProps): JSX.Element;
|
|
@@ -11,6 +11,14 @@ export type AppWorkspaceControllerOptions = {
|
|
|
11
11
|
export declare const APP_WORKSPACE_SIDEBAR_HIDE_EVENT = "k2b-app-workspace-sidebar-hide";
|
|
12
12
|
/** Asks the owning `AppWorkspace.Detail` to close; its `onClose` decides. */
|
|
13
13
|
export declare const APP_WORKSPACE_DETAIL_CLOSE_EVENT = "k2b-app-workspace-detail-close";
|
|
14
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* Asks the owning Detail to step by `detail.direction` (`-1` or `1`). It writes
|
|
16
|
+
* the Main element showing the selection to `detail.item`, read synchronously
|
|
17
|
+
* by the controller after dispatch.
|
|
18
|
+
*/
|
|
15
19
|
export declare const APP_WORKSPACE_DETAIL_STEP_EVENT = "k2b-app-workspace-detail-step";
|
|
20
|
+
export type AppWorkspaceDetailStep = {
|
|
21
|
+
direction: 1 | -1;
|
|
22
|
+
item?: HTMLElement;
|
|
23
|
+
};
|
|
16
24
|
export declare const installAppWorkspaceController: (options?: AppWorkspaceControllerOptions) => (() => void);
|
|
@@ -40,5 +40,6 @@ export type { SettingsCollectionActionProps, SettingsCollectionItemActionsProps,
|
|
|
40
40
|
export { default as SettingsCollection } from "./SettingsCollection";
|
|
41
41
|
export type { SettingsModalFooterProps, SettingsModalGroupProps, SettingsModalProps, SettingsModalTabProps, SettingsModalTabTone, } from "./SettingsModal";
|
|
42
42
|
export { default as SettingsModal } from "./SettingsModal";
|
|
43
|
+
export { APP_WORKSPACE_SWITCHER_SEARCH_FROM, type AppWorkspaceSidebarSwitcherProps, type AppWorkspaceSwitcherAction, type AppWorkspaceSwitcherOption, } from "./SidebarSwitcher";
|
|
43
44
|
export type { TabBarItem, TabBarProps } from "./TabBar";
|
|
44
45
|
export { default as TabBar } from "./TabBar";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { LinkNavigateEvent, NavigationScrollMode } from "@k2b/ssr/nav";
|
|
2
2
|
import type { Accessor } from "solid-js";
|
|
3
3
|
import type { IntentTone } from "../semantics";
|
|
4
|
+
import type { AppWorkspaceSidebarSwitcherProps } from "./SidebarSwitcher";
|
|
4
5
|
/** A status icon at a row's end, such as "running". `label` names it for screen readers and as its tooltip. */
|
|
5
6
|
export type NavigationStatus = {
|
|
6
7
|
icon: string;
|
|
@@ -72,6 +73,8 @@ export type NavigationItem = NavigationEntry & ({
|
|
|
72
73
|
});
|
|
73
74
|
export type NavigationOptions = {
|
|
74
75
|
items: Accessor<readonly NavigationItem[]>;
|
|
76
|
+
/** The container the navigation works in, shown above the items with the same switcher as the sidebar's head. */
|
|
77
|
+
switcher?: Accessor<AppWorkspaceSidebarSwitcherProps>;
|
|
75
78
|
onAction?: (action: string) => void | Promise<void>;
|
|
76
79
|
onNavigate?: (event: LinkNavigateEvent) => void | Promise<void>;
|
|
77
80
|
/** Receives disclosure toggles of items that carry `expanded`; the owner decides the next state. */
|
|
@@ -81,6 +84,7 @@ export declare function findNavigationItem(items: readonly NavigationItem[], id:
|
|
|
81
84
|
/** One live source for renderers; no router, registry, fetching or persisted state. */
|
|
82
85
|
export declare function createNavigation(options: NavigationOptions): {
|
|
83
86
|
items: Accessor<readonly NavigationItem[]>;
|
|
87
|
+
switcher: Accessor<AppWorkspaceSidebarSwitcherProps> | undefined;
|
|
84
88
|
onNavigate: ((event: LinkNavigateEvent) => void | Promise<void>) | undefined;
|
|
85
89
|
onExpandedChange: ((id: string, expanded: boolean) => void) | undefined;
|
|
86
90
|
activate(id: string): Promise<void>;
|
|
@@ -17,6 +17,11 @@ export type StatCellProps = {
|
|
|
17
17
|
title?: string;
|
|
18
18
|
trend?: readonly number[];
|
|
19
19
|
size?: StatGridSize;
|
|
20
|
+
/**
|
|
21
|
+
* Wraps the label, value and support line instead of truncating them. Use it for a cell whose height nothing
|
|
22
|
+
* reserves, such as one figure on its own; cells compared in a row keep one line each.
|
|
23
|
+
*/
|
|
24
|
+
wrap?: boolean;
|
|
20
25
|
};
|
|
21
26
|
export declare function StatCell(props: StatCellProps): JSX.Element;
|
|
22
27
|
export default StatCell;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@k2b/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.0",
|
|
4
4
|
"description": "Production-ready components for SolidJS applications.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@fontsource/ibm-plex-mono": "5.3.0",
|
|
47
47
|
"@fontsource/ibm-plex-sans": "5.3.0",
|
|
48
|
-
"@k2b/stdlib": "0.
|
|
48
|
+
"@k2b/stdlib": "0.29.0",
|
|
49
49
|
"@tabler/icons-webfont": "3.48.0",
|
|
50
50
|
"marked": "18.0.14",
|
|
51
51
|
"qr-scanner": "1.4.2"
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@babel/core": "8.0.6",
|
|
59
59
|
"@babel/preset-typescript": "8.0.1",
|
|
60
|
-
"@k2b/ssr": "0.15.
|
|
60
|
+
"@k2b/ssr": "0.15.1",
|
|
61
61
|
"@types/babel__core": "7.20.5",
|
|
62
62
|
"@types/bun": "1.4.2",
|
|
63
63
|
"axe-core": "4.11.0",
|