@pallasoft/ps-internal-components 1.3.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,6 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PsPaginationBar = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const lucide_react_1 = require("lucide-react");
6
+ const ps_pagination_config_js_1 = require("../constants/ps-pagination-config.js");
5
7
  const ps_class_name_service_js_1 = require("../services/ps-class-name-service.js");
6
8
  const ps_pagination_service_js_1 = require("../services/ps-pagination-service.js");
7
9
  const ps_pagination_content_js_1 = require("./ps-pagination-content.js");
@@ -11,6 +13,6 @@ const ps_pagination_link_js_1 = require("./ps-pagination-link.js");
11
13
  const ps_pagination_next_js_1 = require("./ps-pagination-next.js");
12
14
  const ps_pagination_previous_js_1 = require("./ps-pagination-previous.js");
13
15
  const ps_pagination_js_1 = require("./ps-pagination.js");
14
- const PsPaginationBar = ({ className, page, pageCount, renderLink, summary, }) => ((0, jsx_runtime_1.jsxs)("div", { className: ps_class_name_service_js_1.PsClassNameService.merge('flex flex-wrap items-center justify-between gap-3 text-sm text-muted-foreground', className), children: [(0, jsx_runtime_1.jsx)("span", { children: summary }), pageCount > 1 ? ((0, jsx_runtime_1.jsx)(ps_pagination_js_1.PsPagination, { className: 'mx-0 w-auto justify-end', children: (0, jsx_runtime_1.jsxs)(ps_pagination_content_js_1.PsPaginationContent, { children: [(0, jsx_runtime_1.jsx)(ps_pagination_item_js_1.PsPaginationItem, { children: (0, jsx_runtime_1.jsx)(ps_pagination_previous_js_1.PsPaginationPrevious, { asChild: true, isDisabled: page <= 1, children: renderLink(Math.max(page - 1, 1), undefined) }) }), ps_pagination_service_js_1.PsPaginationService.entries(page, pageCount).map((entry) => ((0, jsx_runtime_1.jsx)(ps_pagination_item_js_1.PsPaginationItem, { children: entry.isGap ? ((0, jsx_runtime_1.jsx)(ps_pagination_ellipsis_js_1.PsPaginationEllipsis, {})) : ((0, jsx_runtime_1.jsx)(ps_pagination_link_js_1.PsPaginationLink, { asChild: true, isActive: entry.page === page, children: renderLink(entry.page, entry.page) })) }, `${entry.isGap ? 'gap' : 'page'}-${entry.page}`))), (0, jsx_runtime_1.jsx)(ps_pagination_item_js_1.PsPaginationItem, { children: (0, jsx_runtime_1.jsx)(ps_pagination_next_js_1.PsPaginationNext, { asChild: true, isDisabled: page >= pageCount, children: renderLink(Math.min(page + 1, pageCount), undefined) }) })] }) })) : null] }));
16
+ const PsPaginationBar = ({ className, page, pageCount, renderLink, summary, }) => ((0, jsx_runtime_1.jsxs)("div", { className: ps_class_name_service_js_1.PsClassNameService.merge('flex flex-wrap items-center justify-between gap-3 text-sm text-muted-foreground', className), children: [(0, jsx_runtime_1.jsx)("span", { children: summary }), pageCount > 1 ? ((0, jsx_runtime_1.jsx)(ps_pagination_js_1.PsPagination, { className: 'mx-0 w-auto justify-end', children: (0, jsx_runtime_1.jsxs)(ps_pagination_content_js_1.PsPaginationContent, { children: [(0, jsx_runtime_1.jsx)(ps_pagination_item_js_1.PsPaginationItem, { children: (0, jsx_runtime_1.jsx)(ps_pagination_previous_js_1.PsPaginationPrevious, { asChild: true, isDisabled: page <= 1, children: renderLink(Math.max(page - 1, 1), (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(lucide_react_1.ChevronLeft, { className: 'h-4 w-4' }), (0, jsx_runtime_1.jsx)("span", { children: ps_pagination_config_js_1.PsPaginationConfig.previous })] })) }) }), ps_pagination_service_js_1.PsPaginationService.entries(page, pageCount).map((entry) => ((0, jsx_runtime_1.jsx)(ps_pagination_item_js_1.PsPaginationItem, { children: entry.isGap ? ((0, jsx_runtime_1.jsx)(ps_pagination_ellipsis_js_1.PsPaginationEllipsis, {})) : ((0, jsx_runtime_1.jsx)(ps_pagination_link_js_1.PsPaginationLink, { asChild: true, isActive: entry.page === page, children: renderLink(entry.page, entry.page) })) }, `${entry.isGap ? 'gap' : 'page'}-${entry.page}`))), (0, jsx_runtime_1.jsx)(ps_pagination_item_js_1.PsPaginationItem, { children: (0, jsx_runtime_1.jsx)(ps_pagination_next_js_1.PsPaginationNext, { asChild: true, isDisabled: page >= pageCount, children: renderLink(Math.min(page + 1, pageCount), (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span", { children: ps_pagination_config_js_1.PsPaginationConfig.next }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: 'h-4 w-4' })] })) }) })] }) })) : null] }));
15
17
  exports.PsPaginationBar = PsPaginationBar;
16
18
  exports.PsPaginationBar.displayName = 'PsPaginationBar';
@@ -1,4 +1,6 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { ChevronLeft, ChevronRight } from 'lucide-react';
3
+ import { PsPaginationConfig } from '../constants/ps-pagination-config.js';
2
4
  import { PsClassNameService } from '../services/ps-class-name-service.js';
3
5
  import { PsPaginationService } from '../services/ps-pagination-service.js';
4
6
  import { PsPaginationContent } from './ps-pagination-content.js';
@@ -8,5 +10,5 @@ import { PsPaginationLink } from './ps-pagination-link.js';
8
10
  import { PsPaginationNext } from './ps-pagination-next.js';
9
11
  import { PsPaginationPrevious } from './ps-pagination-previous.js';
10
12
  import { PsPagination } from './ps-pagination.js';
11
- export const PsPaginationBar = ({ className, page, pageCount, renderLink, summary, }) => (_jsxs("div", { className: PsClassNameService.merge('flex flex-wrap items-center justify-between gap-3 text-sm text-muted-foreground', className), children: [_jsx("span", { children: summary }), pageCount > 1 ? (_jsx(PsPagination, { className: 'mx-0 w-auto justify-end', children: _jsxs(PsPaginationContent, { children: [_jsx(PsPaginationItem, { children: _jsx(PsPaginationPrevious, { asChild: true, isDisabled: page <= 1, children: renderLink(Math.max(page - 1, 1), undefined) }) }), PsPaginationService.entries(page, pageCount).map((entry) => (_jsx(PsPaginationItem, { children: entry.isGap ? (_jsx(PsPaginationEllipsis, {})) : (_jsx(PsPaginationLink, { asChild: true, isActive: entry.page === page, children: renderLink(entry.page, entry.page) })) }, `${entry.isGap ? 'gap' : 'page'}-${entry.page}`))), _jsx(PsPaginationItem, { children: _jsx(PsPaginationNext, { asChild: true, isDisabled: page >= pageCount, children: renderLink(Math.min(page + 1, pageCount), undefined) }) })] }) })) : null] }));
13
+ export const PsPaginationBar = ({ className, page, pageCount, renderLink, summary, }) => (_jsxs("div", { className: PsClassNameService.merge('flex flex-wrap items-center justify-between gap-3 text-sm text-muted-foreground', className), children: [_jsx("span", { children: summary }), pageCount > 1 ? (_jsx(PsPagination, { className: 'mx-0 w-auto justify-end', children: _jsxs(PsPaginationContent, { children: [_jsx(PsPaginationItem, { children: _jsx(PsPaginationPrevious, { asChild: true, isDisabled: page <= 1, children: renderLink(Math.max(page - 1, 1), _jsxs(_Fragment, { children: [_jsx(ChevronLeft, { className: 'h-4 w-4' }), _jsx("span", { children: PsPaginationConfig.previous })] })) }) }), PsPaginationService.entries(page, pageCount).map((entry) => (_jsx(PsPaginationItem, { children: entry.isGap ? (_jsx(PsPaginationEllipsis, {})) : (_jsx(PsPaginationLink, { asChild: true, isActive: entry.page === page, children: renderLink(entry.page, entry.page) })) }, `${entry.isGap ? 'gap' : 'page'}-${entry.page}`))), _jsx(PsPaginationItem, { children: _jsx(PsPaginationNext, { asChild: true, isDisabled: page >= pageCount, children: renderLink(Math.min(page + 1, pageCount), _jsxs(_Fragment, { children: [_jsx("span", { children: PsPaginationConfig.next }), _jsx(ChevronRight, { className: 'h-4 w-4' })] })) }) })] }) })) : null] }));
12
14
  PsPaginationBar.displayName = 'PsPaginationBar';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pallasoft/ps-internal-components",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "private": false,
5
5
  "description": "Shared Pallasoft internal UI: app header, app switcher and shadcn primitives for staff tools",
6
6
  "main": "./dist/index.js",