Redesign - Shared field foundation rules (duplicated across 15 form components and emitted globally) are now identical everywhere, so later copies no longer silently override earlier redesigns. - Drawn checkbox and radio controls, white switch thumbs (the thumb was the text colour, a black blob in light mode), recessed field wells, keycap actions in Modal, Drawer, Popover, Toaster, Pagination, Stepper, DataTable. - Menus (Dropdown, ContextMenu, Popover, Select dropdown, Navbar panels) share one flat raised panel with neutral hover rows and mono section labels. - Alerts with an accent rail and icon chip; card headers without the grey band; accordion, collapse, list, list group, timeline, stats, metrics, chat, skeleton, avatar group, clipboard, splitter, section, sidebar, navbar and upload progress restyled. - Chart rebuilt: nice y-axis ticks, gridlines, rounded bars, line and area modes, hover tooltips, hidden series leave the scale. Fixes - Checkbox and radio labels toggle their input again (empty for="" broke it). - TimePicker kept every clicked time pressed; only the chosen hour and minute are pressed now, and nothing is pressed before a value exists. - ColorPicker hex readout now follows the picked colour. - Disabled FileInput no longer shows the native file-input text. - Date and time panels float instead of pushing content. - ContextMenu opened at the pointer closes on scroll. - Drawer left/top/bottom placements slide from their own edge again. - Image-only Card no longer renders an empty body strip. - Timeline supports item.time, current/upcoming states, sizes and compact/alternate variants; showcase demos use distinct variants. - ChatBubble: delivery receipts (sending/sent/delivered/read/failed/error) and meta aligned to its bubble. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
204 lines
5.7 KiB
Plaintext
204 lines
5.7 KiB
Plaintext
import Container from "./Container.wrn"
|
|
|
|
component Section {
|
|
props {
|
|
id: string = ""
|
|
size: string = "default"
|
|
color: string = "primary"
|
|
variant: string = "default"
|
|
spacing: string = "lg"
|
|
maxWidth: string = "xl"
|
|
fullWidth: boolean = false
|
|
borderTop: boolean = false
|
|
borderBottom: boolean = false
|
|
class: string = ""
|
|
}
|
|
|
|
view {
|
|
<section
|
|
{...attrs}
|
|
data-ui-component="Section"
|
|
class='wrn-section {class}'
|
|
id='{id}'
|
|
data-size='{size}'
|
|
data-color='{color}'
|
|
data-variant='{variant}'
|
|
data-spacing='{spacing}'
|
|
data-border-top='{borderTop}'
|
|
data-border-bottom='{borderBottom}'
|
|
>
|
|
{#if fullWidth}
|
|
<slot></slot>
|
|
{:else}
|
|
<Container
|
|
columns="1"
|
|
gap="md"
|
|
maxWidth='{maxWidth}'
|
|
size='{size}'
|
|
color='{color}'
|
|
>
|
|
<slot></slot>
|
|
</Container>
|
|
{/if}
|
|
</section>
|
|
}
|
|
|
|
style {
|
|
.wrn-section {
|
|
--section-tint: transparent;
|
|
--section-ink: inherit;
|
|
position: relative;
|
|
isolation: isolate;
|
|
width: 100%;
|
|
min-width: 0;
|
|
padding-block: 3rem;
|
|
background: var(--section-tint);
|
|
color: var(--section-ink);
|
|
scroll-margin-top: var(--wrn-sticky-header-offset, 5rem);
|
|
}
|
|
|
|
.wrn-section[data-spacing="sm"] {
|
|
padding-block: 2rem;
|
|
}
|
|
|
|
.wrn-section[data-spacing="md"] {
|
|
padding-block: 3rem;
|
|
}
|
|
|
|
.wrn-section[data-spacing="xl"] {
|
|
padding-block: 5rem;
|
|
}
|
|
|
|
.wrn-section[data-variant="soft"] {
|
|
--section-tint: var(--wrn-color-surface-soft);
|
|
}
|
|
|
|
.wrn-section[data-variant="raised"] {
|
|
--section-tint: var(--wrn-color-surface-raised);
|
|
}
|
|
|
|
/*
|
|
* tinted and solid pick their fill from the component colour, which is
|
|
* why these are two attributes rather than one class per pairing. The
|
|
* previous version spent a line on every variant and colour combination.
|
|
*/
|
|
.wrn-section[data-variant="tinted"][data-color="primary"] {
|
|
--section-tint: var(--wrn-color-primary-soft);
|
|
}
|
|
|
|
.wrn-section[data-variant="tinted"][data-color="success"] {
|
|
--section-tint: var(--wrn-color-success-soft);
|
|
}
|
|
|
|
.wrn-section[data-variant="tinted"][data-color="warning"] {
|
|
--section-tint: var(--wrn-color-warning-soft);
|
|
}
|
|
|
|
.wrn-section[data-variant="tinted"][data-color="danger"] {
|
|
--section-tint: var(--wrn-color-danger-soft);
|
|
}
|
|
|
|
.wrn-section[data-variant="tinted"][data-color="info"] {
|
|
--section-tint: var(--wrn-color-info-soft);
|
|
}
|
|
|
|
.wrn-section[data-variant="solid"][data-color="primary"] {
|
|
--section-tint: var(--wrn-color-primary);
|
|
--section-ink: var(--wrn-color-on-primary);
|
|
}
|
|
|
|
.wrn-section[data-variant="solid"][data-color="danger"] {
|
|
--section-tint: var(--wrn-color-danger);
|
|
--section-ink: var(--wrn-color-on-danger);
|
|
}
|
|
|
|
.wrn-section[data-variant="solid"][data-color="secondary"] {
|
|
--section-tint: var(--wrn-color-secondary);
|
|
--section-ink: var(--wrn-color-on-secondary, #fff);
|
|
}
|
|
|
|
.wrn-section[data-variant="solid"][data-color="success"] {
|
|
--section-tint: var(--wrn-color-success);
|
|
--section-ink: #fff;
|
|
}
|
|
|
|
.wrn-section[data-variant="solid"][data-color="info"] {
|
|
--section-tint: var(--wrn-color-info);
|
|
--section-ink: #fff;
|
|
}
|
|
|
|
.wrn-section[data-variant="solid"][data-color="warning"] {
|
|
--section-tint: var(--wrn-color-warning);
|
|
--section-ink: #fff;
|
|
}
|
|
|
|
.wrn-section[data-spacing="none"] {
|
|
padding-block: 0;
|
|
}
|
|
|
|
/* Soft and raised read as bands: hairlines mark where they start and end. */
|
|
.wrn-section[data-variant="soft"],
|
|
.wrn-section[data-variant="tinted"] {
|
|
box-shadow:
|
|
inset 0 1px 0 color-mix(in srgb, var(--wrn-color-border) 70%, transparent),
|
|
inset 0 -1px 0 color-mix(in srgb, var(--wrn-color-border) 70%, transparent);
|
|
}
|
|
|
|
.wrn-section[data-variant="raised"] {
|
|
box-shadow:
|
|
inset 0 1px 0 var(--wrn-color-border),
|
|
inset 0 -1px 0 var(--wrn-color-border),
|
|
0 12px 32px -20px rgb(0 0 0 / 0.25);
|
|
}
|
|
|
|
/* Solid bands carry a faint dot texture so large fills do not look flat. */
|
|
.wrn-section[data-variant="solid"] {
|
|
background:
|
|
radial-gradient(circle at 1px 1px, rgb(255 255 255 / 0.12) 1px, transparent 0) 0 0 / 20px 20px,
|
|
var(--section-tint);
|
|
}
|
|
|
|
/* Panel: the section becomes a framed, rounded band inside the page gutter. */
|
|
.wrn-section[data-variant="panel"] {
|
|
--section-tint: var(--wrn-color-surface);
|
|
width: auto;
|
|
margin-inline: clamp(0.75rem, 3vw, 2rem);
|
|
border: 1px solid var(--wrn-color-border);
|
|
border-radius: var(--wrn-radius-lg, 1rem);
|
|
box-shadow: var(--wrn-shadow-1);
|
|
}
|
|
|
|
/* Grid: a blueprint backdrop that fades out toward the edges. */
|
|
.wrn-section[data-variant="grid"]::before {
|
|
position: absolute;
|
|
z-index: -1;
|
|
inset: 0;
|
|
background:
|
|
linear-gradient(var(--wrn-color-border) 1px, transparent 1px) 0 0 / 32px 32px,
|
|
linear-gradient(90deg, var(--wrn-color-border) 1px, transparent 1px) 0 0 / 32px 32px;
|
|
content: "";
|
|
-webkit-mask-image: radial-gradient(ellipse at center, #000 40%, transparent 85%);
|
|
mask-image: radial-gradient(ellipse at center, #000 40%, transparent 85%);
|
|
pointer-events: none;
|
|
}
|
|
|
|
.wrn-section[data-border-top="true"] {
|
|
border-top: 1px solid var(--wrn-color-border);
|
|
}
|
|
|
|
.wrn-section[data-border-bottom="true"] {
|
|
border-bottom: 1px solid var(--wrn-color-border);
|
|
}
|
|
|
|
@media (min-width: 640px) {
|
|
.wrn-section[data-spacing="lg"] {
|
|
padding-block: 5rem;
|
|
}
|
|
|
|
.wrn-section[data-spacing="xl"] {
|
|
padding-block: 6rem;
|
|
}
|
|
}
|
|
}
|
|
}
|