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