{"name":"tailwind-variants","version":"0.3.0","description":"🦄 Tailwindcss first-class variant API","author":{"name":"Junior Garcia","email":"jrgarciadev@gmail.com"},"license":"MIT","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/nextui-org/tailwind-variants.git"},"bugs":{"url":"https://github.com/nextui-org/tailwind-variants/issues"},"type":"module","main":"dist/index.cjs","types":"./dist/index.d.ts","sideEffects":false,"scripts":{"build":"tsup && node copy-types.cjs","typecheck":"tsc --noEmit","prepack":"clean-package","benchmark":"node benchmark.js","postpack":"clean-package restore","lint":"eslint . src/**/*.{js,ts}","lint:fix":"eslint --fix . src/**/*.{js,ts}","test":"jest --verbose","test:watch":"jest --watch --no-verbose"},"dependencies":{"tailwind-merge":"^2.5.4"},"devDependencies":{"@commitlint/cli":"^17.2.0","@commitlint/config-conventional":"^17.2.0","@jest/globals":"^29.7.0","@swc-node/jest":"^1.5.2","@swc/cli":"0.1.57","@swc/core":"1.2.198","@swc/helpers":"^0.4.14","@types/jest":"28.1.1","@types/node":"^18.11.18","@typescript-eslint/eslint-plugin":"^7.3.1","@typescript-eslint/parser":"^7.3.1","benchmark":"2.1.4","class-variance-authority":"^0.7.0","clean-package":"2.1.1","eslint":"^8.57.0","eslint-config-prettier":"^9.1.0","eslint-config-ts-lambdas":"^1.2.3","eslint-import-resolver-typescript":"^3.6.1","eslint-plugin-import":"^2.29.1","eslint-plugin-jest":"^27.9.0","eslint-plugin-node":"^11.1.0","eslint-plugin-prettier":"^5.1.3","eslint-plugin-promise":"^6.1.1","expect":"^29.7.0","jest":"28.1.1","prettier":"^3.2.5","prettier-eslint":"^16.3.0","prettier-eslint-cli":"^8.0.1","tailwindcss":"^3.2.7","ts-node":"^10.9.1","tsup":"6.6.3","typescript":"5.1.3"},"peerDependencies":{"tailwindcss":"*"},"keywords":["tailwindcss","classes","responsive","variants","styled","styles"],"tsup":{"clean":true,"minify":true,"treeshake":true,"entry":["src/*.js"],"target":"es2019","format":["cjs","esm"]},"packageManager":"pnpm@8.6.8","engines":{"node":">=16.x","pnpm":">=7.x"},"_id":"tailwind-variants@0.3.0","gitHead":"50f0faca460d7dfb7b70ea3e717559210c6c5da1","homepage":"https://github.com/nextui-org/tailwind-variants#readme","_nodeVersion":"20.14.0","_npmVersion":"10.7.0","dist":{"integrity":"sha512-ho2k5kn+LB1fT5XdNS3Clb96zieWxbStE9wNLK7D0AV64kdZMaYzAKo0fWl6fXLPY99ffF9oBJnIj5escEl/8A==","shasum":"481f53031cd4e91f92e0c078bbfd9fe453162e0b","tarball":"http://registry-npm.ywwl.com/tailwind-variants/download/tailwind-variants-0.3.0.tgz","fileCount":21,"unpackedSize":42730,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEMCHxQuEWd8/ZZcQwSnE0Y4hqvc0weEYO5LTyUm1o2SdvECICwJeczigsT8gJiIojSv0c+VoWF1iXPheyMtJOU5Wvnl"}],"size":12776,"noattachment":false,"key":"/tailwind-variants/-/tailwind-variants-0.3.0.tgz"},"_npmUser":{"name":"juniorgarciadev","email":"jrgarciadev@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tailwind-variants_0.3.0_1731411937734_0.9183468369701837"},"_hasShrinkwrap":false,"readme":"<p align=\"center\">\n  <a href=\"https://tailwind-variants.org\">\n    <img width=\"20%\" src=\".github/assets/isotipo.png\" alt=\"tailwind-variants\" />\n    <h1 align=\"center\">tailwind-variants</h1>\n  </a>\n</p>\n<p align=\"center\">\n  The <em>power</em> of Tailwind combined with a <em>first-class</em> variant API.<br><br>\n  <a href=\"https://www.npmjs.com/package/tailwind-variants\">\n    <img src=\"https://img.shields.io/npm/dm/tailwind-variants.svg?style=flat-round\" alt=\"npm downloads\">\n  </a>\n  <a href=\"https://www.npmjs.com/package/tailwind-variants\">\n    <img alt=\"NPM Version\" src=\"https://badgen.net/npm/v/tailwind-variants\" />\n  </a>\n  <a href=\"https://github.com/nextui-org/tailwind-variants/blob/main/LICENSE\">\n    <img src=\"https://img.shields.io/npm/l/tailwind-variants?style=flat\" alt=\"License\">\n  </a>\n</p>\n\n## Features\n\n- First-class variant API\n- Responsive variants\n- Slots support\n- Composition support\n- Fully typed\n- Framework agnostic\n- Automatic conflict resolution\n\n## Documentation\n\nFor full documentation, visit [tailwind-variants.org](https://tailwind-variants.org)\n\n## Quick Start\n\n1. Installation:\n   To use Tailwind Variants in your project, you can install it as a dependency:\n\n```bash\nyarn add tailwind-variants\n# or\nnpm i tailwind-variants\n```\n\n2. Usage:\n\n```js\nimport {tv} from \"tailwind-variants\";\n\nconst button = tv({\n  base: \"font-medium bg-blue-500 text-white rounded-full active:opacity-80\",\n  variants: {\n    color: {\n      primary: \"bg-blue-500 text-white\",\n      secondary: \"bg-purple-500 text-white\",\n    },\n    size: {\n      sm: \"text-sm\",\n      md: \"text-base\",\n      lg: \"px-4 py-3 text-lg\",\n    },\n  },\n  compoundVariants: [\n    {\n      size: [\"sm\", \"md\"],\n      class: \"px-3 py-1\",\n    },\n  ],\n  defaultVariants: {\n    size: \"md\",\n    color: \"primary\",\n  },\n});\n\nreturn <button className={button({size: \"sm\", color: \"secondary\"})}>Click me</button>;\n```\n\n3. Responsive variants configuration (optional): If you want to use responsive variants\n   you need to add the Tailwind Variants `wrapper` to your TailwindCSS config file `tailwind.config.js`.\n\n```js\n// tailwind.config.js\n\nconst {withTV} = require(\"tailwind-variants/transformer\");\n\n/** @type {import('tailwindcss').Config} */\nmodule.exports = withTV({\n  content: [\"./index.html\", \"./src/**/*.{js,ts,jsx,tsx}\"],\n  theme: {\n    extend: {},\n  },\n  plugins: [],\n});\n```\n\nIf you're using a custom path to import Tailwind variants, such as creating a custom tv instance with `createTV`, it's recommended to include this path in the transformer configuration:\n\n```js\n// tailwind.config.js\n\nconst {withTV} = require(\"tailwind-variants/transformer\");\n\n/** @type {import('tailwindcss').Config} */\nmodule.exports = withTV(\n  {\n    content: [\"./index.html\", \"./src/**/*.{js,ts,jsx,tsx}\"],\n    theme: {\n      extend: {},\n    },\n    plugins: [],\n  },\n  {\n    aliases: [\"@/lib/tv\"],\n  },\n);\n```\n\n## Acknowledgements\n\n- [**cva**](https://github.com/joe-bell/cva) ([Joe Bell](https://github.com/joe-bell))\n  This project as started as an extension of Joe's work on `cva` – a great tool for generating variants for a single element with Tailwind CSS. Big shoutout to [Joe Bell](https://github.com/joe-bell) and [contributors](https://github.com/joe-bell/cva/graphs/contributors) you guys rock! 🤘 - we recommend to use `cva` if don't need any of the **Tailwind Variants** features listed [here](https://www.tailwind-variants.org/docs/comparison).\n\n- [**Stitches**](https://stitches.dev/) ([Modulz](https://modulz.app))  \n  The pioneers of the `variants` API movement. Inmense thanks to [Modulz](https://modulz.app) for their work on Stitches and the community around it. 🙏\n\n## Community\n\nWe're excited to see the community adopt NextUI, raise issues, and provide feedback. Whether it's a feature request, bug report, or a project to showcase, please get involved!\n\n- [Discord](https://discord.gg/9b6yyZKmH4)\n- [Twitter](https://twitter.com/getnextui)\n- [GitHub Discussions](https://github.com/nextui-org/tailwind-variants/discussions)\n\n## Contributing\n\nContributions are always welcome!\n\nPlease follow our [contributing guidelines](./CONTRIBUTING.md).\n\nPlease adhere to this project's [CODE_OF_CONDUCT](./CODE_OF_CONDUCT.md).\n\n## Authors\n\n- Junior garcia ([@jrgarciadev](https://github.com/jrgaciadev))\n- Tianen Pang ([@tianenpang](https://github.com/tianenpang))\n\n## License\n\nLicensed under the MIT License.\n\nSee [LICENSE](./LICENSE.md) for more information.\n","publish_time":1731411937878,"maintainers":[{"name":"juniorgarciadev","email":"jrgarciadev@gmail.com"}],"_cnpm_publish_time":1731411937878,"dist-tags":{"dev":"0.0.17-dev.1","latest":"1.0.0"}}