@ni/nimble-components 18.8.3 → 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.
@@ -13821,69 +13821,6 @@
13821
13821
  ], TextArea$1.prototype, "defaultSlottedNodes", void 0);
13822
13822
  applyMixins(TextArea$1, DelegatesARIATextbox);
13823
13823
 
13824
- /**
13825
- * The template for the {@link @microsoft/fast-foundation#(TextArea:class)} component.
13826
- * @public
13827
- */
13828
- const textAreaTemplate = (context, definition) => html `
13829
- <template
13830
- class="
13831
- ${x => (x.readOnly ? "readonly" : "")}
13832
- ${x => (x.resize !== TextAreaResize.none ? `resize-${x.resize}` : "")}"
13833
- >
13834
- <label
13835
- part="label"
13836
- for="control"
13837
- class="${x => x.defaultSlottedNodes && x.defaultSlottedNodes.length
13838
- ? "label"
13839
- : "label label__hidden"}"
13840
- >
13841
- <slot ${slotted("defaultSlottedNodes")}></slot>
13842
- </label>
13843
- <textarea
13844
- part="control"
13845
- class="control"
13846
- id="control"
13847
- ?autofocus="${x => x.autofocus}"
13848
- cols="${x => x.cols}"
13849
- ?disabled="${x => x.disabled}"
13850
- form="${x => x.form}"
13851
- list="${x => x.list}"
13852
- maxlength="${x => x.maxlength}"
13853
- minlength="${x => x.minlength}"
13854
- name="${x => x.name}"
13855
- placeholder="${x => x.placeholder}"
13856
- ?readonly="${x => x.readOnly}"
13857
- ?required="${x => x.required}"
13858
- rows="${x => x.rows}"
13859
- ?spellcheck="${x => x.spellcheck}"
13860
- :value="${x => x.value}"
13861
- aria-atomic="${x => x.ariaAtomic}"
13862
- aria-busy="${x => x.ariaBusy}"
13863
- aria-controls="${x => x.ariaControls}"
13864
- aria-current="${x => x.ariaCurrent}"
13865
- aria-describedby="${x => x.ariaDescribedby}"
13866
- aria-details="${x => x.ariaDetails}"
13867
- aria-disabled="${x => x.ariaDisabled}"
13868
- aria-errormessage="${x => x.ariaErrormessage}"
13869
- aria-flowto="${x => x.ariaFlowto}"
13870
- aria-haspopup="${x => x.ariaHaspopup}"
13871
- aria-hidden="${x => x.ariaHidden}"
13872
- aria-invalid="${x => x.ariaInvalid}"
13873
- aria-keyshortcuts="${x => x.ariaKeyshortcuts}"
13874
- aria-label="${x => x.ariaLabel}"
13875
- aria-labelledby="${x => x.ariaLabelledby}"
13876
- aria-live="${x => x.ariaLive}"
13877
- aria-owns="${x => x.ariaOwns}"
13878
- aria-relevant="${x => x.ariaRelevant}"
13879
- aria-roledescription="${x => x.ariaRoledescription}"
13880
- @input="${(x, c) => x.handleTextInput()}"
13881
- @change="${x => x.handleChange()}"
13882
- ${ref("control")}
13883
- ></textarea>
13884
- </template>
13885
- `;
13886
-
13887
13824
  /**
13888
13825
  * The template for the {@link @microsoft/fast-foundation#(TextField:class)} component.
13889
13826
  * @public
@@ -16807,7 +16744,7 @@
16807
16744
  return `${prefix}${uniqueIdCounter++}`;
16808
16745
  }
16809
16746
 
16810
- const template$l = html `<slot></slot>`;
16747
+ const template$m = html `<slot></slot>`;
16811
16748
 
16812
16749
  const styles$K = css `
16813
16750
  :host {
@@ -16866,7 +16803,7 @@
16866
16803
  const nimbleDesignSystemProvider = ThemeProvider.compose({
16867
16804
  baseName: 'theme-provider',
16868
16805
  styles: styles$K,
16869
- template: template$l
16806
+ template: template$m
16870
16807
  });
16871
16808
  DesignSystem.getOrCreate()
16872
16809
  .withPrefix('nimble')
@@ -17133,7 +17070,7 @@
17133
17070
  `;
17134
17071
 
17135
17072
  // prettier-ignore
17136
- const template$k = (context, definition) => html `
17073
+ const template$l = (context, definition) => html `
17137
17074
  <a
17138
17075
  class="control"
17139
17076
  part="control"
@@ -17206,7 +17143,7 @@
17206
17143
  const nimbleAnchor = Anchor.compose({
17207
17144
  baseName: 'anchor',
17208
17145
  baseClass: Anchor$1,
17209
- template: template$k,
17146
+ template: template$l,
17210
17147
  styles: styles$J,
17211
17148
  shadowOptions: {
17212
17149
  delegatesFocus: true
@@ -17583,7 +17520,7 @@
17583
17520
  }
17584
17521
  `;
17585
17522
 
17586
- const template$j = (context, definition) => html `
17523
+ const template$k = (context, definition) => html `
17587
17524
  <a
17588
17525
  class="control"
17589
17526
  part="control"
@@ -17665,7 +17602,7 @@
17665
17602
  ], AnchorButton.prototype, "disabled", void 0);
17666
17603
  const nimbleAnchorButton = AnchorButton.compose({
17667
17604
  baseName: 'anchor-button',
17668
- template: template$j,
17605
+ template: template$k,
17669
17606
  styles: styles$H,
17670
17607
  shadowOptions: {
17671
17608
  delegatesFocus: true
@@ -17751,13 +17688,15 @@
17751
17688
  }
17752
17689
  `;
17753
17690
 
17754
- const template$i = (context, definition) => html `
17691
+ const template$j = (context, definition) => html `
17755
17692
  <template
17756
17693
  role="menuitem"
17757
17694
  class="${x => (typeof x.startColumnCount === 'number'
17758
17695
  ? `indent-${x.startColumnCount}`
17759
17696
  : '')}"
17760
17697
  aria-disabled="${x => x.disabled}"
17698
+ @click="${(x, c) => x.clickHandler(c.event)}"
17699
+ @keydown="${(x, c) => x.keydownHandler(c.event)}"
17761
17700
  >
17762
17701
  <a
17763
17702
  ${ref('anchor')}
@@ -17769,8 +17708,6 @@
17769
17708
  rel="${x => x.rel}"
17770
17709
  target="${x => x.target}"
17771
17710
  type="${x => x.type}"
17772
- @click="${(x, c) => x.clickHandler(c.event)}"
17773
- @keydown="${(x, c) => x.keydownHandler(c.event)}"
17774
17711
  >
17775
17712
  ${startSlotTemplate(context, definition)}
17776
17713
  <span class="content" part="content">
@@ -17804,7 +17741,7 @@
17804
17741
  * @internal
17805
17742
  */
17806
17743
  clickHandler(e) {
17807
- e.stopImmediatePropagation();
17744
+ e.stopPropagation();
17808
17745
  return true;
17809
17746
  }
17810
17747
  /**
@@ -17816,7 +17753,7 @@
17816
17753
  }
17817
17754
  switch (e.key) {
17818
17755
  case keyEnter:
17819
- e.stopImmediatePropagation();
17756
+ e.stopPropagation();
17820
17757
  break;
17821
17758
  }
17822
17759
  return true;
@@ -17856,7 +17793,7 @@
17856
17793
  ], AnchorMenuItem.prototype, "startColumnCount", void 0);
17857
17794
  const nimbleAnchorMenuItem = AnchorMenuItem.compose({
17858
17795
  baseName: 'anchor-menu-item',
17859
- template: template$i,
17796
+ template: template$j,
17860
17797
  styles: styles$G,
17861
17798
  shadowOptions: {
17862
17799
  delegatesFocus: true
@@ -17999,7 +17936,7 @@
17999
17936
  }
18000
17937
  `;
18001
17938
 
18002
- const template$h = () => html `
17939
+ const template$i = () => html `
18003
17940
  <template slot="anchortab" role="tab" aria-disabled="${x => x.disabled}">
18004
17941
  <a
18005
17942
  download="${x => x.download}"
@@ -18037,7 +17974,7 @@
18037
17974
  ], AnchorTab.prototype, "disabled", void 0);
18038
17975
  const nimbleAnchorTab = AnchorTab.compose({
18039
17976
  baseName: 'anchor-tab',
18040
- template: template$h,
17977
+ template: template$i,
18041
17978
  styles: styles$E
18042
17979
  });
18043
17980
  DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleAnchorTab());
@@ -18061,7 +17998,7 @@
18061
17998
  }
18062
17999
  `;
18063
18000
 
18064
- const template$g = (context, definition) => html `
18001
+ const template$h = (context, definition) => html `
18065
18002
  ${startSlotTemplate(context, definition)}
18066
18003
  <div ${ref('tablist')} class="tablist" part="tablist" role="tablist">
18067
18004
  <slot name="anchortab" ${slotted('tabs')}></slot>
@@ -18258,7 +18195,7 @@
18258
18195
  applyMixins(AnchorTabs, StartEnd);
18259
18196
  const nimbleAnchorTabs = AnchorTabs.compose({
18260
18197
  baseName: 'anchor-tabs',
18261
- template: template$g,
18198
+ template: template$h,
18262
18199
  styles: styles$D,
18263
18200
  shadowOptions: {
18264
18201
  delegatesFocus: false
@@ -19198,7 +19135,7 @@
19198
19135
  data: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path class="cls-1" d="M8.033 14.026 4.9 10.866 6.277 9.53l1.744 1.81 4.562-4.507 1.307 1.363Zm1.155-10.68-1.321-1.32-2.312 2.311-2.311-2.311-1.321 1.32 2.311 2.312L1.923 7.97l1.32 1.32 2.312-2.31 2.312 2.31 1.32-1.32-2.31-2.312Z"/></svg>`
19199
19136
  };
19200
19137
 
19201
- const template$f = html `
19138
+ const template$g = html `
19202
19139
  <template>
19203
19140
  <div class="icon" :innerHTML=${x => x.icon.data}></div>
19204
19141
  </template
@@ -19257,7 +19194,7 @@
19257
19194
  const registerIcon = (baseName, iconClass) => {
19258
19195
  const composedIcon = iconClass.compose({
19259
19196
  baseName,
19260
- template: template$f,
19197
+ template: template$g,
19261
19198
  styles: styles$z,
19262
19199
  baseClass: iconClass
19263
19200
  });
@@ -19324,7 +19261,7 @@
19324
19261
  };
19325
19262
 
19326
19263
  // prettier-ignore
19327
- const template$e = html `
19264
+ const template$f = html `
19328
19265
  <div class="container"
19329
19266
  role="status"
19330
19267
  aria-atomic="${x => x.ariaAtomic}"
@@ -19443,7 +19380,7 @@
19443
19380
  applyMixins(Banner, ARIAGlobalStatesAndProperties);
19444
19381
  const nimbleBanner = Banner.compose({
19445
19382
  baseName: 'banner',
19446
- template: template$e,
19383
+ template: template$f,
19447
19384
  styles: styles$B
19448
19385
  });
19449
19386
  DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleBanner());
@@ -19898,7 +19835,7 @@
19898
19835
  }
19899
19836
  `;
19900
19837
 
19901
- const template$d = (context, definition) => html `
19838
+ const template$e = (context, definition) => html `
19902
19839
  <div
19903
19840
  role="button"
19904
19841
  part="control"
@@ -19973,7 +19910,7 @@
19973
19910
  applyMixins(ToggleButton, StartEnd, DelegatesARIAButton);
19974
19911
  const nimbleToggleButton = ToggleButton.compose({
19975
19912
  baseName: 'toggle-button',
19976
- template: template$d,
19913
+ template: template$e,
19977
19914
  styles: styles$u,
19978
19915
  shadowOptions: {
19979
19916
  delegatesFocus: true
@@ -20264,17 +20201,13 @@
20264
20201
  color: ${failColor};
20265
20202
  width: 100%;
20266
20203
  position: absolute;
20267
- top: ${controlHeight};
20204
+ bottom: calc(-1 * ${errorTextFontLineHeight});
20268
20205
  left: 0px;
20269
20206
  overflow: hidden;
20270
20207
  text-overflow: ellipsis;
20271
20208
  white-space: nowrap;
20272
20209
  }
20273
20210
 
20274
- :host([error-visible][readonly]:not([disabled])) .error-text {
20275
- top: calc(${controlHeight} - ${borderWidth});
20276
- }
20277
-
20278
20211
  :host([error-visible]) .error-text:empty {
20279
20212
  display: none;
20280
20213
  }
@@ -20679,7 +20612,7 @@
20679
20612
  }
20680
20613
  `));
20681
20614
 
20682
- const template$c = html `
20615
+ const template$d = html `
20683
20616
  <template>
20684
20617
  <dialog
20685
20618
  ${ref('dialogElement')}
@@ -20805,7 +20738,7 @@
20805
20738
  applyMixins(Dialog, ARIAGlobalStatesAndProperties);
20806
20739
  const nimbleDialog = Dialog.compose({
20807
20740
  baseName: 'dialog',
20808
- template: template$c,
20741
+ template: template$d,
20809
20742
  styles: styles$q,
20810
20743
  baseClass: Dialog
20811
20744
  });
@@ -20965,7 +20898,7 @@
20965
20898
  }
20966
20899
  `));
20967
20900
 
20968
- const template$b = html `
20901
+ const template$c = html `
20969
20902
  <dialog
20970
20903
  ${ref('dialog')}
20971
20904
  aria-label="${x => x.ariaLabel}"
@@ -21079,7 +21012,7 @@
21079
21012
  applyMixins(Drawer, ARIAGlobalStatesAndProperties);
21080
21013
  const nimbleDrawer = Drawer.compose({
21081
21014
  baseName: 'drawer',
21082
- template: template$b,
21015
+ template: template$c,
21083
21016
  styles: styles$p
21084
21017
  });
21085
21018
  DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleDrawer());
@@ -23037,7 +22970,7 @@
23037
22970
  `;
23038
22971
 
23039
22972
  // prettier-ignore
23040
- const template$a = html `
22973
+ const template$b = html `
23041
22974
  <template
23042
22975
  ?open="${x => x.open}"
23043
22976
  @focusout="${(x, c) => x.focusoutHandler(c.event)}"
@@ -23292,7 +23225,7 @@
23292
23225
  ], MenuButton.prototype, "slottedMenus", void 0);
23293
23226
  const nimbleMenuButton = MenuButton.compose({
23294
23227
  baseName: 'menu-button',
23295
- template: template$a,
23228
+ template: template$b,
23296
23229
  styles: styles$m,
23297
23230
  shadowOptions: {
23298
23231
  delegatesFocus: true
@@ -24056,7 +23989,7 @@
24056
23989
  }
24057
23990
  `));
24058
23991
 
24059
- const template$9 = html `
23992
+ const template$a = html `
24060
23993
  <template role="progressbar">
24061
23994
  <div class="container">
24062
23995
  <div class="bit1"></div>
@@ -24073,7 +24006,7 @@
24073
24006
  }
24074
24007
  const nimbleSpinner = Spinner.compose({
24075
24008
  baseName: 'spinner',
24076
- template: template$9,
24009
+ template: template$a,
24077
24010
  styles: styles$g
24078
24011
  });
24079
24012
  DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleSpinner());
@@ -24242,7 +24175,7 @@
24242
24175
  `));
24243
24176
 
24244
24177
  // prettier-ignore
24245
- const template$8 = html `
24178
+ const template$9 = html `
24246
24179
  <template
24247
24180
  role="switch"
24248
24181
  aria-checked="${x => x.checked}"
@@ -24286,7 +24219,7 @@
24286
24219
  const nimbleSwitch = Switch.compose({
24287
24220
  baseClass: Switch$1,
24288
24221
  baseName: 'switch',
24289
- template: template$8,
24222
+ template: template$9,
24290
24223
  styles: styles$f
24291
24224
  });
24292
24225
  DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleSwitch());
@@ -27688,7 +27621,7 @@
27688
27621
  `;
27689
27622
 
27690
27623
  // prettier-ignore
27691
- const template$7 = html `
27624
+ const template$8 = html `
27692
27625
  <template role="columnheader" aria-sort="${x => x.ariaSort}">
27693
27626
  <slot></slot>
27694
27627
 
@@ -27738,7 +27671,7 @@
27738
27671
  ], TableHeader.prototype, "firstSortedColumn", void 0);
27739
27672
  const nimbleTableHeader = TableHeader.compose({
27740
27673
  baseName: 'table-header',
27741
- template: template$7,
27674
+ template: template$8,
27742
27675
  styles: styles$c
27743
27676
  });
27744
27677
  DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleTableHeader());
@@ -27794,7 +27727,7 @@
27794
27727
  `;
27795
27728
 
27796
27729
  // prettier-ignore
27797
- const template$6 = html `
27730
+ const template$7 = html `
27798
27731
  <template role="cell">
27799
27732
  <div ${ref('cellContentContainer')} class="cell-content-container"></div>
27800
27733
 
@@ -27880,14 +27813,14 @@
27880
27813
  ], TableCell.prototype, "actionMenuLabel", void 0);
27881
27814
  const nimbleTableCell = TableCell.compose({
27882
27815
  baseName: 'table-cell',
27883
- template: template$6,
27816
+ template: template$7,
27884
27817
  styles: styles$a
27885
27818
  });
27886
27819
  DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleTableCell());
27887
27820
  const tableCellTag = DesignSystem.tagFor(TableCell);
27888
27821
 
27889
27822
  // prettier-ignore
27890
- const template$5 = html `
27823
+ const template$6 = html `
27891
27824
  <template role="row">
27892
27825
  ${repeat(x => x.columnStates, html `
27893
27826
  ${when(x => !x.column.columnHidden, html `
@@ -27987,14 +27920,14 @@
27987
27920
  ], TableRow.prototype, "columnStates", null);
27988
27921
  const nimbleTableRow = TableRow.compose({
27989
27922
  baseName: 'table-row',
27990
- template: template$5,
27923
+ template: template$6,
27991
27924
  styles: styles$b
27992
27925
  });
27993
27926
  DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleTableRow());
27994
27927
  const tableRowTag = DesignSystem.tagFor(TableRow);
27995
27928
 
27996
27929
  // prettier-ignore
27997
- const template$4 = html `
27930
+ const template$5 = html `
27998
27931
  <template role="table" ${children$1({ property: 'childItems', filter: elements() })}>
27999
27932
  <div class="table-container" style="
28000
27933
  --ni-private-table-scroll-x: -${x => x.scrollX}px;
@@ -29213,7 +29146,7 @@
29213
29146
  ], Table.prototype, "firstSortedColumn", void 0);
29214
29147
  const nimbleTable = Table.compose({
29215
29148
  baseName: 'table',
29216
- template: template$4,
29149
+ template: template$5,
29217
29150
  styles: styles$d
29218
29151
  });
29219
29152
  DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleTable());
@@ -29231,7 +29164,7 @@
29231
29164
  }
29232
29165
  `;
29233
29166
 
29234
- const template$3 = html `
29167
+ const template$4 = html `
29235
29168
  <template>
29236
29169
  <span class="header-content">
29237
29170
  <slot></slot>
@@ -29347,7 +29280,7 @@
29347
29280
  }
29348
29281
  const nimbleTableColumnText = TableColumnText.compose({
29349
29282
  baseName: 'table-column-text',
29350
- template: template$3,
29283
+ template: template$4,
29351
29284
  styles: styles$9
29352
29285
  });
29353
29286
  DesignSystem.getOrCreate()
@@ -29419,7 +29352,7 @@
29419
29352
  }
29420
29353
  `;
29421
29354
 
29422
- const template$2 = html `
29355
+ const template$3 = html `
29423
29356
  <template slot="end">
29424
29357
  <div class="separator"></div>
29425
29358
  <slot></slot>
@@ -29433,7 +29366,7 @@
29433
29366
  }
29434
29367
  const nimbleTabsToolbar = TabsToolbar.compose({
29435
29368
  baseName: 'tabs-toolbar',
29436
- template: template$2,
29369
+ template: template$3,
29437
29370
  styles: styles$7
29438
29371
  });
29439
29372
  DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleTabsToolbar());
@@ -29446,6 +29379,7 @@
29446
29379
 
29447
29380
  const styles$6 = css `
29448
29381
  ${display('inline-flex')}
29382
+ ${styles$s}
29449
29383
 
29450
29384
  :host {
29451
29385
  font: ${bodyFont};
@@ -29454,6 +29388,7 @@
29454
29388
  color: ${bodyFontColor};
29455
29389
  flex-direction: column;
29456
29390
  vertical-align: top;
29391
+ --ni-private-hover-indicator-width: calc(${borderWidth} + 1px);
29457
29392
  }
29458
29393
 
29459
29394
  :host([disabled]) {
@@ -29470,10 +29405,47 @@
29470
29405
  color: ${controlLabelDisabledFontColor};
29471
29406
  }
29472
29407
 
29408
+ .container {
29409
+ display: flex;
29410
+ justify-content: center;
29411
+ position: relative;
29412
+ height: 100%;
29413
+ width: 100%;
29414
+ }
29415
+
29416
+ .container::after {
29417
+ content: ' ';
29418
+ position: absolute;
29419
+ bottom: calc(-1 * ${borderWidth});
29420
+ width: 0px;
29421
+ height: 0px;
29422
+ border-bottom: ${borderHoverColor}
29423
+ var(--ni-private-hover-indicator-width) solid;
29424
+ transition: width ${smallDelay} ease-in;
29425
+ }
29426
+
29427
+ @media (prefers-reduced-motion) {
29428
+ .container::after {
29429
+ transition-duration: 0s;
29430
+ }
29431
+ }
29432
+
29433
+ :host([error-visible]) .container::after {
29434
+ border-bottom-color: ${failColor};
29435
+ }
29436
+
29437
+ :host(:hover) .container::after {
29438
+ width: 100%;
29439
+ }
29440
+
29441
+ :host([disabled]:hover) .container::after,
29442
+ :host([readonly]:hover) .container::after {
29443
+ width: 0px;
29444
+ }
29445
+
29473
29446
  .control {
29474
29447
  -webkit-appearance: none;
29475
29448
  font: inherit;
29476
- width: 100%;
29477
29449
  flex-grow: 1;
29478
29450
  outline: none;
29479
29451
  box-sizing: border-box;
@@ -29482,8 +29454,13 @@
29482
29454
  border-radius: 0px;
29483
29455
  align-items: flex-end;
29484
29456
  border: ${borderWidth} solid transparent;
29457
+ min-width: 100px;
29458
+ min-height: calc(${iconSize} + ${standardPadding});
29485
29459
  padding: 8px;
29486
- transition: box-shadow ${smallDelay}, border ${smallDelay};
29460
+ ${
29461
+ /* This padding ensures that showing/hiding the error icon doesn't affect text layout */ ''}
29462
+ padding-right: calc(${iconSize});
29463
+ margin: 0px;
29487
29464
  resize: none;
29488
29465
  }
29489
29466
 
@@ -29493,13 +29470,8 @@
29493
29470
  }
29494
29471
  }
29495
29472
 
29496
- .control:hover {
29497
- border-color: ${borderHoverColor};
29498
- box-shadow: 0px 0px 0px 1px ${borderHoverColor};
29499
- }
29500
-
29501
29473
  .control:focus-within {
29502
- border-color: ${borderHoverColor};
29474
+ border-bottom-color: ${borderHoverColor};
29503
29475
  }
29504
29476
 
29505
29477
  .control[readonly],
@@ -29508,23 +29480,22 @@
29508
29480
  .control[disabled],
29509
29481
  .control[disabled]:hover {
29510
29482
  border-color: rgba(${borderRgbPartialColor}, 0.1);
29511
- box-shadow: none;
29512
29483
  }
29513
29484
 
29514
- .control::placeholder {
29515
- color: ${controlLabelFontColor};
29485
+ :host([error-visible]) .control {
29486
+ border-bottom-color: ${failColor};
29516
29487
  }
29517
29488
 
29518
- .control[disabled]::placeholder {
29519
- color: ${controlLabelDisabledFontColor};
29489
+ :host([error-visible]) .control[readonly]:hover:focus-within {
29490
+ border-bottom-color: ${failColor};
29520
29491
  }
29521
29492
 
29522
- :host([cols]) .control {
29523
- width: auto;
29493
+ .control::placeholder {
29494
+ color: ${controlLabelFontColor};
29524
29495
  }
29525
29496
 
29526
- :host([rows]) .control {
29527
- flex: none;
29497
+ .control[disabled]::placeholder {
29498
+ color: ${controlLabelDisabledFontColor};
29528
29499
  }
29529
29500
 
29530
29501
  :host([resize='both']) .control {
@@ -29536,6 +29507,17 @@
29536
29507
  :host([resize='vertical']) .control {
29537
29508
  resize: vertical;
29538
29509
  }
29510
+
29511
+ :host([error-visible]) .error-icon {
29512
+ display: none;
29513
+ }
29514
+
29515
+ :host([error-visible]) .error-icon.scrollbar-width-calculated {
29516
+ display: inline-flex;
29517
+ position: absolute;
29518
+ top: calc(${standardPadding} / 2);
29519
+ right: var(--ni-private-scrollbar-width);
29520
+ }
29539
29521
  `.withBehaviors(appearanceBehavior(TextAreaAppearance.outline, css `
29540
29522
  .control {
29541
29523
  border-color: rgba(${borderRgbPartialColor}, 0.3);
@@ -29554,8 +29536,71 @@
29554
29536
  border-color: transparent;
29555
29537
  background-color: rgba(${borderRgbPartialColor}, 0.1);
29556
29538
  }
29539
+
29540
+ :host([error-visible][disabled]) .control {
29541
+ border-bottom-color: ${failColor};
29542
+ }
29557
29543
  `));
29558
29544
 
29545
+ const template$2 = () => html `
29546
+ <label
29547
+ part="label"
29548
+ for="control"
29549
+ class="${x => (x.defaultSlottedNodes?.length ? 'label' : 'label label__hidden')}"
29550
+ >
29551
+ <slot ${slotted('defaultSlottedNodes')}></slot>
29552
+ </label>
29553
+ <div class="container">
29554
+ <textarea
29555
+ part="control"
29556
+ class="control"
29557
+ id="control"
29558
+ ?autofocus="${x => x.autofocus}"
29559
+ cols="${x => x.cols}"
29560
+ ?disabled="${x => x.disabled}"
29561
+ form="${x => x.form}"
29562
+ list="${x => x.list}"
29563
+ maxlength="${x => x.maxlength}"
29564
+ minlength="${x => x.minlength}"
29565
+ name="${x => x.name}"
29566
+ placeholder="${x => x.placeholder}"
29567
+ ?readonly="${x => x.readOnly}"
29568
+ ?required="${x => x.required}"
29569
+ rows="${x => x.rows}"
29570
+ ?spellcheck="${x => x.spellcheck}"
29571
+ :value="${x => x.value}"
29572
+ aria-atomic="${x => x.ariaAtomic}"
29573
+ aria-busy="${x => x.ariaBusy}"
29574
+ aria-controls="${x => x.ariaControls}"
29575
+ aria-current="${x => x.ariaCurrent}"
29576
+ aria-describedby="${x => x.ariaDescribedby}"
29577
+ aria-details="${x => x.ariaDetails}"
29578
+ aria-disabled="${x => x.ariaDisabled}"
29579
+ aria-errormessage="${x => x.ariaErrormessage}"
29580
+ aria-flowto="${x => x.ariaFlowto}"
29581
+ aria-haspopup="${x => x.ariaHaspopup}"
29582
+ aria-hidden="${x => x.ariaHidden}"
29583
+ aria-invalid="${x => x.ariaInvalid}"
29584
+ aria-keyshortcuts="${x => x.ariaKeyshortcuts}"
29585
+ aria-label="${x => x.ariaLabel}"
29586
+ aria-labelledby="${x => x.ariaLabelledby}"
29587
+ aria-live="${x => x.ariaLive}"
29588
+ aria-owns="${x => x.ariaOwns}"
29589
+ aria-relevant="${x => x.ariaRelevant}"
29590
+ aria-roledescription="${x => x.ariaRoledescription}"
29591
+ @input="${x => x.onTextAreaInput()}"
29592
+ @change="${x => x.handleChange()}"
29593
+ ${ref('control')}
29594
+ ></textarea>
29595
+ <${iconExclamationMarkTag}
29596
+ severity="error"
29597
+ class="error-icon ${x => (x.scrollbarWidth >= 0 ? 'scrollbar-width-calculated' : '')}"
29598
+ style="--ni-private-scrollbar-width: ${x => x.scrollbarWidth}px;"
29599
+ ></${iconExclamationMarkTag}>
29600
+ ${errorTextTemplate}
29601
+ </div>
29602
+ `;
29603
+
29559
29604
  /**
29560
29605
  * A nimble-styed HTML text area
29561
29606
  */
@@ -29570,15 +29615,96 @@
29570
29615
  * HTML Attribute: appearance
29571
29616
  */
29572
29617
  this.appearance = TextAreaAppearance.outline;
29618
+ /**
29619
+ * Whether to display the error state.
29620
+ *
29621
+ * @public
29622
+ * @remarks
29623
+ * HTML Attribute: error-visible
29624
+ */
29625
+ this.errorVisible = false;
29626
+ /**
29627
+ * The width of the vertical scrollbar, if displayed.
29628
+ * @internal
29629
+ */
29630
+ this.scrollbarWidth = -1;
29631
+ this.updateScrollbarWidthQueued = false;
29632
+ }
29633
+ /**
29634
+ * @internal
29635
+ */
29636
+ connectedCallback() {
29637
+ super.connectedCallback();
29638
+ this.resizeObserver = new ResizeObserver(() => this.onResize());
29639
+ this.resizeObserver.observe(this);
29640
+ }
29641
+ /**
29642
+ * @internal
29643
+ */
29644
+ disconnectedCallback() {
29645
+ this.resizeObserver?.disconnect();
29646
+ }
29647
+ /**
29648
+ * @internal
29649
+ */
29650
+ onTextAreaInput() {
29651
+ this.handleTextInput();
29652
+ this.queueUpdateScrollbarWidth();
29653
+ }
29654
+ // If a property can affect whether a scrollbar is visible, we need to
29655
+ // call queueUpdateScrollbarWidth() when it changes. The exceptions are
29656
+ // properties that affect size (e.g. height, width, cols, rows), because
29657
+ // we already have a ResizeObserver handling those changes. Also,
29658
+ // a change to errorVisible cannot cause scrollbar visibility to change,
29659
+ // because we always reserve space for the error icon.
29660
+ /**
29661
+ * @internal
29662
+ */
29663
+ placeholderChanged() {
29664
+ this.queueUpdateScrollbarWidth();
29665
+ }
29666
+ /**
29667
+ * @internal
29668
+ */
29669
+ valueChanged(previous, next) {
29670
+ super.valueChanged(previous, next);
29671
+ this.queueUpdateScrollbarWidth();
29672
+ }
29673
+ onResize() {
29674
+ // Do this directly instead of calling updateScrollbarWidth, b/c we don't want to
29675
+ // interfere with queue.
29676
+ this.scrollbarWidth = this.control.offsetWidth - this.control.clientWidth;
29677
+ }
29678
+ queueUpdateScrollbarWidth() {
29679
+ if (!this.$fastController.isConnected) {
29680
+ return;
29681
+ }
29682
+ if (!this.updateScrollbarWidthQueued) {
29683
+ this.updateScrollbarWidthQueued = true;
29684
+ DOM.queueUpdate(() => this.updateScrollbarWidth());
29685
+ }
29686
+ }
29687
+ updateScrollbarWidth() {
29688
+ this.updateScrollbarWidthQueued = false;
29689
+ this.scrollbarWidth = this.control.offsetWidth - this.control.clientWidth;
29573
29690
  }
29574
29691
  }
29575
29692
  __decorate$1([
29576
29693
  attr
29577
29694
  ], TextArea.prototype, "appearance", void 0);
29695
+ __decorate$1([
29696
+ attr({ attribute: 'error-text' })
29697
+ ], TextArea.prototype, "errorText", void 0);
29698
+ __decorate$1([
29699
+ attr({ attribute: 'error-visible', mode: 'boolean' })
29700
+ ], TextArea.prototype, "errorVisible", void 0);
29701
+ __decorate$1([
29702
+ observable
29703
+ ], TextArea.prototype, "scrollbarWidth", void 0);
29578
29704
  const nimbleTextArea = TextArea.compose({
29579
29705
  baseName: 'text-area',
29580
29706
  baseClass: TextArea$1,
29581
- template: textAreaTemplate,
29707
+ template: template$2,
29582
29708
  styles: styles$6,
29583
29709
  shadowOptions: {
29584
29710
  delegatesFocus: true