UNPKG

@engie-group/fluid-design-system-react

Version:

Fluid Design System React

21 lines (18 loc) 1.03 kB
import { jsx } from 'react/jsx-runtime'; import { Root as Slot } from '../../node_modules/.pnpm/@radix-ui_react-slot@1.2.3_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-slot/dist/index.js'; import { isDefaultComponent } from '../../utils/typeHelpers.js'; import { Utils } from '../../utils/util.js'; const NJPaginationItem = (props) => { const { index, current, children, asChild, ...htmlProps } = props; let className = 'nj-pagination__link'; const ariaLabel = `Page ${index}`; if (current) { return (jsx("span", { className: className, "aria-label": ariaLabel, "data-index": index, "aria-current": "true", children: index })); } if (isDefaultComponent(asChild)) { className = Utils.classNames(className, htmlProps.className); return (jsx("button", { "aria-label": ariaLabel, ...htmlProps, className: className, "data-index": index, children: index })); } return jsx(Slot, { className: className, children: children }); }; export { NJPaginationItem };