@eccenca/gui-elements 24.4.0-fixpreventwronglydisplayedtooltipscmem6858.0 → 24.4.1-featurechatcomponentscmem6775.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.
- package/CHANGELOG.md +17 -0
- package/dist/cjs/common/index.js.map +1 -1
- package/dist/cjs/components/Chat/ChatArea.js +55 -0
- package/dist/cjs/components/Chat/ChatArea.js.map +1 -0
- package/dist/cjs/components/Chat/ChatContent.js +53 -0
- package/dist/cjs/components/Chat/ChatContent.js.map +1 -0
- package/dist/cjs/components/Chat/ChatField.js +45 -0
- package/dist/cjs/components/Chat/ChatField.js.map +1 -0
- package/dist/cjs/components/Chat/index.js +20 -0
- package/dist/cjs/components/Chat/index.js.map +1 -0
- package/dist/cjs/components/Icon/canonicalIconNames.js +3 -0
- package/dist/cjs/components/Icon/canonicalIconNames.js.map +1 -1
- package/dist/cjs/components/TextField/TextArea.js +2 -2
- package/dist/cjs/components/TextField/TextArea.js.map +1 -1
- package/dist/cjs/components/index.js +1 -0
- package/dist/cjs/components/index.js.map +1 -1
- package/dist/esm/common/index.js.map +1 -1
- package/dist/esm/components/Chat/ChatArea.js +59 -0
- package/dist/esm/components/Chat/ChatArea.js.map +1 -0
- package/dist/esm/components/Chat/ChatContent.js +57 -0
- package/dist/esm/components/Chat/ChatContent.js.map +1 -0
- package/dist/esm/components/Chat/ChatField.js +49 -0
- package/dist/esm/components/Chat/ChatField.js.map +1 -0
- package/dist/esm/components/Chat/index.js +4 -0
- package/dist/esm/components/Chat/index.js.map +1 -0
- package/dist/esm/components/Icon/canonicalIconNames.js +3 -0
- package/dist/esm/components/Icon/canonicalIconNames.js.map +1 -1
- package/dist/esm/components/TextField/TextArea.js +2 -2
- package/dist/esm/components/TextField/TextArea.js.map +1 -1
- package/dist/esm/components/index.js +1 -0
- package/dist/esm/components/index.js.map +1 -1
- package/dist/types/common/index.d.ts +1 -0
- package/dist/types/components/Chat/ChatArea.d.ts +34 -0
- package/dist/types/components/Chat/ChatContent.d.ts +43 -0
- package/dist/types/components/Chat/ChatField.d.ts +19 -0
- package/dist/types/components/Chat/index.d.ts +3 -0
- package/dist/types/components/Icon/canonicalIconNames.d.ts +3 -0
- package/dist/types/components/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/common/index.ts +1 -0
- package/src/components/Chat/ChatArea.tsx +114 -0
- package/src/components/Chat/ChatContent.tsx +116 -0
- package/src/components/Chat/ChatField.tsx +52 -0
- package/src/components/Chat/_chat.scss +81 -0
- package/src/components/Chat/index.ts +3 -0
- package/src/components/Chat/stories/ChatArea.stories.tsx +33 -0
- package/src/components/Chat/stories/ChatContent.stories.tsx +58 -0
- package/src/components/Chat/stories/ChatField.stories.tsx +18 -0
- package/src/components/Icon/canonicalIconNames.tsx +3 -0
- package/src/components/TextField/TextArea.tsx +2 -2
- package/src/components/Tooltip/Tooltip.stories.tsx +2 -0
- package/src/components/index.scss +1 -0
- package/src/components/index.ts +1 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { LoremIpsum } from "react-lorem-ipsum";
|
|
3
|
+
import { Meta, StoryFn } from "@storybook/react";
|
|
4
|
+
|
|
5
|
+
import { ChatContent, Depiction, HtmlContentBlock, Icon, OverflowText } from "../../../index";
|
|
6
|
+
|
|
7
|
+
import canonicalIcons from "./../../Icon/canonicalIconNames";
|
|
8
|
+
|
|
9
|
+
const allIcons = new Map([
|
|
10
|
+
...Object.keys(canonicalIcons).map((keyId) => {
|
|
11
|
+
return [`Icon: ${keyId}`, <Depiction image={<Icon name={keyId} />} />];
|
|
12
|
+
}),
|
|
13
|
+
]);
|
|
14
|
+
|
|
15
|
+
const exampleImages = {
|
|
16
|
+
None: undefined,
|
|
17
|
+
...Object.fromEntries(allIcons),
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export default {
|
|
21
|
+
title: "Components/Chat/ChatContent",
|
|
22
|
+
component: ChatContent,
|
|
23
|
+
argTypes: {
|
|
24
|
+
avatar: {
|
|
25
|
+
control: "select",
|
|
26
|
+
options: Object.keys(exampleImages),
|
|
27
|
+
mapping: exampleImages,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
} as Meta<typeof ChatContent>;
|
|
31
|
+
|
|
32
|
+
const TemplateFull: StoryFn<typeof ChatContent> = (args) => <ChatContent {...args} />;
|
|
33
|
+
|
|
34
|
+
export const Default = TemplateFull.bind({});
|
|
35
|
+
Default.args = {
|
|
36
|
+
children: (
|
|
37
|
+
<HtmlContentBlock>
|
|
38
|
+
<LoremIpsum p={1} avgSentencesPerParagraph={5} random={false} />
|
|
39
|
+
</HtmlContentBlock>
|
|
40
|
+
),
|
|
41
|
+
avatar: <Depiction image={<Icon name={"application-useraccount"} />} />,
|
|
42
|
+
statusLine: (
|
|
43
|
+
<OverflowText>
|
|
44
|
+
<strong>Username</strong> 25 minutes ago
|
|
45
|
+
</OverflowText>
|
|
46
|
+
),
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const LongChatBubble = TemplateFull.bind({});
|
|
50
|
+
LongChatBubble.args = {
|
|
51
|
+
...Default.args,
|
|
52
|
+
children: (
|
|
53
|
+
<HtmlContentBlock>
|
|
54
|
+
<LoremIpsum p={10} avgSentencesPerParagraph={10} random={false} />
|
|
55
|
+
</HtmlContentBlock>
|
|
56
|
+
),
|
|
57
|
+
limitHeight: true,
|
|
58
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Meta, StoryFn } from "@storybook/react";
|
|
3
|
+
|
|
4
|
+
import { ChatField } from "../../../index";
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: "Components/Chat/ChatField",
|
|
8
|
+
component: ChatField,
|
|
9
|
+
argTypes: {},
|
|
10
|
+
} as Meta<typeof ChatField>;
|
|
11
|
+
|
|
12
|
+
let forceupdate = 0;
|
|
13
|
+
const TemplateFull: StoryFn<typeof ChatField> = (args) => <ChatField {...args} key={forceupdate++} />;
|
|
14
|
+
|
|
15
|
+
export const Default = TemplateFull.bind({});
|
|
16
|
+
Default.args = {
|
|
17
|
+
onSubmit: (value) => alert(value),
|
|
18
|
+
};
|
|
@@ -8,6 +8,7 @@ const canonicalIcons = {
|
|
|
8
8
|
"application-homepage": icons.Workspace,
|
|
9
9
|
"application-legacygui": icons.ResetAlt,
|
|
10
10
|
"application-mapping": icons.ModelBuilder,
|
|
11
|
+
"application-colors": icons.ColorPalette,
|
|
11
12
|
"application-queries": icons.DataView,
|
|
12
13
|
"application-useraccount": icons.UserAvatar,
|
|
13
14
|
"application-vocabularies": icons.Catalog,
|
|
@@ -50,6 +51,7 @@ const canonicalIcons = {
|
|
|
50
51
|
"artefact-workflow": icons.ModelBuilder,
|
|
51
52
|
|
|
52
53
|
"data-boolean": icons.Boolean,
|
|
54
|
+
"data-color": icons.ColorPalette,
|
|
53
55
|
"data-sourcepath": icons.Data_2,
|
|
54
56
|
"data-targetpath": icons.Data_1,
|
|
55
57
|
"data-string": icons.StringText,
|
|
@@ -145,6 +147,7 @@ const canonicalIcons = {
|
|
|
145
147
|
"operation-merge": icons.DirectionMerge,
|
|
146
148
|
"operation-redo": icons.Redo,
|
|
147
149
|
"operation-search": icons.Search,
|
|
150
|
+
"operation-send": icons.Send,
|
|
148
151
|
"operation-sharelink": icons.CopyLink,
|
|
149
152
|
"operation-transform": icons.Calculation,
|
|
150
153
|
"operation-translate": icons.Translate,
|
|
@@ -91,7 +91,7 @@ export const TextArea = ({
|
|
|
91
91
|
leftIconElementRect.width ?? 0
|
|
92
92
|
}px)`
|
|
93
93
|
);
|
|
94
|
-
leftIconElement.addEventListener("click", (
|
|
94
|
+
leftIconElement.addEventListener("click", () => {
|
|
95
95
|
textAreaElement.focus();
|
|
96
96
|
});
|
|
97
97
|
}
|
|
@@ -157,7 +157,7 @@ export const TextArea = ({
|
|
|
157
157
|
rows={
|
|
158
158
|
rows && !otherBlueprintTextAreaProps.autoResize && !otherBlueprintTextAreaProps.growVertically
|
|
159
159
|
? rows
|
|
160
|
-
:
|
|
160
|
+
: 2
|
|
161
161
|
}
|
|
162
162
|
{...otherBlueprintTextAreaProps}
|
|
163
163
|
dir={"auto"}
|
|
@@ -2,6 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { loremIpsum } from "react-lorem-ipsum";
|
|
3
3
|
import { OverlaysProvider } from "@blueprintjs/core";
|
|
4
4
|
import { Meta, StoryFn } from "@storybook/react";
|
|
5
|
+
import { fn } from "@storybook/test";
|
|
5
6
|
|
|
6
7
|
import { Tooltip } from "../../index";
|
|
7
8
|
|
|
@@ -34,6 +35,7 @@ Default.args = {
|
|
|
34
35
|
children: "hover me",
|
|
35
36
|
content: testContent,
|
|
36
37
|
addIndicator: true,
|
|
38
|
+
onOpening: fn(),
|
|
37
39
|
};
|
|
38
40
|
|
|
39
41
|
export const MarkdownSupport = Template.bind({});
|
package/src/components/index.ts
CHANGED
|
@@ -8,6 +8,7 @@ export * from "./Badge/Badge";
|
|
|
8
8
|
export * from "./Breadcrumb";
|
|
9
9
|
export * from "./Button/Button";
|
|
10
10
|
export * from "./Card";
|
|
11
|
+
export * from "./Chat";
|
|
11
12
|
export * from "./Checkbox/Checkbox";
|
|
12
13
|
export * from "./ContextOverlay";
|
|
13
14
|
export * from "./Depiction/Depiction";
|