Skip to content

Commit

Permalink
feat: updated inline documentation attributes for buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Akpa committed Dec 5, 2018
1 parent 30c7d4f commit e5305b2
Show file tree
Hide file tree
Showing 14 changed files with 87 additions and 48 deletions.
4 changes: 2 additions & 2 deletions dev/views/ContentLoaders.vue
Original file line number Diff line number Diff line change
Expand Up @@ -263,11 +263,11 @@
import Vue from 'vue'
import {
FishTankLoaderContent as LoaderContent,
FishTankPropsDoc,
} from '@/index'
import FishTankPropsDoc from '@/components/FishTankPropsDoc.vue'
import VueMarkdown from 'vue-markdown'
export default Vue.extend({
Expand Down
3 changes: 2 additions & 1 deletion dev/views/Loaders.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@

<script lang="ts">
import Vue from 'vue'
import { FishTankSpinner as Spinner, FishTankButtonPrimary as ftbutton, FishTankPropsDoc } from '@/index'
import { FishTankSpinner as Spinner, FishTankButtonPrimary as ftbutton } from '@/index'
import FishTankPropsDoc from '@/components/FishTankPropsDoc.vue'
import VueMarkdown from 'vue-markdown'
export default Vue.extend({
Expand Down
3 changes: 2 additions & 1 deletion dev/views/Tags.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@

<script lang="ts">
import Vue from "vue"
import { FishTankTag , FishTankPropsDoc} from "@/index"
import { FishTankTag } from "@/index"
import FishTankPropsDoc from '@/components/FishTankPropsDoc.vue'
import { Flag24 } from '@fishtank/icons-vue'
import VueMarkdown from 'vue-markdown'
Expand Down
4 changes: 2 additions & 2 deletions src/components/FishTankBaseButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ export default Vue.extend({
block: {
type: Boolean,
default: false,
decription: "Changes Button to full width block element"
description: "Changes Button to full width block element"
},
name:{
type: String,
default:"",
required:false,
decription: "Optional name of the button, which can be used with the form data."
description: "Optional name of the button, which can be used with the form data."
}
},
computed: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/FishTankButtonDestructive.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default Vue.extend({
introduction: "Destructive Button",
description: "Destructive Button",
token:[`
<FishTankButtonDestructive>Primary Button</FishTankButtonDestructive>
<FishTankButtonDestructive>Destructive Button</FishTankButtonDestructive>
`],
components: {
FishTankBaseButton
Expand Down
4 changes: 2 additions & 2 deletions src/components/FishTankButtonFeatureIcon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ import Vue from "vue"
import FishTankBaseButton from "./FishTankBaseButton.vue"
export default Vue.extend({
name: "ButtonFeatureIcon",
name: "FishTankButtonFeatureIcon",
introduction: "Feature Icon Button",
description: "Feature Icon Button",
token:[`
<ButtonFeatureIcon> <Alert24/> </ButtonFeatureIcon>
<FishTankButtonFeatureIcon> <Alert24/> </FishTankButtonFeatureIcon>
`],
components: {
FishTankBaseButton,
Expand Down
6 changes: 3 additions & 3 deletions src/components/FishTankButtonFeatureLabel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ import FishTankBaseButton from "./FishTankBaseButton.vue"
import FishTankButtonFeatureIcon from "./FishTankButtonFeatureIcon.vue"
export default Vue.extend({
name: "ButtonFeatureLabel",
name: "FishTankButtonFeatureLabel",
introduction: "Feature Label Button",
description: "Feature Label Button",
token:[`
<ButtonFeatureLabel>
<FishTankButtonFeatureLabel>
<template slot="icon"> <Alert24/> </template>
<template slot="label"> Button Feature Label</template>
</ButtonFeatureLabel>
</FishTankButtonFeatureLabel>
`],
components: {
FishTankBaseButton,
Expand Down
23 changes: 12 additions & 11 deletions src/components/FishTankButtonGradient.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,32 +23,33 @@ export default Vue.extend({
introduction: "Gradient Button",
description: "Gradient Button",
token:[`
<ButtonGradient
<FishTankButtonGradient
:gradientStart="startingHexColorVariable"
:gradientEnd="endingHexColorVariable"
:colorDirection="to-right"
>Button Gradient</ButtonGradient>
:colorDirection="to right"
>Button Gradient</FishTankButtonGradient>
`],
components: {
FishTankBaseButton
},
props:{
gradientStart :{
type:String, required:true, default:"#000000",
description:"Start Color of Gradient",
type_description:"String(Hex color, or valid CSS color)"
type:String,
required:true,
default:"#000000",
description:"Start Color of Gradient; String(Hex color, or valid CSS color)",
},
gradientEnd :{
type:String, required:true, default:"#000000",
description:"End Color of Gradient",
type_description:"String(Hex color, or valid CSS color)"
type:String,
required:true,
default:"#000000",
description:"End Color of Gradient; String(Hex color, or valid CSS color)",
},
colorDirection :{
type:String,
required:false,
default:"to right",
description:"Horizontal Direction of Gradient",
type_description:"String(\"to right\" or \"to left\") "
description:"Horizontal Direction of Gradient; String(\"to right\" or \"to left\")",
},
block: {
type: Boolean,
Expand Down
6 changes: 3 additions & 3 deletions src/components/FishTankButtonOutlineSmall.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import FishTankBaseButton from "./FishTankBaseButton.vue"
export default Vue.extend({
name: "FishTankButtonOutlineSmall",
introduction: "Primary Button",
description: "Primary Button",
introduction: "Small Outline Button",
description: "Small Outline Button",
token:[`
<FishTankButtonOutlineSmall>Primary Button</FishTankButtonOutlineSmall>
<FishTankButtonOutlineSmall>Small Outline Button</FishTankButtonOutlineSmall>
`],
components: {
FishTankBaseButton
Expand Down
8 changes: 4 additions & 4 deletions src/components/FishTankButtonPrimary.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ export default Vue.extend({
<FishTankButtonPrimary
:block="true">Button Primary</FishTankButtonPrimary>
`,
`<ButtonPrimary
`<FishTankButtonPrimary
@click="handleClick"
>Button Primary</ButtonPrimary>`,
`<ButtonPrimary
>Button Primary</FishTankButtonPrimary>`,
`<FishTankButtonPrimary
:disabled="falsyVariable"
:block="truthyVariable"
>Button Primary</ButtonPrimary>`
>Button Primary</FishTankButtonPrimary>`
],
components: {
FishTankBaseButton
Expand Down
2 changes: 1 addition & 1 deletion src/components/FishTankButtonWhite.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default Vue.extend({
introduction: "White Button",
description: "White Button",
token:[`
<FishTankButtonWhite>Primary Button</FishTankButtonWhite>
<FishTankButtonWhite>White Button</FishTankButtonWhite>
`],
components: {
FishTankBaseButton
Expand Down
64 changes: 49 additions & 15 deletions src/components/FishTankPropsDoc.vue
Original file line number Diff line number Diff line change
@@ -1,32 +1,66 @@
<template>
<div>
<template v-for="(propObj, key, index) in properties">
<div
v-if="propObj.description !== undefined"
:key="`p+${index}`">
<h1>{{ key }}</h1>
<template v-for="(prop, key, index) in propObj">
<template v-if="key === 'type'">
<div :key="`q+${index}`">{{ key }}: {{ prop.name }}</div>
</template>
<template v-else>
<div :key="`q+${index}`">{{ key }}: {{ prop }}</div>
<table
v-if="layout === 'table'"
class="table-card">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Default</th>
<th>Description</th>
<th>Required</th>
</tr>
</thead>
<tbody>
<template v-for="(propObj, namekey, indexA) in properties">
<template v-if="(propObj.description !== undefined)" >
<tr :key="`p+${indexA}`">
<td>{{ namekey }}</td>
<td>{{ propObj['type'].name }}</td>
<td>{{ propObj['default'] }}</td>
<td>{{ propObj['description'] }}</td>
<td>
<template v-if="propObj.hasOwnProperty('required') === true">
{{ propObj['required'] }}
</template>
<template v-if="propObj.hasOwnProperty('required') === false">
false
</template>
</td>
</tr>
</template>
</template>
</div>
</tbody>
</table>
<template v-if="layout === 'list'">
<h4>{{ namekey }}</h4>
<template v-for="(prop, key, index) in propObj">
<template v-if="key === 'type'">
<div :key="`q+${index}`">{{ key }}: {{ prop.name }}</div>
</template>
<template v-else>
<div :key="`q+${index}`">{{ key }}: {{ prop }}</div>
</template>
</template>
</template>
</div>
</template>

<script lang="ts">
<script>
import Vue from 'vue'
import a11y from '@/util/a11y'
export default Vue.extend({
name:"FishTankPropsDocs",
props:{
properties:{
type: Object,
reqwuired:true,
required:true,
default: ()=>{}
},
layout:{
type: String,
required:true,
default: "list"
}
}
})
Expand Down
5 changes: 4 additions & 1 deletion src/components/FishTankTag.vue
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,10 @@ export default Vue.extend({
} else {
return false
}
}
},
// returnStyle(){
// return JSON.stringify(this.$style)
// }
},
methods:{
updateInput(event:any) {
Expand Down
1 change: 0 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,5 @@ export { default as FishTankLoaderSpinner } from "./components/FishTankLoaderSpi
export { default as FishTankButtonGroup } from "./components/FishTankButtonGroup.vue"
export { default as FishTankButtonGroupButton } from "./components/FishTankButtonGroupButton.vue"
export { default as FishTankLoaderContent } from "./components/FishTankLoaderContent.vue"
export { default as FishTankPropsDoc } from "./components/FishTankPropsDoc.vue"

import './styles.scss'

0 comments on commit e5305b2

Please sign in to comment.