@pyreon/kinetic 0.0.2 → 0.1.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/lib/index.js +49 -1
- package/package.json +10 -5
package/lib/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Show, createRef, h, onMount, onUnmount } from "@pyreon/core";
|
|
2
2
|
import { runUntracked, signal, watch } from "@pyreon/reactivity";
|
|
3
|
-
import { jsx } from "@pyreon/core/jsx-runtime";
|
|
4
3
|
|
|
5
4
|
//#region src/useAnimationEnd.ts
|
|
6
5
|
const DEFAULT_TIMEOUT = 5e3;
|
|
@@ -60,6 +59,55 @@ function useReducedMotion() {
|
|
|
60
59
|
return matches;
|
|
61
60
|
}
|
|
62
61
|
|
|
62
|
+
//#endregion
|
|
63
|
+
//#region ../../node_modules/.bun/@pyreon+core@0.5.4/node_modules/@pyreon/core/lib/jsx-runtime.js
|
|
64
|
+
/**
|
|
65
|
+
* Hyperscript function — the compiled output of JSX.
|
|
66
|
+
* `<div class="x">hello</div>` → `h("div", { class: "x" }, "hello")`
|
|
67
|
+
*
|
|
68
|
+
* Generic on P so TypeScript validates props match the component's signature
|
|
69
|
+
* at the call site, then stores the result in the loosely-typed VNode.
|
|
70
|
+
*/
|
|
71
|
+
/** Shared empty props sentinel — identity-checked in mountElement to skip applyProps. */
|
|
72
|
+
const EMPTY_PROPS = {};
|
|
73
|
+
function h$1(type, props, ...children) {
|
|
74
|
+
return {
|
|
75
|
+
type,
|
|
76
|
+
props: props ?? EMPTY_PROPS,
|
|
77
|
+
children: normalizeChildren(children),
|
|
78
|
+
key: props?.key ?? null
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
function normalizeChildren(children) {
|
|
82
|
+
for (let i = 0; i < children.length; i++) if (Array.isArray(children[i])) return flattenChildren(children);
|
|
83
|
+
return children;
|
|
84
|
+
}
|
|
85
|
+
function flattenChildren(children) {
|
|
86
|
+
const result = [];
|
|
87
|
+
for (const child of children) if (Array.isArray(child)) result.push(...flattenChildren(child));
|
|
88
|
+
else result.push(child);
|
|
89
|
+
return result;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* JSX automatic runtime.
|
|
93
|
+
*
|
|
94
|
+
* When tsconfig has `"jsxImportSource": "@pyreon/core"`, the TS/bundler compiler
|
|
95
|
+
* rewrites JSX to imports from this file automatically:
|
|
96
|
+
* <div class="x" /> → jsx("div", { class: "x" })
|
|
97
|
+
*/
|
|
98
|
+
function jsx(type, props, key) {
|
|
99
|
+
const { children, ...rest } = props;
|
|
100
|
+
const propsWithKey = key != null ? {
|
|
101
|
+
...rest,
|
|
102
|
+
key
|
|
103
|
+
} : rest;
|
|
104
|
+
if (typeof type === "function") return h$1(type, children !== void 0 ? {
|
|
105
|
+
...propsWithKey,
|
|
106
|
+
children
|
|
107
|
+
} : propsWithKey);
|
|
108
|
+
return h$1(type, propsWithKey, ...children === void 0 ? [] : Array.isArray(children) ? children : [children]);
|
|
109
|
+
}
|
|
110
|
+
|
|
63
111
|
//#endregion
|
|
64
112
|
//#region src/kinetic/CollapseRenderer.tsx
|
|
65
113
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pyreon/kinetic",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "https://github.com/pyreon/ui-system",
|
|
7
|
+
"directory": "packages/kinetic"
|
|
8
|
+
},
|
|
4
9
|
"description": "CSS-transition-based animation components for Pyreon",
|
|
5
10
|
"license": "MIT",
|
|
6
11
|
"type": "module",
|
|
@@ -36,11 +41,11 @@
|
|
|
36
41
|
"typecheck": "tsc --noEmit"
|
|
37
42
|
},
|
|
38
43
|
"peerDependencies": {
|
|
39
|
-
"@pyreon/core": ">=0.
|
|
40
|
-
"@pyreon/reactivity": ">=0.
|
|
44
|
+
"@pyreon/core": ">=0.4.0 <1.0.0",
|
|
45
|
+
"@pyreon/reactivity": ">=0.4.0 <1.0.0"
|
|
41
46
|
},
|
|
42
47
|
"devDependencies": {
|
|
43
|
-
"@vitus-labs/tools-rolldown": "^1.15.
|
|
44
|
-
"@vitus-labs/tools-typescript": "^1.15.
|
|
48
|
+
"@vitus-labs/tools-rolldown": "^1.15.3",
|
|
49
|
+
"@vitus-labs/tools-typescript": "^1.15.3"
|
|
45
50
|
}
|
|
46
51
|
}
|