mirror of
https://github.com/usememos/memos.git
synced 2026-11-19 10:29:11 +01:00
chore: upgrade ui lib
This commit is contained in:
@@ -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.
|
||||
|
||||
+1
-1
@@ -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",
|
||||
|
||||
Generated
+5
-5
@@ -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)
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
@@ -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<Exclude<ActivityLevel, 0>, 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",
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -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 (
|
||||
<aside className={cn("mu-compact flex h-full w-full select-none flex-col bg-mu-canvas text-mu-ink-muted", className)}>
|
||||
<aside className={cn("mu-compact flex h-full w-full select-none flex-col bg-mu-canvas text-mu-text-secondary", className)}>
|
||||
<div data-sidebar-header className={cn("flex h-13 shrink-0 items-center justify-between gap-2", SIDEBAR_RAIL_CLASSES)}>
|
||||
<SpaceSwitcher className="min-w-0" size="header" />
|
||||
{canCompose && <NewMemoAction onClick={openEditor} />}
|
||||
@@ -409,18 +409,18 @@ const AppSidebar = ({ className }: { className?: string }) => {
|
||||
onClick={() => setMobileOpen(false)}
|
||||
className={cn(
|
||||
sidebarSurfaceVariants({ role: "account" }),
|
||||
"group mu-label text-mu-ink transition-colors hover:bg-mu-hover mu-focus",
|
||||
"group mu-label text-mu-text transition-colors hover:bg-mu-hover border border-transparent mu-focus focus-visible:border-mu-focus",
|
||||
)}
|
||||
>
|
||||
<span className={SIDEBAR_LEADING_SLOT_CLASSES}>
|
||||
<UserRoundIcon className="mu-icon me-auto text-mu-ink-muted" />
|
||||
<UserRoundIcon className="mu-icon me-auto text-mu-text-secondary" />
|
||||
</span>
|
||||
<span data-sidebar-label className="min-w-0 flex-1 truncate">
|
||||
{t("common.sign-in-to-memos")}
|
||||
</span>
|
||||
<ArrowRightIcon
|
||||
data-sidebar-trailing
|
||||
className="mu-icon-sm shrink-0 text-mu-ink-muted/60 transition-transform group-hover:translate-x-0.5 rtl:rotate-180 rtl:group-hover:-translate-x-0.5"
|
||||
className="mu-icon-sm shrink-0 text-mu-text-secondary/60 transition-transform group-hover:translate-x-0.5 rtl:rotate-180 rtl:group-hover:-translate-x-0.5"
|
||||
/>
|
||||
</Link>
|
||||
</footer>
|
||||
|
||||
@@ -54,7 +54,7 @@ const CommonSidebarContent = () => {
|
||||
<span className="min-w-0 flex-1 truncate">{t(resource.labelKey)}</span>
|
||||
<ExternalLinkIcon
|
||||
aria-hidden="true"
|
||||
className="mu-icon-xs shrink-0 text-mu-ink-muted/50 transition-colors group-hover:text-mu-ink/70"
|
||||
className="mu-icon-xs shrink-0 text-mu-text-secondary/50 transition-colors group-hover:text-mu-text/70"
|
||||
/>
|
||||
</a>
|
||||
))}
|
||||
|
||||
@@ -157,7 +157,7 @@ const QuickFindDialog = () => {
|
||||
</Dialog.Description>
|
||||
<form onSubmit={handleSubmit}>
|
||||
<div className="flex items-center justify-between gap-3 border-b border-mu-line/50 px-4 py-2">
|
||||
<span className="min-w-0 truncate mu-caption text-mu-ink-muted" title={scopeLabel}>
|
||||
<span className="min-w-0 truncate mu-caption text-mu-text-secondary" title={scopeLabel}>
|
||||
{compactScopeLabel}
|
||||
</span>
|
||||
<ToggleGroup
|
||||
@@ -188,13 +188,13 @@ const QuickFindDialog = () => {
|
||||
aria-describedby={hintId}
|
||||
/>
|
||||
<div className="flex items-end justify-between gap-3">
|
||||
<div className="min-w-0 space-y-1 mu-caption text-mu-ink-muted">
|
||||
<div className="min-w-0 space-y-1 mu-caption text-mu-text-secondary">
|
||||
<p id={hintId}>{t("search.keyboard-hint")}</p>
|
||||
<a
|
||||
href="https://usememos.com/docs/usage/shortcuts#filter-expression-syntax"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="inline-block underline underline-offset-2 hover:text-mu-ink"
|
||||
className="inline-block underline underline-offset-2 hover:text-mu-text"
|
||||
>
|
||||
{t("search.syntax-help")}
|
||||
</a>
|
||||
@@ -206,12 +206,12 @@ const QuickFindDialog = () => {
|
||||
</div>
|
||||
) : (
|
||||
<div className="flex h-[52px] shrink-0 items-center gap-2.5 px-4">
|
||||
<SearchIcon className="mu-icon size-[17px] shrink-0 text-mu-ink-muted" />
|
||||
<SearchIcon className="mu-icon size-[17px] shrink-0 text-mu-text-secondary" />
|
||||
{/* The dialog's own field, focused whenever it is open: the caret marks focus, as in a
|
||||
command palette, so it draws no outline around the borderless header. */}
|
||||
<input
|
||||
{...fieldProps}
|
||||
className="h-10 min-w-0 flex-1 bg-transparent mu-body outline-none placeholder:text-mu-ink-muted"
|
||||
className="h-10 min-w-0 flex-1 bg-transparent mu-body outline-none placeholder:text-mu-text-secondary"
|
||||
placeholder={`${t("common.search")} ${compactScopeLabel}`}
|
||||
aria-label={`${t("common.search")} ${scopeLabel}`}
|
||||
/>
|
||||
|
||||
@@ -48,7 +48,7 @@ const INDICATORS = {
|
||||
grip: {
|
||||
base: "h-8 w-1 rounded-full transition-[background-color,opacity] duration-150",
|
||||
dragging: "bg-mu-primary/70 opacity-100",
|
||||
rest: "bg-mu-ink-muted/50 opacity-0 group-hover:opacity-100 group-focus-visible:bg-mu-primary/70 group-focus-visible:opacity-100",
|
||||
rest: "bg-mu-text-secondary/50 opacity-0 group-hover:opacity-100 group-focus-visible:bg-mu-primary/70 group-focus-visible:opacity-100",
|
||||
},
|
||||
} as const;
|
||||
|
||||
|
||||
@@ -12,19 +12,19 @@ import { SCOPE_PANEL_ICON_CLASSES, SIDEBAR_LEADING_SLOT_CLASSES, sidebarSurfaceV
|
||||
*/
|
||||
export const SIDEBAR_ROW_BOX_CLASSES = `${sidebarSurfaceVariants({ role: "row" })} group transition-colors`;
|
||||
|
||||
export const SIDEBAR_ROW_CLASSES = `${SIDEBAR_ROW_BOX_CLASSES} mu-focus`;
|
||||
export const SIDEBAR_ROW_CLASSES = `${SIDEBAR_ROW_BOX_CLASSES} border border-transparent mu-focus focus-visible:border-mu-focus`;
|
||||
|
||||
export const SIDEBAR_ROW_ICON_CLASSES =
|
||||
// The md row's 16px icon at the md stroke, beside its 14px label, in the row's own muted ink.
|
||||
"mu-icon me-auto shrink-0 group-data-checked:text-mu-primary";
|
||||
const SIDEBAR_ROW_COUNT_CLASSES = "mu-caption tabular-nums text-mu-ink-muted group-data-checked:text-mu-primary";
|
||||
const SIDEBAR_ROW_COUNT_CLASSES = "mu-caption tabular-nums text-mu-text-secondary group-data-checked:text-mu-primary";
|
||||
|
||||
/**
|
||||
* The focusable body of a split row — rows whose box is a wrapper carrying other controls
|
||||
* put their label layout and focus ring here. The gap must stay equal to the box's own
|
||||
* `gap-1` or slot alignment breaks between one-control and split rows.
|
||||
*/
|
||||
export const SIDEBAR_ROW_LABEL_CLASSES = `flex h-full min-w-0 flex-1 items-center gap-1 text-start mu-focus`;
|
||||
export const SIDEBAR_ROW_LABEL_CLASSES = `flex h-full min-w-0 flex-1 items-center gap-1 text-start border border-transparent mu-focus focus-visible:border-mu-focus`;
|
||||
|
||||
/**
|
||||
* Fixed leading slot: a 20px column begins on the artwork rail. Small glyphs pin to its
|
||||
@@ -34,7 +34,7 @@ export const SIDEBAR_ROW_LABEL_CLASSES = `flex h-full min-w-0 flex-1 items-cente
|
||||
export const SIDEBAR_ROW_SLOT_CLASSES = SIDEBAR_LEADING_SLOT_CLASSES;
|
||||
|
||||
/** A slot that is itself a control (disclosure, row menu): same box plus the hover chip. */
|
||||
export const SIDEBAR_ROW_SLOT_BUTTON_CLASSES = `${SIDEBAR_ROW_SLOT_CLASSES} relative rounded hover:bg-mu-hover after:absolute after:-inset-0.5 after:content-[''] mu-focus`;
|
||||
export const SIDEBAR_ROW_SLOT_BUTTON_CLASSES = `${SIDEBAR_ROW_SLOT_CLASSES} relative rounded hover:bg-mu-hover after:absolute after:-inset-0.5 after:content-[''] border border-transparent mu-focus focus-visible:border-mu-focus`;
|
||||
|
||||
/** Trailing rail for counts, wide enough that digits align down the list. */
|
||||
export const SIDEBAR_ROW_COUNT_RAIL_CLASSES = `${SIDEBAR_ROW_COUNT_CLASSES} min-w-[3ch] shrink-0 text-end`;
|
||||
@@ -64,16 +64,16 @@ export const ScopePanelRowIcon = ({ icon: Icon, className }: { icon: LucideIcon;
|
||||
*/
|
||||
export type SidebarRowState = "idle" | "current" | "checked";
|
||||
|
||||
const SIDEBAR_ROW_HOVER_CLASSES = "hover:bg-mu-hover/65 hover:text-mu-ink";
|
||||
const SIDEBAR_ROW_HOVER_CLASSES = "hover:bg-mu-hover/65 hover:text-mu-text";
|
||||
|
||||
export const sidebarRowStateClasses = (state: SidebarRowState = "idle") => {
|
||||
// Selection never changes weight (the type rules), so labels do not shift: fill and color carry it.
|
||||
if (state === "current") return "bg-mu-hover text-mu-ink";
|
||||
if (state === "current") return "bg-mu-hover text-mu-text";
|
||||
if (state === "checked") {
|
||||
// The mark hangs in the rail's 12px inset so the label stays on its rail.
|
||||
return `relative text-mu-ink ${SIDEBAR_ROW_HOVER_CLASSES} before:absolute before:inset-y-1.5 before:-start-3 before:w-0.5 before:rounded-e-full before:bg-mu-primary before:content-['']`;
|
||||
return `relative text-mu-text ${SIDEBAR_ROW_HOVER_CLASSES} before:absolute before:inset-y-1.5 before:-start-3 before:w-0.5 before:rounded-e-full before:bg-mu-primary before:content-['']`;
|
||||
}
|
||||
return `text-mu-ink-muted ${SIDEBAR_ROW_HOVER_CLASSES}`;
|
||||
return `text-mu-text-secondary ${SIDEBAR_ROW_HOVER_CLASSES}`;
|
||||
};
|
||||
|
||||
/** Goes on the row box so the icon slot and count rail inside it can take the checked colour. */
|
||||
|
||||
@@ -9,7 +9,7 @@ const SidebarSectionHeader = ({ children, action }: Props) => (
|
||||
<div className="mb-0.5 flex h-6 min-w-0 items-center justify-between gap-2">
|
||||
{/* Sentence case at the small label weight: it reads apart from the 400-weight muted rows by
|
||||
weight and space, not by capitals or a size below the type scale. */}
|
||||
<h2 className="min-w-0 truncate ps-2 mu-label-sm text-mu-ink-muted select-none">{children}</h2>
|
||||
<h2 className="min-w-0 truncate ps-2 mu-label-sm text-mu-text-secondary select-none">{children}</h2>
|
||||
{action}
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -20,14 +20,14 @@ import { ScopePanelRowIcon } from "./SidebarRow";
|
||||
import SidebarSectionHeader from "./SidebarSectionHeader";
|
||||
import { SCOPE_PANEL_ROW_CLASSES, SIDEBAR_LEADING_SLOT_CLASSES, sidebarSurfaceVariants } from "./sidebar-layout";
|
||||
|
||||
/** One half of the Home/Explore segmented control; the current half is raised. */
|
||||
/** One half of the Home/Explore segmented control; the current half is filled. */
|
||||
const BrowseLink = ({ to, current, icon: Icon, label }: { to: string; current: boolean; icon: LucideIcon; label: string }) => (
|
||||
<Link
|
||||
to={to}
|
||||
aria-current={current ? "page" : undefined}
|
||||
className={cn(
|
||||
"flex h-(--mu-row-height) min-w-0 items-center gap-1.5 rounded-mu-sm px-1.5 mu-label hover:bg-mu-canvas/60 mu-focus",
|
||||
current && "bg-mu-canvas shadow-mu-key hover:bg-mu-canvas",
|
||||
"flex h-(--mu-row-height) min-w-0 items-center gap-1.5 rounded-mu-sm px-1.5 mu-label hover:bg-mu-canvas/60 border border-transparent mu-focus focus-visible:border-mu-focus",
|
||||
current && "bg-mu-canvas hover:bg-mu-canvas",
|
||||
)}
|
||||
>
|
||||
<span className={SIDEBAR_LEADING_SLOT_CLASSES}>
|
||||
@@ -92,7 +92,7 @@ function SpaceSwitcher({ className, size = "md" }: { className?: string; size?:
|
||||
aria-label={`${t("space.switch")}: ${triggerLabel}`}
|
||||
title={triggerLabel}
|
||||
className={cn(
|
||||
"memos-brand-trigger text-start transition-colors hover:bg-mu-hover/65 mu-focus",
|
||||
"memos-brand-trigger text-start transition-colors hover:bg-mu-hover/65 border border-transparent mu-focus focus-visible:border-mu-focus",
|
||||
sidebarSurfaceVariants({ role: size === "header" ? "headerBrand" : "mobileBrand" }),
|
||||
className,
|
||||
)}
|
||||
@@ -111,7 +111,7 @@ function SpaceSwitcher({ className, size = "md" }: { className?: string; size?:
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
viewBox="0 0 10 20"
|
||||
className="h-5 w-2.5 shrink-0 text-mu-ink-muted/35"
|
||||
className="h-5 w-2.5 shrink-0 text-mu-text-secondary/35"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
strokeWidth={1.25}
|
||||
@@ -131,7 +131,7 @@ function SpaceSwitcher({ className, size = "md" }: { className?: string; size?:
|
||||
)}
|
||||
<ChevronsUpDownIcon
|
||||
aria-hidden="true"
|
||||
className={cn(size === "header" ? "mu-icon-xs" : "mu-icon-sm", "shrink-0 text-mu-ink-muted/70")}
|
||||
className={cn(size === "header" ? "mu-icon-xs" : "mu-icon-sm", "shrink-0 text-mu-text-secondary/70")}
|
||||
/>
|
||||
</Popover.Trigger>
|
||||
{/* A list of rows beside the sidebar, at its 28px row height. */}
|
||||
|
||||
@@ -29,8 +29,8 @@ const TagPath = forwardRef<HTMLSpanElement, { tag: string }>(({ tag }, ref) => {
|
||||
<span ref={ref} className="min-w-0 flex-1 truncate text-start">
|
||||
{segments.map((segment, index) => (
|
||||
<span key={`${segment}-${index}`}>
|
||||
{index > 0 && <span className="px-0.5 text-mu-ink-muted/40">/</span>}
|
||||
<span className={index === segments.length - 1 ? "text-current" : "text-mu-ink-muted/75"}>{segment}</span>
|
||||
{index > 0 && <span className="px-0.5 text-mu-text-secondary/40">/</span>}
|
||||
<span className={index === segments.length - 1 ? "text-current" : "text-mu-text-secondary/75"}>{segment}</span>
|
||||
</span>
|
||||
))}
|
||||
</span>
|
||||
|
||||
@@ -31,7 +31,7 @@ import SidebarSection from "./SidebarSection";
|
||||
/** The row's ⋯ menu: a trailing slot control that stays hidden until the row is engaged. */
|
||||
const VIEW_MENU_TRIGGER_CLASSES = cn(
|
||||
SIDEBAR_ROW_SLOT_BUTTON_CLASSES,
|
||||
"text-mu-ink-muted transition-opacity md:opacity-0 md:group-hover/view:opacity-100 md:focus-visible:opacity-100 data-popup-open:opacity-100",
|
||||
"text-mu-text-secondary transition-opacity md:opacity-0 md:group-hover/view:opacity-100 md:focus-visible:opacity-100 data-popup-open:opacity-100",
|
||||
);
|
||||
|
||||
const ViewsSection = ({ manageActive = false }: { manageActive?: boolean }) => {
|
||||
|
||||
@@ -44,5 +44,5 @@ export const sidebarSurfaceVariants = cva("min-w-0 items-center", {
|
||||
* 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.
|
||||
*/
|
||||
export const SCOPE_PANEL_ROW_CLASSES = `${menuClasses().item} transition-colors hover:bg-mu-hover aria-[current=page]:bg-mu-hover mu-focus`;
|
||||
export const SCOPE_PANEL_ICON_CLASSES = "mu-icon text-mu-ink-muted";
|
||||
export const SCOPE_PANEL_ROW_CLASSES = `${menuClasses().item} transition-colors hover:bg-mu-hover aria-[current=page]:bg-mu-hover border border-transparent mu-focus focus-visible:border-mu-focus`;
|
||||
export const SCOPE_PANEL_ICON_CLASSES = "mu-icon text-mu-text-secondary";
|
||||
|
||||
@@ -31,7 +31,7 @@ const AttachmentThumb = ({ item, className }: { item: AttachmentLibraryListItem;
|
||||
return (
|
||||
<div className={cn("relative overflow-hidden rounded-mu-xl bg-mu-well/35", className)}>
|
||||
<VideoPoster sourceUrl={item.sourceUrl} alt={item.attachment.filename} className="h-full w-full object-cover" />
|
||||
<span className="absolute bottom-2 right-2 inline-flex h-7 w-7 items-center justify-center rounded-full bg-mu-canvas/85 text-mu-ink">
|
||||
<span className="absolute bottom-2 right-2 inline-flex h-7 w-7 items-center justify-center rounded-full bg-mu-canvas/85 text-mu-text">
|
||||
<PlayIcon className="mu-icon-sm fill-current" />
|
||||
</span>
|
||||
</div>
|
||||
@@ -39,7 +39,7 @@ const AttachmentThumb = ({ item, className }: { item: AttachmentLibraryListItem;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={cn("flex items-center justify-center rounded-mu-xl bg-mu-well/45 text-mu-ink-muted", className)}>
|
||||
<div className={cn("flex items-center justify-center rounded-mu-xl bg-mu-well/45 text-mu-text-secondary", className)}>
|
||||
{type === "audio/*" ? <FileAudioIcon className="mu-icon h-5 w-5" /> : <FileIcon className="mu-icon h-5 w-5" />}
|
||||
</div>
|
||||
);
|
||||
@@ -53,12 +53,12 @@ export const AttachmentDocumentRows = ({ items, creators }: { items: AttachmentL
|
||||
key={item.attachment.name}
|
||||
className="flex items-center gap-2.5 rounded-[18px] border border-mu-line/60 bg-mu-canvas/90 p-3"
|
||||
>
|
||||
<div className="flex h-10 w-10 shrink-0 items-center justify-center rounded-mu-lg bg-mu-well/45 text-mu-ink-muted">
|
||||
<div className="flex h-10 w-10 shrink-0 items-center justify-center rounded-mu-lg bg-mu-well/45 text-mu-text-secondary">
|
||||
<FileIcon className="mu-icon h-4.5 w-4.5" />
|
||||
</div>
|
||||
|
||||
<div className="min-w-0 flex-1">
|
||||
<div className="truncate mu-label text-mu-ink" title={item.attachment.filename}>
|
||||
<div className="truncate mu-label text-mu-text" title={item.attachment.filename}>
|
||||
{item.attachment.filename}
|
||||
</div>
|
||||
<div className="mt-0.5 flex flex-wrap items-center gap-1.5">
|
||||
@@ -111,7 +111,7 @@ export const AttachmentUnusedRows = ({ items, creators }: { items: AttachmentLib
|
||||
<AttachmentThumb item={item} className="h-10 w-10 shrink-0" />
|
||||
|
||||
<div className="min-w-0 flex-1">
|
||||
<div className="truncate mu-label text-mu-ink" title={item.attachment.filename}>
|
||||
<div className="truncate mu-label text-mu-text" title={item.attachment.filename}>
|
||||
{item.attachment.filename}
|
||||
</div>
|
||||
<div className="mt-0.5 flex flex-wrap items-center gap-1.5">
|
||||
|
||||
@@ -45,11 +45,11 @@ const AttachmentLibraryEmptyState = ({ className, tab }: AttachmentLibraryEmptyS
|
||||
className,
|
||||
)}
|
||||
>
|
||||
<div className="flex h-16 w-16 items-center justify-center rounded-full bg-mu-well/45 text-mu-ink-muted">
|
||||
<div className="flex h-16 w-16 items-center justify-center rounded-full bg-mu-well/45 text-mu-text-secondary">
|
||||
<Icon className="mu-icon size-7" />
|
||||
</div>
|
||||
<div className="mt-5 mu-label text-mu-ink">{t(titleKey)}</div>
|
||||
<p className="mt-2 max-w-sm mu-body text-mu-ink-muted">{t(descriptionKey)}</p>
|
||||
<div className="mt-5 mu-label text-mu-text">{t(titleKey)}</div>
|
||||
<p className="mt-2 max-w-sm mu-body text-mu-text-secondary">{t(descriptionKey)}</p>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -38,7 +38,7 @@ export const AttachmentCreator = ({ creatorName, user }: AttachmentCreatorProps)
|
||||
return (
|
||||
<Link
|
||||
to={getCreatorHomePath(username)}
|
||||
className="inline-flex min-w-0 max-w-full items-center gap-1.5 rounded-mu-sm mu-caption text-mu-ink-muted hover:text-mu-ink focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-mu-focus"
|
||||
className="inline-flex min-w-0 max-w-full items-center gap-1.5 rounded-mu-sm mu-caption text-mu-text-secondary hover:text-mu-text focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-mu-focus"
|
||||
viewTransition
|
||||
>
|
||||
<UserAvatar className="size-4" avatarUrl={user?.avatarUrl} name={displayName} />
|
||||
@@ -57,13 +57,13 @@ export const AttachmentMetadataLine = ({ className, items }: AttachmentMetadataL
|
||||
return (
|
||||
<div
|
||||
className={cn(
|
||||
"flex items-center gap-1.5 overflow-x-auto whitespace-nowrap mu-caption text-mu-ink-muted [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
|
||||
"flex items-center gap-1.5 overflow-x-auto whitespace-nowrap mu-caption text-mu-text-secondary [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
|
||||
className,
|
||||
)}
|
||||
>
|
||||
{visibleItems.map((item, index) => (
|
||||
<span key={`${item}-${index}`} className="contents">
|
||||
{index > 0 && <span className="shrink-0 text-mu-ink-muted/50">•</span>}
|
||||
{index > 0 && <span className="shrink-0 text-mu-text-secondary/50">•</span>}
|
||||
<span className="shrink-0">{item}</span>
|
||||
</span>
|
||||
))}
|
||||
@@ -86,7 +86,7 @@ export const AttachmentSourceChip = ({
|
||||
<Link
|
||||
to={`/${memoName}`}
|
||||
state={createMemoNavigationState(`${location.pathname}${location.search}`)}
|
||||
className="inline-flex max-w-full items-center truncate rounded-full border border-mu-line/60 bg-mu-well/30 px-1.5 py-0.5 mu-caption text-mu-ink-muted hover:bg-mu-hover"
|
||||
className="inline-flex max-w-full items-center truncate rounded-full border border-mu-line/60 bg-mu-well/30 px-1.5 py-0.5 mu-caption text-mu-text-secondary hover:bg-mu-hover"
|
||||
>
|
||||
<span className="truncate">{t("attachment-library.labels.memo")}</span>
|
||||
</Link>
|
||||
|
||||
@@ -32,7 +32,7 @@ export const AttachmentLibraryErrorState = ({ error, onRetry }: AttachmentLibrar
|
||||
|
||||
return (
|
||||
<div className="p-6 text-center" role="alert">
|
||||
<p className="mu-body text-mu-ink-muted">{error?.message ?? t("attachment-library.errors.load")}</p>
|
||||
<p className="mu-body text-mu-text-secondary">{error?.message ?? t("attachment-library.errors.load")}</p>
|
||||
<Button variant="primary" className="mt-4" onClick={onRetry}>
|
||||
{t("attachment-library.actions.retry")}
|
||||
</Button>
|
||||
|
||||
@@ -36,7 +36,7 @@ const AttachmentLibraryToolbar = ({ activeTab, onTabChange, stats }: AttachmentL
|
||||
return (
|
||||
<Toggle key={tab.key} value={tab.key} icon={<Icon />}>
|
||||
{t(`attachment-library.tabs.${tab.labelKey}`)}
|
||||
<span className="ms-1 tabular-nums text-mu-ink-muted">{tab.count(stats)}</span>
|
||||
<span className="ms-1 tabular-nums text-mu-text-secondary">{tab.count(stats)}</span>
|
||||
</Toggle>
|
||||
);
|
||||
})}
|
||||
|
||||
@@ -35,7 +35,7 @@ const AttachmentMediaCard = ({ item, creator, onPreview }: { item: AttachmentLib
|
||||
<div className="absolute inset-0 bg-linear-to-t from-black/35 via-black/5 to-transparent" />
|
||||
<span
|
||||
className={cn(
|
||||
"absolute bottom-2.5 right-2.5 inline-flex h-8 items-center justify-center rounded-full bg-mu-canvas/85 text-mu-ink backdrop-blur-sm",
|
||||
"absolute bottom-2.5 right-2.5 inline-flex h-8 items-center justify-center rounded-full bg-mu-canvas/85 text-mu-text backdrop-blur-sm",
|
||||
videoDuration === undefined ? "w-8" : "gap-1.5 px-2.5 mu-label-sm tabular-nums",
|
||||
)}
|
||||
>
|
||||
@@ -61,7 +61,7 @@ const AttachmentMediaCard = ({ item, creator, onPreview }: { item: AttachmentLib
|
||||
|
||||
<div className="flex flex-col gap-2 p-3">
|
||||
<div className="flex items-start justify-between gap-2">
|
||||
<div className="min-w-0 truncate mu-label text-mu-ink" title={item.filename}>
|
||||
<div className="min-w-0 truncate mu-label text-mu-text" title={item.filename}>
|
||||
{item.filename}
|
||||
</div>
|
||||
|
||||
@@ -88,7 +88,7 @@ const AttachmentMediaGrid = ({ groups, creators, onPreview }: AttachmentMediaGri
|
||||
{groups.map((group) => (
|
||||
<section key={group.key} className="space-y-2.5 sm:space-y-3">
|
||||
<div className="flex items-center gap-2.5">
|
||||
<div className="mu-label-sm uppercase tracking-[0.24em] text-mu-ink-muted">{group.label}</div>
|
||||
<div className="mu-label-sm uppercase tracking-[0.24em] text-mu-text-secondary">{group.label}</div>
|
||||
<div className="h-px flex-1 bg-mu-line/70" />
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Toggle, ToggleGroup, Tooltip } from "@usememos/ui";
|
||||
import { MonitorIcon, MoonIcon, PaletteIcon, SunIcon } from "lucide-react";
|
||||
import { MonitorIcon, MoonIcon, SunIcon } from "lucide-react";
|
||||
import { useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { cn } from "@/lib/utils";
|
||||
@@ -12,7 +12,6 @@ const THEMES: { value: Theme; icon: React.ReactElement; labelKey: Translations }
|
||||
{ value: "system", icon: <MonitorIcon />, labelKey: "setting.preference.theme-system-short" },
|
||||
{ value: "default", icon: <SunIcon />, labelKey: "setting.preference.theme-light" },
|
||||
{ value: "default-dark", icon: <MoonIcon />, labelKey: "setting.preference.theme-dark" },
|
||||
{ value: "paper", icon: <PaletteIcon />, labelKey: "setting.preference.theme-paper" },
|
||||
];
|
||||
|
||||
interface Props {
|
||||
|
||||
@@ -9,7 +9,7 @@ const AuthNotice = ({ tone = "info", children, className }: { tone?: "info" | "e
|
||||
role={tone === "error" ? "alert" : "status"}
|
||||
className={cn(
|
||||
"flex items-start gap-2 rounded-mu-md px-2.5 py-2 mu-caption",
|
||||
tone === "error" ? "bg-mu-danger-soft text-mu-danger" : "bg-mu-hover text-mu-ink-muted",
|
||||
tone === "error" ? "bg-mu-danger-soft text-mu-danger" : "bg-mu-hover text-mu-text-secondary",
|
||||
className,
|
||||
)}
|
||||
>
|
||||
|
||||
@@ -15,7 +15,7 @@ interface Props {
|
||||
|
||||
// "Don't have an account yet? Sign up" style prompt for hopping between auth pages.
|
||||
export const AuthLinkPrompt = ({ prompt, to, label }: { prompt: string; to: string; label: string }) => (
|
||||
<p className="mt-5 text-center mu-caption text-mu-ink-muted">
|
||||
<p className="mt-5 text-center mu-caption text-mu-text-secondary">
|
||||
{prompt}{" "}
|
||||
<Link to={to} className="text-mu-accent hover:underline" viewTransition>
|
||||
{label}
|
||||
@@ -48,8 +48,8 @@ const AuthPageLayout = ({ title, description, children }: Props) => (
|
||||
<main className="flex w-full flex-1 flex-col sm:w-90 sm:flex-none sm:rounded-mu-xl sm:border sm:border-mu-line sm:bg-mu-surface">
|
||||
<div className="flex flex-1 flex-col justify-center px-5 py-12 sm:px-7 sm:pt-8 sm:pb-7">
|
||||
<MemosLogo size="lg" className="mb-8" />
|
||||
{title && <h1 className="mu-heading text-mu-ink">{title}</h1>}
|
||||
{description && <p className="mt-1 mu-body text-mu-ink-muted">{description}</p>}
|
||||
{title && <h1 className="mu-heading text-mu-text">{title}</h1>}
|
||||
{description && <p className="mt-1 mu-body text-mu-text-secondary">{description}</p>}
|
||||
<div className={cn("w-full", title && "mt-6")}>{children}</div>
|
||||
</div>
|
||||
{/* Same side padding as the content above, so the footer's controls share its edges. */}
|
||||
|
||||
@@ -90,15 +90,15 @@ const CORNER_CLASSES = { ss: "rounded-ss-mu-lg", se: "rounded-se-mu-lg", es: "ro
|
||||
*/
|
||||
const BADGE = "inline-flex h-[22px] min-w-[22px] items-center justify-center rounded-mu-md px-[5px]";
|
||||
const TODAY_BADGE = `${BADGE} bg-mu-primary text-mu-on-primary`;
|
||||
const OPEN_BADGE = `${BADGE} bg-mu-ink/10 text-mu-ink`;
|
||||
const OPEN_BADGE = `${BADGE} bg-mu-text/10 text-mu-text`;
|
||||
/** Negative margin keeps the badge where it was; only the halo grows outward. */
|
||||
const OPEN_TODAY_HALO = "-m-[3px] inline-flex rounded-[9px] bg-mu-ink/10 p-[3px]";
|
||||
const OPEN_TODAY_HALO = "-m-[3px] inline-flex rounded-[9px] bg-mu-text/10 p-[3px]";
|
||||
|
||||
const getNumeralClass = (day: CalendarDayCellData, count: number): string => {
|
||||
if (day.isToday) return TODAY_BADGE;
|
||||
if (day.isSelected) return OPEN_BADGE;
|
||||
if (!day.isCurrentMonth) return "text-mu-ink-muted/40";
|
||||
return count > 0 ? "text-mu-ink" : "text-mu-ink-muted/70";
|
||||
if (!day.isCurrentMonth) return "text-mu-text-secondary/40";
|
||||
return count > 0 ? "text-mu-text" : "text-mu-text-secondary/70";
|
||||
};
|
||||
|
||||
const NO_IMAGES: CalendarDaySummary["images"] = [];
|
||||
@@ -145,7 +145,7 @@ const DayMark = ({
|
||||
);
|
||||
}
|
||||
return (
|
||||
<span className="flex flex-col gap-[3px] text-mu-ink-muted/45 transition-colors group-hover/day:text-mu-ink-muted">
|
||||
<span className="flex flex-col gap-[3px] text-mu-text-secondary/45 transition-colors group-hover/day:text-mu-text-secondary">
|
||||
<span className="h-0.5 w-4 rounded-full bg-current" />
|
||||
<span className="h-0.5 w-2.5 rounded-full bg-current" />
|
||||
</span>
|
||||
@@ -188,12 +188,13 @@ export const CalendarDayCell = memo(
|
||||
aria-label={getTooltipText(count, day.date, t, timeBasis)}
|
||||
aria-current={day.isSelected ? "page" : undefined}
|
||||
className={cn(
|
||||
"group/day relative flex min-h-14 min-w-0 flex-col overflow-hidden border-mu-line/70 px-1.5 py-2 text-start no-underline transition-colors sm:px-3 sm:min-h-20 md:min-h-[5.5rem]",
|
||||
"group/day relative flex min-h-14 min-w-0 flex-col overflow-hidden px-1.5 py-2 text-start no-underline transition-colors sm:px-3 sm:min-h-20 md:min-h-[5.5rem]",
|
||||
layout.slim && "sm:px-2",
|
||||
!isLastColumn && "border-e",
|
||||
!isLastRow && "border-b",
|
||||
corner && CORNER_CLASSES[corner],
|
||||
"mu-focus",
|
||||
"border border-mu-line/70 border-s-transparent border-t-transparent mu-focus focus-visible:border-mu-focus",
|
||||
// After the all-sides color: tailwind-merge drops a per-side color that comes before it.
|
||||
isLastColumn && "border-e-transparent",
|
||||
isLastRow && "border-b-transparent",
|
||||
// The open day keeps its heat tint; its numeral badge is the selection mark.
|
||||
day.isCurrentMonth ? DAY_CELL_FILLS[level] : "bg-mu-well/25 hover:bg-mu-hover",
|
||||
)}
|
||||
@@ -225,8 +226,8 @@ export const CalendarDayCell = memo(
|
||||
<span
|
||||
className={cn(
|
||||
"overflow-hidden whitespace-pre-line break-words mu-caption [display:-webkit-box] [-webkit-box-orient:vertical]",
|
||||
"text-mu-ink-muted transition-colors group-hover/day:text-mu-ink",
|
||||
day.isSelected && "text-mu-ink",
|
||||
"text-mu-text-secondary transition-colors group-hover/day:text-mu-text",
|
||||
day.isSelected && "text-mu-text",
|
||||
excerpt.isCode && "font-mono mu-caption",
|
||||
)}
|
||||
style={{ WebkitLineClamp: textLines }}
|
||||
|
||||
@@ -163,7 +163,9 @@ export const CalendarView = ({ month, date }: CalendarViewProps) => {
|
||||
</MentionResolutionProvider>
|
||||
{error && <MemoListError error={error} onRetry={refetch} />}
|
||||
{isEmptyMonth && md && (
|
||||
<p className="mt-2 shrink-0 text-center mu-caption text-mu-ink-muted">{t("calendar.no-memos-in-month", { month: monthLabel })}</p>
|
||||
<p className="mt-2 shrink-0 text-center mu-caption text-mu-text-secondary">
|
||||
{t("calendar.no-memos-in-month", { month: monthLabel })}
|
||||
</p>
|
||||
)}
|
||||
{activeDate && !md && (
|
||||
<section aria-label={dateLabel} className="mt-4 flex w-full flex-col">
|
||||
|
||||
@@ -48,7 +48,7 @@ export const MonthPicker = ({ month, monthLabel, today }: MonthPickerProps) => {
|
||||
<Popover.Root open={open} onOpenChange={setOpen}>
|
||||
{/* The month is the calendar page's title, so it is the page heading as well as the trigger. */}
|
||||
<h1 className="min-w-0">
|
||||
<Popover.Trigger aria-label={t("calendar.select-month")} className={cn(TITLE_CONTROL_CLASSES, "mu-heading text-mu-ink")}>
|
||||
<Popover.Trigger aria-label={t("calendar.select-month")} className={cn(TITLE_CONTROL_CLASSES, "mu-heading text-mu-text")}>
|
||||
{monthLabel}
|
||||
</Popover.Trigger>
|
||||
</h1>
|
||||
@@ -61,7 +61,7 @@ export const MonthPicker = ({ month, monthLabel, today }: MonthPickerProps) => {
|
||||
icon={<ChevronLeftIcon className="mu-icon rtl:rotate-180" />}
|
||||
onClick={() => setYear((value) => value - 1)}
|
||||
/>
|
||||
<span className="flex-1 text-center mu-label-sm tabular-nums text-mu-ink">{year}</span>
|
||||
<span className="flex-1 text-center mu-label-sm tabular-nums text-mu-text">{year}</span>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
@@ -80,7 +80,7 @@ export const MonthPicker = ({ month, monthLabel, today }: MonthPickerProps) => {
|
||||
key={key}
|
||||
to={buildCalendarPath(key)}
|
||||
aria-current={isShown ? "page" : undefined}
|
||||
className={cn(TEXT_CONTROL_CLASSES, "relative text-mu-ink")}
|
||||
className={cn(TEXT_CONTROL_CLASSES, "relative text-mu-text")}
|
||||
onClick={() => setOpen(false)}
|
||||
>
|
||||
{monthShortLabels[value - 1]}
|
||||
|
||||
@@ -217,8 +217,8 @@ function FormSection({ title, description, children }: { title: string; descript
|
||||
return (
|
||||
<section className="space-y-4 rounded-mu-lg border bg-mu-well/20 p-4">
|
||||
<div className="space-y-1">
|
||||
<h3 className="mu-label text-mu-ink">{title}</h3>
|
||||
{description ? <p className="mu-caption text-mu-ink-muted">{description}</p> : null}
|
||||
<h3 className="mu-label text-mu-text">{title}</h3>
|
||||
{description ? <p className="mu-caption text-mu-text-secondary">{description}</p> : null}
|
||||
</div>
|
||||
<div className="space-y-4">{children}</div>
|
||||
</section>
|
||||
@@ -501,9 +501,9 @@ function CreateIdentityProviderDialog({ open, onOpenChange, identityProvider, on
|
||||
<>
|
||||
<FormSection title={t("setting.sso.oauth-configuration")} description={t("setting.sso.oauth-configuration-description")}>
|
||||
<div className="rounded-mu-md border bg-mu-canvas px-3 py-3">
|
||||
<p className="mu-label-sm uppercase tracking-wide text-mu-ink-muted">{t("setting.sso.redirect-url")}</p>
|
||||
<p className="mt-2 break-all font-mono mu-caption text-mu-ink">{absolutifyLink("/auth/callback")}</p>
|
||||
<p className="mt-2 mu-caption text-mu-ink-muted">{t("setting.sso.redirect-url-description")}</p>
|
||||
<p className="mu-label-sm uppercase tracking-wide text-mu-text-secondary">{t("setting.sso.redirect-url")}</p>
|
||||
<p className="mt-2 break-all font-mono mu-caption text-mu-text">{absolutifyLink("/auth/callback")}</p>
|
||||
<p className="mt-2 mu-caption text-mu-text-secondary">{t("setting.sso.redirect-url-description")}</p>
|
||||
</div>
|
||||
|
||||
<div className="grid gap-4 md:grid-cols-2">
|
||||
|
||||
@@ -151,7 +151,7 @@ function CreateSpaceDialog({ open, onOpenChange, onCreated, note }: Props) {
|
||||
</Field.Root>
|
||||
)}
|
||||
</div>
|
||||
<p className="mu-caption text-mu-ink-muted">{note ?? t("space.creator-admin-note")}</p>
|
||||
<p className="mu-caption text-mu-text-secondary">{note ?? t("space.creator-admin-note")}</p>
|
||||
<Dialog.Footer>
|
||||
<Button type="button" variant="ghost" disabled={createSpace.isPending} onClick={() => onOpenChange(false)}>
|
||||
{t("common.cancel")}
|
||||
|
||||
@@ -201,7 +201,7 @@ function CreateWebhookDialog({ open, onOpenChange, webhookName, onSuccess }: Pro
|
||||
if (hasExistingSecret) {
|
||||
return (
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="flex-1 mu-caption text-mu-ink-muted">{t("setting.webhook.create-dialog.signing-secret-configured")}</span>
|
||||
<span className="flex-1 mu-caption text-mu-text-secondary">{t("setting.webhook.create-dialog.signing-secret-configured")}</span>
|
||||
<Button
|
||||
type="button"
|
||||
variant="neutral"
|
||||
@@ -217,7 +217,7 @@ function CreateWebhookDialog({ open, onOpenChange, webhookName, onSuccess }: Pro
|
||||
}
|
||||
return (
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="flex-1 mu-caption text-mu-ink-muted">{t("setting.webhook.create-dialog.signing-secret-not-configured")}</span>
|
||||
<span className="flex-1 mu-caption text-mu-text-secondary">{t("setting.webhook.create-dialog.signing-secret-not-configured")}</span>
|
||||
<Button type="button" variant="neutral" onClick={handleGenerateSecret} disabled={secretState.isLoading}>
|
||||
{t("setting.webhook.create-dialog.generate-secret")}
|
||||
</Button>
|
||||
|
||||
@@ -157,7 +157,7 @@ function CustomIconPicker({ value, onChange, disabled, label, fallback = Astroid
|
||||
))}
|
||||
</Combobox.List>
|
||||
</Combobox.Root>
|
||||
{tab === "emoji" && <p className="px-1 pt-2 mu-caption text-mu-ink-muted">{t("space.icon.emoji-help")}</p>}
|
||||
{tab === "emoji" && <p className="px-1 pt-2 mu-caption text-mu-text-secondary">{t("space.icon.emoji-help")}</p>}
|
||||
</div>
|
||||
<div className="mt-2 border-t pt-1.5">
|
||||
<Button
|
||||
|
||||
@@ -53,13 +53,13 @@ export const FloatingAction = ({ children }: { children: ReactNode }) => (
|
||||
);
|
||||
|
||||
/**
|
||||
* A group of controls floating on the paper: one raised bar with flat controls inside, so no
|
||||
* shadow sits inside another. Light in every theme, like the paper under it.
|
||||
* A group of controls floating on the paper: one bordered bar with flat controls inside. Light in
|
||||
* every theme, like the paper under it.
|
||||
*/
|
||||
export const FloatingBar = ({ className, children }: { className?: string; children: ReactNode }) => (
|
||||
<div
|
||||
data-theme="light"
|
||||
className={cn("pointer-events-auto flex items-center gap-0.5 rounded-mu-lg bg-mu-surface p-1 shadow-mu-pop", className)}
|
||||
className={cn("pointer-events-auto flex items-center gap-0.5 rounded-mu-lg border border-mu-edge bg-mu-surface p-1", className)}
|
||||
>
|
||||
{children}
|
||||
</div>
|
||||
|
||||
@@ -207,7 +207,7 @@ const DrawingSheet = ({ mode, initialScene, background, onDone, onClose }: Drawi
|
||||
</Tooltip.Root>
|
||||
<Popover.Popup side={isWide ? "bottom" : "top"} aria-label={t("editor.drawing.style")}>
|
||||
<div className="flex flex-col gap-2">
|
||||
<span className="mu-label-sm text-mu-ink-muted">{t("editor.drawing.color")}</span>
|
||||
<span className="mu-label-sm text-mu-text-secondary">{t("editor.drawing.color")}</span>
|
||||
<div
|
||||
role="group"
|
||||
aria-label={t("editor.drawing.color")}
|
||||
@@ -234,7 +234,7 @@ const DrawingSheet = ({ mode, initialScene, background, onDone, onClose }: Drawi
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex flex-col gap-2">
|
||||
<span className="mu-label-sm text-mu-ink-muted">{t("editor.drawing.width")}</span>
|
||||
<span className="mu-label-sm text-mu-text-secondary">{t("editor.drawing.width")}</span>
|
||||
<ToggleGroup
|
||||
fullWidth
|
||||
aria-label={t("editor.drawing.width")}
|
||||
|
||||
@@ -132,7 +132,7 @@ const DrawingViewer = ({ attachment: initialAttachment, memo, canEdit, onClose,
|
||||
Not a Dialog.Title, whose heading type is 16px; the popup's aria-label names the dialog. */}
|
||||
<FloatingBar className={isWide ? "pr-2" : "pr-3"}>
|
||||
<IconAction size={size} label={t("common.close")} icon={<XIcon />} onClick={onClose} />
|
||||
<span className={cn("truncate text-mu-ink", isWide ? "mu-label-sm" : "mu-label")}>{title}</span>
|
||||
<span className={cn("truncate text-mu-text", isWide ? "mu-label-sm" : "mu-label")}>{title}</span>
|
||||
</FloatingBar>
|
||||
<FloatingBar className={isWide ? undefined : "gap-3"}>
|
||||
<IconAction
|
||||
@@ -142,7 +142,7 @@ const DrawingViewer = ({ attachment: initialAttachment, memo, canEdit, onClose,
|
||||
onClick={() => canvasRef.current?.zoomToFit()}
|
||||
/>
|
||||
{canEdit && (
|
||||
// Flat inside the bar: the bar is the one raised surface.
|
||||
// Flat inside the bar: the bar is the one bordered surface.
|
||||
<Button variant="ghost" size={size} icon={<PencilLineIcon />} disabled={!scene} onClick={() => setIsEditing(true)}>
|
||||
{t("common.edit")}
|
||||
</Button>
|
||||
|
||||
@@ -47,12 +47,12 @@ export class ErrorBoundary extends Component<Props, State> {
|
||||
<h1 className="mu-heading">{translate("error.title")}</h1>
|
||||
</div>
|
||||
|
||||
<p className="text-mu-ink/70">{translate("error.description")}</p>
|
||||
<p className="text-mu-text/70">{translate("error.description")}</p>
|
||||
|
||||
{this.state.error && (
|
||||
<details className="bg-mu-well p-3 rounded-mu-md mu-body">
|
||||
<summary className="cursor-pointer font-medium mb-2">{translate("error.details")}</summary>
|
||||
<pre className="whitespace-pre-wrap break-words mu-caption text-mu-ink/60">{this.state.error.message}</pre>
|
||||
<pre className="whitespace-pre-wrap break-words mu-caption text-mu-text/60">{this.state.error.message}</pre>
|
||||
</details>
|
||||
)}
|
||||
|
||||
@@ -80,12 +80,12 @@ export function ChunkLoadErrorFallback() {
|
||||
<h1 className="mu-heading">{translate("error.title")}</h1>
|
||||
</div>
|
||||
|
||||
<p className="text-mu-ink/70">{translate("error.description-update")}</p>
|
||||
<p className="text-mu-text/70">{translate("error.description-update")}</p>
|
||||
|
||||
{error?.message && (
|
||||
<details className="bg-mu-well p-3 rounded-mu-md mu-body">
|
||||
<summary className="cursor-pointer font-medium mb-2">{translate("error.details")}</summary>
|
||||
<pre className="whitespace-pre-wrap break-words mu-caption text-mu-ink/60">{error.message}</pre>
|
||||
<pre className="whitespace-pre-wrap break-words mu-caption text-mu-text/60">{error.message}</pre>
|
||||
</details>
|
||||
)}
|
||||
|
||||
|
||||
@@ -18,7 +18,9 @@ interface Props {
|
||||
* brand wordmark's weight and spacing in the theme's serif stack; the exact face is not required.
|
||||
*/
|
||||
const IdentityLabel = ({ mark, label, size = "md", collapsed, wrap, className }: Props) => (
|
||||
<span className={cn("flex min-w-0 items-center text-mu-ink", size === "hero" ? "gap-3" : size === "lg" ? "gap-2.5" : "gap-2", className)}>
|
||||
<span
|
||||
className={cn("flex min-w-0 items-center text-mu-text", size === "hero" ? "gap-3" : size === "lg" ? "gap-2.5" : "gap-2", className)}
|
||||
>
|
||||
{mark}
|
||||
{!collapsed && (
|
||||
<span
|
||||
|
||||
@@ -86,8 +86,8 @@ function MemoCommentMessage({ notification }: Props) {
|
||||
<UserAvatar className="w-10 h-10" avatarUrl={sender?.avatarUrl} name={sender?.displayName || sender?.username} />
|
||||
<div
|
||||
className={cn(
|
||||
"absolute -bottom-1 -right-1 w-5 h-5 rounded-full border-2 border-mu-canvas flex items-center justify-center shadow-mu-pop transition-all",
|
||||
isUnread ? "bg-mu-primary text-mu-on-primary" : "bg-mu-well/80 text-mu-ink-muted",
|
||||
"absolute -bottom-1 -right-1 w-5 h-5 rounded-full border-2 border-mu-canvas flex items-center justify-center transition-all",
|
||||
isUnread ? "bg-mu-primary text-mu-on-primary" : "bg-mu-well/80 text-mu-text-secondary",
|
||||
)}
|
||||
>
|
||||
<MessageCircleIcon className="mu-icon-xs w-2.5 h-2.5" />
|
||||
@@ -97,9 +97,9 @@ function MemoCommentMessage({ notification }: Props) {
|
||||
<div className="flex-1 min-w-0">
|
||||
<div className="flex items-center justify-between gap-3 mb-1">
|
||||
<div className="flex items-center gap-1.5 flex-wrap min-w-0">
|
||||
<span className="mu-label text-mu-ink/95">{sender?.displayName || sender?.username}</span>
|
||||
<span className="mu-body text-mu-ink-muted/80">{t("inbox.commented-on-memo")}</span>
|
||||
<span className="mu-caption text-mu-ink-muted/60">
|
||||
<span className="mu-label text-mu-text/95">{sender?.displayName || sender?.username}</span>
|
||||
<span className="mu-body text-mu-text-secondary/80">{t("inbox.commented-on-memo")}</span>
|
||||
<span className="mu-caption text-mu-text-secondary/60">
|
||||
{notification.createTime &&
|
||||
t("common.date-at-time", {
|
||||
date: timestampDate(notification.createTime).toLocaleDateString([], { month: "short", day: "numeric" }),
|
||||
@@ -114,7 +114,7 @@ function MemoCommentMessage({ notification }: Props) {
|
||||
className="p-1.5 hover:bg-mu-primary/10 rounded-mu-lg transition-all duration-150 opacity-0 group-hover:opacity-100"
|
||||
title={t("common.archive")}
|
||||
>
|
||||
<CheckIcon className="mu-icon text-mu-ink-muted hover:text-mu-primary transition-colors" />
|
||||
<CheckIcon className="mu-icon text-mu-text-secondary hover:text-mu-primary transition-colors" />
|
||||
</button>
|
||||
) : (
|
||||
<button
|
||||
@@ -122,23 +122,23 @@ function MemoCommentMessage({ notification }: Props) {
|
||||
className="p-1.5 hover:bg-mu-danger-soft rounded-mu-lg transition-all duration-150 opacity-0 group-hover:opacity-100"
|
||||
title={t("common.delete")}
|
||||
>
|
||||
<TrashIcon className="mu-icon text-mu-ink-muted hover:text-mu-danger transition-colors" />
|
||||
<TrashIcon className="mu-icon text-mu-text-secondary hover:text-mu-danger transition-colors" />
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="pl-3 border-l-2 border-mu-ink-muted/20 mb-3">
|
||||
<p className="mu-body text-mu-ink/60 line-clamp-1">
|
||||
<span className="mu-label-sm text-mu-ink-muted/50 mr-2 uppercase tracking-wide">{t("inbox.original")}</span>
|
||||
{commentPayload.relatedMemoSnippet || <span className="italic text-mu-ink-muted/40">{t("inbox.empty-memo")}</span>}
|
||||
<div className="pl-3 border-l-2 border-mu-text-secondary/20 mb-3">
|
||||
<p className="mu-body text-mu-text/60 line-clamp-1">
|
||||
<span className="mu-label-sm text-mu-text-secondary/50 mr-2 uppercase tracking-wide">{t("inbox.original")}</span>
|
||||
{commentPayload.relatedMemoSnippet || <span className="italic text-mu-text-secondary/40">{t("inbox.empty-memo")}</span>}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
onClick={handleNavigateToMemo}
|
||||
className="w-full p-2 text-left sm:p-3 rounded-mu-lg bg-gradient-to-br from-mu-primary/[0.06] to-mu-primary/[0.03] hover:from-mu-primary/[0.1] hover:to-mu-primary/[0.06] cursor-pointer border border-mu-primary/30 hover:border-mu-primary/50 transition-all duration-200 group/comment shadow-mu-key hover:shadow"
|
||||
className="w-full p-2 text-left sm:p-3 rounded-mu-lg bg-mu-well/50 hover:bg-mu-hover cursor-pointer border border-mu-edge transition-colors duration-200 group/comment mu-focus focus-visible:border-mu-focus"
|
||||
>
|
||||
<div className="flex items-start gap-2">
|
||||
<div className="w-5 h-5 flex items-center justify-center shrink-0">
|
||||
@@ -146,8 +146,8 @@ function MemoCommentMessage({ notification }: Props) {
|
||||
</div>
|
||||
<div className="flex-1 min-w-0">
|
||||
<p className="mu-label-sm text-mu-primary/60 mb-1 uppercase tracking-wider">{t("inbox.comment-heading")}</p>
|
||||
<p className="mu-body text-mu-ink/90 line-clamp-2">
|
||||
{commentPayload.memoSnippet || <span className="italic text-mu-ink-muted/50">{t("inbox.empty-comment")}</span>}
|
||||
<p className="mu-body text-mu-text/90 line-clamp-2">
|
||||
{commentPayload.memoSnippet || <span className="italic text-mu-text-secondary/50">{t("inbox.empty-comment")}</span>}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -88,8 +88,8 @@ function MemoMentionMessage({ notification }: Props) {
|
||||
<UserAvatar className="w-10 h-10" avatarUrl={sender?.avatarUrl} name={sender?.displayName || sender?.username} />
|
||||
<div
|
||||
className={cn(
|
||||
"absolute -bottom-1 -right-1 w-5 h-5 rounded-full border-2 border-mu-canvas flex items-center justify-center shadow-mu-pop transition-all",
|
||||
isUnread ? "bg-mu-primary text-mu-on-primary" : "bg-mu-well/80 text-mu-ink-muted",
|
||||
"absolute -bottom-1 -right-1 w-5 h-5 rounded-full border-2 border-mu-canvas flex items-center justify-center transition-all",
|
||||
isUnread ? "bg-mu-primary text-mu-on-primary" : "bg-mu-well/80 text-mu-text-secondary",
|
||||
)}
|
||||
>
|
||||
<AtSignIcon className="mu-icon-xs w-2.5 h-2.5" />
|
||||
@@ -99,11 +99,11 @@ function MemoMentionMessage({ notification }: Props) {
|
||||
<div className="flex-1 min-w-0">
|
||||
<div className="flex items-center justify-between gap-3 mb-1">
|
||||
<div className="flex items-center gap-1.5 flex-wrap min-w-0">
|
||||
<span className="mu-label text-mu-ink/95">{sender?.displayName || sender?.username}</span>
|
||||
<span className="mu-body text-mu-ink-muted/80">
|
||||
<span className="mu-label text-mu-text/95">{sender?.displayName || sender?.username}</span>
|
||||
<span className="mu-body text-mu-text-secondary/80">
|
||||
{isCommentMention ? t("inbox.mentioned-in-comment") : t("inbox.mentioned-in-memo")}
|
||||
</span>
|
||||
<span className="mu-caption text-mu-ink-muted/60">
|
||||
<span className="mu-caption text-mu-text-secondary/60">
|
||||
{notification.createTime &&
|
||||
t("common.date-at-time", {
|
||||
date: timestampDate(notification.createTime).toLocaleDateString([], { month: "short", day: "numeric" }),
|
||||
@@ -118,7 +118,7 @@ function MemoMentionMessage({ notification }: Props) {
|
||||
className="p-1.5 hover:bg-mu-primary/10 rounded-mu-lg transition-all duration-150 opacity-0 group-hover:opacity-100"
|
||||
title={t("common.archive")}
|
||||
>
|
||||
<CheckIcon className="mu-icon text-mu-ink-muted hover:text-mu-primary transition-colors" />
|
||||
<CheckIcon className="mu-icon text-mu-text-secondary hover:text-mu-primary transition-colors" />
|
||||
</button>
|
||||
) : (
|
||||
<button
|
||||
@@ -126,17 +126,17 @@ function MemoMentionMessage({ notification }: Props) {
|
||||
className="p-1.5 hover:bg-mu-danger-soft rounded-mu-lg transition-all duration-150 opacity-0 group-hover:opacity-100"
|
||||
title={t("common.delete")}
|
||||
>
|
||||
<TrashIcon className="mu-icon text-mu-ink-muted hover:text-mu-danger transition-colors" />
|
||||
<TrashIcon className="mu-icon text-mu-text-secondary hover:text-mu-danger transition-colors" />
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{mentionPayload.relatedMemo && (
|
||||
<div className="pl-3 border-l-2 border-mu-ink-muted/20 mb-3">
|
||||
<p className="mu-body text-mu-ink/60 line-clamp-1">
|
||||
<span className="mu-label-sm text-mu-ink-muted/50 mr-2 uppercase tracking-wide">{t("inbox.memo-label")}</span>
|
||||
{mentionPayload.relatedMemoSnippet || <span className="italic text-mu-ink-muted/40">{t("inbox.empty-memo")}</span>}
|
||||
<div className="pl-3 border-l-2 border-mu-text-secondary/20 mb-3">
|
||||
<p className="mu-body text-mu-text/60 line-clamp-1">
|
||||
<span className="mu-label-sm text-mu-text-secondary/50 mr-2 uppercase tracking-wide">{t("inbox.memo-label")}</span>
|
||||
{mentionPayload.relatedMemoSnippet || <span className="italic text-mu-text-secondary/40">{t("inbox.empty-memo")}</span>}
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
@@ -144,7 +144,7 @@ function MemoMentionMessage({ notification }: Props) {
|
||||
<button
|
||||
type="button"
|
||||
onClick={handleNavigate}
|
||||
className="w-full p-2 text-left sm:p-3 rounded-mu-lg bg-gradient-to-br from-mu-primary/[0.06] to-mu-primary/[0.03] hover:from-mu-primary/[0.1] hover:to-mu-primary/[0.06] cursor-pointer border border-mu-primary/30 hover:border-mu-primary/50 transition-all duration-200 group/comment shadow-mu-key hover:shadow"
|
||||
className="w-full p-2 text-left sm:p-3 rounded-mu-lg bg-mu-well/50 hover:bg-mu-hover cursor-pointer border border-mu-edge transition-colors duration-200 group/comment mu-focus focus-visible:border-mu-focus"
|
||||
>
|
||||
<div className="flex items-start gap-2">
|
||||
<div className="w-5 h-5 flex items-center justify-center shrink-0">
|
||||
@@ -154,8 +154,8 @@ function MemoMentionMessage({ notification }: Props) {
|
||||
<p className="mu-label-sm text-mu-primary/60 mb-1 uppercase tracking-wider">
|
||||
{isCommentMention ? t("inbox.comment-heading") : t("inbox.memo-heading")}
|
||||
</p>
|
||||
<p className="mu-body text-mu-ink/90 line-clamp-2">
|
||||
{mentionPayload.memoSnippet || <span className="italic text-mu-ink-muted/50">{t("inbox.empty-memo")}</span>}
|
||||
<p className="mu-body text-mu-text/90 line-clamp-2">
|
||||
{mentionPayload.memoSnippet || <span className="italic text-mu-text-secondary/50">{t("inbox.empty-memo")}</span>}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -120,8 +120,8 @@ function SpaceInvitationMessage({ notification }: Props) {
|
||||
<UserAvatar className="w-10 h-10" avatarUrl={sender?.avatarUrl} name={sender?.displayName || sender?.username} />
|
||||
<div
|
||||
className={cn(
|
||||
"absolute -bottom-1 -right-1 w-5 h-5 rounded-full border-2 border-mu-canvas flex items-center justify-center shadow-mu-pop transition-all",
|
||||
isUnread ? "bg-mu-primary text-mu-on-primary" : "bg-mu-well/80 text-mu-ink-muted",
|
||||
"absolute -bottom-1 -right-1 w-5 h-5 rounded-full border-2 border-mu-canvas flex items-center justify-center transition-all",
|
||||
isUnread ? "bg-mu-primary text-mu-on-primary" : "bg-mu-well/80 text-mu-text-secondary",
|
||||
)}
|
||||
>
|
||||
<UsersIcon className="mu-icon-xs w-2.5 h-2.5" />
|
||||
@@ -131,9 +131,9 @@ function SpaceInvitationMessage({ notification }: Props) {
|
||||
<div className="flex-1 min-w-0">
|
||||
<div className="flex items-center justify-between gap-3 mb-3">
|
||||
<div className="flex items-center gap-1.5 flex-wrap min-w-0">
|
||||
<span className="mu-label text-mu-ink/95">{sender?.displayName || sender?.username}</span>
|
||||
<span className="mu-body text-mu-ink-muted/80">{t("inbox.space-invitation")}</span>
|
||||
<span className="mu-caption text-mu-ink-muted/60">
|
||||
<span className="mu-label text-mu-text/95">{sender?.displayName || sender?.username}</span>
|
||||
<span className="mu-body text-mu-text-secondary/80">{t("inbox.space-invitation")}</span>
|
||||
<span className="mu-caption text-mu-text-secondary/60">
|
||||
{notification.createTime &&
|
||||
t("common.date-at-time", {
|
||||
date: timestampDate(notification.createTime).toLocaleDateString([], { month: "short", day: "numeric" }),
|
||||
@@ -148,7 +148,7 @@ function SpaceInvitationMessage({ notification }: Props) {
|
||||
className="p-1.5 hover:bg-mu-primary/10 rounded-mu-lg transition-all duration-150 opacity-0 group-hover:opacity-100"
|
||||
title={t("common.archive")}
|
||||
>
|
||||
<CheckIcon className="mu-icon text-mu-ink-muted hover:text-mu-primary transition-colors" />
|
||||
<CheckIcon className="mu-icon text-mu-text-secondary hover:text-mu-primary transition-colors" />
|
||||
</button>
|
||||
) : (
|
||||
<button
|
||||
@@ -156,7 +156,7 @@ function SpaceInvitationMessage({ notification }: Props) {
|
||||
className="p-1.5 hover:bg-mu-danger-soft rounded-mu-lg transition-all duration-150 opacity-0 group-hover:opacity-100"
|
||||
title={t("common.delete")}
|
||||
>
|
||||
<TrashIcon className="mu-icon text-mu-ink-muted hover:text-mu-danger transition-colors" />
|
||||
<TrashIcon className="mu-icon text-mu-text-secondary hover:text-mu-danger transition-colors" />
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
@@ -167,11 +167,11 @@ function SpaceInvitationMessage({ notification }: Props) {
|
||||
<SpaceMark icon={space.icon} size="lg" />
|
||||
<div className="min-w-0 flex-1">
|
||||
<div className="flex min-w-0 flex-wrap items-center gap-1.5">
|
||||
<span className="truncate mu-label text-mu-ink/95">{space.title}</span>
|
||||
<span className="mu-caption text-mu-ink-muted/70">{spaceUid}</span>
|
||||
<span className="truncate mu-label text-mu-text/95">{space.title}</span>
|
||||
<span className="mu-caption text-mu-text-secondary/70">{spaceUid}</span>
|
||||
<SpaceRoleBadge role={payload.role} />
|
||||
</div>
|
||||
<p className="line-clamp-1 mu-caption text-mu-ink-muted/80">
|
||||
<p className="line-clamp-1 mu-caption text-mu-text-secondary/80">
|
||||
{isPending ? space.description || t("setting.spaces.invited-to-join") : t("inbox.space-invitation-accepted")}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -15,7 +15,7 @@ const LearnMore: React.FC<Props> = (props: Props) => {
|
||||
return (
|
||||
<Tooltip.Provider>
|
||||
<Tooltip.Root>
|
||||
<Tooltip.Trigger render={<a className={`text-mu-ink-muted hover:text-mu-accent ${className}`} href={url} target="_blank" />}>
|
||||
<Tooltip.Trigger render={<a className={`text-mu-text-secondary hover:text-mu-accent ${className}`} href={url} target="_blank" />}>
|
||||
<ExternalLinkIcon className="mu-icon" />
|
||||
</Tooltip.Trigger>
|
||||
<Tooltip.Popup>
|
||||
|
||||
@@ -46,7 +46,7 @@ const LocaleOptions = () => {
|
||||
<Combobox.Item key={locale} value={locale}>
|
||||
<span className="flex min-w-0 flex-1 items-baseline gap-1.5">
|
||||
<span className="truncate">{localeLabel(locale)}</span>
|
||||
<span className="shrink-0 mu-caption text-mu-ink-muted">{locale}</span>
|
||||
<span className="shrink-0 mu-caption text-mu-text-secondary">{locale}</span>
|
||||
</span>
|
||||
</Combobox.Item>
|
||||
)}
|
||||
|
||||
@@ -189,7 +189,10 @@ export function MapView() {
|
||||
{!query.complete && !query.isError && (
|
||||
<p
|
||||
role="status"
|
||||
className={cn("absolute start-3 top-3 z-10 flex h-7 items-center px-2.5 mu-caption text-mu-ink-muted tabular-nums", surfaceClass)}
|
||||
className={cn(
|
||||
"absolute start-3 top-3 z-10 flex h-7 items-center px-2.5 mu-caption text-mu-text-secondary tabular-nums",
|
||||
surfaceClass,
|
||||
)}
|
||||
>
|
||||
{t("map.loaded", { count: query.memos.length })}
|
||||
</p>
|
||||
@@ -271,7 +274,7 @@ export function MapView() {
|
||||
<h2 className="font-medium">{t(filters.length ? "map.no-results" : "map.empty")}</h2>
|
||||
{/* Guests cannot add a location, so only filters get a hint for them. */}
|
||||
{(filters.length > 0 || user) && (
|
||||
<p className="mt-2 mu-body text-mu-ink-muted">{t(filters.length ? "map.no-results-hint" : "map.empty-hint")}</p>
|
||||
<p className="mt-2 mu-body text-mu-text-secondary">{t(filters.length ? "map.no-results-hint" : "map.empty-hint")}</p>
|
||||
)}
|
||||
{filters.length > 0 && (
|
||||
<Button className="mt-4" variant="neutral" onClick={() => removeFilter(() => true)}>
|
||||
|
||||
@@ -41,11 +41,11 @@ interface MediaMetadataDetailsProps {
|
||||
|
||||
const DetailRow = ({ icon: Icon, label, value, secondary, action }: DetailRowProps) => (
|
||||
<div className="grid grid-cols-[1rem_minmax(0,1fr)_auto] gap-x-2.5 py-2.5">
|
||||
<Icon className="mu-icon-sm mt-0.5 text-mu-ink-muted" aria-hidden="true" />
|
||||
<Icon className="mu-icon-sm mt-0.5 text-mu-text-secondary" aria-hidden="true" />
|
||||
<div className="min-w-0">
|
||||
<div className="mu-label-sm text-mu-ink-muted">{label}</div>
|
||||
<div className="mt-0.5 break-words mu-caption text-mu-ink tabular-nums">{value}</div>
|
||||
{secondary && <div className="mt-0.5 mu-caption text-mu-ink-muted">{secondary}</div>}
|
||||
<div className="mu-label-sm text-mu-text-secondary">{label}</div>
|
||||
<div className="mt-0.5 break-words mu-caption text-mu-text tabular-nums">{value}</div>
|
||||
{secondary && <div className="mt-0.5 mu-caption text-mu-text-secondary">{secondary}</div>}
|
||||
</div>
|
||||
{action && <div className="self-center">{action}</div>}
|
||||
</div>
|
||||
@@ -53,7 +53,7 @@ const DetailRow = ({ icon: Icon, label, value, secondary, action }: DetailRowPro
|
||||
|
||||
const DetailSection = ({ title, children }: { title: string; children: ReactNode }) => (
|
||||
<section>
|
||||
<h3 className="mb-0.5 mu-label-sm text-mu-ink-muted">{title}</h3>
|
||||
<h3 className="mb-0.5 mu-label-sm text-mu-text-secondary">{title}</h3>
|
||||
<div className="divide-y divide-mu-line">{children}</div>
|
||||
</section>
|
||||
);
|
||||
@@ -110,15 +110,15 @@ const MediaMetadataDetails = ({ id, item, onClose, className }: MediaMetadataDet
|
||||
aria-label={t("attachment-details.title")}
|
||||
data-theme="dark"
|
||||
className={cn(
|
||||
"absolute inset-x-0 bottom-0 z-40 flex max-h-[72vh] flex-col overflow-hidden rounded-t-mu-2xl border-t border-mu-line bg-mu-surface/96 text-mu-ink shadow-mu-pop backdrop-blur-xl lg:inset-y-0 lg:left-auto lg:w-[22rem] lg:max-h-none lg:rounded-none lg:border-l lg:border-t-0 lg:bg-mu-surface/85",
|
||||
"absolute inset-x-0 bottom-0 z-40 flex max-h-[72vh] flex-col overflow-hidden rounded-t-mu-2xl border-t border-mu-line bg-mu-surface/96 text-mu-text backdrop-blur-xl lg:inset-y-0 lg:left-auto lg:w-[22rem] lg:max-h-none lg:rounded-none lg:border-l lg:border-t-0 lg:bg-mu-surface/85",
|
||||
className,
|
||||
)}
|
||||
>
|
||||
<div className="mx-auto mt-2 h-1 w-8 rounded-full bg-mu-ink-muted/40 lg:hidden" aria-hidden="true" />
|
||||
<div className="mx-auto mt-2 h-1 w-8 rounded-full bg-mu-text-secondary/40 lg:hidden" aria-hidden="true" />
|
||||
<header className="flex shrink-0 items-center justify-between gap-3 border-b border-mu-line px-4 pb-3 pt-3 lg:pt-20">
|
||||
<div>
|
||||
<h2 className="mu-label text-mu-ink">{t("attachment-details.title")}</h2>
|
||||
<p className="mt-0.5 max-w-[16rem] truncate mu-caption text-mu-ink-muted">{item.filename}</p>
|
||||
<h2 className="mu-label text-mu-text">{t("attachment-details.title")}</h2>
|
||||
<p className="mt-0.5 max-w-[16rem] truncate mu-caption text-mu-text-secondary">{item.filename}</p>
|
||||
</div>
|
||||
<Button
|
||||
variant="ghost"
|
||||
@@ -205,12 +205,14 @@ const MediaMetadataDetails = ({ id, item, onClose, className }: MediaMetadataDet
|
||||
)}
|
||||
|
||||
{!details.hasSavedMetadata && (
|
||||
<p className="rounded-mu-xl border border-mu-line px-3 py-2.5 mu-caption text-mu-ink-muted">{t("attachment-details.empty")}</p>
|
||||
<p className="rounded-mu-xl border border-mu-line px-3 py-2.5 mu-caption text-mu-text-secondary">
|
||||
{t("attachment-details.empty")}
|
||||
</p>
|
||||
)}
|
||||
|
||||
{details.sourceExifOrientation !== undefined && (
|
||||
<details className="group border-t border-mu-line pt-3">
|
||||
<summary className="cursor-pointer select-none mu-label-sm text-mu-ink-muted hover:text-mu-ink">
|
||||
<summary className="cursor-pointer select-none mu-label-sm text-mu-text-secondary hover:text-mu-text">
|
||||
{t("attachment-details.sections.technical")}
|
||||
</summary>
|
||||
<div className="mt-2">
|
||||
|
||||
@@ -31,8 +31,10 @@ const MemoShareImagePreview = forwardRef<HTMLDivElement, { width: number }>(({ w
|
||||
<div className="flex min-w-0 items-center gap-2.5">
|
||||
<UserAvatar avatarUrl={preview.avatarUrl} name={preview.displayName} className="h-8 w-8" />
|
||||
<div className="min-w-0">
|
||||
<div className="truncate mu-label-sm text-mu-ink">{preview.displayName}</div>
|
||||
{preview.formattedDisplayTime && <div className="truncate mu-caption text-mu-ink-muted">{preview.formattedDisplayTime}</div>}
|
||||
<div className="truncate mu-label-sm text-mu-text">{preview.displayName}</div>
|
||||
{preview.formattedDisplayTime && (
|
||||
<div className="truncate mu-caption text-mu-text-secondary">{preview.formattedDisplayTime}</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -61,7 +63,7 @@ const MemoShareImagePreview = forwardRef<HTMLDivElement, { width: number }>(({ w
|
||||
>
|
||||
<img src={item.posterUrl} alt={item.filename} className="h-full w-full object-cover" loading="eager" decoding="async" />
|
||||
{index === 3 && preview.visualItems.length > 4 && (
|
||||
<div className="absolute inset-0 flex items-center justify-center bg-mu-ink/35 mu-title text-mu-canvas">
|
||||
<div className="absolute inset-0 flex items-center justify-center bg-mu-text/35 mu-title text-mu-canvas">
|
||||
+{preview.visualItems.length - 4}
|
||||
</div>
|
||||
)}
|
||||
@@ -75,7 +77,7 @@ const MemoShareImagePreview = forwardRef<HTMLDivElement, { width: number }>(({ w
|
||||
{preview.footerBadges.map((badge) => (
|
||||
<span
|
||||
key={badge.type}
|
||||
className="inline-flex rounded-full border border-mu-line/70 bg-mu-well/55 px-2 py-0.5 mu-caption text-mu-ink-muted"
|
||||
className="inline-flex rounded-full border border-mu-line/70 bg-mu-well/55 px-2 py-0.5 mu-caption text-mu-text-secondary"
|
||||
>
|
||||
{badge.count} {t("common.attachments").toLowerCase()}
|
||||
</span>
|
||||
|
||||
@@ -88,10 +88,10 @@ const MemoCommentSection = forwardRef<MemoCommentSectionHandle, Props>(
|
||||
) : (
|
||||
<div className="w-full flex flex-row justify-between items-center h-8 pl-3 mb-2">
|
||||
<div className="flex flex-row justify-start items-center">
|
||||
<MessageCircleIcon className="mu-icon w-5 h-auto text-mu-ink-muted mr-1" />
|
||||
<span className="text-mu-ink-muted mu-body">{t("memo.comment.self")}</span>
|
||||
<MessageCircleIcon className="mu-icon w-5 h-auto text-mu-text-secondary mr-1" />
|
||||
<span className="text-mu-text-secondary mu-body">{t("memo.comment.self")}</span>
|
||||
{/* The count sits beside the label as a plain number, as it does on a card's comment strip and in the sidebar. */}
|
||||
<span className="text-mu-ink-muted mu-caption tabular-nums ml-1.5">{commentCount}</span>
|
||||
<span className="text-mu-text-secondary mu-caption tabular-nums ml-1.5">{commentCount}</span>
|
||||
</div>
|
||||
{showCreateButton && (
|
||||
<Button variant="ghost" onPointerEnter={preloadEditor} onFocus={preloadEditor} onClick={openEditor}>
|
||||
|
||||
@@ -223,7 +223,7 @@ const MemoDetailSidebar = ({
|
||||
className={cn(
|
||||
SIDEBAR_ROW_CLASSES,
|
||||
sidebarRowStateClasses("idle"),
|
||||
"data-popup-open:bg-mu-hover/65 data-popup-open:text-mu-ink",
|
||||
"data-popup-open:bg-mu-hover/65 data-popup-open:text-mu-text",
|
||||
)}
|
||||
>
|
||||
<SidebarRowIconSlot icon={Share2Icon} />
|
||||
|
||||
@@ -54,7 +54,7 @@ function ShareLinkRow({ share, memoName }: ShareLinkRowProps) {
|
||||
return (
|
||||
<div className="flex flex-col gap-1 rounded-mu-md border border-mu-line p-3">
|
||||
<div className="flex items-center justify-between gap-2">
|
||||
<span className="truncate font-mono mu-caption text-mu-ink-muted">{url}</span>
|
||||
<span className="truncate font-mono mu-caption text-mu-text-secondary">{url}</span>
|
||||
<div className="flex shrink-0 items-center gap-1">
|
||||
<Tooltip.Root>
|
||||
<Tooltip.Trigger
|
||||
@@ -87,7 +87,7 @@ function ShareLinkRow({ share, memoName }: ShareLinkRowProps) {
|
||||
</Tooltip.Root>
|
||||
</div>
|
||||
</div>
|
||||
<p className="mu-caption text-mu-ink-muted">{formatExpiry(share, t)}</p>
|
||||
<p className="mu-caption text-mu-text-secondary">{formatExpiry(share, t)}</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -133,13 +133,13 @@ const MemoSharePanel = ({ open, onClose, memoName }: MemoSharePanelProps) => {
|
||||
<div className="flex flex-col gap-4 py-2">
|
||||
{/* Active links */}
|
||||
<div className="flex flex-col gap-2">
|
||||
<p className="mu-label text-mu-ink-muted">{t("memo.share.active-links")}</p>
|
||||
<p className="mu-label text-mu-text-secondary">{t("memo.share.active-links")}</p>
|
||||
{isLoading ? (
|
||||
<div className="flex flex-col gap-2" aria-busy="true" aria-label={t("editor.blocks.loading")}>
|
||||
<Skeleton height={32} />
|
||||
</div>
|
||||
) : shares.length === 0 ? (
|
||||
<p className="mu-body text-mu-ink-muted">{t("memo.share.no-links")}</p>
|
||||
<p className="mu-body text-mu-text-secondary">{t("memo.share.no-links")}</p>
|
||||
) : (
|
||||
<div className="flex flex-col gap-2">
|
||||
{shares.map((share) => (
|
||||
|
||||
@@ -32,7 +32,7 @@ function MemoDisplaySettingsContent() {
|
||||
return (
|
||||
<div className="flex flex-col gap-3">
|
||||
<ToggleGroup
|
||||
size="sm"
|
||||
size="md"
|
||||
fullWidth
|
||||
aria-label={t("memo.layout")}
|
||||
value={[String(maxColumns)]}
|
||||
|
||||
@@ -172,7 +172,7 @@ const MemoEditorDraft = ({ draft, ...editing }: MemoEditorDraftProps) => {
|
||||
aria-hidden
|
||||
className={cn("flex w-full flex-col gap-2 rounded-mu-lg border border-mu-line/70 bg-mu-surface px-4 py-3", editing.className)}
|
||||
>
|
||||
<div className="w-full text-base leading-6 text-mu-ink-muted">{editing.placeholder ?? " "}</div>
|
||||
<div className="w-full text-base leading-6 text-mu-text-secondary">{editing.placeholder ?? " "}</div>
|
||||
<div className="h-9 w-full" />
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -97,14 +97,14 @@ const AudienceMenu = ({ value, onChange, space, onSpaceChange, disabled }: Audie
|
||||
) : (
|
||||
<span
|
||||
aria-hidden
|
||||
className="flex size-5 shrink-0 items-center justify-center rounded-[5px] border border-dashed border-mu-ink-muted/45"
|
||||
className="flex size-5 shrink-0 items-center justify-center rounded-[5px] border border-dashed border-mu-text-secondary/45"
|
||||
>
|
||||
<PlusIcon className="mu-icon-xs" />
|
||||
</span>
|
||||
)
|
||||
}
|
||||
>
|
||||
{space ? destination : <span className="text-mu-ink-muted">{t("space.add-to")}</span>}
|
||||
{space ? destination : <span className="text-mu-text-secondary">{t("space.add-to")}</span>}
|
||||
</Menu.SubmenuTrigger>
|
||||
<Menu.Popup className="w-56">
|
||||
{spaceChoices.map((item) => {
|
||||
|
||||
@@ -132,7 +132,7 @@ export const EditorToolbar: FC<EditorToolbarProps> = ({
|
||||
<div className="flex shrink-0 flex-row items-center justify-end gap-1">
|
||||
{/* Markdown mode is said beside the commit button, where it never covers the text. */}
|
||||
{sourceMode.isSourceMode && (
|
||||
<span className="px-1.5 mu-label-xs font-mono text-mu-ink-muted select-none" aria-label={t("editor.markdown-mode")}>
|
||||
<span className="px-1.5 mu-label-xs font-mono text-mu-text-secondary select-none" aria-label={t("editor.markdown-mode")}>
|
||||
Markdown
|
||||
</span>
|
||||
)}
|
||||
|
||||
@@ -34,13 +34,13 @@ export const AudioRecorderPanel: FC<AudioRecorderPanelProps> = ({
|
||||
<div className="mu-compact flex h-7 w-full items-center justify-between gap-2">
|
||||
<div className="flex min-w-0 flex-1 items-center gap-2">
|
||||
{isRequestingPermission || isTranscribing ? (
|
||||
<Spinner size="sm" aria-hidden className="shrink-0 text-mu-ink-muted" />
|
||||
<Spinner size="sm" aria-hidden className="shrink-0 text-mu-text-secondary" />
|
||||
) : (
|
||||
<span aria-hidden className="size-2 shrink-0 rounded-full bg-mu-danger motion-safe:animate-pulse" />
|
||||
)}
|
||||
<span className="mu-visually-hidden">{srStatusText}</span>
|
||||
<VoiceWaveform levels={waveformLevels} className="max-w-[200px] overflow-hidden" />
|
||||
<span className="shrink-0 font-mono mu-caption tabular-nums text-mu-ink-muted">
|
||||
<span className="shrink-0 font-mono mu-caption tabular-nums text-mu-text-secondary">
|
||||
{isTranscribing ? t("editor.audio-recorder.transcribing") : formatAudioTime(elapsedSeconds)}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -22,7 +22,7 @@ export function SuggestionsBar({
|
||||
if (!suggestions.length) return null;
|
||||
return (
|
||||
<div role="group" aria-labelledby={labelId} className="flex w-full items-start gap-2 mu-caption">
|
||||
<span id={labelId} className="inline-flex h-6 shrink-0 items-center gap-1.5 text-mu-ink-muted">
|
||||
<span id={labelId} className="inline-flex h-6 shrink-0 items-center gap-1.5 text-mu-text-secondary">
|
||||
<ZapIcon className="mu-icon-sm" aria-hidden />
|
||||
{t("editor.suggestions")}
|
||||
</span>
|
||||
@@ -34,7 +34,7 @@ export function SuggestionsBar({
|
||||
disabled={disabled}
|
||||
aria-label={suggestion.accessibleLabel ?? suggestion.label}
|
||||
// A quiet pill until hovered, then the tag pill's own fill and ink, so it never reads as a tag already added.
|
||||
className="inline-flex h-6 max-w-full items-center gap-1 rounded-mu-md bg-mu-hover/60 ps-1.5 pe-2 text-mu-ink-muted transition-colors hover:bg-mu-well hover:text-mu-ink disabled:cursor-not-allowed disabled:opacity-45 mu-focus"
|
||||
className="inline-flex h-6 max-w-full items-center gap-1 rounded-mu-md bg-mu-hover/60 ps-1.5 pe-2 text-mu-text-secondary transition-colors hover:bg-mu-well hover:text-mu-text disabled:cursor-not-allowed disabled:opacity-45 border border-transparent mu-focus focus-visible:border-mu-focus"
|
||||
onClick={() => onAccept(suggestion.id)}
|
||||
>
|
||||
{suggestion.icon ? <suggestion.icon className="mu-icon-xs" aria-hidden /> : <PlusIcon className="mu-icon-xs" aria-hidden />}
|
||||
|
||||
@@ -45,7 +45,7 @@ const TimestampInput: FC<{
|
||||
|
||||
return (
|
||||
<div className="space-y-1">
|
||||
<label htmlFor={id} className="mu-label-sm text-mu-ink-muted">
|
||||
<label htmlFor={id} className="mu-label-sm text-mu-text-secondary">
|
||||
{label}
|
||||
{value !== initialValue.current && <span className="text-mu-primary ml-0.5">*</span>}
|
||||
</label>
|
||||
@@ -77,7 +77,7 @@ export const TimestampPopover: FC = () => {
|
||||
const createTime = useEditorSelector((s) => s.timestamps.createTime);
|
||||
const updateTime = useEditorSelector((s) => s.timestamps.updateTime);
|
||||
|
||||
if (!createTime) return <span className="shrink-0 whitespace-nowrap mu-caption text-mu-ink-muted select-none">{nowLabel()}</span>;
|
||||
if (!createTime) return <span className="shrink-0 whitespace-nowrap mu-caption text-mu-text-secondary select-none">{nowLabel()}</span>;
|
||||
|
||||
return (
|
||||
<Popover.Root>
|
||||
|
||||
@@ -24,7 +24,7 @@ export const VoiceWaveform: FC<VoiceWaveformProps> = ({ levels, className }) =>
|
||||
return (
|
||||
<span
|
||||
key={`bar-${i}`}
|
||||
className="w-[2px] shrink-0 rounded-full bg-mu-ink-muted transition-[height,opacity] duration-75 ease-out"
|
||||
className="w-[2px] shrink-0 rounded-full bg-mu-text-secondary transition-[height,opacity] duration-75 ease-out"
|
||||
style={{ height: `${h}px`, opacity }}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
export const FOCUS_MODE_STYLES = {
|
||||
backdrop: "fixed inset-0 bg-mu-overlay backdrop-blur-sm z-(--mu-layer-overlay)",
|
||||
container: {
|
||||
base: "fixed z-50 w-auto max-w-3xl mx-auto shadow-mu-pop border-mu-line h-auto overflow-y-auto pt-2 pb-4 sm:px-6",
|
||||
base: "fixed z-50 w-auto max-w-3xl mx-auto border-mu-line h-auto overflow-y-auto pt-2 pb-4 sm:px-6",
|
||||
spacing: "top-2 left-2 right-2 bottom-2 sm:top-4 sm:left-4 sm:right-4 sm:bottom-4 md:top-8 md:left-8 md:right-8 md:bottom-8",
|
||||
},
|
||||
/** The view transition name the session's frame carries while focus mode toggles (see editor.css). */
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
flex: 1 0 auto;
|
||||
}
|
||||
& .memo-editor-root {
|
||||
caret-color: var(--mu-ink);
|
||||
caret-color: var(--mu-text);
|
||||
outline: none;
|
||||
}
|
||||
& .memo-editor-root ::selection {
|
||||
@@ -113,7 +113,7 @@
|
||||
align-items: center;
|
||||
gap: 0.375rem;
|
||||
margin-inline-end: 0.125rem;
|
||||
color: var(--mu-ink-muted);
|
||||
color: var(--mu-text-secondary);
|
||||
}
|
||||
|
||||
.memo-upload-anchor[data-status="failed"] .memo-upload-anchor-message {
|
||||
@@ -135,11 +135,11 @@
|
||||
@usememos/ui popup surface and its tooltips the package's tooltip, so they line up with the
|
||||
app's own popups, without changing document typography or package internals. */
|
||||
.mbe-ui:is(.mbe-menu, .mbe-toolbar, .mbe-image-toolbar, .mbe-link-card, .mbe-input-popover) {
|
||||
border: 0;
|
||||
border: 1px solid var(--mu-edge);
|
||||
border-radius: var(--mu-radius-xl);
|
||||
background: var(--mu-surface);
|
||||
box-shadow: var(--mu-shadow-pop);
|
||||
color: var(--mu-ink);
|
||||
box-shadow: none;
|
||||
color: var(--mu-text);
|
||||
font: 400 13px / 18px var(--mu-font-sans);
|
||||
letter-spacing: 0;
|
||||
}
|
||||
|
||||
@@ -41,14 +41,14 @@ const LinkMetadataCard = ({ url, fallback, enabled = true }: LinkMetadataCardPro
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className={cn(
|
||||
"group my-0 mb-2 flex w-full max-w-full overflow-hidden rounded-mu-md border border-mu-line bg-mu-well/20 text-mu-ink no-underline transition-colors",
|
||||
"hover:border-mu-primary/35 hover:bg-mu-hover/20",
|
||||
"group my-0 mb-2 flex w-full max-w-full overflow-hidden rounded-mu-md border border-mu-edge bg-mu-well/20 text-mu-text no-underline transition-colors",
|
||||
"hover:bg-mu-hover/20 mu-focus focus-visible:border-mu-focus",
|
||||
)}
|
||||
>
|
||||
<span className="flex min-w-0 flex-1 flex-col gap-0.5 px-2.5 py-2 sm:gap-1 sm:px-3 sm:py-2.5">
|
||||
{hostname && <span className="truncate mu-caption text-mu-ink-muted">{hostname}</span>}
|
||||
{title && <span className="line-clamp-2 mu-label text-mu-ink">{title}</span>}
|
||||
{description && <span className="line-clamp-1 mu-caption text-mu-ink-muted sm:line-clamp-2">{description}</span>}
|
||||
{hostname && <span className="truncate mu-caption text-mu-text-secondary">{hostname}</span>}
|
||||
{title && <span className="line-clamp-2 mu-label text-mu-text">{title}</span>}
|
||||
{description && <span className="line-clamp-1 mu-caption text-mu-text-secondary sm:line-clamp-2">{description}</span>}
|
||||
</span>
|
||||
{image && !imageFailed && (
|
||||
<span className="flex w-24 shrink-0 items-center border-s border-mu-line/70 bg-mu-well/40 sm:w-40">
|
||||
|
||||
@@ -113,7 +113,7 @@ const MemoContentViewImpl = (props: MemoContentViewProps) => {
|
||||
};
|
||||
|
||||
return (
|
||||
<div className={`w-full flex flex-col justify-start items-start text-mu-ink ${className || ""}`}>
|
||||
<div className={`w-full flex flex-col justify-start items-start text-mu-text ${className || ""}`}>
|
||||
<div
|
||||
ref={contentRef}
|
||||
data-memo-content
|
||||
|
||||
@@ -105,15 +105,15 @@ const FilterChip = ({ icon: Icon, customIcon, label, onRemove, onEdit }: FilterC
|
||||
const t = useTranslate();
|
||||
const body = (
|
||||
<>
|
||||
{customIcon ?? (Icon && <Icon className="mu-icon-sm text-mu-ink-muted shrink-0" />)}
|
||||
<span className={cn("text-mu-ink/80 truncate", onEdit ? "font-mono mu-caption max-w-64" : "font-medium max-w-32")}>{label}</span>
|
||||
{customIcon ?? (Icon && <Icon className="mu-icon-sm text-mu-text-secondary shrink-0" />)}
|
||||
<span className={cn("text-mu-text/80 truncate", onEdit ? "font-mono mu-caption max-w-64" : "font-medium max-w-32")}>{label}</span>
|
||||
</>
|
||||
);
|
||||
return (
|
||||
<div
|
||||
className={cn(
|
||||
"group inline-flex min-w-0 max-w-full items-center gap-1.5 h-7 px-2.5",
|
||||
"bg-mu-hover/50 hover:bg-mu-hover border border-mu-line/50 rounded-full mu-body transition-all duration-200 hover:shadow-mu-key",
|
||||
"bg-mu-hover/50 hover:bg-mu-hover border border-mu-line/50 rounded-full mu-body transition-all duration-200",
|
||||
)}
|
||||
>
|
||||
{onEdit ? (
|
||||
@@ -168,7 +168,7 @@ const MemoFilters = ({ className }: { className?: string }) => {
|
||||
const view = memoViews.find((item) => getMemoViewId(item.name) === memoView);
|
||||
return view?.title
|
||||
? {
|
||||
customIcon: <MemoViewIcon icon={view.icon} className="mu-icon-sm text-sm text-mu-ink-muted" />,
|
||||
customIcon: <MemoViewIcon icon={view.icon} className="mu-icon-sm text-sm text-mu-text-secondary" />,
|
||||
label: view.title,
|
||||
}
|
||||
: null;
|
||||
|
||||
@@ -62,7 +62,8 @@ const TILE_PLACEHOLDER_CLASS = "border-dashed border-mu-edge bg-mu-well/50 shado
|
||||
/** The same for a row: an outlined, empty row. */
|
||||
const ROW_PLACEHOLDER_CLASS = "bg-transparent shadow-[inset_0_0_0_1px_var(--mu-edge)] hover:bg-transparent [&>*]:invisible";
|
||||
/** The lifted copy that follows the pointer while an item is dragged. */
|
||||
const GHOST_CLASS = "pointer-events-none fixed start-0 top-0 z-(--mu-layer-popup) overflow-hidden rounded-mu-md shadow-mu-pop [scale:1.03]";
|
||||
const GHOST_CLASS =
|
||||
"pointer-events-none fixed start-0 top-0 z-(--mu-layer-popup) overflow-hidden rounded-mu-md border border-mu-edge [scale:1.03]";
|
||||
|
||||
/** The attributes a reorderable item carries for `useDragReorder`. */
|
||||
interface ReorderAttributes {
|
||||
@@ -160,7 +161,7 @@ const AttachmentTile: FC<{
|
||||
item: AttachmentItem;
|
||||
actions: ItemActions;
|
||||
className?: string;
|
||||
/** A drawing alone in the gallery is a raised sheet, as in the saved memo; among others it is framed like them. */
|
||||
/** A drawing alone in the gallery is a bordered sheet, as in the saved memo; among others it is framed like them. */
|
||||
alone: boolean;
|
||||
/** The tile is being dragged: its place shows as an empty slot while a lifted copy follows the pointer. */
|
||||
placeholder: boolean;
|
||||
@@ -188,7 +189,7 @@ const AttachmentTile: FC<{
|
||||
className={cn(
|
||||
VISUAL_TILE_BUTTON_CLASS,
|
||||
"group/tile h-full min-h-0 touch-manipulation cursor-grab select-none [-webkit-touch-callout:none]",
|
||||
drawing && alone && "border-0 shadow-mu-raised",
|
||||
drawing && alone && "border-mu-edge",
|
||||
placeholder && TILE_PLACEHOLDER_CLASS,
|
||||
className,
|
||||
)}
|
||||
@@ -209,7 +210,7 @@ const AttachmentTile: FC<{
|
||||
{item.category === "motion" && <span className={cn(TILE_BADGE_CLASS, "start-2 top-2")}>{t("attachment-library.labels.live")}</span>}
|
||||
{actions.badge && <span className={cn(TILE_BADGE_CLASS, "bottom-2 start-2")}>{actions.badge}</span>}
|
||||
{actions.isUploadingInline && (
|
||||
<div className="absolute inset-0 flex items-center justify-center bg-mu-surface/40 text-mu-ink">
|
||||
<div className="absolute inset-0 flex items-center justify-center bg-mu-surface/40 text-mu-text">
|
||||
<Spinner label={t("editor.insert-menu.uploading-inline-image")} />
|
||||
</div>
|
||||
)}
|
||||
@@ -303,9 +304,9 @@ const AttachmentRow: FC<{
|
||||
/>
|
||||
</>
|
||||
) : category === "audio" ? (
|
||||
<FileAudioIcon className="mu-icon-sm text-mu-ink-muted" />
|
||||
<FileAudioIcon className="mu-icon-sm text-mu-text-secondary" />
|
||||
) : (
|
||||
<FileIcon className="mu-icon-sm text-mu-ink-muted" />
|
||||
<FileIcon className="mu-icon-sm text-mu-text-secondary" />
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -641,14 +642,14 @@ const AttachmentListEditor: FC<AttachmentListEditorProps> = ({
|
||||
createPortal(
|
||||
<div
|
||||
ref={rowDrag.ghostRef}
|
||||
className={cn(GHOST_CLASS, "flex items-center gap-1 bg-mu-surface px-2 mu-caption text-mu-ink")}
|
||||
className={cn(GHOST_CLASS, "flex items-center gap-1 bg-mu-surface px-2 mu-caption text-mu-text")}
|
||||
style={{ width: rowDrag.grab.width, height: rowDrag.grab.height, translate: `${rowDrag.grab.left}px ${rowDrag.grab.top}px` }}
|
||||
>
|
||||
<span className={METADATA_ROW_SLOT_CLASSES}>
|
||||
{draggedRow.category === "audio" ? (
|
||||
<FileAudioIcon className="mu-icon-sm text-mu-ink-muted" />
|
||||
<FileAudioIcon className="mu-icon-sm text-mu-text-secondary" />
|
||||
) : (
|
||||
<FileIcon className="mu-icon-sm text-mu-ink-muted" />
|
||||
<FileIcon className="mu-icon-sm text-mu-text-secondary" />
|
||||
)}
|
||||
</span>
|
||||
<span className="min-w-0 flex-1 truncate">{draggedRow.filename}</span>
|
||||
|
||||
@@ -104,7 +104,7 @@ const readPaperColor = (img: HTMLImageElement): string | undefined => {
|
||||
|
||||
/**
|
||||
* A drawing as a sheet of paper. The sheet extends the drawing's own paper beyond its edges, so
|
||||
* it can be any size. On its own it is a raised sheet; in a collage (`framed`) it takes the photos'
|
||||
* it can be any size. On its own it is a bordered sheet; in a collage (`framed`) it takes the photos'
|
||||
* hairline frame, so every cell of the grid has the same edge. The image is the original file at 2x: exports carry 2 pixels per drawn
|
||||
* pixel, so it shows at the size it was drawn and keeps strokes and text sharp.
|
||||
*/
|
||||
@@ -147,7 +147,7 @@ const DrawingTile = ({
|
||||
const VideoPlayBadge = ({ className, children }: PropsWithChildren<{ className?: string }>) => (
|
||||
<div
|
||||
className={cn(
|
||||
"pointer-events-none absolute flex items-center justify-center rounded-full bg-mu-canvas/80 text-mu-ink/70 backdrop-blur-sm",
|
||||
"pointer-events-none absolute flex items-center justify-center rounded-full bg-mu-canvas/80 text-mu-text/70 backdrop-blur-sm",
|
||||
className,
|
||||
)}
|
||||
>
|
||||
|
||||
@@ -55,7 +55,7 @@ const AudioProgressBar = ({ filename, currentTime, duration, onSeek }: AudioProg
|
||||
[&::-webkit-slider-runnable-track]:bg-transparent
|
||||
[&::-webkit-slider-thumb]:mt-[-4px] [&::-webkit-slider-thumb]:size-3 [&::-webkit-slider-thumb]:appearance-none
|
||||
[&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border [&::-webkit-slider-thumb]:border-mu-line
|
||||
[&::-webkit-slider-thumb]:bg-mu-canvas [&::-webkit-slider-thumb]:shadow-mu-key
|
||||
[&::-webkit-slider-thumb]:bg-mu-canvas
|
||||
[&::-moz-range-track]:h-1 [&::-moz-range-track]:rounded-full [&::-moz-range-track]:bg-transparent
|
||||
[&::-moz-range-thumb]:size-3 [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:border
|
||||
[&::-moz-range-thumb]:border-mu-line [&::-moz-range-thumb]:bg-mu-canvas"
|
||||
@@ -183,7 +183,7 @@ const AudioAttachmentItem = ({ filename, sourceUrl, mimeType, size }: AudioAttac
|
||||
|
||||
<div className="flex flex-col gap-1">
|
||||
<AudioProgressBar filename={filename} currentTime={currentTime} duration={duration} onSeek={handleSeek} />
|
||||
<div className="flex items-center justify-between mu-caption tabular-nums text-mu-ink-muted/60">
|
||||
<div className="flex items-center justify-between mu-caption tabular-nums text-mu-text-secondary/60">
|
||||
<span>{formatAudioTime(currentTime)}</span>
|
||||
<span>{getDurationLabel(duration)}</span>
|
||||
</div>
|
||||
|
||||
@@ -3,18 +3,13 @@
|
||||
* Hover uses `group/media` on {@link MEDIA_HOVER_SURFACE_CLASS} so scale/gradient track the media surface, not the outer button chrome.
|
||||
*/
|
||||
|
||||
// No `outline-none`: as a utility it would override `mu-focus` and hide the keyboard outline.
|
||||
// Reserve a real border so `mu-focus` can change its color.
|
||||
export const VISUAL_TILE_BUTTON_CLASS =
|
||||
"relative block overflow-hidden rounded-mu-md border border-mu-line/70 bg-mu-well/30 p-0 text-left transition-colors mu-focus";
|
||||
"relative block overflow-hidden rounded-mu-md border border-mu-line/70 bg-mu-well/30 p-0 text-left transition-colors mu-focus focus-visible:border-mu-focus";
|
||||
|
||||
/**
|
||||
* A lone drawing is a sheet of paper on the card rather than a photo in a frame: no tile border or
|
||||
* well, just the package's raised edge, the same in both themes. Hover lifts it a little more
|
||||
* instead of the photo scrim and zoom. In a collage a drawing takes the photos' hairline frame
|
||||
* instead, so one grid never mixes two edges.
|
||||
*/
|
||||
/** A lone drawing uses a flat paper surface; a collage uses the photos' shared frame. */
|
||||
export const DRAWING_SHEET_TILE_CLASS =
|
||||
"relative block overflow-hidden rounded-mu-md p-0 text-left shadow-mu-raised transition-shadow hover:shadow-mu-key mu-focus";
|
||||
"relative block overflow-hidden rounded-mu-md p-0 text-left border border-mu-edge transition-colors mu-focus focus-visible:border-mu-focus";
|
||||
|
||||
/** A lone drawing: the sheet spans the column, at least 160px tall, with the drawing centered on it. */
|
||||
export const DRAWING_SHEET_SINGLE_CLASS = "flex w-full min-h-40 items-center justify-center";
|
||||
@@ -45,9 +40,9 @@ export const VISUAL_Z = {
|
||||
overflowMask: "z-[3]",
|
||||
} as const;
|
||||
|
||||
export const MEDIA_HOVER_GRADIENT_CLASS = `pointer-events-none absolute inset-0 ${VISUAL_Z.gradient} bg-gradient-to-t from-mu-ink/15 via-transparent to-transparent opacity-0 transition-opacity group-hover/media:opacity-100`;
|
||||
export const MEDIA_HOVER_GRADIENT_CLASS = `pointer-events-none absolute inset-0 ${VISUAL_Z.gradient} bg-gradient-to-t from-mu-text/15 via-transparent to-transparent opacity-0 transition-opacity group-hover/media:opacity-100`;
|
||||
|
||||
export const COLLAGE_VIDEO_PLAY_BADGE_CLASS = `bottom-2 right-2 ${VISUAL_Z.badge} h-7 w-7 bg-mu-canvas/80 text-mu-ink/70`;
|
||||
export const COLLAGE_VIDEO_PLAY_BADGE_CLASS = `bottom-2 right-2 ${VISUAL_Z.badge} h-7 w-7 bg-mu-canvas/80 text-mu-text/70`;
|
||||
|
||||
export const OVERFLOW_TILE_OVERLAY_CLASS = `pointer-events-none absolute inset-0 ${VISUAL_Z.overflowMask} flex items-center justify-center bg-black/45 mu-heading text-white backdrop-blur-[2px]`;
|
||||
|
||||
@@ -56,4 +51,4 @@ export const OVERFLOW_TILE_OVERLAY_CLASS = `pointer-events-none absolute inset-0
|
||||
* motion photo's Live badge, but not a control.
|
||||
*/
|
||||
export const TILE_BADGE_CLASS =
|
||||
"pointer-events-none absolute select-none rounded-full border border-mu-line/45 bg-mu-canvas/65 px-2 py-0.5 mu-label-xs uppercase tracking-wide text-mu-ink backdrop-blur-sm";
|
||||
"pointer-events-none absolute select-none rounded-full border border-mu-line/45 bg-mu-canvas/65 px-2 py-0.5 mu-label-xs uppercase tracking-wide text-mu-text backdrop-blur-sm";
|
||||
|
||||
@@ -30,7 +30,7 @@ const LocationDisplayView = ({ location }: LocationDisplayViewProps) => {
|
||||
{popoverOpen && <LazyLocationPicker latlng={{ lat: location.latitude, lng: location.longitude }} readonly className="h-52" />}
|
||||
<div className="space-y-1">
|
||||
{location.placeholder.trim() && <p className="wrap-anywhere mu-label">{displayText}</p>}
|
||||
<p className="mu-caption tabular-nums text-mu-ink-muted">{getLocationCoordinatesText(location, 6)}</p>
|
||||
<p className="mu-caption tabular-nums text-mu-text-secondary">{getLocationCoordinatesText(location, 6)}</p>
|
||||
</div>
|
||||
</Popover.Popup>
|
||||
</Popover.Root>
|
||||
|
||||
@@ -11,12 +11,12 @@ import { cn } from "@/lib/utils";
|
||||
* sit on a card rather than the sidebar surface.
|
||||
*/
|
||||
export const METADATA_ROW_BOX_CLASSES =
|
||||
"group/row relative flex h-7 w-full min-w-0 items-center gap-1 rounded-mu-md px-2 text-start mu-caption text-mu-ink-muted transition-colors hover:bg-mu-hover hover:text-mu-ink";
|
||||
"group/row relative flex h-7 w-full min-w-0 items-center gap-1 rounded-mu-md px-2 text-start mu-caption text-mu-text-secondary transition-colors hover:bg-mu-hover hover:text-mu-text";
|
||||
/** A row that is itself the control: the box, the focus outline, and the quiet "on" fill while pressed or holding a popup open. */
|
||||
export const METADATA_ROW_CLASSES = cn(
|
||||
METADATA_ROW_BOX_CLASSES,
|
||||
"aria-pressed:bg-mu-hover aria-pressed:text-mu-ink data-popup-open:bg-mu-hover data-popup-open:text-mu-ink",
|
||||
"mu-focus",
|
||||
"aria-pressed:bg-mu-hover aria-pressed:text-mu-text data-popup-open:bg-mu-hover data-popup-open:text-mu-text",
|
||||
"border border-transparent mu-focus focus-visible:border-mu-focus",
|
||||
);
|
||||
/**
|
||||
* The compact row: 24px instead of 28px, for a list that previews rather than edits (the
|
||||
@@ -24,7 +24,8 @@ export const METADATA_ROW_CLASSES = cn(
|
||||
*/
|
||||
export const METADATA_COMPACT_ROW_CLASSES = cn(METADATA_ROW_CLASSES, "h-6");
|
||||
/** The focusable body of a split row; its gap must equal the box's `gap-1`. */
|
||||
export const METADATA_ROW_LABEL_CLASSES = "flex h-full min-w-0 flex-1 items-center gap-1 text-start mu-focus";
|
||||
export const METADATA_ROW_LABEL_CLASSES =
|
||||
"flex h-full min-w-0 flex-1 items-center gap-1 text-start border border-transparent mu-focus focus-visible:border-mu-focus";
|
||||
/** The same 20px leading column the sidebar's rows reserve, so glyphs share one rail across both. */
|
||||
export const METADATA_ROW_SLOT_CLASSES = SIDEBAR_LEADING_SLOT_CLASSES;
|
||||
export const METADATA_ROW_ICON_CLASSES = "mu-icon-sm me-auto shrink-0";
|
||||
@@ -35,8 +36,8 @@ export const METADATA_ROW_ICON_CLASSES = "mu-icon-sm me-auto shrink-0";
|
||||
*/
|
||||
export const METADATA_ROW_TEXT_CLASSES = "min-w-0 flex-1 truncate";
|
||||
/** An attachment is content, not a description, so its row text keeps the memo's ink. */
|
||||
export const METADATA_ROW_CONTENT_TEXT_CLASSES = cn(METADATA_ROW_TEXT_CLASSES, "text-mu-ink");
|
||||
export const METADATA_ROW_DETAIL_CLASSES = "shrink-0 mu-caption tabular-nums text-mu-ink-muted";
|
||||
export const METADATA_ROW_CONTENT_TEXT_CLASSES = cn(METADATA_ROW_TEXT_CLASSES, "text-mu-text");
|
||||
export const METADATA_ROW_DETAIL_CLASSES = "shrink-0 mu-caption tabular-nums text-mu-text-secondary";
|
||||
/**
|
||||
* A slot that is itself a control (play, disclosure): the same box and glyph as any other
|
||||
* slot, so it reads like its siblings at rest. The glyph darkens under the pointer and
|
||||
@@ -44,8 +45,8 @@ export const METADATA_ROW_DETAIL_CLASSES = "shrink-0 mu-caption tabular-nums tex
|
||||
*/
|
||||
export const METADATA_ROW_SLOT_BUTTON_CLASSES = cn(
|
||||
METADATA_ROW_SLOT_CLASSES,
|
||||
"relative cursor-pointer rounded transition-colors hover:text-mu-ink aria-pressed:text-mu-primary after:absolute after:-inset-0.5 after:content-['']",
|
||||
"mu-focus",
|
||||
"relative cursor-pointer rounded transition-colors hover:text-mu-text aria-pressed:text-mu-primary after:absolute after:-inset-0.5 after:content-['']",
|
||||
"border border-transparent mu-focus focus-visible:border-mu-focus",
|
||||
);
|
||||
|
||||
/*
|
||||
@@ -97,7 +98,7 @@ export const MetadataRowDetail = ({ parts }: { parts: Array<string | undefined>
|
||||
<span className={DETAIL_RAIL_CLASSES}>
|
||||
{shown.map((part, index) => (
|
||||
<span key={part} className="flex items-center gap-1">
|
||||
{index > 0 && <span className="text-mu-ink-muted/40">·</span>}
|
||||
{index > 0 && <span className="text-mu-text-secondary/40">·</span>}
|
||||
<span>{part}</span>
|
||||
</span>
|
||||
))}
|
||||
@@ -132,7 +133,7 @@ interface MetadataSectionProps extends PropsWithChildren {
|
||||
const MetadataSection = ({ title, count, action, density = "default", children }: MetadataSectionProps) => (
|
||||
<section className="w-full" aria-label={title}>
|
||||
<div className={cn("flex min-w-0 items-center justify-between gap-2", density === "compact" ? "h-5" : "mb-0.5 h-6")}>
|
||||
<h3 className="flex min-w-0 items-center gap-1.5 mu-label-sm text-mu-ink-muted select-none">
|
||||
<h3 className="flex min-w-0 items-center gap-1.5 mu-label-sm text-mu-text-secondary select-none">
|
||||
<span className="truncate">{title}</span>
|
||||
{count != null && <span className="mu-caption tabular-nums">{count}</span>}
|
||||
</h3>
|
||||
|
||||
@@ -47,7 +47,9 @@ export const LinkMemoDialog = ({
|
||||
<div className="border-t border-mu-line" />
|
||||
<div className="max-h-[320px] overflow-y-auto">
|
||||
{filteredMemos.length === 0 ? (
|
||||
<div className="py-8 text-center mu-body text-mu-ink-muted">{isFetching ? "Loading..." : t("reference.no-memos-found")}</div>
|
||||
<div className="py-8 text-center mu-body text-mu-text-secondary">
|
||||
{isFetching ? "Loading..." : t("reference.no-memos-found")}
|
||||
</div>
|
||||
) : (
|
||||
filteredMemos.map((memo) => {
|
||||
const alreadyLinked = isAlreadyLinked(memo.name);
|
||||
@@ -61,7 +63,7 @@ export const LinkMemoDialog = ({
|
||||
onClick={() => !alreadyLinked && onSelectMemo(memo)}
|
||||
>
|
||||
<div className="w-full flex flex-col gap-1">
|
||||
<div className="flex items-center gap-1.5 mu-body text-mu-ink-muted select-none">
|
||||
<div className="flex items-center gap-1.5 mu-body text-mu-text-secondary select-none">
|
||||
{alreadyLinked && <LinkIcon className="mu-icon-xs shrink-0" />}
|
||||
<span>{memo.createTime && timestampDate(memo.createTime).toLocaleString()}</span>
|
||||
</div>
|
||||
|
||||
@@ -34,7 +34,7 @@ const RelationRow = ({ memo, parentPage, icon = LinkIcon, variant = "row", trail
|
||||
>
|
||||
<MetadataRowIconSlot icon={icon} />
|
||||
<span className={METADATA_ROW_TEXT_CLASSES}>
|
||||
{memo.snippet || <span className="italic text-mu-ink-muted/60">{t("common.no-content")}</span>}
|
||||
{memo.snippet || <span className="italic text-mu-text-secondary/60">{t("common.no-content")}</span>}
|
||||
</span>
|
||||
{trailing}
|
||||
</Link>
|
||||
|
||||
@@ -17,7 +17,7 @@ const PANEL_WIDTH_VAR = "--memo-panel-width";
|
||||
/** The card's current width as a CSS expression, for pages that give way to it. */
|
||||
export const MEMO_PANEL_WIDTH_CSS = `var(${PANEL_WIDTH_VAR})`;
|
||||
/** The title's type, shared with hosts that show the same content inline without the card. */
|
||||
export const MEMO_PANEL_TITLE_CLASS = "truncate mu-title text-mu-ink";
|
||||
export const MEMO_PANEL_TITLE_CLASS = "truncate mu-title text-mu-text";
|
||||
const PANEL_DEFAULT_WIDTH = 400;
|
||||
const PANEL_MIN_WIDTH = 320;
|
||||
const PANEL_MAX_WIDTH = 640;
|
||||
@@ -127,9 +127,8 @@ export function MemoPanel({ open, title, subtitle, reservedWidth, busy = false,
|
||||
aria-describedby={undefined}
|
||||
style={!desktop ? { height: `${sheetShare * 100}dvh` } : undefined}
|
||||
className={cn(
|
||||
// A popover surface: lighter than the page in both themes, with the float shadow
|
||||
// rather than the tight card shadow, so a 400px card reads as lifted, not pasted on.
|
||||
"fixed z-30 flex min-h-0 flex-col border border-mu-line/70 bg-mu-surface text-mu-ink shadow-mu-pop outline-none transition-transform duration-200",
|
||||
// A popover surface: lighter than the page in both themes.
|
||||
"fixed z-30 flex min-h-0 flex-col border border-mu-line/70 bg-mu-surface text-mu-text outline-none transition-transform duration-200",
|
||||
desktop
|
||||
? "inset-y-3 end-3 w-[var(--memo-panel-width)] rounded-mu-xl data-starting-style:translate-x-full data-ending-style:translate-x-full"
|
||||
: "inset-x-0 bottom-0 rounded-t-mu-2xl pb-[env(safe-area-inset-bottom)] data-starting-style:translate-y-full data-ending-style:translate-y-full",
|
||||
@@ -158,13 +157,13 @@ export function MemoPanel({ open, title, subtitle, reservedWidth, busy = false,
|
||||
aria-label={t(expanded ? "common.collapse-panel" : "common.expand-panel")}
|
||||
onClick={() => setExpanded((value) => !value)}
|
||||
>
|
||||
<span className="h-1 w-10 rounded-full bg-mu-ink-muted/35" />
|
||||
<span className="h-1 w-10 rounded-full bg-mu-text-secondary/35" />
|
||||
</button>
|
||||
)}
|
||||
<header className="flex shrink-0 items-center gap-0.5 border-b border-mu-line/70 py-2.5 ps-3 pe-3">
|
||||
<div className="min-w-0 flex-1">
|
||||
<Dialog.Title className={MEMO_PANEL_TITLE_CLASS}>{shown.title}</Dialog.Title>
|
||||
{shown.subtitle && <p className="truncate mu-caption text-mu-ink-muted">{shown.subtitle}</p>}
|
||||
{shown.subtitle && <p className="truncate mu-caption text-mu-text-secondary">{shown.subtitle}</p>}
|
||||
</div>
|
||||
<Dialog.Close disabled={busy} render={<Button variant="ghost" size="sm" aria-label={t("common.close")} icon={<XIcon />} />} />
|
||||
</header>
|
||||
|
||||
@@ -85,7 +85,7 @@ export function MemoPanelList({ memos, selectionKey, timeDisplay, emptyText, com
|
||||
/>
|
||||
))}
|
||||
</MentionResolutionProvider>
|
||||
{emptyText && memos.length === 0 && <p className="mu-body text-mu-ink-muted">{emptyText}</p>}
|
||||
{emptyText && memos.length === 0 && <p className="mu-body text-mu-text-secondary">{emptyText}</p>}
|
||||
{compose &&
|
||||
isUserSettingsInitialized &&
|
||||
(composing ? (
|
||||
|
||||
@@ -6,7 +6,7 @@ export type MemoParentStatus = "loading" | "unavailable" | "error";
|
||||
export default function MemoParentPlaceholder({ status, onRetry }: { status: MemoParentStatus; onRetry?: () => void }) {
|
||||
const t = useTranslate();
|
||||
return (
|
||||
<div className="px-2 py-1.5 mu-caption text-mu-ink-muted" role="status">
|
||||
<div className="px-2 py-1.5 mu-caption text-mu-text-secondary" role="status">
|
||||
<p>{t(status === "loading" ? "memo.parent-loading" : status === "error" ? "memo.parent-load-error" : "memo.parent-unavailable")}</p>
|
||||
{status === "unavailable" && <p className="mt-1 leading-5">{t("memo.parent-unavailable-description")}</p>}
|
||||
{status === "error" && onRetry && (
|
||||
|
||||
@@ -72,7 +72,7 @@ const AttachmentThumbnails = ({ attachments }: { attachments: Attachment[] }) =>
|
||||
</div>
|
||||
))}
|
||||
{others.map((item) => (
|
||||
<div key={item.id} className="flex items-center gap-1 mu-caption text-mu-ink-muted">
|
||||
<div key={item.id} className="flex items-center gap-1 mu-caption text-mu-text-secondary">
|
||||
<FileIcon className="mu-icon-xs shrink-0" />
|
||||
<span className="truncate max-w-[80px]">{item.filename}</span>
|
||||
</div>
|
||||
@@ -100,8 +100,8 @@ const PreviewMeta = ({
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="flex min-w-0 shrink-0 items-center gap-1.5 mu-caption text-mu-ink-muted">
|
||||
{showMemoId && memoId && <span className="shrink-0 font-mono mu-caption text-mu-ink-muted/60">{memoId}</span>}
|
||||
<div className="flex min-w-0 shrink-0 items-center gap-1.5 mu-caption text-mu-text-secondary">
|
||||
{showMemoId && memoId && <span className="shrink-0 font-mono mu-caption text-mu-text-secondary/60">{memoId}</span>}
|
||||
{showCreator && creatorName && <span className="max-w-32 truncate">{creatorName}</span>}
|
||||
</div>
|
||||
);
|
||||
@@ -131,9 +131,9 @@ const MemoPreview = ({
|
||||
const meta = <PreviewMeta creator={creator} showCreator={showCreator} memoName={name} showMemoId={showMemoId} />;
|
||||
const contentNode = truncate ? (
|
||||
hasContent ? (
|
||||
<div className="min-w-0 truncate mu-caption text-mu-ink-muted">{content}</div>
|
||||
<div className="min-w-0 truncate mu-caption text-mu-text-secondary">{content}</div>
|
||||
) : hasAttachments ? null : (
|
||||
<div className="min-w-0 truncate mu-caption text-mu-ink-muted">{t("common.no-content")}</div>
|
||||
<div className="min-w-0 truncate mu-caption text-mu-text-secondary">{t("common.no-content")}</div>
|
||||
)
|
||||
) : (
|
||||
// Previews are inert (pointer-events-none), so a static CSS bound replaces the
|
||||
@@ -154,7 +154,7 @@ const MemoPreview = ({
|
||||
{contentNode}
|
||||
{hasAttachments &&
|
||||
(truncate ? (
|
||||
<div className="inline-flex shrink-0 items-center justify-center gap-0.5 text-mu-ink-muted/60">
|
||||
<div className="inline-flex shrink-0 items-center justify-center gap-0.5 text-mu-text-secondary/60">
|
||||
<FileIcon className="mu-icon-xs inline-block" />
|
||||
<span className="mu-caption tabular-nums">{countLogicalAttachmentItems(attachmentOnlyItems)}</span>
|
||||
</div>
|
||||
|
||||
@@ -1,17 +1,15 @@
|
||||
import { Popover, Tooltip } from "@usememos/ui";
|
||||
import { Button, Popover, Toggle, Tooltip } from "@usememos/ui";
|
||||
import { SmilePlusIcon } from "lucide-react";
|
||||
import { type ReactElement, useState } from "react";
|
||||
import { type ReactElement, useRef, useState } from "react";
|
||||
import { useInstance } from "@/contexts/InstanceContext";
|
||||
import { cn } from "@/lib/utils";
|
||||
import type { Memo } from "@/types/proto/api/memo_service_pb";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
import { useReactionActions } from "./hooks";
|
||||
import { REACTION_ADD_CLASSES } from "./ReactionView";
|
||||
|
||||
interface Props {
|
||||
memo: Memo;
|
||||
/**
|
||||
* The element that opens the picker. Defaults to the round add control that closes a
|
||||
* The element that opens the picker. Defaults to the quiet add control that closes a
|
||||
* strip of reaction pills; a host with its own action grammar (the memo header) passes
|
||||
* the control that belongs there.
|
||||
*/
|
||||
@@ -22,23 +20,34 @@ interface Props {
|
||||
const ReactionSelector = ({ memo, trigger }: Props) => {
|
||||
const t = useTranslate();
|
||||
const [open, setOpen] = useState(false);
|
||||
const triggerRef = useRef<HTMLButtonElement>(null);
|
||||
const popupRef = useRef<HTMLDivElement>(null);
|
||||
const { memoRelatedSetting } = useInstance();
|
||||
|
||||
const { hasReacted, handleReactionClick } = useReactionActions({
|
||||
memo,
|
||||
onComplete: () => setOpen(false),
|
||||
onComplete: () => {
|
||||
if (popupRef.current?.contains(document.activeElement)) triggerRef.current?.focus({ preventScroll: true });
|
||||
setOpen(false);
|
||||
},
|
||||
});
|
||||
|
||||
return (
|
||||
<Popover.Root open={open} onOpenChange={setOpen}>
|
||||
<Popover.Root
|
||||
open={open}
|
||||
onOpenChange={(nextOpen, details) => {
|
||||
// Focus must reach the header trigger before closing hides its wrapper.
|
||||
if (!nextOpen && details.reason === "escape-key") triggerRef.current?.focus({ preventScroll: true });
|
||||
setOpen(nextOpen);
|
||||
}}
|
||||
>
|
||||
<Tooltip.Root>
|
||||
<Tooltip.Trigger
|
||||
render={
|
||||
<Popover.Trigger
|
||||
ref={triggerRef}
|
||||
aria-label={t("setting.memo.add-reaction")}
|
||||
render={trigger ?? <button type="button" className={REACTION_ADD_CLASSES} />}
|
||||
// A host trigger brings its own icon; the default button draws this one.
|
||||
children={trigger ? undefined : <SmilePlusIcon className="mu-icon" />}
|
||||
render={trigger ?? <Button variant="ghost" shape="pill" size="sm" icon={<SmilePlusIcon />} />}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
@@ -50,21 +59,27 @@ const ReactionSelector = ({ memo, trigger }: Props) => {
|
||||
* and Base UI would briefly reposition the portal at (0, 0). Close this
|
||||
* picker immediately instead of animating an unanchored popup.
|
||||
*/}
|
||||
{/* The list variant gives the grid a Menu's inset; each emoji is a cell with a menu row's height, radius and hover fill. */}
|
||||
<Popover.Popup align="center" variant="list" className="max-w-[90vw] transition-none sm:max-w-md">
|
||||
<div className="grid grid-cols-4 sm:grid-cols-6 md:grid-cols-8 max-h-64 overflow-y-auto">
|
||||
<Popover.Popup
|
||||
ref={popupRef}
|
||||
align="start"
|
||||
initialFocus={(interactionType) => (interactionType === "keyboard" ? true : popupRef.current)}
|
||||
aria-label={t("setting.memo.add-reaction")}
|
||||
className="mu-compact w-max p-[calc(var(--mu-space-2)-1px)] transition-none"
|
||||
>
|
||||
<div className="grid max-h-[var(--mu-list-height)] grid-flow-col gap-0.5 overflow-y-auto max-sm:grid-flow-row max-sm:grid-cols-[repeat(4,max-content)] [@media(pointer:coarse)]:grid-flow-row [@media(pointer:coarse)]:grid-cols-[repeat(4,max-content)]">
|
||||
{memoRelatedSetting.reactions.map((reactionType) => (
|
||||
<button
|
||||
type="button"
|
||||
<Toggle
|
||||
key={reactionType}
|
||||
className={cn(
|
||||
"inline-flex h-8 items-center justify-center rounded-mu-lg text-base cursor-pointer hover:bg-mu-hover",
|
||||
hasReacted(reactionType) && "bg-mu-key",
|
||||
)}
|
||||
onClick={() => handleReactionClick(reactionType)}
|
||||
variant="ghost"
|
||||
className="w-[var(--mu-row-height)] p-0 data-pressed:bg-mu-selected"
|
||||
aria-label={reactionType}
|
||||
pressed={hasReacted(reactionType)}
|
||||
onPressedChange={() => handleReactionClick(reactionType)}
|
||||
>
|
||||
{reactionType}
|
||||
</button>
|
||||
<span className="mu-body" aria-hidden>
|
||||
{reactionType}
|
||||
</span>
|
||||
</Toggle>
|
||||
))}
|
||||
</div>
|
||||
</Popover.Popup>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Tooltip } from "@usememos/ui";
|
||||
import { Toggle, Tooltip } from "@usememos/ui";
|
||||
import useCurrentUser from "@/hooks/useCurrentUser";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { State } from "@/types/proto/api/common_pb";
|
||||
@@ -6,16 +6,6 @@ import type { Memo } from "@/types/proto/api/memo_service_pb";
|
||||
import type { User } from "@/types/proto/api/user_service_pb";
|
||||
import { formatReactionTooltip, useReactionActions } from "./hooks";
|
||||
|
||||
/** A reaction is a chip in the Badge's grammar, the same shape and height as a tag. */
|
||||
const REACTION_PILL_CLASSES = "inline-flex h-5 shrink-0 items-center gap-1.5 rounded-mu-sm bg-mu-well px-1.5 mu-caption text-mu-ink";
|
||||
const REACTION_PILL_INTERACTIVE_CLASSES = cn(
|
||||
REACTION_PILL_CLASSES,
|
||||
"cursor-pointer transition-colors hover:bg-mu-hover hover:text-mu-ink aria-pressed:bg-mu-hover aria-pressed:text-mu-ink data-popup-open:bg-mu-hover data-popup-open:text-mu-ink",
|
||||
"mu-focus",
|
||||
);
|
||||
/** The strip's add control is a control, not a token: a quiet square of the chips' height with no resting surface. */
|
||||
export const REACTION_ADD_CLASSES = cn(REACTION_PILL_INTERACTIVE_CLASSES, "size-5 justify-center bg-transparent px-0 text-mu-ink-muted");
|
||||
|
||||
interface Props {
|
||||
memo: Memo;
|
||||
reactionType: string;
|
||||
@@ -25,17 +15,17 @@ interface Props {
|
||||
const ReactionView = (props: Props) => {
|
||||
const { memo, reactionType, users } = props;
|
||||
const currentUser = useCurrentUser();
|
||||
const hasReaction = users.some((user) => currentUser && user.username === currentUser.username);
|
||||
const readonly = memo.state === State.ARCHIVED;
|
||||
|
||||
const { handleReactionClick } = useReactionActions({ memo });
|
||||
const { hasReacted, handleReactionClick } = useReactionActions({ memo });
|
||||
const hasReaction = hasReacted(reactionType);
|
||||
|
||||
const isClickable = Boolean(currentUser) && !readonly;
|
||||
const label = (
|
||||
<>
|
||||
<span className="inline-flex items-center gap-1">
|
||||
<span className="mu-body">{reactionType}</span>
|
||||
<span className="mu-caption tabular-nums text-mu-ink-muted">{users.length}</span>
|
||||
</>
|
||||
<span className="mu-caption tabular-nums">{users.length}</span>
|
||||
</span>
|
||||
);
|
||||
|
||||
return (
|
||||
@@ -44,14 +34,21 @@ const ReactionView = (props: Props) => {
|
||||
<Tooltip.Trigger
|
||||
render={
|
||||
isClickable ? (
|
||||
<button
|
||||
type="button"
|
||||
className={REACTION_PILL_INTERACTIVE_CLASSES}
|
||||
aria-pressed={hasReaction}
|
||||
onClick={() => handleReactionClick(reactionType)}
|
||||
<Toggle
|
||||
variant="soft"
|
||||
shape="pill"
|
||||
size="sm"
|
||||
className="shrink-0"
|
||||
pressed={hasReaction}
|
||||
onPressedChange={() => handleReactionClick(reactionType)}
|
||||
/>
|
||||
) : (
|
||||
<span className={REACTION_PILL_CLASSES} />
|
||||
<span
|
||||
className={cn(
|
||||
"inline-flex h-6 shrink-0 items-center rounded-mu-full px-2",
|
||||
hasReaction ? "bg-mu-selected text-mu-text" : "bg-mu-hover text-mu-text-secondary",
|
||||
)}
|
||||
/>
|
||||
)
|
||||
}
|
||||
>
|
||||
|
||||
@@ -145,8 +145,8 @@ export const CreatorDisplay: React.FC<{ creator: User }> = ({ creator }) => (
|
||||
<>
|
||||
<Link
|
||||
className={cn(
|
||||
"flex min-w-0 shrink items-center gap-1.5 rounded-mu-sm mu-label-sm text-mu-ink transition-colors hover:text-mu-ink/80",
|
||||
"mu-focus",
|
||||
"flex min-w-0 shrink items-center gap-1.5 rounded-mu-sm mu-label-sm text-mu-text transition-colors hover:text-mu-text/80",
|
||||
"border border-transparent mu-focus focus-visible:border-mu-focus",
|
||||
)}
|
||||
to={getCreatorHomePath(creator.username)}
|
||||
viewTransition
|
||||
@@ -156,7 +156,7 @@ export const CreatorDisplay: React.FC<{ creator: User }> = ({ creator }) => (
|
||||
</span>
|
||||
<span className="min-w-0 truncate">{creator.displayName || creator.username}</span>
|
||||
</Link>
|
||||
<span aria-hidden="true" className="shrink-0 text-mu-ink-muted/40">
|
||||
<span aria-hidden="true" className="shrink-0 text-mu-text-secondary/40">
|
||||
·
|
||||
</span>
|
||||
</>
|
||||
@@ -190,7 +190,7 @@ interface TimeDisplayProps {
|
||||
const TimeDisplay: React.FC<TimeDisplayProps> = ({ displayTime, timeTooltip, memoName, parentPage, isCurrentPage }) => (
|
||||
<TimeTooltip content={timeTooltip}>
|
||||
{isCurrentPage ? (
|
||||
<span className="shrink-0 whitespace-nowrap mu-caption text-mu-ink-muted select-none">{displayTime}</span>
|
||||
<span className="shrink-0 whitespace-nowrap mu-caption text-mu-text-secondary select-none">{displayTime}</span>
|
||||
) : (
|
||||
<Link
|
||||
className={cn(MEMO_TIME_CONTROL_CLASSES, "underline-offset-2 hover:underline")}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
export const MEMO_CARD_BASE_CLASSES =
|
||||
"relative group flex flex-col justify-start items-start bg-mu-surface w-full px-4 py-3 mb-2 gap-2 text-mu-ink rounded-mu-lg border border-mu-line/70 transition-colors";
|
||||
"relative group flex flex-col justify-start items-start bg-mu-surface w-full px-4 py-3 mb-2 gap-2 text-mu-text rounded-mu-lg border border-mu-line/70 transition-colors";
|
||||
|
||||
/**
|
||||
* A memo's timestamp as a control, on the card header and in the editor: one line of muted
|
||||
* 13px text with no box, darkening on hover like every quiet label.
|
||||
*/
|
||||
export const MEMO_TIME_CONTROL_CLASSES = cn(
|
||||
"shrink-0 whitespace-nowrap rounded-mu-sm text-start mu-caption text-mu-ink-muted transition-colors select-none hover:text-mu-ink",
|
||||
"mu-focus",
|
||||
"shrink-0 whitespace-nowrap rounded-mu-sm text-start mu-caption text-mu-text-secondary transition-colors select-none hover:text-mu-text",
|
||||
"border border-transparent mu-focus focus-visible:border-mu-focus",
|
||||
);
|
||||
|
||||
export const RELATIVE_TIME_THRESHOLD_MS = 1000 * 60 * 60 * 24;
|
||||
|
||||
@@ -53,7 +53,7 @@ const MotionPhotoPreview = ({
|
||||
role="button"
|
||||
tabIndex={0}
|
||||
className={cn(
|
||||
"absolute select-none rounded-full border border-mu-line/45 bg-mu-canvas/65 px-2.5 py-1 mu-label-sm uppercase tracking-wide text-mu-ink backdrop-blur-sm transition-colors hover:bg-mu-canvas/80 mu-focus",
|
||||
"absolute select-none rounded-full border border-mu-line/45 bg-mu-canvas/65 px-2.5 py-1 mu-label-sm uppercase tracking-wide text-mu-text backdrop-blur-sm transition-colors hover:bg-mu-canvas/80 mu-focus focus-visible:border-mu-focus",
|
||||
badgeClassName,
|
||||
)}
|
||||
onMouseEnter={() => setMotionActive(true)}
|
||||
|
||||
@@ -12,7 +12,7 @@ interface Props {
|
||||
* empty timeline never reads as a failed search.
|
||||
*/
|
||||
const EmptyLine = ({ message, action, onAction }: Props) => (
|
||||
<div className="flex w-full flex-wrap items-center justify-center gap-x-1 py-10 mu-body text-mu-ink-muted">
|
||||
<div className="flex w-full flex-wrap items-center justify-center gap-x-1 py-10 mu-body text-mu-text-secondary">
|
||||
<span>{message}</span>
|
||||
{action && onAction && (
|
||||
<>
|
||||
|
||||
@@ -42,7 +42,7 @@ const MemoListError = ({ error, onRetry, onEditQuery, onClearQuery }: Props) =>
|
||||
<div role="alert" className="w-full min-w-0 space-y-3 rounded-mu-lg border border-mu-line px-4 py-4">
|
||||
<p className="mu-label">{t(MESSAGE_KEYS[kind])}</p>
|
||||
{kind === "invalid" && (
|
||||
<pre className="max-h-48 overflow-auto whitespace-pre-wrap break-words font-mono mu-caption text-mu-ink-muted">
|
||||
<pre className="max-h-48 overflow-auto whitespace-pre-wrap break-words font-mono mu-caption text-mu-text-secondary">
|
||||
{getErrorMessage(error)}
|
||||
</pre>
|
||||
)}
|
||||
|
||||
@@ -12,7 +12,7 @@ const Placeholder = ({ scene, message, className }: PlaceholderProps) => (
|
||||
<div className="w-full max-w-80 shrink-0">
|
||||
<InkIllustration scene={scene} />
|
||||
</div>
|
||||
<p className="mt-1 mu-body text-mu-ink-muted">{message}</p>
|
||||
<p className="mt-1 mu-body text-mu-text-secondary">{message}</p>
|
||||
</div>
|
||||
);
|
||||
|
||||
|
||||
@@ -337,10 +337,10 @@ function PreviewImageDialog({ open, onOpenChange, imgUrls = [], items, initialIn
|
||||
)}
|
||||
>
|
||||
<div className="flex items-start justify-between gap-3">
|
||||
<div className="min-w-0 text-mu-ink" data-theme="dark">
|
||||
<div className="min-w-0 text-mu-text" data-theme="dark">
|
||||
<div className="truncate mu-label">{currentItem.filename || t("attachment-preview.title")}</div>
|
||||
{hasMultiple && (
|
||||
<div className="mt-1 mu-caption text-mu-ink-muted">
|
||||
<div className="mt-1 mu-caption text-mu-text-secondary">
|
||||
{safeIndex + 1} / {itemCount}
|
||||
</div>
|
||||
)}
|
||||
@@ -437,10 +437,7 @@ function PreviewImageDialog({ open, onOpenChange, imgUrls = [], items, initialIn
|
||||
{isImagePreview && (
|
||||
<div className={cn("absolute inset-x-0 bottom-0 z-30 px-3 pb-3 pt-6", showDetails && "hidden lg:block lg:pr-[22rem]")}>
|
||||
{/* The bar keeps its glass so the counter and zoom readout stay legible over the photo. */}
|
||||
<div
|
||||
data-theme="dark"
|
||||
className="mx-auto flex w-fit items-center gap-1 rounded-full bg-black/60 px-2 py-2 shadow-mu-pop backdrop-blur-sm"
|
||||
>
|
||||
<div data-theme="dark" className="mx-auto flex w-fit items-center gap-1 rounded-full bg-black/60 px-2 py-2 backdrop-blur-sm">
|
||||
{hasMultiple && !sm && (
|
||||
<>
|
||||
<Button
|
||||
@@ -449,7 +446,7 @@ function PreviewImageDialog({ open, onOpenChange, imgUrls = [], items, initialIn
|
||||
disabled={!canGoPrevious}
|
||||
icon={<ChevronLeft />}
|
||||
/>
|
||||
<div className="min-w-9 px-1 text-center mu-label-sm tabular-nums text-mu-ink-muted">
|
||||
<div className="min-w-9 px-1 text-center mu-label-sm tabular-nums text-mu-text-secondary">
|
||||
{safeIndex + 1}/{itemCount}
|
||||
</div>
|
||||
<Button aria-label={t("attachment-preview.next")} onClick={handleNext} disabled={!canGoNext} icon={<ChevronRight />} />
|
||||
@@ -457,7 +454,7 @@ function PreviewImageDialog({ open, onOpenChange, imgUrls = [], items, initialIn
|
||||
</>
|
||||
)}
|
||||
<Button aria-label={t("map.zoom-out")} onClick={handleZoomOut} disabled={zoomScale === MIN_ZOOM} icon={<ZoomOut />} />
|
||||
<div className="min-w-12 px-2 text-center mu-label-sm tabular-nums text-mu-ink-muted">{zoomPercent}%</div>
|
||||
<div className="min-w-12 px-2 text-center mu-label-sm tabular-nums text-mu-text-secondary">{zoomPercent}%</div>
|
||||
<Button aria-label={t("map.zoom-in")} onClick={handleZoomIn} disabled={zoomScale === MAX_ZOOM} icon={<ZoomIn />} />
|
||||
<div className="mx-1 h-5 w-px bg-mu-line" />
|
||||
<Button aria-label={t("attachment-preview.reset-zoom")} onClick={resetZoom} disabled={!isZoomed} icon={<RotateCcw />} />
|
||||
@@ -494,7 +491,7 @@ function PreviewImageDialog({ open, onOpenChange, imgUrls = [], items, initialIn
|
||||
<Button size="sm" onClick={handlePrevious} disabled={!canGoPrevious}>
|
||||
{t("common.previous")}
|
||||
</Button>
|
||||
<div className="px-3 mu-caption text-mu-ink-muted">
|
||||
<div className="px-3 mu-caption text-mu-text-secondary">
|
||||
{safeIndex + 1} / {itemCount}
|
||||
</div>
|
||||
<Button size="sm" onClick={handleNext} disabled={!canGoNext}>
|
||||
|
||||
@@ -226,13 +226,13 @@ const AISection = () => {
|
||||
<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>
|
||||
<h4 className="mu-label text-mu-ink">{t("setting.ai.byok-title")}</h4>
|
||||
<h4 className="mu-label text-mu-text">{t("setting.ai.byok-title")}</h4>
|
||||
</div>
|
||||
<p className="mu-body text-mu-ink-muted">{t("setting.ai.byok-description")}</p>
|
||||
<ul className="space-y-1 mu-body text-mu-ink-muted">
|
||||
<p className="mu-body text-mu-text-secondary">{t("setting.ai.byok-description")}</p>
|
||||
<ul className="space-y-1 mu-body text-mu-text-secondary">
|
||||
{byokNotes.map((note) => (
|
||||
<li key={note} className="flex gap-2">
|
||||
<span className="mt-2 size-1 rounded-full bg-mu-ink-muted/60" aria-hidden />
|
||||
<span className="mt-2 size-1 rounded-full bg-mu-text-secondary/60" aria-hidden />
|
||||
<span>{t(note)}</span>
|
||||
</li>
|
||||
))}
|
||||
@@ -252,8 +252,8 @@ const AISection = () => {
|
||||
header: t("common.name"),
|
||||
render: (_, provider: LocalAIProvider) => (
|
||||
<div className="flex flex-col gap-0.5">
|
||||
<span className="text-mu-ink">{provider.title}</span>
|
||||
<span className="font-mono mu-caption text-mu-ink-muted">{provider.id}</span>
|
||||
<span className="text-mu-text">{provider.title}</span>
|
||||
<span className="font-mono mu-caption text-mu-text-secondary">{provider.id}</span>
|
||||
</div>
|
||||
),
|
||||
},
|
||||
@@ -552,7 +552,7 @@ const AIProviderDialog = ({ provider, onOpenChange, onSave }: AIProviderDialogPr
|
||||
placeholder={draft.apiKeySet ? t("setting.ai.keep-api-key") : ""}
|
||||
/>
|
||||
{draft.apiKeySet && (
|
||||
<p className="mu-caption text-mu-ink-muted">{t("setting.ai.current-key", { key: draft.apiKeyHint || "-" })}</p>
|
||||
<p className="mu-caption text-mu-text-secondary">{t("setting.ai.current-key", { key: draft.apiKeyHint || "-" })}</p>
|
||||
)}
|
||||
{fieldErrors.errors.apiKey && <Field.Error match>{fieldErrors.errors.apiKey}</Field.Error>}
|
||||
</Field.Root>
|
||||
|
||||
@@ -29,7 +29,7 @@ const ApiUsageExample = () => {
|
||||
|
||||
return (
|
||||
<div className="relative w-full min-w-0 rounded-mu-lg border border-mu-line/60 bg-mu-well/30">
|
||||
<pre className="overflow-x-auto p-3 pe-12 font-mono mu-caption text-mu-ink/85">
|
||||
<pre className="overflow-x-auto p-3 pe-12 font-mono mu-caption text-mu-text/85">
|
||||
<code>{example}</code>
|
||||
</pre>
|
||||
<Tooltip.Root>
|
||||
@@ -63,7 +63,7 @@ const StatusDot = ({ status }: { status: TokenStatus }) => (
|
||||
<span
|
||||
aria-hidden="true"
|
||||
className={`size-1.5 shrink-0 rounded-full ${
|
||||
status === "active" ? "bg-mu-success" : status === "expiring" ? "bg-mu-warning" : "bg-mu-ink-muted/40"
|
||||
status === "active" ? "bg-mu-success" : status === "expiring" ? "bg-mu-warning" : "bg-mu-text-secondary/40"
|
||||
}`}
|
||||
/>
|
||||
);
|
||||
@@ -86,11 +86,11 @@ const HowToUseDisclosure = () => {
|
||||
<Collapsible.Panel>
|
||||
<div className="grid gap-4 pt-2 lg:grid-cols-2">
|
||||
<div className="flex min-w-0 flex-col gap-2.5">
|
||||
<p className="mu-caption text-mu-ink-muted">{t("setting.access-token.about-description")}</p>
|
||||
<p className="mu-caption text-mu-text-secondary">{t("setting.access-token.about-description")}</p>
|
||||
<ApiUsageExample />
|
||||
<div className="flex flex-wrap items-center gap-x-4 gap-y-1.5">
|
||||
<a
|
||||
className="inline-flex items-center gap-1 mu-caption text-mu-ink-muted underline-offset-4 hover:text-mu-accent hover:underline"
|
||||
className="inline-flex items-center gap-1 mu-caption text-mu-text-secondary underline-offset-4 hover:text-mu-accent hover:underline"
|
||||
href="https://usememos.com/docs/security/access-tokens"
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
@@ -99,7 +99,7 @@ const HowToUseDisclosure = () => {
|
||||
<ExternalLinkIcon className="mu-icon-xs" />
|
||||
</a>
|
||||
<a
|
||||
className="inline-flex items-center gap-1 mu-caption text-mu-ink-muted underline-offset-4 hover:text-mu-accent hover:underline"
|
||||
className="inline-flex items-center gap-1 mu-caption text-mu-text-secondary underline-offset-4 hover:text-mu-accent hover:underline"
|
||||
href={WEB_CLIPPER_URL}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
@@ -110,7 +110,7 @@ const HowToUseDisclosure = () => {
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<ul className="m-0 flex list-none flex-col gap-1.5 p-0 mu-caption text-mu-ink-muted">
|
||||
<ul className="m-0 flex list-none flex-col gap-1.5 p-0 mu-caption text-mu-text-secondary">
|
||||
{[
|
||||
t("setting.access-token.guideline-shown-once"),
|
||||
t("setting.access-token.guideline-one-per-app"),
|
||||
@@ -118,7 +118,7 @@ const HowToUseDisclosure = () => {
|
||||
t("setting.access-token.guideline-review"),
|
||||
].map((guideline) => (
|
||||
<li key={guideline} className="flex gap-2">
|
||||
<span className="mt-[7px] size-1 shrink-0 rounded-full bg-mu-ink-muted/40" />
|
||||
<span className="mt-[7px] size-1 shrink-0 rounded-full bg-mu-text-secondary/40" />
|
||||
{guideline}
|
||||
</li>
|
||||
))}
|
||||
@@ -136,8 +136,8 @@ const EmptyState = ({ onCreate }: { onCreate: () => void }) => {
|
||||
<span className="mx-auto flex size-10 items-center justify-center rounded-mu-lg bg-mu-primary/10 text-mu-primary">
|
||||
<KeyRoundIcon className="mu-icon" />
|
||||
</span>
|
||||
<h4 className="mt-3 mu-label text-mu-ink">{t("setting.access-token.empty-title")}</h4>
|
||||
<p className="mx-auto mt-1 max-w-sm mu-caption text-mu-ink-muted">{t("setting.access-token.empty-description")}</p>
|
||||
<h4 className="mt-3 mu-label text-mu-text">{t("setting.access-token.empty-title")}</h4>
|
||||
<p className="mx-auto mt-1 max-w-sm mu-caption text-mu-text-secondary">{t("setting.access-token.empty-description")}</p>
|
||||
<div className="mx-auto mt-4 max-w-md text-left">
|
||||
<ApiUsageExample />
|
||||
</div>
|
||||
@@ -146,7 +146,7 @@ const EmptyState = ({ onCreate }: { onCreate: () => void }) => {
|
||||
{t("setting.access-token.create-first")}
|
||||
</Button>
|
||||
<a
|
||||
className="inline-flex items-center gap-1.5 mu-caption text-mu-ink-muted hover:text-mu-ink"
|
||||
className="inline-flex items-center gap-1.5 mu-caption text-mu-text-secondary hover:text-mu-text"
|
||||
href={WEB_CLIPPER_URL}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
@@ -169,8 +169,8 @@ const TokenRow = ({ token, onDelete }: { token: PersonalAccessToken; onDelete: (
|
||||
<List.Item className="group flex items-center gap-3">
|
||||
<StatusDot status={status} />
|
||||
<div className="min-w-0 flex-1">
|
||||
<div className="mu-label-sm text-mu-ink">{token.description}</div>
|
||||
<div className="mt-0.5 mu-caption text-mu-ink-muted">
|
||||
<div className="mu-label-sm text-mu-text">{token.description}</div>
|
||||
<div className="mt-0.5 mu-caption text-mu-text-secondary">
|
||||
{lastUsedAt ? (
|
||||
<>
|
||||
{t("setting.access-token.last-used")} <RelativeTime date={lastUsedAt} />
|
||||
|
||||
@@ -33,12 +33,12 @@ const ConfigurationSection = () => {
|
||||
{
|
||||
key: "resource",
|
||||
header: t("setting.configuration.resource"),
|
||||
render: (_, row: ManagedResourceRow) => <span className="font-mono mu-caption text-mu-ink">{row.resource.resource}</span>,
|
||||
render: (_, row: ManagedResourceRow) => <span className="font-mono mu-caption text-mu-text">{row.resource.resource}</span>,
|
||||
},
|
||||
{
|
||||
key: "source",
|
||||
header: t("setting.configuration.source"),
|
||||
render: (_, row: ManagedResourceRow) => <span className="mu-body text-mu-ink-muted">{row.resource.source}</span>,
|
||||
render: (_, row: ManagedResourceRow) => <span className="mu-body text-mu-text-secondary">{row.resource.source}</span>,
|
||||
},
|
||||
{
|
||||
key: "fields",
|
||||
|
||||
@@ -12,8 +12,8 @@ interface Props {
|
||||
const InfoChip = ({ label, value, tooltip, className }: Props) => {
|
||||
const chip = (
|
||||
<Badge tone="outline" className={cn("max-w-full", className)}>
|
||||
<span className="text-mu-ink-muted">{label}</span>
|
||||
<span className="max-w-[20rem] truncate text-mu-ink">{value}</span>
|
||||
<span className="text-mu-text-secondary">{label}</span>
|
||||
<span className="max-w-[20rem] truncate text-mu-text">{value}</span>
|
||||
</Badge>
|
||||
);
|
||||
|
||||
@@ -24,7 +24,16 @@ const InfoChip = ({ label, value, tooltip, className }: Props) => {
|
||||
// The full value is something to read, so it opens as a hover card that a click or tap also opens, not a tooltip.
|
||||
return (
|
||||
<Popover.Root>
|
||||
<Popover.Trigger openOnHover delay={300} render={<button type="button" className="mu-focus inline-flex max-w-full rounded-mu-sm" />}>
|
||||
<Popover.Trigger
|
||||
openOnHover
|
||||
delay={300}
|
||||
render={
|
||||
<button
|
||||
type="button"
|
||||
className="border border-transparent mu-focus focus-visible:border-mu-focus inline-flex max-w-full rounded-mu-sm"
|
||||
/>
|
||||
}
|
||||
>
|
||||
{chip}
|
||||
</Popover.Trigger>
|
||||
<Popover.Popup aria-label={label}>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { create } from "@bufbuild/protobuf";
|
||||
import { Button, Dialog, Field, Fieldset, Input, Radio, RadioGroup, Spinner } from "@usememos/ui";
|
||||
import { CheckIcon, SearchIcon } from "lucide-react";
|
||||
import { type FormEvent, useEffect, useState } from "react";
|
||||
import { type FormEvent, type RefObject, useEffect, useState } from "react";
|
||||
import UserAvatar from "@/components/UserAvatar";
|
||||
import { useCreateSpaceInvitation } from "@/hooks/useSpaceQueries";
|
||||
import { useUsersByUsernames } from "@/hooks/useUserQueries";
|
||||
@@ -16,13 +16,14 @@ const LOOKUP_DELAY_MS = 300;
|
||||
interface Props {
|
||||
open: boolean;
|
||||
onOpenChange: (open: boolean) => void;
|
||||
finalFocus?: RefObject<HTMLElement | null>;
|
||||
space: Space;
|
||||
viewerName: string;
|
||||
memberUserNames: Set<string>;
|
||||
pendingInviteeNames: Set<string>;
|
||||
}
|
||||
|
||||
const InviteSpaceMemberDialog = ({ open, onOpenChange, space, viewerName, memberUserNames, pendingInviteeNames }: Props) => {
|
||||
const InviteSpaceMemberDialog = ({ open, onOpenChange, finalFocus, space, viewerName, memberUserNames, pendingInviteeNames }: Props) => {
|
||||
const t = useTranslate();
|
||||
const spaceUid = extractSpaceUidFromName(space.name);
|
||||
const createInvitation = useCreateSpaceInvitation(viewerName);
|
||||
@@ -107,7 +108,7 @@ const InviteSpaceMemberDialog = ({ open, onOpenChange, space, viewerName, member
|
||||
|
||||
return (
|
||||
<Dialog.Root open={open} onOpenChange={handleOpenChange}>
|
||||
<Dialog.Popup data-critical-surface="invite-member-dialog" closeLabel={t("common.close")}>
|
||||
<Dialog.Popup data-critical-surface="invite-member-dialog" closeLabel={t("common.close")} finalFocus={finalFocus}>
|
||||
<form className="grid gap-4" onSubmit={handleSubmit}>
|
||||
<Dialog.Title>{t("setting.spaces.invite-to", { space: space.title })}</Dialog.Title>
|
||||
<Dialog.Description>
|
||||
@@ -138,14 +139,14 @@ const InviteSpaceMemberDialog = ({ open, onOpenChange, space, viewerName, member
|
||||
onClick={() => setSelectedUserName(isSelected ? "" : candidate.name)}
|
||||
className={
|
||||
isSelected
|
||||
? "flex w-full items-center gap-3 rounded-mu-lg border border-mu-primary/35 bg-mu-primary/5 px-3 py-2 text-left transition-colors"
|
||||
: "flex w-full items-center gap-3 rounded-mu-lg border border-mu-line px-3 py-2 text-left transition-colors hover:bg-mu-hover disabled:cursor-not-allowed disabled:opacity-60"
|
||||
? "flex w-full items-center gap-3 rounded-mu-lg border border-mu-edge bg-mu-well px-3 py-2 text-left text-mu-text transition-colors mu-focus focus-visible:border-mu-focus"
|
||||
: "flex w-full items-center gap-3 rounded-mu-lg border border-mu-edge px-3 py-2 text-left text-mu-text-secondary transition-colors enabled:hover:bg-mu-hover disabled:cursor-not-allowed disabled:opacity-60 mu-focus focus-visible:border-mu-focus"
|
||||
}
|
||||
>
|
||||
<UserAvatar className="size-8" avatarUrl={candidate.avatarUrl} name={candidate.displayName || candidate.username} />
|
||||
<div className="min-w-0 flex-1">
|
||||
<p className="truncate mu-label">{candidate.displayName || `@${candidate.username}`}</p>
|
||||
<p className="truncate mu-caption text-mu-ink-muted">
|
||||
<p className="truncate mu-caption text-mu-text-secondary">
|
||||
@{candidate.username} · {resultStatus}
|
||||
</p>
|
||||
</div>
|
||||
@@ -154,7 +155,7 @@ const InviteSpaceMemberDialog = ({ open, onOpenChange, space, viewerName, member
|
||||
) : null}
|
||||
|
||||
{normalizedUsername && lookupSettled && usersQuery.isSuccess && !candidate ? (
|
||||
<p className="mu-caption text-mu-ink-muted">{t("setting.spaces.user-not-found", { username: normalizedUsername })}</p>
|
||||
<p className="mu-caption text-mu-text-secondary">{t("setting.spaces.user-not-found", { username: normalizedUsername })}</p>
|
||||
) : null}
|
||||
</Field.Root>
|
||||
|
||||
@@ -168,8 +169,8 @@ const InviteSpaceMemberDialog = ({ open, onOpenChange, space, viewerName, member
|
||||
<Field.Label className="items-start">
|
||||
<Radio value={option.value} className="mt-0.5" />
|
||||
<span className="flex flex-col gap-0.5">
|
||||
<span className="text-mu-ink">{option.label}</span>
|
||||
<span className="mu-caption text-mu-ink-muted">{option.description}</span>
|
||||
<span className="text-mu-text">{option.label}</span>
|
||||
<span className="mu-caption text-mu-text-secondary">{option.description}</span>
|
||||
</span>
|
||||
</Field.Label>
|
||||
</Field.Item>
|
||||
|
||||
@@ -153,7 +153,7 @@ const LinkedIdentitySection = () => {
|
||||
render: (_, row: LinkedIdentityRow) => (
|
||||
<div className="flex min-w-[16rem] flex-col gap-2">
|
||||
<div className="flex flex-wrap items-center gap-2">
|
||||
<span className="mu-label text-mu-ink">{row.title}</span>
|
||||
<span className="mu-label text-mu-text">{row.title}</span>
|
||||
<Badge>{row.typeLabel}</Badge>
|
||||
</div>
|
||||
<div className="flex flex-wrap items-center gap-2">
|
||||
@@ -176,7 +176,7 @@ const LinkedIdentitySection = () => {
|
||||
) : null}
|
||||
<ManagedByConfigurationChip resource={findManagedResource(configurationStatus, row.linkedIdentity?.name ?? "")} />
|
||||
</div>
|
||||
<p className="mu-caption text-mu-ink-muted">
|
||||
<p className="mu-caption text-mu-text-secondary">
|
||||
{row.isLinked ? t("setting.sso.extern-uid-description") : t("setting.sso.not-linked-description")}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -128,12 +128,14 @@ const MemberSection = () => {
|
||||
<UserAvatar className="h-10 w-10 shrink-0" avatarUrl={user.avatarUrl} name={user.displayName || user.username} />
|
||||
<div className="flex min-w-0 flex-1 flex-col">
|
||||
<div className="flex flex-wrap items-center gap-x-2 gap-y-1">
|
||||
<span className={user.displayName ? "mu-label text-mu-ink" : "mu-label text-mu-ink-muted italic"}>
|
||||
<span className={user.displayName ? "mu-label text-mu-text" : "mu-label text-mu-text-secondary italic"}>
|
||||
{user.displayName || t("common.empty-placeholder")}
|
||||
</span>
|
||||
{currentUser?.name === user.name ? <span className="mu-caption text-mu-ink-muted">{t("common.yourself")}</span> : null}
|
||||
{currentUser?.name === user.name ? (
|
||||
<span className="mu-caption text-mu-text-secondary">{t("common.yourself")}</span>
|
||||
) : null}
|
||||
</div>
|
||||
<span className="truncate mu-caption text-mu-ink-muted">@{user.username}</span>
|
||||
<span className="truncate mu-caption text-mu-text-secondary">@{user.username}</span>
|
||||
</div>
|
||||
</div>
|
||||
),
|
||||
|
||||
@@ -45,7 +45,7 @@ type ImportStage =
|
||||
const IssueList = ({ issues, tone }: { issues: ImportMemosIssue[]; tone: "warning" | "failure" }) => {
|
||||
if (issues.length === 0) return null;
|
||||
return (
|
||||
<ul className={`flex flex-col gap-1 mu-caption ${tone === "failure" ? "text-mu-danger" : "text-mu-ink-muted"}`}>
|
||||
<ul className={`flex flex-col gap-1 mu-caption ${tone === "failure" ? "text-mu-danger" : "text-mu-text-secondary"}`}>
|
||||
{issues.map((issue, index) => (
|
||||
<li key={`${tone}-${index}`}>{issue.memoUid ? `${issue.memoUid}: ${issue.message}` : issue.message}</li>
|
||||
))}
|
||||
@@ -165,8 +165,8 @@ const MemoExportSection = () => {
|
||||
<Field.Label className="items-start">
|
||||
<Radio value={String(option.value)} className="mt-0.5" />
|
||||
<span className="flex flex-col gap-1 leading-5">
|
||||
<span className="mu-body text-mu-ink">{t(option.label)}</span>
|
||||
<span className="mu-caption text-mu-ink-muted">{t(option.description)}</span>
|
||||
<span className="mu-body text-mu-text">{t(option.label)}</span>
|
||||
<span className="mu-caption text-mu-text-secondary">{t(option.description)}</span>
|
||||
</span>
|
||||
</Field.Label>
|
||||
</Field.Item>
|
||||
|
||||
@@ -77,7 +77,7 @@ const MemoRelatedSettings = () => {
|
||||
<SettingPanel
|
||||
header={
|
||||
<div className="flex items-center justify-between gap-3">
|
||||
<span className="mu-label text-mu-ink-muted">{t("setting.memo.configured-reactions")}</span>
|
||||
<span className="mu-label text-mu-text-secondary">{t("setting.memo.configured-reactions")}</span>
|
||||
<Badge tone="outline">{memoRelatedSetting.reactions.length}</Badge>
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -52,9 +52,9 @@ const MyAccountSection = () => {
|
||||
<div className="flex-1 min-w-40 flex flex-col justify-center items-start gap-1">
|
||||
<div className="w-full">
|
||||
<span className="mu-label">{user?.displayName}</span>
|
||||
<span className="ml-2 mu-body text-mu-ink-muted">@{user?.username}</span>
|
||||
<span className="ml-2 mu-body text-mu-text-secondary">@{user?.username}</span>
|
||||
</div>
|
||||
{user?.description && <p className="w-full mu-body text-mu-ink-muted truncate">{user?.description}</p>}
|
||||
{user?.description && <p className="w-full mu-body text-mu-text-secondary truncate">{user?.description}</p>}
|
||||
</div>
|
||||
<div className="flex items-center gap-2 shrink-0">
|
||||
<Button variant="neutral" onClick={accountDialog.open} icon={<PenLineIcon />}>
|
||||
@@ -77,8 +77,8 @@ const MyAccountSection = () => {
|
||||
{/* A plain row: red is kept for the confirm step, not the section that leads to it. */}
|
||||
<div className="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
|
||||
<div className="min-w-0">
|
||||
<p className="mu-label text-mu-ink">{t("setting.account.delete-account")}</p>
|
||||
<p className="mu-caption text-mu-ink-muted">{t("setting.account.delete-account-description")}</p>
|
||||
<p className="mu-label text-mu-text">{t("setting.account.delete-account")}</p>
|
||||
<p className="mu-caption text-mu-text-secondary">{t("setting.account.delete-account-description")}</p>
|
||||
</div>
|
||||
<Button variant="neutral" className="shrink-0 self-start sm:self-auto" onClick={() => setDeleteOpen(true)}>
|
||||
{t("setting.account.delete-account")}
|
||||
|
||||
@@ -50,7 +50,7 @@ const ResourceStatsSection = () => {
|
||||
description={t("setting.resource-stats.description")}
|
||||
actions={
|
||||
<>
|
||||
{generatedTime ? <span className="mu-caption text-mu-ink-muted">{generatedTime}</span> : null}
|
||||
{generatedTime ? <span className="mu-caption text-mu-text-secondary">{generatedTime}</span> : null}
|
||||
<Button
|
||||
variant="neutral"
|
||||
disabled={isFetching}
|
||||
@@ -67,7 +67,7 @@ const ResourceStatsSection = () => {
|
||||
{isLoading && !data ? (
|
||||
<SettingList aria-busy aria-label={t("setting.resource-stats.label")}>
|
||||
<List.Item>
|
||||
<span className="text-mu-ink-muted">…</span>
|
||||
<span className="text-mu-text-secondary">…</span>
|
||||
</List.Item>
|
||||
</SettingList>
|
||||
) : null}
|
||||
|
||||
@@ -130,7 +130,7 @@ const SSOSection = () => {
|
||||
render: (_, row: IdentityProviderRow) => (
|
||||
<div className="flex min-w-[16rem] flex-col gap-2">
|
||||
<div className="flex flex-wrap items-center gap-2">
|
||||
<span className="mu-label text-mu-ink">{row.title}</span>
|
||||
<span className="mu-label text-mu-text">{row.title}</span>
|
||||
<Badge>{row.typeLabel}</Badge>
|
||||
</div>
|
||||
<div className="flex flex-wrap items-center gap-2">
|
||||
@@ -145,7 +145,7 @@ const SSOSection = () => {
|
||||
header: t("setting.sso.configuration"),
|
||||
render: (_, row: IdentityProviderRow) => (
|
||||
<div className="flex min-w-[24rem] flex-col gap-2">
|
||||
<p className="mu-caption text-mu-ink-muted">{t("setting.sso.configuration-summary-description")}</p>
|
||||
<p className="mu-caption text-mu-text-secondary">{t("setting.sso.configuration-summary-description")}</p>
|
||||
<div className="flex flex-wrap gap-2">
|
||||
{row.summaryItems.map((item) => (
|
||||
<InfoChip key={item.key} label={item.label} value={item.value} tooltip={item.tooltip} />
|
||||
|
||||
@@ -23,11 +23,11 @@ const SettingGroup: React.FC<SettingGroupProps> = ({ title, description, childre
|
||||
{(title || description) && (
|
||||
<div className="flex min-w-0 flex-1 flex-col gap-1">
|
||||
{title && (
|
||||
<h4 id={titleId} className="mu-label text-mu-ink">
|
||||
<h4 id={titleId} className="mu-label text-mu-text">
|
||||
{title}
|
||||
</h4>
|
||||
)}
|
||||
{description && <p className="max-w-2xl mu-caption text-mu-ink-muted">{description}</p>}
|
||||
{description && <p className="max-w-2xl mu-caption text-mu-text-secondary">{description}</p>}
|
||||
</div>
|
||||
)}
|
||||
{actions ? <div className="flex shrink-0 flex-wrap items-center gap-2 sm:ml-auto">{actions}</div> : null}
|
||||
|
||||
@@ -43,13 +43,13 @@ export const SettingListItem = ({ label, description, children }: SettingListIte
|
||||
};
|
||||
|
||||
export const StatValue = ({ value }: { value: string }) => (
|
||||
<span className="block min-w-0 break-all text-right font-mono mu-body tabular-nums text-mu-ink">{value}</span>
|
||||
<span className="block min-w-0 break-all text-right font-mono mu-body tabular-nums text-mu-text">{value}</span>
|
||||
);
|
||||
|
||||
/** A read-only figure: its name at the start, the value at the end. No control, so no Field. */
|
||||
export const StatRow = ({ label, value }: { label: string; value: string }) => (
|
||||
<List.Item className="flex items-baseline justify-between gap-4">
|
||||
<span className="min-w-0 mu-body text-mu-ink">{label}</span>
|
||||
<span className="min-w-0 mu-body text-mu-text">{label}</span>
|
||||
<StatValue value={value} />
|
||||
</List.Item>
|
||||
);
|
||||
|
||||
@@ -16,8 +16,8 @@ const SettingSection: React.FC<SettingSectionProps> = ({ title, description, chi
|
||||
<div className="flex min-w-0 flex-col gap-3 border-b border-mu-line/70 pb-4 sm:flex-row sm:items-end sm:justify-between">
|
||||
<div className="min-w-0 flex-1">
|
||||
{/* The settings page's title: the one heading on the page. */}
|
||||
{title && <div className="mb-1 mu-heading text-mu-ink">{typeof title === "string" ? <h1>{title}</h1> : title}</div>}
|
||||
{description && <p className="w-full mu-body text-mu-ink-muted">{description}</p>}
|
||||
{title && <div className="mb-1 mu-heading text-mu-text">{typeof title === "string" ? <h1>{title}</h1> : title}</div>}
|
||||
{description && <p className="w-full mu-body text-mu-text-secondary">{description}</p>}
|
||||
</div>
|
||||
{actions && <div className="flex shrink-0 flex-wrap items-center gap-2">{actions}</div>}
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Badge, Button, Field, Input, List, Select, Skeleton, Tabs, Textarea } from "@usememos/ui";
|
||||
import { ArrowLeftIcon, ChevronRightIcon, Clock3Icon, PlusIcon, ShieldCheckIcon, UserPlusIcon } from "lucide-react";
|
||||
import { type ReactNode, useEffect, useMemo, useState } from "react";
|
||||
import { type ReactNode, useEffect, useMemo, useRef, useState } from "react";
|
||||
import { useNavigate, useSearchParams } from "react-router-dom";
|
||||
import ConfirmDialog from "@/components/ConfirmDialog";
|
||||
import CreateSpaceDialog from "@/components/CreateSpaceDialog";
|
||||
@@ -61,7 +61,7 @@ const SkeletonList = ({ label }: { label: string }) => (
|
||||
|
||||
/** Shown in place of a list that has nothing to show: empty, or failed to load. */
|
||||
const ListMessage = ({ children, className }: { children: ReactNode; className?: string }) => (
|
||||
<div className={cn("rounded-mu-lg border border-dashed border-mu-line px-3 text-center mu-body text-mu-ink-muted", className)}>
|
||||
<div className={cn("rounded-mu-lg border border-dashed border-mu-line px-3 text-center mu-body text-mu-text-secondary", className)}>
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
@@ -77,9 +77,9 @@ const MemberIdentity = ({ member, user, isCurrentUser }: { member: SpaceMember;
|
||||
<div className="min-w-0">
|
||||
<div className="flex flex-wrap items-center gap-1.5">
|
||||
<p className="truncate mu-label">{displayName}</p>
|
||||
{isCurrentUser ? <span className="mu-caption text-mu-ink-muted">{t("setting.spaces.you")}</span> : null}
|
||||
{isCurrentUser ? <span className="mu-caption text-mu-text-secondary">{t("setting.spaces.you")}</span> : null}
|
||||
</div>
|
||||
<p className="mt-0.5 truncate mu-caption text-mu-ink-muted">@{username}</p>
|
||||
<p className="mt-0.5 truncate mu-caption text-mu-text-secondary">@{username}</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
@@ -94,7 +94,7 @@ const InvitationIdentity = ({ invitation, user }: { invitation: SpaceInvitation;
|
||||
<UserAvatar className="size-10" avatarUrl={user?.avatarUrl} name={displayName} />
|
||||
<div className="min-w-0">
|
||||
<p className="truncate mu-label">{displayName}</p>
|
||||
<p className="mt-0.5 truncate mu-caption text-mu-ink-muted">@{username}</p>
|
||||
<p className="mt-0.5 truncate mu-caption text-mu-text-secondary">@{username}</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
@@ -182,7 +182,7 @@ const SpacesSection = () => {
|
||||
<h4 id="space-invitations-heading" className="mu-label">
|
||||
{t("setting.spaces.invitations")}
|
||||
</h4>
|
||||
<span className="mu-caption text-mu-ink-muted">
|
||||
<span className="mu-caption text-mu-text-secondary">
|
||||
{t("setting.spaces.pending-count", { count: receivedInvitations.length })}
|
||||
</span>
|
||||
</div>
|
||||
@@ -201,14 +201,14 @@ const SpacesSection = () => {
|
||||
<SpaceRoleBadge role={invitation.role} />
|
||||
</div>
|
||||
{uid ? (
|
||||
<p className="mt-0.5 flex min-w-0 items-baseline gap-1 mu-caption text-mu-ink-muted">
|
||||
<p className="mt-0.5 flex min-w-0 items-baseline gap-1 mu-caption text-mu-text-secondary">
|
||||
<span className="shrink-0">{t("space.custom-id-label")}:</span>
|
||||
<span title={uid} className="min-w-0 break-all font-mono">
|
||||
{uid}
|
||||
</span>
|
||||
</p>
|
||||
) : null}
|
||||
<p className="mt-1 truncate mu-caption text-mu-ink-muted">
|
||||
<p className="mt-1 truncate mu-caption text-mu-text-secondary">
|
||||
{invitation.space?.description || t("setting.spaces.invited-to-join")}
|
||||
</p>
|
||||
</div>
|
||||
@@ -246,7 +246,7 @@ const SpacesSection = () => {
|
||||
{t("setting.spaces.your-spaces")}
|
||||
</h4>
|
||||
{spaces.length > 0 ? (
|
||||
<span className="mu-caption text-mu-ink-muted">
|
||||
<span className="mu-caption text-mu-text-secondary">
|
||||
{spaces.length === 1
|
||||
? t("setting.spaces.space-count", { count: spaces.length })
|
||||
: t("setting.spaces.spaces-count", { count: spaces.length })}
|
||||
@@ -260,7 +260,7 @@ const SpacesSection = () => {
|
||||
) : spaces.length === 0 ? (
|
||||
<div className="rounded-mu-lg border border-dashed border-mu-line px-4 py-9 text-center">
|
||||
<p className="mu-label">{t("setting.spaces.no-spaces")}</p>
|
||||
<p className="mx-auto mt-1 max-w-md mu-caption text-mu-ink-muted">{t("setting.spaces.no-spaces-description")}</p>
|
||||
<p className="mx-auto mt-1 max-w-md mu-caption text-mu-text-secondary">{t("setting.spaces.no-spaces-description")}</p>
|
||||
<Button variant="neutral" className="mt-4" onClick={() => setCreateOpen(true)} icon={<PlusIcon />}>
|
||||
{t("setting.spaces.create-space")}
|
||||
</Button>
|
||||
@@ -285,22 +285,22 @@ const SpacesSection = () => {
|
||||
<p className="truncate mu-label">{space.title}</p>
|
||||
<SpaceRoleBadge role={space.currentUserRole} />
|
||||
</div>
|
||||
<p className="mt-0.5 flex min-w-0 items-baseline gap-1 mu-caption text-mu-ink-muted">
|
||||
<p className="mt-0.5 flex min-w-0 items-baseline gap-1 mu-caption text-mu-text-secondary">
|
||||
<span className="shrink-0">{t("space.custom-id-label")}:</span>
|
||||
<span title={uid} className="min-w-0 break-all font-mono">
|
||||
{uid}
|
||||
</span>
|
||||
</p>
|
||||
<p className="mt-1 truncate mu-caption text-mu-ink-muted">
|
||||
<p className="mt-1 truncate mu-caption text-mu-text-secondary">
|
||||
{space.description || t("setting.spaces.no-description")}
|
||||
</p>
|
||||
</div>
|
||||
<span className="hidden shrink-0 mu-caption text-mu-ink-muted sm:inline">
|
||||
<span className="hidden shrink-0 mu-caption text-mu-text-secondary sm:inline">
|
||||
{space.memberCount === 1
|
||||
? t("setting.spaces.member-count", { count: space.memberCount })
|
||||
: t("setting.spaces.members-count", { count: space.memberCount })}
|
||||
</span>
|
||||
<ChevronRightIcon className="mu-icon shrink-0 text-mu-ink-muted/65 transition-transform group-hover:translate-x-0.5" />
|
||||
<ChevronRightIcon className="mu-icon shrink-0 text-mu-text-secondary/65 transition-transform group-hover:translate-x-0.5" />
|
||||
</List.ItemButton>
|
||||
</List.Item>
|
||||
);
|
||||
@@ -352,6 +352,7 @@ const SpaceDetail = ({ space, viewerName, onBack }: SpaceDetailProps) => {
|
||||
const [description, setDescription] = useState(space.description);
|
||||
const [icon, setIcon] = useState(space.icon);
|
||||
const [inviteOpen, setInviteOpen] = useState(false);
|
||||
const inviteButtonRef = useRef<HTMLElement>(null);
|
||||
const [leaveOpen, setLeaveOpen] = useState(false);
|
||||
const [deleteOpen, setDeleteOpen] = useState(false);
|
||||
const [removeTarget, setRemoveTarget] = useState<SpaceMember>();
|
||||
@@ -453,7 +454,11 @@ const SpaceDetail = ({ space, viewerName, onBack }: SpaceDetailProps) => {
|
||||
|
||||
return (
|
||||
<section className="min-w-0">
|
||||
<button type="button" onClick={onBack} className="mb-4 inline-flex items-center gap-1.5 mu-body text-mu-ink-muted hover:text-mu-ink">
|
||||
<button
|
||||
type="button"
|
||||
onClick={onBack}
|
||||
className="mb-4 inline-flex items-center gap-1.5 mu-body text-mu-text-secondary hover:text-mu-text"
|
||||
>
|
||||
<ArrowLeftIcon className="mu-icon" />
|
||||
{t("setting.spaces.label")}
|
||||
</button>
|
||||
@@ -465,13 +470,13 @@ const SpaceDetail = ({ space, viewerName, onBack }: SpaceDetailProps) => {
|
||||
<h1 className="truncate mu-heading">{space.title}</h1>
|
||||
<SpaceRoleBadge role={currentRole} />
|
||||
</div>
|
||||
<p className="mt-1 flex min-w-0 items-baseline gap-1 mu-caption text-mu-ink-muted">
|
||||
<p className="mt-1 flex min-w-0 items-baseline gap-1 mu-caption text-mu-text-secondary">
|
||||
<span className="shrink-0">{t("space.custom-id-label")}:</span>
|
||||
<span title={spaceUid} className="min-w-0 break-all font-mono">
|
||||
{spaceUid}
|
||||
</span>
|
||||
</p>
|
||||
<p className="mt-1 truncate mu-body text-mu-ink-muted">{space.description || t("setting.spaces.no-description")}</p>
|
||||
<p className="mt-1 truncate mu-body text-mu-text-secondary">{space.description || t("setting.spaces.no-description")}</p>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
@@ -480,7 +485,7 @@ const SpaceDetail = ({ space, viewerName, onBack }: SpaceDetailProps) => {
|
||||
<Tabs.Tab value="general">{t("setting.spaces.general")}</Tabs.Tab>
|
||||
<Tabs.Tab value="members">
|
||||
{t("setting.spaces.members")}
|
||||
<span className="text-mu-ink-muted">{members.length || space.memberCount}</span>
|
||||
<span className="text-mu-text-secondary">{members.length || space.memberCount}</span>
|
||||
</Tabs.Tab>
|
||||
</Tabs.List>
|
||||
</Tabs.Root>
|
||||
@@ -492,12 +497,12 @@ const SpaceDetail = ({ space, viewerName, onBack }: SpaceDetailProps) => {
|
||||
<h4 id="space-details-heading" className="mu-label">
|
||||
{t("setting.spaces.space-details")}
|
||||
</h4>
|
||||
<p className="mt-1 mu-caption text-mu-ink-muted">{t("setting.spaces.space-details-description")}</p>
|
||||
<p className="mt-1 mu-caption text-mu-text-secondary">{t("setting.spaces.space-details-description")}</p>
|
||||
</div>
|
||||
<List.Root aria-labelledby="space-details-heading">
|
||||
<List.Item className="grid gap-2 sm:grid-cols-[170px_1fr] sm:items-center">
|
||||
<span className="mu-label">{t("space.custom-id-label")}</span>
|
||||
<code className="min-w-0 break-all rounded-mu-md bg-mu-well/35 px-3 py-2 font-mono mu-caption text-mu-ink/85">
|
||||
<code className="min-w-0 break-all rounded-mu-md bg-mu-well/35 px-3 py-2 font-mono mu-caption text-mu-text/85">
|
||||
{spaceUid}
|
||||
</code>
|
||||
</List.Item>
|
||||
@@ -550,10 +555,10 @@ const SpaceDetail = ({ space, viewerName, onBack }: SpaceDetailProps) => {
|
||||
<List.Root aria-labelledby="space-access-heading">
|
||||
<List.Item className="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
|
||||
<div className="flex items-start gap-2">
|
||||
<ShieldCheckIcon className="mu-icon mt-0.5 shrink-0 text-mu-ink-muted" />
|
||||
<ShieldCheckIcon className="mu-icon mt-0.5 shrink-0 text-mu-text-secondary" />
|
||||
<div>
|
||||
<p className="mu-label">{t("setting.spaces.role-in-space")}</p>
|
||||
<p className="mt-1 mu-caption text-mu-ink-muted">
|
||||
<p className="mt-1 mu-caption text-mu-text-secondary">
|
||||
{isAdmin ? t("setting.spaces.admin-role-description") : t("setting.spaces.user-role-description")}
|
||||
</p>
|
||||
</div>
|
||||
@@ -568,7 +573,7 @@ const SpaceDetail = ({ space, viewerName, onBack }: SpaceDetailProps) => {
|
||||
<div className="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
|
||||
<div className="min-w-0">
|
||||
<h4 className="mu-label">{t("setting.spaces.leave-space")}</h4>
|
||||
<p className="mu-caption text-mu-ink-muted">
|
||||
<p className="mu-caption text-mu-text-secondary">
|
||||
{isLastAdmin ? t("setting.spaces.last-admin-leave-description") : t("setting.spaces.leave-description")}
|
||||
</p>
|
||||
</div>
|
||||
@@ -585,7 +590,7 @@ const SpaceDetail = ({ space, viewerName, onBack }: SpaceDetailProps) => {
|
||||
<div className="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
|
||||
<div className="min-w-0">
|
||||
<h4 className="mu-label">{t("setting.spaces.delete-space")}</h4>
|
||||
<p className="mu-caption text-mu-ink-muted">{t("setting.spaces.delete-description")}</p>
|
||||
<p className="mu-caption text-mu-text-secondary">{t("setting.spaces.delete-description")}</p>
|
||||
</div>
|
||||
<Button variant="neutral" className="shrink-0 self-start sm:self-auto" onClick={() => setDeleteOpen(true)}>
|
||||
{t("setting.spaces.delete-space")}
|
||||
@@ -602,10 +607,10 @@ const SpaceDetail = ({ space, viewerName, onBack }: SpaceDetailProps) => {
|
||||
<h4 id="space-members-heading" className="mu-label">
|
||||
{t("setting.spaces.members")}
|
||||
</h4>
|
||||
<p className="mt-1 mu-caption text-mu-ink-muted">{t("setting.spaces.members-description")}</p>
|
||||
<p className="mt-1 mu-caption text-mu-text-secondary">{t("setting.spaces.members-description")}</p>
|
||||
</div>
|
||||
{isAdmin ? (
|
||||
<Button variant="neutral" onClick={() => setInviteOpen(true)} icon={<UserPlusIcon />}>
|
||||
<Button ref={inviteButtonRef} variant="neutral" onClick={() => setInviteOpen(true)} icon={<UserPlusIcon />}>
|
||||
{t("setting.spaces.invite-member")}
|
||||
</Button>
|
||||
) : null}
|
||||
@@ -668,7 +673,7 @@ const SpaceDetail = ({ space, viewerName, onBack }: SpaceDetailProps) => {
|
||||
<h4 id="space-pending-invitations-heading" className="mu-label">
|
||||
{t("setting.spaces.pending-invitations")}
|
||||
</h4>
|
||||
<span className="mu-caption text-mu-ink-muted">{invitations.length}</span>
|
||||
<span className="mu-caption text-mu-text-secondary">{invitations.length}</span>
|
||||
</div>
|
||||
{invitationsQuery.isLoading ? (
|
||||
<SkeletonList label={t("setting.spaces.loading-invitations")} />
|
||||
@@ -700,6 +705,7 @@ const SpaceDetail = ({ space, viewerName, onBack }: SpaceDetailProps) => {
|
||||
<InviteSpaceMemberDialog
|
||||
open={inviteOpen}
|
||||
onOpenChange={setInviteOpen}
|
||||
finalFocus={inviteButtonRef}
|
||||
space={space}
|
||||
viewerName={viewerName}
|
||||
memberUserNames={memberUserNames}
|
||||
|
||||
@@ -291,8 +291,8 @@ const StorageSection = () => {
|
||||
<span className="grid min-w-0 flex-1 gap-1 sm:grid-cols-[minmax(12rem,16rem)_1fr] sm:gap-5">
|
||||
<span className="flex min-w-0 flex-col gap-1">
|
||||
<span className="flex min-w-0 items-center gap-2">
|
||||
<Icon className="mu-icon shrink-0 text-mu-ink-muted" />
|
||||
<span className="truncate text-mu-ink">{t(option.titleKey)}</span>
|
||||
<Icon className="mu-icon shrink-0 text-mu-text-secondary" />
|
||||
<span className="truncate text-mu-text">{t(option.titleKey)}</span>
|
||||
</span>
|
||||
{option.badges && (
|
||||
<span className="flex flex-wrap gap-1.5 ps-6">
|
||||
@@ -304,7 +304,7 @@ const StorageSection = () => {
|
||||
</span>
|
||||
)}
|
||||
</span>
|
||||
<span className="mu-caption text-mu-ink-muted">{t(option.descriptionKey)}</span>
|
||||
<span className="mu-caption text-mu-text-secondary">{t(option.descriptionKey)}</span>
|
||||
</span>
|
||||
</Field.Label>
|
||||
</Field.Item>
|
||||
@@ -314,15 +314,15 @@ const StorageSection = () => {
|
||||
</Field.Root>
|
||||
|
||||
<div>
|
||||
<div className="mb-2 flex items-center gap-2 mu-label-sm text-mu-ink-muted">
|
||||
<div className="mb-2 flex items-center gap-2 mu-label-sm text-mu-text-secondary">
|
||||
<SelectedStorageIcon className="mu-icon-sm" />
|
||||
<span>{t("setting.storage.current-storage")}</span>
|
||||
<span className="text-mu-ink">{t(selectedStorageOption.titleKey)}</span>
|
||||
<span className="text-mu-text">{t(selectedStorageOption.titleKey)}</span>
|
||||
</div>
|
||||
<ul className="flex flex-col gap-1.5 mu-caption text-mu-ink-muted">
|
||||
<ul className="flex flex-col gap-1.5 mu-caption text-mu-text-secondary">
|
||||
{selectedStorageOption.noteKeys.map((note) => (
|
||||
<li key={note} className="flex gap-2">
|
||||
<span className="mt-2 size-1 rounded-full bg-mu-ink-muted/60" aria-hidden />
|
||||
<span className="mt-2 size-1 rounded-full bg-mu-text-secondary/60" aria-hidden />
|
||||
<span>{t(note)}</span>
|
||||
</li>
|
||||
))}
|
||||
|
||||
@@ -156,10 +156,10 @@ const TagsSection = () => {
|
||||
return (
|
||||
<SettingSection title={t("setting.tags.label")}>
|
||||
<SettingGroup title={t("setting.tags.title")} description={t("setting.tags.description")}>
|
||||
<SettingPanel footer={<span className="mu-caption text-mu-ink-muted">{t("setting.tags.tag-pattern-hint")}</span>}>
|
||||
<SettingPanel footer={<span className="mu-caption text-mu-text-secondary">{t("setting.tags.tag-pattern-hint")}</span>}>
|
||||
<div className="flex flex-col gap-3">
|
||||
<div className="flex items-center justify-between gap-3">
|
||||
<div className="flex items-center gap-2 mu-label text-mu-ink">
|
||||
<div className="flex items-center gap-2 mu-label text-mu-text">
|
||||
<PlusIcon className="mu-icon-sm" />
|
||||
<span>{t("setting.tags.add-rule")}</span>
|
||||
</div>
|
||||
@@ -192,7 +192,7 @@ const TagsSection = () => {
|
||||
{newTagError && <Field.Error match>{newTagError}</Field.Error>}
|
||||
</Field.Root>
|
||||
|
||||
<div className="flex h-8 items-center gap-2 rounded-mu-md border border-mu-line bg-mu-canvas px-2 mu-body text-mu-ink-muted">
|
||||
<div className="flex h-8 items-center gap-2 rounded-mu-md border border-mu-line bg-mu-canvas px-2 mu-body text-mu-text-secondary">
|
||||
<PaletteIcon className="mu-icon" />
|
||||
<span>{t("setting.tags.background-color")}</span>
|
||||
<input
|
||||
@@ -210,7 +210,7 @@ const TagsSection = () => {
|
||||
<Field.Root>
|
||||
<Field.Label>
|
||||
<Checkbox checked={newTagBlur} onCheckedChange={setNewTagBlur} />
|
||||
<EyeOffIcon className="mu-icon text-mu-ink-muted" />
|
||||
<EyeOffIcon className="mu-icon text-mu-text-secondary" />
|
||||
{t("setting.tags.blur-content")}
|
||||
</Field.Label>
|
||||
</Field.Root>
|
||||
@@ -219,7 +219,7 @@ const TagsSection = () => {
|
||||
</SettingPanel>
|
||||
|
||||
<div className="flex items-center justify-between gap-3">
|
||||
<h4 id={configuredRulesId} className="mu-label text-mu-ink-muted">
|
||||
<h4 id={configuredRulesId} className="mu-label text-mu-text-secondary">
|
||||
{t("setting.tags.configured-rules")}
|
||||
</h4>
|
||||
<Badge tone="outline">{configuredEntries.length}</Badge>
|
||||
@@ -227,8 +227,8 @@ const TagsSection = () => {
|
||||
|
||||
{configuredEntries.length === 0 ? (
|
||||
<div className="flex flex-col items-center justify-center gap-2 rounded-mu-lg border border-dashed border-mu-line px-4 py-8 text-center">
|
||||
<TagIcon className="mu-icon size-5 text-mu-ink-muted" />
|
||||
<p className="mu-body text-mu-ink-muted">{t("setting.tags.no-tags-configured")}</p>
|
||||
<TagIcon className="mu-icon size-5 text-mu-text-secondary" />
|
||||
<p className="mu-body text-mu-text-secondary">{t("setting.tags.no-tags-configured")}</p>
|
||||
</div>
|
||||
) : (
|
||||
<SettingList aria-labelledby={configuredRulesId}>
|
||||
@@ -236,17 +236,17 @@ const TagsSection = () => {
|
||||
<List.Item key={row.name} className="grid gap-3 lg:grid-cols-[minmax(12rem,1fr)_auto_auto_auto] lg:items-center">
|
||||
<div className="min-w-0">
|
||||
<div className="flex min-w-0 items-center gap-2">
|
||||
<TagIcon className="mu-icon shrink-0 text-mu-ink-muted" />
|
||||
<span className="truncate font-mono mu-body text-mu-ink">{row.name}</span>
|
||||
<TagIcon className="mu-icon shrink-0 text-mu-text-secondary" />
|
||||
<span className="truncate font-mono mu-body text-mu-text">{row.name}</span>
|
||||
</div>
|
||||
<div className="mt-1 flex flex-wrap items-center gap-2 pl-6 mu-caption text-mu-ink-muted">
|
||||
<div className="mt-1 flex flex-wrap items-center gap-2 pl-6 mu-caption text-mu-text-secondary">
|
||||
<span>{t("setting.tags.matching-rule")}</span>
|
||||
<span className="text-mu-line">/</span>
|
||||
<span>{t("setting.tags.used-count", { count: row.count })}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex items-center gap-2 mu-body text-mu-ink-muted">
|
||||
<div className="flex items-center gap-2 mu-body text-mu-text-secondary">
|
||||
<span
|
||||
className={cn("size-5 rounded-mu-md border border-mu-line", !localTags[row.name].color && "bg-mu-canvas")}
|
||||
style={{ backgroundColor: localTags[row.name].color ?? DEFAULT_TAG_COLOR }}
|
||||
@@ -267,7 +267,7 @@ const TagsSection = () => {
|
||||
<Field.Root>
|
||||
<Field.Label>
|
||||
<Checkbox checked={localTags[row.name].blur} onCheckedChange={(checked) => handleBlurChange(row.name, checked)} />
|
||||
<EyeOffIcon className="mu-icon text-mu-ink-muted" />
|
||||
<EyeOffIcon className="mu-icon text-mu-text-secondary" />
|
||||
{t("setting.tags.blur-content")}
|
||||
</Field.Label>
|
||||
</Field.Root>
|
||||
|
||||
@@ -111,7 +111,7 @@ function UsageLimitDialog({ open, onOpenChange, entry, defaults, users, saving,
|
||||
<span className="max-w-40 truncate">{label}</span>
|
||||
<button
|
||||
type="button"
|
||||
className="rounded-full p-0.5 text-mu-ink-muted hover:bg-mu-hover hover:text-mu-ink"
|
||||
className="rounded-full p-0.5 text-mu-text-secondary hover:bg-mu-hover hover:text-mu-text"
|
||||
aria-label={t("setting.usage-limits.remove-user", { name: label })}
|
||||
onClick={() => setNames((current) => current.filter((item) => item !== name))}
|
||||
>
|
||||
@@ -161,7 +161,7 @@ function UsageLimitDialog({ open, onOpenChange, entry, defaults, users, saving,
|
||||
{isInvalid(metric) && <Field.Error match>{t("setting.usage-limits.invalid")}</Field.Error>}
|
||||
</Field.Root>
|
||||
))}
|
||||
<p className="mu-caption text-mu-ink-muted">
|
||||
<p className="mu-caption text-mu-text-secondary">
|
||||
{forAll ? t("setting.usage-limits.default-hint") : t("setting.usage-limits.entry-hint")}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user