@novi-ui/raster 0.2.0 → 0.4.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.
@@ -1,4 +1,4 @@
1
- /* 自動生成。編集しないこと。src/tokens/raster-tokens.ts を変更して再生成する。 */
1
+ /* 自動生成。編集しないこと。src/tokens/raster-tokens.ts と color-set.ts を変更して再生成する。 */
2
2
 
3
3
  @layer novi.base {
4
4
  [data-novi-theme='raster'] {
@@ -23,6 +23,7 @@
23
23
  --novi-duration-slow: 120ms;
24
24
  --novi-ease-standard: cubic-bezier(0.2, 0, 0, 1);
25
25
  --novi-ease-emphasized: cubic-bezier(0.2, 0, 0, 1);
26
+ --novi-hue: 268;
26
27
  --novi-color-bg: oklch(99% 0 0);
27
28
  --novi-color-subtle: oklch(96% 0 0);
28
29
  --novi-color-fg: oklch(20% 0 0);
@@ -32,9 +33,9 @@
32
33
  --novi-color-overlay: oklch(20% 0 0 / 0.45);
33
34
  --novi-color-default: oklch(96% 0 0);
34
35
  --novi-color-default-fg: oklch(20% 0 0);
35
- --novi-color-primary: oklch(50% 0.19 265);
36
+ --novi-color-primary: oklch(44% 0.09 268);
36
37
  --novi-color-primary-fg: oklch(99% 0 0);
37
- --novi-color-secondary: oklch(48% 0.15 300);
38
+ --novi-color-secondary: oklch(44% 0.09 35);
38
39
  --novi-color-secondary-fg: oklch(99% 0 0);
39
40
  --novi-color-success: oklch(47% 0.13 155);
40
41
  --novi-color-success-fg: oklch(99% 0 0);
@@ -42,6 +43,22 @@
42
43
  --novi-color-warning-fg: oklch(99% 0 0);
43
44
  --novi-color-danger: oklch(50% 0.19 27);
44
45
  --novi-color-danger-fg: oklch(99% 0 0);
46
+ --novi-swatch-ink: oklch(44% 0.09 268);
47
+ --novi-swatch-ink-fg: oklch(99% 0 0);
48
+ --novi-swatch-prussian: oklch(44% 0.09 235);
49
+ --novi-swatch-prussian-fg: oklch(99% 0 0);
50
+ --novi-swatch-forest: oklch(44% 0.09 160);
51
+ --novi-swatch-forest-fg: oklch(99% 0 0);
52
+ --novi-swatch-olive: oklch(44% 0.09 125);
53
+ --novi-swatch-olive-fg: oklch(99% 0 0);
54
+ --novi-swatch-ochre: oklch(44% 0.09 70);
55
+ --novi-swatch-ochre-fg: oklch(99% 0 0);
56
+ --novi-swatch-brick: oklch(44% 0.09 35);
57
+ --novi-swatch-brick-fg: oklch(99% 0 0);
58
+ --novi-swatch-bordeaux: oklch(44% 0.09 12);
59
+ --novi-swatch-bordeaux-fg: oklch(99% 0 0);
60
+ --novi-swatch-graphite: oklch(44% 0.02 270);
61
+ --novi-swatch-graphite-fg: oklch(99% 0 0);
45
62
  }
46
63
 
47
64
  [data-novi-theme='raster'][data-novi-scheme='dark'] {
@@ -54,9 +71,9 @@
54
71
  --novi-color-overlay: oklch(10% 0 0 / 0.6);
55
72
  --novi-color-default: oklch(25% 0 0);
56
73
  --novi-color-default-fg: oklch(95% 0 0);
57
- --novi-color-primary: oklch(76% 0.13 265);
74
+ --novi-color-primary: oklch(74% 0.09 268);
58
75
  --novi-color-primary-fg: oklch(16% 0 0);
59
- --novi-color-secondary: oklch(76% 0.12 300);
76
+ --novi-color-secondary: oklch(74% 0.09 35);
60
77
  --novi-color-secondary-fg: oklch(16% 0 0);
61
78
  --novi-color-success: oklch(77% 0.13 155);
62
79
  --novi-color-success-fg: oklch(16% 0 0);
@@ -64,6 +81,22 @@
64
81
  --novi-color-warning-fg: oklch(16% 0 0);
65
82
  --novi-color-danger: oklch(73% 0.16 27);
66
83
  --novi-color-danger-fg: oklch(16% 0 0);
84
+ --novi-swatch-ink: oklch(74% 0.09 268);
85
+ --novi-swatch-ink-fg: oklch(16% 0 0);
86
+ --novi-swatch-prussian: oklch(74% 0.09 235);
87
+ --novi-swatch-prussian-fg: oklch(16% 0 0);
88
+ --novi-swatch-forest: oklch(74% 0.09 160);
89
+ --novi-swatch-forest-fg: oklch(16% 0 0);
90
+ --novi-swatch-olive: oklch(74% 0.09 125);
91
+ --novi-swatch-olive-fg: oklch(16% 0 0);
92
+ --novi-swatch-ochre: oklch(74% 0.09 70);
93
+ --novi-swatch-ochre-fg: oklch(16% 0 0);
94
+ --novi-swatch-brick: oklch(74% 0.09 35);
95
+ --novi-swatch-brick-fg: oklch(16% 0 0);
96
+ --novi-swatch-bordeaux: oklch(74% 0.09 12);
97
+ --novi-swatch-bordeaux-fg: oklch(16% 0 0);
98
+ --novi-swatch-graphite: oklch(74% 0.017 270);
99
+ --novi-swatch-graphite-fg: oklch(16% 0 0);
67
100
  }
68
101
 
69
102
  @media (prefers-color-scheme: dark) {
@@ -77,9 +110,9 @@
77
110
  --novi-color-overlay: oklch(10% 0 0 / 0.6);
78
111
  --novi-color-default: oklch(25% 0 0);
79
112
  --novi-color-default-fg: oklch(95% 0 0);
80
- --novi-color-primary: oklch(76% 0.13 265);
113
+ --novi-color-primary: oklch(74% 0.09 268);
81
114
  --novi-color-primary-fg: oklch(16% 0 0);
82
- --novi-color-secondary: oklch(76% 0.12 300);
115
+ --novi-color-secondary: oklch(74% 0.09 35);
83
116
  --novi-color-secondary-fg: oklch(16% 0 0);
84
117
  --novi-color-success: oklch(77% 0.13 155);
85
118
  --novi-color-success-fg: oklch(16% 0 0);
@@ -87,6 +120,203 @@
87
120
  --novi-color-warning-fg: oklch(16% 0 0);
88
121
  --novi-color-danger: oklch(73% 0.16 27);
89
122
  --novi-color-danger-fg: oklch(16% 0 0);
123
+ --novi-swatch-ink: oklch(74% 0.09 268);
124
+ --novi-swatch-ink-fg: oklch(16% 0 0);
125
+ --novi-swatch-prussian: oklch(74% 0.09 235);
126
+ --novi-swatch-prussian-fg: oklch(16% 0 0);
127
+ --novi-swatch-forest: oklch(74% 0.09 160);
128
+ --novi-swatch-forest-fg: oklch(16% 0 0);
129
+ --novi-swatch-olive: oklch(74% 0.09 125);
130
+ --novi-swatch-olive-fg: oklch(16% 0 0);
131
+ --novi-swatch-ochre: oklch(74% 0.09 70);
132
+ --novi-swatch-ochre-fg: oklch(16% 0 0);
133
+ --novi-swatch-brick: oklch(74% 0.09 35);
134
+ --novi-swatch-brick-fg: oklch(16% 0 0);
135
+ --novi-swatch-bordeaux: oklch(74% 0.09 12);
136
+ --novi-swatch-bordeaux-fg: oklch(16% 0 0);
137
+ --novi-swatch-graphite: oklch(74% 0.017 270);
138
+ --novi-swatch-graphite-fg: oklch(16% 0 0);
139
+ }
140
+ }
141
+
142
+ /* ── カラーセット Print Inks(specs/06-tones-and-colors) ──
143
+ data-novi-color は data-novi-theme と同じ要素(テーマルート)に置く。
144
+ 未知の色名はどれにも一致せず、既定色 Ink のまま描画される。 */
145
+ [data-novi-theme='raster'][data-novi-color='ink'] {
146
+ --novi-hue: 268;
147
+ --novi-color-primary: oklch(44% 0.09 268);
148
+ --novi-color-primary-fg: oklch(99% 0 0);
149
+ --novi-color-secondary: oklch(44% 0.09 35);
150
+ --novi-color-secondary-fg: oklch(99% 0 0);
151
+ }
152
+
153
+ [data-novi-theme='raster'][data-novi-color='prussian'] {
154
+ --novi-hue: 235;
155
+ --novi-color-primary: oklch(44% 0.09 235);
156
+ --novi-color-primary-fg: oklch(99% 0 0);
157
+ --novi-color-secondary: oklch(44% 0.09 70);
158
+ --novi-color-secondary-fg: oklch(99% 0 0);
159
+ }
160
+
161
+ [data-novi-theme='raster'][data-novi-color='forest'] {
162
+ --novi-hue: 160;
163
+ --novi-color-primary: oklch(44% 0.09 160);
164
+ --novi-color-primary-fg: oklch(99% 0 0);
165
+ --novi-color-secondary: oklch(44% 0.09 70);
166
+ --novi-color-secondary-fg: oklch(99% 0 0);
167
+ }
168
+
169
+ [data-novi-theme='raster'][data-novi-color='olive'] {
170
+ --novi-hue: 125;
171
+ --novi-color-primary: oklch(44% 0.09 125);
172
+ --novi-color-primary-fg: oklch(99% 0 0);
173
+ --novi-color-secondary: oklch(44% 0.09 268);
174
+ --novi-color-secondary-fg: oklch(99% 0 0);
175
+ }
176
+
177
+ [data-novi-theme='raster'][data-novi-color='ochre'] {
178
+ --novi-hue: 70;
179
+ --novi-color-primary: oklch(44% 0.09 70);
180
+ --novi-color-primary-fg: oklch(99% 0 0);
181
+ --novi-color-secondary: oklch(44% 0.09 235);
182
+ --novi-color-secondary-fg: oklch(99% 0 0);
183
+ }
184
+
185
+ [data-novi-theme='raster'][data-novi-color='brick'] {
186
+ --novi-hue: 35;
187
+ --novi-color-primary: oklch(44% 0.09 35);
188
+ --novi-color-primary-fg: oklch(99% 0 0);
189
+ --novi-color-secondary: oklch(44% 0.09 268);
190
+ --novi-color-secondary-fg: oklch(99% 0 0);
191
+ }
192
+
193
+ [data-novi-theme='raster'][data-novi-color='bordeaux'] {
194
+ --novi-hue: 12;
195
+ --novi-color-primary: oklch(44% 0.09 12);
196
+ --novi-color-primary-fg: oklch(99% 0 0);
197
+ --novi-color-secondary: oklch(44% 0.09 70);
198
+ --novi-color-secondary-fg: oklch(99% 0 0);
199
+ }
200
+
201
+ [data-novi-theme='raster'][data-novi-color='graphite'] {
202
+ --novi-hue: 270;
203
+ --novi-color-primary: oklch(44% 0.02 270);
204
+ --novi-color-primary-fg: oklch(99% 0 0);
205
+ --novi-color-secondary: oklch(44% 0.09 35);
206
+ --novi-color-secondary-fg: oklch(99% 0 0);
207
+ }
208
+
209
+ [data-novi-theme='raster'][data-novi-scheme='dark'][data-novi-color='ink'] {
210
+ --novi-color-primary: oklch(74% 0.09 268);
211
+ --novi-color-primary-fg: oklch(16% 0 0);
212
+ --novi-color-secondary: oklch(74% 0.09 35);
213
+ --novi-color-secondary-fg: oklch(16% 0 0);
214
+ }
215
+
216
+ [data-novi-theme='raster'][data-novi-scheme='dark'][data-novi-color='prussian'] {
217
+ --novi-color-primary: oklch(74% 0.09 235);
218
+ --novi-color-primary-fg: oklch(16% 0 0);
219
+ --novi-color-secondary: oklch(74% 0.09 70);
220
+ --novi-color-secondary-fg: oklch(16% 0 0);
221
+ }
222
+
223
+ [data-novi-theme='raster'][data-novi-scheme='dark'][data-novi-color='forest'] {
224
+ --novi-color-primary: oklch(74% 0.09 160);
225
+ --novi-color-primary-fg: oklch(16% 0 0);
226
+ --novi-color-secondary: oklch(74% 0.09 70);
227
+ --novi-color-secondary-fg: oklch(16% 0 0);
228
+ }
229
+
230
+ [data-novi-theme='raster'][data-novi-scheme='dark'][data-novi-color='olive'] {
231
+ --novi-color-primary: oklch(74% 0.09 125);
232
+ --novi-color-primary-fg: oklch(16% 0 0);
233
+ --novi-color-secondary: oklch(74% 0.09 268);
234
+ --novi-color-secondary-fg: oklch(16% 0 0);
235
+ }
236
+
237
+ [data-novi-theme='raster'][data-novi-scheme='dark'][data-novi-color='ochre'] {
238
+ --novi-color-primary: oklch(74% 0.09 70);
239
+ --novi-color-primary-fg: oklch(16% 0 0);
240
+ --novi-color-secondary: oklch(74% 0.09 235);
241
+ --novi-color-secondary-fg: oklch(16% 0 0);
242
+ }
243
+
244
+ [data-novi-theme='raster'][data-novi-scheme='dark'][data-novi-color='brick'] {
245
+ --novi-color-primary: oklch(74% 0.09 35);
246
+ --novi-color-primary-fg: oklch(16% 0 0);
247
+ --novi-color-secondary: oklch(74% 0.09 268);
248
+ --novi-color-secondary-fg: oklch(16% 0 0);
249
+ }
250
+
251
+ [data-novi-theme='raster'][data-novi-scheme='dark'][data-novi-color='bordeaux'] {
252
+ --novi-color-primary: oklch(74% 0.09 12);
253
+ --novi-color-primary-fg: oklch(16% 0 0);
254
+ --novi-color-secondary: oklch(74% 0.09 70);
255
+ --novi-color-secondary-fg: oklch(16% 0 0);
256
+ }
257
+
258
+ [data-novi-theme='raster'][data-novi-scheme='dark'][data-novi-color='graphite'] {
259
+ --novi-color-primary: oklch(74% 0.017 270);
260
+ --novi-color-primary-fg: oklch(16% 0 0);
261
+ --novi-color-secondary: oklch(74% 0.09 35);
262
+ --novi-color-secondary-fg: oklch(16% 0 0);
263
+ }
264
+
265
+ @media (prefers-color-scheme: dark) {
266
+ [data-novi-theme='raster']:not([data-novi-scheme='light'])[data-novi-color='ink'] {
267
+ --novi-color-primary: oklch(74% 0.09 268);
268
+ --novi-color-primary-fg: oklch(16% 0 0);
269
+ --novi-color-secondary: oklch(74% 0.09 35);
270
+ --novi-color-secondary-fg: oklch(16% 0 0);
271
+ }
272
+
273
+ [data-novi-theme='raster']:not([data-novi-scheme='light'])[data-novi-color='prussian'] {
274
+ --novi-color-primary: oklch(74% 0.09 235);
275
+ --novi-color-primary-fg: oklch(16% 0 0);
276
+ --novi-color-secondary: oklch(74% 0.09 70);
277
+ --novi-color-secondary-fg: oklch(16% 0 0);
278
+ }
279
+
280
+ [data-novi-theme='raster']:not([data-novi-scheme='light'])[data-novi-color='forest'] {
281
+ --novi-color-primary: oklch(74% 0.09 160);
282
+ --novi-color-primary-fg: oklch(16% 0 0);
283
+ --novi-color-secondary: oklch(74% 0.09 70);
284
+ --novi-color-secondary-fg: oklch(16% 0 0);
285
+ }
286
+
287
+ [data-novi-theme='raster']:not([data-novi-scheme='light'])[data-novi-color='olive'] {
288
+ --novi-color-primary: oklch(74% 0.09 125);
289
+ --novi-color-primary-fg: oklch(16% 0 0);
290
+ --novi-color-secondary: oklch(74% 0.09 268);
291
+ --novi-color-secondary-fg: oklch(16% 0 0);
292
+ }
293
+
294
+ [data-novi-theme='raster']:not([data-novi-scheme='light'])[data-novi-color='ochre'] {
295
+ --novi-color-primary: oklch(74% 0.09 70);
296
+ --novi-color-primary-fg: oklch(16% 0 0);
297
+ --novi-color-secondary: oklch(74% 0.09 235);
298
+ --novi-color-secondary-fg: oklch(16% 0 0);
299
+ }
300
+
301
+ [data-novi-theme='raster']:not([data-novi-scheme='light'])[data-novi-color='brick'] {
302
+ --novi-color-primary: oklch(74% 0.09 35);
303
+ --novi-color-primary-fg: oklch(16% 0 0);
304
+ --novi-color-secondary: oklch(74% 0.09 268);
305
+ --novi-color-secondary-fg: oklch(16% 0 0);
306
+ }
307
+
308
+ [data-novi-theme='raster']:not([data-novi-scheme='light'])[data-novi-color='bordeaux'] {
309
+ --novi-color-primary: oklch(74% 0.09 12);
310
+ --novi-color-primary-fg: oklch(16% 0 0);
311
+ --novi-color-secondary: oklch(74% 0.09 70);
312
+ --novi-color-secondary-fg: oklch(16% 0 0);
313
+ }
314
+
315
+ [data-novi-theme='raster']:not([data-novi-scheme='light'])[data-novi-color='graphite'] {
316
+ --novi-color-primary: oklch(74% 0.017 270);
317
+ --novi-color-primary-fg: oklch(16% 0 0);
318
+ --novi-color-secondary: oklch(74% 0.09 35);
319
+ --novi-color-secondary-fg: oklch(16% 0 0);
90
320
  }
91
321
  }
92
322
  }
@@ -17,7 +17,7 @@ declare const selectStyles: import("tailwind-variants").TVReturnType<{
17
17
  trigger: string;
18
18
  option: string;
19
19
  }>;
20
- radius: VariantMap<"sm" | "md" | "lg" | "none" | "full", {
20
+ radius: VariantMap<"none" | "sm" | "md" | "lg" | "full", {
21
21
  trigger: string;
22
22
  }>;
23
23
  }, {
@@ -39,7 +39,7 @@ declare const selectStyles: import("tailwind-variants").TVReturnType<{
39
39
  trigger: string;
40
40
  option: string;
41
41
  }>;
42
- radius: VariantMap<"sm" | "md" | "lg" | "none" | "full", {
42
+ radius: VariantMap<"none" | "sm" | "md" | "lg" | "full", {
43
43
  trigger: string;
44
44
  }>;
45
45
  }, {
@@ -61,7 +61,7 @@ declare const selectStyles: import("tailwind-variants").TVReturnType<{
61
61
  trigger: string;
62
62
  option: string;
63
63
  }>;
64
- radius: VariantMap<"sm" | "md" | "lg" | "none" | "full", {
64
+ radius: VariantMap<"none" | "sm" | "md" | "lg" | "full", {
65
65
  trigger: string;
66
66
  }>;
67
67
  }, {
@@ -7,19 +7,19 @@ import { VariantMap } from "@novi-ui/core";
7
7
  * const mySkeleton = tv({ extend: skeletonStyles, slots: { root: 'opacity-50' } })
8
8
  */
9
9
  declare const skeletonStyles: import("tailwind-variants").TVReturnType<{
10
- radius: VariantMap<"sm" | "md" | "lg" | "none" | "full", {
10
+ radius: VariantMap<"none" | "sm" | "md" | "lg" | "full", {
11
11
  root: string;
12
12
  }>;
13
13
  }, {
14
14
  root: string;
15
15
  }, undefined, {
16
- radius: VariantMap<"sm" | "md" | "lg" | "none" | "full", {
16
+ radius: VariantMap<"none" | "sm" | "md" | "lg" | "full", {
17
17
  root: string;
18
18
  }>;
19
19
  }, {
20
20
  root: string;
21
21
  }, import("tailwind-variants").TVReturnTypeLike<{
22
- radius: VariantMap<"sm" | "md" | "lg" | "none" | "full", {
22
+ radius: VariantMap<"none" | "sm" | "md" | "lg" | "full", {
23
23
  root: string;
24
24
  }>;
25
25
  }, {
@@ -20,7 +20,7 @@ declare const textareaStyles: import("tailwind-variants").TVReturnType<{
20
20
  inputWrapper: string;
21
21
  textarea: string;
22
22
  }>;
23
- radius: VariantMap<"sm" | "md" | "lg" | "none" | "full", {
23
+ radius: VariantMap<"none" | "sm" | "md" | "lg" | "full", {
24
24
  inputWrapper: string;
25
25
  }>;
26
26
  }, {
@@ -38,7 +38,7 @@ declare const textareaStyles: import("tailwind-variants").TVReturnType<{
38
38
  inputWrapper: string;
39
39
  textarea: string;
40
40
  }>;
41
- radius: VariantMap<"sm" | "md" | "lg" | "none" | "full", {
41
+ radius: VariantMap<"none" | "sm" | "md" | "lg" | "full", {
42
42
  inputWrapper: string;
43
43
  }>;
44
44
  }, {
@@ -56,7 +56,7 @@ declare const textareaStyles: import("tailwind-variants").TVReturnType<{
56
56
  inputWrapper: string;
57
57
  textarea: string;
58
58
  }>;
59
- radius: VariantMap<"sm" | "md" | "lg" | "none" | "full", {
59
+ radius: VariantMap<"none" | "sm" | "md" | "lg" | "full", {
60
60
  inputWrapper: string;
61
61
  }>;
62
62
  }, {
@@ -10,7 +10,7 @@ declare const toastStyles: import("tailwind-variants").TVReturnType<{
10
10
  color: VariantMap<"default" | "primary" | "secondary" | "success" | "warning" | "danger", {
11
11
  root: string;
12
12
  }>;
13
- radius: VariantMap<"sm" | "md" | "lg" | "none" | "full", {
13
+ radius: VariantMap<"none" | "sm" | "md" | "lg" | "full", {
14
14
  root: string;
15
15
  }>;
16
16
  }, {
@@ -26,7 +26,7 @@ declare const toastStyles: import("tailwind-variants").TVReturnType<{
26
26
  color: VariantMap<"default" | "primary" | "secondary" | "success" | "warning" | "danger", {
27
27
  root: string;
28
28
  }>;
29
- radius: VariantMap<"sm" | "md" | "lg" | "none" | "full", {
29
+ radius: VariantMap<"none" | "sm" | "md" | "lg" | "full", {
30
30
  root: string;
31
31
  }>;
32
32
  }, {
@@ -42,7 +42,7 @@ declare const toastStyles: import("tailwind-variants").TVReturnType<{
42
42
  color: VariantMap<"default" | "primary" | "secondary" | "success" | "warning" | "danger", {
43
43
  root: string;
44
44
  }>;
45
- radius: VariantMap<"sm" | "md" | "lg" | "none" | "full", {
45
+ radius: VariantMap<"none" | "sm" | "md" | "lg" | "full", {
46
46
  root: string;
47
47
  }>;
48
48
  }, {
@@ -0,0 +1,106 @@
1
+ //#region src/tokens/color-set.ts
2
+ /**
3
+ * Print Inks のトーン。
4
+ * light の C 0.090 は、このセットでの色域上限 0.095(律速 Ochre)の 0.005 内側。
5
+ */
6
+ const RASTER_TONE = {
7
+ light: {
8
+ l: 44,
9
+ c: .09
10
+ },
11
+ dark: {
12
+ l: 74,
13
+ c: .09
14
+ }
15
+ };
16
+ /**
17
+ * 8色。全色が顔料・インクの実名を持つ。
18
+ * 紫・青緑・ピンクは意図的に入れていない(Tactile のセット候補。入れない色で性格を作る)。
19
+ */
20
+ const COLOR_DEFS = [
21
+ {
22
+ id: "ink",
23
+ name: "Ink",
24
+ hue: 268,
25
+ pair: "brick",
26
+ description: "万年筆の藍黒。書き物の色。既定色"
27
+ },
28
+ {
29
+ id: "prussian",
30
+ name: "Prussian",
31
+ hue: 235,
32
+ pair: "ochre",
33
+ description: "紺青。18世紀からある合成顔料の名"
34
+ },
35
+ {
36
+ id: "forest",
37
+ name: "Forest",
38
+ hue: 160,
39
+ pair: "ochre",
40
+ description: "深い常緑。製図インクの緑"
41
+ },
42
+ {
43
+ id: "olive",
44
+ name: "Olive",
45
+ hue: 125,
46
+ pair: "ink",
47
+ description: "オリーブドラブ。土に近い緑"
48
+ },
49
+ {
50
+ id: "ochre",
51
+ name: "Ochre",
52
+ hue: 70,
53
+ pair: "prussian",
54
+ description: "黄土。最古の顔料のひとつ"
55
+ },
56
+ {
57
+ id: "brick",
58
+ name: "Brick",
59
+ hue: 35,
60
+ pair: "ink",
61
+ description: "煉瓦の朱。スイスポスターの赤の末裔"
62
+ },
63
+ {
64
+ id: "bordeaux",
65
+ name: "Bordeaux",
66
+ hue: 12,
67
+ pair: "ochre",
68
+ description: "ワインの澱の赤"
69
+ },
70
+ {
71
+ id: "graphite",
72
+ name: "Graphite",
73
+ hue: 270,
74
+ pair: "brick",
75
+ description: "黒鉛。色を消すという選択肢",
76
+ fixedC: .02,
77
+ fixedCDark: .017
78
+ }
79
+ ];
80
+ /** 文字色は地色と同じ値(bg light / bg dark)。面の上に地の色で書く、が Raster の約束。 */
81
+ const PRIMARY_FG_LIGHT = "oklch(99% 0 0)";
82
+ const PRIMARY_FG_DARK = "oklch(16% 0 0)";
83
+ const oklch = (l, c, hue) => `oklch(${l}% ${c} ${hue})`;
84
+ /**
85
+ * 定義(hue と例外 C)とトーンから、実際の CSS 値を組み立てる。
86
+ * テストが不正な色(域外の hue × C)を作って検査を確かめるのにも使う(AC-03-4)。
87
+ */
88
+ function buildColorEntry(def, tone = RASTER_TONE) {
89
+ return {
90
+ ...def,
91
+ light: {
92
+ primary: oklch(tone.light.l, def.fixedC ?? tone.light.c, def.hue),
93
+ primaryFg: PRIMARY_FG_LIGHT
94
+ },
95
+ dark: {
96
+ primary: oklch(tone.dark.l, def.fixedCDark ?? tone.dark.c, def.hue),
97
+ primaryFg: PRIMARY_FG_DARK
98
+ }
99
+ };
100
+ }
101
+ /** Print Inks の全8色(事前計算済み) */
102
+ const RASTER_COLOR_SET = COLOR_DEFS.map((def) => buildColorEntry(def));
103
+ //#endregion
104
+ export { RASTER_COLOR_SET, RASTER_TONE, buildColorEntry };
105
+
106
+ //# sourceMappingURL=color-set.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color-set.mjs","names":[],"sources":["../../src/tokens/color-set.ts"],"sourcesContent":["/**\n * Raster のカラーセット「Print Inks」とトーン。\n *\n * **specs/06-tones-and-colors が唯一の真実**で、ここはその写し。\n * 値を変えるときは spec を先に変える(Ask first — 全組み合わせの検査対象が変わるため)。\n *\n * トーン(L / C)はモデルが所有し、色は hue と名前だけを持つ(ADR-C01)。\n * 差し色は新しい色を作らず、同じセット内の別のインクを組む「2色刷り」(ADR-C03)。\n * 全値はここで事前計算し、生成器・テスト・IR が同じ計算結果を読む(ADR-C02)。\n */\n\nexport interface RasterTone {\n /** OKLCH の L(% 単位の数値。44 = 44%) */\n l: number\n /** OKLCH の C */\n c: number\n}\n\n/**\n * Print Inks のトーン。\n * light の C 0.090 は、このセットでの色域上限 0.095(律速 Ochre)の 0.005 内側。\n */\nexport const RASTER_TONE: { light: RasterTone; dark: RasterTone } = {\n light: { l: 44, c: 0.09 },\n dark: { l: 74, c: 0.09 },\n}\n\nexport interface RasterColorDef {\n /** `data-novi-color` に指定する名前(kebab-case) */\n id: string\n /** 表示名 */\n name: string\n /** OKLCH の hue(度) */\n hue: number\n /** 2色刷りの相方。`--novi-color-secondary` にこの色の値が入る */\n pair: string\n /** 1行の出自。docs / llms / MCP が使う */\n description: string\n /** 無彩枠だけが持つ C の例外値(light) */\n fixedC?: number\n /** 同・dark */\n fixedCDark?: number\n}\n\n/**\n * 8色。全色が顔料・インクの実名を持つ。\n * 紫・青緑・ピンクは意図的に入れていない(Tactile のセット候補。入れない色で性格を作る)。\n */\nconst COLOR_DEFS: readonly RasterColorDef[] = [\n {\n id: 'ink',\n name: 'Ink',\n hue: 268,\n pair: 'brick',\n description: '万年筆の藍黒。書き物の色。既定色',\n },\n {\n id: 'prussian',\n name: 'Prussian',\n hue: 235,\n pair: 'ochre',\n description: '紺青。18世紀からある合成顔料の名',\n },\n {\n id: 'forest',\n name: 'Forest',\n hue: 160,\n pair: 'ochre',\n description: '深い常緑。製図インクの緑',\n },\n { id: 'olive', name: 'Olive', hue: 125, pair: 'ink', description: 'オリーブドラブ。土に近い緑' },\n {\n id: 'ochre',\n name: 'Ochre',\n hue: 70,\n pair: 'prussian',\n description: '黄土。最古の顔料のひとつ',\n },\n {\n id: 'brick',\n name: 'Brick',\n hue: 35,\n pair: 'ink',\n description: '煉瓦の朱。スイスポスターの赤の末裔',\n },\n { id: 'bordeaux', name: 'Bordeaux', hue: 12, pair: 'ochre', description: 'ワインの澱の赤' },\n {\n id: 'graphite',\n name: 'Graphite',\n hue: 270,\n pair: 'brick',\n description: '黒鉛。色を消すという選択肢',\n fixedC: 0.02,\n fixedCDark: 0.017,\n },\n]\n\n/** `data-novi-color` 未指定・未知の名前のときに効く色(FR-05) */\nexport const DEFAULT_COLOR_ID = 'ink'\n\n/**\n * OKLCH → 線形 sRGB。\n * core の testing にも同じ変換があるが、あちらは文字列 API でテスト専用。\n * ここは生成器(Node 実行)からも呼ぶため、依存なしで持つ。\n */\nfunction toLinearSrgb(l: number, c: number, hue: number): [number, number, number] {\n const rad = (hue * Math.PI) / 180\n const a = c * Math.cos(rad)\n const b = c * Math.sin(rad)\n\n const lc = (l + 0.3963377774 * a + 0.2158037573 * b) ** 3\n const mc = (l - 0.1055613458 * a - 0.0638541728 * b) ** 3\n const sc = (l - 0.0894841775 * a - 1.291485548 * b) ** 3\n\n return [\n 4.0767416621 * lc - 3.3077115913 * mc + 0.2309699292 * sc,\n -1.2684380046 * lc + 2.6097574011 * mc - 0.3413193965 * sc,\n -0.0041960863 * lc - 0.7034186147 * mc + 1.707614701 * sc,\n ]\n}\n\n/**\n * その OKLCH が sRGB で再現できるか。\n *\n * トーンの天井はコントラストではなくこれが決める(暗く鮮やかな黄・青緑は sRGB に無い)。\n * 「表示はされるが実際は別の色に丸められている」を仕様上の合格にしないための検査。\n *\n * @param l 0〜1 の L(`parseOklch` の返り値と同じ単位)\n */\nexport function inSrgbGamut(l: number, c: number, hue: number): boolean {\n const tolerance = 0.0005\n return toLinearSrgb(l, c, hue).every((v) => v >= -tolerance && v <= 1 + tolerance)\n}\n\nexport interface RasterColorSchemeValues {\n primary: string\n primaryFg: string\n}\n\nexport interface RasterColorEntry extends RasterColorDef {\n light: RasterColorSchemeValues\n dark: RasterColorSchemeValues\n}\n\n/** 文字色は地色と同じ値(bg light / bg dark)。面の上に地の色で書く、が Raster の約束。 */\nconst PRIMARY_FG_LIGHT = 'oklch(99% 0 0)'\nconst PRIMARY_FG_DARK = 'oklch(16% 0 0)'\n\nconst oklch = (l: number, c: number, hue: number) => `oklch(${l}% ${c} ${hue})`\n\n/**\n * 定義(hue と例外 C)とトーンから、実際の CSS 値を組み立てる。\n * テストが不正な色(域外の hue × C)を作って検査を確かめるのにも使う(AC-03-4)。\n */\nexport function buildColorEntry(\n def: RasterColorDef,\n tone: { light: RasterTone; dark: RasterTone } = RASTER_TONE,\n): RasterColorEntry {\n return {\n ...def,\n light: {\n primary: oklch(tone.light.l, def.fixedC ?? tone.light.c, def.hue),\n primaryFg: PRIMARY_FG_LIGHT,\n },\n dark: {\n primary: oklch(tone.dark.l, def.fixedCDark ?? tone.dark.c, def.hue),\n primaryFg: PRIMARY_FG_DARK,\n },\n }\n}\n\n/** Print Inks の全8色(事前計算済み) */\nexport const RASTER_COLOR_SET: readonly RasterColorEntry[] = COLOR_DEFS.map((def) =>\n buildColorEntry(def),\n)\n\n/** @throws セットに無い id(相方の参照ミスは実行時ではなくここで死ぬべき) */\nexport function colorById(id: string): RasterColorEntry {\n const entry = RASTER_COLOR_SET.find((c) => c.id === id)\n if (entry === undefined) throw new Error(`Print Inks に無い色です: ${id}`)\n return entry\n}\n"],"mappings":";;;;;AAsBA,MAAa,cAAuD;CAClE,OAAO;EAAE,GAAG;EAAI,GAAG;CAAK;CACxB,MAAM;EAAE,GAAG;EAAI,GAAG;CAAK;AACzB;;;;;AAuBA,MAAM,aAAwC;CAC5C;EACE,IAAI;EACJ,MAAM;EACN,KAAK;EACL,MAAM;EACN,aAAa;CACf;CACA;EACE,IAAI;EACJ,MAAM;EACN,KAAK;EACL,MAAM;EACN,aAAa;CACf;CACA;EACE,IAAI;EACJ,MAAM;EACN,KAAK;EACL,MAAM;EACN,aAAa;CACf;CACA;EAAE,IAAI;EAAS,MAAM;EAAS,KAAK;EAAK,MAAM;EAAO,aAAa;CAAgB;CAClF;EACE,IAAI;EACJ,MAAM;EACN,KAAK;EACL,MAAM;EACN,aAAa;CACf;CACA;EACE,IAAI;EACJ,MAAM;EACN,KAAK;EACL,MAAM;EACN,aAAa;CACf;CACA;EAAE,IAAI;EAAY,MAAM;EAAY,KAAK;EAAI,MAAM;EAAS,aAAa;CAAU;CACnF;EACE,IAAI;EACJ,MAAM;EACN,KAAK;EACL,MAAM;EACN,aAAa;EACb,QAAQ;EACR,YAAY;CACd;AACF;;AAkDA,MAAM,mBAAmB;AACzB,MAAM,kBAAkB;AAExB,MAAM,SAAS,GAAW,GAAW,QAAgB,SAAS,EAAE,IAAI,EAAE,GAAG,IAAI;;;;;AAM7E,SAAgB,gBACd,KACA,OAAgD,aAC9B;CAClB,OAAO;EACL,GAAG;EACH,OAAO;GACL,SAAS,MAAM,KAAK,MAAM,GAAG,IAAI,UAAU,KAAK,MAAM,GAAG,IAAI,GAAG;GAChE,WAAW;EACb;EACA,MAAM;GACJ,SAAS,MAAM,KAAK,KAAK,GAAG,IAAI,cAAc,KAAK,KAAK,GAAG,IAAI,GAAG;GAClE,WAAW;EACb;CACF;AACF;;AAGA,MAAa,mBAAgD,WAAW,KAAK,QAC3E,gBAAgB,GAAG,CACrB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@novi-ui/raster",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "description": "Novi UI theme 1 — minimal / Swiss. Sharp corners, no shadows, hairline rules, restrained motion.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "tailwind-variants": "^3.3.1",
35
- "@novi-ui/core": "0.1.1"
35
+ "@novi-ui/core": "0.2.0"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@size-limit/preset-small-lib": "^13.0.3",
@@ -43,6 +43,7 @@
43
43
  "@types/react": "^19.0.0",
44
44
  "@types/react-dom": "^19.2.4",
45
45
  "@vitest/coverage-v8": "^4.1.11",
46
+ "esbuild": "^0.25.0",
46
47
  "jsdom": "^30.0.1",
47
48
  "react": "^19.0.0",
48
49
  "react-aria-components": "^1.20.0",