@pallasoft/ps-core-components 1.0.0 → 1.2.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.
@@ -2,6 +2,8 @@ import type { ReactNode } from 'react';
2
2
  export interface PsEmptyStateAction {
3
3
  href: string;
4
4
  label: string;
5
+ rel?: string;
6
+ target?: string;
5
7
  variant?: 'primary' | 'secondary';
6
8
  }
7
9
  export interface PsEmptyStateProps {
@@ -9,5 +9,5 @@ const getActionClassName = (variant = 'secondary') => {
9
9
  }
10
10
  return 'border-line bg-surface text-ink hover:border-primary/40 hover:text-primary';
11
11
  };
12
- const PsEmptyState = ({ actions = [], badge, className, detail, description, eyebrow, icon, title, }) => ((0, jsx_runtime_1.jsx)("main", { className: ps_design_system_1.PallasoftClassNameService.merge('relative flex min-h-screen items-center justify-center bg-mist px-4 py-10 text-ink', className), children: (0, jsx_runtime_1.jsx)("section", { className: 'ps-card relative w-full max-w-2xl p-6 sm:p-8', children: (0, jsx_runtime_1.jsxs)("div", { className: 'flex flex-col gap-5 sm:flex-row sm:items-start', children: [icon ? ((0, jsx_runtime_1.jsx)("div", { className: 'ps-icon-surface h-14 w-14', children: icon })) : null, (0, jsx_runtime_1.jsxs)("div", { className: 'min-w-0 flex-1', children: [(0, jsx_runtime_1.jsxs)("div", { className: 'flex flex-wrap items-center gap-2', children: [eyebrow ? ((0, jsx_runtime_1.jsx)("p", { className: 'text-xs font-semibold uppercase tracking-[0.22em] text-primary', children: eyebrow })) : null, eyebrow && badge ? (0, jsx_runtime_1.jsx)("span", { className: 'h-1 w-1 rounded-full bg-line' }) : null, badge ? ((0, jsx_runtime_1.jsx)("p", { className: 'text-xs font-semibold uppercase tracking-[0.22em] text-ink/40', children: badge })) : null] }), (0, jsx_runtime_1.jsx)("h1", { className: 'mt-3 text-3xl font-semibold tracking-tight sm:text-4xl', children: title }), (0, jsx_runtime_1.jsx)("p", { className: 'mt-3 text-sm leading-6 text-ink/60', children: description }), detail ? ((0, jsx_runtime_1.jsx)("p", { className: 'mt-4 rounded-2xl border border-line bg-mist px-4 py-3 text-left text-xs leading-5 text-ink/60', children: detail })) : null, actions.length > 0 ? ((0, jsx_runtime_1.jsx)("div", { className: 'mt-6 flex flex-col gap-2 sm:flex-row', children: actions.map((action) => ((0, jsx_runtime_1.jsx)("a", { className: ps_design_system_1.PallasoftClassNameService.merge('ps-focus-ring ps-pressable inline-flex items-center justify-center rounded-ps-control border px-4 py-3 text-sm font-semibold', getActionClassName(action.variant)), href: action.href, children: action.label }, `${action.href}-${action.label}`))) })) : null] })] }) }) }));
12
+ const PsEmptyState = ({ actions = [], badge, className, detail, description, eyebrow, icon, title, }) => ((0, jsx_runtime_1.jsx)("main", { className: ps_design_system_1.PallasoftClassNameService.merge('relative flex min-h-screen items-center justify-center bg-mist px-4 py-10 text-ink', className), children: (0, jsx_runtime_1.jsx)("section", { className: 'ps-card relative w-full max-w-2xl p-6 sm:p-8', children: (0, jsx_runtime_1.jsxs)("div", { className: 'flex flex-col gap-5 sm:flex-row sm:items-start', children: [icon ? (0, jsx_runtime_1.jsx)("div", { className: 'ps-icon-surface h-14 w-14', children: icon }) : null, (0, jsx_runtime_1.jsxs)("div", { className: 'min-w-0 flex-1', children: [(0, jsx_runtime_1.jsxs)("div", { className: 'flex flex-wrap items-center gap-2', children: [eyebrow ? ((0, jsx_runtime_1.jsx)("p", { className: 'text-xs font-semibold uppercase tracking-[0.22em] text-primary', children: eyebrow })) : null, eyebrow && badge ? (0, jsx_runtime_1.jsx)("span", { className: 'h-1 w-1 rounded-full bg-line' }) : null, badge ? ((0, jsx_runtime_1.jsx)("p", { className: 'text-xs font-semibold uppercase tracking-[0.22em] text-ink/40', children: badge })) : null] }), (0, jsx_runtime_1.jsx)("h1", { className: 'mt-3 text-3xl font-semibold tracking-tight sm:text-4xl', children: title }), (0, jsx_runtime_1.jsx)("p", { className: 'mt-3 text-sm leading-6 text-ink/60', children: description }), detail ? ((0, jsx_runtime_1.jsx)("p", { className: 'mt-4 rounded-2xl border border-line bg-mist px-4 py-3 text-left text-xs leading-5 text-ink/60', children: detail })) : null, actions.length > 0 ? ((0, jsx_runtime_1.jsx)("div", { className: 'mt-6 flex flex-col gap-2 sm:flex-row', children: actions.map((action) => ((0, jsx_runtime_1.jsx)("a", { className: ps_design_system_1.PallasoftClassNameService.merge('ps-focus-ring ps-pressable inline-flex items-center justify-center rounded-ps-control border px-4 py-3 text-sm font-semibold', getActionClassName(action.variant)), href: action.href, rel: action.rel, target: action.target, children: action.label }, `${action.href}-${action.label}`))) })) : null] })] }) }) }));
13
13
  exports.PsEmptyState = PsEmptyState;
@@ -0,0 +1,14 @@
1
+ import type { ElementType, ReactNode } from 'react';
2
+ export interface PsSiteHeaderProps {
3
+ centerContent?: ReactNode;
4
+ homeHref: string;
5
+ label: string;
6
+ LinkComponent?: ElementType;
7
+ logoAlt?: string;
8
+ logoClassName?: string;
9
+ logoSrc: string;
10
+ onBack?: () => void;
11
+ showLabel?: boolean;
12
+ trailing?: ReactNode;
13
+ }
14
+ export declare const PsSiteHeader: ({ centerContent, homeHref, label, LinkComponent, logoAlt, logoClassName, logoSrc, onBack, showLabel, trailing, }: PsSiteHeaderProps) => import("react").JSX.Element;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PsSiteHeader = 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 logoLinkClassName = 'flex shrink-0 items-center gap-2.5';
8
+ const PsSiteHeader = ({ centerContent, homeHref, label, LinkComponent, logoAlt, logoClassName, logoSrc, onBack, showLabel = false, trailing, }) => {
9
+ const logoLabel = `${label} home`;
10
+ const logoContent = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("img", { alt: logoAlt ?? label, className: ps_design_system_1.PallasoftClassNameService.merge('h-8 w-auto', logoClassName), src: logoSrc }), showLabel ? (0, jsx_runtime_1.jsx)("span", { className: 'text-base font-bold text-ink', children: label }) : null] }));
11
+ const logoLink = LinkComponent ? ((0, jsx_runtime_1.jsx)(LinkComponent, { "aria-label": logoLabel, className: logoLinkClassName, to: homeHref, children: logoContent })) : ((0, jsx_runtime_1.jsx)("a", { "aria-label": logoLabel, className: logoLinkClassName, href: homeHref, children: logoContent }));
12
+ return ((0, jsx_runtime_1.jsx)("header", { className: 'fixed inset-x-0 top-0 z-header px-6 pt-4', children: (0, jsx_runtime_1.jsxs)("nav", { className: 'ps-glass mx-auto flex max-w-6xl items-center gap-3 rounded-ps-card px-5 py-3', children: [onBack ? ((0, jsx_runtime_1.jsx)("button", { "aria-label": 'Back', className: 'ps-focus-ring flex h-9 w-9 shrink-0 items-center justify-center rounded-full text-ink md:hidden', onClick: onBack, type: 'button', children: (0, jsx_runtime_1.jsx)(ps_icons_1.PsIcon, { iconKey: ps_icons_1.PsIconKey.ChevronRight, width: 20, height: 20, className: 'rotate-180' }) })) : null, (0, jsx_runtime_1.jsx)("div", { className: onBack ? 'hidden md:flex' : 'contents', children: logoLink }), (0, jsx_runtime_1.jsx)("div", { className: 'flex min-w-0 flex-1 items-center justify-center gap-3', children: centerContent }), trailing ? (0, jsx_runtime_1.jsx)("div", { className: 'flex shrink-0 items-center gap-2.5', children: trailing }) : null] }) }));
13
+ };
14
+ exports.PsSiteHeader = PsSiteHeader;
package/dist/index.d.ts CHANGED
@@ -13,6 +13,7 @@ export * from './components/ps-metric-card';
13
13
  export * from './components/ps-pill';
14
14
  export * from './components/ps-reflective-app-shell';
15
15
  export * from './components/ps-section-header';
16
+ export * from './components/ps-site-header';
16
17
  export * from './components/ps-skeleton';
17
18
  export * from './components/ps-spinner';
18
19
  export * from './components/ps-theme-toggle';
package/dist/index.js CHANGED
@@ -29,6 +29,7 @@ __exportStar(require("./components/ps-metric-card"), exports);
29
29
  __exportStar(require("./components/ps-pill"), exports);
30
30
  __exportStar(require("./components/ps-reflective-app-shell"), exports);
31
31
  __exportStar(require("./components/ps-section-header"), exports);
32
+ __exportStar(require("./components/ps-site-header"), exports);
32
33
  __exportStar(require("./components/ps-skeleton"), exports);
33
34
  __exportStar(require("./components/ps-spinner"), exports);
34
35
  __exportStar(require("./components/ps-theme-toggle"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pallasoft/ps-core-components",
3
- "version": "1.0.0",
3
+ "version": "1.2.0",
4
4
  "private": false,
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",