@uniflowed/stylex 0.0.0-alpha.14 → 0.0.0-alpha.15
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/index.js +26 -0
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -39,6 +39,32 @@
|
|
|
39
39
|
// configuration flag. The preset is reached by importing it, so a project that
|
|
40
40
|
// does not import it pays nothing, and one that imports half of it keeps half.
|
|
41
41
|
//
|
|
42
|
+
// # The half of a component catalogue that lives here
|
|
43
|
+
//
|
|
44
|
+
// "Not a component library" is a rule about what this package exports, and it
|
|
45
|
+
// was read for a while as a rule about what it is responsible for. It is not.
|
|
46
|
+
// About twenty of the catalogue `@uniflowed/ui` is measured against — Badge,
|
|
47
|
+
// Card, Button, Input, Textarea, Label, Aspect Ratio and the rest — have no
|
|
48
|
+
// behaviour at all: no role, no state machine, no keyboard map. A headless
|
|
49
|
+
// package cannot ship them, because with the styles taken out a `Badge` is a
|
|
50
|
+
// `<span>`. **They are this module's half of the split, and the answer is a
|
|
51
|
+
// style function rather than a component** (ubugeeei-prod/uf#298).
|
|
52
|
+
//
|
|
53
|
+
// `buttonStyles({ tone, size })`, `cardStyles()`, `textStyles({ size, tone })`
|
|
54
|
+
// and `fieldStyles()` are already that answer for four of them, and the shape
|
|
55
|
+
// is the point: a caller spreads `{ className }` onto their own `<button>`, so
|
|
56
|
+
// they keep `type="submit"`, `formAction`, the ref and every attribute a
|
|
57
|
+
// wrapper would have had to remember to forward. Nothing here appears in
|
|
58
|
+
// `@uniflowed/ui`'s types and nothing here renders an element — the rule holds
|
|
59
|
+
// exactly as written; what changed is that the gap is now assigned rather than
|
|
60
|
+
// left between the two packages.
|
|
61
|
+
//
|
|
62
|
+
// `crates/uf_lib/src/ui.rs` records the assignment component by component, and
|
|
63
|
+
// `cargo test -p uf_lib` holds it to this file in both directions: an entry
|
|
64
|
+
// there may not name a style `./preset.js` does not export, and a style
|
|
65
|
+
// exported here must be named by some entry. A `badgeStyles` is the way to
|
|
66
|
+
// close the Badge gap; a `<Badge>` in the other package is not.
|
|
67
|
+
//
|
|
42
68
|
// # Where the token values come from
|
|
43
69
|
//
|
|
44
70
|
// `@uniflowed/brand` owns uf's visual identity — the palette, the type,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniflowed/stylex",
|
|
3
|
-
"version": "0.0.0-alpha.
|
|
3
|
+
"version": "0.0.0-alpha.15",
|
|
4
4
|
"description": "Flow declarations for @uniflowed/stylex, part of the Unified Toolchain for Flow.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -21,6 +21,6 @@
|
|
|
21
21
|
"*.js"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@uniflowed/core": "0.0.0-alpha.
|
|
24
|
+
"@uniflowed/core": "0.0.0-alpha.15"
|
|
25
25
|
}
|
|
26
26
|
}
|