-
-
Notifications
You must be signed in to change notification settings - Fork 121
[popups] Refine OpenChangeReason
#1782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
"type": "((open: boolean, event: Event | undefined, reason: OpenChangeReason | undefined) => void)", | ||
"type": "((open: boolean, event: Event | undefined, reason: {} | undefined) => void)", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@michaldudak the API extractor can't handle StringUnion | 'extra-string'
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, there was a bug in how nested unions were handled. Could you update the extractor to https://pkg.pr.new/michaldudak/react-api-extractor@a21d7b8 and see if it helps?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works 👍
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
444f0f4
to
7bacf23
Compare
cd2ce56
to
81c22b4
Compare
Signed-off-by: atomiks <cc.glows@gmail.com>
fd746da
to
cbd2316
Compare
@@ -248,7 +250,7 @@ export namespace useDialogRoot { | |||
onOpenChange?: ( | |||
open: boolean, | |||
event: Event | undefined, | |||
reason: OpenChangeReason | undefined, | |||
reason: DialogOpenChangeReason | undefined, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should use the publicly exported type here (AlertDialog.Root.OpenChangeReason
). If DialogOpenChangeReason
is used, devs won't know where to import it from.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose type only imports don't lead to circular dependency issues?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The generator can't handle the public type of Select.Root.OpenChangeReason
. To be fair, the Actions
type is also not clear where it exists from at the moment, so I could just do OpenChangeReason
, and maybe the generator (or some manual code) can automatically prepend the component name + Root
. Would be useful to still have overrides
in this case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once I update the API extractor to handle types in namespaces, we shouldn't need to use @type
annotations manually. Still, an ability to override could be useful sometimes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does seem like they're still needed here
commit: |
20140fe
to
40cd658
Compare
Signed-off-by: atomiks <cc.glows@gmail.com>
042d905
to
52cf9d5
Compare
Closes #1773
click
->trigger-press
hover
->trigger-hover
focus
->trigger-focus
Not final reasons:
close-press
occurs when clicking the theClose
button partitem-press
occurs when clickingMenu.Item
orSelect.Item
cancel-open
occurs when theymouseup
aftermousedown
outside of the menu or select