Skip to content

moores2/carbon-components-vue

 
 

Repository files navigation

carbon-components-vue

Carbon Components Vue is released under the Apache-2.0 license CircleCI

[Experimental] Vue implementation of the Carbon Design System

A collection of Carbon Components implemented using Vue logo Vue.js.

Usage

General

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

  • In your main js file (where you include Vue) you can include the styles wholesale: import "carbon-components/css/carbon-components.min.css";
  • You can also use the unpkg cdn to bring in the styles wholesale: unpkg.com/carbon-components/css/carbon-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 "~carbon-components/scss/globals/scss/styles.scss";
  • Check out the Carbon 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

Run the following command using npm:

npm install -S @carbon/vue

If you prefer Yarn, use the following command instead:

yarn add @carbon/vue

NOTE: https://www.npmjs.com/package/current-script-polyfill is required for older browsers (e.g. IE11)

Using all at once

In your main js file (where you include Vue)

// No need for Babel
import CarbonComponentsVue from '@carbon/vue';

alternatively if wanting to specify babel presets

// need babel
import CarbonComponentsVue from '@carbon/vue/src/index';
Vue.use(CarbonComponentsVue);

Using one at a time

In your main js file (where you include Vue)

// No need for Babel
import { CvButton } from '@carbon/vue';

In a component file

<script>
...
import CvButton from '@carbon/vue/src/components/cv-button/cv-button';
...
components: {
  CvButton,
},
...
</script>

From unkpg

In your html file, no need to babel.

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

. . . <cv-button>Hello</cv-button>

Project State

v0.2.9

  • Add gauge component - story is Data-viz/CvGauge
  • Add pie chart component - story is Data-viz/CvPieChart
  • Add router-link version of CvLink

v0.2.8 Correct duff deploy

v0.2.7

  • Fix click on modal dialog closing it

v0.2.6

  • Fix tab out of modal
  • Remove unused vars

v0.2.5 - Minor fixes

  • Make structured list native Vue
  • Simplify structured list components
  • Removed non-core CSS
  • Fix to paginator reactivity

v0.2.4 - Minor fixes

  • Make tooltip native Vue
  • Tidy up a bit of unused code
  • Make tabs native Vue and use carbon react pattern (breaks previous tab use)

v0.2.3 - Minor fixes

  • Fix modal hide on main body click and show visible in story.
  • Make cv-search native Vue.
  • Make cv-number-input native Vue.

v0.2.2 - Minor fixes

  • Fixed expandable tile and made it native Vue
  • Made notification componentes native Vue
  • Tidied toggle stories.

v0.2.0 - Moved to Storybook 4

  • Knobs now operate as Vue properties the template is no longer replaced each time (as per Knobs in storybook 3)
  • Story kinds array replaced by variants which define the settings used in each story.
  • NOTE: slots no longer editable

v0.1.0 - First draft of carbon-components-vue implementation

This initial set of components, based on v9 of carbon components, includes draft implementations of all non-data viz components found in the core carbon components library. Public parts of the component: properties, events, data, methods, computed values are at this point subject to review at this point.

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.

Current Version: 0.1 :white_check_mark: Ready :warning: Under review :heavy_minus_sign: Not available

Components State Link
CvAccordion http://vue.carbondesignsystem.com/?selectedKind=CvAccordion
CvBarGraph ⚠️ http://vue.carbondesignsystem.com/?selectedKind=Data-Viz%2FCvBarGraph
CvBreadcrumb http://vue.carbondesignsystem.com/?selectedKind=CvBreadcrumb
CvButton http://vue.carbondesignsystem.com/?selectedKind=CvButton
CvCheckbox http://vue.carbondesignsystem.com/?selectedKind=CvCheckbox
CvCodeSnippet http://vue.carbondesignsystem.com/?selectedKind=CvCodeSnippet&selectedStory=All
CvContentSwitcher http://vue.carbondesignsystem.com/?selectedKind=CvContentSwitcher
CvDataTable carbon-design-system#51
CvDatePicker http://vue.carbondesignsystem.com/?selectedKind=CvDatePicker&selectedStory=All
CvDropdown http://vue.carbondesignsystem.com/?selectedKind=CvDropdown
CvFileUploader http://vue.carbondesignsystem.com/?selectedKind=CvFileUploader&selectedStory=All
CvForm http://vue.carbondesignsystem.com/?selectedKind=CvForm
CvGauge ⚠️ carbon-design-system#49
CvIcon ⚠️ http://vue.carbondesignsystem.com/?selectedKind=CvIcon
CvInlineNotification http://vue.carbondesignsystem.com/?selectedKind=CvInlineNotification
CvLineGraph carbon-design-system#53
CvLink http://vue.carbondesignsystem.com/?selectedKind=CvLink
CvList http://vue.carbondesignsystem.com/?selectedKind=CvList
CvLoading http://vue.carbondesignsystem.com/?selectedKind=CvLoading
CvModal http://vue.carbondesignsystem.com/?selectedKind=CvModal
CvNumberInput http://vue.carbondesignsystem.com/?selectedKind=CvNumberInput
CvOverflowMenu http://vue.carbondesignsystem.com/?selectedKind=CvOverflowMenu
CvPagination http://vue.carbondesignsystem.com/?selectedKind=CvPagination&selectedStory=All
CvPieChart ⚠️ carbon-design-system#52
CvProgress http://vue.carbondesignsystem.com/?selectedKind=CvProgress
CvRadioButton http://vue.carbondesignsystem.com/?selectedKind=CvRadioButton
CvScatterPlot carbon-design-system#50
CvSearch http://vue.carbondesignsystem.com/?selectedKind=CvSearch
CvSelect http://vue.carbondesignsystem.com/?selectedKind=CvSelect
CvSlider http://vue.carbondesignsystem.com/?selectedKind=CvSlider
CvStructuredList http://vue.carbondesignsystem.com/?selectedKind=CvStructuredList
CvTabs http://vue.carbondesignsystem.com/?selectedKind=CvTabs
CvTag http://vue.carbondesignsystem.com/?selectedKind=CvTag
CvTextArea http://vue.carbondesignsystem.com/?selectedKind=CvTextArea
CvTextInput http://vue.carbondesignsystem.com/?selectedKind=CvTextInput
CvTimePicker http://vue.carbondesignsystem.com/?selectedKind=CvTimePicker&selectedStory=All
CvTile http://vue.carbondesignsystem.com/?selectedKind=CvTile
CvToastNotification http://vue.carbondesignsystem.com/?selectedKind=CvToastNotification
CvToggle http://vue.carbondesignsystem.com/?selectedKind=CvToggle
CvTooltip http://vue.carbondesignsystem.com/?selectedKind=CvTooltip

Development

Please refer to the Contribution Guidelines before starting any work.

Contributing

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

Publishing this library on gh-pages

sh deploy-gh-pages.sh

About

[Experimental] Vue implementation of the Carbon Design System

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 51.8%
  • Vue 47.3%
  • Other 0.9%