@pushwoosh/dumb-components 4.16.0 → 4.17.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.
Files changed (139) hide show
  1. package/SmsPreview/SmsPreview.d.ts +4 -0
  2. package/SmsPreview/SmsPreview.js +48 -0
  3. package/SmsPreview/index.d.ts +2 -0
  4. package/SmsPreview/index.js +1 -0
  5. package/SmsPreview/polyglot/index.d.ts +2 -0
  6. package/SmsPreview/polyglot/index.js +34 -0
  7. package/SmsPreview/polyglot/messages_ar.d.ts +3 -0
  8. package/SmsPreview/polyglot/messages_ar.js +5 -0
  9. package/SmsPreview/polyglot/messages_bn.d.ts +3 -0
  10. package/SmsPreview/polyglot/messages_bn.js +5 -0
  11. package/SmsPreview/polyglot/messages_de.d.ts +3 -0
  12. package/SmsPreview/polyglot/messages_de.js +5 -0
  13. package/SmsPreview/polyglot/messages_en.d.ts +3 -0
  14. package/SmsPreview/polyglot/messages_en.js +5 -0
  15. package/SmsPreview/polyglot/messages_es.d.ts +3 -0
  16. package/SmsPreview/polyglot/messages_es.js +5 -0
  17. package/SmsPreview/polyglot/messages_fr.d.ts +3 -0
  18. package/SmsPreview/polyglot/messages_fr.js +5 -0
  19. package/SmsPreview/polyglot/messages_he.d.ts +3 -0
  20. package/SmsPreview/polyglot/messages_he.js +5 -0
  21. package/SmsPreview/polyglot/messages_hi.d.ts +3 -0
  22. package/SmsPreview/polyglot/messages_hi.js +5 -0
  23. package/SmsPreview/polyglot/messages_ja.d.ts +3 -0
  24. package/SmsPreview/polyglot/messages_ja.js +5 -0
  25. package/SmsPreview/polyglot/messages_ko.d.ts +3 -0
  26. package/SmsPreview/polyglot/messages_ko.js +5 -0
  27. package/SmsPreview/polyglot/messages_pt.d.ts +3 -0
  28. package/SmsPreview/polyglot/messages_pt.js +5 -0
  29. package/SmsPreview/polyglot/messages_ru.d.ts +3 -0
  30. package/SmsPreview/polyglot/messages_ru.js +5 -0
  31. package/SmsPreview/polyglot/messages_th.d.ts +3 -0
  32. package/SmsPreview/polyglot/messages_th.js +5 -0
  33. package/SmsPreview/polyglot/messages_zh.d.ts +3 -0
  34. package/SmsPreview/polyglot/messages_zh.js +5 -0
  35. package/SmsPreview/polyglot/types.d.ts +9 -0
  36. package/SmsPreview/polyglot/types.js +1 -0
  37. package/SmsPreview/styles.d.ts +15 -0
  38. package/SmsPreview/styles.js +22 -0
  39. package/SmsPreview/types.d.ts +22 -0
  40. package/SmsPreview/types.js +1 -0
  41. package/Tooltip/Tooltip.d.ts +1 -1
  42. package/Tooltip/Tooltip.js +8 -3
  43. package/WalletPassPreview/WalletPassPreview.d.ts +4 -0
  44. package/WalletPassPreview/WalletPassPreview.js +203 -0
  45. package/WalletPassPreview/components/BarcodePlaceholder/BarcodePlaceholder.d.ts +3 -0
  46. package/WalletPassPreview/components/BarcodePlaceholder/BarcodePlaceholder.js +148 -0
  47. package/WalletPassPreview/components/BarcodePlaceholder/index.d.ts +1 -0
  48. package/WalletPassPreview/components/BarcodePlaceholder/index.js +1 -0
  49. package/WalletPassPreview/components/BarcodePlaceholder/styles.d.ts +6 -0
  50. package/WalletPassPreview/components/BarcodePlaceholder/styles.js +11 -0
  51. package/WalletPassPreview/components/BarcodePlaceholder/types.d.ts +3 -0
  52. package/WalletPassPreview/components/BarcodePlaceholder/types.js +1 -0
  53. package/WalletPassPreview/constants.d.ts +8 -0
  54. package/WalletPassPreview/constants.js +27 -0
  55. package/WalletPassPreview/helpers/formatting.d.ts +3 -0
  56. package/WalletPassPreview/helpers/formatting.js +63 -0
  57. package/WalletPassPreview/helpers/index.d.ts +1 -0
  58. package/WalletPassPreview/helpers/index.js +1 -0
  59. package/WalletPassPreview/index.d.ts +2 -0
  60. package/WalletPassPreview/index.js +1 -0
  61. package/WalletPassPreview/polyglot/index.d.ts +2 -0
  62. package/WalletPassPreview/polyglot/index.js +34 -0
  63. package/WalletPassPreview/polyglot/messages_ar.d.ts +3 -0
  64. package/WalletPassPreview/polyglot/messages_ar.js +34 -0
  65. package/WalletPassPreview/polyglot/messages_bn.d.ts +3 -0
  66. package/WalletPassPreview/polyglot/messages_bn.js +34 -0
  67. package/WalletPassPreview/polyglot/messages_de.d.ts +3 -0
  68. package/WalletPassPreview/polyglot/messages_de.js +34 -0
  69. package/WalletPassPreview/polyglot/messages_en.d.ts +3 -0
  70. package/WalletPassPreview/polyglot/messages_en.js +34 -0
  71. package/WalletPassPreview/polyglot/messages_es.d.ts +3 -0
  72. package/WalletPassPreview/polyglot/messages_es.js +34 -0
  73. package/WalletPassPreview/polyglot/messages_fr.d.ts +3 -0
  74. package/WalletPassPreview/polyglot/messages_fr.js +34 -0
  75. package/WalletPassPreview/polyglot/messages_he.d.ts +3 -0
  76. package/WalletPassPreview/polyglot/messages_he.js +34 -0
  77. package/WalletPassPreview/polyglot/messages_hi.d.ts +3 -0
  78. package/WalletPassPreview/polyglot/messages_hi.js +34 -0
  79. package/WalletPassPreview/polyglot/messages_ja.d.ts +3 -0
  80. package/WalletPassPreview/polyglot/messages_ja.js +34 -0
  81. package/WalletPassPreview/polyglot/messages_ko.d.ts +3 -0
  82. package/WalletPassPreview/polyglot/messages_ko.js +34 -0
  83. package/WalletPassPreview/polyglot/messages_pt.d.ts +3 -0
  84. package/WalletPassPreview/polyglot/messages_pt.js +34 -0
  85. package/WalletPassPreview/polyglot/messages_ru.d.ts +3 -0
  86. package/WalletPassPreview/polyglot/messages_ru.js +34 -0
  87. package/WalletPassPreview/polyglot/messages_th.d.ts +3 -0
  88. package/WalletPassPreview/polyglot/messages_th.js +34 -0
  89. package/WalletPassPreview/polyglot/messages_zh.d.ts +3 -0
  90. package/WalletPassPreview/polyglot/messages_zh.js +34 -0
  91. package/WalletPassPreview/polyglot/types.d.ts +47 -0
  92. package/WalletPassPreview/polyglot/types.js +1 -0
  93. package/WalletPassPreview/styles.d.ts +139 -0
  94. package/WalletPassPreview/styles.js +180 -0
  95. package/WalletPassPreview/types.d.ts +34 -0
  96. package/WalletPassPreview/types.js +1 -0
  97. package/WebPushPreview/WebPushPreview.d.ts +4 -0
  98. package/WebPushPreview/WebPushPreview.js +40 -0
  99. package/WebPushPreview/index.d.ts +2 -0
  100. package/WebPushPreview/index.js +1 -0
  101. package/WebPushPreview/polyglot/index.d.ts +5 -0
  102. package/WebPushPreview/polyglot/index.js +34 -0
  103. package/WebPushPreview/polyglot/messages_ar.d.ts +3 -0
  104. package/WebPushPreview/polyglot/messages_ar.js +3 -0
  105. package/WebPushPreview/polyglot/messages_bn.d.ts +3 -0
  106. package/WebPushPreview/polyglot/messages_bn.js +3 -0
  107. package/WebPushPreview/polyglot/messages_de.d.ts +3 -0
  108. package/WebPushPreview/polyglot/messages_de.js +3 -0
  109. package/WebPushPreview/polyglot/messages_en.d.ts +3 -0
  110. package/WebPushPreview/polyglot/messages_en.js +3 -0
  111. package/WebPushPreview/polyglot/messages_es.d.ts +3 -0
  112. package/WebPushPreview/polyglot/messages_es.js +3 -0
  113. package/WebPushPreview/polyglot/messages_fr.d.ts +3 -0
  114. package/WebPushPreview/polyglot/messages_fr.js +3 -0
  115. package/WebPushPreview/polyglot/messages_he.d.ts +3 -0
  116. package/WebPushPreview/polyglot/messages_he.js +3 -0
  117. package/WebPushPreview/polyglot/messages_hi.d.ts +3 -0
  118. package/WebPushPreview/polyglot/messages_hi.js +3 -0
  119. package/WebPushPreview/polyglot/messages_ja.d.ts +3 -0
  120. package/WebPushPreview/polyglot/messages_ja.js +3 -0
  121. package/WebPushPreview/polyglot/messages_ko.d.ts +3 -0
  122. package/WebPushPreview/polyglot/messages_ko.js +3 -0
  123. package/WebPushPreview/polyglot/messages_pt.d.ts +3 -0
  124. package/WebPushPreview/polyglot/messages_pt.js +3 -0
  125. package/WebPushPreview/polyglot/messages_ru.d.ts +3 -0
  126. package/WebPushPreview/polyglot/messages_ru.js +3 -0
  127. package/WebPushPreview/polyglot/messages_th.d.ts +3 -0
  128. package/WebPushPreview/polyglot/messages_th.js +3 -0
  129. package/WebPushPreview/polyglot/messages_zh.d.ts +3 -0
  130. package/WebPushPreview/polyglot/messages_zh.js +3 -0
  131. package/WebPushPreview/polyglot/types.d.ts +4 -0
  132. package/WebPushPreview/polyglot/types.js +1 -0
  133. package/WebPushPreview/styles.d.ts +22 -0
  134. package/WebPushPreview/styles.js +31 -0
  135. package/WebPushPreview/types.d.ts +13 -0
  136. package/WebPushPreview/types.js +1 -0
  137. package/index.d.ts +6 -0
  138. package/index.js +3 -0
  139. package/package.json +1 -1
@@ -0,0 +1,4 @@
1
+ import { type ReactElement } from 'react';
2
+ import type { SmsPreviewProps } from './types';
3
+ /** Renders a text message in a phone thread: sender on top, one bubble, segment count below. */
4
+ export declare function SmsPreview(props: SmsPreviewProps): ReactElement;
@@ -0,0 +1,48 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Color } from '@pushwoosh/kit-constants';
3
+ import { Vertical } from '@pushwoosh/kit-helpers';
4
+ import { Text } from '@pushwoosh/kit-typography';
5
+ import { Lang } from './polyglot';
6
+ import { Bubble, Phone, PhoneHeader, Placeholder, Thread } from './styles';
7
+ /** Renders a text message in a phone thread: sender on top, one bubble, segment count below. */
8
+ export function SmsPreview(props) {
9
+ const {
10
+ senderName,
11
+ channelName,
12
+ text,
13
+ emptyText,
14
+ segments
15
+ } = props;
16
+ return _jsxs(Vertical, {
17
+ "$gap": 8,
18
+ "$alignContent": "start",
19
+ children: [_jsxs(Phone, {
20
+ children: [_jsxs(PhoneHeader, {
21
+ children: [_jsx(Text, {
22
+ "$variant": "h4",
23
+ children: senderName
24
+ }), _jsx(Text, {
25
+ "$color": Color.LOCKED,
26
+ children: channelName || _jsx(Lang, {
27
+ message: "DUMB.SMS_PREVIEW.CHANNEL"
28
+ })
29
+ })]
30
+ }), _jsx(Thread, {
31
+ children: text ? _jsx(Bubble, {
32
+ children: text
33
+ }) : _jsx(Placeholder, {
34
+ children: emptyText || _jsx(Lang, {
35
+ message: "DUMB.SMS_PREVIEW.EMPTY"
36
+ })
37
+ })
38
+ })]
39
+ }), text && segments && _jsx(Text, {
40
+ "$color": Color.LOCKED,
41
+ children: _jsx(Lang, {
42
+ message: "DUMB.SMS_PREVIEW.SEGMENTS",
43
+ segments: segments.count,
44
+ encoding: segments.encoding === 'GSM7' ? 'GSM-7' : 'Unicode'
45
+ })
46
+ })]
47
+ });
48
+ }
@@ -0,0 +1,2 @@
1
+ export { SmsPreview } from './SmsPreview';
2
+ export type { SmsEncoding, SmsPreviewProps, SmsSegments } from './types';
@@ -0,0 +1 @@
1
+ export { SmsPreview } from './SmsPreview';
@@ -0,0 +1,2 @@
1
+ import { type SmsPreviewMessages } from './types';
2
+ export declare const Lang: import("react").FC<import("../..").LangProps<SmsPreviewMessages>>, useLang: () => (props: import("../..").LangProps<SmsPreviewMessages>) => 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 SmsPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<SmsPreviewMessages>;
@@ -0,0 +1,5 @@
1
+ export const messages = {
2
+ 'DUMB.SMS_PREVIEW.CHANNEL': 'SMS',
3
+ 'DUMB.SMS_PREVIEW.EMPTY': 'الرسالة فارغة',
4
+ 'DUMB.SMS_PREVIEW.SEGMENTS': 'المقاطع {{segments}} · {{encoding}}'
5
+ };
@@ -0,0 +1,3 @@
1
+ import { type SmsPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<SmsPreviewMessages>;
@@ -0,0 +1,5 @@
1
+ export const messages = {
2
+ 'DUMB.SMS_PREVIEW.CHANNEL': 'SMS',
3
+ 'DUMB.SMS_PREVIEW.EMPTY': 'বার্তা খালি',
4
+ 'DUMB.SMS_PREVIEW.SEGMENTS': 'সেগমেন্ট {{segments}} · {{encoding}}'
5
+ };
@@ -0,0 +1,3 @@
1
+ import { type SmsPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<SmsPreviewMessages>;
@@ -0,0 +1,5 @@
1
+ export const messages = {
2
+ 'DUMB.SMS_PREVIEW.CHANNEL': 'SMS',
3
+ 'DUMB.SMS_PREVIEW.EMPTY': 'Die Nachricht ist leer',
4
+ 'DUMB.SMS_PREVIEW.SEGMENTS': '{{segments}} Segment(e) · {{encoding}}'
5
+ };
@@ -0,0 +1,3 @@
1
+ import { type SmsPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<SmsPreviewMessages>;
@@ -0,0 +1,5 @@
1
+ export const messages = {
2
+ 'DUMB.SMS_PREVIEW.CHANNEL': 'SMS',
3
+ 'DUMB.SMS_PREVIEW.EMPTY': 'The message is empty',
4
+ 'DUMB.SMS_PREVIEW.SEGMENTS': '{{segments}} segment(s) · {{encoding}}'
5
+ };
@@ -0,0 +1,3 @@
1
+ import { type SmsPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<SmsPreviewMessages>;
@@ -0,0 +1,5 @@
1
+ export const messages = {
2
+ 'DUMB.SMS_PREVIEW.CHANNEL': 'SMS',
3
+ 'DUMB.SMS_PREVIEW.EMPTY': 'El mensaje está vacío',
4
+ 'DUMB.SMS_PREVIEW.SEGMENTS': '{{segments}} segmento(s) · {{encoding}}'
5
+ };
@@ -0,0 +1,3 @@
1
+ import { type SmsPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<SmsPreviewMessages>;
@@ -0,0 +1,5 @@
1
+ export const messages = {
2
+ 'DUMB.SMS_PREVIEW.CHANNEL': 'SMS',
3
+ 'DUMB.SMS_PREVIEW.EMPTY': 'Le message est vide',
4
+ 'DUMB.SMS_PREVIEW.SEGMENTS': '{{segments}} segment(s) · {{encoding}}'
5
+ };
@@ -0,0 +1,3 @@
1
+ import { type SmsPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<SmsPreviewMessages>;
@@ -0,0 +1,5 @@
1
+ export const messages = {
2
+ 'DUMB.SMS_PREVIEW.CHANNEL': 'SMS',
3
+ 'DUMB.SMS_PREVIEW.EMPTY': 'ההודעה ריקה',
4
+ 'DUMB.SMS_PREVIEW.SEGMENTS': 'מקטעים {{segments}} · {{encoding}}'
5
+ };
@@ -0,0 +1,3 @@
1
+ import { type SmsPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<SmsPreviewMessages>;
@@ -0,0 +1,5 @@
1
+ export const messages = {
2
+ 'DUMB.SMS_PREVIEW.CHANNEL': 'SMS',
3
+ 'DUMB.SMS_PREVIEW.EMPTY': 'संदेश खाली है',
4
+ 'DUMB.SMS_PREVIEW.SEGMENTS': 'सेगमेंट {{segments}} · {{encoding}}'
5
+ };
@@ -0,0 +1,3 @@
1
+ import { type SmsPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<SmsPreviewMessages>;
@@ -0,0 +1,5 @@
1
+ export const messages = {
2
+ 'DUMB.SMS_PREVIEW.CHANNEL': 'SMS',
3
+ 'DUMB.SMS_PREVIEW.EMPTY': 'メッセージが空です',
4
+ 'DUMB.SMS_PREVIEW.SEGMENTS': 'セグメント {{segments}} · {{encoding}}'
5
+ };
@@ -0,0 +1,3 @@
1
+ import { type SmsPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<SmsPreviewMessages>;
@@ -0,0 +1,5 @@
1
+ export const messages = {
2
+ 'DUMB.SMS_PREVIEW.CHANNEL': 'SMS',
3
+ 'DUMB.SMS_PREVIEW.EMPTY': '메시지가 비어 있습니다',
4
+ 'DUMB.SMS_PREVIEW.SEGMENTS': '세그먼트 {{segments}} · {{encoding}}'
5
+ };
@@ -0,0 +1,3 @@
1
+ import { type SmsPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<SmsPreviewMessages>;
@@ -0,0 +1,5 @@
1
+ export const messages = {
2
+ 'DUMB.SMS_PREVIEW.CHANNEL': 'SMS',
3
+ 'DUMB.SMS_PREVIEW.EMPTY': 'A mensagem está vazia',
4
+ 'DUMB.SMS_PREVIEW.SEGMENTS': '{{segments}} segmento(s) · {{encoding}}'
5
+ };
@@ -0,0 +1,3 @@
1
+ import { type SmsPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<SmsPreviewMessages>;
@@ -0,0 +1,5 @@
1
+ export const messages = {
2
+ 'DUMB.SMS_PREVIEW.CHANNEL': 'SMS',
3
+ 'DUMB.SMS_PREVIEW.EMPTY': 'Сообщение пустое',
4
+ 'DUMB.SMS_PREVIEW.SEGMENTS': 'сегментов: {{segments}} · {{encoding}}'
5
+ };
@@ -0,0 +1,3 @@
1
+ import { type SmsPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<SmsPreviewMessages>;
@@ -0,0 +1,5 @@
1
+ export const messages = {
2
+ 'DUMB.SMS_PREVIEW.CHANNEL': 'SMS',
3
+ 'DUMB.SMS_PREVIEW.EMPTY': 'ข้อความว่างเปล่า',
4
+ 'DUMB.SMS_PREVIEW.SEGMENTS': 'เซกเมนต์ {{segments}} · {{encoding}}'
5
+ };
@@ -0,0 +1,3 @@
1
+ import { type SmsPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<SmsPreviewMessages>;
@@ -0,0 +1,5 @@
1
+ export const messages = {
2
+ 'DUMB.SMS_PREVIEW.CHANNEL': '短信',
3
+ 'DUMB.SMS_PREVIEW.EMPTY': '消息为空',
4
+ 'DUMB.SMS_PREVIEW.SEGMENTS': '分段 {{segments}} · {{encoding}}'
5
+ };
@@ -0,0 +1,9 @@
1
+ import type { NoParams } from '../../polyglot';
2
+ export type SmsPreviewMessages = {
3
+ 'DUMB.SMS_PREVIEW.CHANNEL': NoParams;
4
+ 'DUMB.SMS_PREVIEW.EMPTY': NoParams;
5
+ 'DUMB.SMS_PREVIEW.SEGMENTS': {
6
+ segments: number;
7
+ encoding: string;
8
+ };
9
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,15 @@
1
+ export declare const Phone: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
2
+ style?: import("react").CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
3
+ }> & string;
4
+ export declare const PhoneHeader: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
5
+ style?: import("react").CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
6
+ }> & string;
7
+ export declare const Thread: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
8
+ style?: import("react").CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
9
+ }> & string;
10
+ export declare const Bubble: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
11
+ style?: import("react").CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
12
+ }> & string;
13
+ export declare const Placeholder: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
14
+ style?: import("react").CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
15
+ }> & string;
@@ -0,0 +1,22 @@
1
+ import styled from 'styled-components';
2
+ import { Color, FontSize, ShapeRadius } from '@pushwoosh/kit-constants';
3
+ export const Phone = styled.div.withConfig({
4
+ displayName: "Phone",
5
+ componentId: "sc-1wraspo-0"
6
+ })(["width:320px;border:8px solid ", ";border-radius:32px;overflow:hidden;background-color:", ";"], Color.MAIN, Color.CLEAR);
7
+ export const PhoneHeader = styled.div.withConfig({
8
+ displayName: "PhoneHeader",
9
+ componentId: "sc-1wraspo-1"
10
+ })(["display:flex;flex-direction:column;gap:2px;padding:12px;border-bottom:1px solid ", ";text-align:center;"], Color.DIVIDER);
11
+ export const Thread = styled.div.withConfig({
12
+ displayName: "Thread",
13
+ componentId: "sc-1wraspo-2"
14
+ })(["display:flex;flex-direction:column;min-height:160px;padding:16px 12px;"]);
15
+ export const Bubble = styled.div.withConfig({
16
+ displayName: "Bubble",
17
+ componentId: "sc-1wraspo-3"
18
+ })(["padding:10px 12px;border-radius:16px 16px 16px 4px;background-color:", ";color:", ";font-size:", ";line-height:1.4;white-space:pre-wrap;word-break:break-word;unicode-bidi:plaintext;text-align:start;"], Color.DIVIDER, Color.MAIN, FontSize.REGULAR);
19
+ export const Placeholder = styled.div.withConfig({
20
+ displayName: "Placeholder",
21
+ componentId: "sc-1wraspo-4"
22
+ })(["padding:12px;border:1px dashed ", ";border-radius:", ";color:", ";font-size:", ";text-align:center;"], Color.FORM, ShapeRadius.SECTION, Color.LOCKED, FontSize.SMALL);
@@ -0,0 +1,22 @@
1
+ /** Character set the message is sent in; it sets the segment size. */
2
+ export type SmsEncoding = 'GSM7' | 'UCS2';
3
+ /** How many SMS parts the text is split into on the wire. */
4
+ export interface SmsSegments {
5
+ /** Number of parts. */
6
+ count: number;
7
+ /** Character set of the parts. */
8
+ encoding: SmsEncoding;
9
+ }
10
+ /** Props of {@link SmsPreview}. */
11
+ export interface SmsPreviewProps {
12
+ /** Who the message comes from: the application title, or the sender name of a messenger. */
13
+ senderName: string;
14
+ /** Channel line under the sender; `SMS` by default. */
15
+ channelName?: string;
16
+ /** Message text, shown in one bubble. */
17
+ text: string;
18
+ /** Shown instead of the bubble when `text` is empty. */
19
+ emptyText?: string;
20
+ /** Segment line under the phone; hidden when absent or when `text` is empty. */
21
+ segments?: SmsSegments;
22
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,7 +1,7 @@
1
1
  import { type ReactElement } from 'react';
2
2
  import type { TooltipProps } from './types';
3
3
  /**
4
- * Wraps an element and shows a contextual tooltip on hover/focus, with configurable
4
+ * Wraps an element and shows a contextual tooltip on hover/keyboard focus, with configurable
5
5
  * position, width and color. Positioning is handled by floating-ui, so the tooltip
6
6
  * flips to a fallback placement when the requested one would overflow the viewport. Use
7
7
  * {@link TooltipTrigger} for a standalone help icon.
@@ -6,7 +6,7 @@ import { DEFAULT_MAX_WIDTH } from './constants';
6
6
  import { Arrow, TooltipBox } from './styles';
7
7
  import { useTooltipPosition } from './useTooltipPosition';
8
8
  /**
9
- * Wraps an element and shows a contextual tooltip on hover/focus, with configurable
9
+ * Wraps an element and shows a contextual tooltip on hover/keyboard focus, with configurable
10
10
  * position, width and color. Positioning is handled by floating-ui, so the tooltip
11
11
  * flips to a fallback placement when the requested one would overflow the viewport. Use
12
12
  * {@link TooltipTrigger} for a standalone help icon.
@@ -70,14 +70,19 @@ export function Tooltip({
70
70
  }
71
71
  const show = () => setIsHovered(true);
72
72
  const hide = () => setIsHovered(false);
73
+ const showOnKeyboardFocus = event => {
74
+ if (event.target instanceof Element && event.target.matches(':focus-visible')) {
75
+ show();
76
+ }
77
+ };
73
78
  referenceEl.addEventListener('mouseenter', show);
74
79
  referenceEl.addEventListener('mouseleave', hide);
75
- referenceEl.addEventListener('focusin', show);
80
+ referenceEl.addEventListener('focusin', showOnKeyboardFocus);
76
81
  referenceEl.addEventListener('focusout', hide);
77
82
  return () => {
78
83
  referenceEl.removeEventListener('mouseenter', show);
79
84
  referenceEl.removeEventListener('mouseleave', hide);
80
- referenceEl.removeEventListener('focusin', show);
85
+ referenceEl.removeEventListener('focusin', showOnKeyboardFocus);
81
86
  referenceEl.removeEventListener('focusout', hide);
82
87
  };
83
88
  }, [referenceEl, isControlled]);
@@ -0,0 +1,4 @@
1
+ import { type ReactElement } from 'react';
2
+ import { type WalletPassPreviewProps } from './types';
3
+ /** Renders an Apple Wallet pass with its status, back fields and the preview caveats. */
4
+ export declare function WalletPassPreview({ pass, passStyle, imageUrls, }: WalletPassPreviewProps): ReactElement;
@@ -0,0 +1,203 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Color } from '@pushwoosh/kit-constants';
3
+ import { BarcodePlaceholder } from './components/BarcodePlaceholder';
4
+ import { BACK_FIELDS_SHOWN, BARCODE_NAMES, STYLE_NAMES, TRANSIT_ICONS } from './constants';
5
+ import { formatFieldValue, parseRgbColor } from './helpers';
6
+ import { Lang, useLang } from './polyglot';
7
+ import { AuxiliaryField, AuxiliaryFields, BackFieldItem, BackFieldLabel, BackFieldMore, BackFields, Background, Barcode, BarcodeAltText, Card, Content, CoverImage, FieldLabel, FieldValue, FieldValueSecondary, FieldValueSmall, Footer, FooterImage, Header, HeaderBrand, HeaderField, HeaderFields, Info, InfoBadge, InfoBar, InfoSection, Logo, LogoText, Note, PrimaryField, PrimaryFields, SecondaryField, SecondaryFields, SectionTitle, SerialItem, SerialLabel, StatusBadge, Strip, Thumbnail } from './styles';
8
+ /** Renders an Apple Wallet pass with its status, back fields and the preview caveats. */
9
+ export function WalletPassPreview({
10
+ pass,
11
+ passStyle,
12
+ imageUrls = {}
13
+ }) {
14
+ const lang = useLang();
15
+ const bgColor = parseRgbColor(pass.backgroundColor);
16
+ const fgColor = parseRgbColor(pass.foregroundColor);
17
+ const labelColor = parseRgbColor(pass.labelColor);
18
+ const transitType = pass.boardingPass?.transitType;
19
+ const barcodeFormat = pass.barcodes?.[0]?.format || 'PKBarcodeFormatQR';
20
+ const styleBlock = pass[passStyle];
21
+ const isBoarding = passStyle === 'boardingPass';
22
+ return _jsxs("div", {
23
+ children: [_jsxs(Card, {
24
+ "$bg": bgColor,
25
+ "$fg": fgColor,
26
+ children: [_jsxs(Header, {
27
+ children: [_jsxs(HeaderBrand, {
28
+ children: [imageUrls.logo && _jsx(Logo, {
29
+ src: imageUrls.logo,
30
+ alt: lang({
31
+ message: 'DUMB.WALLET_PASS_PREVIEW.IMAGE_LOGO'
32
+ })
33
+ }), !imageUrls.logo && pass.logoText && _jsx(LogoText, {
34
+ children: pass.logoText
35
+ })]
36
+ }), styleBlock?.headerFields && styleBlock.headerFields.length > 0 && _jsx(HeaderFields, {
37
+ children: styleBlock.headerFields.map((field, i) => _jsxs(HeaderField, {
38
+ children: [field.label && _jsx(FieldLabel, {
39
+ "$color": labelColor,
40
+ children: field.label
41
+ }), _jsx(FieldValueSmall, {
42
+ children: formatFieldValue(field)
43
+ })]
44
+ }, `${field.key ?? 'header'}-${i}`))
45
+ })]
46
+ }), imageUrls.strip && _jsx(Strip, {
47
+ children: _jsx(CoverImage, {
48
+ src: imageUrls.strip,
49
+ alt: lang({
50
+ message: 'DUMB.WALLET_PASS_PREVIEW.IMAGE_STRIP'
51
+ })
52
+ })
53
+ }), imageUrls.background && _jsx(Background, {
54
+ children: _jsx(CoverImage, {
55
+ src: imageUrls.background,
56
+ alt: lang({
57
+ message: 'DUMB.WALLET_PASS_PREVIEW.IMAGE_BACKGROUND'
58
+ })
59
+ })
60
+ }), _jsxs(Content, {
61
+ children: [styleBlock?.primaryFields && styleBlock.primaryFields.length > 0 && _jsxs(PrimaryFields, {
62
+ "$boarding": isBoarding,
63
+ children: [styleBlock.primaryFields.map((field, i) => _jsxs(PrimaryField, {
64
+ "$boarding": isBoarding,
65
+ children: [field.label && _jsx(FieldLabel, {
66
+ "$color": labelColor,
67
+ children: field.label
68
+ }), _jsx(FieldValue, {
69
+ children: formatFieldValue(field)
70
+ })]
71
+ }, `${field.key ?? 'primary'}-${i}`)), imageUrls.thumbnail && (passStyle === 'eventTicket' || passStyle === 'generic') && _jsx(Thumbnail, {
72
+ src: imageUrls.thumbnail,
73
+ alt: lang({
74
+ message: 'DUMB.WALLET_PASS_PREVIEW.IMAGE_THUMBNAIL'
75
+ })
76
+ })]
77
+ }), styleBlock?.auxiliaryFields && styleBlock.auxiliaryFields.length > 0 && _jsx(AuxiliaryFields, {
78
+ children: styleBlock.auxiliaryFields.map((field, i) => _jsxs(AuxiliaryField, {
79
+ children: [field.label && _jsx(FieldLabel, {
80
+ "$color": labelColor,
81
+ children: field.label
82
+ }), _jsx(FieldValueSmall, {
83
+ children: formatFieldValue(field)
84
+ })]
85
+ }, `${field.key ?? 'auxiliary'}-${i}`))
86
+ }), styleBlock?.secondaryFields && styleBlock.secondaryFields.length > 0 && _jsx(SecondaryFields, {
87
+ children: styleBlock.secondaryFields.map((field, i) => _jsxs(SecondaryField, {
88
+ children: [field.label && _jsx(FieldLabel, {
89
+ "$color": labelColor,
90
+ children: field.label
91
+ }), _jsx(FieldValueSecondary, {
92
+ children: formatFieldValue(field)
93
+ })]
94
+ }, `${field.key ?? 'secondary'}-${i}`))
95
+ })]
96
+ }), pass.barcodes && pass.barcodes[0] && _jsxs(Barcode, {
97
+ children: [_jsx(BarcodePlaceholder, {
98
+ format: barcodeFormat
99
+ }), _jsx(BarcodeAltText, {
100
+ "$color": labelColor,
101
+ children: pass.barcodes[0].altText || pass.barcodes[0].message
102
+ })]
103
+ }), imageUrls.footer && _jsx(Footer, {
104
+ children: _jsx(FooterImage, {
105
+ src: imageUrls.footer,
106
+ alt: lang({
107
+ message: 'DUMB.WALLET_PASS_PREVIEW.IMAGE_FOOTER'
108
+ })
109
+ })
110
+ })]
111
+ }), _jsxs(InfoBar, {
112
+ children: [_jsx(InfoBadge, {
113
+ "$background": Color.PRIMARY,
114
+ "$capitalize": true,
115
+ children: STYLE_NAMES[passStyle] ? lang({
116
+ message: STYLE_NAMES[passStyle]
117
+ }) : passStyle
118
+ }), isBoarding && transitType && _jsx(InfoBadge, {
119
+ "$background": Color.SUCCESS,
120
+ children: TRANSIT_ICONS[transitType] ? lang({
121
+ message: TRANSIT_ICONS[transitType]
122
+ }) : transitType.replace('PKTransitType', '')
123
+ }), pass.barcodes?.[0] && _jsx(InfoBadge, {
124
+ "$background": Color.WARNING,
125
+ children: BARCODE_NAMES[barcodeFormat] || _jsx(Lang, {
126
+ message: "DUMB.WALLET_PASS_PREVIEW.BARCODE_QR"
127
+ })
128
+ })]
129
+ }), _jsxs(Info, {
130
+ children: [(pass.serialNumber || pass.voided || pass.expirationDate || pass.relevantDate || pass.locations && pass.locations.length > 0) && _jsxs(InfoSection, {
131
+ children: [_jsx(SectionTitle, {
132
+ children: _jsx(Lang, {
133
+ message: "DUMB.WALLET_PASS_PREVIEW.STATUS_SECTION"
134
+ })
135
+ }), pass.serialNumber && _jsxs(SerialItem, {
136
+ children: [_jsx(SerialLabel, {
137
+ children: _jsx(Lang, {
138
+ message: "DUMB.WALLET_PASS_PREVIEW.SERIAL"
139
+ })
140
+ }), ' ', pass.serialNumber]
141
+ }), pass.voided && _jsx(StatusBadge, {
142
+ "$background": Color.DANGER,
143
+ "$bold": true,
144
+ children: _jsx(Lang, {
145
+ message: "DUMB.WALLET_PASS_PREVIEW.VOIDED"
146
+ })
147
+ }), pass.expirationDate && _jsx(StatusBadge, {
148
+ "$background": Color.WARNING,
149
+ children: _jsx(Lang, {
150
+ message: "DUMB.WALLET_PASS_PREVIEW.EXPIRES",
151
+ date: new Date(pass.expirationDate).toLocaleDateString()
152
+ })
153
+ }), pass.relevantDate && _jsx(StatusBadge, {
154
+ "$background": Color.PRIMARY,
155
+ children: _jsx(Lang, {
156
+ message: "DUMB.WALLET_PASS_PREVIEW.LOCK_SCREEN",
157
+ date: new Date(pass.relevantDate).toLocaleString()
158
+ })
159
+ }), pass.locations && pass.locations.length > 0 && _jsx(StatusBadge, {
160
+ "$background": Color.SUCCESS,
161
+ children: _jsx(Lang, {
162
+ message: "DUMB.WALLET_PASS_PREVIEW.LOCATIONS",
163
+ count: pass.locations.length
164
+ })
165
+ }), pass.maxDistance ? _jsx(StatusBadge, {
166
+ "$background": Color.EXCEPTIONAL,
167
+ children: _jsx(Lang, {
168
+ message: "DUMB.WALLET_PASS_PREVIEW.MAX_DISTANCE",
169
+ distance: pass.maxDistance
170
+ })
171
+ }) : null]
172
+ }), styleBlock?.backFields && styleBlock.backFields.length > 0 && _jsxs(InfoSection, {
173
+ children: [_jsx(SectionTitle, {
174
+ children: _jsx(Lang, {
175
+ message: "DUMB.WALLET_PASS_PREVIEW.BACK_FIELDS",
176
+ count: styleBlock.backFields.length
177
+ })
178
+ }), _jsxs(BackFields, {
179
+ children: [styleBlock.backFields.slice(0, BACK_FIELDS_SHOWN).map((field, i) => _jsxs(BackFieldItem, {
180
+ children: [_jsxs(BackFieldLabel, {
181
+ children: [field.label || field.key, ":"]
182
+ }), ' ', formatFieldValue(field)]
183
+ }, `${field.key ?? 'back'}-${i}`)), styleBlock.backFields.length > BACK_FIELDS_SHOWN && _jsx(BackFieldMore, {
184
+ children: _jsx(Lang, {
185
+ message: "DUMB.WALLET_PASS_PREVIEW.MORE",
186
+ count: styleBlock.backFields.length - BACK_FIELDS_SHOWN
187
+ })
188
+ })]
189
+ })]
190
+ })]
191
+ }), _jsxs(Note, {
192
+ children: [_jsx(Lang, {
193
+ message: "DUMB.WALLET_PASS_PREVIEW.NOTE_SIMPLIFIED"
194
+ }), _jsx("br", {}), _jsx("strong", {
195
+ children: _jsx(Lang, {
196
+ message: "DUMB.WALLET_PASS_PREVIEW.NOTE_LABEL"
197
+ })
198
+ }), ' ', _jsx(Lang, {
199
+ message: "DUMB.WALLET_PASS_PREVIEW.NOTE_BARCODES"
200
+ })]
201
+ })]
202
+ });
203
+ }
@@ -0,0 +1,3 @@
1
+ import { type ReactElement } from 'react';
2
+ import { type BarcodePlaceholderProps } from './types';
3
+ export declare function BarcodePlaceholder({ format }: BarcodePlaceholderProps): ReactElement;