@ni/spright-components 6.16.0 → 6.17.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.
@@ -14764,6 +14764,7 @@
14764
14764
  const tokenNames = {
14765
14765
  actionRgbPartialColor: 'action-rgb-partial-color',
14766
14766
  applicationBackgroundColor: 'application-background-color',
14767
+ containerBackgroundColor: 'container-background-color',
14767
14768
  dividerBackgroundColor: 'divider-background-color',
14768
14769
  dividerBackgroundDynamicColor: 'divider-background-dynamic-color',
14769
14770
  headerBackgroundColor: 'header-background-color',
@@ -16301,6 +16302,7 @@
16301
16302
  const tokenValues = {
16302
16303
  actionRgbPartialColor: hexToRgbPartialThemeColor(createThemeColor(Black91, Black15, White)),
16303
16304
  applicationBackgroundColor: createThemeColor(White, Black85, ForestGreen),
16305
+ containerBackgroundColor: hexToRgbaCssThemeColor(createThemeColor(Black91, Black15, White), 0.07, 0.1, 0.1),
16304
16306
  headerBackgroundColor: createThemeColor(Black7, Black88, ForestGreen),
16305
16307
  sectionBackgroundColor: createThemeColor(Black15, Black80, ForestGreen),
16306
16308
  sectionBackgroundImage: createThemeColor(`linear-gradient(${Black15}, ${hexToRgbaCssColor(Black15, 0)})`, `linear-gradient(${Black82}, ${hexToRgbaCssColor(Black82, 0)})`, `linear-gradient(${ForestGreen}, ${hexToRgbaCssColor(ForestGreen, 0)})`),
@@ -16474,6 +16476,7 @@
16474
16476
  // #region color tokens
16475
16477
  const actionRgbPartialColor = createThemeColorToken(tokenNames.actionRgbPartialColor, tokenValues.actionRgbPartialColor);
16476
16478
  const applicationBackgroundColor = createThemeColorToken(tokenNames.applicationBackgroundColor, tokenValues.applicationBackgroundColor);
16479
+ createThemeColorToken(tokenNames.containerBackgroundColor, tokenValues.containerBackgroundColor);
16477
16480
  createThemeColorToken(tokenNames.headerBackgroundColor, tokenValues.headerBackgroundColor);
16478
16481
  createThemeColorToken(tokenNames.sectionBackgroundColor, tokenValues.sectionBackgroundColor);
16479
16482
  const sectionBackgroundImage = createThemeColorToken(tokenNames.sectionBackgroundImage, tokenValues.sectionBackgroundImage);
@@ -98696,10 +98699,57 @@ focus outline in that case.
98696
98699
  width: 80px;
98697
98700
  margin: ${mediumPadding};
98698
98701
  }
98702
+
98703
+ .attachments {
98704
+ display: none;
98705
+ }
98706
+
98707
+ .attachments.has-content {
98708
+ display: flex;
98709
+ flex-wrap: wrap;
98710
+ gap: ${mediumPadding};
98711
+ padding: ${mediumPadding};
98712
+ max-height: calc(${controlSlimHeight} * 3 + ${mediumPadding} * 4 );
98713
+ overflow-y: auto;
98714
+ }
98715
+
98716
+ .attachments ::slotted(*) {
98717
+ height: ${controlSlimHeight};
98718
+ }
98719
+
98720
+ .footer {
98721
+ display: flex;
98722
+ flex-direction: row;
98723
+ align-items: flex-end;
98724
+ justify-content: flex-end;
98725
+ }
98726
+
98727
+ .footer-actions {
98728
+ display: none;
98729
+ flex: 1;
98730
+ }
98731
+
98732
+ .footer-actions.has-content {
98733
+ display: flex;
98734
+ align-items: center;
98735
+ flex-wrap: wrap;
98736
+ column-gap: ${mediumPadding};
98737
+ margin: ${mediumPadding};
98738
+ }
98739
+
98740
+ .footer-actions ::slotted(*) {
98741
+ height: ${controlSlimHeight};
98742
+ }
98699
98743
  `;
98700
98744
 
98701
98745
  const template$7 = html `
98702
98746
  <div class="container">
98747
+ <section class="attachments ${x => (x.attachmentsIsEmpty ? '' : 'has-content')}">
98748
+ <slot
98749
+ name="attachments"
98750
+ ${slotted({ property: 'slottedAttachmentsElements' })}
98751
+ ></slot>
98752
+ </section>
98703
98753
  <textarea
98704
98754
  ${ref('textArea')}
98705
98755
  placeholder="${x => x.placeholder}"
@@ -98709,19 +98759,27 @@ focus outline in that case.
98709
98759
  @keydown="${(x, c) => x.textAreaKeydownHandler(c.event)}"
98710
98760
  @input="${x => x.textAreaInputHandler()}"
98711
98761
  ></textarea>
98712
- <${buttonTag}
98713
- class="action-button"
98714
- appearance="block"
98715
- appearance-variant="${x => (x.processing ? 'primary' : 'accent')}"
98716
- ?disabled=${x => (x.processing ? false : (x.sendDisabled || x.isInputEmpty))}
98717
- @click=${x => (x.processing ? x.stopButtonClickHandler() : x.sendButtonClickHandler())}
98718
- tabindex="${x => x.tabIndex}"
98719
- title=${x => (x.processing ? x.stopButtonLabel : x.sendButtonLabel)}
98720
- content-hidden
98721
- >
98722
- ${x => (x.processing ? x.stopButtonLabel : x.sendButtonLabel)}
98723
- ${when(x => x.processing, html `<${iconStopSquareTag} slot="start"></${iconStopSquareTag}>`, html `<${iconPaperPlaneTag} slot="start"></${iconPaperPlaneTag}>`)}
98724
- </${buttonTag}>
98762
+ <section class="footer">
98763
+ <section class="footer-actions ${x => (x.footerActionsIsEmpty ? '' : 'has-content')}">
98764
+ <slot
98765
+ name="footer-actions"
98766
+ ${slotted({ property: 'slottedFooterActionsElements' })}
98767
+ ></slot>
98768
+ </section>
98769
+ <${buttonTag}
98770
+ class="action-button"
98771
+ appearance="block"
98772
+ appearance-variant="${x => (x.processing ? 'primary' : 'accent')}"
98773
+ ?disabled=${x => (x.processing ? false : (x.sendDisabled || x.isInputEmpty))}
98774
+ @click=${x => (x.processing ? x.stopButtonClickHandler() : x.sendButtonClickHandler())}
98775
+ tabindex="${x => x.tabIndex}"
98776
+ title=${x => (x.processing ? x.stopButtonLabel : x.sendButtonLabel)}
98777
+ content-hidden
98778
+ >
98779
+ ${x => (x.processing ? x.stopButtonLabel : x.sendButtonLabel)}
98780
+ ${when(x => x.processing, html `<${iconStopSquareTag} slot="start"></${iconStopSquareTag}>`, html `<${iconPaperPlaneTag} slot="start"></${iconPaperPlaneTag}>`)}
98781
+ </${buttonTag}>
98782
+ </section>
98725
98783
  <${iconExclamationMarkTag}
98726
98784
  severity="error"
98727
98785
  class="error-icon ${x => (x.scrollbarWidth >= 0 ? 'scrollbar-width-calculated' : '')}"
@@ -98750,8 +98808,18 @@ focus outline in that case.
98750
98808
  * @internal
98751
98809
  */
98752
98810
  this.scrollbarWidth = -1;
98811
+ /** @internal */
98812
+ this.footerActionsIsEmpty = true;
98813
+ /** @internal */
98814
+ this.attachmentsIsEmpty = true;
98753
98815
  this.updateScrollbarWidthQueued = false;
98754
98816
  }
98817
+ slottedFooterActionsElementsChanged(_prev, next) {
98818
+ this.footerActionsIsEmpty = next === undefined || next.length === 0;
98819
+ }
98820
+ slottedAttachmentsElementsChanged(_prev, next) {
98821
+ this.attachmentsIsEmpty = next === undefined || next.length === 0;
98822
+ }
98755
98823
  /**
98756
98824
  * @internal
98757
98825
  */
@@ -98912,6 +98980,18 @@ focus outline in that case.
98912
98980
  __decorate([
98913
98981
  observable
98914
98982
  ], ChatInput.prototype, "scrollbarWidth", void 0);
98983
+ __decorate([
98984
+ observable
98985
+ ], ChatInput.prototype, "footerActionsIsEmpty", void 0);
98986
+ __decorate([
98987
+ observable
98988
+ ], ChatInput.prototype, "slottedFooterActionsElements", void 0);
98989
+ __decorate([
98990
+ observable
98991
+ ], ChatInput.prototype, "attachmentsIsEmpty", void 0);
98992
+ __decorate([
98993
+ observable
98994
+ ], ChatInput.prototype, "slottedAttachmentsElements", void 0);
98915
98995
  const sprightChatInput = ChatInput.compose({
98916
98996
  baseName: 'chat-input',
98917
98997
  template: template$7,