File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " @solved-ac/ui-react" ,
3- "version" : " 0.0.1-alpha.19 " ,
3+ "version" : " 0.0.1-alpha.20 " ,
44 "description" : " React component library used by solved.ac" ,
55 "author" : " shiftpsh" ,
66 "license" : " MIT" ,
Original file line number Diff line number Diff line change 1- import React , { HTMLAttributes } from 'react'
1+ import React , { ElementType } from 'react'
22import styled from 'styled-components'
3+ import { PolymorphicElementProps } from '../types/PolymorphicElementProps'
34
45const paddingMap = {
56 none : 'padding: 0;' ,
@@ -16,11 +17,13 @@ const ListContainer = styled.ul<ListContainerProps>`
1617 list-style: none;
1718`
1819
19- export interface ListProps extends HTMLAttributes < HTMLUListElement > {
20+ export type ListProps < T extends ElementType = 'ul' > = {
2021 padding ?: 'none' | 'normal' | 'wide'
21- }
22+ } & PolymorphicElementProps < T >
2223
23- export const List : React . FC < ListProps > = ( props ) => {
24+ export const List = < T extends ElementType > (
25+ props : ListProps < T >
26+ ) : JSX . Element => {
2427 const { padding = 'normal' , children, ...rest } = props
2528
2629 return (
You can’t perform that action at this time.
0 commit comments