@ni/spright-components 1.0.21 → 1.0.22

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.
@@ -16280,7 +16280,7 @@
16280
16280
 
16281
16281
  /**
16282
16282
  * Do not edit directly
16283
- * Generated on Mon, 17 Jun 2024 15:00:56 GMT
16283
+ * Generated on Mon, 17 Jun 2024 16:25:28 GMT
16284
16284
  */
16285
16285
 
16286
16286
  const Information100DarkUi = "#a46eff";
@@ -19800,7 +19800,8 @@
19800
19800
  popupIconWarningLabel: 'Warning',
19801
19801
  popupIconInformationLabel: 'Information',
19802
19802
  filterSearchLabel: 'Search',
19803
- filterNoResultsLabel: 'No items found'
19803
+ filterNoResultsLabel: 'No items found',
19804
+ loadingLabel: 'Loading…'
19804
19805
  };
19805
19806
 
19806
19807
  const popupDismissLabel = DesignToken.create({
@@ -19835,6 +19836,10 @@
19835
19836
  name: 'filter-no-results-label',
19836
19837
  cssCustomPropertyName: null
19837
19838
  }).withDefault(coreLabelDefaults.filterNoResultsLabel);
19839
+ const loadingLabel = DesignToken.create({
19840
+ name: 'loading-label',
19841
+ cssCustomPropertyName: null
19842
+ }).withDefault(coreLabelDefaults.loadingLabel);
19838
19843
 
19839
19844
  // prettier-ignore
19840
19845
  const template$A = html `
@@ -20907,7 +20912,8 @@
20907
20912
  */
20908
20913
  const FilterMode = {
20909
20914
  none: undefined,
20910
- standard: 'standard'
20915
+ standard: 'standard',
20916
+ manual: 'manual'
20911
20917
  };
20912
20918
 
20913
20919
  const styles$I = css `
@@ -24657,7 +24663,8 @@
24657
24663
  popupIconWarning: popupIconWarningLabel,
24658
24664
  popupIconInformation: popupIconInformationLabel,
24659
24665
  filterSearch: filterSearchLabel,
24660
- filterNoResults: filterNoResultsLabel
24666
+ filterNoResults: filterNoResultsLabel,
24667
+ loading: loadingLabel
24661
24668
  };
24662
24669
  /**
24663
24670
  * Core label provider for Nimble
@@ -24692,6 +24699,9 @@
24692
24699
  __decorate$1([
24693
24700
  attr({ attribute: 'filter-no-results' })
24694
24701
  ], LabelProviderCore.prototype, "filterNoResults", void 0);
24702
+ __decorate$1([
24703
+ attr({ attribute: 'loading' })
24704
+ ], LabelProviderCore.prototype, "loading", void 0);
24695
24705
  const nimbleLabelProviderCore = LabelProviderCore.compose({
24696
24706
  baseName: 'label-provider-core',
24697
24707
  styles: styles$F
@@ -59399,6 +59409,37 @@ img.ProseMirror-separator {
59399
59409
  align-items: center;
59400
59410
  padding: ${smallPadding} ${mediumPadding};
59401
59411
  }
59412
+
59413
+ .loading-container {
59414
+ padding-left: ${mediumPadding};
59415
+ padding-right: ${mediumPadding};
59416
+ display: flex;
59417
+ height: ${controlHeight};
59418
+ flex: 1 0 auto;
59419
+ }
59420
+
59421
+ .loading-container.above {
59422
+ align-items: end;
59423
+ padding-bottom: ${smallPadding};
59424
+ }
59425
+
59426
+ .loading-container.below {
59427
+ align-items: normal;
59428
+ padding-top: ${smallPadding};
59429
+ }
59430
+
59431
+ .loading-container.empty {
59432
+ padding: ${smallPadding} ${mediumPadding};
59433
+ align-items: center;
59434
+ }
59435
+
59436
+ .loading-label {
59437
+ color: ${placeholderFontColor};
59438
+ }
59439
+
59440
+ .loading-spinner {
59441
+ margin-left: auto;
59442
+ }
59402
59443
  `.withBehaviors(appearanceBehavior(DropdownAppearance.block, css `
59403
59444
  :host([error-visible]) .control {
59404
59445
  border-bottom-width: ${borderWidth};
@@ -59406,11 +59447,235 @@ img.ProseMirror-separator {
59406
59447
  }
59407
59448
  `), themeBehavior(Theme.color, css `
59408
59449
  .filter-field,
59409
- .no-results-label {
59450
+ .no-results-label,
59451
+ .loading-container {
59410
59452
  background: ${hexToRgbaCssColor(White, 0.15)};
59411
59453
  }
59412
59454
  `));
59413
59455
 
59456
+ const styles$q = css `
59457
+ ${display$1('inline-grid')}
59458
+
59459
+ :host {
59460
+ height: ${spinnerSmallHeight};
59461
+ aspect-ratio: 1 / 1;
59462
+ }
59463
+
59464
+ div.overlay {
59465
+ z-index: ${ZIndexLevels.zIndex1};
59466
+ margin: max(2px, 6.25%);
59467
+ grid-area: 1/1;
59468
+ }
59469
+
59470
+ div.container {
59471
+ margin: max(2px, 6.25%);
59472
+ grid-area: 1/1;
59473
+ ${
59474
+ /**
59475
+ * At some spinner sizes / browser zoom levels, the spinner bits/squares appear to slightly overlap visually.
59476
+ * If we set a color with transparency on each bit, it'll look wrong in the overlapping region (since the opacity
59477
+ * combines and affects the color at the overlapping spot).
59478
+ * Currently all 3 themes use a color with opacity = 0.6, so that's applied here on the parent element instead,
59479
+ * which avoids that issue.
59480
+ */
59481
+ ''}
59482
+ opacity: 0.6;
59483
+ }
59484
+
59485
+ :host([appearance='accent']) div.container {
59486
+ opacity: 1;
59487
+ }
59488
+
59489
+ div.bit1,
59490
+ div.bit2 {
59491
+ background: var(--ni-private-spinner-bits-background-color);
59492
+ width: 50%;
59493
+ height: 50%;
59494
+ margin: auto;
59495
+ animation-duration: 1600ms;
59496
+ animation-iteration-count: infinite;
59497
+ animation-play-state: var(
59498
+ --ni-private-spinner-animation-play-state,
59499
+ running
59500
+ );
59501
+ animation-timing-function: cubic-bezier(0.65, 0, 0.35, 0);
59502
+ }
59503
+
59504
+ div.bit1 {
59505
+ animation-name: ni-private-spinner-keyframes-1;
59506
+ }
59507
+
59508
+ div.bit2 {
59509
+ animation-name: ni-private-spinner-keyframes-2;
59510
+ }
59511
+
59512
+ @media (prefers-reduced-motion) {
59513
+ div.bit1,
59514
+ div.bit2 {
59515
+ animation-timing-function: ease-in-out, steps(1);
59516
+ animation-duration: 3200ms;
59517
+ }
59518
+
59519
+ div.bit1 {
59520
+ animation-name: ni-private-spinner-no-motion-opacity-keyframes,
59521
+ ni-private-spinner-no-motion-transform-keyframes-1;
59522
+ }
59523
+
59524
+ div.bit2 {
59525
+ animation-name: ni-private-spinner-no-motion-opacity-keyframes,
59526
+ ni-private-spinner-no-motion-transform-keyframes-2;
59527
+ }
59528
+ }
59529
+
59530
+ @keyframes ni-private-spinner-keyframes-1 {
59531
+ 0%,
59532
+ 100% {
59533
+ transform: translate(-50%, 0);
59534
+ }
59535
+
59536
+ 25% {
59537
+ transform: translate(50%, 0);
59538
+ }
59539
+
59540
+ 50% {
59541
+ transform: translate(50%, 100%);
59542
+ }
59543
+
59544
+ 75% {
59545
+ transform: translate(-50%, 100%);
59546
+ }
59547
+ }
59548
+
59549
+ @keyframes ni-private-spinner-keyframes-2 {
59550
+ 0%,
59551
+ 100% {
59552
+ transform: translate(50%, 0);
59553
+ }
59554
+
59555
+ 25% {
59556
+ transform: translate(-50%, 0);
59557
+ }
59558
+
59559
+ 50% {
59560
+ transform: translate(-50%, -100%);
59561
+ }
59562
+
59563
+ 75% {
59564
+ transform: translate(50%, -100%);
59565
+ }
59566
+ }
59567
+
59568
+ @keyframes ni-private-spinner-no-motion-opacity-keyframes {
59569
+ 0%,
59570
+ 50%,
59571
+ 100% {
59572
+ opacity: 0;
59573
+ }
59574
+
59575
+ 25%,
59576
+ 75% {
59577
+ opacity: 1;
59578
+ }
59579
+ }
59580
+
59581
+ @keyframes ni-private-spinner-no-motion-transform-keyframes-1 {
59582
+ 0%,
59583
+ 100% {
59584
+ transform: translate(-50%, 0);
59585
+ }
59586
+ 50% {
59587
+ transform: translate(50%, 0);
59588
+ }
59589
+ }
59590
+
59591
+ @keyframes ni-private-spinner-no-motion-transform-keyframes-2 {
59592
+ 0%,
59593
+ 100% {
59594
+ transform: translate(50%, 0);
59595
+ }
59596
+
59597
+ 50% {
59598
+ transform: translate(-50%, 0);
59599
+ }
59600
+ }
59601
+ `.withBehaviors(themeBehavior(Theme.light, css `
59602
+ :host {
59603
+ --ni-private-spinner-bits-background-color: ${Black91};
59604
+ }
59605
+ :host([appearance='accent']) {
59606
+ --ni-private-spinner-bits-background-color: ${DigitalGreenLight};
59607
+ }
59608
+ `), themeBehavior(Theme.dark, css `
59609
+ :host {
59610
+ --ni-private-spinner-bits-background-color: ${Black15};
59611
+ }
59612
+ :host([appearance='accent']) {
59613
+ --ni-private-spinner-bits-background-color: ${PowerGreen};
59614
+ }
59615
+ `), themeBehavior(Theme.color, css `
59616
+ :host {
59617
+ --ni-private-spinner-bits-background-color: ${White};
59618
+ }
59619
+ :host([appearance='accent']) {
59620
+ --ni-private-spinner-bits-background-color: ${PowerGreen};
59621
+ }
59622
+ `));
59623
+
59624
+ /* eslint-disable @typescript-eslint/indent */
59625
+ // prettier-ignore
59626
+ const template$m = html `
59627
+ <template role="progressbar">
59628
+ ${''
59629
+ /**
59630
+ * In Firefox, the 'title' set on the spinner is very finicky when
59631
+ * the spinner is animating. Therefore, put a transparent overlay on
59632
+ * top of the spinning bits so that the title displays as expected.
59633
+ */
59634
+ }
59635
+ <div class="overlay"></div>
59636
+
59637
+ <div class="container">
59638
+ <div class="bit1"></div>
59639
+ <div class="bit2"></div>
59640
+ </div>
59641
+ </template>
59642
+ `;
59643
+
59644
+ /**
59645
+ * Types of spinner appearance.
59646
+ * @public
59647
+ */
59648
+ const SpinnerAppearance = {
59649
+ default: undefined,
59650
+ accent: 'accent'
59651
+ };
59652
+
59653
+ /**
59654
+ * A Nimble-styled spinner component.
59655
+ * A spinner is an animating indicator that can be placed in a particular region of a page to represent loading progress, or an ongoing operation, of an indeterminate / unknown duration.
59656
+ */
59657
+ class Spinner extends FoundationElement {
59658
+ constructor() {
59659
+ super(...arguments);
59660
+ /**
59661
+ * @public
59662
+ * @description
59663
+ * The appearance the spinner area should have.
59664
+ */
59665
+ this.appearance = SpinnerAppearance.default;
59666
+ }
59667
+ }
59668
+ __decorate$1([
59669
+ attr
59670
+ ], Spinner.prototype, "appearance", void 0);
59671
+ const nimbleSpinner = Spinner.compose({
59672
+ baseName: 'spinner',
59673
+ template: template$m,
59674
+ styles: styles$q
59675
+ });
59676
+ DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleSpinner());
59677
+ const spinnerTag = 'nimble-spinner';
59678
+
59414
59679
  const isListOption = (el) => {
59415
59680
  return el instanceof ListOption;
59416
59681
  };
@@ -59419,7 +59684,7 @@ img.ProseMirror-separator {
59419
59684
  };
59420
59685
  /* eslint-disable @typescript-eslint/indent */
59421
59686
  // prettier-ignore
59422
- const template$m = (context, definition) => html `
59687
+ const template$l = (context, definition) => html `
59423
59688
  <template
59424
59689
  class="${x => [
59425
59690
  x.collapsible && 'collapsible',
@@ -59509,7 +59774,7 @@ img.ProseMirror-separator {
59509
59774
  aria-controls="${x => x.ariaControls}"
59510
59775
  aria-activedescendant="${x => x.ariaActiveDescendant}"
59511
59776
  @input="${(x, c) => x.inputHandler(c.event)}"
59512
- @click="${(x, c) => x.inputClickHandler(c.event)}"
59777
+ @click="${(x, c) => x.ignoreClickHandler(c.event)}"
59513
59778
  placeholder="${x => filterSearchLabel.getValueFor(x)}"
59514
59779
  value="${x => x.filter}"
59515
59780
  />
@@ -59526,11 +59791,20 @@ img.ProseMirror-separator {
59526
59791
  })}
59527
59792
  ></slot>
59528
59793
  </div>
59529
- ${when(x => (x.filterMode !== FilterMode.none && x.filteredOptions.length === 0), html `
59794
+ ${when(x => (x.filterMode !== FilterMode.none && x.filteredOptions.length === 0 && !x.loadingVisible), html `
59530
59795
  <span class="no-results-label ${x => x.positionAttribute}">
59531
59796
  ${x => filterNoResultsLabel.getValueFor(x)}
59532
59797
  </span>
59533
59798
  `)}
59799
+ ${when(x => x.loadingVisible, html `
59800
+ <div class="loading-container ${x => x.positionAttribute} ${x => (x.filteredOptions.length === 0 ? 'empty' : '')}"
59801
+ @click="${(x, c) => x.ignoreClickHandler(c.event)}">
59802
+ <span class="loading-label">
59803
+ ${x => loadingLabel.getValueFor(x)}
59804
+ </span>
59805
+ <${spinnerTag} class="loading-spinner" appearance="accent"></${spinnerTag}>
59806
+ </div>
59807
+ `)}
59534
59808
  </div>
59535
59809
  </div>
59536
59810
  </${anchoredRegionTag}>
@@ -59574,6 +59848,7 @@ img.ProseMirror-separator {
59574
59848
  this.errorVisible = false;
59575
59849
  this.filterMode = FilterMode.none;
59576
59850
  this.clearable = false;
59851
+ this.loadingVisible = false;
59577
59852
  /**
59578
59853
  * @internal
59579
59854
  */
@@ -59833,8 +60108,8 @@ img.ProseMirror-separator {
59833
60108
  /**
59834
60109
  * @internal
59835
60110
  */
59836
- inputClickHandler(e) {
59837
- e.stopPropagation(); // clicking in filter input shouldn't close dropdown
60111
+ ignoreClickHandler(e) {
60112
+ e.stopPropagation();
59838
60113
  }
59839
60114
  /**
59840
60115
  * @internal
@@ -59867,19 +60142,24 @@ img.ProseMirror-separator {
59867
60142
  */
59868
60143
  inputHandler(e) {
59869
60144
  this.filter = this.filterInput?.value ?? '';
59870
- this.filterOptions();
59871
- const enabledOptions = this.filteredOptions.filter(o => !o.disabled);
59872
- let activeOptionIndex = this.filter !== ''
59873
- ? this.openActiveIndex ?? this.selectedIndex
59874
- : this.selectedIndex;
59875
- if (enabledOptions.length > 0
59876
- && !enabledOptions.find(o => o === this.options[activeOptionIndex])) {
59877
- activeOptionIndex = this.options.indexOf(enabledOptions[0]);
60145
+ if (this.filterMode === FilterMode.standard) {
60146
+ this.filterOptions();
60147
+ const enabledOptions = this.filteredOptions.filter(o => !o.disabled);
60148
+ let activeOptionIndex = this.filter !== ''
60149
+ ? this.openActiveIndex ?? this.selectedIndex
60150
+ : this.selectedIndex;
60151
+ if (enabledOptions.length > 0
60152
+ && !enabledOptions.find(o => o === this.options[activeOptionIndex])) {
60153
+ activeOptionIndex = this.options.indexOf(enabledOptions[0]);
60154
+ }
60155
+ else if (enabledOptions.length === 0) {
60156
+ activeOptionIndex = -1;
60157
+ }
60158
+ this.setActiveOption(activeOptionIndex);
59878
60159
  }
59879
- else if (enabledOptions.length === 0) {
59880
- activeOptionIndex = -1;
60160
+ if (this.filterMode !== FilterMode.none) {
60161
+ this.emitFilterInputEvent();
59881
60162
  }
59882
- this.setActiveOption(activeOptionIndex);
59883
60163
  if (e.inputType.includes('deleteContent') || !this.filter.length) {
59884
60164
  return true;
59885
60165
  }
@@ -60152,6 +60432,9 @@ img.ProseMirror-separator {
60152
60432
  if (this.filterInput) {
60153
60433
  this.filterInput.value = '';
60154
60434
  }
60435
+ if (this.filterMode !== FilterMode.none) {
60436
+ this.emitFilterInputEvent();
60437
+ }
60155
60438
  this.ariaControls = '';
60156
60439
  this.ariaExpanded = 'false';
60157
60440
  }
@@ -60350,7 +60633,9 @@ img.ProseMirror-separator {
60350
60633
  if (option.hidden) {
60351
60634
  return true;
60352
60635
  }
60353
- return !this.filterMatchesText(option.text);
60636
+ return this.filterMode === FilterMode.standard
60637
+ ? !this.filterMatchesText(option.text)
60638
+ : false;
60354
60639
  }
60355
60640
  filterMatchesText(text) {
60356
60641
  const filter = this.filter.toLowerCase();
@@ -60449,6 +60734,12 @@ img.ProseMirror-separator {
60449
60734
  filterChanged() {
60450
60735
  this.filterOptions();
60451
60736
  }
60737
+ emitFilterInputEvent() {
60738
+ const eventDetail = {
60739
+ filterText: this.filter
60740
+ };
60741
+ this.$emit('filter-input', eventDetail, { bubbles: true });
60742
+ }
60452
60743
  maxHeightChanged() {
60453
60744
  this.updateListboxMaxHeightCssVariable();
60454
60745
  }
@@ -60483,6 +60774,9 @@ img.ProseMirror-separator {
60483
60774
  __decorate$1([
60484
60775
  attr({ attribute: 'clearable', mode: 'boolean' })
60485
60776
  ], Select.prototype, "clearable", void 0);
60777
+ __decorate$1([
60778
+ attr({ attribute: 'loading-visible', mode: 'boolean' })
60779
+ ], Select.prototype, "loadingVisible", void 0);
60486
60780
  __decorate$1([
60487
60781
  observable
60488
60782
  ], Select.prototype, "displayPlaceholder", void 0);
@@ -60525,7 +60819,7 @@ img.ProseMirror-separator {
60525
60819
  const nimbleSelect = Select.compose({
60526
60820
  baseName: 'select',
60527
60821
  baseClass: Select$2,
60528
- template: template$m,
60822
+ template: template$l,
60529
60823
  styles: styles$r,
60530
60824
  indicator: arrowExpanderDown16X16.data,
60531
60825
  end: html `
@@ -60539,229 +60833,6 @@ img.ProseMirror-separator {
60539
60833
  applyMixins(Select, StartEnd, DelegatesARIASelect);
60540
60834
  DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleSelect());
60541
60835
 
60542
- const styles$q = css `
60543
- ${display$1('inline-grid')}
60544
-
60545
- :host {
60546
- height: ${spinnerSmallHeight};
60547
- aspect-ratio: 1 / 1;
60548
- }
60549
-
60550
- div.overlay {
60551
- z-index: ${ZIndexLevels.zIndex1};
60552
- margin: max(2px, 6.25%);
60553
- grid-area: 1/1;
60554
- }
60555
-
60556
- div.container {
60557
- margin: max(2px, 6.25%);
60558
- grid-area: 1/1;
60559
- ${
60560
- /**
60561
- * At some spinner sizes / browser zoom levels, the spinner bits/squares appear to slightly overlap visually.
60562
- * If we set a color with transparency on each bit, it'll look wrong in the overlapping region (since the opacity
60563
- * combines and affects the color at the overlapping spot).
60564
- * Currently all 3 themes use a color with opacity = 0.6, so that's applied here on the parent element instead,
60565
- * which avoids that issue.
60566
- */
60567
- ''}
60568
- opacity: 0.6;
60569
- }
60570
-
60571
- :host([appearance='accent']) div.container {
60572
- opacity: 1;
60573
- }
60574
-
60575
- div.bit1,
60576
- div.bit2 {
60577
- background: var(--ni-private-spinner-bits-background-color);
60578
- width: 50%;
60579
- height: 50%;
60580
- margin: auto;
60581
- animation-duration: 1600ms;
60582
- animation-iteration-count: infinite;
60583
- animation-play-state: var(
60584
- --ni-private-spinner-animation-play-state,
60585
- running
60586
- );
60587
- animation-timing-function: cubic-bezier(0.65, 0, 0.35, 0);
60588
- }
60589
-
60590
- div.bit1 {
60591
- animation-name: ni-private-spinner-keyframes-1;
60592
- }
60593
-
60594
- div.bit2 {
60595
- animation-name: ni-private-spinner-keyframes-2;
60596
- }
60597
-
60598
- @media (prefers-reduced-motion) {
60599
- div.bit1,
60600
- div.bit2 {
60601
- animation-timing-function: ease-in-out, steps(1);
60602
- animation-duration: 3200ms;
60603
- }
60604
-
60605
- div.bit1 {
60606
- animation-name: ni-private-spinner-no-motion-opacity-keyframes,
60607
- ni-private-spinner-no-motion-transform-keyframes-1;
60608
- }
60609
-
60610
- div.bit2 {
60611
- animation-name: ni-private-spinner-no-motion-opacity-keyframes,
60612
- ni-private-spinner-no-motion-transform-keyframes-2;
60613
- }
60614
- }
60615
-
60616
- @keyframes ni-private-spinner-keyframes-1 {
60617
- 0%,
60618
- 100% {
60619
- transform: translate(-50%, 0);
60620
- }
60621
-
60622
- 25% {
60623
- transform: translate(50%, 0);
60624
- }
60625
-
60626
- 50% {
60627
- transform: translate(50%, 100%);
60628
- }
60629
-
60630
- 75% {
60631
- transform: translate(-50%, 100%);
60632
- }
60633
- }
60634
-
60635
- @keyframes ni-private-spinner-keyframes-2 {
60636
- 0%,
60637
- 100% {
60638
- transform: translate(50%, 0);
60639
- }
60640
-
60641
- 25% {
60642
- transform: translate(-50%, 0);
60643
- }
60644
-
60645
- 50% {
60646
- transform: translate(-50%, -100%);
60647
- }
60648
-
60649
- 75% {
60650
- transform: translate(50%, -100%);
60651
- }
60652
- }
60653
-
60654
- @keyframes ni-private-spinner-no-motion-opacity-keyframes {
60655
- 0%,
60656
- 50%,
60657
- 100% {
60658
- opacity: 0;
60659
- }
60660
-
60661
- 25%,
60662
- 75% {
60663
- opacity: 1;
60664
- }
60665
- }
60666
-
60667
- @keyframes ni-private-spinner-no-motion-transform-keyframes-1 {
60668
- 0%,
60669
- 100% {
60670
- transform: translate(-50%, 0);
60671
- }
60672
- 50% {
60673
- transform: translate(50%, 0);
60674
- }
60675
- }
60676
-
60677
- @keyframes ni-private-spinner-no-motion-transform-keyframes-2 {
60678
- 0%,
60679
- 100% {
60680
- transform: translate(50%, 0);
60681
- }
60682
-
60683
- 50% {
60684
- transform: translate(-50%, 0);
60685
- }
60686
- }
60687
- `.withBehaviors(themeBehavior(Theme.light, css `
60688
- :host {
60689
- --ni-private-spinner-bits-background-color: ${Black91};
60690
- }
60691
- :host([appearance='accent']) {
60692
- --ni-private-spinner-bits-background-color: ${DigitalGreenLight};
60693
- }
60694
- `), themeBehavior(Theme.dark, css `
60695
- :host {
60696
- --ni-private-spinner-bits-background-color: ${Black15};
60697
- }
60698
- :host([appearance='accent']) {
60699
- --ni-private-spinner-bits-background-color: ${PowerGreen};
60700
- }
60701
- `), themeBehavior(Theme.color, css `
60702
- :host {
60703
- --ni-private-spinner-bits-background-color: ${White};
60704
- }
60705
- :host([appearance='accent']) {
60706
- --ni-private-spinner-bits-background-color: ${PowerGreen};
60707
- }
60708
- `));
60709
-
60710
- /* eslint-disable @typescript-eslint/indent */
60711
- // prettier-ignore
60712
- const template$l = html `
60713
- <template role="progressbar">
60714
- ${''
60715
- /**
60716
- * In Firefox, the 'title' set on the spinner is very finicky when
60717
- * the spinner is animating. Therefore, put a transparent overlay on
60718
- * top of the spinning bits so that the title displays as expected.
60719
- */
60720
- }
60721
- <div class="overlay"></div>
60722
-
60723
- <div class="container">
60724
- <div class="bit1"></div>
60725
- <div class="bit2"></div>
60726
- </div>
60727
- </template>
60728
- `;
60729
-
60730
- /**
60731
- * Types of spinner appearance.
60732
- * @public
60733
- */
60734
- const SpinnerAppearance = {
60735
- default: undefined,
60736
- accent: 'accent'
60737
- };
60738
-
60739
- /**
60740
- * A Nimble-styled spinner component.
60741
- * A spinner is an animating indicator that can be placed in a particular region of a page to represent loading progress, or an ongoing operation, of an indeterminate / unknown duration.
60742
- */
60743
- class Spinner extends FoundationElement {
60744
- constructor() {
60745
- super(...arguments);
60746
- /**
60747
- * @public
60748
- * @description
60749
- * The appearance the spinner area should have.
60750
- */
60751
- this.appearance = SpinnerAppearance.default;
60752
- }
60753
- }
60754
- __decorate$1([
60755
- attr
60756
- ], Spinner.prototype, "appearance", void 0);
60757
- const nimbleSpinner = Spinner.compose({
60758
- baseName: 'spinner',
60759
- template: template$l,
60760
- styles: styles$q
60761
- });
60762
- DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleSpinner());
60763
- const spinnerTag = 'nimble-spinner';
60764
-
60765
60836
  const styles$p = css `
60766
60837
  ${display$1('inline-flex')}
60767
60838