@sdxc/ui 2026.10.21 → 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.
- package/README.md +4 -0
- package/dist/behaviors/filter-model.js +6 -5
- package/dist/components/attachment.js +9 -1
- package/dist/components/breadcrumbs.d.ts +17 -3
- package/dist/components/breadcrumbs.js +5 -3
- package/dist/components/group.js +3 -2
- package/dist/components/link-button.d.ts +14 -1
- package/dist/components/link-button.js +173 -169
- package/dist/components/link.d.ts +14 -1
- package/dist/components/link.js +63 -59
- package/dist/components/nav-link.d.ts +14 -1
- package/dist/components/nav-link.js +61 -57
- package/dist/components/navigation-menu.d.ts +12 -0
- package/dist/components/navigation-menu.js +15 -6
- package/dist/components/pagination.d.ts +17 -4
- package/dist/components/pagination.js +14 -7
- package/dist/components/sidebar.d.ts +18 -0
- package/dist/components/sidebar.js +22 -9
- package/dist/mixins/active-descendant-keys.d.ts +33 -3
- package/dist/mixins/active-descendant-keys.js +101 -13
- package/dist/mixins/calendar-keys.js +0 -1
- package/dist/mixins/carousel-controls.js +0 -1
- package/dist/mixins/context-menu.js +4 -6
- package/dist/mixins/dismiss.js +3 -5
- package/dist/mixins/frame-refresh.d.ts +30 -0
- package/dist/mixins/frame-refresh.js +85 -0
- package/dist/mixins/frame-submit.d.ts +65 -0
- package/dist/mixins/frame-submit.js +104 -0
- package/dist/mixins/grid-list-keys.js +0 -1
- package/dist/mixins/index.d.ts +2 -0
- package/dist/mixins/index.js +2 -0
- package/dist/mixins/long-press.js +2 -4
- package/dist/mixins/menu-keys.js +2 -3
- package/dist/mixins/menubar-keys.js +3 -4
- package/dist/mixins/message-follow.js +0 -1
- package/dist/mixins/theme-toggle.js +2 -4
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/link-prefetch.d.ts +33 -0
- package/dist/utils/link-prefetch.js +31 -0
- package/package.json +6 -5
package/dist/mixins/index.d.ts
CHANGED
|
@@ -26,6 +26,8 @@ export * from "./dismiss.js";
|
|
|
26
26
|
export * from "./drag-reorder.js";
|
|
27
27
|
export * from "./drop-zone.js";
|
|
28
28
|
export * from "./dual-range.js";
|
|
29
|
+
export * from "./frame-refresh.js";
|
|
30
|
+
export * from "./frame-submit.js";
|
|
29
31
|
export * from "./grid-list-keys.js";
|
|
30
32
|
export * from "./heading-level-fallback.js";
|
|
31
33
|
export * from "./hotkey.js";
|
package/dist/mixins/index.js
CHANGED
|
@@ -26,6 +26,8 @@ export * from "./dismiss.js";
|
|
|
26
26
|
export * from "./drag-reorder.js";
|
|
27
27
|
export * from "./drop-zone.js";
|
|
28
28
|
export * from "./dual-range.js";
|
|
29
|
+
export * from "./frame-refresh.js";
|
|
30
|
+
export * from "./frame-submit.js";
|
|
29
31
|
export * from "./grid-list-keys.js";
|
|
30
32
|
export * from "./heading-level-fallback.js";
|
|
31
33
|
export * from "./hotkey.js";
|
|
@@ -84,10 +84,8 @@ export const longPress = createMixin((handle) => {
|
|
|
84
84
|
origin = undefined;
|
|
85
85
|
}
|
|
86
86
|
return (options = {}, props = options) => {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
let duration = options.duration ?? DEFAULT_DURATION;
|
|
87
|
+
let resolved = props === options ? {} : options;
|
|
88
|
+
let duration = resolved.duration ?? DEFAULT_DURATION;
|
|
91
89
|
return createElement(handle.element, {
|
|
92
90
|
mix: [
|
|
93
91
|
on("pointerdown", (event) => {
|
package/dist/mixins/menu-keys.js
CHANGED
|
@@ -47,9 +47,8 @@ export const menuKeys = createMixin((_handle) => {
|
|
|
47
47
|
let buffer = "";
|
|
48
48
|
let resetBufferId;
|
|
49
49
|
return (options = {}, props = options) => {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
let selector = options.itemSelector ?? DEFAULT_ITEM_SELECTOR;
|
|
50
|
+
let resolved = props === options ? {} : options;
|
|
51
|
+
let selector = resolved.itemSelector ?? DEFAULT_ITEM_SELECTOR;
|
|
53
52
|
return ref((host, signal) => {
|
|
54
53
|
let initialItems = queryItems(host, selector);
|
|
55
54
|
if (initialItems.length > 0)
|
|
@@ -122,10 +122,9 @@ export const menubarKeys = createMixin((_handle) => {
|
|
|
122
122
|
let buffer = "";
|
|
123
123
|
let resetBufferId;
|
|
124
124
|
return (options = {}, props = options) => {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
let
|
|
128
|
-
let itemSelector = options.itemSelector ?? DEFAULT_ITEM_SELECTOR;
|
|
125
|
+
let resolved = props === options ? {} : options;
|
|
126
|
+
let triggerSelector = resolved.triggerSelector ?? DEFAULT_TRIGGER_SELECTOR;
|
|
127
|
+
let itemSelector = resolved.itemSelector ?? DEFAULT_ITEM_SELECTOR;
|
|
129
128
|
return ref((host, signal) => {
|
|
130
129
|
let initialTriggers = queryTriggers(host, triggerSelector);
|
|
131
130
|
if (initialTriggers.length > 0)
|
|
@@ -126,10 +126,8 @@ function applyMode(mode) {
|
|
|
126
126
|
*/
|
|
127
127
|
export const themeToggle = createMixin((handle) => {
|
|
128
128
|
return (options = {}, props = options) => {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
}
|
|
132
|
-
let cookieName = options.cookieName ?? THEME_COOKIE_NAME;
|
|
129
|
+
let resolved = props === options ? {} : options;
|
|
130
|
+
let cookieName = resolved.cookieName ?? THEME_COOKIE_NAME;
|
|
133
131
|
return createElement(handle.element, {
|
|
134
132
|
mix: [
|
|
135
133
|
on("command", (event) => {
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ export * from "./hue-spectrum.js";
|
|
|
24
24
|
export * from "./is-new-primary-press.js";
|
|
25
25
|
export * from "./key-combo.js";
|
|
26
26
|
export * from "./keyboard-nav.js";
|
|
27
|
+
export * from "./link-prefetch.js";
|
|
27
28
|
export * from "./merge-style.js";
|
|
28
29
|
export * from "./paired-range-inputs.js";
|
|
29
30
|
export * from "./placement.js";
|
package/dist/utils/index.js
CHANGED
|
@@ -24,6 +24,7 @@ export * from "./hue-spectrum.js";
|
|
|
24
24
|
export * from "./is-new-primary-press.js";
|
|
25
25
|
export * from "./key-combo.js";
|
|
26
26
|
export * from "./keyboard-nav.js";
|
|
27
|
+
export * from "./link-prefetch.js";
|
|
27
28
|
export * from "./merge-style.js";
|
|
28
29
|
export * from "./paired-range-inputs.js";
|
|
29
30
|
export * from "./placement.js";
|
|
@@ -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.
|
|
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,14 +18,15 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@remix-run/ui": "0.12.1",
|
|
21
|
-
"@sdxc/icons": "2026.10.
|
|
22
|
-
"@sdxc/
|
|
21
|
+
"@sdxc/icons": "2026.10.24",
|
|
22
|
+
"@sdxc/iife": "2026.10.23",
|
|
23
|
+
"@sdxc/u": "2026.10.24",
|
|
23
24
|
"@sdxc/uuid": "2026.10.13"
|
|
24
25
|
},
|
|
25
26
|
"peerDependencies": {
|
|
26
|
-
"remix": "3.
|
|
27
|
+
"remix": "3.1.0"
|
|
27
28
|
},
|
|
28
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "f9db0f8f1f51a256e74b94b0f4b1db4be9880370",
|
|
29
30
|
"publishConfig": {
|
|
30
31
|
"access": "public"
|
|
31
32
|
},
|