@pushwoosh/dumb-components 4.8.0 → 4.8.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.
- package/ChatPreview/components/ButtonLabel/ButtonLabel.d.ts +4 -0
- package/ChatPreview/components/ButtonLabel/ButtonLabel.js +20 -0
- package/ChatPreview/components/ButtonLabel/index.d.ts +1 -0
- package/ChatPreview/components/ButtonLabel/index.js +1 -0
- package/ChatPreview/components/ButtonLabel/styles.d.ts +3 -0
- package/ChatPreview/components/ButtonLabel/styles.js +5 -0
- package/ChatPreview/components/ButtonLabel/types.d.ts +5 -0
- package/ChatPreview/components/ButtonLabel/types.js +1 -0
- package/ChatPreview/components/ChatCardView/ChatCardView.js +4 -1
- package/ChatPreview/components/MessageBubble/MessageBubble.js +4 -1
- package/package.json +1 -1
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type ReactElement } from 'react';
|
|
2
|
+
import type { ButtonLabelProps } from './types';
|
|
3
|
+
/** A button title with the glyph chats put on link and phone buttons, so they don't read as quick replies. */
|
|
4
|
+
export declare function ButtonLabel(props: ButtonLabelProps): ReactElement;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { CallIcon, OpenIcon } from '@pushwoosh/kit-icons';
|
|
3
|
+
import { Label } from './styles';
|
|
4
|
+
/** A button title with the glyph chats put on link and phone buttons, so they don't read as quick replies. */
|
|
5
|
+
export function ButtonLabel(props) {
|
|
6
|
+
const {
|
|
7
|
+
button
|
|
8
|
+
} = props;
|
|
9
|
+
return _jsxs(Label, {
|
|
10
|
+
children: [button.kind === 'url' && _jsx(OpenIcon, {
|
|
11
|
+
"data-testid": "chat-button-url",
|
|
12
|
+
size: "small",
|
|
13
|
+
view: "lined"
|
|
14
|
+
}), button.kind === 'phone' && _jsx(CallIcon, {
|
|
15
|
+
"data-testid": "chat-button-phone",
|
|
16
|
+
size: "small",
|
|
17
|
+
view: "lined"
|
|
18
|
+
}), button.title]
|
|
19
|
+
});
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ButtonLabel } from './ButtonLabel';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ButtonLabel } from './ButtonLabel';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const Label: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "style"> & {
|
|
2
|
+
style?: import("react").CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
|
|
3
|
+
}> & string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -3,6 +3,7 @@ import { CardBody, CardButton, CardButtons, CardFrame, CardTitle, Thumbnail } fr
|
|
|
3
3
|
import { RCS_MEDIA_HEIGHT } from '../../constants';
|
|
4
4
|
import { rcsLayoutOf } from '../../helpers';
|
|
5
5
|
import { Footer } from '../../styles';
|
|
6
|
+
import { ButtonLabel } from '../ButtonLabel';
|
|
6
7
|
import { ChatMediaView } from '../ChatMediaView';
|
|
7
8
|
import { ChatText } from '../ChatText';
|
|
8
9
|
import { Deliverable } from '../Deliverable';
|
|
@@ -54,7 +55,9 @@ export function ChatCardView(props) {
|
|
|
54
55
|
}), Boolean(card.buttons?.length) && _jsx(CardButtons, {
|
|
55
56
|
children: card.buttons?.map(button => _jsx(CardButton, {
|
|
56
57
|
"$skin": look.skin,
|
|
57
|
-
children:
|
|
58
|
+
children: _jsx(ButtonLabel, {
|
|
59
|
+
button: button
|
|
60
|
+
})
|
|
58
61
|
}, button.id))
|
|
59
62
|
})]
|
|
60
63
|
});
|
|
@@ -3,6 +3,7 @@ import { ListIcon } from '@pushwoosh/kit-icons';
|
|
|
3
3
|
import { InlineButton, InlineButtons } from './styles';
|
|
4
4
|
import { bubbleButtonsOf } from '../../helpers';
|
|
5
5
|
import { Bubble, Footer, HeaderText } from '../../styles';
|
|
6
|
+
import { ButtonLabel } from '../ButtonLabel';
|
|
6
7
|
import { ChatMediaView } from '../ChatMediaView';
|
|
7
8
|
import { ChatText } from '../ChatText';
|
|
8
9
|
import { Deliverable } from '../Deliverable';
|
|
@@ -54,7 +55,9 @@ export function MessageBubble(props) {
|
|
|
54
55
|
}), (inlineButtons.length > 0 || content.list) && _jsxs(InlineButtons, {
|
|
55
56
|
children: [inlineButtons.map(button => _jsx(InlineButton, {
|
|
56
57
|
"$skin": look.skin,
|
|
57
|
-
children:
|
|
58
|
+
children: _jsx(ButtonLabel, {
|
|
59
|
+
button: button
|
|
60
|
+
})
|
|
58
61
|
}, button.id)), content.list && _jsxs(InlineButton, {
|
|
59
62
|
"$skin": look.skin,
|
|
60
63
|
children: [_jsx(ListIcon, {
|