Skip to content

Commit d53687c

Browse files
authored
Merge pull request #33 from morkro/1.1.0
Release 1.1.0
2 parents a5e29d5 + 2b7067c commit d53687c

25 files changed

+5883
-22276
lines changed

.babelrc.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

.eslintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.eslintrc.js

Lines changed: 23 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,31 @@
1-
// https://eslint.org/docs/user-guide/configuring
2-
31
module.exports = {
42
env: {
5-
jest: true
3+
browser: true,
4+
es2021: true,
5+
node: true,
6+
'cypress/globals': true,
67
},
7-
extends: [
8-
'plugin:vue/strongly-recommended',
9-
'standard'
10-
],
11-
// required to lint *.vue files
12-
plugins: [
13-
'vue'
14-
],
15-
// custom rules
8+
parser: 'vue-eslint-parser',
9+
parserOptions: {
10+
ecmaVersion: 2020,
11+
},
12+
plugins: ['vue', 'cypress'],
13+
extends: ['eslint:recommended', 'plugin:vue/vue3-essential'],
1614
rules: {
15+
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
16+
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
1717
'vue/script-indent': 'off',
1818
'vue/html-indent': 'off',
19+
'vue/no-unused-vars': 'error',
1920
'vue/require-default-prop': 'off',
20-
'vue/max-attributes-per-line': [2, {
21-
'singleline': 3,
22-
'multiline': {
23-
'max': 1,
24-
'allowFirstLine': true
25-
}
26-
}],
27-
'vue/component-name-in-template-casing': ['error', 'kebab-case', {
28-
'ignores': []
29-
}],
30-
'vue/html-closing-bracket-newline': ['error', {
31-
'singleline': 'never',
32-
'multiline': 'never'
33-
}],
34-
'indent': 'off',
35-
// allow paren-less arrow functions
36-
'arrow-parens': 'off',
37-
// allow async-await
38-
'generator-star-spacing': 'off',
39-
}
21+
indent: 'off',
22+
semi: [2, 'never'],
23+
quotes: [2, 'single'],
24+
'cypress/no-assigning-return-values': 'error',
25+
'cypress/no-unnecessary-waiting': 'error',
26+
'cypress/assertion-before-screenshot': 'warn',
27+
'cypress/no-force': 'warn',
28+
'cypress/no-async-tests': 'error',
29+
'cypress/no-pause': 'error',
30+
},
4031
}

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ jobs:
2020
run: npm run lint
2121

2222
- name: Run tests
23-
run: npm test
23+
run: npm run test:ci

README.md

Lines changed: 35 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,41 @@
11
# Vue A11yDialog [![Build Status](https://travis-ci.org/morkro/vue-a11y-dialog.svg?branch=master)](https://travis-ci.org/morkro/vue-a11y-dialog)
22

3-
This is a Vue.js wrapper component for [`a11y-dialog@5.4.1`](https://github.com/edenspiekermann/a11y-dialog) ([**demo**](https://codesandbox.io/s/rj20wr1kpp)).
3+
This is a Vue.js wrapper component for [`a11y-dialog@7.3.0`](https://github.com/KittyGiraudel/a11y-dialog) ([**demo**](https://codesandbox.io/s/rj20wr1kpp)).
44

5-
**Vue 2 and 3**
6-
7-
The newest major release of this package comes with Vue 3 support and removes the dependency to [`portal-vue@2.1.7`](https://github.com/LinusBorg/portal-vue). If you still need to support Vue 2, you can stay on version [`0.5.2`](https://github.com/morkro/vue-a11y-dialog/tree/0.5.2).
8-
9-
- [Install](#install)
5+
- [Installation](#installation)
106
- [Usage](#usage)
117
- [Multiple dialogs](#multiple-dialogs)
128
- [API](#api)
139
- [Events](#events)
1410
- [Slots](#slots)
1511
- [Server-side Rendering](#server-side-rendering)
1612

17-
## Install
13+
## Installation
14+
15+
This library supports both Vue 3 and Vue 2. However, active maintenance is focused on Vue 3. If you still need to support Vue 2, you can stay on version [`0.5.2`](https://github.com/morkro/vue-a11y-dialog/tree/0.5.2).
16+
17+
**Vue 3**
1818

1919
```bash
2020
npm install vue-a11y-dialog
2121
```
2222

23-
## Usage
23+
**Vue 2**
2424

25-
In your `main.js` application file, install the component:
26-
27-
### Vue 2
28-
29-
```js
30-
import VueA11yDialog from 'vue-a11y-dialog'
31-
32-
Vue.use(VueA11yDialog)
25+
```bash
26+
npm install vue-a11y-dialog@0.5.2
3327
```
3428

35-
### Vue 3
29+
## Usage
30+
31+
In your `main.js` application file, install the component:
3632

3733
```js
3834
import { createApp } from 'vue'
39-
import VueA11yDialog from 'vue-a11y-dialog'
35+
import A11yDialog from 'vue-a11y-dialog'
4036
import App from './App.vue'
4137

42-
createApp(App).use(VueA11yDialog).mount('#app')
38+
createApp(App).use(A11yDialog).mount('#app')
4339
```
4440

4541
Then use it as follows:
@@ -186,21 +182,7 @@ export default {
186182

187183
## API
188184

189-
> All `a11y-dialog` instance methods are available, see their [docs](https://github.com/edenspiekermann/a11y-dialog#js-api) for more.
190-
191-
### `disable-native`
192-
193-
- **Property**: `disable-native`
194-
- **Type**: `Boolean`
195-
- **Default**: `false`
196-
- **Description**: Per default we're using the native `<dialog>` element. However, if you want to disable that and use a `<div role="dialog">` instead, you can just do that by adding this attribute. This gives you full control (and responsibilites) over styling. Read the [`a11y-dialog` Styling layer documentation](http://edenspiekermann.github.io/a11y-dialog/#styling-layer) for more information.
197-
- **Usage**:
198-
199-
```html
200-
<a11y-dialog disable-native>
201-
<!-- ... -->
202-
</a11y-dialog>
203-
```
185+
> All `a11y-dialog` instance methods are available, for further documentation see [here](https://a11y-dialog.netlify.app/).
204186
205187
### `id`
206188

@@ -250,7 +232,7 @@ export default {
250232
- **Type**: `Object`
251233
- **Required**: `false`
252234
- **Default**: `{}`
253-
- **Description**: Object of classes for each HTML element of the dialog element. Keys are: `base`, `overlay`, `element`, `document`, `title`, `closeButton`. See [a11y-dialog docs](http://edenspiekermann.github.io/a11y-dialog/#expected-dom-structure) for reference.
235+
- **Description**: Object of classes for each HTML element of the dialog element. Keys are: `base`, `overlay`, `document`, `title`, `closeButton`. See [a11y-dialog docs](https://a11y-dialog.netlify.app/usage/markup) for reference.
254236
- **Usage**:
255237

256238
```html
@@ -348,7 +330,7 @@ export default {
348330

349331
### `closeButtonContent`
350332

351-
- **Name**: `closeButtonLabel`
333+
- **Name**: `closeButtonContent`
352334
- **Default**: `\u00D7` (×)
353335
- **Description**: The string that is the inner HTML of the close button.
354336
- **Usage**:
@@ -362,6 +344,23 @@ export default {
362344
</a11y-dialog>
363345
```
364346

347+
348+
### `closeButtonPosition`
349+
350+
- **Name**: `closeButtonPosition`
351+
- **Default**: `first`
352+
- **Description**: One of `first`, `last`, or `none`
353+
- **Usage**:
354+
355+
```html
356+
<a11y-dialog close-button-position="last">
357+
<template v-slot:closeButtonContent>
358+
<span>Close dialog</span>
359+
</template>
360+
<!-- ... -->
361+
</a11y-dialog>
362+
```
363+
365364
## Server-side Rendering
366365

367366
This is a client-only component; `a11y-dialog` won't render anything on the server and wait for your bundle to be executed on the client.

cypress.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"component": {
3+
"testFiles": "**/*.spec.ct.{js,ts,jsx,tsx}",
4+
"componentFolder": "src"
5+
},
6+
"video": false
7+
}

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": "hello@cypress.io",
4+
"body": "Fixtures are a great way to mock data for responses to routes"
5+
}

cypress/plugins/index.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
const path = require('path')
2+
const { startDevServer } = require('@cypress/vite-dev-server')
3+
4+
module.exports = (on, config) => {
5+
on('dev-server:start', (options) => {
6+
return startDevServer({
7+
options,
8+
viteConfig: {
9+
configFile: path.resolve(__dirname, '../../vite.config.js'),
10+
},
11+
})
12+
})
13+
14+
return config
15+
}

cypress/support/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// Ensure global app styles are loaded:
2+
import '../../src/demo.css'

0 commit comments

Comments
 (0)