@tempots/ui 14.0.0 → 14.0.2
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
|
[](https://www.npmjs.com/package/@tempots/ui)
|
|
6
6
|
[](https://github.com/fponticelli/tempots/blob/main/LICENSE)
|
|
7
|
+
[](https://codecov.io/gh/fponticelli/tempots)
|
|
8
|
+
[](https://github.com/fponticelli/tempots/actions)
|
|
7
9
|
|
|
8
10
|
## Installation
|
|
9
11
|
|
package/dom/animatable.d.ts
CHANGED
|
@@ -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": "14.0.
|
|
3
|
+
"version": "14.0.2",
|
|
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": "^35.0.
|
|
44
|
-
"@tempots/std": "^0.
|
|
43
|
+
"@tempots/dom": "^35.0.2",
|
|
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
|
-
* @
|
|
17
|
-
* @
|
|
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
|
-
* @
|
|
28
|
-
* @
|
|
29
|
-
* @
|
|
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
|
-
* @
|
|
45
|
-
* @
|
|
46
|
-
* @
|
|
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.
|
package/renderables/query.d.ts
CHANGED
|
@@ -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
|
-
* @
|
|
8
|
-
* @
|
|
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
|
-
* @
|
|
33
|
-
* @
|
|
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
|
-
* @
|
|
149
|
-
* @
|
|
150
|
-
* @
|
|
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
|
|
@@ -36,7 +36,7 @@ import { ExtractParams, MakeParams, RouteInfo } from './route-info';
|
|
|
36
36
|
* })
|
|
37
37
|
* ```
|
|
38
38
|
*
|
|
39
|
-
* @
|
|
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
|
-
* @
|
|
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
|
-
* @
|
|
8
|
-
* @
|
|
9
|
-
* @
|
|
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
|
-
* @
|
|
8
|
-
* @
|
|
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
|
-
* @
|
|
31
|
-
* @
|
|
32
|
-
* @
|
|
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
|
-
* @
|
|
51
|
-
* @
|
|
52
|
-
* @
|
|
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.
|