@pushwoosh/dumb-components 4.16.0 → 4.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/SmsPreview/SmsPreview.d.ts +4 -0
- package/SmsPreview/SmsPreview.js +48 -0
- package/SmsPreview/index.d.ts +2 -0
- package/SmsPreview/index.js +1 -0
- package/SmsPreview/polyglot/index.d.ts +2 -0
- package/SmsPreview/polyglot/index.js +34 -0
- package/SmsPreview/polyglot/messages_ar.d.ts +3 -0
- package/SmsPreview/polyglot/messages_ar.js +5 -0
- package/SmsPreview/polyglot/messages_bn.d.ts +3 -0
- package/SmsPreview/polyglot/messages_bn.js +5 -0
- package/SmsPreview/polyglot/messages_de.d.ts +3 -0
- package/SmsPreview/polyglot/messages_de.js +5 -0
- package/SmsPreview/polyglot/messages_en.d.ts +3 -0
- package/SmsPreview/polyglot/messages_en.js +5 -0
- package/SmsPreview/polyglot/messages_es.d.ts +3 -0
- package/SmsPreview/polyglot/messages_es.js +5 -0
- package/SmsPreview/polyglot/messages_fr.d.ts +3 -0
- package/SmsPreview/polyglot/messages_fr.js +5 -0
- package/SmsPreview/polyglot/messages_he.d.ts +3 -0
- package/SmsPreview/polyglot/messages_he.js +5 -0
- package/SmsPreview/polyglot/messages_hi.d.ts +3 -0
- package/SmsPreview/polyglot/messages_hi.js +5 -0
- package/SmsPreview/polyglot/messages_ja.d.ts +3 -0
- package/SmsPreview/polyglot/messages_ja.js +5 -0
- package/SmsPreview/polyglot/messages_ko.d.ts +3 -0
- package/SmsPreview/polyglot/messages_ko.js +5 -0
- package/SmsPreview/polyglot/messages_pt.d.ts +3 -0
- package/SmsPreview/polyglot/messages_pt.js +5 -0
- package/SmsPreview/polyglot/messages_ru.d.ts +3 -0
- package/SmsPreview/polyglot/messages_ru.js +5 -0
- package/SmsPreview/polyglot/messages_th.d.ts +3 -0
- package/SmsPreview/polyglot/messages_th.js +5 -0
- package/SmsPreview/polyglot/messages_zh.d.ts +3 -0
- package/SmsPreview/polyglot/messages_zh.js +5 -0
- package/SmsPreview/polyglot/types.d.ts +9 -0
- package/SmsPreview/polyglot/types.js +1 -0
- package/SmsPreview/styles.d.ts +15 -0
- package/SmsPreview/styles.js +22 -0
- package/SmsPreview/types.d.ts +22 -0
- package/SmsPreview/types.js +1 -0
- package/WalletPassPreview/WalletPassPreview.d.ts +4 -0
- package/WalletPassPreview/WalletPassPreview.js +203 -0
- package/WalletPassPreview/components/BarcodePlaceholder/BarcodePlaceholder.d.ts +3 -0
- package/WalletPassPreview/components/BarcodePlaceholder/BarcodePlaceholder.js +148 -0
- package/WalletPassPreview/components/BarcodePlaceholder/index.d.ts +1 -0
- package/WalletPassPreview/components/BarcodePlaceholder/index.js +1 -0
- package/WalletPassPreview/components/BarcodePlaceholder/styles.d.ts +6 -0
- package/WalletPassPreview/components/BarcodePlaceholder/styles.js +11 -0
- package/WalletPassPreview/components/BarcodePlaceholder/types.d.ts +3 -0
- package/WalletPassPreview/components/BarcodePlaceholder/types.js +1 -0
- package/WalletPassPreview/constants.d.ts +8 -0
- package/WalletPassPreview/constants.js +27 -0
- package/WalletPassPreview/helpers/formatting.d.ts +3 -0
- package/WalletPassPreview/helpers/formatting.js +63 -0
- package/WalletPassPreview/helpers/index.d.ts +1 -0
- package/WalletPassPreview/helpers/index.js +1 -0
- package/WalletPassPreview/index.d.ts +2 -0
- package/WalletPassPreview/index.js +1 -0
- package/WalletPassPreview/polyglot/index.d.ts +2 -0
- package/WalletPassPreview/polyglot/index.js +34 -0
- package/WalletPassPreview/polyglot/messages_ar.d.ts +3 -0
- package/WalletPassPreview/polyglot/messages_ar.js +34 -0
- package/WalletPassPreview/polyglot/messages_bn.d.ts +3 -0
- package/WalletPassPreview/polyglot/messages_bn.js +34 -0
- package/WalletPassPreview/polyglot/messages_de.d.ts +3 -0
- package/WalletPassPreview/polyglot/messages_de.js +34 -0
- package/WalletPassPreview/polyglot/messages_en.d.ts +3 -0
- package/WalletPassPreview/polyglot/messages_en.js +34 -0
- package/WalletPassPreview/polyglot/messages_es.d.ts +3 -0
- package/WalletPassPreview/polyglot/messages_es.js +34 -0
- package/WalletPassPreview/polyglot/messages_fr.d.ts +3 -0
- package/WalletPassPreview/polyglot/messages_fr.js +34 -0
- package/WalletPassPreview/polyglot/messages_he.d.ts +3 -0
- package/WalletPassPreview/polyglot/messages_he.js +34 -0
- package/WalletPassPreview/polyglot/messages_hi.d.ts +3 -0
- package/WalletPassPreview/polyglot/messages_hi.js +34 -0
- package/WalletPassPreview/polyglot/messages_ja.d.ts +3 -0
- package/WalletPassPreview/polyglot/messages_ja.js +34 -0
- package/WalletPassPreview/polyglot/messages_ko.d.ts +3 -0
- package/WalletPassPreview/polyglot/messages_ko.js +34 -0
- package/WalletPassPreview/polyglot/messages_pt.d.ts +3 -0
- package/WalletPassPreview/polyglot/messages_pt.js +34 -0
- package/WalletPassPreview/polyglot/messages_ru.d.ts +3 -0
- package/WalletPassPreview/polyglot/messages_ru.js +34 -0
- package/WalletPassPreview/polyglot/messages_th.d.ts +3 -0
- package/WalletPassPreview/polyglot/messages_th.js +34 -0
- package/WalletPassPreview/polyglot/messages_zh.d.ts +3 -0
- package/WalletPassPreview/polyglot/messages_zh.js +34 -0
- package/WalletPassPreview/polyglot/types.d.ts +47 -0
- package/WalletPassPreview/polyglot/types.js +1 -0
- package/WalletPassPreview/styles.d.ts +139 -0
- package/WalletPassPreview/styles.js +180 -0
- package/WalletPassPreview/types.d.ts +34 -0
- package/WalletPassPreview/types.js +1 -0
- package/WebPushPreview/WebPushPreview.d.ts +4 -0
- package/WebPushPreview/WebPushPreview.js +40 -0
- package/WebPushPreview/index.d.ts +2 -0
- package/WebPushPreview/index.js +1 -0
- package/WebPushPreview/polyglot/index.d.ts +5 -0
- package/WebPushPreview/polyglot/index.js +34 -0
- package/WebPushPreview/polyglot/messages_ar.d.ts +3 -0
- package/WebPushPreview/polyglot/messages_ar.js +3 -0
- package/WebPushPreview/polyglot/messages_bn.d.ts +3 -0
- package/WebPushPreview/polyglot/messages_bn.js +3 -0
- package/WebPushPreview/polyglot/messages_de.d.ts +3 -0
- package/WebPushPreview/polyglot/messages_de.js +3 -0
- package/WebPushPreview/polyglot/messages_en.d.ts +3 -0
- package/WebPushPreview/polyglot/messages_en.js +3 -0
- package/WebPushPreview/polyglot/messages_es.d.ts +3 -0
- package/WebPushPreview/polyglot/messages_es.js +3 -0
- package/WebPushPreview/polyglot/messages_fr.d.ts +3 -0
- package/WebPushPreview/polyglot/messages_fr.js +3 -0
- package/WebPushPreview/polyglot/messages_he.d.ts +3 -0
- package/WebPushPreview/polyglot/messages_he.js +3 -0
- package/WebPushPreview/polyglot/messages_hi.d.ts +3 -0
- package/WebPushPreview/polyglot/messages_hi.js +3 -0
- package/WebPushPreview/polyglot/messages_ja.d.ts +3 -0
- package/WebPushPreview/polyglot/messages_ja.js +3 -0
- package/WebPushPreview/polyglot/messages_ko.d.ts +3 -0
- package/WebPushPreview/polyglot/messages_ko.js +3 -0
- package/WebPushPreview/polyglot/messages_pt.d.ts +3 -0
- package/WebPushPreview/polyglot/messages_pt.js +3 -0
- package/WebPushPreview/polyglot/messages_ru.d.ts +3 -0
- package/WebPushPreview/polyglot/messages_ru.js +3 -0
- package/WebPushPreview/polyglot/messages_th.d.ts +3 -0
- package/WebPushPreview/polyglot/messages_th.js +3 -0
- package/WebPushPreview/polyglot/messages_zh.d.ts +3 -0
- package/WebPushPreview/polyglot/messages_zh.js +3 -0
- package/WebPushPreview/polyglot/types.d.ts +4 -0
- package/WebPushPreview/polyglot/types.js +1 -0
- package/WebPushPreview/styles.d.ts +22 -0
- package/WebPushPreview/styles.js +31 -0
- package/WebPushPreview/types.d.ts +13 -0
- package/WebPushPreview/types.js +1 -0
- package/index.d.ts +6 -0
- package/index.js +3 -0
- 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 @@
|
|
|
1
|
+
export { WebPushPreview } from './WebPushPreview';
|
|
@@ -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 @@
|
|
|
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';
|