Commit Graph

81 Commits

Author SHA1 Message Date
Robin Malfait 2f987be5b9 bump to 1.4.2 2021-11-08 11:15:43 +01:00
Robin Malfait 452b2c2852 bump version to 1.4.1 2021-08-30 14:23:52 +02:00
Robin Malfait d25f80ae9d bump version to 1.4.0 2021-07-29 12:56:11 +02:00
Robin Malfait da314b6b79 bump version to 1.3.0 2021-06-21 11:47:06 +02:00
Robin Malfait e56dd07e16 Improve react peer deps (#622)
* ensure react-dom is also a peer dependency

Co-authored-by: =?UTF-8?q?S=C3=A9bastien=20Vanvelthem?= <belgattitude@gmail.com>

* prepare peer dependencies for React 18

* update changelog

Co-authored-by: =?UTF-8?q?S=C3=A9bastien=20Vanvelthem?= <belgattitude@gmail.com>
2021-06-15 17:48:41 +02:00
Dmitry Ishkov abe3e1b988 Support tree-shaking by enabling preserveModules (#602) 2021-06-15 11:55:13 +02:00
Robin Malfait d0e27ff25c Update react peer dependency version range (#544)
* update react peer dependency version range

* update changelog
2021-05-19 12:30:52 +02:00
Robin Malfait a8bbd0ecee bump versions 2021-05-10 12:08:05 +02:00
Robin Malfait 7d517f6413 bump versions 2021-04-28 10:34:50 +02:00
Robin Malfait 719db69123 bump version to 1.1.0 2021-04-26 15:47:43 +02:00
Robin Malfait 6722e9e79f bump version to 1.0! 2021-04-14 17:42:58 +02:00
Robin Malfait c88b53eac1 provide description in package.json
Also making sure that the README is being published.
2021-04-14 17:41:48 +02:00
Robin Malfait 67d09e1c27 bump versions 2021-04-02 15:22:35 +02:00
Robin Malfait 71730fea12 bump version 2021-02-11 19:39:44 +01:00
Robin Malfait 43effbbe29 v0.3.0 2021-02-06 16:30:08 +01:00
Robin Malfait 9b0d9e136a bump dependencies (#177)
* bump root dependencies

* bump react related dependencies

* update browserslist db

* remove obsolete shared dependency
2021-01-29 15:14:59 +01:00
Robin Malfait 24725216e4 fix: outside click refocus bug (#114)
* add watch script

* make interactions in Vue and React consistent

* re-work focus restoration

When we click outside of the Menu or Listbox, we want to
restore the focus to the Button, *unless* we clicked on/in an element
that is focusable in itself. For example, when the Menu is open and you
click in an input field, the input field should stay focused. We should
also close the Menu itself at this point.

* add examples with multiple elements

* bump dependencies
2020-10-20 15:38:12 +02:00
Robin Malfait aab23c9077 feat: add render features + render strategy (#106)
* add unmount strategy to README (React)

* add unmount strategy to README (Vue)

* add different render features (React)

* use render features in Menu and Listbox (React)

* add different render features (Vue)

* use render features in Menu and Listbox (Vue)

* bump dependencies

* add ability to change the ref property using `refName`

Example use case:

```tsx
// Some components have this API with an `innerRef`. The suggested approach is to use
// `React.forwardRef` so that you get the actual `ref` value. However if you already have this
// `innerRef` API than we can use the `refName="innerRef"` to give the `ref` prop a good name. It
// defaults to `ref` so that it still works everywhere else.

function MyButton({ innerRef, ...props }) {
  return <button ref={innerRef} {...props} />
}

<Menu.Button as={MyButton} refName="innerRef" />
```

* small cleanup, move refs to props we control

* add tests for the render abstraction (Render)

+ use the unique __ symbol as a default value in the Props type for the
  omitable props.

* use render features in Transition (React)

* add/update Transition examples to also showcase the `unmount={false}` render strategy

* bump dependencies

* add example with nested unmount/hide transitions

* add unmount to Transition documentation
2020-10-18 15:34:05 +02:00
Robin Malfait 7d4af1ad3a chore: bump dependencies (#100) 2020-10-14 12:51:10 +02:00
Robin Malfait 5bb7df9d93 chore: bump dependencies (#90) 2020-10-12 12:27:11 +02:00
Robin Malfait deee4dfa20 bump dependencies 2020-10-08 15:33:47 +02:00
Robin Malfait 6ea5c93457 chore: bump dependencies 2020-10-06 11:01:46 +02:00
Adam Wathan b07a298188 v0.2.0 2020-10-05 21:50:45 -04:00
dependabot[bot] 7c46f27674 chore: Bump framer-motion from 2.7.6 to 2.7.7 (#42)
Bumps [framer-motion](https://github.com/framer/motion) from 2.7.6 to 2.7.7.
- [Release notes](https://github.com/framer/motion/releases)
- [Changelog](https://github.com/framer/motion/blob/main/CHANGELOG.md)
- [Commits](https://github.com/framer/motion/commits)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-10-05 14:13:30 +02:00
dependabot[bot] a5a3ae8bc1 chore: Bump @types/react from 16.9.49 to 16.9.50 (#43)
Bumps [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) from 16.9.49 to 16.9.50.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-10-05 14:09:35 +02:00
Robin Malfait 58ff88698b feat: add Listbox component (#3)
* make jest monorepo aware

* add @testing-library/jest-dom for custom matchers

This way we can use expect(element).toHaveAttribute(key, value?)

* abstract keys enum

* change type to unknown, because we don't know the return value

* update use-id hook, make it suspense aware

Thanks Reach UI!

* hoist the disposables collection

* add accessbility assertions for listbox

Also made it consistent for the Menu component and simplified some of the assertions

* add use-computed hook

This allows us re-render when hooks change, but also return a value. So this is a combination of useEffect and a useState value.

* add Listbox component

* bump dependencies

* add listbox example

* add lint-staged

This way we will only lint the files that have been staged and ready to be committed instead of the whole codebase

* add missing prevent defaults

* improve tests to verify that we can actually update the value of the listbox

* scroll the active listbox item into view

* small optimization, only focus "Nothing" on pointer leave when we are the active item

We used to always go to "Nothing" on pointer leave. And while this code
doesn't get called often, it *gets* called if you are using your arrow
keys and the mouse pointer is still over the list.

* bump dependencies

Also moved the tailwind dependencies to the root

* fix typo

* drop the default Transition inside the Menu and Listbox components

* update examples to reflect drop of default Transition wrapper

* rename Listbox.{Items,Item} to Listbox.{Options,Option}

Also rename all instances of `item` to `option` in tests and comments
and what have you...

* fix typo

* drop disabled prop, use aria-disabled only
2020-10-02 11:05:41 +02:00
Robin Malfait 878e417139 version 0.1.3 2020-09-29 00:01:50 +02:00
Robin Malfait 93f315b066 add prepublishOnly hooks 2020-09-25 16:11:52 +02:00
Robin Malfait 8add6f43f7 version 0.1.1 2020-09-24 12:56:25 +02:00
Robin Malfait 458466aa2a add playground:build script 2020-09-20 21:18:39 +02:00
Robin Malfait 8b546f054b setup @headlessui/react package 2020-09-16 18:20:49 +02:00