0.30.0
Changes since 0.29.0:
IdentityBadge Popover (#293)
- The badge now opens a popover containing more information when clicked.
- The popover contains:
- The full address already selected (so that it can be copied).
- The “you” badge if the address corresponds to the connected account.
- A link to the account on Etherscan.
- A button to copy the address in the clipboard.
- Pressing the Escape key or focusing anything else outside of the popover will close it.
- If ToastHub is present, it will be used to display the copy confirmation.
- Also adds keyboard support for the badge itself (using ButtonBase).
Keyboard navigation
Small width (mobile)
Usage examples
<IdentityBadge
entity="0x2c9341a52cfa3f2c2554ca1803134137b9366b3c"
/>
Indicate that it is the connected account:
<IdentityBadge
entity="0x2c9341a52cfa3f2c2554ca1803134137b9366b3c"
connectedAccount
/>
Disable the toast notification:
<IdentityBadge
entity="0x2c9341a52cfa3f2c2554ca1803134137b9366b3c"
onCopy={null}
/>
Change the network type:
<IdentityBadge
entity="0x2c9341a52cfa3f2c2554ca1803134137b9366b3c"
networkType="rinkeby"
/>
AddressField (#292) 🆕✨
- Displays an Ethereum identicon alongside an Ethereum address.
- Automatically selects the input content when focused.
- Provides a button to copy the address.
- Uses the
Toast
component, if available, to confirm that the address has been copied.
Usage examples
<AddressField address="0x09ABDb7947D780FBa0807e401da812fcE3F165a7" />
Custom onCopy
handler (disables the Toast message):
<AddressField
onCopy={() => alert('Copied')}
address="0x09ABDb7947D780FBa0807e401da812fcE3F165a7"
/>
Popover: focus handling, centering, API changes (#290)
- Supports a “center” placement.
- Opening + closing transition (rather than opening only).
- Throws an error if the component is not wrapped in <Root.Provider>.
- The component closing behavior is now based on the focus rather than
the click events outside, allowing to close it e.g. when a sandboxed iframe
is clicked.
API changes:
openerRef
becomesopener
(to better reflect that it’s a DOM
element and not a React ref)left
andright
were not playing nicely with Popper.js and have been
removed.- A new prop,
visible
allows to declare the Popover element without
condition, and to let the component handle its opening / close transitions. - A new placement,
center
, has been added, and centers the Popover on
the opener element.
ButtonBase (#284) 🆕✨
This is a basic button component that does nothing except displaying a focus ring. It is useful as a base to build other button types.
ButtonIcon (#285) 🆕✨
A simple component to be used when having an icon acting as a button. Provides an active and a focus state.
IconCopy (#288) 🆕✨
Used to represent the action of copying in the clipboard.
Other changes and fixes
- The
Button
now forwards refs to the HTML element. (#289) TextInput
now has a fixed weight (40px), to align it with other components likeButton
andDropDown
. (#287)Root
now doesn’t render until the root element is ready (easier to manage from the consumer side). (#291)- A selection style has been added. (#286)
- Fix a bug preventing to use
Toast
/ToastHub
without having@babel/polyfill
in the project. (#283) - Fix a warning being displayed when a styled component was passed to
TableCell
’scontentContainer
prop, which was also the default. (#296)
Internal changes
- Remove styled-components from the dev dependencies. styled-components is a peer dependency and shouldn’t be a dependency. Doing so can be problematic when using
npm link @aragon/ui
in a project, causing two versions of styled-components to be included. (#297) - Add a custom proptype to validate components. (#296)
- Remove circular dependencies. (#298)
- Rollup: don’t analyze the bundle size in dev mode. (#299)