@glimstone/svelte 4.5.6 → 4.5.8
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/dist/BrandMark.svelte +10 -2
- package/dist/BrandMark.svelte.d.ts +2 -0
- package/dist/PickerWindow.svelte +23 -8
- package/dist/PickerWindow.svelte.d.ts +5 -1
- package/dist/ReadmeButton.svelte +4 -1
- package/dist/ReadmeButton.svelte.d.ts +2 -0
- package/dist/index.d.ts +1 -1
- package/package.json +2 -2
package/dist/BrandMark.svelte
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
2
|
export interface BrandMarkProps {
|
|
3
3
|
svg: string;
|
|
4
|
+
/** The drawing a lit tile shows instead. */
|
|
5
|
+
hover?: string;
|
|
4
6
|
}
|
|
5
7
|
</script>
|
|
6
8
|
|
|
7
9
|
<script lang="ts">
|
|
8
10
|
// A vendor mark kept as its own markup, from appMarks.ts.
|
|
9
|
-
let { svg }: BrandMarkProps = $props();
|
|
11
|
+
let { svg, hover }: BrandMarkProps = $props();
|
|
10
12
|
</script>
|
|
11
13
|
|
|
12
|
-
|
|
14
|
+
{#if hover}
|
|
15
|
+
<span data-glim="BrandMark" class="glim-brand-svg" aria-hidden="true"
|
|
16
|
+
><span class="glim-mark-rest">{@html svg}</span><span class="glim-mark-hover">{@html hover}</span></span
|
|
17
|
+
>
|
|
18
|
+
{:else}
|
|
19
|
+
<span data-glim="BrandMark" class="glim-brand-svg" aria-hidden="true">{@html svg}</span>
|
|
20
|
+
{/if}
|
package/dist/PickerWindow.svelte
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import type { PickGroup, PickItem, PickerText } from "@glimstone/core";
|
|
4
4
|
import type { WindowAction } from "./WindowFootRow.svelte";
|
|
5
5
|
|
|
6
|
-
export type { PickGroup, PickerText, TileMark } from "@glimstone/core";
|
|
6
|
+
export type { PickBadge, PickGroup, PickerText, TileMark } from "@glimstone/core";
|
|
7
7
|
|
|
8
8
|
export type PickerItem = PickItem<Snippet>;
|
|
9
9
|
|
|
@@ -24,6 +24,10 @@
|
|
|
24
24
|
actions?: WindowAction[];
|
|
25
25
|
/** Back from the form to the tiles, with the search as it was. */
|
|
26
26
|
onBack?: () => void;
|
|
27
|
+
/** A quiet line at the start of the foot, such as the verdict of a test. */
|
|
28
|
+
start?: string | Snippet;
|
|
29
|
+
/** The id of the tile picked before, which stands marked and takes the focus when the tiles show. */
|
|
30
|
+
selected?: string;
|
|
27
31
|
/** Called for every way out: the foot, Escape and, while the tiles show, a press beside the window. */
|
|
28
32
|
onClose: () => void;
|
|
29
33
|
}
|
|
@@ -37,12 +41,14 @@
|
|
|
37
41
|
isTileMark,
|
|
38
42
|
pageLocale,
|
|
39
43
|
pickerHue,
|
|
44
|
+
pickFocusTarget,
|
|
45
|
+
pickMarkClass,
|
|
40
46
|
pickSearchKey,
|
|
41
47
|
pickSections,
|
|
42
48
|
pickTileKey,
|
|
43
49
|
pickTileStyle,
|
|
44
|
-
windowFocusTarget,
|
|
45
50
|
} from "@glimstone/core";
|
|
51
|
+
import Badge from "./Badge.svelte";
|
|
46
52
|
import BrandMark from "./BrandMark.svelte";
|
|
47
53
|
import GlyphField from "./GlyphField.svelte";
|
|
48
54
|
import { IconBack, IconClose, IconSearch } from "./glyphs.js";
|
|
@@ -59,7 +65,7 @@
|
|
|
59
65
|
// follows: it closes the window, or passes the picked tile's form as
|
|
60
66
|
// children, which takes the tiles' place with Back and the form's actions in
|
|
61
67
|
// the foot.
|
|
62
|
-
let { title, hint, items, groups = [], text, onPick, children, actions = [], onBack, onClose }: PickerWindowProps = $props();
|
|
68
|
+
let { title, hint, items, groups = [], text, onPick, children, actions = [], onBack, start, selected, onClose }: PickerWindowProps = $props();
|
|
63
69
|
|
|
64
70
|
let query = $state("");
|
|
65
71
|
const hue = pickerHue();
|
|
@@ -71,7 +77,7 @@
|
|
|
71
77
|
void form;
|
|
72
78
|
void tick().then(() => {
|
|
73
79
|
if (scroll) holdPickHeight(scroll);
|
|
74
|
-
if (card)
|
|
80
|
+
if (card) pickFocusTarget(card, scroll ?? null)?.focus();
|
|
75
81
|
});
|
|
76
82
|
});
|
|
77
83
|
// Back keeps the window open, so it returns false.
|
|
@@ -117,6 +123,7 @@
|
|
|
117
123
|
style={css(hue ?? undefined)}
|
|
118
124
|
bind:ref={card}
|
|
119
125
|
text={{ cancel: text.cancel, close: text.close }}
|
|
126
|
+
{start}
|
|
120
127
|
actions={form ? [back, ...actions] : [{ label: text.close, labelKey: "common.close", glyph: IconClose, wayOut: true }]}
|
|
121
128
|
closeOnBackdrop={!form}
|
|
122
129
|
{onClose}
|
|
@@ -144,16 +151,24 @@
|
|
|
144
151
|
{:else}
|
|
145
152
|
{#each sections as s (s.id)}
|
|
146
153
|
<section class="glim-pick-section">
|
|
147
|
-
{#if s.title}
|
|
154
|
+
{#if s.title}
|
|
155
|
+
<div class="glim-pick-eyebrow">
|
|
156
|
+
<h3 class="glim-eyebrow">{s.title}</h3>
|
|
157
|
+
{#if s.badge}<Badge size="small" tone={s.badge.tone}>{s.badge.label}</Badge>{/if}
|
|
158
|
+
{#if s.hint}<InfoBubble tip={s.hint} />{/if}
|
|
159
|
+
</div>
|
|
160
|
+
{/if}
|
|
148
161
|
<ul class="glim-provider-pick">
|
|
149
162
|
{#each s.items as item (item.id)}
|
|
150
|
-
{#snippet brand()}{#if isTileMark(item.mark)}<BrandMark svg={item.mark.svg} />{/if}{/snippet}
|
|
163
|
+
{#snippet brand()}{#if isTileMark(item.mark)}<BrandMark svg={item.mark.svg} hover={item.mark.hover} />{/if}{/snippet}
|
|
151
164
|
<li style={css(pickTileStyle(item.mark))}>
|
|
152
165
|
<ReadmeButton
|
|
153
166
|
brand="house"
|
|
154
|
-
parts={[{ name: item.label, sub: item.sub, onClick: () => onPick(item.id) }]}
|
|
167
|
+
parts={[{ name: item.label, sub: item.sub, onClick: item.status ? undefined : () => onPick(item.id) }]}
|
|
168
|
+
soonLabel={item.status}
|
|
169
|
+
current={item.id === selected}
|
|
155
170
|
mark={isTileMark(item.mark) ? brand : (item.mark as Snippet | undefined)}
|
|
156
|
-
markClass={
|
|
171
|
+
markClass={pickMarkClass(item.mark)}
|
|
157
172
|
hint={item.hint}
|
|
158
173
|
tip={item.tip}
|
|
159
174
|
/>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Snippet } from "svelte";
|
|
2
2
|
import type { PickGroup, PickItem, PickerText } from "@glimstone/core";
|
|
3
3
|
import type { WindowAction } from "./WindowFootRow.svelte";
|
|
4
|
-
export type { PickGroup, PickerText, TileMark } from "@glimstone/core";
|
|
4
|
+
export type { PickBadge, PickGroup, PickerText, TileMark } from "@glimstone/core";
|
|
5
5
|
export type PickerItem = PickItem<Snippet>;
|
|
6
6
|
export interface PickerWindowProps {
|
|
7
7
|
/** The notch's words, also the window's accessible name. */
|
|
@@ -20,6 +20,10 @@ export interface PickerWindowProps {
|
|
|
20
20
|
actions?: WindowAction[];
|
|
21
21
|
/** Back from the form to the tiles, with the search as it was. */
|
|
22
22
|
onBack?: () => void;
|
|
23
|
+
/** A quiet line at the start of the foot, such as the verdict of a test. */
|
|
24
|
+
start?: string | Snippet;
|
|
25
|
+
/** The id of the tile picked before, which stands marked and takes the focus when the tiles show. */
|
|
26
|
+
selected?: string;
|
|
23
27
|
/** Called for every way out: the foot, Escape and, while the tiles show, a press beside the window. */
|
|
24
28
|
onClose: () => void;
|
|
25
29
|
}
|
package/dist/ReadmeButton.svelte
CHANGED
|
@@ -23,6 +23,8 @@
|
|
|
23
23
|
note?: boolean;
|
|
24
24
|
/** The second line of a unit whose first part has neither `href` nor `onClick`. */
|
|
25
25
|
soonLabel?: string;
|
|
26
|
+
/** Marks the first part as the one chosen, such as a picker's tile picked before. */
|
|
27
|
+
current?: boolean;
|
|
26
28
|
/** Runs on a click on a part's link, for an app whose webview has no browser
|
|
27
29
|
* behind it to open the address in. */
|
|
28
30
|
onLinkClick?: (e: MouseEvent) => void;
|
|
@@ -42,7 +44,7 @@
|
|
|
42
44
|
// brand's colour ("Brand tiles"). A link where a part leads to a file or a
|
|
43
45
|
// listing, a button where it does something on the page, and a quiet unit with
|
|
44
46
|
// "Soon" as its second line where the listing does not exist yet.
|
|
45
|
-
let { brand, parts, mark, markClass, art, hint, tip, note, soonLabel, onLinkClick }: ReadmeButtonProps = $props();
|
|
47
|
+
let { brand, parts, mark, markClass, art, hint, tip, note, soonLabel, current, onLinkClick }: ReadmeButtonProps = $props();
|
|
46
48
|
|
|
47
49
|
let root: HTMLDivElement;
|
|
48
50
|
const soon = $derived(readmeSoon(parts));
|
|
@@ -60,6 +62,7 @@
|
|
|
60
62
|
i === 0
|
|
61
63
|
? {
|
|
62
64
|
"aria-describedby": tooltip.describedBy,
|
|
65
|
+
"aria-current": current || undefined,
|
|
63
66
|
onmouseenter: tooltip.show,
|
|
64
67
|
onmouseleave: tooltip.hide,
|
|
65
68
|
onfocus: tooltip.showOnFocus,
|
|
@@ -20,6 +20,8 @@ export interface ReadmeButtonProps {
|
|
|
20
20
|
note?: boolean;
|
|
21
21
|
/** The second line of a unit whose first part has neither `href` nor `onClick`. */
|
|
22
22
|
soonLabel?: string;
|
|
23
|
+
/** Marks the first part as the one chosen, such as a picker's tile picked before. */
|
|
24
|
+
current?: boolean;
|
|
23
25
|
/** Runs on a click on a part's link, for an app whose webview has no browser
|
|
24
26
|
* behind it to open the address in. */
|
|
25
27
|
onLinkClick?: (e: MouseEvent) => void;
|
package/dist/index.d.ts
CHANGED
|
@@ -42,7 +42,7 @@ export { default as NumberField, type NumberFieldProps } from "./NumberField.sve
|
|
|
42
42
|
export { default as PasswordField, type PasswordFieldProps } from "./PasswordField.svelte";
|
|
43
43
|
export { default as PathField, type PathFieldProps } from "./PathField.svelte";
|
|
44
44
|
export { default as PaypalDialog, type PaypalDialogProps, type PaypalSelectorProps } from "./PaypalDialog.svelte";
|
|
45
|
-
export { default as PickerWindow, type PickGroup, type PickerItem, type PickerText, type PickerWindowProps, type TileMark } from "./PickerWindow.svelte";
|
|
45
|
+
export { default as PickerWindow, type PickBadge, type PickGroup, type PickerItem, type PickerText, type PickerWindowProps, type TileMark } from "./PickerWindow.svelte";
|
|
46
46
|
export { default as Pill, type PillProps, type PillTone } from "./Pill.svelte";
|
|
47
47
|
export { default as Popover, type PopoverProps } from "./Popover.svelte";
|
|
48
48
|
export { default as PresenceBadges, type PresenceBadgesProps } from "./PresenceBadges.svelte";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@glimstone/svelte",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.8",
|
|
4
4
|
"description": "GlimStone's components for Svelte",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"repository": {
|
|
@@ -141,7 +141,7 @@
|
|
|
141
141
|
"build": "svelte-package -i src -o dist"
|
|
142
142
|
},
|
|
143
143
|
"dependencies": {
|
|
144
|
-
"@glimstone/core": "4.5.
|
|
144
|
+
"@glimstone/core": "4.5.8"
|
|
145
145
|
},
|
|
146
146
|
"peerDependencies": {
|
|
147
147
|
"@internationalized/date": "^3.12.4",
|