Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@teste-ui/utils

teste-ui13MIT2.0.4TypeScript support: included

Common utilities and types for Chakra UI

readme

Utilities

Shared Vanilla TS/JS utilities for various Chakra UI components and packages.

This is an internal utility, not intended for public usage.

Installation

yarn add @teste-ui/utils

changelog

Change Log

2.0.4

Patch Changes

  • #6301 c11743b47 Thanks @effectivetom! - Fix incorrect breakpoint calculation which excluded some viewport widths from media query coverage

2.0.3

Patch Changes

2.0.2

Patch Changes

2.0.1

Patch Changes

2.0.0

Major Changes

2.0.0-next.2

Major Changes

2.0.0-next.1

Major Changes

2.0.0-next.0

Major Changes

1.10.4

Patch Changes

  • e1fe48cbe Thanks @TimKolberger! - Bumped patch version for every package to fix release process. Root cause was a bug in our CI configuration.

1.10.3

Patch Changes

1.10.2

Patch Changes

1.10.1

Patch Changes

  • #5502 24b4333d0 Thanks @nikolovlazar! - Fixing a bug that happens when using the useCheckboxGroup hook with number values instead of string values

1.10.0

Minor Changes

  • #5316 1537a725f Thanks @TimKolberger! - Add helper function flatten

    import { flatten } from "@teste-ui/utils"
    
    flatten({ space: [0, 1, 2, 4, 8, 16, 32] })
    /** =>
    {
      "space.0": 0,
      "space.1": 1,
      "space.2": 2,
      "space.3": 4,
      "space.4": 8,
      "space.5": 16,
      "space.6": 32,
    }
    */

1.9.1

Patch Changes

  • #5075 b28142946 Thanks @cschroeter! - Update babel config to transpile soruces for older browsers. This fixes issues with CRA and Storybook.

1.9.0

Minor Changes

  • #4991 6095eaf9a Thanks @segunadebayo! - Update build system we use from a custom babel cli setup to preconstruct.

    The previous build system transpiles the code in src directory to dist/esm and dist/cjs keeping the same file structure. The new build system merges all files in src and transpiles to a single esm and cjs file.

    Potential Breaking Change: The side effect of this is that, if you imported any function, component or hook using the undocumented approach like import { useOutsideClick } from "@teste-ui/hooks/dist/use-outside-click", you'll notice that the this doesn't work anymore.

    Here's how to resolve it:

    `jsx live=false // Won't work 🎇 import { useOutsideClick } from "@teste-ui/hooks/dist/use-outside-click"

    // Works ✅ import { useOutsideClick } from "@teste-ui/hooks" `

    If this affected your project, we recommend that you import hooks, functions or components the way it's shown in the documentation. This will help keep your project future-proof.

1.8.4

Patch Changes

1.8.3

Patch Changes

1.8.2

Patch Changes

1.8.1

Patch Changes

1.8.0

Minor Changes

Patch Changes

  • d0f50a46e Thanks @segunadebayo! - PanSession class

    • Add velocity data to pointer pan event
    • Add onSessionStart to pan event handlers

1.7.0

Minor Changes

1.6.0

Minor Changes

  • 0974e547c Thanks @segunadebayo! - Add lazy content utility for disclosure components like popover, menu, tab, etc.

  • 59ea894a7 #3836 Thanks @segunadebayo! - - Add pan session class to handle pan gestures. This is used in the slider logic and sharable with vue library.

    • Perf: Throttle pan move events to once per frame which improves the slider's onChange call performance.

    • Update types for internal pointer event

1.5.2

Patch Changes

1.5.1

Patch Changes

  • 1a04a41bd Thanks @segunadebayo! - Update import of shared utils from react-utils to utils

  • e481ba491 Thanks @segunadebayo! - - Extract functions from react-utils back to utils package

    • Remove withFlushSync function in favor of using a microtask callback
    • Import types for warn function

1.5.0

Minor Changes

  • a58b724e9 Thanks @segunadebayo! - Add withFlushSync function wrapper to help resolve concurrent mode and onFocus state issues.

    This is a temp fix until the issue is fixed in React.

  • b724a9dd9 #3674 Thanks @codebender828! - Extract all React based utilities and types into @teste-ui/react-utils

1.4.0

Minor Changes

  • e748219f3 Thanks @segunadebayo! - ### Pointer Events

    Add unified pointer event management utils and hook for interal use only.

    The hook is called usePointerEvent, it works pretty similar to useEventListener except that does two things:

    • Unifies the pointer event system and ensure that only one of onMouse*, onTouch*, or onPointer* handler runs
    • Provide event information about the pointer event like x and y position depending on the pointer type.

    Credits to framer-motion for doing the hard work for this utilities

    • Added useFocusOnPointerDown to get Safari to detect the correct event.relatedTarget when you blur a focused element.

    Focus Management

    Set preventScroll option to be true by default, setting focus on an element should happen without scrolling the page (in most cases).

    Set nextTick to undefined by default and update all components that use next tick to use { nextTick: true }.

  • 91ef14839 #3583 Thanks @segunadebayo! - Add getCSSVar function to resolve token values and return the css variable reference instead of the actual value. It does a lookup against theme.__cssMap.

    const value = getCSSVar(theme, "colors", "blue.500")
    // => "var(--teste-colors-blue.500)"
    
    const value = getCSSVar(theme, "colors", "tomato")
    // => "tomato" // since tomato doesn't exist in theme colors

1.3.0

Minor Changes

1.2.0

Minor Changes

Patch Changes

  • ff4a36bca #3245 Thanks @segunadebayo! - Removed objectAssign function in favor of using native Object.assign method. It is now supported in most browsers

    This function is only used once in the system package as well. This PR simply removes it to cut bundle size of utils. Less is more 😃.

  • 483687237 #3283 Thanks @segunadebayo! - Update focus util to handle unsupported browsers (Safari), and ability to opt out of requestAnimationFrame

1.1.0

Minor Changes

1.0.2

Patch Changes

  • e73878ee #2790 Thanks @yuzima! - Resolved an issue where custom breakpoints prefixed with a number ("2xl") weren't detected

1.0.1

Patch Changes

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

1.0.0 (2020-11-13)

Note: Version bump only for package @teste-ui/utils

Change Log

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

1.0.0-rc.8 (2020-10-29)

Bug Fixes

  • toast: allow custom render in update (eb8bff9), closes #2362

Change Log

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

1.0.0-rc.7 (2020-10-25)

Note: Version bump only for package @teste-ui/utils

1.0.0-rc.6 (2020-10-25)

Note: Version bump only for package @teste-ui/utils

1.0.0-rc.5 (2020-09-27)

Note: Version bump only for package @teste-ui/utils

1.0.0-rc.4 (2020-09-25)

Note: Version bump only for package @teste-ui/utils

1.0.0-rc.3 (2020-08-30)

Note: Version bump only for package @teste-ui/utils

Change Log

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

1.0.0-rc.2 (2020-08-09)

Note: Version bump only for package @teste-ui/utils

Change Log

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

1.0.0-rc.1 (2020-08-06)

Note: Version bump only for package @teste-ui/utils

Change Log

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

1.0.0-rc.0 (2020-07-26)

Note: Version bump only for package @teste-ui/utils

Change Log

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

1.0.0-next.7 (2020-07-26)

Bug Fixes

  • prevent issue where right click triggers active css state (4ea9b88)

Features

  • add popover transition and merge props util (112ff7b)

Change Log

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

1.0.0-next.6 (2020-07-15)

Note: Version bump only for package @teste-ui/utils

Change Log

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

1.0.0-next.5 (2020-07-15)

Bug Fixes

  • #1180 slider moving incorrectly when min is odd and step is even (4038ad4)

Features

  • css: allow object notation for responsive props in css (08c0029)

Change Log

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

1.0.0-next.4 (2020-07-01)

Bug Fixes

Features

  • add more util tests (f9edcf9)
  • add tests for dom utls (8898ef2)
  • handle null values in mapResponsive (f371eb2)
  • implement assertion test and initialize all utils test files (5a077ff)
  • stack: add support for responsive direction and divider (074f317)
  • implement style props parser (e1a6382)

Change Log

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

1.0.0-next.3 (2020-06-28)

Bug Fixes

Features

  • add more util tests (f9edcf9)
  • add tests for dom utls (8898ef2)
  • handle null values in mapResponsive (f371eb2)
  • implement assertion test and initialize all utils test files (5a077ff)
  • stack: add support for responsive direction and divider (074f317)
  • implement style props parser (e1a6382)

Change Log

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

1.0.0-next.2 (2020-06-21)

Bug Fixes

Features

  • add more util tests (f9edcf9)
  • add tests for dom utls (8898ef2)
  • implement assertion test and initialize all utils test files (5a077ff)
  • stack: add support for responsive direction and divider (074f317)
  • implement style props parser (e1a6382)