Skip to content

Commit 2f05d22

Browse files
authored
Merge pull request #1064 from NemeZZiZZ/classnames-to-clsx
changed classnames module with clsx
2 parents 56a7ba1 + 811184d commit 2f05d22

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,6 @@
125125
},
126126
"dependencies": {
127127
"@floating-ui/dom": "^1.0.0",
128-
"classnames": "^2.3.0"
128+
"clsx": "^2.0.0"
129129
}
130130
}

Diff for: rollup.config.dev.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const name = 'ReactTooltip'
1818
const globals = {
1919
react: 'React',
2020
'react-dom': 'ReactDOM',
21-
classnames: 'classNames',
21+
clsx: 'clsx',
2222
'prop-types': 'PropTypes',
2323
}
2424

Diff for: rollup.config.prod.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const buildFormats = [
3939
'@floating-ui/dom': 'FloatingUIDOM',
4040
react: 'React',
4141
'react-dom': 'ReactDOM',
42-
classnames: 'classNames',
42+
clsx: 'clsx',
4343
'prop-types': 'PropTypes',
4444
},
4545
},

Diff for: src/components/Tooltip/Tooltip.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useEffect, useState, useRef, useCallback, useImperativeHandle } from 'react'
22
import { autoUpdate } from '@floating-ui/dom'
3-
import classNames from 'classnames'
3+
import clsx from 'clsx'
44
import debounce from 'utils/debounce'
55
import { useTooltip } from 'components/TooltipProvider'
66
import useIsomorphicLayoutEffect from 'utils/use-isomorphic-layout-effect'
@@ -790,7 +790,7 @@ const Tooltip = ({
790790
<WrapperElement
791791
id={id}
792792
role={role}
793-
className={classNames(
793+
className={clsx(
794794
'react-tooltip',
795795
coreStyles['tooltip'],
796796
styles['tooltip'],
@@ -823,7 +823,7 @@ const Tooltip = ({
823823
>
824824
{actualContent}
825825
<WrapperElement
826-
className={classNames(
826+
className={clsx(
827827
'react-tooltip-arrow',
828828
coreStyles['arrow'],
829829
styles['arrow'],

Diff for: src/components/TooltipProvider/TooltipWrapper.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useEffect, useRef } from 'react'
2-
import classNames from 'classnames'
2+
import clsx from 'clsx'
33
import { useTooltip } from './TooltipProvider'
44
import type { ITooltipWrapper } from './TooltipProviderTypes'
55

@@ -35,7 +35,7 @@ const TooltipWrapper = ({
3535
return (
3636
<span
3737
ref={anchorRef}
38-
className={classNames('react-tooltip-wrapper', className)}
38+
className={clsx('react-tooltip-wrapper', className)}
3939
data-tooltip-place={place}
4040
data-tooltip-content={content}
4141
data-tooltip-html={html}

Diff for: yarn.lock

+5-5
Original file line numberDiff line numberDiff line change
@@ -2204,11 +2204,6 @@ cjs-module-lexer@^1.0.0:
22042204
resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.2.3.tgz#6c370ab19f8a3394e318fe682686ec0ac684d107"
22052205
integrity sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ==
22062206

2207-
classnames@^2.3.0:
2208-
version "2.3.2"
2209-
resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.3.2.tgz#351d813bf0137fcc6a76a16b88208d2560a0d924"
2210-
integrity sha512-CSbhY4cFEJRe6/GQzIk5qXZ4Jeg5pcsP7b5peFSDpffpe1cqjASH/n9UTjBwOp6XpMSTwQ8Za2K5V02ueA7Tmw==
2211-
22122207
clean-stack@^2.0.0:
22132208
version "2.2.0"
22142209
resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b"
@@ -2267,6 +2262,11 @@ clone-regexp@^2.1.0:
22672262
dependencies:
22682263
is-regexp "^2.0.0"
22692264

2265+
clsx@^2.0.0:
2266+
version "2.0.0"
2267+
resolved "https://registry.yarnpkg.com/clsx/-/clsx-2.0.0.tgz#12658f3fd98fafe62075595a5c30e43d18f3d00b"
2268+
integrity sha512-rQ1+kcj+ttHG0MKVGBUXwayCCF1oh39BF5COIpRzuCEv8Mwjv0XucrI2ExNTOn9IlLifGClWQcU9BrZORvtw6Q==
2269+
22702270
co@^4.6.0:
22712271
version "4.6.0"
22722272
resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184"

0 commit comments

Comments
 (0)