@gjsify/adwaita-web 0.41.0 → 0.42.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.
- package/README.md +98 -3
- package/dist/adwaita-web.css +30 -23
- package/dist/adwaita-web.css.map +1 -1
- package/lib/types/adw-fonts.spec.d.ts +2 -0
- package/lib/types/breakpoints.d.ts +10 -1
- package/lib/types/connect-lifecycle.spec.d.ts +1 -0
- package/lib/types/elements/adw-about-dialog.d.ts +1 -0
- package/lib/types/elements/adw-action-row.d.ts +2 -0
- package/lib/types/elements/adw-alert-dialog.d.ts +14 -2
- package/lib/types/elements/adw-dialog.d.ts +2 -7
- package/lib/types/elements/adw-icon.d.ts +17 -1
- package/lib/types/elements/adw-navigation-split-view.d.ts +7 -0
- package/lib/types/elements/adw-overlay-split-view.d.ts +6 -0
- package/lib/types/elements/adw-popover.d.ts +1 -0
- package/lib/types/elements/adw-preferences-dialog.d.ts +1 -0
- package/lib/types/elements/adw-switch.d.ts +10 -0
- package/lib/types/elements/adw-toggle-group.d.ts +2 -0
- package/lib/types/elements/modal-surface.d.ts +59 -0
- package/lib/types/elements/roving-focus.d.ts +26 -0
- package/lib/types/elements/row-activation.d.ts +26 -0
- package/lib/types/empty-sections.d.ts +15 -0
- package/lib/types/empty-sections.spec.d.ts +1 -0
- package/lib/types/fonts.d.ts +1 -0
- package/lib/types/icon-registry.d.ts +35 -0
- package/lib/types/icon-registry.spec.d.ts +18 -0
- package/lib/types/index.d.ts +1 -1
- package/lib/types/keyboard-operable.spec.d.ts +1 -0
- package/lib/types/styles.generated.d.ts +1 -1
- package/package.json +10 -6
- package/scss/_banner.scss +1 -1
- package/scss/_checks.scss +8 -8
- package/scss/_combo_row.scss +1 -1
- package/scss/_drop_down.scss +1 -1
- package/scss/_expander_row.scss +1 -1
- package/scss/_icon.scss +47 -0
- package/scss/_icons.generated.scss +18 -6
- package/scss/_password_entry_row.scss +1 -1
- package/scss/_preferences_dialog.scss +3 -2
- package/scss/_progress_bar.scss +1 -1
- package/scss/_row.scss +1 -1
- package/scss/_status_page.scss +1 -1
- package/scss/_tab_view.scss +1 -1
- package/scss/_toast.scss +6 -24
- package/scss/_variables.scss +23 -3
- package/src/adw-action-rows.spec.ts +21 -9
- package/src/adw-button-content.spec.ts +11 -6
- package/src/adw-fonts.spec.ts +188 -0
- package/src/adw-icon.spec.ts +17 -8
- package/src/adw-row-state.spec.ts +11 -1
- package/src/breakpoints.ts +18 -4
- package/src/connect-lifecycle.spec.ts +351 -0
- package/src/elements/adw-about-dialog.ts +24 -18
- package/src/elements/adw-action-row.ts +14 -2
- package/src/elements/adw-alert-dialog.ts +39 -20
- package/src/elements/adw-button-row.ts +3 -0
- package/src/elements/adw-clamp.ts +3 -2
- package/src/elements/adw-data-grid.ts +5 -2
- package/src/elements/adw-dialog.ts +16 -63
- package/src/elements/adw-expander-row.ts +18 -4
- package/src/elements/adw-header-bar.ts +2 -0
- package/src/elements/adw-icon.ts +32 -6
- package/src/elements/adw-inline-view-switcher.ts +12 -0
- package/src/elements/adw-menu-button.ts +17 -10
- package/src/elements/adw-navigation-split-view.ts +30 -7
- package/src/elements/adw-overlay-split-view.ts +15 -3
- package/src/elements/adw-popover.ts +11 -0
- package/src/elements/adw-preferences-dialog.ts +18 -16
- package/src/elements/adw-preferences-group.ts +7 -0
- package/src/elements/adw-sidebar.ts +15 -0
- package/src/elements/adw-status-page.ts +12 -4
- package/src/elements/adw-switch-row.ts +7 -0
- package/src/elements/adw-switch.ts +19 -1
- package/src/elements/adw-tab-view.ts +7 -4
- package/src/elements/adw-toast-overlay.ts +8 -1
- package/src/elements/adw-toggle-group.ts +94 -2
- package/src/elements/adw-toolbar-view.ts +6 -2
- package/src/elements/adw-view-switcher-bar.ts +18 -0
- package/src/elements/adw-view-switcher.ts +14 -0
- package/src/elements/modal-surface.ts +180 -0
- package/src/elements/roving-focus.ts +154 -0
- package/src/elements/row-activation.ts +92 -0
- package/src/empty-sections.spec.ts +81 -0
- package/src/empty-sections.ts +54 -0
- package/src/fonts.ts +25 -0
- package/src/icon-registry.spec.ts +240 -0
- package/src/icon-registry.ts +157 -0
- package/src/index.ts +24 -1
- package/src/keyboard-operable.spec.ts +755 -0
- package/src/source-view/theme.ts +15 -3
- package/src/split-button.spec.ts +6 -2
- package/src/style-classes.spec.ts +6 -0
- package/src/styles.generated.ts +1 -1
- package/src/test.browser.mts +14 -0
package/src/source-view/theme.ts
CHANGED
|
@@ -15,9 +15,21 @@ import { EditorView } from '@codemirror/view';
|
|
|
15
15
|
import { HighlightStyle } from '@codemirror/language';
|
|
16
16
|
import { tags } from '@lezer/highlight';
|
|
17
17
|
|
|
18
|
-
/**
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Monospace stack — the `--monospace-font-family` token, with its own value
|
|
20
|
+
* repeated as the `var()` fallback for a page that loads `@gjsify/adwaita-web`'s
|
|
21
|
+
* stylesheet without the theme tokens.
|
|
22
|
+
*
|
|
23
|
+
* It USED to be a second stack, written out here and longer (Cascadia Code,
|
|
24
|
+
* JetBrains Mono, Source Code Pro, Consolas). Two consequences, both real: the
|
|
25
|
+
* `stylesheet-font-families` conformance rule reads `.css`/`.scss` only, so a
|
|
26
|
+
* stack living in a TS string literal was outside every check the repo has; and
|
|
27
|
+
* on a host with, say, JetBrains Mono but no Adwaita Mono, an `<adw-source-view>`
|
|
28
|
+
* and a `.monospace` label on the SAME page rendered in DIFFERENT typefaces.
|
|
29
|
+
* `_variables.scss` is where that stack is argued about (it explains why
|
|
30
|
+
* 'Cantarell' is dropped from it), so it is where it lives.
|
|
31
|
+
*/
|
|
32
|
+
const MONO_FONT = "var(--monospace-font-family, 'Adwaita Mono', ui-monospace, 'SF Mono', 'Menlo', monospace)";
|
|
21
33
|
|
|
22
34
|
/** The CodeMirror EditorView theme mapping `.cm-*` chrome to Adwaita tokens. */
|
|
23
35
|
export const adwaitaEditorTheme = EditorView.theme({
|
package/src/split-button.spec.ts
CHANGED
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
} from '@gjsify/adwaita-core/conformance';
|
|
20
20
|
import type { SplitButtonProperty } from '@gjsify/adwaita-core';
|
|
21
21
|
import type { AdwSplitButton } from './elements/adw-split-button.js';
|
|
22
|
+
import { fallbackMask, maskOf } from './icon-registry.spec.js';
|
|
22
23
|
|
|
23
24
|
/** The GObject properties the element re-emits as `notify::*` CustomEvents. */
|
|
24
25
|
const NOTIFY_PROPERTIES: readonly SplitButtonProperty[] = [
|
|
@@ -160,12 +161,15 @@ export const AdwSplitButtonTest = async () => {
|
|
|
160
161
|
host.remove();
|
|
161
162
|
});
|
|
162
163
|
|
|
163
|
-
await it('
|
|
164
|
+
await it('turns a stray icon name into the broken glyph, not a stray class', () => {
|
|
164
165
|
const { el, host } = mount({ 'icon-name': 'a b' });
|
|
165
166
|
const icon = actionHalf(el).querySelector('.adw-icon') as HTMLElement;
|
|
166
167
|
// `adw-icon--a b` would have added a second, unrelated `b` class.
|
|
167
168
|
expect(icon.classList.contains('b')).toBe(false);
|
|
168
|
-
expect(icon.className).toBe('adw-icon');
|
|
169
|
+
expect(icon.className).toBe('adw-icon adw-icon--image-missing');
|
|
170
|
+
// The name was GIVEN, so the slot shows what GTK's failed lookup shows —
|
|
171
|
+
// dropping the class left a visible 16px hole instead.
|
|
172
|
+
expect(maskOf(icon)).toBe(fallbackMask());
|
|
169
173
|
host.remove();
|
|
170
174
|
});
|
|
171
175
|
|
|
@@ -83,6 +83,12 @@ export const DOCUMENTED_STYLE_CLASSES: Record<string, { shipped: boolean; reason
|
|
|
83
83
|
monospace: SHIPPED,
|
|
84
84
|
numeric: SHIPPED,
|
|
85
85
|
// Colors
|
|
86
|
+
// `accent` was missing from this list for as long as it has existed, and not by
|
|
87
|
+
// judgement: the gate that keeps the list honest read only the doc's BACKTICK
|
|
88
|
+
// spelling, and `.accent` is the one class upstream writes as `<tt>.accent</tt>`
|
|
89
|
+
// (style-classes.md:368). It has always been implemented (`scss/_labels.scss:53`);
|
|
90
|
+
// what was missing was anything that would notice if it stopped being.
|
|
91
|
+
accent: SHIPPED,
|
|
86
92
|
error: SHIPPED,
|
|
87
93
|
warning: SHIPPED,
|
|
88
94
|
success: SHIPPED,
|