@chakra-ui/react-utils
Advanced tools
Comparing version 0.0.0-dev-20221222051548 to 0.0.0-dev-20221223180742
@@ -1,63 +0,6 @@ | ||
import { Merge, EventKeys } from '@chakra-ui/utils'; | ||
import * as react from 'react'; | ||
declare type ReactRef<T> = React.Ref<T> | React.RefObject<T> | React.MutableRefObject<T>; | ||
/** | ||
* Assigns a value to a ref function or object | ||
* | ||
* @param ref the ref to assign to | ||
* @param value the value | ||
*/ | ||
declare function assignRef<T = any>(ref: ReactRef<T> | undefined, value: T): void; | ||
/** | ||
* Combine multiple React refs into a single ref function. | ||
* This is used mostly when you need to allow consumers forward refs to | ||
* internal components | ||
* | ||
* @param refs refs to assign to value to | ||
*/ | ||
declare function mergeRefs<T>(...refs: (ReactRef<T> | undefined)[]): (node: T | null) => void; | ||
interface CreateContextOptions { | ||
/** | ||
* If `true`, React will throw if context is `null` or `undefined` | ||
* In some cases, you might want to support nested context, so you can set it to `false` | ||
*/ | ||
strict?: boolean; | ||
/** | ||
* Error message to throw if the context is `undefined` | ||
*/ | ||
errorMessage?: string; | ||
/** | ||
* The display name of the context | ||
*/ | ||
name?: string; | ||
} | ||
declare type CreateContextReturn<T> = [ | ||
React.Provider<T>, | ||
() => T, | ||
React.Context<T> | ||
]; | ||
/** | ||
* Creates a named context, provider, and hook. | ||
* | ||
* @param options create context options | ||
*/ | ||
declare function createContext<ContextType>(options?: CreateContextOptions): CreateContextReturn<ContextType>; | ||
declare type MaybeRenderProp<P> = React.ReactNode | ((props: P) => React.ReactNode); | ||
declare type WithoutStyleAttr<T> = Omit<T, "color" | "width" | "height">; | ||
declare type HTMLProps<T = any> = WithoutStyleAttr<React.HTMLAttributes<T>> & React.RefAttributes<T>; | ||
declare type PropGetter<T extends HTMLElement = any, P = {}> = (props?: Merge<HTMLProps<T>, P>, ref?: React.Ref<any> | React.RefObject<any>) => Merge<HTMLProps<T>, P>; | ||
declare type PropGetterV2<T extends React.ElementType, P = {}> = (props?: WithoutStyleAttr<React.ComponentPropsWithoutRef<T>> & P, ref?: React.Ref<any> | React.RefObject<any>) => WithoutStyleAttr<React.ComponentPropsWithRef<T>>; | ||
declare type EventKeyMap = Partial<Record<EventKeys, React.KeyboardEventHandler>>; | ||
/** | ||
* Gets only the valid children of a component, | ||
* and ignores any nullish or falsy child. | ||
* | ||
* @param children the children | ||
*/ | ||
declare function getValidChildren(children: React.ReactNode): react.ReactElement<any, string | react.JSXElementConstructor<any>>[]; | ||
export { CreateContextOptions, CreateContextReturn, EventKeyMap, HTMLProps, MaybeRenderProp, PropGetter, PropGetterV2, ReactRef, assignRef, createContext, getValidChildren, mergeRefs }; | ||
export { ReactRef, assignRef, mergeRefs } from './refs.js'; | ||
export { CreateContextOptions, CreateContextReturn, createContext } from './context.js'; | ||
export { EventKeyMap, HTMLProps, MaybeRenderProp, PropGetter, PropGetterV2 } from './types.js'; | ||
export { getValidChildren } from './children.js'; | ||
import '@chakra-ui/utils'; | ||
import 'react'; |
{ | ||
"name": "@chakra-ui/react-utils", | ||
"version": "0.0.0-dev-20221222051548", | ||
"version": "0.0.0-dev-20221223180742", | ||
"description": "React utilities and helpers for Chakra UI", | ||
@@ -14,3 +14,3 @@ "keywords": [ | ||
"license": "MIT", | ||
"main": "dist/index.cjs.js", | ||
"main": "dist/index.js", | ||
"sideEffects": false, | ||
@@ -32,3 +32,3 @@ "files": [ | ||
"dependencies": { | ||
"@chakra-ui/utils": "0.0.0-dev-20221222051548" | ||
"@chakra-ui/utils": "0.0.0-dev-20221223180742" | ||
}, | ||
@@ -42,9 +42,18 @@ "peerDependencies": { | ||
}, | ||
"module": "dist/index.esm.js", | ||
"clean-package": "../../../clean-package.config.json", | ||
"tsup": { | ||
"clean": true, | ||
"target": "es2019", | ||
"format": [ | ||
"cjs", | ||
"esm" | ||
] | ||
}, | ||
"module": "dist/index.mjs", | ||
"types": "dist/index.d.ts", | ||
"exports": { | ||
".": { | ||
"import": "./dist/index.esm.js", | ||
"require": "./dist/index.cjs.js", | ||
"types": "./dist/index.d.ts" | ||
"types": "./dist/index.d.ts", | ||
"import": "./dist/index.mjs", | ||
"require": "./dist/index.js" | ||
}, | ||
@@ -54,8 +63,8 @@ "./package.json": "./package.json" | ||
"scripts": { | ||
"build": "tsup src/index.ts --dts", | ||
"build": "tsup src --dts", | ||
"dev": "pnpm build:fast -- --watch", | ||
"clean": "rimraf dist .turbo", | ||
"typecheck": "tsc --noEmit", | ||
"build:fast": "tsup src/index.ts" | ||
"build:fast": "tsup src" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15923
22
414
1
+ Added@chakra-ui/utils@0.0.0-dev-20221223180742(transitive)
- Removed@chakra-ui/utils@0.0.0-dev-20221222051548(transitive)