@ni/nimble-components 11.0.0 → 11.0.3

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.
@@ -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,32 +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;
2678
+ bottom: calc(
2679
+ var(--ni-private-hover-indicator-width) +
2680
+ var(--ni-private-indicator-lines-gap)
2681
+ );
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;
2688
+ }
2689
+
2690
+ @media (prefers-reduced-motion) {
2691
+ :host::before {
2692
+ transition-duration: 0s;
2693
+ }
2694
+ }
2695
+
2696
+ :host(${Hc})::before {
2645
2697
  width: 100%;
2646
- ${""}
2647
- max-height: calc(var(--max-height) - ${yn});
2648
- z-index: 1;
2649
- padding: 4px;
2650
- box-shadow: 0px 3px 3px ${wn};
2651
- border: 1px solid ${xn};
2652
- background-color: ${an};
2653
- background-clip: padding-box;
2654
2698
  }
2655
2699
 
2656
- .listbox[hidden] {
2657
- display: none;
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;
2658
2725
  }
2659
2726
 
2660
2727
  .control {
@@ -2675,23 +2742,40 @@ const hd=mt`
2675
2742
  }
2676
2743
 
2677
2744
  :host(.open:not(:hover)) .control {
2678
- border-bottom: ${_n} solid ${fn};
2679
- transition: border-bottom ${Fr}, padding-bottom ${Fr};
2680
- }
2681
-
2682
- :host(:hover) .control {
2683
- border-bottom: 2px solid ${fn};
2684
- padding-bottom: 0px;
2685
- transition: border-bottom ${Fr}, padding-bottom ${Fr};
2745
+ border-bottom-color: ${fn};
2686
2746
  }
2687
2747
 
2688
2748
  :host([disabled]) .control,
2689
2749
  :host([disabled]) .control:hover {
2690
- border-bottom: ${_n} solid ${tr};
2691
- padding-bottom: 1px;
2750
+ border-bottom-color: ${tr};
2692
2751
  color: ${tr};
2693
2752
  }
2694
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
+
2695
2779
  :host([open][position='above']) .listbox {
2696
2780
  border-bottom-left-radius: 0;
2697
2781
  border-bottom-right-radius: 0;
@@ -2757,8 +2841,8 @@ const hd=mt`
2757
2841
  flex: 0 0 auto;
2758
2842
  }
2759
2843
  `
2760
- const dd=class extends ui{setPositioning(){this.$fastController.isConnected&&super.setPositioning()}slottedOptionsChanged(t,e){const s=this.value
2761
- super.slottedOptionsChanged(t,e),s&&(this.value=s)}}.compose({baseName:"select",baseClass:ui,template:(t,e)=>X`
2844
+ const dd=class extends ui{setPositioning(){this.$fastController.isConnected&&(super.setPositioning(),this.updateListboxMaxHeightCssVariable())}slottedOptionsChanged(t,e){const s=this.value
2845
+ super.slottedOptionsChanged(t,e),s&&(this.value=s)}maxHeightChanged(){this.updateListboxMaxHeightCssVariable()}updateListboxMaxHeightCssVariable(){this.listbox&&this.listbox.style.setProperty("--ni-private-select-max-height",`${this.maxHeight}px`)}}.compose({baseName:"select",baseClass:ui,template:(t,e)=>X`
2762
2846
  <template
2763
2847
  class="${t=>[t.collapsible&&"collapsible",t.collapsible&&t.open&&"open",t.disabled&&"disabled",t.collapsible&&t.position].filter(Boolean).join(" ")}"
2764
2848
  aria-activedescendant="${t=>t.ariaActiveDescendant}"
@@ -3385,6 +3469,10 @@ const Sd="underline",Ad="outline",Ed="block",Md="frameless",Hd=mt`
3385
3469
  --webkit-user-select: none;
3386
3470
  color: ${Zn};
3387
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
+ );
3388
3476
  }
3389
3477
 
3390
3478
  :host([disabled]) {
@@ -3408,22 +3496,10 @@ const Sd="underline",Ad="outline",Ed="block",Md="frameless",Hd=mt`
3408
3496
  flex-direction: row;
3409
3497
  border-radius: 0px;
3410
3498
  font: inherit;
3411
- transition: border-bottom ${Fr}, padding-bottom ${Fr};
3412
3499
  align-items: center;
3413
- --ni-private-hover-bottom-border-width: 2px;
3500
+ justify-content: center;
3414
3501
  border: 0px solid rgba(${pn}, 0.3);
3415
- border-bottom-width: var(--ni-private-bottom-border-width);
3416
3502
  gap: calc(${Cn} / 2);
3417
- padding-bottom: calc(
3418
- var(--ni-private-hover-bottom-border-width) -
3419
- var(--ni-private-bottom-border-width)
3420
- );
3421
- }
3422
-
3423
- @media (prefers-reduced-motion) {
3424
- .root {
3425
- transition-duration: 0s;
3426
- }
3427
3503
  }
3428
3504
 
3429
3505
  :host(.invalid) .root {
@@ -3438,21 +3514,6 @@ const Sd="underline",Ad="outline",Ed="block",Md="frameless",Hd=mt`
3438
3514
  border-color: rgba(${pn}, 0.1);
3439
3515
  }
3440
3516
 
3441
- .root:hover {
3442
- --ni-private-bottom-border-width: var(
3443
- --ni-private-hover-bottom-border-width
3444
- );
3445
- border-bottom-color: ${fn};
3446
- }
3447
-
3448
- :host([readonly]) .root:hover {
3449
- --ni-private-bottom-border-width: 1px;
3450
- }
3451
-
3452
- :host([disabled]) .root:hover {
3453
- --ni-private-bottom-border-width: 1px;
3454
- }
3455
-
3456
3517
  .root:focus-within {
3457
3518
  border-bottom-color: ${fn};
3458
3519
  }
@@ -3500,10 +3561,7 @@ const Sd="underline",Ad="outline",Ed="block",Md="frameless",Hd=mt`
3500
3561
  background: transparent;
3501
3562
  color: inherit;
3502
3563
  padding: 0px;
3503
- height: calc(
3504
- ${yn} - ${_n} -
3505
- var(--ni-private-hover-bottom-border-width)
3506
- );
3564
+ height: ${yn};
3507
3565
  width: 100%;
3508
3566
  margin-top: auto;
3509
3567
  margin-bottom: auto;
@@ -3544,6 +3602,36 @@ const Sd="underline",Ad="outline",Ed="block",Md="frameless",Hd=mt`
3544
3602
  display: contents;
3545
3603
  }
3546
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
+
3547
3635
  .error-content {
3548
3636
  display: none;
3549
3637
  }
@@ -3599,46 +3687,33 @@ const Sd="underline",Ad="outline",Ed="block",Md="frameless",Hd=mt`
3599
3687
  }
3600
3688
  `.withBehaviors(Tc(Sd,mt`
3601
3689
  .root {
3602
- --ni-private-bottom-border-width: 1px;
3690
+ border-bottom-width: ${_n};
3691
+ }
3692
+
3693
+ .control {
3694
+ height: var(--ni-private-height-within-border);
3603
3695
  padding-top: ${_n};
3604
3696
  padding-left: ${_n};
3605
3697
  padding-right: ${_n};
3606
3698
  }
3607
-
3608
- :host([disabled]) .root {
3609
- border-color: rgba(${pn}, 0.1);
3610
- }
3611
-
3612
- :host([disabled]) .root:hover {
3613
- --ni-private-bottom-border-width: 1px;
3614
- }
3615
3699
  `),Tc(Ed,mt`
3616
3700
  .root {
3617
3701
  background-color: rgba(${pn}, 0.1);
3618
- --ni-private-bottom-border-width: 0px;
3619
- padding-top: ${_n};
3620
- padding-left: ${_n};
3621
- padding-right: ${_n};
3622
- }
3623
-
3624
- .root:focus-within {
3625
- --ni-private-bottom-border-width: 1px;
3626
3702
  }
3627
3703
 
3628
- .root:focus-within:hover {
3629
- --ni-private-bottom-border-width: var(
3630
- --ni-private-hover-bottom-border-width
3631
- );
3704
+ .control {
3705
+ padding-left: ${_n};
3706
+ padding-right: ${_n};
3632
3707
  }
3633
3708
 
3709
+ .root:focus-within,
3634
3710
  :host(.invalid) .root {
3635
- --ni-private-bottom-border-width: 1px;
3711
+ border-bottom-width: ${_n};
3636
3712
  }
3637
3713
 
3638
- :host(.invalid) .root:hover {
3639
- --ni-private-bottom-border-width: var(
3640
- --ni-private-hover-bottom-border-width
3641
- );
3714
+ .root:focus-within .control,
3715
+ :host(.invalid) .control {
3716
+ height: calc(${yn} - ${_n});
3642
3717
  }
3643
3718
 
3644
3719
  :host([readonly]) .root {
@@ -3649,28 +3724,20 @@ const Sd="underline",Ad="outline",Ed="block",Md="frameless",Hd=mt`
3649
3724
  :host([disabled]) .root {
3650
3725
  background-color: rgba(${pn}, 0.07);
3651
3726
  }
3652
-
3653
- :host([disabled]) .root:hover {
3654
- --ni-private-bottom-border-width: 0px;
3655
- }
3656
-
3657
- :host(.invalid[disabled]) .root {
3658
- --ni-private-bottom-border-width: 1px;
3659
- }
3660
3727
  `),Tc(Ad,mt`
3661
3728
  .root {
3662
- --ni-private-bottom-border-width: 1px;
3663
3729
  border-width: ${_n};
3664
- border-bottom-width: var(--ni-private-bottom-border-width);
3730
+ }
3731
+
3732
+ .control {
3733
+ height: var(--ni-private-height-within-border);
3665
3734
  }
3666
3735
 
3667
3736
  :host(.invalid) .errortext {
3668
3737
  top: calc(${yn} - ${_n});
3669
3738
  }
3670
3739
  `),Tc(Md,mt`
3671
- .root {
3672
- --ni-private-bottom-border-width: 0px;
3673
- padding-top: ${_n};
3740
+ .control {
3674
3741
  padding-left: ${_n};
3675
3742
  padding-right: ${_n};
3676
3743
  }
@@ -3678,10 +3745,6 @@ const Sd="underline",Ad="outline",Ed="block",Md="frameless",Hd=mt`
3678
3745
  :host([readonly]) .root {
3679
3746
  border-color: transparent;
3680
3747
  }
3681
-
3682
- .root:hover {
3683
- --ni-private-bottom-border-width: 0px;
3684
- }
3685
3748
  `),Gr(mt`
3686
3749
  ${""}
3687
3750
  .control::-ms-reveal {