horizon-design 2.0.1 → 2.1.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.
Files changed (31) hide show
  1. package/README.md +56 -30
  2. package/dist/components/asset-card/AssetCard.svelte +7 -5
  3. package/dist/components/asset-card/AssetCard.svelte.d.ts +2 -2
  4. package/dist/components/avatar/Avatar.svelte.d.ts +1 -1
  5. package/dist/components/badge/Badge.svelte +2 -1
  6. package/dist/components/badge/Badge.svelte.d.ts +2 -1
  7. package/dist/components/button/button-variants.d.ts +7 -4
  8. package/dist/components/button/button-variants.js +7 -4
  9. package/dist/components/command-palette/PaletteSearch.svelte +1 -1
  10. package/dist/components/faceted-search/FacetedSearch.svelte +5 -2
  11. package/dist/components/faceted-search/FacetedSearch.svelte.d.ts +4 -1
  12. package/dist/components/game-card/GameCard.svelte +4 -3
  13. package/dist/components/game-card/GameCard.svelte.d.ts +2 -1
  14. package/dist/components/game-hero/GameHero.svelte +2 -2
  15. package/dist/components/game-hero/GameHero.svelte.d.ts +1 -1
  16. package/dist/components/player-count/PlayerCount.svelte +3 -3
  17. package/dist/components/player-count/PlayerCount.svelte.d.ts +2 -2
  18. package/dist/components/sidebar/Sidebar.svelte +20 -15
  19. package/dist/components/sidebar/Sidebar.svelte.d.ts +5 -4
  20. package/dist/components/sidebar/SidebarSection.svelte +3 -3
  21. package/dist/components/sidebar/SidebarSection.svelte.d.ts +2 -2
  22. package/dist/components/tag-picker/TagPicker.svelte +1 -1
  23. package/dist/components/theme-switch/ThemeSwitch.svelte +1 -1
  24. package/dist/components/theme-switch/ThemeSwitch.svelte.d.ts +1 -1
  25. package/dist/editor/inspector-panel/InspectorPanel.svelte +12 -13
  26. package/dist/editor/inspector-panel/InspectorPanel.svelte.d.ts +3 -2
  27. package/dist/generated/theme.css +22 -22
  28. package/dist/generated/tokens.js +16 -16
  29. package/dist/styles/scale.css +0 -2
  30. package/dist/utils.js +3 -4
  31. package/package.json +1 -1
package/README.md CHANGED
@@ -97,7 +97,7 @@ the same, and never write a colour literal.
97
97
  | Text | `fg`, `fg-2`, `muted`, `faint` |
98
98
  | Actions and status | `primary`, `primary-hover`, `on-primary`, `danger`, `on-danger`, `success`, `warning`, `info`, `accent`, each with `-subtle` (a tinted fill) and `-border` |
99
99
  | Editor | `server`, `local` (the two object modes), `grid-line`, the code colours `code-keyword`, `code-function`, `code-string`, `code-number`, `code-type`, `code-comment`, `code-attribute`, `code-line` |
100
- | Fixed in both themes | `paper` (switch and slider thumbs, QR codes), `on-art`, `art-scrim` and `art-scrim-hover` (text and pills over game art), `avatar-1` to `avatar-5` |
100
+ | Fixed in both themes | `paper` (switch and slider thumbs, QR codes), `on-art`, `art-scrim` and `art-scrim-hover` (text, labels and buttons over game art), `avatar-1` to `avatar-5` |
101
101
  | Overlays | `scrim` |
102
102
 
103
103
  - **Theme:** dark is the default; `data-theme="light"` on `<html>` (or on any element, for a
@@ -115,6 +115,12 @@ the same, and never write a colour literal.
115
115
  `ContextMenu`, `HoverCard`, `FloatingPanel`, `CommandPalette`) take `frosted` for a translucent,
116
116
  blurred surface; the `frosted` utility is for overlays only.
117
117
  - Tailwind's default palette and shadows are removed: only these tokens produce colour utilities.
118
+ - **Contrast:** every text colour keeps 4.5:1 (WCAG 2.2 AA) on every fill it is drawn on, in both
119
+ themes: the neutral texts on every surface and on `hover`, and `fg`, `fg-2` and `muted` also on
120
+ each status tint; the coloured texts on every surface, on `hover` and on their own tint; the code
121
+ colours on the current line. `active` (a pressed or current item) carries `fg`, `fg-2` or `muted`
122
+ only, and `faint` never sits on a tint. The one exception is the code editor's selection
123
+ highlights, laid by the user over any text. A test checks each pair.
118
124
 
119
125
  The tokens have one source, `scripts/tokens/tokens.ts`. When the library is built,
120
126
  `scripts/tokens/generate.ts` writes the theme CSS (`src/lib/generated/theme.css`) and the
@@ -318,33 +324,33 @@ variants).
318
324
 
319
325
  ### Display
320
326
 
321
- | Component | What it is |
322
- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
323
- | [`Announcement`](https://play-horizon.github.io/horizon-design/announcement) | A small pill that announces something new, with an optional icon and a tag. |
324
- | [`AspectRatio`](https://play-horizon.github.io/horizon-design/aspect-ratio) | Keeps its content at a fixed width-to-height ratio (`ratio`, such as `16 / 9`). |
325
- | [`AssetCard`](https://play-horizon.github.io/horizon-design/asset-card) | An asset in a list (a store listing, an entry of My assets or of a game's assets): its square thumbnail, its `name`, its `kind`, a `meta` line (votes, the rig profile) and `actions` (Add to my assets). It is a link with `href`, a button with `onclick`, a toggle pressed while `selected` with `selectable` (for pickers), and a plain display with none of them. `name` and `kind`, translated, are required. |
326
- | [`Avatar`](https://play-horizon.github.io/horizon-design/avatar) | A person's avatar: their image, or their initials (`fallback`) on a coloured disc while it loads or when there is none, the same size either way. `alt`, the person's name, names it; without it, it is decorative. |
327
- | [`AvatarStack`](https://play-horizon.github.io/horizon-design/avatar-stack) | A row of overlapping avatars, such as who is editing a game now: up to `max` people, then a chip whose text `overflowText` gives; `label`, required, names the group. |
328
- | [`Badge`](https://play-horizon.github.io/horizon-design/badge) | A small label: a status, a count, a tag or a restriction badge; `variant` sets its colour and `size` its height. |
329
- | [`Card`](https://play-horizon.github.io/horizon-design/card) | A surface that groups related content: an optional title and description, the content, and an optional footer. The title is a heading of `headingLevel` (3 by default, 2 right under the page's title). |
330
- | [`Carousel`](https://play-horizon.github.io/horizon-design/carousel) | A horizontal slideshow of `slides` with previous and next controls and indicators (Ark Carousel); `label`, required, names it, and Ark `translations`, required, name the slides and the controls and the roles of the carousel and its slides. The arrows and dots show their names in tooltips. |
331
- | [`DataList`](https://play-horizon.github.io/horizon-design/data-list) | A list of label and value pairs (`items`), such as the details of a game. |
332
- | [`Frame`](https://play-horizon.github.io/horizon-design/frame) | A window-like frame around content, such as a code sample or a screenshot; with a `title`, a title bar shows it, with three window controls at its end. |
333
- | [`GameCard`](https://play-horizon.github.io/horizon-design/game-card) | A game in a list, its 16:9 thumbnail and its name: a link with `href`, a button with `onclick`, either covering the whole card; a plain display with neither. The `feature` variant is the larger Continue playing card, with the icon and an `action` (Play). |
334
- | [`GameHero`](https://play-horizon.github.io/horizon-design/game-hero) | The top of a game page: the game's 16:9 thumbnail as a banner that fades into the page, with the square icon, the name, a `byline` (the creator) and the game's `tags` over its bottom, and a `top` slot at its top left (Back, a `Button` of the `art` variant). |
335
- | [`Item`](https://play-horizon.github.io/horizon-design/item) | A row of a list, laying out what it is given (media, a title, a description, actions) in a line: a link with `href`, a button with `onclick` (its content then holds no other control), a plain row with neither. |
336
- | [`Kbd`](https://play-horizon.github.io/horizon-design/kbd) | A keyboard key or shortcut, such as `Ctrl K`, drawn as a raised key. With `command` (its names, translated), the platform's command key: ⌘ on Apple's platforms, Ctrl elsewhere, from the user agent once mounted, without changing size. `isApplePlatform` tells the app which key its shortcuts use. |
337
- | [`Marquee`](https://play-horizon.github.io/horizon-design/marquee) | Content (`MarqueeItem`s) that scrolls continuously, pausing while hovered or focused and still under reduced motion (Ark Marquee); `label` and `roleDescription`, required, name the region and its role. |
338
- | [`PlayerCount`](https://play-horizon.github.io/horizon-design/player-count) | How many people are playing a game now: a live dot and the count. `count` (formatted) and `label` (`playing now`) are required; `variant` is `inline` or an `overlay` pill on game art. |
339
- | [`Prose`](https://play-horizon.github.io/horizon-design/prose) | Typography for long-form text, such as rendered Markdown; its text is selectable. |
340
- | [`QrCode`](https://play-horizon.github.io/horizon-design/qr-code) | A QR code of `value` on the fixed `paper` background, so scanners read it in both themes (Ark QrCode); `label`, required, names the image. |
341
- | [`ScrollArea`](https://play-horizon.github.io/horizon-design/scroll-area) | A scrolling region with a thin, themed vertical scrollbar, shown only while the content overflows and kept 8 px from the region's top and bottom (Ark ScrollArea); the region needs a height and a `label`, required, which names it, and takes the keyboard focus while it scrolls, so the arrow keys scroll it. |
342
- | [`Separator`](https://play-horizon.github.io/horizon-design/separator) | A horizontal or vertical divider, hidden from assistive technology unless `decorative` is false. |
343
- | [`Status`](https://play-horizon.github.io/horizon-design/status) | A small dot that shows a status: online (or running), away, busy (or failing) or offline, with a soft ring in its colour; `label` names it, and without it the dot is decorative. |
344
- | [`Table`](https://play-horizon.github.io/horizon-design/table) | A data table from `columns` and `rows`: a column shows each row's field named by its `key`, or renders its `cell` snippet with the row; `rowKey`, required, gives each row's stable key. |
345
- | [`ThemeSwitch`](https://play-horizon.github.io/horizon-design/theme-switch) | The theme switch: three icon buttons (system, dark, light) on a sunken pill, which call `theme.set`, with a raised highlight that slides to the chosen one; `labels`, required, names the group and each mode, also in each button's tooltip (`tooltipSide` places them). |
346
- | [`ThumbCard`](https://play-horizon.github.io/horizon-design/thumb-card) | A card showing a preview (its content) with a `label` under it: a link with `href`, a button with `onclick`, either covering the whole card; a plain display with neither. |
347
- | [`Timer`](https://play-horizon.github.io/horizon-design/timer) | A countdown or a stopwatch (Ark Timer), with the days before the hours from one day on (`01:02:00:00`), and start, pause, resume and reset buttons that `labels`, required, names (also in their tooltips). It starts paused unless `autoStart`. |
327
+ | Component | What it is |
328
+ | ---------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
329
+ | [`Announcement`](https://play-horizon.github.io/horizon-design/announcement) | A small pill that announces something new, with an optional icon and a tag. |
330
+ | [`AspectRatio`](https://play-horizon.github.io/horizon-design/aspect-ratio) | Keeps its content at a fixed width-to-height ratio (`ratio`, such as `16 / 9`). |
331
+ | [`AssetCard`](https://play-horizon.github.io/horizon-design/asset-card) | An asset in a list (a store listing, an entry of My assets or of a game's assets): its square thumbnail, its `name`, then its `kind` and a `meta` line (votes, the rig profile) in muted text and `actions` (Add to my assets). It is a link with `href`, a button with `onclick`, a toggle pressed while `selected` with `selectable` (for pickers), and a plain display with none of them. `name` and `kind`, translated, are required. |
332
+ | [`Avatar`](https://play-horizon.github.io/horizon-design/avatar) | A person's avatar: their image, or their initials (`fallback`) on a coloured disc while it loads or when there is none, the same size either way. `alt`, the person's name, names it; without it, it is decorative. |
333
+ | [`AvatarStack`](https://play-horizon.github.io/horizon-design/avatar-stack) | A row of overlapping avatars, such as who is editing a game now: up to `max` people, then a chip whose text `overflowText` gives; `label`, required, names the group. |
334
+ | [`Badge`](https://play-horizon.github.io/horizon-design/badge) | A small label for state the user must notice (a status, an unread or error count, a restriction badge; metadata such as tags is muted text instead); `variant` sets its colour and `size` its height. |
335
+ | [`Card`](https://play-horizon.github.io/horizon-design/card) | A surface that groups related content: an optional title and description, the content, and an optional footer. The title is a heading of `headingLevel` (3 by default, 2 right under the page's title). |
336
+ | [`Carousel`](https://play-horizon.github.io/horizon-design/carousel) | A horizontal slideshow of `slides` with previous and next controls and indicators (Ark Carousel); `label`, required, names it, and Ark `translations`, required, name the slides and the controls and the roles of the carousel and its slides. The arrows and dots show their names in tooltips. |
337
+ | [`DataList`](https://play-horizon.github.io/horizon-design/data-list) | A list of label and value pairs (`items`), such as the details of a game. |
338
+ | [`Frame`](https://play-horizon.github.io/horizon-design/frame) | A window-like frame around content, such as a code sample or a screenshot; with a `title`, a title bar shows it, with three window controls at its end. |
339
+ | [`GameCard`](https://play-horizon.github.io/horizon-design/game-card) | A game in a list, its 16:9 thumbnail and its name: a link with `href`, a button with `onclick`, either covering the whole card; a plain display with neither. The `feature` variant is the larger Continue playing card, with the icon and an `action` (Play). |
340
+ | [`GameHero`](https://play-horizon.github.io/horizon-design/game-hero) | The top of a game page: the game's 16:9 thumbnail as a banner that fades into the page, with the square icon, the name, a `byline` (the creator) and the game's `tags` (plain text, never badges) over its bottom, and a `top` slot at its top left (Back, a `Button` of the `art` variant). |
341
+ | [`Item`](https://play-horizon.github.io/horizon-design/item) | A row of a list, laying out what it is given (media, a title, a description, actions) in a line: a link with `href`, a button with `onclick` (its content then holds no other control), a plain row with neither. |
342
+ | [`Kbd`](https://play-horizon.github.io/horizon-design/kbd) | A keyboard key or shortcut, such as `Ctrl K`, drawn as a raised key. With `command` (its names, translated), the platform's command key: ⌘ on Apple's platforms, Ctrl elsewhere, from the user agent once mounted, without changing size. `isApplePlatform` tells the app which key its shortcuts use. |
343
+ | [`Marquee`](https://play-horizon.github.io/horizon-design/marquee) | Content (`MarqueeItem`s) that scrolls continuously, pausing while hovered or focused and still under reduced motion (Ark Marquee); `label` and `roleDescription`, required, name the region and its role. |
344
+ | [`PlayerCount`](https://play-horizon.github.io/horizon-design/player-count) | How many people are playing a game now: a live dot and the count. `count` (formatted) and `label` (`playing now`) are required; `variant` is `inline` or an `overlay` label on game art. |
345
+ | [`Prose`](https://play-horizon.github.io/horizon-design/prose) | Typography for long-form text, such as rendered Markdown; its text is selectable. |
346
+ | [`QrCode`](https://play-horizon.github.io/horizon-design/qr-code) | A QR code of `value` on the fixed `paper` background, so scanners read it in both themes (Ark QrCode); `label`, required, names the image. |
347
+ | [`ScrollArea`](https://play-horizon.github.io/horizon-design/scroll-area) | A scrolling region with a thin, themed vertical scrollbar, shown only while the content overflows and kept 8 px from the region's top and bottom (Ark ScrollArea); the region needs a height and a `label`, required, which names it, and takes the keyboard focus while it scrolls, so the arrow keys scroll it. |
348
+ | [`Separator`](https://play-horizon.github.io/horizon-design/separator) | A horizontal or vertical divider, hidden from assistive technology unless `decorative` is false. |
349
+ | [`Status`](https://play-horizon.github.io/horizon-design/status) | A small dot that shows a status: online (or running), away, busy (or failing) or offline, with a soft ring in its colour; `label` names it, and without it the dot is decorative. |
350
+ | [`Table`](https://play-horizon.github.io/horizon-design/table) | A data table from `columns` and `rows`: a column shows each row's field named by its `key`, or renders its `cell` snippet with the row; `rowKey`, required, gives each row's stable key. |
351
+ | [`ThemeSwitch`](https://play-horizon.github.io/horizon-design/theme-switch) | The theme switch: three icon buttons (system, dark, light) on a sunken track, which call `theme.set`, with a raised highlight that slides to the chosen one; `labels`, required, names the group and each mode, also in each button's tooltip (`tooltipSide` places them). |
352
+ | [`ThumbCard`](https://play-horizon.github.io/horizon-design/thumb-card) | A card showing a preview (its content) with a `label` under it: a link with `href`, a button with `onclick`, either covering the whole card; a plain display with neither. |
353
+ | [`Timer`](https://play-horizon.github.io/horizon-design/timer) | A countdown or a stopwatch (Ark Timer), with the days before the hours from one day on (`01:02:00:00`), and start, pause, resume and reset buttons that `labels`, required, names (also in their tooltips). It starts paused unless `autoStart`. |
348
354
 
349
355
  ### Feedback
350
356
 
@@ -370,7 +376,7 @@ variants).
370
376
  | [`CommandPalette`](https://play-horizon.github.io/horizon-design/command-palette) | The command palette: a dialog at the top of the window with a search field and every command that matches what is typed (each word whole, ignoring case and accents, through Ark's `useFilter`), ranked by [fuzzysort](https://github.com/farzher/fuzzysort), label matches first, each with its shortcut. The field and the virtualised list are an Ark combobox: Up, Down, Home and End move through the commands that can run, Enter runs one, Escape closes. `open` binds, `onRun` runs the chosen command once the palette has finished closing, so the command can move the focus, and `label` and `emptyText` are required. |
371
377
  | [`LinkOverlay`](https://play-horizon.github.io/horizon-design/link-overlay) | The link of a `LinkBox`, stretched over the whole box so a click anywhere follows it, while the box's other links and controls stay usable. |
372
378
  | [`Pagination`](https://play-horizon.github.io/horizon-design/pagination) | Page links with previous and next for `count` items, required (Ark Pagination); `page` binds the current page, and Ark `translations` name its controls; the built-in arrows show their names as tooltips. `children` replaces the built-in controls with the parts `PaginationPrevTrigger` and `PaginationNextTrigger` (an icon-only one takes a `label`, its tooltip), `PaginationItem`, `PaginationEllipsis` and `PaginationContext`, which reads its state. |
373
- | [`Sidebar`](https://play-horizon.github.io/horizon-design/sidebar) | An app's navigation sidebar: a sunken column with an optional header (the brand), the navigation itself (`SidebarSection` and `SidebarItem`, named by `label`) and an optional footer (the account); `collapsed` narrows it to its icons, and each item then shows its text as a tooltip. |
379
+ | [`Sidebar`](https://play-horizon.github.io/horizon-design/sidebar) | An app's navigation sidebar: a sunken column with an optional header (the brand), then the navigation landmark (named by `label`), holding the navigation itself (`SidebarSection` and `SidebarItem`) and an optional footer (the account's entries); `collapsed` narrows it to its icons, and each item then shows its text as a tooltip. |
374
380
  | [`SkipNav`](https://play-horizon.github.io/horizon-design/skip-nav) | A link, shown on keyboard focus, that skips to the page's main content. |
375
381
  | [`Steps`](https://play-horizon.github.io/horizon-design/steps) | A multi-step flow (Ark Steps): the `steps` (each an `id`, a `title` and its `content`), the current step's content, and back and next buttons named by `prevLabel` and `nextLabel`, required; `step` binds the current step. |
376
382
 
@@ -406,7 +412,7 @@ variants).
406
412
  | [`FileTree`](https://play-horizon.github.io/horizon-design/file-tree) | A tree of files and folders on `VirtualTree` (only the rows in view are rendered) from a `collection`, with expandable folders and custom icons; only files are selected. `label`, required, names it, and `selectedValue`, `expandedValue` and `focusedValue` bind. |
407
413
  | [`HierarchyView`](https://play-horizon.github.io/horizon-design/hierarchy-view) | The Editor's hierarchy of a scene's objects, on `VirtualTree`: keyboard navigation, multiple selection, renaming, deletion, and drag and drop ([pragmatic-drag-and-drop](#drag-and-drop)) to reparent and reorder, which reports each change of `data` through `onDataChange`. `label`, `renameLabel` and `dragLabel` are required; `nodeWithName` writes a renamed node when `nodeToString` reads a field other than `name`, and `selectedValue` and `expandedValue` bind. |
408
414
  | [`HorizonLayout`](https://play-horizon.github.io/horizon-design/horizon-layout) | The Editor window's docking layout: horizon-layout 2.0.2 styled with horizon-design, taking every prop of its `HorizonLayout`, with docked panes that meet on a single line, floating panels raised over them, and a button that restores a maximised view; `config` binds, `views` holds the views, horizon-layout's `translations`, required and complete, name the split handles, the tab lists and the floating panels, and `restoreLabel`, required, names the restore button and is its tooltip. |
409
- | [`InspectorPanel`](https://play-horizon.github.io/horizon-design/inspector-panel) | The Editor's inspector: a column of collapsible cards (a component each) that can be reordered by drag ([pragmatic-drag-and-drop](#drag-and-drop)) or keyboard; `cards` and `expandedIds` bind, and `onRemove` with `removeLabel` adds a remove button (with its tooltip) to each card not marked `removable: false`. |
415
+ | [`InspectorPanel`](https://play-horizon.github.io/horizon-design/inspector-panel) | The Editor's inspector: a column of flat collapsible sections divided by hairlines (a component each, `cards` in the API), opened by their header rows, that can be reordered by drag ([pragmatic-drag-and-drop](#drag-and-drop)) or keyboard; `cards` and `expandedIds` bind, and `onRemove` with `removeLabel` adds a remove button (with its tooltip) to each card not marked `removable: false`. |
410
416
 
411
417
  ## Drag and drop
412
418
 
@@ -418,6 +424,26 @@ package computes exactly the instructions a hierarchy needs (reorder above or be
418
424
  reparent by indent level) and a list's closest edge. `@dnd-kit/svelte` was the alternative; its
419
425
  Svelte port is younger and less proven. The keyboard does the same moves (Shift+arrows).
420
426
 
427
+ ## Upgrading from 2.0
428
+
429
+ 2.1.0 changes what an app may see or test:
430
+
431
+ - **Token values:** the text colours that fell short of 4.5:1 moved in lightness, hue kept: `muted`
432
+ and `faint`, `primary` and `server`, `danger`, and `code-comment` in both themes, and in the light
433
+ theme `success`, `local`, `info` and `code-number`. Code that copied a hex from
434
+ `horizon-design/tokens` gets the new values.
435
+ - **`tracking-overline` is removed**, with the uppercase labels it spaced: section labels
436
+ (`SidebarSection`, `FacetedSearch`'s legends) are sentence case, small and semibold.
437
+ - **`Button`'s `tint` and `danger` variants** mark their hover with the full-colour border instead of
438
+ a darker tint.
439
+ - **`InspectorPanel`** draws its components as flat sections divided by hairlines, not bordered
440
+ cards; its drop line is `[data-slot="inspector-panel-drop-line"]`, with `data-edge` `top` or
441
+ `bottom`.
442
+ - **`AssetCard`** shows its `kind` as muted text, no longer a `Badge`.
443
+ - **`TagPicker`'s** tags and **`PlayerCount`'s** overlay are rounded like the controls (6 px), no
444
+ longer fully.
445
+ - **`GameCard`** without a thumbnail draws its art box with the `sunken` fill (it was `raised`).
446
+
421
447
  ## Upgrading from 1.0.0
422
448
 
423
449
  2.0.0 changes what code written for 1.0.0 may rely on:
@@ -1,8 +1,8 @@
1
1
  <!--
2
2
  @component
3
3
  An asset in a list (a store listing, an entry of My assets or of a game's assets): its square
4
- thumbnail, its name, its kind, a `meta` line (votes, the rig profile) and `actions` (Add to my
5
- assets). Without a thumbnail, `placeholder` (an icon of the kind) is drawn on a neutral fill.
4
+ thumbnail, its name, then its kind and a `meta` line in muted text (votes, the rig profile), and
5
+ `actions` (Add to my assets). Without a thumbnail, `placeholder` (an icon of the kind) is drawn on a neutral fill.
6
6
 
7
7
  It is interactive only when given something to do: with `href`, its name is a link; with `onclick`,
8
8
  a button; with `selectable` too, a toggle whose pressed state is `selected`, for pickers. The link
@@ -12,7 +12,6 @@ a button), and the actions stay their own buttons. With none of them, it is a pl
12
12
  <script lang="ts">
13
13
  import type { Snippet } from 'svelte';
14
14
  import { cn } from '../../utils.js';
15
- import Badge from '../badge/Badge.svelte';
16
15
 
17
16
  let {
18
17
  name,
@@ -93,8 +92,11 @@ a button), and the actions stay their own buttons. With none of them, it is a pl
93
92
  <span class="truncate text-sm font-semibold text-fg">{name}</span>
94
93
  {/if}
95
94
  <div class="flex min-w-0 items-center gap-1.5 text-xs text-muted">
96
- <Badge size="sm">{kind}</Badge>
97
- {#if meta}<span class="relative z-2 truncate">{@render meta()}</span>{/if}
95
+ <span class="shrink-0">{kind}</span>
96
+ {#if meta}
97
+ <span aria-hidden="true">·</span>
98
+ <span class="relative z-2 truncate">{@render meta()}</span>
99
+ {/if}
98
100
  </div>
99
101
  </div>
100
102
  {#if actions}
@@ -25,8 +25,8 @@ type $$ComponentProps = {
25
25
  };
26
26
  /**
27
27
  * An asset in a list (a store listing, an entry of My assets or of a game's assets): its square
28
- * thumbnail, its name, its kind, a `meta` line (votes, the rig profile) and `actions` (Add to my
29
- * assets). Without a thumbnail, `placeholder` (an icon of the kind) is drawn on a neutral fill.
28
+ * thumbnail, its name, then its kind and a `meta` line in muted text (votes, the rig profile), and
29
+ * `actions` (Add to my assets). Without a thumbnail, `placeholder` (an icon of the kind) is drawn on a neutral fill.
30
30
  *
31
31
  * It is interactive only when given something to do: with `href`, its name is a link; with `onclick`,
32
32
  * a button; with `selectable` too, a toggle whose pressed state is `selected`, for pickers. The link
@@ -20,7 +20,7 @@ declare const Avatar: import("svelte").Component<{
20
20
  /** The disc's colour; picked from the initials when unset. */
21
21
  tone?: AvatarTone;
22
22
  /** The diameter, from `xs` (18 px) to `xl` (64 px). */
23
- size?: "sm" | "md" | "xs" | "lg" | "xl";
23
+ size?: "xs" | "sm" | "md" | "lg" | "xl";
24
24
  }, {}, "">;
25
25
  type Avatar = ReturnType<typeof Avatar>;
26
26
  export default Avatar;
@@ -1,6 +1,7 @@
1
1
  <!--
2
2
  @component
3
- A small label: a status, a count, a tag or a restriction badge. `variant` sets its colour
3
+ A small label for state the user must notice: a status, an unread or error count, a restriction
4
+ badge. Metadata (tags, a kind, a role) is muted text, not a badge. `variant` sets its colour
4
5
  (neutral, primary, success, warning, danger, info, accent, and the Editor's server and local
5
6
  modes); `size` its height (md 20 px, sm 17 px).
6
7
  -->
@@ -1,6 +1,7 @@
1
1
  import type { Snippet } from 'svelte';
2
2
  /**
3
- * A small label: a status, a count, a tag or a restriction badge. `variant` sets its colour
3
+ * A small label for state the user must notice: a status, an unread or error count, a restriction
4
+ * badge. Metadata (tags, a kind, a role) is muted text, not a badge. `variant` sets its colour
4
5
  * (neutral, primary, success, warning, danger, info, accent, and the Editor's server and local
5
6
  * modes); `size` its height (md 20 px, sm 17 px).
6
7
  */
@@ -9,15 +9,18 @@ declare const variants: {
9
9
  readonly default: "bg-surface border-border text-fg inset-shadow-highlight hover:bg-hover";
10
10
  /** The one main action of a screen. */
11
11
  readonly primary: "bg-primary border-primary text-on-primary font-semibold hover:bg-primary-hover hover:border-primary-hover";
12
- /** A secondary action that should stand out: tinted with the primary colour. */
13
- readonly tint: "bg-primary-subtle border-primary-border text-primary hover:bg-primary/20";
12
+ /**
13
+ * A secondary action that should stand out: tinted with the primary colour. Hovered, its border
14
+ * takes the full colour: a darker tint behind the text would take it under 4.5:1.
15
+ */
16
+ readonly tint: "bg-primary-subtle border-primary-border text-primary hover:border-primary";
14
17
  /** A quiet action in toolbars and lists. */
15
18
  readonly ghost: "bg-transparent border-transparent text-fg-2 hover:bg-hover hover:text-fg";
16
19
  /** A destructive action next to others. */
17
- readonly danger: "bg-danger-subtle border-danger-border text-danger hover:bg-danger/20";
20
+ readonly danger: "bg-danger-subtle border-danger-border text-danger hover:border-danger";
18
21
  /** The confirming action of a destructive dialog. */
19
22
  readonly 'danger-solid': "bg-danger border-danger text-on-danger font-semibold hover:opacity-90";
20
- /** An action over game art, such as a game page's Back: a dark translucent pill in both themes. */
23
+ /** An action over game art, such as a game page's Back: a dark translucent button in both themes. */
21
24
  readonly art: "bg-art-scrim border-transparent text-on-art hover:bg-art-scrim-hover";
22
25
  /** Text that acts like a link. */
23
26
  readonly link: "border-transparent text-primary underline-offset-4 hover:underline";
@@ -5,15 +5,18 @@ const variants = {
5
5
  default: 'bg-surface border-border text-fg inset-shadow-highlight hover:bg-hover',
6
6
  /** The one main action of a screen. */
7
7
  primary: 'bg-primary border-primary text-on-primary font-semibold hover:bg-primary-hover hover:border-primary-hover',
8
- /** A secondary action that should stand out: tinted with the primary colour. */
9
- tint: 'bg-primary-subtle border-primary-border text-primary hover:bg-primary/20',
8
+ /**
9
+ * A secondary action that should stand out: tinted with the primary colour. Hovered, its border
10
+ * takes the full colour: a darker tint behind the text would take it under 4.5:1.
11
+ */
12
+ tint: 'bg-primary-subtle border-primary-border text-primary hover:border-primary',
10
13
  /** A quiet action in toolbars and lists. */
11
14
  ghost: 'bg-transparent border-transparent text-fg-2 hover:bg-hover hover:text-fg',
12
15
  /** A destructive action next to others. */
13
- danger: 'bg-danger-subtle border-danger-border text-danger hover:bg-danger/20',
16
+ danger: 'bg-danger-subtle border-danger-border text-danger hover:border-danger',
14
17
  /** The confirming action of a destructive dialog. */
15
18
  'danger-solid': 'bg-danger border-danger text-on-danger font-semibold hover:opacity-90',
16
- /** An action over game art, such as a game page's Back: a dark translucent pill in both themes. */
19
+ /** An action over game art, such as a game page's Back: a dark translucent button in both themes. */
17
20
  art: 'bg-art-scrim border-transparent text-on-art hover:bg-art-scrim-hover',
18
21
  /** Text that acts like a link. */
19
22
  link: 'border-transparent text-primary underline-offset-4 hover:underline'
@@ -127,7 +127,7 @@ opens (the dialog unmounts its content on close), so every opening starts with a
127
127
  >
128
128
  <span class="min-w-0 truncate">{command.label}</span>
129
129
  {#if command.group}
130
- <span class="shrink-0 text-xs text-faint">{command.group}</span>
130
+ <span class="shrink-0 text-xs text-muted">{command.group}</span>
131
131
  {/if}
132
132
  {#if command.shortcut}
133
133
  <Kbd class="ml-auto">{command.shortcut}</Kbd>
@@ -77,7 +77,10 @@ shows while any option is chosen. Every text is passed in, translated.
77
77
  facets: readonly Facet[];
78
78
  /** The ways to order the results; no sort control when empty. */
79
79
  sorts?: readonly SortOption[];
80
- /** The chosen sort's id (bindable); unset, the first of `sorts`. */
80
+ /**
81
+ * The chosen sort's id (bindable); left out, the first of `sorts`. Bind it to a state that
82
+ * holds an id: Svelte refuses to bind an unset value to a prop that has a fallback.
83
+ */
81
84
  sort?: string;
82
85
  /** The search field's accessible name, such as "Search games". */
83
86
  searchLabel: string;
@@ -130,7 +133,7 @@ shows while any option is chosen. Every text is passed in, translated.
130
133
  <aside class="flex min-h-0 flex-col gap-5 overflow-y-auto">
131
134
  {#each facets as facet (facet.id)}
132
135
  <fieldset class="grid gap-1.5">
133
- <legend class="mb-1.5 text-2xs font-bold tracking-overline text-faint uppercase">
136
+ <legend class="mb-1.5 text-xs font-semibold text-muted">
134
137
  {facet.label}
135
138
  </legend>
136
139
  {#each facet.options as option (option.id)}
@@ -42,7 +42,10 @@ type $$ComponentProps = {
42
42
  facets: readonly Facet[];
43
43
  /** The ways to order the results; no sort control when empty. */
44
44
  sorts?: readonly SortOption[];
45
- /** The chosen sort's id (bindable); unset, the first of `sorts`. */
45
+ /**
46
+ * The chosen sort's id (bindable); left out, the first of `sorts`. Bind it to a state that
47
+ * holds an id: Svelte refuses to bind an unset value to a prop that has a fallback.
48
+ */
46
49
  sort?: string;
47
50
  /** The search field's accessible name, such as "Search games". */
48
51
  searchLabel: string;
@@ -10,7 +10,8 @@ neither, it is a plain display: no hover, no focus.
10
10
  - `feature` (Continue playing): a larger card with the square `icon`, the name and the `meta`
11
11
  line drawn over the bottom of the art, and an `action` (Play) at its bottom right.
12
12
 
13
- The art carries the colour; without a thumbnail, a neutral fill stands in.
13
+ The art carries the colour; without a thumbnail, the sunken fill stands in, apart from the page in
14
+ both themes.
14
15
  -->
15
16
  <script lang="ts">
16
17
  import type { Snippet } from 'svelte';
@@ -81,7 +82,7 @@ The art carries the colour; without a thumbnail, a neutral fill stands in.
81
82
  >
82
83
  <div
83
84
  class={cn(
84
- 'relative grid aspect-video overflow-hidden rounded-lg bg-raised shadow-sm transition-[transform,box-shadow] duration-200 ease-standard',
85
+ 'relative grid aspect-video overflow-hidden rounded-lg bg-sunken shadow-sm transition-[transform,box-shadow] duration-200 ease-standard',
85
86
  lift
86
87
  )}
87
88
  >
@@ -122,7 +123,7 @@ The art carries the colour; without a thumbnail, a neutral fill stands in.
122
123
  >
123
124
  <div
124
125
  class={cn(
125
- 'relative aspect-video overflow-hidden rounded-lg bg-raised shadow-sm transition-[transform,box-shadow] duration-200 ease-standard',
126
+ 'relative aspect-video overflow-hidden rounded-lg bg-sunken shadow-sm transition-[transform,box-shadow] duration-200 ease-standard',
126
127
  lift
127
128
  )}
128
129
  >
@@ -34,7 +34,8 @@ type $$ComponentProps = {
34
34
  * - `feature` (Continue playing): a larger card with the square `icon`, the name and the `meta`
35
35
  * line drawn over the bottom of the art, and an `action` (Play) at its bottom right.
36
36
  *
37
- * The art carries the colour; without a thumbnail, a neutral fill stands in.
37
+ * The art carries the colour; without a thumbnail, the sunken fill stands in, apart from the page in
38
+ * both themes.
38
39
  */
39
40
  declare const GameCard: import("svelte").Component<$$ComponentProps, {}, "">;
40
41
  type GameCard = ReturnType<typeof GameCard>;
@@ -25,7 +25,7 @@ the square icon, the name, a `byline` (the creator) and the game's `tags` over i
25
25
  icon?: string;
26
26
  /** The line under the name: the creator. */
27
27
  byline?: Snippet;
28
- /** The game's tags, next to the byline. */
28
+ /** The game's tags, next to the byline, as plain text ("obby · platformer"), never badges. */
29
29
  tags?: Snippet;
30
30
  /** Drawn at the banner's top left, such as a Back button. */
31
31
  top?: Snippet;
@@ -62,7 +62,7 @@ the square icon, the name, a `byline` (the creator) and the game's `tags` over i
62
62
  <div class="flex items-center gap-1.5 text-fg-2">{@render byline()}</div>
63
63
  {/if}
64
64
  {#if tags}
65
- <div class="flex flex-wrap gap-1.5">{@render tags()}</div>
65
+ <div class="flex flex-wrap gap-1.5 text-fg-2">{@render tags()}</div>
66
66
  {/if}
67
67
  </div>
68
68
  {/if}
@@ -8,7 +8,7 @@ type $$ComponentProps = {
8
8
  icon?: string;
9
9
  /** The line under the name: the creator. */
10
10
  byline?: Snippet;
11
- /** The game's tags, next to the byline. */
11
+ /** The game's tags, next to the byline, as plain text ("obby · platformer"), never badges. */
12
12
  tags?: Snippet;
13
13
  /** Drawn at the banner's top left, such as a Back button. */
14
14
  top?: Snippet;
@@ -1,7 +1,7 @@
1
1
  <!--
2
2
  @component
3
3
  How many people are playing a game now: a live dot and the count. `inline` (the game page) shows
4
- the count in bold followed by its label; `overlay` (on game art) is a dark pill with the count
4
+ the count in bold followed by its label; `overlay` (on game art) is a dark label with the count
5
5
  only, its label kept for assistive technology. The app passes the count already formatted by the
6
6
  i18n layer (`9,870`, `4.2k`) and the label translated (`playing now`). `live` false shows an idle
7
7
  dot, for a game nobody is playing.
@@ -21,7 +21,7 @@ dot, for a game nobody is playing.
21
21
  count: string;
22
22
  /** What the count counts, such as "playing now". */
23
23
  label: string;
24
- /** `inline` for a page, `overlay` for a pill over game art. */
24
+ /** `inline` for a page, `overlay` for a label over game art. */
25
25
  variant?: 'inline' | 'overlay';
26
26
  /** False when nobody is playing: the dot turns idle. */
27
27
  live?: boolean;
@@ -37,7 +37,7 @@ dot, for a game nobody is playing.
37
37
  'inline-flex shrink-0 items-center whitespace-nowrap tabular-nums',
38
38
  variant === 'inline'
39
39
  ? 'gap-1.75 text-base text-fg'
40
- : 'h-5 gap-1.25 rounded-full bg-art-scrim px-1.75 text-xs font-semibold text-on-art',
40
+ : 'h-5 gap-1.25 rounded-md bg-art-scrim px-1.75 text-xs font-semibold text-on-art',
41
41
  className
42
42
  )}
43
43
  data-slot="player-count"
@@ -3,7 +3,7 @@ type $$ComponentProps = {
3
3
  count: string;
4
4
  /** What the count counts, such as "playing now". */
5
5
  label: string;
6
- /** `inline` for a page, `overlay` for a pill over game art. */
6
+ /** `inline` for a page, `overlay` for a label over game art. */
7
7
  variant?: 'inline' | 'overlay';
8
8
  /** False when nobody is playing: the dot turns idle. */
9
9
  live?: boolean;
@@ -14,7 +14,7 @@ type $$ComponentProps = {
14
14
  };
15
15
  /**
16
16
  * How many people are playing a game now: a live dot and the count. `inline` (the game page) shows
17
- * the count in bold followed by its label; `overlay` (on game art) is a dark pill with the count
17
+ * the count in bold followed by its label; `overlay` (on game art) is a dark label with the count
18
18
  * only, its label kept for assistive technology. The app passes the count already formatted by the
19
19
  * i18n layer (`9,870`, `4.2k`) and the label translated (`playing now`). `live` false shows an idle
20
20
  * dot, for a game nobody is playing.
@@ -1,8 +1,9 @@
1
1
  <!--
2
2
  @component
3
- An app's navigation sidebar: a sunken column with an optional header (the brand), the
4
- navigation itself (`SidebarSection` and `SidebarItem`, named by `label`) and an optional footer
5
- (the account). `collapsed` narrows it to the items' icons: their text and the sections' labels
3
+ An app's navigation sidebar: a sunken column with an optional header (the brand), then the
4
+ navigation landmark (named by `label`), which holds both the navigation itself (`SidebarSection`
5
+ and `SidebarItem`), scrolling when it overflows, and the optional footer pinned beneath it (the
6
+ account's entries). `collapsed` narrows it to the items' icons: their text and the sections' labels
6
7
  are clipped or visually hidden, and still read by assistive technology, and each item shows its
7
8
  text as a tooltip.
8
9
  -->
@@ -31,7 +32,7 @@ text as a tooltip.
31
32
  label?: string;
32
33
  /** The top of the sidebar, such as the brand. */
33
34
  header?: Snippet;
34
- /** The bottom of the sidebar, such as the account. */
35
+ /** The bottom of the sidebar, inside the navigation landmark, such as the account's entries. */
35
36
  footer?: Snippet;
36
37
  /** The navigation: `SidebarSection`s and `SidebarItem`s. */
37
38
  children?: Snippet;
@@ -61,16 +62,20 @@ text as a tooltip.
61
62
  {@render header()}
62
63
  </div>
63
64
  {/if}
64
- <nav
65
- aria-label={label}
66
- class="flex flex-1 flex-col gap-0.5 overflow-x-hidden overflow-y-auto px-2.5 pb-3"
67
- data-slot="sidebar-content"
68
- >
69
- {@render children?.()}
70
- </nav>
71
- {#if footer}
72
- <div class="mx-2.5 border-t border-border px-1 py-3" data-slot="sidebar-footer">
73
- {@render footer()}
65
+ <nav aria-label={label} class="flex min-h-0 flex-1 flex-col">
66
+ <div
67
+ class="flex flex-1 flex-col gap-0.5 overflow-x-hidden overflow-y-auto px-2.5 pb-3"
68
+ data-slot="sidebar-content"
69
+ >
70
+ {@render children?.()}
74
71
  </div>
75
- {/if}
72
+ {#if footer}
73
+ <div
74
+ class="mx-2.5 flex flex-col gap-0.5 border-t border-border py-3"
75
+ data-slot="sidebar-footer"
76
+ >
77
+ {@render footer()}
78
+ </div>
79
+ {/if}
80
+ </nav>
76
81
  </aside>
@@ -11,7 +11,7 @@ type $$ComponentProps = {
11
11
  label?: string;
12
12
  /** The top of the sidebar, such as the brand. */
13
13
  header?: Snippet;
14
- /** The bottom of the sidebar, such as the account. */
14
+ /** The bottom of the sidebar, inside the navigation landmark, such as the account's entries. */
15
15
  footer?: Snippet;
16
16
  /** The navigation: `SidebarSection`s and `SidebarItem`s. */
17
17
  children?: Snippet;
@@ -19,9 +19,10 @@ type $$ComponentProps = {
19
19
  [key: string]: unknown;
20
20
  };
21
21
  /**
22
- * An app's navigation sidebar: a sunken column with an optional header (the brand), the
23
- * navigation itself (`SidebarSection` and `SidebarItem`, named by `label`) and an optional footer
24
- * (the account). `collapsed` narrows it to the items' icons: their text and the sections' labels
22
+ * An app's navigation sidebar: a sunken column with an optional header (the brand), then the
23
+ * navigation landmark (named by `label`), which holds both the navigation itself (`SidebarSection`
24
+ * and `SidebarItem`), scrolling when it overflows, and the optional footer pinned beneath it (the
25
+ * account's entries). `collapsed` narrows it to the items' icons: their text and the sections' labels
25
26
  * are clipped or visually hidden, and still read by assistive technology, and each item shows its
26
27
  * text as a tooltip.
27
28
  */
@@ -1,6 +1,6 @@
1
1
  <!--
2
2
  @component
3
- A group of `SidebarItem`s, with an optional overline label that names the group. A collapsed
3
+ A group of `SidebarItem`s, with an optional label that names the group. A collapsed
4
4
  `Sidebar` hides the label visually.
5
5
  -->
6
6
  <script lang="ts">
@@ -15,7 +15,7 @@ A group of `SidebarItem`s, with an optional overline label that names the group.
15
15
  }: {
16
16
  /** Classes added to the group. */
17
17
  class?: string;
18
- /** The group's overline label; none when empty. */
18
+ /** The group's label, in sentence case; none when empty. */
19
19
  label?: string;
20
20
  /** The group's `SidebarItem`s. */
21
21
  children?: Snippet;
@@ -36,7 +36,7 @@ A group of `SidebarItem`s, with an optional overline label that names the group.
36
36
  {#if label}
37
37
  <p
38
38
  id={labelId}
39
- class="px-2.5 pt-3 pb-1 text-2xs font-bold tracking-overline text-muted uppercase group-data-[collapsed=true]/sidebar:sr-only"
39
+ class="px-2.5 pt-3 pb-1 text-xs font-semibold text-muted group-data-[collapsed=true]/sidebar:sr-only"
40
40
  >
41
41
  {label}
42
42
  </p>
@@ -2,7 +2,7 @@ import type { Snippet } from 'svelte';
2
2
  type $$ComponentProps = {
3
3
  /** Classes added to the group. */
4
4
  class?: string;
5
- /** The group's overline label; none when empty. */
5
+ /** The group's label, in sentence case; none when empty. */
6
6
  label?: string;
7
7
  /** The group's `SidebarItem`s. */
8
8
  children?: Snippet;
@@ -10,7 +10,7 @@ type $$ComponentProps = {
10
10
  [key: string]: unknown;
11
11
  };
12
12
  /**
13
- * A group of `SidebarItem`s, with an optional overline label that names the group. A collapsed
13
+ * A group of `SidebarItem`s, with an optional label that names the group. A collapsed
14
14
  * `Sidebar` hides the label visually.
15
15
  */
16
16
  declare const SidebarSection: import("svelte").Component<$$ComponentProps, {}, "">;
@@ -65,7 +65,7 @@ with its labels translated; `value` holds the chosen tags' ids, in the order the
65
65
  aria-pressed={on}
66
66
  disabled={disabled || (full && !on)}
67
67
  class={cn(
68
- 'inline-flex h-control-sm items-center rounded-full border px-2.5 text-sm transition-colors outline-none focus-visible:ring-2 focus-visible:ring-primary disabled:pointer-events-none disabled:opacity-40',
68
+ 'inline-flex h-control-sm items-center rounded-md border px-2.5 text-sm transition-colors outline-none focus-visible:ring-2 focus-visible:ring-primary disabled:pointer-events-none disabled:opacity-40',
69
69
  on
70
70
  ? 'border-primary-border bg-primary-subtle text-primary'
71
71
  : 'border-border bg-surface text-fg-2 hover:bg-hover hover:text-fg'
@@ -1,6 +1,6 @@
1
1
  <!--
2
2
  @component
3
- The theme switch: three icon buttons (system, dark, light) on a sunken pill, with a raised
3
+ The theme switch: three icon buttons (system, dark, light) on a sunken track, with a raised
4
4
  highlight that slides to the chosen one. Once it has slid, choosing calls `theme.set`, which saves
5
5
  the mode and crossfades the page (at once under reduced motion). The labels name each mode, both for assistive technology and in each button's tooltip; the app passes them
6
6
  translated.
@@ -20,7 +20,7 @@ type $$ComponentProps = {
20
20
  class?: string;
21
21
  };
22
22
  /**
23
- * The theme switch: three icon buttons (system, dark, light) on a sunken pill, with a raised
23
+ * The theme switch: three icon buttons (system, dark, light) on a sunken track, with a raised
24
24
  * highlight that slides to the chosen one. Once it has slid, choosing calls `theme.set`, which saves
25
25
  * the mode and crossfades the page (at once under reduced motion). The labels name each mode, both for assistive technology and in each button's tooltip; the app passes them
26
26
  * translated.
@@ -1,7 +1,8 @@
1
1
  <!--
2
2
  @component
3
- The Editor's inspector: a column of collapsible cards (a component each) that can be reordered by
4
- drag or keyboard.
3
+ The Editor's inspector: a column of flat collapsible sections divided by hairlines, a component each
4
+ (`cards` in the API). A section opens and closes by its header row, and the sections can be
5
+ reordered by drag or keyboard.
5
6
 
6
7
  Each card's header is a button that opens and closes it. On a header, the up and down arrows move
7
8
  the focus to the card above or below, Home and End to the first and the last, and Shift+up and
@@ -234,11 +235,7 @@ app that asks first (a confirmation dialog) gives the focus back itself once it
234
235
  }
235
236
  </script>
236
237
 
237
- <div
238
- {@attach panelDrop}
239
- data-slot="inspector-panel"
240
- class={cn('flex flex-col gap-1 text-sm', className)}
241
- >
238
+ <div {@attach panelDrop} data-slot="inspector-panel" class={cn('flex flex-col text-sm', className)}>
242
239
  {#each cards as card, i (card.id)}
243
240
  {@const isExpanded = expandedIds.includes(card.id)}
244
241
 
@@ -246,27 +243,29 @@ app that asks first (a confirmation dialog) gives the focus back itself once it
246
243
  {@attach cardDrop(card)}
247
244
  data-slot="inspector-panel-card"
248
245
  class={cn(
249
- 'relative flex flex-col rounded-md border border-border transition-opacity duration-150',
246
+ 'relative flex flex-col border-b border-border transition-opacity duration-150',
250
247
  draggingId === card.id && 'opacity-30'
251
248
  )}
252
249
  >
253
250
  {#if dropTarget?.id === card.id}
254
251
  <div
255
252
  class={[
256
- 'pointer-events-none absolute inset-x-1 h-px rounded-full bg-primary',
257
- dropTarget.edge === 'top' ? '-top-0.75' : '-bottom-0.75'
253
+ 'pointer-events-none absolute inset-x-0 z-1 h-0.5 bg-primary',
254
+ dropTarget.edge === 'top' ? 'top-0' : 'bottom-0'
258
255
  ]}
256
+ data-slot="inspector-panel-drop-line"
257
+ data-edge={dropTarget.edge}
259
258
  aria-hidden="true"
260
259
  ></div>
261
260
  {/if}
262
- <div class="flex items-center rounded-sm pr-2 transition-colors hover:bg-hover/50">
261
+ <div class="flex items-center pr-2 transition-colors hover:bg-hover/50">
263
262
  <button
264
263
  type="button"
265
264
  id={headerId(card.id)}
266
265
  aria-expanded={isExpanded}
267
266
  aria-controls={bodyId(card.id)}
268
267
  aria-keyshortcuts="Shift+ArrowUp Shift+ArrowDown"
269
- class="flex min-w-0 flex-1 cursor-default items-center gap-1.5 rounded-sm px-2 py-1.5 text-left"
268
+ class="flex min-w-0 flex-1 cursor-default items-center gap-1.5 px-2 py-1.5 text-left"
270
269
  onclick={() => toggleExpanded(card.id)}
271
270
  onkeydown={(event) => handleHeaderKeydown(event, i)}
272
271
  >
@@ -314,7 +313,7 @@ app that asks first (a confirmation dialog) gives the focus back itself once it
314
313
  inert={!isExpanded}
315
314
  >
316
315
  <div class="overflow-hidden">
317
- <div class="border-t border-border px-3 py-2.5">
316
+ <div class="px-3 pt-0.5 pb-2.5">
318
317
  {#if content}
319
318
  {@render content(card)}
320
319
  {/if}
@@ -37,8 +37,9 @@ type $$ComponentProps = {
37
37
  onExpandedChange?: (expandedIds: string[]) => void;
38
38
  } & RemoveProps;
39
39
  /**
40
- * The Editor's inspector: a column of collapsible cards (a component each) that can be reordered by
41
- * drag or keyboard.
40
+ * The Editor's inspector: a column of flat collapsible sections divided by hairlines, a component each
41
+ * (`cards` in the API). A section opens and closes by its header row, and the sections can be
42
+ * reordered by drag or keyboard.
42
43
  *
43
44
  * Each card's header is a button that opens and closes it. On a header, the up and down arrows move
44
45
  * the focus to the card above or below, Home and End to the first and the last, and Shift+up and
@@ -24,11 +24,11 @@
24
24
  /* Secondary text: body copy next to primary text. */
25
25
  --fg-2: oklch(0.86 0.02 255);
26
26
  /* Labels, metadata and placeholder text. */
27
- --muted: oklch(0.68 0.045 261);
28
- /* Decorative and disabled text, overline labels. */
29
- --faint: oklch(0.52 0.045 263);
27
+ --muted: oklch(0.685 0.045 261);
28
+ /* The quietest text: hints, counts and disabled text, still 4.5:1 on every surface; never on a tint. */
29
+ --faint: oklch(0.635 0.045 263);
30
30
  /* The one main action, links, selection and focus. */
31
- --primary: oklch(0.663 0.178 263.8);
31
+ --primary: oklch(0.672 0.172 263.8);
32
32
  /* A hovered primary action. */
33
33
  --primary-hover: oklch(0.76 0.122 264);
34
34
  /* Text and icons on a primary fill. */
@@ -38,7 +38,7 @@
38
38
  /* Borders of tinted primary elements. */
39
39
  --primary-border: oklch(0.663 0.178 263.8 / 0.45);
40
40
  /* Errors and destructive actions. */
41
- --danger: oklch(0.672 0.208 25.6);
41
+ --danger: oklch(0.679 0.208 25.6);
42
42
  /* Tinted danger fills. */
43
43
  --danger-subtle: oklch(0.672 0.208 25.6 / 0.13);
44
44
  /* Borders of tinted danger elements. */
@@ -70,7 +70,7 @@
70
70
  /* Borders of tinted accent elements. */
71
71
  --accent-border: oklch(0.7 0.16 300 / 0.35);
72
72
  /* The Server mode's colour in the Editor. */
73
- --server: oklch(0.663 0.178 263.8);
73
+ --server: oklch(0.672 0.172 263.8);
74
74
  /* The Local mode's colour in the Editor. */
75
75
  --local: oklch(0.72 0.15 162.5);
76
76
  /* The dimmed backdrop behind modal overlays. */
@@ -79,9 +79,9 @@
79
79
  --paper: oklch(1 0 0);
80
80
  /* Text and icons drawn over game art, in both themes. */
81
81
  --on-art: oklch(1 0 0);
82
- /* Translucent pills drawn over game art, in both themes. */
82
+ /* Translucent labels and buttons drawn over game art, in both themes. */
83
83
  --art-scrim: oklch(0.15 0.02 268 / 0.72);
84
- /* A hovered translucent pill over game art, in both themes. */
84
+ /* A hovered translucent button over game art, in both themes. */
85
85
  --art-scrim-hover: oklch(0.15 0.02 268 / 0.86);
86
86
  /* Avatar fallback tone 1. */
87
87
  --avatar-1: oklch(0.56 0.17 264);
@@ -108,7 +108,7 @@
108
108
  /* Code: type names. */
109
109
  --code-type: oklch(0.82 0.1 190);
110
110
  /* Code: comments. */
111
- --code-comment: oklch(0.6 0.04 262);
111
+ --code-comment: oklch(0.642 0.04 262);
112
112
  /* Code: attributes and properties. */
113
113
  --code-attribute: oklch(0.82 0.08 25);
114
114
  --elevation-sm: 0 1px 2px oklch(0 0 0 / 0.3);
@@ -140,11 +140,11 @@
140
140
  /* Secondary text: body copy next to primary text. */
141
141
  --fg-2: oklch(0.33 0.045 265);
142
142
  /* Labels, metadata and placeholder text. */
143
- --muted: oklch(0.5 0.041 259);
144
- /* Decorative and disabled text, overline labels. */
145
- --faint: oklch(0.64 0.035 260);
143
+ --muted: oklch(0.498 0.041 259);
144
+ /* The quietest text: hints, counts and disabled text, still 4.5:1 on every surface; never on a tint. */
145
+ --faint: oklch(0.529 0.035 260);
146
146
  /* The one main action, links, selection and focus. */
147
- --primary: oklch(0.533 0.219 264);
147
+ --primary: oklch(0.503 0.219 264);
148
148
  /* A hovered primary action. */
149
149
  --primary-hover: oklch(0.488 0.217 264.4);
150
150
  /* Text and icons on a primary fill. */
@@ -154,7 +154,7 @@
154
154
  /* Borders of tinted primary elements. */
155
155
  --primary-border: oklch(0.533 0.219 264 / 0.4);
156
156
  /* Errors and destructive actions. */
157
- --danger: oklch(0.541 0.207 25.3);
157
+ --danger: oklch(0.525 0.207 25.3);
158
158
  /* Tinted danger fills. */
159
159
  --danger-subtle: oklch(0.541 0.207 25.3 / 0.08);
160
160
  /* Borders of tinted danger elements. */
@@ -162,7 +162,7 @@
162
162
  /* Text and icons on a danger fill. */
163
163
  --on-danger: oklch(1 0 0);
164
164
  /* Success, running and online states. */
165
- --success: oklch(0.506 0.109 162.6);
165
+ --success: oklch(0.477 0.103 162.6);
166
166
  /* Tinted success fills. */
167
167
  --success-subtle: oklch(0.506 0.109 162.6 / 0.1);
168
168
  /* Borders of tinted success elements. */
@@ -174,7 +174,7 @@
174
174
  /* Borders of tinted warning elements. */
175
175
  --warning-border: oklch(0.51 0.104 84 / 0.45);
176
176
  /* Neutral information: banners, console info lines. */
177
- --info: oklch(0.52 0.13 245);
177
+ --info: oklch(0.499 0.125 245);
178
178
  /* Tinted info fills. */
179
179
  --info-subtle: oklch(0.52 0.13 245 / 0.09);
180
180
  /* Borders of tinted info elements. */
@@ -186,18 +186,18 @@
186
186
  /* Borders of tinted accent elements. */
187
187
  --accent-border: oklch(0.52 0.19 300 / 0.35);
188
188
  /* The Server mode's colour in the Editor. */
189
- --server: oklch(0.533 0.219 264);
189
+ --server: oklch(0.503 0.219 264);
190
190
  /* The Local mode's colour in the Editor. */
191
- --local: oklch(0.506 0.109 162.6);
191
+ --local: oklch(0.477 0.103 162.6);
192
192
  /* The dimmed backdrop behind modal overlays. */
193
193
  --scrim: oklch(0.2 0.04 266 / 0.4);
194
194
  /* Always white: switch and slider thumbs, QR code backgrounds. */
195
195
  --paper: oklch(1 0 0);
196
196
  /* Text and icons drawn over game art, in both themes. */
197
197
  --on-art: oklch(1 0 0);
198
- /* Translucent pills drawn over game art, in both themes. */
198
+ /* Translucent labels and buttons drawn over game art, in both themes. */
199
199
  --art-scrim: oklch(0.15 0.02 268 / 0.72);
200
- /* A hovered translucent pill over game art, in both themes. */
200
+ /* A hovered translucent button over game art, in both themes. */
201
201
  --art-scrim-hover: oklch(0.15 0.02 268 / 0.86);
202
202
  /* Avatar fallback tone 1. */
203
203
  --avatar-1: oklch(0.56 0.17 264);
@@ -220,11 +220,11 @@
220
220
  /* Code: strings. */
221
221
  --code-string: oklch(0.5 0.13 150);
222
222
  /* Code: numbers. */
223
- --code-number: oklch(0.55 0.136 55);
223
+ --code-number: oklch(0.526 0.13 55);
224
224
  /* Code: type names. */
225
225
  --code-type: oklch(0.5 0.085 200);
226
226
  /* Code: comments. */
227
- --code-comment: oklch(0.58 0.03 262);
227
+ --code-comment: oklch(0.515 0.03 262);
228
228
  /* Code: attributes and properties. */
229
229
  --code-attribute: oklch(0.5 0.15 25);
230
230
  --elevation-sm: 0 1px 2px oklch(0.3 0.05 265 / 0.08);
@@ -21,14 +21,14 @@ export const tokenValues = {
21
21
  'border-strong': { oklch: 'oklch(0.34 0.055 266)', hex: '#2a3755' },
22
22
  'fg': { oklch: 'oklch(0.968 0.007 248)', hex: '#f1f5f9' },
23
23
  'fg-2': { oklch: 'oklch(0.86 0.02 255)', hex: '#c8d2de' },
24
- 'muted': { oklch: 'oklch(0.68 0.045 261)', hex: '#8999b5' },
25
- 'faint': { oklch: 'oklch(0.52 0.045 263)', hex: '#5b6983' },
26
- 'primary': { oklch: 'oklch(0.663 0.178 263.8)', hex: '#598dff' },
24
+ 'muted': { oklch: 'oklch(0.685 0.045 261)', hex: '#8a9bb6' },
25
+ 'faint': { oklch: 'oklch(0.635 0.045 263)', hex: '#7c8ba7' },
26
+ 'primary': { oklch: 'oklch(0.672 0.172 263.8)', hex: '#5e90fe' },
27
27
  'primary-hover': { oklch: 'oklch(0.76 0.122 264)', hex: '#89b0ff' },
28
28
  'on-primary': { oklch: 'oklch(0.17 0.02 265)', hex: '#0b0f18' },
29
29
  'primary-subtle': { oklch: 'oklch(0.663 0.178 263.8 / 0.13)', hex: '#598dff21' },
30
30
  'primary-border': { oklch: 'oklch(0.663 0.178 263.8 / 0.45)', hex: '#598dff73' },
31
- 'danger': { oklch: 'oklch(0.672 0.208 25.6)', hex: '#fc514e' },
31
+ 'danger': { oklch: 'oklch(0.679 0.208 25.6)', hex: '#ff5350' },
32
32
  'danger-subtle': { oklch: 'oklch(0.672 0.208 25.6 / 0.13)', hex: '#fc514e21' },
33
33
  'danger-border': { oklch: 'oklch(0.672 0.208 25.6 / 0.45)', hex: '#fc514e73' },
34
34
  'on-danger': { oklch: 'oklch(0.18 0.03 25)', hex: '#1d0c0b' },
@@ -44,7 +44,7 @@ export const tokenValues = {
44
44
  'accent': { oklch: 'oklch(0.7 0.16 300)', hex: '#ae84f2' },
45
45
  'accent-subtle': { oklch: 'oklch(0.7 0.16 300 / 0.13)', hex: '#ae84f221' },
46
46
  'accent-border': { oklch: 'oklch(0.7 0.16 300 / 0.35)', hex: '#ae84f259' },
47
- 'server': { oklch: 'oklch(0.663 0.178 263.8)', hex: '#598dff' },
47
+ 'server': { oklch: 'oklch(0.672 0.172 263.8)', hex: '#5e90fe' },
48
48
  'local': { oklch: 'oklch(0.72 0.15 162.5)', hex: '#21c188' },
49
49
  'scrim': { oklch: 'oklch(0.12 0.02 268 / 0.62)', hex: '#04050d9e' },
50
50
  'paper': { oklch: 'oklch(1 0 0)', hex: '#ffffff' },
@@ -63,7 +63,7 @@ export const tokenValues = {
63
63
  'code-string': { oklch: 'oklch(0.8 0.13 150)', hex: '#7cd591' },
64
64
  'code-number': { oklch: 'oklch(0.8 0.13 65)', hex: '#f7ab5d' },
65
65
  'code-type': { oklch: 'oklch(0.82 0.1 190)', hex: '#6ed9d2' },
66
- 'code-comment': { oklch: 'oklch(0.6 0.04 262)', hex: '#738199' },
66
+ 'code-comment': { oklch: 'oklch(0.642 0.04 262)', hex: '#808da6' },
67
67
  'code-attribute': { oklch: 'oklch(0.82 0.08 25)', hex: '#f4b0aa' }
68
68
  },
69
69
  light: {
@@ -77,31 +77,31 @@ export const tokenValues = {
77
77
  'border-strong': { oklch: 'oklch(0.83 0.024 259)', hex: '#bec8d7' },
78
78
  'fg': { oklch: 'oklch(0.208 0.04 265.8)', hex: '#0f172a' },
79
79
  'fg-2': { oklch: 'oklch(0.33 0.045 265)', hex: '#2a354d' },
80
- 'muted': { oklch: 'oklch(0.5 0.041 259)', hex: '#55647b' },
81
- 'faint': { oklch: 'oklch(0.64 0.035 260)', hex: '#808da2' },
82
- 'primary': { oklch: 'oklch(0.533 0.219 264)', hex: '#265de9' },
80
+ 'muted': { oklch: 'oklch(0.498 0.041 259)', hex: '#55647a' },
81
+ 'faint': { oklch: 'oklch(0.529 0.035 260)', hex: '#606c80' },
82
+ 'primary': { oklch: 'oklch(0.503 0.219 264)', hex: '#1e53de' },
83
83
  'primary-hover': { oklch: 'oklch(0.488 0.217 264.4)', hex: '#1d4ed8' },
84
84
  'on-primary': { oklch: 'oklch(1 0 0)', hex: '#ffffff' },
85
85
  'primary-subtle': { oklch: 'oklch(0.533 0.219 264 / 0.09)', hex: '#265de917' },
86
86
  'primary-border': { oklch: 'oklch(0.533 0.219 264 / 0.4)', hex: '#265de966' },
87
- 'danger': { oklch: 'oklch(0.541 0.207 25.3)', hex: '#cc1a27' },
87
+ 'danger': { oklch: 'oklch(0.525 0.207 25.3)', hex: '#c60f22' },
88
88
  'danger-subtle': { oklch: 'oklch(0.541 0.207 25.3 / 0.08)', hex: '#cc1a2714' },
89
89
  'danger-border': { oklch: 'oklch(0.541 0.207 25.3 / 0.4)', hex: '#cc1a2766' },
90
90
  'on-danger': { oklch: 'oklch(1 0 0)', hex: '#ffffff' },
91
- 'success': { oklch: 'oklch(0.506 0.109 162.6)', hex: '#047852' },
91
+ 'success': { oklch: 'oklch(0.477 0.103 162.6)', hex: '#026e4b' },
92
92
  'success-subtle': { oklch: 'oklch(0.506 0.109 162.6 / 0.1)', hex: '#0478521a' },
93
93
  'success-border': { oklch: 'oklch(0.506 0.109 162.6 / 0.4)', hex: '#04785266' },
94
94
  'warning': { oklch: 'oklch(0.51 0.104 84)', hex: '#826002' },
95
95
  'warning-subtle': { oklch: 'oklch(0.84 0.17 84 / 0.2)', hex: '#febf1233' },
96
96
  'warning-border': { oklch: 'oklch(0.51 0.104 84 / 0.45)', hex: '#82600273' },
97
- 'info': { oklch: 'oklch(0.52 0.13 245)', hex: '#036eae' },
97
+ 'info': { oklch: 'oklch(0.499 0.125 245)', hex: '#0268a5' },
98
98
  'info-subtle': { oklch: 'oklch(0.52 0.13 245 / 0.09)', hex: '#036eae17' },
99
99
  'info-border': { oklch: 'oklch(0.52 0.13 245 / 0.4)', hex: '#036eae66' },
100
100
  'accent': { oklch: 'oklch(0.52 0.19 300)', hex: '#7c44c3' },
101
101
  'accent-subtle': { oklch: 'oklch(0.52 0.19 300 / 0.08)', hex: '#7c44c314' },
102
102
  'accent-border': { oklch: 'oklch(0.52 0.19 300 / 0.35)', hex: '#7c44c359' },
103
- 'server': { oklch: 'oklch(0.533 0.219 264)', hex: '#265de9' },
104
- 'local': { oklch: 'oklch(0.506 0.109 162.6)', hex: '#047852' },
103
+ 'server': { oklch: 'oklch(0.503 0.219 264)', hex: '#1e53de' },
104
+ 'local': { oklch: 'oklch(0.477 0.103 162.6)', hex: '#026e4b' },
105
105
  'scrim': { oklch: 'oklch(0.2 0.04 266 / 0.4)', hex: '#0d152866' },
106
106
  'paper': { oklch: 'oklch(1 0 0)', hex: '#ffffff' },
107
107
  'on-art': { oklch: 'oklch(1 0 0)', hex: '#ffffff' },
@@ -117,9 +117,9 @@ export const tokenValues = {
117
117
  'code-keyword': { oklch: 'oklch(0.5 0.2 300)', hex: '#773ac1' },
118
118
  'code-function': { oklch: 'oklch(0.48 0.12 245)', hex: '#02629c' },
119
119
  'code-string': { oklch: 'oklch(0.5 0.13 150)', hex: '#137738' },
120
- 'code-number': { oklch: 'oklch(0.55 0.136 55)', hex: '#ac5701' },
120
+ 'code-number': { oklch: 'oklch(0.526 0.13 55)', hex: '#a25201' },
121
121
  'code-type': { oklch: 'oklch(0.5 0.085 200)', hex: '#007176' },
122
- 'code-comment': { oklch: 'oklch(0.58 0.03 262)', hex: '#717b8d' },
122
+ 'code-comment': { oklch: 'oklch(0.515 0.03 262)', hex: '#5e6879' },
123
123
  'code-attribute': { oklch: 'oklch(0.5 0.15 25)', hex: '#a83634' }
124
124
  }
125
125
  };
@@ -48,8 +48,6 @@
48
48
  --text-display-lg--line-height: 1.02;
49
49
  --text-display-lg--letter-spacing: -0.025em;
50
50
 
51
- --tracking-overline: 0.09em;
52
-
53
51
  --radius-xs: 0.125rem;
54
52
  --radius-sm: 0.25rem;
55
53
  --radius-md: 0.375rem;
package/dist/utils.js CHANGED
@@ -8,8 +8,8 @@ import { clsx } from 'clsx';
8
8
  import { extendTailwindMerge, validators } from 'tailwind-merge';
9
9
  // Theme values tailwind-merge can't recognise on its own: without them, `text-display` would
10
10
  // count as a text colour and replace `text-fg`, `h-control-md` wouldn't yield to `h-8`, and a
11
- // caller's `animate-zoom-in` wouldn't replace a component's `animate-fade-in`. Every `animate-*`,
12
- // `ease-*` and `tracking-*` class sets one property only, so any name of the theme is one of them.
11
+ // caller's `animate-zoom-in` wouldn't replace a component's `animate-fade-in`. Every `animate-*`
12
+ // and `ease-*` class sets one property only, so any name of the theme is one of them.
13
13
  const twMerge = extendTailwindMerge({
14
14
  extend: {
15
15
  theme: {
@@ -17,8 +17,7 @@ const twMerge = extendTailwindMerge({
17
17
  'inset-shadow': ['highlight'],
18
18
  spacing: ['control-xs', 'control-sm', 'control-md', 'control-lg'],
19
19
  animate: [validators.isAny],
20
- ease: [validators.isAny],
21
- tracking: [validators.isAny]
20
+ ease: [validators.isAny]
22
21
  }
23
22
  }
24
23
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "horizon-design",
3
- "version": "2.0.1",
3
+ "version": "2.1.0",
4
4
  "keywords": [
5
5
  "svelte"
6
6
  ],