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

[ToggleButton][ToggleButtonGroup] Create ToggleButton and ToggleButtonGroup #763

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

mj12albert
Copy link
Member

@mj12albert mj12albert commented Oct 28, 2024

@mj12albert mj12albert added new feature New feature or request component: toggle button This is the name of the generic UI component, not the React module! labels Oct 28, 2024
@mui-bot
Copy link

mui-bot commented Oct 28, 2024

Netlify deploy preview

https://deploy-preview-763--base-ui.netlify.app/

Generated by 🚫 dangerJS against 8702100

@mj12albert mj12albert force-pushed the feat/toggle-button branch 4 times, most recently from 6c0fe92 to 6e04229 Compare October 28, 2024 17:06
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Oct 30, 2024
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Oct 30, 2024
@mj12albert mj12albert force-pushed the feat/toggle-button branch 5 times, most recently from 9bcba83 to 3a74374 Compare October 31, 2024 14:07
@mj12albert mj12albert changed the title [ToggleButton] Create ToggleButton [ToggleButton][ToggleButtonGroup] Create ToggleButton and ToggleButtonGroup Oct 31, 2024
@mj12albert mj12albert force-pushed the feat/toggle-button branch 2 times, most recently from 7cc24fd to b06a97d Compare October 31, 2024 15:17
@mj12albert mj12albert added the component: button group This is the name of the generic UI component, not the React module! label Oct 31, 2024
@mj12albert mj12albert force-pushed the feat/toggle-button branch 10 times, most recently from bcdd1cc to 7c449d8 Compare November 1, 2024 07:52
@mj12albert mj12albert force-pushed the feat/toggle-button branch 4 times, most recently from 5d873bf to e4f7794 Compare November 7, 2024 14:47
@mj12albert mj12albert marked this pull request as ready for review November 8, 2024 04:56
@mj12albert mj12albert force-pushed the feat/toggle-button branch 3 times, most recently from 03bcd17 to dd0c57d Compare November 11, 2024 03:43
@@ -25,6 +25,7 @@ const CompositeRoot = React.forwardRef(function CompositeRoot(
itemSizes,
loop,
cols,
isRtl,
Copy link
Contributor

Choose a reason for hiding this comment

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

rtl without is is fine; we match HTML naming without is indicators

function App() {
const [activeIndex, setActiveIndex] = React.useState(0);
return (
<CompositeRoot activeIndex={activeIndex} onActiveIndexChange={setActiveIndex}>
Copy link
Contributor

Choose a reason for hiding this comment

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

Composite sets data-active internally, but we use data-highlighted for our components. We could remove the data-active attr internally in Composite and use the highlighted: boolean ownerState instead to apply data-highlighted

Copy link
Member Author

Choose a reason for hiding this comment

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

846fde7
@atomiks it would still be in CompositeItem right?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, the active part of its ownerState should be removed, or changed to highlighted

Comment on lines +109 to +115
## RTL

Use the `direction` prop to configure a RTL toggle button group:

```tsx
<ToggleButtonGroup.Root direction="rtl">{/* toggle buttons */}</ToggleButtonGroup.Root>
```
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this match the native dir prop instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: toggle button This is the name of the generic UI component, not the React module! new feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ToggleButtonGroup] Implement ToggleButtonGroup [ToggleButton] Implement ToggleButton
3 participants