Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: tailwindlabs/headlessui
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: @headlessui/react@v1.7.17
Choose a base ref
...
head repository: tailwindlabs/headlessui
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: @headlessui/react@v1.7.18
Choose a head ref

Commits on Aug 17, 2023

  1. 2
    Copy the full SHA
    8505d7a View commit details

Commits on Aug 21, 2023

  1. fix: double onClose on mobile dialog outClick (#2690)

    * fix: double onClose on mobile dialog outClick
    
    * Fix CS
    
    * Add fix to Vue useOutsideClick
    
    * Update changelog
    
    * Fix CS
    
    ---------
    
    Co-authored-by: Jordan Pittman <jordan@cryptica.me>
    DavideFrancescon and thecrypticace authored Aug 21, 2023
    2
    Copy the full SHA
    6a88fd5 View commit details

Commits on Aug 22, 2023

  1. Lazily resolve default containers in <Dialog> (#2697)

    * Lazily resolve default containers in `<Dialog>`
    
    * Update changelog
    thecrypticace authored Aug 22, 2023
    2
    Copy the full SHA
    5a3d556 View commit details

Commits on Aug 23, 2023

  1. Fix Portal SSR hydration mismatches (#2700)

    * Register portal based on element presence in the DOM
    
    This always coincides with `onMounted` currently but that’s about to change
    
    * Mount element lazily for portals
    
    This prevent’s SSR hydration issues and matches the behavior of React’s `<Portal>` element
    
    * Fix portal tests
    
    * Update comment
    
    * Update changelog
    thecrypticace authored Aug 23, 2023
    2
    Copy the full SHA
    6444e01 View commit details

Commits on Aug 28, 2023

  1. Fix warning

    thecrypticace committed Aug 28, 2023
    2
    Copy the full SHA
    4b0ab1e View commit details
  2. Ensure hidden TabPanel components are hidden from the accessibility…

    … tree (#2708)
    
    * explicitly add the `aria-hidden="true"` attribute
    
    The `Hidden` component only adds the `aria-hidden` by default if the
    `Focusable` feature is passed. In our case we don't want it to be
    focusable so therefore we didn't pass this feature flag.
    
    Because we didn't pass the `Focusable` feature, the `display: hidden`
    was used which makes it completely unfocusable to the keyboard of the
    user which is what we want.
    
    However, the VoiceOver cursor _can_ get into those elements. Adding the
    `aria-hidden` manually to these tabs solves the issue.
    
    * update changelog
    RobinMalfait authored Aug 28, 2023
    2
    Copy the full SHA
    fd17c26 View commit details
  3. Add support for role="alertdialog" to <Dialog> component (#2709)

    * WIP
    
    * Add warning for unsupported roles to `<Dialog>`
    
    * Update assertions
    
    * Add test for React
    
    * Add support for `role=alertdialog` to Vue
    
    ---------
    
    Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
    thecrypticace and adamwathan authored Aug 28, 2023
    2
    Copy the full SHA
    a6a2382 View commit details
  4. Update changelog

    thecrypticace committed Aug 28, 2023
    2
    Copy the full SHA
    c6ac692 View commit details

Commits on Aug 29, 2023

  1. Ensure blurring the Combobox.Input component closes the Combobox (#…

    …2712)
    
    * ensure blurring the `Combobox.Input` component closes the `Combobox`
    
    * update changelog
    
    * select the value on blur if we are in single value mode
    RobinMalfait authored Aug 29, 2023
    2
    Copy the full SHA
    134c0fb View commit details

Commits on Aug 30, 2023

  1. Improve release workflow (#2719)

    * add scripts to help with automating releases
    
    * add prepare-release and release workflows
    
    * bump actions from v2 to v3
    
    * use `github.ref_name` for getting the tag name
    
    * ensure we use `**` for matching tags with slashes in them
    RobinMalfait authored Aug 30, 2023
    2
    Copy the full SHA
    2b27d9f View commit details
  2. Allow <button> to be in nested components in <PopoverButton> (#2715)

    * Tweak `dom()` helper
    
    The helper can currently return a component instance when it should only ever return a DOM element. So, we fix the implementation to return null if it’s not an `Element` _and_ adjust the types such that if a `ComponentPublicInstance` is passed we change the return type to `Element`.
    
    * Specialize DOM helper to HTML elements
    
    Technically it could be an SVG element but much of Headless UI assumes HTML elements all over. So we’ll adjust the types to assume HTMLElement instead.
    
    * Allow `dom()` helper to return any `Node` type
    
    It doesn’t actually always return an HTMLElement but we have behavior that relies on it returning and checking for `Comment` nodes
    
    * Detect `<button>` nested in components inside `<PopoverButton>`
    
    * Update changelog
    thecrypticace authored Aug 30, 2023
    2
    Copy the full SHA
    c92757d View commit details
  3. Don't overwrite user-defined template refs when rendering (#2720)

    * Merge vnode refs when rendering
    
    In some cases if we used our own ref (we do this in `<TransitionRoot>` for instance) and rendered slot children we would wipe out  user-specified refs. So we set a flag when calling `cloneVNode` to merge our refs and any user-specified refs.
    
    * Update changelog
    thecrypticace authored Aug 30, 2023
    2
    Copy the full SHA
    5a1e2e4 View commit details

Commits on Aug 31, 2023

  1. Add immediate prop to <Combobox /> for immediately opening the Co…

    …mbobox when the `input` receives focus (#2686)
    
    * Allow to open combobox on input focus
    
    * Close focused combobox with openOnFocus prop when clicking the button
    
    * ensure tabbing through a few fields, doesn't result in an incorrectly selected item
    
    When you have a fwe inputs such as:
    
    ```html
    <form>
       <input />
       <input />
       <input />
       <Combobox>
          <Combobox.Input />
       </Combobox>
       <input />
       <input />
       <input />
    </form>
    ```
    
    Tabbing through this list will open the combobox once you are on the
    input field. When you continue tabbing, the first item would be
    selected. However, if the combobox is not marked as nullable, it means
    that just going through the form means that we set a value we can't
    unset anymore.
    
    We still want to open the combobox, we just don't want to select
    anything in this case.
    
    * only `openOnFocus` if the `<Combobox.Input />` is focused from the
    outside
    
    If the focus is coming from the `<Combobox.Button />` or as a side
    effect of selecting an `<Combobox.Option />` then we don't want to
    re-open the `<Combobox />`
    
    * update tests to ensure that the `Combobox.Input` is the active element
    
    * order `handleBlur` and `handleFocus` the same way in Vue & React
    
    * only select the active option when the Combobox wasn't opened by focusing the input field
    
    * convert to `immediate` prop on the `Combobox` itself
    
    * update changelog
    
    * ensure we see the "relatedTarget" in Safari
    
    Safari doesn't fire a `focus` event when clicking a button, therefore it
    does not become the `document.activeElement`, and events like `blur` or
    `focus` doesn't set the button as the `event.relatedTarget`.
    
    Keeping track of a history like this solves that problem. We already had
    the code for the `FocusTrap` component.
    
    ---------
    
    Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
    tzurbaev and RobinMalfait authored Aug 31, 2023
    2
    Copy the full SHA
    fa95262 View commit details
  2. Allow changes to the className prop when the <Transition /> compo…

    …nent is currently not transitioning (#2722)
    
    * allow changes to the `className` when we are _not_ transitioning
    
    * update changelog
    RobinMalfait authored Aug 31, 2023
    2
    Copy the full SHA
    d4aa86d View commit details
  3. Export component interfaces and mark them as internal (#2313)

    * export component interfaces, and mark them as internal
    
    This is not ideal because we don't want these to be public. However, if
    you are creating components on top of Headless UI, the TypeScript
    compiler needs access to them.
    
    So now they are public in a sense, but you shouldn't be interacting with
    them directly.
    
    Co-authored-by: Jordan Pittman <jordan@cryptica.me>
    
    * Update changelog
    
    ---------
    
    Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
    thecrypticace and RobinMalfait authored Aug 31, 2023
    2
    Copy the full SHA
    8e93cd0 View commit details

Commits on Sep 11, 2023

  1. Sort imports automatically (#2741)

    * add `prettier-plugin-organize-imports` and `prettier-plugin-tailwindcss`
    
    * format
    
    * bump Tailwind CSS
    
    * format playgrounds using updated Tailwind CSS and Prettier plugins
    
    * use import syntax
    RobinMalfait authored Sep 11, 2023
    2
    Copy the full SHA
    76dd10e View commit details
  2. 2
    Copy the full SHA
    f2179f3 View commit details

Commits on Sep 15, 2023

  1. Add virtual prop to Combobox component (#2740)

    * type timezones in playground data
    
    * add `@tanstack/react-virtual` and `@tanstack/vue-virtual`
    
    * use latest stable Tailwind CSS version
    
    * add Combobox with virtual prop example
    
    * add `virtual` prop to `Combobox`
    
    Co-authored-by: Jordan Pittman <jordan@cryptica.me>
    
    * add tests for `virtual` prop
    
    - Also wrap `click` helpers in `act` for React (use `rawClick` without
      `act` in tests related to `Transition`)
    
    * update changelog
    
    ---------
    
    Co-authored-by: Jordan Pittman <jordan@cryptica.me>
    RobinMalfait and thecrypticace authored Sep 15, 2023
    2
    Copy the full SHA
    f016dc5 View commit details

Commits on Sep 19, 2023

  1. 2
    Copy the full SHA
    2a64c13 View commit details

Commits on Sep 20, 2023

  1. Make sure as={Fragment} doesn’t result in a render loop (#2760)

    * Make sure `as={Fragment}` doesn’t result in a render loop
    
    * Add comment about usage
    
    * Fix render loop on popover panel too
    
    * Update changelog
    thecrypticace authored Sep 20, 2023
    2
    Copy the full SHA
    0f34486 View commit details

Commits on Sep 25, 2023

  1. 2
    Copy the full SHA
    d4a94cb View commit details

Commits on Oct 2, 2023

  1. Implement new virtual API for the Combobox component (#2779)

    * add `(Vue)` or `(React)` to playground header
    
    * show amount of items in virtualized example
    
    * improve calculating the active index
    
    * disable strict mode
    
    * update virtualized playground examples with preferred API
    
    * optimize `calculateActiveIndex`
    
    * implement new `virtual` API
    
    * update changelog
    RobinMalfait authored Oct 2, 2023
    2
    Copy the full SHA
    99cdf91 View commit details

Commits on Oct 4, 2023

  1. Fix state data attribute in Vue (#2787)

    * Add tests
    
    * Fix state data attribute in Vue
    thecrypticace authored Oct 4, 2023
    2
    Copy the full SHA
    20a224a View commit details
  2. Update changelog

    thecrypticace committed Oct 4, 2023
    2
    Copy the full SHA
    1469b85 View commit details

Commits on Nov 2, 2023

  1. Fix VoiceOver bug for Listbox component in Chrome (#2824)

    * fix VoiceOver bug for Listbox in Chrome
    
    Chrome currently has a bug if you use a `Listbox` with a `Label` and use
    the `aria-multiselectable` attribute. This combination will cause
    VoiceOver to _not_ announce the `role="option"` elements when
    interacting with them.
    
    If we drop the `aria-multiselectable` OR the `aria-labelledby` it starts
    working. Alternatively replacing `aria-labelledby` with `aria-label`
    won't work either.
    
    I filed a Chrome bug report about this here: https://bugs.chromium.org/p/chromium/issues/detail?id=1498261
    
    ---
    
    Luckily there is a workaround in our `Listbox` implementation. Right now
    we always require the `Listbox.Button` to be there. The
    `Listbox.Options` component doesn't work on its own in our
    implementation.
    
    This means that whenever we open the `Listbox` that we have to go via
    the `Listbox.Button`. This `Listbox.Button` is already labelled by the
    `Listbox.Label` if there is one.
    
    This also means that we can safely drop the `id` of the label inside the
    `aria-labelledby` from the `Listbox.Options`.
    
    This wouldn't have worked if our `Listbox.Options` could be used in a
    standalone way without the `Listbox.Button`.
    
    At the end of the day the hierarchy looks like this:
    
    - Options is labelled by the Button
       - Button is labelled by the Label
          - Label
    
    Fixes: #2817
    
    * update changelog
    RobinMalfait authored Nov 2, 2023
    2
    Copy the full SHA
    bfacb64 View commit details

Commits on Nov 17, 2023

  1. Copy the full SHA
    c2c43c3 View commit details
  2. 1
    Copy the full SHA
    475db7c View commit details
  3. 1
    Copy the full SHA
    d3c2a19 View commit details
  4. Fix example

    thecrypticace committed Nov 17, 2023
    1
    Copy the full SHA
    24486b3 View commit details

Commits on Dec 5, 2023

  1. Fix outside click detection when component is mounted in the Shadow D…

    …OM (#2866)
    
    * Fix outside click detection when component is mounted in the Shadow DOM
    
    * Fix code style
    
    * Fix error
    thecrypticace authored Dec 5, 2023
    2
    Copy the full SHA
    7b30e06 View commit details
  2. 2
    Copy the full SHA
    6846231 View commit details
  3. Update changelog

    thecrypticace committed Dec 5, 2023
    2
    Copy the full SHA
    c2096b0 View commit details

Commits on Dec 12, 2023

  1. 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
    thecrypticace authored Dec 12, 2023
    2
    Copy the full SHA
    c25e2e6 View commit details
  2. Fix error when transition classes contain new lines (#2871)

    * fix DOMException when remove class with '\n' character in react 'transition' component
    
    * Split classes on all whitespace
    
    * Revert "fix DOMException when remove class with '\n' character in react 'transition' component"
    
    This reverts commit 76e8354.
    
    * fix typo
    
    * Add test
    
    * Fix CS
    
    * Update changelog
    
    ---------
    
    Co-authored-by: Jordan Pittman <jordan@cryptica.me>
    KingManiya and thecrypticace authored Dec 12, 2023
    2
    Copy the full SHA
    c24ba86 View commit details
  3. Update changelog

    thecrypticace committed Dec 12, 2023
    2
    Copy the full SHA
    01a34cb View commit details

Commits on Jan 6, 2024

  1. Copy the full SHA
    c6b5a81 View commit details
  2. fix incorrect activeIndex when handling Focus.Previous

    This is already available in the React version, now let's sync it in the
    Vue version as well.
    RobinMalfait committed Jan 6, 2024
    Copy the full SHA
    32b0117 View commit details
  3. improve iOS scroll locking (Vue)

    The scroll locking on iOS was flickering in some scenario's due to the
    `window.scrollTo(0, 0)` related code. Instead of that, we now cancel
    touch moves instead but still allow it in scrollable containers inside
    the Dialog itself.
    
    This was already applied in the React version, but this adds the same
    improvement to the Vue version as well.
    RobinMalfait committed Jan 6, 2024
    Copy the full SHA
    279356b View commit details

Commits on Jan 8, 2024

  1. Copy the full SHA
    ac64a80 View commit details
  2. prepare patch release

    RobinMalfait committed Jan 8, 2024
    Copy the full SHA
    d625361 View commit details
  3. Copy the full SHA
    afb3c8c View commit details
Showing with 11,878 additions and 9,882 deletions.
  1. +26 −10 .github/workflows/main.yml
  2. +55 −0 .github/workflows/prepare-release.yml
  3. +4 −4 .github/workflows/release-insiders.yml
  4. +63 −0 .github/workflows/release.yml
  5. +13 −3 package.json
  6. +20 −1 packages/@headlessui-react/CHANGELOG.md
  7. +7 −2 packages/@headlessui-react/package.json
  8. +2,576 −2,903 packages/@headlessui-react/src/components/combobox/combobox.test.tsx
  9. +499 −142 packages/@headlessui-react/src/components/combobox/combobox.tsx
  10. +1 −1 packages/@headlessui-react/src/components/description/description.test.tsx
  11. +8 −11 packages/@headlessui-react/src/components/description/description.tsx
  12. +144 −16 packages/@headlessui-react/src/components/dialog/dialog.test.tsx
  13. +77 −45 packages/@headlessui-react/src/components/dialog/dialog.tsx
  14. +8 −9 packages/@headlessui-react/src/components/disclosure/disclosure.test.tsx
  15. +32 −30 packages/@headlessui-react/src/components/disclosure/disclosure.tsx
  16. +3 −4 packages/@headlessui-react/src/components/focus-trap/focus-trap.test.tsx
  17. +18 −44 packages/@headlessui-react/src/components/focus-trap/focus-trap.tsx
  18. +1 −1 packages/@headlessui-react/src/components/label/label.test.tsx
  19. +8 −11 packages/@headlessui-react/src/components/label/label.tsx
  20. +22 −24 packages/@headlessui-react/src/components/listbox/listbox.test.tsx
  21. +39 −46 packages/@headlessui-react/src/components/listbox/listbox.tsx
  22. +16 −16 packages/@headlessui-react/src/components/menu/menu.test.tsx
  23. +40 −43 packages/@headlessui-react/src/components/menu/menu.tsx
  24. +12 −13 packages/@headlessui-react/src/components/popover/popover.test.tsx
  25. +50 −49 packages/@headlessui-react/src/components/popover/popover.tsx
  26. +2 −4 packages/@headlessui-react/src/components/portal/portal.test.tsx
  27. +16 −19 packages/@headlessui-react/src/components/portal/portal.tsx
  28. +8 −11 packages/@headlessui-react/src/components/radio-group/radio-group.test.tsx
  29. +39 −35 packages/@headlessui-react/src/components/radio-group/radio-group.tsx
  30. +6 −7 packages/@headlessui-react/src/components/switch/switch.test.tsx
  31. +34 −27 packages/@headlessui-react/src/components/switch/switch.tsx
  32. +1 −1 packages/@headlessui-react/src/components/tabs/tabs.ssr.test.tsx
  33. +6 −7 packages/@headlessui-react/src/components/tabs/tabs.test.tsx
  34. +33 −36 packages/@headlessui-react/src/components/tabs/tabs.tsx
  35. +1 −1 packages/@headlessui-react/src/components/transitions/transition.ssr.test.tsx
  36. +57 −6 packages/@headlessui-react/src/components/transitions/transition.test.tsx
  37. +43 −28 packages/@headlessui-react/src/components/transitions/transition.tsx
  38. +1 −2 packages/@headlessui-react/src/components/transitions/utils/transition.test.ts
  39. +1 −1 packages/@headlessui-react/src/components/transitions/utils/transition.ts
  40. +78 −29 packages/@headlessui-react/src/hooks/document-overflow/handle-ios-locking.ts
  41. +1 −1 packages/@headlessui-react/src/hooks/document-overflow/use-document-overflow.ts
  42. +1 −2 packages/@headlessui-react/src/hooks/use-disposables.ts
  43. +0 −1 packages/@headlessui-react/src/hooks/use-document-event.ts
  44. +0 −1 packages/@headlessui-react/src/hooks/use-event-listener.ts
  45. +1 −1 packages/@headlessui-react/src/hooks/use-flags.ts
  46. +1 −1 packages/@headlessui-react/src/hooks/use-id.ts
  47. +3 −3 packages/@headlessui-react/src/hooks/use-inert.test.tsx
  48. +1 −1 packages/@headlessui-react/src/hooks/use-inert.tsx
  49. +1 −1 packages/@headlessui-react/src/hooks/use-is-initial-render.ts
  50. +1 −1 packages/@headlessui-react/src/hooks/use-iso-morphic-effect.ts
  51. +1 −1 packages/@headlessui-react/src/hooks/use-on-unmount.ts
  52. +5 −0 packages/@headlessui-react/src/hooks/use-outside-click.ts
  53. +1 −2 packages/@headlessui-react/src/hooks/use-resolve-button-type.ts
  54. +3 −2 packages/@headlessui-react/src/hooks/use-root-containers.tsx
  55. +1 −1 packages/@headlessui-react/src/hooks/use-sync-refs.ts
  56. +1 −1 packages/@headlessui-react/src/hooks/use-text-value.ts
  57. +1 −3 packages/@headlessui-react/src/hooks/use-transition.ts
  58. +2 −2 packages/@headlessui-react/src/hooks/use-tree-walker.ts
  59. +0 −1 packages/@headlessui-react/src/hooks/use-window-event.ts
  60. +1 −1 packages/@headlessui-react/src/index.ts
  61. +2 −3 packages/@headlessui-react/src/internal/focus-sentinel.tsx
  62. +7 −4 packages/@headlessui-react/src/internal/hidden.tsx
  63. +1 −8 packages/@headlessui-react/src/internal/open-closed.tsx
  64. +1 −7 packages/@headlessui-react/src/internal/portal-force-root.tsx
  65. +2 −9 packages/@headlessui-react/src/internal/stack-context.tsx
  66. +5 −5 packages/@headlessui-react/src/test-utils/accessibility-assertions.ts
  67. +1 −2 packages/@headlessui-react/src/test-utils/execute-timeline.ts
  68. +2 −3 packages/@headlessui-react/src/test-utils/interactions.test.tsx
  69. +26 −1 packages/@headlessui-react/src/test-utils/interactions.ts
  70. +1 −1 packages/@headlessui-react/src/test-utils/snapshot.ts
  71. +8 −3 packages/@headlessui-react/src/test-utils/ssr.tsx
  72. +1 −1 packages/@headlessui-react/src/types.ts
  73. +24 −0 packages/@headlessui-react/src/utils/active-element-history.ts
  74. +46 −38 packages/@headlessui-react/src/utils/calculate-active-index.ts
  75. +1 −1 packages/@headlessui-react/src/utils/owner.ts
  76. +4 −5 packages/@headlessui-react/src/utils/render.test.tsx
  77. +68 −24 packages/@headlessui-react/src/utils/render.ts
  78. +3 −1 packages/@headlessui-tailwindcss/CHANGELOG.md
  79. +8 −7 packages/@headlessui-tailwindcss/README.md
  80. +1 −1 packages/@headlessui-tailwindcss/jest.setup.js
  81. +5 −1 packages/@headlessui-tailwindcss/package.json
  82. +4 −3 packages/@headlessui-tailwindcss/scripts/fix-types.js
  83. +19 −1 packages/@headlessui-vue/CHANGELOG.md
  84. +9 −2 packages/@headlessui-vue/package.json
  85. +3,142 −3,298 packages/@headlessui-vue/src/components/combobox/combobox.test.ts
  86. +464 −151 packages/@headlessui-vue/src/components/combobox/combobox.ts
  87. +4 −6 packages/@headlessui-vue/src/components/description/description.test.ts
  88. +3 −6 packages/@headlessui-vue/src/components/description/description.ts
  89. +168 −28 packages/@headlessui-vue/src/components/dialog/dialog.test.ts
  90. +33 −19 packages/@headlessui-vue/src/components/dialog/dialog.ts
  91. +1 −1 packages/@headlessui-vue/src/components/disclosure/disclosure.srr.test.ts
  92. +153 −199 packages/@headlessui-vue/src/components/disclosure/disclosure.test.ts
  93. +11 −12 packages/@headlessui-vue/src/components/disclosure/disclosure.ts
  94. +84 −101 packages/@headlessui-vue/src/components/focus-trap/focus-trap.test.ts
  95. +10 −35 packages/@headlessui-vue/src/components/focus-trap/focus-trap.ts
  96. +4 −6 packages/@headlessui-vue/src/components/label/label.test.ts
  97. +2 −5 packages/@headlessui-vue/src/components/label/label.ts
  98. +13 −15 packages/@headlessui-vue/src/components/listbox/listbox.test.tsx
  99. +16 −19 packages/@headlessui-vue/src/components/listbox/listbox.ts
  100. +13 −13 packages/@headlessui-vue/src/components/menu/menu.test.tsx
  101. +20 −20 packages/@headlessui-vue/src/components/menu/menu.ts
  102. +537 −647 packages/@headlessui-vue/src/components/popover/popover.test.ts
  103. +24 −25 packages/@headlessui-vue/src/components/popover/popover.ts
  104. +37 −38 packages/@headlessui-vue/src/components/portal/portal.test.ts
  105. +25 −12 packages/@headlessui-vue/src/components/portal/portal.ts
  106. +9 −11 packages/@headlessui-vue/src/components/radio-group/radio-group.test.ts
  107. +12 −14 packages/@headlessui-vue/src/components/radio-group/radio-group.ts
  108. +7 −8 packages/@headlessui-vue/src/components/switch/switch.test.tsx
  109. +11 −14 packages/@headlessui-vue/src/components/switch/switch.ts
  110. +1 −1 packages/@headlessui-vue/src/components/tabs/tabs.ssr.test.ts
  111. +834 −942 packages/@headlessui-vue/src/components/tabs/tabs.test.ts
  112. +10 −13 packages/@headlessui-vue/src/components/tabs/tabs.ts
  113. +2 −2 packages/@headlessui-vue/src/components/transitions/transition.ssr.test.ts
  114. +4 −6 packages/@headlessui-vue/src/components/transitions/transition.test.ts
  115. +18 −16 packages/@headlessui-vue/src/components/transitions/transition.ts
  116. +1 −2 packages/@headlessui-vue/src/components/transitions/utils/transition.test.ts
  117. +1 −1 packages/@headlessui-vue/src/components/transitions/utils/transition.ts
  118. +136 −85 packages/@headlessui-vue/src/hooks/document-overflow/handle-ios-locking.ts
  119. +2 −2 packages/@headlessui-vue/src/hooks/document-overflow/use-document-overflow.ts
  120. +1 −1 packages/@headlessui-vue/src/hooks/use-controllable.ts
  121. +5 −6 packages/@headlessui-vue/src/hooks/use-inert.test.ts
  122. +1 −7 packages/@headlessui-vue/src/hooks/use-inert.ts
  123. +7 −2 packages/@headlessui-vue/src/hooks/use-outside-click.ts
  124. +2 −2 packages/@headlessui-vue/src/hooks/use-resolve-button-type.ts
  125. +4 −3 packages/@headlessui-vue/src/hooks/use-root-containers.ts
  126. +1 −1 packages/@headlessui-vue/src/hooks/use-text-value.ts
  127. +1 −1 packages/@headlessui-vue/src/hooks/use-tree-walker.ts
  128. +1 −1 packages/@headlessui-vue/src/index.ts
  129. +2 −3 packages/@headlessui-vue/src/internal/focus-sentinel.ts
  130. +6 −2 packages/@headlessui-vue/src/internal/hidden.ts
  131. +1 −8 packages/@headlessui-vue/src/internal/open-closed.ts
  132. +1 −8 packages/@headlessui-vue/src/internal/portal-force-root.ts
  133. +1 −11 packages/@headlessui-vue/src/internal/stack-context.ts
  134. +5 −5 packages/@headlessui-vue/src/test-utils/accessibility-assertions.ts
  135. +2 −3 packages/@headlessui-vue/src/test-utils/execute-timeline.ts
  136. +2 −3 packages/@headlessui-vue/src/test-utils/interactions.test.ts
  137. +18 −0 packages/@headlessui-vue/src/test-utils/interactions.ts
  138. +2 −2 packages/@headlessui-vue/src/test-utils/vue-testing-library.ts
  139. +24 −0 packages/@headlessui-vue/src/utils/active-element-history.ts
  140. +49 −38 packages/@headlessui-vue/src/utils/calculate-active-index.ts
  141. +18 −3 packages/@headlessui-vue/src/utils/dom.ts
  142. +2 −2 packages/@headlessui-vue/src/utils/owner.ts
  143. +49 −3 packages/@headlessui-vue/src/utils/render.test.ts
  144. +4 −3 packages/@headlessui-vue/src/utils/render.ts
  145. +3 −0 packages/playground-react/data.ts
  146. +1 −1 packages/playground-react/next.config.js
  147. +2 −1 packages/playground-react/package.json
  148. +4 −4 packages/playground-react/pages/_app.tsx
  149. +1 −1 packages/playground-react/pages/_document.tsx
  150. +1 −1 packages/playground-react/pages/_error.tsx
  151. +3 −3 packages/playground-react/pages/combinations/form.tsx
  152. +2 −2 packages/playground-react/pages/combinations/tabs-in-dialog.tsx
  153. +2 −2 packages/playground-react/pages/combobox/combobox-countries.tsx
  154. +192 −0 packages/playground-react/pages/combobox/combobox-virtual-with-empty-states.tsx
  155. +215 −0 packages/playground-react/pages/combobox/combobox-virtualized.tsx
  156. +2 −2 packages/playground-react/pages/combobox/combobox-with-pure-tailwind.tsx
  157. +1 −1 packages/playground-react/pages/combobox/command-palette-with-groups.tsx
  158. +1 −1 packages/playground-react/pages/combobox/command-palette.tsx
  159. +1 −1 packages/playground-react/pages/combobox/multi-select.tsx
  160. +1 −1 packages/playground-react/pages/dialog/dialog-focus-issue.tsx
  161. +2 −2 packages/playground-react/pages/dialog/dialog-scroll-issue.tsx
  162. +2 −3 packages/playground-react/pages/dialog/dialog-with-shadow-children.tsx
  163. +8 −8 packages/playground-react/pages/dialog/dialog.tsx
  164. +5 −5 packages/playground-react/pages/dialog/scrollable-dialog.tsx
  165. +4 −4 packages/playground-react/pages/dialog/scrollable-page-with-dialog.tsx
  166. +0 −1 packages/playground-react/pages/disclosure/disclosure.tsx
  167. +1 −3 packages/playground-react/pages/listbox/listbox-with-pure-tailwind.tsx
  168. +1 −1 packages/playground-react/pages/listbox/multi-select.tsx
  169. +1 −1 packages/playground-react/pages/listbox/multiple-elements.tsx
  170. +5 −5 packages/playground-react/pages/menu/menu-with-floating-ui.tsx
  171. +4 −4 packages/playground-react/pages/menu/menu-with-framer-motion.tsx
  172. +5 −5 packages/playground-react/pages/menu/menu-with-popper.tsx
  173. +3 −4 packages/playground-react/pages/menu/menu-with-transition-and-popper.tsx
  174. +2 −3 packages/playground-react/pages/menu/menu-with-transition.tsx
  175. +2 −3 packages/playground-react/pages/menu/menu.tsx
  176. +2 −3 packages/playground-react/pages/menu/multiple-elements.tsx
  177. +1 −1 packages/playground-react/pages/popover/popover.tsx
  178. +1 −1 packages/playground-react/pages/radio-group/radio-group.tsx
  179. +5 −5 packages/playground-react/pages/suspense/portal.tsx
  180. +1 −1 packages/playground-react/pages/switch/switch-with-pure-tailwind.tsx
  181. +3 −3 packages/playground-react/pages/tabs/tabs-with-pure-tailwind.tsx
  182. +3 −3 packages/playground-react/pages/transitions/component-examples/dropdown.tsx
  183. +4 −4 packages/playground-react/pages/transitions/component-examples/modal.tsx
  184. +1 −1 packages/playground-react/pages/transitions/component-examples/nested/hidden.tsx
  185. +1 −1 packages/playground-react/pages/transitions/component-examples/nested/unmount.tsx
  186. +1 −1 packages/playground-react/pages/transitions/component-examples/peek-a-boo.tsx
  187. +2 −2 packages/playground-react/pages/transitions/full-page-examples/full-page-transition.tsx
  188. +5 −5 packages/playground-react/pages/transitions/full-page-examples/layout-with-sidebar.tsx
  189. +1 −2 packages/playground-react/pages/transitions/react-hot-toast.tsx
  190. +1 −1 packages/playground-react/utils/hooks/use-popper.ts
  191. +2 −1 packages/playground-vue/package.json
  192. +1 −1 packages/playground-vue/src/KeyCaster.vue
  193. +1 −0 packages/playground-vue/src/Layout.vue
  194. +1 −1 packages/playground-vue/src/components/combinations/tabs-in-dialog.vue
  195. +149 −0 packages/playground-vue/src/components/combobox/_virtual-example.vue
  196. +146 −0 packages/playground-vue/src/components/combobox/combobox-open-on-focus.vue
  197. +165 −0 packages/playground-vue/src/components/combobox/combobox-virtual-with-empty-states.vue
  198. +37 −0 packages/playground-vue/src/components/combobox/combobox-virtualized.vue
  199. +4 −4 packages/playground-vue/src/components/dialog/dialog.vue
  200. +1 −1 packages/playground-vue/src/components/dialog/slide-over.vue
  201. +1 −1 packages/playground-vue/src/components/menu/menu-with-floating-ui.vue
  202. +1 −1 packages/playground-vue/src/components/menu/menu-with-popper.vue
  203. +1 −1 packages/playground-vue/src/components/menu/menu-with-transition-and-popper.vue
  204. +1 −1 packages/playground-vue/src/components/menu/menu-with-transition.vue
  205. +1 −1 packages/playground-vue/src/components/menu/menu.vue
  206. +2 −2 packages/playground-vue/src/components/menu/multiple-elements.vue
  207. +1 −1 packages/playground-vue/src/components/tabs/simple-tabs.vue
  208. +1 −1 packages/playground-vue/src/components/tabs/tabs.vue
  209. +3 −0 packages/playground-vue/src/data.ts
  210. +1 −1 packages/playground-vue/src/playground-utils/hooks/use-popper.js
  211. +1 −1 packages/playground-vue/src/router.ts
  212. +1 −1 packages/playground-vue/vite.config.js
  213. +8 −2 scripts/build.sh
  214. +15 −0 scripts/package-path.js
  215. +25 −0 scripts/release-channel.js
  216. +29 −0 scripts/release-notes.js
  217. +406 −62 yarn.lock
36 changes: 26 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -10,20 +10,20 @@ concurrency:
cancel-in-progress: true

env:
NODE_VERSION: 16.x
NODE_VERSION: 18.x

jobs:
install:
runs-on: ubuntu-latest

steps:
- name: Begin CI...
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Use Node ${{ env.NODE_VERSION }}
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-modules-${{ hashFiles('**/yarn.lock') }}
@@ -38,8 +38,8 @@ jobs:

steps:
- name: Begin CI...
uses: actions/checkout@v2
- uses: actions/cache@v2
uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-modules-${{ hashFiles('**/yarn.lock') }}
@@ -54,8 +54,8 @@ jobs:

steps:
- name: Begin CI...
uses: actions/checkout@v2
- uses: actions/cache@v2
uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-modules-${{ hashFiles('**/yarn.lock') }}
@@ -71,12 +71,28 @@ jobs:

steps:
- name: Begin CI...
uses: actions/checkout@v2
- uses: actions/cache@v2
uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Build
run: yarn build
env:
CI: true

check-types:
runs-on: ubuntu-latest
needs: [build]

steps:
- name: Begin CI...
uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Check Types
run: yarn lint-types
env:
CI: true
55 changes: 55 additions & 0 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Prepare Release

on:
workflow_dispatch:
push:
tags:
- '**'

env:
CI: true

permissions:
contents: read

jobs:
build:
permissions:
contents: write # for softprops/action-gh-release to create GitHub release

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18]

steps:
- uses: actions/checkout@v3

- run: git fetch --tags -f

- name: Resolve version
id: vars
run: |
echo "TAG_NAME=${{ github.ref_name }}" >> $GITHUB_ENV
- name: Get release notes
run: |
RELEASE_NOTES=$(npm run release-notes $TAG_NAME --silent)
echo "RELEASE_NOTES<<EOF" >> $GITHUB_ENV
echo "$RELEASE_NOTES" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'

- name: Release
uses: softprops/action-gh-release@v1
with:
draft: true
tag_name: ${{ env.TAG_NAME }}
body: |
${{ env.RELEASE_NOTES }}
8 changes: 4 additions & 4 deletions .github/workflows/release-insiders.yml
Original file line number Diff line number Diff line change
@@ -14,20 +14,20 @@ jobs:

strategy:
matrix:
node-version: [16]
node-version: [18]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'

- name: Use cached node_modules
id: cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-modules-${{ hashFiles('**/yarn.lock') }}
63 changes: 63 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Release

on:
release:
types: [published]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read

env:
CI: true

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18]

steps:
- uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'

- name: Use cached node_modules
id: cache
uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-modules-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
nodeModules-
- name: Install dependencies
run: yarn install --frozen-lockfile
env:
CI: true

- name: Test
run: |
yarn test || yarn test || yarn test || exit 1
env:
CI: true

- name: Calculate environment variables
run: |
echo "TAG_NAME=${{ github.event.tag_name }}" >> $GITHUB_ENV
echo "RELEASE_CHANNEL=$(npm run release-channel $TAG_NAME --silent)" >> $GITHUB_ENV
echo "PACKAGE_PATH=$(npm run package-path $TAG_NAME --silent)" >> $GITHUB_ENV
- name: Publish
run: npm publish ${{ env.PACKAGE_PATH }} --tag ${{ env.RELEASE_CHANNEL }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
16 changes: 13 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -20,7 +20,11 @@
"build": "npm-run-all -p 'react build' 'vue build'",
"test": "./scripts/test.sh",
"lint": "./scripts/lint.sh",
"lint-check": "CI=true ./scripts/lint.sh"
"lint-check": "CI=true ./scripts/lint.sh",
"lint-types": "CI=true yarn workspaces run lint-types",
"release-channel": "node ./scripts/release-channel.js",
"release-notes": "node ./scripts/release-notes.js",
"package-path": "node ./scripts/package-path.js"
},
"husky": {
"hooks": {
@@ -34,9 +38,14 @@
"printWidth": 100,
"semi": false,
"singleQuote": true,
"trailingComma": "es5"
"trailingComma": "es5",
"plugins": [
"prettier-plugin-organize-imports",
"prettier-plugin-tailwindcss"
]
},
"devDependencies": {
"@arethetypeswrong/cli": "^0.13.3",
"@swc/core": "^1.2.131",
"@swc/jest": "^0.2.17",
"@testing-library/jest-dom": "^5.16.4",
@@ -48,7 +57,8 @@
"lint-staged": "^12.2.1",
"npm-run-all": "^4.1.5",
"prettier": "^2.6.2",
"prettier-plugin-tailwindcss": "^0.1.4",
"prettier-plugin-organize-imports": "^3.2.3",
"prettier-plugin-tailwindcss": "0.4",
"rimraf": "^3.0.2",
"tslib": "^2.3.1",
"typescript": "^4.9.5"
21 changes: 20 additions & 1 deletion packages/@headlessui-react/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -9,6 +9,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Nothing yet!

## [1.7.18] - 2024-01-08

### Fixed

- Don't call `<Dialog>`'s `onClose` twice on mobile devices ([#2690](https://github.com/tailwindlabs/headlessui/pull/2690))
- Lazily resolve default containers in `<Dialog>` ([#2697](https://github.com/tailwindlabs/headlessui/pull/2697))
- Ensure hidden `Tab.Panel` components are hidden from the accessibility tree ([#2708](https://github.com/tailwindlabs/headlessui/pull/2708))
- Add support for `role="alertdialog"` to `<Dialog>` component ([#2709](https://github.com/tailwindlabs/headlessui/pull/2709))
- Ensure blurring the `Combobox.Input` component closes the `Combobox` ([#2712](https://github.com/tailwindlabs/headlessui/pull/2712))
- Allow changes to the `className` prop when the `<Transition />` component is currently not transitioning ([#2722](https://github.com/tailwindlabs/headlessui/pull/2722))
- Export (internal-only) component interfaces for TypeScript compiler ([#2313](https://github.com/tailwindlabs/headlessui/pull/2313))
- Fix infinite render-loop for `<Disclosure.Panel>` and `<Popover.Panel>` when `as={Fragment}` ([#2760](https://github.com/tailwindlabs/headlessui/pull/2760))
- Fix VoiceOver bug for `Listbox` component in Chrome ([#2824](https://github.com/tailwindlabs/headlessui/pull/2824))
- Fix outside click detection when component is mounted in the Shadow DOM ([#2866](https://github.com/tailwindlabs/headlessui/pull/2866))
- Fix CJS types ([#2880](https://github.com/tailwindlabs/headlessui/pull/2880))
- Fix error when transition classes contain new lines ([#2871](https://github.com/tailwindlabs/headlessui/pull/2871))
- Improve iOS locking ([7721aca](https://github.com/tailwindlabs/headlessui/commit/7721acaecea2008c2d7e8ab29cc8d45b70bb021e))

## [1.7.17] - 2023-08-17

### Fixed
@@ -535,7 +553,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Everything!

[unreleased]: https://github.com/tailwindlabs/headlessui/compare/@headlessui/react@v1.7.17...HEAD
[unreleased]: https://github.com/tailwindlabs/headlessui/compare/@headlessui/react@v1.7.18...HEAD
[1.7.18]: https://github.com/tailwindlabs/headlessui/compare/@headlessui/react@v1.7.17...@headlessui/react@v1.7.18
[1.7.17]: https://github.com/tailwindlabs/headlessui/compare/@headlessui/react@v1.7.16...v1.7.17
[1.7.16]: https://github.com/tailwindlabs/headlessui/compare/@headlessui/react@v1.7.15...@headlessui/react@v1.7.16
[1.7.15]: https://github.com/tailwindlabs/headlessui/compare/@headlessui/react@v1.7.14...@headlessui/react@v1.7.15
9 changes: 7 additions & 2 deletions packages/@headlessui-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@headlessui/react",
"version": "1.7.17",
"version": "1.7.18",
"description": "A set of completely unstyled, fully accessible UI components for React, designed to integrate beautifully with Tailwind CSS.",
"main": "dist/index.cjs",
"typings": "dist/index.d.ts",
@@ -11,7 +11,10 @@
"dist"
],
"exports": {
"types": "./dist/index.d.ts",
"types": {
"import": "./dist/index.d.ts",
"require": "./dist/index.d.cts"
},
"import": "./dist/headlessui.esm.js",
"require": "./dist/index.cjs"
},
@@ -34,6 +37,7 @@
"watch": "../../scripts/watch.sh --external:react --external:react-dom",
"test": "../../scripts/test.sh",
"lint": "../../scripts/lint.sh",
"lint-types": "yarn run attw -P",
"playground": "yarn workspace playground-react dev",
"clean": "rimraf ./dist"
},
@@ -51,6 +55,7 @@
"snapshot-diff": "^0.8.1"
},
"dependencies": {
"@tanstack/react-virtual": "^3.0.0-beta.60",
"client-only": "^0.0.1"
}
}
Loading