@ni/spright-components 4.4.1 → 4.5.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.
@@ -4,4 +4,6 @@
4
4
  * that are required instead of leveraging this file.
5
5
  */
6
6
  import '@ni/nimble-components/dist/esm/all-components';
7
+ import './chat/conversation';
8
+ import './chat/message';
7
9
  import './rectangle';
@@ -4,5 +4,7 @@
4
4
  * that are required instead of leveraging this file.
5
5
  */
6
6
  import '@ni/nimble-components/dist/esm/all-components';
7
+ import './chat/conversation';
8
+ import './chat/message';
7
9
  import './rectangle';
8
10
  //# sourceMappingURL=all-components.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"all-components.js","sourceRoot":"","sources":["../../src/all-components.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,+CAA+C,CAAC;AAEvD,OAAO,aAAa,CAAC","sourcesContent":["/**\n * Import of all the web components available in Spright AND Nimble.\n * Production applications are encouraged to import only components\n * that are required instead of leveraging this file.\n */\n\nimport '@ni/nimble-components/dist/esm/all-components';\n\nimport './rectangle';\n"]}
1
+ {"version":3,"file":"all-components.js","sourceRoot":"","sources":["../../src/all-components.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,+CAA+C,CAAC;AAEvD,OAAO,qBAAqB,CAAC;AAC7B,OAAO,gBAAgB,CAAC;AACxB,OAAO,aAAa,CAAC","sourcesContent":["/**\n * Import of all the web components available in Spright AND Nimble.\n * Production applications are encouraged to import only components\n * that are required instead of leveraging this file.\n */\n\nimport '@ni/nimble-components/dist/esm/all-components';\n\nimport './chat/conversation';\nimport './chat/message';\nimport './rectangle';\n"]}
@@ -0,0 +1,12 @@
1
+ import { FoundationElement } from '@microsoft/fast-foundation';
2
+ declare global {
3
+ interface HTMLElementTagNameMap {
4
+ 'spright-chat-conversation': ChatConversation;
5
+ }
6
+ }
7
+ /**
8
+ * A Spright component for displaying a series of chat messages
9
+ */
10
+ export declare class ChatConversation extends FoundationElement {
11
+ }
12
+ export declare const chatConversationTag = "spright-chat-conversation";
@@ -0,0 +1,18 @@
1
+ import { DesignSystem, FoundationElement } from '@microsoft/fast-foundation';
2
+ import { styles } from './styles';
3
+ import { template } from './template';
4
+ /**
5
+ * A Spright component for displaying a series of chat messages
6
+ */
7
+ export class ChatConversation extends FoundationElement {
8
+ }
9
+ const sprightChatConversation = ChatConversation.compose({
10
+ baseName: 'chat-conversation',
11
+ template,
12
+ styles
13
+ });
14
+ DesignSystem.getOrCreate()
15
+ .withPrefix('spright')
16
+ .register(sprightChatConversation());
17
+ export const chatConversationTag = 'spright-chat-conversation';
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/chat/conversation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC7E,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAQtC;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,iBAAiB;CAAG;AAE1D,MAAM,uBAAuB,GAAG,gBAAgB,CAAC,OAAO,CAAC;IACrD,QAAQ,EAAE,mBAAmB;IAC7B,QAAQ;IACR,MAAM;CACT,CAAC,CAAC;AAEH,YAAY,CAAC,WAAW,EAAE;KACrB,UAAU,CAAC,SAAS,CAAC;KACrB,QAAQ,CAAC,uBAAuB,EAAE,CAAC,CAAC;AACzC,MAAM,CAAC,MAAM,mBAAmB,GAAG,2BAA2B,CAAC","sourcesContent":["import { DesignSystem, FoundationElement } from '@microsoft/fast-foundation';\nimport { styles } from './styles';\nimport { template } from './template';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'spright-chat-conversation': ChatConversation;\n }\n}\n\n/**\n * A Spright component for displaying a series of chat messages\n */\nexport class ChatConversation extends FoundationElement {}\n\nconst sprightChatConversation = ChatConversation.compose({\n baseName: 'chat-conversation',\n template,\n styles\n});\n\nDesignSystem.getOrCreate()\n .withPrefix('spright')\n .register(sprightChatConversation());\nexport const chatConversationTag = 'spright-chat-conversation';\n"]}
@@ -0,0 +1 @@
1
+ export declare const styles: import("@microsoft/fast-element").ElementStyles;
@@ -0,0 +1,16 @@
1
+ import { css } from '@microsoft/fast-element';
2
+ import { applicationBackgroundColor, mediumPadding, standardPadding } from '@ni/nimble-components/dist/esm/theme-provider/design-tokens';
3
+ import { display } from '../../utilities/style/display';
4
+ export const styles = css `
5
+ ${display('flex')}
6
+
7
+ :host {
8
+ flex-direction: column;
9
+ justify-content: flex-start;
10
+ row-gap: ${standardPadding};
11
+ padding: ${mediumPadding};
12
+ background: ${applicationBackgroundColor};
13
+ overflow-y: auto;
14
+ }
15
+ `;
16
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../src/chat/conversation/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EACH,0BAA0B,EAC1B,aAAa,EACb,eAAe,EAClB,MAAM,6DAA6D,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAExD,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;MACnB,OAAO,CAAC,MAAM,CAAC;;;;;mBAKF,eAAe;mBACf,aAAa;sBACV,0BAA0B;;;CAG/C,CAAC","sourcesContent":["import { css } from '@microsoft/fast-element';\nimport {\n applicationBackgroundColor,\n mediumPadding,\n standardPadding\n} from '@ni/nimble-components/dist/esm/theme-provider/design-tokens';\nimport { display } from '../../utilities/style/display';\n\nexport const styles = css`\n ${display('flex')}\n\n :host {\n flex-direction: column;\n justify-content: flex-start;\n row-gap: ${standardPadding};\n padding: ${mediumPadding};\n background: ${applicationBackgroundColor};\n overflow-y: auto;\n }\n`;\n"]}
@@ -0,0 +1,2 @@
1
+ import type { ChatConversation } from '.';
2
+ export declare const template: import("@microsoft/fast-element").ViewTemplate<ChatConversation, any>;
@@ -0,0 +1,6 @@
1
+ import { html } from '@microsoft/fast-element';
2
+ /* eslint-disable @typescript-eslint/indent */
3
+ // prettier-ignore
4
+ export const template = html `<slot></slot>`;
5
+ /* eslint-enable @typescript-eslint/indent */
6
+ //# sourceMappingURL=template.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../src/chat/conversation/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAG/C,8CAA8C;AAC9C,kBAAkB;AAClB,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAkB,eAAe,CAAC;AAC9D,6CAA6C","sourcesContent":["import { html } from '@microsoft/fast-element';\nimport type { ChatConversation } from '.';\n\n/* eslint-disable @typescript-eslint/indent */\n// prettier-ignore\nexport const template = html<ChatConversation>`<slot></slot>`;\n/* eslint-enable @typescript-eslint/indent */\n"]}
@@ -0,0 +1,20 @@
1
+ import { FoundationElement } from '@microsoft/fast-foundation';
2
+ import { ChatMessageType } from './types';
3
+ declare global {
4
+ interface HTMLElementTagNameMap {
5
+ 'spright-chat-message': ChatMessage;
6
+ }
7
+ }
8
+ /**
9
+ * A Spright component for displaying a chat message
10
+ */
11
+ export declare class ChatMessage extends FoundationElement {
12
+ /**
13
+ * @public
14
+ * The message type of this message in the chat conversation
15
+ * @remarks
16
+ * HTML Attribute: message-type
17
+ */
18
+ readonly messageType: ChatMessageType;
19
+ }
20
+ export declare const chatMessageTag = "spright-chat-message";
@@ -0,0 +1,32 @@
1
+ import { __decorate } from "tslib";
2
+ import { attr } from '@microsoft/fast-element';
3
+ import { DesignSystem, FoundationElement } from '@microsoft/fast-foundation';
4
+ import { styles } from './styles';
5
+ import { template } from './template';
6
+ import { ChatMessageType } from './types';
7
+ /**
8
+ * A Spright component for displaying a chat message
9
+ */
10
+ export class ChatMessage extends FoundationElement {
11
+ constructor() {
12
+ super(...arguments);
13
+ /**
14
+ * @public
15
+ * The message type of this message in the chat conversation
16
+ * @remarks
17
+ * HTML Attribute: message-type
18
+ */
19
+ this.messageType = ChatMessageType.system;
20
+ }
21
+ }
22
+ __decorate([
23
+ attr({ attribute: 'message-type' })
24
+ ], ChatMessage.prototype, "messageType", void 0);
25
+ const sprightChatMessage = ChatMessage.compose({
26
+ baseName: 'chat-message',
27
+ template,
28
+ styles
29
+ });
30
+ DesignSystem.getOrCreate().withPrefix('spright').register(sprightChatMessage());
31
+ export const chatMessageTag = 'spright-chat-message';
32
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/chat/message/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC7E,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAQ1C;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,iBAAiB;IAAlD;;QACI;;;;;WAKG;QAEa,gBAAW,GAAoB,eAAe,CAAC,MAAM,CAAC;IAC1E,CAAC;CAAA;AADmB;IADf,IAAI,CAAC,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;gDACkC;AAG1E,MAAM,kBAAkB,GAAG,WAAW,CAAC,OAAO,CAAC;IAC3C,QAAQ,EAAE,cAAc;IACxB,QAAQ;IACR,MAAM;CACT,CAAC,CAAC;AAEH,YAAY,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,kBAAkB,EAAE,CAAC,CAAC;AAChF,MAAM,CAAC,MAAM,cAAc,GAAG,sBAAsB,CAAC","sourcesContent":["import { attr } from '@microsoft/fast-element';\nimport { DesignSystem, FoundationElement } from '@microsoft/fast-foundation';\nimport { styles } from './styles';\nimport { template } from './template';\nimport { ChatMessageType } from './types';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'spright-chat-message': ChatMessage;\n }\n}\n\n/**\n * A Spright component for displaying a chat message\n */\nexport class ChatMessage extends FoundationElement {\n /**\n * @public\n * The message type of this message in the chat conversation\n * @remarks\n * HTML Attribute: message-type\n */\n @attr({ attribute: 'message-type' })\n public readonly messageType: ChatMessageType = ChatMessageType.system;\n}\n\nconst sprightChatMessage = ChatMessage.compose({\n baseName: 'chat-message',\n template,\n styles\n});\n\nDesignSystem.getOrCreate().withPrefix('spright').register(sprightChatMessage());\nexport const chatMessageTag = 'spright-chat-message';\n"]}
@@ -0,0 +1 @@
1
+ export declare const styles: import("@microsoft/fast-element").ElementStyles;
@@ -0,0 +1,44 @@
1
+ import { css } from '@microsoft/fast-element';
2
+ import { bodyFont, bodyFontColor, borderHoverColor, borderWidth, fillSelectedColor, mediumPadding } from '@ni/nimble-components/dist/esm/theme-provider/design-tokens';
3
+ import { display } from '../../utilities/style/display';
4
+ export const styles = css `
5
+ ${display('flex')}
6
+
7
+ :host {
8
+ min-width: 16px;
9
+ min-height: 16px;
10
+
11
+ flex-direction: row;
12
+ justify-content: center;
13
+ flex-shrink: 0;
14
+ font: ${bodyFont};
15
+ color: ${bodyFontColor};
16
+ }
17
+
18
+ :host([message-type='outbound']) {
19
+ justify-content: flex-end;
20
+ }
21
+
22
+ :host([message-type='inbound']) {
23
+ justify-content: flex-start;
24
+ }
25
+
26
+ div {
27
+ max-width: calc(100% - 200px);
28
+ width: fit-content;
29
+ height: fit-content;
30
+ padding: ${mediumPadding};
31
+ overflow-x: auto;
32
+ }
33
+
34
+ :host([message-type='outbound']) div {
35
+ background: ${fillSelectedColor};
36
+ border: ${borderWidth} solid ${borderHoverColor};
37
+ border-radius: 8px 8px 0px 8px;
38
+ }
39
+
40
+ :host([message-type='inbound']) div {
41
+ border-radius: 8px 8px 8px 0px;
42
+ }
43
+ `;
44
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../src/chat/message/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EACH,QAAQ,EACR,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,iBAAiB,EACjB,aAAa,EAChB,MAAM,6DAA6D,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAExD,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;MACnB,OAAO,CAAC,MAAM,CAAC;;;;;;;;;gBASL,QAAQ;iBACP,aAAa;;;;;;;;;;;;;;;mBAeX,aAAa;;;;;sBAKV,iBAAiB;kBACrB,WAAW,UAAU,gBAAgB;;;;;;;CAOtD,CAAC","sourcesContent":["import { css } from '@microsoft/fast-element';\nimport {\n bodyFont,\n bodyFontColor,\n borderHoverColor,\n borderWidth,\n fillSelectedColor,\n mediumPadding\n} from '@ni/nimble-components/dist/esm/theme-provider/design-tokens';\nimport { display } from '../../utilities/style/display';\n\nexport const styles = css`\n ${display('flex')}\n\n :host {\n min-width: 16px;\n min-height: 16px;\n\n flex-direction: row;\n justify-content: center;\n flex-shrink: 0;\n font: ${bodyFont};\n color: ${bodyFontColor};\n }\n\n :host([message-type='outbound']) {\n justify-content: flex-end;\n }\n\n :host([message-type='inbound']) {\n justify-content: flex-start;\n }\n\n div {\n max-width: calc(100% - 200px);\n width: fit-content;\n height: fit-content;\n padding: ${mediumPadding};\n overflow-x: auto;\n }\n\n :host([message-type='outbound']) div {\n background: ${fillSelectedColor};\n border: ${borderWidth} solid ${borderHoverColor};\n border-radius: 8px 8px 0px 8px;\n }\n\n :host([message-type='inbound']) div {\n border-radius: 8px 8px 8px 0px;\n }\n`;\n"]}
@@ -0,0 +1,2 @@
1
+ import type { ChatMessage } from '.';
2
+ export declare const template: import("@microsoft/fast-element").ViewTemplate<ChatMessage, any>;
@@ -0,0 +1,6 @@
1
+ import { html } from '@microsoft/fast-element';
2
+ /* eslint-disable @typescript-eslint/indent */
3
+ // prettier-ignore
4
+ export const template = html `<div><slot></slot></div>`;
5
+ /* eslint-enable @typescript-eslint/indent */
6
+ //# sourceMappingURL=template.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../src/chat/message/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAG/C,8CAA8C;AAC9C,kBAAkB;AAClB,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAa,0BAA0B,CAAC;AACpE,6CAA6C","sourcesContent":["import { html } from '@microsoft/fast-element';\nimport type { ChatMessage } from '.';\n\n/* eslint-disable @typescript-eslint/indent */\n// prettier-ignore\nexport const template = html<ChatMessage>`<div><slot></slot></div>`;\n/* eslint-enable @typescript-eslint/indent */\n"]}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * A message type in a chat conversation.
3
+ * @public
4
+ */
5
+ export declare const ChatMessageType: {
6
+ readonly system: undefined;
7
+ readonly outbound: "outbound";
8
+ readonly inbound: "inbound";
9
+ };
10
+ export type ChatMessageType = (typeof ChatMessageType)[keyof typeof ChatMessageType];
@@ -0,0 +1,10 @@
1
+ /**
2
+ * A message type in a chat conversation.
3
+ * @public
4
+ */
5
+ export const ChatMessageType = {
6
+ system: undefined,
7
+ outbound: 'outbound',
8
+ inbound: 'inbound'
9
+ };
10
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/chat/message/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC3B,MAAM,EAAE,SAAS;IACjB,QAAQ,EAAE,UAAU;IACpB,OAAO,EAAE,SAAS;CACZ,CAAC","sourcesContent":["/**\n * A message type in a chat conversation.\n * @public\n */\nexport const ChatMessageType = {\n system: undefined,\n outbound: 'outbound',\n inbound: 'inbound'\n} as const;\n\nexport type ChatMessageType =\n (typeof ChatMessageType)[keyof typeof ChatMessageType];\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ni/spright-components",
3
- "version": "4.4.1",
3
+ "version": "4.5.1",
4
4
  "description": "NI Spright Components",
5
5
  "scripts": {
6
6
  "build": "npm run build-components && npm run bundle-components",
@@ -50,7 +50,7 @@
50
50
  "dependencies": {
51
51
  "@microsoft/fast-element": "^1.14.0",
52
52
  "@microsoft/fast-foundation": "^2.50.0",
53
- "@ni/nimble-components": "^32.12.1",
53
+ "@ni/nimble-components": "^32.13.0",
54
54
  "tslib": "^2.2.0"
55
55
  },
56
56
  "devDependencies": {