From a37ca85f8dc7caa1def5805f6fdaa1653c1e0cd1 Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Sat, 23 May 2020 18:43:07 +0000 Subject: [PATCH] fix: Replace classnames with clsx --- examples/src/components/ExampleItem.js | 2 +- package.json | 2 +- src/components/Tab.js | 2 +- src/components/TabList.js | 2 +- src/components/TabPanel.js | 2 +- src/components/UncontrolledTabs.js | 2 +- yarn.lock | 46 ++++---------------------- 7 files changed, 13 insertions(+), 45 deletions(-) diff --git a/examples/src/components/ExampleItem.js b/examples/src/components/ExampleItem.js index d918be0236..04b1f1730c 100644 --- a/examples/src/components/ExampleItem.js +++ b/examples/src/components/ExampleItem.js @@ -2,7 +2,7 @@ import React, { Component } from 'react'; import T from 'prop-types'; import { Tab, Tabs, TabList, TabPanel } from 'react-tabs'; // eslint-disable-line import { LiveProvider, LiveEditor, LivePreview, LiveError } from 'react-live'; -import classNames from 'classnames'; +import classNames from 'clsx'; const scope = { Tabs, Tab, TabList, TabPanel }; diff --git a/package.json b/package.json index 6332f7a98e..fe8b018b69 100644 --- a/package.json +++ b/package.json @@ -106,7 +106,7 @@ "webpack-dev-server": "^3.1.7" }, "dependencies": { - "classnames": "^2.2.0", + "clsx": "^1.1.0", "prop-types": "^15.5.0" }, "jest": { diff --git a/src/components/Tab.js b/src/components/Tab.js index a4e4ad3a94..911966fae1 100644 --- a/src/components/Tab.js +++ b/src/components/Tab.js @@ -1,6 +1,6 @@ import PropTypes from 'prop-types'; import React, { Component } from 'react'; -import cx from 'classnames'; +import cx from 'clsx'; const DEFAULT_CLASS = 'react-tabs__tab'; diff --git a/src/components/TabList.js b/src/components/TabList.js index 5175e6d6e6..bac4f3fe3a 100644 --- a/src/components/TabList.js +++ b/src/components/TabList.js @@ -1,6 +1,6 @@ import PropTypes from 'prop-types'; import React, { Component } from 'react'; -import cx from 'classnames'; +import cx from 'clsx'; export default class TabList extends Component { static defaultProps = { diff --git a/src/components/TabPanel.js b/src/components/TabPanel.js index d245a4897d..894de1f855 100644 --- a/src/components/TabPanel.js +++ b/src/components/TabPanel.js @@ -1,6 +1,6 @@ import PropTypes from 'prop-types'; import React, { Component } from 'react'; -import cx from 'classnames'; +import cx from 'clsx'; const DEFAULT_CLASS = 'react-tabs__tab-panel'; diff --git a/src/components/UncontrolledTabs.js b/src/components/UncontrolledTabs.js index a47ad95303..fcbcbd1edc 100644 --- a/src/components/UncontrolledTabs.js +++ b/src/components/UncontrolledTabs.js @@ -1,6 +1,6 @@ import PropTypes from 'prop-types'; import React, { cloneElement, Component } from 'react'; -import cx from 'classnames'; +import cx from 'clsx'; import uuid from '../helpers/uuid'; import { childrenPropType } from '../helpers/propTypes'; import { getPanelsCount, getTabsCount } from '../helpers/count'; diff --git a/yarn.lock b/yarn.lock index 6fcee2864f..910de49643 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2837,11 +2837,6 @@ class-utils@^0.3.5: isobject "^3.0.0" static-extend "^0.1.1" -classnames@^2.2.0: - version "2.2.6" - resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.2.6.tgz#43935bffdd291f326dad0a205309b38d00f650ce" - integrity sha512-JR/iSQOSt+LQIWwrwEzJ9uk0xfN3mTVYMwt1Ir5mUcSN6pU+V4zQFFaJsclJbPuAUQH+yfWef6tm7l1quW3C8Q== - clean-css@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/clean-css/-/clean-css-4.2.3.tgz#507b5de7d97b48ee53d84adb0160ff6216380f78" @@ -2966,6 +2961,11 @@ clone@^2.1.2: resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f" integrity sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18= +clsx@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/clsx/-/clsx-1.1.0.tgz#62937c6adfea771247c34b54d320fb99624f5702" + integrity sha512-3avwM37fSK5oP6M5rQ9CNe99lwxhXDOeSWVPAOYF6OazUTgZCMb0yWlJpmdD74REy1gkEaFiub2ULv4fq9GUhA== + cmd-shim@^3.0.0, cmd-shim@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/cmd-shim/-/cmd-shim-3.0.3.tgz#2c35238d3df37d98ecdd7d5f6b8dc6b21cadc7cb" @@ -3671,7 +3671,7 @@ debug@^3.0.0, debug@^3.1.0, debug@^3.1.1, debug@^3.2.5: dependencies: ms "^2.1.1" -debuglog@*, debuglog@^1.0.1: +debuglog@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/debuglog/-/debuglog-1.0.1.tgz#aa24ffb9ac3df9a2351837cfb2d279360cd78492" integrity sha1-qiT/uaw9+aI1GDfPstJ5NgzXhJI= @@ -5964,7 +5964,7 @@ import-local@^3.0.2: pkg-dir "^4.2.0" resolve-cwd "^3.0.0" -imurmurhash@*, imurmurhash@^0.1.4: +imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= @@ -7505,11 +7505,6 @@ lockfile@^1.0.4: dependencies: signal-exit "^3.0.2" -lodash._baseindexof@*: - version "3.1.0" - resolved "https://registry.yarnpkg.com/lodash._baseindexof/-/lodash._baseindexof-3.1.0.tgz#fe52b53a1c6761e42618d654e4a25789ed61822c" - integrity sha1-/lK1OhxnYeQmGNZU5KJXie1hgiw= - lodash._baseuniq@~4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/lodash._baseuniq/-/lodash._baseuniq-4.6.0.tgz#0ebb44e456814af7905c6212fa2c9b2d51b841e8" @@ -7518,33 +7513,11 @@ lodash._baseuniq@~4.6.0: lodash._createset "~4.0.0" lodash._root "~3.0.0" -lodash._bindcallback@*: - version "3.0.1" - resolved "https://registry.yarnpkg.com/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz#e531c27644cf8b57a99e17ed95b35c748789392e" - integrity sha1-5THCdkTPi1epnhftlbNcdIeJOS4= - -lodash._cacheindexof@*: - version "3.0.2" - resolved "https://registry.yarnpkg.com/lodash._cacheindexof/-/lodash._cacheindexof-3.0.2.tgz#3dc69ac82498d2ee5e3ce56091bafd2adc7bde92" - integrity sha1-PcaayCSY0u5ePOVgkbr9Ktx73pI= - -lodash._createcache@*: - version "3.1.2" - resolved "https://registry.yarnpkg.com/lodash._createcache/-/lodash._createcache-3.1.2.tgz#56d6a064017625e79ebca6b8018e17440bdcf093" - integrity sha1-VtagZAF2JeeevKa4AY4XRAvc8JM= - dependencies: - lodash._getnative "^3.0.0" - lodash._createset@~4.0.0: version "4.0.3" resolved "https://registry.yarnpkg.com/lodash._createset/-/lodash._createset-4.0.3.tgz#0f4659fbb09d75194fa9e2b88a6644d363c9fe26" integrity sha1-D0ZZ+7CddRlPqeK4imZE02PJ/iY= -lodash._getnative@*, lodash._getnative@^3.0.0: - version "3.9.1" - resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5" - integrity sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U= - lodash._reinterpolate@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" @@ -7605,11 +7578,6 @@ lodash.merge@^4.0.2: resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== -lodash.restparam@*: - version "3.6.1" - resolved "https://registry.yarnpkg.com/lodash.restparam/-/lodash.restparam-3.6.1.tgz#936a4e309ef330a7645ed4145986c85ae5b20805" - integrity sha1-k2pOMJ7zMKdkXtQUWYbIWuWyCAU= - lodash.sortby@^4.7.0: version "4.7.0" resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438"