Repository navigation
Releases
v1.1.0
The first minor after the 1.0 freeze: it closes the Fluent UI v9 gap backlog of docs/ROADMAP.md (§8.2, §8.5 and §8.6) that the freeze allowed, and adds nothing breaking. Every addition is optional and defaults to the 1.0 behaviour, with the few exceptions under "Upgrading from 1.0". What stays open, and why, is in the roadmap's §8.1a.
Upgrading from 1.0
Nothing needs to change. Three kinds of difference can show in code or markup that depends on exact details:
- Widened unions.
PresenceStatusgains'blocked'and'unknown',TimePickerInvalidReasongains'not-listed',SpinnerSizegains three sizes,ToastPositiongains'top'and'bottom',DismissReasonandModalOpenChangeReasongain'parent-closed'/'focus-outside', andToastControllerhas three more members (updateToast,pauseToast,playToast). An exhaustiveswitchover one of these unions, or code that implementsToastControlleritself, needs the new cases. - Markup.
MenuButtonalways rendersaria-expanded;RadioGroup.Itemrendersdata-label-positionandSliderrendersdata-orientation; a bareSkeletonis 16px tall;ToggleButtonas an anchor with anhrefand noroleno longer rendersaria-pressed; a popup with the default motion isdata-presence="exited"until it is placed; a Popover, Menu or other popup opened inside a Dialog or Drawer closes with it. Literal markup pins in your own tests may need a refresh. - Migration codemod.
chart-1tochart-5are names a stock shadcn/ui theme also defines, so the codemod now treats 22 names as shared (the 17 of 1.0 and these five).
Added
- Text takes Fluent's layout and decoration props:
wrap,truncate,italic,underline,strikethrough,alignandblock(closestext-1,text-2andtext-5). - Divider takes
appearance(default,subtle,strong,brand),insetandalignContent(start,center,end), withdata-appearance,data-insetand, on a labelled divider,data-align-content(closesdivider-1,divider-2anddivider-3).DividerAppearanceis a new exported type. - Badge takes the
ghostappearance (the color as text alone),shape(circular,rounded,square), thetinysize (a 6px dot with no content), and aniconslot withiconPosition(before,after), withdata-shapeanddata-sizeand the stable classwave-badge__icon(closesbadge-3,badge-4,badge-5andbadge-6).BadgeAppearancegains'ghost', andBadgeSize('tiny'andSize) is a new exported type. - CounterBadge takes the
ghostappearance,shapeandsize(extra-smalltoextra-large; adotstays 6px), withdata-shapeanddata-size(closescounterbadge-4). - PresenceBadge takes the statuses
blockedandunknown(each with a glyph of its own) and theoutOfOfficemodifier, which draws the out-of-office arrow in the status's color and names the badge ", out of office" (closespresence-1andpresence-2).PresenceStatusgains'blocked'and'unknown', so aswitchover it that has nodefaultneeds the two cases.presence-4is not changed: see the roadmap. - Buttons:
shape(rounded,circular,square; defaultrounded) on Button, ToggleButton, MenuButton, CompoundButton and SplitButton and the Toolbar buttons, withdata-shapewhile it is set (closesbuttons-1). ToggleButton and MenuButton are polymorphic (as), with the new typesToggleButtonOwnPropsandMenuButtonOwnProps(closesbuttons-11).CompoundButton'ssecondaryTexttakes a slot object and the newcontentContainerslot object re-elements the text column; both merge overslotProps(closesbuttons-7).SplitButtonmenuButtonLabel={null}names the menu half by the primary action througharia-labelledby(closesbuttons-14).Linktakesbackground(default,brand,inverted; new typeLinkBackground) withdata-background(closesbuttons-18). - Textarea takes
resize(none,vertical,horizontal,both; defaultvertical; typeTextareaResize) andonValueChange(value)(closesform-basic-13andform-basic-15). - Select takes
icon(a custom chevron drawn in awave-select__wrapperbeside the select;falsehides the chevron; new classeswave-select__wrapperandwave-select__icon) andonValueChange(value), which withmultiplegets the first selected value (closesform-basic-27andform-basic-28). - RadioGroup and
RadioGroup.ItemtakelabelPosition(after,below; typeRadioLabelPosition);orientation="horizontal"withlabelPosition="below"is Fluent'shorizontal-stacked(closesform-basic-20). - Slider takes
orientation="vertical"(closesform-basic-30). - TimePicker takes
showSeconds(valueHH:mm:ss),formatTime(value),parseTime(text)andfreeform(falselimits the selection to listed times and reports others as the new'not-listed'reason ofTimePickerInvalidReason, with the messagelabels.notListed), closingtimepicker-2,timepicker-4andtimepicker-5. AswitchoverTimePickerInvalidReasonthat has nodefaultneeds the new case. - Table and DataGrid take
size('medium','small'or'extra-small'; typeTableSize): it tightens the padding of cells, header cells, sort buttons and selection cells and sizes the media ofTable.CellLayout, rendered asdata-size(closestable-1).Table.Rowtakesappearance('none','brand'or'neutral'; typeTableRowAppearance), the fill of a selected DataGrid row for a row of your own state, rendered asdata-appearance(closestr-1). - DataGrid takes
focusMode('cell','row'or'none'; typeDataGridFocusMode; Fluent'srow_unstableis'row', its'composite'has no counterpart), anduseGridNavigationtakes the same option (GridNavigationFocusMode), rendered asdata-focus-mode(closesdg-4, except'composite').DataGrid.CellandDataGrid.HeaderCelltakefocusMode('cell','group'or'none'; typeDataGridCellFocusMode):'none'takes the cell and its widgets out of the arrow-key navigation,'group'makes the cell its own focus target (closesdgc-1). - Table takes
virtualWindowandTable.Bodytakescountwith a function child that returns the row at an index: only the rows in view render, between spacer rows (new classwave-table__spacer), witharia-rowcount,aria-rowindexanddata-row-index.GridNavigationModeltakes an optionalfooterRowCount. - Dialog:
Dialog.Content mountNode,titleAsandDialog.Title as(a heading level,divorspan; typeDialogTitleElement),Dialog.Footer position,startActions,fluidandstackOnNarrow, andlightDismisson a non-modal Dialog and Drawer (a press outside or focus leaving closes it, with the reasonsoutside-pressandfocus-outside) (closesdialog-6,dialogtitle-1,dialogactions-1,dialogactions-2). - Popover:
onOpenChange(open, details?)withreasonandevent(typesPopoverOpenChangeReason,PopoverOpenChangeDetails),withArrow,trapFocus,inline,closeOnScroll,appearance(neutral,brand,inverted),size, andPopover.Content role(closespopover-4,popover-5,popover-6,popoversurface-1,popoversurface-2,popoversurface-4). - Tooltip:
relationship="inaccessible",withArrowwithslotProps.beak,positioning.target, andasChild(no wrapper element) (closestooltip-2,tooltip-4,tooltip-5,tooltip-7;tooltip-6is covered byslotProps.content). TeachingPopover:appearanceandtrapFocus(closesteaching-2,teaching-4;teaching-3is covered bypositioning). - Menu:
onOpenChange(open, details?)reportsdetails.reasonand the DOMevent(typesMenuOpenChangeReason,MenuOpenChangeDetails),closeOnScroll,inlineandmountNode(both inherited by submenus), andidonMenu.Popover, which the trigger'saria-controlsfollows (closesmenu-4andmenu-5). Menu items takesubText(a second line that is part of the name;slotProps.subText),secondaryContentanddisabledFocusable(closesmenu-7,menu-8,menu-9). A touch or pen long press (600 ms) opens anopenOnContextmenu in browsers that fire nocontextmenu(iOS Safari). - Nav and NavDrawer take
density="small"(data-density),multiple={false}(one open category) anddetailsononValueChange,onItemSelectandonOpenCategoriesChange(typesNavDensity,NavSelectDetails,NavCategoryToggleDetails) (closesnav-1,nav-2,nav-4).useNavDrawerTogglewires a Hamburger outside a NavDrawer. chartSeriesand the tokens--wave-chart-1to--wave-chart-10(chart1tochart10,bg-wave-chart-N): ten categorical colors made for charts, 3:1 onbackgroundandcardand at least 7 apart (OKLab dE x100) for full color vision and under simulated protanopia, deuteranopia and tritanopia, tested as a set in light and dark; white in high contrast.chartPaletteis unchanged.motionon the listbox popups of Combobox, Dropdown, TagPicker and TimePicker (andListboxSurface), on the DatePicker calendar, and on AvatarGroup andAvatarGroup.Popover: these popups fade and slide like Popover (popupMotion), and the listbox stays in its popup while it exits.useVirtualWindowtakesmeasureItems: rows of different heights, withitemSizeas the estimate; rows are measured, and the scroll position is corrected when a measured size differs.VirtualWindow.itemProps?(index)and the typeVirtualItemPropsare new. List, Listbox, Combobox and Dropdown lay out from it; DataGrid and FlatTree keep fixed rows.virtualWindowon TimePicker and TagPicker (array form), with the classeswave-time-picker__spacerandwave-tag-picker__spacer. List...
v1.0.0
The first stable release and the API freeze: Phase 14 of the roadmap. From 1.0.0 on, semantic versioning covers the exports of the package entry, the documented props and their data-* state attributes, the stable wave-* classes of the class-name registry, the --wave-* tokens, the namespaced theme keys and the CSS entries of the exports map; Wave's own wave: utility classes and the modules the entry does not export are internal. 1.0 ends the 0.x compromises at once. It makes every change 0.18 announced: everything 0.x deprecated is removed (P14-02), Image.alt is required (P14-03), Badge and CounterBadge color="important" is Fluent's neutral high-emphasis color (P14-05), a TimePicker without format follows the hour cycle of the browser's language (P14-06), and the details argument of every change callback is required. And it makes four breaks that no 0.x release announced, chosen after 0.18 shipped and without a 0.19 to announce them (the roadmap's announce-first rule is waived for them; Upgrading to 1.0 and a migration codemod stand in for the notice): every class the components draw carries the prefix wave: and an app's Tailwind build gets Wave's theme keys under wave (bg-wave-primary), so nothing of Wave's styling collides with an app's any more (P14-01); ref reaches the focusable element of twelve form controls, whose wrapper is the new slotProps.root (P14-04, reversing 0.18's decision to keep ref on the root); the package is ES modules only; and the 0.4 ramp names --brand-N and --grey-N no longer re-theme Wave. It closes the four gaps of Phase 14: foundation-9, foundation-10, badge-1 and timepicker-3. Nothing is added but what these changes need. Read "Upgrading from 0.18" before upgrading.
Upgrading from 0.18
Upgrading to 1.0 lists every change with its old and new form and how to find the uses in an app. In short:
- Upgrade to 0.18.1 first, run a development build and replace each use it warns about (every replacement works in 0.18), then upgrade to 1.0 and run the type check: removed props, values, call forms and exports, the
reftypes of the twelve controls and the requireddetailsarguments are type errors. 1.0 logs none of the 0.18 notices, and JavaScript that no type checker reads gets no message for a removed prop (the guide's "Untyped code" says what it gets). - ES modules only.
exports["."]is{ types: index.d.ts, default: index.mjs },mainis./dist/index.mjsandmoduleis gone; no.cjsorindex.d.ctsships.require()of the package works on Node.js 22.12 and later (theenginesfloor, unchanged) and returns the same module asimport. A TypeScript file compiled as CommonJS needsmodulenode20ornodenext(node16reports TS1479), and Jest in CommonJS mode must transform the package or run in its ES modules mode. - Namespaced utilities. Wave's classes are
wave:flex,wave:bg-primary; your Tailwind build gets Wave's colors, type ramp and shadows asbg-wave-primary,text-wave-body-1andshadow-wave-4, and the 0.x names (bg-primary,text-foreground,border-border,text-body-1,shadow-4,var(--color-primary)) generate nothing unless a theme of yours defines them. The migration codemod rewrites your own classes,@applylists and theme variable uses:node node_modules/@mortenbrudvik/waveui/codemod/migrate-1.0.mjs --dry-run "src/**/*.{ts,tsx,css}"prints every change, and without--dry-runit writes them. It never rewrites the 17 names a stock shadcn/ui theme defines too (bg-primary,text-foreground,border-border, …), nor the names your own theme declares, without--include-shared: an app without shadcn/ui and without a theme of its own passes it. It cannot find selectors of Wave's 0.x classes (.bg-primary,querySelector('.flex'): use the stablewave-*classes ordata-*attributes), reveals against Wave's row groups (group-hover/table-row:: the rows carrywave:group/table-row), or the setup changes: without Tailwind, a Tailwind class inclassName(p-2) still removes Wave's conflicting class but nothing defines it, so use your own CSS or the new./utilities; with./tailwind, your@themeno longer restyles the components (they come precompiled, every theme value inlined: restyle them through the--wave-*tokens), your build no longer generates the classes they use, and any utility and unlayered rule of yours wins over Wave's classes, so a bare background class of yours also covers a component's hover, pressed, selected and disabled backgrounds. refreaches the control of Checkbox, Switch, SearchBox, SpinButton, ColorSlider, AlphaSlider,ColorPicker.HexField, Combobox, Dropdown, TimePicker, DatePicker and TagPicker (its trigger,TagPicker.InputorTagPicker.Button), which losecontrolRef; their root isslotProps.root.ref. A ref object typed for the root no longer compiles, but a callback ref or state setter typed for a<div>still does on the seven whose control is an<input>(SearchBox, SpinButton, ColorSlider, AlphaSlider, Combobox, TimePicker, DatePicker): look for those by hand.Popover.Trigger,Menu.Trigger,TeachingPopover.Trigger,Dialog.Trigger,Drawer.Trigger,Overflow.Item asChildandPresencearound one of them now reach its control.- Removed: every prop, value, call form, export, class, stylesheet and rule that 0.x deprecated (Removed), with no alias, and the 0.4 ramp names as overrides (override
--wave-brand-Nand--wave-grey-N). - Required: the
detailsargument of the change callbacks (code that calls such a prop itself passes it) andImage.alt(Changed, Required arguments and props). - Defaults and meanings:
color="important"on Badge and CounterBadge is the neutral high-emphasis look (severekeeps the orange); TeachingPopover's Done callsonFinishonly, neveronDismiss; a TimePicker withoutformatfollows the browser's language after mounting (12-hour on the server and in the hydrating render): passformatfor a fixed hour cycle.
Added
slotProps.rooton the twelve controls whoserefmoved and onRadioGroup.Item(whose<label>no ref reached), as on Input since 0.18: the root element'sref, classes, style, attributes and handlers. Your classes and style come after the component's ownclassNameandstyle, your handlers run first (preventDefault()skips the component's own root handlers), and the component keeps its enumerateddata-*attributes, its own root props and its hidden state (hidden,inert,aria-hiddenat the component's own values); a<label>root (Checkbox, Switch,RadioGroup.Item,ColorPicker.HexField) takes nohtmlForfrom the part, which would send its clicks to another element. Checkbox, Switch and the radio do not call your rootonClickwhile disabled; the other roots pass no click to their control and call it in every state. A click on a label root's text reaches itsonClicktwice, as on any<label>(the text, then the click the label passes to the control).@mortenbrudvik/waveui/utilities(also./utilities.css): the namespaced token utilities for apps without Tailwind:bg-,text-,border-,ring-,fill-andstroke-with each of the 144 color tokens, the type ramp (text-wave-body-1), the shadows (shadow-wave-4), the font families and the animations, 889 classes without variants and without spacing or layout utilities. Unlayered like./styles, so its classes beat the zero-specificity base styles of./stylesinside the provider; link it after./stylesand before your own CSS.- The namespaced theme keys in
./tailwindand./tokens(--color-wave-*,--text-wave-*,--shadow-wave-*, with the font families, durations, curves and animations that carriedwavealready), for an app's own classes:bg-wave-primary,text-wave-body-1,shadow-wave-4,tw:bg-wave-primaryin a prefixed build. - The migration codemod
codemod/migrate-1.0.mjs, shipped in the package (Node.js built-ins only): it rewrites an app's utilities of Wave's former theme names (31 color utilities with 144 color names, the type ramp, the shadow levels) with their variants, modifiers and important marks,@applylists and theme variable uses (var(--color-primary),theme(--text-body-1--line-height)), in scripts, CSS, HTML, Vue, Svelte and MDX, never a comment or a declaration;--dry-runwrites nothing,--include-sharedalso rewrites the 17 names shared with a stock shadcn/ui theme and the names the scanned files declare as their own theme keys; a second run changes nothing. TagPicker.Buttonis reached by TagPicker'srefwhen it renders in place ofTagPicker.Input.- Development warnings (keys):
MessageBar:dismiss-button-slot-object,SearchBox:dismiss-button-slot-objectandTag:dismissIcon-button-slot-object, when a dismiss or clear slot object'sasis a button, which is unwrapped (see Changed);Image:alt-missing("Image: `alt` is required. …") replaces 0.18'sImage:alt, for JavaScript that leavesaltout. - Documentation: Upgrading to 1.0 is final. The README gains the setup matrix of Quick start, "ES modules only" under Installation, "Custom Tailwind setups", "Namespaced names", the
rootpart and the components that read a child'sref, and "Upgrading to 1.0" in place of "1.0 notices"; the guide's Pattern 5 is "cn() and wcn()" (#pattern-5-cn-and-wcn); the testing gui...
v0.18.1
Fixed
- The rule that a disabled control calls no
onClickof yours on its parts (the README's Customization chapter, "Disabled controls", and rule 4 of the guide's Customization chapter) promised more than the components do, and now says what they do. It covers the control's own element and the parts inside it or that pass their click to it (a Switch's thumb and label, an Input's bordered wrapper, a Dropdown's value), not every part beside it: a part that passes no click to the control, such as the error message of a TimePicker or DatePicker, takes youronClickin every state, and so do the parts of ColorPicker andColorPicker.HexField(opacityLabel,opacityValue,label,errorMessage), since a ColorPicker has no disabled state: while its value is not a hex color only the color parts bound to it are disabled, and its hex field stays editable. The exception of the ColorArea, ColorSlider and AlphaSlider drawings said that each slider is its range input, natively disabled; each root is a<div>that takes youronClickwhile disabled too, and only the range inputs inside it are natively disabled. The exceptions stay those drawings (field,rail,thumb) and a disabledOption's ownonClickprop. No component changed.
Changed
- Tests: the timeouts of the slow tests hold under load, where the 0.18.0 gate exceeded twelve of them, and no assertion changed. In
scripts/__tests__/verify-dist.test.mjseverycheckServerImportcase has 30 s per check (nine had Vitest's 5 s default), and every case that runs the whole check (verifyDistormain) three times its former timeout (90 s where it had 30 s); Combobox's data-mode test "keeps option ids per value across filtering and reopening" has 30 s. Two new tests pin that the parts of ColorPicker andColorPicker.HexFieldcall youronClickwhile the value is not a hex color, as while it is one.
v0.18.0
The thirteenth Fluent UI v9 parity release: Phase 13 of the roadmap, the customization surface and the 1.0 notices. An app can now style and extend WaveUI components without forking them or reaching into internal modules. The elements a component draws besides its root take your props through slotProps, one object per part keyed by the part's name in the class-name registry (slotProps={{ track: { className, onClick } }} on a Switch): every part of the class-name registry that no named slot fills and that is not excluded, 236 in all, merged by the rules a root follows (your classes last, your handlers first and cancellable, your ref beside the component's), while the attributes the component's wiring depends on stay locked. A slot object's children may be a render function (Component, props) => ReactNode, which replaces a named slot's element and keeps its wiring; getNativeElementProps keeps the props an element accepts, and mergeSlotProps, the helper every component applies to its parts, is public. A Field's child may be a function that receives the control's id and ARIA attributes, for a control Field cannot merge them into, and useFieldContext and FieldContextProvider are public. Hooks give content of your own a narrow view of its component: a radio card (useRadioGroupContext, useRadioGroupItem), a menu item (useMenuContext, useMenuListContext), an action that follows a MessageBar's status and layout (useMessageBarContext), and a DataGrid cell that reads and drives the sort and the selection (useDataGridSort, useDataGridSelection, useDataGridRowId). And the last minor before 1.0 announces every change 1.0 makes: four uses that code can detect now warn in development, the Deprecated list restates every change decided for 1.0 with the release that announced it, ref placement is decided (nothing moves), and Upgrading to 1.0 is drafted. It closes the fourteen gaps of P13-01 and P13-02 (foundation-34, foundation-35, foundation-36, foundation-38, foundation-39, form-basic-7, form-basic-8, form-basic-21, field-6, api-1, menu-17, messagebar-6, ctx-1, buttons-29), with four departures from Fluent: one slotProps object instead of a prop per part (whose names would collide with WaveUI's named slots); narrow hooks instead of the context objects, which throw in development outside their component where Fluent's return defaults; a Field context that is optional by design (useFieldContext() is null outside a Field); and foundation-38 closed by the stable classes, which a stylesheet targets app-wide, and per-instance className and slotProps, while a provider-level WaveProvider classNames (Fluent's customStyleHooks_unstable) is left for after 1.0. Nothing public is removed and no default changes, and without slotProps every component renders the attributes of 0.17, on some elements in another order: read "Upgrading from 0.17" before upgrading.
Upgrading from 0.17
- Nothing is removed and no default changes. A component given no
slotProps(or{}) renders the attribute names and values of 0.17 and behaves as in 0.17, but for the two changes of Changed, Behaviour: a MessageBar measuring its layout leaves out the text changes of the commit that renders the new layout, and a staticMenurenders its root once more as it mounts. On some elements the attributes come in another order: a part's merged props put its class before the attributes the component locks, a Tag's Dismiss button renders the attributes that itsdismissIconslot adds to it (a merged<button>orButton, the deprecated button object, an ARIA attribute of a slot object) before itsclass, and MessageBar's Dismiss button renders itstypefirst. Browsers, React's hydration, Testing Library's queries and Vitest's DOM snapshots ignore the order; a test that compares raw HTML strings (renderToStringoutput,innerHTML) changes. - New development warnings, once each, for uses that 1.0 removes or changes (see Deprecated):
Badge:color:importantandCounterBadge:color:important(color="important", whose look changes in 1.0: passcolor="severe"to keep the orange; CounterBadge warns only when it draws a count or a dot),deprecated:useRovingTabIndex:useRovingTabIndex(containerRef, options)(the 0.4 call shape),deprecated:DataGrid:onSortChange(columnId, direction)(the positional callback of a grid withoutitems,sortordefaultSort), andMenu.Popover:legacy-motion,Dialog.Content:legacy-motion,Drawer:legacy-motionandNavDrawer:legacy-motion(aclassNamewith presence variants whilemotionis unset). A test that spies onconsole.warnand renders one of these forms asserts the warning. They readprocess.env.NODE_ENVthemselves, ascreateBrandTokens' ramp check does, so a production bundle drops them and their text; imported without a bundler (noprocess), they are skipped, while WaveUI's other warnings assume development there. - Types.
FieldProps['children']widens to a function as well ((props: FieldControlProps) => ReactNode), and so does a slot object'schildren(SlotRenderFunction): code that reads these props in a wrapper of its own handles the function, or narrows it out.CardProps['checkbox']narrows: its slot object takes nochildren(an<input>has none; any are dropped at run time), so a variable typedSlot<'input'>, whosechildrenmay now be a function, no longer fits it: type the variableCardProps['checkbox'], or write the object inline. Every props type with parts gains an optionalslotProps(a polymorphic component's in its<X>OwnProps), and a few declare their own instead of inheriting one:AvatarGroupItemPropsis now an interface, Avatar's props without theirslotPropsand with the item's own, rather than an alias ofAvatarProps; the checkable menu items' props,AlphaSliderPropsandNavSubItemOwnPropsleave out theslotPropsof the type they extend.WaveContextValueis unchanged. details.eventmay be the grid's own. A cell of yours that sorts or selects throughuseDataGridSort().setSort(sort, event?)oruseDataGridSelection().toggle(id, event?)without an event reachesonSortChangeandonSelectedItemsChangewith an untrustedEventof typesortorselectand no target (asuseTableColumnSizingpassesnew Event('resize')), sodetailsalways comes: a handler that readsdetails.event.targetchecks it.- Decided for 1.0, announced now (see Deprecated):
refplacement does not change.refreaches the root element, the one that receivesclassName, with two exceptions that stay as they are: Input'srefreaches its<input>, also withcontentBeforeorcontentAfter, whereslotProps.root.refreaches the bordered wrapper that takesclassName, andRadioGroup.Item's reaches itsrole="radio"button, while itsclassNamestays on its root<label>, which no ref reaches.controlRefreaches the focusable element of the controls that have one, andslotProps.<part>.refa part. TimePicker'sformatwill follow the locale's hour cycle, the optionaldetailsarguments become required, and so doesImage.alt.WaveProvider classNames(app-wide classes per component) is not part of 1.0: it may come after it, as an addition. - Everything else is opt-in:
slotProps, the render-function slot children,getNativeElementProps,mergeSlotProps, Field's function child,FieldContextProvideranduseFieldContext, and the context hooks are new props and exports, and a page that uses none of them renders as in 0.17, apart from the order and the two behaviour changes of item 1.
Added
slotProps(foundation-34; typesSlotPart,SlotPartWithRefandSlotPartOwn; Fluent gives each part a prop of its own name,indicator={{ … }}): the elements a component draws itself besides its root take props of yours, one object per part, keyed by the part's key in the class-name registry (switchClassNames.trackisslotProps.track, with the classwave-switch__track). Every part key of the registry that no named slot fills and that is not excluded is one, 236 in all (the registry's other part keys are 100 named slots and 29 exclusions): a Switch's track and thumb, a Checkbox's box, an Input's<input>, a picker's listbox surface, a Calendar's days, a Dialog's body, a menu item's label and shortcut, a Tree item's row, a Nav category's toggle, a Carousel's track and slides, a DataGrid header's sort button and resize handle, a MessageBar's text column, every toast's container in a Toaster, and the rest. A part takes the attributes, handlers andrefof its element and anydata-*attribute (a string, a number or a boolean), but nochildren,as,keyordangerouslySetInnerHTML(type errors in an object literal, dropped at run time); a value typed by an interface (React.ButtonHTMLAttributes<HTMLButtonElement>, an interface of yours) or returned bygetNativeElementPropsfits a part too, andSlotPartWithRef<E, R>types a part whose ref takes another element (a List item's content, Input's root). Your props merge as a root's do: yourclassNameafter the part's own classes throughcn(the stable class stays first, and yours win a conflict of the same variant); yourstyleover the part's, except the keys a component must control (a positioned popup's position, size limits and visibility, a beak's offset, a carousel track's translation, a ...
v0.17.1
Fixed
- Token values with an unclosed quote, comment, parenthesis or square bracket, a stray
)or], or a trailing backslash are now skipped with a warning, like values with;,{or}, byWaveProvider tokensandgetTokenStyle; before, in a server-renderedstyleattribute such a value swallowed the declarations after it (the later overrides and yourstyle), so the server and the client could render different overrides (the 0.17.0 note that both render the same overrides held for well-formed values only). The value is scanned once, as the CSS tokenizer reads it: parentheses and brackets inside a string or a comment, the other quote inside a string and escapes inside a string do not count, a string must close on its own line, and a closer must match the innermost open parenthesis or bracket. Every token oftokens.css, font stacks with quoted names such as'Segoe UI Web (West European)', shadows, curves,var()with a fallback andcolor-mix()still pass. - Token values that hold
url((in any case), or a!or a backslash outside strings and comments, are skipped with the same warning. No token takes a URL, and an unquoted URL ends at its first)whatever it holds, sourl(a"b)c")opened a string after it that swallowed the later declarations on the server, and so did the same URL spelt with an escape (u\72l(a"b)c"),\75 rl(…)), which nourl(test sees; the server readred !importantasredwith the important priority, while the client refuses the value. A backslash inside a string ('Wave\'s Sans') is still an escape. - Token values are trimmed (JavaScript's
trim) before they are applied. React's server renderer trims a custom property's value while the client sets it as given, so a value with a no-break space, a byte order mark, a vertical tab or a line or paragraph separator at an edge painted on the server-rendered root and fell back on the client-rendered portals (' red'with a no-break space). A value that is empty after trimming sets nothing, on the server and in the client. - After these fixes every value
tokensandgetTokenStyleapply is trimmed, balanced CSS text without;,{,}orurl(and with no!or backslash outside strings and comments, which the server-renderedstyleattribute and the client read alike, so the server and the client render the same overrides. Checked in Chromium 156 for each of these cases and for 400,000 generated values (quotes, comments, brackets, escapes,url(,!important,<!--and-->,@rules,U+ranges and the edge spaces), of which none of the 97,560 that pass read differently; in review, a tokenizer that follows CSS Syntax Level 3 found none of the 337,195 that pass among 2,000,000 values that swallows or alters another declaration. - The check is one pass over the value, its stack of open parentheses and brackets an array, so its time grows with the length of the value alone: a long value from a tenant's settings cannot stall a server render (
')'.repeat(2 ** 18)takes milliseconds). - Both value warnings now say that a value must be "a finite number, or CSS text with balanced quotes, brackets and comments, without
;,{,}orurl(, and without!or a backslash outside strings and comments".
Changed
WaveProvider'stokenswarnings (WaveProvider:tokens:name:<key>andWaveProvider:tokens:value:<key>) readprocess.env.NODE_ENVwritten out, as the full-ramp check ofcreateBrandTokensdoes, so a production bundle drops them and their text, which keepsWaveProviderwithDialogwithin its budget with the new checks. Development builds warn as before; imported without a bundler (noprocess), the provider skips them.getTokenStyle's warnings are not gated this way.- Dev gates:
verify-distproves the gate, as it doescreateBrandTokens' contrast check: an import of onlyWaveProvider, built for production, holds noWaveProvider:tokens:warning key (HOOK_PROBES_0_17).
Size
Against 0.17.0, measured as its Size table was (verify-dist's measureImport). Sizes are in bytes:
| Import | 0.17.0 | 0.17.1 |
|---|---|---|
An import of only getTokenStyle |
1,350 (772 gzip) | 1,825 (1,018 gzip) |
An import of only WaveProvider |
3,902 (1,844 gzip) | 3,967 (1,883 gzip) |
An import of WaveProvider and Dialog |
73,335 (24,747 gzip) | 73,403 (24,778 gzip) |
getTokenStylegrows by 475 bytes (246 gzip), the checks and the longer warning. In the provider the warnings that a production bundle now drops pay for most of the checks:WaveProvideralone grows by 65 bytes (39 gzip) and withDialogby 68 (31 gzip), within its budget of 73,420 and 24,843. Every other import of the 0.17.0 table, anddist/styles.css, is unchanged.
v0.17.0
The twelfth Fluent UI v9 parity release: Phase 12 of the roadmap, the theming API and a charts strategy. An app can now look like its own brand without forking WaveUI or fighting it. WaveProvider tokens overrides any design token by its camelCase name, as inline custom properties on the provider's root and on every portal of its subtree, so a nested panel's dialogs, menus, popovers, tooltips and toasts match the panel (applyStylesToPortals={false} keeps the overrides off the portals). createBrandTokens('#c43e00') builds the 16-stop brand ramp from one color, each stop at the default ramp's luminance, so the light and dark themes keep their contrast whatever the seed; a full ramp of your own is checked in development. waveTokens gives every token a typed JavaScript value (waveTokens.primary is 'var(--wave-primary)'), getTokenStyle the provider's inline style for an element no provider renders (a Server Component's <html>), and chartPalette the 12 palette fills in an order for chart series. Shadows become per-theme tokens with Fluent's stronger dark values, each persona palette hue gains a tint, a tint foreground and a border, and two font families (monospace and numeric) come with Text font and a medium weight. Charts are a documented strategy, not components: the guide's new "Charts with WaveUI" chapter and Storybook stories for Recharts and Chart.js, which stay out of the package. It closes the eleven gaps of P12-01 to P12-04 (foundation-1, foundation-3, foundation-5, foundation-6, foundation-7, foundation-8, foundation-11, foundation-12, foundation-46, text-3, text-4): foundation-46 by the strategy, and foundation-6 by the palette, with the spacing, radius and stroke scales documented rather than made tokens. Nothing public was removed, and the markup of 0.16 is unchanged without tokens; WaveContextValue gains three members and TextWeight a fourth value, and the dark and high-contrast shadows are stronger: read "Upgrading from 0.16" before upgrading.
Upgrading from 0.16
- The dark and high-contrast shadows are stronger. The six shadow levels are tokens of each theme group (
--wave-shadow-2…--wave-shadow-64), and theshadow-2…shadow-64utilities read them (@theme inlinemaps--shadow-Ntovar(--wave-shadow-N)). The light theme keeps the shadows of 0.16 byte for byte (ambient opacity 0.12, key 0.14); dark and high contrast take Fluent's 0.24 and 0.28 with the same offsets and blurs, twice as dark, so every raised surface of those themes (cards, menus, popovers, tooltips, toasts, dialogs, overlay drawers) looks different: a visual change, no API change. Since a level's value is now a token, Tailwind can no longer take its colors apart: a shadow color utility or an opacity modifier (shadow-black,shadow-primary,shadow-4/50) no longer changesshadow-2…shadow-64(Tailwind's ownshadow-sm…shadow-2xlare unaffected). Change a level for a theme through its token instead (.wave-dark { --wave-shadow-8: … }, ortokens={{ shadow8: … }}on a provider). On the Tailwind path an@themeof yours that sets--shadow-Nkeeps its value, which replaces Wave's alias; a build that read the literal shadow values fromtokens.cssnow findsvar(--wave-shadow-N)there. WaveContextValuehas three new members:tokens(the merged overrides of the providers above;{}outside a provider),tokenStyle(the inline style that applies them;undefinedwhen there is nothing to set) andapplyStylesToPortals(trueoutside a provider). A hand-built value of the type (a test mock ofuseWaveTheme) adds them.TextWeighthas a fourth value,'medium'(500,font-medium), which theweightof Text, Label and InfoLabel takes: an exhaustiveswitchover it, or aRecord<TextWeight, …>of your own, adds a case.- With
tokens, the provider root and the portal wrappers carry the overrides. Withouttokensanywhere above, the markup is 0.16's: the root has nostyleattribute unless you pass one, and a portal wrapper'sstyleholds only itspositionandz-index. Withtokens, the root renders the--wave-*custom properties in itsstyle, before your ownstyle, which wins a conflicting property; a nested provider's root carries the whole merged map, also when it sets notokensof its own; and each portal wrapper of the subtree puts the properties before its two own (unlessapplyStylesToPortalsisfalse). A test that compares a wholestyleattribute, or a selector on[style], changes when you adopttokens. - Everything else is opt-in:
tokens,applyStylesToPortals,createBrandTokens,waveTokens,getTokenStyle,chartPalette,Text font, the palette tints, tint foregrounds and borders, and the two font families are new props, exports and tokens, and a page that uses none of them renders as in 0.16, apart from item 1. On the./tailwindpath your Tailwind theme gains their names: the colorspalette-<hue>-tint,palette-<hue>-tint-foregroundandpalette-<hue>-borderof the 12 hues, and the font familiesfont-wave-monoandfont-wave-numeric(see the README's Global effects).cn()treats the two font families as families, socn('font-wave', 'font-wave-mono')keeps the last.
Added
WaveProvider tokens(foundation-1;WaveTokenOverrides | null; Fluent'sthemeprop with a partial theme): design token overrides for the subtree, CSS values by token name. A name is the token's CSS variable in camelCase without--wave-(a hyphen before each capital letter and before a run of digits:primaryForegroundis--wave-primary-foreground,brand80is--wave-brand-80,paletteRedTint,shadow8,fontFamilyMonospace,zOverlay), and a number is written as its string.themestill names one of the three themes, and the overrides apply over it as inline custom properties on the provider's root (in the server HTML too, so the first paint has them) and on the wrapper of every portal in its subtree, so its dialogs, drawers, menus, popovers, tooltips, listboxes and toasts take them. An inline style beats every stylesheet rule on the same element, so an override also wins over.wave-light { --wave-primary: … }; astyleyou pass to the provider wins over the overrides. A nested provider merges its overrides over the enclosing provider's, key by key, also when it sets anothertheme(so set an override of a semantic color in the provider that sets the theme it was chosen for): an omittedtokens, or a key whose value isundefined, inherits.nullclears the inherited overrides of the tokens a theme declares (the semantic colors, the palette, the shadows) and of the subtree's overlays; the theme-independent tokens of an enclosing provider (the brand and grey ramps, the font families, the stacking layers, the motion durations and curves, which are declared on:rootonly) still reach the subtree's own elements through the cascade, sotokens={createBrandTokens('#0f6cbd')}is the way to put a subtree back on the default ramp everywhere. Names are converted by the rule, not checked against the list of tokens: TypeScript refuses a misspelled one, and in JavaScript it sets a custom property nothing reads. A key that is not a camelCase identifier, or a value that is neither a finite number nor a string without;,{or}, is skipped with a development warning (so a value cannot add a declaration of its own to the server-renderedstyleattribute, and the server and the client render the same overrides). The merged overrides keep their identity while their entries stay equal, so an inlinetokens={{ … }}re-renders no consumer. Under a Content Security Policy that blocks inline style attributes (style-srcwithout'unsafe-inline'), the server-rendered overrides do not apply and hydration does not apply them again: ship them in a stylesheet there, and pass notokens(norgetTokenStyle), since the overlays and the subtrees rendered in the client would still take them and leave the page half branded (guide). Fluent's provider inserts a style rule with the renderer's nonce instead; Wave renders no<style>element and needs no nonce.applyStylesToPortals(foundation-3; Fluent's name;trueby default):falsekeeps thetokensoverrides off the portals of the subtree, those inherited from enclosing providers included. The theme classes, the direction and thewave-portalwrapper stay, so an overlay of a dark provider is still dark; for the tokens the theme declares it shows the theme's own values, and the theme-independent ones come from the cascade of the element it renders into. A nested provider inherits an omitted value, liketheme(Fluent's is not inherited), and since Wave's portal wrapper never carried the provider root's own look, whatfalsedrops are the overrides (Fluent'sfalsedrops the root's other classes). It keeps a panel's accent out of the panel's dialogs and menus when the page's brand comes from CSS or fromgetTokenStyleon<html>; under an enclosing provider'stokensthe overlays lose that brand too.createBrandTokens(seed)(foundation-5; typesBrandStop,BrandRamp,BrandTokens): the 16 brand tokensbrand10…brand160of one color (#rgbor#rrggbb, any case), fortokens(alone or spread with other overrides) orgetTokenStyle. Each stop keeps the relative luminance of the default ramp's stop and takes its hue and colorfulness from the seed: the seed's OKLCH hue and chroma, shaped per stop like the default ramp (less colorful toward both ends, the hue drifting a few degrees as the default's does), reduced t...
v0.16.0
The eleventh Fluent UI v9 parity release: Phase 11 of the roadmap, tables and lists at data scale. DataGrid, List, Listbox, Combobox, Dropdown and the new FlatTree stay correct when most of their data is not rendered: a small built-in window (useVirtualWindow, passed as virtualWindow) renders the rows in view plus an overscan, with spacers for the others, while selection, select-all, sorting, the keyboard and the positions a screen reader announces (aria-rowcount and aria-rowindex, aria-setsize and aria-posinset) follow the data, and the focused row stays rendered when it is scrolled away. A DataGrid given items selects by its data instead of its rendered rows, its columns resize by pointer, touch and keyboard, and tables built from the static Table parts get headless state (useTableFeatures with sort, selection and column-sizing plugins, the generic useSelection) and Table.ResizeHandle. Listbox, Combobox and Dropdown take their options as data (items, renderOption). Windowing is fixed-size only and adds no dependency: an adapter over a virtualization library can implement the same VirtualWindow interface (the guide's "Data at Scale" chapter has one for @tanstack/react-virtual). It closes thirteen of the fourteen gaps of P11-01 to P11-04 (hook-1, hook-2, hook-3, hook-4, foundation-40, dg-3, dg-6, trh-1, virt-1, foundation-45, tree-9, list-6, combobox-7); table-2, a Table rendered from <div>s, stays open (windowing works on native table rows). Nothing public was removed, and no type narrows except UseGridNavigationResult, which gains two members, but a DataGrid with items changes how its selection behaves: read "Upgrading from 0.15" before upgrading.
Upgrading from 0.15
- A DataGrid with
items: selection follows the data. Select-all selects every selectable item ofitems, whether its row is rendered or not, and its checkbox shows the state of those items (checked when all are selected, mixed when some are); when all of them are selected, select-all removes only their ids, and a selected item whose selection is disabled keeps its state. A row click, Space and a row's control change one id and no longer drop the selected ids whose rows are not rendered, andonSelectedItemsChange(selectedItems, details)(same signature, row ids) now reports those ids too: an id of an item that is filtered out, on another page, outside the window or restored from storage by id stays selected until your code removes it. In 0.15 such ids were left out of the reported selection and of the select-all state, so the next change dropped them. In single mode the selected id is the first one given (0.15: the first one whose row is rendered), and newitemsdo not clear it. Select-all reports the ids outsideitemsfirst, then the selected ids ofitemsinitemsorder, so a grid that mounts sorted (defaultSortor a controlledsort) now reports them initemsorder, where 0.15 reported the sorted order. A grid built fromDataGrid.Rowchildren (noitems) keeps the 0.15 behaviour. isSelectionDisabled(item, index)tells a grid withitemswhich items cannot be selected, rendered or not: select-all skips them, and a rendered row takes it as thedisabledof its selection cell. Without it, an item is selectable unless its rendered row disables its selection cell (selectionCellProps.disabled,DataGrid.SelectionCell disabled), which only a rendered row can say: a grid with avirtualWindowpassesisSelectionDisabled, or select-all also selects the disabled items it does not render. A cell's owndisabledstill wins for its control, and a value that disagrees withisSelectionDisabledwarns in development.- Everything else is opt-in: windowing (
useVirtualWindow, andvirtualWindowon DataGrid, List, Listbox, Combobox and Dropdown),FlatTreeanduseFlatTree, the table hooks, the pickers' data mode (items) and resizable columns are new components, props and hooks. A component that uses none of them behaves as in 0.15, apart from item 1. - A windowed list needs a bounded height and a fixed item height. Its scroller (the DataGrid's scroll wrapper, the element of
containerProps; the List, Listbox or FlatTree element; the popup list of a Combobox or Dropdown has its own maximum height) needs a height or a maximum height, or the window measures the whole list and renders every item (DataGrid warns in development,DataGrid:virtual-window-height). Every item is exactly the window'sitemSizetall: the components set that height on each row, item and option after its ownstyle, and a windowed DataGrid's body cells drop their block padding and keep their text on one line, so the content must fit. - Development warnings a 0.15 grid can now log: in a grid with
items, aDataGrid.Rowwhose ownrowIddiffers from its item's id (DataGrid.Row:row-id-mismatch), or aDataGrid.Rowchild of the body whoserowIdis no item's id (DataGrid.Row:row-id-outside-items): select-all and its checkbox use the ids fromgetRowId, so such rows are outside them. Pass agetRowIdthat returns the rows' ids. Withitems, the text ofDataGrid:single-several-selectedsays that only the first id is selected (key unchanged). A test that spies onconsole.warnasserts them. - Types:
UseGridNavigationResulthas two new members,activeRowIndexandpendingRowIndex(alwaysnullwithout the newmodeloption): a hand-built value of it (a test mock) adds them.ListboxOptionElementPropsgains optionalaria-posinset,aria-setsizeandstyle, which an option component of yours onuseListboxOptionreceives in a data-mode list (the position) and in a windowed list (its height): spread them, and mergestyleafter your own.DataGridLabelsgainsresizeColumnandcolumnWidth.
Added
useVirtualWindow(options)(virt-1,foundation-45), a window over a long list of fixed-height items:itemSize(pixels; every item has it),overscan(items rendered beyond each edge; by default enough for 240 pixels and at least 6, so 9 items of 28 pixels and 8 of 32),initialViewportSize(the viewport assumed on the server, in the first render and while the scroller measures 0;480) andscrollPaddingStart(the height of a sticky header over the rows, whichscrollToIndexplaces rows below). It returns aVirtualWindow:itemSize,scrollRef(the scrolling element's callback ref),layout(count, { keep })(theVirtualEntrylist to render,{ kind: 'item', index }and{ kind: 'spacer', size, key }, a pure function called during render;keepholds indexes outside the view, the focused row) andscrollToIndex(index, { align })(auto, the least scroll that shows the item,start,center,end; it moves the window in the same update, a request made before the scroller attaches is applied when it does, and once more when the scroller first changes height, a popup that positioning shrinks, unless it was scrolled first). The window re-renders when the first row in view or the viewport height changes, not per scroll event: a passivescrolllistener read once per animation frame and aResizeObserver. Pass it to a component'svirtualWindow: the component lays the window out itself, since only it knows which item it must keep rendered. MergescrollRefwith your refs or destructure it (ref={virtualWindow.scrollRef}fails the React Compiler's lint). Fluent's closest counterpart is its deprecatedVirtualizer; an object of your own that implementsVirtualWindow(an adapter over@tanstack/react-virtual, guide) works in every component.- DataGrid
virtualWindow(virt-1), withitemsandcolumnsand the body rows rendered from them: only the body rows in view render, with spacer rows (<tr aria-hidden="true" data-virtual-spacer>,wave-data-grid__spacer) for the others. The scroll wrapper (containerProps) is the scroller and needs a bounded height; the header sticks at its top (pass the header's height asscrollPaddingStart); the columns are laid out from widths, so they never change as rows come and go. The keyboard moves by the data: ArrowUp/ArrowDown, PageUp/PageDown (10 rows) and Ctrl+Home/Ctrl+End scroll a target row that is not rendered into the window and focus it once it renders, the focused row stays rendered while it is scrolled away, and when a sort or newitemsmake the browser drop focus from a moved row, focus returns to the same row, or the rendered row nearest its place. The grid carriesaria-rowcount(the items plus the header rows), every rowaria-rowindex(header rows first, body rows in the sorted order) and every body rowdata-row-index; without a window none of them render. A focused row that the sticky header covers is scrolled below it (not for the focus a pointer press gives). - List
virtualWindowandcount(list-6), with a function child(index) => <List.Item …/>that the list calls for the rendered indexes only: the list element is the scroller (vertical scrolling is added; give it a bounded height), items carrydata-indexand their place in the whole list (aria-setsizeandaria-posinset, or in a grid,navigationMode="composite",aria-rowcounton the list andaria-rowindexon the rows), and spacers arearia-hidden<li>s (<div>s in a grid) withwave-list__spacer. Where the list navigates its items, the keys move by index over the whole list (the arrows wrap, PageUp/PageDown move ten items and stop at the ends, Home/End), scrolling the target into view before it is focused; the focused item stays rendered (also while focus is in a popup it opened) and is the Tab stop while focus is in the list; whencountdrops to or below the focused item, focus moves to the last item. Selection keeps the values of items that are not rendered. A s...
v0.15.0
The tenth Fluent UI v9 parity release: Phase 10 of the roadmap, motion on components. Dialogs scale and fade in, drawers slide from their edge and inline drawers open their space, Popover, Menu, InfoButton's note and TeachingPopover fade and slide away from their anchor, Accordion panels, Tree groups and Nav categories collapse, toasts and the new MessageBarGroup let their neighbours glide when one comes or goes, TabList slides its selection line and Carousel can cross-fade. Every motion is Tailwind classes on the presence core's data-presence phases, timed with Fluent's motion tokens and off under prefers-reduced-motion; a bundle that animates nothing holds no motion code (verify-dist proves it for an import of only Button). Each animated part takes a motion slot (motion, backdropMotion, expandIconMotion, indeterminateMotion: unset is the default motion, null none, a class string or { className } yours), and WaveProvider motion="none" turns every default off. An exiting surface is inert, and focus, dismiss layers, the focus trap, the isolation and the scroll lock are released when it closes, not when its motion ends. It closes the twelve gaps of P10-01 and P10-02 (foundation-13, dialog-5, drw-4, acc-6, tree-4, toast-5, nav-8, messagebargroup-1, foundation-15, car-3, tab-5, progress-6). Nothing public was removed and every type only widens, but with no motion prop the surfaces animate, so an unchanged page looks different in a browser: read "Upgrading from 0.14" before upgrading if your end-to-end tests wait for elements to disappear or your styles select Wave's DOM.
Upgrading from 0.14
- Surfaces animate by default in a browser. A closed Dialog, Drawer, NavDrawer, Menu, Popover, InfoButton note, Tooltip or TeachingPopover stays in the document for its exit (100 to 500 ms, by surface and size),
inert, withdata-presence="exiting"(anddata-state="closed"on the popups); focus, the dismiss layer, the trap, the isolation and the scroll lock are released at once. End-to-end tests that look for an element's absence right after a close wait for it, or render under<WaveProvider motion="none">. Unit tests in jsdom are unaffected: Vitest loads no CSS, so every phase ends at once (hold one withmockAnimations). - Popover.Content, the Tooltip surface and the TeachingPopover surface mount through the presence core: they render
data-presenceanddata-state(open, andclosedwhile they exit), andinertwhile they exit. A popover named by its trigger keeps noaria-labelledbywhile it exits (it isinertand out of the accessibility tree then). defaultOpensurfaces animate in on a client render too (0.14: only after hydration): Dialog, an overlay Drawer and NavDrawer, Menu, Popover, Tooltip, InfoButton and TeachingPopover mount withappear, so the same page behaves the same whichever way it rendered.motion={null}restores 0.14. In-flow content (inline drawers, Accordion, Tree, Nav, the bars a MessageBarGroup mounts with) never animates on mount.- New wrapper elements.
div.wave-accordion-panel__collapsearound Accordion's region;div.wave-tree-item__collapsearound a Tree group;div.wave-nav-category__collapsearound a Nav category's list;div.wave-drawer__collapse(andwave-nav-drawer__collapsefor NavDrawer) around an inline panel;div.wave-toaster__toast-contentinside each toast container. The first four aredisplay: contentswhile open, so layout is unchanged then; selectors with a child combinator across them (.wave-accordion-item > [role=region],li > ul,[role=treeitem] > [role=group], a flex rule on an inline drawer's parent's direct children during the motion) and tests that walkparentElementornextElementSiblingchange. While a wrapper enters or exits it is a clipping grid of one track, whichever motion runs (the default, amotionof yours, or 0.14 classes on an inline drawer'sclassName, item 6): a slide of yours on the part is clipped by it, and an inline drawer whose width (height at the bottom) is a percentage inclassName, orsize="full"animated by 0.14 classes, resolves it against the track for that time and is right again once open. Give such a drawer a length, or passmotion={null}. - The toast container is a one-cell grid around the new content element (
wave-toaster__toast-content, which holds the status text and the content); itsdata-wave-toastmarker, classes and attributes are unchanged. A test that reads the status text as the container's first child walks one level deeper. - A
classNamewithdata-[presence=…]classes onMenu.Popover,Dialog.Content, Drawer or NavDrawer keeps 0.14's behaviour whilemotionis unset: that part gets no default motion, so your classes animate it unmixed (an inline drawer's presence core waits for its<aside>, as in 0.14). Moving those classes tomotionis the recommended form. The rule covers the part, not its backdrop: a Dialog, Drawer or NavDrawer animated that way now also fades its backdrop by default (backdropMotion={null}keeps 0.14's backdrop), and a backdrop animated through thebackdropslot'sclassNamegets the default fade beside your classes (move them tobackdropMotion). CSS of yours keyed on the phases is not covered either: rules on.wave-toaster__toast[data-presence=…](the 0.8 to 0.14 way to animate toasts) now run beside the toasts' default motion, and atransitionshorthand of yours can reset the recipe's property list, so pass<Toaster motion={null}>or move them tomotion; the same holds for rules on InfoButton's and InfoLabel's note ([data-wave-infolabel-surface][data-presence=…]), wheremotion={null}on InfoButton or InfoLabel keeps 0.14's. - TabList's selected indicator is drawn by the selected tab's
::afterover a transparent 2px border (the tab's box is unchanged), the tab isrelative, and every tab of thetransparentappearance carriesborder-transparent forced-colors:border-[Canvas]. A class that recoloured the indicator through the tab's bottom (start) border targets theafter:border now (after:border-b-…, verticalafter:border-s-…); a border colour of yours left on the tab shows at once under the newly selected tab while the line slides there. - Focus in a closing panel moves to its trigger (Accordion's trigger, the Tree item, the Nav category's button), in the closing commit; 0.14 unmounted the content and focus fell to
<body>. - Behaviour fixes visible during exits: a stacked dialog's backdrop stays transparent while it fades, Dialog's title padding holds, and TeachingPopover stays visible while it exits (see Fixed).
- Carousel's slide curve is the
easy-easetoken (was Tailwind'sease-in-out), same 300 ms, and the root rendersdata-motion. Nav.Category's chevron turns with theeasy-easetoken too (was Tailwind's default curve), same 150 ms, and its transition is a motion slot (expandIconMotion): belowWaveProvider motion="none"it turns at once, while Accordion's and Tree's chevrons, which have no slot, keep their transitions. - Nav item actions fade in over 150 ms (were instant), and at once below
motion="none"and under reduced motion. Their children's transition list is set by the reveal, so a transition class of yours on an action is replaced. - Types:
WaveContextValuehas a new member,motion(MotionPreference); a hand-built value (a test mock ofuseWaveTheme) adds it. - New attributes, always rendered:
data-presenceon the new wrappers and on Popover.Content, the Tooltip surface and the TeachingPopover surface;data-stateon those three surfaces; Carousel'sdata-motion. A test that compares an element's full HTML or attribute list changes.
Added
- Default motion on the overlays and disclosures below, with Fluent's motion tokens (the guide's "Component Motion" section lists the classes); the listbox popups of Combobox, Dropdown, TagPicker and TimePicker, the DatePicker calendar and the AvatarGroup popover still appear and disappear at once (ROADMAP §8.5):
- Dialog: the surface scales up from 85% and fades in over 250 ms (decelerating), and out over 200 ms (accelerating); the backdrop fades over the same times, so it never outlasts the surface.
- Drawer and NavDrawer: an overlay panel slides in from its edge by its own size (
startandendmirrored in right-to-left layouts,leftandrightnot) and fades, over 250, 300, 400 or 500 ms bysize, both ways, with its backdrop fading over the same time; an inline drawer opens and closes the space it takes in the layout while its panel fades, held at its size against its inner edge, so the page beside it never reflows inside it (afullinline drawer has no motion: its size is its container's). - Popover.Content,
Menu.Popoverand its submenus, the InfoButton note and the TeachingPopover surface: a fade and a 4px slide away from the anchor, on the side the surface opened on (data-side), 200 ms in, 100 ms out; a TeachingPopover rendered in place only fades. Positioned surfaces never transitiontransform, so they never glide from their last position. - Tooltip: a fade, 100 ms both ways (Fluent's Tooltip has no motion). Shown again during its exit, it returns to
enteringon the same element. - Accordion panels, Tree groups and Nav categories: the part's space opens from nothing and closes back while it fades, 200 ms both ways; the part keeps its width and its line breaks, and a nested Tree group goes with its parent. A pointer click that falls through an exiting Tree group onto its item (an
inertelement lets the pointer through) neither expands nor activates the item; Enter and a...
v0.14.1
Fixed
- TeachingPopover starts over when it opens again. An uncontrolled step (no
activeStep) kept its place while the popover was closed, so a tour finished with Done, or closed midway with Close, Escape or its Trigger, opened again on the step where it had been left. Each opening, by the Trigger or a controlledopen, now showsdefaultActiveStep(else the first step) from its first render, callsonStepChangewith it once when the step was elsewhere, and announces no step change (the focused popover's name carries the position). A controlledactiveStepis left as it is, and the first mount calls nothing.
v0.14.0
The ninth Fluent UI v9 parity release: Phase 9 of the roadmap, collections, data grids and guided tours. Overflow hides by priority and in groups, Breadcrumb collapses into a menu (by count or by the room it has), DataGrid renders and sorts its own rows from typed columns and selects on a row click, the static Table gets sortable headers, a selection cell, a cell layout and cell actions, List can be navigated without selecting and gets an action of its own, and TeachingPopover gets footer actions and Fluent's composable parts. Every addition is opt-in, and nothing public was removed; the type widenings and the few markup changes are under "Upgrading from 0.13".
Upgrading from 0.13
DataGridColumnandDataGridare generic over the type of the grid'sitems(DataGridColumn<T = unknown>,DataGridProps<T>,DataGridBaseProps<T>,DataGridBodyProps<T>); without a type argument they keep the 0.13 shape withT = unknown. A column'slabelwidens fromstringtoReactNode(code that reads it as a string narrows it first), and itsidis optional and deprecated, socolumn.idreads asstring | undefined(writecolumnId).DataGridhas two call signatures;React.ComponentProps<typeof DataGrid>is the last one,DataGridProps<unknown>.childrenofDataGridandDataGrid.Bodyis optional, andDataGridBodyProps['children']may be a render function(item, index) => ReactNode(DataGridBodyPropsomits the nativechildren): code that reads it as aReactNodehandles the function.onSortChange(sort)andonSelectedItemsChange(items)get a second argument,details({ event }, the click or key press behind the change). Exact assertions such astoHaveBeenCalledWith(sort)or amock.callsentry compared to a one-element array need it ({ event: expect.any(Event) }). The 0.4 positionalonSortChange(columnId, direction)and the deprecatedonSelectionChange(keys)are unchanged.- A grid with
itemsuses the object form ofonSortChange, with or withoutsortanddefaultSort. Next toitems, the positional callback and the deprecatedsortColumn,sortDirection,defaultSortColumnanddefaultSortDirectionare type errors. At run time a positionalonSortChangeis called in the object form (onSortChange(sort, details)), and only the deprecated sort props are ignored, with a development warning (DataGrid:items-deprecated-sort). Passitems={data ?? []}while the data loads. - A sorted DataGrid header shows an arrow (up for ascending, down for descending:
<svg data-wave-icon="sort-arrow-up">or"sort-arrow-down", 12px, withdata-direction, stillwave-data-grid-header-cell__sort-icon) instead of 0.13's filled triangle. A test or style that reads the triangle's path or itsh-3 w-3classes changes. OverflowItemPropsis a type alias of a union (OverflowItemBaseProps & OverflowItemPriorityProps:priorityandpinnedexclude each other).interface X extends OverflowItemPropsno longer compiles: extendOverflowItemBaseProps(and intersectOverflowItemPriorityPropsfor the two props).- TeachingPopover's Done calls
onFinish, thenonDismiss. Done still callsonDismissthrough 0.x, so that 0.13 code keeps working; 1.0 drops it. A handler pair that does the same work in both runs it twice on Done. - Children of TeachingPopover render. 0.13 dropped them silently; they now render in place, before the popover's own surface (the new parts are written there).
- TeachingPopover's
stepsform renders the default parts. The Close button sits in a<div class="wave-teaching-popover-header">(it keeps its class and its place at the top end), the heading, the body and the footer carrywave-teaching-popover-title,wave-teaching-popover-bodyandwave-teaching-popover-footerbefore their 0.13 part classes, and the surface and the footer carrydata-layout(horizontal). The look and every other attribute are unchanged. A selector that relies on the Close button being a child of the surface (.wave-teaching-popover > .wave-teaching-popover__close-button), on:first-child, or a test that walksdialog.firstElementChild, changes. It is the one change to an element structure of 0.13 that needs no opt-in (the others add attributes and classes), made so that a part's stable class sits on the element that takes itsclassName(C-CLASS) and thestepsform and the parts form render the same markup. - Table and DataGrid cells are positioned (
relative: the box ofTable.CellActions), and their rows are the Tailwind groupgroup/table-row. An absolutely positioned element of yours inside a cell is placed against the cell, and body cells paint over astickyheader of yours that sets noz-index(give it one). - New attributes on 0.13 markup, always rendered with their resolved value: Overflow's
data-orientation,data-overflow-directionanddata-button-position; Breadcrumb'sdata-size,data-focus-modeanddata-overflow(on the<nav>); DataGrid'sdata-selection-appearance(on the table); List'sdata-navigation-mode; the TeachingPopover surface'sdata-layout. A test that compares an element's full HTML or attribute list changes.
Added
- Overflow:
Overflow.Itempriority(items hide in ascending priority; equal priorities by direction) orpinned(never hides);overflowDirection(end,start),orientation(verticalstacks the items and measures heights; Fluent'soverflowAxis),minimumVisible,hasHiddenItems(the button is rendered before the first measurement, also in the server HTML),buttonPosition(end, the default, orbefore-hidden: the button stands just before the first hidden item, as a breadcrumb's "…" does) andonOverflowChange(hiddenItems, details)with{ visibleItems, groupVisibility }. Groups:Overflow.Item groupId,Overflow.Divider(OverflowDivider, hidden while its group is; it stretches across the row, so aToolbar.Dividerin it is drawn at the row's height),useIsOverflowGroupVisible(groupId)('visible','hidden'or'overflow') anduseHasHiddenItems().Overflow.Item asChildputs the item's props on its single element child (an<li>, a Toolbar button), and a row withrole="list"makes the button's wrapper a list item. When every item fits again while the overflow button has focus, focus moves to the first item it stood for (also in Breadcrumb'soverflow="auto"trail), not to the page. While no item setspriorityorpinned, the first item (withstart, the last) never hides, as in 0.13. TypesOverflowDirection,OverflowGroupVisibility,OverflowChangeDetails,OverflowItemBaseProps,OverflowItemPriorityProps,OverflowDividerProps. - Breadcrumb:
maxDisplayedItemsandoverflowIndex(default1) collapse the middle items into a "…" button (overflowLabel, "More items") that opens a Menu of them: aMenu.ItemLinkfor a link item (anasChildlink too, the element's ownhrefwinning; anasChildelement of a component, a router link with or without a stringhref, is rendered by that component with its own props, itsasincluded, so it navigates the way the trail's link does; a link item or anasChild<a>keeps itstarget,relanddownloadon the trail), aMenu.Itemfor a button item, disabled when the item is. The first item and the lastcurrentitem never collapse.overflow="auto"collapses by the room instead: the trail is an Overflow of its<li>s, the first and the current item pinned, and the "…" (with its own separator) stands where the hidden items were.size(small,medium,large),focusMode(tab, orarrow: one Tab stop, the arrow keys, Home and End, mirrored in RTL) anddivider(a slot;falsehides the separators). - Breadcrumb helpers, server-safe and importing nothing:
partitionBreadcrumbItems({ items, maxDisplayedItems, overflowIndex })(Fluent's rules;PartitionBreadcrumbItemsOptions,PartitionBreadcrumbItemsResult),truncateBreadcrumbLongName(content, maxLength = 30),truncateBreadcrumbLongTooltip(content, maxLength = 80)(Fluent spells ittruncateBreadcrumLongTooltip; there is no alias) andisTruncatableBreadcrumbContent(content, maxLength). - DataGrid typed columns and items:
DataGridColumngainscolumnId,compare,renderCell,renderHeaderCellandsortable(default: it hascompare), and itslabeltakes any content;createTableColumn<T>(options)(CreateTableColumnOptions; server-safe) builds one withsortableresolved.items,getRowId(default: the item's index initems) andcolumnsrender the header, the rows and their cells;DataGrid.Bodyalso takes a render function(item, index) => <DataGrid.Row>, whose rows get theirrowIdfromgetRowId. Item rows are memoised by row id, so a sort moves them without rendering them again. TypesDataGridItemsProps,DataGridItemsSortProps. - DataGrid built-in sorting: with
items, the grid orders its rows by the sorted column'scompare, also whilesortis controlled: a stable sort of a copy, and descending negatescompare, so items that compare equal keep their order in both directions. A column withoutcomparenever reorders the rows (server-sorted data).DataGrid.HeaderCell sortIconreplaces the arrow (an optional indicator:falsehides it; the glyph shows only while the column is sorted).onSortChangeandonSelectedItemsChangereceivedetails(DataGridSortChangeDetails,DataGridSelectedItemsChangeDetails). - DataGrid selection:
selectOnRowClick(a click on a row toggles it; the row'sonClickruns first, and itspreventDefault()keeps the selection; a click on a link, a button, an input or another interactive element, from a popup portaled from the row, on a header row, or one that ends a text selectio...