diff --git a/AGENTS.md b/AGENTS.md index dae4700a5..2672dd9ef 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -131,10 +131,11 @@ 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. -- Style with Tailwind CSS v4 and the package's `mu-` utilities (`bg-mu-surface`, `text-mu-ink-muted`, `rounded-mu-md`), +- 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 text sizes or old color names (`muted-foreground`, `destructive`, `popover`). The exceptions are the brand wordmark and emoji glyphs, whose font size is their icon box (`SpaceIcon`, `SpaceMark`, `MemoViewIcon`, `CustomIconPicker`). +- Custom controls using `mu-focus` must reserve a real 1px border (transparent for borderless controls). - Focus shows through `mu-focus`. Never add `ring-*` or `focus-visible:ring-*`, and never pair `mu-focus` with `outline-none`, which overrides it. Visually hidden text uses `mu-visually-hidden`; a control that appears on focus keeps Tailwind's `sr-only focus-visible:not-sr-only` pair. diff --git a/web/package.json b/web/package.json index c3d02ca70..2892b53de 100644 --- a/web/package.json +++ b/web/package.json @@ -28,7 +28,7 @@ "@tanstack/react-query-devtools": "^5.100.9", "@usememos/canvas": "26.11.2", "@usememos/editor": "26.11.3", - "@usememos/ui": "26.11.9", + "@usememos/ui": "26.11.18", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "copy-to-clipboard": "^4.0.2", diff --git a/web/pnpm-lock.yaml b/web/pnpm-lock.yaml index 1becf528f..b465ac88d 100644 --- a/web/pnpm-lock.yaml +++ b/web/pnpm-lock.yaml @@ -45,8 +45,8 @@ importers: specifier: 26.11.3 version: 26.11.3(react-dom@19.2.6(react@19.2.6))(react@19.2.6) '@usememos/ui': - specifier: 26.11.9 - version: 26.11.9(@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.18 + version: 26.11.18(@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 @@ -973,8 +973,8 @@ packages: react-dom: optional: true - '@usememos/ui@26.11.9': - resolution: {integrity: sha512-rO0rmjrSwjMO60ftTV6yrmzrctF0Xtdqd8iT77vTYtVhd2ehl2KIqwym46nCLeQcp44oYFFt8rjtI6+Eqj57Aw==} + '@usememos/ui@26.11.18': + resolution: {integrity: sha512-+KaFiHeKSDhyDBxyhHysbfroAMOBq+fsOhbbq8EZIO0r68+pb2XKAxGnn+/6ZbXkb0zcvomf0gd01MGxX2U1+Q==} peerDependencies: '@base-ui/react': 1.9.0 lucide-react: '>=1.0.0' @@ -2392,7 +2392,7 @@ snapshots: react: 19.2.6 react-dom: 19.2.6(react@19.2.6) - '@usememos/ui@26.11.9(@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.18(@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) diff --git a/web/src/components/ActivityCalendar/MonthCalendar.tsx b/web/src/components/ActivityCalendar/MonthCalendar.tsx index 2efcb4e9a..18b155b5d 100644 --- a/web/src/components/ActivityCalendar/MonthCalendar.tsx +++ b/web/src/components/ActivityCalendar/MonthCalendar.tsx @@ -15,7 +15,7 @@ import { calculateMaxCount, getTooltipText } from "./utils"; */ const CALENDAR_GRID_CLASSES = "grid grid-cols-[repeat(7,28px)] justify-between gap-y-1"; /** Weekday initials: caption weight in muted ink, so they sit under the day numbers rather than beside them. */ -export const WEEKDAY_LABEL_CLASSES = "mu-caption text-mu-ink-muted"; +export const WEEKDAY_LABEL_CLASSES = "mu-caption text-mu-text-secondary"; /** Localized weekday labels starting on the instance's first day of the week. */ export const useWeekdayLabels = (weekStartDayOffset: number) => { diff --git a/web/src/components/ActivityCalendar/cellStyles.ts b/web/src/components/ActivityCalendar/cellStyles.ts index 127d34d1b..3a319493e 100644 --- a/web/src/components/ActivityCalendar/cellStyles.ts +++ b/web/src/components/ActivityCalendar/cellStyles.ts @@ -14,17 +14,17 @@ const CHIP_BASE = const INTERACTIVE_CHIP = "group-hover/day:brightness-[0.97] group-focus-visible/day:outline-2 group-focus-visible/day:outline-solid group-focus-visible/day:-outline-offset-2 group-focus-visible/day:outline-mu-focus"; -const OUTSIDE_MONTH_CHIP = "bg-transparent text-mu-ink-muted/25"; -const EMPTY_CHIP = "bg-transparent text-mu-ink/75 group-hover/day:bg-mu-well/40"; +const OUTSIDE_MONTH_CHIP = "bg-transparent text-mu-text-secondary/25"; +const EMPTY_CHIP = "bg-transparent text-mu-text/75 group-hover/day:bg-mu-well/40"; /** A picked day is a checked filter like a view or tag row: it takes the accent, not a ring. */ const SELECTED_CHIP = "z-10 bg-mu-primary text-mu-on-primary"; /** Primary-tinted activity levels; the small chip can carry a stronger wash than a full day cell. */ const INTENSITY_TINTS: Record, string> = { - 1: "bg-mu-primary/12 text-mu-ink/75", - 2: "bg-mu-primary/22 text-mu-ink/80", - 3: "bg-mu-primary/34 text-mu-ink/80", - 4: "bg-mu-primary/48 text-mu-ink/85", + 1: "bg-mu-primary/12 text-mu-text/75", + 2: "bg-mu-primary/22 text-mu-text/80", + 3: "bg-mu-primary/34 text-mu-text/80", + 4: "bg-mu-primary/48 text-mu-text/85", }; /** diff --git a/web/src/components/AppSidebar/AppSidebar.tsx b/web/src/components/AppSidebar/AppSidebar.tsx index 46e419403..aad7b245a 100644 --- a/web/src/components/AppSidebar/AppSidebar.tsx +++ b/web/src/components/AppSidebar/AppSidebar.tsx @@ -304,7 +304,7 @@ const NavPill = ({ label, icon: Icon, to, onClick, active = false, expanded = fa "aria-current": active ? ("page" as const) : undefined, className: cn( sidebarSurfaceVariants({ role: "navPill" }), - "mu-focus", + "border border-transparent mu-focus focus-visible:border-mu-focus", sidebarRowStateClasses(active ? "current" : "idle"), // The one pill with an open label gives way first, so the row always ends on the rail. expanded && "min-w-0 shrink", @@ -392,7 +392,7 @@ const AppSidebar = ({ className }: { className?: string }) => { const { setMobileOpen } = useAppSidebar(); const { canOpen: canCompose, openEditor } = useGlobalMemoEditor(); return ( -