File tree Expand file tree Collapse file tree 4 files changed +23
-20
lines changed Expand file tree Collapse file tree 4 files changed +23
-20
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ import { debounce } from 'es-toolkit/compat';
28
28
import useIsomorphicEffect from '../../internal/useIsomorphicEffect' ;
29
29
import mergeRefs from '../../tools/mergeRefs' ;
30
30
import cx from 'classnames' ;
31
- import toggleClass from '../../tools/toggleClass' ;
31
+ import { toggleClass } from '../../tools/toggleClass' ;
32
32
import requiredIfGivenPropIsTruthy from '../../prop-types/requiredIfGivenPropIsTruthy' ;
33
33
import wrapFocus , {
34
34
elementOrParentIsFloatingMenu ,
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ import React, {
15
15
} from 'react' ;
16
16
import classNames from 'classnames' ;
17
17
import { Close } from '@carbon/icons-react' ;
18
- import toggleClass from '../../tools/toggleClass' ;
18
+ import { toggleClass } from '../../tools/toggleClass' ;
19
19
import Button from '../Button' ;
20
20
import ButtonSet from '../ButtonSet' ;
21
21
import InlineLoading from '../InlineLoading' ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Copyright IBM Corp. 2019, 2025
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ /**
9
+ * Toggles a class on an element.
10
+ *
11
+ * @param element - The target element.
12
+ * @param className - The class to toggle.
13
+ * @param add - `true` to add the class, `false` to remove it.
14
+ */
15
+ export const toggleClass = (
16
+ element : Element ,
17
+ className : string ,
18
+ add : boolean
19
+ ) => {
20
+ element . classList . toggle ( className , add ) ;
21
+ } ;
You can’t perform that action at this time.
0 commit comments