|
| 1 | +import { |
| 2 | + FLUID_VARIATION, |
| 3 | + DISABLED_STATE, |
| 4 | + HOVER_STATE, |
| 5 | +} from '@semantic-ui/specs'; |
| 6 | + |
| 7 | +export default { |
| 8 | + uiType: 'element', |
| 9 | + name: 'Card', |
| 10 | + description: 'A card displays segmented content in a manner similar to a playing card.', |
| 11 | + tagName: 'ui-card', |
| 12 | + exportName: 'UICard', |
| 13 | + exampleCode: `<ui-card image="/images/new-avatar/dima2.png"> |
| 14 | + <div slot="header">Dima B</div> |
| 15 | + <div slot="subheader">Software Engineer</div> |
| 16 | + <div slot="description">Dima has strong opinions about button padding and the perfect shade of blue.</div> |
| 17 | +</ui-card>`, |
| 18 | + content: [ |
| 19 | + { |
| 20 | + name: 'Icon', |
| 21 | + includeAttributeClass: true, |
| 22 | + attribute: 'icon', |
| 23 | + couplesWith: ['ui-icon'], |
| 24 | + description: 'include an icon', |
| 25 | + exampleCode: `<ui-card icon="pause"></ui-card> |
| 26 | +<ui-card> |
| 27 | + <ui-icon pause slot="icon"></ui-icon> |
| 28 | +</ui-card>`, |
| 29 | + }, |
| 30 | + { |
| 31 | + name: 'Header', |
| 32 | + attribute: 'header', |
| 33 | + description: 'include an header', |
| 34 | + exampleCode: `<ui-card header="Header"></ui-card> |
| 35 | +<ui-card> |
| 36 | + <div class="header">Header</div> |
| 37 | +</ui-card> |
| 38 | +<ui-card> |
| 39 | + <div slot="header">Header</div> |
| 40 | +</ui-card>`, |
| 41 | + }, |
| 42 | + { |
| 43 | + name: 'Description', |
| 44 | + attribute: 'description', |
| 45 | + description: 'include a description', |
| 46 | + exampleCode: `<ui-card description="Description"></ui-card> |
| 47 | +<ui-card> |
| 48 | + <div class="description">Description</div> |
| 49 | +</ui-card> |
| 50 | +<ui-card> |
| 51 | + <div slot="description">Description</div> |
| 52 | +</ui-card>`, |
| 53 | + }, |
| 54 | + { |
| 55 | + name: 'Subheader', |
| 56 | + attribute: 'subheader', |
| 57 | + description: 'include an subheader', |
| 58 | + exampleCode: `<ui-card header="Header" subheader="Subheader"></ui-card> |
| 59 | +<ui-card> |
| 60 | + <div class="header">Header</div> |
| 61 | + <div class="subheader">Subheader</div> |
| 62 | +</ui-card> |
| 63 | +<ui-card> |
| 64 | + <div slot="header">Header</div> |
| 65 | + <div slot="subheader">Subheader</div> |
| 66 | +</ui-card>`, |
| 67 | + }, |
| 68 | + { |
| 69 | + name: 'Image', |
| 70 | + attribute: 'image', |
| 71 | + couplesWith: ['ui-image'], |
| 72 | + description: 'include an image', |
| 73 | + exampleCode: `<ui-card image="/images/avatar/jenny.jpg">Get started with your new card.</ui-card>`, |
| 74 | + }, |
| 75 | + ], |
| 76 | + types: [], |
| 77 | + states: [ |
| 78 | + HOVER_STATE, |
| 79 | + { |
| 80 | + name: 'Focus', |
| 81 | + attribute: 'focused', |
| 82 | + description: 'be focused by the keyboard', |
| 83 | + }, |
| 84 | + DISABLED_STATE, |
| 85 | + ], |
| 86 | + variations: [ |
| 87 | + FLUID_VARIATION, |
| 88 | + { |
| 89 | + name: 'Link', |
| 90 | + attribute: 'link', |
| 91 | + usageLevel: 1, |
| 92 | + description: 'can be formatted as if the card can be clicked', |
| 93 | + }, |
| 94 | + { |
| 95 | + name: 'Horizontal', |
| 96 | + attribute: 'horizontal', |
| 97 | + usageLevel: 1, |
| 98 | + description: 'can have content horizontally oriented', |
| 99 | + exampleCode: `<ui-card horizontal image="/images/avatar/jenny.jpg">Get started with your new card.</ui-card>`, |
| 100 | + }, |
| 101 | + ], |
| 102 | + settings: [ |
| 103 | + { |
| 104 | + name: 'Href', |
| 105 | + type: 'string', |
| 106 | + attribute: 'href', |
| 107 | + description: 'link to a url', |
| 108 | + }, |
| 109 | + ], |
| 110 | + supportsPlural: true, |
| 111 | + pluralName: 'Cards', |
| 112 | + pluralTagName: 'ui-cards', |
| 113 | + pluralExportName: 'UICards', |
| 114 | + pluralDescription: 'Cards can exist together as a group', |
| 115 | + pluralContent: [], |
| 116 | + pluralSharedTypes: ['link'], |
| 117 | + pluralOnlyTypes: [], |
| 118 | + pluralOnlyVariations: [ |
| 119 | + { |
| 120 | + name: 'doubling', |
| 121 | + attribute: 'doubling', |
| 122 | + description: 'A group of cards can double its column width for mobile', |
| 123 | + usageLevel: 3, |
| 124 | + }, |
| 125 | + { |
| 126 | + name: 'stackable', |
| 127 | + attribute: 'stackable', |
| 128 | + description: 'A group of cards can automatically stack rows to a single columns on mobile devices', |
| 129 | + usageLevel: 3, |
| 130 | + }, |
| 131 | + { |
| 132 | + name: 'Spaced', |
| 133 | + attribute: 'spaced', |
| 134 | + description: 'A group of cards can adjust its spacing', |
| 135 | + usageLevel: 2, |
| 136 | + options: [ |
| 137 | + { |
| 138 | + name: 'Spaced', |
| 139 | + value: 'spaced', |
| 140 | + description: 'A card group have increased spacing', |
| 141 | + }, |
| 142 | + { |
| 143 | + name: 'Three', |
| 144 | + value: 'very-spaced', |
| 145 | + description: 'A card group can have very increased spacing', |
| 146 | + }, |
| 147 | + ], |
| 148 | + }, |
| 149 | + { |
| 150 | + name: 'Count', |
| 151 | + attribute: 'count', |
| 152 | + description: 'A group of cards can set how many cards should exist in a row', |
| 153 | + usageLevel: 3, |
| 154 | + options: [ |
| 155 | + { |
| 156 | + name: 'Two', |
| 157 | + value: 'two', |
| 158 | + description: 'A card group can have two items per row', |
| 159 | + }, |
| 160 | + { |
| 161 | + name: 'Three', |
| 162 | + value: 'three', |
| 163 | + description: 'A card group can have three items per row', |
| 164 | + }, |
| 165 | + { |
| 166 | + name: 'Four', |
| 167 | + value: 'four', |
| 168 | + description: 'A card group can have four items per row', |
| 169 | + }, |
| 170 | + { |
| 171 | + name: 'Five', |
| 172 | + value: 'five', |
| 173 | + description: 'A card group can have five items per row', |
| 174 | + }, |
| 175 | + { |
| 176 | + name: 'Six', |
| 177 | + value: 'six', |
| 178 | + description: 'A card group can have six items per row', |
| 179 | + }, |
| 180 | + ], |
| 181 | + }, |
| 182 | + ], |
| 183 | + pluralSharedVariations: [], |
| 184 | +}; |
0 commit comments