Skip to content

Commit

Permalink
Adds vue-svg-loader to showcase and refactors the system card svgs to…
Browse files Browse the repository at this point in the history
… sit on a 100x100 bounding box so they are consistent
  • Loading branch information
roblevintennis committed Sep 25, 2020
1 parent 08d0286 commit 6c5610b
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 105 deletions.
1 change: 1 addition & 0 deletions agnosticui-vue/package.json
Expand Up @@ -46,6 +46,7 @@
"vue-jest": "^3.0.6",
"vue-loader": "^15.9.3",
"vue-style-loader": "^4.1.2",
"vue-svg-loader": "^0.17.0-beta.2",
"vue-template-compiler": "^2.6.12",
"vue-test-utils": "^1.0.0-beta.11",
"webpack": "^4.44.1",
Expand Down
11 changes: 11 additions & 0 deletions showcase/src/assets/color2.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions showcase/src/assets/grid.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions showcase/src/assets/spacing.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions showcase/src/assets/typography.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
113 changes: 10 additions & 103 deletions showcase/src/views/SystemCards.vue
Expand Up @@ -12,23 +12,7 @@
<h6>Color</h6>
</header>
<a href="#color" :class="$style.cardbody">
<svg
width="56"
height="56"
viewBox="0 0 56 56"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path d="M0 0H12V12H0V0Z" fill="#CCCCCC" />
<path opacity="0.6" d="M22 0H34V12H22V0Z" fill="#CCCCCC" />
<path opacity="0.3" d="M44 0H56V12H44V0Z" fill="#CCCCCC" />
<path d="M0 22H12V34H0V22Z" fill="#D8D8D8" />
<path opacity="0.6" d="M22 22H34V34H22V22Z" fill="#D8D8D8" />
<path opacity="0.3" d="M44 22H56V34H44V22Z" fill="#D8D8D8" />
<path d="M0 44H12V56H0V44Z" fill="#E9E9E9" />
<path opacity="0.6" d="M22 44H34V56H22V44Z" fill="#E9E9E9" />
<path opacity="0.3" d="M44 44H56V56H44V44Z" fill="#E9E9E9" />
</svg>
<ColorSVG />
</a>
</Card>
</FlexCol>
Expand All @@ -38,55 +22,7 @@
<h6>Typography</h6>
</header>
<a href="#typography" :class="$style.cardbody">
<svg
width="97"
height="89"
viewBox="0 0 97 89"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<rect x="4.5" y="5.5" width="87" height="79" stroke="#D8D8D8" />
<path
d="M39.9688 64V62.6562C40.9271 62.4688 41.7292 62.2708 42.375 62.0625C43.0417 61.8542 43.5729 61.6562 43.9688 61.4688C44.3646 61.2604 44.6458 61.0729 44.8125 60.9062C45 60.7188 45.0938 60.5521 45.0938 60.4062V27.4375H35.75C35.4375 27.4375 35.1458 27.5 34.875 27.625C34.625 27.7292 34.3646 27.9688 34.0938 28.3438C33.8438 28.7188 33.5521 29.2708 33.2188 30C32.8854 30.7292 32.4896 31.6979 32.0312 32.9062L30.6875 32.3125C30.7917 31.0833 30.9271 29.7708 31.0938 28.375C31.2812 26.9792 31.4896 25.7292 31.7188 24.625H63.2812L64.2188 25.4062C64.1771 26.4688 64.0729 27.6354 63.9062 28.9062C63.7396 30.1562 63.5312 31.4375 63.2812 32.75H61.875C61.6667 31.7917 61.4792 30.9792 61.3125 30.3125C61.1667 29.625 60.9896 29.0729 60.7812 28.6562C60.5729 28.2188 60.3229 27.9062 60.0312 27.7188C59.7604 27.5312 59.4062 27.4375 58.9688 27.4375H50.0938V60.4062C50.0938 60.6771 50.4688 61.0208 51.2188 61.4375C51.9688 61.8542 53.3021 62.2604 55.2188 62.6562V64H39.9688Z"
fill="#D8D8D8"
/>
<rect
x="-0.5"
y="0.5"
width="9"
height="9"
transform="matrix(-1 0 0 1 9 79)"
fill="white"
stroke="#D8D8D8"
/>
<rect
x="-0.5"
y="0.5"
width="9"
height="9"
transform="matrix(-1 0 0 1 96 79)"
fill="white"
stroke="#D8D8D8"
/>
<rect
x="-0.5"
y="0.5"
width="9"
height="9"
transform="matrix(-1 0 0 1 96 0)"
fill="white"
stroke="#D8D8D8"
/>
<rect
x="-0.5"
y="0.5"
width="9"
height="9"
transform="matrix(-1 0 0 1 9 0)"
fill="white"
stroke="#D8D8D8"
/>
</svg>
<TypographySVG />
</a>
</Card>
</FlexCol>
Expand All @@ -95,30 +31,7 @@
<header :class="$style.cardheader">
<h6>Spacing</h6>
</header>
<a href="#spacing" :class="$style.cardbody">
<svg
width="89"
height="80"
viewBox="0 0 89 80"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<rect x="0.5" y="0.5" width="24" height="79" stroke="#E9E9E9" />
<rect x="73.5" y="0.5" width="15" height="79" stroke="#E9E9E9" />
<path
d="M41.2764 57H42.2109V55.3887H43.3066V54.54H42.2109V49.2495H40.7822C40.5566 49.6004 40.3293 49.9513 40.1001 50.3022C39.8745 50.6532 39.6489 51.0041 39.4233 51.355C39.1978 51.7059 38.9704 52.0568 38.7412 52.4077C38.5156 52.7586 38.2882 53.1095 38.0591 53.4604C37.8335 53.8114 37.6079 54.1623 37.3823 54.5132V55.3887H41.2764V57ZM38.3384 54.54V54.5186C38.5317 54.2214 38.7251 53.9259 38.9185 53.6323C39.1118 53.3351 39.3052 53.0379 39.4985 52.7407C39.6955 52.4435 39.8906 52.1481 40.084 51.8545C40.2773 51.5573 40.4707 51.2619 40.6641 50.9683C40.8574 50.6711 41.0508 50.3739 41.2441 50.0767H41.2764V54.54H38.3384ZM46.9106 57.1289C47.4585 57.1289 47.9437 57.034 48.3662 56.8442C48.7923 56.6545 49.1253 56.3931 49.3652 56.0601C49.6051 55.7235 49.7251 55.3385 49.7251 54.9053V54.8945C49.7251 54.5758 49.6553 54.2804 49.5156 54.0083C49.376 53.7362 49.1808 53.5052 48.9302 53.3154C48.6831 53.1221 48.3931 52.9878 48.0601 52.9126V52.8911C48.4862 52.7586 48.8228 52.5402 49.0698 52.2358C49.3205 51.9315 49.4458 51.5752 49.4458 51.167V51.1562C49.4458 50.766 49.3366 50.4186 49.1182 50.1143C48.8997 49.8063 48.599 49.5646 48.2158 49.3892C47.8363 49.2101 47.4012 49.1206 46.9106 49.1206C46.4237 49.1206 45.9886 49.2101 45.6055 49.3892C45.2223 49.5646 44.9215 49.8063 44.7031 50.1143C44.4847 50.4186 44.3755 50.766 44.3755 51.1562V51.167C44.3755 51.5752 44.5008 51.9315 44.7515 52.2358C45.0021 52.5402 45.3387 52.7586 45.7612 52.8911V52.9126C45.4318 52.9878 45.1418 53.1221 44.8911 53.3154C44.6405 53.5052 44.4453 53.7362 44.3057 54.0083C44.166 54.2804 44.0962 54.5758 44.0962 54.8945V54.9053C44.0962 55.3385 44.2161 55.7235 44.4561 56.0601C44.6995 56.3931 45.0326 56.6545 45.4551 56.8442C45.8776 57.034 46.3628 57.1289 46.9106 57.1289ZM46.9106 56.2856C46.5562 56.2856 46.241 56.2248 45.9653 56.103C45.6896 55.9777 45.473 55.8076 45.3154 55.5928C45.1579 55.3743 45.0791 55.1255 45.0791 54.8462V54.8354C45.0791 54.5526 45.1561 54.3019 45.3101 54.0835C45.4676 53.8651 45.6842 53.6932 45.96 53.5679C46.2357 53.4425 46.5526 53.3799 46.9106 53.3799C47.2687 53.3799 47.5856 53.4425 47.8613 53.5679C48.137 53.6932 48.3519 53.8651 48.5059 54.0835C48.6634 54.3019 48.7422 54.5526 48.7422 54.8354V54.8462C48.7422 55.1255 48.6634 55.3743 48.5059 55.5928C48.3483 55.8076 48.1317 55.9777 47.856 56.103C47.5838 56.2248 47.2687 56.2856 46.9106 56.2856ZM46.9106 52.5312C46.5991 52.5312 46.3252 52.4775 46.0889 52.3701C45.8525 52.2591 45.6681 52.1069 45.5356 51.9136C45.4032 51.7202 45.3369 51.4982 45.3369 51.2476V51.2368C45.3369 50.9862 45.4032 50.7642 45.5356 50.5708C45.6681 50.3774 45.8525 50.2271 46.0889 50.1196C46.3252 50.0086 46.5991 49.9531 46.9106 49.9531C47.2222 49.9531 47.4961 50.0086 47.7324 50.1196C47.9688 50.2271 48.1532 50.3774 48.2856 50.5708C48.4181 50.7642 48.4844 50.9862 48.4844 51.2368V51.2476C48.4844 51.4982 48.4181 51.7202 48.2856 51.9136C48.1532 52.1069 47.9688 52.2591 47.7324 52.3701C47.4961 52.4775 47.2222 52.5312 46.9106 52.5312ZM50.8154 58.8799H51.75V56.0654H51.7715C51.8896 56.2803 52.0365 56.4665 52.2119 56.624C52.391 56.778 52.5951 56.8979 52.8242 56.9839C53.0534 57.0662 53.2987 57.1074 53.5601 57.1074C54.0291 57.1074 54.4391 56.9893 54.79 56.7529C55.1445 56.513 55.4202 56.1764 55.6172 55.7432C55.8177 55.3099 55.918 54.7996 55.918 54.2124V54.207C55.918 53.6198 55.8195 53.1095 55.6226 52.6763C55.4256 52.2394 55.1481 51.9028 54.79 51.6665C54.4355 51.4266 54.0202 51.3066 53.5439 51.3066C53.279 51.3066 53.0337 51.3496 52.8081 51.4355C52.5825 51.5215 52.382 51.6432 52.2065 51.8008C52.0347 51.9548 51.8896 52.141 51.7715 52.3594H51.75V51.4141H50.8154V58.8799ZM53.3613 56.2803C53.0462 56.2803 52.7669 56.1943 52.5234 56.0225C52.2835 55.8506 52.0938 55.6107 51.9541 55.3027C51.8145 54.9912 51.7446 54.6278 51.7446 54.2124V54.207C51.7446 53.7881 51.8127 53.4246 51.9487 53.1167C52.0884 52.8052 52.2799 52.5635 52.5234 52.3916C52.7669 52.2197 53.0462 52.1338 53.3613 52.1338C53.6908 52.1338 53.9754 52.2179 54.2153 52.3862C54.4552 52.5509 54.6396 52.7891 54.7686 53.1006C54.8975 53.4085 54.9619 53.7773 54.9619 54.207V54.2124C54.9619 54.6349 54.8975 55.002 54.7686 55.3135C54.6396 55.6214 54.4552 55.8595 54.2153 56.0278C53.9754 56.1961 53.6908 56.2803 53.3613 56.2803ZM56.0522 57H57.0889L58.437 54.873H58.4585L59.7959 57H60.8325L58.9741 54.1694L60.8594 51.4141H59.8174L58.4907 53.5088H58.4692L57.1265 51.4141H56.0845L57.9536 54.207L56.0522 57Z"
fill="#D8D8D8"
/>
<mask maskUnits="userSpaceOnUse" x="0" y="0" width="0" height="0" fill="black">
<rect fill="white" width="0" height="0" />
</mask>
<path
d="M72.8536 39.8536C73.0488 39.6583 73.0488 39.3417 72.8536 39.1464L69.6716 35.9645C69.4763 35.7692 69.1597 35.7692 68.9645 35.9645C68.7692 36.1597 68.7692 36.4763 68.9645 36.6716L71.7929 39.5L68.9645 42.3284C68.7692 42.5237 68.7692 42.8403 68.9645 43.0355C69.1597 43.2308 69.4763 43.2308 69.6716 43.0355L72.8536 39.8536ZM25.1464 39.1464C24.9512 39.3417 24.9512 39.6583 25.1464 39.8536L28.3284 43.0355C28.5237 43.2308 28.8403 43.2308 29.0355 43.0355C29.2308 42.8403 29.2308 42.5237 29.0355 42.3284L26.2071 39.5L29.0355 36.6716C29.2308 36.4763 29.2308 36.1597 29.0355 35.9645C28.8403 35.7692 28.5237 35.7692 28.3284 35.9645L25.1464 39.1464ZM72.5 39L25.5 39V40L72.5 40V39Z"
fill="#E9E9E9"
mask="url(#)"
/>
</svg>
</a>
<a href="#spacing" :class="$style.cardbody"></a>
</Card>
</FlexCol>
<FlexCol v-bind:xs="12" auto>
Expand All @@ -127,18 +40,7 @@
<h6>Grid</h6>
</header>
<a href="#grid" :class="$style.cardbody">
<svg
width="80"
height="80"
viewBox="0 0 80 80"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<rect x="48" width="8" height="80" fill="#E9E9E9" />
<rect width="8" height="80" fill="#E9E9E9" />
<rect x="71.9629" width="8" height="80" fill="#E9E9E9" />
<rect x="23.9629" width="8" height="80" fill="#E9E9E9" />
</svg>
<GridSVG />
</a>
</Card>
</FlexCol>
Expand All @@ -151,14 +53,19 @@ import Card from "agnosticui/Card.vue";
import FlexGrid from "agnosticui/FlexGrid/FlexGrid";
import FlexRow from "agnosticui/FlexGrid/FlexRow";
import FlexCol from "agnosticui/FlexGrid/FlexCol";
import ColorSVG from "../assets/color2.svg";
import GridSVG from "../assets/grid.svg";
import TypographySVG from "../assets/typography.svg";
export default {
name: "SystemCards",
components: {
Card,
FlexCol,
FlexGrid,
FlexRow,
ColorSVG,
TypographySVG,
GridSVG,
},
};
</script>
Expand Down
15 changes: 14 additions & 1 deletion showcase/vue.config.js
Expand Up @@ -16,11 +16,24 @@ module.exports = {
}
}
},
chainWebpack: (config) => {
const svgRule = config.module.rule('svg');

svgRule.uses.clear();

svgRule
.use('vue-loader')
.loader('vue-loader')
.end()
.use('vue-svg-loader')
.loader('vue-svg-loader')
},

configureWebpack: {
resolve: {
alias: {
"agnosticui": path.resolve(__dirname, '../node_modules/agnosticui-vue/src/stories')
}
}
}
},
}

0 comments on commit 6c5610b

Please sign in to comment.