UNPKG

@workday/canvas-kit-react

Version:

The parent module that contains all Workday Canvas Kit React components

19 lines (18 loc) 969 B
import * as React from 'react'; import { ListItem } from './common/List'; import { Flex } from '@workday/canvas-kit-react/layout'; import { createComponent } from '@workday/canvas-kit-react/common'; import { PaginationContext } from './usePaginationModel'; export const PageList = createComponent('ol')({ displayName: 'Pagination.PageList', Component({ children, ...elemProps }, ref, Element) { const model = React.useContext(PaginationContext); return (React.createElement(Flex, { ref: ref, as: Element, margin: "zero", role: "list", paddingLeft: "zero", paddingRight: "zero", gap: "xxxs", ...elemProps }, typeof children === 'function' ? children(model) : children)); }, }); export const PageListItem = createComponent('li')({ displayName: 'Pagination.PageListItem', Component({ children, ...elemProps }, ref, Element) { return (React.createElement(ListItem, { ref: ref, as: Element, ...elemProps }, children)); }, });