Skip to content

Commit

Permalink
migrates tabs to ts and css modules
Browse files Browse the repository at this point in the history
  • Loading branch information
kyleshike committed Sep 29, 2023
1 parent 7779cf4 commit 809a4a2
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 59 deletions.
File renamed without changes.
50 changes: 0 additions & 50 deletions src/Tabs/Tabs.styles.js

This file was deleted.

File renamed without changes.
25 changes: 16 additions & 9 deletions src/Tabs/Tabs.jsx → src/Tabs/Tabs.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,31 @@
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';

import ReactBootstrapTabs from 'react-bootstrap/Tabs';

import { StyledTabsWrapper } from './Tabs.styles';
import styles from './tabs.module.scss';

const Tabs = ({
children,
flexWrapUnset,
navItemButtonFullHeight,
...props
}) => (
<StyledTabsWrapper
flexWrapUnset={flexWrapUnset}
navItemButtonFullHeight={navItemButtonFullHeight}
<ReactBootstrapTabs
className={
classNames(
styles.tabs,
{
[styles.flexWrapUnset]: flexWrapUnset,
[styles.navItemButtonFullHeight]: navItemButtonFullHeight,
},
)
}
variant="tabs"
{...props}
>
<ReactBootstrapTabs variant="tabs" {...props}>
{children}
</ReactBootstrapTabs>
</StyledTabsWrapper>
{children}
</ReactBootstrapTabs>
);

export default Tabs;
Expand Down
36 changes: 36 additions & 0 deletions src/Tabs/tabs.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
@import '../../scss/theme.scss';

.tabs {
--border-width: 0.125rem;

border-bottom: var(--border-width) solid $ux-gray-400;

:global(.nav-link) {
color:$ux-gray-800;
font: 400 0.875rem/1.25rem DM Sans, sans-serif;
text-decoration: none;
border: none;
border-radius: 0;
border-bottom: var(--border-width) solid $ux-gray-400;
margin-bottom: calc(0px - var(--border-width));
padding: 0.375rem 0.75rem;
}

:global(.nav-link.active),
:global(.nav-link:hover),
:global(.nav-link:active),
:global(.nav-link:focus) {
color: $ux-blue-500;
border-bottom: var(--border-width) solid $ux-blue-500;
}
}

.flexWrapUnset {
flex-wrap: nowrap;
}

.navItemButtonFullHeight {
:global(.nav-item .button) {
height: calc(100% + var(--border-width));
}
}

0 comments on commit 809a4a2

Please sign in to comment.