@ni/nimble-components 11.0.1 → 11.0.4

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.
@@ -2252,7 +2252,7 @@ const nd=od.compose({baseName:"menu-button",template:t=>X`
2252
2252
  <${t.tagFor(ed)}
2253
2253
  part="button"
2254
2254
  appearance="${t=>t.appearance}"
2255
- content-hidden="${t=>t.contentHidden}"
2255
+ ?content-hidden="${t=>t.contentHidden}"
2256
2256
  ?checked="${t=>t.open}"
2257
2257
  ?disabled="${t=>t.disabled}"
2258
2258
  aria-haspopup="true"
@@ -2444,6 +2444,7 @@ const ld=mt`
2444
2444
  user-select: none;
2445
2445
  color: ${Zn};
2446
2446
  height: calc(${kn} + ${yn});
2447
+ --ni-private-hover-indicator-width: calc(${_n} + 1px);
2447
2448
  }
2448
2449
 
2449
2450
  :host([disabled]) {
@@ -2451,32 +2452,71 @@ const ld=mt`
2451
2452
  cursor: default;
2452
2453
  }
2453
2454
 
2455
+ .label {
2456
+ display: flex;
2457
+ color: ${gr};
2458
+ font: ${vr};
2459
+ }
2460
+
2454
2461
  .root {
2455
2462
  box-sizing: border-box;
2456
2463
  position: relative;
2457
2464
  display: flex;
2458
2465
  flex-direction: row;
2466
+ justify-content: center;
2459
2467
  border-radius: 0px;
2460
2468
  border-bottom: ${_n} solid rgba(${pn}, 0.3);
2461
- padding-bottom: 1px;
2462
- transition: border-bottom ${Fr}, padding-bottom ${Fr};
2469
+ gap: calc(${Cn} / 2);
2470
+ }
2471
+
2472
+ .root:focus-within {
2473
+ border-bottom-color: ${fn};
2474
+ }
2475
+
2476
+ :host([disabled]) .root,
2477
+ :host([disabled]) .root:hover {
2478
+ border-bottom: ${_n} solid ${tr};
2479
+ }
2480
+
2481
+ .root::before {
2482
+ ${""}
2483
+ content: ' ';
2484
+ color: transparent;
2485
+ width: 0px;
2486
+ user-select: none;
2487
+ }
2488
+
2489
+ .root::after {
2490
+ content: '';
2491
+ position: absolute;
2492
+ bottom: calc(-1 * ${_n});
2493
+ width: 0px;
2494
+ height: 0px;
2495
+ border-bottom: ${fn}
2496
+ var(--ni-private-hover-indicator-width) solid;
2497
+ transition: width ${Fr} ease-in;
2463
2498
  }
2464
2499
 
2465
2500
  @media (prefers-reduced-motion) {
2466
- .root {
2501
+ .root::after {
2467
2502
  transition-duration: 0s;
2468
2503
  }
2469
2504
  }
2470
2505
 
2471
- .root:hover {
2472
- border-bottom: 2px solid ${fn};
2473
- padding-bottom: 0px;
2506
+ :host(.invalid) .root::after {
2507
+ border-bottom-color: ${vn};
2474
2508
  }
2475
2509
 
2476
- :host([disabled]) .root,
2477
- :host([disabled]) .root:hover {
2478
- border-bottom: ${_n} solid ${tr};
2479
- padding-bottom: 1px;
2510
+ :host(:hover) .root::after {
2511
+ width: 100%;
2512
+ }
2513
+
2514
+ :host([disabled]:hover) .root::after {
2515
+ width: 0px;
2516
+ }
2517
+
2518
+ [part='start'] {
2519
+ display: contents;
2480
2520
  }
2481
2521
 
2482
2522
  .control {
@@ -2484,11 +2524,10 @@ const ld=mt`
2484
2524
  font: inherit;
2485
2525
  background: transparent;
2486
2526
  color: inherit;
2487
- height: 28px;
2527
+ height: calc(${yn} - ${_n});
2488
2528
  width: 100%;
2489
- margin-top: auto;
2490
- margin-bottom: auto;
2491
2529
  border: none;
2530
+ padding: 0px;
2492
2531
  }
2493
2532
 
2494
2533
  .control:hover,
@@ -2515,12 +2554,6 @@ const ld=mt`
2515
2554
  color: ${tr};
2516
2555
  }
2517
2556
 
2518
- .label {
2519
- display: flex;
2520
- color: ${gr};
2521
- font: ${vr};
2522
- }
2523
-
2524
2557
  .controls {
2525
2558
  display: flex;
2526
2559
  flex-direction: column;
@@ -2629,35 +2662,66 @@ const hd=mt`
2629
2662
  font: ${Jn};
2630
2663
  height: ${yn};
2631
2664
  position: relative;
2665
+ justify-content: center;
2632
2666
  user-select: none;
2633
2667
  min-width: 250px;
2634
2668
  outline: none;
2635
2669
  vertical-align: top;
2670
+ --ni-private-hover-indicator-width: 2px;
2671
+ --ni-private-focus-indicator-width: 1px;
2672
+ --ni-private-indicator-lines-gap: 1px;
2636
2673
  }
2637
2674
 
2638
- .listbox {
2639
- box-sizing: border-box;
2640
- display: inline-flex;
2641
- flex-direction: column;
2642
- left: 0;
2643
- overflow-y: auto;
2675
+ :host::before {
2676
+ content: '';
2644
2677
  position: absolute;
2645
- width: 100%;
2646
- --ni-private-listbox-padding: 4px;
2647
- max-height: calc(
2648
- var(--ni-private-select-max-height) - 2 *
2649
- var(--ni-private-listbox-padding)
2678
+ bottom: calc(
2679
+ var(--ni-private-hover-indicator-width) +
2680
+ var(--ni-private-indicator-lines-gap)
2650
2681
  );
2651
- z-index: 1;
2652
- padding: var(--ni-private-listbox-padding);
2653
- box-shadow: 0px 3px 3px ${wn};
2654
- border: 1px solid ${xn};
2655
- background-color: ${an};
2656
- background-clip: padding-box;
2682
+ width: 0px;
2683
+ height: 0px;
2684
+ justify-self: center;
2685
+ border-bottom: ${fn}
2686
+ var(--ni-private-focus-indicator-width) solid;
2687
+ transition: width ${Fr} ease-in;
2657
2688
  }
2658
2689
 
2659
- .listbox[hidden] {
2660
- display: none;
2690
+ @media (prefers-reduced-motion) {
2691
+ :host::before {
2692
+ transition-duration: 0s;
2693
+ }
2694
+ }
2695
+
2696
+ :host(${Hc})::before {
2697
+ width: 100%;
2698
+ }
2699
+
2700
+ :host::after {
2701
+ content: '';
2702
+ position: absolute;
2703
+ bottom: 0px;
2704
+ width: 0px;
2705
+ height: 0px;
2706
+ justify-self: center;
2707
+ border-bottom: ${fn}
2708
+ var(--ni-private-hover-indicator-width) solid;
2709
+ transition: width ${Fr} ease-in;
2710
+ }
2711
+
2712
+ @media (prefers-reduced-motion) {
2713
+ :host::after {
2714
+ transition-duration: 0s;
2715
+ }
2716
+ }
2717
+
2718
+ :host(:hover)::after,
2719
+ :host(${Hc})::after {
2720
+ width: 100%;
2721
+ }
2722
+
2723
+ :host([disabled]:hover)::after {
2724
+ width: 0px;
2661
2725
  }
2662
2726
 
2663
2727
  .control {
@@ -2678,23 +2742,40 @@ const hd=mt`
2678
2742
  }
2679
2743
 
2680
2744
  :host(.open:not(:hover)) .control {
2681
- border-bottom: ${_n} solid ${fn};
2682
- transition: border-bottom ${Fr}, padding-bottom ${Fr};
2683
- }
2684
-
2685
- :host(:hover) .control {
2686
- border-bottom: 2px solid ${fn};
2687
- padding-bottom: 0px;
2688
- transition: border-bottom ${Fr}, padding-bottom ${Fr};
2745
+ border-bottom-color: ${fn};
2689
2746
  }
2690
2747
 
2691
2748
  :host([disabled]) .control,
2692
2749
  :host([disabled]) .control:hover {
2693
- border-bottom: ${_n} solid ${tr};
2694
- padding-bottom: 1px;
2750
+ border-bottom-color: ${tr};
2695
2751
  color: ${tr};
2696
2752
  }
2697
2753
 
2754
+ .listbox {
2755
+ box-sizing: border-box;
2756
+ display: inline-flex;
2757
+ flex-direction: column;
2758
+ left: 0;
2759
+ overflow-y: auto;
2760
+ position: absolute;
2761
+ width: 100%;
2762
+ --ni-private-listbox-padding: ${$n};
2763
+ max-height: calc(
2764
+ var(--ni-private-select-max-height) - 2 *
2765
+ var(--ni-private-listbox-padding)
2766
+ );
2767
+ z-index: 1;
2768
+ padding: var(--ni-private-listbox-padding);
2769
+ box-shadow: 0px 3px 3px ${wn};
2770
+ border: 1px solid ${xn};
2771
+ background-color: ${an};
2772
+ background-clip: padding-box;
2773
+ }
2774
+
2775
+ .listbox[hidden] {
2776
+ display: none;
2777
+ }
2778
+
2698
2779
  :host([open][position='above']) .listbox {
2699
2780
  border-bottom-left-radius: 0;
2700
2781
  border-bottom-right-radius: 0;
@@ -3388,6 +3469,10 @@ const Sd="underline",Ad="outline",Ed="block",Md="frameless",Hd=mt`
3388
3469
  --webkit-user-select: none;
3389
3470
  color: ${Zn};
3390
3471
  height: calc(${kn} + ${yn});
3472
+ --ni-private-hover-indicator-width: calc(${_n} + 1px);
3473
+ --ni-private-height-within-border: calc(
3474
+ ${yn} - 2 * ${_n}
3475
+ );
3391
3476
  }
3392
3477
 
3393
3478
  :host([disabled]) {
@@ -3411,22 +3496,10 @@ const Sd="underline",Ad="outline",Ed="block",Md="frameless",Hd=mt`
3411
3496
  flex-direction: row;
3412
3497
  border-radius: 0px;
3413
3498
  font: inherit;
3414
- transition: border-bottom ${Fr}, padding-bottom ${Fr};
3415
3499
  align-items: center;
3416
- --ni-private-hover-bottom-border-width: 2px;
3500
+ justify-content: center;
3417
3501
  border: 0px solid rgba(${pn}, 0.3);
3418
- border-bottom-width: var(--ni-private-bottom-border-width);
3419
3502
  gap: calc(${Cn} / 2);
3420
- padding-bottom: calc(
3421
- var(--ni-private-hover-bottom-border-width) -
3422
- var(--ni-private-bottom-border-width)
3423
- );
3424
- }
3425
-
3426
- @media (prefers-reduced-motion) {
3427
- .root {
3428
- transition-duration: 0s;
3429
- }
3430
3503
  }
3431
3504
 
3432
3505
  :host(.invalid) .root {
@@ -3441,21 +3514,6 @@ const Sd="underline",Ad="outline",Ed="block",Md="frameless",Hd=mt`
3441
3514
  border-color: rgba(${pn}, 0.1);
3442
3515
  }
3443
3516
 
3444
- .root:hover {
3445
- --ni-private-bottom-border-width: var(
3446
- --ni-private-hover-bottom-border-width
3447
- );
3448
- border-bottom-color: ${fn};
3449
- }
3450
-
3451
- :host([readonly]) .root:hover {
3452
- --ni-private-bottom-border-width: 1px;
3453
- }
3454
-
3455
- :host([disabled]) .root:hover {
3456
- --ni-private-bottom-border-width: 1px;
3457
- }
3458
-
3459
3517
  .root:focus-within {
3460
3518
  border-bottom-color: ${fn};
3461
3519
  }
@@ -3503,10 +3561,7 @@ const Sd="underline",Ad="outline",Ed="block",Md="frameless",Hd=mt`
3503
3561
  background: transparent;
3504
3562
  color: inherit;
3505
3563
  padding: 0px;
3506
- height: calc(
3507
- ${yn} - ${_n} -
3508
- var(--ni-private-hover-bottom-border-width)
3509
- );
3564
+ height: ${yn};
3510
3565
  width: 100%;
3511
3566
  margin-top: auto;
3512
3567
  margin-bottom: auto;
@@ -3547,6 +3602,36 @@ const Sd="underline",Ad="outline",Ed="block",Md="frameless",Hd=mt`
3547
3602
  display: contents;
3548
3603
  }
3549
3604
 
3605
+ [part='end']::after {
3606
+ content: '';
3607
+ position: absolute;
3608
+ bottom: calc(-1 * ${_n});
3609
+ width: 0px;
3610
+ height: 0px;
3611
+ border-bottom: ${fn}
3612
+ var(--ni-private-hover-indicator-width) solid;
3613
+ transition: width ${Fr} ease-in;
3614
+ }
3615
+
3616
+ @media (prefers-reduced-motion) {
3617
+ [part='end']::after {
3618
+ transition-duration: 0s;
3619
+ }
3620
+ }
3621
+
3622
+ :host(.invalid) [part='end']::after {
3623
+ border-bottom-color: ${vn};
3624
+ }
3625
+
3626
+ :host(:hover) [part='end']::after {
3627
+ width: 100%;
3628
+ }
3629
+
3630
+ :host([disabled]:hover) [part='end']::after,
3631
+ :host([readonly]:hover) [part='end']::after {
3632
+ width: 0px;
3633
+ }
3634
+
3550
3635
  .error-content {
3551
3636
  display: none;
3552
3637
  }
@@ -3602,46 +3687,33 @@ const Sd="underline",Ad="outline",Ed="block",Md="frameless",Hd=mt`
3602
3687
  }
3603
3688
  `.withBehaviors(Tc(Sd,mt`
3604
3689
  .root {
3605
- --ni-private-bottom-border-width: 1px;
3690
+ border-bottom-width: ${_n};
3691
+ }
3692
+
3693
+ .control {
3694
+ height: var(--ni-private-height-within-border);
3606
3695
  padding-top: ${_n};
3607
3696
  padding-left: ${_n};
3608
3697
  padding-right: ${_n};
3609
3698
  }
3610
-
3611
- :host([disabled]) .root {
3612
- border-color: rgba(${pn}, 0.1);
3613
- }
3614
-
3615
- :host([disabled]) .root:hover {
3616
- --ni-private-bottom-border-width: 1px;
3617
- }
3618
3699
  `),Tc(Ed,mt`
3619
3700
  .root {
3620
3701
  background-color: rgba(${pn}, 0.1);
3621
- --ni-private-bottom-border-width: 0px;
3622
- padding-top: ${_n};
3623
- padding-left: ${_n};
3624
- padding-right: ${_n};
3625
3702
  }
3626
3703
 
3627
- .root:focus-within {
3628
- --ni-private-bottom-border-width: 1px;
3629
- }
3630
-
3631
- .root:focus-within:hover {
3632
- --ni-private-bottom-border-width: var(
3633
- --ni-private-hover-bottom-border-width
3634
- );
3704
+ .control {
3705
+ padding-left: ${_n};
3706
+ padding-right: ${_n};
3635
3707
  }
3636
3708
 
3709
+ .root:focus-within,
3637
3710
  :host(.invalid) .root {
3638
- --ni-private-bottom-border-width: 1px;
3711
+ border-bottom-width: ${_n};
3639
3712
  }
3640
3713
 
3641
- :host(.invalid) .root:hover {
3642
- --ni-private-bottom-border-width: var(
3643
- --ni-private-hover-bottom-border-width
3644
- );
3714
+ .root:focus-within .control,
3715
+ :host(.invalid) .control {
3716
+ height: calc(${yn} - ${_n});
3645
3717
  }
3646
3718
 
3647
3719
  :host([readonly]) .root {
@@ -3652,28 +3724,20 @@ const Sd="underline",Ad="outline",Ed="block",Md="frameless",Hd=mt`
3652
3724
  :host([disabled]) .root {
3653
3725
  background-color: rgba(${pn}, 0.07);
3654
3726
  }
3655
-
3656
- :host([disabled]) .root:hover {
3657
- --ni-private-bottom-border-width: 0px;
3658
- }
3659
-
3660
- :host(.invalid[disabled]) .root {
3661
- --ni-private-bottom-border-width: 1px;
3662
- }
3663
3727
  `),Tc(Ad,mt`
3664
3728
  .root {
3665
- --ni-private-bottom-border-width: 1px;
3666
3729
  border-width: ${_n};
3667
- border-bottom-width: var(--ni-private-bottom-border-width);
3730
+ }
3731
+
3732
+ .control {
3733
+ height: var(--ni-private-height-within-border);
3668
3734
  }
3669
3735
 
3670
3736
  :host(.invalid) .errortext {
3671
3737
  top: calc(${yn} - ${_n});
3672
3738
  }
3673
3739
  `),Tc(Md,mt`
3674
- .root {
3675
- --ni-private-bottom-border-width: 0px;
3676
- padding-top: ${_n};
3740
+ .control {
3677
3741
  padding-left: ${_n};
3678
3742
  padding-right: ${_n};
3679
3743
  }
@@ -3681,10 +3745,6 @@ const Sd="underline",Ad="outline",Ed="block",Md="frameless",Hd=mt`
3681
3745
  :host([readonly]) .root {
3682
3746
  border-color: transparent;
3683
3747
  }
3684
-
3685
- .root:hover {
3686
- --ni-private-bottom-border-width: 0px;
3687
- }
3688
3748
  `),Gr(mt`
3689
3749
  ${""}
3690
3750
  .control::-ms-reveal {