@availity/feedback 6.2.7 → 6.2.11

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/CHANGELOG.md CHANGED
@@ -3,6 +3,41 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [6.2.11](https://github.com/Availity/availity-react/compare/@availity/feedback@6.2.10...@availity/feedback@6.2.11) (2021-12-20)
7
+
8
+ **Note:** Version bump only for package @availity/feedback
9
+
10
+
11
+
12
+
13
+
14
+ ## [6.2.10](https://github.com/Availity/availity-react/compare/@availity/feedback@6.2.9...@availity/feedback@6.2.10) (2021-12-14)
15
+
16
+ **Note:** Version bump only for package @availity/feedback
17
+
18
+
19
+
20
+
21
+
22
+ ## 6.2.9 (2021-12-09)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * **feedback:** added submit on enter func and tests ([d642923](https://github.com/Availity/availity-react/commit/d642923eb0ca80ee5faff17e0f830c3e1e2181c7))
28
+
29
+
30
+
31
+
32
+
33
+ ## [6.2.8](https://github.com/Availity/availity-react/compare/@availity/feedback@6.2.7...@availity/feedback@6.2.8) (2021-12-03)
34
+
35
+ **Note:** Version bump only for package @availity/feedback
36
+
37
+
38
+
39
+
40
+
6
41
  ## 6.2.7 (2021-12-03)
7
42
 
8
43
 
package/README.md CHANGED
@@ -3,5 +3,23 @@
3
3
  > Availity feedback with smiley faces react component.
4
4
 
5
5
  [![Version](https://img.shields.io/npm/v/@availity/feedback.svg?style=for-the-badge)](https://www.npmjs.com/package/@availity/feedback)
6
+ [![NPM Downloads](https://img.shields.io/npm/dt/@availity/feedback.svg?style=for-the-badge)](https://www.npmjs.com/package/@availity/feedback)
7
+ [![Dependecy Status](https://img.shields.io/librariesio/release/npm/@availity/feedback?style=for-the-badge)](https://github.com/Availity/availity-react/blob/master/packages/feedback/package.json)
6
8
 
7
- ## [Documentation](https://availity.github.io/availity-react/components/feedback/index)
9
+ ## Installation
10
+
11
+ ### NPM
12
+
13
+ ```bash
14
+ npm install @availity/feedback
15
+ ```
16
+
17
+ ### Yarn
18
+
19
+ ```bash
20
+ yarn add @availity/feedback
21
+ ```
22
+
23
+ ## Documentation
24
+
25
+ Check out more documentation at [availity.github.io](https://availity.github.io/availity-react/components/feedback/index)
package/package.json CHANGED
@@ -1,31 +1,31 @@
1
1
  {
2
2
  "name": "@availity/feedback",
3
- "version": "6.2.7",
4
- "author": "Evan Sharp <evan.sharp@availity.com>",
3
+ "version": "6.2.11",
5
4
  "description": "Availity feedback with smiley faces react component.",
6
- "main": "index.js",
7
- "types": "index.d.ts",
8
5
  "keywords": [
9
6
  "react",
10
- "availity"
7
+ "availity",
8
+ "feedback"
11
9
  ],
12
- "repository": {
13
- "type": "git",
14
- "url": "https://github.com/Availity/availity-react.git"
15
- },
10
+ "homepage": "https://availity.github.io/availity-react/components/feedback/index",
16
11
  "bugs": {
17
12
  "url": "https://github.com/Availity/availity-react/issues"
18
13
  },
19
- "license": "MIT",
20
- "publishConfig": {
21
- "access": "public"
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "https://github.com/Availity/availity-react.git",
17
+ "directory": "packages/feedback"
22
18
  },
19
+ "license": "MIT",
20
+ "author": "Evan Sharp <evan.sharp@availity.com>",
21
+ "main": "index.js",
22
+ "types": "index.d.ts",
23
23
  "dependencies": {
24
- "@availity/form": "^1.2.1",
25
- "@availity/hooks": "^3.1.0",
26
- "@availity/icon": "^0.10.0",
24
+ "@availity/form": "^1.2.3",
25
+ "@availity/hooks": "^3.1.2",
26
+ "@availity/icon": "^0.10.2",
27
27
  "@availity/native-form": "^4.0.5",
28
- "@availity/select": "^2.2.1",
28
+ "@availity/select": "^2.3.2",
29
29
  "prop-types": "^15.7.2"
30
30
  },
31
31
  "devDependencies": {
@@ -47,5 +47,8 @@
47
47
  "reactstrap": "^8.0.0 || ^7.0.0 || ^6.0.0",
48
48
  "yup": "^0.27.0"
49
49
  },
50
- "gitHead": "10873615b671bbdd3bbd0ab7cbfd290bd968e0b5"
50
+ "publishConfig": {
51
+ "access": "public"
52
+ },
53
+ "gitHead": "5983e704cd833c6e93ef6d00472f48a0876fe782"
51
54
  }
@@ -1,4 +1,4 @@
1
- import React, { useState, useEffect } from 'react';
1
+ import React, { useState, useEffect, useRef } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { Button, ModalBody, ModalHeader, ModalFooter, FormGroup } from 'reactstrap';
4
4
  import { avLogMessagesApi, avRegionsApi } from '@availity/api-axios';
@@ -45,7 +45,7 @@ const FeedbackForm = ({
45
45
  }) => {
46
46
  const [active, setActive] = useState(null);
47
47
  const [sent, setSent] = useState(null);
48
-
48
+ const ref = useRef();
49
49
  const sendFeedback = async ({ smileField, ...values }) => {
50
50
  const response = await avRegionsApi.getCurrentRegion();
51
51
 
@@ -111,10 +111,11 @@ const FeedbackForm = ({
111
111
  {prompt || `Tell us what you think about ${name}`}
112
112
  </ModalHeader>
113
113
  <Form
114
+ innerRef={ref}
114
115
  aria-label="Feedback Form"
115
116
  aria-describedby="feedback-form-header"
116
117
  role="form"
117
- onKeyDown={({ keyCode }) => keyCode === 27 && onClose()}
118
+ onKeyDown={({ key }) => key === 'Escape' && onClose()}
118
119
  data-testid="feedback-form"
119
120
  initialValues={{
120
121
  'face-options': undefined,
@@ -201,7 +202,7 @@ const FeedbackForm = ({
201
202
  onClick={() => setSupportIsActive(true)}
202
203
  color="link"
203
204
  type="button"
204
- onKeyDown={({ keyCode }) => keyCode === 13 && setSupportIsActive(true)}
205
+ onKeyDown={({ key }) => key === 'Enter' && setSupportIsActive(true)}
205
206
  >
206
207
  Open a support ticket
207
208
  </Button>
@@ -210,13 +211,14 @@ const FeedbackForm = ({
210
211
 
211
212
  {onClose ? (
212
213
  <Button
214
+ type="button"
213
215
  onClick={onClose}
214
216
  color="secondary"
215
- onKeyDown={({keyCode, shiftKey}) => {
216
- if (keyCode === 13) {
217
+ onKeyDown={({ key, shiftKey }) => {
218
+ if (key === 'Enter') {
217
219
  onClose();
218
220
  }
219
- if (keyCode === 9 && !active && !shiftKey && !modal) {
221
+ if (key === 'Tab' && !active && !shiftKey && !modal) {
220
222
  onClose();
221
223
  }
222
224
  }}
@@ -226,8 +228,11 @@ const FeedbackForm = ({
226
228
  ) : null}
227
229
 
228
230
  <Button
229
- onKeyDown={({keyCode, shiftKey}) => {
230
- if (keyCode === 9 && !shiftKey && !modal) {
231
+ onKeyDown={({ key, shiftKey }) => {
232
+ if (key === 'Enter') {
233
+ ref.current.submitForm();
234
+ }
235
+ if (key === 'Tab' && !shiftKey && !modal) {
231
236
  onClose();
232
237
  }
233
238
  }}
@@ -271,7 +276,7 @@ FeedbackForm.propTypes = {
271
276
  showSupport: PropTypes.bool,
272
277
  setSupportIsActive: PropTypes.func,
273
278
  autoFocusFeedbackButton: PropTypes.bool,
274
- modal: PropTypes.bool
279
+ modal: PropTypes.bool,
275
280
  };
276
281
 
277
282
  FeedbackForm.defaultProps = {
@@ -280,7 +285,7 @@ FeedbackForm.defaultProps = {
280
285
  additionalComments: false,
281
286
  analytics: avLogMessagesApi,
282
287
  showSupport: false,
283
- modal: true
288
+ modal: true,
284
289
  };
285
290
 
286
291
  export default FeedbackForm;