@tedbree/eventbree-vue

0.1.22 • Public • Published

eventbree-components-vue

Eventbree Components Vue is released under the Apache-2.0 license

Vue implementation of the eventbree Design System A collection of [Eventbree Components] implemented using Vue logo Vue.js.

@tedbree/eventbree-vue

Change log

See CHANGELOG.md

Current Components

View available Vue.js components here. Usage information is available when you click the blue ? icon in the top right corner of the selected component.

See component status pages for the status of each component.

Contributing

Fork, create branch, submit PR. The PR will be used as part of a review process.

Usage

General

The components do not import any of the eventbree styles themselves. Use the SCSS or CSS from eventbree-components to provide the styling.

  • In your main js file (where you include Vue) you can include the styles wholesale: import "eventbree-components/css/eventbree-components.min.css";
  • You can also use the unpkg cdn to bring in the styles wholesale: unpkg.com/eventbree-components/css/eventbree-components.min.css aliases the latest minified css file.
  • If you prefer to build the SCSS, in the <style> tag of your top-level component you can include the styles wholesale: @import "~eventbree-components/scss/globals/scss/styles.scss";
  • Check out the eventbree Design System developers page for information on including individual component styles into your project.

List of Available Components

View available Vue Components here. Usage information is in the notes tab.

Getting Started

Quick Start (Vue CLI)

Assuming we're starting with a new Vue CLI project:

Vue CLI v3.7.0
? Please pick a preset: Manually select features
? Check the features needed for your project: Babel, CSS Pre-processors
? Pick a CSS pre-processor (PostCSS, Autoprefixer and CSS Modules are supported by default): Sass/SCSS (with node-
sass)
? Where do you prefer placing config for Babel, PostCSS, ESLint, etc.? In package.json
? Save this as a preset for future projects? No

Using Yarn

$ yarn add @tedbree/eventbree-vue

Or npm

$ npm install @tedbree/eventbree-vue

In src/main.js add the following to include the eventbree styles and components.

import 'eventbree-components/css/eventbree-components.css';
import eventbreeComponentsVue from '@tedbree/eventbree-vue/src/index';
Vue.use(eventbreeComponentsVue);

Replace the contents of src/components/HelloWorld.vue with the following

<template>
  <div class="sample">
    <h1>Example use of @tedbree/eventbree-vue</h1>
    <eb-text-input label="Who are you?" v-model="yourName" placeholder="your name" />
    <eb-button @click="onClick">Hello {{yourName}}</eb-button>
    <eb-modal :visible="visible" @modal-hidden="modalClosed">
      <template slot="title"
        >Welcome to @tedbree/eventbree-vue {{yourName}}</template
      >
      <template slot="content">
        <p>
          Lorem ipsum dolor sit amet, consectetur adipisicing elit, seed do eiusmod tempor incididunt ut labore et
          dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
          commodo consequat.
        </p>
      </template>
    </eb-modal>
  </div>
</template>

<script>
  export default {
    name: 'HelloWorld',
    data() {
      return {
        yourName: '',
        visible: false,
      };
    },
    methods: {
      onClick() {
        this.visible = true;
      },
      modalClosed() {
        this.visible = false;
      },
    },
  };
</script>

<style>
  .sample {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    max-width: 600px;
    margin: 5% auto;
  }

  .eb-text-input {
    margin: 30px 0;
  }
</style>

That's it! Now start the server and start building.

Using Yarn

$ yarn serve

Or npm

$ npm serve

Longer start

Install

Run the following command using npm:

npm install @tedbree/eventbree-vue

If you prefer Yarn, use the following command instead:

yarn add @tedbree/eventbree-vue

NOTE: current-script-polyfill is required for older browsers (e.g. IE11)

Using the component library

In your main js file (where you include Vue):

import eventbreeComponentsVue from '@tedbree/eventbree-vue';
Vue.use(eventbreeComponentsVue);

The above lines will register all the core components. You can register only the components you need if you prefer:

Vue.use(eventbreeComponentsVue, ['ebButton', 'ebTag']);

Using the components directly or individually

You can import the component source either for all core components or for the individual components you need.

To import all the core components:

import eventbreeComponentsVue from '@tedbree/eventbree-vue/src/index';
Vue.use(eventbreeComponentsVue);

To import individual components:

<script>
...
import ebButton from '@tedbree/eventbree-vue/src/components/eb-button/eb-button';
...
components: {
  ebButton,
},
...
</script>

Note: to import the component source you will need to ensure that Babel can process the source. We recommend the Babel preset @vue/app. If @tedbree/eventbree-vue is installed as a dependency in a node_modules folder or similar, you may need to enable Babel to process the source files, for example with the following lines, or similar, inside the webpack.config.js file:

{
  test: /\.js$/,
  loader: 'babel-loader',
  include: [path.resolve(__dirname, 'node_modules/@eventbree'), path.resolve(__dirname, 'src')]
}

Using the components from unkpg

In your html file, no need to babel.

<script src="https://unpkg.com/vue@latest" />
<script src="https://unpkg.com/@tedbree/eventbree-vue" />
<script>
Vue.use(window['eventbree-vue'].default);
<script>

. . . <eb-button>Hello</eb-button>

Package Sidebar

Install

npm i @tedbree/eventbree-vue

Weekly Downloads

18

Version

0.1.22

License

Apache-2.0

Unpacked Size

13 MB

Total Files

456

Last publish

Collaborators

  • tedbree