@glimstone/solid 0.0.0-stage → 4.5.1
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 +50 -2
- package/dist/AboutCard.d.ts +154 -0
- package/dist/Accordion.d.ts +15 -0
- package/dist/Accordion.js +45 -0
- package/dist/AngleSlider.d.ts +10 -0
- package/dist/AngleSlider.js +47 -0
- package/dist/Avatar.d.ts +11 -0
- package/dist/Avatar.js +50 -0
- package/dist/Badge-CC2mjBLM.js +116 -0
- package/dist/Badge.d.ts +52 -0
- package/dist/BusyRing.d.ts +13 -0
- package/dist/Button-DNSkNN0r.js +219 -0
- package/dist/Button.d.ts +56 -0
- package/dist/Card.d.ts +33 -0
- package/dist/Carousel.d.ts +18 -0
- package/dist/Carousel.js +88 -0
- package/dist/Checkbox.d.ts +14 -0
- package/dist/CoffeeDialog.d.ts +16 -0
- package/dist/Collapsible.d.ts +12 -0
- package/dist/Collapsible.js +27 -0
- package/dist/ColorPicker.d.ts +21 -0
- package/dist/Combobox.d.ts +16 -0
- package/dist/Combobox.js +64 -0
- package/dist/ConfirmDialog.d.ts +29 -0
- package/dist/ContextMenu.d.ts +27 -0
- package/dist/CopyField.d.ts +17 -0
- package/dist/CryptoDonateDialog.d.ts +35 -0
- package/dist/DatePicker.d.ts +17 -0
- package/dist/DatePicker.js +132 -0
- package/dist/DropdownListbox.d.ts +22 -0
- package/dist/EmptyState.d.ts +19 -0
- package/dist/FieldError.d.ts +8 -0
- package/dist/FieldRow.d.ts +20 -0
- package/dist/FieldRowGroup.d.ts +10 -0
- package/dist/FileUpload.d.ts +15 -0
- package/dist/FileUpload.js +68 -0
- package/dist/FloatingPanel.d.ts +14 -0
- package/dist/FloatingPanel.js +80 -0
- package/dist/Fortress.d.ts +101 -0
- package/dist/FortressAppCard.d.ts +39 -0
- package/dist/FortressPermissions.d.ts +23 -0
- package/dist/FortressStatusWindow.d.ts +25 -0
- package/dist/GlyphField.d.ts +16 -0
- package/dist/GlyphTile.d.ts +12 -0
- package/dist/HoverCard.d.ts +12 -0
- package/dist/HoverCard.js +55 -0
- package/dist/IconButton-Lzbq5Cst.js +42 -0
- package/dist/IconButton.d.ts +16 -0
- package/dist/IconTipButton-BojUYQWU.js +73 -0
- package/dist/IconTipButton.d.ts +20 -0
- package/dist/InfoBubble.d.ts +4 -0
- package/dist/InstanceCard.d.ts +25 -0
- package/dist/Kbd.d.ts +5 -0
- package/dist/Lift-CsM0IU9t.js +13 -0
- package/dist/Lift.d.ts +12 -0
- package/dist/ListRow.d.ts +16 -0
- package/dist/ListTable.d.ts +21 -0
- package/dist/Marquee.d.ts +16 -0
- package/dist/Marquee.js +59 -0
- package/dist/MenuBar.d.ts +17 -0
- package/dist/Meter.d.ts +18 -0
- package/dist/NumberField.d.ts +20 -0
- package/dist/Pagination.d.ts +14 -0
- package/dist/Pagination.js +77 -0
- package/dist/PasswordField.d.ts +17 -0
- package/dist/PathField.d.ts +28 -0
- package/dist/PaypalDialog.d.ts +51 -0
- package/dist/Pill.d.ts +12 -0
- package/dist/PinInput.d.ts +21 -0
- package/dist/PinInput.js +50 -0
- package/dist/Popover.d.ts +14 -0
- package/dist/ProgressBar.d.ts +14 -0
- package/dist/Rating.d.ts +15 -0
- package/dist/Rating.js +45 -0
- package/dist/ReadmeButton.d.ts +29 -0
- package/dist/RowMark.d.ts +5 -0
- package/dist/ScrollArea.d.ts +9 -0
- package/dist/ScrollArea.js +31 -0
- package/dist/Select.d.ts +48 -0
- package/dist/Select.js +548 -0
- package/dist/Selector.d.ts +76 -0
- package/dist/Sheet.d.ts +21 -0
- package/dist/SidebarRow.d.ts +28 -0
- package/dist/SignInCard.d.ts +40 -0
- package/dist/SignaturePad.d.ts +11 -0
- package/dist/SignaturePad.js +65 -0
- package/dist/SkeletonRow.d.ts +10 -0
- package/dist/Slider.d.ts +12 -0
- package/dist/Slider.js +34 -0
- package/dist/Splitter.d.ts +14 -0
- package/dist/Splitter.js +54 -0
- package/dist/Steps.d.ts +17 -0
- package/dist/Steps.js +112 -0
- package/dist/SubCard.d.ts +17 -0
- package/dist/Table.d.ts +14 -0
- package/dist/TagsInput.d.ts +15 -0
- package/dist/TagsInput.js +57 -0
- package/dist/TextField.d.ts +25 -0
- package/dist/Timer.d.ts +15 -0
- package/dist/Timer.js +98 -0
- package/dist/TipWrap.d.ts +12 -0
- package/dist/Toast.d.ts +27 -0
- package/dist/Toggle.d.ts +23 -0
- package/dist/Tour.d.ts +10 -0
- package/dist/Tour.js +83 -0
- package/dist/Tree.d.ts +20 -0
- package/dist/UnavailableNotice.d.ts +15 -0
- package/dist/Window.d.ts +30 -0
- package/dist/WindowBar.d.ts +25 -0
- package/dist/WindowFootRow.d.ts +25 -0
- package/dist/engines.d.ts +17 -0
- package/dist/fieldName-Bb6qW0oS.js +8 -0
- package/dist/fieldName.d.ts +5 -0
- package/dist/glyphs-xP5bYKa1.js +127 -0
- package/dist/glyphs.d.ts +36 -0
- package/dist/index.d.ts +65 -0
- package/dist/index.js +5279 -0
- package/dist/portalHue-CLVEiNTo.js +14 -0
- package/dist/portalHue.d.ts +10 -0
- package/dist/style-ByE-hij7.js +8 -0
- package/dist/style.d.ts +7 -0
- package/dist/useConfirm.d.ts +26 -0
- package/dist/useDragArmed.d.ts +6 -0
- package/dist/usePaypalButtons.d.ts +17 -0
- package/dist/useTipBubble-BJIYZw03.js +65 -0
- package/dist/useTipBubble.d.ts +25 -0
- package/package.json +148 -4
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
2
|
+
import { type CryptoCoin, type CryptoNetwork } from "@glimstone/core";
|
|
3
|
+
export type { CryptoCoin, CryptoNetwork } from "@glimstone/core";
|
|
4
|
+
export interface CryptoDonateDialogProps {
|
|
5
|
+
/** The coins on offer. See the rule at the top of this file. */
|
|
6
|
+
coins: CryptoCoin[];
|
|
7
|
+
/** What is shown right now. The app owns this, so it can remember it. */
|
|
8
|
+
coin: CryptoCoin;
|
|
9
|
+
network: CryptoNetwork;
|
|
10
|
+
/** Picking a coin lands on that coin's first network rather than keeping the
|
|
11
|
+
* previous chain, which the donor never checked against the new coin. */
|
|
12
|
+
onPick: (coin: CryptoCoin, network: CryptoNetwork) => void;
|
|
13
|
+
text: {
|
|
14
|
+
title: string;
|
|
15
|
+
/** The app's appeal, the same in every giving window. */
|
|
16
|
+
appeal: string;
|
|
17
|
+
/** One sentence saying what to do: pick a currency and a network, then scan
|
|
18
|
+
* or copy. */
|
|
19
|
+
intro: string;
|
|
20
|
+
/** The label over the chain row ("Networks"). */
|
|
21
|
+
networks: string;
|
|
22
|
+
copyLabel: string;
|
|
23
|
+
closeLabel: string;
|
|
24
|
+
};
|
|
25
|
+
/** The address as a scannable square. */
|
|
26
|
+
renderQr?: (value: string) => JSX.Element;
|
|
27
|
+
/** A coin's own mark. */
|
|
28
|
+
renderMark?: (coin: CryptoCoin) => JSX.Element;
|
|
29
|
+
/** Copy the address and say so in a toast, in the app's own words. */
|
|
30
|
+
onCopy: (coin: CryptoCoin, network: CryptoNetwork) => void;
|
|
31
|
+
onClose: () => void;
|
|
32
|
+
/** The window's own card, for the app's Escape handling and focus trap. */
|
|
33
|
+
ref?: HTMLDivElement | ((el: HTMLDivElement) => void);
|
|
34
|
+
}
|
|
35
|
+
export declare function CryptoDonateDialog(props: CryptoDonateDialogProps): JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
2
|
+
import { type DatePickerText } from "@glimstone/core";
|
|
3
|
+
export type { DatePickerText, DateView } from "@glimstone/core";
|
|
4
|
+
export interface DatePickerProps {
|
|
5
|
+
label?: string;
|
|
6
|
+
/** The day as "2026-11-14", or null for none. */
|
|
7
|
+
value: string | null;
|
|
8
|
+
onChange: (value: string | null) => void;
|
|
9
|
+
/** The first and the last day it offers, as "2026-11-14". */
|
|
10
|
+
min?: string;
|
|
11
|
+
max?: string;
|
|
12
|
+
/** The language the calendar is drawn in; the page's by default. */
|
|
13
|
+
locale?: string;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
text?: Partial<DatePickerText>;
|
|
16
|
+
}
|
|
17
|
+
export declare function DatePicker(raw: DatePickerProps): JSX.Element;
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { r as e } from "./fieldName-Bb6qW0oS.js";
|
|
2
|
+
import { d as t, n, t as r } from "./glyphs-xP5bYKa1.js";
|
|
3
|
+
import { t as i } from "./Lift-CsM0IU9t.js";
|
|
4
|
+
import { t as a } from "./portalHue-CLVEiNTo.js";
|
|
5
|
+
import { t as o } from "./style-ByE-hij7.js";
|
|
6
|
+
import { className as s, createComponent as c, effect as l, insert as u, mergeProps as d, setAttribute as f, spread as p, template as m, use as h } from "solid-js/web";
|
|
7
|
+
import { For as g, createMemo as _, createSignal as v, createUniqueId as y, mergeProps as b } from "solid-js";
|
|
8
|
+
import { DATE_PICKER_TEXT as x, SELECT_POSITIONING as S, formatDay as C, pageDir as w, pageLocale as T } from "@glimstone/core";
|
|
9
|
+
import { normalizeProps as E, useMachine as D } from "@zag-js/solid";
|
|
10
|
+
import * as O from "@zag-js/date-picker";
|
|
11
|
+
// src/DatePicker.tsx
|
|
12
|
+
var k = /*#__PURE__*/ m("<div><div><div><div><button></button><button></button><button></button></div><table><thead><tr></tr></thead><tbody></tbody></table></div><div><div><button></button><button></button><button></button></div><table><tbody></tbody></table></div><div><div><button></button><span class=\"glim-date-title glim-num\"></span><button></button></div><table><tbody>"), A = /*#__PURE__*/ m("<div data-glim=DatePicker><label></label><div><button><span>"), j = /*#__PURE__*/ m("<th scope=col class=glim-date-weekday>"), M = /*#__PURE__*/ m("<tr>"), N = /*#__PURE__*/ m("<td><div>");
|
|
13
|
+
function P(m) {
|
|
14
|
+
let P = b({ disabled: !1 }, m), F = y(), I = e(() => P.label), L = () => ({
|
|
15
|
+
...x,
|
|
16
|
+
...P.text
|
|
17
|
+
}), R = () => P.locale ?? T(), z = () => P.value ? C(P.value, R()) : L().placeholder, B = D(O.machine, () => ({
|
|
18
|
+
id: F,
|
|
19
|
+
dir: w(),
|
|
20
|
+
locale: R(),
|
|
21
|
+
value: P.value ? [O.parse(P.value)] : [],
|
|
22
|
+
min: P.min ? O.parse(P.min) : void 0,
|
|
23
|
+
max: P.max ? O.parse(P.max) : void 0,
|
|
24
|
+
disabled: P.disabled,
|
|
25
|
+
positioning: S,
|
|
26
|
+
onValueChange: (e) => P.onChange(e.value[0]?.toString() ?? null),
|
|
27
|
+
translations: {
|
|
28
|
+
content: L().calendar,
|
|
29
|
+
trigger: () => I() ? `${I()}, ${z()}` : z(),
|
|
30
|
+
prevTrigger: (e) => L().previous[e],
|
|
31
|
+
nextTrigger: (e) => L().next[e],
|
|
32
|
+
viewTrigger: () => L().zoomOut
|
|
33
|
+
}
|
|
34
|
+
})), V = _(() => O.connect(B, E)), [H, U] = v(), W = a(() => V().open, H), G = () => V().getPositionerProps(), K = () => V().getMonthsGrid({
|
|
35
|
+
columns: 4,
|
|
36
|
+
format: "short"
|
|
37
|
+
}), q = () => V().getYearsGrid({ columns: 4 });
|
|
38
|
+
return (() => {
|
|
39
|
+
var e = A(), a = e.firstChild, m = a.nextSibling, _ = m.firstChild, v = _.firstChild;
|
|
40
|
+
return p(e, d(() => V().getRootProps(), { class: "glim-date" }), !1, !0), p(a, d(() => V().getLabelProps(), { get class() {
|
|
41
|
+
return P.label === void 0 ? "glim-sr-only" : "glim-field-label";
|
|
42
|
+
} }), !1, !0), u(a, I), p(m, d(() => V().getControlProps(), { class: "glim-date-control" }), !1, !0), h(U, _), p(_, d(() => V().getTriggerProps(), { class: "glim-input glim-date-trigger" }), !1, !0), u(v, z), u(_, c(n, {}), null), u(e, c(i, { get children() {
|
|
43
|
+
var e = k(), n = e.firstChild, i = n.firstChild, a = i.firstChild, s = a.firstChild, m = s.nextSibling, h = m.nextSibling, _ = a.nextSibling, v = _.firstChild, y = v.firstChild, b = v.nextSibling, x = i.nextSibling, S = x.firstChild, C = S.firstChild, w = C.nextSibling, T = w.nextSibling, E = S.nextSibling, D = E.firstChild, O = x.nextSibling, A = O.firstChild, P = A.firstChild, F = P.nextSibling, I = F.nextSibling, L = A.nextSibling, R = L.firstChild;
|
|
44
|
+
return p(e, d(G, {
|
|
45
|
+
get style() {
|
|
46
|
+
return {
|
|
47
|
+
...G().style,
|
|
48
|
+
...o(W.style())
|
|
49
|
+
};
|
|
50
|
+
},
|
|
51
|
+
get class() {
|
|
52
|
+
return `glim-date-positioner ${W.className()}`.trim();
|
|
53
|
+
}
|
|
54
|
+
}), !1, !0), p(n, d(() => V().getContentProps(), { class: "glim-date-panel" }), !1, !0), p(i, d(() => V().getViewProps({ view: "day" }), { get hidden() {
|
|
55
|
+
return V().view !== "day";
|
|
56
|
+
} }), !1, !0), p(a, d(() => V().getViewControlProps({ view: "day" }), { class: "glim-date-head" }), !1, !0), p(s, d(() => V().getPrevTriggerProps({ view: "day" }), { class: "glim-date-step" }), !1, !0), u(s, c(r, {})), p(m, d(() => V().getViewTriggerProps({ view: "day" }), { class: "glim-date-title" }), !1, !0), u(m, () => V().visibleRangeText.start), p(h, d(() => V().getNextTriggerProps({ view: "day" }), { class: "glim-date-step" }), !1, !0), u(h, c(t, {})), p(_, d(() => V().getTableProps({ view: "day" }), { class: "glim-date-grid" }), !1, !0), p(v, d(() => V().getTableHeadProps({ view: "day" })), !1, !0), p(y, d(() => V().getTableRowProps({ view: "day" })), !1, !0), u(y, c(g, {
|
|
57
|
+
get each() {
|
|
58
|
+
return V().weekDays;
|
|
59
|
+
},
|
|
60
|
+
children: (e) => (() => {
|
|
61
|
+
var t = j();
|
|
62
|
+
return u(t, () => e.narrow), l(() => f(t, "aria-label", e.long)), t;
|
|
63
|
+
})()
|
|
64
|
+
})), p(b, d(() => V().getTableBodyProps({ view: "day" })), !1, !0), u(b, c(g, {
|
|
65
|
+
get each() {
|
|
66
|
+
return V().weeks;
|
|
67
|
+
},
|
|
68
|
+
children: (e) => (() => {
|
|
69
|
+
var t = M();
|
|
70
|
+
return p(t, d(() => V().getTableRowProps({ view: "day" })), !1, !0), u(t, c(g, {
|
|
71
|
+
each: e,
|
|
72
|
+
children: (e) => (() => {
|
|
73
|
+
var t = N(), n = t.firstChild;
|
|
74
|
+
return p(t, d(() => V().getDayTableCellProps({ value: e })), !1, !0), p(n, d(() => V().getDayTableCellTriggerProps({ value: e }), { class: "glim-date-cell glim-num" }), !1, !0), u(n, () => e.day), t;
|
|
75
|
+
})()
|
|
76
|
+
})), t;
|
|
77
|
+
})()
|
|
78
|
+
})), p(x, d(() => V().getViewProps({ view: "month" }), { get hidden() {
|
|
79
|
+
return V().view !== "month";
|
|
80
|
+
} }), !1, !0), p(S, d(() => V().getViewControlProps({ view: "month" }), { class: "glim-date-head" }), !1, !0), p(C, d(() => V().getPrevTriggerProps({ view: "month" }), { class: "glim-date-step" }), !1, !0), u(C, c(r, {})), p(w, d(() => V().getViewTriggerProps({ view: "month" }), { class: "glim-date-title" }), !1, !0), u(w, () => V().visibleRange.start.year), p(T, d(() => V().getNextTriggerProps({ view: "month" }), { class: "glim-date-step" }), !1, !0), u(T, c(t, {})), p(E, d(() => V().getTableProps({
|
|
81
|
+
view: "month",
|
|
82
|
+
columns: 4
|
|
83
|
+
}), { class: "glim-date-grid" }), !1, !0), p(D, d(() => V().getTableBodyProps({ view: "month" })), !1, !0), u(D, c(g, {
|
|
84
|
+
get each() {
|
|
85
|
+
return K();
|
|
86
|
+
},
|
|
87
|
+
children: (e) => (() => {
|
|
88
|
+
var t = M();
|
|
89
|
+
return p(t, d(() => V().getTableRowProps()), !1, !0), u(t, c(g, {
|
|
90
|
+
each: e,
|
|
91
|
+
children: (e) => (() => {
|
|
92
|
+
var t = N(), n = t.firstChild;
|
|
93
|
+
return p(t, d(() => V().getMonthTableCellProps({
|
|
94
|
+
...e,
|
|
95
|
+
columns: 4
|
|
96
|
+
})), !1, !0), p(n, d(() => V().getMonthTableCellTriggerProps({
|
|
97
|
+
...e,
|
|
98
|
+
columns: 4
|
|
99
|
+
}), { class: "glim-date-cell glim-date-cell--wide" }), !1, !0), u(n, () => e.label), t;
|
|
100
|
+
})()
|
|
101
|
+
})), t;
|
|
102
|
+
})()
|
|
103
|
+
})), p(O, d(() => V().getViewProps({ view: "year" }), { get hidden() {
|
|
104
|
+
return V().view !== "year";
|
|
105
|
+
} }), !1, !0), p(A, d(() => V().getViewControlProps({ view: "year" }), { class: "glim-date-head" }), !1, !0), p(P, d(() => V().getPrevTriggerProps({ view: "year" }), { class: "glim-date-step" }), !1, !0), u(P, c(r, {})), u(F, () => `${V().getDecade().start} - ${V().getDecade().end}`), p(I, d(() => V().getNextTriggerProps({ view: "year" }), { class: "glim-date-step" }), !1, !0), u(I, c(t, {})), p(L, d(() => V().getTableProps({
|
|
106
|
+
view: "year",
|
|
107
|
+
columns: 4
|
|
108
|
+
}), { class: "glim-date-grid" }), !1, !0), p(R, d(() => V().getTableBodyProps({ view: "year" })), !1, !0), u(R, c(g, {
|
|
109
|
+
get each() {
|
|
110
|
+
return q();
|
|
111
|
+
},
|
|
112
|
+
children: (e) => (() => {
|
|
113
|
+
var t = M();
|
|
114
|
+
return p(t, d(() => V().getTableRowProps({ view: "year" })), !1, !0), u(t, c(g, {
|
|
115
|
+
each: e,
|
|
116
|
+
children: (e) => (() => {
|
|
117
|
+
var t = N(), n = t.firstChild;
|
|
118
|
+
return p(t, d(() => V().getYearTableCellProps({
|
|
119
|
+
...e,
|
|
120
|
+
columns: 4
|
|
121
|
+
})), !1, !0), p(n, d(() => V().getYearTableCellTriggerProps({
|
|
122
|
+
...e,
|
|
123
|
+
columns: 4
|
|
124
|
+
}), { class: "glim-date-cell glim-date-cell--wide glim-num" }), !1, !0), u(n, () => e.label), t;
|
|
125
|
+
})()
|
|
126
|
+
})), t;
|
|
127
|
+
})()
|
|
128
|
+
})), e;
|
|
129
|
+
} }), null), l(() => s(v, P.value ? "glim-date-value" : "glim-date-value glim-date-value--empty")), e;
|
|
130
|
+
})();
|
|
131
|
+
}
|
|
132
|
+
export { P as DatePicker };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
2
|
+
export interface DropdownListboxProps {
|
|
3
|
+
/** Whether the panel is mounted. The caller owns the trigger; only the
|
|
4
|
+
* panel is shared. */
|
|
5
|
+
open: boolean;
|
|
6
|
+
/** Called when the panel dismisses itself (outside click, Escape, scroll,
|
|
7
|
+
* resize). Picking an option does not call it: a single-select list closes
|
|
8
|
+
* itself at the call site, a multi-select one stays open. */
|
|
9
|
+
onClose: () => void;
|
|
10
|
+
/** The trigger, which anchors the panel and is exempt from the outside-click
|
|
11
|
+
* dismissal so clicking it does not close and reopen the list. */
|
|
12
|
+
triggerRef: HTMLElement | null | undefined;
|
|
13
|
+
/** Accessible name for the listbox, normally the same label the trigger
|
|
14
|
+
* carries. */
|
|
15
|
+
label: string;
|
|
16
|
+
/** `aria-multiselectable`, for a checkbox multi-select list. */
|
|
17
|
+
multiselectable?: boolean;
|
|
18
|
+
/** The `role="option"` buttons. */
|
|
19
|
+
children: JSX.Element;
|
|
20
|
+
}
|
|
21
|
+
/** @deprecated Use Select, which keeps focus on its trigger and adds typeahead. */
|
|
22
|
+
export declare function DropdownListbox(props: DropdownListboxProps): JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
2
|
+
/**
|
|
3
|
+
* What a list, table or panel shows when it holds nothing: a muted, oversized
|
|
4
|
+
* glyph, a title, an optional hint and an optional action. "Nothing here yet"
|
|
5
|
+
* and "nothing matches the filter" take the same shape with different words,
|
|
6
|
+
* so somebody is not sent looking for a filter that was never set.
|
|
7
|
+
*/
|
|
8
|
+
export declare function EmptyState(props: {
|
|
9
|
+
/** The page's own glyph, so the empty state echoes the place it is on. */
|
|
10
|
+
glyph?: JSX.Element;
|
|
11
|
+
/** What is missing, such as "No backups yet" or "No backups match the filter". */
|
|
12
|
+
title: string;
|
|
13
|
+
/** One line on how to get there; anything longer goes into a bubble or a window. */
|
|
14
|
+
hint?: string;
|
|
15
|
+
/** A Button that gets out of the empty state, such as "Add a backup" or "Clear the filter". */
|
|
16
|
+
action?: JSX.Element;
|
|
17
|
+
/** It stands inside a card, which already provides the surface. */
|
|
18
|
+
nested?: boolean;
|
|
19
|
+
}): JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { JSX } from "solid-js";
|
|
2
|
+
/** The line under a field whose value it cannot take, with the fault mark.
|
|
3
|
+
* The fields draw it from their `error`; an app's own field draws it with
|
|
4
|
+
* the id its aria-describedby names. */
|
|
5
|
+
export declare function FieldError(props: {
|
|
6
|
+
id: string;
|
|
7
|
+
children: JSX.Element;
|
|
8
|
+
}): JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
2
|
+
import { type PillTone } from "@glimstone/core";
|
|
3
|
+
export interface FieldRowProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, "children" | "class"> {
|
|
4
|
+
/** The row's name, and the accessible name of the control in it. */
|
|
5
|
+
label: string;
|
|
6
|
+
/** Draws the words in other markup, such as a quiet "optional". The name stays `label`. */
|
|
7
|
+
drawn?: JSX.Element;
|
|
8
|
+
/** What the row does, drawn as an "(i)" beside the name. */
|
|
9
|
+
hint?: string;
|
|
10
|
+
/** A row with only a value to show holds it as a pill. */
|
|
11
|
+
value?: string | number;
|
|
12
|
+
/** The pill's tone. */
|
|
13
|
+
tone?: PillTone;
|
|
14
|
+
/** In a FieldRowGroup with columns, spans all of them. */
|
|
15
|
+
wide?: boolean;
|
|
16
|
+
/** The control. */
|
|
17
|
+
children?: JSX.Element;
|
|
18
|
+
class?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare function FieldRow(props: FieldRowProps): JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
2
|
+
export interface FieldRowGroupProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, "class" | "style"> {
|
|
3
|
+
/** The FieldRows. */
|
|
4
|
+
children: JSX.Element;
|
|
5
|
+
/** Rows side by side, each column lining up its own names. A `wide` row spans them all. */
|
|
6
|
+
columns?: 1 | 2;
|
|
7
|
+
class?: string;
|
|
8
|
+
style?: JSX.CSSProperties;
|
|
9
|
+
}
|
|
10
|
+
export declare function FieldRowGroup(props: FieldRowGroupProps): JSX.Element;
|
|
@@ -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(raw: FileUploadProps): import("solid-js").JSX.Element;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { t as e } from "./IconButton-Lzbq5Cst.js";
|
|
2
|
+
import { _ as t, a as n } from "./glyphs-xP5bYKa1.js";
|
|
3
|
+
import { createComponent as r, insert as i, mergeProps as a, spread as o, template as s } from "solid-js/web";
|
|
4
|
+
import { For as c, Show as l, createMemo as u, createUniqueId as d, mergeProps as f } from "solid-js";
|
|
5
|
+
import { FILE_UPLOAD_TEXT as p, formatFileSize as m, pageDir as h } from "@glimstone/core";
|
|
6
|
+
import { normalizeProps as g, useMachine as _ } from "@zag-js/solid";
|
|
7
|
+
import * as v from "@zag-js/file-upload";
|
|
8
|
+
// src/FileUpload.tsx
|
|
9
|
+
var y = /*#__PURE__*/ s("<ul>"), b = /*#__PURE__*/ s("<div data-glim=FileUpload><label></label><div><span class=glim-upload-words></span></div><input>"), x = /*#__PURE__*/ s("<li><span></span><span>"), S = /*#__PURE__*/ s("<p class=glim-field-error>");
|
|
10
|
+
function C(s) {
|
|
11
|
+
let C = f({
|
|
12
|
+
maxFiles: 1,
|
|
13
|
+
disabled: !1
|
|
14
|
+
}, s), w = d(), T = () => ({
|
|
15
|
+
...p,
|
|
16
|
+
...C.text
|
|
17
|
+
}), E = _(v.machine, () => ({
|
|
18
|
+
id: w,
|
|
19
|
+
dir: h(),
|
|
20
|
+
acceptedFiles: C.value,
|
|
21
|
+
accept: C.accept,
|
|
22
|
+
maxFiles: C.maxFiles,
|
|
23
|
+
maxFileSize: C.maxFileSize,
|
|
24
|
+
disabled: C.disabled,
|
|
25
|
+
onFileChange: (e) => C.onChange(e.acceptedFiles),
|
|
26
|
+
translations: {
|
|
27
|
+
dropzone: T().drop,
|
|
28
|
+
deleteFile: (e) => T().remove(e.name)
|
|
29
|
+
}
|
|
30
|
+
})), D = u(() => v.connect(E, g));
|
|
31
|
+
return (() => {
|
|
32
|
+
var s = b(), u = s.firstChild, d = u.nextSibling, f = d.firstChild, p = d.nextSibling;
|
|
33
|
+
return o(s, a(() => D().getRootProps(), { class: "glim-upload" }), !1, !0), o(u, a(() => D().getLabelProps(), { class: "glim-field-label" }), !1, !0), i(u, () => C.label), o(d, a(() => D().getDropzoneProps(), { class: "glim-upload-drop" }), !1, !0), i(d, r(t, {}), f), i(f, () => T().drop), o(p, a(() => D().getHiddenInputProps()), !1, !1), i(s, r(l, {
|
|
34
|
+
get when() {
|
|
35
|
+
return D().acceptedFiles.length > 0;
|
|
36
|
+
},
|
|
37
|
+
get children() {
|
|
38
|
+
var t = y();
|
|
39
|
+
return o(t, a(() => D().getItemGroupProps(), { class: "glim-upload-files" }), !1, !0), i(t, r(c, {
|
|
40
|
+
get each() {
|
|
41
|
+
return D().acceptedFiles;
|
|
42
|
+
},
|
|
43
|
+
children: (t) => (() => {
|
|
44
|
+
var s = x(), c = s.firstChild, l = c.nextSibling;
|
|
45
|
+
return o(s, a(() => D().getItemProps({ file: t }), { class: "glim-upload-file" }), !1, !0), o(c, a(() => D().getItemNameProps({ file: t }), { class: "glim-upload-name" }), !1, !0), i(c, () => t.name), o(l, a(() => D().getItemSizeTextProps({ file: t }), { class: "glim-upload-size glim-num" }), !1, !0), i(l, () => m(t.size)), i(s, r(e, {
|
|
46
|
+
get tip() {
|
|
47
|
+
return T().remove(t.name);
|
|
48
|
+
},
|
|
49
|
+
get glyph() {
|
|
50
|
+
return r(n, {});
|
|
51
|
+
},
|
|
52
|
+
onClick: () => D().deleteFile(t)
|
|
53
|
+
}), null), s;
|
|
54
|
+
})()
|
|
55
|
+
})), t;
|
|
56
|
+
}
|
|
57
|
+
}), null), i(s, r(c, {
|
|
58
|
+
get each() {
|
|
59
|
+
return D().rejectedFiles;
|
|
60
|
+
},
|
|
61
|
+
children: ({ file: e, errors: t }) => (() => {
|
|
62
|
+
var n = S();
|
|
63
|
+
return i(n, () => T().refused(e.name, t[0])), n;
|
|
64
|
+
})()
|
|
65
|
+
}), null), s;
|
|
66
|
+
})();
|
|
67
|
+
}
|
|
68
|
+
export { C as FileUpload };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
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: JSX.Element;
|
|
12
|
+
text?: Partial<FloatingPanelText>;
|
|
13
|
+
}
|
|
14
|
+
export declare function FloatingPanel(raw: FloatingPanelProps): JSX.Element;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { t as e } from "./Badge-CC2mjBLM.js";
|
|
2
|
+
import { t } from "./Button-DNSkNN0r.js";
|
|
3
|
+
import { a as n, b as r, v as i, y as a } from "./glyphs-xP5bYKa1.js";
|
|
4
|
+
import { t as o } from "./Lift-CsM0IU9t.js";
|
|
5
|
+
import { createComponent as s, insert as c, mergeProps as l, spread as u, template as d } from "solid-js/web";
|
|
6
|
+
import { For as f, Show as p, createMemo as m, createUniqueId as h, mergeProps as g } from "solid-js";
|
|
7
|
+
import { FLOATING_PANEL_TEXT as _, pageDir as v } from "@glimstone/core";
|
|
8
|
+
import { normalizeProps as y, useMachine as b } from "@zag-js/solid";
|
|
9
|
+
import * as x from "@zag-js/floating-panel";
|
|
10
|
+
// src/FloatingPanel.tsx
|
|
11
|
+
var S = /*#__PURE__*/ d("<div data-glim=FloatingPanel class=glim-fpanel-layer><div><div><div><div><h2></h2><div><button></button><button></button><button></button></div></div></div><div></div><div class=glim-fpanel-foot>"), C = /*#__PURE__*/ d("<div>"), w = [
|
|
12
|
+
"n",
|
|
13
|
+
"e",
|
|
14
|
+
"s",
|
|
15
|
+
"w",
|
|
16
|
+
"ne",
|
|
17
|
+
"se",
|
|
18
|
+
"sw",
|
|
19
|
+
"nw"
|
|
20
|
+
];
|
|
21
|
+
function T(d) {
|
|
22
|
+
let T = g({
|
|
23
|
+
defaultSize: {
|
|
24
|
+
width: 360,
|
|
25
|
+
height: 280
|
|
26
|
+
},
|
|
27
|
+
resizable: !0
|
|
28
|
+
}, d), E = () => ({
|
|
29
|
+
..._,
|
|
30
|
+
...T.text
|
|
31
|
+
}), D = h(), O = b(x.machine, () => ({
|
|
32
|
+
id: D,
|
|
33
|
+
dir: v(),
|
|
34
|
+
open: T.open,
|
|
35
|
+
defaultSize: T.defaultSize,
|
|
36
|
+
resizable: T.resizable,
|
|
37
|
+
strategy: "fixed",
|
|
38
|
+
closeOnEscape: !0,
|
|
39
|
+
onOpenChange: (e) => T.onOpenChange(e.open),
|
|
40
|
+
translations: {
|
|
41
|
+
minimize: E().minimize,
|
|
42
|
+
maximize: E().maximize,
|
|
43
|
+
restore: E().restore
|
|
44
|
+
}
|
|
45
|
+
})), k = m(() => x.connect(O, y));
|
|
46
|
+
return s(o, { get children() {
|
|
47
|
+
var o = S(), d = o.firstChild, m = d.firstChild, h = m.firstChild, g = h.firstChild, _ = g.firstChild, v = _.nextSibling, y = v.firstChild, b = y.nextSibling, x = b.nextSibling, D = h.nextSibling, O = D.nextSibling;
|
|
48
|
+
return u(d, l(() => k().getPositionerProps(), { class: "glim-fpanel-positioner" }), !1, !0), u(m, l(() => k().getContentProps(), { class: "glim-fpanel" }), !1, !0), u(h, l(() => k().getDragTriggerProps(), { class: "glim-fpanel-drag" }), !1, !0), u(g, l(() => k().getHeaderProps(), { class: "glim-fpanel-head" }), !1, !0), u(_, l(() => k().getTitleProps(), { class: "glim-panel-heading" }), !1, !0), c(_, s(e, {
|
|
49
|
+
tone: "heading",
|
|
50
|
+
size: "heading",
|
|
51
|
+
wrap: !0,
|
|
52
|
+
get children() {
|
|
53
|
+
return T.title;
|
|
54
|
+
}
|
|
55
|
+
})), u(v, l(() => k().getControlProps(), { class: "glim-fpanel-control" }), !1, !0), u(y, l(() => k().getStageTriggerProps({ stage: "minimized" }), { class: "glim-btn-bare glim-icon-btn" }), !1, !0), c(y, s(a, {})), u(b, l(() => k().getStageTriggerProps({ stage: "maximized" }), { class: "glim-btn-bare glim-icon-btn" }), !1, !0), c(b, s(i, {})), u(x, l(() => k().getStageTriggerProps({ stage: "default" }), { class: "glim-btn-bare glim-icon-btn" }), !1, !0), c(x, s(r, {})), u(D, l(() => k().getBodyProps(), { class: "glim-fpanel-body" }), !1, !0), c(D, () => T.children), c(O, s(t, {
|
|
56
|
+
get label() {
|
|
57
|
+
return E().close;
|
|
58
|
+
},
|
|
59
|
+
labelKey: null,
|
|
60
|
+
get glyph() {
|
|
61
|
+
return s(n, {});
|
|
62
|
+
},
|
|
63
|
+
onClick: () => k().setOpen(!1)
|
|
64
|
+
})), c(m, s(p, {
|
|
65
|
+
get when() {
|
|
66
|
+
return T.resizable;
|
|
67
|
+
},
|
|
68
|
+
get children() {
|
|
69
|
+
return s(f, {
|
|
70
|
+
each: w,
|
|
71
|
+
children: (e) => (() => {
|
|
72
|
+
var t = C();
|
|
73
|
+
return u(t, l(() => k().getResizeTriggerProps({ axis: e }), { class: "glim-fpanel-edge" }), !1, !1), t;
|
|
74
|
+
})()
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}), null), o;
|
|
78
|
+
} });
|
|
79
|
+
}
|
|
80
|
+
export { T as FloatingPanel };
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
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";
|
|
4
|
+
export interface FortressProps {
|
|
5
|
+
text: FortressText;
|
|
6
|
+
/** The interface language, for counts and lists. */
|
|
7
|
+
lang: string;
|
|
8
|
+
/** The app showing the page. */
|
|
9
|
+
app: {
|
|
10
|
+
id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
logo?: string;
|
|
13
|
+
};
|
|
14
|
+
joined: boolean;
|
|
15
|
+
/** The other apps of the fortress, each with its instances. */
|
|
16
|
+
apps: FortressApp[];
|
|
17
|
+
permissions: FortressPermission[];
|
|
18
|
+
onPermission: (id: string, on: boolean) => Promise<FortressAnswer>;
|
|
19
|
+
/** Puts the small confirmation of a saved permission, or the reason it failed, into the app's toasts. */
|
|
20
|
+
notify?: (message: string, severity: ToastSeverity) => void;
|
|
21
|
+
onJoin: (words: string[]) => Promise<FortressAnswer>;
|
|
22
|
+
/** Removes an instance, of this app or another. Without it no other app offers Remove. */
|
|
23
|
+
onRemove?: (id: string) => Promise<FortressAnswer>;
|
|
24
|
+
/** `password` is set where `phrasePassword` asks for it first. Without it there is no Show phrase. */
|
|
25
|
+
onShowPhrase?: (password?: string) => Promise<PhraseAnswer>;
|
|
26
|
+
/** Offered right after a removal and beside `removed`, since until the phrase changes the fortress takes no new app. */
|
|
27
|
+
onChangePhrase?: () => Promise<ChangeAnswer>;
|
|
28
|
+
/** The instances removed since the phrase last changed, by name ("Bravo on Atlas"). While there are any, a line says that no new app can join. */
|
|
29
|
+
removed?: string[];
|
|
30
|
+
/** Another member removed this app, so the empty place says so until it joins again. */
|
|
31
|
+
removedHere?: boolean;
|
|
32
|
+
/** Whether the other apps show. Without it the switch keeps its state on this device. */
|
|
33
|
+
showOthers?: boolean;
|
|
34
|
+
onShowOthers?: (on: boolean) => void;
|
|
35
|
+
/** The app draws the switch for the other apps itself, such as at the top of its pairing card, with `showOthers` and `othersLine`. */
|
|
36
|
+
hideSwitch?: boolean;
|
|
37
|
+
/** The devices this app is paired with today, whose pairing moves into the fortress on joining. */
|
|
38
|
+
pairedWith?: string[];
|
|
39
|
+
/** A member of a fortress this app saw on the network while it is in none. */
|
|
40
|
+
found?: {
|
|
41
|
+
app: string;
|
|
42
|
+
device: string;
|
|
43
|
+
logo?: string;
|
|
44
|
+
};
|
|
45
|
+
/** Asks for the app's password before the phrase shows. */
|
|
46
|
+
phrasePassword?: boolean;
|
|
47
|
+
onOpen?: (app: FortressApp, instance: FortressInstance) => void;
|
|
48
|
+
/** The app's own card for another app, such as the one its Instances tab draws, in place of FortressAppCard. With `onRemove` it gets `remove`, which asks before an instance goes, as the app's own cards do. */
|
|
49
|
+
renderApp?: (app: FortressApp, hueIndex: number, remove?: (id: string, name: string) => void) => JSX.Element;
|
|
50
|
+
/** What the QR code beside the words carries, the words alone without it. */
|
|
51
|
+
phraseQr?: (words: string[]) => string;
|
|
52
|
+
/** Something of the app's own under a permission's words. */
|
|
53
|
+
permissionExtra?: (permission: FortressPermission) => JSX.Element;
|
|
54
|
+
labelKeys?: Partial<FortressLabelKeys>;
|
|
55
|
+
/** The rainbow position the fortress's first card takes, after the app's own cards. */
|
|
56
|
+
hueStart?: number;
|
|
57
|
+
/** This app's own instance cards. As a function it gets `remove`, which asks before an instance goes. */
|
|
58
|
+
children?: JSX.Element | ((remove: (id: string, device: string) => void) => JSX.Element);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* The fortress in the Instances tab ("The fortress" in the design language):
|
|
62
|
+
* the app's own instances first, the switch for the other apps and, once it is
|
|
63
|
+
* on, their cards and the permissions, with Show phrase or Enter phrase in the
|
|
64
|
+
* corner. Changing the phrase and leaving live in the pairing settings
|
|
65
|
+
* (FortressPairing).
|
|
66
|
+
*/
|
|
67
|
+
export declare function Fortress(props: FortressProps): JSX.Element;
|
|
68
|
+
export interface FortressPairingProps {
|
|
69
|
+
text: FortressText;
|
|
70
|
+
lang: string;
|
|
71
|
+
app: {
|
|
72
|
+
id: string;
|
|
73
|
+
name: string;
|
|
74
|
+
};
|
|
75
|
+
onLeave: () => Promise<FortressAnswer>;
|
|
76
|
+
/** `password` is set where `phrasePassword` asks for it first. Without it there is no Show phrase here. */
|
|
77
|
+
onShowPhrase?: (password?: string) => Promise<PhraseAnswer>;
|
|
78
|
+
/** Asks for the app's password before the phrase shows. */
|
|
79
|
+
phrasePassword?: boolean;
|
|
80
|
+
/** What the QR code beside the words carries, the words alone without it. */
|
|
81
|
+
phraseQr?: (words: string[]) => string;
|
|
82
|
+
/** Without it there is no way to change the phrase here, for an app that cannot keep a new one. */
|
|
83
|
+
onChangePhrase?: () => Promise<ChangeAnswer>;
|
|
84
|
+
/** The devices whose pairing ends with leaving. */
|
|
85
|
+
pairedWith?: string[];
|
|
86
|
+
/** A sentence of the app's own for the leave window, such as what stays as it is. */
|
|
87
|
+
leaveNote?: string;
|
|
88
|
+
labelKeys?: Partial<FortressLabelKeys>;
|
|
89
|
+
hueIndex?: number;
|
|
90
|
+
/** Rows of the app's own above the phrase, such as the name the instance goes by. */
|
|
91
|
+
children?: JSX.Element;
|
|
92
|
+
/** Rows of the app's own below leaving, such as the switch for the other apps. */
|
|
93
|
+
after?: JSX.Element;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* The fortress in the app's pairing settings: the one place where the phrase
|
|
97
|
+
* shows and changes and the app leaves, each behind a window that says what
|
|
98
|
+
* it does. An app that shows the phrase here leaves Show phrase out of its
|
|
99
|
+
* Fortress.
|
|
100
|
+
*/
|
|
101
|
+
export declare function FortressPairing(props: FortressPairingProps): JSX.Element;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type FortressApp, type FortressInstance, type FortressText } from "@glimstone/core";
|
|
2
|
+
export type { FortressApp, FortressInstance } from "@glimstone/core";
|
|
3
|
+
export interface FortressAppCardProps {
|
|
4
|
+
app: FortressApp;
|
|
5
|
+
text: FortressText;
|
|
6
|
+
/** The interface language, for the counts. */
|
|
7
|
+
lang: string;
|
|
8
|
+
hueIndex?: number;
|
|
9
|
+
/** Opens an instance, through the fortress where it runs elsewhere. Without it the instance's `open.href` opens in a new tab. */
|
|
10
|
+
onOpen?: (app: FortressApp, instance: FortressInstance) => void;
|
|
11
|
+
/** Asks before an instance is removed, with its name. Without it nothing here removes. */
|
|
12
|
+
onRemove?: (id: string, name: string) => void;
|
|
13
|
+
/** The label key behind Remove, which picks its glyph. */
|
|
14
|
+
removeKey?: string;
|
|
15
|
+
}
|
|
16
|
+
/** The state of one instance: reached through the relay, and connected, checking or away. */
|
|
17
|
+
export declare function PresenceBadges(props: {
|
|
18
|
+
instance: FortressInstance;
|
|
19
|
+
text: FortressText;
|
|
20
|
+
}): import("solid-js").JSX.Element;
|
|
21
|
+
/** A device's glyph, asked for by its kind through the app's resolver (`deviceServer`, `devicePc`, `deviceLaptop`, `devicePhone`). */
|
|
22
|
+
export declare function deviceGlyph(kind: FortressInstance["deviceKind"]): import("solid-js").JSX.Element;
|
|
23
|
+
export interface FortressDoubtWindowProps {
|
|
24
|
+
app: FortressApp;
|
|
25
|
+
instance: FortressInstance;
|
|
26
|
+
text: FortressText;
|
|
27
|
+
/** Runs on Open anyway. The window closes either way. */
|
|
28
|
+
onOpen: () => void;
|
|
29
|
+
onClose: () => void;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* The question before an instance with `doubt` opens: two members claim the
|
|
33
|
+
* same app on the same device, so the person opens one only by the end of its
|
|
34
|
+
* id. An app that draws the other apps in cards of its own shows it before
|
|
35
|
+
* `onOpen`.
|
|
36
|
+
*/
|
|
37
|
+
export declare function FortressDoubtWindow(props: FortressDoubtWindowProps): import("solid-js").JSX.Element;
|
|
38
|
+
/** Another app of the fortress: its state, where it runs, and the way to open it. */
|
|
39
|
+
export declare function FortressAppCard(props: FortressAppCardProps): import("solid-js").JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
2
|
+
import { type FortressAnswer, type FortressApp, type FortressPermission, type FortressText, type ToastSeverity } from "@glimstone/core";
|
|
3
|
+
export type { FortressPermission } from "@glimstone/core";
|
|
4
|
+
export interface FortressPermissionsProps {
|
|
5
|
+
text: FortressText;
|
|
6
|
+
/** The app showing the card, for the filter "With {app}". */
|
|
7
|
+
app: {
|
|
8
|
+
id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
};
|
|
11
|
+
/** Every app of the fortress, this one included, for the marks. */
|
|
12
|
+
apps: Pick<FortressApp, "id" | "name" | "logo">[];
|
|
13
|
+
permissions: FortressPermission[];
|
|
14
|
+
/** Saves one switch the moment it flips. A refusal leaves it as it was and shakes it. */
|
|
15
|
+
onPermission: (id: string, on: boolean) => Promise<FortressAnswer>;
|
|
16
|
+
/** Puts the small confirmation of a save, or the reason it failed, into the app's toasts. */
|
|
17
|
+
notify?: (message: string, severity: ToastSeverity) => void;
|
|
18
|
+
hueIndex?: number;
|
|
19
|
+
/** Something of the app's own under one permission's words, such as the folder it writes to. */
|
|
20
|
+
extra?: (permission: FortressPermission) => JSX.Element;
|
|
21
|
+
}
|
|
22
|
+
/** What one app may do at another, a switch for each, all on unless switched off. */
|
|
23
|
+
export declare function FortressPermissions(props: FortressPermissionsProps): JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
2
|
+
import { type FortressApp, type FortressInstance, type FortressLogLine, type FortressStatusReport, type FortressText } from "@glimstone/core";
|
|
3
|
+
export type { FortressLogLine, FortressStatusReport } from "@glimstone/core";
|
|
4
|
+
export interface FortressStatusWindowProps {
|
|
5
|
+
app: FortressApp;
|
|
6
|
+
instance: FortressInstance;
|
|
7
|
+
/** The member's status report, its words and times already in the person's language. */
|
|
8
|
+
report?: FortressStatusReport;
|
|
9
|
+
/** The member's log, newest first. The window shows the first ten lines. */
|
|
10
|
+
log?: FortressLogLine[];
|
|
11
|
+
loading?: boolean;
|
|
12
|
+
/** Why the report did not come, such as `openRefusalText` puts it. */
|
|
13
|
+
error?: string;
|
|
14
|
+
text: FortressText;
|
|
15
|
+
/** The interface language. */
|
|
16
|
+
lang: string;
|
|
17
|
+
onClose: () => void;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* What Open shows for a member without pages of its own, such as an Unraid
|
|
21
|
+
* plugin, whose pages need Unraid's own sign-in and so never go through the
|
|
22
|
+
* fortress: its state from the status report, its last log lines and, for a
|
|
23
|
+
* plugin, where its settings are.
|
|
24
|
+
*/
|
|
25
|
+
export declare function FortressStatusWindow(props: FortressStatusWindowProps): JSX.Element;
|