@tempots/ui 0.21.0 → 0.22.1-next.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tempots/ui",
3
- "version": "0.21.0",
3
+ "version": "0.22.1-next.0",
4
4
  "type": "module",
5
5
  "main": "./index.cjs",
6
6
  "module": "./index.js",
@@ -40,7 +40,7 @@
40
40
  "@floating-ui/dom": "^1.6.7"
41
41
  },
42
42
  "peerDependencies": {
43
- "@tempots/dom": "23.0.2",
43
+ "@tempots/dom": "24.0.0-next.0",
44
44
  "@tempots/std": "0.16.0"
45
45
  }
46
46
  }
@@ -1,4 +1,4 @@
1
- import { TNode, DOMContext, Value } from '@tempots/dom';
1
+ import { TNode, Value } from '@tempots/dom';
2
2
  /**
3
3
  * Represents the placement options for a pop-over.
4
4
  *
@@ -47,4 +47,4 @@ export type PopOverOptions = {
47
47
  * @returns The rendered PopOver component.
48
48
  * @public
49
49
  */
50
- export declare const PopOver: ({ content, open, placement, offset: { mainAxis, crossAxis }, }: PopOverOptions) => (ctx: DOMContext) => import('@tempots/dom').Clear;
50
+ export declare const PopOver: ({ content, open, placement, offset: { mainAxis, crossAxis }, }: PopOverOptions) => import('@tempots/dom').Renderable;
@@ -0,0 +1,23 @@
1
+ import { TNode, Prop } from '@tempots/dom';
2
+ import { LocationData } from './location-data';
3
+ /**
4
+ * Creates a location object based on the current browser location.
5
+ * @returns The location object representing the current browser location.
6
+ * @internal
7
+ */
8
+ export declare const _makeLocation: () => LocationData;
9
+ /**
10
+ * Creates a location prop that represents the current browser location.
11
+ * The location prop is updated whenever the browser location changes.
12
+ *
13
+ * @returns The location prop.
14
+ * @internal
15
+ */
16
+ export declare const _makeLocationProp: () => Prop<LocationData>;
17
+ /**
18
+ * Provides the location context to the child component.
19
+ * @param child - The child component to be wrapped with the location context.
20
+ * @returns The wrapped component with the location context.
21
+ * @public
22
+ */
23
+ export declare const ProvideBrowserLocation: (child: TNode) => import('@tempots/dom').Renderable;
@@ -0,0 +1,9 @@
1
+ import { TNode, Prop } from '@tempots/dom';
2
+ export declare const isAbsoluteURL: (url: string) => boolean;
3
+ /**
4
+ * Provides the location context to the child component.
5
+ * @param child - The child component to be wrapped with the location context.
6
+ * @returns The wrapped component with the location context.
7
+ * @public
8
+ */
9
+ export declare const ProvideHeadlessLocation: (url: Prop<string>, child: TNode) => import('@tempots/dom').Renderable;
@@ -0,0 +1,51 @@
1
+ import { Prop } from '@tempots/dom';
2
+ /**
3
+ * Represents the data for a location.
4
+ *
5
+ * @public
6
+ */
7
+ export type LocationData = {
8
+ /**
9
+ * The pathname of the location.
10
+ */
11
+ readonly pathname: string;
12
+ /**
13
+ * The search parameters of the location.
14
+ */
15
+ readonly search: Record<string, string>;
16
+ /**
17
+ * The hash of the location.
18
+ */
19
+ readonly hash?: string;
20
+ };
21
+ /**
22
+ * Compares two location objects and returns true if they are equal, false otherwise.
23
+ * @param a - The first location object to compare.
24
+ * @param b - The second location object to compare.
25
+ * @returns True if the location objects are equal, false otherwise.
26
+ * @public
27
+ */
28
+ export declare const areLocationsEqual: (a: LocationData, b: LocationData) => boolean;
29
+ /**
30
+ * Converts a URL string into a LocationData object.
31
+ * @param url - The URL string to convert.
32
+ * @returns The LocationData object representing the URL.
33
+ * @public
34
+ */
35
+ export declare const locationFromURL: (url: string, baseUrl?: string) => LocationData;
36
+ /**
37
+ * Sets the location from the given URL and updates the specified property.
38
+ * @param prop - The property to update with the new location.
39
+ * @param url - The URL from which to extract the location.
40
+ * @returns The updated property.
41
+ * @public
42
+ */
43
+ export declare const setLocationFromUrl: (prop: Prop<LocationData>, url: string) => Prop<LocationData>;
44
+ /**
45
+ * Returns the full URL based on the provided location data.
46
+ *
47
+ * @param location - The location data object.
48
+ * @returns The full URL string.
49
+ * @public
50
+ */
51
+ export declare const urlFromLocation: (location: LocationData) => string;
@@ -1,74 +1,11 @@
1
1
  import { TNode, Prop } from '@tempots/dom';
2
- /**
3
- * Represents the data for a location.
4
- *
5
- * @public
6
- */
7
- export type LocationData = {
8
- /**
9
- * The pathname of the location.
10
- */
11
- readonly pathname: string;
12
- /**
13
- * The search parameters of the location.
14
- */
15
- readonly search: Record<string, string>;
16
- /**
17
- * The hash of the location.
18
- */
19
- readonly hash?: string;
20
- };
2
+ import { LocationData } from './location-data';
21
3
  /**
22
4
  * Marker for the LocationProvider.
23
5
  *
24
6
  * @public
25
7
  */
26
8
  export declare const LocationProviderMarker: import('@tempots/dom').ProviderMark<Prop<LocationData>>;
27
- /**
28
- * Creates a location object based on the current browser location.
29
- * @returns The location object representing the current browser location.
30
- * @internal
31
- */
32
- export declare const _makeLocation: () => LocationData;
33
- /**
34
- * Compares two location objects and returns true if they are equal, false otherwise.
35
- * @param a - The first location object to compare.
36
- * @param b - The second location object to compare.
37
- * @returns True if the location objects are equal, false otherwise.
38
- * @public
39
- */
40
- export declare const areLocationsEqual: (a: LocationData, b: LocationData) => boolean;
41
- /**
42
- * Converts a URL string into a LocationData object.
43
- * @param url - The URL string to convert.
44
- * @returns The LocationData object representing the URL.
45
- * @public
46
- */
47
- export declare const locationFromURL: (url: string) => LocationData;
48
- /**
49
- * Sets the location from the given URL and updates the specified property.
50
- * @param prop - The property to update with the new location.
51
- * @param url - The URL from which to extract the location.
52
- * @returns The updated property.
53
- * @public
54
- */
55
- export declare const setLocationFromUrl: (prop: Prop<LocationData>, url: string) => Prop<LocationData>;
56
- /**
57
- * Returns the full URL based on the provided location data.
58
- *
59
- * @param location - The location data object.
60
- * @returns The full URL string.
61
- * @public
62
- */
63
- export declare const urlFromLocation: (location: LocationData) => string;
64
- /**
65
- * Creates a location prop that represents the current browser location.
66
- * The location prop is updated whenever the browser location changes.
67
- *
68
- * @returns The location prop.
69
- * @internal
70
- */
71
- export declare const _makeLocationProp: () => Prop<LocationData>;
72
9
  /**
73
10
  * Provides the location context to the child component.
74
11
  * @param child - The child component to be wrapped with the location context.
@@ -6,7 +6,7 @@ import { DOMContext, Signal, TNode, Size } from '@tempots/dom';
6
6
  * @returns A function that takes a DOMContext and returns a renderable function.
7
7
  * @public
8
8
  */
9
- export declare const ElementSize: (fn: (size: Signal<Size>) => TNode) => (ctx: DOMContext) => (removeTree: boolean) => void;
9
+ export declare const ElementSize: (fn: (size: Signal<Size>) => TNode) => import('@tempots/dom').Renderable;
10
10
  /**
11
11
  * Creates a renderable function that monitors the window size and invokes the provided function with the current size.
12
12
  * @param fn - The function to be invoked with the current window size.