@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,180 @@
1
+ import styled, { css } from 'styled-components';
2
+ import { Color, FontSize, FontWeight, ShapeRadius } from '@pushwoosh/kit-constants';
3
+ import { H3 } from '@pushwoosh/kit-typography';
4
+ export const Card = styled.div.withConfig({
5
+ displayName: "Card",
6
+ componentId: "sc-toqi7y-0"
7
+ })(["max-width:375px;margin:0 auto 2rem;border-radius:16px;overflow:hidden;box-shadow:0 8px 32px rgba(0,0,0,0.3);font-family:-apple-system,BlinkMacSystemFont,sans-serif;background-color:", ";color:", ";@media (max-width:768px){transform:scale(0.9);}"], ({
8
+ $bg
9
+ }) => $bg, ({
10
+ $fg
11
+ }) => $fg);
12
+ export const Header = styled.div.withConfig({
13
+ displayName: "Header",
14
+ componentId: "sc-toqi7y-1"
15
+ })(["display:flex;align-items:center;justify-content:space-between;padding:0.875rem 1.25rem;border-bottom:1px solid rgba(255,255,255,0.15);gap:0.75rem;"]);
16
+ export const HeaderBrand = styled.div.withConfig({
17
+ displayName: "HeaderBrand",
18
+ componentId: "sc-toqi7y-2"
19
+ })(["display:flex;align-items:center;flex:1;"]);
20
+ export const Logo = styled.img.withConfig({
21
+ displayName: "Logo",
22
+ componentId: "sc-toqi7y-3"
23
+ })(["height:32px;max-width:80px;object-fit:contain;flex-shrink:0;"]);
24
+ export const LogoText = styled.div.withConfig({
25
+ displayName: "LogoText",
26
+ componentId: "sc-toqi7y-4"
27
+ })(["font-size:16px;font-weight:600;letter-spacing:-0.02em;flex-shrink:0;"]);
28
+ export const HeaderFields = styled.div.withConfig({
29
+ displayName: "HeaderFields",
30
+ componentId: "sc-toqi7y-5"
31
+ })(["display:flex;gap:0.75rem;"]);
32
+ export const HeaderField = styled.div.withConfig({
33
+ displayName: "HeaderField",
34
+ componentId: "sc-toqi7y-6"
35
+ })(["flex:0 1 auto;text-align:right;"]);
36
+ export const Strip = styled.div.withConfig({
37
+ displayName: "Strip",
38
+ componentId: "sc-toqi7y-7"
39
+ })(["width:100%;height:120px;overflow:hidden;"]);
40
+ export const Background = styled.div.withConfig({
41
+ displayName: "Background",
42
+ componentId: "sc-toqi7y-8"
43
+ })(["position:absolute;top:0;left:0;width:100%;height:100%;z-index:-1;opacity:0.3;"]);
44
+ export const CoverImage = styled.img.withConfig({
45
+ displayName: "CoverImage",
46
+ componentId: "sc-toqi7y-9"
47
+ })(["width:100%;height:100%;object-fit:cover;"]);
48
+ export const Content = styled.div.withConfig({
49
+ displayName: "Content",
50
+ componentId: "sc-toqi7y-10"
51
+ })(["padding:1.25rem 1.25rem 0.75rem;"]);
52
+ export const PrimaryFields = styled.div.withConfig({
53
+ displayName: "PrimaryFields",
54
+ componentId: "sc-toqi7y-11"
55
+ })(["display:flex;gap:0.75rem;align-items:center;margin-bottom:0.875rem;", ""], ({
56
+ $boarding
57
+ }) => $boarding && css(["gap:1rem;justify-content:space-between;padding:0.5rem 0;position:relative;&::after{content:'\\2708';position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);font-size:1.5rem;opacity:0.4;}"]));
58
+ export const PrimaryField = styled.div.withConfig({
59
+ displayName: "PrimaryField",
60
+ componentId: "sc-toqi7y-12"
61
+ })(["flex:1;margin-bottom:0;text-align:", ";"], ({
62
+ $boarding
63
+ }) => $boarding ? 'center' : 'inherit');
64
+ export const FieldLabel = styled.div.withConfig({
65
+ displayName: "FieldLabel",
66
+ componentId: "sc-toqi7y-13"
67
+ })(["font-size:0.6875rem;font-weight:", ";margin-bottom:0.25rem;letter-spacing:0.3px;opacity:0.75;text-transform:uppercase;color:", ";"], FontWeight.MEDIUM, ({
68
+ $color
69
+ }) => $color);
70
+ export const FieldValue = styled.div.withConfig({
71
+ displayName: "FieldValue",
72
+ componentId: "sc-toqi7y-14"
73
+ })(["font-size:2.25rem;font-weight:600;line-height:1.1;letter-spacing:-0.02em;"]);
74
+ export const FieldValueSmall = styled.div.withConfig({
75
+ displayName: "FieldValueSmall",
76
+ componentId: "sc-toqi7y-15"
77
+ })(["font-size:18px;font-weight:600;line-height:1.3;"]);
78
+ export const FieldValueSecondary = styled.div.withConfig({
79
+ displayName: "FieldValueSecondary",
80
+ componentId: "sc-toqi7y-16"
81
+ })(["font-size:16px;font-weight:", ";line-height:1.3;"], FontWeight.MEDIUM);
82
+ export const Thumbnail = styled.img.withConfig({
83
+ displayName: "Thumbnail",
84
+ componentId: "sc-toqi7y-17"
85
+ })(["width:80px;height:80px;border-radius:", ";object-fit:cover;"], ShapeRadius.SECTION);
86
+ export const AuxiliaryFields = styled.div.withConfig({
87
+ displayName: "AuxiliaryFields",
88
+ componentId: "sc-toqi7y-18"
89
+ })(["display:grid;grid-template-columns:repeat(3,1fr);gap:0.75rem;margin-bottom:0.875rem;padding-bottom:0.875rem;border-bottom:1px solid rgba(255,255,255,0.15);"]);
90
+ export const AuxiliaryField = styled.div.withConfig({
91
+ displayName: "AuxiliaryField",
92
+ componentId: "sc-toqi7y-19"
93
+ })(["min-width:0;&:nth-child(2){text-align:center;}"]);
94
+ export const SecondaryFields = styled.div.withConfig({
95
+ displayName: "SecondaryFields",
96
+ componentId: "sc-toqi7y-20"
97
+ })(["display:grid;grid-template-columns:1fr 1fr;gap:0.875rem;margin-bottom:0.875rem;"]);
98
+ export const SecondaryField = styled.div.withConfig({
99
+ displayName: "SecondaryField",
100
+ componentId: "sc-toqi7y-21"
101
+ })(["min-width:0;&:last-child{text-align:right;}"]);
102
+ export const Barcode = styled.div.withConfig({
103
+ displayName: "Barcode",
104
+ componentId: "sc-toqi7y-22"
105
+ })(["padding:1.25rem 1.25rem 1.5rem;text-align:center;background:rgba(255,255,255,0.08);"]);
106
+ export const BarcodeAltText = styled.div.withConfig({
107
+ displayName: "BarcodeAltText",
108
+ componentId: "sc-toqi7y-23"
109
+ })(["margin-top:0.625rem;font-size:0.8125rem;opacity:0.75;font-weight:", ";letter-spacing:0.5px;color:", ";"], FontWeight.MEDIUM, ({
110
+ $color
111
+ }) => $color);
112
+ export const Footer = styled.div.withConfig({
113
+ displayName: "Footer",
114
+ componentId: "sc-toqi7y-24"
115
+ })(["padding:0.5rem 1rem;text-align:center;"]);
116
+ export const FooterImage = styled.img.withConfig({
117
+ displayName: "FooterImage",
118
+ componentId: "sc-toqi7y-25"
119
+ })(["height:15px;object-fit:contain;"]);
120
+ export const InfoBar = styled.div.withConfig({
121
+ displayName: "InfoBar",
122
+ componentId: "sc-toqi7y-26"
123
+ })(["display:flex;gap:0.75rem;flex-wrap:wrap;justify-content:center;margin-bottom:2rem;"]);
124
+ export const InfoBadge = styled.span.withConfig({
125
+ displayName: "InfoBadge",
126
+ componentId: "sc-toqi7y-27"
127
+ })(["background:", ";color:", ";padding:0.375rem 0.75rem;border-radius:6px;font-size:", ";font-weight:600;text-transform:", ";"], ({
128
+ $background
129
+ }) => $background, Color.CLEAR, FontSize.SMALL, ({
130
+ $capitalize
131
+ }) => $capitalize ? 'capitalize' : 'none');
132
+ export const Info = styled.div.withConfig({
133
+ displayName: "Info",
134
+ componentId: "sc-toqi7y-28"
135
+ })(["background:", ";padding:1.5rem;border-radius:12px;margin-top:2rem;"], Color.FROZEN);
136
+ export const InfoSection = styled.div.withConfig({
137
+ displayName: "InfoSection",
138
+ componentId: "sc-toqi7y-29"
139
+ })(["margin-top:1.5rem;padding-top:1.5rem;border-top:1px solid ", ";&:first-child{margin-top:0;padding-top:0;border-top:none;}"], Color.DIVIDER);
140
+ // The old bare h4 kept the UA top margin (1.33em of 16px); kit H3 resets it.
141
+ export const SectionTitle = styled(H3).withConfig({
142
+ displayName: "SectionTitle",
143
+ componentId: "sc-toqi7y-30"
144
+ })(["margin:1.33rem 0 1rem;"]);
145
+ export const SerialItem = styled.div.withConfig({
146
+ displayName: "SerialItem",
147
+ componentId: "sc-toqi7y-31"
148
+ })(["font-size:", ";margin-bottom:0.75rem;"], FontSize.REGULAR);
149
+ export const SerialLabel = styled.strong.withConfig({
150
+ displayName: "SerialLabel",
151
+ componentId: "sc-toqi7y-32"
152
+ })(["color:", ";margin-right:0.375rem;"], Color.LOCKED);
153
+ export const StatusBadge = styled.div.withConfig({
154
+ displayName: "StatusBadge",
155
+ componentId: "sc-toqi7y-33"
156
+ })(["padding:0.75rem;border-radius:", ";margin-bottom:0.5rem;font-size:", ";line-height:1.4;background:", ";color:", ";font-weight:", ";"], ShapeRadius.SECTION, FontSize.REGULAR, ({
157
+ $background
158
+ }) => $background, Color.CLEAR, ({
159
+ $bold
160
+ }) => $bold ? 600 : 'inherit');
161
+ export const BackFields = styled.div.withConfig({
162
+ displayName: "BackFields",
163
+ componentId: "sc-toqi7y-34"
164
+ })(["background:", ";padding:1rem;border-radius:", ";font-size:", ";"], Color.FROZEN, ShapeRadius.SECTION, FontSize.REGULAR);
165
+ export const BackFieldItem = styled.div.withConfig({
166
+ displayName: "BackFieldItem",
167
+ componentId: "sc-toqi7y-35"
168
+ })(["margin-bottom:0.5rem;line-height:1.6;"]);
169
+ export const BackFieldLabel = styled.strong.withConfig({
170
+ displayName: "BackFieldLabel",
171
+ componentId: "sc-toqi7y-36"
172
+ })(["color:", ";font-size:", ";text-transform:uppercase;margin-right:0.375rem;"], Color.LOCKED, FontSize.SMALL);
173
+ export const BackFieldMore = styled.div.withConfig({
174
+ displayName: "BackFieldMore",
175
+ componentId: "sc-toqi7y-37"
176
+ })(["color:", ";font-style:italic;margin-top:0.5rem;"], Color.LOCKED);
177
+ export const Note = styled.p.withConfig({
178
+ displayName: "Note",
179
+ componentId: "sc-toqi7y-38"
180
+ })(["color:", ";font-size:", ";margin-top:1.5rem;"], Color.LOCKED, FontSize.REGULAR);
@@ -0,0 +1,34 @@
1
+ /** Apple Wallet pass JSON (`pass.json`), as the pass designer edits it. */
2
+ export type WalletPass = {
3
+ formatVersion: 1;
4
+ passTypeIdentifier: string;
5
+ /** Assigned server-side on creation; never set or edited on the frontend. */
6
+ serialNumber?: string;
7
+ teamIdentifier: string;
8
+ organizationName: string;
9
+ description: string;
10
+ [key: string]: any;
11
+ };
12
+ /** One field of a pass style block (header, primary, secondary, auxiliary, back). */
13
+ export type WalletPassField = {
14
+ key: string;
15
+ label?: string;
16
+ value: string | number;
17
+ changeMessage?: string;
18
+ textAlignment?: string;
19
+ dateStyle?: string;
20
+ timeStyle?: string;
21
+ isRelative?: boolean;
22
+ numberStyle?: string;
23
+ currencyCode?: string;
24
+ dataDetectorTypes?: string[];
25
+ };
26
+ /** Props of {@link WalletPassPreview}. */
27
+ export type WalletPassPreviewProps = {
28
+ /** Pass to draw. */
29
+ pass: WalletPass;
30
+ /** Style block of the pass: `boardingPass`, `coupon`, `eventTicket`, `storeCard` or `generic`. */
31
+ passStyle: string;
32
+ /** Image URLs by slot: `logo`, `strip`, `background`, `thumbnail`, `footer`. */
33
+ imageUrls?: Record<string, string>;
34
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ import { type ReactElement } from 'react';
2
+ import type { WebPushPreviewProps } from './types';
3
+ /** Renders a web push the way a desktop browser shows it: site on top, icon, title and body. */
4
+ export declare function WebPushPreview(props: WebPushPreviewProps): ReactElement;
@@ -0,0 +1,40 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { BrowserIcon } from '@pushwoosh/kit-icons';
3
+ import { Lang } from './polyglot';
4
+ import { Body, BrowserBar, Icon, Message, Title, Toast } from './styles';
5
+ import { PREVIEW_ICON_URL } from '../PushPreview/constants';
6
+ import { LIGHT_ISLAND_PROPS } from '../shared/lightIsland';
7
+ /** Renders a web push the way a desktop browser shows it: site on top, icon, title and body. */
8
+ export function WebPushPreview(props) {
9
+ const {
10
+ title,
11
+ text,
12
+ appName,
13
+ iconUrl,
14
+ width
15
+ } = props;
16
+ return _jsxs(Toast, {
17
+ ...LIGHT_ISLAND_PROPS,
18
+ "$width": width,
19
+ children: [appName && _jsxs(BrowserBar, {
20
+ children: [_jsx(BrowserIcon, {
21
+ size: "small",
22
+ view: "lined"
23
+ }), appName]
24
+ }), _jsxs(Body, {
25
+ children: [_jsx(Icon, {
26
+ alt: appName ?? title,
27
+ src: iconUrl || PREVIEW_ICON_URL
28
+ }), _jsxs("div", {
29
+ children: [title && _jsx(Title, {
30
+ children: title
31
+ }), _jsx(Message, {
32
+ "$locked": !text,
33
+ children: text || _jsx(Lang, {
34
+ message: "DUMB.WEB_PUSH_PREVIEW.EMPTY"
35
+ })
36
+ })]
37
+ })]
38
+ })]
39
+ });
40
+ }
@@ -0,0 +1,2 @@
1
+ export { WebPushPreview } from './WebPushPreview';
2
+ export type { WebPushPreviewProps } from './types';
@@ -0,0 +1 @@
1
+ export { WebPushPreview } from './WebPushPreview';
@@ -0,0 +1,5 @@
1
+ export declare const Lang: import("react").FC<{
2
+ message: "DUMB.WEB_PUSH_PREVIEW.EMPTY";
3
+ } & import("../..").NoParams>, useLang: () => (props: {
4
+ message: "DUMB.WEB_PUSH_PREVIEW.EMPTY";
5
+ } & import("../..").NoParams) => 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 WebPushPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<WebPushPreviewMessages>;
@@ -0,0 +1,3 @@
1
+ export const messages = {
2
+ 'DUMB.WEB_PUSH_PREVIEW.EMPTY': 'الرسالة فارغة…'
3
+ };
@@ -0,0 +1,3 @@
1
+ import { type WebPushPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<WebPushPreviewMessages>;
@@ -0,0 +1,3 @@
1
+ export const messages = {
2
+ 'DUMB.WEB_PUSH_PREVIEW.EMPTY': 'বার্তাটি খালি…'
3
+ };
@@ -0,0 +1,3 @@
1
+ import { type WebPushPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<WebPushPreviewMessages>;
@@ -0,0 +1,3 @@
1
+ export const messages = {
2
+ 'DUMB.WEB_PUSH_PREVIEW.EMPTY': 'Die Nachricht ist leer…'
3
+ };
@@ -0,0 +1,3 @@
1
+ import { type WebPushPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<WebPushPreviewMessages>;
@@ -0,0 +1,3 @@
1
+ export const messages = {
2
+ 'DUMB.WEB_PUSH_PREVIEW.EMPTY': 'Message is empty…'
3
+ };
@@ -0,0 +1,3 @@
1
+ import { type WebPushPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<WebPushPreviewMessages>;
@@ -0,0 +1,3 @@
1
+ export const messages = {
2
+ 'DUMB.WEB_PUSH_PREVIEW.EMPTY': 'El mensaje está vacío…'
3
+ };
@@ -0,0 +1,3 @@
1
+ import { type WebPushPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<WebPushPreviewMessages>;
@@ -0,0 +1,3 @@
1
+ export const messages = {
2
+ 'DUMB.WEB_PUSH_PREVIEW.EMPTY': 'Le message est vide…'
3
+ };
@@ -0,0 +1,3 @@
1
+ import { type WebPushPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<WebPushPreviewMessages>;
@@ -0,0 +1,3 @@
1
+ export const messages = {
2
+ 'DUMB.WEB_PUSH_PREVIEW.EMPTY': 'ההודעה ריקה…'
3
+ };
@@ -0,0 +1,3 @@
1
+ import { type WebPushPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<WebPushPreviewMessages>;
@@ -0,0 +1,3 @@
1
+ export const messages = {
2
+ 'DUMB.WEB_PUSH_PREVIEW.EMPTY': 'संदेश खाली है…'
3
+ };
@@ -0,0 +1,3 @@
1
+ import { type WebPushPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<WebPushPreviewMessages>;
@@ -0,0 +1,3 @@
1
+ export const messages = {
2
+ 'DUMB.WEB_PUSH_PREVIEW.EMPTY': 'メッセージが空です…'
3
+ };
@@ -0,0 +1,3 @@
1
+ import { type WebPushPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<WebPushPreviewMessages>;
@@ -0,0 +1,3 @@
1
+ export const messages = {
2
+ 'DUMB.WEB_PUSH_PREVIEW.EMPTY': '메시지가 비어 있습니다…'
3
+ };
@@ -0,0 +1,3 @@
1
+ import { type WebPushPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<WebPushPreviewMessages>;
@@ -0,0 +1,3 @@
1
+ export const messages = {
2
+ 'DUMB.WEB_PUSH_PREVIEW.EMPTY': 'A mensagem está vazia…'
3
+ };
@@ -0,0 +1,3 @@
1
+ import { type WebPushPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<WebPushPreviewMessages>;
@@ -0,0 +1,3 @@
1
+ export const messages = {
2
+ 'DUMB.WEB_PUSH_PREVIEW.EMPTY': 'Сообщение пустое…'
3
+ };
@@ -0,0 +1,3 @@
1
+ import { type WebPushPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<WebPushPreviewMessages>;
@@ -0,0 +1,3 @@
1
+ export const messages = {
2
+ 'DUMB.WEB_PUSH_PREVIEW.EMPTY': 'ข้อความว่างเปล่า…'
3
+ };
@@ -0,0 +1,3 @@
1
+ import { type WebPushPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<WebPushPreviewMessages>;
@@ -0,0 +1,3 @@
1
+ export const messages = {
2
+ 'DUMB.WEB_PUSH_PREVIEW.EMPTY': '消息为空…'
3
+ };
@@ -0,0 +1,4 @@
1
+ import type { NoParams } from '../../polyglot';
2
+ export type WebPushPreviewMessages = {
3
+ 'DUMB.WEB_PUSH_PREVIEW.EMPTY': NoParams;
4
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,22 @@
1
+ export declare const Toast: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Merged<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
2
+ style?: import("react").CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
3
+ }, {
4
+ $width?: string | number;
5
+ }>> & string;
6
+ export declare const BrowserBar: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
7
+ style?: import("react").CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
8
+ }> & string;
9
+ export declare const Body: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
10
+ style?: import("react").CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
11
+ }> & string;
12
+ export declare const Icon: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, "style"> & {
13
+ style?: import("react").CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
14
+ }> & string;
15
+ export declare const Title: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
16
+ style?: import("react").CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
17
+ }> & string;
18
+ export declare const Message: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Merged<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
19
+ style?: import("react").CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
20
+ }, {
21
+ $locked?: boolean;
22
+ }>> & string;
@@ -0,0 +1,31 @@
1
+ import styled from 'styled-components';
2
+ import { Color, FontSize, FontWeight, LineHeight, Shadow, ShapeRadius } from '@pushwoosh/kit-constants';
3
+ import { toCssValue } from '@pushwoosh/kit-helpers';
4
+ export const Toast = styled.div.withConfig({
5
+ displayName: "Toast",
6
+ componentId: "sc-xhzvrb-0"
7
+ })(["display:flex;flex-direction:column;gap:8px;width:", ";min-width:240px;max-width:360px;padding:12px;border:1px solid ", ";border-radius:", ";background:", ";box-shadow:", ";"], ({
8
+ $width
9
+ }) => $width ? toCssValue($width) : '100%', Color.DIVIDER, ShapeRadius.SECTION, Color.CLEAR, Shadow.LARGE);
10
+ export const BrowserBar = styled.div.withConfig({
11
+ displayName: "BrowserBar",
12
+ componentId: "sc-xhzvrb-1"
13
+ })(["display:flex;align-items:center;gap:6px;color:", ";font-size:", ";line-height:", ";"], Color.LOCKED, FontSize.SMALL, LineHeight.SMALL);
14
+ export const Body = styled.div.withConfig({
15
+ displayName: "Body",
16
+ componentId: "sc-xhzvrb-2"
17
+ })(["display:grid;grid-template-columns:40px 1fr;gap:12px;align-items:start;"]);
18
+ export const Icon = styled.img.withConfig({
19
+ displayName: "Icon",
20
+ componentId: "sc-xhzvrb-3"
21
+ })(["width:40px;height:40px;border-radius:", ";object-fit:cover;"], ShapeRadius.CONTROL);
22
+ export const Title = styled.div.withConfig({
23
+ displayName: "Title",
24
+ componentId: "sc-xhzvrb-4"
25
+ })(["color:", ";font-size:", ";font-weight:", ";line-height:", ";word-break:break-word;"], Color.MAIN, FontSize.REGULAR, FontWeight.MEDIUM, LineHeight.REGULAR);
26
+ export const Message = styled.div.withConfig({
27
+ displayName: "Message",
28
+ componentId: "sc-xhzvrb-5"
29
+ })(["color:", ";font-size:", ";line-height:", ";white-space:pre-wrap;word-break:break-word;"], ({
30
+ $locked
31
+ }) => $locked ? Color.LOCKED : Color.MAIN, FontSize.SMALL, LineHeight.SMALL);
@@ -0,0 +1,13 @@
1
+ /** Props of {@link WebPushPreview}. */
2
+ export interface WebPushPreviewProps {
3
+ /** Notification title. */
4
+ title: string;
5
+ /** Notification body. */
6
+ text: string;
7
+ /** Site or application the browser names as the sender. */
8
+ appName?: string;
9
+ /** Notification icon URL; the default push icon otherwise. */
10
+ iconUrl?: string;
11
+ /** CSS width of the preview. */
12
+ width?: string | number;
13
+ }
@@ -0,0 +1 @@
1
+ export {};
package/index.d.ts CHANGED
@@ -37,6 +37,12 @@ export { PushStoriesPreview, hasStoryButton, normalizeStoryDuration, PUSH_STORIE
37
37
  export { InboxPreview, resolveInboxLayout, MAX_CAROUSEL_SLIDES, type InboxLayoutType, type InboxPreviewPlatform, type InboxPreviewContent, type InboxPreviewProps, type InboxPreviewSlide, } from './InboxPreview';
38
38
  export { WhatsAppPreview } from './WhatsAppPreview';
39
39
  export type { WhatsAppAttachment, WhatsAppAttachmentKind, WhatsAppMessage, WhatsAppPreviewProps, } from './WhatsAppPreview';
40
+ export { SmsPreview } from './SmsPreview';
41
+ export type { SmsEncoding, SmsPreviewProps, SmsSegments } from './SmsPreview';
42
+ export { WebPushPreview } from './WebPushPreview';
43
+ export type { WebPushPreviewProps } from './WebPushPreview';
44
+ export { WalletPassPreview } from './WalletPassPreview';
45
+ export type { WalletPass, WalletPassField, WalletPassPreviewProps } from './WalletPassPreview';
40
46
  export { ChatPreview } from './ChatPreview';
41
47
  export type { ChatButton, ChatButtonKind, ChatCard, ChatChannel, ChatCompatibility, ChatContent, ChatContentType, ChatHeader, ChatIssue, ChatIssueSeverity, ChatList, ChatListItem, ChatMedia, ChatMediaKind, ChatPreviewProps, ChatRcsHeight, ChatRcsLayout, ChatRcsOrientation, ChatRcsThumbnailAlignment, } from './ChatPreview';
42
48
  export { Toast, ToastProvider, useToast } from './Toast';
package/index.js CHANGED
@@ -36,6 +36,9 @@ export { PushPreview, getDefaultLanguage } from './PushPreview';
36
36
  export { PushStoriesPreview, hasStoryButton, normalizeStoryDuration, PUSH_STORIES_ASPECT_RATIO, PUSH_STORIES_DEFAULT_DURATION, PUSH_STORIES_MAX_DURATION } from './PushStoriesPreview';
37
37
  export { InboxPreview, resolveInboxLayout, MAX_CAROUSEL_SLIDES } from './InboxPreview';
38
38
  export { WhatsAppPreview } from './WhatsAppPreview';
39
+ export { SmsPreview } from './SmsPreview';
40
+ export { WebPushPreview } from './WebPushPreview';
41
+ export { WalletPassPreview } from './WalletPassPreview';
39
42
  export { ChatPreview } from './ChatPreview';
40
43
  export { Toast, ToastProvider, useToast } from './Toast';
41
44
  export { AutosizeInput, PageHeader, PageHeaderEditable, Rename } from './PageHeader';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/dumb-components",
3
- "version": "4.16.0",
3
+ "version": "4.17.1",
4
4
  "description": "React components to build Pushwoosh products",
5
5
  "main": "index.js",
6
6
  "module": "index.js",