@umriss-ui/core 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +103 -0
- package/README.md +50 -18
- package/dist/core.css +1 -1
- package/dist/core.js +2297 -2324
- package/dist/de.d.ts +67 -0
- package/dist/formats-DrB9TuzO.js +65 -0
- package/dist/index.d.ts +94 -26
- package/dist/wording/de.js +18 -3
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -50,6 +50,109 @@ module on the caller's side that carries `"use client"` and imports from there.
|
|
|
50
50
|
|
|
51
51
|
---
|
|
52
52
|
|
|
53
|
+
## 0.3.0 – English formats, and the context menu (Sep. 2026)
|
|
54
|
+
|
|
55
|
+
### Changed
|
|
56
|
+
|
|
57
|
+
- **The formats are English.** `DEFAULT_FORMATS` writes `en-GB` on a 24-hour
|
|
58
|
+
clock: `17/03/2026`, `09:05`, `1,234.5`, `74%`, "3 minutes ago", and English
|
|
59
|
+
collation. Until now it wrote `de-DE` whatever the wording said (ADR-0024;
|
|
60
|
+
ADR-0019 left this decision open on purpose).
|
|
61
|
+
- **German ships as a pair.** `GERMAN_FORMATS` stands beside `GERMAN_WORDING`
|
|
62
|
+
behind `@umriss-ui/core/wording/de`, so a German application takes both
|
|
63
|
+
halves of its language in one import:
|
|
64
|
+
`language={{ wording: GERMAN_WORDING, formats: GERMAN_FORMATS }}`. An
|
|
65
|
+
application that hands in the wording alone now gets German words over
|
|
66
|
+
English notation - which is what the library shipped before, and why the
|
|
67
|
+
decision was made.
|
|
68
|
+
- **`NumberInput` reads the notation it writes.** Its parser no longer assumes
|
|
69
|
+
a German dot and comma; the separators are measured off the formats
|
|
70
|
+
(`separatorsOf`), so a field under any notation - including one an
|
|
71
|
+
application replaced - reads its own output back. `parseNumber` and
|
|
72
|
+
`filterInput` take the separators as a last argument, defaulting to the
|
|
73
|
+
default notation.
|
|
74
|
+
- **What did not move:** the CSV export of `@umriss-ui/table` keeps its decimal
|
|
75
|
+
comma and its semicolon (a machine format for a spreadsheet, argued at its
|
|
76
|
+
site), and the German test fixtures that measure a property *of* German stay
|
|
77
|
+
German.
|
|
78
|
+
|
|
79
|
+
### Added
|
|
80
|
+
|
|
81
|
+
- **`formatsFor(locale)`** builds a complete `Formats` for a locale - the
|
|
82
|
+
product's options (day first, two digits, 24-hour clock, per cent without
|
|
83
|
+
decimals) over the locale's separators and words.
|
|
84
|
+
- **`separatorsOf(formats)`** and `DEFAULT_SEPARATORS`: the group and decimal
|
|
85
|
+
separator a notation writes, measured rather than declared.
|
|
86
|
+
- **Three wording entries for `@umriss-ui/schedule`'s lane groups**:
|
|
87
|
+
`scheduleFoldGroup`, `scheduleUnfoldGroup` and `scheduleLaneCount(count)`,
|
|
88
|
+
in English and in `GERMAN_WORDING`. An application that supplies a complete
|
|
89
|
+
`Wording` of its own gains three required entries — which the type says, at
|
|
90
|
+
compile time, as it is meant to (ADR-0019).
|
|
91
|
+
|
|
92
|
+
### The first release that is not a candidate
|
|
93
|
+
|
|
94
|
+
`@umriss-ui/core` was already on `latest`; `@umriss-ui/charts` and
|
|
95
|
+
`@umriss-ui/schedule` join it with this delivery, and the three are released
|
|
96
|
+
together because the schedule stands on both.
|
|
97
|
+
|
|
98
|
+
## The context menu (Sep. 2026)
|
|
99
|
+
|
|
100
|
+
From `.scratch/schedule/spec.md`, ticket 01, and
|
|
101
|
+
`.scratch/schedule-refinement/spec.md`, ticket 03.
|
|
102
|
+
|
|
103
|
+
### Added
|
|
104
|
+
|
|
105
|
+
- **`ContextMenu`** — the menu opened at a point instead of under a trigger, for
|
|
106
|
+
a right-click on a surface that is not a button. Controlled (`open`,
|
|
107
|
+
`onOpenChange`, `position` in client coordinates, `ariaLabel`), built on
|
|
108
|
+
`Popover`, with `MenuItem`, `MenuSeparator` and the menu's keyboard. The focus
|
|
109
|
+
returns to where it stood when the menu opened.
|
|
110
|
+
- **Wording:** `scheduleLaneRefused`, `scheduleOverlap`, `scheduleLateTransport`,
|
|
111
|
+
`scheduleGhostTimes`, `scheduleSetup`, `scheduleTeardown`,
|
|
112
|
+
`scheduleTransport`, `scheduleRoute`, `scheduleOverlapWith` and
|
|
113
|
+
`scheduleLateBy`, for `@umriss-ui/schedule`, in both shipped wordings. An
|
|
114
|
+
application that hands in a whole `Wording` object of its own adds the nine.
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## 0.2.0 – Styles that load themselves, and touch nothing else (Sep. 2026)
|
|
119
|
+
|
|
120
|
+
Delivery report for `.scratch/styles-without-side-effects/spec.md` (ADR-0021).
|
|
121
|
+
The second version on the registry. The middle digit rises because `theme`
|
|
122
|
+
leaves `UmrissProvider` and the base layer leaves the stylesheet - read
|
|
123
|
+
**Changed** before upgrading from `0.1.0`.
|
|
124
|
+
|
|
125
|
+
### Changed
|
|
126
|
+
|
|
127
|
+
- **No stylesheet import any more.** `dist/core.js` imports its own stylesheet;
|
|
128
|
+
`import { Button } from "@umriss-ui/core"` is the whole setup.
|
|
129
|
+
`@umriss-ui/core/styles.css` stays exported and is optional.
|
|
130
|
+
- **No base layer.** The rules on `html`, `body`, `*`, `:focus-visible`,
|
|
131
|
+
`::selection`, `input`/`textarea` and the page's scrollbars are gone. An
|
|
132
|
+
application that relied on them for its own page - margin, font, background,
|
|
133
|
+
box model, selection colour - sets them itself. Every component carries what it
|
|
134
|
+
needs: its text context, `box-sizing` and squircle corners on its own elements
|
|
135
|
+
and their `::before`/`::after`, a focus ring on every element it puts into the
|
|
136
|
+
tab order (the calendar's days and month arrows, the range presets and the
|
|
137
|
+
close buttons of `Modal` and `Toast` included), caret, autofill look and
|
|
138
|
+
scrollbars on its own fields and scroll containers.
|
|
139
|
+
- **Cascade layers.** Every rule lies in `umriss.tokens`, `umriss.base` or
|
|
140
|
+
`umriss.components`. CSS an application writes outside a layer wins over the
|
|
141
|
+
library whatever its specificity and loading order, and a token is overridden
|
|
142
|
+
with `:root { --u-… }`.
|
|
143
|
+
- **Light and dark are `color-scheme`.** Tokens with two values are
|
|
144
|
+
`light-dark(<light>, <dark>)`. `:root[data-theme="dark"]` is gone and
|
|
145
|
+
`color-scheme` is no longer set on `:root`: an application sets
|
|
146
|
+
`color-scheme` (most theme libraries already do), and one that sets nothing
|
|
147
|
+
stays light.
|
|
148
|
+
- **`UmrissProvider` has no `theme`** - the prop, `UmrissConfig.theme` and the
|
|
149
|
+
`Theme` type are removed - and it writes nothing onto the document any more,
|
|
150
|
+
including the `data-density` attribute no stylesheet read. `density` works as
|
|
151
|
+
before, through context.
|
|
152
|
+
- **Browsers:** Chrome 123, Firefox 120, Safari 17.5 or newer (`light-dark()`).
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
53
156
|
## 0.1.0 – First publication (Sep. 2026)
|
|
54
157
|
|
|
55
158
|
The first version published to npm, under the tag `latest`. It is the state described by
|
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ once for all three packages in [`../../docs/design-language.md`](../../docs/desi
|
|
|
10
10
|
## Use
|
|
11
11
|
|
|
12
12
|
```bash
|
|
13
|
-
pnpm add @umriss-ui/core
|
|
13
|
+
pnpm add @umriss-ui/core
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
The demo is the documentation: <https://romanhaendler.github.io/umriss-ui/core/>.
|
|
@@ -18,27 +18,56 @@ In an application:
|
|
|
18
18
|
|
|
19
19
|
```tsx
|
|
20
20
|
import { Button, Card } from "@umriss-ui/core";
|
|
21
|
-
import "@umriss-ui/core/styles.css";
|
|
22
|
-
// The package ships no fonts; the application loads Geist itself.
|
|
23
|
-
// Without it the tokens fall back to the system fonts.
|
|
24
|
-
import "@fontsource/geist-sans/400.css";
|
|
25
|
-
import "@fontsource/geist-sans/500.css";
|
|
26
|
-
import "@fontsource/geist-sans/600.css";
|
|
27
|
-
import "@fontsource/geist-mono/400.css";
|
|
28
21
|
```
|
|
29
22
|
|
|
30
|
-
|
|
23
|
+
Nothing else is required.
|
|
31
24
|
|
|
32
|
-
|
|
25
|
+
## Styles
|
|
33
26
|
|
|
34
|
-
|
|
35
|
-
|
|
27
|
+
**They load themselves.** `dist/core.js` imports its stylesheet, and the
|
|
28
|
+
manifest marks CSS as a side effect, so a bundler keeps it. The stylesheet stays
|
|
29
|
+
exported as `@umriss-ui/core/styles.css` for setups that link stylesheets by
|
|
30
|
+
hand; nobody has to import it.
|
|
31
|
+
|
|
32
|
+
**They touch nothing else** (ADR-0021). No rule selects `html`, `body`, `*` or a
|
|
33
|
+
native element of the page, and the only rules on `:root` declare the tokens.
|
|
34
|
+
Each component carries what it needs itself: its type, `box-sizing` on its own
|
|
35
|
+
elements, a focus ring on what it makes focusable. A caller's content inside
|
|
36
|
+
`Stack` or `Grid` keeps the caller's type.
|
|
37
|
+
|
|
38
|
+
**Everything can be overridden.** The library's rules lie in three cascade
|
|
39
|
+
layers, `umriss.tokens`, `umriss.base` and `umriss.components`, and CSS written
|
|
40
|
+
outside a layer wins over all of them, whatever the order of loading:
|
|
41
|
+
|
|
42
|
+
```css
|
|
43
|
+
:root {
|
|
44
|
+
--u-font-sans: "Inter", system-ui, sans-serif;
|
|
45
|
+
--u-color-accent: #0f766e;
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
**Light and dark follow the application's `color-scheme`.** Every token with
|
|
50
|
+
two values is written `light-dark(<light>, <dark>)`. An application that
|
|
51
|
+
switches its mode with a theme library usually sets `color-scheme` already;
|
|
52
|
+
one with a switch of its own writes one line, which its native controls need
|
|
53
|
+
anyway:
|
|
54
|
+
|
|
55
|
+
```css
|
|
56
|
+
html.dark { color-scheme: dark; }
|
|
57
|
+
:root { color-scheme: light dark; } /* or: follow the system */
|
|
36
58
|
```
|
|
37
59
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
60
|
+
An application that sets nothing stays light. A part of a page can be dark on
|
|
61
|
+
its own (`<aside style="color-scheme: dark">`).
|
|
62
|
+
|
|
63
|
+
**Fonts are the application's.** The tokens name Geist first and end in the
|
|
64
|
+
system fonts; nothing is loaded. Geist is recommended — `@fontsource/geist-sans`
|
|
65
|
+
(400, 500, 600) and `@fontsource/geist-mono` (400) — and any other face is one
|
|
66
|
+
token away.
|
|
67
|
+
|
|
68
|
+
**Browsers:** Chrome 123, Firefox 120, Safari 17.5 or newer. `light-dark()` is
|
|
69
|
+
older nowhere; an older browser discards the tokens and shows the interface
|
|
70
|
+
unstyled.
|
|
42
71
|
|
|
43
72
|
## Wording
|
|
44
73
|
|
|
@@ -81,6 +110,7 @@ The table and the alarm list are not part of this package. They live in
|
|
|
81
110
|
| `ConfirmDialog` | a compact confirmation dialog, `tone="danger"` for destructive actions, loading state |
|
|
82
111
|
| `ToastProvider` / `useToast` | stacked status messages at the bottom right, four tones, auto-dismiss, `aria-live` |
|
|
83
112
|
| `Menu` / `MenuItem` / `MenuSeparator` | a dropdown menu with a portal panel, arrow-key navigation, `tone="danger"` |
|
|
113
|
+
| `ContextMenu` | the same menu opened at a point in the viewport - for a right-click on a surface that is not a button; controlled, focus returns to where it was |
|
|
84
114
|
| `Tooltip` | help text on hover and keyboard focus, inverted (ink surface), portal |
|
|
85
115
|
| `Tabs` / `TabList` / `Tab` / `TabPanel` | controlled tabs with an ink underline and arrow-key control |
|
|
86
116
|
| `Skeleton` | a loading placeholder (bar or circle) with a discreet pulse |
|
|
@@ -94,7 +124,7 @@ The table and the alarm list are not part of this package. They live in
|
|
|
94
124
|
| `Badge` | a status label with a dot, five tones; slightly rounded by default, `pill` for counters |
|
|
95
125
|
| `NumberInput` | numeric input in the notation the formats seam provides, today German (comma, thousands dots on leaving the field), `decimals` (0 = whole numbers), `min`/`max`, arrow keys with Shift ×10, an integrated spinner column at the right inner edge, `prefix`/`suffix` adornments (€, %) |
|
|
96
126
|
| `Meter` | a narrow fill bar (0–1) with a mono percentage label, five tones – for utilisation in cells; `label` names what is being measured |
|
|
97
|
-
| `UmrissProvider` | one place to set things:
|
|
127
|
+
| `UmrissProvider` | one place to set things: density, portal target, toasts, language. **Optional** – without it everything behaves as it does unconfigured. It holds no theme (light and dark are the application's `color-scheme`) and writes nothing onto the document |
|
|
98
128
|
| `LanguageProvider` / `useFormats` / `useWording` | formatting and wording as an overridable seam; the wording is a directory of entries, not a translation call. English is the default, German ships as `@umriss-ui/core/wording/de` |
|
|
99
129
|
| `Dock` | a tool strip over *one* surface: four named resting places at the edges of the host, moved by the grip (dragging snaps, the four arrow keys are the four places), orientation follows the edge; translucent material like the palette; a place without room refuses visibly; `mode` marks at most one tool and belongs to the caller |
|
|
100
130
|
| `DateRangePicker` | a period in two clicks across two chained months: backwards is allowed (the ends swap silently), a preview band on hovering, quick choices from the wording |
|
|
@@ -126,7 +156,9 @@ The table and the alarm list are not part of this package. They live in
|
|
|
126
156
|
3. Keyboard operation and `aria` attributes are part of the definition of done.
|
|
127
157
|
4. No business logic: a mapping such as "status X is green" is the application's
|
|
128
158
|
to make.
|
|
129
|
-
5. Tokens only, no raw values. A new value is created as a token first.
|
|
159
|
+
5. Tokens only, no raw values. A new value is created as a token first. No
|
|
160
|
+
selector reaches beyond the component's own elements, and every rule lies in
|
|
161
|
+
a layer (ADR-0021; the guards in `tests-unit/stylesheets.test.ts` hold it).
|
|
130
162
|
6. Everything is English – identifiers, props and prose (ADR-0018, which
|
|
131
163
|
reversed ADR-0015). What still stands from ADR-0015 is the spelling of the
|
|
132
164
|
accessible name: it is `aria-label` where it names the root element, and
|