@ni/nimble-components 18.8.4 → 18.9.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.
@@ -2979,17 +2979,13 @@ const Dp=no.tagFor(Lp),zp="underline",Bp="outline",Np="block",Zp=ft`
2979
2979
  color: ${Ur};
2980
2980
  width: 100%;
2981
2981
  position: absolute;
2982
- top: ${ta};
2982
+ bottom: calc(-1 * ${uc});
2983
2983
  left: 0px;
2984
2984
  overflow: hidden;
2985
2985
  text-overflow: ellipsis;
2986
2986
  white-space: nowrap;
2987
2987
  }
2988
2988
 
2989
- :host([error-visible][readonly]:not([disabled])) .error-text {
2990
- top: calc(${ta} - ${na});
2991
- }
2992
-
2993
2989
  :host([error-visible]) .error-text:empty {
2994
2990
  display: none;
2995
2991
  }
@@ -5752,6 +5748,7 @@ class kw extends _e{}const Sw=kw.compose({baseName:"tabs-toolbar",template:Cw,st
5752
5748
  no.getOrCreate().withPrefix("nimble").register(Sw()),no.tagFor(kw)
5753
5749
  const _w="outline",Iw="block",Mw=ft`
5754
5750
  ${bn("inline-flex")}
5751
+ ${qp}
5755
5752
 
5756
5753
  :host {
5757
5754
  font: ${yl};
@@ -5760,6 +5757,7 @@ const _w="outline",Iw="block",Mw=ft`
5760
5757
  color: ${xl};
5761
5758
  flex-direction: column;
5762
5759
  vertical-align: top;
5760
+ --ni-private-hover-indicator-width: calc(${na} + 1px);
5763
5761
  }
5764
5762
 
5765
5763
  :host([disabled]) {
@@ -5776,10 +5774,47 @@ const _w="outline",Iw="block",Mw=ft`
5776
5774
  color: ${Ll};
5777
5775
  }
5778
5776
 
5777
+ .container {
5778
+ display: flex;
5779
+ justify-content: center;
5780
+ position: relative;
5781
+ height: 100%;
5782
+ width: 100%;
5783
+ }
5784
+
5785
+ .container::after {
5786
+ content: ' ';
5787
+ position: absolute;
5788
+ bottom: calc(-1 * ${na});
5789
+ width: 0px;
5790
+ height: 0px;
5791
+ border-bottom: ${Kr}
5792
+ var(--ni-private-hover-indicator-width) solid;
5793
+ transition: width ${Cc} ease-in;
5794
+ }
5795
+
5796
+ @media (prefers-reduced-motion) {
5797
+ .container::after {
5798
+ transition-duration: 0s;
5799
+ }
5800
+ }
5801
+
5802
+ :host([error-visible]) .container::after {
5803
+ border-bottom-color: ${Ur};
5804
+ }
5805
+
5806
+ :host(:hover) .container::after {
5807
+ width: 100%;
5808
+ }
5809
+
5810
+ :host([disabled]:hover) .container::after,
5811
+ :host([readonly]:hover) .container::after {
5812
+ width: 0px;
5813
+ }
5814
+
5779
5815
  .control {
5780
5816
  -webkit-appearance: none;
5781
5817
  font: inherit;
5782
- width: 100%;
5783
5818
  flex-grow: 1;
5784
5819
  outline: none;
5785
5820
  box-sizing: border-box;
@@ -5788,8 +5823,12 @@ const _w="outline",Iw="block",Mw=ft`
5788
5823
  border-radius: 0px;
5789
5824
  align-items: flex-end;
5790
5825
  border: ${na} solid transparent;
5826
+ min-width: 100px;
5827
+ min-height: calc(${sa} + ${oa});
5791
5828
  padding: 8px;
5792
- transition: box-shadow ${Cc}, border ${Cc};
5829
+ ${""}
5830
+ padding-right: calc(${sa});
5831
+ margin: 0px;
5793
5832
  resize: none;
5794
5833
  }
5795
5834
 
@@ -5799,13 +5838,8 @@ const _w="outline",Iw="block",Mw=ft`
5799
5838
  }
5800
5839
  }
5801
5840
 
5802
- .control:hover {
5803
- border-color: ${Kr};
5804
- box-shadow: 0px 0px 0px 1px ${Kr};
5805
- }
5806
-
5807
5841
  .control:focus-within {
5808
- border-color: ${Kr};
5842
+ border-bottom-color: ${Kr};
5809
5843
  }
5810
5844
 
5811
5845
  .control[readonly],
@@ -5814,23 +5848,22 @@ const _w="outline",Iw="block",Mw=ft`
5814
5848
  .control[disabled],
5815
5849
  .control[disabled]:hover {
5816
5850
  border-color: rgba(${jr}, 0.1);
5817
- box-shadow: none;
5818
5851
  }
5819
5852
 
5820
- .control::placeholder {
5821
- color: ${Tl};
5853
+ :host([error-visible]) .control {
5854
+ border-bottom-color: ${Ur};
5822
5855
  }
5823
5856
 
5824
- .control[disabled]::placeholder {
5825
- color: ${Ll};
5857
+ :host([error-visible]) .control[readonly]:hover:focus-within {
5858
+ border-bottom-color: ${Ur};
5826
5859
  }
5827
5860
 
5828
- :host([cols]) .control {
5829
- width: auto;
5861
+ .control::placeholder {
5862
+ color: ${Tl};
5830
5863
  }
5831
5864
 
5832
- :host([rows]) .control {
5833
- flex: none;
5865
+ .control[disabled]::placeholder {
5866
+ color: ${Ll};
5834
5867
  }
5835
5868
 
5836
5869
  :host([resize='both']) .control {
@@ -5842,6 +5875,17 @@ const _w="outline",Iw="block",Mw=ft`
5842
5875
  :host([resize='vertical']) .control {
5843
5876
  resize: vertical;
5844
5877
  }
5878
+
5879
+ :host([error-visible]) .error-icon {
5880
+ display: none;
5881
+ }
5882
+
5883
+ :host([error-visible]) .error-icon.scrollbar-width-calculated {
5884
+ display: inline-flex;
5885
+ position: absolute;
5886
+ top: calc(${oa} / 2);
5887
+ right: var(--ni-private-scrollbar-width);
5888
+ }
5845
5889
  `.withBehaviors(Dc(_w,ft`
5846
5890
  .control {
5847
5891
  border-color: rgba(${jr}, 0.3);
@@ -5860,21 +5904,21 @@ const _w="outline",Iw="block",Mw=ft`
5860
5904
  border-color: transparent;
5861
5905
  background-color: rgba(${jr}, 0.1);
5862
5906
  }
5907
+
5908
+ :host([error-visible][disabled]) .control {
5909
+ border-bottom-color: ${Ur};
5910
+ }
5863
5911
  `))
5864
- class Rw extends Xo{constructor(){super(...arguments),this.appearance=_w}}t([nt],Rw.prototype,"appearance",void 0)
5865
- const Aw=Rw.compose({baseName:"text-area",baseClass:Xo,template:(t,e)=>G`
5866
- <template
5867
- class="
5868
- ${t=>t.readOnly?"readonly":""}
5869
- ${t=>t.resize!==Wo?`resize-${t.resize}`:""}"
5912
+ class Rw extends Xo{constructor(){super(...arguments),this.appearance=_w,this.errorVisible=!1,this.scrollbarWidth=-1,this.updateScrollbarWidthQueued=!1}connectedCallback(){super.connectedCallback(),this.resizeObserver=new ResizeObserver((()=>this.onResize())),this.resizeObserver.observe(this)}disconnectedCallback(){this.resizeObserver?.disconnect()}onTextAreaInput(){this.handleTextInput(),this.queueUpdateScrollbarWidth()}placeholderChanged(){this.queueUpdateScrollbarWidth()}valueChanged(t,e){super.valueChanged(t,e),this.queueUpdateScrollbarWidth()}onResize(){this.scrollbarWidth=this.control.offsetWidth-this.control.clientWidth}queueUpdateScrollbarWidth(){this.$fastController.isConnected&&(this.updateScrollbarWidthQueued||(this.updateScrollbarWidthQueued=!0,u.queueUpdate((()=>this.updateScrollbarWidth()))))}updateScrollbarWidth(){this.updateScrollbarWidthQueued=!1,this.scrollbarWidth=this.control.offsetWidth-this.control.clientWidth}}t([nt],Rw.prototype,"appearance",void 0),t([nt({attribute:"error-text"})],Rw.prototype,"errorText",void 0),t([nt({attribute:"error-visible",mode:"boolean"})],Rw.prototype,"errorVisible",void 0),t([f],Rw.prototype,"scrollbarWidth",void 0)
5913
+ const Aw=Rw.compose({baseName:"text-area",baseClass:Xo,template:()=>G`
5914
+ <label
5915
+ part="label"
5916
+ for="control"
5917
+ class="${t=>t.defaultSlottedNodes?.length?"label":"label label__hidden"}"
5870
5918
  >
5871
- <label
5872
- part="label"
5873
- for="control"
5874
- class="${t=>t.defaultSlottedNodes&&t.defaultSlottedNodes.length?"label":"label label__hidden"}"
5875
- >
5876
- <slot ${Tt("defaultSlottedNodes")}></slot>
5877
- </label>
5919
+ <slot ${Tt("defaultSlottedNodes")}></slot>
5920
+ </label>
5921
+ <div class="container">
5878
5922
  <textarea
5879
5923
  part="control"
5880
5924
  class="control"
@@ -5912,11 +5956,17 @@ const Aw=Rw.compose({baseName:"text-area",baseClass:Xo,template:(t,e)=>G`
5912
5956
  aria-owns="${t=>t.ariaOwns}"
5913
5957
  aria-relevant="${t=>t.ariaRelevant}"
5914
5958
  aria-roledescription="${t=>t.ariaRoledescription}"
5915
- @input="${(t,e)=>t.handleTextInput()}"
5959
+ @input="${t=>t.onTextAreaInput()}"
5916
5960
  @change="${t=>t.handleChange()}"
5917
5961
  ${_t("control")}
5918
5962
  ></textarea>
5919
- </template>
5963
+ <${dp}
5964
+ severity="error"
5965
+ class="error-icon ${t=>t.scrollbarWidth>=0?"scrollbar-width-calculated":""}"
5966
+ style="--ni-private-scrollbar-width: ${t=>t.scrollbarWidth}px;"
5967
+ ></${dp}>
5968
+ ${Tp}
5969
+ </div>
5920
5970
  `,styles:Mw,shadowOptions:{delegatesFocus:!0}})
5921
5971
  no.getOrCreate().withPrefix("nimble").register(Aw()),no.tagFor(Rw)
5922
5972
  const Ow="underline",Ew="outline",Fw="block",Vw="frameless",Hw=ft`