# mindlens-components

> Custom component and plugins build for Vue 3

Latest version **0.0.18** (published 2023-02-14) · 0 weekly downloads

## Install

```sh
npm install mindlens-components
pnpm add mindlens-components
yarn add mindlens-components
bun add mindlens-components
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.18 |
| Published | 2023-02-14 |
| First published | 2023-02-13 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 5 |
| Unpacked size | 48.7 KB |
| Known vulnerabilities | 0 (+5 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | wokle |

## Links

- npm: https://www.npmjs.com/package/mindlens-components
- npm.io page: https://npm.io/package/mindlens-components

## Dependencies (5)

- [vue](https://npm.io/package/vue.md) ^3.2.45
- [jsdom](https://npm.io/package/jsdom.md) ^21.1.0
- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [happy-dom](https://npm.io/package/happy-dom.md) ^8.3.2
- [@types/lodash](https://npm.io/package/@types/lodash.md) ^4.14.191

## Recent versions

- 0.0.18 (latest) — 2023-02-14
- 0.0.17 — 2023-02-14
- 0.0.16 — 2023-02-14
- 0.0.15 — 2023-02-14
- 0.0.14 — 2023-02-14
- 0.0.13 — 2023-02-14
- 0.0.12 — 2023-02-14
- 0.0.11 — 2023-02-14
- 0.0.10 — 2023-02-14
- 0.0.9 — 2023-02-13
- 0.0.8 — 2023-02-13
- 0.0.7 — 2023-02-13
- 0.0.6 — 2023-02-13
- 0.0.5 — 2023-02-13
- 0.0.4 — 2023-02-13
- … 4 more at https://npm.io/package/mindlens-components/versions

## README

# Vue 3 custom components

Custom component and plugins build for Vue 3

### What's included ?

1. Button
2. Alert

### How to install ?

1. Start a new project
2. Run 'npm intall mindlens-components' or 'yarn add mindlens-components' in terminal at root dir

### How to use the plugins and components ?
1. Open main.ts
2. Insert code below to register the plugins and components

```
import mindlens from 'mindlens-components'
import 'mindlens-components/styles.css'

import App from './App.vue'

createApp(App)
.use(mindlens)
.mount('#app')
```

3. To use the button, use <ml-button/> component:

```
<ml-button variation="left-icon-text"/>
<ml-button variation="text-only"/>

<ml-button type="secondary" variation="right-icon-text"/>
<ml-button type="secondary" variation="icon-only"/>
```
4. To use the alert, use MLAlert plugin. Need to inject the plugin into the component as below: 
```
export default {
    inject: ['MLAlert'],
    data() {
      return {
        mlAlert: this.MLAlert
      }
    },
    methods: {
      showAlert(type: string, variation: string){
        this.mlAlert({
            header: 'This is header',
            type: type,
            variation: variation,
            content: 'This is a content. Content is a subject or ideas contained in something written, said...
            textButton1: "Btn 1",
            textButton2: "Btn 2"
        })
      },
    }
}
```

### props

1. Button component:

| Props         | Description                   | Value                                                 |
| ------------- | ----------------------------- | ----------------------------------------------------- |
| variation     | vVriation of the button       | left-icon-text, right-icon-text, text-only, icon-only |
| type          | Button style type             | primary, secondary                                    |
| type2         | Button criticality style type | info(default), warning, error, success                |
| text          | Button text content           | String value                                          |


2. Alert plugin

| Props         | Description                   | Value                                                 |
| ------------- | ----------------------------- | ----------------------------------------------------- |
| variation     | Variation of the alert        | all, title-only, content-only, title-content          |
| type          | Alert criticality style type  | info, error, warning, success                         |
| header        | Alert header content          | String value                                          |
| content       | Alert description content     | String value                                          |
| textButton1   | Button 1 text content         | String value                                          |
| textButton2   | Button 2 text content         | String value                                          |


### Example

For live example can go [here](https://vue-custom-components-test.vercel.app/)

---
_Source: https://npm.io/package/mindlens-components · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
