@levo-so/blocks 0.1.81 → 0.1.83

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.
@@ -0,0 +1,89 @@
1
+ import type { ILevoBlockBaseProps } from "@levo-so/studio";
2
+ import {
3
+ Box,
4
+ Button,
5
+ Container,
6
+ Heading,
7
+ Icon,
8
+ Image,
9
+ Section,
10
+ Typography,
11
+ useContentEngine,
12
+ } from "@levo-so/studio";
13
+ import dayjs from "dayjs";
14
+
15
+ import { ClientOnly } from "../event/ClientOnly";
16
+ import type { ICards19Content } from "./cards-19.schema";
17
+
18
+ const Cards19: React.FC<ILevoBlockBaseProps<ICards19Content>> = () => {
19
+ const { data, query, setQuery, meta } = useContentEngine("events");
20
+
21
+ const handleNext = () => setQuery({ page: (query?.page || 1) + 1 });
22
+ const handlePrevious = () => setQuery({ page: (query?.page || 1) - 1 });
23
+
24
+ return (
25
+ <Section elementKey="layout">
26
+ <Container elementKey="container">
27
+ <Box elementKey="header-container">
28
+ <Heading elementKey="title" />
29
+ <Button elementKey="cta-button" />
30
+ </Box>
31
+
32
+ <Box elementKey="events_levoGroup" data-levo_group>
33
+ {(data || [])?.map((item: any, index: number) => (
34
+ <Box
35
+ key={`events-listing-element-${index}`}
36
+ data-levo_group_item
37
+ elementKey={`events.${index}.eventWrapper`}
38
+ >
39
+ <Image
40
+ height={200}
41
+ width={360}
42
+ elementKey={`events.${index}.image`}
43
+ alt="event poster"
44
+ />
45
+ <Box elementKey={`events.${index}.text-wrapper`}>
46
+ <Box elementKey={`events.${index}.text-container`}>
47
+ <Typography elementKey={`events.${index}.caption-text`} />
48
+
49
+ <Box elementKey={`events.${index}.date-wrapper`}>
50
+ <Icon elementKey={`events.${index}.date-icon`} />
51
+ <Typography elementKey={`events.${index}.publishedAt-header`}>
52
+ <ClientOnly>
53
+ {dayjs(item?.["publishedAt-header"]).format("MMM D, YYYY")}
54
+ </ClientOnly>
55
+ </Typography>
56
+ </Box>
57
+ </Box>
58
+
59
+ <Typography elementKey={`events.${index}.title`} />
60
+ <Typography elementKey={`events.${index}.description`} />
61
+ <Typography elementKey={`events.${index}.publishedAt`}>
62
+ <ClientOnly>{dayjs(item?.publishedAt).format("MMM D, YYYY")}</ClientOnly>
63
+ </Typography>
64
+ </Box>
65
+ </Box>
66
+ ))}
67
+ </Box>
68
+ <Box elementKey="paginationWrapper">
69
+ <Button
70
+ elementKey="paginationLeftButton"
71
+ disabled={query?.page === 1}
72
+ onClick={handlePrevious}
73
+ />
74
+
75
+ <Typography elementKey="paginationText">
76
+ {`${query?.page || 1}/${meta?.pages || 0}`}
77
+ </Typography>
78
+ <Button
79
+ elementKey="paginationRightButton"
80
+ onClick={handleNext}
81
+ disabled={query?.page === meta?.pages}
82
+ />
83
+ </Box>
84
+ </Container>
85
+ </Section>
86
+ );
87
+ };
88
+
89
+ export default Cards19;
@@ -0,0 +1,536 @@
1
+ import type { IBlock } from "@levo-so/studio";
2
+
3
+ const DUMMY_ICON = {
4
+ kind: "icon",
5
+ data: {
6
+ id: "archive-minus",
7
+ label: "Archive Minus",
8
+ tags: ["archive", "custom", "directional", "minus"],
9
+ svgCode:
10
+ '<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M14.5 11.4H9.5C9.09 11.4 8.75 11.06 8.75 10.65C8.75 10.24 9.09 9.90002 9.5 9.90002H14.5C14.91 9.90002 15.25 10.24 15.25 10.65C15.25 11.06 14.91 11.4 14.5 11.4Z" fill="var(--color-icon-primary)"/>\n<path d="M4.92957 22.75C4.50957 22.75 4.11957 22.65 3.76957 22.45C2.99957 22 2.55957 21.09 2.55957 19.96V5.86C2.55957 3.32 4.62957 1.25 7.16957 1.25H16.8196C19.3596 1.25 21.4296 3.32 21.4296 5.86V19.95C21.4296 21.08 20.9896 21.99 20.2196 22.44C19.4496 22.89 18.4396 22.84 17.4496 22.29L12.5696 19.58C12.2796 19.42 11.7096 19.42 11.4196 19.58L6.53957 22.29C5.99957 22.59 5.44957 22.75 4.92957 22.75ZM7.17957 2.75C5.46957 2.75 4.06957 4.15 4.06957 5.86V19.95C4.06957 20.54 4.23957 20.98 4.53957 21.15C4.83957 21.33 5.30957 21.27 5.81957 20.98L10.6996 18.27C11.4396 17.86 12.5596 17.86 13.2996 18.27L18.1796 20.98C18.6896 21.27 19.1596 21.33 19.4596 21.15C19.7596 20.97 19.9296 20.53 19.9296 19.95V5.86C19.9296 4.15 18.5296 2.75 16.8196 2.75H7.17957Z" fill="var(--color-icon-primary)"/>\n</svg>',
11
+ },
12
+ };
13
+
14
+ const DEFAULT_CONTENT = {
15
+ layout: null,
16
+ container: null,
17
+ "header-section": null,
18
+ title: "Events",
19
+ description:
20
+ "Stay updated on our upcoming community gatherings, workshops, and networking events!",
21
+ "cta-button": "View all",
22
+ events: [
23
+ {
24
+ eventWrapper: null,
25
+ image: {
26
+ id: "w9fEtJuVtBFgU",
27
+ filename: "image.png",
28
+ kind: "image",
29
+ location: "https://static.levostg.online/W6OEVMW8/image-6HgF6xxhyiHBm.png",
30
+ srcset: {
31
+ "1080w": "https://static.levostg.online/W6OEVMW8/image-6HgF6xxhyiHBm-1080w.webp",
32
+ "1200w": "https://static.levostg.online/W6OEVMW8/image-6HgF6xxhyiHBm-1200w.webp",
33
+ "1920w": "https://static.levostg.online/W6OEVMW8/image-6HgF6xxhyiHBm-1920w.webp",
34
+ "320w": "https://static.levostg.online/W6OEVMW8/image-6HgF6xxhyiHBm-320w.webp",
35
+ "640w": "https://static.levostg.online/W6OEVMW8/image-6HgF6xxhyiHBm-640w.webp",
36
+ "750w": "https://static.levostg.online/W6OEVMW8/image-6HgF6xxhyiHBm-750w.webp",
37
+ "828w": "https://static.levostg.online/W6OEVMW8/image-6HgF6xxhyiHBm-828w.webp",
38
+ path: "https://static.levostg.online/W6OEVMW8/image-6HgF6xxhyiHBm-750w.webp 750w, https://static.levostg.online/W6OEVMW8/image-6HgF6xxhyiHBm-828w.webp 828w, https://static.levostg.online/W6OEVMW8/image-6HgF6xxhyiHBm-1080w.webp 1080w, https://static.levostg.online/W6OEVMW8/image-6HgF6xxhyiHBm-1200w.webp 1200w, https://static.levostg.online/W6OEVMW8/image-6HgF6xxhyiHBm-1920w.webp 1920w, https://static.levostg.online/W6OEVMW8/image-6HgF6xxhyiHBm-320w.webp 320w, https://static.levostg.online/W6OEVMW8/image-6HgF6xxhyiHBm-640w.webp 640w",
39
+ },
40
+ mimetype: "image/png",
41
+ },
42
+ "content-wrapper": null,
43
+ title: "Afghan American Inauguration",
44
+ description:
45
+ "Join us for this historic celebration of community leadership and cultural pride.",
46
+ details: [
47
+ {
48
+ detailWrapper: null,
49
+ icon: DUMMY_ICON,
50
+ text: "3:00 PM - 6:00 PM",
51
+ },
52
+ {
53
+ detailWrapper: null,
54
+ icon: DUMMY_ICON,
55
+ text: "2200 Harvard St, Sacramento, CA 95815",
56
+ },
57
+ {
58
+ detailWrapper: null,
59
+ icon: DUMMY_ICON,
60
+ text: "11 Apr",
61
+ },
62
+ ],
63
+ },
64
+ {
65
+ eventWrapper: null,
66
+ image: {
67
+ id: "7141014160938075687",
68
+ location: "https://static.levocdn.com/WLZ1TXTD/defaultblue-tryFJ012mgyH.png",
69
+ kind: "image",
70
+ mimetype: "image/png",
71
+ srcset: {
72
+ "1080w": "https://static.levocdn.com/WLZ1TXTD/defaultblue-tryFJ012mgyH-1080w.webp",
73
+ "1200w": "https://static.levocdn.com/WLZ1TXTD/defaultblue-tryFJ012mgyH-1200w.webp",
74
+ "1920w": "https://static.levocdn.com/WLZ1TXTD/defaultblue-tryFJ012mgyH-1920w.webp",
75
+ "320w": "https://static.levocdn.com/WLZ1TXTD/defaultblue-tryFJ012mgyH-320w.webp",
76
+ "640w": "https://static.levocdn.com/WLZ1TXTD/defaultblue-tryFJ012mgyH-640w.webp",
77
+ "750w": "https://static.levocdn.com/WLZ1TXTD/defaultblue-tryFJ012mgyH-750w.webp",
78
+ "828w": "https://static.levocdn.com/WLZ1TXTD/defaultblue-tryFJ012mgyH-828w.webp",
79
+ path: "https://static.levocdn.com/WLZ1TXTD/defaultblue-tryFJ012mgyH-640w.webp 640w, https://static.levocdn.com/WLZ1TXTD/defaultblue-tryFJ012mgyH-1080w.webp 1080w, https://static.levocdn.com/WLZ1TXTD/defaultblue-tryFJ012mgyH-1200w.webp 1200w, https://static.levocdn.com/WLZ1TXTD/defaultblue-tryFJ012mgyH-1920w.webp 1920w, https://static.levocdn.com/WLZ1TXTD/defaultblue-tryFJ012mgyH-320w.webp 320w, https://static.levocdn.com/WLZ1TXTD/defaultblue-tryFJ012mgyH-750w.webp 750w, https://static.levocdn.com/WLZ1TXTD/defaultblue-tryFJ012mgyH-828w.webp 828w",
80
+ },
81
+ },
82
+ "content-wrapper": null,
83
+ title: "Community Health Workshop",
84
+ description: "Learn about wellness resources and health services available in our community.",
85
+ details: [
86
+ {
87
+ detailWrapper: null,
88
+ icon: DUMMY_ICON,
89
+ text: "10:00 AM - 2:00 PM",
90
+ },
91
+ {
92
+ detailWrapper: null,
93
+ icon: DUMMY_ICON,
94
+ text: "1500 Main St, Sacramento, CA 95814",
95
+ },
96
+ {
97
+ detailWrapper: null,
98
+ icon: DUMMY_ICON,
99
+ text: "25 Apr",
100
+ },
101
+ ],
102
+ },
103
+ ],
104
+ paginationWrapper: null,
105
+ paginationLeftButton: "Previous",
106
+ paginationText: "",
107
+ paginationRightButton: "Next",
108
+ };
109
+
110
+ export type ICards20Content = typeof DEFAULT_CONTENT;
111
+
112
+ export const Cards20: IBlock = {
113
+ category_id: "cards",
114
+ title: "Cards 20",
115
+ key: "cards-20",
116
+ version: "v1",
117
+ prompt_description:
118
+ "Event listing with header section containing title, description and CTA button, followed by event cards with images and detailed information including time, location, and date with icons",
119
+ content_schema: [
120
+ {
121
+ key: "layout",
122
+ label: "Layout",
123
+ field_interface: "LayoutWidget",
124
+ hint: {
125
+ prompt_description:
126
+ "Defines the overall structure and layout of the Event Listing 2 block. No content generation required.",
127
+ },
128
+ },
129
+ {
130
+ key: "container",
131
+ label: "Container",
132
+ field_interface: "ContainerWidget",
133
+ hint: {
134
+ prompt_description:
135
+ "Contains the whole Event Listing 2 section, providing spacing and alignment for visual consistency. No content generation required.",
136
+ },
137
+ },
138
+ {
139
+ key: "header-section",
140
+ label: "Header Section",
141
+ field_interface: "BoxWidget",
142
+ hint: {
143
+ prompt_description:
144
+ "Container for the header content including title, description, and CTA button. No content generation required.",
145
+ },
146
+ },
147
+ {
148
+ key: "header-content",
149
+ label: "Header Content",
150
+ field_interface: "BoxWidget",
151
+ hint: {
152
+ prompt_description:
153
+ "Wrapper for the title and description to enable flex layout styling. No content generation required.",
154
+ },
155
+ },
156
+ {
157
+ key: "title",
158
+ label: "Title",
159
+ field_interface: "HeadingWidget",
160
+ hint: {
161
+ prompt_description:
162
+ "Main heading for the events section. Should be clear and engaging, indicating the purpose of the section.",
163
+ min_characters: 5,
164
+ max_characters: 20,
165
+ },
166
+ },
167
+ {
168
+ key: "description",
169
+ label: "Description",
170
+ field_interface: "TypographyWidget",
171
+ hint: {
172
+ prompt_description:
173
+ "Supporting text that provides context about the events. Should be informative and encouraging.",
174
+ min_characters: 50,
175
+ max_characters: 150,
176
+ },
177
+ },
178
+ {
179
+ key: "cta-button",
180
+ label: "CTA Button",
181
+ field_interface: "ButtonWidget",
182
+ hint: {
183
+ prompt_description:
184
+ "Call-to-action button that encourages users to explore more events. Should be action-oriented.",
185
+ min_characters: 6,
186
+ max_characters: 15,
187
+ },
188
+ },
189
+ {
190
+ key: "events",
191
+ label: "Events",
192
+ field_interface: "BoxWidget",
193
+ kind: "group",
194
+ fields: [
195
+ {
196
+ key: "eventWrapper",
197
+ label: "Event Wrapper",
198
+ field_interface: "BoxWidget",
199
+ },
200
+ {
201
+ key: "image",
202
+ label: "Event Image",
203
+ field_interface: "ImageWidget",
204
+ hint: {
205
+ prompt_description:
206
+ "Featured image for the event. Should be engaging and relevant to the event content.",
207
+ orientation: "landscape",
208
+ size: "medium",
209
+ usecase: "hero",
210
+ },
211
+ },
212
+ {
213
+ key: "content-wrapper",
214
+ label: "Content Wrapper",
215
+ field_interface: "BoxWidget",
216
+ },
217
+ {
218
+ key: "title",
219
+ label: "Event Title",
220
+ field_interface: "HeadingWidget",
221
+ hint: {
222
+ prompt_description: "Name of the event. Should be clear, descriptive, and engaging.",
223
+ min_characters: 15,
224
+ max_characters: 50,
225
+ },
226
+ },
227
+ {
228
+ key: "description",
229
+ label: "Event Description",
230
+ field_interface: "TypographyWidget",
231
+ hint: {
232
+ prompt_description:
233
+ "Brief description of the event, highlighting key benefits or features that would interest attendees.",
234
+ min_characters: 40,
235
+ max_characters: 120,
236
+ },
237
+ },
238
+ {
239
+ key: "details",
240
+ label: "Event Details",
241
+ field_interface: "BoxWidget",
242
+ kind: "group",
243
+ fields: [
244
+ {
245
+ key: "detailWrapper",
246
+ label: "Detail Wrapper",
247
+ field_interface: "BoxWidget",
248
+ },
249
+ {
250
+ key: "icon",
251
+ label: "Detail Icon",
252
+ field_interface: "ImageWidget",
253
+ hint: {
254
+ prompt_description:
255
+ "Icon representing the type of detail (time, location, date). Should be simple and recognizable.",
256
+ orientation: "square",
257
+ size: "icon",
258
+ usecase: "icon",
259
+ },
260
+ },
261
+ {
262
+ key: "text",
263
+ label: "Detail Text",
264
+ field_interface: "TypographyWidget",
265
+ hint: {
266
+ prompt_description:
267
+ "Detail information such as time, location, or date. Should be clear and specific.",
268
+ min_characters: 5,
269
+ max_characters: 50,
270
+ },
271
+ },
272
+ ],
273
+ hint: {
274
+ prompt_description:
275
+ "Collection of event details including time, location, and date with corresponding icons.",
276
+ min_items: 3,
277
+ max_items: 3,
278
+ },
279
+ },
280
+ ],
281
+ hint: {
282
+ prompt_description:
283
+ "Collection of events with images, titles, descriptions, and detailed information about time, location, and date.",
284
+ min_items: 3,
285
+ max_items: 6,
286
+ },
287
+ },
288
+ {
289
+ key: "paginationWrapper",
290
+ label: "Pagination Wrapper",
291
+ field_interface: "BoxWidget",
292
+ hint: {
293
+ prompt_description:
294
+ "Container holding pagination controls (buttons and info) at the bottom of the event grid. Provides structure and alignment for pagination elements. No content generation required.",
295
+ },
296
+ },
297
+ {
298
+ key: "paginationLeftButton",
299
+ label: "Pagination Left Button",
300
+ field_interface: "ButtonWidget",
301
+ hint: {
302
+ prompt_description:
303
+ "Button for navigating to the previous page of events. Label should be clear and descriptive, such as 'Previous'.",
304
+ min_characters: 4,
305
+ max_characters: 12,
306
+ },
307
+ },
308
+ {
309
+ key: "paginationInfo",
310
+ label: "Pagination Info",
311
+ field_interface: "TypographyWidget",
312
+ hint: {
313
+ prompt_description:
314
+ "Displays the current events page and total pages, e.g., '1/10'. Keep format concise and clear.",
315
+ min_characters: 3,
316
+ max_characters: 8,
317
+ },
318
+ },
319
+ {
320
+ key: "paginationText",
321
+ label: "Pagination Text",
322
+ field_interface: "TypographyWidget",
323
+ hint: {
324
+ prompt_description:
325
+ "Displays the current events page and total pages, e.g., '1/10'. Keep format concise and clear.",
326
+ min_characters: 3,
327
+ max_characters: 8,
328
+ },
329
+ },
330
+ {
331
+ key: "paginationRightButton",
332
+ label: "Pagination Right Button",
333
+ field_interface: "ButtonWidget",
334
+ hint: {
335
+ prompt_description:
336
+ "Button for navigating to the next page of events. Label should be clear and descriptive, such as 'Next'.",
337
+ min_characters: 4,
338
+ max_characters: 12,
339
+ },
340
+ },
341
+ ],
342
+ layouts: [
343
+ {
344
+ key: "default",
345
+ title: "Default",
346
+ styles: {
347
+ layout: {
348
+ "padding-top": "4xl",
349
+ "padding-bottom": "4xl",
350
+ "padding-left": "xl",
351
+ "padding-right": "xl",
352
+ filter: "none",
353
+ },
354
+ container: {
355
+ "max-width": "1280px",
356
+ "margin-left": "auto",
357
+ "margin-right": "auto",
358
+ display: "flex",
359
+ "flex-direction": "column",
360
+ "row-gap": "3xl",
361
+ filter: "none",
362
+ },
363
+ "header-section": {
364
+ display: "flex",
365
+ "flex-direction": "row",
366
+ "align-items": "center",
367
+ "text-align": "center",
368
+ "row-gap": "lg",
369
+ "margin-bottom": "xl",
370
+ filter: "none",
371
+ "justify-content": "space-between",
372
+ tablet: {
373
+ "flex-direction": "column",
374
+ },
375
+ mobile: {
376
+ "flex-direction": "column",
377
+ },
378
+ },
379
+ "header-content": {
380
+ display: "flex",
381
+ "flex-direction": "column",
382
+ "row-gap": "base",
383
+ "text-align": "left",
384
+ mobile: {
385
+ "text-align": "center",
386
+ },
387
+ },
388
+ title: {
389
+ color: "text-1",
390
+ },
391
+ description: {
392
+ "font-size": "lg",
393
+ color: "text-2",
394
+ "max-width": "600px",
395
+ "line-height": "1.6",
396
+ },
397
+
398
+ events_levoGroup: {
399
+ display: "grid",
400
+ "grid-template-columns": "repeat(2, minmax(0, 1fr))",
401
+ "column-gap": "2xl",
402
+ "row-gap": "2xl",
403
+ tablet: {
404
+ "grid-template-columns": "repeat(2, minmax(0, 1fr))",
405
+ },
406
+ mobile: {
407
+ "grid-template-columns": "repeat(1, minmax(0, 1fr))",
408
+ },
409
+ filter: "none",
410
+ },
411
+ paginationWrapper: {
412
+ width: "100%",
413
+ display: "flex",
414
+ "justify-content": "center",
415
+ "column-gap": "lg",
416
+ "align-items": "center",
417
+ },
418
+ events: Array(2)
419
+ ?.fill(0)
420
+ .map((v) => {
421
+ return {
422
+ eventWrapper: {
423
+ "background-color": "white",
424
+ "border-radius": "xl",
425
+ overflow: "hidden",
426
+ "box-shadow": "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",
427
+ display: "flex",
428
+ "flex-direction": "column",
429
+ filter: "none",
430
+ "padding-bottom": "none",
431
+ height: "min-content",
432
+ },
433
+ image: {
434
+ width: "100%",
435
+ height: "auto",
436
+ "object-fit": "cover",
437
+ filter: "none",
438
+ "min-height": "260px",
439
+ },
440
+ "content-wrapper": {
441
+ "padding-left": "xl",
442
+ "padding-right": "xl",
443
+ "padding-top": "lg",
444
+ "padding-bottom": "xl",
445
+ display: "flex",
446
+ "flex-direction": "column",
447
+ "row-gap": "base",
448
+ filter: "none",
449
+ "background-color": "white",
450
+ },
451
+ title: {
452
+ "font-size": "xl",
453
+ "font-weight": "600",
454
+ color: "text-1",
455
+ "line-height": "1.3",
456
+ filter: "none",
457
+ },
458
+ description: {
459
+ "font-size": "base",
460
+ color: "text-2",
461
+ "line-height": "1.5",
462
+ "margin-bottom": "sm",
463
+ filter: "none",
464
+ display: "none",
465
+ },
466
+ details_levoGroup: {
467
+ display: "flex",
468
+ "flex-direction": "column",
469
+ "row-gap": "xs",
470
+ filter: "none",
471
+ },
472
+ details: [
473
+ {
474
+ detailWrapper: {
475
+ display: "flex",
476
+ "align-items": "center",
477
+ "column-gap": "sm",
478
+ filter: "none",
479
+ },
480
+ icon: {
481
+ width: "22px",
482
+ height: "22px",
483
+ "flex-shrink": "0",
484
+ filter: "none",
485
+ },
486
+ text: {
487
+ "font-size": "sm",
488
+ color: "text-2",
489
+ "line-height": "1.4",
490
+ },
491
+ },
492
+ {
493
+ icon: {
494
+ filter: "none",
495
+ width: "22px",
496
+ height: "22px",
497
+ },
498
+ detailWrapper: {
499
+ filter: "none",
500
+ display: "flex",
501
+ "column-gap": "sm",
502
+ },
503
+ text: {
504
+ filter: "none",
505
+ },
506
+ },
507
+ {
508
+ icon: {
509
+ filter: "none",
510
+ height: "22px",
511
+ width: "22px",
512
+ },
513
+ detailWrapper: {
514
+ filter: "none",
515
+ display: "flex",
516
+ "column-gap": "sm",
517
+ },
518
+ },
519
+ ],
520
+ };
521
+ }),
522
+ },
523
+ content: DEFAULT_CONTENT,
524
+ config: {
525
+ title: {
526
+ selectedVariants: {
527
+ Heading_Level: "H2",
528
+ },
529
+ heading: {
530
+ level: 2,
531
+ },
532
+ },
533
+ },
534
+ },
535
+ ],
536
+ };