Skip to content

Commit 014010f

Browse files
initial
0 parents  commit 014010f

24 files changed

+6509
-0
lines changed

.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true

.eslintrc.cjs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/* eslint-env node */
2+
module.exports = {
3+
root: true,
4+
'extends': [
5+
'plugin:vue/vue3-essential',
6+
'eslint:recommended'
7+
],
8+
overrides: [
9+
{
10+
files: [
11+
'cypress/e2e/**/*.{cy,spec}.{js,ts,jsx,tsx}'
12+
],
13+
'extends': [
14+
'plugin:cypress/recommended'
15+
]
16+
}
17+
],
18+
parserOptions: {
19+
ecmaVersion: 'latest'
20+
}
21+
}

.gitignore

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
.DS_Store
12+
dist
13+
dist-ssr
14+
coverage
15+
*.local
16+
17+
/cypress/videos/
18+
/cypress/screenshots/
19+
20+
# Editor directories and files
21+
.vscode/*
22+
!.vscode/extensions.json
23+
.idea
24+
*.suo
25+
*.ntvs*
26+
*.njsproj
27+
*.sln
28+
*.sw?

.vscode/extensions.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["Vue.volar", "Vue.vscode-typescript-vue-plugin"]
3+
}

README.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# voicecapture-vue
2+
3+
A component darkmode injection in your document page with vue.js
4+
5+
<a href="https://voicecapture-vue.web.app" target="_blank">Live Preview</a>
6+
7+
Install
8+
```js
9+
npm install --save voicecapture-vue
10+
```
11+
12+
Usage basic
13+
```vue
14+
import VoiceCaptureVue from 'voicecapture-vue';
15+
16+
<VoiceCaptureVue />
17+
```
18+
19+
Prop hiddenLabel
20+
```vue
21+
<VoiceCaptureVue :hiddenLabel="true" />
22+
```
23+
24+
Prop hiddenIcon
25+
```vue
26+
<VoiceCaptureVue :hiddenIcon="true" />
27+
```
28+
29+
Prop labelDark and labelLight
30+
```vue
31+
<VoiceCaptureVue labelDark="Tema escuro" labelLight="Tema claro" />
32+
```
33+
34+
Slot change icon and label custom
35+
```vue
36+
<VoiceCaptureVue>
37+
<template #iconDark>
38+
<svg></svg>
39+
</template>
40+
<template #iconLight>
41+
<svg></svg>
42+
</template>
43+
<template #labelDark>
44+
Off
45+
</template>
46+
<template #labelLight>
47+
On
48+
</template>
49+
</VoiceCaptureVue>
50+
```
51+
52+
Usage useVoiceCaptureVue with toggleMode and mode value
53+
```vue
54+
import { useVoiceCaptureVue } from 'voicecapture-vue';
55+
56+
const { mode, toggleMode } = useVoiceCaptureVue();
57+
58+
<button @click="toggleMode">VoiceCaptureVue {{ mode }}</button>
59+
```
60+
61+
Style modification and usage in your styles
62+
```css
63+
body {
64+
--dm-color-primary: #41b883;
65+
--dm-color-secondary: #34495e;
66+
--dm-color-text: #222;
67+
--dm-color-background: #fff;
68+
}
69+
70+
body.darkmode {
71+
--dm-color-text: #fff;
72+
--dm-color-background: #222;
73+
}
74+
```
75+
Create your variable colors and update this with class .darkmode.
76+
77+
### Description class of components
78+
If VoiceCaptureVue usage in a page, a class in body document is update with class darkmode.
79+
In LocalStorage is created a key store with value current mode.
80+
Do you usage children body.darkmode styles for your application.
81+
I recomend create a variables colors in css and update this with toggle class of body document.

cypress.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { defineConfig } from 'cypress';
2+
3+
export default defineConfig({
4+
e2e: {
5+
specPattern: 'cypress/e2e/**/*.{cy,spec}.{js,jsx,ts,tsx}',
6+
baseUrl: 'http://localhost:4173',
7+
testIsolation: false
8+
},
9+
});

cypress/e2e/VoiceCapture.cy.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
describe('Test VoiceCapture', () => {
2+
beforeEach(() => {
3+
cy.visit('/');
4+
});
5+
});

cypress/e2e/jsconfig.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es5",
4+
"lib": ["es5", "dom"],
5+
"types": ["cypress"]
6+
},
7+
"include": ["./**/*", "../support/**/*"]
8+
}

cypress/fixtures/example.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "Using fixtures to represent data",
3+
"email": "[email protected]",
4+
"body": "Fixtures are a great way to mock data for responses to routes"
5+
}

cypress/support/commands.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// ***********************************************
2+
// This example commands.js shows you how to
3+
// create various custom commands and overwrite
4+
// existing commands.
5+
//
6+
// For more comprehensive examples of custom
7+
// commands please read more here:
8+
// https://on.cypress.io/custom-commands
9+
// ***********************************************
10+
//
11+
//
12+
// -- This is a parent command --
13+
// Cypress.Commands.add('login', (email, password) => { ... })
14+
//
15+
//
16+
// -- This is a child command --
17+
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
18+
//
19+
//
20+
// -- This is a dual command --
21+
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
22+
//
23+
//
24+
// -- This will overwrite an existing command --
25+
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })

0 commit comments

Comments
 (0)