@sdxc/ui 2026.10.23 → 2026.10.24

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,33 @@
1
+ /**
2
+ * The prefetch modes every link component accepts, and the attribute value
3
+ * each mode writes, so `Link`, `NavLink`, `Pagination.Link` and the rest
4
+ * prefetch their destinations through one shared contract.
5
+ *
6
+ * @author [Sergio Xalambrí](https://sergiodxa.com)
7
+ * @copyright Sergio Xalambrí 2026
8
+ */
9
+ /**
10
+ * When a link's destination starts loading. `"intent"` and `"viewport"` hand
11
+ * the decision to the `remix/component` runtime through `data-rmx-prefetch`;
12
+ * `"render"` asks the browser through a `<link rel="prefetch">` rendered
13
+ * beside the anchor, which also serves full-document navigations; `"none"`
14
+ * loads it only on navigation.
15
+ */
16
+ export type LinkPrefetch = "none" | "intent" | "viewport" | "render";
17
+ /**
18
+ * Value for the anchor's `data-rmx-prefetch` attribute, present only for the
19
+ * modes the runtime reads.
20
+ *
21
+ * @param mode The link's prefetch mode.
22
+ * @returns `"intent"` or `"viewport"`, or `undefined` to leave the attribute off.
23
+ */
24
+ export declare function prefetchAttribute(mode: LinkPrefetch): "intent" | "viewport" | undefined;
25
+ /**
26
+ * Whether the link renders a `<link rel="prefetch">` for its destination,
27
+ * which needs both the `"render"` mode and a destination to point at.
28
+ *
29
+ * @param mode The link's prefetch mode.
30
+ * @param href The anchor's destination.
31
+ * @returns `true` when the hint belongs beside the anchor.
32
+ */
33
+ export declare function rendersPrefetchHint(mode: LinkPrefetch, href: unknown): href is string;
@@ -0,0 +1,31 @@
1
+ /**
2
+ * The prefetch modes every link component accepts, and the attribute value
3
+ * each mode writes, so `Link`, `NavLink`, `Pagination.Link` and the rest
4
+ * prefetch their destinations through one shared contract.
5
+ *
6
+ * @author [Sergio Xalambrí](https://sergiodxa.com)
7
+ * @copyright Sergio Xalambrí 2026
8
+ */
9
+ /**
10
+ * Value for the anchor's `data-rmx-prefetch` attribute, present only for the
11
+ * modes the runtime reads.
12
+ *
13
+ * @param mode The link's prefetch mode.
14
+ * @returns `"intent"` or `"viewport"`, or `undefined` to leave the attribute off.
15
+ */
16
+ export function prefetchAttribute(mode) {
17
+ if (mode === "intent" || mode === "viewport")
18
+ return mode;
19
+ return undefined;
20
+ }
21
+ /**
22
+ * Whether the link renders a `<link rel="prefetch">` for its destination,
23
+ * which needs both the `"render"` mode and a destination to point at.
24
+ *
25
+ * @param mode The link's prefetch mode.
26
+ * @param href The anchor's destination.
27
+ * @returns `true` when the hint belongs beside the anchor.
28
+ */
29
+ export function rendersPrefetchHint(mode, href) {
30
+ return mode === "render" && typeof href === "string" && href.length > 0;
31
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sdxc/ui",
3
- "version": "2026.10.23",
3
+ "version": "2026.10.24",
4
4
  "description": "Styled, accessible remix/component components rendered as server HTML",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -18,15 +18,15 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "@remix-run/ui": "0.12.1",
21
- "@sdxc/icons": "2026.10.20",
21
+ "@sdxc/icons": "2026.10.24",
22
22
  "@sdxc/iife": "2026.10.23",
23
- "@sdxc/u": "2026.10.23",
23
+ "@sdxc/u": "2026.10.24",
24
24
  "@sdxc/uuid": "2026.10.13"
25
25
  },
26
26
  "peerDependencies": {
27
- "remix": "3.0.0"
27
+ "remix": "3.1.0"
28
28
  },
29
- "gitHead": "8e428ddf15290d44500a9618ec4d04bd7629fa99",
29
+ "gitHead": "f9db0f8f1f51a256e74b94b0f4b1db4be9880370",
30
30
  "publishConfig": {
31
31
  "access": "public"
32
32
  },