@justeattakeaway/pie-button 0.34.0 → 0.35.0
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 +6 -63
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,16 +14,13 @@
|
|
|
14
14
|
2. [Installation](#installation)
|
|
15
15
|
3. [Importing the component](#importing-the-component)
|
|
16
16
|
4. [Peer Dependencies](#peer-dependencies)
|
|
17
|
-
5. [
|
|
18
|
-
6. [
|
|
19
|
-
7. [Events](#events)
|
|
17
|
+
5. [Props](#props)
|
|
18
|
+
6. [Events](#events)
|
|
20
19
|
- [HTML example](#html)
|
|
21
20
|
- [Vue example (using Nuxt 3)](#vue-templates-using-nuxt-3)
|
|
22
21
|
- [React example (using Next 13)](#react-templates-using-next-13)
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
- [Browser Tests](#browser-tests)
|
|
26
|
-
- [Visual Tests](#visual-tests)
|
|
22
|
+
7. [Forms usage](#forms-usage)
|
|
23
|
+
8. [Contributing](#contributing)
|
|
27
24
|
|
|
28
25
|
|
|
29
26
|
## pie-button
|
|
@@ -71,30 +68,6 @@ import { PieButton } from '@justeattakeaway/pie-button/dist/react';
|
|
|
71
68
|
> When using `pie-button`, you will also need to include a couple of dependencies to ensure the component renders as expected. See [the PIE Wiki for more information and how to include these in your application](https://github.com/justeattakeaway/pie/wiki/Getting-started-with-PIE-Web-Components#expected-dependencies).
|
|
72
69
|
|
|
73
70
|
|
|
74
|
-
## Local development
|
|
75
|
-
|
|
76
|
-
Install the dependencies. Note that this, and the following commands below, should be run from the **root of the monorepo**:
|
|
77
|
-
|
|
78
|
-
```bash
|
|
79
|
-
yarn
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
To build the `pie-button` package, run the following command:
|
|
83
|
-
|
|
84
|
-
```bash
|
|
85
|
-
yarn build --filter=pie-button
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
If you'd like to develop using the component storybook, then you should build the component in `watch` mode, and run storybook in a separate terminal tab:
|
|
89
|
-
|
|
90
|
-
```bash
|
|
91
|
-
yarn watch --filter=pie-button
|
|
92
|
-
|
|
93
|
-
# in a separate terminal tab, run
|
|
94
|
-
yarn dev --filter=pie-storybook
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
|
|
98
71
|
## Props
|
|
99
72
|
|
|
100
73
|
| Property | Type | Default | Description |
|
|
@@ -219,36 +192,6 @@ In this example:
|
|
|
219
192
|
- No validation will be performed during submission, thanks to formnovalidate.
|
|
220
193
|
- The form's submission response will be opened in a new browser tab/window because of the formtarget="_blank" attribute.
|
|
221
194
|
|
|
222
|
-
##
|
|
223
|
-
|
|
224
|
-
### Browser tests
|
|
225
|
-
|
|
226
|
-
To run the browser tests, run the following command from the root of the monorepo:
|
|
195
|
+
## Contributing
|
|
227
196
|
|
|
228
|
-
|
|
229
|
-
yarn test:browsers --filter=pie-button
|
|
230
|
-
```
|
|
231
|
-
|
|
232
|
-
### Visual tests
|
|
233
|
-
|
|
234
|
-
To run the visual regression tests, run the following command from the root of the monorepo:
|
|
235
|
-
|
|
236
|
-
```bash
|
|
237
|
-
yarn test:visual --filter=pie-button
|
|
238
|
-
```
|
|
239
|
-
|
|
240
|
-
Note: To run these locally, you will need to ensure that any environment variables required are set up on your machine to mirror those on CI (such as Percy tokens). How you achieve this will differ between operating systems.
|
|
241
|
-
|
|
242
|
-
#### Setup via bash
|
|
243
|
-
|
|
244
|
-
```bash
|
|
245
|
-
export PERCY_TOKEN_PIE_BUTTON=abcde
|
|
246
|
-
```
|
|
247
|
-
|
|
248
|
-
#### Setup via package.json
|
|
249
|
-
|
|
250
|
-
Under scripts `test:visual` replace the environment variable with the below:
|
|
251
|
-
|
|
252
|
-
```bash
|
|
253
|
-
PERCY_TOKEN_PIE_BUTTON=abcde
|
|
254
|
-
```
|
|
197
|
+
Check out our [contributing guide](https://github.com/justeattakeaway/pie/wiki/Contributing-Guide) for more information on [local development](https://github.com/justeattakeaway/pie/wiki/Contributing-Guide#local-development) and how to run specific [component tests](https://github.com/justeattakeaway/pie/wiki/Contributing-Guide#testing).
|