@glimstone/svelte 4.9.1 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/dist/AngleSlider.svelte +33 -9
  2. package/dist/AngleSlider.svelte.d.ts +1 -1
  3. package/dist/Avatar.svelte +1 -1
  4. package/dist/Badge.svelte +3 -7
  5. package/dist/Badge.svelte.d.ts +2 -5
  6. package/dist/Card.svelte +5 -1
  7. package/dist/Card.svelte.d.ts +3 -0
  8. package/dist/Chart.svelte +84 -0
  9. package/dist/Chart.svelte.d.ts +19 -0
  10. package/dist/ChartLegend.svelte +19 -0
  11. package/dist/ChartLegend.svelte.d.ts +7 -0
  12. package/dist/Checkbox.svelte +16 -3
  13. package/dist/ColorPicker.svelte +49 -4
  14. package/dist/ColorPicker.svelte.d.ts +2 -0
  15. package/dist/Combobox.svelte +12 -4
  16. package/dist/ConfirmDialog.svelte +8 -2
  17. package/dist/ConnectionRow.svelte +4 -1
  18. package/dist/ConnectionRow.svelte.d.ts +2 -0
  19. package/dist/ContextMenu.svelte +4 -2
  20. package/dist/ContextMenu.svelte.d.ts +2 -0
  21. package/dist/DatePicker.svelte +21 -11
  22. package/dist/FieldErrorLine.svelte +24 -0
  23. package/dist/FieldErrorLine.svelte.d.ts +7 -0
  24. package/dist/FieldRow.svelte +16 -4
  25. package/dist/FileUpload.svelte +14 -4
  26. package/dist/FileUpload.svelte.d.ts +2 -0
  27. package/dist/FortressPermissions.svelte +3 -1
  28. package/dist/HoverCard.svelte +34 -5
  29. package/dist/HoverCard.svelte.d.ts +12 -2
  30. package/dist/IconTipButton.svelte +6 -2
  31. package/dist/IconTipButton.svelte.d.ts +3 -0
  32. package/dist/InfoBubble.svelte +1 -1
  33. package/dist/ListRow.svelte +71 -6
  34. package/dist/ListRow.svelte.d.ts +17 -2
  35. package/dist/ListSelect.svelte +7 -2
  36. package/dist/ListTable.svelte +36 -16
  37. package/dist/ListTable.svelte.d.ts +5 -0
  38. package/dist/MenuSelect.svelte +11 -3
  39. package/dist/Meter.svelte +21 -3
  40. package/dist/Meter.svelte.d.ts +4 -0
  41. package/dist/MultiSelect.svelte +156 -0
  42. package/dist/MultiSelect.svelte.d.ts +20 -0
  43. package/dist/NotifyCard.svelte +1 -1
  44. package/dist/NumberField.svelte +2 -2
  45. package/dist/Pagination.svelte +15 -5
  46. package/dist/PasswordField.svelte +7 -6
  47. package/dist/PinInput.svelte +4 -2
  48. package/dist/Rating.svelte +10 -1
  49. package/dist/RevealEye.svelte +17 -0
  50. package/dist/RevealEye.svelte.d.ts +6 -0
  51. package/dist/SearchHit.svelte +10 -0
  52. package/dist/SearchHit.svelte.d.ts +7 -0
  53. package/dist/Selector.svelte +28 -4
  54. package/dist/Selector.svelte.d.ts +4 -3
  55. package/dist/SettingsNav.svelte +152 -0
  56. package/dist/SettingsNav.svelte.d.ts +46 -0
  57. package/dist/SignInTile.svelte +124 -114
  58. package/dist/SkeletonRow.svelte +8 -2
  59. package/dist/SkeletonRow.svelte.d.ts +4 -0
  60. package/dist/Slider.svelte +1 -0
  61. package/dist/Sparkline.svelte +24 -0
  62. package/dist/Sparkline.svelte.d.ts +11 -0
  63. package/dist/StatusSummary.svelte +55 -0
  64. package/dist/StatusSummary.svelte.d.ts +18 -0
  65. package/dist/SubCard.svelte +16 -16
  66. package/dist/SubCard.svelte.d.ts +3 -3
  67. package/dist/TextArea.svelte +13 -3
  68. package/dist/TextField.svelte +2 -2
  69. package/dist/TimeDial.svelte +74 -0
  70. package/dist/TimeDial.svelte.d.ts +13 -0
  71. package/dist/TimePicker.svelte +57 -0
  72. package/dist/TimePicker.svelte.d.ts +19 -0
  73. package/dist/TimeRangePicker.svelte +52 -0
  74. package/dist/TimeRangePicker.svelte.d.ts +16 -0
  75. package/dist/TimeShell.svelte +145 -0
  76. package/dist/TimeShell.svelte.d.ts +16 -0
  77. package/dist/Timer.svelte +6 -1
  78. package/dist/TipBubble.svelte +1 -1
  79. package/dist/ToastCard.svelte +7 -3
  80. package/dist/ToastCard.svelte.d.ts +2 -0
  81. package/dist/ToastViewport.svelte +6 -3
  82. package/dist/Toggle.svelte +3 -1
  83. package/dist/Tour.svelte +8 -2
  84. package/dist/Window.svelte +5 -3
  85. package/dist/Window.svelte.d.ts +3 -1
  86. package/dist/bubble.svelte.d.ts +12 -1
  87. package/dist/bubble.svelte.js +13 -5
  88. package/dist/engines.svelte.d.ts +7 -1
  89. package/dist/engines.svelte.js +13 -1
  90. package/dist/entries/multiselect.d.ts +1 -0
  91. package/dist/entries/multiselect.js +2 -0
  92. package/dist/glyphs.d.ts +3 -0
  93. package/dist/glyphs.js +3 -0
  94. package/dist/index.d.ts +13 -7
  95. package/dist/index.js +9 -4
  96. package/package.json +7 -2
  97. package/dist/AboutCard.svelte +0 -116
  98. package/dist/AboutCard.svelte.d.ts +0 -40
  99. package/dist/DropdownListbox.svelte +0 -178
  100. package/dist/DropdownListbox.svelte.d.ts +0 -23
@@ -7,5 +7,5 @@
7
7
  </script>
8
8
 
9
9
  {#if state.shown}
10
- <div {@attach lift} bind:this={state.bubble} id={state.id} role="tooltip" class="glim-bubble glim-fade">{state.text}</div>
10
+ <div {@attach lift} bind:this={state.bubble} id={state.id} role="tooltip" class="glim-bubble glim-fade glim-bubble--{state.kind}">{state.text}{#if state.shortcut}<kbd class="glim-bubble-key">{state.shortcut}</kbd>{/if}</div>
11
11
  {/if}
@@ -3,6 +3,8 @@
3
3
 
4
4
  export interface ToastCardProps {
5
5
  id: string;
6
+ /** A short first line; the message then reads as its description. */
7
+ title?: string;
6
8
  message: string;
7
9
  severity: ToastSeverity;
8
10
  /** A button such as Undo. A press runs it and dismisses the toast. */
@@ -18,14 +20,14 @@
18
20
  </script>
19
21
 
20
22
  <script lang="ts">
21
- import { MARKS, softBreaks, TOAST_MARKS } from "@glimstone/core";
23
+ import { leaveBehind, MARKS, softBreaks, TOAST_MARKS } from "@glimstone/core";
22
24
  import Button from "./Button.svelte";
23
25
  import MarkSvg from "./MarkSvg.svelte";
24
26
 
25
27
  // One toast, without state, so a test can mount it with props. Focus is
26
28
  // heard on focusin and focusout, so tabbing onto the dismiss button pauses
27
29
  // the countdown like a hover does.
28
- let { id, message, severity, action, dismissLabel, onDismiss, onMouseEnter, onMouseLeave, onFocus, onBlur }: ToastCardProps = $props();
30
+ let { id, title, message, severity, action, dismissLabel, onDismiss, onMouseEnter, onMouseLeave, onFocus, onBlur }: ToastCardProps = $props();
29
31
 
30
32
  function keys(e: KeyboardEvent) {
31
33
  if (e.key === "Escape") {
@@ -37,16 +39,18 @@
37
39
 
38
40
  <!-- svelte-ignore a11y_no_static_element_interactions -->
39
41
  <div
42
+ {@attach leaveBehind}
40
43
  data-glim="ToastCard"
41
44
  onmouseenter={() => onMouseEnter(id)}
42
45
  onmouseleave={() => onMouseLeave(id)}
43
46
  onfocusin={() => onFocus(id)}
44
47
  onfocusout={() => onBlur(id)}
45
48
  onkeydown={keys}
46
- class="glim-toast glim-toast-card"
49
+ class={title ? "glim-toast glim-toast-card glim-toast-card--titled" : "glim-toast glim-toast-card"}
47
50
  >
48
51
  <MarkSvg mark={TOAST_MARKS[severity]} class={`glim-toast-glyph glim-toast-glyph--${severity}`} />
49
52
  <div class="glim-toast-body">
53
+ {#if title}<p class="glim-toast-title">{title}</p>{/if}
50
54
  <p class="glim-toast-message">{#each softBreaks(message) as part, i}{#if i > 0}<wbr />{/if}{part}{/each}</p>
51
55
  {#if action}
52
56
  {@const act = action}
@@ -1,6 +1,8 @@
1
1
  import type { ToastAction, ToastSeverity } from "@glimstone/core";
2
2
  export interface ToastCardProps {
3
3
  id: string;
4
+ /** A short first line; the message then reads as its description. */
5
+ title?: string;
4
6
  message: string;
5
7
  severity: ToastSeverity;
6
8
  /** A button such as Undo. A press runs it and dismisses the toast. */
@@ -17,7 +17,7 @@
17
17
  </script>
18
18
 
19
19
  <script lang="ts">
20
- import { announce, liveRegionAttrs, toastPoliteness } from "@glimstone/core";
20
+ import { announce, liveRegionAttrs, toastAnnouncement, toastPoliteness, watchToastStack } from "@glimstone/core";
21
21
  import ToastCard from "./ToastCard.svelte";
22
22
 
23
23
  // The toast system's presentational half (design-language.md, "Toasts"). It
@@ -40,17 +40,20 @@
40
40
  for (const t of toasts) {
41
41
  if (heard.has(t.id)) continue;
42
42
  heard.add(t.id);
43
- announce(t.message, toastPoliteness(t.severity));
43
+ announce(toastAnnouncement(t), toastPoliteness(t.severity));
44
44
  }
45
45
  });
46
+ let stack: HTMLDivElement;
47
+ $effect(() => watchToastStack(stack));
46
48
  </script>
47
49
 
48
50
  <div class="glim-sr-only" {...liveRegionAttrs("polite")}></div>
49
51
  <div class="glim-sr-only" {...liveRegionAttrs("assertive")}></div>
50
- <div data-glim="ToastViewport" class="glim-toast-stack">
52
+ <div bind:this={stack} data-glim="ToastViewport" class="glim-toast-stack">
51
53
  {#each toasts as t (t.id)}
52
54
  <ToastCard
53
55
  id={t.id}
56
+ title={t.title}
54
57
  message={t.message}
55
58
  severity={t.severity}
56
59
  action={t.action}
@@ -57,7 +57,9 @@
57
57
  </script>
58
58
 
59
59
  <span data-glim="Toggle" bind:this={frame} class={`glim-toggle${className ? ` ${className}` : ""}`} {style}>
60
- {#if label !== undefined && !hideLabel}<span class="glim-toggle-label">{label}</span>{/if}
60
+ <!-- The words are part of the switch's target, as a native label's would be. -->
61
+ <!-- svelte-ignore a11y_click_events_have_key_events, a11y_no_static_element_interactions -->
62
+ {#if label !== undefined && !hideLabel}<span class="glim-toggle-label" onclick={() => frame.querySelector<HTMLElement>(".glim-toggle-track")?.click()}>{label}</span>{/if}
61
63
  <!-- No title: the label is always visible beside the switch, so a tooltip
62
64
  would only repeat it. A refused switch's bubble says why. -->
63
65
  <button
package/dist/Tour.svelte CHANGED
@@ -16,7 +16,7 @@
16
16
  import { untrack } from "svelte";
17
17
  import * as tour from "@zag-js/tour";
18
18
  import { normalizeProps, useMachine } from "@zag-js/svelte";
19
- import { TOUR_TEXT, pageDir, tourSteps } from "@glimstone/core";
19
+ import { TOUR_TEXT, pageDir, tourDots, tourSpotlight, tourSteps } from "@glimstone/core";
20
20
  import Badge from "./Badge.svelte";
21
21
  import Button from "./Button.svelte";
22
22
  import { IconBack, IconCheck, IconForward } from "./glyphs.js";
@@ -30,10 +30,13 @@
30
30
 
31
31
  const words = $derived({ ...TOUR_TEXT, ...text });
32
32
  const id = $props.id();
33
+ let at = $state(0);
33
34
  const service = useMachine(tour.machine, () => ({
34
35
  id,
35
36
  dir: pageDir(),
36
37
  steps: tourSteps(steps),
38
+ ...tourSpotlight(steps, at),
39
+ onStepChange: (d: { stepIndex: number }) => (at = d.stepIndex),
37
40
  onStatusChange: (d: { status: string }) => {
38
41
  if (d.status === "dismissed" || d.status === "completed" || d.status === "skipped") {
39
42
  open = false;
@@ -61,7 +64,10 @@
61
64
  </h2>
62
65
  <p {...api.getDescriptionProps()} class="glim-tour-text">{api.step.description}</p>
63
66
  <div class="glim-tour-foot">
64
- <span {...api.getProgressTextProps()} class="glim-tour-progress glim-num">{words.progress(api.stepIndex + 1, api.totalSteps)}</span>
67
+ <span {...api.getProgressTextProps()} class="glim-tour-progress">
68
+ <span class="glim-sr-only">{words.progress(api.stepIndex + 1, api.totalSteps)}</span>
69
+ {#each tourDots(api.totalSteps, api.stepIndex) as current, i (i)}<span aria-hidden="true" class="glim-tour-dot" data-current={current || undefined}></span>{/each}
70
+ </span>
65
71
  <Button label={words.back} labelKey={null} glyph={IconBack} disabled={!api.hasPrevStep} onClick={() => api.prev()} />
66
72
  {#if api.lastStep}
67
73
  <Button label={words.close} labelKey={null} glyph={IconCheck} tone="accent" onClick={end} />
@@ -18,7 +18,9 @@
18
18
  actions?: WindowAction[];
19
19
  /** A quiet line at the start of the foot, such as where the work carries on. */
20
20
  start?: string | Snippet;
21
- /** `normal` for a question or a form, `wide` for a list, `full` for a tool. */
21
+ /** The width: `small` (400px) for a question, `normal` (560px) for a form,
22
+ * `large` (720px) for a longer form, `wide` (960px) for a list, `full` for
23
+ * a tool. */
22
24
  size?: WindowSize;
23
25
  /** The words of the way out the window adds. */
24
26
  text: { cancel: string; close: string };
@@ -35,7 +37,7 @@
35
37
 
36
38
  <script lang="ts">
37
39
  import { onMount } from "svelte";
38
- import { focusedAsker, menuIsOpen, returnFocus, stackWindow, windowFocusTarget } from "@glimstone/core";
40
+ import { focusedAsker, leaveBehind, menuIsOpen, returnFocus, stackWindow, windowFocusTarget } from "@glimstone/core";
39
41
  import Badge from "./Badge.svelte";
40
42
  import { lift } from "./lift.js";
41
43
  import WindowFootRow from "./WindowFootRow.svelte";
@@ -89,7 +91,7 @@
89
91
  so it is the only node Svelte removes for it, wherever the caller put it. -->
90
92
  {#snippet backdrop()}
91
93
  <!-- svelte-ignore a11y_no_static_element_interactions -->
92
- <div class="glim-modal-backdrop" {@attach lift} onmousedown={pressBeside}>
94
+ <div class="glim-modal-backdrop" {@attach lift} {@attach leaveBehind} onmousedown={pressBeside}>
93
95
  <div
94
96
  data-glim="Window"
95
97
  data-glim-title={title}
@@ -15,7 +15,9 @@ export interface WindowProps extends Omit<HTMLAttributes<HTMLDivElement>, "title
15
15
  actions?: WindowAction[];
16
16
  /** A quiet line at the start of the foot, such as where the work carries on. */
17
17
  start?: string | Snippet;
18
- /** `normal` for a question or a form, `wide` for a list, `full` for a tool. */
18
+ /** The width: `small` (400px) for a question, `normal` (560px) for a form,
19
+ * `large` (720px) for a longer form, `wide` (960px) for a list, `full` for
20
+ * a tool. */
19
21
  size?: WindowSize;
20
22
  /** The words of the way out the window adds. */
21
23
  text: {
@@ -1,3 +1,4 @@
1
+ import { type BubbleKind } from "@glimstone/core";
1
2
  export interface TipBubble {
2
3
  /** The trigger the bubble is placed against. */
3
4
  trigger: HTMLElement | null;
@@ -5,11 +6,21 @@ export interface TipBubble {
5
6
  readonly id: string;
6
7
  readonly text: string | undefined;
7
8
  readonly shown: boolean;
9
+ readonly kind: BubbleKind;
10
+ readonly shortcut: string | undefined;
8
11
  /** `aria-describedby` while open, so the bubble is announced as the trigger's description. */
9
12
  readonly describedBy: string | undefined;
13
+ /** Opens a tooltip once the pointer has rested, an info bubble at once. */
10
14
  show: () => void;
11
15
  hide: () => void;
12
16
  /** Focus opens the bubble only when the keyboard was used last; a mouse user gets focus as a side effect. */
13
17
  showOnFocus: () => void;
14
18
  }
15
- export declare function useTipBubble(tip: () => string | undefined, disabled?: () => boolean): TipBubble;
19
+ export interface TipBubbleOptions {
20
+ /** `tip` names a control: small, inverted, once the pointer has rested.
21
+ * `info` explains: roomier, on the floating surface, at once. */
22
+ kind?: BubbleKind;
23
+ /** A keyboard shortcut drawn beside a tooltip's words, such as "Ctrl K". */
24
+ shortcut?: () => string | undefined;
25
+ }
26
+ export declare function useTipBubble(tip: () => string | undefined, disabled?: () => boolean, { kind, shortcut }?: TipBubbleOptions): TipBubble;
@@ -1,7 +1,8 @@
1
- import { dismissBubbleOn, placeBubble, pointerWasLast, trackInputModality } from "@glimstone/core";
1
+ import { dismissBubbleOn, placeBubble, pointerWasLast, restTimer, trackInputModality } from "@glimstone/core";
2
2
  let count = 0;
3
- export function useTipBubble(tip, disabled = () => false) {
3
+ export function useTipBubble(tip, disabled = () => false, { kind = "tip", shortcut = () => undefined } = {}) {
4
4
  let open = $state(false);
5
+ const timer = restTimer(kind);
5
6
  let trigger = $state(null);
6
7
  let bubble = $state(null);
7
8
  const id = `glim-tip-${++count}`;
@@ -19,11 +20,14 @@ export function useTipBubble(tip, disabled = () => false) {
19
20
  trackInputModality();
20
21
  const show = () => {
21
22
  if (text)
22
- open = true;
23
+ timer.rest(() => (open = true));
23
24
  };
24
25
  const hide = () => {
26
+ timer.cancel();
27
+ timer.closed(open);
25
28
  open = false;
26
29
  };
30
+ $effect(() => timer.cancel);
27
31
  // Effects run once the bubble is in the document and before the browser
28
32
  // paints, so it is measured and placed without a visible jump.
29
33
  $effect(() => {
@@ -53,14 +57,18 @@ export function useTipBubble(tip, disabled = () => false) {
53
57
  get shown() {
54
58
  return shown;
55
59
  },
60
+ kind,
61
+ get shortcut() {
62
+ return shortcut();
63
+ },
56
64
  get describedBy() {
57
65
  return shown ? id : undefined;
58
66
  },
59
67
  show,
60
68
  hide,
61
69
  showOnFocus: () => {
62
- if (!pointerWasLast())
63
- show();
70
+ if (text && !pointerWasLast())
71
+ open = true;
64
72
  },
65
73
  };
66
74
  }
@@ -1,4 +1,4 @@
1
- import { type Density, type LabelAxis, type LabelMode, type Motion, type RainbowState, type Shape } from "@glimstone/core";
1
+ import { type Density, type GlyphStyle, type Layout, type LabelAxis, type LabelMode, type Light, type Motion, type RainbowState, type Shape } from "@glimstone/core";
2
2
  export interface Box<T> {
3
3
  current: T;
4
4
  }
@@ -12,6 +12,12 @@ export declare function useHue(index: () => number | undefined): {
12
12
  };
13
13
  export declare function useShape(): Box<Shape>;
14
14
  export declare function useMotion(): Box<Motion>;
15
+ /** How light falls on the stone. */
16
+ export declare function useLight(): Box<Light>;
17
+ /** Whether the glyphs are drawn filled or as lines. */
18
+ export declare function useGlyphs(): Box<GlyphStyle>;
19
+ /** Whether what lies on a card is drawn with cards or without. */
20
+ export declare function useLayout(): Box<Layout>;
15
21
  /** The row density of lists and tables. */
16
22
  export declare function useDensity(): Box<Density>;
17
23
  /** The accent the user chose, or "" for the default. */
@@ -1,4 +1,4 @@
1
- import { applyAccent, applyDensity, applyMotion, applyRainbow, applyShape, DEFAULT_DENSITY, DEFAULT_MOTION, DEFAULT_SHAPE, getLabelMode, hueVars, labelModeChanged, rainbowState, setLabelMode, subscribeLabelMode, subscribeRainbow, } from "@glimstone/core";
1
+ import { applyAccent, applyDensity, applyGlyphs, applyLayout, applyLight, applyMotion, applyRainbow, applyShape, DEFAULT_DENSITY, DEFAULT_GLYPHS, DEFAULT_LAYOUT, DEFAULT_LIGHT, DEFAULT_MOTION, DEFAULT_SHAPE, getLabelMode, hueVars, labelModeChanged, rainbowState, setLabelMode, subscribeLabelMode, subscribeRainbow, } from "@glimstone/core";
2
2
  function follow(read, subscribe, write) {
3
3
  let value = $state(read());
4
4
  $effect(() => subscribe(() => (value = read())));
@@ -47,6 +47,18 @@ export function useShape() {
47
47
  export function useMotion() {
48
48
  return follow(() => document.documentElement.getAttribute("data-motion") ?? DEFAULT_MOTION, watchRoot("data-motion"), applyMotion);
49
49
  }
50
+ /** How light falls on the stone. */
51
+ export function useLight() {
52
+ return follow(() => document.documentElement.getAttribute("data-light") ?? DEFAULT_LIGHT, watchRoot("data-light"), applyLight);
53
+ }
54
+ /** Whether the glyphs are drawn filled or as lines. */
55
+ export function useGlyphs() {
56
+ return follow(() => document.documentElement.getAttribute("data-glyphs") ?? DEFAULT_GLYPHS, watchRoot("data-glyphs"), applyGlyphs);
57
+ }
58
+ /** Whether what lies on a card is drawn with cards or without. */
59
+ export function useLayout() {
60
+ return follow(() => document.documentElement.getAttribute("data-layout") ?? DEFAULT_LAYOUT, watchRoot("data-layout"), applyLayout);
61
+ }
50
62
  /** The row density of lists and tables. */
51
63
  export function useDensity() {
52
64
  return follow(() => document.documentElement.getAttribute("data-density") ?? DEFAULT_DENSITY, watchRoot("data-density"), applyDensity);
@@ -0,0 +1 @@
1
+ export { default as MultiSelect, type MultiSelectProps, type MultiSelectText } from "../MultiSelect.svelte";
@@ -0,0 +1,2 @@
1
+ // Its own entry, so an app that uses none of the Zag controls needs none of the Zag packages.
2
+ export { default as MultiSelect } from "../MultiSelect.svelte";
package/dist/glyphs.d.ts CHANGED
@@ -28,7 +28,10 @@ export declare const IconSearch: Snippet<[]>;
28
28
  export declare const IconForward: Snippet<[]>;
29
29
  export declare const IconUpload: Snippet<[]>;
30
30
  export declare const IconCalendar: Snippet<[]>;
31
+ export declare const IconClock: Snippet<[]>;
31
32
  export declare const IconStar: Snippet<[]>;
33
+ export declare const IconEyedropper: Snippet<[]>;
32
34
  export declare const IconPlay: Snippet<[]>;
33
35
  export declare const IconPause: Snippet<[]>;
34
36
  export declare const IconResetArrow: Snippet<[]>;
37
+ export declare const IconMore: Snippet<[]>;
package/dist/glyphs.js CHANGED
@@ -43,7 +43,10 @@ export const IconSearch = markSnippet(MARKS.search);
43
43
  export const IconForward = markSnippet(MARKS.forward);
44
44
  export const IconUpload = markSnippet(MARKS.upload);
45
45
  export const IconCalendar = markSnippet(MARKS.calendar);
46
+ export const IconClock = markSnippet(MARKS.clock);
46
47
  export const IconStar = markSnippet(MARKS.star);
48
+ export const IconEyedropper = markSnippet(MARKS.eyedropper);
47
49
  export const IconPlay = markSnippet(MARKS.play);
48
50
  export const IconPause = markSnippet(MARKS.pause);
49
51
  export const IconResetArrow = markSnippet(MARKS.resetArrow);
52
+ export const IconMore = markSnippet(MARKS.more);
package/dist/index.d.ts CHANGED
@@ -1,5 +1,4 @@
1
- export { default as AboutCard, type AboutCardProps } from "./AboutCard.svelte";
2
- export { default as Badge, type BadgeForm, type BadgeProps, type BadgeShape, type BadgeSize, type BadgeTone, type NotchInset } from "./Badge.svelte";
1
+ export { default as Badge, type BadgeForm, type BadgeProps, type BadgeSize, type BadgeTone, type NotchInset } from "./Badge.svelte";
3
2
  export { default as BrandMark, type BrandMarkProps } from "./BrandMark.svelte";
4
3
  export { default as BusyRing, type BusyRingProps, type BusyRingSize } from "./BusyRing.svelte";
5
4
  export { default as Button, type ButtonProps, type ButtonSize, type ButtonTone, type ButtonVariant } from "./Button.svelte";
@@ -12,7 +11,6 @@ export { default as ConnectionRow, type ConnectionAction, type ConnectionRowLabe
12
11
  export { default as ContextMenu, type ContextMenuProps, type MenuEntry, type MenuHead, type MenuItem } from "./ContextMenu.svelte";
13
12
  export { default as CopyField, type CopyFieldProps } from "./CopyField.svelte";
14
13
  export { default as CryptoDonateDialog, type CryptoCoin, type CryptoDonateDialogProps, type CryptoNetwork } from "./CryptoDonateDialog.svelte";
15
- export { default as DropdownListbox, type DropdownListboxProps } from "./DropdownListbox.svelte";
16
14
  export { default as EmptyState, type EmptyStateProps } from "./EmptyState.svelte";
17
15
  export { default as FieldError, type FieldErrorProps } from "./FieldError.svelte";
18
16
  export { default as FieldRow, type FieldRowProps } from "./FieldRow.svelte";
@@ -35,10 +33,14 @@ export { default as InfoTile, type InfoTileProps } from "./InfoTile.svelte";
35
33
  export { default as InfoVersionCard, type InfoVersionCardProps, type UpdateCheck, type UpdateRoute, type UpdateState, type VersionCardText, type VersionRow } from "./InfoVersionCard.svelte";
36
34
  export { default as InstanceCard, type InstanceCardProps, type InstanceFigure } from "./InstanceCard.svelte";
37
35
  export { default as Kbd, type KbdProps } from "./Kbd.svelte";
38
- export { default as ListRow, type ListRowProps } from "./ListRow.svelte";
36
+ export { default as ListRow, type ListRowAction, type ListRowMenu, type ListRowProps } from "./ListRow.svelte";
37
+ export type { HoverCardFact, ListRowStatus } from "@glimstone/core";
39
38
  export { default as ListTable, type ListColumn, type ListTableProps, type ListTableText } from "./ListTable.svelte";
40
39
  export { default as MarkSvg } from "./MarkSvg.svelte";
41
40
  export { default as MenuBar, type MenuBarHandle, type MenuBarMenu, type MenuBarProps } from "./MenuBar.svelte";
41
+ export { default as Chart, type ChartProps, type ChartKind, type ChartRow, type ChartSeries } from "./Chart.svelte";
42
+ export { default as ChartLegend, type ChartLegendProps } from "./ChartLegend.svelte";
43
+ export { default as Sparkline, type SparklineProps } from "./Sparkline.svelte";
42
44
  export { default as Meter, type MeterProps, type MeterSize } from "./Meter.svelte";
43
45
  export { default as NumberField, type NumberFieldProps } from "./NumberField.svelte";
44
46
  export { default as PasswordField, type PasswordFieldProps } from "./PasswordField.svelte";
@@ -52,6 +54,7 @@ export { default as ProgressBar, type ProgressBarProps } from "./ProgressBar.sve
52
54
  export { default as ReadmeButton, type ReadmeBrand, type ReadmeButtonProps, type ReadmePart } from "./ReadmeButton.svelte";
53
55
  export { default as RowMark, type RowMarkProps } from "./RowMark.svelte";
54
56
  export { default as Selector, selectorTabId, type SelectMode, type SelectorActivation, type SelectorItem, type SelectorOrientation, type SelectorProps, type SelectorSize, type SelectorVariant } from "./Selector.svelte";
57
+ export { default as SettingsNav, type SettingsNavGroup, type SettingsNavItem, type SettingsNavProps } from "./SettingsNav.svelte";
55
58
  export { default as Sheet, type SheetProps } from "./Sheet.svelte";
56
59
  export { default as SidebarRow, type SidebarCount, type SidebarRowProps } from "./SidebarRow.svelte";
57
60
  export { default as SignInCard, type ResetAnswer, type SignInAnswer, type SignInCardProps, type SignInCardService, type SignInLabelKeys, type SignInText } from "./SignInCard.svelte";
@@ -60,10 +63,13 @@ export { default as SignInReauthWindow, type SignInReauthText, type SignInReauth
60
63
  export { default as SignInTile, type SignInTileCard, type SignInTileLabelKeys, type SignInTileProps, type SignInTileText } from "./SignInTile.svelte";
61
64
  export { default as NotifyCard, type NotifyCardLabelKeys, type NotifyCardProps, type NotifyCardText } from "./NotifyCard.svelte";
62
65
  export { default as SkeletonRow, type SkeletonRowProps } from "./SkeletonRow.svelte";
66
+ export { default as StatusSummary, type StatusNeed, type StatusSummaryProps, type StatusSummaryTone } from "./StatusSummary.svelte";
63
67
  export { default as SubCard, type SubCardProps } from "./SubCard.svelte";
64
68
  export { default as Table, type TableColumn, type TableProps } from "./Table.svelte";
65
69
  export { default as TextArea, type TextAreaProps } from "./TextArea.svelte";
66
70
  export { default as TextField, type FieldWidth, type TextFieldProps } from "./TextField.svelte";
71
+ export { default as TimePicker, type TimePickerProps, type TimePickerText } from "./TimePicker.svelte";
72
+ export { default as TimeRangePicker, type TimeRangePickerProps } from "./TimeRangePicker.svelte";
67
73
  export { default as ToastCard, type ToastCardProps } from "./ToastCard.svelte";
68
74
  export { default as ToastViewport, type ToastViewportEntry, type ToastViewportProps } from "./ToastViewport.svelte";
69
75
  export { default as Toggle, type ToggleProps } from "./Toggle.svelte";
@@ -71,13 +77,13 @@ export { default as Tree, type TreeNode, type TreeProps } from "./Tree.svelte";
71
77
  export { default as UnavailableNotice, type UnavailableNoticeProps } from "./UnavailableNotice.svelte";
72
78
  export { default as Window, type WindowAction, type WindowProps, type WindowSize } from "./Window.svelte";
73
79
  export { default as WindowBar, type WindowBarProps } from "./WindowBar.svelte";
74
- export { useAccent, useDensity, useHue, useLabelMode, useMotion, useRainbow, useShape } from "./engines.svelte.js";
80
+ export { useAccent, useDensity, useGlyphs, useHue, useLabelMode, useLayout, useLight, useMotion, useRainbow, useShape } from "./engines.svelte.js";
75
81
  export { useConfirm, useDialogKeys, type ConfirmOptions, type ConfirmText } from "./confirm.svelte.js";
76
82
  export { useFieldName } from "./fieldName.js";
77
83
  export { deviceGlyph } from "./fortressParts.js";
78
- export { glyphFor, IconBack, IconCalendar, IconCancel, IconCheck, IconClose, IconCopy, IconExpand, IconEye, IconEyeOff, IconFolderOpen, IconForward, IconPause, IconPencil, IconPlay, IconResetArrow, IconSearch, IconStar, IconTrash, IconUpload, IconWindowMaximise, IconWindowMinimise, IconWindowRestore, setGlyphResolver } from "./glyphs.js";
84
+ export { glyphFor, IconBack, IconCalendar, IconCancel, IconClock, IconCheck, IconClose, IconCopy, IconExpand, IconEye, IconEyeOff, IconFolderOpen, IconForward, IconMore, IconPause, IconPencil, IconPlay, IconResetArrow, IconSearch, IconStar, IconTrash, IconUpload, IconWindowMaximise, IconWindowMinimise, IconWindowRestore, setGlyphResolver } from "./glyphs.js";
79
85
  export * from "./portalHue.svelte.js";
80
- export { useTipBubble, type TipBubble } from "./bubble.svelte.js";
86
+ export { useTipBubble, type TipBubble, type TipBubbleOptions } from "./bubble.svelte.js";
81
87
  export * from "./useDragArmed.svelte.js";
82
88
  export { usePaypalButtons, type PaypalButtonsOptions } from "./usePaypalButtons.svelte.js";
83
89
  export type { ToastAction } from "@glimstone/core";
package/dist/index.js CHANGED
@@ -1,4 +1,3 @@
1
- export { default as AboutCard } from "./AboutCard.svelte";
2
1
  export { default as Badge } from "./Badge.svelte";
3
2
  export { default as BrandMark } from "./BrandMark.svelte";
4
3
  export { default as BusyRing } from "./BusyRing.svelte";
@@ -12,7 +11,6 @@ export { default as ConnectionRow } from "./ConnectionRow.svelte";
12
11
  export { default as ContextMenu } from "./ContextMenu.svelte";
13
12
  export { default as CopyField } from "./CopyField.svelte";
14
13
  export { default as CryptoDonateDialog } from "./CryptoDonateDialog.svelte";
15
- export { default as DropdownListbox } from "./DropdownListbox.svelte";
16
14
  export { default as EmptyState } from "./EmptyState.svelte";
17
15
  export { default as FieldError } from "./FieldError.svelte";
18
16
  export { default as FieldRow } from "./FieldRow.svelte";
@@ -39,6 +37,9 @@ export { default as ListRow } from "./ListRow.svelte";
39
37
  export { default as ListTable } from "./ListTable.svelte";
40
38
  export { default as MarkSvg } from "./MarkSvg.svelte";
41
39
  export { default as MenuBar } from "./MenuBar.svelte";
40
+ export { default as Chart } from "./Chart.svelte";
41
+ export { default as ChartLegend } from "./ChartLegend.svelte";
42
+ export { default as Sparkline } from "./Sparkline.svelte";
42
43
  export { default as Meter } from "./Meter.svelte";
43
44
  export { default as NumberField } from "./NumberField.svelte";
44
45
  export { default as PasswordField } from "./PasswordField.svelte";
@@ -52,6 +53,7 @@ export { default as ProgressBar } from "./ProgressBar.svelte";
52
53
  export { default as ReadmeButton } from "./ReadmeButton.svelte";
53
54
  export { default as RowMark } from "./RowMark.svelte";
54
55
  export { default as Selector, selectorTabId } from "./Selector.svelte";
56
+ export { default as SettingsNav } from "./SettingsNav.svelte";
55
57
  export { default as Sheet } from "./Sheet.svelte";
56
58
  export { default as SidebarRow } from "./SidebarRow.svelte";
57
59
  export { default as SignInCard } from "./SignInCard.svelte";
@@ -60,10 +62,13 @@ export { default as SignInReauthWindow } from "./SignInReauthWindow.svelte";
60
62
  export { default as SignInTile } from "./SignInTile.svelte";
61
63
  export { default as NotifyCard } from "./NotifyCard.svelte";
62
64
  export { default as SkeletonRow } from "./SkeletonRow.svelte";
65
+ export { default as StatusSummary } from "./StatusSummary.svelte";
63
66
  export { default as SubCard } from "./SubCard.svelte";
64
67
  export { default as Table } from "./Table.svelte";
65
68
  export { default as TextArea } from "./TextArea.svelte";
66
69
  export { default as TextField } from "./TextField.svelte";
70
+ export { default as TimePicker } from "./TimePicker.svelte";
71
+ export { default as TimeRangePicker } from "./TimeRangePicker.svelte";
67
72
  export { default as ToastCard } from "./ToastCard.svelte";
68
73
  export { default as ToastViewport } from "./ToastViewport.svelte";
69
74
  export { default as Toggle } from "./Toggle.svelte";
@@ -71,11 +76,11 @@ export { default as Tree } from "./Tree.svelte";
71
76
  export { default as UnavailableNotice } from "./UnavailableNotice.svelte";
72
77
  export { default as Window } from "./Window.svelte";
73
78
  export { default as WindowBar } from "./WindowBar.svelte";
74
- export { useAccent, useDensity, useHue, useLabelMode, useMotion, useRainbow, useShape } from "./engines.svelte.js";
79
+ export { useAccent, useDensity, useGlyphs, useHue, useLabelMode, useLayout, useLight, useMotion, useRainbow, useShape } from "./engines.svelte.js";
75
80
  export { useConfirm, useDialogKeys } from "./confirm.svelte.js";
76
81
  export { useFieldName } from "./fieldName.js";
77
82
  export { deviceGlyph } from "./fortressParts.js";
78
- export { glyphFor, IconBack, IconCalendar, IconCancel, IconCheck, IconClose, IconCopy, IconExpand, IconEye, IconEyeOff, IconFolderOpen, IconForward, IconPause, IconPencil, IconPlay, IconResetArrow, IconSearch, IconStar, IconTrash, IconUpload, IconWindowMaximise, IconWindowMinimise, IconWindowRestore, setGlyphResolver } from "./glyphs.js";
83
+ export { glyphFor, IconBack, IconCalendar, IconCancel, IconClock, IconCheck, IconClose, IconCopy, IconExpand, IconEye, IconEyeOff, IconFolderOpen, IconForward, IconMore, IconPause, IconPencil, IconPlay, IconResetArrow, IconSearch, IconStar, IconTrash, IconUpload, IconWindowMaximise, IconWindowMinimise, IconWindowRestore, setGlyphResolver } from "./glyphs.js";
79
84
  export * from "./portalHue.svelte.js";
80
85
  export { useTipBubble } from "./bubble.svelte.js";
81
86
  export * from "./useDragArmed.svelte.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glimstone/svelte",
3
- "version": "4.9.1",
3
+ "version": "5.0.0",
4
4
  "description": "GlimStone's components for Svelte",
5
5
  "license": "AGPL-3.0-only",
6
6
  "repository": {
@@ -28,6 +28,11 @@
28
28
  "svelte": "./dist/entries/combobox.js",
29
29
  "default": "./dist/entries/combobox.js"
30
30
  },
31
+ "./MultiSelect": {
32
+ "types": "./dist/entries/multiselect.d.ts",
33
+ "svelte": "./dist/entries/multiselect.js",
34
+ "default": "./dist/entries/multiselect.js"
35
+ },
31
36
  "./Slider": {
32
37
  "types": "./dist/entries/slider.d.ts",
33
38
  "svelte": "./dist/entries/slider.js",
@@ -141,7 +146,7 @@
141
146
  "build": "svelte-package -i src -o dist"
142
147
  },
143
148
  "dependencies": {
144
- "@glimstone/core": "4.9.1"
149
+ "@glimstone/core": "5.0.0"
145
150
  },
146
151
  "peerDependencies": {
147
152
  "@internationalized/date": "^3.12.4",
@@ -1,116 +0,0 @@
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
- discordButton?: string;
15
- mailButton: string;
16
- mailSubject: string;
17
- version: string;
18
- unreleased: (version: string) => string;
19
- /** The Help card's heading. Without it the card draws none. */
20
- helpTitle?: string;
21
- };
22
- version: string | null;
23
- glimstoneVersion: string;
24
- repoUrl: string;
25
- repoGlyph?: Snippet;
26
- glimstoneRepoUrl: string;
27
- onCoffee: () => void;
28
- coffeeArt: Snippet;
29
- cryptoGlyph?: Snippet;
30
- paypalGlyph?: Snippet;
31
- onPaypal?: () => void;
32
- onCrypto?: () => void;
33
- discordUrl?: string;
34
- discordGlyph?: Snippet;
35
- mailAddress?: string;
36
- mailGlyph?: Snippet;
37
- openUrl?: (url: string) => void;
38
- hueIndex?: number;
39
- }
40
- </script>
41
-
42
- <script lang="ts">
43
- import { openInBrowser, versionLink, warnDeprecated, type VersionRow } from "@glimstone/core";
44
- import Card from "./Card.svelte";
45
- import InfoAboutCard from "./InfoAboutCard.svelte";
46
- import InfoHelpCard from "./InfoHelpCard.svelte";
47
-
48
- // The 3.2.0 props of the single About card, laid out as the Info tile: the
49
- // About card under `text.title`, the Version card under `text.version` with
50
- // the app and GlimStone as its rows, and the Help card. Deprecated for
51
- // InfoTile, which adds the update state, the components and the bug report.
52
- let {
53
- text,
54
- version,
55
- glimstoneVersion,
56
- repoUrl,
57
- repoGlyph,
58
- glimstoneRepoUrl,
59
- onCoffee,
60
- coffeeArt,
61
- cryptoGlyph,
62
- paypalGlyph,
63
- onPaypal,
64
- onCrypto,
65
- discordUrl,
66
- discordGlyph,
67
- mailAddress,
68
- mailGlyph,
69
- openUrl = openInBrowser,
70
- hueIndex,
71
- }: AboutCardProps = $props();
72
- warnDeprecated("AboutCard");
73
-
74
- const rows: VersionRow[] = $derived([
75
- ...(version ? [{ name: text.version, version, repoUrl }] : []),
76
- { name: "GlimStone", version: glimstoneVersion, repoUrl: glimstoneRepoUrl },
77
- ]);
78
- const at = (offset: number) => (hueIndex === undefined ? undefined : hueIndex + offset);
79
- </script>
80
-
81
- <div data-glim="AboutCard" style="display: contents">
82
- <Card title={text.version} hueIndex={at(0)}>
83
- <ul class="glim-version-rows">
84
- {#each rows as row (row.name)}
85
- {@const link = versionLink(row)}
86
- <li class="glim-version-row">
87
- <span class="glim-version-name"><span class="glim-version-part">{row.name}</span></span>
88
- {#if link.href}
89
- <a href={link.href} target="_blank" rel="noopener noreferrer" class="glim-num glim-version-number">{link.shown}</a>
90
- {:else}
91
- <span class="glim-num glim-version-number">{link.released ? link.shown : text.unreleased(link.shown)}</span>
92
- {/if}
93
- </li>
94
- {/each}
95
- </ul>
96
- </Card>
97
- <InfoHelpCard
98
- hueIndex={at(1)}
99
- text={{
100
- title: text.helpTitle,
101
- report: text.report,
102
- repoButton: text.repoButton,
103
- discordButton: text.discordButton,
104
- mailButton: text.mailButton,
105
- mailSubject: text.mailSubject,
106
- }}
107
- {repoUrl}
108
- {repoGlyph}
109
- {discordUrl}
110
- {discordGlyph}
111
- {mailAddress}
112
- {mailGlyph}
113
- {openUrl}
114
- />
115
- <InfoAboutCard hueIndex={at(2)} {text} {onCoffee} {coffeeArt} {onPaypal} {paypalGlyph} {onCrypto} {cryptoGlyph} />
116
- </div>