Compare commits

...

10 Commits

Author SHA1 Message Date
Junior Garcia
8900d17479 chore: update QA workflow by removing Prettier steps and adjusting permissions for continuous release 2025-11-26 09:03:37 -03:00
Junior Garcia
2fc7b6971b chore: update repository URL in package.json files for react and styles packages 2025-11-26 08:57:39 -03:00
Junior Garcia
b7a74551e6 chore: remove test steps from QA workflow and update prettier command 2025-11-26 08:51:44 -03:00
Junior Garcia
29bd9c3008 chore: remove commitlint workflow configuration 2025-11-26 08:48:29 -03:00
Junior Garcia
d2d7aa4023 chore: add repository metadata to styles package.json 2025-11-26 08:44:16 -03:00
Junior Garcia
b138f7094b Merge branch 'v3' of github.com:heroui-inc/heroui into beta-3 2025-11-26 08:34:30 -03:00
Junior Garcia
133db1c5e6 chore: add additional branches to QA workflow for pull request triggers 2025-11-26 08:34:04 -03:00
Junior Garcia
ded91af578 Merge branch 'v3' of github.com:heroui-inc/heroui into beta-3 2025-11-26 08:32:42 -03:00
Junior Garcia
72f8a07eca chore: update release command in QA workflow to include styles and react packages 2025-11-26 08:32:11 -03:00
Junior Garcia
730922456b
feat(tabs): add hideSeparator prop to remove tab separators (#5938)
* feat(tabs): add hideSeparator prop to remove tab separators

* docs(tabs): update icon metadata for Tabs component
2025-11-24 16:20:11 -03:00
11 changed files with 113 additions and 73 deletions

View File

@ -4,6 +4,8 @@ on:
pull_request:
branches:
- canary
- v3
- 'beta-*'
jobs:
build:
@ -19,18 +21,6 @@ jobs:
- name: Build packages
run: pnpm build
tests:
name: Tests
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v4
- name: Install
uses: ./.github/common-actions/install
- name: Run tests
run: pnpm test
eslint:
name: ESLint
@ -45,18 +35,6 @@ jobs:
- name: Run ESLint
run: pnpm lint
prettier:
name: Prettier
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v4
- name: Install
uses: ./.github/common-actions/install
- name: Run prettier
run: pnpm format:check
types:
name: TypeScript
@ -75,9 +53,14 @@ jobs:
name: Continuous Release
if: github.repository == 'heroui-inc/heroui'
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout branch
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install
uses: ./.github/common-actions/install
@ -86,4 +69,4 @@ jobs:
run: pnpm build
- name: Release
run: pnpx pkg-pr-new publish --compact --pnpm './packages/components/*' './packages/core/*' './packages/hooks/*' './packages/utilities/*'
run: pnpx pkg-pr-new publish --pnpm './packages/styles' './packages/react'

View File

@ -1,43 +0,0 @@
name: Commitlint
on:
push:
branches: [main, canary, v3]
pull_request:
branches: [main, canary, v3]
permissions:
contents: read
pull-requests: read
jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- name: Checkout codebase
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install dependencies
uses: ./.github/common-actions/install
- name: Print versions
run: |
git --version
node --version
pnpm --version
pnpm commitlint --version
- name: Run commitlint
id: run_commitlint
uses: wagoid/commitlint-github-action@v6
env:
NODE_PATH: ${{ github.workspace }}/node_modules
with:
configFile: commitlint.config.mjs
- name: Show outputs
if: ${{ always() }}
run: echo ${{ toJSON(steps.run_commitlint.outputs.results) }}

View File

@ -1,6 +1,7 @@
---
title: Tabs
description: Tabs organize content into multiple sections and allow users to navigate between them.
icon: updated
links:
rac: Tabs
source: tabs/tabs.tsx
@ -144,6 +145,7 @@ The component supports both CSS pseudo-classes and data attributes:
| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `orientation` | `"horizontal" \| "vertical"` | `"horizontal"` | Tab layout orientation |
| `hideSeparator` | `boolean` | `false` | Hide separator lines between tabs |
| `selectedKey` | `string` | - | Controlled selected tab key |
| `defaultSelectedKey` | `string` | - | Default selected tab key |
| `onSelectionChange` | `(key: Key) => void` | - | Selection change handler |

View File

@ -834,6 +834,10 @@ export const demos: Record<string, DemoItem> = {
component: TabsDemos.CustomStyles,
file: "tabs/custom-styles.tsx",
},
"tabs-without-separator": {
component: TabsDemos.WithoutSeparator,
file: "tabs/without-separator.tsx",
},
// TextArea demos
"textarea-basic": {
component: TextAreaDemos.Basic,

View File

@ -2,3 +2,4 @@ export {Basic} from "./basic";
export {Vertical} from "./vertical";
export {Disabled} from "./disabled";
export {CustomStyles} from "./custom-styles";
export {WithoutSeparator} from "./without-separator";

View File

@ -0,0 +1,33 @@
import {Tabs} from "@heroui/react";
export function WithoutSeparator() {
return (
<Tabs hideSeparator className="w-full max-w-md">
<Tabs.ListContainer>
<Tabs.List aria-label="Options">
<Tabs.Tab id="overview">
Overview
<Tabs.Indicator />
</Tabs.Tab>
<Tabs.Tab id="analytics">
Analytics
<Tabs.Indicator />
</Tabs.Tab>
<Tabs.Tab id="reports">
Reports
<Tabs.Indicator />
</Tabs.Tab>
</Tabs.List>
</Tabs.ListContainer>
<Tabs.Panel className="pt-4" id="overview">
<p>View your project overview and recent activity.</p>
</Tabs.Panel>
<Tabs.Panel className="pt-4" id="analytics">
<p>Track your metrics and analyze performance data.</p>
</Tabs.Panel>
<Tabs.Panel className="pt-4" id="reports">
<p>Generate and download detailed reports.</p>
</Tabs.Panel>
</Tabs>
);
}

View File

@ -37,7 +37,7 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/heroui-inc/heroui.git",
"url": "https://github.com/heroui-inc/heroui.git",
"directory": "packages/react"
},
"bugs": {

View File

@ -237,6 +237,40 @@ const CustomStyleTemplate = (args: Story["args"]) => {
);
};
const WithoutSeparatorTemplate = (args: Story["args"]) => {
return (
<div className="w-[600px]">
<Tabs {...args} hideSeparator>
<Tabs.ListContainer>
<Tabs.List aria-label="Options">
<Tabs.Tab id="overview">
Overview
<Tabs.Indicator />
</Tabs.Tab>
<Tabs.Tab id="analytics">
Analytics
<Tabs.Indicator />
</Tabs.Tab>
<Tabs.Tab id="reports">
Reports
<Tabs.Indicator />
</Tabs.Tab>
</Tabs.List>
</Tabs.ListContainer>
<Tabs.Panel className="pt-4" id="overview">
<p>View your project overview and recent activity.</p>
</Tabs.Panel>
<Tabs.Panel className="pt-4" id="analytics">
<p>Track your metrics and analyze performance data.</p>
</Tabs.Panel>
<Tabs.Panel className="pt-4" id="reports">
<p>Generate and download detailed reports.</p>
</Tabs.Panel>
</Tabs>
</div>
);
};
const Showcase1Template = (args: Story["args"]) => {
const DEFAULT_ZOOM = 200;
const [selectedZoom, setSelectedZoom] = React.useState<Key>(DEFAULT_ZOOM);
@ -371,6 +405,13 @@ export const WithCustomStyle: Story = {
render: CustomStyleTemplate,
};
export const WithoutSeparator: Story = {
args: {
children: null,
},
render: WithoutSeparatorTemplate,
};
export const Showcase1: Story = {
args: {
children: null,

View File

@ -20,8 +20,9 @@ import {tabsVariants} from "./tabs.styles";
* Tabs Context
* -----------------------------------------------------------------------------------------------*/
type TabsContext = {
slots?: ReturnType<typeof tabsVariants>;
hideSeparator?: boolean;
orientation?: "horizontal" | "vertical";
slots?: ReturnType<typeof tabsVariants>;
};
const TabsContext = createContext<TabsContext>({});
@ -32,13 +33,20 @@ const TabsContext = createContext<TabsContext>({});
interface TabsRootProps extends ComponentPropsWithRef<typeof TabsPrimitive>, TabsVariants {
children: React.ReactNode;
className?: string;
hideSeparator?: boolean;
}
const TabsRoot = ({children, className, orientation = "horizontal", ...props}: TabsRootProps) => {
const TabsRoot = ({
children,
className,
hideSeparator = false,
orientation = "horizontal",
...props
}: TabsRootProps) => {
const slots = React.useMemo(() => tabsVariants(), []);
return (
<TabsContext value={{slots, orientation}}>
<TabsContext value={{hideSeparator, orientation, slots}}>
<TabsPrimitive
{...props}
className={composeTwRenderProps(className, slots.base())}
@ -81,12 +89,13 @@ interface TabListProps extends ComponentPropsWithRef<typeof TabListPrimitive<obj
}
const TabList = ({children, className, ...props}: TabListProps) => {
const {slots} = useContext(TabsContext);
const {hideSeparator, slots} = useContext(TabsContext);
return (
<TabListPrimitive
{...props}
className={composeTwRenderProps(className, slots?.tabList())}
data-hide-separator={hideSeparator ? "true" : undefined}
data-slot="tabs-list"
>
{children}

View File

@ -104,6 +104,11 @@
opacity: 0;
}
/* Hide separator when hideSeparator prop is set */
[data-hide-separator="true"] &:not(:first-child):before {
display: none;
}
/* Disabled state */
&:disabled,
&[data-disabled],

View File

@ -4,6 +4,11 @@
"description": "HeroUI core styles and Tailwind plugin",
"author": "HeroUI <support@heroui.com>",
"homepage": "https://heroui.com",
"repository": {
"type": "git",
"url": "https://github.com/heroui-inc/heroui.git",
"directory": "packages/styles"
},
"license": "MIT",
"type": "module",
"main": "./index.css",