@pallasoft/ps-core-components 2.30.0 → 2.31.0

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.
@@ -0,0 +1,19 @@
1
+ import type { ReactNode } from 'react';
2
+ export interface PsDocumentRowProps {
3
+ actions?: ReactNode;
4
+ amount?: ReactNode;
5
+ badges?: ReactNode;
6
+ className?: string;
7
+ date?: string;
8
+ isSelected?: boolean;
9
+ note?: ReactNode;
10
+ onOpen?: () => void;
11
+ onPrefetch?: () => void;
12
+ select?: ReactNode;
13
+ subtitle?: string;
14
+ thumbnailAlt?: string;
15
+ thumbnailFallback?: ReactNode;
16
+ thumbnailSrc?: string | null;
17
+ title: string;
18
+ }
19
+ export declare const PsDocumentRow: ({ actions, amount, badges, className, date, isSelected, note, onOpen, onPrefetch, select, subtitle, thumbnailAlt, thumbnailFallback, thumbnailSrc, title, }: PsDocumentRowProps) => import("react").JSX.Element;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PsDocumentRow = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const ps_design_system_1 = require("@pallasoft/ps-design-system");
6
+ const PsDocumentRow = ({ actions, amount, badges, className, date, isSelected = false, note, onOpen, onPrefetch, select, subtitle, thumbnailAlt = '', thumbnailFallback, thumbnailSrc, title, }) => {
7
+ const Main = onOpen ? 'button' : 'div';
8
+ return ((0, jsx_runtime_1.jsxs)("div", { className: ps_design_system_1.PallasoftClassNameService.merge('flex min-w-0 flex-wrap items-center gap-x-3 gap-y-2 border-b border-line/70 px-3 py-3 transition-colors last:border-b-0 sm:flex-nowrap', isSelected ? 'bg-primary/5' : 'hover:bg-mist/40', className), children: [select ? (0, jsx_runtime_1.jsx)("span", { className: 'flex shrink-0 items-center', children: select }) : null, (0, jsx_runtime_1.jsxs)(Main, { className: 'ps-focus-ring grid min-w-0 flex-1 basis-0 grid-cols-[auto_minmax(0,1fr)] items-center gap-x-3 gap-y-1 rounded-ps-control text-left sm:grid-cols-[auto_minmax(0,1fr)_auto]', ...(onOpen
9
+ ? {
10
+ onClick: onOpen,
11
+ onFocus: onPrefetch,
12
+ onPointerEnter: onPrefetch,
13
+ type: 'button',
14
+ }
15
+ : {}), children: [(0, jsx_runtime_1.jsx)("span", { className: 'row-span-2 flex h-14 w-11 shrink-0 items-center justify-center overflow-hidden rounded-ps-control border border-line/60 bg-mist/40 sm:row-span-1', children: thumbnailSrc ? ((0, jsx_runtime_1.jsx)("img", { alt: thumbnailAlt, className: 'h-full w-full object-cover object-top', decoding: 'async', loading: 'lazy', src: thumbnailSrc })) : (thumbnailFallback) }), (0, jsx_runtime_1.jsxs)("span", { className: 'flex min-w-0 flex-col gap-0.5', children: [(0, jsx_runtime_1.jsx)("span", { className: 'truncate text-sm font-semibold text-ink', children: title }), subtitle ? (0, jsx_runtime_1.jsx)("span", { className: 'truncate text-xs text-ink/55', children: subtitle }) : null, badges ? ((0, jsx_runtime_1.jsx)("span", { className: 'flex flex-wrap items-center gap-1.5 pt-1', children: badges })) : null, note ? ((0, jsx_runtime_1.jsx)("span", { className: 'line-clamp-2 break-words pt-0.5 text-xs text-ink/70', children: note })) : null] }), amount || date ? ((0, jsx_runtime_1.jsxs)("span", { className: 'col-start-2 flex items-baseline gap-2 sm:col-start-3 sm:flex-col sm:items-end sm:gap-0.5', children: [amount ? ((0, jsx_runtime_1.jsx)("span", { className: 'text-sm font-semibold tabular-nums text-ink', children: amount })) : null, date ? (0, jsx_runtime_1.jsx)("span", { className: 'text-xs tabular-nums text-ink/55', children: date }) : null] })) : null] }), actions ? ((0, jsx_runtime_1.jsx)("div", { className: 'flex w-full shrink-0 items-center justify-end gap-2 sm:w-auto', children: actions })) : null] }));
16
+ };
17
+ exports.PsDocumentRow = PsDocumentRow;
@@ -0,0 +1,9 @@
1
+ import type { ReactNode } from 'react';
2
+ export interface PsSelectionBarProps {
3
+ children: ReactNode;
4
+ className?: string;
5
+ clearLabel: string;
6
+ countLabel: string;
7
+ onClear: () => void;
8
+ }
9
+ export declare const PsSelectionBar: ({ children, className, clearLabel, countLabel, onClear, }: PsSelectionBarProps) => import("react").JSX.Element;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PsSelectionBar = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const ps_design_system_1 = require("@pallasoft/ps-design-system");
6
+ const ps_icons_1 = require("@pallasoft/ps-icons");
7
+ const PsSelectionBar = ({ children, className, clearLabel, countLabel, onClear, }) => ((0, jsx_runtime_1.jsxs)("div", { "aria-live": 'polite', className: ps_design_system_1.PallasoftClassNameService.merge('sticky bottom-3 z-10 flex min-w-0 flex-wrap items-center gap-x-3 gap-y-2 rounded-ps-card border border-line bg-surface px-4 py-2 shadow-lg', className), role: 'toolbar', children: [(0, jsx_runtime_1.jsx)("span", { className: 'text-sm font-semibold text-ink', children: countLabel }), (0, jsx_runtime_1.jsx)("div", { className: 'flex min-w-0 flex-1 flex-wrap items-center gap-2', children: children }), (0, jsx_runtime_1.jsx)("button", { "aria-label": clearLabel, className: 'ps-focus-ring ps-control-square inline-flex shrink-0 items-center justify-center rounded-ps-control text-ink/65 transition-colors hover:bg-ink/5 hover:text-ink', onClick: onClear, title: clearLabel, type: 'button', children: (0, jsx_runtime_1.jsx)(ps_icons_1.PsIcon, { "aria-hidden": 'true', className: 'size-4', iconKey: ps_icons_1.PsIconKey.Close }) })] }));
8
+ exports.PsSelectionBar = PsSelectionBar;
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { PallasoftClassNameService } from '@pallasoft/ps-design-system';
3
+ export const PsDocumentRow = ({ actions, amount, badges, className, date, isSelected = false, note, onOpen, onPrefetch, select, subtitle, thumbnailAlt = '', thumbnailFallback, thumbnailSrc, title, }) => {
4
+ const Main = onOpen ? 'button' : 'div';
5
+ return (_jsxs("div", { className: PallasoftClassNameService.merge('flex min-w-0 flex-wrap items-center gap-x-3 gap-y-2 border-b border-line/70 px-3 py-3 transition-colors last:border-b-0 sm:flex-nowrap', isSelected ? 'bg-primary/5' : 'hover:bg-mist/40', className), children: [select ? _jsx("span", { className: 'flex shrink-0 items-center', children: select }) : null, _jsxs(Main, { className: 'ps-focus-ring grid min-w-0 flex-1 basis-0 grid-cols-[auto_minmax(0,1fr)] items-center gap-x-3 gap-y-1 rounded-ps-control text-left sm:grid-cols-[auto_minmax(0,1fr)_auto]', ...(onOpen
6
+ ? {
7
+ onClick: onOpen,
8
+ onFocus: onPrefetch,
9
+ onPointerEnter: onPrefetch,
10
+ type: 'button',
11
+ }
12
+ : {}), children: [_jsx("span", { className: 'row-span-2 flex h-14 w-11 shrink-0 items-center justify-center overflow-hidden rounded-ps-control border border-line/60 bg-mist/40 sm:row-span-1', children: thumbnailSrc ? (_jsx("img", { alt: thumbnailAlt, className: 'h-full w-full object-cover object-top', decoding: 'async', loading: 'lazy', src: thumbnailSrc })) : (thumbnailFallback) }), _jsxs("span", { className: 'flex min-w-0 flex-col gap-0.5', children: [_jsx("span", { className: 'truncate text-sm font-semibold text-ink', children: title }), subtitle ? _jsx("span", { className: 'truncate text-xs text-ink/55', children: subtitle }) : null, badges ? (_jsx("span", { className: 'flex flex-wrap items-center gap-1.5 pt-1', children: badges })) : null, note ? (_jsx("span", { className: 'line-clamp-2 break-words pt-0.5 text-xs text-ink/70', children: note })) : null] }), amount || date ? (_jsxs("span", { className: 'col-start-2 flex items-baseline gap-2 sm:col-start-3 sm:flex-col sm:items-end sm:gap-0.5', children: [amount ? (_jsx("span", { className: 'text-sm font-semibold tabular-nums text-ink', children: amount })) : null, date ? _jsx("span", { className: 'text-xs tabular-nums text-ink/55', children: date }) : null] })) : null] }), actions ? (_jsx("div", { className: 'flex w-full shrink-0 items-center justify-end gap-2 sm:w-auto', children: actions })) : null] }));
13
+ };
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { PallasoftClassNameService } from '@pallasoft/ps-design-system';
3
+ import { PsIcon, PsIconKey } from '@pallasoft/ps-icons';
4
+ export const PsSelectionBar = ({ children, className, clearLabel, countLabel, onClear, }) => (_jsxs("div", { "aria-live": 'polite', className: PallasoftClassNameService.merge('sticky bottom-3 z-10 flex min-w-0 flex-wrap items-center gap-x-3 gap-y-2 rounded-ps-card border border-line bg-surface px-4 py-2 shadow-lg', className), role: 'toolbar', children: [_jsx("span", { className: 'text-sm font-semibold text-ink', children: countLabel }), _jsx("div", { className: 'flex min-w-0 flex-1 flex-wrap items-center gap-2', children: children }), _jsx("button", { "aria-label": clearLabel, className: 'ps-focus-ring ps-control-square inline-flex shrink-0 items-center justify-center rounded-ps-control text-ink/65 transition-colors hover:bg-ink/5 hover:text-ink', onClick: onClear, title: clearLabel, type: 'button', children: _jsx(PsIcon, { "aria-hidden": 'true', className: 'size-4', iconKey: PsIconKey.Close }) })] }));
package/dist/esm/index.js CHANGED
@@ -25,6 +25,8 @@ export * from './models/ps-sortable-list';
25
25
  export * from './components/ps-empty-state';
26
26
  export * from './components/ps-fab';
27
27
  export * from './components/ps-infinite-scroll';
28
+ export * from './components/ps-document-row';
29
+ export * from './components/ps-selection-bar';
28
30
  export * from './components/ps-list-tile';
29
31
  export * from './components/ps-metric-card';
30
32
  export * from './components/ps-pill';
package/dist/index.d.ts CHANGED
@@ -25,6 +25,8 @@ export * from './models/ps-sortable-list';
25
25
  export * from './components/ps-empty-state';
26
26
  export * from './components/ps-fab';
27
27
  export * from './components/ps-infinite-scroll';
28
+ export * from './components/ps-document-row';
29
+ export * from './components/ps-selection-bar';
28
30
  export * from './components/ps-list-tile';
29
31
  export * from './components/ps-metric-card';
30
32
  export * from './components/ps-pill';
package/dist/index.js CHANGED
@@ -41,6 +41,8 @@ __exportStar(require("./models/ps-sortable-list"), exports);
41
41
  __exportStar(require("./components/ps-empty-state"), exports);
42
42
  __exportStar(require("./components/ps-fab"), exports);
43
43
  __exportStar(require("./components/ps-infinite-scroll"), exports);
44
+ __exportStar(require("./components/ps-document-row"), exports);
45
+ __exportStar(require("./components/ps-selection-bar"), exports);
44
46
  __exportStar(require("./components/ps-list-tile"), exports);
45
47
  __exportStar(require("./components/ps-metric-card"), exports);
46
48
  __exportStar(require("./components/ps-pill"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pallasoft/ps-core-components",
3
- "version": "2.30.0",
3
+ "version": "2.31.0",
4
4
  "private": false,
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/esm/index.js",