Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@chakra-ui/counter

Package Overview
Dependencies
Maintainers
3
Versions
324
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@chakra-ui/counter - npm Package Compare versions

Comparing version 2.0.11 to 2.0.12

dist/chunk-O3YOOUZ7.mjs

66

dist/index.d.ts

@@ -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"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc