@equinor/eds-core-react
Version:
The React implementation of the Equinor Design System
31 lines (28 loc) • 781 B
JavaScript
import { forwardRef } from 'react';
import styled, { css } from 'styled-components';
import { list } from './List.tokens.js';
import { typographyTemplate } from '@equinor/eds-utils';
import { jsx } from 'react/jsx-runtime';
const {
typography
} = list;
const StyledList = styled.ul.withConfig({
displayName: "List__StyledList",
componentId: "sc-v9d2hy-0"
})(["", " ", ""], ({
as
}) => as === 'ol' ? css(["& ol{list-style-type:lower-alpha;}"]) : '', typographyTemplate(typography));
const List = /*#__PURE__*/forwardRef(function List({
children,
variant = 'bullet',
...props
}, ref) {
const as = variant === 'numbered' ? 'ol' : 'ul';
return /*#__PURE__*/jsx(StyledList, {
as: as,
ref: ref,
...props,
children: children
});
});
export { List };