@plexui/styles 0.15.0 → 0.16.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.
@@ -229,7 +229,13 @@
229
229
  row-gap: 18px;
230
230
  padding: 17px 16px;
231
231
  border-radius: 26px;
232
- --alert-indicator-size: 22px;
232
+ /* TipKit draws the symbol itself 22 wide at tipImageSize 22 (the circle of i); a PlexUI icon draws its circle 20
233
+ of its 24, so the icon's box is 26.4 for a 22px circle (console 15.11, owner: «иконка правильного размера? не
234
+ маленькая?», it was 18.3). The SVG overhangs its 22px place by the inset on each side (negative margins), so the
235
+ layout, a custom indicator's place and the text at 56 stay as they were. */
236
+ --alert-indicator-glyph-size: 22px;
237
+ --alert-indicator-size: calc(var(--alert-indicator-glyph-size) * 24 / 20);
238
+ --alert-indicator-inset: calc((var(--alert-indicator-size) - var(--alert-indicator-glyph-size)) / 2);
233
239
  }
234
240
 
235
241
  .Alert:has(> .Content > .Actions > :not(.DismissButton)) {
@@ -303,13 +309,17 @@
303
309
  padding-inline: 6px 4px;
304
310
  margin-block: 5px;
305
311
  /* A smaller custom indicator stands on the middle of the icon's place */
306
- min-height: var(--alert-indicator-size);
312
+ min-height: var(--alert-indicator-glyph-size);
307
313
  }
308
314
 
309
315
  .Indicator::before {
310
316
  content: none;
311
317
  }
312
318
 
319
+ .Indicator svg {
320
+ margin: calc(-1 * var(--alert-indicator-inset));
321
+ }
322
+
313
323
  /* With a description under it the title's first line stands on the middle of the icon too, as an iOS row centres
314
324
  its icon on its first line (owner 15.11: TipKit's lower image read as off centre); the 10px under the icon keep
315
325
  the card as tall */
@@ -326,7 +336,7 @@
326
336
  of the image, as a title alone does: one line centred on the icon, more lines going on under it (owner 13.11:
327
337
  the line sat 6px above the icon's middle) */
328
338
  .Indicator + .Content > .Message:not(:has(> .Title)) {
329
- margin-top: calc(5px + var(--alert-indicator-size) / 2 - 0.5lh);
339
+ margin-top: calc(5px + var(--alert-indicator-glyph-size) / 2 - 0.5lh);
330
340
  }
331
341
 
332
342
  .Message {
@@ -394,7 +404,7 @@
394
404
  }
395
405
 
396
406
  .Alert[data-mobile-actions="own"]:has(> .Indicator) .Actions {
397
- padding-inline-start: calc(6px + var(--alert-indicator-size) + 4px + 8px);
407
+ padding-inline-start: calc(6px + var(--alert-indicator-glyph-size) + 4px + 8px);
398
408
  }
399
409
 
400
410
  .Alert .Actions > .DismissButton {
@@ -425,7 +435,13 @@
425
435
  row-gap: 18px;
426
436
  padding: 17px 16px;
427
437
  border-radius: 26px;
428
- --alert-indicator-size: 22px;
438
+ /* TipKit draws the symbol itself 22 wide at tipImageSize 22 (the circle of i); a PlexUI icon draws its circle 20
439
+ of its 24, so the icon's box is 26.4 for a 22px circle (console 15.11, owner: «иконка правильного размера? не
440
+ маленькая?», it was 18.3). The SVG overhangs its 22px place by the inset on each side (negative margins), so the
441
+ layout, a custom indicator's place and the text at 56 stay as they were. */
442
+ --alert-indicator-glyph-size: 22px;
443
+ --alert-indicator-size: calc(var(--alert-indicator-glyph-size) * 24 / 20);
444
+ --alert-indicator-inset: calc((var(--alert-indicator-size) - var(--alert-indicator-glyph-size)) / 2);
429
445
  }
430
446
 
431
447
  :where([data-plex-layout="phone"]) .Alert:has(> .Content > .Actions > :not(.DismissButton)) {
@@ -499,13 +515,17 @@
499
515
  padding-inline: 6px 4px;
500
516
  margin-block: 5px;
501
517
  /* A smaller custom indicator stands on the middle of the icon's place */
502
- min-height: var(--alert-indicator-size);
518
+ min-height: var(--alert-indicator-glyph-size);
503
519
  }
504
520
 
505
521
  :where([data-plex-layout="phone"]) .Indicator::before {
506
522
  content: none;
507
523
  }
508
524
 
525
+ :where([data-plex-layout="phone"]) .Indicator svg {
526
+ margin: calc(-1 * var(--alert-indicator-inset));
527
+ }
528
+
509
529
  /* With a description under it the title's first line stands on the middle of the icon too, as an iOS row centres
510
530
  its icon on its first line (owner 15.11: TipKit's lower image read as off centre); the 10px under the icon keep
511
531
  the card as tall */
@@ -522,7 +542,7 @@
522
542
  of the image, as a title alone does: one line centred on the icon, more lines going on under it (owner 13.11:
523
543
  the line sat 6px above the icon's middle) */
524
544
  :where([data-plex-layout="phone"]) .Indicator + .Content > .Message:not(:has(> .Title)) {
525
- margin-top: calc(5px + var(--alert-indicator-size) / 2 - 0.5lh);
545
+ margin-top: calc(5px + var(--alert-indicator-glyph-size) / 2 - 0.5lh);
526
546
  }
527
547
 
528
548
  :where([data-plex-layout="phone"]) .Message {
@@ -590,7 +610,7 @@
590
610
  }
591
611
 
592
612
  :where([data-plex-layout="phone"]) .Alert[data-mobile-actions="own"]:has(> .Indicator) .Actions {
593
- padding-inline-start: calc(6px + var(--alert-indicator-size) + 4px + 8px);
613
+ padding-inline-start: calc(6px + var(--alert-indicator-glyph-size) + 4px + 8px);
594
614
  }
595
615
 
596
616
  :where([data-plex-layout="phone"]) .Alert .Actions > .DismissButton {
@@ -43,5 +43,15 @@
43
43
  display: inline-flex;
44
44
  align-items: center;
45
45
  gap: calc(var(--spacing) * 0.5);
46
+ }/* The name of a modifier printed as a symbol, such as Command for ⌘: read out, not shown */.Name {
47
+ position: absolute;
48
+ width: 1px;
49
+ height: 1px;
50
+ margin: -1px;
51
+ padding: 0;
52
+ overflow: hidden;
53
+ clip-path: inset(50%);
54
+ white-space: nowrap;
55
+ border: 0;
46
56
  }
47
57
  }
@@ -30,5 +30,23 @@
30
30
  100% {
31
31
  transform: translateX(-100%);
32
32
  }
33
+ }/* Parts of one bar side by side, such as paid, pending and due, each in its color with a hairline of the track
34
+ between them; the rest of the track is what is left */.Root[data-segmented] {
35
+ display: flex;
36
+ gap: var(--progress-segment-gap);
37
+ }/* A full bar's parts give the gaps back in proportion, so the last one is not cut off at the end */.Segment {
38
+ flex-shrink: 1;
39
+ min-width: 0;
40
+ height: 100%;
41
+ background: var(--progress-segment-color, var(--progress-indicator-color));
42
+ transition: width var(--progress-transition-duration) var(--progress-transition-ease);
33
43
  }
44
+
45
+ .Segment[data-color="secondary"] { --progress-segment-color: var(--color-background-secondary-solid); }
46
+ .Segment[data-color="success"] { --progress-segment-color: var(--color-background-success-solid); }
47
+ .Segment[data-color="warning"] { --progress-segment-color: var(--color-background-warning-solid); }
48
+ .Segment[data-color="caution"] { --progress-segment-color: var(--color-background-caution-solid); }
49
+ .Segment[data-color="danger"] { --progress-segment-color: var(--color-background-danger-solid); }
50
+ .Segment[data-color="info"] { --progress-segment-color: var(--color-background-info-solid); }
51
+ .Segment[data-color="discovery"] { --progress-segment-color: var(--color-background-discovery-solid); }
34
52
  }
@@ -0,0 +1,44 @@
1
+ @layer components {/* A number whose digits roll to a new value, as an odometer: each digit is a reel of 0 to 9 behind a window one
2
+ digit tall. The window holds the digit itself, hidden, so it keeps the text's width and baseline and the number
3
+ stands in a sentence; the reel turns over it. Separators, signs and currency stand still. Tabular figures keep
4
+ every digit as wide, so the number does not jitter while it rolls. */.RollingNumber {
5
+ display: inline-block;
6
+ font-variant-numeric: tabular-nums;
7
+ white-space: nowrap;
8
+ }/* Each digit is a box of its own, which bidi treats as neutral: the number keeps left to right in a right-to-left page,
9
+ as its digits are written */.Visual {
10
+ direction: ltr;
11
+ unicode-bidi: isolate;
12
+ }.Digit {
13
+ position: relative;
14
+ display: inline-block;
15
+ /* Clips the reel with a clip path: a clipping box would move the baseline to its bottom edge */
16
+ clip-path: inset(0 -0.1em);
17
+ }.Ghost {
18
+ visibility: hidden;
19
+ }.Reel {
20
+ position: absolute;
21
+ inset-inline: 0;
22
+ top: 0;
23
+ display: flex;
24
+ flex-direction: column;
25
+ align-items: center;
26
+ transform: translateY(calc(var(--rolling-number-digit, 0) * -10%));
27
+ transition: transform var(--rolling-number-duration) var(--rolling-number-ease);
28
+ }
29
+
30
+ @media (prefers-reduced-motion: reduce) {.Reel {
31
+ transition: none
32
+ }
33
+ }/* The number as text for a screen reader; the reels are hidden from it */.Text {
34
+ position: absolute;
35
+ width: 1px;
36
+ height: 1px;
37
+ margin: -1px;
38
+ padding: 0;
39
+ overflow: hidden;
40
+ clip-path: inset(50%);
41
+ white-space: nowrap;
42
+ border: 0;
43
+ }
44
+ }
@@ -139,6 +139,8 @@
139
139
  --progress-transition-duration: var(--transition-duration-basic);
140
140
  --progress-transition-ease: var(--transition-ease-basic);
141
141
  --progress-indeterminate-duration: 1.5s;
142
+ /* Between the parts of a segmented bar */
143
+ --progress-segment-gap: 2px;
142
144
 
143
145
  /* =============================================
144
146
  Separator
@@ -914,6 +916,13 @@
914
916
  control is the enabled one at 50%) */
915
917
  --toggle-group-disabled-opacity: 0.5;
916
918
 
919
+ /* =============================================
920
+ Rolling number
921
+ ============================================= */
922
+ /* Long enough to read the digits pass, as an odometer turns */
923
+ --rolling-number-duration: 600ms;
924
+ --rolling-number-ease: var(--cubic-move);
925
+
917
926
  /* =============================================
918
927
  Stepper
919
928
  ============================================= */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plexui/styles",
3
- "version": "0.15.0",
3
+ "version": "0.16.0",
4
4
  "description": "Framework-agnostic CSS for Plex UI: design tokens, globals and component styles",
5
5
  "type": "module",
6
6
  "license": "MIT",