@workday/canvas-kit-react
Version:
The parent module that contains all Workday Canvas Kit React components
25 lines (24 loc) • 1.41 kB
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import * as React from 'react';
import { ListItem } from './common/List';
import { mergeStyles } from '@workday/canvas-kit-react/layout';
import { createComponent } from '@workday/canvas-kit-react/common';
import { PaginationContext } from './usePaginationModel';
import { createStencil } from '@workday/canvas-kit-styling';
import { system } from '@workday/canvas-tokens-web';
export const paginationPageListStencil = createStencil({
base: { name: "3izoro", styles: "box-sizing:border-box;display:flex;margin:var(--cnvs-sys-space-zero);padding-inline-start:var(--cnvs-sys-space-zero);padding-inline-end:var(--cnvs-sys-space-zero);gap:var(--cnvs-sys-space-x1);" }
}, "pagination-page-list-762aeb");
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, ...elemProps, children: children }));
},
});