@gjsify/adwaita-web 0.30.0 → 0.32.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 (176) hide show
  1. package/dist/adwaita-web.css +786 -272
  2. package/dist/adwaita-web.css.map +1 -1
  3. package/lib/types/adw-about-dialog.spec.d.ts +1 -0
  4. package/lib/types/adw-action-rows.spec.d.ts +1 -0
  5. package/lib/types/adw-avatar.spec.d.ts +1 -0
  6. package/lib/types/adw-banner.spec.d.ts +1 -0
  7. package/lib/types/adw-button-content.spec.d.ts +1 -0
  8. package/lib/types/adw-carousel.spec.d.ts +1 -0
  9. package/lib/types/adw-checks.spec.d.ts +1 -0
  10. package/lib/types/adw-header-bar.spec.d.ts +1 -0
  11. package/lib/types/adw-icon.spec.d.ts +1 -0
  12. package/lib/types/adw-progress-bar.spec.d.ts +1 -0
  13. package/lib/types/adw-sidebar.spec.d.ts +1 -0
  14. package/lib/types/adw-switch.spec.d.ts +1 -0
  15. package/lib/types/adw-wrap-box.spec.d.ts +1 -0
  16. package/lib/types/bottom-sheet.spec.d.ts +1 -0
  17. package/lib/types/breakpoints.d.ts +22 -0
  18. package/lib/types/breakpoints.spec.d.ts +1 -0
  19. package/lib/types/chrome.spec.d.ts +1 -0
  20. package/lib/types/elements/adw-about-dialog.d.ts +47 -8
  21. package/lib/types/elements/adw-action-row.d.ts +35 -0
  22. package/lib/types/elements/adw-avatar.d.ts +11 -0
  23. package/lib/types/elements/adw-bottom-sheet.d.ts +33 -4
  24. package/lib/types/elements/adw-button-content.d.ts +12 -0
  25. package/lib/types/elements/adw-button-row.d.ts +10 -1
  26. package/lib/types/elements/adw-carousel.d.ts +111 -8
  27. package/lib/types/elements/adw-checks.d.ts +57 -0
  28. package/lib/types/elements/adw-clamp.d.ts +4 -1
  29. package/lib/types/elements/adw-data-grid.d.ts +11 -31
  30. package/lib/types/elements/adw-drop-down.d.ts +17 -20
  31. package/lib/types/elements/adw-entry-row.d.ts +93 -3
  32. package/lib/types/elements/adw-expander-row.d.ts +7 -1
  33. package/lib/types/elements/adw-header-bar.d.ts +15 -0
  34. package/lib/types/elements/adw-icon.d.ts +25 -0
  35. package/lib/types/elements/adw-inline-view-switcher.d.ts +37 -11
  36. package/lib/types/elements/adw-menu-button.d.ts +6 -6
  37. package/lib/types/elements/adw-navigation-split-view.d.ts +6 -0
  38. package/lib/types/elements/adw-navigation-view.d.ts +63 -20
  39. package/lib/types/elements/adw-overlay-split-view.d.ts +38 -0
  40. package/lib/types/elements/adw-password-entry-row.d.ts +19 -10
  41. package/lib/types/elements/adw-popover.d.ts +58 -0
  42. package/lib/types/elements/adw-preferences-dialog.d.ts +57 -2
  43. package/lib/types/elements/adw-preferences-group.d.ts +31 -0
  44. package/lib/types/elements/adw-progress-bar.d.ts +38 -0
  45. package/lib/types/elements/adw-sidebar.d.ts +37 -5
  46. package/lib/types/elements/adw-split-button.d.ts +53 -7
  47. package/lib/types/elements/adw-switch-row.d.ts +11 -2
  48. package/lib/types/elements/adw-switch.d.ts +15 -0
  49. package/lib/types/elements/adw-tab-view.d.ts +129 -12
  50. package/lib/types/elements/adw-toolbar-view.d.ts +5 -0
  51. package/lib/types/elements/adw-view-stack.d.ts +27 -19
  52. package/lib/types/elements/adw-view-switcher-bar.d.ts +23 -7
  53. package/lib/types/elements/adw-view-switcher.d.ts +22 -11
  54. package/lib/types/elements/adw-window-title.d.ts +3 -1
  55. package/lib/types/elements/view-switcher-dom.d.ts +44 -0
  56. package/lib/types/entry-rows.spec.d.ts +1 -0
  57. package/lib/types/index.d.ts +7 -0
  58. package/lib/types/navigation-view.spec.d.ts +1 -0
  59. package/lib/types/preferences-search.d.ts +20 -0
  60. package/lib/types/preferences.spec.d.ts +1 -0
  61. package/lib/types/split-button.spec.d.ts +1 -0
  62. package/lib/types/split-views.spec.d.ts +1 -0
  63. package/lib/types/styles.generated.d.ts +1 -1
  64. package/lib/types/tab-view.spec.d.ts +1 -0
  65. package/lib/types/view-stack.spec.d.ts +1 -0
  66. package/lib/types/view-switcher.spec.d.ts +1 -0
  67. package/package.json +6 -6
  68. package/scss/_banner.scss +13 -0
  69. package/scss/_bottom_sheet.scss +5 -6
  70. package/scss/_button.scss +3 -26
  71. package/scss/_button_content.scss +28 -0
  72. package/scss/_checks.scss +228 -0
  73. package/scss/_clamp.scss +9 -3
  74. package/scss/_data_grid.scss +15 -7
  75. package/scss/_drop_down.scss +12 -55
  76. package/scss/_expander_row.scss +5 -50
  77. package/scss/_icon.scss +51 -0
  78. package/scss/_icons.generated.scss +6 -0
  79. package/scss/_inline_view_switcher.scss +34 -0
  80. package/scss/_labels.scss +135 -0
  81. package/scss/_menu_button.scss +10 -70
  82. package/scss/_popover.scss +186 -0
  83. package/scss/_preferences.scss +29 -0
  84. package/scss/_preferences_dialog.scss +17 -0
  85. package/scss/_progress_bar.scss +161 -0
  86. package/scss/_reset.scss +18 -7
  87. package/scss/_spinner.scss +7 -3
  88. package/scss/_split_button.scss +6 -50
  89. package/scss/_switch.scss +90 -0
  90. package/scss/_switch_row.scss +6 -52
  91. package/scss/_tab_view.scss +64 -0
  92. package/scss/_theme.scss +10 -0
  93. package/scss/_toolbar_view.scss +74 -0
  94. package/scss/_variables.scss +34 -0
  95. package/scss/_view_switcher.scss +40 -0
  96. package/scss/_view_switcher_bar.scss +37 -0
  97. package/scss/_wrap_box.scss +56 -6
  98. package/scss/adwaita-skin.scss +23 -0
  99. package/src/adw-about-dialog.spec.ts +350 -0
  100. package/src/adw-action-rows.spec.ts +342 -0
  101. package/src/adw-avatar.spec.ts +139 -0
  102. package/src/adw-banner.spec.ts +152 -0
  103. package/src/adw-button-content.spec.ts +183 -0
  104. package/src/adw-button-row.spec.ts +12 -6
  105. package/src/adw-carousel.spec.ts +389 -0
  106. package/src/adw-checks.spec.ts +368 -0
  107. package/src/adw-drop-down.spec.ts +123 -0
  108. package/src/adw-header-bar.spec.ts +83 -0
  109. package/src/adw-icon.spec.ts +167 -0
  110. package/src/adw-progress-bar.spec.ts +173 -0
  111. package/src/adw-sidebar.spec.ts +332 -0
  112. package/src/adw-switch.spec.ts +242 -0
  113. package/src/adw-tab-view.spec.ts +12 -3
  114. package/src/adw-view-switcher-bar.spec.ts +61 -13
  115. package/src/adw-wrap-box.spec.ts +194 -0
  116. package/src/bottom-sheet.spec.ts +325 -0
  117. package/src/breakpoints.spec.ts +147 -0
  118. package/src/breakpoints.ts +67 -0
  119. package/src/chrome.spec.ts +301 -0
  120. package/src/elements/adw-about-dialog.ts +223 -163
  121. package/src/elements/adw-action-row.ts +120 -10
  122. package/src/elements/adw-avatar.ts +48 -54
  123. package/src/elements/adw-banner.ts +46 -10
  124. package/src/elements/adw-bottom-sheet.ts +145 -60
  125. package/src/elements/adw-button-content.ts +107 -33
  126. package/src/elements/adw-button-row.ts +61 -37
  127. package/src/elements/adw-button.ts +5 -7
  128. package/src/elements/adw-carousel.ts +467 -105
  129. package/src/elements/adw-checks.ts +299 -0
  130. package/src/elements/adw-clamp.ts +80 -10
  131. package/src/elements/adw-combo-row.ts +15 -7
  132. package/src/elements/adw-data-grid.ts +43 -91
  133. package/src/elements/adw-drop-down.ts +117 -128
  134. package/src/elements/adw-entry-row.ts +404 -36
  135. package/src/elements/adw-expander-row.ts +61 -29
  136. package/src/elements/adw-header-bar.ts +31 -6
  137. package/src/elements/adw-icon.ts +148 -0
  138. package/src/elements/adw-inline-view-switcher.ts +240 -129
  139. package/src/elements/adw-menu-button.ts +93 -70
  140. package/src/elements/adw-navigation-split-view.ts +48 -7
  141. package/src/elements/adw-navigation-view.ts +286 -148
  142. package/src/elements/adw-overlay-split-view.ts +164 -14
  143. package/src/elements/adw-password-entry-row.ts +111 -89
  144. package/src/elements/adw-popover.ts +283 -0
  145. package/src/elements/adw-preferences-dialog.ts +120 -21
  146. package/src/elements/adw-preferences-group.ts +128 -22
  147. package/src/elements/adw-progress-bar.ts +189 -0
  148. package/src/elements/adw-sidebar.ts +301 -142
  149. package/src/elements/adw-spin-row.ts +11 -5
  150. package/src/elements/adw-spinner.ts +23 -8
  151. package/src/elements/adw-split-button.ts +371 -92
  152. package/src/elements/adw-status-page.ts +9 -9
  153. package/src/elements/adw-switch-row.ts +100 -30
  154. package/src/elements/adw-switch.ts +129 -0
  155. package/src/elements/adw-tab-view.ts +682 -129
  156. package/src/elements/adw-toggle-group.ts +5 -7
  157. package/src/elements/adw-toolbar-view.ts +84 -21
  158. package/src/elements/adw-view-stack.ts +162 -85
  159. package/src/elements/adw-view-switcher-bar.ts +163 -81
  160. package/src/elements/adw-view-switcher.ts +231 -112
  161. package/src/elements/adw-window-title.ts +44 -11
  162. package/src/elements/adw-wrap-box.ts +131 -35
  163. package/src/elements/view-switcher-dom.ts +108 -0
  164. package/src/entry-rows.spec.ts +391 -0
  165. package/src/index.ts +23 -0
  166. package/src/navigation-view.spec.ts +435 -0
  167. package/src/preferences-search.ts +135 -0
  168. package/src/preferences.spec.ts +250 -0
  169. package/src/source-view/adw-source-view.ts +2 -5
  170. package/src/split-button.spec.ts +470 -0
  171. package/src/split-views.spec.ts +309 -0
  172. package/src/styles.generated.ts +1 -1
  173. package/src/tab-view.spec.ts +451 -0
  174. package/src/test.browser.mts +49 -0
  175. package/src/view-stack.spec.ts +272 -0
  176. package/src/view-switcher.spec.ts +446 -0
@@ -1,34 +1,32 @@
1
- /** A dropdown option — `value` is the stable id, `label` the shown text. */
2
- export interface AdwDropDownOption {
3
- value: string;
4
- label: string;
5
- }
6
- type RawOption = string | {
7
- value?: unknown;
8
- label?: unknown;
9
- };
1
+ import './adw-popover.js';
2
+ import type { AdwComboOption, AdwComboOptionInput } from '@gjsify/adwaita-core';
3
+ /**
4
+ * A dropdown option — `value` is the stable id, `label` the shown text.
5
+ *
6
+ * An alias of core's {@link AdwComboOption}: the drop-down and the combo row are
7
+ * the same selection model behind two chromes, and they had two names for one
8
+ * descriptor. Kept exported so the published type name does not break.
9
+ */
10
+ export type AdwDropDownOption = AdwComboOption;
10
11
  export declare class AdwDropDown extends HTMLElement {
11
12
  private _buttonEl;
12
13
  private _labelEl;
13
14
  private _popoverEl;
14
15
  private _listEl;
15
16
  private _searchEl;
16
- private _options;
17
17
  private _itemButtons;
18
- private _selected;
19
- private _active;
18
+ /** The headless options list + selectedIndex↔selectedValue machine (ADR 0004). */
19
+ private readonly _state;
20
20
  private _initialized;
21
21
  private _typeAheadBuffer;
22
22
  private _typeAheadTimer;
23
- private _onDocumentPointerDown;
24
- private _onDocumentKeyDown;
25
23
  static get observedAttributes(): string[];
26
24
  /** The options list. Setting it rebuilds the popover and clamps the selection. */
27
25
  get options(): AdwDropDownOption[];
28
- set options(value: ReadonlyArray<RawOption>);
26
+ set options(value: ReadonlyArray<AdwComboOptionInput>);
29
27
  /** Alias of `options` (Gtk.DropDown's model is often called "items"). */
30
28
  get items(): AdwDropDownOption[];
31
- set items(value: ReadonlyArray<RawOption>);
29
+ set items(value: ReadonlyArray<AdwComboOptionInput>);
32
30
  /** The selected index. Out-of-range values are ignored (Gtk.DropDown:selected). */
33
31
  get selected(): number;
34
32
  set selected(value: number);
@@ -43,13 +41,13 @@ export declare class AdwDropDown extends HTMLElement {
43
41
  /** Whether the popover is currently open. */
44
42
  get active(): boolean;
45
43
  connectedCallback(): void;
46
- disconnectedCallback(): void;
47
44
  attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
48
45
  private _parseOptionsAttr;
49
46
  private _selectIndex;
50
- private _setActive;
47
+ private _onPopoverToggled;
51
48
  private _onButtonKeyDown;
52
- private _onPopoverKeyDown;
49
+ /** Printable keys inside an OPEN popover, when there is no search entry to type into. */
50
+ private _onPopoverTypeAhead;
53
51
  /** Type-ahead: accumulate keys, focus/select the next matching option. */
54
52
  private _typeAhead;
55
53
  /** Filter the visible items by a search query (case-insensitive substring). */
@@ -60,4 +58,3 @@ export declare class AdwDropDown extends HTMLElement {
60
58
  private _updateSelectedStates;
61
59
  private _renderPopover;
62
60
  }
63
- export {};
@@ -1,10 +1,100 @@
1
+ import { EntryRowState, type EntryRowRenderState } from '@gjsify/adwaita-core';
2
+ import { type AdwIcon } from './adw-icon.js';
1
3
  export declare class AdwEntryRow extends HTMLElement {
2
- private _input;
3
- private _titleEl;
4
- private _initialized;
4
+ /** The headless `update_empty` derivation + apply latch (ADR 0004). */
5
+ protected readonly _state: EntryRowState;
6
+ protected _input: HTMLInputElement;
7
+ /** The large placeholder title (`empty_title` in adw-entry-row.ui). */
8
+ protected _emptyTitle: HTMLSpanElement;
9
+ /** The small label above the value (`title` in adw-entry-row.ui). */
10
+ protected _title: HTMLSpanElement;
11
+ /** The `editable-area` gizmo: both titles plus the input. */
12
+ protected _area: HTMLDivElement;
13
+ protected _editIcon: AdwIcon;
14
+ protected _indicator: HTMLSpanElement;
15
+ protected _applyButton: HTMLButtonElement;
16
+ protected _prefixes: HTMLDivElement;
17
+ protected _suffixes: HTMLDivElement;
18
+ protected _initialized: boolean;
19
+ /** Light-DOM children captured at build time, adopted after `_onConnected`. */
20
+ private _authored;
21
+ private _lastText;
22
+ private _lastLength;
5
23
  static get observedAttributes(): string[];
24
+ /**
25
+ * Class-name prefix for this row's parts. `<adw-password-entry-row>`
26
+ * overrides it so `_password_entry_row.scss` keeps matching its own parts —
27
+ * the two SCSS partials are near-identical but each scopes to its own tag.
28
+ */
29
+ protected get _classPrefix(): string;
30
+ /** The editable text. */
6
31
  get text(): string;
7
32
  set text(value: string);
33
+ /** `Adw.EntryRow:text-length` — the number of CHARACTERS, not UTF-16 units. */
34
+ get textLength(): number;
35
+ /** `Adw.EntryRow:max-length` — maximum number of characters, `0` = unlimited. */
36
+ get maxLength(): number;
37
+ set maxLength(value: number);
38
+ /** Whether the entry accepts edits (`GtkEditable:editable`). */
39
+ get editable(): boolean;
40
+ set editable(value: boolean);
41
+ /** `Adw.EntryRow:show-apply-button` — typing reveals an apply button. */
42
+ get showApplyButton(): boolean;
43
+ set showApplyButton(value: boolean);
44
+ /** `Adw.EntryRow:activates-default` — Enter may submit the surrounding form. */
45
+ get activatesDefault(): boolean;
46
+ set activatesDefault(value: boolean);
47
+ /** Whether the embedded entry currently has focus. */
48
+ get editing(): boolean;
8
49
  connectedCallback(): void;
9
50
  attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
51
+ /**
52
+ * Add a widget after the editable area — `adw_entry_row_add_suffix`
53
+ * (adw-entry-row.c:885-899), which APPENDS into a box, so several suffixes
54
+ * coexist and the password row's own peek toggle survives a consumer's.
55
+ */
56
+ addSuffix(node: Node): void;
57
+ /**
58
+ * Add a widget before the editable area — `adw_entry_row_add_prefix`
59
+ * (C:864-880). PREPENDS, like the `gtk_box_prepend` it mirrors, so several
60
+ * prefixes stack in reverse call order exactly as they do in GTK.
61
+ */
62
+ addPrefix(node: Node): void;
63
+ /**
64
+ * Drive the trailing indicator — `adw_entry_row_set_show_indicator`
65
+ * (adw-entry-row-private.h, C:1281-1296). Private-to-the-library upstream,
66
+ * public here because `<adw-password-entry-row>` is a separate custom element
67
+ * rather than a C subclass with access to the private header.
68
+ */
69
+ setShowIndicator(show: boolean): void;
70
+ /** `adw_entry_row_set_indicator_icon_name` (C:1263-1273). */
71
+ setIndicatorIconName(iconName: string): void;
72
+ /** `adw_entry_row_set_indicator_tooltip` (C:1275-1279). */
73
+ setIndicatorTooltip(tooltip: string): void;
74
+ /** Apply the pending edit — the apply button click (C:229-241). */
75
+ apply(): void;
76
+ /** Focus the entry without selecting — `adw_entry_row_grab_focus_without_selecting` (C:1379-1389). */
77
+ grabFocusWithoutSelecting(): boolean;
78
+ /** Subclass hook: runs after the DOM exists and the state is seeded, before the first render. */
79
+ protected _onConnected(): void;
80
+ private _build;
81
+ /**
82
+ * Re-home the children the author wrote. libadwaita's buildable maps an
83
+ * untyped `<child>` to a suffix (C:796-812); `slot="prefix"` is the web
84
+ * spelling of its `type="prefix"`.
85
+ */
86
+ private _adoptAuthored;
87
+ /**
88
+ * `pressed_cb` (C:201-227): a click landing on the row, the editable area,
89
+ * the indicator or either affordance box grabs focus; anything else (a suffix
90
+ * control, the apply button) is left alone. The pencil is `can-target=False`
91
+ * in the .ui, so a click on it picks the editable area — hence it focuses too.
92
+ */
93
+ private _maybeFocus;
94
+ /** `text_activated_cb` (C:243-266) — exactly one of the two signals. */
95
+ private _activate;
96
+ private _renderTitle;
97
+ /** Paint one render snapshot. Overridden (via `super`) by the password row. */
98
+ protected _render(state: EntryRowRenderState): void;
99
+ private _onStateChanged;
10
100
  }
@@ -1,9 +1,9 @@
1
+ import './adw-switch.js';
1
2
  export declare class AdwExpanderRow extends HTMLElement {
2
3
  private _headerEl;
3
4
  private _titleEl;
4
5
  private _subtitleEl;
5
6
  private _enableSwitch;
6
- private _enableLabel;
7
7
  private _chevronEl;
8
8
  private _contentEl;
9
9
  private _prefixEl;
@@ -11,6 +11,12 @@ export declare class AdwExpanderRow extends HTMLElement {
11
11
  /** The headless expanded/collapsed disclosure state machine (ADR 0004). */
12
12
  private readonly _state;
13
13
  private _initialized;
14
+ /**
15
+ * Guards the enable switch's `notify::active` while WE are the ones writing
16
+ * it. Only a user toggle publishes `notify::enable-expansion`; a programmatic
17
+ * `enableExpansion = …` re-syncs the control silently, as it always has.
18
+ */
19
+ private _reflectingEnable;
14
20
  constructor();
15
21
  static get observedAttributes(): string[];
16
22
  get expanded(): boolean;
@@ -3,6 +3,13 @@ export declare class AdwHeaderBar extends HTMLElement {
3
3
  private _startEl;
4
4
  private _centerEl;
5
5
  private _endEl;
6
+ /**
7
+ * The generated title span, or `null` when a `slot="center"` title-widget
8
+ * took the centre. `Adw.HeaderBar` has the same either/or: setting
9
+ * `title-widget` replaces the derived `AdwWindowTitle` outright.
10
+ */
11
+ private _titleEl;
12
+ static get observedAttributes(): string[];
6
13
  /** The start (left) section container — append buttons/widgets here. */
7
14
  get startSection(): HTMLDivElement | null;
8
15
  /** The center (title) section — holds the `title` text or any `slot="center"`
@@ -11,4 +18,12 @@ export declare class AdwHeaderBar extends HTMLElement {
11
18
  /** The end (right) section container — append buttons/widgets here. */
12
19
  get endSection(): HTMLDivElement | null;
13
20
  connectedCallback(): void;
21
+ /**
22
+ * `title` used to be read ONCE, in `connectedCallback`, so every later write
23
+ * was a silent no-op — a header bar whose title tracked the open document
24
+ * kept whatever it was created with. `Adw.HeaderBar`'s derived title widget
25
+ * is bound to the property and re-renders on every change.
26
+ */
27
+ attributeChangedCallback(name: string): void;
28
+ private _renderTitle;
14
29
  }
@@ -0,0 +1,25 @@
1
+ export declare class AdwIcon extends HTMLElement {
2
+ static get observedAttributes(): string[];
3
+ /** The declared symbolic name, `-symbolic` suffix optional. */
4
+ get iconName(): string;
5
+ set iconName(value: string | null);
6
+ /**
7
+ * The name that actually reached the mask class — `''` when the icon-name is
8
+ * 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.
10
+ */
11
+ get resolvedIconName(): string;
12
+ /** The rendered edge length in px, or `null` when the stylesheet decides. */
13
+ get size(): number | null;
14
+ set size(value: number | null);
15
+ connectedCallback(): void;
16
+ attributeChangedCallback(): void;
17
+ private _render;
18
+ }
19
+ /**
20
+ * Build one icon node: the three lines every caller would otherwise write.
21
+ *
22
+ * `extraClasses` are the caller's own positioning/context classes, added
23
+ * alongside the managed `.adw-icon` + mask class rather than replacing them.
24
+ */
25
+ export declare function createAdwIcon(iconName: string | null, ...extraClasses: string[]): AdwIcon;
@@ -1,30 +1,56 @@
1
- /** The three display modes, mirroring AdwInlineViewSwitcherDisplayMode. */
2
- declare const DISPLAY_MODES: readonly ["labels", "icons", "both"];
3
- type DisplayMode = (typeof DISPLAY_MODES)[number];
1
+ import type { AdwInlineViewSwitcherDisplayMode, AdwViewSwitcherPage } from '@gjsify/adwaita-core';
4
2
  /** A single page. Children of <adw-inline-view-switcher>; consumed at connect time. */
5
3
  export declare class AdwViewStackPage extends HTMLElement {
6
4
  static get observedAttributes(): string[];
7
5
  }
8
6
  export declare class AdwInlineViewSwitcher extends HTMLElement {
7
+ private readonly _state;
9
8
  private _groupEl;
10
9
  private _pagesEl;
10
+ private _panels;
11
11
  private _toggles;
12
- private _pages;
13
- private _active;
14
12
  private _displayMode;
15
13
  private _initialized;
16
14
  static get observedAttributes(): string[];
17
- /** Zero-based index of the visible page. */
15
+ constructor();
16
+ /** Zero-based index of the visible PAGE, `-1` when nothing is selected. */
18
17
  get active(): number;
19
18
  set active(value: number);
19
+ /**
20
+ * Index of the ACTIVE TOGGLE, `-1` when the visible page has none because it
21
+ * is hidden — the port-safe `GTK_INVALID_LIST_POSITION`
22
+ * (adw-inline-view-switcher.c:441-446).
23
+ */
24
+ get activeToggle(): number;
20
25
  /** What the toggles display: 'labels', 'icons' or 'both'. */
21
- get displayMode(): DisplayMode;
22
- set displayMode(value: DisplayMode);
26
+ get displayMode(): AdwInlineViewSwitcherDisplayMode;
27
+ set displayMode(value: AdwInlineViewSwitcherDisplayMode);
28
+ /** Name of the visible page, `''` when nothing is selected. */
29
+ get visibleChildName(): string;
30
+ set visibleChildName(name: string | null | undefined);
31
+ /** The resolved page records. */
32
+ get pages(): readonly AdwViewSwitcherPage[];
33
+ /**
34
+ * Show or hide a page. Returns whether the SELECTION moved. Rebuilds the
35
+ * toggle row, because a hidden page has no toggle at all — C reacts to a
36
+ * page's `notify::visible` with `recreate_toggles`
37
+ * (adw-inline-view-switcher.c:425, :471-477).
38
+ */
39
+ setPageVisible(name: string, visible: boolean): boolean;
23
40
  connectedCallback(): void;
41
+ disconnectedCallback(): void;
24
42
  attributeChangedCallback(name: string): void;
25
- private _readActiveAttr;
26
43
  private _readDisplayModeAttr;
27
- private _selectIndex;
44
+ /**
45
+ * Rebuild the toggle row from the derived models. One node per VISIBLE page,
46
+ * in compacted order — the structural half of `recreate_toggles`. Selection
47
+ * alone never lands here: `selection_changed_cb` only sets the active toggle
48
+ * (adw-inline-view-switcher.c:434-453), and rebuilding mid-drag would drop
49
+ * the dwell the drag has already armed.
50
+ */
51
+ private _rebuildToggles;
52
+ private _onStateChange;
28
53
  private _render;
54
+ private _applyStyleClasses;
55
+ private _reflectActive;
29
56
  }
30
- export {};
@@ -1,3 +1,5 @@
1
+ import type { SplitButtonDirection } from '@gjsify/adwaita-core';
2
+ import './adw-popover.js';
1
3
  /** A menu entry. `id` defaults to `label` on activation; `icon` is optional. */
2
4
  export interface AdwMenuItem {
3
5
  id?: string;
@@ -9,11 +11,8 @@ export declare class AdwMenuButton extends HTMLElement {
9
11
  private _popoverEl;
10
12
  private _items;
11
13
  private _menuTitle;
12
- private _active;
13
14
  private _initialized;
14
15
  private _itemButtons;
15
- private _onDocumentPointerDown;
16
- private _onDocumentKeyDown;
17
16
  static get observedAttributes(): string[];
18
17
  /** Whether the popover menu is currently open. */
19
18
  get active(): boolean;
@@ -23,12 +22,13 @@ export declare class AdwMenuButton extends HTMLElement {
23
22
  /** The optional popover heading. */
24
23
  get menuTitle(): string;
25
24
  set menuTitle(value: string);
25
+ /** Where the popover opens, and (via core) which way `none` folds. */
26
+ get direction(): SplitButtonDirection;
27
+ set direction(value: SplitButtonDirection);
26
28
  connectedCallback(): void;
27
- disconnectedCallback(): void;
28
29
  attributeChangedCallback(name: string): void;
29
30
  private _parseMenuAttr;
30
- private _setActive;
31
- private _onMenuKeyDown;
31
+ private _onPopoverToggled;
32
32
  private _render;
33
33
  private _renderMenu;
34
34
  }
@@ -2,6 +2,7 @@ export declare class AdwNavigationSplitView extends HTMLElement {
2
2
  private _sidebarEl;
3
3
  private _contentEl;
4
4
  private _initialized;
5
+ private _disposeBreakpoint;
5
6
  static get observedAttributes(): string[];
6
7
  get collapsed(): boolean;
7
8
  set collapsed(v: boolean);
@@ -9,7 +10,12 @@ export declare class AdwNavigationSplitView extends HTMLElement {
9
10
  get showContent(): boolean;
10
11
  set showContent(v: boolean);
11
12
  connectedCallback(): void;
13
+ disconnectedCallback(): void;
12
14
  attributeChangedCallback(name: string): void;
13
15
  private _syncWidth;
16
+ /** A pixel attribute, falling back to the widget's own default. */
17
+ private _widthAttr;
14
18
  private _syncClasses;
19
+ /** (Re)bind the `breakpoint` condition to `collapsed`. */
20
+ private _syncBreakpoint;
15
21
  }
@@ -1,65 +1,108 @@
1
1
  /** A single navigation page. Children of <adw-navigation-view>. */
2
2
  export declare class AdwNavigationPage extends HTMLElement {
3
+ /** Set while the owning view writes an attribute back, so the sync cannot recurse. */
4
+ private _syncing;
3
5
  static get observedAttributes(): string[];
4
6
  get title(): string;
5
7
  set title(value: string);
6
8
  get tag(): string | null;
7
9
  set tag(value: string | null);
8
- /** Whether the page can be popped (and thus shows a back button). */
10
+ /** Whether the page can be popped by a shortcut or the back button. */
9
11
  get canPop(): boolean;
10
12
  set canPop(value: boolean);
13
+ attributeChangedCallback(name: string, previous: string | null): void;
14
+ /** Put an attribute back the way it was, without re-entering the sync. */
15
+ revertAttribute(name: string, value: string | null): void;
11
16
  }
12
17
  export declare class AdwNavigationView extends HTMLElement {
13
18
  private _pagesEl;
14
- private _pages;
15
- private _stack;
16
- private _dynamic;
17
- private _backButtons;
19
+ private readonly _backButtons;
18
20
  private _initialized;
21
+ private readonly _diagnose;
22
+ private readonly _state;
19
23
  static get observedAttributes(): string[];
20
24
  /** Whether push/pop transitions are animated. */
21
25
  get animateTransitions(): boolean;
22
26
  set animateTransitions(value: boolean);
27
+ /** Whether pressing Escape pops the visible page (Adw.NavigationView:pop-on-escape). */
28
+ get popOnEscape(): boolean;
29
+ set popOnEscape(value: boolean);
23
30
  /** The currently-visible page (top of the stack), or null when empty. */
24
31
  get visiblePage(): AdwNavigationPage | null;
25
32
  /** The tag of the visible page, or null. */
26
33
  get visiblePageTag(): string | null;
34
+ /** The number of pages on the navigation stack. */
35
+ get depth(): number;
36
+ /** The navigation stack, bottom-first (Adw.NavigationView:navigation-stack). */
37
+ get navigationStack(): readonly AdwNavigationPage[];
38
+ /** Every page this view knows — static and dynamically pushed. */
39
+ get pages(): readonly AdwNavigationPage[];
40
+ /** Whether the automatic back button is shown (AdwBackButton's visibility rule). */
41
+ get canGoBack(): boolean;
42
+ /** The back button's tooltip — the previous page's title, or null when there is no button. */
43
+ get backButtonTooltip(): string | null;
27
44
  connectedCallback(): void;
28
- attributeChangedCallback(): void;
45
+ attributeChangedCallback(name: string): void;
46
+ /**
47
+ * Push a page property change into the core. Called by
48
+ * {@link AdwNavigationPage.attributeChangedCallback}; a rename the core rejects
49
+ * (the tag is taken) is rolled back, because the attribute must not disagree
50
+ * with the tag index `push-by-tag` resolves against.
51
+ */
52
+ syncPageProperty(page: AdwNavigationPage, name: string, previous: string | null): void;
29
53
  /**
30
54
  * Add a static page without pushing it (mirrors AdwNavigationView.add). The
31
55
  * view keeps a reference; the page becomes reachable via push-by-tag. Named
32
56
  * `addPage` rather than `add` to avoid clashing with any DOM method.
33
57
  */
34
- addPage(page: AdwNavigationPage): void;
58
+ addPage(page: AdwNavigationPage): boolean;
35
59
  /**
36
- * Remove a static page (mirrors AdwNavigationView.remove). Named `removePage`
37
- * to avoid overriding HTMLElement.remove() (which takes no arguments).
60
+ * Remove a page (mirrors AdwNavigationView.remove). A page that is on the
61
+ * stack is removed once it is POPPED, not now. Named `removePage` to avoid
62
+ * overriding HTMLElement.remove() (which takes no arguments).
38
63
  */
39
- removePage(page: AdwNavigationPage): void;
64
+ removePage(page: AdwNavigationPage): boolean;
40
65
  /**
41
66
  * Push a page onto the navigation stack (mirrors AdwNavigationView.push).
42
67
  * Accepts a page element or, when given a string, the tag of a known page
43
- * (push-by-tag, mirrors AdwNavigationView.push_by_tag). A page that is not
44
- * already known is added dynamically and destroyed when it is popped.
68
+ * (push-by-tag). A page that is not already known is added dynamically and
69
+ * destroyed when it is popped.
45
70
  */
46
- push(pageOrTag: AdwNavigationPage | string): void;
71
+ push(pageOrTag: AdwNavigationPage | string): boolean;
72
+ /** Push the page carrying `tag` (mirrors AdwNavigationView.push_by_tag). */
73
+ pushByTag(tag: string): boolean;
47
74
  /**
48
75
  * Pop the visible page off the stack (mirrors AdwNavigationView.pop).
49
- * Returns true when a page was popped. A dynamically-pushed page is removed
50
- * from the DOM. The root page cannot be popped.
76
+ * Returns true when a page was popped. The root page cannot be popped.
77
+ * `can-pop` does NOT gate this — it gates the shortcuts and the back button.
51
78
  */
52
79
  pop(): boolean;
53
- /** Pop every page down to (and including pushing) the given tag's page. */
80
+ /** Pop until `page` is visible, in ONE transition (mirrors AdwNavigationView.pop_to_page). */
81
+ popToPage(page: AdwNavigationPage): boolean;
82
+ /** Pop until the page carrying `tag` is visible (mirrors AdwNavigationView.pop_to_tag). */
54
83
  popToTag(tag: string): boolean;
55
84
  /**
56
- * Replace the whole navigation stack with the given pages (mirrors
57
- * AdwNavigationView.replace). The last page becomes visible.
85
+ * Replace the whole navigation stack (mirrors AdwNavigationView.replace). The
86
+ * last page becomes visible; the transition is never animated.
87
+ *
88
+ * String entries are resolved BEFORE anything is mutated — the C does the same
89
+ * in replace_with_tags:3136-3147, and resolving late is what used to lose a
90
+ * dynamically-pushed page and blank the view.
58
91
  */
59
- replace(pages: Array<AdwNavigationPage | string>): void;
60
- private _resolvePage;
92
+ replace(pages: ReadonlyArray<AdwNavigationPage | string | null>): void;
93
+ /** Replace the stack with the pages carrying `tags` (mirrors AdwNavigationView.replace_with_tags). */
94
+ replaceWithTags(tags: readonly string[]): void;
95
+ /** The page with this tag, or null (mirrors AdwNavigationView.find_page). */
96
+ findPage(tag: string): AdwNavigationPage | null;
97
+ /** The page popping `page` would reveal (mirrors AdwNavigationView.get_previous_page). */
98
+ getPreviousPage(page: AdwNavigationPage): AdwNavigationPage | null;
99
+ private _onChange;
100
+ private _dispatch;
101
+ private readonly _onKeyDown;
61
102
  private _syncClasses;
62
103
  private _render;
104
+ private _attach;
105
+ private _detach;
63
106
  /** Inject (or remove) the automatic back button on the visible page. */
64
107
  private _syncBackButton;
65
108
  private _removeBackButton;
@@ -3,6 +3,23 @@ export declare class AdwOverlaySplitView extends HTMLElement {
3
3
  private _sidebarEl;
4
4
  private _contentEl;
5
5
  private _backdropEl;
6
+ private _disposeBreakpoint;
7
+ /**
8
+ * The single source of truth for the property interplay, shared with the
9
+ * NativeScript renderer (ADR 0004). The element owns the attributes and the
10
+ * painting; every rule about what `collapsed` + `show-sidebar` + `pin-sidebar`
11
+ * MEAN together lives in core, held to `OVERLAY_COLLAPSE_VECTORS`.
12
+ */
13
+ private _state;
14
+ /** Re-entrancy guard for {@link _reflectShowSidebar}. */
15
+ private _reflecting;
16
+ /**
17
+ * Every attribute {@link _readAttribute} handles must be listed here — an
18
+ * unobserved attribute never reaches `attributeChangedCallback`, so its branch
19
+ * is DEAD after construction. `pin-sidebar` was missing, which made the
20
+ * property that suppresses the collapse coupling settable only in the markup
21
+ * a parser saw: `view.setAttribute('pin-sidebar', '')` did nothing at all.
22
+ */
6
23
  static get observedAttributes(): string[];
7
24
  get showSidebar(): boolean;
8
25
  set showSidebar(v: boolean);
@@ -12,7 +29,28 @@ export declare class AdwOverlaySplitView extends HTMLElement {
12
29
  get maxSidebarWidth(): number;
13
30
  get sidebarWidthFraction(): number;
14
31
  connectedCallback(): void;
32
+ disconnectedCallback(): void;
15
33
  attributeChangedCallback(_name: string, _old: string | null, _val: string | null): void;
34
+ /**
35
+ * Push ONE attribute into the state, then reflect back what the state made
36
+ * of it.
37
+ *
38
+ * Per-attribute rather than a re-read of all of them, because `show-sidebar`
39
+ * is a value the state ALSO owns: collapsing auto-hides an unpinned sidebar,
40
+ * and a blanket re-read would immediately clobber that decision with the
41
+ * stale attribute.
42
+ */
43
+ private _readAttribute;
44
+ /**
45
+ * Mirror the state's `showSidebar` back onto the attribute, so the DOM keeps
46
+ * telling the truth after an auto-hide.
47
+ *
48
+ * Guarded: writing the attribute re-enters `attributeChangedCallback`, and
49
+ * without the flag that is an infinite reflection loop rather than a render.
50
+ */
51
+ private _reflectShowSidebar;
52
+ /** (Re)bind the `breakpoint` condition to `collapsed`. */
53
+ private _syncBreakpoint;
16
54
  openSidebar(): void;
17
55
  hideSidebar(): void;
18
56
  toggleSidebar(): void;
@@ -1,16 +1,25 @@
1
- export declare class AdwPasswordEntryRow extends HTMLElement {
2
- private _input;
3
- private _titleEl;
1
+ import { AdwEntryRow } from './adw-entry-row.js';
2
+ export declare class AdwPasswordEntryRow extends AdwEntryRow {
3
+ /** The headless peek + caps-lock derivation, composing the parent row's state. */
4
+ private readonly _password;
4
5
  private _toggle;
5
6
  private _toggleIcon;
6
- private _initialized;
7
7
  static get observedAttributes(): string[];
8
- get text(): string;
9
- set text(value: string);
10
- /** Whether the contents are shown in clear text (peek toggle is engaged). */
8
+ protected get _classPrefix(): string;
9
+ /** Whether the contents are shown in clear text (`GtkText:visibility`). */
11
10
  get revealed(): boolean;
12
11
  set revealed(value: boolean);
13
- connectedCallback(): void;
14
- attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
15
- private _renderRevealed;
12
+ /** Whether Caps Lock is engaged, as last observed from a keyboard event. */
13
+ get capsLockOn(): boolean;
14
+ /**
15
+ * Feed the platform's Caps Lock state in — GDK gets it from the keyboard
16
+ * device (adw-password-entry-row.c:111-115). Public because a host that
17
+ * knows better than `KeyboardEvent.getModifierState` (a virtual keyboard, a
18
+ * test) can drive it directly.
19
+ */
20
+ setCapsLockOn(on: boolean): void;
21
+ protected _onConnected(): void;
22
+ attributeChangedCallback(name: string, oldValue: string | null, value: string | null): void;
23
+ /** `notify_visibility_cb` (C:62-81), applied to the DOM. */
24
+ private _renderPassword;
16
25
  }
@@ -0,0 +1,58 @@
1
+ /** Which side of the anchor the surface sits on. */
2
+ export type AdwPopoverPosition = 'bottom' | 'top' | 'start' | 'end';
3
+ /** Which edge of the anchor the surface lines up with. */
4
+ export type AdwPopoverAlign = 'start' | 'end';
5
+ /** The ARIA role of the surface — it decides the row role consumers give their items. */
6
+ export type AdwPopoverRole = 'menu' | 'listbox';
7
+ export declare class AdwPopover extends HTMLElement {
8
+ private readonly _state;
9
+ private _anchor;
10
+ private _initialized;
11
+ /** Guards the `open` attribute↔property loop, which would otherwise recurse. */
12
+ private _reflecting;
13
+ private _onDocumentPointerDown;
14
+ private _onDocumentKeyDown;
15
+ static get observedAttributes(): string[];
16
+ /** Whether the popover is showing. */
17
+ get open(): boolean;
18
+ set open(value: boolean);
19
+ /**
20
+ * The element the surface is positioned against and hands focus back to.
21
+ * Defaults to `parentElement`, which is the common case: the popover is the
22
+ * last child of the widget that owns it.
23
+ */
24
+ get anchor(): HTMLElement | null;
25
+ set anchor(value: HTMLElement | null);
26
+ /** Which side of the anchor the surface sits on. */
27
+ get position(): AdwPopoverPosition;
28
+ set position(value: AdwPopoverPosition);
29
+ /** Which edge of the anchor the surface lines up with. */
30
+ get align(): AdwPopoverAlign;
31
+ set align(value: AdwPopoverAlign);
32
+ /** The surface's ARIA role. */
33
+ get popoverRole(): AdwPopoverRole;
34
+ /** The navigable rows, in DOM order. Hidden rows are skipped — a filtered list navigates what it shows. */
35
+ get items(): HTMLElement[];
36
+ /** Show the popover — `gtk_popover_popup()`. */
37
+ popup(): void;
38
+ /** Hide the popover — `gtk_popover_popdown()`. */
39
+ popdown(): void;
40
+ /** Subscribe to open-state changes. Returns an unsubscribe function. */
41
+ subscribe(listener: (open: boolean) => void): () => void;
42
+ connectedCallback(): void;
43
+ disconnectedCallback(): void;
44
+ attributeChangedCallback(name: string, _previous: string | null, value: string | null): void;
45
+ private _onStateChange;
46
+ private _bindDocument;
47
+ private _unbindDocument;
48
+ private _render;
49
+ /**
50
+ * Arrow/Home/End/Enter/Space inside the surface. The arithmetic is core's
51
+ * ({@link resolvePopoverKey}); this only maps its answer onto the DOM.
52
+ *
53
+ * Escape is NOT handled here — it is bound at the document in capture phase
54
+ * so it works no matter where focus sits, including a search entry inside
55
+ * the popover.
56
+ */
57
+ private _onKeyDown;
58
+ }