Commit Graph

254 Commits

Author SHA1 Message Date
Ryan Gossiaux
cdc0d86044 Add/improve slotProps handling for Label & Description
* Add slot props support to Label
* Refactor slot props usage in Description
* Add missing slot props to RadioGroupLabel and RadioGroupDescription
2022-01-27 16:04:15 -08:00
Ryan Gossiaux
0430f2d6b6 1.0.0-beta.8 2022-01-21 17:09:38 -08:00
Ryan Gossiaux
5e795d2d4f Fix typeahead search logic when repeating a letter
Fixes #35

This ports 186a4cfcef
2022-01-21 17:06:51 -08:00
Ryan Gossiaux
bc809ef590 Workaround tabIndex=-1 added to document body by SvelteKit
This ends up producing a lot of extra focus events that normally would not exist.

Fixes #36
Fixes #39
2022-01-21 16:17:16 -08:00
Ryan Gossiaux
ac1f86ac15 Add Label fixes and tests
Fixes #33
2022-01-20 15:05:11 -08:00
Ryan Gossiaux
6224278607 Add upstream HeadlessUI Label tests 2022-01-17 23:59:29 -05:00
Ryan Gossiaux
81806a98aa Upgrade svelte2tsx version to support slot prop spread
For #31 which will be fixed in the next release
2022-01-17 23:59:29 -05:00
Ryan Gossiaux
6d2aa60d22 Use new TS option to preserve imports in tests
These assertions were here to prevent imports (needed for svelte-inine-compile) from being removed.
2022-01-17 23:59:29 -05:00
Ryan Gossiaux
5d83d35e71 1.0.0-beta.7 2021-12-31 11:50:23 -10:00
Ryan Gossiaux
e16e27f04e Handle dynamically adding items in list components: Radio Group, Tabs, Listbox, Menu
Fixes #29

Upstream Headless UI handles this for Radio Group but not for the others. I didn't see any reason why not to implement this for the other ones too.
2021-12-31 11:46:00 -10:00
Ryan Gossiaux
b5b6854d2d Menu: fix typo slot => slotProps
This will have caused class as a function to not work correctly for Menu
2021-12-30 18:59:17 -10:00
Ryan Gossiaux
48f50d65d9 Expose <Portal> and <PortalGroup> components
After all, why not? Headless UI exposes them too, and now that I have some unit tests for them I feel more confident in it.
2021-12-30 17:52:32 -10:00
Ryan Gossiaux
00d92048dc Fix a few Transition-related tests 2021-12-30 17:52:03 -10:00
Ryan Gossiaux
839bb55e40 Add Portal tests 2021-12-30 17:31:16 -10:00
Ryan Gossiaux
b0a3eef486 Portal: make reactive correctly on changes to target from PortalGroup 2021-12-30 17:30:21 -10:00
Ryan Gossiaux
2911102eea Add Description tests 2021-12-30 16:36:37 -10:00
Ryan Gossiaux
3ff520d72d Use svelte-inline-compile library to add more unit tests (mostly slot prop)
This brings the number of tests from 381 => 424 which I'm pleased with.

It'd be nice to replace my TestRenderer tests with this but it's not worth the effort.
2021-12-30 15:43:39 -10:00
Ryan Gossiaux
72b0b838e4 RadioGroupOption: active slot prop should have boolean, not integer, value 2021-12-30 15:39:55 -10:00
Ryan Gossiaux
e0d64f9bfc TabPanel: add selected slot prop 2021-12-30 12:51:06 -10:00
Ryan Gossiaux
a9d57659fb Migrate Description to <Render> and pass slot props 2021-12-30 12:13:47 -10:00
Ryan Gossiaux
2b705fd1ae Fix tests after introduction of babel step 2021-12-30 09:56:22 -10:00
Ryan Gossiaux
809cf84164 Add open slot prop to <Menu> 2021-12-30 09:46:29 -10:00
Ryan Gossiaux
a96c4a2339 Add svelte-inline-compile 2021-12-30 09:41:42 -10:00
Ryan Gossiaux
3068c88f8c Add support for svelte-inline-compile to jest 2021-12-30 09:40:10 -10:00
Ryan Gossiaux
a9a0fd3109 1.0.0-beta.6 2021-12-29 11:01:57 -10:00
Ryan Gossiaux
0550274e88 Add .gitattributes to exclude test files from stats
Want this to show up as a Svelte library, not TS, and this seems to be the best way to do it.
2021-12-29 10:58:07 -10:00
Ryan Gossiaux
7578037da5 Add Tabs tests 2021-12-29 10:53:12 -10:00
Ryan Gossiaux
0996de1e6e Add test data to Tab components 2021-12-29 10:32:28 -10:00
Ryan Gossiaux
9772e49054 Fix active tab selection on mount
When this runs, $api.tabs has not been updated yet, so the calculation was not correct.
This caused various bugs like defaultIndex not working and aria-selected not being set, etc.
2021-12-29 10:29:26 -10:00
Ryan Gossiaux
70c68d00fe Tab: fix aria-controls
When porting, I thought I was being clever by just using ids instead of refs in $api.panels
But I didn't notice that the refs let you distinguish those panels which are rendered from those which are not.
My implementation had aria-controls= set for all tabs, even when their panels were not in the DOM.
2021-12-28 16:51:36 -10:00
Ryan Gossiaux
90e633f8a8 1.0.0-beta.5 2021-12-28 15:13:36 -10:00
Ryan Gossiaux
6bb337fb7a Add Popover tests 2021-12-28 15:12:46 -10:00
Ryan Gossiaux
d9117431d6 Add an id to PopoverOverlay 2021-12-28 15:12:16 -10:00
Ryan Gossiaux
5bff629363 PopoverButton: fix aria-controls when Popover is closed 2021-12-28 11:36:18 -10:00
Ryan Gossiaux
c99b74c089 Prettier
Didn't run this on every single file because it messes up the formatting of the some of the TestRenderer constructions
2021-12-28 09:28:36 -10:00
Ryan Gossiaux
23a98b50ed Add remaining Menu tests 2021-12-28 09:12:16 -10:00
Ryan Gossiaux
41774ec075 Fix searching for MenuItems 2021-12-28 09:08:51 -10:00
Ryan Gossiaux
d7348b35b6 Conditionally forward MenuItem click events only if the MenuItem is not disabled
This is obviously a lot easier in React, but at any rate this mimics upstream behavior here.
2021-12-28 09:03:43 -10:00
Ryan Gossiaux
2c09162fc0 Initial Menu tests 2021-12-27 22:00:10 -10:00
Ryan Gossiaux
fe0388cc44 Misc fixes to Menus
* Disabled prop not forwarded correctly to MenuButton
* Active element not set correctly when Menu is opened
* Log message had wrong component name
2021-12-27 21:58:34 -10:00
Ryan Gossiaux
6af4b2a3b6 Add initial RadioGroup tests
Basically all the ones that aren't annoying to write
2021-12-27 15:51:43 -08:00
Ryan Gossiaux
303c68f79c First pass at Listbox tests 2021-12-27 15:19:00 -08:00
Ryan Gossiaux
b37e0f3c9c Remaining Disclosure tests
Minus the render prop tests
2021-12-27 12:56:32 -08:00
Ryan Gossiaux
1bed7dbea7 Initial Disclosure tests 2021-12-26 23:36:37 -08:00
Ryan Gossiaux
206b83963e Fix a couple <Disclosure> mistakes
* Incorrect error messages from <DisclosurePanel>
* Not using buttonId correctly (don't think this had any practical impact though)
2021-12-26 22:58:55 -08:00
Ryan Gossiaux
d1940e5d16 Add nested dialog tests 2021-12-26 22:45:03 -08:00
Ryan Gossiaux
9bd9901ef6 Add more Dialog tests 2021-12-26 18:08:03 -08:00
Ryan Gossiaux
08021bbf21 Add support for <Form> tag 2021-12-26 18:07:47 -08:00
Ryan Gossiaux
b207405a1e Exclude test files from packaging 2021-12-26 17:41:58 -08:00
Ryan Gossiaux
76efee0e21 1.0.0-beta.4 2021-12-26 17:04:43 -08:00