Skip to content

Commit e6c6444

Browse files
authored
refactor: list and offerlist vanilla extract (#5698)
1 parent 3ab54b9 commit e6c6444

File tree

20 files changed

+10789
-16413
lines changed

20 files changed

+10789
-16413
lines changed

.changeset/easy-dots-stop.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@ultraviolet/ui": minor
3+
---
4+
5+
- Refactor components `List` and `OfferList` to use vanilla-extract instead of Emotion
6+
- HeaderCell: Rename prop `minWith`-> `minWidth`

packages/plus/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090
"@ultraviolet/themes": "workspace:*",
9191
"@vanilla-extract/css": "1.17.4",
9292
"@vanilla-extract/dynamic": "2.1.5",
93+
"@vanilla-extract/recipes": "0.5.7",
9394
"csstype": "3.1.3",
9495
"react-intersection-observer": "9.16.0"
9596
}

packages/plus/src/components/OfferList/OfferList.tsx

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,12 @@
11
'use client'
22

3-
import styled from '@emotion/styled'
43
import { List } from '@ultraviolet/ui'
54
import type { ComponentProps } from 'react'
65
import { useEffect, useState } from 'react'
76
import { Cell } from './components/Cell'
87
import { Row } from './components/Row'
98
import { OfferListProvider } from './OfferListProvider'
10-
11-
const StyledList = styled(List)`
12-
td:first-child,
13-
th:first-child {
14-
width: ${({ theme }) => theme.sizing[700]};
15-
min-width: ${({ theme }) => theme.sizing[700]};
16-
max-width: ${({ theme }) => theme.sizing[700]};
17-
}
18-
`
9+
import { offerList } from './styles.css'
1910

2011
type OfferListProps = Omit<
2112
ComponentProps<typeof List>,
@@ -84,16 +75,16 @@ export const OfferList = ({
8475
setCheckboxSelectedRows={setCheckboxSelectedRows}
8576
setRadioSelectedRow={setRadioSelectedRow}
8677
>
87-
<StyledList
78+
<List
8879
autoCollapse={autoCollapse}
89-
className={className}
80+
className={`${className ? `${className} ` : ''}${offerList}`}
9081
columns={computedColumns}
9182
data-testid={dataTestId}
9283
expandable={false}
9384
selectable={false}
9485
>
9586
{children}
96-
</StyledList>
87+
</List>
9788
</OfferListProvider>
9889
)
9990
}

0 commit comments

Comments
 (0)