You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 72c444b
Browse filesBrowse the repository at this point in the historyBrowse files
Keep avatars and rendered-content styles in products. Build submitted forms
with native or Base UI Form and shared fields; use shortcut hints or native
kbd elements for key labels.
Remove Avatar, Form, Kbd and Prose, their guides and verification fixtures,
and synchronize component consumers and Linux screenshots.
Copy file name to clipboardExpand all lines: AGENTS.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,11 +44,11 @@ These are decisions, not suggestions. Changing one needs the maintainer's sign-o
44
44
-**Apps set only color and font tokens.** The 29 color tokens and three font tokens are the whole theming surface; `themeTokens` lists the 29 an app theme sets. Every other token and every `mu-*` class rule is internal to the package. See [What an app can change](docs/color.md#what-an-app-can-change).
45
45
-**Apps build their own parts from the package.** Base UI for behavior, class functions (`buttonClasses`, `menuClasses`) and [public classes](docs/custom-components.md#public-classes) for looks, `--mu-row-*` variables and tokens for the rest. A component whose look apps reuse exports `<component>Classes()` and builds its own classes with it. See [Building your own component](docs/custom-components.md).
46
46
-**Two themes.** Every change works in Light and Dark (`data-theme="light" | "dark"`), and under `prefers-reduced-motion`. Apps add their own themes by setting the theme tokens ([App themes](docs/color.md#app-themes)); the package ships and tests only these two.
47
-
-**Few sizes, two weights.** Text uses the nine styles in [Typography](docs/typography.md): 13, 14, 16 and 20px in apps (11px only for the text of 20px parts: xs controls and kbd; badges use 13px; 32px only for a website hero), weights 400 and 500 (600 only for bold and headings inside Prose), letter spacing 0. Field and setting names stay 500 in every layout; values, Menu/Select/Combobox items and descriptions stay 400. Horizontal Field labels in a Popover use `text-secondary`; other Field labels use `text`, with disabled text always `text-disabled`. See [Text roles](docs/typography.md#text-roles). Font decisions follow Apple's typography guidelines, as that page explains. No other size or weight without a written reason in that page.
47
+
-**Few sizes, two weights.** Text uses the nine styles in [Typography](docs/typography.md): 13, 14, 16 and 20px in apps (11px only for the text of 20px parts: xs controls; badges use 13px; 32px only for a website hero), weights 400 and 500, letter spacing 0. Field and setting names stay 500 in every layout; values, Menu/Select/Combobox items and descriptions stay 400. Horizontal Field labels in a Popover use `text-secondary`; other Field labels use `text`, with disabled text always `text-disabled`. See [Text roles](docs/typography.md#text-roles). Font decisions follow Apple's typography guidelines, as that page explains. No other size or weight without a written reason in that page.
48
48
-**Sizes come in rows.**`size` is `xs | sm | md` (20, 24, 32px; md default; there is no `lg`) and sets height, padding, text, icon and radius together. Only the components listed in [Control sizes](docs/layout.md#control-sizes) take `xs`; text entry, menus, tabs and tables are `sm | md`. [Floating-list items](docs/layout.md#floating-list-items) keep 8px inline padding at both sizes, including with leading icons; standalone trailing Menu icons get the shared 2px optical correction. The one height between sizes is `mu-compact`, a class that makes md 28px inside an app's sidebar; it is not a `size` value. The same size has the same geometry, text and hit boundaries on every input device; no touch-only size overrides or hit-area extensions.
49
49
-**One spacing ladder.** Layout uses 4, 8, 12, 16, 20, 24, 32, 48 and 64px, and each step has a job: see [Spacing](docs/layout.md#spacing). 2px is `inset` only. Closer means more related; bounded panels keep their content inset at least as large as their ordinary peer-block gap. Page gutters and region/footer separation follow their own documented roles. Apps follow the same ladder: `spacingSteps` lists the steps, and `offLadderSpacing()` finds an app's Tailwind classes that miss them.
50
50
-**Lucide icons as elements** (`icon={<Pin />}`). No `size` or `strokeWidth` props: CSS sets 12/14/16px and a 1.25px screen-pixel stroke at every size.
51
-
-**Not in the set:** Card (the only boxes are List, a `bordered` Table and a `bordered`Form), Slider, Stepper, Chip, SegmentedControl, Accordion. See [what was left out](docs/components/README.md#left-out-on-purpose) and what to use instead.
51
+
-**Not in the set:** Card (the only boxes are Listand a `bordered`Table), Slider, Stepper, Chip, SegmentedControl, Accordion. See [what was left out](docs/components/README.md#left-out-on-purpose) and what to use instead.
52
52
-**Scoped CSS.** Classes start with `mu-`. No global selectors beyond `:root` and `.mu-root`, so the package can mount inside a host page.
53
53
-**Source order decides.** Inside the package a later rule beats an earlier one on the same element. Every `:has()` sits in `:where()`, so it adds no specificity. See [Writing component CSS](docs/building.md#writing-component-css).
54
54
-**Accessibility.** Text keeps 4.5:1 contrast in both themes. Keyboard focus recolors the existing 1px border (`focus` ink, or contrasting text color on filled controls); text links get a double underline. A focused text field keeps its normal border and surface, with the caret or text selection showing typing focus. Forced-colors mode uses a 2px system focus edge. No focus rings or visible outlines; popups never draw a focus boundary. Icon-only controls have an `aria-label` and a Tooltip.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,9 @@ Changes to `@usememos/ui` that an app can see. New entries go under "Unreleased"
4
4
5
5
## Unreleased
6
6
7
-
-**Breaking:** use the same size rows, text, spacing and hit boundaries for mouse and touch input. Remove touch-only 44px minimum dimensions, checkbox/radio/switch margins, expanded hit areas, field text enlargement, Prose task-row expansion and Dialog/Drawer title padding. Remove the public `mu-hit` class and `hit-area` token. The reaction-picker recipe changes columns only with viewport width.
7
+
-**Breaking:** use the same size rows, text, spacing and hit boundaries for mouse and touch input. Remove touch-only 44px minimum dimensions, checkbox/radio/switch margins, expanded hit areas, field text enlargement and Dialog/Drawer title padding. Remove the public `mu-hit` class and `hit-area` token. The reaction-picker recipe changes columns only with viewport width.
8
+
9
+
-**Breaking:** remove Avatar, Form, Kbd and Prose, their public types and CSS classes. Products own avatars and rendered-content styles. Compose submitted forms with a native `<form>` or Base UI Form, Field, Fieldset and Button; use Menu/Tooltip `shortcut` hints or native `<kbd>` for key labels. Remove their fixtures, tests and screenshot baselines.
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ The Memos UI design system: tokens, foundation styles and React components for m
6
6
- Light and Dark themes, all from CSS custom properties. Apps can add their own.
7
7
- One package, `@usememos/ui`. ESM only, for React 18 or later, with behavior from [Base UI](https://base-ui.com).
8
8
9
-
The package ships the tokens, the foundation styles and 31 components, each with a page in [docs/components](docs/components/README.md). Versions follow memos' CalVer (`26.10.0`, `26.10.1`) and do not signal breaking changes, so pin an exact version. [docs/](docs/README.md) is the design system and the source of truth for the package.
9
+
The package ships the tokens, the foundation styles and components, each with a page in [docs/components](docs/components/README.md). Versions follow memos' CalVer (`26.10.0`, `26.10.1`) and do not signal breaking changes, so pin an exact version. [docs/](docs/README.md) is the design system and the source of truth for the package.
Copy file name to clipboardExpand all lines: docs/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ It is not a general-purpose UI library for outside developers. Components are ge
26
26
|[Motion](motion.md)| Immediate feedback, minimal opening and closing, and reduced motion |
27
27
|[States](states.md)| Hover, pressed, loading, disabled, invalid and focus |
28
28
|[Icons](icons.md)| Lucide, sizes, the fixed stroke and accessibility |
29
-
|[Components](components/README.md)| The 31 components, what was left out, and one page per component |
29
+
|[Components](components/README.md)| The components, what was left out, and one page per component |
30
30
|[Using the components](usage.md)| Which component to pick (overlays, controls, feedback), recipes for combining them, size, emphasis, an accessibility checklist, common mistakes and a map from other UI kits |
31
31
|[Patterns](patterns.md)| Page, form, entry, confirmation, loading, empty state and mobile |
32
32
|[Building on it](building.md)| Base UI, loading the CSS, scoping inside a host page, theme selection and API conventions |
Copy file name to clipboardExpand all lines: docs/building.md
+3-4Lines changed: 3 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,7 +57,6 @@ An app changes only the color and font tokens. Every other token and every `mu-*
57
57
- The [public classes](custom-components.md#public-classes) are for apps too: size rows (`mu-s-md`), surface roles (`mu-key`), focus, icons and the type scale. Apps apply them to their own parts and never override them.
58
58
-`mu-positioner` puts a popup's positioner on `layer-popup`, and `mu-popup-motion` supplies the shared opening and closing fade and `space-1` offset over `duration-fade`. Under reduced motion it has no transition, including opacity. See [Motion](motion.md).
59
59
- The surface classes `mu-well`, `mu-key` and `mu-popup` apply flat fills and borders. Use them for new parts. See [Surfaces and boundaries](depth.md).
60
-
-`mu-prose` styles rendered content. See [Prose](components/prose.md).
61
60
-`mu-icon` applies icon size and stroke rules outside a component, at the size of the nearest size row; `mu-icon-xs`, `mu-icon-sm` and `mu-icon-md` set a fixed size on their own. See [Icons](icons.md).
62
61
-`mu-visually-hidden` hides text visually but keeps it for screen readers.
63
62
- A size row class sets the `--mu-row-*` variables (height, padding, text, radius, gap, icon) that every part inside reads. See [Row variables](custom-components.md#row-variables).
-**Base UI's names.**`Root`, `Trigger`, `Popup`, `Item`, `Title`, `Description`, `Close`, `Panel` and so on. No shadcn names (`DropdownMenuContent`, `CardHeader`).
98
97
-**One `Popup` per overlay.** Base UI's `Portal`, `Positioner` and `Backdrop` are folded into our `Popup`. It takes `side`, `align`, Base UI's other placement behavior (`anchor`, `sticky`, `collisionAvoidance`, `collisionBoundary`, `positionMethod`, `disableAnchorTracking`) and its portal `container`, and draws the backdrop where the component has one (Dialog). The gap to the trigger and the distance kept from the viewport edge are fixed by the system (4px for menus and lists, 6px for popovers and tooltips; Base UI's default edge distance), so `sideOffset`, `alignOffset` and `collisionPadding` are not props.
99
98
-**Indicators are built in.** The check in a menu or select item, the chevron in a select trigger and the knob in a switch render by themselves. See [built-in glyphs](icons.md#built-in-glyphs).
100
-
-**One element, one component.** Button, Input, Textarea, Badge, Kbd, Separator, Spinner, Skeleton, Link, Checkbox, Switch and Toggle are single components, not namespaces.
99
+
-**One element, one component.** Button, Input, Textarea, Badge, Separator, Spinner, Skeleton, Link, Checkbox, Switch and Toggle are single components, not namespaces.
101
100
-**No data props.** Collections are built from parts (`Menu.Item`, `Select.Item`, `Tabs.Tab`), not passed as `items` or `options` arrays.
`Prose` is one stylesheet shared by every place content is rendered or edited, including the editor (`@usememos/editor`). Content never shifts between editing and reading.
136
+
Rendered content and avatars belong to the product. The editor (`@usememos/editor`) owns its reading and editing styles; this package does not style Markdown. Build submitted forms with a native `<form>` or Base UI Form and this package’s Field, Fieldset and Button.
| Text |`text`, `text-secondary`, `text-disabled`| Primary, secondary and disabled text. Each keeps 4.5:1 on the backgrounds named in the token table below |
15
15
| Emphasis |`primary`, `primary-hover`, `on-primary`| Primary button, checked checkbox and radio, switch when on, tooltip |
16
16
| Meta |`accent`, `selection`, `focus`, `focus-edge`| Links and text selection (`accent`); the control keyboard focus edge and the forced-colors field focus edge (`focus`, `focus-edge`). Never a fill |
@@ -46,7 +46,7 @@ There are two themes: **Light** (the default) and **Dark**.
46
46
- Each theme sets every color token explicitly. The package's tests check the values against the table on this page and check the contrast promised here.
47
47
- Light starts with a pale warm-gray paper canvas. White surfaces and keys remain brighter; wells and hover fills are darker steps in the same warm-gray family. This is a flat color treatment, with no texture.
48
48
- Dark keeps the same flat surface roles. Wells and keys are distinct gray fills, and `primary` flips to near-white with a dark `on-primary`.
49
-
-`edge` separates bounded surfaces and stays quiet at rest, on hover and under selected/pressed attributes. Text fields keep it during typing focus too; neutral buttons, Selects and off switch tracks do not strengthen it on hover. `control-edge` is reserved for small unchecked Checkbox, Radio and Prose task marks, at least 3:1 against `canvas` and `surface` in both themes. On default toggles use a `well` fill with `text`, without a visible border; soft toggles use `hover` when off and `selected` with `text` when on; segmented choices use a contrasting `key` fill in a quiet well. Text tokens never become persistent borders. Non-text controls retain their focus treatment; invalid fields retain their error edge. Forced colors adds system-colored selection boundaries when fills disappear; `line` separates content. The quiet resting field boundary remains below 3:1; see [boundary contrast](depth.md#rules).
49
+
-`edge` separates bounded surfaces and stays quiet at rest, on hover and under selected/pressed attributes. Text fields keep it during typing focus too; neutral buttons, Selects and off switch tracks do not strengthen it on hover. `control-edge` is reserved for small unchecked Checkboxand Radio marks, at least 3:1 against `canvas` and `surface` in both themes. On default toggles use a `well` fill with `text`, without a visible border; soft toggles use `hover` when off and `selected` with `text` when on; segmented choices use a contrasting `key` fill in a quiet well. Text tokens never become persistent borders. Non-text controls retain their focus treatment; invalid fields retain their error edge. Forced colors adds system-colored selection boundaries when fills disappear; `line` separates content. The quiet resting field boundary remains below 3:1; see [boundary contrast](depth.md#rules).
50
50
51
51
### Choosing a theme
52
52
@@ -103,10 +103,10 @@ An app can offer more themes than the two the package ships, such as a warm Pape
103
103
|`well`|`oklch(0.934 0.008 95)`|`#252525`| Flat parts that hold a state: switch, tab, checkbox and radio wells, pressed toggles, inline code. A boundary is added only where the component needs one. Not for enabled text entry |
104
104
|`hover`|`oklch(0.95 0.006 95)`|`#252525`| Hover on rows, ghost buttons and wells; the highlighted row in menus and selects |
105
105
|`selected`|`oklch(0.919 0.004 95)`|`#343434`| Persistent soft-toggle fill, including while hovered; with `text` or `text-disabled`, never a selected border |
106
-
|`key`|`#ffffff`|`#343434`| Controls and selected parts: neutral buttons, select triggers, the selected tab, kbd. Flat: neutral buttons and selects use `edge`; selected segments use fill without a visible border in normal colors |
106
+
|`key`|`#ffffff`|`#343434`| Controls and selected parts: neutral buttons, select triggers, the selected tab. Flat: neutral buttons and selects use `edge`; selected segments use fill without a visible border in normal colors |
107
107
|`key-hover`|`oklch(0.982 0.004 95)`|`#3c3c3c`| Hover on a neutral key |
|`control-edge`|`#909090`|`#777777`| Small unchecked Checkbox, Radio and Prose task markers only; never a full-control hover or selected boundary; at least 3:1 on `canvas` and `surface`|
109
+
|`control-edge`|`#909090`|`#777777`| Small unchecked Checkboxand Radio markers only; never a full-control hover or selected boundary; at least 3:1 on `canvas` and `surface`|
110
110
|`line`|`oklch(0.919 0.004 95)`|`#252525`| Separators, table rules and menu dividers. About 1.2:1 against canvas in Light, so structural lines also need spacing or a heading |
111
111
|`overlay`|`rgba(0,0,0,0.32)`|`rgba(0,0,0,0.6)`| Backdrop behind dialogs and sheets |
112
112
|`text`|`#1a1a1a`|`#ededed`| Primary text and icons on canvas, surface, well, key and selected (10:1 or more in both themes) |
0 commit comments