@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.
@@ -18561,6 +18561,7 @@
18561
18561
  user-select: none;
18562
18562
  color: ${bodyFontColor};
18563
18563
  height: calc(${labelHeight} + ${controlHeight});
18564
+ --ni-private-hover-indicator-width: calc(${borderWidth} + 1px);
18564
18565
  }
18565
18566
 
18566
18567
  :host([disabled]) {
@@ -18568,32 +18569,71 @@
18568
18569
  cursor: default;
18569
18570
  }
18570
18571
 
18572
+ .label {
18573
+ display: flex;
18574
+ color: ${controlLabelFontColor};
18575
+ font: ${controlLabelFont};
18576
+ }
18577
+
18571
18578
  .root {
18572
18579
  box-sizing: border-box;
18573
18580
  position: relative;
18574
18581
  display: flex;
18575
18582
  flex-direction: row;
18583
+ justify-content: center;
18576
18584
  border-radius: 0px;
18577
18585
  border-bottom: ${borderWidth} solid rgba(${borderRgbPartialColor}, 0.3);
18578
- padding-bottom: 1px;
18579
- transition: border-bottom ${smallDelay}, padding-bottom ${smallDelay};
18586
+ gap: calc(${standardPadding} / 2);
18587
+ }
18588
+
18589
+ .root:focus-within {
18590
+ border-bottom-color: ${borderHoverColor};
18591
+ }
18592
+
18593
+ :host([disabled]) .root,
18594
+ :host([disabled]) .root:hover {
18595
+ border-bottom: ${borderWidth} solid ${bodyDisabledFontColor};
18596
+ }
18597
+
18598
+ .root::before {
18599
+ ${ /* Empty string causes alignment issue */''}
18600
+ content: ' ';
18601
+ color: transparent;
18602
+ width: 0px;
18603
+ user-select: none;
18604
+ }
18605
+
18606
+ .root::after {
18607
+ content: '';
18608
+ position: absolute;
18609
+ bottom: calc(-1 * ${borderWidth});
18610
+ width: 0px;
18611
+ height: 0px;
18612
+ border-bottom: ${borderHoverColor}
18613
+ var(--ni-private-hover-indicator-width) solid;
18614
+ transition: width ${smallDelay} ease-in;
18580
18615
  }
18581
18616
 
18582
18617
  @media (prefers-reduced-motion) {
18583
- .root {
18618
+ .root::after {
18584
18619
  transition-duration: 0s;
18585
18620
  }
18586
18621
  }
18587
18622
 
18588
- .root:hover {
18589
- border-bottom: 2px solid ${borderHoverColor};
18590
- padding-bottom: 0px;
18623
+ :host(.invalid) .root::after {
18624
+ border-bottom-color: ${failColor};
18591
18625
  }
18592
18626
 
18593
- :host([disabled]) .root,
18594
- :host([disabled]) .root:hover {
18595
- border-bottom: ${borderWidth} solid ${bodyDisabledFontColor};
18596
- padding-bottom: 1px;
18627
+ :host(:hover) .root::after {
18628
+ width: 100%;
18629
+ }
18630
+
18631
+ :host([disabled]:hover) .root::after {
18632
+ width: 0px;
18633
+ }
18634
+
18635
+ [part='start'] {
18636
+ display: contents;
18597
18637
  }
18598
18638
 
18599
18639
  .control {
@@ -18601,11 +18641,10 @@
18601
18641
  font: inherit;
18602
18642
  background: transparent;
18603
18643
  color: inherit;
18604
- height: 28px;
18644
+ height: calc(${controlHeight} - ${borderWidth});
18605
18645
  width: 100%;
18606
- margin-top: auto;
18607
- margin-bottom: auto;
18608
18646
  border: none;
18647
+ padding: 0px;
18609
18648
  }
18610
18649
 
18611
18650
  .control:hover,
@@ -18632,12 +18671,6 @@
18632
18671
  color: ${bodyDisabledFontColor};
18633
18672
  }
18634
18673
 
18635
- .label {
18636
- display: flex;
18637
- color: ${controlLabelFontColor};
18638
- font: ${controlLabelFont};
18639
- }
18640
-
18641
18674
  .controls {
18642
18675
  display: flex;
18643
18676
  flex-direction: column;
@@ -18696,36 +18729,66 @@
18696
18729
  font: ${bodyFont};
18697
18730
  height: ${controlHeight};
18698
18731
  position: relative;
18732
+ justify-content: center;
18699
18733
  user-select: none;
18700
18734
  min-width: 250px;
18701
18735
  outline: none;
18702
18736
  vertical-align: top;
18737
+ --ni-private-hover-indicator-width: 2px;
18738
+ --ni-private-focus-indicator-width: 1px;
18739
+ --ni-private-indicator-lines-gap: 1px;
18703
18740
  }
18704
18741
 
18705
- .listbox {
18706
- box-sizing: border-box;
18707
- display: inline-flex;
18708
- flex-direction: column;
18709
- left: 0;
18710
- overflow-y: auto;
18742
+ :host::before {
18743
+ content: '';
18711
18744
  position: absolute;
18745
+ bottom: calc(
18746
+ var(--ni-private-hover-indicator-width) +
18747
+ var(--ni-private-indicator-lines-gap)
18748
+ );
18749
+ width: 0px;
18750
+ height: 0px;
18751
+ justify-self: center;
18752
+ border-bottom: ${borderHoverColor}
18753
+ var(--ni-private-focus-indicator-width) solid;
18754
+ transition: width ${smallDelay} ease-in;
18755
+ }
18756
+
18757
+ @media (prefers-reduced-motion) {
18758
+ :host::before {
18759
+ transition-duration: 0s;
18760
+ }
18761
+ }
18762
+
18763
+ :host(${focusVisible})::before {
18712
18764
  width: 100%;
18713
- ${
18714
- /*
18715
- * The --max-height custom property is defined by fast-foundation.
18716
- * See: https://github.com/microsoft/fast/blob/af1f8736ae9ff54a7449324bad952865981d1ece/packages/web-components/fast-foundation/src/select/select.ts#L199
18717
- */ ''}
18718
- max-height: calc(var(--max-height) - ${controlHeight});
18719
- z-index: 1;
18720
- padding: 4px;
18721
- box-shadow: 0px 3px 3px ${popupBoxShadowColor};
18722
- border: 1px solid ${popupBorderColor};
18723
- background-color: ${applicationBackgroundColor};
18724
- background-clip: padding-box;
18725
18765
  }
18726
18766
 
18727
- .listbox[hidden] {
18728
- display: none;
18767
+ :host::after {
18768
+ content: '';
18769
+ position: absolute;
18770
+ bottom: 0px;
18771
+ width: 0px;
18772
+ height: 0px;
18773
+ justify-self: center;
18774
+ border-bottom: ${borderHoverColor}
18775
+ var(--ni-private-hover-indicator-width) solid;
18776
+ transition: width ${smallDelay} ease-in;
18777
+ }
18778
+
18779
+ @media (prefers-reduced-motion) {
18780
+ :host::after {
18781
+ transition-duration: 0s;
18782
+ }
18783
+ }
18784
+
18785
+ :host(:hover)::after,
18786
+ :host(${focusVisible})::after {
18787
+ width: 100%;
18788
+ }
18789
+
18790
+ :host([disabled]:hover)::after {
18791
+ width: 0px;
18729
18792
  }
18730
18793
 
18731
18794
  .control {
@@ -18746,23 +18809,40 @@
18746
18809
  }
18747
18810
 
18748
18811
  :host(.open:not(:hover)) .control {
18749
- border-bottom: ${borderWidth} solid ${borderHoverColor};
18750
- transition: border-bottom ${smallDelay}, padding-bottom ${smallDelay};
18751
- }
18752
-
18753
- :host(:hover) .control {
18754
- border-bottom: 2px solid ${borderHoverColor};
18755
- padding-bottom: 0px;
18756
- transition: border-bottom ${smallDelay}, padding-bottom ${smallDelay};
18812
+ border-bottom-color: ${borderHoverColor};
18757
18813
  }
18758
18814
 
18759
18815
  :host([disabled]) .control,
18760
18816
  :host([disabled]) .control:hover {
18761
- border-bottom: ${borderWidth} solid ${bodyDisabledFontColor};
18762
- padding-bottom: 1px;
18817
+ border-bottom-color: ${bodyDisabledFontColor};
18763
18818
  color: ${bodyDisabledFontColor};
18764
18819
  }
18765
18820
 
18821
+ .listbox {
18822
+ box-sizing: border-box;
18823
+ display: inline-flex;
18824
+ flex-direction: column;
18825
+ left: 0;
18826
+ overflow-y: auto;
18827
+ position: absolute;
18828
+ width: 100%;
18829
+ --ni-private-listbox-padding: ${smallPadding};
18830
+ max-height: calc(
18831
+ var(--ni-private-select-max-height) - 2 *
18832
+ var(--ni-private-listbox-padding)
18833
+ );
18834
+ z-index: 1;
18835
+ padding: var(--ni-private-listbox-padding);
18836
+ box-shadow: 0px 3px 3px ${popupBoxShadowColor};
18837
+ border: 1px solid ${popupBorderColor};
18838
+ background-color: ${applicationBackgroundColor};
18839
+ background-clip: padding-box;
18840
+ }
18841
+
18842
+ .listbox[hidden] {
18843
+ display: none;
18844
+ }
18845
+
18766
18846
  :host([open][position='above']) .listbox {
18767
18847
  border-bottom-left-radius: 0;
18768
18848
  border-bottom-right-radius: 0;
@@ -18841,6 +18921,7 @@
18841
18921
  return;
18842
18922
  }
18843
18923
  super.setPositioning();
18924
+ this.updateListboxMaxHeightCssVariable();
18844
18925
  }
18845
18926
  // Workaround for https://github.com/microsoft/fast/issues/5773
18846
18927
  slottedOptionsChanged(prev, next) {
@@ -18850,6 +18931,14 @@
18850
18931
  this.value = value;
18851
18932
  }
18852
18933
  }
18934
+ maxHeightChanged() {
18935
+ this.updateListboxMaxHeightCssVariable();
18936
+ }
18937
+ updateListboxMaxHeightCssVariable() {
18938
+ if (this.listbox) {
18939
+ this.listbox.style.setProperty('--ni-private-select-max-height', `${this.maxHeight}px`);
18940
+ }
18941
+ }
18853
18942
  }
18854
18943
  const nimbleSelect = Select.compose({
18855
18944
  baseName: 'select',
@@ -19464,6 +19553,10 @@
19464
19553
  --webkit-user-select: none;
19465
19554
  color: ${bodyFontColor};
19466
19555
  height: calc(${labelHeight} + ${controlHeight});
19556
+ --ni-private-hover-indicator-width: calc(${borderWidth} + 1px);
19557
+ --ni-private-height-within-border: calc(
19558
+ ${controlHeight} - 2 * ${borderWidth}
19559
+ );
19467
19560
  }
19468
19561
 
19469
19562
  :host([disabled]) {
@@ -19487,22 +19580,10 @@
19487
19580
  flex-direction: row;
19488
19581
  border-radius: 0px;
19489
19582
  font: inherit;
19490
- transition: border-bottom ${smallDelay}, padding-bottom ${smallDelay};
19491
19583
  align-items: center;
19492
- --ni-private-hover-bottom-border-width: 2px;
19584
+ justify-content: center;
19493
19585
  border: 0px solid rgba(${borderRgbPartialColor}, 0.3);
19494
- border-bottom-width: var(--ni-private-bottom-border-width);
19495
19586
  gap: calc(${standardPadding} / 2);
19496
- padding-bottom: calc(
19497
- var(--ni-private-hover-bottom-border-width) -
19498
- var(--ni-private-bottom-border-width)
19499
- );
19500
- }
19501
-
19502
- @media (prefers-reduced-motion) {
19503
- .root {
19504
- transition-duration: 0s;
19505
- }
19506
19587
  }
19507
19588
 
19508
19589
  :host(.invalid) .root {
@@ -19517,21 +19598,6 @@
19517
19598
  border-color: rgba(${borderRgbPartialColor}, 0.1);
19518
19599
  }
19519
19600
 
19520
- .root:hover {
19521
- --ni-private-bottom-border-width: var(
19522
- --ni-private-hover-bottom-border-width
19523
- );
19524
- border-bottom-color: ${borderHoverColor};
19525
- }
19526
-
19527
- :host([readonly]) .root:hover {
19528
- --ni-private-bottom-border-width: 1px;
19529
- }
19530
-
19531
- :host([disabled]) .root:hover {
19532
- --ni-private-bottom-border-width: 1px;
19533
- }
19534
-
19535
19601
  .root:focus-within {
19536
19602
  border-bottom-color: ${borderHoverColor};
19537
19603
  }
@@ -19579,10 +19645,7 @@
19579
19645
  background: transparent;
19580
19646
  color: inherit;
19581
19647
  padding: 0px;
19582
- height: calc(
19583
- ${controlHeight} - ${borderWidth} -
19584
- var(--ni-private-hover-bottom-border-width)
19585
- );
19648
+ height: ${controlHeight};
19586
19649
  width: 100%;
19587
19650
  margin-top: auto;
19588
19651
  margin-bottom: auto;
@@ -19626,6 +19689,36 @@
19626
19689
  display: contents;
19627
19690
  }
19628
19691
 
19692
+ [part='end']::after {
19693
+ content: '';
19694
+ position: absolute;
19695
+ bottom: calc(-1 * ${borderWidth});
19696
+ width: 0px;
19697
+ height: 0px;
19698
+ border-bottom: ${borderHoverColor}
19699
+ var(--ni-private-hover-indicator-width) solid;
19700
+ transition: width ${smallDelay} ease-in;
19701
+ }
19702
+
19703
+ @media (prefers-reduced-motion) {
19704
+ [part='end']::after {
19705
+ transition-duration: 0s;
19706
+ }
19707
+ }
19708
+
19709
+ :host(.invalid) [part='end']::after {
19710
+ border-bottom-color: ${failColor};
19711
+ }
19712
+
19713
+ :host(:hover) [part='end']::after {
19714
+ width: 100%;
19715
+ }
19716
+
19717
+ :host([disabled]:hover) [part='end']::after,
19718
+ :host([readonly]:hover) [part='end']::after {
19719
+ width: 0px;
19720
+ }
19721
+
19629
19722
  .error-content {
19630
19723
  display: none;
19631
19724
  }
@@ -19681,46 +19774,33 @@
19681
19774
  }
19682
19775
  `.withBehaviors(appearanceBehavior(TextFieldAppearance.underline, css `
19683
19776
  .root {
19684
- --ni-private-bottom-border-width: 1px;
19777
+ border-bottom-width: ${borderWidth};
19778
+ }
19779
+
19780
+ .control {
19781
+ height: var(--ni-private-height-within-border);
19685
19782
  padding-top: ${borderWidth};
19686
19783
  padding-left: ${borderWidth};
19687
19784
  padding-right: ${borderWidth};
19688
19785
  }
19689
-
19690
- :host([disabled]) .root {
19691
- border-color: rgba(${borderRgbPartialColor}, 0.1);
19692
- }
19693
-
19694
- :host([disabled]) .root:hover {
19695
- --ni-private-bottom-border-width: 1px;
19696
- }
19697
19786
  `), appearanceBehavior(TextFieldAppearance.block, css `
19698
19787
  .root {
19699
19788
  background-color: rgba(${borderRgbPartialColor}, 0.1);
19700
- --ni-private-bottom-border-width: 0px;
19701
- padding-top: ${borderWidth};
19702
- padding-left: ${borderWidth};
19703
- padding-right: ${borderWidth};
19704
19789
  }
19705
19790
 
19706
- .root:focus-within {
19707
- --ni-private-bottom-border-width: 1px;
19708
- }
19709
-
19710
- .root:focus-within:hover {
19711
- --ni-private-bottom-border-width: var(
19712
- --ni-private-hover-bottom-border-width
19713
- );
19791
+ .control {
19792
+ padding-left: ${borderWidth};
19793
+ padding-right: ${borderWidth};
19714
19794
  }
19715
19795
 
19796
+ .root:focus-within,
19716
19797
  :host(.invalid) .root {
19717
- --ni-private-bottom-border-width: 1px;
19798
+ border-bottom-width: ${borderWidth};
19718
19799
  }
19719
19800
 
19720
- :host(.invalid) .root:hover {
19721
- --ni-private-bottom-border-width: var(
19722
- --ni-private-hover-bottom-border-width
19723
- );
19801
+ .root:focus-within .control,
19802
+ :host(.invalid) .control {
19803
+ height: calc(${controlHeight} - ${borderWidth});
19724
19804
  }
19725
19805
 
19726
19806
  :host([readonly]) .root {
@@ -19731,28 +19811,20 @@
19731
19811
  :host([disabled]) .root {
19732
19812
  background-color: rgba(${borderRgbPartialColor}, 0.07);
19733
19813
  }
19734
-
19735
- :host([disabled]) .root:hover {
19736
- --ni-private-bottom-border-width: 0px;
19737
- }
19738
-
19739
- :host(.invalid[disabled]) .root {
19740
- --ni-private-bottom-border-width: 1px;
19741
- }
19742
19814
  `), appearanceBehavior(TextFieldAppearance.outline, css `
19743
19815
  .root {
19744
- --ni-private-bottom-border-width: 1px;
19745
19816
  border-width: ${borderWidth};
19746
- border-bottom-width: var(--ni-private-bottom-border-width);
19817
+ }
19818
+
19819
+ .control {
19820
+ height: var(--ni-private-height-within-border);
19747
19821
  }
19748
19822
 
19749
19823
  :host(.invalid) .errortext {
19750
19824
  top: calc(${controlHeight} - ${borderWidth});
19751
19825
  }
19752
19826
  `), appearanceBehavior(TextFieldAppearance.frameless, css `
19753
- .root {
19754
- --ni-private-bottom-border-width: 0px;
19755
- padding-top: ${borderWidth};
19827
+ .control {
19756
19828
  padding-left: ${borderWidth};
19757
19829
  padding-right: ${borderWidth};
19758
19830
  }
@@ -19760,10 +19832,6 @@
19760
19832
  :host([readonly]) .root {
19761
19833
  border-color: transparent;
19762
19834
  }
19763
-
19764
- .root:hover {
19765
- --ni-private-bottom-border-width: 0px;
19766
- }
19767
19835
  `), themeBehavior(css `
19768
19836
  ${'' /* Light theme */}
19769
19837
  .control::-ms-reveal {