@jaetask/toolkit 0.3.1 → 0.3.2
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 +4 -1
- package/package.json +1 -1
- package/dist/fonts/OFL.txt +0 -93
- 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 +0 -70
- package/dist/forms.js +0 -56
- package/dist/forms.js.map +0 -1
- package/dist/link.d.ts +0 -22
- package/dist/link.js +0 -45
- package/dist/link.js.map +0 -1
- package/dist/page.d.ts +0 -122
- package/dist/page.js +0 -108
- package/dist/page.js.map +0 -1
- package/dist/parts.d.ts +0 -83
- package/dist/parts.js +0 -78
- package/dist/parts.js.map +0 -1
- package/dist/shell.d.ts +0 -85
- package/dist/shell.js +0 -143
- package/dist/shell.js.map +0 -1
- package/dist/ui.d.ts +0 -26
- package/dist/ui.js +0 -37
- package/dist/ui.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## 0.3.
|
|
3
|
+
## 0.3.2
|
|
4
4
|
|
|
5
5
|
- `PropertyPicker`: the search line runs the full width; `anchor`, `side` and `align` open the list from a fixed part and a chosen side.
|
|
6
6
|
- Suite: `MarkdownText`, Markdown shown as text with headings, lists, code, links and the app's own pictures. A picture from another site is shown as a link.
|
|
@@ -13,6 +13,9 @@
|
|
|
13
13
|
- Suite: `ViewToggle`, the icon buttons that choose how a board is grouped, and `PropertyPills`, on and off pills such as the properties a card shows.
|
|
14
14
|
- Suite: links to other sites. `ServiceIcon` (YouTube, GitHub, Figma, Notion, or a plain link), `service`, `knownService` and `linkHost` name a link's site, and `AddLinkDialog` asks for an address and an optional title.
|
|
15
15
|
- Suite: `PropertyPicker`, a row that opens a searchable list in a popover (a key that opens it, number keys, pick several with the chosen ones above a line, create from what was typed), and `RailRow`, the quiet row it opens from.
|
|
16
|
+
|
|
17
|
+
## 0.3.1
|
|
18
|
+
|
|
16
19
|
- Select's highlighted row is light grey (`focus:bg-accent`), with the tick on the chosen one; the emoji search says "Search emoji...".
|
|
17
20
|
- Suite: the agent-native Content app's emoji reactions: `EmojiPickerPanel` (search, then the categories), `filterEmojiCategories`, `CommentReactionChips`, `AddReactionButton` (quick reactions, then the searchable panel, in a Popover) and `CommentIconButton`.
|
|
18
21
|
- `@jaetask/toolkit/editor` (and `/editor/*`, `/editor.css`): agent-native's Notion-style editor on Tiptap 3.28: SharedRichEditor, RichMarkdownEditor (Markdown in and out), SlashCommandMenu with DEFAULT_SLASH_COMMANDS, BubbleToolbar, code blocks with lowlight, images and the rest, with `/collab-ui` for its optional collaboration parts.
|
package/package.json
CHANGED
package/dist/fonts/OFL.txt
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
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
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
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
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
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
|
package/dist/forms.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"forms.js","sourceRoot":"","sources":["../src/forms.tsx"],"names":[],"mappings":";AAAA,+FAA+F;AAC/F,2CAA2C;AAC3C,OAAO,EAAkC,MAAM,EAAE,MAAM,OAAO,CAAC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dist/link.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { type AnchorHTMLAttributes, type ReactNode } from "react";
|
|
2
|
-
export type LinkProps = Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "href"> & {
|
|
3
|
-
href: string;
|
|
4
|
-
children?: ReactNode;
|
|
5
|
-
};
|
|
6
|
-
export type LinkComponent = (props: LinkProps) => ReactNode;
|
|
7
|
-
/** Gives the toolkit the app's router: its link component and its current location. */
|
|
8
|
-
export declare function ToolkitProvider({ link, location, children, }: {
|
|
9
|
-
link?: LinkComponent;
|
|
10
|
-
location?: string | (() => string);
|
|
11
|
-
children: ReactNode;
|
|
12
|
-
}): import("react").JSX.Element;
|
|
13
|
-
/** The app's link component. */
|
|
14
|
-
export declare function Link(props: LinkProps): import("react").JSX.Element;
|
|
15
|
-
/** `to` with ?from= set to the given location. */
|
|
16
|
-
export declare function withFrom(to: string, from: string): string;
|
|
17
|
-
/** `to` with ?from= set to the current location. */
|
|
18
|
-
export declare function useFromHref(to: string): string;
|
|
19
|
-
/** A ?from= value that is safe to follow: a same-origin path. */
|
|
20
|
-
export declare function safeFrom(from: string | null | undefined): string | null;
|
|
21
|
-
/** Where an edit page's Back goes: the ?from= path when it is safe, else the fallback. */
|
|
22
|
-
export declare function useBackTo(fallback: string): string;
|
package/dist/link.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
// Links and the way back. Every link the toolkit draws goes through one Link component, so an app
|
|
3
|
-
// with a router (React Router, TanStack) passes its own, and an app without one gets a plain <a>.
|
|
4
|
-
// Edit links carry ?from= so the edit page's Back, Cancel and Save return to the same spot.
|
|
5
|
-
import { createContext, useContext } from "react";
|
|
6
|
-
const PlainLink = ({ href, children, ...rest }) => (_jsx("a", { href: href, ...rest, children: children }));
|
|
7
|
-
const browserLocation = () => typeof window === "undefined" ? "" : window.location.pathname + window.location.search;
|
|
8
|
-
const RoutingContext = createContext({ link: PlainLink, location: browserLocation });
|
|
9
|
-
/** Gives the toolkit the app's router: its link component and its current location. */
|
|
10
|
-
export function ToolkitProvider({ link, location, children, }) {
|
|
11
|
-
const value = {
|
|
12
|
-
link: link ?? PlainLink,
|
|
13
|
-
location: typeof location === "string" ? () => location : (location ?? browserLocation),
|
|
14
|
-
};
|
|
15
|
-
return _jsx(RoutingContext.Provider, { value: value, children: children });
|
|
16
|
-
}
|
|
17
|
-
/** The app's link component. */
|
|
18
|
-
export function Link(props) {
|
|
19
|
-
const { link: L } = useContext(RoutingContext);
|
|
20
|
-
return _jsx(L, { ...props });
|
|
21
|
-
}
|
|
22
|
-
/** `to` with ?from= set to the given location. */
|
|
23
|
-
export function withFrom(to, from) {
|
|
24
|
-
if (!from)
|
|
25
|
-
return to;
|
|
26
|
-
return `${to}${to.includes("?") ? "&" : "?"}from=${encodeURIComponent(from)}`;
|
|
27
|
-
}
|
|
28
|
-
/** `to` with ?from= set to the current location. */
|
|
29
|
-
export function useFromHref(to) {
|
|
30
|
-
const { location } = useContext(RoutingContext);
|
|
31
|
-
return withFrom(to, location());
|
|
32
|
-
}
|
|
33
|
-
/** A ?from= value that is safe to follow: a same-origin path. */
|
|
34
|
-
export function safeFrom(from) {
|
|
35
|
-
if (!from)
|
|
36
|
-
return null;
|
|
37
|
-
return from.startsWith("/") && !from.startsWith("//") && !from.includes("\\") ? from : null;
|
|
38
|
-
}
|
|
39
|
-
/** Where an edit page's Back goes: the ?from= path when it is safe, else the fallback. */
|
|
40
|
-
export function useBackTo(fallback) {
|
|
41
|
-
const { location } = useContext(RoutingContext);
|
|
42
|
-
const query = location().split("?")[1] ?? "";
|
|
43
|
-
return safeFrom(new URLSearchParams(query).get("from")) ?? fallback;
|
|
44
|
-
}
|
|
45
|
-
//# sourceMappingURL=link.js.map
|
package/dist/link.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"link.js","sourceRoot":"","sources":["../src/link.tsx"],"names":[],"mapp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AAI,CAAC,IAAI;QAAE,OAAO,EAAE,CAAC;IACrB,OAAO,GAAG,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,QAAQ,kBAAkB,CAAC,IAAI,CAAC,EAAE,CAAC;AAChF,CAAC;AAED,oDAAoD;AACpD,MAAM,UAAU,WAAW,CAAC,EAAU;IACpC,MAAM,EAAE,QAAQ,EAAE,GAAG,UAAU,CAAC,cAAc,CAAC,CAAC;IAChD,OAAO,QAAQ,CAAC,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;AAClC,CAAC;AAED,iEAAiE;AACjE,MAAM,UAAU,QAAQ,CAAC,IAA+B;IACtD,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IACvB,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;AAC9F,CAAC;AAED,0FAA0F;AAC1F,MAAM,UAAU,SAAS,CAAC,QAAgB;IACxC,MAAM,EAAE,QAAQ,EAAE,GAAG,UAAU,CAAC,cAAc,CAAC,CAAC;IAChD,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAC7C,OAAO,QAAQ,CAAC,IAAI,eAAe,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,QAAQ,CAAC;AACtE,CAAC"}
|
package/dist/page.d.ts
DELETED
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
|
-
import { type Surface } from "./ui.js";
|
|
3
|
-
/** A page: title, one line, the one primary action on the right, then stacked panels. */
|
|
4
|
-
export declare function PageBody({ title, line, action, children, }: {
|
|
5
|
-
title: string;
|
|
6
|
-
line?: ReactNode;
|
|
7
|
-
action?: ReactNode;
|
|
8
|
-
children: ReactNode;
|
|
9
|
-
}): import("react").JSX.Element;
|
|
10
|
-
/** A section: warm grey panel, title, one line on what it holds, at most one action on the right. */
|
|
11
|
-
export declare function Panel({ id, title, line, action, children, }: {
|
|
12
|
-
id: string;
|
|
13
|
-
title: string;
|
|
14
|
-
line?: ReactNode;
|
|
15
|
-
action?: ReactNode;
|
|
16
|
-
children: ReactNode;
|
|
17
|
-
}): import("react").JSX.Element;
|
|
18
|
-
/** A white card inside a panel. */
|
|
19
|
-
export declare function Card({ children, className }: {
|
|
20
|
-
children: ReactNode;
|
|
21
|
-
className?: string;
|
|
22
|
-
}): import("react").JSX.Element;
|
|
23
|
-
/** A small-caps label above a value inside a card. */
|
|
24
|
-
export declare function Kicker({ children }: {
|
|
25
|
-
children: ReactNode;
|
|
26
|
-
}): import("react").JSX.Element;
|
|
27
|
-
/** A grey button that opens another page and remembers this one as ?from=. */
|
|
28
|
-
export declare function PageLink({ to, children, disabled, surface, }: {
|
|
29
|
-
to: string;
|
|
30
|
-
children: ReactNode;
|
|
31
|
-
disabled?: boolean;
|
|
32
|
-
surface?: Surface;
|
|
33
|
-
}): import("react").JSX.Element;
|
|
34
|
-
/** A panel's one Edit button: opens that section's own edit page. */
|
|
35
|
-
export declare function EditLink({ to, label, disabled, }: {
|
|
36
|
-
to: string;
|
|
37
|
-
label?: string;
|
|
38
|
-
disabled?: boolean;
|
|
39
|
-
}): import("react").JSX.Element;
|
|
40
|
-
/** The page's one dark button. */
|
|
41
|
-
export declare function PrimaryLink({ to, children }: {
|
|
42
|
-
to: string;
|
|
43
|
-
children: ReactNode;
|
|
44
|
-
}): import("react").JSX.Element;
|
|
45
|
-
/** Back to where you came from: the same pill on every page that has one. */
|
|
46
|
-
export declare function BackLink({ to }: {
|
|
47
|
-
to: string;
|
|
48
|
-
}): import("react").JSX.Element;
|
|
49
|
-
/** A list: one white card of divided rows. */
|
|
50
|
-
export declare function ListCard({ children, as, }: {
|
|
51
|
-
children: ReactNode;
|
|
52
|
-
as?: "ul" | "ol" | "div";
|
|
53
|
-
}): import("react").JSX.Element;
|
|
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, }: {
|
|
61
|
-
to?: string;
|
|
62
|
-
children: ReactNode;
|
|
63
|
-
aside?: ReactNode;
|
|
64
|
-
as?: "li" | "div" | "article";
|
|
65
|
-
dragId?: string;
|
|
66
|
-
blocked?: boolean;
|
|
67
|
-
blockedLabel?: string;
|
|
68
|
-
}): import("react").JSX.Element;
|
|
69
|
-
/** An empty section: a dashed card, one sentence on how to fill it, one button. */
|
|
70
|
-
export declare function EmptyCard({ text, action }: {
|
|
71
|
-
text: string;
|
|
72
|
-
action?: ReactNode;
|
|
73
|
-
}): import("react").JSX.Element;
|
|
74
|
-
export type Progress = "not-started" | "in-progress" | "done";
|
|
75
|
-
/** A bare status dot, for sidebars and tight rows. */
|
|
76
|
-
export declare function Dot({ status }: {
|
|
77
|
-
status: Progress;
|
|
78
|
-
}): import("react").JSX.Element;
|
|
79
|
-
/** Status as a dot and a word: grey not started, orange in progress, green done. Never red. */
|
|
80
|
-
export declare function StatusDot({ status, label }: {
|
|
81
|
-
status: Progress;
|
|
82
|
-
label?: string;
|
|
83
|
-
}): import("react").JSX.Element;
|
|
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 }: {
|
|
89
|
-
children: ReactNode;
|
|
90
|
-
colour?: Colour;
|
|
91
|
-
}): import("react").JSX.Element;
|
|
92
|
-
/** Pills to pick one value from, on an edit page. */
|
|
93
|
-
export declare function ChipPicker<T extends string>({ value, options, onChange, label, }: {
|
|
94
|
-
value: T;
|
|
95
|
-
options: {
|
|
96
|
-
id: T;
|
|
97
|
-
name: string;
|
|
98
|
-
}[];
|
|
99
|
-
onChange: (value: T) => void;
|
|
100
|
-
label: string;
|
|
101
|
-
}): import("react").JSX.Element;
|
|
102
|
-
/**
|
|
103
|
-
* One edit page: title and Back, a white card of labelled Rows, then Cancel and Save. Without
|
|
104
|
-
* onSave (changes save as you go) the bar shows Done.
|
|
105
|
-
*/
|
|
106
|
-
export declare function EditFrame({ title, line, backTo, children, onSave, busy, saveLabel, extra, }: {
|
|
107
|
-
title: string;
|
|
108
|
-
line?: ReactNode;
|
|
109
|
-
backTo: string;
|
|
110
|
-
children: ReactNode;
|
|
111
|
-
onSave?: () => void;
|
|
112
|
-
busy?: boolean;
|
|
113
|
-
saveLabel?: string;
|
|
114
|
-
extra?: ReactNode;
|
|
115
|
-
}): import("react").JSX.Element;
|
|
116
|
-
/** A labelled row on an edit page: label and one line on the left, the inputs on the right. */
|
|
117
|
-
export declare function Row({ title, line, htmlFor, children, }: {
|
|
118
|
-
title: string;
|
|
119
|
-
line?: string;
|
|
120
|
-
htmlFor?: string;
|
|
121
|
-
children: ReactNode;
|
|
122
|
-
}): import("react").JSX.Element;
|
package/dist/page.js
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { Link, useFromHref } from "./link.js";
|
|
3
|
-
import { Button, cx } from "./ui.js";
|
|
4
|
-
/** A page: title, one line, the one primary action on the right, then stacked panels. */
|
|
5
|
-
export function PageBody({ title, line, action, children, }) {
|
|
6
|
-
return (_jsxs("div", { className: "tk-page", children: [_jsxs("div", { className: "tk-page-head", children: [_jsxs("div", { children: [_jsx("h1", { className: "tk-page-title", children: title }), line && _jsx("p", { className: "tk-page-line", children: line })] }), action] }), children] }));
|
|
7
|
-
}
|
|
8
|
-
/** A section: warm grey panel, title, one line on what it holds, at most one action on the right. */
|
|
9
|
-
export function Panel({ id, title, line, action, children, }) {
|
|
10
|
-
return (_jsxs("section", { id: id, "aria-labelledby": `${id}-title`, className: "tk-panel", children: [_jsxs("div", { className: "tk-panel-head", children: [_jsxs("div", { children: [_jsx("h2", { id: `${id}-title`, className: "tk-panel-title", children: title }), line && _jsx("p", { className: "tk-panel-line", children: line })] }), action] }), children] }));
|
|
11
|
-
}
|
|
12
|
-
/** A white card inside a panel. */
|
|
13
|
-
export function Card({ children, className }) {
|
|
14
|
-
return _jsx("div", { className: cx("tk-card", className), children: children });
|
|
15
|
-
}
|
|
16
|
-
/** A small-caps label above a value inside a card. */
|
|
17
|
-
export function Kicker({ children }) {
|
|
18
|
-
return _jsx("span", { className: "tk-kicker", children: children });
|
|
19
|
-
}
|
|
20
|
-
function ButtonLink({ href, variant = "grey", surface = "panel", disabled, children, }) {
|
|
21
|
-
if (disabled)
|
|
22
|
-
return (_jsx(Button, { variant: variant, surface: surface, disabled: true, children: children }));
|
|
23
|
-
return (_jsx(Link, { href: href, className: "tk-button", "data-variant": variant, "data-surface": surface, children: children }));
|
|
24
|
-
}
|
|
25
|
-
/** A grey button that opens another page and remembers this one as ?from=. */
|
|
26
|
-
export function PageLink({ to, children, disabled, surface, }) {
|
|
27
|
-
const href = useFromHref(to);
|
|
28
|
-
return (_jsx(ButtonLink, { href: href, surface: surface ?? "panel", disabled: disabled ?? false, children: children }));
|
|
29
|
-
}
|
|
30
|
-
/** A panel's one Edit button: opens that section's own edit page. */
|
|
31
|
-
export function EditLink({ to, label = "Edit", disabled, }) {
|
|
32
|
-
return (_jsx(PageLink, { to: to, disabled: disabled ?? false, children: label }));
|
|
33
|
-
}
|
|
34
|
-
/** The page's one dark button. */
|
|
35
|
-
export function PrimaryLink({ to, children }) {
|
|
36
|
-
const href = useFromHref(to);
|
|
37
|
-
return (_jsx(ButtonLink, { href: href, variant: "primary", children: children }));
|
|
38
|
-
}
|
|
39
|
-
/** Back to where you came from: the same pill on every page that has one. */
|
|
40
|
-
export function BackLink({ to }) {
|
|
41
|
-
return (_jsx(ButtonLink, { href: to, surface: "white", children: "Back" }));
|
|
42
|
-
}
|
|
43
|
-
/** A list: one white card of divided rows. */
|
|
44
|
-
export function ListCard({ children, as = "ul", }) {
|
|
45
|
-
const Tag = as;
|
|
46
|
-
return _jsx(Tag, { className: "tk-list", children: children });
|
|
47
|
-
}
|
|
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", }) {
|
|
55
|
-
const href = useFromHref(to ?? "");
|
|
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] }))] }));
|
|
67
|
-
}
|
|
68
|
-
/** An empty section: a dashed card, one sentence on how to fill it, one button. */
|
|
69
|
-
export function EmptyCard({ text, action }) {
|
|
70
|
-
return (_jsxs("div", { className: "tk-empty", children: [_jsx("p", { children: text }), action] }));
|
|
71
|
-
}
|
|
72
|
-
const WORD = {
|
|
73
|
-
"not-started": "Not started",
|
|
74
|
-
"in-progress": "In progress",
|
|
75
|
-
done: "Done",
|
|
76
|
-
};
|
|
77
|
-
/** A bare status dot, for sidebars and tight rows. */
|
|
78
|
-
export function Dot({ status }) {
|
|
79
|
-
return _jsx("span", { "aria-hidden": true, className: "tk-dot", "data-status": status });
|
|
80
|
-
}
|
|
81
|
-
/** Status as a dot and a word: grey not started, orange in progress, green done. Never red. */
|
|
82
|
-
export function StatusDot({ status, label }) {
|
|
83
|
-
return (_jsxs("span", { className: "tk-status", children: [_jsx(Dot, { status: status }), label ?? WORD[status]] }));
|
|
84
|
-
}
|
|
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 }));
|
|
90
|
-
}
|
|
91
|
-
/** Pills to pick one value from, on an edit page. */
|
|
92
|
-
export function ChipPicker({ value, options, onChange, label, }) {
|
|
93
|
-
return (_jsx("div", { role: "radiogroup", "aria-label": label, className: "tk-chips", children: options.map((o) => (
|
|
94
|
-
// biome-ignore lint/a11y/useSemanticElements: pills styled as buttons, with radio semantics
|
|
95
|
-
_jsx("button", { type: "button", role: "radio", "aria-checked": value === o.id, className: "tk-pick", onClick: () => onChange(o.id), children: o.name }, o.id))) }));
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* One edit page: title and Back, a white card of labelled Rows, then Cancel and Save. Without
|
|
99
|
-
* onSave (changes save as you go) the bar shows Done.
|
|
100
|
-
*/
|
|
101
|
-
export function EditFrame({ title, line, backTo, children, onSave, busy, saveLabel = "Save", extra, }) {
|
|
102
|
-
return (_jsxs("div", { className: "tk-edit", children: [_jsxs("div", { className: "tk-page-head", children: [_jsxs("div", { children: [_jsx("h1", { className: "tk-page-title", children: title }), line && _jsx("p", { className: "tk-page-line", children: line })] }), _jsx(BackLink, { to: backTo })] }), _jsx("div", { className: "tk-edit-card", children: children }), _jsxs("div", { className: "tk-edit-bar", children: [extra && _jsx("span", { className: "tk-edit-extra", children: extra }), onSave ? (_jsxs(_Fragment, { children: [_jsx(ButtonLink, { href: backTo, surface: "white", children: "Cancel" }), _jsx(Button, { variant: "primary", disabled: busy ?? false, onClick: onSave, children: busy ? "Saving…" : saveLabel })] })) : (_jsx(ButtonLink, { href: backTo, variant: "primary", children: "Done" }))] })] }));
|
|
103
|
-
}
|
|
104
|
-
/** A labelled row on an edit page: label and one line on the left, the inputs on the right. */
|
|
105
|
-
export function Row({ title, line, htmlFor, children, }) {
|
|
106
|
-
return (_jsxs("div", { className: "tk-row", children: [_jsxs("div", { className: "tk-row-label", children: [htmlFor ? (_jsx("label", { htmlFor: htmlFor, className: "tk-row-title", children: title })) : (_jsx("span", { className: "tk-row-title", children: title })), line && _jsx("span", { className: "tk-row-line", children: line })] }), _jsx("div", { className: "tk-row-fields", children: children })] }));
|
|
107
|
-
}
|
|
108
|
-
//# sourceMappingURL=page.js.map
|
package/dist/page.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"page.js","sourceRoot":"","sources":["../src/page.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,EAAE,EAAgB,MAAM,SAAS,CAAC;AAEnD,yFAAyF;AACzF,MAAM,UAAU,QAAQ,CAAC,EACvB,K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C,SAAS,GACtB,IACR,CACJ,CAAC,CAAC,CAAC,CACF,KAAC,UAAU,IAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAC,SAAS,qBAE9B,CACd,IACG,IACF,CACP,CAAC;AACJ,CAAC;AAED,+FAA+F;AAC/F,MAAM,UAAU,GAAG,CAAC,EAClB,KAAK,EACL,IAAI,EACJ,OAAO,EACP,QAAQ,GAMT;IACC,OAAO,CACL,eAAK,SAAS,EAAC,QAAQ,aACrB,eAAK,SAAS,EAAC,cAAc,aAC1B,OAAO,CAAC,CAAC,CAAC,CACT,gBAAO,OAAO,EAAE,OAAO,EAAE,SAAS,EAAC,cAAc,YAC9C,KAAK,GACA,CACT,CAAC,CAAC,CAAC,CACF,eAAM,SAAS,EAAC,cAAc,YAAE,KAAK,GAAQ,CAC9C,EACA,IAAI,IAAI,eAAM,SAAS,EAAC,aAAa,YAAE,IAAI,GAAQ,IAChD,EACN,cAAK,SAAS,EAAC,eAAe,YAAE,QAAQ,GAAO,IAC3C,CACP,CAAC;AACJ,CAAC"}
|
package/dist/parts.d.ts
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { type ReactNode } from "react";
|
|
2
|
-
import { type Colour } from "./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 };
|
package/dist/parts.js
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
// Parts that go inside a page: the board and its columns, threads of comments, facts, notices,
|
|
3
|
-
// and the centred page that sits outside the shell (sign-in).
|
|
4
|
-
import { createContext, useContext, useState } from "react";
|
|
5
|
-
import { ROW_DRAG_TYPE } from "./page.js";
|
|
6
|
-
/** Columns side by side, scrolling sideways when they do not fit. */
|
|
7
|
-
export function Board({ children, label }) {
|
|
8
|
-
return (_jsx("section", { className: "tk-board", "aria-label": label, children: children }));
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* One column: a title, an optional kind chip and count, then its rows. With `onDrop`, a ListRow
|
|
12
|
-
* that has a `dragId` can be dropped here, and onDrop gets that id.
|
|
13
|
-
*/
|
|
14
|
-
export function Column({ id, title, kind, count, action, empty = "Nothing here.", onDrop, children, }) {
|
|
15
|
-
const [over, setOver] = useState(false);
|
|
16
|
-
const accepts = (e) => !!onDrop && e.dataTransfer.types.includes(ROW_DRAG_TYPE);
|
|
17
|
-
const hasRows = Array.isArray(children) ? children.length > 0 : !!children;
|
|
18
|
-
return (_jsxs("section", { className: "tk-column", "aria-labelledby": `${id}-title`, "data-over": over ? "true" : undefined, onDragOver: (e) => {
|
|
19
|
-
if (!accepts(e))
|
|
20
|
-
return;
|
|
21
|
-
e.preventDefault();
|
|
22
|
-
e.dataTransfer.dropEffect = "move";
|
|
23
|
-
if (!over)
|
|
24
|
-
setOver(true);
|
|
25
|
-
}, onDragLeave: (e) => {
|
|
26
|
-
if (!e.currentTarget.contains(e.relatedTarget))
|
|
27
|
-
setOver(false);
|
|
28
|
-
}, onDrop: (e) => {
|
|
29
|
-
setOver(false);
|
|
30
|
-
if (!accepts(e))
|
|
31
|
-
return;
|
|
32
|
-
e.preventDefault();
|
|
33
|
-
const rowId = e.dataTransfer.getData(ROW_DRAG_TYPE);
|
|
34
|
-
if (rowId)
|
|
35
|
-
onDrop?.(rowId);
|
|
36
|
-
}, children: [_jsxs("div", { className: "tk-column-head", children: [_jsx("h3", { id: `${id}-title`, className: "tk-column-title", children: title }), kind, count !== undefined && _jsx("span", { className: "tk-count", children: count }), action && _jsx("span", { className: "tk-column-action", children: action })] }), hasRows ? (_jsx("ul", { className: "tk-list tk-column-list", children: children })) : (_jsx("p", { className: "tk-column-empty", children: empty }))] }));
|
|
37
|
-
}
|
|
38
|
-
const Depth = createContext(0);
|
|
39
|
-
/** A run of comments and activity lines, oldest first. */
|
|
40
|
-
export function Thread({ children, label }) {
|
|
41
|
-
return (_jsx("ol", { className: "tk-thread", "aria-label": label, children: children }));
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* One comment: author, time, text, then reactions and actions. `replies` holds one level of
|
|
45
|
-
* reply Comments; a reply's own replies are not shown.
|
|
46
|
-
*/
|
|
47
|
-
export function Comment({ author, avatar, time, reactions, actions, replies, children, }) {
|
|
48
|
-
const depth = useContext(Depth);
|
|
49
|
-
return (_jsxs("li", { className: "tk-comment", "data-reply": depth > 0 ? "true" : undefined, children: [avatar, _jsxs("div", { className: "tk-comment-main", children: [_jsxs("div", { className: "tk-comment-head", children: [_jsx("span", { className: "tk-comment-author", children: author }), time && _jsx("span", { className: "tk-comment-time", children: time })] }), _jsx("div", { className: "tk-comment-text", children: children }), (reactions || actions) && (_jsxs("div", { className: "tk-comment-foot", children: [reactions, actions] })), depth === 0 && replies && (_jsx(Depth.Provider, { value: 1, children: _jsx("ol", { className: "tk-replies", children: replies }) }))] })] }));
|
|
50
|
-
}
|
|
51
|
-
/** Emoji reactions under a comment; the person's own are pressed. */
|
|
52
|
-
export function Reactions({ items, onToggle, }) {
|
|
53
|
-
return (_jsx("span", { className: "tk-reactions", children: items.map((r) => (_jsxs("button", { type: "button", className: "tk-reaction", "aria-pressed": !!r.mine, "aria-label": `${r.emoji} ${r.count}`, onClick: () => onToggle?.(r.emoji), children: [_jsx("span", { "aria-hidden": true, children: r.emoji }), " ", r.count] }, r.emoji))) }));
|
|
54
|
-
}
|
|
55
|
-
/** One line of activity in a thread (a move, a status change), with at most one action. */
|
|
56
|
-
export function ActivityRow({ children, time, action, }) {
|
|
57
|
-
return (_jsxs("li", { className: "tk-activity", children: [_jsx("span", { className: "tk-activity-dot", "aria-hidden": true }), _jsx("span", { className: "tk-activity-text", children: children }), time && _jsx("span", { className: "tk-comment-time", children: time }), action && _jsx("span", { className: "tk-activity-action", children: action })] }));
|
|
58
|
-
}
|
|
59
|
-
/** Small-caps labels with their values, in a white card. */
|
|
60
|
-
export function Facts({ items }) {
|
|
61
|
-
return (_jsx("dl", { className: "tk-card tk-facts", children: items.map((f) => (_jsxs("div", { className: "tk-fact", children: [_jsx("dt", { className: "tk-kicker", children: f.label }), _jsx("dd", { children: f.value })] }, f.label))) }));
|
|
62
|
-
}
|
|
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 function Notice({ tone = "info", floating, onDismiss, children, }) {
|
|
68
|
-
return (_jsxs("div", { className: "tk-notice", "data-tone": tone, "data-floating": floating ? "true" : undefined, role: tone === "refused" ? "alert" : "status", children: [_jsx("span", { className: "tk-notice-text", children: children }), onDismiss && (_jsx("button", { type: "button", className: "tk-icon-button", "aria-label": "Dismiss", onClick: onDismiss, children: _jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", "aria-hidden": true, children: _jsx("path", { d: "M6 6l12 12M18 6 6 18", strokeLinecap: "round" }) }) }))] }));
|
|
69
|
-
}
|
|
70
|
-
/** A page outside the shell, such as sign-in: one panel in the middle of the window. */
|
|
71
|
-
export function CenteredPage({ title, line, children, }) {
|
|
72
|
-
return (_jsx("main", { className: "tk-root tk-centered", children: _jsxs("section", { className: "tk-panel tk-centered-panel", "aria-labelledby": "tk-centered-title", children: [_jsxs("div", { children: [_jsx("h1", { id: "tk-centered-title", className: "tk-panel-title", children: title }), line && _jsx("p", { className: "tk-panel-line", children: line })] }), children] }) }));
|
|
73
|
-
}
|
|
74
|
-
/** Several controls side by side inside one Row. */
|
|
75
|
-
export function Inline({ children }) {
|
|
76
|
-
return _jsx("div", { className: "tk-inline", children: children });
|
|
77
|
-
}
|
|
78
|
-
//# sourceMappingURL=parts.js.map
|
package/dist/parts.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parts.js","sourceRoot":"","sources":["../src/parts.tsx"],"names":[],"mappings":";AAAA,+FAA+F;AAC/F,8DAA8D;AAC9D,OAAO,EAAE,aAAa,EAAkC,UAAU,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5F,OAAO,EAAe,aAAa,EAAE,MAAM,WAAW,CAAC;AAEvD,qEAAqE;AACrE,MAAM,UAAU,KAAK,CAAC,EAAE,QAAQ,EAAE,KAAK,EAA2C;IAChF,OAAO,CACL,kBAAS,SAAS,EAAC,UAAU,gBAAa,KAAK,YAC5C,QAAQ,GACD,CACX,CAAC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AED,wFAAwF;AACxF,MAAM,UAAU,YAAY,CAAC,EAC3B,KAAK,EACL,IAAI,EACJ,QAAQ,GAKT;IACC,OAAO,CACL,eAAM,SAAS,EAAC,qBAAqB,YACnC,mBAAS,SAAS,EAAC,4BAA4B,qBAAiB,mBAAmB,aACjF,0BACE,aAAI,EAAE,EAAC,mBAAmB,EAAC,SAAS,EAAC,gBAAgB,YAClD,KAAK,GACH,EACJ,IAAI,IAAI,YAAG,SAAS,EAAC,eAAe,YAAE,IAAI,GAAK,IAC5C,EACL,QAAQ,IACD,GACL,CACR,CAAC;AACJ,CAAC;AAED,oDAAoD;AACpD,MAAM,UAAU,MAAM,CAAC,EAAE,QAAQ,EAA2B;IAC1D,OAAO,cAAK,SAAS,EAAC,WAAW,YAAE,QAAQ,GAAO,CAAC;AACrD,CAAC"}
|
package/dist/shell.d.ts
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { type ReactNode } from "react";
|
|
2
|
-
import { type Colour, type Progress } from "./page.js";
|
|
3
|
-
export type NavItem = {
|
|
4
|
-
href: string;
|
|
5
|
-
label: string;
|
|
6
|
-
/** A 16px line icon (for example from @tabler/icons-react). */
|
|
7
|
-
icon?: ReactNode;
|
|
8
|
-
current?: boolean;
|
|
9
|
-
/** A number shown at the right of the row, such as items waiting. */
|
|
10
|
-
count?: number;
|
|
11
|
-
};
|
|
12
|
-
export type GroupItem = {
|
|
13
|
-
id: string;
|
|
14
|
-
href: string;
|
|
15
|
-
label: string;
|
|
16
|
-
/** An image or Avatar. */
|
|
17
|
-
avatar?: ReactNode;
|
|
18
|
-
status?: Progress;
|
|
19
|
-
/** Always shown open, in a warm grey block: for an app where only the selected item opens. */
|
|
20
|
-
open?: ReactNode;
|
|
21
|
-
/**
|
|
22
|
-
* Sections the item expands into. Each item with children has its own expand button; several
|
|
23
|
-
* can be open at once, and the shell remembers which ones were left open.
|
|
24
|
-
*/
|
|
25
|
-
children?: ReactNode;
|
|
26
|
-
/** Expanded until the person collapses it. */
|
|
27
|
-
defaultOpen?: boolean;
|
|
28
|
-
/** The row is the current page. */
|
|
29
|
-
current?: boolean;
|
|
30
|
-
onSelect?: () => void;
|
|
31
|
-
};
|
|
32
|
-
export type Group = {
|
|
33
|
-
label: string;
|
|
34
|
-
/** Where the group label links, for example the list of all projects. */
|
|
35
|
-
href?: string;
|
|
36
|
-
items: GroupItem[];
|
|
37
|
-
/** Shown when the group has no items: one line on how to add the first. */
|
|
38
|
-
empty?: ReactNode;
|
|
39
|
-
/**
|
|
40
|
-
* Lets the person reorder the items by dragging a row, or with Alt+Up and Alt+Down on a focused
|
|
41
|
-
* row. Gets the item ids in their new order; save it, then pass the items back in that order.
|
|
42
|
-
*/
|
|
43
|
-
onReorder?: (ids: string[]) => void;
|
|
44
|
-
};
|
|
45
|
-
/** A round avatar: an image, an emoji, or the first letter, on one of the six colours. */
|
|
46
|
-
export declare function Avatar({ name, src, emoji, colour, }: {
|
|
47
|
-
name: string;
|
|
48
|
-
src?: string;
|
|
49
|
-
emoji?: string;
|
|
50
|
-
colour?: Colour;
|
|
51
|
-
}): import("react").JSX.Element;
|
|
52
|
-
/** A small-caps label and its links, inside the selected group item. */
|
|
53
|
-
export declare function SideSection({ label, children }: {
|
|
54
|
-
label: string;
|
|
55
|
-
children: ReactNode;
|
|
56
|
-
}): import("react").JSX.Element;
|
|
57
|
-
/** A link inside the selected group item, with an optional line and status dot. */
|
|
58
|
-
export declare function SideLink({ href, label, line, status, current, }: {
|
|
59
|
-
href: string;
|
|
60
|
-
label: string;
|
|
61
|
-
line?: string;
|
|
62
|
-
status?: Progress;
|
|
63
|
-
current?: boolean;
|
|
64
|
-
}): import("react").JSX.Element;
|
|
65
|
-
/** The frame every Kit app opens in. */
|
|
66
|
-
export declare function AppShell({ app, nav, groups, bottom, settingsHref, onSearch, title, topAside, collapsed: collapsedProp, onCollapsedChange, children, }: {
|
|
67
|
-
app: {
|
|
68
|
-
name: string;
|
|
69
|
-
href?: string;
|
|
70
|
-
mark?: ReactNode;
|
|
71
|
-
};
|
|
72
|
-
nav: NavItem[];
|
|
73
|
-
groups?: Group[];
|
|
74
|
-
/** Pages that sit at the bottom of the sidebar, above Settings (for example Archive). */
|
|
75
|
-
bottom?: NavItem[];
|
|
76
|
-
settingsHref?: string;
|
|
77
|
-
onSearch?: () => void;
|
|
78
|
-
/** Where you are, shown in the top bar before the app name. */
|
|
79
|
-
title?: ReactNode;
|
|
80
|
-
/** Controls on the right of the top bar, for example the chat panel toggle. */
|
|
81
|
-
topAside?: ReactNode;
|
|
82
|
-
collapsed?: boolean;
|
|
83
|
-
onCollapsedChange?: (collapsed: boolean) => void;
|
|
84
|
-
children: ReactNode;
|
|
85
|
-
}): import("react").JSX.Element;
|
package/dist/shell.js
DELETED
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
// The app shell: a light grey sidebar (app mark, nav with icons, small-caps groups of projects or
|
|
3
|
-
// entities with status dots, Settings at the bottom), a top bar, and the page. Every Kit app opens
|
|
4
|
-
// in this frame; the app passes data and the shell draws it.
|
|
5
|
-
import { useEffect, useState } from "react";
|
|
6
|
-
import { Link } from "./link.js";
|
|
7
|
-
import { Dot } from "./page.js";
|
|
8
|
-
const GROUP_DRAG_TYPE = "application/x-tk-group-item";
|
|
9
|
-
const STORAGE_KEY = "tk-sidebar-collapsed";
|
|
10
|
-
function useCollapsed(controlled, onChange) {
|
|
11
|
-
const [own, setOwn] = useState(false);
|
|
12
|
-
useEffect(() => {
|
|
13
|
-
if (controlled !== undefined)
|
|
14
|
-
return;
|
|
15
|
-
try {
|
|
16
|
-
setOwn(localStorage.getItem(STORAGE_KEY) === "true");
|
|
17
|
-
}
|
|
18
|
-
catch { }
|
|
19
|
-
}, [controlled]);
|
|
20
|
-
const collapsed = controlled ?? own;
|
|
21
|
-
const set = (next) => {
|
|
22
|
-
onChange?.(next);
|
|
23
|
-
if (controlled !== undefined)
|
|
24
|
-
return;
|
|
25
|
-
setOwn(next);
|
|
26
|
-
try {
|
|
27
|
-
localStorage.setItem(STORAGE_KEY, String(next));
|
|
28
|
-
}
|
|
29
|
-
catch { }
|
|
30
|
-
};
|
|
31
|
-
return [collapsed, set];
|
|
32
|
-
}
|
|
33
|
-
const OPEN_KEY = "tk-sidebar-open";
|
|
34
|
-
/** Which expandable items are open, remembered per browser. */
|
|
35
|
-
function useOpenItems() {
|
|
36
|
-
const [stored, setStored] = useState({});
|
|
37
|
-
useEffect(() => {
|
|
38
|
-
try {
|
|
39
|
-
const value = JSON.parse(localStorage.getItem(OPEN_KEY) ?? "{}");
|
|
40
|
-
if (value && typeof value === "object")
|
|
41
|
-
setStored(value);
|
|
42
|
-
}
|
|
43
|
-
catch { }
|
|
44
|
-
}, []);
|
|
45
|
-
const isOpen = (key, fallback) => stored[key] ?? fallback;
|
|
46
|
-
const toggle = (key, fallback) => setStored((prev) => {
|
|
47
|
-
const next = { ...prev, [key]: !(prev[key] ?? fallback) };
|
|
48
|
-
try {
|
|
49
|
-
localStorage.setItem(OPEN_KEY, JSON.stringify(next));
|
|
50
|
-
}
|
|
51
|
-
catch { }
|
|
52
|
-
return next;
|
|
53
|
-
});
|
|
54
|
-
return { isOpen, toggle };
|
|
55
|
-
}
|
|
56
|
-
const ChevronIcon = () => (_jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", "aria-hidden": true, children: _jsx("path", { d: "m9 6 6 6-6 6", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
57
|
-
const SearchIcon = () => (_jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", "aria-hidden": true, children: [_jsx("circle", { cx: "11", cy: "11", r: "6" }), _jsx("path", { d: "m20 20-4-4" })] }));
|
|
58
|
-
const CollapseIcon = () => (_jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", "aria-hidden": true, children: [_jsx("rect", { x: "4", y: "4", width: "16", height: "16", rx: "2" }), _jsx("path", { d: "M9 4v16" })] }));
|
|
59
|
-
/** A round avatar: an image, an emoji, or the first letter, on one of the six colours. */
|
|
60
|
-
export function Avatar({ name, src, emoji, colour, }) {
|
|
61
|
-
return (_jsx("span", { className: "tk-avatar", "data-colour": colour, "data-emoji": emoji ? "true" : undefined, "aria-hidden": true, children: src ? (_jsx("img", { src: src, alt: "", width: 22, height: 22 })) : ((emoji ?? (name.trim()[0] ?? "?").toUpperCase())) }));
|
|
62
|
-
}
|
|
63
|
-
/** A small-caps label and its links, inside the selected group item. */
|
|
64
|
-
export function SideSection({ label, children }) {
|
|
65
|
-
return (_jsxs("div", { className: "tk-side-section", children: [_jsx("span", { className: "tk-group-label", children: label }), children] }));
|
|
66
|
-
}
|
|
67
|
-
/** A link inside the selected group item, with an optional line and status dot. */
|
|
68
|
-
export function SideLink({ href, label, line, status, current, }) {
|
|
69
|
-
return (_jsxs(Link, { href: href, className: "tk-side-link", "aria-current": current ? "page" : undefined, children: [_jsxs("span", { className: "tk-side-link-text", children: [_jsx("span", { className: "tk-label", children: label }), line && _jsx("span", { className: "tk-side-link-line", children: line })] }), status && _jsx(Dot, { status: status })] }));
|
|
70
|
-
}
|
|
71
|
-
function NavLink({ item }) {
|
|
72
|
-
return (_jsxs(Link, { href: item.href, title: item.label, className: "tk-nav-item", "aria-current": item.current ? "page" : undefined, children: [item.icon && _jsx("span", { className: "tk-nav-icon", children: item.icon }), _jsx("span", { className: "tk-label", children: item.label }), item.count !== undefined && item.count > 0 && _jsx("span", { className: "tk-count", children: item.count })] }));
|
|
73
|
-
}
|
|
74
|
-
function GroupRow({ item, expanded, onToggle, move, }) {
|
|
75
|
-
const [over, setOver] = useState(false);
|
|
76
|
-
const expandable = item.children !== undefined;
|
|
77
|
-
const shown = item.open ?? (expandable && expanded ? item.children : undefined);
|
|
78
|
-
const link = (_jsxs(Link, { href: item.href, className: "tk-group-item", title: item.label, onClick: item.onSelect, "aria-current": item.current ? "page" : item.open ? "true" : undefined, "aria-keyshortcuts": move ? "Alt+ArrowUp Alt+ArrowDown" : undefined, onKeyDown: move
|
|
79
|
-
? (e) => {
|
|
80
|
-
if (!e.altKey || (e.key !== "ArrowUp" && e.key !== "ArrowDown"))
|
|
81
|
-
return;
|
|
82
|
-
e.preventDefault();
|
|
83
|
-
move.onStep(item.id, e.key === "ArrowUp" ? -1 : 1);
|
|
84
|
-
}
|
|
85
|
-
: undefined, children: [item.avatar ?? _jsx(Avatar, { name: item.label }), _jsx("span", { className: "tk-label", children: item.label }), !shown && item.status && _jsx(Dot, { status: item.status })] }));
|
|
86
|
-
const sectionsId = `tk-group-${item.id}`;
|
|
87
|
-
const row = expandable ? (_jsxs("div", { className: "tk-group-row", children: [link, _jsx("button", { type: "button", className: "tk-icon-button tk-chevron", "aria-label": `${expanded ? "Collapse" : "Expand"} ${item.label}`, "aria-expanded": expanded, "aria-controls": sectionsId, onClick: onToggle, children: _jsx(ChevronIcon, {}) })] })) : (link);
|
|
88
|
-
const drag = move
|
|
89
|
-
? {
|
|
90
|
-
draggable: true,
|
|
91
|
-
"data-over": over ? "true" : undefined,
|
|
92
|
-
onDragStart: (e) => {
|
|
93
|
-
e.dataTransfer.setData(GROUP_DRAG_TYPE, item.id);
|
|
94
|
-
e.dataTransfer.effectAllowed = "move";
|
|
95
|
-
},
|
|
96
|
-
onDragOver: (e) => {
|
|
97
|
-
if (!e.dataTransfer.types.includes(GROUP_DRAG_TYPE))
|
|
98
|
-
return;
|
|
99
|
-
e.preventDefault();
|
|
100
|
-
if (!over)
|
|
101
|
-
setOver(true);
|
|
102
|
-
},
|
|
103
|
-
onDragLeave: () => setOver(false),
|
|
104
|
-
onDrop: (e) => {
|
|
105
|
-
setOver(false);
|
|
106
|
-
const id = e.dataTransfer.getData(GROUP_DRAG_TYPE);
|
|
107
|
-
if (!id || id === item.id)
|
|
108
|
-
return;
|
|
109
|
-
e.preventDefault();
|
|
110
|
-
move.onMove(id, item.id);
|
|
111
|
-
},
|
|
112
|
-
}
|
|
113
|
-
: {};
|
|
114
|
-
return (_jsxs("div", { className: shown ? "tk-group-open" : "tk-group-slot", id: shown ? sectionsId : undefined, ...drag, children: [row, shown] }));
|
|
115
|
-
}
|
|
116
|
-
function reorder(ids, id, before) {
|
|
117
|
-
const rest = ids.filter((x) => x !== id);
|
|
118
|
-
const at = before === null ? rest.length : rest.indexOf(before);
|
|
119
|
-
rest.splice(at < 0 ? rest.length : at, 0, id);
|
|
120
|
-
return rest;
|
|
121
|
-
}
|
|
122
|
-
/** The frame every Kit app opens in. */
|
|
123
|
-
export function AppShell({ app, nav, groups = [], bottom = [], settingsHref, onSearch, title, topAside, collapsed: collapsedProp, onCollapsedChange, children, }) {
|
|
124
|
-
const [collapsed, setCollapsed] = useCollapsed(collapsedProp, onCollapsedChange);
|
|
125
|
-
const openItems = useOpenItems();
|
|
126
|
-
return (_jsxs("div", { className: "tk-root tk-shell", "data-collapsed": collapsed ? "true" : "false", children: [_jsxs("aside", { className: "tk-side", "aria-label": `${app.name} navigation`, children: [_jsxs("div", { className: "tk-side-scroll", children: [_jsxs(Link, { href: app.href ?? "/", className: "tk-mark", title: app.name, children: [app.mark ?? (_jsx("span", { className: "tk-mark-icon", "aria-hidden": true, children: (app.name[0] ?? "?").toUpperCase() })), _jsx("span", { className: "tk-label", children: app.name })] }), _jsx("nav", { className: "tk-nav", "aria-label": "Pages", children: nav.map((item) => (_jsx(NavLink, { item: item }, item.href))) }), groups.map((group) => (_jsxs("div", { className: "tk-group", children: [group.href ? (_jsx(Link, { href: group.href, className: "tk-group-label", children: group.label })) : (_jsx("span", { className: "tk-group-label", children: group.label })), group.items.map((item) => (_jsx(GroupRow, { item: item, move: group.onReorder
|
|
127
|
-
? {
|
|
128
|
-
onMove: (id, before) => {
|
|
129
|
-
const ids = group.items.map((i) => i.id);
|
|
130
|
-
group.onReorder?.(reorder(ids, id, before));
|
|
131
|
-
},
|
|
132
|
-
onStep: (id, by) => {
|
|
133
|
-
const ids = group.items.map((i) => i.id);
|
|
134
|
-
const at = ids.indexOf(id) + by;
|
|
135
|
-
if (at < 0 || at >= ids.length)
|
|
136
|
-
return;
|
|
137
|
-
const before = by < 0 ? (ids[at] ?? null) : (ids[at + 1] ?? null);
|
|
138
|
-
group.onReorder?.(reorder(ids, id, before));
|
|
139
|
-
},
|
|
140
|
-
}
|
|
141
|
-
: undefined, expanded: openItems.isOpen(`${group.label}/${item.id}`, item.defaultOpen ?? false), onToggle: () => openItems.toggle(`${group.label}/${item.id}`, item.defaultOpen ?? false) }, item.id))), !group.items.length && group.empty && (_jsx("div", { className: "tk-side-empty", children: group.empty }))] }, group.label)))] }), bottom.length > 0 && (_jsx("nav", { className: "tk-nav tk-nav-bottom", "aria-label": "More pages", children: bottom.map((item) => (_jsx(NavLink, { item: item }, item.href))) })), _jsxs("div", { className: "tk-side-foot", children: [settingsHref ? (_jsx(Link, { href: settingsHref, className: "tk-settings", children: "Settings" })) : (_jsx("span", { className: "tk-settings" })), onSearch && (_jsx("button", { type: "button", className: "tk-icon-button", "aria-label": "Search", onClick: onSearch, children: _jsx(SearchIcon, {}) })), _jsx("button", { type: "button", className: "tk-icon-button", "aria-label": collapsed ? "Expand sidebar" : "Collapse sidebar", "aria-pressed": collapsed, onClick: () => setCollapsed(!collapsed), children: _jsx(CollapseIcon, {}) })] })] }), _jsxs("div", { className: "tk-main", children: [_jsxs("header", { className: "tk-top", children: [title && _jsx("span", { className: "tk-top-title", children: title }), _jsx("span", { className: "tk-top-app", children: app.name }), topAside && _jsx("span", { className: "tk-top-aside", children: topAside })] }), _jsx("main", { className: "tk-content", children: children })] })] }));
|
|
142
|
-
}
|
|
143
|
-
//# sourceMappingURL=shell.js.map
|
package/dist/shell.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shell.js","sourceRoot":"","sources":["../src/shell.tsx"],"names":[],"mappings":";AAAA,kGAAkG;AAClG,mGAAmG;AACnG,6DAA6D;AAC7D,OA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,SAAS,aACtB,kBAAQ,SAAS,EAAC,QAAQ,aACvB,KAAK,IAAI,eAAM,SAAS,EAAC,cAAc,YAAE,KAAK,GAAQ,EACvD,eAAM,SAAS,EAAC,YAAY,YAAE,GAAG,CAAC,IAAI,GAAQ,EAC7C,QAAQ,IAAI,eAAM,SAAS,EAAC,cAAc,YAAE,QAAQ,GAAQ,IACtD,EACT,eAAM,SAAS,EAAC,YAAY,YAAE,QAAQ,GAAQ,IAC1C,IACF,CACP,CAAC;AACJ,CAAC"}
|
package/dist/ui.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { type ButtonHTMLAttributes, type InputHTMLAttributes, type LabelHTMLAttributes, type ReactNode, type SelectHTMLAttributes, type TextareaHTMLAttributes } from "react";
|
|
2
|
-
export declare const cx: (...parts: (string | false | null | undefined)[]) => string;
|
|
3
|
-
export type ButtonVariant = "grey" | "primary" | "danger";
|
|
4
|
-
/** The surface a grey button sits on: a warm grey panel (default) or a white card. */
|
|
5
|
-
export type Surface = "panel" | "white";
|
|
6
|
-
export declare const Button: import("react").ForwardRefExoticComponent<ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
7
|
-
variant?: ButtonVariant;
|
|
8
|
-
surface?: Surface;
|
|
9
|
-
} & import("react").RefAttributes<HTMLButtonElement>>;
|
|
10
|
-
export declare const Input: import("react").ForwardRefExoticComponent<InputHTMLAttributes<HTMLInputElement> & import("react").RefAttributes<HTMLInputElement>>;
|
|
11
|
-
export declare const Textarea: import("react").ForwardRefExoticComponent<TextareaHTMLAttributes<HTMLTextAreaElement> & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
12
|
-
export declare const Select: import("react").ForwardRefExoticComponent<SelectHTMLAttributes<HTMLSelectElement> & import("react").RefAttributes<HTMLSelectElement>>;
|
|
13
|
-
export declare function Label({ className, ...rest }: LabelHTMLAttributes<HTMLLabelElement>): import("react").JSX.Element;
|
|
14
|
-
/**
|
|
15
|
-
* Permanent delete, confirmed by typing the name. Archive is the everyday way to retire something;
|
|
16
|
-
* this is the only dialog the toolkit has.
|
|
17
|
-
*/
|
|
18
|
-
export declare function ConfirmDelete({ name, what, onConfirm, label, }: {
|
|
19
|
-
name: string;
|
|
20
|
-
what?: string;
|
|
21
|
-
onConfirm: () => void;
|
|
22
|
-
label?: string;
|
|
23
|
-
}): import("react").JSX.Element;
|
|
24
|
-
export type Children = {
|
|
25
|
-
children?: ReactNode;
|
|
26
|
-
};
|
package/dist/ui.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
// UI primitives: buttons, inputs and the one dialog. No sheets or drawers: every edit is its own page.
|
|
3
|
-
import { forwardRef, useId, useRef, useState, } from "react";
|
|
4
|
-
export const cx = (...parts) => parts.filter(Boolean).join(" ");
|
|
5
|
-
export const Button = forwardRef(function Button({ variant = "grey", surface = "panel", className, type, ...rest }, ref) {
|
|
6
|
-
return (_jsx("button", { ref: ref, type: type ?? "button", "data-variant": variant, "data-surface": surface, className: cx("tk-button", className), ...rest }));
|
|
7
|
-
});
|
|
8
|
-
export const Input = forwardRef(function Input({ className, ...rest }, ref) {
|
|
9
|
-
return _jsx("input", { ref: ref, className: cx("tk-input", className), ...rest });
|
|
10
|
-
});
|
|
11
|
-
export const Textarea = forwardRef(function Textarea({ className, ...rest }, ref) {
|
|
12
|
-
return _jsx("textarea", { ref: ref, className: cx("tk-textarea", className), ...rest });
|
|
13
|
-
});
|
|
14
|
-
export const Select = forwardRef(function Select({ className, ...rest }, ref) {
|
|
15
|
-
return _jsx("select", { ref: ref, className: cx("tk-select", className), ...rest });
|
|
16
|
-
});
|
|
17
|
-
export function Label({ className, ...rest }) {
|
|
18
|
-
// biome-ignore lint/a11y/noLabelWithoutControl: callers pass htmlFor
|
|
19
|
-
return _jsx("label", { className: cx("tk-row-title", className), ...rest });
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Permanent delete, confirmed by typing the name. Archive is the everyday way to retire something;
|
|
23
|
-
* this is the only dialog the toolkit has.
|
|
24
|
-
*/
|
|
25
|
-
export function ConfirmDelete({ name, what = "this", onConfirm, label = "Delete", }) {
|
|
26
|
-
const ref = useRef(null);
|
|
27
|
-
const [typed, setTyped] = useState("");
|
|
28
|
-
const id = useId();
|
|
29
|
-
return (_jsxs(_Fragment, { children: [_jsx(Button, { variant: "danger", onClick: () => ref.current?.showModal(), children: label }), _jsx("dialog", { ref: ref, className: "tk-dialog", "aria-labelledby": `${id}-t`, children: _jsxs("form", { method: "dialog", className: "tk-dialog-form", onSubmit: (e) => {
|
|
30
|
-
e.preventDefault();
|
|
31
|
-
if (typed !== name)
|
|
32
|
-
return;
|
|
33
|
-
ref.current?.close();
|
|
34
|
-
onConfirm();
|
|
35
|
-
}, children: [_jsxs("h2", { id: `${id}-t`, className: "tk-dialog-title", children: ["Delete ", what, " for good?"] }), _jsxs("p", { className: "tk-muted", children: ["This cannot be undone. Type ", _jsx("b", { children: name }), " to confirm."] }), _jsx(Input, { "aria-label": `Type ${name} to confirm`, value: typed, onChange: (e) => setTyped(e.target.value) }), _jsxs("div", { className: "tk-edit-bar", children: [_jsx(Button, { surface: "white", onClick: () => ref.current?.close(), children: "Cancel" }), _jsx(Button, { type: "submit", variant: "danger", disabled: typed !== name, children: label })] })] }) })] }));
|
|
36
|
-
}
|
|
37
|
-
//# sourceMappingURL=ui.js.map
|
package/dist/ui.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ui.js","sourceRoot":"","sources":["../src/ui.tsx"],"names":[],"mappings":";AAAA,uGAAuG;AACvG,OAAO,EAEL,UAAU,EAMV,KAAK,EACL,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AAEf,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,KAA4C,EAAE,EAAE,CACpE,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,C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