@ni/nimble-components 14.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.
@@ -11554,7 +11554,7 @@
11554
11554
  *
11555
11555
  * @public
11556
11556
  */
11557
- class Radio extends FormAssociatedRadio {
11557
+ class Radio$1 extends FormAssociatedRadio {
11558
11558
  constructor() {
11559
11559
  super();
11560
11560
  /**
@@ -11639,13 +11639,13 @@
11639
11639
  }
11640
11640
  __decorate$1([
11641
11641
  attr({ attribute: "readonly", mode: "boolean" })
11642
- ], Radio.prototype, "readOnly", void 0);
11642
+ ], Radio$1.prototype, "readOnly", void 0);
11643
11643
  __decorate$1([
11644
11644
  observable
11645
- ], Radio.prototype, "name", void 0);
11645
+ ], Radio$1.prototype, "name", void 0);
11646
11646
  __decorate$1([
11647
11647
  observable
11648
- ], Radio.prototype, "defaultSlottedNodes", void 0);
11648
+ ], Radio$1.prototype, "defaultSlottedNodes", void 0);
11649
11649
 
11650
11650
  /**
11651
11651
  * a method to filter out any whitespace _only_ nodes, to be used inside a template
@@ -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;
@@ -20262,16 +20259,16 @@
20262
20259
  /**
20263
20260
  * A nimble-styled radio button
20264
20261
  */
20265
- class RadioButton extends Radio {
20262
+ class Radio extends Radio$1 {
20266
20263
  }
20267
- const nimbleRadioButton = RadioButton.compose({
20268
- baseName: 'radio-button',
20269
- baseClass: Radio,
20264
+ const nimbleRadio = Radio.compose({
20265
+ baseName: 'radio',
20266
+ baseClass: Radio$1,
20270
20267
  template: radioTemplate,
20271
20268
  styles: styles$d,
20272
20269
  checkedIndicator: circleFilled16X16.data
20273
20270
  });
20274
- DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleRadioButton());
20271
+ DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleRadio());
20275
20272
 
20276
20273
  const styles$c = css `
20277
20274
  ${display('inline-block')}
@@ -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