Skip to content

Latest commit

 

History

History
462 lines (324 loc) · 16.2 KB

v1.6.7.mdx

File metadata and controls

462 lines (324 loc) · 16.2 KB
title description releaseUrl releaseDate version
Version 1.6.7
Explore the changelog for Chakra UI version 1.6.7. Learn about the latest features, bug fixes, and improvements.
August 29, 2021
1.6.7

Minor Changes

  • 28af4c030 #4595 Thanks @margalit! - - Added an enabled prop to the useOutsideClick hook to conditionally attach event handlers.

    • Updated the useMenu hook to only enable the useOutsideClick hook when the menu is open.

Minor Changes

  • 01c913309 #4611 Thanks @segunadebayo! - Add new helpers to the theme-tools package to make the process of creating component themes less cumbersome.

    • cssVar - function to create css vars
    • calc - function that makes it easy to create the css calc string
    • anatomy- function to define and extend component parts

    Creating a CSS variable in the theme

    import { cssVar, calc } from "@chakra-ui/theme-tools"
    
    const $width = cssVar("slider-width")
    const $height = cssVar("slider-height")
    
    const $diff = calc($width)
      .subtract($height)
      .toString()
    
    $width.variable // => '--slider-width'
    $width.reference // => 'var(--slider-width)'

    Create a component anatomy

    import { anatomy }  from "@chakra-ui/theme-tools"
    import type { PartsStyle } from "@chakra-ui/theme-tools"
    
    const btn = anatomy("button").parts("label", "container")
    
    const newBtn = btn.extend("icon") //  extend button to include icon part
    
    // Using the anatomy in component theme
    const baseStyle: PartsStyle<typeof newBtn> = {
      // auto-complete for the component parts
      icon: {...},
      label: {...}
    }

    Added PartsStyleObject and PartStyleFunction types for easy creation of type-safe, multipart component styles.

Patch Changes

Patch Changes

Patch Changes

Patch Changes

Patch Changes

Patch Changes

Patch Changes

Patch Changes

Patch Changes

Patch Changes

Patch Changes

Patch Changes

Patch Changes

Patch Changes

Patch Changes

Patch Changes

Patch Changes

Patch Changes

Patch Changes

Patch Changes

Patch Changes

Patch Changes

Patch Changes

Patch Changes

Patch Changes

Patch Changes

Patch Changes

Patch Changes

Patch Changes

Patch Changes

Patch Changes

Major Changes

Minor Changes

  • e3bad39bc #4615 Thanks @shubhsk88! - - Included the example in Tooltip for forwardref
    • Automate the changelog generation process

Patch Changes

Patch Changes