3 Commits

Author SHA1 Message Date
Janeene Beeforth 3905be67a9 Fix esm compatibility for @headlessui/tailwindcss plugin package (#3051)
* Set @headlessui/tailwindcss module type

The distributed tailwindcss plugin package uses `.js` for esm files, and `.cjs` for commonjs files. This corresponds to `"type": "module"` in the package.json file.

One build script `fix-types.js` was a commonjs script which was breaking this module file naming pattern. Renamed the script to `fix-types.cjs` so that we could then standardise the module type for @headlessui/tailwindcss package as a whole.

* Fix esm import of tailwindcss/plugin

ESM imports need to specify the filename extension when importing individual files.

* update changelog

---------

Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
2024-05-29 16:17:06 +02:00
Jordan Pittman c25e2e6036 Fix CJS types (#2880)
* Fix Vue type error

* Add separate CTS types

* Add “Are The Types Wrong” CLI

* wip

* Bump node versions in workflows

* wip

* wip

* wip

* yolo

* yolo (again?)

* wip

* wip
2023-12-12 11:43:34 -05:00
Robin Malfait 39c5bd3230 Add @headlessui/tailwindcss plugin (#1487)
* add `@headlessui/tailwindcss` plugin

* expose `data-headlessui-state="..."` data attribute

All components that expose boolean props in their render prop / v-slot
will receive a `data-headlessui-state="..."` attribute.

If it exposes boolean values but all are false, then there will be an
empty `data-headlessui-state=""`. If the current component is rendering
a `Fragment` then we don't expose those attributes.

* use tailwindcss in `playground-react` and `playground-vue`

We were using the CDN, but now that we have the
`@headlessui/tailwindcss` plugin, it's a bit easier to configure it
natively and import the plugin.

* ensure to build the `@headlessui/tailwindcss` package before starting the playground

* refactor `listbox` example to use the @headlessui/tailwindcss plugin

* update changelog

* bump Tailwind CSS to latest insiders version

* correctly generate types

* type `tailwind.config.js` files for playgrounds

* add todo for when `:has()` is available
2022-05-24 22:51:02 +02:00