@tempots/beatui 0.4.1 → 0.5.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.
@@ -0,0 +1,15 @@
1
+ import { TNode, Value } from '@tempots/dom';
2
+ import { ThemeColorName } from '@/tokens';
3
+ export type LinkVariant = 'default' | 'plain' | 'hover';
4
+ export interface LinkOptions {
5
+ href: Value<string>;
6
+ variant?: Value<LinkVariant>;
7
+ color?: Value<ThemeColorName>;
8
+ colorDisabled?: Value<ThemeColorName>;
9
+ disabled?: Value<boolean>;
10
+ withViewTransition?: boolean;
11
+ target?: Value<string>;
12
+ rel?: Value<string>;
13
+ }
14
+ export declare function generateLinkClasses(variant: LinkVariant, color: ThemeColorName, disabled: boolean): string;
15
+ export declare function Link({ href, variant, color, colorDisabled, disabled, withViewTransition, target, rel, }: LinkOptions, ...children: TNode[]): import("@tempots/dom").Renderable;
@@ -0,0 +1,23 @@
1
+ import { TNode, Value } from '@tempots/dom';
2
+ import { LinkOptions } from './link';
3
+ export type UrlMatchMode = 'exact' | 'prefix' | 'params';
4
+ export interface NavigationLinkOptions extends Omit<LinkOptions, 'disabled'> {
5
+ /**
6
+ * How to match the current URL against the link's href
7
+ * - 'exact': URL must match exactly (default)
8
+ * - 'prefix': Current URL must start with the link's href
9
+ * - 'params': Match pathname and search params, ignore hash
10
+ */
11
+ matchMode?: UrlMatchMode;
12
+ /**
13
+ * Whether to disable the link when it matches the current location
14
+ * @default true
15
+ */
16
+ disableWhenActive?: Value<boolean>;
17
+ }
18
+ export declare function isUrlMatch(location: {
19
+ pathname: string;
20
+ search: Record<string, string>;
21
+ hash?: string;
22
+ }, targetHref: string, matchMode: UrlMatchMode): boolean;
23
+ export declare function NavigationLink({ href, matchMode, disableWhenActive, ...linkOptions }: NavigationLinkOptions, ...children: TNode[]): import("@tempots/dom").Renderable;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tempots/beatui",
3
- "version": "0.4.1",
3
+ "version": "0.5.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.umd.js",
6
6
  "module": "dist/index.es.js",