@kushagradhawan/kookie-ui 0.1.14 → 0.1.16

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.
Files changed (50) hide show
  1. package/components.css +1324 -131
  2. package/dist/cjs/components/dropdown-menu.js +1 -1
  3. package/dist/cjs/components/dropdown-menu.js.map +2 -2
  4. package/dist/cjs/components/icons.d.ts +2 -1
  5. package/dist/cjs/components/icons.d.ts.map +1 -1
  6. package/dist/cjs/components/icons.js +1 -1
  7. package/dist/cjs/components/icons.js.map +3 -3
  8. package/dist/cjs/components/image.d.ts +23 -2
  9. package/dist/cjs/components/image.d.ts.map +1 -1
  10. package/dist/cjs/components/image.js +1 -1
  11. package/dist/cjs/components/image.js.map +3 -3
  12. package/dist/cjs/components/sidebar.d.ts +117 -42
  13. package/dist/cjs/components/sidebar.d.ts.map +1 -1
  14. package/dist/cjs/components/sidebar.js +1 -1
  15. package/dist/cjs/components/sidebar.js.map +3 -3
  16. package/dist/cjs/components/sidebar.props.d.ts +17 -10
  17. package/dist/cjs/components/sidebar.props.d.ts.map +1 -1
  18. package/dist/cjs/components/sidebar.props.js +1 -1
  19. package/dist/cjs/components/sidebar.props.js.map +3 -3
  20. package/dist/esm/components/dropdown-menu.js +1 -1
  21. package/dist/esm/components/dropdown-menu.js.map +3 -3
  22. package/dist/esm/components/icons.d.ts +2 -1
  23. package/dist/esm/components/icons.d.ts.map +1 -1
  24. package/dist/esm/components/icons.js +1 -1
  25. package/dist/esm/components/icons.js.map +3 -3
  26. package/dist/esm/components/image.d.ts +23 -2
  27. package/dist/esm/components/image.d.ts.map +1 -1
  28. package/dist/esm/components/image.js +1 -1
  29. package/dist/esm/components/image.js.map +3 -3
  30. package/dist/esm/components/sidebar.d.ts +117 -42
  31. package/dist/esm/components/sidebar.d.ts.map +1 -1
  32. package/dist/esm/components/sidebar.js +1 -1
  33. package/dist/esm/components/sidebar.js.map +3 -3
  34. package/dist/esm/components/sidebar.props.d.ts +17 -10
  35. package/dist/esm/components/sidebar.props.d.ts.map +1 -1
  36. package/dist/esm/components/sidebar.props.js +1 -1
  37. package/dist/esm/components/sidebar.props.js.map +3 -3
  38. package/package.json +1 -1
  39. package/src/components/_internal/base-button.css +2 -9
  40. package/src/components/_internal/base-menu.css +2 -2
  41. package/src/components/button.css +2 -2
  42. package/src/components/dropdown-menu.tsx +2 -2
  43. package/src/components/icon-button.css +2 -2
  44. package/src/components/icons.tsx +18 -1
  45. package/src/components/image.css +5 -0
  46. package/src/components/image.tsx +173 -11
  47. package/src/components/sidebar.css +850 -54
  48. package/src/components/sidebar.props.tsx +15 -11
  49. package/src/components/sidebar.tsx +500 -367
  50. package/styles.css +1324 -131
@@ -1,15 +1,47 @@
1
+ /* Sidebar Provider - handles positioning */
2
+ .rt-SidebarProvider {
3
+ /* Positioning based on side */
4
+ &:where([data-side="left"]) {
5
+ /* Left side is default - no additional positioning needed */
6
+ order: -1; /* Ensure it appears first in flex container */
7
+ }
8
+
9
+ &:where([data-side="right"]) {
10
+ /* Position on the right side */
11
+ order: 999; /* Push to end in flex container */
12
+ }
13
+ }
14
+
1
15
  /* Sidebar Root Container */
2
16
  .rt-SidebarRoot {
3
- --sidebar-width: 16rem;
4
- --sidebar-width-icon: 3rem;
17
+ --sidebar-width: 16rem; /* Fixed width */
5
18
 
6
- position: fixed;
7
- top: 0;
8
- bottom: 0;
9
- left: 0;
10
- z-index: 30;
11
19
  width: var(--sidebar-width);
12
- transition: transform 0.2s ease, width 0.2s ease;
20
+ height: 100vh;
21
+ flex-shrink: 0;
22
+ display: flex;
23
+ flex-direction: column;
24
+
25
+ /* Make sure Theme wrapper also participates in flex layout */
26
+ & :where(.radix-themes) {
27
+ display: flex;
28
+ flex-direction: column;
29
+ flex: 1;
30
+ height: 100%;
31
+ }
32
+
33
+ /* Floating type - ONLY visual changes */
34
+ &:where([data-type="floating"]) {
35
+ border-radius: var(--radius-4);
36
+ margin: var(--space-2);
37
+ height: calc(100vh - var(--space-4));
38
+ overflow: visible; /* Ensure shadow is not clipped */
39
+
40
+ /* Ensure Theme wrapper has proper border radius in floating mode */
41
+ & :where(.radix-themes) {
42
+ border-radius: inherit;
43
+ }
44
+ }
13
45
  }
14
46
 
15
47
  /* Sidebar Container */
@@ -19,35 +51,509 @@
19
51
  height: 100%;
20
52
  width: 100%;
21
53
  background-color: var(--color-panel-solid);
22
- border-right: 1px solid var(--gray-a5);
54
+ border-radius: inherit;
55
+ flex: 1;
23
56
  }
24
57
 
25
58
  /* Sidebar Header */
26
59
  .rt-SidebarHeader {
27
60
  display: flex;
61
+ flex-direction: column;
62
+ flex-shrink: 0;
63
+ border-radius: var(--sidebar-base-border-radius) var(--sidebar-base-border-radius) 0 0;
64
+
65
+ /* Support for SidebarMenuButton inside header */
66
+ & :where(.rt-SidebarMenuButton) {
67
+ /* Inherit all base MenuButton styles */
68
+ display: flex;
69
+ align-items: center;
70
+ gap: var(--space-2);
71
+ min-height: var(--sidebar-item-height);
72
+ padding-top: var(--sidebar-item-padding-y);
73
+ padding-bottom: var(--sidebar-item-padding-y);
74
+ padding-left: var(--sidebar-item-padding-left);
75
+ padding-right: var(--sidebar-item-padding-right);
76
+ box-sizing: border-box;
77
+ position: relative;
78
+ outline: none;
79
+ background: none;
80
+ border: none;
81
+ width: 100%;
82
+ text-align: left;
83
+ cursor: var(--cursor-menu-item);
84
+ user-select: none;
85
+
86
+ /* Header-specific styling */
87
+ justify-content: flex-start;
88
+ border-radius: var(--sidebar-base-border-radius) var(--sidebar-base-border-radius) 0 0;
89
+
90
+ /* Transitions */
91
+ transition: background var(--duration-2) var(--ease-1),
92
+ box-shadow var(--duration-2) var(--ease-1),
93
+ filter var(--duration-2) var(--ease-1);
94
+
95
+ /* Hover states - use data-highlighted from component */
96
+ &:where([data-highlighted]:not([data-disabled])) {
97
+ background-color: var(--gray-a3);
98
+ }
99
+
100
+ /* Active/Press state */
101
+ &:where(:active:not([data-disabled])) {
102
+ background-color: var(--gray-a4);
103
+ }
104
+
105
+ /* Focus state */
106
+ &:where(:focus-visible) {
107
+ outline: 2px solid var(--focus-8);
108
+ outline-offset: 2px;
109
+ }
110
+
111
+ /* Reduced motion support */
112
+ @media (prefers-reduced-motion: reduce) {
113
+ transition: none;
114
+ }
115
+ }
116
+ }
117
+
118
+ /* Header container variant - default flex container */
119
+ .rt-SidebarHeader:where(.rt-SidebarHeader--container) {
120
+ display: flex;
121
+ flex-direction: row;
122
+ align-items: center;
123
+ gap: var(--space-2);
124
+ padding: var(--sidebar-content-padding);
125
+ min-height: var(--sidebar-item-height);
126
+
127
+ /* Make MenuButtons expand to full width */
128
+ & :where(.rt-SidebarMenuButton) {
129
+ flex: 1;
130
+ }
131
+ }
132
+
133
+ /* Flex utilities for header layouts */
134
+ .rt-SidebarHeader:where(.rt-flex-row) {
135
+ flex-direction: row;
136
+ }
137
+
138
+ .rt-SidebarHeader:where(.rt-flex-col) {
139
+ flex-direction: column;
140
+ }
141
+
142
+ .rt-SidebarHeader:where(.rt-items-center) {
28
143
  align-items: center;
29
- padding: var(--space-3);
30
- border-bottom: 1px solid var(--gray-a5);
31
144
  }
32
145
 
33
- /* Sidebar Content */
146
+ .rt-SidebarHeader:where(.rt-items-start) {
147
+ align-items: flex-start;
148
+ }
149
+
150
+ .rt-SidebarHeader:where(.rt-items-end) {
151
+ align-items: flex-end;
152
+ }
153
+
154
+ .rt-SidebarHeader:where(.rt-justify-between) {
155
+ justify-content: space-between;
156
+ }
157
+
158
+ .rt-SidebarHeader:where(.rt-justify-center) {
159
+ justify-content: center;
160
+ }
161
+
162
+ .rt-SidebarHeader:where(.rt-justify-start) {
163
+ justify-content: flex-start;
164
+ }
165
+
166
+ .rt-SidebarHeader:where(.rt-justify-end) {
167
+ justify-content: flex-end;
168
+ }
169
+
170
+ .rt-SidebarHeader:where(.rt-gap-1) {
171
+ gap: var(--space-1);
172
+ }
173
+
174
+ .rt-SidebarHeader:where(.rt-gap-2) {
175
+ gap: var(--space-2);
176
+ }
177
+
178
+ .rt-SidebarHeader:where(.rt-gap-3) {
179
+ gap: var(--space-3);
180
+ }
181
+
182
+ .rt-SidebarHeader:where(.rt-gap-4) {
183
+ gap: var(--space-4);
184
+ }
185
+
186
+ /* Sidebar Content - based on rt-BaseMenuContent */
34
187
  .rt-SidebarContent {
188
+ --scrollarea-scrollbar-vertical-margin-top: var(--sidebar-content-padding);
189
+ --scrollarea-scrollbar-vertical-margin-bottom: var(--sidebar-content-padding);
190
+ --scrollarea-scrollbar-horizontal-margin-left: var(--sidebar-content-padding);
191
+ --scrollarea-scrollbar-horizontal-margin-right: var(--sidebar-content-padding);
192
+
193
+ display: flex;
194
+ flex-direction: column;
35
195
  flex: 1;
36
- padding: var(--space-2);
196
+ box-sizing: border-box;
197
+ min-height: 0; /* Critical for flex children to shrink */
198
+
199
+ /* Ensure ScrollArea takes full height within SidebarContent */
200
+ & :where(.rt-ScrollAreaRoot) {
201
+ flex: 1;
202
+ display: flex;
203
+ flex-direction: column;
204
+ min-height: 0;
205
+ }
206
+
207
+ & :where(.rt-ScrollAreaViewport) {
208
+ flex: 1;
209
+ display: flex;
210
+ flex-direction: column;
211
+ min-height: 0;
212
+ }
213
+ }
214
+
215
+ /* Sidebar Menu - based on rt-BaseMenuViewport */
216
+ .rt-SidebarMenu {
217
+ flex: 1;
218
+ display: flex;
219
+ flex-direction: column;
220
+ gap: var(--space-2); /* Use gap for consistent spacing */
221
+ padding: var(--sidebar-content-padding);
222
+ box-sizing: border-box;
223
+ list-style: none;
224
+ margin: 0;
37
225
  min-height: 0;
226
+
227
+ :where(.rt-SidebarContent:has(.rt-ScrollAreaScrollbar[data-orientation='vertical'])) & {
228
+ padding-right: var(--space-3);
229
+ }
230
+ }
231
+
232
+ /* Sidebar Menu Item */
233
+ .rt-SidebarMenuItem {
234
+ list-style: none;
235
+ }
236
+
237
+ /* Sidebar Menu Button - matches rt-BaseMenuItem */
238
+ .rt-SidebarMenuButton {
239
+ display: flex;
240
+ align-items: center;
241
+ gap: var(--space-2);
242
+ min-height: var(--sidebar-item-height);
243
+ padding-top: var(--sidebar-item-padding-y);
244
+ padding-bottom: var(--sidebar-item-padding-y);
245
+ padding-left: var(--sidebar-item-padding-left);
246
+ padding-right: var(--sidebar-item-padding-right);
247
+ box-sizing: border-box;
248
+ position: relative;
249
+ outline: none;
250
+ scroll-margin: var(--sidebar-content-padding) 0;
251
+ background: none;
252
+ border: none;
253
+ width: 100%;
254
+ text-align: left;
255
+ border-radius: var(--radius-2);
256
+
257
+ /* Transitions - similar to button but without transform */
258
+ transition: background var(--duration-2) var(--ease-1),
259
+ box-shadow var(--duration-2) var(--ease-1),
260
+ filter var(--duration-2) var(--ease-1);
261
+
262
+ /* Fix sticky text highlighting after selection in Firefox */
263
+ user-select: none;
264
+
265
+ /* Cursors */
266
+ cursor: var(--cursor-menu-item);
267
+ &:where([data-disabled]) {
268
+ cursor: default;
269
+ color: var(--gray-a8);
270
+ }
271
+
272
+ /* Hover state (mouse) + programmatic highlight */
273
+ &:where([data-highlighted]:not([data-disabled])) {
274
+ background-color: var(--gray-a3);
275
+ }
276
+
277
+ @media (hover: hover) {
278
+ &:where(:hover:not([data-disabled])) {
279
+ background-color: var(--gray-a3);
280
+ }
281
+ }
282
+
283
+ /* Active/Press state */
284
+ &:where(:active:not([data-disabled])) {
285
+ background-color: var(--gray-a4);
286
+ }
287
+
288
+ /* Active navigation state */
289
+ &:where([data-active], .rt-active) {
290
+ background-color: var(--accent-a3);
291
+ color: var(--accent-a12);
292
+ }
293
+
294
+ /* Focus state */
295
+ &:where(:focus-visible) {
296
+ outline: 2px solid var(--focus-8);
297
+ outline-offset: 2px;
298
+ }
299
+
300
+ /* Accent color support */
301
+ &:where([data-accent-color]) {
302
+ color: var(--accent-a11);
303
+ }
304
+
305
+ /* Gray text support */
306
+ & :where(.rt-Text[data-accent-color='gray'], [data-accent-color='gray']) {
307
+ color: var(--gray-a10);
308
+ }
309
+
310
+ /* Reduced motion support */
311
+ @media (prefers-reduced-motion: reduce) {
312
+ transition: none;
313
+ }
314
+ }
315
+
316
+ /* Sidebar Menu Sub Components - Radix Accordion */
317
+ .rt-SidebarMenuSubTrigger {
318
+ justify-content: space-between;
319
+ }
320
+
321
+ /* Accordion trigger icon rotation */
322
+ .rt-SidebarMenuSubTrigger {
323
+ & :where(.rt-SidebarMenuSubTriggerIcon) {
324
+ transition: transform 0.2s ease;
325
+ }
326
+
327
+ &:where([data-state="open"]) :where(.rt-SidebarMenuSubTriggerIcon) {
328
+ transform: rotate(90deg);
329
+ }
330
+ }
331
+
332
+ .rt-SidebarMenuSubContent {
333
+ overflow: hidden;
334
+
335
+ /* Allow focus outlines to show */
336
+ &:where(:focus-within) {
337
+ overflow: visible;
338
+ }
339
+
340
+ /* Radix Accordion animation support */
341
+ &:where([data-state="open"]) {
342
+ animation: rt-sidebar-slide-down 200ms ease-out;
343
+ }
344
+
345
+ &:where([data-state="closed"]) {
346
+ animation: rt-sidebar-slide-up 200ms ease-out;
347
+ }
348
+ }
349
+
350
+ @keyframes rt-sidebar-slide-down {
351
+ from {
352
+ height: 0;
353
+ }
354
+ to {
355
+ height: var(--radix-accordion-content-height);
356
+ }
357
+ }
358
+
359
+ @keyframes rt-sidebar-slide-up {
360
+ from {
361
+ height: var(--radix-accordion-content-height);
362
+ }
363
+ to {
364
+ height: 0;
365
+ }
366
+ }
367
+
368
+ .rt-SidebarMenuSubList {
369
+ padding-left: var(--space-4);
370
+ border-left: 1px solid var(--gray-a5);
371
+ margin-left: var(--space-3);
372
+ }
373
+
374
+ /* Sub-menu items have consistent heights based on size - match dropdown menu exactly */
375
+ :where(.rt-SidebarContent.rt-r-size-1) :where(.rt-SidebarMenuSubList) .rt-SidebarMenuButton {
376
+ padding-left: var(--space-3);
377
+ padding-top: calc(var(--space-1) * 0.75);
378
+ padding-bottom: calc(var(--space-1) * 0.75);
379
+ min-height: var(--space-5); /* 20px */
380
+ font-size: var(--font-size-1);
381
+ }
382
+
383
+ :where(.rt-SidebarContent.rt-r-size-2) :where(.rt-SidebarMenuSubList) .rt-SidebarMenuButton {
384
+ padding-left: var(--space-3);
385
+ padding-top: var(--space-1);
386
+ padding-bottom: var(--space-1);
387
+ min-height: var(--space-6); /* 24px */
388
+ font-size: var(--font-size-2);
38
389
  }
39
390
 
40
391
  /* Sidebar Footer */
41
392
  .rt-SidebarFooter {
42
- padding: var(--space-3);
43
- border-top: 1px solid var(--gray-a5);
393
+ display: flex;
394
+ flex-direction: column;
395
+ flex-shrink: 0;
396
+ margin-top: auto;
397
+ border-radius: 0 0 var(--sidebar-base-border-radius) var(--sidebar-base-border-radius);
398
+
399
+ /* Support for SidebarMenuButton inside footer */
400
+ & :where(.rt-SidebarMenuButton) {
401
+ /* Inherit all base MenuButton styles */
402
+ display: flex;
403
+ align-items: center;
404
+ gap: var(--space-2);
405
+ min-height: var(--sidebar-item-height);
406
+ padding-top: var(--sidebar-item-padding-y);
407
+ padding-bottom: var(--sidebar-item-padding-y);
408
+ padding-left: var(--sidebar-item-padding-left);
409
+ padding-right: var(--sidebar-item-padding-right);
410
+ box-sizing: border-box;
411
+ position: relative;
412
+ outline: none;
413
+ background: none;
414
+ border: none;
415
+ width: 100%;
416
+ text-align: left;
417
+ cursor: var(--cursor-menu-item);
418
+ user-select: none;
419
+
420
+ /* Footer-specific styling */
421
+ justify-content: flex-start;
422
+ border-radius: 0 0 var(--sidebar-base-border-radius) var(--sidebar-base-border-radius);
423
+
424
+ /* Transitions */
425
+ transition: background var(--duration-2) var(--ease-1),
426
+ box-shadow var(--duration-2) var(--ease-1),
427
+ filter var(--duration-2) var(--ease-1);
428
+
429
+ /* Hover states - use data-highlighted from component */
430
+ &:where([data-highlighted]:not([data-disabled])) {
431
+ background-color: var(--gray-a3);
432
+ }
433
+
434
+ /* Active/Press state */
435
+ &:where(:active:not([data-disabled])) {
436
+ background-color: var(--gray-a4);
437
+ }
438
+
439
+ /* Focus state */
440
+ &:where(:focus-visible) {
441
+ outline: 2px solid var(--focus-8);
442
+ outline-offset: 2px;
443
+ }
444
+
445
+ /* Reduced motion support */
446
+ @media (prefers-reduced-motion: reduce) {
447
+ transition: none;
448
+ }
449
+ }
44
450
  }
45
451
 
46
- /* Sidebar Inset (main content area) */
47
- .rt-SidebarInset {
48
- flex: 1;
49
- margin-left: var(--sidebar-width);
50
- transition: margin-left 0.2s ease;
452
+ /* Footer container variant - default flex container */
453
+ .rt-SidebarFooter:where(.rt-SidebarFooter--container) {
454
+ display: flex;
455
+ flex-direction: row;
456
+ align-items: center;
457
+ gap: var(--space-2);
458
+ padding: var(--sidebar-content-padding);
459
+ min-height: var(--sidebar-item-height);
460
+
461
+ /* Make MenuButtons expand to full width */
462
+ & :where(.rt-SidebarMenuButton) {
463
+ flex: 1;
464
+ }
465
+ }
466
+
467
+ /* Flex utilities for footer layouts */
468
+ .rt-SidebarFooter:where(.rt-flex-row) {
469
+ flex-direction: row;
470
+ }
471
+
472
+ .rt-SidebarFooter:where(.rt-flex-col) {
473
+ flex-direction: column;
474
+ }
475
+
476
+ .rt-SidebarFooter:where(.rt-items-center) {
477
+ align-items: center;
478
+ }
479
+
480
+ .rt-SidebarFooter:where(.rt-items-start) {
481
+ align-items: flex-start;
482
+ }
483
+
484
+ .rt-SidebarFooter:where(.rt-items-end) {
485
+ align-items: flex-end;
486
+ }
487
+
488
+ .rt-SidebarFooter:where(.rt-justify-between) {
489
+ justify-content: space-between;
490
+ }
491
+
492
+ .rt-SidebarFooter:where(.rt-justify-center) {
493
+ justify-content: center;
494
+ }
495
+
496
+ .rt-SidebarFooter:where(.rt-justify-start) {
497
+ justify-content: flex-start;
498
+ }
499
+
500
+ .rt-SidebarFooter:where(.rt-justify-end) {
501
+ justify-content: flex-end;
502
+ }
503
+
504
+ .rt-SidebarFooter:where(.rt-gap-1) {
505
+ gap: var(--space-1);
506
+ }
507
+
508
+ .rt-SidebarFooter:where(.rt-gap-2) {
509
+ gap: var(--space-2);
510
+ }
511
+
512
+ .rt-SidebarFooter:where(.rt-gap-3) {
513
+ gap: var(--space-3);
514
+ }
515
+
516
+ .rt-SidebarFooter:where(.rt-gap-4) {
517
+ gap: var(--space-4);
518
+ }
519
+
520
+ /* Sidebar Separator - ensure full width and proper spacing */
521
+ .rt-SidebarSeparator {
522
+ width: 100%;
523
+ margin: var(--space-2) 0;
524
+ }
525
+
526
+ /* Sidebar Group Components - add spacing between groups */
527
+ .rt-SidebarGroup {
528
+ display: flex;
529
+ flex-direction: column;
530
+ flex-shrink: 0;
531
+
532
+ /* Add spacing between groups without manual separators */
533
+ &:where(:not(:first-child)) {
534
+ margin-top: var(--space-4);
535
+ }
536
+ }
537
+
538
+ .rt-SidebarGroupLabel {
539
+ display: flex;
540
+ align-items: center;
541
+ min-height: var(--sidebar-item-height);
542
+ padding-top: var(--sidebar-item-padding-y);
543
+ padding-bottom: var(--sidebar-item-padding-y);
544
+ padding-left: var(--sidebar-item-padding-left);
545
+ padding-right: var(--sidebar-item-padding-right);
546
+ box-sizing: border-box;
547
+ color: var(--gray-a10);
548
+ user-select: none;
549
+ cursor: default;
550
+ flex-shrink: 0;
551
+ }
552
+
553
+ .rt-SidebarGroupContent {
554
+ display: flex;
555
+ flex-direction: column;
556
+ flex-shrink: 0;
51
557
  }
52
558
 
53
559
  /***************************************************************************************************
@@ -57,43 +563,189 @@
57
563
  ***************************************************************************************************/
58
564
 
59
565
  @breakpoints {
60
- .rt-SidebarRoot {
566
+ /* Container sizing - padding and border radius like Card */
567
+ .rt-SidebarContainer {
61
568
  &:where(.rt-r-size-1) {
62
- --sidebar-width: 14rem;
63
- --sidebar-width-icon: 2.5rem;
569
+ --sidebar-base-padding: var(--space-3);
570
+ --sidebar-base-border-radius: var(--radius-4);
571
+ /* Ensure header/footer menu buttons share the same sizing variables as content */
572
+ --sidebar-content-padding: var(--space-1);
573
+ --sidebar-item-padding-left: var(--space-2);
574
+ --sidebar-item-padding-right: var(--space-2);
575
+ --sidebar-item-padding-y: calc(var(--space-1) * 0.75);
576
+ --sidebar-item-height: var(--space-5);
64
577
  }
65
- &:where(.rt-r-size-3) {
66
- --sidebar-width: 18rem;
67
- --sidebar-width-icon: 3.5rem;
578
+ &:where(.rt-r-size-2) {
579
+ --sidebar-base-padding: var(--space-4);
580
+ --sidebar-base-border-radius: var(--radius-4);
581
+ /* Ensure header/footer menu buttons share the same sizing variables as content */
582
+ --sidebar-content-padding: var(--space-2);
583
+ --sidebar-item-padding-left: var(--space-3);
584
+ --sidebar-item-padding-right: var(--space-3);
585
+ --sidebar-item-padding-y: var(--space-1);
586
+ --sidebar-item-height: var(--space-6);
68
587
  }
69
588
  }
70
- }
71
589
 
72
- /* Size-specific padding adjustments */
73
- .rt-SidebarHeader {
74
- &:where(.rt-r-size-1) {
75
- padding: var(--space-2);
76
- }
77
- &:where(.rt-r-size-3) {
78
- padding: var(--space-4);
590
+ /* Content sizing - like base menu (dropdown menu) */
591
+ .rt-SidebarContent {
592
+ &:where(.rt-r-size-1) {
593
+ --sidebar-content-padding: var(--space-1);
594
+ --sidebar-item-padding-left: calc(var(--space-5) / 1.2);
595
+ --sidebar-item-padding-right: var(--space-2);
596
+ --sidebar-item-padding-y: calc(var(--space-1) * 0.75);
597
+ --sidebar-item-height: var(--space-5);
598
+ border-radius: var(--radius-3);
599
+
600
+ /* reset with :not:has so we still support browsers without :has */
601
+ &:where(:not(:has(.rt-BaseMenuCheckboxItem, .rt-BaseMenuRadioItem))) {
602
+ --sidebar-item-padding-left: var(--space-2);
603
+ }
604
+ &:where(:has(.rt-BaseMenuCheckboxItem, .rt-BaseMenuRadioItem)) {
605
+ --sidebar-item-padding-left: calc(var(--space-5) / 1.2);
606
+ }
607
+ }
608
+ &:where(.rt-r-size-2) {
609
+ --sidebar-content-padding: var(--space-2);
610
+ --sidebar-item-padding-left: var(--space-3);
611
+ --sidebar-item-padding-right: var(--space-3);
612
+ --sidebar-item-padding-y: var(--space-1);
613
+ --sidebar-item-height: var(--space-6);
614
+ border-radius: var(--radius-4);
615
+
616
+ /* reset with :not:has so we still support browsers without :has */
617
+ &:where(:not(:has(.rt-BaseMenuCheckboxItem, .rt-BaseMenuRadioItem))) {
618
+ --sidebar-item-padding-left: var(--space-3);
619
+ }
620
+ &:where(:has(.rt-BaseMenuCheckboxItem, .rt-BaseMenuRadioItem)) {
621
+ --sidebar-item-padding-left: var(--space-5);
622
+ }
623
+ }
79
624
  }
80
- }
81
625
 
82
- .rt-SidebarFooter {
83
- &:where(.rt-r-size-1) {
84
- padding: var(--space-2);
626
+ /* Size-specific menu button styling - matches base menu items */
627
+ .rt-SidebarContent:where(.rt-r-size-1) {
628
+ & :where(.rt-SidebarMenuButton) {
629
+ font-size: var(--font-size-1);
630
+ line-height: var(--line-height-1);
631
+ letter-spacing: var(--letter-spacing-1);
632
+ border-radius: var(--radius-1);
633
+
634
+ /* stylelint-disable-next-line selector-max-type */
635
+ & :where(svg) {
636
+ width: calc(var(--space-3) * 1.175);
637
+ height: calc(var(--space-3) * 1.175);
638
+ flex-shrink: 0;
639
+ }
640
+ }
641
+
642
+ /* Sub-trigger icon sizing - matches base menu exactly */
643
+ & :where(.rt-BaseMenuSubTriggerIcon) {
644
+ width: calc(8px * var(--scaling));
645
+ height: calc(8px * var(--scaling));
646
+ flex-shrink: 0;
647
+ margin-left: auto;
648
+ }
649
+
650
+ /* Group label sizing - matches base menu */
651
+ & :where(.rt-SidebarGroupLabel) {
652
+ font-size: var(--font-size-1);
653
+ line-height: var(--line-height-1);
654
+ letter-spacing: var(--letter-spacing-1);
655
+ }
85
656
  }
86
- &:where(.rt-r-size-3) {
87
- padding: var(--space-4);
657
+
658
+ /* Header and footer styling for size 1 */
659
+ .rt-SidebarContainer:where(.rt-r-size-1) {
660
+ & :where(.rt-SidebarHeader .rt-SidebarMenuButton) {
661
+ font-size: var(--font-size-1);
662
+ line-height: var(--line-height-1);
663
+ letter-spacing: var(--letter-spacing-1);
664
+ border-radius: var(--radius-1);
665
+
666
+ /* stylelint-disable-next-line selector-max-type */
667
+ & :where(svg) {
668
+ width: calc(var(--space-3) * 1.175);
669
+ height: calc(var(--space-3) * 1.175);
670
+ flex-shrink: 0;
671
+ }
672
+ }
673
+
674
+ & :where(.rt-SidebarFooter .rt-SidebarMenuButton) {
675
+ font-size: var(--font-size-1);
676
+ line-height: var(--line-height-1);
677
+ letter-spacing: var(--letter-spacing-1);
678
+ border-radius: var(--radius-1);
679
+
680
+ /* stylelint-disable-next-line selector-max-type */
681
+ & :where(svg) {
682
+ width: calc(var(--space-3) * 1.175);
683
+ height: calc(var(--space-3) * 1.175);
684
+ flex-shrink: 0;
685
+ }
686
+ }
88
687
  }
89
- }
90
688
 
91
- .rt-SidebarContent {
92
- &:where(.rt-r-size-1) {
93
- padding: var(--space-1);
689
+ .rt-SidebarContent:where(.rt-r-size-2) {
690
+ & :where(.rt-SidebarMenuButton) {
691
+ font-size: var(--font-size-2);
692
+ line-height: var(--line-height-2);
693
+ letter-spacing: var(--letter-spacing-2);
694
+ border-radius: var(--radius-2);
695
+
696
+ /* stylelint-disable-next-line selector-max-type */
697
+ & :where(svg) {
698
+ width: var(--space-4);
699
+ height: var(--space-4);
700
+ flex-shrink: 0;
701
+ }
702
+ }
703
+
704
+ /* Sub-trigger icon sizing - matches base menu exactly */
705
+ & :where(.rt-BaseMenuSubTriggerIcon) {
706
+ width: calc(10px * var(--scaling));
707
+ height: calc(10px * var(--scaling));
708
+ flex-shrink: 0;
709
+ margin-left: auto;
710
+ }
711
+
712
+ /* Group label sizing - matches base menu */
713
+ & :where(.rt-SidebarGroupLabel) {
714
+ font-size: var(--font-size-2);
715
+ line-height: var(--line-height-2);
716
+ letter-spacing: var(--letter-spacing-2);
717
+ }
94
718
  }
95
- &:where(.rt-r-size-3) {
96
- padding: var(--space-3);
719
+
720
+ /* Header and footer styling for size 2 */
721
+ .rt-SidebarContainer:where(.rt-r-size-2) {
722
+ & :where(.rt-SidebarHeader .rt-SidebarMenuButton) {
723
+ font-size: var(--font-size-2);
724
+ line-height: var(--line-height-2);
725
+ letter-spacing: var(--letter-spacing-2);
726
+ border-radius: var(--radius-2);
727
+
728
+ /* stylelint-disable-next-line selector-max-type */
729
+ & :where(svg) {
730
+ width: var(--space-4);
731
+ height: var(--space-4);
732
+ flex-shrink: 0;
733
+ }
734
+ }
735
+
736
+ & :where(.rt-SidebarFooter .rt-SidebarMenuButton) {
737
+ font-size: var(--font-size-2);
738
+ line-height: var(--line-height-2);
739
+ letter-spacing: var(--letter-spacing-2);
740
+ border-radius: var(--radius-2);
741
+
742
+ /* stylelint-disable-next-line selector-max-type */
743
+ & :where(svg) {
744
+ width: var(--space-4);
745
+ height: var(--space-4);
746
+ flex-shrink: 0;
747
+ }
748
+ }
97
749
  }
98
750
  }
99
751
 
@@ -103,30 +755,174 @@
103
755
  * *
104
756
  ***************************************************************************************************/
105
757
 
758
+ /* Sidebar Container Variants */
106
759
  .rt-SidebarContainer {
107
- &:where(.rt-variant-classic) {
108
- background-color: var(--color-surface);
109
- border: 1px solid var(--gray-a5);
110
- }
111
760
  &:where(.rt-variant-ghost) {
112
761
  background-color: transparent;
113
762
  border: none;
114
763
  }
764
+ &:where(.rt-variant-soft) {
765
+ background-color: var(--accent-a2);
766
+ }
767
+ &:where(.rt-variant-surface) {
768
+ background-color: var(--color-surface);
769
+
770
+ /* Border on the side opposite to sidebar position */
771
+ &:where([data-side="left"]) {
772
+ border-right: 1px solid var(--gray-a6);
773
+ }
774
+
775
+ &:where([data-side="right"]) {
776
+ border-left: 1px solid var(--gray-a6);
777
+ }
778
+ }
779
+ }
780
+
781
+ /* Floating shadows - only for ghost variant */
782
+ .rt-SidebarContainer:where(.rt-variant-ghost) {
783
+ :where(.rt-SidebarRoot[data-type="floating"]) & {
784
+ box-shadow: var(--shadow-4);
785
+ }
786
+ }
787
+
788
+ /* Floating borders - only for surface variant */
789
+ .rt-SidebarContainer:where(.rt-variant-surface) {
790
+ :where(.rt-SidebarRoot[data-type="floating"]) & {
791
+ border: 1px solid var(--gray-a6);
792
+ }
793
+ }
794
+
795
+ /* Menu Button Variants - Independent of Container */
796
+
797
+ /* Menu Variant: Solid */
798
+ .rt-SidebarHeader:where(.rt-menu-variant-solid),
799
+ .rt-SidebarContent:where(.rt-menu-variant-solid),
800
+ .rt-SidebarFooter:where(.rt-menu-variant-solid) {
801
+ /* Active navigation state for solid variant */
802
+ & :where(.rt-SidebarMenuButton[data-active]) {
803
+ background-color: var(--accent-9);
804
+ color: var(--accent-contrast);
805
+
806
+ /* Force all text elements to inherit active color */
807
+ & :where(.rt-Text) {
808
+ color: inherit !important;
809
+ }
810
+
811
+ & :where([data-accent-color='gray']) {
812
+ color: inherit !important;
813
+ }
814
+ }
815
+
816
+ /* Hover/highlighted state for solid variant */
817
+ & :where(.rt-SidebarMenuButton[data-highlighted]) {
818
+ background-color: var(--accent-9);
819
+ color: var(--accent-contrast);
820
+
821
+ /* Force all text elements to inherit hover color */
822
+ & :where(.rt-Text) {
823
+ color: inherit !important;
824
+ }
825
+
826
+ & :where([data-accent-color='gray']) {
827
+ color: inherit !important;
828
+ }
829
+ }
830
+
831
+ /* High contrast support for solid variant */
832
+ &:where(.rt-high-contrast) {
833
+ & :where(.rt-SidebarMenuButton[data-active]),
834
+ & :where(.rt-SidebarMenuButton[data-highlighted]) {
835
+ background-color: var(--accent-12);
836
+ color: var(--accent-1);
837
+
838
+ & :where(.rt-Text) {
839
+ color: inherit !important;
840
+ }
841
+
842
+ & :where([data-accent-color='gray']) {
843
+ color: inherit !important;
844
+ }
845
+
846
+ &:where([data-accent-color]) {
847
+ background-color: var(--accent-9);
848
+ color: var(--accent-contrast);
849
+
850
+ & :where(.rt-Text) {
851
+ color: inherit !important;
852
+ }
853
+
854
+ & :where([data-accent-color='gray']) {
855
+ color: inherit !important;
856
+ }
857
+ }
858
+ }
859
+ }
860
+ }
861
+
862
+ /* Menu Variant: Soft */
863
+ .rt-SidebarHeader:where(.rt-menu-variant-soft),
864
+ .rt-SidebarContent:where(.rt-menu-variant-soft),
865
+ .rt-SidebarFooter:where(.rt-menu-variant-soft) {
866
+ /* Active navigation state for soft variant */
867
+ & :where(.rt-SidebarMenuButton[data-active]) {
868
+ background-color: var(--accent-a4);
869
+ color: var(--accent-a12);
870
+
871
+ /* In soft variant, improve contrast for gray text while maintaining hierarchy */
872
+ & :where(.rt-Text[data-accent-color='gray'], [data-accent-color='gray']) {
873
+ color: var(--gray-11) !important;
874
+ }
875
+ }
876
+
877
+ /* Hover/highlighted state for soft variant */
878
+ & :where(.rt-SidebarMenuButton[data-highlighted]) {
879
+ background-color: var(--accent-a4);
880
+
881
+ /* In soft variant, improve contrast for gray text while maintaining hierarchy */
882
+ & :where(.rt-Text[data-accent-color='gray'], [data-accent-color='gray']) {
883
+ color: var(--gray-11) !important;
884
+ }
885
+ }
115
886
  }
116
887
 
888
+
889
+
890
+
891
+
892
+
893
+
117
894
  /* Ensure menu items inherit proper theming and spacing for sidebar */
118
895
  .rt-SidebarContent :where(.rt-BaseMenuItem) {
119
896
  border-radius: var(--radius-2);
120
897
  margin-bottom: var(--space-1);
121
898
  }
122
899
 
900
+ /* Collapsible behavior */
901
+ .rt-SidebarRoot:where([data-collapsible="icon"][data-state="collapsed"]) {
902
+ transform: translateX(-100%);
903
+ transition: transform var(--duration-3) var(--ease-2);
904
+ }
905
+
906
+ .rt-SidebarRoot:where([data-collapsible="icon"][data-state="expanded"]) {
907
+ transform: translateX(0);
908
+ transition: transform var(--duration-3) var(--ease-2);
909
+ }
910
+
911
+ /* Right-side sidebar adjustments */
912
+ .rt-SidebarRoot:where([data-collapsible="icon"][data-state="collapsed"][data-side="right"]) {
913
+ transform: translateX(100%);
914
+ }
915
+
916
+ /* Reduced motion support for collapsible */
917
+ @media (prefers-reduced-motion: reduce) {
918
+ .rt-SidebarRoot:where([data-collapsible="icon"]) {
919
+ transition: none;
920
+ }
921
+ }
922
+
123
923
  /* Responsive behavior */
124
924
  @media (max-width: 768px) {
125
925
  .rt-SidebarRoot {
126
926
  display: none;
127
927
  }
128
-
129
- .rt-SidebarInset {
130
- margin-left: 0;
131
- }
132
928
  }