@gjsify/adwaita-web 0.51.0 → 0.52.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 (103) hide show
  1. package/dist/adwaita-web.css +255 -27
  2. package/dist/adwaita-web.css.map +1 -1
  3. package/lib/types/blueprint-layout.spec.d.ts +1 -0
  4. package/lib/types/blueprint-markup.spec.d.ts +4 -0
  5. package/lib/types/blueprint-tree.spec.d.ts +1 -0
  6. package/lib/types/elements/adw-bottom-sheet.d.ts +31 -13
  7. package/lib/types/elements/adw-carousel.d.ts +5 -0
  8. package/lib/types/elements/adw-header-bar.d.ts +15 -0
  9. package/lib/types/elements/adw-inline-view-switcher.d.ts +1 -0
  10. package/lib/types/elements/adw-navigation-view.d.ts +1 -0
  11. package/lib/types/elements/adw-sidebar.d.ts +10 -0
  12. package/lib/types/elements/adw-tab-view.d.ts +1 -0
  13. package/lib/types/elements/adw-toggle-group.d.ts +11 -0
  14. package/lib/types/elements/gtk-action-bar.d.ts +19 -0
  15. package/lib/types/elements/gtk-box.d.ts +17 -0
  16. package/lib/types/elements/gtk-button.d.ts +2 -0
  17. package/lib/types/elements/gtk-label.d.ts +122 -0
  18. package/lib/types/gio-menu.spec.d.ts +1 -0
  19. package/lib/types/gtk-box.spec.d.ts +1 -0
  20. package/lib/types/gtk-label.spec.d.ts +1 -0
  21. package/lib/types/gtk-value-doors.spec.d.ts +1 -0
  22. package/lib/types/index.d.ts +4 -1
  23. package/lib/types/namespace/gio.d.ts +1 -0
  24. package/lib/types/namespace/gtk.d.ts +5 -0
  25. package/lib/types/shared-tree-builder.d.ts +64 -0
  26. package/lib/types/source-view/asm6502.d.ts +1 -20
  27. package/lib/types/source-view/index.d.ts +3 -2
  28. package/lib/types/source-view/theme.d.ts +1 -1
  29. package/lib/types/string-list-slot.d.ts +4 -0
  30. package/lib/types/styles.generated.d.ts +1 -1
  31. package/lib/types/tags.spec.d.ts +1 -0
  32. package/lib/types/value-lists.spec.d.ts +1 -0
  33. package/package.json +8 -6
  34. package/scss/_action_bar.scss +51 -0
  35. package/scss/_banner.scss +8 -1
  36. package/scss/_bottom_sheet.scss +57 -0
  37. package/scss/_box.scss +23 -0
  38. package/scss/_button.scss +29 -7
  39. package/scss/_button_content.scss +6 -1
  40. package/scss/_button_row.scss +5 -2
  41. package/scss/_carousel.scss +6 -0
  42. package/scss/_labels.scss +126 -12
  43. package/scss/_navigation_split_view.scss +18 -0
  44. package/scss/_overlay_split_view.scss +5 -0
  45. package/scss/_reset.scss +29 -4
  46. package/scss/_split_button.scss +5 -2
  47. package/scss/_status_page.scss +31 -17
  48. package/scss/_theme.scss +11 -3
  49. package/scss/_toolbar_view.scss +10 -0
  50. package/scss/_variables.scss +1 -0
  51. package/scss/_widget.scss +55 -0
  52. package/scss/_window_title.scss +9 -0
  53. package/scss/adwaita-skin.scss +8 -2
  54. package/src/adw-banner.spec.ts +16 -0
  55. package/src/adw-button-row.spec.ts +8 -0
  56. package/src/adw-header-bar.spec.ts +17 -0
  57. package/src/blueprint-layout.spec.ts +223 -0
  58. package/src/blueprint-markup.spec.ts +155 -0
  59. package/src/blueprint-tree.spec.ts +174 -0
  60. package/src/bottom-sheet.spec.ts +166 -1
  61. package/src/chrome.spec.ts +5 -2
  62. package/src/elements/adw-bottom-sheet.ts +166 -59
  63. package/src/elements/adw-carousel.ts +10 -5
  64. package/src/elements/adw-clamp.ts +12 -0
  65. package/src/elements/adw-combo-row.ts +13 -4
  66. package/src/elements/adw-header-bar.ts +46 -3
  67. package/src/elements/adw-inline-view-switcher.ts +11 -0
  68. package/src/elements/adw-navigation-view.ts +10 -0
  69. package/src/elements/adw-sidebar.ts +22 -0
  70. package/src/elements/adw-spin-row.ts +44 -5
  71. package/src/elements/adw-status-page.ts +12 -6
  72. package/src/elements/adw-tab-view.ts +20 -3
  73. package/src/elements/adw-toggle-group.ts +45 -4
  74. package/src/elements/adw-toolbar-view.ts +9 -0
  75. package/src/elements/gtk-action-bar.ts +90 -0
  76. package/src/elements/gtk-box.ts +87 -0
  77. package/src/elements/gtk-button.ts +60 -13
  78. package/src/elements/gtk-drop-down.ts +10 -1
  79. package/src/elements/gtk-label.ts +415 -0
  80. package/src/gio-menu.spec.ts +125 -0
  81. package/src/globals.d.ts +7 -0
  82. package/src/gtk-box.spec.ts +168 -0
  83. package/src/gtk-button.spec.ts +123 -1
  84. package/src/gtk-label.spec.ts +595 -0
  85. package/src/gtk-value-doors.spec.ts +104 -0
  86. package/src/index.ts +14 -1
  87. package/src/keyboard-operable.spec.ts +2 -1
  88. package/src/namespace/gio.ts +19 -0
  89. package/src/namespace/gtk.ts +14 -0
  90. package/src/shared-tree-builder.ts +268 -0
  91. package/src/shared-trees.spec.ts +296 -32
  92. package/src/source-view/adw-source-view.ts +3 -3
  93. package/src/source-view/asm6502.ts +11 -191
  94. package/src/source-view/index.ts +17 -11
  95. package/src/source-view/theme.ts +16 -16
  96. package/src/split-button.spec.ts +7 -0
  97. package/src/string-list-slot.ts +21 -0
  98. package/src/styles.generated.ts +1 -1
  99. package/src/tags.spec.ts +51 -0
  100. package/src/test.browser.mts +18 -0
  101. package/src/value-lists.spec.ts +93 -0
  102. package/lib/types/source-view/hex.d.ts +0 -21
  103. package/src/source-view/hex.ts +0 -37
@@ -14,6 +14,12 @@
14
14
  import { EditorView } from '@codemirror/view';
15
15
  import { HighlightStyle } from '@codemirror/language';
16
16
  import { tags } from '@lezer/highlight';
17
+ import {
18
+ ADW_SOURCE_PALETTE_DARK,
19
+ ADW_SOURCE_PALETTE_LIGHT,
20
+ ADW_SOURCE_SYNTAX_ROLES,
21
+ type AdwSourcePalette,
22
+ } from '@gjsify/adwaita-core';
17
23
 
18
24
  /**
19
25
  * Monospace stack — the `--monospace-font-family` token, with its own value
@@ -95,18 +101,19 @@ export const adwaitaHighlightStyle = HighlightStyle.define([
95
101
  { tag: tags.variableName, color: 'var(--view-fg-color, rgba(0,0,6,0.8))' },
96
102
  ]);
97
103
 
104
+ /**
105
+ * Emit one `--adw-src-<role>: <colour>;` declaration per syntax role, in the
106
+ * core's role order. The two schemes therefore cannot drift into listing
107
+ * different roles, which is the failure a hand-written pair of blocks invites.
108
+ */
109
+ const paletteDeclarations = (palette: AdwSourcePalette): string =>
110
+ ADW_SOURCE_SYNTAX_ROLES.map((role) => ` --adw-src-${role}: ${palette[role]};`).join('\n');
111
+
98
112
  // The light-theme syntax palette + shared chrome. Dark values are supplied by
99
113
  // the overrides block (same mechanism as adwaita-web's _theme.scss: auto via
100
114
  // prefers-color-scheme, manual via .theme-dark / opt-out via .theme-light).
101
115
  const DARK_TOKENS = `
102
- --adw-src-comment: #9a9996;
103
- --adw-src-keyword: #78aeed;
104
- --adw-src-number: #ffa348;
105
- --adw-src-string: #8ff0a4;
106
- --adw-src-label: #dc8add;
107
- --adw-src-register: #33d1c9;
108
- --adw-src-directive: #f66151;
109
- --adw-src-operator: rgba(255, 255, 255, 0.55);
116
+ ${paletteDeclarations(ADW_SOURCE_PALETTE_DARK)}
110
117
  --adw-src-gutter-fg: rgba(255, 255, 255, 0.35);
111
118
  --adw-src-active-line: color-mix(in srgb, #ffffff 6%, transparent);`;
112
119
 
@@ -116,14 +123,7 @@ export const SOURCE_VIEW_STYLE_ID = 'adw-source-view-style';
116
123
  /** The chrome stylesheet: container, copy button, LTR pin, syntax palette. */
117
124
  export const SOURCE_VIEW_CSS = `
118
125
  .adw-source-view {
119
- --adw-src-comment: #5e5c64;
120
- --adw-src-keyword: #1c71d8;
121
- --adw-src-number: #c64600;
122
- --adw-src-string: #26a269;
123
- --adw-src-label: #813d9c;
124
- --adw-src-register: #007e8a;
125
- --adw-src-directive: #a51d2d;
126
- --adw-src-operator: rgba(0, 0, 6, 0.55);
126
+ ${paletteDeclarations(ADW_SOURCE_PALETTE_LIGHT)}
127
127
  --adw-src-selection: color-mix(in srgb, var(--accent-bg-color, #3584e4) 26%, transparent);
128
128
  --adw-src-gutter-bg: var(--view-bg-color, #ffffff);
129
129
  --adw-src-gutter-fg: rgba(0, 0, 6, 0.35);
@@ -338,6 +338,13 @@ export const AdwSplitButtonTest = async () => {
338
338
  expect(el.classList.contains('checked')).toBe(false);
339
339
  host.remove();
340
340
  });
341
+
342
+ // Measured beside a GTK render of the gallery's split-button `.blp`: 5px wider there.
343
+ await it('draws the arrow half 24px wide, as `splitbutton > menubutton > button` is', () => {
344
+ const { el, host } = mount({ label: 'Save' });
345
+ expect(Math.round(dropdownHalf(el).getBoundingClientRect().width)).toBe(24);
346
+ host.remove();
347
+ });
341
348
  });
342
349
 
343
350
  // The two behaviours a hand-rolled popover with only an outside-click handler cannot
@@ -0,0 +1,21 @@
1
+ // The `model` slot `<adw-combo-row>` and `<gtk-drop-down>` share — ADR 0072.
2
+ //
3
+ // A `.blp` writes a list model as an OBJECT at the property it sets,
4
+ // `model: Gtk.StringList { strings [ "Blue", "Teal" ] }`, and the shared-tree builder hands
5
+ // that over as a `<gtk-string-list slot="model" strings='["Blue","Teal"]'>` child. The slot
6
+ // CONSUMES it: the child is data, read for its strings and then gone, as GtkBuilder leaves no
7
+ // list model in the widget tree. The strings are JSON because `model` itself is a JSON
8
+ // attribute on both elements, so the one parser reads both spellings.
9
+
10
+ import { parseListModel } from '@gjsify/adwaita-core';
11
+ import type { AdwComboOption } from '@gjsify/adwaita-core';
12
+
13
+ import type { AdwSlotConsume } from './slotted-children.js';
14
+
15
+ /** The `model` slot, handing the authored list to `adopt`. */
16
+ export function stringListSlot(adopt: (model: AdwComboOption[]) => void): AdwSlotConsume {
17
+ return {
18
+ name: 'model',
19
+ consume: (node) => adopt(parseListModel(node instanceof Element ? node.getAttribute('strings') : null)),
20
+ };
21
+ }