@kolkrabbi/kol-theme 0.5.0 → 0.7.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.
@@ -0,0 +1,348 @@
1
+ /* ---------------------------------------------------------------------------
2
+ * Dashboard Grid — responsive via container queries
3
+ * --------------------------------------------------------------------------- */
4
+
5
+ .dash-grid {
6
+ display: grid;
7
+ grid-auto-flow: dense;
8
+ grid-template-columns: repeat(2, 1fr);
9
+ grid-auto-rows: minmax(240px, auto);
10
+ gap: 1rem;
11
+ width: 100%;
12
+ align-items: stretch;
13
+ }
14
+
15
+ @container (min-width: 540px) {
16
+ .dash-grid { grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }
17
+ }
18
+ @container (min-width: 1024px) {
19
+ .dash-grid { gap: 1.5rem; }
20
+ }
21
+
22
+ /* On 2-col mobile grid, clamp oversized spans via data attribute + !important
23
+ to override inline styles. At 540px+ the grid is 4-col so no clamping needed. */
24
+ @container (max-width: 539px) {
25
+ .dash-grid > [data-cols="3"],
26
+ .dash-grid > [data-cols="4"] {
27
+ grid-column: span 2 !important;
28
+ }
29
+ }
30
+
31
+ /* ---------------------------------------------------------------------------
32
+ * Dashboard Card Base
33
+ * --------------------------------------------------------------------------- */
34
+
35
+ .dash-card {
36
+ display: flex;
37
+ flex-direction: column;
38
+ gap: 1rem;
39
+ padding: 1rem;
40
+ background-color: color-mix(in srgb, var(--kol-surface-on-primary, currentColor) 2%, transparent);
41
+ border: 1px solid color-mix(in srgb, var(--kol-surface-on-primary, currentColor) 4%, transparent);
42
+ border-radius: 0.25rem;
43
+ overflow: visible;
44
+ min-height: 0;
45
+ }
46
+
47
+ @container (min-width: 768px) {
48
+ .dash-card {
49
+ padding: 1.5rem;
50
+ }
51
+ }
52
+
53
+ @container (min-width: 1024px) {
54
+ .dash-card {
55
+ padding: 2rem;
56
+ }
57
+ }
58
+
59
+ .dash-card__footer {
60
+ margin-top: auto;
61
+ padding-top: 1rem;
62
+ border-top: 1px solid color-mix(in srgb, var(--kol-surface-on-primary, currentColor) 8%, transparent);
63
+ }
64
+
65
+ /* ---------------------------------------------------------------------------
66
+ * Dashboard Typography (JetBrains Mono)
67
+ * --------------------------------------------------------------------------- */
68
+
69
+ /* Card titles — 16px → 20px, medium weight */
70
+ .dash-title {
71
+ font-family: var(--kol-font-family-mono);
72
+ font-weight: 500;
73
+ font-size: 16px;
74
+ line-height: 120%;
75
+ color: var(--kol-surface-on-primary);
76
+ }
77
+
78
+ @container (min-width: 768px) {
79
+ .dash-title {
80
+ font-size: 20px;
81
+ }
82
+ }
83
+
84
+ /* Big metric values — 24px → 32px, medium weight */
85
+ .dash-value {
86
+ font-family: var(--kol-font-family-mono);
87
+ font-weight: 500;
88
+ font-size: 24px;
89
+ line-height: 1;
90
+ color: var(--kol-surface-on-primary);
91
+ }
92
+
93
+ @container (min-width: 768px) {
94
+ .dash-value {
95
+ font-size: 28px;
96
+ }
97
+ }
98
+
99
+ @container (min-width: 1024px) {
100
+ .dash-value {
101
+ font-size: 32px;
102
+ }
103
+ }
104
+
105
+ /* Sub-headings — 16px → 22px, medium weight */
106
+ .dash-subtitle {
107
+ font-family: var(--kol-font-family-mono);
108
+ font-weight: 500;
109
+ font-size: 16px;
110
+ line-height: 125%;
111
+ color: var(--kol-surface-on-primary);
112
+ }
113
+
114
+ @container (min-width: 768px) {
115
+ .dash-subtitle {
116
+ font-size: 22px;
117
+ }
118
+ }
119
+
120
+ /* List items, descriptions — 12px → 14px, regular weight */
121
+ .dash-body {
122
+ font-family: var(--kol-font-family-mono);
123
+ font-weight: 400;
124
+ font-size: 12px;
125
+ line-height: 125%;
126
+ color: var(--kol-surface-on-primary);
127
+ }
128
+
129
+ @container (min-width: 768px) {
130
+ .dash-body {
131
+ font-size: 14px;
132
+ }
133
+ }
134
+
135
+ /* Footers, secondary text — 10px → 12px, regular weight */
136
+ .dash-detail {
137
+ font-family: var(--kol-font-family-mono);
138
+ font-weight: 400;
139
+ font-size: 10px;
140
+ line-height: 1;
141
+ color: var(--kol-surface-on-primary);
142
+ }
143
+
144
+ @container (min-width: 768px) {
145
+ .dash-detail {
146
+ font-size: 12px;
147
+ }
148
+ }
149
+
150
+ /* Chart axes, compact items, legends — 8px → 11px, regular weight */
151
+ .dash-caption {
152
+ font-family: var(--kol-font-family-mono);
153
+ font-weight: 400;
154
+ font-size: 8px;
155
+ line-height: 1;
156
+ color: var(--kol-surface-on-primary);
157
+ }
158
+
159
+ @container (min-width: 768px) {
160
+ .dash-caption {
161
+ font-size: 10px;
162
+ }
163
+ }
164
+
165
+ @container (min-width: 1024px) {
166
+ .dash-caption {
167
+ font-size: 11px;
168
+ }
169
+ }
170
+
171
+ /* ---------------------------------------------------------------------------
172
+ * Chart Utilities
173
+ * --------------------------------------------------------------------------- */
174
+
175
+ .chart__dot {
176
+ width: 8px;
177
+ height: 8px;
178
+ border-radius: 999px;
179
+ background-color: var(--chart-color-value, var(--kol-accent-primary));
180
+ transition: opacity 0.2s ease;
181
+ }
182
+
183
+ .chart__segment {
184
+ stroke: var(--chart-color-value, var(--kol-accent-primary));
185
+ fill: none;
186
+ transition: opacity 0.2s ease;
187
+ }
188
+
189
+ .chart__bar-fill {
190
+ height: 100%;
191
+ border-radius: 999px;
192
+ background-color: var(--chart-color-value, var(--kol-accent-primary));
193
+ transition: width 0.3s ease, opacity 0.2s ease;
194
+ }
195
+
196
+ .chart__dot.is-muted,
197
+ .chart__segment.is-muted,
198
+ .chart__bar-fill.is-muted {
199
+ opacity: 0.35;
200
+ }
201
+
202
+ /* ---------------------------------------------------------------------------
203
+ * Chart Color Classes (palette-based)
204
+ * --------------------------------------------------------------------------- */
205
+
206
+ .chart-color-blue { --chart-color-value: var(--kol-palette-blue); }
207
+ .chart-color-green { --chart-color-value: var(--kol-palette-green); }
208
+ .chart-color-yellow { --chart-color-value: var(--kol-palette-yellow); }
209
+ .chart-color-red { --chart-color-value: var(--kol-palette-red); }
210
+ .chart-color-orange { --chart-color-value: var(--kol-palette-orange); }
211
+ .chart-color-purple { --chart-color-value: var(--kol-palette-purple); }
212
+ .chart-color-teal { --chart-color-value: var(--kol-palette-teal); }
213
+
214
+ /* ---------------------------------------------------------------------------
215
+ * Chart Tooltips
216
+ * --------------------------------------------------------------------------- */
217
+
218
+ .dash-tooltip {
219
+ position: absolute;
220
+ left: var(--tx);
221
+ top: var(--ty);
222
+ transform: translate(-50%, -110%);
223
+ z-index: 10;
224
+ pointer-events: none;
225
+ display: inline-flex;
226
+ align-items: center;
227
+ padding: 0.125rem 0.25rem;
228
+ background-color: var(--kol-surface-primary);
229
+ border: 1px solid color-mix(in srgb, var(--kol-surface-on-primary, currentColor) 12%, transparent);
230
+ border-radius: 0.25rem;
231
+ white-space: nowrap;
232
+ line-height: 1;
233
+ }
234
+
235
+ .dash-chart-element--active {
236
+ filter: brightness(1.2);
237
+ }
238
+
239
+ /* ---------------------------------------------------------------------------
240
+ * Scatter Plot Hit Area
241
+ * --------------------------------------------------------------------------- */
242
+
243
+ .dash-scatter-point {
244
+ width: 10px;
245
+ height: 10px;
246
+ border-radius: 9999px;
247
+ }
248
+
249
+ .dash-scatter-point::before {
250
+ content: '';
251
+ position: absolute;
252
+ top: 50%;
253
+ left: 50%;
254
+ width: 12px;
255
+ height: 12px;
256
+ transform: translate(-50%, -50%);
257
+ }
258
+
259
+ /* ---------------------------------------------------------------------------
260
+ * List Item Hover
261
+ * --------------------------------------------------------------------------- */
262
+
263
+ .dash-list-item {
264
+ padding: 0.375rem 0.5rem;
265
+ margin: -0.375rem -0.5rem;
266
+ border-radius: 0.25rem;
267
+ transition: background-color 0.15s ease;
268
+ }
269
+
270
+ .dash-list-item:hover {
271
+ background-color: color-mix(in srgb, var(--kol-surface-on-primary) 4%, transparent);
272
+ }
273
+
274
+ .dash-list-item__detail {
275
+ max-height: 0;
276
+ overflow: hidden;
277
+ opacity: 0;
278
+ transition: max-height 0.2s ease, opacity 0.15s ease;
279
+ }
280
+
281
+ .dash-list-item:hover .dash-list-item__detail {
282
+ max-height: 2rem;
283
+ opacity: 1;
284
+ }
285
+
286
+ /* ---------------------------------------------------------------------------
287
+ * Metric Card Cycling
288
+ * --------------------------------------------------------------------------- */
289
+
290
+ .dash-metric--interactive {
291
+ cursor: pointer;
292
+ }
293
+
294
+ .dash-metric-dots {
295
+ display: flex;
296
+ gap: 0.375rem;
297
+ }
298
+
299
+ .dash-metric-dot {
300
+ width: 6px;
301
+ height: 6px;
302
+ border-radius: 9999px;
303
+ background-color: var(--kol-surface-on-primary);
304
+ opacity: 0.3;
305
+ transition: opacity 0.2s ease;
306
+ }
307
+
308
+ .dash-metric-dot--active {
309
+ opacity: 1;
310
+ }
311
+
312
+ .dash-metric-value {
313
+ transition: opacity 0.15s ease;
314
+ }
315
+
316
+ .dash-metric-value--fading {
317
+ opacity: 0;
318
+ }
319
+
320
+ /* ---------------------------------------------------------------------------
321
+ * Line Chart
322
+ * --------------------------------------------------------------------------- */
323
+
324
+ .dash-line-path {
325
+ stroke-width: 2;
326
+ fill: none;
327
+ }
328
+
329
+ .dash-line-area {
330
+ stroke: none;
331
+ }
332
+
333
+ /* ---------------------------------------------------------------------------
334
+ * Donut Chart
335
+ * --------------------------------------------------------------------------- */
336
+
337
+ .dash-donut-segment {
338
+ transition: opacity 0.2s ease;
339
+ }
340
+
341
+ /* ---------------------------------------------------------------------------
342
+ * Heatmap
343
+ * --------------------------------------------------------------------------- */
344
+
345
+ .dash-heatmap-cell {
346
+ border-radius: 2px;
347
+ transition: opacity 0.2s ease, filter 0.2s ease;
348
+ }
@@ -132,16 +132,55 @@
132
132
  color var(--kol-transition-base);
133
133
  }
134
134
 
135
+ /* ─────────────────────────────────────────────────────────────────────
136
+ * Dropdown — molecules/Dropdown.jsx (2026-07-08 chrome law).
137
+ * The trigger IS button chrome: JSX emits kol-btn kol-btn-{primary|
138
+ * outline} kol-btn-{size}, so fills/hover/active/focus come from the
139
+ * button rules. Classes below only add trigger layout + the open/panel
140
+ * fusion: primary = one piece (same fill, no border, no gap, hairline
141
+ * divider inside); outline = bordered pair, trigger's bottom edge is
142
+ * the divider.
143
+ * ───────────────────────────────────────────────────────────────────── */
144
+
145
+ .kol-dd-trigger {
146
+ width: 100%;
147
+ justify-content: space-between;
148
+ }
149
+
150
+ .kol-dd-trigger--open {
151
+ border-radius: var(--kol-radius-sm) var(--kol-radius-sm) 0 0;
152
+ }
153
+
154
+ .kol-dd-panel {
155
+ color: var(--kol-surface-on-primary);
156
+ border-radius: 0 0 var(--kol-radius-sm) var(--kol-radius-sm);
157
+ padding-bottom: 4px;
158
+ }
159
+
160
+ .kol-dd-panel--primary { background-color: var(--kol-surface-secondary); }
161
+
162
+ .kol-dd-panel--outline {
163
+ background-color: var(--kol-surface-primary);
164
+ border: 1px solid var(--kol-oq-16);
165
+ border-top: none;
166
+ }
167
+
168
+ .kol-dd-div {
169
+ height: 1px;
170
+ background-color: var(--kol-border-default);
171
+ margin: 0 12px;
172
+ }
173
+
135
174
  .tag-control:hover {
136
- background-color: color-mix(in srgb, var(--kol-surface-on-primary) 24%, transparent);
175
+ background-color: var(--kol-oq-12);
137
176
  color: var(--kol-surface-on-primary);
138
177
  border-color: transparent;
139
178
  }
140
179
 
141
180
  .tag-control.is-active {
142
- background-color: color-mix(in srgb, var(--kol-surface-on-primary) 24%, transparent);
181
+ background-color: var(--kol-oq-12);
143
182
  color: var(--kol-surface-on-primary);
144
- border-color: color-mix(in srgb, var(--kol-surface-on-primary) 24%, transparent);
183
+ border-color: var(--kol-oq-12);
145
184
  }
146
185
 
147
186
  .tag-sm { font-size: 10px; font-weight: 470; padding: 4px 10px; }
package/kol-theme.css CHANGED
@@ -41,6 +41,8 @@
41
41
  @import "./kol-components-atoms.css" layer(components);
42
42
  @import "./kol-components-molecules.css" layer(components);
43
43
  @import "./kol-components-organisms.css" layer(components);
44
+ @import "./kol-components-dashboards.css" layer(components);
45
+ @import "./kol-components-chess.css" layer(components);
44
46
 
45
47
  /* Theme-level design tokens */
46
48
  @layer components {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kolkrabbi/kol-theme",
3
- "version": "0.5.0",
3
+ "version": "0.7.0",
4
4
  "description": "KOL (Kolkrabbi) design-system tokens + base CSS — brand-neutral. The canonical token/cascade layer every other KOL package and consumer builds on.",
5
5
  "license": "MIT",
6
6
  "type": "module",