@mendylanda/ui 0.4.3-dev.68.e3417befc4d5 → 0.4.3-dev.70.eaaf58b8af54
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.
|
@@ -65,6 +65,11 @@ export function FilterMenuPanel({ sections, selectedId, onSelect, onClose, ancho
|
|
|
65
65
|
});
|
|
66
66
|
useEffect(() => {
|
|
67
67
|
const frame = requestAnimationFrame(() => {
|
|
68
|
+
const active = document.activeElement;
|
|
69
|
+
// A slow frame must not reset navigation or an editor the user already entered.
|
|
70
|
+
if (active !== content.current &&
|
|
71
|
+
(content.current?.contains(active) || editor.current?.contains(active)))
|
|
72
|
+
return;
|
|
68
73
|
const first = rows.current.get(initialSelection.current ?? "") ??
|
|
69
74
|
[...rows.current.values()].find((button) => !button.disabled);
|
|
70
75
|
(first ?? content.current)?.focus();
|
package/dist/sheet/parts.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { useContext, useId, useLayoutEffect, useMemo } from "react";
|
|
4
4
|
import * as Dialog from "@radix-ui/react-dialog";
|
|
5
|
-
import { Pin,
|
|
5
|
+
import { Pin, X } from "lucide-react";
|
|
6
6
|
import { Button } from "../customization.js";
|
|
7
7
|
import { useMendyLocale } from "../locale-context.js";
|
|
8
8
|
import { cn } from "../utils.js";
|
|
@@ -31,14 +31,13 @@ export function SheetClose({ onClick, ...props }) {
|
|
|
31
31
|
export function SheetPin({ onClick, ...props }) {
|
|
32
32
|
const instance = useSheetInstance();
|
|
33
33
|
const { t } = useMendyLocale();
|
|
34
|
-
if (
|
|
34
|
+
if (instance.pinned || !instance.layout?.canPin)
|
|
35
35
|
return null;
|
|
36
|
-
return (_jsx(Button, { type: "button", variant: "ghost", size: "icon", ...props, "aria-label": props["aria-label"] ?? t(
|
|
36
|
+
return (_jsx(Button, { type: "button", variant: "ghost", size: "icon", ...props, "aria-label": props["aria-label"] ?? t("sheetPin"), "aria-keyshortcuts": "P", title: props.title ?? `${t("sheetPin")} (P)`, onClick: (event) => {
|
|
37
37
|
onClick?.(event);
|
|
38
38
|
if (!event.defaultPrevented)
|
|
39
|
-
instance.setPinned(
|
|
40
|
-
}, children: props.children ??
|
|
41
|
-
(instance.pinned ? _jsx(PinOff, { "aria-hidden": "true" }) : _jsx(Pin, { "aria-hidden": "true" })) }));
|
|
39
|
+
instance.setPinned(true);
|
|
40
|
+
}, children: props.children ?? _jsx(Pin, { "aria-hidden": "true" }) }));
|
|
42
41
|
}
|
|
43
42
|
export function SheetHeader({ title, description, actions, controls = true, children, className, ...props }) {
|
|
44
43
|
const { t } = useMendyLocale();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mendylanda/ui",
|
|
3
|
-
"version": "0.4.3-dev.
|
|
3
|
+
"version": "0.4.3-dev.70.eaaf58b8af54",
|
|
4
4
|
"description": "Mendy Landa's reusable React components. Tables, filters, and sheets with shared interactions and customizable UI.",
|
|
5
5
|
"homepage": "https://ui.mendylanda.com",
|
|
6
6
|
"license": "MIT",
|
|
@@ -126,5 +126,5 @@
|
|
|
126
126
|
"build": "tsc -p tsconfig.build.json && node scripts/build-css.mjs",
|
|
127
127
|
"typecheck": "tsc -p tsconfig.build.json --noEmit"
|
|
128
128
|
},
|
|
129
|
-
"gitHead": "
|
|
129
|
+
"gitHead": "eaaf58b8af54105f1c6de74c527ff896a6af1e7f"
|
|
130
130
|
}
|