@tightknitai/block-kitchen 0.6.1-alpha.0 → 0.8.2

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,1381 @@
1
+ import { Sparkles, FileText, AlignLeft, MousePointerClick, TextCursorInput, LayoutTemplate, Bell, Pilcrow, Image, Video, GalleryHorizontal, Table } from 'lucide-react';
2
+
3
+ // src/lib/default-blocks.ts
4
+ var defaultPalette = [
5
+ {
6
+ name: "Agents",
7
+ icon: Sparkles,
8
+ variants: [
9
+ {
10
+ id: "agents_feedback_remove",
11
+ label: "Feedback + remove",
12
+ factory: () => ({
13
+ type: "context_actions",
14
+ elements: [
15
+ {
16
+ type: "feedback_buttons",
17
+ action_id: "feedback",
18
+ positive_button: {
19
+ text: { type: "plain_text", text: "Good Response" },
20
+ value: "positive"
21
+ },
22
+ negative_button: {
23
+ text: { type: "plain_text", text: "Bad Response" },
24
+ value: "negative"
25
+ }
26
+ },
27
+ {
28
+ type: "icon_button",
29
+ action_id: "remove",
30
+ icon: "trash",
31
+ text: { type: "plain_text", text: "Remove" }
32
+ }
33
+ ]
34
+ })
35
+ },
36
+ {
37
+ id: "agents_feedback_only",
38
+ label: "Feedback only",
39
+ factory: () => ({
40
+ type: "context_actions",
41
+ elements: [
42
+ {
43
+ type: "feedback_buttons",
44
+ action_id: "feedback",
45
+ positive_button: {
46
+ text: { type: "plain_text", text: "\u{1F44D}" },
47
+ value: "positive"
48
+ },
49
+ negative_button: {
50
+ text: { type: "plain_text", text: "\u{1F44E}" },
51
+ value: "negative"
52
+ }
53
+ }
54
+ ]
55
+ })
56
+ },
57
+ {
58
+ id: "agents_plan",
59
+ label: "Plan",
60
+ factory: () => ({
61
+ type: "plan",
62
+ title: "Investigating the issue",
63
+ tasks: [
64
+ {
65
+ type: "task_card",
66
+ task_id: "task_1",
67
+ title: "Read the bug report",
68
+ status: "complete"
69
+ },
70
+ {
71
+ type: "task_card",
72
+ task_id: "task_2",
73
+ title: "Reproduce the error locally",
74
+ status: "in_progress"
75
+ },
76
+ {
77
+ type: "task_card",
78
+ task_id: "task_3",
79
+ title: "Identify the root cause",
80
+ status: "pending"
81
+ }
82
+ ]
83
+ })
84
+ },
85
+ {
86
+ id: "agents_task_card",
87
+ label: "Task card",
88
+ factory: () => ({
89
+ type: "task_card",
90
+ task_id: "task_1",
91
+ title: "Summarize the latest release notes",
92
+ status: "in_progress"
93
+ })
94
+ },
95
+ {
96
+ id: "agents_task_card_with_sources",
97
+ label: "Task card with sources",
98
+ factory: () => ({
99
+ type: "task_card",
100
+ task_id: "task_2",
101
+ title: "Cite supporting docs",
102
+ status: "complete",
103
+ sources: [
104
+ {
105
+ type: "url",
106
+ url: "https://example.com/runbook",
107
+ text: "Runbook"
108
+ },
109
+ {
110
+ type: "url",
111
+ url: "https://example.com/changelog",
112
+ text: "Changelog"
113
+ }
114
+ ]
115
+ })
116
+ }
117
+ ]
118
+ },
119
+ {
120
+ name: "Markdown",
121
+ icon: FileText,
122
+ variants: [
123
+ {
124
+ id: "markdown_basic",
125
+ label: "Basic",
126
+ factory: () => ({
127
+ type: "markdown",
128
+ text: "A **markdown** block. Supports _italic_, ~~strike~~, `code`, [links](https://slack.com), lists, tables, and task lists."
129
+ })
130
+ },
131
+ {
132
+ id: "markdown_list",
133
+ label: "List",
134
+ factory: () => ({
135
+ type: "markdown",
136
+ text: "**Roadmap**\n\n- Item one\n- Item two\n- Item three"
137
+ })
138
+ },
139
+ {
140
+ id: "markdown_code",
141
+ label: "Code block",
142
+ factory: () => ({
143
+ type: "markdown",
144
+ // biome-ignore lint/suspicious/noTemplateCurlyInString: literal markdown source for a code-block sample
145
+ text: "```ts\nconst greet = (name: string) => `Hello, ${name}!`;\n```"
146
+ })
147
+ }
148
+ ]
149
+ },
150
+ {
151
+ name: "Section",
152
+ icon: AlignLeft,
153
+ variants: [
154
+ {
155
+ id: "section_plain_text",
156
+ label: "Plain text",
157
+ factory: () => ({
158
+ type: "section",
159
+ text: {
160
+ type: "plain_text",
161
+ text: "A simple plain-text section.",
162
+ emoji: true
163
+ }
164
+ })
165
+ },
166
+ {
167
+ id: "section_mrkdwn",
168
+ label: "Mrkdwn",
169
+ factory: () => ({
170
+ type: "section",
171
+ text: {
172
+ type: "mrkdwn",
173
+ text: "A *markdown* section. Supports _italic_, ~strike~, `code`, and <https://slack.com|links>."
174
+ }
175
+ })
176
+ },
177
+ {
178
+ id: "section_with_button",
179
+ label: "With button accessory",
180
+ factory: () => ({
181
+ type: "section",
182
+ text: {
183
+ type: "mrkdwn",
184
+ text: "A section with a button accessory on the right."
185
+ },
186
+ accessory: {
187
+ type: "button",
188
+ text: { type: "plain_text", text: "Click me", emoji: true },
189
+ action_id: "section_button"
190
+ }
191
+ })
192
+ },
193
+ {
194
+ id: "section_with_image",
195
+ label: "With image accessory",
196
+ factory: () => ({
197
+ type: "section",
198
+ text: {
199
+ type: "mrkdwn",
200
+ text: "A section with an image accessory on the right."
201
+ },
202
+ accessory: {
203
+ type: "image",
204
+ image_url: "https://placehold.co/80x80?text=Img",
205
+ alt_text: "Placeholder accessory image"
206
+ }
207
+ })
208
+ }
209
+ ]
210
+ },
211
+ {
212
+ name: "Actions",
213
+ icon: MousePointerClick,
214
+ variants: [
215
+ {
216
+ id: "actions_all_selects",
217
+ label: "All selects",
218
+ factory: () => ({
219
+ type: "actions",
220
+ elements: [
221
+ {
222
+ type: "static_select",
223
+ action_id: "static_select",
224
+ placeholder: { type: "plain_text", text: "Static", emoji: true },
225
+ options: [
226
+ {
227
+ text: { type: "plain_text", text: "Option 1", emoji: true },
228
+ value: "option_1"
229
+ },
230
+ {
231
+ text: { type: "plain_text", text: "Option 2", emoji: true },
232
+ value: "option_2"
233
+ }
234
+ ]
235
+ },
236
+ {
237
+ type: "users_select",
238
+ action_id: "users_select",
239
+ placeholder: { type: "plain_text", text: "User", emoji: true }
240
+ },
241
+ {
242
+ type: "channels_select",
243
+ action_id: "channels_select",
244
+ placeholder: { type: "plain_text", text: "Channel", emoji: true }
245
+ },
246
+ {
247
+ type: "conversations_select",
248
+ action_id: "conversations_select",
249
+ placeholder: {
250
+ type: "plain_text",
251
+ text: "Conversation",
252
+ emoji: true
253
+ }
254
+ },
255
+ {
256
+ type: "external_select",
257
+ action_id: "external_select",
258
+ placeholder: { type: "plain_text", text: "External", emoji: true },
259
+ min_query_length: 0
260
+ }
261
+ ]
262
+ })
263
+ },
264
+ {
265
+ id: "actions_filtered_conversation",
266
+ label: "Filtered conversation",
267
+ factory: () => ({
268
+ type: "actions",
269
+ elements: [
270
+ {
271
+ type: "conversations_select",
272
+ action_id: "filtered_conversations_select",
273
+ placeholder: {
274
+ type: "plain_text",
275
+ text: "Pick a public channel",
276
+ emoji: true
277
+ },
278
+ filter: {
279
+ include: ["public"],
280
+ exclude_bot_users: true,
281
+ exclude_external_shared_channels: true
282
+ }
283
+ }
284
+ ]
285
+ })
286
+ },
287
+ {
288
+ id: "actions_selects_initial_values",
289
+ label: "Selects with initial values",
290
+ factory: () => ({
291
+ type: "actions",
292
+ elements: [
293
+ {
294
+ type: "static_select",
295
+ action_id: "static_select_initial",
296
+ placeholder: { type: "plain_text", text: "Pick one", emoji: true },
297
+ initial_option: {
298
+ text: { type: "plain_text", text: "Option 2", emoji: true },
299
+ value: "option_2"
300
+ },
301
+ options: [
302
+ {
303
+ text: { type: "plain_text", text: "Option 1", emoji: true },
304
+ value: "option_1"
305
+ },
306
+ {
307
+ text: { type: "plain_text", text: "Option 2", emoji: true },
308
+ value: "option_2"
309
+ },
310
+ {
311
+ text: { type: "plain_text", text: "Option 3", emoji: true },
312
+ value: "option_3"
313
+ }
314
+ ]
315
+ },
316
+ {
317
+ type: "users_select",
318
+ action_id: "users_select_initial",
319
+ placeholder: { type: "plain_text", text: "Pick a user", emoji: true },
320
+ initial_user: "U0LAN0Z89"
321
+ },
322
+ {
323
+ type: "channels_select",
324
+ action_id: "channels_select_initial",
325
+ placeholder: {
326
+ type: "plain_text",
327
+ text: "Pick a channel",
328
+ emoji: true
329
+ },
330
+ initial_channel: "C012AB3CD"
331
+ }
332
+ ]
333
+ })
334
+ },
335
+ {
336
+ id: "actions_button",
337
+ label: "Button",
338
+ factory: () => ({
339
+ type: "actions",
340
+ elements: [
341
+ {
342
+ type: "button",
343
+ text: { type: "plain_text", text: "Click me", emoji: true },
344
+ action_id: "button_1"
345
+ }
346
+ ]
347
+ })
348
+ },
349
+ {
350
+ id: "actions_datepickers",
351
+ label: "Datepickers",
352
+ factory: () => ({
353
+ type: "actions",
354
+ elements: [
355
+ {
356
+ type: "datepicker",
357
+ action_id: "datepicker",
358
+ placeholder: {
359
+ type: "plain_text",
360
+ text: "Select a date",
361
+ emoji: true
362
+ }
363
+ },
364
+ {
365
+ type: "timepicker",
366
+ action_id: "timepicker",
367
+ placeholder: {
368
+ type: "plain_text",
369
+ text: "Select a time",
370
+ emoji: true
371
+ }
372
+ },
373
+ {
374
+ type: "datetimepicker",
375
+ action_id: "datetimepicker"
376
+ }
377
+ ]
378
+ })
379
+ },
380
+ {
381
+ id: "actions_checkboxes",
382
+ label: "Checkboxes",
383
+ factory: () => ({
384
+ type: "actions",
385
+ elements: [
386
+ {
387
+ type: "checkboxes",
388
+ action_id: "checkboxes",
389
+ options: [
390
+ {
391
+ text: { type: "plain_text", text: "Option 1", emoji: true },
392
+ value: "option_1"
393
+ },
394
+ {
395
+ text: { type: "plain_text", text: "Option 2", emoji: true },
396
+ value: "option_2"
397
+ },
398
+ {
399
+ text: { type: "plain_text", text: "Option 3", emoji: true },
400
+ value: "option_3"
401
+ }
402
+ ]
403
+ }
404
+ ]
405
+ })
406
+ },
407
+ {
408
+ id: "actions_radio_buttons",
409
+ label: "Radio buttons",
410
+ factory: () => ({
411
+ type: "actions",
412
+ elements: [
413
+ {
414
+ type: "radio_buttons",
415
+ action_id: "radio_buttons",
416
+ options: [
417
+ {
418
+ text: { type: "plain_text", text: "Option 1", emoji: true },
419
+ value: "option_1"
420
+ },
421
+ {
422
+ text: { type: "plain_text", text: "Option 2", emoji: true },
423
+ value: "option_2"
424
+ },
425
+ {
426
+ text: { type: "plain_text", text: "Option 3", emoji: true },
427
+ value: "option_3"
428
+ }
429
+ ]
430
+ }
431
+ ]
432
+ })
433
+ },
434
+ {
435
+ id: "actions_timepicker",
436
+ label: "Timepicker",
437
+ factory: () => ({
438
+ type: "actions",
439
+ elements: [
440
+ {
441
+ type: "timepicker",
442
+ action_id: "timepicker_only",
443
+ placeholder: {
444
+ type: "plain_text",
445
+ text: "Select a time",
446
+ emoji: true
447
+ }
448
+ }
449
+ ]
450
+ })
451
+ }
452
+ ]
453
+ },
454
+ {
455
+ name: "Input",
456
+ icon: TextCursorInput,
457
+ variants: [
458
+ {
459
+ id: "input_plain_text",
460
+ label: "Plain text",
461
+ factory: () => ({
462
+ type: "input",
463
+ label: { type: "plain_text", text: "Label", emoji: true },
464
+ element: {
465
+ type: "plain_text_input",
466
+ action_id: "plain_text_input",
467
+ placeholder: {
468
+ type: "plain_text",
469
+ text: "Enter some text",
470
+ emoji: true
471
+ }
472
+ }
473
+ })
474
+ },
475
+ {
476
+ id: "input_multiline_text",
477
+ label: "Multiline text",
478
+ factory: () => ({
479
+ type: "input",
480
+ label: { type: "plain_text", text: "Description", emoji: true },
481
+ element: {
482
+ type: "plain_text_input",
483
+ action_id: "plain_text_input_multiline",
484
+ multiline: true,
485
+ placeholder: {
486
+ type: "plain_text",
487
+ text: "Enter a longer description",
488
+ emoji: true
489
+ }
490
+ }
491
+ })
492
+ },
493
+ {
494
+ id: "input_email",
495
+ label: "Email",
496
+ factory: () => ({
497
+ type: "input",
498
+ label: { type: "plain_text", text: "Email address", emoji: true },
499
+ element: {
500
+ type: "email_text_input",
501
+ action_id: "email_text_input",
502
+ placeholder: {
503
+ type: "plain_text",
504
+ text: "name@example.com",
505
+ emoji: true
506
+ }
507
+ }
508
+ })
509
+ },
510
+ {
511
+ id: "input_url",
512
+ label: "URL",
513
+ factory: () => ({
514
+ type: "input",
515
+ label: { type: "plain_text", text: "Website", emoji: true },
516
+ element: {
517
+ type: "url_text_input",
518
+ action_id: "url_text_input",
519
+ placeholder: {
520
+ type: "plain_text",
521
+ text: "https://example.com",
522
+ emoji: true
523
+ }
524
+ }
525
+ })
526
+ },
527
+ {
528
+ id: "input_number",
529
+ label: "Number",
530
+ factory: () => ({
531
+ type: "input",
532
+ label: { type: "plain_text", text: "Quantity", emoji: true },
533
+ element: {
534
+ type: "number_input",
535
+ action_id: "number_input",
536
+ is_decimal_allowed: false,
537
+ placeholder: { type: "plain_text", text: "0", emoji: true }
538
+ }
539
+ })
540
+ },
541
+ {
542
+ id: "input_date",
543
+ label: "Date",
544
+ factory: () => ({
545
+ type: "input",
546
+ label: { type: "plain_text", text: "Pick a date", emoji: true },
547
+ element: {
548
+ type: "datepicker",
549
+ action_id: "datepicker",
550
+ placeholder: {
551
+ type: "plain_text",
552
+ text: "Select a date",
553
+ emoji: true
554
+ }
555
+ }
556
+ })
557
+ },
558
+ {
559
+ id: "input_select",
560
+ label: "Select",
561
+ factory: () => ({
562
+ type: "input",
563
+ label: { type: "plain_text", text: "Pick an option", emoji: true },
564
+ element: {
565
+ type: "static_select",
566
+ action_id: "static_select",
567
+ placeholder: {
568
+ type: "plain_text",
569
+ text: "Choose one",
570
+ emoji: true
571
+ },
572
+ options: [
573
+ {
574
+ text: { type: "plain_text", text: "Option 1", emoji: true },
575
+ value: "option_1"
576
+ },
577
+ {
578
+ text: { type: "plain_text", text: "Option 2", emoji: true },
579
+ value: "option_2"
580
+ },
581
+ {
582
+ text: { type: "plain_text", text: "Option 3", emoji: true },
583
+ value: "option_3"
584
+ }
585
+ ]
586
+ }
587
+ })
588
+ },
589
+ {
590
+ id: "input_rich_text",
591
+ label: "Rich text",
592
+ factory: () => ({
593
+ type: "input",
594
+ label: { type: "plain_text", text: "Description", emoji: true },
595
+ element: {
596
+ type: "rich_text_input",
597
+ action_id: "rich_text_input",
598
+ placeholder: {
599
+ type: "plain_text",
600
+ text: "Type something",
601
+ emoji: true
602
+ }
603
+ }
604
+ })
605
+ },
606
+ {
607
+ id: "input_file",
608
+ label: "File upload",
609
+ factory: () => ({
610
+ type: "input",
611
+ label: { type: "plain_text", text: "Upload a file", emoji: true },
612
+ element: {
613
+ type: "file_input",
614
+ action_id: "file_input",
615
+ max_files: 1
616
+ }
617
+ })
618
+ }
619
+ ]
620
+ },
621
+ {
622
+ name: "Structure",
623
+ icon: LayoutTemplate,
624
+ variants: [
625
+ {
626
+ id: "structure_header",
627
+ label: "Header",
628
+ factory: () => ({
629
+ type: "header",
630
+ text: { type: "plain_text", text: "Heading text", emoji: true }
631
+ })
632
+ },
633
+ {
634
+ id: "structure_divider",
635
+ label: "Divider",
636
+ factory: () => ({ type: "divider" })
637
+ },
638
+ {
639
+ id: "structure_context_plain",
640
+ label: "Context (plain text)",
641
+ factory: () => ({
642
+ type: "context",
643
+ elements: [{ type: "plain_text", text: "Posted by your app", emoji: true }]
644
+ })
645
+ },
646
+ {
647
+ id: "structure_context_mrkdwn",
648
+ label: "Context (mrkdwn)",
649
+ factory: () => ({
650
+ type: "context",
651
+ elements: [{ type: "mrkdwn", text: "Posted by *your app*" }]
652
+ })
653
+ },
654
+ {
655
+ id: "structure_context_text_images",
656
+ label: "Context (text + images)",
657
+ factory: () => ({
658
+ type: "context",
659
+ elements: [
660
+ {
661
+ type: "image",
662
+ image_url: "https://placehold.co/40x40?text=A",
663
+ alt_text: "Avatar"
664
+ },
665
+ { type: "mrkdwn", text: "*Alex* posted in <#general>" }
666
+ ]
667
+ })
668
+ }
669
+ ]
670
+ },
671
+ {
672
+ name: "Alert",
673
+ icon: Bell,
674
+ variants: [
675
+ {
676
+ id: "alert_default",
677
+ label: "Default",
678
+ factory: () => ({
679
+ type: "alert",
680
+ text: {
681
+ type: "mrkdwn",
682
+ text: "A neutral alert message."
683
+ }
684
+ })
685
+ },
686
+ {
687
+ id: "alert_info",
688
+ label: "Info",
689
+ factory: () => ({
690
+ type: "alert",
691
+ level: "info",
692
+ text: {
693
+ type: "mrkdwn",
694
+ text: "FYI: the build finished in 42 seconds."
695
+ }
696
+ })
697
+ },
698
+ {
699
+ id: "alert_warning",
700
+ label: "Warning",
701
+ factory: () => ({
702
+ type: "alert",
703
+ level: "warning",
704
+ text: {
705
+ type: "mrkdwn",
706
+ text: "Heads up: this action cannot be undone."
707
+ }
708
+ })
709
+ },
710
+ {
711
+ id: "alert_error",
712
+ label: "Error",
713
+ factory: () => ({
714
+ type: "alert",
715
+ level: "error",
716
+ text: {
717
+ type: "mrkdwn",
718
+ text: "Something went wrong. Please try again."
719
+ }
720
+ })
721
+ },
722
+ {
723
+ id: "alert_success",
724
+ label: "Success",
725
+ factory: () => ({
726
+ type: "alert",
727
+ level: "success",
728
+ text: {
729
+ type: "mrkdwn",
730
+ text: "Your changes have been saved."
731
+ }
732
+ })
733
+ }
734
+ ]
735
+ },
736
+ {
737
+ name: "Rich Text",
738
+ icon: Pilcrow,
739
+ variants: [
740
+ {
741
+ id: "rich_text_section",
742
+ label: "Section",
743
+ factory: () => ({
744
+ type: "rich_text",
745
+ elements: [
746
+ {
747
+ type: "rich_text_section",
748
+ elements: [
749
+ { type: "text", text: "A rich text " },
750
+ { type: "text", text: "section", style: { bold: true } },
751
+ { type: "text", text: " with inline " },
752
+ { type: "text", text: "styled", style: { italic: true } },
753
+ { type: "text", text: " text." }
754
+ ]
755
+ }
756
+ ]
757
+ })
758
+ }
759
+ ]
760
+ },
761
+ {
762
+ name: "Image",
763
+ icon: Image,
764
+ variants: [
765
+ {
766
+ id: "image_with_title",
767
+ label: "With title",
768
+ factory: () => ({
769
+ type: "image",
770
+ image_url: "https://placehold.co/600x300?text=Image",
771
+ alt_text: "Placeholder image",
772
+ title: { type: "plain_text", text: "Image title", emoji: true }
773
+ })
774
+ },
775
+ {
776
+ id: "image_no_title",
777
+ label: "No title",
778
+ factory: () => ({
779
+ type: "image",
780
+ image_url: "https://placehold.co/600x300?text=Image",
781
+ alt_text: "Placeholder image"
782
+ })
783
+ }
784
+ ]
785
+ },
786
+ {
787
+ name: "Video",
788
+ icon: Video,
789
+ variants: [
790
+ {
791
+ id: "video_basic",
792
+ label: "Basic",
793
+ factory: () => ({
794
+ type: "video",
795
+ alt_text: "A short demo video",
796
+ title: { type: "plain_text", text: "Product demo", emoji: true },
797
+ thumbnail_url: "https://placehold.co/600x340?text=Video",
798
+ video_url: "https://www.youtube.com/embed/dQw4w9WgXcQ"
799
+ })
800
+ },
801
+ {
802
+ id: "video_with_metadata",
803
+ label: "With metadata",
804
+ factory: () => ({
805
+ type: "video",
806
+ alt_text: "A short demo video",
807
+ title: { type: "plain_text", text: "Product demo", emoji: true },
808
+ title_url: "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
809
+ thumbnail_url: "https://placehold.co/600x340?text=Video",
810
+ video_url: "https://www.youtube.com/embed/dQw4w9WgXcQ",
811
+ author_name: "Acme",
812
+ description: {
813
+ type: "plain_text",
814
+ text: "A short walkthrough of the new release.",
815
+ emoji: true
816
+ },
817
+ provider_name: "YouTube",
818
+ provider_icon_url: "https://placehold.co/16x16?text=YT"
819
+ })
820
+ }
821
+ ]
822
+ },
823
+ {
824
+ name: "Card and Carousel",
825
+ icon: GalleryHorizontal,
826
+ variants: [
827
+ {
828
+ id: "card_basic",
829
+ label: "Card",
830
+ factory: () => ({
831
+ type: "card",
832
+ icon: {
833
+ type: "image",
834
+ image_url: "https://placehold.co/36x36?text=Icon",
835
+ alt_text: "Card icon"
836
+ },
837
+ title: { type: "mrkdwn", text: "Card title" },
838
+ subtitle: { type: "mrkdwn", text: "Card subtitle" },
839
+ body: {
840
+ type: "mrkdwn",
841
+ text: "A short description of what this card is about."
842
+ }
843
+ })
844
+ },
845
+ {
846
+ id: "card_with_hero",
847
+ label: "Card with hero image",
848
+ factory: () => ({
849
+ type: "card",
850
+ hero_image: {
851
+ type: "image",
852
+ image_url: "https://placehold.co/400x200?text=Hero",
853
+ alt_text: "Card hero image"
854
+ },
855
+ title: { type: "mrkdwn", text: "Card title" },
856
+ body: {
857
+ type: "mrkdwn",
858
+ text: "A short description of what this card is about."
859
+ }
860
+ })
861
+ },
862
+ {
863
+ id: "card_with_actions",
864
+ label: "Card with actions",
865
+ factory: () => ({
866
+ type: "card",
867
+ title: { type: "mrkdwn", text: "Card title" },
868
+ body: {
869
+ type: "mrkdwn",
870
+ text: "A short description of what this card is about."
871
+ },
872
+ actions: [
873
+ {
874
+ type: "button",
875
+ text: { type: "plain_text", text: "Open", emoji: true },
876
+ action_id: "card_action_1"
877
+ }
878
+ ]
879
+ })
880
+ },
881
+ {
882
+ id: "carousel_basic",
883
+ label: "Carousel",
884
+ factory: () => ({
885
+ type: "carousel",
886
+ elements: [
887
+ {
888
+ type: "card",
889
+ title: { type: "mrkdwn", text: "Card 1" },
890
+ body: { type: "mrkdwn", text: "First card in the carousel." }
891
+ },
892
+ {
893
+ type: "card",
894
+ title: { type: "mrkdwn", text: "Card 2" },
895
+ body: { type: "mrkdwn", text: "Second card in the carousel." }
896
+ },
897
+ {
898
+ type: "card",
899
+ title: { type: "mrkdwn", text: "Card 3" },
900
+ body: { type: "mrkdwn", text: "Third card in the carousel." }
901
+ }
902
+ ]
903
+ })
904
+ }
905
+ ]
906
+ },
907
+ {
908
+ name: "Table",
909
+ icon: Table,
910
+ variants: [
911
+ {
912
+ id: "table_simple",
913
+ label: "Simple table",
914
+ factory: () => ({
915
+ type: "table",
916
+ rows: [
917
+ [
918
+ { type: "raw_text", text: "Header 1" },
919
+ { type: "raw_text", text: "Header 2" },
920
+ { type: "raw_text", text: "Header 3" }
921
+ ],
922
+ [
923
+ { type: "raw_text", text: "Row 1, A" },
924
+ { type: "raw_text", text: "Row 1, B" },
925
+ { type: "raw_text", text: "Row 1, C" }
926
+ ],
927
+ [
928
+ { type: "raw_text", text: "Row 2, A" },
929
+ { type: "raw_text", text: "Row 2, B" },
930
+ { type: "raw_text", text: "Row 2, C" }
931
+ ]
932
+ ]
933
+ })
934
+ }
935
+ ]
936
+ }
937
+ ];
938
+ var legacyInputVariants = [
939
+ {
940
+ id: "input_plain_text",
941
+ label: "plain text",
942
+ factory: () => ({
943
+ type: "input",
944
+ label: { type: "plain_text", text: "Label", emoji: true },
945
+ element: {
946
+ type: "plain_text_input",
947
+ action_id: "plain_text_input",
948
+ placeholder: {
949
+ type: "plain_text",
950
+ text: "Enter some text",
951
+ emoji: true
952
+ }
953
+ }
954
+ })
955
+ },
956
+ {
957
+ id: "input_multiline_text",
958
+ label: "multiline text",
959
+ factory: () => ({
960
+ type: "input",
961
+ label: { type: "plain_text", text: "Description", emoji: true },
962
+ element: {
963
+ type: "plain_text_input",
964
+ action_id: "plain_text_input_multiline",
965
+ multiline: true,
966
+ placeholder: {
967
+ type: "plain_text",
968
+ text: "Enter a longer description",
969
+ emoji: true
970
+ }
971
+ }
972
+ })
973
+ },
974
+ {
975
+ id: "input_email",
976
+ label: "email",
977
+ factory: () => ({
978
+ type: "input",
979
+ label: { type: "plain_text", text: "Email address", emoji: true },
980
+ element: {
981
+ type: "email_text_input",
982
+ action_id: "email_text_input",
983
+ placeholder: {
984
+ type: "plain_text",
985
+ text: "name@example.com",
986
+ emoji: true
987
+ }
988
+ }
989
+ })
990
+ },
991
+ {
992
+ id: "input_url",
993
+ label: "url",
994
+ factory: () => ({
995
+ type: "input",
996
+ label: { type: "plain_text", text: "Website", emoji: true },
997
+ element: {
998
+ type: "url_text_input",
999
+ action_id: "url_text_input",
1000
+ placeholder: {
1001
+ type: "plain_text",
1002
+ text: "https://example.com",
1003
+ emoji: true
1004
+ }
1005
+ }
1006
+ })
1007
+ },
1008
+ {
1009
+ id: "input_number",
1010
+ label: "number",
1011
+ factory: () => ({
1012
+ type: "input",
1013
+ label: { type: "plain_text", text: "Quantity", emoji: true },
1014
+ element: {
1015
+ type: "number_input",
1016
+ action_id: "number_input",
1017
+ is_decimal_allowed: false,
1018
+ placeholder: { type: "plain_text", text: "0", emoji: true }
1019
+ }
1020
+ })
1021
+ },
1022
+ {
1023
+ id: "input_date",
1024
+ label: "date",
1025
+ factory: () => ({
1026
+ type: "input",
1027
+ label: { type: "plain_text", text: "Pick a date", emoji: true },
1028
+ element: {
1029
+ type: "datepicker",
1030
+ action_id: "datepicker",
1031
+ placeholder: {
1032
+ type: "plain_text",
1033
+ text: "Select a date",
1034
+ emoji: true
1035
+ }
1036
+ }
1037
+ })
1038
+ },
1039
+ {
1040
+ id: "input_time",
1041
+ label: "time",
1042
+ factory: () => ({
1043
+ type: "input",
1044
+ label: { type: "plain_text", text: "Pick a time", emoji: true },
1045
+ element: {
1046
+ type: "timepicker",
1047
+ action_id: "timepicker",
1048
+ placeholder: {
1049
+ type: "plain_text",
1050
+ text: "Select a time",
1051
+ emoji: true
1052
+ }
1053
+ }
1054
+ })
1055
+ },
1056
+ {
1057
+ id: "input_datetime",
1058
+ label: "date and time",
1059
+ factory: () => ({
1060
+ type: "input",
1061
+ label: {
1062
+ type: "plain_text",
1063
+ text: "Pick a date and time",
1064
+ emoji: true
1065
+ },
1066
+ element: {
1067
+ type: "datetimepicker",
1068
+ action_id: "datetimepicker"
1069
+ }
1070
+ })
1071
+ },
1072
+ {
1073
+ id: "input_static_select",
1074
+ label: "select",
1075
+ factory: () => ({
1076
+ type: "input",
1077
+ label: { type: "plain_text", text: "Pick an option", emoji: true },
1078
+ element: {
1079
+ type: "static_select",
1080
+ action_id: "static_select",
1081
+ placeholder: {
1082
+ type: "plain_text",
1083
+ text: "Choose one",
1084
+ emoji: true
1085
+ },
1086
+ options: [
1087
+ {
1088
+ text: { type: "plain_text", text: "Option 1", emoji: true },
1089
+ value: "option_1"
1090
+ },
1091
+ {
1092
+ text: { type: "plain_text", text: "Option 2", emoji: true },
1093
+ value: "option_2"
1094
+ },
1095
+ {
1096
+ text: { type: "plain_text", text: "Option 3", emoji: true },
1097
+ value: "option_3"
1098
+ }
1099
+ ]
1100
+ }
1101
+ })
1102
+ },
1103
+ {
1104
+ id: "input_multi_static_select",
1105
+ label: "multi-select",
1106
+ factory: () => ({
1107
+ type: "input",
1108
+ label: { type: "plain_text", text: "Pick options", emoji: true },
1109
+ element: {
1110
+ type: "multi_static_select",
1111
+ action_id: "multi_static_select",
1112
+ placeholder: {
1113
+ type: "plain_text",
1114
+ text: "Choose one or more",
1115
+ emoji: true
1116
+ },
1117
+ options: [
1118
+ {
1119
+ text: { type: "plain_text", text: "Option 1", emoji: true },
1120
+ value: "option_1"
1121
+ },
1122
+ {
1123
+ text: { type: "plain_text", text: "Option 2", emoji: true },
1124
+ value: "option_2"
1125
+ },
1126
+ {
1127
+ text: { type: "plain_text", text: "Option 3", emoji: true },
1128
+ value: "option_3"
1129
+ }
1130
+ ]
1131
+ }
1132
+ })
1133
+ },
1134
+ {
1135
+ id: "input_users_select",
1136
+ label: "users select",
1137
+ factory: () => ({
1138
+ type: "input",
1139
+ label: { type: "plain_text", text: "Pick a user", emoji: true },
1140
+ element: {
1141
+ type: "users_select",
1142
+ action_id: "users_select",
1143
+ placeholder: {
1144
+ type: "plain_text",
1145
+ text: "Select a user",
1146
+ emoji: true
1147
+ }
1148
+ }
1149
+ })
1150
+ },
1151
+ {
1152
+ id: "input_multi_users_select",
1153
+ label: "multi users select",
1154
+ factory: () => ({
1155
+ type: "input",
1156
+ label: { type: "plain_text", text: "Pick users", emoji: true },
1157
+ element: {
1158
+ type: "multi_users_select",
1159
+ action_id: "multi_users_select",
1160
+ placeholder: {
1161
+ type: "plain_text",
1162
+ text: "Select users",
1163
+ emoji: true
1164
+ }
1165
+ }
1166
+ })
1167
+ },
1168
+ {
1169
+ id: "input_channels_select",
1170
+ label: "channels select",
1171
+ factory: () => ({
1172
+ type: "input",
1173
+ label: { type: "plain_text", text: "Pick a channel", emoji: true },
1174
+ element: {
1175
+ type: "channels_select",
1176
+ action_id: "channels_select",
1177
+ placeholder: {
1178
+ type: "plain_text",
1179
+ text: "Select a channel",
1180
+ emoji: true
1181
+ }
1182
+ }
1183
+ })
1184
+ },
1185
+ {
1186
+ id: "input_multi_channels_select",
1187
+ label: "multi channels select",
1188
+ factory: () => ({
1189
+ type: "input",
1190
+ label: { type: "plain_text", text: "Pick channels", emoji: true },
1191
+ element: {
1192
+ type: "multi_channels_select",
1193
+ action_id: "multi_channels_select",
1194
+ placeholder: {
1195
+ type: "plain_text",
1196
+ text: "Select channels",
1197
+ emoji: true
1198
+ }
1199
+ }
1200
+ })
1201
+ },
1202
+ {
1203
+ id: "input_conversations_select",
1204
+ label: "conversations select",
1205
+ factory: () => ({
1206
+ type: "input",
1207
+ label: {
1208
+ type: "plain_text",
1209
+ text: "Pick a conversation",
1210
+ emoji: true
1211
+ },
1212
+ element: {
1213
+ type: "conversations_select",
1214
+ action_id: "conversations_select",
1215
+ placeholder: {
1216
+ type: "plain_text",
1217
+ text: "Select a conversation",
1218
+ emoji: true
1219
+ }
1220
+ }
1221
+ })
1222
+ },
1223
+ {
1224
+ id: "input_multi_conversations_select",
1225
+ label: "multi conversations select",
1226
+ factory: () => ({
1227
+ type: "input",
1228
+ label: {
1229
+ type: "plain_text",
1230
+ text: "Pick conversations",
1231
+ emoji: true
1232
+ },
1233
+ element: {
1234
+ type: "multi_conversations_select",
1235
+ action_id: "multi_conversations_select",
1236
+ placeholder: {
1237
+ type: "plain_text",
1238
+ text: "Select conversations",
1239
+ emoji: true
1240
+ }
1241
+ }
1242
+ })
1243
+ },
1244
+ {
1245
+ id: "input_external_select",
1246
+ label: "external select",
1247
+ factory: () => ({
1248
+ type: "input",
1249
+ label: { type: "plain_text", text: "Pick an option", emoji: true },
1250
+ element: {
1251
+ type: "external_select",
1252
+ action_id: "external_select",
1253
+ placeholder: {
1254
+ type: "plain_text",
1255
+ text: "Choose one",
1256
+ emoji: true
1257
+ },
1258
+ min_query_length: 0
1259
+ }
1260
+ })
1261
+ },
1262
+ {
1263
+ id: "input_multi_external_select",
1264
+ label: "multi external select",
1265
+ factory: () => ({
1266
+ type: "input",
1267
+ label: { type: "plain_text", text: "Pick options", emoji: true },
1268
+ element: {
1269
+ type: "multi_external_select",
1270
+ action_id: "multi_external_select",
1271
+ placeholder: {
1272
+ type: "plain_text",
1273
+ text: "Choose one or more",
1274
+ emoji: true
1275
+ },
1276
+ min_query_length: 0
1277
+ }
1278
+ })
1279
+ },
1280
+ {
1281
+ id: "input_radio_buttons",
1282
+ label: "radio buttons",
1283
+ factory: () => ({
1284
+ type: "input",
1285
+ label: { type: "plain_text", text: "Pick one", emoji: true },
1286
+ element: {
1287
+ type: "radio_buttons",
1288
+ action_id: "radio_buttons",
1289
+ options: [
1290
+ {
1291
+ text: { type: "plain_text", text: "Option 1", emoji: true },
1292
+ value: "option_1"
1293
+ },
1294
+ {
1295
+ text: { type: "plain_text", text: "Option 2", emoji: true },
1296
+ value: "option_2"
1297
+ },
1298
+ {
1299
+ text: { type: "plain_text", text: "Option 3", emoji: true },
1300
+ value: "option_3"
1301
+ }
1302
+ ]
1303
+ }
1304
+ })
1305
+ },
1306
+ {
1307
+ id: "input_checkboxes",
1308
+ label: "checkboxes",
1309
+ factory: () => ({
1310
+ type: "input",
1311
+ label: { type: "plain_text", text: "Pick any", emoji: true },
1312
+ element: {
1313
+ type: "checkboxes",
1314
+ action_id: "checkboxes",
1315
+ options: [
1316
+ {
1317
+ text: { type: "plain_text", text: "Option 1", emoji: true },
1318
+ value: "option_1"
1319
+ },
1320
+ {
1321
+ text: { type: "plain_text", text: "Option 2", emoji: true },
1322
+ value: "option_2"
1323
+ },
1324
+ {
1325
+ text: { type: "plain_text", text: "Option 3", emoji: true },
1326
+ value: "option_3"
1327
+ }
1328
+ ]
1329
+ }
1330
+ })
1331
+ },
1332
+ {
1333
+ id: "input_rich_text",
1334
+ label: "rich text input",
1335
+ factory: () => ({
1336
+ type: "input",
1337
+ label: { type: "plain_text", text: "Description", emoji: true },
1338
+ element: {
1339
+ type: "rich_text_input",
1340
+ action_id: "rich_text_input",
1341
+ placeholder: {
1342
+ type: "plain_text",
1343
+ text: "Type something",
1344
+ emoji: true
1345
+ }
1346
+ }
1347
+ })
1348
+ },
1349
+ {
1350
+ id: "input_file",
1351
+ label: "file upload",
1352
+ factory: () => ({
1353
+ type: "input",
1354
+ label: { type: "plain_text", text: "Upload a file", emoji: true },
1355
+ element: {
1356
+ type: "file_input",
1357
+ action_id: "file_input",
1358
+ max_files: 1
1359
+ }
1360
+ })
1361
+ }
1362
+ ];
1363
+ var extraAlertVariant = {
1364
+ id: "alert_warning",
1365
+ label: "Warning",
1366
+ factory: () => ({
1367
+ type: "alert",
1368
+ level: "warning",
1369
+ text: {
1370
+ type: "mrkdwn",
1371
+ text: "Heads up: this action cannot be undone."
1372
+ }
1373
+ })
1374
+ };
1375
+ function buildVariantById(sections) {
1376
+ return new Map(sections.flatMap((section) => section.variants.map((v) => [v.id, v])));
1377
+ }
1378
+
1379
+ export { buildVariantById, defaultPalette, extraAlertVariant, legacyInputVariants };
1380
+ //# sourceMappingURL=palette.js.map
1381
+ //# sourceMappingURL=palette.js.map