Skip to content

Commit

Permalink
fix(components): replace Tab component selector
Browse files Browse the repository at this point in the history
Since Circuit UI is no longer transpiled with Babel and the Emotion Babel plugin is no longer
applied, we can't use component selectors anymore.

bugfix/tab-component-selector

bugfix/tab-component-selector
  • Loading branch information
connor-baer committed Jun 11, 2020
1 parent 36a4bb5 commit 045a9a4
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/__snapshots__/storyshots.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -13400,7 +13400,7 @@ exports[`Storyshots Components/Tabs Links 1`] = `
}
@media (max-width:479px) {
.circuit-6 > .circuit-1 {
.circuit-6 [role='tab'] {
-webkit-flex: 1 1 auto;
-ms-flex: 1 1 auto;
flex: 1 1 auto;
Expand Down
6 changes: 3 additions & 3 deletions src/components/Tabs/__snapshots__/Tabs.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ exports[`Tabs styles should render with default styles 1`] = `
}
@media (max-width:479px) {
.circuit-4 > .circuit-1 {
.circuit-4 [role='tab'] {
-webkit-flex: 1 1 auto;
-ms-flex: 1 1 auto;
flex: 1 1 auto;
Expand Down Expand Up @@ -302,7 +302,7 @@ exports[`Tabs styles should render with stretched styles 1`] = `
flex-wrap: nowrap;
}
.circuit-4 > .circuit-1 {
.circuit-4 [role='tab'] {
-webkit-flex: 1 1 auto;
-ms-flex: 1 1 auto;
flex: 1 1 auto;
Expand All @@ -313,7 +313,7 @@ exports[`Tabs styles should render with stretched styles 1`] = `
}
@media (max-width:479px) {
.circuit-4 > .circuit-1 {
.circuit-4 [role='tab'] {
-webkit-flex: 1 1 auto;
-ms-flex: 1 1 auto;
flex: 1 1 auto;
Expand Down
2 changes: 0 additions & 2 deletions src/components/Tabs/components/Tab/Tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ Tab.defaultProps = {
role: 'tab'
};

export { StyledTab };

/**
* @component
*/
Expand Down
3 changes: 1 addition & 2 deletions src/components/Tabs/components/Tab/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
* limitations under the License.
*/

import Tab, { StyledTab } from './Tab';
import Tab from './Tab';

export { StyledTab };
export default Tab;
4 changes: 1 addition & 3 deletions src/components/Tabs/components/TabList/TabList.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ import { css } from '@emotion/core';

import { shadowDouble } from '../../../../styles/style-helpers';

import { StyledTab } from '../Tab';

const MOBILE_AUTOSTRETCH_ITEMS_MAX = 3;
const DEFAULT_HEIGHT = '80px';

Expand All @@ -43,7 +41,7 @@ const navigationBaseStyles = css`
`;

const stretchedStyles = ({ children, theme }) => css`
& > ${StyledTab} {
& [role='tab'] {
flex: 1 1 auto;
padding: 0 ${theme.spacings.kilo};
width: ${Math.floor(100 / children.length)}%;
Expand Down

0 comments on commit 045a9a4

Please sign in to comment.