@ni/spright-components 5.5.1 → 5.5.2
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.
- package/dist/all-components-bundle.js +42 -4
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +4654 -4633
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/esm/chat/conversation/index.d.ts +5 -0
- package/dist/esm/chat/conversation/index.js +16 -0
- package/dist/esm/chat/conversation/index.js.map +1 -1
- package/dist/esm/chat/conversation/styles.js +15 -3
- package/dist/esm/chat/conversation/styles.js.map +1 -1
- package/dist/esm/chat/conversation/template.js +6 -2
- package/dist/esm/chat/conversation/template.js.map +1 -1
- package/package.json +2 -2
|
@@ -16000,6 +16000,7 @@
|
|
|
16000
16000
|
dividerBackgroundColor: 'divider-background-color',
|
|
16001
16001
|
headerBackgroundColor: 'header-background-color',
|
|
16002
16002
|
sectionBackgroundColor: 'section-background-color',
|
|
16003
|
+
sectionBackgroundImage: 'section-background-image',
|
|
16003
16004
|
buttonFillPrimaryColor: 'button-fill-primary-color',
|
|
16004
16005
|
buttonPrimaryFontColor: 'button-primary-font-color',
|
|
16005
16006
|
buttonFillAccentColor: 'button-fill-accent-color',
|
|
@@ -16032,6 +16033,7 @@
|
|
|
16032
16033
|
largePadding: 'large-padding',
|
|
16033
16034
|
labelHeight: 'label-height',
|
|
16034
16035
|
borderWidth: 'border-width',
|
|
16036
|
+
dividerWidth: 'divider-width',
|
|
16035
16037
|
iconSize: 'icon-size',
|
|
16036
16038
|
groupHeaderTextTransform: 'group-header-text-transform',
|
|
16037
16039
|
drawerWidth: 'drawer-width',
|
|
@@ -16250,7 +16252,12 @@
|
|
|
16250
16252
|
const applicationBackgroundColor = DesignToken.create(styleNameFromTokenName(tokenNames.applicationBackgroundColor)).withDefault((element) => getColorForTheme(element, White, Black85, ForestGreen));
|
|
16251
16253
|
DesignToken.create(styleNameFromTokenName(tokenNames.headerBackgroundColor)).withDefault((element) => getColorForTheme(element, Black7, Black88, ForestGreen));
|
|
16252
16254
|
DesignToken.create(styleNameFromTokenName(tokenNames.sectionBackgroundColor)).withDefault((element) => getColorForTheme(element, Black15, Black80, ForestGreen));
|
|
16253
|
-
DesignToken.create(styleNameFromTokenName(tokenNames.
|
|
16255
|
+
const sectionBackgroundImage = DesignToken.create(styleNameFromTokenName(tokenNames.sectionBackgroundImage)).withDefault((element) => {
|
|
16256
|
+
const start = getColorForTheme(element, Black15, Black82, ForestGreen);
|
|
16257
|
+
const end = getColorForTheme(element, hexToRgbaCssColor(Black15, 0), hexToRgbaCssColor(Black82, 0), hexToRgbaCssColor(ForestGreen, 0));
|
|
16258
|
+
return `linear-gradient(${start}, ${end})`;
|
|
16259
|
+
});
|
|
16260
|
+
DesignToken.create(styleNameFromTokenName(tokenNames.dividerBackgroundColor)).withDefault((element) => getColorForTheme(element, hexToRgbaCssColor(Black91, 0.2), hexToRgbaCssColor(Black15, 0.2), hexToRgbaCssColor(White, 0.2)));
|
|
16254
16261
|
const fillSelectedColor = DesignToken.create(styleNameFromTokenName(tokenNames.fillSelectedColor)).withDefault((element) => hexToRgbaCssColor(getFillSelectedColorForTheme(element), 0.2));
|
|
16255
16262
|
const fillSelectedRgbPartialColor = DesignToken.create(styleNameFromTokenName(tokenNames.fillSelectedRgbPartialColor)).withDefault((element) => hexToRgbPartial(getFillSelectedColorForTheme(element)));
|
|
16256
16263
|
const fillHoverSelectedColor = DesignToken.create(styleNameFromTokenName(tokenNames.fillHoverSelectedColor)).withDefault((element) => hexToRgbaCssColor(getFillSelectedColorForTheme(element), 0.15));
|
|
@@ -16313,6 +16320,7 @@
|
|
|
16313
16320
|
const largePadding = DesignToken.create(styleNameFromTokenName(tokenNames.largePadding)).withDefault('24px');
|
|
16314
16321
|
DesignToken.create(styleNameFromTokenName(tokenNames.labelHeight)).withDefault('16px');
|
|
16315
16322
|
const borderWidth = DesignToken.create(styleNameFromTokenName(tokenNames.borderWidth)).withDefault('1px');
|
|
16323
|
+
DesignToken.create(styleNameFromTokenName(tokenNames.dividerWidth)).withDefault('2px');
|
|
16316
16324
|
const iconSize = DesignToken.create(styleNameFromTokenName(tokenNames.iconSize)).withDefault('16px');
|
|
16317
16325
|
const drawerWidth = DesignToken.create(styleNameFromTokenName(tokenNames.drawerWidth)).withDefault('784px');
|
|
16318
16326
|
const dialogSmallWidth = DesignToken.create(styleNameFromTokenName(tokenNames.dialogSmallWidth)).withDefault('400px');
|
|
@@ -93482,6 +93490,8 @@ focus outline in that case.
|
|
|
93482
93490
|
|
|
93483
93491
|
:host {
|
|
93484
93492
|
flex-direction: column;
|
|
93493
|
+
background: ${applicationBackgroundColor};
|
|
93494
|
+
border: ${borderWidth} solid ${applicationBackgroundColor};
|
|
93485
93495
|
}
|
|
93486
93496
|
|
|
93487
93497
|
.messages {
|
|
@@ -93490,24 +93500,52 @@ focus outline in that case.
|
|
|
93490
93500
|
flex-direction: column;
|
|
93491
93501
|
justify-content: flex-start;
|
|
93492
93502
|
row-gap: 32px;
|
|
93493
|
-
padding: ${mediumPadding}
|
|
93494
|
-
|
|
93503
|
+
padding: ${mediumPadding} ${standardPadding} ${mediumPadding}
|
|
93504
|
+
${standardPadding};
|
|
93505
|
+
background: ${sectionBackgroundImage};
|
|
93495
93506
|
overflow-y: auto;
|
|
93496
93507
|
}
|
|
93508
|
+
|
|
93509
|
+
.input {
|
|
93510
|
+
padding: ${borderWidth} ${standardPadding} ${standardPadding}
|
|
93511
|
+
${standardPadding};
|
|
93512
|
+
}
|
|
93513
|
+
|
|
93514
|
+
.input.input-empty {
|
|
93515
|
+
padding: 0px ${standardPadding} 0px ${standardPadding};
|
|
93516
|
+
}
|
|
93497
93517
|
`;
|
|
93498
93518
|
|
|
93499
93519
|
/* eslint-disable @typescript-eslint/indent */
|
|
93500
93520
|
// prettier-ignore
|
|
93501
93521
|
const template$3 = html `
|
|
93502
93522
|
<div class="messages"><slot></slot></div>
|
|
93503
|
-
<div class="input
|
|
93523
|
+
<div class="input ${x => (x.inputEmpty ? 'input-empty' : '')}">
|
|
93524
|
+
<slot name="input" ${slotted({ property: 'slottedInputElements' })}>
|
|
93525
|
+
</slot>
|
|
93526
|
+
</div>
|
|
93527
|
+
`;
|
|
93504
93528
|
/* eslint-enable @typescript-eslint/indent */
|
|
93505
93529
|
|
|
93506
93530
|
/**
|
|
93507
93531
|
* A Spright component for displaying a series of chat messages
|
|
93508
93532
|
*/
|
|
93509
93533
|
class ChatConversation extends FoundationElement {
|
|
93534
|
+
constructor() {
|
|
93535
|
+
super(...arguments);
|
|
93536
|
+
/** @internal */
|
|
93537
|
+
this.inputEmpty = true;
|
|
93538
|
+
}
|
|
93539
|
+
slottedInputElementsChanged(_prev, next) {
|
|
93540
|
+
this.inputEmpty = !next?.length;
|
|
93541
|
+
}
|
|
93510
93542
|
}
|
|
93543
|
+
__decorate([
|
|
93544
|
+
observable
|
|
93545
|
+
], ChatConversation.prototype, "inputEmpty", void 0);
|
|
93546
|
+
__decorate([
|
|
93547
|
+
observable
|
|
93548
|
+
], ChatConversation.prototype, "slottedInputElements", void 0);
|
|
93511
93549
|
const sprightChatConversation = ChatConversation.compose({
|
|
93512
93550
|
baseName: 'chat-conversation',
|
|
93513
93551
|
template: template$3,
|