@chakra-ui/counter
Advanced tools
Comparing version 2.0.11 to 2.0.12
@@ -1,64 +0,2 @@ | ||
import * as react from 'react'; | ||
interface UseCounterProps { | ||
/** | ||
* The callback fired when the value changes | ||
*/ | ||
onChange?(valueAsString: string, valueAsNumber: number): void; | ||
/** | ||
* The number of decimal points used to round the value | ||
*/ | ||
precision?: number; | ||
/** | ||
* The initial value of the counter. Should be less than `max` and greater than `min` | ||
*/ | ||
defaultValue?: string | number; | ||
/** | ||
* The value of the counter. Should be less than `max` and greater than `min` | ||
*/ | ||
value?: string | number; | ||
/** | ||
* The step used to increment or decrement the value | ||
* @default 1 | ||
*/ | ||
step?: number; | ||
/** | ||
* The minimum value of the counter | ||
* @default Number.MIN_SAFE_INTEGER | ||
*/ | ||
min?: number; | ||
/** | ||
* The maximum value of the counter | ||
* @default Number.MAX_SAFE_INTEGER | ||
*/ | ||
max?: number; | ||
/** | ||
* This controls the value update behavior in general. | ||
* | ||
* - If `true` and you use the stepper or up/down arrow keys, | ||
* the value will not exceed the `max` or go lower than `min` | ||
* | ||
* - If `false`, the value will be allowed to go out of range. | ||
* | ||
* @default true | ||
*/ | ||
keepWithinRange?: boolean; | ||
} | ||
declare function useCounter(props?: UseCounterProps): { | ||
isOutOfRange: boolean; | ||
isAtMax: boolean; | ||
isAtMin: boolean; | ||
precision: number; | ||
value: string | number; | ||
valueAsNumber: number; | ||
update: (next: string | number) => void; | ||
reset: () => void; | ||
increment: (step?: number) => void; | ||
decrement: (step?: number) => void; | ||
clamp: (value: number) => string; | ||
cast: (value: string | number) => void; | ||
setValue: react.Dispatch<react.SetStateAction<string | number>>; | ||
}; | ||
declare type UseCounterReturn = ReturnType<typeof useCounter>; | ||
export { UseCounterProps, UseCounterReturn, useCounter }; | ||
export { UseCounterProps, UseCounterReturn, useCounter } from './use-counter.js'; | ||
import 'react'; |
{ | ||
"name": "@chakra-ui/counter", | ||
"version": "2.0.11", | ||
"version": "2.0.12", | ||
"description": "A React hook for managing counters", | ||
@@ -20,3 +20,3 @@ "keywords": [ | ||
"license": "MIT", | ||
"main": "dist/index.cjs.js", | ||
"main": "dist/index.js", | ||
"files": [ | ||
@@ -37,7 +37,7 @@ "dist" | ||
"dependencies": { | ||
"@chakra-ui/number-utils": "2.0.5", | ||
"@chakra-ui/react-use-callback-ref": "2.0.5" | ||
"@chakra-ui/number-utils": "2.0.6", | ||
"@chakra-ui/react-use-callback-ref": "2.0.6", | ||
"@chakra-ui/shared-utils": "2.0.4" | ||
}, | ||
"devDependencies": { | ||
"@chakra-ui/shared-utils": "2.0.3", | ||
"react": "^18.0.0", | ||
@@ -49,9 +49,18 @@ "clean-package": "2.1.1" | ||
}, | ||
"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" | ||
}, | ||
@@ -61,8 +70,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
18671
2
10
510
4
1
+ Added@chakra-ui/number-utils@2.0.6(transitive)
+ Added@chakra-ui/react-use-callback-ref@2.0.6(transitive)
+ Added@chakra-ui/shared-utils@2.0.4(transitive)
- Removed@chakra-ui/number-utils@2.0.5(transitive)
- Removed@chakra-ui/react-use-callback-ref@2.0.5(transitive)