@plexui/styles 0.1.25 → 0.1.26

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.
@@ -224,16 +224,20 @@
224
224
  }/* Focus visible */.MenuButton:focus-visible::before {
225
225
  box-shadow: 0 0 0 2px var(--color-ring);
226
226
  }/* Inner container - controls height like reference .abr-y */.MenuButtonInner {
227
+ /* The row's height: a badge keeps an even inset inside it */
228
+ --sidebar-menu-row-height: var(--sidebar-menu-item-height);
229
+
227
230
  position: relative;
228
231
  display: flex;
229
232
  align-items: center;
230
233
  width: 100%;
231
- height: var(--sidebar-menu-item-height);
232
- padding-right: 12px; /* Space for chevron from edge */
234
+ height: var(--sidebar-menu-row-height);
235
+ /* Counts and the chevron end here */
236
+ padding-right: var(--sidebar-menu-item-trailing-padding);
233
237
  overflow: hidden;
234
238
  }@media (min-width: 768px) {
235
239
  .MenuButtonInner {
236
- height: var(--sidebar-menu-item-height-desktop);
240
+ --sidebar-menu-row-height: var(--sidebar-menu-item-height-desktop);
237
241
  }
238
242
 
239
243
  .MenuButton {
@@ -284,21 +288,77 @@
284
288
  }/* No special button positioning when collapsed - keep left alignment for smooth transition */:global([data-sidebar="collapsed"]) .MenuButton {
285
289
  width: 100%;
286
290
  }/* Icon stays same size when collapsed - centering via parent justify-content *//* Menu button sizes */.MenuButton[data-size="sm"] .MenuButtonInner {
287
- height: 28px;
291
+ --sidebar-menu-row-height: 28px;
288
292
  }.MenuButton[data-size="lg"] .MenuButtonInner {
289
- height: var(--sidebar-menu-item-height);
293
+ --sidebar-menu-row-height: var(--sidebar-menu-item-height);
290
294
  }/* =============================================
291
295
  Menu Badge & Action
292
296
  ============================================= */.MenuBadge {
293
297
  position: relative;
294
298
  z-index: 1;
299
+ /* Trailing, also in a SidebarMenuSubButton that has no label to push it */
300
+ margin-left: auto;
295
301
  padding-left: calc(var(--spacing) * 2);
302
+ /* Plain text, such as a count, reads quieter than the label */
303
+ color: var(--color-text-secondary);
304
+ font-size: var(--font-text-xs-size);
305
+ font-variant-numeric: tabular-nums;
306
+ font-weight: var(--font-weight-normal);
307
+ line-height: var(--font-text-xs-line-height);
296
308
  transition: opacity var(--sidebar-collapse-duration) var(--cubic-move);
297
309
  transition-delay: 0.2s;
310
+ }/* A Badge sits as far from the row's edge as from its top and bottom, in
311
+ step with the highlight's rounded end. Its own padding reaches past the
312
+ trailing padding, so its digits end where plain counts and the chevron end.
313
+ A badge before a chevron keeps its place. */.MenuBadge:last-child:has(> [data-size]) {
314
+ --sidebar-menu-badge-height: var(--badge-size-sm);
315
+
316
+ margin-right: calc(
317
+ (var(--sidebar-menu-row-height, var(--sidebar-menu-item-height-desktop)) - var(--sidebar-menu-badge-height)) / 2 -
318
+ var(--sidebar-menu-item-trailing-padding)
319
+ );
320
+ }.MenuBadge:last-child:has(> [data-size="md"]) {
321
+ --sidebar-menu-badge-height: var(--badge-size-md);
298
322
  }:global([data-sidebar="collapsed"]) .MenuBadge:not(:where([data-sidebar="collapsed"] [data-sidebar="expanded"] *)) {
299
323
  opacity: 0;
300
324
  pointer-events: none;
301
325
  transition-delay: 0s;
326
+ }/* In the collapsed rail a Badge becomes a dot of its color at the top right
327
+ of the row's icon, just clear of the glyph. Plain text, such as a count,
328
+ only fades. */.MenuButtonInner:has(> .MenuBadge > [data-color]) {
329
+ /* A grey solid is too dark on a dark rail: secondary text reads in both themes */
330
+ --sidebar-menu-badge-dot-color: var(--color-text-secondary);
331
+ }.MenuButtonInner:has(> .MenuBadge > [data-color="success"]) {
332
+ --sidebar-menu-badge-dot-color: var(--color-background-success-solid);
333
+ }.MenuButtonInner:has(> .MenuBadge > [data-color="warning"]) {
334
+ --sidebar-menu-badge-dot-color: var(--color-background-warning-solid);
335
+ }.MenuButtonInner:has(> .MenuBadge > [data-color="danger"]) {
336
+ --sidebar-menu-badge-dot-color: var(--color-background-danger-solid);
337
+ }.MenuButtonInner:has(> .MenuBadge > [data-color="info"]) {
338
+ --sidebar-menu-badge-dot-color: var(--color-background-info-solid);
339
+ }.MenuButtonInner:has(> .MenuBadge > [data-color="discovery"]) {
340
+ --sidebar-menu-badge-dot-color: var(--color-background-discovery-solid);
341
+ }.MenuButtonInner:has(> .MenuBadge > [data-color="caution"]) {
342
+ --sidebar-menu-badge-dot-color: var(--color-background-caution-solid);
343
+ }.MenuButtonInner:has(> .MenuBadge > [data-color]) > .MenuButtonIcon::after {
344
+ --sidebar-menu-badge-dot-offset: calc(
345
+ (var(--sidebar-icon-wrapper-size) - var(--sidebar-icon-size)) / 2 - var(--sidebar-menu-badge-dot-size) + 1px
346
+ );
347
+
348
+ position: absolute;
349
+ top: var(--sidebar-menu-badge-dot-offset);
350
+ right: var(--sidebar-menu-badge-dot-offset);
351
+ width: var(--sidebar-menu-badge-dot-size);
352
+ height: var(--sidebar-menu-badge-dot-size);
353
+ border-radius: var(--radius-full);
354
+ background: var(--sidebar-menu-badge-dot-color);
355
+ content: "";
356
+ opacity: 0;
357
+ pointer-events: none;
358
+ transition: opacity var(--sidebar-collapse-duration) var(--cubic-move);
359
+ }:global([data-sidebar="collapsed"]) .MenuButtonInner:has(> .MenuBadge > [data-color]):not(:where([data-sidebar="collapsed"] [data-sidebar="expanded"] *)) > .MenuButtonIcon::after {
360
+ opacity: 1;
361
+ transition-delay: 0.1s;
302
362
  }.MenuAction {
303
363
  position: relative;
304
364
  z-index: 1;
@@ -323,12 +383,17 @@
323
383
  }.MenuSubItem {
324
384
  position: relative;
325
385
  }.MenuSubButton {
386
+ /* The row's height: a badge keeps an even inset inside it */
387
+ --sidebar-menu-row-height: calc(
388
+ 2 * var(--sidebar-menu-sub-item-padding-y, 8px) + var(--sidebar-menu-sub-item-line-height, 20px)
389
+ );
390
+
326
391
  /* Inherits MenuButton base styles (replaced composes for Turbopack compatibility) */
327
392
  position: relative;
328
393
  display: flex;
329
394
  align-items: center;
330
395
  width: 100%;
331
- padding: var(--sidebar-menu-sub-item-padding-y, 8px) 12px;
396
+ padding: var(--sidebar-menu-sub-item-padding-y, 8px) var(--sidebar-menu-item-trailing-padding);
332
397
  margin: var(--sidebar-menu-item-margin);
333
398
  border: none;
334
399
  border-radius: 0;
@@ -381,7 +446,9 @@
381
446
  box-shadow: 0 0 0 2px var(--color-ring);
382
447
  }@media (min-width: 768px) {
383
448
  .MenuSubButton {
384
- padding: 6px 12px;
449
+ --sidebar-menu-row-height: calc(12px + var(--sidebar-menu-sub-item-line-height, 20px));
450
+
451
+ padding: 6px var(--sidebar-menu-item-trailing-padding);
385
452
  }
386
453
  }/* Indent levels for nested items - full-width buttons with padding for text *//* indent0 = 12px aligns with section header (GroupLabel) */.MenuSubButton.indent0 {
387
454
  padding-left: 12px;
@@ -407,6 +474,9 @@
407
474
  display: flex;
408
475
  align-items: center;
409
476
  justify-content: center;
477
+ /* The glyph has 3px of air in its box: pulled into the trailing padding,
478
+ it ends where counts end, and turns about the same axis */
479
+ margin-right: -3px;
410
480
  margin-left: auto;
411
481
  color: inherit; /* Inherit from parent item */
412
482
  transition: transform 0.15s;
@@ -1009,7 +1079,7 @@ background: var(--gray-300);
1009
1079
  }
1010
1080
 
1011
1081
  .App .MobileSidebar .MenuButtonInner {
1012
- padding-right: 8px;
1082
+ --sidebar-menu-item-trailing-padding: 8px;
1013
1083
  }
1014
1084
 
1015
1085
  .App .MobileSidebar .MenuButtonLabel {
@@ -1021,6 +1091,11 @@ background: var(--gray-300);
1021
1091
  height: 18px;
1022
1092
  }
1023
1093
 
1094
+ .App .MobileSidebar .MenuBadge {
1095
+ font-size: 17px;
1096
+ line-height: 22px;
1097
+ }
1098
+
1024
1099
  .App .MobileSidebar .MenuBadge span {
1025
1100
  padding-right: 0;
1026
1101
  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.26",
4
4
  "description": "Framework-agnostic CSS for Plex UI: design tokens, globals and component styles",
5
5
  "type": "module",
6
6
  "license": "MIT",