@ni/nimble-components 15.0.0 → 15.1.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.
@@ -16793,6 +16793,10 @@
16793
16793
  width: calc(100% - 8px);
16794
16794
  }
16795
16795
 
16796
+ :host([error-visible]):before {
16797
+ border-bottom-color: ${failColor};
16798
+ }
16799
+
16796
16800
  :host::after {
16797
16801
  content: '';
16798
16802
  position: absolute;
@@ -16816,6 +16820,10 @@
16816
16820
  width: 100%;
16817
16821
  }
16818
16822
 
16823
+ :host([error-visible]):after {
16824
+ border-bottom-color: ${failColor};
16825
+ }
16826
+
16819
16827
  :host([disabled]:hover)::after {
16820
16828
  width: 0px;
16821
16829
  }
@@ -16842,6 +16850,12 @@
16842
16850
  border-color: rgba(${borderRgbPartialColor}, 0.1);
16843
16851
  }
16844
16852
 
16853
+ :host([error-visible]) .control,
16854
+ :host([error-visible][open]) .control,
16855
+ :host([error-visible][disabled]) .control {
16856
+ border-bottom-color: ${failColor};
16857
+ }
16858
+
16845
16859
  .listbox {
16846
16860
  box-sizing: border-box;
16847
16861
  display: inline-flex;
@@ -17022,10 +17036,6 @@
17022
17036
  color: ${bodyDisabledFontColor};
17023
17037
  }
17024
17038
 
17025
- :host([error-visible])::after {
17026
- border-bottom-color: ${failColor};
17027
- }
17028
-
17029
17039
  .control {
17030
17040
  bottom-border-width: var(--ni-private-bottom-border-width);
17031
17041
  }
@@ -17034,19 +17044,6 @@
17034
17044
  border-bottom-color: ${borderHoverColor};
17035
17045
  }
17036
17046
 
17037
- :host([error-visible]) .control {
17038
- border-bottom: var(--ni-private-bottom-border-width) solid ${failColor};
17039
- }
17040
-
17041
- :host([disabled]) .control {
17042
- border-color: rgba(${borderRgbPartialColor}, 0.1);
17043
- }
17044
-
17045
- :host([error-visible][disabled]) .control,
17046
- :host([error-visible][open]) .control {
17047
- border-bottom-color: ${failColor};
17048
- }
17049
-
17050
17047
  .selected-value {
17051
17048
  -webkit-appearance: none;
17052
17049
  background: transparent;
@@ -20317,7 +20314,32 @@
20317
20314
 
20318
20315
  const styles$b = css `
20319
20316
  ${styles$n}
20320
- `;
20317
+ ${styles$m}
20318
+
20319
+ ${
20320
+ /* We are using flex `order` to define the visual ordering of the selected value,
20321
+ error icon, and dropdown arrow because they are not "interactive" i.e. part of the tab order */ ''}
20322
+ [part='selected-value'] {
20323
+ order: 1;
20324
+ }
20325
+
20326
+ [part='indicator'] {
20327
+ order: 3;
20328
+ }
20329
+
20330
+ .error-icon {
20331
+ order: 2;
20332
+ }
20333
+
20334
+ .end {
20335
+ display: contents;
20336
+ }
20337
+ `.withBehaviors(appearanceBehavior(DropdownAppearance.block, css `
20338
+ :host([error-visible]) .control {
20339
+ border-bottom-width: ${borderWidth};
20340
+ padding-bottom: 0;
20341
+ }
20342
+ `));
20321
20343
 
20322
20344
  /**
20323
20345
  * A nimble-styled HTML select
@@ -20326,6 +20348,7 @@
20326
20348
  constructor() {
20327
20349
  super(...arguments);
20328
20350
  this.appearance = DropdownAppearance.underline;
20351
+ this.errorVisible = false;
20329
20352
  }
20330
20353
  // Workaround for https://github.com/microsoft/fast/issues/5123
20331
20354
  setPositioning() {
@@ -20357,12 +20380,25 @@
20357
20380
  __decorate([
20358
20381
  attr
20359
20382
  ], Select.prototype, "appearance", void 0);
20383
+ __decorate([
20384
+ attr({ attribute: 'error-text' })
20385
+ ], Select.prototype, "errorText", void 0);
20386
+ __decorate([
20387
+ attr({ attribute: 'error-visible', mode: 'boolean' })
20388
+ ], Select.prototype, "errorVisible", void 0);
20360
20389
  const nimbleSelect = Select.compose({
20361
20390
  baseName: 'select',
20362
20391
  baseClass: Select$1,
20363
20392
  template: selectTemplate,
20364
20393
  styles: styles$b,
20365
- indicator: arrowExpanderDown16X16.data
20394
+ indicator: arrowExpanderDown16X16.data,
20395
+ end: html `
20396
+ <${DesignSystem.tagFor(IconExclamationMark)}
20397
+ severity="error"
20398
+ class="error-icon"
20399
+ ></${DesignSystem.tagFor(IconExclamationMark)}>
20400
+ ${errorTextTemplate}
20401
+ `
20366
20402
  });
20367
20403
  DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleSelect());
20368
20404