Skip to content

v2.11.0

Choose a tag to compare

@blvdmitry blvdmitry released this 14 Apr 22:48
· 10 commits to main since this release

Full web changelog · Documentation

npm install reshaped

PinField component

<FormControl>
  <FormControl.Label>Pin code</FormControl.Label>
  <PinField name="pin" defaultValue="2543" />
</FormControl>

We've added a new PinField component for handling one-time passwords and other numeric or alphabetic codes.
It works based on a native input element, supports controlled/uncontrolled modes and has an extensive keyboard support for managing the input focus and selection.

Toast boundaries

Based on the community request, we have added Toast rendering boundaries.
Anywhere in your application, you can wrap an area with a separate ToastProvider to make notifications render based on that area boundaries.

function Boundary() {
  const ChildComponent = () => {
    const toast = useToast();

    return (
      <Button
        onClick={() => {
          toast.show({
            text: "Notification sent",
          });
        }}
      >
        Show notification
      </Button>
    );
  };

  return (
    <View backgroundColor="neutral-faded" padding={10} width="600px" maxWidth="100%" borderRadius="medium">
      <ToastProvider>
        <ChildComponent />
      </ToastProvider>
    </View>
  );
}

Other improvements

  • Updated Commitlint, Storybook and Chromatic to the latest major versions
  • Fixed a build error caused the FormControl files naming when working with Vite
  • Updated Vite integration guide #238
  • Actionable: improved the form submission logic for the submit type buttons with a custom onClick
  • Breadcrumbs: added a disabledExpand property to render static breadcrumbs inside other clickable elements #227
  • Calendar: fixed edge cases of assigning the correct tabIndex to the day cells
  • Card: improved the padding logic to include the border width into its calculations
  • DropdownMenu: simplified the handling of keyboard and mouse click events combination
  • Modal: added overlayClassName property #229
  • Modal: improved the scrollable content handling when using swipe-to-close functionality #242
  • Pagination: added tabular number styles to avoid the page button size changes during navigation
  • Slider: added tabular number styles to avoid the tooltip size changes
  • Slider: added float values rounding #228
  • Table: removed content wrapping for the cells using the auto width
  • Tabs: added smooth transition for the Tab list fades whenever it doesn't fit into the viewport
  • Tabs: improved the selection element transition
  • Tabs: updated the triggers font-weight to medium to match other clickable elements
  • TextField: removed focus-within styles from the root elements whenever a button is focused in one of its slots
  • View: fixed dividers rendering incorrectly when nested inside React.Fragment #226
  • View: improved the padding logic to include the border width into its calculations
  • useHotkeys: added a disabled option to control the hotkeys availability based on your local state
  • useHotkeys: added a preventDefault option to automatically prevent the default behavior of the binded hotkeys
  • useHotkeys: improved the cleanup of the triggered hotkeys when pressing the meta key