your personal website on atproto - mirror
blento.app
1import type { CardDefinition } from '../types';
2import ButtonCard from './ButtonCard.svelte';
3import EditingButtonCard from './EditingButtonCard.svelte';
4import ButtonCardSettings from './ButtonCardSettings.svelte';
5
6export const ButtonCardDefinition: CardDefinition = {
7 type: 'button',
8 contentComponent: ButtonCard,
9 editingContentComponent: EditingButtonCard,
10 settingsComponent: ButtonCardSettings,
11 sidebarButtonText: 'Button',
12
13 createNew: (card) => {
14 card.cardData = {
15 text: 'Click me'
16 };
17 card.w = 2;
18 card.h = 1;
19 card.mobileW = 4;
20 card.mobileH = 2;
21 },
22
23 defaultColor: 'transparent',
24 allowSetColor: true,
25 canHaveLabel: false,
26
27 minW: 2,
28 minH: 1,
29 maxW: 8,
30 maxH: 4,
31
32 groups: ['Utilities'],
33 name: 'Button',
34 icon: `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" class="size-4"><path stroke-linecap="round" stroke-linejoin="round" d="M15.042 21.672 13.684 16.6m0 0-2.51 2.225.569-9.47 5.227 7.917-3.286-.672ZM12 2.25V4.5m5.834.166-1.591 1.591M20.25 10.5H18M7.757 14.743l-1.59 1.59M6 10.5H3.75m4.007-4.243-1.59-1.59" /></svg>`
35
36};