@tempots/ui 13.3.0 → 14.0.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/README.md CHANGED
@@ -4,6 +4,8 @@ A collection of reusable UI components and renderables built on top of @tempots/
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/@tempots/ui.svg)](https://www.npmjs.com/package/@tempots/ui)
6
6
  [![license](https://img.shields.io/npm/l/@tempots/ui.svg)](https://github.com/fponticelli/tempots/blob/main/LICENSE)
7
+ [![codecov](https://codecov.io/gh/fponticelli/tempots/branch/main/graph/badge.svg)](https://codecov.io/gh/fponticelli/tempots)
8
+ [![CI](https://github.com/fponticelli/tempots/workflows/CI/badge.svg)](https://github.com/fponticelli/tempots/actions)
7
9
 
8
10
  ## Installation
9
11
 
@@ -73,7 +73,7 @@ export declare const interpolateColor: (startColor: string, endColor: string) =>
73
73
  export declare const interpolateShadow: (startShadow: string, endShadow: string) => ((t: number) => string);
74
74
  export declare const getComputedAnimatableProp: (styles: CSSStyleDeclaration, key: keyof AnimatableProps) => AnimatableProps[typeof key];
75
75
  export declare const getComputedAnimatable: (el: HTMLElement, styles: AnimatableProps) => AnimatableProps;
76
- export declare const applyAnimatableProp: (el: HTMLElement, key: keyof AnimatableProps, value: AnimatableProps[typeof key]) => void;
77
- export declare const applyInterpolatedAnimatableProp: (el: HTMLElement, key: keyof AnimatableProps, from: AnimatableProps[typeof key], to: AnimatableProps[typeof key], progress: number) => void;
76
+ export declare const applyAnimatableProp: (el: HTMLElement, key: keyof AnimatableProps, value: AnimatableProps[typeof key], transforms: string[], filters: string[]) => void;
77
+ export declare const applyInterpolatedAnimatableProp: (el: HTMLElement, key: keyof AnimatableProps, from: AnimatableProps[typeof key], to: AnimatableProps[typeof key], progress: number, transforms: string[], filters: string[]) => void;
78
78
  export declare const applyInterpolatedAnimatable: (el: HTMLElement, from: AnimatableProps, to: AnimatableProps, progress: number) => void;
79
79
  export declare const applyAnimatable: (el: HTMLElement, styles: AnimatableProps) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tempots/ui",
3
- "version": "13.3.0",
3
+ "version": "14.0.1",
4
4
  "type": "module",
5
5
  "main": "./index.cjs",
6
6
  "module": "./index.js",
@@ -40,7 +40,7 @@
40
40
  "@floating-ui/dom": "^1.7.1"
41
41
  },
42
42
  "peerDependencies": {
43
- "@tempots/dom": "^34.3.0",
44
- "@tempots/std": "^0.24.0"
43
+ "@tempots/dom": "^35.0.1",
44
+ "@tempots/std": "^0.25.2"
45
45
  }
46
46
  }
@@ -13,8 +13,8 @@ export interface MutationContentOptions<Req, Res, E> {
13
13
  /**
14
14
  * Options for displaying the different states of an asynchronous resource.
15
15
  *
16
- * @template Res - The type of the value when the resource is successfully loaded.
17
- * @template E - The type of the error when the resource fails to load.
16
+ * @typeParam Res - The type of the value when the resource is successfully loaded.
17
+ * @typeParam E - The type of the error when the resource fails to load.
18
18
  * @public
19
19
  */
20
20
  export interface MutationDisplayOptions<Req, Res, E> {
@@ -24,9 +24,9 @@ export interface MutationDisplayOptions<Req, Res, E> {
24
24
  /**
25
25
  * Component to display an asynchronous mutation based on its current status.
26
26
  *
27
- * @template Req - The type of the request.
28
- * @template Res - The type of the value when the resource is successfully loaded.
29
- * @template E - The type of the error when the resource fails to load.
27
+ * @typeParam Req - The type of the request.
28
+ * @typeParam Res - The type of the value when the resource is successfully loaded.
29
+ * @typeParam E - The type of the error when the resource fails to load.
30
30
  *
31
31
  * @param {MutationResource<Req, Res, E>} resource - The asynchronous resource to display.
32
32
  * @param {MutationDisplayOptions<Req, Res, E>} options - The display options for the resource.
@@ -41,9 +41,9 @@ export declare const MutationDisplay: <Req, Res, E>(resource: MutationResource<R
41
41
  * loading, success, and error states. It automatically manages the lifecycle of
42
42
  * async requests and provides reload functionality.
43
43
  *
44
- * @template Req - The type of the request.
45
- * @template Res - The type of the value when the resource is successfully loaded.
46
- * @template E - The type of the error when the resource fails to load.
44
+ * @typeParam Req - The type of the request.
45
+ * @typeParam Res - The type of the value when the resource is successfully loaded.
46
+ * @typeParam E - The type of the error when the resource fails to load.
47
47
  *
48
48
  * @param {MutationResource<Req, Res, E>} resource - The asynchronous resource to display.
49
49
  * @param {MutationDisplayOptions<Req, Res, E>} options - The display options for the resource.
@@ -4,8 +4,8 @@ import { AsyncResult, NonLoading } from '@tempots/std';
4
4
  /**
5
5
  * Options for displaying the different states of an asynchronous query.
6
6
  *
7
- * @template Res - The type of the value when the query is successfully loaded.
8
- * @template E - The type of the error when the query fails to load.
7
+ * @typeParam Res - The type of the value when the query is successfully loaded.
8
+ * @typeParam E - The type of the error when the query fails to load.
9
9
  * @public
10
10
  */
11
11
  export interface QueryDisplayOptions<Res, E> {
@@ -29,8 +29,8 @@ export interface QueryDisplayOptions<Res, E> {
29
29
  /**
30
30
  * Component to display an asynchronous query based on its current status.
31
31
  *
32
- * @template Res - The type of the value when the query is successfully loaded.
33
- * @template E - The type of the error when the query fails to load.
32
+ * @typeParam Res - The type of the value when the query is successfully loaded.
33
+ * @typeParam E - The type of the error when the query fails to load.
34
34
  *
35
35
  * @param {QueryResource<Res, E>} query - The asynchronous query to display.
36
36
  * @param {QueryDisplayOptions<Res, E>} options - The display options for the query.
@@ -145,9 +145,9 @@ export declare const QueryDisplay: <Res, E>(query: QueryResource<Res, E>, option
145
145
  * })
146
146
  * ```
147
147
  *
148
- * @template Req - The type of the request parameter
149
- * @template Res - The type of the successful result value
150
- * @template E - The type of the error (defaults to unknown)
148
+ * @typeParam Req - The type of the request parameter
149
+ * @typeParam Res - The type of the successful result value
150
+ * @typeParam E - The type of the error (defaults to unknown)
151
151
  * @param options - Configuration object for the query
152
152
  * @param options.request - Signal or value representing the request parameters
153
153
  * @param options.load - Async function that loads the query
@@ -1,4 +1,4 @@
1
- import { Provider, Signal, Value } from '@tempots/dom';
1
+ import { Provider, Signal, SplitValue } from '@tempots/dom';
2
2
  import { LocationData } from './location-data';
3
3
  import { NavigationOptions } from './navigation-options';
4
4
  export type { NavigationOptions } from './navigation-options';
@@ -115,7 +115,7 @@ export type LocationHandle = {
115
115
  /**
116
116
  * Returns a reactive signal that mirrors the result of `match`.
117
117
  */
118
- matchSignal: (matcher: Value<string | RegExp | ((location: LocationData) => boolean)>, options?: LocationMatchOptions) => Signal<boolean>;
118
+ matchSignal: (matcher: SplitValue<string | RegExp | ((location: LocationData) => boolean)>, options?: LocationMatchOptions) => Signal<boolean>;
119
119
  };
120
120
  /**
121
121
  * Draft object provided inside `LocationHandle.run` for staged updates.
@@ -36,7 +36,7 @@ import { ExtractParams, MakeParams, RouteInfo } from './route-info';
36
36
  * })
37
37
  * ```
38
38
  *
39
- * @template T - The type of the routes configuration object
39
+ * @typeParam T - The type of the routes configuration object
40
40
  * @param routes - Object mapping route patterns to handler functions
41
41
  * @returns A renderable router component that handles URL routing and provides context
42
42
  * @throws {Error} When no matching route is found for the current URL
@@ -83,7 +83,7 @@ export declare const RootRouter: <T extends { [K in keyof T]: (info: K extends s
83
83
  * })
84
84
  * ```
85
85
  *
86
- * @template T - The type of the routes configuration object
86
+ * @typeParam T - The type of the routes configuration object
87
87
  * @param routes - Object mapping route patterns to handler functions
88
88
  * @returns A renderable router component that handles nested URL routing
89
89
  * @throws {Error} When no matching route is found for the remaining path
@@ -4,9 +4,9 @@ import { AsyncResult, NonLoading } from '@tempots/std';
4
4
  * A write-side wrapper for async state around POST/PUT/PATCH/DELETE.
5
5
  * Mirrors AsyncResource but the action is explicit (execute), not implicit (reload).
6
6
  *
7
- * @template Req - The request payload/type you send.
8
- * @template Res - The response/value you get back on success.
9
- * @template E - The error type on failure.
7
+ * @typeParam Req - The request payload/type you send.
8
+ * @typeParam Res - The response/value you get back on success.
9
+ * @typeParam E - The error type on failure.
10
10
  */
11
11
  export interface MutationResource<Req, Res, E> {
12
12
  /** Current async status (Idle | Loading | Success | Failure). */
@@ -4,8 +4,8 @@ import { AsyncResult, NonLoading } from '@tempots/std';
4
4
  * Represents an asynchronous query with its current status, value, error, and loading state.
5
5
  * Provides methods to reload the query and dispose of it.
6
6
  *
7
- * @template Res - The type of the value when the query is successfully loaded.
8
- * @template E - The type of the error when the query fails to load.
7
+ * @typeParam Res - The type of the value when the query is successfully loaded.
8
+ * @typeParam E - The type of the error when the query fails to load.
9
9
  * @public
10
10
  */
11
11
  export interface QueryResource<Res, E> {
@@ -27,9 +27,9 @@ export interface QueryResource<Res, E> {
27
27
  /**
28
28
  * Options for loading a query, including the request, abort signal, and previous result.
29
29
  *
30
- * @template Req - The type of the request.
31
- * @template Res - The type of the value when the query is successfully loaded.
32
- * @template E - The type of the error when the query fails to load.
30
+ * @typeParam Req - The type of the request.
31
+ * @typeParam Res - The type of the value when the query is successfully loaded.
32
+ * @typeParam E - The type of the error when the query fails to load.
33
33
  * @public
34
34
  */
35
35
  export interface QueryResourceLoadOptions<Req, Res, E> {
@@ -47,9 +47,9 @@ export interface QueryResourceLoadOptions<Req, Res, E> {
47
47
  /**
48
48
  * Creates an asynchronous query that can be loaded, reloaded, and disposed of.
49
49
  *
50
- * @template R - The type of the request.
51
- * @template V - The type of the value when the query is successfully loaded.
52
- * @template E - The type of the error when the query fails to load.
50
+ * @typeParam R - The type of the request.
51
+ * @typeParam V - The type of the value when the query is successfully loaded.
52
+ * @typeParam E - The type of the error when the query fails to load.
53
53
  *
54
54
  * @param request - The request to load the query.
55
55
  * @param load - The function to load the query.