@nubitio/dashboard 0.7.4 → 0.8.1
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/dist/index.cjs +800 -106
- package/dist/index.d.cts +237 -20
- package/dist/index.d.mts +237 -20
- package/dist/index.mjs +787 -110
- package/dist/style.css +183 -2
- package/package.json +12 -4
package/dist/style.css
CHANGED
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
grid-template-columns: minmax(0, 1fr);
|
|
60
60
|
}
|
|
61
61
|
.nb-dashboard-section--grid {
|
|
62
|
-
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
|
|
62
|
+
grid-template-columns: var(--nb-dashboard-columns, repeat(auto-fit, minmax(220px, 1fr)));
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
@media (max-width: 1100px) {
|
|
@@ -69,12 +69,102 @@
|
|
|
69
69
|
.nb-dashboard-section--charts {
|
|
70
70
|
grid-template-columns: minmax(0, 1fr);
|
|
71
71
|
}
|
|
72
|
+
.nb-dashboard-section--grid {
|
|
73
|
+
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
|
74
|
+
}
|
|
72
75
|
}
|
|
73
76
|
@media (max-width: 640px) {
|
|
74
|
-
.nb-dashboard-section--stats
|
|
77
|
+
.nb-dashboard-section--stats,
|
|
78
|
+
.nb-dashboard-section--grid {
|
|
75
79
|
grid-template-columns: minmax(0, 1fr);
|
|
76
80
|
}
|
|
77
81
|
}
|
|
82
|
+
.nb-dashboard-layout-controls {
|
|
83
|
+
align-items: center;
|
|
84
|
+
display: flex;
|
|
85
|
+
gap: var(--space-1);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.nb-dashboard-layout-controls__hidden-list {
|
|
89
|
+
display: flex;
|
|
90
|
+
flex-direction: column;
|
|
91
|
+
gap: var(--space-2);
|
|
92
|
+
list-style: none;
|
|
93
|
+
margin: 0;
|
|
94
|
+
min-width: 200px;
|
|
95
|
+
padding: 0;
|
|
96
|
+
}
|
|
97
|
+
.nb-dashboard-layout-controls__hidden-list li {
|
|
98
|
+
align-items: center;
|
|
99
|
+
display: flex;
|
|
100
|
+
justify-content: space-between;
|
|
101
|
+
gap: var(--space-3);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.nb-dashboard-layout-controls__show-btn {
|
|
105
|
+
background: none;
|
|
106
|
+
border: none;
|
|
107
|
+
color: var(--accent-color);
|
|
108
|
+
cursor: pointer;
|
|
109
|
+
font-size: var(--font-size-sm);
|
|
110
|
+
font-weight: var(--font-weight-medium);
|
|
111
|
+
padding: 0;
|
|
112
|
+
}
|
|
113
|
+
.nb-dashboard-layout-controls__show-btn:hover {
|
|
114
|
+
text-decoration: underline;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.nb-dashboard-widget-slot {
|
|
118
|
+
border: 1px dashed var(--border-color);
|
|
119
|
+
border-radius: var(--radius-lg);
|
|
120
|
+
padding: var(--space-2);
|
|
121
|
+
position: relative;
|
|
122
|
+
}
|
|
123
|
+
.nb-dashboard-widget-slot__controls {
|
|
124
|
+
display: flex;
|
|
125
|
+
gap: var(--space-1);
|
|
126
|
+
justify-content: flex-end;
|
|
127
|
+
padding-bottom: var(--space-1);
|
|
128
|
+
}
|
|
129
|
+
.nb-dashboard-widget-slot__btn {
|
|
130
|
+
align-items: center;
|
|
131
|
+
background: var(--surface-2, var(--surface-1));
|
|
132
|
+
border: 1px solid var(--border-color);
|
|
133
|
+
border-radius: var(--radius-sm);
|
|
134
|
+
color: var(--text-secondary);
|
|
135
|
+
cursor: pointer;
|
|
136
|
+
display: inline-flex;
|
|
137
|
+
height: 24px;
|
|
138
|
+
justify-content: center;
|
|
139
|
+
width: 24px;
|
|
140
|
+
}
|
|
141
|
+
.nb-dashboard-widget-slot__btn:hover {
|
|
142
|
+
background: var(--surface-3);
|
|
143
|
+
}
|
|
144
|
+
.nb-dashboard-widget-slot__btn--hide:hover {
|
|
145
|
+
background: color-mix(in srgb, var(--error-color) 14%, transparent);
|
|
146
|
+
color: var(--error-color);
|
|
147
|
+
}
|
|
148
|
+
.nb-dashboard-widget-slot__body {
|
|
149
|
+
pointer-events: none;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.nb-dashboard-widget-slot__error {
|
|
153
|
+
background: color-mix(in srgb, var(--error-color) 10%, transparent);
|
|
154
|
+
border-radius: var(--radius-md);
|
|
155
|
+
color: var(--error-color);
|
|
156
|
+
font-size: var(--font-size-xs);
|
|
157
|
+
margin-bottom: var(--space-2);
|
|
158
|
+
padding: var(--space-2) var(--space-3);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.nb-dashboard-period-filter {
|
|
162
|
+
align-items: center;
|
|
163
|
+
display: flex;
|
|
164
|
+
flex-wrap: wrap;
|
|
165
|
+
gap: var(--space-2);
|
|
166
|
+
}
|
|
167
|
+
|
|
78
168
|
.nb-dashboard-widget__subtitle {
|
|
79
169
|
color: var(--text-tertiary);
|
|
80
170
|
font-size: var(--font-size-xs);
|
|
@@ -254,6 +344,97 @@
|
|
|
254
344
|
font-weight: var(--font-weight-medium);
|
|
255
345
|
}
|
|
256
346
|
|
|
347
|
+
.nb-dashboard-chart-tooltip {
|
|
348
|
+
background: var(--surface-1, var(--surface-0));
|
|
349
|
+
border: 1px solid var(--border-color);
|
|
350
|
+
border-radius: var(--radius-md);
|
|
351
|
+
box-shadow: var(--shadow-md, 0 4px 12px rgba(0, 0, 0, 0.12));
|
|
352
|
+
font-size: var(--font-size-xs);
|
|
353
|
+
padding: var(--space-2) var(--space-3);
|
|
354
|
+
}
|
|
355
|
+
.nb-dashboard-chart-tooltip__label {
|
|
356
|
+
color: var(--text-tertiary);
|
|
357
|
+
font-weight: var(--font-weight-medium);
|
|
358
|
+
margin-bottom: var(--space-1);
|
|
359
|
+
}
|
|
360
|
+
.nb-dashboard-chart-tooltip__items {
|
|
361
|
+
display: flex;
|
|
362
|
+
flex-direction: column;
|
|
363
|
+
gap: var(--space-1);
|
|
364
|
+
list-style: none;
|
|
365
|
+
margin: 0;
|
|
366
|
+
padding: 0;
|
|
367
|
+
}
|
|
368
|
+
.nb-dashboard-chart-tooltip__item {
|
|
369
|
+
align-items: center;
|
|
370
|
+
display: grid;
|
|
371
|
+
gap: var(--space-2);
|
|
372
|
+
grid-template-columns: 8px 1fr auto;
|
|
373
|
+
}
|
|
374
|
+
.nb-dashboard-chart-tooltip__swatch {
|
|
375
|
+
border-radius: 2px;
|
|
376
|
+
height: 8px;
|
|
377
|
+
width: 8px;
|
|
378
|
+
}
|
|
379
|
+
.nb-dashboard-chart-tooltip__name {
|
|
380
|
+
color: var(--text-secondary);
|
|
381
|
+
overflow: hidden;
|
|
382
|
+
text-overflow: ellipsis;
|
|
383
|
+
white-space: nowrap;
|
|
384
|
+
}
|
|
385
|
+
.nb-dashboard-chart-tooltip__value {
|
|
386
|
+
color: var(--text-primary);
|
|
387
|
+
font-family: var(--font-family-mono);
|
|
388
|
+
font-weight: var(--font-weight-medium);
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
.nb-dashboard-progress .nb-stat-card__body {
|
|
392
|
+
display: flex;
|
|
393
|
+
flex-direction: column;
|
|
394
|
+
gap: var(--space-2);
|
|
395
|
+
padding-top: var(--space-2);
|
|
396
|
+
}
|
|
397
|
+
.nb-dashboard-progress__meter {
|
|
398
|
+
background: var(--surface-3);
|
|
399
|
+
border-radius: var(--radius-full, 999px);
|
|
400
|
+
height: 8px;
|
|
401
|
+
overflow: hidden;
|
|
402
|
+
width: 100%;
|
|
403
|
+
}
|
|
404
|
+
.nb-dashboard-progress__fill {
|
|
405
|
+
background: var(--accent-color);
|
|
406
|
+
border-radius: inherit;
|
|
407
|
+
height: 100%;
|
|
408
|
+
transition: width 0.3s ease;
|
|
409
|
+
}
|
|
410
|
+
.nb-dashboard-progress__labels {
|
|
411
|
+
align-items: baseline;
|
|
412
|
+
display: flex;
|
|
413
|
+
gap: var(--space-1);
|
|
414
|
+
}
|
|
415
|
+
.nb-dashboard-progress__value {
|
|
416
|
+
color: var(--text-primary);
|
|
417
|
+
font-family: var(--font-family-mono);
|
|
418
|
+
font-size: var(--font-size-lg);
|
|
419
|
+
font-weight: var(--font-weight-bold);
|
|
420
|
+
}
|
|
421
|
+
.nb-dashboard-progress__max {
|
|
422
|
+
color: var(--text-tertiary);
|
|
423
|
+
font-size: var(--font-size-xs);
|
|
424
|
+
}
|
|
425
|
+
.nb-dashboard-progress--success .nb-dashboard-progress__fill {
|
|
426
|
+
background: var(--success-color);
|
|
427
|
+
}
|
|
428
|
+
.nb-dashboard-progress--warning .nb-dashboard-progress__fill {
|
|
429
|
+
background: var(--warning-color);
|
|
430
|
+
}
|
|
431
|
+
.nb-dashboard-progress--danger .nb-dashboard-progress__fill {
|
|
432
|
+
background: var(--error-color);
|
|
433
|
+
}
|
|
434
|
+
.nb-dashboard-progress--info .nb-dashboard-progress__fill {
|
|
435
|
+
background: var(--info-color, var(--accent-color));
|
|
436
|
+
}
|
|
437
|
+
|
|
257
438
|
.nb-dashboard-table-card .nb-stat-card__header > div:first-child {
|
|
258
439
|
align-items: center;
|
|
259
440
|
display: flex;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nubitio/dashboard",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Declarative dashboard engine with stat cards, charts, and data tables for Nubit admin apps.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -40,7 +40,9 @@
|
|
|
40
40
|
"dist"
|
|
41
41
|
],
|
|
42
42
|
"sideEffects": [
|
|
43
|
-
"**/*.css"
|
|
43
|
+
"**/*.css",
|
|
44
|
+
"./dashboard/widgets/registerBuiltinWidgets.ts",
|
|
45
|
+
"./dashboard/widgets/WidgetRenderer.tsx"
|
|
44
46
|
],
|
|
45
47
|
"engines": {
|
|
46
48
|
"node": ">=18.0.0"
|
|
@@ -49,10 +51,16 @@
|
|
|
49
51
|
"access": "public"
|
|
50
52
|
},
|
|
51
53
|
"peerDependencies": {
|
|
54
|
+
"@tanstack/react-query": "^5.0.0",
|
|
52
55
|
"react": "^18.2.0 || ^19.0.0",
|
|
53
56
|
"react-dom": "^18.2.0 || ^19.0.0",
|
|
54
57
|
"react-router-dom": "^6.0.0",
|
|
55
|
-
"
|
|
56
|
-
"@nubitio/
|
|
58
|
+
"recharts": "^3.0.0",
|
|
59
|
+
"@nubitio/core": "^0.8.1",
|
|
60
|
+
"@nubitio/ui": "^0.8.1"
|
|
61
|
+
},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"@tanstack/react-query": "^5.0.0",
|
|
64
|
+
"recharts": "^3.9.2"
|
|
57
65
|
}
|
|
58
66
|
}
|