Merge remote-tracking branch 'origin/main'
Docs / docs (push) Successful in 20s
Playwright Tests / test-playwright (1, 2) (push) Failing after 4m22s
Playwright Tests / test-playwright (2, 2) (push) Successful in 2m12s
pre-commit / pre-commit (push) Failing after 2m33s
Test Backend / test-backend (3.12) (push) Successful in 5m1s
Test Backend / test-backend (3.14) (push) Successful in 4m52s
Compose Smoke Test / test-compose (push) Successful in 33s
Playwright Tests / merge-reports (push) Successful in 1m32s
Docs / docs (push) Successful in 20s
Playwright Tests / test-playwright (1, 2) (push) Failing after 4m22s
Playwright Tests / test-playwright (2, 2) (push) Successful in 2m12s
pre-commit / pre-commit (push) Failing after 2m33s
Test Backend / test-backend (3.12) (push) Successful in 5m1s
Test Backend / test-backend (3.14) (push) Successful in 4m52s
Compose Smoke Test / test-compose (push) Successful in 33s
Playwright Tests / merge-reports (push) Successful in 1m32s
This commit is contained in:
@@ -425,7 +425,7 @@
|
||||
);
|
||||
--dui-reading: var(--foreground);
|
||||
--dui-reading-reached: var(--primary-foreground);
|
||||
--dui-reading-on-handle: var(--foreground);
|
||||
--dui-reading-on-handle: var(--dui-on-handle, var(--foreground));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -576,8 +576,9 @@
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
/* The rail comes before the input, so no sibling selector reaches it. */
|
||||
.dui-slider-input:disabled ~ .dui-slider-thumb,
|
||||
.dui-slider-input:disabled ~ .dui-slider-rail {
|
||||
.dui-slider:has(.dui-slider-input:disabled) .dui-slider-rail {
|
||||
opacity: 0.45;
|
||||
}
|
||||
|
||||
@@ -716,6 +717,12 @@
|
||||
line-height: 1.35;
|
||||
}
|
||||
|
||||
/* A press is a disc of a fixed size, as tall as the body, so there is no text
|
||||
to clip and its shadow falls outside the body by design. */
|
||||
.dui-face-body:has(> .dui-face-press) {
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.dui-face-body .dui-clock {
|
||||
font-size: 72px;
|
||||
line-height: 1;
|
||||
@@ -784,6 +791,47 @@
|
||||
outline: none;
|
||||
}
|
||||
|
||||
/*
|
||||
* The ring's paint. Each look states it on its root as these variables rather
|
||||
* than in rules under `[data-look]`: a round panel draws a dashboard beside
|
||||
* one in another look, and a descendant rule would reach into both, where an
|
||||
* inherited value stops at the nearer root. Reset on every root, so a look
|
||||
* that leaves one out takes the fallback rather than the outer root's.
|
||||
*/
|
||||
:where([data-look]) {
|
||||
--dui-ring-track: initial;
|
||||
--dui-ring-glow: initial;
|
||||
--dui-ring-handle: initial;
|
||||
--dui-ring-handle-edge: initial;
|
||||
--dui-ring-handle-edge-width: initial;
|
||||
--dui-ring-handle-shadow: initial;
|
||||
--dui-ring-swatch: initial;
|
||||
--dui-ring-swatch-width: initial;
|
||||
--dui-on-handle: initial;
|
||||
}
|
||||
|
||||
.dui-ring-track {
|
||||
stroke: var(--dui-ring-track, var(--muted));
|
||||
}
|
||||
|
||||
.dui-ring-fill {
|
||||
stroke: var(--primary);
|
||||
filter: var(--dui-ring-glow, none);
|
||||
}
|
||||
|
||||
.dui-ring-handle {
|
||||
fill: var(--dui-ring-handle, var(--primary));
|
||||
stroke: var(--dui-ring-handle-edge, none);
|
||||
stroke-width: var(--dui-ring-handle-edge-width, 0);
|
||||
filter: var(--dui-ring-handle-shadow, none);
|
||||
}
|
||||
|
||||
/* A colour's handle is filled with the colour, so only its edge is the look's. */
|
||||
.dui-ring-swatch {
|
||||
stroke: var(--dui-ring-swatch, var(--card));
|
||||
stroke-width: var(--dui-ring-swatch-width, 3px);
|
||||
}
|
||||
|
||||
.dui-ring-hit {
|
||||
pointer-events: stroke;
|
||||
cursor: pointer;
|
||||
|
||||
@@ -6,9 +6,10 @@
|
||||
* below reads them from there: the tokens by inheritance, the look and the
|
||||
* touch flag through this context.
|
||||
*
|
||||
* The style is carried in the context as well as on the element, because a
|
||||
* menu is portalled to `body` and lands outside the canvas. A surface that
|
||||
* floats out of the tree re-states the tokens rather than borrowing the app's.
|
||||
* The style and the theme class are carried in the context as well as on the
|
||||
* element, because a menu is portalled to `body` and lands outside the canvas.
|
||||
* A surface that floats out of the tree re-states them rather than borrowing
|
||||
* the app's.
|
||||
*/
|
||||
import { createContext, useContext, useMemo } from "react"
|
||||
|
||||
@@ -28,6 +29,8 @@ type Canvas = {
|
||||
touch: boolean
|
||||
/** The palette's tokens, or `{}` when the dashboard names none. */
|
||||
style: React.CSSProperties
|
||||
/** The theme scope class, `theme-light` or `theme-dark`. */
|
||||
theme: string
|
||||
}
|
||||
|
||||
/** A dashboard that names no palette, as one object rather than one per render. */
|
||||
@@ -37,6 +40,7 @@ const LookContext = createContext<Canvas>({
|
||||
look: "material",
|
||||
touch: false,
|
||||
style: {},
|
||||
theme: "",
|
||||
})
|
||||
|
||||
/** The look everything under here is drawn in. */
|
||||
@@ -46,10 +50,10 @@ export const useLook = () => useContext(LookContext)
|
||||
* What the canvas root carries: the theme class, the palette, and the two
|
||||
* attributes the looks' stylesheets key off.
|
||||
*
|
||||
* The class is always resolved to `light` or `dark`, rather than left empty
|
||||
* for a dashboard that follows the device: the sets state their own colours
|
||||
* per theme, and a chart canvas has to be told which one it is drawing in.
|
||||
* Restating the app's own resolved theme changes nothing when they agree.
|
||||
* The class is always resolved to `theme-light` or `theme-dark`, rather than
|
||||
* left empty for a dashboard that follows the device: the sets state their own
|
||||
* colours per theme, and a chart canvas has to be told which one it is drawing
|
||||
* in. Restating the app's own resolved theme changes nothing when they agree.
|
||||
*
|
||||
* `touch` is passed in rather than read off the document, because it belongs to
|
||||
* the screen rather than to the dashboard: the same document may hang on a
|
||||
@@ -73,7 +77,7 @@ export function useCanvasRoot(
|
||||
[roles],
|
||||
)
|
||||
return {
|
||||
className: stated || (resolvedTheme === "dark" ? "dark" : "light"),
|
||||
className: `theme-${stated || resolvedTheme}`,
|
||||
style,
|
||||
"data-look": look,
|
||||
"data-touch": touch ? "" : undefined,
|
||||
@@ -101,13 +105,13 @@ export function LookProvider({
|
||||
const root = useCanvasRoot(dashboard, touch)
|
||||
const look = root["data-look"]
|
||||
const touched = root["data-touch"] !== undefined
|
||||
const { style } = root
|
||||
const { style, className: theme } = root
|
||||
// A bound setting wakes this component on every message its flow sends, and
|
||||
// what the widgets below actually react to is the value — so it changes only
|
||||
// when one of the three things it carries does.
|
||||
// when one of the four things it carries does.
|
||||
const value = useMemo(
|
||||
() => ({ look, touch: touched, style }),
|
||||
[look, touched, style],
|
||||
() => ({ look, touch: touched, style, theme }),
|
||||
[look, touched, style, theme],
|
||||
)
|
||||
return <LookContext.Provider value={value}>{children}</LookContext.Provider>
|
||||
}
|
||||
|
||||
@@ -21,7 +21,8 @@ import type { Look } from "../../settings"
|
||||
|
||||
type LookMotion = {
|
||||
spring: Transition
|
||||
/** How a widget arrives on the canvas. */
|
||||
/** How a widget arrives on the canvas. `custom` is the side it comes from,
|
||||
* as `gridStagger` takes it. */
|
||||
enter: Variants
|
||||
/** Seconds for one round of the ambient ground; 0 draws none. */
|
||||
drift: number
|
||||
@@ -34,7 +35,7 @@ export const LOOK: Record<Look, LookMotion> = {
|
||||
// the way the rest of the product does.
|
||||
spring: { type: "spring", stiffness: 420, damping: 34, mass: 1 },
|
||||
enter: {
|
||||
hidden: { opacity: 0, y: 8 },
|
||||
hidden: (from = 1) => ({ opacity: 0, y: 8 * from }),
|
||||
visible: { opacity: 1, y: 0 },
|
||||
},
|
||||
drift: 0,
|
||||
@@ -42,7 +43,7 @@ export const LOOK: Record<Look, LookMotion> = {
|
||||
material: {
|
||||
spring: { type: "spring", stiffness: 550, damping: 38, mass: 1 },
|
||||
enter: {
|
||||
hidden: { opacity: 0, y: 8 },
|
||||
hidden: (from = 1) => ({ opacity: 0, y: 8 * from }),
|
||||
visible: { opacity: 1, y: 0 },
|
||||
},
|
||||
drift: 0,
|
||||
@@ -50,15 +51,23 @@ export const LOOK: Record<Look, LookMotion> = {
|
||||
glass: {
|
||||
spring: { type: "spring", stiffness: 320, damping: 22, mass: 0.8 },
|
||||
enter: {
|
||||
hidden: { opacity: 0, y: 12, scale: 0.96 },
|
||||
hidden: (from = 1) => ({ opacity: 0, y: 12 * from, scale: 0.96 }),
|
||||
visible: { opacity: 1, y: 0, scale: 1 },
|
||||
},
|
||||
drift: 46,
|
||||
},
|
||||
}
|
||||
|
||||
/** Widgets arrive as a page rather than all at once. */
|
||||
/**
|
||||
* Widgets arrive as a page rather than all at once, row by row.
|
||||
*
|
||||
* `custom` is the side they come from: below (1), as a round panel's next
|
||||
* dashboard rises, or above (-1) for one further up a panel's rail, which
|
||||
* brings the last row in first.
|
||||
*/
|
||||
export const gridStagger: Variants = {
|
||||
hidden: {},
|
||||
visible: { transition: { staggerChildren: 0.03 } },
|
||||
visible: (from = 1) => ({
|
||||
transition: { staggerChildren: 0.03, staggerDirection: from < 0 ? -1 : 1 },
|
||||
}),
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ assert.deepEqual(
|
||||
)
|
||||
assert.deepEqual(
|
||||
rolesOf(["#0a0a0a"])?.series.slice(1),
|
||||
slots(block(".dark {")),
|
||||
slots(block(".theme-dark {")),
|
||||
"a dark dashboard continues with the dark --chart-2…8",
|
||||
)
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
*
|
||||
* The result is written onto the canvas as the plain token variables the app
|
||||
* already themes with (`--background`, `--card`, `--primary`, …), which is the
|
||||
* same mechanism `.light` and `.dark` use on a subtree. Nothing here touches
|
||||
* same mechanism `.theme-light` and `.theme-dark` use on a subtree. Nothing here touches
|
||||
* `index.css`: that file's token blocks are byte-identical with the website's
|
||||
* and `make design-check` holds them there.
|
||||
*
|
||||
|
||||
@@ -154,8 +154,10 @@ export function Select({
|
||||
onChange,
|
||||
}: SelectProps) {
|
||||
// The menu is portalled to `body`, which is outside the canvas — so it
|
||||
// re-states the dashboard's own colours rather than borrowing the app's.
|
||||
const { style } = useLook()
|
||||
// re-states the dashboard's own theme, colours and look rather than
|
||||
// borrowing the app's. The look carries the variables its menu is painted
|
||||
// with: without it a glass menu has no blur, and the tile under it shows.
|
||||
const { style, theme, look } = useLook()
|
||||
return (
|
||||
<SelectPrimitive.Root
|
||||
value={value}
|
||||
@@ -178,7 +180,11 @@ export function Select({
|
||||
position="popper"
|
||||
sideOffset={4}
|
||||
style={style}
|
||||
className="fx-menu z-50 max-h-64 min-w-[var(--radix-select-trigger-width)] overflow-y-auto p-1 data-[state=open]:animate-in data-[state=open]:zoom-in-95 data-[state=open]:fade-in-0"
|
||||
data-look={look}
|
||||
className={cn(
|
||||
theme,
|
||||
"fx-menu z-50 max-h-64 min-w-[var(--radix-select-trigger-width)] overflow-y-auto p-1 data-[state=open]:animate-in data-[state=open]:zoom-in-95 data-[state=open]:fade-in-0",
|
||||
)}
|
||||
>
|
||||
<SelectPrimitive.Viewport>
|
||||
{options.map((option) => (
|
||||
|
||||
@@ -31,13 +31,14 @@ export function Readout({
|
||||
}: ReadoutProps) {
|
||||
const { label, numeric } = useAnimatedNumber(value, precision)
|
||||
return (
|
||||
<span data-testid="readout" className="flex min-w-0 items-baseline gap-1.5">
|
||||
<span
|
||||
className={cn(
|
||||
"min-w-0 truncate",
|
||||
size === "hero" ? "dui-hero" : "tabular-nums",
|
||||
)}
|
||||
>
|
||||
<span
|
||||
data-testid="readout"
|
||||
className={cn(
|
||||
"flex min-w-0 items-baseline gap-1.5",
|
||||
size === "hero" && "dui-hero",
|
||||
)}
|
||||
>
|
||||
<span className="min-w-0 truncate tabular-nums">
|
||||
{numeric ? (
|
||||
<motion.span>{label}</motion.span>
|
||||
) : (
|
||||
|
||||
@@ -21,6 +21,12 @@
|
||||
[data-look="fluksio"] {
|
||||
--fx-radius: var(--radius-lg);
|
||||
--fx-field: var(--radius-md);
|
||||
/* A round face's ring (`core.css`): the slider's handle, a ring of primary
|
||||
around the page colour. */
|
||||
--dui-ring-handle: var(--background);
|
||||
--dui-ring-handle-edge: var(--primary);
|
||||
--dui-ring-handle-edge-width: 2px;
|
||||
--dui-ring-handle-shadow: drop-shadow(0 1px 2px rgb(0 0 0 / 0.2));
|
||||
}
|
||||
|
||||
/* --- surfaces ------------------------------------------------------------ */
|
||||
@@ -315,26 +321,3 @@
|
||||
outline: none;
|
||||
box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 50%, transparent);
|
||||
}
|
||||
|
||||
/* --- a round dashboard's ring -------------------------------------------- */
|
||||
|
||||
[data-look="fluksio"] .dui-ring-track {
|
||||
stroke: var(--muted);
|
||||
}
|
||||
|
||||
[data-look="fluksio"] .dui-ring-fill {
|
||||
stroke: var(--primary);
|
||||
}
|
||||
|
||||
/* The slider's handle: a ring of primary around the page colour. */
|
||||
[data-look="fluksio"] .dui-ring-handle {
|
||||
fill: var(--background);
|
||||
stroke: var(--primary);
|
||||
stroke-width: 2px;
|
||||
filter: drop-shadow(0 1px 2px rgb(0 0 0 / 0.2));
|
||||
}
|
||||
|
||||
[data-look="fluksio"] .dui-ring-swatch {
|
||||
stroke: var(--card);
|
||||
stroke-width: 3px;
|
||||
}
|
||||
|
||||
@@ -172,8 +172,10 @@ export function Select({
|
||||
onChange,
|
||||
}: SelectProps) {
|
||||
// The menu is portalled to `body`, which is outside the canvas — so it
|
||||
// re-states the dashboard's own colours rather than borrowing the app's.
|
||||
const { style } = useLook()
|
||||
// re-states the dashboard's own theme, colours and look rather than
|
||||
// borrowing the app's. The look carries the variables its menu is painted
|
||||
// with: without it a glass menu has no blur, and the tile under it shows.
|
||||
const { style, theme, look } = useLook()
|
||||
return (
|
||||
<SelectPrimitive.Root
|
||||
value={value}
|
||||
@@ -200,7 +202,11 @@ export function Select({
|
||||
position="popper"
|
||||
sideOffset={4}
|
||||
style={style}
|
||||
className="gl-menu z-50 max-h-64 min-w-[var(--radix-select-trigger-width)] overflow-y-auto p-1 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95"
|
||||
data-look={look}
|
||||
className={cn(
|
||||
theme,
|
||||
"gl-menu z-50 max-h-64 min-w-[var(--radix-select-trigger-width)] overflow-y-auto p-1 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
||||
)}
|
||||
>
|
||||
<SelectPrimitive.Viewport>
|
||||
{options.map((option) => (
|
||||
|
||||
@@ -30,13 +30,14 @@ export function Readout({
|
||||
}: ReadoutProps) {
|
||||
const { label, numeric } = useAnimatedNumber(value, precision)
|
||||
return (
|
||||
<span data-testid="readout" className="flex min-w-0 items-baseline gap-1.5">
|
||||
<span
|
||||
className={cn(
|
||||
"min-w-0 truncate",
|
||||
size === "hero" ? "dui-hero" : "tabular-nums",
|
||||
)}
|
||||
>
|
||||
<span
|
||||
data-testid="readout"
|
||||
className={cn(
|
||||
"flex min-w-0 items-baseline gap-1.5",
|
||||
size === "hero" && "dui-hero",
|
||||
)}
|
||||
>
|
||||
<span className="min-w-0 truncate tabular-nums">
|
||||
{numeric ? (
|
||||
<motion.span>{label}</motion.span>
|
||||
) : (
|
||||
|
||||
@@ -26,9 +26,23 @@
|
||||
--gl-radius: 1.25rem;
|
||||
--gl-track: rgb(255 255 255 / 0.16);
|
||||
--gl-blob-opacity: 0.5;
|
||||
/* A round face's press, which has no card behind it. See below. */
|
||||
--gl-press: var(--gl-bg);
|
||||
--gl-press-shadow: var(--gl-inset);
|
||||
/* A round face's ring (`core.css`): lit, as the gauge's arc is, under a
|
||||
white handle, which a reading's dot on it shows dark against. */
|
||||
--dui-ring-track: var(--gl-track);
|
||||
--dui-ring-glow: drop-shadow(0 0 4px var(--primary));
|
||||
--dui-ring-handle: #fff;
|
||||
--dui-ring-handle-edge: var(--gl-border);
|
||||
--dui-ring-handle-edge-width: 1px;
|
||||
--dui-ring-handle-shadow: drop-shadow(0 2px 8px rgb(0 0 0 / 0.35));
|
||||
--dui-ring-swatch: rgb(255 255 255 / 0.85);
|
||||
--dui-ring-swatch-width: 2px;
|
||||
--dui-on-handle: rgb(0 0 0 / 0.75);
|
||||
}
|
||||
|
||||
[data-look="glass"].light {
|
||||
[data-look="glass"].theme-light {
|
||||
--gl-bg: rgb(255 255 255 / 0.5);
|
||||
--gl-bg-strong: rgb(255 255 255 / 0.7);
|
||||
--gl-border: rgb(255 255 255 / 0.75);
|
||||
@@ -37,6 +51,8 @@
|
||||
--gl-track: rgb(0 0 0 / 0.1);
|
||||
/* Diluted by the white it mixes into, so it takes more of it to show. */
|
||||
--gl-blob-opacity: 0.6;
|
||||
--gl-press: color-mix(in srgb, var(--primary) 14%, rgb(255 255 255 / 0.85));
|
||||
--gl-press-shadow: var(--gl-shadow), var(--gl-inset);
|
||||
}
|
||||
|
||||
/* --- the ground ---------------------------------------------------------- */
|
||||
@@ -238,6 +254,19 @@
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
/*
|
||||
* A Switch's or a Button's face on a round dashboard is one large press with
|
||||
* only the ground behind it. A tile's button has a card for contrast; this has
|
||||
* none, so in light the white wash all but disappears into the ground. The
|
||||
* look's root states the press's own wash, so a dashboard keeps its own when
|
||||
* a round panel draws it beside one in another look or theme.
|
||||
*/
|
||||
.dui-face-press
|
||||
> .gl-button:not([data-variant="filled"], [aria-pressed="true"]) {
|
||||
background: var(--gl-press);
|
||||
box-shadow: var(--gl-press-shadow);
|
||||
}
|
||||
|
||||
.gl-switch {
|
||||
position: relative;
|
||||
display: inline-flex;
|
||||
@@ -415,32 +444,3 @@
|
||||
outline: 2px solid var(--ring);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
/* --- a round dashboard's ring -------------------------------------------- */
|
||||
|
||||
[data-look="glass"] .dui-ring-track {
|
||||
stroke: var(--gl-track);
|
||||
}
|
||||
|
||||
/* Lit, as the gauge's arc is. */
|
||||
[data-look="glass"] .dui-ring-fill {
|
||||
stroke: var(--primary);
|
||||
filter: drop-shadow(0 0 4px var(--primary));
|
||||
}
|
||||
|
||||
[data-look="glass"] .dui-ring-handle {
|
||||
fill: #fff;
|
||||
stroke: var(--gl-border);
|
||||
stroke-width: 1px;
|
||||
filter: drop-shadow(0 2px 8px rgb(0 0 0 / 0.35));
|
||||
}
|
||||
|
||||
/* A reading's dot on the handle, which is white here in either theme. */
|
||||
[data-look="glass"] :is(.dui-ring, .dui-slider) {
|
||||
--dui-reading-on-handle: rgb(0 0 0 / 0.75);
|
||||
}
|
||||
|
||||
[data-look="glass"] .dui-ring-swatch {
|
||||
stroke: rgb(255 255 255 / 0.85);
|
||||
stroke-width: 2px;
|
||||
}
|
||||
|
||||
@@ -199,8 +199,10 @@ export function Select({
|
||||
onChange,
|
||||
}: SelectProps) {
|
||||
// The menu is portalled to `body`, which is outside the canvas — so it
|
||||
// re-states the dashboard's own colours rather than borrowing the app's.
|
||||
const { style } = useLook()
|
||||
// re-states the dashboard's own theme, colours and look rather than
|
||||
// borrowing the app's. The look carries the variables its menu is painted
|
||||
// with: without it a glass menu has no blur, and the tile under it shows.
|
||||
const { style, theme, look } = useLook()
|
||||
return (
|
||||
<SelectPrimitive.Root
|
||||
value={value}
|
||||
@@ -226,7 +228,11 @@ export function Select({
|
||||
position="popper"
|
||||
sideOffset={4}
|
||||
style={style}
|
||||
className="m3-menu z-50 max-h-64 min-w-[var(--radix-select-trigger-width)] overflow-y-auto p-1 data-[state=open]:animate-in data-[state=open]:zoom-in-95 data-[state=open]:fade-in-0"
|
||||
data-look={look}
|
||||
className={cn(
|
||||
theme,
|
||||
"m3-menu z-50 max-h-64 min-w-[var(--radix-select-trigger-width)] overflow-y-auto p-1 data-[state=open]:animate-in data-[state=open]:zoom-in-95 data-[state=open]:fade-in-0",
|
||||
)}
|
||||
>
|
||||
<SelectPrimitive.Viewport>
|
||||
{options.map((option) => (
|
||||
|
||||
@@ -29,13 +29,14 @@ export function Readout({
|
||||
}: ReadoutProps) {
|
||||
const { label, numeric } = useAnimatedNumber(value, precision)
|
||||
return (
|
||||
<span data-testid="readout" className="flex min-w-0 items-baseline gap-1.5">
|
||||
<span
|
||||
className={cn(
|
||||
"min-w-0 truncate",
|
||||
size === "hero" ? "dui-hero" : "tabular-nums",
|
||||
)}
|
||||
>
|
||||
<span
|
||||
data-testid="readout"
|
||||
className={cn(
|
||||
"flex min-w-0 items-baseline gap-1.5",
|
||||
size === "hero" && "dui-hero",
|
||||
)}
|
||||
>
|
||||
<span className="min-w-0 truncate tabular-nums">
|
||||
{numeric ? (
|
||||
<motion.span>{label}</motion.span>
|
||||
) : (
|
||||
|
||||
@@ -23,6 +23,7 @@ import type {
|
||||
RailProps,
|
||||
} from "../core/contract"
|
||||
import { railGeometry, TESTID } from "../core/contract"
|
||||
import { useLook } from "../core/look"
|
||||
import { LOOK } from "../core/motion"
|
||||
|
||||
/** Material's ground is the surface colour itself; only an image is drawn. */
|
||||
@@ -39,6 +40,8 @@ export function Backdrop({ image }: BackdropProps) {
|
||||
}
|
||||
|
||||
function Issue({ issue }: { issue: string }) {
|
||||
// Portalled to `body`, so it re-states the dashboard's theme and colours.
|
||||
const { style, theme } = useLook()
|
||||
return (
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
@@ -49,7 +52,12 @@ function Issue({ issue }: { issue: string }) {
|
||||
data-testid={TESTID.issue}
|
||||
/>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent className="max-w-xs break-words">{issue}</TooltipContent>
|
||||
<TooltipContent
|
||||
className={cn(theme, "max-w-xs break-words")}
|
||||
style={style}
|
||||
>
|
||||
{issue}
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -19,6 +19,10 @@
|
||||
--m3-sc: color-mix(in oklab, var(--primary) 22%, var(--card));
|
||||
--m3-outline: var(--border);
|
||||
--m3-radius: 1rem;
|
||||
/* A round face's ring (`core.css`): a tonal track under a primary handle,
|
||||
which a reading's dot on it shows light against. */
|
||||
--dui-ring-track: var(--m3-sc);
|
||||
--dui-on-handle: var(--primary-foreground);
|
||||
}
|
||||
|
||||
/* --- surfaces ----------------------------------------------------------- */
|
||||
@@ -319,27 +323,3 @@
|
||||
outline: 2px solid var(--primary);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
/* --- a round dashboard's ring -------------------------------------------- */
|
||||
|
||||
[data-look="material"] .dui-ring-track {
|
||||
stroke: var(--m3-sc);
|
||||
}
|
||||
|
||||
[data-look="material"] .dui-ring-fill {
|
||||
stroke: var(--primary);
|
||||
}
|
||||
|
||||
[data-look="material"] .dui-ring-handle {
|
||||
fill: var(--primary);
|
||||
}
|
||||
|
||||
/* A reading's dot on the handle, which is primary here. */
|
||||
[data-look="material"] :is(.dui-ring, .dui-slider) {
|
||||
--dui-reading-on-handle: var(--primary-foreground);
|
||||
}
|
||||
|
||||
[data-look="material"] .dui-ring-swatch {
|
||||
stroke: var(--card);
|
||||
stroke-width: 3px;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user