@glimstone/react 4.4.1 → 4.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/dist/AboutCard.d.ts +1 -1
  2. package/dist/AboutCard.js +3 -2
  3. package/dist/Accordion.d.ts +15 -0
  4. package/dist/Accordion.js +23 -0
  5. package/dist/AngleSlider.d.ts +10 -0
  6. package/dist/AngleSlider.js +19 -0
  7. package/dist/Avatar.d.ts +11 -0
  8. package/dist/Avatar.js +11 -0
  9. package/dist/Badge.d.ts +1 -1
  10. package/dist/Badge.js +1 -1
  11. package/dist/Carousel.d.ts +18 -0
  12. package/dist/Carousel.js +27 -0
  13. package/dist/Checkbox.js +1 -1
  14. package/dist/Collapsible.d.ts +12 -0
  15. package/dist/Collapsible.js +21 -0
  16. package/dist/ContextMenu.d.ts +3 -1
  17. package/dist/ContextMenu.js +11 -3
  18. package/dist/CryptoDonateDialog.d.ts +2 -28
  19. package/dist/DatePicker.d.ts +16 -0
  20. package/dist/DatePicker.js +39 -0
  21. package/dist/DropdownListbox.d.ts +1 -1
  22. package/dist/DropdownListbox.js +11 -4
  23. package/dist/FileUpload.d.ts +15 -0
  24. package/dist/FileUpload.js +23 -0
  25. package/dist/FloatingPanel.d.ts +14 -0
  26. package/dist/FloatingPanel.js +25 -0
  27. package/dist/Fortress.d.ts +2 -13
  28. package/dist/HoverCard.d.ts +12 -0
  29. package/dist/HoverCard.js +20 -0
  30. package/dist/InfoBubble.js +1 -1
  31. package/dist/InstanceCard.d.ts +2 -4
  32. package/dist/Marquee.d.ts +16 -0
  33. package/dist/Marquee.js +23 -0
  34. package/dist/MenuBar.d.ts +2 -4
  35. package/dist/MenuBar.js +10 -10
  36. package/dist/Meter.js +1 -1
  37. package/dist/Pagination.d.ts +14 -0
  38. package/dist/Pagination.js +26 -0
  39. package/dist/PathField.js +2 -2
  40. package/dist/PinInput.d.ts +21 -0
  41. package/dist/PinInput.js +27 -0
  42. package/dist/Rating.d.ts +15 -0
  43. package/dist/Rating.js +24 -0
  44. package/dist/ScrollArea.d.ts +9 -0
  45. package/dist/ScrollArea.js +11 -0
  46. package/dist/Select.js +10 -2
  47. package/dist/SidebarRow.d.ts +2 -6
  48. package/dist/SignInCard.d.ts +2 -9
  49. package/dist/SignInCard.js +3 -0
  50. package/dist/SignaturePad.d.ts +11 -0
  51. package/dist/SignaturePad.js +27 -0
  52. package/dist/SkeletonRow.js +1 -1
  53. package/dist/Splitter.d.ts +14 -0
  54. package/dist/Splitter.js +22 -0
  55. package/dist/Steps.d.ts +17 -0
  56. package/dist/Steps.js +32 -0
  57. package/dist/TagsInput.d.ts +15 -0
  58. package/dist/TagsInput.js +32 -0
  59. package/dist/Timer.d.ts +15 -0
  60. package/dist/Timer.js +14 -0
  61. package/dist/Toast.d.ts +2 -7
  62. package/dist/Tour.d.ts +10 -0
  63. package/dist/Tour.js +30 -0
  64. package/dist/engines.d.ts +11 -0
  65. package/dist/engines.js +43 -0
  66. package/dist/glyphs.d.ts +8 -0
  67. package/dist/glyphs.js +8 -0
  68. package/dist/index.d.ts +1 -0
  69. package/dist/index.js +1 -0
  70. package/dist/usePaypalButtons.d.ts +8 -7
  71. package/package.json +28 -7
@@ -117,7 +117,7 @@ export declare function InfoTile({ version, help, about, hueIndex, ...data }: In
117
117
  * app and GlimStone as its rows, and the Help card.
118
118
  *
119
119
  * @deprecated Use `InfoTile`, which adds the version rows' sub-lines, the
120
- * other components, "Check for updates" and the bug report.
120
+ * other components, "Check for updates" and the bug report. Removed in 5.0.0.
121
121
  */
122
122
  export declare function AboutCard({ text, version, glimstoneVersion, repoUrl, repoGlyph, glimstoneRepoUrl, onCoffee, coffeeArt, cryptoGlyph, paypalGlyph, onPaypal, onCrypto, mailAddress, mailGlyph, openUrl, hueIndex, }: {
123
123
  text: {
package/dist/AboutCard.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useState } from "react";
3
- import { mailHref, offersMail, openInBrowser, runUpdateCheck, updateFace, updateStage, versionLink, } from "@glimstone/core";
3
+ import { mailHref, offersMail, openInBrowser, runUpdateCheck, updateFace, updateStage, versionLink, warnDeprecated, } from "@glimstone/core";
4
4
  import { Button } from "./Button.js";
5
5
  import { Card } from "./Card.js";
6
6
  import { ReadmeButton } from "./ReadmeButton.js";
@@ -58,9 +58,10 @@ export function InfoTile({ version, help, about, hueIndex, ...data }) {
58
58
  * app and GlimStone as its rows, and the Help card.
59
59
  *
60
60
  * @deprecated Use `InfoTile`, which adds the version rows' sub-lines, the
61
- * other components, "Check for updates" and the bug report.
61
+ * other components, "Check for updates" and the bug report. Removed in 5.0.0.
62
62
  */
63
63
  export function AboutCard({ text, version, glimstoneVersion, repoUrl, repoGlyph, glimstoneRepoUrl, onCoffee, coffeeArt, cryptoGlyph, paypalGlyph, onPaypal, onCrypto, mailAddress, mailGlyph, openUrl = openInBrowser, hueIndex, }) {
64
+ warnDeprecated("AboutCard");
64
65
  const rows = [
65
66
  ...(version ? [{ name: text.version, version, repoUrl }] : []),
66
67
  { name: "GlimStone", version: glimstoneVersion, repoUrl: glimstoneRepoUrl },
@@ -0,0 +1,15 @@
1
+ import { type ReactNode } from "react";
2
+ import { type AccordionItem, type HeadingLevel } from "@glimstone/core";
3
+ export type { AccordionItem, HeadingLevel } from "@glimstone/core";
4
+ export interface AccordionProps<T extends AccordionItem> {
5
+ items: readonly T[];
6
+ /** The values of the open items. Left out, it keeps its own state. */
7
+ value?: string[];
8
+ onChange?: (value: string[]) => void;
9
+ /** Several items open at once; otherwise opening one closes the other. */
10
+ multiple?: boolean;
11
+ headingLevel?: HeadingLevel;
12
+ /** Draws the text under an item's row. */
13
+ content: (item: T) => ReactNode;
14
+ }
15
+ export declare function Accordion<T extends AccordionItem>({ items, value, onChange, multiple, headingLevel, content }: AccordionProps<T>): import("react").JSX.Element;
@@ -0,0 +1,23 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useId, useState } from "react";
3
+ import * as accordion from "@zag-js/accordion";
4
+ import { normalizeProps, useMachine } from "@zag-js/react";
5
+ import { pageDir } from "@glimstone/core";
6
+ import { IconExpand } from "./glyphs.js";
7
+ export function Accordion({ items, value, onChange, multiple = false, headingLevel = 3, content }) {
8
+ const [own, setOwn] = useState([]);
9
+ const service = useMachine(accordion.machine, {
10
+ id: useId(),
11
+ dir: pageDir(),
12
+ value: value ?? own,
13
+ multiple,
14
+ collapsible: true,
15
+ onValueChange: (d) => {
16
+ setOwn(d.value);
17
+ onChange?.(d.value);
18
+ },
19
+ });
20
+ const api = accordion.connect(service, normalizeProps);
21
+ const Heading = `h${headingLevel}`;
22
+ return (_jsx("div", { "data-glim": "Accordion", ...api.getRootProps(), className: "glim-accordion", children: items.map((item) => (_jsxs("div", { ...api.getItemProps(item), className: "glim-accordion-item", children: [_jsx(Heading, { className: "glim-disclosure-heading", children: _jsxs("button", { ...api.getItemTriggerProps(item), className: "glim-disclosure-trigger", children: [_jsx("span", { className: "glim-disclosure-label", children: item.title }), _jsx("span", { ...api.getItemIndicatorProps(item), className: "glim-disclosure-indicator", children: _jsx(IconExpand, {}) })] }) }), _jsx("div", { ...api.getItemContentProps(item), className: "glim-disclosure-content", children: _jsx("div", { className: "glim-disclosure-body", children: content(item) }) })] }, item.value))) }));
23
+ }
@@ -0,0 +1,10 @@
1
+ export interface AngleSliderProps {
2
+ label?: string;
3
+ value: number;
4
+ onChange: (value: number) => void;
5
+ step?: number;
6
+ /** The angles that carry a tick on the dial. */
7
+ marks?: number[];
8
+ disabled?: boolean;
9
+ }
10
+ export declare function AngleSlider({ label, value, onChange, step, marks, disabled }: AngleSliderProps): import("react").JSX.Element;
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useId } from "react";
3
+ import * as angleSlider from "@zag-js/angle-slider";
4
+ import { normalizeProps, useMachine } from "@zag-js/react";
5
+ import { pageDir } from "@glimstone/core";
6
+ import { useFieldName } from "./fieldName.js";
7
+ export function AngleSlider({ label, value, onChange, step = 1, marks = [0, 90, 180, 270], disabled = false }) {
8
+ const name = useFieldName(label);
9
+ const service = useMachine(angleSlider.machine, {
10
+ id: useId(),
11
+ dir: pageDir(),
12
+ value,
13
+ step,
14
+ disabled,
15
+ onValueChange: (d) => onChange(d.value),
16
+ });
17
+ const api = angleSlider.connect(service, normalizeProps);
18
+ return (_jsxs("div", { "data-glim": "AngleSlider", ...api.getRootProps(), className: "glim-angle", children: [_jsx("label", { ...api.getLabelProps(), className: label === undefined ? "glim-sr-only" : "glim-field-label", children: name }), _jsxs("div", { className: "glim-angle-body", children: [_jsxs("div", { ...api.getControlProps(), className: "glim-angle-dial", children: [_jsx("div", { ...api.getMarkerGroupProps(), className: "glim-angle-marks", children: marks.map((mark) => (_jsx("span", { ...api.getMarkerProps({ value: mark }), className: "glim-angle-mark" }, mark))) }), _jsx("div", { ...api.getThumbProps(), "aria-valuetext": `${api.value}°`, className: "glim-angle-thumb" })] }), _jsx("div", { ...api.getValueTextProps(), className: "glim-angle-value glim-num", children: `${api.value}°` })] }), _jsx("input", { ...api.getHiddenInputProps() })] }));
19
+ }
@@ -0,0 +1,11 @@
1
+ import { type AvatarSize } from "@glimstone/core";
2
+ export type { AvatarSize } from "@glimstone/core";
3
+ export interface AvatarProps {
4
+ /** The person's name: the accessible name, and where the initials come from. */
5
+ name: string;
6
+ src?: string;
7
+ size?: AvatarSize;
8
+ /** A palette position, for a list of people whose circles each take a hue under rainbow. */
9
+ hueIndex?: number;
10
+ }
11
+ export declare function Avatar({ name, src, size, hueIndex }: AvatarProps): import("react").JSX.Element;
package/dist/Avatar.js ADDED
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useId } from "react";
3
+ import * as avatar from "@zag-js/avatar";
4
+ import { normalizeProps, useMachine } from "@zag-js/react";
5
+ import { avatarView, initials, pageDir } from "@glimstone/core";
6
+ export function Avatar({ name, src, size = "md", hueIndex }) {
7
+ const service = useMachine(avatar.machine, { id: useId(), dir: pageDir() });
8
+ const api = avatar.connect(service, normalizeProps);
9
+ const view = avatarView({ size, hueIndex });
10
+ return (_jsxs("span", { "data-glim": "Avatar", ...api.getRootProps(), role: "img", "aria-label": name, className: view.className, style: view.style, children: [src && _jsx("img", { ...api.getImageProps(), src: src, alt: "", className: "glim-avatar-image" }), _jsx("span", { ...api.getFallbackProps(), "aria-hidden": "true", className: "glim-avatar-fallback", children: initials(name) })] }));
11
+ }
package/dist/Badge.d.ts CHANGED
@@ -12,7 +12,7 @@ export interface BadgeProps {
12
12
  * shape setting. */
13
13
  form?: BadgeForm;
14
14
  /** @deprecated Use `form`. Only "circle" has an effect: it makes the badge
15
- * icon-only. */
15
+ * icon-only. Removed in 5.0.0. */
16
16
  shape?: BadgeShape;
17
17
  /** Render as a <button> or a real <a href>, with the same box as a span. */
18
18
  as?: "span" | "button" | "a";
package/dist/Badge.js CHANGED
@@ -31,5 +31,5 @@ export function Badge({ children, tone = "neutral", size = "medium", form, shape
31
31
  if (as === "a") {
32
32
  return (_jsx("a", { "data-glim": "Badge", href: href, target: target, rel: rel, title: title, "aria-label": ariaLabel, style: hueStyle, className: classes, children: children }));
33
33
  }
34
- return (_jsx("span", { "data-glim": "Badge", title: title, "aria-label": ariaLabel, style: hueStyle, className: classes, children: children }));
34
+ return (_jsx("span", { "data-glim": "Badge", title: title, role: ariaLabel ? "img" : undefined, "aria-label": ariaLabel, style: hueStyle, className: classes, children: children }));
35
35
  }
@@ -0,0 +1,18 @@
1
+ import { type ReactNode } from "react";
2
+ import { type CarouselText } from "@glimstone/core";
3
+ export type { CarouselText } from "@glimstone/core";
4
+ export interface CarouselProps<T> {
5
+ /** The carousel's accessible name. */
6
+ label: string;
7
+ items: readonly T[];
8
+ /** The page in force, counted from 0. Left out, it keeps its own. */
9
+ page?: number;
10
+ onPageChange?: (page: number) => void;
11
+ slidesPerPage?: number;
12
+ /** Goes from the last page on to the first. */
13
+ loop?: boolean;
14
+ /** Draws a slide. */
15
+ slide: (item: T, index: number) => ReactNode;
16
+ text?: Partial<CarouselText>;
17
+ }
18
+ export declare function Carousel<T>({ label, items, page, onPageChange, slidesPerPage, loop, slide, text }: CarouselProps<T>): import("react").JSX.Element;
@@ -0,0 +1,27 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useId, useState } from "react";
3
+ import * as carousel from "@zag-js/carousel";
4
+ import { normalizeProps, useMachine } from "@zag-js/react";
5
+ import { CAROUSEL_TEXT, pageDir, stillMotion } from "@glimstone/core";
6
+ import { Button } from "./Button.js";
7
+ import { IconBack, IconForward } from "./glyphs.js";
8
+ export function Carousel({ label, items, page, onPageChange, slidesPerPage = 1, loop = false, slide, text }) {
9
+ const words = { ...CAROUSEL_TEXT, ...text };
10
+ const [own, setOwn] = useState(0);
11
+ const service = useMachine(carousel.machine, {
12
+ id: useId(),
13
+ dir: pageDir(),
14
+ slideCount: items.length,
15
+ slidesPerPage,
16
+ loop,
17
+ page: page ?? own,
18
+ spacing: "var(--space-6)",
19
+ onPageChange: (d) => {
20
+ setOwn(d.page);
21
+ onPageChange?.(d.page);
22
+ },
23
+ translations: { item: (index, count) => words.slide(index + 1, count), indicator: (index) => words.goTo(index + 1) },
24
+ });
25
+ const api = carousel.connect(service, normalizeProps);
26
+ return (_jsxs("section", { "data-glim": "Carousel", ...api.getRootProps(), "aria-label": label, className: "glim-carousel", children: [_jsx("div", { ...api.getItemGroupProps(), className: "glim-carousel-slides", children: items.map((item, index) => (_jsx("div", { ...api.getItemProps({ index }), className: "glim-carousel-slide", children: slide(item, index) }, index))) }), _jsxs("div", { ...api.getControlProps(), className: "glim-carousel-control", children: [_jsx(Button, { label: words.previous, labelKey: null, glyph: _jsx(IconBack, {}), variant: "icon", disabled: !api.canScrollPrev, onClick: () => api.scrollPrev(stillMotion()) }), _jsx("div", { ...api.getIndicatorGroupProps(), className: "glim-carousel-dots", children: api.pageSnapPoints.map((_, index) => (_jsx("button", { ...api.getIndicatorProps({ index }), onClick: () => api.scrollTo(index, stillMotion()), className: "glim-carousel-dot" }, index))) }), _jsx(Button, { label: words.next, labelKey: null, glyph: _jsx(IconForward, {}), variant: "icon", disabled: !api.canScrollNext, onClick: () => api.scrollNext(stillMotion()) })] })] }));
27
+ }
package/dist/Checkbox.js CHANGED
@@ -3,5 +3,5 @@ import { IconCheck } from "./glyphs.js";
3
3
  export function Checkbox({ checked, onChange, label, hideLabel = false, slim = false, disabled, className }) {
4
4
  const bare = hideLabel || slim;
5
5
  const classes = ["glim-checkbox", slim && "glim-checkbox--slim", className].filter(Boolean).join(" ");
6
- return (_jsxs("button", { "data-glim": "Checkbox", 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 })] }));
6
+ return (_jsxs("button", { "data-glim": "Checkbox", type: "button", role: "checkbox", "aria-checked": checked, "aria-label": bare ? label : undefined, disabled: disabled, onClick: () => onChange(!checked), onKeyDown: (e) => e.key === "Enter" && e.preventDefault(), className: classes, children: [_jsx("span", { className: "glim-checkbox-box", "aria-hidden": "true", children: _jsx(IconCheck, {}) }), !bare && _jsx("span", { children: label })] }));
7
7
  }
@@ -0,0 +1,12 @@
1
+ import { type ReactNode } from "react";
2
+ export interface CollapsibleProps {
3
+ /** The words on the row that opens it, which are also its accessible name. */
4
+ label: string;
5
+ /** Whether it is open. Left out, it keeps its own state from `defaultOpen`. */
6
+ open?: boolean;
7
+ onOpenChange?: (open: boolean) => void;
8
+ defaultOpen?: boolean;
9
+ disabled?: boolean;
10
+ children: ReactNode;
11
+ }
12
+ export declare function Collapsible({ label, open, onOpenChange, defaultOpen, disabled, children }: CollapsibleProps): import("react").JSX.Element;
@@ -0,0 +1,21 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useId, useState } from "react";
3
+ import * as collapsible from "@zag-js/collapsible";
4
+ import { normalizeProps, useMachine } from "@zag-js/react";
5
+ import { pageDir } from "@glimstone/core";
6
+ import { IconExpand } from "./glyphs.js";
7
+ export function Collapsible({ label, open, onOpenChange, defaultOpen = false, disabled = false, children }) {
8
+ const [own, setOwn] = useState(defaultOpen);
9
+ const service = useMachine(collapsible.machine, {
10
+ id: useId(),
11
+ dir: pageDir(),
12
+ open: open ?? own,
13
+ disabled,
14
+ onOpenChange: (d) => {
15
+ setOwn(d.open);
16
+ onOpenChange?.(d.open);
17
+ },
18
+ });
19
+ const api = collapsible.connect(service, normalizeProps);
20
+ return (_jsxs("div", { "data-glim": "Collapsible", ...api.getRootProps(), className: "glim-collapsible", children: [_jsxs("button", { ...api.getTriggerProps(), className: "glim-disclosure-trigger", children: [_jsx("span", { className: "glim-disclosure-label", children: label }), _jsx("span", { ...api.getIndicatorProps(), className: "glim-disclosure-indicator", children: _jsx(IconExpand, {}) })] }), _jsx("div", { ...api.getContentProps(), className: "glim-disclosure-content", children: _jsx("div", { className: "glim-disclosure-body", children: children }) })] }));
21
+ }
@@ -21,5 +21,7 @@ export interface ContextMenuProps {
21
21
  onClose: () => void;
22
22
  /** Left or right on a row without a submenu, for a bar that steps to the next menu. */
23
23
  onStep?: (direction: 1 | -1) => void;
24
+ /** Opens with the focus on the last row, as ArrowUp on a menu bar's word asks. */
25
+ fromEnd?: boolean;
24
26
  }
25
- export declare function ContextMenu({ x, y, items, above, label, id, opener, onClose, onStep }: ContextMenuProps): import("react").JSX.Element;
27
+ export declare function ContextMenu({ x, y, items, above, label, id, opener, onClose, onStep, fromEnd }: ContextMenuProps): import("react").JSX.Element;
@@ -8,7 +8,7 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
8
8
  // caller flips `checked` and the row follows.
9
9
  import { useLayoutEffect, useRef, useState } from "react";
10
10
  import { createPortal } from "react-dom";
11
- import { claimMenu, closeMenuOutside, focusedAsker, focusFirstMenuRow, focusMenuRow, isMenuHead, menuMove, menuRowView, placeMenu, placeSubmenu, returnFocus, tidyMenu, portalTarget, } from "@glimstone/core";
11
+ import { claimMenu, closeMenuOutside, focusedAsker, focusFirstMenuRow, focusMenuRow, focusMenuRowByLetter, isTypeahead, isMenuHead, menuMove, menuRowView, placeMenu, placeSubmenu, returnFocus, tidyMenu, portalTarget, } from "@glimstone/core";
12
12
  import { IconCheck, IconExpand, IconPencil } from "./glyphs.js";
13
13
  import { Kbd } from "./Kbd.js";
14
14
  import { useTipBubble } from "./useTipBubble.js";
@@ -28,7 +28,7 @@ function Rows({ entries, openAt, onPick, }) {
28
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
29
  });
30
30
  }
31
- export function ContextMenu({ x, y, items, above = false, label, id, opener, onClose, onStep }) {
31
+ export function ContextMenu({ x, y, items, above = false, label, id, opener, onClose, onStep, fromEnd = false }) {
32
32
  const menu = useRef(null);
33
33
  const subMenu = useRef(null);
34
34
  const [asker] = useState(focusedAsker);
@@ -57,7 +57,10 @@ export function ContextMenu({ x, y, items, above = false, label, id, opener, onC
57
57
  useLayoutEffect(() => {
58
58
  const release = claimMenu(finish);
59
59
  const outside = closeMenuOutside(() => [menu.current, subMenu.current, latest.current.opener], () => finish(false));
60
- focusFirstMenuRow(menu.current);
60
+ if (fromEnd)
61
+ focusMenuRow(menu.current, "last");
62
+ else
63
+ focusFirstMenuRow(menu.current);
61
64
  return () => {
62
65
  release();
63
66
  outside();
@@ -99,6 +102,11 @@ export function ContextMenu({ x, y, items, above = false, label, id, opener, onC
99
102
  function keys(e, inSub) {
100
103
  if (e.key === "Tab")
101
104
  return finish(false);
105
+ if (isTypeahead(e.nativeEvent)) {
106
+ if (focusMenuRowByLetter(e.currentTarget, e.key))
107
+ e.preventDefault();
108
+ return;
109
+ }
102
110
  const move = menuMove(e.key, getComputedStyle(e.currentTarget).direction === "rtl");
103
111
  if (!move)
104
112
  return;
@@ -1,32 +1,6 @@
1
1
  import type { ReactNode, Ref } from "react";
2
- /** One address, and the chain it lives on. */
3
- export interface CryptoNetwork {
4
- /** Stable id, for the copy toast and for the app's own tests. */
5
- id: string;
6
- /** The chain as a donor's wallet names it. */
7
- name: string;
8
- address: string;
9
- /** One short line shown with the address, for what a donor has to know
10
- * before sending. Already translated. */
11
- note?: string;
12
- }
13
- /** One coin, and every chain it can be sent on. */
14
- export interface CryptoCoin {
15
- /** Stable id, and the key `renderMark` draws by. */
16
- id: string;
17
- /** The ticker, on the tile under the mark. */
18
- symbol: string;
19
- /** The full name, for the accessible label. */
20
- name: string;
21
- /** Never empty, and every entry carries an address. */
22
- networks: CryptoNetwork[];
23
- /** The coin's own colour and the ink that holds on it, which its tile lights
24
- * up in under the pointer ("Brand tiles"). The picked coin keeps the accent. */
25
- tile?: {
26
- color: string;
27
- ink: string;
28
- };
29
- }
2
+ import { type CryptoCoin, type CryptoNetwork } from "@glimstone/core";
3
+ export type { CryptoCoin, CryptoNetwork } from "@glimstone/core";
30
4
  export interface CryptoDonateDialogProps {
31
5
  /** The coins on offer. See the rule at the top of this file. */
32
6
  coins: CryptoCoin[];
@@ -0,0 +1,16 @@
1
+ import { type DatePickerText } from "@glimstone/core";
2
+ export type { DatePickerText, DateView } from "@glimstone/core";
3
+ export interface DatePickerProps {
4
+ label?: string;
5
+ /** The day as "2026-11-14", or null for none. */
6
+ value: string | null;
7
+ onChange: (value: string | null) => void;
8
+ /** The first and the last day it offers, as "2026-11-14". */
9
+ min?: string;
10
+ max?: string;
11
+ /** The language the calendar is drawn in; the page's by default. */
12
+ locale?: string;
13
+ disabled?: boolean;
14
+ text?: Partial<DatePickerText>;
15
+ }
16
+ export declare function DatePicker({ label, value, onChange, min, max, locale, disabled, text }: DatePickerProps): import("react").JSX.Element;
@@ -0,0 +1,39 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useId, useRef } from "react";
3
+ import * as datePicker from "@zag-js/date-picker";
4
+ import { normalizeProps, Portal, useMachine } from "@zag-js/react";
5
+ import { DATE_PICKER_TEXT, formatDay, pageDir, pageLocale, portalTarget, SELECT_POSITIONING } from "@glimstone/core";
6
+ import { useFieldName } from "./fieldName.js";
7
+ import { IconBack, IconCalendar, IconForward } from "./glyphs.js";
8
+ import { usePortalHue } from "./portalHue.js";
9
+ export function DatePicker({ label, value, onChange, min, max, locale, disabled = false, text }) {
10
+ const name = useFieldName(label);
11
+ const words = { ...DATE_PICKER_TEXT, ...text };
12
+ const lang = locale ?? pageLocale();
13
+ const shown = value ? formatDay(value, lang) : words.placeholder;
14
+ const service = useMachine(datePicker.machine, {
15
+ id: useId(),
16
+ dir: pageDir(),
17
+ locale: lang,
18
+ value: value ? [datePicker.parse(value)] : [],
19
+ min: min ? datePicker.parse(min) : undefined,
20
+ max: max ? datePicker.parse(max) : undefined,
21
+ disabled,
22
+ positioning: SELECT_POSITIONING,
23
+ onValueChange: (d) => onChange(d.value[0]?.toString() ?? null),
24
+ translations: {
25
+ content: words.calendar,
26
+ trigger: () => (name ? `${name}, ${shown}` : shown),
27
+ prevTrigger: (view) => words.previous[view],
28
+ nextTrigger: (view) => words.next[view],
29
+ viewTrigger: () => words.zoomOut,
30
+ },
31
+ });
32
+ const api = datePicker.connect(service, normalizeProps);
33
+ const triggerRef = useRef(null);
34
+ const hue = usePortalHue(api.open, triggerRef);
35
+ const positioner = api.getPositionerProps();
36
+ const months = api.getMonthsGrid({ columns: 4, format: "short" });
37
+ const years = api.getYearsGrid({ columns: 4 });
38
+ return (_jsxs("div", { "data-glim": "DatePicker", ...api.getRootProps(), className: "glim-date", children: [_jsx("label", { ...api.getLabelProps(), className: label === undefined ? "glim-sr-only" : "glim-field-label", children: name }), _jsx("div", { ...api.getControlProps(), className: "glim-date-control", children: _jsxs("button", { ...api.getTriggerProps(), ref: triggerRef, className: "glim-input glim-date-trigger", children: [_jsx("span", { className: value ? "glim-date-value" : "glim-date-value glim-date-value--empty", children: shown }), _jsx(IconCalendar, {})] }) }), _jsx(Portal, { container: { current: portalTarget() }, children: _jsx("div", { ...positioner, style: { ...positioner.style, ...hue.style }, className: `glim-date-positioner ${hue.className}`.trim(), children: _jsxs("div", { ...api.getContentProps(), className: "glim-date-panel", children: [_jsxs("div", { ...api.getViewProps({ view: "day" }), hidden: api.view !== "day", children: [_jsxs("div", { ...api.getViewControlProps({ view: "day" }), className: "glim-date-head", children: [_jsx("button", { ...api.getPrevTriggerProps({ view: "day" }), className: "glim-date-step", children: _jsx(IconBack, {}) }), _jsx("button", { ...api.getViewTriggerProps({ view: "day" }), className: "glim-date-title", children: api.visibleRangeText.start }), _jsx("button", { ...api.getNextTriggerProps({ view: "day" }), className: "glim-date-step", children: _jsx(IconForward, {}) })] }), _jsxs("table", { ...api.getTableProps({ view: "day" }), className: "glim-date-grid", children: [_jsx("thead", { ...api.getTableHeadProps({ view: "day" }), children: _jsx("tr", { ...api.getTableRowProps({ view: "day" }), children: api.weekDays.map((day, i) => (_jsx("th", { scope: "col", "aria-label": day.long, className: "glim-date-weekday", children: day.narrow }, i))) }) }), _jsx("tbody", { ...api.getTableBodyProps({ view: "day" }), children: api.weeks.map((week, i) => (_jsx("tr", { ...api.getTableRowProps({ view: "day" }), children: week.map((day, j) => (_jsx("td", { ...api.getDayTableCellProps({ value: day }), children: _jsx("div", { ...api.getDayTableCellTriggerProps({ value: day }), className: "glim-date-cell glim-num", children: day.day }) }, j))) }, i))) })] })] }), _jsxs("div", { ...api.getViewProps({ view: "month" }), hidden: api.view !== "month", children: [_jsxs("div", { ...api.getViewControlProps({ view: "month" }), className: "glim-date-head", children: [_jsx("button", { ...api.getPrevTriggerProps({ view: "month" }), className: "glim-date-step", children: _jsx(IconBack, {}) }), _jsx("button", { ...api.getViewTriggerProps({ view: "month" }), className: "glim-date-title", children: api.visibleRange.start.year }), _jsx("button", { ...api.getNextTriggerProps({ view: "month" }), className: "glim-date-step", children: _jsx(IconForward, {}) })] }), _jsx("table", { ...api.getTableProps({ view: "month", columns: 4 }), className: "glim-date-grid", children: _jsx("tbody", { ...api.getTableBodyProps({ view: "month" }), children: months.map((row, i) => (_jsx("tr", { ...api.getTableRowProps(), children: row.map((month, j) => (_jsx("td", { ...api.getMonthTableCellProps({ ...month, columns: 4 }), children: _jsx("div", { ...api.getMonthTableCellTriggerProps({ ...month, columns: 4 }), className: "glim-date-cell glim-date-cell--wide", children: month.label }) }, j))) }, i))) }) })] }), _jsxs("div", { ...api.getViewProps({ view: "year" }), hidden: api.view !== "year", children: [_jsxs("div", { ...api.getViewControlProps({ view: "year" }), className: "glim-date-head", children: [_jsx("button", { ...api.getPrevTriggerProps({ view: "year" }), className: "glim-date-step", children: _jsx(IconBack, {}) }), _jsx("span", { className: "glim-date-title glim-num", children: `${api.getDecade().start} - ${api.getDecade().end}` }), _jsx("button", { ...api.getNextTriggerProps({ view: "year" }), className: "glim-date-step", children: _jsx(IconForward, {}) })] }), _jsx("table", { ...api.getTableProps({ view: "year", columns: 4 }), className: "glim-date-grid", children: _jsx("tbody", { ...api.getTableBodyProps({ view: "year" }), children: years.map((row, i) => (_jsx("tr", { ...api.getTableRowProps({ view: "year" }), children: row.map((year, j) => (_jsx("td", { ...api.getYearTableCellProps({ ...year, columns: 4 }), children: _jsx("div", { ...api.getYearTableCellTriggerProps({ ...year, columns: 4 }), className: "glim-date-cell glim-date-cell--wide glim-num", children: year.label }) }, j))) }, i))) }) })] })] }) }) })] }));
39
+ }
@@ -18,5 +18,5 @@ export interface DropdownListboxProps {
18
18
  /** The `role="option"` buttons. */
19
19
  children: ReactNode;
20
20
  }
21
- /** @deprecated Use Select, which keeps focus on its trigger and adds typeahead. */
21
+ /** @deprecated Use Select, which keeps focus on its trigger and adds typeahead. Removed in 5.0.0. */
22
22
  export declare function DropdownListbox({ open, onClose, triggerRef, label, multiselectable, children, }: DropdownListboxProps): import("react").ReactPortal | null;
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useEffect, useLayoutEffect, useRef, useState, } from "react";
3
3
  import { createPortal } from "react-dom";
4
- import { computeBubblePosition, portalTarget } from "@glimstone/core";
4
+ import { computeBubblePosition, focusByLetter, isTypeahead, portalTarget, warnDeprecated } from "@glimstone/core";
5
5
  import { usePortalHue } from "./portalHue.js";
6
6
  // The `role="listbox"` panel a button-opens-a-list picker drops open. It is
7
7
  // portalled to <body> (portalTarget), because a card with `overflow: hidden` clips an
@@ -15,8 +15,9 @@ import { usePortalHue } from "./portalHue.js";
15
15
  /** The gap to the trigger and the minimum distance from the viewport edge,
16
16
  * 4px to match `mt-1`. */
17
17
  const DROPDOWN_GAP = 4;
18
- /** @deprecated Use Select, which keeps focus on its trigger and adds typeahead. */
18
+ /** @deprecated Use Select, which keeps focus on its trigger and adds typeahead. Removed in 5.0.0. */
19
19
  export function DropdownListbox({ open, onClose, triggerRef, label, multiselectable, children, }) {
20
+ warnDeprecated("DropdownListbox");
20
21
  const panelRef = useRef(null);
21
22
  const [pos, setPos] = useState(null);
22
23
  // One focus move per opening, once the panel sits at its real coordinates.
@@ -141,9 +142,15 @@ export function DropdownListbox({ open, onClose, triggerRef, label, multiselecta
141
142
  focusInsideRef.current = false;
142
143
  };
143
144
  }, [open, triggerRef]);
144
- // Arrows, Home and End move between options here so every listbox behaves
145
- // alike. Enter and Space need nothing: the options are real buttons.
145
+ // Arrows, Home, End and a typed letter move between options here so every
146
+ // listbox behaves alike. Enter and Space need nothing: the options are real
147
+ // buttons.
146
148
  function onPanelKeyDown(e) {
149
+ if (isTypeahead(e.nativeEvent)) {
150
+ if (focusByLetter(options(), e.key))
151
+ e.preventDefault();
152
+ return;
153
+ }
147
154
  if (e.key !== "ArrowDown" && e.key !== "ArrowUp" && e.key !== "Home" && e.key !== "End")
148
155
  return;
149
156
  const opts = options();
@@ -0,0 +1,15 @@
1
+ import { type FileUploadText } from "@glimstone/core";
2
+ export type { FileRefusal, FileUploadText } from "@glimstone/core";
3
+ export interface FileUploadProps {
4
+ label: string;
5
+ value: File[];
6
+ onChange: (files: File[]) => void;
7
+ /** The kinds of file it takes, as media types such as "image/*" or "application/json". */
8
+ accept?: string[];
9
+ maxFiles?: number;
10
+ /** The largest file it takes, in bytes. */
11
+ maxFileSize?: number;
12
+ disabled?: boolean;
13
+ text?: Partial<FileUploadText>;
14
+ }
15
+ export declare function FileUpload({ label, value, onChange, accept, maxFiles, maxFileSize, disabled, text }: FileUploadProps): import("react").JSX.Element;
@@ -0,0 +1,23 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useId } from "react";
3
+ import * as fileUpload from "@zag-js/file-upload";
4
+ import { normalizeProps, useMachine } from "@zag-js/react";
5
+ import { FILE_UPLOAD_TEXT, formatFileSize, pageDir } from "@glimstone/core";
6
+ import { IconButton } from "./IconButton.js";
7
+ import { IconClose, IconUpload } from "./glyphs.js";
8
+ export function FileUpload({ label, value, onChange, accept, maxFiles = 1, maxFileSize, disabled = false, text }) {
9
+ const words = { ...FILE_UPLOAD_TEXT, ...text };
10
+ const service = useMachine(fileUpload.machine, {
11
+ id: useId(),
12
+ dir: pageDir(),
13
+ acceptedFiles: value,
14
+ accept: accept,
15
+ maxFiles,
16
+ maxFileSize,
17
+ disabled,
18
+ onFileChange: (d) => onChange(d.acceptedFiles),
19
+ translations: { dropzone: words.drop, deleteFile: (file) => words.remove(file.name) },
20
+ });
21
+ const api = fileUpload.connect(service, normalizeProps);
22
+ return (_jsxs("div", { "data-glim": "FileUpload", ...api.getRootProps(), className: "glim-upload", children: [_jsx("label", { ...api.getLabelProps(), className: "glim-field-label", children: label }), _jsxs("div", { ...api.getDropzoneProps(), className: "glim-upload-drop", children: [_jsx(IconUpload, {}), _jsx("span", { className: "glim-upload-words", children: words.drop })] }), _jsx("input", { ...api.getHiddenInputProps() }), api.acceptedFiles.length > 0 && (_jsx("ul", { ...api.getItemGroupProps(), className: "glim-upload-files", children: api.acceptedFiles.map((file) => (_jsxs("li", { ...api.getItemProps({ file }), className: "glim-upload-file", children: [_jsx("span", { ...api.getItemNameProps({ file }), className: "glim-upload-name", children: file.name }), _jsx("span", { ...api.getItemSizeTextProps({ file }), className: "glim-upload-size glim-num", children: formatFileSize(file.size) }), _jsx(IconButton, { tip: words.remove(file.name), glyph: _jsx(IconClose, {}), onClick: () => api.deleteFile(file) })] }, `${file.name}-${file.size}`))) })), api.rejectedFiles.map(({ file, errors }) => (_jsx("p", { className: "glim-field-error", children: words.refused(file.name, errors[0]) }, `${file.name}-${file.size}`)))] }));
23
+ }
@@ -0,0 +1,14 @@
1
+ import { type ReactNode } from "react";
2
+ import { type FloatingPanelText, type PanelSize } from "@glimstone/core";
3
+ export type { FloatingPanelText, PanelSize } from "@glimstone/core";
4
+ export interface FloatingPanelProps {
5
+ title: string;
6
+ open: boolean;
7
+ onOpenChange: (open: boolean) => void;
8
+ /** The size it opens at. */
9
+ defaultSize?: PanelSize;
10
+ resizable?: boolean;
11
+ children: ReactNode;
12
+ text?: Partial<FloatingPanelText>;
13
+ }
14
+ export declare function FloatingPanel({ title, open, onOpenChange, defaultSize, resizable, children, text }: FloatingPanelProps): import("react").JSX.Element;
@@ -0,0 +1,25 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useId } from "react";
3
+ import * as floatingPanel from "@zag-js/floating-panel";
4
+ import { normalizeProps, Portal, useMachine } from "@zag-js/react";
5
+ import { FLOATING_PANEL_TEXT, pageDir, portalTarget } from "@glimstone/core";
6
+ import { Badge } from "./Badge.js";
7
+ import { Button } from "./Button.js";
8
+ import { IconClose, IconWindowMaximise, IconWindowMinimise, IconWindowRestore } from "./glyphs.js";
9
+ const AXES = ["n", "e", "s", "w", "ne", "se", "sw", "nw"];
10
+ export function FloatingPanel({ title, open, onOpenChange, defaultSize = { width: 360, height: 280 }, resizable = true, children, text }) {
11
+ const words = { ...FLOATING_PANEL_TEXT, ...text };
12
+ const service = useMachine(floatingPanel.machine, {
13
+ id: useId(),
14
+ dir: pageDir(),
15
+ open,
16
+ defaultSize,
17
+ resizable,
18
+ strategy: "fixed",
19
+ closeOnEscape: true,
20
+ onOpenChange: (d) => onOpenChange(d.open),
21
+ translations: { minimize: words.minimize, maximize: words.maximize, restore: words.restore },
22
+ });
23
+ const api = floatingPanel.connect(service, normalizeProps);
24
+ return (_jsx(Portal, { container: { current: portalTarget() }, children: _jsx("div", { "data-glim": "FloatingPanel", className: "glim-fpanel-layer", children: _jsx("div", { ...api.getPositionerProps(), className: "glim-fpanel-positioner", children: _jsxs("div", { ...api.getContentProps(), className: "glim-fpanel", children: [_jsx("div", { ...api.getDragTriggerProps(), className: "glim-fpanel-drag", children: _jsxs("div", { ...api.getHeaderProps(), className: "glim-fpanel-head", children: [_jsx("h2", { ...api.getTitleProps(), className: "glim-panel-heading", children: _jsx(Badge, { tone: "heading", size: "heading", wrap: true, children: title }) }), _jsxs("div", { ...api.getControlProps(), className: "glim-fpanel-control", children: [_jsx("button", { ...api.getStageTriggerProps({ stage: "minimized" }), className: "glim-btn-bare glim-icon-btn", children: _jsx(IconWindowMinimise, {}) }), _jsx("button", { ...api.getStageTriggerProps({ stage: "maximized" }), className: "glim-btn-bare glim-icon-btn", children: _jsx(IconWindowMaximise, {}) }), _jsx("button", { ...api.getStageTriggerProps({ stage: "default" }), className: "glim-btn-bare glim-icon-btn", children: _jsx(IconWindowRestore, {}) })] })] }) }), _jsx("div", { ...api.getBodyProps(), className: "glim-fpanel-body", children: children }), _jsx("div", { className: "glim-fpanel-foot", children: _jsx(Button, { label: words.close, labelKey: null, glyph: _jsx(IconClose, {}), onClick: () => api.setOpen(false) }) }), resizable && AXES.map((axis) => _jsx("div", { ...api.getResizeTriggerProps({ axis }), className: "glim-fpanel-edge" }, axis))] }) }) }) }));
25
+ }
@@ -1,17 +1,6 @@
1
1
  import { type ReactNode } from "react";
2
- import { type ChangeAnswer, type FortressAnswer, type FortressApp, type FortressInstance, type FortressPermission, type FortressText, type PhraseAnswer, type ToastSeverity } from "@glimstone/core";
3
- export type { ChangeAnswer, FortressAnswer, FortressText, PhraseAnswer } from "@glimstone/core";
4
- /** The label keys behind the fortress's buttons, which pick their glyphs (see Button). */
5
- export interface FortressLabelKeys {
6
- join: string;
7
- leave: string;
8
- showPhrase: string;
9
- changePhrase: string;
10
- remove: string;
11
- later: string;
12
- unlock: string;
13
- copy: string;
14
- }
2
+ import { type ChangeAnswer, type FortressAnswer, type FortressApp, type FortressInstance, type FortressLabelKeys, type FortressPermission, type FortressText, type PhraseAnswer, type ToastSeverity } from "@glimstone/core";
3
+ export type { ChangeAnswer, FortressAnswer, FortressLabelKeys, FortressText, PhraseAnswer } from "@glimstone/core";
15
4
  export interface FortressProps {
16
5
  text: FortressText;
17
6
  /** The interface language, for counts and lists. */
@@ -0,0 +1,12 @@
1
+ import { type ReactNode } from "react";
2
+ export interface HoverCardProps {
3
+ /** The link's words. */
4
+ label: string;
5
+ href: string;
6
+ /** How long the pointer rests before the card opens, and after it leaves before it closes, in ms. */
7
+ openDelay?: number;
8
+ closeDelay?: number;
9
+ /** Draws the card. */
10
+ content: () => ReactNode;
11
+ }
12
+ export declare function HoverCard({ label, href, openDelay, closeDelay, content }: HoverCardProps): import("react").JSX.Element;
@@ -0,0 +1,20 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useId, useRef } from "react";
3
+ import * as hoverCard from "@zag-js/hover-card";
4
+ import { normalizeProps, Portal, useMachine } from "@zag-js/react";
5
+ import { pageDir, portalTarget } from "@glimstone/core";
6
+ import { usePortalHue } from "./portalHue.js";
7
+ export function HoverCard({ label, href, openDelay = 600, closeDelay = 300, content }) {
8
+ const service = useMachine(hoverCard.machine, {
9
+ id: useId(),
10
+ dir: pageDir(),
11
+ openDelay,
12
+ closeDelay,
13
+ positioning: { placement: "bottom", gutter: 8 },
14
+ });
15
+ const api = hoverCard.connect(service, normalizeProps);
16
+ const triggerRef = useRef(null);
17
+ const hue = usePortalHue(api.open, triggerRef);
18
+ const positioner = api.getPositionerProps();
19
+ return (_jsxs(_Fragment, { children: [_jsx("a", { "data-glim": "HoverCard", ...api.getTriggerProps(), ref: triggerRef, href: href, className: "glim-hovercard-link", children: label }), api.open && (_jsx(Portal, { container: { current: portalTarget() }, children: _jsx("div", { ...positioner, style: { ...positioner.style, ...hue.style }, className: `glim-hovercard-positioner ${hue.className}`.trim(), children: _jsx("div", { ...api.getContentProps(), className: "glim-hovercard", children: content() }) }) }))] }));
20
+ }
@@ -10,7 +10,7 @@ import { useTipBubble } from "./useTipBubble.js";
10
10
  // has less margin on a busy fill.
11
11
  export function InfoBubble({ tip, onAccent = false }) {
12
12
  const tooltip = useTipBubble(tip);
13
- return (_jsxs(_Fragment, { children: [_jsx("span", { "data-glim": "InfoBubble", ref: tooltip.ref, "aria-label": tip, "aria-describedby": tooltip.describedBy, tabIndex: 0, ...tooltip.handlers,
13
+ return (_jsxs(_Fragment, { children: [_jsx("span", { "data-glim": "InfoBubble", ref: tooltip.ref, role: "img", "aria-label": tip, "aria-describedby": tooltip.describedBy, tabIndex: 0, ...tooltip.handlers,
14
14
  // Inside a <label>, a click on a span is forwarded to the label's field,
15
15
  // which takes focus and closes the bubble at once. stopPropagation does
16
16
  // not stop the native forwarding; preventDefault does, and the span
@@ -1,8 +1,6 @@
1
1
  import type { HTMLAttributes, ReactNode } from "react";
2
- export interface InstanceFigure {
3
- value: string;
4
- label: string;
5
- }
2
+ import { type InstanceFigure } from "@glimstone/core";
3
+ export type { InstanceFigure } from "@glimstone/core";
6
4
  export interface InstanceCardProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
7
5
  /** The app's mark, as an address or as an inline `<svg>`. */
8
6
  logo?: string | ReactNode;