Skip to content

Commit 9590bef

Browse files
committed
refactor: rename tabs to tab
1 parent 73583b0 commit 9590bef

File tree

5 files changed

+29
-29
lines changed

5 files changed

+29
-29
lines changed

pages/tabs/style-permutations.page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import ScreenshotArea from '../utils/screenshot-area';
1010

1111
// Rounded with background
1212
const style1 = {
13-
tabs: {
13+
tab: {
1414
backgroundColor: {
1515
default: 'light-dark(#f1f5f9, #1e293b)',
1616
hover: 'light-dark(#dbeafe, #1e3a8a)',
@@ -58,7 +58,7 @@ const style1 = {
5858

5959
// Border colors with background
6060
const style2 = {
61-
tabs: {
61+
tab: {
6262
backgroundColor: {
6363
default: 'light-dark(#fef3c7, #422006)',
6464
hover: 'light-dark(#fde68a, #713f12)',

src/__tests__/snapshot-tests/__snapshots__/documenter.test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25739,7 +25739,7 @@ need to introduce friction to the switching of tabs.",
2573925739
],
2574025740
"type": "object",
2574125741
},
25742-
"name": "tabs",
25742+
"name": "tab",
2574325743
"optional": true,
2574425744
"type": "{ backgroundColor?: { active?: string | undefined; default?: string | undefined; disabled?: string | undefined; hover?: string | undefined; } | undefined; borderColor?: { active?: string | undefined; default?: string | undefined; disabled?: string | undefined; hover?: string | undefined; } | undefined; ... 8 more .....",
2574525745
},

src/tabs/__tests__/styles.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jest.mock('../../internal/environment', () => ({
99
}));
1010

1111
const testStyles = {
12-
tabs: {
12+
tab: {
1313
borderRadius: '4px',
1414
borderWidth: '2px',
1515
fontSize: '16px',

src/tabs/interfaces.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ export namespace TabsProps {
199199
}
200200

201201
export interface Style {
202-
tabs?: {
202+
tab?: {
203203
backgroundColor?: {
204204
active?: string;
205205
default?: string;

src/tabs/styles.tsx

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,27 @@ export function getTabStyles(style: TabsProps['style']) {
1010
}
1111

1212
return {
13-
borderRadius: style?.tabs?.borderRadius,
14-
borderWidth: style?.tabs?.borderWidth,
15-
fontSize: style?.tabs?.fontSize,
16-
fontWeight: style?.tabs?.fontWeight,
17-
paddingBlock: style?.tabs?.paddingBlock,
18-
paddingInline: style?.tabs?.paddingInline,
19-
[customCssProps.styleBackgroundActive]: style?.tabs?.backgroundColor?.active,
20-
[customCssProps.styleBackgroundDefault]: style?.tabs?.backgroundColor?.default,
21-
[customCssProps.styleBackgroundDisabled]: style?.tabs?.backgroundColor?.disabled,
22-
[customCssProps.styleBackgroundHover]: style?.tabs?.backgroundColor?.hover,
23-
[customCssProps.styleBorderColorActive]: style?.tabs?.borderColor?.active,
24-
[customCssProps.styleBorderColorDefault]: style?.tabs?.borderColor?.default,
25-
[customCssProps.styleBorderColorDisabled]: style?.tabs?.borderColor?.disabled,
26-
[customCssProps.styleBorderColorHover]: style?.tabs?.borderColor?.hover,
27-
[customCssProps.styleColorActive]: style?.tabs?.color?.active,
28-
[customCssProps.styleColorDefault]: style?.tabs?.color?.default,
29-
[customCssProps.styleColorDisabled]: style?.tabs?.color?.disabled,
30-
[customCssProps.styleColorHover]: style?.tabs?.color?.hover,
31-
[customCssProps.styleFocusRingBorderColor]: style?.tabs?.focusRing?.borderColor,
32-
[customCssProps.styleFocusRingBorderRadius]: style?.tabs?.focusRing?.borderRadius,
33-
[customCssProps.styleFocusRingBorderWidth]: style?.tabs?.focusRing?.borderWidth,
13+
borderRadius: style?.tab?.borderRadius,
14+
borderWidth: style?.tab?.borderWidth,
15+
fontSize: style?.tab?.fontSize,
16+
fontWeight: style?.tab?.fontWeight,
17+
paddingBlock: style?.tab?.paddingBlock,
18+
paddingInline: style?.tab?.paddingInline,
19+
[customCssProps.styleBackgroundActive]: style?.tab?.backgroundColor?.active,
20+
[customCssProps.styleBackgroundDefault]: style?.tab?.backgroundColor?.default,
21+
[customCssProps.styleBackgroundDisabled]: style?.tab?.backgroundColor?.disabled,
22+
[customCssProps.styleBackgroundHover]: style?.tab?.backgroundColor?.hover,
23+
[customCssProps.styleBorderColorActive]: style?.tab?.borderColor?.active,
24+
[customCssProps.styleBorderColorDefault]: style?.tab?.borderColor?.default,
25+
[customCssProps.styleBorderColorDisabled]: style?.tab?.borderColor?.disabled,
26+
[customCssProps.styleBorderColorHover]: style?.tab?.borderColor?.hover,
27+
[customCssProps.styleColorActive]: style?.tab?.color?.active,
28+
[customCssProps.styleColorDefault]: style?.tab?.color?.default,
29+
[customCssProps.styleColorDisabled]: style?.tab?.color?.disabled,
30+
[customCssProps.styleColorHover]: style?.tab?.color?.hover,
31+
[customCssProps.styleFocusRingBorderColor]: style?.tab?.focusRing?.borderColor,
32+
[customCssProps.styleFocusRingBorderRadius]: style?.tab?.focusRing?.borderRadius,
33+
[customCssProps.styleFocusRingBorderWidth]: style?.tab?.focusRing?.borderWidth,
3434
};
3535
}
3636

@@ -40,9 +40,9 @@ export function getTabContainerStyles(style: TabsProps['style']) {
4040
}
4141

4242
return {
43-
[customCssProps.styleTabsUnderlineColor]: style?.tabs?.underline?.color,
44-
[customCssProps.styleTabsUnderlineWidth]: style?.tabs?.underline?.width,
45-
[customCssProps.styleTabsUnderlineBorderRadius]: style?.tabs?.underline?.borderRadius,
43+
[customCssProps.styleTabsUnderlineColor]: style?.tab?.underline?.color,
44+
[customCssProps.styleTabsUnderlineWidth]: style?.tab?.underline?.width,
45+
[customCssProps.styleTabsUnderlineBorderRadius]: style?.tab?.underline?.borderRadius,
4646
[customCssProps.styleTabsSeparatorColor]: style?.tabSeparator?.color,
4747
[customCssProps.styleTabsSeparatorWidth]: style?.tabSeparator?.width,
4848
};

0 commit comments

Comments
 (0)