Skip to content

Commit

Permalink
fix(numberinput): 🐛 remove number input label warning
Browse files Browse the repository at this point in the history
  • Loading branch information
navin-moorthy committed Oct 28, 2021
1 parent 51dbbd0 commit 9a1699f
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 49 deletions.
35 changes: 16 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,29 +36,29 @@
"dist"
],
"scripts": {
"postinstall": "concurrently \"husky install\" \"patch-package\"",
"boot": "concurrently \"yarn keys\" \"yarn previews\"",
"keys": "node scripts/builds/keys",
"previews": "node scripts/builds/create-previews.js",
"storybook": "cross-env TAILWIND_MODE=watch start-storybook -p 6006",
"test": "jest --config ./jest.config.ts --no-cache",
"lint": "eslint --color --ext .js,.jsx,.ts,.tsx .",
"lint:fix": "eslint --color --ext .js,.jsx,.ts,.tsx . --fix",
"format": "prettier -wl \"./**/*.{html,css,js,jsx,ts,tsx,md,json}\"",
"format:package": "sort-package-json package.json",
"docs": "node scripts/builds/docs.js",
"prebuild": "rimraf dist",
"build": "concurrently yarn:build:*",
"build:cjs": "cross-env BABEL_ENV=cjs babel src --extensions .ts,.tsx -d dist/cjs --source-maps",
"build:esm": "cross-env BABEL_ENV=esm babel src --extensions .ts,.tsx -d dist/esm --source-maps",
"build:types": "tsc --emitDeclarationOnly --project tsconfig.prod.json",
"storybook-build": "yarn previews && build-storybook",
"commit": "gacp",
"contributors:add": "all-contributors add",
"contributors:generate": "all-contributors generate",
"docs": "node scripts/builds/docs.js",
"format": "prettier -wl \"./**/*.{html,css,js,jsx,ts,tsx,md,json}\"",
"format:package": "sort-package-json package.json",
"postinstall": "concurrently \"husky install\" \"patch-package\"",
"keys": "node scripts/builds/keys",
"lint": "eslint --color --ext .js,.jsx,.ts,.tsx .",
"lint:fix": "eslint --color --ext .js,.jsx,.ts,.tsx . --fix",
"prepublishOnly": "pinst --disable",
"previews": "node scripts/builds/create-previews.js",
"postpublish": "pinst --enable",
"release": "release-it",
"storybook": "cross-env TAILWIND_MODE=watch start-storybook -p 6006",
"storybook-build": "yarn previews && build-storybook",
"test": "jest --config ./jest.config.ts --no-cache"
"postpublish": "pinst --enable"
},
"commitlint": {
"extends": [
Expand All @@ -71,9 +71,6 @@
],
"**/*.{html,css,js,jsx,ts,tsx,md,json}": [
"yarn format"
],
"package.json": [
"yarn format:package"
]
},
"browserslist": {
Expand All @@ -89,15 +86,15 @@
]
},
"dependencies": {
"@chakra-ui/counter": "^1.1.9",
"@chakra-ui/hooks": "^1.6.0",
"@chakra-ui/counter": "^1.1.10",
"@chakra-ui/hooks": "^1.6.1",
"@chakra-ui/react-utils": "^1.1.2",
"@chakra-ui/utils": "^1.8.2",
"@chakra-ui/utils": "^1.8.3",
"@react-aria/i18n": "^3.3.2",
"@react-aria/interactions": "^3.6.0",
"@react-aria/spinbutton": "^3.0.1",
"@react-aria/utils": "^3.9.0",
"date-fns": "^2.24.0",
"date-fns": "^2.25.0",
"raf": "^3.4.1",
"reakit-system": "^0.15.2",
"reakit-utils": "^0.15.2",
Expand Down
11 changes: 1 addition & 10 deletions src/number-input/NumberInput.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import * as React from "react";
import { createComponent, createHook, useCreateElement } from "reakit-system";
import { createComponent, createHook } from "reakit-system";
import { InputHTMLProps, InputOptions, useInput } from "reakit";
import { useWarning } from "reakit-warning";
import { EventKeyMap, mergeRefs } from "@chakra-ui/react-utils";
import {
callAllHandlers,
Expand Down Expand Up @@ -265,12 +264,4 @@ export const NumberInput = createComponent({
as: "input",
memo: true,
useHook: useNumberInput,
useCreateElement: (type, props, children) => {
useWarning(
!props["aria-label"] && !props["aria-labelledby"],
"You should provide either `aria-label` or `aria-labelledby` props.",
"See https://www.w3.org/TR/wai-aria-1.1/#spinbutton",
);
return useCreateElement(type, props, children);
},
});
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "es5",
"target": "es6",
"module": "esnext",
"lib": ["dom", "esnext", "dom.iterable"],
"types": ["node", "jest", "@testing-library/jest-dom"],
Expand Down
38 changes: 19 additions & 19 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1926,21 +1926,21 @@
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==

"@chakra-ui/counter@^1.1.9":
version "1.1.9"
resolved "https://registry.yarnpkg.com/@chakra-ui/counter/-/counter-1.1.9.tgz#954794624806ea6a00f0ebdd3d50c6838d0b41fc"
integrity sha512-WHkYSHJynkFwVFD6wg6afDteBeAmDHV35/tPMwpyTcgagpF99xY/8mULnBoLkkCc/PMe+meHuZJEXuCaxy4ecg==
"@chakra-ui/counter@^1.1.10":
version "1.1.10"
resolved "https://registry.yarnpkg.com/@chakra-ui/counter/-/counter-1.1.10.tgz#0112942f723290221c4e3464817567c6dae33e90"
integrity sha512-63LfIKK2duHyY9n8AfoXfwmQYkmNNaItAIB2ZNT230eTY0RwuKiAi+J4C/N9amxCB7EUw15gQphb2DjjL5D3GQ==
dependencies:
"@chakra-ui/hooks" "1.6.0"
"@chakra-ui/utils" "1.8.2"
"@chakra-ui/hooks" "1.6.1"
"@chakra-ui/utils" "1.8.3"

"@chakra-ui/[email protected].0", "@chakra-ui/hooks@^1.6.0":
version "1.6.0"
resolved "https://registry.yarnpkg.com/@chakra-ui/hooks/-/hooks-1.6.0.tgz#94f54540298b6a5a7ef68b15e451e76b0ee1fed4"
integrity sha512-5QFICaE1omNCJyVQQX62sZvRvIpI4VansN2AvZpSdrMjRiWvmBNLZN2Khr7+8j6F7uDh5LSgTxiP02vWLp12hA==
"@chakra-ui/[email protected].1", "@chakra-ui/hooks@^1.6.1":
version "1.6.1"
resolved "https://registry.yarnpkg.com/@chakra-ui/hooks/-/hooks-1.6.1.tgz#56e3bdb4e3d3b1dd827cf35b4be848817846e582"
integrity sha512-377Wvrt2BxpEY+1dDMsvm3J/E4GTdrxJM4fju24iUg0iFv87jg+jf6GXPsrZfdN6a9XfCCmclcmLxEH/0Trwpg==
dependencies:
"@chakra-ui/react-utils" "1.1.2"
"@chakra-ui/utils" "1.8.2"
"@chakra-ui/utils" "1.8.3"
compute-scroll-into-view "1.0.14"
copy-to-clipboard "3.3.1"

Expand All @@ -1951,10 +1951,10 @@
dependencies:
"@chakra-ui/utils" "^1.7.0"

"@chakra-ui/[email protected].2", "@chakra-ui/utils@^1.8.2":
version "1.8.2"
resolved "https://registry.yarnpkg.com/@chakra-ui/utils/-/utils-1.8.2.tgz#5a9f1f67c5f2232769fe7d009fcf96eebf3c2b4e"
integrity sha512-MnE4czCQCE87Ch1DfAdmZvObgRviw9wQ9Zti372P8VD1ILEdff/C5WBWHW6mgG3YcorPAxgnrNF3MmNE95jRkA==
"@chakra-ui/[email protected].3", "@chakra-ui/utils@^1.8.3":
version "1.8.3"
resolved "https://registry.yarnpkg.com/@chakra-ui/utils/-/utils-1.8.3.tgz#4eb6da7d772e483376ca47afeaf54cd453432340"
integrity sha512-v184c2TYwQYBEcDI/9C1DjN668jZVTJeb/DPtucAjEHNi4T0py3tjGDbUd05LoNoZ64uijtWYanfrr6Abe4m1Q==
dependencies:
"@types/lodash.mergewith" "4.6.6"
css-box-model "1.2.1"
Expand Down Expand Up @@ -8255,10 +8255,10 @@ date-fns@^2.16.1:
resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.22.1.tgz#1e5af959831ebb1d82992bf67b765052d8f0efc4"
integrity sha512-yUFPQjrxEmIsMqlHhAhmxkuH769baF21Kk+nZwZGyrMoyLA+LugaQtC0+Tqf9CBUUULWwUJt6Q5ySI3LJDDCGg==

date-fns@^2.24.0:
version "2.24.0"
resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.24.0.tgz#7d86dc0d93c87b76b63d213b4413337cfd1c105d"
integrity sha512-6ujwvwgPID6zbI0o7UbURi2vlLDR9uP26+tW6Lg+Ji3w7dd0i3DOcjcClLjLPranT60SSEFBwdSyYwn/ZkPIuw==
date-fns@^2.25.0:
version "2.25.0"
resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.25.0.tgz#8c5c8f1d958be3809a9a03f4b742eba894fc5680"
integrity sha512-ovYRFnTrbGPD4nqaEqescPEv1mNwvt+UTqI3Ay9SzNtey9NZnYu6E2qCcBBgJ6/2VF1zGGygpyTDITqpQQ5e+w==

dateformat@^3.0.0:
version "3.0.3"
Expand Down

0 comments on commit 9a1699f

Please sign in to comment.