@spaced-out/ui-design-system 0.3.12 → 0.3.13
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
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.3.13](https://github.com/spaced-out/ui-design-system/compare/v0.3.12...v0.3.13) (2024-12-18)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* Removed stories that are not required in Chatbubble ([#308](https://github.com/spaced-out/ui-design-system/issues/308)) ([4b65c32](https://github.com/spaced-out/ui-design-system/commit/4b65c32e544f8c9953de78d375ee4959957670d1))
|
|
11
|
+
|
|
5
12
|
### [0.3.12](https://github.com/spaced-out/ui-design-system/compare/v0.3.11...v0.3.12) (2024-12-18)
|
|
6
13
|
|
|
7
14
|
|
|
@@ -14,12 +14,12 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
14
14
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
15
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
16
16
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
17
|
-
const getNamedComponent = (childrenArray,
|
|
17
|
+
const getNamedComponent = (childrenArray, componentDisplayName) => {
|
|
18
18
|
const nodes = [];
|
|
19
19
|
for (const child of childrenArray) {
|
|
20
20
|
if (
|
|
21
21
|
// $FlowFixMe
|
|
22
|
-
child?.type?.displayName ===
|
|
22
|
+
child?.type?.displayName === componentDisplayName) {
|
|
23
23
|
nodes.push(child);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -44,7 +44,6 @@ const ChatBubble = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
44
44
|
ref: ref,
|
|
45
45
|
"data-testid": "ChatBubble",
|
|
46
46
|
className: (0, _classify.default)(_ChatBubbleModule.default.chatBubbleWrapper, {
|
|
47
|
-
[_ChatBubbleModule.default.chatBubbleWrapperLeft]: isLeftAligned,
|
|
48
47
|
[_ChatBubbleModule.default.chatBubbleWrapperRight]: !isLeftAligned
|
|
49
48
|
}, classNames?.wrapper)
|
|
50
49
|
}, anchorComponent, chatComponent);
|
|
@@ -65,8 +64,8 @@ const ChatAnchor = _ref2 => {
|
|
|
65
64
|
}), isAI ? /*#__PURE__*/React.createElement(_Icon.Icon, {
|
|
66
65
|
name: "sparkle",
|
|
67
66
|
color: "information",
|
|
68
|
-
type:
|
|
69
|
-
size:
|
|
67
|
+
type: _Icon.ICON_TYPE.solid,
|
|
68
|
+
size: _Icon.ICON_SIZE.large
|
|
70
69
|
}) : /*#__PURE__*/React.createElement(_Avatar.Avatar, avatarProps)));
|
|
71
70
|
};
|
|
72
71
|
exports.ChatAnchor = ChatAnchor;
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
|
|
5
5
|
import classify from '../../utils/classify';
|
|
6
|
+
import type {AvatarProps} from '../Avatar';
|
|
6
7
|
import {Avatar} from '../Avatar';
|
|
7
|
-
import
|
|
8
|
-
import {Icon} from '../Icon';
|
|
8
|
+
import {Icon, ICON_SIZE, ICON_TYPE} from '../Icon';
|
|
9
9
|
import type {BaseTooltipProps} from '../Tooltip';
|
|
10
10
|
import {Tooltip} from '../Tooltip';
|
|
11
11
|
|
|
@@ -14,13 +14,13 @@ import css from './ChatBubble.module.css';
|
|
|
14
14
|
|
|
15
15
|
const getNamedComponent = (
|
|
16
16
|
childrenArray: Array<React.Node>,
|
|
17
|
-
|
|
18
|
-
): React.Node | React.Node[]
|
|
17
|
+
componentDisplayName: string,
|
|
18
|
+
): ?React.Node | React.Node[] => {
|
|
19
19
|
const nodes: React.Node[] = [];
|
|
20
20
|
for (const child of childrenArray) {
|
|
21
21
|
if (
|
|
22
22
|
// $FlowFixMe
|
|
23
|
-
child?.type?.displayName ===
|
|
23
|
+
child?.type?.displayName === componentDisplayName
|
|
24
24
|
) {
|
|
25
25
|
nodes.push(child);
|
|
26
26
|
}
|
|
@@ -62,7 +62,6 @@ export const ChatBubble: React$AbstractComponent<
|
|
|
62
62
|
className={classify(
|
|
63
63
|
css.chatBubbleWrapper,
|
|
64
64
|
{
|
|
65
|
-
[css.chatBubbleWrapperLeft]: isLeftAligned,
|
|
66
65
|
[css.chatBubbleWrapperRight]: !isLeftAligned,
|
|
67
66
|
},
|
|
68
67
|
classNames?.wrapper,
|
|
@@ -94,7 +93,12 @@ export const ChatAnchor = ({
|
|
|
94
93
|
>
|
|
95
94
|
<Tooltip {...tooltip} hidden={!tooltip}>
|
|
96
95
|
{isAI ? (
|
|
97
|
-
<Icon
|
|
96
|
+
<Icon
|
|
97
|
+
name="sparkle"
|
|
98
|
+
color="information"
|
|
99
|
+
type={ICON_TYPE.solid}
|
|
100
|
+
size={ICON_SIZE.large}
|
|
101
|
+
/>
|
|
98
102
|
) : (
|
|
99
103
|
<Avatar {...avatarProps} />
|
|
100
104
|
)}
|
|
@@ -1,29 +1,41 @@
|
|
|
1
|
-
@value (
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
@value (
|
|
2
|
+
spaceNone,
|
|
3
|
+
spaceXSmall,
|
|
4
|
+
spaceSmall
|
|
5
|
+
) from '../../styles/variables/_space.css';
|
|
6
|
+
@value (
|
|
7
|
+
colorBorderPrimary,
|
|
8
|
+
colorBackgroundTertiary,
|
|
9
|
+
colorNeutralLightest,
|
|
10
|
+
colorFillPrimary,
|
|
11
|
+
colorInformation
|
|
12
|
+
) from '../../styles/variables/_color.css';
|
|
13
|
+
@value (
|
|
14
|
+
borderWidthPrimary,
|
|
15
|
+
borderRadiusSmall,
|
|
16
|
+
borderRadiusCircle
|
|
10
17
|
) from '../../styles/variables/_border.css';
|
|
11
|
-
@value (
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
18
|
+
@value (
|
|
19
|
+
size2,
|
|
20
|
+
size12,
|
|
21
|
+
size24,
|
|
22
|
+
size42,
|
|
23
|
+
size580
|
|
24
|
+
) from '../../styles/variables/_size.css';
|
|
25
|
+
@value (
|
|
26
|
+
opacity100,
|
|
27
|
+
opacity60,
|
|
28
|
+
opacity80
|
|
29
|
+
) from '../../styles/variables/_opacity.css';
|
|
15
30
|
|
|
16
31
|
.chatBubbleWrapper {
|
|
17
32
|
display: flex;
|
|
18
33
|
gap: spaceSmall;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
.chatBubbleWrapperLeft {
|
|
22
|
-
flex-direction: row; /* ChatAnchor comes first */
|
|
34
|
+
flex-direction: row;
|
|
23
35
|
}
|
|
24
36
|
|
|
25
37
|
.chatBubbleWrapperRight {
|
|
26
|
-
flex-direction: row-reverse;
|
|
38
|
+
flex-direction: row-reverse;
|
|
27
39
|
}
|
|
28
40
|
|
|
29
41
|
.chatAnchorWrapper {
|
|
@@ -74,11 +86,7 @@ borderRadiusSmall
|
|
|
74
86
|
.loadingText {
|
|
75
87
|
composes: buttonTextMedium from '../../styles/typography.module.css';
|
|
76
88
|
display: inline-flex;
|
|
77
|
-
background: linear-gradient(
|
|
78
|
-
90deg,
|
|
79
|
-
colorFillPrimary 0%,
|
|
80
|
-
colorInformation 100%
|
|
81
|
-
);
|
|
89
|
+
background: linear-gradient(90deg, colorFillPrimary, colorInformation);
|
|
82
90
|
-webkit-background-clip: text;
|
|
83
91
|
-webkit-text-fill-color: transparent;
|
|
84
92
|
background-clip: text;
|
|
@@ -96,12 +104,8 @@ borderRadiusSmall
|
|
|
96
104
|
.dot {
|
|
97
105
|
width: calc(size12/4);
|
|
98
106
|
height: calc(size12/4);
|
|
99
|
-
background: linear-gradient(
|
|
100
|
-
|
|
101
|
-
colorFillPrimary 0%,
|
|
102
|
-
colorInformation 100%
|
|
103
|
-
);
|
|
104
|
-
border-radius: 50%; /* Makes dots circular */
|
|
107
|
+
background: linear-gradient(90deg, colorFillPrimary, colorInformation);
|
|
108
|
+
border-radius: borderRadiusCircle;
|
|
105
109
|
opacity: opacity80;
|
|
106
110
|
|
|
107
111
|
/* Bounce Animation */
|