@plexui/styles 0.1.25 → 0.1.27

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.
@@ -41,6 +41,11 @@
41
41
  }/* Hide all spans in header when collapsed, except the collapse trigger's own */:global([data-sidebar="collapsed"]) .Header span:not(:where(.Trigger, .Trigger *)) {
42
42
  opacity: 0;
43
43
  pointer-events: none;
44
+ }/* A title beside the trigger also gives up its width, so the trigger stands
45
+ on the icons' axis rather than half a title to the right */:global([data-sidebar="collapsed"]) .Header > span:not(:where(.Trigger, .Trigger *)) {
46
+ max-width: 0;
47
+ overflow: hidden;
48
+ white-space: nowrap;
44
49
  }/* Keep only the logo icon visible (first element with fixed size). A wrapper
45
50
  around the trigger (a Tooltip, say) keeps its own size. */:global([data-sidebar="collapsed"]) .Header > div:not(:has(.Trigger)) {
46
51
  width: 32px;
@@ -224,16 +229,20 @@
224
229
  }/* Focus visible */.MenuButton:focus-visible::before {
225
230
  box-shadow: 0 0 0 2px var(--color-ring);
226
231
  }/* Inner container - controls height like reference .abr-y */.MenuButtonInner {
232
+ /* The row's height: a badge keeps an even inset inside it */
233
+ --sidebar-menu-row-height: var(--sidebar-menu-item-height);
234
+
227
235
  position: relative;
228
236
  display: flex;
229
237
  align-items: center;
230
238
  width: 100%;
231
- height: var(--sidebar-menu-item-height);
232
- padding-right: 12px; /* Space for chevron from edge */
239
+ height: var(--sidebar-menu-row-height);
240
+ /* Counts and the chevron end here */
241
+ padding-right: var(--sidebar-menu-item-trailing-padding);
233
242
  overflow: hidden;
234
243
  }@media (min-width: 768px) {
235
244
  .MenuButtonInner {
236
- height: var(--sidebar-menu-item-height-desktop);
245
+ --sidebar-menu-row-height: var(--sidebar-menu-item-height-desktop);
237
246
  }
238
247
 
239
248
  .MenuButton {
@@ -284,21 +293,77 @@
284
293
  }/* No special button positioning when collapsed - keep left alignment for smooth transition */:global([data-sidebar="collapsed"]) .MenuButton {
285
294
  width: 100%;
286
295
  }/* Icon stays same size when collapsed - centering via parent justify-content *//* Menu button sizes */.MenuButton[data-size="sm"] .MenuButtonInner {
287
- height: 28px;
296
+ --sidebar-menu-row-height: 28px;
288
297
  }.MenuButton[data-size="lg"] .MenuButtonInner {
289
- height: var(--sidebar-menu-item-height);
298
+ --sidebar-menu-row-height: var(--sidebar-menu-item-height);
290
299
  }/* =============================================
291
300
  Menu Badge & Action
292
301
  ============================================= */.MenuBadge {
293
302
  position: relative;
294
303
  z-index: 1;
304
+ /* Trailing, also in a SidebarMenuSubButton that has no label to push it */
305
+ margin-left: auto;
295
306
  padding-left: calc(var(--spacing) * 2);
307
+ /* Plain text, such as a count, reads quieter than the label */
308
+ color: var(--color-text-secondary);
309
+ font-size: var(--font-text-xs-size);
310
+ font-variant-numeric: tabular-nums;
311
+ font-weight: var(--font-weight-normal);
312
+ line-height: var(--font-text-xs-line-height);
296
313
  transition: opacity var(--sidebar-collapse-duration) var(--cubic-move);
297
314
  transition-delay: 0.2s;
315
+ }/* A Badge sits as far from the row's edge as from its top and bottom, in
316
+ step with the highlight's rounded end. Its own padding reaches past the
317
+ trailing padding, so its digits end where plain counts and the chevron end.
318
+ A badge before a chevron keeps its place. */.MenuBadge:last-child:has(> [data-size]) {
319
+ --sidebar-menu-badge-height: var(--badge-size-sm);
320
+
321
+ margin-right: calc(
322
+ (var(--sidebar-menu-row-height, var(--sidebar-menu-item-height-desktop)) - var(--sidebar-menu-badge-height)) / 2 -
323
+ var(--sidebar-menu-item-trailing-padding)
324
+ );
325
+ }.MenuBadge:last-child:has(> [data-size="md"]) {
326
+ --sidebar-menu-badge-height: var(--badge-size-md);
298
327
  }:global([data-sidebar="collapsed"]) .MenuBadge:not(:where([data-sidebar="collapsed"] [data-sidebar="expanded"] *)) {
299
328
  opacity: 0;
300
329
  pointer-events: none;
301
330
  transition-delay: 0s;
331
+ }/* In the collapsed rail a Badge becomes a dot of its color at the top right
332
+ of the row's icon, just clear of the glyph. Plain text, such as a count,
333
+ only fades. */.MenuButtonInner:has(> .MenuBadge > [data-color]) {
334
+ /* A grey solid is too dark on a dark rail: secondary text reads in both themes */
335
+ --sidebar-menu-badge-dot-color: var(--color-text-secondary);
336
+ }.MenuButtonInner:has(> .MenuBadge > [data-color="success"]) {
337
+ --sidebar-menu-badge-dot-color: var(--color-background-success-solid);
338
+ }.MenuButtonInner:has(> .MenuBadge > [data-color="warning"]) {
339
+ --sidebar-menu-badge-dot-color: var(--color-background-warning-solid);
340
+ }.MenuButtonInner:has(> .MenuBadge > [data-color="danger"]) {
341
+ --sidebar-menu-badge-dot-color: var(--color-background-danger-solid);
342
+ }.MenuButtonInner:has(> .MenuBadge > [data-color="info"]) {
343
+ --sidebar-menu-badge-dot-color: var(--color-background-info-solid);
344
+ }.MenuButtonInner:has(> .MenuBadge > [data-color="discovery"]) {
345
+ --sidebar-menu-badge-dot-color: var(--color-background-discovery-solid);
346
+ }.MenuButtonInner:has(> .MenuBadge > [data-color="caution"]) {
347
+ --sidebar-menu-badge-dot-color: var(--color-background-caution-solid);
348
+ }.MenuButtonInner:has(> .MenuBadge > [data-color]) > .MenuButtonIcon::after {
349
+ --sidebar-menu-badge-dot-offset: calc(
350
+ (var(--sidebar-icon-wrapper-size) - var(--sidebar-icon-size)) / 2 - var(--sidebar-menu-badge-dot-size) + 1px
351
+ );
352
+
353
+ position: absolute;
354
+ top: var(--sidebar-menu-badge-dot-offset);
355
+ right: var(--sidebar-menu-badge-dot-offset);
356
+ width: var(--sidebar-menu-badge-dot-size);
357
+ height: var(--sidebar-menu-badge-dot-size);
358
+ border-radius: var(--radius-full);
359
+ background: var(--sidebar-menu-badge-dot-color);
360
+ content: "";
361
+ opacity: 0;
362
+ pointer-events: none;
363
+ transition: opacity var(--sidebar-collapse-duration) var(--cubic-move);
364
+ }:global([data-sidebar="collapsed"]) .MenuButtonInner:has(> .MenuBadge > [data-color]):not(:where([data-sidebar="collapsed"] [data-sidebar="expanded"] *)) > .MenuButtonIcon::after {
365
+ opacity: 1;
366
+ transition-delay: 0.1s;
302
367
  }.MenuAction {
303
368
  position: relative;
304
369
  z-index: 1;
@@ -323,12 +388,17 @@
323
388
  }.MenuSubItem {
324
389
  position: relative;
325
390
  }.MenuSubButton {
391
+ /* The row's height: a badge keeps an even inset inside it */
392
+ --sidebar-menu-row-height: calc(
393
+ 2 * var(--sidebar-menu-sub-item-padding-y, 8px) + var(--sidebar-menu-sub-item-line-height, 20px)
394
+ );
395
+
326
396
  /* Inherits MenuButton base styles (replaced composes for Turbopack compatibility) */
327
397
  position: relative;
328
398
  display: flex;
329
399
  align-items: center;
330
400
  width: 100%;
331
- padding: var(--sidebar-menu-sub-item-padding-y, 8px) 12px;
401
+ padding: var(--sidebar-menu-sub-item-padding-y, 8px) var(--sidebar-menu-item-trailing-padding);
332
402
  margin: var(--sidebar-menu-item-margin);
333
403
  border: none;
334
404
  border-radius: 0;
@@ -381,7 +451,9 @@
381
451
  box-shadow: 0 0 0 2px var(--color-ring);
382
452
  }@media (min-width: 768px) {
383
453
  .MenuSubButton {
384
- padding: 6px 12px;
454
+ --sidebar-menu-row-height: calc(12px + var(--sidebar-menu-sub-item-line-height, 20px));
455
+
456
+ padding: 6px var(--sidebar-menu-item-trailing-padding);
385
457
  }
386
458
  }/* Indent levels for nested items - full-width buttons with padding for text *//* indent0 = 12px aligns with section header (GroupLabel) */.MenuSubButton.indent0 {
387
459
  padding-left: 12px;
@@ -407,6 +479,9 @@
407
479
  display: flex;
408
480
  align-items: center;
409
481
  justify-content: center;
482
+ /* The glyph has 3px of air in its box: pulled into the trailing padding,
483
+ it ends where counts end, and turns about the same axis */
484
+ margin-right: -3px;
410
485
  margin-left: auto;
411
486
  color: inherit; /* Inherit from parent item */
412
487
  transition: transform 0.15s;
@@ -916,6 +991,9 @@ background: var(--gray-300);
916
991
  flex-shrink: 0;
917
992
  width: 40px;
918
993
  }.App .Footer {
994
+ /* The person row is twice as tall as the icon axis is far from its edge
995
+ (40px): the round end of its highlight is then concentric with an avatar */
996
+ --sidebar-menu-item-height-desktop: 40px;
919
997
  --sidebar-menu-item-margin-desktop: 0;
920
998
  position: relative;
921
999
  min-height: 49px;
@@ -1009,7 +1087,7 @@ background: var(--gray-300);
1009
1087
  }
1010
1088
 
1011
1089
  .App .MobileSidebar .MenuButtonInner {
1012
- padding-right: 8px;
1090
+ --sidebar-menu-item-trailing-padding: 8px;
1013
1091
  }
1014
1092
 
1015
1093
  .App .MobileSidebar .MenuButtonLabel {
@@ -1021,6 +1099,11 @@ background: var(--gray-300);
1021
1099
  height: 18px;
1022
1100
  }
1023
1101
 
1102
+ .App .MobileSidebar .MenuBadge {
1103
+ font-size: 17px;
1104
+ line-height: 22px;
1105
+ }
1106
+
1024
1107
  .App .MobileSidebar .MenuBadge span {
1025
1108
  padding-right: 0;
1026
1109
  font-size: 17px;
@@ -555,6 +555,8 @@
555
555
  --sidebar-menu-item-radius: 8px;
556
556
  --sidebar-menu-item-font-size: 14px;
557
557
  --sidebar-menu-item-line-height: 20px;
558
+ --sidebar-menu-item-trailing-padding: 12px;
559
+ --sidebar-menu-badge-dot-size: 6px;
558
560
 
559
561
  /* Icon */
560
562
  --sidebar-icon-size: 20px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plexui/styles",
3
- "version": "0.1.25",
3
+ "version": "0.1.27",
4
4
  "description": "Framework-agnostic CSS for Plex UI: design tokens, globals and component styles",
5
5
  "type": "module",
6
6
  "license": "MIT",