@pallasoft/ps-core-components 2.4.0 → 2.5.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,4 @@
1
+ export interface PsSkeletonCardProps {
2
+ className?: string;
3
+ }
4
+ export declare const PsSkeletonCard: ({ className }: PsSkeletonCardProps) => import("react").JSX.Element;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PsSkeletonCard = 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_skeleton_1 = require("./ps-skeleton");
7
+ const ps_skeleton_group_1 = require("./ps-skeleton-group");
8
+ const PsSkeletonCard = ({ className }) => ((0, jsx_runtime_1.jsxs)(ps_skeleton_group_1.PsSkeletonGroup, { className: ps_design_system_1.PallasoftClassNameService.merge('flex flex-col gap-3 rounded-[1.25rem] border border-line bg-surface p-5', className), children: [(0, jsx_runtime_1.jsx)(ps_skeleton_1.PsSkeleton, { className: 'h-2.5 w-24' }), (0, jsx_runtime_1.jsx)(ps_skeleton_1.PsSkeleton, { className: 'h-6 w-32' })] }));
9
+ exports.PsSkeletonCard = PsSkeletonCard;
@@ -0,0 +1,7 @@
1
+ import type { ReactNode } from 'react';
2
+ export interface PsSkeletonGroupProps {
3
+ children: ReactNode;
4
+ className?: string;
5
+ label?: string;
6
+ }
7
+ export declare const PsSkeletonGroup: ({ children, className, label, }: PsSkeletonGroupProps) => import("react").JSX.Element;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PsSkeletonGroup = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const PsSkeletonGroup = ({ children, className, label = 'Loading', }) => ((0, jsx_runtime_1.jsxs)("div", { "aria-busy": 'true', className: className, role: 'status', children: [(0, jsx_runtime_1.jsx)("span", { className: 'sr-only', children: label }), children] }));
6
+ exports.PsSkeletonGroup = PsSkeletonGroup;
@@ -0,0 +1,8 @@
1
+ export interface PsSkeletonListProps {
2
+ className?: string;
3
+ hasLeading?: boolean;
4
+ hasTrailing?: boolean;
5
+ rows?: number;
6
+ title?: boolean;
7
+ }
8
+ export declare const PsSkeletonList: ({ className, hasLeading, hasTrailing, rows, title, }: PsSkeletonListProps) => import("react").JSX.Element;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PsSkeletonList = 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_skeleton_config_1 = require("../constants/ps-skeleton-config");
7
+ const ps_skeleton_1 = require("./ps-skeleton");
8
+ const ps_skeleton_group_1 = require("./ps-skeleton-group");
9
+ const PsSkeletonList = ({ className, hasLeading = false, hasTrailing = true, rows = 4, title = false, }) => ((0, jsx_runtime_1.jsxs)(ps_skeleton_group_1.PsSkeletonGroup, { className: ps_design_system_1.PallasoftClassNameService.merge('flex flex-col', className), children: [title ? (0, jsx_runtime_1.jsx)(ps_skeleton_1.PsSkeleton, { className: 'mx-3 mb-3 h-2.5 w-24' }) : null, Array.from({ length: rows }, (_, index) => ((0, jsx_runtime_1.jsxs)("div", { className: 'flex min-h-11 items-center gap-3 px-3 py-2.5', children: [hasLeading ? (0, jsx_runtime_1.jsx)(ps_skeleton_1.PsSkeleton, { shape: 'circle' }) : null, (0, jsx_runtime_1.jsx)(ps_skeleton_1.PsSkeleton, { className: ps_skeleton_config_1.PsSkeletonConfig.lineWidths[index % ps_skeleton_config_1.PsSkeletonConfig.lineWidths.length] }), hasTrailing ? (0, jsx_runtime_1.jsx)(ps_skeleton_1.PsSkeleton, { className: 'ml-auto h-2.5 w-20 shrink-0' }) : null] }, index)))] }));
10
+ exports.PsSkeletonList = PsSkeletonList;
@@ -0,0 +1,7 @@
1
+ export interface PsSkeletonTableProps {
2
+ className?: string;
3
+ columns?: number;
4
+ hasToolbar?: boolean;
5
+ rows?: number;
6
+ }
7
+ export declare const PsSkeletonTable: ({ className, columns, hasToolbar, rows, }: PsSkeletonTableProps) => import("react").JSX.Element;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PsSkeletonTable = 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_skeleton_config_1 = require("../constants/ps-skeleton-config");
7
+ const ps_skeleton_1 = require("./ps-skeleton");
8
+ const ps_skeleton_group_1 = require("./ps-skeleton-group");
9
+ const PsSkeletonTable = ({ className, columns = 4, hasToolbar = false, rows = 6, }) => {
10
+ const gridTemplateColumns = `minmax(0, 2fr) repeat(${Math.max(columns - 1, 0)}, minmax(0, 1fr))`;
11
+ return ((0, jsx_runtime_1.jsxs)(ps_skeleton_group_1.PsSkeletonGroup, { className: ps_design_system_1.PallasoftClassNameService.merge('flex flex-col gap-3', className), children: [hasToolbar ? ((0, jsx_runtime_1.jsxs)("div", { className: 'flex items-center gap-3', children: [(0, jsx_runtime_1.jsx)(ps_skeleton_1.PsSkeleton, { className: 'max-w-sm', shape: 'block' }), (0, jsx_runtime_1.jsx)(ps_skeleton_1.PsSkeleton, { className: 'ml-auto w-24', shape: 'block' })] })) : null, (0, jsx_runtime_1.jsxs)("div", { className: 'overflow-hidden rounded-[1.25rem] border border-line bg-surface', children: [(0, jsx_runtime_1.jsx)("div", { className: 'grid gap-4 bg-mist/70 px-5 py-4', style: { gridTemplateColumns }, children: Array.from({ length: columns }, (_, index) => ((0, jsx_runtime_1.jsx)(ps_skeleton_1.PsSkeleton, { className: 'h-2.5 w-16' }, index))) }), Array.from({ length: rows }, (_, rowIndex) => ((0, jsx_runtime_1.jsx)("div", { className: 'grid items-center gap-4 border-t border-line px-5 py-4', style: { gridTemplateColumns }, children: Array.from({ length: columns }, (__, columnIndex) => ((0, jsx_runtime_1.jsx)(ps_skeleton_1.PsSkeleton, { className: columnIndex === columns - 1 && columns > 1
12
+ ? 'ml-auto w-16'
13
+ : ps_skeleton_config_1.PsSkeletonConfig.lineWidths[(rowIndex + columnIndex) % ps_skeleton_config_1.PsSkeletonConfig.lineWidths.length] }, columnIndex))) }, rowIndex)))] })] }));
14
+ };
15
+ exports.PsSkeletonTable = PsSkeletonTable;
@@ -0,0 +1,5 @@
1
+ export interface PsSkeletonTextProps {
2
+ className?: string;
3
+ lines?: number;
4
+ }
5
+ export declare const PsSkeletonText: ({ className, lines }: PsSkeletonTextProps) => import("react").JSX.Element;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PsSkeletonText = 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_skeleton_config_1 = require("../constants/ps-skeleton-config");
7
+ const ps_skeleton_1 = require("./ps-skeleton");
8
+ const ps_skeleton_group_1 = require("./ps-skeleton-group");
9
+ const PsSkeletonText = ({ className, lines = 3 }) => ((0, jsx_runtime_1.jsx)(ps_skeleton_group_1.PsSkeletonGroup, { className: ps_design_system_1.PallasoftClassNameService.merge('flex flex-col gap-2.5', className), children: Array.from({ length: lines }, (_, index) => ((0, jsx_runtime_1.jsx)(ps_skeleton_1.PsSkeleton, { className: index === lines - 1 && lines > 1
10
+ ? 'w-2/3'
11
+ : ps_skeleton_config_1.PsSkeletonConfig.lineWidths[index % ps_skeleton_config_1.PsSkeletonConfig.lineWidths.length] }, index))) }));
12
+ exports.PsSkeletonText = PsSkeletonText;
@@ -1,4 +1,6 @@
1
+ export type PsSkeletonShape = 'block' | 'circle' | 'line';
1
2
  export interface PsSkeletonProps {
2
3
  className?: string;
4
+ shape?: PsSkeletonShape;
3
5
  }
4
- export declare const PsSkeleton: ({ className }: PsSkeletonProps) => import("react").JSX.Element;
6
+ export declare const PsSkeleton: ({ className, shape }: PsSkeletonProps) => import("react").JSX.Element;
@@ -3,5 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PsSkeleton = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const ps_design_system_1 = require("@pallasoft/ps-design-system");
6
- const PsSkeleton = ({ className }) => ((0, jsx_runtime_1.jsx)("div", { className: ps_design_system_1.PallasoftClassNameService.merge('animate-pulse rounded-full bg-mist', className) }));
6
+ const shapeClassNames = {
7
+ block: 'h-11 w-full rounded-ps-control',
8
+ circle: 'h-9 w-9 shrink-0 rounded-full',
9
+ line: 'h-3 w-full rounded-full',
10
+ };
11
+ const PsSkeleton = ({ className, shape = 'line' }) => ((0, jsx_runtime_1.jsx)("span", { "aria-hidden": 'true', className: ps_design_system_1.PallasoftClassNameService.merge('ps-skeleton', shapeClassNames[shape], className) }));
7
12
  exports.PsSkeleton = PsSkeleton;
@@ -0,0 +1,3 @@
1
+ export declare const PsSkeletonConfig: {
2
+ readonly lineWidths: readonly ["w-3/4", "w-1/2", "w-5/6", "w-2/3"];
3
+ };
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PsSkeletonConfig = void 0;
4
+ exports.PsSkeletonConfig = {
5
+ lineWidths: ['w-3/4', 'w-1/2', 'w-5/6', 'w-2/3'],
6
+ };
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { PallasoftClassNameService } from '@pallasoft/ps-design-system';
3
+ import { PsSkeleton } from './ps-skeleton';
4
+ import { PsSkeletonGroup } from './ps-skeleton-group';
5
+ export const PsSkeletonCard = ({ className }) => (_jsxs(PsSkeletonGroup, { className: PallasoftClassNameService.merge('flex flex-col gap-3 rounded-[1.25rem] border border-line bg-surface p-5', className), children: [_jsx(PsSkeleton, { className: 'h-2.5 w-24' }), _jsx(PsSkeleton, { className: 'h-6 w-32' })] }));
@@ -0,0 +1,2 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ export const PsSkeletonGroup = ({ children, className, label = 'Loading', }) => (_jsxs("div", { "aria-busy": 'true', className: className, role: 'status', children: [_jsx("span", { className: 'sr-only', children: label }), children] }));
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { PallasoftClassNameService } from '@pallasoft/ps-design-system';
3
+ import { PsSkeletonConfig } from '../constants/ps-skeleton-config';
4
+ import { PsSkeleton } from './ps-skeleton';
5
+ import { PsSkeletonGroup } from './ps-skeleton-group';
6
+ export const PsSkeletonList = ({ className, hasLeading = false, hasTrailing = true, rows = 4, title = false, }) => (_jsxs(PsSkeletonGroup, { className: PallasoftClassNameService.merge('flex flex-col', className), children: [title ? _jsx(PsSkeleton, { className: 'mx-3 mb-3 h-2.5 w-24' }) : null, Array.from({ length: rows }, (_, index) => (_jsxs("div", { className: 'flex min-h-11 items-center gap-3 px-3 py-2.5', children: [hasLeading ? _jsx(PsSkeleton, { shape: 'circle' }) : null, _jsx(PsSkeleton, { className: PsSkeletonConfig.lineWidths[index % PsSkeletonConfig.lineWidths.length] }), hasTrailing ? _jsx(PsSkeleton, { className: 'ml-auto h-2.5 w-20 shrink-0' }) : null] }, index)))] }));
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { PallasoftClassNameService } from '@pallasoft/ps-design-system';
3
+ import { PsSkeletonConfig } from '../constants/ps-skeleton-config';
4
+ import { PsSkeleton } from './ps-skeleton';
5
+ import { PsSkeletonGroup } from './ps-skeleton-group';
6
+ export const PsSkeletonTable = ({ className, columns = 4, hasToolbar = false, rows = 6, }) => {
7
+ const gridTemplateColumns = `minmax(0, 2fr) repeat(${Math.max(columns - 1, 0)}, minmax(0, 1fr))`;
8
+ return (_jsxs(PsSkeletonGroup, { className: PallasoftClassNameService.merge('flex flex-col gap-3', className), children: [hasToolbar ? (_jsxs("div", { className: 'flex items-center gap-3', children: [_jsx(PsSkeleton, { className: 'max-w-sm', shape: 'block' }), _jsx(PsSkeleton, { className: 'ml-auto w-24', shape: 'block' })] })) : null, _jsxs("div", { className: 'overflow-hidden rounded-[1.25rem] border border-line bg-surface', children: [_jsx("div", { className: 'grid gap-4 bg-mist/70 px-5 py-4', style: { gridTemplateColumns }, children: Array.from({ length: columns }, (_, index) => (_jsx(PsSkeleton, { className: 'h-2.5 w-16' }, index))) }), Array.from({ length: rows }, (_, rowIndex) => (_jsx("div", { className: 'grid items-center gap-4 border-t border-line px-5 py-4', style: { gridTemplateColumns }, children: Array.from({ length: columns }, (__, columnIndex) => (_jsx(PsSkeleton, { className: columnIndex === columns - 1 && columns > 1
9
+ ? 'ml-auto w-16'
10
+ : PsSkeletonConfig.lineWidths[(rowIndex + columnIndex) % PsSkeletonConfig.lineWidths.length] }, columnIndex))) }, rowIndex)))] })] }));
11
+ };
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { PallasoftClassNameService } from '@pallasoft/ps-design-system';
3
+ import { PsSkeletonConfig } from '../constants/ps-skeleton-config';
4
+ import { PsSkeleton } from './ps-skeleton';
5
+ import { PsSkeletonGroup } from './ps-skeleton-group';
6
+ export const PsSkeletonText = ({ className, lines = 3 }) => (_jsx(PsSkeletonGroup, { className: PallasoftClassNameService.merge('flex flex-col gap-2.5', className), children: Array.from({ length: lines }, (_, index) => (_jsx(PsSkeleton, { className: index === lines - 1 && lines > 1
7
+ ? 'w-2/3'
8
+ : PsSkeletonConfig.lineWidths[index % PsSkeletonConfig.lineWidths.length] }, index))) }));
@@ -1,3 +1,8 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { PallasoftClassNameService } from '@pallasoft/ps-design-system';
3
- export const PsSkeleton = ({ className }) => (_jsx("div", { className: PallasoftClassNameService.merge('animate-pulse rounded-full bg-mist', className) }));
3
+ const shapeClassNames = {
4
+ block: 'h-11 w-full rounded-ps-control',
5
+ circle: 'h-9 w-9 shrink-0 rounded-full',
6
+ line: 'h-3 w-full rounded-full',
7
+ };
8
+ export const PsSkeleton = ({ className, shape = 'line' }) => (_jsx("span", { "aria-hidden": 'true', className: PallasoftClassNameService.merge('ps-skeleton', shapeClassNames[shape], className) }));
@@ -0,0 +1,3 @@
1
+ export const PsSkeletonConfig = {
2
+ lineWidths: ['w-3/4', 'w-1/2', 'w-5/6', 'w-2/3'],
3
+ };
package/dist/esm/index.js CHANGED
@@ -18,6 +18,11 @@ export * from './components/ps-navigation-progress';
18
18
  export * from './components/ps-section-header';
19
19
  export * from './components/ps-site-header';
20
20
  export * from './components/ps-skeleton';
21
+ export * from './components/ps-skeleton-card';
22
+ export * from './components/ps-skeleton-group';
23
+ export * from './components/ps-skeleton-list';
24
+ export * from './components/ps-skeleton-table';
25
+ export * from './components/ps-skeleton-text';
21
26
  export * from './components/ps-spinner';
22
27
  export * from './components/ps-theme-toggle';
23
28
  export * from './components/ps-voice-orb';
package/dist/index.d.ts CHANGED
@@ -18,6 +18,11 @@ export * from './components/ps-navigation-progress';
18
18
  export * from './components/ps-section-header';
19
19
  export * from './components/ps-site-header';
20
20
  export * from './components/ps-skeleton';
21
+ export * from './components/ps-skeleton-card';
22
+ export * from './components/ps-skeleton-group';
23
+ export * from './components/ps-skeleton-list';
24
+ export * from './components/ps-skeleton-table';
25
+ export * from './components/ps-skeleton-text';
21
26
  export * from './components/ps-spinner';
22
27
  export * from './components/ps-theme-toggle';
23
28
  export * from './components/ps-voice-orb';
package/dist/index.js CHANGED
@@ -34,6 +34,11 @@ __exportStar(require("./components/ps-navigation-progress"), exports);
34
34
  __exportStar(require("./components/ps-section-header"), exports);
35
35
  __exportStar(require("./components/ps-site-header"), exports);
36
36
  __exportStar(require("./components/ps-skeleton"), exports);
37
+ __exportStar(require("./components/ps-skeleton-card"), exports);
38
+ __exportStar(require("./components/ps-skeleton-group"), exports);
39
+ __exportStar(require("./components/ps-skeleton-list"), exports);
40
+ __exportStar(require("./components/ps-skeleton-table"), exports);
41
+ __exportStar(require("./components/ps-skeleton-text"), exports);
37
42
  __exportStar(require("./components/ps-spinner"), exports);
38
43
  __exportStar(require("./components/ps-theme-toggle"), exports);
39
44
  __exportStar(require("./components/ps-voice-orb"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pallasoft/ps-core-components",
3
- "version": "2.4.0",
3
+ "version": "2.5.0",
4
4
  "private": false,
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/esm/index.js",