UNPKG

@workday/canvas-kit-react

Version:

The parent module that contains all Workday Canvas Kit React components

25 lines (24 loc) 1.37 kB
import { jsx as _jsx } from "react/jsx-runtime"; import * as React from 'react'; import { createComponent } from '@workday/canvas-kit-react/common'; import { mergeStyles } from '@workday/canvas-kit-react/layout'; import { createStencil, handleCsProp } from '@workday/canvas-kit-styling'; import { system } from '@workday/canvas-tokens-web'; import { ListItem } from './common/List'; import { PaginationContext } from './usePaginationModel'; export const paginationPageListStencil = createStencil({ base: { name: "3w263p", styles: "box-sizing:border-box;display:flex;margin:0;padding-inline:0;gap:var(--cnvs-sys-gap-xs, var(--cnvs-sys-space-x1, 0.25rem));" } }, "pagination-page-list-1f5414"); export const PageList = createComponent('ol')({ displayName: 'Pagination.PageList', Component({ children, ...elemProps }, ref, Element) { const model = React.useContext(PaginationContext); return (_jsx(Element, { ref: ref, role: "list", ...mergeStyles(elemProps, paginationPageListStencil()), 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, ...handleCsProp(elemProps), children: children })); }, });