@gjsify/adwaita-web 0.41.0 → 0.43.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 (97) hide show
  1. package/README.md +98 -3
  2. package/dist/adwaita-web.css +30 -23
  3. package/dist/adwaita-web.css.map +1 -1
  4. package/lib/types/adw-fonts.spec.d.ts +2 -0
  5. package/lib/types/breakpoints.d.ts +10 -1
  6. package/lib/types/connect-lifecycle.spec.d.ts +1 -0
  7. package/lib/types/elements/adw-about-dialog.d.ts +1 -0
  8. package/lib/types/elements/adw-action-row.d.ts +2 -0
  9. package/lib/types/elements/adw-alert-dialog.d.ts +14 -2
  10. package/lib/types/elements/adw-carousel.d.ts +8 -0
  11. package/lib/types/elements/adw-dialog.d.ts +2 -7
  12. package/lib/types/elements/adw-icon.d.ts +17 -1
  13. package/lib/types/elements/adw-navigation-split-view.d.ts +7 -0
  14. package/lib/types/elements/adw-overlay-split-view.d.ts +6 -0
  15. package/lib/types/elements/adw-popover.d.ts +1 -0
  16. package/lib/types/elements/adw-preferences-dialog.d.ts +1 -0
  17. package/lib/types/elements/adw-switch.d.ts +10 -0
  18. package/lib/types/elements/adw-toggle-group.d.ts +2 -0
  19. package/lib/types/elements/modal-surface.d.ts +59 -0
  20. package/lib/types/elements/roving-focus.d.ts +26 -0
  21. package/lib/types/elements/row-activation.d.ts +26 -0
  22. package/lib/types/elements/swipe-drag.d.ts +63 -0
  23. package/lib/types/empty-sections.d.ts +15 -0
  24. package/lib/types/empty-sections.spec.d.ts +1 -0
  25. package/lib/types/fonts.d.ts +1 -0
  26. package/lib/types/icon-registry.d.ts +35 -0
  27. package/lib/types/icon-registry.spec.d.ts +18 -0
  28. package/lib/types/index.d.ts +1 -1
  29. package/lib/types/keyboard-operable.spec.d.ts +1 -0
  30. package/lib/types/styles.generated.d.ts +1 -1
  31. package/package.json +10 -6
  32. package/scss/_banner.scss +1 -1
  33. package/scss/_checks.scss +8 -8
  34. package/scss/_combo_row.scss +1 -1
  35. package/scss/_drop_down.scss +1 -1
  36. package/scss/_expander_row.scss +1 -1
  37. package/scss/_icon.scss +47 -0
  38. package/scss/_icons.generated.scss +18 -6
  39. package/scss/_password_entry_row.scss +1 -1
  40. package/scss/_preferences_dialog.scss +3 -2
  41. package/scss/_progress_bar.scss +1 -1
  42. package/scss/_row.scss +1 -1
  43. package/scss/_status_page.scss +1 -1
  44. package/scss/_tab_view.scss +1 -1
  45. package/scss/_toast.scss +6 -24
  46. package/scss/_variables.scss +23 -3
  47. package/src/adw-action-rows.spec.ts +21 -9
  48. package/src/adw-button-content.spec.ts +11 -6
  49. package/src/adw-fonts.spec.ts +188 -0
  50. package/src/adw-icon.spec.ts +17 -8
  51. package/src/adw-row-state.spec.ts +11 -1
  52. package/src/breakpoints.ts +18 -4
  53. package/src/connect-lifecycle.spec.ts +351 -0
  54. package/src/elements/adw-about-dialog.ts +24 -18
  55. package/src/elements/adw-action-row.ts +14 -2
  56. package/src/elements/adw-alert-dialog.ts +39 -20
  57. package/src/elements/adw-button-row.ts +3 -0
  58. package/src/elements/adw-carousel.ts +86 -5
  59. package/src/elements/adw-clamp.ts +3 -2
  60. package/src/elements/adw-data-grid.ts +5 -2
  61. package/src/elements/adw-dialog.ts +16 -63
  62. package/src/elements/adw-expander-row.ts +18 -4
  63. package/src/elements/adw-header-bar.ts +2 -0
  64. package/src/elements/adw-icon.ts +32 -6
  65. package/src/elements/adw-inline-view-switcher.ts +12 -0
  66. package/src/elements/adw-menu-button.ts +17 -10
  67. package/src/elements/adw-navigation-split-view.ts +30 -7
  68. package/src/elements/adw-overlay-split-view.ts +15 -3
  69. package/src/elements/adw-popover.ts +11 -0
  70. package/src/elements/adw-preferences-dialog.ts +18 -16
  71. package/src/elements/adw-preferences-group.ts +7 -0
  72. package/src/elements/adw-sidebar.ts +15 -0
  73. package/src/elements/adw-status-page.ts +12 -4
  74. package/src/elements/adw-switch-row.ts +7 -0
  75. package/src/elements/adw-switch.ts +19 -1
  76. package/src/elements/adw-tab-view.ts +7 -4
  77. package/src/elements/adw-toast-overlay.ts +8 -1
  78. package/src/elements/adw-toggle-group.ts +94 -2
  79. package/src/elements/adw-toolbar-view.ts +6 -2
  80. package/src/elements/adw-view-switcher-bar.ts +18 -0
  81. package/src/elements/adw-view-switcher.ts +14 -0
  82. package/src/elements/modal-surface.ts +180 -0
  83. package/src/elements/roving-focus.ts +154 -0
  84. package/src/elements/row-activation.ts +92 -0
  85. package/src/elements/swipe-drag.ts +450 -0
  86. package/src/empty-sections.spec.ts +81 -0
  87. package/src/empty-sections.ts +54 -0
  88. package/src/fonts.ts +25 -0
  89. package/src/icon-registry.spec.ts +240 -0
  90. package/src/icon-registry.ts +157 -0
  91. package/src/index.ts +24 -1
  92. package/src/keyboard-operable.spec.ts +755 -0
  93. package/src/source-view/theme.ts +15 -3
  94. package/src/split-button.spec.ts +6 -2
  95. package/src/style-classes.spec.ts +6 -0
  96. package/src/styles.generated.ts +1 -1
  97. package/src/test.browser.mts +14 -0
@@ -0,0 +1,2 @@
1
+ import '@gjsify/adwaita-web';
2
+ export declare const AdwFontsTest: () => Promise<void>;
@@ -13,8 +13,17 @@ export declare function addBreakpoints(element: Element, breakpoints: readonly A
13
13
  * of an `Adw.Breakpoint` with one `add_setter()` call. Returns a dispose function; call it
14
14
  * before re-binding and on disconnect.
15
15
  *
16
+ * `applied` is what the binding being REPLACED had last set, and it is not optional
17
+ * bookkeeping: an element rebinds on every connect, and a fresh `AdwBreakpoint` starts
18
+ * at `false` while firing on transitions only. Without carrying it over, a view the
19
+ * breakpoint had collapsed and that then moves into a WIDE parent evaluates
20
+ * `matches === applied === false` and never hears `onUnapply` — measured stuck at
21
+ * `collapsed` after 800px → 500px → 900px. Pass what the setter last received, never
22
+ * what the attribute currently says: markup that declares the state itself was never
23
+ * this breakpoint's doing and must not be undone by it.
24
+ *
16
25
  * A missing or unparsable condition binds nothing and returns a no-op, leaving whatever
17
26
  * the attribute already says untouched — an element must not silently flip state because
18
27
  * its condition had a typo.
19
28
  */
20
- export declare function bindBreakpointSetter(element: Element, condition: string | null, setValue: (active: boolean) => void): () => void;
29
+ export declare function bindBreakpointSetter(element: Element, condition: string | null, setValue: (active: boolean) => void, applied?: boolean): () => void;
@@ -0,0 +1 @@
1
+ export declare const AdwConnectLifecycleTest: () => Promise<void>;
@@ -2,6 +2,7 @@ export declare class AdwAboutDialog extends HTMLElement {
2
2
  private _initialized;
3
3
  private _scrimEl;
4
4
  private _sheetEl;
5
+ private _modal;
5
6
  private _navView;
6
7
  private _scrollEl;
7
8
  private _mainToolbarEl;
@@ -8,6 +8,8 @@ export declare class AdwActionRow extends HTMLElement {
8
8
  /** Watches the activatable widget's `disabled`/`aria-disabled` — the live binding. */
9
9
  private _sensitivityObserver;
10
10
  private _initialized;
11
+ /** Tab stop + Enter/Space, re-derived whenever `activatable` moves. */
12
+ private _activation?;
11
13
  static get observedAttributes(): string[];
12
14
  /** The end (suffix) section — append controls here imperatively. */
13
15
  get suffixSection(): HTMLDivElement;
@@ -18,6 +18,7 @@ export declare class AdwAlertDialog extends HTMLElement {
18
18
  private _bodyEl;
19
19
  private _childEl;
20
20
  private _responseAreaEl;
21
+ private _modal;
21
22
  /** The headless response registry + default/close semantics + resolution (ADR 0004). */
22
23
  private _model;
23
24
  /** The rendered button per registered response id (the DOM half of the model). */
@@ -63,7 +64,18 @@ export declare class AdwAlertDialog extends HTMLElement {
63
64
  /** Dismissal (Escape / scrim) — close, then emit the close-response. */
64
65
  private _dismiss;
65
66
  private _emitResponse;
66
- /** Move focus to the default response button (or the first enabled one). */
67
- private _focusInitial;
67
+ /**
68
+ * Where a presented alert puts focus, in the three steps `adw_alert_dialog_grab_focus`
69
+ * takes (refs/libadwaita/src/adw-alert-dialog.c:382): the CONTENT first
70
+ * (`adw_widget_grab_focus_child (priv->scrolled_window)`, :397), then the default
71
+ * widget (:406), then the first response whose `enabled` is set (:413). The default
72
+ * response is rarely the first button — a destructive alert opens on Cancel — and
73
+ * content beats it: an alert carrying an entry is answered by typing into it.
74
+ *
75
+ * `focusables` is the surface's own list, so what "focusable" means is decided once.
76
+ */
77
+ private _initialFocusTarget;
78
+ /** The default response button, or the first enabled one. */
79
+ private _defaultResponseButton;
68
80
  private _render;
69
81
  }
@@ -34,6 +34,8 @@ export declare class AdwCarousel extends HTMLElement implements CarouselHost {
34
34
  * index while the target page stays the target.
35
35
  */
36
36
  private _scrollTargetId;
37
+ /** The pointer-drag gesture, asked whether it owns the strip. See `_onWheel`. */
38
+ private _drag;
37
39
  static get observedAttributes(): string[];
38
40
  constructor();
39
41
  get nPages(): number;
@@ -47,6 +49,12 @@ export declare class AdwCarousel extends HTMLElement implements CarouselHost {
47
49
  */
48
50
  set position(value: number);
49
51
  get currentPage(): number;
52
+ /**
53
+ * `AdwCarousel:allow-mouse-drag` — whether the strip can be dragged with the pointer.
54
+ * Defaults to TRUE, as in libadwaita, where FALSE leaves dragging to touch only.
55
+ */
56
+ get allowMouseDrag(): boolean;
57
+ set allowMouseDrag(value: boolean);
50
58
  /** Whether the scroll wheel navigates between pages. Defaults to TRUE, as in libadwaita. */
51
59
  get allowScrollWheel(): boolean;
52
60
  set allowScrollWheel(value: boolean);
@@ -8,7 +8,7 @@ export declare class AdwDialog extends HTMLElement {
8
8
  private _titleEl;
9
9
  private _closeBtn;
10
10
  private _contentEl;
11
- private _previouslyFocused;
11
+ private _modal;
12
12
  static get observedAttributes(): string[];
13
13
  /** Whether the dialog is currently revealed. */
14
14
  get open(): boolean;
@@ -40,12 +40,7 @@ export declare class AdwDialog extends HTMLElement {
40
40
  attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
41
41
  /** A dismissal was requested: honour `can-close`, else raise close-attempt. */
42
42
  private _attemptClose;
43
- /** Focus trap + Escape while the box has focus. */
44
- private _onBoxKeyDown;
45
- private _focusables;
46
- /** On present: remember focus, then move it into the dialog. */
47
- private _onPresented;
48
- /** On close: emit `closed` and return focus to where it was before present. */
43
+ /** On close: emit `closed`, then let the surface return focus to where it was. */
49
44
  private _onClosed;
50
45
  private _render;
51
46
  }
@@ -1,3 +1,15 @@
1
+ /**
2
+ * The generated mask-class prefix — the one place the `--` spelling appears. `icon-registry`
3
+ * builds the same class for a runtime registration and imports it from here rather than
4
+ * spelling it twice.
5
+ */
6
+ export declare const MASK_CLASS_PREFIX = "adw-icon--";
7
+ /**
8
+ * The glyph an icon falls back to — the same name `_icon.scss` masks with, the same one
9
+ * libadwaita's C substitutes for a NULL icon-name, and the same one GTK's icon theme
10
+ * returns for a name it cannot find.
11
+ */
12
+ export declare const MISSING_ICON_NAME = "image-missing";
1
13
  export declare class AdwIcon extends HTMLElement {
2
14
  static get observedAttributes(): string[];
3
15
  /** The declared symbolic name, `-symbolic` suffix optional. */
@@ -6,7 +18,11 @@ export declare class AdwIcon extends HTMLElement {
6
18
  /**
7
19
  * The name that actually reached the mask class — `''` when the icon-name is
8
20
  * absent, empty, or not usable as one CSS token. Consumers that need to know
9
- * whether an icon is being drawn ask this, not the raw attribute.
21
+ * whether the DECLARED name is drawable ask this, not the raw attribute.
22
+ *
23
+ * `''` does NOT mean the box draws nothing: an unusable name that was given still
24
+ * draws {@link MISSING_ICON_NAME}. Whether an icon was ASKED FOR is the raw
25
+ * attribute's emptiness, which is the predicate a host's visibility follows.
10
26
  */
11
27
  get resolvedIconName(): string;
12
28
  /** The rendered edge length in px, or `null` when the stylesheet decides. */
@@ -11,6 +11,12 @@ export declare class AdwNavigationSplitView extends HTMLElement {
11
11
  private _contentEl;
12
12
  private _initialized;
13
13
  private _disposeBreakpoint;
14
+ /**
15
+ * What the breakpoint last SET, carried across every rebind. Not read off the
16
+ * attribute: a `collapsed` the markup declared was never this breakpoint's doing,
17
+ * and unapplying it at connect would undo the author.
18
+ */
19
+ private _breakpointApplied;
14
20
  /** The ordering table, the tag guard and the action routing (ADR 0004). */
15
21
  private _state;
16
22
  /** Re-entrancy guard for the `show-content` reflection. */
@@ -38,6 +44,7 @@ export declare class AdwNavigationSplitView extends HTMLElement {
38
44
  /** `navigation.pop` — `navigation_pop_cb`. */
39
45
  pop(): NavigationActionResult;
40
46
  connectedCallback(): void;
47
+ private _buildOnce;
41
48
  /** `Adw.NavigationPage:tag` off the slotted pane, or `null` when untagged. */
42
49
  private _tagOf;
43
50
  /**
@@ -4,6 +4,12 @@ export declare class AdwOverlaySplitView extends HTMLElement {
4
4
  private _contentEl;
5
5
  private _backdropEl;
6
6
  private _disposeBreakpoint;
7
+ /**
8
+ * What the breakpoint last SET, carried across every rebind. Not read off the
9
+ * attribute: a `collapsed` the markup declared was never this breakpoint's doing,
10
+ * and unapplying it at connect would undo the author.
11
+ */
12
+ private _breakpointApplied;
7
13
  /**
8
14
  * The property interplay, shared with the NativeScript renderer (ADR 0004): the
9
15
  * element owns the attributes and the painting, core owns what `collapsed` +
@@ -35,6 +35,7 @@ export declare class AdwPopover extends HTMLElement {
35
35
  /** Subscribe to open-state changes. Returns an unsubscribe function. */
36
36
  subscribe(listener: (open: boolean) => void): () => void;
37
37
  connectedCallback(): void;
38
+ private _buildOnce;
38
39
  disconnectedCallback(): void;
39
40
  attributeChangedCallback(name: string, _previous: string | null, value: string | null): void;
40
41
  private _onStateChange;
@@ -28,6 +28,7 @@ export declare class AdwPreferencesDialog extends HTMLElement {
28
28
  private _bodyEl;
29
29
  private _pagesEl;
30
30
  private _closeBtn;
31
+ private _modal;
31
32
  static get observedAttributes(): string[];
32
33
  get open(): boolean;
33
34
  set open(value: boolean);
@@ -3,6 +3,16 @@ export declare class AdwSwitch extends HTMLElement {
3
3
  private _slider;
4
4
  private _initialized;
5
5
  static get observedAttributes(): string[];
6
+ /**
7
+ * `Gtk.Widget:can-focus` on the slider, inverted so the default stays "yes".
8
+ *
9
+ * `adw_switch_row_init` does `gtk_widget_set_can_focus (self->slider, FALSE)`
10
+ * (adw-switch-row.c:159) and makes the ROW activatable instead, so a switch row is ONE
11
+ * tab stop announced as its own title — not a bare checkbox followed by a label that
12
+ * cannot be reached. A standalone `<adw-switch>` keeps its checkbox focusable.
13
+ */
14
+ get unfocusable(): boolean;
15
+ set unfocusable(value: boolean);
6
16
  /** Whether the switch is on. */
7
17
  get active(): boolean;
8
18
  set active(value: boolean);
@@ -8,6 +8,8 @@ export declare class AdwToggleGroup extends HTMLElement {
8
8
  /** The headless segment list + guarded selection state machine (ADR 0004). */
9
9
  private readonly _state;
10
10
  private _initialized;
11
+ /** `aria-checked` under `radio`, `aria-selected` under `tab` — decided at connect. */
12
+ private _stateAttr;
11
13
  static get observedAttributes(): string[];
12
14
  /** Zero-based index of the active toggle. */
13
15
  get active(): number;
@@ -0,0 +1,59 @@
1
+ /** The two roles a modal surface in this package declares. */
2
+ export type AdwModalRole = 'dialog' | 'alertdialog';
3
+ export interface AdwModalSurfaceInit {
4
+ /**
5
+ * The custom element itself. It receives the keydown listener, because a dialog that
6
+ * moves focus to its HOST — `<adw-preferences-dialog>` does — would otherwise press
7
+ * Tab against a listener on a descendant that never sees the event.
8
+ */
9
+ host: HTMLElement;
10
+ /** The element carrying the role, `aria-modal`, and the boundary focus may not cross. */
11
+ surface: HTMLElement;
12
+ /** The WAI-ARIA role for {@link AdwModalSurfaceInit.surface}. */
13
+ role: AdwModalRole;
14
+ /** Whether the dialog is presented right now. */
15
+ isOpen: () => boolean;
16
+ /** Escape while open. Dismissal is the element's own business (`can-close`, close-response). */
17
+ onEscape: () => void;
18
+ /**
19
+ * Where focus goes on present, when the element wants something other than the first
20
+ * focusable control — `<adw-alert-dialog>` starts on its DEFAULT response, not on the
21
+ * leftmost button. It is handed {@link AdwModalSurface.focusables}, so a rule like
22
+ * "the first control in the content area" is a `find` over that list rather than a
23
+ * second copy of the filter.
24
+ *
25
+ * Returning nothing — or an element that is not in that list — falls back to the
26
+ * first focusable, then to the surface itself.
27
+ */
28
+ initialFocus?: (focusables: readonly HTMLElement[]) => HTMLElement | null | undefined;
29
+ }
30
+ /**
31
+ * A modal surface: it declares `aria-modal`, keeps Tab inside itself, and gives focus
32
+ * back to whatever had it when the dialog appeared.
33
+ *
34
+ * The element drives it with two calls — {@link present} when it opens and
35
+ * {@link dismiss} when it closes — and keeps its own dismissal rules.
36
+ */
37
+ export declare class AdwModalSurface {
38
+ private readonly _init;
39
+ /** Focused before `present()`, restored by `dismiss()`. */
40
+ private _previouslyFocused;
41
+ constructor(init: AdwModalSurfaceInit);
42
+ /** The controls inside the surface, in tab order, that a `focus()` can actually reach. */
43
+ focusables(): HTMLElement[];
44
+ /**
45
+ * Remember where focus was, then move it inside.
46
+ *
47
+ * SYNCHRONOUS, and that was measured rather than assumed. `<adw-about-dialog>` used to
48
+ * defer this by a `requestAnimationFrame`, which reads as "the sheet is not laid out
49
+ * yet" — it is not. Every element here toggles its `open` class before calling this,
50
+ * so the surface is already displayed; reading `document.activeElement` in the same
51
+ * task that sets `open` finds it inside the dialog for all four. A retry frame would
52
+ * be a branch nothing can reach, and a spec asserting focus one frame late would pass
53
+ * over a dialog that never focused anything at all.
54
+ */
55
+ present(): void;
56
+ /** Give focus back to whatever had it before `present()`. */
57
+ dismiss(): void;
58
+ private _onKeyDown;
59
+ }
@@ -0,0 +1,26 @@
1
+ /** Which axis the items are laid out along — it decides which arrow keys move. */
2
+ export type AdwRovingOrientation = 'horizontal' | 'vertical';
3
+ export interface AdwRovingFocusInit {
4
+ /**
5
+ * The element the listener sits on — the custom element itself, so items rebuilt at
6
+ * any time are still covered.
7
+ */
8
+ host: HTMLElement;
9
+ orientation: AdwRovingOrientation;
10
+ /**
11
+ * The items a key may land on, in visual order. The widget filters: a `hidden` or
12
+ * `disabled` item is not navigable, and leaving one in would strand the user on a
13
+ * `focus()` the browser refuses.
14
+ */
15
+ items: () => readonly HTMLElement[];
16
+ /**
17
+ * Select `item`. Whether the selection actually MOVED is the widget's own business:
18
+ * focus travels with the key either way ({@link attachRovingFocus}).
19
+ */
20
+ select: (item: HTMLElement) => void;
21
+ }
22
+ /**
23
+ * Make a roving tabindex navigable: arrows step, Home/End jump, and focus travels with
24
+ * the selection so the next keypress has somewhere to start from.
25
+ */
26
+ export declare function attachRovingFocus(init: AdwRovingFocusInit): void;
@@ -0,0 +1,26 @@
1
+ /** What a row needs to become the keyboard's idea of one activatable thing. */
2
+ export interface AdwRowActivationInit {
3
+ /** The element that becomes the tab stop and receives the keys. */
4
+ row: HTMLElement;
5
+ /** Re-read on every {@link AdwRowActivation.sync}: is the row activatable right now? */
6
+ activatable: () => boolean;
7
+ /**
8
+ * What Enter and Space do. Defaults to `row.click()` so a row keeps ONE activation
9
+ * path — the click handler it already has — rather than growing a second one that can
10
+ * drift from it.
11
+ */
12
+ activate?: () => void;
13
+ }
14
+ export interface AdwRowActivation {
15
+ /** Re-derive the tab stop after anything that can change `activatable()`. */
16
+ sync(): void;
17
+ }
18
+ /**
19
+ * Make `row` a tab stop while it is activatable, and activate it on Enter and Space.
20
+ *
21
+ * The listener is the element's OWN and is bound once, without teardown: it survives a
22
+ * re-parent and is collected with the element, so there is nothing here for
23
+ * `check-adwaita-connect-rebind.mjs` to hold. Only bindings that reach outside the element
24
+ * need releasing and re-arming.
25
+ */
26
+ export declare function attachRowActivation(init: AdwRowActivationInit): AdwRowActivation;
@@ -0,0 +1,63 @@
1
+ /** Which way the widget pages, and therefore which axis claims a drag. */
2
+ export type AdwSwipeOrientation = 'horizontal' | 'vertical';
3
+ export interface AdwSwipeDragInit {
4
+ /** The element the listeners sit on. Items rebuilt under it stay covered. */
5
+ host: HTMLElement;
6
+ orientation: AdwSwipeOrientation;
7
+ /** Re-read on every press: may a mouse drag start right now? */
8
+ enabled: () => boolean;
9
+ /** Page pitch in px. The raw pixel delta is divided by it to reach progress. */
10
+ pitch: () => number;
11
+ /** Snap points, ascending, as `adw_swipeable_get_snap_points` returns them. */
12
+ points: () => readonly number[];
13
+ /** Progress now — the gesture is seeded from it and bounded by it. */
14
+ progress: () => number;
15
+ /** `AdwCarousel:allow-long-swipes`. */
16
+ allowLongSwipes: () => boolean;
17
+ /**
18
+ * `adw_swipeable_get_cancel_progress` — where a CANCELLED gesture goes.
19
+ *
20
+ * Not optional by accident: the tracker's own fallback is where the gesture began,
21
+ * and `AdwCarousel`'s answer is `get_closest_snap_point` — the point nearest where
22
+ * the finger is NOW (adw-carousel.c:1294-1299). The two differ for exactly the
23
+ * gesture that matters, one cancelled past the halfway mark: upstream commits to the
24
+ * page under the cursor, the fallback yanks it back.
25
+ */
26
+ cancelProgress: () => number;
27
+ /** Show this progress. Called on every move that the gesture owns. */
28
+ onUpdate: (progress: number) => void;
29
+ /**
30
+ * Whether a gesture may be claimed at all right now, on top of the refusals this
31
+ * module makes itself. `AdwCarousel` needs none — its `interactive` and
32
+ * `allow-mouse-drag` are {@link enabled} — but `is_in_swipe_area` lives here for the
33
+ * widgets that implement `get_swipe_area`, which the carousel does not.
34
+ */
35
+ claimable?: (start: {
36
+ x: number;
37
+ y: number;
38
+ }) => boolean;
39
+ /** Settle on this progress. `velocity` is raw px/ms, for an animation duration. */
40
+ onEnd: (progress: number, velocity: number) => void;
41
+ }
42
+ /**
43
+ * Make `host` draggable with a mouse, deciding where it lands the way `AdwSwipeTracker`
44
+ * does.
45
+ *
46
+ * The listener is the element's own and is bound once, without teardown: it survives a
47
+ * re-parent and is collected with the element.
48
+ */
49
+ /** What a caller gets back, so it can tell whether a gesture owns the widget. */
50
+ export interface AdwSwipeDrag {
51
+ /**
52
+ * Whether a gesture is currently claimed.
53
+ *
54
+ * A widget needs this to keep its OTHER inputs out of the offset while a drag owns
55
+ * it. Measured on `<adw-carousel>`: one wheel notch during a claimed drag ran the
56
+ * whole wheel path and jumped `scrollLeft` 80 → 440 in a frame, which the next move
57
+ * then yanked back. Upstream's `scroll_cb` is ungated too, but there the external
58
+ * request is a spring the next frame quietly overrides — here `claim()` sets
59
+ * `scroll-behavior: auto`, which turns it into an instant jump.
60
+ */
61
+ readonly dragging: boolean;
62
+ }
63
+ export declare function attachSwipeDrag(init: AdwSwipeDragInit): AdwSwipeDrag;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Hide each of `sections` exactly while it holds no element children — now, and one
3
+ * MICROTASK after every later childList change.
4
+ *
5
+ * The deferral is what a MutationObserver is; it matters because the derivation used to
6
+ * run synchronously inside `_render()`. It lands before paint, so layout is never wrong,
7
+ * but a caller that appends and measures in the SAME task still reads the old answer —
8
+ * `<adw-toolbar-view>._syncClasses` does exactly that via `offsetHeight`, and its
9
+ * undershoot classes are corrected by the ResizeObserver on the next frame.
10
+ *
11
+ * Element children, not child NODES: whitespace between two slotted bars is a text node
12
+ * and an empty bar full of indentation is still an empty bar — which is also why the
13
+ * CSS `:empty` this looks like cannot express it.
14
+ */
15
+ export declare function bindEmptySections(...sections: readonly HTMLElement[]): void;
@@ -0,0 +1 @@
1
+ export declare const AdwEmptySectionsTest: () => Promise<void>;
@@ -0,0 +1 @@
1
+ export { ADWAITA_FONTS_CSS, ADWAITA_FONTS_STYLE_ID, applyAdwaitaFonts } from '@gjsify/adwaita-fonts/embedded';
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Make `name` drawable by every `.adw-icon` in the document, from an Adwaita symbolic SVG
3
+ * source string (what `@gjsify/adwaita-icons` exports).
4
+ *
5
+ * BOTH arguments are checked and a wrong one THROWS rather than registering nothing: unlike
6
+ * a render, this is an explicit call with a wrong argument, and silently doing nothing is
7
+ * the failure mode this whole area exists to end. The name is normalized exactly as
8
+ * `<adw-icon icon-name>` normalizes it — a single `-symbolic` suffix comes off, and the rest
9
+ * must be one CSS token; the SVG has to parse to an `<svg>` root. `<adw-icon>` draws
10
+ * `image-missing` for the same unusable name instead — there it came from markup, and
11
+ * taking the page down over a typo is not proportionate.
12
+ *
13
+ * Registering a name the stylesheet already compiles is allowed and REPLACES the glyph:
14
+ * the property is set on the document element, so it wins over the `:root` rule.
15
+ *
16
+ * CLIENT-SIDE ONLY: this touches `document.documentElement` and `document.head`, so at
17
+ * module top level in an SSR/SSG build it throws before a page is rendered.
18
+ */
19
+ export declare function registerIcon(name: string, svg: string): void;
20
+ /**
21
+ * Whether `name` has a glyph — compiled into the stylesheet, or registered at runtime.
22
+ *
23
+ * Reads the live cascade rather than a generated list, so it answers for a glyph that
24
+ * arrived by any route, including a consumer's own `--icon-<name>` declaration. It is
25
+ * deliberately the CUSTOM PROPERTY that is read and not the rendered `mask-image` of a
26
+ * probe element: since `_icon.scss` gives every icon box the `image-missing` fallback,
27
+ * a rendered mask is never `none`, and comparing against the fallback would answer
28
+ * `false` for `image-missing` itself — the one name where being drawn and having fallen
29
+ * back look identical.
30
+ *
31
+ * Narrowing worth knowing: a consumer who writes `.adw-icon--x { mask-image: url(…) }`
32
+ * with no matching `--icon-x` gets `false` here and a drawn icon anyway. The generator and
33
+ * {@link registerIcon} are the two things that create the pair, and both create both.
34
+ */
35
+ export declare function isIconAvailable(name: string): boolean;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * What an icon box actually draws. Exported because the vector-driven icon specs
3
+ * (`adw-action-rows`, `adw-button-content`, `split-button`) need the same discriminator:
4
+ * they used to read `classList` alone, which is green on a correctly-applied class over
5
+ * a glyph nobody has.
6
+ */
7
+ export declare const maskOf: (el: HTMLElement) => string;
8
+ /**
9
+ * The `--icon-image-missing` the stylesheet compiles, as the cascade resolves it.
10
+ *
11
+ * Compared by EXACT equality against a computed `mask-image` throughout, which is sound
12
+ * because Firefox serializes both identically — measured, 1336 characters each, byte for
13
+ * byte. A substring test would not be sound: every icon's data URI opens with the same
14
+ * `url("data:image/svg+xml,%3Csvg%20height…` prefix, so a leading slice matches ALL of
15
+ * them, and the first version of this file passed that way while asserting nothing.
16
+ */
17
+ export declare function fallbackMask(): string;
18
+ export declare const AdwIconRegistryTest: () => Promise<void>;
@@ -1,9 +1,9 @@
1
- import '@gjsify/adwaita-fonts';
2
1
  export { addBreakpoints, bindBreakpointSetter } from './breakpoints.js';
3
2
  export { ACCENT_BG_PROPERTY, ACCENT_PROPERTY, applyAdwaitaAccent, clearAdwaitaAccent, isAdwaitaDark, } from './accent.js';
4
3
  export type { ApplyAccentOptions } from './accent.js';
5
4
  export { AdwScrollShading } from './scroll-shading.js';
6
5
  export type { AdwUndershootEdges } from './scroll-shading.js';
6
+ export { isIconAvailable, registerIcon } from './icon-registry.js';
7
7
  export { AdwAvatar } from './elements/adw-avatar.js';
8
8
  export { AdwBanner } from './elements/adw-banner.js';
9
9
  export { AdwCard } from './elements/adw-card.js';
@@ -0,0 +1 @@
1
+ export declare const AdwKeyboardOperableTest: () => Promise<void>;