diff --git a/components/vf-componenet-rollup/index.scss b/components/vf-componenet-rollup/index.scss index 85af9a14a..0e0f02760 100755 --- a/components/vf-componenet-rollup/index.scss +++ b/components/vf-componenet-rollup/index.scss @@ -119,6 +119,7 @@ button { @import 'vf-pagination/vf-pagination.scss'; @import 'vf-pagination/vf-pagination--full.scss'; @import 'vf-back-to-top/vf-back-to-top.scss'; +@import 'vf-indicator-loader/vf-indicator-loader.scss'; /* All Visual Framework Containers */ diff --git a/components/vf-indicator-loader/.npmignore b/components/vf-indicator-loader/.npmignore new file mode 100644 index 000000000..c5beaf7cf --- /dev/null +++ b/components/vf-indicator-loader/.npmignore @@ -0,0 +1,4 @@ +bin +.github +.travis.yml +node_modules diff --git a/components/vf-indicator-loader/CHANGELOG.md b/components/vf-indicator-loader/CHANGELOG.md new file mode 100644 index 000000000..349a39276 --- /dev/null +++ b/components/vf-indicator-loader/CHANGELOG.md @@ -0,0 +1,4 @@ +### 1.0.0-alpha.1 + +* Basic implementation of vf-indicator-loader component +* [Tracking issue](https://github.com/visual-framework/vf-core/issues/1332) diff --git a/components/vf-indicator-loader/README.md b/components/vf-indicator-loader/README.md new file mode 100644 index 000000000..ad42546eb --- /dev/null +++ b/components/vf-indicator-loader/README.md @@ -0,0 +1,47 @@ +# Loader component + +[![npm version](https://badge.fury.io/js/%40visual-framework%2Fvf-indicator-loader.svg)](https://badge.fury.io/js/%40visual-framework%2Fvf-indicator-loader) + +## About + +Use these when content or a page is still in the progress of being loaded. + +## Usage + +- Spinner variant: This indicator should be reserved for actions that take between 2-10 seconds. +- Progress variant: [To come](https://github.com/visual-framework/vf-core/issues/1332) +- Skeleton variant: [To come](https://github.com/visual-framework/vf-core/issues/1332) + +[Recommended reading related reading](https://www.nngroup.com/articles/progress-indicators/) on usage of loader elements. Less is better. + +## Install + +This repository is distributed with [npm][https://www.npmjs.com/]. After [installing npm][https://www.npmjs.com/get-npm] and [yarn](https://classic.yarnpkg.com/en/docs/install), you can install `vf-indicator-loader` with this command. + +``` +$ yarn add --dev @visual-framework/vf-indicator-loader +``` + +### JS + +You should import this component in `./components/vf-component-rollup/scripts.js` or your other JS process: + +```js +// no js yet for this component +``` + +### Sass/CSS + +The style files included are written in [Sass](https://sass-lang.com/). If you're using a VF-core project, you can import it like this: + +``` +@import "@visual-framework/vf-indicator-loader/index.scss"; +``` + +Make sure you import Sass requirements along with the modules. You can use a [project boilerplate](https://stable.visual-framework.dev/building/) or the [`vf-sass-starter`](https://stable.visual-framework.dev/components/vf-sass-starter/) + +## Help + +- [Read the Visual Framework troubleshooting](https://stable.visual-framework.dev/troubleshooting/) +- [Open a ticket](https://github.com/visual-framework/vf-core/issues) +- [Chat on Slack](https://join.slack.com/t/visual-framework/shared_invite/enQtNDAxNzY0NDg4NTY0LWFhMjEwNGY3ZTk3NWYxNWVjOWQ1ZWE4YjViZmY1YjBkMDQxMTNlNjQ0N2ZiMTQ1ZTZiMGM4NjU5Y2E0MjM3ZGQ) diff --git a/components/vf-indicator-loader/index.scss b/components/vf-indicator-loader/index.scss new file mode 100644 index 000000000..831b36a86 --- /dev/null +++ b/components/vf-indicator-loader/index.scss @@ -0,0 +1,16 @@ +// setup files required + +// sass-lint:disable clean-import-paths +@import 'vf-global-variables'; +@import 'vf-variables'; +@import 'vf-functions'; +@import 'vf-mixins'; + +// component specific styles + +@import 'vf-indicator-loader.variables.scss'; +@import 'vf-indicator-loader.scss'; + +// component variant styles +// @import 'vf-indicator-loader--variant.scss'; + diff --git a/components/vf-indicator-loader/package.json b/components/vf-indicator-loader/package.json new file mode 100644 index 000000000..df14fc088 --- /dev/null +++ b/components/vf-indicator-loader/package.json @@ -0,0 +1,23 @@ +{ + "version": "1.0.0-alpha.0", + "name": "@visual-framework/vf-indicator-loader", + "description": "vf-indicator-loader component", + "homepage": "", + "author": "VF", + "license": "Apache 2.0", + "style": "vf-indicator-loader.css", + "sass": "index.scss", + "main": "build/index.js", + "test": "echo \"Error: no test specified\" && exit 1", + "publishConfig": { + "access": "public" + }, + "repo": "https://github.com/visual-framework/vf-core/tree/develop/components/vf-indicator-loader", + "bugs": { + "url": "https://github.com/visual-framework/vf-core/issues" + }, + "keywords": [ + "fractal", + "component" + ] +} diff --git a/components/vf-indicator-loader/vf-indicator-loader.config.yml b/components/vf-indicator-loader/vf-indicator-loader.config.yml new file mode 100644 index 000000000..b5dd81f2d --- /dev/null +++ b/components/vf-indicator-loader/vf-indicator-loader.config.yml @@ -0,0 +1,25 @@ +# The title shown on the component page +title: Loader +# Label shown on index pages +label: Loader +status: alpha +# The template used from /components/_previews +# +# Per-variant options +variants: + - name: default + hidden: true + - name: spinner + context: + container: false +# Global component context +context: + component-type: block + # custom-values: passed as {{custom-values}} + # - note: you in your custom-values you should use dashes `-` + # and not underscores `_` as underscores prevent inherited template use + # title: Title text + # text: String of text + # image: ../../assets/vf-component-name/assets/vf-component-name.png + # - note on paths: be sure to prefix with `../../` + # - Why? https://github.com/visual-framework/vf-core/issues/364 diff --git a/components/vf-indicator-loader/vf-indicator-loader.js b/components/vf-indicator-loader/vf-indicator-loader.js new file mode 100644 index 000000000..982be933b --- /dev/null +++ b/components/vf-indicator-loader/vf-indicator-loader.js @@ -0,0 +1 @@ +// vf-indicator-loader diff --git a/components/vf-indicator-loader/vf-indicator-loader.jsx b/components/vf-indicator-loader/vf-indicator-loader.jsx new file mode 100644 index 000000000..82ac7b82f --- /dev/null +++ b/components/vf-indicator-loader/vf-indicator-loader.jsx @@ -0,0 +1,21 @@ +// vf-indicator-loader for React +// See vf-extensions-react for usage guidance + +import React from "react"; +import "./vf-indicator-loader.scss"; + +export function VFLoader({ container = false }) { + return container ? ( +