@scalewing/react 1.71.0 → 1.72.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/README.md +48 -2
- package/dist/components/Box.d.ts +3 -2
- package/dist/components/Box.js +3 -2
- package/dist/components/ListGroup.d.ts +11 -3
- package/dist/components/ListGroup.js +6 -3
- package/dist/css/css-action-menu.js +11 -0
- package/dist/css/css-button-group-attached.js +6 -1
- package/dist/css/css-button-natural-width.d.ts +1 -0
- package/dist/css/css-button-natural-width.js +16 -0
- package/dist/css/css-button.js +2 -0
- package/dist/css/css-list-size.d.ts +3 -0
- package/dist/css/css-list-size.js +31 -0
- package/dist/css/css-list-tiles-bounded.d.ts +1 -0
- package/dist/css/css-list-tiles-bounded.js +74 -0
- package/dist/css/css-list-tiles.d.ts +1 -0
- package/dist/css/css-list-tiles.js +37 -7
- package/dist/css/css-list.d.ts +0 -1
- package/dist/css/css-list.js +18 -9
- package/dist/css/css-utilities.js +2 -0
- package/dist/css/list-row-metrics.d.ts +3 -0
- package/dist/css/list-row-metrics.js +18 -0
- package/dist/css/spacing-classes.d.ts +1 -1
- package/dist/css/spacing-classes.js +1 -0
- package/dist/css/stacking.js +2 -1
- package/dist/flex-item-classes.d.ts +15 -0
- package/dist/flex-item-classes.js +6 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -1
- package/dist/list-options.d.ts +13 -5
- package/dist/list-options.js +15 -7
- package/dist/styles.css +87 -15
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @scalewing/react
|
|
2
2
|
|
|
3
|
+
## 1.72.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 942b480: A `Button`, `ButtonLink` and `ActionMenu` keep their natural width as an item of a flex row (`flex-shrink: 0`) and are never wider than their container (`max-width: 100%`): in a crowded row their siblings give way first, so their words stay on the one line they take, and only where the words are longer than the whole container do they wrap, inside the pill. Words are never cut, and no component's DOM changes. The buttons of an attached `ButtonGroup` still share its one row and shrink as before, so a joined control wraps its words inside its segments on a phone rather than spilling past the column. New `shrink={false}` on every Box-based component (`FlexItemProps`, class `sw-no-shrink`) keeps a box such as a header's actions in their own `Inline` at its natural size along its parent's main axis. No new tokens, no new dependency; no prop is removed or renamed. Request: `docs/requests/teisoro-button-natural-width.md`.
|
|
8
|
+
|
|
9
|
+
Migration: nothing to change in code, but check these after upgrading. Any `Inline` without `wrap` (not wrapping is its default) whose Buttons or menus together are wider than it now overflows where their words used to wrap as they were squeezed: give it `wrap`, or a row of its own below `md`. A Button or menu in a nested `Inline` in a crowded row: give that `Inline` `shrink={false}`, or its controls spill out of it.
|
|
10
|
+
|
|
11
|
+
- 38fe3cc: `ListGroup` `size="lg"` (opt-in; `listGroupSizes`, `ListGroupSize`, class `sw-list-group-lg`): every row of the group at least 56 px on every pointer, its parts centred, such as names pressed at a shared counter. `variant="tiles"` now takes `maxHeight` (it threw): the grid scrolls inside the same named region, `rows` counting rows of tiles, the edge shade drawn over the opaque tiles, and a tile focused from the keyboard scrolled fully into view, its ring whole; tiles still take no `footer` (its error now reads "A ListGroup of tiles takes no footer"). A tile's row now fills its tile, so beside a taller tile on the same grid row its press area, fill and focus ring reach the tile's edges (an `action` stays centred). Other variants and sizes render as before. No new tokens, no new dependency. Request: `docs/requests/teisoro-list-group-tiles-scroll.md`.
|
|
12
|
+
|
|
3
13
|
## 1.71.0
|
|
4
14
|
|
|
5
15
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -444,6 +444,29 @@ On the web, `variant="neutral"` is a quiet grey fill (the muted color at 16 %, t
|
|
|
444
444
|
|
|
445
445
|
`Button` `width` is `'content'` (the default: as wide as its words) or `'full'`: the button fills its container's inline size in a `Stack`, a `Grid` cell or any column, and in an `Inline` row takes the space its siblings leave, as a full `Select` does, so an Edit beside a ••• `ActionMenu` fills the row and the menu keeps its own square at the end. The row rule holds for a `Button` that is a direct child of the `Inline`; wrapped in another box it fills that box instead. In a wrapping `Inline` (`wrap`) a full button grows from its words' width and moves to a line of its own when the row runs out, rather than shrinking past its words. Inside a `ButtonGroup` it is not needed: the group already stacks its buttons full width below `md`. The words stay centred. An unknown width throws a `RangeError`. The class is `sw-button-full`.
|
|
446
446
|
|
|
447
|
+
A `Button` (and a `ButtonLink`) keeps its natural width as an item of a flex row (an `Inline` that does not wrap, a header's actions): it gives up none of it (`flex-shrink: 0`), so the row's other items give way first and its words stay on the one line they take at that width, never squeezed onto two or three. It is never wider than its container (`max-width: 100%`): where its words are longer than the whole row or column it is in (a narrow column, a `ButtonGroup` stacked on a phone), they wrap inside the pill, every word shown; they are never cut. A `width="full"` button in an `Inline` still shares the row as before, and so do an attached `ButtonGroup`'s buttons, which shrink to share its one row and wrap their words inside their segments on a narrow phone. Any `Inline` without `wrap` (not wrapping is its default) whose Buttons together are wider than it overflows rather than squeezing them: give it `wrap`, or put the buttons on a row of their own on a narrow screen. A box of several controls that must keep its width as one, such as a header's Button and account menu in their own `Inline`, takes `shrink={false}` (below); an `Inline` otherwise shrinks below its content (`min-width: 0`).
|
|
448
|
+
|
|
449
|
+
```tsx
|
|
450
|
+
<Inline justify="between" align="center" gap={3} wrap={false}>
|
|
451
|
+
<Inline align="center" gap={6} wrap>
|
|
452
|
+
{brand}
|
|
453
|
+
{areas}
|
|
454
|
+
</Inline>
|
|
455
|
+
<Inline align="center" gap={2} wrap={false} shrink={false}>
|
|
456
|
+
<Button size="sm" variant="neutral" onPress={switchRoost}>
|
|
457
|
+
Switch to the night roost
|
|
458
|
+
</Button>
|
|
459
|
+
<ActionMenu
|
|
460
|
+
label={`${colony} · ${habitat}`}
|
|
461
|
+
trigger={colony}
|
|
462
|
+
triggerAppearance="text"
|
|
463
|
+
align="end"
|
|
464
|
+
items={items}
|
|
465
|
+
/>
|
|
466
|
+
</Inline>
|
|
467
|
+
</Inline>
|
|
468
|
+
```
|
|
469
|
+
|
|
447
470
|
On a coarse pointer (a phone or a tablet, `(pointer: coarse)`) every `Button`, `ButtonLink` and control built on them is at least 44 × 44 px (the md control height), whatever its `size`: an `xs` or `sm` Button keeps its padding and type but its box grows to the touch target, so a small row action in a table or a checklist is still easy to tap. A fine pointer keeps each size's height (28, 32 and 44 px). Rows holding small Buttons are taller on touch; two layouts keep `min-width: 0` so their Buttons can share a row, a full-width attached `ButtonGroup` below `md` and a `width="full"` Button in an `Inline`, and both keep the 44 px height. Popovers holding small Buttons grow too, such as `DateField`'s calendar with its footer.
|
|
448
471
|
|
|
449
472
|
`ButtonLink` is a link drawn as a `Button`, for a destination that reads as an action, such as a site's Contact us or Sign in: an `<a href>` with the Button's `variant` (default `primary`), `size` (default `md`) and `width`, so it opens like any link (a new tab, a page rendered with no script) and keeps its variant's words over the canvas link colour, hover included. `aria-current="page"` marks the one that is the current page with the pressed button's ring (a Highlight border in forced colours). A link has no disabled state: render none instead. Use `Button` for a press that does something on the page. An unknown variant, size or width throws a `RangeError`; the class is `sw-button-link` beside the Button's own.
|
|
@@ -485,7 +508,7 @@ A `Button` that toggles something passes `aria-pressed`. The pressed button gets
|
|
|
485
508
|
|
|
486
509
|
`ActionMenu` `header` is a non-interactive block above the commands, such as who is signed in: each child a line of its own, in the caption size and the muted color, set off by a hairline. It sits outside the `role="menu"` element and the arrow keys, and is the menu's description (`aria-describedby`), read as the menu opens; `null`, `false` and `''` are no header. An item's `lang` (a BCP 47 tag) marks its label as another language than the page's, such as "English" on a Spanish page (WCAG 3.1.2).
|
|
487
510
|
|
|
488
|
-
`ActionMenu` `triggerAppearance="text"` (opt-in; default `"framed"`, `actionMenuTriggerAppearances`) draws the trigger as its words (`trigger`, or `label`) in label type at medium weight in the text color, with the shared muted chevron pointing down after them and no fill or outline; the quiet grey fill shows on hover and while the menu is open. It is the sm control height (the 44 px target on a coarse pointer). Name the trigger with `label` as before, and include the words shown in it (WCAG 2.5.3, so voice control can say them): a person's name that opens their account menu takes a `label` such as "Account, Ada Okafor". The trigger's words are one flex item (mixed inline content keeps its spaces), then the chevron. Forced colors draw its border in the system's border color, the chevron in CanvasText, and an open trigger's border in Highlight. An unknown value throws a `RangeError`.
|
|
511
|
+
`ActionMenu` `triggerAppearance="text"` (opt-in; default `"framed"`, `actionMenuTriggerAppearances`) draws the trigger as its words (`trigger`, or `label`) in label type at medium weight in the text color, with the shared muted chevron pointing down after them and no fill or outline; the quiet grey fill shows on hover and while the menu is open. It is the sm control height (the 44 px target on a coarse pointer). Name the trigger with `label` as before, and include the words shown in it (WCAG 2.5.3, so voice control can say them): a person's name that opens their account menu takes a `label` such as "Account, Ada Okafor". The trigger's words are one flex item (mixed inline content keeps its spaces), then the chevron. Every `ActionMenu` keeps its natural width in a crowded flex row, as a `Button` does, so a name in a header stays on its one line while the row's other items give way; it is never wider than its container, and where its words are longer than the whole row they wrap inside the trigger, never cut. Forced colors draw its border in the system's border color, the chevron in CanvasText, and an open trigger's border in Highlight. An unknown value throws a `RangeError`.
|
|
489
512
|
|
|
490
513
|
`ContextSwitcher` is a button showing the context in use, such as a workspace, a competition or a season, that opens a popup to switch it. `label` says what is switched ("Season"); `trigger` is what the button shows, usually the current context (words, or a mark and words on two lines); the button is named by both ("Season Fall 2026", the visible words in the name). `groups` is a list of `{ id, label?, options }`, each option `{ id, label, detail?, icon?, badge?: { label, tone }, count?, countLabel?, countTone? }`: a decorative mark, the label over a muted detail, a status `Badge`, and the shared count pill (`NavCount`'s tones), all read in the option's name, a `countLabel` in place of the number; a `count` of 0 shows no pill, as `NavCount`'s. `currentId` is the option in use, checked and `aria-selected`. The popup is a non-modal dialog named by `label` on the top layer, placed as `ActionMenu`'s list is (`align` `"start"` or `"end"`). Focus moves into it: to the `filter` field when there is one (`{ label, placeholder?, emptyText, minOptions? }`, a combobox that narrows the options by label or detail, case and accents ignored, shows and announces `emptyText` when nothing is left, and appears only from `minOptions` options, 0 by default), else to the listbox. ↓ and ↑ move the active row and Enter chooses it; in the listbox Home and End go to the ends, letters jump by typeahead and Space chooses. Choosing closes the popup, puts focus back on the trigger, then calls `onSelect(option)`; the current option only closes it. `actions` (`{ id, label, icon?, onSelect }`) are commands in a footer under a hairline, reached with Tab, that close the popup and return focus to the trigger before they run. Escape closes it with focus on the trigger (and stops there, so an `AppShell` drawer round it stays open); a press outside or Tab out of it (or Shift+Tab back to the trigger) closes it where focus went. Focus leaving the window (another app, a browser tab) leaves it open until the next press. A press on the popup's caption, padding or a row keeps focus in the field or the listbox, so the keys keep working; Enter while an input method composes is the method's. The popup is at least 15rem and never narrower than the trigger, capped by the viewport, and follows the trigger's width while open. `triggerAppearance` is `"framed"` (default, the outlined control), `"text"` (words and a chevron, no fill until hovered or open), `"pill"` (a rounded outlined pill at label weight) or `"icon"` (a glyph alone in a round quiet button, no chevron, named by `label` and the current option's label, for a rail); `width="full"` fills the column, such as a sidebar's top. The trigger, options and commands are 44 px on a coarse pointer; forced colours draw the active row in `Highlight`. Keep state shared by several copies (an `AppShell` header and its rail, for instance) in your own component. Blank words, empty or duplicate groups, options or actions, a bad count, badge or tone, a `currentId` that names no option, a trigger that draws nothing, and an unknown `triggerAppearance`, `width` or `align` throw a `RangeError`.
|
|
491
514
|
|
|
@@ -1362,7 +1385,28 @@ The frame is centred at `SiteHeader`'s bar width with its gutters, so the naviga
|
|
|
1362
1385
|
</Card>
|
|
1363
1386
|
```
|
|
1364
1387
|
|
|
1365
|
-
`ListGroup` is rows in one list with a hairline between each pair, the web twin of react-native's: a `ul` (its list role kept) named by `aria-label` or `aria-labelledby`. `variant="panel"` (the default) is one bordered panel; `plain` draws no panel and a hairline above the first row too, for rows inside a `Card`. `variant="tiles"` keeps one list (its name, its list items, a screen reader's count of them) and lays its rows out as tiles: each row its own bordered panel on the surface with no hairline between them, in `tileColumns` equal columns (`2`, `3` the default, or `4`; `listTileColumnCounts`, `ListGroupTileColumns`) a spacing step 3 apart from `md` up, one a row below it, such as a strip of new arrivals under its heading. A row's press fill and inset focus ring stay inside its tile; `truncate` keeps a long title to one line in a narrow tile.
|
|
1388
|
+
`ListGroup` is rows in one list with a hairline between each pair, the web twin of react-native's: a `ul` (its list role kept) named by `aria-label` or `aria-labelledby`. `variant="panel"` (the default) is one bordered panel; `plain` draws no panel and a hairline above the first row too, for rows inside a `Card`. `variant="tiles"` keeps one list (its name, its list items, a screen reader's count of them) and lays its rows out as tiles: each row its own bordered panel on the surface with no hairline between them, in `tileColumns` equal columns (`2`, `3` the default, or `4`; `listTileColumnCounts`, `ListGroupTileColumns`) a spacing step 3 apart from `md` up, one a row below it, such as a strip of new arrivals under its heading. A row's press fill and inset focus ring stay inside its tile, and fill it: tiles on one grid row are as tall as the tallest, and a shorter tile's row stretches to its edges (an `action` stays centred); `truncate` keeps a long title to one line in a narrow tile. With `maxHeight`, tiles scroll as a bounded list does: the grid sits in the same named scroll region (a keyboard stop, its name required), `rows` counts rows of tiles (each the counted row of a title and one detail line, 62 px, inside its two hairlines, the gap between them; one tile a row on a phone), and the shade on an edge with more past it is drawn over the tiles, which would hide one drawn under them. Since the count assumes a detail line, title-only `lg` tiles (58 px with their hairlines) show a part of the next row under the shade, which says there is more. Tab moves through the tiles in their reading order, row by row, and the region keeps a spacing-step-5 margin (`scroll-padding-block`) so a focused tile scrolls fully into view, clear of the shade, its ring whole; the margin is clamped to what the region has over one row of tiles, so a region one row tall (`rows: 1`) keeps none: its focused tile is whole, with its ring, but may sit under both shades. There is no virtualisation: every tile is in the DOM. Tiles take no `footer` (they do not add up to a total), and `tileColumns` needs `tiles`; either throws a `RangeError`, as does a count other than 2, 3 or 4. `size="lg"` (opt-in; default `"md"`, `listGroupSizes`, `ListGroupSize`) makes every row of the group at least 56 px tall on every pointer (spacing steps 8 and 2, class `sw-list-group-lg`), its parts centred in the row, a larger press target than the 44 px a pressable row takes on a coarse pointer, such as a grid of names chosen at a shared counter; a row of a title and a detail is taller than that already. A bounded list counts the same rows at either size. An unknown size throws a `RangeError`.
|
|
1389
|
+
|
|
1390
|
+
```tsx
|
|
1391
|
+
<ListGroup
|
|
1392
|
+
aria-labelledby="who"
|
|
1393
|
+
variant="tiles"
|
|
1394
|
+
size="lg"
|
|
1395
|
+
maxHeight={{ rows: 4 }}
|
|
1396
|
+
>
|
|
1397
|
+
{people.map((person) => (
|
|
1398
|
+
<ListRow
|
|
1399
|
+
key={person.id}
|
|
1400
|
+
title={person.name}
|
|
1401
|
+
truncate
|
|
1402
|
+
accessory="none"
|
|
1403
|
+
onPress={() => choose(person)}
|
|
1404
|
+
/>
|
|
1405
|
+
))}
|
|
1406
|
+
</ListGroup>
|
|
1407
|
+
```
|
|
1408
|
+
|
|
1409
|
+
Each `ListRow` has a `title` (weight 600, or the body weight with `titleAppearance="plain"`; `tone="danger"` for a row that ends something), an optional muted `detail` line, an optional `value` at its end (weight 600, tabular figures; `valueTone` `success`, `danger`, `muted`, `accent` or `warning`, the warning colour's ink moved halfway to the text colour so it keeps 4.5:1 on the surface in every palette; `valueBadge` draws the value as a `Badge` in that tone instead, such as a status, still read in the row's name, never with `valueTone`; `valueDetail` a muted line under it) and an optional `leading` mark such as a status dot, hidden from assistive technology, so the words say what it means. With `onPress` the whole row is a button, and with `href` a link (`onPress` then takes a plain press for a client router); either adds a chevron, a quiet fill under the pointer and 44 px on a coarse pointer, and the row is named by its title and value and described by its detail lines (`aria-label` replaces the name). `selected` makes a pressable row a choice: a check while true, `aria-pressed` on a button or `aria-current` on a link (on a row with neither `onPress` nor `href` it throws, since nothing could read the state). `accessory="none"` hides the chevron of a row that acts in place; `disabled` blocks presses. A row with neither `onPress` nor `href` only states something. `maxHeight={{ rows }}` bounds the list to that many rows of a title and one detail line, the rest scrolling inside its own named region, which shades an edge with more rows past it; a bounded list must be named. `footer` stays pinned under the rows, outside the scroll, such as a `ListRow` with the count and the total (a row there is not a list item). An empty title or value, an unknown variant, tone or badge tone, a `valueDetail`, `valueTone` or `valueBadge` without a value, a value both toned and a badge, or a bad row count throws a `RangeError`.
|
|
1366
1410
|
|
|
1367
1411
|
`FixtureRow` is one pairing of two sides, such as a game: `home` and `away` (`{ name, mark? }`, the mark a hidden crest beside the name on the centre's side), `center` (a kickoff time, `centerKind="time"`, the default, in a small grey chip, or a score, `"score"`, in bold figures; both tabular), then `meta` (muted, such as the field) and `status` (`{ label, tone }`, a small `Badge`) at the end. The home side ends at the centre and the away side starts from it, mirrored in right-to-left; names wrap. Rows live in a `FixtureGroup` (`{ title, children }`), a caption that names their list (a date and a venue): the list is one grid and each row a subgrid of it, so the centres and ends line up down the run whatever the names (a browser without subgrid, before Chrome 117 or Safari 16, draws each row on its own grid, unaligned). Below `md` the end moves under the sides; `metaHideBelow` (`md` or `lg`) leaves the meta out below it. With `href` the whole row is a link and with `onPress` alone a button (with both, `onPress` takes a plain press on the link for a client router), with a chevron, a hover fill, an inset focus ring and 44 px; `aria-label` names it in your words ("Heron Marsh with Otter Pool, 8:00"), otherwise it is named by what it shows, in order. A blank title, a row outside a group, a side without a name, a blank centre, an unknown `centerKind` or `metaHideBelow`, a bad status, a blank `href`, or an `aria-label` that is blank or on a row with neither `href` nor `onPress` throws a `RangeError`.
|
|
1368
1412
|
|
|
@@ -1682,6 +1726,8 @@ Every `Box`-based component (`Box`, `Stack`, `Inline`, `Card`, `Grid`, …) take
|
|
|
1682
1726
|
|
|
1683
1727
|
Values outside the catalog throw a `RangeError`. There is no per-breakpoint span and no arbitrary column template.
|
|
1684
1728
|
|
|
1729
|
+
Every `Box`-based component also takes `shrink`. `shrink={false}` (opt-in, the generated `sw-no-shrink`, `flex-shrink: 0`) keeps the box at its natural size along its parent's main axis when the parent is a flex container short of room (its width in an `Inline` row, its height in a `Stack` column): it gives up none of it and its siblings give way instead, such as a header's actions (a `Button` and an account `ActionMenu` in their own `Inline`) beside navigation that wraps. An `Inline` or `Stack` otherwise shrinks below its content (`min-width: 0`), so the controls in it would be squeezed or spill out of it. The box can then be larger than its parent, so keep it for content that fits at the widths you support. `shrink` left out or `true` changes nothing.
|
|
1730
|
+
|
|
1685
1731
|
`Grid` `align` (`start`, `center`, `end`, `stretch`) sets where each child sits in the height of its row, with the same generated `sw-align-*` classes as `Stack` and `Inline`. Unset, children stretch. `align="end"` keeps a row of fields level when one label wraps:
|
|
1686
1732
|
|
|
1687
1733
|
```tsx
|
package/dist/components/Box.d.ts
CHANGED
|
@@ -3,10 +3,11 @@ import { type AnchorHTMLAttributes, type HTMLAttributes } from 'react';
|
|
|
3
3
|
import { type BoxBorderValue } from '../css/css-box-border.js';
|
|
4
4
|
import { type BoxLinkAppearance } from '../css/css-box-link.js';
|
|
5
5
|
import { type ColumnSpanProps } from '../column-span-classes.js';
|
|
6
|
+
import { type FlexItemProps } from '../flex-item-classes.js';
|
|
6
7
|
import { type SpacingProps } from '../spacing-classes.js';
|
|
7
8
|
import { type VisibilityProps } from '../visibility-classes.js';
|
|
8
9
|
export type BoxElement = 'div' | 'section' | 'article' | 'header' | 'footer' | 'main' | 'nav' | 'aside' | 'span' | 'a' | 'label';
|
|
9
|
-
export type BoxProps = SpacingProps & VisibilityProps & ColumnSpanProps & HTMLAttributes<HTMLElement> & Pick<AnchorHTMLAttributes<HTMLAnchorElement>, 'download' | 'href' | 'rel' | 'target'> & {
|
|
10
|
+
export type BoxProps = SpacingProps & VisibilityProps & ColumnSpanProps & FlexItemProps & HTMLAttributes<HTMLElement> & Pick<AnchorHTMLAttributes<HTMLAnchorElement>, 'download' | 'href' | 'rel' | 'target'> & {
|
|
10
11
|
as?: BoxElement;
|
|
11
12
|
background?: Extract<SemanticColorKey, 'background' | 'surface'>;
|
|
12
13
|
radius?: RadiusStep;
|
|
@@ -43,7 +44,7 @@ export type BoxProps = SpacingProps & VisibilityProps & ColumnSpanProps & HTMLAt
|
|
|
43
44
|
};
|
|
44
45
|
export type BoxBorder = BoxBorderValue;
|
|
45
46
|
export type BoxLink = BoxLinkAppearance;
|
|
46
|
-
export declare const Box: import("react").ForwardRefExoticComponent<SpacingProps & VisibilityProps & ColumnSpanProps & HTMLAttributes<HTMLElement> & Pick<AnchorHTMLAttributes<HTMLAnchorElement>, "rel" | "download" | "href" | "target"> & {
|
|
47
|
+
export declare const Box: import("react").ForwardRefExoticComponent<SpacingProps & VisibilityProps & ColumnSpanProps & FlexItemProps & HTMLAttributes<HTMLElement> & Pick<AnchorHTMLAttributes<HTMLAnchorElement>, "rel" | "download" | "href" | "target"> & {
|
|
47
48
|
as?: BoxElement;
|
|
48
49
|
background?: Extract<SemanticColorKey, "background" | "surface">;
|
|
49
50
|
radius?: RadiusStep;
|
package/dist/components/Box.js
CHANGED
|
@@ -4,11 +4,12 @@ import { cx } from '../class-names.js';
|
|
|
4
4
|
import { boxBorderClass } from '../css/css-box-border.js';
|
|
5
5
|
import { assertBoxLink, boxLinkClass, } from '../css/css-box-link.js';
|
|
6
6
|
import { columnSpanClassNames, } from '../column-span-classes.js';
|
|
7
|
+
import { flexItemClassNames, } from '../flex-item-classes.js';
|
|
7
8
|
import { spacingClassNames } from '../spacing-classes.js';
|
|
8
9
|
import { assertBoxExternal, externalLinkContent, externalLinkRel, } from './box/external-link.js';
|
|
9
10
|
import { tabStop } from '../tab-stop.js';
|
|
10
11
|
import { visibilityClassNames, } from '../visibility-classes.js';
|
|
11
|
-
export const Box = forwardRef(function Box({ as = 'div', background, border, children, className, columnSpan, external, hideBelow, hideFrom, link, newTabLabel, padding, paddingBottom, paddingLeft, paddingRight, paddingTop, paddingX, paddingY, radius, rel, style, tabIndex, target, ...rest }, ref) {
|
|
12
|
+
export const Box = forwardRef(function Box({ as = 'div', background, border, children, className, columnSpan, external, hideBelow, hideFrom, link, newTabLabel, padding, paddingBottom, paddingLeft, paddingRight, paddingTop, paddingX, paddingY, radius, rel, shrink, style, tabIndex, target, ...rest }, ref) {
|
|
12
13
|
assertBoxLink(link, as);
|
|
13
14
|
assertBoxExternal({ as, external, newTabLabel });
|
|
14
15
|
// assertBoxExternal has made sure an external link has its words.
|
|
@@ -24,7 +25,7 @@ export const Box = forwardRef(function Box({ as = 'div', background, border, chi
|
|
|
24
25
|
paddingTop,
|
|
25
26
|
paddingX,
|
|
26
27
|
paddingY,
|
|
27
|
-
}), ...visibilityClassNames({ hideBelow, hideFrom }), ...columnSpanClassNames({ columnSpan }), boxBorderClass(border), boxLinkClass(link), className), style: {
|
|
28
|
+
}), ...visibilityClassNames({ hideBelow, hideFrom }), ...columnSpanClassNames({ columnSpan }), ...flexItemClassNames({ shrink }), boxBorderClass(border), boxLinkClass(link), className), style: {
|
|
28
29
|
backgroundColor: background
|
|
29
30
|
? `var(--sw-color-${background})`
|
|
30
31
|
: undefined,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
import { type ListGroupTileColumns } from '../css/css-list-tiles.js';
|
|
3
|
-
import { type ListGroupMaxHeight, type ListGroupVariant } from '../list-options.js';
|
|
3
|
+
import { type ListGroupMaxHeight, type ListGroupSize, type ListGroupVariant } from '../list-options.js';
|
|
4
4
|
export type ListGroupProps = {
|
|
5
5
|
/** `ListRow` elements; the group draws a hairline between each pair. */
|
|
6
6
|
children: ReactNode;
|
|
@@ -16,10 +16,17 @@ export type ListGroupProps = {
|
|
|
16
16
|
variant?: ListGroupVariant;
|
|
17
17
|
/** How many tiles share a row from `md` up (`tiles` only): 2, 3 (default) or 4. */
|
|
18
18
|
tileColumns?: ListGroupTileColumns;
|
|
19
|
+
/**
|
|
20
|
+
* `md` (the default) rows are as tall as their words; `lg` rows stand
|
|
21
|
+
* at least 56 px on every pointer with their words centred, a larger
|
|
22
|
+
* press target such as a name pressed at a shared counter.
|
|
23
|
+
*/
|
|
24
|
+
size?: ListGroupSize;
|
|
19
25
|
/**
|
|
20
26
|
* Bounds the list to a row count of its own region, `{ rows }` rows of a
|
|
21
27
|
* title and one detail line, where the rest scroll; the region is a named
|
|
22
|
-
* keyboard stop and shades an edge with more rows past it.
|
|
28
|
+
* keyboard stop and shades an edge with more rows past it. With `tiles`
|
|
29
|
+
* it counts rows of tiles, the grid scrolling inside the region.
|
|
23
30
|
*/
|
|
24
31
|
maxHeight?: ListGroupMaxHeight;
|
|
25
32
|
/**
|
|
@@ -33,6 +40,7 @@ export type ListGroupProps = {
|
|
|
33
40
|
/**
|
|
34
41
|
* Rows in one list (`ul`, its list role kept) with hairlines between them:
|
|
35
42
|
* a panel of its own, or plain rows inside a surface; or the same list's
|
|
36
|
-
* rows as tiles, each a panel
|
|
43
|
+
* rows as tiles, each a panel, bounded to a count of rows (of tiles)
|
|
44
|
+
* that scroll in a named region. The ref reaches the outer box.
|
|
37
45
|
*/
|
|
38
46
|
export declare const ListGroup: import("react").ForwardRefExoticComponent<ListGroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
4
|
import { cx } from '../class-names.js';
|
|
5
|
+
import { listGroupLargeClass } from '../css/css-list-size.js';
|
|
5
6
|
import { listTileColumnsClass, } from '../css/css-list-tiles.js';
|
|
6
7
|
import { assertListGroup, listMaxHeightStyle, } from '../list-options.js';
|
|
7
8
|
import { ListRowContainer } from './list/list-row-container.js';
|
|
@@ -9,13 +10,15 @@ import { ScrollRegion } from './ScrollRegion.js';
|
|
|
9
10
|
/**
|
|
10
11
|
* Rows in one list (`ul`, its list role kept) with hairlines between them:
|
|
11
12
|
* a panel of its own, or plain rows inside a surface; or the same list's
|
|
12
|
-
* rows as tiles, each a panel
|
|
13
|
+
* rows as tiles, each a panel, bounded to a count of rows (of tiles)
|
|
14
|
+
* that scroll in a named region. The ref reaches the outer box.
|
|
13
15
|
*/
|
|
14
|
-
export const ListGroup = forwardRef(function ListGroup({ children, 'aria-label': label, 'aria-labelledby': labelledBy, variant = 'panel', tileColumns, maxHeight, footer, className, id, }, ref) {
|
|
16
|
+
export const ListGroup = forwardRef(function ListGroup({ children, 'aria-label': label, 'aria-labelledby': labelledBy, variant = 'panel', tileColumns, size = 'md', maxHeight, footer, className, id, }, ref) {
|
|
15
17
|
assertListGroup({
|
|
16
18
|
label,
|
|
17
19
|
labelledBy,
|
|
18
20
|
variant,
|
|
21
|
+
size,
|
|
19
22
|
maxHeight,
|
|
20
23
|
tileColumns,
|
|
21
24
|
hasFooter: footer !== undefined,
|
|
@@ -23,5 +26,5 @@ export const ListGroup = forwardRef(function ListGroup({ children, 'aria-label':
|
|
|
23
26
|
const list = (_jsx("ul", { "aria-label": label, "aria-labelledby": labelledBy, className: "sw-list",
|
|
24
27
|
// A list styled without bullets loses its role in Safari.
|
|
25
28
|
role: "list", children: _jsx(ListRowContainer.Provider, { value: "li", children: children }) }));
|
|
26
|
-
return (_jsxs("div", { className: cx('sw-list-group', `sw-list-group-${variant}`, variant === 'tiles' && listTileColumnsClass(tileColumns ?? 3), className), id: id, ref: ref, children: [maxHeight === undefined ? (list) : (_jsx(ScrollRegion, { "aria-label": label, "aria-labelledby": labelledBy, className: "sw-list-group-scroll", style: listMaxHeightStyle(maxHeight), children: list })), footer === undefined ? null : (_jsx("div", { className: "sw-list-group-footer", children: _jsx(ListRowContainer.Provider, { value: "div", children: footer }) }))] }));
|
|
29
|
+
return (_jsxs("div", { className: cx('sw-list-group', `sw-list-group-${variant}`, variant === 'tiles' && listTileColumnsClass(tileColumns ?? 3), size === 'lg' && listGroupLargeClass, className), id: id, ref: ref, children: [maxHeight === undefined ? (list) : (_jsx(ScrollRegion, { "aria-label": label, "aria-labelledby": labelledBy, className: "sw-list-group-scroll", style: listMaxHeightStyle(maxHeight), children: list })), footer === undefined ? null : (_jsx("div", { className: "sw-list-group-footer", children: _jsx(ListRowContainer.Provider, { value: "div", children: footer }) }))] }));
|
|
27
30
|
});
|
|
@@ -6,9 +6,19 @@ import { coarsePointerQuery, touchTarget } from './touch-target.js';
|
|
|
6
6
|
import { quietFill } from './quiet-fill.js';
|
|
7
7
|
const caption = typographyVariants.caption;
|
|
8
8
|
const label = typographyVariants.label;
|
|
9
|
+
/*
|
|
10
|
+
* A menu keeps its natural width as an item of a crowded flex row, as a
|
|
11
|
+
* Button does (css-button-natural-width.ts): it gives up none of it
|
|
12
|
+
* (`flex-shrink: 0`), so the row's other items give way first and a name
|
|
13
|
+
* in a header stays on its one line. The menu and its trigger are never
|
|
14
|
+
* wider than their container (`max-width: 100%`): where the trigger's
|
|
15
|
+
* words are longer than the whole row, they wrap inside it, never cut.
|
|
16
|
+
*/
|
|
9
17
|
export function cssActionMenuClasses() {
|
|
10
18
|
return `.sw-action-menu {
|
|
11
19
|
display: inline-flex;
|
|
20
|
+
flex-shrink: 0;
|
|
21
|
+
max-width: 100%;
|
|
12
22
|
position: relative;
|
|
13
23
|
}
|
|
14
24
|
|
|
@@ -20,6 +30,7 @@ export function cssActionMenuClasses() {
|
|
|
20
30
|
color: var(--sw-color-text);
|
|
21
31
|
cursor: pointer;
|
|
22
32
|
font: inherit;
|
|
33
|
+
max-width: 100%;
|
|
23
34
|
min-height: var(--sw-control-xs-min-height);
|
|
24
35
|
padding-inline: var(--sw-control-xs-padding-inline);
|
|
25
36
|
}
|
|
@@ -11,7 +11,11 @@ export function buttonGroupFullWidthClass(breakpoint) {
|
|
|
11
11
|
* height, their borders overlapping into single dividers, the inner
|
|
12
12
|
* corners square and the outer ones the sm radius. It keeps its row on a
|
|
13
13
|
* phone (it never stacks) and sizes to its buttons, even in a Stack that
|
|
14
|
-
* would stretch it, so `justify` does not apply.
|
|
14
|
+
* would stretch it, so `justify` does not apply. Its buttons share that
|
|
15
|
+
* row: they shrink as flex items again (`flex-shrink: 1`, over a Button's
|
|
16
|
+
* natural width, css-button-natural-width.ts), so a joined control wider
|
|
17
|
+
* than a phone's column wraps its words inside its segments rather than
|
|
18
|
+
* spilling past the column.
|
|
15
19
|
*
|
|
16
20
|
* A borderless variant (primary, tertiary, ghost, danger) draws its
|
|
17
21
|
* divider in its own text colour at low strength, so a joined row of them
|
|
@@ -42,6 +46,7 @@ export function cssButtonGroupAttachedClasses() {
|
|
|
42
46
|
|
|
43
47
|
${group} > .sw-button {
|
|
44
48
|
border-radius: 0;
|
|
49
|
+
flex-shrink: 1;
|
|
45
50
|
}
|
|
46
51
|
|
|
47
52
|
${group} > .sw-button ~ .sw-button {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function cssButtonNaturalWidthClasses(): string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* A Button keeps its natural width as an item of a flex row (an Inline
|
|
3
|
+
* that does not wrap, a header's actions): it gives up none of it
|
|
4
|
+
* (`flex-shrink: 0`), so a crowded row's other items give way first and
|
|
5
|
+
* its words stay on the one line they take at that width. It is never
|
|
6
|
+
* wider than its container (`max-width: 100%`): where its words are
|
|
7
|
+
* longer than the whole row or column it is in, they wrap inside the
|
|
8
|
+
* pill, every word shown, never cut. A full button's own rules
|
|
9
|
+
* (css-button-width.ts) still let it shrink and grow in an Inline.
|
|
10
|
+
*/
|
|
11
|
+
export function cssButtonNaturalWidthClasses() {
|
|
12
|
+
return `.sw-button {
|
|
13
|
+
flex-shrink: 0;
|
|
14
|
+
max-width: 100%;
|
|
15
|
+
}`;
|
|
16
|
+
}
|
package/dist/css/css-button.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { buttonSizes, buttonVariants, typographyVariants, } from '@scalewing/tokens';
|
|
2
2
|
import { breakpointQuery } from './breakpoints.js';
|
|
3
3
|
import { buttonGroupAttachedClassCatalog, cssButtonGroupAttachedClasses, } from './css-button-group-attached.js';
|
|
4
|
+
import { cssButtonNaturalWidthClasses } from './css-button-natural-width.js';
|
|
4
5
|
import { buttonWidthClassCatalog, cssButtonWidthClasses, } from './css-button-width.js';
|
|
5
6
|
import { quietFill } from './quiet-fill.js';
|
|
6
7
|
import { coarsePointerQuery, touchTarget } from './touch-target.js';
|
|
@@ -147,6 +148,7 @@ ${disabledNeutralRules()}
|
|
|
147
148
|
${pressedRules()}
|
|
148
149
|
${ariaDisabledForcedRules()}
|
|
149
150
|
${sizeRules()}
|
|
151
|
+
${cssButtonNaturalWidthClasses()}
|
|
150
152
|
${cssButtonWidthClasses()}
|
|
151
153
|
${groupRules()}
|
|
152
154
|
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { listRowLargeMinHeight } from './list-row-metrics.js';
|
|
2
|
+
export const listGroupLargeClass = 'sw-list-group-lg';
|
|
3
|
+
const group = `.${listGroupLargeClass}`;
|
|
4
|
+
/*
|
|
5
|
+
* The group's own rows only, never a ListGroup nested inside one of
|
|
6
|
+
* them: its list's rows, the same list inside its scroll region when it
|
|
7
|
+
* is bounded, and its footer's row.
|
|
8
|
+
*/
|
|
9
|
+
const ownRows = [
|
|
10
|
+
`${group} > .sw-list > .sw-list-item > .sw-list-row`,
|
|
11
|
+
`${group} > .sw-list-group-scroll > .sw-list > .sw-list-item > .sw-list-row`,
|
|
12
|
+
`${group} > .sw-list-group-footer > .sw-list-item > .sw-list-row`,
|
|
13
|
+
].join(',\n');
|
|
14
|
+
/*
|
|
15
|
+
* An `lg` group's rows stand at least 56 px on every pointer, past the
|
|
16
|
+
* 44 px a pressable row takes on a coarse one, with their parts centred
|
|
17
|
+
* on the row's height rather than set at its top, so a one-line name sits
|
|
18
|
+
* in the middle of its tile. The chained classes outrank the
|
|
19
|
+
* coarse-pointer target, which follows the rows in the sheet. Every row
|
|
20
|
+
* of the group is the same floor, pressable or not, in a panel, plain
|
|
21
|
+
* rows or tiles.
|
|
22
|
+
*/
|
|
23
|
+
export function cssListSizeClasses() {
|
|
24
|
+
return `${ownRows} {
|
|
25
|
+
align-items: center;
|
|
26
|
+
min-height: ${listRowLargeMinHeight};
|
|
27
|
+
}`;
|
|
28
|
+
}
|
|
29
|
+
export function listSizeClassCatalog() {
|
|
30
|
+
return [listGroupLargeClass];
|
|
31
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function cssListTilesBoundedClasses(): string;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { listTileGap } from './css-list-tiles.js';
|
|
2
|
+
import { blockShade } from './css-scroll-region.js';
|
|
3
|
+
import { listCountedRowHeight } from './list-row-metrics.js';
|
|
4
|
+
import { zIndex } from './stacking.js';
|
|
5
|
+
const region = '.sw-list-group-tiles > .sw-list-group-scroll';
|
|
6
|
+
/* How deep the scroll shade is, as a bounded list's and table's. */
|
|
7
|
+
const shadeDepth = 'var(--sw-space-5)';
|
|
8
|
+
/* One counted row of tiles: the counted row inside its tile's two hairlines. */
|
|
9
|
+
const tileRow = `(${listCountedRowHeight} + 2px)`;
|
|
10
|
+
/*
|
|
11
|
+
* A bounded grid of tiles (`variant="tiles"` with `maxHeight`) is the
|
|
12
|
+
* same named scroll region as a bounded list, its grid scrolling inside
|
|
13
|
+
* it. `rows` counts rows of tiles: each the counted row (a title and one
|
|
14
|
+
* detail line) inside its tile's two hairlines, with the grid's gap
|
|
15
|
+
* between them, so a phone's one column counts its tiles one by one.
|
|
16
|
+
*
|
|
17
|
+
* The tiles are opaque panels, so the shade a bounded list paints under
|
|
18
|
+
* its rows would be hidden under them. Here the region's `::before` and
|
|
19
|
+
* `::after` are the shade, stuck to its top and bottom edges over the
|
|
20
|
+
* tiles (the sticky-cell layer of `stacking.ts`, as a table's pinned
|
|
21
|
+
* head is over its scrolling cells) while `ScrollRegion` marks more past
|
|
22
|
+
* that edge: each is a space-5 strip pulled out of the flow by an equal
|
|
23
|
+
* negative margin, so it moves no tile, and takes no press.
|
|
24
|
+
*
|
|
25
|
+
* Focus scrolling keeps a space-5 margin at either edge
|
|
26
|
+
* (`scroll-padding-block`), so a tile focused from the keyboard is
|
|
27
|
+
* scrolled fully into view, clear of the shade, its ring whole. The
|
|
28
|
+
* margin is clamped to half of what the region has over one counted row
|
|
29
|
+
* of tiles, so a region one row tall (`rows: 1`) keeps no margin (never a
|
|
30
|
+
* negative one): its focused tile is scrolled fully into view, whole and
|
|
31
|
+
* with its ring, but may sit under both shades, which leave it no room
|
|
32
|
+
* to clear them. Forced colours draw no shade (the system's scrollbar is the
|
|
33
|
+
* cue); printed, every tile shows.
|
|
34
|
+
*/
|
|
35
|
+
export function cssListTilesBoundedClasses() {
|
|
36
|
+
const rows = 'var(--sw-list-max-rows)';
|
|
37
|
+
return `${region} {
|
|
38
|
+
max-height: calc(${rows} * ${tileRow} + (${rows} - 1) * ${listTileGap});
|
|
39
|
+
scroll-padding-block: max(0px, min(${shadeDepth}, calc((100% - ${tileRow}) / 2)));
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
${region}::before,
|
|
43
|
+
${region}::after {
|
|
44
|
+
content: '';
|
|
45
|
+
display: block;
|
|
46
|
+
height: ${shadeDepth};
|
|
47
|
+
pointer-events: none;
|
|
48
|
+
position: sticky;
|
|
49
|
+
${zIndex('stickyCell')}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
${region}::before {
|
|
53
|
+
margin-block-end: calc(-1 * ${shadeDepth});
|
|
54
|
+
top: 0;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
${region}::after {
|
|
58
|
+
bottom: 0;
|
|
59
|
+
margin-block-start: calc(-1 * ${shadeDepth});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
${region}.sw-scroll-more-top::before { background-image: ${blockShade('bottom')}; }
|
|
63
|
+
|
|
64
|
+
${region}.sw-scroll-more-bottom::after { background-image: ${blockShade('top')}; }
|
|
65
|
+
|
|
66
|
+
@media (forced-colors: active) {
|
|
67
|
+
${region}::before,
|
|
68
|
+
${region}::after { display: none; }
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@media print {
|
|
72
|
+
${region} { max-height: none; }
|
|
73
|
+
}`;
|
|
74
|
+
}
|
|
@@ -2,5 +2,6 @@
|
|
|
2
2
|
export declare const listTileColumnCounts: readonly [2, 3, 4];
|
|
3
3
|
export type ListGroupTileColumns = (typeof listTileColumnCounts)[number];
|
|
4
4
|
export declare function listTileColumnsClass(columns: ListGroupTileColumns): string;
|
|
5
|
+
export declare const listTileGap = "var(--sw-space-3)";
|
|
5
6
|
export declare function cssListTilesClasses(): string;
|
|
6
7
|
export declare function listTilesClassCatalog(): string[];
|
|
@@ -5,6 +5,19 @@ export function listTileColumnsClass(columns) {
|
|
|
5
5
|
return `sw-list-group-tiles-${columns}`;
|
|
6
6
|
}
|
|
7
7
|
const tiles = '.sw-list-group-tiles';
|
|
8
|
+
/* The space between tiles, across and down; a bounded grid counts it too. */
|
|
9
|
+
export const listTileGap = 'var(--sw-space-3)';
|
|
10
|
+
/*
|
|
11
|
+
* The list a group's class lays out, the group's own child or, bounded
|
|
12
|
+
* (`maxHeight`), its scroll region's: a selector list, so each keeps the
|
|
13
|
+
* specificity it would have alone and the order below still decides.
|
|
14
|
+
*/
|
|
15
|
+
function tileList(group, inner = '') {
|
|
16
|
+
return [
|
|
17
|
+
`${group} > .sw-list${inner}`,
|
|
18
|
+
`${group} > .sw-list-group-scroll > .sw-list${inner}`,
|
|
19
|
+
].join(',\n');
|
|
20
|
+
}
|
|
8
21
|
/*
|
|
9
22
|
* A tiled ListGroup is still one list (`sw-list`), its rows laid out as
|
|
10
23
|
* tiles: equal columns a space-3 apart from `md` up, one column below it,
|
|
@@ -15,31 +28,48 @@ const tiles = '.sw-list-group-tiles';
|
|
|
15
28
|
* Generated after the list's hairline rules (css-list.ts), whose
|
|
16
29
|
* `.sw-list > .sw-list-item + .sw-list-item` has the same specificity as
|
|
17
30
|
* the tile rule: being later is what lets a tile's own border replace the
|
|
18
|
-
* hairline. `list-group-tiles.test.tsx` holds that order.
|
|
31
|
+
* hairline. `list-group-tiles.test.tsx` holds that order. A bounded
|
|
32
|
+
* group's grid sits in its scroll region and takes the same rules.
|
|
33
|
+
*
|
|
34
|
+
* Tiles on one grid row are as tall as the tallest of them, so each tile
|
|
35
|
+
* is a flex box whose row fills it (`flex: 1 1 auto`, stretched across
|
|
36
|
+
* its height): a short row's press area, fill and inset ring reach its
|
|
37
|
+
* tile's edges beside a taller one. A tile with an `action` stretches its
|
|
38
|
+
* row the same way and keeps the action centred on it.
|
|
19
39
|
*/
|
|
20
40
|
export function cssListTilesClasses() {
|
|
21
|
-
const columns = listTileColumnCounts.map((count) => `.${listTileColumnsClass(count)}
|
|
22
|
-
|
|
41
|
+
const columns = listTileColumnCounts.map((count) => `${tileList(`.${listTileColumnsClass(count)}`)} { grid-template-columns: repeat(${count}, minmax(0, 1fr)); }`);
|
|
42
|
+
const item = ' > .sw-list-item';
|
|
43
|
+
return `${tileList(tiles)} {
|
|
23
44
|
display: grid;
|
|
24
|
-
gap:
|
|
45
|
+
gap: ${listTileGap};
|
|
25
46
|
}
|
|
26
47
|
|
|
27
48
|
${columns.join('\n')}
|
|
28
49
|
|
|
29
|
-
${tiles
|
|
50
|
+
${tileList(tiles, item)} {
|
|
51
|
+
align-items: stretch;
|
|
30
52
|
background: var(--sw-color-surface);
|
|
31
53
|
border: 1px solid var(--sw-color-border);
|
|
32
54
|
border-radius: var(--sw-radius-md);
|
|
55
|
+
display: flex;
|
|
33
56
|
min-width: 0;
|
|
34
57
|
overflow: clip;
|
|
35
58
|
}
|
|
36
59
|
|
|
60
|
+
${tileList(tiles, `${item} > .sw-list-row`)} {
|
|
61
|
+
flex: 1 1 auto;
|
|
62
|
+
min-width: 0;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
${tileList(tiles, `${item} > .sw-list-row-action`)} { align-self: center; }
|
|
66
|
+
|
|
37
67
|
@media ${breakpointQuery('below', 'md')} {
|
|
38
|
-
${tiles}
|
|
68
|
+
${tileList(tiles).replaceAll('\n', '\n ')} { grid-template-columns: minmax(0, 1fr); }
|
|
39
69
|
}
|
|
40
70
|
|
|
41
71
|
@media (forced-colors: active) {
|
|
42
|
-
${tiles
|
|
72
|
+
${tileList(tiles, item).replaceAll('\n', '\n ')} { border-color: CanvasText; }
|
|
43
73
|
}`;
|
|
44
74
|
}
|
|
45
75
|
export function listTilesClassCatalog() {
|
package/dist/css/css-list.d.ts
CHANGED
package/dist/css/css-list.js
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
import { typographyVariants } from '@scalewing/tokens';
|
|
2
1
|
import { cssListRowClasses, listRowClassCatalog } from './css-list-row.js';
|
|
3
2
|
import { cssListRowTrailingClasses, listRowTrailingClassCatalog, } from './css-list-row-trailing.js';
|
|
4
3
|
import { cssListRowTruncateClasses, listRowTruncateClassCatalog, } from './css-list-row-truncate.js';
|
|
5
4
|
import { cssListTilesClasses, listTilesClassCatalog, } from './css-list-tiles.js';
|
|
5
|
+
import { cssListSizeClasses, listSizeClassCatalog } from './css-list-size.js';
|
|
6
|
+
import { cssListTilesBoundedClasses } from './css-list-tiles-bounded.js';
|
|
6
7
|
import { blockEdgeShadeRules, scrollRegionRules } from './css-scroll-region.js';
|
|
7
|
-
|
|
8
|
-
const caption = typographyVariants.caption;
|
|
9
|
-
/* A row's padding, shared by the row rules and the bounded list's height. */
|
|
10
|
-
export const listRowPadBlock = 'var(--sw-space-3)';
|
|
8
|
+
import { listCountedRowHeight } from './list-row-metrics.js';
|
|
11
9
|
const scroll = '.sw-list-group-scroll';
|
|
10
|
+
/*
|
|
11
|
+
* The region of a bounded list of rows, not of tiles: tiles are opaque
|
|
12
|
+
* panels that would hide a shade drawn under them, so a bounded grid of
|
|
13
|
+
* tiles draws its own over them (css-list-tiles-bounded.ts).
|
|
14
|
+
*/
|
|
15
|
+
const rowScroll = `.sw-list-group:not(.sw-list-group-tiles) > ${scroll}`;
|
|
12
16
|
/*
|
|
13
17
|
* A ListGroup is one list (`sw-list`) with a hairline between its rows:
|
|
14
18
|
* a bordered panel on the surface, or plain rows inside a surface that
|
|
@@ -46,12 +50,12 @@ function groupRules() {
|
|
|
46
50
|
* shows.
|
|
47
51
|
*/
|
|
48
52
|
function boundedRules() {
|
|
49
|
-
const top = `${
|
|
50
|
-
const bottom = `${
|
|
53
|
+
const top = `${rowScroll}.sw-scroll-more-top`;
|
|
54
|
+
const bottom = `${rowScroll}.sw-scroll-more-bottom`;
|
|
51
55
|
return `${scrollRegionRules(scroll)}
|
|
52
56
|
|
|
53
57
|
${scroll} {
|
|
54
|
-
max-height: calc(var(--sw-list-max-rows) * (
|
|
58
|
+
max-height: calc(var(--sw-list-max-rows) * (${listCountedRowHeight} + 1px));
|
|
55
59
|
}
|
|
56
60
|
|
|
57
61
|
${blockEdgeShadeRules({ top, bottom, both: `${top}.sw-scroll-more-bottom` })}
|
|
@@ -78,7 +82,11 @@ ${cssListRowTrailingClasses()}
|
|
|
78
82
|
|
|
79
83
|
${cssListRowTruncateClasses()}
|
|
80
84
|
|
|
81
|
-
${
|
|
85
|
+
${cssListSizeClasses()}
|
|
86
|
+
|
|
87
|
+
${cssListTilesClasses()}
|
|
88
|
+
|
|
89
|
+
${cssListTilesBoundedClasses()}`;
|
|
82
90
|
}
|
|
83
91
|
export function listClassCatalog() {
|
|
84
92
|
return [
|
|
@@ -89,6 +97,7 @@ export function listClassCatalog() {
|
|
|
89
97
|
'sw-list-group-plain',
|
|
90
98
|
'sw-list-group-scroll',
|
|
91
99
|
'sw-list-group-footer',
|
|
100
|
+
...listSizeClassCatalog(),
|
|
92
101
|
...listTilesClassCatalog(),
|
|
93
102
|
...listRowClassCatalog(),
|
|
94
103
|
...listRowTrailingClassCatalog(),
|
|
@@ -39,6 +39,8 @@ const layoutRules = {
|
|
|
39
39
|
'sw-inline': '.sw-inline { display: flex; flex-direction: row; align-items: center; min-width: 0; }',
|
|
40
40
|
'sw-wrap': '.sw-wrap { flex-wrap: wrap; }',
|
|
41
41
|
'sw-grow': '.sw-grow { flex-grow: 1; }',
|
|
42
|
+
// A flex item that keeps its natural width (Box `shrink={false}`).
|
|
43
|
+
'sw-no-shrink': '.sw-no-shrink { flex-shrink: 0; }',
|
|
42
44
|
'sw-full-width': '.sw-full-width { width: 100%; }',
|
|
43
45
|
'sw-container': '.sw-container { width: 100%; max-width: var(--sw-container-max); margin-inline: auto; }',
|
|
44
46
|
// A narrower centred column at the reading width (Article's), for a
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { typographyVariants } from '@scalewing/tokens';
|
|
2
|
+
const label = typographyVariants.label;
|
|
3
|
+
const caption = typographyVariants.caption;
|
|
4
|
+
/* A row's padding, shared by the row rules and a bounded list's height. */
|
|
5
|
+
export const listRowPadBlock = 'var(--sw-space-3)';
|
|
6
|
+
/*
|
|
7
|
+
* The row a bounded list counts (`maxHeight: { rows }`): a title and one
|
|
8
|
+
* detail line inside the row's padding, 62 px. A taller row shows fewer
|
|
9
|
+
* at a time and a shorter one more. It is taller than an `lg` row's
|
|
10
|
+
* 56 px floor, so the count is the same at either size. A sum, for a
|
|
11
|
+
* caller to add its hairlines to inside its own parentheses.
|
|
12
|
+
*/
|
|
13
|
+
export const listCountedRowHeight = `2 * ${listRowPadBlock} + ${label.lineHeight}px + ${caption.lineHeight}px`;
|
|
14
|
+
/*
|
|
15
|
+
* An `lg` row's floor, 56 px (space-8 and space-2) on every pointer: a
|
|
16
|
+
* larger press target than the 44 px coarse-pointer one.
|
|
17
|
+
*/
|
|
18
|
+
export const listRowLargeMinHeight = 'calc(var(--sw-space-8) + var(--sw-space-2))';
|
|
@@ -7,4 +7,4 @@ export type SpacingKind = 'padding' | 'gap';
|
|
|
7
7
|
export declare function spacingClass(kind: SpacingKind, axis: PaddingAxis | GapAxis, step: SpacingStep): string;
|
|
8
8
|
export declare function paddingClassNames(): string[];
|
|
9
9
|
export declare function gapClassNames(): string[];
|
|
10
|
-
export declare const layoutClassNames: readonly ["sw-stack", "sw-inline", "sw-wrap", "sw-grow", "sw-full-width", "sw-container", "sw-container-reading", "sw-sr-only", "sw-align-start", "sw-align-center", "sw-align-end", "sw-align-stretch", "sw-justify-start", "sw-justify-center", "sw-justify-end", "sw-justify-between"];
|
|
10
|
+
export declare const layoutClassNames: readonly ["sw-stack", "sw-inline", "sw-wrap", "sw-grow", "sw-no-shrink", "sw-full-width", "sw-container", "sw-container-reading", "sw-sr-only", "sw-align-start", "sw-align-center", "sw-align-end", "sw-align-stretch", "sw-justify-start", "sw-justify-center", "sw-justify-end", "sw-justify-between"];
|
package/dist/css/stacking.js
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
* `z-index` reads a layer from here, lowest first:
|
|
4
4
|
*
|
|
5
5
|
* 1. `stickyCell`: a sticky table head group (every row in a sticky
|
|
6
|
-
* `thead`) or row label over the cells that scroll under it
|
|
6
|
+
* `thead`) or row label over the cells that scroll under it, and a
|
|
7
|
+
* bounded grid of tiles' sticky edge shade over the tiles under it.
|
|
7
8
|
* 2. `stickyFooter`: a sticky table footer (a pinned total row) over the
|
|
8
9
|
* cells and pinned header cells that scroll under it, and under the
|
|
9
10
|
* ActionBar, which stays the page's last word at the bottom edge.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const noShrinkClass = "sw-no-shrink";
|
|
2
|
+
export type FlexItemProps = {
|
|
3
|
+
/**
|
|
4
|
+
* `false` keeps this box at its natural size along its parent's main
|
|
5
|
+
* axis when the parent is a flex container short of room (its width in
|
|
6
|
+
* an `Inline` row, its height in a `Stack` column): it gives up none of
|
|
7
|
+
* it, and its siblings give way instead, such as a header's actions (a
|
|
8
|
+
* Button and an account menu in their own Inline) beside a title or
|
|
9
|
+
* navigation that may wrap. The box can then be larger than its parent,
|
|
10
|
+
* so keep it for content that fits. `true` (the default) lets it shrink
|
|
11
|
+
* as any flex item.
|
|
12
|
+
*/
|
|
13
|
+
shrink?: boolean;
|
|
14
|
+
};
|
|
15
|
+
export declare function flexItemClassNames({ shrink }: FlexItemProps): string[];
|
package/dist/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export { DocumentViewer, type DocumentViewerLabels, type DocumentViewerProps, }
|
|
|
13
13
|
export { ListGroup, type ListGroupProps } from './components/ListGroup.js';
|
|
14
14
|
export { inspectMarkdown, markdownOmissionKinds, MarkdownView, type MarkdownHeading, type MarkdownInspection, type MarkdownImage, type MarkdownImageResolver, type MarkdownOmission, type MarkdownOmissionCounts, type MarkdownOmissionKind, type MarkdownOptions, type MarkdownViewProps, } from './components/MarkdownView.js';
|
|
15
15
|
export { ListRow, type ListRowProps } from './components/ListRow.js';
|
|
16
|
-
export { listGroupVariants, listRowTitleAppearances, listRowTones, listRowValueTones, type ListGroupMaxHeight, type ListGroupVariant, type ListRowTitleAppearance, type ListRowTone, type ListRowValueTone, } from './list-options.js';
|
|
16
|
+
export { listGroupSizes, listGroupVariants, listRowTitleAppearances, listRowTones, listRowValueTones, type ListGroupMaxHeight, type ListGroupSize, type ListGroupVariant, type ListRowTitleAppearance, type ListRowTone, type ListRowValueTone, } from './list-options.js';
|
|
17
17
|
export { listTileColumnCounts, type ListGroupTileColumns, } from './css/css-list-tiles.js';
|
|
18
18
|
export { Checkbox, checkboxAppearances, type CheckboxAppearance, type CheckboxProps, } from './components/Checkbox.js';
|
|
19
19
|
export { PasteRows, type PasteRowsColumn, type PasteRowsProps, } from './components/PasteRows.js';
|
|
@@ -116,6 +116,7 @@ export { Grid, gridFits, gridRails } from './components/Grid.js';
|
|
|
116
116
|
export type { GridColumns, GridFit, GridProps, GridRail, } from './components/Grid.js';
|
|
117
117
|
export type { GridColumnSpan } from './css/css-grid-span.js';
|
|
118
118
|
export type { ColumnSpanProps } from './column-span-classes.js';
|
|
119
|
+
export type { FlexItemProps } from './flex-item-classes.js';
|
|
119
120
|
export { DenominationGrid, denominationCellToneAppearances, denominationGridFrames, denominationLabelAppearances, denominationNegativeAppearances, denominationTotalEmphases, denominationTransposeBreakpoints, } from './components/DenominationGrid.js';
|
|
120
121
|
export type { DenominationCellToneAppearance, DenominationGridColumn, DenominationGridEntry, DenominationGridFrame, DenominationGridLayout, DenominationGridNegativeAppearance, DenominationGridProps, DenominationGridRow, DenominationGridRowEmphasis, DenominationGridRowRole, DenominationGridTone, DenominationGridValueRow, DenominationLabelAppearance, DenominationLabelWidth, DenominationTotalEmphasis, DenominationTransposeBreakpoint, } from './components/DenominationGrid.js';
|
|
121
122
|
export { FilterChips, filterChipCountAppearances, filterChipsOverflows, filterChipsSelectedStyles, filterChipTones, } from './components/FilterChips.js';
|
package/dist/index.js
CHANGED
|
@@ -12,7 +12,7 @@ export { DocumentViewer, } from './components/DocumentViewer.js';
|
|
|
12
12
|
export { ListGroup } from './components/ListGroup.js';
|
|
13
13
|
export { inspectMarkdown, markdownOmissionKinds, MarkdownView, } from './components/MarkdownView.js';
|
|
14
14
|
export { ListRow } from './components/ListRow.js';
|
|
15
|
-
export { listGroupVariants, listRowTitleAppearances, listRowTones, listRowValueTones, } from './list-options.js';
|
|
15
|
+
export { listGroupSizes, listGroupVariants, listRowTitleAppearances, listRowTones, listRowValueTones, } from './list-options.js';
|
|
16
16
|
export { listTileColumnCounts, } from './css/css-list-tiles.js';
|
|
17
17
|
export { Checkbox, checkboxAppearances, } from './components/Checkbox.js';
|
|
18
18
|
export { PasteRows, } from './components/PasteRows.js';
|
package/dist/list-options.d.ts
CHANGED
|
@@ -18,6 +18,14 @@ export type ListGroupVariant = (typeof listGroupVariants)[number];
|
|
|
18
18
|
export type ListGroupMaxHeight = {
|
|
19
19
|
rows: number;
|
|
20
20
|
};
|
|
21
|
+
/**
|
|
22
|
+
* How tall a group's rows stand at least: `md` (the default) is as tall as
|
|
23
|
+
* the words (44 px for a pressable row on a coarse pointer); `lg` is a
|
|
24
|
+
* 56 px row on every pointer, its words centred in it, such as a grid of
|
|
25
|
+
* names pressed at a shared counter.
|
|
26
|
+
*/
|
|
27
|
+
export declare const listGroupSizes: readonly ["md", "lg"];
|
|
28
|
+
export type ListGroupSize = (typeof listGroupSizes)[number];
|
|
21
29
|
/** `danger` draws the title in the danger colour, for a row that ends something. */
|
|
22
30
|
export declare const listRowTones: readonly ["default", "danger"];
|
|
23
31
|
export type ListRowTone = (typeof listRowTones)[number];
|
|
@@ -31,19 +39,19 @@ export type ListGroupInput = {
|
|
|
31
39
|
label: string | undefined;
|
|
32
40
|
labelledBy: string | undefined;
|
|
33
41
|
variant: unknown;
|
|
42
|
+
size: unknown;
|
|
34
43
|
maxHeight: ListGroupMaxHeight | undefined;
|
|
35
44
|
tileColumns: unknown;
|
|
36
45
|
hasFooter: boolean;
|
|
37
46
|
};
|
|
38
47
|
/**
|
|
39
|
-
* Fails closed on a ListGroup it cannot draw: an unknown variant,
|
|
40
|
-
* `maxHeight` that is not a whole row count from 1, a bounded list with
|
|
48
|
+
* Fails closed on a ListGroup it cannot draw: an unknown variant or size,
|
|
49
|
+
* a `maxHeight` that is not a whole row count from 1, a bounded list with
|
|
41
50
|
* no name (its scroll region is a keyboard stop and must say what it
|
|
42
51
|
* holds), `tileColumns` other than 2, 3 or 4 or on a list that is not
|
|
43
|
-
* tiles, or tiles with
|
|
44
|
-
* rows nor add up to a total).
|
|
52
|
+
* tiles, or tiles with a `footer` (tiles do not add up to a total).
|
|
45
53
|
*/
|
|
46
|
-
export declare function assertListGroup({ label, labelledBy, variant, maxHeight, tileColumns, hasFooter, }: ListGroupInput): void;
|
|
54
|
+
export declare function assertListGroup({ label, labelledBy, variant, size, maxHeight, tileColumns, hasFooter, }: ListGroupInput): void;
|
|
47
55
|
/** The row count the generated `sw-list-group-scroll` height reads. */
|
|
48
56
|
export declare function listMaxHeightStyle(maxHeight: ListGroupMaxHeight): CSSProperties;
|
|
49
57
|
export type ListRowInput = {
|
package/dist/list-options.js
CHANGED
|
@@ -10,6 +10,13 @@ import { isOneOf } from './is-one-of.js';
|
|
|
10
10
|
* `md`).
|
|
11
11
|
*/
|
|
12
12
|
export const listGroupVariants = ['panel', 'plain', 'tiles'];
|
|
13
|
+
/**
|
|
14
|
+
* How tall a group's rows stand at least: `md` (the default) is as tall as
|
|
15
|
+
* the words (44 px for a pressable row on a coarse pointer); `lg` is a
|
|
16
|
+
* 56 px row on every pointer, its words centred in it, such as a grid of
|
|
17
|
+
* names pressed at a shared counter.
|
|
18
|
+
*/
|
|
19
|
+
export const listGroupSizes = ['md', 'lg'];
|
|
13
20
|
/** `danger` draws the title in the danger colour, for a row that ends something. */
|
|
14
21
|
export const listRowTones = ['default', 'danger'];
|
|
15
22
|
/** `strong` (the default) sets the title at the label weight; `plain` at the body's. */
|
|
@@ -19,24 +26,25 @@ function isBlank(text) {
|
|
|
19
26
|
return typeof text !== 'string' || text.trim() === '';
|
|
20
27
|
}
|
|
21
28
|
/**
|
|
22
|
-
* Fails closed on a ListGroup it cannot draw: an unknown variant,
|
|
23
|
-
* `maxHeight` that is not a whole row count from 1, a bounded list with
|
|
29
|
+
* Fails closed on a ListGroup it cannot draw: an unknown variant or size,
|
|
30
|
+
* a `maxHeight` that is not a whole row count from 1, a bounded list with
|
|
24
31
|
* no name (its scroll region is a keyboard stop and must say what it
|
|
25
32
|
* holds), `tileColumns` other than 2, 3 or 4 or on a list that is not
|
|
26
|
-
* tiles, or tiles with
|
|
27
|
-
* rows nor add up to a total).
|
|
33
|
+
* tiles, or tiles with a `footer` (tiles do not add up to a total).
|
|
28
34
|
*/
|
|
29
|
-
export function assertListGroup({ label, labelledBy, variant, maxHeight, tileColumns, hasFooter, }) {
|
|
35
|
+
export function assertListGroup({ label, labelledBy, variant, size, maxHeight, tileColumns, hasFooter, }) {
|
|
30
36
|
if (!isOneOf(listGroupVariants, variant))
|
|
31
37
|
throw new RangeError(`Unknown ListGroup variant: ${String(variant)}`);
|
|
38
|
+
if (!isOneOf(listGroupSizes, size))
|
|
39
|
+
throw new RangeError(`Unknown ListGroup size: ${String(size)}`);
|
|
32
40
|
if (tileColumns !== undefined) {
|
|
33
41
|
if (variant !== 'tiles')
|
|
34
42
|
throw new RangeError('ListGroup tileColumns needs variant="tiles"');
|
|
35
43
|
if (!listTileColumnCounts.includes(tileColumns))
|
|
36
44
|
throw new RangeError(`ListGroup tileColumns must be 2, 3 or 4: ${String(tileColumns)}`);
|
|
37
45
|
}
|
|
38
|
-
if (variant === 'tiles' &&
|
|
39
|
-
throw new RangeError('A ListGroup of tiles takes no
|
|
46
|
+
if (variant === 'tiles' && hasFooter)
|
|
47
|
+
throw new RangeError('A ListGroup of tiles takes no footer');
|
|
40
48
|
if (maxHeight === undefined)
|
|
41
49
|
return;
|
|
42
50
|
const rows = typeof maxHeight === 'object' && maxHeight !== null
|
package/dist/styles.css
CHANGED
|
@@ -884,6 +884,7 @@ body {
|
|
|
884
884
|
.sw-inline { display: flex; flex-direction: row; align-items: center; min-width: 0; }
|
|
885
885
|
.sw-wrap { flex-wrap: wrap; }
|
|
886
886
|
.sw-grow { flex-grow: 1; }
|
|
887
|
+
.sw-no-shrink { flex-shrink: 0; }
|
|
887
888
|
.sw-full-width { width: 100%; }
|
|
888
889
|
.sw-container { width: 100%; max-width: var(--sw-container-max); margin-inline: auto; }
|
|
889
890
|
.sw-container-reading { width: 100%; max-width: var(--sw-reading-max); margin-inline: auto; }
|
|
@@ -1051,6 +1052,10 @@ body {
|
|
|
1051
1052
|
@media (pointer: coarse) {
|
|
1052
1053
|
.sw-button { min-height: var(--sw-control-md-min-height); min-width: var(--sw-control-md-min-height); }
|
|
1053
1054
|
}
|
|
1055
|
+
.sw-button {
|
|
1056
|
+
flex-shrink: 0;
|
|
1057
|
+
max-width: 100%;
|
|
1058
|
+
}
|
|
1054
1059
|
.sw-button-full {
|
|
1055
1060
|
width: 100%;
|
|
1056
1061
|
}
|
|
@@ -1085,6 +1090,7 @@ body {
|
|
|
1085
1090
|
|
|
1086
1091
|
.sw-button-group.sw-button-group-attached > .sw-button {
|
|
1087
1092
|
border-radius: 0;
|
|
1093
|
+
flex-shrink: 1;
|
|
1088
1094
|
}
|
|
1089
1095
|
|
|
1090
1096
|
.sw-button-group.sw-button-group-attached > .sw-button ~ .sw-button {
|
|
@@ -3123,31 +3129,31 @@ button.sw-date-toggle-day[aria-disabled='true'] {
|
|
|
3123
3129
|
max-height: calc(var(--sw-list-max-rows) * (2 * var(--sw-space-3) + 20px + 18px + 1px));
|
|
3124
3130
|
}
|
|
3125
3131
|
|
|
3126
|
-
.sw-list-group-scroll.sw-scroll-more-top,
|
|
3127
|
-
.sw-list-group-scroll.sw-scroll-more-bottom {
|
|
3132
|
+
.sw-list-group:not(.sw-list-group-tiles) > .sw-list-group-scroll.sw-scroll-more-top,
|
|
3133
|
+
.sw-list-group:not(.sw-list-group-tiles) > .sw-list-group-scroll.sw-scroll-more-bottom {
|
|
3128
3134
|
background-repeat: no-repeat;
|
|
3129
3135
|
background-size: 100% var(--sw-space-5);
|
|
3130
3136
|
}
|
|
3131
3137
|
|
|
3132
|
-
.sw-list-group-scroll.sw-scroll-more-top {
|
|
3138
|
+
.sw-list-group:not(.sw-list-group-tiles) > .sw-list-group-scroll.sw-scroll-more-top {
|
|
3133
3139
|
background-image: linear-gradient(to bottom, color-mix(in srgb, var(--sw-color-text) 28%, transparent), transparent);
|
|
3134
3140
|
background-position: top;
|
|
3135
3141
|
}
|
|
3136
3142
|
|
|
3137
|
-
.sw-list-group-scroll.sw-scroll-more-bottom {
|
|
3143
|
+
.sw-list-group:not(.sw-list-group-tiles) > .sw-list-group-scroll.sw-scroll-more-bottom {
|
|
3138
3144
|
background-image: linear-gradient(to top, color-mix(in srgb, var(--sw-color-text) 28%, transparent), transparent);
|
|
3139
3145
|
background-position: bottom;
|
|
3140
3146
|
}
|
|
3141
3147
|
|
|
3142
|
-
.sw-list-group-scroll.sw-scroll-more-top.sw-scroll-more-bottom {
|
|
3148
|
+
.sw-list-group:not(.sw-list-group-tiles) > .sw-list-group-scroll.sw-scroll-more-top.sw-scroll-more-bottom {
|
|
3143
3149
|
background-image: linear-gradient(to bottom, color-mix(in srgb, var(--sw-color-text) 28%, transparent), transparent), linear-gradient(to top, color-mix(in srgb, var(--sw-color-text) 28%, transparent), transparent);
|
|
3144
3150
|
background-position: top, bottom;
|
|
3145
3151
|
}
|
|
3146
3152
|
|
|
3147
3153
|
@media (forced-colors: active) {
|
|
3148
|
-
.sw-list-group-scroll.sw-scroll-more-top,
|
|
3149
|
-
.sw-list-group-scroll.sw-scroll-more-bottom,
|
|
3150
|
-
.sw-list-group-scroll.sw-scroll-more-top.sw-scroll-more-bottom { background-image: none; }
|
|
3154
|
+
.sw-list-group:not(.sw-list-group-tiles) > .sw-list-group-scroll.sw-scroll-more-top,
|
|
3155
|
+
.sw-list-group:not(.sw-list-group-tiles) > .sw-list-group-scroll.sw-scroll-more-bottom,
|
|
3156
|
+
.sw-list-group:not(.sw-list-group-tiles) > .sw-list-group-scroll.sw-scroll-more-top.sw-scroll-more-bottom { background-image: none; }
|
|
3151
3157
|
}
|
|
3152
3158
|
|
|
3153
3159
|
@media (forced-colors: active) {
|
|
@@ -3385,29 +3391,92 @@ button.sw-date-toggle-day[aria-disabled='true'] {
|
|
|
3385
3391
|
white-space: nowrap;
|
|
3386
3392
|
}
|
|
3387
3393
|
|
|
3388
|
-
.sw-list-group-
|
|
3394
|
+
.sw-list-group-lg > .sw-list > .sw-list-item > .sw-list-row,
|
|
3395
|
+
.sw-list-group-lg > .sw-list-group-scroll > .sw-list > .sw-list-item > .sw-list-row,
|
|
3396
|
+
.sw-list-group-lg > .sw-list-group-footer > .sw-list-item > .sw-list-row {
|
|
3397
|
+
align-items: center;
|
|
3398
|
+
min-height: calc(var(--sw-space-8) + var(--sw-space-2));
|
|
3399
|
+
}
|
|
3400
|
+
|
|
3401
|
+
.sw-list-group-tiles > .sw-list,
|
|
3402
|
+
.sw-list-group-tiles > .sw-list-group-scroll > .sw-list {
|
|
3389
3403
|
display: grid;
|
|
3390
3404
|
gap: var(--sw-space-3);
|
|
3391
3405
|
}
|
|
3392
3406
|
|
|
3393
|
-
.sw-list-group-tiles-2 > .sw-list
|
|
3394
|
-
.sw-list-group-tiles-
|
|
3395
|
-
.sw-list-group-tiles-
|
|
3407
|
+
.sw-list-group-tiles-2 > .sw-list,
|
|
3408
|
+
.sw-list-group-tiles-2 > .sw-list-group-scroll > .sw-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
3409
|
+
.sw-list-group-tiles-3 > .sw-list,
|
|
3410
|
+
.sw-list-group-tiles-3 > .sw-list-group-scroll > .sw-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
|
3411
|
+
.sw-list-group-tiles-4 > .sw-list,
|
|
3412
|
+
.sw-list-group-tiles-4 > .sw-list-group-scroll > .sw-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
|
|
3396
3413
|
|
|
3397
|
-
.sw-list-group-tiles > .sw-list > .sw-list-item
|
|
3414
|
+
.sw-list-group-tiles > .sw-list > .sw-list-item,
|
|
3415
|
+
.sw-list-group-tiles > .sw-list-group-scroll > .sw-list > .sw-list-item {
|
|
3416
|
+
align-items: stretch;
|
|
3398
3417
|
background: var(--sw-color-surface);
|
|
3399
3418
|
border: 1px solid var(--sw-color-border);
|
|
3400
3419
|
border-radius: var(--sw-radius-md);
|
|
3420
|
+
display: flex;
|
|
3401
3421
|
min-width: 0;
|
|
3402
3422
|
overflow: clip;
|
|
3403
3423
|
}
|
|
3404
3424
|
|
|
3425
|
+
.sw-list-group-tiles > .sw-list > .sw-list-item > .sw-list-row,
|
|
3426
|
+
.sw-list-group-tiles > .sw-list-group-scroll > .sw-list > .sw-list-item > .sw-list-row {
|
|
3427
|
+
flex: 1 1 auto;
|
|
3428
|
+
min-width: 0;
|
|
3429
|
+
}
|
|
3430
|
+
|
|
3431
|
+
.sw-list-group-tiles > .sw-list > .sw-list-item > .sw-list-row-action,
|
|
3432
|
+
.sw-list-group-tiles > .sw-list-group-scroll > .sw-list > .sw-list-item > .sw-list-row-action { align-self: center; }
|
|
3433
|
+
|
|
3405
3434
|
@media not all and (min-width: 48rem) {
|
|
3406
|
-
.sw-list-group-tiles > .sw-list
|
|
3435
|
+
.sw-list-group-tiles > .sw-list,
|
|
3436
|
+
.sw-list-group-tiles > .sw-list-group-scroll > .sw-list { grid-template-columns: minmax(0, 1fr); }
|
|
3407
3437
|
}
|
|
3408
3438
|
|
|
3409
3439
|
@media (forced-colors: active) {
|
|
3410
|
-
.sw-list-group-tiles > .sw-list > .sw-list-item
|
|
3440
|
+
.sw-list-group-tiles > .sw-list > .sw-list-item,
|
|
3441
|
+
.sw-list-group-tiles > .sw-list-group-scroll > .sw-list > .sw-list-item { border-color: CanvasText; }
|
|
3442
|
+
}
|
|
3443
|
+
|
|
3444
|
+
.sw-list-group-tiles > .sw-list-group-scroll {
|
|
3445
|
+
max-height: calc(var(--sw-list-max-rows) * (2 * var(--sw-space-3) + 20px + 18px + 2px) + (var(--sw-list-max-rows) - 1) * var(--sw-space-3));
|
|
3446
|
+
scroll-padding-block: max(0px, min(var(--sw-space-5), calc((100% - (2 * var(--sw-space-3) + 20px + 18px + 2px)) / 2)));
|
|
3447
|
+
}
|
|
3448
|
+
|
|
3449
|
+
.sw-list-group-tiles > .sw-list-group-scroll::before,
|
|
3450
|
+
.sw-list-group-tiles > .sw-list-group-scroll::after {
|
|
3451
|
+
content: '';
|
|
3452
|
+
display: block;
|
|
3453
|
+
height: var(--sw-space-5);
|
|
3454
|
+
pointer-events: none;
|
|
3455
|
+
position: sticky;
|
|
3456
|
+
z-index: 1;
|
|
3457
|
+
}
|
|
3458
|
+
|
|
3459
|
+
.sw-list-group-tiles > .sw-list-group-scroll::before {
|
|
3460
|
+
margin-block-end: calc(-1 * var(--sw-space-5));
|
|
3461
|
+
top: 0;
|
|
3462
|
+
}
|
|
3463
|
+
|
|
3464
|
+
.sw-list-group-tiles > .sw-list-group-scroll::after {
|
|
3465
|
+
bottom: 0;
|
|
3466
|
+
margin-block-start: calc(-1 * var(--sw-space-5));
|
|
3467
|
+
}
|
|
3468
|
+
|
|
3469
|
+
.sw-list-group-tiles > .sw-list-group-scroll.sw-scroll-more-top::before { background-image: linear-gradient(to bottom, color-mix(in srgb, var(--sw-color-text) 28%, transparent), transparent); }
|
|
3470
|
+
|
|
3471
|
+
.sw-list-group-tiles > .sw-list-group-scroll.sw-scroll-more-bottom::after { background-image: linear-gradient(to top, color-mix(in srgb, var(--sw-color-text) 28%, transparent), transparent); }
|
|
3472
|
+
|
|
3473
|
+
@media (forced-colors: active) {
|
|
3474
|
+
.sw-list-group-tiles > .sw-list-group-scroll::before,
|
|
3475
|
+
.sw-list-group-tiles > .sw-list-group-scroll::after { display: none; }
|
|
3476
|
+
}
|
|
3477
|
+
|
|
3478
|
+
@media print {
|
|
3479
|
+
.sw-list-group-tiles > .sw-list-group-scroll { max-height: none; }
|
|
3411
3480
|
}
|
|
3412
3481
|
|
|
3413
3482
|
.sw-fixture-group {
|
|
@@ -7638,6 +7707,8 @@ html:has(.sw-site-header-sticky) .sw-docs-layout {
|
|
|
7638
7707
|
|
|
7639
7708
|
.sw-action-menu {
|
|
7640
7709
|
display: inline-flex;
|
|
7710
|
+
flex-shrink: 0;
|
|
7711
|
+
max-width: 100%;
|
|
7641
7712
|
position: relative;
|
|
7642
7713
|
}
|
|
7643
7714
|
|
|
@@ -7649,6 +7720,7 @@ html:has(.sw-site-header-sticky) .sw-docs-layout {
|
|
|
7649
7720
|
color: var(--sw-color-text);
|
|
7650
7721
|
cursor: pointer;
|
|
7651
7722
|
font: inherit;
|
|
7723
|
+
max-width: 100%;
|
|
7652
7724
|
min-height: var(--sw-control-xs-min-height);
|
|
7653
7725
|
padding-inline: var(--sw-control-xs-padding-inline);
|
|
7654
7726
|
}
|