-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FX-5543] Migrate List and ListItem to TailwindCSS (#4497)
- Loading branch information
1 parent
4068e86
commit 1f9def0
Showing
10 changed files
with
97 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
'@toptal/picasso-list': major | ||
'@toptal/picasso': patch | ||
--- | ||
|
||
- migrate `List` and `ListItem` to TailwindCSS | ||
- add `@toptal/picasso-tailwind-merge` as a peer dependency | ||
- remove `material-ui/core` from peer dependencies |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,20 @@ | ||
import type { Theme } from '@material-ui/core/styles' | ||
import { createStyles } from '@material-ui/core/styles' | ||
import { rem } from '@toptal/picasso-shared' | ||
import { palette } from '@toptal/picasso-utils' | ||
import type { ListItemType } from './context' | ||
import type { Variant } from './types' | ||
|
||
import { listStyleTypes } from '../ListItem/styles' | ||
export const listStyleTypeClass: Record<ListItemType, string> = { | ||
circle: 'list-[circle]', | ||
disc: 'list-disc', | ||
checkmark: 'list-none', | ||
arrow: 'list-none', | ||
numeral: 'list-decimal', | ||
alpha: 'list-[lower-alpha]', | ||
roman: 'list-[lower-roman]', | ||
} | ||
|
||
export default ({ typography }: Theme) => | ||
createStyles({ | ||
root: { | ||
fontSize: typography.fontSizes.medium, | ||
color: palette.common.black, | ||
marginTop: rem(4), | ||
paddingLeft: rem(16), | ||
}, | ||
unordered: { | ||
paddingLeft: rem(24), | ||
}, | ||
firstLevel: { | ||
paddingLeft: rem(16), | ||
}, | ||
...listStyleTypes, | ||
}) | ||
export const getPaddingClasses = ({ | ||
variant, | ||
level, | ||
}: { | ||
variant: Variant | ||
level: number | ||
}) => (level === 0 || variant !== 'unordered' ? 'pl-4' : 'pl-6') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import type { ReactNode } from 'react' | ||
import type { BaseProps } from '@toptal/picasso-shared' | ||
|
||
import type { ListItemType } from './context' | ||
|
||
export type Variant = 'ordered' | 'unordered' | ||
|
||
export type Props = BaseProps & { | ||
children: ReactNode | ||
/** The variant to use */ | ||
variant: Variant | ||
/** Specifies the start value of the first list item in an ordered list */ | ||
start?: number | ||
/** Style for items bullet/ordinal, can be overridden on a item level */ | ||
styleType?: ListItemType | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.