@plexui/styles 0.1.24 → 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.
@@ -274,6 +274,30 @@
274
274
  box-shadow: none;
275
275
  }.Field:where([data-row]:not([data-orientation="vertical"])) .Control > [data-variant="ghost"] > input {
276
276
  text-align: end;
277
+ }/* A FieldGroup with `columns`: every value starts at one column, as in an iOS form of
278
+ typed details. A field keeps its width, a ghost takes the rest of the line, a switch
279
+ and an action stay at the end. */[data-field-columns] .Field:where([data-row]:not([data-orientation="vertical"]):not(:has(> .Action))),
280
+ [data-field-columns] .Field:where([data-row]:not([data-orientation="vertical"]):not(:has(> .Action))):has(
281
+ .Control > [data-variant="ghost"] > input,
282
+ .Control > [data-variant="ghost"] > textarea
283
+ ) {
284
+ --field-row-gap: 16px;
285
+
286
+ grid-template-columns: var(--field-row-column-width) minmax(0, 1fr);
287
+ }[data-field-columns] .Field:where([data-row]:not([data-orientation="vertical"])) .Control:has(
288
+ > [data-variant]:not([data-variant="ghost"]) > input,
289
+ > [data-variant]:not([data-variant="ghost"]) > textarea,
290
+ > [data-variant][role="button"]
291
+ ) {
292
+ justify-self: start;
293
+ }[data-field-columns] .Field:where([data-row]:not([data-orientation="vertical"])) .Control > [data-variant="ghost"] > input {
294
+ text-align: start;
295
+ }@media (min-width: 768px) {
296
+ [data-field-columns] .Field:where([data-row]:not([data-orientation="vertical"])):has(> .Action) {
297
+ --field-row-gap: 16px;
298
+
299
+ grid-template-columns: var(--field-row-column-width) minmax(0, 1fr) auto;
300
+ }
277
301
  }/* On a phone a list takes the width of its own line under the label and the action.
278
302
  The row is the frame of every field, as on iOS: the framed fields of the web read
279
303
  as the ghost above, with nothing for the author to change. */@media (max-width: 767px) {
@@ -331,9 +355,50 @@
331
355
  text-align: end;
332
356
  }
333
357
 
334
- /* A Select or a date: its value ends at the row's edge */
358
+ /* A Select or a date: its value ends at the row's edge, its mark too, as the row has no pill to sit in */
335
359
  .Field:where([data-row]:not([data-orientation="vertical"])) .Control [data-variant="outline"][role="button"] {
360
+ --dropdown-icon-pill-offset: 0px;
361
+
336
362
  padding-inline: 0;
337
363
  }
364
+
365
+ /* An InputGroup: its value and its unit end at the row's edge too. A button at the end
366
+ reads as the row's text, as a Select's value does: no gutter and no fill */
367
+ .Field:where([data-row]:not([data-orientation="vertical"])) .Control > [data-slot="input-group"][data-variant="outline"] {
368
+ --input-group-gutter: 0px;
369
+ }
370
+
371
+ .Field:where([data-row]:not([data-orientation="vertical"])) .Control > [data-slot="input-group"] > [data-align="inline-end"] > button:last-child {
372
+ --button-gutter: 0px;
373
+ --button-background-color: transparent;
374
+ --button-background-color-active: transparent;
375
+
376
+ margin-inline-end: 0;
377
+ }
378
+
379
+ /* With `columns` the value starts at the column and takes the rest of the row: a unit,
380
+ a Select's mark and an icon end at its edge, as on iOS */
381
+ [data-field-columns] .Field:where([data-row]:not([data-orientation="vertical"]):not(:has(> .Action))):has(
382
+ .Control > [data-variant="outline"] > input,
383
+ .Control > [data-variant="outline"] > textarea
384
+ ) {
385
+ grid-template-columns: var(--field-row-column-width) minmax(0, 1fr);
386
+ }
387
+
388
+ [data-field-columns] .Field:where([data-row]:not([data-orientation="vertical"])) .Control:has(
389
+ > [data-variant]:not([data-variant="ghost"]) > input,
390
+ > [data-variant]:not([data-variant="ghost"]) > textarea,
391
+ > [data-variant][role="button"]
392
+ ) {
393
+ justify-self: stretch;
394
+ }
395
+
396
+ [data-field-columns] .Field:where([data-row]:not([data-orientation="vertical"])) .Control > [data-variant="outline"] > input {
397
+ text-align: start;
398
+ }
399
+
400
+ [data-field-columns] .Field:where([data-row]:not([data-orientation="vertical"])) .Control > [data-variant="outline"][role="button"] {
401
+ width: 100%;
402
+ }
338
403
  }
339
404
  }
@@ -27,6 +27,8 @@
27
27
  /* The transform-origin computed from the content and arrow positions/offsets */
28
28
  transform-origin: var(--radix-dropdown-menu-content-transform-origin);
29
29
  will-change: transform;
30
+
31
+ /* A submenu opens 100 ms after the pointer reaches its row, then shows at once */
30
32
  }
31
33
 
32
34
  /* Animation states applied to a wrapping parent */
@@ -56,6 +58,15 @@
56
58
  transition-duration: var(--motion-exit);
57
59
  transition-property: opacity, transform;
58
60
  transition-timing-function: var(--cubic-exit-snappy);
61
+ }
62
+ .Menu[data-entering-active] .MenuList[data-submenu],
63
+ .Menu[data-entering][data-interrupted] .MenuList[data-submenu] {
64
+ transition-duration: var(--motion-enter-quick);
65
+ }
66
+
67
+ .Menu[data-exiting-active] .MenuList[data-submenu],
68
+ .Menu[data-exiting][data-interrupted] .MenuList[data-submenu] {
69
+ transition-duration: var(--motion-exit-quick);
59
70
  }.MenuItemContent {
60
71
  padding: var(--menu-item-padding);
61
72
  }
@@ -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;
@@ -248,6 +248,7 @@
248
248
  --field-row-control-width: 160px;
249
249
  --field-row-text-width: 240px;
250
250
  --field-row-label-width: 80px;
251
+ --field-row-column-width: 40%;
251
252
  --field-row-row-gap: 2px;
252
253
  --field-row-text-display: flex;
253
254
  --field-row-label-font-size: var(--font-text-sm-size);
@@ -554,6 +555,8 @@
554
555
  --sidebar-menu-item-radius: 8px;
555
556
  --sidebar-menu-item-font-size: 14px;
556
557
  --sidebar-menu-item-line-height: 20px;
558
+ --sidebar-menu-item-trailing-padding: 12px;
559
+ --sidebar-menu-badge-dot-size: 6px;
557
560
 
558
561
  /* Icon */
559
562
  --sidebar-icon-size: 20px;
@@ -384,6 +384,9 @@
384
384
  --motion-enter-large: 300ms;
385
385
  --motion-exit: 150ms;
386
386
  --motion-exit-large: 200ms;
387
+ /* A submenu: it opens 100 ms after the pointer arrives, then shows at once */
388
+ --motion-enter-quick: 100ms;
389
+ --motion-exit-quick: 100ms;
387
390
 
388
391
  /* =============================================
389
392
  Scrollbar
@@ -641,6 +644,8 @@
641
644
  --motion-enter-large: 0ms;
642
645
  --motion-exit: 0ms;
643
646
  --motion-exit-large: 0ms;
647
+ --motion-enter-quick: 0ms;
648
+ --motion-exit-quick: 0ms;
644
649
  }
645
650
  }
646
651
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plexui/styles",
3
- "version": "0.1.24",
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",