elements-kit 0.22.0 → 0.23.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.
Files changed (56) hide show
  1. package/LICENSE +201 -21
  2. package/README.md +30 -13
  3. package/dist/await.d.mts +1 -1
  4. package/dist/await.mjs +4 -6
  5. package/dist/children-BbHF-Dew.d.mts +253 -0
  6. package/dist/{element-Di0PYFX1.mjs → element-w3nDE2S5.mjs} +2 -2
  7. package/dist/environment-Fg46vL6e.d.mts +19 -0
  8. package/dist/for.d.mts +1 -1
  9. package/dist/for.mjs +1 -1
  10. package/dist/{fragment-Bvs1sGu1.mjs → fragment-DEhI5x0f.mjs} +2 -3
  11. package/dist/hydrate/index.mjs +1 -1
  12. package/dist/{hydrate-CHomBRY9.mjs → hydrate-CrVzu88K.mjs} +5 -5
  13. package/dist/index-BR8XVkck.d.mts +392 -0
  14. package/dist/integrations/astro-client.mjs +2 -2
  15. package/dist/integrations/astro-server.mjs +3 -4
  16. package/dist/integrations/astro-slots.mjs +2 -2
  17. package/dist/integrations/react.d.mts +1 -1
  18. package/dist/jsx-runtime/index.d.mts +3 -2
  19. package/dist/jsx-runtime/index.mjs +2 -2
  20. package/dist/server/index.mjs +1 -1
  21. package/dist/{server-CTkyXTV6.mjs → server-D7ffi7b_.mjs} +4 -4
  22. package/dist/signals/index.d.mts +2 -2
  23. package/dist/signals/index.mjs +30 -20
  24. package/dist/ui/otp-input/index.d.mts +5 -4
  25. package/dist/ui/otp-input/index.mjs +5 -5
  26. package/dist/utilities/active-element.d.mts +1 -1
  27. package/dist/utilities/async.d.mts +2 -2
  28. package/dist/utilities/async.mjs +13 -5
  29. package/dist/utilities/debounced.d.mts +1 -1
  30. package/dist/utilities/element-rect.d.mts +1 -1
  31. package/dist/utilities/element-scroll.d.mts +1 -1
  32. package/dist/utilities/environment.d.mts +2 -7
  33. package/dist/utilities/environment.mjs +13 -1
  34. package/dist/utilities/event-driven.d.mts +1 -1
  35. package/dist/utilities/event-listener.d.mts +1 -1
  36. package/dist/utilities/focus-within.d.mts +1 -1
  37. package/dist/utilities/hover.d.mts +1 -1
  38. package/dist/utilities/interval.d.mts +1 -1
  39. package/dist/utilities/location.d.mts +1 -1
  40. package/dist/utilities/media-devices.d.mts +1 -1
  41. package/dist/utilities/media-player.d.mts +1 -1
  42. package/dist/utilities/media-query.d.mts +1 -1
  43. package/dist/utilities/network.d.mts +1 -1
  44. package/dist/utilities/orientation.d.mts +1 -1
  45. package/dist/utilities/previous.d.mts +1 -1
  46. package/dist/utilities/promise.d.mts +1 -1
  47. package/dist/utilities/routing.d.mts +1 -1
  48. package/dist/utilities/search-params.d.mts +1 -1
  49. package/dist/utilities/storage.d.mts +1 -1
  50. package/dist/utilities/throttled.d.mts +1 -1
  51. package/dist/utilities/timeout.d.mts +1 -1
  52. package/dist/utilities/window-focus.d.mts +1 -1
  53. package/dist/utilities/window-size.d.mts +1 -1
  54. package/package.json +1 -1
  55. package/dist/children-s3nFjpLA.d.mts +0 -581
  56. /package/dist/{polyfill-BVNd6ogU.d.mts → polyfill-C-CxgMqq.d.mts} +0 -0
@@ -0,0 +1,19 @@
1
+ //#region src/utilities/environment.d.ts
2
+ /** `true` when running in a browser (both `window` and `document` exist). */
3
+ declare const isBrowser: boolean;
4
+ /**
5
+ * `HTMLElement` in the browser; an empty stand-in on the server.
6
+ *
7
+ * A custom-element class evaluates its `extends` clause at module load, but
8
+ * `HTMLElement` is undefined in Node — so importing an element module during
9
+ * SSR (e.g. an Astro `client:load` island) throws `HTMLElement is not defined`
10
+ * before any `isBrowser` guard can run. Elements are never *constructed* on the
11
+ * server (the streaming renderer emits plain tags), so a stub base is enough to
12
+ * let the class definition load; the guarded `customElements.define` still only
13
+ * registers in a real browser.
14
+ */
15
+ declare const HTMLElementBase: typeof HTMLElement;
16
+ /** A shared `Disposable` whose `Symbol.dispose` is a no-op — useful as a safe default. */
17
+ declare const noopDisposable: Disposable;
18
+ //#endregion
19
+ export { isBrowser as n, noopDisposable as r, HTMLElementBase as t };
package/dist/for.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { s as MaybeReactiveProps } from "./children-s3nFjpLA.mjs";
1
+ import { o as MaybeReactiveProps } from "./children-BbHF-Dew.mjs";
2
2
 
3
3
  //#region src/for.d.ts
4
4
  type KeyFn<T> = (item: T, index: number) => string | number;
package/dist/for.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { C as untracked, S as trigger, _ as onCleanup, d as effectScope, u as effect, x as signal } from "./lib-DYypKhxk.mjs";
2
2
  import "./signals/index.mjs";
3
- import { n as disposeElement } from "./element-Di0PYFX1.mjs";
3
+ import { n as disposeElement } from "./element-w3nDE2S5.mjs";
4
4
  //#region src/for.ts
5
5
  /**
6
6
  * Keyed list renderer. See {@link ForProps} for prop details.
@@ -1,6 +1,6 @@
1
1
  import { _ as onCleanup, u as effect } from "./lib-DYypKhxk.mjs";
2
2
  import "./signals/index.mjs";
3
- import { a as mountChild } from "./element-Di0PYFX1.mjs";
3
+ import { a as mountChild } from "./element-w3nDE2S5.mjs";
4
4
  import { Slot } from "./slot.mjs";
5
5
  //#region src/jsx-runtime/fragment.ts
6
6
  /**
@@ -44,8 +44,7 @@ function Fragment(props) {
44
44
  } else if (source != null) slot.set(parseHtml(String(source)));
45
45
  return fragment;
46
46
  }
47
- const children = props.children;
48
- const raw = typeof children === "function" ? children() : children;
47
+ const raw = props.children;
49
48
  if (raw == null) return fragment;
50
49
  const nodes = Array.isArray(raw) ? raw.flat(Infinity) : [raw];
51
50
  for (const child of nodes) mountChild(fragment, child);
@@ -1,2 +1,2 @@
1
- import { t as hydrate } from "../hydrate-CHomBRY9.mjs";
1
+ import { t as hydrate } from "../hydrate-CrVzu88K.mjs";
2
2
  export { hydrate };
@@ -1,11 +1,11 @@
1
1
  import { C as untracked, _ as onCleanup, d as effectScope, n as CLAIM, t as ASYNC_REGION, u as effect, v as setDeferAsyncRuns } from "./lib-DYypKhxk.mjs";
2
- import { isReactive, resolveProps } from "./signals/index.mjs";
2
+ import { isReactive } from "./signals/index.mjs";
3
3
  import { isReactivePromiseLike } from "./utilities/promise.mjs";
4
4
  import { flushDeferredAsyncRuns, isAsyncLike } from "./utilities/async.mjs";
5
- import { i as applyProps, o as resolveChild, r as setRenderer, t as createElement } from "./element-Di0PYFX1.mjs";
5
+ import { i as applyProps, o as resolveChild, r as setRenderer, t as createElement } from "./element-w3nDE2S5.mjs";
6
6
  import { Slot } from "./slot.mjs";
7
7
  import { For, isForComponent } from "./for.mjs";
8
- import { n as isFragmentComponent, r as parseHtml, t as Fragment } from "./fragment-Bvs1sGu1.mjs";
8
+ import { n as isFragmentComponent, r as parseHtml, t as Fragment } from "./fragment-DEhI5x0f.mjs";
9
9
  //#region src/hydrate/claim.ts
10
10
  let hydrationContext = null;
11
11
  function setHydrationContext(ctx) {
@@ -35,7 +35,7 @@ const claimRenderer = { jsx(type, props) {
35
35
  kind: "for",
36
36
  props
37
37
  };
38
- if (typeof type === "function" && !type.prototype?.render) return type(resolveProps(props));
38
+ if (typeof type === "function" && !type.prototype?.render) return type(props);
39
39
  const name = typeof type === "function" ? type.name ?? "anonymous" : String(type);
40
40
  throw new Error(`Hydration does not support class components ("${name}"); v1 supports intrinsic elements, function components, Fragment and For.`);
41
41
  } };
@@ -158,7 +158,7 @@ function claimAsync(cur, p, om) {
158
158
  }
159
159
  const slot = claimSlot(cur, om);
160
160
  effect(() => {
161
- if (p.state === "pending") return;
161
+ if (p.state !== "fulfilled" && p.state !== "rejected") return;
162
162
  slot.set(resolveChild(p.result));
163
163
  });
164
164
  onCleanup(() => slot.clear());
@@ -0,0 +1,392 @@
1
+ //#region src/signals/lib.d.ts
2
+ declare const SIGNAL: unique symbol;
3
+ declare const COMPUTED: unique symbol;
4
+ declare const EFFECT: unique symbol;
5
+ declare const EFFECT_SCOPE: unique symbol;
6
+ /**
7
+ * Returns `true` if `fn` is a signal handle created by {@link signal}.
8
+ *
9
+ * Relies on the SIGNAL symbol.
10
+ */
11
+ declare function isSignal(fn: unknown): boolean;
12
+ /**
13
+ * Returns `true` if `fn` is a computed handle created by {@link computed}.
14
+ *
15
+ * Relies on the COMPUTED symbol.
16
+ */
17
+ declare function isComputed(fn: unknown): boolean;
18
+ /**
19
+ * Returns `true` if `fn` is an effect cleanup handle created by {@link effect}.
20
+ *
21
+ * Relies on the EFFECT symbol.
22
+ */
23
+ declare function isEffect(fn: unknown): boolean;
24
+ /**
25
+ * Returns `true` if `fn` is an effectScope cleanup handle created by
26
+ * {@link effectScope}.
27
+ *
28
+ * Relies on `Function.name` matching the internal `effectScopeOper` function name.
29
+ */
30
+ declare function isEffectScope(fn: () => void): boolean;
31
+ /**
32
+ * Creates a mutable reactive signal.
33
+ *
34
+ * - **Read**: call with no arguments → returns the current value and
35
+ * subscribes the active tracking context.
36
+ * - **Write**: call with a value → updates the signal and schedules
37
+ * downstream effects if the value changed.
38
+ *
39
+ * @example
40
+ * ```ts
41
+ * const count = signal(0);
42
+ * count(); // → 0 (read)
43
+ * count(1); // write – effects depending on count will re-run
44
+ * count(); // → 1
45
+ * ```
46
+ */
47
+ declare function signal<T>(): Updater<T> & Computed<T>;
48
+ declare function signal<T>(initialValue: T): Updater<T> & Computed<T>;
49
+ /**
50
+ * Creates a lazily-evaluated computed value.
51
+ *
52
+ * The `getter` is only called when the computed value is read **and** one of
53
+ * its dependencies has changed since the last evaluation. If nothing has
54
+ * changed the cached `value` is returned without re-running `getter`.
55
+ *
56
+ * Computed values are read-only; they cannot be set directly.
57
+ *
58
+ * @param getter - Pure function deriving a value from other reactive sources.
59
+ * Receives the previous value as an optional optimisation hint.
60
+ *
61
+ * @example
62
+ * ```ts
63
+ * const a = signal(1);
64
+ * const b = signal(2);
65
+ * const sum = computed(() => a() + b());
66
+ *
67
+ * sum(); // → 3
68
+ * a(10);
69
+ * sum(); // → 12 (re-evaluated lazily)
70
+ * ```
71
+ */
72
+ declare function computed<T>(getter: (previousValue?: T) => T): () => T;
73
+ /**
74
+ * Creates a reactive side-effect that runs immediately and re-runs whenever
75
+ * any signal or computed it read during its last execution changes.
76
+ *
77
+ * Use {@link onCleanup} inside `fn` to register teardown logic that runs
78
+ * before each re-execution and on final disposal.
79
+ *
80
+ * If `effect` is called inside an `effectScope` or another `effect`, the
81
+ * new effect is automatically owned by the outer scope and will be disposed
82
+ * when the scope is disposed.
83
+ *
84
+ * @param fn - The side-effect body. Reactive reads inside this function
85
+ * establish dependency links.
86
+ * @returns A disposal function. Call it to stop the effect and run any
87
+ * registered cleanup.
88
+ *
89
+ * @example
90
+ * ```ts
91
+ * const url = signal('/api/data');
92
+ *
93
+ * const stop = effect(() => {
94
+ * const controller = new AbortController();
95
+ * fetch(url(), { signal: controller.signal });
96
+ * onCleanup(() => controller.abort());
97
+ * });
98
+ *
99
+ * url('/api/other'); // previous fetch is aborted, new one starts
100
+ * stop(); // final cleanup: abort the last fetch
101
+ * ```
102
+ */
103
+ /**
104
+ * @internal Method key for settling a reactive async wrapper from a
105
+ * serialized server snapshot (hydration seeding). Lives here so
106
+ * `utilities/promise`, `utilities/async` and `hydrate` can share it without
107
+ * a utility-to-utility dependency.
108
+ */
109
+ declare const SEED: unique symbol;
110
+ /**
111
+ * @internal Method key for the hydrate claim protocol: the claim walk hands
112
+ * each async wrapper its ek-data record (or undefined). The wrapper decides —
113
+ * seed and discard any deferred run, or execute the deferred run now.
114
+ */
115
+ declare const CLAIM: unique symbol;
116
+ declare function effect(fn: () => void): () => void;
117
+ /**
118
+ * Creates an ownership scope that groups reactive effects so they can all be
119
+ * disposed at once.
120
+ *
121
+ * Effects and nested scopes created inside `fn` are linked to this scope.
122
+ * When the returned disposal function is called, all owned effects are stopped
123
+ * in cascade – triggering their registered {@link onCleanup} callbacks – and
124
+ * the scope itself is removed from any parent scope that owns it.
125
+ *
126
+ * @param fn - Synchronous setup function. Create effects and nested scopes
127
+ * here.
128
+ * @returns A disposal function that tears down all owned effects and the scope
129
+ * itself.
130
+ *
131
+ * @example
132
+ * ```ts
133
+ * const stopAll = effectScope(() => {
134
+ * effect(() => console.log('a:', a()));
135
+ * effect(() => console.log('b:', b()));
136
+ * });
137
+ *
138
+ * stopAll(); // both effects stopped simultaneously
139
+ * ```
140
+ */
141
+ declare function effectScope(fn: () => void): () => void;
142
+ /**
143
+ * Registers a cleanup callback for the currently executing effect or scope.
144
+ *
145
+ * The callback will be called:
146
+ * 1. **Before the next re-run** of the enclosing effect (so resources from
147
+ * the previous run are released before the new run sets them up again).
148
+ * 2. **On final disposal** of the effect, whether triggered explicitly by
149
+ * calling the effect's cleanup handle or implicitly by an owning
150
+ * `effectScope` being disposed.
151
+ *
152
+ * Calling `onCleanup` outside of a tracking context (no active effect) is a
153
+ * no-op; it does **not** throw.
154
+ *
155
+ * Only one cleanup function per effect run is supported. Calling `onCleanup`
156
+ * multiple times within the same run overwrites the previous registration.
157
+ *
158
+ * @param fn - The teardown callback.
159
+ *
160
+ * @example
161
+ * ```ts
162
+ * effect(() => {
163
+ * const id = setInterval(() => tick(), 1000);
164
+ * onCleanup(() => clearInterval(id));
165
+ * });
166
+ * ```
167
+ *
168
+ * @example Composable helper – no prop-drilling needed:
169
+ * ```ts
170
+ * function useEventListener(target: EventTarget, type: string, handler: EventListener) {
171
+ * target.addEventListener(type, handler);
172
+ * onCleanup(() => target.removeEventListener(type, handler));
173
+ * }
174
+ *
175
+ * effect(() => {
176
+ * useEventListener(window, 'resize', onResize);
177
+ * });
178
+ * ```
179
+ */
180
+ declare function onCleanup(fn: () => void): void;
181
+ /**
182
+ * Runs `fn` as a single atomic update: all signal writes inside `fn` are
183
+ * collected and effects are flushed only once after `fn` returns, rather than
184
+ * after each individual write.
185
+ *
186
+ * Batches can be nested; the flush only occurs when the outermost batch
187
+ * completes.
188
+ *
189
+ * @example
190
+ * ```ts
191
+ * batch(() => {
192
+ * x(1);
193
+ * y(2);
194
+ * z(3);
195
+ * }); // effects that depend on x, y, or z run once here
196
+ * ```
197
+ */
198
+ declare function batch(fn: () => void): void;
199
+ /**
200
+ * Executes `fn` in a non-tracking context: any signals read inside `fn` do
201
+ * **not** create dependency links on the currently active subscriber.
202
+ *
203
+ * Useful when you need to read a signal's current value without subscribing to
204
+ * future changes.
205
+ *
206
+ * @returns The value returned by `fn`.
207
+ *
208
+ * @example
209
+ * ```ts
210
+ * const logCount = effect(() => {
211
+ * console.log('triggered by a:', a());
212
+ * // read b without subscribing – effect won't re-run when b changes
213
+ * console.log('current b:', untracked(b));
214
+ * });
215
+ * ```
216
+ */
217
+ declare function untracked<T>(fn: Computed<T>): T;
218
+ /**
219
+ * Manually triggers all subscribers of every signal read inside `fn`.
220
+ *
221
+ * Unlike writing to a signal, `trigger` does not change the signal's value; it
222
+ * only forces downstream effects and computeds to re-evaluate.
223
+ *
224
+ * @param fn - Function whose reactive reads identify the signals to trigger.
225
+ *
226
+ * @example
227
+ * ```ts
228
+ * const items = signal([1, 2, 3]);
229
+ *
230
+ * // Mutate in place (referential equality won't detect the change):
231
+ * items().push(4);
232
+ * trigger(items); // manually notify subscribers
233
+ * ```
234
+ */
235
+ declare function trigger<T = void>(fn: Computed<T>): void;
236
+ //#endregion
237
+ //#region src/signals/index.d.ts
238
+ /**
239
+ * Type-guard: `true` when `value` is a reactive source (`signal` or `computed`),
240
+ * `false` when it is a plain value.
241
+ *
242
+ * Use this when you accept {@link MaybeReactive} and need to branch on whether
243
+ * the caller passed a live source or a static value.
244
+ *
245
+ * @example
246
+ * ```ts
247
+ * import { signal, isReactive } from "elements-kit/signals";
248
+ *
249
+ * const a: MaybeReactive<number> = 5;
250
+ * const b: MaybeReactive<number> = signal(0);
251
+ * const c: () => number = () => 5;
252
+ *
253
+ * isReactive(a); // false
254
+ * isReactive(b); // true
255
+ * isReactive(c); // false
256
+ * ```
257
+ */
258
+ declare function isReactive<T>(value: MaybeReactive<T>): value is () => T;
259
+ /** Writer half of a {@link Signal}: `sig(next)` assigns a new value. */
260
+ type Updater<T> = (value: T) => void;
261
+ /** Zero-arg getter that subscribes the current tracking scope on call. */
262
+ type Computed<T> = () => T;
263
+ /**
264
+ * A reactive read/write cell — callable as both a getter (no args) and a
265
+ * setter (one arg).
266
+ *
267
+ * @example
268
+ * ```ts
269
+ * import { signal } from "elements-kit/signals";
270
+ *
271
+ * const count: Signal<number> = signal(0);
272
+ * count(); // read → 0 (subscribes the active scope)
273
+ * count(5); // write → notifies subscribers
274
+ * ```
275
+ */
276
+ type Signal<T> = Updater<T> & Computed<T>;
277
+ /**
278
+ * A decorator that makes a class field reactive by automatically wrapping its value in a signal.
279
+ *
280
+ * The field behaves like a normal property (get/set) but reactivity is tracked under the hood.
281
+ * Any reads will subscribe to the signal and any writes will trigger updates.
282
+ *
283
+ * @example
284
+ * ```ts
285
+ * class Counter {
286
+ * \@reactive() count: number = 0;
287
+ * }
288
+ *
289
+ * const counter = new Counter();
290
+ * counter.count++; // Triggers reactivity
291
+ * console.log(counter.count); // Subscribes to changes
292
+ * ```
293
+ *
294
+ * @remarks
295
+ * Equivalent to manually creating a private signal and getter/setter:
296
+ * ```ts
297
+ * class Counter {
298
+ * #count = signal(0);
299
+ * get count() { return this.#count(); }
300
+ * set count(value) { this.#count(value); }
301
+ * }
302
+ * ```
303
+ */
304
+ declare function reactive<This extends object, Value>(source?: (self: This) => Signal<Value>): (_target: unknown, context: ClassFieldDecoratorContext<This, Value>) => (this: This, initialValue: Value) => Value;
305
+ /**
306
+ * A value that may be static or reactive. Accepts a plain `T` or a
307
+ * zero-arg getter (`() => T`) — typically a `signal` or `computed`.
308
+ *
309
+ * Used across the library anywhere a prop or attribute may be bound to
310
+ * reactive state. Resolve with {@link resolve}, detect with {@link isReactive}.
311
+ *
312
+ * @template T — the value type.
313
+ *
314
+ * @example
315
+ * ```ts
316
+ * import { signal, computed } from "elements-kit/signals";
317
+ *
318
+ * const count = signal(0);
319
+ * const double = computed(() => count() * 2);
320
+ *
321
+ * const a: MaybeReactive<number> = 5; // static
322
+ * const b: MaybeReactive<number> = count; // signal (getter)
323
+ * const c: MaybeReactive<number> = double; // computed (getter)
324
+ * ```
325
+ */
326
+ type MaybeReactive<T> = T | Computed<T>;
327
+ /**
328
+ * Resolve a {@link MaybeReactive} to its current value. Calls the getter when
329
+ * reactive (a `signal` or `computed`); returns the value as-is otherwise — an
330
+ * unbranded function is a value, not a source, so a callback survives intact.
331
+ *
332
+ * This is how a function component reads a prop it declared `MaybeReactive`:
333
+ * the runtime hands props over exactly as the caller wrote them, so the value
334
+ * may be either form. Reading inside an effect or a JSX getter subscribes.
335
+ *
336
+ * @example
337
+ * ```ts
338
+ * resolve(5); // 5
339
+ * resolve(count); // current count value — signal
340
+ * resolve(props.label); // current value, whichever form the caller passed
341
+ * resolve(() => 5); // the function itself — unbranded, so not a source
342
+ * ```
343
+ */
344
+ declare function resolve<T>(value: MaybeReactive<T>): T;
345
+ /**
346
+ * A props bag where every key is a getter — what {@link computedProps} produces.
347
+ * The counterpart to `Props<P>`: that one is what a caller may pass, this is
348
+ * what a body reads. Optional keys lose their `?`, so `props.excited()` needs
349
+ * no `?.` — the getter is always there, only its result may be undefined.
350
+ *
351
+ * @template P — the raw prop shape.
352
+ */
353
+ type ComputedProps<P> = { readonly [K in keyof P]-?: Computed<P[K]> };
354
+ /**
355
+ * Reactive keys become the value they yield. `computedProps` infers its shape
356
+ * verbatim and unwraps here, because inferring through `T | Computed<T>` picks
357
+ * the `Computed` branch for any function prop and yields its return type.
358
+ */
359
+ type Unwrap<P> = { [K in keyof P]: UnwrapValue<P[K]> };
360
+ /** Naked parameter so it distributes: `T | Computed<T>` collapses to `T`. */
361
+ type UnwrapValue<V> = V extends Computed<infer T> ? T : V;
362
+ /** Arity of a call signature; `0` for anything that is not callable. */
363
+ type ArgCount<F> = F extends ((...args: infer A) => unknown) ? A["length"] : 0;
364
+ type ArgFnPropError = "computedProps: a prop that takes arguments cannot be inferred here — read it off the raw props instead";
365
+ /**
366
+ * Reject props that take arguments — inference cannot tell them from a getter.
367
+ * Zero-arg ones stay: `Signal` and `Computed` are zero-arg callables too.
368
+ */
369
+ type NoArgFnProps<P> = { [K in keyof P]: ArgCount<P[K]> extends 0 ? P[K] : ArgFnPropError };
370
+ /**
371
+ * Turn props into a bag of per-key getters, so a body reads one shape no matter
372
+ * which form the caller passed. Opt-in: the JSX runtime hands function
373
+ * components their props untouched.
374
+ *
375
+ * Every key is callable, including one the caller omitted. A getter is always
376
+ * truthy, so defaults go on the call: `props.excited() ?? "…"`. Read a bag by
377
+ * calling the key — {@link resolve} is for raw props.
378
+ *
379
+ * Function props are the limit: a prop taking arguments is rejected, and a
380
+ * zero-arg one types as its return value. Read those off the raw props.
381
+ *
382
+ * @example
383
+ * ```ts
384
+ * const count = signal(0);
385
+ * const props = computedProps({ count, label: "n" });
386
+ * props.count(); // 0 — subscribes to count
387
+ * props.label(); // "n"
388
+ * ```
389
+ */
390
+ declare function computedProps<P extends object>(raw: P & NoArgFnProps<P>): ComputedProps<Unwrap<P>>;
391
+ //#endregion
392
+ export { isSignal as C, untracked as D, trigger as E, isEffectScope as S, signal as T, computed as _, Updater as a, isComputed as b, reactive as c, COMPUTED as d, EFFECT as f, batch as g, SIGNAL as h, Signal as i, resolve as l, SEED as m, ComputedProps as n, computedProps as o, EFFECT_SCOPE as p, MaybeReactive as r, isReactive as s, Computed as t, CLAIM as u, effect as v, onCleanup as w, isEffect as x, effectScope as y };
@@ -1,6 +1,6 @@
1
- import { t as createElement } from "../element-Di0PYFX1.mjs";
1
+ import { t as createElement } from "../element-w3nDE2S5.mjs";
2
2
  import { render } from "../render.mjs";
3
- import { t as hydrate } from "../hydrate-CHomBRY9.mjs";
3
+ import { t as hydrate } from "../hydrate-CrVzu88K.mjs";
4
4
  import { withSlotProps } from "./astro-slots.mjs";
5
5
  //#region src/integrations/astro-client.ts
6
6
  /**
@@ -1,8 +1,7 @@
1
1
  import { y as setInertEffects } from "../lib-DYypKhxk.mjs";
2
- import { resolveProps } from "../signals/index.mjs";
3
- import { r as setRenderer, t as createElement } from "../element-Di0PYFX1.mjs";
2
+ import { r as setRenderer, t as createElement } from "../element-w3nDE2S5.mjs";
4
3
  import { withSlotProps } from "./astro-slots.mjs";
5
- import { i as serverJsx, n as renderToString, r as SNode } from "../server-CTkyXTV6.mjs";
4
+ import { i as serverJsx, n as renderToString, r as SNode } from "../server-D7ffi7b_.mjs";
6
5
  //#region src/integrations/astro-server.ts
7
6
  /**
8
7
  * Decide whether `Component` is an elements-kit component. Invoked by Astro
@@ -17,7 +16,7 @@ const check = async (Component, props) => {
17
16
  const prevInert = setInertEffects(true);
18
17
  setRenderer({ jsx: serverJsx });
19
18
  try {
20
- return Component(resolveProps(props ?? {})) instanceof SNode;
19
+ return Component(props ?? {}) instanceof SNode;
21
20
  } catch {
22
21
  return false;
23
22
  } finally {
@@ -1,5 +1,5 @@
1
- import { t as createElement } from "../element-Di0PYFX1.mjs";
2
- import { t as Fragment } from "../fragment-Bvs1sGu1.mjs";
1
+ import { t as createElement } from "../element-w3nDE2S5.mjs";
2
+ import { t as Fragment } from "../fragment-DEhI5x0f.mjs";
3
3
  //#region src/integrations/astro-slots.ts
4
4
  /**
5
5
  * @internal Map Astro's pre-rendered slot HTML (`Record<name, html>`) into
@@ -1,4 +1,4 @@
1
- import { f as Computed } from "../children-s3nFjpLA.mjs";
1
+ import { t as Computed } from "../index-BR8XVkck.mjs";
2
2
 
3
3
  //#region src/integrations/react.d.ts
4
4
  /**
@@ -1,2 +1,3 @@
1
- import { a as Fragment, c as Props, d as Require, i as JSX, l as PropsOf, n as ComponentClass, o as createElement, p as MaybeReactive, r as ComponentFn, s as MaybeReactiveProps, t as Children, u as RawProps } from "../children-s3nFjpLA.mjs";
2
- export { type Children, ComponentClass, ComponentFn, Fragment, JSX, type MaybeReactive, type MaybeReactiveProps, type Props, type PropsOf, type RawProps, type Require, createElement as h, createElement as jsx, createElement as jsxDEV, createElement as jsxs };
1
+ import { a as Fragment, c as PropsOf, i as JSX, l as Require, n as ComponentClass, o as MaybeReactiveProps, r as ComponentFn, s as Props, t as Children, u as createElement } from "../children-BbHF-Dew.mjs";
2
+ import { n as ComputedProps, r as MaybeReactive } from "../index-BR8XVkck.mjs";
3
+ export { type Children, ComponentClass, ComponentFn, type ComputedProps, Fragment, JSX, type MaybeReactive, type MaybeReactiveProps, type Props, type PropsOf, type Require, createElement as h, createElement as jsx, createElement as jsxDEV, createElement as jsxs };
@@ -1,3 +1,3 @@
1
- import { t as createElement } from "../element-Di0PYFX1.mjs";
2
- import { t as Fragment } from "../fragment-Bvs1sGu1.mjs";
1
+ import { t as createElement } from "../element-w3nDE2S5.mjs";
2
+ import { t as Fragment } from "../fragment-DEhI5x0f.mjs";
3
3
  export { Fragment, createElement as h, createElement as jsx, createElement as jsxDEV, createElement as jsxs };
@@ -1,2 +1,2 @@
1
- import { n as renderToString, t as renderToStream } from "../server-CTkyXTV6.mjs";
1
+ import { n as renderToString, t as renderToStream } from "../server-D7ffi7b_.mjs";
2
2
  export { renderToStream, renderToString };
@@ -1,10 +1,10 @@
1
1
  import { C as untracked, y as setInertEffects } from "./lib-DYypKhxk.mjs";
2
- import { isReactive, resolveProps } from "./signals/index.mjs";
2
+ import { isReactive } from "./signals/index.mjs";
3
3
  import { isReactivePromiseLike } from "./utilities/promise.mjs";
4
4
  import { isAsyncLike } from "./utilities/async.mjs";
5
- import { c as BooleanAttributes, l as ChildProperties, r as setRenderer, s as AttrAliases, u as Properties } from "./element-Di0PYFX1.mjs";
5
+ import { c as BooleanAttributes, l as ChildProperties, r as setRenderer, s as AttrAliases, u as Properties } from "./element-w3nDE2S5.mjs";
6
6
  import { isForComponent } from "./for.mjs";
7
- import { n as isFragmentComponent } from "./fragment-Bvs1sGu1.mjs";
7
+ import { n as isFragmentComponent } from "./fragment-DEhI5x0f.mjs";
8
8
  //#region src/server/escape.ts
9
9
  function escapeDelim(s, delim, escDelim) {
10
10
  let iDelim = s.indexOf(delim);
@@ -121,7 +121,7 @@ function serverJsx(type, props) {
121
121
  return new SNode(childList(props.children));
122
122
  }
123
123
  if (isForComponent(type)) return forElement(props);
124
- if (typeof type === "function" && !type.prototype?.render) return new SNode(child(type(resolveProps(props))));
124
+ if (typeof type === "function" && !type.prototype?.render) return new SNode(child(type(props)));
125
125
  const name = typeof type === "function" ? type.name ?? "anonymous" : String(type);
126
126
  throw new Error(`Server rendering does not support class components ("${name}"); v1 supports intrinsic elements, function components, Fragment and For.`);
127
127
  }
@@ -1,2 +1,2 @@
1
- import { A as isComputed, C as EFFECT_SCOPE, D as computed, E as batch, F as signal, I as trigger, L as untracked, M as isEffectScope, N as isSignal, O as effect, P as onCleanup, S as EFFECT, T as SIGNAL, _ as reactive, b as CLAIM, f as Computed, g as isReactive, h as Updater, j as isEffect, k as effectScope, m as Signal, p as MaybeReactive, v as resolve, w as SEED, x as COMPUTED, y as resolveProps } from "../children-s3nFjpLA.mjs";
2
- export { CLAIM, COMPUTED, Computed, EFFECT, EFFECT_SCOPE, MaybeReactive, SEED, SIGNAL, Signal, Updater, batch, computed, effect, effectScope, isComputed, isEffect, isEffectScope, isReactive, isSignal, onCleanup, reactive, resolve, resolveProps, signal, trigger, untracked };
1
+ import { C as isSignal, D as untracked, E as trigger, S as isEffectScope, T as signal, _ as computed, a as Updater, b as isComputed, c as reactive, d as COMPUTED, f as EFFECT, g as batch, h as SIGNAL, i as Signal, l as resolve, m as SEED, n as ComputedProps, o as computedProps, p as EFFECT_SCOPE, r as MaybeReactive, s as isReactive, t as Computed, u as CLAIM, v as effect, w as onCleanup, x as isEffect, y as effectScope } from "../index-BR8XVkck.mjs";
2
+ export { CLAIM, COMPUTED, Computed, ComputedProps, EFFECT, EFFECT_SCOPE, MaybeReactive, SEED, SIGNAL, Signal, Updater, batch, computed, computedProps, effect, effectScope, isComputed, isEffect, isEffectScope, isReactive, isSignal, onCleanup, reactive, resolve, signal, trigger, untracked };