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