@workday/canvas-kit-react
Version:
The parent module that contains all Workday Canvas Kit React components
20 lines (19 loc) • 1.01 kB
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
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 (_jsx(Flex, { ref: ref, as: Element, margin: "zero", role: "list", paddingLeft: "zero", paddingRight: "zero", gap: "xxxs", ...elemProps, children: typeof children === 'function' ? children(model) : children }));
},
});
export const PageListItem = createComponent('li')({
displayName: 'Pagination.PageListItem',
Component({ children, ...elemProps }, ref, Element) {
return (_jsx(ListItem, { ref: ref, as: Element, ...elemProps, children: children }));
},
});