@swiftwc/ui 0.0.0-dev.18 → 0.0.0-dev.19
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/client/index.js +3 -11
- package/generated/components/content-unavailable-view.d.ts +24 -0
- package/generated/components/content-unavailable-view.js +78 -0
- package/generated/components/date-picker.js +2 -4
- package/generated/components/index.d.ts +1 -3
- package/generated/components/index.js +1 -3
- package/generated/components/navigation-split-view.d.ts +3 -0
- package/generated/components/navigation-split-view.js +3 -0
- package/generated/components/navigation-stack.d.ts +3 -0
- package/generated/components/navigation-stack.js +3 -0
- package/generated/components/tab-bar.d.ts +3 -0
- package/generated/components/tab-bar.js +3 -0
- package/generated/components/text-field.js +1 -1
- package/generated/css/index.css +114 -61
- package/generated/i18n/index.d.ts +20 -10
- package/generated/i18n/index.js +82 -54
- package/generated/i18n/locales/el.d.ts +8 -0
- package/generated/i18n/locales/el.js +8 -0
- package/generated/i18n/locales/en.d.ts +8 -0
- package/generated/i18n/locales/en.js +8 -0
- package/generated/i18n/locales/index.d.ts +4 -0
- package/generated/i18n/locales/index.js +4 -0
- package/package.json +8 -4
- package/scss/_components.scss +2 -0
- package/scss/components/_bordered-button.scss +8 -0
- package/scss/components/_bordered-prominent-button.scss +8 -0
- package/scss/components/_borderless-button.scss +8 -0
- package/scss/components/_content-unavailable-view.scss +45 -0
- package/scss/components/_glass-button.scss +8 -0
- package/scss/components/_glass-prominent-button.scss +8 -0
- package/scss/components/_index.scss +4 -0
- package/scss/components/_label-view.scss +29 -22
- package/scss/components/_plain-button.scss +7 -0
- package/scss/components/_v-stack.scss +17 -0
- package/scss/placeholders/_lists.scss +10 -38
- package/scss/utils/_stacks.scss +4 -0
- package/web-components.html-data/en.json +19 -3
package/generated/i18n/index.js
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
import { el, en } from './locales';
|
|
2
|
+
export function defineTranslations(factory) {
|
|
3
|
+
return factory;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* @fires localechange - On html[lang] change!
|
|
7
|
+
*/
|
|
1
8
|
export class I18n {
|
|
2
9
|
static #readyCalled = false;
|
|
3
10
|
static #tag = 'en';
|
|
@@ -7,8 +14,30 @@ export class I18n {
|
|
|
7
14
|
static #decimalSeparator = '.';
|
|
8
15
|
static #dateSeparator = '/';
|
|
9
16
|
static #dateOrder = ['month', 'day', 'year'];
|
|
17
|
+
static #lang = 'en';
|
|
18
|
+
/** Registry: language code → factory. Pre-seeded with 'en'. */
|
|
19
|
+
static #factories = new Map([
|
|
20
|
+
['en', en],
|
|
21
|
+
['el', el],
|
|
22
|
+
]);
|
|
23
|
+
/** Cache: language code → resolved translation object. */
|
|
24
|
+
static #strings = new Map();
|
|
10
25
|
static on = new EventTarget();
|
|
11
26
|
// ----------------------------
|
|
27
|
+
// Public registration API
|
|
28
|
+
// ----------------------------
|
|
29
|
+
/**
|
|
30
|
+
* Register a translation factory for a language.
|
|
31
|
+
* Call this before the language is first needed.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* I18n.register('el', () => ({ SearchUnavailableContent: { … } }))
|
|
35
|
+
*/
|
|
36
|
+
static register(lang, factory) {
|
|
37
|
+
this.#factories.set(lang, factory);
|
|
38
|
+
this.#strings.delete(lang); // bust cache so next t() re-resolves
|
|
39
|
+
}
|
|
40
|
+
// ----------------------------
|
|
12
41
|
// Lazy init
|
|
13
42
|
// ----------------------------
|
|
14
43
|
static #ensureReady() {
|
|
@@ -16,72 +45,42 @@ export class I18n {
|
|
|
16
45
|
this.setOwnConfig();
|
|
17
46
|
}
|
|
18
47
|
// ----------------------------
|
|
19
|
-
// Proxy with typed target
|
|
20
|
-
// ----------------------------
|
|
21
|
-
static _props = new Proxy({}, {
|
|
22
|
-
get: (_, prop) => {
|
|
23
|
-
this.#ensureReady();
|
|
24
|
-
switch (prop) {
|
|
25
|
-
case 'tag':
|
|
26
|
-
return this.#tag;
|
|
27
|
-
case 'options':
|
|
28
|
-
return this.#options;
|
|
29
|
-
case 'locale':
|
|
30
|
-
return this.#locale;
|
|
31
|
-
case 'decimalSeparator':
|
|
32
|
-
return this.#decimalSeparator;
|
|
33
|
-
case 'dateSeparator':
|
|
34
|
-
return this.#dateSeparator;
|
|
35
|
-
case 'dateOrder':
|
|
36
|
-
return this.#dateOrder;
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
set: (_, prop, value) => {
|
|
40
|
-
switch (prop) {
|
|
41
|
-
case 'tag':
|
|
42
|
-
this.#observer?.disconnect();
|
|
43
|
-
this.#observer = undefined;
|
|
44
|
-
this.#tag = value;
|
|
45
|
-
this.#getOwnConfig();
|
|
46
|
-
break;
|
|
47
|
-
case 'options':
|
|
48
|
-
this.#options = value;
|
|
49
|
-
this.#getOwnConfig();
|
|
50
|
-
break;
|
|
51
|
-
}
|
|
52
|
-
return true;
|
|
53
|
-
},
|
|
54
|
-
});
|
|
55
|
-
// ----------------------------
|
|
56
48
|
// Accessors
|
|
57
49
|
// ----------------------------
|
|
58
50
|
static get tag() {
|
|
59
|
-
|
|
51
|
+
this.#ensureReady();
|
|
52
|
+
return this.#tag;
|
|
60
53
|
}
|
|
61
54
|
static set tag(val) {
|
|
62
|
-
this
|
|
55
|
+
this.#observer?.disconnect();
|
|
56
|
+
this.#observer = undefined;
|
|
57
|
+
this.#tag = val;
|
|
58
|
+
this.#getOwnConfig();
|
|
63
59
|
}
|
|
64
60
|
static get options() {
|
|
65
|
-
|
|
61
|
+
this.#ensureReady();
|
|
62
|
+
return this.#options;
|
|
66
63
|
}
|
|
67
64
|
static set options(val) {
|
|
68
|
-
this
|
|
65
|
+
this.#options = val;
|
|
66
|
+
this.#getOwnConfig();
|
|
69
67
|
}
|
|
70
68
|
static get locale() {
|
|
71
|
-
|
|
69
|
+
this.#ensureReady();
|
|
70
|
+
return this.#locale;
|
|
72
71
|
}
|
|
73
72
|
static get decimalSeparator() {
|
|
74
|
-
|
|
73
|
+
this.#ensureReady();
|
|
74
|
+
return this.#decimalSeparator;
|
|
75
75
|
}
|
|
76
76
|
static get dateSeparator() {
|
|
77
|
-
|
|
77
|
+
this.#ensureReady();
|
|
78
|
+
return this.#dateSeparator;
|
|
78
79
|
}
|
|
79
80
|
static get dateOrder() {
|
|
80
|
-
|
|
81
|
+
this.#ensureReady();
|
|
82
|
+
return this.#dateOrder;
|
|
81
83
|
}
|
|
82
|
-
// ----------------------------
|
|
83
|
-
// Core logic
|
|
84
|
-
// ----------------------------
|
|
85
84
|
static setOwnConfig(options) {
|
|
86
85
|
if (!this.#readyCalled)
|
|
87
86
|
this.#readyCalled = true;
|
|
@@ -100,7 +99,7 @@ export class I18n {
|
|
|
100
99
|
return;
|
|
101
100
|
this.#tag = document.documentElement.lang;
|
|
102
101
|
this.#getOwnConfig();
|
|
103
|
-
this.on.dispatchEvent(new CustomEvent('
|
|
102
|
+
this.on.dispatchEvent(new CustomEvent('localechange', { detail: { lang: this.#tag } }));
|
|
104
103
|
}
|
|
105
104
|
static #getOwnConfig() {
|
|
106
105
|
try {
|
|
@@ -109,7 +108,6 @@ export class I18n {
|
|
|
109
108
|
catch {
|
|
110
109
|
this.#locale = new Intl.Locale('en');
|
|
111
110
|
}
|
|
112
|
-
console.debug(this.#locale);
|
|
113
111
|
try {
|
|
114
112
|
const nf = new Intl.NumberFormat(this.#locale);
|
|
115
113
|
const parts = nf.formatToParts(1.1);
|
|
@@ -118,11 +116,10 @@ export class I18n {
|
|
|
118
116
|
catch {
|
|
119
117
|
this.#decimalSeparator = '.';
|
|
120
118
|
}
|
|
121
|
-
console.debug(this.#decimalSeparator);
|
|
122
119
|
try {
|
|
123
120
|
const df = new Intl.DateTimeFormat(this.#locale);
|
|
124
121
|
const parts = df.formatToParts(new Date(2000, 11, 31));
|
|
125
|
-
this.#dateOrder = parts.filter(({ type }) => type !== 'literal')
|
|
122
|
+
this.#dateOrder = parts.filter(({ type }) => type !== 'literal').map(({ type }) => type) ?? ['month', 'day', 'year'];
|
|
126
123
|
this.#dateSeparator =
|
|
127
124
|
parts
|
|
128
125
|
.filter(({ type }) => type === 'literal')
|
|
@@ -133,7 +130,38 @@ export class I18n {
|
|
|
133
130
|
this.#dateOrder = ['month', 'day', 'year'];
|
|
134
131
|
this.#dateSeparator = '/';
|
|
135
132
|
}
|
|
136
|
-
|
|
137
|
-
|
|
133
|
+
try {
|
|
134
|
+
this.#lang = this.#resolveLanguage(this.#tag);
|
|
135
|
+
}
|
|
136
|
+
catch {
|
|
137
|
+
this.#lang = 'en';
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Resolve the best available language for a given BCP 47 tag.
|
|
142
|
+
* Tries the full tag, then just the base language, then falls back to 'en'.
|
|
143
|
+
*/
|
|
144
|
+
static #resolveLanguage(tag) {
|
|
145
|
+
const lang = tag instanceof Intl.Locale ? tag.language : new Intl.Locale(tag || 'en').language;
|
|
146
|
+
if (this.#factories.has(String(tag)))
|
|
147
|
+
return String(tag);
|
|
148
|
+
if (this.#factories.has(lang))
|
|
149
|
+
return lang;
|
|
150
|
+
return 'en';
|
|
151
|
+
}
|
|
152
|
+
/** Look up a top-level translation key for the current language, falling back to 'en'. */
|
|
153
|
+
static t(key) {
|
|
154
|
+
this.#ensureReady();
|
|
155
|
+
if (!this.#strings.has(this.#lang)) {
|
|
156
|
+
const factory = this.#factories.get(this.#lang) ?? en;
|
|
157
|
+
this.#strings.set(this.#lang, factory());
|
|
158
|
+
}
|
|
159
|
+
const current = this.#strings.get(this.#lang);
|
|
160
|
+
if (key in current)
|
|
161
|
+
return current[key];
|
|
162
|
+
// Key missing from current language — fall back to en
|
|
163
|
+
if (!this.#strings.has('en'))
|
|
164
|
+
this.#strings.set('en', en());
|
|
165
|
+
return this.#strings.get('en')[key];
|
|
138
166
|
}
|
|
139
167
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
declare const _default: () => {
|
|
2
|
+
readonly SearchUnavailableContent: {
|
|
3
|
+
readonly NoLabel: "Κανένα αποτέλεσμα";
|
|
4
|
+
readonly Label: "Κανένα αποτέλεσμα για «{search}»";
|
|
5
|
+
readonly Description: "Ελέγξτε την ορθογραφία ή δοκιμάστε μια νέα αναζήτηση.";
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { defineTranslations } from '../index';
|
|
2
|
+
export default defineTranslations(() => ({
|
|
3
|
+
SearchUnavailableContent: {
|
|
4
|
+
NoLabel: 'Κανένα αποτέλεσμα',
|
|
5
|
+
Label: 'Κανένα αποτέλεσμα για «{search}»',
|
|
6
|
+
Description: 'Ελέγξτε την ορθογραφία ή δοκιμάστε μια νέα αναζήτηση.',
|
|
7
|
+
},
|
|
8
|
+
}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swiftwc/ui",
|
|
3
|
-
"version": "0.0.0-dev.
|
|
3
|
+
"version": "0.0.0-dev.19",
|
|
4
4
|
"description": "Elegant SwiftUI-inspired web components for standalone web apps and web extensions.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -57,12 +57,13 @@
|
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
59
59
|
"prebuild": "rm -rf generated",
|
|
60
|
-
"build": "npm run build:ts && npm run build:scss && npm run build:manifest && npm run build:barrels",
|
|
60
|
+
"build": "npm run build:ts && npm run build:scss && npm run build:manifest && npm run build:barrels && npm run build:barrels:i18n",
|
|
61
61
|
"build:ts:watch": "npm run prebuild && tsc --watch",
|
|
62
62
|
"build:ts": "tsc",
|
|
63
63
|
"build:scss": "sass --style=expanded --no-source-map scss/index.scss generated/css/index.css",
|
|
64
64
|
"build:manifest": "tsx scripts/make-manifest.ts",
|
|
65
|
-
"build:barrels": "barrelsby
|
|
65
|
+
"build:barrels": "barrelsby --noHeader --delete --singleQuotes --noSemicolon --directory ./js/components --exclude \".\\.test\\.ts\"",
|
|
66
|
+
"build:barrels:i18n": "barrelsby --noHeader --delete --singleQuotes --noSemicolon --exportDefault --fullPathname --directory ./js/i18n/locales",
|
|
66
67
|
"format:check": "prettier . --check",
|
|
67
68
|
"format:write": "prettier . --write",
|
|
68
69
|
"test": "vitest --dom",
|
|
@@ -76,5 +77,8 @@
|
|
|
76
77
|
"tsx": "^4.21.0",
|
|
77
78
|
"vitest": "^4.0.18"
|
|
78
79
|
},
|
|
79
|
-
"customElements": "custom-elements/en.json"
|
|
80
|
+
"customElements": "custom-elements/en.json",
|
|
81
|
+
"imports": {
|
|
82
|
+
"#internal/*": "./js/internal/*"
|
|
83
|
+
}
|
|
80
84
|
}
|
package/scss/_components.scss
CHANGED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
@use '../vars';
|
|
2
|
+
@use '../placeholders';
|
|
3
|
+
|
|
4
|
+
@layer #{vars.$components-layer} {
|
|
5
|
+
content-unavailable-view {
|
|
6
|
+
:where(&) {
|
|
7
|
+
place-content: center;
|
|
8
|
+
place-items: center;
|
|
9
|
+
|
|
10
|
+
text-align: center;
|
|
11
|
+
|
|
12
|
+
row-gap: 1rem;
|
|
13
|
+
|
|
14
|
+
&::part(content-unavailable-actions-stack) {
|
|
15
|
+
row-gap: 0.2rem;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&::part(content-unavailable-title-stack) {
|
|
19
|
+
--label-flow: vertical;
|
|
20
|
+
|
|
21
|
+
--label-font: title3; // NOTE: Safari fix
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
> :not([slot]) {
|
|
26
|
+
--label-image-size: 5rem;
|
|
27
|
+
|
|
28
|
+
--label-gap: 1rem;
|
|
29
|
+
|
|
30
|
+
// --label-font: title3;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&:not(:has(> [slot='description'])) {
|
|
34
|
+
:where(&)::part(content-unavailable-description-stack) {
|
|
35
|
+
display: none;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&:not(:has(> [slot='actions'])) {
|
|
40
|
+
:where(&)::part(content-unavailable-actions-stack) {
|
|
41
|
+
display: none;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
[is='glass-prominent-button'],
|
|
28
28
|
list-view,
|
|
29
29
|
table-view,
|
|
30
|
+
content-unavailable-view,
|
|
30
31
|
tool-bar-item,
|
|
31
32
|
tool-bar-item-group,
|
|
32
33
|
sidebar-toggle,
|
|
@@ -45,6 +46,9 @@
|
|
|
45
46
|
}
|
|
46
47
|
}
|
|
47
48
|
|
|
49
|
+
:where(content-unavailable-view)::part(content-unavailable-title-stack),
|
|
50
|
+
:where(content-unavailable-view)::part(content-unavailable-description-stack),
|
|
51
|
+
:where(content-unavailable-view)::part(content-unavailable-actions-stack),
|
|
48
52
|
:where(table-view)::part(table-container),
|
|
49
53
|
:where(table-view)::part(table-column-stack),
|
|
50
54
|
:where(table-view)::part(table-header-stack),
|
|
@@ -3,6 +3,19 @@
|
|
|
3
3
|
@use 'sass:string';
|
|
4
4
|
@use 'sass:map';
|
|
5
5
|
|
|
6
|
+
// scalpel precision
|
|
7
|
+
@property --label-gap {
|
|
8
|
+
syntax: '<length>';
|
|
9
|
+
inherits: false;
|
|
10
|
+
initial-value: 0;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@property --label-image-size {
|
|
14
|
+
syntax: '<length>';
|
|
15
|
+
inherits: false;
|
|
16
|
+
initial-value: 0;
|
|
17
|
+
}
|
|
18
|
+
|
|
6
19
|
// @property --label-style {
|
|
7
20
|
// syntax: 'title-and-icon | icon-only | title-only | automatic';
|
|
8
21
|
// inherits: true;
|
|
@@ -55,7 +68,8 @@ $label-line-ifs: (
|
|
|
55
68
|
--label--host-align-items: center;
|
|
56
69
|
--label--host-justify-items: normal;
|
|
57
70
|
|
|
58
|
-
--label
|
|
71
|
+
--label-gap: 0.3rem;
|
|
72
|
+
--label--host-gap: var(--label-gap);
|
|
59
73
|
|
|
60
74
|
--label--iconstack-display: grid;
|
|
61
75
|
--label--titlestack-display: grid;
|
|
@@ -75,7 +89,8 @@ $label-line-ifs: (
|
|
|
75
89
|
--label--host-align-items: normal;
|
|
76
90
|
--label--host-justify-items: center;
|
|
77
91
|
|
|
78
|
-
--label
|
|
92
|
+
--label-gap: 0.3rem;
|
|
93
|
+
--label--host-gap: var(--label-gap);
|
|
79
94
|
|
|
80
95
|
--label--iconstack-display: grid;
|
|
81
96
|
--label--titlestack-display: grid;
|
|
@@ -158,7 +173,10 @@ $label-line-ifs: (
|
|
|
158
173
|
grid-template-rows: var(--label--host-grid-template-rows,);
|
|
159
174
|
// grid-template-areas: 'label-image-stack label-title-stack';
|
|
160
175
|
|
|
161
|
-
gap: var(--label--host-gap,);
|
|
176
|
+
gap: var(--label--host-gap,); //;
|
|
177
|
+
|
|
178
|
+
--label-image-size: 2rem;
|
|
179
|
+
--label-imagestack-fontsize: var(--label-image-size);
|
|
162
180
|
// gap: 0;
|
|
163
181
|
|
|
164
182
|
white-space: var(--label--host-white-space,);
|
|
@@ -184,8 +202,8 @@ $label-line-ifs: (
|
|
|
184
202
|
&::part(label-image-stack) {
|
|
185
203
|
aspect-ratio: 1 / 1;
|
|
186
204
|
|
|
187
|
-
inline-size: var(--label-
|
|
188
|
-
font-size: var(--label-
|
|
205
|
+
inline-size: var(--label-imagestack-fontsize);
|
|
206
|
+
font-size: var(--label-imagestack-fontsize);
|
|
189
207
|
|
|
190
208
|
// line-height: 1;
|
|
191
209
|
|
|
@@ -255,34 +273,23 @@ $label-line-ifs: (
|
|
|
255
273
|
--label--host-grid-template-columns: if(
|
|
256
274
|
style(--label-style: icon-only): minmax(0, 1fr) ; style(--label-style: title-only): minmax(0, 1fr) ;
|
|
257
275
|
style(--label-style: title-and-icon): if(style(--label-flow: vertical): minmax(0, 1fr) ; else: auto minmax(0, 1fr) ;) ;
|
|
258
|
-
else: if(
|
|
259
|
-
style(--label--has-icon: yes) and style(--label--has-title: yes): if(style(--label-flow: vertical): minmax(0, 1fr) ; else: auto minmax(0, 1fr) ;)
|
|
260
|
-
; else: minmax(0, 1fr) ;
|
|
261
|
-
)
|
|
262
|
-
;
|
|
276
|
+
else: if(style(--label--has-icon: yes) and style(--label--has-title: yes): if(style(--label-flow: vertical): minmax(0, 1fr) ; else: auto minmax(0, 1fr) ;) ; else: minmax(0, 1fr) ;) ;
|
|
263
277
|
);
|
|
264
278
|
--label--host-grid-template-rows: if(
|
|
265
279
|
style(--label-style: icon-only): minmax(0, 1fr) ; style(--label-style: title-only): minmax(0, 1fr) ;
|
|
266
280
|
style(--label-style: title-and-icon): if(style(--label-flow: vertical): auto minmax(0, 1fr) ; else: minmax(0, 1fr) ;) ;
|
|
267
|
-
else: if(
|
|
268
|
-
style(--label--has-icon: yes) and style(--label--has-title: yes): if(style(--label-flow: vertical): auto minmax(0, 1fr) ; else: minmax(0, 1fr) ;)
|
|
269
|
-
; else: minmax(0, 1fr) ;
|
|
270
|
-
)
|
|
271
|
-
;
|
|
281
|
+
else: if(style(--label--has-icon: yes) and style(--label--has-title: yes): if(style(--label-flow: vertical): auto minmax(0, 1fr) ; else: minmax(0, 1fr) ;) ; else: minmax(0, 1fr) ;) ;
|
|
272
282
|
);
|
|
273
283
|
|
|
274
|
-
--label
|
|
275
|
-
|
|
276
|
-
);
|
|
284
|
+
--label-gap: if(style(--label-style: title-and-icon): 0.3rem ; else: if(style(--label--has-icon: yes) and style(--label--has-title: yes): 0.3rem ;) ;);
|
|
285
|
+
--label--host-gap: if(style(--label-style: title-and-icon): var(--label-gap) ; else: if(style(--label--has-icon: yes) and style(--label--has-title: yes): var(--label-gap) ;) ;);
|
|
277
286
|
|
|
278
287
|
--label--iconstack-display: if(
|
|
279
|
-
style(--label-style: icon-only): grid ; style(--label-style: title-only): none ; style(--label-style: title-and-icon): grid ;
|
|
280
|
-
else: if(style(--label--has-icon: yes): grid ; else: none;) ;
|
|
288
|
+
style(--label-style: icon-only): grid ; style(--label-style: title-only): none ; style(--label-style: title-and-icon): grid ; else: if(style(--label--has-icon: yes): grid ; else: none;) ;
|
|
281
289
|
);
|
|
282
290
|
|
|
283
291
|
--label--titlestack-display: if(
|
|
284
|
-
style(--label-style: icon-only): none ; style(--label-style: title-only): grid ; style(--label-style: title-and-icon): grid ;
|
|
285
|
-
else: if(style(--label--has-title: yes): grid ; else: none;) ;
|
|
292
|
+
style(--label-style: icon-only): none ; style(--label-style: title-only): grid ; style(--label-style: title-and-icon): grid ; else: if(style(--label--has-title: yes): grid ; else: none;) ;
|
|
286
293
|
);
|
|
287
294
|
}
|
|
288
295
|
}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
@use '../vars';
|
|
2
|
+
@use 'sass:string';
|
|
3
|
+
@use 'sass:list';
|
|
4
|
+
|
|
5
|
+
$v-stack-templates: ((auto auto minmax(0, 1fr)), (auto minmax(0, 1fr)), (auto auto autominmax(0, 1fr)));
|
|
2
6
|
|
|
3
7
|
@layer #{vars.$components-layer} {
|
|
4
8
|
v-stack {
|
|
@@ -14,5 +18,18 @@
|
|
|
14
18
|
// :where(& > *) {
|
|
15
19
|
// max-width: 100%;
|
|
16
20
|
// }
|
|
21
|
+
|
|
22
|
+
@each $template in $v-stack-templates {
|
|
23
|
+
$parts: string.split('#{$template}', ', ');
|
|
24
|
+
$result: '';
|
|
25
|
+
@each $part in $parts {
|
|
26
|
+
$result: $result + '#{$part},';
|
|
27
|
+
}
|
|
28
|
+
$result: string.slice($result, 1, string.length($result) - 1);
|
|
29
|
+
@debug $result, $template;
|
|
30
|
+
:where(&[template='#{$result}']) {
|
|
31
|
+
grid-template-rows: $template;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
17
34
|
}
|
|
18
35
|
}
|
|
@@ -144,10 +144,7 @@
|
|
|
144
144
|
> :not(summary) {
|
|
145
145
|
:where(&) {
|
|
146
146
|
--itemface: var(--list--details-background-color, var(--list--item-background-color,));
|
|
147
|
-
--itemhighlightface: var(
|
|
148
|
-
--list--selecteddetails-background-color,
|
|
149
|
-
var(--list--highlighteditem-background-color, var(--list--item-background-color,))
|
|
150
|
-
);
|
|
147
|
+
--itemhighlightface: var(--list--selecteddetails-background-color, var(--list--highlighteditem-background-color, var(--list--item-background-color,)));
|
|
151
148
|
--itemactiveface: var(--list--selecteddetails-background-color, var(--list--highlighteditem-background-color, var(--list--item-background-color,)));
|
|
152
149
|
|
|
153
150
|
--itemtext: var(--list--details-color, var(--list--item-color,));
|
|
@@ -158,14 +155,8 @@
|
|
|
158
155
|
> summary {
|
|
159
156
|
:where([is='disclosure-group'][open] &) {
|
|
160
157
|
--itemface: var(--list--opendetails-background-color, var(--list--item-background-color,));
|
|
161
|
-
--itemhighlightface: var(
|
|
162
|
-
|
|
163
|
-
var(--list--highlighteditem-background-color, var(--list--item-background-color,))
|
|
164
|
-
);
|
|
165
|
-
--itemactiveface: var(
|
|
166
|
-
--list--selectedopendetails-background-color,
|
|
167
|
-
var(--list--highlighteditem-background-color, var(--list--item-background-color,))
|
|
168
|
-
);
|
|
158
|
+
--itemhighlightface: var(--list--selectedopendetails-background-color, var(--list--highlighteditem-background-color, var(--list--item-background-color,)));
|
|
159
|
+
--itemactiveface: var(--list--selectedopendetails-background-color, var(--list--highlighteditem-background-color, var(--list--item-background-color,)));
|
|
169
160
|
|
|
170
161
|
--itemtext: var(--list--opendetails-color, var(--list--item-color,));
|
|
171
162
|
--itemhighlighttext: var(--list--selectedopendetails-color, var(--list--highlighteditem-color, var(--list--item-color,)));
|
|
@@ -186,14 +177,8 @@
|
|
|
186
177
|
);
|
|
187
178
|
|
|
188
179
|
--itemtext: var(--list--opensummary-color, var(--list--item-color,));
|
|
189
|
-
--itemhighlighttext: var(
|
|
190
|
-
|
|
191
|
-
var(--list--selectedsummary-color, var(--list--highlighteditem-color, var(--list--item-color,)))
|
|
192
|
-
);
|
|
193
|
-
--itemactivetext: var(
|
|
194
|
-
--list--selectedopensummary-color,
|
|
195
|
-
var(--list--selectedsummary-color, var(--list--highlighteditem-color, var(--list--item-color,)))
|
|
196
|
-
);
|
|
180
|
+
--itemhighlighttext: var(--list--selectedopensummary-color, var(--list--selectedsummary-color, var(--list--highlighteditem-color, var(--list--item-color,))));
|
|
181
|
+
--itemactivetext: var(--list--selectedopensummary-color, var(--list--selectedsummary-color, var(--list--highlighteditem-color, var(--list--item-color,))));
|
|
197
182
|
}
|
|
198
183
|
}
|
|
199
184
|
}
|
|
@@ -215,14 +200,8 @@
|
|
|
215
200
|
);
|
|
216
201
|
|
|
217
202
|
--itemtext: var(--list--rootsummary-color, var(--list--item-color,));
|
|
218
|
-
--itemhighlighttext: var(
|
|
219
|
-
|
|
220
|
-
var(--list--selectedsummary-color, var(--list--highlighteditem-color, var(--list--item-color,)))
|
|
221
|
-
);
|
|
222
|
-
--itemactivetext: var(
|
|
223
|
-
--list--selectedrootsummary-color,
|
|
224
|
-
var(--list--selectedsummary-color, var(--list--highlighteditem-color, var(--list--item-color,)))
|
|
225
|
-
);
|
|
203
|
+
--itemhighlighttext: var(--list--selectedrootsummary-color, var(--list--selectedsummary-color, var(--list--highlighteditem-color, var(--list--item-color,))));
|
|
204
|
+
--itemactivetext: var(--list--selectedrootsummary-color, var(--list--selectedsummary-color, var(--list--highlighteditem-color, var(--list--item-color,))));
|
|
226
205
|
|
|
227
206
|
// overwrite extra stuff for rootsummary
|
|
228
207
|
// outline: red solid 4px;
|
|
@@ -244,17 +223,11 @@
|
|
|
244
223
|
--itemface: var(--list--rootsummary-background-color, var(--list--opensummary-background-color, var(--list--item-background-color,)));
|
|
245
224
|
--itemhighlightface: var(
|
|
246
225
|
--list--selectedrootsummary-background-color,
|
|
247
|
-
var(
|
|
248
|
-
--list--selectedopensummary-background-color,
|
|
249
|
-
var(--list--selectedsummary-background-color, var(--list--highlighteditem-background-color, var(--list--item-background-color,)))
|
|
250
|
-
)
|
|
226
|
+
var(--list--selectedopensummary-background-color, var(--list--selectedsummary-background-color, var(--list--highlighteditem-background-color, var(--list--item-background-color,))))
|
|
251
227
|
);
|
|
252
228
|
--itemactiveface: var(
|
|
253
229
|
--list--selectedrootsummary-background-color,
|
|
254
|
-
var(
|
|
255
|
-
--list--selectedopensummary-background-color,
|
|
256
|
-
var(--list--selectedsummary-background-color, var(--list--highlighteditem-background-color, var(--list--item-background-color,)))
|
|
257
|
-
)
|
|
230
|
+
var(--list--selectedopensummary-background-color, var(--list--selectedsummary-background-color, var(--list--highlighteditem-background-color, var(--list--item-background-color,))))
|
|
258
231
|
);
|
|
259
232
|
|
|
260
233
|
--itemtext: var(--list--rootsummary-color, var(--list--opensummary-color, var(--list--item-color,)));
|
|
@@ -378,8 +351,7 @@
|
|
|
378
351
|
:where(&)::part(section-footer-stack),
|
|
379
352
|
:where(&)::part(section-header-stack) {
|
|
380
353
|
// outline: magenta 4px solid;
|
|
381
|
-
padding-inline: calc(var(--list--root-padding-inline, 0px) + var(--itempadistart, 0px))
|
|
382
|
-
calc(var(--list--root-padding-inline, 0px) + var(--itempadiend, 0px));
|
|
354
|
+
padding-inline: calc(var(--list--root-padding-inline, 0px) + var(--itempadistart, 0px)) calc(var(--list--root-padding-inline, 0px) + var(--itempadiend, 0px));
|
|
383
355
|
|
|
384
356
|
margin-inline: calc(var(--list--root-padding-inline) * -1);
|
|
385
357
|
|
package/scss/utils/_stacks.scss
CHANGED