{#if caption || description || searchable}
{/if}
}
style {
.wire-next--data-map {
display: grid;
gap: 0.75rem;
padding: 1rem;
border: 1px solid var(--wire-color-border);
border-radius: var(--wire-radius-md);
background: var(--wire-color-surface);
box-shadow: var(--wire-shadow-1);
}
.wire-table {
--table-accent: var(--wire-color-primary);
display: flex;
flex-direction: column;
gap: 0.85rem;
width: 100%;
min-width: 0;
max-width: 100%;
color: var(--wire-color-text);
}
.wire-table[data-color="secondary"] {
--table-accent: var(--wire-color-secondary);
}
.wire-table[data-color="success"] {
--table-accent: var(--wire-color-success);
}
.wire-table[data-color="danger"] {
--table-accent: var(--wire-color-danger);
}
.wire-table[data-color="info"] {
--table-accent: var(--wire-color-info);
}
.wire-table__toolbar {
display: flex;
align-items: flex-end;
justify-content: space-between;
flex-wrap: wrap;
gap: 0.75rem;
}
.wire-table__heading {
display: grid;
gap: 0.2rem;
min-width: 0;
}
.wire-table__caption {
margin: 0;
color: var(--wire-color-text);
font-size: 0.98rem;
font-weight: 650;
}
.wire-table__description {
margin: 0;
color: var(--wire-color-text-muted);
font-size: 0.82rem;
}
.wire-table__actions {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 0.4rem;
}
.wire-table__selected-count {
color: var(--wire-color-text-muted);
font-size: 0.78rem;
font-variant-numeric: tabular-nums;
}
.wire-table__action {
appearance: none;
display: inline-flex;
align-items: center;
gap: 0.35rem;
min-height: 2.1rem;
padding: 0 0.7rem;
color: var(--wire-color-text);
background: var(--wire-color-surface-soft);
border: 1px solid var(--wire-color-border);
border-radius: var(--wire-radius-sm);
font: inherit;
font-size: 0.79rem;
cursor: pointer;
transition: border-color 140ms ease, color 140ms ease, background 140ms ease;
}
.wire-table__action:hover {
color: var(--table-accent);
border-color: color-mix(in srgb, var(--table-accent) 45%, var(--wire-color-border));
}
.wire-table__action[data-tone="danger"] {
color: var(--wire-color-danger);
border-color: color-mix(in srgb, var(--wire-color-danger) 35%, var(--wire-color-border));
}
.wire-table__action[data-tone="danger"]:hover {
background: color-mix(in srgb, var(--wire-color-danger) 12%, transparent);
}
/* Full gridlines: vertical rules between columns as well as rows. */
.wire-table[data-gridlines="grid"] .wire-table__table th,
.wire-table[data-gridlines="grid"] .wire-table__table td {
border-right: 1px solid color-mix(in srgb, var(--wire-color-border) 60%, transparent);
}
.wire-table[data-gridlines="grid"] .wire-table__table th:last-child,
.wire-table[data-gridlines="grid"] .wire-table__table td:last-child {
border-right: 0;
}
.wire-table__search {
display: inline-flex;
align-items: center;
gap: 0.45rem;
min-height: 2.35rem;
padding: 0 0.7rem;
color: var(--wire-color-text-muted);
background: var(--wire-color-surface-soft);
border: 1px solid var(--wire-color-border);
border-radius: 0.7rem;
}
.wire-table__search input {
width: 12rem;
max-width: 100%;
padding: 0;
color: var(--wire-color-text);
background: transparent;
border: 0;
font: inherit;
font-size: 0.83rem;
outline: none;
}
.wire-table__search:focus-within {
border-color: color-mix(in srgb, var(--table-accent) 45%, var(--wire-color-border));
}
/*
* The table scrolls sideways rather than squashing its columns.
*
* max-width matters as much as width here: a wide table -- a comparison
* layout turns every record into a column -- makes the flex item grow to
* fit its content unless it is told not to, and the whole table then
* spilled out over the page beside it instead of scrolling inside its own
* box. min-width: 0 alone is not enough once the parent is a grid.
*/
.wire-table__scroll {
position: relative;
width: 100%;
min-width: 0;
max-width: 100%;
overflow-x: auto;
border: 1px solid var(--wire-color-border);
border-radius: 0.9rem;
}
.wire-table[data-bordered="false"] .wire-table__scroll {
border: 0;
border-radius: 0;
}
.wire-table__table {
width: 100%;
border-collapse: collapse;
font-size: 0.85rem;
}
.wire-table__table th,
.wire-table__table td {
padding: 0.7rem 0.85rem;
text-align: left;
vertical-align: middle;
white-space: nowrap;
}
.wire-table[data-density="compact"] .wire-table__table th,
.wire-table[data-density="compact"] .wire-table__table td {
padding: 0.42rem 0.6rem;
}
.wire-table[data-density="comfortable"] .wire-table__table th,
.wire-table[data-density="comfortable"] .wire-table__table td {
padding: 0.95rem 1rem;
}
.wire-table__table th[data-align="center"],
.wire-table__table td[data-align="center"] {
text-align: center;
}
.wire-table__table th[data-align="end"],
.wire-table__table td[data-align="end"] {
text-align: right;
}
.wire-table__table thead th {
position: sticky;
top: 0;
z-index: 1;
color: var(--wire-color-text-muted);
background: var(--wire-color-surface-soft);
border-bottom: 1px solid var(--wire-color-border);
font-size: 0.76rem;
font-weight: 650;
letter-spacing: 0.02em;
text-transform: uppercase;
}
.wire-table__table tbody tr {
border-bottom: 1px solid color-mix(in srgb, var(--wire-color-border) 60%, transparent);
}
.wire-table__table tbody tr:last-child {
border-bottom: 0;
}
/*
* Row background: stripe, then hover, then selection, each beating the one
* before it.
*
* These were written at whatever specificity fell out naturally, and the
* stripe selector was the strongest -- so a selected row on an even line
* kept its stripe and looked different from a selected row on an odd line,
* and hovering flipped rows between three shades. Selection is a state
* about the row, not decoration, so it wins outright; every rule below
* sits at the same specificity and is ordered deliberately.
*/
.wire-table[data-striped="true"] .wire-table__table tbody tr:nth-child(even) {
background: color-mix(in srgb, var(--wire-color-surface-soft) 55%, transparent);
}
.wire-table[data-striped] .wire-table__table tbody tr:hover:not([data-selected="true"]) {
background: color-mix(in srgb, var(--table-accent) 7%, transparent);
}
/* Every selected row identical, striped or not. */
.wire-table[data-striped] .wire-table__table tbody tr[data-selected="true"] {
background: color-mix(in srgb, var(--table-accent) 15%, transparent);
}
.wire-table[data-striped] .wire-table__table tbody tr[data-selected="true"]:hover {
background: color-mix(in srgb, var(--table-accent) 22%, transparent);
}
.wire-table__sort {
appearance: none;
display: inline-flex;
align-items: center;
gap: 0.32rem;
padding: 0;
color: inherit;
background: transparent;
border: 0;
font: inherit;
font-size: inherit;
font-weight: inherit;
letter-spacing: inherit;
text-transform: inherit;
cursor: pointer;
}
.wire-table__sort:hover {
color: var(--table-accent);
}
.wire-table__sort-icon {
flex: 0 0 auto;
opacity: 0.45;
}
.wire-table__sort[data-active="true"] {
color: var(--table-accent);
}
.wire-table__sort[data-active="true"] .wire-table__sort-icon {
opacity: 1;
}
.wire-table__select-cell {
width: 2.6rem;
text-align: center;
}
.wire-table__check {
appearance: none;
display: inline-flex;
align-items: center;
justify-content: center;
padding: 0;
width: 1.05rem;
height: 1.05rem;
color: transparent;
background: var(--wire-color-surface-raised);
border: 1px solid var(--wire-color-border);
border-radius: 0.32rem;
cursor: pointer;
transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}
.wire-table__check[aria-checked="true"] {
color: var(--wire-color-primary-contrast);
background: var(--table-accent);
border-color: var(--table-accent);
}
.wire-table__check:focus-visible {
outline: none;
box-shadow: 0 0 0 3px color-mix(in srgb, var(--table-accent) 35%, transparent);
}
.wire-table__table--comparison {
width: auto;
min-width: 100%;
}
.wire-table__table--comparison th,
.wire-table__table--comparison td {
min-width: 7rem;
}
.wire-table__table--comparison th[scope="row"] {
color: var(--wire-color-text-muted);
background: var(--wire-color-surface-soft);
font-size: 0.76rem;
font-weight: 650;
text-transform: uppercase;
white-space: nowrap;
}
.wire-table[data-layout="comparison"] .wire-table__table th:first-child,
.wire-table[data-layout="comparison"] .wire-table__table td:first-child {
position: sticky;
left: 0;
z-index: 2;
}
.wire-table__status {
display: flex;
align-items: center;
justify-content: center;
gap: 0.6rem;
padding: 1.75rem 1rem;
color: var(--wire-color-text-muted);
font-size: 0.85rem;
text-align: center;
}
.wire-table__status--error {
color: var(--wire-color-danger);
}
.wire-table__spinner {
width: 0.95rem;
height: 0.95rem;
border: 2px solid color-mix(in srgb, currentColor 30%, transparent);
border-top-color: currentColor;
border-radius: 50%;
animation: wire-table-spin 700ms linear infinite;
}
@keyframes wire-table-spin {
to {
transform: rotate(360deg);
}
}
/* Dim the rows while a refresh is in flight rather than tearing them out:
a table that empties on every keystroke is far harder to read. */
.wire-table[data-loading="true"] .wire-table__table tbody {
opacity: 0.45;
}
/* Keeps the first column readable while the rest scrolls sideways. */
.wire-table[data-sticky-first="true"] .wire-table__table th:first-child,
.wire-table[data-sticky-first="true"] .wire-table__table td:first-child {
position: sticky;
left: 0;
z-index: 2;
background: var(--wire-color-surface);
}
.wire-table[data-sticky-first="true"] .wire-table__table thead th:first-child {
z-index: 3;
}
.wire-table__empty {
margin: 0;
padding: 1.75rem 1rem;
color: var(--wire-color-text-muted);
font-size: 0.85rem;
text-align: center;
}
.wire-table__footer {
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
gap: 0.75rem;
}
.wire-table__range {
margin: 0;
color: var(--wire-color-text-muted);
font-size: 0.8rem;
}
.wire-table__pager {
display: flex;
align-items: center;
gap: 0.5rem;
}
.wire-table__page-size {
display: inline-flex;
align-items: center;
gap: 0.4rem;
color: var(--wire-color-text-muted);
font-size: 0.78rem;
}
.wire-table__page-dropdown {
display: inline-flex;
}
/*
* padding is reset explicitly: an app-level button { padding: ... } rule
* outranks the browser default and would crush the icon inside these
* fixed-size controls.
*/
.wire-table__page-button {
appearance: none;
display: inline-flex;
align-items: center;
justify-content: center;
flex: 0 0 auto;
padding: 0;
width: 2rem;
height: 2rem;
color: var(--wire-color-text);
background: var(--wire-color-surface-soft);
border: 1px solid var(--wire-color-border);
border-radius: 0.55rem;
cursor: pointer;
}
.wire-table__page-button:hover:not(:disabled) {
color: var(--table-accent);
border-color: color-mix(in srgb, var(--table-accent) 40%, var(--wire-color-border));
}
.wire-table__page-button:disabled {
opacity: 0.45;
cursor: not-allowed;
}
.wire-table__page-button svg {
flex: 0 0 auto;
}
.wire-table__page-numbers {
display: inline-flex;
align-items: center;
gap: 0.25rem;
}
.wire-table__page-number {
appearance: none;
min-width: 2rem;
height: 2rem;
padding: 0 0.4rem;
color: var(--wire-color-text-muted);
background: transparent;
border: 1px solid transparent;
border-radius: 0.55rem;
font: inherit;
font-size: 0.78rem;
font-variant-numeric: tabular-nums;
cursor: pointer;
}
.wire-table__page-number:hover {
color: var(--wire-color-text);
background: var(--wire-color-surface-soft);
}
.wire-table__page-number[data-active="true"] {
color: var(--wire-color-primary-contrast);
background: var(--table-accent);
border-color: var(--table-accent);
}
.wire-table__page-indicator {
color: var(--wire-color-text-muted);
font-size: 0.78rem;
font-variant-numeric: tabular-nums;
}
/*
* Below the breakpoint each row becomes its own card and every cell grows
* a label from its column, so the data stays readable without a horizontal
* scrollbar on a phone.
*/
@media (max-width: 639px) {
.wire-table__scroll {
overflow-x: visible;
border: 0;
}
.wire-table__table,
.wire-table__table tbody,
.wire-table__table tr,
.wire-table__table td {
display: block;
width: 100%;
}
.wire-table__table thead {
display: none;
}
/*
* Each row becomes a card. These are the exact tokens Card paints its
* surface with (.wire-next__card-panel in ui.css) rather than a lookalike
* of my own, so a stacked row and a real Card cannot drift apart.
*
* The Card component itself cannot be mounted per row: component tags
* are resolved once, server side, while these rows are cloned in the
* browser from a single template -- every row would share one mount.
*/
.wire-table__table tbody tr {
margin-bottom: 0.7rem;
padding: 0.5rem 0.25rem;
background: var(--wire-color-surface);
border: 1px solid var(--wire-color-border);
border-radius: var(--wire-radius-md);
box-shadow: var(--wire-shadow-1);
}
.wire-table[data-striped="true"] .wire-table__table tbody tr:nth-child(even) {
background: var(--wire-color-surface);
}
.wire-table[data-striped] .wire-table__table tbody tr[data-selected="true"] {
background: color-mix(in srgb, var(--table-accent) 15%, var(--wire-color-surface));
border-color: color-mix(in srgb, var(--table-accent) 45%, var(--wire-color-border));
}
.wire-table__table td {
display: flex;
align-items: center;
justify-content: space-between;
gap: 1rem;
white-space: normal;
text-align: right;
}
.wire-table__table td::before {
content: attr(data-label);
color: var(--wire-color-text-muted);
font-size: 0.72rem;
font-weight: 650;
text-transform: uppercase;
}
.wire-table__select-cell {
width: auto;
}
.wire-table__footer {
justify-content: center;
}
.wire-table__actions {
width: 100%;
}
/* The page-size menu is anchored to a control near the bottom of the
screen; it must be able to render outside the footer box. */
.wire-table__footer,
.wire-table__pager {
overflow: visible;
}
}
}
}