You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(tabs,button): migrate TabItem to BaseButton, add TabItem maxWidth with truncation tooltip, disallow Button children prop (#2689)
<!--
How to write a good PR title:
- Follow [the Conventional Commits
specification](https://www.conventionalcommits.org/en/v1.0.0/).
- Give as much context as necessary and as little as possible
- Prefix it with [WIP] while it’s a work in progress
-->
## Self Checklist
- [x] I wrote a PR title in **English** and added an appropriate
**label** to the PR.
- [x] I wrote the commit message in **English** and to follow [**the
Conventional Commits
specification**](https://www.conventionalcommits.org/en/v1.0.0/).
- [x] I [added the
**changeset**](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md)
about the changes that needed to be released. (or didn't have to)
- [x] I wrote or updated **documentation** related to the changes. (or
didn't have to)
- [x] I wrote or updated **tests** related to the changes. (or didn't
have to)
- [x] I tested the changes in various browsers. (or didn't have to)
- Windows: Chrome, Edge, (Optional) Firefox
- macOS: Chrome, Edge, Safari, (Optional) Firefox
## Related Issue
<!-- Link issues here, e.g. Fixes#1234 -->
Fixes#2688
## Summary
- refactor(button): disallow children prop
- refactor(tabs): migrate TabItem to BaseButton
- feat(tabs): add maxWidth and truncation tooltip
This PR migrates TabItem from Button to BaseButton, introduces an
optional maxWidth prop for TabItem, and shows a Tooltip only when the
label is truncated. It also disallows the children prop in Button to
enforce the intended API.
## Details
- `Tabs`
- Migrate TabItem to BaseButton to simplify styling and reduce Button
dependencies
- Port only tertiary + monochrome-light styles
- Default background transparent; hover uses var(--bg-black-lighter)
- Border radius: s/m = radius-8, l = radius-12
- Inactive text color aligned to var(--txt-black-darker)
- Add maxWidth to TabItem; ellipsis detection via useElementTruncated
- Tooltip shows the full label only when truncated (disabled otherwise)
- `Button`
- Disallow children prop (typed as never) to encourage using text,
leftContent, rightContent
- `Docs`
- Update Tabs stories to cover long labels and truncation behavior
## Breaking change? (Yes/No)
Yes
- Button no longer accepts children. Passing children will produce type
errors.
- Migration:
- Replace `<Button><span>Label</span></Button>` with `<Button
text="Label" />`
- Move any leading/trailing visuals into leftContent/rightContent
- Example:
- Before: `<Button><Icon />Save</Button>`
- After: `<Button text="Save" leftContent={<Icon />} />`
## References
[related
thread](https://desk.channel.io/root/threads/groups/WebBezier-124831/68bea56a6f3b4b747751/68bea56a6f3b4b747751)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- Breaking Changes
- Button이 더 이상 children을 허용하지 않습니다. 대신 text, leftContent, rightContent를
사용하세요.
- New Features
- Tabs: TabItem에 선택적 maxWidth 속성 추가.
- Tab 라벨이 실제로 잘릴 때만 Tooltip이 자동으로 표시됩니다.
- 콘텐츠 절단 감지 훅 추가로 툴팁 표시가 동적으로 처리됩니다.
- Style
- Tabs: 크기별 Tab 버튼 레이아웃, 활성/호버/비활성 상태 스타일(.TabItemButton 등) 추가.
- Chores
- 배포용 변경 로그(changeset) 추가 및 마이너 릴리스 준비.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
0 commit comments