@alacris/ui 0.4.2 → 0.4.4
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/README.md +3 -3
- package/package.json +1 -1
- package/src/components/ui-accordion-item.js +1 -1
- package/src/components/ui-alert.js +1 -0
- package/src/components/ui-autocomplete.js +2 -1
- package/src/components/ui-chip.js +1 -0
- package/src/components/ui-drawer.js +1 -1
- package/src/components/ui-select.js +2 -1
- package/src/components/ui-sheet.js +1 -1
- package/src/components/ui-side-sheet.js +1 -1
- package/src/components/ui-text-field.js +5 -5
package/README.md
CHANGED
|
@@ -47,9 +47,9 @@ The published package is plain ESM. Point an import map at a pinned CDN build of
|
|
|
47
47
|
{
|
|
48
48
|
"imports": {
|
|
49
49
|
"@alacris/core": "https://cdn.jsdelivr.net/npm/@alacris/core@0.11.4/dist/alacris.js",
|
|
50
|
-
"@alacris/ui": "https://cdn.jsdelivr.net/npm/@alacris/ui@0.4.
|
|
51
|
-
"@alacris/ui/theme": "https://cdn.jsdelivr.net/npm/@alacris/ui@0.4.
|
|
52
|
-
"@alacris/ui/components/": "https://cdn.jsdelivr.net/npm/@alacris/ui@0.4.
|
|
50
|
+
"@alacris/ui": "https://cdn.jsdelivr.net/npm/@alacris/ui@0.4.4/src/index.js",
|
|
51
|
+
"@alacris/ui/theme": "https://cdn.jsdelivr.net/npm/@alacris/ui@0.4.4/src/theme/index.js",
|
|
52
|
+
"@alacris/ui/components/": "https://cdn.jsdelivr.net/npm/@alacris/ui@0.4.4/src/components/"
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
</script>
|
package/package.json
CHANGED
|
@@ -146,7 +146,7 @@ define('ui-accordion-item', {
|
|
|
146
146
|
<ui-icon class=${() => `chevron${expanded() ? ' open' : ''}`} name="expand-more"></ui-icon>
|
|
147
147
|
</button>
|
|
148
148
|
</h3>
|
|
149
|
-
<div part="content" class="content" id="content" role="region" aria-labelledby="header"
|
|
149
|
+
<div part="content" class="content" id="content" role="region" aria-labelledby="header" ?inert=${() => !expanded()}
|
|
150
150
|
ref=${(el) => { contentEl = el; el.hidden = !expanded.peek(); }}>
|
|
151
151
|
<div class="body" part="body"><slot></slot></div>
|
|
152
152
|
</div>`;
|
|
@@ -132,6 +132,7 @@ define('ui-alert', {
|
|
|
132
132
|
const onDismiss = () => {
|
|
133
133
|
if (dismissing) return;
|
|
134
134
|
dismissing = true;
|
|
135
|
+
host.inert = true;
|
|
135
136
|
const height = host.scrollHeight || 0;
|
|
136
137
|
// Simulated DOMs (and display:none hosts) measure 0 — skip straight out.
|
|
137
138
|
if (!height) { host.emit('dismiss'); return; }
|
|
@@ -155,7 +155,8 @@ const styles = css`
|
|
|
155
155
|
}
|
|
156
156
|
.filled.floating .label { translate: 0 calc(-50% - 16px); scale: 0.75; }
|
|
157
157
|
.outlined.floating .label {
|
|
158
|
-
|
|
158
|
+
inset-block-start: 0;
|
|
159
|
+
translate: 0 -50%;
|
|
159
160
|
scale: 0.75;
|
|
160
161
|
}
|
|
161
162
|
.focused .label { color: ${t.accent}; }
|
|
@@ -153,7 +153,7 @@ define('ui-drawer', {
|
|
|
153
153
|
return html`
|
|
154
154
|
${() =>
|
|
155
155
|
variant() === 'standard'
|
|
156
|
-
? html`<aside class=${() => `std ${anchor()}${open() ? ' open' : ''}`} part="surface"
|
|
156
|
+
? html`<aside class=${() => `std ${anchor()}${open() ? ' open' : ''}`} ?inert=${() => !open()} part="surface"
|
|
157
157
|
aria-label=${() => label() || 'Navigation'}>
|
|
158
158
|
<div class="inner"><slot></slot></div>
|
|
159
159
|
</aside>`
|
|
@@ -189,7 +189,8 @@ const styles = css`
|
|
|
189
189
|
}
|
|
190
190
|
.filled.floating .label { translate: 0 calc(-50% - 16px); scale: 0.75; }
|
|
191
191
|
.outlined.floating .label {
|
|
192
|
-
|
|
192
|
+
inset-block-start: 0;
|
|
193
|
+
translate: 0 -50%;
|
|
193
194
|
scale: 0.75;
|
|
194
195
|
}
|
|
195
196
|
.open .label, :focus-within .label { color: ${t.accent}; }
|
|
@@ -186,7 +186,7 @@ define('ui-sheet', {
|
|
|
186
186
|
return html`
|
|
187
187
|
${() =>
|
|
188
188
|
variant() === 'standard'
|
|
189
|
-
? html`<div class=${() => `std${open() ? ' open' : ''}`} part="surface" role="region"
|
|
189
|
+
? html`<div class=${() => `std${open() ? ' open' : ''}`} ?inert=${() => !open()} part="surface" role="region"
|
|
190
190
|
aria-label=${() => label() || 'Sheet'}>
|
|
191
191
|
<div class="std-inner">
|
|
192
192
|
<div class="handle" part="handle" aria-hidden="true"></div>
|
|
@@ -195,7 +195,7 @@ define('ui-side-sheet', {
|
|
|
195
195
|
return html`
|
|
196
196
|
${() =>
|
|
197
197
|
variant() === 'standard'
|
|
198
|
-
? html`<aside class=${() => `std ${anchor()}${open() ? ' open' : ''}`} part="surface"
|
|
198
|
+
? html`<aside class=${() => `std ${anchor()}${open() ? ' open' : ''}`} ?inert=${() => !open()} part="surface"
|
|
199
199
|
role="region"
|
|
200
200
|
aria-labelledby=${() => (hasHeadline() ? 'headline' : null)}
|
|
201
201
|
aria-label=${() => (hasHeadline() ? null : (label() || 'Side sheet'))}>
|
|
@@ -193,14 +193,14 @@ const styles = css`
|
|
|
193
193
|
color ${sys.duration.short2} ${sys.easing.standard};
|
|
194
194
|
}
|
|
195
195
|
.with-leading .label { inset-inline-start: calc(${sys.space(4)} + 1.5rem + ${sys.space(2)}); }
|
|
196
|
-
/* Multi-line fields anchor the label
|
|
197
|
-
.multiline .label { inset-block-start: 24px; z-index: 2; }
|
|
196
|
+
/* Multi-line fields anchor the unfloated label near the top line. */
|
|
197
|
+
.multiline:not(.floating) .label { inset-block-start: 24px; z-index: 2; }
|
|
198
198
|
.filled.floating .label { translate: 0 calc(-50% - 16px); scale: 0.75; }
|
|
199
|
-
.filled.multiline.floating .label { translate: 0 -85%; scale: 0.75; }
|
|
200
|
-
.outlined.multiline.floating .label { inset-block-start: 8px; }
|
|
199
|
+
.filled.multiline.floating .label { inset-block-start: 24px; translate: 0 -85%; scale: 0.75; }
|
|
201
200
|
.outlined.floating .label {
|
|
202
201
|
inset-inline-start: ${sys.space(4)};
|
|
203
|
-
|
|
202
|
+
inset-block-start: 0;
|
|
203
|
+
translate: 0 -50%;
|
|
204
204
|
scale: 0.75;
|
|
205
205
|
}
|
|
206
206
|
.focused .label { color: ${t.accent}; }
|