@dreamtree-org/twreact-ui 1.2.1 → 1.3.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/DESIGN.md +118 -0
- package/README.md +52 -34
- package/ai-skills/dreamtree-ui.md +27 -0
- package/dist/components/blocks/AppShell.d.ts +4 -0
- package/dist/components/blocks/AppShell.d.ts.map +1 -0
- package/dist/components/blocks/ConfirmDialog.d.ts +4 -0
- package/dist/components/blocks/ConfirmDialog.d.ts.map +1 -0
- package/dist/components/blocks/EmptyState.d.ts +4 -0
- package/dist/components/blocks/EmptyState.d.ts.map +1 -0
- package/dist/components/blocks/ErrorState.d.ts +4 -0
- package/dist/components/blocks/ErrorState.d.ts.map +1 -0
- package/dist/components/blocks/LoadingState.d.ts +9 -0
- package/dist/components/blocks/LoadingState.d.ts.map +1 -0
- package/dist/components/blocks/PageHeader.d.ts +4 -0
- package/dist/components/blocks/PageHeader.d.ts.map +1 -0
- package/dist/components/blocks/StatCard.d.ts +4 -0
- package/dist/components/blocks/StatCard.d.ts.map +1 -0
- package/dist/components/blocks/StatusPill.d.ts +5 -0
- package/dist/components/blocks/StatusPill.d.ts.map +1 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +48 -38
- package/dist/index.esm.css +1 -1
- package/dist/index.esm.js +958 -268
- package/dist/index.js +965 -267
- package/dist/tokens/brands/default.css +1 -0
- package/dist/tokens/brands/default.json +5 -0
- package/dist/tokens/brands/practicepro.css +17 -0
- package/dist/tokens/brands/practicepro.json +27 -0
- package/dist/tokens/tailwind3-preset.cjs +214 -0
- package/dist/tokens/theme.css +193 -0
- package/dist/tokens/tokens.json +373 -0
- package/dist/tokens/vars.css +98 -0
- package/dist/types/blocks.d.ts +109 -0
- package/dist/types/blocks.d.ts.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/doc/README.md +19 -0
- package/mcp/catalog.snapshot.json +398 -3
- package/package.json +11 -5
- package/tokens/brands/default.json +5 -0
- package/tokens/brands/practicepro.json +27 -0
- package/tokens/lib.cjs +128 -0
- package/tokens/tokens.json +133 -0
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$description": "Dreamtree design tokens (W3C Design Tokens Community Group format, 2025.10). Source of truth for twreact-ui's CSS variables, the Tailwind 3 preset, the Tailwind 4 theme and DESIGN.md. Products override only a brand file in tokens/brands/. Dark values live in $extensions[\"org.dreamtree.dark\"].",
|
|
3
|
+
"color": {
|
|
4
|
+
"$type": "color",
|
|
5
|
+
"primary": {
|
|
6
|
+
"50": {
|
|
7
|
+
"$value": "#eff6ff"
|
|
8
|
+
},
|
|
9
|
+
"100": {
|
|
10
|
+
"$value": "#dbeafe"
|
|
11
|
+
},
|
|
12
|
+
"200": {
|
|
13
|
+
"$value": "#bfdbfe"
|
|
14
|
+
},
|
|
15
|
+
"300": {
|
|
16
|
+
"$value": "#93c5fd"
|
|
17
|
+
},
|
|
18
|
+
"400": {
|
|
19
|
+
"$value": "#60a5fa"
|
|
20
|
+
},
|
|
21
|
+
"500": {
|
|
22
|
+
"$value": "#3b82f6"
|
|
23
|
+
},
|
|
24
|
+
"600": {
|
|
25
|
+
"$value": "#2563eb"
|
|
26
|
+
},
|
|
27
|
+
"700": {
|
|
28
|
+
"$value": "#1d4ed8"
|
|
29
|
+
},
|
|
30
|
+
"800": {
|
|
31
|
+
"$value": "#1e40af"
|
|
32
|
+
},
|
|
33
|
+
"900": {
|
|
34
|
+
"$value": "#1e3a8a"
|
|
35
|
+
},
|
|
36
|
+
"950": {
|
|
37
|
+
"$value": "#172554"
|
|
38
|
+
},
|
|
39
|
+
"$description": "The one accent: primary actions, active navigation, current step, progress, links and the focus ring. Default is Tailwind blue, which twreact-ui has always shipped."
|
|
40
|
+
},
|
|
41
|
+
"secondary": {
|
|
42
|
+
"50": {
|
|
43
|
+
"$value": "#f8fafc"
|
|
44
|
+
},
|
|
45
|
+
"100": {
|
|
46
|
+
"$value": "#f1f5f9"
|
|
47
|
+
},
|
|
48
|
+
"200": {
|
|
49
|
+
"$value": "#e2e8f0"
|
|
50
|
+
},
|
|
51
|
+
"300": {
|
|
52
|
+
"$value": "#cbd5e1"
|
|
53
|
+
},
|
|
54
|
+
"400": {
|
|
55
|
+
"$value": "#94a3b8"
|
|
56
|
+
},
|
|
57
|
+
"500": {
|
|
58
|
+
"$value": "#64748b"
|
|
59
|
+
},
|
|
60
|
+
"600": {
|
|
61
|
+
"$value": "#475569"
|
|
62
|
+
},
|
|
63
|
+
"700": {
|
|
64
|
+
"$value": "#334155"
|
|
65
|
+
},
|
|
66
|
+
"800": {
|
|
67
|
+
"$value": "#1e293b"
|
|
68
|
+
},
|
|
69
|
+
"900": {
|
|
70
|
+
"$value": "#0f172a"
|
|
71
|
+
},
|
|
72
|
+
"950": {
|
|
73
|
+
"$value": "#020617"
|
|
74
|
+
},
|
|
75
|
+
"$description": "Neutral slate for secondary buttons, muted text and the default app shell."
|
|
76
|
+
},
|
|
77
|
+
"success": {
|
|
78
|
+
"50": {
|
|
79
|
+
"$value": "#f0fdf4"
|
|
80
|
+
},
|
|
81
|
+
"100": {
|
|
82
|
+
"$value": "#dcfce7"
|
|
83
|
+
},
|
|
84
|
+
"200": {
|
|
85
|
+
"$value": "#bbf7d0"
|
|
86
|
+
},
|
|
87
|
+
"300": {
|
|
88
|
+
"$value": "#86efac"
|
|
89
|
+
},
|
|
90
|
+
"400": {
|
|
91
|
+
"$value": "#4ade80"
|
|
92
|
+
},
|
|
93
|
+
"500": {
|
|
94
|
+
"$value": "#22c55e"
|
|
95
|
+
},
|
|
96
|
+
"600": {
|
|
97
|
+
"$value": "#16a34a"
|
|
98
|
+
},
|
|
99
|
+
"700": {
|
|
100
|
+
"$value": "#15803d"
|
|
101
|
+
},
|
|
102
|
+
"800": {
|
|
103
|
+
"$value": "#166534"
|
|
104
|
+
},
|
|
105
|
+
"900": {
|
|
106
|
+
"$value": "#14532d"
|
|
107
|
+
},
|
|
108
|
+
"950": {
|
|
109
|
+
"$value": "#052e16"
|
|
110
|
+
},
|
|
111
|
+
"$description": "Completed, filed, accepted, healthy. Badges use the 100 fill with 800 text."
|
|
112
|
+
},
|
|
113
|
+
"warning": {
|
|
114
|
+
"50": {
|
|
115
|
+
"$value": "#fffbeb"
|
|
116
|
+
},
|
|
117
|
+
"100": {
|
|
118
|
+
"$value": "#fef3c7"
|
|
119
|
+
},
|
|
120
|
+
"200": {
|
|
121
|
+
"$value": "#fde68a"
|
|
122
|
+
},
|
|
123
|
+
"300": {
|
|
124
|
+
"$value": "#fcd34d"
|
|
125
|
+
},
|
|
126
|
+
"400": {
|
|
127
|
+
"$value": "#fbbf24"
|
|
128
|
+
},
|
|
129
|
+
"500": {
|
|
130
|
+
"$value": "#f59e0b"
|
|
131
|
+
},
|
|
132
|
+
"600": {
|
|
133
|
+
"$value": "#d97706"
|
|
134
|
+
},
|
|
135
|
+
"700": {
|
|
136
|
+
"$value": "#b45309"
|
|
137
|
+
},
|
|
138
|
+
"800": {
|
|
139
|
+
"$value": "#92400e"
|
|
140
|
+
},
|
|
141
|
+
"900": {
|
|
142
|
+
"$value": "#78350f"
|
|
143
|
+
},
|
|
144
|
+
"950": {
|
|
145
|
+
"$value": "#451a03"
|
|
146
|
+
},
|
|
147
|
+
"$description": "Needs attention soon: at risk, pending, in review."
|
|
148
|
+
},
|
|
149
|
+
"error": {
|
|
150
|
+
"50": {
|
|
151
|
+
"$value": "#fef2f2"
|
|
152
|
+
},
|
|
153
|
+
"100": {
|
|
154
|
+
"$value": "#fee2e2"
|
|
155
|
+
},
|
|
156
|
+
"200": {
|
|
157
|
+
"$value": "#fecaca"
|
|
158
|
+
},
|
|
159
|
+
"300": {
|
|
160
|
+
"$value": "#fca5a5"
|
|
161
|
+
},
|
|
162
|
+
"400": {
|
|
163
|
+
"$value": "#f87171"
|
|
164
|
+
},
|
|
165
|
+
"500": {
|
|
166
|
+
"$value": "#ef4444"
|
|
167
|
+
},
|
|
168
|
+
"600": {
|
|
169
|
+
"$value": "#dc2626"
|
|
170
|
+
},
|
|
171
|
+
"700": {
|
|
172
|
+
"$value": "#b91c1c"
|
|
173
|
+
},
|
|
174
|
+
"800": {
|
|
175
|
+
"$value": "#991b1b"
|
|
176
|
+
},
|
|
177
|
+
"900": {
|
|
178
|
+
"$value": "#7f1d1d"
|
|
179
|
+
},
|
|
180
|
+
"950": {
|
|
181
|
+
"$value": "#450a0a"
|
|
182
|
+
},
|
|
183
|
+
"$description": "Errors, overdue and destructive actions only. Never decoration."
|
|
184
|
+
},
|
|
185
|
+
"info": {
|
|
186
|
+
"50": {
|
|
187
|
+
"$value": "#f0f9ff"
|
|
188
|
+
},
|
|
189
|
+
"100": {
|
|
190
|
+
"$value": "#e0f2fe"
|
|
191
|
+
},
|
|
192
|
+
"200": {
|
|
193
|
+
"$value": "#bae6fd"
|
|
194
|
+
},
|
|
195
|
+
"300": {
|
|
196
|
+
"$value": "#7dd3fc"
|
|
197
|
+
},
|
|
198
|
+
"400": {
|
|
199
|
+
"$value": "#38bdf8"
|
|
200
|
+
},
|
|
201
|
+
"500": {
|
|
202
|
+
"$value": "#0ea5e9"
|
|
203
|
+
},
|
|
204
|
+
"600": {
|
|
205
|
+
"$value": "#0284c7"
|
|
206
|
+
},
|
|
207
|
+
"700": {
|
|
208
|
+
"$value": "#0369a1"
|
|
209
|
+
},
|
|
210
|
+
"800": {
|
|
211
|
+
"$value": "#075985"
|
|
212
|
+
},
|
|
213
|
+
"900": {
|
|
214
|
+
"$value": "#0c4a6e"
|
|
215
|
+
},
|
|
216
|
+
"950": {
|
|
217
|
+
"$value": "#082f49"
|
|
218
|
+
},
|
|
219
|
+
"$description": "Informational and scheduled states that are not the brand accent."
|
|
220
|
+
},
|
|
221
|
+
"gray": {
|
|
222
|
+
"50": {
|
|
223
|
+
"$value": "#f9fafb"
|
|
224
|
+
},
|
|
225
|
+
"100": {
|
|
226
|
+
"$value": "#f3f4f6"
|
|
227
|
+
},
|
|
228
|
+
"200": {
|
|
229
|
+
"$value": "#e5e7eb"
|
|
230
|
+
},
|
|
231
|
+
"300": {
|
|
232
|
+
"$value": "#d1d5db"
|
|
233
|
+
},
|
|
234
|
+
"400": {
|
|
235
|
+
"$value": "#9ca3af"
|
|
236
|
+
},
|
|
237
|
+
"500": {
|
|
238
|
+
"$value": "#6b7280"
|
|
239
|
+
},
|
|
240
|
+
"600": {
|
|
241
|
+
"$value": "#4b5563"
|
|
242
|
+
},
|
|
243
|
+
"700": {
|
|
244
|
+
"$value": "#374151"
|
|
245
|
+
},
|
|
246
|
+
"800": {
|
|
247
|
+
"$value": "#1f2937"
|
|
248
|
+
},
|
|
249
|
+
"900": {
|
|
250
|
+
"$value": "#111827"
|
|
251
|
+
},
|
|
252
|
+
"950": {
|
|
253
|
+
"$value": "#030712"
|
|
254
|
+
},
|
|
255
|
+
"$description": "Borders, dividers and quiet fills. Matches Tailwind gray so existing twreact-ui classes keep their look."
|
|
256
|
+
}
|
|
257
|
+
},
|
|
258
|
+
"role": {
|
|
259
|
+
"$type": "color",
|
|
260
|
+
"$description": "Semantic surface and text roles. Screens use these (bg-surface, text-foreground, border-line) instead of picking palette steps.",
|
|
261
|
+
"background": {
|
|
262
|
+
"$value": "#f8fafc",
|
|
263
|
+
"$description": "Page background.",
|
|
264
|
+
"$extensions": {
|
|
265
|
+
"org.dreamtree.dark": "#0b1120"
|
|
266
|
+
}
|
|
267
|
+
},
|
|
268
|
+
"surface": {
|
|
269
|
+
"$value": "#ffffff",
|
|
270
|
+
"$description": "Cards, dialogs, menus.",
|
|
271
|
+
"$extensions": {
|
|
272
|
+
"org.dreamtree.dark": "#111827"
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
"foreground": {
|
|
276
|
+
"$value": "#0f172a",
|
|
277
|
+
"$description": "Body text and titles.",
|
|
278
|
+
"$extensions": {
|
|
279
|
+
"org.dreamtree.dark": "#e5e7eb"
|
|
280
|
+
}
|
|
281
|
+
},
|
|
282
|
+
"muted": {
|
|
283
|
+
"$value": "#475569",
|
|
284
|
+
"$description": "Subtitles, labels, captions (7.5:1 on white).",
|
|
285
|
+
"$extensions": {
|
|
286
|
+
"org.dreamtree.dark": "#94a3b8"
|
|
287
|
+
}
|
|
288
|
+
},
|
|
289
|
+
"line": {
|
|
290
|
+
"$value": "#e2e8f0",
|
|
291
|
+
"$description": "Card and divider borders.",
|
|
292
|
+
"$extensions": {
|
|
293
|
+
"org.dreamtree.dark": "#1f2937"
|
|
294
|
+
}
|
|
295
|
+
},
|
|
296
|
+
"shell": {
|
|
297
|
+
"$value": "#0f172a",
|
|
298
|
+
"$description": "App shell sidebar background.",
|
|
299
|
+
"$extensions": {
|
|
300
|
+
"org.dreamtree.dark": "#020617"
|
|
301
|
+
}
|
|
302
|
+
},
|
|
303
|
+
"shell-foreground": {
|
|
304
|
+
"$value": "#cbd5e1",
|
|
305
|
+
"$description": "Sidebar text.",
|
|
306
|
+
"$extensions": {
|
|
307
|
+
"org.dreamtree.dark": "#cbd5e1"
|
|
308
|
+
}
|
|
309
|
+
},
|
|
310
|
+
"shell-active": {
|
|
311
|
+
"$value": "#1e293b",
|
|
312
|
+
"$description": "Active sidebar item fill.",
|
|
313
|
+
"$extensions": {
|
|
314
|
+
"org.dreamtree.dark": "#1e293b"
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
},
|
|
318
|
+
"font": {
|
|
319
|
+
"family": {
|
|
320
|
+
"$type": "fontFamily",
|
|
321
|
+
"sans": {
|
|
322
|
+
"$value": [
|
|
323
|
+
"Inter",
|
|
324
|
+
"system-ui",
|
|
325
|
+
"-apple-system",
|
|
326
|
+
"Segoe UI",
|
|
327
|
+
"Roboto",
|
|
328
|
+
"Arial",
|
|
329
|
+
"sans-serif"
|
|
330
|
+
]
|
|
331
|
+
},
|
|
332
|
+
"mono": {
|
|
333
|
+
"$value": [
|
|
334
|
+
"JetBrains Mono",
|
|
335
|
+
"ui-monospace",
|
|
336
|
+
"SFMono-Regular",
|
|
337
|
+
"Menlo",
|
|
338
|
+
"monospace"
|
|
339
|
+
]
|
|
340
|
+
}
|
|
341
|
+
},
|
|
342
|
+
"size": {
|
|
343
|
+
"$type": "dimension",
|
|
344
|
+
"$description": "Type scale. micro replaces the 1,445 hand-written text-[10px]/text-[11px] found across products.",
|
|
345
|
+
"micro": {
|
|
346
|
+
"$value": {
|
|
347
|
+
"value": 0.6875,
|
|
348
|
+
"unit": "rem"
|
|
349
|
+
},
|
|
350
|
+
"$extensions": {
|
|
351
|
+
"org.dreamtree.lineHeight": "1rem"
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
},
|
|
356
|
+
"radius": {
|
|
357
|
+
"$type": "dimension",
|
|
358
|
+
"control": {
|
|
359
|
+
"$value": {
|
|
360
|
+
"value": 0.5,
|
|
361
|
+
"unit": "rem"
|
|
362
|
+
},
|
|
363
|
+
"$description": "Buttons, inputs, menus."
|
|
364
|
+
},
|
|
365
|
+
"card": {
|
|
366
|
+
"$value": {
|
|
367
|
+
"value": 0.75,
|
|
368
|
+
"unit": "rem"
|
|
369
|
+
},
|
|
370
|
+
"$description": "Cards and dialogs."
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--dt-primary-50: 239 246 255;
|
|
3
|
+
--dt-primary-100: 219 234 254;
|
|
4
|
+
--dt-primary-200: 191 219 254;
|
|
5
|
+
--dt-primary-300: 147 197 253;
|
|
6
|
+
--dt-primary-400: 96 165 250;
|
|
7
|
+
--dt-primary-500: 59 130 246;
|
|
8
|
+
--dt-primary-600: 37 99 235;
|
|
9
|
+
--dt-primary-700: 29 78 216;
|
|
10
|
+
--dt-primary-800: 30 64 175;
|
|
11
|
+
--dt-primary-900: 30 58 138;
|
|
12
|
+
--dt-primary-950: 23 37 84;
|
|
13
|
+
--dt-secondary-50: 248 250 252;
|
|
14
|
+
--dt-secondary-100: 241 245 249;
|
|
15
|
+
--dt-secondary-200: 226 232 240;
|
|
16
|
+
--dt-secondary-300: 203 213 225;
|
|
17
|
+
--dt-secondary-400: 148 163 184;
|
|
18
|
+
--dt-secondary-500: 100 116 139;
|
|
19
|
+
--dt-secondary-600: 71 85 105;
|
|
20
|
+
--dt-secondary-700: 51 65 85;
|
|
21
|
+
--dt-secondary-800: 30 41 59;
|
|
22
|
+
--dt-secondary-900: 15 23 42;
|
|
23
|
+
--dt-secondary-950: 2 6 23;
|
|
24
|
+
--dt-success-50: 240 253 244;
|
|
25
|
+
--dt-success-100: 220 252 231;
|
|
26
|
+
--dt-success-200: 187 247 208;
|
|
27
|
+
--dt-success-300: 134 239 172;
|
|
28
|
+
--dt-success-400: 74 222 128;
|
|
29
|
+
--dt-success-500: 34 197 94;
|
|
30
|
+
--dt-success-600: 22 163 74;
|
|
31
|
+
--dt-success-700: 21 128 61;
|
|
32
|
+
--dt-success-800: 22 101 52;
|
|
33
|
+
--dt-success-900: 20 83 45;
|
|
34
|
+
--dt-success-950: 5 46 22;
|
|
35
|
+
--dt-warning-50: 255 251 235;
|
|
36
|
+
--dt-warning-100: 254 243 199;
|
|
37
|
+
--dt-warning-200: 253 230 138;
|
|
38
|
+
--dt-warning-300: 252 211 77;
|
|
39
|
+
--dt-warning-400: 251 191 36;
|
|
40
|
+
--dt-warning-500: 245 158 11;
|
|
41
|
+
--dt-warning-600: 217 119 6;
|
|
42
|
+
--dt-warning-700: 180 83 9;
|
|
43
|
+
--dt-warning-800: 146 64 14;
|
|
44
|
+
--dt-warning-900: 120 53 15;
|
|
45
|
+
--dt-warning-950: 69 26 3;
|
|
46
|
+
--dt-error-50: 254 242 242;
|
|
47
|
+
--dt-error-100: 254 226 226;
|
|
48
|
+
--dt-error-200: 254 202 202;
|
|
49
|
+
--dt-error-300: 252 165 165;
|
|
50
|
+
--dt-error-400: 248 113 113;
|
|
51
|
+
--dt-error-500: 239 68 68;
|
|
52
|
+
--dt-error-600: 220 38 38;
|
|
53
|
+
--dt-error-700: 185 28 28;
|
|
54
|
+
--dt-error-800: 153 27 27;
|
|
55
|
+
--dt-error-900: 127 29 29;
|
|
56
|
+
--dt-error-950: 69 10 10;
|
|
57
|
+
--dt-info-50: 240 249 255;
|
|
58
|
+
--dt-info-100: 224 242 254;
|
|
59
|
+
--dt-info-200: 186 230 253;
|
|
60
|
+
--dt-info-300: 125 211 252;
|
|
61
|
+
--dt-info-400: 56 189 248;
|
|
62
|
+
--dt-info-500: 14 165 233;
|
|
63
|
+
--dt-info-600: 2 132 199;
|
|
64
|
+
--dt-info-700: 3 105 161;
|
|
65
|
+
--dt-info-800: 7 89 133;
|
|
66
|
+
--dt-info-900: 12 74 110;
|
|
67
|
+
--dt-info-950: 8 47 73;
|
|
68
|
+
--dt-gray-50: 249 250 251;
|
|
69
|
+
--dt-gray-100: 243 244 246;
|
|
70
|
+
--dt-gray-200: 229 231 235;
|
|
71
|
+
--dt-gray-300: 209 213 219;
|
|
72
|
+
--dt-gray-400: 156 163 175;
|
|
73
|
+
--dt-gray-500: 107 114 128;
|
|
74
|
+
--dt-gray-600: 75 85 99;
|
|
75
|
+
--dt-gray-700: 55 65 81;
|
|
76
|
+
--dt-gray-800: 31 41 55;
|
|
77
|
+
--dt-gray-900: 17 24 39;
|
|
78
|
+
--dt-gray-950: 3 7 18;
|
|
79
|
+
--dt-background: 248 250 252;
|
|
80
|
+
--dt-surface: 255 255 255;
|
|
81
|
+
--dt-foreground: 15 23 42;
|
|
82
|
+
--dt-muted: 71 85 105;
|
|
83
|
+
--dt-line: 226 232 240;
|
|
84
|
+
--dt-shell: 15 23 42;
|
|
85
|
+
--dt-shell-foreground: 203 213 225;
|
|
86
|
+
--dt-shell-active: 30 41 59;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.dark, [data-theme="dark"] {
|
|
90
|
+
--dt-background: 11 17 32;
|
|
91
|
+
--dt-surface: 17 24 39;
|
|
92
|
+
--dt-foreground: 229 231 235;
|
|
93
|
+
--dt-muted: 148 163 184;
|
|
94
|
+
--dt-line: 31 41 55;
|
|
95
|
+
--dt-shell: 2 6 23;
|
|
96
|
+
--dt-shell-foreground: 203 213 225;
|
|
97
|
+
--dt-shell-active: 30 41 59;
|
|
98
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import type { ElementType, ReactNode } from 'react';
|
|
2
|
+
import type { BaseComponentProps } from './index';
|
|
3
|
+
/** Semantic tone shared by StatCard and StatusPill. */
|
|
4
|
+
export type Tone = 'primary' | 'secondary' | 'success' | 'warning' | 'error' | 'info';
|
|
5
|
+
export interface AppShellNavItem {
|
|
6
|
+
id: string;
|
|
7
|
+
label: string;
|
|
8
|
+
href?: string;
|
|
9
|
+
icon?: ReactNode;
|
|
10
|
+
active?: boolean;
|
|
11
|
+
/** Small count badge, e.g. pending approvals. Hidden when 0 or undefined. */
|
|
12
|
+
count?: number;
|
|
13
|
+
/** Optional group heading the item sits under. */
|
|
14
|
+
group?: string;
|
|
15
|
+
onClick?: () => void;
|
|
16
|
+
}
|
|
17
|
+
export interface AppShellProps extends BaseComponentProps {
|
|
18
|
+
/** Product mark shown at the top of the sidebar and in the mobile top bar. */
|
|
19
|
+
brand: ReactNode;
|
|
20
|
+
nav: AppShellNavItem[];
|
|
21
|
+
/** Pinned to the bottom of the sidebar (user menu, workspace switcher). */
|
|
22
|
+
sidebarFooter?: ReactNode;
|
|
23
|
+
/** Content for the right side of the top bar (search, notifications, avatar). */
|
|
24
|
+
topbar?: ReactNode;
|
|
25
|
+
/** Title shown in the mobile top bar. */
|
|
26
|
+
pageTitle?: string;
|
|
27
|
+
/** Element used for nav links, e.g. Next.js `Link`. Defaults to `a`. */
|
|
28
|
+
linkAs?: ElementType;
|
|
29
|
+
children?: ReactNode;
|
|
30
|
+
}
|
|
31
|
+
export interface PageHeaderProps extends BaseComponentProps {
|
|
32
|
+
title: ReactNode;
|
|
33
|
+
subtitle?: ReactNode;
|
|
34
|
+
/** Buttons on the right. Keep one primary action per page. */
|
|
35
|
+
actions?: ReactNode;
|
|
36
|
+
/** Back link for detail pages. */
|
|
37
|
+
back?: {
|
|
38
|
+
href: string;
|
|
39
|
+
label: string;
|
|
40
|
+
};
|
|
41
|
+
linkAs?: ElementType;
|
|
42
|
+
}
|
|
43
|
+
export interface StatCardChange {
|
|
44
|
+
value: number;
|
|
45
|
+
/** e.g. "vs last week". */
|
|
46
|
+
period?: string;
|
|
47
|
+
unit?: '%' | '';
|
|
48
|
+
/** Whether an increase is good (green). Defaults to true. */
|
|
49
|
+
goodWhenUp?: boolean;
|
|
50
|
+
}
|
|
51
|
+
export interface StatCardProps extends BaseComponentProps {
|
|
52
|
+
label: ReactNode;
|
|
53
|
+
value: ReactNode;
|
|
54
|
+
icon?: ReactNode;
|
|
55
|
+
tone?: Tone;
|
|
56
|
+
change?: StatCardChange;
|
|
57
|
+
/** Shows a skeleton instead of the value. */
|
|
58
|
+
loading?: boolean;
|
|
59
|
+
}
|
|
60
|
+
export type StatusTone = 'neutral' | 'info' | 'success' | 'warning' | 'danger' | 'muted';
|
|
61
|
+
export interface StatusPillProps extends BaseComponentProps {
|
|
62
|
+
/** Look the status up in `map`. Unknown statuses render humanized ("in_review" → "In review"), never raw. */
|
|
63
|
+
status?: string;
|
|
64
|
+
map?: Record<string, {
|
|
65
|
+
label: string;
|
|
66
|
+
tone: StatusTone;
|
|
67
|
+
icon?: ReactNode;
|
|
68
|
+
}>;
|
|
69
|
+
/** Used when no `status`/`map` is given. Accepts a status tone or a semantic tone. */
|
|
70
|
+
tone?: StatusTone | Tone;
|
|
71
|
+
icon?: ReactNode;
|
|
72
|
+
children?: ReactNode;
|
|
73
|
+
}
|
|
74
|
+
export interface EmptyStateProps extends BaseComponentProps {
|
|
75
|
+
title: ReactNode;
|
|
76
|
+
description?: ReactNode;
|
|
77
|
+
icon?: ReactNode;
|
|
78
|
+
/** Primary or outlined button that resolves the empty state. */
|
|
79
|
+
action?: ReactNode;
|
|
80
|
+
compact?: boolean;
|
|
81
|
+
}
|
|
82
|
+
export interface ErrorStateProps extends BaseComponentProps {
|
|
83
|
+
title?: ReactNode;
|
|
84
|
+
description?: ReactNode;
|
|
85
|
+
onRetry?: () => void;
|
|
86
|
+
retryLabel?: string;
|
|
87
|
+
}
|
|
88
|
+
export interface LoadingStateProps extends BaseComponentProps {
|
|
89
|
+
/** Shape of the skeleton; match the content that will replace it. */
|
|
90
|
+
variant?: 'table' | 'cards' | 'stats' | 'detail';
|
|
91
|
+
rows?: number;
|
|
92
|
+
/** Screen-reader text. */
|
|
93
|
+
label?: string;
|
|
94
|
+
}
|
|
95
|
+
export interface ConfirmDialogProps extends BaseComponentProps {
|
|
96
|
+
isOpen: boolean;
|
|
97
|
+
/** The action as a question: "Remove Kiran from Diwali buyers?" */
|
|
98
|
+
title: string;
|
|
99
|
+
/** One line saying what will happen. */
|
|
100
|
+
description?: ReactNode;
|
|
101
|
+
/** Named with the verb ("Remove"), never "OK". */
|
|
102
|
+
confirmLabel: string;
|
|
103
|
+
cancelLabel?: string;
|
|
104
|
+
destructive?: boolean;
|
|
105
|
+
loading?: boolean;
|
|
106
|
+
onConfirm: () => void;
|
|
107
|
+
onCancel: () => void;
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=blocks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blocks.d.ts","sourceRoot":"","sources":["../../src/types/blocks.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD,uDAAuD;AACvD,MAAM,MAAM,IAAI,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;AAEtF,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;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