Upgrading from version 8 to version 9 includes handling both breaking changes and deprecated components. To ensure that existing code functions correctly with v9, it is essential to address the breaking changes. Managing the deprecated components can be deferred as a subsequent task to prepare for v10, where these components will be completely removed.
The theme object, along with its utility functions, introduce a minimal set of breaking changes for Garden version 9. It is important to proceed with caution when upgrading each Garden package individually. To begin a v9 migration, these initial steps must be taken before upgrading individual packages:
- All existing v8 packages must be set to v8.75.0 or higher in order to complete a successful individual package migration to v9.
- Since
@zendeskgarden/react-theming
is central to all Garden packages, it must be updated to v9 first. Detailed theming upgrade instructions are provided under the breaking changes section.
Garden has transitioned from utilizing Popper to adopting the enhanced Floating UI library. In the past, Popper's modifiers were directly accessible as component props, creating a rigid dependency that hindered updates to the positioning library. To address this, these properties have been removed since Floating UI is designed to intuitively handle component positioning in the majority of scenarios. Should you find yourself in need of specific functionality provided by the former modifiers, we encourage you to file an issue, making sure to mention the relevant Floating UI middleware for clarity. Garden will consider additional positioning prop support on a case-by-case basis.
-
Garden v9 packages use
styled-components
version range^5.3.1
.react-theming@v9
uses version range^4.2.0 || ^5.3.1
to supportv8
tov9
upgrades.
-
Garden v9 upgraded from
react-merge-refs
v1 to v2.- The breaking change exports ESM only.
- Build and test pipelines may need to be updated to account for the
.mjs
extension. See Garden's jest.config.js for details.
-
The following breaking changes are listed alphabetically by package. While individual packages can be upgraded one at a time, @zendeskgarden/react-theming must be upgraded first.
- The following React component prop types have changed:
- Removed
IItem
type export. UseITimelineItemProps
instead. IStepperLabelProps['icon']
:ReactNode
->ReactElement
ITimelineItemProps['icon']
:ReactNode
->ReactElement
- Removed
- Removed
ButtonGroup
: UI no longer recommended by Garden - Removed
IIconProps
type export. UseIButtonStartIconProps
orIButtonEndIconProps
instead. Anchor
: renders with an underline for improved accessibility. The same treatment applies to<Button isLink>
. The default can be removed with<Anchor isUnderlined={false}>
for word-wrapped or redundant UI where the underline is considered to be a visual distraction. While technically not a breaking change, the migration guide highlights this change for upgrade cases that may render unexpected styling.
- Removed
Sidebar
andSubnav
: UI no longer recommended by Garden - Removed
PRODUCT
type export. UseIHeaderItemProps['product']
instead. - Removed
hasFooter
prop forBody
(no replacement needed) - Removed
message
andconnect
values fromproduct
prop inHeader.Item
andNav.Item
Typings have been updated accordingly - The following React component types have changed:
- Removed
IBodyProps
type export. Header.ItemIcon
:HTMLAttributes<HTMLElement>
->SVGAttributes<SVGElement>
Nav.ItemIcon
:HTMLAttributes<HTMLElement>
->SVGAttributes<SVGElement>
- Removed
- Added
Nav.List
as a semantic wrapper forNav.Item
. See the README for details.
Colorpicker
: renamed toColorPicker
ColorpickerDialog
: renamed toColorPickerDialog
- removed
popperModifiers
prop (see note)
- removed
ColorSwatch
- The new
name
prop is required because the refactored component is now backed by a native radio or checkbox group. - Removed
rowIndex
,colIndex
,defaultRowIndex
, anddefaultColIndex
. For the sake of accessibility, focus state should not be exposed or controlled.
- The new
ColorSwatchDialog
- same breaking changes as
ColorSwatch
. popperModifiers
prop (see note)
- same breaking changes as
- Removed
GardenPlacement
type export. UseIDatePickerProps['placement']
instead. Datepicker
: renamed toDatePicker
- removed
eventsEnabled
prop (no longer exposed by Floating UI) - removed
popperModifiers
prop (see note)
- removed
DatepickerRange
: renamed toDatePickerRange
- Use this package if you were using
@zendeskgarden/react-drag-drop
inv8
- Use this package if you were using
@zendeskgarden/react-dropdowns.next
inv8
- The
v8
version of@zendeskgarden/react-dropdowns
is no longer maintained and is renamed to@zendeskgarden/react-dropdowns.legacy
inv9
- The
Combobox
Option
no longer accepts an object type for thevalue
prop. Use string values for stable comparison.- Removed
label
prop fromOptGroup
. Uselegend
instead.
Menu
- value
auto
is no longer valid for thefallbackPlacements
prop. - new
restoreFocus
prop (default:true
) returns focus to trigger after menu interaction. When menu expansion is controlled to allow multiple item selection, setrestoreFocus={false}
and manage trigger focus manually on close.
- value
- Removed
MultiThumbRange
: UI no longer recommended by Garden - The following types have changed:
- removed
IFieldProps
- removed
IIconProps
. UseIFauxInputStartIconProps
orIFauxInputEndIconProps
instead. IMediaInputProps['start']
:any
->ReactElement
IMediaInputProps['end']
:any
->ReactElement
- removed
- Exported constants prefixed with
ARRAY_
no longer have a prefix. - The following types have been removed:
ALIGN_ITEMS
,ALIGN_SELF
,DIRECTION
,JUSTIFY_CONTENT
,TEXT_ALIGN
,GRID_NUMBER
,BREAKPOINT
,SPACE
, andWRAP
DrawerModal
: renamed toDrawer
TooltipModal
: renamed toTooltipDialog
- removed
popperModifiers
prop (see note)
- removed
- Removed internal
useFocusVisible
hook for bothModal
andDrawer
. For non-Garden modal content that still depends on the polyfill for focus styling, either:- Use updated
:focus-visible
styling provided by thefocusStyles
andgetFocusBoxShadow
theming utilities, or - Use @zendeskgarden/container-focusvisible to restore the polyfill
- Use updated
- Removed
GARDEN_PLACEMENT
type export. UseITooltipDialogProps['placement']
instead.
- The following types have changed:
- removed
ToastPlacement
. UseIToastOptions['placement']
instead. - removed
ToastContent
. UseIToast['content']
instead.
- removed
Pagination
: renamed toOffsetPagination
- changed type export from
HTMLAttributes<HTMLUListElement>
toHTMLAttributes<HTMLElement>
- removed
transformPageProps
prop - added
labels
prop
- changed type export from
- Renamed
PAGE_TYPE
type export toPageType
- Removed
isHovered
,isActive
, andisFocused
props fromTable.OverflowButton
- The default
theme
object has removed values forcolors.background
andcolors.foreground
. Use the'background.default'
and'foreground.default'
variables together with the v9getColor
utility instead. - The theming
palette
has undergone a comprehensive redesign and now includes enhanced support for both light and dark modes. To facilitate a smoother transition, we have introduced a temporary utility,getColorV8
, which is deprecated. This utility enables the application of the legacy version 8 color scheme to custom components that are not part of the Garden framework. It is recommended to utilize this stopgap measure until such components can be updated to leverage the full capabilities of v9getColor
. - Removed the
theme
default prop from all components. Garden components must be nested within<ThemeProvider>
to receive thetheme
object and render successfully. - Removed
focusVisibleRef
prop (and the resulting scoping<div>
) from<ThemeProvider>
. Current browser support obviates the need for a:focus-visible
polyfill. - Removed
message
andconnect
values fromPALETTE.product
- Utility function
getColor
has been refactored with a signature that supports v9 light/dark modes. Replace usage withgetColorV8
until custom components can be upgraded to utilize the newgetColor
function. - Utility functions
getFocusBoxShadow
andfocusStyles
no longer takehue
,shade
,spacerHue
, orspacerShade
parameters. Use thecolor
orshadeColor
parameters instead. The new object parameters take the shape of refactoredgetColor
. - Utility function
getDocument
has been removed. UseuseDocument
instead. - Utility function
isRtl
has been removed. Useprops.theme.rtl
instead. - Utility function
withTheme
has been removed. Usestyled-components
useTheme instead. - The following exports have changed:
- removed
retrieveTheme
. UseretriveComponentStyles
instead. - constants prefixed with
ARRAY_
no longer have a prefix.
- removed
- The following types have changed:
- renamed
ARROW_POSITION
toArrowPosition
- renamed
MENU_POSITION
toMenuPosition
- renamed
Tooltip
- removed
eventsEnabled
prop (no longer exposed by Floating UI) - removed
popperModifiers
prop (see note)
- removed
CodeBlock
: Thelanguage
set has been reduced from 32 to 13, for a significant decrease in bundle size. If you encounter any essential languages that are missing, please create an issue. Garden will evaluate incorporating any business-critical languages.- The following React component types have changed:
Span.Icon
:HTMLAttributes<HTMLElement>
->SVGAttributes<SVGElement>
Span.StartIcon
:HTMLAttributes<HTMLElement>
->SVGAttributes<SVGElement>
- This package has been removed.
- Migrate to
@zendeskgarden/container-utilities
and@zendeskgarden/react-theming
to continue receiving updates.
The following subcomponents have been renamed to streamline imports and improve affinity with their parent components. The deprecated exports will be removed in a future major release. Use the following mappings to update subcomponent properties.
FooterItem
->Footer.Item
HeaderItem
->Header.Item
HeaderItemIcon
->Header.ItemIcon
HeaderItemText
->Header.ItemText
HeaderItemWrapper
->Header.ItemWrapper
NavItem
->Nav.Item
NavItemIcon
->Nav.ItemIcon
NavItemText
->Nav.ItemText
Hint
->Field.Hint
Label
->Field.Label
Message
->Field.Message
Hint
->Field.Hint
Label
->Field.Label
Message
->Field.Message
Col
->Grid.Col
Row
->Grid.Row
Body
->Modal.Body
Close
->Modal.Close
Footer
->Modal.Footer
FooterItem
->Modal.FooterItem
Header
->Modal.Header
Close
->Alert.Close
,Notification.Close
Paragraph
->Alert.Paragraph
,Notification.Paragraph
,Well.Paragraph
Title
->Alert.Title
,Notification.Title
,Well.Title
Body
->Table.Body
Caption
->Table.Caption
Cell
->Table.Cell
GroupRow
->Table.GroupRow
Head
->Table.Head
HeaderCell
->Table.HeaderCell
HeaderRow
->Table.HeaderRow
OverflowButton
->Table.OverflowButton
Row
->Table.Row
SortableCell
->Table.SortableCell
Tab
->Tabs.Tab
TabList
->Tabs.TabList
TabPanel
->Tabs.TabPanel
Paragraph
->Tooltip.Paragraph
Title
->Tooltip.Title