@k2b/ui 0.65.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.
Files changed (106) hide show
  1. package/README.md +47 -0
  2. package/dist/browser/v2/button.js +180 -0
  3. package/dist/browser/v2/button.js.map +1 -0
  4. package/dist/browser/v2/components.js +763 -0
  5. package/dist/browser/v2/components.js.map +1 -0
  6. package/dist/browser/v2/content.js +1107 -0
  7. package/dist/browser/v2/content.js.map +1 -0
  8. package/dist/browser/v2/controls.js +568 -0
  9. package/dist/browser/v2/controls.js.map +1 -0
  10. package/dist/browser/v2/describe.js +397 -0
  11. package/dist/browser/v2/describe.js.map +1 -0
  12. package/dist/browser/v2/index.js +25 -0
  13. package/dist/browser/v2/index.js.map +1 -0
  14. package/dist/browser/v2/layout.js +578 -0
  15. package/dist/browser/v2/layout.js.map +1 -0
  16. package/dist/browser/v2/link.js +9 -0
  17. package/dist/browser/v2/link.js.map +1 -0
  18. package/dist/browser/v2/marks.js +211 -0
  19. package/dist/browser/v2/marks.js.map +1 -0
  20. package/dist/browser/v2/states.js +180 -0
  21. package/dist/browser/v2/states.js.map +1 -0
  22. package/dist/browser/v2/structure.js +328 -0
  23. package/dist/browser/v2/structure.js.map +1 -0
  24. package/dist/browser/v2/testing/index.js +23 -0
  25. package/dist/browser/v2/testing/index.js.map +1 -0
  26. package/dist/browser/v2/testing/measure-v2-layout.js +762 -0
  27. package/dist/browser/v2/testing/measure-v2-layout.js.map +1 -0
  28. package/dist/browser/v2/testing/settled.js +52 -0
  29. package/dist/browser/v2/testing/settled.js.map +1 -0
  30. package/dist/browser/v2/tokens.js +83 -0
  31. package/dist/browser/v2/tokens.js.map +1 -0
  32. package/dist/browser/v2/types.js +24 -0
  33. package/dist/browser/v2/types.js.map +1 -0
  34. package/dist/ssr/v2/button.js +177 -0
  35. package/dist/ssr/v2/button.js.map +1 -0
  36. package/dist/ssr/v2/components.js +518 -0
  37. package/dist/ssr/v2/components.js.map +1 -0
  38. package/dist/ssr/v2/content.js +727 -0
  39. package/dist/ssr/v2/content.js.map +1 -0
  40. package/dist/ssr/v2/controls.js +268 -0
  41. package/dist/ssr/v2/controls.js.map +1 -0
  42. package/dist/ssr/v2/describe.js +397 -0
  43. package/dist/ssr/v2/describe.js.map +1 -0
  44. package/dist/ssr/v2/index.js +25 -0
  45. package/dist/ssr/v2/index.js.map +1 -0
  46. package/dist/ssr/v2/layout.js +377 -0
  47. package/dist/ssr/v2/layout.js.map +1 -0
  48. package/dist/ssr/v2/link.js +9 -0
  49. package/dist/ssr/v2/link.js.map +1 -0
  50. package/dist/ssr/v2/marks.js +126 -0
  51. package/dist/ssr/v2/marks.js.map +1 -0
  52. package/dist/ssr/v2/states.js +128 -0
  53. package/dist/ssr/v2/states.js.map +1 -0
  54. package/dist/ssr/v2/structure.js +229 -0
  55. package/dist/ssr/v2/structure.js.map +1 -0
  56. package/dist/ssr/v2/testing/index.js +23 -0
  57. package/dist/ssr/v2/testing/index.js.map +1 -0
  58. package/dist/ssr/v2/testing/measure-v2-layout.js +762 -0
  59. package/dist/ssr/v2/testing/measure-v2-layout.js.map +1 -0
  60. package/dist/ssr/v2/testing/settled.js +52 -0
  61. package/dist/ssr/v2/testing/settled.js.map +1 -0
  62. package/dist/ssr/v2/tokens.js +83 -0
  63. package/dist/ssr/v2/tokens.js.map +1 -0
  64. package/dist/ssr/v2/types.js +24 -0
  65. package/dist/ssr/v2/types.js.map +1 -0
  66. package/dist/types/v2/button.d.ts +54 -0
  67. package/dist/types/v2/components.d.ts +173 -0
  68. package/dist/types/v2/content.d.ts +233 -0
  69. package/dist/types/v2/controls.d.ts +118 -0
  70. package/dist/types/v2/describe.d.ts +18 -0
  71. package/dist/types/v2/index.d.ts +22 -0
  72. package/dist/types/v2/layout.d.ts +124 -0
  73. package/dist/types/v2/link.d.ts +7 -0
  74. package/dist/types/v2/marks.d.ts +90 -0
  75. package/dist/types/v2/states.d.ts +45 -0
  76. package/dist/types/v2/structure.d.ts +47 -0
  77. package/dist/types/v2/testing/index.d.ts +16 -0
  78. package/dist/types/v2/testing/measure-v2-layout.d.ts +99 -0
  79. package/dist/types/v2/testing/settled.d.ts +13 -0
  80. package/dist/types/v2/tokens.d.ts +77 -0
  81. package/dist/types/v2/types.d.ts +44 -0
  82. package/dist/v2.css +3072 -0
  83. package/package.json +23 -4
  84. package/skills/k2b-ui/SKILL.md +201 -0
  85. package/skills/k2b-ui/images/form-1440.png +0 -0
  86. package/skills/k2b-ui/images/form-390.png +0 -0
  87. package/skills/k2b-ui/images/list-detail-1440.png +0 -0
  88. package/skills/k2b-ui/images/list-detail-390.png +0 -0
  89. package/skills/k2b-ui/images/mail-1440.png +0 -0
  90. package/skills/k2b-ui/images/mail-390.png +0 -0
  91. package/skills/k2b-ui/images/record-1440.png +0 -0
  92. package/skills/k2b-ui/images/record-390.png +0 -0
  93. package/skills/k2b-ui/images/record-groups-1440.png +0 -0
  94. package/skills/k2b-ui/images/record-groups-390.png +0 -0
  95. package/skills/k2b-ui/images/table-1440.png +0 -0
  96. package/skills/k2b-ui/images/table-390.png +0 -0
  97. package/skills/k2b-ui/recipes/form.tsx +54 -0
  98. package/skills/k2b-ui/recipes/list-detail.tsx +105 -0
  99. package/skills/k2b-ui/recipes/mail.tsx +193 -0
  100. package/skills/k2b-ui/recipes/record-groups.tsx +115 -0
  101. package/skills/k2b-ui/recipes/record.tsx +163 -0
  102. package/skills/k2b-ui/recipes/table.tsx +68 -0
  103. package/skills/k2b-ui/references/mistakes.md +162 -0
  104. package/skills/k2b-ui/references/primitives.md +310 -0
  105. package/skills/k2b-ui/references/recipes.md +101 -0
  106. package/skills/k2b-ui/references/seeing.md +94 -0
@@ -0,0 +1,233 @@
1
+ import { type JSX } from "solid-js";
2
+ import { type EmptyProps } from "./states";
3
+ import type { TypeRole } from "./tokens";
4
+ import type { Action, OnNavigate, Person, Status } from "./types";
5
+ export type TextProps = {
6
+ /**
7
+ * One of the four type roles. Without one, text takes the role of its place (13/20 in a pane, the role of the
8
+ * sentence it stands in). (Named `type`, not `role`, so it never reads as an ARIA role.)
9
+ */
10
+ type?: TypeRole;
11
+ /**
12
+ * Emphasis is a weight, never a size: `strong` (600) stresses a word, `medium` (500) lets a state or an amount stand
13
+ * out a little, such as "Quittung offen".
14
+ */
15
+ weight?: "medium" | "strong";
16
+ /** The muted ink, for a second voice beside the main text. */
17
+ muted?: boolean;
18
+ /** A colour of meaning, never decoration. */
19
+ tone?: Status | "ai" | "draft";
20
+ /** The words lead to this page: they keep the ink of the text and are underlined (blue is only the main action). */
21
+ href?: string;
22
+ children: JSX.Element;
23
+ };
24
+ /**
25
+ * Text in one of the four type roles. Standing in the flow of a column (a pane, a band, a section, a group) it is a
26
+ * block that carries the text edge itself; anywhere else (a bar, a row, a sentence) it runs inline, and in a bar it is
27
+ * cut to one line with "…". The stylesheet decides by place, so text passed as data behaves the same.
28
+ */
29
+ export declare const Text: (props: TextProps) => JSX.Element;
30
+ export type ProseProps = {
31
+ /**
32
+ * Text in Markdown, such as a message. Raw HTML in it shows as text; links lead only to web pages and mail
33
+ * addresses; images show their words, they load nothing.
34
+ */
35
+ markdown: string;
36
+ children?: never;
37
+ } | {
38
+ markdown?: never;
39
+ children: JSX.Element;
40
+ };
41
+ /** Reading text: 14/22, a measure of 720 px, headings at 16 and 18. It carries the text edge itself. */
42
+ export declare const Prose: (props: ProseProps) => JSX.Element;
43
+ export type InlineProps = {
44
+ children: JSX.Element;
45
+ };
46
+ /**
47
+ * One line of things with the one fixed gap of 8 px. In a column it carries the text edge itself. In a column narrower
48
+ * than 480 px it wraps onto more lines instead of cutting a thing; in a bar it flows together with the bar's end.
49
+ */
50
+ export declare const Inline: (props: InlineProps) => JSX.Element;
51
+ export type Fact = {
52
+ label: string;
53
+ value: JSX.Element;
54
+ /** A quiet word under the value, such as "Standard". */
55
+ hint?: string;
56
+ /** Offers a copy button at the value; the text that is copied. */
57
+ copy?: string;
58
+ };
59
+ export type FactsProps = {
60
+ items: readonly Fact[];
61
+ /** All facts on one line, labels quiet before their values. */
62
+ inline?: boolean;
63
+ /** At the end of the inline line, such as "Print". */
64
+ end?: JSX.Element;
65
+ };
66
+ /** Values with their labels: label 12 quiet, value 13, 32 px a row, copy at the value. */
67
+ export declare const Facts: (props: FactsProps) => JSX.Element;
68
+ export type ListProps = {
69
+ children: JSX.Element;
70
+ label?: string;
71
+ };
72
+ /** Rows one under the other. (Selection, keyboard and drag come with the behaviour layer.) */
73
+ export declare const List: (props: ListProps) => JSX.Element;
74
+ export type RowLines = readonly [JSX.Element] | readonly [JSX.Element, JSX.Element] | readonly [JSX.Element, JSX.Element, JSX.Element];
75
+ export type RowProps = {
76
+ /**
77
+ * One to three lines; the role follows the position: one line 40 px, two lines 52 px (the second quiet, 12 px),
78
+ * three lines 72 px (the second a row, the third quiet). A row of three lines cuts each line with "…".
79
+ */
80
+ lines: RowLines;
81
+ /** A quiet note after the title, such as a count or an address. */
82
+ meta?: JSX.Element;
83
+ /** The lead: a symbol in the colour of its area … */
84
+ icon?: string;
85
+ /** … the data colour of that symbol … */
86
+ color?: string;
87
+ /** … or a person. */
88
+ avatar?: Person;
89
+ /** Unread: a dot leads and the first two lines turn 600. */
90
+ unread?: boolean;
91
+ /** The title in 600. */
92
+ strong?: boolean;
93
+ /** The open one, in the tint of the app. */
94
+ selected?: boolean;
95
+ /** "You are next", in the blue tint. */
96
+ yours?: boolean;
97
+ /** Top right, quiet: a time or a date. */
98
+ time?: JSX.Element;
99
+ /** Bottom right on the third line: chips, icons, people. */
100
+ marks?: JSX.Element;
101
+ /** The one deed of this entry, a framed button at the end; on the phone it moves under the text. */
102
+ action?: Action;
103
+ /** At the end: a few icon buttons, such as "Reply" and "More". */
104
+ end?: JSX.Element;
105
+ /** The row opens this link … */
106
+ href?: string;
107
+ /** … in place on a plain click, while the link still opens in a new tab (see `OnNavigate`) … */
108
+ onNavigate?: OnNavigate;
109
+ /** … or calls this. */
110
+ onOpen?: () => void;
111
+ };
112
+ /**
113
+ * What opens an entry: the title becomes a link or a button, stretched over the whole entry. It is never the entry
114
+ * itself, so buttons and links inside the entry stay buttons and links of their own (no control inside a control).
115
+ */
116
+ export declare const RowOpen: (props: {
117
+ href?: string;
118
+ onNavigate?: OnNavigate;
119
+ onOpen?: () => void;
120
+ children: JSX.Element;
121
+ }) => JSX.Element;
122
+ /** One entry: from column edge to column edge, square, also when it opens something. */
123
+ export declare const Row: (props: RowProps) => JSX.Element;
124
+ /** Two lines of a cell: the line itself and a quiet second line under it. */
125
+ export type CellLines = {
126
+ lines: readonly [JSX.Element, JSX.Element];
127
+ };
128
+ /** What a cell shows: one line, or two lines named as such (`{ lines: [first, second] }`). */
129
+ export type CellValue = JSX.Element | CellLines;
130
+ export type Column<T> = {
131
+ title: string;
132
+ cell: (row: T) => CellValue;
133
+ /** Numbers and amounts stand at the end. */
134
+ align?: "start" | "end";
135
+ /**
136
+ * A column that can be dragged wider or narrower: its minimum and default in px. The column is exactly its
137
+ * default wide; cut text never widens it.
138
+ */
139
+ width?: {
140
+ min: number;
141
+ default: number;
142
+ };
143
+ /** A text column that may wrap to at most three lines; the row grows, every other cell stays on its first line. */
144
+ wrap?: boolean;
145
+ /** Drops away on the phone (rule 7: columns drop, they do not shrink). */
146
+ drop?: boolean;
147
+ };
148
+ /** Where an entry leads: a page (a real link, also before the page is live) or a deed in place. */
149
+ export type OpenTarget = {
150
+ href: string;
151
+ onNavigate?: OnNavigate;
152
+ onOpen?: () => void;
153
+ } | {
154
+ href?: undefined;
155
+ onNavigate?: undefined;
156
+ onOpen: () => void;
157
+ };
158
+ type TableBase<T> = {
159
+ columns: readonly Column<T>[];
160
+ rows: readonly T[];
161
+ /** A name for the table, for assistive technology. */
162
+ label?: string;
163
+ /** The first column (and the box column) stays while the table scrolls sideways; an edge shows behind it. */
164
+ sticky?: boolean;
165
+ /** The column the rows are sorted by: an arrow in its head. */
166
+ sort?: {
167
+ column: number;
168
+ direction: "ascending" | "descending";
169
+ };
170
+ /** What a row opens, on the desktop and on the phone: its first cell is the link or button. */
171
+ open?: (row: T) => OpenTarget;
172
+ /** On the phone each row becomes a row of two lines instead (rule 7). */
173
+ phone?: (row: T) => {
174
+ lines: readonly [JSX.Element, JSX.Element];
175
+ avatar?: Person;
176
+ time?: JSX.Element;
177
+ };
178
+ /**
179
+ * While the rows load: the head stays and square placeholders hold the place of the rows, so nothing moves when they
180
+ * come; `rows` (3 when not set) and `lines` (1 or 2) say how many and how high.
181
+ */
182
+ loading?: boolean | {
183
+ rows?: number;
184
+ lines?: 1 | 2;
185
+ };
186
+ /** No rows and nothing loading: the empty state stands in place of the table, such as "Keine Aufträge mit diesem Filter." */
187
+ empty?: EmptyProps;
188
+ };
189
+ /** A table whose rows are told apart: selection, the open row and groups need the stable key of a row. */
190
+ type KeyedTable<T> = {
191
+ /** The stable key of a row. */
192
+ rowKey: (row: T) => string;
193
+ /**
194
+ * A large table (Grids): a box column to select rows. The status row shows what can be done with them
195
+ * (`StatusRow selection`).
196
+ */
197
+ select?: {
198
+ selected: readonly string[];
199
+ onChange: (keys: readonly string[]) => void;
200
+ /** The name of the box of all rows and of one row, such as "Alle Aufträge" and the row's title. */
201
+ all: string;
202
+ row: (row: T) => string;
203
+ };
204
+ /** The key of the open row, in the tint of the app. */
205
+ current?: string;
206
+ /** Rows of a group follow one another under a tinted group row of 36 px (no frame: it would cut the columns). */
207
+ group?: (row: T) => TableGroup;
208
+ };
209
+ type PlainTable = {
210
+ rowKey?: undefined;
211
+ select?: undefined;
212
+ current?: undefined;
213
+ group?: undefined;
214
+ };
215
+ export type TableProps<T> = TableBase<T> & (KeyedTable<T> | PlainTable);
216
+ /**
217
+ * A group of rows: its key, its head (such as a state chip), quiet figures after it, and the count for the phone.
218
+ * The head is made where it stands (the table and the phone list each make their own), so it is a function.
219
+ */
220
+ export type TableGroup = {
221
+ key: string;
222
+ head: () => JSX.Element;
223
+ meta?: string;
224
+ count?: string;
225
+ };
226
+ /**
227
+ * Many like things in columns: head 36, a line under every row, none between columns. Long text stays on one line
228
+ * with "…" and a fixed row height (variant a, decided 22.11.); `wrap` lets one text column take three lines. With
229
+ * `select` or `sticky` it is the large table of Grids: one scroller for head and rows, a sticky head and first column,
230
+ * rows and cells under the pointer, groups as tinted rows.
231
+ */
232
+ export declare const Table: <T>(props: TableProps<T>) => JSX.Element;
233
+ export {};
@@ -0,0 +1,118 @@
1
+ import { type JSX } from "solid-js";
2
+ export type FieldProps = {
3
+ label: string;
4
+ /** The name the value is sent under; the control inside takes it. */
5
+ name?: string;
6
+ /** A quiet hint under the control. */
7
+ hint?: string;
8
+ /** The error at the field; it replaces the hint and marks the control. */
9
+ error?: string;
10
+ /** "Optional" or a unit, quiet at the end of the label line. */
11
+ optional?: string;
12
+ /**
13
+ * The form is not sent without a value here: the control says so to the browser and to assistive technology. The
14
+ * label line shows nothing for it; the fields that may stay empty say "optional" instead (as the mockup does).
15
+ */
16
+ required?: boolean;
17
+ children: JSX.Element;
18
+ };
19
+ export declare function Field(props: FieldProps): JSX.Element;
20
+ export declare namespace Field {
21
+ var Row: (props: {
22
+ children: JSX.Element;
23
+ }) => JSX.Element;
24
+ }
25
+ export type InputProps = {
26
+ value?: string;
27
+ placeholder?: string;
28
+ type?: "text" | "email" | "number" | "search" | "tel" | "url" | "password";
29
+ /** A Tabler icon before the text, such as `search`. */
30
+ icon?: string;
31
+ /** A text of several lines (80 px). */
32
+ multiline?: boolean;
33
+ min?: number;
34
+ max?: number;
35
+ name?: string;
36
+ /** A name when the input stands without a Field, such as a search in a head. */
37
+ label?: string;
38
+ onInput?: (value: string) => void;
39
+ /**
40
+ * A key in the field, such as Enter to search or Escape to clear; the handler may call `preventDefault`. While
41
+ * `event.isComposing` is true the key belongs to an input method (Japanese, Chinese, …): Enter then confirms the
42
+ * characters and must not search.
43
+ */
44
+ onKeyDown?: (event: KeyboardEvent) => void;
45
+ /**
46
+ * The text field itself, to focus it (`input.focus()`) or select its text: `let input; <Input ref={input} />` or a
47
+ * function that takes it.
48
+ */
49
+ ref?: HTMLInputElement | HTMLTextAreaElement | ((element: HTMLInputElement | HTMLTextAreaElement) => void);
50
+ /** At the end inside the field: a symbol, or a ghost icon button such as the filter of a search. */
51
+ end?: JSX.Element;
52
+ };
53
+ /** A round text field: 36 px, 1 px edge, a blue ring on focus. In a field it takes its name and error. */
54
+ export declare const Input: (props: InputProps) => JSX.Element;
55
+ export type SelectProps = {
56
+ options: readonly (string | {
57
+ value: string;
58
+ label: string;
59
+ })[];
60
+ /** The chosen value. With `onChange` the caller holds it; without, the selection keeps the choice itself. */
61
+ value?: string;
62
+ onChange?: (value: string) => void;
63
+ placeholder?: string;
64
+ name?: string;
65
+ label?: string;
66
+ };
67
+ /**
68
+ * The closed shape of a selection: the value and a chevron in the round field. (The list opens with the behaviour
69
+ * layer; until then it is a native select laid over the shape, so it works with the keyboard and in forms.) The
70
+ * shape always shows the value that is chosen now.
71
+ */
72
+ export declare const Select: (props: SelectProps) => JSX.Element;
73
+ export type DateInputProps = {
74
+ value?: string;
75
+ onInput?: (value: string) => void;
76
+ placeholder?: string;
77
+ name?: string;
78
+ label?: string;
79
+ };
80
+ /** The shape of a date field: the date and a calendar symbol. (The picker opens with the behaviour layer.) */
81
+ export declare const DateInput: (props: DateInputProps) => JSX.Element;
82
+ export type CheckProps = {
83
+ label: JSX.Element;
84
+ name?: string;
85
+ /** Set, not set, or mixed (some of a group). */
86
+ checked?: boolean | "mixed";
87
+ /** A switch instead of a box: on and off take effect at once. */
88
+ switch?: boolean;
89
+ disabled?: boolean;
90
+ onChange?: (checked: boolean) => void;
91
+ };
92
+ /**
93
+ * A box, or a switch, with its label. The mark takes exactly one 20 px text line and never aligns by baseline, so it
94
+ * sits on the same pixel empty, set and mixed (guard: mark-geometry).
95
+ */
96
+ export declare const Check: (props: CheckProps) => JSX.Element;
97
+ /** A box without visible words, named for assistive technology (internal: "select all", "select this row"). */
98
+ export declare const MarkCheck: (props: {
99
+ label: string;
100
+ checked?: boolean | "mixed";
101
+ onChange?: (checked: boolean) => void;
102
+ }) => JSX.Element;
103
+ export type ChoiceProps = {
104
+ name: string;
105
+ options: readonly (string | {
106
+ value: string;
107
+ label: string;
108
+ })[];
109
+ value?: string;
110
+ /** The question of the choice when it stands without a Field: shown as the label line of a field of its own. */
111
+ label?: string;
112
+ onChange?: (value: string) => void;
113
+ };
114
+ /**
115
+ * A few visible options, one of which is chosen: round points, each on one 20 px text line. With a `label` and no
116
+ * Field around it, it stands in a field of its own, so its question is visible and names the group.
117
+ */
118
+ export declare const Choice: (props: ChoiceProps) => JSX.Element;
@@ -0,0 +1,18 @@
1
+ export type DescribeV2Options = {
2
+ /**
3
+ * The page is laid out (a real browser): parts without a box are reported as hidden at this width instead of being
4
+ * described, and a table names the columns it dropped. Leave it off for markup without layout, such as a DOM built
5
+ * from server-rendered HTML.
6
+ */
7
+ layout?: boolean;
8
+ };
9
+ /**
10
+ * A short text outline of a v2 screen, read from the `data-k2-part` marks of the primitives: which parts stand where,
11
+ * what they say, how many rows a list or table has, and the problems a person would see (an element no primitive
12
+ * owns, loose text, a group in a group, two primary buttons). It costs a few hundred tokens and needs no picture, so
13
+ * an agent reads it after every change and asks for a screenshot only when the outline leaves a doubt.
14
+ *
15
+ * The function is self-contained (no imports, no outer names), so a test can also run it inside a browser page:
16
+ * `await page.evaluate(\`(${describeV2})(document.body, { layout: true })\`)`.
17
+ */
18
+ export declare function describeV2(root: Element, options?: DescribeV2Options): string;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * `@k2b/ui/v2`: the second generation of `@k2b/ui`, built beside v1.
3
+ *
4
+ * **Provisional until the maintainer approves v2.** Names, props and styles may change in any release until then;
5
+ * no application ships a v2 screen before its screen is approved against the mockup.
6
+ *
7
+ * - Styles: `@k2b/ui/v2.css`, everything below the root class `k2-ui`, in the `k2-` namespace beside v1's `k2b-`.
8
+ * - Primitives own spacing, lines and type. They take no `class`, `style`, `size` or `gap`; free drawing belongs in
9
+ * `Canvas` only. The repository checks `v2-primitive-props`, `v2-app-layout-css` and `v2-no-ui-sdk-outside-ui`
10
+ * enforce this.
11
+ */
12
+ export { Button, type ButtonProps } from "./button";
13
+ export { Digest, type DigestEntry, type DigestProps, Nav, type NavGroup, type NavItem, type NavProps, Notice, type NoticeProps, Path, type PathProps, RecordHead, type RecordHeadProps, type RecordId, type StatusFact, StatusRow, type StatusRowProps, type Step, Steps, type StepsProps, type Tab, Tabs, type TabsProps, } from "./components";
14
+ export { type CellValue, type Column, type Fact, Facts, type FactsProps, Inline, type InlineProps, List, type ListProps, type OpenTarget, Prose, type ProseProps, Row, type RowLines, type RowProps, Table, type TableGroup, type TableProps, Text, type TextProps, } from "./content";
15
+ export { Check, type CheckProps, Choice, type ChoiceProps, DateInput, type DateInputProps, Field, type FieldProps, Input, type InputProps, Select, type SelectProps, } from "./controls";
16
+ export { type DescribeV2Options, describeV2 } from "./describe";
17
+ export { Band, type BandProps, Bar, type BarProps, Canvas, type CanvasProps, type CellProps, Cells, Pane, type PaneProps, type Tile, Tiles, type TilesProps, Workspace, type WorkspaceProps, } from "./layout";
18
+ export { Avatar, type AvatarProps, Chip, type ChipProps, Icon, type IconProps, Progress, type ProgressProps } from "./marks";
19
+ export { Empty, type EmptyProps, Failed, type FailedProps, Loading, type LoadingProps } from "./states";
20
+ export { Group, type GroupProps, Section, type SectionProps } from "./structure";
21
+ export { fontWeights, gripTolerance, hairline, heights, radii, type TypeRole, textEdge, typeRoles } from "./tokens";
22
+ export type { Action, OnNavigate, Person, Status, TwoActions, Width } from "./types";
@@ -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;