@knpkv/rly 0.13.0 → 0.15.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 (51) hide show
  1. package/README.md +73 -1
  2. package/dist/{Dialog-B9Ub_gMT.js → Dialog-CU66FqWD.js} +325 -257
  3. package/dist/Dialog-CU66FqWD.js.map +1 -0
  4. package/dist/{PortalProvider-CN_81Fy3.js → PortalProvider-op07u8na.js} +20 -18
  5. package/dist/PortalProvider-op07u8na.js.map +1 -0
  6. package/dist/assets/relay-mark.svg +9 -0
  7. package/dist/components.css +1 -1
  8. package/dist/dts/foundations/Icon.d.ts +1 -1
  9. package/dist/dts/foundations/Icon.d.ts.map +1 -1
  10. package/dist/dts/internal/composedFocus.d.ts +11 -0
  11. package/dist/dts/internal/composedFocus.d.ts.map +1 -0
  12. package/dist/dts/internal/relaySummon.d.ts +50 -0
  13. package/dist/dts/internal/relaySummon.d.ts.map +1 -0
  14. package/dist/dts/patterns/Region.d.ts +2 -2
  15. package/dist/dts/patterns/Region.d.ts.map +1 -1
  16. package/dist/dts/patterns/RelayComposer.d.ts +65 -0
  17. package/dist/dts/patterns/RelayComposer.d.ts.map +1 -0
  18. package/dist/dts/patterns/RelayDock.d.ts.map +1 -1
  19. package/dist/dts/patterns/RelayLauncher.d.ts +67 -0
  20. package/dist/dts/patterns/RelayLauncher.d.ts.map +1 -0
  21. package/dist/dts/patterns/RelayMark.d.ts +35 -0
  22. package/dist/dts/patterns/RelayMark.d.ts.map +1 -0
  23. package/dist/dts/patterns/RelayPanel.d.ts +91 -0
  24. package/dist/dts/patterns/RelayPanel.d.ts.map +1 -0
  25. package/dist/dts/patterns/index.d.ts +8 -0
  26. package/dist/dts/patterns/index.d.ts.map +1 -1
  27. package/dist/dts/tokens/fonts.d.ts +13 -0
  28. package/dist/dts/tokens/fonts.d.ts.map +1 -0
  29. package/dist/dts/tokens/index.d.ts +2 -0
  30. package/dist/dts/tokens/index.d.ts.map +1 -1
  31. package/dist/fonts.css +83 -2
  32. package/dist/foundations/index.js +1 -1
  33. package/dist/generated-tokens.css +2 -2
  34. package/dist/index.js +6 -6
  35. package/dist/patterns/index.js +2 -2
  36. package/dist/{patterns-DPd5YlSW.js → patterns-CDBnXTUD.js} +1258 -756
  37. package/dist/patterns-CDBnXTUD.js.map +1 -0
  38. package/dist/primitives/index.js +3 -3
  39. package/dist/{primitives-Bd6WhE78.js → primitives-DgQybTyq.js} +254 -322
  40. package/dist/primitives-DgQybTyq.js.map +1 -0
  41. package/dist/tokens/index.js +2 -2
  42. package/dist/{tokens-B075JP3Z.js → tokens-Cf0jXIRg.js} +14 -8
  43. package/dist/tokens-Cf0jXIRg.js.map +1 -0
  44. package/package.json +2 -1
  45. package/registry/components.json +373 -0
  46. package/registry/search.json +88 -0
  47. package/dist/Dialog-B9Ub_gMT.js.map +0 -1
  48. package/dist/PortalProvider-CN_81Fy3.js.map +0 -1
  49. package/dist/patterns-DPd5YlSW.js.map +0 -1
  50. package/dist/primitives-Bd6WhE78.js.map +0 -1
  51. package/dist/tokens-B075JP3Z.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  import type { ReactElement } from "react";
2
2
  /** Stable, presentation-only glyph names supported by rly. */
3
- export declare const RLY_ICON_NAMES: readonly ["arrow-down", "arrow-left", "arrow-right", "arrow-up", "check", "chevron-down", "chevron-left", "chevron-right", "chevron-up", "alert", "clock", "external-link", "file", "link", "loader", "menu", "minus", "plus", "search", "user", "close"];
3
+ export declare const RLY_ICON_NAMES: readonly ["arrow-down", "arrow-left", "arrow-right", "arrow-up", "check", "chevron-down", "chevron-left", "chevron-right", "chevron-up", "alert", "clock", "external-link", "file", "link", "loader", "menu", "minus", "plus", "search", "user", "close", "pin"];
4
4
  /** A stable glyph name owned by rly rather than its icon implementation. */
5
5
  export type RlyIconName = (typeof RLY_ICON_NAMES)[number];
6
6
  /** Machine-readable icon size variants. */
@@ -1 +1 @@
1
- {"version":3,"file":"Icon.d.ts","sourceRoot":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IAAI,UAAW,SAAS,KAAG,YAuBvC,CAAA"}
@@ -0,0 +1,11 @@
1
+ interface ShadowRootHost extends Node {
2
+ readonly host: Element;
3
+ }
4
+ export declare const hasShadowRootHost: (value: Node) => value is ShadowRootHost;
5
+ export declare const activeElementFor: (panel: HTMLElement) => Element | null;
6
+ export declare const composedParentFor: (node: Node, composedParents?: ReadonlyMap<Node, Node | null>) => Element | null;
7
+ export declare const isWithinComposedElement: (ancestor: Element, descendant: Node | null, composedParents?: ReadonlyMap<Node, Node | null>) => boolean;
8
+ export declare const isWithinPanel: (panel: HTMLElement, active: Element | null) => boolean;
9
+ export declare const focusRestoreTarget: (ownerDocument: Document) => HTMLElement | null;
10
+ export {};
11
+ //# sourceMappingURL=composedFocus.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"composedFocus.d.ts","sourceRoot":"","sources":["../../../src/internal/composedFocus.ts"],"names":[],"mappings":"AAMA,UAAU,cAAe,SAAQ,IAAI;IACnC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;CACvB;AAED,eAAO,MAAM,iBAAiB,UAAW,IAAI,KAAG,KAAK,IAAI,cACC,CAAA;AAS1D,eAAO,MAAM,gBAAgB,UAAW,WAAW,KAAG,OAAO,GAAG,IAG/D,CAAA;AAgBD,eAAO,MAAM,iBAAiB,SAAU,IAAI,oBAAoB,WAAW,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC,KAAG,OAAO,GAAG,IAO1G,CAAA;AAED,eAAO,MAAM,uBAAuB,aACxB,OAAO,cACL,IAAI,GAAG,IAAI,oBACL,WAAW,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC,KAC/C,OAaF,CAAA;AAED,eAAO,MAAM,aAAa,UAAW,WAAW,UAAU,OAAO,GAAG,IAAI,KAAG,OACnC,CAAA;AAQxC,eAAO,MAAM,kBAAkB,kBAAmB,QAAQ,KAAG,WAAW,GAAG,IAG1E,CAAA"}
@@ -0,0 +1,50 @@
1
+ /** A key the summon machine listens for: the bound chord (Ctrl/⌘+J) or Escape. */
2
+ export type RelaySummonKey = "chord" | "escape";
3
+ /** What the machine needs to know at the moment a key arrives. */
4
+ export interface RelaySummonContext {
5
+ readonly open: boolean;
6
+ /** Focus is inside the Relay region. */
7
+ readonly focusInRelay: boolean;
8
+ /** Relay is a full-screen dialog (phone), where the chord and Escape both close it. */
9
+ readonly fullscreen: boolean;
10
+ }
11
+ /**
12
+ * What a key does (Relay UX decision): closed → Open (focus the composer); open with focus on the page →
13
+ * FocusComposer; open with focus in Relay → ReturnFocus (back to where you were, Relay stays open);
14
+ * full screen, the chord closes. Escape closes when focus is in Relay or Relay is full screen, and is
15
+ * left to the page otherwise. Ignore means the event is not handled and must not be prevented.
16
+ */
17
+ export type RelaySummonEffect = "Open" | "FocusComposer" | "ReturnFocus" | "Close" | "Ignore";
18
+ export declare const relaySummonTransition: (context: RelaySummonContext, key: RelaySummonKey) => RelaySummonEffect;
19
+ /** The parts of a keyboard event the summon reads. */
20
+ export interface RelaySummonKeyEvent {
21
+ readonly altKey: boolean;
22
+ readonly code: string;
23
+ readonly ctrlKey: boolean;
24
+ readonly isComposing: boolean;
25
+ readonly key: string;
26
+ /** Deprecated, but 229 is still how some browsers mark a key that belongs to an IME. */
27
+ readonly keyCode: number;
28
+ readonly metaKey: boolean;
29
+ readonly repeat: boolean;
30
+ readonly shiftKey: boolean;
31
+ }
32
+ /** A key that belongs to an IME composition; Escape there cancels the composition, never Relay. */
33
+ export declare const isImeKey: (event: RelaySummonKeyEvent) => boolean;
34
+ /**
35
+ * Whether an event is exactly the shortcut's ARIA keys ("Control+J", "Meta+J"): the named modifiers and
36
+ * no others, so Ctrl+Shift+J, Alt chords, an IME composition or a held key's repeats never match. A
37
+ * Latin layout matches the letter the user sees (Dvorak, AZERTY); a non-Latin one (Russian, Greek), where
38
+ * the key is no ASCII letter, matches the physical key instead.
39
+ */
40
+ export declare const matchesShortcutKeys: (keys: string, event: RelaySummonKeyEvent) => boolean;
41
+ /**
42
+ * Whether a key event belongs to a layer nested in or opened from Relay: a dialog, a listbox or menu
43
+ * while it is an open popup (Radix's data-state, or the target of an expanded aria-controls), or an
44
+ * expanded popup controller inside Relay that keeps focus while its popup is open (a combobox). It reads
45
+ * the event's composed path up to Relay's region, so layers inside shadow roots and layers portaled out
46
+ * of Relay (whose path never reaches the region) count. Relay's own surface, marked
47
+ * data-rly-relay-surface (the full-screen dialog), and always-rendered lists never count.
48
+ */
49
+ export declare const hasNestedLayer: (region: HTMLElement | null, path: ReadonlyArray<EventTarget>) => boolean;
50
+ //# sourceMappingURL=relaySummon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relaySummon.d.ts","sourceRoot":"","sources":["../../../src/internal/relaySummon.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,QAAQ,CAAA;AAE/C,kEAAkE;AAClE,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;IACtB,wCAAwC;IACxC,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAA;IAC9B,uFAAuF;IACvF,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAA;CAC7B;AAED;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,eAAe,GAAG,aAAa,GAAG,OAAO,GAAG,QAAQ,CAAA;AAE7F,eAAO,MAAM,qBAAqB,YAAa,kBAAkB,OAAO,cAAc,KAAG,iBAKxF,CAAA;AAED,sDAAsD;AACtD,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAA;IAC7B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,wFAAwF;IACxF,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;IACxB,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAA;CAC3B;AAED,mGAAmG;AACnG,eAAO,MAAM,QAAQ,UAAW,mBAAmB,KAAG,OAAqD,CAAA;AAI3G;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,SAAU,MAAM,SAAS,mBAAmB,KAAG,OAe9E,CAAA;AAKD;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,WAAY,WAAW,GAAG,IAAI,QAAQ,aAAa,CAAC,WAAW,CAAC,KAAG,OAU7F,CAAA"}
@@ -9,8 +9,8 @@ export declare const RLY_REGION_VARIANTS: {
9
9
  };
10
10
  readonly tray: {
11
11
  readonly className: string;
12
- readonly purpose: "A region holding individually actionable cards, one surface step down so the cards stand out";
13
- readonly tokens: readonly ["color-surface-2", "color-border-1"];
12
+ readonly purpose: "A region holding individually actionable cards; its body sits one surface step down so the cards stand out, under the same header as every region";
13
+ readonly tokens: readonly ["color-surface-1", "color-surface-2", "color-border-1"];
14
14
  };
15
15
  };
16
16
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Region.d.ts","sourceRoot":"","sources":["../../../src/patterns/Region.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,qBAAqB,EAAE,KAAK,YAAY,EAAE,KAAK,SAAS,EAAS,MAAM,OAAO,CAAA;AAM5F,qDAAqD;AACrD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;CAa9B,CAAA;AAEF,8BAA8B;AAC9B,eAAO,MAAM,2BAA2B;;CAAsC,CAAA;AAE9E,8DAA8D;AAC9D,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,mBAAmB,CAAC,IAAI,CAAA;AAEjE,oEAAoE;AACpE,MAAM,MAAM,qBAAqB,GAAG,CAAC,GAAG,CAAC,CAAA;AAEzC,sCAAsC;AACtC,MA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AC,OAAO,CAAC,EAAE,SAAS,CAAA;IAC5B,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAA;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAChC,4DAA4D;IAC5D,QAAQ,CAAC,YAAY,CAAC,EAAE,qBAAqB,CAAA;IAC7C;;;OAGG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B,+CAA+C;IAC/C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,2CAA2C;IAC3C,QAAQ,CAAC,IAAI,CAAC,EAAE,aAAa,CAAA;CAC9B,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,MAAM,4FAUhB,WAAW,KAAG,YA2BhB,CAAA"}
@@ -0,0 +1,65 @@
1
+ import type { ReactElement, ReactNode, Ref } from "react";
2
+ /** Something the message is about, shown as a removable chip ("patch-reader.ts lines 14 to 19"). */
3
+ export interface RlyRelayContextRef {
4
+ readonly id: string;
5
+ readonly label: string;
6
+ }
7
+ /** One accepted-message request: the text and the client request id a retry must reuse. */
8
+ export interface RlyRelaySubmission {
9
+ readonly requestId: string;
10
+ readonly text: string;
11
+ }
12
+ /** Inputs for the composer. */
13
+ export interface RelayComposerProps {
14
+ /** Why Send is unavailable (a run in flight); shown, and announced with Send. */
15
+ readonly busyReason?: string | undefined;
16
+ readonly contextRefs?: ReadonlyArray<RlyRelayContextRef>;
17
+ /** The textarea's name, "Message Relay" unless the host names it. */
18
+ readonly label?: string;
19
+ readonly onRemoveContextRef?: (id: string) => void;
20
+ /** Called with Ctrl/⌘+Enter or Send when there is text and nothing blocks it. */
21
+ readonly onSend: () => void;
22
+ /** Stop the run; pass it only while a run is in flight and the session offers cancel. */
23
+ readonly onStop?: (() => void) | undefined;
24
+ readonly onValueChange: (value: string) => void;
25
+ readonly placeholder?: string;
26
+ /** One run preset control, usually a menu trigger ("Thorough review, Codex"). */
27
+ readonly preset?: ReactNode;
28
+ /** The textarea, for useRelaySummon's composerRef. */
29
+ readonly ref?: Ref<HTMLTextAreaElement>;
30
+ readonly value: string;
31
+ }
32
+ /**
33
+ * Relay's message box (Relay UX decision). It grows with its text up to min(12 lines, 40% of the
34
+ * viewport), then scrolls. Enter is a newline and Ctrl/⌘+Enter sends, said as visible text beside Send;
35
+ * an IME composition never sends. While `busyReason` is set, Send stays focusable (aria-disabled) so
36
+ * its reason is heard, and pressing it does nothing. Keep the value with `useRelayDraft`, keyed by the
37
+ * object Relay is about, so it survives closing, reopening and resizing.
38
+ */
39
+ export declare const RelayComposer: ({ busyReason, contextRefs, label, onRemoveContextRef, onSend, onStop, onValueChange, placeholder, preset, ref, value }: RelayComposerProps) => ReactElement;
40
+ /** A per-object draft: the value for the composer and the submission a send makes. */
41
+ export interface RlyRelayDraft {
42
+ /** The request with this id was accepted: clear the draft, unless the user has typed since. */
43
+ readonly accepted: (requestId: string) => void;
44
+ readonly onValueChange: (value: string) => void;
45
+ /** The current text with a request id that stays the same until the text changes or is accepted. */
46
+ readonly submission: () => RlyRelaySubmission;
47
+ readonly value: string;
48
+ }
49
+ /** Storage a draft may survive a reload in; session storage, never local storage (drafts may be sensitive). */
50
+ export type RlyRelayDraftStorage = Pick<Storage, "getItem" | "removeItem" | "setItem">;
51
+ /** Inputs for {@link useRelayDraft}. */
52
+ export interface UseRelayDraftOptions {
53
+ /** Mints a client request id (the host's own, e.g. a UUID from its runtime); rly owns no id source. */
54
+ readonly newRequestId: () => string;
55
+ /** Opt in to surviving a reload; read lazily, and any refusal keeps the draft in memory only. */
56
+ readonly storage?: () => RlyRelayDraftStorage;
57
+ }
58
+ /**
59
+ * The composer's draft for one object (the JSON ObjectRef, so PR A's draft can never send as PR B's).
60
+ * It lives in memory for the page, so closing, reopening or resizing Relay keeps it; with `storage`
61
+ * (session storage) it also survives a reload. A send reuses one request id until the text is edited,
62
+ * so a retry after an uncertain outcome is deduplicated and an edited message is a new one.
63
+ */
64
+ export declare const useRelayDraft: (objectKey: string, options: UseRelayDraftOptions) => RlyRelayDraft;
65
+ //# sourceMappingURL=RelayComposer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RelayComposer.d.ts","sourceRoot":"","sources":["../../../src/patterns/RelayComposer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAoD,YAAY,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAY3G,oGAAoG;AACpG,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CACvB;AAED,2FAA2F;AAC3F,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CACtB;AAED,+BAA+B;AAC/B,MAAM,WAAW,kBAAkB;IACjC,iFAAiF;IACjF,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACxC,QAAQ,CAAC,WAAW,CAAC,EAAE,aAAa,CAAC,kBAAkB,CAAC,CAAA;IACxD,qEAAqE;IACrE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,kBAAkB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IAClD,iFAAiF;IACjF,QAAQ,CAAC,MAAM,EAAE,MAAM,IAAI,CAAA;IAC3B,yFAAyF;IACzF,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAA;IAC1C,QAAQ,CAAC,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAC/C,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;IAC7B,iFAAiF;IACjF,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,CAAA;IAC3B,sDAAs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AW,CAAC,EAAE,KAAK,CAAA;IAC5B,QAAQ,CAAC,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IAC9C,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;CACvB,CAAA;AAED,KAAK,qBAAqB,GAAG,kBAAkB,GAAG;IAChD,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAA;IAC9B,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IAC/C,QAAQ,CAAC,IAAI,CAAC,EAAE,KAAK,CAAA;CACtB,CAAA;AAED,yEAAyE;AACzE,MAAM,MAAM,cAAc,GAAG,wBAAwB,GAAG,qBAAqB,CAAA;AAuW7E;;;GAGG;AACH,eAAO,MAAM,SAAS,mBAAoB,cAAc,KAAG,YAoG1D,CAAA"}
@@ -0,0 +1,67 @@
1
+ import type { ComponentPropsWithRef, ReactElement, RefCallback, RefObject } from "react";
2
+ /** The keyboard shortcut a launcher advertises: the visible hint and its `aria-keyshortcuts` value. */
3
+ export interface RlyRelayShortcut {
4
+ /** Shown beside the label on wider screens, for example "⌘J" or "Ctrl J". */
5
+ readonly hint: string;
6
+ /** The ARIA form, for example "Meta+J" or "Control+J". */
7
+ readonly keys: string;
8
+ }
9
+ /** Relay's summon shortcut (Ctrl/⌘+J) as a platform shows it. */
10
+ export declare const relayShortcut: (apple: boolean) => RlyRelayShortcut;
11
+ /**
12
+ * Ctrl/⌘+J for the browser's platform, for a host that binds it. The server renders the non-Apple
13
+ * form and an Apple browser switches to ⌘ after hydration without a mismatch. A host that binds the
14
+ * key must also prevent the browser's own Ctrl+J (Downloads in Chrome on Windows and Linux).
15
+ */
16
+ export declare const useRelayShortcut: () => RlyRelayShortcut;
17
+ /** Inputs for {@link useRelaySummon}. */
18
+ export interface UseRelaySummonOptions {
19
+ readonly open: boolean;
20
+ readonly onOpenChange: (open: boolean) => void;
21
+ /** Relay is the full-screen dialog (phone): the shortcut closes it. */
22
+ readonly fullscreen: boolean;
23
+ /** The launcher: where focus returns when the element Relay was summoned from is gone. */
24
+ readonly launcher: RefObject<HTMLElement | null>;
25
+ /**
26
+ * The shortcut to listen for, the same value the launcher advertises; `null` while the host's own
27
+ * surface owns the key (a live terminal). Escape inside Relay keeps working either way.
28
+ */
29
+ readonly shortcut: RlyRelayShortcut | null;
30
+ }
31
+ /** Refs a host attaches so the summon knows Relay's region and composer. */
32
+ export interface RlyRelaySummon {
33
+ /** Attach to the composer; a pending summon focuses it as soon as it mounts, however late. */
34
+ readonly composerRef: RefCallback<HTMLElement>;
35
+ /** Attach to Relay's region (RelayPanel's `ref`); focus inside it counts as being in Relay. */
36
+ readonly regionRef: RefCallback<HTMLElement>;
37
+ }
38
+ /**
39
+ * Relay's keyboard summon (Relay UX decision). The shortcut opens Relay and focuses the composer; open
40
+ * with focus on the page, it moves focus to the composer; open with focus in Relay, it returns focus to
41
+ * where it came from and Relay stays open; full screen, it closes. Escape closes when focus is in Relay
42
+ * or Relay is full screen, and focus returns once Relay has actually closed (after a modal has released
43
+ * the page). Only the exact chord is handled and prevented, so Ctrl+K, `?`, g-sequences and the browser's
44
+ * other keys pass through. It listens on the launcher's document and on Relay's, if Relay is portaled
45
+ * into another (an iframe).
46
+ */
47
+ export declare const useRelaySummon: (options: UseRelaySummonOptions) => RlyRelaySummon;
48
+ /** Inputs for the launcher. */
49
+ export type RelayLauncherProps = Omit<ComponentPropsWithRef<"button">, "children" | "type"> & {
50
+ /** Whether Relay is open; announced as the button's expanded state. */
51
+ readonly expanded: boolean;
52
+ /** The visible name, "Relay" unless the host names its Relay more specifically. */
53
+ readonly label?: string;
54
+ /**
55
+ * The shortcut the host actually binds, usually `useRelayShortcut()`, or `null` when it binds none
56
+ * (a live terminal that keeps its own chords). Required, so a launcher never advertises a key that
57
+ * does nothing.
58
+ */
59
+ readonly shortcut: RlyRelayShortcut | null;
60
+ };
61
+ /**
62
+ * The header button that opens and closes Relay: its mark, a label and the shortcut hint. It sits in
63
+ * the host's header like any other control, never fixed over the page. The hint hides on narrow
64
+ * screens, and the button stays 32px tall (44px for a coarse pointer).
65
+ */
66
+ export declare const RelayLauncher: ({ className, expanded, label, shortcut, ...props }: RelayLauncherProps) => ReactElement;
67
+ //# sourceMappingURL=RelayLauncher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RelayLauncher.d.ts","sourceRoot":"","sources":["../../../src/patterns/RelayLauncher.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAUxF,uGAAuG;AACvG,MAAM,WAAW,gBAAgB;IAC/B,6EAA6E;IAC7E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,0DAA0D;IAC1D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CACtB;AAED,iEAAiE;AACjE,eAAO,MAAM,aAAa,UAAW,OAAO,KAAG,gBACiC,CAAA;AAShF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,QAAO,gBAC+C,CAAA;AAEnF,yCAAyC;AACzC,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;IACtB,QAAQ,CAAC,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IAC9C,uEAAuE;IACvE,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAA;IAC5B,0FAA0F;IAC1F,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAA;IAChD;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,GAAG,IAAI,CAAA;CAC3C;AAED,4EAA4E;AAC5E,MAAM,WAAW,cAAc;IAC7B,8FAA8F;IAC9F,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC,WAAW,CAAC,CAAA;IAC9C,+FAA+F;IAC/F,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC,WAAW,CAAC,CAAA;CAC7C;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,YAAa,qBAAqB,KAAG,cAmH/D,CAAA;AAWD,+BAA+B;AAC/B,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,qBAAqB,CAAC,QAAQ,CAAC,EAAE,UAAU,GAAG,MAAM,CAAC,GAAG;IAC5F,uEAAuE;IACvE,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAA;IAC1B,mFAAmF;IACnF,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,GAAG,IAAI,CAAA;CAC3C,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,aAAa,uDAMvB,kBAAkB,KAAG,YAoBvB,CAAA"}
@@ -0,0 +1,35 @@
1
+ import type { ComponentPropsWithRef, ReactElement } from "react";
2
+ /** Sizes the bare mark is drawn and checked at, in CSS pixels; 16 stays legible in one colour. */
3
+ export declare const RLY_RELAY_MARK_SIZES: readonly [16, 20, 24, 32];
4
+ /** One supported bare mark size. */
5
+ export type RlyRelayMarkSize = (typeof RLY_RELAY_MARK_SIZES)[number];
6
+ /** Sizes the tile is drawn at; its glyph is half the tile. */
7
+ export declare const RLY_RELAY_MARK_TILE_SIZES: readonly [20, 24, 32];
8
+ /** One supported tile size. */
9
+ export type RlyRelayMarkTileSize = (typeof RLY_RELAY_MARK_TILE_SIZES)[number];
10
+ type MarkBaseProps = Omit<ComponentPropsWithRef<"svg">, "children" | "height" | "viewBox" | "width">;
11
+ /** Inputs for the bare mark. */
12
+ export type RelayMarkProps = MarkBaseProps & {
13
+ /** 20px unless given. */
14
+ readonly size?: RlyRelayMarkSize;
15
+ /** Names the mark for assistive technology; without it the mark is decorative and hidden. */
16
+ readonly label?: string;
17
+ };
18
+ /** Inputs for the mark on an agent-coloured tile. */
19
+ export type RelayMarkTileProps = Omit<ComponentPropsWithRef<"span">, "children"> & {
20
+ /** 24px unless given. */
21
+ readonly size?: RlyRelayMarkTileSize;
22
+ /** Names the tile for assistive technology; without it the tile is decorative and hidden. */
23
+ readonly label?: string;
24
+ };
25
+ /** The mark on an agent-coloured tile; in forced colours the tile becomes an outline in its context's colour. */
26
+ declare const RelayMarkTile: ({ className, label, size, ...props }: RelayMarkTileProps) => ReactElement;
27
+ /**
28
+ * Relay's mark, drawn in the current colour, so it follows its host's text in every theme and in
29
+ * forced colours. `RelayMark.Tile` sets it on the agent colour for headers and avatars.
30
+ */
31
+ export declare const RelayMark: (({ className, label, size, ...props }: RelayMarkProps) => ReactElement) & {
32
+ Tile: typeof RelayMarkTile;
33
+ };
34
+ export {};
35
+ //# sourceMappingURL=RelayMark.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RelayMark.d.ts","sourceRoot":"","sources":["../../../src/patterns/RelayMark.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAMhE,kGAAkG;AAClG,eAAO,MAAM,oBAAoB,EAAE,SAAS,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAoB,CAAA;AAC/E,oCAAoC;AACpC,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAA;AAEpE,8DAA8D;AAC9D,eAAO,MAAM,yBAAyB,EAAE,SAAS,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAgB,CAAA;AAC5E,+BAA+B;AAC/B,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,CAAC,CAAA;AAE7E,KAAK,aAAa,GAAG,IAAI,CAAC,qBAAqB,CAAC,KAAK,CAAC,EAAE,UAAU,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,CAAC,CAAA;AA6BpG,gCAAgC;AAChC,MAAM,MAAM,cAAc,GAAG,aAAa,GAAG;IAC3C,yBAAyB;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,gBAAgB,CAAA;IAChC,6FAA6F;IAC7F,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CACxB,CAAA;AAED,qDAAqD;AACrD,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,GAAG;IACjF,yBAAyB;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,oBAAoB,CAAA;IACpC,6FAA6F;IAC7F,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CACxB,CAAA;AAyBD,iHAAiH;AACjH,QAAA,MAAM,aAAa,yCAA0C,kBAAkB,KAAG,YAYjF,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,SAAS,0CACmB,cAAc,KAAG,YAAY;;CASrE,CAAA"}
@@ -0,0 +1,91 @@
1
+ import type { ReactElement, ReactNode, Ref, RefObject } from "react";
2
+ /** How Relay is laid out: over the page, pinned beside it, or full screen. */
3
+ export declare const RLY_RELAY_PANEL_PRESENTATIONS: readonly ["overlay", "pinned", "fullscreen"];
4
+ /** One Relay presentation. */
5
+ export type RlyRelayPanelPresentation = (typeof RLY_RELAY_PANEL_PRESENTATIONS)[number];
6
+ /** The overlay's width, and the column a pinned Relay takes, in CSS pixels. */
7
+ export declare const RLY_RELAY_PANEL_WIDTH = 440;
8
+ /** What Relay is looking at: a label and, when it has one, the exact revision (shown in mono). */
9
+ export interface RlyRelayScope {
10
+ readonly label: string;
11
+ readonly revision?: string;
12
+ }
13
+ /** One of Relay's views; a count is part of its name ("Findings 3"), never announced on change. */
14
+ export interface RlyRelayPanelTab {
15
+ readonly content: ReactNode;
16
+ readonly count?: number;
17
+ readonly label: string;
18
+ readonly value: string;
19
+ }
20
+ /** The pin toggle, passed only when the host can pin Relay beside its page at this width. */
21
+ export interface RlyRelayPanelPin {
22
+ readonly onPinnedChange: (pinned: boolean) => void;
23
+ readonly pinned: boolean;
24
+ }
25
+ interface RelayPanelBaseProps {
26
+ /** Status line under the header (freshness of what Relay read); not a live region. */
27
+ readonly freshness?: ReactNode;
28
+ /** Kept on screen under the body: the composer. */
29
+ readonly footer?: ReactNode;
30
+ /** Where focus returns when the panel closes itself (close button, Escape, full-screen dismissal). */
31
+ readonly launcher: RefObject<HTMLElement | null>;
32
+ /**
33
+ * Called by the close button and Escape. Closing hides Relay in every presentation; whether it was
34
+ * pinned is the host's remembered preference, restored when Relay opens again.
35
+ */
36
+ readonly onClose: () => void;
37
+ /** Thread options, usually one menu trigger. */
38
+ readonly options?: ReactNode;
39
+ readonly pin?: RlyRelayPanelPin | undefined;
40
+ readonly presentation: RlyRelayPanelPresentation;
41
+ /** The panel's region, for useRelaySummon. */
42
+ readonly ref?: Ref<HTMLElement>;
43
+ readonly scope: RlyRelayScope;
44
+ /** The panel's name, "Relay" unless the host names it more specifically. */
45
+ readonly title?: string;
46
+ }
47
+ interface RelayPanelTabsProps extends RelayPanelBaseProps {
48
+ readonly children?: never;
49
+ readonly onTabChange: (value: string) => void;
50
+ readonly selectedTab: string;
51
+ readonly tabs: ReadonlyArray<RlyRelayPanelTab>;
52
+ }
53
+ interface RelayPanelBodyProps extends RelayPanelBaseProps {
54
+ /** A single view (setup, for example), shown without tabs. */
55
+ readonly children: ReactNode;
56
+ readonly onTabChange?: never;
57
+ readonly selectedTab?: never;
58
+ readonly tabs?: never;
59
+ }
60
+ /** Inputs for the panel: tabbed views, or one body. */
61
+ export type RelayPanelProps = RelayPanelTabsProps | RelayPanelBodyProps;
62
+ /**
63
+ * Relay's frame (Relay UX decision). `overlay` floats over the right of the page with no backdrop and no
64
+ * focus trap; render it right after the launcher so Tab order follows. `pinned` is a sticky column for
65
+ * the host's grid. `fullscreen` is a modal dialog with the page inert. Only the body scrolls, so the
66
+ * header and the footer's composer stay on screen. Escape and the close button call `onClose` and return
67
+ * focus to the launcher; Escape is left to an IME composition and to dialogs or open popups inside.
68
+ * Changing presentation remounts the views and footer, so state that must survive (a composer draft)
69
+ * lives with the host or the composer, keyed by the object Relay is about.
70
+ */
71
+ export declare const RelayPanel: (props: RelayPanelProps) => ReactElement;
72
+ /** Inputs for {@link useRelayPresentation}. */
73
+ export interface UseRelayPresentationOptions {
74
+ /** The user's pin preference, remembered by the host per product and viewport class. */
75
+ readonly pinned: boolean;
76
+ /** The narrowest width the host's own page stays usable at, beside a pinned Relay. */
77
+ readonly minHostWidth: number;
78
+ }
79
+ /** The presentation to render, and whether to offer the pin toggle. */
80
+ export interface RlyRelayPresentation {
81
+ readonly canPin: boolean;
82
+ readonly presentation: RlyRelayPanelPresentation;
83
+ }
84
+ /**
85
+ * The presentation for the viewport (Relay UX decision): full screen at phone width; pinned when the user
86
+ * pinned it and the viewport is wide enough (≥1440 and the host's minimum beside the column); otherwise
87
+ * the overlay. The server renders the overlay. A host may still choose its own presentation.
88
+ */
89
+ export declare const useRelayPresentation: ({ minHostWidth, pinned }: UseRelayPresentationOptions) => RlyRelayPresentation;
90
+ export {};
91
+ //# sourceMappingURL=RelayPanel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RelayPanel.d.ts","sourceRoot":"","sources":["../../../src/patterns/RelayPanel.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAuC,YAAY,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAmBzG,8EAA8E;AAC9E,eAAO,MAAM,6BAA6B,EAAE,SAAS,CAAC,SAAS,EAAE,QAAQ,EAAE,YAAY,CAItF,CAAA;AACD,8BAA8B;AAC9B,MAAM,MAAM,yBAAyB,GAAG,CAAC,OAAO,6BAA6B,CAAC,CAAC,MAAM,CAAC,CAAA;AAEtF,+EAA+E;AAC/E,eAAO,MAAM,qBAAqB,MAAM,CAAA;AAExC,kGAAkG;AAClG,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;I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WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAC7C,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAA;CAC/C;AAED,UAAU,mBAAoB,SAAQ,mBAAmB;IACvD,8DAA8D;IAC9D,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAA;IAC5B,QAAQ,CAAC,WAAW,CAAC,EAAE,KAAK,CAAA;IAC5B,QAAQ,CAAC,WAAW,CAAC,EAAE,KAAK,CAAA;IAC5B,QAAQ,CAAC,IAAI,CAAC,EAAE,KAAK,CAAA;CACtB;AAED,uDAAuD;AACvD,MAAM,MAAM,eAAe,GAAG,mBAAmB,GAAG,mBAAmB,CAAA;AAOvE;;;;;;;;GAQG;AACH,eAAO,MAAM,UAAU,UAAW,eAAe,KAAG,YAmGnD,CAAA;AAsFD,+CAA+C;AAC/C,MAAM,WAAW,2BAA2B;IAC1C,wFAAwF;IACxF,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;IACxB,sFAAsF;IACtF,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;CAC9B;AAED,uEAAuE;AACvE,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;IACxB,QAAQ,CAAC,YAAY,EAAE,yBAAyB,CAAA;CACjD;AAwBD;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,6BAA8B,2BAA2B,KAAG,oBAK5F,CAAA"}
@@ -34,8 +34,16 @@ export { RelationshipChain, RLY_RELATIONSHIP_DIRECTION_PRESENTATION, RLY_RELATIO
34
34
  export type { RelationshipChainProps, RlyMissingRelationshipEndpoint, RlyPresentRelationshipEndpoint, RlyRelationship, RlyRelationshipDirection, RlyRelationshipEndpoint, RlyRelationshipLifecycle } from "./RelationshipChain.js";
35
35
  export { RelationshipTable } from "./RelationshipTable.js";
36
36
  export type { RelationshipTableProps } from "./RelationshipTable.js";
37
+ export { RelayComposer, useRelayDraft } from "./RelayComposer.js";
38
+ export type { RelayComposerProps, RlyRelayContextRef, RlyRelayDraft, RlyRelayDraftStorage, RlyRelaySubmission, UseRelayDraftOptions } from "./RelayComposer.js";
37
39
  export { RelayDock } from "./RelayDock.js";
38
40
  export type { RelayDockProps, RlyRelayDockContextChip, RlyRelayDockDesktopPresentation, RlyRelayDockSelection, RlyRelayDockSelectionControl, RlyRelayDockState } from "./RelayDock.js";
41
+ export { RelayLauncher, relayShortcut, useRelayShortcut, useRelaySummon } from "./RelayLauncher.js";
42
+ export type { RelayLauncherProps, RlyRelayShortcut, RlyRelaySummon, UseRelaySummonOptions } from "./RelayLauncher.js";
43
+ export { RelayMark, RLY_RELAY_MARK_SIZES, RLY_RELAY_MARK_TILE_SIZES } from "./RelayMark.js";
44
+ export type { RelayMarkProps, RelayMarkTileProps, RlyRelayMarkSize, RlyRelayMarkTileSize } from "./RelayMark.js";
45
+ export { RelayPanel, RLY_RELAY_PANEL_PRESENTATIONS, RLY_RELAY_PANEL_WIDTH, useRelayPresentation } from "./RelayPanel.js";
46
+ export type { RelayPanelProps, RlyRelayPanelPin, RlyRelayPanelPresentation, RlyRelayPanelTab, RlyRelayPresentation, RlyRelayScope, UseRelayPresentationOptions } from "./RelayPanel.js";
39
47
  export { ReleasePreview } from "./ReleasePreview.js";
40
48
  export type { ReleasePreviewProps, RlyReleasePreviewPresentation } from "./ReleasePreview.js";
41
49
  export { ReleaseRelay, RLY_RELEASE_RELAY_DEFAULT_VARIANTS, RLY_RELEASE_RELAY_SYMBOLS, RLY_RELEASE_RELAY_VARIANTS } from "./ReleaseRelay.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/patterns/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAC5D,YAAY,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,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B,EACpB,gBAAgB,EAChB,qBAAqB,EACrB,yBAAyB,EACzB,0BAA0B,EAC1B,gBAAgB,EACjB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,oBAAoB,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAC5D,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,YAAY,EACV,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,0BAA0B,EAC1B,gBAAgB,EACjB,MAAM,kBAAkB,CAAA"}
@@ -0,0 +1,13 @@
1
+ /** One web font rly's styles.css loads: its CSS family and the woff2 file a shell preloads. */
2
+ export interface RlyFontFace {
3
+ readonly family: string;
4
+ readonly file: string;
5
+ }
6
+ /**
7
+ * Every web font rly's styles.css loads, as Fontsource names the files. The faces use
8
+ * `font-display: optional`, so a shell must preload each of these files (from its own origin, with
9
+ * `crossorigin`) for Geist to render on first load; otherwise the metric-matched fallback stays for
10
+ * that page view and nothing swaps. Shells read this list instead of hardcoding file names.
11
+ */
12
+ export declare const RLY_FONT_FACES: readonly [RlyFontFace, RlyFontFace];
13
+ //# sourceMappingURL=fonts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fonts.d.ts","sourceRoot":"","sources":["../../../src/tokens/fonts.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CACtB;AAED;;;;;GAKG;AACH,eAAO,MAAM,cAAc,EAAE,SAAS,CAAC,WAAW,EAAE,WAAW,CAG9D,CAAA"}
@@ -1,3 +1,5 @@
1
+ export { RLY_FONT_FACES } from "./fonts.js";
2
+ export type { RlyFontFace } from "./fonts.js";
1
3
  export { RLY_COLOR_TOKEN_NAMES, RLY_CONTROL_HEIGHT_TOKEN_NAMES, RLY_MOTION_TOKEN_NAMES, RLY_RADIUS_TOKEN_NAMES, RLY_SPACE_TOKEN_NAMES, RLY_TYPE_TOKEN_NAMES } from "./semantic-tokens.js";
2
4
  export type { RlyColorToken, RlyControlHeightToken, RlyMotionToken, RlyRadiusToken, RlySpaceToken, RlyTypeToken } from "./semantic-tokens.js";
3
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tokens/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,qBAAqB,EACrB,8BAA8B,EAC9B,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,sBAAsB,CAAA;AAC7B,YAAY,EACV,aAAa,EACb,qBAAqB,EACrB,cAAc,EACd,cAAc,EACd,aAAa,EACb,YAAY,EACb,MAAM,sBAAsB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tokens/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAC3C,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAC7C,OAAO,EACL,qBAAqB,EACrB,8BAA8B,EAC9B,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,sBAAsB,CAAA;AAC7B,YAAY,EACV,aAAa,EACb,qBAAqB,EACrB,cAAc,EACd,cAAc,EACd,aAAa,EACb,YAAY,EACb,MAAM,sBAAsB,CAAA"}
package/dist/fonts.css CHANGED
@@ -1,5 +1,10 @@
1
+ /*
2
+ * optional: a preloaded face (served from the shell's origin) is ready within the short block period and
3
+ * renders from first paint; a face that is late stays on the metric-matched fallback for this page
4
+ * view, so text never swaps and never shifts. Shells preload every face in RLY_FONT_FACES.
5
+ */
1
6
  @font-face {
2
- font-display: swap;
7
+ font-display: optional;
3
8
  font-family: "Geist Variable";
4
9
  font-style: normal;
5
10
  font-weight: 100 900;
@@ -7,9 +12,85 @@
7
12
  }
8
13
 
9
14
  @font-face {
10
- font-display: swap;
15
+ font-display: optional;
11
16
  font-family: "Geist Mono Variable";
12
17
  font-style: normal;
13
18
  font-weight: 100 900;
14
19
  src: url("./fonts/geist-mono-latin-wght-normal.woff2") format("woff2-variations");
15
20
  }
21
+
22
+ /*
23
+ * Metric-matched fallbacks, so text keeps its line breaks and row heights when Geist swaps in.
24
+ * Arial, Liberation Sans and Arimo share advance widths, so one override set covers macOS, Windows
25
+ * and Linux; Courier New, Liberation Mono and Cousine likewise. Geist's ascent 1005 and descent 295
26
+ * (per 1000; hhea and typo agree, USE_TYPO_METRICS is set) are divided by each face's size-adjust.
27
+ * Widths were measured in Chromium on product copy: Geist at 430 (body) runs 103.3% of Liberation
28
+ * Sans and at 520 (meta) 105.2%, so each gets its own face. At 600 to 650 it runs 99.8% to 101.1%
29
+ * of Liberation Sans Bold; a real bold face covers 550 and up, because a synthetic bold of the
30
+ * regular face matches neither.
31
+ */
32
+ @font-face {
33
+ font-family: "Geist Fallback";
34
+ font-style: normal;
35
+ font-weight: 100 479;
36
+ src:
37
+ local("Arial"), local("ArialMT"), local("Liberation Sans"), local("LiberationSans"), local("Arimo"),
38
+ local("Arimo-Regular");
39
+ size-adjust: 103.3%;
40
+ ascent-override: 97.3%;
41
+ descent-override: 28.6%;
42
+ line-gap-override: 0%;
43
+ }
44
+
45
+ /* Meta text (520) runs wider against the same regular face. */
46
+ @font-face {
47
+ font-family: "Geist Fallback";
48
+ font-style: normal;
49
+ font-weight: 480 549;
50
+ src:
51
+ local("Arial"), local("ArialMT"), local("Liberation Sans"), local("LiberationSans"), local("Arimo"),
52
+ local("Arimo-Regular");
53
+ size-adjust: 105.2%;
54
+ ascent-override: 95.5%;
55
+ descent-override: 28%;
56
+ line-gap-override: 0%;
57
+ }
58
+
59
+ @font-face {
60
+ font-family: "Geist Fallback";
61
+ font-style: normal;
62
+ font-weight: 550 900;
63
+ src:
64
+ local("Arial Bold"), local("Arial-BoldMT"), local("Liberation Sans Bold"), local("LiberationSans-Bold"),
65
+ local("Arimo Bold"), local("Arimo-Bold");
66
+ size-adjust: 100.3%;
67
+ ascent-override: 100.2%;
68
+ descent-override: 29.4%;
69
+ line-gap-override: 0%;
70
+ }
71
+
72
+ @font-face {
73
+ font-family: "Geist Mono Fallback";
74
+ font-style: normal;
75
+ font-weight: 100 549;
76
+ src:
77
+ local("Courier New"), local("CourierNewPSMT"), local("Liberation Mono"), local("LiberationMono"), local("Cousine"),
78
+ local("Cousine-Regular");
79
+ size-adjust: 100%;
80
+ ascent-override: 100.5%;
81
+ descent-override: 29.5%;
82
+ line-gap-override: 0%;
83
+ }
84
+
85
+ @font-face {
86
+ font-family: "Geist Mono Fallback";
87
+ font-style: normal;
88
+ font-weight: 550 900;
89
+ src:
90
+ local("Courier New Bold"), local("CourierNewPS-BoldMT"), local("Liberation Mono Bold"),
91
+ local("LiberationMono-Bold"), local("Cousine Bold"), local("Cousine-Bold");
92
+ size-adjust: 100%;
93
+ ascent-override: 100.5%;
94
+ descent-override: 29.5%;
95
+ line-gap-override: 0%;
96
+ }
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { a as e, i as t, n, o as r, r as i, t as a } from "../ThemeProvider-BFeldMeE.js";
3
- import { a as o, i as s, n as c, o as l, s as u } from "../PortalProvider-CN_81Fy3.js";
3
+ import { a as o, i as s, n as c, o as l, s as u } from "../PortalProvider-op07u8na.js";
4
4
  import { t as d } from "../LinkProvider-DMkhwZ3P.js";
5
5
  export { r as GlobalStyles, s as Icon, d as LinkProvider, c as PortalProvider, o as RLY_ICON_DEFAULT_VARIANTS, l as RLY_ICON_NAMES, u as RLY_ICON_VARIANTS, a as RLY_THEME_NAMES, n as ThemeProvider, i as decodeRlyTheme, t as useDocumentTheme, e as useStoredTheme };
6
6
 
@@ -2,8 +2,8 @@
2
2
  @layer rly.tokens {
3
3
  :root {
4
4
  color-scheme: light dark;
5
- --rly-font-ui: "Geist Variable", "Geist", system-ui, sans-serif;
6
- --rly-font-mono: "Geist Mono Variable", "Geist Mono", ui-monospace, monospace;
5
+ --rly-font-ui: "Geist Variable", "Geist", "Geist Fallback", system-ui, sans-serif;
6
+ --rly-font-mono: "Geist Mono Variable", "Geist Mono", "Geist Mono Fallback", ui-monospace, monospace;
7
7
  --rly-focus-ring-width: 2px;
8
8
  --rly-focus-ring-offset: 2px;
9
9
  --rly-color-canvas: light-dark(#F6F6F8, #101114);