@glimstone/svelte 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 +53 -2
- package/dist/AboutCard.svelte +87 -0
- package/dist/AboutCard.svelte.d.ts +37 -0
- package/dist/Accordion.svelte +60 -0
- package/dist/Accordion.svelte.d.ts +38 -0
- package/dist/AngleSlider.svelte +56 -0
- package/dist/AngleSlider.svelte.d.ts +13 -0
- package/dist/Avatar.svelte +37 -0
- package/dist/Avatar.svelte.d.ts +13 -0
- package/dist/Badge.svelte +119 -0
- package/dist/Badge.svelte.d.ts +54 -0
- package/dist/BrandMark.svelte +12 -0
- package/dist/BrandMark.svelte.d.ts +6 -0
- package/dist/BusyRing.svelte +39 -0
- package/dist/BusyRing.svelte.d.ts +15 -0
- package/dist/Button.svelte +172 -0
- package/dist/Button.svelte.d.ts +57 -0
- package/dist/Card.svelte +61 -0
- package/dist/Card.svelte.d.ts +23 -0
- package/dist/Carousel.svelte +72 -0
- package/dist/Carousel.svelte.d.ts +41 -0
- package/dist/Checkbox.svelte +48 -0
- package/dist/Checkbox.svelte.d.ts +17 -0
- package/dist/CoffeeDialog.svelte +70 -0
- package/dist/CoffeeDialog.svelte.d.ts +18 -0
- package/dist/Collapsible.svelte +49 -0
- package/dist/Collapsible.svelte.d.ts +14 -0
- package/dist/ColorPicker.svelte +122 -0
- package/dist/ColorPicker.svelte.d.ts +23 -0
- package/dist/Combobox.svelte +87 -0
- package/dist/Combobox.svelte.d.ts +18 -0
- package/dist/ConfirmDialog.svelte +106 -0
- package/dist/ConfirmDialog.svelte.d.ts +31 -0
- package/dist/ConfirmHost.svelte +41 -0
- package/dist/ConfirmHost.svelte.d.ts +7 -0
- package/dist/ContextMenu.svelte +213 -0
- package/dist/ContextMenu.svelte.d.ts +29 -0
- package/dist/CopyField.svelte +60 -0
- package/dist/CopyField.svelte.d.ts +19 -0
- package/dist/CryptoDonateDialog.svelte +162 -0
- package/dist/CryptoDonateDialog.svelte.d.ts +37 -0
- package/dist/DatePicker.svelte +149 -0
- package/dist/DatePicker.svelte.d.ts +18 -0
- package/dist/DropdownListbox.svelte +178 -0
- package/dist/DropdownListbox.svelte.d.ts +23 -0
- package/dist/EmptyState.svelte +31 -0
- package/dist/EmptyState.svelte.d.ts +16 -0
- package/dist/FieldError.svelte +20 -0
- package/dist/FieldError.svelte.d.ts +8 -0
- package/dist/FieldRow.svelte +52 -0
- package/dist/FieldRow.svelte.d.ts +23 -0
- package/dist/FieldRowGroup.svelte +33 -0
- package/dist/FieldRowGroup.svelte.d.ts +13 -0
- package/dist/FileUpload.svelte +74 -0
- package/dist/FileUpload.svelte.d.ts +18 -0
- package/dist/FloatingPanel.svelte +89 -0
- package/dist/FloatingPanel.svelte.d.ts +17 -0
- package/dist/Fortress.svelte +222 -0
- package/dist/Fortress.svelte.d.ts +62 -0
- package/dist/FortressAppCard.svelte +115 -0
- package/dist/FortressAppCard.svelte.d.ts +18 -0
- package/dist/FortressDoubtWindow.svelte +37 -0
- package/dist/FortressDoubtWindow.svelte.d.ts +12 -0
- package/dist/FortressPairing.svelte +85 -0
- package/dist/FortressPairing.svelte.d.ts +32 -0
- package/dist/FortressPermissions.svelte +93 -0
- package/dist/FortressPermissions.svelte.d.ts +24 -0
- package/dist/FortressStatusWindow.svelte +128 -0
- package/dist/FortressStatusWindow.svelte.d.ts +20 -0
- package/dist/FortressWindow.svelte +271 -0
- package/dist/FortressWindow.svelte.d.ts +18 -0
- package/dist/GlyphField.svelte +52 -0
- package/dist/GlyphField.svelte.d.ts +20 -0
- package/dist/GlyphTile.svelte +25 -0
- package/dist/GlyphTile.svelte.d.ts +14 -0
- package/dist/HoverCard.svelte +47 -0
- package/dist/HoverCard.svelte.d.ts +14 -0
- package/dist/IconButton.svelte +49 -0
- package/dist/IconButton.svelte.d.ts +20 -0
- package/dist/IconTipButton.svelte +67 -0
- package/dist/IconTipButton.svelte.d.ts +23 -0
- package/dist/InfoAboutCard.svelte +65 -0
- package/dist/InfoAboutCard.svelte.d.ts +35 -0
- package/dist/InfoBubble.svelte +50 -0
- package/dist/InfoBubble.svelte.d.ts +7 -0
- package/dist/InfoHelpCard.svelte +93 -0
- package/dist/InfoHelpCard.svelte.d.ts +44 -0
- package/dist/InfoTile.svelte +31 -0
- package/dist/InfoTile.svelte.d.ts +15 -0
- package/dist/InfoVersionCard.svelte +99 -0
- package/dist/InfoVersionCard.svelte.d.ts +29 -0
- package/dist/InstanceCard.svelte +85 -0
- package/dist/InstanceCard.svelte.d.ts +27 -0
- package/dist/Kbd.svelte +16 -0
- package/dist/Kbd.svelte.d.ts +8 -0
- package/dist/ListRow.svelte +51 -0
- package/dist/ListRow.svelte.d.ts +19 -0
- package/dist/ListSelect.svelte +135 -0
- package/dist/ListSelect.svelte.d.ts +25 -0
- package/dist/ListTable.svelte +183 -0
- package/dist/ListTable.svelte.d.ts +44 -0
- package/dist/MarkSvg.svelte +9 -0
- package/dist/MarkSvg.svelte.d.ts +8 -0
- package/dist/Marquee.svelte +63 -0
- package/dist/Marquee.svelte.d.ts +39 -0
- package/dist/MenuBar.svelte +98 -0
- package/dist/MenuBar.svelte.d.ts +19 -0
- package/dist/MenuChoice.svelte +30 -0
- package/dist/MenuChoice.svelte.d.ts +33 -0
- package/dist/MenuHeadEdit.svelte +29 -0
- package/dist/MenuHeadEdit.svelte.d.ts +10 -0
- package/dist/MenuRows.svelte +57 -0
- package/dist/MenuRows.svelte.d.ts +9 -0
- package/dist/MenuSelect.svelte +145 -0
- package/dist/MenuSelect.svelte.d.ts +25 -0
- package/dist/MenuSubmenu.svelte +64 -0
- package/dist/MenuSubmenu.svelte.d.ts +37 -0
- package/dist/Meter.svelte +55 -0
- package/dist/Meter.svelte.d.ts +20 -0
- package/dist/NumberField.svelte +70 -0
- package/dist/NumberField.svelte.d.ts +23 -0
- package/dist/Pagination.svelte +62 -0
- package/dist/Pagination.svelte.d.ts +16 -0
- package/dist/PasswordField.svelte +69 -0
- package/dist/PasswordField.svelte.d.ts +21 -0
- package/dist/PathField.svelte +111 -0
- package/dist/PathField.svelte.d.ts +33 -0
- package/dist/PaypalDialog.svelte +174 -0
- package/dist/PaypalDialog.svelte.d.ts +54 -0
- package/dist/Pill.svelte +25 -0
- package/dist/Pill.svelte.d.ts +14 -0
- package/dist/PinInput.svelte +81 -0
- package/dist/PinInput.svelte.d.ts +23 -0
- package/dist/Popover.svelte +38 -0
- package/dist/Popover.svelte.d.ts +16 -0
- package/dist/PresenceBadges.svelte +22 -0
- package/dist/PresenceBadges.svelte.d.ts +8 -0
- package/dist/ProgressBar.svelte +37 -0
- package/dist/ProgressBar.svelte.d.ts +16 -0
- package/dist/Rating.svelte +65 -0
- package/dist/Rating.svelte.d.ts +18 -0
- package/dist/ReadmeButton.svelte +82 -0
- package/dist/ReadmeButton.svelte.d.ts +27 -0
- package/dist/RowMark.svelte +16 -0
- package/dist/RowMark.svelte.d.ts +7 -0
- package/dist/ScrollArea.svelte +46 -0
- package/dist/ScrollArea.svelte.d.ts +11 -0
- package/dist/Select.svelte +97 -0
- package/dist/Select.svelte.d.ts +67 -0
- package/dist/SelectFace.svelte +18 -0
- package/dist/SelectFace.svelte.d.ts +32 -0
- package/dist/Selector.svelte +264 -0
- package/dist/Selector.svelte.d.ts +77 -0
- package/dist/SelectorSegment.svelte +159 -0
- package/dist/SelectorSegment.svelte.d.ts +27 -0
- package/dist/Sheet.svelte +51 -0
- package/dist/Sheet.svelte.d.ts +23 -0
- package/dist/SidebarRow.svelte +91 -0
- package/dist/SidebarRow.svelte.d.ts +31 -0
- package/dist/SignInCard.svelte +251 -0
- package/dist/SignInCard.svelte.d.ts +34 -0
- package/dist/SignInField.svelte +32 -0
- package/dist/SignInField.svelte.d.ts +11 -0
- package/dist/SignaturePad.svelte +72 -0
- package/dist/SignaturePad.svelte.d.ts +13 -0
- package/dist/SkeletonRow.svelte +29 -0
- package/dist/SkeletonRow.svelte.d.ts +12 -0
- package/dist/Slider.svelte +60 -0
- package/dist/Slider.svelte.d.ts +15 -0
- package/dist/Splitter.svelte +59 -0
- package/dist/Splitter.svelte.d.ts +37 -0
- package/dist/Steps.svelte +90 -0
- package/dist/Steps.svelte.d.ts +40 -0
- package/dist/SubCard.svelte +45 -0
- package/dist/SubCard.svelte.d.ts +14 -0
- package/dist/Table.svelte +48 -0
- package/dist/Table.svelte.d.ts +37 -0
- package/dist/TagsInput.svelte +77 -0
- package/dist/TagsInput.svelte.d.ts +18 -0
- package/dist/TextArea.svelte +55 -0
- package/dist/TextArea.svelte.d.ts +17 -0
- package/dist/TextField.svelte +61 -0
- package/dist/TextField.svelte.d.ts +18 -0
- package/dist/Timer.svelte +62 -0
- package/dist/Timer.svelte.d.ts +17 -0
- package/dist/TipBubble.svelte +11 -0
- package/dist/TipBubble.svelte.d.ts +7 -0
- package/dist/TipWrap.svelte +15 -0
- package/dist/TipWrap.svelte.d.ts +10 -0
- package/dist/ToastCard.svelte +68 -0
- package/dist/ToastCard.svelte.d.ts +18 -0
- package/dist/ToastViewport.svelte +65 -0
- package/dist/ToastViewport.svelte.d.ts +14 -0
- package/dist/Toggle.svelte +84 -0
- package/dist/Toggle.svelte.d.ts +25 -0
- package/dist/Tour.svelte +75 -0
- package/dist/Tour.svelte.d.ts +12 -0
- package/dist/Tree.svelte +122 -0
- package/dist/Tree.svelte.d.ts +22 -0
- package/dist/UnavailableNotice.svelte +36 -0
- package/dist/UnavailableNotice.svelte.d.ts +18 -0
- package/dist/Window.svelte +108 -0
- package/dist/Window.svelte.d.ts +33 -0
- package/dist/WindowBar.svelte +76 -0
- package/dist/WindowBar.svelte.d.ts +26 -0
- package/dist/WindowFootRow.svelte +67 -0
- package/dist/WindowFootRow.svelte.d.ts +28 -0
- package/dist/bubble.svelte.d.ts +15 -0
- package/dist/bubble.svelte.js +66 -0
- package/dist/confirm.svelte.d.ts +37 -0
- package/dist/confirm.svelte.js +62 -0
- package/dist/engines.svelte.d.ts +18 -0
- package/dist/engines.svelte.js +57 -0
- package/dist/entries/accordion.d.ts +1 -0
- package/dist/entries/accordion.js +2 -0
- package/dist/entries/angleslider.d.ts +1 -0
- package/dist/entries/angleslider.js +2 -0
- package/dist/entries/avatar.d.ts +1 -0
- package/dist/entries/avatar.js +2 -0
- package/dist/entries/carousel.d.ts +1 -0
- package/dist/entries/carousel.js +2 -0
- package/dist/entries/collapsible.d.ts +1 -0
- package/dist/entries/collapsible.js +2 -0
- package/dist/entries/combobox.d.ts +1 -0
- package/dist/entries/combobox.js +2 -0
- package/dist/entries/datepicker.d.ts +1 -0
- package/dist/entries/datepicker.js +2 -0
- package/dist/entries/fileupload.d.ts +1 -0
- package/dist/entries/fileupload.js +2 -0
- package/dist/entries/floatingpanel.d.ts +1 -0
- package/dist/entries/floatingpanel.js +2 -0
- package/dist/entries/hovercard.d.ts +1 -0
- package/dist/entries/hovercard.js +2 -0
- package/dist/entries/marquee.d.ts +1 -0
- package/dist/entries/marquee.js +2 -0
- package/dist/entries/pagination.d.ts +1 -0
- package/dist/entries/pagination.js +2 -0
- package/dist/entries/pininput.d.ts +1 -0
- package/dist/entries/pininput.js +2 -0
- package/dist/entries/rating.d.ts +1 -0
- package/dist/entries/rating.js +2 -0
- package/dist/entries/scrollarea.d.ts +1 -0
- package/dist/entries/scrollarea.js +2 -0
- package/dist/entries/select.d.ts +1 -0
- package/dist/entries/select.js +2 -0
- package/dist/entries/signaturepad.d.ts +1 -0
- package/dist/entries/signaturepad.js +2 -0
- package/dist/entries/slider.d.ts +1 -0
- package/dist/entries/slider.js +2 -0
- package/dist/entries/splitter.d.ts +1 -0
- package/dist/entries/splitter.js +2 -0
- package/dist/entries/steps.d.ts +1 -0
- package/dist/entries/steps.js +2 -0
- package/dist/entries/tagsinput.d.ts +1 -0
- package/dist/entries/tagsinput.js +2 -0
- package/dist/entries/timer.d.ts +1 -0
- package/dist/entries/timer.js +2 -0
- package/dist/entries/tour.d.ts +1 -0
- package/dist/entries/tour.js +2 -0
- package/dist/fieldName.d.ts +4 -0
- package/dist/fieldName.js +9 -0
- package/dist/fortressParts.d.ts +5 -0
- package/dist/fortressParts.js +16 -0
- package/dist/glyphs.d.ts +32 -0
- package/dist/glyphs.js +47 -0
- package/dist/index.d.ts +78 -0
- package/dist/index.js +77 -0
- package/dist/lift.d.ts +5 -0
- package/dist/lift.js +9 -0
- package/dist/portalHue.svelte.d.ts +9 -0
- package/dist/portalHue.svelte.js +16 -0
- package/dist/selectParts.svelte.d.ts +39 -0
- package/dist/selectParts.svelte.js +28 -0
- package/dist/selectorItem.d.ts +22 -0
- package/dist/selectorItem.js +1 -0
- package/dist/style.d.ts +5 -0
- package/dist/style.js +12 -0
- package/dist/useDragArmed.svelte.d.ts +6 -0
- package/dist/useDragArmed.svelte.js +24 -0
- package/dist/usePaypalButtons.svelte.d.ts +18 -0
- package/dist/usePaypalButtons.svelte.js +41 -0
- package/package.json +173 -4
package/README.md
CHANGED
|
@@ -1,3 +1,54 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @glimstone/svelte
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The components of [GlimStone](https://junkerderprovinz.github.io/glimstone/) for
|
|
4
|
+
Svelte 5, 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, written with runes.
|
|
7
|
+
|
|
8
|
+
```sh
|
|
9
|
+
npm install @glimstone/core @glimstone/svelte
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
```ts
|
|
13
|
+
import "@glimstone/core/tokens.css";
|
|
14
|
+
import { applyCachedAppearance, applyStoredLabelModes } from "@glimstone/core";
|
|
15
|
+
import { setGlyphResolver } from "@glimstone/svelte";
|
|
16
|
+
|
|
17
|
+
applyCachedAppearance();
|
|
18
|
+
applyStoredLabelModes();
|
|
19
|
+
setGlyphResolver((key) => appGlyph(key));
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
```svelte
|
|
23
|
+
<script lang="ts">
|
|
24
|
+
import { Button, Toggle, useConfirm } from "@glimstone/svelte";
|
|
25
|
+
import { Select } from "@glimstone/svelte/Select";
|
|
26
|
+
|
|
27
|
+
let quiet = $state(true);
|
|
28
|
+
let zone = $state<string | null>("Europe/Vienna");
|
|
29
|
+
const ask = useConfirm({ title: "Confirm", cancel: "Cancel", confirm: "Confirm" });
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<Toggle bind:checked={quiet} label="Quiet notifications" />
|
|
33
|
+
<Select bind:value={zone} label="Time zone" options={zones} />
|
|
34
|
+
<Button label="Delete" labelKey="delete" onClick={() => ask.confirm("Delete the snapshot?")} />
|
|
35
|
+
<ask.confirmDialog />
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
- A value binds with `bind:value`, `bind:checked` or `bind:open`, and the
|
|
39
|
+
component still reports each change through React's callback, such as
|
|
40
|
+
`onChange`.
|
|
41
|
+
- Events are callback props with React's names (`onClick`, `onChange`,
|
|
42
|
+
`onOpenChange`). `class` and attributes such as `id` or `aria-*` go to the
|
|
43
|
+
element.
|
|
44
|
+
- Markup props are snippets, and so are glyphs: `setGlyphResolver` returns one,
|
|
45
|
+
which `createRawSnippet` builds from an SVG string, and `IconClose` and the
|
|
46
|
+
other marks are snippets too.
|
|
47
|
+
- The engines are boxes whose `current` follows the document and writes back
|
|
48
|
+
through the core: `useLabelMode`, `useRainbow`, `useShape`, `useMotion`,
|
|
49
|
+
`useAccent`, `useDensity`, and `useHue` to read a rainbow position.
|
|
50
|
+
- `Select`, `Combobox` and `Slider` come from their own entries and need
|
|
51
|
+
`@zag-js/svelte` with their machine packages (`@zag-js/select` and
|
|
52
|
+
`@zag-js/menu`, `@zag-js/combobox`, `@zag-js/slider`).
|
|
53
|
+
- The package ships its `.svelte` sources, built by `svelte-package`, so the
|
|
54
|
+
app's own Svelte compiles them.
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
3
|
+
|
|
4
|
+
export interface AboutCardProps {
|
|
5
|
+
text: {
|
|
6
|
+
title: string;
|
|
7
|
+
body: string;
|
|
8
|
+
coffee: string;
|
|
9
|
+
coffeeButton: string;
|
|
10
|
+
cryptoButton?: string;
|
|
11
|
+
paypalButton?: string;
|
|
12
|
+
report: string;
|
|
13
|
+
repoButton: string;
|
|
14
|
+
mailButton: string;
|
|
15
|
+
mailSubject: string;
|
|
16
|
+
version: string;
|
|
17
|
+
unreleased: (version: string) => string;
|
|
18
|
+
/** The Help card's heading. Without it the card draws none. */
|
|
19
|
+
helpTitle?: string;
|
|
20
|
+
};
|
|
21
|
+
version: string | null;
|
|
22
|
+
glimstoneVersion: string;
|
|
23
|
+
repoUrl: string;
|
|
24
|
+
repoGlyph?: Snippet;
|
|
25
|
+
glimstoneRepoUrl: string;
|
|
26
|
+
onCoffee: () => void;
|
|
27
|
+
coffeeArt: Snippet;
|
|
28
|
+
cryptoGlyph?: Snippet;
|
|
29
|
+
paypalGlyph?: Snippet;
|
|
30
|
+
onPaypal?: () => void;
|
|
31
|
+
onCrypto?: () => void;
|
|
32
|
+
mailAddress?: string;
|
|
33
|
+
mailGlyph?: Snippet;
|
|
34
|
+
openUrl?: (url: string) => void;
|
|
35
|
+
hueIndex?: number;
|
|
36
|
+
}
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<script lang="ts">
|
|
40
|
+
import { openInBrowser, warnDeprecated, type VersionRow } from "@glimstone/core";
|
|
41
|
+
import InfoTile from "./InfoTile.svelte";
|
|
42
|
+
|
|
43
|
+
// The 3.2.0 props of the single About card, laid out as the Info tile: the
|
|
44
|
+
// About card under `text.title`, the Version card under `text.version` with
|
|
45
|
+
// the app and GlimStone as its rows, and the Help card. Deprecated for
|
|
46
|
+
// InfoTile, which adds the version rows' sub-lines, the other components,
|
|
47
|
+
// "Check for updates" and the bug report.
|
|
48
|
+
let {
|
|
49
|
+
text,
|
|
50
|
+
version,
|
|
51
|
+
glimstoneVersion,
|
|
52
|
+
repoUrl,
|
|
53
|
+
repoGlyph,
|
|
54
|
+
glimstoneRepoUrl,
|
|
55
|
+
onCoffee,
|
|
56
|
+
coffeeArt,
|
|
57
|
+
cryptoGlyph,
|
|
58
|
+
paypalGlyph,
|
|
59
|
+
onPaypal,
|
|
60
|
+
onCrypto,
|
|
61
|
+
mailAddress,
|
|
62
|
+
mailGlyph,
|
|
63
|
+
openUrl = openInBrowser,
|
|
64
|
+
hueIndex,
|
|
65
|
+
}: AboutCardProps = $props();
|
|
66
|
+
warnDeprecated("AboutCard");
|
|
67
|
+
|
|
68
|
+
const rows: VersionRow[] = $derived([
|
|
69
|
+
...(version ? [{ name: text.version, version, repoUrl }] : []),
|
|
70
|
+
{ name: "GlimStone", version: glimstoneVersion, repoUrl: glimstoneRepoUrl },
|
|
71
|
+
]);
|
|
72
|
+
</script>
|
|
73
|
+
|
|
74
|
+
<InfoTile
|
|
75
|
+
data-glim="AboutCard"
|
|
76
|
+
{hueIndex}
|
|
77
|
+
about={{ text, onCoffee, coffeeArt, onPaypal, paypalGlyph, onCrypto, cryptoGlyph }}
|
|
78
|
+
version={{ text: { title: text.version, unreleased: text.unreleased }, rows, openUrl }}
|
|
79
|
+
help={{
|
|
80
|
+
text: { title: text.helpTitle, report: text.report, repoButton: text.repoButton, mailButton: text.mailButton, mailSubject: text.mailSubject },
|
|
81
|
+
repoUrl,
|
|
82
|
+
repoGlyph,
|
|
83
|
+
mailAddress,
|
|
84
|
+
mailGlyph,
|
|
85
|
+
openUrl,
|
|
86
|
+
}}
|
|
87
|
+
/>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
export interface AboutCardProps {
|
|
3
|
+
text: {
|
|
4
|
+
title: string;
|
|
5
|
+
body: string;
|
|
6
|
+
coffee: string;
|
|
7
|
+
coffeeButton: string;
|
|
8
|
+
cryptoButton?: string;
|
|
9
|
+
paypalButton?: string;
|
|
10
|
+
report: string;
|
|
11
|
+
repoButton: string;
|
|
12
|
+
mailButton: string;
|
|
13
|
+
mailSubject: string;
|
|
14
|
+
version: string;
|
|
15
|
+
unreleased: (version: string) => string;
|
|
16
|
+
/** The Help card's heading. Without it the card draws none. */
|
|
17
|
+
helpTitle?: string;
|
|
18
|
+
};
|
|
19
|
+
version: string | null;
|
|
20
|
+
glimstoneVersion: string;
|
|
21
|
+
repoUrl: string;
|
|
22
|
+
repoGlyph?: Snippet;
|
|
23
|
+
glimstoneRepoUrl: string;
|
|
24
|
+
onCoffee: () => void;
|
|
25
|
+
coffeeArt: Snippet;
|
|
26
|
+
cryptoGlyph?: Snippet;
|
|
27
|
+
paypalGlyph?: Snippet;
|
|
28
|
+
onPaypal?: () => void;
|
|
29
|
+
onCrypto?: () => void;
|
|
30
|
+
mailAddress?: string;
|
|
31
|
+
mailGlyph?: Snippet;
|
|
32
|
+
openUrl?: (url: string) => void;
|
|
33
|
+
hueIndex?: number;
|
|
34
|
+
}
|
|
35
|
+
declare const AboutCard: import("svelte").Component<AboutCardProps, {}, "">;
|
|
36
|
+
type AboutCard = ReturnType<typeof AboutCard>;
|
|
37
|
+
export default AboutCard;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
3
|
+
import type { AccordionItem, HeadingLevel } from "@glimstone/core";
|
|
4
|
+
|
|
5
|
+
export type { AccordionItem, HeadingLevel } from "@glimstone/core";
|
|
6
|
+
|
|
7
|
+
export interface AccordionProps<T extends AccordionItem> {
|
|
8
|
+
items: readonly T[];
|
|
9
|
+
/** The values of the open items, bound with `bind:value`. Left out, it keeps its own state. */
|
|
10
|
+
value?: string[];
|
|
11
|
+
onChange?: (value: string[]) => void;
|
|
12
|
+
/** Several items open at once; otherwise opening one closes the other. */
|
|
13
|
+
multiple?: boolean;
|
|
14
|
+
headingLevel?: HeadingLevel;
|
|
15
|
+
/** Draws the text under an item's row. */
|
|
16
|
+
content: Snippet<[T]>;
|
|
17
|
+
}
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<script lang="ts" generics="T extends AccordionItem">
|
|
21
|
+
import * as accordion from "@zag-js/accordion";
|
|
22
|
+
import { normalizeProps, useMachine } from "@zag-js/svelte";
|
|
23
|
+
import { pageDir } from "@glimstone/core";
|
|
24
|
+
import { IconExpand } from "./glyphs.js";
|
|
25
|
+
|
|
26
|
+
// A list of rows that each open their own text, for reading matter such as the
|
|
27
|
+
// questions of a help page. Rule 26 keeps it off settings pages. Each row is a
|
|
28
|
+
// heading with a button in it, so a screen reader can walk the questions.
|
|
29
|
+
let { items, value = $bindable(), onChange, multiple = false, headingLevel = 3, content }: AccordionProps<T> = $props();
|
|
30
|
+
|
|
31
|
+
const id = $props.id();
|
|
32
|
+
const service = useMachine(accordion.machine, () => ({
|
|
33
|
+
id,
|
|
34
|
+
dir: pageDir(),
|
|
35
|
+
value: value ?? [],
|
|
36
|
+
multiple,
|
|
37
|
+
collapsible: true,
|
|
38
|
+
onValueChange: (d: { value: string[] }) => {
|
|
39
|
+
value = d.value;
|
|
40
|
+
onChange?.(d.value);
|
|
41
|
+
},
|
|
42
|
+
}));
|
|
43
|
+
const api = $derived(accordion.connect(service, normalizeProps));
|
|
44
|
+
</script>
|
|
45
|
+
|
|
46
|
+
<div data-glim="Accordion" {...api.getRootProps()} class="glim-accordion">
|
|
47
|
+
{#each items as item (item.value)}
|
|
48
|
+
<div {...api.getItemProps(item)} class="glim-accordion-item">
|
|
49
|
+
<svelte:element this={`h${headingLevel}`} class="glim-disclosure-heading">
|
|
50
|
+
<button {...api.getItemTriggerProps(item)} class="glim-disclosure-trigger">
|
|
51
|
+
<span class="glim-disclosure-label">{item.title}</span>
|
|
52
|
+
<span {...api.getItemIndicatorProps(item)} class="glim-disclosure-indicator">{@render IconExpand()}</span>
|
|
53
|
+
</button>
|
|
54
|
+
</svelte:element>
|
|
55
|
+
<div {...api.getItemContentProps(item)} class="glim-disclosure-content">
|
|
56
|
+
<div class="glim-disclosure-body">{@render content(item)}</div>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
{/each}
|
|
60
|
+
</div>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
import type { AccordionItem, 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, bound with `bind:value`. 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: Snippet<[T]>;
|
|
14
|
+
}
|
|
15
|
+
declare function $$render<T extends AccordionItem>(): {
|
|
16
|
+
props: AccordionProps<T>;
|
|
17
|
+
exports: {};
|
|
18
|
+
bindings: "value";
|
|
19
|
+
slots: {};
|
|
20
|
+
events: {};
|
|
21
|
+
};
|
|
22
|
+
declare class __sveltets_Render<T extends AccordionItem> {
|
|
23
|
+
props(): ReturnType<typeof $$render<T>>['props'];
|
|
24
|
+
events(): ReturnType<typeof $$render<T>>['events'];
|
|
25
|
+
slots(): ReturnType<typeof $$render<T>>['slots'];
|
|
26
|
+
bindings(): "value";
|
|
27
|
+
exports(): {};
|
|
28
|
+
}
|
|
29
|
+
interface $$IsomorphicComponent {
|
|
30
|
+
new <T extends AccordionItem>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<T>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<T>['props']>, ReturnType<__sveltets_Render<T>['events']>, ReturnType<__sveltets_Render<T>['slots']>> & {
|
|
31
|
+
$$bindings?: ReturnType<__sveltets_Render<T>['bindings']>;
|
|
32
|
+
} & ReturnType<__sveltets_Render<T>['exports']>;
|
|
33
|
+
<T extends AccordionItem>(internal: unknown, props: ReturnType<__sveltets_Render<T>['props']> & {}): ReturnType<__sveltets_Render<T>['exports']>;
|
|
34
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
35
|
+
}
|
|
36
|
+
declare const Accordion: $$IsomorphicComponent;
|
|
37
|
+
type Accordion<T extends AccordionItem> = InstanceType<typeof Accordion<T>>;
|
|
38
|
+
export default Accordion;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
export interface AngleSliderProps {
|
|
3
|
+
label?: string;
|
|
4
|
+
/** The angle, bound with `bind:value`. */
|
|
5
|
+
value: number;
|
|
6
|
+
onChange?: (value: number) => void;
|
|
7
|
+
step?: number;
|
|
8
|
+
/** The angles that carry a tick on the dial. */
|
|
9
|
+
marks?: number[];
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
}
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<script lang="ts">
|
|
15
|
+
import * as angleSlider from "@zag-js/angle-slider";
|
|
16
|
+
import { normalizeProps, useMachine } from "@zag-js/svelte";
|
|
17
|
+
import { pageDir } from "@glimstone/core";
|
|
18
|
+
import { useFieldName } from "./fieldName.js";
|
|
19
|
+
|
|
20
|
+
// An angle set on a dial, such as how far a picture turns. The dial is round
|
|
21
|
+
// whatever the shape setting, since a circle is its geometry and not a corner,
|
|
22
|
+
// and the value stands beside it in degrees, left to right in every language.
|
|
23
|
+
// Inside a FieldRow the row names it.
|
|
24
|
+
let { label, value = $bindable(), onChange, step = 1, marks = [0, 90, 180, 270], disabled = false }: AngleSliderProps = $props();
|
|
25
|
+
|
|
26
|
+
const name = useFieldName(() => label);
|
|
27
|
+
const id = $props.id();
|
|
28
|
+
const service = useMachine(angleSlider.machine, () => ({
|
|
29
|
+
id,
|
|
30
|
+
dir: pageDir(),
|
|
31
|
+
value,
|
|
32
|
+
step,
|
|
33
|
+
disabled,
|
|
34
|
+
onValueChange: (d: { value: number }) => {
|
|
35
|
+
value = d.value;
|
|
36
|
+
onChange?.(d.value);
|
|
37
|
+
},
|
|
38
|
+
}));
|
|
39
|
+
const api = $derived(angleSlider.connect(service, normalizeProps));
|
|
40
|
+
</script>
|
|
41
|
+
|
|
42
|
+
<div data-glim="AngleSlider" {...api.getRootProps()} class="glim-angle">
|
|
43
|
+
<label {...api.getLabelProps()} class={label === undefined ? "glim-sr-only" : "glim-field-label"}>{name()}</label>
|
|
44
|
+
<div class="glim-angle-body">
|
|
45
|
+
<div {...api.getControlProps()} class="glim-angle-dial">
|
|
46
|
+
<div {...api.getMarkerGroupProps()} class="glim-angle-marks">
|
|
47
|
+
{#each marks as mark (mark)}
|
|
48
|
+
<span {...api.getMarkerProps({ value: mark })} class="glim-angle-mark"></span>
|
|
49
|
+
{/each}
|
|
50
|
+
</div>
|
|
51
|
+
<div {...api.getThumbProps()} aria-valuetext={`${api.value}°`} class="glim-angle-thumb"></div>
|
|
52
|
+
</div>
|
|
53
|
+
<div {...api.getValueTextProps()} class="glim-angle-value glim-num">{`${api.value}°`}</div>
|
|
54
|
+
</div>
|
|
55
|
+
<input {...api.getHiddenInputProps()} />
|
|
56
|
+
</div>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface AngleSliderProps {
|
|
2
|
+
label?: string;
|
|
3
|
+
/** The angle, bound with `bind:value`. */
|
|
4
|
+
value: number;
|
|
5
|
+
onChange?: (value: number) => void;
|
|
6
|
+
step?: number;
|
|
7
|
+
/** The angles that carry a tick on the dial. */
|
|
8
|
+
marks?: number[];
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
}
|
|
11
|
+
declare const AngleSlider: import("svelte").Component<AngleSliderProps, {}, "value">;
|
|
12
|
+
type AngleSlider = ReturnType<typeof AngleSlider>;
|
|
13
|
+
export default AngleSlider;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { AvatarSize } from "@glimstone/core";
|
|
3
|
+
|
|
4
|
+
export type { AvatarSize } from "@glimstone/core";
|
|
5
|
+
|
|
6
|
+
export interface AvatarProps {
|
|
7
|
+
/** The person's name: the accessible name, and where the initials come from. */
|
|
8
|
+
name: string;
|
|
9
|
+
src?: string;
|
|
10
|
+
size?: AvatarSize;
|
|
11
|
+
/** A palette position, for a list of people whose circles each take a hue under rainbow. */
|
|
12
|
+
hueIndex?: number;
|
|
13
|
+
}
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<script lang="ts">
|
|
17
|
+
import * as avatar from "@zag-js/avatar";
|
|
18
|
+
import { normalizeProps, useMachine } from "@zag-js/svelte";
|
|
19
|
+
import { avatarView, initials, pageDir } from "@glimstone/core";
|
|
20
|
+
import { css } from "./style.js";
|
|
21
|
+
|
|
22
|
+
// A person's picture, and their initials while it loads, when it fails or when
|
|
23
|
+
// there is none. The name is what a screen reader hears either way.
|
|
24
|
+
let { name, src, size = "md", hueIndex }: AvatarProps = $props();
|
|
25
|
+
|
|
26
|
+
const id = $props.id();
|
|
27
|
+
const service = useMachine(avatar.machine, () => ({ id, dir: pageDir() }));
|
|
28
|
+
const api = $derived(avatar.connect(service, normalizeProps));
|
|
29
|
+
const view = $derived(avatarView({ size, hueIndex }));
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<span data-glim="Avatar" {...api.getRootProps()} role="img" aria-label={name} class={view.className} style={css(view.style)}>
|
|
33
|
+
{#if src}
|
|
34
|
+
<img {...api.getImageProps()} {src} alt="" class="glim-avatar-image" />
|
|
35
|
+
{/if}
|
|
36
|
+
<span {...api.getFallbackProps()} aria-hidden="true" class="glim-avatar-fallback">{initials(name)}</span>
|
|
37
|
+
</span>
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
declare const Avatar: import("svelte").Component<AvatarProps, {}, "">;
|
|
12
|
+
type Avatar = ReturnType<typeof Avatar>;
|
|
13
|
+
export default Avatar;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
3
|
+
import type { BadgeForm, BadgeShape, BadgeSize, BadgeTone, NotchInset } from "@glimstone/core";
|
|
4
|
+
|
|
5
|
+
export type { BadgeForm, BadgeShape, BadgeSize, BadgeTone, NotchInset } from "@glimstone/core";
|
|
6
|
+
|
|
7
|
+
export interface BadgeProps {
|
|
8
|
+
children: Snippet;
|
|
9
|
+
/** Status colour. Defaults to the neutral chip. */
|
|
10
|
+
tone?: BadgeTone;
|
|
11
|
+
/** Size stage; see badgeClassName in the core. A square icon-only badge is always
|
|
12
|
+
* `"icon"`. */
|
|
13
|
+
size?: BadgeSize;
|
|
14
|
+
/** The corners: rounded, square, pill or circle. Without it they follow the
|
|
15
|
+
* shape setting. */
|
|
16
|
+
form?: BadgeForm;
|
|
17
|
+
/** @deprecated Use `form`. Only "circle" has an effect: it makes the badge
|
|
18
|
+
* icon-only. */
|
|
19
|
+
shape?: BadgeShape;
|
|
20
|
+
/** Render as a <button> or a real <a href>, with the same box as a span. */
|
|
21
|
+
as?: "span" | "button" | "a";
|
|
22
|
+
onClick?: () => void;
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
title?: string;
|
|
25
|
+
/** Accessible name for an icon-only badge whose glyph is aria-hidden. */
|
|
26
|
+
ariaLabel?: string;
|
|
27
|
+
/** `as="a"` only: passed straight through to the underlying <a>. */
|
|
28
|
+
href?: string;
|
|
29
|
+
target?: string;
|
|
30
|
+
rel?: string;
|
|
31
|
+
/** Let content that wraps grow the box instead of overflowing it. */
|
|
32
|
+
wrap?: boolean;
|
|
33
|
+
/** Extra classes, such as `tabular-nums` for a count, or `max-w-full` with
|
|
34
|
+
* `wrap` in a narrow column. */
|
|
35
|
+
class?: string;
|
|
36
|
+
/** Rainbow position, by the caller's list index among the badges visible at
|
|
37
|
+
* once. Only `heading` and `active` take it, since the other tones are
|
|
38
|
+
* status signals. Omit it for the only such badge on a page, which keeps
|
|
39
|
+
* the single accent. */
|
|
40
|
+
hueIndex?: number;
|
|
41
|
+
/** `as="button"` only. The tooltip and accessible name of an icon-only
|
|
42
|
+
* button, rendered through IconTipButton; it also makes the badge
|
|
43
|
+
* icon-only for sizing, and replaces `title` and `ariaLabel`. */
|
|
44
|
+
tip?: string;
|
|
45
|
+
/** Heading notch only: the card's content padding in quarter-rem steps
|
|
46
|
+
* (`insetStart={5}` for 1.25rem), for the two cases NotchInset describes.
|
|
47
|
+
* Omit it where the static position already lands right. */
|
|
48
|
+
insetStart?: NotchInset;
|
|
49
|
+
/** Heading notch only: keep the notch's look without positioning it, for
|
|
50
|
+
* several heading badges that straddle one card edge together inside a
|
|
51
|
+
* caller-positioned <h2>. `insetStart` is ignored alongside it. A heading
|
|
52
|
+
* badge in normal flow is a `tone="heading"` badge at another size. */
|
|
53
|
+
inFlow?: boolean;
|
|
54
|
+
}
|
|
55
|
+
</script>
|
|
56
|
+
|
|
57
|
+
<script lang="ts">
|
|
58
|
+
import { badgeClassName, hueVars } from "@glimstone/core";
|
|
59
|
+
import { css } from "./style.js";
|
|
60
|
+
import IconTipButton from "./IconTipButton.svelte";
|
|
61
|
+
|
|
62
|
+
// The shared status chip; sizes, tones and the heading notch are described in
|
|
63
|
+
// badgeClassName() in the core.
|
|
64
|
+
//
|
|
65
|
+
// `as="button"` and `as="a"` resolve to the same box as a span at the same
|
|
66
|
+
// stage. `as="a"` is a real anchor, so copying the link and opening it in a new
|
|
67
|
+
// tab work. A numbered heading is two badges, never one split pill: `inFlow`
|
|
68
|
+
// keeps the notch's look but drops its positioning, so the caller positions
|
|
69
|
+
// its <h2> and lays the badges out side by side.
|
|
70
|
+
let {
|
|
71
|
+
children,
|
|
72
|
+
tone = "neutral",
|
|
73
|
+
size = "medium",
|
|
74
|
+
form,
|
|
75
|
+
shape,
|
|
76
|
+
as = "span",
|
|
77
|
+
onClick,
|
|
78
|
+
disabled,
|
|
79
|
+
title,
|
|
80
|
+
ariaLabel,
|
|
81
|
+
href,
|
|
82
|
+
target,
|
|
83
|
+
rel,
|
|
84
|
+
wrap,
|
|
85
|
+
class: className,
|
|
86
|
+
hueIndex,
|
|
87
|
+
tip,
|
|
88
|
+
insetStart,
|
|
89
|
+
inFlow,
|
|
90
|
+
}: BadgeProps = $props();
|
|
91
|
+
|
|
92
|
+
// Rainbow never colours text: --accent-ink is not redefined under .glim-hue,
|
|
93
|
+
// so a hued active badge's text keeps the single accent's ink while its
|
|
94
|
+
// background follows the hue.
|
|
95
|
+
const hueOn = $derived(hueIndex !== undefined && (tone === "heading" || tone === "active"));
|
|
96
|
+
const classes = $derived(
|
|
97
|
+
[
|
|
98
|
+
hueOn && "glim-hue",
|
|
99
|
+
// `.glim-notch-hue` drives the card-wide reactive hover in tokens.css, so
|
|
100
|
+
// it is only set on a heading-sized badge.
|
|
101
|
+
hueOn && size === "heading" && "glim-notch-hue",
|
|
102
|
+
badgeClassName({ tone, size, form, shape, wrap, iconOnly: tip !== undefined, inFlow, insetStart, action: as !== "span" }),
|
|
103
|
+
className,
|
|
104
|
+
]
|
|
105
|
+
.filter(Boolean)
|
|
106
|
+
.join(" "),
|
|
107
|
+
);
|
|
108
|
+
const hueStyle = $derived(hueOn ? css(hueVars(hueIndex!)) : undefined);
|
|
109
|
+
</script>
|
|
110
|
+
|
|
111
|
+
{#if as === "button" && tip !== undefined}
|
|
112
|
+
<IconTipButton data-glim="Badge" {tip} onclick={() => onClick?.()} {disabled} style={hueStyle} class={classes}>{@render children()}</IconTipButton>
|
|
113
|
+
{:else if as === "button"}
|
|
114
|
+
<button data-glim="Badge" type="button" onclick={() => onClick?.()} {disabled} {title} aria-label={ariaLabel} style={hueStyle} class={classes}>{@render children()}</button>
|
|
115
|
+
{:else if as === "a"}
|
|
116
|
+
<a data-glim="Badge" {href} {target} {rel} {title} aria-label={ariaLabel} style={hueStyle} class={classes}>{@render children()}</a>
|
|
117
|
+
{:else}
|
|
118
|
+
<span data-glim="Badge" {title} role={ariaLabel ? "img" : undefined} aria-label={ariaLabel} style={hueStyle} class={classes}>{@render children()}</span>
|
|
119
|
+
{/if}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
import type { BadgeForm, BadgeShape, BadgeSize, BadgeTone, NotchInset } from "@glimstone/core";
|
|
3
|
+
export type { BadgeForm, BadgeShape, BadgeSize, BadgeTone, NotchInset } from "@glimstone/core";
|
|
4
|
+
export interface BadgeProps {
|
|
5
|
+
children: Snippet;
|
|
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
|
+
declare const Badge: import("svelte").Component<BadgeProps, {}, "">;
|
|
53
|
+
type Badge = ReturnType<typeof Badge>;
|
|
54
|
+
export default Badge;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
export interface BrandMarkProps {
|
|
3
|
+
svg: string;
|
|
4
|
+
}
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<script lang="ts">
|
|
8
|
+
// A vendor mark kept as its own markup, from appMarks.ts.
|
|
9
|
+
let { svg }: BrandMarkProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<span data-glim="BrandMark" class="glim-brand-svg" aria-hidden="true">{@html svg}</span>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { BusyRingSize } from "@glimstone/core";
|
|
3
|
+
|
|
4
|
+
export type { BusyRingSize } from "@glimstone/core";
|
|
5
|
+
|
|
6
|
+
export interface BusyRingProps {
|
|
7
|
+
/** `small` fits a button's glyph slot, `large` a card that waits. */
|
|
8
|
+
size?: BusyRingSize;
|
|
9
|
+
/** What is being waited for. With it the ring is a status that says so, without
|
|
10
|
+
* it the ring is hidden from assistive technology and its surroundings speak. */
|
|
11
|
+
label?: string;
|
|
12
|
+
/** Milliseconds before it shows; 0 shows it at once. */
|
|
13
|
+
delay?: number;
|
|
14
|
+
class?: string;
|
|
15
|
+
}
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<script lang="ts">
|
|
19
|
+
import { busyRingView } from "@glimstone/core";
|
|
20
|
+
import { css } from "./style.js";
|
|
21
|
+
|
|
22
|
+
// The ring that turns while the app works on something: two arcs turning
|
|
23
|
+
// against each other. It shows only after BUSY_DELAY, so a quick answer never
|
|
24
|
+
// flashes it.
|
|
25
|
+
let { size, label, delay, class: className }: BusyRingProps = $props();
|
|
26
|
+
const view = $derived(busyRingView({ size, delay }));
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<span
|
|
30
|
+
data-glim="BusyRing"
|
|
31
|
+
role={label ? "status" : undefined}
|
|
32
|
+
aria-hidden={label ? undefined : true}
|
|
33
|
+
class={className ? `${view.className} ${className}` : view.className}
|
|
34
|
+
style={css(view.style)}
|
|
35
|
+
>
|
|
36
|
+
<span class="glim-busy-ring-arc"><span class="glim-busy-ring-tail"></span></span>
|
|
37
|
+
<span class="glim-busy-ring-arc glim-busy-ring-arc--inner"><span class="glim-busy-ring-tail"></span></span>
|
|
38
|
+
{#if label}<span class="glim-sr-only">{label}</span>{/if}
|
|
39
|
+
</span>
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
declare const BusyRing: import("svelte").Component<BusyRingProps, {}, "">;
|
|
14
|
+
type BusyRing = ReturnType<typeof BusyRing>;
|
|
15
|
+
export default BusyRing;
|