Skip to content

Commit 72c444b

Browse files
committed
refactor!: remove product-owned components
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.
1 parent 15a7afb commit 72c444b

112 files changed

Lines changed: 69 additions & 889 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎AGENTS.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ These are decisions, not suggestions. Changing one needs the maintainer's sign-o
4444
- **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).
4545
- **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).
4646
- **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.
4848
- **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.
4949
- **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.
5050
- **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 List and 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.
5252
- **Scoped CSS.** Classes start with `mu-`. No global selectors beyond `:root` and `.mu-root`, so the package can mount inside a host page.
5353
- **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).
5454
- **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.

‎CHANGELOG.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ Changes to `@usememos/ui` that an app can see. New entries go under "Unreleased"
44

55
## Unreleased
66

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.
810

911
## 26.11.19
1012

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The Memos UI design system: tokens, foundation styles and React components for m
66
- Light and Dark themes, all from CSS custom properties. Apps can add their own.
77
- One package, `@usememos/ui`. ESM only, for React 18 or later, with behavior from [Base UI](https://base-ui.com).
88

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.
1010

1111
## Use it
1212

‎docs/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ It is not a general-purpose UI library for outside developers. Components are ge
2626
| [Motion](motion.md) | Immediate feedback, minimal opening and closing, and reduced motion |
2727
| [States](states.md) | Hover, pressed, loading, disabled, invalid and focus |
2828
| [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 |
3030
| [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 |
3131
| [Patterns](patterns.md) | Page, form, entry, confirmation, loading, empty state and mobile |
3232
| [Building on it](building.md) | Base UI, loading the CSS, scoping inside a host page, theme selection and API conventions |

‎docs/building.md‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ An app changes only the color and font tokens. Every other token and every `mu-*
5757
- 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.
5858
- `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).
5959
- 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).
6160
- `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).
6261
- `mu-visually-hidden` hides text visually but keeps it for screen readers.
6362
- 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).
@@ -97,7 +96,7 @@ import { Ellipsis, Pin, Trash2 } from "lucide-react";
9796
- **Base UI's names.** `Root`, `Trigger`, `Popup`, `Item`, `Title`, `Description`, `Close`, `Panel` and so on. No shadcn names (`DropdownMenuContent`, `CardHeader`).
9897
- **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.
9998
- **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.
101100
- **No data props.** Collections are built from parts (`Menu.Item`, `Select.Item`, `Tabs.Tab`), not passed as `items` or `options` arrays.
102101

103102
### Props
@@ -132,9 +131,9 @@ const toast = Toast.useToastManager();
132131
toast.add({ title: "Note archived", type: "success" });
133132
```
134133

135-
## Shared styles for content
134+
## Product-owned content
136135

137-
`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.
138137

139138
## What every new component needs
140139

‎docs/color.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Memos UI is ink on paper: a light warm-gray canvas, bright surfaces, `primary` i
1010
| Wells | `well` | Switch tracks, segmented groups, unchecked boxes and radios, pressed toggles, inline code |
1111
| Hover | `hover` | Rows, ghost buttons, the highlighted menu row |
1212
| Saved choices | `selected` | Persistent fill on soft toggles, distinct from hover |
13-
| Keys | `key`, `key-hover` | Neutral buttons, select triggers, the selected tab, kbd |
13+
| Keys | `key`, `key-hover` | Neutral buttons, select triggers, the selected tab |
1414
| 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 |
1515
| Emphasis | `primary`, `primary-hover`, `on-primary` | Primary button, checked checkbox and radio, switch when on, tooltip |
1616
| 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**.
4646
- 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.
4747
- 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.
4848
- 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 Checkbox and 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).
5050

5151
### Choosing a theme
5252

@@ -103,10 +103,10 @@ An app can offer more themes than the two the package ships, such as a warm Pape
103103
| `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 |
104104
| `hover` | `oklch(0.95 0.006 95)` | `#252525` | Hover on rows, ghost buttons and wells; the highlighted row in menus and selects |
105105
| `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 |
107107
| `key-hover` | `oklch(0.982 0.004 95)` | `#3c3c3c` | Hover on a neutral key |
108108
| `edge` | `oklch(0.858 0.006 95)` | `#343434` | Quiet resting borders of fields, neutral buttons, switch tracks, well/key surfaces, popups, badges, selects and disabled controls |
109-
| `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 Checkbox and Radio markers only; never a full-control hover or selected boundary; at least 3:1 on `canvas` and `surface` |
110110
| `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 |
111111
| `overlay` | `rgba(0,0,0,0.32)` | `rgba(0,0,0,0.6)` | Backdrop behind dialogs and sheets |
112112
| `text` | `#1a1a1a` | `#ededed` | Primary text and icons on canvas, surface, well, key and selected (10:1 or more in both themes) |

0 commit comments

Comments
 (0)