dce-reactkit 3.6.11 → 3.6.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +7 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/helpers/combineClassNames.d.ts +3 -2
- package/dist/esm/index.js +7 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/helpers/combineClassNames.d.ts +3 -2
- package/dist/index.d.ts +3 -2
- package/package.json +1 -1
- package/src/components/MultiSwitch.tsx +1 -1
- package/src/helpers/combineClassNames.ts +7 -2
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Merges a list of class names into a class name, intelligently handling spaces
|
|
3
3
|
* @author Gabe Abrams
|
|
4
|
-
* @param classNames the list of class names to merge
|
|
4
|
+
* @param classNames the list of class names to merge (or falsey values to
|
|
5
|
+
* ignore)
|
|
5
6
|
* @returns the merged class name
|
|
6
7
|
*/
|
|
7
|
-
declare const combineClassNames: (classNames: string[]) => string;
|
|
8
|
+
declare const combineClassNames: (classNames: (string | undefined | null | false)[]) => string;
|
|
8
9
|
export default combineClassNames;
|
package/dist/index.d.ts
CHANGED
|
@@ -1420,10 +1420,11 @@ declare const makeLinksClickable: (text: string, opts?: {
|
|
|
1420
1420
|
/**
|
|
1421
1421
|
* Merges a list of class names into a class name, intelligently handling spaces
|
|
1422
1422
|
* @author Gabe Abrams
|
|
1423
|
-
* @param classNames the list of class names to merge
|
|
1423
|
+
* @param classNames the list of class names to merge (or falsey values to
|
|
1424
|
+
* ignore)
|
|
1424
1425
|
* @returns the merged class name
|
|
1425
1426
|
*/
|
|
1426
|
-
declare const combineClassNames: (classNames: string[]) => string;
|
|
1427
|
+
declare const combineClassNames: (classNames: (string | undefined | null | false)[]) => string;
|
|
1427
1428
|
|
|
1428
1429
|
/**
|
|
1429
1430
|
* List of error codes built into the react kit
|
package/package.json
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Merges a list of class names into a class name, intelligently handling spaces
|
|
3
3
|
* @author Gabe Abrams
|
|
4
|
-
* @param classNames the list of class names to merge
|
|
4
|
+
* @param classNames the list of class names to merge (or falsey values to
|
|
5
|
+
* ignore)
|
|
5
6
|
* @returns the merged class name
|
|
6
7
|
*/
|
|
7
|
-
const combineClassNames = (classNames: string[]): string => {
|
|
8
|
+
const combineClassNames = (classNames: (string | undefined | null | false)[]): string => {
|
|
8
9
|
return (
|
|
9
10
|
classNames
|
|
11
|
+
// Turn falsey values into empty strings
|
|
12
|
+
.map((className) => {
|
|
13
|
+
return className || '';
|
|
14
|
+
})
|
|
10
15
|
// Trim whitespace
|
|
11
16
|
.map((className) => {
|
|
12
17
|
return className.trim();
|