Skip to content

Releases

v1.1.0

Choose a tag to compare

@github-actions github-actions released this 07 Nov 15:40

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:

  1. Widened unions. PresenceStatus gains 'blocked' and 'unknown', TimePickerInvalidReason gains 'not-listed', SpinnerSize gains three sizes, ToastPosition gains 'top' and 'bottom', DismissReason and ModalOpenChangeReason gain 'parent-closed'/'focus-outside', and ToastController has three more members (updateToast, pauseToast, playToast). An exhaustive switch over one of these unions, or code that implements ToastController itself, needs the new cases.
  2. Markup. MenuButton always renders aria-expanded; RadioGroup.Item renders data-label-position and Slider renders data-orientation; a bare Skeleton is 16px tall; ToggleButton as an anchor with an href and no role no longer renders aria-pressed; a popup with the default motion is data-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.
  3. Migration codemod. chart-1 to chart-5 are 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, align and block (closes text-1, text-2 and text-5).
  • Divider takes appearance (default, subtle, strong, brand), inset and alignContent (start, center, end), with data-appearance, data-inset and, on a labelled divider, data-align-content (closes divider-1, divider-2 and divider-3). DividerAppearance is a new exported type.
  • Badge takes the ghost appearance (the color as text alone), shape (circular, rounded, square), the tiny size (a 6px dot with no content), and an icon slot with iconPosition (before, after), with data-shape and data-size and the stable class wave-badge__icon (closes badge-3, badge-4, badge-5 and badge-6). BadgeAppearance gains 'ghost', and BadgeSize ('tiny' and Size) is a new exported type.
  • CounterBadge takes the ghost appearance, shape and size (extra-small to extra-large; a dot stays 6px), with data-shape and data-size (closes counterbadge-4).
  • PresenceBadge takes the statuses blocked and unknown (each with a glyph of its own) and the outOfOffice modifier, which draws the out-of-office arrow in the status's color and names the badge ", out of office" (closes presence-1 and presence-2). PresenceStatus gains 'blocked' and 'unknown', so a switch over it that has no default needs the two cases. presence-4 is not changed: see the roadmap.
  • Buttons: shape (rounded, circular, square; default rounded) on Button, ToggleButton, MenuButton, CompoundButton and SplitButton and the Toolbar buttons, with data-shape while it is set (closes buttons-1). ToggleButton and MenuButton are polymorphic (as), with the new types ToggleButtonOwnProps and MenuButtonOwnProps (closes buttons-11). CompoundButton's secondaryText takes a slot object and the new contentContainer slot object re-elements the text column; both merge over slotProps (closes buttons-7). SplitButton menuButtonLabel={null} names the menu half by the primary action through aria-labelledby (closes buttons-14). Link takes background (default, brand, inverted; new type LinkBackground) with data-background (closes buttons-18).
  • Textarea takes resize (none, vertical, horizontal, both; default vertical; type TextareaResize) and onValueChange(value) (closes form-basic-13 and form-basic-15).
  • Select takes icon (a custom chevron drawn in a wave-select__wrapper beside the select; false hides the chevron; new classes wave-select__wrapper and wave-select__icon) and onValueChange(value), which with multiple gets the first selected value (closes form-basic-27 and form-basic-28).
  • RadioGroup and RadioGroup.Item take labelPosition (after, below; type RadioLabelPosition); orientation="horizontal" with labelPosition="below" is Fluent's horizontal-stacked (closes form-basic-20).
  • Slider takes orientation="vertical" (closes form-basic-30).
  • TimePicker takes showSeconds (value HH:mm:ss), formatTime(value), parseTime(text) and freeform (false limits the selection to listed times and reports others as the new 'not-listed' reason of TimePickerInvalidReason, with the message labels.notListed), closing timepicker-2, timepicker-4 and timepicker-5. A switch over TimePickerInvalidReason that has no default needs the new case.
  • Table and DataGrid take size ('medium', 'small' or 'extra-small'; type TableSize): it tightens the padding of cells, header cells, sort buttons and selection cells and sizes the media of Table.CellLayout, rendered as data-size (closes table-1). Table.Row takes appearance ('none', 'brand' or 'neutral'; type TableRowAppearance), the fill of a selected DataGrid row for a row of your own state, rendered as data-appearance (closes tr-1).
  • DataGrid takes focusMode ('cell', 'row' or 'none'; type DataGridFocusMode; Fluent's row_unstable is 'row', its 'composite' has no counterpart), and useGridNavigation takes the same option (GridNavigationFocusMode), rendered as data-focus-mode (closes dg-4, except 'composite'). DataGrid.Cell and DataGrid.HeaderCell take focusMode ('cell', 'group' or 'none'; type DataGridCellFocusMode): 'none' takes the cell and its widgets out of the arrow-key navigation, 'group' makes the cell its own focus target (closes dgc-1).
  • Table takes virtualWindow and Table.Body takes count with a function child that returns the row at an index: only the rows in view render, between spacer rows (new class wave-table__spacer), with aria-rowcount, aria-rowindex and data-row-index. GridNavigationModel takes an optional footerRowCount.
  • Dialog: Dialog.Content mountNode, titleAs and Dialog.Title as (a heading level, div or span; type DialogTitleElement), Dialog.Footer position, startActions, fluid and stackOnNarrow, and lightDismiss on a non-modal Dialog and Drawer (a press outside or focus leaving closes it, with the reasons outside-press and focus-outside) (closes dialog-6, dialogtitle-1, dialogactions-1, dialogactions-2).
  • Popover: onOpenChange(open, details?) with reason and event (types PopoverOpenChangeReason, PopoverOpenChangeDetails), withArrow, trapFocus, inline, closeOnScroll, appearance (neutral, brand, inverted), size, and Popover.Content role (closes popover-4, popover-5, popover-6, popoversurface-1, popoversurface-2, popoversurface-4).
  • Tooltip: relationship="inaccessible", withArrow with slotProps.beak, positioning.target, and asChild (no wrapper element) (closes tooltip-2, tooltip-4, tooltip-5, tooltip-7; tooltip-6 is covered by slotProps.content). TeachingPopover: appearance and trapFocus (closes teaching-2, teaching-4; teaching-3 is covered by positioning).
  • Menu: onOpenChange(open, details?) reports details.reason and the DOM event (types MenuOpenChangeReason, MenuOpenChangeDetails), closeOnScroll, inline and mountNode (both inherited by submenus), and id on Menu.Popover, which the trigger's aria-controls follows (closes menu-4 and menu-5). Menu items take subText (a second line that is part of the name; slotProps.subText), secondaryContent and disabledFocusable (closes menu-7, menu-8, menu-9). A touch or pen long press (600 ms) opens an openOnContext menu in browsers that fire no contextmenu (iOS Safari).
  • Nav and NavDrawer take density="small" (data-density), multiple={false} (one open category) and details on onValueChange, onItemSelect and onOpenCategoriesChange (types NavDensity, NavSelectDetails, NavCategoryToggleDetails) (closes nav-1, nav-2, nav-4). useNavDrawerToggle wires a Hamburger outside a NavDrawer.
  • chartSeries and the tokens --wave-chart-1 to --wave-chart-10 (chart1 to chart10, bg-wave-chart-N): ten categorical colors made for charts, 3:1 on background and card and 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. chartPalette is unchanged.
  • motion on the listbox popups of Combobox, Dropdown, TagPicker and TimePicker (and ListboxSurface), on the DatePicker calendar, and on AvatarGroup and AvatarGroup.Popover: these popups fade and slide like Popover (popupMotion), and the listbox stays in its popup while it exits.
  • useVirtualWindow takes measureItems: rows of different heights, with itemSize as the estimate; rows are measured, and the scroll position is corrected when a measured size differs. VirtualWindow.itemProps?(index) and the type VirtualItemProps are new. List, Listbox, Combobox and Dropdown lay out from it; DataGrid and FlatTree keep fixed rows.
  • virtualWindow on TimePicker and TagPicker (array form), with the classes wave-time-picker__spacer and wave-tag-picker__spacer. List...
Read more

v1.0.0

Choose a tag to compare

@github-actions github-actions released this 03 Nov 04:57
3943190

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:

  1. 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 ref types of the twelve controls and the required details arguments 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).
  2. ES modules only. exports["."] is { types: index.d.ts, default: index.mjs }, main is ./dist/index.mjs and module is gone; no .cjs or index.d.cts ships. require() of the package works on Node.js 22.12 and later (the engines floor, unchanged) and returns the same module as import. A TypeScript file compiled as CommonJS needs module node20 or nodenext (node16 reports TS1479), and Jest in CommonJS mode must transform the package or run in its ES modules mode.
  3. Namespaced utilities. Wave's classes are wave:flex, wave:bg-primary; your Tailwind build gets Wave's colors, type ramp and shadows as bg-wave-primary, text-wave-body-1 and shadow-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, @apply lists 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-run it 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 stable wave-* classes or data-* attributes), reveals against Wave's row groups (group-hover/table-row:: the rows carry wave:group/table-row), or the setup changes: without Tailwind, a Tailwind class in className (p-2) still removes Wave's conflicting class but nothing defines it, so use your own CSS or the new ./utilities; with ./tailwind, your @theme no 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.
  4. ref reaches the control of Checkbox, Switch, SearchBox, SpinButton, ColorSlider, AlphaSlider, ColorPicker.HexField, Combobox, Dropdown, TimePicker, DatePicker and TagPicker (its trigger, TagPicker.Input or TagPicker.Button), which lose controlRef; their root is slotProps.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 asChild and Presence around one of them now reach its control.
  5. 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-N and --wave-grey-N).
  6. Required: the details argument of the change callbacks (code that calls such a prop itself passes it) and Image.alt (Changed, Required arguments and props).
  7. Defaults and meanings: color="important" on Badge and CounterBadge is the neutral high-emphasis look (severe keeps the orange); TeachingPopover's Done calls onFinish only, never onDismiss; a TimePicker without format follows the browser's language after mounting (12-hour on the server and in the hydrating render): pass format for a fixed hour cycle.

Added

  • slotProps.root on the twelve controls whose ref moved and on RadioGroup.Item (whose <label> no ref reached), as on Input since 0.18: the root element's ref, classes, style, attributes and handlers. Your classes and style come after the component's own className and style, your handlers run first (preventDefault() skips the component's own root handlers), and the component keeps its enumerated data-* attributes, its own root props and its hidden state (hidden, inert, aria-hidden at the component's own values); a <label> root (Checkbox, Switch, RadioGroup.Item, ColorPicker.HexField) takes no htmlFor from the part, which would send its clicks to another element. Checkbox, Switch and the radio do not call your root onClick while 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 its onClick twice, 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- and stroke- 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 ./styles inside the provider; link it after ./styles and before your own CSS.
  • The namespaced theme keys in ./tailwind and ./tokens (--color-wave-*, --text-wave-*, --shadow-wave-*, with the font families, durations, curves and animations that carried wave already), for an app's own classes: bg-wave-primary, text-wave-body-1, shadow-wave-4, tw:bg-wave-primary in 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, @apply lists 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-run writes nothing, --include-shared also 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.Button is reached by TagPicker's ref when it renders in place of TagPicker.Input.
  • Development warnings (keys): MessageBar:dismiss-button-slot-object, SearchBox:dismiss-button-slot-object and Tag:dismissIcon-button-slot-object, when a dismiss or clear slot object's as is a button, which is unwrapped (see Changed); Image:alt-missing ("Image: `alt` is required. …") replaces 0.18's Image:alt, for JavaScript that leaves alt out.
  • 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 root part and the components that read a child's ref, 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...
Read more

v0.18.1

Choose a tag to compare

@github-actions github-actions released this 01 Nov 22:52

Fixed

  • The rule that a disabled control calls no onClick of 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 your onClick in every state, and so do the parts of ColorPicker and ColorPicker.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 your onClick while disabled too, and only the range inputs inside it are natively disabled. The exceptions stay those drawings (field, rail, thumb) and a disabled Option's own onClick prop. 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.mjs every checkServerImport case has 30 s per check (nine had Vitest's 5 s default), and every case that runs the whole check (verifyDist or main) 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 and ColorPicker.HexField call your onClick while the value is not a hex color, as while it is one.

v0.18.0

Choose a tag to compare

@github-actions github-actions released this 01 Nov 21:54

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

  1. 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 static Menu renders 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 its dismissIcon slot adds to it (a merged <button> or Button, the deprecated button object, an ARIA attribute of a slot object) before its class, and MessageBar's Dismiss button renders its type first. Browsers, React's hydration, Testing Library's queries and Vitest's DOM snapshots ignore the order; a test that compares raw HTML strings (renderToString output, innerHTML) changes.
  2. New development warnings, once each, for uses that 1.0 removes or changes (see Deprecated): Badge:color:important and CounterBadge:color:important (color="important", whose look changes in 1.0: pass color="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 without items, sort or defaultSort), and Menu.Popover:legacy-motion, Dialog.Content:legacy-motion, Drawer:legacy-motion and NavDrawer:legacy-motion (a className with presence variants while motion is unset). A test that spies on console.warn and renders one of these forms asserts the warning. They read process.env.NODE_ENV themselves, as createBrandTokens' ramp check does, so a production bundle drops them and their text; imported without a bundler (no process), they are skipped, while WaveUI's other warnings assume development there.
  3. Types. FieldProps['children'] widens to a function as well ((props: FieldControlProps) => ReactNode), and so does a slot object's children (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 no children (an <input> has none; any are dropped at run time), so a variable typed Slot<'input'>, whose children may now be a function, no longer fits it: type the variable CardProps['checkbox'], or write the object inline. Every props type with parts gains an optional slotProps (a polymorphic component's in its <X>OwnProps), and a few declare their own instead of inheriting one: AvatarGroupItemProps is now an interface, Avatar's props without their slotProps and with the item's own, rather than an alias of AvatarProps; the checkable menu items' props, AlphaSliderProps and NavSubItemOwnProps leave out the slotProps of the type they extend. WaveContextValue is unchanged.
  4. details.event may be the grid's own. A cell of yours that sorts or selects through useDataGridSort().setSort(sort, event?) or useDataGridSelection().toggle(id, event?) without an event reaches onSortChange and onSelectedItemsChange with an untrusted Event of type sort or select and no target (as useTableColumnSizing passes new Event('resize')), so details always comes: a handler that reads details.event.target checks it.
  5. Decided for 1.0, announced now (see Deprecated): ref placement does not change. ref reaches the root element, the one that receives className, with two exceptions that stay as they are: Input's ref reaches its <input>, also with contentBefore or contentAfter, where slotProps.root.ref reaches the bordered wrapper that takes className, and RadioGroup.Item's reaches its role="radio" button, while its className stays on its root <label>, which no ref reaches. controlRef reaches the focusable element of the controls that have one, and slotProps.<part>.ref a part. TimePicker's format will follow the locale's hour cycle, the optional details arguments become required, and so does Image.alt. WaveProvider classNames (app-wide classes per component) is not part of 1.0: it may come after it, as an addition.
  6. Everything else is opt-in: slotProps, the render-function slot children, getNativeElementProps, mergeSlotProps, Field's function child, FieldContextProvider and useFieldContext, 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; types SlotPart, SlotPartWithRef and SlotPartOwn; 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.track is slotProps.track, with the class wave-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 and ref of its element and any data-* attribute (a string, a number or a boolean), but no children, as, key or dangerouslySetInnerHTML (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 by getNativeElementProps fits a part too, and SlotPartWithRef<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: your className after the part's own classes through cn (the stable class stays first, and yours win a conflict of the same variant); your style over 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 ...
Read more

v0.17.1

Choose a tag to compare

@github-actions github-actions released this 30 Oct 06:47

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 }, by WaveProvider tokens and getTokenStyle; before, in a server-rendered style attribute such a value swallowed the declarations after it (the later overrides and your style), 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 of tokens.css, font stacks with quoted names such as 'Segoe UI Web (West European)', shadows, curves, var() with a fallback and color-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, so url(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 no url( test sees; the server read red !important as red with 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 tokens and getTokenStyle apply is trimmed, balanced CSS text without ;, {, } or url( and with no ! or backslash outside strings and comments, which the server-rendered style attribute 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 ;, {, } or url(, and without ! or a backslash outside strings and comments".

Changed

  • WaveProvider's tokens warnings (WaveProvider:tokens:name:<key> and WaveProvider:tokens:value:<key>) read process.env.NODE_ENV written out, as the full-ramp check of createBrandTokens does, so a production bundle drops them and their text, which keeps WaveProvider with Dialog within its budget with the new checks. Development builds warn as before; imported without a bundler (no process), the provider skips them. getTokenStyle's warnings are not gated this way.
  • Dev gates: verify-dist proves the gate, as it does createBrandTokens' contrast check: an import of only WaveProvider, built for production, holds no WaveProvider: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)
  • getTokenStyle grows 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: WaveProvider alone grows by 65 bytes (39 gzip) and with Dialog by 68 (31 gzip), within its budget of 73,420 and 24,843. Every other import of the 0.17.0 table, and dist/styles.css, is unchanged.

v0.17.0

Choose a tag to compare

@github-actions github-actions released this 30 Oct 03:21

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

  1. 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 the shadow-2 … shadow-64 utilities read them (@theme inline maps --shadow-N to var(--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 changes shadow-2 … shadow-64 (Tailwind's own shadow-sm … shadow-2xl are unaffected). Change a level for a theme through its token instead (.wave-dark { --wave-shadow-8: … }, or tokens={{ shadow8: … }} on a provider). On the Tailwind path an @theme of yours that sets --shadow-N keeps its value, which replaces Wave's alias; a build that read the literal shadow values from tokens.css now finds var(--wave-shadow-N) there.
  2. WaveContextValue has three new members: tokens (the merged overrides of the providers above; {} outside a provider), tokenStyle (the inline style that applies them; undefined when there is nothing to set) and applyStylesToPortals (true outside a provider). A hand-built value of the type (a test mock of useWaveTheme) adds them.
  3. TextWeight has a fourth value, 'medium' (500, font-medium), which the weight of Text, Label and InfoLabel takes: an exhaustive switch over it, or a Record<TextWeight, …> of your own, adds a case.
  4. With tokens, the provider root and the portal wrappers carry the overrides. Without tokens anywhere above, the markup is 0.16's: the root has no style attribute unless you pass one, and a portal wrapper's style holds only its position and z-index. With tokens, the root renders the --wave-* custom properties in its style, before your own style, which wins a conflicting property; a nested provider's root carries the whole merged map, also when it sets no tokens of its own; and each portal wrapper of the subtree puts the properties before its two own (unless applyStylesToPortals is false). A test that compares a whole style attribute, or a selector on [style], changes when you adopt tokens.
  5. 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 ./tailwind path your Tailwind theme gains their names: the colors palette-<hue>-tint, palette-<hue>-tint-foreground and palette-<hue>-border of the 12 hues, and the font families font-wave-mono and font-wave-numeric (see the README's Global effects). cn() treats the two font families as families, so cn('font-wave', 'font-wave-mono') keeps the last.

Added

  • WaveProvider tokens (foundation-1; WaveTokenOverrides | null; Fluent's theme prop 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: primaryForeground is --wave-primary-foreground, brand80 is --wave-brand-80, paletteRedTint, shadow8, fontFamilyMonospace, zOverlay), and a number is written as its string. theme still 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: … }; a style you 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 another theme (so set an override of a semantic color in the provider that sets the theme it was chosen for): an omitted tokens, or a key whose value is undefined, inherits. null clears 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 :root only) still reach the subtree's own elements through the cascade, so tokens={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-rendered style attribute, and the server and the client render the same overrides). The merged overrides keep their identity while their entries stay equal, so an inline tokens={{ … }} re-renders no consumer. Under a Content Security Policy that blocks inline style attributes (style-src without 'unsafe-inline'), the server-rendered overrides do not apply and hydration does not apply them again: ship them in a stylesheet there, and pass no tokens (nor getTokenStyle), 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; true by default): false keeps the tokens overrides off the portals of the subtree, those inherited from enclosing providers included. The theme classes, the direction and the wave-portal wrapper 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, like theme (Fluent's is not inherited), and since Wave's portal wrapper never carried the provider root's own look, what false drops are the overrides (Fluent's false drops 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 from getTokenStyle on <html>; under an enclosing provider's tokens the overlays lose that brand too.
  • createBrandTokens(seed) (foundation-5; types BrandStop, BrandRamp, BrandTokens): the 16 brand tokens brand10 … brand160 of one color (#rgb or #rrggbb, any case), for tokens (alone or spread with other overrides) or getTokenStyle. 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...
Read more

v0.16.0

Choose a tag to compare

@github-actions github-actions released this 29 Oct 15:55

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

  1. A DataGrid with items: selection follows the data. Select-all selects every selectable item of items, 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, and onSelectedItemsChange(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 new items do not clear it. Select-all reports the ids outside items first, then the selected ids of items in items order, so a grid that mounts sorted (defaultSort or a controlled sort) now reports them in items order, where 0.15 reported the sorted order. A grid built from DataGrid.Row children (no items) keeps the 0.15 behaviour.
  2. isSelectionDisabled(item, index) tells a grid with items which items cannot be selected, rendered or not: select-all skips them, and a rendered row takes it as the disabled of 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 a virtualWindow passes isSelectionDisabled, or select-all also selects the disabled items it does not render. A cell's own disabled still wins for its control, and a value that disagrees with isSelectionDisabled warns in development.
  3. Everything else is opt-in: windowing (useVirtualWindow, and virtualWindow on DataGrid, List, Listbox, Combobox and Dropdown), FlatTree and useFlatTree, 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.
  4. 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's itemSize tall: the components set that height on each row, item and option after its own style, and a windowed DataGrid's body cells drop their block padding and keep their text on one line, so the content must fit.
  5. Development warnings a 0.15 grid can now log: in a grid with items, a DataGrid.Row whose own rowId differs from its item's id (DataGrid.Row:row-id-mismatch), or a DataGrid.Row child of the body whose rowId is no item's id (DataGrid.Row:row-id-outside-items): select-all and its checkbox use the ids from getRowId, so such rows are outside them. Pass a getRowId that returns the rows' ids. With items, the text of DataGrid:single-several-selected says that only the first id is selected (key unchanged). A test that spies on console.warn asserts them.
  6. Types: UseGridNavigationResult has two new members, activeRowIndex and pendingRowIndex (always null without the new model option): a hand-built value of it (a test mock) adds them. ListboxOptionElementProps gains optional aria-posinset, aria-setsize and style, which an option component of yours on useListboxOption receives in a data-mode list (the position) and in a windowed list (its height): spread them, and merge style after your own. DataGridLabels gains resizeColumn and columnWidth.

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) and scrollPaddingStart (the height of a sticky header over the rows, which scrollToIndex places rows below). It returns a VirtualWindow: itemSize, scrollRef (the scrolling element's callback ref), layout(count, { keep }) (the VirtualEntry list to render, { kind: 'item', index } and { kind: 'spacer', size, key }, a pure function called during render; keep holds indexes outside the view, the focused row) and scrollToIndex(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 passive scroll listener read once per animation frame and a ResizeObserver. Pass it to a component's virtualWindow: the component lays the window out itself, since only it knows which item it must keep rendered. Merge scrollRef with your refs or destructure it (ref={virtualWindow.scrollRef} fails the React Compiler's lint). Fluent's closest counterpart is its deprecated Virtualizer; an object of your own that implements VirtualWindow (an adapter over @tanstack/react-virtual, guide) works in every component.
  • DataGrid virtualWindow (virt-1), with items and columns and 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 as scrollPaddingStart); 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 new items make the browser drop focus from a moved row, focus returns to the same row, or the rendered row nearest its place. The grid carries aria-rowcount (the items plus the header rows), every row aria-rowindex (header rows first, body rows in the sorted order) and every body row data-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 virtualWindow and count (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 carry data-index and their place in the whole list (aria-setsize and aria-posinset, or in a grid, navigationMode="composite", aria-rowcount on the list and aria-rowindex on the rows), and spacers are aria-hidden <li>s (<div>s in a grid) with wave-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; when count drops to or below the focused item, focus moves to the last item. Selection keeps the values of items that are not rendered. A s...
Read more

v0.15.0

Choose a tag to compare

@github-actions github-actions released this 28 Oct 11:59

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

  1. 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, with data-presence="exiting" (and data-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 with mockAnimations).
  2. Popover.Content, the Tooltip surface and the TeachingPopover surface mount through the presence core: they render data-presence and data-state (open, and closed while they exit), and inert while they exit. A popover named by its trigger keeps no aria-labelledby while it exits (it is inert and out of the accessibility tree then).
  3. defaultOpen surfaces 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 with appear, 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.
  4. New wrapper elements. div.wave-accordion-panel__collapse around Accordion's region; div.wave-tree-item__collapse around a Tree group; div.wave-nav-category__collapse around a Nav category's list; div.wave-drawer__collapse (and wave-nav-drawer__collapse for NavDrawer) around an inline panel; div.wave-toaster__toast-content inside each toast container. The first four are display: contents while 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 walk parentElement or nextElementSibling change. While a wrapper enters or exits it is a clipping grid of one track, whichever motion runs (the default, a motion of yours, or 0.14 classes on an inline drawer's className, 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 in className, or size="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 pass motion={null}.
  5. 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); its data-wave-toast marker, classes and attributes are unchanged. A test that reads the status text as the container's first child walks one level deeper.
  6. A className with data-[presence=…] classes on Menu.Popover, Dialog.Content, Drawer or NavDrawer keeps 0.14's behaviour while motion is 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 to motion is 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 the backdrop slot's className gets the default fade beside your classes (move them to backdropMotion). 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 a transition shorthand of yours can reset the recipe's property list, so pass <Toaster motion={null}> or move them to motion; the same holds for rules on InfoButton's and InfoLabel's note ([data-wave-infolabel-surface][data-presence=…]), where motion={null} on InfoButton or InfoLabel keeps 0.14's.
  7. TabList's selected indicator is drawn by the selected tab's ::after over a transparent 2px border (the tab's box is unchanged), the tab is relative, and every tab of the transparent appearance carries border-transparent forced-colors:border-[Canvas]. A class that recoloured the indicator through the tab's bottom (start) border targets the after: border now (after:border-b-…, vertical after:border-s-…); a border colour of yours left on the tab shows at once under the newly selected tab while the line slides there.
  8. 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>.
  9. 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).
  10. Carousel's slide curve is the easy-ease token (was Tailwind's ease-in-out), same 300 ms, and the root renders data-motion. Nav.Category's chevron turns with the easy-ease token too (was Tailwind's default curve), same 150 ms, and its transition is a motion slot (expandIconMotion): below WaveProvider motion="none" it turns at once, while Accordion's and Tree's chevrons, which have no slot, keep their transitions.
  11. 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.
  12. Types: WaveContextValue has a new member, motion (MotionPreference); a hand-built value (a test mock of useWaveTheme) adds it.
  13. New attributes, always rendered: data-presence on the new wrappers and on Popover.Content, the Tooltip surface and the TeachingPopover surface; data-state on those three surfaces; Carousel's data-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 (start and end mirrored in right-to-left layouts, left and right not) and fades, over 250, 300, 400 or 500 ms by size, 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 (a full inline drawer has no motion: its size is its container's).
    • Popover.Content, Menu.Popover and 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 transition transform, 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 entering on 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 inert element lets the pointer through) neither expands nor activates the item; Enter and a...
Read more

v0.14.1

Choose a tag to compare

@github-actions github-actions released this 27 Oct 17:22

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 controlled open, now shows defaultActiveStep (else the first step) from its first render, calls onStepChange with it once when the step was elsewhere, and announces no step change (the focused popover's name carries the position). A controlled activeStep is left as it is, and the first mount calls nothing.

v0.14.0

Choose a tag to compare

@github-actions github-actions released this 27 Oct 16:22

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

  1. DataGridColumn and DataGrid are generic over the type of the grid's items (DataGridColumn<T = unknown>, DataGridProps<T>, DataGridBaseProps<T>, DataGridBodyProps<T>); without a type argument they keep the 0.13 shape with T = unknown. A column's label widens from string to ReactNode (code that reads it as a string narrows it first), and its id is optional and deprecated, so column.id reads as string | undefined (write columnId). DataGrid has two call signatures; React.ComponentProps<typeof DataGrid> is the last one, DataGridProps<unknown>.
  2. children of DataGrid and DataGrid.Body is optional, and DataGridBodyProps['children'] may be a render function (item, index) => ReactNode (DataGridBodyProps omits the native children): code that reads it as a ReactNode handles the function.
  3. onSortChange(sort) and onSelectedItemsChange(items) get a second argument, details ({ event }, the click or key press behind the change). Exact assertions such as toHaveBeenCalledWith(sort) or a mock.calls entry compared to a one-element array need it ({ event: expect.any(Event) }). The 0.4 positional onSortChange(columnId, direction) and the deprecated onSelectionChange(keys) are unchanged.
  4. A grid with items uses the object form of onSortChange, with or without sort and defaultSort. Next to items, the positional callback and the deprecated sortColumn, sortDirection, defaultSortColumn and defaultSortDirection are type errors. At run time a positional onSortChange is called in the object form (onSortChange(sort, details)), and only the deprecated sort props are ignored, with a development warning (DataGrid:items-deprecated-sort). Pass items={data ?? []} while the data loads.
  5. 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, with data-direction, still wave-data-grid-header-cell__sort-icon) instead of 0.13's filled triangle. A test or style that reads the triangle's path or its h-3 w-3 classes changes.
  6. OverflowItemProps is a type alias of a union (OverflowItemBaseProps & OverflowItemPriorityProps: priority and pinned exclude each other). interface X extends OverflowItemProps no longer compiles: extend OverflowItemBaseProps (and intersect OverflowItemPriorityProps for the two props).
  7. TeachingPopover's Done calls onFinish, then onDismiss. Done still calls onDismiss through 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.
  8. 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).
  9. TeachingPopover's steps form 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 carry wave-teaching-popover-title, wave-teaching-popover-body and wave-teaching-popover-footer before their 0.13 part classes, and the surface and the footer carry data-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 walks dialog.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 its className (C-CLASS) and the steps form and the parts form render the same markup.
  10. Table and DataGrid cells are positioned (relative: the box of Table.CellActions), and their rows are the Tailwind group group/table-row. An absolutely positioned element of yours inside a cell is placed against the cell, and body cells paint over a sticky header of yours that sets no z-index (give it one).
  11. New attributes on 0.13 markup, always rendered with their resolved value: Overflow's data-orientation, data-overflow-direction and data-button-position; Breadcrumb's data-size, data-focus-mode and data-overflow (on the <nav>); DataGrid's data-selection-appearance (on the table); List's data-navigation-mode; the TeachingPopover surface's data-layout. A test that compares an element's full HTML or attribute list changes.

Added

  • Overflow: Overflow.Item priority (items hide in ascending priority; equal priorities by direction) or pinned (never hides); overflowDirection (end, start), orientation (vertical stacks the items and measures heights; Fluent's overflowAxis), minimumVisible, hasHiddenItems (the button is rendered before the first measurement, also in the server HTML), buttonPosition (end, the default, or before-hidden: the button stands just before the first hidden item, as a breadcrumb's "…" does) and onOverflowChange(hiddenItems, details) with { visibleItems, groupVisibility }. Groups: Overflow.Item groupId, Overflow.Divider (OverflowDivider, hidden while its group is; it stretches across the row, so a Toolbar.Divider in it is drawn at the row's height), useIsOverflowGroupVisible(groupId) ('visible', 'hidden' or 'overflow') and useHasHiddenItems(). Overflow.Item asChild puts the item's props on its single element child (an <li>, a Toolbar button), and a row with role="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's overflow="auto" trail), not to the page. While no item sets priority or pinned, the first item (with start, the last) never hides, as in 0.13. Types OverflowDirection, OverflowGroupVisibility, OverflowChangeDetails, OverflowItemBaseProps, OverflowItemPriorityProps, OverflowDividerProps.
  • Breadcrumb: maxDisplayedItems and overflowIndex (default 1) collapse the middle items into a "…" button (overflowLabel, "More items") that opens a Menu of them: a Menu.ItemLink for a link item (an asChild link too, the element's own href winning; an asChild element of a component, a router link with or without a string href, is rendered by that component with its own props, its as included, so it navigates the way the trail's link does; a link item or an asChild <a> keeps its target, rel and download on the trail), a Menu.Item for a button item, disabled when the item is. The first item and the last current item 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, or arrow: one Tab stop, the arrow keys, Home and End, mirrored in RTL) and divider (a slot; false hides 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 it truncateBreadcrumLongTooltip; there is no alias) and isTruncatableBreadcrumbContent(content, maxLength).
  • DataGrid typed columns and items: DataGridColumn gains columnId, compare, renderCell, renderHeaderCell and sortable (default: it has compare), and its label takes any content; createTableColumn<T>(options) (CreateTableColumnOptions; server-safe) builds one with sortable resolved. items, getRowId (default: the item's index in items) and columns render the header, the rows and their cells; DataGrid.Body also takes a render function (item, index) => <DataGrid.Row>, whose rows get their rowId from getRowId. Item rows are memoised by row id, so a sort moves them without rendering them again. Types DataGridItemsProps, DataGridItemsSortProps.
  • DataGrid built-in sorting: with items, the grid orders its rows by the sorted column's compare, also while sort is controlled: a stable sort of a copy, and descending negates compare, so items that compare equal keep their order in both directions. A column without compare never reorders the rows (server-sorted data). DataGrid.HeaderCell sortIcon replaces the arrow (an optional indicator: false hides it; the glyph shows only while the column is sorted). onSortChange and onSelectedItemsChange receive details (DataGridSortChangeDetails, DataGridSelectedItemsChangeDetails).
  • DataGrid selection: selectOnRowClick (a click on a row toggles it; the row's onClick runs first, and its preventDefault() 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...
Read more