Skip to content

Commit

Permalink
feat: Revert styled-components to v5 (#492)
Browse files Browse the repository at this point in the history
  • Loading branch information
dogmar authored Jun 7, 2023
1 parent 60341c9 commit f5752c9
Show file tree
Hide file tree
Showing 5 changed files with 112 additions and 176 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
"@storybook/testing-library": "0.1.0",
"@types/react-dom": "18.2.4",
"@types/react-transition-group": "4.4.6",
"@types/styled-components": "5.1.26",
"@typescript-eslint/eslint-plugin": "5.59.9",
"@typescript-eslint/parser": "5.59.9",
"babel-loader": "9.1.2",
Expand All @@ -106,7 +107,7 @@
"react-transition-group": "4.4.5",
"rimraf": "5.0.1",
"storybook": "7.0.18",
"styled-components": "6.0.0-rc.3",
"styled-components": "5.3.11",
"typescript": "4.9.5",
"vite": "4.3.9"
},
Expand All @@ -118,7 +119,7 @@
"react": ">=18.2.0",
"react-dom": ">=18.2.0",
"react-transition-group": ">=4.4.5",
"styled-components": ">=6.0.0-rc.3"
"styled-components": ">=5.3.11"
},
"packageManager": "[email protected]",
"resolutions": {
Expand Down
14 changes: 4 additions & 10 deletions src/components/SubTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,19 @@ type SubtabProps = TabBaseProps &
size?: SubTabSize
}

const parentFillLevelToActiveBG: Record<
FillLevel,
keyof typeof styledTheme.colors
> = {
const parentFillLevelToActiveBG = {
0: 'fill-zero-selected',
1: 'fill-one-selected',
2: 'fill-two-selected',
3: 'fill-three-selected',
}
} as const satisfies Record<FillLevel, keyof typeof styledTheme.colors>

const parentFillLevelToHoverBG: Record<
FillLevel,
keyof typeof styledTheme.colors
> = {
const parentFillLevelToHoverBG = {
0: 'fill-zero-hover',
1: 'fill-one-hover',
2: 'fill-two-hover',
3: 'fill-three-hover',
}
} as const satisfies Record<FillLevel, keyof typeof styledTheme.colors>

const SubTabBase = styled.div<{
size: SubTabSize
Expand Down
6 changes: 2 additions & 4 deletions src/components/wizard/Installer.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import styled from 'styled-components'
import { type ReactElement } from 'react'
import { type ComponentProps, type ReactElement } from 'react'

import AppIcon from '../AppIcon'
import { ListBox } from '../ListBox'
Expand All @@ -9,8 +9,6 @@ import Chip from '../Chip'
import Tooltip from '../Tooltip'
import InfoOutlineIcon from '../icons/InfoOutlineIcon'

import { type CSSObject } from '../../types'

import { useNavigation, useStepper } from './hooks'

const Installer = styled(InstallerUnstyled)(({ theme }) => ({
Expand All @@ -36,7 +34,7 @@ const Installer = styled(InstallerUnstyled)(({ theme }) => ({
},
}))

function InstallerUnstyled({ ...props }: CSSObject): ReactElement {
function InstallerUnstyled({ ...props }: ComponentProps<'div'>): ReactElement {
const { onEdit } = useNavigation()
const { selected: apps } = useStepper()

Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ export type Severity = 'info' | 'warning' | 'success' | 'error' | 'danger'

export type ColorKey = keyof DefaultTheme['colors']

export type CSSObject = Record<string, any>
export { type CSSObject } from 'styled-components'
Loading

0 comments on commit f5752c9

Please sign in to comment.