@k2b/ui 0.23.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 +84 -64
- package/dist/browser/content/Calendar.js.map +1 -1
- package/dist/browser/content/CalendarDayView.js +1 -1
- package/dist/browser/content/CalendarDayView.js.map +1 -1
- package/dist/browser/content/CalendarWeekView.js +28 -6
- package/dist/browser/content/CalendarWeekView.js.map +1 -1
- package/dist/browser/content/DataTable.js +45 -35
- package/dist/browser/content/DataTable.js.map +1 -1
- package/dist/browser/content/calendar-day-scroll.js +17 -4
- package/dist/browser/content/calendar-day-scroll.js.map +1 -1
- package/dist/browser/content/calendar-time-view.js +9 -4
- package/dist/browser/content/calendar-time-view.js.map +1 -1
- package/dist/browser/layout/AppWorkspace.js +2 -0
- 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 +14 -0
- 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 +12 -2
- 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/ssr/content/Calendar.js +36 -13
- package/dist/ssr/content/Calendar.js.map +1 -1
- package/dist/ssr/content/CalendarDayView.js +1 -1
- package/dist/ssr/content/CalendarDayView.js.map +1 -1
- package/dist/ssr/content/CalendarWeekView.js +27 -6
- package/dist/ssr/content/CalendarWeekView.js.map +1 -1
- package/dist/ssr/content/DataTable.js +21 -17
- package/dist/ssr/content/DataTable.js.map +1 -1
- package/dist/ssr/content/calendar-day-scroll.js +17 -4
- package/dist/ssr/content/calendar-day-scroll.js.map +1 -1
- package/dist/ssr/content/calendar-time-view.js +8 -3
- package/dist/ssr/content/calendar-time-view.js.map +1 -1
- package/dist/ssr/layout/AppWorkspace.js +2 -0
- 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 +14 -0
- 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 +12 -2
- 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/styles.css +1 -1
- package/dist/types/content/Calendar.d.ts +4 -1
- package/dist/types/content/CalendarWeekView.d.ts +1 -1
- package/dist/types/content/DataTable.d.ts +9 -0
- package/dist/types/content/calendar-day-scroll.d.ts +9 -4
- package/dist/types/layout/AppWorkspace.d.ts +2 -0
- package/dist/types/layout/SidebarSwitcher.d.ts +65 -0
- package/dist/types/layout/index.d.ts +1 -0
- package/dist/types/layout/navigation-model.d.ts +4 -0
- package/package.json +3 -3
|
@@ -240,7 +240,10 @@ export type CalendarSelectionControls = {
|
|
|
240
240
|
export type CalendarQuickCreateControls = {
|
|
241
241
|
/** What the person asked to create through `quickCreate`; absent after a click, a drag, or the keyboard. */
|
|
242
242
|
create?: string;
|
|
243
|
-
/**
|
|
243
|
+
/**
|
|
244
|
+
* Closes the quick create, returns the focus to the selected day only while the focus is still in the quick create, and
|
|
245
|
+
* leaves a newer selection in place; once another quick create replaced it, nothing.
|
|
246
|
+
*/
|
|
244
247
|
close: () => void;
|
|
245
248
|
};
|
|
246
249
|
export type CalendarEventTimeChange = {
|
|
@@ -2,6 +2,6 @@ import { type TimeViewProps } from "./calendar-time-view";
|
|
|
2
2
|
/**
|
|
3
3
|
* The week view with `dayHours`: the loaded days side by side in one strip, seven on a wide screen and three on a
|
|
4
4
|
* phone. A trackpad, Shift with the wheel, or a finger scroll it sideways day by day; each gesture keeps the axis it
|
|
5
|
-
* started on, and the strip settles on a day
|
|
5
|
+
* started on, and the strip settles on a day edge. The arrows move by whole weeks.
|
|
6
6
|
*/
|
|
7
7
|
export declare const CalendarWeekView: (props: TimeViewProps) => import("solid-js").JSX.Element;
|
|
@@ -14,6 +14,15 @@ export type DataTableColumn<T> = {
|
|
|
14
14
|
cellClass?: string;
|
|
15
15
|
/** Defaults to right for numeric values and left for everything else. */
|
|
16
16
|
align?: "left" | "center" | "right";
|
|
17
|
+
/**
|
|
18
|
+
* Keeps each value on one line, so the column is at least as wide as its
|
|
19
|
+
* longest value. For dates, times, numbers, amounts, and short codes.
|
|
20
|
+
* Defaults to true when the column's first value is a number or date. The
|
|
21
|
+
* default cell wrapper already keeps every value on one line; this option
|
|
22
|
+
* decides wrapping for content under a custom `cellContentClass`, and a
|
|
23
|
+
* `white-space` that class sets itself wins.
|
|
24
|
+
*/
|
|
25
|
+
nowrap?: boolean;
|
|
17
26
|
/**
|
|
18
27
|
* Marks the column sortable. Pass a string when the server's sort key
|
|
19
28
|
* differs from the column id — they often do, because one column can show a
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* The day view runs down through the days and stops gently at each day start: within `STOP_ZONE` pixels of one the
|
|
5
5
|
* wheel slows down, and a scroll that rests close to one glides onto it. The week view scrolls sideways through the
|
|
6
|
-
* days; a wheel or trackpad gesture keeps the axis it started on, and a scroll
|
|
7
|
-
* the
|
|
6
|
+
* days; a wheel or trackpad gesture keeps the axis it started on, and a resting scroll glides to the nearest day start
|
|
7
|
+
* or, with end space, day end at the edge of the visible room. A scroll no gesture made, such as a reveal, glides on in
|
|
8
|
+
* its own direction, so what it brought into view stays there.
|
|
8
9
|
*/
|
|
9
10
|
/** Pixels before and after a day start in which the wheel slows down. */
|
|
10
11
|
export declare const STOP_ZONE = 72;
|
|
@@ -38,5 +39,9 @@ export type WheelAxis = "x" | "y";
|
|
|
38
39
|
export declare const wheelAxis: (deltaX: number, deltaY: number, shiftKey: boolean) => WheelAxis;
|
|
39
40
|
/** The sideways part of a wheel event on an axis, Shift turning the vertical delta into a sideways one. */
|
|
40
41
|
export declare const wheelDelta: (axis: WheelAxis, deltaX: number, deltaY: number, shiftKey: boolean) => number;
|
|
41
|
-
/**
|
|
42
|
-
|
|
42
|
+
/**
|
|
43
|
+
* The day start nearest to `position` in a strip of equal columns, or with `room` the nearer day edge at either end of
|
|
44
|
+
* the visible room; ties keep the start. A `heading` of 1 or -1 only looks ahead or back, for a scroll that brought
|
|
45
|
+
* something into view and must not slide back over it.
|
|
46
|
+
*/
|
|
47
|
+
export declare const snapToColumn: (position: number, width: number, room?: number, heading?: number) => number;
|
|
@@ -2,6 +2,7 @@ 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;
|
|
@@ -354,6 +355,7 @@ type AppWorkspaceComponent = ((props: AppWorkspaceProps) => JSX.Element) & {
|
|
|
354
355
|
SidebarDesktop: (props: {
|
|
355
356
|
children: JSX.Element;
|
|
356
357
|
}) => JSX.Element;
|
|
358
|
+
SidebarSwitcher: (props: AppWorkspaceSidebarSwitcherProps) => JSX.Element;
|
|
357
359
|
SidebarSection: (props: AppWorkspaceSidebarSectionProps) => JSX.Element;
|
|
358
360
|
SidebarBody: (props: AppWorkspaceSidebarBodyProps) => JSX.Element;
|
|
359
361
|
SidebarFooter: (props: AppWorkspaceSidebarContentProps) => JSX.Element;
|
|
@@ -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;
|
|
@@ -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>;
|
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",
|