mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-19 09:42:21 +00:00
Merge pull request #1839 from bilawalsidhu/samehkhamis/kit-styles
Vue kit: the kit's classes carry Core's standard looks
This commit is contained in:
25 files changed
+433
-67
No files matched your search
@@ -0,0 +1,4 @@
|
||||
- The Vue kit's button, chip, badge, empty state and segmented control now
|
||||
carry Core's standard looks, so controls can be built from the kit without
|
||||
restyling them; nothing in the app changes look (manjunath22466,
|
||||
samehkhamis, #1839).
|
||||
+27
-5
@@ -42,9 +42,31 @@ 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 (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` |
|
||||
| `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 regular one does
|
||||
(a compact action's quieter hover is for an unpressed button), and a disabled
|
||||
one dims and ignores hover and press. `tone` is `accent` or `danger`, and
|
||||
`size` styles the action variant only. Each look's resting rule selects one
|
||||
kit class; the button, chip and empty-state skins load before the feature
|
||||
stylesheets that restyle them, so a feature class still wins. The badge and
|
||||
segmented skins are the stylesheets their Core classes always used. 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`
|
||||
@@ -74,8 +96,8 @@ gain) takes `hold`. Every select in the views is a `UiSelect`.
|
||||
density variants and colours stay caller classes, and it renders the CCTV
|
||||
source and calibration badges and the rail card badges. `UiEmpty` takes
|
||||
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 Scene shot list, mission
|
||||
roster and imagery strip use it. The locale picker's and the mission tables'
|
||||
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.
|
||||
`UiSlider` keeps the native range input rather than drawing a
|
||||
`role="slider"` track, so Core's keyboard, form behaviour and styling stay;
|
||||
|
||||
@@ -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();
|
||||
});
|
||||
+39
-6
@@ -4,9 +4,22 @@ 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 regular one
|
||||
// does (a compact action's quieter hover is for an unpressed button); a
|
||||
// disabled one dims and ignores hover and press. `size` styles the action
|
||||
// variant only. 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 +27,24 @@ import { vClassToggle } from '../rail/classToggle.js';
|
||||
defineOptions({ inheritAttrs: false });
|
||||
|
||||
const props = defineProps({
|
||||
variant: { type: String, default: 'ghost' },
|
||||
tone: { type: String, default: 'accent' },
|
||||
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',
|
||||
validator: (value) => ['accent', 'danger'].includes(value),
|
||||
},
|
||||
/** `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 +82,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,172 @@
|
||||
// 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, ' ')
|
||||
.replace(/\( /g, '(')
|
||||
.replace(/ \)/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:where(.ui-button--action)',
|
||||
'.gev-action-button--compact',
|
||||
);
|
||||
shares(
|
||||
'.ui-button--compact:where(.ui-button--action):hover:not(:disabled):not(.ui-button--pressed)',
|
||||
'.gev-action-button--compact:hover:not(:disabled)',
|
||||
);
|
||||
shares(
|
||||
'.ui-button--compact.ui-button--danger:where(.ui-button--action):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:not(:disabled)', '.panel-collapse-btn:hover');
|
||||
assert.match(ruleWith('.ui-button--icon:disabled').body, /opacity:\s*0\.45/);
|
||||
});
|
||||
|
||||
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:not(:disabled)',
|
||||
'.panel-collapse-btn:hover',
|
||||
);
|
||||
});
|
||||
|
||||
test('a ghost button, the tones and the size alone carry no style', () => {
|
||||
const kitButton =
|
||||
/\.ui-button(?:--(?:ghost|accent|danger|pressed|compact))?(?![\w-])/;
|
||||
// size="compact" styles the action variant only.
|
||||
const look = /\.ui-button--(?:action|primary|icon)(?![\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}`,
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
test('feature rules over a kit skin keep the type they inherit', () => {
|
||||
// The chip and empty skins set a font and colour; these feature surfaces
|
||||
// inherit theirs from the card or strip around them.
|
||||
for (const [selector, property] of [
|
||||
['.gev-voice-card-chip', /font:\s*inherit/],
|
||||
['.scene-shot-empty', /font:\s*inherit/],
|
||||
['.recent-imagery-readout .ri-strip-empty', /font:\s*inherit/],
|
||||
['.recent-imagery-readout .ri-strip-empty', /color:\s*inherit/],
|
||||
])
|
||||
assert.ok(
|
||||
all.some(
|
||||
(rule) => rule.selectors.includes(selector) && property.test(rule.body),
|
||||
),
|
||||
`${selector} keeps ${property}`,
|
||||
);
|
||||
});
|
||||
@@ -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,12 @@
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* A pressed kit action looks as a hovered regular one does (a compact one
|
||||
too: its quieter hover below is for an unpressed button). */
|
||||
.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 +37,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 +55,20 @@
|
||||
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", on the action variant only: :where keeps the kit
|
||||
selector at one class's weight). */
|
||||
.ui-button--compact:where(.ui-button--action),
|
||||
.gev-action-button--compact {
|
||||
border-radius: 6px;
|
||||
font-size: 8px;
|
||||
@@ -47,12 +76,19 @@
|
||||
padding: 4px 6px;
|
||||
}
|
||||
|
||||
/* A pressed compact action keeps its pressed look under the pointer. */
|
||||
.ui-button--compact:where(.ui-button--action):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:where(.ui-button--action):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,12 +208,20 @@ 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:not(:disabled),
|
||||
.ui-button--icon.ui-button--pressed:not(:disabled),
|
||||
.panel-collapse-btn:hover {
|
||||
border-color: var(--glass-border-hover);
|
||||
color: var(--text-primary);
|
||||
background: rgba(255, 255, 255, 0.07);
|
||||
}
|
||||
|
||||
.ui-button--icon:disabled {
|
||||
opacity: 0.45;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
/* A side panel answers the pointer as the command dock's trays do: a
|
||||
brighter edge and an accent title and toggle. Touch screens have no hover,
|
||||
so a tap must not leave a panel lit. */
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -78,7 +78,7 @@ async function importChosen(event) {
|
||||
<div class="scene-controls">
|
||||
<UiSelect class="gev-field" id="scene-select" :aria-label="t('Scene')" :disabled="off('select')" @update:model-value="scenes.act('selectScene', $event)"><SceneOptions /></UiSelect>
|
||||
<UiButton id="scene-new-btn" type="button" :disabled="off('new')" @click="scenes.act('create')" class="gev-action-button scene-btn" :title="t('Start a new, empty scene')">{{ t('NEW SCENE') }}</UiButton>
|
||||
<UiButton tone="alert" id="scene-delete-btn" type="button" :disabled="off('delete')" @click="scenes.act('deleteScene')" class="gev-action-button gev-action-button--danger scene-btn scene-btn-danger" :title="t('Delete this scene and all of its shots')">{{ t('DELETE') }}</UiButton>
|
||||
<UiButton tone="danger" id="scene-delete-btn" type="button" :disabled="off('delete')" @click="scenes.act('deleteScene')" class="gev-action-button gev-action-button--danger scene-btn scene-btn-danger" :title="t('Delete this scene and all of its shots')">{{ t('DELETE') }}</UiButton>
|
||||
</div>
|
||||
<p class="scene-step-heading">{{ t('SHOTS') }}</p>
|
||||
<div class="scene-controls">
|
||||
@@ -90,7 +90,7 @@ async function importChosen(event) {
|
||||
<p class="scene-step-heading">{{ t('PREVIEW') }}</p>
|
||||
<div class="scene-controls">
|
||||
<UiButton variant="primary" id="scene-start-btn" type="button" class="gev-action-button scene-btn scene-btn-primary" :title="t('Play from this scene through the rest of the project')" :disabled="off('start')" @click="scenes.act('start')">{{ scene?.playLabel ?? t('PLAY', { context: 'scene' }) }}</UiButton>
|
||||
<UiButton tone="alert" id="scene-stop-btn" type="button" :disabled="off('stop')" @click="scenes.act('stop')" class="gev-action-button gev-action-button--danger scene-btn scene-btn-danger" :title="t('Stop playback (Esc)')">{{ t('STOP') }}</UiButton>
|
||||
<UiButton tone="danger" id="scene-stop-btn" type="button" :disabled="off('stop')" @click="scenes.act('stop')" class="gev-action-button gev-action-button--danger scene-btn scene-btn-danger" :title="t('Stop playback (Esc)')">{{ t('STOP') }}</UiButton>
|
||||
<UiButton id="scene-next-btn" type="button" :disabled="off('next')" @click="scenes.act('next')" class="gev-action-button scene-btn" :title="t('Play the shot after the selected one, moving on to the next scene when needed')">{{ t('NEXT') }}</UiButton>
|
||||
</div>
|
||||
<p class="scene-step-heading">{{ t('SAVE & SHARE') }}</p>
|
||||
|
||||
@@ -161,7 +161,7 @@ function onRenameKey(shot, event) {
|
||||
><UiIcon name="arrow_downward" :size="12"
|
||||
/></UiButton>
|
||||
<UiButton
|
||||
tone="alert"
|
||||
tone="danger"
|
||||
class="gev-action-button gev-action-button--danger gev-action-button--compact scene-shot-btn scene-shot-danger"
|
||||
@click="act('remove', shot)"
|
||||
>{{ t('DEL') }}</UiButton
|
||||
|
||||
@@ -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