@rolemodel/optics 1.8.0 → 1.10.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.
@@ -2366,8 +2366,8 @@ small {
2366
2366
  }
2367
2367
  }
2368
2368
 
2369
- .btn-warning, .btn-destructive,
2370
- .btn-delete, .btn-primary, .btn {
2369
+ .btn {
2370
+ /* Public API (customizable component options) */
2371
2371
  --_op-btn-height-small: var(--op-input-height-small);
2372
2372
  --_op-btn-height-medium: var(--op-input-height-medium);
2373
2373
  --_op-btn-height-large: var(--op-input-height-large);
@@ -2377,6 +2377,7 @@ small {
2377
2377
  --_op-btn-padding-small: 0 var(--op-space-x-small);
2378
2378
  --_op-btn-padding-medium: 0 var(--op-space-small);
2379
2379
  --_op-btn-padding-large: 0 var(--op-space-small);
2380
+ /* Private API (component option defaults) */
2380
2381
  --__op-btn-height: var(--_op-btn-height-large);
2381
2382
  --__op-btn-font-size: var(--_op-btn-font-large);
2382
2383
  --__op-btn-padding: var(--_op-btn-padding-large);
@@ -2387,6 +2388,9 @@ small {
2387
2388
  padding: var(--__op-btn-padding);
2388
2389
  border-radius: var(--op-radius-medium);
2389
2390
  appearance: none;
2391
+ background-color: var(--op-color-neutral-plus-eight);
2392
+ box-shadow: inset var(--op-border-all) var(--op-color-neutral-plus-four);
2393
+ color: var(--op-color-neutral-on-plus-eight);
2390
2394
  cursor: pointer;
2391
2395
  font-size: var(--__op-btn-font-size);
2392
2396
  font-weight: var(--op-font-weight-normal);
@@ -2395,201 +2399,209 @@ small {
2395
2399
  text-decoration: none;
2396
2400
  transition: var(--op-transition-input);
2397
2401
  white-space: nowrap;
2398
- }
2399
- .btn--pill.btn-warning, .btn--pill.btn-destructive,
2400
- .btn--pill.btn-delete, .btn--pill.btn-primary, .btn--pill.btn {
2401
- border-radius: var(--op-radius-pill);
2402
- }
2403
- .btn--icon.btn-warning, .btn--icon.btn-destructive,
2404
- .btn--icon.btn-delete, .btn--icon.btn-primary, .btn--icon.btn {
2405
- width: var(--__op-btn-height);
2406
- min-width: var(--__op-btn-height);
2407
- padding: 0;
2408
- }
2409
- .btn--icon-with-label.btn-warning, .btn--icon-with-label.btn-destructive,
2410
- .btn--icon-with-label.btn-delete, .btn--icon-with-label.btn-primary, .btn--icon-with-label.btn {
2411
- flex-direction: column;
2412
- padding: var(--op-space-small);
2413
- gap: var(--op-space-3x-small);
2414
- }
2415
- .btn--small.btn-warning, .btn--small.btn-destructive,
2416
- .btn--small.btn-delete, .btn--small.btn-primary, .btn--small.btn {
2417
- --__op-btn-height: var(--_op-btn-height-small);
2418
- --__op-btn-font-size: var(--_op-btn-font-small);
2419
- --__op-btn-padding: var(--_op-btn-padding-small);
2420
- }
2421
- .btn--medium.btn-warning, .btn--medium.btn-destructive,
2422
- .btn--medium.btn-delete, .btn--medium.btn-primary, .btn--medium.btn {
2423
- --__op-btn-height: var(--_op-btn-height-medium);
2424
- --__op-btn-font-size: var(--_op-btn-font-medium);
2425
- --__op-btn-padding: var(--_op-btn-padding-medium);
2426
- }
2427
- .btn--large.btn-warning, .btn--large.btn-destructive,
2428
- .btn--large.btn-delete, .btn--large.btn-primary, .btn--large.btn {
2429
- --__op-btn-height: var(--_op-btn-height-large);
2430
- --__op-btn-font-size: var(--_op-btn-font-large);
2431
- --__op-btn-padding: var(--_op-btn-padding-large);
2432
- }
2433
- .btn--disabled.btn-warning, .btn--disabled.btn-destructive,
2434
- .btn--disabled.btn-delete, .btn--disabled.btn-primary, .btn--disabled.btn, .btn-warning:disabled, .btn-destructive:disabled,
2435
- .btn-delete:disabled, .btn-primary:disabled, .btn:disabled {
2436
- opacity: var(--op-opacity-disabled);
2437
- pointer-events: none;
2438
- -webkit-user-select: none; /* stylelint-disable property-no-vendor-prefix */
2439
- user-select: none;
2440
- }
2441
- .btn--with-badge.btn-warning, .btn--with-badge.btn-destructive,
2442
- .btn--with-badge.btn-delete, .btn--with-badge.btn-primary, .btn--with-badge.btn {
2443
- position: relative;
2444
- }
2445
- .btn-warning:focus, .btn-destructive:focus,
2446
- .btn-delete:focus, .btn-primary:focus, .btn:focus, .btn-warning:focus-within, .btn-destructive:focus-within,
2447
- .btn-delete:focus-within, .btn-primary:focus-within, .btn:focus-within, .btn-warning:focus-visible, .btn-destructive:focus-visible,
2448
- .btn-delete:focus-visible, .btn-primary:focus-visible, .btn:focus-visible {
2449
- outline: none;
2450
- }
2451
- @media (width <= 768px) {
2452
- .btn-warning, .btn-destructive,
2453
- .btn-delete, .btn-primary, .btn {
2454
- --__op-btn-height: var(--_op-btn-height-large);
2455
- --__op-btn-font-size: var(--_op-btn-font-large);
2402
+ /* Modifiers */
2403
+ /* Default Active State */
2404
+ &.btn--active {
2405
+ background-color: var(--op-color-primary-plus-five);
2406
+ box-shadow: inset var(--op-border-all) var(--op-color-primary-plus-three);
2407
+ color: var(--op-color-primary-on-plus-five);
2408
+ }
2409
+ /* Default Hover State */
2410
+ &:hover {
2411
+ background-color: var(--op-color-primary-plus-eight);
2412
+ box-shadow: inset var(--op-border-all) var(--op-color-primary-plus-three);
2413
+ color: var(--op-color-primary-on-plus-eight);
2414
+ }
2415
+ /* Default Focus State */
2416
+ &:focus-visible {
2417
+ background-color: var(--op-color-neutral-plus-eight);
2418
+ box-shadow: var(--op-input-focus-primary);
2419
+ color: var(--op-color-neutral-on-plus-eight);
2420
+ }
2421
+ /* Default Borderless State */
2422
+ &.btn--no-border {
2423
+ background-color: transparent;
2424
+ box-shadow: none;
2425
+ color: var(--op-color-primary-on-plus-max);
2426
+ /* Default Borderless + Active State. */
2427
+ &.btn--active {
2428
+ background-color: var(--op-color-primary-plus-five);
2429
+ box-shadow: inset var(--op-border-all) var(--op-color-primary-plus-three);
2430
+ color: var(--op-color-primary-on-plus-five);
2431
+ }
2432
+ /* Default Borderless + Hover State */
2433
+ &:hover {
2434
+ background-color: var(--op-color-primary-plus-eight);
2435
+ box-shadow: inset var(--op-border-all) var(--op-color-primary-plus-five);
2436
+ color: var(--op-color-primary-on-plus-eight);
2437
+ }
2438
+ /* Default Borderless + Focus State */
2439
+ &:focus-visible {
2440
+ background-color: var(--op-color-primary-plus-eight);
2441
+ box-shadow: var(--op-input-focus-primary);
2442
+ color: var(--op-color-primary-on-plus-eight);
2443
+ }
2444
+ }
2445
+ /* Pill Modifier */
2446
+ &.btn--pill {
2447
+ border-radius: var(--op-radius-pill);
2448
+ }
2449
+ /* Icon Modifier */
2450
+ &.btn--icon {
2451
+ width: var(--__op-btn-height);
2452
+ min-width: var(--__op-btn-height);
2453
+ padding: 0;
2456
2454
  }
2457
- .btn--small.btn-warning, .btn--small.btn-destructive,
2458
- .btn--small.btn-delete, .btn--small.btn-primary, .btn--small.btn, .btn--medium.btn-warning, .btn--medium.btn-destructive,
2459
- .btn--medium.btn-delete, .btn--medium.btn-primary, .btn--medium.btn, .btn--large.btn-warning, .btn--large.btn-destructive,
2460
- .btn--large.btn-delete, .btn--large.btn-primary, .btn--large.btn {
2455
+ /* Icon With Label Modifier */
2456
+ &.btn--icon-with-label {
2457
+ flex-direction: column;
2458
+ padding: var(--op-space-small);
2459
+ gap: var(--op-space-3x-small);
2460
+ }
2461
+ /* Size Modifiers */
2462
+ &.btn--small {
2463
+ --__op-btn-height: var(--_op-btn-height-small);
2464
+ --__op-btn-font-size: var(--_op-btn-font-small);
2465
+ --__op-btn-padding: var(--_op-btn-padding-small);
2466
+ }
2467
+ &.btn--medium {
2468
+ --__op-btn-height: var(--_op-btn-height-medium);
2469
+ --__op-btn-font-size: var(--_op-btn-font-medium);
2470
+ --__op-btn-padding: var(--_op-btn-padding-medium);
2471
+ }
2472
+ &.btn--large {
2461
2473
  --__op-btn-height: var(--_op-btn-height-large);
2462
2474
  --__op-btn-font-size: var(--_op-btn-font-large);
2463
2475
  --__op-btn-padding: var(--_op-btn-padding-large);
2464
2476
  }
2477
+ /* Disabled Modifier */
2478
+ &.btn--disabled,
2479
+ &:disabled {
2480
+ opacity: var(--op-opacity-disabled);
2481
+ pointer-events: none;
2482
+ -webkit-user-select: none; /* stylelint-disable property-no-vendor-prefix */
2483
+ user-select: none;
2484
+ }
2485
+ /* Button with notification style badge */
2486
+ &.btn--with-badge {
2487
+ position: relative;
2488
+ }
2489
+ /* Focus State */
2490
+ &:focus,
2491
+ &:focus-within,
2492
+ &:focus-visible {
2493
+ outline: none;
2494
+ }
2495
+ /* https:/*uxmovement.com/mobile/optimal-size-and-spacing-for-mobile-buttons/ */
2496
+ /* --op-breakpoint-small */
2497
+ /* Variant Modifiers */
2498
+ &.btn--primary {
2499
+ background-color: var(--op-color-primary-base);
2500
+ box-shadow: inset var(--op-border-all) var(--op-color-primary-base);
2501
+ color: var(--op-color-primary-on-base);
2502
+ /* Active State */
2503
+ &.btn--active {
2504
+ background-color: var(--op-color-primary-minus-five);
2505
+ box-shadow: inset var(--op-border-all) var(--op-color-primary-plus-two);
2506
+ color: var(--op-color-primary-on-minus-five);
2507
+ }
2508
+ /* Hover State */
2509
+ &:hover {
2510
+ background-color: var(--op-color-primary-plus-one);
2511
+ box-shadow: inset var(--op-border-all) var(--op-color-primary-plus-one);
2512
+ color: var(--op-color-primary-on-plus-one);
2513
+ }
2514
+ /* Focus State */
2515
+ &:focus-visible {
2516
+ background-color: var(--op-color-primary-base);
2517
+ box-shadow: var(--op-input-focus-primary);
2518
+ color: var(--op-color-primary-on-base);
2519
+ }
2520
+ /* Borderless State */
2521
+ &.btn--no-border {
2522
+ background-color: transparent;
2523
+ box-shadow: none;
2524
+ color: var(--op-color-primary-base);
2525
+ /* Borderless + Active State */
2526
+ &.btn--active {
2527
+ background-color: var(--op-color-primary-plus-five);
2528
+ box-shadow: inset var(--op-border-all) var(--op-color-primary-plus-three);
2529
+ color: var(--op-color-primary-on-plus-five);
2530
+ }
2531
+ /* Borderless + Hover State */
2532
+ &:hover {
2533
+ background-color: var(--op-color-primary-plus-eight);
2534
+ box-shadow: inset var(--op-border-all) var(--op-color-primary-plus-five);
2535
+ color: var(--op-color-primary-on-plus-eight);
2536
+ }
2537
+ /* Borderless + Focus State */
2538
+ &:focus-visible {
2539
+ background-color: var(--op-color-primary-plus-eight);
2540
+ box-shadow: var(--op-input-focus-primary);
2541
+ color: var(--op-color-primary-on-plus-eight);
2542
+ }
2543
+ }
2544
+ }
2545
+ &.btn--destructive,
2546
+ &.btn--delete {
2547
+ background-color: var(--op-color-alerts-danger-base);
2548
+ box-shadow: inset var(--op-border-all) var(--op-color-alerts-danger-base);
2549
+ color: var(--op-color-alerts-danger-on-base);
2550
+ /* Active State */
2551
+ &.btn--active {
2552
+ background-color: var(--op-color-alerts-danger-plus-five);
2553
+ box-shadow: inset var(--op-border-all) var(--op-color-alerts-danger-plus-three);
2554
+ color: var(--op-color-alerts-danger-on-plus-five);
2555
+ }
2556
+ /* Hover State */
2557
+ &:hover {
2558
+ background-color: var(--op-color-alerts-danger-minus-two);
2559
+ box-shadow: inset var(--op-border-all) var(--op-color-alerts-danger-minus-two);
2560
+ color: var(--op-color-alerts-danger-on-minus-two);
2561
+ }
2562
+ /* Focus State */
2563
+ &:focus-visible {
2564
+ background-color: var(--op-color-alerts-danger-base);
2565
+ box-shadow: var(--op-input-focus-danger);
2566
+ color: var(--op-color-alerts-danger-on-base);
2567
+ }
2568
+ }
2569
+ &.btn--warning {
2570
+ background-color: var(--op-color-alerts-warning-base);
2571
+ box-shadow: inset var(--op-border-all) var(--op-color-alerts-warning-base);
2572
+ color: var(--op-color-alerts-warning-on-base);
2573
+ /* Active State */
2574
+ &.btn--active {
2575
+ background-color: var(--op-color-alerts-warning-plus-five);
2576
+ box-shadow: inset var(--op-border-all) var(--op-color-alerts-warning-plus-three);
2577
+ color: var(--op-color-alerts-warning-on-plus-five);
2578
+ }
2579
+ /* Hover State */
2580
+ &:hover {
2581
+ background-color: var(--op-color-alerts-warning-minus-two);
2582
+ box-shadow: inset var(--op-border-all) var(--op-color-alerts-warning-minus-two);
2583
+ color: var(--op-color-alerts-warning-on-minus-two);
2584
+ }
2585
+ /* Focus State */
2586
+ &:focus-visible {
2587
+ background-color: var(--op-color-alerts-warning-base);
2588
+ box-shadow: var(--op-input-focus-warning);
2589
+ color: var(--op-color-alerts-warning-on-base);
2590
+ }
2591
+ }
2465
2592
  }
2466
-
2467
- .btn {
2468
- background-color: var(--op-color-neutral-plus-eight);
2469
- box-shadow: inset var(--op-border-all) var(--op-color-neutral-plus-four);
2470
- color: var(--op-color-neutral-on-plus-eight);
2471
- }
2472
- .btn.btn--active {
2473
- background-color: var(--op-color-primary-plus-five);
2474
- box-shadow: inset var(--op-border-all) var(--op-color-primary-plus-three);
2475
- color: var(--op-color-primary-on-plus-five);
2476
- }
2477
- .btn:hover {
2478
- background-color: var(--op-color-primary-plus-eight);
2479
- box-shadow: inset var(--op-border-all) var(--op-color-primary-plus-three);
2480
- color: var(--op-color-primary-on-plus-eight);
2481
- }
2482
- .btn:focus-visible {
2483
- background-color: var(--op-color-neutral-plus-eight);
2484
- box-shadow: var(--op-input-focus-primary);
2485
- color: var(--op-color-neutral-on-plus-eight);
2486
- }
2487
- .btn.btn--no-border {
2488
- background-color: transparent;
2489
- box-shadow: none;
2490
- color: var(--op-color-primary-on-plus-max);
2491
- }
2492
- .btn.btn--no-border.btn--active {
2493
- background-color: var(--op-color-primary-plus-five);
2494
- box-shadow: inset var(--op-border-all) var(--op-color-primary-plus-three);
2495
- color: var(--op-color-primary-on-plus-five);
2496
- }
2497
- .btn.btn--no-border:hover {
2498
- background-color: var(--op-color-primary-plus-eight);
2499
- box-shadow: inset var(--op-border-all) var(--op-color-primary-plus-five);
2500
- color: var(--op-color-primary-on-plus-eight);
2501
- }
2502
- .btn.btn--no-border:focus-visible {
2503
- background-color: var(--op-color-primary-plus-eight);
2504
- box-shadow: var(--op-input-focus-primary);
2505
- color: var(--op-color-primary-on-plus-eight);
2506
- }
2507
-
2508
- .btn-primary {
2509
- background-color: var(--op-color-primary-base);
2510
- box-shadow: inset var(--op-border-all) var(--op-color-primary-base);
2511
- color: var(--op-color-primary-on-base);
2512
- }
2513
- .btn-primary.btn--active {
2514
- background-color: var(--op-color-primary-minus-five);
2515
- box-shadow: inset var(--op-border-all) var(--op-color-primary-plus-two);
2516
- color: var(--op-color-primary-on-minus-five);
2517
- }
2518
- .btn-primary:hover {
2519
- background-color: var(--op-color-primary-plus-one);
2520
- box-shadow: inset var(--op-border-all) var(--op-color-primary-plus-one);
2521
- color: var(--op-color-primary-on-plus-one);
2522
- }
2523
- .btn-primary:focus-visible {
2524
- background-color: var(--op-color-primary-base);
2525
- box-shadow: var(--op-input-focus-primary);
2526
- color: var(--op-color-primary-on-base);
2527
- }
2528
- .btn-primary.btn--no-border {
2529
- background-color: transparent;
2530
- box-shadow: none;
2531
- color: var(--op-color-primary-base);
2532
- }
2533
- .btn-primary.btn--no-border.btn--active {
2534
- background-color: var(--op-color-primary-plus-five);
2535
- box-shadow: inset var(--op-border-all) var(--op-color-primary-plus-three);
2536
- color: var(--op-color-primary-on-plus-five);
2537
- }
2538
- .btn-primary.btn--no-border:hover {
2539
- background-color: var(--op-color-primary-plus-eight);
2540
- box-shadow: inset var(--op-border-all) var(--op-color-primary-plus-five);
2541
- color: var(--op-color-primary-on-plus-eight);
2542
- }
2543
- .btn-primary.btn--no-border:focus-visible {
2544
- background-color: var(--op-color-primary-plus-eight);
2545
- box-shadow: var(--op-input-focus-primary);
2546
- color: var(--op-color-primary-on-plus-eight);
2547
- }
2548
-
2549
- .btn-destructive,
2550
- .btn-delete {
2551
- background-color: var(--op-color-alerts-danger-base);
2552
- box-shadow: inset var(--op-border-all) var(--op-color-alerts-danger-base);
2553
- color: var(--op-color-alerts-danger-on-base);
2554
- }
2555
- .btn-destructive.btn--active,
2556
- .btn-delete.btn--active {
2557
- background-color: var(--op-color-alerts-danger-plus-five);
2558
- box-shadow: inset var(--op-border-all) var(--op-color-alerts-danger-plus-three);
2559
- color: var(--op-color-alerts-danger-on-plus-five);
2560
- }
2561
- .btn-destructive:hover,
2562
- .btn-delete:hover {
2563
- background-color: var(--op-color-alerts-danger-minus-two);
2564
- box-shadow: inset var(--op-border-all) var(--op-color-alerts-danger-minus-two);
2565
- color: var(--op-color-alerts-danger-on-minus-two);
2566
- }
2567
- .btn-destructive:focus-visible,
2568
- .btn-delete:focus-visible {
2569
- background-color: var(--op-color-alerts-danger-base);
2570
- box-shadow: var(--op-input-focus-danger);
2571
- color: var(--op-color-alerts-danger-on-base);
2572
- }
2573
-
2574
- .btn-warning {
2575
- background-color: var(--op-color-alerts-warning-base);
2576
- box-shadow: inset var(--op-border-all) var(--op-color-alerts-warning-base);
2577
- color: var(--op-color-alerts-warning-on-base);
2578
- }
2579
- .btn-warning.btn--active {
2580
- background-color: var(--op-color-alerts-warning-plus-five);
2581
- box-shadow: inset var(--op-border-all) var(--op-color-alerts-warning-plus-three);
2582
- color: var(--op-color-alerts-warning-on-plus-five);
2583
- }
2584
- .btn-warning:hover {
2585
- background-color: var(--op-color-alerts-warning-minus-two);
2586
- box-shadow: inset var(--op-border-all) var(--op-color-alerts-warning-minus-two);
2587
- color: var(--op-color-alerts-warning-on-minus-two);
2588
- }
2589
- .btn-warning:focus-visible {
2590
- background-color: var(--op-color-alerts-warning-base);
2591
- box-shadow: var(--op-input-focus-warning);
2592
- color: var(--op-color-alerts-warning-on-base);
2593
+ @media (width <= 768px) {
2594
+ .btn {
2595
+ --__op-btn-height: var(--_op-btn-height-large);
2596
+ --__op-btn-font-size: var(--_op-btn-font-large);
2597
+ &.btn--small,
2598
+ &.btn--medium,
2599
+ &.btn--large {
2600
+ --__op-btn-height: var(--_op-btn-height-large);
2601
+ --__op-btn-font-size: var(--_op-btn-font-large);
2602
+ --__op-btn-padding: var(--_op-btn-padding-large);
2603
+ }
2604
+ }
2593
2605
  }
2594
2606
 
2595
2607
  .btn-group {
@@ -2598,85 +2610,33 @@ small {
2598
2610
  --op-btn-group-focus-z-index: 3;
2599
2611
  display: inline-flex;
2600
2612
  align-items: center;
2601
- }
2602
- .btn-group .btn + .btn,
2603
- .btn-group .btn + .btn-primary,
2604
- .btn-group .btn + .btn-destructive,
2605
- .btn-group .btn + .btn-delete,
2606
- .btn-group .btn + .btn-warning,
2607
- .btn-group .btn-primary + .btn,
2608
- .btn-group .btn-primary + .btn-primary,
2609
- .btn-group .btn-primary + .btn-destructive,
2610
- .btn-group .btn-primary + .btn-delete,
2611
- .btn-group .btn-primary + .btn-warning,
2612
- .btn-group .btn-destructive + .btn,
2613
- .btn-group .btn-destructive + .btn-primary,
2614
- .btn-group .btn-destructive + .btn-destructive,
2615
- .btn-group .btn-destructive + .btn-delete,
2616
- .btn-group .btn-destructive + .btn-warning,
2617
- .btn-group .btn-delete + .btn,
2618
- .btn-group .btn-delete + .btn-primary,
2619
- .btn-group .btn-delete + .btn-destructive,
2620
- .btn-group .btn-delete + .btn-delete,
2621
- .btn-group .btn-delete + .btn-warning,
2622
- .btn-group .btn-warning + .btn,
2623
- .btn-group .btn-warning + .btn-primary,
2624
- .btn-group .btn-warning + .btn-destructive,
2625
- .btn-group .btn-warning + .btn-delete,
2626
- .btn-group .btn-warning + .btn-warning {
2627
- margin-left: -1px;
2628
- }
2629
- .btn-group .btn:hover,
2630
- .btn-group .btn-primary:hover,
2631
- .btn-group .btn-destructive:hover,
2632
- .btn-group .btn-delete:hover,
2633
- .btn-group .btn-warning:hover {
2634
- z-index: var(--op-btn-group-hover-z-index);
2635
- }
2636
- .btn-group .btn.btn--active,
2637
- .btn-group .btn-primary.btn--active,
2638
- .btn-group .btn-destructive.btn--active,
2639
- .btn-group .btn-delete.btn--active,
2640
- .btn-group .btn-warning.btn--active {
2641
- z-index: var(--op-btn-group-active-z-index);
2642
- }
2643
- .btn-group .btn:focus, .btn-group .btn:focus-within, .btn-group .btn:focus-visible,
2644
- .btn-group .btn-primary:focus,
2645
- .btn-group .btn-primary:focus-within,
2646
- .btn-group .btn-primary:focus-visible,
2647
- .btn-group .btn-destructive:focus,
2648
- .btn-group .btn-destructive:focus-within,
2649
- .btn-group .btn-destructive:focus-visible,
2650
- .btn-group .btn-delete:focus,
2651
- .btn-group .btn-delete:focus-within,
2652
- .btn-group .btn-delete:focus-visible,
2653
- .btn-group .btn-warning:focus,
2654
- .btn-group .btn-warning:focus-within,
2655
- .btn-group .btn-warning:focus-visible {
2656
- z-index: var(--op-btn-group-focus-z-index);
2657
- }
2658
- .btn-group .btn:not(:first-child, :last-child),
2659
- .btn-group .btn-primary:not(:first-child, :last-child),
2660
- .btn-group .btn-destructive:not(:first-child, :last-child),
2661
- .btn-group .btn-delete:not(:first-child, :last-child),
2662
- .btn-group .btn-warning:not(:first-child, :last-child) {
2663
- border-radius: 0;
2664
- }
2665
- .btn-group .btn:first-child:not(:last-child),
2666
- .btn-group .btn-primary:first-child:not(:last-child),
2667
- .btn-group .btn-destructive:first-child:not(:last-child),
2668
- .btn-group .btn-delete:first-child:not(:last-child),
2669
- .btn-group .btn-warning:first-child:not(:last-child) {
2670
- border-bottom-right-radius: 0;
2671
- border-top-right-radius: 0;
2672
- }
2673
- .btn-group .btn:last-child:not(:first-child),
2674
- .btn-group .btn-primary:last-child:not(:first-child),
2675
- .btn-group .btn-destructive:last-child:not(:first-child),
2676
- .btn-group .btn-delete:last-child:not(:first-child),
2677
- .btn-group .btn-warning:last-child:not(:first-child) {
2678
- border-bottom-left-radius: 0;
2679
- border-top-left-radius: 0;
2613
+ .btn {
2614
+ + .btn {
2615
+ margin-inline-start: calc(var(--op-border-width) * -1);
2616
+ }
2617
+ &:hover {
2618
+ z-index: var(--op-btn-group-hover-z-index);
2619
+ }
2620
+ &.btn--active {
2621
+ z-index: var(--op-btn-group-active-z-index);
2622
+ }
2623
+ &:focus,
2624
+ &:focus-within,
2625
+ &:focus-visible {
2626
+ z-index: var(--op-btn-group-focus-z-index);
2627
+ }
2628
+ &:not(:first-child, :last-child) {
2629
+ border-radius: 0;
2630
+ }
2631
+ &:first-child:not(:last-child) {
2632
+ border-bottom-right-radius: 0;
2633
+ border-top-right-radius: 0;
2634
+ }
2635
+ &:last-child:not(:first-child) {
2636
+ border-bottom-left-radius: 0;
2637
+ border-top-left-radius: 0;
2638
+ }
2639
+ }
2680
2640
  }
2681
2641
 
2682
2642
  .btn-group-toolbar {
@@ -3859,10 +3819,14 @@ dialog.modal {
3859
3819
  }
3860
3820
  }
3861
3821
 
3862
- .table-container, .table-danger, .table-primary, .table {
3863
- --_op-table-cell-height-default: calc(11 * var(--op-size-unit));
3864
- --_op-table-cell-height-comfortable: calc(16 * var(--op-size-unit));
3865
- --_op-table-cell-height-compact: calc(8 * var(--op-size-unit));
3822
+ .table {
3823
+ /* Public API */
3824
+ /* Cells (for height, the appropriate variable is used when using the density modifiers) */
3825
+ --_op-table-cell-height-default: calc(11 * var(--op-size-unit)); /* 44px */
3826
+ --_op-table-cell-height-comfortable: calc(16 * var(--op-size-unit)); /* 64px */
3827
+ --_op-table-cell-height-compact: calc(8 * var(--op-size-unit)); /* 32px */
3828
+ /* Private API */
3829
+ /* These allow for overriding specific padding versions easier. */
3866
3830
  --__op-table-cell-height: var(--_op-table-cell-height-default);
3867
3831
  width: 100%;
3868
3832
  border-radius: var(--op-radius-medium);
@@ -3870,87 +3834,98 @@ dialog.modal {
3870
3834
  box-shadow: var(--op-border-all) var(--op-color-border);
3871
3835
  contain: paint;
3872
3836
  table-layout: auto;
3873
- }
3874
- .table-container thead, .table-danger thead, .table-primary thead, .table thead {
3875
- background-color: var(--op-color-neutral-plus-eight);
3876
- box-shadow: inset var(--op-border-top) var(--op-color-border);
3877
- color: var(--op-color-neutral-on-plus-eight);
3878
- }
3879
- .table-container thead:has(th input[type=checkbox]:checked), .table-danger thead:has(th input[type=checkbox]:checked), .table-primary thead:has(th input[type=checkbox]:checked), .table thead:has(th input[type=checkbox]:checked) {
3880
- background-color: var(--op-color-primary-plus-seven);
3881
- color: var(--op-color-primary-on-plus-seven);
3882
- }
3883
- .table-container th, .table-danger th, .table-primary th, .table th {
3884
- font-weight: var(--op-font-weight-semi-bold);
3885
- text-align: left;
3886
- }
3887
- .table-container tbody, .table-danger tbody, .table-primary tbody, .table tbody,
3888
- .table-container tfoot,
3889
- .table-danger tfoot,
3890
- .table-primary tfoot,
3891
- .table tfoot {
3892
- background-color: var(--op-color-neutral-plus-max);
3893
- color: var(--op-color-neutral-on-plus-max);
3894
- }
3895
- .table-container th, .table-danger th, .table-primary th, .table th,
3896
- .table-container td,
3897
- .table-danger td,
3898
- .table-primary td,
3899
- .table td {
3900
- height: var(--__op-table-cell-height);
3901
- padding: var(--op-space-2x-small) var(--op-space-small);
3902
- font-size: var(--op-font-small);
3903
- }
3904
- .table-container tr:not(:last-child), .table-danger tr:not(:last-child), .table-primary tr:not(:last-child), .table tr:not(:last-child) {
3905
- box-shadow: inset var(--op-border-top) var(--op-color-border);
3906
- }
3907
- .table-container tfoot tr, .table-danger tfoot tr, .table-primary tfoot tr, .table tfoot tr {
3908
- box-shadow: var(--op-border-top) var(--op-color-border);
3909
- }
3910
- .table--auto-layout.table-container, .table--auto-layout.table-danger, .table--auto-layout.table-primary, .table--auto-layout.table {
3911
- table-layout: auto;
3912
- }
3913
- .table--fixed-layout.table-container, .table--fixed-layout.table-danger, .table--fixed-layout.table-primary, .table--fixed-layout.table {
3914
- table-layout: fixed;
3915
- }
3916
- .table--default-density.table-container, .table--default-density.table-danger, .table--default-density.table-primary, .table--default-density.table {
3917
- --__op-table-cell-height: var(--_op-table-cell-height-default);
3918
- }
3919
- .table--comfortable-density.table-container, .table--comfortable-density.table-danger, .table--comfortable-density.table-primary, .table--comfortable-density.table {
3920
- --__op-table-cell-height: var(--_op-table-cell-height-comfortable);
3921
- }
3922
- .table--compact-density.table-container, .table--compact-density.table-danger, .table--compact-density.table-primary, .table--compact-density.table {
3923
- --__op-table-cell-height: var(--_op-table-cell-height-compact);
3924
- }
3925
- .table--even-striped.table-container tbody tr:nth-child(even), .table--even-striped.table-danger tbody tr:nth-child(even), .table--even-striped.table-primary tbody tr:nth-child(even), .table--even-striped.table tbody tr:nth-child(even) {
3926
- background-color: var(--op-color-neutral-plus-seven);
3927
- color: var(--op-color-neutral-on-plus-seven);
3928
- }
3929
- .table--odd-striped.table-container tbody tr:nth-child(odd), .table--odd-striped.table-danger tbody tr:nth-child(odd), .table--odd-striped.table-primary tbody tr:nth-child(odd), .table--odd-striped.table tbody tr:nth-child(odd) {
3930
- background-color: var(--op-color-neutral-plus-seven);
3931
- color: var(--op-color-neutral-on-plus-seven);
3932
- }
3933
- .table--sticky-header.table-container thead, .table--sticky-header.table-danger thead, .table--sticky-header.table-primary thead, .table--sticky-header.table thead {
3934
- position: sticky;
3935
- top: 0;
3936
- }
3937
- .table--sticky-footer.table-container tfoot, .table--sticky-footer.table-danger tfoot, .table--sticky-footer.table-primary tfoot, .table--sticky-footer.table tfoot {
3938
- position: sticky;
3939
- bottom: 0;
3940
- }
3941
-
3942
- .table-primary thead {
3943
- background-color: var(--op-color-primary-plus-seven);
3944
- color: var(--op-color-primary-on-plus-seven);
3945
- }
3946
-
3947
- .table-danger thead {
3948
- background-color: var(--op-color-alerts-danger-plus-seven);
3949
- color: var(--op-color-alerts-danger-on-plus-seven);
3950
- }
3951
-
3952
- .table-container {
3953
- overflow-y: auto;
3837
+ /* Elements */
3838
+ thead {
3839
+ background-color: var(--op-color-neutral-plus-eight);
3840
+ box-shadow: inset var(--op-border-top) var(--op-color-border);
3841
+ color: var(--op-color-neutral-on-plus-eight);
3842
+ &:has(th input[type=checkbox]:checked) {
3843
+ background-color: var(--op-color-primary-plus-seven);
3844
+ color: var(--op-color-primary-on-plus-seven);
3845
+ }
3846
+ }
3847
+ th {
3848
+ font-weight: var(--op-font-weight-semi-bold);
3849
+ text-align: left;
3850
+ }
3851
+ tbody,
3852
+ tfoot {
3853
+ background-color: var(--op-color-neutral-plus-max);
3854
+ color: var(--op-color-neutral-on-plus-max);
3855
+ }
3856
+ th,
3857
+ td {
3858
+ height: var(--__op-table-cell-height);
3859
+ font-size: var(--op-font-small);
3860
+ padding-block: var(--op-space-2x-small);
3861
+ padding-inline: var(--op-space-small);
3862
+ }
3863
+ tfoot tr {
3864
+ box-shadow: var(--op-border-top) var(--op-color-border);
3865
+ }
3866
+ tr:not(:last-child) {
3867
+ box-shadow: inset var(--op-border-top) var(--op-color-border);
3868
+ }
3869
+ /* Modifiers */
3870
+ /* stylelint-disable no-descending-specificity */
3871
+ &.table--primary {
3872
+ thead {
3873
+ background-color: var(--op-color-primary-plus-seven);
3874
+ color: var(--op-color-primary-on-plus-seven);
3875
+ }
3876
+ }
3877
+ &.table--danger {
3878
+ thead {
3879
+ background-color: var(--op-color-alerts-danger-plus-seven);
3880
+ color: var(--op-color-alerts-danger-on-plus-seven);
3881
+ }
3882
+ }
3883
+ /* stylelint-enable no-descending-specificity */
3884
+ &.table--container {
3885
+ overflow-y: auto;
3886
+ }
3887
+ /* Layout Modifiers */
3888
+ &.table--auto-layout {
3889
+ table-layout: auto;
3890
+ }
3891
+ &.table--fixed-layout {
3892
+ table-layout: fixed;
3893
+ }
3894
+ /* Table Density Modifiers */
3895
+ &.table--default-density {
3896
+ --__op-table-cell-height: var(--_op-table-cell-height-default);
3897
+ }
3898
+ &.table--comfortable-density {
3899
+ --__op-table-cell-height: var(--_op-table-cell-height-comfortable);
3900
+ }
3901
+ &.table--compact-density {
3902
+ --__op-table-cell-height: var(--_op-table-cell-height-compact);
3903
+ }
3904
+ /* Striped Modifiers */
3905
+ &.table--even-striped {
3906
+ tbody tr:nth-child(even) {
3907
+ background-color: var(--op-color-neutral-plus-seven);
3908
+ color: var(--op-color-neutral-on-plus-seven);
3909
+ }
3910
+ }
3911
+ &.table--odd-striped {
3912
+ tbody tr:nth-child(odd) {
3913
+ background-color: var(--op-color-neutral-plus-seven);
3914
+ color: var(--op-color-neutral-on-plus-seven);
3915
+ }
3916
+ }
3917
+ /* Sticky Header Row Modifier */
3918
+ /* stylelint-disable no-descending-specificity */
3919
+ &.table--sticky-header thead {
3920
+ position: sticky;
3921
+ inset-block-start: 0;
3922
+ }
3923
+ /* stylelint-enable no-descending-specificity */
3924
+ /* Sticky Footer Row Modifier */
3925
+ &.table--sticky-footer tfoot {
3926
+ position: sticky;
3927
+ inset-block-end: 0;
3928
+ }
3954
3929
  }
3955
3930
 
3956
3931
  .tag {