Skip to content

Commit 06d6f08

Browse files
authored
fix: rename wrapper to tab wrapper (#4636)
* fix: rename wrapper to tab wrapper * docs: update * docs: update * docs: update * fix: rename wrapper to tab wrapper
1 parent 1965b84 commit 06d6f08

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@heroui/theme": patch
3+
---
4+
5+
Fix tabs slots "wrapper" rename to "tabWrapper" -- Breaking Change (#4552)

apps/docs/content/docs/components/tabs.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ function AppTabs() {
199199
- **tabContent**: The tab content slot, it wraps the tab content.
200200
- **cursor**: The cursor slot, it wraps the cursor. This is only visible when `disableAnimation=false`
201201
- **panel**: The panel slot, it wraps the tab panel (content).
202+
- **tabWrapper**: The tab wrapper slot, it wraps the tab and the tab content.
202203

203204
### Custom Styles
204205

@@ -343,7 +344,7 @@ You can customize the `Tabs` component by passing custom Tailwind CSS classes to
343344
},
344345
{
345346
attribute: "classNames",
346-
type: "Partial<Record<\"base\"\"tabList\"\"tab\"\"tabContent\"\"cursor\"\"panel\", string>>",
347+
type: "Partial<Record<\"base\"\"tabList\"\"tab\"\"tabContent\"\"cursor\"\"panel\"\"tabWrapper\", string>>",
347348
description: "Allows to set custom class names for the card slots.",
348349
default: "-"
349350
},

packages/components/tabs/src/use-tabs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ export function useTabs<T extends object>(originalProps: UseTabsProps<T>) {
171171
const getWrapperProps: PropGetter = useCallback(
172172
(props) => ({
173173
"data-slot": "tabWrapper",
174-
className: slots.wrapper({class: clsx(classNames?.wrapper, props?.className)}),
174+
className: slots.tabWrapper({class: clsx(classNames?.tabWrapper, props?.className)}),
175175
"data-placement": placement,
176176
"data-vertical":
177177
isVertical || placement === "start" || placement === "end" ? "vertical" : "horizontal",

packages/core/theme/src/components/tabs.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ const tabs = tv({
7272
// focus ring
7373
...dataFocusVisibleClasses,
7474
],
75-
wrapper: [],
75+
tabWrapper: [],
7676
},
7777
variants: {
7878
variant: {
@@ -166,15 +166,15 @@ const tabs = tv({
166166
start: {
167167
tabList: "flex-col",
168168
panel: "py-0 px-3",
169-
wrapper: "flex",
169+
tabWrapper: "flex",
170170
},
171171
end: {
172172
tabList: "flex-col",
173173
panel: "py-0 px-3",
174-
wrapper: "flex flex-row-reverse",
174+
tabWrapper: "flex flex-row-reverse",
175175
},
176176
bottom: {
177-
wrapper: "flex flex-col-reverse",
177+
tabWrapper: "flex flex-col-reverse",
178178
},
179179
},
180180
},

0 commit comments

Comments
 (0)