block.json
138 lines
| 1 | { |
| 2 | "name": "kubio/link", |
| 3 | "category": "kubio-basic", |
| 4 | "attributes": { |
| 5 | "kubio": { |
| 6 | "type": "object" |
| 7 | }, |
| 8 | "text": { |
| 9 | "type": "string", |
| 10 | "source": "html", |
| 11 | "default": "this is a link" |
| 12 | }, |
| 13 | "link": { |
| 14 | "type": "object", |
| 15 | "default": { |
| 16 | "typeOpenLink": "sameWindow" |
| 17 | } |
| 18 | }, |
| 19 | "preserveSpace": { |
| 20 | "type": "object" |
| 21 | }, |
| 22 | "icon": { |
| 23 | "type": "object", |
| 24 | "default": { |
| 25 | "name": "" |
| 26 | } |
| 27 | } |
| 28 | }, |
| 29 | "supports": { |
| 30 | "anchor": true, |
| 31 | "kubio": { |
| 32 | "appearanceEffect": true, |
| 33 | "default": { |
| 34 | "props": { |
| 35 | "showIcon": false, |
| 36 | "iconPosition": "before" |
| 37 | }, |
| 38 | "style": { |
| 39 | "descendants": { |
| 40 | "icon": { |
| 41 | "size": { |
| 42 | "value": 16 |
| 43 | }, |
| 44 | "margin": { |
| 45 | "left": { |
| 46 | "value": 10 |
| 47 | }, |
| 48 | "right": { |
| 49 | "value": 10 |
| 50 | } |
| 51 | } |
| 52 | } |
| 53 | } |
| 54 | } |
| 55 | }, |
| 56 | "elementsEnum": { |
| 57 | "OUTER": "outer", |
| 58 | "LINK": "link", |
| 59 | "ICON": "icon", |
| 60 | "TEXT": "text" |
| 61 | }, |
| 62 | "elementsByName": { |
| 63 | "outer": { |
| 64 | "wrapper": true, |
| 65 | "props": { |
| 66 | "tag": "span" |
| 67 | } |
| 68 | }, |
| 69 | "link": { |
| 70 | "default": true, |
| 71 | "prefixWithTag": true, |
| 72 | "props": { |
| 73 | "tag": "a", |
| 74 | "className": [ |
| 75 | "h-w-100", |
| 76 | "h-global-transition" |
| 77 | ] |
| 78 | } |
| 79 | }, |
| 80 | "text": { |
| 81 | "props": { |
| 82 | "tag": "span", |
| 83 | "className": [ |
| 84 | "kubio-inherit-typography" |
| 85 | ] |
| 86 | } |
| 87 | }, |
| 88 | "icon": { |
| 89 | "props": { |
| 90 | "tag": "icon" |
| 91 | }, |
| 92 | "statesConfig": { |
| 93 | "default": { |
| 94 | "stateRedirectElement": "link" |
| 95 | } |
| 96 | } |
| 97 | } |
| 98 | }, |
| 99 | "template": { |
| 100 | "type": "element", |
| 101 | "props": { |
| 102 | "name": "outer" |
| 103 | }, |
| 104 | "children": [ |
| 105 | { |
| 106 | "type": "element", |
| 107 | "props": { |
| 108 | "name": "link" |
| 109 | }, |
| 110 | "children": [ |
| 111 | { |
| 112 | "type": "element", |
| 113 | "props": { |
| 114 | "name": "icon", |
| 115 | "shouldRender": "computed.showBeforeIcon" |
| 116 | } |
| 117 | }, |
| 118 | { |
| 119 | "type": "element", |
| 120 | "props": { |
| 121 | "name": "text" |
| 122 | } |
| 123 | }, |
| 124 | { |
| 125 | "type": "element", |
| 126 | "props": { |
| 127 | "name": "icon", |
| 128 | "shouldRender": "computed.showAfterIcon" |
| 129 | } |
| 130 | } |
| 131 | ] |
| 132 | } |
| 133 | ] |
| 134 | } |
| 135 | } |
| 136 | } |
| 137 | } |
| 138 |