Merge pull request #1840 from bilawalsidhu/samehkhamis/kit-close-button

Vue kit: UiCloseButton for every close button in the views
This commit is contained in:
Sameh Khamis authored and GitHub committed 2026-11-19 00:57:23 -08:00
commit fb49418851
33 files changed
+322 -69

No files matched your search

+3
View File
@@ -0,0 +1,3 @@
- Every close, dismiss and clear button in the views is now one kit
component, `UiCloseButton`, with the same look and behaviour as before
(manjunath22466, samehkhamis, #1840).
+8
View File
@@ -53,6 +53,7 @@ never copied:
| `UiButton` `variant="action"` | the action surface (`gev-action-button`); `tone="danger"` hovers red, `size="compact"` is the shot-row footprint (on this variant only) | `src/ui/styles/action-button.css` |
| `UiButton` `variant="primary"` | the action surface with a group's main-action accent | `src/ui/styles/action-button.css` |
| `UiButton` `variant="icon"` | the 22px square glyph button of a panel's collapse toggle | `src/ui/styles/controls.css` |
| `UiCloseButton` | a close, dismiss or clear button: a bare glyph (× with `glyph="times"`, the Material `close` symbol with `glyph="icon"`) with no padding, border or background of its own and a pointer; the site's feature class sets size, colour, hover and any surface, and `bare` leaves the look off for a skin that sets its own padding and border | `src/ui/styles/close-button.css` |
| `UiChip` | the read-only chip (a pill of uppercase mono text); `selected` takes the accent | `src/ui/styles/chip.css` |
| `UiEmpty` | the one-line empty state (dim mono text), its hint on a line below | `src/ui/styles/empty-state.css` |
| `UiBadge` | the read-only badge (`gev-status-badge`) | `src/ui/styles/status-badge.css` |
@@ -99,6 +100,13 @@ a `title` and `hint`, but Core's empty states are one line, so the title
is the text itself rather than a bold heading; the News feed, Scene shot
list, mission roster and imagery strip use it. The locale picker's and the mission tables'
empty rows stay a paragraph and table cells.
`UiCloseButton` is a `UiButton` with a fixed glyph, a required `label` and
no tip unless the site passes a `title`; attributes and classes pass through,
so each site keeps its id, feature class and look. Every close, dismiss and
clear button in the views is one (`src/ui/kit/closeButtons.test.mjs` pins
it); Street Level's and the space mission's keep `bare`, since their skins
set their own padding and border. The close buttons built in script (credits, the
Quebec CCTV overlay, the guide) are not converted yet.
`UiSlider` keeps the native range input rather than drawing a
`role="slider"` track, so Core's keyboard, form behaviour and styling stay;
it takes `v-model`, `min`, `max`, `step` and `disabled`, emits a
+4
View File
@@ -1329,6 +1329,10 @@
"src/ui/kit/UiBadge.test.mjs",
"src/ui/kit/UiEmpty.vue",
"src/ui/kit/kitStyles.test.mjs",
"src/ui/kit/UiCloseButton.vue",
"src/ui/kit/UiCloseButton.test.mjs",
"src/ui/kit/closeButtons.test.mjs",
"src/ui/styles/close-button.css",
"src/ui/styles/chip.css",
"src/ui/styles/empty-state.css",
"src/ui/rail/RailChips.vue",
+5
View File
@@ -241,6 +241,7 @@
"src/ui/kit/UiSelect.js",
"src/ui/kit/UiEmpty.vue",
"src/ui/kit/UiBadge.vue",
"src/ui/kit/UiCloseButton.vue",
"src/ui/stores/globeActions.js",
"src/ui/views/panels/GlobeActions.vue",
"src/ui/views/panels/RenderFailure.vue",
@@ -1014,6 +1015,8 @@
"src/ui/kit/UiSelect.js",
"src/ui/kit/UiButton.vue",
"src/ui/kit/UiBadge.vue",
"src/ui/kit/UiCloseButton.vue",
"src/ui/kit/UiIcon.vue",
"src/ui/rail/fieldValue.js",
"src/ui/kit/UiSlider.js",
"src/ui/kit/UiSegmented.vue"
@@ -1602,6 +1605,7 @@
"src/ui/kit/UiSlider.js",
"src/ui/kit/UiButton.vue",
"src/ui/kit/UiBadge.vue",
"src/ui/kit/UiCloseButton.vue",
"src/ui/stores/globeActions.js",
"src/ui/stores/recording.js",
"src/ui/i18n.js",
@@ -5370,6 +5374,7 @@
"src/ui/kit/UiButton.vue",
"src/ui/kit/UiEmpty.vue",
"src/ui/kit/UiBadge.vue",
"src/ui/kit/UiCloseButton.vue",
"src/ui/stores/globeActions.js",
"src/ui/stores/recording.js",
"src/ui/i18n.js",
+98
View File
@@ -0,0 +1,98 @@
import { after, before, test } from 'node:test';
import assert from 'node:assert/strict';
import { installVueDom } from '../../testSupport/vueDom.mjs';
let mount;
let UiCloseButton;
let uninstall;
before(async () => {
uninstall = installVueDom();
({ mount } = await import('@vue/test-utils'));
UiCloseButton = (await import('./UiCloseButton.vue')).default;
});
after(() => uninstall());
function mountClose(props = {}, attrs = {}) {
return mount(UiCloseButton, {
attachTo: document.body,
props: { label: 'Close card', ...props },
attrs,
});
}
test('a close button is a button named by its label, with no tip of its own', () => {
const wrapper = mountClose();
const button = wrapper.get('button');
assert.equal(button.attributes('type'), 'button');
assert.equal(button.attributes('aria-label'), 'Close card');
assert.equal(button.attributes('title'), undefined);
assert.ok(button.classes().includes('ui-close-button'));
wrapper.unmount();
});
test('glyph="times" draws the × character', () => {
const wrapper = mountClose();
const button = wrapper.get('button');
assert.equal(button.element.innerHTML, '×');
wrapper.unmount();
});
test('glyph="icon" draws the Material close symbol, sized by the stylesheet', () => {
const wrapper = mountClose({ glyph: 'icon' });
const icon = wrapper.get('button > span');
assert.equal(wrapper.get('button').element.children.length, 1);
assert.equal(icon.text(), 'close');
assert.ok(icon.classes().includes('material-symbols-outlined'));
assert.equal(icon.attributes('aria-hidden'), 'true');
assert.equal(icon.attributes('style'), undefined);
wrapper.unmount();
});
test('attributes and classes pass through to the button', () => {
const wrapper = mountClose(
{},
{
id: 'gev-chat-close',
class: 'data-toggle-chip',
title: 'Clear reading',
'data-action-id': 'clear',
'aria-hidden': 'true',
disabled: true,
hidden: true,
},
);
const button = wrapper.get('button');
assert.equal(button.attributes('id'), 'gev-chat-close');
assert.ok(button.classes().includes('data-toggle-chip'));
assert.ok(button.classes().includes('ui-close-button'));
assert.equal(button.attributes('title'), 'Clear reading');
assert.equal(button.attributes('data-action-id'), 'clear');
assert.equal(button.attributes('aria-hidden'), 'true');
assert.equal(button.element.disabled, true);
assert.equal(button.element.hidden, true);
wrapper.unmount();
});
test('bare leaves the kit look off', () => {
const wrapper = mountClose({ bare: true }, { class: 'sl-viewer-x' });
const classes = wrapper.get('button').classes();
assert.ok(classes.includes('sl-viewer-x'));
assert.equal(classes.includes('ui-close-button'), false);
wrapper.unmount();
});
test('a click is emitted with its event', async () => {
const wrapper = mountClose();
await wrapper.get('button').trigger('click');
const clicks = wrapper.emitted('click');
assert.equal(clicks.length, 1);
assert.ok(clicks[0][0] instanceof Event);
wrapper.unmount();
});
test('a disabled close button emits no click', async () => {
const wrapper = mountClose({}, { disabled: true });
await wrapper.get('button').trigger('click');
assert.equal(wrapper.emitted('click'), undefined);
wrapper.unmount();
});
+40
View File
@@ -0,0 +1,40 @@
<script setup>
import UiButton from './UiButton.vue';
import UiIcon from './UiIcon.vue';
// Core's close, dismiss and clear button: a UiButton with a fixed glyph and
// a required accessible name. `glyph` is `times` (the × character) or `icon`
// (the Material `close` symbol, sized by the caller's stylesheet). Attributes
// and classes pass through to the button, so each site keeps its id, its
// feature class and its look; a `title` passed in is its tip, and without
// one it has none. The kit class `ui-close-button` (close-button.css) is
// Core's common look, a bare glyph: no padding, border or background of its
// own, and a pointer. Its rule selects one class and loads before the
// feature stylesheets, so a feature rule still sets the size, colour, hover
// and any surface. `bare` leaves the kit look off, for a button whose own
// skin sets its padding and border.
const props = defineProps({
/** The accessible name (aria-label). */
label: { type: String, required: true },
glyph: {
type: String,
default: 'times',
validator: (value) => ['times', 'icon'].includes(value),
},
bare: { type: Boolean, default: false },
});
const emit = defineEmits(['click']);
</script>
<template>
<UiButton
:class="{ 'ui-close-button': !props.bare }"
:label="props.label"
:native-title="false"
@click="emit('click', $event)"
><UiIcon v-if="props.glyph === 'icon'" name="close" :size="null" /><template
v-else
>×</template
></UiButton
>
</template>
+5 -2
View File
@@ -1,5 +1,8 @@
<script setup>
/** A Material Symbols glyph; the name must be in index.html's `icon_names`. */
/**
* A Material Symbols glyph; the name must be in index.html's `icon_names`.
* `size` is its font size in pixels; null leaves the size to the stylesheet.
*/
defineProps({
name: { type: String, required: true },
size: { type: Number, default: 18 },
@@ -9,7 +12,7 @@ defineProps({
<template>
<span
class="ui-icon material-symbols-outlined"
:style="{ fontSize: `${size}px` }"
:style="size == null ? undefined : { fontSize: `${size}px` }"
aria-hidden="true"
>{{ name }}</span
>
+76
View File
@@ -0,0 +1,76 @@
// Every close, dismiss and clear button in a Vue view is a UiCloseButton: no
// SFC template hand-writes a button whose only content is × or the Material
// `close` symbol. Buttons built in script are not read here.
import { test } from 'node:test';
import assert from 'node:assert/strict';
import { readFileSync, readdirSync } from 'node:fs';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
const SRC_ROOT = fileURLToPath(new URL('../../', import.meta.url));
const REPO_ROOT = path.resolve(SRC_ROOT, '..');
/** Every SFC under src. */
function sfcFiles(directory = SRC_ROOT) {
const files = [];
for (const entry of readdirSync(directory, { withFileTypes: true })) {
const absolute = path.join(directory, entry.name);
if (entry.isDirectory()) files.push(...sfcFiles(absolute));
else if (entry.isFile() && entry.name.endsWith('.vue'))
files.push(absolute);
}
return files.sort();
}
/** The template block: everything outside script and style. */
function template(source) {
return source.replace(/<(script|style)\b[\s\S]*?<\/\1\s*>/g, '');
}
// An opening tag's attributes, quoted values may hold `>` (`() => x`).
const ATTRS = String.raw`(?:[^>"']|"[^"]*"|'[^']*')*`;
const BUTTON = String.raw`(button|UiButton)`;
const CLOSE_GLYPH = [
String.raw`×|&times;|&#215;|&#xd7;`,
String.raw`<span\b[^>]*\bmaterial-symbols-outlined\b[^>]*>\s*close\s*</span\s*>`,
String.raw`<UiIcon${ATTRS}\bname="close"${ATTRS}/>`,
].join('|');
const HAND_WRITTEN_CLOSE = new RegExp(
String.raw`<${BUTTON}\b${ATTRS}>\s*(?:${CLOSE_GLYPH})\s*</\1\s*>`,
'gi',
);
/** Hand-written close buttons in an SFC's template. */
function handWrittenCloses(source) {
return [...template(source).matchAll(HAND_WRITTEN_CLOSE)].map((m) =>
m[0].replace(/\s+/g, ' '),
);
}
test('the scan finds each hand-written close glyph', () => {
for (const markup of [
'<template><button type="button" @click="emit(\'close\')">×</button></template>',
'<template><button\n class="x"\n :title="a > b ? 1 : 2"\n >×</button\n></template>',
'<template><UiButton class="x" :label="l">&times;</UiButton></template>',
'<template><button type="button" class="x">\n <span class="material-symbols-outlined" aria-hidden="true">close</span>\n</button></template>',
'<template><UiButton class="x"><UiIcon name="close" :size="14" /></UiButton></template>',
])
assert.equal(handWrittenCloses(markup).length, 1, markup);
for (const markup of [
'<template><UiCloseButton class="x" :label="l" /></template>',
'<template><button type="button">{{ name }} ×</button></template>',
'<template><button type="button">On<span class="material-symbols-outlined">close</span></button></template>',
'<template><button type="button"><span class="material-symbols-outlined">close_fullscreen</span></button></template>',
])
assert.equal(handWrittenCloses(markup).length, 0, markup);
});
test('no SFC hand-writes a close button; each is a UiCloseButton', () => {
const found = [];
for (const file of sfcFiles()) {
const relative = path.relative(REPO_ROOT, file).split(path.sep).join('/');
for (const markup of handWrittenCloses(readFileSync(file, 'utf8')))
found.push(`${relative}: ${markup}`);
}
assert.deepEqual(found, []);
});
+22
View File
@@ -138,6 +138,17 @@ test('UiChip, UiEmpty, UiBadge and UiSegmented wear Core’s skins', () => {
shares('.ui-segmented__item:disabled', '.gev-segment:disabled');
});
test('UiCloseButton wears the bare glyph look the guide’s close shares', () => {
const rule = shares('.ui-close-button', '.gev-guide-close');
for (const declaration of [
/padding:\s*0;/,
/border:\s*0;/,
/background:\s*none;/,
/cursor:\s*pointer;/,
])
assert.match(rule.body, declaration);
});
test('the kit’s skins load before the feature stylesheets that restyle them', () => {
const at = (selector) => css.indexOf(selector);
for (const [kit, feature] of [
@@ -146,6 +157,17 @@ test('the kit’s skins load before the feature stylesheets that restyle them',
['.ui-empty,', '.recent-imagery-readout .ri-strip-empty {'],
['.ui-empty,', '#space-mission-panel-host .space-mission-roster-empty {'],
['.ui-button--icon,', '#command-dock .panel-collapse-btn'],
['.ui-close-button,', '.data-toggle-chip {'],
['.ui-close-button,', '.geo-import-action {'],
['.ui-close-button,', '.panel-surface-control {'],
['.ui-close-button,', '.gev-voice-card-dismiss {'],
['.ui-close-button,', '.bhote-event-icon-btn {'],
['.ui-close-button,', '.entity-card__close {'],
['.ui-close-button,', '.context-search__clear {'],
['.ui-close-button,', '.key-setup-close {'],
['.ui-close-button,', '.cctv-popup__close {'],
['.ui-close-button,', '.view-context__live-off {'],
['.ui-close-button,', '.gev-guide-close {'],
]) {
assert.ok(
at(kit) >= 0 && at(feature) > at(kit),
+4 -6
View File
@@ -2,6 +2,7 @@
import { onBeforeUnmount } from 'vue';
import { t } from '../../i18n/index.js';
import { formatScaleRange } from '../unitLabels.js';
import UiCloseButton from '../kit/UiCloseButton.vue';
import RailCardSetting from './RailCardSetting.vue';
import RailChips from './RailChips.vue';
import RailRowList from './RailRowList.vue';
@@ -100,16 +101,13 @@ function legendView(legend) {
/><template v-else-if="block.type === 'result'"
><div class="rail-card-result-header"
><span class="panel-title">{{ block.label }}</span
><button
><UiCloseButton
class="data-toggle-chip"
type="button"
data-action-id="clear"
:aria-label="t('Clear reading')"
:label="t('Clear reading')"
:title="t('Clear reading')"
:hidden="!block.clear"
@click="dispatch(block.clear, block)"
>×</button
></div
@click="dispatch(block.clear, block)" /></div
><div class="rail-card-result-lines"
><RailCardBlocks
:blocks="[
@@ -1,6 +1,7 @@
<script setup>
import { computed } from 'vue';
import { t } from '../../i18n/index.js';
import UiCloseButton from '../kit/UiCloseButton.vue';
import UiSegmented from '../kit/UiSegmented.vue';
import RailCardBlocks from '../rail/RailCardBlocks.vue';
import RailCards from '../rail/RailCards.vue';
@@ -99,8 +100,7 @@ const modeOptions = computed(() =>
:label="t('Mode')"
:options="modeOptions"
:model-value="view.mode"
@update:model-value="onSetMode"
/><div
@update:model-value="onSetMode" /><div
v-for="slot in view.slots"
:id="`ri-slot-${slot.id}`"
:key="slot.id"
@@ -108,21 +108,17 @@ const modeOptions = computed(() =>
:data-state="slot.state"
><span class="ri-slot-tag">{{ slot.tag }}</span
><span class="ri-slot-value" :title="slot.text">{{ slot.text }}</span
><button
><UiCloseButton
:id="`ri-unpin-${slot.id}`"
:class="[
'data-toggle-chip ri-unpin',
{ 'is-reserved': !slot.pinned },
]"
type="button"
:data-unpin="slot.id"
:disabled="!slot.pinned"
:aria-hidden="String(!slot.pinned)"
:aria-label="slot.unpinLabel"
:title="slot.unpinLabel"
>×</button
></div
></section
:label="slot.unpinLabel"
:title="slot.unpinLabel" /></div></section
><div id="ri-controls" class="ri-block ri-controls"
><label class="ri-opacity-label" for="ri-opacity"
><span>{{ t('OPACITY') }}</span
+1 -2
View File
@@ -361,18 +361,17 @@ html:not([lang='en']) .bhote-embedded-callout footer a {
color: var(--text-primary);
}
/* A UiCloseButton (close-button.css). */
.bhote-event-icon-btn {
flex: 0 0 30px;
width: 30px;
height: 30px;
padding: 0;
border: 1px solid rgba(151, 211, 224, 0.26);
border-radius: 4px;
color: var(--text-primary);
background: var(--accent-dim);
font: inherit;
font-size: 18px;
cursor: pointer;
}
.bhote-event-status-row {
+13
View File
@@ -0,0 +1,13 @@
/* Core's close, dismiss and clear buttons draw a bare glyph: no padding,
* border or background of their own, and a pointer. The kit's
* UiCloseButton wears it as .ui-close-button; the guide's close button,
* built in script, shares the rule. It selects one class and loads before
* the feature stylesheets, so each feature rule still sets its size, colour,
* hover and any surface (a border, a chip, a tinted square). */
.ui-close-button,
.gev-guide-close {
padding: 0;
border: 0;
background: none;
cursor: pointer;
}
+1 -4
View File
@@ -148,18 +148,15 @@ body.mobile-shell .context-dock-btn {
display: none;
}
/* A UiCloseButton (close-button.css). */
.context-search__clear {
display: grid;
flex: none;
place-items: center;
width: 24px;
height: 24px;
padding: 0;
color: rgba(199, 214, 222, 0.65);
background: transparent;
border: 0;
border-radius: 50%;
cursor: pointer;
}
.context-search__clear:hover,
+3 -10
View File
@@ -83,18 +83,15 @@
color: #ff9f43;
}
/* A UiCloseButton: close-button.css draws no padding, border or background. */
.entity-card__close {
display: grid;
flex: none;
place-items: center;
width: 1.5rem;
height: 1.5rem;
padding: 0;
color: rgba(199, 214, 222, 0.6);
background: none;
border: 0;
border-radius: 6px;
cursor: pointer;
}
.entity-card__close:hover,
@@ -1119,18 +1116,16 @@
color: #ff5c6c;
}
/* A UiCloseButton (close-button.css). */
.view-context__live-off {
display: grid;
flex: none;
place-items: center;
width: 22px;
height: 22px;
padding: 0;
color: rgba(199, 214, 222, 0.5);
background: none;
border: 1px solid transparent;
border-radius: 6px;
cursor: pointer;
}
.view-context__live-off .material-symbols-outlined {
@@ -1314,18 +1309,16 @@
border-radius: 999px;
}
/* A UiCloseButton (close-button.css). */
.cctv-popup__close {
display: grid;
place-items: center;
width: 28px;
height: 28px;
margin-inline-start: auto;
padding: 0;
color: rgba(236, 244, 248, 0.8);
background: none;
border: 1px solid rgba(255, 255, 255, 0.14);
border-radius: 8px;
cursor: pointer;
}
.cctv-popup__close:hover {
+1 -4
View File
@@ -190,20 +190,17 @@
letter-spacing: 0.06rem;
}
/* Shares close-button.css: no padding, border or background, a pointer. */
.gev-guide-close {
display: grid;
place-items: center;
width: 20px;
height: 20px;
margin: -2px -4px 0 0;
padding: 0;
color: rgba(214, 220, 226, 0.55);
font-size: 0.95rem;
line-height: 1;
background: none;
border: 0;
border-radius: 5px;
cursor: pointer;
}
.gev-guide-close:hover,
+1 -2
View File
@@ -129,15 +129,14 @@
color: rgba(54, 220, 255, 0.86);
}
/* A UiCloseButton (close-button.css). */
.key-setup-close {
display: grid;
place-items: center;
padding: 0.15rem;
color: rgba(171, 210, 220, 0.6);
background: none;
border: 1px solid transparent;
border-radius: 0.3rem;
cursor: pointer;
transition:
color var(--transition-fast),
border-color var(--transition-fast);
+1 -2
View File
@@ -94,18 +94,17 @@
color: #ffc46b;
}
/* A UiCloseButton (close-button.css). */
.gev-voice-card-dismiss {
margin-inline-start: auto;
width: 1.1rem;
height: 1.1rem;
padding: 0;
color: var(--text-secondary);
background: rgba(255, 255, 255, 0.04);
border: 1px solid rgba(54, 220, 255, 0.24);
border-radius: 0.2rem;
font-size: 0.72rem;
line-height: 1;
cursor: pointer;
transition:
color var(--transition-fast),
border-color var(--transition-fast);
+2 -3
View File
@@ -17,6 +17,7 @@ import ViewContext from './panels/ViewContext.vue';
import SpaceMissionsPanel from './panels/SpaceMissionsPanel.vue';
import RadioPanel from './panels/RadioPanel.vue';
import UiButton from '../kit/UiButton.vue';
import UiCloseButton from '../kit/UiCloseButton.vue';
import { cockpitEntryFace } from '../cockpitPresentation.js';
import { LAYER_TABS, TAB_AFFECTS, activeTab, availableTabs, contextReady, enabledLayerIds, setEnabledLayers, tabTarget } from '../contextLayerTabs.js';
import { shownLayerName } from '../layerNames.js';
@@ -192,9 +193,7 @@ watch(
<div v-if="contextSearchOpen" class="context-search" role="search">
<span class="material-symbols-outlined" aria-hidden="true">search</span>
<input ref="searchInput" v-model="contextSearchText" type="search" class="context-search__input" :placeholder="searchHint" :aria-label="searchHint" autocomplete="off" spellcheck="false" @keydown.esc.stop="closeContextSearch" />
<button v-if="contextSearchText" type="button" class="context-search__clear" :aria-label="t('Clear search')" :title="t('Clear search')" @click="contextSearchText = ''; searchInput?.focus()">
<span class="material-symbols-outlined" aria-hidden="true">close</span>
</button>
<UiCloseButton v-if="contextSearchText" class="context-search__clear" glyph="icon" :label="t('Clear search')" :title="t('Clear search')" @click="contextSearchText = ''; searchInput?.focus()" />
</div>
<div v-if="availableTabs.length" class="context-tabs" role="tablist" :aria-label="t('Context tabs')">
<button id="context-tab-btn-view" type="button" role="tab" class="context-tabs__tab" :class="{ active: activeTab === 'view' }" :aria-selected="String(activeTab === 'view')" aria-controls="context-tab-view" :tabindex="activeTab === 'view' ? 0 : -1" @click="activeTab = 'view'" @keydown.left.prevent="switchTab" @keydown.right.prevent="switchTab">
+2 -3
View File
@@ -8,6 +8,7 @@ import { vStatusText } from '../rail/statusText.js';
import { useLocaleStore } from '../stores/locale.js';
import { useProviderSettingsStore } from '../stores/providerSettings.js';
import LocalePicker from './panels/LocalePicker.vue';
import UiCloseButton from '../kit/UiCloseButton.vue';
const { picker } = storeToRefs(useLocaleStore());
// The key setup owner (src/keySetup.js) presents the chip, the dialog and its
@@ -48,9 +49,7 @@ const removeTitle = (title) =>
<div class="key-setup-scanline" aria-hidden="true"></div>
<header class="key-setup-header">
<span class="key-setup-kicker">{{ t('GROUND STATION · PROVIDER SETTINGS') }}</span>
<button type="button" class="key-setup-close" data-key-setup-close :aria-label="t('Close key setup')" @click="controls?.close()">
<span class="material-symbols-outlined" aria-hidden="true">close</span>
</button>
<UiCloseButton class="key-setup-close" glyph="icon" data-key-setup-close :label="t('Close key setup')" @click="controls?.close()" />
</header>
<h2 id="key-setup-title">{{ t('Power up the globe') }}</h2>
<p id="key-setup-description">{{ t('The globe already flies keyless. Every key below switches on another real feed — paste one and it\'s saved into this app\'s local configuration, then the server restarts itself. Server-side keys stay on this machine; Google Maps and Cesium ion run in the browser and must be provider-restricted. Keys you configured elsewhere are shown but never touched.') }}</p>
+2 -1
View File
@@ -2,6 +2,7 @@
import { storeToRefs } from 'pinia';
import { t } from '../../../i18n/index.js';
import { useBhoteKoshiPanelStore } from '../../stores/bhoteKoshiPanel.js';
import UiCloseButton from '../../kit/UiCloseButton.vue';
import UiSlider from '../../kit/UiSlider.js';
// The Bhote Koshi reconstruction controls, at the end of the context rail,
@@ -19,7 +20,7 @@ const sliderValue = (event, scale) => Number(event.target.value) / scale;
<div class="bhote-event-kicker">{{ t('EVENT RECONSTRUCTION · 26 AUG 2026') }}</div>
<div class="bhote-event-title">{{ t('BHOTE KOSHI OUTBURST FLOOD') }}</div>
</div>
<button class="bhote-event-icon-btn" type="button" data-action="close" :title="t('Close event layer')" :aria-label="t('Close event layer')" @click="call('close')">×</button>
<UiCloseButton class="bhote-event-icon-btn" data-action="close" :title="t('Close event layer')" :label="t('Close event layer')" @click="call('close')" />
</div>
<div class="bhote-event-status-row">
<span class="bhote-event-status observed" :hidden="panel.refs.observedStatus.hidden">{{ t('OBSERVED IMAGERY') }}</span>
+2 -3
View File
@@ -4,6 +4,7 @@ import { storeToRefs } from 'pinia';
import { t } from '../../../i18n/index.js';
import { useCctvStore } from '../../stores/cctv.js';
import { usePanelChromeStore } from '../../stores/panelChrome.js';
import UiCloseButton from '../../kit/UiCloseButton.vue';
// A selected camera's card: a thumbnail of its latest frame, a few facts,
// and a button that opens the full CCTV panel. The frame and facts come from
@@ -78,9 +79,7 @@ function openPanel() {
<span class="material-symbols-outlined" aria-hidden="true">videocam</span>
<strong>{{ name || t('Camera view') }}</strong>
<span v-if="sourceBadge?.label" class="cctv-popup__badge">{{ sourceBadge.label }}</span>
<button type="button" class="cctv-popup__close" :aria-label="t('Close')" @click="big = false">
<span class="material-symbols-outlined" aria-hidden="true">close</span>
</button>
<UiCloseButton class="cctv-popup__close" glyph="icon" :label="t('Close')" @click="big = false" />
</header>
<img :src="src" :alt="name || t('Camera frame')" />
<figcaption v-if="facts.length">
+2 -1
View File
@@ -5,6 +5,7 @@ import { t } from '../../../i18n/index.js';
import { useVoiceStore } from '../../stores/voice.js';
import { ASSISTANT_NAME } from '../../../voice/control.js';
import PanelLayoutButtons from './PanelLayoutButtons.vue';
import UiCloseButton from '../../kit/UiCloseButton.vue';
// The typed chat in the command dock, as its owner (src/voice/chatControl.js)
// writes the voice control presenter. Messages arrive apart from the view, so
@@ -68,7 +69,7 @@ const quickPrompts = () => [t('Fly to Tokyo'), t('Show live flights')];
<div id="gev-chat-header-actions">
<PanelLayoutButtons :docked="props.view.layout.docked" :minimized="props.view.chat.minimized" @dock="emit('layout-dock')" @minimize="emit('chat-minimize')" />
<button v-if="props.view.panel" id="gev-voice-settings-button" class="gev-voice-settings-button" type="button" :aria-label="t('Settings')" :title="t('Settings')" aria-controls="gev-voice-panel" :aria-expanded="String(props.view.voicePanel.settingsExpanded)" @click="emit('settings-button')"><span class="material-symbols-outlined gev-voice-settings-icon" aria-hidden="true">settings</span></button>
<button id="gev-chat-close" type="button" :aria-label="t('Close chat')" @click="emit('chat-close')">×</button>
<UiCloseButton id="gev-chat-close" :label="t('Close chat')" @click="emit('chat-close')" />
</div>
</header>
<div id="gev-chat-messages" ref="list" role="log" :aria-label="t('Conversation')" aria-live="polite" :aria-busy="props.view.chat.busy || props.view.chat.revealing ? 'true' : undefined" @scroll.passive="onListScroll">
+3 -4
View File
@@ -3,6 +3,7 @@ import { storeToRefs } from 'pinia';
import { computed, nextTick, useTemplateRef, watch } from 'vue';
import { formatNumber, t, tn } from '../../../i18n/index.js';
import UiButton from '../../kit/UiButton.vue';
import UiCloseButton from '../../kit/UiCloseButton.vue';
import UiSelect from '../../kit/UiSelect.js';
import {
libraryStatTiles,
@@ -102,13 +103,11 @@ const onDialogClick = (event) => {
<h2 id="data-library-title" class="panel-title panel-surface-title">
{{ t('DATA LIBRARY') }}
</h2>
<UiButton
<UiCloseButton
class="panel-surface-control data-library-close"
:label="t('Close data library')"
:native-title="false"
@click="controls?.close()"
>×</UiButton
>
/>
</header>
<div class="data-library-body" data-panel-body>
<dl class="data-library-stats" :aria-label="t('Data Library at a glance')">
+2 -1
View File
@@ -6,6 +6,7 @@ import { DRAW_COLOR_CSS } from '../../../annotations/drawMarks.js';
import { vFieldValue } from '../../rail/fieldValue.js';
import { vFocusSafeChildren } from '../../rail/focusSafeChildren.js';
import DrawSwatches from './DrawSwatches.vue';
import UiCloseButton from '../../kit/UiCloseButton.vue';
import { useDisplayStore } from '../../stores/display.js';
// UTILITIES ▸ Draw's shapes, one row each like Import's files: the colour
@@ -99,5 +100,5 @@ function leave() {
</script>
<template>
<ul class="geo-import-list draw-mark-list" :class="{ visible: listed }" id="draw-mark-list" v-focus-safe-children="leave" :aria-label="t('Drawn shapes')"><li v-for="row in rows" :key="row.id" class="geo-import-row draw-mark-row" :class="{ 'hidden-mark': row.hidden }" :data-mark-id="row.id" @keydown="onRowKey(row, $event)"><button type="button" class="geo-import-swatch draw-mark-swatch" data-control="swatch" :style="{ background: DRAW_COLOR_CSS[row.color] }" :title="row.labels.swatch" :aria-label="row.labels.swatch" :aria-expanded="String(picking === row.id)" :aria-controls="`draw-mark-colors-${row.id}`" @click="picking = picking === row.id ? null : row.id"></button><DrawSwatches v-if="picking === row.id" :id="`draw-mark-colors-${row.id}`" class="draw-mark-colors" data-control="picker" autofocus :label="row.labels.colors" :model-value="row.color" @update:model-value="recolor(row, $event)" @choose="closePicker(row.id)" /><input type="text" class="geo-import-name draw-mark-name" data-control="name" maxlength="120" autocomplete="off" spellcheck="false" v-field-value="row.name" :placeholder="row.placeholder" :aria-label="row.labels.name" @keydown="onNameKey(row, $event)" @focusout="commit(row, $event.currentTarget)"><button type="button" class="geo-import-action" data-control="toggle" :title="row.labels.toggle" :aria-label="row.labels.toggle" @click="display.act('toggleDrawMark', row.id)"><span class="material-symbols-outlined" aria-hidden="true">{{ row.hidden ? 'visibility_off' : 'visibility' }}</span></button><button v-for="action in row.actions" :key="action.id" type="button" class="geo-import-action draw-mark-action" :data-control="`action-${action.id}`" :data-action="action.id" :title="action.label" :aria-label="action.label" :aria-disabled="String(row.busy)" @click="display.act('runDrawMarkAction', row.id, action.id)"><span class="material-symbols-outlined" aria-hidden="true">{{ action.icon }}</span></button><button type="button" class="geo-import-action" data-control="fly" :title="row.labels.fly" :aria-label="row.labels.fly" @click="display.act('flyToDrawMark', row.id)"><span class="material-symbols-outlined" aria-hidden="true">my_location</span></button><button type="button" class="geo-import-action" data-control="remove" :title="row.labels.remove" :aria-label="row.labels.remove" @click="display.act('removeDrawMark', row.id)"><span class="material-symbols-outlined" aria-hidden="true">close</span></button><span v-if="row.actions.length" class="draw-mark-note" role="status" :aria-busy="String(row.busy)">{{ row.busy ? '…' : row.note }}</span></li></ul>
<ul class="geo-import-list draw-mark-list" :class="{ visible: listed }" id="draw-mark-list" v-focus-safe-children="leave" :aria-label="t('Drawn shapes')"><li v-for="row in rows" :key="row.id" class="geo-import-row draw-mark-row" :class="{ 'hidden-mark': row.hidden }" :data-mark-id="row.id" @keydown="onRowKey(row, $event)"><button type="button" class="geo-import-swatch draw-mark-swatch" data-control="swatch" :style="{ background: DRAW_COLOR_CSS[row.color] }" :title="row.labels.swatch" :aria-label="row.labels.swatch" :aria-expanded="String(picking === row.id)" :aria-controls="`draw-mark-colors-${row.id}`" @click="picking = picking === row.id ? null : row.id"></button><DrawSwatches v-if="picking === row.id" :id="`draw-mark-colors-${row.id}`" class="draw-mark-colors" data-control="picker" autofocus :label="row.labels.colors" :model-value="row.color" @update:model-value="recolor(row, $event)" @choose="closePicker(row.id)" /><input type="text" class="geo-import-name draw-mark-name" data-control="name" maxlength="120" autocomplete="off" spellcheck="false" v-field-value="row.name" :placeholder="row.placeholder" :aria-label="row.labels.name" @keydown="onNameKey(row, $event)" @focusout="commit(row, $event.currentTarget)"><button type="button" class="geo-import-action" data-control="toggle" :title="row.labels.toggle" :aria-label="row.labels.toggle" @click="display.act('toggleDrawMark', row.id)"><span class="material-symbols-outlined" aria-hidden="true">{{ row.hidden ? 'visibility_off' : 'visibility' }}</span></button><button v-for="action in row.actions" :key="action.id" type="button" class="geo-import-action draw-mark-action" :data-control="`action-${action.id}`" :data-action="action.id" :title="action.label" :aria-label="action.label" :aria-disabled="String(row.busy)" @click="display.act('runDrawMarkAction', row.id, action.id)"><span class="material-symbols-outlined" aria-hidden="true">{{ action.icon }}</span></button><button type="button" class="geo-import-action" data-control="fly" :title="row.labels.fly" :aria-label="row.labels.fly" @click="display.act('flyToDrawMark', row.id)"><span class="material-symbols-outlined" aria-hidden="true">my_location</span></button><UiCloseButton class="geo-import-action" glyph="icon" data-control="remove" :title="row.labels.remove" :label="row.labels.remove" @click="display.act('removeDrawMark', row.id)" /><span v-if="row.actions.length" class="draw-mark-note" role="status" :aria-busy="String(row.busy)">{{ row.busy ? '…' : row.note }}</span></li></ul>
</template>
+2 -3
View File
@@ -10,6 +10,7 @@ import AltitudeGraph from './AltitudeGraph.vue';
import { contextNeedle, contextSearchText, matchesContextSearch } from '../../contextSearch.js';
import RouteGlobe from './RouteGlobe.vue';
import CctvPreview from './CctvPreview.vue';
import UiCloseButton from '../../kit/UiCloseButton.vue';
import { useCctvStore } from '../../stores/cctv.js';
import SpotConditions from './SpotConditions.vue';
import { shownLayerName } from '../../layerNames.js';
@@ -396,9 +397,7 @@ watch(
<h3 class="entity-card__title">{{ shownTitle }}</h3>
<span v-if="subtitle" class="entity-card__subtitle">{{ subtitle }}</span>
</div>
<button type="button" class="entity-card__close" :aria-label="t('Close card')" :title="t('Close card')" @click="store.clear()">
<span class="material-symbols-outlined" aria-hidden="true">close</span>
</button>
<UiCloseButton class="entity-card__close" glyph="icon" :label="t('Close card')" :title="t('Close card')" @click="store.clear()" />
</header>
<div class="entity-card__meta">
+2 -1
View File
@@ -5,6 +5,7 @@ import { t } from '../../../i18n/index.js';
import UiSlider from '../../kit/UiSlider.js';
import { useSpaceMissionsStore } from '../../stores/spaceMissions.js';
import UiButton from '../../kit/UiButton.vue';
import UiCloseButton from '../../kit/UiCloseButton.vue';
// The selected space mission. The launches layer presents it
// and hides the panel while none is selected; the roster beside it hides
@@ -27,7 +28,7 @@ watch(
<template>
<aside id="space-mission-panel" ref="root" class="context-space-mission-detail" :aria-label="t('Selected Space Mission')" :hidden="!m">
<div class="space-mission-view-header"><span>{{ t('SELECTED SPACE MISSION') }}</span><button type="button" data-mission-close :title="t('Show all missions')" :aria-label="t('Deselect mission')" @click="layer?.deselectMission()">×</button></div>
<div class="space-mission-view-header"><span>{{ t('SELECTED SPACE MISSION') }}</span><UiCloseButton data-mission-close bare :title="t('Show all missions')" :label="t('Deselect mission')" @click="layer?.deselectMission()" /></div>
<div class="space-mission-detail">
<strong data-mission-title>{{ m ? m.title : t('MISSION') }}</strong>
<span data-mission-field data-mission-provider :hidden="m && !m.provider">{{ m?.provider }}</span>
+2 -1
View File
@@ -3,6 +3,7 @@ import { storeToRefs } from 'pinia';
import { computed, shallowRef, watch } from 'vue';
import { t } from '../../../i18n/index.js';
import UiButton from '../../kit/UiButton.vue';
import UiCloseButton from '../../kit/UiCloseButton.vue';
import UiSegmented from '../../kit/UiSegmented.vue';
import RailPanel from '../../rail/RailPanel.vue';
import RailChips from '../../rail/RailChips.vue';
@@ -139,7 +140,7 @@ const vThumb = {
<UiSegmented class="sl-seg" item-class="sl-seg-btn" active-class="is-active" keyboard="radio" :hidden="!viewer.renderModes" :label="t('Image fit')" :options="renderModeOptions" :model-value="viewer.renderMode" @update:model-value="store.act('setRenderMode', $event)" />
</div>
<div class="sl-viewer-tools sl-viewer-tools-right">
<button id="sl-viewer-close" class="sl-viewer-x" type="button" :title="t('Close the image and deselect it on the map')" :aria-label="t('Close the street-level image')">×</button>
<UiCloseButton id="sl-viewer-close" class="sl-viewer-x" bare :title="t('Close the image and deselect it on the map')" :label="t('Close the street-level image')" />
</div>
</div>
<div id="sl-viewer-error" class="sl-error" role="alert" :hidden="!(embedOverlay || expanded) || !view?.error"><span aria-hidden="true">⚠</span> {{ view?.error || '' }}</div>
+2 -3
View File
@@ -10,6 +10,7 @@ import { shownLayerName } from '../../layerNames.js';
import { entityKind } from '../../../data/entityContext.js';
import SpotConditions from './SpotConditions.vue';
import SunDial from './SunDial.vue';
import UiCloseButton from '../../kit/UiCloseButton.vue';
import AltitudeGraph from './AltitudeGraph.vue';
// What the Context panel shows while nothing is picked: where the camera is
@@ -322,9 +323,7 @@ const distance = (km) =>
</span>
</span>
<span class="view-context__live-state" :class="`view-context__live-state--${layer.state.tone}`">{{ layer.state.text }}</span>
<button type="button" class="view-context__live-off" :aria-label="t('Turn off {name}', { name: layer.name })" :title="t('Turn off {name}', { name: layer.name })" @click="turnOff(layer)">
<span class="material-symbols-outlined" aria-hidden="true">close</span>
</button>
<UiCloseButton class="view-context__live-off" glyph="icon" :label="t('Turn off {name}', { name: layer.name })" :title="t('Turn off {name}', { name: layer.name })" @click="turnOff(layer)" />
</div>
<div v-if="layer.breakdown" class="view-context__split">
<p class="view-context__split-basis">{{ layer.breakdown.basis }}</p>
+2 -1
View File
@@ -2,6 +2,7 @@
import { t } from '../../../i18n/index.js';
import { ASSISTANT_NAME } from '../../../voice/control.js';
import UiChip from '../../kit/UiChip.vue';
import UiCloseButton from '../../kit/UiCloseButton.vue';
// Captions, plan and result, as VoiceCardControls (src/voice/voiceCard.js)
// presents them. Captions update silently; the polite live region carries
@@ -15,7 +16,7 @@ const emit = defineEmits(['dismiss']);
<div class="gev-voice-card-header">
<span class="gev-voice-card-kicker">{{ t('VOICE') }}</span>
<span id="gev-voice-card-phase" class="gev-voice-card-phase">{{ card.phase }}</span>
<button id="gev-voice-card-dismiss" class="gev-voice-card-dismiss" type="button" :aria-label="t('Dismiss voice card')" @click="emit('dismiss')">×</button>
<UiCloseButton id="gev-voice-card-dismiss" class="gev-voice-card-dismiss" :label="t('Dismiss voice card')" @click="emit('dismiss')" />
</div>
<p id="gev-voice-card-user" class="gev-voice-card-caption" data-role="user" :hidden="!card.user.visible"><span id="gev-voice-card-user-who" class="gev-voice-card-who">{{ card.user.label }}</span><span id="gev-voice-card-user-text" class="gev-voice-card-text">{{ card.user.text }}</span></p>
<p id="gev-voice-card-pointer" class="gev-voice-card-pointer" :hidden="!card.pointer.visible"><span id="gev-voice-card-pointer-kind" class="gev-voice-card-who">{{ card.pointer.kind }}</span><span class="gev-voice-card-sr">: </span><span id="gev-voice-card-pointer-text" class="gev-voice-card-pointer-label">{{ card.pointer.text }}</span></p>
+2 -1
View File
@@ -9,6 +9,7 @@ import VoiceVisualizer from './VoiceVisualizer.vue';
import ChatPanel from './ChatPanel.vue';
import PanelLayoutButtons from './PanelLayoutButtons.vue';
import UiButton from '../../kit/UiButton.vue';
import UiCloseButton from '../../kit/UiCloseButton.vue';
import UiSelect from '../../kit/UiSelect.js';
// The voice control in the command dock, as its presenter
@@ -107,7 +108,7 @@ const frameStyle = (panel) => ({
<button id="gev-voice-settings-tab" class="gev-voice-panel-tab" type="button" role="tab" :aria-label="t('Settings')" :title="t('Settings')" :aria-selected="String(view.voicePanel.selected === 'settings')" :tabindex="view.voicePanel.selected === 'settings' ? 0 : -1" aria-controls="gev-voice-settings-panel" @click="emit('tab', 1)" @keydown="emit('tab-keydown', 1, $event)"><span class="material-symbols-outlined gev-voice-panel-tab-icon" aria-hidden="true">settings</span></button>
</div>
<PanelLayoutButtons :docked="view.layout.docked" :minimized="view.voicePanel.minimized" @dock="emit('layout-dock')" @minimize="emit('voice-minimize')" />
<button id="gev-voice-settings-close" type="button" :aria-label="t('Close voice panel')" @click="emit('settings-close')">×</button>
<UiCloseButton id="gev-voice-settings-close" :label="t('Close voice panel')" @click="emit('settings-close')" />
</div>
<div class="gev-voice-mini" role="group" :aria-label="t('Latest voice exchange')">
<p :hidden="!view.mini.user"><span class="gev-voice-mini-who">{{ t('YOU') }}</span><span id="gev-voice-mini-user">{{ view.mini.user }}</span></p>
+3 -2
View File
@@ -3,6 +3,7 @@ import { computed, shallowRef, useTemplateRef, watch } from 'vue';
import { formatDate, t, translateKnown } from '../../../i18n/index.js';
import { photoCreator, formatAge } from '../../../layers/wildlifeSightings/photoText.js';
import { ACARTIA_SITE, inatLicenceLabel, inatPhotoUrl, isOpenPhoto } from '../../../layers/wildlifeSightings/records.js';
import UiCloseButton from '../../kit/UiCloseButton.vue';
const props = defineProps({
sighting: { type: Object, required: true },
@@ -71,7 +72,7 @@ watch([() => props.sighting.stableId, () => photo.value?.src], () => { loaded.va
<template>
<section class="wildlife-sighting-card" data-wildlife-sighting-card tabindex="-1" :aria-label="name" @keydown.stop @keyup.stop>
<button type="button" class="wildlife-sighting-card-close" :aria-label="t('Close sighting')" @click="emit('close')">×</button>
<UiCloseButton class="wildlife-sighting-card-close" :label="t('Close sighting')" @click="emit('close')" />
<component :is="link ? 'a' : 'div'" class="wildlife-sighting-card-content" :href="link || undefined" :target="link ? '_blank' : undefined" :rel="link ? 'noopener noreferrer' : undefined" :aria-label="link ? actionLabel : undefined">
<div v-if="photo" class="wildlife-sighting-card-photo" :aria-busy="!loaded && !failed">
<p v-if="!loaded && !failed" role="status">{{ t('Loading photo...') }}</p>
@@ -115,7 +116,7 @@ watch([() => props.sighting.stableId, () => photo.value?.src], () => { loaded.va
.wildlife-sighting-card-content:focus-visible { outline: 2px solid var(--text-primary); outline-offset: 3px; }
/* Script focus starts inside the card; tab focus still outlines its controls. */
.wildlife-sighting-card:focus-visible { outline: none !important; }
.wildlife-sighting-card-close { position: absolute; z-index: 1; inset-block-start: 4px; inset-inline-end: 4px; width: 24px; height: 24px; padding: 0; border: 0; border-radius: var(--btn-radius); background: transparent; color: inherit; font: 20px/1 var(--font-sans); cursor: pointer; }
.wildlife-sighting-card-close { position: absolute; z-index: 1; inset-block-start: 4px; inset-inline-end: 4px; width: 24px; height: 24px; border-radius: var(--btn-radius); color: inherit; font: 20px/1 var(--font-sans); }
.wildlife-sighting-card-close:hover { background: var(--menu-bg); }
.wildlife-sighting-card-close:focus-visible { outline: 2px solid var(--text-primary); outline-offset: 2px; }
.wildlife-sighting-card-photo { position: relative; width: 100%; height: 180px; }
+1
View File
@@ -1,6 +1,7 @@
/* Preserve component and responsive rule order in one stylesheet entry. */
@import './src/ui/styles/foundation.css';
@import './src/ui/styles/action-button.css';
@import './src/ui/styles/close-button.css';
@import './src/ui/styles/form-field.css';
@import './src/ui/styles/status-badge.css';
@import './src/ui/styles/chip.css';