@webority/insights-react 0.88.1 → 0.90.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.
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"format": "webority-guidance/1",
|
|
3
|
+
"package": {
|
|
4
|
+
"name": "@webority/insights-react",
|
|
5
|
+
"version": "0.90.0"
|
|
6
|
+
},
|
|
7
|
+
"components": [
|
|
8
|
+
{
|
|
9
|
+
"name": "FeedbackButton",
|
|
10
|
+
"usage": {
|
|
11
|
+
"when": [
|
|
12
|
+
"A portal lets a person send a free comment from any page.",
|
|
13
|
+
"The comment goes with the page it was written on, unless pagePath names another page."
|
|
14
|
+
],
|
|
15
|
+
"whenNot": [],
|
|
16
|
+
"do": [],
|
|
17
|
+
"dont": [],
|
|
18
|
+
"a11y": [
|
|
19
|
+
"The button is a native button that opens the drawer, a dialog named by its title.",
|
|
20
|
+
"The comment box takes the drawer title as its accessible name.",
|
|
21
|
+
"Send stays disabled while the comment is empty or only spaces.",
|
|
22
|
+
"The thanks message is a status region."
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "NpsPrompt",
|
|
28
|
+
"usage": {
|
|
29
|
+
"when": [
|
|
30
|
+
"A portal asks the one question of how likely a person is to recommend the product.",
|
|
31
|
+
"It asks once per mount, and only when the server says the question is due.",
|
|
32
|
+
"Send posts the score and an optional comment; Not now is a permanent answer the server records."
|
|
33
|
+
],
|
|
34
|
+
"whenNot": [],
|
|
35
|
+
"do": [],
|
|
36
|
+
"dont": [],
|
|
37
|
+
"a11y": [
|
|
38
|
+
"The score scale is a radio group named by the question, with one control per score.",
|
|
39
|
+
"The comment box appears only after a score is chosen.",
|
|
40
|
+
"Send stays disabled until a score is chosen.",
|
|
41
|
+
"The thanks message is a status region."
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
}
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
* page path, unless `pagePath` is given.
|
|
4
4
|
*
|
|
5
5
|
* @param {object} props
|
|
6
|
-
* @param {string} [props.label
|
|
7
|
-
* @param {string} [props.title
|
|
8
|
-
* @param {string} [props.placeholder
|
|
9
|
-
* @param {string} [props.sendLabel
|
|
10
|
-
* @param {string} [props.thanks
|
|
11
|
-
* @param {string|null} [props.pagePath]
|
|
6
|
+
* @param {string} [props.label]
|
|
7
|
+
* @param {string} [props.title]
|
|
8
|
+
* @param {string} [props.placeholder]
|
|
9
|
+
* @param {string} [props.sendLabel]
|
|
10
|
+
* @param {string} [props.thanks]
|
|
11
|
+
* @param {string|null} [props.pagePath]
|
|
12
12
|
*/
|
|
13
13
|
export default function FeedbackButton({ label, title, placeholder, sendLabel, thanks, pagePath, }: {
|
|
14
14
|
label?: string;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export declare const meta: {
|
|
2
|
+
readonly name: "FeedbackButton";
|
|
3
|
+
readonly marker: any;
|
|
4
|
+
readonly platforms: readonly ["web"];
|
|
5
|
+
readonly acceptsChildren: false;
|
|
6
|
+
readonly props: {
|
|
7
|
+
readonly label: {
|
|
8
|
+
readonly type: "string";
|
|
9
|
+
readonly default: "Feedback";
|
|
10
|
+
readonly description: "The text on the button that opens the drawer.";
|
|
11
|
+
};
|
|
12
|
+
readonly title: {
|
|
13
|
+
readonly type: "string";
|
|
14
|
+
readonly default: "Send us feedback";
|
|
15
|
+
readonly description: "The drawer's heading. It also names the comment box.";
|
|
16
|
+
};
|
|
17
|
+
readonly placeholder: {
|
|
18
|
+
readonly type: "string";
|
|
19
|
+
readonly default: "Tell us what works and what does not";
|
|
20
|
+
readonly description: "The hint shown in the empty comment box.";
|
|
21
|
+
};
|
|
22
|
+
readonly sendLabel: {
|
|
23
|
+
readonly type: "string";
|
|
24
|
+
readonly default: "Send";
|
|
25
|
+
readonly description: "The text on the button that sends the comment.";
|
|
26
|
+
};
|
|
27
|
+
readonly thanks: {
|
|
28
|
+
readonly type: "string";
|
|
29
|
+
readonly default: "Thanks, we read every message.";
|
|
30
|
+
readonly description: "The message shown in the drawer after the comment is sent.";
|
|
31
|
+
};
|
|
32
|
+
readonly pagePath: {
|
|
33
|
+
readonly type: "string";
|
|
34
|
+
readonly description: "The page the comment is about. It defaults to the current path, read when the comment is sent. Null is accepted.";
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
readonly omit: readonly [];
|
|
38
|
+
readonly examples: readonly [{
|
|
39
|
+
readonly id: "FeedbackButton";
|
|
40
|
+
readonly title: "Default";
|
|
41
|
+
readonly props: {};
|
|
42
|
+
}, {
|
|
43
|
+
readonly id: "FeedbackButton.pagePath";
|
|
44
|
+
readonly title: "Fixed page";
|
|
45
|
+
readonly props: {
|
|
46
|
+
readonly pagePath: "/billing";
|
|
47
|
+
};
|
|
48
|
+
}, {
|
|
49
|
+
readonly id: "FeedbackButton.labels";
|
|
50
|
+
readonly title: "Custom labels";
|
|
51
|
+
readonly props: {
|
|
52
|
+
readonly label: "Give feedback";
|
|
53
|
+
readonly title: "Tell us more";
|
|
54
|
+
readonly placeholder: "What should change?";
|
|
55
|
+
readonly sendLabel: "Post";
|
|
56
|
+
readonly thanks: "Got it.";
|
|
57
|
+
};
|
|
58
|
+
}];
|
|
59
|
+
readonly usage: {
|
|
60
|
+
readonly when: readonly ["A portal lets a person send a free comment from any page.", "The comment goes with the page it was written on, unless pagePath names another page."];
|
|
61
|
+
readonly whenNot: readonly [];
|
|
62
|
+
readonly do: readonly [];
|
|
63
|
+
readonly dont: readonly [];
|
|
64
|
+
readonly a11y: readonly ["The button is a native button that opens the drawer, a dialog named by its title.", "The comment box takes the drawer title as its accessible name.", "Send stays disabled while the comment is empty or only spaces.", "The thanks message is a status region."];
|
|
65
|
+
};
|
|
66
|
+
};
|
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
* answer the server records, so the question does not come back.
|
|
5
5
|
*
|
|
6
6
|
* @param {object} props
|
|
7
|
-
* @param {string} [props.question
|
|
8
|
-
* @param {string} [props.lowLabel
|
|
9
|
-
* @param {string} [props.highLabel
|
|
10
|
-
* @param {string} [props.commentLabel
|
|
11
|
-
* @param {string} [props.sendLabel
|
|
12
|
-
* @param {string} [props.notNowLabel
|
|
13
|
-
* @param {string} [props.thanks
|
|
7
|
+
* @param {string} [props.question]
|
|
8
|
+
* @param {string} [props.lowLabel]
|
|
9
|
+
* @param {string} [props.highLabel]
|
|
10
|
+
* @param {string} [props.commentLabel]
|
|
11
|
+
* @param {string} [props.sendLabel]
|
|
12
|
+
* @param {string} [props.notNowLabel]
|
|
13
|
+
* @param {string} [props.thanks]
|
|
14
14
|
*/
|
|
15
15
|
export default function NpsPrompt({ question, lowLabel, highLabel, commentLabel, sendLabel, notNowLabel, thanks, }: {
|
|
16
16
|
question?: string;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export declare const meta: {
|
|
2
|
+
readonly name: "NpsPrompt";
|
|
3
|
+
readonly marker: any;
|
|
4
|
+
readonly platforms: readonly ["web"];
|
|
5
|
+
readonly acceptsChildren: false;
|
|
6
|
+
readonly props: {
|
|
7
|
+
readonly question: {
|
|
8
|
+
readonly type: "string";
|
|
9
|
+
readonly default: "How likely are you to recommend us to a colleague?";
|
|
10
|
+
readonly description: "The question asked above the score scale.";
|
|
11
|
+
};
|
|
12
|
+
readonly lowLabel: {
|
|
13
|
+
readonly type: "string";
|
|
14
|
+
readonly default: "Not likely";
|
|
15
|
+
readonly description: "The label under the lowest score.";
|
|
16
|
+
};
|
|
17
|
+
readonly highLabel: {
|
|
18
|
+
readonly type: "string";
|
|
19
|
+
readonly default: "Very likely";
|
|
20
|
+
readonly description: "The label under the highest score.";
|
|
21
|
+
};
|
|
22
|
+
readonly commentLabel: {
|
|
23
|
+
readonly type: "string";
|
|
24
|
+
readonly default: "What is the main reason for your score? (optional)";
|
|
25
|
+
readonly description: "The label of the optional comment box that appears once a score is chosen.";
|
|
26
|
+
};
|
|
27
|
+
readonly sendLabel: {
|
|
28
|
+
readonly type: "string";
|
|
29
|
+
readonly default: "Send";
|
|
30
|
+
readonly description: "The text on the button that sends the score and comment.";
|
|
31
|
+
};
|
|
32
|
+
readonly notNowLabel: {
|
|
33
|
+
readonly type: "string";
|
|
34
|
+
readonly default: "Not now";
|
|
35
|
+
readonly description: "The text on the button that dismisses the question for good.";
|
|
36
|
+
};
|
|
37
|
+
readonly thanks: {
|
|
38
|
+
readonly type: "string";
|
|
39
|
+
readonly default: "Thanks for your feedback.";
|
|
40
|
+
readonly description: "The message shown after the score is sent.";
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
readonly omit: readonly [];
|
|
44
|
+
readonly examples: readonly [{
|
|
45
|
+
readonly id: "NpsPrompt";
|
|
46
|
+
readonly title: "Default";
|
|
47
|
+
readonly props: {};
|
|
48
|
+
}, {
|
|
49
|
+
readonly id: "NpsPrompt.labels";
|
|
50
|
+
readonly title: "Custom labels";
|
|
51
|
+
readonly props: {
|
|
52
|
+
readonly question: "Would you recommend us?";
|
|
53
|
+
readonly lowLabel: "Never";
|
|
54
|
+
readonly highLabel: "Always";
|
|
55
|
+
readonly commentLabel: "Why?";
|
|
56
|
+
readonly sendLabel: "Go";
|
|
57
|
+
readonly notNowLabel: "Later";
|
|
58
|
+
readonly thanks: "Cheers.";
|
|
59
|
+
};
|
|
60
|
+
}];
|
|
61
|
+
readonly usage: {
|
|
62
|
+
readonly when: readonly ["A portal asks the one question of how likely a person is to recommend the product.", "It asks once per mount, and only when the server says the question is due.", "Send posts the score and an optional comment; Not now is a permanent answer the server records."];
|
|
63
|
+
readonly whenNot: readonly [];
|
|
64
|
+
readonly do: readonly [];
|
|
65
|
+
readonly dont: readonly [];
|
|
66
|
+
readonly a11y: readonly ["The score scale is a radio group named by the question, with one control per score.", "The comment box appears only after a score is chosen.", "Send stays disabled until a score is chosen.", "The thanks message is a status region."];
|
|
67
|
+
};
|
|
68
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webority/insights-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.90.0",
|
|
4
4
|
"description": "Webority product feedback for React portals: the NPS question and a feedback button that post to the product's Webority.Insights feedback API, built on @webority/ui-react.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"type": "module",
|
|
@@ -22,7 +22,8 @@
|
|
|
22
22
|
"types": "./dist/types/index.d.ts",
|
|
23
23
|
"default": "./dist/insights-react.js"
|
|
24
24
|
},
|
|
25
|
-
"./package.json": "./package.json"
|
|
25
|
+
"./package.json": "./package.json",
|
|
26
|
+
"./guidance.json": "./dist/guidance.json"
|
|
26
27
|
},
|
|
27
28
|
"sideEffects": false,
|
|
28
29
|
"peerDependencies": {
|
|
@@ -30,7 +31,7 @@
|
|
|
30
31
|
"react": "^19.0.0",
|
|
31
32
|
"react-bootstrap": "^2.10.0",
|
|
32
33
|
"react-dom": "^19.0.0",
|
|
33
|
-
"@webority/ui-react": "0.
|
|
34
|
+
"@webority/ui-react": "0.90.0"
|
|
34
35
|
},
|
|
35
36
|
"devDependencies": {
|
|
36
37
|
"@testing-library/dom": "10.4.2",
|
|
@@ -48,10 +49,11 @@
|
|
|
48
49
|
"typescript": "^7.0.2",
|
|
49
50
|
"vite": "^8.0.12",
|
|
50
51
|
"vitest": "5.0.1",
|
|
51
|
-
"@webority/
|
|
52
|
+
"@webority/canvas-kit": "0.90.0",
|
|
53
|
+
"@webority/ui-react": "0.90.0"
|
|
52
54
|
},
|
|
53
55
|
"scripts": {
|
|
54
|
-
"build": "vite build && tsc -p tsconfig.json",
|
|
56
|
+
"build": "vite build && tsc -p tsconfig.json && node ../canvas-kit/dist/cli.js guidance --config canvas-kit.json --out dist/guidance.json",
|
|
55
57
|
"test": "vitest run",
|
|
56
58
|
"test:watch": "vitest",
|
|
57
59
|
"test:coverage": "vitest run --coverage"
|