@partrunner-ai/ui 2.0.0 → 2.1.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@partrunner-ai/ui",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "L1 primitives built on the PartRunner token scale. Plain CSS over --pr-* so it works in Tailwind v3, v4, or no Tailwind at all.",
5
5
  "license": "(MIT AND OFL-1.1)",
6
6
  "type": "module",
@@ -33,7 +33,7 @@
33
33
  "module": "./dist/index.js",
34
34
  "types": "./dist/index.d.ts",
35
35
  "dependencies": {
36
- "@partrunner-ai/tokens": "2.0.0"
36
+ "@partrunner-ai/tokens": "2.0.1"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "lucide-react": ">=0.312.0",
@@ -51,7 +51,7 @@
51
51
  "postcss-import": "15.1.0",
52
52
  "tailwindcss": "3.4.17",
53
53
  "vitest": "^3.2.7",
54
- "@partrunner-ai/shell": "2.0.0"
54
+ "@partrunner-ai/shell": "2.0.2"
55
55
  },
56
56
  "publishConfig": {
57
57
  "registry": "https://registry.npmjs.org",
package/styles/light.css CHANGED
@@ -3388,3 +3388,436 @@ button.pr-stepper__dot:focus-visible {
3388
3388
  .pr-sheet__title {
3389
3389
  letter-spacing: var(--pr-tracking-display, -0.022em);
3390
3390
  }
3391
+
3392
+ /* ───────────────────────── PageHeader ───────────────────────── */
3393
+
3394
+ /* Stacks on small screens, spreads title/actions from 640px up. Text colours
3395
+ come from --pr-fg/--pr-fg-muted rather than fixed brand greys: opacity over
3396
+ a themed surface does not produce a legible grey, and the tokens are
3397
+ audited in both themes. */
3398
+ .pr-page-header {
3399
+ display: flex;
3400
+ flex-direction: column;
3401
+ gap: 16px;
3402
+ margin-block-end: 24px;
3403
+ }
3404
+
3405
+ .pr-page-header__text {
3406
+ min-width: 0;
3407
+ }
3408
+
3409
+ .pr-page-header__eyebrow {
3410
+ display: inline-flex;
3411
+ align-items: center;
3412
+ gap: 6px;
3413
+ padding: 4px 10px;
3414
+ border: 1px solid var(--pr-glass-border);
3415
+ border-radius: 999px;
3416
+ background: color-mix(in srgb, var(--pr-surface) 70%, transparent);
3417
+ -webkit-backdrop-filter: blur(calc(var(--pr-glass-blur, 24px) / 2)) saturate(120%);
3418
+ backdrop-filter: blur(calc(var(--pr-glass-blur, 24px) / 2)) saturate(120%);
3419
+ box-shadow: var(--pr-shadow-sm);
3420
+ font-size: 11px;
3421
+ font-weight: 600;
3422
+ text-transform: uppercase;
3423
+ letter-spacing: 0.14em;
3424
+ color: var(--pr-fg-muted);
3425
+ }
3426
+
3427
+ .pr-page-header__eyebrow + .pr-page-header__title {
3428
+ margin-block-start: 8px;
3429
+ }
3430
+
3431
+ .pr-page-header__title {
3432
+ margin: 0;
3433
+ font-size: 24px;
3434
+ font-weight: 700;
3435
+ letter-spacing: var(--pr-tracking-display, -0.022em);
3436
+ line-height: 1.25;
3437
+ color: var(--pr-fg);
3438
+ }
3439
+
3440
+ .pr-page-header__subtitle {
3441
+ margin: 6px 0 0;
3442
+ font-size: 14px;
3443
+ line-height: 1.375;
3444
+ color: var(--pr-fg-muted);
3445
+ }
3446
+
3447
+ .pr-page-header__actions {
3448
+ display: flex;
3449
+ flex-wrap: wrap;
3450
+ align-items: center;
3451
+ gap: 8px;
3452
+ }
3453
+
3454
+ @media (min-width: 640px) {
3455
+ .pr-page-header {
3456
+ flex-direction: row;
3457
+ align-items: flex-end;
3458
+ justify-content: space-between;
3459
+ }
3460
+
3461
+ .pr-page-header__title {
3462
+ font-size: 30px;
3463
+ }
3464
+ }
3465
+
3466
+ /* ───────────────────────── StatTile ───────────────────────── */
3467
+
3468
+ /* The tone wash mixes the tone into the current surface, so the tile stays on
3469
+ the semantic surface in both themes instead of sitting on fixed white.
3470
+ The trend chip is the one place with fixed light-theme colours: its 11px
3471
+ text needs AA and the tone foregrounds only clear AA under .dark. */
3472
+ .pr-stat-tile {
3473
+ position: relative;
3474
+ overflow: hidden;
3475
+ padding: 16px;
3476
+ border: 1px solid var(--pr-glass-border);
3477
+ border-radius: var(--pr-radius-md, 0.5rem);
3478
+ background: color-mix(in srgb, var(--pr-surface) 90%, transparent);
3479
+ box-shadow: var(--pr-shadow-sm);
3480
+ transition:
3481
+ transform 200ms var(--pr-ease, ease),
3482
+ box-shadow 200ms var(--pr-ease, ease);
3483
+ }
3484
+
3485
+ .pr-stat-tile:hover {
3486
+ transform: translateY(-2px);
3487
+ box-shadow: var(--pr-shadow-card);
3488
+ }
3489
+
3490
+ .pr-stat-tile--yellow {
3491
+ background: color-mix(in srgb, var(--pr-surface) 88%, var(--pr-tone-yellow-bg));
3492
+ }
3493
+ .pr-stat-tile--amber {
3494
+ background: color-mix(in srgb, var(--pr-surface) 88%, var(--pr-tone-amber-bg));
3495
+ }
3496
+ .pr-stat-tile--blue {
3497
+ background: color-mix(in srgb, var(--pr-surface) 88%, var(--pr-tone-blue-bg));
3498
+ }
3499
+ .pr-stat-tile--purple {
3500
+ background: color-mix(in srgb, var(--pr-surface) 88%, var(--pr-tone-purple-bg));
3501
+ }
3502
+ .pr-stat-tile--green {
3503
+ background: color-mix(in srgb, var(--pr-surface) 88%, var(--pr-tone-green-bg));
3504
+ }
3505
+ .pr-stat-tile--rose {
3506
+ background: color-mix(in srgb, var(--pr-surface) 88%, var(--pr-tone-rose-bg));
3507
+ }
3508
+
3509
+ .pr-stat-tile__body {
3510
+ display: flex;
3511
+ align-items: flex-start;
3512
+ justify-content: space-between;
3513
+ gap: 12px;
3514
+ }
3515
+
3516
+ .pr-stat-tile__main {
3517
+ min-width: 0;
3518
+ flex: 1;
3519
+ }
3520
+
3521
+ .pr-stat-tile__label {
3522
+ margin: 0;
3523
+ font-size: 11px;
3524
+ font-weight: 600;
3525
+ text-transform: uppercase;
3526
+ letter-spacing: 0.12em;
3527
+ color: var(--pr-fg-muted);
3528
+ }
3529
+
3530
+ .pr-stat-tile__value {
3531
+ margin: 8px 0 0;
3532
+ font-size: 24px;
3533
+ font-weight: 700;
3534
+ letter-spacing: var(--pr-tracking-display, -0.022em);
3535
+ line-height: 1;
3536
+ color: var(--pr-fg);
3537
+ }
3538
+
3539
+ .pr-stat-tile__hint {
3540
+ margin: 6px 0 0;
3541
+ font-size: 12px;
3542
+ line-height: 1.375;
3543
+ color: var(--pr-fg-muted);
3544
+ }
3545
+
3546
+ .pr-stat-tile__icon {
3547
+ display: flex;
3548
+ flex-shrink: 0;
3549
+ align-items: center;
3550
+ justify-content: center;
3551
+ width: 36px;
3552
+ height: 36px;
3553
+ border-radius: var(--pr-radius-sm, 0.375rem);
3554
+ }
3555
+
3556
+ .pr-stat-tile__icon svg {
3557
+ width: 18px;
3558
+ height: 18px;
3559
+ }
3560
+
3561
+ /* Icon-chip pairs use the audited tone bg/fg pairs. The light-theme tone
3562
+ foregrounds sit below AA for text but only ever paint an 18px icon here,
3563
+ which is governed by the 3:1 non-text minimum. */
3564
+ .pr-stat-tile--yellow .pr-stat-tile__icon {
3565
+ background: var(--pr-tone-yellow-bg);
3566
+ color: var(--pr-tone-yellow-fg);
3567
+ }
3568
+ .pr-stat-tile--amber .pr-stat-tile__icon {
3569
+ background: var(--pr-tone-amber-bg);
3570
+ color: var(--pr-tone-amber-fg);
3571
+ }
3572
+ .pr-stat-tile--blue .pr-stat-tile__icon {
3573
+ background: var(--pr-tone-blue-bg);
3574
+ color: var(--pr-tone-blue-fg);
3575
+ }
3576
+ .pr-stat-tile--purple .pr-stat-tile__icon {
3577
+ background: var(--pr-tone-purple-bg);
3578
+ color: var(--pr-tone-purple-fg);
3579
+ }
3580
+ .pr-stat-tile--green .pr-stat-tile__icon {
3581
+ background: var(--pr-tone-green-bg);
3582
+ color: var(--pr-tone-green-fg);
3583
+ }
3584
+ .pr-stat-tile--rose .pr-stat-tile__icon {
3585
+ background: var(--pr-tone-rose-bg);
3586
+ color: var(--pr-tone-rose-fg);
3587
+ }
3588
+ .pr-stat-tile--neutral .pr-stat-tile__icon {
3589
+ background: var(--pr-border);
3590
+ color: var(--pr-fg-muted);
3591
+ }
3592
+
3593
+ .pr-stat-tile__meta {
3594
+ display: flex;
3595
+ align-items: center;
3596
+ justify-content: space-between;
3597
+ gap: 8px;
3598
+ margin-block-start: 12px;
3599
+ }
3600
+
3601
+ .pr-stat-tile__trend {
3602
+ display: inline-flex;
3603
+ align-items: center;
3604
+ gap: 4px;
3605
+ padding: 2px 8px;
3606
+ border-radius: 999px;
3607
+ font-size: 11px;
3608
+ font-weight: 600;
3609
+ }
3610
+
3611
+ .pr-stat-tile__trend svg {
3612
+ width: 12px;
3613
+ height: 12px;
3614
+ }
3615
+
3616
+ .pr-stat-tile__trend--up {
3617
+ background: #d1fae5;
3618
+ color: #047857;
3619
+ }
3620
+
3621
+ .pr-stat-tile__trend--down {
3622
+ background: #ffe4e6;
3623
+ color: #be123c;
3624
+ }
3625
+
3626
+ .dark .pr-stat-tile__trend--up {
3627
+ background: var(--pr-tone-green-bg);
3628
+ color: var(--pr-tone-green-fg);
3629
+ }
3630
+
3631
+ .dark .pr-stat-tile__trend--down {
3632
+ background: var(--pr-tone-rose-bg);
3633
+ color: var(--pr-tone-rose-fg);
3634
+ }
3635
+
3636
+ .pr-stat-tile__footer {
3637
+ min-width: 0;
3638
+ overflow: hidden;
3639
+ font-size: 11px;
3640
+ color: var(--pr-fg-faint);
3641
+ text-overflow: ellipsis;
3642
+ white-space: nowrap;
3643
+ }
3644
+
3645
+ @media (min-width: 640px) {
3646
+ .pr-stat-tile {
3647
+ padding: 20px;
3648
+ }
3649
+
3650
+ .pr-stat-tile__value {
3651
+ font-size: 28px;
3652
+ }
3653
+ }
3654
+
3655
+ /* ───────────────────────── Toolbar ───────────────────────── */
3656
+
3657
+ /* Glass surface, same recipe as the shell chrome at half the blur: separates
3658
+ from the page background without weight, and follows the theme. */
3659
+ .pr-toolbar {
3660
+ display: flex;
3661
+ flex-wrap: wrap;
3662
+ align-items: center;
3663
+ gap: 8px;
3664
+ padding: 10px 12px;
3665
+ border: 1px solid var(--pr-glass-border);
3666
+ border-radius: var(--pr-radius-md, 0.5rem);
3667
+ background: color-mix(in srgb, var(--pr-surface) 75%, transparent);
3668
+ -webkit-backdrop-filter: blur(calc(var(--pr-glass-blur, 24px) / 2)) saturate(120%);
3669
+ backdrop-filter: blur(calc(var(--pr-glass-blur, 24px) / 2)) saturate(120%);
3670
+ box-shadow: var(--pr-shadow-sm);
3671
+ }
3672
+
3673
+ /* ───────────────────────── IconButton ───────────────────────── */
3674
+
3675
+ /* Icon-only button with an accessibility contract: the touch target is at
3676
+ least 44x44 on small screens for every size, and on all screens unless
3677
+ `compact` is set. Desktop sizes step down visually while the pointer
3678
+ stays coarse. */
3679
+ .pr-icon-btn {
3680
+ display: inline-flex;
3681
+ align-items: center;
3682
+ justify-content: center;
3683
+ min-width: 44px;
3684
+ min-height: 44px;
3685
+ padding: 0;
3686
+ border: none;
3687
+ border-radius: var(--pr-radius-md, 0.5rem);
3688
+ background: transparent;
3689
+ cursor: pointer;
3690
+ transition:
3691
+ background-color 160ms var(--pr-ease, ease),
3692
+ color 160ms var(--pr-ease, ease),
3693
+ box-shadow 160ms var(--pr-ease, ease);
3694
+ }
3695
+
3696
+ .pr-icon-btn:focus-visible {
3697
+ outline: none;
3698
+ box-shadow: var(--pr-focus-ring);
3699
+ }
3700
+
3701
+ .pr-icon-btn:active:not(:disabled) {
3702
+ transform: scale(0.96);
3703
+ }
3704
+
3705
+ .pr-icon-btn:disabled,
3706
+ .pr-icon-btn[aria-disabled='true'] {
3707
+ opacity: 0.6;
3708
+ cursor: not-allowed;
3709
+ pointer-events: none;
3710
+ }
3711
+
3712
+ @media (min-width: 640px) {
3713
+ .pr-icon-btn--sm {
3714
+ min-width: 36px;
3715
+ min-height: 36px;
3716
+ }
3717
+
3718
+ .pr-icon-btn--md {
3719
+ min-width: 40px;
3720
+ min-height: 40px;
3721
+ }
3722
+
3723
+ .pr-icon-btn--lg {
3724
+ min-width: 48px;
3725
+ min-height: 48px;
3726
+ }
3727
+
3728
+ .pr-icon-btn--compact {
3729
+ min-width: 32px;
3730
+ min-height: 32px;
3731
+ }
3732
+ }
3733
+
3734
+ .pr-icon-btn svg {
3735
+ width: 18px;
3736
+ height: 18px;
3737
+ }
3738
+
3739
+ .pr-icon-btn--default,
3740
+ .pr-icon-btn--subtle {
3741
+ color: var(--pr-fg-muted);
3742
+ }
3743
+
3744
+ .pr-icon-btn--default:hover,
3745
+ .pr-icon-btn--subtle:hover {
3746
+ background: var(--pr-glass-bg);
3747
+ color: var(--pr-fg);
3748
+ box-shadow: var(--pr-shadow-sm);
3749
+ }
3750
+
3751
+ .pr-icon-btn--ghost {
3752
+ color: var(--pr-fg-muted);
3753
+ }
3754
+
3755
+ .pr-icon-btn--ghost:hover {
3756
+ background: var(--pr-glass-bg);
3757
+ color: var(--pr-fg);
3758
+ }
3759
+
3760
+ .pr-icon-btn--primary {
3761
+ color: var(--pr-accent);
3762
+ }
3763
+
3764
+ .pr-icon-btn--primary:hover {
3765
+ background: color-mix(in srgb, var(--pr-accent) 15%, transparent);
3766
+ color: var(--pr-accent-strong);
3767
+ box-shadow: var(--pr-shadow-sm);
3768
+ }
3769
+
3770
+ .pr-icon-btn--danger {
3771
+ color: var(--pr-danger);
3772
+ }
3773
+
3774
+ .pr-icon-btn--danger:hover {
3775
+ background: color-mix(in srgb, var(--pr-danger) 12%, transparent);
3776
+ color: var(--pr-danger);
3777
+ box-shadow: var(--pr-shadow-sm);
3778
+ }
3779
+
3780
+ /* ───────────────────────── ConfirmDialog ───────────────────────── */
3781
+
3782
+ .pr-confirm-dialog__actions {
3783
+ display: flex;
3784
+ flex-direction: column-reverse;
3785
+ gap: 8px;
3786
+ }
3787
+
3788
+ .pr-confirm-dialog__icon-row {
3789
+ display: flex;
3790
+ justify-content: center;
3791
+ padding-block: 8px;
3792
+ }
3793
+
3794
+ .pr-confirm-dialog__icon {
3795
+ display: inline-flex;
3796
+ align-items: center;
3797
+ justify-content: center;
3798
+ width: 48px;
3799
+ height: 48px;
3800
+ border-radius: var(--pr-radius-md, 0.5rem);
3801
+ }
3802
+
3803
+ .pr-confirm-dialog__icon svg {
3804
+ width: 24px;
3805
+ height: 24px;
3806
+ }
3807
+
3808
+ .pr-confirm-dialog__icon--danger {
3809
+ background: color-mix(in srgb, var(--pr-danger) 12%, transparent);
3810
+ color: var(--pr-danger);
3811
+ }
3812
+
3813
+ .pr-confirm-dialog__icon--accent {
3814
+ background: var(--pr-tone-yellow-bg);
3815
+ color: var(--pr-tone-yellow-fg);
3816
+ }
3817
+
3818
+ @media (min-width: 640px) {
3819
+ .pr-confirm-dialog__actions {
3820
+ flex-direction: row;
3821
+ justify-content: flex-end;
3822
+ }
3823
+ }