@gjsify/adwaita-core 0.36.0 → 0.37.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 (61) hide show
  1. package/lib/esm/conformance/index.js +1 -1
  2. package/lib/esm/conformance/shortcut-label.js +1 -0
  3. package/lib/esm/index.js +1 -1
  4. package/lib/esm/shortcut-label.js +1 -0
  5. package/lib/types/about-dialog.d.ts +92 -98
  6. package/lib/types/action-row.d.ts +95 -125
  7. package/lib/types/avatar.d.ts +30 -37
  8. package/lib/types/banner.d.ts +25 -53
  9. package/lib/types/breakpoint.d.ts +6 -7
  10. package/lib/types/button-content.d.ts +41 -80
  11. package/lib/types/carousel.d.ts +175 -252
  12. package/lib/types/checks.d.ts +13 -30
  13. package/lib/types/chrome.d.ts +90 -136
  14. package/lib/types/color-scheme.d.ts +5 -6
  15. package/lib/types/conformance/about-dialog.d.ts +64 -91
  16. package/lib/types/conformance/action-row.d.ts +26 -46
  17. package/lib/types/conformance/avatar.d.ts +8 -10
  18. package/lib/types/conformance/banner.d.ts +17 -37
  19. package/lib/types/conformance/button-content.d.ts +24 -46
  20. package/lib/types/conformance/carousel.d.ts +35 -75
  21. package/lib/types/conformance/checks.d.ts +0 -4
  22. package/lib/types/conformance/chrome.d.ts +28 -36
  23. package/lib/types/conformance/data-grid.d.ts +28 -47
  24. package/lib/types/conformance/dialog.d.ts +4 -9
  25. package/lib/types/conformance/entry-row.d.ts +20 -39
  26. package/lib/types/conformance/index.d.ts +2 -0
  27. package/lib/types/conformance/navigation-view.d.ts +0 -4
  28. package/lib/types/conformance/popover.d.ts +4 -9
  29. package/lib/types/conformance/preferences.d.ts +15 -28
  30. package/lib/types/conformance/rows.d.ts +5 -12
  31. package/lib/types/conformance/shortcut-label.d.ts +34 -0
  32. package/lib/types/conformance/sidebar.d.ts +28 -49
  33. package/lib/types/conformance/spinner.d.ts +21 -27
  34. package/lib/types/conformance/split-button.d.ts +21 -43
  35. package/lib/types/conformance/split-view.d.ts +29 -36
  36. package/lib/types/conformance/tab-view.d.ts +32 -73
  37. package/lib/types/conformance/view-stack.d.ts +0 -12
  38. package/lib/types/conformance/view-switcher.d.ts +46 -114
  39. package/lib/types/conformance/wrap-box.d.ts +40 -63
  40. package/lib/types/data-grid.d.ts +38 -48
  41. package/lib/types/dialog.d.ts +39 -51
  42. package/lib/types/easing.d.ts +6 -12
  43. package/lib/types/entry-row.d.ts +94 -123
  44. package/lib/types/glib.d.ts +17 -25
  45. package/lib/types/index.d.ts +2 -0
  46. package/lib/types/length-unit.d.ts +7 -12
  47. package/lib/types/navigation-view.d.ts +62 -68
  48. package/lib/types/popover.d.ts +39 -66
  49. package/lib/types/preferences.d.ts +83 -100
  50. package/lib/types/rows.d.ts +45 -63
  51. package/lib/types/shortcut-label.d.ts +79 -0
  52. package/lib/types/shortcut-label.spec.d.ts +2 -0
  53. package/lib/types/sidebar.d.ts +95 -121
  54. package/lib/types/spinner.d.ts +39 -61
  55. package/lib/types/split-button.d.ts +78 -134
  56. package/lib/types/split-view.d.ts +74 -89
  57. package/lib/types/tab-view.d.ts +174 -256
  58. package/lib/types/view-stack.d.ts +87 -129
  59. package/lib/types/view-switcher.d.ts +126 -211
  60. package/lib/types/wrap-box.d.ts +62 -123
  61. package/package.json +3 -3
@@ -33,12 +33,10 @@ export interface AdwDataGridRow {
33
33
  [key: string]: AdwDataGridCellValue;
34
34
  }
35
35
  /**
36
- * One column track, in renderer-neutral terms.
37
- *
38
- * `fixed` carries the author's CSS length UNPARSED, because the browser can
39
- * resolve every unit CSS has and no other renderer can: it is the one track kind
40
- * whose meaning is the stylesheet's. A renderer without a CSS engine parses what
41
- * it understands and falls back — see the NativeScript sibling for that call.
36
+ * One column track, in renderer-neutral terms. `fixed` carries the author's CSS length
37
+ * UNPARSED, because only a browser can resolve every unit CSS has: it is the one track
38
+ * kind whose meaning is the stylesheet's. A renderer without a CSS engine parses what it
39
+ * understands and falls back.
42
40
  */
43
41
  export type DataGridTrack =
44
42
  /** A pinned track: the `width` string exactly as the column declared it. */
@@ -66,56 +64,51 @@ export declare const DATA_GRID_ROW_CLASS = "adw-data-grid-row";
66
64
  /**
67
65
  * The column tracks derived from the column descriptors.
68
66
  *
69
- * `width` pins a track and `flex` weights one, each on its own column. The
70
- * interesting rule is the third one and it is GLOBAL, not per column: when
71
- * NOTHING declares a size anywhere, the FIRST column absorbs the slack and every
72
- * other column sizes to its content. That is the statement shape — one label
73
- * column taking whatever is left, trailing figures hugging the right edge — and
74
- * it is why the emptiest possible column list still produces a usable grid.
75
- *
76
- * One declared size anywhere turns the rule off for every column, so a caller
77
- * pinning a single column does not silently keep an implicit flexible one.
67
+ * `width` pins a track and `flex` weights one, each on its own column. The third rule is
68
+ * GLOBAL, not per column: when NOTHING declares a size anywhere, the FIRST column absorbs
69
+ * the slack and every other column sizes to its content — the statement shape, one label
70
+ * column taking what is left and trailing figures hugging the right edge. One declared
71
+ * size anywhere turns the rule off for every column, so pinning a single column does not
72
+ * silently keep an implicit flexible one.
78
73
  */
79
74
  export declare function dataGridTracks(columns: ReadonlyArray<AdwDataGridColumn>): DataGridTrack[];
80
75
  /**
81
76
  * The CSS `grid-template-columns` value for a track list — the browser mapping.
82
77
  *
83
- * The slack track is `minmax(0px, 1fr)` rather than `1fr` so a long cell cannot
84
- * push the column past its share (`1fr` floors at the content's min-content
85
- * size); `0px` is spelled with its unit because that is the CSSOM-canonical
86
- * form, and a bare `0` does not round-trip through `style.gridTemplateColumns`.
78
+ * The slack track is `minmax(0px, 1fr)` rather than `1fr` so a long cell cannot push the
79
+ * column past its share (`1fr` floors at the content's min-content size); `0px` carries
80
+ * its unit because a bare `0` does not round-trip through `style.gridTemplateColumns`.
87
81
  */
88
82
  export declare function dataGridTrackTemplate(tracks: ReadonlyArray<DataGridTrack>): string;
89
83
  /**
90
- * A column's effective alignment: its own `align`, or `end` when it is numeric.
91
- *
92
- * The numeric default is the widget's reason to exist — a column of figures that
93
- * does not end on a common right edge is a boxed list with extra steps.
84
+ * A column's effective alignment: its own `align`, or `end` when it is numeric. The
85
+ * numeric default is the widget's reason to exist — a column of figures that does not end
86
+ * on a common right edge is a boxed list with extra steps.
94
87
  */
95
88
  export declare function dataGridColumnAlign(column: AdwDataGridColumn): AdwDataGridAlign;
96
89
  /**
97
- * The classes a column's cells carry: the base cell class, the alignment, and
98
- * the two typographic opt-ins.
90
+ * The classes a column's cells carry: the base cell class, the alignment, and the two
91
+ * typographic opt-ins.
99
92
  *
100
- * `numeric` and `mono` are the libadwaita label classes (_labels.scss:81-88):
101
- * both set `font-variant-numeric: tabular-nums`, `mono` additionally switching
102
- * to the monospace family. A renderer whose stylesheet cannot express that
103
- * feature still gets the alignment, which is the half that survives.
93
+ * `numeric` IS libadwaita's own label class (`font-variant-numeric: tabular-nums`);
94
+ * `mono` is this widget's cell class, which `@extend`s upstream's `.monospace` on top of
95
+ * the tabular figures. A renderer whose stylesheet cannot express the font feature still
96
+ * gets the alignment, which is the half that survives.
104
97
  *
105
- * `align` is NOT clamped to {@link AdwDataGridAlign} here, so a value outside
106
- * the union produces a class no stylesheet claims and the cell falls back to the
107
- * base rule. That is deliberate asymmetry with {@link normalizeDataGridVariant}:
108
- * a bogus variant would pick an EMPHASIS (a bold total rule where none belongs),
109
- * a bogus alignment only fails to move text.
98
+ * `align` is NOT clamped to {@link AdwDataGridAlign}, so a value outside the union
99
+ * produces a class no stylesheet claims and the cell falls back to the base rule —
100
+ * deliberate asymmetry with {@link normalizeDataGridVariant}: a bogus variant would pick
101
+ * an EMPHASIS (a bold total rule where none belongs), a bogus alignment only fails to
102
+ * move text.
110
103
  */
111
104
  export declare function dataGridColumnClasses(column: AdwDataGridColumn): string[];
112
105
  /**
113
106
  * Coerce a cell value to display text — pre-formatted strings pass through.
114
107
  *
115
- * The grid FORMATS NOTHING: locale currency, thousands separators and decimals
116
- * are the app's, because only the app knows the locale and the rounding. A
117
- * number reaching here is a convenience, not a formatting request, so it is
118
- * stringified as-is. A missing key is empty rather than `undefined`.
108
+ * The grid FORMATS NOTHING: locale currency, thousands separators and decimals are the
109
+ * app's, because only the app knows the locale and the rounding. A number reaching here is
110
+ * a convenience, not a formatting request, so it is stringified as-is. A missing key is
111
+ * empty rather than `undefined`.
119
112
  */
120
113
  export declare function dataGridCellText(value: AdwDataGridCellValue | null): string;
121
114
  /** Clamp an arbitrary variant to the known set (unknown → 'normal'). */
@@ -125,16 +118,13 @@ export declare function normalizeDataGridColumns(raw: unknown): AdwDataGridColum
125
118
  /**
126
119
  * Whether a row activates on click/tap.
127
120
  *
128
- * Three conditions, and the order matters. Only a `normal` row can activate at
129
- * all — a section header, a subtotal and a total are STRUCTURE, and making them
130
- * tappable would offer a detail view for a computed line that has none. Then the
131
- * per-row flag wins over the grid-level one in BOTH directions: `false` opts a
132
- * single row out of a fully interactive grid, `true` opts a single row into an
133
- * otherwise inert one.
121
+ * Only a `normal` row can activate at all — a section header, a subtotal and a total are
122
+ * STRUCTURE, and making them tappable would offer a detail view for a computed line that
123
+ * has none. The per-row flag then wins over the grid-level one in BOTH directions:
124
+ * `false` opts a single row out of a fully interactive grid, `true` opts one into an
125
+ * otherwise inert grid.
134
126
  *
135
- * `rowFlag` is `unknown` on purpose: it arrives from a JSON attribute, where
136
- * anything can be under the key, and only the two booleans decide. Any other
137
- * value defers to the grid, which is what a value the widget cannot read should
138
- * do.
127
+ * `rowFlag` is `unknown` on purpose: it arrives from a JSON attribute where anything can
128
+ * be under the key, and only the two booleans decide — any other value defers to the grid.
139
129
  */
140
130
  export declare function dataGridRowInteractive(variant: AdwDataGridRowVariant, rowFlag: unknown, gridInteractive: boolean): boolean;
@@ -101,9 +101,8 @@ export declare class AdwAlertResponses {
101
101
  /**
102
102
  * Which affordance asked a bottom sheet to close.
103
103
  *
104
- * These are not interchangeable: the C source runs each through a DIFFERENT
105
- * gate, and the differences are exactly what a renderer flattening them into one
106
- * `_attemptClose()` loses.
104
+ * Not interchangeable: the C runs each through a DIFFERENT gate, and the differences are
105
+ * exactly what a renderer flattening them into one `_attemptClose()` loses.
107
106
  *
108
107
  * - `'dimming'` — a click on the modal scrim (`released_cb`).
109
108
  * - `'escape'` — the <kbd>Escape</kbd> shortcut on the sheet (`maybe_close_cb`).
@@ -135,28 +134,22 @@ export interface BottomSheetCloseState {
135
134
  * The dismissal decision table — `Adw.BottomSheet`'s five dismissal affordances
136
135
  * as one pure function, callable without owning any state.
137
136
  *
138
- * Three rows are worth reading twice, because no renderer got them right:
137
+ * Three rows are worth reading twice:
139
138
  *
140
139
  * - `('drag-handle', …)` is ALWAYS `'ignored'`. The handle is created with
141
- * `can_focus = FALSE` + `can_target = FALSE` (adw-bottom-sheet.c:1197-1198),
142
- * so it cannot be clicked at all; its only behavioural role is elsewhere
143
- * (`allow_mouse_drag = show_drag_handle || bottom_bar`, adw-bottom-sheet.c:455).
144
- * Both ports had turned it into a close BUTTON, which is the one behaviour it
145
- * provably does not have.
140
+ * `can_focus = FALSE` + `can_target = FALSE`, so it cannot be clicked at all; its only
141
+ * behavioural role is elsewhere (`allow_mouse_drag = show_drag_handle || bottom_bar`). It
142
+ * is NOT a close button.
146
143
  * - `('escape', { open: false })` is `'close-attempt'`, not nothing. The emit in
147
- * `maybe_close_cb` (adw-bottom-sheet.c:393-399) is the fallthrough for EVERY
148
- * case that is not `can_close && open`, and a closed sheet is still focusable
149
- * while it shows a bottom bar.
150
- * - `('close-button', { open: false, canClose: true })` is `'delegate'`:
151
- * `sheet_close_cb` (adw-bottom-sheet.c:377-385) activates the parent's
152
- * `sheet.close` action instead of doing nothing.
144
+ * `maybe_close_cb` is the fallthrough for EVERY case that is not `can_close && open`, and a
145
+ * closed sheet is still focusable while it shows a bottom bar.
146
+ * - `('close-button', { open: false, canClose: true })` is `'delegate'`: `sheet_close_cb`
147
+ * activates the parent's `sheet.close` action instead of doing nothing.
153
148
  *
154
- * The `'dimming'`/`'swipe'` closed rows encode a REACHABILITY gate rather than a
155
- * branch inside the callback: `released_cb` never tests `open`, but the scrim is
156
- * `can_target = open` (adw-bottom-sheet.c:1148, 1692), and `prepare_cb` refuses
157
- * to even detect a swipe unless the direction matches the state
158
- * (adw-bottom-sheet.c:1050-1053). Neither can fire on a closed sheet, so neither
159
- * signals anything.
149
+ * The `'dimming'`/`'swipe'` closed rows encode a REACHABILITY gate rather than a branch
150
+ * inside the callback: `released_cb` never tests `open`, but the scrim is `can_target = open`,
151
+ * and `prepare_cb` refuses to even detect a swipe unless the direction matches the state.
152
+ * Neither can fire on a closed sheet, so neither signals anything.
160
153
  */
161
154
  export declare function resolveBottomSheetClose(source: BottomSheetCloseSource, state: BottomSheetCloseState): BottomSheetCloseOutcome;
162
155
  /** One entry in a {@link BottomSheetPresentation}'s teardown callback pair. */
@@ -165,13 +158,12 @@ export type BottomSheetTeardownCallback = 'closing' | 'closed';
165
158
  export type BottomSheetPresentationListener = (open: boolean) => void;
166
159
  /**
167
160
  * The two callbacks `AdwDialog` installs on its bottom sheet
168
- * (`adw_bottom_sheet_set_callbacks`, adw-bottom-sheet.c:2227-2238). They are
169
- * NOT the same event twice:
161
+ * (`adw_bottom_sheet_set_callbacks`). NOT the same event twice:
170
162
  *
171
- * - `onClosing` fires when the close STARTS — adw-dialog.c:231-240 turns it into
172
- * the public `AdwDialog::closed` signal.
173
- * - `onClosed` fires when the sheet has finished hiding — adw-dialog.c:243-249
174
- * turns it into the dialog's removal from the widget tree.
163
+ * - `onClosing` fires when the close STARTS — `AdwDialog` turns it into the public
164
+ * `AdwDialog::closed` signal.
165
+ * - `onClosed` fires when the sheet has finished hiding — `AdwDialog` turns it into the
166
+ * dialog's removal from the widget tree.
175
167
  */
176
168
  export interface BottomSheetPresentationOptions {
177
169
  /** The close started (`closing_callback`). */
@@ -184,12 +176,10 @@ export interface BottomSheetPresentationOptions {
184
176
  * the idempotent `open` flag, the `can-close` gate applied through
185
177
  * {@link resolveBottomSheetClose}, and the `has_been_open` teardown replay.
186
178
  *
187
- * `setOpen` is the PROGRAMMATIC path and deliberately ignores `can-close`
188
- * ("Bottom sheet can still be closed using [property@BottomSheet:open]",
189
- * adw-bottom-sheet.c:2071); {@link requestClose} is the INTERACTIVE path that
190
- * runs the gate. Keeping them apart is what lets a locked sheet still be closed
191
- * by its owner — the distinction NativeScript lacked entirely (every dismissal
192
- * went through one unconditional `close()`).
179
+ * `setOpen` is the PROGRAMMATIC path and deliberately ignores `can-close` ("Bottom sheet can
180
+ * still be closed using [property@BottomSheet:open]"); {@link requestClose} is the INTERACTIVE
181
+ * path that runs the gate. Keeping them apart is what lets a locked sheet still be closed by
182
+ * its owner.
193
183
  */
194
184
  export declare class BottomSheetPresentation {
195
185
  private _open;
@@ -208,37 +198,35 @@ export declare class BottomSheetPresentation {
208
198
  get canClose(): boolean;
209
199
  /**
210
200
  * Whether the sheet has ever been open. Drives the teardown replay in
211
- * {@link setOpen}; `has_been_open` in the C source (adw-bottom-sheet.c:153).
201
+ * {@link setOpen}; `has_been_open` in the C source.
212
202
  */
213
203
  get hasBeenOpen(): boolean;
214
- /** Set `can-close`. Returns whether it changed (adw-bottom-sheet.c:2076-2091). */
204
+ /** Set `can-close`. Returns whether it changed. */
215
205
  setCanClose(canClose: boolean): boolean;
216
206
  /**
217
- * The programmatic open/close — `adw_bottom_sheet_set_open`
218
- * (adw-bottom-sheet.c:1661-1778). Returns whether `open` changed, i.e.
219
- * whether a `notify::open` was emitted.
207
+ * The programmatic open/close — `adw_bottom_sheet_set_open`. Returns whether `open`
208
+ * changed, i.e. whether a `notify::open` was emitted.
220
209
  *
221
210
  * `can-close` is NOT consulted: this is the owner's path, and it is how
222
- * `adw_dialog_force_close` closes a locked dialog (adw-dialog.c:1979-1997).
211
+ * `adw_dialog_force_close` closes a locked dialog.
223
212
  */
224
213
  setOpen(open: boolean): boolean;
225
214
  /**
226
- * Route a dismissal affordance through {@link resolveBottomSheetClose} and
227
- * APPLY the outcome — `'close'` closes the sheet, everything else leaves it
228
- * untouched. The returned outcome tells the renderer what to emit: a
229
- * `close-attempt` signal, a `sheet.close` forwarded to the parent, or
230
- * nothing at all.
215
+ * Route a dismissal affordance through {@link resolveBottomSheetClose} and APPLY the
216
+ * outcome — `'close'` closes the sheet, everything else leaves it untouched. The returned
217
+ * outcome tells the renderer what to emit: a `close-attempt` signal, a `sheet.close`
218
+ * forwarded to the parent, or nothing at all.
231
219
  */
232
220
  requestClose(source: BottomSheetCloseSource): BottomSheetCloseOutcome;
233
221
  /**
234
- * The sheet has finished hiding — `open_animation_done_cb`'s teardown
235
- * (adw-bottom-sheet.c:335-349) reduced to what a renderer without a spring
236
- * animation can observe. Fires `onClosed` and returns whether it did.
222
+ * The sheet has finished hiding — `open_animation_done_cb`'s teardown reduced to what a
223
+ * renderer without a spring animation can observe. Fires `onClosed` and returns whether it
224
+ * did.
237
225
  *
238
- * The C guard is `progress < 0.5` ("settled on the closed side"); with no
239
- * animation the settled progress IS `open`, so an open sheet fires nothing.
240
- * Call it only after a {@link setOpen} that RETURNED TRUE — the replay branch
241
- * has already fired both callbacks for a never-opened sheet.
226
+ * The C guard is `progress < 0.5` ("settled on the closed side"); with no animation the
227
+ * settled progress IS `open`, so an open sheet fires nothing. Call it only after a
228
+ * {@link setOpen} that RETURNED TRUE — the replay branch has already fired both callbacks
229
+ * for a never-opened sheet.
242
230
  */
243
231
  finishClose(): boolean;
244
232
  }
@@ -1,21 +1,15 @@
1
- /** `adw_lerp` (adw-animation-util.c:23-27) — `a * (1 - t) + b * t`. */
1
+ /** `adw_lerp` — `a * (1 - t) + b * t`. */
2
2
  export declare function adwLerp(a: number, b: number, t: number): number;
3
3
  /**
4
- * The inverse: where `r` sits between `a` and `b`, as a 0..1 fraction.
5
- *
6
- * Not a libadwaita function — C writes the division inline — but it is the same
7
- * expression at every call site, and naming it is what keeps the two directions
8
- * from drifting apart.
4
+ * The inverse: where `r` sits between `a` and `b`, as a 0..1 fraction. Not a
5
+ * libadwaita function — C writes the division inline at each call site.
9
6
  */
10
7
  export declare function inverseLerp(a: number, b: number, r: number): number;
11
8
  /** `ease_out_cubic` (adw-easing.c) — `(t - 1)^3 + 1`. */
12
9
  export declare function easeOutCubic(t: number): number;
13
10
  /**
14
- * `ease_in_out_sine` (adw-easing.c:276-281) — `-0.5 * (cos(pi * t) - 1)`, with
15
- * the duration argument at its only used value, 1.
16
- *
17
- * This is the curve the spinner's arc breathes on, at BOTH ends: `get_arc_start`
18
- * eases the extend phase and `get_arc_end` the contract phase
19
- * (adw-spinner-paintable.c:121, :141).
11
+ * `ease_in_out_sine` — `-0.5 * (cos(pi * t) - 1)`, with the duration argument at its
12
+ * only used value, 1. The curve the spinner's arc breathes on at BOTH ends:
13
+ * `get_arc_start` eases the extend phase, `get_arc_end` the contract phase.
20
14
  */
21
15
  export declare function easeInOutSine(t: number): number;