@ni/spright-components 1.0.21 → 1.0.23

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 22:32:36 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
@@ -25014,9 +25024,18 @@
25014
25024
  }
25015
25025
  connectedCallback() {
25016
25026
  super.connectedCallback();
25017
- if (this.isListOptionOwner(this.parentElement)) {
25018
- this.parentElement.registerOption(this);
25027
+ const owner = this.getListOptionOwner();
25028
+ owner?.registerOption(this);
25029
+ }
25030
+ getListOptionOwner() {
25031
+ let parent = this.parentElement;
25032
+ while (parent) {
25033
+ if (this.isListOptionOwner(parent)) {
25034
+ return parent;
25035
+ }
25036
+ parent = parent.parentElement;
25019
25037
  }
25038
+ return undefined;
25020
25039
  }
25021
25040
  isListOptionOwner(parent) {
25022
25041
  if (!parent) {
@@ -59399,6 +59418,37 @@ img.ProseMirror-separator {
59399
59418
  align-items: center;
59400
59419
  padding: ${smallPadding} ${mediumPadding};
59401
59420
  }
59421
+
59422
+ .loading-container {
59423
+ padding-left: ${mediumPadding};
59424
+ padding-right: ${mediumPadding};
59425
+ display: flex;
59426
+ height: ${controlHeight};
59427
+ flex: 1 0 auto;
59428
+ }
59429
+
59430
+ .loading-container.above {
59431
+ align-items: end;
59432
+ padding-bottom: ${smallPadding};
59433
+ }
59434
+
59435
+ .loading-container.below {
59436
+ align-items: normal;
59437
+ padding-top: ${smallPadding};
59438
+ }
59439
+
59440
+ .loading-container.empty {
59441
+ padding: ${smallPadding} ${mediumPadding};
59442
+ align-items: center;
59443
+ }
59444
+
59445
+ .loading-label {
59446
+ color: ${placeholderFontColor};
59447
+ }
59448
+
59449
+ .loading-spinner {
59450
+ margin-left: auto;
59451
+ }
59402
59452
  `.withBehaviors(appearanceBehavior(DropdownAppearance.block, css `
59403
59453
  :host([error-visible]) .control {
59404
59454
  border-bottom-width: ${borderWidth};
@@ -59406,11 +59456,235 @@ img.ProseMirror-separator {
59406
59456
  }
59407
59457
  `), themeBehavior(Theme.color, css `
59408
59458
  .filter-field,
59409
- .no-results-label {
59459
+ .no-results-label,
59460
+ .loading-container {
59410
59461
  background: ${hexToRgbaCssColor(White, 0.15)};
59411
59462
  }
59412
59463
  `));
59413
59464
 
59465
+ const styles$q = css `
59466
+ ${display$1('inline-grid')}
59467
+
59468
+ :host {
59469
+ height: ${spinnerSmallHeight};
59470
+ aspect-ratio: 1 / 1;
59471
+ }
59472
+
59473
+ div.overlay {
59474
+ z-index: ${ZIndexLevels.zIndex1};
59475
+ margin: max(2px, 6.25%);
59476
+ grid-area: 1/1;
59477
+ }
59478
+
59479
+ div.container {
59480
+ margin: max(2px, 6.25%);
59481
+ grid-area: 1/1;
59482
+ ${
59483
+ /**
59484
+ * At some spinner sizes / browser zoom levels, the spinner bits/squares appear to slightly overlap visually.
59485
+ * If we set a color with transparency on each bit, it'll look wrong in the overlapping region (since the opacity
59486
+ * combines and affects the color at the overlapping spot).
59487
+ * Currently all 3 themes use a color with opacity = 0.6, so that's applied here on the parent element instead,
59488
+ * which avoids that issue.
59489
+ */
59490
+ ''}
59491
+ opacity: 0.6;
59492
+ }
59493
+
59494
+ :host([appearance='accent']) div.container {
59495
+ opacity: 1;
59496
+ }
59497
+
59498
+ div.bit1,
59499
+ div.bit2 {
59500
+ background: var(--ni-private-spinner-bits-background-color);
59501
+ width: 50%;
59502
+ height: 50%;
59503
+ margin: auto;
59504
+ animation-duration: 1600ms;
59505
+ animation-iteration-count: infinite;
59506
+ animation-play-state: var(
59507
+ --ni-private-spinner-animation-play-state,
59508
+ running
59509
+ );
59510
+ animation-timing-function: cubic-bezier(0.65, 0, 0.35, 0);
59511
+ }
59512
+
59513
+ div.bit1 {
59514
+ animation-name: ni-private-spinner-keyframes-1;
59515
+ }
59516
+
59517
+ div.bit2 {
59518
+ animation-name: ni-private-spinner-keyframes-2;
59519
+ }
59520
+
59521
+ @media (prefers-reduced-motion) {
59522
+ div.bit1,
59523
+ div.bit2 {
59524
+ animation-timing-function: ease-in-out, steps(1);
59525
+ animation-duration: 3200ms;
59526
+ }
59527
+
59528
+ div.bit1 {
59529
+ animation-name: ni-private-spinner-no-motion-opacity-keyframes,
59530
+ ni-private-spinner-no-motion-transform-keyframes-1;
59531
+ }
59532
+
59533
+ div.bit2 {
59534
+ animation-name: ni-private-spinner-no-motion-opacity-keyframes,
59535
+ ni-private-spinner-no-motion-transform-keyframes-2;
59536
+ }
59537
+ }
59538
+
59539
+ @keyframes ni-private-spinner-keyframes-1 {
59540
+ 0%,
59541
+ 100% {
59542
+ transform: translate(-50%, 0);
59543
+ }
59544
+
59545
+ 25% {
59546
+ transform: translate(50%, 0);
59547
+ }
59548
+
59549
+ 50% {
59550
+ transform: translate(50%, 100%);
59551
+ }
59552
+
59553
+ 75% {
59554
+ transform: translate(-50%, 100%);
59555
+ }
59556
+ }
59557
+
59558
+ @keyframes ni-private-spinner-keyframes-2 {
59559
+ 0%,
59560
+ 100% {
59561
+ transform: translate(50%, 0);
59562
+ }
59563
+
59564
+ 25% {
59565
+ transform: translate(-50%, 0);
59566
+ }
59567
+
59568
+ 50% {
59569
+ transform: translate(-50%, -100%);
59570
+ }
59571
+
59572
+ 75% {
59573
+ transform: translate(50%, -100%);
59574
+ }
59575
+ }
59576
+
59577
+ @keyframes ni-private-spinner-no-motion-opacity-keyframes {
59578
+ 0%,
59579
+ 50%,
59580
+ 100% {
59581
+ opacity: 0;
59582
+ }
59583
+
59584
+ 25%,
59585
+ 75% {
59586
+ opacity: 1;
59587
+ }
59588
+ }
59589
+
59590
+ @keyframes ni-private-spinner-no-motion-transform-keyframes-1 {
59591
+ 0%,
59592
+ 100% {
59593
+ transform: translate(-50%, 0);
59594
+ }
59595
+ 50% {
59596
+ transform: translate(50%, 0);
59597
+ }
59598
+ }
59599
+
59600
+ @keyframes ni-private-spinner-no-motion-transform-keyframes-2 {
59601
+ 0%,
59602
+ 100% {
59603
+ transform: translate(50%, 0);
59604
+ }
59605
+
59606
+ 50% {
59607
+ transform: translate(-50%, 0);
59608
+ }
59609
+ }
59610
+ `.withBehaviors(themeBehavior(Theme.light, css `
59611
+ :host {
59612
+ --ni-private-spinner-bits-background-color: ${Black91};
59613
+ }
59614
+ :host([appearance='accent']) {
59615
+ --ni-private-spinner-bits-background-color: ${DigitalGreenLight};
59616
+ }
59617
+ `), themeBehavior(Theme.dark, css `
59618
+ :host {
59619
+ --ni-private-spinner-bits-background-color: ${Black15};
59620
+ }
59621
+ :host([appearance='accent']) {
59622
+ --ni-private-spinner-bits-background-color: ${PowerGreen};
59623
+ }
59624
+ `), themeBehavior(Theme.color, css `
59625
+ :host {
59626
+ --ni-private-spinner-bits-background-color: ${White};
59627
+ }
59628
+ :host([appearance='accent']) {
59629
+ --ni-private-spinner-bits-background-color: ${PowerGreen};
59630
+ }
59631
+ `));
59632
+
59633
+ /* eslint-disable @typescript-eslint/indent */
59634
+ // prettier-ignore
59635
+ const template$m = html `
59636
+ <template role="progressbar">
59637
+ ${''
59638
+ /**
59639
+ * In Firefox, the 'title' set on the spinner is very finicky when
59640
+ * the spinner is animating. Therefore, put a transparent overlay on
59641
+ * top of the spinning bits so that the title displays as expected.
59642
+ */
59643
+ }
59644
+ <div class="overlay"></div>
59645
+
59646
+ <div class="container">
59647
+ <div class="bit1"></div>
59648
+ <div class="bit2"></div>
59649
+ </div>
59650
+ </template>
59651
+ `;
59652
+
59653
+ /**
59654
+ * Types of spinner appearance.
59655
+ * @public
59656
+ */
59657
+ const SpinnerAppearance = {
59658
+ default: undefined,
59659
+ accent: 'accent'
59660
+ };
59661
+
59662
+ /**
59663
+ * A Nimble-styled spinner component.
59664
+ * 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.
59665
+ */
59666
+ class Spinner extends FoundationElement {
59667
+ constructor() {
59668
+ super(...arguments);
59669
+ /**
59670
+ * @public
59671
+ * @description
59672
+ * The appearance the spinner area should have.
59673
+ */
59674
+ this.appearance = SpinnerAppearance.default;
59675
+ }
59676
+ }
59677
+ __decorate$1([
59678
+ attr
59679
+ ], Spinner.prototype, "appearance", void 0);
59680
+ const nimbleSpinner = Spinner.compose({
59681
+ baseName: 'spinner',
59682
+ template: template$m,
59683
+ styles: styles$q
59684
+ });
59685
+ DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleSpinner());
59686
+ const spinnerTag = 'nimble-spinner';
59687
+
59414
59688
  const isListOption = (el) => {
59415
59689
  return el instanceof ListOption;
59416
59690
  };
@@ -59419,7 +59693,7 @@ img.ProseMirror-separator {
59419
59693
  };
59420
59694
  /* eslint-disable @typescript-eslint/indent */
59421
59695
  // prettier-ignore
59422
- const template$m = (context, definition) => html `
59696
+ const template$l = (context, definition) => html `
59423
59697
  <template
59424
59698
  class="${x => [
59425
59699
  x.collapsible && 'collapsible',
@@ -59509,7 +59783,7 @@ img.ProseMirror-separator {
59509
59783
  aria-controls="${x => x.ariaControls}"
59510
59784
  aria-activedescendant="${x => x.ariaActiveDescendant}"
59511
59785
  @input="${(x, c) => x.inputHandler(c.event)}"
59512
- @click="${(x, c) => x.inputClickHandler(c.event)}"
59786
+ @click="${(x, c) => x.ignoreClickHandler(c.event)}"
59513
59787
  placeholder="${x => filterSearchLabel.getValueFor(x)}"
59514
59788
  value="${x => x.filter}"
59515
59789
  />
@@ -59526,11 +59800,20 @@ img.ProseMirror-separator {
59526
59800
  })}
59527
59801
  ></slot>
59528
59802
  </div>
59529
- ${when(x => (x.filterMode !== FilterMode.none && x.filteredOptions.length === 0), html `
59803
+ ${when(x => (x.filterMode !== FilterMode.none && x.filteredOptions.length === 0 && !x.loadingVisible), html `
59530
59804
  <span class="no-results-label ${x => x.positionAttribute}">
59531
59805
  ${x => filterNoResultsLabel.getValueFor(x)}
59532
59806
  </span>
59533
59807
  `)}
59808
+ ${when(x => x.loadingVisible, html `
59809
+ <div class="loading-container ${x => x.positionAttribute} ${x => (x.filteredOptions.length === 0 ? 'empty' : '')}"
59810
+ @click="${(x, c) => x.ignoreClickHandler(c.event)}">
59811
+ <span class="loading-label">
59812
+ ${x => loadingLabel.getValueFor(x)}
59813
+ </span>
59814
+ <${spinnerTag} class="loading-spinner" appearance="accent"></${spinnerTag}>
59815
+ </div>
59816
+ `)}
59534
59817
  </div>
59535
59818
  </div>
59536
59819
  </${anchoredRegionTag}>
@@ -59574,6 +59857,7 @@ img.ProseMirror-separator {
59574
59857
  this.errorVisible = false;
59575
59858
  this.filterMode = FilterMode.none;
59576
59859
  this.clearable = false;
59860
+ this.loadingVisible = false;
59577
59861
  /**
59578
59862
  * @internal
59579
59863
  */
@@ -59833,8 +60117,8 @@ img.ProseMirror-separator {
59833
60117
  /**
59834
60118
  * @internal
59835
60119
  */
59836
- inputClickHandler(e) {
59837
- e.stopPropagation(); // clicking in filter input shouldn't close dropdown
60120
+ ignoreClickHandler(e) {
60121
+ e.stopPropagation();
59838
60122
  }
59839
60123
  /**
59840
60124
  * @internal
@@ -59867,19 +60151,24 @@ img.ProseMirror-separator {
59867
60151
  */
59868
60152
  inputHandler(e) {
59869
60153
  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]);
60154
+ if (this.filterMode === FilterMode.standard) {
60155
+ this.filterOptions();
60156
+ const enabledOptions = this.filteredOptions.filter(o => !o.disabled);
60157
+ let activeOptionIndex = this.filter !== ''
60158
+ ? this.openActiveIndex ?? this.selectedIndex
60159
+ : this.selectedIndex;
60160
+ if (enabledOptions.length > 0
60161
+ && !enabledOptions.find(o => o === this.options[activeOptionIndex])) {
60162
+ activeOptionIndex = this.options.indexOf(enabledOptions[0]);
60163
+ }
60164
+ else if (enabledOptions.length === 0) {
60165
+ activeOptionIndex = -1;
60166
+ }
60167
+ this.setActiveOption(activeOptionIndex);
59878
60168
  }
59879
- else if (enabledOptions.length === 0) {
59880
- activeOptionIndex = -1;
60169
+ if (this.filterMode !== FilterMode.none) {
60170
+ this.emitFilterInputEvent();
59881
60171
  }
59882
- this.setActiveOption(activeOptionIndex);
59883
60172
  if (e.inputType.includes('deleteContent') || !this.filter.length) {
59884
60173
  return true;
59885
60174
  }
@@ -60152,6 +60441,9 @@ img.ProseMirror-separator {
60152
60441
  if (this.filterInput) {
60153
60442
  this.filterInput.value = '';
60154
60443
  }
60444
+ if (this.filterMode !== FilterMode.none) {
60445
+ this.emitFilterInputEvent();
60446
+ }
60155
60447
  this.ariaControls = '';
60156
60448
  this.ariaExpanded = 'false';
60157
60449
  }
@@ -60350,7 +60642,9 @@ img.ProseMirror-separator {
60350
60642
  if (option.hidden) {
60351
60643
  return true;
60352
60644
  }
60353
- return !this.filterMatchesText(option.text);
60645
+ return this.filterMode === FilterMode.standard
60646
+ ? !this.filterMatchesText(option.text)
60647
+ : false;
60354
60648
  }
60355
60649
  filterMatchesText(text) {
60356
60650
  const filter = this.filter.toLowerCase();
@@ -60449,6 +60743,12 @@ img.ProseMirror-separator {
60449
60743
  filterChanged() {
60450
60744
  this.filterOptions();
60451
60745
  }
60746
+ emitFilterInputEvent() {
60747
+ const eventDetail = {
60748
+ filterText: this.filter
60749
+ };
60750
+ this.$emit('filter-input', eventDetail, { bubbles: true });
60751
+ }
60452
60752
  maxHeightChanged() {
60453
60753
  this.updateListboxMaxHeightCssVariable();
60454
60754
  }
@@ -60483,6 +60783,9 @@ img.ProseMirror-separator {
60483
60783
  __decorate$1([
60484
60784
  attr({ attribute: 'clearable', mode: 'boolean' })
60485
60785
  ], Select.prototype, "clearable", void 0);
60786
+ __decorate$1([
60787
+ attr({ attribute: 'loading-visible', mode: 'boolean' })
60788
+ ], Select.prototype, "loadingVisible", void 0);
60486
60789
  __decorate$1([
60487
60790
  observable
60488
60791
  ], Select.prototype, "displayPlaceholder", void 0);
@@ -60525,7 +60828,7 @@ img.ProseMirror-separator {
60525
60828
  const nimbleSelect = Select.compose({
60526
60829
  baseName: 'select',
60527
60830
  baseClass: Select$2,
60528
- template: template$m,
60831
+ template: template$l,
60529
60832
  styles: styles$r,
60530
60833
  indicator: arrowExpanderDown16X16.data,
60531
60834
  end: html `
@@ -60539,229 +60842,6 @@ img.ProseMirror-separator {
60539
60842
  applyMixins(Select, StartEnd, DelegatesARIASelect);
60540
60843
  DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleSelect());
60541
60844
 
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
60845
  const styles$p = css `
60766
60846
  ${display$1('inline-flex')}
60767
60847