@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.
- package/dist/components/ps-skeleton-card.d.ts +4 -0
- package/dist/components/ps-skeleton-card.js +9 -0
- package/dist/components/ps-skeleton-group.d.ts +7 -0
- package/dist/components/ps-skeleton-group.js +6 -0
- package/dist/components/ps-skeleton-list.d.ts +8 -0
- package/dist/components/ps-skeleton-list.js +10 -0
- package/dist/components/ps-skeleton-table.d.ts +7 -0
- package/dist/components/ps-skeleton-table.js +15 -0
- package/dist/components/ps-skeleton-text.d.ts +5 -0
- package/dist/components/ps-skeleton-text.js +12 -0
- package/dist/components/ps-skeleton.d.ts +3 -1
- package/dist/components/ps-skeleton.js +6 -1
- package/dist/constants/ps-skeleton-config.d.ts +3 -0
- package/dist/constants/ps-skeleton-config.js +6 -0
- package/dist/esm/components/ps-skeleton-card.js +5 -0
- package/dist/esm/components/ps-skeleton-group.js +2 -0
- package/dist/esm/components/ps-skeleton-list.js +6 -0
- package/dist/esm/components/ps-skeleton-table.js +11 -0
- package/dist/esm/components/ps-skeleton-text.js +8 -0
- package/dist/esm/components/ps-skeleton.js +6 -1
- package/dist/esm/constants/ps-skeleton-config.js +3 -0
- package/dist/esm/index.js +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/package.json +1 -1
|
@@ -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,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,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
|
|
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,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
|
-
|
|
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) }));
|
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);
|