@pallasoft/ps-core-components 2.15.1 → 2.15.3
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-site-header.js +1 -1
- package/dist/components/ps-skeleton.js +3 -8
- package/dist/constants/ps-skeleton-config.d.ts +10 -0
- package/dist/constants/ps-skeleton-config.js +19 -0
- package/dist/constants/ps-voice-orb.js +7 -7
- package/dist/esm/components/ps-site-header.js +1 -1
- package/dist/esm/components/ps-skeleton.js +3 -8
- package/dist/esm/constants/ps-skeleton-config.js +19 -0
- package/dist/esm/constants/ps-voice-orb.js +7 -7
- package/dist/esm/index.js +2 -0
- package/dist/esm/models/ps-skeleton-size.js +1 -0
- package/dist/esm/services/ps-skeleton-class-service.js +19 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/models/ps-skeleton-size.d.ts +4 -0
- package/dist/models/ps-skeleton-size.js +2 -0
- package/dist/services/ps-skeleton-class-service.d.ts +5 -0
- package/dist/services/ps-skeleton-class-service.js +23 -0
- package/package.json +1 -1
|
@@ -10,7 +10,7 @@ const logoLinkClassName = 'flex shrink-0 items-center gap-2.5';
|
|
|
10
10
|
const PsSiteHeader = ({ centerContent, className, homeHref, label, LinkComponent, logoAlt, logoClassName, logoSrc, logoSrcDark, logoSrcMobile, logoSrcMobileDark, navClassName, onBack, showLabel = false, trailing, }) => {
|
|
11
11
|
const headerRef = (0, use_ps_published_height_1.usePsPublishedHeight)(ps_site_header_config_1.PsSiteHeaderConfig.heightVariable);
|
|
12
12
|
const logoLabel = `${label} home`;
|
|
13
|
-
const renderLogo = (src, darkSrc, baseClassName) => darkSrc ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("img", { alt: logoAlt !== null && logoAlt !== undefined ? logoAlt : label, className: ps_design_system_1.PallasoftClassNameService.merge(baseClassName, 'dark:hidden', logoClassName), decoding: 'async',
|
|
13
|
+
const renderLogo = (src, darkSrc, baseClassName) => darkSrc ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("img", { alt: logoAlt !== null && logoAlt !== undefined ? logoAlt : label, className: ps_design_system_1.PallasoftClassNameService.merge(baseClassName, 'dark:hidden', logoClassName), decoding: 'async', src: src }), (0, jsx_runtime_1.jsx)("img", { alt: logoAlt !== null && logoAlt !== undefined ? logoAlt : label, className: ps_design_system_1.PallasoftClassNameService.merge(baseClassName, 'hidden dark:block', logoClassName), decoding: 'async', src: darkSrc })] })) : ((0, jsx_runtime_1.jsx)("img", { alt: logoAlt !== null && logoAlt !== undefined ? logoAlt : label, className: ps_design_system_1.PallasoftClassNameService.merge(baseClassName, logoClassName), decoding: 'async', src: src }));
|
|
14
14
|
const logoContent = logoSrcMobile ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span", { className: 'hidden sm:contents', children: renderLogo(logoSrc, logoSrcDark, 'h-8 w-auto') }), (0, jsx_runtime_1.jsx)("span", { className: 'contents sm:hidden', children: renderLogo(logoSrcMobile, logoSrcMobileDark, 'h-8 w-auto') }), showLabel ? (0, jsx_runtime_1.jsx)("span", { className: 'text-base font-bold text-ink', children: label }) : null] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [renderLogo(logoSrc, logoSrcDark, 'h-8 w-auto'), showLabel ? (0, jsx_runtime_1.jsx)("span", { className: 'text-base font-bold text-ink', children: label }) : null] }));
|
|
15
15
|
const logoLink = LinkComponent ? ((0, jsx_runtime_1.jsx)(LinkComponent, { "aria-label": logoLabel, className: logoLinkClassName, prefetch: 'intent', to: homeHref, children: logoContent })) : ((0, jsx_runtime_1.jsx)("a", { "aria-label": logoLabel, className: logoLinkClassName, href: homeHref, children: logoContent }));
|
|
16
16
|
return ((0, jsx_runtime_1.jsx)("header", { ref: headerRef, className: ps_design_system_1.PallasoftClassNameService.merge('fixed inset-x-0 top-0 z-header px-6 pt-4', className), children: (0, jsx_runtime_1.jsxs)("nav", { className: ps_design_system_1.PallasoftClassNameService.merge('ps-glass mx-auto flex max-w-6xl items-center gap-3 rounded-ps-card px-5 py-3', navClassName), 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] }) }));
|
|
@@ -5,12 +5,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const ps_design_system_1 = require("@pallasoft/ps-design-system");
|
|
6
6
|
const ps_skeleton_config_1 = require("../constants/ps-skeleton-config");
|
|
7
7
|
const ps_skeleton_shape_1 = require("../constants/ps-skeleton-shape");
|
|
8
|
-
const
|
|
9
|
-
[ps_skeleton_shape_1.PsSkeletonShape.Block]: 'h-11 w-full rounded-ps-control',
|
|
10
|
-
[ps_skeleton_shape_1.PsSkeletonShape.Circle]: 'h-9 w-9 shrink-0 rounded-full',
|
|
11
|
-
[ps_skeleton_shape_1.PsSkeletonShape.Line]: 'h-3 w-full rounded-full',
|
|
12
|
-
[ps_skeleton_shape_1.PsSkeletonShape.Text]: 'h-3 w-full rounded-full',
|
|
13
|
-
};
|
|
8
|
+
const ps_skeleton_class_service_1 = require("../services/ps-skeleton-class-service");
|
|
14
9
|
const sizeStyle = (props) => {
|
|
15
10
|
const style = {};
|
|
16
11
|
if (props.width !== undefined)
|
|
@@ -30,10 +25,10 @@ const PsSkeleton = ({ shape = ps_skeleton_shape_1.PsSkeletonShape.Line, ...props
|
|
|
30
25
|
const style = sizeStyle(props);
|
|
31
26
|
if (shape === ps_skeleton_shape_1.PsSkeletonShape.Text) {
|
|
32
27
|
const lines = props.lines !== undefined ? props.lines : ps_skeleton_config_1.PsSkeletonConfig.defaultTextLines;
|
|
33
|
-
return ((0, jsx_runtime_1.jsx)("span", { className: ps_design_system_1.PallasoftClassNameService.merge('flex flex-col gap-2.5', props.className), children: Array.from({ length: lines }, (item, index) => ((0, jsx_runtime_1.jsx)("span", { "aria-hidden": 'true', className:
|
|
28
|
+
return ((0, jsx_runtime_1.jsx)("span", { className: ps_design_system_1.PallasoftClassNameService.merge('flex flex-col gap-2.5', props.className), children: Array.from({ length: lines }, (item, index) => ((0, jsx_runtime_1.jsx)("span", { "aria-hidden": 'true', className: ps_skeleton_class_service_1.PsSkeletonClassService.resolve(ps_skeleton_shape_1.PsSkeletonShape.Line, index === lines - 1 && lines > 1
|
|
34
29
|
? ps_skeleton_config_1.PsSkeletonConfig.lastLineWidth
|
|
35
30
|
: ps_skeleton_config_1.PsSkeletonConfig.lineWidths[index % ps_skeleton_config_1.PsSkeletonConfig.lineWidths.length]), style: style }, index))) }));
|
|
36
31
|
}
|
|
37
|
-
return ((0, jsx_runtime_1.jsx)("span", { "aria-hidden": 'true', className:
|
|
32
|
+
return ((0, jsx_runtime_1.jsx)("span", { "aria-hidden": 'true', className: ps_skeleton_class_service_1.PsSkeletonClassService.resolve(shape, props.className), style: style }));
|
|
38
33
|
};
|
|
39
34
|
exports.PsSkeleton = PsSkeleton;
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
+
import type { PsSkeletonSize } from '../models/ps-skeleton-size';
|
|
2
|
+
import { PsSkeletonShape } from './ps-skeleton-shape';
|
|
1
3
|
export declare const PsSkeletonConfig: {
|
|
2
4
|
readonly defaultTextLines: 3;
|
|
3
5
|
readonly lastLineWidth: "w-2/3";
|
|
4
6
|
readonly lineWidths: readonly ["w-3/4", "w-1/2", "w-5/6", "w-2/3"];
|
|
7
|
+
readonly baseClassName: "ps-skeleton";
|
|
8
|
+
readonly classSeparator: RegExp;
|
|
9
|
+
readonly variantSeparator: ":";
|
|
10
|
+
readonly importantPrefix: "!";
|
|
11
|
+
readonly widthUtilityPattern: RegExp;
|
|
12
|
+
readonly heightUtilityPattern: RegExp;
|
|
13
|
+
readonly shapeClassNames: Record<PsSkeletonShape, string>;
|
|
14
|
+
readonly shapeSizes: Record<PsSkeletonShape, PsSkeletonSize>;
|
|
5
15
|
};
|
|
@@ -1,8 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PsSkeletonConfig = void 0;
|
|
4
|
+
const ps_skeleton_shape_1 = require("./ps-skeleton-shape");
|
|
4
5
|
exports.PsSkeletonConfig = {
|
|
5
6
|
defaultTextLines: 3,
|
|
6
7
|
lastLineWidth: 'w-2/3',
|
|
7
8
|
lineWidths: ['w-3/4', 'w-1/2', 'w-5/6', 'w-2/3'],
|
|
9
|
+
baseClassName: 'ps-skeleton',
|
|
10
|
+
classSeparator: /\s+/,
|
|
11
|
+
variantSeparator: ':',
|
|
12
|
+
importantPrefix: '!',
|
|
13
|
+
widthUtilityPattern: /^(w|size)-/,
|
|
14
|
+
heightUtilityPattern: /^(h|size)-/,
|
|
15
|
+
shapeClassNames: {
|
|
16
|
+
[ps_skeleton_shape_1.PsSkeletonShape.Block]: 'rounded-ps-control',
|
|
17
|
+
[ps_skeleton_shape_1.PsSkeletonShape.Circle]: 'shrink-0 rounded-full',
|
|
18
|
+
[ps_skeleton_shape_1.PsSkeletonShape.Line]: 'rounded-full',
|
|
19
|
+
[ps_skeleton_shape_1.PsSkeletonShape.Text]: 'rounded-full',
|
|
20
|
+
},
|
|
21
|
+
shapeSizes: {
|
|
22
|
+
[ps_skeleton_shape_1.PsSkeletonShape.Block]: { height: 'h-11', width: 'w-full' },
|
|
23
|
+
[ps_skeleton_shape_1.PsSkeletonShape.Circle]: { height: 'h-9', width: 'w-9' },
|
|
24
|
+
[ps_skeleton_shape_1.PsSkeletonShape.Line]: { height: 'h-3', width: 'w-full' },
|
|
25
|
+
[ps_skeleton_shape_1.PsSkeletonShape.Text]: { height: 'h-3', width: 'w-full' },
|
|
26
|
+
},
|
|
8
27
|
};
|
|
@@ -74,15 +74,15 @@ exports.PsVoiceOrbCadenceByState = {
|
|
|
74
74
|
};
|
|
75
75
|
exports.PsVoiceOrbThemes = {
|
|
76
76
|
default: {
|
|
77
|
-
glass: 'radial-gradient(circle at 32% 28%, rgb(255 255 255 / 0.
|
|
78
|
-
rim: 'conic-gradient(rgb(var(--ps-color-primary-rgb)), rgb(var(--ps-color-accent-rgb)), rgb(
|
|
79
|
-
ripple: 'rgb(var(--ps-color-primary-rgb) / 0.
|
|
80
|
-
core: 'radial-gradient(circle, rgb(255 255 255
|
|
77
|
+
glass: 'radial-gradient(circle at 32% 28%, rgb(255 255 255 / 0.95), transparent 46%), radial-gradient(circle, rgb(255 255 255 / 0.92), rgb(var(--ps-color-accent-rgb) / 0.5) 58%, rgb(var(--ps-color-primary-rgb) / 0.75) 100%)',
|
|
78
|
+
rim: 'conic-gradient(rgb(var(--ps-color-primary-rgb)), rgb(var(--ps-color-accent-rgb)), rgb(255 255 255), rgb(var(--ps-color-secondary-rgb)), rgb(var(--ps-color-primary-rgb)))',
|
|
79
|
+
ripple: 'rgb(var(--ps-color-primary-rgb) / 0.6)',
|
|
80
|
+
core: 'radial-gradient(circle, rgb(255 255 255), rgb(var(--ps-color-accent-rgb) / 0.75) 35%, transparent 70%)',
|
|
81
81
|
},
|
|
82
82
|
error: {
|
|
83
|
-
glass: 'radial-gradient(circle at 32% 28%, rgb(255 255 255 / 0.
|
|
83
|
+
glass: 'radial-gradient(circle at 32% 28%, rgb(255 255 255 / 0.95), transparent 46%), radial-gradient(circle, rgb(255 255 255 / 0.92), rgb(var(--ps-color-danger-rgb) / 0.45) 58%, rgb(var(--ps-color-danger-rgb) / 0.7) 100%)',
|
|
84
84
|
rim: 'conic-gradient(rgb(var(--ps-color-danger-rgb)), rgb(255 255 255 / 0.85), rgb(var(--ps-color-danger-rgb) / 0.7), rgb(var(--ps-color-danger-rgb)))',
|
|
85
|
-
ripple: 'rgb(var(--ps-color-danger-rgb) / 0.
|
|
86
|
-
core: 'radial-gradient(circle, rgb(255 255 255
|
|
85
|
+
ripple: 'rgb(var(--ps-color-danger-rgb) / 0.6)',
|
|
86
|
+
core: 'radial-gradient(circle, rgb(255 255 255), rgb(var(--ps-color-danger-rgb) / 0.7) 35%, transparent 70%)',
|
|
87
87
|
},
|
|
88
88
|
};
|
|
@@ -7,7 +7,7 @@ const logoLinkClassName = 'flex shrink-0 items-center gap-2.5';
|
|
|
7
7
|
export const PsSiteHeader = ({ centerContent, className, homeHref, label, LinkComponent, logoAlt, logoClassName, logoSrc, logoSrcDark, logoSrcMobile, logoSrcMobileDark, navClassName, onBack, showLabel = false, trailing, }) => {
|
|
8
8
|
const headerRef = usePsPublishedHeight(PsSiteHeaderConfig.heightVariable);
|
|
9
9
|
const logoLabel = `${label} home`;
|
|
10
|
-
const renderLogo = (src, darkSrc, baseClassName) => darkSrc ? (_jsxs(_Fragment, { children: [_jsx("img", { alt: logoAlt !== null && logoAlt !== undefined ? logoAlt : label, className: PallasoftClassNameService.merge(baseClassName, 'dark:hidden', logoClassName), decoding: 'async',
|
|
10
|
+
const renderLogo = (src, darkSrc, baseClassName) => darkSrc ? (_jsxs(_Fragment, { children: [_jsx("img", { alt: logoAlt !== null && logoAlt !== undefined ? logoAlt : label, className: PallasoftClassNameService.merge(baseClassName, 'dark:hidden', logoClassName), decoding: 'async', src: src }), _jsx("img", { alt: logoAlt !== null && logoAlt !== undefined ? logoAlt : label, className: PallasoftClassNameService.merge(baseClassName, 'hidden dark:block', logoClassName), decoding: 'async', src: darkSrc })] })) : (_jsx("img", { alt: logoAlt !== null && logoAlt !== undefined ? logoAlt : label, className: PallasoftClassNameService.merge(baseClassName, logoClassName), decoding: 'async', src: src }));
|
|
11
11
|
const logoContent = logoSrcMobile ? (_jsxs(_Fragment, { children: [_jsx("span", { className: 'hidden sm:contents', children: renderLogo(logoSrc, logoSrcDark, 'h-8 w-auto') }), _jsx("span", { className: 'contents sm:hidden', children: renderLogo(logoSrcMobile, logoSrcMobileDark, 'h-8 w-auto') }), showLabel ? _jsx("span", { className: 'text-base font-bold text-ink', children: label }) : null] })) : (_jsxs(_Fragment, { children: [renderLogo(logoSrc, logoSrcDark, 'h-8 w-auto'), showLabel ? _jsx("span", { className: 'text-base font-bold text-ink', children: label }) : null] }));
|
|
12
12
|
const logoLink = LinkComponent ? (_jsx(LinkComponent, { "aria-label": logoLabel, className: logoLinkClassName, prefetch: 'intent', to: homeHref, children: logoContent })) : (_jsx("a", { "aria-label": logoLabel, className: logoLinkClassName, href: homeHref, children: logoContent }));
|
|
13
13
|
return (_jsx("header", { ref: headerRef, className: PallasoftClassNameService.merge('fixed inset-x-0 top-0 z-header px-6 pt-4', className), children: _jsxs("nav", { className: PallasoftClassNameService.merge('ps-glass mx-auto flex max-w-6xl items-center gap-3 rounded-ps-card px-5 py-3', navClassName), children: [onBack ? (_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: _jsx(PsIcon, { iconKey: PsIconKey.ChevronRight, width: 20, height: 20, className: 'rotate-180' }) })) : null, _jsx("div", { className: onBack ? 'hidden md:flex' : 'contents', children: logoLink }), _jsx("div", { className: 'flex min-w-0 flex-1 items-center justify-center gap-3', children: centerContent }), trailing ? _jsx("div", { className: 'flex shrink-0 items-center gap-2.5', children: trailing }) : null] }) }));
|
|
@@ -2,12 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { PallasoftClassNameService } from '@pallasoft/ps-design-system';
|
|
3
3
|
import { PsSkeletonConfig } from '../constants/ps-skeleton-config';
|
|
4
4
|
import { PsSkeletonShape } from '../constants/ps-skeleton-shape';
|
|
5
|
-
|
|
6
|
-
[PsSkeletonShape.Block]: 'h-11 w-full rounded-ps-control',
|
|
7
|
-
[PsSkeletonShape.Circle]: 'h-9 w-9 shrink-0 rounded-full',
|
|
8
|
-
[PsSkeletonShape.Line]: 'h-3 w-full rounded-full',
|
|
9
|
-
[PsSkeletonShape.Text]: 'h-3 w-full rounded-full',
|
|
10
|
-
};
|
|
5
|
+
import { PsSkeletonClassService } from '../services/ps-skeleton-class-service';
|
|
11
6
|
const sizeStyle = (props) => {
|
|
12
7
|
const style = {};
|
|
13
8
|
if (props.width !== undefined)
|
|
@@ -27,9 +22,9 @@ export const PsSkeleton = ({ shape = PsSkeletonShape.Line, ...props }) => {
|
|
|
27
22
|
const style = sizeStyle(props);
|
|
28
23
|
if (shape === PsSkeletonShape.Text) {
|
|
29
24
|
const lines = props.lines !== undefined ? props.lines : PsSkeletonConfig.defaultTextLines;
|
|
30
|
-
return (_jsx("span", { className: PallasoftClassNameService.merge('flex flex-col gap-2.5', props.className), children: Array.from({ length: lines }, (item, index) => (_jsx("span", { "aria-hidden": 'true', className:
|
|
25
|
+
return (_jsx("span", { className: PallasoftClassNameService.merge('flex flex-col gap-2.5', props.className), children: Array.from({ length: lines }, (item, index) => (_jsx("span", { "aria-hidden": 'true', className: PsSkeletonClassService.resolve(PsSkeletonShape.Line, index === lines - 1 && lines > 1
|
|
31
26
|
? PsSkeletonConfig.lastLineWidth
|
|
32
27
|
: PsSkeletonConfig.lineWidths[index % PsSkeletonConfig.lineWidths.length]), style: style }, index))) }));
|
|
33
28
|
}
|
|
34
|
-
return (_jsx("span", { "aria-hidden": 'true', className:
|
|
29
|
+
return (_jsx("span", { "aria-hidden": 'true', className: PsSkeletonClassService.resolve(shape, props.className), style: style }));
|
|
35
30
|
};
|
|
@@ -1,5 +1,24 @@
|
|
|
1
|
+
import { PsSkeletonShape } from './ps-skeleton-shape';
|
|
1
2
|
export const PsSkeletonConfig = {
|
|
2
3
|
defaultTextLines: 3,
|
|
3
4
|
lastLineWidth: 'w-2/3',
|
|
4
5
|
lineWidths: ['w-3/4', 'w-1/2', 'w-5/6', 'w-2/3'],
|
|
6
|
+
baseClassName: 'ps-skeleton',
|
|
7
|
+
classSeparator: /\s+/,
|
|
8
|
+
variantSeparator: ':',
|
|
9
|
+
importantPrefix: '!',
|
|
10
|
+
widthUtilityPattern: /^(w|size)-/,
|
|
11
|
+
heightUtilityPattern: /^(h|size)-/,
|
|
12
|
+
shapeClassNames: {
|
|
13
|
+
[PsSkeletonShape.Block]: 'rounded-ps-control',
|
|
14
|
+
[PsSkeletonShape.Circle]: 'shrink-0 rounded-full',
|
|
15
|
+
[PsSkeletonShape.Line]: 'rounded-full',
|
|
16
|
+
[PsSkeletonShape.Text]: 'rounded-full',
|
|
17
|
+
},
|
|
18
|
+
shapeSizes: {
|
|
19
|
+
[PsSkeletonShape.Block]: { height: 'h-11', width: 'w-full' },
|
|
20
|
+
[PsSkeletonShape.Circle]: { height: 'h-9', width: 'w-9' },
|
|
21
|
+
[PsSkeletonShape.Line]: { height: 'h-3', width: 'w-full' },
|
|
22
|
+
[PsSkeletonShape.Text]: { height: 'h-3', width: 'w-full' },
|
|
23
|
+
},
|
|
5
24
|
};
|
|
@@ -71,15 +71,15 @@ export const PsVoiceOrbCadenceByState = {
|
|
|
71
71
|
};
|
|
72
72
|
export const PsVoiceOrbThemes = {
|
|
73
73
|
default: {
|
|
74
|
-
glass: 'radial-gradient(circle at 32% 28%, rgb(255 255 255 / 0.
|
|
75
|
-
rim: 'conic-gradient(rgb(var(--ps-color-primary-rgb)), rgb(var(--ps-color-accent-rgb)), rgb(
|
|
76
|
-
ripple: 'rgb(var(--ps-color-primary-rgb) / 0.
|
|
77
|
-
core: 'radial-gradient(circle, rgb(255 255 255
|
|
74
|
+
glass: 'radial-gradient(circle at 32% 28%, rgb(255 255 255 / 0.95), transparent 46%), radial-gradient(circle, rgb(255 255 255 / 0.92), rgb(var(--ps-color-accent-rgb) / 0.5) 58%, rgb(var(--ps-color-primary-rgb) / 0.75) 100%)',
|
|
75
|
+
rim: 'conic-gradient(rgb(var(--ps-color-primary-rgb)), rgb(var(--ps-color-accent-rgb)), rgb(255 255 255), rgb(var(--ps-color-secondary-rgb)), rgb(var(--ps-color-primary-rgb)))',
|
|
76
|
+
ripple: 'rgb(var(--ps-color-primary-rgb) / 0.6)',
|
|
77
|
+
core: 'radial-gradient(circle, rgb(255 255 255), rgb(var(--ps-color-accent-rgb) / 0.75) 35%, transparent 70%)',
|
|
78
78
|
},
|
|
79
79
|
error: {
|
|
80
|
-
glass: 'radial-gradient(circle at 32% 28%, rgb(255 255 255 / 0.
|
|
80
|
+
glass: 'radial-gradient(circle at 32% 28%, rgb(255 255 255 / 0.95), transparent 46%), radial-gradient(circle, rgb(255 255 255 / 0.92), rgb(var(--ps-color-danger-rgb) / 0.45) 58%, rgb(var(--ps-color-danger-rgb) / 0.7) 100%)',
|
|
81
81
|
rim: 'conic-gradient(rgb(var(--ps-color-danger-rgb)), rgb(255 255 255 / 0.85), rgb(var(--ps-color-danger-rgb) / 0.7), rgb(var(--ps-color-danger-rgb)))',
|
|
82
|
-
ripple: 'rgb(var(--ps-color-danger-rgb) / 0.
|
|
83
|
-
core: 'radial-gradient(circle, rgb(255 255 255
|
|
82
|
+
ripple: 'rgb(var(--ps-color-danger-rgb) / 0.6)',
|
|
83
|
+
core: 'radial-gradient(circle, rgb(255 255 255), rgb(var(--ps-color-danger-rgb) / 0.7) 35%, transparent 70%)',
|
|
84
84
|
},
|
|
85
85
|
};
|
package/dist/esm/index.js
CHANGED
|
@@ -24,6 +24,8 @@ export * from './hooks/use-ps-published-height';
|
|
|
24
24
|
export * from './constants/ps-scaled-preview-config';
|
|
25
25
|
export * from './constants/ps-site-header-config';
|
|
26
26
|
export * from './components/ps-skeleton';
|
|
27
|
+
export * from './services/ps-skeleton-class-service';
|
|
28
|
+
export * from './models/ps-skeleton-size';
|
|
27
29
|
export * from './constants/ps-skeleton-shape';
|
|
28
30
|
export * from './components/ps-skeleton-card';
|
|
29
31
|
export * from './components/ps-skeleton-group';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { PallasoftClassNameService } from '@pallasoft/ps-design-system';
|
|
2
|
+
import { PsSkeletonConfig } from '../constants/ps-skeleton-config';
|
|
3
|
+
export class PsSkeletonClassService {
|
|
4
|
+
static resolve(shape, className) {
|
|
5
|
+
const utilities = className
|
|
6
|
+
? className
|
|
7
|
+
.split(PsSkeletonConfig.classSeparator)
|
|
8
|
+
.filter((token) => !token.includes(PsSkeletonConfig.variantSeparator))
|
|
9
|
+
.map((token) => PsSkeletonClassService.withoutImportant(token))
|
|
10
|
+
: [];
|
|
11
|
+
const hasWidth = utilities.some((utility) => PsSkeletonConfig.widthUtilityPattern.test(utility));
|
|
12
|
+
const hasHeight = utilities.some((utility) => PsSkeletonConfig.heightUtilityPattern.test(utility));
|
|
13
|
+
const size = PsSkeletonConfig.shapeSizes[shape];
|
|
14
|
+
return PallasoftClassNameService.merge(PsSkeletonConfig.baseClassName, PsSkeletonConfig.shapeClassNames[shape], hasHeight ? null : size.height, hasWidth ? null : size.width, className);
|
|
15
|
+
}
|
|
16
|
+
static withoutImportant(token) {
|
|
17
|
+
return token.startsWith(PsSkeletonConfig.importantPrefix) ? token.slice(1) : token;
|
|
18
|
+
}
|
|
19
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -24,6 +24,8 @@ export * from './hooks/use-ps-published-height';
|
|
|
24
24
|
export * from './constants/ps-scaled-preview-config';
|
|
25
25
|
export * from './constants/ps-site-header-config';
|
|
26
26
|
export * from './components/ps-skeleton';
|
|
27
|
+
export * from './services/ps-skeleton-class-service';
|
|
28
|
+
export * from './models/ps-skeleton-size';
|
|
27
29
|
export * from './constants/ps-skeleton-shape';
|
|
28
30
|
export * from './components/ps-skeleton-card';
|
|
29
31
|
export * from './components/ps-skeleton-group';
|
package/dist/index.js
CHANGED
|
@@ -40,6 +40,8 @@ __exportStar(require("./hooks/use-ps-published-height"), exports);
|
|
|
40
40
|
__exportStar(require("./constants/ps-scaled-preview-config"), exports);
|
|
41
41
|
__exportStar(require("./constants/ps-site-header-config"), exports);
|
|
42
42
|
__exportStar(require("./components/ps-skeleton"), exports);
|
|
43
|
+
__exportStar(require("./services/ps-skeleton-class-service"), exports);
|
|
44
|
+
__exportStar(require("./models/ps-skeleton-size"), exports);
|
|
43
45
|
__exportStar(require("./constants/ps-skeleton-shape"), exports);
|
|
44
46
|
__exportStar(require("./components/ps-skeleton-card"), exports);
|
|
45
47
|
__exportStar(require("./components/ps-skeleton-group"), exports);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PsSkeletonClassService = void 0;
|
|
4
|
+
const ps_design_system_1 = require("@pallasoft/ps-design-system");
|
|
5
|
+
const ps_skeleton_config_1 = require("../constants/ps-skeleton-config");
|
|
6
|
+
class PsSkeletonClassService {
|
|
7
|
+
static resolve(shape, className) {
|
|
8
|
+
const utilities = className
|
|
9
|
+
? className
|
|
10
|
+
.split(ps_skeleton_config_1.PsSkeletonConfig.classSeparator)
|
|
11
|
+
.filter((token) => !token.includes(ps_skeleton_config_1.PsSkeletonConfig.variantSeparator))
|
|
12
|
+
.map((token) => PsSkeletonClassService.withoutImportant(token))
|
|
13
|
+
: [];
|
|
14
|
+
const hasWidth = utilities.some((utility) => ps_skeleton_config_1.PsSkeletonConfig.widthUtilityPattern.test(utility));
|
|
15
|
+
const hasHeight = utilities.some((utility) => ps_skeleton_config_1.PsSkeletonConfig.heightUtilityPattern.test(utility));
|
|
16
|
+
const size = ps_skeleton_config_1.PsSkeletonConfig.shapeSizes[shape];
|
|
17
|
+
return ps_design_system_1.PallasoftClassNameService.merge(ps_skeleton_config_1.PsSkeletonConfig.baseClassName, ps_skeleton_config_1.PsSkeletonConfig.shapeClassNames[shape], hasHeight ? null : size.height, hasWidth ? null : size.width, className);
|
|
18
|
+
}
|
|
19
|
+
static withoutImportant(token) {
|
|
20
|
+
return token.startsWith(ps_skeleton_config_1.PsSkeletonConfig.importantPrefix) ? token.slice(1) : token;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.PsSkeletonClassService = PsSkeletonClassService;
|