Skip to content

1.13.0

Choose a tag to compare

@github-actions github-actions released this 29 Sep 01:48
· 848 commits to main since this release

Where the bytes went

What you import 1.12.0 1.13.0
Button 5.1 kB 5.2 kB
Chip 3.3 kB 3.4 kB
LineChart 11.6 kB 11.8 kB
CodeBlock 5.0 kB 5.1 kB
Image 6.5 kB 7.1 kB
Gallery 10.2 kB 10.4 kB
a whole page shell 29.0 kB 29.2 kB
12 components — a typical app 70.5 kB 71.0 kB
12 components, with Korean 72.9 kB 73.8 kB
25 components — a large one 115.7 kB 116.9 kB
all exports 263.9 kB 265.8 kB

Image is the row that moved. A picture that failed with an empty alt printed a hardcoded English sentence, so Image now reaches internal/i18n.ts and internal/defaults.ts, which costs it 0.5 kB. The last 0.1 kB is width and height, which Gallery also carries because it draws an Image.

The 0.1 kB on Chip, CodeBlock, LineChart and the page shell is the same machinery gaining an Object.hasOwn on each of its two lookups, and a shared bound under the memos in internal/.

The twelve- and twenty-five-component rows carry internal/wheel.ts on top of that, which is what a Tabs bar now takes the wheel with.

The last 0.1 kB on nearly every row is the focus ring: the resting declaration and the transition it travels on are two more entries in the class string every control carries. neba/styles.css moved 22.4 kB → 22.5 kB for the same reason, plus the breakpoint slots each responsive element now clears — which is the cost of a fix that could not be made anywhere else, since only the element that reads a slot can say it does not inherit one.

Registering a language ships that language's whole module, so the twenty picker strings and the two a Carousel's stop button needs land in it whether or not the page draws either: 2.8 kB now against 2.4 kB before. Those twenty used to be hardcoded English, which a Korean product could not reach at all.

Added

  • Every portalled surface reads one z-index, --neba-z-portal. Fourteen of them carried a hardcoded z-50, which is a guess about a page the library cannot see — a site whose own fixed header sits above that had its menus and dialogs opening underneath its chrome, and the way out was a selector per surface. The token defaults to 50, and a host that needs another number sets it once on :root.

  • A BottomNavigationItem declares the target and rel its link already rendered. The props were typed against a <button> and cast to an <a>, so a destination that opened in a new tab could only be written by handing the component something TypeScript said was impossible.

  • A ProgressLinear, a ProgressCircular and a Meter take a thickness. The ladder decides the bar's height and the ring's stroke, and the ladder is five steps — so a speed-test dial or a page that is about one number had no way to draw a heavier line without moving the diameter with it. It is a number of pixels on all three, because that is what the ring's arithmetic already works in. A ring's stroke is held inside the ring it describes: past half the radius there is no hole left in the middle of it.

  • A Combobox takes a filter, and false turns it off. The list was always narrowed here, against each option's visible label — so a search answered by a server, which is the case a combobox with hundreds of options exists for, had its results filtered a second time and lost every row that had matched on a keyword, a description or a synonym rather than on the label. filter={false} lets a narrowed list through; a function decides per option. The row that offers to add what was typed is exempt from both, since it is the query written out.

  • A Slider draws marks, and takes classNames for the parts behind its root. Labelling points on a track — 1 / 100 / 250 / 500 under a count, "realistic" and "abstract" at the ends of a style axis — was a row a caller had to lay out themselves, absolutely positioned at (value − min) / (max − min) of a width they had to know. An array of { value, label? } does it, and a bare marks is a tick at every step. The row sits beside the control rather than on the rail, because a tick on the rail has to stay legible over both the fill and the groove, and it is aria-hidden: the thumb already announces the value and the range.

    The slots are the other half of the same complaint. A Slider draws seven parts and offered a class name for exactly one of them, so a one-off recolour had to reach for [role="slider"]. label, control, track, indicator, thumb, description and mark are named now, like every other multi-part component in the library.

  • A SelectOption can name a group, and a run of them gets a heading. A list of time zones by region or fonts by family had nowhere to put the heading, and the stand-in was a disabled option holding a <strong> — which the keyboard and the pointer skip correctly and a screen reader still reads as an option that cannot be chosen. A group is a run of adjacent options naming it, so the array's order stays the list's order and nothing is moved out from under a caller; two runs of one name draw two headings, which is the array saying they are not together.

  • A Tabs bar takes the wheel. A bar with more tabs than room scrolls, but a mouse has one wheel and it points down the page — and the bar draws no scroll buttons and hides its scrollbar, so the tabs past the edge were reachable only by keyboard. A wheel rolled over the bar now travels along it. It is on by default, which is what separates the prop from ScrollZone's wheel: that strip has a pair of buttons and this one has nothing. A bar that fits takes nothing at all, so a page with three tabs on it is unaffected, and wheel={false} turns it off.

  • A Carousel with autoPlay draws the button that stops it. It paused on hover, on focus and in a background tab, and it never started for a reader who had asked for less motion — but a reader holding a phone hovers nothing, and one running a magnifier may never put a pointer over the strip at all. WCAG 2.2.2 asks for a mechanism, and those were not one. The control sits in the row under the frame, beside the dots and never over a slide; pauseLabel and playLabel name it, and it is translated in all nineteen languages. There is no prop to take it away — a caller who wants a control of their own can drive value and leave autoPlay off.

  • The four date and time pickers say their twenty non-date strings in the reader's language. "Previous month", "Choose a year", "Today", "Now", "Hour", "AM/PM" and fourteen more were hardcoded English, over dates Intl had already translated — so a Korean product's only way out was to write out all twenty through labels. There is a picker message namespace now, in all nineteen languages. labels still wins where it is given, which is what it is for: locale answers the language and labels answers the wording.

  • An Image takes width and height, and reserves the box they describe. They were omitted from the props, so the one component in the library whose reason to exist is holding a picture's space could only be told what that space was as a ratio worked out by hand — and a default Image reserved nothing at all, which is the largest source of layout shift on most sites. They reach the <img> as the attributes they are, and giving both turns an 'auto' ratio into their proportion. An explicit ratio still outranks them: that one is the layout's shape and these two are the picture's.

Changed

  • A focus ring arrives rather than appears, and on a field it is flush with the edge. Two things about the same object. The ring is declared at rest with no width instead of not being declared at all, so the focus has a width to travel rather than a style to switch — it grows in beside the hairline it belongs to, at the house duration, and instantly for a reader who has asked for less motion. And a field's shell takes it flush: the hairline turns the ring's own colour the moment the focus lands, so a ring held two pixels off drew a second line with a stripe of page between the two, which is a control wearing a halo rather than an edge that has thickened. Everywhere else the ring keeps its offset, and that is contrast rather than taste — flush against a filled control it would sit on a fill of its own family.

    A pointer resting on a focused field used to take the hairline a shade under the ring it is now flush against, because hover: and focus-within: are one class each and the winner was whichever Tailwind generated last. The pair is spelled out, so the edge is one colour.

    The six field shells also stop holding every duration at 0ms while the focus is inside. That was the rule about a press applied one step too far: clicking into a field is a press, but the ring is the answer to the caret being somewhere, and it arrives from a Tab as often as from a click.

  • An AccordionItem's title wraps, and the header is a heading at a level the caller chooses. Two things about the same element. The title was wrapped in truncate, which is right for a label and wrong for the thing an accordion is most often a list of: an FAQ's title is a sentence, and an ellipsis in the middle of it loses the question. It wraps now, and lines clamps it where a caller wants one — the same word, and now the same table, Typography uses. And the header renders an <h3> whatever sits above it, so the natural way to ask for a different one was to pass a styled heading as the title, which nests a heading inside a heading; the documentation said to do exactly that. headingLevel on the Accordion sets it for the whole stack, which is where it belongs — the sections are siblings, and a run of headings at different levels is an outline that lies.

  • A field's height is a floor rather than a fixed row. A TextField, a Select, a Combobox, a NumberField and the four date and time pickers all took the size ladder as an exact height, and a field holds a caller's own text — so text set larger than the step, which is the whole point of the tool that does it, had its glyphs cut off by the row around it. classNames.shell could repair it only with an h-auto!, and needing !important to beat your own class is the signal that the height was the wrong shape rather than the wrong number. Nothing moves at the library's own sizes. It stays an exact height on a Button, a Chip and everything else the library draws the contents of: those are flex children of a row a caller arranges, and a minimum height there is a control that stretches to whatever is beside it.

  • A Typography level's leading is a ratio rather than a length, and the root carries neba-typography. The two halves of one problem: the scale paired each size with the line height it worked out to, and the component emitted nothing but utilities. So a caller who set a size of their own — which is what a figure, a display number or a hero line is — got a line box built for a size nobody asked for, with no selector to repair it from a stylesheet either, since a utility string is not a contract. Every level keeps exactly the ratio it was drawn at, so nothing moves at the scale's own sizes and an overridden one gets a line box in proportion. The class is a hook and carries no styling of its own, the way neba-link and neba-portal do.

  • A ScrollZone and a Tabs bar hold the wheel at their ends rather than handing it back. Taking the wheel and then giving it up the moment the strip runs out is what makes the page lurch mid-flick: the reader is still pushing the strip and what answers is the article behind it. Both hold it now, and the pointer leaving the strip is what gives the page its wheel back. overscroll-behavior: contain does the same for the gestures the browser scrolls itself — a finger, a sideways trackpad swipe, and the wheel over a vertical zone — which used to carry on into the page at either end.

    This changes what ScrollZone's wheel promises. The old wording said a strip with nothing left ahead of it was something to scroll past rather than something to be caught in; a caller who wanted that behaviour wants wheel off.

  • An Anchor finds its headings once instead of on every frame of a scroll. It ran a document.getElementById for each row of the trail on every scroll frame, for an answer that changes only when the document does. The elements are kept and checked against isConnected, so a heading that arrives after the trail is still found.

  • An AnimateMarquee measures itself when its size changes, not on every render above it. The measurement listed children as a dependency, so every render of whatever held the strip tore both resize observers down, put them back, and ran a getComputedStyle and an offsetWidth — a forced layout — for a strip that had not moved. The track is observed, so a change in what is on it is already reported.

  • The last two Intl objects a render was rebuilding are memoised. localeWeekStart built an Intl.DateTimeFormat and an Intl.Locale on every render of a Calendar, a DatePicker, a DateRangePicker and a DateTimePicker — every keystroke and every hover anywhere inside one — and graphemesOf / wordsOf built an Intl.Segmenter on every call, for three text effects that ask on every frame they animate. Both go through a cache now, as the number and date formatters already did.

  • A Transfer and a TreeSelect fold their labels once instead of once per keystroke. Both folded every row inside the filter, which put a String.prototype.normalize on every item for every character typed — a Transfer did it on every render, search or no search. The haystacks are built once per items now, which is the arrangement a DataTable and a CommandPalette already used. Nothing about what matches has changed.

  • A chart's data table is memoised, and reads the chart's own formatter. The visually hidden table is built in the same render the crosshair's state lives in, so every cell of it was reconciled again for each pixel the pointer travelled across the picture — a row per point on a ScatterChart. It is React.memo now, and the frame's format is keyed on what the options say rather than on the identity of the object they arrived in, so a format written inline in the JSX no longer defeats it.

    One number moves with it: a ScatterChart with no format writes its table values the way its axis and its tooltip already write them, so 24000 reads as 24K rather than 24,000. It was the only chart whose table disagreed with its own picture.

Fixed

  • A responsive slot no longer inherits into a nested component. Every value that changes at a breakpoint resolves through a custom property, one per breakpoint, and only the breakpoints a caller names are written — so a slot an element did not write was whatever the nearest ancestor had written. A GridContainer inside a Grid read the item's --n-span-md and came out a fraction of the width it had asked for, and the same shape covered every gutter, column count, flex direction and content measure in the library. The element that reads a slot now clears it, which an inline style still outranks.

  • A NavigationMenu's panel keeps its surface. The colour slots were declared on the Root, and the panel is portalled to the end of the document — so it was not a descendant of the element carrying them, bg-(--n-panel-press) painted nothing, and the panel opened as clear glass with the page readable straight through the links. Both ends of the component take the slots now, which is what every other portalling component in the library already did.

  • Dragging a run of rows in a DataTable no longer selects the text it crosses. It was the last drag in the library written by hand, and it had the hole the column resize used to have: no text-selection suppression, over every cell the pointer passed rather than the two beside a boundary. It goes through beginPointerDrag now — captured to the table rather than to the row that was pressed, since a virtual body unmounts a row the moment it scrolls away. The auto-scroll at the edge stays where it is.

  • A TreeSelect's clear button says "Clear" in every language no longer. It was named out of the pickers' English defaults — a set it has nothing else to do with — rather than out of the same action messages the identical × on a Combobox reads. It takes a clearLabel like Combobox does, too.

  • A pointer drag starts even when the pointer cannot be captured. setPointerCapture throws for a pointer that is no longer active — one lifted between the pointerdown and the handler — and the exception escaped into React's event handler, which takes the page down. Capture is an optimisation and the three listeners work without it, so it is taken where it can be and skipped where it cannot.

  • An AnimateScramble redraws on its own tick and not on every render above it. The noise glyphs were picked with Math.random() during the render, so any re-render from anywhere in the tree reshuffled every unsettled letter at whatever moment it happened to land — an effect meant to be a clock, answering to the whole page. They are picked from the tick counter and the position now, which also settles the hydration mismatch the random source caused on a server-rendered page.

  • A CodeBlock's copy button keeps the focus when the clipboard falls back. On a page without a secure context the copy goes through execCommand against an off-screen textarea, and selecting that textarea took the focus — so a reader who pressed the button with a keyboard was left on <body>, having lost their place in the page as the reward for copying.

  • An Anchor, an Image and a Panes write their refs in an effect rather than during a render. A ref written while rendering is a ref that lies when React throws that render away, which is a live hazard under concurrent rendering and is the rule useShortcut had already written down. None of the three reads the value during a render, so nothing about their behaviour changes.

  • An Image says its own absence in the reader's language. A picture that failed with an empty alt printed a hardcoded Image unavailable, which was the one string the library invented and could not translate. There is an image message namespace now, in all eighteen languages, and Image takes a locale and an unavailableLabel like every other component that has to invent a word.

  • A message lookup reads a table's own keys and not its prototype's. A locale a caller took from a URL, or a {placeholder} a translation happened to name after a member of Object, resolved up the prototype chain — so locale="constructor" was spread over English as though it were a table of messages, and {constructor} in a translation wrote function Object() { [native code] } into the middle of a sentence.

  • An AppLogo and a BottomNavigationItem merge noopener noreferrer into a link that leaves this tab. safeRel reached four of the six components that let a target through to an <a>; these two handed the page they opened a window.opener pointing back at the one that opened it, and a Referer header naming it. A rel written by hand — nofollow, sponsored — is merged rather than replaced, as everywhere else.

  • colorSchemeScript escapes < in the values it writes. The string is inlined inside a <script> element, and a browser stops parsing that element at the first </script in it however the JavaScript around it is quoted — so a storageKey holding one would have ended the tag and handed the rest to the HTML parser as markup. Breadcrumb already wrote its structured data out this way.

  • The five memos in internal/ cannot grow without bound. The Intl formatters and segmenters, the MediaQueryLists, the week-start table and the resolved message tables are keyed on a locale, on the options behind a format prop, or on a query string handed to the public useMediaQuery — a caller's to choose in every case, and two of them carried a comment claiming otherwise. They share one ceiling now, well above anything the library itself reaches; a page that never approaches it is unchanged, and one that passes it rebuilds what it would have built anyway.

  • A shared IntersectionObserver is let go once nothing is watching through it. One is kept per threshold, and threshold is a public prop on all seventeen Animate* components — so a caller computing one left a live observer behind for every value it had ever held, each of them a registration the browser still walks on every scroll. A group now lives exactly as long as its last watcher.

  • An AnimateMarquee stops for the focus as well as for the pointer. pauseOnHover was :hover alone, so a link on a moving strip could be aimed at with a mouse and not reached with a keyboard — tabbing to it left it travelling off the screen while it was being read.


Every release is in the changelog on the docs site and in CHANGELOG.md at this tag.