@ni/nimble-components 32.7.2 → 32.8.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.
@@ -20337,7 +20337,42 @@ so this becomes the fallback color for the slot */ ''}
20337
20337
  DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleCardButton());
20338
20338
 
20339
20339
  const styles$M = css `
20340
+ .error-icon {
20341
+ display: none;
20342
+ }
20343
+
20344
+ :host([error-visible]) .error-icon {
20345
+ display: inline-flex;
20346
+ width: ${iconSize};
20347
+ height: ${iconSize};
20348
+ flex: none;
20349
+ }
20350
+
20351
+ .error-text {
20352
+ display: none;
20353
+ }
20354
+
20355
+ :host([error-visible]) .error-text {
20356
+ display: block;
20357
+ font: ${errorTextFont};
20358
+ color: ${failColor};
20359
+ width: 100%;
20360
+ position: absolute;
20361
+ bottom: calc(-1 * (${errorTextFontLineHeight} + 2px));
20362
+ left: 0px;
20363
+ overflow: hidden;
20364
+ text-overflow: ellipsis;
20365
+ white-space: nowrap;
20366
+ }
20367
+
20368
+ :host([error-visible]) .error-text:empty {
20369
+ display: none;
20370
+ }
20371
+ `;
20372
+
20373
+ const styles$L = css `
20340
20374
  ${display('inline-flex')}
20375
+ ${styles$M}
20341
20376
 
20342
20377
  :host {
20343
20378
  font: ${bodyFont};
@@ -20345,16 +20380,25 @@ so this becomes the fallback color for the slot */ ''}
20345
20380
  cursor: pointer;
20346
20381
  outline: none;
20347
20382
  ${userSelectNone}
20383
+ min-height: ${controlHeight};
20348
20384
  }
20349
20385
 
20350
20386
  :host([disabled]) {
20351
20387
  cursor: default;
20352
20388
  }
20353
20389
 
20390
+ .container {
20391
+ position: relative;
20392
+ display: grid;
20393
+ grid-template-columns: auto 1fr auto;
20394
+ grid-template-rows: ${bodyFontLineHeight} auto;
20395
+ align-items: center;
20396
+ width: 100%;
20397
+ }
20398
+
20354
20399
  .control {
20355
- width: calc(${controlHeight} / 2);
20356
- height: calc(${controlHeight} / 2);
20357
- flex-shrink: 0;
20400
+ width: ${iconSize};
20401
+ height: ${iconSize};
20358
20402
  border: ${borderWidth} solid ${borderColor};
20359
20403
  padding: 2px;
20360
20404
  display: inline-flex;
@@ -20367,6 +20411,8 @@ so this becomes the fallback color for the slot */ ''}
20367
20411
  * Set it to 0 to ensure the outline is just as high as the control.
20368
20412
  */ ''}
20369
20413
  line-height: 0;
20414
+ grid-column: 1;
20415
+ grid-row: 1;
20370
20416
  }
20371
20417
 
20372
20418
  @media (prefers-reduced-motion) {
@@ -20394,7 +20440,9 @@ so this becomes the fallback color for the slot */ ''}
20394
20440
  .label {
20395
20441
  font: inherit;
20396
20442
  color: ${bodyFontColor};
20397
- padding-left: 1ch;
20443
+ padding-left: ${mediumPadding};
20444
+ grid-column: 2;
20445
+ grid-row: 1 / span 2;
20398
20446
  cursor: inherit;
20399
20447
  }
20400
20448
 
@@ -20411,16 +20459,13 @@ so this becomes the fallback color for the slot */ ''}
20411
20459
  height: ${iconSize};
20412
20460
  width: ${iconSize};
20413
20461
  overflow: visible;
20462
+ fill: ${borderColor};
20414
20463
  }
20415
20464
 
20416
20465
  :host(.checked:not(.indeterminate)) slot[name='checked-indicator'] {
20417
20466
  display: contents;
20418
20467
  }
20419
20468
 
20420
- slot[name='checked-indicator'] svg {
20421
- fill: ${borderColor};
20422
- }
20423
-
20424
20469
  :host([disabled]) slot[name='checked-indicator'] svg {
20425
20470
  fill: rgba(${borderRgbPartialColor}, 0.3);
20426
20471
  }
@@ -20442,6 +20487,18 @@ so this becomes the fallback color for the slot */ ''}
20442
20487
  :host([disabled]) slot[name='indeterminate-indicator'] svg {
20443
20488
  fill: rgba(${borderRgbPartialColor}, 0.3);
20444
20489
  }
20490
+
20491
+ .error-icon {
20492
+ grid-column: 3;
20493
+ grid-row: 1;
20494
+ margin: 0px ${smallPadding};
20495
+ }
20496
+ `;
20497
+
20498
+ const errorTextTemplate = html `
20499
+ <div class="error-text" title="${x => x.errorText}" aria-live="polite">
20500
+ ${x => x.errorText}
20501
+ </div>
20445
20502
  `;
20446
20503
 
20447
20504
  const template$B = (_context, definition) => html `
@@ -20456,22 +20513,29 @@ so this becomes the fallback color for the slot */ ''}
20456
20513
  @click="${(x, c) => x.clickHandler(c.event)}"
20457
20514
  class="${x => (x.readOnly ? 'readonly' : '')} ${x => (x.checked ? 'checked' : '')} ${x => (x.indeterminate ? 'indeterminate' : '')}"
20458
20515
  >
20459
- <div part="control" class="control">
20460
- <slot name="checked-indicator">
20461
- ${definition.checkedIndicator || ''}
20462
- </slot>
20463
- <slot name="indeterminate-indicator">
20464
- ${definition.indeterminateIndicator || ''}
20465
- </slot>
20466
- </div>
20467
- <label
20468
- part="label"
20469
- class="${x => (x.defaultSlottedNodes?.length
20516
+ <div part="container" class="container">
20517
+ <div part="control" class="control">
20518
+ <slot name="checked-indicator">
20519
+ ${definition.checkedIndicator || ''}
20520
+ </slot>
20521
+ <slot name="indeterminate-indicator">
20522
+ ${definition.indeterminateIndicator || ''}
20523
+ </slot>
20524
+ </div>
20525
+ <label
20526
+ part="label"
20527
+ class="${x => (x.defaultSlottedNodes?.length
20470
20528
  ? 'label'
20471
20529
  : 'label label__hidden')}"
20472
- >
20473
- <slot ${slotted('defaultSlottedNodes')}></slot>
20474
- </label>
20530
+ >
20531
+ <slot ${slotted('defaultSlottedNodes')}></slot>
20532
+ </label>
20533
+ <${iconExclamationMarkTag}
20534
+ severity="error"
20535
+ class="error-icon"
20536
+ ></${iconExclamationMarkTag}>
20537
+ ${errorTextTemplate}
20538
+ </div>
20475
20539
  </template>
20476
20540
  `;
20477
20541
 
@@ -20479,6 +20543,10 @@ so this becomes the fallback color for the slot */ ''}
20479
20543
  * A nimble-styled checkbox control.
20480
20544
  */
20481
20545
  class Checkbox extends Checkbox$1 {
20546
+ constructor() {
20547
+ super(...arguments);
20548
+ this.errorVisible = false;
20549
+ }
20482
20550
  /**
20483
20551
  * @internal
20484
20552
  */
@@ -20490,18 +20558,24 @@ so this becomes the fallback color for the slot */ ''}
20490
20558
  __decorate$1([
20491
20559
  attr({ attribute: 'tabindex', converter: nullableNumberConverter })
20492
20560
  ], Checkbox.prototype, "tabIndex", void 0);
20561
+ __decorate$1([
20562
+ attr({ attribute: 'error-text' })
20563
+ ], Checkbox.prototype, "errorText", void 0);
20564
+ __decorate$1([
20565
+ attr({ attribute: 'error-visible', mode: 'boolean' })
20566
+ ], Checkbox.prototype, "errorVisible", void 0);
20493
20567
  const nimbleCheckbox = Checkbox.compose({
20494
20568
  baseName: 'checkbox',
20495
20569
  baseClass: Checkbox$1,
20496
20570
  template: template$B,
20497
- styles: styles$M,
20571
+ styles: styles$L,
20498
20572
  checkedIndicator: check16X16.data,
20499
20573
  indeterminateIndicator: minus16X16.data
20500
20574
  });
20501
20575
  DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleCheckbox());
20502
20576
  const checkboxTag = 'nimble-checkbox';
20503
20577
 
20504
- const styles$L = css `
20578
+ const styles$K = css `
20505
20579
  ${styles$_}
20506
20580
  ${buttonAppearanceVariantStyles}
20507
20581
 
@@ -20648,7 +20722,7 @@ so this becomes the fallback color for the slot */ ''}
20648
20722
  const nimbleToggleButton = ToggleButton.compose({
20649
20723
  baseName: 'toggle-button',
20650
20724
  template: template$A,
20651
- styles: styles$L,
20725
+ styles: styles$K,
20652
20726
  shadowOptions: {
20653
20727
  delegatesFocus: true
20654
20728
  }
@@ -20656,12 +20730,6 @@ so this becomes the fallback color for the slot */ ''}
20656
20730
  DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleToggleButton());
20657
20731
  const toggleButtonTag = 'nimble-toggle-button';
20658
20732
 
20659
- const errorTextTemplate = html `
20660
- <div class="error-text" title="${x => x.errorText}" aria-live="polite">
20661
- ${x => x.errorText}
20662
- </div>
20663
- `;
20664
-
20665
20733
  // AUTO-GENERATED FILE - DO NOT EDIT DIRECTLY
20666
20734
  // See generation source in nimble-components/build/generate-icons
20667
20735
  /**
@@ -20686,7 +20754,7 @@ so this becomes the fallback color for the slot */ ''}
20686
20754
  };
20687
20755
 
20688
20756
  // prettier-ignore
20689
- const styles$K = css `
20757
+ const styles$J = css `
20690
20758
  ${display('inline-flex')}
20691
20759
 
20692
20760
  :host {
@@ -20955,40 +21023,6 @@ so this becomes the fallback color for the slot */ ''}
20955
21023
  }
20956
21024
  `));
20957
21025
 
20958
- const styles$J = css `
20959
- .error-icon {
20960
- display: none;
20961
- }
20962
-
20963
- :host([error-visible]) .error-icon {
20964
- display: inline-flex;
20965
- width: ${iconSize};
20966
- height: ${iconSize};
20967
- flex: none;
20968
- }
20969
-
20970
- .error-text {
20971
- display: none;
20972
- }
20973
-
20974
- :host([error-visible]) .error-text {
20975
- display: block;
20976
- font: ${errorTextFont};
20977
- color: ${failColor};
20978
- width: 100%;
20979
- position: absolute;
20980
- bottom: calc(-1 * (${errorTextFontLineHeight} + 2px));
20981
- left: 0px;
20982
- overflow: hidden;
20983
- text-overflow: ellipsis;
20984
- white-space: nowrap;
20985
- }
20986
-
20987
- :host([error-visible]) .error-text:empty {
20988
- display: none;
20989
- }
20990
- `;
20991
-
20992
21026
  /**
20993
21027
  * Types of dropdown appearance.
20994
21028
  * @public
@@ -21004,8 +21038,8 @@ so this becomes the fallback color for the slot */ ''}
21004
21038
  };
21005
21039
 
21006
21040
  const styles$I = css `
21007
- ${styles$K}
21008
21041
  ${styles$J}
21042
+ ${styles$M}
21009
21043
 
21010
21044
  :host {
21011
21045
  --ni-private-hover-bottom-border-width: 2px;
@@ -26514,7 +26548,7 @@ so this becomes the fallback color for the slot */ ''}
26514
26548
 
26515
26549
  const styles$y = css `
26516
26550
  ${display('inline-block')}
26517
- ${styles$J}
26551
+ ${styles$M}
26518
26552
 
26519
26553
  :host {
26520
26554
  font: ${bodyFont};
@@ -26888,7 +26922,7 @@ so this becomes the fallback color for the slot */ ''}
26888
26922
 
26889
26923
  const styles$w = css `
26890
26924
  ${display('inline-block')}
26891
- ${styles$J}
26925
+ ${styles$M}
26892
26926
 
26893
26927
  .positioning-region {
26894
26928
  display: flex;
@@ -45155,7 +45189,7 @@ img.ProseMirror-separator {
45155
45189
  }).withDefault(richTextLabelDefaults.richTextToggleNumberedListLabel);
45156
45190
 
45157
45191
  const styles$u = css `
45158
- ${styles$K}
45192
+ ${styles$J}
45159
45193
 
45160
45194
  :host {
45161
45195
  height: auto;
@@ -45576,7 +45610,7 @@ img.ProseMirror-separator {
45576
45610
 
45577
45611
  const styles$t = css `
45578
45612
  ${display('inline-flex')}
45579
- ${styles$J}
45613
+ ${styles$M}
45580
45614
 
45581
45615
  :host {
45582
45616
  font: ${bodyFont};
@@ -60340,8 +60374,8 @@ img.ProseMirror-separator {
60340
60374
  .register(nimbleRichTextViewer());
60341
60375
 
60342
60376
  const styles$r = css `
60343
- ${styles$K}
60344
60377
  ${styles$J}
60378
+ ${styles$M}
60345
60379
 
60346
60380
  ${
60347
60381
  /* We are using flex `order` to define the visual ordering of the selected value,
@@ -66091,6 +66125,7 @@ focus outline in that case.
66091
66125
 
66092
66126
  .header-row-action-container {
66093
66127
  display: flex;
66128
+ align-items: center;
66094
66129
  }
66095
66130
 
66096
66131
  .checkbox-container {
@@ -74172,7 +74207,7 @@ focus outline in that case.
74172
74207
 
74173
74208
  const styles$6 = css `
74174
74209
  ${display('inline-flex')}
74175
- ${styles$J}
74210
+ ${styles$M}
74176
74211
 
74177
74212
  :host {
74178
74213
  font: ${bodyFont};
@@ -74517,7 +74552,7 @@ focus outline in that case.
74517
74552
 
74518
74553
  const styles$5 = css `
74519
74554
  ${display('inline-block')}
74520
- ${styles$J}
74555
+ ${styles$M}
74521
74556
 
74522
74557
  :host {
74523
74558
  font: ${bodyFont};