@lerianstudio/sindarian-ui 2.0.0-beta.6 → 2.0.0-beta.8

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 (2) hide show
  1. package/dist/globals.css +55 -31
  2. package/package.json +1 -1
package/dist/globals.css CHANGED
@@ -541,7 +541,7 @@
541
541
  }
542
542
  }
543
543
 
544
- /* Sonner toast overrides — solid bold backgrounds (Radix parity) */
544
+ /* Sonner toast overrides — tinted surfaces from the system token families */
545
545
  [data-sonner-toaster] {
546
546
  --width: 420px;
547
547
  pointer-events: auto !important;
@@ -559,41 +559,41 @@
559
559
  }
560
560
 
561
561
  /*
562
- Type fills come from the system token families, so a toast themes with the
563
- rest of the app. All three coloured types take ONE ink, --accent-foreground:
564
- a solid system fill is bright enough to need near-black ink in BOTH themes,
565
- and that token is the only one in this sheet that is near-black in both.
566
-
567
- It replaced the per-family reasoning that stood here, which routed success
568
- and error through --primary-foreground because that token inverts (white in
569
- light, base/800 in dark). Inverting was the bug: white ink on the LIGHT
570
- fills measured 3.35:1 on --system-success and 3.78:1 on --system-error,
571
- both under AA, and no token value can fix that from the white side — the
572
- light green/600 and red/500 fills sit mid-luminance, so white caps at ~3.8
573
- while near-black reaches 5.9 and 5.3. Ratios now, ink over fill:
574
- light 5.93 / 5.25 / 11.17 and dark 11.39 / 7.23 / 13.00
575
- (success / error / warning). The dark pairs were already passing at
576
- 8.51 / 5.41 / 13.00 and only gained. `toast ink` in
577
- src/__tests__/tokens-contract.test.ts recomputes all six from these
578
- declarations, so the next token edit that drops a pair under 4.5 fails
579
- instead of shipping.
562
+ Each coloured type paints the `surface` + `text` + `border` trio of its own
563
+ family — the pairing every other tinted component in the kit already uses
564
+ (`components/ui/badge/index.tsx`, `enterprise/alert-banner/index.tsx`).
565
+ `surface` is the only slot in a system family built to sit BEHIND content: it
566
+ darkens on the dark canvas, while `base` and `h1a` are fill and ink slots
567
+ that INVERT between themes (`--system-success-h1a` is #166534 in light and
568
+ #BBF7D0 in dark). Grounding toast text on either of those forces a different
569
+ ink per theme, and the toast stops tracking the family it names.
570
+
571
+ Ink over ground, light / dark: success 6.81 / 10.62, error 7.60 / 8.51,
572
+ warning 6.62 / 11.70 — every half clear of the 4.5 floor by more than two
573
+ points. `system text tokens` in `src/__tests__/tokens-contract.test.ts`
574
+ already measures this pair for all five families, so the toast is covered by
575
+ the gate that guards the pills rather than by a rule written for it alone;
576
+ `sonner toast ink` there reads whichever pair these rules declare.
577
+
578
+ `info` stays neutral on `--card`: an informational toast is the unstyled
579
+ case, not a fourth colour.
580
580
  */
581
581
  [data-sonner-toast][data-type='success'] {
582
- --normal-bg: hsl(var(--system-success));
583
- --normal-text: hsl(var(--accent-foreground));
584
- --normal-border: transparent;
582
+ --normal-bg: hsl(var(--system-success-surface));
583
+ --normal-text: hsl(var(--system-success-text));
584
+ --normal-border: hsl(var(--system-success-border));
585
585
  }
586
586
 
587
587
  [data-sonner-toast][data-type='error'] {
588
- --normal-bg: hsl(var(--system-error));
589
- --normal-text: hsl(var(--accent-foreground));
590
- --normal-border: transparent;
588
+ --normal-bg: hsl(var(--system-error-surface));
589
+ --normal-text: hsl(var(--system-error-text));
590
+ --normal-border: hsl(var(--system-error-border));
591
591
  }
592
592
 
593
593
  [data-sonner-toast][data-type='warning'] {
594
- --normal-bg: hsl(var(--system-alert));
595
- --normal-text: hsl(var(--accent-foreground));
596
- --normal-border: transparent;
594
+ --normal-bg: hsl(var(--system-alert-surface));
595
+ --normal-text: hsl(var(--system-alert-text));
596
+ --normal-border: hsl(var(--system-alert-border));
597
597
  }
598
598
 
599
599
  [data-sonner-toast][data-type='info'] {
@@ -602,8 +602,32 @@
602
602
  --normal-border: hsl(var(--border));
603
603
  }
604
604
 
605
- [data-sonner-toast] [data-title] {
606
- font-weight: 600;
605
+ /*
606
+ The title outranks the description, and both rules have to WIN the cascade
607
+ for that to mean anything. Sonner ships
608
+ `[data-sonner-toast][data-styled='true'] [data-title]` at font-weight 500 and
609
+ its description twin at 400 — both (0,3,0), both injected at runtime.
610
+ The title rule here was a plain `[data-sonner-toast] [data-title]` (0,2,0):
611
+ it declared 600 and rendered at 500, losing outright, while the description
612
+ carried `!important` and rendered at 600. The hierarchy came out inverted on
613
+ every toast in the kit, the long line heavier than the label naming it.
614
+
615
+ Both now take the compound selector plus !important — the shape the
616
+ close-button rules below already use against this same stylesheet, and for
617
+ the same reason: source order cannot settle a tie with a sheet that is
618
+ injected at runtime.
619
+
620
+ The description returns to 400. It is the running text of a toast, and 14px
621
+ semibold across a full sentence reads as emphasis with nothing left to
622
+ emphasise; the family ink already carries the severity. Its `color` override
623
+ keeps !important on its own merits — sonner hardcodes #3f3f3f there, plus a
624
+ dark-theme rule of its own on top.
625
+
626
+ `toast text weights` in src/__tests__/tokens-contract.test.ts holds the order
627
+ and the two properties that let it apply.
628
+ */
629
+ [data-sonner-toast][data-styled='true'] [data-title] {
630
+ font-weight: 600 !important;
607
631
  font-size: 0.875rem;
608
632
  line-height: 1.25rem;
609
633
  }
@@ -611,7 +635,7 @@
611
635
  [data-sonner-toast] [data-description],
612
636
  [data-sonner-toast][data-styled='true'] [data-description] {
613
637
  font-size: 0.875rem;
614
- font-weight: 600 !important;
638
+ font-weight: 400 !important;
615
639
  line-height: 1.25rem;
616
640
  color: var(--normal-text) !important;
617
641
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lerianstudio/sindarian-ui",
3
- "version": "2.0.0-beta.6",
3
+ "version": "2.0.0-beta.8",
4
4
  "description": "Sindarian UI - A UI library for Midaz Console",
5
5
  "license": "ISC",
6
6
  "author": {