diff --git a/.travis.yml b/.travis.yml index a006270c..31d3f5e6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,14 @@ language: node_js node_js: 12 -script: npm run build +install: + - npm i + - npm i --prefix examples/react-webpack + - npm i --prefix examples/vue-webpack + +script: + - npm run build + - npm run build:examples deploy: - provider: script diff --git a/README.md b/README.md index 6ae3130f..8abcc3b4 100644 --- a/README.md +++ b/README.md @@ -20,12 +20,19 @@ You can import and process styles manually by importing `dist/index.css` and `dist/index-without-styles.js` separately. Or even you can don't import styles at all, and write your own instead. +### React and Vue versions +By default `dist/index.js` is imported, instead of it, you can import a specific +version for React or Vue by importing `dist/react-without-styles.js` or +`dist/vue-without-styles.js` accordingly. The framework-specific version contains +all features available in the default one plus specific for particular framework wrappers. + ## Usage -### Button (`superheroUtils.createButton`) +### Button + +#### `superheroUtils.createButton` This library exports a function that creates buttons. This function accepts arguments: - class name of nodes that should become buttons, or the DOM node itself - (this option simplifies integration into Frontend frameworks like Vue/React) - options object Option | Description @@ -47,7 +54,7 @@ Option | Description ``` Select the button style you like the most and adopt this code to your website's HTML. -Additional examples can be found [here](./index.html). +Additional examples can be found [here](examples/index.html). #### Screenshots @@ -58,6 +65,24 @@ Size value | Screenshot `medium` | medium `large` | large +#### `superheroUtils.createButtonByDiv` + +The same function as the previous one except that the first argument should be an +instance of `HTMLDivElement`. The button content will be added to that node instead of +the DOM node replacing. The function with this interface simplifies integration into +Frontend frameworks like Vue and React. + +#### `superheroUtils.Button` (only in React and Vue versions) + +The component that is compatible with the corresponding framework. Accepts the same +properties as [`superheroUtils.createButton`](#superheroutilscreatebutton)'s options. + +#### Example + +```html +