@pushwoosh/dumb-components 1.1.208 → 1.1.210

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.
Files changed (103) hide show
  1. package/Divider/index.d.ts +1 -0
  2. package/Divider/index.js +1 -0
  3. package/Divider/styles.d.ts +2 -0
  4. package/Divider/styles.js +7 -0
  5. package/WhatsAppPreview/WhatsAppPreview.d.ts +4 -0
  6. package/WhatsAppPreview/WhatsAppPreview.js +103 -0
  7. package/WhatsAppPreview/__tests__/parseWhatsAppMarkup.test.d.ts +1 -0
  8. package/WhatsAppPreview/__tests__/parseWhatsAppMarkup.test.js +59 -0
  9. package/WhatsAppPreview/components/WhatsAppChatHeader/WhatsAppChatHeader.d.ts +4 -0
  10. package/WhatsAppPreview/components/WhatsAppChatHeader/WhatsAppChatHeader.js +39 -0
  11. package/WhatsAppPreview/components/WhatsAppChatHeader/index.d.ts +1 -0
  12. package/WhatsAppPreview/components/WhatsAppChatHeader/index.js +1 -0
  13. package/WhatsAppPreview/components/WhatsAppChatHeader/styles.d.ts +47 -0
  14. package/WhatsAppPreview/components/WhatsAppChatHeader/styles.js +37 -0
  15. package/WhatsAppPreview/components/WhatsAppChatHeader/types.d.ts +10 -0
  16. package/WhatsAppPreview/components/WhatsAppChatHeader/types.js +1 -0
  17. package/WhatsAppPreview/components/WhatsAppDateChip/WhatsAppDateChip.d.ts +4 -0
  18. package/WhatsAppPreview/components/WhatsAppDateChip/WhatsAppDateChip.js +28 -0
  19. package/WhatsAppPreview/components/WhatsAppDateChip/index.d.ts +1 -0
  20. package/WhatsAppPreview/components/WhatsAppDateChip/index.js +1 -0
  21. package/WhatsAppPreview/components/WhatsAppDateChip/styles.d.ts +6 -0
  22. package/WhatsAppPreview/components/WhatsAppDateChip/styles.js +6 -0
  23. package/WhatsAppPreview/components/WhatsAppDateChip/types.d.ts +6 -0
  24. package/WhatsAppPreview/components/WhatsAppDateChip/types.js +1 -0
  25. package/WhatsAppPreview/components/WhatsAppFormattedText/WhatsAppFormattedText.d.ts +4 -0
  26. package/WhatsAppPreview/components/WhatsAppFormattedText/WhatsAppFormattedText.js +39 -0
  27. package/WhatsAppPreview/components/WhatsAppFormattedText/index.d.ts +1 -0
  28. package/WhatsAppPreview/components/WhatsAppFormattedText/index.js +1 -0
  29. package/WhatsAppPreview/components/WhatsAppFormattedText/types.d.ts +16 -0
  30. package/WhatsAppPreview/components/WhatsAppFormattedText/types.js +1 -0
  31. package/WhatsAppPreview/components/WhatsAppMessageBubble/WhatsAppMessageBubble.d.ts +4 -0
  32. package/WhatsAppPreview/components/WhatsAppMessageBubble/WhatsAppMessageBubble.js +34 -0
  33. package/WhatsAppPreview/components/WhatsAppMessageBubble/index.d.ts +1 -0
  34. package/WhatsAppPreview/components/WhatsAppMessageBubble/index.js +1 -0
  35. package/WhatsAppPreview/components/WhatsAppMessageBubble/styles.d.ts +23 -0
  36. package/WhatsAppPreview/components/WhatsAppMessageBubble/styles.js +25 -0
  37. package/WhatsAppPreview/components/WhatsAppMessageBubble/types.d.ts +6 -0
  38. package/WhatsAppPreview/components/WhatsAppMessageBubble/types.js +1 -0
  39. package/WhatsAppPreview/components/WhatsAppStatusBar/WhatsAppStatusBar.d.ts +4 -0
  40. package/WhatsAppPreview/components/WhatsAppStatusBar/WhatsAppStatusBar.js +37 -0
  41. package/WhatsAppPreview/components/WhatsAppStatusBar/index.d.ts +1 -0
  42. package/WhatsAppPreview/components/WhatsAppStatusBar/index.js +1 -0
  43. package/WhatsAppPreview/components/WhatsAppStatusBar/styles.d.ts +15 -0
  44. package/WhatsAppPreview/components/WhatsAppStatusBar/styles.js +10 -0
  45. package/WhatsAppPreview/components/WhatsAppStatusBar/types.d.ts +5 -0
  46. package/WhatsAppPreview/components/WhatsAppStatusBar/types.js +1 -0
  47. package/WhatsAppPreview/constants.d.ts +26 -0
  48. package/WhatsAppPreview/constants.js +26 -0
  49. package/WhatsAppPreview/helpers.d.ts +3 -0
  50. package/WhatsAppPreview/helpers.js +56 -0
  51. package/WhatsAppPreview/icons/WhatsAppAvatarIcon.svg +1 -0
  52. package/WhatsAppPreview/icons/WhatsAppBackIcon.svg +1 -0
  53. package/WhatsAppPreview/icons/WhatsAppBatteryIcon.svg +1 -0
  54. package/WhatsAppPreview/icons/WhatsAppCallIcon.svg +1 -0
  55. package/WhatsAppPreview/icons/WhatsAppMenuIcon.svg +1 -0
  56. package/WhatsAppPreview/icons/WhatsAppSignalIcon.svg +1 -0
  57. package/WhatsAppPreview/icons/WhatsAppTickIcon.svg +1 -0
  58. package/WhatsAppPreview/icons/WhatsAppTicksIcon.svg +1 -0
  59. package/WhatsAppPreview/icons/WhatsAppWallpaperPattern.svg +1 -0
  60. package/WhatsAppPreview/icons/WhatsAppWifiIcon.svg +1 -0
  61. package/WhatsAppPreview/icons/index.d.ts +10 -0
  62. package/WhatsAppPreview/icons/index.js +10 -0
  63. package/WhatsAppPreview/index.d.ts +2 -0
  64. package/WhatsAppPreview/index.js +1 -0
  65. package/WhatsAppPreview/polyglot/index.d.ts +2 -0
  66. package/WhatsAppPreview/polyglot/index.js +34 -0
  67. package/WhatsAppPreview/polyglot/messages_ar.d.ts +3 -0
  68. package/WhatsAppPreview/polyglot/messages_ar.js +5 -0
  69. package/WhatsAppPreview/polyglot/messages_bn.d.ts +3 -0
  70. package/WhatsAppPreview/polyglot/messages_bn.js +5 -0
  71. package/WhatsAppPreview/polyglot/messages_de.d.ts +3 -0
  72. package/WhatsAppPreview/polyglot/messages_de.js +5 -0
  73. package/WhatsAppPreview/polyglot/messages_en.d.ts +3 -0
  74. package/WhatsAppPreview/polyglot/messages_en.js +5 -0
  75. package/WhatsAppPreview/polyglot/messages_es.d.ts +3 -0
  76. package/WhatsAppPreview/polyglot/messages_es.js +5 -0
  77. package/WhatsAppPreview/polyglot/messages_fr.d.ts +3 -0
  78. package/WhatsAppPreview/polyglot/messages_fr.js +5 -0
  79. package/WhatsAppPreview/polyglot/messages_he.d.ts +3 -0
  80. package/WhatsAppPreview/polyglot/messages_he.js +5 -0
  81. package/WhatsAppPreview/polyglot/messages_hi.d.ts +3 -0
  82. package/WhatsAppPreview/polyglot/messages_hi.js +5 -0
  83. package/WhatsAppPreview/polyglot/messages_ja.d.ts +3 -0
  84. package/WhatsAppPreview/polyglot/messages_ja.js +5 -0
  85. package/WhatsAppPreview/polyglot/messages_ko.d.ts +3 -0
  86. package/WhatsAppPreview/polyglot/messages_ko.js +5 -0
  87. package/WhatsAppPreview/polyglot/messages_pt.d.ts +3 -0
  88. package/WhatsAppPreview/polyglot/messages_pt.js +5 -0
  89. package/WhatsAppPreview/polyglot/messages_ru.d.ts +3 -0
  90. package/WhatsAppPreview/polyglot/messages_ru.js +5 -0
  91. package/WhatsAppPreview/polyglot/messages_th.d.ts +3 -0
  92. package/WhatsAppPreview/polyglot/messages_th.js +5 -0
  93. package/WhatsAppPreview/polyglot/messages_zh.d.ts +3 -0
  94. package/WhatsAppPreview/polyglot/messages_zh.js +5 -0
  95. package/WhatsAppPreview/polyglot/types.d.ts +6 -0
  96. package/WhatsAppPreview/polyglot/types.js +1 -0
  97. package/WhatsAppPreview/styles.d.ts +34 -0
  98. package/WhatsAppPreview/styles.js +24 -0
  99. package/WhatsAppPreview/types.d.ts +45 -0
  100. package/WhatsAppPreview/types.js +1 -0
  101. package/index.d.ts +3 -0
  102. package/index.js +2 -0
  103. package/package.json +1 -1
@@ -0,0 +1,15 @@
1
+ export declare const StatusBarIndicators: import("styled-components").StyledComponent<"div", any, import("@pushwoosh/kit-helpers/styled-helpers").CommonBoxProps & {
2
+ $alignContent?: import("@pushwoosh/kit-helpers/styled-helpers").AlignContentValue | undefined;
3
+ $alignItems?: import("@pushwoosh/kit-helpers/styled-helpers").ItemAlignmentValue | undefined;
4
+ $gap?: import("@pushwoosh/kit-helpers/styled-helpers").StrNum | undefined;
5
+ $justifyContent?: import("@pushwoosh/kit-helpers/styled-helpers").JustifyContentValue | undefined;
6
+ } & {
7
+ $gridAutoFlow?: "row" | "column" | "dense" | "row dense" | "column dense" | undefined;
8
+ $justifyItems?: import("@pushwoosh/kit-helpers/styled-helpers").ItemAlignmentValue | undefined;
9
+ $placeItems?: import("@pushwoosh/kit-helpers/styled-helpers").ItemAlignmentValue | undefined;
10
+ } & {
11
+ $gridAutoFlow: string;
12
+ } & {
13
+ $alignItems: string;
14
+ $gap: number;
15
+ }, "$gridAutoFlow" | "$alignItems" | "$gap">;
@@ -0,0 +1,10 @@
1
+ import styled from 'styled-components';
2
+ import { Horizontal } from '@pushwoosh/kit-helpers';
3
+ import { WHATSAPP_COLOR } from '../../constants';
4
+ export const StatusBarIndicators = styled(Horizontal).attrs({
5
+ $alignItems: 'center',
6
+ $gap: 5
7
+ }).withConfig({
8
+ displayName: "StatusBarIndicators",
9
+ componentId: "sc-lua8an-0"
10
+ })(["color:", ";svg{display:block;}"], WHATSAPP_COLOR.STATUS_BAR);
@@ -0,0 +1,5 @@
1
+ /** Props of {@link WhatsAppStatusBar}. */
2
+ export interface WhatsAppStatusBarProps {
3
+ /** Clock shown on the left side of the status bar. */
4
+ time: string;
5
+ }
@@ -0,0 +1,26 @@
1
+ /** Colours of the replicated WhatsApp chat UI; they are WhatsApp's, not Pushwoosh design tokens. */
2
+ export declare const WHATSAPP_COLOR: {
3
+ readonly DEVICE_SHELL: "#DFE2E5";
4
+ readonly DEVICE_EDGE: "#C7CCD1";
5
+ readonly SCREEN: "#EFE7DE";
6
+ readonly HEADER: "#F6F3EF";
7
+ readonly HEADER_BORDER: "#DAD5CF";
8
+ readonly ISLAND: "#2B2F33";
9
+ readonly STATUS_BAR: "#0B0C0D";
10
+ readonly TITLE: "#111B21";
11
+ readonly SUBTITLE: "#667781";
12
+ readonly ACTION: "#3B4A54";
13
+ readonly AVATAR: "#CFD6DB";
14
+ readonly AVATAR_GLYPH: "#FFFFFF";
15
+ readonly INCOMING_BUBBLE: "#FFFFFF";
16
+ readonly OUTGOING_BUBBLE: "#D9FDD3";
17
+ readonly BUBBLE_TEXT: "#111B21";
18
+ readonly BUBBLE_META: "#667781";
19
+ readonly BUBBLE_SHADOW: "rgba(11, 20, 26, 0.13)";
20
+ readonly READ_TICK: "#53BDEB";
21
+ readonly DATE_CHIP_TEXT: "#54656F";
22
+ readonly WALLPAPER_INK: "#D8CCBD";
23
+ };
24
+ export declare const WHATSAPP_PREVIEW_WIDTH = 340;
25
+ export declare const WHATSAPP_PREVIEW_HEIGHT = 640;
26
+ export declare const WHATSAPP_STATUS_BAR_TIME = "12:02";
@@ -0,0 +1,26 @@
1
+ /** Colours of the replicated WhatsApp chat UI; they are WhatsApp's, not Pushwoosh design tokens. */
2
+ export const WHATSAPP_COLOR = {
3
+ DEVICE_SHELL: '#DFE2E5',
4
+ DEVICE_EDGE: '#C7CCD1',
5
+ SCREEN: '#EFE7DE',
6
+ HEADER: '#F6F3EF',
7
+ HEADER_BORDER: '#DAD5CF',
8
+ ISLAND: '#2B2F33',
9
+ STATUS_BAR: '#0B0C0D',
10
+ TITLE: '#111B21',
11
+ SUBTITLE: '#667781',
12
+ ACTION: '#3B4A54',
13
+ AVATAR: '#CFD6DB',
14
+ AVATAR_GLYPH: '#FFFFFF',
15
+ INCOMING_BUBBLE: '#FFFFFF',
16
+ OUTGOING_BUBBLE: '#D9FDD3',
17
+ BUBBLE_TEXT: '#111B21',
18
+ BUBBLE_META: '#667781',
19
+ BUBBLE_SHADOW: 'rgba(11, 20, 26, 0.13)',
20
+ READ_TICK: '#53BDEB',
21
+ DATE_CHIP_TEXT: '#54656F',
22
+ WALLPAPER_INK: '#D8CCBD'
23
+ };
24
+ export const WHATSAPP_PREVIEW_WIDTH = 340;
25
+ export const WHATSAPP_PREVIEW_HEIGHT = 640;
26
+ export const WHATSAPP_STATUS_BAR_TIME = '12:02';
@@ -0,0 +1,3 @@
1
+ import type { WhatsAppTextNode } from './components/WhatsAppFormattedText/types';
2
+ /** Splits WhatsApp markup (`*bold*`, `_italic_`, `~strike~`, backtick monospace) into a render tree. */
3
+ export declare function parseWhatsAppMarkup(text: string): WhatsAppTextNode[];
@@ -0,0 +1,56 @@
1
+ const MARKERS = [{
2
+ style: 'mono',
3
+ marker: '```'
4
+ }, {
5
+ style: 'mono',
6
+ marker: '`'
7
+ }, {
8
+ style: 'bold',
9
+ marker: '*'
10
+ }, {
11
+ style: 'italic',
12
+ marker: '_'
13
+ }, {
14
+ style: 'strike',
15
+ marker: '~'
16
+ }];
17
+ function findMarkerAt(text, index) {
18
+ return MARKERS.find(({
19
+ marker
20
+ }) => text.startsWith(marker, index)) || null;
21
+ }
22
+ /** Splits WhatsApp markup (`*bold*`, `_italic_`, `~strike~`, backtick monospace) into a render tree. */
23
+ export function parseWhatsAppMarkup(text) {
24
+ const nodes = [];
25
+ let plain = '';
26
+ let index = 0;
27
+ const flush = () => {
28
+ if (plain) {
29
+ nodes.push({
30
+ text: plain
31
+ });
32
+ plain = '';
33
+ }
34
+ };
35
+ while (index < text.length) {
36
+ const found = findMarkerAt(text, index);
37
+ const openEnd = found ? index + found.marker.length : index;
38
+ const closeStart = found ? text.indexOf(found.marker, openEnd) : -1;
39
+ if (!found || closeStart <= openEnd) {
40
+ plain += text[index];
41
+ index += 1;
42
+ continue;
43
+ }
44
+ const inner = text.slice(openEnd, closeStart);
45
+ flush();
46
+ nodes.push({
47
+ style: found.style,
48
+ children: found.style === 'mono' ? [{
49
+ text: inner
50
+ }] : parseWhatsAppMarkup(inner)
51
+ });
52
+ index = closeStart + found.marker.length;
53
+ }
54
+ flush();
55
+ return nodes;
56
+ }
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor"><circle cx="12" cy="8.5" r="4"/><path d="M4 20.5c0-3.9 3.6-6.5 8-6.5s8 2.6 8 6.5z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="11" height="20" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m9.5 1.5-8 8.5 8 8.5"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="25" height="12" fill="none"><rect width="21" height="10.8" x=".6" y=".6" stroke="currentColor" stroke-opacity=".4" stroke-width="1.2" rx="3"/><rect width="17.8" height="7.6" x="2.2" y="2.2" fill="currentColor" rx="1.8"/><path fill="currentColor" fill-opacity=".4" d="M23.2 4.2v3.6a2 2 0 0 0 0-3.6"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"><path d="M6.3 2.5H3.9a1.6 1.6 0 0 0-1.6 1.8c.4 3.4 1.9 6.5 4.3 8.9s5.5 3.9 8.9 4.3a1.6 1.6 0 0 0 1.8-1.6v-2.4a1.2 1.2 0 0 0-1-1.2l-2.3-.4a1.2 1.2 0 0 0-1.2.5l-.8 1.1a10.6 10.6 0 0 1-4.6-4.6l1.1-.8A1.2 1.2 0 0 0 9 6.9l-.4-2.3a1.2 1.2 0 0 0-1.2-1Z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor"><circle cx="10" cy="4" r="1.7"/><circle cx="10" cy="10" r="1.7"/><circle cx="10" cy="16" r="1.7"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="18" height="12" fill="currentColor"><rect width="3" height="4" y="8" rx="1"/><rect width="3" height="6.5" x="5" y="5.5" rx="1"/><rect width="3" height="9" x="10" y="3" rx="1"/><rect width="3" height="12" x="15" rx="1"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="12" height="11" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.4"><path d="m1 6.1 2.6 2.7 7-6.8"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="11" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.4"><path d="m1 6.1 2.6 2.7L9.2 2M6.4 6.9 8 8.8 14.6 2"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg"><defs><pattern id="a" width="150" height="150" patternUnits="userSpaceOnUse"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.4"><path d="M18 24c-4-4-7-6-7-9a3.2 3.2 0 0 1 5.9-1.6A3.2 3.2 0 0 1 25 15c0 3-3 5-7 9m34-14h16a3 3 0 0 1 3 3v8a3 3 0 0 1-3 3h-9l-5 4v-4h-2a3 3 0 0 1-3-3v-8a3 3 0 0 1 3-3m60 2 2.6 5.4 5.9.8-4.3 4.1 1 5.9-5.2-2.8-5.2 2.8 1-5.9-4.3-4.1 5.9-.8ZM14 56h12v8a6 6 0 0 1-12 0zm12 2h3a3 3 0 0 1 0 6h-3M13 74h14m33-6V54l10-2v14"/><circle cx="57" cy="68" r="3"/><circle cx="67" cy="66" r="3"/><path d="M100 58h4l2-3h8l2 3h4a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-20a2 2 0 0 1-2-2V60a2 2 0 0 1 2-2"/><circle cx="110" cy="65" r="4.5"/><circle cx="20" cy="105" r="9"/><path d="M16 108a5 5 0 0 0 8 0"/><circle cx="17" cy="102" r=".9"/><circle cx="23" cy="102" r=".9"/><path d="M54 100h18v13H54zm9 0v13m-9-13a4 4 0 0 1 9-2 4 4 0 0 1 9 2m28 10 22-9-9 22-4-9Z"/><circle cx="133" cy="133" r="8"/><path d="M133 128v5l3 2M126 24h10m-5-5v10"/></g></pattern></defs><rect width="100%" height="100%" fill="url(#a)"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="12" fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="1.7"><path d="M1 4.2a11 11 0 0 1 14 0M3.6 7a7.2 7.2 0 0 1 8.8 0M6.2 9.7a3.3 3.3 0 0 1 3.6 0"/></svg>
@@ -0,0 +1,10 @@
1
+ export { default as WhatsAppAvatarIcon } from './WhatsAppAvatarIcon.svg';
2
+ export { default as WhatsAppBackIcon } from './WhatsAppBackIcon.svg';
3
+ export { default as WhatsAppBatteryIcon } from './WhatsAppBatteryIcon.svg';
4
+ export { default as WhatsAppCallIcon } from './WhatsAppCallIcon.svg';
5
+ export { default as WhatsAppMenuIcon } from './WhatsAppMenuIcon.svg';
6
+ export { default as WhatsAppSignalIcon } from './WhatsAppSignalIcon.svg';
7
+ export { default as WhatsAppTickIcon } from './WhatsAppTickIcon.svg';
8
+ export { default as WhatsAppTicksIcon } from './WhatsAppTicksIcon.svg';
9
+ export { default as WhatsAppWallpaperPattern } from './WhatsAppWallpaperPattern.svg';
10
+ export { default as WhatsAppWifiIcon } from './WhatsAppWifiIcon.svg';
@@ -0,0 +1,10 @@
1
+ export { default as WhatsAppAvatarIcon } from './WhatsAppAvatarIcon.svg';
2
+ export { default as WhatsAppBackIcon } from './WhatsAppBackIcon.svg';
3
+ export { default as WhatsAppBatteryIcon } from './WhatsAppBatteryIcon.svg';
4
+ export { default as WhatsAppCallIcon } from './WhatsAppCallIcon.svg';
5
+ export { default as WhatsAppMenuIcon } from './WhatsAppMenuIcon.svg';
6
+ export { default as WhatsAppSignalIcon } from './WhatsAppSignalIcon.svg';
7
+ export { default as WhatsAppTickIcon } from './WhatsAppTickIcon.svg';
8
+ export { default as WhatsAppTicksIcon } from './WhatsAppTicksIcon.svg';
9
+ export { default as WhatsAppWallpaperPattern } from './WhatsAppWallpaperPattern.svg';
10
+ export { default as WhatsAppWifiIcon } from './WhatsAppWifiIcon.svg';
@@ -0,0 +1,2 @@
1
+ export { WhatsAppPreview } from './WhatsAppPreview';
2
+ export type { WhatsAppMessage, WhatsAppMessageDirection, WhatsAppMessageStatus, WhatsAppPreviewProps, } from './types';
@@ -0,0 +1 @@
1
+ export { WhatsAppPreview } from './WhatsAppPreview';
@@ -0,0 +1,2 @@
1
+ import { type WhatsAppPreviewMessages } from './types';
2
+ export declare const Lang: import("react").FC<import("../../polyglot").LangProps<WhatsAppPreviewMessages>>, useLang: () => (props: import("../../polyglot").LangProps<WhatsAppPreviewMessages>) => string;
@@ -0,0 +1,34 @@
1
+ import { messages as ar } from './messages_ar';
2
+ import { messages as bn } from './messages_bn';
3
+ import { messages as de } from './messages_de';
4
+ import { messages as en } from './messages_en';
5
+ import { messages as es } from './messages_es';
6
+ import { messages as fr } from './messages_fr';
7
+ import { messages as he } from './messages_he';
8
+ import { messages as hi } from './messages_hi';
9
+ import { messages as ja } from './messages_ja';
10
+ import { messages as ko } from './messages_ko';
11
+ import { messages as pt } from './messages_pt';
12
+ import { messages as ru } from './messages_ru';
13
+ import { messages as th } from './messages_th';
14
+ import { messages as zh } from './messages_zh';
15
+ import { createLang } from '../../polyglot';
16
+ export const {
17
+ Lang,
18
+ useLang
19
+ } = createLang({
20
+ ar,
21
+ bn,
22
+ de,
23
+ en,
24
+ es,
25
+ fr,
26
+ he,
27
+ hi,
28
+ ja,
29
+ ko,
30
+ pt,
31
+ ru,
32
+ th,
33
+ zh
34
+ });
@@ -0,0 +1,3 @@
1
+ import { type WhatsAppPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<WhatsAppPreviewMessages>;
@@ -0,0 +1,5 @@
1
+ export const messages = {
2
+ 'DUMB.WHATSAPP_PREVIEW.BUSINESS_ACCOUNT': 'حساب أعمال',
3
+ 'DUMB.WHATSAPP_PREVIEW.EMPTY': 'الرسالة فارغة…',
4
+ 'DUMB.WHATSAPP_PREVIEW.TODAY': 'اليوم'
5
+ };
@@ -0,0 +1,3 @@
1
+ import { type WhatsAppPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<WhatsAppPreviewMessages>;
@@ -0,0 +1,5 @@
1
+ export const messages = {
2
+ 'DUMB.WHATSAPP_PREVIEW.BUSINESS_ACCOUNT': 'ব্যবসায়িক অ্যাকাউন্ট',
3
+ 'DUMB.WHATSAPP_PREVIEW.EMPTY': 'বার্তাটি খালি…',
4
+ 'DUMB.WHATSAPP_PREVIEW.TODAY': 'আজ'
5
+ };
@@ -0,0 +1,3 @@
1
+ import { type WhatsAppPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<WhatsAppPreviewMessages>;
@@ -0,0 +1,5 @@
1
+ export const messages = {
2
+ 'DUMB.WHATSAPP_PREVIEW.BUSINESS_ACCOUNT': 'Unternehmenskonto',
3
+ 'DUMB.WHATSAPP_PREVIEW.EMPTY': 'Die Nachricht ist leer…',
4
+ 'DUMB.WHATSAPP_PREVIEW.TODAY': 'Heute'
5
+ };
@@ -0,0 +1,3 @@
1
+ import { type WhatsAppPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<WhatsAppPreviewMessages>;
@@ -0,0 +1,5 @@
1
+ export const messages = {
2
+ 'DUMB.WHATSAPP_PREVIEW.BUSINESS_ACCOUNT': 'Business account',
3
+ 'DUMB.WHATSAPP_PREVIEW.EMPTY': 'Message is empty…',
4
+ 'DUMB.WHATSAPP_PREVIEW.TODAY': 'Today'
5
+ };
@@ -0,0 +1,3 @@
1
+ import { type WhatsAppPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<WhatsAppPreviewMessages>;
@@ -0,0 +1,5 @@
1
+ export const messages = {
2
+ 'DUMB.WHATSAPP_PREVIEW.BUSINESS_ACCOUNT': 'Cuenta de empresa',
3
+ 'DUMB.WHATSAPP_PREVIEW.EMPTY': 'El mensaje está vacío…',
4
+ 'DUMB.WHATSAPP_PREVIEW.TODAY': 'Hoy'
5
+ };
@@ -0,0 +1,3 @@
1
+ import { type WhatsAppPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<WhatsAppPreviewMessages>;
@@ -0,0 +1,5 @@
1
+ export const messages = {
2
+ 'DUMB.WHATSAPP_PREVIEW.BUSINESS_ACCOUNT': 'Compte professionnel',
3
+ 'DUMB.WHATSAPP_PREVIEW.EMPTY': 'Le message est vide…',
4
+ 'DUMB.WHATSAPP_PREVIEW.TODAY': 'Aujourd’hui'
5
+ };
@@ -0,0 +1,3 @@
1
+ import { type WhatsAppPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<WhatsAppPreviewMessages>;
@@ -0,0 +1,5 @@
1
+ export const messages = {
2
+ 'DUMB.WHATSAPP_PREVIEW.BUSINESS_ACCOUNT': 'חשבון עסקי',
3
+ 'DUMB.WHATSAPP_PREVIEW.EMPTY': 'ההודעה ריקה…',
4
+ 'DUMB.WHATSAPP_PREVIEW.TODAY': 'היום'
5
+ };
@@ -0,0 +1,3 @@
1
+ import { type WhatsAppPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<WhatsAppPreviewMessages>;
@@ -0,0 +1,5 @@
1
+ export const messages = {
2
+ 'DUMB.WHATSAPP_PREVIEW.BUSINESS_ACCOUNT': 'व्यवसाय खाता',
3
+ 'DUMB.WHATSAPP_PREVIEW.EMPTY': 'संदेश खाली है…',
4
+ 'DUMB.WHATSAPP_PREVIEW.TODAY': 'आज'
5
+ };
@@ -0,0 +1,3 @@
1
+ import { type WhatsAppPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<WhatsAppPreviewMessages>;
@@ -0,0 +1,5 @@
1
+ export const messages = {
2
+ 'DUMB.WHATSAPP_PREVIEW.BUSINESS_ACCOUNT': 'ビジネスアカウント',
3
+ 'DUMB.WHATSAPP_PREVIEW.EMPTY': 'メッセージが空です…',
4
+ 'DUMB.WHATSAPP_PREVIEW.TODAY': '今日'
5
+ };
@@ -0,0 +1,3 @@
1
+ import { type WhatsAppPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<WhatsAppPreviewMessages>;
@@ -0,0 +1,5 @@
1
+ export const messages = {
2
+ 'DUMB.WHATSAPP_PREVIEW.BUSINESS_ACCOUNT': '비즈니스 계정',
3
+ 'DUMB.WHATSAPP_PREVIEW.EMPTY': '메시지가 비어 있습니다…',
4
+ 'DUMB.WHATSAPP_PREVIEW.TODAY': '오늘'
5
+ };
@@ -0,0 +1,3 @@
1
+ import { type WhatsAppPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<WhatsAppPreviewMessages>;
@@ -0,0 +1,5 @@
1
+ export const messages = {
2
+ 'DUMB.WHATSAPP_PREVIEW.BUSINESS_ACCOUNT': 'Conta comercial',
3
+ 'DUMB.WHATSAPP_PREVIEW.EMPTY': 'A mensagem está vazia…',
4
+ 'DUMB.WHATSAPP_PREVIEW.TODAY': 'Hoje'
5
+ };
@@ -0,0 +1,3 @@
1
+ import { type WhatsAppPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<WhatsAppPreviewMessages>;
@@ -0,0 +1,5 @@
1
+ export const messages = {
2
+ 'DUMB.WHATSAPP_PREVIEW.BUSINESS_ACCOUNT': 'Бизнес-аккаунт',
3
+ 'DUMB.WHATSAPP_PREVIEW.EMPTY': 'Сообщение пустое…',
4
+ 'DUMB.WHATSAPP_PREVIEW.TODAY': 'Сегодня'
5
+ };
@@ -0,0 +1,3 @@
1
+ import { type WhatsAppPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<WhatsAppPreviewMessages>;
@@ -0,0 +1,5 @@
1
+ export const messages = {
2
+ 'DUMB.WHATSAPP_PREVIEW.BUSINESS_ACCOUNT': 'บัญชีธุรกิจ',
3
+ 'DUMB.WHATSAPP_PREVIEW.EMPTY': 'ข้อความว่างเปล่า…',
4
+ 'DUMB.WHATSAPP_PREVIEW.TODAY': 'วันนี้'
5
+ };
@@ -0,0 +1,3 @@
1
+ import { type WhatsAppPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<WhatsAppPreviewMessages>;
@@ -0,0 +1,5 @@
1
+ export const messages = {
2
+ 'DUMB.WHATSAPP_PREVIEW.BUSINESS_ACCOUNT': '商业账号',
3
+ 'DUMB.WHATSAPP_PREVIEW.EMPTY': '消息为空…',
4
+ 'DUMB.WHATSAPP_PREVIEW.TODAY': '今天'
5
+ };
@@ -0,0 +1,6 @@
1
+ import type { NoParams } from '../../polyglot';
2
+ export type WhatsAppPreviewMessages = {
3
+ 'DUMB.WHATSAPP_PREVIEW.BUSINESS_ACCOUNT': NoParams;
4
+ 'DUMB.WHATSAPP_PREVIEW.EMPTY': NoParams;
5
+ 'DUMB.WHATSAPP_PREVIEW.TODAY': NoParams;
6
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,34 @@
1
+ export declare const DeviceBox: import("styled-components").StyledComponent<"div", any, import("@pushwoosh/kit-helpers/styled-helpers").CommonBoxProps & {
2
+ $alignContent?: import("@pushwoosh/kit-helpers/styled-helpers").AlignContentValue | undefined;
3
+ $alignItems?: import("@pushwoosh/kit-helpers/styled-helpers").ItemAlignmentValue | undefined;
4
+ $gap?: import("@pushwoosh/kit-helpers/styled-helpers").StrNum | undefined;
5
+ $justifyContent?: import("@pushwoosh/kit-helpers/styled-helpers").JustifyContentValue | undefined;
6
+ } & {
7
+ $gridAutoFlow?: "row" | "column" | "dense" | "row dense" | "column dense" | undefined;
8
+ $justifyItems?: import("@pushwoosh/kit-helpers/styled-helpers").ItemAlignmentValue | undefined;
9
+ $placeItems?: import("@pushwoosh/kit-helpers/styled-helpers").ItemAlignmentValue | undefined;
10
+ } & {
11
+ $sizes: import("@pushwoosh/kit-helpers/styled-helpers").StrNum;
12
+ } & {
13
+ $sizes: string;
14
+ $padding: number;
15
+ $borderRadius: number;
16
+ $bgColor: "#DFE2E5";
17
+ $border: string;
18
+ }, "$bgColor" | "$border" | "$borderRadius" | "$padding" | "$sizes">;
19
+ export declare const WallpaperLayer: import("styled-components").StyledComponent<"div", any, import("@pushwoosh/kit-helpers/styled-helpers").CommonBoxProps & {
20
+ $alignContent?: import("@pushwoosh/kit-helpers/styled-helpers").AlignContentValue | undefined;
21
+ $alignItems?: import("@pushwoosh/kit-helpers/styled-helpers").ItemAlignmentValue | undefined;
22
+ $gap?: import("@pushwoosh/kit-helpers/styled-helpers").StrNum | undefined;
23
+ $justifyContent?: import("@pushwoosh/kit-helpers/styled-helpers").JustifyContentValue | undefined;
24
+ } & {
25
+ $gridAutoFlow?: "row" | "column" | "dense" | "row dense" | "column dense" | undefined;
26
+ $justifyItems?: import("@pushwoosh/kit-helpers/styled-helpers").ItemAlignmentValue | undefined;
27
+ $placeItems?: import("@pushwoosh/kit-helpers/styled-helpers").ItemAlignmentValue | undefined;
28
+ } & {
29
+ $gridAutoFlow: string;
30
+ } & {
31
+ $position: string;
32
+ $inset: number;
33
+ }, "$gridAutoFlow" | "$inset" | "$position">;
34
+ export declare const WallpaperImage: import("styled-components").StyledComponent<"img", any, {}, never>;
@@ -0,0 +1,24 @@
1
+ import styled from 'styled-components';
2
+ import { Rows, Vertical } from '@pushwoosh/kit-helpers';
3
+ import { WHATSAPP_COLOR } from './constants';
4
+ export const DeviceBox = styled(Rows).attrs({
5
+ $sizes: 'minmax(0, 1fr)',
6
+ $padding: 5,
7
+ $borderRadius: 44,
8
+ $bgColor: WHATSAPP_COLOR.DEVICE_SHELL,
9
+ $border: `1px solid ${WHATSAPP_COLOR.DEVICE_EDGE}`
10
+ }).withConfig({
11
+ displayName: "DeviceBox",
12
+ componentId: "sc-15y0kbp-0"
13
+ })(["-webkit-font-smoothing:antialiased;*{box-sizing:border-box;}"]);
14
+ export const WallpaperLayer = styled(Vertical).attrs({
15
+ $position: 'absolute',
16
+ $inset: 0
17
+ }).withConfig({
18
+ displayName: "WallpaperLayer",
19
+ componentId: "sc-15y0kbp-1"
20
+ })(["color:", ";opacity:0.5;pointer-events:none;svg{display:block;width:100%;height:100%;}"], WHATSAPP_COLOR.WALLPAPER_INK);
21
+ export const WallpaperImage = styled.img.withConfig({
22
+ displayName: "WallpaperImage",
23
+ componentId: "sc-15y0kbp-2"
24
+ })(["width:100%;height:100%;object-fit:cover;"]);
@@ -0,0 +1,45 @@
1
+ import type { ReactNode } from 'react';
2
+ /** Who sent the message: `outgoing` is the phone owner (green, right), `incoming` is the business (white, left). */
3
+ export type WhatsAppMessageDirection = 'incoming' | 'outgoing';
4
+ /** Delivery state drawn as ticks next to an outgoing message's time. */
5
+ export type WhatsAppMessageStatus = 'sent' | 'delivered' | 'read';
6
+ /** One chat bubble of {@link WhatsAppPreview}. */
7
+ export interface WhatsAppMessage {
8
+ /** Stable key when the list is re-ordered or edited. */
9
+ id?: string;
10
+ /** Bubble side and colour. */
11
+ direction: WhatsAppMessageDirection;
12
+ /** Message body; WhatsApp markup (`*bold*`, `_italic_`, `~strike~`, `` `mono` ``) is rendered. */
13
+ text?: string;
14
+ /** Custom body rendered instead of `text` — e.g. an inline editor for the welcome message. */
15
+ content?: ReactNode;
16
+ /** Time stamp inside the bubble. */
17
+ time?: string;
18
+ /** Tick state; ignored for incoming messages. */
19
+ status?: WhatsAppMessageStatus;
20
+ }
21
+ /** Props of {@link WhatsAppPreview}. */
22
+ export interface WhatsAppPreviewProps {
23
+ /** Chat messages, oldest first. */
24
+ messages?: WhatsAppMessage[];
25
+ /** Business name in the chat header. */
26
+ contactName?: string;
27
+ /** Caption under the name; defaults to the localized "Business account". */
28
+ contactSubtitle?: string;
29
+ /** Business avatar URL; a placeholder glyph is drawn when absent. */
30
+ avatarUrl?: string;
31
+ /** Date separator above the first message; hide it with an empty string. */
32
+ dateLabel?: string;
33
+ /** Clock in the device status bar. */
34
+ statusBarTime?: string;
35
+ /** Chat wallpaper URL replacing the built-in pattern. */
36
+ wallpaperUrl?: string;
37
+ /** Text shown on the wallpaper while the chat has no messages. */
38
+ emptyText?: ReactNode;
39
+ /** CSS width of the device. */
40
+ width?: string | number;
41
+ /** CSS height of the device. */
42
+ height?: string | number;
43
+ /** Show the loading placeholder instead of the chat. */
44
+ isLoading?: boolean;
45
+ }
@@ -0,0 +1 @@
1
+ export {};
package/index.d.ts CHANGED
@@ -5,6 +5,7 @@ export { Button, GhostButton, RemoveButton } from './Button';
5
5
  export { CardMetric } from './CardMetric';
6
6
  export { Checkbox } from './Checkbox';
7
7
  export { CrashScreen } from './CrashScreen';
8
+ export { Divider } from './Divider';
8
9
  export { Drawer, DrawerHeader, DrawerTitle, DrawerBody, DrawerDocs, useDocs, } from './Drawer';
9
10
  export { CalendarSuperForm, CalendarDropdown, addPeriod, compareStructs, dateToStruct, dateToStructTz, getSortedTimezones, getTimezoneOffset, getPeriodEnd, getPeriodStart, structToDate, structToDateTz, stringifyValue, pickDateStruct, type CalendarDropdownProps, type CalendarDropdownRangeDateProps, type CalendarSuperFormProps, type DateStruct, type RangeValue, type TimezoneOption, } from './Calendar';
10
11
  export { DatePicker, DatePickerField, DateTimePicker, DateTimePickerField, } from './DateTimePicker';
@@ -33,6 +34,8 @@ export { Link, type LinkPropsWithoutAs, type LinkPropsWithAsTag, type LinkPropsW
33
34
  export { StatisticCard } from './StatisticCard';
34
35
  export { EmailTemplatePreview, NoEmailTemplatePreview, replaceLocalization, replacePlaceholders } from './EmailTemplatePreview';
35
36
  export { PushPreview } from './PushPreview';
37
+ export { WhatsAppPreview } from './WhatsAppPreview';
38
+ export type { WhatsAppMessage, WhatsAppMessageDirection, WhatsAppMessageStatus, WhatsAppPreviewProps, } from './WhatsAppPreview';
36
39
  export { Toast, ToastProvider, useToast } from './Toast';
37
40
  export { AutosizeInput, PageHeader, PageHeaderEditable } from './PageHeader';
38
41
  export { ExportResult } from './ExportResult';
package/index.js CHANGED
@@ -5,6 +5,7 @@ export { Button, GhostButton, RemoveButton } from './Button';
5
5
  export { CardMetric } from './CardMetric';
6
6
  export { Checkbox } from './Checkbox';
7
7
  export { CrashScreen } from './CrashScreen';
8
+ export { Divider } from './Divider';
8
9
  export { Drawer, DrawerHeader, DrawerTitle, DrawerBody, DrawerDocs, useDocs } from './Drawer';
9
10
  export { CalendarSuperForm, CalendarDropdown, addPeriod, compareStructs, dateToStruct, dateToStructTz, getSortedTimezones, getTimezoneOffset, getPeriodEnd, getPeriodStart, structToDate, structToDateTz, stringifyValue, pickDateStruct } from './Calendar';
10
11
  export { DatePicker, DatePickerField, DateTimePicker, DateTimePickerField } from './DateTimePicker';
@@ -33,6 +34,7 @@ export { Link } from './Link';
33
34
  export { StatisticCard } from './StatisticCard';
34
35
  export { EmailTemplatePreview, NoEmailTemplatePreview, replaceLocalization, replacePlaceholders } from './EmailTemplatePreview';
35
36
  export { PushPreview } from './PushPreview';
37
+ export { WhatsAppPreview } from './WhatsAppPreview';
36
38
  export { Toast, ToastProvider, useToast } from './Toast';
37
39
  export { AutosizeInput, PageHeader, PageHeaderEditable } from './PageHeader';
38
40
  export { ExportResult } from './ExportResult';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/dumb-components",
3
- "version": "1.1.208",
3
+ "version": "1.1.210",
4
4
  "description": "React components to build Pushwoosh products",
5
5
  "main": "index.js",
6
6
  "module": "index.js",