Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⬆️ Styled components v6 #3050

Merged
merged 35 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
b11c17a
try updating styled components
oddvernes Aug 21, 2023
bf838de
♻️ Icon was tricky
oddvernes Sep 13, 2023
789472e
only changed import
oddvernes Sep 13, 2023
25d11a2
only change import
oddvernes Sep 13, 2023
3f9b2f6
only change import
oddvernes Sep 13, 2023
556aaf7
replaced CSSObject with StyledObject<any>
oddvernes Sep 13, 2023
9469b25
refactoring needed due to new types
oddvernes Sep 13, 2023
25fea5d
refactoring due to new types
oddvernes Sep 13, 2023
4a5e684
fixing transient props
oddvernes Sep 13, 2023
dc68313
replace removed FlattenSimpleInterpolation with 'any'
oddvernes Sep 13, 2023
7ee359d
Accordion: transient props
oddvernes Sep 14, 2023
653a249
Input: transient props
oddvernes Sep 14, 2023
7c69c84
Chip: transient props
oddvernes Sep 14, 2023
0c9706c
Checkbox: transient props
oddvernes Sep 14, 2023
d49e52a
Autocomplete: transient props
oddvernes Sep 14, 2023
174a75e
Radio: transient props
oddvernes Sep 14, 2023
0088ab2
Avatar, Banner, ButtonGroup, Card: transient props
oddvernes Sep 14, 2023
4f7d558
breadcrumbs: fix deprecated event
oddvernes Sep 14, 2023
7a1eeb4
Storybook Stack: transient props
oddvernes Sep 14, 2023
afe1c48
pagination, progress: transient props
oddvernes Sep 14, 2023
fac59dd
sidesheet, slider, snackbar: transient props
oddvernes Sep 14, 2023
eecd53c
Switch, table: transient props
oddvernes Sep 14, 2023
abdfca8
TableOfContents, TopBar: transient props
oddvernes Sep 14, 2023
26e2ad2
Tabs, TextArea, TextField: transient props
oddvernes Sep 14, 2023
94188b0
Lab storybook: "stack" sc6 compatible
oddvernes Sep 15, 2023
dbc51fd
Datepicker: filter styled propsforwarding
oddvernes Sep 15, 2023
3f7a61d
Lab Button/Table stories: use style instead of css
oddvernes Sep 15, 2023
105a60e
core-react: update snapshots
oddvernes Sep 15, 2023
f865fa4
Fix tests after sc6
oddvernes Sep 15, 2023
da0c61b
Data-grid: usse transient props
oddvernes Sep 15, 2023
db8fa02
use default export for styled again
oddvernes Sep 15, 2023
3f2fda6
Table/Caption: fixed transient prop
oddvernes Sep 18, 2023
0d19cff
⬆️ Update styled-components latest patch
oddvernes Sep 18, 2023
2a6770e
add back CSSObject type after patch added it back
oddvernes Sep 18, 2023
e4183b3
update snapshot
oddvernes Sep 18, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions assets/font/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 20 additions & 6 deletions packages/eds-core-react/.storybook/components/Stack.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,32 @@
import styled, { CSSProperties } from 'styled-components'
import styled, { StyledObject } from 'styled-components'

type StackProps = {
direction?: CSSProperties['flexDirection']
align?: CSSProperties['alignItems']
direction?: StyledObject<any>['flexDirection']
align?: StyledObject<any>['alignItems']
children: React.ReactNode
} & React.HTMLAttributes<HTMLDivElement>

type StyledStackProps = {
$direction?: StyledObject<any>['flexDirection']
$align?: StyledObject<any>['alignItems']
}

export const Stack = styled.div<StackProps>`
const StyledStack = styled.div<StyledStackProps>`
display: flex;
flex-direction: column;
justify-content: center;
align-items: ${({ align }) => align || 'center'};
align-items: ${({ $align }) => $align || 'center'};
gap: 1rem;
flex-wrap: wrap;
@media screen and (min-width: 600px) {
flex-direction: ${({ direction }) => direction || 'row'};
flex-direction: ${({ $direction }) => $direction || 'row'};
}
`

export const Stack = ({ children, direction, align, ...rest }: StackProps) => {
return (
<StyledStack $direction={direction} $align={align} {...rest}>
{children}
</StyledStack>
)
}
5 changes: 2 additions & 3 deletions packages/eds-core-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
"@types/ramda": "^0.29.2",
"@types/react": "^18.0.21",
"@types/react-dom": "^18.0.10",
"@types/styled-components": "^5.1.26",
"@types/testing-library__jest-dom": "^5.14.6",
"babel-loader": "^9.1.2",
"babel-plugin-styled-components": "^2.1.4",
Expand All @@ -82,14 +81,14 @@
"rollup-plugin-delete": "^2.0.0",
"rollup-plugin-postcss": "^4.0.2",
"storybook": "^7.3.0",
"styled-components": "5.3.9",
"styled-components": "6.0.7",
"tsc-watch": "^6.0.4",
"typescript": "^5.1.6"
},
"peerDependencies": {
"react": ">=16.8",
"react-dom": ">=16.8",
"styled-components": ">=4.2 < 6"
"styled-components": ">=4.2"
},
"dependencies": {
"@babel/runtime": "^7.22.5",
Expand Down
Loading