@guardian/stand 0.0.5 → 0.0.6
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/README.md +394 -7
- package/dist/{byline → components/byline}/Byline.cjs +5 -5
- package/dist/{byline → components/byline}/Byline.js +5 -5
- package/dist/components/byline/styles.cjs +266 -0
- package/dist/components/byline/styles.js +256 -0
- package/dist/components/tag-picker/TagAutocomplete.cjs +107 -0
- package/dist/components/tag-picker/TagAutocomplete.js +26 -0
- package/dist/components/tag-picker/TagTable.cjs +203 -0
- package/dist/components/tag-picker/TagTable.js +91 -0
- package/dist/components/tag-picker/styles.cjs +198 -0
- package/dist/components/tag-picker/styles.js +185 -0
- package/dist/components/util.cjs +19 -0
- package/dist/components/util.js +17 -0
- package/dist/index.cjs +15 -1
- package/dist/index.js +8 -1
- package/dist/styleD/build/css/css/base/colors.css +122 -0
- package/dist/styleD/build/css/css/base/typography.css +43 -0
- package/dist/styleD/build/css/css/component/byline.css +36 -0
- package/dist/styleD/build/css/css/component/tagAutocomplete.css +23 -0
- package/dist/styleD/build/css/css/component/tagTable.css +39 -0
- package/dist/styleD/build/css/css/semantic/colors.css +27 -0
- package/dist/styleD/build/css/css/semantic/typography.css +138 -0
- package/dist/styleD/build/typescript/base/colors.cjs +144 -0
- package/dist/styleD/build/typescript/base/colors.js +142 -0
- package/dist/styleD/build/typescript/base/typography.cjs +65 -0
- package/dist/styleD/build/typescript/base/typography.js +63 -0
- package/dist/styleD/build/typescript/component/byline.cjs +42 -0
- package/dist/styleD/build/typescript/component/byline.js +40 -0
- package/dist/styleD/build/typescript/component/tagAutocomplete.cjs +29 -0
- package/dist/styleD/build/typescript/component/tagAutocomplete.js +27 -0
- package/dist/styleD/build/typescript/component/tagTable.cjs +53 -0
- package/dist/styleD/build/typescript/component/tagTable.js +51 -0
- package/dist/styleD/build/typescript/semantic/colors.cjs +37 -0
- package/dist/styleD/build/typescript/semantic/colors.js +35 -0
- package/dist/styleD/build/typescript/semantic/typography.cjs +462 -0
- package/dist/styleD/build/typescript/semantic/typography.js +460 -0
- package/dist/styleD/utils/semantic/typography.cjs +17 -0
- package/dist/styleD/utils/semantic/typography.js +15 -0
- package/dist/types/components/byline/Byline.d.ts +83 -0
- package/dist/types/components/byline/styles.d.ts +13 -0
- package/dist/types/components/byline/theme.d.ts +3 -0
- package/dist/types/components/tag-picker/TagAutocomplete.d.ts +117 -0
- package/dist/types/components/tag-picker/TagTable.d.ts +126 -0
- package/dist/types/components/tag-picker/example-tags.d.ts +2 -0
- package/dist/types/components/tag-picker/styles.d.ts +16 -0
- package/dist/types/components/tag-picker/types.d.ts +65 -0
- package/dist/types/{byline → components}/util.d.ts +1 -0
- package/dist/types/index.d.ts +26 -2
- package/dist/types/styleD/build/typescript/base/colors.d.ts +144 -0
- package/dist/types/styleD/build/typescript/base/typography.d.ts +65 -0
- package/dist/types/styleD/build/typescript/component/byline.d.ts +42 -0
- package/dist/types/styleD/build/typescript/component/tagAutocomplete.d.ts +29 -0
- package/dist/types/styleD/build/typescript/component/tagTable.d.ts +53 -0
- package/dist/types/styleD/build/typescript/semantic/colors.d.ts +37 -0
- package/dist/types/styleD/build/typescript/semantic/typography.d.ts +462 -0
- package/dist/types/styleD/stories/base/Typography.d.ts +1 -0
- package/dist/types/styleD/stories/base/storybookColorPalette.d.ts +19 -0
- package/dist/types/styleD/stories/semantic/TypographyPresets.d.ts +1 -0
- package/dist/types/styleD/utils/semantic/typography.d.ts +15 -0
- package/dist/types/styleD/utils/semantic/typography.test.d.ts +1 -0
- package/package.json +67 -22
- package/dist/byline/styles.cjs +0 -244
- package/dist/byline/styles.js +0 -234
- package/dist/types/byline/Byline.d.ts +0 -17
- package/dist/types/byline/styles.d.ts +0 -11
- package/dist/types/byline/theme.d.ts +0 -44
- /package/dist/{byline → components/byline}/Preview.cjs +0 -0
- /package/dist/{byline → components/byline}/Preview.js +0 -0
- /package/dist/{byline → components/byline}/lib.cjs +0 -0
- /package/dist/{byline → components/byline}/lib.js +0 -0
- /package/dist/{byline → components/byline}/placeholder.cjs +0 -0
- /package/dist/{byline → components/byline}/placeholder.js +0 -0
- /package/dist/{byline → components/byline}/plugins.cjs +0 -0
- /package/dist/{byline → components/byline}/plugins.js +0 -0
- /package/dist/{byline → components/byline}/schema.cjs +0 -0
- /package/dist/{byline → components/byline}/schema.js +0 -0
- /package/dist/types/{byline → components/byline}/Preview.d.ts +0 -0
- /package/dist/types/{byline → components/byline}/contributors-fixture.d.ts +0 -0
- /package/dist/types/{byline → components/byline}/lib.d.ts +0 -0
- /package/dist/types/{byline → components/byline}/lib.test.d.ts +0 -0
- /package/dist/types/{byline → components/byline}/placeholder.d.ts +0 -0
- /package/dist/types/{byline → components/byline}/plugins.d.ts +0 -0
- /package/dist/types/{byline → components/byline}/schema.d.ts +0 -0
|
@@ -0,0 +1,460 @@
|
|
|
1
|
+
const semanticTypography = {
|
|
2
|
+
"title-sm": {
|
|
3
|
+
font: {
|
|
4
|
+
fontFamily: "GH Guardian Headline",
|
|
5
|
+
fontWeight: 700,
|
|
6
|
+
fontSize: "18px",
|
|
7
|
+
fontStyle: "normal",
|
|
8
|
+
lineHeight: 1.15,
|
|
9
|
+
letterSpacing: "0px"
|
|
10
|
+
},
|
|
11
|
+
letterSpacing: "0px",
|
|
12
|
+
fontWidth: 100
|
|
13
|
+
},
|
|
14
|
+
"title-md": {
|
|
15
|
+
font: {
|
|
16
|
+
fontFamily: "GH Guardian Headline",
|
|
17
|
+
fontWeight: 700,
|
|
18
|
+
fontSize: "20px",
|
|
19
|
+
fontStyle: "normal",
|
|
20
|
+
lineHeight: 1.15,
|
|
21
|
+
letterSpacing: "0px"
|
|
22
|
+
},
|
|
23
|
+
letterSpacing: "0px",
|
|
24
|
+
fontWidth: 100
|
|
25
|
+
},
|
|
26
|
+
"title-lg": {
|
|
27
|
+
font: {
|
|
28
|
+
fontFamily: "GH Guardian Headline",
|
|
29
|
+
fontWeight: 700,
|
|
30
|
+
fontSize: "24px",
|
|
31
|
+
fontStyle: "normal",
|
|
32
|
+
lineHeight: 1.15,
|
|
33
|
+
letterSpacing: "0px"
|
|
34
|
+
},
|
|
35
|
+
letterSpacing: "0px",
|
|
36
|
+
fontWidth: 100
|
|
37
|
+
},
|
|
38
|
+
"title-xl": {
|
|
39
|
+
font: {
|
|
40
|
+
fontFamily: "GH Guardian Headline",
|
|
41
|
+
fontWeight: 700,
|
|
42
|
+
fontSize: "32px",
|
|
43
|
+
fontStyle: "normal",
|
|
44
|
+
lineHeight: 1.15,
|
|
45
|
+
letterSpacing: "0px"
|
|
46
|
+
},
|
|
47
|
+
letterSpacing: "0px",
|
|
48
|
+
fontWidth: 100
|
|
49
|
+
},
|
|
50
|
+
"heading-xs": {
|
|
51
|
+
font: {
|
|
52
|
+
fontFamily: "Open Sans",
|
|
53
|
+
fontWeight: 700,
|
|
54
|
+
fontSize: "12px",
|
|
55
|
+
fontStyle: "normal",
|
|
56
|
+
lineHeight: 1.15,
|
|
57
|
+
letterSpacing: "0px"
|
|
58
|
+
},
|
|
59
|
+
letterSpacing: "0px",
|
|
60
|
+
fontWidth: 95
|
|
61
|
+
},
|
|
62
|
+
"heading-sm": {
|
|
63
|
+
font: {
|
|
64
|
+
fontFamily: "Open Sans",
|
|
65
|
+
fontWeight: 700,
|
|
66
|
+
fontSize: "14px",
|
|
67
|
+
fontStyle: "normal",
|
|
68
|
+
lineHeight: 1.15,
|
|
69
|
+
letterSpacing: "-0.2px"
|
|
70
|
+
},
|
|
71
|
+
letterSpacing: "-0.2px",
|
|
72
|
+
fontWidth: 95
|
|
73
|
+
},
|
|
74
|
+
"heading-md": {
|
|
75
|
+
font: {
|
|
76
|
+
fontFamily: "Open Sans",
|
|
77
|
+
fontWeight: 700,
|
|
78
|
+
fontSize: "16px",
|
|
79
|
+
fontStyle: "normal",
|
|
80
|
+
lineHeight: 1.15,
|
|
81
|
+
letterSpacing: "-0.5px"
|
|
82
|
+
},
|
|
83
|
+
letterSpacing: "-0.5px",
|
|
84
|
+
fontWidth: 95
|
|
85
|
+
},
|
|
86
|
+
"heading-lg": {
|
|
87
|
+
font: {
|
|
88
|
+
fontFamily: "Open Sans",
|
|
89
|
+
fontWeight: 700,
|
|
90
|
+
fontSize: "18px",
|
|
91
|
+
fontStyle: "normal",
|
|
92
|
+
lineHeight: 1.15,
|
|
93
|
+
letterSpacing: "-0.5px"
|
|
94
|
+
},
|
|
95
|
+
letterSpacing: "-0.5px",
|
|
96
|
+
fontWidth: 95
|
|
97
|
+
},
|
|
98
|
+
"heading-xl": {
|
|
99
|
+
font: {
|
|
100
|
+
fontFamily: "Open Sans",
|
|
101
|
+
fontWeight: 700,
|
|
102
|
+
fontSize: "20px",
|
|
103
|
+
fontStyle: "normal",
|
|
104
|
+
lineHeight: 1.15,
|
|
105
|
+
letterSpacing: "-0.5px"
|
|
106
|
+
},
|
|
107
|
+
letterSpacing: "-0.5px",
|
|
108
|
+
fontWidth: 95
|
|
109
|
+
},
|
|
110
|
+
"heading-2xl": {
|
|
111
|
+
font: {
|
|
112
|
+
fontFamily: "Open Sans",
|
|
113
|
+
fontWeight: 700,
|
|
114
|
+
fontSize: "24px",
|
|
115
|
+
fontStyle: "normal",
|
|
116
|
+
lineHeight: 1.15,
|
|
117
|
+
letterSpacing: "-1px"
|
|
118
|
+
},
|
|
119
|
+
letterSpacing: "-1px",
|
|
120
|
+
fontWidth: 95
|
|
121
|
+
},
|
|
122
|
+
"heading-compact-xs": {
|
|
123
|
+
font: {
|
|
124
|
+
fontFamily: "Open Sans",
|
|
125
|
+
fontWeight: 700,
|
|
126
|
+
fontSize: "12px",
|
|
127
|
+
fontStyle: "normal",
|
|
128
|
+
lineHeight: 1.15,
|
|
129
|
+
letterSpacing: "0px"
|
|
130
|
+
},
|
|
131
|
+
letterSpacing: "0px",
|
|
132
|
+
fontWidth: 88
|
|
133
|
+
},
|
|
134
|
+
"heading-compact-sm": {
|
|
135
|
+
font: {
|
|
136
|
+
fontFamily: "Open Sans",
|
|
137
|
+
fontWeight: 700,
|
|
138
|
+
fontSize: "14px",
|
|
139
|
+
fontStyle: "normal",
|
|
140
|
+
lineHeight: 1.15,
|
|
141
|
+
letterSpacing: "0px"
|
|
142
|
+
},
|
|
143
|
+
letterSpacing: "0px",
|
|
144
|
+
fontWidth: 88
|
|
145
|
+
},
|
|
146
|
+
"heading-compact-md": {
|
|
147
|
+
font: {
|
|
148
|
+
fontFamily: "Open Sans",
|
|
149
|
+
fontWeight: 700,
|
|
150
|
+
fontSize: "16px",
|
|
151
|
+
fontStyle: "normal",
|
|
152
|
+
lineHeight: 1.15,
|
|
153
|
+
letterSpacing: "-0.2px"
|
|
154
|
+
},
|
|
155
|
+
letterSpacing: "-0.2px",
|
|
156
|
+
fontWidth: 88
|
|
157
|
+
},
|
|
158
|
+
"heading-compact-lg": {
|
|
159
|
+
font: {
|
|
160
|
+
fontFamily: "Open Sans",
|
|
161
|
+
fontWeight: 700,
|
|
162
|
+
fontSize: "18px",
|
|
163
|
+
fontStyle: "normal",
|
|
164
|
+
lineHeight: 1.15,
|
|
165
|
+
letterSpacing: "-0.2px"
|
|
166
|
+
},
|
|
167
|
+
letterSpacing: "-0.2px",
|
|
168
|
+
fontWidth: 88
|
|
169
|
+
},
|
|
170
|
+
"heading-compact-xl": {
|
|
171
|
+
font: {
|
|
172
|
+
fontFamily: "Open Sans",
|
|
173
|
+
fontWeight: 700,
|
|
174
|
+
fontSize: "20px",
|
|
175
|
+
fontStyle: "normal",
|
|
176
|
+
lineHeight: 1.15,
|
|
177
|
+
letterSpacing: "-0.5px"
|
|
178
|
+
},
|
|
179
|
+
letterSpacing: "-0.5px",
|
|
180
|
+
fontWidth: 88
|
|
181
|
+
},
|
|
182
|
+
"heading-compact-2xl": {
|
|
183
|
+
font: {
|
|
184
|
+
fontFamily: "Open Sans",
|
|
185
|
+
fontWeight: 700,
|
|
186
|
+
fontSize: "24px",
|
|
187
|
+
fontStyle: "normal",
|
|
188
|
+
lineHeight: 1.15,
|
|
189
|
+
letterSpacing: "-0.5px"
|
|
190
|
+
},
|
|
191
|
+
letterSpacing: "-0.5px",
|
|
192
|
+
fontWidth: 88
|
|
193
|
+
},
|
|
194
|
+
"body-sm": {
|
|
195
|
+
font: {
|
|
196
|
+
fontFamily: "Open Sans",
|
|
197
|
+
fontWeight: 460,
|
|
198
|
+
fontSize: "14px",
|
|
199
|
+
fontStyle: "normal",
|
|
200
|
+
lineHeight: 1.3,
|
|
201
|
+
letterSpacing: "0px"
|
|
202
|
+
},
|
|
203
|
+
letterSpacing: "0px",
|
|
204
|
+
fontWidth: 95
|
|
205
|
+
},
|
|
206
|
+
"body-md": {
|
|
207
|
+
font: {
|
|
208
|
+
fontFamily: "Open Sans",
|
|
209
|
+
fontWeight: 460,
|
|
210
|
+
fontSize: "16px",
|
|
211
|
+
fontStyle: "normal",
|
|
212
|
+
lineHeight: 1.3,
|
|
213
|
+
letterSpacing: "0px"
|
|
214
|
+
},
|
|
215
|
+
letterSpacing: "0px",
|
|
216
|
+
fontWidth: 95
|
|
217
|
+
},
|
|
218
|
+
"body-lg": {
|
|
219
|
+
font: {
|
|
220
|
+
fontFamily: "Open Sans",
|
|
221
|
+
fontWeight: 460,
|
|
222
|
+
fontSize: "18px",
|
|
223
|
+
fontStyle: "normal",
|
|
224
|
+
lineHeight: 1.3,
|
|
225
|
+
letterSpacing: "0px"
|
|
226
|
+
},
|
|
227
|
+
letterSpacing: "0px",
|
|
228
|
+
fontWidth: 95
|
|
229
|
+
},
|
|
230
|
+
"body-xl": {
|
|
231
|
+
font: {
|
|
232
|
+
fontFamily: "Open Sans",
|
|
233
|
+
fontWeight: 460,
|
|
234
|
+
fontSize: "20px",
|
|
235
|
+
fontStyle: "normal",
|
|
236
|
+
lineHeight: 1.3,
|
|
237
|
+
letterSpacing: "0px"
|
|
238
|
+
},
|
|
239
|
+
letterSpacing: "0px",
|
|
240
|
+
fontWidth: 95
|
|
241
|
+
},
|
|
242
|
+
"body-italic-sm": {
|
|
243
|
+
font: {
|
|
244
|
+
fontFamily: "Open Sans",
|
|
245
|
+
fontWeight: 460,
|
|
246
|
+
fontSize: "14px",
|
|
247
|
+
fontStyle: "italic",
|
|
248
|
+
lineHeight: 1.3,
|
|
249
|
+
letterSpacing: "0px"
|
|
250
|
+
},
|
|
251
|
+
letterSpacing: "0px",
|
|
252
|
+
fontWidth: 95
|
|
253
|
+
},
|
|
254
|
+
"body-italic-md": {
|
|
255
|
+
font: {
|
|
256
|
+
fontFamily: "Open Sans",
|
|
257
|
+
fontWeight: 460,
|
|
258
|
+
fontSize: "16px",
|
|
259
|
+
fontStyle: "italic",
|
|
260
|
+
lineHeight: 1.3,
|
|
261
|
+
letterSpacing: "0px"
|
|
262
|
+
},
|
|
263
|
+
letterSpacing: "0px",
|
|
264
|
+
fontWidth: 95
|
|
265
|
+
},
|
|
266
|
+
"body-italic-lg": {
|
|
267
|
+
font: {
|
|
268
|
+
fontFamily: "Open Sans",
|
|
269
|
+
fontWeight: 460,
|
|
270
|
+
fontSize: "18px",
|
|
271
|
+
fontStyle: "italic",
|
|
272
|
+
lineHeight: 1.3,
|
|
273
|
+
letterSpacing: "0px"
|
|
274
|
+
},
|
|
275
|
+
letterSpacing: "0px",
|
|
276
|
+
fontWidth: 95
|
|
277
|
+
},
|
|
278
|
+
"body-italic-xl": {
|
|
279
|
+
font: {
|
|
280
|
+
fontFamily: "Open Sans",
|
|
281
|
+
fontWeight: 460,
|
|
282
|
+
fontSize: "20px",
|
|
283
|
+
fontStyle: "italic",
|
|
284
|
+
lineHeight: 1.3,
|
|
285
|
+
letterSpacing: "0px"
|
|
286
|
+
},
|
|
287
|
+
letterSpacing: "0px",
|
|
288
|
+
fontWidth: 95
|
|
289
|
+
},
|
|
290
|
+
"body-compact-sm": {
|
|
291
|
+
font: {
|
|
292
|
+
fontFamily: "Open Sans",
|
|
293
|
+
fontWeight: 460,
|
|
294
|
+
fontSize: "14px",
|
|
295
|
+
fontStyle: "normal",
|
|
296
|
+
lineHeight: 1.3,
|
|
297
|
+
letterSpacing: "0px"
|
|
298
|
+
},
|
|
299
|
+
letterSpacing: "0px",
|
|
300
|
+
fontWidth: 88
|
|
301
|
+
},
|
|
302
|
+
"body-compact-md": {
|
|
303
|
+
font: {
|
|
304
|
+
fontFamily: "Open Sans",
|
|
305
|
+
fontWeight: 460,
|
|
306
|
+
fontSize: "16px",
|
|
307
|
+
fontStyle: "normal",
|
|
308
|
+
lineHeight: 1.3,
|
|
309
|
+
letterSpacing: "0px"
|
|
310
|
+
},
|
|
311
|
+
letterSpacing: "0px",
|
|
312
|
+
fontWidth: 88
|
|
313
|
+
},
|
|
314
|
+
"body-compact-lg": {
|
|
315
|
+
font: {
|
|
316
|
+
fontFamily: "Open Sans",
|
|
317
|
+
fontWeight: 460,
|
|
318
|
+
fontSize: "18px",
|
|
319
|
+
fontStyle: "normal",
|
|
320
|
+
lineHeight: 1.3,
|
|
321
|
+
letterSpacing: "0px"
|
|
322
|
+
},
|
|
323
|
+
letterSpacing: "0px",
|
|
324
|
+
fontWidth: 88
|
|
325
|
+
},
|
|
326
|
+
"body-compact-xl": {
|
|
327
|
+
font: {
|
|
328
|
+
fontFamily: "Open Sans",
|
|
329
|
+
fontWeight: 460,
|
|
330
|
+
fontSize: "20px",
|
|
331
|
+
fontStyle: "normal",
|
|
332
|
+
lineHeight: 1.3,
|
|
333
|
+
letterSpacing: "0px"
|
|
334
|
+
},
|
|
335
|
+
letterSpacing: "0px",
|
|
336
|
+
fontWidth: 88
|
|
337
|
+
},
|
|
338
|
+
"body-compact-italic-sm": {
|
|
339
|
+
font: {
|
|
340
|
+
fontFamily: "Open Sans",
|
|
341
|
+
fontWeight: 460,
|
|
342
|
+
fontSize: "14px",
|
|
343
|
+
fontStyle: "italic",
|
|
344
|
+
lineHeight: 1.3,
|
|
345
|
+
letterSpacing: "0px"
|
|
346
|
+
},
|
|
347
|
+
letterSpacing: "0px",
|
|
348
|
+
fontWidth: 88
|
|
349
|
+
},
|
|
350
|
+
"body-compact-italic-md": {
|
|
351
|
+
font: {
|
|
352
|
+
fontFamily: "Open Sans",
|
|
353
|
+
fontWeight: 460,
|
|
354
|
+
fontSize: "16px",
|
|
355
|
+
fontStyle: "italic",
|
|
356
|
+
lineHeight: 1.3,
|
|
357
|
+
letterSpacing: "0px"
|
|
358
|
+
},
|
|
359
|
+
letterSpacing: "0px",
|
|
360
|
+
fontWidth: 88
|
|
361
|
+
},
|
|
362
|
+
"body-compact-italic-lg": {
|
|
363
|
+
font: {
|
|
364
|
+
fontFamily: "Open Sans",
|
|
365
|
+
fontWeight: 460,
|
|
366
|
+
fontSize: "18px",
|
|
367
|
+
fontStyle: "italic",
|
|
368
|
+
lineHeight: 1.3,
|
|
369
|
+
letterSpacing: "0px"
|
|
370
|
+
},
|
|
371
|
+
letterSpacing: "0px",
|
|
372
|
+
fontWidth: 88
|
|
373
|
+
},
|
|
374
|
+
"body-compact-italic-xl": {
|
|
375
|
+
font: {
|
|
376
|
+
fontFamily: "Open Sans",
|
|
377
|
+
fontWeight: 460,
|
|
378
|
+
fontSize: "20px",
|
|
379
|
+
fontStyle: "italic",
|
|
380
|
+
lineHeight: 1.3,
|
|
381
|
+
letterSpacing: "0px"
|
|
382
|
+
},
|
|
383
|
+
letterSpacing: "0px",
|
|
384
|
+
fontWidth: 88
|
|
385
|
+
},
|
|
386
|
+
"meta-md": {
|
|
387
|
+
font: {
|
|
388
|
+
fontFamily: "Open Sans",
|
|
389
|
+
fontWeight: 460,
|
|
390
|
+
fontSize: "12px",
|
|
391
|
+
fontStyle: "normal",
|
|
392
|
+
lineHeight: 1.3,
|
|
393
|
+
letterSpacing: "0px"
|
|
394
|
+
},
|
|
395
|
+
letterSpacing: "0px",
|
|
396
|
+
fontWidth: 95
|
|
397
|
+
},
|
|
398
|
+
"meta-compact-md": {
|
|
399
|
+
font: {
|
|
400
|
+
fontFamily: "Open Sans",
|
|
401
|
+
fontWeight: 460,
|
|
402
|
+
fontSize: "12px",
|
|
403
|
+
fontStyle: "normal",
|
|
404
|
+
lineHeight: 1.3,
|
|
405
|
+
letterSpacing: "0px"
|
|
406
|
+
},
|
|
407
|
+
letterSpacing: "0px",
|
|
408
|
+
fontWidth: 88
|
|
409
|
+
},
|
|
410
|
+
"article-body-md": {
|
|
411
|
+
font: {
|
|
412
|
+
fontFamily: "GuardianTextEgyptian",
|
|
413
|
+
fontWeight: 400,
|
|
414
|
+
fontSize: "16px",
|
|
415
|
+
fontStyle: "normal",
|
|
416
|
+
lineHeight: 1.4,
|
|
417
|
+
letterSpacing: "0px"
|
|
418
|
+
},
|
|
419
|
+
letterSpacing: "0px",
|
|
420
|
+
fontWidth: 100
|
|
421
|
+
},
|
|
422
|
+
"article-body-bold-md": {
|
|
423
|
+
font: {
|
|
424
|
+
fontFamily: "GuardianTextEgyptian",
|
|
425
|
+
fontWeight: 700,
|
|
426
|
+
fontSize: "16px",
|
|
427
|
+
fontStyle: "normal",
|
|
428
|
+
lineHeight: 1.4,
|
|
429
|
+
letterSpacing: "0px"
|
|
430
|
+
},
|
|
431
|
+
letterSpacing: "0px",
|
|
432
|
+
fontWidth: 100
|
|
433
|
+
},
|
|
434
|
+
"article-body-italic-md": {
|
|
435
|
+
font: {
|
|
436
|
+
fontFamily: "GuardianTextEgyptian",
|
|
437
|
+
fontWeight: 400,
|
|
438
|
+
fontSize: "16px",
|
|
439
|
+
fontStyle: "italic",
|
|
440
|
+
lineHeight: 1.4,
|
|
441
|
+
letterSpacing: "0px"
|
|
442
|
+
},
|
|
443
|
+
letterSpacing: "0px",
|
|
444
|
+
fontWidth: 100
|
|
445
|
+
},
|
|
446
|
+
"article-body-bold-italic-md": {
|
|
447
|
+
font: {
|
|
448
|
+
fontFamily: "GuardianTextEgyptian",
|
|
449
|
+
fontWeight: 700,
|
|
450
|
+
fontSize: "16px",
|
|
451
|
+
fontStyle: "italic",
|
|
452
|
+
lineHeight: 1.4,
|
|
453
|
+
letterSpacing: "0px"
|
|
454
|
+
},
|
|
455
|
+
letterSpacing: "0px",
|
|
456
|
+
fontWidth: 100
|
|
457
|
+
}
|
|
458
|
+
};
|
|
459
|
+
|
|
460
|
+
export { semanticTypography };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var react = require('@emotion/react');
|
|
4
|
+
|
|
5
|
+
const convertTypographyToEmotion = (typography) => {
|
|
6
|
+
return react.css`
|
|
7
|
+
font-family: ${typography.font.fontFamily};
|
|
8
|
+
font-weight: ${typography.font.fontWeight};
|
|
9
|
+
font-size: ${typography.font.fontSize};
|
|
10
|
+
font-style: ${typography.font.fontStyle};
|
|
11
|
+
line-height: ${typography.font.lineHeight};
|
|
12
|
+
letter-spacing: ${typography.letterSpacing};
|
|
13
|
+
font-variation-settings: \"wdth\" ${typography.fontWidth};
|
|
14
|
+
`;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
exports.convertTypographyToEmotion = convertTypographyToEmotion;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { css } from '@emotion/react';
|
|
2
|
+
|
|
3
|
+
const convertTypographyToEmotion = (typography) => {
|
|
4
|
+
return css`
|
|
5
|
+
font-family: ${typography.font.fontFamily};
|
|
6
|
+
font-weight: ${typography.font.fontWeight};
|
|
7
|
+
font-size: ${typography.font.fontSize};
|
|
8
|
+
font-style: ${typography.font.fontStyle};
|
|
9
|
+
line-height: ${typography.font.lineHeight};
|
|
10
|
+
letter-spacing: ${typography.letterSpacing};
|
|
11
|
+
font-variation-settings: \"wdth\" ${typography.fontWidth};
|
|
12
|
+
`;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export { convertTypographyToEmotion };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type { FocusEventHandler } from 'react';
|
|
2
|
+
import type { ComponentByline } from '../../styleD/build/typescript/component/byline';
|
|
3
|
+
import type { DeepPartial } from '../util';
|
|
4
|
+
import type { BylineModel, TaggedContributor } from './lib';
|
|
5
|
+
type BylineProps = {
|
|
6
|
+
/** `theme` - Used to customise the look and feel of the Byline component */
|
|
7
|
+
theme?: DeepPartial<ComponentByline>;
|
|
8
|
+
/** `allowUntaggedContributors` - Whether to allow untagged contributors in the byline */
|
|
9
|
+
allowUntaggedContributors?: boolean;
|
|
10
|
+
/** `contributorLimit` - Maximum number of tagged/untagged contributors allowed in the byline */
|
|
11
|
+
contributorLimit?: number;
|
|
12
|
+
/** `enablePreview` - Whether to show the byline preview below the editor */
|
|
13
|
+
enablePreview?: boolean;
|
|
14
|
+
/** `placeholder` - Placeholder text for the byline editor */
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
/** `initialValue` - Initial value for the byline editor */
|
|
17
|
+
initialValue?: BylineModel;
|
|
18
|
+
/** `readOnly` - Whether the byline editor is in read-only mode */
|
|
19
|
+
readOnly?: boolean;
|
|
20
|
+
/** `handleSave` - Callback function to handle saving the byline value */
|
|
21
|
+
handleSave: (newValue: BylineModel) => void;
|
|
22
|
+
/** `searchContributors` - Function to search for contributors based on selected text, results will appear on the dropdown */
|
|
23
|
+
searchContributors?: (selectedText: string) => Promise<TaggedContributor[]>;
|
|
24
|
+
/** `onBlur` - Optional blur event handler for the byline editor */
|
|
25
|
+
onBlur?: FocusEventHandler<HTMLDivElement>;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* ## Byline
|
|
29
|
+
*
|
|
30
|
+
* *Status: Production*
|
|
31
|
+
*
|
|
32
|
+
* A flexible byline editor component built in ProseMirror and React with usability and accessibility in mind.
|
|
33
|
+
*
|
|
34
|
+
* **Peer dependencies:**
|
|
35
|
+
*
|
|
36
|
+
* You'll need to install the following peer dependencies in your project to use the `Byline` component:
|
|
37
|
+
* - `@guardian/prosemirror-invisibles`
|
|
38
|
+
* - `prosemirror-dropcursor`
|
|
39
|
+
* - `prosemirror-history`
|
|
40
|
+
* - `prosemirror-keymap`
|
|
41
|
+
* - `prosemirror-model`
|
|
42
|
+
* - `prosemirror-state`
|
|
43
|
+
* - `prosemirror-view`
|
|
44
|
+
*
|
|
45
|
+
* See the `peerDependencies` section of `package.json` for compatible versions to install.
|
|
46
|
+
*
|
|
47
|
+
* #### Usage
|
|
48
|
+
*
|
|
49
|
+
* ```tsx
|
|
50
|
+
* import type { BylineModel } from '@guardian/stand';
|
|
51
|
+
* import { Byline } from '@guardian/stand';
|
|
52
|
+
*
|
|
53
|
+
* const Component = () => {
|
|
54
|
+
* const bylineModel: BylineModel = {
|
|
55
|
+
* // ...set up your byline model here
|
|
56
|
+
* };
|
|
57
|
+
* ...
|
|
58
|
+
* return (
|
|
59
|
+
* <>
|
|
60
|
+
* ...
|
|
61
|
+
* <Byline initialValue={bylineModel} />
|
|
62
|
+
* ...
|
|
63
|
+
* </>
|
|
64
|
+
* );
|
|
65
|
+
* };
|
|
66
|
+
* ```
|
|
67
|
+
*
|
|
68
|
+
* By itself the `Byline` component is just the editor UI.
|
|
69
|
+
* You will need to set up the ProseMirror editor state, schema, and plugins to get a fully functioning byline editor.
|
|
70
|
+
* See the props and example below for a more complete implementation.
|
|
71
|
+
* The `BylineModel` type defines the structure of the byline data which is agnostic from any other data structure. You must convert to/from this model when integrating with your application's data structures.
|
|
72
|
+
*
|
|
73
|
+
* #### Props
|
|
74
|
+
*
|
|
75
|
+
* See {@link BylineProps} for the full list of props, usage example can be seen in Storybook.
|
|
76
|
+
*
|
|
77
|
+
* #### Example
|
|
78
|
+
*
|
|
79
|
+
* The `ContentByline` component in `flexible-frontend` has a detailed example of how to use the `Byline` component from Stand.
|
|
80
|
+
* See [ContentByline.tsx](https://github.com/guardian/flexible-content/blob/1d537615a18ae24a4a5410a3f945b2b9db1dbb47/flexible-frontend/src/app/components/furniture/content-byline/ContentByline.tsx#L72-L205).
|
|
81
|
+
*/
|
|
82
|
+
export declare const Byline: ({ theme, allowUntaggedContributors, contributorLimit, enablePreview, placeholder, initialValue, readOnly, handleSave, searchContributors, onBlur, }: BylineProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
83
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { SerializedStyles } from '@emotion/react';
|
|
2
|
+
import type { Node } from 'prosemirror-model';
|
|
3
|
+
import { type ComponentByline } from '../../styleD/build/typescript/component/byline';
|
|
4
|
+
import type { DeepPartial } from '../util';
|
|
5
|
+
export declare const bylineContainerStyles: SerializedStyles;
|
|
6
|
+
export declare const bylineEditorStyles: (partialTheme?: DeepPartial<ComponentByline>) => SerializedStyles;
|
|
7
|
+
export declare const dropdownContainerStyles: (showDropdown: boolean, partialTheme?: DeepPartial<ComponentByline['dropdown']>) => SerializedStyles;
|
|
8
|
+
export declare const dropdownUlStyles: SerializedStyles;
|
|
9
|
+
export declare const dropdownLiStyles: (partialTheme?: DeepPartial<ComponentByline['dropdown']>) => SerializedStyles;
|
|
10
|
+
export declare const selectedDropdownLiStyles: (partialTheme?: DeepPartial<ComponentByline['dropdown']>) => SerializedStyles;
|
|
11
|
+
export declare const previewStyles: SerializedStyles;
|
|
12
|
+
export declare const previewFreeTextStyles: SerializedStyles;
|
|
13
|
+
export declare const previewContributorStyles: (node: Node) => SerializedStyles;
|