UNPKG

@kiwicom/orbit-components

Version:

Orbit-components is a React component library which provides developers with the easiest possible way of building Kiwi.com’s products.

31 lines (30 loc) 1.1 kB
"use client"; import * as React from "react"; import cx from "clsx"; import { SIZES, TYPES } from "./consts"; import { spaceAfterClasses } from "../common/tailwind"; const sizeTokens = { [SIZES.SMALL]: "text-small leading-small [&_.orbit-list-item-icon]:h-icon-small", [SIZES.NORMAL]: "text-normal leading-normal [&_.orbit-list-item-icon]:h-icon-medium [&_.orbit-list-item-label]:text-small", [SIZES.LARGE]: "text-large leading-large [&_.orbit-list-item-icon]:h-icon-large [&_.orbit-list-item-label]:text-normal" }; const typeTokens = { [TYPES.PRIMARY]: "text-primary-foreground", [TYPES.SECONDARY]: "text-secondary-foreground" }; const List = ({ children, dataTest, id, size = SIZES.NORMAL, type = TYPES.PRIMARY, spaceAfter }) => { return /*#__PURE__*/React.createElement("ul", { "data-test": dataTest, id: id, className: cx("orbit-list font-base m-0 flex w-full list-none flex-col p-0", sizeTokens[size], typeTokens[type], spaceAfter != null && spaceAfterClasses[spaceAfter]) }, children); }; export default List; export { default as ListItem } from "./ListItem";