@tempots/ui 0.15.2 → 0.16.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tempots/ui",
3
- "version": "0.15.2",
3
+ "version": "0.16.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.6.7"
41
41
  },
42
42
  "peerDependencies": {
43
- "@tempots/dom": "19.3.1",
43
+ "@tempots/dom": "20.0.0",
44
44
  "@tempots/std": "0.15.0"
45
45
  }
46
46
  }
@@ -1,11 +1,34 @@
1
- import { TNode, Value } from '@tempots/dom';
1
+ import { TNode, Value, Renderable } from '@tempots/dom';
2
+ import { HandleAnchorClickOptions } from '../dom/handle-anchor-click';
3
+ import { Merge } from '@tempots/std';
4
+ /**
5
+ * Options for configuring an anchor element.
6
+ * @public
7
+ */
8
+ export type AnchorOptions = Merge<{
9
+ /**
10
+ * The href attribute of the anchor element.
11
+ * Can be a string or a Signal containing a string.
12
+ */
13
+ href: Value<string>;
14
+ }, HandleAnchorClickOptions>;
15
+ /**
16
+ * Represents either a string value (or Signal of string) for the href,
17
+ * or a full AnchorOptions object.
18
+ *
19
+ * This type is used as the first parameter of the Anchor function,
20
+ * allowing for flexible configuration of anchor elements.
21
+ *
22
+ * @public
23
+ */
24
+ export type HrefOrAnchorOptions = Value<string> | AnchorOptions;
2
25
  /**
3
26
  * Creates an anchor element with the specified href and children.
4
27
  * When the anchor element is clicked, the location is updated to the specified href.
5
28
  *
6
- * @param href - The href attribute of the anchor element.
29
+ * @param hrefOrOptions - The href attribute of the anchor element.
7
30
  * @param children - The child elements of the anchor element.
8
31
  * @returns The anchor element.
9
32
  * @public
10
33
  */
11
- export declare const Anchor: (href: Value<string>, ...children: TNode[]) => import('@tempots/dom').Renderable;
34
+ export declare const Anchor: (hrefOrOptions: HrefOrAnchorOptions, ...children: TNode[]) => Renderable;