|
| 1 | +<template> |
| 2 | + <Wrapper feature="Suggestion" :rows="rows"> |
| 3 | + <template #default> |
| 4 | + <button class="xds:suggestion xds:w-30"> |
| 5 | + <CuratedIcon class="xds:icon" /> |
| 6 | + very long default suggestion to test line wrap alignment |
| 7 | + </button> |
| 8 | + </template> |
| 9 | + <template #color> |
| 10 | + <button class="xds:suggestion"> |
| 11 | + <CuratedIcon class="xds:icon" /> |
| 12 | + suggestion |
| 13 | + </button> |
| 14 | + <button v-for="(value, key) in colors" :key="key" class="xds:suggestion" :class="value"> |
| 15 | + <CuratedIcon class="xds:icon" /> |
| 16 | + {{ cleanedValue(value) }} suggestion |
| 17 | + </button> |
| 18 | + </template> |
| 19 | + <template #size> |
| 20 | + <button |
| 21 | + v-for="size in ['xds:suggestion-sm', 'xds:suggestion-md', 'xds:suggestion-lg']" |
| 22 | + :key="size" |
| 23 | + class="xds:suggestion" |
| 24 | + :class="size" |
| 25 | + > |
| 26 | + <CuratedIcon class="xds:icon" /> |
| 27 | + {{ cleanedValue(size) }} suggestion |
| 28 | + </button> |
| 29 | + </template> |
| 30 | + <template #outlined> |
| 31 | + <button class="xds:suggestion xds:suggestion-outlined"> |
| 32 | + <CuratedIcon class="xds:icon" /> |
| 33 | + outlined suggestion |
| 34 | + </button> |
| 35 | + <button |
| 36 | + v-for="(value, key) in colors" |
| 37 | + :key="key" |
| 38 | + class="xds:suggestion xds:suggestion-outlined" |
| 39 | + :class="value" |
| 40 | + > |
| 41 | + <CuratedIcon class="xds:icon" /> |
| 42 | + outlined {{ cleanedValue(value) }} suggestion |
| 43 | + </button> |
| 44 | + </template> |
| 45 | + <template #outlined-size> |
| 46 | + <button |
| 47 | + v-for="size in ['xds:suggestion-sm', 'xds:suggestion-md', 'xds:suggestion-lg']" |
| 48 | + :key="size" |
| 49 | + class="xds:suggestion xds:suggestion-outlined" |
| 50 | + :class="size" |
| 51 | + > |
| 52 | + <CuratedIcon class="xds:icon" /> |
| 53 | + outlined {{ cleanedValue(size) }} suggestion |
| 54 | + </button> |
| 55 | + </template> |
| 56 | + <template #ghost> |
| 57 | + <button class="xds:suggestion xds:suggestion-ghost"> |
| 58 | + <CuratedIcon class="xds:icon" /> |
| 59 | + ghost suggestion |
| 60 | + </button> |
| 61 | + <button |
| 62 | + v-for="(value, key) in colors" |
| 63 | + :key="key" |
| 64 | + class="xds:suggestion xds:suggestion-ghost" |
| 65 | + :class="value" |
| 66 | + > |
| 67 | + <CuratedIcon class="xds:icon" /> |
| 68 | + ghost {{ cleanedValue(value) }} suggestion |
| 69 | + </button> |
| 70 | + </template> |
| 71 | + <template #ghost-size> |
| 72 | + <button |
| 73 | + v-for="size in ['xds:suggestion-sm', 'xds:suggestion-md', 'xds:suggestion-lg']" |
| 74 | + :key="size" |
| 75 | + class="xds:suggestion xds:suggestion-ghost" |
| 76 | + :class="size" |
| 77 | + > |
| 78 | + <CuratedIcon class="xds:icon" /> |
| 79 | + ghost {{ cleanedValue(size) }} suggestion |
| 80 | + </button> |
| 81 | + </template> |
| 82 | + <template #combinations> |
| 83 | + <button class="xds:suggestion xds:suggestion-success xds:suggestion-md"> |
| 84 | + <CuratedIcon class="xds:icon" /> |
| 85 | + success md suggestion |
| 86 | + </button> |
| 87 | + <button class="xds:suggestion xds:suggestion-auxiliary xds:suggestion-md"> |
| 88 | + <CuratedIcon class="xds:icon" /> |
| 89 | + auxiliary md suggestion |
| 90 | + </button> |
| 91 | + <button class="xds:suggestion xds:suggestion-error xds:suggestion-lg"> |
| 92 | + <CuratedIcon class="xds:icon" /> |
| 93 | + error lg suggestion |
| 94 | + </button> |
| 95 | + </template> |
| 96 | + </Wrapper> |
| 97 | +</template> |
| 98 | + |
| 99 | +<script setup lang="ts"> |
| 100 | +import CuratedIcon from './icons/curated.svg' |
| 101 | +import Wrapper from './wrapper.vue' |
| 102 | +
|
| 103 | +const rows = [ |
| 104 | + 'default', |
| 105 | + 'color', |
| 106 | + 'size', |
| 107 | + 'outlined', |
| 108 | + 'outlined-size', |
| 109 | + 'ghost', |
| 110 | + 'ghost-size', |
| 111 | + 'combinations', |
| 112 | +] |
| 113 | +const colors = { |
| 114 | + neutral: 'xds:suggestion-neutral', |
| 115 | + lead: 'xds:suggestion-lead', |
| 116 | + auxiliary: 'xds:suggestion-auxiliary', |
| 117 | + accent: 'xds:suggestion-accent', |
| 118 | + highlight: 'xds:suggestion-highlight', |
| 119 | + success: 'xds:suggestion-success', |
| 120 | + warning: 'xds:suggestion-warning', |
| 121 | + error: 'xds:suggestion-error', |
| 122 | +} |
| 123 | +
|
| 124 | +const cleanedValue = (value: string) => value.replace(/^xds:suggestion-/, '') |
| 125 | +</script> |
0 commit comments