@nonoun/native-app 0.2.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/custom-elements.json +848 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/nui-app-panel/nui-app-panel-element.d.ts +20 -0
- package/dist/nui-app-panel/nui-app-panel-element.d.ts.map +1 -0
- package/dist/nui-app.css +843 -0
- package/dist/nui-app.js +336 -0
- package/dist/nui-sidebar/nui-sidebar-element.d.ts +11 -0
- package/dist/nui-sidebar/nui-sidebar-element.d.ts.map +1 -0
- package/dist/nui-sidebar/nui-sidebar-group-element.d.ts +24 -0
- package/dist/nui-sidebar/nui-sidebar-group-element.d.ts.map +1 -0
- package/dist/nui-sidebar/nui-sidebar-group-header-element.d.ts +7 -0
- package/dist/nui-sidebar/nui-sidebar-group-header-element.d.ts.map +1 -0
- package/dist/nui-sidebar/nui-sidebar-item-element.d.ts +10 -0
- package/dist/nui-sidebar/nui-sidebar-item-element.d.ts.map +1 -0
- package/dist/nui-sidebar/nui-sidebar-nav-element.d.ts +20 -0
- package/dist/nui-sidebar/nui-sidebar-nav-element.d.ts.map +1 -0
- package/dist/nui-sidebar/nui-sidebar-nav-item-element.d.ts +23 -0
- package/dist/nui-sidebar/nui-sidebar-nav-item-element.d.ts.map +1 -0
- package/package.json +37 -0
package/dist/nui-app.css
ADDED
|
@@ -0,0 +1,843 @@
|
|
|
1
|
+
@layer ui {
|
|
2
|
+
|
|
3
|
+
/* ╭──────────────────────────────────────────────────────────╮
|
|
4
|
+
│ nui-sidebar │
|
|
5
|
+
│ Full-page layout: collapsible/resizable sidebar aside │
|
|
6
|
+
│ + content column (breadcrumb, canvas, body, chat). │
|
|
7
|
+
╰──────────────────────────────────────────────────────────╯ */
|
|
8
|
+
|
|
9
|
+
/* ── Outer Layout ── */
|
|
10
|
+
|
|
11
|
+
:where(nui-sidebar) {
|
|
12
|
+
display: flex;
|
|
13
|
+
height: 100dvh;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/* WHY: Reserve sidebar width before JS builds the DOM — prevents layout shift.
|
|
17
|
+
Collapsed state is read synchronously in the constructor so CSS matches immediately.
|
|
18
|
+
Replaced by the real aside once [data-ready] is set. */
|
|
19
|
+
:where(nui-sidebar):not([data-ready]):not([collapsed])::before {
|
|
20
|
+
content: '';
|
|
21
|
+
width: var(--ui-layout-sidebar-width);
|
|
22
|
+
flex-shrink: 0;
|
|
23
|
+
background: var(--n-body);
|
|
24
|
+
border-right: 1px solid var(--n-border-muted);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
:where(nui-sidebar):not([data-ready])[collapsed]::before {
|
|
28
|
+
content: '';
|
|
29
|
+
width: 48px;
|
|
30
|
+
flex-shrink: 0;
|
|
31
|
+
background: var(--n-body);
|
|
32
|
+
border-right: 1px solid var(--n-border-muted);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* ── Content Column ── */
|
|
36
|
+
/* WHY: Everything except the aside forms a flex column. */
|
|
37
|
+
|
|
38
|
+
:where(nui-sidebar) > :where(:not([slot])) {
|
|
39
|
+
flex: 1 1 0%;
|
|
40
|
+
min-width: 0;
|
|
41
|
+
min-height: 0;
|
|
42
|
+
display: flex;
|
|
43
|
+
flex-direction: column;
|
|
44
|
+
padding: 0;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* ── Sidebar Aside ── */
|
|
48
|
+
/* WHY: position: relative creates the containing block for absolute
|
|
49
|
+
header/footer overlays. Content fills the full height and scrolls
|
|
50
|
+
underneath the pinned header/footer. */
|
|
51
|
+
|
|
52
|
+
:where(nui-sidebar) > :where([slot="sidebar"]) {
|
|
53
|
+
--n-sidebar-header-height: 0px;
|
|
54
|
+
--n-sidebar-footer-height: 0px;
|
|
55
|
+
|
|
56
|
+
container-name: sidebar;
|
|
57
|
+
container-type: inline-size;
|
|
58
|
+
position: sticky;
|
|
59
|
+
top: 0;
|
|
60
|
+
width: var(--ui-layout-sidebar-width);
|
|
61
|
+
min-width: 160px;
|
|
62
|
+
max-width: 400px;
|
|
63
|
+
height: 100dvh;
|
|
64
|
+
display: block;
|
|
65
|
+
transition: width var(--n-duration) var(--n-easing), min-width var(--n-duration) var(--n-easing);
|
|
66
|
+
overflow: hidden;
|
|
67
|
+
z-index: 10;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/* WHY: Disable width transition while dragging — it fights the pointer. */
|
|
71
|
+
:where(nui-sidebar) > :where([slot="sidebar"][resizing]) {
|
|
72
|
+
transition: none;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/* ── Collapsed Icon Rail ── */
|
|
76
|
+
/* WHY: Collapsed = icon rail, not fully hidden. 48px fits icons (1rem) + padding.
|
|
77
|
+
[collapsed] drives the aside to 48px which triggers @container sidebar queries
|
|
78
|
+
in this file and in child component CSS. */
|
|
79
|
+
|
|
80
|
+
:where(nui-sidebar)[collapsed] > :where([slot="sidebar"]) {
|
|
81
|
+
width: 48px;
|
|
82
|
+
min-width: 48px;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/* ── Resize Handle ── */
|
|
86
|
+
|
|
87
|
+
:where(nui-sidebar) :where(.layout-resize-handle) {
|
|
88
|
+
position: absolute;
|
|
89
|
+
top: 0;
|
|
90
|
+
right: 0;
|
|
91
|
+
width: 4px;
|
|
92
|
+
height: 100%;
|
|
93
|
+
cursor: col-resize;
|
|
94
|
+
z-index: 1;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
:where(nui-sidebar) :where(.layout-resize-handle):hover,
|
|
98
|
+
:where(nui-sidebar) > :where([slot="sidebar"][resizing]) :where(.layout-resize-handle) {
|
|
99
|
+
background: var(--n-border-muted);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/* WHY: When collapsed to icon rail, the sidebar edge meets content — drop left padding. */
|
|
103
|
+
|
|
104
|
+
:where(nui-sidebar)[collapsed] :where(nui-app-canvas) {
|
|
105
|
+
padding-inline-start: 0;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
:where(nui-sidebar)[collapsed] :where(nui-app-breadcrumb) {
|
|
109
|
+
padding-inline-start: 0;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/* ── Sidebar Header ── */
|
|
113
|
+
/* WHY: Absolute-positioned overlay pinned to top of aside. Content scrolls
|
|
114
|
+
underneath it. z-index: 2 sits above content (z-index: 0). */
|
|
115
|
+
|
|
116
|
+
:where(nui-sidebar-header) {
|
|
117
|
+
position: absolute;
|
|
118
|
+
top: 0;
|
|
119
|
+
left: 0;
|
|
120
|
+
right: 0;
|
|
121
|
+
z-index: 2;
|
|
122
|
+
display: flex;
|
|
123
|
+
flex-direction: column;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/* ── Sidebar Content ── */
|
|
127
|
+
/* WHY: Full height of the aside, scrollable. Padding-block offsets keep
|
|
128
|
+
content from starting behind header / ending behind footer.
|
|
129
|
+
Fade-out alpha mask dissolves content edges under the overlays. */
|
|
130
|
+
|
|
131
|
+
:where(nui-sidebar-content) {
|
|
132
|
+
display: flex;
|
|
133
|
+
flex-direction: column;
|
|
134
|
+
padding-block-start: var(--n-sidebar-header-height);
|
|
135
|
+
padding-block-end: var(--n-sidebar-footer-height);
|
|
136
|
+
width: 100%;
|
|
137
|
+
height: 100%;
|
|
138
|
+
overflow-y: auto;
|
|
139
|
+
scrollbar-width: none;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/* WHY: When header is present, fade top edge. Content dissolves as it
|
|
143
|
+
scrolls under the header — transparent at top, fully visible by 1.25×
|
|
144
|
+
the header height. No opaque header background needed. */
|
|
145
|
+
:where(nui-sidebar-content)[data-has-header] {
|
|
146
|
+
mask-image: linear-gradient(
|
|
147
|
+
to bottom,
|
|
148
|
+
transparent 0,
|
|
149
|
+
black calc(var(--n-sidebar-header-height) * 1.25),
|
|
150
|
+
black 100%
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/* WHY: When footer is present, fade bottom edge. */
|
|
155
|
+
:where(nui-sidebar-content)[data-has-footer] {
|
|
156
|
+
mask-image: linear-gradient(
|
|
157
|
+
to bottom,
|
|
158
|
+
black 0,
|
|
159
|
+
black calc(100% - var(--n-sidebar-footer-height) * 1.25),
|
|
160
|
+
transparent 100%
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/* WHY: When both header AND footer are present, fade both edges. */
|
|
165
|
+
:where(nui-sidebar-content)[data-has-header][data-has-footer] {
|
|
166
|
+
mask-image: linear-gradient(
|
|
167
|
+
to bottom,
|
|
168
|
+
transparent 0,
|
|
169
|
+
black calc(var(--n-sidebar-header-height) * 1.25),
|
|
170
|
+
black calc(100% - var(--n-sidebar-footer-height) * 1.25),
|
|
171
|
+
transparent 100%
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/* ── Sidebar Footer ── */
|
|
176
|
+
/* WHY: Absolute-positioned overlay pinned to bottom of aside. */
|
|
177
|
+
|
|
178
|
+
:where(nui-sidebar-footer) {
|
|
179
|
+
position: absolute;
|
|
180
|
+
bottom: 0;
|
|
181
|
+
left: 0;
|
|
182
|
+
right: 0;
|
|
183
|
+
z-index: 2;
|
|
184
|
+
display: flex;
|
|
185
|
+
flex-direction: column;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/* ── Sidebar Item ── */
|
|
189
|
+
/* WHY: Universal sidebar row element. Provides inline padding for any content
|
|
190
|
+
(buttons, links, icons). When a child ui-listbox[popover] is present, JS
|
|
191
|
+
wires PopoverController for click-to-toggle menu behavior. */
|
|
192
|
+
|
|
193
|
+
:where(nui-sidebar-item) {
|
|
194
|
+
display: flex;
|
|
195
|
+
align-items: center;
|
|
196
|
+
flex: 1;
|
|
197
|
+
min-width: 0;
|
|
198
|
+
gap: calc(var(--n-space) * 2);
|
|
199
|
+
min-height: var(--n-size);
|
|
200
|
+
font-size: var(--n-font-size);
|
|
201
|
+
font-weight: var(--ui-font-weight-button);
|
|
202
|
+
letter-spacing: var(--n-letter-spacing);
|
|
203
|
+
line-height: var(--ui-line-height-control);
|
|
204
|
+
color: var(--n-ink);
|
|
205
|
+
cursor: pointer;
|
|
206
|
+
user-select: none;
|
|
207
|
+
border: none;
|
|
208
|
+
background: none;
|
|
209
|
+
padding-block: var(--n-space);
|
|
210
|
+
padding-inline: calc(var(--n-space-k) * var(--n-space));
|
|
211
|
+
border-radius: var(--n-radius);
|
|
212
|
+
transition: color var(--n-duration) var(--n-easing);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/* WHY: Items in header/footer match the breadcrumb bar height so the
|
|
216
|
+
first sidebar row aligns horizontally with the breadcrumb. */
|
|
217
|
+
:where(nui-sidebar-header) > :where(nui-sidebar-item),
|
|
218
|
+
:where(nui-sidebar-footer) > :where(nui-sidebar-item) {
|
|
219
|
+
min-height: var(--ui-layout-bar-height);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
:where(nui-sidebar-item):hover,
|
|
223
|
+
:where(nui-sidebar-item)[force-hover] {
|
|
224
|
+
color: var(--n-ink-strong);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
:where(nui-sidebar-item):focus-visible,
|
|
228
|
+
:where(nui-sidebar-item)[force-focus-visible] {
|
|
229
|
+
outline: 2px solid var(--ui-focus-ring);
|
|
230
|
+
outline-offset: -2px;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/* WHY: Fixed-size icon well so all sidebar icons center-align on the same
|
|
234
|
+
column width regardless of intrinsic icon size. 1.5rem matches the sidebar's
|
|
235
|
+
visual rhythm at default density. */
|
|
236
|
+
:where(nui-sidebar-item) > :where([slot="icon"]) {
|
|
237
|
+
display: inline-flex;
|
|
238
|
+
align-items: center;
|
|
239
|
+
justify-content: center;
|
|
240
|
+
width: 1.5rem;
|
|
241
|
+
height: 1.5rem;
|
|
242
|
+
flex-shrink: 0;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/* WHY: Trailing caret pushes to end — same pattern as button justify="spread". */
|
|
246
|
+
:where(nui-sidebar-item) > :where([slot="trailing"]) {
|
|
247
|
+
margin-inline-start: auto;
|
|
248
|
+
flex-shrink: 0;
|
|
249
|
+
color: var(--n-ink-muted);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/* WHY: When the item wraps a sub-component (e.g. ui-button) that provides
|
|
253
|
+
its own icon, hide [slot="icon"] in expanded mode — it only serves as the
|
|
254
|
+
bare collapsed-rail representation. */
|
|
255
|
+
:where(nui-sidebar-item:has(> ui-button)) > :where([slot="icon"]) {
|
|
256
|
+
display: none;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/* WHY: Title text truncates when sidebar narrows during resize. */
|
|
260
|
+
:where(nui-sidebar-item) > :where([slot="label"]) {
|
|
261
|
+
flex: 1;
|
|
262
|
+
min-width: 0;
|
|
263
|
+
white-space: nowrap;
|
|
264
|
+
overflow: hidden;
|
|
265
|
+
text-overflow: ellipsis;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
/* ── Item Popover ── */
|
|
269
|
+
/* WHY: Popover opens to the right of the sidebar item.
|
|
270
|
+
Default: top-aligned, grows downward (span-block-end).
|
|
271
|
+
Flip: bottom-aligned, grows upward (span-block-start). */
|
|
272
|
+
|
|
273
|
+
:where(nui-sidebar-item) > :where(ui-listbox[popover]) {
|
|
274
|
+
--n-popover-origin: left center;
|
|
275
|
+
--n-popover-from: perspective(800px) scale(0.96) rotateY(20deg);
|
|
276
|
+
|
|
277
|
+
position: fixed;
|
|
278
|
+
position-area: inline-end span-block-end;
|
|
279
|
+
position-try-fallbacks: --sidebar-item-flip-up;
|
|
280
|
+
margin-block: var(--ui-popover-viewport-margin);
|
|
281
|
+
margin-inline: 0;
|
|
282
|
+
margin-inline-start: var(--ui-popover-gap);
|
|
283
|
+
min-width: 200px;
|
|
284
|
+
max-height: var(--ui-popover-max-height);
|
|
285
|
+
overflow-y: auto;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
@position-try --sidebar-item-flip-up {
|
|
289
|
+
position-area: inline-end span-block-start;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
@position-try --sidebar-item-flip-down {
|
|
293
|
+
position-area: inline-end span-block-end;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/* ── Container Query: Collapsed Sidebar ── */
|
|
297
|
+
/* WHY: Each component owns its own collapsed behavior via @container.
|
|
298
|
+
The aside is the container (container-name: sidebar). When it shrinks
|
|
299
|
+
to 48px (icon rail), components respond to the width, not to [collapsed].
|
|
300
|
+
Threshold 80px: collapsed = 48px, min expanded = 160px. */
|
|
301
|
+
|
|
302
|
+
@container sidebar (max-width: 80px) {
|
|
303
|
+
|
|
304
|
+
/* Resize handle — no dragging in icon rail */
|
|
305
|
+
:where(.layout-resize-handle) {
|
|
306
|
+
display: none;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
/* Header/footer — center content horizontally */
|
|
310
|
+
:where(nui-sidebar-header),
|
|
311
|
+
:where(nui-sidebar-footer) {
|
|
312
|
+
align-items: center;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/* Content — center items in the 48px rail */
|
|
316
|
+
:where(nui-sidebar-content) {
|
|
317
|
+
align-items: center;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/* Item — shrink to icon-only. */
|
|
321
|
+
:where(nui-sidebar-item) {
|
|
322
|
+
flex: 0 0 auto;
|
|
323
|
+
padding-inline: var(--n-space);
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
:where(nui-sidebar-item) > :where([slot="icon"]) {
|
|
327
|
+
display: inline-flex;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
:where(nui-sidebar-item) > :where(:not([slot="icon"]):not(ui-listbox[popover]):not(.nav-group-flyout)) {
|
|
331
|
+
display: none;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
/* WHY: In collapsed mode the sidebar item is a small icon — centering
|
|
335
|
+
the popover vertically with the anchor is more natural than top-aligning. */
|
|
336
|
+
:where(nui-sidebar-item) > :where(ui-listbox[popover]) {
|
|
337
|
+
position-area: inline-end;
|
|
338
|
+
position-try-fallbacks: --sidebar-item-flip-up, --sidebar-item-flip-down;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
/* ╭──────────────────────────────────────────────────────────╮
|
|
344
|
+
│ nui-sidebar-nav │
|
|
345
|
+
│ Navigation list with keyboard nav + selection. │
|
|
346
|
+
│ Transparent wrapper — no visual surface. │
|
|
347
|
+
│ Uses nui-sidebar-nav-item / nui-sidebar-group. │
|
|
348
|
+
╰──────────────────────────────────────────────────────────╯ */
|
|
349
|
+
|
|
350
|
+
/* WHY: nui-sidebar-nav is a transparent flex wrapper — no inline padding.
|
|
351
|
+
Inline padding is owned by leaf items (nav-item, summary).
|
|
352
|
+
Block padding is owned by nav-group margins. */
|
|
353
|
+
:where(nui-sidebar-nav) {
|
|
354
|
+
display: flex;
|
|
355
|
+
flex-direction: column;
|
|
356
|
+
gap: 0;
|
|
357
|
+
padding: 0;
|
|
358
|
+
outline: none;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
/* ── Nav Item ── */
|
|
362
|
+
/* WHY: Nav items share the same visual pattern as options (ghost row,
|
|
363
|
+
hover/active/selected states). */
|
|
364
|
+
|
|
365
|
+
:where(nui-sidebar-nav-item) {
|
|
366
|
+
--n-font-weight: var(--ui-font-weight-text);
|
|
367
|
+
--n-line-height: var(--ui-line-height-control);
|
|
368
|
+
|
|
369
|
+
display: flex;
|
|
370
|
+
align-items: center;
|
|
371
|
+
gap: calc(var(--n-space) * 2);
|
|
372
|
+
padding-inline: calc(var(--n-space-k) * var(--n-space));
|
|
373
|
+
|
|
374
|
+
min-height: var(--n-size);
|
|
375
|
+
|
|
376
|
+
font-size: var(--n-font-size);
|
|
377
|
+
letter-spacing: var(--n-letter-spacing);
|
|
378
|
+
line-height: var(--n-line-height);
|
|
379
|
+
font-weight: var(--n-font-weight);
|
|
380
|
+
|
|
381
|
+
cursor: pointer;
|
|
382
|
+
user-select: none;
|
|
383
|
+
color: var(--n-ink-muted);
|
|
384
|
+
|
|
385
|
+
transition:
|
|
386
|
+
background var(--n-duration) var(--n-easing),
|
|
387
|
+
color var(--n-duration) var(--n-easing),
|
|
388
|
+
border-color var(--n-duration) var(--n-easing),
|
|
389
|
+
opacity var(--n-duration) var(--n-easing),
|
|
390
|
+
transform var(--n-duration) var(--n-easing);
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
/* ── Nav Item States ── */
|
|
394
|
+
|
|
395
|
+
:where(nui-sidebar-nav-item):hover,
|
|
396
|
+
:where(nui-sidebar-nav-item)[force-hover] {
|
|
397
|
+
color: var(--n-ink-hover);
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
:where(nui-sidebar-nav-item):active,
|
|
401
|
+
:where(nui-sidebar-nav-item)[force-active] {
|
|
402
|
+
color: var(--n-ink-active);
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
:where(nui-sidebar-nav-item)[aria-current="page"] {
|
|
406
|
+
color: var(--n-ink-strong);
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
:where(nui-sidebar-nav-item)[aria-disabled="true"] {
|
|
410
|
+
color: var(--n-ink-disabled);
|
|
411
|
+
cursor: not-allowed;
|
|
412
|
+
pointer-events: none;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
:where(nui-sidebar-nav-item):focus-visible,
|
|
416
|
+
:where(nui-sidebar-nav-item)[force-focus-visible] {
|
|
417
|
+
outline: 2px solid var(--ui-focus-ring);
|
|
418
|
+
outline-offset: -2px;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
/* ── Nav Group ── */
|
|
422
|
+
/* WHY: Groups stamp a native <details>/<summary> for collapsible behavior.
|
|
423
|
+
DOM structure: nui-sidebar-group > details > summary > nui-sidebar-group-header
|
|
424
|
+
> nui-sidebar-nav-item* */
|
|
425
|
+
|
|
426
|
+
:where(nui-sidebar-group) {
|
|
427
|
+
--n-indicator-index: 0;
|
|
428
|
+
|
|
429
|
+
display: block;
|
|
430
|
+
position: relative;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
:where(nui-sidebar-group) + :where(nui-sidebar-group) {
|
|
434
|
+
margin-block-start: calc(var(--n-space) * 2);
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
/* ── Details (native disclosure with animated open/close) ── */
|
|
438
|
+
|
|
439
|
+
:where(nui-sidebar-group) > :where(details) {
|
|
440
|
+
interpolate-size: allow-keywords;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
:where(nui-sidebar-group) > :where(details)::details-content {
|
|
444
|
+
height: 0;
|
|
445
|
+
overflow: clip;
|
|
446
|
+
opacity: 0;
|
|
447
|
+
|
|
448
|
+
transition:
|
|
449
|
+
height var(--n-duration) var(--n-easing),
|
|
450
|
+
opacity var(--n-duration) var(--n-easing),
|
|
451
|
+
content-visibility var(--n-duration) var(--n-easing) allow-discrete;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
:where(nui-sidebar-group) > :where(details[open])::details-content {
|
|
455
|
+
height: auto;
|
|
456
|
+
opacity: 1;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
/* ── Summary (clickable header row) ── */
|
|
460
|
+
|
|
461
|
+
:where(nui-sidebar-group) > :where(details) > :where(summary) {
|
|
462
|
+
display: flex;
|
|
463
|
+
align-items: center;
|
|
464
|
+
gap: calc(var(--n-space) * 2);
|
|
465
|
+
padding-inline: calc(var(--n-space-k) * var(--n-space));
|
|
466
|
+
cursor: pointer;
|
|
467
|
+
user-select: none;
|
|
468
|
+
list-style: none;
|
|
469
|
+
outline: none;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
/* WHY: Remove default marker in WebKit */
|
|
473
|
+
:where(nui-sidebar-group) > :where(details) > :where(summary)::-webkit-details-marker {
|
|
474
|
+
display: none;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
:where(nui-sidebar-group) > :where(details) > :where(summary)::marker {
|
|
478
|
+
display: none;
|
|
479
|
+
content: '';
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
/* ── Nav Group Header ── */
|
|
483
|
+
/* WHY: Header sits inside <summary>. Bold text with optional icon. */
|
|
484
|
+
|
|
485
|
+
:where(nui-sidebar-group-header) {
|
|
486
|
+
display: flex;
|
|
487
|
+
align-items: center;
|
|
488
|
+
flex: 1;
|
|
489
|
+
gap: calc(var(--n-space) * 2);
|
|
490
|
+
min-height: var(--n-size);
|
|
491
|
+
font-size: var(--n-font-size);
|
|
492
|
+
font-weight: var(--ui-font-weight-button);
|
|
493
|
+
letter-spacing: var(--n-letter-spacing);
|
|
494
|
+
line-height: var(--ui-line-height-control);
|
|
495
|
+
color: var(--n-ink);
|
|
496
|
+
cursor: pointer;
|
|
497
|
+
user-select: none;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
/* WHY: Fixed-size icon well — matches nui-sidebar-item [slot="icon"].
|
|
501
|
+
All sidebar icons align on the same 1.5rem column regardless of icon size.
|
|
502
|
+
JS wraps the first <ui-icon> child in a .icon-well span during setup(). */
|
|
503
|
+
:where(nui-sidebar-group-header) > :where(.icon-well) {
|
|
504
|
+
display: inline-flex;
|
|
505
|
+
align-items: center;
|
|
506
|
+
justify-content: center;
|
|
507
|
+
width: 1.5rem;
|
|
508
|
+
height: 1.5rem;
|
|
509
|
+
flex-shrink: 0;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
/* ── Chevron icon (right side of summary) ── */
|
|
513
|
+
|
|
514
|
+
:where(nui-sidebar-group) > :where(details) > :where(summary)::after {
|
|
515
|
+
content: '';
|
|
516
|
+
flex-shrink: 0;
|
|
517
|
+
width: var(--n-icon-size);
|
|
518
|
+
height: var(--n-icon-size);
|
|
519
|
+
|
|
520
|
+
mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z' fill='currentColor'/%3E%3C/svg%3E");
|
|
521
|
+
mask-size: contain;
|
|
522
|
+
mask-repeat: no-repeat;
|
|
523
|
+
mask-position: center;
|
|
524
|
+
-webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z' fill='currentColor'/%3E%3C/svg%3E");
|
|
525
|
+
-webkit-mask-size: contain;
|
|
526
|
+
-webkit-mask-repeat: no-repeat;
|
|
527
|
+
-webkit-mask-position: center;
|
|
528
|
+
|
|
529
|
+
background: var(--n-ink-muted);
|
|
530
|
+
|
|
531
|
+
transition:
|
|
532
|
+
transform var(--n-duration) var(--n-easing);
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
/* Chevron rotates when open */
|
|
536
|
+
:where(nui-sidebar-group) > :where(details[open]) > :where(summary)::after {
|
|
537
|
+
transform: rotate(180deg);
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
/* ── Selected group — has a child with aria-current ── */
|
|
541
|
+
|
|
542
|
+
:where(nui-sidebar-group):state(has-selection) > :where(details) > :where(summary) :where(nui-sidebar-group-header) {
|
|
543
|
+
color: var(--n-ink-strong);
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
/* ── Summary Hover ── */
|
|
547
|
+
|
|
548
|
+
:where(nui-sidebar-group) > :where(details) > :where(summary):hover :where(nui-sidebar-group-header),
|
|
549
|
+
:where(nui-sidebar-group[force-hover]) > :where(details) > :where(summary) :where(nui-sidebar-group-header) {
|
|
550
|
+
color: var(--n-ink-strong);
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
/* ── Summary Focus ── */
|
|
554
|
+
|
|
555
|
+
:where(nui-sidebar-group) > :where(details) > :where(summary):focus-visible,
|
|
556
|
+
:where(nui-sidebar-group[force-focus-visible]) > :where(details) > :where(summary) {
|
|
557
|
+
outline: 2px solid var(--ui-focus-ring);
|
|
558
|
+
outline-offset: -2px;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
/* ── Vertical connector line (icon groups only) ── */
|
|
562
|
+
|
|
563
|
+
:where(nui-sidebar-group):has(:where(nui-sidebar-group-header) :where(.icon-well)) {
|
|
564
|
+
--n-group-pad: calc(var(--n-space-k) * var(--n-space));
|
|
565
|
+
--n-group-icon-well: 1.5rem;
|
|
566
|
+
--n-group-line-inset: calc(var(--n-group-pad) + var(--n-group-icon-well) / 2);
|
|
567
|
+
--n-group-child-inset: calc(var(--n-group-icon-well) + var(--n-space) * 2);
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
:where(nui-sidebar-group):has(:where(nui-sidebar-group-header) :where(.icon-well)):has(:where(details[open]))::after {
|
|
571
|
+
content: '';
|
|
572
|
+
position: absolute;
|
|
573
|
+
inset-inline-start: var(--n-group-line-inset);
|
|
574
|
+
top: var(--n-size);
|
|
575
|
+
bottom: 0;
|
|
576
|
+
width: 1px;
|
|
577
|
+
background: var(--n-border-muted);
|
|
578
|
+
pointer-events: none;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
/* ── Sliding indicator ── */
|
|
582
|
+
|
|
583
|
+
:where(nui-sidebar-group):has(:where(nui-sidebar-group-header) :where(.icon-well)):has(:where(details[open])):state(has-selection)::before {
|
|
584
|
+
content: '';
|
|
585
|
+
position: absolute;
|
|
586
|
+
z-index: 1;
|
|
587
|
+
inset-inline-start: calc(var(--n-group-line-inset, 0px) - 0.5px);
|
|
588
|
+
top: var(--n-size);
|
|
589
|
+
height: var(--n-size);
|
|
590
|
+
width: 2px;
|
|
591
|
+
border-radius: 1px;
|
|
592
|
+
background: var(--n-surface);
|
|
593
|
+
pointer-events: none;
|
|
594
|
+
transform: translateY(calc(var(--n-indicator-index) * var(--n-size)));
|
|
595
|
+
|
|
596
|
+
transition:
|
|
597
|
+
transform var(--n-duration) var(--n-easing),
|
|
598
|
+
background var(--n-duration) var(--n-easing);
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
/* ── Grouped Child Items ── */
|
|
602
|
+
|
|
603
|
+
:where(nui-sidebar-group) > :where(details) > :where(nui-sidebar-nav-item) {
|
|
604
|
+
margin-inline-start: var(--n-group-child-inset, 0);
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
/* ── Nav Group Flyout (collapsed sidebar) ── */
|
|
608
|
+
|
|
609
|
+
:where(nui-sidebar-group) > :where(ui-listbox.nav-group-flyout[popover]) {
|
|
610
|
+
--n-popover-origin: left center;
|
|
611
|
+
--n-popover-from: perspective(800px) scale(0.96) rotateY(20deg);
|
|
612
|
+
|
|
613
|
+
position: fixed;
|
|
614
|
+
position-area: inline-end span-block-end;
|
|
615
|
+
position-try-fallbacks: --nav-flyout-flip-up;
|
|
616
|
+
margin-block: var(--ui-popover-viewport-margin);
|
|
617
|
+
margin-inline: 0;
|
|
618
|
+
margin-inline-start: var(--ui-popover-gap);
|
|
619
|
+
min-width: 200px;
|
|
620
|
+
max-height: var(--ui-popover-max-height);
|
|
621
|
+
overflow-y: auto;
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
@position-try --nav-flyout-flip-up {
|
|
625
|
+
position-area: inline-end span-block-start;
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
@position-try --nav-flyout-flip-down {
|
|
629
|
+
position-area: inline-end span-block-end;
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
/* ── Container Query: Collapsed Sidebar (nav) ── */
|
|
633
|
+
|
|
634
|
+
@container sidebar (max-width: 80px) {
|
|
635
|
+
|
|
636
|
+
/* Nav items hide entirely — only group headers (with icons) remain. */
|
|
637
|
+
:where(nui-sidebar-nav-item) {
|
|
638
|
+
display: none;
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
/* Summary shrinks to icon-only. */
|
|
642
|
+
:where(nui-sidebar-group) > :where(details) > :where(summary) {
|
|
643
|
+
padding-inline: var(--n-space);
|
|
644
|
+
border-radius: var(--n-radius);
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
/* Hide chevron — no expand/collapse in icon rail (flyout instead). */
|
|
648
|
+
:where(nui-sidebar-group) > :where(details) > :where(summary)::after {
|
|
649
|
+
display: none;
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
/* Hide vertical connector line and sliding indicator. */
|
|
653
|
+
:where(nui-sidebar-group)::after,
|
|
654
|
+
:where(nui-sidebar-group)::before {
|
|
655
|
+
display: none;
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
/* Header collapses to icon-only. */
|
|
659
|
+
:where(nui-sidebar-group-header) {
|
|
660
|
+
flex: 0 0 auto;
|
|
661
|
+
font-size: 0;
|
|
662
|
+
gap: 0;
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
:where(nui-sidebar-group-header) :where(.icon-well) :where(ui-icon) {
|
|
666
|
+
font-size: var(--n-font-size, 1rem);
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
/* WHY: In collapsed mode the group is a small icon — centering
|
|
670
|
+
the flyout vertically with the anchor is more natural. */
|
|
671
|
+
:where(nui-sidebar-group) > :where(ui-listbox.nav-group-flyout[popover]) {
|
|
672
|
+
position-area: inline-end;
|
|
673
|
+
position-try-fallbacks: --nav-flyout-flip-up, --nav-flyout-flip-down;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
/* Collapse inter-group spacing in icon rail. */
|
|
677
|
+
:where(nui-sidebar-group) + :where(nui-sidebar-group) {
|
|
678
|
+
margin-block-start: 0;
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
@layer ui {
|
|
685
|
+
|
|
686
|
+
/* ╭──────────────────────────────────────────────────────────╮
|
|
687
|
+
│ nui-app-breadcrumb │
|
|
688
|
+
│ Grid bar with leading / label / trailing slots. │
|
|
689
|
+
│ Same slot pattern as ui-header. │
|
|
690
|
+
╰──────────────────────────────────────────────────────────╯ */
|
|
691
|
+
|
|
692
|
+
/* ── Base ── */
|
|
693
|
+
|
|
694
|
+
:where(nui-app-breadcrumb) {
|
|
695
|
+
display: grid;
|
|
696
|
+
grid-template-columns: 1fr;
|
|
697
|
+
align-items: center;
|
|
698
|
+
min-height: var(--ui-layout-bar-height);
|
|
699
|
+
gap: calc(var(--n-space) * 2);
|
|
700
|
+
padding-block: var(--n-space);
|
|
701
|
+
padding-inline: calc(var(--n-space-k) * var(--n-space));
|
|
702
|
+
flex-shrink: 0;
|
|
703
|
+
min-width: 0;
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
/* ── Slots ── */
|
|
707
|
+
|
|
708
|
+
:where(nui-app-breadcrumb):has(> [slot="leading"]):has(> [slot="trailing"]) {
|
|
709
|
+
grid-template-columns: auto 1fr auto;
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
:where(nui-app-breadcrumb):has(> [slot="leading"]):not(:has(> [slot="trailing"])) {
|
|
713
|
+
grid-template-columns: auto 1fr;
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
:where(nui-app-breadcrumb):not(:has(> [slot="leading"])):has(> [slot="trailing"]) {
|
|
717
|
+
grid-template-columns: 1fr auto;
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
:where(nui-app-breadcrumb) > :where([slot="leading"]) {
|
|
721
|
+
display: flex;
|
|
722
|
+
align-items: center;
|
|
723
|
+
gap: calc(var(--n-space) * 2);
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
:where(nui-app-breadcrumb) > :where([slot="label"]),
|
|
727
|
+
:where(nui-app-breadcrumb) > :where(:not([slot])) {
|
|
728
|
+
min-width: 0;
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
:where(nui-app-breadcrumb) > :where([slot="trailing"]) {
|
|
732
|
+
display: flex;
|
|
733
|
+
align-items: center;
|
|
734
|
+
gap: calc(var(--n-space) * 2);
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
@layer ui {
|
|
740
|
+
|
|
741
|
+
/* ╭──────────────────────────────────────────────────────────╮
|
|
742
|
+
│ nui-app-canvas │
|
|
743
|
+
│ Structural flex row for body + chat panels. │
|
|
744
|
+
│ No background, no radius — purely layout. │
|
|
745
|
+
╰──────────────────────────────────────────────────────────╯ */
|
|
746
|
+
|
|
747
|
+
:where(nui-app-canvas) {
|
|
748
|
+
display: flex;
|
|
749
|
+
flex: 1;
|
|
750
|
+
min-height: 0;
|
|
751
|
+
padding: 0 calc(var(--n-space-k) * var(--n-space)) calc(var(--n-space-k) * var(--n-space));
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
@layer ui {
|
|
757
|
+
|
|
758
|
+
/* ╭──────────────────────────────────────────────────────────╮
|
|
759
|
+
│ nui-app-panel │
|
|
760
|
+
│ Layout panel — main content surface or collapsible │
|
|
761
|
+
│ aside. Default: flex-1 scrollable body. [aside]: │
|
|
762
|
+
│ fixed-width side panel with open/close + resize. │
|
|
763
|
+
╰──────────────────────────────────────────────────────────╯ */
|
|
764
|
+
|
|
765
|
+
/* ── Base (shared) ── */
|
|
766
|
+
|
|
767
|
+
:where(nui-app-panel) {
|
|
768
|
+
display: flex;
|
|
769
|
+
flex-direction: column;
|
|
770
|
+
scrollbar-width: none;
|
|
771
|
+
background: var(--n-ground, var(--n-panel));
|
|
772
|
+
border-radius: var(--n-radius);
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
:where(nui-app-panel)[show-scrollbar] {
|
|
776
|
+
scrollbar-width: thin;
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
/* ── Main mode (default) ── */
|
|
780
|
+
|
|
781
|
+
:where(nui-app-panel):not([aside]) {
|
|
782
|
+
flex: 1;
|
|
783
|
+
min-width: 0;
|
|
784
|
+
overflow-y: auto;
|
|
785
|
+
padding: calc(var(--n-space-k) * var(--n-space));
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
/* ── Aside mode ── */
|
|
789
|
+
|
|
790
|
+
:where(nui-app-panel)[aside] {
|
|
791
|
+
position: relative;
|
|
792
|
+
width: 0;
|
|
793
|
+
min-width: 0;
|
|
794
|
+
max-width: 480px;
|
|
795
|
+
overflow: clip;
|
|
796
|
+
padding: 0;
|
|
797
|
+
transition:
|
|
798
|
+
width var(--n-duration) var(--n-easing),
|
|
799
|
+
min-width var(--n-duration) var(--n-easing),
|
|
800
|
+
padding var(--n-duration) var(--n-easing),
|
|
801
|
+
margin var(--n-duration) var(--n-easing);
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
:where(nui-app-panel)[aside][open] {
|
|
805
|
+
width: 360px;
|
|
806
|
+
min-width: 280px;
|
|
807
|
+
margin-inline-start: calc(var(--n-space) * 2);
|
|
808
|
+
overflow-y: auto;
|
|
809
|
+
padding: calc(var(--n-space-k) * var(--n-space));
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
/* WHY: When ui-chat manages its own sub-container padding and scroll,
|
|
813
|
+
the layout container delegates — no own padding, no own scroll.
|
|
814
|
+
overflow: visible lets CSS anchor-positioned popovers (ui-select etc.)
|
|
815
|
+
resolve through to the top layer. */
|
|
816
|
+
:where(nui-app-panel)[aside][open]:has(> ui-chat) {
|
|
817
|
+
padding: 0;
|
|
818
|
+
overflow: visible;
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
/* WHY: Disable width transition while dragging — it fights the pointer. */
|
|
822
|
+
:where(nui-app-panel)[aside][resizing] {
|
|
823
|
+
transition: none;
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
/* ── Resize Handle ── */
|
|
827
|
+
|
|
828
|
+
:where(nui-app-panel)[aside] :where(.layout-resize-handle) {
|
|
829
|
+
position: absolute;
|
|
830
|
+
top: 0;
|
|
831
|
+
left: 0;
|
|
832
|
+
width: 4px;
|
|
833
|
+
height: 100%;
|
|
834
|
+
cursor: col-resize;
|
|
835
|
+
z-index: 1;
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
:where(nui-app-panel)[aside] :where(.layout-resize-handle):hover,
|
|
839
|
+
:where(nui-app-panel)[aside][resizing] :where(.layout-resize-handle) {
|
|
840
|
+
background: var(--n-border-muted);
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
}
|