@glimstone/react 4.0.0 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/dist/Checkbox.d.ts +14 -0
- package/dist/Checkbox.js +7 -0
- package/dist/ColorPicker.d.ts +21 -0
- package/dist/ColorPicker.js +68 -0
- package/dist/ContextMenu.d.ts +23 -0
- package/dist/ContextMenu.js +137 -0
- package/dist/CopyField.d.ts +15 -0
- package/dist/CopyField.js +24 -0
- package/dist/Kbd.d.ts +5 -0
- package/dist/Kbd.js +6 -0
- package/dist/MenuBar.d.ts +18 -0
- package/dist/MenuBar.js +40 -0
- package/dist/Meter.d.ts +18 -0
- package/dist/Meter.js +9 -0
- package/dist/PasswordField.d.ts +12 -0
- package/dist/PasswordField.js +8 -0
- package/dist/Pill.d.ts +12 -0
- package/dist/Pill.js +5 -0
- package/dist/ProgressBar.d.ts +14 -0
- package/dist/ProgressBar.js +6 -0
- package/dist/Window.d.ts +37 -0
- package/dist/Window.js +43 -0
- package/dist/glyphs.d.ts +4 -0
- package/dist/glyphs.js +4 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +11 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -67,6 +67,13 @@ needs none of them.
|
|
|
67
67
|
| `SubCard` | A filled inset group inside a card, which replaces a fold-out |
|
|
68
68
|
| `UnavailableNotice` | What stands where a control would be, when the environment forbids the thing entirely |
|
|
69
69
|
| `WindowBar` | A desktop app's own title bar on Windows and Linux |
|
|
70
|
+
| `Window` | The general window: the title notch, a body for anything and a foot that adds Cancel or Close by itself; windows stack |
|
|
71
|
+
| `ContextMenu`, `MenuBar` | A menu at a point and the row of menus in a head bar, with submenus, rows that tick a box, choices, key caps and counts. Opened with the pointer, the first row shows its ring only once a key is pressed |
|
|
72
|
+
| `Checkbox` | The drawn box for "Don't show again" and for choices applied together, `slim` for the box alone in a dense row. Every setting is a `Toggle` |
|
|
73
|
+
| `Kbd`, `Pill` | A key cap, and the quiet data pill of a list row |
|
|
74
|
+
| `PasswordField`, `CopyField` | A secret with the reveal eye inside the field, and a value in monospace with a button that copies it |
|
|
75
|
+
| `Meter`, `ProgressBar` | A level such as a disk's, red from a threshold and `quiet` for a footer line, and work toward its end with a sheen while it runs. Only the bar moves |
|
|
76
|
+
| `ColorPicker` | The square, the hue bar, a preview with the name the colour proposes, the hex field and Apply, in the page or floating beside its swatch |
|
|
70
77
|
| `useLabelMode`, `useTipBubble`, `usePortalHue` | The small hooks the components need |
|
|
71
78
|
| `glyphs` | The marks the components draw themselves, and `setGlyphResolver`, the seam an app registers its own icon set through |
|
|
72
79
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface CheckboxProps {
|
|
2
|
+
checked: boolean;
|
|
3
|
+
/** Called with the flipped value when the box is activated. */
|
|
4
|
+
onChange: (next: boolean) => void;
|
|
5
|
+
/** Always the accessible name; shown beside the box unless hideLabel. */
|
|
6
|
+
label: string;
|
|
7
|
+
/** For a grid whose row and column headings already say it, such as permissions. */
|
|
8
|
+
hideLabel?: boolean;
|
|
9
|
+
/** The box alone, without the frame and its hover ground, for a row or a cell of a dense list. Hides the label. */
|
|
10
|
+
slim?: boolean;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function Checkbox({ checked, onChange, label, hideLabel, slim, disabled, className }: CheckboxProps): import("react").JSX.Element;
|
package/dist/Checkbox.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { IconCheck } from "./glyphs.js";
|
|
3
|
+
export function Checkbox({ checked, onChange, label, hideLabel = false, slim = false, disabled, className }) {
|
|
4
|
+
const bare = hideLabel || slim;
|
|
5
|
+
const classes = ["glim-checkbox", slim && "glim-checkbox--slim", className].filter(Boolean).join(" ");
|
|
6
|
+
return (_jsxs("button", { type: "button", role: "checkbox", "aria-checked": checked, "aria-label": bare ? label : undefined, disabled: disabled, onClick: () => onChange(!checked), className: classes, children: [_jsx("span", { className: "glim-checkbox-box", "aria-hidden": "true", children: _jsx(IconCheck, {}) }), !bare && _jsx("span", { children: label })] }));
|
|
7
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type ColorName, type ColorPickerPanelText } from "@glimstone/core";
|
|
2
|
+
export type { ColorName, ColorPickerPanelText } from "@glimstone/core";
|
|
3
|
+
export interface ColorPickerProps {
|
|
4
|
+
/** The colour the picker starts from, as `#rrggbb`. */
|
|
5
|
+
value: string;
|
|
6
|
+
/** Apply or Enter, with the colour and the name it proposes. */
|
|
7
|
+
onApply: (hex: string, name: string | null) => void;
|
|
8
|
+
/** Every step of a drag, a key or a valid hex, for a live preview. */
|
|
9
|
+
onInput?: (hex: string) => void;
|
|
10
|
+
/** The control that opened the picker. With it the picker floats beside it
|
|
11
|
+
* and closes on Escape, on a click beside it and after Apply. */
|
|
12
|
+
anchor?: HTMLElement | null;
|
|
13
|
+
/** Called when a floating picker closes, however it closes. */
|
|
14
|
+
onClose?: () => void;
|
|
15
|
+
/** The names a colour is matched against, nearest in OKLab. `false` shows none. */
|
|
16
|
+
names?: readonly ColorName[] | false;
|
|
17
|
+
/** The words, read when the picker opens. */
|
|
18
|
+
text?: Partial<ColorPickerPanelText>;
|
|
19
|
+
className?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare function ColorPicker({ value, onApply, onInput, anchor, onClose, names, text, className }: ColorPickerProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useLayoutEffect, useRef, useState } from "react";
|
|
3
|
+
import { createPortal } from "react-dom";
|
|
4
|
+
import { COLOR_NAMES_DE, COLOR_PICKER_TEXT, colorPicker, floatColorPicker, nearestColorName, normalizeHex, } from "@glimstone/core";
|
|
5
|
+
import { Button } from "./Button.js";
|
|
6
|
+
import { IconCheck } from "./glyphs.js";
|
|
7
|
+
export function ColorPicker({ value, onApply, onInput, anchor, onClose, names = COLOR_NAMES_DE, text, className }) {
|
|
8
|
+
const words = { ...COLOR_PICKER_TEXT, ...text };
|
|
9
|
+
const panel = useRef(null);
|
|
10
|
+
const host = useRef(null);
|
|
11
|
+
const widget = useRef(null);
|
|
12
|
+
const [draft, setDraft] = useState(() => normalizeHex(value) ?? "#000000");
|
|
13
|
+
const [typed, setTyped] = useState(draft);
|
|
14
|
+
const latest = useRef({ onInput, onClose });
|
|
15
|
+
useLayoutEffect(() => {
|
|
16
|
+
latest.current = { onInput, onClose };
|
|
17
|
+
});
|
|
18
|
+
useLayoutEffect(() => {
|
|
19
|
+
const picker = colorPicker(draft, (hex) => {
|
|
20
|
+
setDraft(hex);
|
|
21
|
+
setTyped(hex);
|
|
22
|
+
latest.current.onInput?.(hex);
|
|
23
|
+
}, { text: words });
|
|
24
|
+
host.current.appendChild(picker.el);
|
|
25
|
+
widget.current = picker;
|
|
26
|
+
return () => picker.el.remove();
|
|
27
|
+
// Built once; a new value reaches it through setValue below.
|
|
28
|
+
}, []);
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
const hex = normalizeHex(value);
|
|
31
|
+
if (!hex)
|
|
32
|
+
return;
|
|
33
|
+
setDraft(hex);
|
|
34
|
+
setTyped(hex);
|
|
35
|
+
widget.current?.setValue(hex);
|
|
36
|
+
}, [value]);
|
|
37
|
+
useLayoutEffect(() => {
|
|
38
|
+
if (!anchor || !panel.current)
|
|
39
|
+
return;
|
|
40
|
+
const done = floatColorPicker(panel.current, anchor, () => latest.current.onClose?.());
|
|
41
|
+
widget.current?.focus();
|
|
42
|
+
return done;
|
|
43
|
+
}, [anchor]);
|
|
44
|
+
const name = names === false ? null : nearestColorName(draft, names);
|
|
45
|
+
function apply() {
|
|
46
|
+
onApply(draft, name);
|
|
47
|
+
if (anchor) {
|
|
48
|
+
anchor.focus();
|
|
49
|
+
onClose?.();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function onKeyDown(e) {
|
|
53
|
+
if (e.key === "Enter" && !(e.target instanceof HTMLButtonElement)) {
|
|
54
|
+
e.preventDefault();
|
|
55
|
+
apply();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
const body = (_jsxs("div", { ref: panel, className: ["glim-picker-panel", anchor && "glim-picker-panel--float", className].filter(Boolean).join(" "), style: { "--glim-picker-colour": draft }, onKeyDown: onKeyDown, children: [_jsx("div", { ref: host, style: { display: "contents" } }), _jsxs("div", { className: "glim-picker-foot", children: [_jsx("span", { className: "glim-picker-swatch", "aria-hidden": "true" }), name !== null && _jsx("span", { className: "glim-picker-name", children: name }), _jsx("input", { className: "glim-picker-hex", value: typed, maxLength: 7, spellCheck: false, "aria-label": words.hex, onChange: (e) => {
|
|
59
|
+
setTyped(e.target.value);
|
|
60
|
+
const hex = normalizeHex(e.target.value);
|
|
61
|
+
if (!hex)
|
|
62
|
+
return;
|
|
63
|
+
setDraft(hex);
|
|
64
|
+
widget.current?.setValue(hex);
|
|
65
|
+
onInput?.(hex);
|
|
66
|
+
} })] }), _jsx("div", { className: "glim-picker-actions", children: _jsx(Button, { label: words.apply, labelKey: "apply", glyph: _jsx(IconCheck, {}), tone: "accent", onClick: apply }) })] }));
|
|
67
|
+
return anchor ? createPortal(body, document.body) : body;
|
|
68
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type MenuEntry as CoreMenuEntry, type MenuHead as CoreMenuHead, type MenuItem as CoreMenuItem } from "@glimstone/core";
|
|
3
|
+
export type MenuEntry = CoreMenuEntry<ReactNode>;
|
|
4
|
+
export type MenuItem = CoreMenuItem<ReactNode>;
|
|
5
|
+
export type MenuHead = CoreMenuHead<ReactNode>;
|
|
6
|
+
export interface ContextMenuProps {
|
|
7
|
+
/** The point the menu hangs from, in viewport pixels, such as the pointer's. */
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
items: MenuEntry[];
|
|
11
|
+
/** Stand the menu on the point instead, for a menu opened from a bar at the bottom. */
|
|
12
|
+
above?: boolean;
|
|
13
|
+
/** The menu's accessible name. */
|
|
14
|
+
label?: string;
|
|
15
|
+
/** The control that opened the menu. A click on it is not a click outside,
|
|
16
|
+
* and focus goes back to it; without one, focus goes back to wherever it was. */
|
|
17
|
+
opener?: HTMLElement | null;
|
|
18
|
+
/** Called on every way out: a choice, Escape, Tab or a click outside. */
|
|
19
|
+
onClose: () => void;
|
|
20
|
+
/** Left or right on a row without a submenu, for a bar that steps to the next menu. */
|
|
21
|
+
onStep?: (direction: 1 | -1) => void;
|
|
22
|
+
}
|
|
23
|
+
export declare function ContextMenu({ x, y, items, above, label, opener, onClose, onStep }: ContextMenuProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// A menu at a point: a right-click on a row, the More button of a list, or a
|
|
3
|
+
// menu of the bar. Mount it to open it and unmount it on onClose. The model,
|
|
4
|
+
// the placing and the keys come from menu.ts in the core.
|
|
5
|
+
//
|
|
6
|
+
// A submenu opens beside its row as a second menu on the body, one level deep.
|
|
7
|
+
// A checkbox item leaves the menu open, so several can be ticked in a row; the
|
|
8
|
+
// caller flips `checked` and the row follows.
|
|
9
|
+
import { useLayoutEffect, useRef, useState } from "react";
|
|
10
|
+
import { createPortal } from "react-dom";
|
|
11
|
+
import { claimMenu, closeMenuOutside, focusedAsker, focusFirstMenuRow, focusMenuRow, isMenuHead, menuMove, menuRowView, placeMenu, placeSubmenu, returnFocus, tidyMenu, } from "@glimstone/core";
|
|
12
|
+
import { IconCheck, IconExpand, IconPencil } from "./glyphs.js";
|
|
13
|
+
import { Kbd } from "./Kbd.js";
|
|
14
|
+
import { useTipBubble } from "./useTipBubble.js";
|
|
15
|
+
const viewport = () => ({ width: innerWidth, height: innerHeight });
|
|
16
|
+
function HeadEdit({ tip, glyph, row, onPress }) {
|
|
17
|
+
const tooltip = useTipBubble(tip);
|
|
18
|
+
return (_jsxs(_Fragment, { children: [_jsx("button", { ref: tooltip.ref, type: "button", role: "menuitem", tabIndex: -1, "aria-label": tip, "aria-describedby": tooltip.describedBy, ...tooltip.handlers, className: "glim-menu-head-edit", "data-row": row, onClick: onPress, children: glyph ?? _jsx(IconPencil, {}) }), tooltip.bubble] }));
|
|
19
|
+
}
|
|
20
|
+
function Rows({ entries, openAt, onPick, }) {
|
|
21
|
+
return entries.map((entry, i) => {
|
|
22
|
+
if (entry === "-")
|
|
23
|
+
return _jsx("div", { className: "glim-menu-sep", role: "separator" }, i);
|
|
24
|
+
if (isMenuHead(entry)) {
|
|
25
|
+
return (_jsxs("div", { className: "glim-menu-head", role: "presentation", children: [_jsx("span", { children: entry.head }), entry.edit && _jsx(HeadEdit, { tip: entry.edit.tip, glyph: entry.edit.glyph, row: i, onPress: () => onPick(i) })] }, i));
|
|
26
|
+
}
|
|
27
|
+
const view = menuRowView(entry);
|
|
28
|
+
return (_jsxs("button", { type: "button", role: view.role, tabIndex: -1, "aria-checked": view.role === "menuitem" ? undefined : entry.checked, "aria-haspopup": entry.sub ? "menu" : undefined, "aria-expanded": entry.sub ? openAt === i : undefined, disabled: entry.disabled, className: view.current ? "glim-menu-item glim-menu-item--current" : "glim-menu-item", "data-row": i, onClick: () => onPick(i), children: [view.lead === "box" ? (_jsx("span", { className: "glim-checkbox-box", "aria-hidden": "true", children: _jsx(IconCheck, {}) })) : view.lead === "dot" ? (_jsx("span", { className: "glim-menu-dot", style: { backgroundColor: entry.color }, "aria-hidden": "true" })) : (_jsx("span", { className: "glim-menu-glyph", "aria-hidden": "true", children: view.lead === "glyph" && entry.glyph })), _jsx("span", { className: "glim-menu-label", children: entry.label }), view.end === "submenu" && (_jsx("span", { className: "glim-menu-end glim-menu-caret", "aria-hidden": "true", children: _jsx(IconExpand, {}) })), view.end === "tick" && (_jsx("span", { className: "glim-menu-end glim-menu-tick", "aria-hidden": "true", children: _jsx(IconCheck, {}) })), view.end === "shortcut" && _jsx(Kbd, { className: "glim-menu-end", children: entry.shortcut }), view.end === "count" && _jsx("span", { className: "glim-menu-end glim-menu-count glim-num", children: entry.count })] }, i));
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
export function ContextMenu({ x, y, items, above = false, label, opener, onClose, onStep }) {
|
|
32
|
+
const menu = useRef(null);
|
|
33
|
+
const subMenu = useRef(null);
|
|
34
|
+
const [asker] = useState(focusedAsker);
|
|
35
|
+
const [pos, setPos] = useState({ left: x, top: y });
|
|
36
|
+
const [sub, setSub] = useState(null);
|
|
37
|
+
const [subPos, setSubPos] = useState(null);
|
|
38
|
+
const latest = useRef({ onClose, onStep, opener });
|
|
39
|
+
useLayoutEffect(() => {
|
|
40
|
+
latest.current = { onClose, onStep, opener };
|
|
41
|
+
});
|
|
42
|
+
const rows = tidyMenu(items);
|
|
43
|
+
const host = sub ? rows[sub.at] : undefined;
|
|
44
|
+
const subRows = host && !isMenuHead(host) && host !== "-" && host.sub ? tidyMenu(host.sub) : null;
|
|
45
|
+
// Focus goes back only on a way out somebody chose; a click elsewhere keeps
|
|
46
|
+
// the focus it gave. It reads only refs, so the first render's copy serves
|
|
47
|
+
// the listeners too.
|
|
48
|
+
const finish = (handBack) => {
|
|
49
|
+
latest.current.onClose();
|
|
50
|
+
if (handBack)
|
|
51
|
+
returnFocus(latest.current.opener ?? asker);
|
|
52
|
+
};
|
|
53
|
+
useLayoutEffect(() => {
|
|
54
|
+
const el = menu.current;
|
|
55
|
+
setPos(placeMenu(x, y, { width: el.offsetWidth, height: el.offsetHeight }, viewport(), above));
|
|
56
|
+
}, [x, y, above]);
|
|
57
|
+
useLayoutEffect(() => {
|
|
58
|
+
const release = claimMenu(finish);
|
|
59
|
+
const outside = closeMenuOutside(() => [menu.current, subMenu.current, latest.current.opener], () => finish(false));
|
|
60
|
+
focusFirstMenuRow(menu.current);
|
|
61
|
+
return () => {
|
|
62
|
+
release();
|
|
63
|
+
outside();
|
|
64
|
+
};
|
|
65
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
66
|
+
}, []);
|
|
67
|
+
useLayoutEffect(() => {
|
|
68
|
+
const row = sub && menu.current?.querySelector(`[data-row="${sub.at}"]`);
|
|
69
|
+
if (!sub || !row || !subMenu.current) {
|
|
70
|
+
setSubPos(null);
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const rtl = getComputedStyle(menu.current).direction === "rtl";
|
|
74
|
+
const el = subMenu.current;
|
|
75
|
+
setSubPos(placeSubmenu(row.getBoundingClientRect(), { width: el.offsetWidth, height: el.offsetHeight }, viewport(), rtl));
|
|
76
|
+
if (sub.focus)
|
|
77
|
+
focusFirstMenuRow(el);
|
|
78
|
+
}, [sub]);
|
|
79
|
+
function pick(list, at) {
|
|
80
|
+
const entry = list[at];
|
|
81
|
+
if (entry === "-")
|
|
82
|
+
return;
|
|
83
|
+
if (isMenuHead(entry)) {
|
|
84
|
+
finish(true);
|
|
85
|
+
entry.edit?.onSelect();
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
if (entry.sub && list === rows) {
|
|
89
|
+
setSub({ at, focus: true });
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
if (menuRowView(entry).staysOpen) {
|
|
93
|
+
entry.onSelect?.();
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
finish(true);
|
|
97
|
+
entry.onSelect?.();
|
|
98
|
+
}
|
|
99
|
+
function keys(e, inSub) {
|
|
100
|
+
if (e.key === "Tab")
|
|
101
|
+
return finish(false);
|
|
102
|
+
const move = menuMove(e.key, getComputedStyle(e.currentTarget).direction === "rtl");
|
|
103
|
+
if (!move)
|
|
104
|
+
return;
|
|
105
|
+
e.preventDefault();
|
|
106
|
+
if (move !== "in" && move !== "out")
|
|
107
|
+
return focusMenuRow(e.currentTarget, move);
|
|
108
|
+
if (inSub) {
|
|
109
|
+
if (move === "out" && sub) {
|
|
110
|
+
menu.current?.querySelector(`[data-row="${sub.at}"]`)?.focus();
|
|
111
|
+
setSub(null);
|
|
112
|
+
}
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
const at = Number(document.activeElement?.dataset.row);
|
|
116
|
+
const entry = rows[at];
|
|
117
|
+
if (move === "in" && entry && entry !== "-" && !isMenuHead(entry) && entry.sub && !entry.disabled)
|
|
118
|
+
setSub({ at, focus: true });
|
|
119
|
+
else
|
|
120
|
+
latest.current.onStep?.(move === "in" ? 1 : -1);
|
|
121
|
+
}
|
|
122
|
+
// The pointer opens a submenu by resting on its row and closes it on any other row.
|
|
123
|
+
function hover(e) {
|
|
124
|
+
const row = e.target.closest("[data-row]");
|
|
125
|
+
if (!row)
|
|
126
|
+
return;
|
|
127
|
+
const at = Number(row.dataset.row);
|
|
128
|
+
const entry = rows[at];
|
|
129
|
+
const opens = entry !== "-" && !isMenuHead(entry) && !!entry.sub && !entry.disabled;
|
|
130
|
+
if (opens && sub?.at !== at)
|
|
131
|
+
setSub({ at, focus: false });
|
|
132
|
+
else if (!opens && sub)
|
|
133
|
+
setSub(null);
|
|
134
|
+
}
|
|
135
|
+
return (_jsxs(_Fragment, { children: [createPortal(_jsx("div", { ref: menu, role: "menu", "aria-label": label, className: "glim-menu", style: pos, onKeyDown: (e) => keys(e, false), onMouseOver: hover, onContextMenu: (e) => e.preventDefault(), children: _jsx(Rows, { entries: rows, openAt: sub?.at, onPick: (i) => pick(rows, i) }) }), document.body), subRows &&
|
|
136
|
+
createPortal(_jsx("div", { ref: subMenu, role: "menu", "aria-label": host.label, className: "glim-menu", style: subPos ?? { left: 0, top: 0 }, onKeyDown: (e) => keys(e, true), onContextMenu: (e) => e.preventDefault(), children: _jsx(Rows, { entries: subRows, onPick: (i) => pick(subRows, i) }) }), document.body)] }));
|
|
137
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface CopyFieldProps {
|
|
2
|
+
value: string;
|
|
3
|
+
/** The field's accessible name, such as "Token". */
|
|
4
|
+
label: string;
|
|
5
|
+
/** The button's words, before and for a moment after it copied. */
|
|
6
|
+
text?: {
|
|
7
|
+
copy: string;
|
|
8
|
+
copied: string;
|
|
9
|
+
};
|
|
10
|
+
/** Called after every press, with whether the value reached the clipboard. */
|
|
11
|
+
onCopy?: (done: boolean) => void;
|
|
12
|
+
/** Classes for the row, which carries the width. */
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function CopyField({ value, label, text, onCopy, className }: CopyFieldProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef, useState } from "react";
|
|
3
|
+
import { COPIED_MS, copyText } from "@glimstone/core";
|
|
4
|
+
import { Button } from "./Button.js";
|
|
5
|
+
import { IconCheck, IconCopy } from "./glyphs.js";
|
|
6
|
+
export function CopyField({ value, label, text = { copy: "Copy", copied: "Copied" }, onCopy, className }) {
|
|
7
|
+
const [copied, setCopied] = useState(false);
|
|
8
|
+
const field = useRef(null);
|
|
9
|
+
const timer = useRef(undefined);
|
|
10
|
+
useEffect(() => () => clearTimeout(timer.current), []);
|
|
11
|
+
async function copy() {
|
|
12
|
+
const done = await copyText(value);
|
|
13
|
+
onCopy?.(done);
|
|
14
|
+
if (!done) {
|
|
15
|
+
field.current?.focus();
|
|
16
|
+
field.current?.select();
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
setCopied(true);
|
|
20
|
+
clearTimeout(timer.current);
|
|
21
|
+
timer.current = window.setTimeout(() => setCopied(false), COPIED_MS);
|
|
22
|
+
}
|
|
23
|
+
return (_jsxs("span", { className: className ? `glim-copy ${className}` : "glim-copy", children: [_jsx("input", { ref: field, readOnly: true, value: value, "aria-label": label, spellCheck: false, className: "glim-input glim-input--mono" }), _jsx(Button, { label: copied ? text.copied : text.copy, labelKey: copied ? "copied" : "copy", glyph: copied ? _jsx(IconCheck, {}) : _jsx(IconCopy, {}), variant: "icon", onClick: copy }), _jsx("span", { role: "status", className: "glim-sr-only", children: copied ? text.copied : "" })] }));
|
|
24
|
+
}
|
package/dist/Kbd.d.ts
ADDED
package/dist/Kbd.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// A key or a key combination as it is written on the keys, such as "Ctrl+K".
|
|
3
|
+
// The words are the app's, so a German app writes "Strg".
|
|
4
|
+
export function Kbd({ children, className }) {
|
|
5
|
+
return _jsx("kbd", { className: className ? `glim-kbd ${className}` : "glim-kbd", children: children });
|
|
6
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type Ref } from "react";
|
|
2
|
+
import { type MenuEntry } from "./ContextMenu.tsx";
|
|
3
|
+
export interface MenuBarMenu {
|
|
4
|
+
label: string;
|
|
5
|
+
items: MenuEntry[];
|
|
6
|
+
}
|
|
7
|
+
export interface MenuBarHandle {
|
|
8
|
+
/** Opens a menu by its index and puts the focus on its first row. */
|
|
9
|
+
open: (index: number) => void;
|
|
10
|
+
}
|
|
11
|
+
export interface MenuBarProps {
|
|
12
|
+
/** The bar's accessible name, such as "Menu". */
|
|
13
|
+
label: string;
|
|
14
|
+
menus: MenuBarMenu[];
|
|
15
|
+
ref?: Ref<MenuBarHandle>;
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function MenuBar({ label, menus, ref, className }: MenuBarProps): import("react").JSX.Element;
|
package/dist/MenuBar.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// The menu bar of a desktop-style app: a row of words, each opening its menu
|
|
3
|
+
// below it. While one is open the pointer and the arrow keys move between
|
|
4
|
+
// them, as in a desktop program. The app opens the first one on F10 through
|
|
5
|
+
// the ref, since which key does it is the app's keymap.
|
|
6
|
+
import { useImperativeHandle, useRef, useState } from "react";
|
|
7
|
+
import { ContextMenu } from "./ContextMenu.js";
|
|
8
|
+
export function MenuBar({ label, menus, ref, className }) {
|
|
9
|
+
const buttons = useRef([]);
|
|
10
|
+
const [open, setOpen] = useState(null);
|
|
11
|
+
const [stop, setStop] = useState(0);
|
|
12
|
+
const count = menus.length;
|
|
13
|
+
function show(at) {
|
|
14
|
+
const button = buttons.current[at];
|
|
15
|
+
if (!button)
|
|
16
|
+
return;
|
|
17
|
+
button.focus();
|
|
18
|
+
setStop(at);
|
|
19
|
+
const r = button.getBoundingClientRect();
|
|
20
|
+
setOpen({ at, x: r.left, y: r.bottom + 6 });
|
|
21
|
+
}
|
|
22
|
+
useImperativeHandle(ref, () => ({ open: show }));
|
|
23
|
+
function keys(e, at) {
|
|
24
|
+
const rtl = getComputedStyle(e.currentTarget).direction === "rtl";
|
|
25
|
+
const step = { ArrowRight: rtl ? -1 : 1, ArrowLeft: rtl ? 1 : -1 }[e.key];
|
|
26
|
+
if (step !== undefined) {
|
|
27
|
+
e.preventDefault();
|
|
28
|
+
const next = (at + step + count) % count;
|
|
29
|
+
setStop(next);
|
|
30
|
+
buttons.current[next]?.focus();
|
|
31
|
+
}
|
|
32
|
+
else if (e.key === "ArrowDown") {
|
|
33
|
+
e.preventDefault();
|
|
34
|
+
show(at);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return (_jsxs("div", { role: "menubar", "aria-label": label, className: className ? `glim-menubar ${className}` : "glim-menubar", children: [menus.map((m, i) => (_jsx("button", { ref: (el) => {
|
|
38
|
+
buttons.current[i] = el;
|
|
39
|
+
}, type: "button", role: "menuitem", "aria-haspopup": "menu", "aria-expanded": open?.at === i, tabIndex: i === stop ? 0 : -1, className: "glim-menubar-item", onClick: () => (open?.at === i ? setOpen(null) : show(i)), onMouseEnter: () => open && open.at !== i && show(i), onKeyDown: (e) => keys(e, i), onFocus: () => setStop(i), children: m.label }, i))), open && menus[open.at] && (_jsx(ContextMenu, { x: open.x, y: open.y, items: menus[open.at].items, label: menus[open.at].label, opener: buttons.current[open.at], onClose: () => setOpen(null), onStep: (d) => show((open.at + d + count) % count) }, open.at))] }));
|
|
40
|
+
}
|
package/dist/Meter.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type MeterSize } from "@glimstone/core";
|
|
2
|
+
export type { MeterSize } from "@glimstone/core";
|
|
3
|
+
export interface MeterProps {
|
|
4
|
+
/** From 0 to 1. Without it the meter shows stripes while the level is still being read. */
|
|
5
|
+
value?: number | null;
|
|
6
|
+
/** The accessible name, such as the disk's. */
|
|
7
|
+
label: string;
|
|
8
|
+
/** `small` sits beside a row's name, `medium` is as wide as its column. */
|
|
9
|
+
size?: MeterSize;
|
|
10
|
+
/** From here on the fill is the fault colour. */
|
|
11
|
+
threshold?: number;
|
|
12
|
+
/** Slim and grey, for a footer line or a dense list. Inside a button it takes the accent when the button is reached. */
|
|
13
|
+
quiet?: boolean;
|
|
14
|
+
/** The level in words, such as "120 GB free of 4 TB": read out, and shown in the bubble. */
|
|
15
|
+
valueText?: string;
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function Meter({ value, label, size, threshold, quiet, valueText, className }: MeterProps): import("react").JSX.Element;
|
package/dist/Meter.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { meterView } from "@glimstone/core";
|
|
3
|
+
import { useTipBubble } from "./useTipBubble.js";
|
|
4
|
+
export function Meter({ value, label, size = "medium", threshold, quiet, valueText, className }) {
|
|
5
|
+
const view = meterView(value, { size, threshold, quiet });
|
|
6
|
+
const tip = useTipBubble(valueText);
|
|
7
|
+
const busy = view.percent === null;
|
|
8
|
+
return (_jsxs(_Fragment, { children: [_jsx("span", { ref: tip.ref, ...tip.handlers, role: busy ? "progressbar" : "meter", "aria-label": label, "aria-valuemin": busy ? undefined : 0, "aria-valuemax": busy ? undefined : 100, "aria-valuenow": view.percent ?? undefined, "aria-valuetext": valueText, "aria-busy": busy || undefined, className: className ? `${view.className} ${className}` : view.className, children: _jsx("span", { className: "glim-meter-fill", style: view.width ? { width: view.width } : undefined }) }), tip.bubble] }));
|
|
9
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type InputHTMLAttributes, type Ref } from "react";
|
|
2
|
+
export interface PasswordFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type"> {
|
|
3
|
+
/** The eye's name and bubble while the secret is hidden, and once it shows. */
|
|
4
|
+
text?: {
|
|
5
|
+
show: string;
|
|
6
|
+
hide: string;
|
|
7
|
+
};
|
|
8
|
+
/** Classes for the wrapper, which carries the field's width. */
|
|
9
|
+
className?: string;
|
|
10
|
+
ref?: Ref<HTMLInputElement>;
|
|
11
|
+
}
|
|
12
|
+
export declare function PasswordField({ text, className, ref, disabled, ...rest }: PasswordFieldProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { IconEye, IconEyeOff } from "./glyphs.js";
|
|
4
|
+
import { IconTipButton } from "./IconTipButton.js";
|
|
5
|
+
export function PasswordField({ text = { show: "Show", hide: "Hide" }, className, ref, disabled, ...rest }) {
|
|
6
|
+
const [shown, setShown] = useState(false);
|
|
7
|
+
return (_jsxs("span", { className: className ? `glim-secret ${className}` : "glim-secret", children: [_jsx("input", { autoComplete: "current-password", spellCheck: false, ...rest, ref: ref, disabled: disabled, type: shown ? "text" : "password", className: "glim-input" }), _jsx(IconTipButton, { tip: shown ? text.hide : text.show, className: "glim-secret-eye", disabled: disabled, onClick: () => setShown(!shown), children: shown ? _jsx(IconEyeOff, {}) : _jsx(IconEye, {}) })] }));
|
|
8
|
+
}
|
package/dist/Pill.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { type PillTone } from "@glimstone/core";
|
|
3
|
+
export type { PillTone } from "@glimstone/core";
|
|
4
|
+
export interface PillProps {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
/** `state` lifts a word that says what the row is doing; the other three
|
|
7
|
+
* wash the pill in their state colour. */
|
|
8
|
+
tone?: PillTone;
|
|
9
|
+
/** Extra classes, such as `glim-num` for figures that line up in a column. */
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function Pill({ children, tone, className }: PillProps): import("react").JSX.Element;
|
package/dist/Pill.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { pillClassName } from "@glimstone/core";
|
|
3
|
+
export function Pill({ children, tone = "neutral", className }) {
|
|
4
|
+
return _jsx("span", { className: className ? `${pillClassName(tone)} ${className}` : pillClassName(tone), children: children });
|
|
5
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface ProgressBarProps {
|
|
2
|
+
/** From 0 to 1. Without it the bar runs indeterminate, while the work has no measure yet. */
|
|
3
|
+
value?: number | null;
|
|
4
|
+
/** The accessible name, such as what is being copied. */
|
|
5
|
+
label: string;
|
|
6
|
+
/** The work waits: the fill takes the waiting tone and the sheen stops. */
|
|
7
|
+
paused?: boolean;
|
|
8
|
+
/** The work stopped on an error: the fill takes the fault colour. */
|
|
9
|
+
failed?: boolean;
|
|
10
|
+
/** The progress in words, such as "1.2 GB of 4 GB", read out instead of the percentage. */
|
|
11
|
+
valueText?: string;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function ProgressBar({ value, label, paused, failed, valueText, className }: ProgressBarProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { progressView } from "@glimstone/core";
|
|
3
|
+
export function ProgressBar({ value, label, paused, failed, valueText, className }) {
|
|
4
|
+
const view = progressView(value, { paused, failed });
|
|
5
|
+
return (_jsx("span", { role: "progressbar", "aria-label": label, "aria-valuemin": view.percent === null ? undefined : 0, "aria-valuemax": view.percent === null ? undefined : 100, "aria-valuenow": view.percent ?? undefined, "aria-valuetext": valueText, className: className ? `${view.className} ${className}` : view.className, children: _jsx("span", { className: "glim-progress-fill", style: view.width ? { width: view.width } : undefined }) }));
|
|
6
|
+
}
|
package/dist/Window.d.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type WindowSize } from "@glimstone/core";
|
|
3
|
+
export type { WindowSize } from "@glimstone/core";
|
|
4
|
+
export interface WindowAction {
|
|
5
|
+
label: string;
|
|
6
|
+
/** The translation key behind `label`, which picks the glyph, or `null`. */
|
|
7
|
+
labelKey: string | null;
|
|
8
|
+
glyph?: ReactNode;
|
|
9
|
+
/** The forward action, filled with the accent and placed last. */
|
|
10
|
+
primary?: boolean;
|
|
11
|
+
/** This action already leaves the window, such as Done, so no Cancel or Close is added. */
|
|
12
|
+
wayOut?: boolean;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
/** Runs on press. The window closes afterwards unless it returns false. */
|
|
15
|
+
onClick?: () => void | false;
|
|
16
|
+
}
|
|
17
|
+
export interface WindowProps {
|
|
18
|
+
/** The notch's words, also the window's accessible name. */
|
|
19
|
+
title: string;
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
/** The foot's buttons, in reading order. Cancel or Close is added before
|
|
22
|
+
* them unless one of them is a way out itself. */
|
|
23
|
+
actions?: WindowAction[];
|
|
24
|
+
/** A quiet line at the start of the foot, such as where the work carries on. */
|
|
25
|
+
start?: ReactNode;
|
|
26
|
+
/** `normal` for a question or a form, `wide` for a list, `full` for a tool. */
|
|
27
|
+
size?: WindowSize;
|
|
28
|
+
/** The words of the way out the window adds. */
|
|
29
|
+
text: {
|
|
30
|
+
cancel: string;
|
|
31
|
+
close: string;
|
|
32
|
+
};
|
|
33
|
+
/** Called for every way out: the foot, Escape and a press beside the window. */
|
|
34
|
+
onClose: () => void;
|
|
35
|
+
className?: string;
|
|
36
|
+
}
|
|
37
|
+
export declare function Window({ title, children, actions, start, size, text, onClose, className }: WindowProps): import("react").ReactPortal;
|
package/dist/Window.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// The general window: a notch with the title, a body for anything and a foot
|
|
3
|
+
// whose actions stand at the end. It owns the portal, its place on the stack,
|
|
4
|
+
// Escape, the Tab trap and the focus, so a caller only mounts it and unmounts
|
|
5
|
+
// it on onClose.
|
|
6
|
+
import { useId, useLayoutEffect, useRef, useState } from "react";
|
|
7
|
+
import { createPortal } from "react-dom";
|
|
8
|
+
import { focusedAsker, menuIsOpen, returnFocus, stackWindow, windowFocusTarget, windowFoot, } from "@glimstone/core";
|
|
9
|
+
import { Badge } from "./Badge.js";
|
|
10
|
+
import { Button } from "./Button.js";
|
|
11
|
+
import { IconCancel, IconClose } from "./glyphs.js";
|
|
12
|
+
export function Window({ title, children, actions = [], start, size = "normal", text, onClose, className }) {
|
|
13
|
+
const card = useRef(null);
|
|
14
|
+
const titleId = useId();
|
|
15
|
+
// Read before the window takes the focus.
|
|
16
|
+
const [asker] = useState(focusedAsker);
|
|
17
|
+
const close = useRef(onClose);
|
|
18
|
+
useLayoutEffect(() => {
|
|
19
|
+
close.current = onClose;
|
|
20
|
+
});
|
|
21
|
+
useLayoutEffect(() => {
|
|
22
|
+
const unstack = stackWindow(() => card.current, () => close.current());
|
|
23
|
+
if (card.current)
|
|
24
|
+
windowFocusTarget(card.current)?.focus();
|
|
25
|
+
return () => {
|
|
26
|
+
unstack();
|
|
27
|
+
returnFocus(asker);
|
|
28
|
+
};
|
|
29
|
+
}, [asker]);
|
|
30
|
+
const foot = windowFoot(actions, start !== undefined, {
|
|
31
|
+
cancel: { label: text.cancel, labelKey: "common.cancel", glyph: _jsx(IconCancel, {}), wayOut: true },
|
|
32
|
+
close: { label: text.close, labelKey: "common.close", glyph: _jsx(IconClose, {}), wayOut: true },
|
|
33
|
+
});
|
|
34
|
+
return createPortal(_jsx("div", { className: "glim-modal-backdrop",
|
|
35
|
+
// A press beside an open menu only closes the menu, not the window under it.
|
|
36
|
+
onMouseDown: (e) => {
|
|
37
|
+
if (e.target === e.currentTarget && !menuIsOpen())
|
|
38
|
+
close.current();
|
|
39
|
+
}, children: _jsxs("div", { ref: card, role: "dialog", "aria-modal": "true", "aria-labelledby": titleId, className: ["glim-modal-card", "glim-window", size !== "normal" && `glim-window--${size}`, className].filter(Boolean).join(" "), children: [_jsx("h2", { id: titleId, className: "glim-window-title", children: _jsx(Badge, { tone: "heading", size: "heading", wrap: true, insetStart: 5, children: title }) }), _jsx("div", { className: "glim-modal-body glim-window-body", children: children }), foot.length > 0 && (_jsxs("div", { className: "glim-modal-foot", children: [start !== undefined && _jsx("span", { className: "glim-window-start", children: start }), foot.map((a, i) => (_jsx(Button, { label: a.label, labelKey: a.labelKey, glyph: a.glyph, tone: a.primary ? "accent" : "neutral", disabled: a.disabled, onClick: () => {
|
|
40
|
+
if (a.onClick?.() !== false)
|
|
41
|
+
close.current();
|
|
42
|
+
} }, i)))] }))] }) }), document.body);
|
|
43
|
+
}
|
package/dist/glyphs.d.ts
CHANGED
|
@@ -17,6 +17,10 @@ export declare const IconClose: () => import("react").JSX.Element;
|
|
|
17
17
|
export declare const IconCancel: () => import("react").JSX.Element;
|
|
18
18
|
export declare const IconCheck: () => import("react").JSX.Element;
|
|
19
19
|
export declare const IconExpand: () => import("react").JSX.Element;
|
|
20
|
+
export declare const IconPencil: () => import("react").JSX.Element;
|
|
20
21
|
export declare const IconWindowMinimise: () => import("react").JSX.Element;
|
|
21
22
|
export declare const IconWindowMaximise: () => import("react").JSX.Element;
|
|
22
23
|
export declare const IconWindowRestore: () => import("react").JSX.Element;
|
|
24
|
+
export declare const IconEye: () => import("react").JSX.Element;
|
|
25
|
+
export declare const IconEyeOff: () => import("react").JSX.Element;
|
|
26
|
+
export declare const IconCopy: () => import("react").JSX.Element;
|
package/dist/glyphs.js
CHANGED
|
@@ -25,6 +25,10 @@ export const IconClose = () => _jsx(MarkSvg, { mark: MARKS.close, className: "gl
|
|
|
25
25
|
export const IconCancel = () => _jsx(MarkSvg, { mark: MARKS.cancel, className: "glim-mark" });
|
|
26
26
|
export const IconCheck = () => _jsx(MarkSvg, { mark: MARKS.check, className: "glim-mark" });
|
|
27
27
|
export const IconExpand = () => _jsx(MarkSvg, { mark: MARKS.expand, className: "glim-mark" });
|
|
28
|
+
export const IconPencil = () => _jsx(MarkSvg, { mark: MARKS.pencil, className: "glim-mark" });
|
|
28
29
|
export const IconWindowMinimise = () => _jsx(MarkSvg, { mark: MARKS.windowMinimise, className: "glim-mark" });
|
|
29
30
|
export const IconWindowMaximise = () => _jsx(MarkSvg, { mark: MARKS.windowMaximise, className: "glim-mark" });
|
|
30
31
|
export const IconWindowRestore = () => _jsx(MarkSvg, { mark: MARKS.windowRestore, className: "glim-mark" });
|
|
32
|
+
export const IconEye = () => _jsx(MarkSvg, { mark: MARKS.eye, className: "glim-mark" });
|
|
33
|
+
export const IconEyeOff = () => _jsx(MarkSvg, { mark: MARKS.eyeOff, className: "glim-mark" });
|
|
34
|
+
export const IconCopy = () => _jsx(MarkSvg, { mark: MARKS.copy, className: "glim-mark" });
|
package/dist/index.d.ts
CHANGED
|
@@ -2,15 +2,25 @@ export * from "./AboutCard.tsx";
|
|
|
2
2
|
export * from "./Badge.tsx";
|
|
3
3
|
export * from "./Button.tsx";
|
|
4
4
|
export * from "./Card.tsx";
|
|
5
|
+
export * from "./Checkbox.tsx";
|
|
5
6
|
export * from "./CoffeeDialog.tsx";
|
|
7
|
+
export * from "./ColorPicker.tsx";
|
|
6
8
|
export * from "./ConfirmDialog.tsx";
|
|
9
|
+
export * from "./ContextMenu.tsx";
|
|
10
|
+
export * from "./CopyField.tsx";
|
|
7
11
|
export * from "./CryptoDonateDialog.tsx";
|
|
8
12
|
export * from "./DropdownListbox.tsx";
|
|
9
13
|
export * from "./EmptyState.tsx";
|
|
10
14
|
export * from "./IconTipButton.tsx";
|
|
11
15
|
export * from "./InfoBubble.tsx";
|
|
16
|
+
export * from "./Kbd.tsx";
|
|
17
|
+
export * from "./MenuBar.tsx";
|
|
18
|
+
export * from "./Meter.tsx";
|
|
12
19
|
export * from "./NumberField.tsx";
|
|
20
|
+
export * from "./PasswordField.tsx";
|
|
13
21
|
export * from "./PaypalDialog.tsx";
|
|
22
|
+
export * from "./Pill.tsx";
|
|
23
|
+
export * from "./ProgressBar.tsx";
|
|
14
24
|
export * from "./ReadmeButton.tsx";
|
|
15
25
|
export * from "./Selector.tsx";
|
|
16
26
|
export * from "./SidebarRow.tsx";
|
|
@@ -18,6 +28,7 @@ export * from "./SubCard.tsx";
|
|
|
18
28
|
export * from "./Toast.tsx";
|
|
19
29
|
export * from "./Toggle.tsx";
|
|
20
30
|
export * from "./UnavailableNotice.tsx";
|
|
31
|
+
export * from "./Window.tsx";
|
|
21
32
|
export * from "./WindowBar.tsx";
|
|
22
33
|
export * from "./glyphs.tsx";
|
|
23
34
|
export * from "./portalHue.ts";
|
package/dist/index.js
CHANGED
|
@@ -2,15 +2,25 @@ export * from "./AboutCard.js";
|
|
|
2
2
|
export * from "./Badge.js";
|
|
3
3
|
export * from "./Button.js";
|
|
4
4
|
export * from "./Card.js";
|
|
5
|
+
export * from "./Checkbox.js";
|
|
5
6
|
export * from "./CoffeeDialog.js";
|
|
7
|
+
export * from "./ColorPicker.js";
|
|
6
8
|
export * from "./ConfirmDialog.js";
|
|
9
|
+
export * from "./ContextMenu.js";
|
|
10
|
+
export * from "./CopyField.js";
|
|
7
11
|
export * from "./CryptoDonateDialog.js";
|
|
8
12
|
export * from "./DropdownListbox.js";
|
|
9
13
|
export * from "./EmptyState.js";
|
|
10
14
|
export * from "./IconTipButton.js";
|
|
11
15
|
export * from "./InfoBubble.js";
|
|
16
|
+
export * from "./Kbd.js";
|
|
17
|
+
export * from "./MenuBar.js";
|
|
18
|
+
export * from "./Meter.js";
|
|
12
19
|
export * from "./NumberField.js";
|
|
20
|
+
export * from "./PasswordField.js";
|
|
13
21
|
export * from "./PaypalDialog.js";
|
|
22
|
+
export * from "./Pill.js";
|
|
23
|
+
export * from "./ProgressBar.js";
|
|
14
24
|
export * from "./ReadmeButton.js";
|
|
15
25
|
export * from "./Selector.js";
|
|
16
26
|
export * from "./SidebarRow.js";
|
|
@@ -18,6 +28,7 @@ export * from "./SubCard.js";
|
|
|
18
28
|
export * from "./Toast.js";
|
|
19
29
|
export * from "./Toggle.js";
|
|
20
30
|
export * from "./UnavailableNotice.js";
|
|
31
|
+
export * from "./Window.js";
|
|
21
32
|
export * from "./WindowBar.js";
|
|
22
33
|
export * from "./glyphs.js";
|
|
23
34
|
export * from "./portalHue.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@glimstone/react",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "GlimStone's components for React",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"repository": { "type": "git", "url": "git+https://github.com/junkerderprovinz/glimstone.git", "directory": "packages/react" },
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"build": "tsc -p tsconfig.build.json"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@glimstone/core": "4.
|
|
19
|
+
"@glimstone/core": "4.1.0"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
22
22
|
"@zag-js/combobox": "^1.46.0",
|