@takazudo/zdtp 0.6.1 → 0.8.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 +70 -0
- package/PORTABLE-CONTRACT.md +17 -7
- package/README.md +18 -7
- package/dist/apply/build-apply-overrides.d.ts +2 -0
- package/dist/astro/host-adapter.js +3 -3
- package/dist/astro/index.js +1 -1
- package/dist/{autoload-state-CGnis85c.js → autoload-state-CtB0e8mY.js} +1 -1
- package/dist/components/color-picker/color-field.d.ts +3 -1
- package/dist/components/color-picker/color-picker.d.ts +3 -1
- package/dist/components/color-picker/custom-slider.d.ts +2 -1
- package/dist/config/cluster-config.d.ts +10 -2
- package/dist/dashboard/index.d.ts +2 -1
- package/dist/dashboard/index.js +298 -249
- package/dist/dashboard/model.d.ts +3 -1
- package/dist/dashboard/styles.css +152 -43
- package/dist/dashboard/token-dashboard.d.ts +10 -3
- package/dist/dashboard/types.d.ts +21 -3
- package/dist/import-modal.d.ts +21 -22
- package/dist/{index-LYsbHWcy.js → index-BH_IJp9W.js} +2 -2
- package/dist/index-blRjSavc.js +12890 -0
- package/dist/index.d.ts +5 -3
- package/dist/index.js +39 -32
- package/dist/mode-dependence-Ci9avNt8.js +61 -0
- package/dist/{panel-config-Crn5QJGy.js → panel-config-DKfob-1r.js} +314 -301
- package/dist/state/tweak-state.d.ts +17 -7
- package/dist/tabs/modes-row.d.ts +39 -0
- package/dist/testing.js +2 -2
- package/dist/tokens/mode-dependence.d.ts +23 -0
- package/dist/tokens/tier-model.d.ts +9 -0
- package/dist/{tweak-state-Dzr5kDhX.js → tweak-state-BiaKbhXN.js} +729 -671
- package/dist/utils/design-token-serde.d.ts +32 -2
- package/dist/utils/resolve-css-color.d.ts +12 -0
- package/dist/zdtp.css +1 -1
- package/package.json +1 -1
- package/dist/index-DWs1XPfy.js +0 -12251
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { TabConfig } from "../tokens/tier-model.js";
|
|
2
|
-
import type { DashboardMode, DashboardModel } from "./types.js";
|
|
2
|
+
import type { DashboardMode, DashboardModel, DashboardModelOptions } from "./types.js";
|
|
3
3
|
/**
|
|
4
4
|
* Normalize the authored inventory for a static dashboard. Named color schemes,
|
|
5
5
|
* stored changes, editor fallback values and pill.customDefault are not inputs.
|
|
6
6
|
*/
|
|
7
|
+
export declare function buildDashboardModel(tabs: readonly TabConfig[], options?: DashboardModelOptions): DashboardModel;
|
|
8
|
+
/** Compatibility for consumers passing the declared mode positionally. */
|
|
7
9
|
export declare function buildDashboardModel(tabs: readonly TabConfig[], mode?: DashboardMode): DashboardModel;
|
|
@@ -1,3 +1,41 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Public chrome inputs. Hosts may set these four variables on the dashboard or
|
|
3
|
+
* on an ancestor. The registered initial values keep the dashboard usable when
|
|
4
|
+
* no host value is supplied; the `inherit` declarations below preserve an
|
|
5
|
+
* ancestor override instead of shadowing it.
|
|
6
|
+
*
|
|
7
|
+
* --zdtp-dashboard-light-bg: light-mode page and shell background.
|
|
8
|
+
* --zdtp-dashboard-light-fg: light-mode primary text and foreground.
|
|
9
|
+
* --zdtp-dashboard-dark-bg: dark-mode page and shell background.
|
|
10
|
+
* --zdtp-dashboard-dark-fg: dark-mode primary text and foreground.
|
|
11
|
+
*
|
|
12
|
+
* All other chrome colors are derived from these inputs with light-dark() and
|
|
13
|
+
* color-mix().
|
|
14
|
+
*/
|
|
15
|
+
@property --zdtp-dashboard-light-bg {
|
|
16
|
+
syntax: "<color>";
|
|
17
|
+
inherits: true;
|
|
18
|
+
initial-value: #f8fafc;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@property --zdtp-dashboard-light-fg {
|
|
22
|
+
syntax: "<color>";
|
|
23
|
+
inherits: true;
|
|
24
|
+
initial-value: #182131;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@property --zdtp-dashboard-dark-bg {
|
|
28
|
+
syntax: "<color>";
|
|
29
|
+
inherits: true;
|
|
30
|
+
initial-value: #151b24;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@property --zdtp-dashboard-dark-fg {
|
|
34
|
+
syntax: "<color>";
|
|
35
|
+
inherits: true;
|
|
36
|
+
initial-value: #edf2f7;
|
|
37
|
+
}
|
|
38
|
+
|
|
1
39
|
/* Static dashboard chrome deliberately uses no inventory custom properties.
|
|
2
40
|
The namespace and div/span markup protect documentation hosts from tag resets. */
|
|
3
41
|
.zdtp-dashboard,
|
|
@@ -6,13 +44,60 @@
|
|
|
6
44
|
}
|
|
7
45
|
|
|
8
46
|
.zdtp-dashboard {
|
|
47
|
+
/* Keep these inputs inheritable so a wrapper can theme the dashboard. */
|
|
48
|
+
--zdtp-dashboard-light-bg: inherit;
|
|
49
|
+
--zdtp-dashboard-light-fg: inherit;
|
|
50
|
+
--zdtp-dashboard-dark-bg: inherit;
|
|
51
|
+
--zdtp-dashboard-dark-fg: inherit;
|
|
52
|
+
|
|
53
|
+
--zdtp-dashboard-bg: light-dark(
|
|
54
|
+
color-mix(in oklab, var(--zdtp-dashboard-light-bg, #f8fafc), var(--zdtp-dashboard-light-fg, #182131) 0%),
|
|
55
|
+
color-mix(in oklab, var(--zdtp-dashboard-dark-bg, #151b24), var(--zdtp-dashboard-dark-fg, #edf2f7) 0%)
|
|
56
|
+
);
|
|
57
|
+
--zdtp-dashboard-fg: light-dark(
|
|
58
|
+
color-mix(in oklab, var(--zdtp-dashboard-light-bg, #f8fafc), var(--zdtp-dashboard-light-fg, #182131) 100%),
|
|
59
|
+
color-mix(in oklab, var(--zdtp-dashboard-dark-bg, #151b24), var(--zdtp-dashboard-dark-fg, #edf2f7) 100%)
|
|
60
|
+
);
|
|
61
|
+
--zdtp-dashboard-muted: light-dark(
|
|
62
|
+
color-mix(in oklab, var(--zdtp-dashboard-light-bg, #f8fafc), var(--zdtp-dashboard-light-fg, #182131) 58%),
|
|
63
|
+
color-mix(in oklab, var(--zdtp-dashboard-dark-bg, #151b24), var(--zdtp-dashboard-dark-fg, #edf2f7) 58%)
|
|
64
|
+
);
|
|
65
|
+
--zdtp-dashboard-border: light-dark(
|
|
66
|
+
color-mix(in oklab, var(--zdtp-dashboard-light-bg, #f8fafc), var(--zdtp-dashboard-light-fg, #182131) 16%),
|
|
67
|
+
color-mix(in oklab, var(--zdtp-dashboard-dark-bg, #151b24), var(--zdtp-dashboard-dark-fg, #edf2f7) 22%)
|
|
68
|
+
);
|
|
69
|
+
--zdtp-dashboard-card-bg: light-dark(
|
|
70
|
+
color-mix(in oklab, color-mix(in oklab, var(--zdtp-dashboard-light-bg, #f8fafc), var(--zdtp-dashboard-light-fg, #182131) 0%), white 20%),
|
|
71
|
+
color-mix(in oklab, color-mix(in oklab, var(--zdtp-dashboard-dark-bg, #151b24), var(--zdtp-dashboard-dark-fg, #edf2f7) 0%), black 8%)
|
|
72
|
+
);
|
|
73
|
+
--zdtp-dashboard-diag-bg: light-dark(#fff5e6, #3b2c18);
|
|
74
|
+
--zdtp-dashboard-diag-fg: light-dark(#704612, #ffdaa3);
|
|
75
|
+
--zdtp-dashboard-diag-accent: light-dark(#9d641a, #e4ad5c);
|
|
76
|
+
--zdtp-dashboard-focus: light-dark(#245caa, #6488b8);
|
|
77
|
+
--zdtp-dashboard-ruler-major: light-dark(
|
|
78
|
+
color-mix(in oklab, var(--zdtp-dashboard-light-bg, #f8fafc), var(--zdtp-dashboard-light-fg, #182131) 48%),
|
|
79
|
+
color-mix(in oklab, var(--zdtp-dashboard-dark-bg, #151b24), var(--zdtp-dashboard-dark-fg, #edf2f7) 52%)
|
|
80
|
+
);
|
|
81
|
+
--zdtp-dashboard-ruler-minor: light-dark(
|
|
82
|
+
color-mix(in oklab, var(--zdtp-dashboard-light-bg, #f8fafc), var(--zdtp-dashboard-light-fg, #182131) 22%),
|
|
83
|
+
color-mix(in oklab, var(--zdtp-dashboard-dark-bg, #151b24), var(--zdtp-dashboard-dark-fg, #edf2f7) 26%)
|
|
84
|
+
);
|
|
85
|
+
--zdtp-dashboard-bar: light-dark(#526c92, #9dbbe6);
|
|
86
|
+
--zdtp-dashboard-sample-bg: light-dark(
|
|
87
|
+
color-mix(in oklab, var(--zdtp-dashboard-light-bg, #f8fafc), var(--zdtp-dashboard-light-fg, #182131) 4%),
|
|
88
|
+
color-mix(in oklab, var(--zdtp-dashboard-dark-bg, #151b24), var(--zdtp-dashboard-dark-fg, #edf2f7) 6%)
|
|
89
|
+
);
|
|
90
|
+
--zdtp-dashboard-sample-border: light-dark(
|
|
91
|
+
color-mix(in oklab, var(--zdtp-dashboard-light-bg, #f8fafc), var(--zdtp-dashboard-light-fg, #182131) 48%),
|
|
92
|
+
color-mix(in oklab, var(--zdtp-dashboard-dark-bg, #151b24), var(--zdtp-dashboard-dark-fg, #edf2f7) 52%)
|
|
93
|
+
);
|
|
94
|
+
--zdtp-dashboard-transparent: transparent;
|
|
9
95
|
min-inline-size: 0;
|
|
10
96
|
max-inline-size: 100%;
|
|
11
|
-
border: 1px solid
|
|
97
|
+
border: 1px solid var(--zdtp-dashboard-border);
|
|
12
98
|
border-radius: 10px;
|
|
13
|
-
background:
|
|
14
|
-
color:
|
|
15
|
-
color-scheme: light;
|
|
99
|
+
background: transparent;
|
|
100
|
+
color: inherit;
|
|
16
101
|
font: 400 14px/1.5 system-ui, sans-serif;
|
|
17
102
|
letter-spacing: normal;
|
|
18
103
|
text-align: start;
|
|
@@ -21,6 +106,15 @@
|
|
|
21
106
|
overflow-wrap: anywhere;
|
|
22
107
|
}
|
|
23
108
|
|
|
109
|
+
.zdtp-dashboard[data-chrome='host'] { color-scheme: inherit; }
|
|
110
|
+
|
|
111
|
+
/* Shell chrome is scoped to the header and the mode-independent region. This
|
|
112
|
+
leaves a mode-dependent `data-scheme="host"` region able to inherit from the
|
|
113
|
+
page ancestor, even when the shell itself is fixed to light or dark. */
|
|
114
|
+
.zdtp-dashboard[data-chrome='light'] > .zdtp-dashboard__header { color-scheme: light; }
|
|
115
|
+
.zdtp-dashboard[data-chrome='dark'] > .zdtp-dashboard__header { color-scheme: dark; }
|
|
116
|
+
.zdtp-dashboard[data-chrome='host'] > .zdtp-dashboard__header { color-scheme: inherit; }
|
|
117
|
+
|
|
24
118
|
.zdtp-dashboard :where(div, span) {
|
|
25
119
|
min-inline-size: 0;
|
|
26
120
|
margin: 0;
|
|
@@ -37,9 +131,22 @@
|
|
|
37
131
|
display: grid;
|
|
38
132
|
gap: 8px;
|
|
39
133
|
padding: 20px;
|
|
40
|
-
border-block-end: 1px solid
|
|
134
|
+
border-block-end: 1px solid var(--zdtp-dashboard-border);
|
|
135
|
+
background: var(--zdtp-dashboard-bg);
|
|
136
|
+
color: var(--zdtp-dashboard-fg);
|
|
41
137
|
}
|
|
42
138
|
|
|
139
|
+
.zdtp-dashboard__region {
|
|
140
|
+
display: grid;
|
|
141
|
+
gap: 32px;
|
|
142
|
+
background: var(--zdtp-dashboard-bg);
|
|
143
|
+
color: var(--zdtp-dashboard-fg);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.zdtp-dashboard__region[data-scheme='light'] { color-scheme: light; }
|
|
147
|
+
.zdtp-dashboard__region[data-scheme='dark'] { color-scheme: dark; }
|
|
148
|
+
.zdtp-dashboard__region[data-scheme='host'] { color-scheme: inherit; }
|
|
149
|
+
|
|
43
150
|
.zdtp-dashboard__title {
|
|
44
151
|
font-size: 22px;
|
|
45
152
|
font-weight: 700;
|
|
@@ -51,12 +158,12 @@
|
|
|
51
158
|
flex-wrap: wrap;
|
|
52
159
|
align-items: baseline;
|
|
53
160
|
gap: 4px 16px;
|
|
54
|
-
color:
|
|
161
|
+
color: var(--zdtp-dashboard-muted);
|
|
55
162
|
font-size: 12px;
|
|
56
163
|
}
|
|
57
164
|
|
|
58
165
|
.zdtp-dashboard__count {
|
|
59
|
-
color:
|
|
166
|
+
color: var(--zdtp-dashboard-fg);
|
|
60
167
|
font-weight: 600;
|
|
61
168
|
}
|
|
62
169
|
|
|
@@ -77,7 +184,7 @@
|
|
|
77
184
|
align-items: baseline;
|
|
78
185
|
gap: 4px 12px;
|
|
79
186
|
padding-block-end: 8px;
|
|
80
|
-
border-block-end: 1px solid
|
|
187
|
+
border-block-end: 1px solid var(--zdtp-dashboard-border);
|
|
81
188
|
}
|
|
82
189
|
|
|
83
190
|
.zdtp-dashboard__tab-title {
|
|
@@ -86,7 +193,7 @@
|
|
|
86
193
|
}
|
|
87
194
|
|
|
88
195
|
.zdtp-dashboard__tab-count {
|
|
89
|
-
color:
|
|
196
|
+
color: var(--zdtp-dashboard-muted);
|
|
90
197
|
font-size: 12px;
|
|
91
198
|
}
|
|
92
199
|
|
|
@@ -108,10 +215,10 @@
|
|
|
108
215
|
.zdtp-dashboard__token {
|
|
109
216
|
display: flex;
|
|
110
217
|
flex-direction: column;
|
|
111
|
-
border: 1px solid
|
|
218
|
+
border: 1px solid var(--zdtp-dashboard-border);
|
|
112
219
|
border-radius: 6px;
|
|
113
|
-
background:
|
|
114
|
-
color:
|
|
220
|
+
background: var(--zdtp-dashboard-card-bg);
|
|
221
|
+
color: var(--zdtp-dashboard-fg);
|
|
115
222
|
}
|
|
116
223
|
|
|
117
224
|
.zdtp-dashboard__token-content {
|
|
@@ -135,39 +242,40 @@
|
|
|
135
242
|
|
|
136
243
|
.zdtp-dashboard__variable,
|
|
137
244
|
.zdtp-dashboard__reference {
|
|
138
|
-
color:
|
|
245
|
+
color: var(--zdtp-dashboard-muted);
|
|
139
246
|
}
|
|
140
247
|
|
|
141
248
|
.zdtp-dashboard__value {
|
|
142
249
|
padding-block-start: 5px;
|
|
143
|
-
color:
|
|
250
|
+
color: var(--zdtp-dashboard-fg);
|
|
144
251
|
}
|
|
145
252
|
|
|
146
253
|
.zdtp-dashboard__diagnostic {
|
|
147
254
|
margin-block-start: 3px;
|
|
148
255
|
padding: 8px;
|
|
149
|
-
border-inline-start: 2px solid
|
|
150
|
-
background:
|
|
151
|
-
color:
|
|
256
|
+
border-inline-start: 2px solid var(--zdtp-dashboard-diag-accent);
|
|
257
|
+
background: var(--zdtp-dashboard-diag-bg);
|
|
258
|
+
color: var(--zdtp-dashboard-diag-fg);
|
|
152
259
|
font-size: 12px;
|
|
153
260
|
}
|
|
154
261
|
|
|
155
262
|
.zdtp-dashboard__preview {
|
|
156
263
|
display: flex;
|
|
157
|
-
align-items: center;
|
|
158
|
-
padding: 16px;
|
|
159
264
|
block-size: 88px;
|
|
160
|
-
border-block-end: 1px solid
|
|
265
|
+
border-block-end: 1px solid var(--zdtp-dashboard-border);
|
|
161
266
|
border-start-start-radius: 5px;
|
|
162
267
|
border-start-end-radius: 5px;
|
|
163
|
-
background: #eef1f5;
|
|
164
|
-
color: #182131;
|
|
165
268
|
overflow: hidden;
|
|
166
269
|
}
|
|
167
270
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
271
|
+
/* The inner well owns specimen paint and mode; borders and scrolling stay outside. */
|
|
272
|
+
.zdtp-dashboard__preview > .zdtp-dashboard__specimen {
|
|
273
|
+
display: flex;
|
|
274
|
+
align-items: center;
|
|
275
|
+
flex: 1;
|
|
276
|
+
padding: 16px;
|
|
277
|
+
background: light-dark(#eef1f5, #222936);
|
|
278
|
+
color: light-dark(#182131, #f1f5f9);
|
|
171
279
|
}
|
|
172
280
|
|
|
173
281
|
.zdtp-dashboard__sample {
|
|
@@ -176,13 +284,9 @@
|
|
|
176
284
|
max-inline-size: 100%;
|
|
177
285
|
}
|
|
178
286
|
|
|
179
|
-
.zdtp-dashboard__preview--color {
|
|
287
|
+
.zdtp-dashboard__preview--color > .zdtp-dashboard__specimen {
|
|
180
288
|
padding: 0;
|
|
181
|
-
background: repeating-conic-gradient(#e2e6eb 0% 25%, #fff 0% 50%) 0 / 16px 16px;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
.zdtp-dashboard[data-mode='dark'] .zdtp-dashboard__preview--color {
|
|
185
|
-
background: repeating-conic-gradient(#3e4652 0% 25%, #252c37 0% 50%) 0 / 16px 16px;
|
|
289
|
+
background: repeating-conic-gradient(light-dark(#e2e6eb, #3e4652) 0% 25%, light-dark(#fff, #252c37) 0% 50%) 0 / 16px 16px;
|
|
186
290
|
}
|
|
187
291
|
|
|
188
292
|
.zdtp-dashboard__sample--color {
|
|
@@ -192,15 +296,14 @@
|
|
|
192
296
|
|
|
193
297
|
.zdtp-dashboard__sample--bar {
|
|
194
298
|
block-size: 16px;
|
|
195
|
-
background: currentColor;
|
|
196
299
|
}
|
|
197
300
|
|
|
198
301
|
.zdtp-dashboard__sample--radius,
|
|
199
302
|
.zdtp-dashboard__sample--shadow {
|
|
200
303
|
inline-size: 64px;
|
|
201
304
|
block-size: 48px;
|
|
202
|
-
background:
|
|
203
|
-
border: 1px solid
|
|
305
|
+
background: var(--zdtp-dashboard-sample-bg);
|
|
306
|
+
border: 1px solid var(--zdtp-dashboard-sample-border);
|
|
204
307
|
}
|
|
205
308
|
|
|
206
309
|
.zdtp-dashboard__sample--family,
|
|
@@ -214,7 +317,8 @@
|
|
|
214
317
|
}
|
|
215
318
|
|
|
216
319
|
.zdtp-dashboard__empty {
|
|
217
|
-
|
|
320
|
+
background: var(--zdtp-dashboard-bg);
|
|
321
|
+
color: var(--zdtp-dashboard-muted);
|
|
218
322
|
}
|
|
219
323
|
|
|
220
324
|
/* Wide rows use their embedding width, including narrow documentation columns. */
|
|
@@ -232,13 +336,14 @@
|
|
|
232
336
|
overscroll-behavior-inline: contain;
|
|
233
337
|
}
|
|
234
338
|
.zdtp-dashboard__scroll:focus-visible {
|
|
235
|
-
outline: 2px solid
|
|
236
|
-
|
|
339
|
+
outline: 2px solid var(--zdtp-dashboard-focus);
|
|
340
|
+
/* Paint outside the mode-scoped well, against surrounding chrome. */
|
|
341
|
+
outline-offset: 0;
|
|
237
342
|
}
|
|
238
343
|
.zdtp-dashboard__ruler-wrap { padding: 12px; }
|
|
239
344
|
.zdtp-dashboard__ruler-caption,
|
|
240
345
|
.zdtp-dashboard__preview-unavailable {
|
|
241
|
-
color:
|
|
346
|
+
color: var(--zdtp-dashboard-muted);
|
|
242
347
|
font-size: 12px;
|
|
243
348
|
padding: 12px;
|
|
244
349
|
}
|
|
@@ -248,8 +353,8 @@
|
|
|
248
353
|
block-size: 64px;
|
|
249
354
|
padding-block-start: 36px;
|
|
250
355
|
background:
|
|
251
|
-
repeating-linear-gradient(to right,
|
|
252
|
-
repeating-linear-gradient(to right,
|
|
356
|
+
repeating-linear-gradient(to right, var(--zdtp-dashboard-ruler-major) 0 1px, var(--zdtp-dashboard-transparent) 1px 64px) left 24px / 100% 12px no-repeat,
|
|
357
|
+
repeating-linear-gradient(to right, var(--zdtp-dashboard-ruler-minor) 0 1px, var(--zdtp-dashboard-transparent) 1px 8px) left 30px / 100% 6px no-repeat;
|
|
253
358
|
}
|
|
254
359
|
.zdtp-dashboard__ruler-origin { position: absolute; inset-block-start: 0; inset-inline-start: 0; font-size: 12px; }
|
|
255
360
|
.zdtp-dashboard__sample--bar {
|
|
@@ -257,7 +362,7 @@
|
|
|
257
362
|
min-inline-size: 0;
|
|
258
363
|
border: 0;
|
|
259
364
|
padding: 0;
|
|
260
|
-
background:
|
|
365
|
+
background: var(--zdtp-dashboard-bar);
|
|
261
366
|
}
|
|
262
367
|
.zdtp-dashboard__palette {
|
|
263
368
|
display: flex;
|
|
@@ -278,11 +383,15 @@
|
|
|
278
383
|
.zdtp-dashboard__preview--typography {
|
|
279
384
|
display: block;
|
|
280
385
|
block-size: auto;
|
|
281
|
-
padding: 20px;
|
|
282
386
|
border: 0;
|
|
283
387
|
border-radius: 0;
|
|
284
388
|
}
|
|
285
|
-
.zdtp-dashboard__preview--typography > .zdtp-
|
|
389
|
+
.zdtp-dashboard__preview--typography > .zdtp-dashboard__specimen {
|
|
390
|
+
display: block;
|
|
391
|
+
padding: 20px;
|
|
392
|
+
min-block-size: 100%;
|
|
393
|
+
}
|
|
394
|
+
.zdtp-dashboard__preview--typography > .zdtp-dashboard__specimen > .zdtp-dashboard__sample {
|
|
286
395
|
font: 400 18px/1.6 system-ui, sans-serif;
|
|
287
396
|
letter-spacing: normal;
|
|
288
397
|
white-space: pre-wrap;
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
import type { JSX } from 'preact';
|
|
2
2
|
import type { TabConfig, TierConfig } from "../tokens/tier-model.js";
|
|
3
|
-
import type { DashboardMode } from "./types.js";
|
|
3
|
+
import type { DashboardChrome, DashboardInclude, DashboardMode } from "./types.js";
|
|
4
4
|
/** Visual samples are independent from the panel's editor kind. */
|
|
5
5
|
export type DashboardPreviewKind = NonNullable<TierConfig['preview']> | 'color' | 'shadow' | 'text';
|
|
6
6
|
export interface TokenDashboardProps {
|
|
7
7
|
tabs: readonly TabConfig[];
|
|
8
|
-
/** Selects declared per-mode defaults.
|
|
8
|
+
/** Selects declared per-mode defaults. 'host' follows the inherited CSS
|
|
9
|
+
* color-scheme without reading browser or panel state. Defaults to 'light'. */
|
|
9
10
|
mode?: DashboardMode;
|
|
11
|
+
/** Selects visible rows by mode dependence. Defaults to 'all'. */
|
|
12
|
+
include?: DashboardInclude;
|
|
13
|
+
/** Selects the shell and mode-independent region's appearance, including
|
|
14
|
+
* cards, labels, borders, diagnostics and focus/scroll affordances.
|
|
15
|
+
* 'host' inherits the host's effective color-scheme. Defaults to 'light'. */
|
|
16
|
+
chrome?: DashboardChrome;
|
|
10
17
|
title?: string;
|
|
11
18
|
/** Static multiline typography specimen. Empty strings are preserved. */
|
|
12
19
|
previewText?: string;
|
|
@@ -20,4 +27,4 @@ export interface TokenDashboardProps {
|
|
|
20
27
|
* server renderer without hydration, browser globals, or panel configuration.
|
|
21
28
|
* Include @takazudo/zdtp/dashboard/styles.css through the host's CSS pipeline.
|
|
22
29
|
*/
|
|
23
|
-
export declare function TokenDashboard({ tabs, mode, title, id, previewOverrides, previewText, }: TokenDashboardProps): JSX.Element;
|
|
30
|
+
export declare function TokenDashboard({ tabs, mode, include, chrome, title, id, previewOverrides, previewText, }: TokenDashboardProps): JSX.Element;
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import type { TierConfig, TierValueKind } from "../tokens/tier-model.js";
|
|
2
2
|
/** Internal, render-independent description of declared token defaults. */
|
|
3
|
-
export type DashboardMode = 'light' | 'dark';
|
|
3
|
+
export type DashboardMode = 'light' | 'dark' | 'host';
|
|
4
|
+
export type DashboardInclude = 'all' | 'mode-dependent' | 'mode-independent';
|
|
5
|
+
export interface DashboardModelOptions {
|
|
6
|
+
mode?: DashboardMode;
|
|
7
|
+
include?: DashboardInclude;
|
|
8
|
+
}
|
|
9
|
+
/** Appearance of the dashboard chrome, independent of declared token mode. */
|
|
10
|
+
export type DashboardChrome = 'light' | 'dark' | 'host';
|
|
4
11
|
export interface DashboardDiagnostic {
|
|
5
12
|
code: string;
|
|
6
13
|
severity: 'warning' | 'error';
|
|
@@ -22,6 +29,13 @@ export interface DashboardRow {
|
|
|
22
29
|
cssVar: string;
|
|
23
30
|
kind: TierValueKind['kind'];
|
|
24
31
|
source: 'item' | 'base-role';
|
|
32
|
+
modeDependent: boolean;
|
|
33
|
+
/** Direct authored pair; reference-derived dependence has no local pair. */
|
|
34
|
+
sides: {
|
|
35
|
+
light: string;
|
|
36
|
+
dark: string;
|
|
37
|
+
} | null;
|
|
38
|
+
origin: 'modes' | 'semantic' | 'default' | 'reference' | null;
|
|
25
39
|
defaultValue: string;
|
|
26
40
|
/** Human-readable selected-mode declaration, including explicit semantic overrides. */
|
|
27
41
|
declaredValue: string;
|
|
@@ -29,8 +43,9 @@ export interface DashboardRow {
|
|
|
29
43
|
cssValue: string | null;
|
|
30
44
|
/**
|
|
31
45
|
* Follows direct declared references only, never computes CSS. Expressions
|
|
32
|
-
* remain expressions. Null means invalid or dependent on unknown context
|
|
33
|
-
*
|
|
46
|
+
* remain expressions. Null means invalid or dependent on unknown context.
|
|
47
|
+
* In host mode, mode-dependent rows stay null while cssValue retains the
|
|
48
|
+
* declarations needed for the browser to resolve the inherited scheme.
|
|
34
49
|
*/
|
|
35
50
|
resolvedValue: string | null;
|
|
36
51
|
references: DashboardReference[];
|
|
@@ -54,7 +69,10 @@ export interface DashboardTab {
|
|
|
54
69
|
}
|
|
55
70
|
export interface DashboardModel {
|
|
56
71
|
mode: DashboardMode;
|
|
72
|
+
include: DashboardInclude;
|
|
73
|
+
/** Visible inventory, with empty tiers and tabs omitted. */
|
|
57
74
|
tabs: DashboardTab[];
|
|
75
|
+
/** Complete graph, including rows hidden by include. */
|
|
58
76
|
rows: DashboardRow[];
|
|
59
77
|
/** Declare these on each preview scope, never on :root or the document. */
|
|
60
78
|
declarations: Readonly<Record<string, string>>;
|
package/dist/import-modal.d.ts
CHANGED
|
@@ -1,40 +1,39 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Import modal — accepts a pasted design-tokens JSON document and
|
|
3
|
-
*
|
|
4
|
-
* `$schema` key against the fixed `SCHEMA_V1`/`SCHEMA_V2`/`SCHEMA_V3`
|
|
5
|
-
* constants exported by the serde — `panelConfig.schemaId` plays no part in
|
|
6
|
-
* that validation; it is a UI-label-only field (#498). This component does
|
|
7
|
-
* not read `schemaId` at all; the hint/placeholder/error copy below names
|
|
8
|
-
* the actual accepted constants directly.
|
|
2
|
+
* Import modal — accepts a pasted design-tokens JSON document and guides the
|
|
3
|
+
* user through paste → analyze → scope → load.
|
|
9
4
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* - State types import from this package's state envelope.
|
|
15
|
-
* - Modal class names are derived from `panelConfig.modalClassPrefix` via
|
|
16
|
-
* `modalClass(...)` so a single config swap re-themes every dialog.
|
|
5
|
+
* `analyzeDesignTokenJson()` is deliberately state-free, so the first step
|
|
6
|
+
* can inspect a document without applying values or touching storage. The
|
|
7
|
+
* selected tabs and mode/merge choices are passed to `deserialize()` only
|
|
8
|
+
* after the user explicitly chooses Load.
|
|
17
9
|
*
|
|
18
10
|
* Modal lifecycle uses the native `<dialog>` element via `showModal()` /
|
|
19
|
-
* `close()`. Every dismissal path
|
|
20
|
-
*
|
|
21
|
-
*
|
|
11
|
+
* `close()`. Every dismissal path routes through `dialog.close()` so the
|
|
12
|
+
* native `close` event — and thus `onClose` — fires exactly once per
|
|
13
|
+
* dismissal.
|
|
22
14
|
*/
|
|
23
15
|
import type { ColorTweakState, TweakState } from "./state/tweak-state.js";
|
|
24
16
|
import { type PanelConfig } from "./config/panel-config.js";
|
|
25
17
|
export interface ImportModalProps {
|
|
26
18
|
onClose: () => void;
|
|
27
19
|
/** Called with the parsed state when the user hits "Load". The caller is
|
|
28
|
-
*
|
|
20
|
+
* responsible for applying it to the panel + persisting it. */
|
|
29
21
|
onLoad: (state: TweakState) => void;
|
|
30
22
|
/** Color baseline filled in for fields absent from the payload. */
|
|
31
23
|
colorDefaults: ColorTweakState;
|
|
24
|
+
/**
|
|
25
|
+
* The mounted panel instance's live state. It is used by scoped merge and
|
|
26
|
+
* one-side imports to preserve values from the instance being edited.
|
|
27
|
+
* Omitted for backwards-compatible direct renders; serde then falls back to
|
|
28
|
+
* manifest/default values for those options.
|
|
29
|
+
*/
|
|
30
|
+
current?: TweakState;
|
|
32
31
|
/**
|
|
33
32
|
* The mounted panel instance's config (multi-instance, #357). When supplied,
|
|
34
|
-
* the modal derives its modal classes + title id from THIS
|
|
35
|
-
* than the active default instance. Omitted (e.g. a direct
|
|
36
|
-
* `getPanelConfig()`, preserving the single-panel path.
|
|
33
|
+
* the modal derives its modal classes + title id and serde lookups from THIS
|
|
34
|
+
* instance rather than the active default instance. Omitted (e.g. a direct
|
|
35
|
+
* test render) → `getPanelConfig()`, preserving the single-panel path.
|
|
37
36
|
*/
|
|
38
37
|
instanceConfig?: PanelConfig;
|
|
39
38
|
}
|
|
40
|
-
export declare function ImportModal({ onClose, onLoad, colorDefaults, instanceConfig }: ImportModalProps): import("preact").JSX.Element;
|
|
39
|
+
export declare function ImportModal({ onClose, onLoad, colorDefaults, current, instanceConfig, }: ImportModalProps): import("preact").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as y, jsxs as K, Fragment as kt } from "preact/jsx-runtime";
|
|
2
2
|
import { useEffect as P, useState as Y, useRef as O, useMemo as J, useCallback as X } from "preact/hooks";
|
|
3
|
-
import { b as ft, p as wt, u as ht, a as Ne, A as bt, Z as gt } from "./index-
|
|
4
|
-
import { g as vt, m as j } from "./panel-config-
|
|
3
|
+
import { b as ft, p as wt, u as ht, a as Ne, A as bt, Z as gt } from "./index-blRjSavc.js";
|
|
4
|
+
import { g as vt, m as j } from "./panel-config-DKfob-1r.js";
|
|
5
5
|
const xt = (e, o) => {
|
|
6
6
|
const t = new Array(e.length + o.length);
|
|
7
7
|
for (let r = 0; r < e.length; r++)
|