mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-19 09:42:21 +00:00
Vue kit: the kit's classes wear Core's standard looks
UiButton gains styled variants beside the unstyled default ghost: action (the gev-action-button surface, tone="danger" and size="compact"), primary (that surface with the scene panel's main-action accent) and icon (the panel collapse toggle's square glyph button). A pressed styled button looks as a hovered one does. UiChip wears the read-only chip (now chip.css, shared with the news chips), UiEmpty the one-line empty state (now empty-state.css, shared with the news readout), and UiBadge and UiSegmented carry their skins through the kit's own classes too. Every kit selector shares one selector list with the Core skin it comes from, in skins loaded before the feature stylesheets, so no rule is copied and feature classes still win. The app renders as before: the voice card chip and the Recent Imagery and Authoring empty states keep their own type by inheriting it, and the dock pin buttons drop variant="icon", which they never wore. kitStyles.test.mjs pins the shared rules. Co-authored-by: Manjunath Paparaju <[email protected]>
This commit is contained in:
1 parent
ec1fc6bc09
commit
9f8a4cb39d
22 files changed
+363
-61
No files matched your search
+20
-3
@@ -42,9 +42,26 @@ one-panel rule too. Share links continue to record which panels are open.
|
||||
are converted. One component
|
||||
serves every use of a control, with props for the differences (`UiPanel`'s
|
||||
`sideways`, `glow`, `scroll`), rather than a copy per panel. The components
|
||||
are styled by the existing stylesheet and custom properties; a kit class such as
|
||||
`ui-button--icon` carries no Core style yet, and a converted control keeps
|
||||
its own classes beside it. They contain no application state.
|
||||
are styled by the existing stylesheet and custom properties, and they contain
|
||||
no application state. The kit's own classes wear Core's standard looks, each
|
||||
sharing one selector list with the Core skin it comes from, so the rules are
|
||||
never copied:
|
||||
|
||||
| Kit class | Look | Rules |
|
||||
| --- | --- | --- |
|
||||
| `UiButton` `variant="ghost"` (default) | none: the caller's classes style it | — |
|
||||
| `UiButton` `variant="action"` | the action surface (`gev-action-button`); `tone="danger"` hovers red, `size="compact"` is the shot-row footprint | `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` |
|
||||
| `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` |
|
||||
| `UiSegmented` | the segmented control (`gev-segmented`, `gev-segment`) | `src/ui/styles/segmented-control.css` |
|
||||
|
||||
A pressed action, primary or icon button looks as a hovered one does. Each
|
||||
look's resting rule selects one kit class, in a skin loaded before the feature
|
||||
stylesheets, so a feature class still wins; and a converted control keeps its own classes
|
||||
beside the kit's. `src/ui/kit/kitStyles.test.mjs` pins these rules.
|
||||
`UiPanel` takes a `title`, slots and `v-model:collapsed`, but its
|
||||
`collapsed` drives only the button and `ui-panel--collapsed`: the root's
|
||||
`collapsed` class, which hides the body, is drawn at once by `v-panel-state`
|
||||
|
||||
@@ -1328,6 +1328,9 @@
|
||||
"src/ui/kit/UiBadge.vue",
|
||||
"src/ui/kit/UiBadge.test.mjs",
|
||||
"src/ui/kit/UiEmpty.vue",
|
||||
"src/ui/kit/kitStyles.test.mjs",
|
||||
"src/ui/styles/chip.css",
|
||||
"src/ui/styles/empty-state.css",
|
||||
"src/ui/rail/RailChips.vue",
|
||||
"src/ui/displayPanelActions.test.mjs",
|
||||
"src/testSupport/vueDom.mjs",
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
<script setup>
|
||||
// Core's read-only badge, with a `tone` and the kit's classes. It carries Core's `gev-status-badge` class, and
|
||||
// callers add its density variants (`gev-status-badge--box`, `--plain`) and
|
||||
// the feature classes that colour it; the kit classes carry no Core styles
|
||||
// yet. Not mirrored yet: pulse, busy, the tone glyphs and the clipped title.
|
||||
// Core's read-only badge, with a `tone` and the kit's classes. `ui-badge`
|
||||
// wears Core's badge (status-badge.css) beside Core's `gev-status-badge`
|
||||
// class; callers add its density variants (`gev-status-badge--box`,
|
||||
// `--plain`) and the feature classes that colour it. The tone classes carry
|
||||
// no style yet. Not mirrored yet: pulse, busy, the tone glyphs and the
|
||||
// clipped title.
|
||||
defineProps({
|
||||
tone: { type: String, default: 'neutral' },
|
||||
});
|
||||
|
||||
@@ -100,3 +100,50 @@ test('server-rendered markup carries the pressed classes', async () => {
|
||||
assert.match(html, /<button[^>]*class="[^"]*\bactive\b[^"]*"/);
|
||||
assert.match(html, /aria-pressed="true"/);
|
||||
});
|
||||
|
||||
const LOOKS = [
|
||||
'ui-button--action',
|
||||
'ui-button--primary',
|
||||
'ui-button--icon',
|
||||
'ui-button--compact',
|
||||
];
|
||||
|
||||
test('a ghost button, the default, carries no look of the kit’s', () => {
|
||||
const wrapper = mountButton({}, { class: 'pp-toggle-btn' });
|
||||
const classes = wrapper.get('button').classes();
|
||||
assert.ok(classes.includes('ui-button--ghost'));
|
||||
for (const look of LOOKS) assert.equal(classes.includes(look), false, look);
|
||||
wrapper.unmount();
|
||||
});
|
||||
|
||||
test('the variant, tone and size render their kit classes', async () => {
|
||||
const wrapper = mountButton({ variant: 'action', tone: 'danger' });
|
||||
const button = wrapper.get('button');
|
||||
assert.ok(button.classes().includes('ui-button--action'));
|
||||
assert.ok(button.classes().includes('ui-button--danger'));
|
||||
assert.equal(button.classes().includes('ui-button--compact'), false);
|
||||
await wrapper.setProps({ size: 'compact' });
|
||||
assert.ok(button.classes().includes('ui-button--compact'));
|
||||
for (const variant of ['primary', 'icon']) {
|
||||
await wrapper.setProps({ variant });
|
||||
assert.ok(button.classes().includes(`ui-button--${variant}`));
|
||||
assert.equal(button.classes().includes('ui-button--action'), false);
|
||||
}
|
||||
wrapper.unmount();
|
||||
});
|
||||
|
||||
test('a styled variant still presses', async () => {
|
||||
const wrapper = mountButton({
|
||||
variant: 'action',
|
||||
pressed: false,
|
||||
pressedClass: 'active',
|
||||
});
|
||||
const button = wrapper.get('button');
|
||||
assert.equal(button.attributes('aria-pressed'), 'false');
|
||||
await wrapper.setProps({ pressed: true });
|
||||
assert.equal(button.attributes('aria-pressed'), 'true');
|
||||
assert.ok(button.classes().includes('ui-button--pressed'));
|
||||
assert.ok(button.classes().includes('ui-button--action'));
|
||||
assert.ok(button.classes().includes('active'));
|
||||
wrapper.unmount();
|
||||
});
|
||||
+31
-5
@@ -4,9 +4,19 @@ import { vClassToggle } from '../rail/classToggle.js';
|
||||
|
||||
// Core's button and its attribute contract: the button is always the root,
|
||||
// attributes passed in win over its own (a `title` replaces the label's), and
|
||||
// `pressed` renders aria-pressed only when it is passed. Core styles the
|
||||
// button through the classes its callers pass; the kit classes carry no Core
|
||||
// styles yet. Core adds `pressedClass`, its class on a pressed button (most
|
||||
// `pressed` renders aria-pressed only when it is passed. The variant picks
|
||||
// the look:
|
||||
// - `ghost` (the default) carries no style; the caller's classes style it.
|
||||
// - `action` wears Core's action surface (action-button.css), with
|
||||
// `tone="danger"` for a red hover and `size="compact"` for the smaller
|
||||
// shot-row footprint.
|
||||
// - `primary` is that surface with the accent emphasis of a group's one main
|
||||
// action (action-button.css).
|
||||
// - `icon` is the 22px square glyph button of a panel's collapse toggle
|
||||
// (controls.css).
|
||||
// A pressed action, primary or icon button looks as a hovered one does. Each
|
||||
// resting rule selects one kit class, so a feature class loaded later still
|
||||
// wins. Core adds `pressedClass`, its class on a pressed button (most
|
||||
// toggles use `active`). The pressed classes toggle through `classList`, so
|
||||
// classes other code adds to the button (a voice highlight) survive a press.
|
||||
// Not mirrored yet: icon, loading, disabledReason and the missing-label
|
||||
@@ -14,8 +24,20 @@ import { vClassToggle } from '../rail/classToggle.js';
|
||||
defineOptions({ inheritAttrs: false });
|
||||
|
||||
const props = defineProps({
|
||||
variant: { type: String, default: 'ghost' },
|
||||
variant: {
|
||||
type: String,
|
||||
default: 'ghost',
|
||||
validator: (value) =>
|
||||
['ghost', 'action', 'primary', 'icon'].includes(value),
|
||||
},
|
||||
/** `accent`, or `danger` for an action that destroys or stops. */
|
||||
tone: { type: String, default: 'accent' },
|
||||
/** `compact` for an action's smaller footprint. */
|
||||
size: {
|
||||
type: String,
|
||||
default: 'regular',
|
||||
validator: (value) => ['regular', 'compact'].includes(value),
|
||||
},
|
||||
/** The accessible name (aria-label) and, with nativeTitle, the tip. */
|
||||
label: { type: String, default: undefined },
|
||||
pressed: { type: Boolean, default: undefined },
|
||||
@@ -53,7 +75,11 @@ const vPressedClasses = {
|
||||
:type="props.type"
|
||||
:form="props.form"
|
||||
class="ui-button ui-focus"
|
||||
:class="[`ui-button--${props.variant}`, `ui-button--${props.tone}`]"
|
||||
:class="[
|
||||
`ui-button--${props.variant}`,
|
||||
`ui-button--${props.tone}`,
|
||||
{ 'ui-button--compact': props.size === 'compact' },
|
||||
]"
|
||||
:aria-label="props.label"
|
||||
:title="props.nativeTitle ? props.label : undefined"
|
||||
:aria-pressed="
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
<script setup>
|
||||
// Core's chip: a label that says what something is, never a control.
|
||||
// Core styles it through the classes its callers pass; the kit classes carry
|
||||
// no Core styles yet. A chip that presses is a UiButton with pressedClass.
|
||||
// Core's chip: a label that says what something is, never a control. It
|
||||
// wears Core's read-only chip (chip.css: a pill of small uppercase mono
|
||||
// text), and `selected` its accent; feature classes the caller passes
|
||||
// restyle it. A chip that presses is a UiButton with pressedClass.
|
||||
defineProps({
|
||||
selected: { type: Boolean, default: false },
|
||||
mono: { type: Boolean, default: false },
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
<script setup>
|
||||
// Core's empty state, with a `title` and `hint`. Core's empty states are one
|
||||
// line, so the title is the text itself rather than a bold heading; a hint
|
||||
// follows it. Core
|
||||
// styles it through the classes its callers pass. Not mirrored yet: icon.
|
||||
// follows it on a line of its own. It wears Core's empty line
|
||||
// (empty-state.css: dim 10px mono text); feature classes the caller passes
|
||||
// restyle it. Not mirrored yet: icon.
|
||||
defineProps({
|
||||
title: { type: String, required: true },
|
||||
hint: { type: String, default: undefined },
|
||||
|
||||
@@ -7,7 +7,9 @@ import { computed } from 'vue';
|
||||
// stop that arrows move) or `radio` (arrows plus Home and
|
||||
// End). Each option may carry `attrs` (an id, data attributes, a tip), and
|
||||
// Core's classes sit beside the kit's: `gev-segmented`, `gev-segment` and the
|
||||
// selected option's `activeClass`. An option with an `icon` shows the glyph,
|
||||
// selected option's `activeClass`. The kit's classes wear Core's segmented
|
||||
// skin (segmented-control.css) as Core's do; `stacked` carries no style yet.
|
||||
// An option with an `icon` shows the glyph,
|
||||
// and its label becomes the button's accessible name and tooltip, unless its
|
||||
// `attrs` carry a tip of their own.
|
||||
const props = defineProps({
|
||||
|
||||
@@ -0,0 +1,135 @@
|
||||
// The kit's classes wear Core's standard looks: each shares one selector list
|
||||
// with the Core skin it comes from, so the rules are never copied, and the
|
||||
// default ghost button carries none.
|
||||
import { test } from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { readStylesheet } from '../../testSupport/readStylesheet.mjs';
|
||||
|
||||
const css = readStylesheet(new URL('../../../style.css', import.meta.url));
|
||||
|
||||
/** Each rule's selectors, outside @media and other at-rule preludes. */
|
||||
function rules(source) {
|
||||
const out = [];
|
||||
const re = /([^{}]+)\{([^{}]*)\}/g;
|
||||
const bare = source.replace(/\/\*[\s\S]*?\*\//g, '');
|
||||
let match;
|
||||
while ((match = re.exec(bare))) {
|
||||
const prelude = match[1].split('}').pop().trim();
|
||||
if (prelude.startsWith('@')) continue;
|
||||
out.push({
|
||||
selectors: prelude.split(',').map((s) => s.replace(/\s+/g, ' ').trim()),
|
||||
body: match[2],
|
||||
});
|
||||
}
|
||||
return out;
|
||||
}
|
||||
const all = rules(css);
|
||||
|
||||
/** The rule that lists exactly `selector`, which must exist. */
|
||||
function ruleWith(selector) {
|
||||
const found = all.filter((rule) => rule.selectors.includes(selector));
|
||||
assert.equal(found.length, 1, `one rule lists ${selector}`);
|
||||
return found[0];
|
||||
}
|
||||
|
||||
/** `kit` and `core` share one rule, so the kit wears Core's skin unchanged. */
|
||||
function shares(kit, core) {
|
||||
const rule = ruleWith(kit);
|
||||
assert.ok(rule.selectors.includes(core), `${kit} shares ${core}'s rule`);
|
||||
return rule;
|
||||
}
|
||||
|
||||
test('UiButton variants wear Core’s action and icon skins', () => {
|
||||
shares('.ui-button--action', '.gev-action-button');
|
||||
shares('.ui-button--primary', '.gev-action-button');
|
||||
shares(
|
||||
'.ui-button--action:hover:not(:disabled)',
|
||||
'.gev-action-button:hover:not(:disabled)',
|
||||
);
|
||||
shares('.ui-button--action:disabled', '.gev-action-button:disabled');
|
||||
shares(
|
||||
'.ui-button--action.ui-button--danger:hover:not(:disabled)',
|
||||
'.gev-action-button--danger:hover:not(:disabled)',
|
||||
);
|
||||
shares(
|
||||
'.ui-button--primary:where(:not(:disabled))',
|
||||
'#scene-panel .scene-btn-primary:not(:disabled)',
|
||||
);
|
||||
shares('.ui-button--compact', '.gev-action-button--compact');
|
||||
shares(
|
||||
'.ui-button--compact.ui-button--danger:hover:not(:disabled)',
|
||||
'.gev-action-button--compact.gev-action-button--danger:hover:not(:disabled)',
|
||||
);
|
||||
shares('.ui-button--icon', '.panel-collapse-btn');
|
||||
shares('.ui-button--icon:hover', '.panel-collapse-btn:hover');
|
||||
});
|
||||
|
||||
test('a pressed styled button looks as a hovered one does', () => {
|
||||
shares(
|
||||
'.ui-button--action.ui-button--pressed:not(:disabled)',
|
||||
'.gev-action-button:hover:not(:disabled)',
|
||||
);
|
||||
shares(
|
||||
'.ui-button--primary.ui-button--pressed:not(:disabled)',
|
||||
'.gev-action-button:hover:not(:disabled)',
|
||||
);
|
||||
shares(
|
||||
'.ui-button--action.ui-button--danger.ui-button--pressed:not(:disabled)',
|
||||
'.gev-action-button--danger:hover:not(:disabled)',
|
||||
);
|
||||
shares('.ui-button--icon.ui-button--pressed', '.panel-collapse-btn:hover');
|
||||
});
|
||||
|
||||
test('a ghost button and the tones alone carry no style', () => {
|
||||
const kitButton =
|
||||
/\.ui-button(?:--(?:ghost|accent|danger|alert|pressed))?(?![\w-])/;
|
||||
const look = /\.ui-button--(?:action|primary|icon|compact)(?![\w-])/;
|
||||
for (const rule of all)
|
||||
for (const selector of rule.selectors)
|
||||
assert.ok(
|
||||
!kitButton.test(selector) || look.test(selector),
|
||||
`${selector} styles a kit button without a look`,
|
||||
);
|
||||
});
|
||||
|
||||
test('UiChip, UiEmpty, UiBadge and UiSegmented wear Core’s skins', () => {
|
||||
shares('.ui-chip', '.news-chip');
|
||||
shares('.ui-chip--selected', '.news-chip--official');
|
||||
shares('.ui-empty', '.news-readout__empty');
|
||||
assert.match(ruleWith('.ui-empty__hint').body, /display:\s*block/);
|
||||
shares('.ui-badge', '.gev-status-badge');
|
||||
shares('.ui-badge[hidden]', '.gev-status-badge[hidden]');
|
||||
shares('.ui-segmented', '.gev-segmented');
|
||||
shares('.ui-segmented[hidden]', '.gev-segmented[hidden]');
|
||||
shares('.ui-segmented__item', '.gev-segment');
|
||||
shares(
|
||||
'.ui-segmented__item + .ui-segmented__item',
|
||||
'.gev-segment + .gev-segment',
|
||||
);
|
||||
shares(
|
||||
".ui-segmented__item[aria-checked='true']",
|
||||
".gev-segment[aria-checked='true']",
|
||||
);
|
||||
shares(
|
||||
'.ui-segmented__item:hover:not(:disabled)',
|
||||
'.gev-segment:hover:not(:disabled)',
|
||||
);
|
||||
shares('.ui-segmented__item:focus-visible', '.gev-segment:focus-visible');
|
||||
shares('.ui-segmented__item:disabled', '.gev-segment:disabled');
|
||||
});
|
||||
|
||||
test('the kit’s skins load before the feature stylesheets that restyle them', () => {
|
||||
const at = (selector) => css.indexOf(selector);
|
||||
for (const [kit, feature] of [
|
||||
['.ui-chip,', '.gev-voice-card-chip {'],
|
||||
['.ui-empty,', '.scene-shot-empty {'],
|
||||
['.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'],
|
||||
]) {
|
||||
assert.ok(
|
||||
at(kit) >= 0 && at(feature) > at(kit),
|
||||
`${kit} loads before ${feature}`,
|
||||
);
|
||||
}
|
||||
});
|
||||
@@ -130,8 +130,9 @@ test('a collapsed launcher drops its divider so English titles fit whole', () =>
|
||||
/margin-left:\s*auto/,
|
||||
'the launcher toggle',
|
||||
);
|
||||
const button = rules.find(
|
||||
({ selector }) => selector === '.panel-collapse-btn',
|
||||
// The kit's icon button shares the toggle's rule.
|
||||
const button = rules.find(({ selector }) =>
|
||||
selector.split(', ').includes('.panel-collapse-btn'),
|
||||
);
|
||||
assert.match(
|
||||
button?.body || '',
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
/* Ordinary actions share one surface; feature classes own placement and width.
|
||||
* Legacy scene-btn hooks keep untouched toggles/Street Level controls stable. */
|
||||
* Legacy scene-btn hooks keep untouched toggles/Street Level controls stable.
|
||||
* The kit's UiButton wears it as variant="action" (.ui-button--action) and
|
||||
* variant="primary" (.ui-button--primary); its resting rules select one kit
|
||||
* class, so a feature class loaded later still wins. */
|
||||
.ui-button--action,
|
||||
.ui-button--primary,
|
||||
.gev-action-button,
|
||||
.scene-btn {
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
@@ -19,6 +24,11 @@
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* A pressed kit action looks as a hovered one does. */
|
||||
.ui-button--action:hover:not(:disabled),
|
||||
.ui-button--primary:hover:not(:disabled),
|
||||
.ui-button--action.ui-button--pressed:not(:disabled),
|
||||
.ui-button--primary.ui-button--pressed:not(:disabled),
|
||||
.gev-action-button:hover:not(:disabled),
|
||||
.scene-btn:hover:not(:disabled) {
|
||||
color: var(--accent);
|
||||
@@ -26,12 +36,17 @@
|
||||
background: rgba(0, 212, 255, 0.14);
|
||||
}
|
||||
|
||||
.ui-button--action:disabled,
|
||||
.ui-button--primary:disabled,
|
||||
.gev-action-button:disabled,
|
||||
.scene-btn:disabled {
|
||||
opacity: 0.45;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
/* tone="danger". */
|
||||
.ui-button--action.ui-button--danger:hover:not(:disabled),
|
||||
.ui-button--action.ui-button--danger.ui-button--pressed:not(:disabled),
|
||||
.gev-action-button--danger:hover:not(:disabled),
|
||||
.scene-btn-danger:hover:not(:disabled) {
|
||||
color: #ff7272;
|
||||
@@ -39,7 +54,19 @@
|
||||
background: rgba(255, 88, 88, 0.15);
|
||||
}
|
||||
|
||||
/* Shot-row actions retain their smaller footprint and quieter hover treatment. */
|
||||
/* One primary action per group: Authoring's CAPTURE SHOT and PLAY. The panel
|
||||
id keeps those above the shared surface; scenes.css keeps their hover. The
|
||||
kit selector stays at one class's weight. */
|
||||
.ui-button--primary:where(:not(:disabled)),
|
||||
#scene-panel .scene-btn-primary:not(:disabled) {
|
||||
color: var(--accent);
|
||||
border-color: color-mix(in srgb, var(--accent) 55%, transparent);
|
||||
background: color-mix(in srgb, var(--accent) 10%, transparent);
|
||||
}
|
||||
|
||||
/* Shot-row actions retain their smaller footprint and quieter hover treatment
|
||||
(size="compact"). */
|
||||
.ui-button--compact,
|
||||
.gev-action-button--compact {
|
||||
border-radius: 6px;
|
||||
font-size: 8px;
|
||||
@@ -47,12 +74,15 @@
|
||||
padding: 4px 6px;
|
||||
}
|
||||
|
||||
/* A pressed compact action keeps its pressed look under the pointer. */
|
||||
.ui-button--compact:hover:not(:disabled):not(.ui-button--pressed),
|
||||
.gev-action-button--compact:hover:not(:disabled) {
|
||||
color: var(--text-primary);
|
||||
border-color: var(--glass-border-hover);
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
}
|
||||
|
||||
.ui-button--compact.ui-button--danger:hover:not(:disabled),
|
||||
.gev-action-button--compact.gev-action-button--danger:hover:not(:disabled) {
|
||||
color: #ff7e7e;
|
||||
border-color: #ff7e7e;
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
/* Read-only chips: a label that says what something is, never a control (a
|
||||
chip that presses is a button). The kit's UiChip (.ui-chip) and the news
|
||||
cards' chips wear it; feature classes loaded later restyle it. */
|
||||
.ui-chip,
|
||||
.news-chip {
|
||||
padding: 2px 7px;
|
||||
border: 1px solid var(--glass-border-hover);
|
||||
border-radius: 999px;
|
||||
color: var(--text-secondary);
|
||||
font: 8px var(--font-mono);
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
/* A selected chip takes the accent of the read-only badge (status-badge.css);
|
||||
news marks official and confirmed reports this way. */
|
||||
.ui-chip--selected,
|
||||
.news-chip--official,
|
||||
.news-chip--confirmed {
|
||||
border-color: rgba(0, 212, 255, 0.32);
|
||||
background: rgba(0, 212, 255, 0.09);
|
||||
color: #9defff;
|
||||
}
|
||||
@@ -186,6 +186,9 @@ html:not([lang='en']):not(:lang(zh)):not(:lang(ja))
|
||||
background: linear-gradient(to right, var(--glass-border), transparent);
|
||||
}
|
||||
|
||||
/* A panel's collapse toggle, and the kit's square glyph button
|
||||
(UiButton variant="icon"). */
|
||||
.ui-button--icon,
|
||||
.panel-collapse-btn {
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
@@ -205,6 +208,9 @@ html:not([lang='en']):not(:lang(zh)):not(:lang(ja))
|
||||
color var(--transition-fast);
|
||||
}
|
||||
|
||||
/* A pressed kit icon button looks as a hovered one does. */
|
||||
.ui-button--icon:hover,
|
||||
.ui-button--icon.ui-button--pressed,
|
||||
.panel-collapse-btn:hover {
|
||||
border-color: var(--glass-border-hover);
|
||||
color: var(--text-primary);
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
/* A one-line empty state: dim mono text where a list would be. The kit's
|
||||
UiEmpty (.ui-empty) and the news readout's empty and status lines wear it;
|
||||
feature classes loaded later restyle it. */
|
||||
.ui-empty,
|
||||
.news-readout__empty,
|
||||
.news-readout__status {
|
||||
color: var(--text-dim);
|
||||
font: 10px var(--font-mono);
|
||||
}
|
||||
|
||||
/* The next step (a missing key's), under what it holds back. */
|
||||
.ui-empty__hint {
|
||||
display: block;
|
||||
margin-top: 2px;
|
||||
}
|
||||
+2
-26
@@ -163,16 +163,6 @@
|
||||
.news-readout__list.is-stale {
|
||||
opacity: 0.5;
|
||||
}
|
||||
.news-readout__status,
|
||||
.news-readout__empty {
|
||||
color: var(--text-dim);
|
||||
font: 10px var(--font-mono);
|
||||
}
|
||||
/* A missing key's next step, under what it holds back. */
|
||||
.news-readout__empty .ui-empty__hint {
|
||||
display: block;
|
||||
margin-top: 2px;
|
||||
}
|
||||
.news-readout__footer {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -327,22 +317,8 @@
|
||||
flex-wrap: wrap;
|
||||
gap: 4px;
|
||||
}
|
||||
/* GEV's read-only badge (status-badge.css), neutral unless attested. */
|
||||
.news-chip {
|
||||
padding: 2px 7px;
|
||||
border: 1px solid var(--glass-border-hover);
|
||||
border-radius: 999px;
|
||||
color: var(--text-secondary);
|
||||
font: 8px var(--font-mono);
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
.news-chip--official,
|
||||
.news-chip--confirmed {
|
||||
border-color: rgba(0, 212, 255, 0.32);
|
||||
background: rgba(0, 212, 255, 0.09);
|
||||
color: #9defff;
|
||||
}
|
||||
/* A report's chips wear the shared chip (chip.css), neutral unless attested;
|
||||
a claim is dashed. */
|
||||
.news-chip--claimed {
|
||||
border-style: dashed;
|
||||
}
|
||||
|
||||
@@ -175,7 +175,11 @@
|
||||
.recent-imagery-readout .ri-strip.searching {
|
||||
opacity: 0.7;
|
||||
}
|
||||
/* A UiEmpty in the readout's own colour and type, not the shared empty
|
||||
line's (empty-state.css). */
|
||||
.recent-imagery-readout .ri-strip-empty {
|
||||
color: inherit;
|
||||
font: inherit;
|
||||
flex: 1 0 100%;
|
||||
align-self: center;
|
||||
text-align: center;
|
||||
|
||||
@@ -219,14 +219,6 @@ html:not([lang='en']) #scene-panel .scene-controls .scene-btn {
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
/* One primary action per step: CAPTURE SHOT and PLAY. The panel id keeps
|
||||
this above the shared button surface. */
|
||||
#scene-panel .scene-btn-primary:not(:disabled) {
|
||||
color: var(--accent);
|
||||
border-color: color-mix(in srgb, var(--accent) 55%, transparent);
|
||||
background: color-mix(in srgb, var(--accent) 10%, transparent);
|
||||
}
|
||||
|
||||
/* The file row is housekeeping; it stays quieter than the steps above. */
|
||||
#scene-panel .scene-file-controls .scene-btn {
|
||||
font-size: 9px;
|
||||
@@ -236,7 +228,8 @@ html:not([lang='en']) #scene-panel .scene-controls .scene-btn {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
/* Keep the shared hover on the restyled actions. */
|
||||
/* Keep the shared hover on the restyled actions; CAPTURE SHOT and PLAY take
|
||||
their resting emphasis from action-button.css. */
|
||||
#scene-panel .scene-btn-primary:hover:not(:disabled),
|
||||
#scene-panel .scene-file-controls .scene-btn:hover:not(:disabled) {
|
||||
color: var(--accent);
|
||||
@@ -337,6 +330,9 @@ html:not([lang='en']) #scene-panel .scene-controls .scene-btn {
|
||||
border-radius: 8px;
|
||||
padding: 16px 12px;
|
||||
text-align: center;
|
||||
/* A UiEmpty in the panel's weight, not the shared empty line's
|
||||
(empty-state.css). */
|
||||
font: inherit;
|
||||
font-family: var(--font-mono);
|
||||
font-size: 11px;
|
||||
letter-spacing: 0.3px;
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
/* Shared one-of-many control. Feature classes retain surrounding placement. */
|
||||
/* Shared one-of-many control. Feature classes retain surrounding placement.
|
||||
The kit's UiSegmented (.ui-segmented, .ui-segmented__item) wears it. */
|
||||
.ui-segmented,
|
||||
.gev-segmented {
|
||||
display: inline-flex;
|
||||
min-width: 0;
|
||||
@@ -6,9 +8,11 @@
|
||||
border-radius: 6px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.ui-segmented[hidden],
|
||||
.gev-segmented[hidden] {
|
||||
display: none;
|
||||
}
|
||||
.ui-segmented__item,
|
||||
.gev-segment {
|
||||
flex: 1;
|
||||
min-width: min-content;
|
||||
@@ -28,23 +32,28 @@
|
||||
background-color var(--transition-fast),
|
||||
color var(--transition-fast);
|
||||
}
|
||||
.ui-segmented__item + .ui-segmented__item,
|
||||
.gev-segment + .gev-segment {
|
||||
border-left: 1px solid var(--glass-border);
|
||||
}
|
||||
.ui-segmented__item:hover:not(:disabled),
|
||||
.gev-segment:hover:not(:disabled) {
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
color: var(--text-primary);
|
||||
}
|
||||
.ui-segmented__item[aria-checked='true'],
|
||||
.gev-segment[aria-checked='true'] {
|
||||
background: var(--accent);
|
||||
color: #000;
|
||||
}
|
||||
.ui-segmented__item:focus-visible,
|
||||
.gev-segment:focus-visible {
|
||||
position: relative;
|
||||
outline: 2px solid var(--text-primary);
|
||||
outline-offset: -3px;
|
||||
box-shadow: inset 0 0 0 4px #061014;
|
||||
}
|
||||
.ui-segmented__item:disabled,
|
||||
.gev-segment:disabled {
|
||||
opacity: 0.42;
|
||||
cursor: not-allowed;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
/* Read-only badges. Feature CSS supplies meaning through explicit colors;
|
||||
appearance variants change density/shape without interpreting status codes. */
|
||||
appearance variants change density/shape without interpreting status codes.
|
||||
The kit's UiBadge (.ui-badge) wears it. */
|
||||
.ui-badge,
|
||||
.gev-status-badge {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
@@ -38,6 +40,7 @@
|
||||
}
|
||||
|
||||
/* Explicitly beat the component display rule, including in older browsers. */
|
||||
.ui-badge[hidden],
|
||||
.gev-status-badge[hidden] {
|
||||
display: none;
|
||||
}
|
||||
@@ -240,11 +240,14 @@
|
||||
gap: 0.25rem;
|
||||
}
|
||||
|
||||
/* A UiChip in the card's own type: the card's line height and weight, not
|
||||
the shared chip's (chip.css). */
|
||||
.gev-voice-card-chip {
|
||||
padding: 0.08rem 0.3rem;
|
||||
color: var(--text-secondary);
|
||||
border: 1px solid rgba(54, 220, 255, 0.3);
|
||||
border-radius: 0.18rem;
|
||||
font: inherit;
|
||||
font-family: var(--font-mono);
|
||||
font-size: 0.44rem;
|
||||
letter-spacing: 0.06rem;
|
||||
|
||||
@@ -79,7 +79,7 @@ function selectMapSource(chip) {
|
||||
<span class="panel-divider"></span>
|
||||
</button>
|
||||
<div id="control-panel-popover" class="dock-popover-content">
|
||||
<UiButton variant="icon" class="dock-pin-btn" data-pin-target="control-panel" :label="t('Pin visual presets')" :title="t('Keep visual presets open')" :pressed="!!panels['control-panel']?.pinned" @click="pin($event, 'control-panel')"><img src="/pin.svg" alt="" /></UiButton>
|
||||
<UiButton class="dock-pin-btn" data-pin-target="control-panel" :label="t('Pin visual presets')" :title="t('Keep visual presets open')" :pressed="!!panels['control-panel']?.pinned" @click="pin($event, 'control-panel')"><img src="/pin.svg" alt="" /></UiButton>
|
||||
<div id="style-buttons" class="button-grid">
|
||||
<button class="style-btn active" data-style="normal" @click="display.act('setStyle', 'normal')" v-class-toggle="{ ...(style && { active: style.name === 'normal' }) }" :title="t('Show the globe without a visual filter.')">
|
||||
<span class="btn-icon">◯</span>
|
||||
@@ -144,7 +144,7 @@ function selectMapSource(chip) {
|
||||
<div id="location-mini-poi" class="location-mini-poi">{{ loc ? loc.status.poi : t('Landmark: --') }}</div>
|
||||
</div>
|
||||
<div id="location-bar-popover" class="dock-popover-content">
|
||||
<UiButton variant="icon" class="dock-pin-btn" data-pin-target="location-bar" :label="t('Pin location tray')" :title="t('Keep location tray open')" :pressed="!!panels['location-bar']?.pinned" @click="pin($event, 'location-bar')"><img src="/pin.svg" alt="" /></UiButton>
|
||||
<UiButton class="dock-pin-btn" data-pin-target="location-bar" :label="t('Pin location tray')" :title="t('Keep location tray open')" :pressed="!!panels['location-bar']?.pinned" @click="pin($event, 'location-bar')"><img src="/pin.svg" alt="" /></UiButton>
|
||||
<div id="poi-row" class="poi-row-container" v-class-toggle="{ expanded: !!loc?.poisExpanded }"><UiButton v-for="poi in loc?.pois" :key="`${loc.poiCity}:${poi.index}`" class="poi-pill" :pressed="Boolean(poi.active)" pressed-class="active" :data-poi-index="poi.index" @click="locationControls?.choosePoi(poi.index)"><span class="poi-pill-key">{{ poi.key }}</span><span class="poi-pill-name">{{ poi.name }}</span></UiButton></div>
|
||||
<div class="location-bar-divider" id="location-bar-divider" v-class-toggle="{ visible: !!loc?.poisExpanded }"></div>
|
||||
<div class="location-city-row">
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
@import './src/ui/styles/action-button.css';
|
||||
@import './src/ui/styles/form-field.css';
|
||||
@import './src/ui/styles/status-badge.css';
|
||||
@import './src/ui/styles/chip.css';
|
||||
@import './src/ui/styles/empty-state.css';
|
||||
@import './src/ui/styles/slider.css';
|
||||
@import './src/ui/styles/controls.css';
|
||||
@import './src/ui/styles/location.css';
|
||||
|
||||
Reference in new issue
Block a user