1.2.7 • Published 6 years ago

vest-ui v1.2.7

Weekly downloads
3
License
ISC
Repository
github
Last release
6 years ago

1. Setup

1.1 Installation

yarn add vest-ui
npm install vest-ui

1.2 Usage

Import all components.

import Vue from 'vue';
import Vest from 'vest-ui';

Vue.use(Vest);

Or import specific components as needed.

import { ctaBtn, stdInput } from 'vest-ui';

// global
Vue.component('ctaBtn', ctaBtn);
Vue.component('stdInput', stdInput);

// scoped
export default {
	name: 'anyVueComponent',
	components: {
		ctaBtn,
		stdInput,
	}
}

2. Components

2.1 buttons

2.1.1 ctaBtn

alt text)

setup

No additional setup is reuqired to use this component.

props

NameDescriptionTypeValuesNotesOptional
disabledif true, button is disabledbool----yes
btnStyleinteger that renders button color schemenumber1,2,3default: 1yes
alt (deprecated)if true, renders alternate color schemebool----yes

events

NameTriggerNotes
@clickbutton has been clicked--

2.1.2 stdBtn

alt text alt text

setup

No additional setup is reuqired to use this component.

props

NameDescriptionTypeValuesNotesOptional
disabledif true, button is disabledbool----yes
altif true, renders alternate color schemebool----yes

events

NameTriggerNotes
@clickbutton has been clicked--

2.1.3 linkBtn

alt text

setup

No additional setup is reuqired to use this component.

props

NameDescriptionTypeValuesNotesOptional
disabledif true, button is disabledbool----yes

events

NameTriggerNotes
@clickbutton has been clicked--

2.1.4 hexArrowBtn

alt text

setup

No additional setup is reuqired to use this component.

props

NameDescriptionTypeValuesNotesOptional
directionthe direction of the button's arrowstring'right', 'left', 'down'default: 'right'yes
strokeColorbutton's outline/arrow colorstringcss hex colordefault: '#fff'yes
fillColorbutton's color on hover/clickstringcss hex colordefault: '#fff'yes

events

NameTriggerNotes
@clickbutton has been clicked--

2.2 accents

2.2.1 plusText

alt text

setup

This component is absolutely positioned. Be sure to have a positioned element as the desired parent.

props

NameDescriptionTypeValuesNotesOptional
strokeColoraccents's colorstringcss hex colordefault: '#fff'yes

events

There are no events for this component.

2.2.2 hrPlus

alt text

setup

No additional setup is reuqired to use this component.

props

NameDescriptionTypeValuesNotesOptional
strokeColoraccents's colorstringcss hex colordefault: '#fff'yes

events

There are no events for this component.

2.2.3 hrCapped

alt text

setup

No additional setup is reuqired to use this component.

props

NameDescriptionTypeValuesNotesOptional
strokeColoraccents's colorstringcss hex colordefault: '#fff'yes

events

There are no events for this component.

2.3 form components

2.3.1 stdInput

alt text

setup

Must have vee-validate plugin installed and imported in main.js For currency masking, must have v-money plugin installed and imported in main.js

import Vue from 'vue';
import VeeValidate from 'vee-validate';

Vue.use(VeeValidate);

// only need this if you are using the iMoney prop for currency masking
import Money from 'v-money'
Vue.use(Money, {precision: 2})

props

NameDescriptionTypeValuesNotesOptional
iNameinput's namestring----no
v-modelinput's modeled valuestring----no
iValueinput's initial valuestring--this must be the same property that is assigned to v-modelno
iTypeinput's typestringhtml input typedefault: 'text'yes
iValidatevalidation rulesstringvalid validation rule syntax--yes
iPlaceholderinput's placeholder textstring----yes
iClassclass(es) to be applied directly to the input elementstringcss class string--yes
iMaskinput maskstringvalid vue-the-mask string--yes
iMoneyinput mask for currencyobjectvalid v-money object--yes
iMinnumber input's min valuenumber--only used when iType="number"yes
iMaxnumber input's max valuenumber--only used when iType="number"yes
iStepnumber input's legal intervalsnumber--only used when iType="number" default: 1yes
labelClassclass(es) to be applied directly to the input's label/placeholderstringcss class string--yes
iOptionalindicate whether input should display 'optional'bool--default: falseyes

events

There are no events for this component.

2.3.2 stdSelect

alt text alt text

setup

This element uses a single <slot></slot> tag to render <option> tags inside of it. See the docs for more info on Slots.

<std-select>
	<option value="foo">foo</option>
	<option value="bar">bar</option>
	<option value="too">too</option>
</std-select>

props

NameDescriptionTypeValuesNotesOptional
v-modelfield's modeled valuestring----yes
altif true, render's alternate size/fontbool--default: falseyes

events

There are no events for this component.

2.4 nav components

2.4.1 navBar

alt text

setup

the @linkClick event must be listened for and it's corresponding function must update the active prop to match the new active Index.

<!-- vue template -->
<nav-bar @linkClick="handleLinkClick" active="active"></nav-bar>
// vue script

methods: {
	handleLinkClick(newActiveIndex, direction) {
		this.active = newActiveIndex;
		// do anything else
	}
}

props

NameDescriptionTypeValuesNotesOptional
itemsarray of labels for nav itemsstring----no
activewhich nav Item is currently activenumber0 <= active < items.length--no
navKeyunique string for the navBarstring----no
activeBarColorcolor of the active barstringcss hex colordeafult: $vest-sky-blueyes
durduration of navBar animation (ms)Number--deafult: 400yes

events

NameTriggerNotes
@linkClicknavItem has been clickedpasses two props: linkClick(newActiveIndex, direction) where direction is only used to animate other elements in conjunction with the navBar animation.

2.5 containers

2.5.1 stdModal

alt text

setup

This element uses a single <slot></slot> tag to render content inside of the modal. See the docs for more info

props

NameDescriptionTypeValuesNotesOptional
mkeyunique string for the modal's IDstring----no
activewhether or not the modal is visiblebool----no

events

NameTriggerNotes
@closeuser is trying to close the modalshould set whatever value is bound to :active prop to false.

3. Styles

3.1 Import

To access the lastest Vest-ui styles, simply import main.scss and _variables.scss into App.vue.

<!-- App.vue -->
<style lang='scss'>
	@import 'node_modules/vest-ui/styles/main.scss';
	@import 'node_modules/vest-ui/styles/_variables.scss';
</style>

In addition, you will have to include the _variables.scss import in any component styles. I know this sucks, searching for a better way but I don't think Vue offers one currently.

<!-- someComponent.vue -->
<style lang='scss'>
	@import 'node_modules/vest-ui/styles/_variables.scss';
	/*your components scss*/
</style>

3.2 Colors + Fonts

All colors and fonts found in the zeplin styleguide are available in _variables.scss.

  • colors are referenced as scss variables: (ex. $vest-teal)
  • fonts are referenced as scss mixins: (ex. @include text-body) see zeplin comments for exact mixin names.

3.3 Extras

Other helpful extras

Responsive Mixin:

// lg: under 1440px
// md: under 1024px
// sm: under 768px
// 2x: 2x displays (retina)
// 3x: 3x displays (super-retina?)

@include respond-to($media) {
	// conditional styles here
}

Background + Text Opacity Mixin:

@include background-opacity($color, $opacity)
@include text-opacity($color, $opacity)
1.2.7

6 years ago

1.2.6

6 years ago

1.2.5

6 years ago

1.2.4

6 years ago

1.2.3

6 years ago

1.2.2

6 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.11

7 years ago

1.1.10

7 years ago

1.1.9

7 years ago

1.1.8

7 years ago

1.1.7

7 years ago

1.1.6

7 years ago

1.1.5

7 years ago

1.1.4

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.15

7 years ago

1.0.14

7 years ago

1.0.13

7 years ago

1.0.12

7 years ago

1.0.11

7 years ago

1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago