@dialpad/dialtone-vue 1.0.0-beta.7 → 1.0.0-beta.test.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -45
- package/package.json +9 -12
- package/dist/dialtone-vue.common.js +0 -6868
- package/dist/dialtone-vue.umd.js +0 -6878
- package/dist/dialtone-vue.umd.min.js +0 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Handset 📞
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Handset is a library of Vue components for [Dialtone][dt]. The goal is to simplify and standardize the use of common UI patterns and behaviour across all Dialpad projects.
|
|
4
4
|
|
|
5
5
|
**[Component Documentation Site ↗️][handbook]**
|
|
6
6
|
|
|
@@ -8,31 +8,31 @@ Dialtone Vue is a library of Vue components for [Dialtone][dt]. The goal is to s
|
|
|
8
8
|
|
|
9
9
|
### Project Status
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Handset is a new project, and as such it is under constant development as we add new components and refine existing ones. Please refer to the [project board][project] to see the status of Handset components and request new components that should be in the Handset library.
|
|
12
12
|
|
|
13
13
|
[project]: https://github.com/orgs/dialpad/projects/1
|
|
14
14
|
|
|
15
15
|
### Timeline
|
|
16
16
|
|
|
17
|
-
Our goal is to have a stable 1.0 release in
|
|
17
|
+
Our goal is to have a stable 1.0 release in early 2021. At this point, we will split Handset into a separate repository and follow semantic versioning.
|
|
18
18
|
|
|
19
19
|
## Usage
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
Handset components can be imported directly from the package. Some components also export named constants, which can be imported as well:
|
|
22
22
|
|
|
23
23
|
```js
|
|
24
|
-
import {
|
|
24
|
+
import { HsInput, VALIDATION_MESSAGE_TYPES } from '@dialpad/handset';
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
## Storybook Component Documentation
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
Handset uses [Storybook][storybook] for documentation of components, as well as an environment for local development. Please see the [Storybook Documentation Site][handbook] for specific usage information and interactive documentation for each Handset component.
|
|
30
30
|
|
|
31
|
-
All components in
|
|
31
|
+
All components in Handset should have stories written for them in Storybook. For more information on how to write stories, see the [documentation][stories].
|
|
32
32
|
|
|
33
33
|
[storybook]: https://storybook.js.org
|
|
34
|
-
[handbook]: https://
|
|
35
|
-
[stories]: https://
|
|
34
|
+
[handbook]: https://static.dialpadcdn.com/storybook/index.html
|
|
35
|
+
[stories]: https://static.dialpadcdn.com/storybook/index.html?path=/story/docs-storybook-getting-started--page
|
|
36
36
|
|
|
37
37
|
### Running Storybook Locally
|
|
38
38
|
|
|
@@ -41,7 +41,7 @@ Storybook provides a sandbox to develop and experiment with components locally,
|
|
|
41
41
|
To run Storybook locally, first install the dependencies:
|
|
42
42
|
|
|
43
43
|
```
|
|
44
|
-
npm run storybook
|
|
44
|
+
npm run install:storybook
|
|
45
45
|
```
|
|
46
46
|
|
|
47
47
|
Then you can run the dev server:
|
|
@@ -50,67 +50,55 @@ Then you can run the dev server:
|
|
|
50
50
|
npm run storybook
|
|
51
51
|
```
|
|
52
52
|
|
|
53
|
-
## Developing
|
|
53
|
+
## Developing Handset Components
|
|
54
54
|
|
|
55
|
-
Building components for
|
|
55
|
+
Building components for Handset is similar to components for Dialpad or UberConference, but there are some differences. Remember that Handset is a shared library so more care has to be taken to avoid breaking changes.
|
|
56
56
|
|
|
57
|
-
Remember that
|
|
57
|
+
Remember that Handset is a separate project, so be sure to run the lint and unit tests for Handset separately whenever making changes to the library.
|
|
58
58
|
|
|
59
59
|
See [CONTRIBUTING](./CONTRIBUTING.md).
|
|
60
60
|
|
|
61
|
-
### Project Setup
|
|
62
|
-
|
|
63
|
-
#### NPM_AUTH_TOKEN
|
|
64
|
-
|
|
65
|
-
Ensure that `NPM_AUTH_TOKEN` is set in your path. You will need to set the token to an NPM authentication token which has read level access to the `@dialpad` organization.
|
|
66
|
-
|
|
67
|
-
#### Install Dependencies
|
|
68
|
-
|
|
69
|
-
```bash
|
|
70
|
-
npm install
|
|
71
|
-
```
|
|
72
|
-
|
|
73
61
|
### CSS & Dialtone
|
|
74
62
|
|
|
75
|
-
Dialtone components should utilize the global immutable CSS classes provided by Dialtone whenever possible. It is a requirement of any project using
|
|
63
|
+
Dialtone components should utilize the global immutable CSS classes provided by Dialtone whenever possible. It is a requirement of any project using Handset to include these classes.
|
|
76
64
|
|
|
77
65
|
If needed, you can also write custom CSS using the Dialtone LESS variables or mixins by importing `../css/dialtone.less`.
|
|
78
66
|
|
|
79
|
-
Please **do not** use any scoped CSS in
|
|
67
|
+
Please **do not** use any scoped CSS in Handset components.
|
|
80
68
|
|
|
81
69
|
### Unit Tests
|
|
82
70
|
|
|
83
|
-
Each component should have a corresponding unit test in the `tests/specs` directory. There is no special test setup as
|
|
71
|
+
Each component should have a corresponding unit test in the `tests/specs` directory. There is no special test setup as Handset components do not have access to the Vuex store or custom methods/directives.
|
|
84
72
|
|
|
85
73
|
### Exports
|
|
86
74
|
|
|
87
|
-
When adding a new component, please add its exports to `index.js`, including any named exports, so they're available for import to users of
|
|
75
|
+
When adding a new component, please add its exports to `index.js`, including any named exports, so they're available for import to users of Handset:
|
|
88
76
|
|
|
89
77
|
```js
|
|
90
78
|
export {
|
|
91
|
-
default as
|
|
92
|
-
|
|
79
|
+
default as HsInput,
|
|
80
|
+
INPUT_SIZE_TYPES,
|
|
93
81
|
} from './components/input.vue';
|
|
94
82
|
```
|
|
95
83
|
|
|
96
84
|
### External Dependencies
|
|
97
85
|
|
|
98
|
-
|
|
86
|
+
Handset components are designed to be used in a variety of different projects. As such, Handset components should be pure Vue components with no dependencies on global Vue plugins or stores, except when noted below. This in particular means:
|
|
99
87
|
|
|
100
|
-
- **No access to the Vuex store.** Different projects will have different store structures, and so
|
|
101
|
-
- **No I18n.** Each project will have its own i18n implementation. Any text needed in a
|
|
102
|
-
- **No custom directives.** Directives in Vue are installed globally and vary from project to project. Custom directives (such as `v-tooltip`) cannot be used in
|
|
103
|
-
- **No other custom global methods.** Some projects may implement custom global methods on the Vue object.
|
|
104
|
-
- **No imports outside of the
|
|
105
|
-
- **Vue 2 compatibility.**
|
|
88
|
+
- **No access to the Vuex store.** Different projects will have different store structures, and so Handset components cannot access the Vuex store. Handset components should take data as props only.
|
|
89
|
+
- **No I18n.** Each project will have its own i18n implementation. Any text needed in a Handset component should be passed as props or slots.
|
|
90
|
+
- **No custom directives.** Directives in Vue are installed globally and vary from project to project. Custom directives (such as `v-tooltip`) cannot be used in Handset components.
|
|
91
|
+
- **No other custom global methods.** Some projects may implement custom global methods on the Vue object. Handset components are limited to the built-in Vue methods.
|
|
92
|
+
- **No imports outside of the handset directory.**
|
|
93
|
+
- **Vue 2 compatibility.** Handset components should ideally support Vue 2 and 3, but a minimum of Vue 2 support is currently required.
|
|
106
94
|
|
|
107
|
-
## Using
|
|
95
|
+
## Using Handset in your Project
|
|
108
96
|
|
|
109
|
-
Project using
|
|
97
|
+
Project using Handset should be aware of the requirements:
|
|
110
98
|
|
|
111
|
-
- Dialtone classes must be made available globally (to avoid duplication,
|
|
112
|
-
- A tool like Webpack must be used to package the SFC components from
|
|
99
|
+
- Dialtone classes must be made available globally (to avoid duplication, Handset does not do this for you).
|
|
100
|
+
- A tool like Webpack must be used to package the SFC components from Handset.
|
|
113
101
|
- LESS preprocessor support for Vue SFC `<style>` blocks.
|
|
114
|
-
-
|
|
102
|
+
- Handset components are built for Vue 2, with Vue 3 support coming soon.
|
|
115
103
|
|
|
116
|
-
These requirements are enforced via peerdependencies of
|
|
104
|
+
These requirements are enforced via peerdependencies of Handset when possible.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dialpad/dialtone-vue",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.test.1",
|
|
4
4
|
"description": "Vue component library for Dialtone components",
|
|
5
5
|
"repository": "https://github.com/dialpad/dialtone-vue",
|
|
6
6
|
"files": [
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
"main": "./dist/dialtone-vue.common.js",
|
|
10
10
|
"scripts": {
|
|
11
11
|
"build": "vue-cli-service build --target lib --name dialtone-vue index.js",
|
|
12
|
-
"deploy": "npm publish",
|
|
13
|
-
"
|
|
12
|
+
"deploy:npm": "npm publish",
|
|
13
|
+
"deploy": "run-s build deploy:npm",
|
|
14
14
|
"build:wc": "vue-cli-service build --target wc-async --name dialtone-vue 'components/**/*[!.story]*.vue'",
|
|
15
15
|
"test": "vue-cli-service test:unit --timeout 100000 --require source-map-support/register --require jsdom-global/register --colors components/**/*.test.js",
|
|
16
16
|
"lint:code": "esplint ./",
|
|
@@ -24,12 +24,12 @@
|
|
|
24
24
|
"v-click-outside": "^3.1.2"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@dialpad/dialtone": "6.0.0-beta.
|
|
27
|
+
"@dialpad/dialtone": "6.0.0-beta.2",
|
|
28
28
|
"@dialpad/generator-dp": "^1.0.0",
|
|
29
|
-
"@vue/cli-plugin-babel": "~4.
|
|
30
|
-
"@vue/cli-plugin-eslint": "~4.
|
|
31
|
-
"@vue/cli-plugin-unit-mocha": "~4.
|
|
32
|
-
"@vue/cli-service": "~4.
|
|
29
|
+
"@vue/cli-plugin-babel": "~4.5.0",
|
|
30
|
+
"@vue/cli-plugin-eslint": "~4.5.0",
|
|
31
|
+
"@vue/cli-plugin-unit-mocha": "~4.5.0",
|
|
32
|
+
"@vue/cli-service": "~4.5.0",
|
|
33
33
|
"@vue/test-utils": "^1.0.3",
|
|
34
34
|
"babel-eslint": "^10.1.0",
|
|
35
35
|
"babel-plugin-dynamic-import-node": "^2.2.0",
|
|
@@ -64,12 +64,9 @@
|
|
|
64
64
|
"yo": "^3.1.1"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
|
-
"@dialpad/dialtone": "6.0.0-beta.
|
|
67
|
+
"@dialpad/dialtone": "6.0.0-beta.2",
|
|
68
68
|
"vue": "^2.6.11"
|
|
69
69
|
},
|
|
70
|
-
"gitHooks": {
|
|
71
|
-
"pre-commit": "npm run lint"
|
|
72
|
-
},
|
|
73
70
|
"engineStrict": true,
|
|
74
71
|
"engines": {
|
|
75
72
|
"node": ">= 14"
|