@gjsify/adwaita-web 0.31.0 → 0.33.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 (183) hide show
  1. package/dist/adwaita-web.css +835 -299
  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-combo-row.d.ts +10 -0
  30. package/lib/types/elements/adw-data-grid.d.ts +11 -31
  31. package/lib/types/elements/adw-drop-down.d.ts +17 -20
  32. package/lib/types/elements/adw-entry-row.d.ts +93 -3
  33. package/lib/types/elements/adw-expander-row.d.ts +7 -1
  34. package/lib/types/elements/adw-header-bar.d.ts +15 -0
  35. package/lib/types/elements/adw-icon.d.ts +25 -0
  36. package/lib/types/elements/adw-inline-view-switcher.d.ts +73 -11
  37. package/lib/types/elements/adw-menu-button.d.ts +6 -6
  38. package/lib/types/elements/adw-navigation-split-view.d.ts +48 -0
  39. package/lib/types/elements/adw-navigation-view.d.ts +63 -20
  40. package/lib/types/elements/adw-overlay-split-view.d.ts +94 -0
  41. package/lib/types/elements/adw-password-entry-row.d.ts +19 -10
  42. package/lib/types/elements/adw-popover.d.ts +58 -0
  43. package/lib/types/elements/adw-preferences-dialog.d.ts +57 -2
  44. package/lib/types/elements/adw-preferences-group.d.ts +31 -0
  45. package/lib/types/elements/adw-progress-bar.d.ts +38 -0
  46. package/lib/types/elements/adw-sidebar.d.ts +37 -5
  47. package/lib/types/elements/adw-spinner.d.ts +23 -0
  48. package/lib/types/elements/adw-split-button.d.ts +53 -7
  49. package/lib/types/elements/adw-switch-row.d.ts +11 -2
  50. package/lib/types/elements/adw-switch.d.ts +15 -0
  51. package/lib/types/elements/adw-tab-view.d.ts +129 -12
  52. package/lib/types/elements/adw-toolbar-view.d.ts +5 -0
  53. package/lib/types/elements/adw-view-stack.d.ts +39 -19
  54. package/lib/types/elements/adw-view-switcher-bar.d.ts +25 -7
  55. package/lib/types/elements/adw-view-switcher.d.ts +76 -13
  56. package/lib/types/elements/adw-window-title.d.ts +3 -1
  57. package/lib/types/elements/adw-wrap-box.d.ts +58 -3
  58. package/lib/types/elements/view-switcher-dom.d.ts +44 -0
  59. package/lib/types/entry-rows.spec.d.ts +1 -0
  60. package/lib/types/index.d.ts +7 -0
  61. package/lib/types/navigation-view.spec.d.ts +1 -0
  62. package/lib/types/preferences-search.d.ts +20 -0
  63. package/lib/types/preferences.spec.d.ts +1 -0
  64. package/lib/types/split-button.spec.d.ts +1 -0
  65. package/lib/types/split-views.spec.d.ts +1 -0
  66. package/lib/types/styles.generated.d.ts +1 -1
  67. package/lib/types/tab-view.spec.d.ts +1 -0
  68. package/lib/types/view-stack.spec.d.ts +1 -0
  69. package/lib/types/view-switcher.spec.d.ts +1 -0
  70. package/package.json +6 -6
  71. package/scss/_banner.scss +13 -0
  72. package/scss/_bottom_sheet.scss +5 -6
  73. package/scss/_button.scss +3 -26
  74. package/scss/_button_content.scss +28 -0
  75. package/scss/_checks.scss +228 -0
  76. package/scss/_clamp.scss +9 -3
  77. package/scss/_combo_row.scss +19 -0
  78. package/scss/_data_grid.scss +15 -7
  79. package/scss/_drop_down.scss +12 -55
  80. package/scss/_expander_row.scss +5 -50
  81. package/scss/_icon.scss +51 -0
  82. package/scss/_icons.generated.scss +6 -0
  83. package/scss/_inline_view_switcher.scss +34 -0
  84. package/scss/_labels.scss +135 -0
  85. package/scss/_menu_button.scss +10 -70
  86. package/scss/_navigation_split_view.scss +47 -8
  87. package/scss/_overlay_split_view.scss +117 -32
  88. package/scss/_popover.scss +186 -0
  89. package/scss/_preferences.scss +29 -0
  90. package/scss/_preferences_dialog.scss +17 -0
  91. package/scss/_progress_bar.scss +161 -0
  92. package/scss/_reset.scss +18 -7
  93. package/scss/_spinner.scss +37 -19
  94. package/scss/_split_button.scss +6 -50
  95. package/scss/_switch.scss +90 -0
  96. package/scss/_switch_row.scss +6 -52
  97. package/scss/_tab_view.scss +63 -0
  98. package/scss/_theme.scss +10 -0
  99. package/scss/_toolbar_view.scss +74 -0
  100. package/scss/_variables.scss +34 -0
  101. package/scss/_view_switcher.scss +40 -0
  102. package/scss/_view_switcher_bar.scss +37 -0
  103. package/scss/_wrap_box.scss +65 -6
  104. package/scss/adwaita-skin.scss +23 -0
  105. package/src/adw-about-dialog.spec.ts +350 -0
  106. package/src/adw-action-rows.spec.ts +342 -0
  107. package/src/adw-avatar.spec.ts +176 -0
  108. package/src/adw-banner.spec.ts +152 -0
  109. package/src/adw-button-content.spec.ts +207 -0
  110. package/src/adw-button-row.spec.ts +12 -6
  111. package/src/adw-carousel.spec.ts +389 -0
  112. package/src/adw-checks.spec.ts +368 -0
  113. package/src/adw-drop-down.spec.ts +123 -0
  114. package/src/adw-header-bar.spec.ts +83 -0
  115. package/src/adw-icon.spec.ts +167 -0
  116. package/src/adw-progress-bar.spec.ts +173 -0
  117. package/src/adw-row-state.spec.ts +49 -0
  118. package/src/adw-sidebar.spec.ts +332 -0
  119. package/src/adw-switch.spec.ts +242 -0
  120. package/src/adw-tab-view.spec.ts +12 -3
  121. package/src/adw-view-switcher-bar.spec.ts +61 -13
  122. package/src/adw-wrap-box.spec.ts +341 -0
  123. package/src/bottom-sheet.spec.ts +325 -0
  124. package/src/breakpoints.spec.ts +147 -0
  125. package/src/breakpoints.ts +67 -0
  126. package/src/chrome.spec.ts +400 -0
  127. package/src/elements/adw-about-dialog.ts +223 -163
  128. package/src/elements/adw-action-row.ts +131 -11
  129. package/src/elements/adw-avatar.ts +48 -54
  130. package/src/elements/adw-banner.ts +46 -10
  131. package/src/elements/adw-bottom-sheet.ts +145 -60
  132. package/src/elements/adw-button-content.ts +107 -33
  133. package/src/elements/adw-button-row.ts +61 -37
  134. package/src/elements/adw-button.ts +5 -7
  135. package/src/elements/adw-carousel.ts +467 -105
  136. package/src/elements/adw-checks.ts +299 -0
  137. package/src/elements/adw-clamp.ts +80 -10
  138. package/src/elements/adw-combo-row.ts +32 -7
  139. package/src/elements/adw-data-grid.ts +43 -91
  140. package/src/elements/adw-drop-down.ts +117 -128
  141. package/src/elements/adw-entry-row.ts +404 -36
  142. package/src/elements/adw-expander-row.ts +61 -29
  143. package/src/elements/adw-header-bar.ts +31 -6
  144. package/src/elements/adw-icon.ts +148 -0
  145. package/src/elements/adw-inline-view-switcher.ts +325 -131
  146. package/src/elements/adw-menu-button.ts +93 -70
  147. package/src/elements/adw-navigation-split-view.ts +220 -14
  148. package/src/elements/adw-navigation-view.ts +286 -148
  149. package/src/elements/adw-overlay-split-view.ts +536 -28
  150. package/src/elements/adw-password-entry-row.ts +111 -89
  151. package/src/elements/adw-popover.ts +283 -0
  152. package/src/elements/adw-preferences-dialog.ts +120 -21
  153. package/src/elements/adw-preferences-group.ts +128 -22
  154. package/src/elements/adw-progress-bar.ts +189 -0
  155. package/src/elements/adw-sidebar.ts +301 -142
  156. package/src/elements/adw-spin-row.ts +11 -5
  157. package/src/elements/adw-spinner.ts +168 -9
  158. package/src/elements/adw-split-button.ts +371 -92
  159. package/src/elements/adw-status-page.ts +9 -9
  160. package/src/elements/adw-switch-row.ts +100 -30
  161. package/src/elements/adw-switch.ts +129 -0
  162. package/src/elements/adw-tab-view.ts +700 -129
  163. package/src/elements/adw-toggle-group.ts +5 -7
  164. package/src/elements/adw-toolbar-view.ts +84 -21
  165. package/src/elements/adw-view-stack.ts +183 -85
  166. package/src/elements/adw-view-switcher-bar.ts +171 -81
  167. package/src/elements/adw-view-switcher.ts +328 -117
  168. package/src/elements/adw-window-title.ts +44 -11
  169. package/src/elements/adw-wrap-box.ts +329 -78
  170. package/src/elements/view-switcher-dom.ts +108 -0
  171. package/src/entry-rows.spec.ts +391 -0
  172. package/src/index.ts +23 -0
  173. package/src/navigation-view.spec.ts +435 -0
  174. package/src/preferences-search.ts +135 -0
  175. package/src/preferences.spec.ts +250 -0
  176. package/src/source-view/adw-source-view.ts +2 -5
  177. package/src/split-button.spec.ts +470 -0
  178. package/src/split-views.spec.ts +893 -0
  179. package/src/styles.generated.ts +1 -1
  180. package/src/tab-view.spec.ts +451 -0
  181. package/src/test.browser.mts +49 -0
  182. package/src/view-stack.spec.ts +272 -0
  183. package/src/view-switcher.spec.ts +665 -0
@@ -0,0 +1 @@
1
+ export declare const AdwAboutDialogTest: () => Promise<void>;
@@ -0,0 +1 @@
1
+ export declare const AdwActionRowsTest: () => Promise<void>;
@@ -0,0 +1 @@
1
+ export declare const AdwAvatarTest: () => Promise<void>;
@@ -0,0 +1 @@
1
+ export declare const AdwBannerTest: () => Promise<void>;
@@ -0,0 +1 @@
1
+ export declare const AdwButtonContentTest: () => Promise<void>;
@@ -0,0 +1 @@
1
+ export declare const AdwCarouselTest: () => Promise<void>;
@@ -0,0 +1 @@
1
+ export declare const AdwChecksTest: () => Promise<void>;
@@ -0,0 +1 @@
1
+ export declare const AdwHeaderBarTest: () => Promise<void>;
@@ -0,0 +1 @@
1
+ export declare const AdwIconTest: () => Promise<void>;
@@ -0,0 +1 @@
1
+ export declare const AdwProgressBarTest: () => Promise<void>;
@@ -0,0 +1 @@
1
+ export declare const AdwSidebarTest: () => Promise<void>;
@@ -0,0 +1 @@
1
+ export declare const AdwSwitchTest: () => Promise<void>;
@@ -0,0 +1 @@
1
+ export declare const AdwWrapBoxTest: () => Promise<void>;
@@ -0,0 +1 @@
1
+ export declare const AdwBottomSheetTest: () => Promise<void>;
@@ -0,0 +1,22 @@
1
+ import { AdwBreakpoint } from '@gjsify/adwaita-core';
2
+ /**
3
+ * Drive `breakpoints` from `element`'s own box, and return a dispose function.
4
+ *
5
+ * `ResizeObserver` delivers an initial observation on `observe()`, so the
6
+ * breakpoints settle on the correct state before first paint — no flash of the
7
+ * wrong layout, and no separate seeding pass.
8
+ *
9
+ * The size read is the BORDER box in CSS pixels, the browser's counterpart to
10
+ * the `sp`/DIP units an Adwaita condition is written in.
11
+ */
12
+ export declare function addBreakpoints(element: Element, breakpoints: readonly AdwBreakpoint[]): () => void;
13
+ /**
14
+ * Wire a `breakpoint="<condition>"` attribute to a boolean setter, the browser
15
+ * equivalent of an `Adw.Breakpoint` with one `add_setter()` call.
16
+ *
17
+ * Returns a dispose function; call it before re-binding and on disconnect.
18
+ * A missing or unparsable condition binds nothing and returns a no-op, leaving
19
+ * whatever the attribute already says untouched — an element must not silently
20
+ * flip state because its condition had a typo.
21
+ */
22
+ export declare function bindBreakpointSetter(element: Element, condition: string | null, setValue: (active: boolean) => void): () => void;
@@ -0,0 +1 @@
1
+ export declare const AdwBreakpointsTest: () => Promise<void>;
@@ -0,0 +1 @@
1
+ export declare const AdwChromeTest: () => Promise<void>;
@@ -51,24 +51,63 @@ export declare class AdwAboutDialog extends HTMLElement {
51
51
  attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
52
52
  /** Reflect the presented state onto the host + reset the navigation stack. */
53
53
  private _syncOpen;
54
+ /** The credit groups the Credits page shows, straight from `update_credits`. */
55
+ private _creditsSections;
56
+ /**
57
+ * Whether the Legal page has anything on it.
58
+ *
59
+ * This element's licence model is the simplified one — a name plus an
60
+ * optional URL — so it maps onto `GtkLicense` as "custom text when a licence
61
+ * is set, unknown otherwise", which is what `adw_about_dialog_set_license`
62
+ * does to the type anyway (:3472).
63
+ */
64
+ private _hasLegal;
54
65
  /** Rebuild the sheet contents from the current attributes / credit lists. */
55
66
  private _render;
56
- /** A navigation page wrapping a header bar (with the close button) + content. */
67
+ /**
68
+ * A navigation page wrapping a header bar (with the close button) + content.
69
+ *
70
+ * `headerTitle` defaults to the page title; the main page overrides it,
71
+ * because its page title is the dialog's ("About", .ui:19) while its header
72
+ * shows the application name (.ui:30).
73
+ */
57
74
  private _buildPage;
58
- /** The main page: icon, name, developer, version pill, navigation rows. */
75
+ /** The main page: icon, name, developer, version pill, then the three groups. */
59
76
  private _buildMainPage;
77
+ /**
78
+ * One `AdwPreferencesGroup` in its spacing wrapper.
79
+ *
80
+ * `data-group` carries the template's widget id so a test — and a reader —
81
+ * can tell the four named groups apart; nothing styles off it. The credits
82
+ * sections pass `null`, because the template has no id for them: they are
83
+ * built one per section at runtime (:548-549).
84
+ */
85
+ private _buildGroup;
60
86
  /** An activatable row that pushes a subpage, with a trailing go-next chevron. */
61
87
  private _buildNavRow;
62
- private _hasDetails;
63
- private _hasCredits;
64
- private _hasLegal;
65
- /** The Details page: comments + website / support / issue link rows. */
88
+ /**
89
+ * Emit `activate-link` and navigate unless a handler took over.
90
+ *
91
+ * The GObject signal is `BOOLEAN__STRING` with `g_signal_accumulator_true_handled`
92
+ * (:2093-2103) and its default handler returns `GDK_EVENT_PROPAGATE`
93
+ * (:455-460), i.e. "not handled, do the default". A handler returning TRUE
94
+ * suppresses it — which is what `preventDefault()` on a cancelable event
95
+ * means, and why `dispatchEvent`'s return value is the gate here.
96
+ */
97
+ private _activateLink;
98
+ /** The Details page: comments + the links group (website + future custom links). */
66
99
  private _buildDetailsPage;
67
100
  /** A link row that opens a URL in a new tab and emits `activate-link`. */
68
101
  private _buildLinkRow;
69
- /** The Credits page: a group per non-empty credit section. */
102
+ /** The Credits page: one group per section the core assembled. */
70
103
  private _buildCreditsPage;
71
- /** A credit row — a plain title, or a link row when the entry carries a URI. */
104
+ /**
105
+ * A credit row — a plain title, or a link row when the entry carries a URI.
106
+ *
107
+ * The gate is `link !== null`, not the URI's truthiness: `"Ada <>"` parses to
108
+ * an EMPTY link, which is still a link in the C (`if (link)` tests the
109
+ * pointer, :562) and still produces an `AdwLinkRow`, to `mailto:`.
110
+ */
72
111
  private _buildCreditRow;
73
112
  /** The Legal page: copyright + license text. */
74
113
  private _buildLegalPage;
@@ -3,13 +3,48 @@ export declare class AdwActionRow extends HTMLElement {
3
3
  private _subtitleEl;
4
4
  private _suffixEl;
5
5
  private _prefixEl;
6
+ /** The headless labels + activatable-widget coupling (ADR 0004). */
7
+ private readonly _state;
8
+ /** Watches the activatable widget's `disabled`/`aria-disabled` — the live binding. */
9
+ private _sensitivityObserver;
6
10
  private _initialized;
7
11
  static get observedAttributes(): string[];
8
12
  /** The end (suffix) section — append controls here imperatively. */
9
13
  get suffixSection(): HTMLDivElement;
10
14
  /** The start (prefix) section — append icons/widgets here imperatively. */
11
15
  get prefixSection(): HTMLDivElement;
16
+ /** `Adw.ActionRow:activatable-widget` — the widget this row activates. */
17
+ get activatableWidget(): HTMLElement | null;
18
+ /**
19
+ * Set the activatable widget. Its sensitivity is copied into `activatable`
20
+ * right away and then tracked, exactly as libadwaita's `sensitive` →
21
+ * `activatable` binding does (adw-action-row.c:729-732) — including the part
22
+ * that surprises: clearing the widget LEAVES the row activatable (C:709).
23
+ */
24
+ set activatableWidget(widget: HTMLElement | null);
25
+ /** Whether a click activates this row — `GtkListBoxRow:activatable`. */
26
+ get activatable(): boolean;
12
27
  connectedCallback(): void;
28
+ /** Copy the declarative attributes into the headless state. */
29
+ private _adoptAttributes;
30
+ disconnectedCallback(): void;
13
31
  attributeChangedCallback(): void;
32
+ /**
33
+ * `adw_action_row_activate_real` (adw-action-row.c:297-307): forward the
34
+ * activation to the activatable widget, then emit `activated`.
35
+ *
36
+ * A click that ORIGINATED inside the activatable widget does not activate the
37
+ * row at all — no forwarding, no `activated`. That is GTK's answer too: the
38
+ * widget claims the gesture, so `GtkListBox` never emits `row-activated`, and
39
+ * `pressed_cb` denies anything picked below the row / header / prefixes /
40
+ * suffixes (C:120-137). It is also what keeps the forwarding from looping —
41
+ * the synthetic click dispatched below bubbles straight back into this same
42
+ * listener, and without the guard one activation emitted `activated` twice.
43
+ */
44
+ private _onClick;
45
+ /** (Re)point the sensitivity watcher at `widget`, or stop watching. */
46
+ private _observeSensitivity;
47
+ /** Reflect the state's `activatable` back onto the attribute + class. */
48
+ private _syncActivatable;
14
49
  private _render;
15
50
  }
@@ -6,4 +6,15 @@ export declare class AdwAvatar extends HTMLElement {
6
6
  connectedCallback(): void;
7
7
  attributeChangedCallback(): void;
8
8
  private _render;
9
+ /**
10
+ * Size the initials the way `update_font_size` does: measure the label, then
11
+ * scale its aspect ratio against the cap.
12
+ *
13
+ * Only the ratio matters and it is font-size invariant, so measuring AT the
14
+ * cap is the browser's equivalent of Pango's reset-then-measure. The old
15
+ * `size * (size < 32 ? 0.5 : 0.4)` guess overflowed that cap at sizes 28, 30,
16
+ * 31 and everything from 64 up — the initials spilled out of the circle —
17
+ * and was not monotonic across the 32px boundary.
18
+ */
19
+ private _applyFontSize;
9
20
  }
@@ -1,3 +1,4 @@
1
+ import type { BottomSheetCloseOutcome, BottomSheetCloseSource } from '@gjsify/adwaita-core';
1
2
  /** The persistent content. Child of <adw-bottom-sheet>; consumed at connect time. */
2
3
  export declare class AdwBottomSheetContent extends HTMLElement {
3
4
  }
@@ -10,6 +11,10 @@ export declare class AdwBottomSheet extends HTMLElement {
10
11
  private _dimmingEl;
11
12
  private _sheetEl;
12
13
  private _dragHandleEl;
14
+ /** The shared open/can-close model — the single source of truth for both. */
15
+ private readonly _state;
16
+ /** Set while the element writes `open` back, so the write does not re-enter. */
17
+ private _reflecting;
13
18
  static get observedAttributes(): string[];
14
19
  /** Whether the sheet is revealed. */
15
20
  get open(): boolean;
@@ -17,19 +22,43 @@ export declare class AdwBottomSheet extends HTMLElement {
17
22
  /** Whether the content is dimmed + blocked while the sheet is open. */
18
23
  get modal(): boolean;
19
24
  set modal(value: boolean);
20
- /** Whether the user can dismiss the sheet (handle / dimming / Escape). */
25
+ /** Whether the user can dismiss the sheet (dimming / Escape / sheet.close). */
21
26
  get canClose(): boolean;
22
27
  set canClose(value: boolean);
23
28
  /** Whether the overlaid drag handle is shown. */
24
29
  get showDragHandle(): boolean;
25
30
  set showDragHandle(value: boolean);
31
+ /**
32
+ * Route a dismissal affordance through the shared gate and act on the
33
+ * verdict: close, raise `close-attempt`, forward `sheet.close` to an
34
+ * ancestor, or do nothing. The element calls this for the dimming layer and
35
+ * Escape; a close button inside the sheet calls it with `'close-button'`.
36
+ *
37
+ * The verdict differs per source — a locked sheet signals a scrim click but
38
+ * swallows a swipe, and the drag handle never closes anything. See
39
+ * `resolveBottomSheetClose` in `@gjsify/adwaita-core`.
40
+ */
41
+ requestClose(source: BottomSheetCloseSource): BottomSheetCloseOutcome;
26
42
  connectedCallback(): void;
27
43
  attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
28
- private _attemptClose;
44
+ /** The programmatic open/close — `AdwBottomSheet:open`, ungated by `can-close`. */
45
+ private _setOpen;
29
46
  private _render;
30
- /** Read a boolean attribute that defaults to `true` when absent. */
47
+ /** Mirror the state onto the `open` attribute (the CSS + markup hook). */
48
+ private _reflectOpen;
49
+ /** Read a boolean attribute: absent → `fallback`, explicit `="false"` → off. */
31
50
  private _boolAttr;
32
51
  private _setBoolAttr;
33
- /** Move declared slot children out of the light-DOM tree into a list. */
52
+ /**
53
+ * Collect the nodes declared for one slot, in DOCUMENT order, marking every
54
+ * consumed child in `claimed`.
55
+ *
56
+ * The `<adw-bottom-sheet-sheet>` / `<adw-bottom-sheet-content>` wrappers are
57
+ * markup, not widgets — GtkBuilder's `<child type="sheet">` leaves nothing in
58
+ * the tree (adw-bottom-sheet.c:1278-1293) — so the wrapper itself is claimed
59
+ * too. It used to fall through to `unslotted` and be appended to the content
60
+ * layer, leaving an empty custom element behind after its children were
61
+ * pulled out.
62
+ */
34
63
  private _collectSlot;
35
64
  }
@@ -3,8 +3,20 @@ export declare class AdwButtonContent extends HTMLElement {
3
3
  private _iconEl;
4
4
  private _labelEl;
5
5
  private _initialized;
6
+ /** The node currently carrying `image-text-button`, so unroot can find it. */
7
+ private _styledHost;
6
8
  static get observedAttributes(): string[];
7
9
  connectedCallback(): void;
10
+ disconnectedCallback(): void;
8
11
  attributeChangedCallback(name: string): void;
12
+ /**
13
+ * `adw_button_content_root` (:108-116): the nearest button ancestor, unless
14
+ * that button's DIRECT parent is a split button — then the split button
15
+ * takes the class, because `splitbutton.image-text-button > button` is the
16
+ * rule that styles it (_buttons.scss:499-507).
17
+ */
18
+ private _hostButton;
19
+ private _root;
20
+ private _unroot;
9
21
  private _render;
10
22
  }
@@ -1,11 +1,20 @@
1
1
  export declare class AdwButtonRow extends HTMLElement {
2
2
  private _contentsEl;
3
3
  private _startIconEl;
4
+ private _endIconEl;
4
5
  private _titleEl;
6
+ /** The headless title + start/end icon state (ADR 0004). */
7
+ private readonly _state;
5
8
  private _initialized;
6
9
  static get observedAttributes(): string[];
7
10
  connectedCallback(): void;
8
11
  attributeChangedCallback(): void;
9
- private _isActivatable;
10
12
  private _render;
13
+ /**
14
+ * Paint one of the two `image.icon.{start,end}` nodes (adw-button-row.c:39-40).
15
+ *
16
+ * The `start` / `end` position class is set once at construction — it is
17
+ * where the node sits, not what it draws — so only the name changes here.
18
+ */
19
+ private _paintIcon;
11
20
  }
@@ -2,38 +2,140 @@
2
2
  interface CarouselHost extends HTMLElement {
3
3
  readonly nPages: number;
4
4
  readonly position: number;
5
+ /** The page the current position settles on, `-1` when empty. */
6
+ readonly currentPage: number;
5
7
  scrollToPage(index: number): void;
6
8
  addEventListener(type: string, listener: EventListenerOrEventListenerObject): void;
7
9
  removeEventListener(type: string, listener: EventListenerOrEventListenerObject): void;
8
10
  }
9
11
  export declare class AdwCarousel extends HTMLElement implements CarouselHost {
12
+ private readonly _state;
10
13
  private _trackEl;
11
- private _pages;
12
- private _position;
14
+ /** Page id → its `.adw-carousel-page` slot. Ids are internal; the DOM node is the public handle. */
15
+ private readonly _slots;
16
+ private _nextPageId;
13
17
  private _scrollRaf;
14
- private _wheelAccum;
15
18
  private _initialized;
19
+ /** A declared `position` waiting for the track to have a width. */
20
+ private _pendingPosition;
21
+ private _pendingLayout;
22
+ /**
23
+ * `interactive` for the scroll now in flight: the flag of the request that
24
+ * started it, or `null` for a scroll we did not start — which is a user drag,
25
+ * and therefore interactive.
26
+ */
27
+ private _pendingInteractive;
16
28
  static get observedAttributes(): string[];
29
+ constructor();
17
30
  /** Number of pages in the carousel. */
18
31
  get nPages(): number;
19
32
  /** Fractional scroll position (0 = first page, 1 = second, …). */
20
33
  get position(): number;
34
+ /**
35
+ * Scroll to the page this position settles on.
36
+ *
37
+ * `AdwCarousel:position` is READ-ONLY in C (adw-carousel.c:1036-1041) — the
38
+ * setter is a port convenience, and it resolves the value with the same
39
+ * `get_page_at_position` rule the carousel uses everywhere else, so setting
40
+ * 0.5 lands on page 0 exactly as scrolling there would.
41
+ */
21
42
  set position(value: number);
22
- /** Whether the scroll wheel navigates between pages. */
43
+ /** The page the current position settles on, `-1` when the carousel is empty. */
44
+ get currentPage(): number;
45
+ /** Whether the scroll wheel navigates between pages. Defaults to TRUE, as in libadwaita. */
23
46
  get allowScrollWheel(): boolean;
24
47
  set allowScrollWheel(value: boolean);
25
- /** Whether a single flick can skip more than one page. */
48
+ /** Whether a single flick may cross more than one page. */
26
49
  get allowLongSwipes(): boolean;
27
50
  set allowLongSwipes(value: boolean);
51
+ /** Whether the carousel can be navigated at all. Defaults to TRUE. */
52
+ get interactive(): boolean;
53
+ set interactive(value: boolean);
54
+ /** Spacing between pages in px (`AdwCarousel:spacing`). */
55
+ get spacing(): number;
56
+ set spacing(value: number);
28
57
  connectedCallback(): void;
29
58
  attributeChangedCallback(name: string, _oldValue: string | null, newValue: string | null): void;
30
- /** Scroll (snap) to the page at `index`, clamped to the valid range. */
59
+ disconnectedCallback(): void;
60
+ /** One attribute → one state property. Shared by the initial read and later changes. */
61
+ private _applyAttribute;
62
+ /**
63
+ * Scroll to `value`, waiting for the first layout when the track has no
64
+ * width yet.
65
+ *
66
+ * `connectedCallback` runs DURING insertion, so the track is still 0px wide
67
+ * and a scroll offset has nowhere to land — a declared
68
+ * `<adw-carousel position="2">` silently stayed on page 0. Deferring to the
69
+ * first non-zero measurement is the only point at which the offset means
70
+ * anything; a later assignment simply replaces the pending one.
71
+ */
72
+ private _positionWhenMeasurable;
73
+ /**
74
+ * Jump to `value` without the reveal animation.
75
+ *
76
+ * A DECLARED position is where the carousel STARTS, not somewhere it travels
77
+ * to — `<adw-carousel position="2">` should render already showing page 2.
78
+ * Left smooth, the track is still at offset 0 while the animation runs, and
79
+ * the `scroll` event that fires from there recomputes the position back to
80
+ * page 0. So the one assignment is made instant and the caller's
81
+ * `scroll-behavior` is put back.
82
+ */
83
+ private _scrollInstantly;
84
+ /** Drop a pending declared position and stop watching for a layout. */
85
+ private _cancelPendingPosition;
86
+ /** Resolve a fractional position to a page and scroll there; a no-op when there is none. */
87
+ private _scrollToPosition;
88
+ /**
89
+ * Insert `page` at `position` — `adw_carousel_insert` (adw-carousel.c:1370-1407).
90
+ * `-1` or a position past the end appends. Returns whether it was added.
91
+ */
92
+ insertPage(page: HTMLElement, position?: number): boolean;
93
+ /** `adw_carousel_append` (adw-carousel.c:1348-1357). */
94
+ appendPage(page: HTMLElement): boolean;
95
+ /** `adw_carousel_prepend` (adw-carousel.c:1330-1339). */
96
+ prependPage(page: HTMLElement): boolean;
97
+ /** Remove `page` — `adw_carousel_remove` (adw-carousel.c:1508-1532). */
98
+ removePage(page: HTMLElement): boolean;
99
+ /** Move `page` — `adw_carousel_reorder` (adw-carousel.c:1419-1499). */
100
+ reorderPage(page: HTMLElement, position: number): boolean;
101
+ /**
102
+ * Scroll to the page at `index`. Out-of-range, fractional and NaN indices are
103
+ * refused rather than clamped, matching `adw_carousel_get_nth_page`'s
104
+ * precondition (adw-carousel.c:1616).
105
+ */
31
106
  scrollToPage(index: number): void;
107
+ /** One keynav step — `navigate_to_direction` (adw-carousel.c:475-508). */
108
+ navigate(direction: 'back' | 'forward'): boolean;
109
+ private _insert;
110
+ /** The state's id for a page element, or `null` when it is not one of ours. */
111
+ private _idOf;
112
+ /** Make the DOM order match the model order, and drop slots whose page is gone. */
113
+ private _syncTrack;
114
+ /**
115
+ * Put the scroll offset back where the model says it is, instantly.
116
+ *
117
+ * A page revealed at or before the current one moves the position with it
118
+ * (`shift_position`, adw-carousel.c:241-258) precisely so the page on screen
119
+ * does not slide sideways — but a scroll container knows nothing about that
120
+ * and would keep its old offset, showing the newly-inserted page instead. GTK
121
+ * gets this for free because the same allocation that adds the child also
122
+ * lays it out; here it takes one write.
123
+ */
124
+ private _applyScrollFromModel;
125
+ /**
126
+ * `allow-long-swipes` in CSS: `scroll-snap-stop: always` forces the scroll to
127
+ * stop at every page, which is exactly what the property being FALSE means —
128
+ * "each swipe can only move to the adjacent pages" (adw-carousel.c:1111-1113).
129
+ */
130
+ private _applySnapStop;
131
+ /** The px pitch between two page origins — `self->distance` (adw-carousel.c:767). */
132
+ private _distance;
133
+ /** Run the scroll the state asked for, in the track's own scroll coordinates. */
134
+ private _performScroll;
32
135
  private _onScroll;
33
136
  private _onWheel;
34
137
  private _updatePositionFromScroll;
35
- private _slotWidth;
36
- private _emitPosition;
138
+ private _onStateChange;
37
139
  }
38
140
  /** Shared base for the dot / line indicator elements. */
39
141
  declare abstract class AdwCarouselIndicator extends HTMLElement {
@@ -52,6 +154,7 @@ declare abstract class AdwCarouselIndicator extends HTMLElement {
52
154
  private _onChange;
53
155
  protected nPages(): number;
54
156
  protected position(): number;
157
+ protected currentPage(): number;
55
158
  protected goTo(index: number): void;
56
159
  protected abstract _render(): void;
57
160
  }
@@ -0,0 +1,57 @@
1
+ /** The markup + state shared by `<adw-checkbox>` and `<adw-radio>`. */
2
+ declare abstract class AdwCheckBase extends HTMLElement {
3
+ protected _input: HTMLInputElement;
4
+ protected _indicator: HTMLSpanElement;
5
+ protected _label: HTMLSpanElement;
6
+ private _initialized;
7
+ /** `checkbox` or `radio` — the native control this element is built around. */
8
+ protected abstract get inputType(): 'checkbox' | 'radio';
9
+ /** What a click / Space / arrow key on the control means for this kind. */
10
+ protected abstract activate(): void;
11
+ /** Whether the control is checked. */
12
+ get checked(): boolean;
13
+ set checked(value: boolean);
14
+ /** Whether the control is in the third, inconsistent state. */
15
+ get indeterminate(): boolean;
16
+ set indeterminate(value: boolean);
17
+ /** Whether the control is inert. */
18
+ get disabled(): boolean;
19
+ set disabled(value: boolean);
20
+ /** The label text beside the indicator. */
21
+ get label(): string;
22
+ set label(value: string);
23
+ connectedCallback(): void;
24
+ disconnectedCallback(): void;
25
+ attributeChangedCallback(name: string): void;
26
+ /** Extra wiring for a subclass on connect. */
27
+ protected onConnected(): void;
28
+ /** Extra teardown for a subclass on disconnect. */
29
+ protected onDisconnected(): void;
30
+ protected render(): void;
31
+ }
32
+ /** The Adwaita checkbox — `checkbutton > check` as a custom element. */
33
+ export declare class AdwCheckbox extends AdwCheckBase {
34
+ static get observedAttributes(): string[];
35
+ protected get inputType(): 'checkbox';
36
+ protected activate(): void;
37
+ }
38
+ /** The Adwaita radio — `checkbutton > radio`, exclusive within its `name`. */
39
+ export declare class AdwRadio extends AdwCheckBase {
40
+ private _unsubscribe;
41
+ static get observedAttributes(): string[];
42
+ protected get inputType(): 'radio';
43
+ /** The group this member belongs to. */
44
+ get name(): string;
45
+ set name(value: string);
46
+ /**
47
+ * This member's value. Falls back to the label text so a group authored
48
+ * without values still has members the group state can tell apart.
49
+ */
50
+ get value(): string;
51
+ set value(value: string);
52
+ protected activate(): void;
53
+ protected onConnected(): void;
54
+ protected onDisconnected(): void;
55
+ protected render(): void;
56
+ }
57
+ export {};
@@ -1,6 +1,9 @@
1
1
  export declare class AdwClamp extends HTMLElement {
2
+ private _resize;
3
+ private _mutations;
2
4
  static get observedAttributes(): string[];
3
5
  connectedCallback(): void;
6
+ disconnectedCallback(): void;
4
7
  attributeChangedCallback(): void;
5
- private _sync;
8
+ private _allocate;
6
9
  }
@@ -11,5 +11,15 @@ export declare class AdwComboRow extends HTMLElement {
11
11
  set selected(value: number);
12
12
  connectedCallback(): void;
13
13
  attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
14
+ /**
15
+ * `model_changed` (adw-combo-row.c:187-195) — one option or none is not a
16
+ * choice, so the arrow goes and the row stops being activatable.
17
+ *
18
+ * Both halves have to be expressed: `data-presents-chooser` gates the
19
+ * `.adw-row-value::after` mask in the stylesheet, and DISABLING the overlaid
20
+ * `<select>` is what makes the row inert — hiding the arrow alone would leave
21
+ * a row that still opens a one-entry popup on click.
22
+ */
23
+ private _syncChooser;
14
24
  private _renderText;
15
25
  }
@@ -1,33 +1,5 @@
1
- /** Horizontal alignment of a column's header + cells. */
2
- export type AdwDataGridAlign = 'start' | 'end' | 'center';
3
- /** Accounting row emphasis. `normal` is the default plain data row. */
4
- export type AdwDataGridRowVariant = 'normal' | 'section' | 'subtotal' | 'total';
5
- /** A column descriptor — what to read (`key`), how to label + align it. */
6
- export interface AdwDataGridColumn {
7
- /** The row-object key this column renders. */
8
- key: string;
9
- /** Header text (defaults to `key`). */
10
- label?: string;
11
- /** 'start' | 'end' | 'center'. Defaults to 'start' (or 'end' when numeric). */
12
- align?: AdwDataGridAlign;
13
- /** Fixed CSS track size (e.g. '80px', '6rem') — pins the column width. */
14
- width?: string;
15
- /** Fractional track weight (→ `<flex>fr`) — lets the column grow. */
16
- flex?: number;
17
- /** Render cells in a monospace family (tabular figures apply regardless). */
18
- monospace?: boolean;
19
- /** Convenience: right-align + tabular-nums (numeric columns of figures). */
20
- numeric?: boolean;
21
- }
22
- /** A row: cell values keyed by column key + optional accounting metadata. */
23
- export interface AdwDataGridRow {
24
- /** Accounting emphasis. Default 'normal'. */
25
- variant?: AdwDataGridRowVariant;
26
- /** Make just this row clickable (overrides the element-level flag). */
27
- interactive?: boolean;
28
- /** Cell values keyed by column key (pre-formatted strings, or numbers). */
29
- [key: string]: string | number | boolean | AdwDataGridRowVariant | undefined;
30
- }
1
+ import type { AdwDataGridColumn, AdwDataGridRow } from '@gjsify/adwaita-core';
2
+ export type { AdwDataGridAlign, AdwDataGridCellValue, AdwDataGridColumn, AdwDataGridRow, AdwDataGridRowVariant, } from '@gjsify/adwaita-core';
31
3
  export declare class AdwDataGrid extends HTMLElement {
32
4
  private _captionEl;
33
5
  private _scrollEl;
@@ -52,7 +24,15 @@ export declare class AdwDataGrid extends HTMLElement {
52
24
  attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
53
25
  private _parseJsonAttr;
54
26
  private _renderCaption;
55
- /** The CSS `grid-template-columns` value derived from the column descriptors. */
27
+ /**
28
+ * The CSS `grid-template-columns` value derived from the column descriptors.
29
+ *
30
+ * The DERIVATION is core's (`dataGridTracks`), because NativeScript needs the
31
+ * same one for its `ItemSpec`s and can do nothing with a CSS string; the
32
+ * mapping onto CSS text — including the `minmax(0px, 1fr)` slack track whose
33
+ * `0px` must keep its unit to round-trip through the CSSOM — is
34
+ * `dataGridTrackTemplate`.
35
+ */
56
36
  private _trackTemplate;
57
37
  private _columnClasses;
58
38
  private _render;