Skip to content

Conversation

@reidbarber
Copy link
Member

@reidbarber reidbarber commented Oct 6, 2023

Contains docs and more examples for how to create custom Spectrum components using RAC and Tailwind.

Can be previewed here: https://codesandbox.io/p/sandbox/silly-zhukovsky-m4s422?file=%2Fsrc%2FApp.js%3A1%2C1

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

🧢 Your Project:

@rspbot
Copy link

rspbot commented Oct 6, 2023

@rspbot
Copy link

rspbot commented Oct 6, 2023

@rspbot
Copy link

rspbot commented Oct 10, 2023

@reidbarber reidbarber changed the title [WIP] [Tech Week] RAC + Spectrum + Tailwind examples [Tech Week] RAC + Spectrum + Tailwind examples Oct 10, 2023
@rspbot
Copy link

rspbot commented Oct 10, 2023

Copy link
Member

@snowystinger snowystinger left a comment

Choose a reason for hiding this comment

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

very minor comments

let [value, setValue] = useState("");
let [isTextFieldFocused, setIsTextFieldFocused] = useState(false);
return (
<Group
Copy link
Member

Choose a reason for hiding this comment

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

this example seems inverted from the docs https://react-spectrum.adobe.com/react-aria/Group.html#example

I think you could stop tracking the focused state if you flipped it around

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 wanted to have the focus ring around the entire bar if the input was focused, and just around the button if it is focused. I think that's different behavior than what you're talking about (I may be wrong).

Copy link
Member

Choose a reason for hiding this comment

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

Ah, I see, it'd require a little more work to do that. But now I'm no longer sure if it should be done because they really are two components, not really a composite like NumberField and Combobox are with their buttons...

Maybe there should be a form around the Group? and the button should submit? That way, if a user is typing in the textfield and hits enter, it'd "search" automatically?

@rspbot
Copy link

rspbot commented Oct 11, 2023

Copy link
Member

@snowystinger snowystinger left a comment

Choose a reason for hiding this comment

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

Happy for followup, in general it looks good. Do you have a new link for the codesandbox? i still can't use arrow keys to navigate the star rating in the link in the description

let [value, setValue] = useState("");
let [isTextFieldFocused, setIsTextFieldFocused] = useState(false);
return (
<Group
Copy link
Member

Choose a reason for hiding this comment

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

Ah, I see, it'd require a little more work to do that. But now I'm no longer sure if it should be done because they really are two components, not really a composite like NumberField and Combobox are with their buttons...

Maybe there should be a form around the Group? and the button should submit? That way, if a user is typing in the textfield and hits enter, it'd "search" automatically?

@reidbarber
Copy link
Member Author

i still can't use arrow keys to navigate the star rating in the link in the description

@snowystinger Can you try refreshing? It seems to be working for me. Let me know if it still doesn't work and I can investigate.

@adobe adobe deleted a comment from rspbot Oct 16, 2023
Copy link
Member

@yihuiliao yihuiliao left a comment

Choose a reason for hiding this comment

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

lgtm! also just gonna pop in and say that i'm able to use the arrow keys to navigate the star rating if that's helpful at all

@rspbot
Copy link

rspbot commented Oct 17, 2023

@rspbot
Copy link

rspbot commented Oct 17, 2023

## API Changes

unknown top level export { type: 'identifier', name: 'Column' }
unknown top level export { type: 'identifier', name: 'Column' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }

@reidbarber reidbarber merged commit 282ff7a into main Oct 17, 2023
@reidbarber reidbarber deleted the rac-spectrum-tailwind-improvements branch October 17, 2023 14:55
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.

5 participants