Skip to content

Releases: segmentio/evergreen

3.1.2

17 May 18:41
Compare
Choose a tag to compare

Fixes the selectors of the selectable rows and tabs that was causing some states to improperly show. #189.

3.1.1

17 May 18:39
Compare
Choose a tag to compare

Fixes minor positioning issues: #188. Positioning is still broken in this release. Please upgrade to v3.1.4.

3.1.0

17 May 18:36
Compare
Choose a tag to compare

Adds Select Menu Detail View #184.

3.0.1

17 May 18:34
Compare
Choose a tag to compare

Fix Popover Mobile Positioning #182

3.0.0 Interaction Pattern Stability

28 Mar 22:15
474b12b
Compare
Choose a tag to compare

The main update in this release are improvements and API consistency across interaction patterns as well as documentation for the affected components.

High Level Improvements

  • Documentation for Side Sheet, Popover, Corner Dialog, Combobox and Tooltip
  • Popover/Positioner now has configurable positions with newly exported Position object.
  • Popover positioning now auto updates with requestAnimationFrame.
  • Positioner now uses <React.Fragment> instead of arrays and keys.
  • Improved design and API for Corner Dialog
  • Improved focus management and keyboard accessibility for Overlay and Popover.
  • Consistent show API for interaction patterns isShown, onCloseComplete and onOpenComplete.
  • Documented prop types for Positioner

Components with Breaking Changes

No Breaking Changes

  • Combobox
  • Tooltip

Upgrade Notes

Link

  • Link is now green by default
  • Link has a underline by default
  • Link has focus styles

Side Sheet

Side Sheet doesn't spread Overlay.propTypes anymore, and instead offers a simpler API for the transition lifecycle. Instead of relying on the onExited and onEntered API from Overlay — the Side Sheet now implemented onCloseComplete and onOpenComplete instead. This change in API is in line with the Dialog API and the updated Popover API.

  • Removed spread of Overlay.propTypes (onHide, onExit, onExiting, onExited, onEnter, onEntering, onEntered props).
  • Added onCloseComplete prop. Function that will be called when the exit transition is complete.
  • Added onOpenComplete prop. Function that will be called when the enter transition is complete.

Before

<SideSheet
  isShown={state.isShown}
  onExited={() => setState({ isShown: false })}
  onEntered={() => console.log('entered')}
>{...}</SideSheet>

After

<SideSheet
  isShown={state.isShown}
  onCloseComplete={() => setState({ isShown: false })}
  onOpenComplete={() => console.log('entered')}
>{...}</SideSheet>

Positioner

The Positioner is a mainly private component within Evergreen and is used in Popover — which is used in Select Menu.

  • Removed array returns with keys in favor of <React.Fragment/>
  • The key is no longer passed down in the children.
  • Positioner now auto updates, which means it is more reliable when resizing and inside scrollable containers.
  • Positioner now allows for more positions. (see Position Object)
  • useSmartPositioning prop is deprecated. Smart positioning is not opt-out anymore.

Position Object

Evergreen now exports a Position object that is used for the Positioner (and Popover/Select Menu) to have more flexibility.

import { Position } from 'evergreen-ui'

// Available positions
Position.TOP
Position.TOP_LEFT
Position.TOP_RIGHT
Position.BOTTOM
Position.BOTTOM_LEFT
Position.BOTTOM_RIGHT

This would be used as such:

<Popover content={<PopoverContent />} position={Position.TOP_LEFT}>
  <Button>TOP_LEFT</Button>
</Popover>

Popover

The API for the Popover has breaking changes in normal usage.

  • Renamed isOpen into isShown.
  • Deprecated side prop in favor of position prop
  • Added position prop using the Position object.
  • Added onCloseComplete and onOpenComplete transition lifecycle props.
  • onOpen and onClose props still exist.
  • Added bringFocusInside prop with default `true.
  • Popover no longer spread the Positioner props.

Focus Management Improved

The Popover previously didn't have any focus management build in, in this release the Popover adds better focus handling.

When opening the Popover, focus will be brought inside the Popover by looking for elements with [autofocus] first, [tabindex] second and for button elements last.

When passing a node as the Popover children, the Popover will handle focus management automatically when closing the Popover. When closing, it will return back focus on the target if nothing else has focus.

Corner Dialog

This component has changed drastically from it's previous usage. It is almost the same as the Dialog component at this point.

  • Design is updated.
  • onCloseComplete and onOpenComplete transition lifecycle events added.
  • Removed onHide, onExit, onExiting, onExited, onEnter, onEntering, onEntered props.
  • Removed height prop.
  • Removed hasCloseIcon prop.
  • Added hasFooter prop.
  • Added hasHeader prop.
  • Added onConfirm prop.
  • Added confirmLabel prop.
  • Added hasCancel prop.
  • Added onCancel prop.
  • Added cancelLabel prop.

New Design

image

Simple Usage Example

<CornerDialog
  title="Welcome to This New Feature"
  isShown={state.isShown}
  onCloseComplete={() => setState({ isShown: false })}
>
  The Corner Dialog component is used for new feature announcements
  and feedback requests from the user.
</CornerDialog>

Radio + Radio Group

The Radio Group has been dramatically changed. The Radio is pretty much the same.

Radio Group

The Radio Group component is now similar to the API of the Segmented Control.

  • Removed items prop in favor of options prop.
  • Added defaultValue prop.
  • Added value prop.
  • label prop now adds a label to the group.
  • Tweaks to the spacing.
  • When using size={16} the text size is now 400 instead of 300.
  • Added isRequired prop.
  • Added size prop.

Radio

  • Added isRequired prop.
  • Removed appearance prop. There is currently only one appearance.

Overlay

The Overlay is mainly a private component, but has some improvements in functionality — it is most visibly seen in the Side Sheet and the Dialog in terms of focus management.

  • Overlay brings in focus inside of the overlay on open.
  • Overlay brings back focus to the last item that was active when triggering the Overlay.

Autocomplete

  • No longer requires a key to work because of the updated Positioner.

Tooltip

Most basic usage shouldn't be affected by these changes.

  • Removed tooltipProps.
  • Added position prop, default is Position.BOTTOM.
  • Added hideDelay prop. Time in ms before hiding the Tooltip.
  • TooltipStateless now uses Paragraph instead of Text.

Combobox

  • Changed default width from 224 to 240
  • Added placeholder prop. The placeholder text when there is no value present.

2.2.0

07 Mar 20:11
v2.2.0
Compare
Choose a tag to compare

New features

Added an extractStyles() function to make server side rendering super easy. Checkout the ssr-next example app to see how to use it with Next.js.

Bug fixes

  • Fix a broken propType in TextInput (#145)
  • Fix a missing defaultProp for appearance in IconButton (#145)
  • Fix a broken propType in SegmentedControl (#146)
  • Fix mistyped spellCheck prop in Textarea (#146)

2.1.0

27 Feb 05:08
v2.1.0
Compare
Choose a tag to compare

New features

  • Add toasts (toaster) (#142)

Bug fixes

  • Making SearchInput width-aware (#143)
  • select-menu: fix Option rendering (#141)

2.0.1

20 Feb 20:48
v2.0.1
Compare
Choose a tag to compare

Bug fixes

  • Fix the InlineAlert export.

2.0.0

20 Feb 20:44
v2.0.0
Compare
Choose a tag to compare

Breaking changes

ui-box (which provides Evergreen՚s CSS prop API) was upgraded to version 1.0 which introduces a couple of breaking changes. See https://github.com/segmentio/ui-box/releases/tag/v1.0.0 for more details (the first two breaking changes are the main ones to look out for).

The <Dialog> API has received a major overhaul that introduces a number of breaking changes. See #134 for details.

New features

  • Added an isLoading prop to <Button> which disables the button and shows a spinner inside it.
  • Add an <InlineAlert> component which is a simpler version of <Alert> that doesn't have a wrapping card or a title.
  • The <Alert> title is now bold so that it stands out from the body text.

1.2.1

13 Feb 18:20
v1.2.1
Compare
Choose a tag to compare

Bug fixes

  • Fix Button CSS proptype order (#133).