Files
Stirling-PDF/frontend/editor/src/portal/views/Home.css
T
EthanHealy01 7529190587 fix(ui): shared Button content-sizing + padding props, and button call-site cleanups (#6914)
## Summary

A batch of shared **design-system** fixes (Button, SegmentedControl,
Chip, a new CarouselDots) and the consumer/call-site cleanups they
unlock, following the button consolidation (#6787). Also includes
dark-theme token alignment and some portal/auth polish that rides on the
same components.

The shared Button now sizes to its content instead of clipping it, gains
per-axis padding controls, and no longer misbehaves while loading or
disabled; several call sites are then migrated onto the proper component
APIs.

## Shared components (`core/ui`)

### Button
- **Content-driven height.** `--button-height` is now a `min-height`,
not a fixed cap. Single-line buttons still land exactly on the shared
control-height scale (pixel-aligned with `ActionIcon` /
`SegmentedControl`), while taller content — wrapped labels, stacked
title + subtitle rows — grows the button instead of being clipped
mid-glyph. Short content is re-centered with `align-content`,
**without** overriding the root `display`, so a consumer's own layout
(e.g. a full-width list row) isn't disturbed.
- **Padding props.** New `p` / `px` / `py` props
(`none`/`xs`/`sm`/`md`/`lg`/`xl`) override the size-based padding per
axis. Vertical padding is applied through a `--sui-btn-py` CSS variable,
so consumers can also set it from their own class.
- **Loading no longer collapses.** A `fullWidth` button is never treated
as icon-only, so an execute button whose label is momentarily absent
while files hydrate (e.g. `ScopedOperationButton`) keeps its full width
with a centered spinner instead of shrinking to an icon-sized square for
a split second.
- **Disabled in dark mode.** A disabled *primary* button keeps a muted
version of its own accent fill (`opacity: 0.55`) instead of Mantine's
near-black `--mantine-color-disabled`, which blended into dark surfaces
and made the button all but disappear. Loading spinners are excluded so
they stay full-strength.

No breaking API changes — buttons that don't opt in render exactly as
before.

### SegmentedControl
- Fixed a bug where a segment marked `disabled` that also happened to be
the currently-selected value was rendered disabled, leaving the active
segment un-selectable/greyed. A disabled option is now only disabled
when it isn't the current value.

### CarouselDots (new)
- New shared dots indicator component (with Storybook story), used by
the login carousel.

### Chip / theme
- Dark-theme tokens in `theme.css` aligned to the portal's `tokens.css`
so the editor and portal (Processor) dark modes stop drifting (chrome
surfaces lift off the darker canvas); plus a Chip dark-mode styling fix
and a small `mantineTheme` cleanup.

## Consumer / call-site cleanups

- **Compare** tool: the swap control is now a regular shared Button
placed **between** the Original and Edited file cards (the bespoke
full-height vertical swap button and its CSS were removed), and the file
cards fill the full available width.
- **Certificate format**: replaced the inline-styled buttons with clean
two-state (primary / secondary) buttons.
- **ToolPicker**: restored the label selectors that #6787 renamed to the
never-emitted `.sui-btn__label`, and fixed the sidebar-search row
clipping.
- **File sidebar**: "View all files" row fix; `FileSidebarFileItem`
migrated off `display:flex` + `gap` on the Button root (which no longer
reaches the nested label) onto `leftSection` / `rightSection` + a
stacked label.

## Portal / auth polish

- Portal button consolidation and styling across Header, SettingsModal,
Home, Infrastructure, ApiKeyCard, and PopularUseCases.
- **Login**: onboarding text now shows the default starting username /
password; login carousel uses the new CarouselDots; desktop OAuth
styling tweak.

## Verification

- Storybook: button sizes measure exactly on the control-height scale
and match `ActionIcon`; icon-only buttons stay square and centered;
`fullWidth` loading buttons hold full width; disabled dark-mode primary
buttons render as a muted accent rather than grey.
- Single-line buttons are pixel-identical before/after; only buttons
whose content previously overflowed a fixed height render differently
(they now fit rather than clip).
- `task frontend:lint` clean; typecheck shows only the pre-existing
third-party `node_modules` noise also present on `main`.
2026-07-10 10:26:47 +00:00

126 lines
2.5 KiB
CSS

.portal-home {
display: flex;
flex-direction: column;
gap: 1.25rem;
padding: 1.5rem;
max-width: 78rem;
margin: 0 auto;
}
/* Paid-tier greeting header */
.portal-home__greeting {
margin-bottom: -0.25rem;
}
.portal-home__greeting-title {
margin: 0 0 0.25rem;
font-size: 1.5rem;
font-weight: 700;
letter-spacing: -0.02em;
color: var(--color-text-2);
}
.portal-home__greeting-date {
margin: 0;
font-size: 0.8125rem;
color: var(--color-text-4);
}
/* Two-column dashboard row (activity + quick actions) */
.portal-home__row {
display: grid;
grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
gap: 1rem;
align-items: stretch;
}
@media (max-width: 60rem) {
.portal-home__row {
grid-template-columns: 1fr;
}
}
/* Quick actions card */
.portal-home__quick-head {
margin-bottom: 0.625rem;
}
.portal-home__quick-title {
margin: 0;
font-size: 0.9375rem;
font-weight: 600;
color: var(--color-text-1);
}
.portal-home__quick-sub {
font-size: 0.75rem;
color: var(--color-text-4);
}
.portal-home__quick-list {
display: flex;
flex-direction: column;
gap: 0.375rem;
}
/* Visual container only — layout (icon / text / arrow) is handled by the
shared Button's leftSection / label / rightSection, not overridden here. */
.portal-home__quick-row {
background: var(--color-bg-subtle);
border: 1px solid var(--color-border-light);
border-radius: var(--radius-md);
text-align: left;
transition:
background var(--motion-fast),
border-color var(--motion-fast);
}
.portal-home__quick-row:hover {
background: var(--color-bg-hover);
border-color: var(--color-border);
}
/* Let the label grow so the arrow (rightSection) is pushed to the far right,
and don't clip the stacked subtitle. */
.portal-home__quick-row .mantine-Button-label {
flex: 1 1 auto;
justify-content: flex-start;
overflow: visible;
}
.portal-home__quick-icon {
display: inline-flex;
align-items: center;
justify-content: center;
width: 1.75rem;
height: 1.75rem;
border-radius: var(--radius-md);
font-size: 0.875rem;
font-weight: 600;
}
.portal-home__quick-text {
display: flex;
flex-direction: column;
align-items: flex-start;
min-width: 0;
}
.portal-home__quick-text strong {
font-size: 0.8125rem;
color: var(--color-text-1);
font-weight: 600;
}
.portal-home__quick-text span {
font-size: 0.75rem;
color: var(--color-text-4);
}
.portal-home__quick-arrow {
font-size: 0.875rem;
color: var(--color-text-5);
}
.portal-home__quick-row:hover .portal-home__quick-arrow {
color: var(--color-blue);
}