refactor(web): the row primitive as utilities
Rows, slots, trays, notes, skeletons, scores and the release cells. The linked-row pointer rules key on the row knowing it is a link, not on :has(). Refs #280 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
6c183c5d98
commit
a4aa423b3a
+34
-17
@@ -2,6 +2,7 @@
|
|||||||
// and rejected collapsed to counts. Shared by the movie page and the tv deck.
|
// and rejected collapsed to counts. Shared by the movie page and the tv deck.
|
||||||
|
|
||||||
import { Fragment, type ReactNode, useEffect, useRef, useState } from "react";
|
import { Fragment, type ReactNode, useEffect, useRef, useState } from "react";
|
||||||
|
import { CELLS, cx, ROW_RULE, score } from "./look";
|
||||||
import {
|
import {
|
||||||
blacklistAdvice,
|
blacklistAdvice,
|
||||||
blacklistClass,
|
blacklistClass,
|
||||||
@@ -117,18 +118,26 @@ function Paged<T>({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const COLHEAD_LABEL = "font-readout text-2xs uppercase tracking-title text-ink-faint";
|
||||||
|
|
||||||
/** The column header the release cells line up under, from 46rem. */
|
/** The column header the release cells line up under, from 46rem. */
|
||||||
function Colhead() {
|
function Colhead() {
|
||||||
return (
|
return (
|
||||||
<div className="colhead" aria-hidden="true">
|
<div
|
||||||
<span className="colhead-score">score</span>
|
className={cx(
|
||||||
<span className="colhead-cells">
|
"hidden @cells:grid [grid-template-columns:var(--control-h)_minmax(0,1fr)_var(--word-w)] gap-x-3 pt-2 pb-1",
|
||||||
<span>res</span>
|
ROW_RULE,
|
||||||
<span>source</span>
|
)}
|
||||||
<span className="num">size</span>
|
aria-hidden="true"
|
||||||
<span>hdr</span>
|
>
|
||||||
<span>audio</span>
|
<span className={COLHEAD_LABEL}>score</span>
|
||||||
<span className="num">seed</span>
|
<span className={cx("col-start-2 grid", CELLS)}>
|
||||||
|
<span className={COLHEAD_LABEL}>res</span>
|
||||||
|
<span className={COLHEAD_LABEL}>source</span>
|
||||||
|
<span className={cx(COLHEAD_LABEL, "text-right")}>size</span>
|
||||||
|
<span className={COLHEAD_LABEL}>hdr</span>
|
||||||
|
<span className={COLHEAD_LABEL}>audio</span>
|
||||||
|
<span className={cx(COLHEAD_LABEL, "text-right")}>seed</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
@@ -372,7 +381,7 @@ function ReleaseRow({
|
|||||||
lead={
|
lead={
|
||||||
// biome-ignore lint/a11y/useAriaPropsSupportedByRole: the score's name is read with its row, not as a control
|
// biome-ignore lint/a11y/useAriaPropsSupportedByRole: the score's name is read with its row, not as a control
|
||||||
<span
|
<span
|
||||||
className="score"
|
className={score(stop)}
|
||||||
data-score={stop === null ? undefined : String(stop)}
|
data-score={stop === null ? undefined : String(stop)}
|
||||||
aria-label={`score ${formatScore(release.score)}`}
|
aria-label={`score ${formatScore(release.score)}`}
|
||||||
>
|
>
|
||||||
@@ -395,7 +404,7 @@ function ReleaseRow({
|
|||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
beforeSub={
|
beforeSub={
|
||||||
<div className="r-cells" aria-hidden="true">
|
<div className={cx("hidden @cells:grid", CELLS)} aria-hidden="true">
|
||||||
{(
|
{(
|
||||||
[
|
[
|
||||||
[values.res, false],
|
[values.res, false],
|
||||||
@@ -411,11 +420,11 @@ function ReleaseRow({
|
|||||||
// biome-ignore lint/suspicious/noArrayIndexKey: see above
|
// biome-ignore lint/suspicious/noArrayIndexKey: see above
|
||||||
key={index}
|
key={index}
|
||||||
title={value}
|
title={value}
|
||||||
className={
|
className={cx(
|
||||||
[numeric ? "num" : "", value === "—" ? "unclaimed" : ""]
|
"truncate font-readout text-xs tabular-nums",
|
||||||
.filter(Boolean)
|
numeric && "text-right",
|
||||||
.join(" ") || undefined
|
value === "—" ? "text-ink-faint" : "text-ink-muted",
|
||||||
}
|
)}
|
||||||
>
|
>
|
||||||
{value}
|
{value}
|
||||||
</span>
|
</span>
|
||||||
@@ -426,7 +435,15 @@ function ReleaseRow({
|
|||||||
subExpands
|
subExpands
|
||||||
afterSub={
|
afterSub={
|
||||||
blacklisted && (
|
blacklisted && (
|
||||||
<span className="r-why readout" data-blacklist={blacklisted}>
|
<span
|
||||||
|
className={cx(
|
||||||
|
"readout text-xs",
|
||||||
|
blacklisted === "release"
|
||||||
|
? "[color:oklch(from_var(--signal-fault)_0.78_0.1_h)]"
|
||||||
|
: "text-ink-muted",
|
||||||
|
)}
|
||||||
|
data-blacklist={blacklisted}
|
||||||
|
>
|
||||||
{blacklistAdvice(release.blacklist_reason)}
|
{blacklistAdvice(release.blacklist_reason)}
|
||||||
</span>
|
</span>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -313,427 +313,6 @@ body {
|
|||||||
letter-spacing: 0.06em;
|
letter-spacing: 0.06em;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---- the row ------------------------------------------------------------------ */
|
|
||||||
|
|
||||||
/* lead | body | actions, then the tray full width. The body is minmax(0, 1fr):
|
|
||||||
whatever is too long is clipped inside it and never pushes the actions. */
|
|
||||||
.r {
|
|
||||||
position: relative;
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: auto minmax(0, 1fr) auto;
|
|
||||||
grid-template-areas:
|
|
||||||
"lead body act"
|
|
||||||
"tray tray tray";
|
|
||||||
align-items: center;
|
|
||||||
column-gap: var(--space-3);
|
|
||||||
min-height: var(--row-min);
|
|
||||||
padding: var(--space-2) 0;
|
|
||||||
border-bottom: 1px solid oklch(from var(--line) l c h / 60%);
|
|
||||||
}
|
|
||||||
|
|
||||||
.r[data-nolead] {
|
|
||||||
grid-template-columns: minmax(0, 1fr) auto;
|
|
||||||
grid-template-areas:
|
|
||||||
"body act"
|
|
||||||
"tray tray";
|
|
||||||
}
|
|
||||||
|
|
||||||
.r-lead {
|
|
||||||
grid-area: lead;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.r-body {
|
|
||||||
grid-area: body;
|
|
||||||
display: grid;
|
|
||||||
align-content: center;
|
|
||||||
gap: var(--space-1);
|
|
||||||
min-width: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.r-title {
|
|
||||||
min-width: 0;
|
|
||||||
overflow: hidden;
|
|
||||||
white-space: nowrap;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
font-size: var(--text-sm);
|
|
||||||
font-weight: 600;
|
|
||||||
line-height: 1.3;
|
|
||||||
color: var(--ink);
|
|
||||||
}
|
|
||||||
|
|
||||||
.r-title .yr {
|
|
||||||
margin-left: var(--space-2);
|
|
||||||
font-family: var(--font-readout);
|
|
||||||
font-size: var(--text-xs);
|
|
||||||
font-weight: 400;
|
|
||||||
color: var(--ink-faint);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* one line of chips; what does not fit fades out at the edge rather than
|
|
||||||
being cut through a word */
|
|
||||||
.r-meta {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
flex-wrap: nowrap;
|
|
||||||
gap: var(--space-1);
|
|
||||||
min-width: 0;
|
|
||||||
overflow: hidden;
|
|
||||||
mask-image: linear-gradient(to right, var(--ink) calc(100% - 1.5rem), transparent);
|
|
||||||
}
|
|
||||||
|
|
||||||
.r-meta:empty {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.r-sub {
|
|
||||||
min-width: 0;
|
|
||||||
overflow: hidden;
|
|
||||||
white-space: nowrap;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
font-size: var(--text-2xs);
|
|
||||||
line-height: 1.3;
|
|
||||||
color: var(--ink-faint);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* the full string, on a tap (§9.3: the release name is evidence, on expand) */
|
|
||||||
.r-sub[data-full] {
|
|
||||||
white-space: normal;
|
|
||||||
overflow-wrap: anywhere;
|
|
||||||
}
|
|
||||||
|
|
||||||
.r-sub[data-tone="fault"] {
|
|
||||||
color: var(--signal-fault);
|
|
||||||
}
|
|
||||||
|
|
||||||
.r-act {
|
|
||||||
grid-area: act;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: flex-end;
|
|
||||||
gap: var(--space-1);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* every slot has its width whether or not it holds a control, so a row of a
|
|
||||||
kind keeps one action column */
|
|
||||||
.r-slot {
|
|
||||||
display: flex;
|
|
||||||
flex: none;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.r-slot[data-width="icon"] {
|
|
||||||
width: var(--control-h);
|
|
||||||
}
|
|
||||||
|
|
||||||
.r-slot[data-width="toggle"] {
|
|
||||||
width: var(--toggle-w);
|
|
||||||
}
|
|
||||||
|
|
||||||
.r-slot[data-width="word"] {
|
|
||||||
min-width: var(--word-w);
|
|
||||||
}
|
|
||||||
|
|
||||||
.r-slot[data-wide] {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.r-chevron {
|
|
||||||
color: var(--ink-faint);
|
|
||||||
}
|
|
||||||
|
|
||||||
.r-chevron .icon {
|
|
||||||
width: 0.875rem;
|
|
||||||
height: 0.875rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* the row as a link: a stretched button under everything; real controls sit
|
|
||||||
above it, everything else lets the tap through */
|
|
||||||
.r-link {
|
|
||||||
position: absolute;
|
|
||||||
inset: 0;
|
|
||||||
z-index: 0;
|
|
||||||
padding: 0;
|
|
||||||
background: transparent;
|
|
||||||
border: 0;
|
|
||||||
cursor: pointer;
|
|
||||||
transition: background 150ms var(--ease-out);
|
|
||||||
}
|
|
||||||
|
|
||||||
.r-link:hover {
|
|
||||||
background: var(--highlight);
|
|
||||||
}
|
|
||||||
|
|
||||||
.r-link:focus-visible {
|
|
||||||
outline-offset: -2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.r:has(> .r-link) > :not(.r-link) {
|
|
||||||
position: relative;
|
|
||||||
z-index: 1;
|
|
||||||
pointer-events: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.r:has(> .r-link) button:not(.r-link),
|
|
||||||
.r:has(> .r-link) a,
|
|
||||||
.r:has(> .r-link) select,
|
|
||||||
.r:has(> .r-link) input,
|
|
||||||
.r:has(> .r-link) [role="button"] {
|
|
||||||
pointer-events: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.r-tray {
|
|
||||||
grid-area: tray;
|
|
||||||
display: grid;
|
|
||||||
gap: var(--space-2);
|
|
||||||
min-width: 0;
|
|
||||||
padding-top: var(--space-2);
|
|
||||||
}
|
|
||||||
|
|
||||||
.r-tray:not(:has(> :not([hidden]))) {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.r:has(> .r-link) > .r-tray {
|
|
||||||
pointer-events: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.r-note {
|
|
||||||
margin: 0;
|
|
||||||
font-size: var(--text-xs);
|
|
||||||
color: var(--ink-muted);
|
|
||||||
}
|
|
||||||
|
|
||||||
.r-note[data-tone="fault"] {
|
|
||||||
color: var(--signal-fault);
|
|
||||||
}
|
|
||||||
|
|
||||||
.r-note[data-tone="warn"] {
|
|
||||||
color: var(--signal-warn);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* the ⋯ tray: the row's other actions, labelled, full width */
|
|
||||||
.r-morepanel {
|
|
||||||
display: grid;
|
|
||||||
gap: var(--space-2);
|
|
||||||
}
|
|
||||||
|
|
||||||
.r-empty {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: var(--space-2);
|
|
||||||
min-height: var(--row-min);
|
|
||||||
padding: var(--space-2) 0;
|
|
||||||
font-size: var(--text-xs);
|
|
||||||
color: var(--ink-muted);
|
|
||||||
border-bottom: 1px solid oklch(from var(--line) l c h / 60%);
|
|
||||||
}
|
|
||||||
|
|
||||||
.r-empty[data-tone="fault"] {
|
|
||||||
color: var(--signal-fault);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* row leads */
|
|
||||||
.row-poster,
|
|
||||||
.row-poster-blank {
|
|
||||||
display: block;
|
|
||||||
width: 2.25rem;
|
|
||||||
aspect-ratio: 2 / 3;
|
|
||||||
flex: none;
|
|
||||||
object-fit: cover;
|
|
||||||
background: var(--panel-raised);
|
|
||||||
border: 1px solid var(--line);
|
|
||||||
border-radius: 3px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.lead-tag {
|
|
||||||
width: var(--control-h);
|
|
||||||
text-align: center;
|
|
||||||
font-size: var(--text-xs);
|
|
||||||
font-weight: 600;
|
|
||||||
color: var(--ink-faint);
|
|
||||||
}
|
|
||||||
|
|
||||||
.lead-lamp {
|
|
||||||
display: flex;
|
|
||||||
width: var(--space-4);
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* score: the release's lead, on the list-relative heat scale (issue 111) */
|
|
||||||
.score {
|
|
||||||
display: inline-grid;
|
|
||||||
place-items: center;
|
|
||||||
width: var(--control-h);
|
|
||||||
height: var(--control-h);
|
|
||||||
font-family: var(--font-readout);
|
|
||||||
font-size: var(--text-sm);
|
|
||||||
font-weight: 700;
|
|
||||||
font-variant-numeric: tabular-nums;
|
|
||||||
color: var(--ink-muted);
|
|
||||||
border: 1px solid var(--line);
|
|
||||||
border-radius: var(--radius);
|
|
||||||
}
|
|
||||||
|
|
||||||
.score[data-score="0"] {
|
|
||||||
color: var(--score-0);
|
|
||||||
border-color: oklch(from var(--score-0) l c h / 50%);
|
|
||||||
}
|
|
||||||
.score[data-score="1"] {
|
|
||||||
color: var(--score-1);
|
|
||||||
border-color: oklch(from var(--score-1) l c h / 50%);
|
|
||||||
}
|
|
||||||
.score[data-score="2"] {
|
|
||||||
color: var(--score-2);
|
|
||||||
border-color: oklch(from var(--score-2) l c h / 50%);
|
|
||||||
}
|
|
||||||
.score[data-score="3"] {
|
|
||||||
color: var(--score-3);
|
|
||||||
border-color: oklch(from var(--score-3) l c h / 50%);
|
|
||||||
}
|
|
||||||
.score[data-score="4"] {
|
|
||||||
color: var(--score-4);
|
|
||||||
border-color: oklch(from var(--score-4) l c h / 50%);
|
|
||||||
}
|
|
||||||
.score[data-score="5"] {
|
|
||||||
color: var(--score-5);
|
|
||||||
border-color: oklch(from var(--score-5) l c h / 50%);
|
|
||||||
}
|
|
||||||
.score[data-score="6"] {
|
|
||||||
color: var(--score-6);
|
|
||||||
border-color: oklch(from var(--score-6) l c h / 50%);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* season disclosure: the lead of a season row */
|
|
||||||
.disclose-lead .icon {
|
|
||||||
transition: transform 200ms var(--ease-out);
|
|
||||||
}
|
|
||||||
|
|
||||||
.disclose-lead[aria-expanded="true"] .icon {
|
|
||||||
transform: rotate(90deg);
|
|
||||||
}
|
|
||||||
|
|
||||||
.r[data-row="season"] > .r-body > .r-title {
|
|
||||||
font-family: var(--font-display);
|
|
||||||
font-size: var(--text-base);
|
|
||||||
font-weight: 700;
|
|
||||||
letter-spacing: 0.08em;
|
|
||||||
text-transform: uppercase;
|
|
||||||
}
|
|
||||||
|
|
||||||
.episodes {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
list-style: none;
|
|
||||||
background: oklch(from var(--panel) l c h / 50%);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* release cells: the §9.3 fixed columns, from 46rem; the chips carry them below */
|
|
||||||
.r-cells,
|
|
||||||
.colhead {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.colhead-cells,
|
|
||||||
.r-cells {
|
|
||||||
grid-template-columns: 4rem 4.5rem 4.5rem 6rem 7rem 3.5rem;
|
|
||||||
gap: var(--space-4);
|
|
||||||
}
|
|
||||||
|
|
||||||
.r-cells > span {
|
|
||||||
overflow: hidden;
|
|
||||||
white-space: nowrap;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
font-family: var(--font-readout);
|
|
||||||
font-size: var(--text-xs);
|
|
||||||
font-variant-numeric: tabular-nums;
|
|
||||||
color: var(--ink-muted);
|
|
||||||
}
|
|
||||||
|
|
||||||
.r-cells > .num,
|
|
||||||
.colhead-cells > .num {
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
.r-cells > .unclaimed {
|
|
||||||
color: var(--ink-faint);
|
|
||||||
}
|
|
||||||
|
|
||||||
.colhead {
|
|
||||||
grid-template-columns: var(--control-h) minmax(0, 1fr) var(--word-w);
|
|
||||||
column-gap: var(--space-3);
|
|
||||||
padding: var(--space-2) 0 var(--space-1);
|
|
||||||
border-bottom: 1px solid oklch(from var(--line) l c h / 60%);
|
|
||||||
}
|
|
||||||
|
|
||||||
.colhead-cells {
|
|
||||||
grid-column: 2;
|
|
||||||
display: grid;
|
|
||||||
}
|
|
||||||
|
|
||||||
.colhead-score,
|
|
||||||
.colhead-cells > span {
|
|
||||||
font-family: var(--font-readout);
|
|
||||||
font-size: var(--text-2xs);
|
|
||||||
text-transform: uppercase;
|
|
||||||
letter-spacing: 0.04em;
|
|
||||||
color: var(--ink-faint);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* skeleton: the row's own geometry, no shimmer (Dead-Air) */
|
|
||||||
.r-skel {
|
|
||||||
pointer-events: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.skel {
|
|
||||||
display: block;
|
|
||||||
background: var(--panel-raised);
|
|
||||||
border-radius: 3px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.skel-lead {
|
|
||||||
width: 2.25rem;
|
|
||||||
height: 3.375rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.skel-line {
|
|
||||||
width: 70%;
|
|
||||||
height: 0.75rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.skel-short {
|
|
||||||
width: 40%;
|
|
||||||
}
|
|
||||||
|
|
||||||
@container (min-width: 40rem) {
|
|
||||||
.r-slot[data-wide] {
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
|
|
||||||
.r-slot[data-narrow],
|
|
||||||
.r-morepanel {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.r-title {
|
|
||||||
font-size: var(--text-base);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@container (min-width: 46rem) {
|
|
||||||
.r[data-row="release"] .r-meta [data-cell] {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.r[data-row="release"] .r-cells,
|
|
||||||
.colhead {
|
|
||||||
display: grid;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ---- poster grid (§9.6, issue 151) -------------------------------------- */
|
/* ---- poster grid (§9.6, issue 151) -------------------------------------- */
|
||||||
|
|
||||||
.grid-rows {
|
.grid-rows {
|
||||||
@@ -1270,15 +849,6 @@ body {
|
|||||||
margin-top: var(--space-2);
|
margin-top: var(--space-2);
|
||||||
}
|
}
|
||||||
|
|
||||||
.r-why {
|
|
||||||
font-size: var(--text-xs);
|
|
||||||
color: var(--ink-muted);
|
|
||||||
}
|
|
||||||
|
|
||||||
.r-why[data-blacklist="release"] {
|
|
||||||
color: oklch(from var(--signal-fault) 0.78 0.1 h);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ---- subtitles (§15, §9.6) -------------------------------------------- */
|
/* ---- subtitles (§15, §9.6) -------------------------------------------- */
|
||||||
|
|
||||||
/* the languages read as one string, as wide as the wanted set can need */
|
/* the languages read as one string, as wide as the wanted set can need */
|
||||||
|
|||||||
+2
-2
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
import { type CSSProperties, type ReactNode, useEffect, useRef, useState } from "react";
|
import { type CSSProperties, type ReactNode, useEffect, useRef, useState } from "react";
|
||||||
import { Icon, ProviderMark, Star } from "./icons";
|
import { Icon, ProviderMark, Star } from "./icons";
|
||||||
import { control, type } from "./look";
|
import { control, NOTE, type } from "./look";
|
||||||
import { formatMetaLine, formatRating, formatVoteCount, tmdbImage } from "./movie";
|
import { formatMetaLine, formatRating, formatVoteCount, tmdbImage } from "./movie";
|
||||||
import { type ActionOutcome, formatSize, totalSize } from "./releases";
|
import { type ActionOutcome, formatSize, totalSize } from "./releases";
|
||||||
import { cx, flag, IconControl, IconLink, type Note, NoteLine } from "./ui";
|
import { cx, flag, IconControl, IconLink, type Note, NoteLine } from "./ui";
|
||||||
@@ -109,7 +109,7 @@ export function Hero({
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<NoteLine note={note} className="r-note hero-note readout" />
|
<NoteLine note={note} className={cx(NOTE, "mt-2")} />
|
||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -255,3 +255,44 @@ export function chip(state: ChipState = {}): string {
|
|||||||
|
|
||||||
/** A glyph inside a chip: smaller, and drawn a touch heavier to hold the size. */
|
/** A glyph inside a chip: smaller, and drawn a touch heavier to hold the size. */
|
||||||
export const CHIP_ICON = "size-3 [stroke-width:1.7]";
|
export const CHIP_ICON = "size-3 [stroke-width:1.7]";
|
||||||
|
|
||||||
|
/* ---- the row ------------------------------------------------------------- */
|
||||||
|
|
||||||
|
/** A list line's hairline: the line colour, softened. */
|
||||||
|
export const ROW_RULE = "border-b [border-bottom-color:oklch(from_var(--line)_l_c_h/60%)]";
|
||||||
|
|
||||||
|
/** A row's status line, and every note written the same way. */
|
||||||
|
export const NOTE =
|
||||||
|
"readout m-0 text-xs text-ink-muted data-[tone=fault]:text-signal-fault data-[tone=warn]:text-signal-warn";
|
||||||
|
|
||||||
|
/** The secondary line: truncated, and the full string on a tap. */
|
||||||
|
export const SUB =
|
||||||
|
"readout min-w-0 truncate text-2xs leading-row text-ink-faint data-full:whitespace-normal data-full:[overflow-wrap:anywhere]";
|
||||||
|
|
||||||
|
/** Placeholder bars: the row's own geometry, no shimmer (Dead-Air). */
|
||||||
|
export const skel = {
|
||||||
|
lead: "block bg-panel-raised rounded-chip w-poster h-poster",
|
||||||
|
line: "block bg-panel-raised rounded-chip w-7/10 h-3",
|
||||||
|
short: "block bg-panel-raised rounded-chip w-2/5 h-3",
|
||||||
|
} as const;
|
||||||
|
|
||||||
|
/** The release's lead, on the list-relative heat scale (issue 111). */
|
||||||
|
const SCORE_TONE = [
|
||||||
|
"text-score-0 [border-color:oklch(from_var(--score-0)_l_c_h/50%)]",
|
||||||
|
"text-score-1 [border-color:oklch(from_var(--score-1)_l_c_h/50%)]",
|
||||||
|
"text-score-2 [border-color:oklch(from_var(--score-2)_l_c_h/50%)]",
|
||||||
|
"text-score-3 [border-color:oklch(from_var(--score-3)_l_c_h/50%)]",
|
||||||
|
"text-score-4 [border-color:oklch(from_var(--score-4)_l_c_h/50%)]",
|
||||||
|
"text-score-5 [border-color:oklch(from_var(--score-5)_l_c_h/50%)]",
|
||||||
|
"text-score-6 [border-color:oklch(from_var(--score-6)_l_c_h/50%)]",
|
||||||
|
] as const;
|
||||||
|
|
||||||
|
export function score(stop: number | null): string {
|
||||||
|
return cx(
|
||||||
|
"inline-grid place-items-center size-control-h font-readout text-sm font-bold tabular-nums border rounded-panel",
|
||||||
|
stop === null ? "text-ink-muted border-line" : SCORE_TONE[stop],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** The §9.3 fixed columns release attributes line up in, from 46rem. */
|
||||||
|
export const CELLS = "[grid-template-columns:4rem_4.5rem_4.5rem_6rem_7rem_3.5rem] gap-4";
|
||||||
|
|||||||
+11
-4
@@ -7,6 +7,11 @@ import { downloadChipDetail, downloadChipLabel, findDownload } from "./downloads
|
|||||||
import { Icon, Star } from "./icons";
|
import { Icon, Star } from "./icons";
|
||||||
import { waiverLabel } from "./library";
|
import { waiverLabel } from "./library";
|
||||||
import { CHIP_ICON } from "./look";
|
import { CHIP_ICON } from "./look";
|
||||||
|
|
||||||
|
/** A row's lead thumbnail at 2:3; a missing one keeps the same box. */
|
||||||
|
const POSTER =
|
||||||
|
"block w-poster aspect-2/3 flex-none object-cover bg-panel-raised border border-line rounded-chip";
|
||||||
|
|
||||||
import { formatRating, formatVoteCount, tmdbImage } from "./movie";
|
import { formatRating, formatVoteCount, tmdbImage } from "./movie";
|
||||||
import { Chip, type Say } from "./ui";
|
import { Chip, type Say } from "./ui";
|
||||||
|
|
||||||
@@ -39,7 +44,9 @@ export function TitleText({ title, year }: { title: string; year: number | null
|
|||||||
return (
|
return (
|
||||||
<span>
|
<span>
|
||||||
{title}
|
{title}
|
||||||
{year !== null && <span className="yr">{year}</span>}
|
{year !== null && (
|
||||||
|
<span className="ml-2 font-readout text-xs font-normal text-ink-faint">{year}</span>
|
||||||
|
)}
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -201,11 +208,11 @@ export function RatingChip({
|
|||||||
export function RowPoster({ posterPath, title }: { posterPath: string | null; title: string }) {
|
export function RowPoster({ posterPath, title }: { posterPath: string | null; title: string }) {
|
||||||
const [broken, setBroken] = useState(false);
|
const [broken, setBroken] = useState(false);
|
||||||
if (posterPath === null || broken) {
|
if (posterPath === null || broken) {
|
||||||
return <span className="row-poster-blank" aria-hidden="true" />;
|
return <span className={POSTER} aria-hidden="true" />;
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<img
|
<img
|
||||||
className="row-poster"
|
className={POSTER}
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
src={tmdbImage(posterPath, "w92") ?? ""}
|
src={tmdbImage(posterPath, "w92") ?? ""}
|
||||||
alt={`${title} poster`}
|
alt={`${title} poster`}
|
||||||
@@ -218,7 +225,7 @@ export function RowPoster({ posterPath, title }: { posterPath: string | null; ti
|
|||||||
/** The amber lamp that leads every attention-queue row. */
|
/** The amber lamp that leads every attention-queue row. */
|
||||||
export function AttentionLamp() {
|
export function AttentionLamp() {
|
||||||
return (
|
return (
|
||||||
<span className="lead-lamp">
|
<span className="flex w-4 justify-center">
|
||||||
<span className="lamp" data-state="warn" aria-hidden="true" />
|
<span className="lamp" data-state="warn" aria-hidden="true" />
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -83,6 +83,10 @@
|
|||||||
--spacing-dl: 7ch;
|
--spacing-dl: 7ch;
|
||||||
/* a lamp's dot, and the rating star the same size */
|
/* a lamp's dot, and the rating star the same size */
|
||||||
--spacing-lamp: 0.625rem;
|
--spacing-lamp: 0.625rem;
|
||||||
|
--spacing-chevron: 0.875rem;
|
||||||
|
/* a row's poster thumbnail, 2:3 */
|
||||||
|
--spacing-poster: 2.25rem;
|
||||||
|
--spacing-poster-h: 3.375rem;
|
||||||
|
|
||||||
--container-deck: var(--deck-max);
|
--container-deck: var(--deck-max);
|
||||||
--container-measure: var(--measure);
|
--container-measure: var(--measure);
|
||||||
@@ -111,6 +115,7 @@
|
|||||||
--radius-micro: 2px;
|
--radius-micro: 2px;
|
||||||
--radius-chip: 3px;
|
--radius-chip: 3px;
|
||||||
|
|
||||||
|
--font-weight-normal: 400;
|
||||||
--font-weight-semibold: 600;
|
--font-weight-semibold: 600;
|
||||||
--font-weight-bold: 700;
|
--font-weight-bold: 700;
|
||||||
|
|
||||||
@@ -123,6 +128,7 @@
|
|||||||
--leading-none: 1;
|
--leading-none: 1;
|
||||||
--leading-tight: 1.1;
|
--leading-tight: 1.1;
|
||||||
--leading-snug: 1.2;
|
--leading-snug: 1.2;
|
||||||
|
--leading-row: 1.3;
|
||||||
--ease-out: var(--ease-out);
|
--ease-out: var(--ease-out);
|
||||||
|
|
||||||
/* the board's own breakpoints: tab bar to rail, column header, dense pointer */
|
/* the board's own breakpoints: tab bar to rail, column header, dense pointer */
|
||||||
|
|||||||
+130
-33
@@ -16,7 +16,20 @@ import {
|
|||||||
useState,
|
useState,
|
||||||
} from "react";
|
} from "react";
|
||||||
import { Icon, type IconName, useArmed } from "./icons";
|
import { Icon, type IconName, useArmed } from "./icons";
|
||||||
import { type ControlLook, chip, control, cx, toggle, toggleLamp, toggleState, type } from "./look";
|
import {
|
||||||
|
type ControlLook,
|
||||||
|
chip,
|
||||||
|
control,
|
||||||
|
cx,
|
||||||
|
NOTE,
|
||||||
|
ROW_RULE,
|
||||||
|
SUB,
|
||||||
|
skel,
|
||||||
|
toggle,
|
||||||
|
toggleLamp,
|
||||||
|
toggleState,
|
||||||
|
type,
|
||||||
|
} from "./look";
|
||||||
|
|
||||||
export type Tone = "fault" | "warn";
|
export type Tone = "fault" | "warn";
|
||||||
|
|
||||||
@@ -93,10 +106,13 @@ export function IconControl({
|
|||||||
look,
|
look,
|
||||||
shape = "icon",
|
shape = "icon",
|
||||||
className,
|
className,
|
||||||
|
iconClassName,
|
||||||
...rest
|
...rest
|
||||||
}: ComponentProps<"button"> & {
|
}: ComponentProps<"button"> & {
|
||||||
glyph: IconName;
|
glyph: IconName;
|
||||||
label: string;
|
label: string;
|
||||||
|
/** The glyph's own classes, e.g. a disclosure's turn. */
|
||||||
|
iconClassName?: string;
|
||||||
look?: ControlLook["look"];
|
look?: ControlLook["look"];
|
||||||
shape?: "icon" | "chip";
|
shape?: "icon" | "chip";
|
||||||
}) {
|
}) {
|
||||||
@@ -107,7 +123,7 @@ export function IconControl({
|
|||||||
aria-label={label}
|
aria-label={label}
|
||||||
{...rest}
|
{...rest}
|
||||||
>
|
>
|
||||||
<Icon name={glyph} />
|
<Icon name={glyph} className={iconClassName} />
|
||||||
</button>
|
</button>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -417,11 +433,12 @@ export interface ActionSlot {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface RowProps {
|
export interface RowProps {
|
||||||
/** `data-row`: which kind of row, for the few rules that differ by kind. */
|
/** `data-row`: which kind of row. */
|
||||||
kind: string;
|
kind: string;
|
||||||
lead?: ReactNode;
|
lead?: ReactNode;
|
||||||
title?: ReactNode;
|
title?: ReactNode;
|
||||||
titleClassName?: string;
|
/** readout: a path or a key in the mono face. season: an engraved display name. */
|
||||||
|
titleStyle?: "plain" | "readout" | "season";
|
||||||
/** The chip line. */
|
/** The chip line. */
|
||||||
meta?: ReactNode;
|
meta?: ReactNode;
|
||||||
sub?: ReactNode;
|
sub?: ReactNode;
|
||||||
@@ -431,7 +448,7 @@ export interface RowProps {
|
|||||||
beforeSub?: ReactNode;
|
beforeSub?: ReactNode;
|
||||||
/** Body content after the sub line. */
|
/** Body content after the sub line. */
|
||||||
afterSub?: ReactNode;
|
afterSub?: ReactNode;
|
||||||
bodyClassName?: string;
|
/** The body as a whole toggles something, e.g. a season's episodes. */
|
||||||
onBodyClick?: (event: MouseEvent<HTMLDivElement>) => void;
|
onBodyClick?: (event: MouseEvent<HTMLDivElement>) => void;
|
||||||
actions?: ActionSlot[];
|
actions?: ActionSlot[];
|
||||||
/** The phone tray: labelled, full-width versions of the wide-only actions. */
|
/** The phone tray: labelled, full-width versions of the wide-only actions. */
|
||||||
@@ -462,6 +479,18 @@ export function Expandable({ className, children }: { className: string; childre
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const TITLE = {
|
||||||
|
plain: "text-sm @row:text-base font-semibold",
|
||||||
|
readout: "readout text-sm @row:text-base font-semibold",
|
||||||
|
season: "font-display text-base font-bold tracking-label uppercase",
|
||||||
|
} as const;
|
||||||
|
|
||||||
|
const SLOT_WIDTH = {
|
||||||
|
icon: "w-control-h",
|
||||||
|
toggle: "w-toggle-w",
|
||||||
|
word: "min-w-word-w",
|
||||||
|
} as const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The one row: `lead | body | actions`, plus a full-width tray. The body is
|
* The one row: `lead | body | actions`, plus a full-width tray. The body is
|
||||||
* `minmax(0, 1fr)`, so a long title or a run of chips is clipped inside it
|
* `minmax(0, 1fr)`, so a long title or a run of chips is clipped inside it
|
||||||
@@ -470,53 +499,93 @@ export function Expandable({ className, children }: { className: string; childre
|
|||||||
export function Row(props: RowProps) {
|
export function Row(props: RowProps) {
|
||||||
const [moreOpen, setMoreOpen] = useState(false);
|
const [moreOpen, setMoreOpen] = useState(false);
|
||||||
const { open, actions = [] } = props;
|
const { open, actions = [] } = props;
|
||||||
|
// the row as a link: a stretched button under everything; real controls
|
||||||
|
// sit above it, everything else lets the tap through
|
||||||
|
const above = open ? "relative z-1 pointer-events-none" : undefined;
|
||||||
return (
|
return (
|
||||||
<li className="r" data-row={props.kind} data-nolead={flag(!props.lead)}>
|
<li
|
||||||
|
className={cx(
|
||||||
|
"relative grid items-center gap-x-3 min-h-row-min py-2",
|
||||||
|
ROW_RULE,
|
||||||
|
props.lead
|
||||||
|
? "[grid-template-columns:auto_minmax(0,1fr)_auto] [grid-template-areas:'lead_body_act'_'tray_tray_tray']"
|
||||||
|
: "[grid-template-columns:minmax(0,1fr)_auto] [grid-template-areas:'body_act'_'tray_tray']",
|
||||||
|
open && "[&_:is(button,a,select,input,[role=button])]:pointer-events-auto",
|
||||||
|
)}
|
||||||
|
data-row={props.kind}
|
||||||
|
>
|
||||||
{open && (
|
{open && (
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className={cx("r-link", open.className)}
|
className={cx(
|
||||||
|
"r-link absolute inset-0 z-0 p-0 bg-transparent [border:0] cursor-pointer [transition:background_150ms_var(--ease-out)] hover:bg-highlight focus-visible:[outline-offset:-2px]",
|
||||||
|
open.className,
|
||||||
|
)}
|
||||||
aria-label={open.label}
|
aria-label={open.label}
|
||||||
aria-expanded={open.expanded}
|
aria-expanded={open.expanded}
|
||||||
aria-disabled={open.disabled ? "true" : undefined}
|
aria-disabled={open.disabled ? "true" : undefined}
|
||||||
onClick={(event) => open.run(event.currentTarget)}
|
onClick={(event) => open.run(event.currentTarget)}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{props.lead && <div className="r-lead">{props.lead}</div>}
|
{props.lead && (
|
||||||
|
<div className={cx("[grid-area:lead] flex items-center justify-center", above)}>
|
||||||
|
{props.lead}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
{/* biome-ignore lint/a11y/noStaticElementInteractions: the season name expands it too — the chevron stays the accessible control */}
|
{/* biome-ignore lint/a11y/noStaticElementInteractions: the season name expands it too — the chevron stays the accessible control */}
|
||||||
{/* biome-ignore lint/a11y/useKeyWithClickEvents: same */}
|
{/* biome-ignore lint/a11y/useKeyWithClickEvents: same */}
|
||||||
<div className={cx("r-body", props.bodyClassName)} onClick={props.onBodyClick}>
|
<div
|
||||||
|
className={cx("[grid-area:body] grid content-center gap-1 min-w-0", above)}
|
||||||
|
onClick={props.onBodyClick}
|
||||||
|
>
|
||||||
{props.title !== undefined && props.title !== null && (
|
{props.title !== undefined && props.title !== null && (
|
||||||
<div className={cx("r-title", props.titleClassName)}>{props.title}</div>
|
<div
|
||||||
|
className={cx(
|
||||||
|
"min-w-0 truncate leading-row text-ink",
|
||||||
|
TITLE[props.titleStyle ?? "plain"],
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
{props.title}
|
||||||
|
</div>
|
||||||
)}
|
)}
|
||||||
<div className="r-meta">{props.meta}</div>
|
{/* one line of chips; what does not fit fades out at the edge rather
|
||||||
|
than being cut through a word */}
|
||||||
|
<div className="flex items-center flex-nowrap gap-1 min-w-0 overflow-hidden [mask-image:linear-gradient(to_right,var(--ink)_calc(100%_-_1.5rem),transparent)] empty:hidden">
|
||||||
|
{props.meta}
|
||||||
|
</div>
|
||||||
{props.beforeSub}
|
{props.beforeSub}
|
||||||
{props.sub !== undefined &&
|
{props.sub !== undefined &&
|
||||||
props.sub !== null &&
|
props.sub !== null &&
|
||||||
(props.subExpands ? (
|
(props.subExpands ? (
|
||||||
<Expandable className="r-sub readout">{props.sub}</Expandable>
|
<Expandable className={SUB}>{props.sub}</Expandable>
|
||||||
) : (
|
) : (
|
||||||
<div className="r-sub readout">{props.sub}</div>
|
<div className={SUB}>{props.sub}</div>
|
||||||
))}
|
))}
|
||||||
{props.afterSub}
|
{props.afterSub}
|
||||||
</div>
|
</div>
|
||||||
<div className="r-act">
|
{/* every slot has its width whether or not it holds a control, so a row
|
||||||
|
of a kind keeps one action column */}
|
||||||
|
<div className={cx("[grid-area:act] flex items-center justify-end gap-1", above)}>
|
||||||
{actions.map((slot, index) => (
|
{actions.map((slot, index) => (
|
||||||
<span
|
<span
|
||||||
// the column is positional: a slot is its index
|
// the column is positional: a slot is its index
|
||||||
// biome-ignore lint/suspicious/noArrayIndexKey: see above
|
// biome-ignore lint/suspicious/noArrayIndexKey: see above
|
||||||
key={index}
|
key={index}
|
||||||
// a word or a toggle fills its column, so every row's plates line up
|
className={cx(
|
||||||
className={cx("r-slot", slot.width !== "icon" && slot.fill !== false && "*:w-full")}
|
"flex-none items-center justify-center",
|
||||||
|
slot.wide ? "hidden @row:flex" : "flex",
|
||||||
|
slot.narrow && "@row:hidden",
|
||||||
|
SLOT_WIDTH[slot.width],
|
||||||
|
// a word or a toggle fills its column, so every row's plates line up
|
||||||
|
slot.width !== "icon" && slot.fill !== false && "*:w-full",
|
||||||
|
)}
|
||||||
data-width={slot.width}
|
data-width={slot.width}
|
||||||
data-wide={flag(slot.wide)}
|
|
||||||
data-narrow={flag(slot.narrow)}
|
|
||||||
>
|
>
|
||||||
{slot.node}
|
{slot.node}
|
||||||
</span>
|
</span>
|
||||||
))}
|
))}
|
||||||
{props.more && (
|
{props.more && (
|
||||||
<span className="r-slot" data-width="icon" data-narrow="">
|
<span className="flex flex-none items-center justify-center w-control-h @row:hidden">
|
||||||
<IconControl
|
<IconControl
|
||||||
glyph="more"
|
glyph="more"
|
||||||
label="more actions"
|
label="more actions"
|
||||||
@@ -526,15 +595,23 @@ export function Row(props: RowProps) {
|
|||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
{open && open.chevron !== false && actions.length === 0 && (
|
{open && open.chevron !== false && actions.length === 0 && (
|
||||||
<span className="r-slot r-chevron" data-width="icon" aria-hidden="true">
|
<span
|
||||||
<Icon name="chevronRight" />
|
className="flex flex-none items-center justify-center w-control-h text-ink-faint"
|
||||||
|
aria-hidden="true"
|
||||||
|
>
|
||||||
|
<Icon name="chevronRight" className="size-chevron" />
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="r-tray">
|
<div
|
||||||
<NoteLine note={props.note ?? null} className="r-note readout" />
|
className={cx(
|
||||||
|
"[grid-area:tray] grid gap-2 min-w-0 pt-2 [&:not(:has(>:not([hidden])))]:hidden",
|
||||||
|
open && "relative z-1",
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
<NoteLine note={props.note ?? null} className={NOTE} />
|
||||||
{props.more && (
|
{props.more && (
|
||||||
<div className="r-morepanel" hidden={!moreOpen}>
|
<div className="grid gap-2 @row:hidden" hidden={!moreOpen}>
|
||||||
{props.more}
|
{props.more}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@@ -547,18 +624,28 @@ export function Row(props: RowProps) {
|
|||||||
/** A row-shaped placeholder: same height and columns as the row it stands for. */
|
/** A row-shaped placeholder: same height and columns as the row it stands for. */
|
||||||
export function SkeletonRows({ count, withLead = true }: { count: number; withLead?: boolean }) {
|
export function SkeletonRows({ count, withLead = true }: { count: number; withLead?: boolean }) {
|
||||||
return Array.from({ length: count }, (_, index) => (
|
return Array.from({ length: count }, (_, index) => (
|
||||||
// biome-ignore lint/suspicious/noArrayIndexKey: placeholders have no identity
|
<li
|
||||||
<li key={index} className="r r-skel" aria-hidden="true" data-nolead={flag(!withLead)}>
|
// biome-ignore lint/suspicious/noArrayIndexKey: placeholders have no identity
|
||||||
|
key={index}
|
||||||
|
className={cx(
|
||||||
|
"relative grid items-center gap-x-3 min-h-row-min py-2 pointer-events-none",
|
||||||
|
ROW_RULE,
|
||||||
|
withLead
|
||||||
|
? "[grid-template-columns:auto_minmax(0,1fr)_auto] [grid-template-areas:'lead_body_act'_'tray_tray_tray']"
|
||||||
|
: "[grid-template-columns:minmax(0,1fr)_auto] [grid-template-areas:'body_act'_'tray_tray']",
|
||||||
|
)}
|
||||||
|
aria-hidden="true"
|
||||||
|
>
|
||||||
{withLead && (
|
{withLead && (
|
||||||
<div className="r-lead">
|
<div className="[grid-area:lead] flex items-center justify-center">
|
||||||
<span className="skel skel-lead" />
|
<span className={skel.lead} />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<div className="r-body">
|
<div className="[grid-area:body] grid content-center gap-1 min-w-0">
|
||||||
<span className="skel skel-line" />
|
<span className={skel.line} />
|
||||||
<span className="skel skel-line skel-short" />
|
<span className={skel.short} />
|
||||||
</div>
|
</div>
|
||||||
<div className="r-act" />
|
<div className="[grid-area:act] flex items-center justify-end gap-1" />
|
||||||
</li>
|
</li>
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
@@ -567,14 +654,24 @@ export function SkeletonRows({ count, withLead = true }: { count: number; withLe
|
|||||||
export function EmptyRow({
|
export function EmptyRow({
|
||||||
text,
|
text,
|
||||||
tone,
|
tone,
|
||||||
|
lead,
|
||||||
children,
|
children,
|
||||||
}: {
|
}: {
|
||||||
text: string;
|
text: string;
|
||||||
tone?: "fault";
|
tone?: "fault";
|
||||||
|
/** Before the text, such as a probing lamp. */
|
||||||
|
lead?: ReactNode;
|
||||||
children?: ReactNode;
|
children?: ReactNode;
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<li className="r-empty readout" data-tone={tone}>
|
<li
|
||||||
|
className={cx(
|
||||||
|
"readout flex items-center gap-2 min-h-row-min py-2 text-xs text-ink-muted data-[tone=fault]:text-signal-fault",
|
||||||
|
ROW_RULE,
|
||||||
|
)}
|
||||||
|
data-tone={tone}
|
||||||
|
>
|
||||||
|
{lead}
|
||||||
{text}
|
{text}
|
||||||
{children}
|
{children}
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import {
|
|||||||
movieNeedsAttention,
|
movieNeedsAttention,
|
||||||
seriesNeedsAttention,
|
seriesNeedsAttention,
|
||||||
} from "../library";
|
} from "../library";
|
||||||
import { seg, segmented } from "../look";
|
import { seg, segmented, skel } from "../look";
|
||||||
import { MovieCard, MovieRow, SeriesCard, SeriesRow } from "../rows";
|
import { MovieCard, MovieRow, SeriesCard, SeriesRow } from "../rows";
|
||||||
import { allRoots, type LibraryMovie, type Root } from "../search";
|
import { allRoots, type LibraryMovie, type Root } from "../search";
|
||||||
import { Deck, DeckHead, PageBar, Rows, Section, SkeletonRows, useStatus } from "../ui";
|
import { Deck, DeckHead, PageBar, Rows, Section, SkeletonRows, useStatus } from "../ui";
|
||||||
@@ -57,8 +57,8 @@ function GridSkeleton() {
|
|||||||
<span className="card card-skel">
|
<span className="card card-skel">
|
||||||
<span className="card-art" />
|
<span className="card-art" />
|
||||||
<span className="card-body">
|
<span className="card-body">
|
||||||
<span className="skel skel-line" />
|
<span className={skel.line} />
|
||||||
<span className="skel skel-line skel-short" />
|
<span className={skel.short} />
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { useCallback, useEffect, useRef, useState } from "react";
|
|||||||
import { Buckets, type DeckState, type ReleaseActions } from "../buckets";
|
import { Buckets, type DeckState, type ReleaseActions } from "../buckets";
|
||||||
import { LAYER, useEscape, useNav } from "../context";
|
import { LAYER, useEscape, useNav } from "../context";
|
||||||
import { Hero, ProviderLink, RemovePanel, type RemoveSubject, TrailerLink } from "../detail";
|
import { Hero, ProviderLink, RemovePanel, type RemoveSubject, TrailerLink } from "../detail";
|
||||||
import { control } from "../look";
|
import { control, SUB } from "../look";
|
||||||
import {
|
import {
|
||||||
fileName,
|
fileName,
|
||||||
imdbLink,
|
imdbLink,
|
||||||
@@ -84,7 +84,7 @@ function FileRow({
|
|||||||
<Row
|
<Row
|
||||||
kind="file"
|
kind="file"
|
||||||
title={fileName(file.path)}
|
title={fileName(file.path)}
|
||||||
titleClassName="readout"
|
titleStyle="readout"
|
||||||
meta={
|
meta={
|
||||||
<>
|
<>
|
||||||
<WaiverChip waiver={file.waiver} say={say} />
|
<WaiverChip waiver={file.waiver} say={say} />
|
||||||
@@ -96,7 +96,7 @@ function FileRow({
|
|||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
// the full path is evidence, a tap away rather than a hover away
|
// the full path is evidence, a tap away rather than a hover away
|
||||||
afterSub={<Expandable className="r-sub readout">{file.path}</Expandable>}
|
afterSub={<Expandable className={SUB}>{file.path}</Expandable>}
|
||||||
note={note}
|
note={note}
|
||||||
tray={subs.panel}
|
tray={subs.panel}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -223,8 +223,8 @@ function TmdbRow({
|
|||||||
actions={[
|
actions={[
|
||||||
{
|
{
|
||||||
node: (
|
node: (
|
||||||
<span className="r-chevron" aria-hidden="true" data-done={flag(added)}>
|
<span className="text-ink-faint" aria-hidden="true" data-done={flag(added)}>
|
||||||
<Icon name={added ? "check" : "plus"} />
|
<Icon name={added ? "check" : "plus"} className="size-chevron" />
|
||||||
</span>
|
</span>
|
||||||
),
|
),
|
||||||
width: "icon",
|
width: "icon",
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { LAYER, type TvDeckRequest, useEscape, useNav } from "../context";
|
|||||||
import { Hero, ProviderLink, RemovePanel, type RemoveSubject, TrailerLink } from "../detail";
|
import { Hero, ProviderLink, RemovePanel, type RemoveSubject, TrailerLink } from "../detail";
|
||||||
import { ArmedDeleteIcon } from "../icons";
|
import { ArmedDeleteIcon } from "../icons";
|
||||||
import { seriesStatusChipRedundant } from "../library";
|
import { seriesStatusChipRedundant } from "../library";
|
||||||
import { control } from "../look";
|
import { control, cx } from "../look";
|
||||||
import { rottenTomatoesSearch, tmdbSeriesLink, tvdbLink, youtubeLink } from "../movie";
|
import { rottenTomatoesSearch, tmdbSeriesLink, tvdbLink, youtubeLink } from "../movie";
|
||||||
import {
|
import {
|
||||||
audienceOf,
|
audienceOf,
|
||||||
@@ -184,14 +184,18 @@ function SeasonRow({
|
|||||||
label={`${short} episodes`}
|
label={`${short} episodes`}
|
||||||
look="lead"
|
look="lead"
|
||||||
className="disclose-lead"
|
className="disclose-lead"
|
||||||
|
iconClassName={cx(
|
||||||
|
"[transition:transform_200ms_var(--ease-out)]",
|
||||||
|
open && "[transform:rotate(90deg)]",
|
||||||
|
)}
|
||||||
aria-expanded={open}
|
aria-expanded={open}
|
||||||
aria-controls={`episodes-${season.number}`}
|
aria-controls={`episodes-${season.number}`}
|
||||||
onClick={onToggleOpen}
|
onClick={onToggleOpen}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
title={name}
|
title={name}
|
||||||
|
titleStyle="season"
|
||||||
// the season's name expands it too — the chevron stays the accessible control
|
// the season's name expands it too — the chevron stays the accessible control
|
||||||
bodyClassName="r-toggle-body"
|
|
||||||
onBodyClick={(event) => {
|
onBodyClick={(event) => {
|
||||||
if (event.target instanceof Element && event.target.closest("button, [role=button]")) {
|
if (event.target instanceof Element && event.target.closest("button, [role=button]")) {
|
||||||
return;
|
return;
|
||||||
@@ -284,7 +288,11 @@ function SeasonRow({
|
|||||||
}
|
}
|
||||||
note={note}
|
note={note}
|
||||||
tray={
|
tray={
|
||||||
<ul className="episodes" id={`episodes-${season.number}`} hidden={!open}>
|
<ul
|
||||||
|
className="m-0 p-0 list-none [background:oklch(from_var(--panel)_l_c_h/50%)]"
|
||||||
|
id={`episodes-${season.number}`}
|
||||||
|
hidden={!open}
|
||||||
|
>
|
||||||
{season.episodes.map((episode) => (
|
{season.episodes.map((episode) => (
|
||||||
<EpisodeRow
|
<EpisodeRow
|
||||||
key={episode.id}
|
key={episode.id}
|
||||||
@@ -405,7 +413,11 @@ function EpisodeRow({
|
|||||||
return (
|
return (
|
||||||
<Row
|
<Row
|
||||||
kind="episode"
|
kind="episode"
|
||||||
lead={<span className="lead-tag readout">{`E${two(episode.number)}`}</span>}
|
lead={
|
||||||
|
<span className="readout w-control-h text-center text-xs font-semibold text-ink-faint">
|
||||||
|
{`E${two(episode.number)}`}
|
||||||
|
</span>
|
||||||
|
}
|
||||||
title={episode.title === "" ? "—" : episode.title}
|
title={episode.title === "" ? "—" : episode.title}
|
||||||
meta={
|
meta={
|
||||||
<>
|
<>
|
||||||
@@ -689,10 +701,10 @@ export function SeriesView({ seriesId, covered }: { seriesId: number; covered: b
|
|||||||
<Control text="retry" quiet disabled={retrying} onClick={() => void retryRefresh()} />
|
<Control text="retry" quiet disabled={retrying} onClick={() => void retryRefresh()} />
|
||||||
</EmptyRow>
|
</EmptyRow>
|
||||||
) : (
|
) : (
|
||||||
<li className="r-empty readout">
|
<EmptyRow
|
||||||
<span className="lamp" data-state="probing" />
|
lead={<span className="lamp" data-state="probing" />}
|
||||||
{" refreshing metadata — seasons will appear here"}
|
text=" refreshing metadata — seasons will appear here"
|
||||||
</li>
|
/>
|
||||||
)
|
)
|
||||||
) : (
|
) : (
|
||||||
<EmptyRow text="no seasons listed upstream" />
|
<EmptyRow text="no seasons listed upstream" />
|
||||||
|
|||||||
@@ -767,7 +767,7 @@ function SettingsRow({
|
|||||||
<Row
|
<Row
|
||||||
kind="setting"
|
kind="setting"
|
||||||
title={title}
|
title={title}
|
||||||
titleClassName="readout"
|
titleStyle="readout"
|
||||||
meta={chips.map((text) => <Chip key={text}>{text}</Chip>)}
|
meta={chips.map((text) => <Chip key={text}>{text}</Chip>)}
|
||||||
actions={[
|
actions={[
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user