@mlola-ui/engine 1.0.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 +51 -0
- package/build.mjs +123 -0
- package/generated/agents.md +369 -0
- package/generated/assets.json +729 -0
- package/generated/contract.json +1234 -0
- package/generated/foundations.css +154 -0
- package/generated/manifest.json +5 -0
- package/generated/materials.css +55 -0
- package/generated/mlola.css +10 -0
- package/generated/motion.css +93 -0
- package/generated/recipes.css +6504 -0
- package/generated/theme-spec.schema.json +199 -0
- package/generated/theme.css +1 -0
- package/generated/themes.json +258 -0
- package/generated/tokens.css +812 -0
- package/generated/tokens.json +4751 -0
- package/package.json +56 -0
- package/src/behavior-spec.mjs +291 -0
- package/src/color.mjs +150 -0
- package/src/config.mjs +170 -0
- package/src/contract.mjs +103 -0
- package/src/contrast.mjs +68 -0
- package/src/declarations.mjs +131 -0
- package/src/deprecations.mjs +29 -0
- package/src/library-recipes.mjs +105 -0
- package/src/palette.mjs +286 -0
- package/src/render.mjs +190 -0
- package/src/spec.mjs +318 -0
- package/src/spring.mjs +46 -0
- package/src/theme-css.mjs +69 -0
- package/src/theme-distance.mjs +107 -0
- package/src/theme.mjs +97 -0
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://ui.mlola.com/schema/theme-spec.json",
|
|
4
|
+
"title": "Mlola theme spec",
|
|
5
|
+
"description": "A theme as a few decisions. The engine derives every token and solves contrast in both modes.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"$schema": {
|
|
9
|
+
"type": "string"
|
|
10
|
+
},
|
|
11
|
+
"studio": {
|
|
12
|
+
"type": "object",
|
|
13
|
+
"description": "Where a theme pulled from the Theme Studio came from. Informational; the engine ignores it.",
|
|
14
|
+
"properties": {
|
|
15
|
+
"id": {
|
|
16
|
+
"type": "string"
|
|
17
|
+
},
|
|
18
|
+
"version": {
|
|
19
|
+
"type": "integer",
|
|
20
|
+
"minimum": 1
|
|
21
|
+
},
|
|
22
|
+
"source": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"format": "uri"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"specVersion": {
|
|
29
|
+
"const": 1
|
|
30
|
+
},
|
|
31
|
+
"id": {
|
|
32
|
+
"type": "string",
|
|
33
|
+
"pattern": "^[a-z][a-z0-9-]{0,47}$",
|
|
34
|
+
"description": "Used as data-theme=\"<id>\"."
|
|
35
|
+
},
|
|
36
|
+
"label": {
|
|
37
|
+
"type": "string",
|
|
38
|
+
"maxLength": 80
|
|
39
|
+
},
|
|
40
|
+
"vector": {
|
|
41
|
+
"type": "object",
|
|
42
|
+
"description": "Eight expression channels from 0 to 1.",
|
|
43
|
+
"properties": {
|
|
44
|
+
"type": {
|
|
45
|
+
"type": "number",
|
|
46
|
+
"minimum": 0,
|
|
47
|
+
"maximum": 1,
|
|
48
|
+
"description": "utilitarian (0) to editorial (1)"
|
|
49
|
+
},
|
|
50
|
+
"geometry": {
|
|
51
|
+
"type": "number",
|
|
52
|
+
"minimum": 0,
|
|
53
|
+
"maximum": 1,
|
|
54
|
+
"description": "rectilinear (0) to organic (1)"
|
|
55
|
+
},
|
|
56
|
+
"density": {
|
|
57
|
+
"type": "number",
|
|
58
|
+
"minimum": 0,
|
|
59
|
+
"maximum": 1,
|
|
60
|
+
"description": "compact (0) to spacious (1)"
|
|
61
|
+
},
|
|
62
|
+
"depth": {
|
|
63
|
+
"type": "number",
|
|
64
|
+
"minimum": 0,
|
|
65
|
+
"maximum": 1,
|
|
66
|
+
"description": "flat (0) to layered (1)"
|
|
67
|
+
},
|
|
68
|
+
"motion": {
|
|
69
|
+
"type": "number",
|
|
70
|
+
"minimum": 0,
|
|
71
|
+
"maximum": 1,
|
|
72
|
+
"description": "still (0) to kinetic (1)"
|
|
73
|
+
},
|
|
74
|
+
"texture": {
|
|
75
|
+
"type": "number",
|
|
76
|
+
"minimum": 0,
|
|
77
|
+
"maximum": 1,
|
|
78
|
+
"description": "polished (0) to tactile (1)"
|
|
79
|
+
},
|
|
80
|
+
"rhythm": {
|
|
81
|
+
"type": "number",
|
|
82
|
+
"minimum": 0,
|
|
83
|
+
"maximum": 1,
|
|
84
|
+
"description": "regular (0) to syncopated (1)"
|
|
85
|
+
},
|
|
86
|
+
"icon": {
|
|
87
|
+
"type": "number",
|
|
88
|
+
"minimum": 0,
|
|
89
|
+
"maximum": 1,
|
|
90
|
+
"description": "systematic (0) to expressive (1)"
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
"color": {
|
|
95
|
+
"type": "object",
|
|
96
|
+
"properties": {
|
|
97
|
+
"primary": {
|
|
98
|
+
"type": "string",
|
|
99
|
+
"description": "Seed for the primary colour, oklch() or hex. Lightness is adjusted to meet contrast."
|
|
100
|
+
},
|
|
101
|
+
"primaryDark": {
|
|
102
|
+
"type": [
|
|
103
|
+
"string",
|
|
104
|
+
"null"
|
|
105
|
+
],
|
|
106
|
+
"description": "Optional different seed for dark mode."
|
|
107
|
+
},
|
|
108
|
+
"neutral": {
|
|
109
|
+
"type": "object",
|
|
110
|
+
"properties": {
|
|
111
|
+
"hue": {
|
|
112
|
+
"type": "number",
|
|
113
|
+
"minimum": 0,
|
|
114
|
+
"maximum": 360
|
|
115
|
+
},
|
|
116
|
+
"chroma": {
|
|
117
|
+
"type": "number",
|
|
118
|
+
"minimum": 0,
|
|
119
|
+
"maximum": 0.06
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
"required": [
|
|
123
|
+
"hue",
|
|
124
|
+
"chroma"
|
|
125
|
+
],
|
|
126
|
+
"description": "Tint of the page and surfaces."
|
|
127
|
+
},
|
|
128
|
+
"ink": {
|
|
129
|
+
"anyOf": [
|
|
130
|
+
{
|
|
131
|
+
"type": "object",
|
|
132
|
+
"properties": {
|
|
133
|
+
"hue": {
|
|
134
|
+
"type": "number",
|
|
135
|
+
"minimum": 0,
|
|
136
|
+
"maximum": 360
|
|
137
|
+
},
|
|
138
|
+
"chroma": {
|
|
139
|
+
"type": "number",
|
|
140
|
+
"minimum": 0,
|
|
141
|
+
"maximum": 0.06
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
"required": [
|
|
145
|
+
"hue",
|
|
146
|
+
"chroma"
|
|
147
|
+
]
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"type": "null"
|
|
151
|
+
}
|
|
152
|
+
],
|
|
153
|
+
"description": "Tint of text and dark-mode surfaces. Defaults to neutral."
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
"required": [
|
|
157
|
+
"primary"
|
|
158
|
+
]
|
|
159
|
+
},
|
|
160
|
+
"material": {
|
|
161
|
+
"enum": [
|
|
162
|
+
"solid",
|
|
163
|
+
"glass",
|
|
164
|
+
"paper",
|
|
165
|
+
"anodized"
|
|
166
|
+
]
|
|
167
|
+
},
|
|
168
|
+
"fonts": {
|
|
169
|
+
"anyOf": [
|
|
170
|
+
{
|
|
171
|
+
"enum": [
|
|
172
|
+
"neutral",
|
|
173
|
+
"editorial",
|
|
174
|
+
"technical",
|
|
175
|
+
"humanist",
|
|
176
|
+
"geometric"
|
|
177
|
+
]
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"type": "object",
|
|
181
|
+
"properties": {
|
|
182
|
+
"sans": {
|
|
183
|
+
"type": "string"
|
|
184
|
+
},
|
|
185
|
+
"display": {
|
|
186
|
+
"type": "string"
|
|
187
|
+
},
|
|
188
|
+
"mono": {
|
|
189
|
+
"type": "string"
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
]
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
"required": [
|
|
197
|
+
"id"
|
|
198
|
+
]
|
|
199
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/* No mlola.theme.json in this project. */
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"description": "Themes compiled into this build. A project theme from mlola.theme.json appears here alongside the canonical ones.",
|
|
4
|
+
"themes": [
|
|
5
|
+
{
|
|
6
|
+
"id": "graphite",
|
|
7
|
+
"label": "Graphite",
|
|
8
|
+
"name": "Graphite",
|
|
9
|
+
"swatch": "oklch(0.21 0.006 286)",
|
|
10
|
+
"material": "solid",
|
|
11
|
+
"theme": {
|
|
12
|
+
"type": 0.34,
|
|
13
|
+
"geometry": 0.4,
|
|
14
|
+
"density": 0.44,
|
|
15
|
+
"depth": 0.36,
|
|
16
|
+
"motion": 0.36,
|
|
17
|
+
"texture": 0,
|
|
18
|
+
"rhythm": 0.32,
|
|
19
|
+
"icon": 0.36
|
|
20
|
+
},
|
|
21
|
+
"spec": {
|
|
22
|
+
"specVersion": 1,
|
|
23
|
+
"id": "graphite",
|
|
24
|
+
"label": "Graphite",
|
|
25
|
+
"vector": {
|
|
26
|
+
"type": 0.34,
|
|
27
|
+
"geometry": 0.4,
|
|
28
|
+
"density": 0.44,
|
|
29
|
+
"depth": 0.36,
|
|
30
|
+
"motion": 0.36,
|
|
31
|
+
"texture": 0,
|
|
32
|
+
"rhythm": 0.32,
|
|
33
|
+
"icon": 0.36
|
|
34
|
+
},
|
|
35
|
+
"color": {
|
|
36
|
+
"primary": "oklch(0.21 0.006 286)",
|
|
37
|
+
"primaryDark": null,
|
|
38
|
+
"neutral": {
|
|
39
|
+
"hue": 286,
|
|
40
|
+
"chroma": 0.004
|
|
41
|
+
},
|
|
42
|
+
"ink": null
|
|
43
|
+
},
|
|
44
|
+
"material": "solid",
|
|
45
|
+
"fonts": "neutral"
|
|
46
|
+
},
|
|
47
|
+
"genre": "Product & AI",
|
|
48
|
+
"flavor": "Neutral graphite, crisp hairlines, and ink that stays out of the way.",
|
|
49
|
+
"bone": "Tight corners",
|
|
50
|
+
"typography": "Neutral sans throughout",
|
|
51
|
+
"origin": "canonical"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"id": "atelier",
|
|
55
|
+
"label": "Atelier Umami",
|
|
56
|
+
"name": "Atelier Umami",
|
|
57
|
+
"swatch": "oklch(0.638 0.153 58)",
|
|
58
|
+
"material": "paper",
|
|
59
|
+
"theme": {
|
|
60
|
+
"type": 0.82,
|
|
61
|
+
"geometry": 0.68,
|
|
62
|
+
"density": 0.58,
|
|
63
|
+
"depth": 0.62,
|
|
64
|
+
"motion": 0.48,
|
|
65
|
+
"texture": 0.78,
|
|
66
|
+
"rhythm": 0.7,
|
|
67
|
+
"icon": 0.82
|
|
68
|
+
},
|
|
69
|
+
"spec": {
|
|
70
|
+
"specVersion": 1,
|
|
71
|
+
"id": "atelier",
|
|
72
|
+
"label": "Atelier Umami",
|
|
73
|
+
"vector": {
|
|
74
|
+
"type": 0.82,
|
|
75
|
+
"geometry": 0.68,
|
|
76
|
+
"density": 0.58,
|
|
77
|
+
"depth": 0.62,
|
|
78
|
+
"motion": 0.48,
|
|
79
|
+
"texture": 0.78,
|
|
80
|
+
"rhythm": 0.7,
|
|
81
|
+
"icon": 0.82
|
|
82
|
+
},
|
|
83
|
+
"color": {
|
|
84
|
+
"primary": "oklch(0.55 0.16 58)",
|
|
85
|
+
"primaryDark": "oklch(0.75 0.16 68)",
|
|
86
|
+
"neutral": {
|
|
87
|
+
"hue": 80,
|
|
88
|
+
"chroma": 0.016
|
|
89
|
+
},
|
|
90
|
+
"ink": {
|
|
91
|
+
"hue": 260,
|
|
92
|
+
"chroma": 0.018
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
"material": "paper",
|
|
96
|
+
"fonts": "editorial"
|
|
97
|
+
},
|
|
98
|
+
"genre": "Editorial & Craft",
|
|
99
|
+
"flavor": "Warm cotton paper, artisanal ink, and an amber signal.",
|
|
100
|
+
"bone": "Soft corners",
|
|
101
|
+
"typography": "Serif display + sans body",
|
|
102
|
+
"origin": "canonical"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"id": "machined",
|
|
106
|
+
"label": "Machined Titanium",
|
|
107
|
+
"name": "Machined Titanium",
|
|
108
|
+
"swatch": "oklch(0.22 0.01 240)",
|
|
109
|
+
"material": "anodized",
|
|
110
|
+
"theme": {
|
|
111
|
+
"type": 0.22,
|
|
112
|
+
"geometry": 0.05,
|
|
113
|
+
"density": 0.3,
|
|
114
|
+
"depth": 0.34,
|
|
115
|
+
"motion": 0.22,
|
|
116
|
+
"texture": 0.18,
|
|
117
|
+
"rhythm": 0.24,
|
|
118
|
+
"icon": 0.3
|
|
119
|
+
},
|
|
120
|
+
"spec": {
|
|
121
|
+
"specVersion": 1,
|
|
122
|
+
"id": "machined",
|
|
123
|
+
"label": "Machined Titanium",
|
|
124
|
+
"vector": {
|
|
125
|
+
"type": 0.22,
|
|
126
|
+
"geometry": 0.05,
|
|
127
|
+
"density": 0.3,
|
|
128
|
+
"depth": 0.34,
|
|
129
|
+
"motion": 0.22,
|
|
130
|
+
"texture": 0.18,
|
|
131
|
+
"rhythm": 0.24,
|
|
132
|
+
"icon": 0.3
|
|
133
|
+
},
|
|
134
|
+
"color": {
|
|
135
|
+
"primary": "oklch(0.22 0.01 240)",
|
|
136
|
+
"primaryDark": "oklch(0.78 0.15 210)",
|
|
137
|
+
"neutral": {
|
|
138
|
+
"hue": 240,
|
|
139
|
+
"chroma": 0.004
|
|
140
|
+
},
|
|
141
|
+
"ink": {
|
|
142
|
+
"hue": 240,
|
|
143
|
+
"chroma": 0.01
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
"material": "anodized",
|
|
147
|
+
"fonts": "technical"
|
|
148
|
+
},
|
|
149
|
+
"genre": "Industrial & Telemetry",
|
|
150
|
+
"flavor": "Aerospace telemetry, compact precision, and high contrast.",
|
|
151
|
+
"bone": "Hard corners",
|
|
152
|
+
"typography": "Monospace throughout",
|
|
153
|
+
"origin": "canonical"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"id": "aerogel",
|
|
157
|
+
"label": "Aerogel Glass",
|
|
158
|
+
"name": "Aerogel Glass",
|
|
159
|
+
"swatch": "oklch(0.548 0.24 285)",
|
|
160
|
+
"material": "glass",
|
|
161
|
+
"theme": {
|
|
162
|
+
"type": 0.54,
|
|
163
|
+
"geometry": 0.92,
|
|
164
|
+
"density": 0.76,
|
|
165
|
+
"depth": 0.94,
|
|
166
|
+
"motion": 0.82,
|
|
167
|
+
"texture": 0.38,
|
|
168
|
+
"rhythm": 0.76,
|
|
169
|
+
"icon": 0.68
|
|
170
|
+
},
|
|
171
|
+
"spec": {
|
|
172
|
+
"specVersion": 1,
|
|
173
|
+
"id": "aerogel",
|
|
174
|
+
"label": "Aerogel Glass",
|
|
175
|
+
"vector": {
|
|
176
|
+
"type": 0.54,
|
|
177
|
+
"geometry": 0.92,
|
|
178
|
+
"density": 0.76,
|
|
179
|
+
"depth": 0.94,
|
|
180
|
+
"motion": 0.82,
|
|
181
|
+
"texture": 0.38,
|
|
182
|
+
"rhythm": 0.76,
|
|
183
|
+
"icon": 0.68
|
|
184
|
+
},
|
|
185
|
+
"color": {
|
|
186
|
+
"primary": "oklch(0.55 0.24 285)",
|
|
187
|
+
"primaryDark": "oklch(0.75 0.2 285)",
|
|
188
|
+
"neutral": {
|
|
189
|
+
"hue": 260,
|
|
190
|
+
"chroma": 0.018
|
|
191
|
+
},
|
|
192
|
+
"ink": {
|
|
193
|
+
"hue": 270,
|
|
194
|
+
"chroma": 0.028
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
"material": "glass",
|
|
198
|
+
"fonts": "neutral"
|
|
199
|
+
},
|
|
200
|
+
"genre": "Liquid AI & Optics",
|
|
201
|
+
"flavor": "Optical luminescence, liquid refraction, and specular depth.",
|
|
202
|
+
"bone": "Fluid radius",
|
|
203
|
+
"typography": "Airy sans",
|
|
204
|
+
"origin": "canonical"
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
"id": "nordic",
|
|
208
|
+
"label": "Nordic Earth",
|
|
209
|
+
"name": "Nordic Earth",
|
|
210
|
+
"swatch": "oklch(0.5 0.138 150)",
|
|
211
|
+
"material": "solid",
|
|
212
|
+
"theme": {
|
|
213
|
+
"type": 0.62,
|
|
214
|
+
"geometry": 0.74,
|
|
215
|
+
"density": 0.66,
|
|
216
|
+
"depth": 0.46,
|
|
217
|
+
"motion": 0.34,
|
|
218
|
+
"texture": 0.86,
|
|
219
|
+
"rhythm": 0.62,
|
|
220
|
+
"icon": 0.54
|
|
221
|
+
},
|
|
222
|
+
"spec": {
|
|
223
|
+
"specVersion": 1,
|
|
224
|
+
"id": "nordic",
|
|
225
|
+
"label": "Nordic Earth",
|
|
226
|
+
"vector": {
|
|
227
|
+
"type": 0.62,
|
|
228
|
+
"geometry": 0.74,
|
|
229
|
+
"density": 0.66,
|
|
230
|
+
"depth": 0.46,
|
|
231
|
+
"motion": 0.34,
|
|
232
|
+
"texture": 0.86,
|
|
233
|
+
"rhythm": 0.62,
|
|
234
|
+
"icon": 0.54
|
|
235
|
+
},
|
|
236
|
+
"color": {
|
|
237
|
+
"primary": "oklch(0.5 0.14 150)",
|
|
238
|
+
"primaryDark": "oklch(0.72 0.15 150)",
|
|
239
|
+
"neutral": {
|
|
240
|
+
"hue": 135,
|
|
241
|
+
"chroma": 0.018
|
|
242
|
+
},
|
|
243
|
+
"ink": {
|
|
244
|
+
"hue": 145,
|
|
245
|
+
"chroma": 0.024
|
|
246
|
+
}
|
|
247
|
+
},
|
|
248
|
+
"material": "solid",
|
|
249
|
+
"fonts": "neutral"
|
|
250
|
+
},
|
|
251
|
+
"genre": "Organic & Minimal",
|
|
252
|
+
"flavor": "Forest moss, fjord stone, terracotta, and organic calm.",
|
|
253
|
+
"bone": "Organic radius",
|
|
254
|
+
"typography": "Even sans rhythm",
|
|
255
|
+
"origin": "canonical"
|
|
256
|
+
}
|
|
257
|
+
]
|
|
258
|
+
}
|