Skip to content

Commit

Permalink
Migrate to Next PostCss default config
Browse files Browse the repository at this point in the history
  • Loading branch information
Joozty committed Mar 30, 2020
1 parent c2fbbdc commit 3825436
Show file tree
Hide file tree
Showing 62 changed files with 105 additions and 164 deletions.
2 changes: 1 addition & 1 deletion components/application/activity-select/index.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'

import styles from './styles.css'
import styles from './styles.module.css'

import { Icon, Drawer } from 'design'
import { navigation } from 'texts'
Expand Down
2 changes: 1 addition & 1 deletion components/application/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import RepositorySelect from './repository-select'
import ActivitySelect from './activity-select'
import Head from './head'
import Logout from './logout'
import styles from './styles.css'
import styles from './styles.module.css'

import activities from 'store/activities'

Expand Down
2 changes: 1 addition & 1 deletion components/application/logout.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { AppBar } from '@oacore/design'

import styles from './logout.css'
import styles from './logout.module.css'

import { withGlobalStore } from 'store'

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion components/application/repository-select.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { AppBar } from '@oacore/design'

import styles from './repository-select.css'
import styles from './repository-select.module.css'

import { withGlobalStore } from 'store'
import { Select } from 'design'
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion components/document-link/index.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'

import styles from './styles.css'
import styles from './styles.module.css'

import { Button, Icon } from 'design'

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion components/layout/app-bar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { AppBar } from '@oacore/design'
import { classNames } from '@oacore/design/lib/utils'

import LayoutContext from './context'
import styles from './styles.css'
import styles from './styles.module.css'

import { AppBarToggle, Logo } from 'design'

Expand Down
2 changes: 1 addition & 1 deletion components/layout/container.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useReducer } from 'react'
import { classNames } from '@oacore/design/lib/utils'

import { Provider } from './context'
import styles from './styles.css'
import styles from './styles.module.css'

const reducer = (state, action) => {
switch (action.type) {
Expand Down
2 changes: 1 addition & 1 deletion components/layout/main.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { classNames } from '@oacore/design/lib/utils'

import styles from './styles.css'
import styles from './styles.module.css'

const Main = ({ children }) => {
const child = React.Children.only(children)
Expand Down
2 changes: 1 addition & 1 deletion components/layout/side-bar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { AppBar } from '@oacore/design'
import { classNames } from '@oacore/design/lib/utils'

import LayoutContext from './context'
import styles from './styles.css'
import styles from './styles.module.css'

import { Logo, CloseIcon } from 'design'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
:root {
--side-bar-width: 13rem;
--app-bar-skip: 3.5rem;
}

@custom-media --screen-at-least-desktop (min-width: 728px);
@custom-media --screen-until-desktop (max-width: 727px);

.container {
--side-bar-width: 13rem;
--app-bar-skip: 3.5rem;

display: flex;
flex-direction: column;
min-height: 100%;
Expand Down
2 changes: 1 addition & 1 deletion components/loading-bar/index.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { classNames } from '@oacore/design/lib/utils'

import styles from './styles.css'
import styles from './styles.module.css'

const LoadingBar = ({ className, tag: Tag = 'div' }) => (
<Tag className={classNames.use(styles.container).join(className)} />
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion components/table/Sidebar.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useRef } from 'react'
import { classNames } from '@oacore/design/lib/utils'

import tableClassNames from './index.css'
import tableClassNames from './index.module.css'

import { CloseIcon } from 'design'

Expand Down
2 changes: 1 addition & 1 deletion components/table/TableRow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Table } from '@oacore/design'
import { classNames } from '@oacore/design/lib/utils'
import { observer } from 'mobx-react'

import tableClassNames from './index.css'
import tableClassNames from './index.module.css'

const TableRow = props => {
const { id, index, columns, context, isClickable } = props
Expand Down
2 changes: 1 addition & 1 deletion components/table/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import { classNames } from '@oacore/design/lib/utils'

import LoadMoreRow from './LoadMoreRow'
import tableClassNames from './index.css'
import tableClassNames from './index.module.css'
import NoDataFoundRow from './NoDataFoundRow'
import TableRow from './TableRow'
import Sidebar from './Sidebar'
Expand Down
34 changes: 16 additions & 18 deletions components/table/index.css → components/table/index.module.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
:root {
@custom-media --screen-at-least-desktop (min-width: 1200px);

.container {
--table-sidebar-width: 30rem;
}

@custom-media --screen-at-least-desktop (min-width: 1200px);
&:not(.open) > .sidebar {
box-shadow: none;
transform: translateX(100%);
}

&.open > .table {
right: 0;

@media (--screen-at-least-desktop) {
margin-right: var(--table-sidebar-width);
}
}
}

/* TODO: handle this in design library perhaps */
.table-select > input {
Expand Down Expand Up @@ -67,21 +80,6 @@
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.container {
&:not(.open) > .sidebar {
box-shadow: none;
transform: translateX(100%);
}

&.open > .table {
right: 0;

@media (--screen-at-least-desktop) {
margin-right: var(--table-sidebar-width);
}
}
}

.clickable {
cursor: pointer;
}
Expand Down
2 changes: 1 addition & 1 deletion components/takedown/index.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'

import styles from './styles.css'
import styles from './styles.module.css'

import { Button, Icon } from 'design'

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion components/time-lag-chart/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { nest } from 'd3-collection'
import { sum, mean } from 'd3-array'

import CustomTooltip from './tooltip'
import styles from './index.css'
import styles from './index.module.css'

const customTicks = {
...Object.fromEntries(
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion components/time-lag-chart/tooltip.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'

import styles from './index.css'
import styles from './index.module.css'

const Tooltip = ({ active, payload, label, aggregationSize }) => {
const index = parseInt(label, 10) * aggregationSize
Expand Down
2 changes: 1 addition & 1 deletion design/alert/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import { classNames } from '@oacore/design/lib/utils'

import Card from '../card'
import styles from './index.css'
import styles from './index.module.css'

const Alert = React.memo(({ children, variant }) => (
<Card
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion design/app-bar/toggle.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import { AppBarItem } from '@oacore/design'
import { classNames } from '@oacore/design/lib/utils'

import styles from './toggle.css'
import styles from './toggle.module.css'

const Toggle = React.memo(({ className, tag = 'button', ...restProps }) => (
<AppBarItem
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion design/avatar/index.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { classNames } from '@oacore/design/lib/utils'

import styles from './index.css'
import styles from './index.module.css'

const Avatar = React.memo(
({ className, src = '/avatar.png', alt = 'User', ...restProps }) => (
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion design/card/index.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { classNames } from '@oacore/design/lib/utils'

import styles from './index.css'
import styles from './index.module.css'

const Card = ({ children, className, tag: Tag = 'div', ...restProps }) => (
<Tag
Expand Down
4 changes: 1 addition & 3 deletions design/card/index.css → design/card/index.module.css
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
:root {
.container {
--card-padding-x: var(--component-padding-x, 1rem);
--card-padding-y: var(--component-padding-y, 1rem);
--card-background: var(--white, #fff);
--card-corner-radius: var(--component-corner-radius, 2px);
--card-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.container {
min-width: var(--card-min-width, 18rem);
padding: var(--card-padding-y) var(--card-padding-x);
background: var(--card-background);
Expand Down
2 changes: 1 addition & 1 deletion design/close-icon/index.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { classNames } from '@oacore/design/lib/utils'

import styles from './index.css'
import styles from './index.module.css'

const CloseIcon = React.forwardRef(
({ className, tag: Tag = 'span', ...restProps }, ref) => (
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion design/detail-list/index.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { classNames } from '@oacore/design/lib/utils'

import styles from './styles.css'
import styles from './styles.module.css'

const DetailList = React.memo(({ children, className, ...passProps }) => (
<ul
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion design/drawer/item.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { classNames } from '@oacore/design/lib/utils'

import styles from './styles.css'
import styles from './styles.module.css'

const FlatItem = ({
children,
Expand Down
2 changes: 1 addition & 1 deletion design/drawer/list.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { classNames } from '@oacore/design/lib/utils'

import styles from './styles.css'
import styles from './styles.module.css'

const List = ({ children, className, tag: Tag = 'ul', ...restProps }) => (
<Tag className={classNames.use(styles.list).join(className)} {...restProps}>
Expand Down
4 changes: 1 addition & 3 deletions design/drawer/styles.css → design/drawer/styles.module.css
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
:root {
.list {
--drawer-list-padding-y: calc(var(--component-padding-y, 1rem) / 2);
--drawer-list-padding-x: calc(var(--component-padding-x, 1rem) / 2);
--drawer-item-padding-y: calc(var(--component-padding-y, 1rem) / 2);
--drawer-item-padding-x: calc(var(--component-padding-x, 1rem) / 2);
--drawer-item-spacing: calc(var(--component-padding-x, 1rem) / 2);
}

.list {
padding: var(--drawer-list-padding-y) var(--drawer-list-padding-x);
margin: 0;
line-height: 1;
Expand Down
2 changes: 1 addition & 1 deletion design/logo/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import { classNames } from '@oacore/design/lib/utils'

import logoPath from './core-symbol.svg'
import styles from './index.css'
import styles from './index.module.css'

const Logo = React.memo(
({
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion design/numeral/index.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { classNames } from '@oacore/design/lib/utils'

import styles from './styles.css'
import styles from './styles.module.css'

const Numeral = React.memo(
({ children, className, size, tag: Tag = 'div', ...restProps }) => (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
:root {
.container {
--numeral-value-sm-size: 2em;
--numeral-value-md-size: 3em;
--numeral-value-lg-size: 4em;
--numeral-value-size: var(--numeral-value-md-size);
}

.container {
/* For the future */
}

Expand Down
2 changes: 1 addition & 1 deletion design/overlay/index.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { classNames } from '@oacore/design/lib/utils'

import styles from './index.css'
import styles from './index.module.css'

const Overlay = ({
children,
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion design/select/index.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useEffect, useState, useRef, useCallback } from 'react'
import classNames from 'classnames'

import styles from './styles.css'
import styles from './styles.module.css'

// TODO: Taken from @oacore/design
const generateId = () =>
Expand Down
6 changes: 2 additions & 4 deletions design/select/styles.css → design/select/styles.module.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
:root {
--select-background: var(--gray-50);
}

/* TODO: Better name, it's a div shown on top of input when not hovered */
.input-container {
--select-background: var(--gray-50);

position: absolute;
top: 0;
right: 0;
Expand Down
Loading

0 comments on commit 3825436

Please sign in to comment.