|
21 | 21 | - [Removed: onEscapeKeyDown](#removed-onescapekeydown) |
22 | 22 | - [Added: `ariaLabel`](#added-arialabel-1) |
23 | 23 | - [Renamed: Modal.Dialog.Close and Modal.CloseButton](#renamed-modaldialogclose-and-modalclosebutton) |
| 24 | + - [ListItem, TooltipLinkList and TooltipMessage are deprecated](#listitem-tooltiplinklist-and-tooltipmessage-are-deprecated) |
| 25 | + - [Tooltip Component API Changes](#tooltip-component-api-changes) |
| 26 | + - [Renamed: tooltipRef](#renamed-tooltipref) |
| 27 | + - [Removed: arrowProps and withArrows](#removed-arrowprops-and-witharrows) |
| 28 | + - [Removed: placement](#removed-placement) |
| 29 | + - [Changed type: color](#changed-type-color) |
| 30 | + - [WithPopover Component Added](#withpopover-component-added) |
| 31 | + - [WithTooltip Component API Changes](#withtooltip-component-api-changes) |
| 32 | + - [Removed: trigger](#removed-trigger) |
| 33 | + - [Added: triggerOnFocusOnly](#added-triggeronfocusonly) |
| 34 | + - [Renamed: startOpen](#renamed-startopen) |
| 35 | + - [Removed: svg, strategy, withArrows, mutationObserverOptions](#removed-svg-strategy-witharrows-mutationobserveroptions) |
| 36 | + - [Removed: hasChrome](#removed-haschrome) |
| 37 | + - [Removed: closeOnTriggerHidden, followCursor, closeOnOutsideClick](#removed-closeontriggerhidden-followcursor-closeonoutsideclick) |
| 38 | + - [Removed: interactive](#removed-interactive) |
| 39 | + - [Other changes](#other-changes) |
| 40 | + - [WithTooltipPure and WithTooltipState are removed](#withtooltippure-and-withtooltipstate-are-removed) |
24 | 41 | - [From version 8.x to 9.0.0](#from-version-8x-to-900) |
25 | 42 | - [Core Changes and Removals](#core-changes-and-removals) |
26 | 43 | - [Dropped support for legacy packages](#dropped-support-for-legacy-packages) |
@@ -649,6 +666,65 @@ Modal elements must have a title to be accessible. Set that title through the ma |
649 | 666 | The `Modal.Dialog.Close` component and `Modal.CloseButton` components are replaced by `Modal.Close` for consistency with other components. You may call `<Modal.Close />` for a default close button, or `<Modal.Close asChild>...</Modal.Close>` to wrap your own custom button. |
650 | 667 |
|
651 | 668 | The `Modal.Close` component no longer requires an `onClick` handler to close the modal. It will automatically close the modal when clicked. If you need to perform additional actions when the close button is clicked, you can still provide an `onClick` handler, and it will be called in addition to closing the modal. |
| 669 | +#### ListItem, TooltipLinkList and TooltipMessage are deprecated |
| 670 | + |
| 671 | +The ListItem and TooltipLinkList components were used in Storybook to make menus, and TooltipMessage to make message popovers. However, WithTooltip does not support keyboard interactions, so these components were not accessible. |
| 672 | + |
| 673 | +These components are now deprecated and will be removed in future versions. To replace TooltipMessage, replace WithTooltip with WithPopover, and use Popover as a base component for your popovers. To replace ListItem and TooltipLinkList, a dedicated menu component will be introduced in a future version, and Popover can be used in the meantime. |
| 674 | + |
| 675 | +#### Tooltip Component API Changes |
| 676 | + |
| 677 | +##### Renamed: tooltipRef |
| 678 | +Tooltip's `ref` prop is now named `ref` for consistency. |
| 679 | + |
| 680 | +##### Removed: arrowProps and withArrows |
| 681 | +The `arrowProps` and `withArrows` props were not used in Storybook, so they have been removed. |
| 682 | + |
| 683 | +We recommend you do not use arrows in your addon tooltips for better consistency with the Storybook UI. |
| 684 | + |
| 685 | +##### Removed: placement |
| 686 | +The `placement` prop was passed to help position the arrow. It has also been removed. WithToolip now entirely handles the placement of its tooltip on its own. |
| 687 | + |
| 688 | +##### Changed type: color |
| 689 | +The `color` prop used to accept arbitrary colors and theme background color names. This made it difficult to use. |
| 690 | + |
| 691 | +The prop was to the background color of the tooltip, and it was not possible to set the text color in a consistent fashion. To ensure Tooltip uses accessible colors, the prop has been limited to the following values: `'default'`, `'inverse'`, `'positive'`, `'negative'`, `'warning'` and `'none'`. The prop now controls both background and foreground colors. |
| 692 | + |
| 693 | +#### WithPopover Component Added |
| 694 | + |
| 695 | +The WithPopover component acts as a counterpoint to WithTooltip. When you want an interactive overlay with buttons or inputs, use WithPopover and Popover. When you want a static overlay that shows on focus or hover, use WithTooltip with TooltipNote or Tooltip. |
| 696 | + |
| 697 | +WithPopover is based on react-aria. It must have a single child that acts as a trigger. This child must have a pressable role (can be clicked or pressed) and must be able to receive React refs. Wrap your trigger component in `forwardRef` if you notice placement issues for your popover. |
| 698 | + |
| 699 | +#### WithTooltip Component API Changes |
| 700 | + |
| 701 | +##### Removed: trigger |
| 702 | +The `trigger` prop was removed to enforce better accessibility compliance. WithTooltip must not be triggered on click, as it is not reachable by keyboard. Buttons that open a popover, menu or select must use appropriate components instead. |
| 703 | + |
| 704 | +#### Added: triggerOnFocusOnly |
| 705 | +The `triggerOnFocusOnly` prop was added. When set, tooltips will only show on focus. Use this to provide keyboard navigation hints to keyboard users. Do not use it for other purposes. |
| 706 | + |
| 707 | +#### Renamed: startOpen |
| 708 | +The `startOpen` prop was renamed `defaultVisible` to match naming in other components that expose both controlled and uncontrolled visibility. |
| 709 | + |
| 710 | +#### Removed: svg, strategy, withArrows, mutationObserverOptions |
| 711 | +These prop were not used inside Storybook and have been removed. |
| 712 | + |
| 713 | +#### Removed: hasChrome |
| 714 | +The `hasChrome` prop was removed because it should be handled by the tooltip being shown instead. Popover and Tooltip both have a `hasChrome` prop. TooltipNote never needs this prop and does not have it. |
| 715 | + |
| 716 | +#### Removed: closeOnTriggerHidden, followCursor, closeOnOutsideClick |
| 717 | +The `closeOnTriggerHidden`, `followCursor` and `closeOnOutsideClick` prop has been removed. WithTooltip will now authoritatively decide when and where to show or hide its tooltip. It will always close on clicks outside the tooltip, because tooltips should never be modal. |
| 718 | + |
| 719 | +#### Removed: interactive |
| 720 | +Thed `interactive` prop has been removed as it does not align with our vision for accessible components with a well-defined role. Use WithPopover instead of WithTooltip to show interactive overlays. |
| 721 | + |
| 722 | +##### Other changes |
| 723 | +The underlying implementation was switched from Popper.js to react-aria. Due to these changes, WithTooltip must now have a single child that has a focusable role and that can receive React refs. Wrap your trigger component in `forwardRef` if you notice placement issues for your tooltip. |
| 724 | + |
| 725 | +#### WithTooltipPure and WithTooltipState are removed |
| 726 | + |
| 727 | +Instead, use WithTooltip. For a controlled tooltip, use the `onVisibleChange` and `visible` props. For an uncontrolled tooltip with a default open state, use the `defaultVisible` prop. |
652 | 728 |
|
653 | 729 | ## From version 8.x to 9.0.0 |
654 | 730 |
|
|
0 commit comments