@nubitio/admin 0.1.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/dist/style.css ADDED
@@ -0,0 +1,371 @@
1
+ .nb-admin-shell {
2
+ display: flex;
3
+ flex-direction: column;
4
+ height: 100%;
5
+ width: 100%;
6
+ }
7
+
8
+ .nb-admin-layout-header {
9
+ z-index: var(--z-shell-header);
10
+ }
11
+
12
+ .nb-admin-layout-body {
13
+ background-color: var(--surface-0);
14
+ }
15
+
16
+ .nb-admin-shell__body {
17
+ display: flex;
18
+ flex: 1;
19
+ min-height: 0;
20
+ overflow: hidden;
21
+ position: relative;
22
+ }
23
+
24
+ .nb-admin-shell__panel {
25
+ background-color: var(--side-panel-background);
26
+ border-right: 1px solid var(--border-color);
27
+ flex: 0 0 240px;
28
+ height: 100%;
29
+ overflow: hidden;
30
+ position: relative;
31
+ transition: flex-basis var(--transition-slow), transform var(--transition-slow), width var(--transition-slow);
32
+ width: 240px;
33
+ z-index: var(--z-shell-panel);
34
+ }
35
+
36
+ .nb-admin-shell__scrim {
37
+ background: var(--overlay-bg);
38
+ border: 0;
39
+ cursor: pointer;
40
+ inset: 0;
41
+ padding: 0;
42
+ position: absolute;
43
+ z-index: var(--z-shell-scrim);
44
+ }
45
+
46
+ .nb-admin-shell__body.is-large.is-compact .nb-admin-shell__panel {
47
+ flex-basis: var(--side-panel-min-width);
48
+ width: var(--side-panel-min-width);
49
+ }
50
+
51
+ .nb-admin-shell__body.is-overlay .nb-admin-shell__panel {
52
+ inset: 0 auto 0 0;
53
+ position: absolute;
54
+ }
55
+ .nb-admin-shell__body.is-overlay:not(.is-xsmall) .nb-admin-shell__content {
56
+ margin-left: var(--side-panel-min-width, 48px);
57
+ }
58
+ .nb-admin-shell__body.is-overlay.is-closed:not(.is-xsmall) .nb-admin-shell__panel {
59
+ width: var(--side-panel-min-width);
60
+ }
61
+ .nb-admin-shell__body.is-overlay.is-closed.is-xsmall .nb-admin-shell__panel {
62
+ transform: translateX(-100%);
63
+ }
64
+
65
+ .content {
66
+ display: flex;
67
+ flex-direction: column;
68
+ flex-grow: 1;
69
+ min-height: 0;
70
+ overflow-y: auto;
71
+ }
72
+
73
+ .nb-admin-header-component {
74
+ background: var(--surface-1);
75
+ border-bottom: 1px solid var(--border-color);
76
+ box-shadow: 0 1px 0 var(--border-subtle);
77
+ flex: 0 0 auto;
78
+ position: relative;
79
+ z-index: var(--z-shell-header);
80
+ }
81
+
82
+ .nb-admin-header-toolbar {
83
+ align-items: center;
84
+ display: flex;
85
+ gap: var(--space-2);
86
+ min-height: var(--toolbar-height);
87
+ padding: 0 var(--space-4) 0 0;
88
+ }
89
+
90
+ .nb-admin-header-toolbar__before,
91
+ .nb-admin-header-toolbar__after {
92
+ align-items: center;
93
+ display: flex;
94
+ }
95
+
96
+ .nb-admin-header-toolbar__before {
97
+ flex: 1;
98
+ min-width: 0;
99
+ gap: var(--space-1);
100
+ }
101
+
102
+ .nb-admin-header-toolbar__after {
103
+ flex: 0 0 auto;
104
+ gap: var(--space-1);
105
+ }
106
+
107
+ .nb-admin-header-title {
108
+ color: var(--text-primary);
109
+ font-family: var(--font-family-display);
110
+ font-size: var(--font-size-lg);
111
+ font-weight: var(--font-weight-bold);
112
+ letter-spacing: -0.02em;
113
+ min-width: 0;
114
+ overflow: hidden;
115
+ text-overflow: ellipsis;
116
+ white-space: nowrap;
117
+ }
118
+
119
+ .nb-admin-menu-button {
120
+ flex: 0 0 var(--side-panel-min-width);
121
+ width: var(--side-panel-min-width);
122
+ }
123
+
124
+ .nb-admin-messages {
125
+ position: relative;
126
+ }
127
+
128
+ .nb-admin-header-popover {
129
+ position: relative;
130
+ }
131
+
132
+ .nb-admin-header-popover__panel {
133
+ background: var(--surface-1);
134
+ border: 1px solid var(--border-color);
135
+ border-radius: var(--radius-lg);
136
+ box-shadow: var(--shadow-lg);
137
+ overflow: hidden;
138
+ position: absolute;
139
+ right: 0;
140
+ top: calc(100% + var(--space-2));
141
+ z-index: var(--z-shell-popover);
142
+ }
143
+
144
+ .nb-admin-messages > .nb-badge {
145
+ align-items: center;
146
+ background: var(--accent-color);
147
+ border: 2px solid var(--surface-1);
148
+ border-radius: 10px;
149
+ color: #fff;
150
+ display: flex;
151
+ font-size: var(--font-size-xxs);
152
+ font-weight: var(--font-weight-semibold);
153
+ justify-content: center;
154
+ min-width: 18px;
155
+ padding: 1px 4px;
156
+ pointer-events: none;
157
+ position: absolute;
158
+ right: -4px;
159
+ top: -4px;
160
+ }
161
+
162
+ .nb-admin-menu {
163
+ display: flex;
164
+ flex-direction: column;
165
+ height: 100%;
166
+ min-height: 100%;
167
+ width: 240px !important;
168
+ }
169
+ .nb-admin-menu .nb-admin-menu-container {
170
+ background-color: var(--side-panel-background);
171
+ display: flex;
172
+ flex: 1;
173
+ flex-direction: column;
174
+ font-size: var(--font-size-sm);
175
+ min-height: 0;
176
+ overflow-y: auto;
177
+ padding-bottom: var(--footer-height);
178
+ }
179
+ .nb-admin-menu__nav {
180
+ display: flex;
181
+ flex-direction: column;
182
+ white-space: nowrap;
183
+ width: 100%;
184
+ }
185
+ .nb-admin-menu__section {
186
+ border-bottom: 1px solid var(--border-subtle);
187
+ }
188
+ .nb-admin-menu__section:last-child {
189
+ border-bottom: none;
190
+ }
191
+ .nb-admin-menu__item {
192
+ align-items: center;
193
+ background: transparent;
194
+ border: 0;
195
+ border-left: 3px solid transparent;
196
+ color: var(--text-secondary);
197
+ cursor: pointer;
198
+ display: flex;
199
+ font: inherit;
200
+ min-height: 36px;
201
+ padding: 0;
202
+ text-align: left;
203
+ transition: background var(--transition-base), color var(--transition-base), border-color var(--transition-base);
204
+ width: 100%;
205
+ }
206
+ .nb-admin-menu__item:hover {
207
+ background: var(--surface-2);
208
+ color: var(--text-primary);
209
+ }
210
+ .nb-admin-menu__item.is-selected {
211
+ background: var(--surface-2);
212
+ border-left-color: var(--accent-color);
213
+ color: var(--accent-color);
214
+ font-weight: var(--font-weight-semibold);
215
+ }
216
+ .nb-admin-menu__item--parent {
217
+ color: var(--text-primary);
218
+ font-weight: var(--font-weight-medium);
219
+ }
220
+ .nb-admin-menu__chevron {
221
+ border-bottom: 1.5px solid currentcolor;
222
+ border-right: 1.5px solid currentcolor;
223
+ display: inline-flex;
224
+ flex: 0 0 7px;
225
+ height: 7px;
226
+ margin-left: auto;
227
+ margin-right: var(--space-4);
228
+ opacity: 0.5;
229
+ transform: rotate(45deg);
230
+ transition: transform var(--transition-base), opacity var(--transition-base);
231
+ width: 7px;
232
+ }
233
+ .nb-admin-menu__chevron.is-expanded {
234
+ opacity: 0.8;
235
+ transform: rotate(225deg);
236
+ }
237
+ .nb-admin-menu__section.has-selected-child > .nb-admin-menu__item--parent {
238
+ color: var(--accent-color);
239
+ }
240
+ .nb-admin-menu__icon {
241
+ align-items: center;
242
+ color: inherit;
243
+ display: inline-flex;
244
+ flex: 0 0 var(--side-panel-min-width);
245
+ font-size: 1.1rem;
246
+ justify-content: center;
247
+ margin: 0 !important;
248
+ opacity: 0.75;
249
+ width: var(--side-panel-min-width) !important;
250
+ }
251
+ .is-selected .nb-admin-menu__icon {
252
+ opacity: 1;
253
+ }
254
+ .nb-admin-menu__text {
255
+ overflow: hidden;
256
+ padding-right: var(--space-3);
257
+ text-overflow: ellipsis;
258
+ }
259
+ .nb-admin-menu__item--child {
260
+ color: var(--text-secondary);
261
+ font-size: var(--font-size-xs);
262
+ min-height: 32px;
263
+ }
264
+ .nb-admin-menu__item--child .nb-admin-menu__text {
265
+ font-weight: var(--font-weight-regular);
266
+ padding-left: var(--side-panel-min-width);
267
+ }
268
+ .nb-admin-menu__item--child.is-selected {
269
+ color: var(--accent-color);
270
+ }
271
+ .nb-admin-menu__children {
272
+ border-top: 1px solid var(--border-subtle);
273
+ background: color-mix(in srgb, var(--surface-0) 50%, var(--surface-1) 50%);
274
+ padding: var(--space-1) 0;
275
+ }
276
+ .nb-admin-menu.compact .nb-admin-menu__item {
277
+ border-left-color: transparent;
278
+ }
279
+ .nb-admin-menu.compact .nb-admin-menu__item.is-selected {
280
+ border-left-color: var(--accent-color);
281
+ background: var(--surface-2);
282
+ }
283
+ .nb-admin-menu.compact .nb-admin-menu__text,
284
+ .nb-admin-menu.compact .nb-admin-menu__chevron {
285
+ opacity: 0;
286
+ pointer-events: none;
287
+ }
288
+ .nb-admin-menu.compact .nb-admin-menu__icon {
289
+ opacity: 1;
290
+ }
291
+
292
+ .nb-admin-footer {
293
+ background-color: var(--side-panel-background);
294
+ border-top: 1px solid var(--border-subtle);
295
+ bottom: 0;
296
+ display: flex;
297
+ flex-direction: column;
298
+ left: 0;
299
+ opacity: 0;
300
+ position: absolute;
301
+ right: 0;
302
+ transition: opacity var(--transition-slow);
303
+ }
304
+ .nb-admin-shell__body.is-open .nb-admin-footer {
305
+ opacity: 1;
306
+ }
307
+
308
+ .nb-admin-footer-nav {
309
+ display: flex;
310
+ flex-direction: column;
311
+ }
312
+ .nb-admin-footer-nav__item {
313
+ align-items: center;
314
+ background: transparent;
315
+ border: 0;
316
+ border-left: 3px solid transparent;
317
+ color: var(--text-secondary);
318
+ cursor: pointer;
319
+ display: flex;
320
+ font: inherit;
321
+ font-size: var(--font-size-sm);
322
+ min-height: 36px;
323
+ padding: 0;
324
+ text-align: left;
325
+ transition: background var(--transition-base), color var(--transition-base);
326
+ width: 100%;
327
+ }
328
+ .nb-admin-footer-nav__item:hover {
329
+ background: var(--surface-2);
330
+ color: var(--text-primary);
331
+ }
332
+ .nb-admin-footer-nav__item.is-selected {
333
+ background: var(--surface-2);
334
+ border-left-color: var(--accent-color);
335
+ color: var(--accent-color);
336
+ font-weight: var(--font-weight-semibold);
337
+ }
338
+ .nb-admin-footer-nav__icon {
339
+ align-items: center;
340
+ color: inherit;
341
+ display: inline-flex;
342
+ flex: 0 0 var(--side-panel-min-width);
343
+ font-size: 1.1rem;
344
+ justify-content: center;
345
+ margin: 0 !important;
346
+ opacity: 0.75;
347
+ width: var(--side-panel-min-width) !important;
348
+ }
349
+ .is-selected .nb-admin-footer-nav__icon {
350
+ opacity: 1;
351
+ }
352
+ .nb-admin-footer-nav__text {
353
+ overflow: hidden;
354
+ padding-right: var(--space-3);
355
+ text-overflow: ellipsis;
356
+ white-space: nowrap;
357
+ }
358
+
359
+ .nb-admin-footer-copyright {
360
+ color: var(--text-tertiary);
361
+ font-size: var(--font-size-xxs);
362
+ height: var(--footer-height);
363
+ display: flex;
364
+ align-items: center;
365
+ padding: 0 0 0 var(--footer-left-padding);
366
+ }
367
+
368
+ .nb-admin-shell__body.is-compact .nb-admin-footer-nav__text {
369
+ opacity: 0;
370
+ pointer-events: none;
371
+ }
package/package.json ADDED
@@ -0,0 +1,57 @@
1
+ {
2
+ "name": "@nubitio/admin",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "description": "Admin shell layout components: responsive sidebar, header, and screen size utilities for Nubit apps.",
6
+ "license": "MIT",
7
+ "keywords": [
8
+ "react",
9
+ "admin",
10
+ "layout",
11
+ "sidebar",
12
+ "shell"
13
+ ],
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/nubitio/nubit-react.git",
17
+ "directory": "packages/admin"
18
+ },
19
+ "bugs": {
20
+ "url": "https://github.com/nubitio/nubit-react/issues"
21
+ },
22
+ "homepage": "https://github.com/nubitio/nubit-react/tree/main/packages/admin#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/ui": "^0.1.0"
56
+ }
57
+ }