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:
Sameh KhamisandManjunath Paparaju committed 2026-11-18 23:42:55 -08:00
1 parent ec1fc6bc09
commit 9f8a4cb39d
22 files changed
+363 -61

No files matched your search

+31 -5
View File
@@ -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="