astro-tractstack 2.0.19 → 2.0.20

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 (55) hide show
  1. package/dist/index.js +6 -32
  2. package/package.json +1 -1
  3. package/templates/src/components/codehooks/BunnyVideoSetup.tsx +1 -4
  4. package/templates/src/components/codehooks/FeaturedArticleSetup.tsx +0 -4
  5. package/templates/src/components/codehooks/ListContentSetup.tsx +1 -8
  6. package/templates/src/components/codehooks/ProductCardSetup.tsx +0 -2
  7. package/templates/src/components/codehooks/ProductGridSetup.tsx +0 -2
  8. package/templates/src/components/compositor/Compositor.tsx +3 -6
  9. package/templates/src/components/compositor/Node.tsx +13 -32
  10. package/templates/src/components/compositor/NodeWithGuid.tsx +49 -5
  11. package/templates/src/components/compositor/nodes/Pane.tsx +4 -21
  12. package/templates/src/components/compositor/nodes/Pane_DesignLibrary.tsx +27 -7
  13. package/templates/src/components/compositor/nodes/tagElements/NodeBasicTag.tsx +3 -1
  14. package/templates/src/components/compositor/preview/OgImagePreview.tsx +0 -5
  15. package/templates/src/components/compositor/preview/PaneSnapshotGenerator.tsx +5 -6
  16. package/templates/src/components/compositor/preview/PanesPreviewGenerator.tsx +1 -0
  17. package/templates/src/components/edit/PanelSwitch.tsx +3 -24
  18. package/templates/src/components/edit/SettingsPanel.tsx +0 -1
  19. package/templates/src/components/edit/ToolMode.tsx +6 -14
  20. package/templates/src/components/edit/pane/AddPanePanel.tsx +45 -25
  21. package/templates/src/components/edit/pane/AddPanePanel_new.tsx +2 -8
  22. package/templates/src/components/edit/pane/AddPanePanel_paste.tsx +111 -0
  23. package/templates/src/components/edit/pane/RestylePaneModal.tsx +6 -13
  24. package/templates/src/components/edit/pane/steps/AiDesignStep.tsx +0 -5
  25. package/templates/src/components/edit/pane/steps/DesignLibraryStep.tsx +4 -11
  26. package/templates/src/components/edit/panels/StyleBreakPanel.tsx +1 -3
  27. package/templates/src/components/edit/panels/StyleElementPanel_update.tsx +0 -6
  28. package/templates/src/components/edit/panels/StyleImagePanel_update.tsx +0 -3
  29. package/templates/src/components/edit/panels/StyleLiElementPanel_update.tsx +0 -4
  30. package/templates/src/components/edit/panels/StyleLinkPanel_config.tsx +8 -5
  31. package/templates/src/components/edit/panels/StyleLinkPanel_update.tsx +1 -2
  32. package/templates/src/components/edit/panels/StyleParentPanel.tsx +1 -3
  33. package/templates/src/components/edit/panels/StyleParentPanel_update.tsx +2 -5
  34. package/templates/src/components/edit/panels/StyleWidgetPanel_config.tsx +2 -8
  35. package/templates/src/components/edit/panels/StyleWidgetPanel_update.tsx +0 -4
  36. package/templates/src/components/edit/state/SaveToLibraryModal.tsx +27 -16
  37. package/templates/src/components/edit/storyfragment/StoryFragmentConfigPanel.tsx +9 -26
  38. package/templates/src/components/edit/storyfragment/StoryFragmentPanel_og.tsx +7 -16
  39. package/templates/src/components/edit/storyfragment/StoryFragmentPanel_slug.tsx +5 -6
  40. package/templates/src/components/edit/widgets/InteractiveDisclosureWidget.tsx +0 -5
  41. package/templates/src/components/fields/BackgroundImageWrapper.tsx +1 -7
  42. package/templates/src/components/fields/ColorPickerCombo.tsx +8 -12
  43. package/templates/src/components/fields/ViewportComboBox.tsx +4 -6
  44. package/templates/src/stores/nodes.ts +14 -6
  45. package/templates/src/stores/storykeep.ts +3 -3
  46. package/templates/src/types/compositorTypes.ts +2 -0
  47. package/templates/src/utils/compositor/TemplatePanes.ts +0 -76
  48. package/templates/src/utils/compositor/aiPaneParser.ts +3 -1
  49. package/templates/src/utils/compositor/designLibraryHelper.ts +240 -17
  50. package/templates/src/utils/helpers.ts +5 -4
  51. package/utils/inject-files.ts +6 -32
  52. package/templates/src/components/compositor/preview/VisualBreakPreview.tsx +0 -154
  53. package/templates/src/components/edit/pane/PageGen_preview.tsx +0 -511
  54. package/templates/src/utils/compositor/processMarkdown.ts +0 -445
  55. package/templates/src/utils/compositor/templateMarkdownStyles.ts +0 -1273
@@ -1,1273 +0,0 @@
1
- import { ulid } from 'ulid';
2
- import { getColor, tailwindToHex } from './tailwindColors';
3
- import type { Theme } from '@/types/tractstack';
4
- import type {
5
- ArtpackImageNode,
6
- TemplatePane,
7
- ParentClassesPayload,
8
- } from '@/types/compositorTypes';
9
-
10
- const defaultMarkdownBody = `### tell us what happened\n\nyour story continues... and continues... and continues... and continues... and continues... and continues... with nice layout and typography.\n\n#### Add in those important details\n\nWrite for both the humans and for the search engine rankings!\n\nCapture attention and make moves.`;
11
- const defaultSectionBody = `### An incredible journey awaits... An incredible journey awaits... An incredible journey awaits...`;
12
- const defaultIntroBody = `## An incredible journey awaits\n\nAn incredible journey awaits... An incredible journey awaits...`;
13
- const defaultImageHeroBody = `1. ## An incredible journey awaits\n\n* ![Placeholder image](/static.jpg)\n`;
14
-
15
- export const templateCategories = [
16
- {
17
- id: 'all',
18
- title: 'All designs',
19
- getTemplates: (theme: Theme, brand: string, useOdd: boolean) => [
20
- ...templateCategories[1].getTemplates(theme, brand, useOdd),
21
- ...templateCategories[2].getTemplates(theme, brand, useOdd),
22
- ...templateCategories[3].getTemplates(theme, brand, useOdd),
23
- ...templateCategories[4].getTemplates(theme, brand, useOdd),
24
- ],
25
- },
26
- {
27
- id: 'paragraph',
28
- title: 'Tell your story',
29
- getTemplates: (theme: Theme, brand: string, useOdd: boolean) => [
30
- getJustCopyDesign(theme, brand, useOdd, false, `default`),
31
- getJustCopyDesign(theme, brand, useOdd, true, `default`),
32
- getJustCopyDesign(theme, brand, useOdd, false, `onecol`),
33
- getJustCopyDesign(theme, brand, useOdd, true, `onecol`),
34
- getJustCopyDesign(theme, brand, useOdd, false, `center`),
35
- getJustCopyDesign(theme, brand, useOdd, true, `center`),
36
- ],
37
- },
38
- {
39
- id: 'intro',
40
- title: 'Page Intro sections',
41
- getTemplates: (theme: Theme, brand: string, useOdd: boolean) => [
42
- getIntroDesign(theme, brand, useOdd, false, `default`),
43
- getIntroDesign(theme, brand, useOdd, true, `default`),
44
- getIntroDesign(theme, brand, useOdd, false, `onecol`),
45
- getIntroDesign(theme, brand, useOdd, true, `onecol`),
46
- getIntroDesign(theme, brand, useOdd, false, `center`),
47
- getIntroDesign(theme, brand, useOdd, true, `center`),
48
- ],
49
- },
50
- {
51
- id: 'section',
52
- title: 'Sub-title sections',
53
- getTemplates: (theme: Theme, brand: string, useOdd: boolean) => [
54
- getSubTitleDesign(theme, brand, useOdd, false, `default`),
55
- getSubTitleDesign(theme, brand, useOdd, true, `default`),
56
- getSubTitleDesign(theme, brand, useOdd, false, `onecol`),
57
- getSubTitleDesign(theme, brand, useOdd, true, `onecol`),
58
- getSubTitleDesign(theme, brand, useOdd, false, `center`),
59
- getSubTitleDesign(theme, brand, useOdd, true, `center`),
60
- getSubTitleDesign(theme, brand, useOdd, false, `default-brand`),
61
- getSubTitleDesign(theme, brand, useOdd, false, `onecol-brand`),
62
- getSubTitleDesign(theme, brand, useOdd, false, `center-brand`),
63
- ],
64
- },
65
- {
66
- id: 'with-background',
67
- title: 'With Background Image',
68
- getTemplates: (theme: Theme, brand: string, useOdd: boolean) => [
69
- getWithArtpackImageDesign(
70
- getSubTitleDesign,
71
- theme,
72
- brand,
73
- useOdd,
74
- 't8k',
75
- 'blast',
76
- 'cover',
77
- true,
78
- 'default'
79
- ),
80
- getWithArtpackImageDesign(
81
- getSubTitleDesign,
82
- theme,
83
- brand,
84
- useOdd,
85
- 't8k',
86
- 'blast',
87
- 'cover',
88
- true,
89
- 'onecol'
90
- ),
91
- getWithArtpackImageDesign(
92
- getSubTitleDesign,
93
- theme,
94
- brand,
95
- useOdd,
96
- 't8k',
97
- 'blast',
98
- 'cover',
99
- true,
100
- 'center'
101
- ),
102
- getWithArtpackImageDesign(
103
- getIntroDesign,
104
- theme,
105
- brand,
106
- useOdd,
107
- 't8k',
108
- 'blast',
109
- 'cover',
110
- true,
111
- 'default'
112
- ),
113
- getWithArtpackImageDesign(
114
- getIntroDesign,
115
- theme,
116
- brand,
117
- useOdd,
118
- 't8k',
119
- 'blast',
120
- 'cover',
121
- true,
122
- 'onecol'
123
- ),
124
- getWithArtpackImageDesign(
125
- getIntroDesign,
126
- theme,
127
- brand,
128
- useOdd,
129
- 't8k',
130
- 'blast',
131
- 'cover',
132
- true,
133
- 'center'
134
- ),
135
- ],
136
- },
137
- //{
138
- // id: "image-hero",
139
- // title: "Image Hero Section",
140
- // getTemplates: (theme: Theme, brand: string, useOdd: boolean) => [
141
- // getImageHeroSectionDefault(theme, brand, useOdd),
142
- // getImageHeroSectionDefault(theme, brand, useOdd, true),
143
- // ],
144
- //},
145
- ] as const;
146
-
147
- export function getWithArtpackImageDesign(
148
- designFn: (
149
- theme: Theme,
150
- brand: string,
151
- useOdd: boolean,
152
- bordered?: boolean,
153
- variant?: string
154
- ) => TemplatePane,
155
- theme: Theme,
156
- brand: string,
157
- useOdd: boolean,
158
- collection: string = 't8k',
159
- imageName: string = 'blast',
160
- objectFit: 'cover' | 'contain' | 'fill' = 'cover',
161
- bordered: boolean = true,
162
- variant: string = 'default'
163
- ): TemplatePane {
164
- const baseTemplate = designFn(theme, brand, useOdd, bordered, variant);
165
-
166
- const artpackNode: ArtpackImageNode = {
167
- nodeType: 'BgPane',
168
- id: '',
169
- parentId: '',
170
- type: 'artpack-image',
171
- collection,
172
- image: imageName,
173
- src: `/artpacks/${collection}/${imageName}_1920px.webp`,
174
- srcSet: `/artpacks/${collection}/${imageName}_1920px.webp 1920w, /artpacks/${collection}/${imageName}_1080px.webp 1080w, /artpacks/${collection}/${imageName}_600px.webp 600w`,
175
- alt: `Artpack image from ${collection} collection`,
176
- objectFit,
177
- };
178
-
179
- baseTemplate.title = `${baseTemplate.title} with artpack background`;
180
- baseTemplate.slug = `${baseTemplate.slug}-artpack`;
181
-
182
- if (baseTemplate.markdown?.parentClasses) {
183
- baseTemplate.markdown.parentClasses.forEach((classSet) => {
184
- if (classSet.mobile.bgCOLOR === 'mywhite') {
185
- classSet.mobile.bgCOLOR = 'transparent';
186
- }
187
- });
188
- }
189
-
190
- return {
191
- ...baseTemplate,
192
- bgPane: artpackNode,
193
- };
194
- }
195
-
196
- const getBaseParagraphClasses = (theme: Theme) => ({
197
- h2: {
198
- mobile: {
199
- fontWEIGHT: 'bold',
200
- textCOLOR: getColor(
201
- {
202
- light: 'brand-7',
203
- 'light-bw': 'brand-1',
204
- 'light-bold': 'brand-5',
205
- dark: 'brand-4',
206
- 'dark-bw': 'brand-8',
207
- 'dark-bold': 'brand-3',
208
- },
209
- theme
210
- ),
211
- textSIZE: '3xl',
212
- lineHEIGHT: 'snug',
213
- fontFACE: 'action',
214
- pt: '6',
215
- pb: '2.5',
216
- },
217
- tablet: {
218
- textSIZE: '5xl',
219
- pt: '9',
220
- pb: '3.5',
221
- },
222
- desktop: {
223
- textSIZE: '6xl',
224
- pt: '12',
225
- },
226
- },
227
- h3: {
228
- mobile: {
229
- fontWEIGHT: 'bold',
230
- textCOLOR: getColor(
231
- {
232
- light: 'brand-7',
233
- 'light-bw': 'brand-1',
234
- 'light-bold': 'brand-5',
235
- dark: 'brand-4',
236
- 'dark-bw': 'white',
237
- 'dark-bold': 'brand-3',
238
- },
239
- theme
240
- ),
241
- textSIZE: 'xl',
242
- fontFACE: 'action',
243
- pt: '6',
244
- pb: '2.5',
245
- },
246
- tablet: {
247
- textSIZE: '3xl',
248
- pt: '9',
249
- pb: '3.5',
250
- },
251
- desktop: {
252
- pt: '12',
253
- },
254
- },
255
- h4: {
256
- mobile: {
257
- textCOLOR: getColor(
258
- {
259
- light: 'brand-7',
260
- 'light-bw': 'brand-1',
261
- 'light-bold': 'brand-5',
262
- dark: 'brand-4',
263
- 'dark-bw': 'white',
264
- 'dark-bold': 'brand-3',
265
- },
266
- theme
267
- ),
268
- textSIZE: 'xl',
269
- fontFACE: 'action',
270
- pt: '4',
271
- },
272
- tablet: {
273
- textSIZE: '2xl',
274
- pt: '6',
275
- },
276
- desktop: {},
277
- },
278
- p: {
279
- mobile: {
280
- textCOLOR: getColor(
281
- {
282
- light: 'brand-7',
283
- 'light-bw': 'brand-1',
284
- 'light-bold': 'brand-7',
285
- dark: 'brand-8',
286
- 'dark-bw': 'brand-2',
287
- 'dark-bold': 'brand-8',
288
- },
289
- theme
290
- ),
291
- textSIZE: 'lg',
292
- lineHEIGHT: 'loose',
293
- py: '1.5',
294
- },
295
- tablet: {
296
- textSIZE: 'xl',
297
- py: '2.5',
298
- },
299
- desktop: {},
300
- },
301
- });
302
-
303
- const getBaseParentClasses = (): ParentClassesPayload => {
304
- return [
305
- {
306
- mobile: {
307
- mx: '5',
308
- my: '16',
309
- },
310
- tablet: {
311
- mx: '10',
312
- },
313
- desktop: {},
314
- },
315
- {
316
- mobile: {
317
- mx: 'auto',
318
- maxW: 'none',
319
- },
320
- tablet: {
321
- maxW: 'screen-lg',
322
- },
323
- desktop: {
324
- maxW: 'screen-xl',
325
- },
326
- },
327
- {
328
- mobile: {
329
- px: '9',
330
- py: '10',
331
- },
332
- tablet: {
333
- px: '14',
334
- },
335
- desktop: {
336
- px: '32',
337
- },
338
- },
339
- ];
340
- };
341
-
342
- export function getJustCopyDesign(
343
- theme: Theme,
344
- brand: string,
345
- useOdd: boolean,
346
- bordered: boolean = false,
347
- variant: string = `default`
348
- ): TemplatePane {
349
- let title = '';
350
- let slug = '';
351
- const baseClasses = getBaseParentClasses();
352
- switch (variant) {
353
- case `onecol`: {
354
- title = !bordered
355
- ? 'Copy goes here - one column'
356
- : 'Copy goes here with border - one column';
357
- slug = !bordered ? 'paragraph-onecol' : 'paragraph-onecol-bordered';
358
- baseClasses[2].mobile.textALIGN = 'left';
359
- baseClasses[2].mobile.textWRAP = 'pretty';
360
- baseClasses[2].mobile.maxW = '3xl';
361
- if (bordered) {
362
- baseClasses[2].mobile.rounded = 'lg';
363
- baseClasses[2].mobile.shadow = 'md';
364
- baseClasses[2].mobile.bgCOLOR = getColor(
365
- {
366
- light: useOdd ? 'brand-2' : 'white',
367
- 'light-bw': useOdd ? 'white' : 'brand-2',
368
- 'light-bold': useOdd ? 'brand-2' : 'white',
369
- dark: useOdd ? 'black' : 'brand-1',
370
- 'dark-bw': useOdd ? 'black' : 'brand-1',
371
- 'dark-bold': useOdd ? 'brand-1' : 'black',
372
- },
373
- theme
374
- );
375
- }
376
- break;
377
- }
378
-
379
- case `center`: {
380
- title = !bordered
381
- ? 'Copy goes here - centered'
382
- : 'Copy goes here with border - centered';
383
- slug = !bordered ? 'paragraph-centered' : 'paragraph-centered-bordered';
384
- baseClasses[2].mobile.textALIGN = 'center';
385
- baseClasses[2].mobile.textWRAP = 'balance';
386
- if (bordered) {
387
- baseClasses[2].mobile.rounded = 'lg';
388
- baseClasses[2].mobile.shadow = 'md';
389
- baseClasses[2].mobile.bgCOLOR = getColor(
390
- {
391
- light: useOdd ? 'brand-2' : 'white',
392
- 'light-bw': useOdd ? 'white' : 'brand-2',
393
- 'light-bold': useOdd ? 'brand-2' : 'white',
394
- dark: useOdd ? 'black' : 'brand-1',
395
- 'dark-bw': useOdd ? 'black' : 'brand-1',
396
- 'dark-bold': useOdd ? 'brand-1' : 'black',
397
- },
398
- theme
399
- );
400
- }
401
- break;
402
- }
403
-
404
- default: {
405
- title = !bordered ? 'Copy goes here' : 'Copy goes here with border';
406
- slug = !bordered ? 'paragraph-default' : 'paragraph-default-bordered';
407
- baseClasses[2].mobile.textALIGN = 'left';
408
- baseClasses[2].mobile.textWRAP = 'pretty';
409
- if (bordered) {
410
- baseClasses[2].mobile.rounded = 'lg';
411
- baseClasses[2].mobile.shadow = 'md';
412
- baseClasses[2].mobile.bgCOLOR = getColor(
413
- {
414
- light: useOdd ? 'brand-2' : 'white',
415
- 'light-bw': useOdd ? 'white' : 'brand-2',
416
- 'light-bold': useOdd ? 'brand-2' : 'white',
417
- dark: useOdd ? 'black' : 'brand-1',
418
- 'dark-bw': useOdd ? 'black' : 'brand-1',
419
- 'dark-bold': useOdd ? 'brand-1' : 'black',
420
- },
421
- theme
422
- );
423
- }
424
- }
425
- }
426
-
427
- return {
428
- nodeType: 'Pane',
429
- title,
430
- slug,
431
- id: '',
432
- parentId: '',
433
- isDecorative: false,
434
- bgColour: tailwindToHex(
435
- getColor(
436
- {
437
- light: !useOdd ? 'brand-2' : 'white',
438
- 'light-bw': !useOdd ? 'white' : 'brand-2',
439
- 'light-bold': !useOdd ? 'brand-2' : 'white',
440
- dark: !useOdd ? 'black' : 'brand-1',
441
- 'dark-bw': !useOdd ? 'black' : 'brand-1',
442
- 'dark-bold': !useOdd ? 'brand-1' : 'black',
443
- },
444
- theme
445
- ),
446
- brand
447
- ),
448
- markdown: {
449
- nodeType: 'Markdown',
450
- id: '',
451
- parentId: '',
452
- type: 'markdown',
453
- markdownId: ulid(),
454
- defaultClasses: getBaseParagraphClasses(theme),
455
- parentClasses: baseClasses,
456
- markdownBody: defaultMarkdownBody,
457
- },
458
- };
459
- }
460
-
461
- export function getSubTitleDesign(
462
- theme: Theme,
463
- brand: string,
464
- useOdd: boolean,
465
- bordered: boolean = false,
466
- variant: string = `default`
467
- ): TemplatePane {
468
- const baseClasses = getBaseParentClasses();
469
- let title = '';
470
- let slug = '';
471
- let bgColour = '';
472
- let textCOLOR = '';
473
-
474
- switch (variant) {
475
- case `onecol`: {
476
- title = !bordered
477
- ? 'Title section One Column'
478
- : 'Title section one column with border';
479
- slug = !bordered ? 'section-onecol' : 'section-onecol-bordered';
480
- textCOLOR = getColor(
481
- {
482
- light: 'black',
483
- 'light-bw': 'black',
484
- 'light-bold': 'brand-5',
485
- dark: 'brand-4',
486
- 'dark-bw': 'brand-8',
487
- 'dark-bold': 'brand-3',
488
- },
489
- theme
490
- );
491
- bgColour = tailwindToHex(
492
- getColor(
493
- {
494
- light: !useOdd ? 'brand-2' : 'white',
495
- 'light-bw': !useOdd ? 'white' : 'brand-2',
496
- 'light-bold': !useOdd ? 'brand-2' : 'white',
497
- dark: !useOdd ? 'black' : 'brand-1',
498
- 'dark-bw': !useOdd ? 'black' : 'brand-1',
499
- 'dark-bold': !useOdd ? 'brand-1' : 'black',
500
- },
501
- theme
502
- ),
503
- brand
504
- );
505
- baseClasses[2].mobile.textALIGN = 'left';
506
- baseClasses[2].mobile.textWRAP = 'pretty';
507
- baseClasses[2].mobile.maxW = '3xl';
508
- if (bordered) {
509
- baseClasses[2].mobile.rounded = 'lg';
510
- baseClasses[2].mobile.shadow = 'md';
511
- baseClasses[2].mobile.bgCOLOR = getColor(
512
- {
513
- light: useOdd ? 'brand-2' : 'white',
514
- 'light-bw': useOdd ? 'white' : 'brand-2',
515
- 'light-bold': useOdd ? 'brand-2' : 'white',
516
- dark: useOdd ? 'black' : 'brand-1',
517
- 'dark-bw': useOdd ? 'black' : 'brand-1',
518
- 'dark-bold': useOdd ? 'brand-1' : 'black',
519
- },
520
- theme
521
- );
522
- }
523
- break;
524
- }
525
-
526
- case `center`: {
527
- title = !bordered
528
- ? 'Title section centered'
529
- : 'Title section centered with border';
530
- slug = !bordered ? 'section-center' : 'section-center-bordered';
531
- textCOLOR = getColor(
532
- {
533
- light: 'black',
534
- 'light-bw': 'black',
535
- 'light-bold': 'brand-5',
536
- dark: 'brand-4',
537
- 'dark-bw': 'brand-8',
538
- 'dark-bold': 'brand-3',
539
- },
540
- theme
541
- );
542
- bgColour = tailwindToHex(
543
- getColor(
544
- {
545
- light: !useOdd ? 'brand-2' : 'white',
546
- 'light-bw': !useOdd ? 'white' : 'brand-2',
547
- 'light-bold': !useOdd ? 'brand-2' : 'white',
548
- dark: !useOdd ? 'black' : 'brand-1',
549
- 'dark-bw': !useOdd ? 'black' : 'brand-1',
550
- 'dark-bold': !useOdd ? 'brand-1' : 'black',
551
- },
552
- theme
553
- ),
554
- brand
555
- );
556
- baseClasses[2].mobile.textALIGN = 'center';
557
- baseClasses[2].mobile.textWRAP = 'balance';
558
- if (bordered) {
559
- baseClasses[2].mobile.rounded = 'lg';
560
- baseClasses[2].mobile.shadow = 'md';
561
- baseClasses[2].mobile.bgCOLOR = getColor(
562
- {
563
- light: useOdd ? 'brand-2' : 'white',
564
- 'light-bw': useOdd ? 'white' : 'brand-2',
565
- 'light-bold': useOdd ? 'brand-2' : 'white',
566
- dark: useOdd ? 'black' : 'brand-1',
567
- 'dark-bw': useOdd ? 'black' : 'brand-1',
568
- 'dark-bold': useOdd ? 'brand-1' : 'black',
569
- },
570
- theme
571
- );
572
- }
573
- break;
574
- }
575
-
576
- case `onecol-brand`: {
577
- (title = 'Title section v2 one column'),
578
- (slug = 'section-onecol-brand'),
579
- (textCOLOR = getColor(
580
- {
581
- light: 'black',
582
- 'light-bw': 'black',
583
- 'light-bold': 'black',
584
- dark: 'black',
585
- 'dark-bw': 'black',
586
- 'dark-bold': 'black',
587
- },
588
- theme
589
- ));
590
- bgColour = tailwindToHex(
591
- getColor(
592
- {
593
- light: !useOdd ? 'brand-3' : 'brand-4',
594
- 'light-bw': !useOdd ? 'brand-3' : 'brand-4',
595
- 'light-bold': !useOdd ? 'brand-3' : 'brand-4',
596
- dark: !useOdd ? 'brand-3' : 'brand-4',
597
- 'dark-bw': !useOdd ? 'brand-3' : 'brand-4',
598
- 'dark-bold': !useOdd ? 'brand-3' : 'brand-4',
599
- },
600
- theme
601
- ),
602
- brand
603
- );
604
- baseClasses[2].mobile.textALIGN = 'left';
605
- baseClasses[2].mobile.textWRAP = 'pretty';
606
- baseClasses[2].mobile.maxW = '3xl';
607
- if (bordered) {
608
- baseClasses[2].mobile.shadow = 'md';
609
- baseClasses[2].mobile.bgCOLOR = getColor(
610
- {
611
- light: useOdd ? 'brand-2' : 'white',
612
- 'light-bw': useOdd ? 'white' : 'brand-2',
613
- 'light-bold': useOdd ? 'brand-2' : 'white',
614
- dark: useOdd ? 'black' : 'brand-1',
615
- 'dark-bw': useOdd ? 'black' : 'brand-1',
616
- 'dark-bold': useOdd ? 'brand-1' : 'black',
617
- },
618
- theme
619
- );
620
- }
621
- break;
622
- }
623
-
624
- case `center-brand`: {
625
- (title = 'Title section v2 centered'),
626
- (slug = 'section-center-brand'),
627
- (textCOLOR = getColor(
628
- {
629
- light: 'black',
630
- 'light-bw': 'black',
631
- 'light-bold': 'black',
632
- dark: 'black',
633
- 'dark-bw': 'black',
634
- 'dark-bold': 'black',
635
- },
636
- theme
637
- ));
638
- bgColour = tailwindToHex(
639
- getColor(
640
- {
641
- light: !useOdd ? 'brand-3' : 'brand-4',
642
- 'light-bw': !useOdd ? 'brand-3' : 'brand-4',
643
- 'light-bold': !useOdd ? 'brand-3' : 'brand-4',
644
- dark: !useOdd ? 'brand-3' : 'brand-4',
645
- 'dark-bw': !useOdd ? 'brand-3' : 'brand-4',
646
- 'dark-bold': !useOdd ? 'brand-3' : 'brand-4',
647
- },
648
- theme
649
- ),
650
- brand
651
- );
652
- baseClasses[2].mobile.textALIGN = 'center';
653
- baseClasses[2].mobile.textWRAP = 'balance';
654
- if (bordered) {
655
- baseClasses[2].mobile.rounded = 'lg';
656
- baseClasses[2].mobile.shadow = 'md';
657
- baseClasses[2].mobile.bgCOLOR = getColor(
658
- {
659
- light: useOdd ? 'brand-2' : 'white',
660
- 'light-bw': useOdd ? 'white' : 'brand-2',
661
- 'light-bold': useOdd ? 'brand-2' : 'white',
662
- dark: useOdd ? 'black' : 'brand-1',
663
- 'dark-bw': useOdd ? 'black' : 'brand-1',
664
- 'dark-bold': useOdd ? 'brand-1' : 'black',
665
- },
666
- theme
667
- );
668
- }
669
- break;
670
- }
671
-
672
- case `default-brand`: {
673
- (title = 'Title section v2'),
674
- (slug = 'section-default-brand'),
675
- (textCOLOR = getColor(
676
- {
677
- light: 'black',
678
- 'light-bw': 'black',
679
- 'light-bold': 'black',
680
- dark: 'black',
681
- 'dark-bw': 'black',
682
- 'dark-bold': 'black',
683
- },
684
- theme
685
- ));
686
- bgColour = tailwindToHex(
687
- getColor(
688
- {
689
- light: !useOdd ? 'brand-3' : 'brand-4',
690
- 'light-bw': !useOdd ? 'brand-3' : 'brand-4',
691
- 'light-bold': !useOdd ? 'brand-3' : 'brand-4',
692
- dark: !useOdd ? 'brand-3' : 'brand-4',
693
- 'dark-bw': !useOdd ? 'brand-3' : 'brand-4',
694
- 'dark-bold': !useOdd ? 'brand-3' : 'brand-4',
695
- },
696
- theme
697
- ),
698
- brand
699
- );
700
- baseClasses[2].mobile.textALIGN = 'left';
701
- baseClasses[2].mobile.textWRAP = 'pretty';
702
- if (bordered) {
703
- baseClasses[2].mobile.shadow = 'md';
704
- baseClasses[2].mobile.bgCOLOR = getColor(
705
- {
706
- light: useOdd ? 'brand-2' : 'white',
707
- 'light-bw': useOdd ? 'white' : 'brand-2',
708
- 'light-bold': useOdd ? 'brand-2' : 'white',
709
- dark: useOdd ? 'black' : 'brand-1',
710
- 'dark-bw': useOdd ? 'black' : 'brand-1',
711
- 'dark-bold': useOdd ? 'brand-1' : 'black',
712
- },
713
- theme
714
- );
715
- }
716
- break;
717
- }
718
-
719
- default: {
720
- title = !bordered ? 'Title section' : 'Title section with border';
721
- slug = !bordered ? 'section-default' : 'section-default-bordered';
722
- textCOLOR = getColor(
723
- {
724
- light: 'black',
725
- 'light-bw': 'black',
726
- 'light-bold': 'brand-5',
727
- dark: 'brand-4',
728
- 'dark-bw': 'brand-8',
729
- 'dark-bold': 'brand-3',
730
- },
731
- theme
732
- );
733
- bgColour = tailwindToHex(
734
- getColor(
735
- {
736
- light: !useOdd ? 'brand-2' : 'white',
737
- 'light-bw': !useOdd ? 'white' : 'brand-2',
738
- 'light-bold': !useOdd ? 'brand-2' : 'white',
739
- dark: !useOdd ? 'black' : 'brand-1',
740
- 'dark-bw': !useOdd ? 'black' : 'brand-1',
741
- 'dark-bold': !useOdd ? 'brand-1' : 'black',
742
- },
743
- theme
744
- ),
745
- brand
746
- );
747
- baseClasses[2].mobile.textALIGN = 'left';
748
- baseClasses[2].mobile.textWRAP = 'pretty';
749
- if (bordered) {
750
- baseClasses[2].mobile.rounded = 'lg';
751
- baseClasses[2].mobile.shadow = 'md';
752
- baseClasses[2].mobile.bgCOLOR = getColor(
753
- {
754
- light: useOdd ? 'brand-2' : 'white',
755
- 'light-bw': useOdd ? 'white' : 'brand-2',
756
- 'light-bold': useOdd ? 'brand-2' : 'white',
757
- dark: useOdd ? 'black' : 'brand-1',
758
- 'dark-bw': useOdd ? 'black' : 'brand-1',
759
- 'dark-bold': useOdd ? 'brand-1' : 'black',
760
- },
761
- theme
762
- );
763
- }
764
- }
765
- }
766
-
767
- return {
768
- nodeType: 'Pane',
769
- id: '',
770
- parentId: '',
771
- isDecorative: false,
772
- title,
773
- slug,
774
- bgColour,
775
- markdown: {
776
- nodeType: 'Markdown',
777
- id: '',
778
- parentId: '',
779
- type: 'markdown',
780
- markdownId: ulid(),
781
- defaultClasses: {
782
- h2: {
783
- mobile: {
784
- fontWEIGHT: 'bold',
785
- textCOLOR,
786
- textSIZE: '3xl',
787
- fontFACE: 'action',
788
- },
789
- tablet: {
790
- textSIZE: '5xl',
791
- },
792
- desktop: {
793
- textSIZE: '6xl',
794
- },
795
- },
796
- h3: {
797
- mobile: {
798
- fontWEIGHT: 'bold',
799
- textCOLOR,
800
- textSIZE: '2xl',
801
- fontFACE: 'action',
802
- },
803
- tablet: {
804
- textSIZE: '3xl',
805
- },
806
- desktop: {},
807
- },
808
- h4: {
809
- mobile: {
810
- textCOLOR,
811
- textSIZE: 'xl',
812
- fontFACE: 'action',
813
- pt: '4',
814
- },
815
- tablet: {
816
- textSIZE: '2xl',
817
- pt: '6',
818
- },
819
- desktop: {},
820
- },
821
- p: {
822
- mobile: {
823
- textCOLOR,
824
- textSIZE: 'lg',
825
- py: '1.5',
826
- },
827
- tablet: {
828
- textSIZE: 'xl',
829
- py: '2.5',
830
- },
831
- desktop: {},
832
- },
833
- },
834
- parentClasses: baseClasses,
835
- markdownBody: defaultSectionBody,
836
- },
837
- };
838
- }
839
-
840
- const getBaseIntroClasses = (theme: Theme) => ({
841
- h2: {
842
- mobile: {
843
- fontWEIGHT: 'bold',
844
- textCOLOR: getColor(
845
- {
846
- light: 'brand-7',
847
- 'light-bw': 'brand-1',
848
- 'light-bold': 'brand-5',
849
- dark: 'brand-4',
850
- 'dark-bw': 'brand-8',
851
- 'dark-bold': 'brand-3',
852
- },
853
- theme
854
- ),
855
- textSIZE: '3xl',
856
- lineHEIGHT: 'snug',
857
- fontFACE: 'action',
858
- },
859
- tablet: {
860
- textSIZE: '4xl',
861
- },
862
- desktop: {
863
- textSIZE: '5xl',
864
- },
865
- },
866
- h3: {
867
- mobile: {
868
- fontWEIGHT: 'bold',
869
- textCOLOR: getColor(
870
- {
871
- light: 'brand-7',
872
- 'light-bw': 'brand-1',
873
- 'light-bold': 'brand-5',
874
- dark: 'brand-4',
875
- 'dark-bw': 'white',
876
- 'dark-bold': 'brand-3',
877
- },
878
- theme
879
- ),
880
- textSIZE: 'xl',
881
- lineHEIGHT: 'snug',
882
- fontFACE: 'action',
883
- },
884
- tablet: {
885
- textSIZE: '3xl',
886
- },
887
- desktop: {},
888
- },
889
- h4: {
890
- mobile: {
891
- textCOLOR: getColor(
892
- {
893
- light: 'brand-7',
894
- 'light-bw': 'brand-1',
895
- 'light-bold': 'brand-5',
896
- dark: 'brand-4',
897
- 'dark-bw': 'white',
898
- 'dark-bold': 'brand-3',
899
- },
900
- theme
901
- ),
902
- textSIZE: 'xl',
903
- lineHEIGHT: 'snug',
904
- fontFACE: 'action',
905
- pt: '4',
906
- },
907
- tablet: {
908
- textSIZE: '2xl',
909
- pt: '6',
910
- },
911
- desktop: {},
912
- },
913
- p: {
914
- mobile: {
915
- textCOLOR: getColor(
916
- {
917
- light: 'brand-7',
918
- 'light-bw': 'brand-1',
919
- 'light-bold': 'brand-7',
920
- dark: 'brand-8',
921
- 'dark-bw': 'brand-2',
922
- 'dark-bold': 'brand-8',
923
- },
924
- theme
925
- ),
926
- textSIZE: 'lg',
927
- lineHEIGHT: 'loose',
928
- py: '1.5',
929
- },
930
- tablet: {
931
- textSIZE: 'xl',
932
- py: '2.5',
933
- },
934
- desktop: {},
935
- },
936
- });
937
-
938
- const getIntroBaseParentClasses = (): ParentClassesPayload => [
939
- {
940
- mobile: {
941
- mx: '5',
942
- mt: '16',
943
- mb: '16',
944
- },
945
- tablet: {
946
- mx: '10',
947
- mt: '20',
948
- },
949
- desktop: {},
950
- },
951
- {
952
- mobile: {
953
- mx: 'auto',
954
- maxW: 'none',
955
- },
956
- tablet: {
957
- maxW: 'screen-lg',
958
- },
959
- desktop: {
960
- maxW: 'screen-xl',
961
- },
962
- },
963
- {
964
- mobile: {
965
- px: '9',
966
- py: '10',
967
- },
968
- tablet: {
969
- px: '14',
970
- },
971
- desktop: {
972
- px: '32',
973
- },
974
- },
975
- ];
976
-
977
- export const getIntroDesign = (
978
- theme: Theme,
979
- brand: string,
980
- useOdd: boolean = false,
981
- bordered: boolean = false,
982
- variant: string = `default`
983
- ): TemplatePane => {
984
- const parentClasses = getIntroBaseParentClasses();
985
- let title = '';
986
- let slug = '';
987
- switch (variant) {
988
- case `center`: {
989
- (title = !bordered
990
- ? 'Intro section centered'
991
- : 'Intro section centered with border'),
992
- (slug = !bordered ? 'intro-centered' : 'intro-centered-bordered'),
993
- (parentClasses[2].mobile.textALIGN = 'center');
994
- parentClasses[2].mobile.textWRAP = 'balance';
995
- if (bordered) {
996
- parentClasses[2].mobile.rounded = 'lg';
997
- parentClasses[2].mobile.shadow = 'lg';
998
- parentClasses[2].mobile.bgCOLOR = getColor(
999
- {
1000
- light: useOdd ? 'brand-2' : 'white',
1001
- 'light-bw': useOdd ? 'white' : 'brand-2',
1002
- 'light-bold': useOdd ? 'brand-2' : 'white',
1003
- dark: useOdd ? 'black' : 'brand-1',
1004
- 'dark-bw': useOdd ? 'black' : 'brand-1',
1005
- 'dark-bold': useOdd ? 'brand-1' : 'black',
1006
- },
1007
- theme
1008
- );
1009
- }
1010
- break;
1011
- }
1012
-
1013
- case `onecol`: {
1014
- (title = !bordered
1015
- ? 'Intro section one column'
1016
- : 'Intro section one column with border'),
1017
- (slug = !bordered ? 'intro-onecol' : 'intro-onecol-bordered'),
1018
- (parentClasses[2].mobile.textALIGN = 'left');
1019
- parentClasses[2].mobile.textWRAP = 'pretty';
1020
- parentClasses[2].mobile.maxW = '3xl';
1021
- if (bordered) {
1022
- parentClasses[2].mobile.shadow = 'lg';
1023
- parentClasses[2].mobile.bgCOLOR = getColor(
1024
- {
1025
- light: useOdd ? 'brand-2' : 'white',
1026
- 'light-bw': useOdd ? 'white' : 'brand-2',
1027
- 'light-bold': useOdd ? 'brand-2' : 'white',
1028
- dark: useOdd ? 'black' : 'brand-1',
1029
- 'dark-bw': useOdd ? 'black' : 'brand-1',
1030
- 'dark-bold': useOdd ? 'brand-1' : 'black',
1031
- },
1032
- theme
1033
- );
1034
- }
1035
- break;
1036
- }
1037
-
1038
- default: {
1039
- (title = !bordered ? 'Intro section' : 'Intro section with border'),
1040
- (slug = !bordered ? 'intro-default' : 'intro-default-bordered'),
1041
- (parentClasses[2].mobile.textALIGN = 'left');
1042
- parentClasses[2].mobile.textWRAP = 'pretty';
1043
- if (bordered) {
1044
- parentClasses[2].mobile.shadow = 'lg';
1045
- parentClasses[2].mobile.bgCOLOR = getColor(
1046
- {
1047
- light: useOdd ? 'brand-2' : 'white',
1048
- 'light-bw': useOdd ? 'white' : 'brand-2',
1049
- 'light-bold': useOdd ? 'brand-2' : 'white',
1050
- dark: useOdd ? 'black' : 'brand-1',
1051
- 'dark-bw': useOdd ? 'black' : 'brand-1',
1052
- 'dark-bold': useOdd ? 'brand-1' : 'black',
1053
- },
1054
- theme
1055
- );
1056
- }
1057
- }
1058
- }
1059
-
1060
- return {
1061
- nodeType: 'Pane',
1062
- id: '',
1063
- parentId: '',
1064
- isDecorative: false,
1065
- title,
1066
- slug,
1067
- bgColour: tailwindToHex(
1068
- getColor(
1069
- {
1070
- light: !useOdd ? 'brand-2' : 'white',
1071
- 'light-bw': !useOdd ? 'white' : 'brand-2',
1072
- 'light-bold': !useOdd ? 'brand-2' : 'white',
1073
- dark: !useOdd ? 'black' : 'brand-1',
1074
- 'dark-bw': !useOdd ? 'black' : 'brand-1',
1075
- 'dark-bold': !useOdd ? 'brand-1' : 'black',
1076
- },
1077
- theme
1078
- ),
1079
- brand
1080
- ),
1081
- markdown: {
1082
- nodeType: 'Markdown',
1083
- id: '',
1084
- parentId: '',
1085
- type: 'markdown',
1086
- markdownId: ulid(),
1087
- defaultClasses: getBaseIntroClasses(theme),
1088
- parentClasses,
1089
- markdownBody: defaultIntroBody,
1090
- },
1091
- };
1092
- };
1093
-
1094
- export const getImageHeroSectionDefault = (
1095
- theme: Theme,
1096
- brand: string,
1097
- useOdd: boolean = false,
1098
- bordered: boolean = false
1099
- ): TemplatePane => {
1100
- const parentClasses = getImageHeroBaseParentClasses();
1101
- parentClasses[2].mobile.textALIGN = 'left';
1102
- parentClasses[2].mobile.textWRAP = 'pretty';
1103
- if (bordered) {
1104
- parentClasses[2].mobile.shadow = 'lg';
1105
- parentClasses[2].mobile.bgCOLOR = getColor(
1106
- {
1107
- light: useOdd ? 'brand-2' : 'white',
1108
- 'light-bw': useOdd ? 'white' : 'brand-2',
1109
- 'light-bold': useOdd ? 'brand-2' : 'white',
1110
- dark: useOdd ? 'black' : 'brand-1',
1111
- 'dark-bw': useOdd ? 'black' : 'brand-1',
1112
- 'dark-bold': useOdd ? 'brand-1' : 'black',
1113
- },
1114
- theme
1115
- );
1116
- }
1117
-
1118
- return {
1119
- nodeType: 'Pane',
1120
- id: '',
1121
- parentId: '',
1122
- isDecorative: false,
1123
- title: !bordered ? 'Hero Image section' : 'Hero Image section with border',
1124
- slug: 'intro-default',
1125
- bgColour: tailwindToHex(
1126
- getColor(
1127
- {
1128
- light: !useOdd ? 'brand-2' : 'white',
1129
- 'light-bw': !useOdd ? 'white' : 'brand-2',
1130
- 'light-bold': !useOdd ? 'brand-2' : 'white',
1131
- dark: !useOdd ? 'black' : 'brand-1',
1132
- 'dark-bw': !useOdd ? 'black' : 'brand-1',
1133
- 'dark-bold': !useOdd ? 'brand-1' : 'black',
1134
- },
1135
- theme
1136
- ),
1137
- brand
1138
- ),
1139
- markdown: {
1140
- nodeType: 'Markdown',
1141
- id: '',
1142
- parentId: '',
1143
- type: 'markdown',
1144
- markdownId: ulid(),
1145
- defaultClasses: getBaseImageHeroClasses(theme),
1146
- parentClasses,
1147
- markdownBody: defaultImageHeroBody,
1148
- },
1149
- };
1150
- };
1151
-
1152
- const getBaseImageHeroClasses = (theme: Theme) => ({
1153
- h2: {
1154
- mobile: {
1155
- fontWEIGHT: 'bold',
1156
- textCOLOR: getColor(
1157
- {
1158
- light: 'brand-7',
1159
- 'light-bw': 'brand-1',
1160
- 'light-bold': 'brand-5',
1161
- dark: 'brand-4',
1162
- 'dark-bw': 'brand-8',
1163
- 'dark-bold': 'brand-3',
1164
- },
1165
- theme
1166
- ),
1167
- textSIZE: '3xl',
1168
- lineHEIGHT: 'snug',
1169
- fontFACE: 'action',
1170
- mb: '4',
1171
- maxW: '2xl',
1172
- },
1173
- tablet: {
1174
- textSIZE: '4xl',
1175
- mb: '6',
1176
- },
1177
- desktop: {
1178
- textSIZE: '5xl',
1179
- mb: '8',
1180
- },
1181
- },
1182
- p: {
1183
- mobile: {
1184
- textCOLOR: getColor(
1185
- {
1186
- light: 'brand-7',
1187
- 'light-bw': 'brand-1',
1188
- 'light-bold': 'brand-7',
1189
- dark: 'brand-8',
1190
- 'dark-bw': 'brand-2',
1191
- 'dark-bold': 'brand-8',
1192
- },
1193
- theme
1194
- ),
1195
- textSIZE: 'lg',
1196
- lineHEIGHT: 'relaxed',
1197
- maxW: 'xl',
1198
- py: '1.5',
1199
- },
1200
- tablet: {
1201
- textSIZE: 'xl',
1202
- py: '2.5',
1203
- },
1204
- desktop: {
1205
- maxW: '2xl',
1206
- mb: '10',
1207
- },
1208
- },
1209
- li: {
1210
- mobile: {
1211
- fontWEIGHT: 'bold',
1212
- textCOLOR: getColor(
1213
- {
1214
- light: 'brand-7',
1215
- 'light-bw': 'brand-1',
1216
- 'light-bold': 'brand-5',
1217
- dark: 'brand-4',
1218
- 'dark-bw': 'brand-8',
1219
- 'dark-bold': 'brand-3',
1220
- },
1221
- theme
1222
- ),
1223
- textSIZE: '3xl',
1224
- lineHEIGHT: 'snug',
1225
- fontFACE: 'action',
1226
- },
1227
- tablet: {
1228
- textSIZE: '4xl',
1229
- },
1230
- desktop: {
1231
- textSIZE: '5xl',
1232
- },
1233
- },
1234
- img: {
1235
- mobile: {
1236
- objectFIT: 'cover',
1237
- mx: 'auto',
1238
- },
1239
- tablet: {
1240
- maxH: 'none',
1241
- h: 'full',
1242
- },
1243
- desktop: {
1244
- w: '1/2',
1245
- borderL: '8',
1246
- borderCOLOR: 'brand-3',
1247
- },
1248
- },
1249
- });
1250
-
1251
- const getImageHeroBaseParentClasses = (): ParentClassesPayload => [
1252
- ...getIntroBaseParentClasses(),
1253
- {
1254
- mobile: {
1255
- display: 'flex',
1256
- flexDIRECTION: 'col',
1257
- gap: '8',
1258
- p: '6',
1259
- },
1260
- tablet: {
1261
- p: '12',
1262
- gap: '12',
1263
- },
1264
- desktop: {
1265
- flexDIRECTION: 'row',
1266
- items: 'center',
1267
- justify: 'between',
1268
- gap: '0',
1269
- overflow: 'hidden',
1270
- p: '0',
1271
- },
1272
- },
1273
- ];