@gjsify/adwaita-web 0.4.28 → 0.4.30

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjsify/adwaita-web",
3
- "version": "0.4.28",
3
+ "version": "0.4.30",
4
4
  "description": "Adwaita/Libadwaita web components for browser targets",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -33,11 +33,11 @@
33
33
  "build:types": "tsc"
34
34
  },
35
35
  "dependencies": {
36
- "@gjsify/adwaita-fonts": "^0.4.28",
37
- "@gjsify/adwaita-icons": "^0.4.28"
36
+ "@gjsify/adwaita-fonts": "^0.4.30",
37
+ "@gjsify/adwaita-icons": "^0.4.30"
38
38
  },
39
39
  "devDependencies": {
40
- "@gjsify/cli": "^0.4.28",
40
+ "@gjsify/cli": "^0.4.30",
41
41
  "sass": "^1.99.0",
42
42
  "typescript": "^6.0.3"
43
43
  }
@@ -12,7 +12,9 @@ export class AdwComboRow extends HTMLElement {
12
12
  private _items: string[] = [];
13
13
  private _initialized = false;
14
14
 
15
- static get observedAttributes() { return ['selected']; }
15
+ static get observedAttributes() {
16
+ return ['selected'];
17
+ }
16
18
 
17
19
  get selected(): number {
18
20
  return this._select ? this._select.selectedIndex : parseInt(this.getAttribute('selected') || '0', 10);
@@ -60,10 +62,12 @@ export class AdwComboRow extends HTMLElement {
60
62
  const idx = this._select.selectedIndex;
61
63
  this._valueEl.textContent = this._items[idx] ?? '';
62
64
  this.setAttribute('selected', String(idx));
63
- this.dispatchEvent(new CustomEvent('notify::selected', {
64
- bubbles: true,
65
- detail: { selected: idx },
66
- }));
65
+ this.dispatchEvent(
66
+ new CustomEvent('notify::selected', {
67
+ bubbles: true,
68
+ detail: { selected: idx },
69
+ }),
70
+ );
67
71
  });
68
72
  }
69
73
 
@@ -9,10 +9,14 @@ export class AdwHeaderBar extends HTMLElement {
9
9
  private _endEl: HTMLDivElement | null = null;
10
10
 
11
11
  /** The start (left) section container — append buttons/widgets here. */
12
- get startSection(): HTMLDivElement | null { return this._startEl; }
12
+ get startSection(): HTMLDivElement | null {
13
+ return this._startEl;
14
+ }
13
15
 
14
16
  /** The end (right) section container — append buttons/widgets here. */
15
- get endSection(): HTMLDivElement | null { return this._endEl; }
17
+ get endSection(): HTMLDivElement | null {
18
+ return this._endEl;
19
+ }
16
20
 
17
21
  connectedCallback() {
18
22
  if (this._initialized) return;
@@ -9,7 +9,14 @@ export class AdwOverlaySplitView extends HTMLElement {
9
9
  private _backdropEl!: HTMLDivElement;
10
10
 
11
11
  static get observedAttributes() {
12
- return ['show-sidebar', 'collapsed', 'sidebar-position', 'min-sidebar-width', 'max-sidebar-width', 'sidebar-width-fraction'];
12
+ return [
13
+ 'show-sidebar',
14
+ 'collapsed',
15
+ 'sidebar-position',
16
+ 'min-sidebar-width',
17
+ 'max-sidebar-width',
18
+ 'sidebar-width-fraction',
19
+ ];
13
20
  }
14
21
 
15
22
  get showSidebar(): boolean {
@@ -51,7 +58,7 @@ export class AdwOverlaySplitView extends HTMLElement {
51
58
  const contentChildren = Array.from(this.querySelectorAll('[slot="content"]'));
52
59
  // Any remaining unslotted children go to content
53
60
  const unslotted = Array.from(this.childNodes).filter(
54
- n => !sidebarChildren.includes(n as Element) && !contentChildren.includes(n as Element),
61
+ (n) => !sidebarChildren.includes(n as Element) && !contentChildren.includes(n as Element),
55
62
  );
56
63
 
57
64
  // Clear children safely
@@ -60,13 +67,13 @@ export class AdwOverlaySplitView extends HTMLElement {
60
67
  // Sidebar container
61
68
  this._sidebarEl = document.createElement('div');
62
69
  this._sidebarEl.className = 'adw-osv-sidebar';
63
- sidebarChildren.forEach(c => this._sidebarEl.appendChild(c));
70
+ sidebarChildren.forEach((c) => this._sidebarEl.appendChild(c));
64
71
 
65
72
  // Content container
66
73
  this._contentEl = document.createElement('div');
67
74
  this._contentEl.className = 'adw-osv-content';
68
- contentChildren.forEach(c => this._contentEl.appendChild(c));
69
- unslotted.forEach(c => this._contentEl.appendChild(c));
75
+ contentChildren.forEach((c) => this._contentEl.appendChild(c));
76
+ unslotted.forEach((c) => this._contentEl.appendChild(c));
70
77
 
71
78
  // Backdrop for overlay dismiss
72
79
  this._backdropEl = document.createElement('div');
@@ -100,9 +107,11 @@ export class AdwOverlaySplitView extends HTMLElement {
100
107
 
101
108
  toggleSidebar() {
102
109
  this.showSidebar = !this.showSidebar;
103
- this.dispatchEvent(new CustomEvent('sidebar-toggled', {
104
- detail: { isVisible: this.showSidebar },
105
- }));
110
+ this.dispatchEvent(
111
+ new CustomEvent('sidebar-toggled', {
112
+ detail: { isVisible: this.showSidebar },
113
+ }),
114
+ );
106
115
  }
107
116
 
108
117
  private _syncClasses() {
@@ -24,7 +24,7 @@ export class AdwPreferencesGroup extends HTMLElement {
24
24
  // Build boxed list container and move children into it
25
25
  const listbox = document.createElement('div');
26
26
  listbox.className = 'adw-preferences-group-listbox';
27
- children.forEach(child => listbox.appendChild(child));
27
+ children.forEach((child) => listbox.appendChild(child));
28
28
 
29
29
  this.appendChild(header);
30
30
  this.appendChild(listbox);
@@ -13,7 +13,9 @@ export class AdwSpinRow extends HTMLElement {
13
13
  private _value = 0;
14
14
  private _initialized = false;
15
15
 
16
- static get observedAttributes() { return ['value', 'min', 'max', 'step']; }
16
+ static get observedAttributes() {
17
+ return ['value', 'min', 'max', 'step'];
18
+ }
17
19
 
18
20
  get value(): number {
19
21
  return this._value;
@@ -90,9 +92,15 @@ export class AdwSpinRow extends HTMLElement {
90
92
  this._input.value = this._formatValue(this._value);
91
93
  }
92
94
  break;
93
- case 'min': this._min = num; break;
94
- case 'max': this._max = num; break;
95
- case 'step': this._step = num; break;
95
+ case 'min':
96
+ this._min = num;
97
+ break;
98
+ case 'max':
99
+ this._max = num;
100
+ break;
101
+ case 'step':
102
+ this._step = num;
103
+ break;
96
104
  }
97
105
  }
98
106
 
@@ -102,10 +110,12 @@ export class AdwSpinRow extends HTMLElement {
102
110
  }
103
111
 
104
112
  private _emitChange() {
105
- this.dispatchEvent(new CustomEvent('notify::value', {
106
- bubbles: true,
107
- detail: { value: this._value },
108
- }));
113
+ this.dispatchEvent(
114
+ new CustomEvent('notify::value', {
115
+ bubbles: true,
116
+ detail: { value: this._value },
117
+ }),
118
+ );
109
119
  }
110
120
 
111
121
  private _countDecimals(n: number): number {
@@ -9,7 +9,9 @@ export class AdwSwitchRow extends HTMLElement {
9
9
  private _checkbox!: HTMLInputElement;
10
10
  private _initialized = false;
11
11
 
12
- static get observedAttributes() { return ['active']; }
12
+ static get observedAttributes() {
13
+ return ['active'];
14
+ }
13
15
 
14
16
  get active(): boolean {
15
17
  return this.hasAttribute('active');
@@ -52,10 +54,12 @@ export class AdwSwitchRow extends HTMLElement {
52
54
  this._checkbox = input;
53
55
  this._checkbox.addEventListener('change', () => {
54
56
  this.toggleAttribute('active', this._checkbox.checked);
55
- this.dispatchEvent(new CustomEvent('notify::active', {
56
- bubbles: true,
57
- detail: { active: this._checkbox.checked },
58
- }));
57
+ this.dispatchEvent(
58
+ new CustomEvent('notify::active', {
59
+ bubbles: true,
60
+ detail: { active: this._checkbox.checked },
61
+ }),
62
+ );
59
63
  });
60
64
  }
61
65
 
@@ -35,7 +35,9 @@ export class AdwToastOverlay extends HTMLElement {
35
35
  toast.classList.add('hiding');
36
36
  toast.addEventListener('transitionend', () => toast.remove(), { once: true });
37
37
  // Fallback if transitionend doesn't fire
38
- setTimeout(() => { if (toast.parentNode) toast.remove(); }, 300);
38
+ setTimeout(() => {
39
+ if (toast.parentNode) toast.remove();
40
+ }, 300);
39
41
  }, timeout);
40
42
  }
41
43
  }
package/src/index.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  // (or via SCSS partials at `@gjsify/adwaita-web/scss/...`).
5
5
  // Reference: refs/libadwaita (colors/sizing), refs/adwaita-web (component patterns).
6
6
 
7
- import '@gjsify/adwaita-fonts'; // Registers @font-face (fontsource pattern)
7
+ import '@gjsify/adwaita-fonts'; // Registers @font-face (fontsource pattern)
8
8
 
9
9
  // Register custom elements (side-effect imports)
10
10
  export { AdwCard } from './elements/adw-card.js';