@glimstone/solid 0.0.0-stage → 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.
- 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
package/README.md
CHANGED
|
@@ -1,3 +1,51 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @glimstone/solid
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The components of [GlimStone](https://junkerderprovinz.github.io/glimstone/) for
|
|
4
|
+
Solid, on `@glimstone/core`. They are the components of `@glimstone/react`
|
|
5
|
+
with the same names, the same props and defaults, the same behaviour contracts
|
|
6
|
+
and the same markup, so an app moves between the two by changing its imports.
|
|
7
|
+
|
|
8
|
+
```sh
|
|
9
|
+
npm install @glimstone/core @glimstone/solid
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
```tsx
|
|
13
|
+
import "@glimstone/core/tokens.css";
|
|
14
|
+
import { createSignal } from "solid-js";
|
|
15
|
+
import { applyCachedAppearance, applyStoredLabelModes } from "@glimstone/core";
|
|
16
|
+
import { Button, Toggle, setGlyphResolver, useConfirm } from "@glimstone/solid";
|
|
17
|
+
import { Select } from "@glimstone/solid/Select";
|
|
18
|
+
|
|
19
|
+
applyCachedAppearance();
|
|
20
|
+
applyStoredLabelModes();
|
|
21
|
+
setGlyphResolver((key) => appGlyph(key));
|
|
22
|
+
|
|
23
|
+
function Settings() {
|
|
24
|
+
const [quiet, setQuiet] = createSignal(true);
|
|
25
|
+
const [zone, setZone] = createSignal<string | null>("Europe/Vienna");
|
|
26
|
+
const { confirm, confirmDialog } = useConfirm({ title: "Confirm", cancel: "Cancel", confirm: "Confirm" });
|
|
27
|
+
return (
|
|
28
|
+
<>
|
|
29
|
+
<Toggle label="Quiet notifications" checked={quiet()} onChange={setQuiet} />
|
|
30
|
+
<Select label="Time zone" value={zone()} onChange={setZone} options={zones} />
|
|
31
|
+
<Button label="Delete" labelKey="delete" onClick={() => confirm("Delete the snapshot?")} />
|
|
32
|
+
{confirmDialog}
|
|
33
|
+
</>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
- Values are controlled as in React: `checked` or `value` with `onChange`.
|
|
39
|
+
- `class` takes the place of `className`, and attributes such as `id` or
|
|
40
|
+
`aria-*` go to the element as in React.
|
|
41
|
+
- Markup props take a `JSX.Element`. A Solid node stands in one place only, so
|
|
42
|
+
the resolver given to `setGlyphResolver` draws a new glyph on every call, and
|
|
43
|
+
a glyph that shows on a select's trigger and in its list is a function.
|
|
44
|
+
- The engines are primitives in the shape of `createSignal`: `useLabelMode`
|
|
45
|
+
returns an accessor, and `useRainbow`, `useShape`, `useMotion`, `useAccent`
|
|
46
|
+
and `useDensity` return an accessor and a setter that writes the document.
|
|
47
|
+
- Portalled parts, such as bubbles, menus and windows, go straight into the
|
|
48
|
+
body or the open sheet, without the wrapper Solid's `Portal` would add.
|
|
49
|
+
- `Select`, `Combobox` and `Slider` come from their own entries and need
|
|
50
|
+
`@zag-js/solid` with their machine packages (`@zag-js/select` and
|
|
51
|
+
`@zag-js/menu`, `@zag-js/combobox`, `@zag-js/slider`).
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
2
|
+
import { type OpenUrl, type UpdateCheck, type VersionRow } from "@glimstone/core";
|
|
3
|
+
export type { UpdateCheck, VersionRow } from "@glimstone/core";
|
|
4
|
+
export interface InfoAboutCardProps {
|
|
5
|
+
text: {
|
|
6
|
+
title: string;
|
|
7
|
+
body: string;
|
|
8
|
+
coffee: string;
|
|
9
|
+
/** The coffee button's accessible name; its artwork carries the words. */
|
|
10
|
+
coffeeButton: string;
|
|
11
|
+
/** The second give button. Only drawn together with `onPaypal`. */
|
|
12
|
+
paypalButton?: string;
|
|
13
|
+
/** The third. Only drawn together with `onCrypto`. */
|
|
14
|
+
cryptoButton?: string;
|
|
15
|
+
};
|
|
16
|
+
/** Opens the coffee window (CoffeeDialog), which stays inside the app. */
|
|
17
|
+
onCoffee: () => void;
|
|
18
|
+
/** Buy Me a Coffee's own button artwork, `COFFEE_BUTTON_SVG` from appMarks.ts. */
|
|
19
|
+
coffeeArt: JSX.Element;
|
|
20
|
+
/** Opens the PayPal window (PaypalDialog). Omit it where the maker takes no
|
|
21
|
+
* PayPal donations. */
|
|
22
|
+
onPaypal?: () => void;
|
|
23
|
+
/**
|
|
24
|
+
* The marks on the other give buttons. They are passed rather than resolved
|
|
25
|
+
* by label key, because a rule keyed on "crypto" would put a currency's
|
|
26
|
+
* symbol on settings that have nothing to do with it.
|
|
27
|
+
*/
|
|
28
|
+
paypalGlyph?: JSX.Element;
|
|
29
|
+
/** Opens the crypto window (CryptoDonateDialog). Omit it and the card offers
|
|
30
|
+
* no crypto button. */
|
|
31
|
+
onCrypto?: () => void;
|
|
32
|
+
cryptoGlyph?: JSX.Element;
|
|
33
|
+
hueIndex?: number;
|
|
34
|
+
}
|
|
35
|
+
/** The last card of the Info tile: who made the app, then the give row. */
|
|
36
|
+
export declare function InfoAboutCard(props: InfoAboutCardProps): JSX.Element;
|
|
37
|
+
export interface InfoVersionCardProps {
|
|
38
|
+
text: {
|
|
39
|
+
title: string;
|
|
40
|
+
/** The card's "(i)", such as what a click on a number opens. */
|
|
41
|
+
hint?: string;
|
|
42
|
+
unreleased: (version: string) => string;
|
|
43
|
+
/** "Release notes". Only drawn with `onReleaseNotes` and without `whatsNew`. */
|
|
44
|
+
releaseNotes?: string;
|
|
45
|
+
};
|
|
46
|
+
/** The app first, then the design language, then every component it ships. */
|
|
47
|
+
rows: VersionRow[];
|
|
48
|
+
/** "Check for updates" at the bottom of the card. Omit it and the card
|
|
49
|
+
* offers no check. */
|
|
50
|
+
updateCheck?: UpdateCheck;
|
|
51
|
+
/** Opens the app's window on the running version's release notes, for an
|
|
52
|
+
* app that marks no changes. */
|
|
53
|
+
onReleaseNotes?: () => void;
|
|
54
|
+
/** The app's own "New · n" button, wearing `IconWhatsNew` with the dot in
|
|
55
|
+
* front. It takes the place of "Release notes", so the card has one button there. */
|
|
56
|
+
whatsNew?: JSX.Element;
|
|
57
|
+
openUrl?: OpenUrl;
|
|
58
|
+
hueIndex?: number;
|
|
59
|
+
}
|
|
60
|
+
/** The first card: every version as a row, and the New or Release notes button and the update check under them. */
|
|
61
|
+
export declare function InfoVersionCard(props: InfoVersionCardProps): JSX.Element;
|
|
62
|
+
export interface InfoHelpCardProps {
|
|
63
|
+
text: {
|
|
64
|
+
title?: string;
|
|
65
|
+
/** The card's "(i)", such as what the bug report holds. */
|
|
66
|
+
hint?: string;
|
|
67
|
+
report: string;
|
|
68
|
+
repoButton: string;
|
|
69
|
+
mailButton: string;
|
|
70
|
+
mailSubject: string;
|
|
71
|
+
/** "Bug report". Only drawn together with `onBugReport`. */
|
|
72
|
+
bugReport?: string;
|
|
73
|
+
/** The bug report's second line, "Download". */
|
|
74
|
+
bugReportSub?: string;
|
|
75
|
+
/** "Manual". Only drawn together with `manualUrl`. */
|
|
76
|
+
manual?: string;
|
|
77
|
+
/** The manual's second line, "Open". */
|
|
78
|
+
manualSub?: string;
|
|
79
|
+
};
|
|
80
|
+
repoUrl: string;
|
|
81
|
+
/** The mark on the repository button, passed for the same reason as the
|
|
82
|
+
* give buttons' marks. */
|
|
83
|
+
repoGlyph?: JSX.Element;
|
|
84
|
+
/** The workshop's own mailbox. Omit it and the card offers no mail route. */
|
|
85
|
+
mailAddress?: string;
|
|
86
|
+
/** The envelope, `MAIL_SVG` from appMarks.ts, which opens under the pointer. */
|
|
87
|
+
mailGlyph?: JSX.Element;
|
|
88
|
+
/** The app's handbook. Omit it where the app has none; the README is not a
|
|
89
|
+
* manual. */
|
|
90
|
+
manualUrl?: string;
|
|
91
|
+
/** The book, `MANUAL_SVG` from appMarks.ts, which opens under the pointer. */
|
|
92
|
+
manualGlyph?: JSX.Element;
|
|
93
|
+
/** Downloads the instance's logs and settings as one file, without
|
|
94
|
+
* passwords, keys or credentials. */
|
|
95
|
+
onBugReport?: () => void;
|
|
96
|
+
/** `IconDiagnostics`, the bug. */
|
|
97
|
+
bugGlyph?: JSX.Element;
|
|
98
|
+
openUrl?: OpenUrl;
|
|
99
|
+
hueIndex?: number;
|
|
100
|
+
}
|
|
101
|
+
/** The second card: a sentence inviting a report, then GitHub, Email, the manual and the bug report. */
|
|
102
|
+
export declare function InfoHelpCard(props: InfoHelpCardProps): JSX.Element;
|
|
103
|
+
export interface InfoTileProps {
|
|
104
|
+
version: Omit<InfoVersionCardProps, "hueIndex">;
|
|
105
|
+
help: Omit<InfoHelpCardProps, "hueIndex">;
|
|
106
|
+
about: Omit<InfoAboutCardProps, "hueIndex">;
|
|
107
|
+
/** The Version card's rainbow position; the cards after it take the next ones. */
|
|
108
|
+
hueIndex?: number;
|
|
109
|
+
/** Data attributes for the tile, so a component built on it can name itself. */
|
|
110
|
+
[data: `data-${string}`]: string | undefined;
|
|
111
|
+
}
|
|
112
|
+
/** The Info tile's cards in their fixed order, for the page that stacks them. */
|
|
113
|
+
export declare function InfoTile(props: InfoTileProps): JSX.Element;
|
|
114
|
+
/**
|
|
115
|
+
* The 3.2.0 props of the single About card, laid out as the Info tile: the
|
|
116
|
+
* About card under `text.title`, the Version card under `text.version` with the
|
|
117
|
+
* app and GlimStone as its rows, and the Help card.
|
|
118
|
+
*
|
|
119
|
+
* @deprecated Use `InfoTile`, which adds the version rows' sub-lines, the
|
|
120
|
+
* other components, "Check for updates" and the bug report.
|
|
121
|
+
*/
|
|
122
|
+
export declare function AboutCard(props: {
|
|
123
|
+
text: {
|
|
124
|
+
title: string;
|
|
125
|
+
body: string;
|
|
126
|
+
coffee: string;
|
|
127
|
+
coffeeButton: string;
|
|
128
|
+
cryptoButton?: string;
|
|
129
|
+
paypalButton?: string;
|
|
130
|
+
report: string;
|
|
131
|
+
repoButton: string;
|
|
132
|
+
mailButton: string;
|
|
133
|
+
mailSubject: string;
|
|
134
|
+
version: string;
|
|
135
|
+
unreleased: (version: string) => string;
|
|
136
|
+
/** The Help card's heading. Without it the card draws none. */
|
|
137
|
+
helpTitle?: string;
|
|
138
|
+
};
|
|
139
|
+
version: string | null;
|
|
140
|
+
glimstoneVersion: string;
|
|
141
|
+
repoUrl: string;
|
|
142
|
+
repoGlyph?: JSX.Element;
|
|
143
|
+
glimstoneRepoUrl: string;
|
|
144
|
+
onCoffee: () => void;
|
|
145
|
+
coffeeArt: JSX.Element;
|
|
146
|
+
cryptoGlyph?: JSX.Element;
|
|
147
|
+
paypalGlyph?: JSX.Element;
|
|
148
|
+
onPaypal?: () => void;
|
|
149
|
+
onCrypto?: () => void;
|
|
150
|
+
mailAddress?: string;
|
|
151
|
+
mailGlyph?: JSX.Element;
|
|
152
|
+
openUrl?: (url: string) => void;
|
|
153
|
+
hueIndex?: number;
|
|
154
|
+
}): JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
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) => JSX.Element;
|
|
14
|
+
}
|
|
15
|
+
export declare function Accordion<T extends AccordionItem>(raw: AccordionProps<T>): JSX.Element;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { s as e } from "./glyphs-xP5bYKa1.js";
|
|
2
|
+
import { Dynamic as t, createComponent as n, insert as r, mergeProps as i, spread as a, template as o } from "solid-js/web";
|
|
3
|
+
import { For as s, createMemo as c, createSignal as l, createUniqueId as u, mergeProps as d } from "solid-js";
|
|
4
|
+
import { pageDir as f } from "@glimstone/core";
|
|
5
|
+
import { normalizeProps as p, useMachine as m } from "@zag-js/solid";
|
|
6
|
+
import * as h from "@zag-js/accordion";
|
|
7
|
+
// src/Accordion.tsx
|
|
8
|
+
var g = /*#__PURE__*/ o("<div data-glim=Accordion>"), _ = /*#__PURE__*/ o("<button><span class=glim-disclosure-label></span><span>"), v = /*#__PURE__*/ o("<div><div><div class=glim-disclosure-body>");
|
|
9
|
+
function y(o) {
|
|
10
|
+
let y = d({
|
|
11
|
+
multiple: !1,
|
|
12
|
+
headingLevel: 3
|
|
13
|
+
}, o), b = u(), [x, S] = l([]), C = m(h.machine, () => ({
|
|
14
|
+
id: b,
|
|
15
|
+
dir: f(),
|
|
16
|
+
value: y.value ?? x(),
|
|
17
|
+
multiple: y.multiple,
|
|
18
|
+
collapsible: !0,
|
|
19
|
+
onValueChange: (e) => {
|
|
20
|
+
S(e.value), y.onChange?.(e.value);
|
|
21
|
+
}
|
|
22
|
+
})), w = c(() => h.connect(C, p));
|
|
23
|
+
return (() => {
|
|
24
|
+
var o = g();
|
|
25
|
+
return a(o, i(() => w().getRootProps(), { class: "glim-accordion" }), !1, !0), r(o, n(s, {
|
|
26
|
+
get each() {
|
|
27
|
+
return y.items;
|
|
28
|
+
},
|
|
29
|
+
children: (o) => (() => {
|
|
30
|
+
var s = v(), c = s.firstChild, l = c.firstChild;
|
|
31
|
+
return a(s, i(() => w().getItemProps(o), { class: "glim-accordion-item" }), !1, !0), r(s, n(t, {
|
|
32
|
+
get component() {
|
|
33
|
+
return `h${y.headingLevel}`;
|
|
34
|
+
},
|
|
35
|
+
class: "glim-disclosure-heading",
|
|
36
|
+
get children() {
|
|
37
|
+
var t = _(), s = t.firstChild, c = s.nextSibling;
|
|
38
|
+
return a(t, i(() => w().getItemTriggerProps(o), { class: "glim-disclosure-trigger" }), !1, !0), r(s, () => o.title), a(c, i(() => w().getItemIndicatorProps(o), { class: "glim-disclosure-indicator" }), !1, !0), r(c, n(e, {})), t;
|
|
39
|
+
}
|
|
40
|
+
}), c), a(c, i(() => w().getItemContentProps(o), { class: "glim-disclosure-content" }), !1, !0), r(l, () => y.content(o)), s;
|
|
41
|
+
})()
|
|
42
|
+
})), o;
|
|
43
|
+
})();
|
|
44
|
+
}
|
|
45
|
+
export { y as Accordion };
|
|
@@ -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(raw: AngleSliderProps): import("solid-js").JSX.Element;
|
|
@@ -0,0 +1,47 @@
|
|
|
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 { For as o, createMemo as s, createUniqueId as c, mergeProps as l } from "solid-js";
|
|
4
|
+
import { pageDir as u } from "@glimstone/core";
|
|
5
|
+
import { normalizeProps as d, useMachine as f } from "@zag-js/solid";
|
|
6
|
+
import * as p from "@zag-js/angle-slider";
|
|
7
|
+
// src/AngleSlider.tsx
|
|
8
|
+
var m = /*#__PURE__*/ a("<div data-glim=AngleSlider><label></label><div class=glim-angle-body><div><div></div><div></div></div><div></div></div><input>"), h = /*#__PURE__*/ a("<span>");
|
|
9
|
+
function g(a) {
|
|
10
|
+
let g = l({
|
|
11
|
+
step: 1,
|
|
12
|
+
marks: [
|
|
13
|
+
0,
|
|
14
|
+
90,
|
|
15
|
+
180,
|
|
16
|
+
270
|
|
17
|
+
],
|
|
18
|
+
disabled: !1
|
|
19
|
+
}, a), _ = c(), v = e(() => g.label), y = f(p.machine, () => ({
|
|
20
|
+
id: _,
|
|
21
|
+
dir: u(),
|
|
22
|
+
value: g.value,
|
|
23
|
+
step: g.step,
|
|
24
|
+
disabled: g.disabled,
|
|
25
|
+
onValueChange: (e) => g.onChange(e.value)
|
|
26
|
+
})), b = s(() => p.connect(y, d));
|
|
27
|
+
return (() => {
|
|
28
|
+
var e = m(), a = e.firstChild, s = a.nextSibling, c = s.firstChild, l = c.firstChild, u = l.nextSibling, d = c.nextSibling, f = s.nextSibling;
|
|
29
|
+
return i(e, r(() => b().getRootProps(), { class: "glim-angle" }), !1, !0), i(a, r(() => b().getLabelProps(), { get class() {
|
|
30
|
+
return g.label === void 0 ? "glim-sr-only" : "glim-field-label";
|
|
31
|
+
} }), !1, !0), n(a, v), i(c, r(() => b().getControlProps(), { class: "glim-angle-dial" }), !1, !0), i(l, r(() => b().getMarkerGroupProps(), { class: "glim-angle-marks" }), !1, !0), n(l, t(o, {
|
|
32
|
+
get each() {
|
|
33
|
+
return g.marks;
|
|
34
|
+
},
|
|
35
|
+
children: (e) => (() => {
|
|
36
|
+
var t = h();
|
|
37
|
+
return i(t, r(() => b().getMarkerProps({ value: e }), { class: "glim-angle-mark" }), !1, !1), t;
|
|
38
|
+
})()
|
|
39
|
+
})), i(u, r(() => b().getThumbProps(), {
|
|
40
|
+
get "aria-valuetext"() {
|
|
41
|
+
return `${b().value}°`;
|
|
42
|
+
},
|
|
43
|
+
class: "glim-angle-thumb"
|
|
44
|
+
}), !1, !1), i(d, r(() => b().getValueTextProps(), { class: "glim-angle-value glim-num" }), !1, !0), n(d, () => `${b().value}°`), i(f, r(() => b().getHiddenInputProps()), !1, !1), e;
|
|
45
|
+
})();
|
|
46
|
+
}
|
|
47
|
+
export { g as AngleSlider };
|
package/dist/Avatar.d.ts
ADDED
|
@@ -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(raw: AvatarProps): import("solid-js").JSX.Element;
|
package/dist/Avatar.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { t as e } from "./style-ByE-hij7.js";
|
|
2
|
+
import { createComponent as t, insert as n, mergeProps as r, spread as i, template as a } from "solid-js/web";
|
|
3
|
+
import { Show as o, createMemo as s, createUniqueId as c, mergeProps as l } from "solid-js";
|
|
4
|
+
import { avatarView as u, initials as d, pageDir as f } from "@glimstone/core";
|
|
5
|
+
import { normalizeProps as p, useMachine as m } from "@zag-js/solid";
|
|
6
|
+
import * as h from "@zag-js/avatar";
|
|
7
|
+
// src/Avatar.tsx
|
|
8
|
+
var g = /*#__PURE__*/ a("<img>"), _ = /*#__PURE__*/ a("<span data-glim=Avatar><span>");
|
|
9
|
+
function v(a) {
|
|
10
|
+
let v = l({ size: "md" }, a), y = c(), b = m(h.machine, () => ({
|
|
11
|
+
id: y,
|
|
12
|
+
dir: f()
|
|
13
|
+
})), x = s(() => h.connect(b, p)), S = s(() => u({
|
|
14
|
+
size: v.size,
|
|
15
|
+
hueIndex: v.hueIndex
|
|
16
|
+
}));
|
|
17
|
+
return (() => {
|
|
18
|
+
var a = _(), s = a.firstChild;
|
|
19
|
+
return i(a, r(() => x().getRootProps(), {
|
|
20
|
+
role: "img",
|
|
21
|
+
get "aria-label"() {
|
|
22
|
+
return v.name;
|
|
23
|
+
},
|
|
24
|
+
get class() {
|
|
25
|
+
return S().className;
|
|
26
|
+
},
|
|
27
|
+
get style() {
|
|
28
|
+
return e(S().style);
|
|
29
|
+
}
|
|
30
|
+
}), !1, !0), n(a, t(o, {
|
|
31
|
+
get when() {
|
|
32
|
+
return v.src;
|
|
33
|
+
},
|
|
34
|
+
get children() {
|
|
35
|
+
var e = g();
|
|
36
|
+
return i(e, r(() => x().getImageProps(), {
|
|
37
|
+
get src() {
|
|
38
|
+
return v.src;
|
|
39
|
+
},
|
|
40
|
+
alt: "",
|
|
41
|
+
class: "glim-avatar-image"
|
|
42
|
+
}), !1, !1), e;
|
|
43
|
+
}
|
|
44
|
+
}), s), i(s, r(() => x().getFallbackProps(), {
|
|
45
|
+
"aria-hidden": "true",
|
|
46
|
+
class: "glim-avatar-fallback"
|
|
47
|
+
}), !1, !0), n(s, () => d(v.name)), a;
|
|
48
|
+
})();
|
|
49
|
+
}
|
|
50
|
+
export { v as Avatar };
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { t as e } from "./IconTipButton-BojUYQWU.js";
|
|
2
|
+
import { t } from "./style-ByE-hij7.js";
|
|
3
|
+
import { className as n, createComponent as r, delegateEvents as i, effect as a, insert as o, memo as s, setAttribute as c, style as l, template as u } from "solid-js/web";
|
|
4
|
+
import { Match as d, Switch as f, mergeProps as p } from "solid-js";
|
|
5
|
+
import { badgeClassName as m, hueVars as h } from "@glimstone/core";
|
|
6
|
+
// src/Badge.tsx
|
|
7
|
+
var g = /*#__PURE__*/ u("<button data-glim=Badge type=button>"), _ = /*#__PURE__*/ u("<a data-glim=Badge>"), v = /*#__PURE__*/ u("<span data-glim=Badge>");
|
|
8
|
+
function y(i) {
|
|
9
|
+
let u = p({
|
|
10
|
+
tone: "neutral",
|
|
11
|
+
size: "medium",
|
|
12
|
+
as: "span"
|
|
13
|
+
}, i), y = () => u.hueIndex !== void 0 && (u.tone === "heading" || u.tone === "active"), b = () => [
|
|
14
|
+
y() && "glim-hue",
|
|
15
|
+
y() && u.size === "heading" && "glim-notch-hue",
|
|
16
|
+
m({
|
|
17
|
+
tone: u.tone,
|
|
18
|
+
size: u.size,
|
|
19
|
+
form: u.form,
|
|
20
|
+
shape: u.shape,
|
|
21
|
+
wrap: u.wrap,
|
|
22
|
+
iconOnly: u.tip !== void 0,
|
|
23
|
+
inFlow: u.inFlow,
|
|
24
|
+
insetStart: u.insetStart,
|
|
25
|
+
action: u.as !== "span"
|
|
26
|
+
}),
|
|
27
|
+
u.class
|
|
28
|
+
].filter(Boolean).join(" "), x = () => y() ? t(h(u.hueIndex)) : void 0, S = () => u.onClick?.();
|
|
29
|
+
return r(f, {
|
|
30
|
+
get fallback() {
|
|
31
|
+
return (() => {
|
|
32
|
+
var e = v();
|
|
33
|
+
return o(e, () => u.children), a((t) => {
|
|
34
|
+
var r = u.title, i = u.ariaLabel ? "img" : void 0, a = u.ariaLabel, o = x(), s = b();
|
|
35
|
+
return r !== t.e && c(e, "title", t.e = r), i !== t.t && c(e, "role", t.t = i), a !== t.a && c(e, "aria-label", t.a = a), t.o = l(e, o, t.o), s !== t.i && n(e, t.i = s), t;
|
|
36
|
+
}, {
|
|
37
|
+
e: void 0,
|
|
38
|
+
t: void 0,
|
|
39
|
+
a: void 0,
|
|
40
|
+
o: void 0,
|
|
41
|
+
i: void 0
|
|
42
|
+
}), e;
|
|
43
|
+
})();
|
|
44
|
+
},
|
|
45
|
+
get children() {
|
|
46
|
+
return [
|
|
47
|
+
r(d, {
|
|
48
|
+
get when() {
|
|
49
|
+
return s(() => u.as === "button")() && u.tip !== void 0;
|
|
50
|
+
},
|
|
51
|
+
get children() {
|
|
52
|
+
return r(e, {
|
|
53
|
+
"data-glim": "Badge",
|
|
54
|
+
get tip() {
|
|
55
|
+
return u.tip;
|
|
56
|
+
},
|
|
57
|
+
onClick: S,
|
|
58
|
+
get disabled() {
|
|
59
|
+
return u.disabled;
|
|
60
|
+
},
|
|
61
|
+
get style() {
|
|
62
|
+
return x();
|
|
63
|
+
},
|
|
64
|
+
get class() {
|
|
65
|
+
return b();
|
|
66
|
+
},
|
|
67
|
+
get children() {
|
|
68
|
+
return u.children;
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}),
|
|
73
|
+
r(d, {
|
|
74
|
+
get when() {
|
|
75
|
+
return u.as === "button";
|
|
76
|
+
},
|
|
77
|
+
get children() {
|
|
78
|
+
var e = g();
|
|
79
|
+
return e.$$click = S, o(e, () => u.children), a((t) => {
|
|
80
|
+
var r = u.disabled, i = u.title, a = u.ariaLabel, o = x(), s = b();
|
|
81
|
+
return r !== t.e && (e.disabled = t.e = r), i !== t.t && c(e, "title", t.t = i), a !== t.a && c(e, "aria-label", t.a = a), t.o = l(e, o, t.o), s !== t.i && n(e, t.i = s), t;
|
|
82
|
+
}, {
|
|
83
|
+
e: void 0,
|
|
84
|
+
t: void 0,
|
|
85
|
+
a: void 0,
|
|
86
|
+
o: void 0,
|
|
87
|
+
i: void 0
|
|
88
|
+
}), e;
|
|
89
|
+
}
|
|
90
|
+
}),
|
|
91
|
+
r(d, {
|
|
92
|
+
get when() {
|
|
93
|
+
return u.as === "a";
|
|
94
|
+
},
|
|
95
|
+
get children() {
|
|
96
|
+
var e = _();
|
|
97
|
+
return o(e, () => u.children), a((t) => {
|
|
98
|
+
var r = u.href, i = u.target, a = u.rel, o = u.title, s = u.ariaLabel, d = x(), f = b();
|
|
99
|
+
return r !== t.e && c(e, "href", t.e = r), i !== t.t && c(e, "target", t.t = i), a !== t.a && c(e, "rel", t.a = a), o !== t.o && c(e, "title", t.o = o), s !== t.i && c(e, "aria-label", t.i = s), t.n = l(e, d, t.n), f !== t.s && n(e, t.s = f), t;
|
|
100
|
+
}, {
|
|
101
|
+
e: void 0,
|
|
102
|
+
t: void 0,
|
|
103
|
+
a: void 0,
|
|
104
|
+
o: void 0,
|
|
105
|
+
i: void 0,
|
|
106
|
+
n: void 0,
|
|
107
|
+
s: void 0
|
|
108
|
+
}), e;
|
|
109
|
+
}
|
|
110
|
+
})
|
|
111
|
+
];
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
i(["click"]);
|
|
116
|
+
export { y as t };
|
package/dist/Badge.d.ts
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
2
|
+
import { type BadgeForm, type BadgeShape, type BadgeSize, type BadgeTone, type NotchInset } from "@glimstone/core";
|
|
3
|
+
export type { BadgeForm, BadgeShape, BadgeSize, BadgeTone, NotchInset } from "@glimstone/core";
|
|
4
|
+
export interface BadgeProps {
|
|
5
|
+
children: JSX.Element;
|
|
6
|
+
/** Status colour. Defaults to the neutral chip. */
|
|
7
|
+
tone?: BadgeTone;
|
|
8
|
+
/** Size stage; see badgeClassName in the core. A square icon-only badge is always
|
|
9
|
+
* `"icon"`. */
|
|
10
|
+
size?: BadgeSize;
|
|
11
|
+
/** The corners: rounded, square, pill or circle. Without it they follow the
|
|
12
|
+
* shape setting. */
|
|
13
|
+
form?: BadgeForm;
|
|
14
|
+
/** @deprecated Use `form`. Only "circle" has an effect: it makes the badge
|
|
15
|
+
* icon-only. */
|
|
16
|
+
shape?: BadgeShape;
|
|
17
|
+
/** Render as a <button> or a real <a href>, with the same box as a span. */
|
|
18
|
+
as?: "span" | "button" | "a";
|
|
19
|
+
onClick?: () => void;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
title?: string;
|
|
22
|
+
/** Accessible name for an icon-only badge whose glyph is aria-hidden. */
|
|
23
|
+
ariaLabel?: string;
|
|
24
|
+
/** `as="a"` only: passed straight through to the underlying <a>. */
|
|
25
|
+
href?: string;
|
|
26
|
+
target?: string;
|
|
27
|
+
rel?: string;
|
|
28
|
+
/** Let content that wraps grow the box instead of overflowing it. */
|
|
29
|
+
wrap?: boolean;
|
|
30
|
+
/** Extra classes, such as `tabular-nums` for a count, or `max-w-full` with
|
|
31
|
+
* `wrap` in a narrow column. */
|
|
32
|
+
class?: string;
|
|
33
|
+
/** Rainbow position, by the caller's list index among the badges visible at
|
|
34
|
+
* once. Only `heading` and `active` take it, since the other tones are
|
|
35
|
+
* status signals. Omit it for the only such badge on a page, which keeps
|
|
36
|
+
* the single accent. */
|
|
37
|
+
hueIndex?: number;
|
|
38
|
+
/** `as="button"` only. The tooltip and accessible name of an icon-only
|
|
39
|
+
* button, rendered through IconTipButton; it also makes the badge
|
|
40
|
+
* icon-only for sizing, and replaces `title` and `ariaLabel`. */
|
|
41
|
+
tip?: string;
|
|
42
|
+
/** Heading notch only: the card's content padding in quarter-rem steps
|
|
43
|
+
* (`insetStart={5}` for 1.25rem), for the two cases NotchInset describes.
|
|
44
|
+
* Omit it where the static position already lands right. */
|
|
45
|
+
insetStart?: NotchInset;
|
|
46
|
+
/** Heading notch only: keep the notch's look without positioning it, for
|
|
47
|
+
* several heading badges that straddle one card edge together inside a
|
|
48
|
+
* caller-positioned <h2>. `insetStart` is ignored alongside it. A heading
|
|
49
|
+
* badge in normal flow is a `tone="heading"` badge at another size. */
|
|
50
|
+
inFlow?: boolean;
|
|
51
|
+
}
|
|
52
|
+
export declare function Badge(props: BadgeProps): JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type BusyRingSize } from "@glimstone/core";
|
|
2
|
+
export type { BusyRingSize } from "@glimstone/core";
|
|
3
|
+
export interface BusyRingProps {
|
|
4
|
+
/** `small` fits a button's glyph slot, `large` a card that waits. */
|
|
5
|
+
size?: BusyRingSize;
|
|
6
|
+
/** What is being waited for. With it the ring is a status that says so, without
|
|
7
|
+
* it the ring is hidden from assistive technology and its surroundings speak. */
|
|
8
|
+
label?: string;
|
|
9
|
+
/** Milliseconds before it shows; 0 shows it at once. */
|
|
10
|
+
delay?: number;
|
|
11
|
+
class?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function BusyRing(props: BusyRingProps): import("solid-js").JSX.Element;
|