-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Adding Radio Input component #27
base: main
Are you sure you want to change the base?
Conversation
@ivyalin2015 Thank you for working on this! I left couple comments, could you please address them? |
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 also need index.tsx
file in the Radio
directory that exports Radio
components. This is necessary, because we want components/Radio
to be a module itself.
Furthermore, we need Checkbox to be exported from src/index.tsx
(to make it accessible from @stanfordspezi/spezi-web-design-system
module) and from package.json
(to make it accessible as @stanfordspezi/spezi-web-design-system/components/Radio
).
Referencing this PR should help: https://github.com/StanfordSpezi/spezi-web-design-system/pull/36/files
package.json
Outdated
@@ -206,11 +206,13 @@ | |||
"@radix-ui/react-checkbox": "^1.1.2", | |||
"@radix-ui/react-dialog": "^1.1.2", | |||
"@radix-ui/react-dropdown-menu": "^2.1.2", | |||
"@radix-ui/react-icons": "^1.3.2", |
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 don't need these dependencies.
…el in storybook SideLabel formatting caused the text + indicator not to be centered
Ready for another check! I had to modify one of the formatting features in SideLabel for this request. SideLabel.stories.tsx might need some styling edits for the Storybook so that the text and switch are centered. |
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.
Thank you for iterating on this. We're almost there!
Co-authored-by: Arkadiusz Bachorski <[email protected]>
…i-web-design-system into audrey/checkbox
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.
There are still conflicts in this branch. Please merge StanfordSpezi:main
into your branch, using git merge
.
Afterwards, please make sure that Radio
is exposed in the package.json
in the exports
.
That should be the last steps! :)
|
||
export const Default = () => ( | ||
<RadioGroup | ||
className="flex flex-col space-y-4" |
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.
There is still a className
here
const option1 = screen.getByTestId('option1') | ||
const option2 = screen.getByTestId('option2') | ||
|
||
fireEvent.click(option1) | ||
expect(option1).toBeChecked() | ||
expect(option2).not.toBeChecked() | ||
|
||
fireEvent.click(option2) | ||
expect(option2).toBeChecked() | ||
expect(option1).not.toBeChecked() |
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.
Good job! 🚀
Adding Radio Input component
♻️ Current situation & Problem
Add Radio input component
⚙️ Release Notes
📚 Documentation
Please ensure that you properly document any additions in conformance to Spezi Documentation Guide.
This RadioInput component provides a template to create a multiple choice question.
✅ Testing
Please ensure that the PR meets the testing requirements set by CodeCov and that new functionality is appropriately tested.
My tests mainly focus on rendering but do not include confirmation that different items can be selected.
📝 Code of Conduct & Contributing Guidelines
By submitting creating this pull request, you agree to follow our Code of Conduct and Contributing Guidelines: