chore(web): upgrade @usememos/ui to 26.11.25

This commit is contained in:
boojack
2026-11-17 23:18:15 +08:00
parent 6251f8ae8e
commit aa63737191
22 changed files with 47 additions and 30 deletions
+2 -1
View File
@@ -132,7 +132,8 @@ Black-box service tests live in `server/api/test/`, unit tests next to the code.
components). Controls come from the package; build a part it lacks on Base UI as its `custom-components.md` describes.
- Use a package component when one fits (`Button`, `Link`, `Spinner`, `Badge`). Its class functions (`buttonClasses()`,
`menuClasses()`, `badgeClasses()`) are for elements it can't render, such as a router link or a Base UI trigger.
- Action menus use `md`, including custom rows styled with `menuClasses()`. Compact three-dot trigger buttons keep `sm`.
- Menus have fixed density; do not pass `size` to `Menu.Root` or `menuClasses()`, or use `mu-compact` to size menu rows.
Compact three-dot trigger buttons keep `sm`.
- Field text follows its component size on every device; do not add touch-specific font sizing.
- Style with Tailwind CSS v4 and the package's `mu-` utilities (`bg-mu-surface`, `text-mu-text-secondary`, `rounded-mu-md`),
text with its type classes (`mu-caption`, `mu-body`, `mu-label`, `mu-title`), and `cn()` for class merging. No Tailwind
+1 -1
View File
@@ -29,7 +29,7 @@
"@tanstack/react-query-devtools": "^5.100.9",
"@usememos/canvas": "26.11.3",
"@usememos/editor": "26.11.5",
"@usememos/ui": "26.11.23",
"@usememos/ui": "26.11.25",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"copy-to-clipboard": "^4.0.2",
+5 -5
View File
@@ -45,8 +45,8 @@ importers:
specifier: 26.11.5
version: 26.11.5(react-dom@19.2.6(react@19.2.6))(react@19.2.6)
'@usememos/ui':
specifier: 26.11.23
version: 26.11.23(@base-ui/react@1.9.0(@types/react@19.2.14)(react-dom@19.2.6(react@19.2.6))(react@19.2.6))(lucide-react@1.34.0(react@19.2.6))(react-dom@19.2.6(react@19.2.6))(react@19.2.6)
specifier: 26.11.25
version: 26.11.25(@base-ui/react@1.9.0(@types/react@19.2.14)(react-dom@19.2.6(react@19.2.6))(react@19.2.6))(lucide-react@1.34.0(react@19.2.6))(react-dom@19.2.6(react@19.2.6))(react@19.2.6)
class-variance-authority:
specifier: ^0.7.1
version: 0.7.1
@@ -981,8 +981,8 @@ packages:
react-dom:
optional: true
'@usememos/ui@26.11.23':
resolution: {integrity: sha512-fC3dyMDAASe407AcTHZ5kXM1U35Y+WvrXWHryQveSyMupaMeun3qUjE5HGPV56fGnYhydqYGApeQ/WvTrAQQVA==}
'@usememos/ui@26.11.25':
resolution: {integrity: sha512-kD0v47wcZVRrOdDHvTN5EanGiOi7Vlo9i+TcjVirFBA4whUgPt14H38r9Q0cXCThngVwfWoYfeDWiMqg4PpkSA==}
peerDependencies:
'@base-ui/react': 1.9.0
lucide-react: '>=1.0.0'
@@ -2414,7 +2414,7 @@ snapshots:
react: 19.2.6
react-dom: 19.2.6(react@19.2.6)
'@usememos/ui@26.11.23(@base-ui/react@1.9.0(@types/react@19.2.14)(react-dom@19.2.6(react@19.2.6))(react@19.2.6))(lucide-react@1.34.0(react@19.2.6))(react-dom@19.2.6(react@19.2.6))(react@19.2.6)':
'@usememos/ui@26.11.25(@base-ui/react@1.9.0(@types/react@19.2.14)(react-dom@19.2.6(react@19.2.6))(react@19.2.6))(lucide-react@1.34.0(react@19.2.6))(react-dom@19.2.6(react@19.2.6))(react@19.2.6)':
dependencies:
'@base-ui/react': 1.9.0(@types/react@19.2.14)(react-dom@19.2.6(react@19.2.6))(react@19.2.6)
lucide-react: 1.34.0(react@19.2.6)
@@ -96,7 +96,7 @@ const TagsSection = ({ tagCount, onSelect, scope }: Props) => {
<SidebarSection
label={t("common.tags")}
action={
<Menu.Root modal={false} size="md">
<Menu.Root modal={false}>
<Tooltip.Root>
<Tooltip.Trigger
render={
@@ -106,7 +106,7 @@ const ViewsSection = ({ manageActive = false }: { manageActive?: boolean }) => {
</span>
<span className="min-w-0 flex-1 truncate">{memoView.title}</span>
</button>
<Menu.Root modal={false} size="md">
<Menu.Root modal={false}>
<Menu.Trigger
nativeButton={false}
render={
@@ -39,8 +39,8 @@ export const sidebarSurfaceVariants = cva("min-w-0 items-center", {
});
/**
* The scope panel that opens from the sidebar title is a list Popover with `mu-compact`, so its
* rows are the package's menu rows at 28px. Each keeps a 20px leading slot, so icons, the avatar
* The scope panel that opens from the sidebar title is a list Popover whose menu rows use the
* package's fixed 28px density. Each keeps a 20px leading slot, so icons, the avatar
* and Space marks share one column; a Popover sets no highlight, so the rows add their own hover.
* A row whose own menu is open takes the package's highlight.
*/
@@ -65,7 +65,11 @@ const AttachmentMediaCard = ({ item, creator, onPreview }: { item: AttachmentLib
{item.filename}
</div>
{item.kind === "motion" && <Badge tone="outline">{t("attachment-library.labels.live")}</Badge>}
{item.kind === "motion" && (
<Badge size="xs" tone="outline">
{t("attachment-library.labels.live")}
</Badge>
)}
</div>
<AttachmentMetadataLine
@@ -519,7 +519,7 @@ const DrawingSheet = ({
</FloatingRow>
<FloatingRow edge="bottom" className="justify-start max-sm:bottom-[calc(64px+env(safe-area-inset-bottom))]">
<FloatingAction>
<Menu.Root size="md" open={zoomMenuOpen} onOpenChange={setZoomMenuOpen}>
<Menu.Root open={zoomMenuOpen} onOpenChange={setZoomMenuOpen}>
<Menu.Trigger
render={
<Button
@@ -32,7 +32,7 @@ import type { MemoActionMenuProps } from "./types";
* only Restore and Delete, and a viewer only Open and Copy.
*/
/** The open link is a real link, so its row takes the package's menu row classes. */
const MENU_ROW_CLASSES = menuClasses({ size: "md" });
const MENU_ROW_CLASSES = menuClasses();
const MemoActionMenu = (props: MemoActionMenuProps) => {
const { memo, parentPage, readonly } = props;
@@ -163,7 +163,7 @@ const MemoActionMenu = (props: MemoActionMenuProps) => {
};
return (
<Menu.Root modal={false} size="md">
<Menu.Root modal={false}>
<Tooltip.Root>
<Tooltip.Trigger
render={<Menu.Trigger render={<Button variant="ghost" size="sm" aria-label={t("common.more")} icon={<MoreVerticalIcon />} />} />}
@@ -42,7 +42,7 @@ const AudienceMenu = ({ value, onChange, space, onSpaceChange, disabled }: Audie
];
return (
<Menu.Root modal={false} size="md">
<Menu.Root modal={false}>
{/* The trigger starts with an icon (a space mark or the lock) inside a span, so it takes the
package's icon-side padding itself; its gaps are the md icon gap, like a Button's. */}
<Menu.Trigger
@@ -136,7 +136,7 @@ const InsertMenu = (props: InsertMenuProps) => {
return (
<>
<Menu.Root modal={false} size="md">
<Menu.Root modal={false}>
<Tooltip.Root>
<Tooltip.Trigger
render={
@@ -224,7 +224,7 @@ const AttachmentTile: FC<{
))}
</div>
<div className="hidden pointer-coarse:flex">
<Menu.Root modal={false} size="md">
<Menu.Root modal={false}>
<Menu.Trigger
render={<Button variant="neutral" size="sm" icon={<EllipsisIcon />} aria-label={t("common.more")} onClick={stop} />}
/>
@@ -121,7 +121,7 @@ const MemoHeader: React.FC<MemoHeaderProps> = ({ timeDisplay = "relative", showC
const NewBadge = () => {
const t = useTranslate();
return (
<Badge tone="primary" className="shrink-0">
<Badge size="xs" tone="primary" className="shrink-0">
{t("memo.new-badge")}
</Badge>
);
+3 -1
View File
@@ -225,7 +225,9 @@ const AISection = () => {
<div>
<div className="flex max-w-3xl flex-col gap-2">
<div className="flex flex-wrap items-center gap-2">
<Badge tone="outline">{t("setting.ai.byok-label")}</Badge>
<Badge size="xs" tone="outline">
{t("setting.ai.byok-label")}
</Badge>
<h4 className="mu-label text-mu-text">{t("setting.ai.byok-title")}</h4>
</div>
<p className="mu-body text-mu-text-secondary">{t("setting.ai.byok-description")}</p>
@@ -153,7 +153,7 @@ const LinkedIdentitySection = () => {
<div className="min-w-0 flex-1 space-y-2">
<div className="flex flex-wrap items-center gap-2">
<span className="min-w-0 mu-label break-words text-mu-text">{row.title}</span>
<Badge>{row.typeLabel}</Badge>
<Badge size="xs">{row.typeLabel}</Badge>
</div>
<div className="flex flex-wrap items-center gap-2">
<InfoChip label={t("setting.sso.provider-uid")} value={row.providerUid} />
+1 -1
View File
@@ -130,7 +130,7 @@ const SSOSection = () => {
<div className="min-w-0 flex-1 space-y-2">
<div className="flex flex-wrap items-center gap-2">
<span className="min-w-0 mu-label break-words text-mu-text">{row.title}</span>
<Badge>{row.typeLabel}</Badge>
<Badge size="xs">{row.typeLabel}</Badge>
</div>
<div className="flex flex-wrap items-center gap-2">
<InfoChip label={t("setting.sso.provider-uid")} value={row.providerUid} />
@@ -297,7 +297,7 @@ const StorageSection = () => {
{option.badges && (
<span className="flex flex-wrap gap-1.5 ps-6">
{option.badges.map((badge) => (
<Badge key={badge} tone={badge === "setting.storage.badge-recommended" ? "neutral" : "outline"}>
<Badge key={badge} size="xs" tone={badge === "setting.storage.badge-recommended" ? "neutral" : "outline"}>
{t(badge)}
</Badge>
))}
+3 -1
View File
@@ -222,7 +222,9 @@ const TagsSection = () => {
<h4 id={configuredRulesId} className="mu-label text-mu-text-secondary">
{t("setting.tags.configured-rules")}
</h4>
<Badge tone="outline">{configuredEntries.length}</Badge>
<Badge size="xs" tone="outline">
{configuredEntries.length}
</Badge>
</div>
{configuredEntries.length === 0 ? (
+2 -2
View File
@@ -49,14 +49,14 @@ const PreferenceSubmenu = ({ icon: Icon, label, value, options, onChange, classN
</span>
<ChevronRightIcon aria-hidden="true" className={cn(SCOPE_PANEL_ICON_CLASSES, "rtl:rotate-180")} />
</Menu.Trigger>
{/* Like a nested submenu: its first row lines up with this one, and its rows match the panel's (`mu-compact`).
{/* Like a nested submenu: its first row lines up with this one, and its rows match the panel's fixed menu density.
When neither side has room (narrow screens), it drops below the row instead of overflowing. */}
<Menu.Popup
side="inline-end"
align="start"
collisionAvoidance={{ fallbackAxisSide: "end" }}
positionMethod="fixed"
className={cn("mu-compact", className)}
className={className}
>
<Menu.RadioGroup value={value} onValueChange={onChange}>
{options.map((option) => (
+5 -1
View File
@@ -99,7 +99,11 @@ const About = () => {
{versionLabel}
</Chip>
)}
{profile.demo && <Badge tone="warning">{t("about.demo")}</Badge>}
{profile.demo && (
<Badge size="xs" tone="warning">
{t("about.demo")}
</Badge>
)}
</div>
)}
</div>
+5 -1
View File
@@ -596,7 +596,11 @@ const MemoViews = () => {
<div className="flex flex-col gap-3">
<div className="flex items-center justify-between">
<h2 className="mu-label text-mu-text">{t("setting.memo-view.all")}</h2>
{!isPending && !isError && <Badge tone="outline">{memoViews.length}</Badge>}
{!isPending && !isError && (
<Badge size="xs" tone="outline">
{memoViews.length}
</Badge>
)}
</div>
{isPending ? (
+2 -2
View File
@@ -601,7 +601,7 @@ describe("App sidebar logo", () => {
expect(sidebarState.setMobileOpen).toHaveBeenCalledWith(false);
});
it("uses md text-only actions for a saved view", async () => {
it("uses fixed-density text-only actions for a saved view", async () => {
authState.memoViews = [{ name: "memoViews/1", title: "testgp" }];
render(
<MemoryRouter initialEntries={["/"]}>
@@ -612,7 +612,7 @@ describe("App sidebar logo", () => {
fireEvent.click(screen.getByRole("button", { name: "common.edit testgp" }));
const menu = await screen.findByRole("menu");
expect(menu.closest(".mu-s-md") ?? menu.querySelector(".mu-s-md")).not.toBeNull();
expect(menu).toHaveClass("mu-s-sm");
const editItem = screen.getByRole("menuitem", { name: "common.edit" });
const deleteItem = screen.getByRole("menuitem", { name: "common.delete" });
expect(editItem.querySelector("svg")).toBeNull();