@availity/mui-feedback 0.2.4 → 0.2.6
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 +8 -0
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +38 -11
- package/dist/index.mjs +40 -13
- package/package.json +3 -3
- package/src/lib/Feedback.tsx +8 -2
- package/src/lib/FeedbackForm.tsx +42 -29
- package/src/lib/FeedbackHeader.tsx +4 -5
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [0.2.6](https://github.com/Availity/element/compare/@availity/mui-feedback@0.2.5...@availity/mui-feedback@0.2.6) (2024-08-16)
|
|
6
|
+
|
|
7
|
+
### Dependency Updates
|
|
8
|
+
|
|
9
|
+
* `mui-form-utils` updated to version `0.2.5`
|
|
10
|
+
* `mui-textfield` updated to version `0.2.5`
|
|
11
|
+
## [0.2.5](https://github.com/Availity/element/compare/@availity/mui-feedback@0.2.4...@availity/mui-feedback@0.2.5) (2024-08-09)
|
|
12
|
+
|
|
5
13
|
## [0.2.4](https://github.com/Availity/element/compare/@availity/mui-feedback@0.2.3...@availity/mui-feedback@0.2.4) (2024-08-08)
|
|
6
14
|
|
|
7
15
|
### Dependency Updates
|
package/dist/index.d.mts
CHANGED
|
@@ -3,7 +3,8 @@ interface FeedbackProps {
|
|
|
3
3
|
info: (entries: Record<string, unknown>) => void;
|
|
4
4
|
};
|
|
5
5
|
appName: string;
|
|
6
|
+
buttonVariant?: 'secondary' | 'tertiary';
|
|
6
7
|
}
|
|
7
|
-
declare const Feedback: ({ analytics, appName }: FeedbackProps) => JSX.Element;
|
|
8
|
+
declare const Feedback: ({ analytics, appName, buttonVariant, }: FeedbackProps) => JSX.Element;
|
|
8
9
|
|
|
9
10
|
export { Feedback, type FeedbackProps };
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,8 @@ interface FeedbackProps {
|
|
|
3
3
|
info: (entries: Record<string, unknown>) => void;
|
|
4
4
|
};
|
|
5
5
|
appName: string;
|
|
6
|
+
buttonVariant?: 'secondary' | 'tertiary';
|
|
6
7
|
}
|
|
7
|
-
declare const Feedback: ({ analytics, appName }: FeedbackProps) => JSX.Element;
|
|
8
|
+
declare const Feedback: ({ analytics, appName, buttonVariant, }: FeedbackProps) => JSX.Element;
|
|
8
9
|
|
|
9
10
|
export { Feedback, type FeedbackProps };
|
package/dist/index.js
CHANGED
|
@@ -107,7 +107,20 @@ var SmileButtons = (0, import_styles.styled)(import_mui_toggle_button.ToggleButt
|
|
|
107
107
|
var FormActions = (0, import_styles.styled)(import_Grid.default, { name: "AvFeedbackContainer", slot: "FormActions" })({});
|
|
108
108
|
var SmileButton = (_a) => {
|
|
109
109
|
var _b = _a, { disabled, Icon, label, value } = _b, props = __objRest(_b, ["disabled", "Icon", "label", "value"]);
|
|
110
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
110
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
111
|
+
import_mui_toggle_button.ToggleButton,
|
|
112
|
+
__spreadProps(__spreadValues({
|
|
113
|
+
component: import_mui_button.IconButton,
|
|
114
|
+
disableRipple: true,
|
|
115
|
+
title: label,
|
|
116
|
+
"aria-label": value,
|
|
117
|
+
value
|
|
118
|
+
}, props), {
|
|
119
|
+
disabled,
|
|
120
|
+
size: "large",
|
|
121
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, {})
|
|
122
|
+
})
|
|
123
|
+
) });
|
|
111
124
|
};
|
|
112
125
|
var FeedbackForm = ({
|
|
113
126
|
analytics,
|
|
@@ -206,7 +219,7 @@ var FeedbackForm = ({
|
|
|
206
219
|
}
|
|
207
220
|
}
|
|
208
221
|
),
|
|
209
|
-
|
|
222
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
210
223
|
import_mui_textfield.TextField,
|
|
211
224
|
__spreadProps(__spreadValues({}, register("feedback", {
|
|
212
225
|
required: "This field is required",
|
|
@@ -224,12 +237,22 @@ var FeedbackForm = ({
|
|
|
224
237
|
},
|
|
225
238
|
helperText: ((_c = errors.feedback) == null ? void 0 : _c.message) || "Max 200 characters",
|
|
226
239
|
error: !!errors.feedback,
|
|
227
|
-
disabled: loading
|
|
240
|
+
disabled: loading || !smileFieldValue
|
|
228
241
|
})
|
|
229
242
|
),
|
|
230
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(FormActions, { container: true, direction: "row",
|
|
231
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Grid.default, { item: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_mui_button.Button, { color: "secondary", disabled: loading, onClick: handleClose, children: "
|
|
232
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Grid.default, { item: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
243
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(FormActions, { container: true, direction: "row", children: [
|
|
244
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Grid.default, { item: true, flex: 1, minWidth: "147px", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_mui_button.Button, { color: "secondary", disabled: loading, onClick: handleClose, children: "Close" }) }),
|
|
245
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Grid.default, { item: true, flex: 1, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
246
|
+
import_mui_button.LoadingButton,
|
|
247
|
+
{
|
|
248
|
+
disabled: !smileFieldValue,
|
|
249
|
+
loading,
|
|
250
|
+
type: "submit",
|
|
251
|
+
variant: "contained",
|
|
252
|
+
sx: { paddingLeft: 0, paddingRight: 0 },
|
|
253
|
+
children: "Send Feedback"
|
|
254
|
+
}
|
|
255
|
+
) })
|
|
233
256
|
] })
|
|
234
257
|
]
|
|
235
258
|
}
|
|
@@ -251,26 +274,30 @@ var FeedbackHeader = ({ appName, handleClose, loading, sent }) => {
|
|
|
251
274
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
252
275
|
FeedbackHeaderContainer,
|
|
253
276
|
{
|
|
254
|
-
alignItems: "
|
|
277
|
+
alignItems: "flex-start",
|
|
255
278
|
container: true,
|
|
256
279
|
direction: "row",
|
|
257
|
-
marginBottom: !sent ? "8px" : "0px",
|
|
258
280
|
justifyContent: "space-between",
|
|
259
281
|
flexWrap: "nowrap",
|
|
260
282
|
id: "feedback-form-header",
|
|
261
283
|
children: [
|
|
262
284
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_Grid2.default, { item: true, whiteSpace: "normal", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_mui_typography.Typography, { component: "h2", variant: "h5", children: sent ? "Thank you for your feedback." : `Tell us what you think about ${appName}` }) }),
|
|
263
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_Grid2.default, { item: true,
|
|
285
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_Grid2.default, { item: true, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_mui_button2.IconButton, { disabled: loading, title: "Close", onClick: handleClose, size: "medium", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_mui_icon2.CloseIcon, { fontSize: "xsmall" }) }) })
|
|
264
286
|
]
|
|
265
287
|
}
|
|
266
288
|
);
|
|
267
289
|
};
|
|
268
290
|
|
|
269
291
|
// src/lib/Feedback.tsx
|
|
292
|
+
var import_mui_icon3 = require("@availity/mui-icon");
|
|
270
293
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
271
294
|
var FeedbackContainer = (0, import_styles3.styled)(import_Container.default, { name: "AvFeedbackContainer", slot: "root" })({});
|
|
272
295
|
var GiveFeedbackButton = (0, import_styles3.styled)(import_mui_button3.Button, { name: "AvGiveFeedbackButton", slot: "root" })({});
|
|
273
|
-
var Feedback = ({
|
|
296
|
+
var Feedback = ({
|
|
297
|
+
analytics = import_api_axios2.avLogMessagesApiV2,
|
|
298
|
+
appName,
|
|
299
|
+
buttonVariant = "secondary"
|
|
300
|
+
}) => {
|
|
274
301
|
const [anchorEl, setAnchorEl] = (0, import_react2.useState)(null);
|
|
275
302
|
const [sent, setSent] = (0, import_react2.useState)(false);
|
|
276
303
|
const [loading, setLoading] = (0, import_react2.useState)(false);
|
|
@@ -283,7 +310,7 @@ var Feedback = ({ analytics = import_api_axios2.avLogMessagesApiV2, appName }) =
|
|
|
283
310
|
};
|
|
284
311
|
const open = Boolean(anchorEl);
|
|
285
312
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
286
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(GiveFeedbackButton, { onClick: handlePopoverOpen, color:
|
|
313
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(GiveFeedbackButton, { onClick: handlePopoverOpen, color: buttonVariant, startIcon: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_mui_icon3.CommentsIcon, {}), children: "Give Feedback" }),
|
|
287
314
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
288
315
|
import_mui_popover.Popover,
|
|
289
316
|
{
|
package/dist/index.mjs
CHANGED
|
@@ -61,7 +61,7 @@ import { avLogMessagesApiV2 } from "@availity/api-axios";
|
|
|
61
61
|
// src/lib/FeedbackForm.tsx
|
|
62
62
|
import { useEffect } from "react";
|
|
63
63
|
import { TextField } from "@availity/mui-textfield";
|
|
64
|
-
import { LoadingButton, Button } from "@availity/mui-button";
|
|
64
|
+
import { LoadingButton, Button, IconButton } from "@availity/mui-button";
|
|
65
65
|
import { ToggleButtonGroup, ToggleButton } from "@availity/mui-toggle-button";
|
|
66
66
|
import Grid from "@mui/material/Grid";
|
|
67
67
|
import { styled } from "@mui/material/styles";
|
|
@@ -74,7 +74,20 @@ var SmileButtons = styled(ToggleButtonGroup, { name: "AvFeedbackContainer", slot
|
|
|
74
74
|
var FormActions = styled(Grid, { name: "AvFeedbackContainer", slot: "FormActions" })({});
|
|
75
75
|
var SmileButton = (_a) => {
|
|
76
76
|
var _b = _a, { disabled, Icon, label, value } = _b, props = __objRest(_b, ["disabled", "Icon", "label", "value"]);
|
|
77
|
-
return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
77
|
+
return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
78
|
+
ToggleButton,
|
|
79
|
+
__spreadProps(__spreadValues({
|
|
80
|
+
component: IconButton,
|
|
81
|
+
disableRipple: true,
|
|
82
|
+
title: label,
|
|
83
|
+
"aria-label": value,
|
|
84
|
+
value
|
|
85
|
+
}, props), {
|
|
86
|
+
disabled,
|
|
87
|
+
size: "large",
|
|
88
|
+
children: /* @__PURE__ */ jsx(Icon, {})
|
|
89
|
+
})
|
|
90
|
+
) });
|
|
78
91
|
};
|
|
79
92
|
var FeedbackForm = ({
|
|
80
93
|
analytics,
|
|
@@ -173,7 +186,7 @@ var FeedbackForm = ({
|
|
|
173
186
|
}
|
|
174
187
|
}
|
|
175
188
|
),
|
|
176
|
-
|
|
189
|
+
/* @__PURE__ */ jsx(
|
|
177
190
|
TextField,
|
|
178
191
|
__spreadProps(__spreadValues({}, register("feedback", {
|
|
179
192
|
required: "This field is required",
|
|
@@ -191,12 +204,22 @@ var FeedbackForm = ({
|
|
|
191
204
|
},
|
|
192
205
|
helperText: ((_c = errors.feedback) == null ? void 0 : _c.message) || "Max 200 characters",
|
|
193
206
|
error: !!errors.feedback,
|
|
194
|
-
disabled: loading
|
|
207
|
+
disabled: loading || !smileFieldValue
|
|
195
208
|
})
|
|
196
209
|
),
|
|
197
|
-
/* @__PURE__ */ jsxs(FormActions, { container: true, direction: "row",
|
|
198
|
-
/* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(Button, { color: "secondary", disabled: loading, onClick: handleClose, children: "
|
|
199
|
-
/* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(
|
|
210
|
+
/* @__PURE__ */ jsxs(FormActions, { container: true, direction: "row", children: [
|
|
211
|
+
/* @__PURE__ */ jsx(Grid, { item: true, flex: 1, minWidth: "147px", children: /* @__PURE__ */ jsx(Button, { color: "secondary", disabled: loading, onClick: handleClose, children: "Close" }) }),
|
|
212
|
+
/* @__PURE__ */ jsx(Grid, { item: true, flex: 1, children: /* @__PURE__ */ jsx(
|
|
213
|
+
LoadingButton,
|
|
214
|
+
{
|
|
215
|
+
disabled: !smileFieldValue,
|
|
216
|
+
loading,
|
|
217
|
+
type: "submit",
|
|
218
|
+
variant: "contained",
|
|
219
|
+
sx: { paddingLeft: 0, paddingRight: 0 },
|
|
220
|
+
children: "Send Feedback"
|
|
221
|
+
}
|
|
222
|
+
) })
|
|
200
223
|
] })
|
|
201
224
|
]
|
|
202
225
|
}
|
|
@@ -207,7 +230,7 @@ var FeedbackForm = ({
|
|
|
207
230
|
};
|
|
208
231
|
|
|
209
232
|
// src/lib/FeedbackHeader.tsx
|
|
210
|
-
import { IconButton } from "@availity/mui-button";
|
|
233
|
+
import { IconButton as IconButton2 } from "@availity/mui-button";
|
|
211
234
|
import { CloseIcon } from "@availity/mui-icon";
|
|
212
235
|
import { Typography } from "@availity/mui-typography";
|
|
213
236
|
import Grid2 from "@mui/material/Grid";
|
|
@@ -218,26 +241,30 @@ var FeedbackHeader = ({ appName, handleClose, loading, sent }) => {
|
|
|
218
241
|
return /* @__PURE__ */ jsxs2(
|
|
219
242
|
FeedbackHeaderContainer,
|
|
220
243
|
{
|
|
221
|
-
alignItems: "
|
|
244
|
+
alignItems: "flex-start",
|
|
222
245
|
container: true,
|
|
223
246
|
direction: "row",
|
|
224
|
-
marginBottom: !sent ? "8px" : "0px",
|
|
225
247
|
justifyContent: "space-between",
|
|
226
248
|
flexWrap: "nowrap",
|
|
227
249
|
id: "feedback-form-header",
|
|
228
250
|
children: [
|
|
229
251
|
/* @__PURE__ */ jsx2(Grid2, { item: true, whiteSpace: "normal", children: /* @__PURE__ */ jsx2(Typography, { component: "h2", variant: "h5", children: sent ? "Thank you for your feedback." : `Tell us what you think about ${appName}` }) }),
|
|
230
|
-
/* @__PURE__ */ jsx2(Grid2, { item: true,
|
|
252
|
+
/* @__PURE__ */ jsx2(Grid2, { item: true, children: /* @__PURE__ */ jsx2(IconButton2, { disabled: loading, title: "Close", onClick: handleClose, size: "medium", children: /* @__PURE__ */ jsx2(CloseIcon, { fontSize: "xsmall" }) }) })
|
|
231
253
|
]
|
|
232
254
|
}
|
|
233
255
|
);
|
|
234
256
|
};
|
|
235
257
|
|
|
236
258
|
// src/lib/Feedback.tsx
|
|
259
|
+
import { CommentsIcon } from "@availity/mui-icon";
|
|
237
260
|
import { Fragment, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
238
261
|
var FeedbackContainer = styled3(Container, { name: "AvFeedbackContainer", slot: "root" })({});
|
|
239
262
|
var GiveFeedbackButton = styled3(Button2, { name: "AvGiveFeedbackButton", slot: "root" })({});
|
|
240
|
-
var Feedback = ({
|
|
263
|
+
var Feedback = ({
|
|
264
|
+
analytics = avLogMessagesApiV2,
|
|
265
|
+
appName,
|
|
266
|
+
buttonVariant = "secondary"
|
|
267
|
+
}) => {
|
|
241
268
|
const [anchorEl, setAnchorEl] = useState(null);
|
|
242
269
|
const [sent, setSent] = useState(false);
|
|
243
270
|
const [loading, setLoading] = useState(false);
|
|
@@ -250,7 +277,7 @@ var Feedback = ({ analytics = avLogMessagesApiV2, appName }) => {
|
|
|
250
277
|
};
|
|
251
278
|
const open = Boolean(anchorEl);
|
|
252
279
|
return /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
253
|
-
/* @__PURE__ */ jsx3(GiveFeedbackButton, { onClick: handlePopoverOpen, color:
|
|
280
|
+
/* @__PURE__ */ jsx3(GiveFeedbackButton, { onClick: handlePopoverOpen, color: buttonVariant, startIcon: /* @__PURE__ */ jsx3(CommentsIcon, {}), children: "Give Feedback" }),
|
|
254
281
|
/* @__PURE__ */ jsx3(
|
|
255
282
|
Popover,
|
|
256
283
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@availity/mui-feedback",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"description": "Availity MUI Feedback Component - part of the @availity/element design system",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -48,10 +48,10 @@
|
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@availity/api-axios": "^9.0.0",
|
|
50
50
|
"@availity/mui-button": "^0.6.10",
|
|
51
|
-
"@availity/mui-form-utils": "^0.12.
|
|
51
|
+
"@availity/mui-form-utils": "^0.12.5",
|
|
52
52
|
"@availity/mui-icon": "^0.10.1",
|
|
53
53
|
"@availity/mui-popover": "^0.1.5",
|
|
54
|
-
"@availity/mui-textfield": "^0.6.
|
|
54
|
+
"@availity/mui-textfield": "^0.6.5",
|
|
55
55
|
"@availity/mui-toggle-button": "^0.1.13",
|
|
56
56
|
"@availity/mui-typography": "^0.2.0",
|
|
57
57
|
"react-hook-form": "^7.51.3"
|
package/src/lib/Feedback.tsx
CHANGED
|
@@ -6,17 +6,23 @@ import { styled } from '@mui/material/styles';
|
|
|
6
6
|
import { avLogMessagesApiV2 } from '@availity/api-axios';
|
|
7
7
|
import { FeedbackForm } from './FeedbackForm';
|
|
8
8
|
import { FeedbackHeader } from './FeedbackHeader';
|
|
9
|
+
import { CommentsIcon } from '@availity/mui-icon';
|
|
9
10
|
|
|
10
11
|
export interface FeedbackProps {
|
|
11
12
|
analytics?: { info: (entries: Record<string, unknown>) => void };
|
|
12
13
|
appName: string;
|
|
14
|
+
buttonVariant?: 'secondary' | 'tertiary';
|
|
13
15
|
}
|
|
14
16
|
|
|
15
17
|
const FeedbackContainer = styled(Container, { name: 'AvFeedbackContainer', slot: 'root' })({});
|
|
16
18
|
|
|
17
19
|
const GiveFeedbackButton = styled(Button, { name: 'AvGiveFeedbackButton', slot: 'root' })({});
|
|
18
20
|
|
|
19
|
-
export const Feedback = ({
|
|
21
|
+
export const Feedback = ({
|
|
22
|
+
analytics = avLogMessagesApiV2,
|
|
23
|
+
appName,
|
|
24
|
+
buttonVariant = 'secondary',
|
|
25
|
+
}: FeedbackProps): JSX.Element => {
|
|
20
26
|
const [anchorEl, setAnchorEl] = useState<HTMLElement | null>(null);
|
|
21
27
|
const [sent, setSent] = useState<boolean>(false);
|
|
22
28
|
const [loading, setLoading] = useState<boolean>(false);
|
|
@@ -34,7 +40,7 @@ export const Feedback = ({ analytics = avLogMessagesApiV2, appName }: FeedbackPr
|
|
|
34
40
|
|
|
35
41
|
return (
|
|
36
42
|
<>
|
|
37
|
-
<GiveFeedbackButton onClick={handlePopoverOpen} color=
|
|
43
|
+
<GiveFeedbackButton onClick={handlePopoverOpen} color={buttonVariant} startIcon={<CommentsIcon />}>
|
|
38
44
|
Give Feedback
|
|
39
45
|
</GiveFeedbackButton>
|
|
40
46
|
<Popover
|
package/src/lib/FeedbackForm.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useEffect } from 'react';
|
|
2
2
|
import { TextField } from '@availity/mui-textfield';
|
|
3
|
-
import { LoadingButton, Button } from '@availity/mui-button';
|
|
3
|
+
import { LoadingButton, Button, IconButton } from '@availity/mui-button';
|
|
4
4
|
import { ToggleButtonGroup, ToggleButton } from '@availity/mui-toggle-button';
|
|
5
5
|
import Grid from '@mui/material/Grid';
|
|
6
6
|
import { SvgIconProps } from '@mui/material/SvgIcon';
|
|
@@ -41,8 +41,17 @@ const FormActions = styled(Grid, { name: 'AvFeedbackContainer', slot: 'FormActio
|
|
|
41
41
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
42
42
|
const SmileButton = ({ disabled, Icon, label, value, ...props }: SmileButtonProps) => (
|
|
43
43
|
<div>
|
|
44
|
-
<ToggleButton
|
|
45
|
-
|
|
44
|
+
<ToggleButton
|
|
45
|
+
component={IconButton}
|
|
46
|
+
disableRipple
|
|
47
|
+
title={label}
|
|
48
|
+
aria-label={value}
|
|
49
|
+
value={value}
|
|
50
|
+
{...props}
|
|
51
|
+
disabled={disabled}
|
|
52
|
+
size="large"
|
|
53
|
+
>
|
|
54
|
+
<Icon />
|
|
46
55
|
</ToggleButton>
|
|
47
56
|
</div>
|
|
48
57
|
);
|
|
@@ -148,35 +157,39 @@ export const FeedbackForm = ({
|
|
|
148
157
|
);
|
|
149
158
|
}}
|
|
150
159
|
/>
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
<FormActions container direction="row" spacing={1}>
|
|
173
|
-
<Grid item>
|
|
160
|
+
<TextField
|
|
161
|
+
{...register('feedback', {
|
|
162
|
+
required: 'This field is required',
|
|
163
|
+
maxLength: { value: 200, message: 'This field must not exceed 200 characters' },
|
|
164
|
+
})}
|
|
165
|
+
fullWidth
|
|
166
|
+
multiline
|
|
167
|
+
minRows={3}
|
|
168
|
+
maxRows={3}
|
|
169
|
+
label={getFeedbackLabel()}
|
|
170
|
+
inputProps={{ 'aria-required': 'true' }}
|
|
171
|
+
InputLabelProps={{
|
|
172
|
+
component: FormLabel,
|
|
173
|
+
required: true,
|
|
174
|
+
}}
|
|
175
|
+
helperText={errors.feedback?.message || 'Max 200 characters'}
|
|
176
|
+
error={!!errors.feedback}
|
|
177
|
+
disabled={loading || !smileFieldValue}
|
|
178
|
+
/>
|
|
179
|
+
<FormActions container direction="row">
|
|
180
|
+
<Grid item flex={1} minWidth="147px">
|
|
174
181
|
<Button color="secondary" disabled={loading} onClick={handleClose}>
|
|
175
|
-
|
|
182
|
+
Close
|
|
176
183
|
</Button>
|
|
177
184
|
</Grid>
|
|
178
|
-
<Grid item>
|
|
179
|
-
<LoadingButton
|
|
185
|
+
<Grid item flex={1}>
|
|
186
|
+
<LoadingButton
|
|
187
|
+
disabled={!smileFieldValue}
|
|
188
|
+
loading={loading}
|
|
189
|
+
type="submit"
|
|
190
|
+
variant="contained"
|
|
191
|
+
sx={{ paddingLeft: 0, paddingRight: 0 }}
|
|
192
|
+
>
|
|
180
193
|
Send Feedback
|
|
181
194
|
</LoadingButton>
|
|
182
195
|
</Grid>
|
|
@@ -16,10 +16,9 @@ const FeedbackHeaderContainer = styled(Grid, { name: 'AvFeedbackContainer', slot
|
|
|
16
16
|
export const FeedbackHeader = ({ appName, handleClose, loading, sent }: FeedbackHeaderProps): JSX.Element => {
|
|
17
17
|
return (
|
|
18
18
|
<FeedbackHeaderContainer
|
|
19
|
-
alignItems="
|
|
19
|
+
alignItems="flex-start"
|
|
20
20
|
container
|
|
21
21
|
direction="row"
|
|
22
|
-
marginBottom={!sent ? '8px' : '0px'}
|
|
23
22
|
justifyContent="space-between"
|
|
24
23
|
flexWrap="nowrap"
|
|
25
24
|
id="feedback-form-header"
|
|
@@ -29,9 +28,9 @@ export const FeedbackHeader = ({ appName, handleClose, loading, sent }: Feedback
|
|
|
29
28
|
{sent ? 'Thank you for your feedback.' : `Tell us what you think about ${appName}`}
|
|
30
29
|
</Typography>
|
|
31
30
|
</Grid>
|
|
32
|
-
<Grid item
|
|
33
|
-
<IconButton disabled={loading} title="Close" onClick={handleClose}>
|
|
34
|
-
<CloseIcon />
|
|
31
|
+
<Grid item>
|
|
32
|
+
<IconButton disabled={loading} title="Close" onClick={handleClose} size="medium">
|
|
33
|
+
<CloseIcon fontSize="xsmall" />
|
|
35
34
|
</IconButton>
|
|
36
35
|
</Grid>
|
|
37
36
|
</FeedbackHeaderContainer>
|