@jaetask/toolkit 0.1.0 → 0.2.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/CHANGELOG.md +20 -0
- package/README.md +26 -13
- package/dist/fonts/OFL.txt +93 -0
- package/dist/fonts/inter-latin-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/inter-latin-wght-normal.woff2 +0 -0
- package/dist/forms.d.ts +70 -0
- package/dist/forms.js +56 -0
- package/dist/forms.js.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/page.d.ts +19 -5
- package/dist/page.js +26 -8
- package/dist/page.js.map +1 -1
- package/dist/parts.d.ts +83 -0
- package/dist/parts.js +78 -0
- package/dist/parts.js.map +1 -0
- package/dist/shell.d.ts +25 -6
- package/dist/shell.js +96 -10
- package/dist/shell.js.map +1 -1
- package/dist/styles.css +463 -1
- package/package.json +6 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.2.0
|
|
4
|
+
|
|
5
|
+
- Inter ships with the toolkit: `styles.css` loads it from `fonts/` beside it (SIL Open Font License, `fonts/OFL.txt`). Serve or bundle `dist/fonts` with the styles.
|
|
6
|
+
- Six named colours (`blue`, `teal`, `green`, `amber`, `purple`, `pink`) as `--tk-c-*` tokens with light and dark values; `Chip` and `Avatar` take `colour`.
|
|
7
|
+
- `Avatar` takes `emoji`. Its `colour` is now a named colour, not a CSS value, so it needs no inline style.
|
|
8
|
+
- `Board` and `Column`: columns with a title, kind chip and count; a `ListRow` with `dragId` can be dropped on a column with `onDrop`.
|
|
9
|
+
- `ListRow` takes `as`, `dragId`, `blocked` and `blockedLabel`; its body is a `div`. `ListCard` takes `as`.
|
|
10
|
+
- `Thread`, `Comment` (one level of `replies`), `Reactions` and `ActivityRow`.
|
|
11
|
+
- `Tabs` (buttons or links, with counts), `ChipMultiPicker`, `Composer`, `FilterBar` and `SearchInput`, `Facts`, `Notice` (inline or floating), `FileButton` and `Thumbs`, `Inline` for several controls in one `Row`, and `CenteredPage` for pages outside the shell such as sign-in.
|
|
12
|
+
- Nav items take `count`. Groups take `onReorder`: drag a row, or Alt+Up and Alt+Down on a focused row.
|
|
13
|
+
|
|
14
|
+
- Group items take `children`: each expands and collapses on its own with its own button, several can be open at once, and the shell remembers which ones were left open in this browser. `defaultOpen` sets the first state; `current` marks the row as the current page.
|
|
15
|
+
- `AppShell` takes `bottom`: pages that sit at the bottom of the sidebar, above Settings (for example Archive).
|
|
16
|
+
|
|
17
|
+
## 0.1.0
|
|
18
|
+
|
|
19
|
+
- `AppShell`, the page kit, the UI primitives and the tokens in `styles.css`.
|
|
20
|
+
- The ux-flow skill and `toolkit-guard`.
|
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ One shell and one page kit for every Kit app, so each app looks and works the sa
|
|
|
10
10
|
npm install @jaetask/toolkit react react-dom
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
Import the styles once at the app's root
|
|
13
|
+
Import the styles once at the app's root. They load Inter from `fonts/` beside `styles.css`, so a bundler picks the fonts up, and an app that serves `dist/styles.css` directly serves `dist/fonts` with it:
|
|
14
14
|
|
|
15
15
|
```ts
|
|
16
16
|
import "@jaetask/toolkit/styles.css";
|
|
@@ -80,17 +80,22 @@ With a router, pass its link component and location once:
|
|
|
80
80
|
|
|
81
81
|
## What is in it
|
|
82
82
|
|
|
83
|
-
| Component | Use
|
|
84
|
-
| ----------------------------------------------------------------- |
|
|
85
|
-
| `AppShell` | Sidebar (app mark, pages with icons, small-caps groups with status dots, Settings, search, collapse), top bar and page.
|
|
86
|
-
| `SideSection`, `SideLink` | The sections and links inside the selected group item.
|
|
87
|
-
| `PageBody` | Page title, one line, the one primary action, then stacked panels.
|
|
88
|
-
| `Panel` | A section: warm grey, title, one line, at most one action.
|
|
89
|
-
| `EditLink`, `PageLink`, `PrimaryLink`, `BackLink` | Buttons that open pages; edit links carry `?from=` so the way back returns to the same spot.
|
|
90
|
-
| `Card`, `Kicker`, `ListCard`, `ListRow`, `EmptyCard`, `Chip` | What goes inside a panel.
|
|
91
|
-
| `StatusDot`, `Dot` | Grey not started, orange in progress, green done.
|
|
92
|
-
| `EditFrame`, `Row`, `ChipPicker` | The edit page and its labelled rows.
|
|
93
|
-
| `
|
|
83
|
+
| Component | Use |
|
|
84
|
+
| ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
|
|
85
|
+
| `AppShell` | Sidebar (app mark, pages with icons, small-caps groups with status dots, Settings, search, collapse), top bar and page. |
|
|
86
|
+
| `SideSection`, `SideLink` | The sections and links inside the selected group item. |
|
|
87
|
+
| `PageBody` | Page title, one line, the one primary action, then stacked panels. |
|
|
88
|
+
| `Panel` | A section: warm grey, title, one line, at most one action. |
|
|
89
|
+
| `EditLink`, `PageLink`, `PrimaryLink`, `BackLink` | Buttons that open pages; edit links carry `?from=` so the way back returns to the same spot. |
|
|
90
|
+
| `Card`, `Kicker`, `ListCard`, `ListRow`, `EmptyCard`, `Chip` | What goes inside a panel. |
|
|
91
|
+
| `StatusDot`, `Dot` | Grey not started, orange in progress, green done. |
|
|
92
|
+
| `EditFrame`, `Row`, `ChipPicker` | The edit page and its labelled rows. |
|
|
93
|
+
| `Board`, `Column` | Columns with a title, kind chip and count; drag a `ListRow` (with `dragId`) onto a column. |
|
|
94
|
+
| `Thread`, `Comment`, `Reactions`, `ActivityRow` | Comments with one level of replies, emoji reactions, and activity lines with one action. |
|
|
95
|
+
| `Tabs`, `FilterBar`, `SearchInput` | Above a list: views, search and selects. |
|
|
96
|
+
| `ChipMultiPicker`, `Inline`, `FileButton`, `Thumbs` | On an edit page: pick many, several controls in one row, images. |
|
|
97
|
+
| `Composer`, `Facts`, `Notice`, `CenteredPage` | A one-line input with its button, labelled values, the result of the last change, and a page outside the shell such as sign-in. |
|
|
98
|
+
| `Button`, `Input`, `Textarea`, `Select`, `Label`, `ConfirmDelete` | Primitives. `ConfirmDelete` is the only dialog: permanent delete, confirmed by typing the name. |
|
|
94
99
|
|
|
95
100
|
## The ux-flow skill
|
|
96
101
|
|
|
@@ -113,10 +118,18 @@ npx skills add jaetask/toolkit --skill ux-flow
|
|
|
113
118
|
|
|
114
119
|
A line that must keep a literal ends with the comment `toolkit-guard-allow`.
|
|
115
120
|
|
|
121
|
+
## Colours
|
|
122
|
+
|
|
123
|
+
Six named colours for labels, project colours and avatars: `blue`, `teal`, `green`, `amber`, `purple`, `pink`. Pass the name (`<Chip colour="teal">`), never a CSS value.
|
|
124
|
+
|
|
125
|
+
## Changes
|
|
126
|
+
|
|
127
|
+
Push a branch, never main. A pull request to main opens by itself and merges when the `ci` check passes.
|
|
128
|
+
|
|
116
129
|
## Credit
|
|
117
130
|
|
|
118
131
|
The app shell follows the layout of [agent-native](https://github.com/BuilderIO/agent-native) (MIT, Builder.io).
|
|
119
132
|
|
|
120
133
|
## Licence
|
|
121
134
|
|
|
122
|
-
MIT
|
|
135
|
+
MIT. Inter is under the SIL Open Font License (`fonts/OFL.txt`).
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
Copyright 2016 The Inter Project Authors (https://github.com/rsms/inter) Inter-Italic[opsz,wght].ttf: Copyright 2016 The Inter Project Authors (https://github.com/rsms/inter)
|
|
2
|
+
|
|
3
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
4
|
+
This license is copied below, and is also available with a FAQ at:
|
|
5
|
+
http://scripts.sil.org/OFL
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
-----------------------------------------------------------
|
|
9
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
10
|
+
-----------------------------------------------------------
|
|
11
|
+
|
|
12
|
+
PREAMBLE
|
|
13
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
14
|
+
development of collaborative font projects, to support the font creation
|
|
15
|
+
efforts of academic and linguistic communities, and to provide a free and
|
|
16
|
+
open framework in which fonts may be shared and improved in partnership
|
|
17
|
+
with others.
|
|
18
|
+
|
|
19
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
20
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
21
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
22
|
+
redistributed and/or sold with any software provided that any reserved
|
|
23
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
24
|
+
however, cannot be released under any other type of license. The
|
|
25
|
+
requirement for fonts to remain under this license does not apply
|
|
26
|
+
to any document created using the fonts or their derivatives.
|
|
27
|
+
|
|
28
|
+
DEFINITIONS
|
|
29
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
30
|
+
Holder(s) under this license and clearly marked as such. This may
|
|
31
|
+
include source files, build scripts and documentation.
|
|
32
|
+
|
|
33
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
34
|
+
copyright statement(s).
|
|
35
|
+
|
|
36
|
+
"Original Version" refers to the collection of Font Software components as
|
|
37
|
+
distributed by the Copyright Holder(s).
|
|
38
|
+
|
|
39
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
40
|
+
or substituting -- in part or in whole -- any of the components of the
|
|
41
|
+
Original Version, by changing formats or by porting the Font Software to a
|
|
42
|
+
new environment.
|
|
43
|
+
|
|
44
|
+
"Author" refers to any designer, engineer, programmer, technical
|
|
45
|
+
writer or other person who contributed to the Font Software.
|
|
46
|
+
|
|
47
|
+
PERMISSION & CONDITIONS
|
|
48
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
49
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
50
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
51
|
+
Software, subject to the following conditions:
|
|
52
|
+
|
|
53
|
+
1) Neither the Font Software nor any of its individual components,
|
|
54
|
+
in Original or Modified Versions, may be sold by itself.
|
|
55
|
+
|
|
56
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
57
|
+
redistributed and/or sold with any software, provided that each copy
|
|
58
|
+
contains the above copyright notice and this license. These can be
|
|
59
|
+
included either as stand-alone text files, human-readable headers or
|
|
60
|
+
in the appropriate machine-readable metadata fields within text or
|
|
61
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
62
|
+
|
|
63
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
64
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
|
65
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
|
66
|
+
presented to the users.
|
|
67
|
+
|
|
68
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
69
|
+
Software shall not be used to promote, endorse or advertise any
|
|
70
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
71
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
72
|
+
permission.
|
|
73
|
+
|
|
74
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
|
75
|
+
must be distributed entirely under this license, and must not be
|
|
76
|
+
distributed under any other license. The requirement for fonts to
|
|
77
|
+
remain under this license does not apply to any document created
|
|
78
|
+
using the Font Software.
|
|
79
|
+
|
|
80
|
+
TERMINATION
|
|
81
|
+
This license becomes null and void if any of the above conditions are
|
|
82
|
+
not met.
|
|
83
|
+
|
|
84
|
+
DISCLAIMER
|
|
85
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
86
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
87
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
88
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
89
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
90
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
91
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
92
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
93
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
Binary file
|
|
Binary file
|
package/dist/forms.d.ts
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type Surface } from "./ui.js";
|
|
3
|
+
export type TabOption<T extends string> = {
|
|
4
|
+
id: T;
|
|
5
|
+
name: string;
|
|
6
|
+
count?: number;
|
|
7
|
+
href?: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Tabs above a list. With `href` on each option they are links (the current one marked); without,
|
|
11
|
+
* they are buttons that call onChange.
|
|
12
|
+
*/
|
|
13
|
+
export declare function Tabs<T extends string>({ label, value, options, onChange, }: {
|
|
14
|
+
label: string;
|
|
15
|
+
value: T;
|
|
16
|
+
options: TabOption<T>[];
|
|
17
|
+
onChange?: (value: T) => void;
|
|
18
|
+
}): import("react").JSX.Element;
|
|
19
|
+
/** Pills to pick several values from, on an edit page. */
|
|
20
|
+
export declare function ChipMultiPicker<T extends string>({ label, value, options, onChange, }: {
|
|
21
|
+
label: string;
|
|
22
|
+
value: T[];
|
|
23
|
+
options: {
|
|
24
|
+
id: T;
|
|
25
|
+
name: string;
|
|
26
|
+
}[];
|
|
27
|
+
onChange: (value: T[]) => void;
|
|
28
|
+
}): import("react").JSX.Element;
|
|
29
|
+
/** A one-line input with its button: chat, a quick add, a reply. */
|
|
30
|
+
export declare function Composer({ label, value, onChange, onSubmit, placeholder, button, busy, maxLength, }: {
|
|
31
|
+
label: string;
|
|
32
|
+
value: string;
|
|
33
|
+
onChange: (value: string) => void;
|
|
34
|
+
onSubmit: (value: string) => void;
|
|
35
|
+
placeholder?: string;
|
|
36
|
+
button?: string;
|
|
37
|
+
busy?: boolean;
|
|
38
|
+
maxLength?: number;
|
|
39
|
+
}): import("react").JSX.Element;
|
|
40
|
+
/** The bar above a list: a search box first, then selects and toggles. */
|
|
41
|
+
export declare function FilterBar({ children, label, }: {
|
|
42
|
+
children: ReactNode;
|
|
43
|
+
label?: string;
|
|
44
|
+
}): import("react").JSX.Element;
|
|
45
|
+
/** The search box for a FilterBar. */
|
|
46
|
+
export declare function SearchInput({ value, onChange, label, placeholder, }: {
|
|
47
|
+
value: string;
|
|
48
|
+
onChange: (value: string) => void;
|
|
49
|
+
label?: string;
|
|
50
|
+
placeholder?: string;
|
|
51
|
+
}): import("react").JSX.Element;
|
|
52
|
+
/** A grey button that opens the file picker. */
|
|
53
|
+
export declare function FileButton({ label, onFiles, accept, multiple, disabled, surface, }: {
|
|
54
|
+
label: string;
|
|
55
|
+
onFiles: (files: File[]) => void;
|
|
56
|
+
accept?: string;
|
|
57
|
+
multiple?: boolean;
|
|
58
|
+
disabled?: boolean;
|
|
59
|
+
surface?: Surface;
|
|
60
|
+
}): import("react").JSX.Element;
|
|
61
|
+
/** A grid of image thumbnails, each with a Remove button. */
|
|
62
|
+
export declare function Thumbs({ items, onRemove, removeLabel, }: {
|
|
63
|
+
items: {
|
|
64
|
+
id: string;
|
|
65
|
+
src: string;
|
|
66
|
+
alt: string;
|
|
67
|
+
}[];
|
|
68
|
+
onRemove?: (id: string) => void;
|
|
69
|
+
removeLabel?: string;
|
|
70
|
+
}): import("react").JSX.Element;
|
package/dist/forms.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// Controls for list views and edit pages: tabs, pick-many chips, the composer, the filter bar,
|
|
3
|
+
// and a file button with a thumbnail grid.
|
|
4
|
+
import { useRef } from "react";
|
|
5
|
+
import { Link } from "./link.js";
|
|
6
|
+
import { Button, Input } from "./ui.js";
|
|
7
|
+
/**
|
|
8
|
+
* Tabs above a list. With `href` on each option they are links (the current one marked); without,
|
|
9
|
+
* they are buttons that call onChange.
|
|
10
|
+
*/
|
|
11
|
+
export function Tabs({ label, value, options, onChange, }) {
|
|
12
|
+
const body = (o) => (_jsxs(_Fragment, { children: [o.name, o.count !== undefined && _jsx("span", { className: "tk-count", children: o.count })] }));
|
|
13
|
+
if (options.every((o) => o.href))
|
|
14
|
+
return (_jsx("nav", { className: "tk-tabs", "aria-label": label, children: options.map((o) => (_jsx(Link, { href: o.href ?? "", className: "tk-tab", "aria-current": o.id === value ? "page" : undefined, children: body(o) }, o.id))) }));
|
|
15
|
+
return (_jsx("div", { className: "tk-tabs", role: "tablist", "aria-label": label, children: options.map((o) => (_jsx("button", { type: "button", role: "tab", className: "tk-tab", "aria-selected": o.id === value, onClick: () => onChange?.(o.id), children: body(o) }, o.id))) }));
|
|
16
|
+
}
|
|
17
|
+
/** Pills to pick several values from, on an edit page. */
|
|
18
|
+
export function ChipMultiPicker({ label, value, options, onChange, }) {
|
|
19
|
+
const on = new Set(value);
|
|
20
|
+
return (
|
|
21
|
+
// biome-ignore lint/a11y/useSemanticElements: a row of toggle pills, not a fieldset of inputs
|
|
22
|
+
_jsx("div", { role: "group", "aria-label": label, className: "tk-chips", children: options.map((o) => (_jsx("button", { type: "button", className: "tk-pick", "aria-pressed": on.has(o.id), onClick: () => onChange(on.has(o.id) ? value.filter((v) => v !== o.id) : [...value, o.id]), children: o.name }, o.id))) }));
|
|
23
|
+
}
|
|
24
|
+
/** A one-line input with its button: chat, a quick add, a reply. */
|
|
25
|
+
export function Composer({ label, value, onChange, onSubmit, placeholder, button = "Send", busy, maxLength, }) {
|
|
26
|
+
const submit = (e) => {
|
|
27
|
+
e.preventDefault();
|
|
28
|
+
const text = value.trim();
|
|
29
|
+
if (text && !busy)
|
|
30
|
+
onSubmit(text);
|
|
31
|
+
};
|
|
32
|
+
return (_jsxs("form", { className: "tk-composer", onSubmit: submit, children: [_jsx(Input, { "aria-label": label, value: value, placeholder: placeholder, maxLength: maxLength, onChange: (e) => onChange(e.target.value) }), _jsx(Button, { type: "submit", variant: "primary", disabled: busy || !value.trim(), children: button })] }));
|
|
33
|
+
}
|
|
34
|
+
/** The bar above a list: a search box first, then selects and toggles. */
|
|
35
|
+
export function FilterBar({ children, label = "Filters", }) {
|
|
36
|
+
return (
|
|
37
|
+
// biome-ignore lint/a11y/useSemanticElements: a toolbar of filters, not a form that submits
|
|
38
|
+
_jsx("div", { className: "tk-filter", role: "group", "aria-label": label, children: children }));
|
|
39
|
+
}
|
|
40
|
+
/** The search box for a FilterBar. */
|
|
41
|
+
export function SearchInput({ value, onChange, label = "Search", placeholder = "Search", }) {
|
|
42
|
+
return (_jsx(Input, { type: "search", className: "tk-search", "aria-label": label, placeholder: placeholder, value: value, onChange: (e) => onChange(e.target.value) }));
|
|
43
|
+
}
|
|
44
|
+
/** A grey button that opens the file picker. */
|
|
45
|
+
export function FileButton({ label, onFiles, accept = "image/png,image/jpeg,image/webp", multiple, disabled, surface = "white", }) {
|
|
46
|
+
const ref = useRef(null);
|
|
47
|
+
return (_jsxs(_Fragment, { children: [_jsx(Button, { surface: surface, disabled: disabled ?? false, onClick: () => ref.current?.click(), children: label }), _jsx("input", { ref: ref, type: "file", hidden: true, accept: accept, multiple: multiple, onChange: (e) => {
|
|
48
|
+
onFiles(Array.from(e.target.files ?? []));
|
|
49
|
+
e.target.value = "";
|
|
50
|
+
} })] }));
|
|
51
|
+
}
|
|
52
|
+
/** A grid of image thumbnails, each with a Remove button. */
|
|
53
|
+
export function Thumbs({ items, onRemove, removeLabel = "Remove", }) {
|
|
54
|
+
return (_jsx("ul", { className: "tk-thumbs", children: items.map((t) => (_jsxs("li", { className: "tk-thumb", children: [_jsx("img", { src: t.src, alt: t.alt, loading: "lazy" }), onRemove && (_jsx("button", { type: "button", className: "tk-thumb-remove", "aria-label": `${removeLabel} ${t.alt}`, onClick: () => onRemove(t.id), children: removeLabel }))] }, t.id))) }));
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=forms.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
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E,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,YAE5B,WAAW,GACL,CACV,KAXM,CAAC,CAAC,EAAE,CAYR,CACN,CAAC,GACC,CACN,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { type LinkComponent, type LinkProps, Link, safeFrom, ToolkitProvider, useBackTo, useFromHref, withFrom, } from "./link.js";
|
|
2
|
-
export { BackLink, Card, Chip, ChipPicker, Dot, EditFrame, EditLink, EmptyCard, Kicker, ListCard, ListRow, PageBody, PageLink, Panel, PrimaryLink, type Progress, Row, StatusDot, } from "./page.js";
|
|
2
|
+
export { BackLink, Card, Chip, ChipPicker, Dot, EditFrame, EditLink, EmptyCard, Kicker, ListCard, ListRow, PageBody, PageLink, Panel, PrimaryLink, type Progress, ROW_DRAG_TYPE, Row, StatusDot, COLOURS, type Colour, } from "./page.js";
|
|
3
|
+
export { ActivityRow, Board, CenteredPage, Column, Comment, Facts, Inline, Notice, type NoticeTone, Reactions, Thread, } from "./parts.js";
|
|
4
|
+
export { ChipMultiPicker, Composer, FileButton, FilterBar, SearchInput, type TabOption, Tabs, Thumbs, } from "./forms.js";
|
|
3
5
|
export { AppShell, Avatar, type Group, type GroupItem, type NavItem, SideLink, SideSection, } from "./shell.js";
|
|
4
6
|
export { Button, type ButtonVariant, ConfirmDelete, cx, Input, Label, Select, type Surface, Textarea, } from "./ui.js";
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { Link, safeFrom, ToolkitProvider, useBackTo, useFromHref, withFrom, } from "./link.js";
|
|
2
|
-
export { BackLink, Card, Chip, ChipPicker, Dot, EditFrame, EditLink, EmptyCard, Kicker, ListCard, ListRow, PageBody, PageLink, Panel, PrimaryLink, Row, StatusDot, } from "./page.js";
|
|
2
|
+
export { BackLink, Card, Chip, ChipPicker, Dot, EditFrame, EditLink, EmptyCard, Kicker, ListCard, ListRow, PageBody, PageLink, Panel, PrimaryLink, ROW_DRAG_TYPE, Row, StatusDot, COLOURS, } from "./page.js";
|
|
3
|
+
export { ActivityRow, Board, CenteredPage, Column, Comment, Facts, Inline, Notice, Reactions, Thread, } from "./parts.js";
|
|
4
|
+
export { ChipMultiPicker, Composer, FileButton, FilterBar, SearchInput, Tabs, Thumbs, } from "./forms.js";
|
|
3
5
|
export { AppShell, Avatar, SideLink, SideSection, } from "./shell.js";
|
|
4
6
|
export { Button, ConfirmDelete, cx, Input, Label, Select, Textarea, } from "./ui.js";
|
|
5
7
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,IAAI,EACJ,QAAQ,EACR,eAAe,EACf,SAAS,EACT,WAAW,EACX,QAAQ,GACT,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,GAAG,EACH,SAAS,EACT,QAAQ,EACR,SAAS,EACT,MAAM,EACN,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,WAAW,EAEX,GAAG,EACH,SAAS,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,IAAI,EACJ,QAAQ,EACR,eAAe,EACf,SAAS,EACT,WAAW,EACX,QAAQ,GACT,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,GAAG,EACH,SAAS,EACT,QAAQ,EACR,SAAS,EACT,MAAM,EACN,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,WAAW,EAEX,aAAa,EACb,GAAG,EACH,SAAS,EACT,OAAO,GAER,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,WAAW,EACX,KAAK,EACL,YAAY,EACZ,MAAM,EACN,OAAO,EACP,KAAK,EACL,MAAM,EACN,MAAM,EAEN,SAAS,EACT,MAAM,GACP,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,eAAe,EACf,QAAQ,EACR,UAAU,EACV,SAAS,EACT,WAAW,EAEX,IAAI,EACJ,MAAM,GACP,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,QAAQ,EACR,MAAM,EAIN,QAAQ,EACR,WAAW,GACZ,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,MAAM,EAEN,aAAa,EACb,EAAE,EACF,KAAK,EACL,KAAK,EACL,MAAM,EAEN,QAAQ,GACT,MAAM,SAAS,CAAC"}
|
package/dist/page.d.ts
CHANGED
|
@@ -47,14 +47,24 @@ export declare function BackLink({ to }: {
|
|
|
47
47
|
to: string;
|
|
48
48
|
}): import("react").JSX.Element;
|
|
49
49
|
/** A list: one white card of divided rows. */
|
|
50
|
-
export declare function ListCard({ children }: {
|
|
50
|
+
export declare function ListCard({ children, as, }: {
|
|
51
51
|
children: ReactNode;
|
|
52
|
+
as?: "ul" | "ol" | "div";
|
|
52
53
|
}): import("react").JSX.Element;
|
|
53
|
-
/**
|
|
54
|
-
export declare
|
|
54
|
+
/** The drag type the toolkit uses for rows; Column reads it on drop. */
|
|
55
|
+
export declare const ROW_DRAG_TYPE = "application/x-tk-row";
|
|
56
|
+
/**
|
|
57
|
+
* One list row. With `to`, the row opens its own page. With `dragId`, the row can be dragged onto
|
|
58
|
+
* a Column. `blocked` marks it as waiting on something, with a word you can change.
|
|
59
|
+
*/
|
|
60
|
+
export declare function ListRow({ to, children, aside, as, dragId, blocked, blockedLabel, }: {
|
|
55
61
|
to?: string;
|
|
56
62
|
children: ReactNode;
|
|
57
63
|
aside?: ReactNode;
|
|
64
|
+
as?: "li" | "div" | "article";
|
|
65
|
+
dragId?: string;
|
|
66
|
+
blocked?: boolean;
|
|
67
|
+
blockedLabel?: string;
|
|
58
68
|
}): import("react").JSX.Element;
|
|
59
69
|
/** An empty section: a dashed card, one sentence on how to fill it, one button. */
|
|
60
70
|
export declare function EmptyCard({ text, action }: {
|
|
@@ -71,9 +81,13 @@ export declare function StatusDot({ status, label }: {
|
|
|
71
81
|
status: Progress;
|
|
72
82
|
label?: string;
|
|
73
83
|
}): import("react").JSX.Element;
|
|
74
|
-
/**
|
|
75
|
-
export declare
|
|
84
|
+
/** The six named colours for labels, project colours and avatars. */
|
|
85
|
+
export declare const COLOURS: readonly ["blue", "teal", "green", "amber", "purple", "pink"];
|
|
86
|
+
export type Colour = (typeof COLOURS)[number];
|
|
87
|
+
/** A pill value: a label, a kind or a state, in any word. `colour` picks one of the six. */
|
|
88
|
+
export declare function Chip({ children, colour }: {
|
|
76
89
|
children: ReactNode;
|
|
90
|
+
colour?: Colour;
|
|
77
91
|
}): import("react").JSX.Element;
|
|
78
92
|
/** Pills to pick one value from, on an edit page. */
|
|
79
93
|
export declare function ChipPicker<T extends string>({ value, options, onChange, label, }: {
|
package/dist/page.js
CHANGED
|
@@ -41,13 +41,29 @@ export function BackLink({ to }) {
|
|
|
41
41
|
return (_jsx(ButtonLink, { href: to, surface: "white", children: "Back" }));
|
|
42
42
|
}
|
|
43
43
|
/** A list: one white card of divided rows. */
|
|
44
|
-
export function ListCard({ children }) {
|
|
45
|
-
|
|
44
|
+
export function ListCard({ children, as = "ul", }) {
|
|
45
|
+
const Tag = as;
|
|
46
|
+
return _jsx(Tag, { className: "tk-list", children: children });
|
|
46
47
|
}
|
|
47
|
-
/**
|
|
48
|
-
export
|
|
48
|
+
/** The drag type the toolkit uses for rows; Column reads it on drop. */
|
|
49
|
+
export const ROW_DRAG_TYPE = "application/x-tk-row";
|
|
50
|
+
/**
|
|
51
|
+
* One list row. With `to`, the row opens its own page. With `dragId`, the row can be dragged onto
|
|
52
|
+
* a Column. `blocked` marks it as waiting on something, with a word you can change.
|
|
53
|
+
*/
|
|
54
|
+
export function ListRow({ to, children, aside, as = "li", dragId, blocked, blockedLabel = "Blocked", }) {
|
|
49
55
|
const href = useFromHref(to ?? "");
|
|
50
|
-
|
|
56
|
+
const Tag = as;
|
|
57
|
+
const drag = dragId
|
|
58
|
+
? {
|
|
59
|
+
draggable: true,
|
|
60
|
+
onDragStart: (e) => {
|
|
61
|
+
e.dataTransfer.setData(ROW_DRAG_TYPE, dragId);
|
|
62
|
+
e.dataTransfer.effectAllowed = "move";
|
|
63
|
+
},
|
|
64
|
+
}
|
|
65
|
+
: {};
|
|
66
|
+
return (_jsxs(Tag, { className: "tk-list-row", "data-blocked": blocked ? "true" : undefined, ...drag, children: [to ? (_jsx(Link, { href: href, className: "tk-list-body", draggable: dragId ? false : undefined, children: children })) : (_jsx("div", { className: "tk-list-body", children: children })), (aside || blocked) && (_jsxs("span", { className: "tk-list-aside", children: [blocked && _jsx(Chip, { colour: "amber", children: blockedLabel }), aside] }))] }));
|
|
51
67
|
}
|
|
52
68
|
/** An empty section: a dashed card, one sentence on how to fill it, one button. */
|
|
53
69
|
export function EmptyCard({ text, action }) {
|
|
@@ -66,9 +82,11 @@ export function Dot({ status }) {
|
|
|
66
82
|
export function StatusDot({ status, label }) {
|
|
67
83
|
return (_jsxs("span", { className: "tk-status", children: [_jsx(Dot, { status: status }), label ?? WORD[status]] }));
|
|
68
84
|
}
|
|
69
|
-
/**
|
|
70
|
-
export
|
|
71
|
-
|
|
85
|
+
/** The six named colours for labels, project colours and avatars. */
|
|
86
|
+
export const COLOURS = ["blue", "teal", "green", "amber", "purple", "pink"];
|
|
87
|
+
/** A pill value: a label, a kind or a state, in any word. `colour` picks one of the six. */
|
|
88
|
+
export function Chip({ children, colour }) {
|
|
89
|
+
return (_jsx("span", { className: "tk-chip", "data-colour": colour, children: children }));
|
|
72
90
|
}
|
|
73
91
|
/** Pills to pick one value from, on an edit page. */
|
|
74
92
|
export function ChipPicker({ value, options, onChange, label, }) {
|
package/dist/page.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page.js","sour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page.js";
|
|
3
|
+
/** Columns side by side, scrolling sideways when they do not fit. */
|
|
4
|
+
export declare function Board({ children, label }: {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
label?: string;
|
|
7
|
+
}): import("react").JSX.Element;
|
|
8
|
+
/**
|
|
9
|
+
* One column: a title, an optional kind chip and count, then its rows. With `onDrop`, a ListRow
|
|
10
|
+
* that has a `dragId` can be dropped here, and onDrop gets that id.
|
|
11
|
+
*/
|
|
12
|
+
export declare function Column({ id, title, kind, count, action, empty, onDrop, children, }: {
|
|
13
|
+
id: string;
|
|
14
|
+
title: string;
|
|
15
|
+
kind?: ReactNode;
|
|
16
|
+
count?: number;
|
|
17
|
+
action?: ReactNode;
|
|
18
|
+
empty?: ReactNode;
|
|
19
|
+
onDrop?: (rowId: string) => void;
|
|
20
|
+
children?: ReactNode;
|
|
21
|
+
}): import("react").JSX.Element;
|
|
22
|
+
/** A run of comments and activity lines, oldest first. */
|
|
23
|
+
export declare function Thread({ children, label }: {
|
|
24
|
+
children: ReactNode;
|
|
25
|
+
label?: string;
|
|
26
|
+
}): import("react").JSX.Element;
|
|
27
|
+
/**
|
|
28
|
+
* One comment: author, time, text, then reactions and actions. `replies` holds one level of
|
|
29
|
+
* reply Comments; a reply's own replies are not shown.
|
|
30
|
+
*/
|
|
31
|
+
export declare function Comment({ author, avatar, time, reactions, actions, replies, children, }: {
|
|
32
|
+
author: string;
|
|
33
|
+
avatar?: ReactNode;
|
|
34
|
+
time?: string;
|
|
35
|
+
reactions?: ReactNode;
|
|
36
|
+
actions?: ReactNode;
|
|
37
|
+
replies?: ReactNode;
|
|
38
|
+
children: ReactNode;
|
|
39
|
+
}): import("react").JSX.Element;
|
|
40
|
+
/** Emoji reactions under a comment; the person's own are pressed. */
|
|
41
|
+
export declare function Reactions({ items, onToggle, }: {
|
|
42
|
+
items: {
|
|
43
|
+
emoji: string;
|
|
44
|
+
count: number;
|
|
45
|
+
mine?: boolean;
|
|
46
|
+
}[];
|
|
47
|
+
onToggle?: (emoji: string) => void;
|
|
48
|
+
}): import("react").JSX.Element;
|
|
49
|
+
/** One line of activity in a thread (a move, a status change), with at most one action. */
|
|
50
|
+
export declare function ActivityRow({ children, time, action, }: {
|
|
51
|
+
children: ReactNode;
|
|
52
|
+
time?: string;
|
|
53
|
+
action?: ReactNode;
|
|
54
|
+
}): import("react").JSX.Element;
|
|
55
|
+
/** Small-caps labels with their values, in a white card. */
|
|
56
|
+
export declare function Facts({ items }: {
|
|
57
|
+
items: {
|
|
58
|
+
label: string;
|
|
59
|
+
value: ReactNode;
|
|
60
|
+
}[];
|
|
61
|
+
}): import("react").JSX.Element;
|
|
62
|
+
export type NoticeTone = "done" | "refused" | "info";
|
|
63
|
+
/**
|
|
64
|
+
* What the last change did, or why it was refused. Inline by default; `floating` pins it to the
|
|
65
|
+
* bottom of the window. A refusal is amber, never red.
|
|
66
|
+
*/
|
|
67
|
+
export declare function Notice({ tone, floating, onDismiss, children, }: {
|
|
68
|
+
tone?: NoticeTone;
|
|
69
|
+
floating?: boolean;
|
|
70
|
+
onDismiss?: () => void;
|
|
71
|
+
children: ReactNode;
|
|
72
|
+
}): import("react").JSX.Element;
|
|
73
|
+
/** A page outside the shell, such as sign-in: one panel in the middle of the window. */
|
|
74
|
+
export declare function CenteredPage({ title, line, children, }: {
|
|
75
|
+
title: string;
|
|
76
|
+
line?: ReactNode;
|
|
77
|
+
children: ReactNode;
|
|
78
|
+
}): import("react").JSX.Element;
|
|
79
|
+
/** Several controls side by side inside one Row. */
|
|
80
|
+
export declare function Inline({ children }: {
|
|
81
|
+
children: ReactNode;
|
|
82
|
+
}): import("react").JSX.Element;
|
|
83
|
+
export type { Colour };
|