@gjsify/adwaita-web 0.41.0 → 0.43.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/README.md +98 -3
  2. package/dist/adwaita-web.css +30 -23
  3. package/dist/adwaita-web.css.map +1 -1
  4. package/lib/types/adw-fonts.spec.d.ts +2 -0
  5. package/lib/types/breakpoints.d.ts +10 -1
  6. package/lib/types/connect-lifecycle.spec.d.ts +1 -0
  7. package/lib/types/elements/adw-about-dialog.d.ts +1 -0
  8. package/lib/types/elements/adw-action-row.d.ts +2 -0
  9. package/lib/types/elements/adw-alert-dialog.d.ts +14 -2
  10. package/lib/types/elements/adw-carousel.d.ts +8 -0
  11. package/lib/types/elements/adw-dialog.d.ts +2 -7
  12. package/lib/types/elements/adw-icon.d.ts +17 -1
  13. package/lib/types/elements/adw-navigation-split-view.d.ts +7 -0
  14. package/lib/types/elements/adw-overlay-split-view.d.ts +6 -0
  15. package/lib/types/elements/adw-popover.d.ts +1 -0
  16. package/lib/types/elements/adw-preferences-dialog.d.ts +1 -0
  17. package/lib/types/elements/adw-switch.d.ts +10 -0
  18. package/lib/types/elements/adw-toggle-group.d.ts +2 -0
  19. package/lib/types/elements/modal-surface.d.ts +59 -0
  20. package/lib/types/elements/roving-focus.d.ts +26 -0
  21. package/lib/types/elements/row-activation.d.ts +26 -0
  22. package/lib/types/elements/swipe-drag.d.ts +63 -0
  23. package/lib/types/empty-sections.d.ts +15 -0
  24. package/lib/types/empty-sections.spec.d.ts +1 -0
  25. package/lib/types/fonts.d.ts +1 -0
  26. package/lib/types/icon-registry.d.ts +35 -0
  27. package/lib/types/icon-registry.spec.d.ts +18 -0
  28. package/lib/types/index.d.ts +1 -1
  29. package/lib/types/keyboard-operable.spec.d.ts +1 -0
  30. package/lib/types/styles.generated.d.ts +1 -1
  31. package/package.json +10 -6
  32. package/scss/_banner.scss +1 -1
  33. package/scss/_checks.scss +8 -8
  34. package/scss/_combo_row.scss +1 -1
  35. package/scss/_drop_down.scss +1 -1
  36. package/scss/_expander_row.scss +1 -1
  37. package/scss/_icon.scss +47 -0
  38. package/scss/_icons.generated.scss +18 -6
  39. package/scss/_password_entry_row.scss +1 -1
  40. package/scss/_preferences_dialog.scss +3 -2
  41. package/scss/_progress_bar.scss +1 -1
  42. package/scss/_row.scss +1 -1
  43. package/scss/_status_page.scss +1 -1
  44. package/scss/_tab_view.scss +1 -1
  45. package/scss/_toast.scss +6 -24
  46. package/scss/_variables.scss +23 -3
  47. package/src/adw-action-rows.spec.ts +21 -9
  48. package/src/adw-button-content.spec.ts +11 -6
  49. package/src/adw-fonts.spec.ts +188 -0
  50. package/src/adw-icon.spec.ts +17 -8
  51. package/src/adw-row-state.spec.ts +11 -1
  52. package/src/breakpoints.ts +18 -4
  53. package/src/connect-lifecycle.spec.ts +351 -0
  54. package/src/elements/adw-about-dialog.ts +24 -18
  55. package/src/elements/adw-action-row.ts +14 -2
  56. package/src/elements/adw-alert-dialog.ts +39 -20
  57. package/src/elements/adw-button-row.ts +3 -0
  58. package/src/elements/adw-carousel.ts +86 -5
  59. package/src/elements/adw-clamp.ts +3 -2
  60. package/src/elements/adw-data-grid.ts +5 -2
  61. package/src/elements/adw-dialog.ts +16 -63
  62. package/src/elements/adw-expander-row.ts +18 -4
  63. package/src/elements/adw-header-bar.ts +2 -0
  64. package/src/elements/adw-icon.ts +32 -6
  65. package/src/elements/adw-inline-view-switcher.ts +12 -0
  66. package/src/elements/adw-menu-button.ts +17 -10
  67. package/src/elements/adw-navigation-split-view.ts +30 -7
  68. package/src/elements/adw-overlay-split-view.ts +15 -3
  69. package/src/elements/adw-popover.ts +11 -0
  70. package/src/elements/adw-preferences-dialog.ts +18 -16
  71. package/src/elements/adw-preferences-group.ts +7 -0
  72. package/src/elements/adw-sidebar.ts +15 -0
  73. package/src/elements/adw-status-page.ts +12 -4
  74. package/src/elements/adw-switch-row.ts +7 -0
  75. package/src/elements/adw-switch.ts +19 -1
  76. package/src/elements/adw-tab-view.ts +7 -4
  77. package/src/elements/adw-toast-overlay.ts +8 -1
  78. package/src/elements/adw-toggle-group.ts +94 -2
  79. package/src/elements/adw-toolbar-view.ts +6 -2
  80. package/src/elements/adw-view-switcher-bar.ts +18 -0
  81. package/src/elements/adw-view-switcher.ts +14 -0
  82. package/src/elements/modal-surface.ts +180 -0
  83. package/src/elements/roving-focus.ts +154 -0
  84. package/src/elements/row-activation.ts +92 -0
  85. package/src/elements/swipe-drag.ts +450 -0
  86. package/src/empty-sections.spec.ts +81 -0
  87. package/src/empty-sections.ts +54 -0
  88. package/src/fonts.ts +25 -0
  89. package/src/icon-registry.spec.ts +240 -0
  90. package/src/icon-registry.ts +157 -0
  91. package/src/index.ts +24 -1
  92. package/src/keyboard-operable.spec.ts +755 -0
  93. package/src/source-view/theme.ts +15 -3
  94. package/src/split-button.spec.ts +6 -2
  95. package/src/style-classes.spec.ts +6 -0
  96. package/src/styles.generated.ts +1 -1
  97. package/src/test.browser.mts +14 -0
@@ -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
- /** Monospace stack — Adwaita Mono when present, else a portable code font. */
19
- const MONO_FONT =
20
- "'Adwaita Mono', 'Cascadia Code', 'JetBrains Mono', 'Source Code Pro', ui-monospace, 'SF Mono', Menlo, Consolas, monospace";
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({
@@ -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('keeps a stray icon name out of the class list', () => {
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,