Skip to content

Commit a1297c8

Browse files
committed
[tabs] Fix selected/active/highlighted naming consistency
1 parent 38f9485 commit a1297c8

File tree

23 files changed

+93
-100
lines changed

23 files changed

+93
-100
lines changed

docs/reference/generated/tabs-indicator.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"type": "'horizontal' | 'vertical'"
2525
},
2626
"data-activation-direction": {
27-
"description": "Indicates the direction of the activation (based on the previous selected tab).",
27+
"description": "Indicates the direction of the activation (based on the previous active tab).",
2828
"type": "'left' | 'right' | 'up' | 'down' | 'none'"
2929
}
3030
},

docs/reference/generated/tabs-list.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"type": "'horizontal' | 'vertical'"
3131
},
3232
"data-activation-direction": {
33-
"description": "Indicates the direction of the activation (based on the previous selected tab).",
33+
"description": "Indicates the direction of the activation (based on the previous active tab).",
3434
"type": "'left' | 'right' | 'up' | 'down' | 'none'"
3535
}
3636
},

docs/reference/generated/tabs-panel.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"type": "'horizontal' | 'vertical'"
2929
},
3030
"data-activation-direction": {
31-
"description": "Indicates the direction of the activation (based on the previous selected tab).",
31+
"description": "Indicates the direction of the activation (based on the previous active tab).",
3232
"type": "'left' | 'right' | 'up' | 'down' | 'none'"
3333
},
3434
"data-hidden": {

docs/reference/generated/tabs-root.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
"defaultValue": {
66
"type": "Tabs.Tab.Value",
77
"default": "0",
8-
"description": "The default value. Use when the component is not controlled.\nWhen the value is `null`, no Tab will be selected."
8+
"description": "The default value. Use when the component is not controlled.\nWhen the value is `null`, no Tab will be active."
99
},
1010
"value": {
1111
"type": "Tabs.Tab.Value",
12-
"description": "The value of the currently selected `Tab`. Use when the component is controlled.\nWhen the value is `null`, no Tab will be selected."
12+
"description": "The value of the currently selected `Tab`. Use when the component is controlled.\nWhen the value is `null`, no Tab will be active."
1313
},
1414
"onValueChange": {
1515
"type": "((value: Tabs.Tab.Value, eventDetails: { reason: 'none', event: ReasonToEvent, cancel: (() => void), allowPropagation: (() => void), isCanceled: boolean, isPropagationAllowed: boolean, trigger: HTMLElement | undefined } & { activationDirection: Tabs.Tab.ActivationDirection }) => void)",
@@ -38,7 +38,7 @@
3838
"type": "'horizontal' | 'vertical'"
3939
},
4040
"data-activation-direction": {
41-
"description": "Indicates the direction of the activation (based on the previous selected tab).",
41+
"description": "Indicates the direction of the activation (based on the previous active tab).",
4242
"type": "'left' | 'right' | 'up' | 'down' | 'none'"
4343
}
4444
},

docs/reference/generated/tabs-tab.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,7 @@
2424
},
2525
"dataAttributes": {
2626
"data-selected": {
27-
"description": "Present when the tab is selected."
28-
},
29-
"data-highlighted": {
30-
"description": "Present when the tab is highlighted."
27+
"description": "Present when the tab is active."
3128
},
3229
"data-orientation": {
3330
"description": "Indicates the orientation of the tabs.",
@@ -37,7 +34,7 @@
3734
"description": "Present when the tab is disabled."
3835
},
3936
"data-activation-direction": {
40-
"description": "Indicates the direction of the activation (based on the previous selected tab).",
37+
"description": "Indicates the direction of the activation (based on the previous active tab).",
4138
"type": "'left' | 'right' | 'up' | 'down' | 'none'"
4239
}
4340
},

docs/src/app/(private)/experiments/tabs.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
height: 2rem;
5353
}
5454

55-
&[data-selected] {
55+
&[data-active] {
5656
color: var(--color-gray-900);
5757
}
5858

docs/src/app/(public)/(content)/react/components/tabs/demos/hero/css-modules/index.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
padding-block: 0;
3434
height: 2rem;
3535

36-
&[data-selected] {
36+
&[data-active] {
3737
color: var(--color-gray-900);
3838
}
3939

docs/src/app/(public)/(content)/react/components/tabs/demos/hero/tailwind/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@ export default function ExampleTabs() {
66
<Tabs.Root className="rounded-md border border-gray-200" defaultValue="overview">
77
<Tabs.List className="relative z-0 flex gap-1 px-1 shadow-[inset_0_-1px] shadow-gray-200">
88
<Tabs.Tab
9-
className="flex h-8 items-center justify-center border-0 px-2 text-sm font-medium break-keep whitespace-nowrap text-gray-600 outline-none select-none before:inset-x-0 before:inset-y-1 before:rounded-sm before:-outline-offset-1 before:outline-blue-800 hover:text-gray-900 focus-visible:relative focus-visible:before:absolute focus-visible:before:outline focus-visible:before:outline-2 data-[selected]:text-gray-900"
9+
className="flex h-8 items-center justify-center border-0 px-2 text-sm font-medium break-keep whitespace-nowrap text-gray-600 outline-none select-none before:inset-x-0 before:inset-y-1 before:rounded-sm before:-outline-offset-1 before:outline-blue-800 hover:text-gray-900 focus-visible:relative focus-visible:before:absolute focus-visible:before:outline focus-visible:before:outline-2 data-[active]:text-gray-900"
1010
value="overview"
1111
>
1212
Overview
1313
</Tabs.Tab>
1414
<Tabs.Tab
15-
className="flex h-8 items-center justify-center border-0 px-2 text-sm font-medium break-keep whitespace-nowrap text-gray-600 outline-none select-none before:inset-x-0 before:inset-y-1 before:rounded-sm before:-outline-offset-1 before:outline-blue-800 hover:text-gray-900 focus-visible:relative focus-visible:before:absolute focus-visible:before:outline focus-visible:before:outline-2 data-[selected]:text-gray-900"
15+
className="flex h-8 items-center justify-center border-0 px-2 text-sm font-medium break-keep whitespace-nowrap text-gray-600 outline-none select-none before:inset-x-0 before:inset-y-1 before:rounded-sm before:-outline-offset-1 before:outline-blue-800 hover:text-gray-900 focus-visible:relative focus-visible:before:absolute focus-visible:before:outline focus-visible:before:outline-2 data-[active]:text-gray-900"
1616
value="projects"
1717
>
1818
Projects
1919
</Tabs.Tab>
2020
<Tabs.Tab
21-
className="flex h-8 items-center justify-center border-0 px-2 text-sm font-medium break-keep whitespace-nowrap text-gray-600 outline-none select-none before:inset-x-0 before:inset-y-1 before:rounded-sm before:-outline-offset-1 before:outline-blue-800 hover:text-gray-900 focus-visible:relative focus-visible:before:absolute focus-visible:before:outline focus-visible:before:outline-2 data-[selected]:text-gray-900"
21+
className="flex h-8 items-center justify-center border-0 px-2 text-sm font-medium break-keep whitespace-nowrap text-gray-600 outline-none select-none before:inset-x-0 before:inset-y-1 before:rounded-sm before:-outline-offset-1 before:outline-blue-800 hover:text-gray-900 focus-visible:relative focus-visible:before:absolute focus-visible:before:outline focus-visible:before:outline-2 data-[active]:text-gray-900"
2222
value="account"
2323
>
2424
Account

docs/src/components/Demo/Demo.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
inset: -0.375rem -0.5rem;
122122
}
123123

124-
&[data-selected] {
124+
&[data-active] {
125125
color: var(--color-foreground);
126126
font-weight: bold;
127127

packages/react/src/tabs/indicator/TabsIndicator.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ describe('<Tabs.Indicator />', () => {
2222
}));
2323

2424
describe.skipIf(isJSDOM)('rendering', () => {
25-
it('should not render when no tab is selected', async () => {
25+
it('should not render when no tab is active', async () => {
2626
await render(
2727
<Tabs.Root value={null}>
2828
<Tabs.List>

0 commit comments

Comments
 (0)