Skip to content
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

DS fixes and updates #1275

Merged
merged 18 commits into from
Aug 27, 2024
Merged

DS fixes and updates #1275

merged 18 commits into from
Aug 27, 2024

Conversation

jossmac
Copy link
Member

@jossmac jossmac commented Aug 26, 2024

Some things I noticed while integrating with Keystone.

Updates:

  • Support "isPending" prop on Button
  • Support "low" prominence Checkbox
  • Emphasise "selected" state on ActionButton
  • More prominent ActionBar
  • Increase TextArea min-height to 3 lines

Fixes:

  • Allow "focus" method on Picker ref
  • Defensive "current" selector on NavItem styles
  • Fix text truncation on Picker selected text
  • Clear slots of Content children—resolves issue with Calendar elements within Dialog receiving incorrect props
  • Fix issue with Tray when "size" provided to Dialog component

@jossmac jossmac requested a review from emmatown as a code owner August 26, 2024 12:07
Copy link

changeset-bot bot commented Aug 26, 2024

🦋 Changeset detected

Latest commit: 2fd964e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 14 packages
Name Type
@keystar/ui Patch
@keystar/docs Patch
@example/next-app Patch
@example/next-pages Patch
keystatic-docs Patch
@keystatic/core Patch
@example/astro-content Patch
@example/astro Patch
@example/localization Patch
@example/next-block-builder Patch
@keystatic/remix-test-app Patch
@keystatic/templates-astro Patch
@keystatic/templates-nextjs Patch
@keystatic/templates-remix Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Comment on lines 61 to 67
// @ts-expect-error FIXME: not sure how to properly resolve this type issue
useImperativeHandle(forwardedRef, () => ({
...triggerRef.current,
focus() {
state.setFocused(true);
},
}));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem right, forwardedRef is already being passed to FieldPrimitive? And what is being focused here? I assume not the trigger button since then overriding it here wouldn't change anything right? Also, not sure about spreading an HTMLElement like this since i think lots of methods wouldn't work since the this wouldn't be right + it would unnecessarily evaluate a bunch of getters, maybe something like this might make sense?

useImperativeHandle(forwardedRef, () => ({
  get trigger() {
    return triggerRef.currrent;
  },
  focus() {
    state.setFocused(true);
  },
}));

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll remove this from the PR and we can revisit later 👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit of context: Internally, spectrum packs and unpacks refs with useDOMRef, which lets them target the focusable element. I'd like to avoid that awkwardness but may have been a bit hasty in my implementation.

@jossmac jossmac merged commit fac7ba4 into main Aug 27, 2024
8 checks passed
@jossmac jossmac deleted the ds-fixes branch August 27, 2024 07:09
@github-actions github-actions bot mentioned this pull request Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants