@ni/spright-components 6.2.1 → 6.3.1

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.
@@ -6781,20 +6781,6 @@
6781
6781
  ], BreadcrumbItem$1.prototype, "separator", void 0);
6782
6782
  applyMixins(BreadcrumbItem$1, StartEnd, DelegatesARIALink);
6783
6783
 
6784
- /**
6785
- * The template for the {@link @ni/fast-foundation#Breadcrumb} component.
6786
- * @public
6787
- */
6788
- const breadcrumbTemplate = (context, definition) => html `
6789
- <template role="navigation">
6790
- <div role="list" class="list" part="list">
6791
- <slot
6792
- ${slotted({ property: "slottedBreadcrumbItems", filter: elements() })}
6793
- ></slot>
6794
- </div>
6795
- </template>
6796
- `;
6797
-
6798
6784
  /**
6799
6785
  * A Breadcrumb Custom HTML Element.
6800
6786
  * @slot - The default slot for the breadcrumb items
@@ -19749,12 +19735,71 @@
19749
19735
  });
19750
19736
  DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleBanner());
19751
19737
 
19738
+ /**
19739
+ * The template for the {@link @ni/fast-foundation#Breadcrumb} component.
19740
+ * @public
19741
+ */
19742
+ // prettier-ignore
19743
+ const breadcrumbTemplate = (_context, _definition) => html `
19744
+ <template role="navigation">
19745
+ ${when(x => x.showScrollButtons, html `
19746
+ <${buttonTag}
19747
+ content-hidden
19748
+ class="scroll-button left"
19749
+ appearance="${ButtonAppearance.ghost}"
19750
+ @click="${x => x.onScrollLeftClick()}"
19751
+ ${ref('leftScrollButton')}
19752
+ >
19753
+ ${x => scrollForwardLabel.getValueFor(x)}
19754
+ <${iconArrowExpanderLeftTag} slot="start"></${iconArrowExpanderLeftTag}>
19755
+ </${buttonTag}>
19756
+ `)}
19757
+ <div ${ref('list')} role="list" class="list" part="list" tabindex="-1">
19758
+ <slot
19759
+ ${slotted({ property: 'slottedBreadcrumbItems', filter: elements() })}
19760
+ ></slot>
19761
+ </div>
19762
+ ${when(x => x.showScrollButtons, html `
19763
+ <${buttonTag}
19764
+ content-hidden
19765
+ class="scroll-button right"
19766
+ appearance="${ButtonAppearance.ghost}"
19767
+ @click="${x => x.onScrollRightClick()}"
19768
+ >
19769
+ ${x => scrollBackwardLabel.getValueFor(x)}
19770
+ <${iconArrowExpanderRightTag} slot="start"></${iconArrowExpanderRightTag}>
19771
+ </${buttonTag}>
19772
+ `)}
19773
+ </template>
19774
+ `;
19775
+
19752
19776
  const styles$V = css `
19753
- ${display$1('inline-block')}
19777
+ ${display$1('inline-flex')}
19778
+
19779
+ :host {
19780
+ flex-direction: row;
19781
+ }
19782
+
19783
+ .scroll-button.left {
19784
+ margin-right: ${smallPadding};
19785
+ }
19754
19786
 
19755
19787
  .list {
19756
- display: flex;
19757
- flex-wrap: wrap;
19788
+ display: inline-flex;
19789
+ max-width: 100%;
19790
+ width: max-content;
19791
+ align-self: end;
19792
+ overflow-x: scroll;
19793
+ scrollbar-width: none;
19794
+ }
19795
+
19796
+ .scroll-button.right {
19797
+ margin-left: ${smallPadding};
19798
+ }
19799
+
19800
+ ::slotted(*) {
19801
+ flex-shrink: 0;
19802
+ white-space: nowrap;
19758
19803
  }
19759
19804
 
19760
19805
  ::slotted(:last-child) {
@@ -19771,10 +19816,63 @@
19771
19816
  * A nimble-styled breadcrumb
19772
19817
  */
19773
19818
  class Breadcrumb extends Breadcrumb$1 {
19819
+ constructor() {
19820
+ super();
19821
+ /**
19822
+ * @internal
19823
+ */
19824
+ this.showScrollButtons = false;
19825
+ this.listResizeObserver = new ResizeObserver(entries => {
19826
+ let listVisibleWidth = entries[0]?.contentRect.width;
19827
+ if (listVisibleWidth !== undefined) {
19828
+ const buttonWidth = this.leftScrollButton?.clientWidth ?? 0;
19829
+ listVisibleWidth = Math.ceil(listVisibleWidth);
19830
+ if (this.showScrollButtons) {
19831
+ listVisibleWidth += buttonWidth * 2;
19832
+ }
19833
+ this.showScrollButtons = listVisibleWidth < this.list.scrollWidth;
19834
+ }
19835
+ });
19836
+ }
19837
+ /**
19838
+ * @internal
19839
+ */
19840
+ onScrollLeftClick() {
19841
+ this.list.scrollBy({
19842
+ left: -this.list.clientWidth,
19843
+ behavior: 'smooth'
19844
+ });
19845
+ }
19846
+ /**
19847
+ * @internal
19848
+ */
19849
+ onScrollRightClick() {
19850
+ this.list.scrollBy({
19851
+ left: this.list.clientWidth,
19852
+ behavior: 'smooth'
19853
+ });
19854
+ }
19855
+ /**
19856
+ * @internal
19857
+ */
19858
+ connectedCallback() {
19859
+ super.connectedCallback();
19860
+ this.listResizeObserver.observe(this.list);
19861
+ }
19862
+ /**
19863
+ * @internal
19864
+ */
19865
+ disconnectedCallback() {
19866
+ super.disconnectedCallback();
19867
+ this.listResizeObserver.disconnect();
19868
+ }
19774
19869
  }
19775
19870
  __decorate([
19776
19871
  attr
19777
19872
  ], Breadcrumb.prototype, "appearance", void 0);
19873
+ __decorate([
19874
+ observable
19875
+ ], Breadcrumb.prototype, "showScrollButtons", void 0);
19778
19876
  const nimbleBreadcrumb = Breadcrumb.compose({
19779
19877
  baseName: 'breadcrumb',
19780
19878
  baseClass: Breadcrumb$1,
@@ -93780,6 +93878,11 @@ focus outline in that case.
93780
93878
  border: ${borderWidth} solid ${applicationBackgroundColor};
93781
93879
  }
93782
93880
 
93881
+ :host([appearance='overlay']) {
93882
+ background: none;
93883
+ border-color: transparent;
93884
+ }
93885
+
93783
93886
  .messages {
93784
93887
  flex: 1;
93785
93888
  display: flex;
@@ -93792,6 +93895,10 @@ focus outline in that case.
93792
93895
  overflow-y: auto;
93793
93896
  }
93794
93897
 
93898
+ :host([appearance='overlay']) .messages {
93899
+ background: none;
93900
+ }
93901
+
93795
93902
  .input {
93796
93903
  padding: ${borderWidth} ${standardPadding} ${standardPadding}
93797
93904
  ${standardPadding};
@@ -93813,12 +93920,20 @@ focus outline in that case.
93813
93920
  `;
93814
93921
  /* eslint-enable @typescript-eslint/indent */
93815
93922
 
93923
+ /**
93924
+ * Appearances of chat conversation.
93925
+ * @public
93926
+ */
93927
+ const ChatConversationAppearance = {
93928
+ default: undefined};
93929
+
93816
93930
  /**
93817
93931
  * A Spright component for displaying a series of chat messages
93818
93932
  */
93819
93933
  class ChatConversation extends FoundationElement {
93820
93934
  constructor() {
93821
93935
  super(...arguments);
93936
+ this.appearance = ChatConversationAppearance.default;
93822
93937
  /** @internal */
93823
93938
  this.inputEmpty = true;
93824
93939
  }
@@ -93826,6 +93941,9 @@ focus outline in that case.
93826
93941
  this.inputEmpty = !next?.length;
93827
93942
  }
93828
93943
  }
93944
+ __decorate([
93945
+ attr
93946
+ ], ChatConversation.prototype, "appearance", void 0);
93829
93947
  __decorate([
93830
93948
  observable
93831
93949
  ], ChatConversation.prototype, "inputEmpty", void 0);