@nubitio/dashboard 0.5.19

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/style.css ADDED
@@ -0,0 +1,315 @@
1
+ .nb-dashboard-page {
2
+ position: relative;
3
+ }
4
+ .nb-dashboard-page .nb-toolbar-content {
5
+ display: flex;
6
+ flex-direction: column;
7
+ gap: var(--space-4);
8
+ padding-bottom: var(--space-4);
9
+ }
10
+ .nb-dashboard-page__error {
11
+ background: color-mix(in srgb, var(--error-color) 12%, transparent);
12
+ border: 1px solid color-mix(in srgb, var(--error-color) 35%, transparent);
13
+ border-radius: var(--radius-lg);
14
+ color: var(--error-color);
15
+ font-size: var(--font-size-sm);
16
+ padding: var(--space-3) var(--space-4);
17
+ }
18
+ .nb-dashboard-page__loading {
19
+ align-items: center;
20
+ background: color-mix(in srgb, var(--surface-0) 55%, transparent);
21
+ display: flex;
22
+ inset: 0;
23
+ justify-content: center;
24
+ pointer-events: none;
25
+ position: absolute;
26
+ z-index: 2;
27
+ }
28
+ .nb-dashboard-page__spinner {
29
+ animation: nb-dashboard-spin 0.8s linear infinite;
30
+ border: 2px solid var(--border-color);
31
+ border-radius: 50%;
32
+ border-top-color: var(--accent-color);
33
+ height: 28px;
34
+ width: 28px;
35
+ }
36
+
37
+ @keyframes nb-dashboard-spin {
38
+ to {
39
+ transform: rotate(360deg);
40
+ }
41
+ }
42
+ .nb-dashboard-section {
43
+ display: grid;
44
+ gap: var(--space-4);
45
+ width: 100%;
46
+ }
47
+ .nb-dashboard-section--stats {
48
+ grid-template-columns: repeat(4, minmax(0, 1fr));
49
+ }
50
+ .nb-dashboard-section--charts {
51
+ grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
52
+ align-items: stretch;
53
+ }
54
+ .nb-dashboard-section--full {
55
+ grid-template-columns: minmax(0, 1fr);
56
+ }
57
+ .nb-dashboard-section--grid {
58
+ grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
59
+ }
60
+
61
+ @media (max-width: 1100px) {
62
+ .nb-dashboard-section--stats {
63
+ grid-template-columns: repeat(2, minmax(0, 1fr));
64
+ }
65
+ .nb-dashboard-section--charts {
66
+ grid-template-columns: minmax(0, 1fr);
67
+ }
68
+ }
69
+ @media (max-width: 640px) {
70
+ .nb-dashboard-section--stats {
71
+ grid-template-columns: minmax(0, 1fr);
72
+ }
73
+ }
74
+ .nb-dashboard-widget__subtitle {
75
+ color: var(--text-tertiary);
76
+ font-size: var(--font-size-xs);
77
+ margin-left: var(--space-2);
78
+ }
79
+
80
+ .nb-dashboard-stat .nb-stat-card__header {
81
+ padding-bottom: 0;
82
+ }
83
+ .nb-dashboard-stat .nb-stat-card__body {
84
+ padding-top: var(--space-2);
85
+ }
86
+ .nb-dashboard-stat__content {
87
+ align-items: flex-start;
88
+ display: flex;
89
+ gap: var(--space-3);
90
+ }
91
+ .nb-dashboard-stat__icon {
92
+ align-items: center;
93
+ border-radius: var(--radius-lg);
94
+ display: inline-flex;
95
+ flex-shrink: 0;
96
+ font-size: 1.1rem;
97
+ height: 40px;
98
+ justify-content: center;
99
+ width: 40px;
100
+ }
101
+ .nb-dashboard-stat__icon--accent {
102
+ background: color-mix(in srgb, var(--accent-color) 14%, transparent);
103
+ color: var(--accent-color);
104
+ }
105
+ .nb-dashboard-stat__icon--success {
106
+ background: color-mix(in srgb, var(--success-color) 14%, transparent);
107
+ color: var(--success-color);
108
+ }
109
+ .nb-dashboard-stat__icon--warning {
110
+ background: color-mix(in srgb, var(--warning-color) 14%, transparent);
111
+ color: var(--warning-color);
112
+ }
113
+ .nb-dashboard-stat__icon--danger {
114
+ background: color-mix(in srgb, var(--error-color) 14%, transparent);
115
+ color: var(--error-color);
116
+ }
117
+ .nb-dashboard-stat__icon--info {
118
+ background: color-mix(in srgb, var(--info-color, var(--accent-color)) 14%, transparent);
119
+ color: var(--info-color, var(--accent-color));
120
+ }
121
+ .nb-dashboard-stat__metrics {
122
+ display: flex;
123
+ flex: 1;
124
+ flex-direction: column;
125
+ min-width: 0;
126
+ }
127
+
128
+ .nb-dashboard-chart-card .nb-stat-card__body {
129
+ padding-top: var(--space-2);
130
+ }
131
+
132
+ .nb-dashboard-chart-empty {
133
+ align-items: center;
134
+ color: var(--text-tertiary);
135
+ display: flex;
136
+ font-size: var(--font-size-sm);
137
+ justify-content: center;
138
+ min-height: 120px;
139
+ }
140
+
141
+ .nb-dashboard-bar-chart {
142
+ align-items: stretch;
143
+ display: flex;
144
+ gap: var(--space-2);
145
+ padding-top: var(--space-2);
146
+ }
147
+ .nb-dashboard-bar-chart__item {
148
+ display: flex;
149
+ flex: 1;
150
+ flex-direction: column;
151
+ gap: var(--space-2);
152
+ min-width: 0;
153
+ }
154
+ .nb-dashboard-bar-chart__bar-wrap {
155
+ align-items: flex-end;
156
+ display: flex;
157
+ flex: 1;
158
+ min-height: 0;
159
+ }
160
+ .nb-dashboard-bar-chart__bar {
161
+ background: var(--accent-color);
162
+ border-radius: var(--radius-sm) var(--radius-sm) 0 0;
163
+ transition: height 0.2s ease;
164
+ width: 100%;
165
+ }
166
+ .nb-dashboard-bar-chart__label {
167
+ color: var(--text-tertiary);
168
+ font-size: var(--font-size-xs);
169
+ overflow: hidden;
170
+ text-align: center;
171
+ text-overflow: ellipsis;
172
+ white-space: nowrap;
173
+ }
174
+
175
+ .nb-dashboard-donut {
176
+ display: grid;
177
+ gap: var(--space-4);
178
+ grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
179
+ }
180
+ @media (max-width: 720px) {
181
+ .nb-dashboard-donut {
182
+ grid-template-columns: minmax(0, 1fr);
183
+ }
184
+ }
185
+ .nb-dashboard-donut__chart {
186
+ align-items: center;
187
+ display: flex;
188
+ justify-content: center;
189
+ min-height: 180px;
190
+ position: relative;
191
+ }
192
+ .nb-dashboard-donut__svg {
193
+ height: 180px;
194
+ width: 180px;
195
+ }
196
+ .nb-dashboard-donut__center {
197
+ align-items: center;
198
+ display: flex;
199
+ flex-direction: column;
200
+ gap: var(--space-1);
201
+ left: 50%;
202
+ position: absolute;
203
+ text-align: center;
204
+ top: 50%;
205
+ transform: translate(-50%, -50%);
206
+ width: 42%;
207
+ }
208
+ .nb-dashboard-donut__center-label {
209
+ color: var(--text-tertiary);
210
+ font-size: var(--font-size-xs);
211
+ text-transform: uppercase;
212
+ }
213
+ .nb-dashboard-donut__center-value {
214
+ color: var(--text-primary);
215
+ font-family: var(--font-family-mono);
216
+ font-size: var(--font-size-sm);
217
+ font-weight: var(--font-weight-bold);
218
+ line-height: 1.2;
219
+ }
220
+ .nb-dashboard-donut__legend {
221
+ display: flex;
222
+ flex-direction: column;
223
+ gap: var(--space-2);
224
+ list-style: none;
225
+ margin: 0;
226
+ padding: var(--space-2) 0 0;
227
+ }
228
+ .nb-dashboard-donut__legend-item {
229
+ align-items: center;
230
+ display: grid;
231
+ gap: var(--space-2);
232
+ grid-template-columns: 12px 1fr auto;
233
+ }
234
+ .nb-dashboard-donut__legend-swatch {
235
+ border-radius: var(--radius-sm);
236
+ height: 12px;
237
+ width: 12px;
238
+ }
239
+ .nb-dashboard-donut__legend-label {
240
+ color: var(--text-secondary);
241
+ font-size: var(--font-size-sm);
242
+ overflow: hidden;
243
+ text-overflow: ellipsis;
244
+ white-space: nowrap;
245
+ }
246
+ .nb-dashboard-donut__legend-value {
247
+ color: var(--text-primary);
248
+ font-family: var(--font-family-mono);
249
+ font-size: var(--font-size-xs);
250
+ font-weight: var(--font-weight-medium);
251
+ }
252
+
253
+ .nb-dashboard-table-card .nb-stat-card__header > div:first-child {
254
+ align-items: center;
255
+ display: flex;
256
+ flex-wrap: wrap;
257
+ gap: var(--space-2);
258
+ width: 100%;
259
+ }
260
+
261
+ .nb-dashboard-table__header-extra {
262
+ align-items: center;
263
+ display: flex;
264
+ flex: 1;
265
+ gap: var(--space-3);
266
+ justify-content: space-between;
267
+ min-width: 0;
268
+ }
269
+
270
+ .nb-dashboard-table__view-all {
271
+ color: var(--accent-color);
272
+ font-size: var(--font-size-sm);
273
+ font-weight: var(--font-weight-medium);
274
+ margin-left: auto;
275
+ text-decoration: none;
276
+ white-space: nowrap;
277
+ }
278
+ .nb-dashboard-table__view-all:hover {
279
+ text-decoration: underline;
280
+ }
281
+
282
+ .nb-dashboard-table-wrap {
283
+ overflow-x: auto;
284
+ }
285
+
286
+ .nb-dashboard-table {
287
+ border-collapse: collapse;
288
+ font-size: var(--font-size-sm);
289
+ width: 100%;
290
+ }
291
+ .nb-dashboard-table th {
292
+ border-bottom: 1px solid var(--border-color);
293
+ color: var(--text-tertiary);
294
+ font-size: var(--font-size-xs);
295
+ font-weight: var(--font-weight-medium);
296
+ letter-spacing: 0.04em;
297
+ padding: var(--space-2) var(--space-3);
298
+ text-align: left;
299
+ text-transform: uppercase;
300
+ }
301
+ .nb-dashboard-table td {
302
+ border-bottom: 1px solid color-mix(in srgb, var(--border-color) 65%, transparent);
303
+ color: var(--text-primary);
304
+ padding: var(--space-3);
305
+ vertical-align: middle;
306
+ }
307
+ .nb-dashboard-table tbody tr:last-child td {
308
+ border-bottom: none;
309
+ }
310
+ .nb-dashboard-table__cell--right {
311
+ text-align: right;
312
+ }
313
+ .nb-dashboard-table__cell--center {
314
+ text-align: center;
315
+ }
package/package.json ADDED
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "@nubitio/dashboard",
3
+ "version": "0.5.19",
4
+ "type": "module",
5
+ "description": "Declarative dashboard engine with stat cards, charts, and data tables for Nubit admin apps.",
6
+ "license": "MIT",
7
+ "keywords": [
8
+ "react",
9
+ "admin",
10
+ "dashboard",
11
+ "analytics",
12
+ "charts"
13
+ ],
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/nubitio/nubit-react.git",
17
+ "directory": "packages/dashboard"
18
+ },
19
+ "bugs": {
20
+ "url": "https://github.com/nubitio/nubit-react/issues"
21
+ },
22
+ "homepage": "https://github.com/nubitio/nubit-react/tree/main/packages/dashboard#readme",
23
+ "source": "./public.ts",
24
+ "main": "./dist/index.cjs",
25
+ "module": "./dist/index.mjs",
26
+ "types": "./dist/index.d.mts",
27
+ "exports": {
28
+ ".": {
29
+ "types": {
30
+ "import": "./dist/index.d.mts",
31
+ "require": "./dist/index.d.cts"
32
+ },
33
+ "import": "./dist/index.mjs",
34
+ "require": "./dist/index.cjs"
35
+ },
36
+ "./style.css": "./dist/style.css",
37
+ "./package.json": "./package.json"
38
+ },
39
+ "files": [
40
+ "dist"
41
+ ],
42
+ "sideEffects": [
43
+ "**/*.css"
44
+ ],
45
+ "engines": {
46
+ "node": ">=18.0.0"
47
+ },
48
+ "publishConfig": {
49
+ "access": "public"
50
+ },
51
+ "peerDependencies": {
52
+ "react": "^19.0.0",
53
+ "react-dom": "^19.0.0",
54
+ "react-router-dom": "^6.0.0",
55
+ "@nubitio/core": "^0.5.19",
56
+ "@nubitio/ui": "^0.5.19"
57
+ }
58
+ }