@pallasoft/ps-core-components 2.3.1 → 2.4.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-draggable-grid.d.ts +9 -12
- package/dist/components/ps-draggable-grid.js +72 -45
- package/dist/components/ps-navigation-progress.d.ts +3 -2
- package/dist/components/ps-navigation-progress.js +13 -22
- package/dist/components/ps-section-header.js +1 -1
- package/dist/constants/ps-draggable-grid.d.ts +17 -0
- package/dist/constants/ps-draggable-grid.js +26 -0
- package/dist/constants/ps-navigation-progress-config.d.ts +5 -0
- package/dist/constants/ps-navigation-progress-config.js +5 -0
- package/dist/esm/components/ps-accordion.js +5 -0
- package/dist/esm/components/ps-action-tile.js +7 -0
- package/dist/esm/components/ps-audio-spectrum.js +9 -0
- package/dist/esm/components/ps-badge.js +10 -0
- package/dist/esm/components/ps-button.js +16 -0
- package/dist/esm/components/ps-card.js +14 -0
- package/dist/esm/components/ps-draggable-grid.js +80 -0
- package/dist/esm/components/ps-empty-state.js +28 -0
- package/dist/esm/components/ps-fab.js +9 -0
- package/dist/esm/components/ps-infinite-scroll.js +5 -0
- package/dist/esm/components/ps-layer.js +3 -0
- package/dist/esm/components/ps-list-tile.js +11 -0
- package/dist/esm/components/ps-metric-card.js +3 -0
- package/dist/esm/components/ps-navigation-progress.js +21 -0
- package/dist/esm/components/ps-pill.js +10 -0
- package/dist/esm/components/ps-portable-text.js +34 -0
- package/dist/esm/components/ps-reflective-app-shell.js +13 -0
- package/dist/esm/components/ps-section-header.js +2 -0
- package/dist/esm/components/ps-site-header.js +11 -0
- package/dist/esm/components/ps-skeleton.js +3 -0
- package/dist/esm/components/ps-spinner.js +12 -0
- package/dist/esm/components/ps-theme-toggle.js +7 -0
- package/dist/esm/components/ps-voice-orb.js +100 -0
- package/dist/esm/constants/ps-draggable-grid.js +23 -0
- package/dist/esm/constants/ps-navigation-progress-config.js +12 -0
- package/dist/esm/constants/ps-voice-orb.js +85 -0
- package/dist/esm/contexts/ps-layer-context.js +2 -0
- package/dist/esm/hooks/use-ps-audio-spectrum.js +65 -0
- package/dist/esm/hooks/use-ps-exit-transition.js +29 -0
- package/dist/esm/hooks/use-ps-hide-on-scroll.js +25 -0
- package/dist/esm/hooks/use-ps-invisible-recaptcha.js +90 -0
- package/dist/esm/hooks/use-ps-layer-z-index.js +4 -0
- package/dist/esm/hooks/use-ps-navigation-progress.js +41 -0
- package/dist/esm/hooks/use-ps-route-loader-data.js +12 -0
- package/dist/esm/hooks/use-ps-viewport.js +18 -0
- package/dist/esm/index.js +38 -0
- package/dist/esm/interfaces/ps-component-props.js +1 -0
- package/dist/esm/models/ps-draggable-grid.js +1 -0
- package/dist/esm/models/ps-navigation-progress.js +1 -0
- package/dist/esm/models/ps-recaptcha-pending-request.js +1 -0
- package/dist/esm/models/ps-remix-react-module.js +1 -0
- package/dist/esm/models/ps-voice-orb.js +1 -0
- package/dist/hooks/use-ps-exit-transition.js +0 -1
- package/dist/hooks/use-ps-navigation-progress.d.ts +2 -0
- package/dist/hooks/use-ps-navigation-progress.js +45 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/models/ps-draggable-grid.d.ts +19 -0
- package/dist/models/ps-draggable-grid.js +2 -0
- package/dist/models/ps-navigation-progress.d.ts +5 -0
- package/dist/models/ps-navigation-progress.js +2 -0
- package/dist/models/ps-recaptcha-pending-request.d.ts +4 -0
- package/dist/models/ps-recaptcha-pending-request.js +2 -0
- package/dist/models/ps-remix-react-module.d.ts +3 -0
- package/dist/models/ps-remix-react-module.js +2 -0
- package/package.json +11 -3
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export * from './components/ps-layer';
|
|
2
|
+
export * from './components/ps-accordion';
|
|
3
|
+
export * from './components/ps-action-tile';
|
|
4
|
+
export * from './components/ps-audio-spectrum';
|
|
5
|
+
export * from './components/ps-badge';
|
|
6
|
+
export * from './components/ps-button';
|
|
7
|
+
export * from './components/ps-card';
|
|
8
|
+
export * from './components/ps-draggable-grid';
|
|
9
|
+
export * from './components/ps-empty-state';
|
|
10
|
+
export * from './components/ps-fab';
|
|
11
|
+
export * from './components/ps-infinite-scroll';
|
|
12
|
+
export * from './components/ps-list-tile';
|
|
13
|
+
export * from './components/ps-metric-card';
|
|
14
|
+
export * from './components/ps-pill';
|
|
15
|
+
export * from './components/ps-portable-text';
|
|
16
|
+
export * from './components/ps-reflective-app-shell';
|
|
17
|
+
export * from './components/ps-navigation-progress';
|
|
18
|
+
export * from './components/ps-section-header';
|
|
19
|
+
export * from './components/ps-site-header';
|
|
20
|
+
export * from './components/ps-skeleton';
|
|
21
|
+
export * from './components/ps-spinner';
|
|
22
|
+
export * from './components/ps-theme-toggle';
|
|
23
|
+
export * from './components/ps-voice-orb';
|
|
24
|
+
export * from './hooks/use-ps-audio-spectrum';
|
|
25
|
+
export * from './hooks/use-ps-exit-transition';
|
|
26
|
+
export * from './hooks/use-ps-hide-on-scroll';
|
|
27
|
+
export * from './hooks/use-ps-invisible-recaptcha';
|
|
28
|
+
export * from './contexts/ps-layer-context';
|
|
29
|
+
export * from './hooks/use-ps-layer-z-index';
|
|
30
|
+
export * from './hooks/use-ps-route-loader-data';
|
|
31
|
+
export * from './hooks/use-ps-viewport';
|
|
32
|
+
export * from './interfaces/ps-component-props';
|
|
33
|
+
export * from './models/ps-voice-orb';
|
|
34
|
+
export * from './models/ps-navigation-progress';
|
|
35
|
+
export * from './hooks/use-ps-navigation-progress';
|
|
36
|
+
export * from './models/ps-draggable-grid';
|
|
37
|
+
export * from './constants/ps-draggable-grid';
|
|
38
|
+
export * from './constants/ps-navigation-progress-config';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -26,7 +26,6 @@ const usePsExitTransition = (isOpen, durationMs = 180) => {
|
|
|
26
26
|
if (timeoutRef.current)
|
|
27
27
|
clearTimeout(timeoutRef.current);
|
|
28
28
|
};
|
|
29
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
30
29
|
}, [isOpen, durationMs]);
|
|
31
30
|
hasRenderedRef.current = shouldRender;
|
|
32
31
|
return { isClosing, shouldRender };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.usePsNavigationProgress = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const ps_navigation_progress_config_1 = require("../constants/ps-navigation-progress-config");
|
|
6
|
+
const hidden = { isAnimated: false, isVisible: false, width: 0 };
|
|
7
|
+
const usePsNavigationProgress = (isLoading) => {
|
|
8
|
+
const [state, setState] = (0, react_1.useState)(hidden);
|
|
9
|
+
const timers = (0, react_1.useRef)([]);
|
|
10
|
+
(0, react_1.useEffect)(() => {
|
|
11
|
+
if (typeof window === 'undefined')
|
|
12
|
+
return;
|
|
13
|
+
const clear = () => {
|
|
14
|
+
timers.current.forEach((timer) => window.clearTimeout(timer));
|
|
15
|
+
timers.current.forEach((timer) => window.clearInterval(timer));
|
|
16
|
+
timers.current = [];
|
|
17
|
+
};
|
|
18
|
+
clear();
|
|
19
|
+
if (isLoading) {
|
|
20
|
+
setState({ isAnimated: false, isVisible: true, width: 0 });
|
|
21
|
+
timers.current.push(window.setTimeout(() => setState({
|
|
22
|
+
isAnimated: true,
|
|
23
|
+
isVisible: true,
|
|
24
|
+
width: ps_navigation_progress_config_1.PsNavigationProgressConfig.startWidth,
|
|
25
|
+
}), 0), window.setInterval(() => setState((current) => ({
|
|
26
|
+
...current,
|
|
27
|
+
width: current.width +
|
|
28
|
+
(ps_navigation_progress_config_1.PsNavigationProgressConfig.trickleMax - current.width) *
|
|
29
|
+
ps_navigation_progress_config_1.PsNavigationProgressConfig.trickleFactor,
|
|
30
|
+
})), ps_navigation_progress_config_1.PsNavigationProgressConfig.trickleMs));
|
|
31
|
+
return clear;
|
|
32
|
+
}
|
|
33
|
+
setState((current) => current.isVisible
|
|
34
|
+
? {
|
|
35
|
+
isAnimated: true,
|
|
36
|
+
isVisible: true,
|
|
37
|
+
width: ps_navigation_progress_config_1.PsNavigationProgressConfig.completeWidth,
|
|
38
|
+
}
|
|
39
|
+
: current);
|
|
40
|
+
timers.current.push(window.setTimeout(() => setState((current) => ({ ...current, isVisible: false })), ps_navigation_progress_config_1.PsNavigationProgressConfig.transitionMs), window.setTimeout(() => setState(hidden), ps_navigation_progress_config_1.PsNavigationProgressConfig.transitionMs + ps_navigation_progress_config_1.PsNavigationProgressConfig.fadeMs));
|
|
41
|
+
return clear;
|
|
42
|
+
}, [isLoading]);
|
|
43
|
+
return state;
|
|
44
|
+
};
|
|
45
|
+
exports.usePsNavigationProgress = usePsNavigationProgress;
|
package/dist/index.d.ts
CHANGED
|
@@ -31,4 +31,8 @@ export * from './hooks/use-ps-route-loader-data';
|
|
|
31
31
|
export * from './hooks/use-ps-viewport';
|
|
32
32
|
export * from './interfaces/ps-component-props';
|
|
33
33
|
export * from './models/ps-voice-orb';
|
|
34
|
+
export * from './models/ps-navigation-progress';
|
|
35
|
+
export * from './hooks/use-ps-navigation-progress';
|
|
36
|
+
export * from './models/ps-draggable-grid';
|
|
37
|
+
export * from './constants/ps-draggable-grid';
|
|
34
38
|
export * from './constants/ps-navigation-progress-config';
|
package/dist/index.js
CHANGED
|
@@ -47,4 +47,8 @@ __exportStar(require("./hooks/use-ps-route-loader-data"), exports);
|
|
|
47
47
|
__exportStar(require("./hooks/use-ps-viewport"), exports);
|
|
48
48
|
__exportStar(require("./interfaces/ps-component-props"), exports);
|
|
49
49
|
__exportStar(require("./models/ps-voice-orb"), exports);
|
|
50
|
+
__exportStar(require("./models/ps-navigation-progress"), exports);
|
|
51
|
+
__exportStar(require("./hooks/use-ps-navigation-progress"), exports);
|
|
52
|
+
__exportStar(require("./models/ps-draggable-grid"), exports);
|
|
53
|
+
__exportStar(require("./constants/ps-draggable-grid"), exports);
|
|
50
54
|
__exportStar(require("./constants/ps-navigation-progress-config"), exports);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { JSX } from 'react';
|
|
2
|
+
export interface PsDraggableGridItem {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
}
|
|
6
|
+
export interface PsDraggableGridRenderOptions<TItem extends PsDraggableGridItem> {
|
|
7
|
+
handle: JSX.Element;
|
|
8
|
+
index: number;
|
|
9
|
+
isDragging: boolean;
|
|
10
|
+
isOverlay: boolean;
|
|
11
|
+
item: TItem;
|
|
12
|
+
}
|
|
13
|
+
export interface PsDraggableGridProps<TItem extends PsDraggableGridItem> {
|
|
14
|
+
getItemClassName?: (item: TItem) => string;
|
|
15
|
+
items: TItem[];
|
|
16
|
+
onReorder: (items: TItem[]) => void;
|
|
17
|
+
onReorderEnd?: (items: TItem[]) => void;
|
|
18
|
+
renderItem: (options: PsDraggableGridRenderOptions<TItem>) => JSX.Element | null;
|
|
19
|
+
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pallasoft/ps-core-components",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
|
+
"module": "./dist/esm/index.js",
|
|
6
7
|
"types": "./dist/index.d.ts",
|
|
8
|
+
"sideEffects": false,
|
|
7
9
|
"exports": {
|
|
8
10
|
".": {
|
|
9
11
|
"types": "./dist/index.d.ts",
|
|
12
|
+
"module": "./dist/esm/index.js",
|
|
10
13
|
"require": "./dist/index.js",
|
|
11
14
|
"default": "./dist/index.js"
|
|
12
15
|
}
|
|
@@ -16,7 +19,7 @@
|
|
|
16
19
|
],
|
|
17
20
|
"scripts": {
|
|
18
21
|
"husky:prepare": "npx husky",
|
|
19
|
-
"build": "tsc",
|
|
22
|
+
"build": "tsc && tsc -p tsconfig.esm.json",
|
|
20
23
|
"setup:graphify": "sh scripts/graphify-setup.sh",
|
|
21
24
|
"update:graphify": "sh scripts/graphify-update.sh",
|
|
22
25
|
"lint": "npm run lint:eslint",
|
|
@@ -28,6 +31,9 @@
|
|
|
28
31
|
"release": "semantic-release"
|
|
29
32
|
},
|
|
30
33
|
"dependencies": {
|
|
34
|
+
"@dnd-kit/core": "^6.3.1",
|
|
35
|
+
"@dnd-kit/sortable": "^10.0.0",
|
|
36
|
+
"@dnd-kit/utilities": "^3.2.2",
|
|
31
37
|
"@pallasoft/ps-design-system": "^1.3.0",
|
|
32
38
|
"@pallasoft/ps-icons": "^1.1.0",
|
|
33
39
|
"@portabletext/react": "^3.2.4",
|
|
@@ -36,7 +42,8 @@
|
|
|
36
42
|
"react-infinite-scroll-component": "^6.1.1"
|
|
37
43
|
},
|
|
38
44
|
"peerDependencies": {
|
|
39
|
-
"react": "^18 || ^19"
|
|
45
|
+
"react": "^18 || ^19",
|
|
46
|
+
"react-dom": "^18 || ^19"
|
|
40
47
|
},
|
|
41
48
|
"devDependencies": {
|
|
42
49
|
"@commitlint/cli": "^20.1.0",
|
|
@@ -50,6 +57,7 @@
|
|
|
50
57
|
"@semantic-release/npm": "^12.0.0",
|
|
51
58
|
"@semantic-release/release-notes-generator": "^14.0.1",
|
|
52
59
|
"@types/react": "^18.3.28",
|
|
60
|
+
"@types/react-dom": "^18.3.7",
|
|
53
61
|
"@typescript-eslint/eslint-plugin": "^8.48.0",
|
|
54
62
|
"@typescript-eslint/parser": "^8.48.0",
|
|
55
63
|
"commitlint": "^20.1.0",
|