@trackunit/css-class-variance-utilities 0.0.5
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/README.md +21 -0
- package/index.cjs +16 -0
- package/index.js +12 -0
- package/package.json +18 -0
- package/src/cva.d.ts +8 -0
- package/src/index.d.ts +1 -0
package/README.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
> **⚠️ Beta**
|
|
2
|
+
>
|
|
3
|
+
> This is a beta version and subject to change without notice.
|
|
4
|
+
|
|
5
|
+
# Trackunit css-class-variance-utilities
|
|
6
|
+
|
|
7
|
+
The `@trackunit/css-class-variance-utilities` package is the home of Trackunits custom implementation of the CVA and twMerge npm packages.
|
|
8
|
+
|
|
9
|
+
For more info and a full guide on Iris App SDK Development, please visit our [Developer Hub](https://developers.trackunit.com/).
|
|
10
|
+
|
|
11
|
+
## Development
|
|
12
|
+
|
|
13
|
+
At this point this library is only developed by Trackunit Employees.
|
|
14
|
+
For development related information see the [development readme](https://github.com/Trackunit/manager/blob/master/libs/react/components/DEVELOPMENT.md).
|
|
15
|
+
|
|
16
|
+
## Trackunit
|
|
17
|
+
|
|
18
|
+
This package was developed by Trackunit ApS.
|
|
19
|
+
Trackunit is the leading SaaS-based IoT solution for the construction industry, offering an ecosystem of hardware, fleet management software & telematics.
|
|
20
|
+
|
|
21
|
+

|
package/index.cjs
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var classVarianceAuthority = require('class-variance-authority');
|
|
6
|
+
var tailwindMerge = require('tailwind-merge');
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* A wrapper around CVA that uses tailwind-merge to merge the classes.
|
|
10
|
+
*/
|
|
11
|
+
const cvaMerge = (base, config) => {
|
|
12
|
+
const classes = classVarianceAuthority.cva(base, config);
|
|
13
|
+
return props => tailwindMerge.twMerge(classes(props));
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
exports.cvaMerge = cvaMerge;
|
package/index.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { cva } from 'class-variance-authority';
|
|
2
|
+
import { twMerge } from 'tailwind-merge';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A wrapper around CVA that uses tailwind-merge to merge the classes.
|
|
6
|
+
*/
|
|
7
|
+
const cvaMerge = (base, config) => {
|
|
8
|
+
const classes = cva(base, config);
|
|
9
|
+
return props => twMerge(classes(props));
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export { cvaMerge };
|
package/package.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@trackunit/css-class-variance-utilities",
|
|
3
|
+
"version": "0.0.5",
|
|
4
|
+
"repository": "https://github.com/Trackunit/manager",
|
|
5
|
+
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
|
+
"engines": {
|
|
7
|
+
"node": ">=16.x"
|
|
8
|
+
},
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"class-variance-authority": "0.6.0",
|
|
11
|
+
"tailwind-merge": "1.13.0"
|
|
12
|
+
},
|
|
13
|
+
"module": "./index.js",
|
|
14
|
+
"main": "./index.cjs",
|
|
15
|
+
"type": "module",
|
|
16
|
+
"types": "./src/index.d.ts",
|
|
17
|
+
"peerDependencies": {}
|
|
18
|
+
}
|
package/src/cva.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { cva as OriginalCva, type VariantProps as OriginalVariantProps } from "class-variance-authority";
|
|
2
|
+
export type VariantProps<Component extends (...args: any) => any> = OriginalVariantProps<Component> & {
|
|
3
|
+
className: string;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* A wrapper around CVA that uses tailwind-merge to merge the classes.
|
|
7
|
+
*/
|
|
8
|
+
export declare const cvaMerge: typeof OriginalCva;
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./cva";
|