@ni/spright-components 5.1.1 → 5.2.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.
@@ -93047,7 +93047,7 @@ focus outline in that case.
93047
93047
  :host {
93048
93048
  flex-direction: column;
93049
93049
  justify-content: flex-start;
93050
- row-gap: ${standardPadding};
93050
+ row-gap: 32px;
93051
93051
  padding: ${mediumPadding};
93052
93052
  background: ${applicationBackgroundColor};
93053
93053
  overflow-y: auto;
@@ -93073,6 +93073,16 @@ focus outline in that case.
93073
93073
  .withPrefix('spright')
93074
93074
  .register(sprightChatConversation());
93075
93075
 
93076
+ /**
93077
+ * A message type in a chat conversation.
93078
+ * @public
93079
+ */
93080
+ const ChatMessageType = {
93081
+ system: undefined,
93082
+ outbound: 'outbound',
93083
+ inbound: 'inbound'
93084
+ };
93085
+
93076
93086
  const styles$1 = css `
93077
93087
  ${display('flex')}
93078
93088
 
@@ -93087,45 +93097,85 @@ focus outline in that case.
93087
93097
  color: ${bodyFontColor};
93088
93098
  }
93089
93099
 
93090
- :host([message-type='outbound']) {
93100
+ :host([message-type='${ChatMessageType.outbound}']) {
93091
93101
  justify-content: flex-end;
93092
93102
  }
93093
93103
 
93094
- :host([message-type='inbound']) {
93104
+ :host([message-type='${ChatMessageType.inbound}']) {
93095
93105
  justify-content: flex-start;
93096
93106
  }
93097
93107
 
93098
- div {
93099
- max-width: calc(100% - 200px);
93108
+ .container {
93109
+ display: flex;
93110
+ flex-direction: column;
93111
+ max-width: calc(90%);
93112
+ }
93113
+
93114
+ [part='start'] {
93115
+ display: none;
93116
+ }
93117
+
93118
+ .message-content {
93100
93119
  width: fit-content;
93101
93120
  height: fit-content;
93102
- padding: ${mediumPadding};
93103
93121
  overflow-x: auto;
93104
93122
  }
93105
93123
 
93106
- :host([message-type='outbound']) div {
93124
+ :host([message-type='${ChatMessageType.outbound}']) .message-content {
93107
93125
  background: ${fillSelectedColor};
93108
93126
  border: ${borderWidth} solid ${borderHoverColor};
93109
- border-radius: 8px 8px 0px 8px;
93127
+ border-radius: ${mediumPadding} ${mediumPadding} 0px ${mediumPadding};
93128
+ padding: ${mediumPadding};
93129
+ }
93130
+
93131
+ .footer-actions {
93132
+ display: none;
93133
+ }
93134
+
93135
+ :host([message-type='${ChatMessageType.inbound}'])
93136
+ .footer-actions.has-content {
93137
+ display: flex;
93138
+ column-gap: ${standardPadding};
93139
+ margin-top: ${mediumPadding};
93110
93140
  }
93111
93141
 
93112
- :host([message-type='inbound']) div {
93113
- border-radius: 8px 8px 8px 0px;
93142
+ .footer-actions ::slotted(${buttonTag}),
93143
+ .footer-actions ::slotted(${toggleButtonTag}),
93144
+ .footer-actions ::slotted(${anchorButtonTag}),
93145
+ .footer-actions ::slotted(${menuButtonTag}) {
93146
+ height: ${controlSlimHeight};
93147
+ }
93148
+
93149
+ .end {
93150
+ display: none;
93151
+ }
93152
+
93153
+ :host([message-type='${ChatMessageType.inbound}']) .end {
93154
+ display: flex;
93155
+ column-gap: ${standardPadding};
93156
+ margin-top: ${largePadding};
93114
93157
  }
93115
93158
  `;
93116
93159
 
93117
93160
  /* eslint-disable @typescript-eslint/indent */
93118
93161
  // prettier-ignore
93119
- const template$1 = html `<div><slot></slot></div>`;
93162
+ const template$1 = (context, definition) => html `
93163
+ <div class="container">
93164
+ ${startSlotTemplate(context, definition)}
93165
+ <section class="message-content">
93166
+ <slot></slot>
93167
+ </section>
93168
+ <section class="footer-actions ${x => (x.footerActionsIsEmpty ? '' : 'has-content')}">
93169
+ <slot
93170
+ name="footer-actions"
93171
+ ${slotted({ property: 'slottedFooterActionsElements' })}
93172
+ ></slot>
93173
+ </section>
93174
+ ${endSlotTemplate(context, definition)}
93175
+ </div>
93176
+ `;
93120
93177
  /* eslint-enable @typescript-eslint/indent */
93121
93178
 
93122
- /**
93123
- * A message type in a chat conversation.
93124
- * @public
93125
- */
93126
- const ChatMessageType = {
93127
- system: undefined};
93128
-
93129
93179
  /**
93130
93180
  * A Spright component for displaying a chat message
93131
93181
  */
@@ -93139,11 +93189,23 @@ focus outline in that case.
93139
93189
  * HTML Attribute: message-type
93140
93190
  */
93141
93191
  this.messageType = ChatMessageType.system;
93192
+ /** @internal */
93193
+ this.footerActionsIsEmpty = true;
93194
+ }
93195
+ slottedFooterActionsElementsChanged(_prev, next) {
93196
+ this.footerActionsIsEmpty = !next?.length;
93142
93197
  }
93143
93198
  }
93144
93199
  __decorate([
93145
93200
  attr({ attribute: 'message-type' })
93146
93201
  ], ChatMessage.prototype, "messageType", void 0);
93202
+ __decorate([
93203
+ observable
93204
+ ], ChatMessage.prototype, "footerActionsIsEmpty", void 0);
93205
+ __decorate([
93206
+ observable
93207
+ ], ChatMessage.prototype, "slottedFooterActionsElements", void 0);
93208
+ applyMixins(ChatMessage, StartEnd);
93147
93209
  const sprightChatMessage = ChatMessage.compose({
93148
93210
  baseName: 'chat-message',
93149
93211
  template: template$1,