@mildastudio/milda 0.1.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/LICENSE +21 -0
- package/README.md +45 -0
- package/dist/index.d.mts +724 -0
- package/dist/index.d.ts +724 -0
- package/dist/index.js +3094 -0
- package/dist/index.mjs +3053 -0
- package/package.json +34 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Péter Viola
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# milda
|
|
2
|
+
|
|
3
|
+
The **Milda language** — a platform-neutral design language for describing design
|
|
4
|
+
systems and their components, and the canonical AST that tools exchange.
|
|
5
|
+
|
|
6
|
+
Milda separates *what a component is* (its contract, anatomy, behavior, and
|
|
7
|
+
styling intent) from *how any one platform realizes it*. A description written
|
|
8
|
+
once can be generated into React, CSS, Figma variables, and — by design — other
|
|
9
|
+
targets, without the description itself leaking platform assumptions.
|
|
10
|
+
|
|
11
|
+
## What's in here
|
|
12
|
+
|
|
13
|
+
- **AST** (`types/ast.ts`) — the canonical interchange artifact. The spec in
|
|
14
|
+
`docs/dsl/PRELUDE.md` is the normative source of truth; this package is one
|
|
15
|
+
implementation of it.
|
|
16
|
+
- **Tokens** (`types/tokens.ts`) — layered, context-aware token values
|
|
17
|
+
(color, dimension, shadow, typography, …) with alias chains and an explicit
|
|
18
|
+
`escape` leaf for values a target can't express natively.
|
|
19
|
+
- **Facets, layout, states, capabilities** (`types/facets.ts`) — the
|
|
20
|
+
platform-neutral styling and layout vocabulary.
|
|
21
|
+
- **Prelude** (`prelude/preludeV0.ts`) — the standard library expressed as
|
|
22
|
+
data: behavior *atoms*, *archetypes*, facets, states, and capabilities.
|
|
23
|
+
- **Engine** (`engine/*`) — pure, side-effect-free semantics over the AST:
|
|
24
|
+
`resolveToken`, `resolveFacets`/`resolveLayout`, `validate`, and `conformance`
|
|
25
|
+
(which reports where a description has holes for a given target).
|
|
26
|
+
|
|
27
|
+
## Design invariants
|
|
28
|
+
|
|
29
|
+
- **Platform-neutral by construction.** Facet and token resolution is a pure
|
|
30
|
+
structural merge; nothing here encodes CSS pseudo-classes, DOM tags, or any
|
|
31
|
+
single platform's model. Target-specific lowering lives in the generators, not
|
|
32
|
+
in the language.
|
|
33
|
+
- **Honest escape hatches.** Where a value or capability can't be expressed
|
|
34
|
+
cleanly, the model carries an explicit `escape` leaf rather than silently
|
|
35
|
+
approximating — so `conformance` can tell you exactly what won't survive a
|
|
36
|
+
given target.
|
|
37
|
+
|
|
38
|
+
## Status
|
|
39
|
+
|
|
40
|
+
`0.x` — the language and AST are still evolving; treat the shape as unstable
|
|
41
|
+
until `1.0`.
|
|
42
|
+
|
|
43
|
+
## License
|
|
44
|
+
|
|
45
|
+
MIT
|