github carbon-design-system/carbon-components-svelte v0.114.8

28 minutes ago

Highlights

  • InlineNotification has no outer margin, as in v11. The 0.114 conversion kept v10's 1rem above and below, which added to a container's gap.
  • A short multi-line CodeSnippet no longer ends in a blank line, and one with expanded no longer fires a ResizeObserver loop error.
  • SideNav no longer forces a layout on mount to scroll to its current item.

Bug Fixes

  • notification: drop InlineNotification's outer margin, as in v11 by @metonym in #5819
  • code-snippet: drop the room for the expand button without one by @metonym in #5788
  • code-snippet: stop a ResizeObserver loop error on short snippets by @metonym in #5792
  • prose: join a tab panel to its tabs by @metonym in #5785
  • search: focus from the shortcut without scrolling a field in view by @metonym in #5814
  • overflow-menu: drop link options' underline and fill a wider menu by @metonym in #5815
  • kbd: show a letter pressed alone in lowercase by @metonym in #5816

Performance

  • side-nav: scroll to the current item without forcing layout by @metonym in #5813

Documentation

  • layer: explain what contextual tokens mean inside a Layer by @metonym in #5818

InlineNotification

Carbon v11 leaves an inline notification's spacing to the layout that holds it. This release drops the 1rem margin above and below, as 0.114.0 did for Tag, so a notification in a Stack or a grid with gap gets only the gap. fullWidth no longer needs to reset it. A page that relied on the margin to space a notification from its neighbors loses 16px above and below; a container gap or a class puts it back.

<Stack gap={5}>
  <TextInput labelText="Project name" />
  <InlineNotification kind="warning" title="Deprecated:" subtitle="Use the v2 API." />
  <TextInput labelText="Owner" />
</Stack>

InlineNotification between two fields in a Stack

CodeSnippet

A multi-line snippet kept 24px under its code for the "Show more" button even when the code was too short for the button to show, so short code ended in what looked like a blank line. The room now follows the button, and CodeSnippetSkeleton matches.

A three-line CodeSnippet with even padding

A snippet with expanded whose code doesn't need expanding wrote false back to expanded while measuring, which browsers report as "ResizeObserver loop completed with undelivered notifications" on window. That showed up in Vite's overlay, in error trackers, and failed Cypress tests. The snippet now shows collapsed without touching expanded, so a bound value stays as you set it and no collapse event fires without a user action.

SideNav

SideNav read its list's layout in the microtask after mount to bring the current item into view, which forced a layout of the whole page before the browser's own, even for a closed nav. It now scrolls in the next frame, and a closed nav waits until it first opens. On a page of about 8,800 nodes with a closed nav, at 4x CPU throttling, load took 3 layouts and 175.5ms of layout instead of 4 and 236.5ms.

Prose

Tabs render their panels after the tab list, so Prose's flow margin pushed every TabContent 1rem down and a container panel no longer met its tab. Panels now join their tabs.

Container tabs inside Prose

Search, OverflowMenu and Kbd

  • A Search shortcut focuses a field that's already on screen without scrolling the page, which moved pages with a sticky toolbar inside their scroll-padding-top.
  • OverflowMenu link items (href) drop the browser's underline, and options fill a menu widened through menuOptionsClass.
  • A letter shortcut with no modifier shows as written, so shortcut="j" reads "j" rather than "J" (Shift+J). With a modifier it stays a capital, as in ⌘K.

OverflowMenu with a link option

Full Changelog: v0.114.7...v0.114.8

Don't miss a new carbon-components-svelte release

NewReleases is sending notifications on new releases.