@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,40 @@
|
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
2
|
+
import { type SignInHandlers, type SignInText, type SignInLabelKeys } from "@glimstone/core";
|
|
3
|
+
export type { SignInLabelKeys } from "@glimstone/core";
|
|
4
|
+
export type { ResetAnswer, SignInAnswer, SignInText } from "@glimstone/core";
|
|
5
|
+
export interface SignInCardProps extends SignInHandlers {
|
|
6
|
+
/** The app's logo, as an address or as an inline `<svg>` with a viewBox. It stands 7.5rem tall above the name, as wide as its shape asks. */
|
|
7
|
+
logo?: string | JSX.Element;
|
|
8
|
+
/** The page's heading. */
|
|
9
|
+
appName: string;
|
|
10
|
+
text: SignInText;
|
|
11
|
+
/** Offers Sign in with a passkey. Pass it only where a passkey can answer on this address. */
|
|
12
|
+
passkey?: boolean;
|
|
13
|
+
/** Offers Forgot password? and the reset form. */
|
|
14
|
+
reset?: boolean;
|
|
15
|
+
/** The shortest new password the reset form takes, as the server says. */
|
|
16
|
+
minPassword?: number;
|
|
17
|
+
/** One line at the top of the sign-in form, such as "You are signed out". */
|
|
18
|
+
note?: string;
|
|
19
|
+
/** The app's own fields, above the password. */
|
|
20
|
+
fields?: JSX.Element;
|
|
21
|
+
/** The app's own buttons, under Sign in and the passkey. */
|
|
22
|
+
actions?: JSX.Element;
|
|
23
|
+
/** A step the app runs itself, in place of the card's forms. */
|
|
24
|
+
step?: JSX.Element;
|
|
25
|
+
labelKeys?: Partial<SignInLabelKeys>;
|
|
26
|
+
/** The start of the fields' ids: `-password`, `-code`, `-reset-code`, `-new` and `-confirm` follow it. */
|
|
27
|
+
idPrefix?: string;
|
|
28
|
+
/** Puts the focus in the first empty field when the card opens. */
|
|
29
|
+
autoFocus?: boolean;
|
|
30
|
+
/** Classes for the page around the card. */
|
|
31
|
+
class?: string;
|
|
32
|
+
}
|
|
33
|
+
export declare function SignInField(props: {
|
|
34
|
+
label: string;
|
|
35
|
+
htmlFor: string;
|
|
36
|
+
hint?: string;
|
|
37
|
+
hidden?: boolean;
|
|
38
|
+
children: JSX.Element;
|
|
39
|
+
}): JSX.Element;
|
|
40
|
+
export declare function SignInCard(props: SignInCardProps): JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type SignaturePadText } from "@glimstone/core";
|
|
2
|
+
export type { SignaturePadText } from "@glimstone/core";
|
|
3
|
+
export interface SignaturePadProps {
|
|
4
|
+
label: string;
|
|
5
|
+
/** The strokes as SVG path data, one entry a stroke. */
|
|
6
|
+
value: string[];
|
|
7
|
+
onChange: (value: string[]) => void;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
text?: Partial<SignaturePadText>;
|
|
10
|
+
}
|
|
11
|
+
export declare function SignaturePad(raw: SignaturePadProps): import("solid-js").JSX.Element;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { t as e } from "./Button-DNSkNN0r.js";
|
|
2
|
+
import { h as t } from "./glyphs-xP5bYKa1.js";
|
|
3
|
+
import { createComponent as n, insert as r, mergeProps as i, spread as a, template as o } from "solid-js/web";
|
|
4
|
+
import { Index as s, Show as c, createMemo as l, createUniqueId as u, mergeProps as d } from "solid-js";
|
|
5
|
+
import { SIGNATURE_PAD_TEXT as f, pageDir as p } from "@glimstone/core";
|
|
6
|
+
import { normalizeProps as m, useMachine as h } from "@zag-js/solid";
|
|
7
|
+
import * as g from "@zag-js/signature-pad";
|
|
8
|
+
// src/SignaturePad.tsx
|
|
9
|
+
var _ = /*#__PURE__*/ o("<div data-glim=SignaturePad><label></label><div><svg></svg><div></div></div><div class=glim-signature-foot></div><input>"), v = /*#__PURE__*/ o("<svg><path></svg>", !1, !0, !1);
|
|
10
|
+
function y(o) {
|
|
11
|
+
let y = d({ disabled: !1 }, o), b = u(), x = () => ({
|
|
12
|
+
...f,
|
|
13
|
+
...y.text
|
|
14
|
+
}), S = h(g.machine, () => ({
|
|
15
|
+
id: b,
|
|
16
|
+
dir: p(),
|
|
17
|
+
paths: y.value,
|
|
18
|
+
disabled: y.disabled,
|
|
19
|
+
drawing: {
|
|
20
|
+
fill: "currentColor",
|
|
21
|
+
size: 2,
|
|
22
|
+
simulatePressure: !0
|
|
23
|
+
},
|
|
24
|
+
onDraw: (e) => e.currentPath === null && y.onChange(e.paths),
|
|
25
|
+
translations: {
|
|
26
|
+
control: x().area,
|
|
27
|
+
clearTrigger: x().clear
|
|
28
|
+
}
|
|
29
|
+
})), C = l(() => g.connect(S, m)), w = () => {
|
|
30
|
+
C().clear(), y.onChange([]);
|
|
31
|
+
};
|
|
32
|
+
return (() => {
|
|
33
|
+
var o = _(), l = o.firstChild, u = l.nextSibling, d = u.firstChild, f = d.nextSibling, p = u.nextSibling, m = p.nextSibling;
|
|
34
|
+
return a(o, i(() => C().getRootProps(), { class: "glim-signature" }), !1, !0), a(l, i(() => C().getLabelProps(), { class: "glim-field-label" }), !1, !0), r(l, () => y.label), a(u, i(() => C().getControlProps(), { class: "glim-signature-pad" }), !1, !0), a(d, i(() => C().getSegmentProps(), { class: "glim-signature-ink" }), !0, !0), r(d, n(s, {
|
|
35
|
+
get each() {
|
|
36
|
+
return C().paths;
|
|
37
|
+
},
|
|
38
|
+
children: (e) => (() => {
|
|
39
|
+
var t = v();
|
|
40
|
+
return a(t, i(() => C().getSegmentPathProps({ path: e() })), !0, !1), t;
|
|
41
|
+
})()
|
|
42
|
+
}), null), r(d, n(c, {
|
|
43
|
+
get when() {
|
|
44
|
+
return C().currentPath;
|
|
45
|
+
},
|
|
46
|
+
children: (e) => (() => {
|
|
47
|
+
var t = v();
|
|
48
|
+
return a(t, i(() => C().getSegmentPathProps({ path: e() })), !0, !1), t;
|
|
49
|
+
})()
|
|
50
|
+
}), null), a(f, i(() => C().getGuideProps(), { class: "glim-signature-guide" }), !1, !1), r(p, n(e, {
|
|
51
|
+
get label() {
|
|
52
|
+
return x().clear;
|
|
53
|
+
},
|
|
54
|
+
labelKey: null,
|
|
55
|
+
get glyph() {
|
|
56
|
+
return n(t, {});
|
|
57
|
+
},
|
|
58
|
+
get disabled() {
|
|
59
|
+
return C().empty || y.disabled;
|
|
60
|
+
},
|
|
61
|
+
onClick: w
|
|
62
|
+
})), a(m, i(() => C().getHiddenInputProps({ value: C().paths.join(" ") })), !1, !1), o;
|
|
63
|
+
})();
|
|
64
|
+
}
|
|
65
|
+
export { y as SignaturePad };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface SkeletonRowProps {
|
|
2
|
+
/** Milliseconds before it shows; 0 shows it at once. */
|
|
3
|
+
delay?: number;
|
|
4
|
+
/** The tile at the row's start, for a list whose rows have one. */
|
|
5
|
+
tile?: boolean;
|
|
6
|
+
/** The badge at the row's end, for a list whose rows have one. */
|
|
7
|
+
badge?: boolean;
|
|
8
|
+
class?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function SkeletonRow(props: SkeletonRowProps): import("solid-js").JSX.Element;
|
package/dist/Slider.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface SliderProps {
|
|
2
|
+
label?: string;
|
|
3
|
+
value: number;
|
|
4
|
+
onChange: (value: number) => void;
|
|
5
|
+
min: number;
|
|
6
|
+
max: number;
|
|
7
|
+
step?: number;
|
|
8
|
+
/** How the value reads, on screen and to a screen reader. */
|
|
9
|
+
format: (value: number) => string;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare function Slider(raw: SliderProps): import("solid-js").JSX.Element;
|
package/dist/Slider.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { r as e } from "./fieldName-Bb6qW0oS.js";
|
|
2
|
+
import { createComponent as t, insert as n, mergeProps as r, spread as i, template as a } from "solid-js/web";
|
|
3
|
+
import { Index as o, createMemo as s, createUniqueId as c, mergeProps as l } from "solid-js";
|
|
4
|
+
import { normalizeProps as u, useMachine as d } from "@zag-js/solid";
|
|
5
|
+
import * as f from "@zag-js/slider";
|
|
6
|
+
// src/Slider.tsx
|
|
7
|
+
var p = /*#__PURE__*/ a("<div data-glim=Slider><div class=glim-slider-head><label></label><output></output></div><div><div><div>"), m = /*#__PURE__*/ a("<div><input>");
|
|
8
|
+
function h(a) {
|
|
9
|
+
let h = l({ step: 1 }, a), g = c(), _ = e(() => h.label), v = d(f.machine, () => ({
|
|
10
|
+
id: g,
|
|
11
|
+
value: [h.value],
|
|
12
|
+
min: h.min,
|
|
13
|
+
max: h.max,
|
|
14
|
+
step: h.step,
|
|
15
|
+
disabled: h.disabled,
|
|
16
|
+
onValueChange: (e) => h.onChange(e.value[0]),
|
|
17
|
+
getAriaValueText: (e) => h.format(e.value)
|
|
18
|
+
})), y = s(() => f.connect(v, u));
|
|
19
|
+
return (() => {
|
|
20
|
+
var e = p(), a = e.firstChild, s = a.firstChild, c = s.nextSibling, l = a.nextSibling, u = l.firstChild, d = u.firstChild;
|
|
21
|
+
return i(e, r(() => y().getRootProps(), { class: "glim-slider" }), !1, !0), i(s, r(() => y().getLabelProps(), { get class() {
|
|
22
|
+
return h.label === void 0 ? "glim-sr-only" : "glim-field-label";
|
|
23
|
+
} }), !1, !0), n(s, _), i(c, r(() => y().getValueTextProps(), { class: "glim-slider-value" }), !1, !0), n(c, () => h.format(y().value[0])), i(l, r(() => y().getControlProps(), { class: "glim-slider-control" }), !1, !0), i(u, r(() => y().getTrackProps(), { class: "glim-slider-track" }), !1, !0), i(d, r(() => y().getRangeProps(), { class: "glim-slider-range" }), !1, !1), n(l, t(o, {
|
|
24
|
+
get each() {
|
|
25
|
+
return y().value;
|
|
26
|
+
},
|
|
27
|
+
children: (e, t) => (() => {
|
|
28
|
+
var e = m(), n = e.firstChild;
|
|
29
|
+
return i(e, r(() => y().getThumbProps({ index: t }), { class: "glim-slider-thumb" }), !1, !0), i(n, r(() => y().getHiddenInputProps({ index: t })), !1, !1), e;
|
|
30
|
+
})()
|
|
31
|
+
}), null), e;
|
|
32
|
+
})();
|
|
33
|
+
}
|
|
34
|
+
export { h as Slider };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
2
|
+
import { type SplitterPanel, type SplitterText } from "@glimstone/core";
|
|
3
|
+
export type { SplitterPanel, SplitterText } from "@glimstone/core";
|
|
4
|
+
export interface SplitterProps<T extends SplitterPanel> {
|
|
5
|
+
panels: readonly T[];
|
|
6
|
+
/** Each panel's share in percent, in the order of `panels`. */
|
|
7
|
+
size: number[];
|
|
8
|
+
onSizeChange: (size: number[]) => void;
|
|
9
|
+
orientation?: "horizontal" | "vertical";
|
|
10
|
+
/** Draws a panel's content. */
|
|
11
|
+
panel: (panel: T) => JSX.Element;
|
|
12
|
+
text?: Partial<SplitterText>;
|
|
13
|
+
}
|
|
14
|
+
export declare function Splitter<T extends SplitterPanel>(raw: SplitterProps<T>): JSX.Element;
|
package/dist/Splitter.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { createComponent as e, insert as t, mergeProps as n, spread as r, template as i } from "solid-js/web";
|
|
2
|
+
import { For as a, Show as o, createMemo as s, createUniqueId as c, mergeProps as l } from "solid-js";
|
|
3
|
+
import { SPLITTER_TEXT as u, pageDir as d, splitterHandleId as f } from "@glimstone/core";
|
|
4
|
+
import { normalizeProps as p, useMachine as m } from "@zag-js/solid";
|
|
5
|
+
import * as h from "@zag-js/splitter";
|
|
6
|
+
// src/Splitter.tsx
|
|
7
|
+
var g = /*#__PURE__*/ i("<div data-glim=Splitter>"), _ = /*#__PURE__*/ i("<div>"), v = /*#__PURE__*/ i("<div><span>");
|
|
8
|
+
function y(i) {
|
|
9
|
+
let y = l({ orientation: "horizontal" }, i), b = () => ({
|
|
10
|
+
...u,
|
|
11
|
+
...y.text
|
|
12
|
+
}), x = c(), S = m(h.machine, () => ({
|
|
13
|
+
id: x,
|
|
14
|
+
dir: d(),
|
|
15
|
+
orientation: y.orientation,
|
|
16
|
+
panels: y.panels.map(({ id: e, minSize: t, maxSize: n, collapsible: r }) => ({
|
|
17
|
+
id: e,
|
|
18
|
+
minSize: t,
|
|
19
|
+
maxSize: n,
|
|
20
|
+
collapsible: r
|
|
21
|
+
})),
|
|
22
|
+
size: y.size,
|
|
23
|
+
onResize: (e) => y.onSizeChange(e.size)
|
|
24
|
+
})), C = s(() => h.connect(S, p)), w = (e) => {
|
|
25
|
+
let t = y.panels[e + 1];
|
|
26
|
+
return t && f(y.panels[e], t);
|
|
27
|
+
};
|
|
28
|
+
return (() => {
|
|
29
|
+
var i = g();
|
|
30
|
+
return r(i, n(() => C().getRootProps(), { class: "glim-splitter" }), !1, !0), t(i, e(a, {
|
|
31
|
+
get each() {
|
|
32
|
+
return y.panels;
|
|
33
|
+
},
|
|
34
|
+
children: (i, a) => [(() => {
|
|
35
|
+
var e = _();
|
|
36
|
+
return r(e, n(() => C().getPanelProps({ id: i.id }), { class: "glim-splitter-panel" }), !1, !0), t(e, () => y.panel(i)), e;
|
|
37
|
+
})(), e(o, {
|
|
38
|
+
get when() {
|
|
39
|
+
return w(a());
|
|
40
|
+
},
|
|
41
|
+
children: (e) => (() => {
|
|
42
|
+
var t = v(), i = t.firstChild;
|
|
43
|
+
return r(t, n(() => C().getResizeTriggerProps({ id: e() }), {
|
|
44
|
+
get "aria-label"() {
|
|
45
|
+
return b().resize;
|
|
46
|
+
},
|
|
47
|
+
class: "glim-splitter-handle"
|
|
48
|
+
}), !1, !0), r(i, n(() => C().getResizeTriggerIndicator({ id: e() }), { class: "glim-splitter-grip" }), !1, !1), t;
|
|
49
|
+
})()
|
|
50
|
+
})]
|
|
51
|
+
})), i;
|
|
52
|
+
})();
|
|
53
|
+
}
|
|
54
|
+
export { y as Splitter };
|
package/dist/Steps.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
2
|
+
import { type StepsItem, type StepsText } from "@glimstone/core";
|
|
3
|
+
export type { StepsItem, StepsText } from "@glimstone/core";
|
|
4
|
+
export interface StepsProps<T extends StepsItem> {
|
|
5
|
+
items: readonly T[];
|
|
6
|
+
/** The step in force, counted from 0. Left out, it keeps its own. */
|
|
7
|
+
step?: number;
|
|
8
|
+
onStepChange?: (step: number) => void;
|
|
9
|
+
/** Only Back and Next move, so no step is skipped. */
|
|
10
|
+
linear?: boolean;
|
|
11
|
+
/** The forward button of the last step. */
|
|
12
|
+
onFinish?: () => void;
|
|
13
|
+
/** Draws a step's content. */
|
|
14
|
+
content: (item: T, index: number) => JSX.Element;
|
|
15
|
+
text?: Partial<StepsText>;
|
|
16
|
+
}
|
|
17
|
+
export declare function Steps<T extends StepsItem>(raw: StepsProps<T>): JSX.Element;
|
package/dist/Steps.js
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { t as e } from "./Button-DNSkNN0r.js";
|
|
2
|
+
import { d as t, i as n, t as r } from "./glyphs-xP5bYKa1.js";
|
|
3
|
+
import { createComponent as i, insert as a, mergeProps as o, spread as s, template as c } from "solid-js/web";
|
|
4
|
+
import { For as l, Show as u, createMemo as d, createSignal as f, createUniqueId as p, mergeProps as m } from "solid-js";
|
|
5
|
+
import { STEPS_TEXT as h, pageDir as g, stepsKeyTarget as _ } from "@glimstone/core";
|
|
6
|
+
import { normalizeProps as v, useMachine as y } from "@zag-js/solid";
|
|
7
|
+
import * as b from "@zag-js/steps";
|
|
8
|
+
// src/Steps.tsx
|
|
9
|
+
var x = /*#__PURE__*/ c("<div data-glim=Steps><div></div><div class=glim-steps-foot>"), S = /*#__PURE__*/ c("<div>"), C = /*#__PURE__*/ c("<div><button><span></span><span class=glim-steps-title>");
|
|
10
|
+
function w(c) {
|
|
11
|
+
let w = m({ linear: !1 }, c), T = () => ({
|
|
12
|
+
...h,
|
|
13
|
+
...w.text
|
|
14
|
+
}), E = p(), [D, O] = f(0), k = y(b.machine, () => ({
|
|
15
|
+
id: E,
|
|
16
|
+
dir: g(),
|
|
17
|
+
count: w.items.length,
|
|
18
|
+
step: w.step ?? D(),
|
|
19
|
+
linear: w.linear,
|
|
20
|
+
onStepChange: (e) => {
|
|
21
|
+
O(e.step), w.onStepChange?.(e.step);
|
|
22
|
+
}
|
|
23
|
+
})), A = d(() => b.connect(k, v)), j = () => A().value === w.items.length - 1, M = (e) => (t) => {
|
|
24
|
+
let n = _(t.key, e, w.items.length, g());
|
|
25
|
+
n !== null && (t.preventDefault(), document.getElementById(A().getItemState({ index: n }).triggerId)?.focus());
|
|
26
|
+
};
|
|
27
|
+
return (() => {
|
|
28
|
+
var c = x(), d = c.firstChild, f = d.nextSibling;
|
|
29
|
+
return s(c, o(() => A().getRootProps(), { class: "glim-steps" }), !1, !0), s(d, o(() => A().getListProps(), { class: "glim-steps-list" }), !1, !0), a(d, i(l, {
|
|
30
|
+
get each() {
|
|
31
|
+
return w.items;
|
|
32
|
+
},
|
|
33
|
+
children: (e, t) => (() => {
|
|
34
|
+
var r = C(), c = r.firstChild, l = c.firstChild, d = l.nextSibling;
|
|
35
|
+
return s(r, o(() => A().getItemProps({ index: t() }), { class: "glim-steps-item" }), !1, !0), s(c, o(() => A().getTriggerProps({ index: t() }), {
|
|
36
|
+
get tabIndex() {
|
|
37
|
+
return t() === A().value ? 0 : -1;
|
|
38
|
+
},
|
|
39
|
+
onKeyDown: (e) => M(t())(e),
|
|
40
|
+
class: "glim-steps-trigger"
|
|
41
|
+
}), !1, !0), s(l, o(() => A().getIndicatorProps({ index: t() }), { class: "glim-steps-indicator glim-num" }), !1, !0), a(l, i(u, {
|
|
42
|
+
get when() {
|
|
43
|
+
return A().getItemState({ index: t() }).completed;
|
|
44
|
+
},
|
|
45
|
+
get fallback() {
|
|
46
|
+
return t() + 1;
|
|
47
|
+
},
|
|
48
|
+
get children() {
|
|
49
|
+
return i(n, {});
|
|
50
|
+
}
|
|
51
|
+
})), a(d, () => e.title), a(r, i(u, {
|
|
52
|
+
get when() {
|
|
53
|
+
return t() < w.items.length - 1;
|
|
54
|
+
},
|
|
55
|
+
get children() {
|
|
56
|
+
var e = S();
|
|
57
|
+
return s(e, o(() => A().getSeparatorProps({ index: t() }), { class: "glim-steps-separator" }), !1, !1), e;
|
|
58
|
+
}
|
|
59
|
+
}), null), r;
|
|
60
|
+
})()
|
|
61
|
+
})), a(c, i(l, {
|
|
62
|
+
get each() {
|
|
63
|
+
return w.items;
|
|
64
|
+
},
|
|
65
|
+
children: (e, t) => (() => {
|
|
66
|
+
var n = S();
|
|
67
|
+
return s(n, o(() => A().getContentProps({ index: t() }), { class: "glim-steps-content" }), !1, !0), a(n, () => w.content(e, t())), n;
|
|
68
|
+
})()
|
|
69
|
+
}), f), a(f, i(e, {
|
|
70
|
+
get label() {
|
|
71
|
+
return T().back;
|
|
72
|
+
},
|
|
73
|
+
labelKey: null,
|
|
74
|
+
get glyph() {
|
|
75
|
+
return i(r, {});
|
|
76
|
+
},
|
|
77
|
+
get disabled() {
|
|
78
|
+
return !A().hasPrevStep;
|
|
79
|
+
},
|
|
80
|
+
onClick: () => A().goToPrevStep()
|
|
81
|
+
}), null), a(f, i(u, {
|
|
82
|
+
get when() {
|
|
83
|
+
return j();
|
|
84
|
+
},
|
|
85
|
+
get fallback() {
|
|
86
|
+
return i(e, {
|
|
87
|
+
get label() {
|
|
88
|
+
return T().next;
|
|
89
|
+
},
|
|
90
|
+
labelKey: null,
|
|
91
|
+
get glyph() {
|
|
92
|
+
return i(t, {});
|
|
93
|
+
},
|
|
94
|
+
onClick: () => A().goToNextStep()
|
|
95
|
+
});
|
|
96
|
+
},
|
|
97
|
+
get children() {
|
|
98
|
+
return i(e, {
|
|
99
|
+
get label() {
|
|
100
|
+
return T().finish;
|
|
101
|
+
},
|
|
102
|
+
labelKey: null,
|
|
103
|
+
get glyph() {
|
|
104
|
+
return i(n, {});
|
|
105
|
+
},
|
|
106
|
+
onClick: () => w.onFinish?.()
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
}), null), c;
|
|
110
|
+
})();
|
|
111
|
+
}
|
|
112
|
+
export { w as Steps };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
2
|
+
/**
|
|
3
|
+
* A flat, filled group inside a card or a window. It groups without a second
|
|
4
|
+
* raised surface and takes the place of a fold-out, so nothing hides behind a
|
|
5
|
+
* click. Fields and quiet buttons inside it step up one surface, so they do
|
|
6
|
+
* not vanish into its fill.
|
|
7
|
+
*/
|
|
8
|
+
export declare function SubCard(props: {
|
|
9
|
+
/** The group's name, drawn as a section badge on its top edge. */
|
|
10
|
+
title?: string;
|
|
11
|
+
/** One line on what the group does, drawn as an "(i)" inside the badge. */
|
|
12
|
+
hint?: string;
|
|
13
|
+
/** What belongs to the whole group, such as a switch, at the end of the
|
|
14
|
+
* heading's row. */
|
|
15
|
+
end?: JSX.Element;
|
|
16
|
+
children: JSX.Element;
|
|
17
|
+
}): JSX.Element;
|
package/dist/Table.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
2
|
+
import { type TableColumn } from "@glimstone/core";
|
|
3
|
+
export type { TableColumn } from "@glimstone/core";
|
|
4
|
+
export interface TableProps<T extends object> {
|
|
5
|
+
/** The table's accessible name. */
|
|
6
|
+
label: string;
|
|
7
|
+
columns: readonly TableColumn[];
|
|
8
|
+
rows: readonly T[];
|
|
9
|
+
/** One quiet line under the last row, such as how many more there are. */
|
|
10
|
+
more?: string;
|
|
11
|
+
/** Draws a cell of its own. Nothing returned shows the value. */
|
|
12
|
+
cell?: (row: T, column: TableColumn) => JSX.Element;
|
|
13
|
+
}
|
|
14
|
+
export declare function Table<T extends object>(props: TableProps<T>): JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type TagsInputText } from "@glimstone/core";
|
|
2
|
+
export type { TagsInputText } from "@glimstone/core";
|
|
3
|
+
export interface TagsInputProps {
|
|
4
|
+
label?: string;
|
|
5
|
+
value: string[];
|
|
6
|
+
onChange: (value: string[]) => void;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
/** How many tags it takes at most. */
|
|
9
|
+
max?: number;
|
|
10
|
+
/** Takes the same tag twice. */
|
|
11
|
+
allowDuplicates?: boolean;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
text?: Partial<TagsInputText>;
|
|
14
|
+
}
|
|
15
|
+
export declare function TagsInput(raw: TagsInputProps): import("solid-js").JSX.Element;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { r as e } from "./fieldName-Bb6qW0oS.js";
|
|
2
|
+
import { a as t } from "./glyphs-xP5bYKa1.js";
|
|
3
|
+
import { createComponent as n, insert as r, mergeProps as i, spread as a, template as o } from "solid-js/web";
|
|
4
|
+
import { Index as s, createMemo as c, createUniqueId as l, mergeProps as u } from "solid-js";
|
|
5
|
+
import { TAGS_INPUT_TEXT as d, pageDir as f } from "@glimstone/core";
|
|
6
|
+
import { normalizeProps as p, useMachine as m } from "@zag-js/solid";
|
|
7
|
+
import * as h from "@zag-js/tags-input";
|
|
8
|
+
// src/TagsInput.tsx
|
|
9
|
+
var g = /*#__PURE__*/ o("<div data-glim=TagsInput><label></label><div><input></div><input>"), _ = /*#__PURE__*/ o("<span><span><span></span><button></button></span><input>");
|
|
10
|
+
function v(o) {
|
|
11
|
+
let v = u({
|
|
12
|
+
allowDuplicates: !1,
|
|
13
|
+
disabled: !1
|
|
14
|
+
}, o), y = e(() => v.label), b = () => ({
|
|
15
|
+
...d,
|
|
16
|
+
...v.text
|
|
17
|
+
}), x = l(), S = m(h.machine, () => ({
|
|
18
|
+
id: x,
|
|
19
|
+
dir: f(),
|
|
20
|
+
value: v.value,
|
|
21
|
+
max: v.max,
|
|
22
|
+
allowDuplicates: v.allowDuplicates,
|
|
23
|
+
disabled: v.disabled,
|
|
24
|
+
placeholder: v.placeholder,
|
|
25
|
+
editable: !1,
|
|
26
|
+
blurBehavior: "add",
|
|
27
|
+
addOnPaste: !0,
|
|
28
|
+
onValueChange: (e) => v.onChange(e.value),
|
|
29
|
+
translations: {
|
|
30
|
+
deleteTagTriggerLabel: b().remove,
|
|
31
|
+
tagAdded: b().added,
|
|
32
|
+
tagSelected: b().selected,
|
|
33
|
+
tagDeleted: b().removed
|
|
34
|
+
}
|
|
35
|
+
})), C = c(() => h.connect(S, p));
|
|
36
|
+
return (() => {
|
|
37
|
+
var e = g(), o = e.firstChild, c = o.nextSibling, l = c.firstChild, u = c.nextSibling;
|
|
38
|
+
return a(e, i(() => C().getRootProps(), { class: "glim-tags" }), !1, !0), a(o, i(() => C().getLabelProps(), { get class() {
|
|
39
|
+
return v.label === void 0 ? "glim-sr-only" : "glim-field-label";
|
|
40
|
+
} }), !1, !0), r(o, y), a(c, i(() => C().getControlProps(), { class: "glim-tags-control" }), !1, !0), r(c, n(s, {
|
|
41
|
+
get each() {
|
|
42
|
+
return C().value;
|
|
43
|
+
},
|
|
44
|
+
children: (e, o) => {
|
|
45
|
+
let s = () => ({
|
|
46
|
+
index: o,
|
|
47
|
+
value: e()
|
|
48
|
+
});
|
|
49
|
+
return (() => {
|
|
50
|
+
var o = _(), c = o.firstChild, l = c.firstChild, u = l.nextSibling, d = c.nextSibling;
|
|
51
|
+
return a(o, i(() => C().getItemProps(s()), { class: "glim-tag-item" }), !1, !0), a(c, i(() => C().getItemPreviewProps(s()), { class: "glim-tag" }), !1, !0), a(l, i(() => C().getItemTextProps(s()), { class: "glim-tag-text" }), !1, !0), r(l, e), a(u, i(() => C().getItemDeleteTriggerProps(s()), { class: "glim-tag-remove" }), !1, !0), r(u, n(t, {})), a(d, i(() => C().getItemInputProps(s()), { class: "glim-tag-edit" }), !1, !1), o;
|
|
52
|
+
})();
|
|
53
|
+
}
|
|
54
|
+
}), l), a(l, i(() => C().getInputProps(), { class: "glim-tags-input" }), !1, !1), a(u, i(() => C().getHiddenInputProps()), !1, !1), e;
|
|
55
|
+
})();
|
|
56
|
+
}
|
|
57
|
+
export { v as TagsInput };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
2
|
+
import { type FieldWidth } from "@glimstone/core";
|
|
3
|
+
export type { FieldWidth } from "@glimstone/core";
|
|
4
|
+
export interface TextFieldProps extends Omit<JSX.InputHTMLAttributes<HTMLInputElement>, "width" | "class"> {
|
|
5
|
+
/** The accessible name. Inside a FieldRow the row gives it. */
|
|
6
|
+
label?: string;
|
|
7
|
+
/** Sets a path or a token in monospace. */
|
|
8
|
+
mono?: boolean;
|
|
9
|
+
width?: FieldWidth;
|
|
10
|
+
/** Why the value cannot stand, as a line under the field until it is fixed. */
|
|
11
|
+
error?: string;
|
|
12
|
+
class?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function TextField(props: TextFieldProps): JSX.Element;
|
|
15
|
+
export interface TextAreaProps extends Omit<JSX.TextareaHTMLAttributes<HTMLTextAreaElement>, "class"> {
|
|
16
|
+
/** The accessible name. Inside a FieldRow the row gives it. */
|
|
17
|
+
label?: string;
|
|
18
|
+
/** Sets the text in monospace. */
|
|
19
|
+
mono?: boolean;
|
|
20
|
+
width?: FieldWidth;
|
|
21
|
+
/** Why the value cannot stand, as a line under the field until it is fixed. */
|
|
22
|
+
error?: string;
|
|
23
|
+
class?: string;
|
|
24
|
+
}
|
|
25
|
+
export declare function TextArea(props: TextAreaProps): JSX.Element;
|
package/dist/Timer.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type TimerText } from "@glimstone/core";
|
|
2
|
+
export type { TimerText } from "@glimstone/core";
|
|
3
|
+
export interface TimerProps {
|
|
4
|
+
/** Counts down from startMs to zero rather than up. */
|
|
5
|
+
countdown?: boolean;
|
|
6
|
+
/** Where it starts, in milliseconds. */
|
|
7
|
+
startMs?: number;
|
|
8
|
+
/** Where a count up stops, in milliseconds. */
|
|
9
|
+
targetMs?: number;
|
|
10
|
+
autoStart?: boolean;
|
|
11
|
+
/** Called once a countdown reaches zero or a count up its target. */
|
|
12
|
+
onComplete?: () => void;
|
|
13
|
+
text?: Partial<TimerText>;
|
|
14
|
+
}
|
|
15
|
+
export declare function Timer(raw: TimerProps): import("solid-js").JSX.Element;
|
package/dist/Timer.js
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { t as e } from "./Button-DNSkNN0r.js";
|
|
2
|
+
import { f as t, h as n, m as r } from "./glyphs-xP5bYKa1.js";
|
|
3
|
+
import { createComponent as i, insert as a, mergeProps as o, spread as s, template as c } from "solid-js/web";
|
|
4
|
+
import { Match as l, Switch as u, createMemo as d, createUniqueId as f, mergeProps as p } from "solid-js";
|
|
5
|
+
import { TIMER_TEXT as m } from "@glimstone/core";
|
|
6
|
+
import { normalizeProps as h, useMachine as g } from "@zag-js/solid";
|
|
7
|
+
import * as _ from "@zag-js/timer";
|
|
8
|
+
// src/Timer.tsx
|
|
9
|
+
var v = /*#__PURE__*/ c("<div data-glim=Timer><div><span></span><span>:</span><span></span><span>:</span><span></span></div><div>");
|
|
10
|
+
function y(c) {
|
|
11
|
+
let y = p({
|
|
12
|
+
countdown: !1,
|
|
13
|
+
startMs: 0,
|
|
14
|
+
autoStart: !1
|
|
15
|
+
}, c), b = () => ({
|
|
16
|
+
...m,
|
|
17
|
+
...y.text
|
|
18
|
+
}), x = f(), S = g(_.machine, () => ({
|
|
19
|
+
id: x,
|
|
20
|
+
countdown: y.countdown,
|
|
21
|
+
startMs: y.startMs,
|
|
22
|
+
targetMs: y.targetMs,
|
|
23
|
+
autoStart: y.autoStart,
|
|
24
|
+
interval: 250,
|
|
25
|
+
onComplete: () => y.onComplete?.()
|
|
26
|
+
})), C = d(() => _.connect(S, h)), w = () => b().spoken(C().time.hours, C().time.minutes, C().time.seconds);
|
|
27
|
+
return (() => {
|
|
28
|
+
var c = v(), d = c.firstChild, f = d.firstChild, p = f.nextSibling, m = p.nextSibling, h = m.nextSibling, g = h.nextSibling, _ = d.nextSibling;
|
|
29
|
+
return s(c, o(() => C().getRootProps(), { class: "glim-timer" }), !1, !0), s(d, o(() => C().getAreaProps(), {
|
|
30
|
+
role: "timer",
|
|
31
|
+
get "aria-label"() {
|
|
32
|
+
return w();
|
|
33
|
+
},
|
|
34
|
+
get "data-running"() {
|
|
35
|
+
return C().running ? "" : void 0;
|
|
36
|
+
},
|
|
37
|
+
class: "glim-timer-figure glim-num"
|
|
38
|
+
}), !1, !0), s(f, o(() => C().getItemProps({ type: "hours" })), !1, !0), a(f, () => C().formattedTime.hours), s(p, o(() => C().getSeparatorProps()), !1, !0), s(m, o(() => C().getItemProps({ type: "minutes" })), !1, !0), a(m, () => C().formattedTime.minutes), s(h, o(() => C().getSeparatorProps()), !1, !0), s(g, o(() => C().getItemProps({ type: "seconds" })), !1, !0), a(g, () => C().formattedTime.seconds), s(_, o(() => C().getControlProps(), { class: "glim-timer-control" }), !1, !0), a(_, i(u, {
|
|
39
|
+
get fallback() {
|
|
40
|
+
return i(e, {
|
|
41
|
+
get label() {
|
|
42
|
+
return b().start;
|
|
43
|
+
},
|
|
44
|
+
labelKey: null,
|
|
45
|
+
get glyph() {
|
|
46
|
+
return i(r, {});
|
|
47
|
+
},
|
|
48
|
+
onClick: () => C().start()
|
|
49
|
+
});
|
|
50
|
+
},
|
|
51
|
+
get children() {
|
|
52
|
+
return [i(l, {
|
|
53
|
+
get when() {
|
|
54
|
+
return C().running;
|
|
55
|
+
},
|
|
56
|
+
get children() {
|
|
57
|
+
return i(e, {
|
|
58
|
+
get label() {
|
|
59
|
+
return b().pause;
|
|
60
|
+
},
|
|
61
|
+
labelKey: null,
|
|
62
|
+
get glyph() {
|
|
63
|
+
return i(t, {});
|
|
64
|
+
},
|
|
65
|
+
onClick: () => C().pause()
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}), i(l, {
|
|
69
|
+
get when() {
|
|
70
|
+
return C().paused;
|
|
71
|
+
},
|
|
72
|
+
get children() {
|
|
73
|
+
return i(e, {
|
|
74
|
+
get label() {
|
|
75
|
+
return b().resume;
|
|
76
|
+
},
|
|
77
|
+
labelKey: null,
|
|
78
|
+
get glyph() {
|
|
79
|
+
return i(r, {});
|
|
80
|
+
},
|
|
81
|
+
onClick: () => C().resume()
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
})];
|
|
85
|
+
}
|
|
86
|
+
}), null), a(_, i(e, {
|
|
87
|
+
get label() {
|
|
88
|
+
return b().reset;
|
|
89
|
+
},
|
|
90
|
+
labelKey: null,
|
|
91
|
+
get glyph() {
|
|
92
|
+
return i(n, {});
|
|
93
|
+
},
|
|
94
|
+
onClick: () => C().reset()
|
|
95
|
+
}), null), c;
|
|
96
|
+
})();
|
|
97
|
+
}
|
|
98
|
+
export { y as Timer };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
2
|
+
/**
|
|
3
|
+
* Boxes a disabled trigger with a tip in a span that still sees the pointer,
|
|
4
|
+
* since a disabled <button> emits no mouse events. Otherwise the trigger
|
|
5
|
+
* renders as it is.
|
|
6
|
+
*/
|
|
7
|
+
export declare function TipWrap(props: {
|
|
8
|
+
on: boolean;
|
|
9
|
+
show: () => void;
|
|
10
|
+
hide: () => void;
|
|
11
|
+
children: JSX.Element;
|
|
12
|
+
}): JSX.Element;
|
package/dist/Toast.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type ToastAction, type ToastSeverity, type ToastViewportEntry } from "@glimstone/core";
|
|
2
|
+
export type { ToastViewportEntry } from "@glimstone/core";
|
|
3
|
+
export interface ToastCardProps {
|
|
4
|
+
id: string;
|
|
5
|
+
message: string;
|
|
6
|
+
severity: ToastSeverity;
|
|
7
|
+
/** A button such as Undo. A press runs it and dismisses the toast. */
|
|
8
|
+
action?: ToastAction;
|
|
9
|
+
/** Accessible name for the dismiss button, the same for every toast. */
|
|
10
|
+
dismissLabel: string;
|
|
11
|
+
onDismiss: (id: string) => void;
|
|
12
|
+
onMouseEnter: (id: string) => void;
|
|
13
|
+
onMouseLeave: (id: string) => void;
|
|
14
|
+
onFocus: (id: string) => void;
|
|
15
|
+
onBlur: (id: string) => void;
|
|
16
|
+
}
|
|
17
|
+
export declare function ToastCard(props: ToastCardProps): import("solid-js").JSX.Element;
|
|
18
|
+
export interface ToastViewportProps {
|
|
19
|
+
toasts: ToastViewportEntry[];
|
|
20
|
+
dismissLabel: string;
|
|
21
|
+
onDismiss: (id: string) => void;
|
|
22
|
+
onMouseEnter: (id: string) => void;
|
|
23
|
+
onMouseLeave: (id: string) => void;
|
|
24
|
+
onFocus: (id: string) => void;
|
|
25
|
+
onBlur: (id: string) => void;
|
|
26
|
+
}
|
|
27
|
+
export declare function ToastViewport(props: ToastViewportProps): import("solid-js").JSX.Element;
|