@pallasoft/ps-core-components 2.52.0 → 2.52.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.
- package/dist/components/ps-badge.js +1 -1
- package/dist/components/ps-link-tile-grid.js +1 -1
- package/dist/components/ps-section-header.d.ts +3 -1
- package/dist/components/ps-section-header.js +5 -1
- package/dist/constants/ps-heading-level.d.ts +6 -0
- package/dist/constants/ps-heading-level.js +8 -0
- package/dist/esm/components/ps-badge.js +1 -1
- package/dist/esm/components/ps-link-tile-grid.js +1 -1
- package/dist/esm/components/ps-section-header.js +5 -1
- package/dist/esm/constants/ps-heading-level.js +5 -0
- package/dist/esm/index.js +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +1 -1
|
@@ -12,5 +12,5 @@ const toneClassNames = {
|
|
|
12
12
|
success: 'bg-success-soft text-emerald-700 dark:bg-emerald-400/18 dark:text-emerald-50',
|
|
13
13
|
warning: 'bg-warning-soft text-amber-800 dark:bg-amber-400/18 dark:text-amber-50',
|
|
14
14
|
};
|
|
15
|
-
const PsBadge = ({ children, className, isLoading = false, tone = 'neutral', }) => isLoading ? ((0, jsx_runtime_1.jsx)(ps_skeleton_1.PsSkeleton, { className: className, shape: ps_skeleton_shape_1.PsSkeletonShape.Badge })) : ((0, jsx_runtime_1.jsx)("span", { className: ps_design_system_1.PallasoftClassNameService.merge('inline-flex min-h-7 w-fit items-center justify-center whitespace-nowrap rounded-ps-control px-3 py-0.5 text-center text-xs font-semibold
|
|
15
|
+
const PsBadge = ({ children, className, isLoading = false, tone = 'neutral', }) => isLoading ? ((0, jsx_runtime_1.jsx)(ps_skeleton_1.PsSkeleton, { className: className, shape: ps_skeleton_shape_1.PsSkeletonShape.Badge })) : ((0, jsx_runtime_1.jsx)("span", { className: ps_design_system_1.PallasoftClassNameService.merge('inline-flex min-h-7 w-fit items-center justify-center whitespace-nowrap rounded-ps-control px-3 py-0.5 text-center text-xs font-semibold', toneClassNames[tone], className), children: children }));
|
|
16
16
|
exports.PsBadge = PsBadge;
|
|
@@ -8,6 +8,6 @@ const ps_website_section_config_1 = require("../constants/ps-website-section-con
|
|
|
8
8
|
const tileClassName = 'ps-pressable ps-focus-ring group flex h-full items-center justify-between gap-3 rounded-ps-card border border-line bg-surface px-4 py-3 transition-colors hover:border-primary/50';
|
|
9
9
|
const PsLinkTileGrid = ({ LinkComponent, tiles }) => {
|
|
10
10
|
const renderTile = (tile, content) => LinkComponent ? ((0, jsx_runtime_1.jsx)(LinkComponent, { "aria-label": tile.ariaLabel, className: tileClassName, prefetch: 'intent', to: tile.href, children: content })) : ((0, jsx_runtime_1.jsx)("a", { "aria-label": tile.ariaLabel, className: tileClassName, href: tile.href, children: content }));
|
|
11
|
-
return ((0, jsx_runtime_1.jsx)(ps_motion_components_1.PsStaggerContainer, { className: 'grid w-full grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3', staggerDelay: ps_website_section_config_1.PsWebsiteSectionConfig.tileStaggerDelay, children: tiles.map((tile) => ((0, jsx_runtime_1.jsx)(ps_motion_components_1.PsStaggerItem, { children: renderTile(tile, (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("span", { className: 'flex min-w-0 flex-col', children: [(0, jsx_runtime_1.jsx)("span", { className: 'text-body-2 font-semibold text-ink', children: tile.title }), (0, jsx_runtime_1.jsx)("span", { className: '
|
|
11
|
+
return ((0, jsx_runtime_1.jsx)(ps_motion_components_1.PsStaggerContainer, { className: 'grid w-full grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3', staggerDelay: ps_website_section_config_1.PsWebsiteSectionConfig.tileStaggerDelay, children: tiles.map((tile) => ((0, jsx_runtime_1.jsx)(ps_motion_components_1.PsStaggerItem, { children: renderTile(tile, (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("span", { className: 'flex min-w-0 flex-col', children: [(0, jsx_runtime_1.jsx)("span", { className: 'text-body-2 font-semibold text-ink', children: tile.title }), (0, jsx_runtime_1.jsx)("span", { className: 'line-clamp-2 text-body-3 text-ink/60', children: tile.description })] }), (0, jsx_runtime_1.jsx)(ps_icons_1.PsIcon, { className: 'h-4 w-4 shrink-0 text-ink/40 transition-colors group-hover:text-primary', iconKey: ps_icons_1.PsIconKey.ChevronRight })] })) }, tile.href))) }));
|
|
12
12
|
};
|
|
13
13
|
exports.PsLinkTileGrid = PsLinkTileGrid;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
+
import { PsHeadingLevel } from '../constants/ps-heading-level';
|
|
2
3
|
export interface PsSectionHeaderProps {
|
|
3
4
|
description?: string;
|
|
4
5
|
eyebrow?: string;
|
|
6
|
+
headingLevel?: PsHeadingLevel;
|
|
5
7
|
isLoading?: boolean;
|
|
6
8
|
leading?: ReactNode;
|
|
7
9
|
title: string;
|
|
8
10
|
trailing?: ReactNode;
|
|
9
11
|
}
|
|
10
|
-
export declare const PsSectionHeader: ({ description, eyebrow, isLoading, leading, title, trailing, }: PsSectionHeaderProps) => import("react").JSX.Element;
|
|
12
|
+
export declare const PsSectionHeader: ({ description, eyebrow, headingLevel, isLoading, leading, title, trailing, }: PsSectionHeaderProps) => import("react").JSX.Element;
|
|
@@ -2,8 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PsSectionHeader = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const ps_heading_level_1 = require("../constants/ps-heading-level");
|
|
5
6
|
const ps_skeleton_shape_1 = require("../constants/ps-skeleton-shape");
|
|
6
7
|
const ps_skeleton_1 = require("./ps-skeleton");
|
|
7
8
|
const ps_skeleton_group_1 = require("./ps-skeleton-group");
|
|
8
|
-
const PsSectionHeader = ({ description, eyebrow,
|
|
9
|
+
const PsSectionHeader = ({ description, eyebrow, headingLevel = ps_heading_level_1.PsHeadingLevel.h1, isLoading = false, leading, title, trailing, }) => {
|
|
10
|
+
const Heading = headingLevel;
|
|
11
|
+
return 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-muted', children: eyebrow })) : null, (0, jsx_runtime_1.jsx)(Heading, { 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] }));
|
|
12
|
+
};
|
|
9
13
|
exports.PsSectionHeader = PsSectionHeader;
|
|
@@ -9,4 +9,4 @@ const toneClassNames = {
|
|
|
9
9
|
success: 'bg-success-soft text-emerald-700 dark:bg-emerald-400/18 dark:text-emerald-50',
|
|
10
10
|
warning: 'bg-warning-soft text-amber-800 dark:bg-amber-400/18 dark:text-amber-50',
|
|
11
11
|
};
|
|
12
|
-
export const PsBadge = ({ children, className, isLoading = false, tone = 'neutral', }) => isLoading ? (_jsx(PsSkeleton, { className: className, shape: PsSkeletonShape.Badge })) : (_jsx("span", { className: PallasoftClassNameService.merge('inline-flex min-h-7 w-fit items-center justify-center whitespace-nowrap rounded-ps-control px-3 py-0.5 text-center text-xs font-semibold
|
|
12
|
+
export const PsBadge = ({ children, className, isLoading = false, tone = 'neutral', }) => isLoading ? (_jsx(PsSkeleton, { className: className, shape: PsSkeletonShape.Badge })) : (_jsx("span", { className: PallasoftClassNameService.merge('inline-flex min-h-7 w-fit items-center justify-center whitespace-nowrap rounded-ps-control px-3 py-0.5 text-center text-xs font-semibold', toneClassNames[tone], className), children: children }));
|
|
@@ -5,5 +5,5 @@ import { PsWebsiteSectionConfig } from '../constants/ps-website-section-config.j
|
|
|
5
5
|
const tileClassName = 'ps-pressable ps-focus-ring group flex h-full items-center justify-between gap-3 rounded-ps-card border border-line bg-surface px-4 py-3 transition-colors hover:border-primary/50';
|
|
6
6
|
export const PsLinkTileGrid = ({ LinkComponent, tiles }) => {
|
|
7
7
|
const renderTile = (tile, content) => LinkComponent ? (_jsx(LinkComponent, { "aria-label": tile.ariaLabel, className: tileClassName, prefetch: 'intent', to: tile.href, children: content })) : (_jsx("a", { "aria-label": tile.ariaLabel, className: tileClassName, href: tile.href, children: content }));
|
|
8
|
-
return (_jsx(PsStaggerContainer, { className: 'grid w-full grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3', staggerDelay: PsWebsiteSectionConfig.tileStaggerDelay, children: tiles.map((tile) => (_jsx(PsStaggerItem, { children: renderTile(tile, _jsxs(_Fragment, { children: [_jsxs("span", { className: 'flex min-w-0 flex-col', children: [_jsx("span", { className: 'text-body-2 font-semibold text-ink', children: tile.title }), _jsx("span", { className: '
|
|
8
|
+
return (_jsx(PsStaggerContainer, { className: 'grid w-full grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3', staggerDelay: PsWebsiteSectionConfig.tileStaggerDelay, children: tiles.map((tile) => (_jsx(PsStaggerItem, { children: renderTile(tile, _jsxs(_Fragment, { children: [_jsxs("span", { className: 'flex min-w-0 flex-col', children: [_jsx("span", { className: 'text-body-2 font-semibold text-ink', children: tile.title }), _jsx("span", { className: 'line-clamp-2 text-body-3 text-ink/60', children: tile.description })] }), _jsx(PsIcon, { className: 'h-4 w-4 shrink-0 text-ink/40 transition-colors group-hover:text-primary', iconKey: PsIconKey.ChevronRight })] })) }, tile.href))) }));
|
|
9
9
|
};
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { PsHeadingLevel } from '../constants/ps-heading-level.js';
|
|
2
3
|
import { PsSkeletonShape } from '../constants/ps-skeleton-shape.js';
|
|
3
4
|
import { PsSkeleton } from './ps-skeleton.js';
|
|
4
5
|
import { PsSkeletonGroup } from './ps-skeleton-group.js';
|
|
5
|
-
export const PsSectionHeader = ({ description, eyebrow,
|
|
6
|
+
export const PsSectionHeader = ({ description, eyebrow, headingLevel = PsHeadingLevel.h1, isLoading = false, leading, title, trailing, }) => {
|
|
7
|
+
const Heading = headingLevel;
|
|
8
|
+
return 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-muted', children: eyebrow })) : null, _jsx(Heading, { 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] }));
|
|
9
|
+
};
|
package/dist/esm/index.js
CHANGED
|
@@ -138,6 +138,7 @@ export * from './components/ps-metric-row.js';
|
|
|
138
138
|
export * from './components/ps-page-header.js';
|
|
139
139
|
export * from './components/ps-page-intro.js';
|
|
140
140
|
export * from './components/ps-page-layout.js';
|
|
141
|
+
export * from './constants/ps-heading-level.js';
|
|
141
142
|
export * from './constants/ps-page-width.js';
|
|
142
143
|
export * from './constants/ps-page-width-class-names.js';
|
|
143
144
|
export * from './services/ps-page-width-service.js';
|
package/dist/index.d.ts
CHANGED
|
@@ -138,6 +138,7 @@ export * from './components/ps-metric-row';
|
|
|
138
138
|
export * from './components/ps-page-header';
|
|
139
139
|
export * from './components/ps-page-intro';
|
|
140
140
|
export * from './components/ps-page-layout';
|
|
141
|
+
export * from './constants/ps-heading-level';
|
|
141
142
|
export * from './constants/ps-page-width';
|
|
142
143
|
export * from './constants/ps-page-width-class-names';
|
|
143
144
|
export * from './services/ps-page-width-service';
|
package/dist/index.js
CHANGED
|
@@ -155,6 +155,7 @@ __exportStar(require("./components/ps-metric-row"), exports);
|
|
|
155
155
|
__exportStar(require("./components/ps-page-header"), exports);
|
|
156
156
|
__exportStar(require("./components/ps-page-intro"), exports);
|
|
157
157
|
__exportStar(require("./components/ps-page-layout"), exports);
|
|
158
|
+
__exportStar(require("./constants/ps-heading-level"), exports);
|
|
158
159
|
__exportStar(require("./constants/ps-page-width"), exports);
|
|
159
160
|
__exportStar(require("./constants/ps-page-width-class-names"), exports);
|
|
160
161
|
__exportStar(require("./services/ps-page-width-service"), exports);
|