@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
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
3
|
+
|
|
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: Snippet;
|
|
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?: Snippet;
|
|
29
|
+
/** Opens the crypto window (CryptoDonateDialog). Omit it and the card offers
|
|
30
|
+
* no crypto button. */
|
|
31
|
+
onCrypto?: () => void;
|
|
32
|
+
cryptoGlyph?: Snippet;
|
|
33
|
+
hueIndex?: number;
|
|
34
|
+
}
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<script lang="ts">
|
|
38
|
+
import Card from "./Card.svelte";
|
|
39
|
+
import ReadmeButton from "./ReadmeButton.svelte";
|
|
40
|
+
|
|
41
|
+
// The last card of the Info tile: who made the app, then the give row.
|
|
42
|
+
let { text, onCoffee, coffeeArt, onPaypal, paypalGlyph, onCrypto, cryptoGlyph, hueIndex }: InfoAboutCardProps = $props();
|
|
43
|
+
</script>
|
|
44
|
+
|
|
45
|
+
<Card data-glim="InfoAboutCard" title={text.title} {hueIndex}>
|
|
46
|
+
<!-- No reading-width cap: a reading width belongs to a whole page, and a
|
|
47
|
+
cap on this card alone reads as hand-set line breaks. -->
|
|
48
|
+
<p class="glim-info-text">{text.body}</p>
|
|
49
|
+
|
|
50
|
+
<p class="glim-info-text">{text.coffee}</p>
|
|
51
|
+
<!-- The hosted payment routes first and the wallet, which needs no account,
|
|
52
|
+
last. One line per button, as on the README, so nothing moves up under
|
|
53
|
+
the pointer. -->
|
|
54
|
+
<div class="glim-readme-btn-rows glim-about-give">
|
|
55
|
+
<ReadmeButton brand="coffee" parts={[{ name: text.coffeeButton, onClick: onCoffee }]} art={coffeeArt} />
|
|
56
|
+
{#if onPaypal && text.paypalButton}
|
|
57
|
+
<ReadmeButton brand="paypal" parts={[{ name: text.paypalButton, onClick: onPaypal }]} mark={paypalGlyph} markClass="glim-paypal-mark" />
|
|
58
|
+
{/if}
|
|
59
|
+
<!-- The bare letterform without its disc: at button size a disc reads as
|
|
60
|
+
an orange dot. The coin tiles in the donation window keep it. -->
|
|
61
|
+
{#if onCrypto && text.cryptoButton}
|
|
62
|
+
<ReadmeButton brand="bitcoin" parts={[{ name: text.cryptoButton, onClick: onCrypto }]} mark={cryptoGlyph} markClass="glim-bitcoin-mark" />
|
|
63
|
+
{/if}
|
|
64
|
+
</div>
|
|
65
|
+
</Card>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
export interface InfoAboutCardProps {
|
|
3
|
+
text: {
|
|
4
|
+
title: string;
|
|
5
|
+
body: string;
|
|
6
|
+
coffee: string;
|
|
7
|
+
/** The coffee button's accessible name; its artwork carries the words. */
|
|
8
|
+
coffeeButton: string;
|
|
9
|
+
/** The second give button. Only drawn together with `onPaypal`. */
|
|
10
|
+
paypalButton?: string;
|
|
11
|
+
/** The third. Only drawn together with `onCrypto`. */
|
|
12
|
+
cryptoButton?: string;
|
|
13
|
+
};
|
|
14
|
+
/** Opens the coffee window (CoffeeDialog), which stays inside the app. */
|
|
15
|
+
onCoffee: () => void;
|
|
16
|
+
/** Buy Me a Coffee's own button artwork, `COFFEE_BUTTON_SVG` from appMarks.ts. */
|
|
17
|
+
coffeeArt: Snippet;
|
|
18
|
+
/** Opens the PayPal window (PaypalDialog). Omit it where the maker takes no
|
|
19
|
+
* PayPal donations. */
|
|
20
|
+
onPaypal?: () => void;
|
|
21
|
+
/**
|
|
22
|
+
* The marks on the other give buttons. They are passed rather than resolved
|
|
23
|
+
* by label key, because a rule keyed on "crypto" would put a currency's
|
|
24
|
+
* symbol on settings that have nothing to do with it.
|
|
25
|
+
*/
|
|
26
|
+
paypalGlyph?: Snippet;
|
|
27
|
+
/** Opens the crypto window (CryptoDonateDialog). Omit it and the card offers
|
|
28
|
+
* no crypto button. */
|
|
29
|
+
onCrypto?: () => void;
|
|
30
|
+
cryptoGlyph?: Snippet;
|
|
31
|
+
hueIndex?: number;
|
|
32
|
+
}
|
|
33
|
+
declare const InfoAboutCard: import("svelte").Component<InfoAboutCardProps, {}, "">;
|
|
34
|
+
type InfoAboutCard = ReturnType<typeof InfoAboutCard>;
|
|
35
|
+
export default InfoAboutCard;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
export interface InfoBubbleProps {
|
|
3
|
+
tip: string;
|
|
4
|
+
onAccent?: boolean;
|
|
5
|
+
}
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
import { useTipBubble } from "./bubble.svelte.js";
|
|
10
|
+
import TipBubble from "./TipBubble.svelte";
|
|
11
|
+
|
|
12
|
+
// A neutral (i) icon beside a label that reveals a short help text on hover and
|
|
13
|
+
// keyboard focus. Explanations live here rather than as a permanent grey
|
|
14
|
+
// paragraph under the control. The icon never takes the accent colour, which
|
|
15
|
+
// means "active"; the bubble itself comes from useTipBubble.
|
|
16
|
+
//
|
|
17
|
+
// `onAccent` is for an icon inside a filled accent badge such as a card heading:
|
|
18
|
+
// it inherits the badge's --accent-contrast ink and drops the idle opacity, which
|
|
19
|
+
// has less margin on a busy fill.
|
|
20
|
+
let { tip, onAccent = false }: InfoBubbleProps = $props();
|
|
21
|
+
|
|
22
|
+
const tooltip = useTipBubble(() => tip);
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<!-- Inside a <label>, a click on a span is forwarded to the label's field,
|
|
26
|
+
which takes focus and closes the bubble at once. stopPropagation does not
|
|
27
|
+
stop the native forwarding; preventDefault does, and the span keeps the
|
|
28
|
+
focus it took on mousedown. -->
|
|
29
|
+
<!-- svelte-ignore a11y_no_noninteractive_tabindex, a11y_click_events_have_key_events, a11y_no_noninteractive_element_interactions -->
|
|
30
|
+
<span
|
|
31
|
+
data-glim="InfoBubble"
|
|
32
|
+
bind:this={tooltip.trigger}
|
|
33
|
+
role="img"
|
|
34
|
+
aria-label={tip}
|
|
35
|
+
aria-describedby={tooltip.describedBy}
|
|
36
|
+
tabindex={0}
|
|
37
|
+
onmouseenter={tooltip.show}
|
|
38
|
+
onmouseleave={tooltip.hide}
|
|
39
|
+
onfocus={tooltip.showOnFocus}
|
|
40
|
+
onblur={tooltip.hide}
|
|
41
|
+
onclick={(e) => e.preventDefault()}
|
|
42
|
+
class={onAccent ? "glim-info-icon glim-info-icon--on-accent" : "glim-info-icon"}
|
|
43
|
+
>
|
|
44
|
+
<svg viewBox="0 0 16 16" width="15" height="15" fill="none" aria-hidden="true">
|
|
45
|
+
<circle cx="8" cy="8" r="7" stroke="currentColor" stroke-width="1.3" />
|
|
46
|
+
<circle cx="8" cy="4.6" r="0.9" fill="currentColor" />
|
|
47
|
+
<path d="M8 7v4.4" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" />
|
|
48
|
+
</svg>
|
|
49
|
+
</span>
|
|
50
|
+
<TipBubble state={tooltip} />
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
3
|
+
import type { OpenUrl } from "@glimstone/core";
|
|
4
|
+
|
|
5
|
+
export interface InfoHelpCardProps {
|
|
6
|
+
text: {
|
|
7
|
+
title?: string;
|
|
8
|
+
/** The card's "(i)", such as what the bug report holds. */
|
|
9
|
+
hint?: string;
|
|
10
|
+
report: string;
|
|
11
|
+
repoButton: string;
|
|
12
|
+
mailButton: string;
|
|
13
|
+
mailSubject: string;
|
|
14
|
+
/** "Bug report". Only drawn together with `onBugReport`. */
|
|
15
|
+
bugReport?: string;
|
|
16
|
+
/** The bug report's second line, "Download". */
|
|
17
|
+
bugReportSub?: string;
|
|
18
|
+
/** "Manual". Only drawn together with `manualUrl`. */
|
|
19
|
+
manual?: string;
|
|
20
|
+
/** The manual's second line, "Open". */
|
|
21
|
+
manualSub?: string;
|
|
22
|
+
};
|
|
23
|
+
repoUrl: string;
|
|
24
|
+
/** The mark on the repository button, passed for the same reason as the
|
|
25
|
+
* give buttons' marks. */
|
|
26
|
+
repoGlyph?: Snippet;
|
|
27
|
+
/** The workshop's own mailbox. Omit it and the card offers no mail route. */
|
|
28
|
+
mailAddress?: string;
|
|
29
|
+
/** The envelope, `MAIL_SVG` from appMarks.ts, which opens under the pointer. */
|
|
30
|
+
mailGlyph?: Snippet;
|
|
31
|
+
/** The app's handbook. Omit it where the app has none; the README is not a
|
|
32
|
+
* manual. */
|
|
33
|
+
manualUrl?: string;
|
|
34
|
+
/** The book, `MANUAL_SVG` from appMarks.ts, which opens under the pointer. */
|
|
35
|
+
manualGlyph?: Snippet;
|
|
36
|
+
/** Downloads the instance's logs and settings as one file, without
|
|
37
|
+
* passwords, keys or credentials. */
|
|
38
|
+
onBugReport?: () => void;
|
|
39
|
+
/** `IconDiagnostics`, the bug. */
|
|
40
|
+
bugGlyph?: Snippet;
|
|
41
|
+
openUrl?: OpenUrl;
|
|
42
|
+
hueIndex?: number;
|
|
43
|
+
}
|
|
44
|
+
</script>
|
|
45
|
+
|
|
46
|
+
<script lang="ts">
|
|
47
|
+
import { mailHref, offersMail, openInBrowser } from "@glimstone/core";
|
|
48
|
+
import Card from "./Card.svelte";
|
|
49
|
+
import ReadmeButton from "./ReadmeButton.svelte";
|
|
50
|
+
|
|
51
|
+
// The second card of the Info tile: a sentence inviting a report, then
|
|
52
|
+
// GitHub, Email, the manual and the bug report.
|
|
53
|
+
let {
|
|
54
|
+
text,
|
|
55
|
+
repoUrl,
|
|
56
|
+
repoGlyph,
|
|
57
|
+
mailAddress,
|
|
58
|
+
mailGlyph,
|
|
59
|
+
manualUrl,
|
|
60
|
+
manualGlyph,
|
|
61
|
+
onBugReport,
|
|
62
|
+
bugGlyph,
|
|
63
|
+
openUrl = openInBrowser,
|
|
64
|
+
hueIndex,
|
|
65
|
+
}: InfoHelpCardProps = $props();
|
|
66
|
+
|
|
67
|
+
const wantsMail = $derived(offersMail(text.report, mailAddress));
|
|
68
|
+
</script>
|
|
69
|
+
|
|
70
|
+
<Card data-glim="InfoHelpCard" title={text.title} hint={text.hint} {hueIndex}>
|
|
71
|
+
<p class="glim-info-text">{text.report}</p>
|
|
72
|
+
<div class="glim-readme-btn-rows">
|
|
73
|
+
<ReadmeButton brand="github" parts={[{ name: text.repoButton, onClick: () => openUrl(repoUrl) }]} mark={repoGlyph} markClass="glim-github-mark" />
|
|
74
|
+
<!-- This button reaches the app's own authors rather than a third party,
|
|
75
|
+
so it follows the user's accent and rainbow. -->
|
|
76
|
+
{#if wantsMail}
|
|
77
|
+
<ReadmeButton
|
|
78
|
+
brand="house"
|
|
79
|
+
parts={[{ name: text.mailButton, onClick: () => openUrl(mailHref(mailAddress!, text.mailSubject)) }]}
|
|
80
|
+
mark={mailGlyph}
|
|
81
|
+
markClass="glim-house-mark"
|
|
82
|
+
/>
|
|
83
|
+
{/if}
|
|
84
|
+
<!-- The README's docs button, its book and its yellow. -->
|
|
85
|
+
{#if manualUrl && text.manual}
|
|
86
|
+
<ReadmeButton brand="docs" parts={[{ name: text.manual, sub: text.manualSub, onClick: () => openUrl(manualUrl) }]} mark={manualGlyph} markClass="glim-docs-mark" />
|
|
87
|
+
{/if}
|
|
88
|
+
<!-- The file goes with an issue on GitHub, so it lights up beside it. -->
|
|
89
|
+
{#if onBugReport && text.bugReport}
|
|
90
|
+
<ReadmeButton brand="github" parts={[{ name: text.bugReport, sub: text.bugReportSub, onClick: onBugReport }]} mark={bugGlyph} />
|
|
91
|
+
{/if}
|
|
92
|
+
</div>
|
|
93
|
+
</Card>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
import type { OpenUrl } from "@glimstone/core";
|
|
3
|
+
export interface InfoHelpCardProps {
|
|
4
|
+
text: {
|
|
5
|
+
title?: string;
|
|
6
|
+
/** The card's "(i)", such as what the bug report holds. */
|
|
7
|
+
hint?: string;
|
|
8
|
+
report: string;
|
|
9
|
+
repoButton: string;
|
|
10
|
+
mailButton: string;
|
|
11
|
+
mailSubject: string;
|
|
12
|
+
/** "Bug report". Only drawn together with `onBugReport`. */
|
|
13
|
+
bugReport?: string;
|
|
14
|
+
/** The bug report's second line, "Download". */
|
|
15
|
+
bugReportSub?: string;
|
|
16
|
+
/** "Manual". Only drawn together with `manualUrl`. */
|
|
17
|
+
manual?: string;
|
|
18
|
+
/** The manual's second line, "Open". */
|
|
19
|
+
manualSub?: string;
|
|
20
|
+
};
|
|
21
|
+
repoUrl: string;
|
|
22
|
+
/** The mark on the repository button, passed for the same reason as the
|
|
23
|
+
* give buttons' marks. */
|
|
24
|
+
repoGlyph?: Snippet;
|
|
25
|
+
/** The workshop's own mailbox. Omit it and the card offers no mail route. */
|
|
26
|
+
mailAddress?: string;
|
|
27
|
+
/** The envelope, `MAIL_SVG` from appMarks.ts, which opens under the pointer. */
|
|
28
|
+
mailGlyph?: Snippet;
|
|
29
|
+
/** The app's handbook. Omit it where the app has none; the README is not a
|
|
30
|
+
* manual. */
|
|
31
|
+
manualUrl?: string;
|
|
32
|
+
/** The book, `MANUAL_SVG` from appMarks.ts, which opens under the pointer. */
|
|
33
|
+
manualGlyph?: Snippet;
|
|
34
|
+
/** Downloads the instance's logs and settings as one file, without
|
|
35
|
+
* passwords, keys or credentials. */
|
|
36
|
+
onBugReport?: () => void;
|
|
37
|
+
/** `IconDiagnostics`, the bug. */
|
|
38
|
+
bugGlyph?: Snippet;
|
|
39
|
+
openUrl?: OpenUrl;
|
|
40
|
+
hueIndex?: number;
|
|
41
|
+
}
|
|
42
|
+
declare const InfoHelpCard: import("svelte").Component<InfoHelpCardProps, {}, "">;
|
|
43
|
+
type InfoHelpCard = ReturnType<typeof InfoHelpCard>;
|
|
44
|
+
export default InfoHelpCard;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { InfoAboutCardProps } from "./InfoAboutCard.svelte";
|
|
3
|
+
import type { InfoHelpCardProps } from "./InfoHelpCard.svelte";
|
|
4
|
+
import type { InfoVersionCardProps } from "./InfoVersionCard.svelte";
|
|
5
|
+
|
|
6
|
+
export interface InfoTileProps {
|
|
7
|
+
version: Omit<InfoVersionCardProps, "hueIndex">;
|
|
8
|
+
help: Omit<InfoHelpCardProps, "hueIndex">;
|
|
9
|
+
about: Omit<InfoAboutCardProps, "hueIndex">;
|
|
10
|
+
/** The Version card's rainbow position; the cards after it take the next ones. */
|
|
11
|
+
hueIndex?: number;
|
|
12
|
+
/** Data attributes for the tile, so a component built on it can name itself. */
|
|
13
|
+
[data: `data-${string}`]: string | undefined;
|
|
14
|
+
}
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<script lang="ts">
|
|
18
|
+
import InfoAboutCard from "./InfoAboutCard.svelte";
|
|
19
|
+
import InfoHelpCard from "./InfoHelpCard.svelte";
|
|
20
|
+
import InfoVersionCard from "./InfoVersionCard.svelte";
|
|
21
|
+
|
|
22
|
+
// The Info tile's cards in their fixed order, for the page that stacks them.
|
|
23
|
+
let { version, help, about, hueIndex, ...data }: InfoTileProps = $props();
|
|
24
|
+
const at = (offset: number) => (hueIndex === undefined ? undefined : hueIndex + offset);
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<div data-glim="InfoTile" {...data} style="display: contents">
|
|
28
|
+
<InfoVersionCard {...version} hueIndex={at(0)} />
|
|
29
|
+
<InfoHelpCard {...help} hueIndex={at(1)} />
|
|
30
|
+
<InfoAboutCard {...about} hueIndex={at(2)} />
|
|
31
|
+
</div>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { InfoAboutCardProps } from "./InfoAboutCard.svelte";
|
|
2
|
+
import type { InfoHelpCardProps } from "./InfoHelpCard.svelte";
|
|
3
|
+
import type { InfoVersionCardProps } from "./InfoVersionCard.svelte";
|
|
4
|
+
export interface InfoTileProps {
|
|
5
|
+
version: Omit<InfoVersionCardProps, "hueIndex">;
|
|
6
|
+
help: Omit<InfoHelpCardProps, "hueIndex">;
|
|
7
|
+
about: Omit<InfoAboutCardProps, "hueIndex">;
|
|
8
|
+
/** The Version card's rainbow position; the cards after it take the next ones. */
|
|
9
|
+
hueIndex?: number;
|
|
10
|
+
/** Data attributes for the tile, so a component built on it can name itself. */
|
|
11
|
+
[data: `data-${string}`]: string | undefined;
|
|
12
|
+
}
|
|
13
|
+
declare const InfoTile: import("svelte").Component<InfoTileProps, {}, "">;
|
|
14
|
+
type InfoTile = ReturnType<typeof InfoTile>;
|
|
15
|
+
export default InfoTile;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
3
|
+
import type { OpenUrl, UpdateCheck, VersionRow } from "@glimstone/core";
|
|
4
|
+
|
|
5
|
+
export type { UpdateCheck, VersionRow } from "@glimstone/core";
|
|
6
|
+
|
|
7
|
+
export interface InfoVersionCardProps {
|
|
8
|
+
text: {
|
|
9
|
+
title: string;
|
|
10
|
+
/** The card's "(i)", such as what a click on a number opens. */
|
|
11
|
+
hint?: string;
|
|
12
|
+
unreleased: (version: string) => string;
|
|
13
|
+
/** "Release notes". Only drawn with `onReleaseNotes` and without `whatsNew`. */
|
|
14
|
+
releaseNotes?: string;
|
|
15
|
+
};
|
|
16
|
+
/** The app first, then the design language, then every component it ships. */
|
|
17
|
+
rows: VersionRow[];
|
|
18
|
+
/** "Check for updates" at the bottom of the card. Omit it and the card
|
|
19
|
+
* offers no check. */
|
|
20
|
+
updateCheck?: UpdateCheck;
|
|
21
|
+
/** Opens the app's window on the running version's release notes, for an
|
|
22
|
+
* app that marks no changes. */
|
|
23
|
+
onReleaseNotes?: () => void;
|
|
24
|
+
/** The app's own "New · n" button, wearing `IconWhatsNew` with the dot in
|
|
25
|
+
* front. It takes the place of "Release notes", so the card has one button there. */
|
|
26
|
+
whatsNew?: Snippet;
|
|
27
|
+
openUrl?: OpenUrl;
|
|
28
|
+
hueIndex?: number;
|
|
29
|
+
}
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<script lang="ts">
|
|
33
|
+
import { openInBrowser, runUpdateCheck, updateFace, updateStage, versionLink, type UpdateVerdict } from "@glimstone/core";
|
|
34
|
+
import Button from "./Button.svelte";
|
|
35
|
+
import Card from "./Card.svelte";
|
|
36
|
+
|
|
37
|
+
// The first card of the Info tile: every version as a row, and the New or
|
|
38
|
+
// Release notes button and the update check under them. The check shows its
|
|
39
|
+
// verdict on itself, like a test button.
|
|
40
|
+
let { text, rows, updateCheck, onReleaseNotes, whatsNew, openUrl = openInBrowser, hueIndex }: InfoVersionCardProps = $props();
|
|
41
|
+
|
|
42
|
+
const notes = $derived(!whatsNew && onReleaseNotes && text.releaseNotes);
|
|
43
|
+
let verdict = $state<UpdateVerdict>({ kind: "idle" });
|
|
44
|
+
let shake = $state(0);
|
|
45
|
+
|
|
46
|
+
function check(c: UpdateCheck) {
|
|
47
|
+
void runUpdateCheck(c, verdict, (v) => {
|
|
48
|
+
verdict = v;
|
|
49
|
+
if (v.kind === "failed") shake++;
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
function open(e: MouseEvent, href: string) {
|
|
53
|
+
e.preventDefault();
|
|
54
|
+
openUrl(href);
|
|
55
|
+
}
|
|
56
|
+
</script>
|
|
57
|
+
|
|
58
|
+
<Card data-glim="InfoVersionCard" title={text.title} hint={text.hint} {hueIndex}>
|
|
59
|
+
<ul class="glim-version-rows">
|
|
60
|
+
{#each rows as row (row.name)}
|
|
61
|
+
{@const link = versionLink(row)}
|
|
62
|
+
<li class="glim-version-row">
|
|
63
|
+
<span class="glim-version-name">
|
|
64
|
+
<span class="glim-version-part">{row.name}</span>
|
|
65
|
+
{#if row.sub}<span class="glim-version-sub">{row.sub}</span>{/if}
|
|
66
|
+
</span>
|
|
67
|
+
<!-- A link to its release page when it is a published release. It has
|
|
68
|
+
no underline; the ink lifts on hover. -->
|
|
69
|
+
{#if link.href}
|
|
70
|
+
<a href={link.href} target="_blank" rel="noopener noreferrer" onclick={(e) => open(e, link.href!)} class="glim-num glim-version-number">{link.shown}</a>
|
|
71
|
+
{:else}
|
|
72
|
+
<span class="glim-num glim-version-number">{link.released ? link.shown : text.unreleased(link.shown)}</span>
|
|
73
|
+
{/if}
|
|
74
|
+
</li>
|
|
75
|
+
{/each}
|
|
76
|
+
</ul>
|
|
77
|
+
{#if notes || whatsNew || updateCheck}
|
|
78
|
+
<div class="glim-version-actions">
|
|
79
|
+
{#if notes}<Button label={notes} labelKey="about.releaseNotes" onClick={onReleaseNotes} />{/if}
|
|
80
|
+
{@render whatsNew?.()}
|
|
81
|
+
{#if updateCheck}
|
|
82
|
+
{@const face = updateFace(verdict, updateCheck.text)}
|
|
83
|
+
<!-- A new button for every failure, so the shake runs again. -->
|
|
84
|
+
{#key shake}
|
|
85
|
+
<Button
|
|
86
|
+
label={face.label}
|
|
87
|
+
labelKey={face.labelKey}
|
|
88
|
+
tone={face.tone}
|
|
89
|
+
stage={updateStage(updateCheck.text, face.label)}
|
|
90
|
+
busy={verdict.kind === "busy"}
|
|
91
|
+
onClick={() => check(updateCheck)}
|
|
92
|
+
class={shake > 0 ? "glim-shake" : ""}
|
|
93
|
+
/>
|
|
94
|
+
{/key}
|
|
95
|
+
<span role="status" class="glim-sr-only">{face.announced}</span>
|
|
96
|
+
{/if}
|
|
97
|
+
</div>
|
|
98
|
+
{/if}
|
|
99
|
+
</Card>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
import type { OpenUrl, UpdateCheck, VersionRow } from "@glimstone/core";
|
|
3
|
+
export type { UpdateCheck, VersionRow } from "@glimstone/core";
|
|
4
|
+
export interface InfoVersionCardProps {
|
|
5
|
+
text: {
|
|
6
|
+
title: string;
|
|
7
|
+
/** The card's "(i)", such as what a click on a number opens. */
|
|
8
|
+
hint?: string;
|
|
9
|
+
unreleased: (version: string) => string;
|
|
10
|
+
/** "Release notes". Only drawn with `onReleaseNotes` and without `whatsNew`. */
|
|
11
|
+
releaseNotes?: string;
|
|
12
|
+
};
|
|
13
|
+
/** The app first, then the design language, then every component it ships. */
|
|
14
|
+
rows: VersionRow[];
|
|
15
|
+
/** "Check for updates" at the bottom of the card. Omit it and the card
|
|
16
|
+
* offers no check. */
|
|
17
|
+
updateCheck?: UpdateCheck;
|
|
18
|
+
/** Opens the app's window on the running version's release notes, for an
|
|
19
|
+
* app that marks no changes. */
|
|
20
|
+
onReleaseNotes?: () => void;
|
|
21
|
+
/** The app's own "New · n" button, wearing `IconWhatsNew` with the dot in
|
|
22
|
+
* front. It takes the place of "Release notes", so the card has one button there. */
|
|
23
|
+
whatsNew?: Snippet;
|
|
24
|
+
openUrl?: OpenUrl;
|
|
25
|
+
hueIndex?: number;
|
|
26
|
+
}
|
|
27
|
+
declare const InfoVersionCard: import("svelte").Component<InfoVersionCardProps, {}, "">;
|
|
28
|
+
type InfoVersionCard = ReturnType<typeof InfoVersionCard>;
|
|
29
|
+
export default InfoVersionCard;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
3
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
4
|
+
import type { InstanceFigure } from "@glimstone/core";
|
|
5
|
+
|
|
6
|
+
export type { InstanceFigure } from "@glimstone/core";
|
|
7
|
+
|
|
8
|
+
export interface InstanceCardProps extends Omit<HTMLAttributes<HTMLDivElement>, "children" | "class"> {
|
|
9
|
+
/** The app's mark, as an address or as an inline `<svg>`. */
|
|
10
|
+
logo?: string | Snippet;
|
|
11
|
+
/** The device's name for an instance of this app, the app's name for another app. */
|
|
12
|
+
name: string;
|
|
13
|
+
eyebrow?: string;
|
|
14
|
+
/** Badges after the name, such as the state. */
|
|
15
|
+
badges?: Snippet;
|
|
16
|
+
/** One quiet line of facts, joined with a dot. Empty ones are left out. */
|
|
17
|
+
facts?: (string | undefined)[];
|
|
18
|
+
/** A few numbers under the facts, each with its small label. */
|
|
19
|
+
figures?: InstanceFigure[];
|
|
20
|
+
/** What the card holds under the head, such as a row per instance. */
|
|
21
|
+
children?: Snippet;
|
|
22
|
+
/** The card's buttons. Without a body they stand beside the mark. */
|
|
23
|
+
actions?: Snippet;
|
|
24
|
+
/** The card's position in the rainbow, counted over the cards on the page. */
|
|
25
|
+
hueIndex?: number;
|
|
26
|
+
class?: string;
|
|
27
|
+
}
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<script lang="ts">
|
|
31
|
+
import { hueVars } from "@glimstone/core";
|
|
32
|
+
import { css } from "./style.js";
|
|
33
|
+
|
|
34
|
+
// One instance as a card in the Instances grid, or one app of the fortress
|
|
35
|
+
// with a row for each place it runs ("The fortress" in the design language).
|
|
36
|
+
// The mark stands at the start, the name with its badges beside it, and the
|
|
37
|
+
// actions at the end of the card's foot.
|
|
38
|
+
let { logo, name, eyebrow, badges, facts, figures, children, actions, hueIndex, class: className, style, ...rest }: InstanceCardProps = $props();
|
|
39
|
+
|
|
40
|
+
const shown = $derived(facts?.filter(Boolean) ?? []);
|
|
41
|
+
const styleText = $derived(hueIndex !== undefined ? [css(hueVars(hueIndex)), style].filter(Boolean).join("; ") : style);
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
{#snippet acts()}
|
|
45
|
+
{#if actions}<div class="glim-instance-acts">{@render actions()}</div>{/if}
|
|
46
|
+
{/snippet}
|
|
47
|
+
|
|
48
|
+
<div
|
|
49
|
+
data-glim="InstanceCard"
|
|
50
|
+
data-glim-title={name}
|
|
51
|
+
{...rest}
|
|
52
|
+
class={["glim-card glim-instance", hueIndex !== undefined && "glim-hue", className].filter(Boolean).join(" ")}
|
|
53
|
+
style={styleText}
|
|
54
|
+
>
|
|
55
|
+
<div class="glim-instance-top">
|
|
56
|
+
{#if typeof logo === "string"}
|
|
57
|
+
<img class="glim-instance-mark" src={logo} alt="" draggable="false" />
|
|
58
|
+
{:else if logo}
|
|
59
|
+
<span class="glim-instance-mark" aria-hidden="true">{@render logo()}</span>
|
|
60
|
+
{/if}
|
|
61
|
+
<div class="glim-instance-main">
|
|
62
|
+
<div class="glim-instance-name">
|
|
63
|
+
<h3 class="glim-instance-title">{name}</h3>
|
|
64
|
+
{#if badges}<span class="glim-instance-badges">{@render badges()}</span>{/if}
|
|
65
|
+
</div>
|
|
66
|
+
{#if eyebrow}<span class="glim-eyebrow">{eyebrow}</span>{/if}
|
|
67
|
+
{#if shown.length > 0}<p class="glim-instance-facts glim-num">{shown.join(" · ")}</p>{/if}
|
|
68
|
+
{#if figures && figures.length > 0}
|
|
69
|
+
<dl class="glim-instance-figures">
|
|
70
|
+
{#each figures as f (f.label)}
|
|
71
|
+
<div>
|
|
72
|
+
<dt>{f.label}</dt>
|
|
73
|
+
<dd class="glim-num">{f.value}</dd>
|
|
74
|
+
</div>
|
|
75
|
+
{/each}
|
|
76
|
+
</dl>
|
|
77
|
+
{/if}
|
|
78
|
+
{#if !children}{@render acts()}{/if}
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
{#if children}
|
|
82
|
+
<div class="glim-instance-body">{@render children()}</div>
|
|
83
|
+
{@render acts()}
|
|
84
|
+
{/if}
|
|
85
|
+
</div>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
3
|
+
import type { InstanceFigure } from "@glimstone/core";
|
|
4
|
+
export type { InstanceFigure } from "@glimstone/core";
|
|
5
|
+
export interface InstanceCardProps extends Omit<HTMLAttributes<HTMLDivElement>, "children" | "class"> {
|
|
6
|
+
/** The app's mark, as an address or as an inline `<svg>`. */
|
|
7
|
+
logo?: string | Snippet;
|
|
8
|
+
/** The device's name for an instance of this app, the app's name for another app. */
|
|
9
|
+
name: string;
|
|
10
|
+
eyebrow?: string;
|
|
11
|
+
/** Badges after the name, such as the state. */
|
|
12
|
+
badges?: Snippet;
|
|
13
|
+
/** One quiet line of facts, joined with a dot. Empty ones are left out. */
|
|
14
|
+
facts?: (string | undefined)[];
|
|
15
|
+
/** A few numbers under the facts, each with its small label. */
|
|
16
|
+
figures?: InstanceFigure[];
|
|
17
|
+
/** What the card holds under the head, such as a row per instance. */
|
|
18
|
+
children?: Snippet;
|
|
19
|
+
/** The card's buttons. Without a body they stand beside the mark. */
|
|
20
|
+
actions?: Snippet;
|
|
21
|
+
/** The card's position in the rainbow, counted over the cards on the page. */
|
|
22
|
+
hueIndex?: number;
|
|
23
|
+
class?: string;
|
|
24
|
+
}
|
|
25
|
+
declare const InstanceCard: import("svelte").Component<InstanceCardProps, {}, "">;
|
|
26
|
+
type InstanceCard = ReturnType<typeof InstanceCard>;
|
|
27
|
+
export default InstanceCard;
|
package/dist/Kbd.svelte
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
3
|
+
|
|
4
|
+
export interface KbdProps {
|
|
5
|
+
children: Snippet;
|
|
6
|
+
class?: string;
|
|
7
|
+
}
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<script lang="ts">
|
|
11
|
+
// A key or a key combination as it is written on the keys, such as "Ctrl+K".
|
|
12
|
+
// The words are the app's, so a German app writes "Strg".
|
|
13
|
+
let { children, class: className }: KbdProps = $props();
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<kbd data-glim="Kbd" class={className ? `glim-kbd ${className}` : "glim-kbd"}>{@render children()}</kbd>
|