Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@dialpad/dialtone-vue

Package Overview
Dependencies
Maintainers
9
Versions
743
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dialpad/dialtone-vue

Vue component library for Dialtone components

  • 1.2.0
  • npm
  • Socket score

Version published
Weekly downloads
371
decreased by-8.17%
Maintainers
9
Weekly downloads
 
Created
Source

Dialtone Vue 📞

Dialtone Vue is a library of Vue components for Dialtone. The goal is to simplify and standardize the use of common UI patterns and behaviour across all Dialpad projects.

Component Documentation Site ↗️

Project Status

Dialtone Vue is a new project, and as such it is under constant development as we add new components and refine existing ones. Please refer to the jira board to see the status of Dialtone Vue components and request new components that should be in the Dialtone Vue library.

Usage

Dialtone Vue components can be imported directly from the package. Some components also export named constants, which can be imported as well:

import { DtInput, VALIDATION_MESSAGE_TYPES } from '@dialpad/dialtone-vue';

Storybook Component Documentation

Dialtone Vue uses Storybook for documentation of components, as well as an environment for local development. Please see the Storybook Documentation Site for specific usage information and interactive documentation for each Dialtone Vue component.

All components in Dialtone Vue should have stories written for them in Storybook. For more information on how to write stories, see the documentation.

Running Storybook Locally

Storybook provides a sandbox to develop and experiment with components locally, in isolation from the rest of the app. With Storybook you get live reloading of component templates and styles, just like you would in the app. You can also test different props and slots and see the effects in real time, test accessibility issues, and more.

To run Storybook locally, first install the dependencies:

npm run storybook:install

Then you can run the dev server:

npm run storybook

Developing Dialtone Vue Components

Building components for Dialtone Vue is similar to components for Dialpad or UberConference, but there are some differences. Remember that Dialtone Vue is a shared library so more care has to be taken to avoid breaking changes.

Remember that Dialtone Vue is a separate project, so be sure to run the lint and unit tests for Dialtone Vue separately whenever making changes to the library.

See CONTRIBUTING.

Project Setup

Install Dependencies
npm install

CSS & Dialtone

Dialtone components should utilize the global immutable CSS classes provided by Dialtone whenever possible. It is a requirement of any project using Dialtone Vue to include these classes.

If needed, you can also write custom CSS using Dialtone LESS variables by importing ../css/dialtone.less.

Please do not use any scoped CSS or mixins in Dialtone Vue components.

Unit Tests

Each component should have a corresponding unit test in the tests/specs directory. There is no special test setup as Dialtone Vue components do not have access to the Vuex store or custom methods/directives.

Exports

When adding a new component, please add its exports to index.js, including any named exports, so they're available for import to users of Dialtone Vue:

export {
  default as DtInput,
  INPUT_SIZES,
} from './components/input.vue';

External Dependencies

Dialtone Vue components are designed to be used in a variety of different projects. As such, Dialtone Vue components should be pure Vue components with no dependencies on global Vue plugins or stores, except when noted below. This in particular means:

  • No access to the Vuex store. Different projects will have different store structures, and so Dialtone Vue components cannot access the Vuex store. Dialtone Vue components should take data as props only.
  • No I18n. Each project will have its own i18n implementation. Any text needed in a Dialtone Vue component should be passed as props or slots.
  • No custom directives. Directives in Vue are installed globally and vary from project to project. Custom directives (such as v-tooltip) cannot be used in Dialtone Vue components.
  • No other custom global methods. Some projects may implement custom global methods on the Vue object. Dialtone Vue components are limited to the built-in Vue methods.
  • No imports outside of the dialtone-vue directory.
  • Vue 2 compatibility. Dialtone Vue components should ideally support Vue 2 and 3, but a minimum of Vue 2 support is currently required.

Using Dialtone Vue in your Project

Project using Dialtone Vue should be aware of the requirements:

  • Dialtone classes must be made available globally (to avoid duplication, Dialtone Vue does not do this for you).
  • A tool like Webpack must be used to package the SFC components from Dialtone Vue.
  • LESS preprocessor support for Vue SFC <style> blocks.
  • Dialtone Vue components are built for Vue 2, with Vue 3 support coming soon.

These requirements are enforced via peerdependencies of Dialtone Vue when possible.

FAQs

Package last updated on 14 Oct 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc