@swiftwc/ui 0.0.0-dev.75 → 0.0.0-dev.76

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.
@@ -1,7 +1,7 @@
1
1
  import { $, devFlags } from '../internal/utils';
2
2
  export class ImageView extends HTMLElement {
3
3
  static get observedAttributes() {
4
- return ['system-name'];
4
+ return ['system-name', 'system-weight'];
5
5
  }
6
6
  static #template;
7
7
  static get template() {
@@ -16,24 +16,42 @@ export class ImageView extends HTMLElement {
16
16
  attributeChangedCallback(name, oldValue, newValue) {
17
17
  if (devFlags.debug)
18
18
  console.debug(`${ImageView.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
19
+ if (oldValue === newValue)
20
+ return;
19
21
  switch (name) {
20
- case 'system-name':
21
- if (oldValue === newValue)
22
- break;
23
- // this.innerHTML = `<i style="line-height: 1.05" class="ph ph-${newValue}"></i>`
24
- //this.setAttribute('class', `ph ph-${newValue}`)
25
- let image = this.querySelector(':scope>:not([slot])');
26
- if (newValue) {
27
- const el = image ?? $(`<i style="line-height: 1"></i>`, '>1');
28
- el.setAttribute('class', `ph ph-${newValue}`);
29
- image ??= this.appendChild(el);
30
- // image ??= this.appendChild($(`<i style="line-height: 1.05"></i>`, '>1'))
31
- // image.setAttribute('class', `ph ph-${newValue}`)
32
- }
33
- else
34
- image?.remove();
22
+ case 'system-weight': {
23
+ this.#render(this.getAttribute('system-name'), newValue);
35
24
  break;
25
+ }
26
+ case 'system-name': {
27
+ this.#render(newValue, this.getAttribute('system-weight'));
28
+ // // this.innerHTML = `<i style="line-height: 1.05" class="ph ph-${newValue}"></i>`
29
+ // //this.setAttribute('class', `ph ph-${newValue}`)
30
+ // let image = this.querySelector(':scope>:not([slot])')
31
+ // if (newValue) {
32
+ // const el = image ?? $(`<i style="line-height: 1"></i>`, '>1')
33
+ // el.setAttribute('class', `ph ph-${newValue}`)
34
+ // image ??= this.appendChild(el)
35
+ // // image ??= this.appendChild($(`<i style="line-height: 1.05"></i>`, '>1'))
36
+ // // image.setAttribute('class', `ph ph-${newValue}`)
37
+ // } else image?.remove()
38
+ break;
39
+ }
40
+ }
41
+ }
42
+ #render(icon, weight) {
43
+ if (!icon) {
44
+ this.querySelector(':scope>:not([slot])')?.remove();
45
+ return;
36
46
  }
47
+ const tokens = [`ph${weight ? `-${weight}` : ''}`, `ph-${icon}`];
48
+ const container = this.querySelector(':scope>:not([slot])') ?? this.appendChild(Object.assign(document.createElement('i'), { style: 'line-height: 1' }));
49
+ if ('1' !== container.style.getPropertyValue('line-height'))
50
+ container.style.setProperty('line-height', '1');
51
+ for (const token of container.classList)
52
+ if (token.startsWith('ph') && !tokens.includes(token))
53
+ container.classList.remove(token);
54
+ container.classList.add(...tokens);
37
55
  }
38
56
  disconnectedCallback() {
39
57
  if (devFlags.debug)
@@ -1,4 +1,5 @@
1
1
  import { $, devFlags, renderLabel } from '../internal/utils';
2
+ import { html, render } from '../tpl';
2
3
  export class LabeledContent extends HTMLElement {
3
4
  static get observedAttributes() {
4
5
  return ['value', 'label', 'header', 'footer', 'labeled-content-style', 'format'];
@@ -33,24 +34,24 @@ export class LabeledContent extends HTMLElement {
33
34
  return;
34
35
  switch (name) {
35
36
  case 'header':
36
- let header = this.querySelector(':scope>[slot=header]');
37
- if (newValue) {
38
- const el = header ?? $(`<header slot="header"></header>`, '>1');
39
- renderLabel(':scope>label-view', `<label-view font="callout"><span></span></label-view>`, el, newValue);
40
- header ??= this.appendChild(el);
37
+ if (!newValue) {
38
+ this.querySelector(':scope>[slot=header]')?.remove();
39
+ break;
41
40
  }
42
- else
43
- header?.remove();
41
+ const header = this.querySelector(':scope>[slot=header]') ?? this.appendChild(Object.assign(document.createElement('header'), { slot: 'header' }));
42
+ render(html `<label-view font="callout">
43
+ <span>${newValue}</span>
44
+ </label-view>`, header);
44
45
  break;
45
46
  case 'footer':
46
- let footer = this.querySelector(':scope>[slot=footer]');
47
- if (newValue) {
48
- const el = footer ?? $(`<footer slot="footer"></footer>`, '>1');
49
- renderLabel(':scope>label-view', `<label-view font="callout"><span></span></label-view>`, el, newValue);
50
- footer ??= this.appendChild(el);
47
+ if (!newValue) {
48
+ this.querySelector(':scope>[slot=footer]')?.remove();
49
+ break;
51
50
  }
52
- else
53
- footer?.remove();
51
+ const footer = this.querySelector(':scope>[slot=footer]') ?? this.appendChild(Object.assign(document.createElement('footer'), { slot: 'footer' }));
52
+ render(html `<label-view font="callout">
53
+ <span>${newValue}</span>
54
+ </label-view>`, footer);
54
55
  break;
55
56
  case 'value':
56
57
  renderLabel(':scope>label-view:not([slot])', `<label-view><span></span></label-view>`, this, this.#fmt(newValue, this.getAttribute('format')));
@@ -6,10 +6,11 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
6
6
  };
7
7
  var NavigationTitle_1;
8
8
  import { microtaskOnConnected } from '../internal/decorators';
9
- import { $, devFlags, renderLabel } from '../internal/utils';
9
+ import { devFlags } from '../internal/utils';
10
+ import { html, render } from '../tpl';
10
11
  let NavigationTitle = NavigationTitle_1 = class NavigationTitle extends HTMLElement {
11
12
  static get observedAttributes() {
12
- return ['value', 'subtitle'];
13
+ return ['value', 'subtitle', 'system-image', 'system-image-weight'];
13
14
  }
14
15
  constructor() {
15
16
  super();
@@ -17,7 +18,7 @@ let NavigationTitle = NavigationTitle_1 = class NavigationTitle extends HTMLElem
17
18
  attributeChangedCallback(name, oldValue, newValue) {
18
19
  if (devFlags.debug)
19
20
  console.debug(`${NavigationTitle_1.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
20
- this.#render(this.getAttribute('value'), this.getAttribute('subtitle'));
21
+ this.#render(this.getAttribute('value'), this.getAttribute('subtitle'), this.getAttribute('system-image'), this.getAttribute('system-image-weight'));
21
22
  }
22
23
  disconnectedCallback() {
23
24
  if (devFlags.debug)
@@ -27,11 +28,29 @@ let NavigationTitle = NavigationTitle_1 = class NavigationTitle extends HTMLElem
27
28
  if (devFlags.debug)
28
29
  console.debug(`${NavigationTitle_1.name} ⚡️ connect`);
29
30
  }
30
- #render = (title, subtitle) => {
31
- const titleTemplate = `<label-view line-limit="1" truncation-mode="tail" font="headline"><span></span></label-view>`, subtitleTemplate = `<label-view line-limit="1" truncation-mode="tail" foreground="secondary" font="callout"><span></span></label-view>`, vStactTemplate = `<v-stack spacing="0" alignment="fill">${titleTemplate}${subtitleTemplate}</v-stack>`;
32
- const el = this.querySelector(':scope>:not([slot])') ?? this.appendChild($(`<navigation-large-title>${vStactTemplate}</navigation-large-title>`, '>1')), vStack = el.querySelector(':scope>v-stack') ?? el.appendChild($(vStactTemplate, '>1'));
33
- renderLabel(':scope>label-view:nth-child(1)', titleTemplate, vStack, title);
34
- renderLabel(':scope>label-view:nth-child(2)', subtitleTemplate, vStack, subtitle);
31
+ #render = (title, subtitle, systemImage, systemImageWeight) => {
32
+ const template = html `
33
+ <v-stack alignment="fill">
34
+ ${systemImage ? html `<image-view system-name="${systemImage}" system-weight="${systemImageWeight}" foreground="blue"></image-view>` : null}
35
+ <v-stack spacing="0" alignment="fill">
36
+ <label-view line-limit="1" truncation-mode="tail" font="headline">
37
+ <span>${title ?? ''}</span>
38
+ </label-view>
39
+ <label-view line-limit="1" truncation-mode="tail" foreground="secondary" font="callout">
40
+ <span>${subtitle ?? ''}</span>
41
+ </label-view>
42
+ </v-stack>
43
+ </v-stack>
44
+ `;
45
+ const container = this.querySelector(':scope>:not([slot])') ?? this.appendChild(document.createElement('navigation-large-title'));
46
+ render(template, container);
47
+ // const titleTemplate = `<label-view line-limit="1" truncation-mode="tail" font="headline"><span></span></label-view>`,
48
+ // subtitleTemplate = `<label-view line-limit="1" truncation-mode="tail" foreground="secondary" font="callout"><span></span></label-view>`,
49
+ // vStactTemplate = `<v-stack spacing="0" alignment="fill">${titleTemplate}${subtitleTemplate}</v-stack>`
50
+ // const el = this.querySelector(':scope>:not([slot])') ?? this.appendChild($(`<navigation-large-title>${vStactTemplate}</navigation-large-title>`, '>1')),
51
+ // vStack = el.querySelector(':scope>v-stack') ?? el.appendChild($(vStactTemplate, '>1'))
52
+ // renderLabel(':scope>label-view:nth-child(1)', titleTemplate, vStack, title)
53
+ // renderLabel(':scope>label-view:nth-child(2)', subtitleTemplate, vStack, subtitle)
35
54
  };
36
55
  };
37
56
  NavigationTitle = NavigationTitle_1 = __decorate([
@@ -2,7 +2,8 @@ var _a;
2
2
  import { lifecycleObserver } from '../buses';
3
3
  import { CleanupRegistry } from '../internal/class/cleanup-registry';
4
4
  import { ResizeObserverSingleton } from '../internal/class/resize-observer-singleton';
5
- import { $, devFlags, frame, onoff, renderLabel, slowHideShow } from '../internal/utils';
5
+ import { $, devFlags, frame, onoff, slowHideShow } from '../internal/utils';
6
+ import { html, render } from '../tpl';
6
7
  const observers = new ResizeObserverSingleton();
7
8
  export class ScrollView extends HTMLElement {
8
9
  static get observedAttributes() {
@@ -186,10 +187,17 @@ export class ScrollView extends HTMLElement {
186
187
  });
187
188
  }
188
189
  #renderNavTitle = (title, subtitle) => {
189
- const titleTemplate = `<label-view line-limit="1" truncation-mode="tail" font="headline"><span></span></label-view>`, subtitleTemplate = `<label-view line-limit="1" truncation-mode="tail" foreground="secondary" font="callout"><span></span></label-view>`;
190
- const vStack = this.querySelector(':scope>[slot=top-bar-principal]') ?? this.appendChild($(`<v-stack spacing="0" alignment="fill" slot="top-bar-principal">${titleTemplate}${subtitleTemplate}</v-stack>`, '>1'));
191
- renderLabel(':scope>label-view:nth-child(1)', titleTemplate, vStack, title);
192
- renderLabel(':scope>label-view:nth-child(2)', subtitleTemplate, vStack, subtitle);
190
+ // const titleTemplate = `<label-view line-limit="1" truncation-mode="tail" font="headline"><span></span></label-view>`,
191
+ // subtitleTemplate = `<label-view line-limit="1" truncation-mode="tail" foreground="secondary" font="callout"><span></span></label-view>`
192
+ // const vStack =
193
+ // this.querySelector(':scope>[slot=top-bar-principal]') ?? this.appendChild($(`<v-stack spacing="0" alignment="fill" slot="top-bar-principal">${titleTemplate}${subtitleTemplate}</v-stack>`, '>1'))
194
+ // renderLabel(':scope>label-view:nth-child(1)', titleTemplate, vStack, title)
195
+ // renderLabel(':scope>label-view:nth-child(2)', subtitleTemplate, vStack, subtitle)
196
+ const container = this.querySelector(':scope>[slot=top-bar-principal]') ?? this.appendChild(Object.assign(document.createElement('v-stack'), { spacing: '0', alignment: 'fill', slot: 'top-bar-principal' }));
197
+ render(html `
198
+ ${title ? html `<label-view line-limit="1" truncation-mode="tail" font="headline"><span>${title}</span></label-view>` : null}
199
+ ${subtitle ? html `<label-view line-limit="1" truncation-mode="tail" foreground="secondary" font="callout"><span>${subtitle}</span></label-view>` : null}
200
+ `, container);
193
201
  };
194
202
  }
195
203
  _a = ScrollView;
@@ -1,4 +1,5 @@
1
- import { $, devFlags, renderLabel } from '../internal/utils';
1
+ import { $, devFlags } from '../internal/utils';
2
+ import { html, render } from '../tpl';
2
3
  export class SectionView extends HTMLElement {
3
4
  static get observedAttributes() {
4
5
  return ['header', 'footer'];
@@ -37,24 +38,24 @@ export class SectionView extends HTMLElement {
37
38
  // Snapshot.waitReady.then(() => {
38
39
  switch (name) {
39
40
  case 'header':
40
- let header = this.querySelector(':scope>[slot=header]');
41
- if (newValue) {
42
- const el = header ?? $(`<header slot="header"></header>`, '>1');
43
- renderLabel(':scope>label-view', `<label-view line-limit="1" truncation-mode="tail" font="callout"><span></span></label-view>`, el, newValue);
44
- header ??= this.appendChild(el);
41
+ if (!newValue) {
42
+ this.querySelector(':scope>[slot=header]')?.remove();
43
+ break;
45
44
  }
46
- else
47
- header?.remove();
45
+ const header = this.querySelector(':scope>[slot=header]') ?? this.appendChild(Object.assign(document.createElement('header'), { slot: 'header' }));
46
+ render(html `<label-view line-limit="1" truncation-mode="tail" font="callout">
47
+ <span>${newValue}</span>
48
+ </label-view>`, header);
48
49
  break;
49
50
  case 'footer':
50
- let footer = this.querySelector(':scope>[slot=footer]');
51
- if (newValue) {
52
- const el = footer ?? $(`<footer slot="footer"></footer>`, '>1');
53
- renderLabel(':scope>label-view', `<label-view line-limit="1" truncation-mode="tail" font="callout"><span></span></label-view>`, el, newValue);
54
- footer ??= this.appendChild(el);
51
+ if (!newValue) {
52
+ this.querySelector(':scope>[slot=footer]')?.remove();
53
+ break;
55
54
  }
56
- else
57
- footer?.remove();
55
+ const footer = this.querySelector(':scope>[slot=footer]') ?? this.appendChild(Object.assign(document.createElement('footer'), { slot: 'footer' }));
56
+ render(html `<label-view line-limit="1" truncation-mode="tail" font="callout">
57
+ <span>${newValue}</span>
58
+ </label-view>`, footer);
58
59
  break;
59
60
  }
60
61
  // })
@@ -1065,10 +1065,6 @@
1065
1065
  --toolbar-cell-filter: blur(10px);
1066
1066
  --toolbar-cell-opacity: 0;
1067
1067
  }
1068
- :where(:is(navigation-stack, dialog, body-view):has(> body-view > body-view) > scroll-view,
1069
- :is(navigation-stack, dialog, body-view):has(> body-view > body-view) > tool-bar) {
1070
- content-visibility: hidden;
1071
- }
1072
1068
  }
1073
1069
  @layer sw-components {
1074
1070
  :where(navigation-stack:not([hidden]),
@@ -1106,6 +1102,7 @@
1106
1102
  [is=form-view]:not([hidden]),
1107
1103
  v-stack:not([hidden]),
1108
1104
  h-stack:not([hidden]),
1105
+ group-box:not([hidden]),
1109
1106
  tool-bar:not([hidden]),
1110
1107
  label-view:not([hidden]),
1111
1108
  labeled-content:not([hidden]),
@@ -1373,7 +1370,32 @@
1373
1370
  }
1374
1371
  }
1375
1372
  }
1376
- @layer sw-components {}
1373
+ @layer sw-components {
1374
+ :where(image-view) {
1375
+ --image--fontsize: calc(var(--label-image-size) * 1rem);
1376
+ }
1377
+ :where(image-view > :not([slot])) {
1378
+ inline-size: var(--image--fontsize);
1379
+ block-size: var(--image--fontsize);
1380
+ font-size: var(--image--fontsize);
1381
+ }
1382
+ }
1383
+ @layer sw-components {
1384
+ :where(group-box) {
1385
+ background: var(--groupbox--background);
1386
+ padding-inline: var(--groupbox--padding-inline);
1387
+ padding-block: var(--groupbox--padding-block);
1388
+ border-radius: var(--groupbox--border-radius);
1389
+ --groupbox--background: var(--red);
1390
+ --groupbox--padding-inline: 1rem;
1391
+ --groupbox--padding-block: 1rem;
1392
+ --groupbox--border-radius: 1rem;
1393
+ }
1394
+ :where(group-box :nth-child(1 of image-view),
1395
+ group-box :nth-child(1 of label-view)) {
1396
+ --label-image-size: 5;
1397
+ }
1398
+ }
1377
1399
  @layer sw-components {
1378
1400
  :where(h-divider) {
1379
1401
  inline-size: 100%;
@@ -2710,7 +2732,7 @@
2710
2732
  font-weight: var(--label--titlestack-font-weight, );
2711
2733
  display: var(--label--titlestack-display, none);
2712
2734
  }
2713
- label-view > [slot=icon] {
2735
+ :where(label-view > [slot=icon]) {
2714
2736
  aspect-ratio: 1/1;
2715
2737
  inline-size: var(--label-imagestack-fontsize);
2716
2738
  block-size: var(--label-imagestack-fontsize);
@@ -3132,11 +3154,9 @@
3132
3154
  grid-template-rows: minmax(0, 1fr);
3133
3155
  column-gap: var(--labeled-content-column-gap);
3134
3156
  }
3135
- :where(toggle-view)::part(toggle-label-stack) {
3136
- color: var(--secondary);
3137
- }
3138
3157
  :where(toggle-view)::part(toggle-input-stack) {
3139
- place-items: stretch;
3158
+ align-items: center;
3159
+ justify-items: end;
3140
3160
  place-content: stretch;
3141
3161
  }
3142
3162
  :where(toggle-view)::part(toggle-form-input):focus {
@@ -3163,9 +3183,25 @@
3163
3183
  backdrop-filter: var(--liquid-glass-backdrop-filter);
3164
3184
  box-shadow: var(--liquid-glass-box-shadow);
3165
3185
  }
3166
- toggle-view[aria-checked=true] {
3186
+ :where(form toggle-view)::part(toggle-label-stack) {
3187
+ color: var(--secondary);
3188
+ }
3189
+ :where(toggle-view[aria-checked=true]) {
3167
3190
  --toggle--trigger-bg: green;
3168
3191
  }
3192
+ :where(toggle-view > :nth-child(n+2 of [slot=label])) {
3193
+ --label-font: callout;
3194
+ }
3195
+ @supports not (x: if(else:red)) {
3196
+ :where(toggle-view > :nth-child(n+2 of [slot=label])) {
3197
+ --label--titlestack-font-size: var(--label-callout-font-size);
3198
+ --label--titlestack-line-height: var(--label-callout-line-height);
3199
+ --label--titlestack-font-weight: var(--label-callout-font-weight);
3200
+ }
3201
+ }
3202
+ :where(toggle-view:not(form toggle-view) > :nth-child(n+2 of [slot=label])) {
3203
+ color: var(--secondary);
3204
+ }
3169
3205
  }
3170
3206
  @layer sw-components {
3171
3207
  :where(labeled-content) {
@@ -3216,10 +3252,20 @@
3216
3252
  :where(navigation-large-title) {
3217
3253
  transition: --navigation-bar-block-size 1ms step-start;
3218
3254
  }
3255
+ :where(navigation-large-title :nth-child(1 of image-view),
3256
+ navigation-large-title :nth-child(1 of label-view)) {
3257
+ --label-image-size: 5;
3258
+ }
3219
3259
  :where(scroll-view[navigation-bar-title-display-mode=inline]:has(navigation-large-title) navigation-large-title[navigation-bar-auto-hide]) {
3220
3260
  opacity: 0;
3221
3261
  visibility: collapse;
3222
3262
  }
3263
+ :where(navigation-large-title[background-style=grouped]) {
3264
+ background-color: var(--secondaryGroupedBackground);
3265
+ border-radius: var(--insetlist-item-border-radius);
3266
+ padding-inline: var(--list-item-padding-inline-start) var(--list-item-padding-inline-end);
3267
+ padding-block: 1rem;
3268
+ }
3223
3269
  }
3224
3270
  @layer sw-components {
3225
3271
  :where(navigation-title) {
@@ -7,6 +7,3 @@ declare global {
7
7
  'toggle:change': CustomEvent<ToggleChangeDetail>;
8
8
  }
9
9
  }
10
- export interface ToggleViewEventMap {
11
- 'toggle:change': CustomEvent<ToggleChangeDetail>;
12
- }
@@ -1 +1,4 @@
1
1
  export {};
2
+ // export interface ToggleViewEventMap {
3
+ // 'toggle:change': CustomEvent<ToggleChangeDetail>
4
+ // }
@@ -94,6 +94,7 @@ function commitChild(part, value) {
94
94
  part.anchor.before(node);
95
95
  nodes.push(...inserted);
96
96
  }
97
+ part.nodes = nodes;
97
98
  part.committed = value;
98
99
  }
99
100
  function commitAttr(part, value) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swiftwc/ui",
3
- "version": "0.0.0-dev.75",
3
+ "version": "0.0.0-dev.76",
4
4
  "description": "Elegant SwiftUI-inspired web components for standalone web apps and web extensions.",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -5,6 +5,7 @@
5
5
  @forward 'components/disclosure-group';
6
6
 
7
7
  @forward 'components/image-view';
8
+ @forward 'components/group-box';
8
9
 
9
10
  @forward 'components/h-divider';
10
11
  @forward 'components/v-divider';
@@ -53,12 +53,14 @@
53
53
  }
54
54
  }
55
55
 
56
- :is(navigation-stack, dialog, body-view):has(> body-view > body-view) {
57
- > scroll-view,
58
- > tool-bar {
59
- :where(&) {
60
- content-visibility: hidden;
61
- }
62
- }
63
- }
56
+ // NOTE: Going all the way back from deeply nested views forces an empty landing page.
57
+ // NOTE: Refactor this to add a content-visibility:visible when bwd/fwd classes are present.
58
+ // :is(navigation-stack, dialog, body-view):has(> body-view > body-view) {
59
+ // > scroll-view,
60
+ // > tool-bar {
61
+ // :where(&) {
62
+ // content-visibility: hidden;
63
+ // }
64
+ // }
65
+ // }
64
66
  }
@@ -0,0 +1,27 @@
1
+ @use '../vars';
2
+ @use '../mixins';
3
+
4
+ @layer #{vars.$components-layer} {
5
+ group-box {
6
+ :where(&) {
7
+ background: var(--groupbox--background);
8
+
9
+ padding-inline: var(--groupbox--padding-inline);
10
+ padding-block: var(--groupbox--padding-block);
11
+
12
+ border-radius: var(--groupbox--border-radius);
13
+
14
+ --groupbox--background: var(--red);
15
+ --groupbox--padding-inline: 1rem;
16
+ --groupbox--padding-block: 1rem;
17
+ --groupbox--border-radius: 1rem;
18
+ }
19
+
20
+ :nth-child(1 of image-view),
21
+ :nth-child(1 of label-view) {
22
+ :where(&) {
23
+ --label-image-size: 5;
24
+ }
25
+ }
26
+ }
27
+ }
@@ -2,8 +2,18 @@
2
2
  @use '../mixins';
3
3
 
4
4
  @layer #{vars.$components-layer} {
5
- // body-view {
6
- // :where(&) {
7
- // }
8
- // }
5
+ image-view {
6
+ :where(&) {
7
+ --image--fontsize: calc(var(--label-image-size) * 1rem);
8
+ }
9
+
10
+ > :not([slot]) {
11
+ :where(&) {
12
+ inline-size: var(--image--fontsize);
13
+ block-size: var(--image--fontsize);
14
+
15
+ font-size: var(--image--fontsize);
16
+ }
17
+ }
18
+ }
9
19
  }
@@ -39,6 +39,7 @@
39
39
  [is='form-view'],
40
40
  v-stack,
41
41
  h-stack,
42
+ group-box,
42
43
  tool-bar,
43
44
  label-view,
44
45
  labeled-content,
@@ -123,12 +123,6 @@ $label-line-ifs: (
123
123
  }
124
124
  }
125
125
 
126
- @mixin set-label-font($value) {
127
- --label--titlestack-font-size: var(--label-#{$value}-font-size);
128
- --label--titlestack-line-height: var(--label-#{$value}-line-height);
129
- --label--titlestack-font-weight: var(--label-#{$value}-font-weight);
130
- }
131
-
132
126
  @function if-chain($labels, $prop: null) {
133
127
  $if-chain: null;
134
128
 
@@ -214,14 +208,16 @@ $label-line-ifs: (
214
208
  }
215
209
 
216
210
  > [slot='icon'] {
217
- aspect-ratio: 1 / 1;
211
+ :where(&) {
212
+ aspect-ratio: 1 / 1;
218
213
 
219
- inline-size: var(--label-imagestack-fontsize);
220
- block-size: var(--label-imagestack-fontsize);
214
+ inline-size: var(--label-imagestack-fontsize);
215
+ block-size: var(--label-imagestack-fontsize);
221
216
 
222
- font-size: var(--label-imagestack-fontsize);
217
+ font-size: var(--label-imagestack-fontsize);
223
218
 
224
- display: var(--label--iconstack-display, none);
219
+ display: var(--label--iconstack-display, none);
220
+ }
225
221
  }
226
222
 
227
223
  // vars
@@ -343,7 +339,7 @@ $label-line-ifs: (
343
339
  //
344
340
  @each $label, $size in vars.$label-fonts {
345
341
  @include if-chain(--label-font, font, $label) {
346
- @include set-label-font($label);
342
+ @include mixins.set-label-font($label);
347
343
  }
348
344
  }
349
345
  }
@@ -16,6 +16,13 @@
16
16
  // font-size 1ms step-start;
17
17
  }
18
18
 
19
+ :nth-child(1 of image-view),
20
+ :nth-child(1 of label-view) {
21
+ :where(&) {
22
+ --label-image-size: 5;
23
+ }
24
+ }
25
+
19
26
  scroll-view[navigation-bar-title-display-mode='inline']:has(&) &[navigation-bar-auto-hide] {
20
27
  :where(&) {
21
28
  opacity: 0;
@@ -23,5 +30,15 @@
23
30
  visibility: collapse;
24
31
  }
25
32
  }
33
+
34
+ &[background-style='grouped'] {
35
+ :where(&) {
36
+ background-color: var(--secondaryGroupedBackground);
37
+ border-radius: var(--insetlist-item-border-radius);
38
+
39
+ padding-inline: var(--list-item-padding-inline-start) var(--list-item-padding-inline-end);
40
+ padding-block: 1rem;
41
+ }
42
+ }
26
43
  }
27
44
  }
@@ -1,4 +1,6 @@
1
1
  @use '../vars';
2
+ @use '../mixins';
3
+ @use 'sass:string';
2
4
 
3
5
  @layer #{vars.$components-layer} {
4
6
  toggle-view {
@@ -17,12 +19,14 @@
17
19
  column-gap: var(--labeled-content-column-gap);
18
20
  }
19
21
 
20
- &::part(toggle-label-stack) {
21
- color: var(--secondary);
22
- }
22
+ // &::part(toggle-label-stack) {
23
+ // color: var(--secondary);
24
+ // }
23
25
 
24
26
  &::part(toggle-input-stack) {
25
- place-items: stretch;
27
+ // place-items: end;
28
+ align-items: center;
29
+ justify-items: end;
26
30
 
27
31
  place-content: stretch;
28
32
  }
@@ -72,8 +76,37 @@
72
76
  }
73
77
  }
74
78
 
79
+ form & {
80
+ :where(&)::part(toggle-label-stack) {
81
+ color: var(--secondary);
82
+ }
83
+ }
84
+
75
85
  &[aria-checked='true'] {
76
- --toggle--trigger-bg: green;
86
+ :where(&) {
87
+ --toggle--trigger-bg: green;
88
+ }
89
+ }
90
+
91
+ > :nth-child(n + 2 of [slot='label']) {
92
+ :where(&) {
93
+ --label-font: callout;
94
+
95
+ @supports not (x: #{string.unquote('if(else:red)')}) {
96
+ @include mixins.set-label-font(callout);
97
+ }
98
+
99
+ // toggle-view:not(form toggle-view) & {
100
+ // color: var(--secondary);
101
+ // }
102
+ }
103
+ }
104
+ &:not(form &) {
105
+ > :nth-child(n + 2 of [slot='label']) {
106
+ :where(&) {
107
+ color: var(--secondary);
108
+ }
109
+ }
77
110
  }
78
111
  }
79
112
  }
@@ -252,6 +252,12 @@
252
252
  }
253
253
  }
254
254
 
255
+ @mixin set-label-font($value) {
256
+ --label--titlestack-font-size: var(--label-#{$value}-font-size);
257
+ --label--titlestack-line-height: var(--label-#{$value}-line-height);
258
+ --label--titlestack-font-weight: var(--label-#{$value}-font-weight);
259
+ }
260
+
255
261
  @mixin if-iphone-landscape {
256
262
  @media (max-width: #{vars.$ipad-landscape-bp-max}) and (orientation: landscape) {
257
263
  @content;
@@ -220,6 +220,9 @@
220
220
  "attributes": [
221
221
  {
222
222
  "name": "system-name"
223
+ },
224
+ {
225
+ "name": "system-weight"
223
226
  }
224
227
  ]
225
228
  },
@@ -318,6 +321,12 @@
318
321
  },
319
322
  {
320
323
  "name": "subtitle"
324
+ },
325
+ {
326
+ "name": "system-image"
327
+ },
328
+ {
329
+ "name": "system-image-weight"
321
330
  }
322
331
  ]
323
332
  },