@umriss-ui/core 0.1.0 → 0.2.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 +38 -0
- package/README.md +49 -18
- package/dist/core.css +1 -1
- package/dist/core.js +1737 -1768
- package/dist/index.d.ts +5 -17
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -50,6 +50,44 @@ module on the caller's side that carries `"use client"` and imports from there.
|
|
|
50
50
|
|
|
51
51
|
---
|
|
52
52
|
|
|
53
|
+
## 0.2.0 – Styles that load themselves, and touch nothing else (Sep. 2026)
|
|
54
|
+
|
|
55
|
+
Delivery report for `.scratch/styles-without-side-effects/spec.md` (ADR-0021).
|
|
56
|
+
The second version on the registry. The middle digit rises because `theme`
|
|
57
|
+
leaves `UmrissProvider` and the base layer leaves the stylesheet - read
|
|
58
|
+
**Changed** before upgrading from `0.1.0`.
|
|
59
|
+
|
|
60
|
+
### Changed
|
|
61
|
+
|
|
62
|
+
- **No stylesheet import any more.** `dist/core.js` imports its own stylesheet;
|
|
63
|
+
`import { Button } from "@umriss-ui/core"` is the whole setup.
|
|
64
|
+
`@umriss-ui/core/styles.css` stays exported and is optional.
|
|
65
|
+
- **No base layer.** The rules on `html`, `body`, `*`, `:focus-visible`,
|
|
66
|
+
`::selection`, `input`/`textarea` and the page's scrollbars are gone. An
|
|
67
|
+
application that relied on them for its own page - margin, font, background,
|
|
68
|
+
box model, selection colour - sets them itself. Every component carries what it
|
|
69
|
+
needs: its text context, `box-sizing` and squircle corners on its own elements
|
|
70
|
+
and their `::before`/`::after`, a focus ring on every element it puts into the
|
|
71
|
+
tab order (the calendar's days and month arrows, the range presets and the
|
|
72
|
+
close buttons of `Modal` and `Toast` included), caret, autofill look and
|
|
73
|
+
scrollbars on its own fields and scroll containers.
|
|
74
|
+
- **Cascade layers.** Every rule lies in `umriss.tokens`, `umriss.base` or
|
|
75
|
+
`umriss.components`. CSS an application writes outside a layer wins over the
|
|
76
|
+
library whatever its specificity and loading order, and a token is overridden
|
|
77
|
+
with `:root { --u-… }`.
|
|
78
|
+
- **Light and dark are `color-scheme`.** Tokens with two values are
|
|
79
|
+
`light-dark(<light>, <dark>)`. `:root[data-theme="dark"]` is gone and
|
|
80
|
+
`color-scheme` is no longer set on `:root`: an application sets
|
|
81
|
+
`color-scheme` (most theme libraries already do), and one that sets nothing
|
|
82
|
+
stays light.
|
|
83
|
+
- **`UmrissProvider` has no `theme`** - the prop, `UmrissConfig.theme` and the
|
|
84
|
+
`Theme` type are removed - and it writes nothing onto the document any more,
|
|
85
|
+
including the `data-density` attribute no stylesheet read. `density` works as
|
|
86
|
+
before, through context.
|
|
87
|
+
- **Browsers:** Chrome 123, Firefox 120, Safari 17.5 or newer (`light-dark()`).
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
53
91
|
## 0.1.0 – First publication (Sep. 2026)
|
|
54
92
|
|
|
55
93
|
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
|
|
|
@@ -94,7 +123,7 @@ The table and the alarm list are not part of this package. They live in
|
|
|
94
123
|
| `Badge` | a status label with a dot, five tones; slightly rounded by default, `pill` for counters |
|
|
95
124
|
| `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
125
|
| `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:
|
|
126
|
+
| `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
127
|
| `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
128
|
| `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
129
|
| `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 +155,9 @@ The table and the alarm list are not part of this package. They live in
|
|
|
126
155
|
3. Keyboard operation and `aria` attributes are part of the definition of done.
|
|
127
156
|
4. No business logic: a mapping such as "status X is green" is the application's
|
|
128
157
|
to make.
|
|
129
|
-
5. Tokens only, no raw values. A new value is created as a token first.
|
|
158
|
+
5. Tokens only, no raw values. A new value is created as a token first. No
|
|
159
|
+
selector reaches beyond the component's own elements, and every rule lies in
|
|
160
|
+
a layer (ADR-0021; the guards in `tests-unit/stylesheets.test.ts` hold it).
|
|
130
161
|
6. Everything is English – identifiers, props and prose (ADR-0018, which
|
|
131
162
|
reversed ADR-0015). What still stands from ADR-0015 is the spelling of the
|
|
132
163
|
accessible name: it is `aria-label` where it names the root element, and
|