@pallasoft/ps-core-components 2.47.1 → 2.48.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-form-page-skeleton.d.ts +5 -1
- package/dist/components/ps-form-page-skeleton.js +1 -1
- package/dist/components/ps-metric-grid-skeleton.js +5 -1
- package/dist/components/ps-page-header.d.ts +2 -1
- package/dist/components/ps-page-header.js +1 -1
- package/dist/components/ps-page-skeleton.d.ts +2 -1
- package/dist/components/ps-page-skeleton.js +4 -1
- package/dist/components/ps-section-header.js +1 -1
- package/dist/components/ps-section-panel-skeleton.d.ts +2 -1
- package/dist/components/ps-section-panel-skeleton.js +4 -1
- package/dist/esm/components/ps-form-page-skeleton.js +1 -1
- package/dist/esm/components/ps-metric-grid-skeleton.js +5 -1
- package/dist/esm/components/ps-page-header.js +1 -1
- package/dist/esm/components/ps-page-skeleton.js +4 -1
- package/dist/esm/components/ps-section-header.js +1 -1
- package/dist/esm/components/ps-section-panel-skeleton.js +4 -1
- package/package.json +1 -1
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
export interface PsFormPageSkeletonProps {
|
|
2
|
+
hasActions?: boolean;
|
|
3
|
+
hasBackLink?: boolean;
|
|
4
|
+
isNarrow?: boolean;
|
|
2
5
|
loadingLabel: string;
|
|
3
6
|
title?: string;
|
|
7
|
+
variant?: 'bordered' | 'card' | 'plain';
|
|
4
8
|
}
|
|
5
|
-
export declare const PsFormPageSkeleton: ({ loadingLabel, title }: PsFormPageSkeletonProps) => import("react").JSX.Element;
|
|
9
|
+
export declare const PsFormPageSkeleton: ({ hasActions, hasBackLink, isNarrow, loadingLabel, title, variant, }: PsFormPageSkeletonProps) => import("react").JSX.Element;
|
|
@@ -6,5 +6,5 @@ const ps_page_skeleton_config_1 = require("../constants/ps-page-skeleton-config"
|
|
|
6
6
|
const ps_form_fields_skeleton_1 = require("./ps-form-fields-skeleton");
|
|
7
7
|
const ps_page_skeleton_1 = require("./ps-page-skeleton");
|
|
8
8
|
const ps_section_panel_skeleton_1 = require("./ps-section-panel-skeleton");
|
|
9
|
-
const PsFormPageSkeleton = ({ loadingLabel, title }) => ((0, jsx_runtime_1.jsx)(ps_page_skeleton_1.PsPageSkeleton, { hasActions:
|
|
9
|
+
const PsFormPageSkeleton = ({ hasActions = true, hasBackLink = false, isNarrow = false, loadingLabel, title, variant = 'plain', }) => ((0, jsx_runtime_1.jsx)(ps_page_skeleton_1.PsPageSkeleton, { hasActions: hasActions, hasBackLink: hasBackLink, isNarrow: isNarrow, loadingLabel: loadingLabel, title: title, children: ps_page_skeleton_config_1.PsPageSkeletonConfig.formSections.map((section) => ((0, jsx_runtime_1.jsx)(ps_section_panel_skeleton_1.PsSectionPanelSkeleton, { variant: variant, children: (0, jsx_runtime_1.jsx)(ps_form_fields_skeleton_1.PsFormFieldsSkeleton, {}) }, section))) }));
|
|
10
10
|
exports.PsFormPageSkeleton = PsFormPageSkeleton;
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PsMetricGridSkeleton = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const ps_metric_grid_config_1 = require("../constants/ps-metric-grid-config");
|
|
5
6
|
const ps_metric_card_1 = require("./ps-metric-card");
|
|
6
|
-
const PsMetricGridSkeleton = ({ count }) =>
|
|
7
|
+
const PsMetricGridSkeleton = ({ count }) => {
|
|
8
|
+
const columns = ps_metric_grid_config_1.PsMetricGridColumns[Math.min(count, ps_metric_grid_config_1.PsMetricGridConfig.maxColumns)];
|
|
9
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: `grid grid-cols-1 gap-3 ${columns === undefined ? ps_metric_grid_config_1.PsMetricGridColumns[ps_metric_grid_config_1.PsMetricGridConfig.defaultColumns] : columns}`, children: Array.from({ length: count }, (_, index) => ((0, jsx_runtime_1.jsx)(ps_metric_card_1.PsMetricCard, { isLoading: true, label: '', value: '' }, index))) }));
|
|
10
|
+
};
|
|
7
11
|
exports.PsMetricGridSkeleton = PsMetricGridSkeleton;
|
|
@@ -3,6 +3,7 @@ import { type PsBackLinkProps } from './ps-back-link';
|
|
|
3
3
|
export interface PsPageHeaderProps {
|
|
4
4
|
actions?: ReactNode;
|
|
5
5
|
backLink?: PsBackLinkProps;
|
|
6
|
+
leading?: ReactNode;
|
|
6
7
|
title: string;
|
|
7
8
|
}
|
|
8
|
-
export declare const PsPageHeader: ({ actions, backLink, title }: PsPageHeaderProps) => import("react").JSX.Element;
|
|
9
|
+
export declare const PsPageHeader: ({ actions, backLink, leading, title }: PsPageHeaderProps) => import("react").JSX.Element;
|
|
@@ -4,5 +4,5 @@ exports.PsPageHeader = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const ps_back_link_1 = require("./ps-back-link");
|
|
6
6
|
const ps_section_header_1 = require("./ps-section-header");
|
|
7
|
-
const PsPageHeader = ({ actions, backLink, title }) => ((0, jsx_runtime_1.jsx)(ps_section_header_1.PsSectionHeader, { leading: backLink ? (0, jsx_runtime_1.jsx)(ps_back_link_1.PsBackLink, { ...backLink }) :
|
|
7
|
+
const PsPageHeader = ({ actions, backLink, leading, title }) => ((0, jsx_runtime_1.jsx)(ps_section_header_1.PsSectionHeader, { leading: backLink ? (0, jsx_runtime_1.jsx)(ps_back_link_1.PsBackLink, { ...backLink }) : leading, title: title, trailing: actions ? ((0, jsx_runtime_1.jsx)("div", { className: 'flex flex-wrap items-center justify-end gap-2', children: actions })) : undefined }));
|
|
8
8
|
exports.PsPageHeader = PsPageHeader;
|
|
@@ -3,8 +3,9 @@ export interface PsPageSkeletonProps {
|
|
|
3
3
|
actions?: ReactNode;
|
|
4
4
|
children: ReactNode;
|
|
5
5
|
hasActions?: boolean;
|
|
6
|
+
hasBackLink?: boolean;
|
|
6
7
|
isNarrow?: boolean;
|
|
7
8
|
loadingLabel: string;
|
|
8
9
|
title?: string;
|
|
9
10
|
}
|
|
10
|
-
export declare const PsPageSkeleton: ({ actions, children, hasActions, isNarrow, loadingLabel, title, }: PsPageSkeletonProps) => import("react").JSX.Element;
|
|
11
|
+
export declare const PsPageSkeleton: ({ actions, children, hasActions, hasBackLink, isNarrow, loadingLabel, title, }: PsPageSkeletonProps) => import("react").JSX.Element;
|
|
@@ -8,5 +8,8 @@ const ps_page_layout_1 = require("./ps-page-layout");
|
|
|
8
8
|
const ps_page_stack_1 = require("./ps-page-stack");
|
|
9
9
|
const ps_section_header_1 = require("./ps-section-header");
|
|
10
10
|
const ps_skeleton_1 = require("./ps-skeleton");
|
|
11
|
-
const PsPageSkeleton = ({ actions, children, hasActions = false,
|
|
11
|
+
const PsPageSkeleton = ({ actions, children, hasActions = false, hasBackLink = false, isNarrow = false, loadingLabel, title, }) => {
|
|
12
|
+
const backLink = hasBackLink ? (0, jsx_runtime_1.jsx)(ps_skeleton_1.PsSkeleton, { className: 'h-5 w-32' }) : undefined;
|
|
13
|
+
return ((0, jsx_runtime_1.jsx)(ps_page_layout_1.PsPageLayout, { isNarrow: isNarrow, children: (0, jsx_runtime_1.jsxs)(ps_page_stack_1.PsPageStack, { children: [title === undefined ? ((0, jsx_runtime_1.jsx)(ps_section_header_1.PsSectionHeader, { isLoading: true, leading: backLink, title: loadingLabel, trailing: hasActions })) : ((0, jsx_runtime_1.jsx)(ps_page_header_1.PsPageHeader, { actions: actions !== undefined ? (actions) : hasActions ? ((0, jsx_runtime_1.jsx)(ps_skeleton_1.PsSkeleton, { shape: ps_skeleton_shape_1.PsSkeletonShape.Button })) : undefined, leading: backLink, title: title })), children] }) }));
|
|
14
|
+
};
|
|
12
15
|
exports.PsPageSkeleton = PsPageSkeleton;
|
|
@@ -5,5 +5,5 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const ps_skeleton_shape_1 = require("../constants/ps-skeleton-shape");
|
|
6
6
|
const ps_skeleton_1 = require("./ps-skeleton");
|
|
7
7
|
const ps_skeleton_group_1 = require("./ps-skeleton-group");
|
|
8
|
-
const PsSectionHeader = ({ description, eyebrow, isLoading = false, leading, title, trailing, }) => isLoading ? ((0, jsx_runtime_1.jsxs)(ps_skeleton_group_1.PsSkeletonGroup, { className: 'flex flex-wrap items-end justify-between gap-x-4 gap-y-3', label: title, children: [(0, jsx_runtime_1.jsxs)("div", { className: 'flex min-w-0 flex-1 basis-auto flex-col gap-2', children: [eyebrow ? (0, jsx_runtime_1.jsx)(ps_skeleton_1.PsSkeleton, { className: 'h-2.5 w-24' }) : null, (0, jsx_runtime_1.jsx)(ps_skeleton_1.PsSkeleton, { className: 'h-6 w-52' }), description ? (0, jsx_runtime_1.jsx)(ps_skeleton_1.PsSkeleton, { className: 'h-3 w-72' }) : null] }), trailing ? (0, jsx_runtime_1.jsx)(ps_skeleton_1.PsSkeleton, { shape: ps_skeleton_shape_1.PsSkeletonShape.Button }) : null] })) : ((0, jsx_runtime_1.jsxs)("div", { className: 'flex flex-wrap items-end justify-between gap-x-4 gap-y-3', children: [(0, jsx_runtime_1.jsxs)("div", { className: 'flex min-w-0 flex-1 basis-auto flex-col gap-2', children: [leading, eyebrow ? ((0, jsx_runtime_1.jsx)("p", { className: 'text-[0.68rem] font-semibold uppercase tracking-[0.22em] text-ink/50', children: eyebrow })) : null, (0, jsx_runtime_1.jsx)("h1", { className: 'break-words text-xl font-extrabold text-ink sm:text-2xl', children: title }), description ? ((0, jsx_runtime_1.jsx)("p", { className: 'max-w-3xl text-sm leading-6 text-ink/60', children: description })) : null] }), trailing ? ((0, jsx_runtime_1.jsx)("div", { className: 'flex w-full shrink-0 items-center justify-end sm:ml-auto sm:w-auto', children: trailing })) : null] }));
|
|
8
|
+
const PsSectionHeader = ({ description, eyebrow, isLoading = false, leading, title, trailing, }) => isLoading ? ((0, jsx_runtime_1.jsxs)(ps_skeleton_group_1.PsSkeletonGroup, { className: 'flex flex-wrap items-end justify-between gap-x-4 gap-y-3', label: title, children: [(0, jsx_runtime_1.jsxs)("div", { className: 'flex min-w-0 flex-1 basis-auto flex-col gap-2', children: [leading, eyebrow ? (0, jsx_runtime_1.jsx)(ps_skeleton_1.PsSkeleton, { className: 'h-2.5 w-24' }) : null, (0, jsx_runtime_1.jsx)(ps_skeleton_1.PsSkeleton, { className: 'h-6 w-52' }), description ? (0, jsx_runtime_1.jsx)(ps_skeleton_1.PsSkeleton, { className: 'h-3 w-72' }) : null] }), trailing ? (0, jsx_runtime_1.jsx)(ps_skeleton_1.PsSkeleton, { shape: ps_skeleton_shape_1.PsSkeletonShape.Button }) : null] })) : ((0, jsx_runtime_1.jsxs)("div", { className: 'flex flex-wrap items-end justify-between gap-x-4 gap-y-3', children: [(0, jsx_runtime_1.jsxs)("div", { className: 'flex min-w-0 flex-1 basis-auto flex-col gap-2', children: [leading, eyebrow ? ((0, jsx_runtime_1.jsx)("p", { className: 'text-[0.68rem] font-semibold uppercase tracking-[0.22em] text-ink/50', children: eyebrow })) : null, (0, jsx_runtime_1.jsx)("h1", { className: 'break-words text-xl font-extrabold text-ink sm:text-2xl', children: title }), description ? ((0, jsx_runtime_1.jsx)("p", { className: 'max-w-3xl text-sm leading-6 text-ink/60', children: description })) : null] }), trailing ? ((0, jsx_runtime_1.jsx)("div", { className: 'flex w-full shrink-0 items-center justify-end sm:ml-auto sm:w-auto', children: trailing })) : null] }));
|
|
9
9
|
exports.PsSectionHeader = PsSectionHeader;
|
|
@@ -2,5 +2,6 @@ import type { ReactNode } from 'react';
|
|
|
2
2
|
export interface PsSectionPanelSkeletonProps {
|
|
3
3
|
children: ReactNode;
|
|
4
4
|
title?: string;
|
|
5
|
+
variant?: 'bordered' | 'card' | 'plain';
|
|
5
6
|
}
|
|
6
|
-
export declare const PsSectionPanelSkeleton: ({ children, title }: PsSectionPanelSkeletonProps) => import("react").JSX.Element;
|
|
7
|
+
export declare const PsSectionPanelSkeleton: ({ children, title, variant, }: PsSectionPanelSkeletonProps) => import("react").JSX.Element;
|
|
@@ -3,5 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.PsSectionPanelSkeleton = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const ps_skeleton_1 = require("./ps-skeleton");
|
|
6
|
-
const PsSectionPanelSkeleton = ({ children, title
|
|
6
|
+
const PsSectionPanelSkeleton = ({ children, title, variant = 'plain', }) => {
|
|
7
|
+
const heading = title === undefined ? ((0, jsx_runtime_1.jsx)(ps_skeleton_1.PsSkeleton, { className: 'h-4 w-44' })) : ((0, jsx_runtime_1.jsx)("h2", { className: 'text-base font-semibold text-ink', children: title }));
|
|
8
|
+
return variant === 'bordered' ? ((0, jsx_runtime_1.jsxs)("section", { className: 'rounded-ps-panel border border-line bg-surface', children: [(0, jsx_runtime_1.jsx)("header", { className: 'flex min-h-14 items-center justify-between gap-3 border-b border-line px-5 py-3', children: (0, jsx_runtime_1.jsx)("div", { className: 'flex min-w-0 flex-col', children: heading }) }), (0, jsx_runtime_1.jsx)("div", { className: 'flex flex-col gap-4 p-5', children: children })] })) : variant === 'card' ? ((0, jsx_runtime_1.jsxs)("section", { className: 'rounded-ps-panel border border-line bg-surface p-5', children: [(0, jsx_runtime_1.jsx)("div", { className: 'mb-3', children: heading }), children] })) : ((0, jsx_runtime_1.jsxs)("section", { className: 'ps-section', children: [(0, jsx_runtime_1.jsx)("div", { className: 'flex min-h-10 items-center', children: heading }), (0, jsx_runtime_1.jsx)("div", { className: 'flex min-w-0 flex-col gap-4', children: children })] }));
|
|
9
|
+
};
|
|
7
10
|
exports.PsSectionPanelSkeleton = PsSectionPanelSkeleton;
|
|
@@ -3,4 +3,4 @@ import { PsPageSkeletonConfig } from '../constants/ps-page-skeleton-config.js';
|
|
|
3
3
|
import { PsFormFieldsSkeleton } from './ps-form-fields-skeleton.js';
|
|
4
4
|
import { PsPageSkeleton } from './ps-page-skeleton.js';
|
|
5
5
|
import { PsSectionPanelSkeleton } from './ps-section-panel-skeleton.js';
|
|
6
|
-
export const PsFormPageSkeleton = ({ loadingLabel, title }) => (_jsx(PsPageSkeleton, { hasActions:
|
|
6
|
+
export const PsFormPageSkeleton = ({ hasActions = true, hasBackLink = false, isNarrow = false, loadingLabel, title, variant = 'plain', }) => (_jsx(PsPageSkeleton, { hasActions: hasActions, hasBackLink: hasBackLink, isNarrow: isNarrow, loadingLabel: loadingLabel, title: title, children: PsPageSkeletonConfig.formSections.map((section) => (_jsx(PsSectionPanelSkeleton, { variant: variant, children: _jsx(PsFormFieldsSkeleton, {}) }, section))) }));
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { PsMetricGridColumns, PsMetricGridConfig } from '../constants/ps-metric-grid-config.js';
|
|
2
3
|
import { PsMetricCard } from './ps-metric-card.js';
|
|
3
|
-
export const PsMetricGridSkeleton = ({ count }) =>
|
|
4
|
+
export const PsMetricGridSkeleton = ({ count }) => {
|
|
5
|
+
const columns = PsMetricGridColumns[Math.min(count, PsMetricGridConfig.maxColumns)];
|
|
6
|
+
return (_jsx("div", { className: `grid grid-cols-1 gap-3 ${columns === undefined ? PsMetricGridColumns[PsMetricGridConfig.defaultColumns] : columns}`, children: Array.from({ length: count }, (_, index) => (_jsx(PsMetricCard, { isLoading: true, label: '', value: '' }, index))) }));
|
|
7
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { PsBackLink } from './ps-back-link.js';
|
|
3
3
|
import { PsSectionHeader } from './ps-section-header.js';
|
|
4
|
-
export const PsPageHeader = ({ actions, backLink, title }) => (_jsx(PsSectionHeader, { leading: backLink ? _jsx(PsBackLink, { ...backLink }) :
|
|
4
|
+
export const PsPageHeader = ({ actions, backLink, leading, title }) => (_jsx(PsSectionHeader, { leading: backLink ? _jsx(PsBackLink, { ...backLink }) : leading, title: title, trailing: actions ? (_jsx("div", { className: 'flex flex-wrap items-center justify-end gap-2', children: actions })) : undefined }));
|
|
@@ -5,4 +5,7 @@ import { PsPageLayout } from './ps-page-layout.js';
|
|
|
5
5
|
import { PsPageStack } from './ps-page-stack.js';
|
|
6
6
|
import { PsSectionHeader } from './ps-section-header.js';
|
|
7
7
|
import { PsSkeleton } from './ps-skeleton.js';
|
|
8
|
-
export const PsPageSkeleton = ({ actions, children, hasActions = false,
|
|
8
|
+
export const PsPageSkeleton = ({ actions, children, hasActions = false, hasBackLink = false, isNarrow = false, loadingLabel, title, }) => {
|
|
9
|
+
const backLink = hasBackLink ? _jsx(PsSkeleton, { className: 'h-5 w-32' }) : undefined;
|
|
10
|
+
return (_jsx(PsPageLayout, { isNarrow: isNarrow, children: _jsxs(PsPageStack, { children: [title === undefined ? (_jsx(PsSectionHeader, { isLoading: true, leading: backLink, title: loadingLabel, trailing: hasActions })) : (_jsx(PsPageHeader, { actions: actions !== undefined ? (actions) : hasActions ? (_jsx(PsSkeleton, { shape: PsSkeletonShape.Button })) : undefined, leading: backLink, title: title })), children] }) }));
|
|
11
|
+
};
|
|
@@ -2,4 +2,4 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { PsSkeletonShape } from '../constants/ps-skeleton-shape.js';
|
|
3
3
|
import { PsSkeleton } from './ps-skeleton.js';
|
|
4
4
|
import { PsSkeletonGroup } from './ps-skeleton-group.js';
|
|
5
|
-
export const PsSectionHeader = ({ description, eyebrow, isLoading = false, leading, title, trailing, }) => isLoading ? (_jsxs(PsSkeletonGroup, { className: 'flex flex-wrap items-end justify-between gap-x-4 gap-y-3', label: title, children: [_jsxs("div", { className: 'flex min-w-0 flex-1 basis-auto flex-col gap-2', children: [eyebrow ? _jsx(PsSkeleton, { className: 'h-2.5 w-24' }) : null, _jsx(PsSkeleton, { className: 'h-6 w-52' }), description ? _jsx(PsSkeleton, { className: 'h-3 w-72' }) : null] }), trailing ? _jsx(PsSkeleton, { shape: PsSkeletonShape.Button }) : null] })) : (_jsxs("div", { className: 'flex flex-wrap items-end justify-between gap-x-4 gap-y-3', children: [_jsxs("div", { className: 'flex min-w-0 flex-1 basis-auto flex-col gap-2', children: [leading, eyebrow ? (_jsx("p", { className: 'text-[0.68rem] font-semibold uppercase tracking-[0.22em] text-ink/50', children: eyebrow })) : null, _jsx("h1", { className: 'break-words text-xl font-extrabold text-ink sm:text-2xl', children: title }), description ? (_jsx("p", { className: 'max-w-3xl text-sm leading-6 text-ink/60', children: description })) : null] }), trailing ? (_jsx("div", { className: 'flex w-full shrink-0 items-center justify-end sm:ml-auto sm:w-auto', children: trailing })) : null] }));
|
|
5
|
+
export const PsSectionHeader = ({ description, eyebrow, isLoading = false, leading, title, trailing, }) => isLoading ? (_jsxs(PsSkeletonGroup, { className: 'flex flex-wrap items-end justify-between gap-x-4 gap-y-3', label: title, children: [_jsxs("div", { className: 'flex min-w-0 flex-1 basis-auto flex-col gap-2', children: [leading, eyebrow ? _jsx(PsSkeleton, { className: 'h-2.5 w-24' }) : null, _jsx(PsSkeleton, { className: 'h-6 w-52' }), description ? _jsx(PsSkeleton, { className: 'h-3 w-72' }) : null] }), trailing ? _jsx(PsSkeleton, { shape: PsSkeletonShape.Button }) : null] })) : (_jsxs("div", { className: 'flex flex-wrap items-end justify-between gap-x-4 gap-y-3', children: [_jsxs("div", { className: 'flex min-w-0 flex-1 basis-auto flex-col gap-2', children: [leading, eyebrow ? (_jsx("p", { className: 'text-[0.68rem] font-semibold uppercase tracking-[0.22em] text-ink/50', children: eyebrow })) : null, _jsx("h1", { className: 'break-words text-xl font-extrabold text-ink sm:text-2xl', children: title }), description ? (_jsx("p", { className: 'max-w-3xl text-sm leading-6 text-ink/60', children: description })) : null] }), trailing ? (_jsx("div", { className: 'flex w-full shrink-0 items-center justify-end sm:ml-auto sm:w-auto', children: trailing })) : null] }));
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { PsSkeleton } from './ps-skeleton.js';
|
|
3
|
-
export const PsSectionPanelSkeleton = ({ children, title
|
|
3
|
+
export const PsSectionPanelSkeleton = ({ children, title, variant = 'plain', }) => {
|
|
4
|
+
const heading = title === undefined ? (_jsx(PsSkeleton, { className: 'h-4 w-44' })) : (_jsx("h2", { className: 'text-base font-semibold text-ink', children: title }));
|
|
5
|
+
return variant === 'bordered' ? (_jsxs("section", { className: 'rounded-ps-panel border border-line bg-surface', children: [_jsx("header", { className: 'flex min-h-14 items-center justify-between gap-3 border-b border-line px-5 py-3', children: _jsx("div", { className: 'flex min-w-0 flex-col', children: heading }) }), _jsx("div", { className: 'flex flex-col gap-4 p-5', children: children })] })) : variant === 'card' ? (_jsxs("section", { className: 'rounded-ps-panel border border-line bg-surface p-5', children: [_jsx("div", { className: 'mb-3', children: heading }), children] })) : (_jsxs("section", { className: 'ps-section', children: [_jsx("div", { className: 'flex min-h-10 items-center', children: heading }), _jsx("div", { className: 'flex min-w-0 flex-col gap-4', children: children })] }));
|
|
6
|
+
};
|