@sdxc/ui 2026.10.21 → 2026.10.23
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/dist/behaviors/filter-model.js +6 -5
- package/dist/components/attachment.js +9 -1
- 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/grid-list-keys.js +0 -1
- 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/package.json +4 -3
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
8
8
|
* @copyright Sergio Xalambrí 2026
|
|
9
9
|
*/
|
|
10
|
+
import { iife } from "@sdxc/iife";
|
|
10
11
|
import { TypedEventTarget } from "remix/component";
|
|
11
12
|
import { dispatchChange } from "../utils/dispatch-change.js";
|
|
12
13
|
const DEFAULT_QUERY = "";
|
|
@@ -166,11 +167,11 @@ export class FilterModel extends TypedEventTarget {
|
|
|
166
167
|
return;
|
|
167
168
|
}
|
|
168
169
|
let index = this.#matches.findIndex((option) => option.id === this.#activeId);
|
|
169
|
-
let nextIndex =
|
|
170
|
-
|
|
171
|
-
? 0
|
|
172
|
-
|
|
173
|
-
|
|
170
|
+
let nextIndex = iife(() => {
|
|
171
|
+
if (index === -1)
|
|
172
|
+
return delta > 0 ? 0 : this.#matches.length - 1;
|
|
173
|
+
return (index + delta + this.#matches.length) % this.#matches.length;
|
|
174
|
+
});
|
|
174
175
|
let nextOption = this.#matches[nextIndex];
|
|
175
176
|
if (nextOption === undefined)
|
|
176
177
|
return;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "remix/component/jsx-runtime";
|
|
2
|
+
import { iife } from "@sdxc/iife";
|
|
2
3
|
import { bg, border, fg, outline } from "@sdxc/u/color";
|
|
3
4
|
import { rounded, transition } from "@sdxc/u/effects";
|
|
4
5
|
import { raw } from "@sdxc/u/general";
|
|
@@ -272,7 +273,14 @@ Attachment.Trigger = function AttachmentTrigger(handle) {
|
|
|
272
273
|
return () => {
|
|
273
274
|
let { href, commandfor, command, target, role, tabIndex, children, mix, ...rest } = handle.props;
|
|
274
275
|
let isConfigured = href !== undefined || commandfor !== undefined;
|
|
275
|
-
let
|
|
276
|
+
let inferredRole = iife(() => {
|
|
277
|
+
if (href !== undefined)
|
|
278
|
+
return "link";
|
|
279
|
+
if (isConfigured)
|
|
280
|
+
return "button";
|
|
281
|
+
return undefined;
|
|
282
|
+
});
|
|
283
|
+
let resolvedRole = role ?? inferredRole;
|
|
276
284
|
let resolvedTabIndex = tabIndex ?? (isConfigured ? 0 : undefined);
|
|
277
285
|
if (import.meta.env?.DEV && !isConfigured) {
|
|
278
286
|
console.warn('Attachment.Trigger: rendered with neither "href" nor "commandfor" — nothing will happen once `attachmentTrigger()` handles an activation.');
|
|
@@ -50,9 +50,7 @@ export const contextMenu = createMixin((handle) => {
|
|
|
50
50
|
cleanupAnchor = anchor(surface, point, { placement: DEFAULT_PLACEMENT, ...options });
|
|
51
51
|
}
|
|
52
52
|
return (id, options = {}, props = options) => {
|
|
53
|
-
|
|
54
|
-
options = {};
|
|
55
|
-
}
|
|
53
|
+
let resolved = props === options ? {} : options;
|
|
56
54
|
return createElement(handle.element, {
|
|
57
55
|
mix: [
|
|
58
56
|
attrs({ "aria-controls": id, "aria-haspopup": "menu" }),
|
|
@@ -65,10 +63,10 @@ export const contextMenu = createMixin((handle) => {
|
|
|
65
63
|
event.preventDefault();
|
|
66
64
|
let point = { x: event.clientX, y: event.clientY };
|
|
67
65
|
if (event.button !== SECONDARY_BUTTON) {
|
|
68
|
-
openSurfaceAt(id, point,
|
|
66
|
+
openSurfaceAt(id, point, resolved);
|
|
69
67
|
return;
|
|
70
68
|
}
|
|
71
|
-
document.addEventListener("pointerup", () => openSurfaceAt(id, point,
|
|
69
|
+
document.addEventListener("pointerup", () => openSurfaceAt(id, point, resolved), {
|
|
72
70
|
capture: true,
|
|
73
71
|
once: true,
|
|
74
72
|
signal: lifetime,
|
|
@@ -79,7 +77,7 @@ export const contextMenu = createMixin((handle) => {
|
|
|
79
77
|
return;
|
|
80
78
|
event.preventDefault();
|
|
81
79
|
let rect = event.currentTarget.getBoundingClientRect();
|
|
82
|
-
openSurfaceAt(id, { x: rect.left, y: rect.top, width: rect.width, height: rect.height },
|
|
80
|
+
openSurfaceAt(id, { x: rect.left, y: rect.top, width: rect.width, height: rect.height }, resolved);
|
|
83
81
|
}),
|
|
84
82
|
],
|
|
85
83
|
});
|
package/dist/mixins/dismiss.js
CHANGED
|
@@ -103,13 +103,11 @@ export const dismiss = createMixin((handle) => {
|
|
|
103
103
|
scheduleRemaining();
|
|
104
104
|
}
|
|
105
105
|
return (options = {}, props = options) => {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
109
|
-
let pauseOnHover = options.pauseOnHover ?? true;
|
|
106
|
+
let resolved = props === options ? {} : options;
|
|
107
|
+
let pauseOnHover = resolved.pauseOnHover ?? true;
|
|
110
108
|
if (!initialized) {
|
|
111
109
|
initialized = true;
|
|
112
|
-
duration =
|
|
110
|
+
duration = resolved.duration === undefined ? DEFAULT_DURATION : resolved.duration;
|
|
113
111
|
if (duration !== null) {
|
|
114
112
|
remaining = duration;
|
|
115
113
|
scheduleRemaining();
|
|
@@ -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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sdxc/ui",
|
|
3
|
-
"version": "2026.10.
|
|
3
|
+
"version": "2026.10.23",
|
|
4
4
|
"description": "Styled, accessible remix/component components rendered as server HTML",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -19,13 +19,14 @@
|
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@remix-run/ui": "0.12.1",
|
|
21
21
|
"@sdxc/icons": "2026.10.20",
|
|
22
|
-
"@sdxc/
|
|
22
|
+
"@sdxc/iife": "2026.10.23",
|
|
23
|
+
"@sdxc/u": "2026.10.23",
|
|
23
24
|
"@sdxc/uuid": "2026.10.13"
|
|
24
25
|
},
|
|
25
26
|
"peerDependencies": {
|
|
26
27
|
"remix": "3.0.0"
|
|
27
28
|
},
|
|
28
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "8e428ddf15290d44500a9618ec4d04bd7629fa99",
|
|
29
30
|
"publishConfig": {
|
|
30
31
|
"access": "public"
|
|
31
32
|
},
|