Commit Graph

74 Commits

Author SHA1 Message Date
Ryan Gossiaux
df0939fe22 Fix TransitionChild class when no class prop is passed 2021-12-20 22:29:13 -08:00
Ryan Gossiaux
cfe1aaa55e Switch Popover to <Render>
Also fix a bug where PopoverPanel was missing an id
2021-12-20 22:28:46 -08:00
Ryan Gossiaux
93e7148e1b Move Disclosure to <Render> 2021-12-20 19:26:04 -08:00
Ryan Gossiaux
c73d9bf919 Add <Render> to Dialog 2021-12-20 18:34:38 -08:00
Ryan Gossiaux
6bb8554890 Rename slot to slotProps in <Render>
Conflicted with Svelte's use of the `slot` attribute
2021-12-20 18:26:12 -08:00
Ryan Gossiaux
4388273b8b Add <Render> to Switch 2021-12-20 18:15:28 -08:00
Ryan Gossiaux
25a4b0f6e5 Add <Render> usage to <Listbox> 2021-12-20 17:47:02 -08:00
Ryan Gossiaux
5783a20cdc Modify event forwarding to allow opting out
For events which we dispatch ourselves, we can use this to skip the forwarding. Otherwise the listeners don't fire.

svelte-material-ui uses a custom dispatch to get around this issue, I think.
2021-12-20 17:44:20 -08:00
Ryan Gossiaux
31ac0934b0 Add Label custom element 2021-12-20 17:44:00 -08:00
Ryan Gossiaux
c69de8050f Convert Menu to <Render> 2021-12-20 15:46:51 -08:00
Ryan Gossiaux
dccb6fbbd9 Implement initial Render component
This supports everything except the RenderStrategy/hidden/unmount type stuff, while I'll add in a later commit.
2021-12-20 15:45:22 -08:00
Ryan Gossiaux
a84941285b Add initial batch of elements
May need to add more but this is a basic start
2021-12-20 15:44:23 -08:00
Ryan Gossiaux
2dbbec3c0b Add forwardEventsBuilder from svelte-material-ui 2021-12-20 15:43:54 -08:00
Ryan Gossiaux
f105042545 Clean up store types & initial values
Treating these as Readable for better safety from consuming code

Fixes #10
2021-12-19 01:08:50 -08:00
Ryan Gossiaux
8e890b2e80 Standardize event names to be consistent with @headlessui-react
Was previously using Vue names since Vue was the primary reference while porting, but as the public API is closer to the React one it makes sense to use that.

Fixes #8
2021-12-19 00:29:34 -08:00
Ryan Gossiaux
63d44e125c Improve a few more types, including StateDefinition["foo"] usage
Fixes #5
2021-12-19 00:09:44 -08:00
Ryan Gossiaux
305dc1543f $api?. => $api. when possible
Now that this stuff has all been cleaned up with useXContext functions
2021-12-18 23:56:37 -08:00
Ryan Gossiaux
70910c05b0 Standardize context naming
Fixes #7
2021-12-18 23:18:45 -08:00
Ryan Gossiaux
03399fc954 Fix listbox label ref 2021-12-18 23:17:56 -08:00
Ryan Gossiaux
4d47ba89a6 Clean up Listbox store/context usage
Fixes #9
2021-12-18 23:07:55 -08:00
Ryan Gossiaux
1966219b30 Refactor Popover stores/contexts 2021-12-18 22:36:57 -08:00
Ryan Gossiaux
9e45d92929 Refactor to useOpenClosed
Fixes #6
2021-12-18 21:36:09 -08:00
Ryan Gossiaux
4a6edb4e1c Fix some more type errors and turn on TS strict mode
Possible now that svelte2tsx has fixed a few bugs!
2021-12-18 18:48:15 -08:00
Ryan Gossiaux
3b5e036dc4 Add more examples 2021-12-18 18:36:58 -08:00
Ryan Gossiaux
39cc12c8ef Add some more examples 2021-12-18 16:39:05 -08:00
Ryan Gossiaux
2c8be5047d Fix Transition events
In Svelte the component updates/unmount happen in a different order than in React. The `mounted` guard doesn't work in Svelte and needs a different approach.
2021-12-18 15:41:18 -08:00
Ryan Gossiaux
2d6bd4658e Fix entered styles on Transitions
Broke this when I started manually managing classes.
2021-12-18 15:35:53 -08:00
Ryan Gossiaux
ea87a75d35 Add tailwind forms plugin for example pages 2021-12-18 14:44:58 -08:00
Ryan Gossiaux
993db81cfa Fix TransitionChild to preserve class while transitioning
This fixes an issue where the example component-examples/dropdown did not render the leave transition
2021-12-17 16:52:10 -08:00
Ryan Gossiaux
c5ed870827 Assorted fixes
Type fixes, support a couple more classes as functions for the examples, and switch TabPanels to registering ids instead of refs
2021-12-17 14:22:19 -08:00
Ryan Gossiaux
6076a60837 Fix PopoverPanel focus issue
Fixes #20
2021-12-16 23:06:36 -08:00
Ryan Gossiaux
f5130c6cc1 Add use= support to Popover
Fixes #21

Not sure it's worth doing this component by component instead of figuring out <Render> first but w/e
2021-12-16 16:35:09 -08:00
Ryan Gossiaux
3b340fbde5 Fix transition duration in popover example 2021-12-16 16:34:45 -08:00
Ryan Gossiaux
cc69cb9a93 Copy over a few more playground examples 2021-12-16 16:28:57 -08:00
Ryan Gossiaux
1e6d735537 Move dialog example over to grouped imports 2021-12-16 16:22:27 -08:00
Ryan Gossiaux
0911f5efdd Fix some imports 2021-12-16 16:22:14 -08:00
Ryan Gossiaux
4f74dd8ca9 Fix Transition undefined/null bug 2021-12-15 18:40:00 -08:00
Ryan Gossiaux
da6d2c3be6 Fix more TS errors in strict mode 2021-12-15 14:49:19 -08:00
Ryan Gossiaux
5b36ce9404 Fix various type errors with strict mode 2021-12-15 14:06:33 -08:00
Ryan Gossiaux
543c1263e3 Also fix label/description context usage 2021-12-15 10:31:14 -08:00
Ryan Gossiaux
dbfb2c227e Move contexts over to useXContext model
Fixes #4
2021-12-15 10:13:01 -08:00
Ryan Gossiaux
f1edb17609 Fix transitioning away
Fixes #17

The root problem here, which took me ages to find, was that `state` should not be reactive. It should only be set once the child has finished, via the nesting context.
2021-12-14 22:56:55 -08:00
Ryan Gossiaux
20e5360291 Remove extra open= prop in dialog example
I mistakenly added this in reaction to an error
2021-12-14 22:54:59 -08:00
Ryan Gossiaux
df96d74003 A couple fixes to Dialog
Quickfix for SSR
Let it take open from OpenClose context properly
2021-12-14 22:54:06 -08:00
Ryan Gossiaux
47c6918fd2 Fix PortalGroup context 2021-12-14 16:01:47 -08:00
Ryan Gossiaux
7de1e35524 Add index.ts files 2021-12-14 15:28:26 -08:00
Ryan Gossiaux
4fb49c546a Add wrapper for TransitionChild 2021-12-14 15:28:05 -08:00
Ryan Gossiaux
a5fac38a7a Add svelte2tsx 2021-12-14 15:27:26 -08:00
Ryan Gossiaux
b0e2c3d619 Remove busted tailwind button focus classes
The examples repo is using an old version of tailwind + a plugin. shadow-outline-foo doesn't exist in base Tailwind and I cba to find the equivalent right now.
2021-12-14 13:55:21 -08:00
Ryan Gossiaux
0185f9f9f6 Don't render Transition contents if they're not visible
Fixes #14
2021-12-14 13:54:34 -08:00