@k2b/ui 0.64.0 → 0.66.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/README.md +47 -0
- package/dist/base.css +3 -6
- package/dist/browser/actions/ContextMenu.js +1 -3
- package/dist/browser/actions/ContextMenu.js.map +1 -1
- package/dist/browser/actions/Dropdown.js +15 -69
- package/dist/browser/actions/Dropdown.js.map +1 -1
- package/dist/browser/actions/SortableList.js +1 -1
- package/dist/browser/actions/SortableList.js.map +1 -1
- package/dist/browser/actions/ViewTabs.js +5 -9
- package/dist/browser/actions/ViewTabs.js.map +1 -1
- package/dist/browser/actions/drag-and-drop.js +1 -1
- package/dist/browser/actions/drag-and-drop.js.map +1 -1
- package/dist/browser/actions/index.js.map +1 -1
- package/dist/browser/actions/menu-sheet.js +18 -80
- package/dist/browser/actions/menu-sheet.js.map +1 -1
- package/dist/browser/content/DataTable.js +197 -285
- package/dist/browser/content/DataTable.js.map +1 -1
- package/dist/browser/content/MessageRow.js +139 -115
- package/dist/browser/content/MessageRow.js.map +1 -1
- package/dist/browser/content/ProgressPath.js +25 -30
- package/dist/browser/content/ProgressPath.js.map +1 -1
- package/dist/browser/content/index.js +0 -2
- package/dist/browser/content/index.js.map +1 -1
- package/dist/browser/feedback/dialog-core.js +0 -11
- package/dist/browser/feedback/dialog-core.js.map +1 -1
- package/dist/browser/internal/field.js +2 -2
- package/dist/browser/internal/field.js.map +1 -1
- package/dist/browser/intl/messages.js +1 -1
- package/dist/browser/intl/messages.js.map +1 -1
- package/dist/browser/layout/AppWorkspace.js +8 -16
- package/dist/browser/layout/AppWorkspace.js.map +1 -1
- package/dist/browser/layout/Breadcrumbs.js +42 -188
- package/dist/browser/layout/Breadcrumbs.js.map +1 -1
- package/dist/browser/layout/DetailPanel.js +205 -209
- package/dist/browser/layout/DetailPanel.js.map +1 -1
- package/dist/browser/layout/PanelDialog.js +88 -176
- package/dist/browser/layout/PanelDialog.js.map +1 -1
- package/dist/browser/layout/app-workspace-controller.js +5 -12
- package/dist/browser/layout/app-workspace-controller.js.map +1 -1
- package/dist/browser/layout/app-workspace-state.js +2 -2
- package/dist/browser/layout/app-workspace-state.js.map +1 -1
- package/dist/browser/layout/index.js +0 -2
- package/dist/browser/layout/index.js.map +1 -1
- package/dist/browser/layout/workspace-messages.js +2 -12
- package/dist/browser/layout/workspace-messages.js.map +1 -1
- package/dist/browser/surfaces/NoticeCard.js +57 -69
- package/dist/browser/surfaces/NoticeCard.js.map +1 -1
- package/dist/browser/surfaces/Placeholder.js +5 -17
- package/dist/browser/surfaces/Placeholder.js.map +1 -1
- package/dist/browser/surfaces/Section.js +7 -22
- package/dist/browser/surfaces/Section.js.map +1 -1
- package/dist/browser/surfaces/StatusBadge.js +1 -5
- package/dist/browser/surfaces/StatusBadge.js.map +1 -1
- package/dist/browser/surfaces/index.js +0 -4
- package/dist/browser/surfaces/index.js.map +1 -1
- package/dist/browser/v2/button.js +180 -0
- package/dist/browser/v2/button.js.map +1 -0
- package/dist/browser/v2/components.js +763 -0
- package/dist/browser/v2/components.js.map +1 -0
- package/dist/browser/v2/content.js +1107 -0
- package/dist/browser/v2/content.js.map +1 -0
- package/dist/browser/v2/controls.js +568 -0
- package/dist/browser/v2/controls.js.map +1 -0
- package/dist/browser/v2/describe.js +397 -0
- package/dist/browser/v2/describe.js.map +1 -0
- package/dist/browser/v2/index.js +25 -0
- package/dist/browser/v2/index.js.map +1 -0
- package/dist/browser/v2/layout.js +578 -0
- package/dist/browser/v2/layout.js.map +1 -0
- package/dist/browser/v2/link.js +9 -0
- package/dist/browser/v2/link.js.map +1 -0
- package/dist/browser/v2/marks.js +211 -0
- package/dist/browser/v2/marks.js.map +1 -0
- package/dist/browser/v2/states.js +180 -0
- package/dist/browser/v2/states.js.map +1 -0
- package/dist/browser/v2/structure.js +328 -0
- package/dist/browser/v2/structure.js.map +1 -0
- package/dist/browser/v2/testing/index.js +23 -0
- package/dist/browser/v2/testing/index.js.map +1 -0
- package/dist/browser/v2/testing/measure-v2-layout.js +762 -0
- package/dist/browser/v2/testing/measure-v2-layout.js.map +1 -0
- package/dist/browser/v2/testing/settled.js +52 -0
- package/dist/browser/v2/testing/settled.js.map +1 -0
- package/dist/browser/v2/tokens.js +83 -0
- package/dist/browser/v2/tokens.js.map +1 -0
- package/dist/browser/v2/types.js +24 -0
- package/dist/browser/v2/types.js.map +1 -0
- package/dist/ssr/actions/ContextMenu.js +1 -3
- package/dist/ssr/actions/ContextMenu.js.map +1 -1
- package/dist/ssr/actions/Dropdown.js +15 -69
- package/dist/ssr/actions/Dropdown.js.map +1 -1
- package/dist/ssr/actions/SortableList.js +1 -1
- package/dist/ssr/actions/SortableList.js.map +1 -1
- package/dist/ssr/actions/ViewTabs.js +5 -9
- package/dist/ssr/actions/ViewTabs.js.map +1 -1
- package/dist/ssr/actions/drag-and-drop.js +1 -1
- package/dist/ssr/actions/drag-and-drop.js.map +1 -1
- package/dist/ssr/actions/index.js.map +1 -1
- package/dist/ssr/actions/menu-sheet.js +10 -62
- package/dist/ssr/actions/menu-sheet.js.map +1 -1
- package/dist/ssr/content/DataTable.js +54 -64
- package/dist/ssr/content/DataTable.js.map +1 -1
- package/dist/ssr/content/MessageRow.js +30 -10
- package/dist/ssr/content/MessageRow.js.map +1 -1
- package/dist/ssr/content/ProgressPath.js +8 -14
- package/dist/ssr/content/ProgressPath.js.map +1 -1
- package/dist/ssr/content/index.js +0 -2
- package/dist/ssr/content/index.js.map +1 -1
- package/dist/ssr/feedback/dialog-core.js +0 -11
- package/dist/ssr/feedback/dialog-core.js.map +1 -1
- package/dist/ssr/internal/field.js +2 -2
- package/dist/ssr/internal/field.js.map +1 -1
- package/dist/ssr/intl/messages.js +1 -1
- package/dist/ssr/intl/messages.js.map +1 -1
- package/dist/ssr/layout/AppWorkspace.js +8 -16
- package/dist/ssr/layout/AppWorkspace.js.map +1 -1
- package/dist/ssr/layout/Breadcrumbs.js +26 -140
- package/dist/ssr/layout/Breadcrumbs.js.map +1 -1
- package/dist/ssr/layout/DetailPanel.js +68 -70
- package/dist/ssr/layout/DetailPanel.js.map +1 -1
- package/dist/ssr/layout/PanelDialog.js +8 -82
- package/dist/ssr/layout/PanelDialog.js.map +1 -1
- package/dist/ssr/layout/app-workspace-controller.js +5 -12
- package/dist/ssr/layout/app-workspace-controller.js.map +1 -1
- package/dist/ssr/layout/app-workspace-state.js +2 -2
- package/dist/ssr/layout/app-workspace-state.js.map +1 -1
- package/dist/ssr/layout/index.js +0 -2
- package/dist/ssr/layout/index.js.map +1 -1
- package/dist/ssr/layout/workspace-messages.js +2 -12
- package/dist/ssr/layout/workspace-messages.js.map +1 -1
- package/dist/ssr/surfaces/NoticeCard.js +5 -7
- package/dist/ssr/surfaces/NoticeCard.js.map +1 -1
- package/dist/ssr/surfaces/Placeholder.js +4 -15
- package/dist/ssr/surfaces/Placeholder.js.map +1 -1
- package/dist/ssr/surfaces/Section.js +4 -7
- package/dist/ssr/surfaces/Section.js.map +1 -1
- package/dist/ssr/surfaces/StatusBadge.js +1 -5
- package/dist/ssr/surfaces/StatusBadge.js.map +1 -1
- package/dist/ssr/surfaces/index.js +0 -4
- package/dist/ssr/surfaces/index.js.map +1 -1
- package/dist/ssr/v2/button.js +177 -0
- package/dist/ssr/v2/button.js.map +1 -0
- package/dist/ssr/v2/components.js +518 -0
- package/dist/ssr/v2/components.js.map +1 -0
- package/dist/ssr/v2/content.js +727 -0
- package/dist/ssr/v2/content.js.map +1 -0
- package/dist/ssr/v2/controls.js +268 -0
- package/dist/ssr/v2/controls.js.map +1 -0
- package/dist/ssr/v2/describe.js +397 -0
- package/dist/ssr/v2/describe.js.map +1 -0
- package/dist/ssr/v2/index.js +25 -0
- package/dist/ssr/v2/index.js.map +1 -0
- package/dist/ssr/v2/layout.js +377 -0
- package/dist/ssr/v2/layout.js.map +1 -0
- package/dist/ssr/v2/link.js +9 -0
- package/dist/ssr/v2/link.js.map +1 -0
- package/dist/ssr/v2/marks.js +126 -0
- package/dist/ssr/v2/marks.js.map +1 -0
- package/dist/ssr/v2/states.js +128 -0
- package/dist/ssr/v2/states.js.map +1 -0
- package/dist/ssr/v2/structure.js +229 -0
- package/dist/ssr/v2/structure.js.map +1 -0
- package/dist/ssr/v2/testing/index.js +23 -0
- package/dist/ssr/v2/testing/index.js.map +1 -0
- package/dist/ssr/v2/testing/measure-v2-layout.js +762 -0
- package/dist/ssr/v2/testing/measure-v2-layout.js.map +1 -0
- package/dist/ssr/v2/testing/settled.js +52 -0
- package/dist/ssr/v2/testing/settled.js.map +1 -0
- package/dist/ssr/v2/tokens.js +83 -0
- package/dist/ssr/v2/tokens.js.map +1 -0
- package/dist/ssr/v2/types.js +24 -0
- package/dist/ssr/v2/types.js.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/types/actions/Dropdown.d.ts +1 -35
- package/dist/types/actions/ViewTabs.d.ts +2 -3
- package/dist/types/actions/index.d.ts +1 -1
- package/dist/types/actions/menu-sheet.d.ts +1 -3
- package/dist/types/content/DataTable.d.ts +0 -19
- package/dist/types/content/MessageRow.d.ts +11 -0
- package/dist/types/content/ProgressPath.d.ts +6 -12
- package/dist/types/content/index.d.ts +0 -2
- package/dist/types/feedback/dialog-core.d.ts +0 -5
- package/dist/types/layout/AppWorkspace.d.ts +2 -10
- package/dist/types/layout/Breadcrumbs.d.ts +5 -10
- package/dist/types/layout/PanelDialog.d.ts +0 -19
- package/dist/types/layout/app-workspace-state.d.ts +2 -2
- package/dist/types/layout/index.d.ts +1 -5
- package/dist/types/layout/workspace-messages.d.ts +0 -5
- package/dist/types/surfaces/NoticeCard.d.ts +4 -6
- package/dist/types/surfaces/Placeholder.d.ts +0 -7
- package/dist/types/surfaces/Section.d.ts +2 -8
- package/dist/types/surfaces/StatusBadge.d.ts +1 -2
- package/dist/types/surfaces/index.d.ts +1 -9
- package/dist/types/v2/button.d.ts +54 -0
- package/dist/types/v2/components.d.ts +173 -0
- package/dist/types/v2/content.d.ts +233 -0
- package/dist/types/v2/controls.d.ts +118 -0
- package/dist/types/v2/describe.d.ts +18 -0
- package/dist/types/v2/index.d.ts +22 -0
- package/dist/types/v2/layout.d.ts +124 -0
- package/dist/types/v2/link.d.ts +7 -0
- package/dist/types/v2/marks.d.ts +90 -0
- package/dist/types/v2/states.d.ts +45 -0
- package/dist/types/v2/structure.d.ts +47 -0
- package/dist/types/v2/testing/index.d.ts +16 -0
- package/dist/types/v2/testing/measure-v2-layout.d.ts +99 -0
- package/dist/types/v2/testing/settled.d.ts +13 -0
- package/dist/types/v2/tokens.d.ts +77 -0
- package/dist/types/v2/types.d.ts +44 -0
- package/dist/v2.css +3072 -0
- package/package.json +24 -10
- package/skills/k2b-ui/SKILL.md +201 -0
- package/skills/k2b-ui/images/form-1440.png +0 -0
- package/skills/k2b-ui/images/form-390.png +0 -0
- package/skills/k2b-ui/images/list-detail-1440.png +0 -0
- package/skills/k2b-ui/images/list-detail-390.png +0 -0
- package/skills/k2b-ui/images/mail-1440.png +0 -0
- package/skills/k2b-ui/images/mail-390.png +0 -0
- package/skills/k2b-ui/images/record-1440.png +0 -0
- package/skills/k2b-ui/images/record-390.png +0 -0
- package/skills/k2b-ui/images/record-groups-1440.png +0 -0
- package/skills/k2b-ui/images/record-groups-390.png +0 -0
- package/skills/k2b-ui/images/table-1440.png +0 -0
- package/skills/k2b-ui/images/table-390.png +0 -0
- package/skills/k2b-ui/recipes/form.tsx +54 -0
- package/skills/k2b-ui/recipes/list-detail.tsx +105 -0
- package/skills/k2b-ui/recipes/mail.tsx +193 -0
- package/skills/k2b-ui/recipes/record-groups.tsx +115 -0
- package/skills/k2b-ui/recipes/record.tsx +163 -0
- package/skills/k2b-ui/recipes/table.tsx +68 -0
- package/skills/k2b-ui/references/mistakes.md +162 -0
- package/skills/k2b-ui/references/primitives.md +310 -0
- package/skills/k2b-ui/references/recipes.md +101 -0
- package/skills/k2b-ui/references/seeing.md +94 -0
- package/dist/browser/actions/menu-sheet-messages.js +0 -26
- package/dist/browser/actions/menu-sheet-messages.js.map +0 -1
- package/dist/browser/actions/menu-submenu-panel.js +0 -392
- package/dist/browser/actions/menu-submenu-panel.js.map +0 -1
- package/dist/browser/content/FileName.js +0 -68
- package/dist/browser/content/FileName.js.map +0 -1
- package/dist/browser/content/TaskRow.js +0 -129
- package/dist/browser/content/TaskRow.js.map +0 -1
- package/dist/browser/content/progress-path-messages.js +0 -22
- package/dist/browser/content/progress-path-messages.js.map +0 -1
- package/dist/browser/feedback/dialog-foot.js +0 -45
- package/dist/browser/feedback/dialog-foot.js.map +0 -1
- package/dist/browser/internal/renders-something.js +0 -3
- package/dist/browser/internal/renders-something.js.map +0 -1
- package/dist/browser/layout/FloatingPill.js +0 -33
- package/dist/browser/layout/FloatingPill.js.map +0 -1
- package/dist/browser/layout/StatusRow.js +0 -174
- package/dist/browser/layout/StatusRow.js.map +0 -1
- package/dist/browser/layout/panel-dialog-error.js +0 -44
- package/dist/browser/layout/panel-dialog-error.js.map +0 -1
- package/dist/browser/layout/panel-sheet-handle.js +0 -86
- package/dist/browser/layout/panel-sheet-handle.js.map +0 -1
- package/dist/browser/layout-check.js +0 -232
- package/dist/browser/layout-check.js.map +0 -1
- package/dist/browser/surfaces/Area.js +0 -205
- package/dist/browser/surfaces/Area.js.map +0 -1
- package/dist/browser/surfaces/FactGroup.js +0 -148
- package/dist/browser/surfaces/FactGroup.js.map +0 -1
- package/dist/browser/surfaces/FieldGrid.js +0 -34
- package/dist/browser/surfaces/FieldGrid.js.map +0 -1
- package/dist/browser/surfaces/RowGroup.js +0 -82
- package/dist/browser/surfaces/RowGroup.js.map +0 -1
- package/dist/browser/surfaces/flat-block-messages.js +0 -37
- package/dist/browser/surfaces/flat-block-messages.js.map +0 -1
- package/dist/ssr/actions/menu-sheet-messages.js +0 -26
- package/dist/ssr/actions/menu-sheet-messages.js.map +0 -1
- package/dist/ssr/actions/menu-submenu-panel.js +0 -295
- package/dist/ssr/actions/menu-submenu-panel.js.map +0 -1
- package/dist/ssr/content/FileName.js +0 -46
- package/dist/ssr/content/FileName.js.map +0 -1
- package/dist/ssr/content/TaskRow.js +0 -95
- package/dist/ssr/content/TaskRow.js.map +0 -1
- package/dist/ssr/content/progress-path-messages.js +0 -22
- package/dist/ssr/content/progress-path-messages.js.map +0 -1
- package/dist/ssr/feedback/dialog-foot.js +0 -45
- package/dist/ssr/feedback/dialog-foot.js.map +0 -1
- package/dist/ssr/internal/renders-something.js +0 -3
- package/dist/ssr/internal/renders-something.js.map +0 -1
- package/dist/ssr/layout/FloatingPill.js +0 -16
- package/dist/ssr/layout/FloatingPill.js.map +0 -1
- package/dist/ssr/layout/StatusRow.js +0 -93
- package/dist/ssr/layout/StatusRow.js.map +0 -1
- package/dist/ssr/layout/panel-dialog-error.js +0 -28
- package/dist/ssr/layout/panel-dialog-error.js.map +0 -1
- package/dist/ssr/layout/panel-sheet-handle.js +0 -66
- package/dist/ssr/layout/panel-sheet-handle.js.map +0 -1
- package/dist/ssr/layout-check.js +0 -232
- package/dist/ssr/layout-check.js.map +0 -1
- package/dist/ssr/surfaces/Area.js +0 -147
- package/dist/ssr/surfaces/Area.js.map +0 -1
- package/dist/ssr/surfaces/FactGroup.js +0 -106
- package/dist/ssr/surfaces/FactGroup.js.map +0 -1
- package/dist/ssr/surfaces/FieldGrid.js +0 -22
- package/dist/ssr/surfaces/FieldGrid.js.map +0 -1
- package/dist/ssr/surfaces/RowGroup.js +0 -60
- package/dist/ssr/surfaces/RowGroup.js.map +0 -1
- package/dist/ssr/surfaces/flat-block-messages.js +0 -37
- package/dist/ssr/surfaces/flat-block-messages.js.map +0 -1
- package/dist/types/actions/menu-sheet-messages.d.ts +0 -11
- package/dist/types/actions/menu-submenu-panel.d.ts +0 -27
- package/dist/types/content/FileName.d.ts +0 -23
- package/dist/types/content/TaskRow.d.ts +0 -33
- package/dist/types/content/progress-path-messages.d.ts +0 -8
- package/dist/types/feedback/dialog-foot.d.ts +0 -9
- package/dist/types/internal/renders-something.d.ts +0 -2
- package/dist/types/layout/FloatingPill.d.ts +0 -20
- package/dist/types/layout/StatusRow.d.ts +0 -54
- package/dist/types/layout/panel-dialog-error.d.ts +0 -9
- package/dist/types/layout/panel-sheet-handle.d.ts +0 -8
- package/dist/types/layout-check.d.ts +0 -52
- package/dist/types/surfaces/Area.d.ts +0 -38
- package/dist/types/surfaces/FactGroup.d.ts +0 -33
- package/dist/types/surfaces/FieldGrid.d.ts +0 -14
- package/dist/types/surfaces/RowGroup.d.ts +0 -20
- package/dist/types/surfaces/flat-block-messages.d.ts +0 -16
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
2
|
+
import type { Action, Width } from "./types";
|
|
3
|
+
export type WorkspaceProps = {
|
|
4
|
+
/** The sidebar column, such as `Nav`. */
|
|
5
|
+
sidebar?: JSX.Element;
|
|
6
|
+
/** The sidebar's minimum and default width; 200 and 248 px when not set. */
|
|
7
|
+
sidebarWidth?: Width;
|
|
8
|
+
/** The name of the sidebar's grip, such as "Width of the sidebar". */
|
|
9
|
+
sidebarLabel?: string;
|
|
10
|
+
/** The head across the main column: a `Bar` (56 px here) with tabs or a path and the actions. */
|
|
11
|
+
head?: JSX.Element;
|
|
12
|
+
/** The main action; on the phone it floats at the bottom right. */
|
|
13
|
+
primary?: Action;
|
|
14
|
+
/** A `Pane` or `Pane.Split`. */
|
|
15
|
+
children: JSX.Element;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* The working surface of an app: a sidebar, a head and the columns below it, with one hairline between columns and
|
|
19
|
+
* a grip on every line that moves. On the phone the sidebar leaves and columns become pages.
|
|
20
|
+
*/
|
|
21
|
+
export declare const Workspace: (props: WorkspaceProps) => JSX.Element;
|
|
22
|
+
export type PaneProps = {
|
|
23
|
+
/** The head of this column: a `Bar` (56 px; 52 px for a reader beside a list) or `Tabs`. */
|
|
24
|
+
head?: JSX.Element;
|
|
25
|
+
/** The status row of this column (52 px), such as `StatusRow`. */
|
|
26
|
+
status?: JSX.Element;
|
|
27
|
+
/** A column that can be dragged wider: its minimum and default width. Only inside `Pane.Split`. */
|
|
28
|
+
width?: Width;
|
|
29
|
+
/** The name of the column and of its grip, such as "List". */
|
|
30
|
+
label?: string;
|
|
31
|
+
/**
|
|
32
|
+
* The detail of a list (a reader): beside the list on a wide screen. On the phone, while it is there (something is
|
|
33
|
+
* open), it is the page and the list gives way; render it only while something is open. What is open belongs in
|
|
34
|
+
* the address, so reload, back and forward show the same. A detail that closes in place hands the focus back to
|
|
35
|
+
* what opened it, such as the row.
|
|
36
|
+
*/
|
|
37
|
+
detail?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* The way back to the list on the phone, where the detail is a page of its own, such as "Posteingang". Give it an
|
|
40
|
+
* `href`: the address of the list without the open entry. While it is there, the head of the workspace gives way on
|
|
41
|
+
* the phone, so the way back is the one bar above the detail; it is the part `Back`, which a shell may show in its
|
|
42
|
+
* own bar instead.
|
|
43
|
+
*/
|
|
44
|
+
back?: Action;
|
|
45
|
+
/** The side column of a record (the info column): quieter sections. */
|
|
46
|
+
side?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* A name under which the page keeps this column's scroll position, such as "mail-list": back and forward bring
|
|
49
|
+
* the list back where it was (the page restores every `data-scroll-preserve` region, as v1's `ScrollArea` does).
|
|
50
|
+
*/
|
|
51
|
+
scrollKey?: string;
|
|
52
|
+
/** Bands, rows, sections; the pane pads nothing. */
|
|
53
|
+
children?: JSX.Element;
|
|
54
|
+
};
|
|
55
|
+
export declare function Pane(props: PaneProps): JSX.Element;
|
|
56
|
+
export declare namespace Pane {
|
|
57
|
+
var Split: (props: {
|
|
58
|
+
children: JSX.Element;
|
|
59
|
+
}) => JSX.Element;
|
|
60
|
+
}
|
|
61
|
+
export type BarProps = {
|
|
62
|
+
/** The start place: a title, a path, tabs, an inline line. */
|
|
63
|
+
start?: JSX.Element;
|
|
64
|
+
/** The end place: buttons, a search, a person. */
|
|
65
|
+
end?: JSX.Element;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* A bar of fixed height with a line below. Its height comes from its place: 56 as the head of a workspace or pane,
|
|
69
|
+
* 52 as a status row, 40 on its own. Controls in it take the height that leaves equal air above and below. The
|
|
70
|
+
* stylesheet reads the place from the slot the bar stands in, so a bar built ahead and passed on behaves the same.
|
|
71
|
+
* In a column narrower than 480 px, a bar in the flow whose start is an `Inline` wraps instead of cutting: its things
|
|
72
|
+
* and its end flow as one line, one line stays 40, and only a second line makes the bar higher.
|
|
73
|
+
*/
|
|
74
|
+
export declare const Bar: (props: BarProps) => JSX.Element;
|
|
75
|
+
export type BandProps = {
|
|
76
|
+
/** A tone only by meaning: a note, AI, "yours", wrong, waiting. */
|
|
77
|
+
tone?: "note" | "ai" | "yours" | "bad" | "warn";
|
|
78
|
+
label?: string;
|
|
79
|
+
children: JSX.Element;
|
|
80
|
+
};
|
|
81
|
+
/** A band of free height with one line below, from edge to edge. What stands in it draws no line of its own. */
|
|
82
|
+
export declare const Band: (props: BandProps) => JSX.Element;
|
|
83
|
+
export type CellProps = {
|
|
84
|
+
icon: string;
|
|
85
|
+
/** The data colour of the symbol, such as the colour of an area. */
|
|
86
|
+
color?: string;
|
|
87
|
+
label: string;
|
|
88
|
+
value: JSX.Element;
|
|
89
|
+
/** A quiet line under the value. */
|
|
90
|
+
meta?: JSX.Element;
|
|
91
|
+
/** The cell leads to this page: a chevron at its end. */
|
|
92
|
+
href?: string;
|
|
93
|
+
};
|
|
94
|
+
export declare function Cells(props: {
|
|
95
|
+
children: JSX.Element;
|
|
96
|
+
}): JSX.Element;
|
|
97
|
+
export declare namespace Cells {
|
|
98
|
+
var Cell: (props: CellProps) => JSX.Element;
|
|
99
|
+
}
|
|
100
|
+
export type Tile = {
|
|
101
|
+
icon: string;
|
|
102
|
+
title: string;
|
|
103
|
+
meta?: string;
|
|
104
|
+
href?: string;
|
|
105
|
+
};
|
|
106
|
+
/** Like things side by side, such as attachments. Each is pressed, so each is round; never nested. */
|
|
107
|
+
export type TilesProps = {
|
|
108
|
+
items: readonly Tile[];
|
|
109
|
+
more?: Action;
|
|
110
|
+
label?: string;
|
|
111
|
+
};
|
|
112
|
+
export declare const Tiles: (props: TilesProps) => JSX.Element;
|
|
113
|
+
export type CanvasProps = {
|
|
114
|
+
/** What the drawing shows, for assistive technology. */
|
|
115
|
+
label: string;
|
|
116
|
+
/** The height of the drawing in px; the width comes from its place. */
|
|
117
|
+
height?: number;
|
|
118
|
+
children: JSX.Element;
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* The one way out: a surface with its own drawing, where an app may write its own CSS. Never measured by the rules.
|
|
122
|
+
* It draws no line of its own; the structure around it separates it, and a drawing that needs an edge draws it.
|
|
123
|
+
*/
|
|
124
|
+
export declare const Canvas: (props: CanvasProps) => JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Link } from "@k2b/ssr/nav";
|
|
2
|
+
/**
|
|
3
|
+
* The element of something pressable (internal): a link renders `@k2b/ssr/nav`'s `Link`, so `onNavigate` follows its
|
|
4
|
+
* one contract (plain same-origin clicks only, a pending page swap cancelled, history through the event); anything
|
|
5
|
+
* else renders the given element.
|
|
6
|
+
*/
|
|
7
|
+
export declare const linkOr: <const T extends "a" | "button" | "span">(href: string | undefined, otherwise: T) => typeof Link | T;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
2
|
+
import { type OnNavigate, type Person, type Status } from "./types";
|
|
3
|
+
/** Inline custom properties are the primitive's own business: data colours and measured widths, never layout. */
|
|
4
|
+
export declare const custom: (values: Record<string, string | undefined>) => JSX.CSSProperties | undefined;
|
|
5
|
+
export type IconProps = {
|
|
6
|
+
/** A Tabler icon name without the `ti-` prefix, such as `package`. */
|
|
7
|
+
name: string;
|
|
8
|
+
/** A name for assistive technology; without one the icon is decoration. */
|
|
9
|
+
label?: string;
|
|
10
|
+
tone?: Status | "ai" | "app" | "muted" | "subtle";
|
|
11
|
+
};
|
|
12
|
+
/** A Tabler icon. Its size comes from its place: 16 px in rows and bars, 20 px on a tile, 14 px among marks. */
|
|
13
|
+
export declare const Icon: (props: IconProps) => JSX.Element;
|
|
14
|
+
export type AvatarProps = Person;
|
|
15
|
+
/**
|
|
16
|
+
* A person as initials on a colour. The place sets the size: 24 px by default, 32 px leading a row of two or three
|
|
17
|
+
* lines and in a record head (soft there), 20 px among the marks of a row and in a button.
|
|
18
|
+
*/
|
|
19
|
+
export declare const Avatar: (props: AvatarProps) => JSX.Element;
|
|
20
|
+
export type ChipProps = {
|
|
21
|
+
children: JSX.Element;
|
|
22
|
+
/** A symbol before the word. */
|
|
23
|
+
icon?: string;
|
|
24
|
+
/**
|
|
25
|
+
* A plain chip you can press, such as "1 linked" or "+ Tag": then it is a control with a frame (rule 8).
|
|
26
|
+
*/
|
|
27
|
+
onClick?: () => void;
|
|
28
|
+
href?: string;
|
|
29
|
+
/** With `href`: opens the page in place on a plain click (see `OnNavigate`). */
|
|
30
|
+
onNavigate?: OnNavigate;
|
|
31
|
+
/** A pressable chip that is on, such as an active filter: in the tint of the app. */
|
|
32
|
+
pressed?: boolean;
|
|
33
|
+
} & ({
|
|
34
|
+
/** A state with a dot and a word: ok, waiting or wrong. */
|
|
35
|
+
status: Status;
|
|
36
|
+
yours?: never;
|
|
37
|
+
tag?: never;
|
|
38
|
+
amount?: never;
|
|
39
|
+
ai?: never;
|
|
40
|
+
} | {
|
|
41
|
+
status?: never;
|
|
42
|
+
/** "You are next" in the blue of selection; with `dot` a state that is being worked on ("in Arbeit"). */
|
|
43
|
+
yours: true;
|
|
44
|
+
dot?: boolean;
|
|
45
|
+
tag?: never;
|
|
46
|
+
amount?: never;
|
|
47
|
+
ai?: never;
|
|
48
|
+
} | {
|
|
49
|
+
status?: never;
|
|
50
|
+
yours?: never;
|
|
51
|
+
/** A tag in its data colour. */
|
|
52
|
+
tag: true;
|
|
53
|
+
color?: string;
|
|
54
|
+
amount?: never;
|
|
55
|
+
ai?: never;
|
|
56
|
+
} | {
|
|
57
|
+
status?: never;
|
|
58
|
+
yours?: never;
|
|
59
|
+
tag?: never;
|
|
60
|
+
/** An amount of money that goes out (we pay) or comes in. */
|
|
61
|
+
amount: "out" | "in";
|
|
62
|
+
ai?: never;
|
|
63
|
+
} | {
|
|
64
|
+
status?: never;
|
|
65
|
+
yours?: never;
|
|
66
|
+
tag?: never;
|
|
67
|
+
amount?: never /** Something Gustav proposes, in plum. */;
|
|
68
|
+
ai: true;
|
|
69
|
+
} | {
|
|
70
|
+
status?: never;
|
|
71
|
+
yours?: never;
|
|
72
|
+
tag?: never;
|
|
73
|
+
amount?: never;
|
|
74
|
+
ai?: never;
|
|
75
|
+
});
|
|
76
|
+
/** A round mark that shows a state, a tag, an amount or a count. Never a colour without a word. */
|
|
77
|
+
export declare const Chip: (props: ChipProps) => JSX.Element;
|
|
78
|
+
/** A small round dot of a state (internal: a row marks "unread" with it, the sidebar "new"). */
|
|
79
|
+
export declare const Dot: (props: {
|
|
80
|
+
status?: Status | "app";
|
|
81
|
+
label?: string;
|
|
82
|
+
}) => JSX.Element;
|
|
83
|
+
export type ProgressProps = {
|
|
84
|
+
value: number;
|
|
85
|
+
of: number;
|
|
86
|
+
/** The words next to the bar, such as "Arbeitstag 5 von 22". */
|
|
87
|
+
label?: string;
|
|
88
|
+
};
|
|
89
|
+
/** A thin bar with its value. */
|
|
90
|
+
export declare const Progress: (props: ProgressProps) => JSX.Element;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { Action } from "./types";
|
|
2
|
+
export type EmptyProps = {
|
|
3
|
+
/** A Tabler icon for the round sign, such as `inbox`. */
|
|
4
|
+
icon: string;
|
|
5
|
+
/** One sentence that says what is the matter: "Noch keine Einlieferung." is not "Keine Treffer mit diesem Filter." */
|
|
6
|
+
text: string;
|
|
7
|
+
/** The one way out, such as "Einlieferung erfassen" or "Filter zurücksetzen". */
|
|
8
|
+
action?: Action;
|
|
9
|
+
};
|
|
10
|
+
/** Nothing here: a round sign, one sentence, one way out, without a box (mockup: Notice · Empty). */
|
|
11
|
+
export declare const Empty: (props: EmptyProps) => import("solid-js").JSX.Element;
|
|
12
|
+
export type FailedProps = {
|
|
13
|
+
/**
|
|
14
|
+
* What could not be loaded and what stays as it is, such as "Unterhaltungen konnten nicht geladen werden. Deine
|
|
15
|
+
* Ansicht und Auswahl bleiben erhalten."
|
|
16
|
+
*/
|
|
17
|
+
text: string;
|
|
18
|
+
/** Loads again; the button says "Erneut versuchen" in the language of the page. */
|
|
19
|
+
onRetry: () => void;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Loading failed: the shape of `Empty` with a sign in the tone of wrong, the sentence, and "Erneut versuchen". It
|
|
23
|
+
* replaces only the data; the selection and the view around it stay. (A connection that retries on its own shows in
|
|
24
|
+
* the status row instead, without a button; something a person must fix is a `Notice` that names the deed.)
|
|
25
|
+
*/
|
|
26
|
+
export declare const Failed: (props: FailedProps) => import("solid-js").JSX.Element;
|
|
27
|
+
export type LoadingProps = {
|
|
28
|
+
/** How many rows hold the place; 3 when not set. Give as many as usually come, so nothing moves when they arrive. */
|
|
29
|
+
rows?: number;
|
|
30
|
+
/** The lines of the rows that will come, so each placeholder is exactly as high as its row (40, 52 or 72). */
|
|
31
|
+
lines?: 1 | 2 | 3;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Loading: square placeholders in the heights of the real rows, so nothing moves when the data arrives. It stands
|
|
35
|
+
* where the `List` will stand; a `Table` takes `loading` itself and keeps its head. Assistive technology hears
|
|
36
|
+
* "Wird geladen…" (in the language of the page) from a status line; the placeholders themselves are hidden from it.
|
|
37
|
+
*/
|
|
38
|
+
export declare const Loading: (props: LoadingProps) => import("solid-js").JSX.Element;
|
|
39
|
+
/** The words "loading" for assistive technology only (internal: `Loading` and a loading `Table`). */
|
|
40
|
+
export declare const LoadingStatus: () => import("solid-js").JSX.Element;
|
|
41
|
+
/** Rows of placeholders in the shape of `Row` (internal: `Loading` and the phone list of a loading `Table`). */
|
|
42
|
+
export declare const PlaceholderRows: (props: {
|
|
43
|
+
rows: number;
|
|
44
|
+
lines: 1 | 2 | 3;
|
|
45
|
+
}) => import("solid-js").JSX.Element;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
2
|
+
import type { Action, TwoActions } from "./types";
|
|
3
|
+
export type SectionProps = {
|
|
4
|
+
/** The symbol of the section. With `color` it stands on a tinted tile, otherwise plain. */
|
|
5
|
+
icon?: string;
|
|
6
|
+
/** The data colour of the section's area, such as the colour of deliveries. */
|
|
7
|
+
color?: string;
|
|
8
|
+
title: string;
|
|
9
|
+
count?: number | string;
|
|
10
|
+
/** At most two text buttons in the head; on the phone they keep only their symbol. */
|
|
11
|
+
actions?: TwoActions;
|
|
12
|
+
/** One sentence under the head that sums the section up. */
|
|
13
|
+
summary?: JSX.Element;
|
|
14
|
+
/** The way to all of it, at the end ("All deliveries ›"). */
|
|
15
|
+
more?: Action;
|
|
16
|
+
children?: JSX.Element;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* A section: a head with symbol, title, count and at most two text buttons. Rule 9: no line under the head, none
|
|
20
|
+
* between the entries, one line at the end.
|
|
21
|
+
*/
|
|
22
|
+
export declare const Section: (props: SectionProps) => JSX.Element;
|
|
23
|
+
export type GroupProps = {
|
|
24
|
+
icon?: string;
|
|
25
|
+
color?: string;
|
|
26
|
+
title: string;
|
|
27
|
+
count?: number | string;
|
|
28
|
+
/** A quiet line under the title; the head grows from 40 to 56 px. */
|
|
29
|
+
meta?: JSX.Element;
|
|
30
|
+
/** A state at the end of the head, such as `<Text weight="medium"><Icon name="gavel" /> Läuft</Text>` or an amount. */
|
|
31
|
+
state?: JSX.Element;
|
|
32
|
+
/** More deeds of the group behind one "…" button. (The menu opens with the behaviour layer.) */
|
|
33
|
+
menu?: Action;
|
|
34
|
+
/** At most two text buttons at the end of the head; more deeds go into `menu`. */
|
|
35
|
+
actions?: TwoActions;
|
|
36
|
+
/**
|
|
37
|
+
* Only the head with its result; the content is hidden, and a chevron at the end opens it. (Opening comes with the
|
|
38
|
+
* behaviour layer.)
|
|
39
|
+
*/
|
|
40
|
+
folded?: boolean;
|
|
41
|
+
children?: JSX.Element;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* The one framed group: what belongs together (a delivery, the items of one consignor, a thread). A square frame of
|
|
45
|
+
* one hairline, a tinted head, and no line inside: entries are told apart by spacing alone. Never nested.
|
|
46
|
+
*/
|
|
47
|
+
export declare const Group: (props: GroupProps) => JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@k2b/ui/v2/testing`: check a v2 screen in a Playwright test the same way @k2b/ui checks its own primitives.
|
|
3
|
+
*
|
|
4
|
+
* - `measureV2Layout(page)`: edges, double lines, type roles and grips as numbers; `problems` is empty when the page
|
|
5
|
+
* keeps the v2 rules.
|
|
6
|
+
* - `describeV2Page(page)`: the text outline of `describeV2` from a laid-out page, with hidden parts and dropped
|
|
7
|
+
* columns at the page's width.
|
|
8
|
+
* - `settled(page)`: waits for fonts, layout and finite animations before anything is read.
|
|
9
|
+
*
|
|
10
|
+
* Needs Playwright in the consumer (an optional peer dependency); nothing here is part of the main export.
|
|
11
|
+
*/
|
|
12
|
+
import type { Page } from "playwright";
|
|
13
|
+
export { measureV2Layout, type V2GripMeasure, type V2Layout, type V2LayoutOptions } from "./measure-v2-layout";
|
|
14
|
+
export { settled } from "./settled";
|
|
15
|
+
/** The `describeV2` outline of a laid-out page, from `root` (the whole body by default). */
|
|
16
|
+
export declare const describeV2Page: (page: Page, root?: string) => Promise<string>;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A test helper, shipped as `@k2b/ui/v2/testing`: measures the layout rules of @k2b/ui v2 on a Playwright page, as numbers
|
|
3
|
+
* against the mockup instead of a count of error classes (the lesson of the flat audit, 22.11.).
|
|
4
|
+
*
|
|
5
|
+
* - **edge:** a horizontal hairline or a tinted band reaches both edges of its column (within 1.5 px). A column edge
|
|
6
|
+
* is a vertical hairline, an element matched by `columns`, or the edge of `root`.
|
|
7
|
+
* - **double:** no two parallel lines lie at most 1 px apart over more than 1 px of length, also across components.
|
|
8
|
+
* - **type:** every run of text is set in a type role: 12, 13, 14 or 18 px on a 16, 20 or 24 px line, in 400, 500 or
|
|
9
|
+
* 600. Reading text (`prose`) may also use 16 px and a 22 px line.
|
|
10
|
+
* - **grip:** the pill of every grip is centred on its 1 px line within ±0.25 CSS px, measured in the DOM and again
|
|
11
|
+
* in the screenshot at the page's device pixel ratio, inside the grip only.
|
|
12
|
+
*
|
|
13
|
+
* A line is any way to draw one: a border side, a `box-shadow` without blur (offset or spread), a box of at most
|
|
14
|
+
* 1.5 px, and the same on `::before` and `::after`, also under a `display: contents` parent whose own box has no
|
|
15
|
+
* size. To measure a pseudo-element, the helper puts a stand-in element with the pseudo's computed style in its place
|
|
16
|
+
* for the moment of the measurement and restores the page afterwards.
|
|
17
|
+
*
|
|
18
|
+
* Only what a person sees counts: a line or band is cut to the viewport and to every ancestor that clips it (a
|
|
19
|
+
* scrolled column), so content scrolled out of view is measured after scrolling, not before. A rounded box (a
|
|
20
|
+
* control, a mark, an overlay) floats on its own: its outline is no divider and makes no double line.
|
|
21
|
+
*
|
|
22
|
+
* The DOM contract of v2 marks what the rules need: `data-k2-column` (a column), `data-k2-grip` (a grip whose box is
|
|
23
|
+
* its pill), `data-k2-prose` (reading text), `data-k2-figure` (a drawn mark such as the track of steps; its lines are
|
|
24
|
+
* no dividers), `data-k2-canvas` (free drawing: never measured inside, only the line it draws itself) and
|
|
25
|
+
* `data-k2-avatar` (initials, no type role). The options take other selectors, for the mockup's classes for example.
|
|
26
|
+
*
|
|
27
|
+
* - **inside:** a band or a group is one thing (rule 9): a horizontal hairline inside it separates its parts and is a
|
|
28
|
+
* finding at any distance from other lines. A frame, a control's outline and a figure's track are no such line.
|
|
29
|
+
* - **cut:** a control's label never leaves its box and is never clipped, unless it ends in "…" in its own box (the
|
|
30
|
+
* way back to a list with a long name); a one-line text (the lines of a row, the
|
|
31
|
+
* cells of a table with column widths) never wraps, it ends with "…"; a box that clips its text shows every line
|
|
32
|
+
* whole and cuts a line at its end only with "…".
|
|
33
|
+
*
|
|
34
|
+
* ```ts
|
|
35
|
+
* import { measureV2Layout } from "@k2b/ui/v2/testing";
|
|
36
|
+
*
|
|
37
|
+
* for (const deviceScaleFactor of [1, 2])
|
|
38
|
+
* test(`DPR ${deviceScaleFactor}: the layout keeps the v2 rules`, async () => {
|
|
39
|
+
* const page = await browser.newPage({ viewport: { width: 1440, height: 900 }, deviceScaleFactor });
|
|
40
|
+
* await page.setContent(html);
|
|
41
|
+
* expect((await measureV2Layout(page)).problems).toEqual([]);
|
|
42
|
+
* });
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
import type { Page } from "playwright";
|
|
46
|
+
export type V2LayoutOptions = {
|
|
47
|
+
/** The element to measure; the whole body by default. */
|
|
48
|
+
root?: string;
|
|
49
|
+
/** Columns whose edges lines must reach. */
|
|
50
|
+
columns?: string;
|
|
51
|
+
/** Grips; each one's box is its pill. */
|
|
52
|
+
grips?: string;
|
|
53
|
+
/** Reading text, which may also use 16 px and a 22 px line. */
|
|
54
|
+
prose?: string;
|
|
55
|
+
/** Subtrees whose inside is never measured: free drawing in `Canvas`. The line such a surface draws itself counts. */
|
|
56
|
+
skip?: string;
|
|
57
|
+
/** One thing in one frame or band (rule 9): spacing alone separates its parts, so any line inside is a finding. */
|
|
58
|
+
unbroken?: string;
|
|
59
|
+
/** Controls whose label must never be cut: a text that leaves the control's box or is clipped by it. */
|
|
60
|
+
controls?: string;
|
|
61
|
+
/** Text that stays on one line and ends with "…" when it is too long; wrapping to a second line is a finding. */
|
|
62
|
+
oneLine?: string;
|
|
63
|
+
/** Drawn marks whose lines are no dividers, such as the track of steps; their text is still measured. */
|
|
64
|
+
figure?: string;
|
|
65
|
+
/** Text that has no type role, such as initials in an avatar. */
|
|
66
|
+
untyped?: string;
|
|
67
|
+
};
|
|
68
|
+
export type V2GripMeasure = {
|
|
69
|
+
grip: string;
|
|
70
|
+
/** Pill centre minus line centre in CSS px, from the DOM. */
|
|
71
|
+
dom: number;
|
|
72
|
+
/** The same from the screenshot, or null when the pill or its line could not be told from the background. */
|
|
73
|
+
pixels: number | null;
|
|
74
|
+
/** The width of the line in CSS px, from the screenshot. */
|
|
75
|
+
lineWidth: number | null;
|
|
76
|
+
};
|
|
77
|
+
export type V2Layout = {
|
|
78
|
+
edge: string[];
|
|
79
|
+
double: string[];
|
|
80
|
+
/** Lines inside one thing (a band, a group), whatever their distance to other lines. */
|
|
81
|
+
inside: string[];
|
|
82
|
+
/** Cut control labels and one-line texts that wrap. */
|
|
83
|
+
cut: string[];
|
|
84
|
+
type: string[];
|
|
85
|
+
grip: string[];
|
|
86
|
+
grips: V2GripMeasure[];
|
|
87
|
+
/** Pseudo-elements the helper could not measure without changing the page; each one is a problem, never a pass. */
|
|
88
|
+
pseudo: string[];
|
|
89
|
+
/** How many hairlines and tinted bands were measured, so a test can tell an empty page from a clean one. */
|
|
90
|
+
measured: {
|
|
91
|
+
lines: number;
|
|
92
|
+
bands: number;
|
|
93
|
+
texts: number;
|
|
94
|
+
};
|
|
95
|
+
/** Every problem as one readable line; empty when the page keeps the rules. */
|
|
96
|
+
problems: string[];
|
|
97
|
+
};
|
|
98
|
+
/** Measures the v2 layout rules on the page as it stands. Restores the page before it returns. */
|
|
99
|
+
export declare function measureV2Layout(page: Page, options?: V2LayoutOptions): Promise<V2Layout>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Page } from "playwright";
|
|
2
|
+
/**
|
|
3
|
+
* Guards against state sampled before it settled (#1476, #1499).
|
|
4
|
+
* Waits for fonts, the first resize delivery and its scheduled frame, running finite document-timeline animations, then two frames.
|
|
5
|
+
* Infinite, scroll-driven, and paused animations are not waited for. A page that
|
|
6
|
+
* keeps starting finite animations is not settled: this throws with their names,
|
|
7
|
+
* and the test must wait for its own condition instead. Suites not about motion
|
|
8
|
+
* pass `reducedMotion: "reduce"` to newPage/newContext themselves. Playwright's
|
|
9
|
+
* pointer rests at the top left from the first page on, touch contexts included,
|
|
10
|
+
* so content that arrives there later fades into hover; the error marks such
|
|
11
|
+
* targets with `"hovered":true`.
|
|
12
|
+
*/
|
|
13
|
+
export declare const settled: (page: Page) => Promise<void>;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The measured numbers of @k2b/ui v2, taken from the approved mockup (`v2.css`, draft 16). `v2.css` declares the same
|
|
3
|
+
* values as custom properties; a unit test keeps both in step, and the layout measurements in the browser tests read
|
|
4
|
+
* their limits from here.
|
|
5
|
+
*/
|
|
6
|
+
/** The four type roles. A primitive picks a role, never a size. */
|
|
7
|
+
export declare const typeRoles: {
|
|
8
|
+
/** Labels, times, counters. */
|
|
9
|
+
readonly meta: {
|
|
10
|
+
readonly size: 12;
|
|
11
|
+
readonly lineHeight: 16;
|
|
12
|
+
readonly weight: 400;
|
|
13
|
+
};
|
|
14
|
+
/** Rows and controls. */
|
|
15
|
+
readonly row: {
|
|
16
|
+
readonly size: 13;
|
|
17
|
+
readonly lineHeight: 20;
|
|
18
|
+
readonly weight: 400;
|
|
19
|
+
};
|
|
20
|
+
/** Titles in a head, reading text. */
|
|
21
|
+
readonly body: {
|
|
22
|
+
readonly size: 14;
|
|
23
|
+
readonly lineHeight: 20;
|
|
24
|
+
readonly weight: 400;
|
|
25
|
+
};
|
|
26
|
+
/** The one main statement or name. */
|
|
27
|
+
readonly lead: {
|
|
28
|
+
readonly size: 18;
|
|
29
|
+
readonly lineHeight: 24;
|
|
30
|
+
readonly weight: 600;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
export type TypeRole = keyof typeof typeRoles;
|
|
34
|
+
/** The three weights; emphasis is a weight, never a size. */
|
|
35
|
+
export declare const fontWeights: readonly [400, 500, 600];
|
|
36
|
+
/**
|
|
37
|
+
* Where text starts in a column: 20 px from 768 px, 16 px below. After an icon the text edge is 24 px further in
|
|
38
|
+
* (16 px icon and 8 px gap), so 44 px and 40 px on the phone.
|
|
39
|
+
*/
|
|
40
|
+
export declare const textEdge: {
|
|
41
|
+
readonly wide: 20;
|
|
42
|
+
readonly phone: 16;
|
|
43
|
+
readonly afterIcon: 24;
|
|
44
|
+
readonly phoneBelow: 768;
|
|
45
|
+
};
|
|
46
|
+
/** The one hairline: 1 px in one colour. Lines separate groups and reach the edges of their column. */
|
|
47
|
+
export declare const hairline: {
|
|
48
|
+
readonly width: 1;
|
|
49
|
+
};
|
|
50
|
+
/** Radii by role: a mark (4), a control or an overlay (8), round (999), the app card (14). Structure is square. */
|
|
51
|
+
export declare const radii: {
|
|
52
|
+
readonly mark: 4;
|
|
53
|
+
readonly control: 8;
|
|
54
|
+
readonly overlay: 8;
|
|
55
|
+
readonly round: 999;
|
|
56
|
+
readonly card: 14;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Fixed heights by place; a primitive takes its height from where it stands. The row heights are minima, as in the
|
|
60
|
+
* mockup: a row of two or three lines is taller than its minimum by its line, so it stands 53 and 73 px apart
|
|
61
|
+
* (`row2 + hairline.width`), exactly as the approved mockup renders it.
|
|
62
|
+
*/
|
|
63
|
+
export declare const heights: {
|
|
64
|
+
readonly head: 56;
|
|
65
|
+
readonly status: 52;
|
|
66
|
+
readonly tabs: 44;
|
|
67
|
+
readonly bar: 40;
|
|
68
|
+
readonly columns: 36;
|
|
69
|
+
readonly row: 40;
|
|
70
|
+
readonly row2: 52;
|
|
71
|
+
readonly row3: 72;
|
|
72
|
+
readonly dense: 32;
|
|
73
|
+
readonly control: 36;
|
|
74
|
+
readonly controlSmall: 28;
|
|
75
|
+
};
|
|
76
|
+
/** A grip's pill centre lies on the centre of its line within this many CSS px, at device pixel ratio 1 and 2. */
|
|
77
|
+
export declare const gripTolerance = 0.25;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { LinkNavigateEvent } from "@k2b/ssr/nav";
|
|
2
|
+
/**
|
|
3
|
+
* Opens a link's page in place, beside the real link (`href`): the contract of `@k2b/ssr/nav`'s `Link`, which the
|
|
4
|
+
* primitive renders. A plain same-origin click (the main button, no modifier key, no other target) reaches it; the
|
|
5
|
+
* link has then taken the click and cancelled a pending page swap, and the handler moves history with `push` or
|
|
6
|
+
* `replaceWith`, or loads the page with `fallback`. A click with a modifier key, "open in new tab" and a click before
|
|
7
|
+
* the page is live stay the browser's.
|
|
8
|
+
*/
|
|
9
|
+
export type OnNavigate = (event: LinkNavigateEvent) => void | Promise<void>;
|
|
10
|
+
/** The width of a column that can be dragged: its minimum and its default, in CSS px. Nothing else. */
|
|
11
|
+
export type Width = {
|
|
12
|
+
min: number;
|
|
13
|
+
default: number;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* An action as data. The primitive decides whether it becomes a button, an icon button or a text button, so the
|
|
17
|
+
* same action looks the same in every place (concept, API style).
|
|
18
|
+
*/
|
|
19
|
+
export type Action = {
|
|
20
|
+
label: string;
|
|
21
|
+
/** A Tabler icon name without the `ti-` prefix, such as `plus`. */
|
|
22
|
+
icon?: string;
|
|
23
|
+
href?: string;
|
|
24
|
+
/** With `href`: opens the page in place on a plain click (see `OnNavigate`). */
|
|
25
|
+
onNavigate?: OnNavigate;
|
|
26
|
+
onClick?: () => void;
|
|
27
|
+
/** A quiet summary after the label where the place shows one, such as "Bank, Person, Portal". */
|
|
28
|
+
meta?: string;
|
|
29
|
+
/** The action leads further, to a page with more: a chevron to the right after the label. */
|
|
30
|
+
forward?: boolean;
|
|
31
|
+
};
|
|
32
|
+
/** At most two actions, such as the text buttons in the head of a section; a third does not fit by type. */
|
|
33
|
+
export type TwoActions = readonly [Action] | readonly [Action, Action];
|
|
34
|
+
/** The colours of meaning. A tone is never decoration: it says ok, wait, wrong, AI or "yours". */
|
|
35
|
+
export type Status = "ok" | "warn" | "bad";
|
|
36
|
+
/** A person or an organisation shown as initials on a colour. */
|
|
37
|
+
export type Person = {
|
|
38
|
+
name: string;
|
|
39
|
+
initials?: string;
|
|
40
|
+
/** The colour behind the initials; without it the fixed colour of the name, the same everywhere in Cloud. */
|
|
41
|
+
color?: string;
|
|
42
|
+
};
|
|
43
|
+
/** The initials of a name: the first letters of its first two words. */
|
|
44
|
+
export declare const initialsOf: (person: Person) => string;
|