@pyreon/elements 0.0.2 → 0.1.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/lib/index.d.ts CHANGED
@@ -261,7 +261,7 @@ declare const Component$3: ({
261
261
  setUnblocked
262
262
  }: OverlayContext & {
263
263
  children: VNodeChild;
264
- }) => any;
264
+ }) => _pyreon_core0.VNode;
265
265
  //#endregion
266
266
  //#region src/Overlay/useOverlay.d.ts
267
267
  /**
@@ -332,7 +332,7 @@ declare const useOverlay: ({
332
332
  setUnblocked
333
333
  }: OverlayContext & {
334
334
  children: _pyreon_core0.VNodeChild;
335
- }) => any;
335
+ }) => _pyreon_core0.VNode;
336
336
  };
337
337
  //#endregion
338
338
  //#region src/Overlay/component.d.ts
package/lib/index.js CHANGED
@@ -1,7 +1,6 @@
1
1
  import { Provider, alignContent, extendCss, makeItResponsive, value } from "@pyreon/unistyle";
2
2
  import { Fragment, Portal, createContext, onMount, onUnmount, popContext, pushContext, useContext } from "@pyreon/core";
3
3
  import { config, isEmpty, omit, pick, render, throttle } from "@pyreon/ui-core";
4
- import { Fragment as Fragment$1, jsx, jsxs } from "@pyreon/core/jsx-runtime";
5
4
  import { signal } from "@pyreon/reactivity";
6
5
 
7
6
  //#region src/constants.ts
@@ -83,6 +82,58 @@ const StyledComponent = styled$2(component$1)`
83
82
  })};
84
83
  `;
85
84
 
85
+ //#endregion
86
+ //#region ../../node_modules/.bun/@pyreon+core@0.5.4/node_modules/@pyreon/core/lib/jsx-runtime.js
87
+ /** Marker for fragment nodes — renders children without a wrapper element */
88
+ const Fragment$1 = Symbol("Pyreon.Fragment");
89
+ /**
90
+ * Hyperscript function — the compiled output of JSX.
91
+ * `<div class="x">hello</div>` → `h("div", { class: "x" }, "hello")`
92
+ *
93
+ * Generic on P so TypeScript validates props match the component's signature
94
+ * at the call site, then stores the result in the loosely-typed VNode.
95
+ */
96
+ /** Shared empty props sentinel — identity-checked in mountElement to skip applyProps. */
97
+ const EMPTY_PROPS = {};
98
+ function h(type, props, ...children) {
99
+ return {
100
+ type,
101
+ props: props ?? EMPTY_PROPS,
102
+ children: normalizeChildren(children),
103
+ key: props?.key ?? null
104
+ };
105
+ }
106
+ function normalizeChildren(children) {
107
+ for (let i = 0; i < children.length; i++) if (Array.isArray(children[i])) return flattenChildren(children);
108
+ return children;
109
+ }
110
+ function flattenChildren(children) {
111
+ const result = [];
112
+ for (const child of children) if (Array.isArray(child)) result.push(...flattenChildren(child));
113
+ else result.push(child);
114
+ return result;
115
+ }
116
+ /**
117
+ * JSX automatic runtime.
118
+ *
119
+ * When tsconfig has `"jsxImportSource": "@pyreon/core"`, the TS/bundler compiler
120
+ * rewrites JSX to imports from this file automatically:
121
+ * <div class="x" /> → jsx("div", { class: "x" })
122
+ */
123
+ function jsx(type, props, key) {
124
+ const { children, ...rest } = props;
125
+ const propsWithKey = key != null ? {
126
+ ...rest,
127
+ key
128
+ } : rest;
129
+ if (typeof type === "function") return h(type, children !== void 0 ? {
130
+ ...propsWithKey,
131
+ children
132
+ } : propsWithKey);
133
+ return h(type, propsWithKey, ...children === void 0 ? [] : Array.isArray(children) ? children : [children]);
134
+ }
135
+ const jsxs = jsx;
136
+
86
137
  //#endregion
87
138
  //#region src/helpers/Content/component.tsx
88
139
  /**
package/package.json CHANGED
@@ -1,6 +1,11 @@
1
1
  {
2
2
  "name": "@pyreon/elements",
3
- "version": "0.0.2",
3
+ "version": "0.1.1",
4
+ "repository": {
5
+ "type": "git",
6
+ "url": "https://github.com/pyreon/ui-system",
7
+ "directory": "packages/elements"
8
+ },
4
9
  "description": "Foundational UI components for Pyreon",
5
10
  "license": "MIT",
6
11
  "type": "module",
@@ -36,13 +41,13 @@
36
41
  "typecheck": "tsc --noEmit"
37
42
  },
38
43
  "peerDependencies": {
39
- "@pyreon/core": ">=0.3.0",
40
- "@pyreon/reactivity": ">=0.3.0",
41
- "@pyreon/ui-core": "^0.0.2",
42
- "@pyreon/unistyle": "^0.0.2"
44
+ "@pyreon/core": ">=0.4.0 <1.0.0",
45
+ "@pyreon/reactivity": ">=0.4.0 <1.0.0",
46
+ "@pyreon/ui-core": ">=0.1.1",
47
+ "@pyreon/unistyle": ">=0.1.1"
43
48
  },
44
49
  "devDependencies": {
45
- "@vitus-labs/tools-rolldown": "^1.15.0",
46
- "@vitus-labs/tools-typescript": "^1.15.0"
50
+ "@vitus-labs/tools-rolldown": "^1.15.3",
51
+ "@vitus-labs/tools-typescript": "^1.15.3"
47
52
  }
48
53
  }