@swiftwc/ui 0.0.0-dev.75 → 0.0.0-dev.77
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/generated/components/image-view.js +34 -16
- package/generated/components/labeled-content.js +15 -14
- package/generated/components/navigation-title.js +27 -8
- package/generated/components/scroll-view.js +13 -5
- package/generated/components/section-view.js +16 -15
- package/generated/css/index.css +57 -11
- package/generated/events/toggle-view.d.ts +0 -3
- package/generated/events/toggle-view.js +3 -0
- package/generated/tpl/render.js +1 -0
- package/package.json +1 -1
- package/scss/_components.scss +1 -0
- package/scss/base/_layout.scss +10 -8
- package/scss/components/_group-box.scss +27 -0
- package/scss/components/_image-view.scss +14 -4
- package/scss/components/_index.scss +1 -0
- package/scss/components/_label-view.scss +8 -12
- package/scss/components/_navigation-large-title.scss +17 -0
- package/scss/components/_toggle-view.scss +38 -5
- package/scss/mixins/_index.scss +6 -0
- package/web-components.html-data/en.json +9 -0
|
@@ -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-
|
|
21
|
-
|
|
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($(`<i style="line-height: 1"></i>`, '>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
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
-
|
|
43
|
-
|
|
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
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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
|
-
|
|
53
|
-
|
|
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 {
|
|
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
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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,
|
|
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>`,
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
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($(`<v-stack spacing="0" alignment="fill" slot="top-bar-principal"></v-stack>`, '>1'));
|
|
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
|
|
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
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
-
|
|
47
|
-
|
|
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
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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
|
-
|
|
57
|
-
|
|
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
|
// })
|
package/generated/css/index.css
CHANGED
|
@@ -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
|
-
|
|
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
|
|
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) {
|
package/generated/tpl/render.js
CHANGED
package/package.json
CHANGED
package/scss/_components.scss
CHANGED
package/scss/base/_layout.scss
CHANGED
|
@@ -53,12 +53,14 @@
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
:
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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
|
-
|
|
6
|
-
|
|
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
|
}
|
|
@@ -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
|
-
|
|
211
|
+
:where(&) {
|
|
212
|
+
aspect-ratio: 1 / 1;
|
|
218
213
|
|
|
219
|
-
|
|
220
|
-
|
|
214
|
+
inline-size: var(--label-imagestack-fontsize);
|
|
215
|
+
block-size: var(--label-imagestack-fontsize);
|
|
221
216
|
|
|
222
|
-
|
|
217
|
+
font-size: var(--label-imagestack-fontsize);
|
|
223
218
|
|
|
224
|
-
|
|
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
|
-
|
|
22
|
-
}
|
|
22
|
+
// &::part(toggle-label-stack) {
|
|
23
|
+
// color: var(--secondary);
|
|
24
|
+
// }
|
|
23
25
|
|
|
24
26
|
&::part(toggle-input-stack) {
|
|
25
|
-
place-items:
|
|
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
|
-
|
|
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
|
}
|
package/scss/mixins/_index.scss
CHANGED
|
@@ -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
|
},
|