@redocly/theme 0.6.4 → 0.7.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.
Files changed (86) hide show
  1. package/lib/Feedback/Comment.d.ts +3 -0
  2. package/lib/Feedback/Comment.js +80 -0
  3. package/lib/Feedback/Rating.d.ts +3 -0
  4. package/lib/Feedback/Rating.js +82 -0
  5. package/lib/Feedback/Reasons.d.ts +3 -0
  6. package/lib/Feedback/Reasons.js +85 -0
  7. package/lib/Feedback/Sentiment.d.ts +3 -0
  8. package/lib/Feedback/Sentiment.js +79 -0
  9. package/lib/Feedback/Thumbs.d.ts +7 -0
  10. package/lib/Feedback/Thumbs.js +79 -0
  11. package/lib/Feedback/index.d.ts +5 -0
  12. package/lib/Feedback/index.js +27 -0
  13. package/lib/Feedback/types.d.ts +71 -0
  14. package/lib/Feedback/types.js +3 -0
  15. package/lib/Markdown/MarkdownLayout.d.ts +2 -1
  16. package/lib/Markdown/MarkdownLayout.js +8 -2
  17. package/lib/Markdown/Tabs/Tab.js +11 -5
  18. package/lib/Markdown/Tabs/Tabs.js +14 -5
  19. package/lib/Navbar/Navbar.js +6 -3
  20. package/lib/Pages/Forbidden.d.ts +2 -0
  21. package/lib/Pages/Forbidden.js +39 -0
  22. package/lib/Pages/NotFound.d.ts +2 -0
  23. package/lib/Pages/NotFound.js +39 -0
  24. package/lib/Pages/index.d.ts +1 -0
  25. package/lib/Pages/index.js +18 -0
  26. package/lib/Profile/LoginLink.d.ts +5 -0
  27. package/lib/Profile/LoginLink.js +30 -0
  28. package/lib/Profile/Profile.js +3 -1
  29. package/lib/Profile/UserProfile.d.ts +13 -0
  30. package/lib/Profile/UserProfile.js +82 -0
  31. package/lib/Profile/index.d.ts +4 -0
  32. package/lib/Profile/index.js +5 -1
  33. package/lib/Search/Autocomplete.d.ts +4 -1
  34. package/lib/Search/Autocomplete.js +19 -3
  35. package/lib/Search/ClearIcon.js +1 -1
  36. package/lib/Search/Input.js +1 -1
  37. package/lib/Search/Search.js +6 -1
  38. package/lib/Search/SearchIcon.js +1 -1
  39. package/lib/Search/ShortcutKey.d.ts +7 -0
  40. package/lib/Search/ShortcutKey.js +35 -0
  41. package/lib/config.d.ts +61 -0
  42. package/lib/config.js +19 -0
  43. package/lib/globalStyle.js +62 -0
  44. package/lib/index.d.ts +2 -0
  45. package/lib/index.js +2 -0
  46. package/lib/mocks/Link.js +1 -1
  47. package/lib/mocks/hooks/index.js +11 -1
  48. package/lib/mocks/search.js +18 -5
  49. package/lib/ui/Box.d.ts +2 -2
  50. package/lib/ui/Box.js +1 -0
  51. package/lib/ui/darkColors.js +5 -0
  52. package/package.json +9 -5
  53. package/src/Feedback/Comment.tsx +64 -0
  54. package/src/Feedback/Rating.tsx +107 -0
  55. package/src/Feedback/Reasons.tsx +81 -0
  56. package/src/Feedback/Sentiment.tsx +75 -0
  57. package/src/Feedback/Thumbs.tsx +116 -0
  58. package/src/Feedback/index.ts +5 -0
  59. package/src/Feedback/types.ts +63 -0
  60. package/src/Markdown/MarkdownLayout.tsx +10 -1
  61. package/src/Markdown/Tabs/Tab.tsx +11 -5
  62. package/src/Markdown/Tabs/Tabs.tsx +14 -5
  63. package/src/Navbar/Navbar.tsx +8 -3
  64. package/src/Pages/Forbidden.tsx +42 -0
  65. package/src/Pages/NotFound.tsx +42 -0
  66. package/src/Pages/index.ts +1 -0
  67. package/src/Profile/LoginLink.tsx +29 -0
  68. package/src/Profile/Profile.tsx +3 -1
  69. package/src/Profile/UserProfile.tsx +101 -0
  70. package/src/Profile/index.ts +4 -0
  71. package/src/Search/Autocomplete.tsx +26 -2
  72. package/src/Search/ClearIcon.tsx +1 -1
  73. package/src/Search/Input.tsx +1 -1
  74. package/src/Search/Search.tsx +3 -0
  75. package/src/Search/SearchIcon.tsx +1 -1
  76. package/src/Search/ShortcutKey.tsx +35 -0
  77. package/src/config.ts +23 -0
  78. package/src/globalStyle.ts +64 -0
  79. package/src/index.ts +2 -0
  80. package/src/mocks/Link.tsx +2 -1
  81. package/src/mocks/hooks/index.ts +11 -1
  82. package/src/mocks/search.ts +20 -5
  83. package/src/settings.yaml +2 -0
  84. package/src/types/portal/index.d.ts +1 -1
  85. package/src/ui/Box.tsx +5 -2
  86. package/src/ui/darkColors.tsx +5 -0
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { CommentProps } from '../Feedback';
3
+ export declare const Comment: ({ settings, onSubmit }: CommentProps) => JSX.Element;
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.Comment = void 0;
30
+ const React = __importStar(require("react"));
31
+ const styled_components_1 = __importDefault(require("styled-components"));
32
+ const _theme_1 = require("../index.js");
33
+ const Comment = ({ settings, onSubmit }) => {
34
+ const { label, submitText } = settings || {};
35
+ const [text, setText] = React.useState('');
36
+ const [submitValue, setSubmitValue] = React.useState('');
37
+ const send = () => {
38
+ if (!text)
39
+ return;
40
+ setSubmitValue(text);
41
+ onSubmit({ comment: text });
42
+ };
43
+ const handleTextAreaChange = (e) => {
44
+ setText(e.target.value);
45
+ };
46
+ if (submitValue) {
47
+ return (React.createElement(Wrapper, null,
48
+ React.createElement(Label, null, submitText || 'Thank you for helping improve our documentation!')));
49
+ }
50
+ return (React.createElement(Wrapper, { "data-component-name": "Feedback/Comment" },
51
+ React.createElement(Label, null, label || 'Please share your feedback with us:'),
52
+ React.createElement(TextArea, { rows: 3, onChange: handleTextAreaChange }),
53
+ React.createElement(SendButton, { onClick: send }, "Send")));
54
+ };
55
+ exports.Comment = Comment;
56
+ const Wrapper = styled_components_1.default.div `
57
+ font-family: var(--font-family-base);
58
+ display: flex;
59
+ flex-direction: column;
60
+ width: 100%;
61
+ `;
62
+ const Label = styled_components_1.default.h3 `
63
+ margin-right: 15px;
64
+ `;
65
+ const TextArea = styled_components_1.default.textarea `
66
+ font-family: var(--font-family-base);
67
+ border: 1px solid #ccc;
68
+ border-radius: 5px;
69
+ color: black;
70
+ margin: 0 0 10px 0;
71
+ padding: 10px;
72
+ `;
73
+ const SendButton = (0, styled_components_1.default)(_theme_1.Button).attrs(() => ({
74
+ color: 'primary',
75
+ })) `
76
+ width: 100px;
77
+ margin-left: 0;
78
+ margin-right: 0;
79
+ `;
80
+ //# sourceMappingURL=Comment.js.map
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { RatingProps } from '../Feedback';
3
+ export declare const Rating: ({ settings, onSubmit }: RatingProps) => JSX.Element;
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.Rating = void 0;
30
+ const React = __importStar(require("react"));
31
+ const styled_components_1 = __importDefault(require("styled-components"));
32
+ const Feedback_1 = require("../Feedback");
33
+ const Rating = ({ settings, onSubmit }) => {
34
+ const { label, max, submitText, comment: commentSettings, reasons: reasonsSettings, } = settings || {};
35
+ const [score, setScore] = React.useState(0);
36
+ const [comment, setComment] = React.useState('');
37
+ const [reasons, setReasons] = React.useState([]);
38
+ if (score && (reasonsSettings === null || reasonsSettings === void 0 ? void 0 : reasonsSettings.enable) && !reasons.length) {
39
+ const { label: reasonsLabel, items, multi } = reasonsSettings;
40
+ const buttonText = (commentSettings === null || commentSettings === void 0 ? void 0 : commentSettings.enable) ? 'Next' : 'Send';
41
+ return (React.createElement(Feedback_1.Reasons, { onSubmit: ({ reasons }) => setReasons(reasons), settings: { label: reasonsLabel, items, multi, buttonText } }));
42
+ }
43
+ if (score && (commentSettings === null || commentSettings === void 0 ? void 0 : commentSettings.enable) && !comment) {
44
+ return (React.createElement(Feedback_1.Comment, { onSubmit: ({ comment }) => setComment(comment), settings: { label: commentSettings.label } }));
45
+ }
46
+ if (score) {
47
+ onSubmit({
48
+ score,
49
+ comment,
50
+ reasons,
51
+ });
52
+ return (React.createElement(Wrapper, null,
53
+ React.createElement(Label, null, submitText || 'Thank you for helping improve our documentation!')));
54
+ }
55
+ return (React.createElement(Wrapper, { "data-component-name": "Feedback/Rating" },
56
+ React.createElement(Label, null, label || 'How helpful was this page?'),
57
+ React.createElement(Stars, { max: max || 5, onSubmit: setScore })));
58
+ };
59
+ exports.Rating = Rating;
60
+ const Stars = ({ max, onSubmit }) => {
61
+ const [hovered, setHovered] = React.useState(0);
62
+ const stars = [];
63
+ for (let index = 1; index <= max; index++) {
64
+ stars.push(React.createElement(Star, { key: index, onClick: () => onSubmit(index), onMouseOver: () => setHovered(index), onMouseLeave: () => setHovered(0) },
65
+ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 20 20" }, hovered < index ? (React.createElement("g", { fill: "#e8c002" },
66
+ React.createElement("path", { d: "M20 7h-7L10 .5 7 7H0l5.46 5.47-1.64 7 6.18-3.7 6.18 3.73-1.63-7zm-10 6.9-3.76 2.27 1-4.28L3.5 8.5h4.61L10 4.6l1.9 3.9h4.6l-3.73 3.4 1 4.28z" }))) : (React.createElement("g", { fill: "#e8c002" },
67
+ React.createElement("path", { d: "M20 7h-7L10 .5 7 7H0l5.46 5.47-1.64 7 6.18-3.7 6.18 3.73-1.63-7z" }))))));
68
+ }
69
+ return React.createElement(React.Fragment, null, stars);
70
+ };
71
+ const Wrapper = styled_components_1.default.div `
72
+ display: flex;
73
+ align-items: center;
74
+ `;
75
+ const Star = styled_components_1.default.span `
76
+ cursor: pointer;
77
+ `;
78
+ const Label = styled_components_1.default.h3 `
79
+ margin-right: 15px;
80
+ font-family: var(--font-family-base);
81
+ `;
82
+ //# sourceMappingURL=Rating.js.map
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { ReasonsProps } from '../Feedback';
3
+ export declare const Reasons: ({ settings, onSubmit }: ReasonsProps) => JSX.Element;
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.Reasons = void 0;
30
+ const React = __importStar(require("react"));
31
+ const styled_components_1 = __importDefault(require("styled-components"));
32
+ const _theme_1 = require("../index.js");
33
+ const Reasons = ({ settings, onSubmit }) => {
34
+ const { label, multi, buttonText, items = [] } = settings;
35
+ const [checkedState, setCheckedState] = React.useState(new Array(items.length).fill(false));
36
+ if (!items.length) {
37
+ return React.createElement(React.Fragment, null);
38
+ }
39
+ const input_type = multi ? 'checkbox' : 'radio';
40
+ const handleOptionChange = (position) => {
41
+ const updatedCheckedState = multi
42
+ ? checkedState.map((item, index) => (index === position ? !item : item))
43
+ : items.map((_, idx) => position === idx);
44
+ setCheckedState(updatedCheckedState);
45
+ };
46
+ const submitForm = () => {
47
+ onSubmit({ reasons: items.filter((_, index) => !!checkedState[index]) });
48
+ };
49
+ return (React.createElement(Wrapper, { "data-component-name": "Feedback/Reasons" },
50
+ React.createElement(Label, null, label || 'Which statement describes your thoughts about this page?'),
51
+ items.map((reason, idx) => (React.createElement(OptionWrapper, { key: reason },
52
+ React.createElement("input", { type: input_type, value: reason, checked: checkedState[idx], name: "reasons", onChange: () => handleOptionChange(idx) }),
53
+ React.createElement("label", { id: reason, onClick: () => handleOptionChange(idx) }, reason)))),
54
+ React.createElement(SendButton, { onClick: submitForm }, buttonText || 'Send')));
55
+ };
56
+ exports.Reasons = Reasons;
57
+ const Wrapper = styled_components_1.default.div `
58
+ font-family: var(--font-family-base);
59
+ display: flex;
60
+ flex-direction: column;
61
+ `;
62
+ const Label = styled_components_1.default.h3 `
63
+ margin-right: 15px;
64
+ `;
65
+ const SendButton = (0, styled_components_1.default)(_theme_1.Button).attrs(() => ({
66
+ color: 'primary',
67
+ })) `
68
+ width: 100px;
69
+ margin-left: 0;
70
+ margin-right: 0;
71
+ margin-top: 15px;
72
+ `;
73
+ const OptionWrapper = styled_components_1.default.div `
74
+ margin: 5px 0;
75
+ display: flex;
76
+ input {
77
+ margin-right: 10px;
78
+ cursor: pointer;
79
+ }
80
+ label {
81
+ font-size: 14px;
82
+ cursor: pointer;
83
+ }
84
+ `;
85
+ //# sourceMappingURL=Reasons.js.map
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { SentimentProps } from '../Feedback';
3
+ export declare const Sentiment: ({ settings, onSubmit }: SentimentProps) => JSX.Element;
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.Sentiment = void 0;
30
+ const React = __importStar(require("react"));
31
+ const styled_components_1 = __importDefault(require("styled-components"));
32
+ const Feedback_1 = require("../Feedback");
33
+ const Thumbs_1 = require("./Thumbs");
34
+ const Sentiment = ({ settings, onSubmit }) => {
35
+ const { label, submitText, comment: commentSettings, reasons: reasonsSettings } = settings || {};
36
+ const [score, setScore] = React.useState(0);
37
+ const [comment, setComment] = React.useState('');
38
+ const [reasons, setReasons] = React.useState([]);
39
+ if (score && (reasonsSettings === null || reasonsSettings === void 0 ? void 0 : reasonsSettings.enable) && !reasons.length) {
40
+ const { label: reasonsLabel, items, multi } = reasonsSettings;
41
+ const buttonText = (commentSettings === null || commentSettings === void 0 ? void 0 : commentSettings.enable) ? 'Next' : 'Send';
42
+ return (React.createElement(Feedback_1.Reasons, { onSubmit: ({ reasons }) => setReasons(reasons), settings: { label: reasonsLabel, items, multi, buttonText } }));
43
+ }
44
+ if (score && (commentSettings === null || commentSettings === void 0 ? void 0 : commentSettings.enable) && !comment) {
45
+ const commentLabel = score === 1
46
+ ? commentSettings.likeLabel || 'What was most helpful?'
47
+ : commentSettings.dislikeLabel || 'What can we improve?';
48
+ return (React.createElement(Feedback_1.Comment, { onSubmit: ({ comment }) => setComment(comment), settings: { label: commentLabel } }));
49
+ }
50
+ if (score) {
51
+ onSubmit({
52
+ score,
53
+ comment,
54
+ reasons,
55
+ });
56
+ return (React.createElement(Wrapper, null,
57
+ React.createElement(Label, null, submitText || 'Thank you for helping improve our documentation!')));
58
+ }
59
+ return (React.createElement(Wrapper, { "data-component-name": "Feedback/Sentiment" },
60
+ React.createElement(Label, null, label || 'Was this page helpful?'),
61
+ React.createElement(Vote, { onClick: () => setScore(1) },
62
+ React.createElement(Thumbs_1.ThumbUp, { text: "Yes" })),
63
+ React.createElement(Vote, { onClick: () => setScore(-1) },
64
+ React.createElement(Thumbs_1.ThumbDown, null))));
65
+ };
66
+ exports.Sentiment = Sentiment;
67
+ const Wrapper = styled_components_1.default.div `
68
+ font-family: var(--font-family-base);
69
+ display: flex;
70
+ align-items: center;
71
+ `;
72
+ const Label = styled_components_1.default.h3 `
73
+ margin-right: 15px;
74
+ `;
75
+ const Vote = styled_components_1.default.div `
76
+ cursor: pointer;
77
+ margin: 0 10px;
78
+ `;
79
+ //# sourceMappingURL=Sentiment.js.map
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ export declare const ThumbUp: ({ text }: {
3
+ text?: string | undefined;
4
+ }) => JSX.Element;
5
+ export declare const ThumbDown: ({ text }: {
6
+ text?: string | undefined;
7
+ }) => JSX.Element;
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.ThumbDown = exports.ThumbUp = void 0;
30
+ const React = __importStar(require("react"));
31
+ const styled_components_1 = __importDefault(require("styled-components"));
32
+ const ThumbUp = ({ text }) => (React.createElement(Wrapper, { style: { alignItems: 'normal' } },
33
+ React.createElement(Icon, null,
34
+ React.createElement("svg", { version: "1.1", xmlns: "http://www.w3.org/2000/svg", x: "0px", y: "0px", viewBox: "0 0 512 512" },
35
+ React.createElement("g", null,
36
+ React.createElement("g", null,
37
+ React.createElement("g", null,
38
+ React.createElement("path", { d: "M495.736,290.773C509.397,282.317,512,269.397,512,260.796c0-22.4-18.253-47.462-42.667-47.462H349.918\n c-4.284-0.051-25.651-1.51-25.651-25.6c0-4.71-3.814-8.533-8.533-8.533s-8.533,3.823-8.533,8.533\n c0,33.749,27.913,42.667,42.667,42.667h119.467c14.182,0,25.6,16.631,25.6,30.396c0,4.437,0,17.946-26.53,20.855\n c-4.506,0.495-7.834,4.42-7.586,8.951c0.239,4.523,3.985,8.064,8.516,8.064c14.114,0,25.6,11.486,25.6,25.6\n s-11.486,25.6-25.6,25.6h-17.067c-4.719,0-8.533,3.823-8.533,8.533s3.814,8.533,8.533,8.533c14.114,0,25.6,11.486,25.6,25.6\n s-11.486,25.6-25.6,25.6h-25.6c-4.719,0-8.533,3.823-8.533,8.533s3.814,8.533,8.533,8.533c8.934,0,17.067,8.132,17.067,17.067\n c0,8.61-8.448,17.067-17.067,17.067h-128c-35.627,0-48.444-7.074-63.292-15.258c-12.553-6.921-26.786-14.763-54.963-18.79\n c-4.668-0.674-8.994,2.577-9.66,7.236c-0.666,4.668,2.569,8.994,7.236,9.66c25.105,3.584,37.325,10.325,49.152,16.845\n c15.497,8.542,31.505,17.374,71.526,17.374h128c17.869,0,34.133-16.273,34.133-34.133c0-6.229-1.775-12.134-4.83-17.229\n c21.794-1.877,38.963-20.224,38.963-42.505c0-10.829-4.062-20.736-10.735-28.271C500.42,358.212,512,342.571,512,324.267\n C512,310.699,505.634,298.59,495.736,290.773z" }),
39
+ React.createElement("path", { d: "M76.8,443.733c9.412,0,17.067-7.654,17.067-17.067S86.212,409.6,76.8,409.6c-9.412,0-17.067,7.654-17.067,17.067\n S67.388,443.733,76.8,443.733z" }),
40
+ React.createElement("path", { d: "M179.2,247.467c25.353,0,57.429-28.297,74.3-45.167c36.634-36.634,36.634-82.167,36.634-151.1\n c0-5.342,3.191-8.533,8.533-8.533c29.508,0,42.667,13.158,42.667,42.667v102.4c0,4.71,3.814,8.533,8.533,8.533\n s8.533-3.823,8.533-8.533v-102.4c0-39.083-20.659-59.733-59.733-59.733c-14.831,0-25.6,10.769-25.6,25.6\n c0,66.978,0,107.401-31.633,139.034C216.661,215.006,192.811,230.4,179.2,230.4c-4.719,0-8.533,3.823-8.533,8.533\n S174.481,247.467,179.2,247.467z" }),
41
+ React.createElement("path", { d: "M145.067,213.333H8.533c-4.719,0-8.533,3.823-8.533,8.533v256c0,4.71,3.814,8.533,8.533,8.533h136.533\n c4.719,0,8.533-3.823,8.533-8.533v-256C153.6,217.156,149.786,213.333,145.067,213.333z M136.533,469.333H17.067V230.4h119.467\n V469.333z" })))))),
42
+ React.createElement("span", null, text || 'Yes')));
43
+ exports.ThumbUp = ThumbUp;
44
+ const ThumbDown = ({ text }) => (React.createElement(Wrapper, { style: { alignItems: 'end' } },
45
+ React.createElement(Icon, null,
46
+ React.createElement("svg", { version: "1.1", xmlns: "http://www.w3.org/2000/svg", x: "0px", y: "0px", viewBox: "0 0 512 512" },
47
+ React.createElement("g", null,
48
+ React.createElement("g", null,
49
+ React.createElement("g", null,
50
+ React.createElement("path", { d: "M76.8,247.467c9.412,0,17.067-7.654,17.067-17.067c0-9.412-7.654-17.067-17.067-17.067\n\t\t\t\tc-9.412,0-17.067,7.654-17.067,17.067C59.733,239.812,67.388,247.467,76.8,247.467z" }),
51
+ React.createElement("path", { d: "M495.736,221.227C505.634,213.41,512,201.301,512,187.733c0-18.295-11.58-33.946-27.802-39.996\n\t\t\t\tc6.673-7.535,10.735-17.434,10.735-28.271c0-22.281-17.169-40.627-38.963-42.505c3.055-5.094,4.83-10.999,4.83-17.229\n\t\t\t\tc0-17.86-16.265-34.133-34.133-34.133h-128c-40.021,0-56.03,8.832-71.526,17.374c-11.827,6.519-24.047,13.261-49.152,16.845\n\t\t\t\tc-4.668,0.666-7.902,4.992-7.236,9.66c0.666,4.659,4.949,7.885,9.66,7.236c28.177-4.028,42.411-11.87,54.963-18.79\n\t\t\t\tc14.848-8.183,27.665-15.258,63.292-15.258h128c8.619,0,17.067,8.456,17.067,17.067c0,8.934-8.132,17.067-17.067,17.067\n\t\t\t\tc-4.719,0-8.533,3.823-8.533,8.533s3.814,8.533,8.533,8.533h25.6c14.114,0,25.6,11.486,25.6,25.6s-11.486,25.6-25.6,25.6\n\t\t\t\tc-4.719,0-8.533,3.823-8.533,8.533c0,4.71,3.814,8.533,8.533,8.533h17.067c14.114,0,25.6,11.486,25.6,25.6\n\t\t\t\ts-11.486,25.6-25.6,25.6c-4.531,0-8.277,3.541-8.516,8.064c-0.247,4.531,3.081,8.457,7.586,8.951\n\t\t\t\tc26.53,2.91,26.53,16.418,26.53,20.847c0,13.773-11.418,30.404-25.6,30.404H349.867c-14.763,0-42.667,8.917-42.667,42.667\n\t\t\t\tc0,4.71,3.814,8.533,8.533,8.533s8.533-3.823,8.533-8.533c0-24.09,21.367-25.549,25.6-25.6h119.467\n\t\t\t\tc24.414,0,42.667-25.054,42.667-47.471C512,242.603,509.397,229.683,495.736,221.227z" }),
52
+ React.createElement("path", { d: "M349.867,315.733c-4.719,0-8.533,3.823-8.533,8.533v102.4c0,29.508-13.158,42.667-42.667,42.667\n\t\t\t\tc-5.342,0-8.533-3.192-8.533-8.533c0-68.932,0-114.466-36.634-151.1c-16.87-16.87-48.947-45.167-74.3-45.167\n\t\t\t\tc-4.719,0-8.533,3.823-8.533,8.533s3.814,8.533,8.533,8.533c13.611,0,37.461,15.394,62.234,40.166\n\t\t\t\tc31.633,31.633,31.633,72.055,31.633,139.034c0,14.831,10.769,25.6,25.6,25.6c39.074,0,59.733-20.651,59.733-59.733v-102.4\n\t\t\t\tC358.4,319.556,354.586,315.733,349.867,315.733z" }),
53
+ React.createElement("path", { d: "M145.067,25.6H8.533C3.814,25.6,0,29.423,0,34.133v256c0,4.71,3.814,8.533,8.533,8.533h136.533\n\t\t\t\tc4.719,0,8.533-3.823,8.533-8.533v-256C153.6,29.423,149.786,25.6,145.067,25.6z M136.533,281.6H17.067V42.667h119.467V281.6z" })))))),
54
+ React.createElement("span", null, text || 'No')));
55
+ exports.ThumbDown = ThumbDown;
56
+ const Wrapper = styled_components_1.default.div `
57
+ font-family: var(--font-family-base);
58
+ display: flex;
59
+ color: var(--color-primary-500);
60
+ &:hover {
61
+ color: var(--color-primary-600);
62
+ svg {
63
+ > g {
64
+ fill: var(--color-primary-600);
65
+ }
66
+ }
67
+ }
68
+ `;
69
+ const Icon = styled_components_1.default.div `
70
+ width: 18px;
71
+ height: 18px;
72
+ margin-right: 5px;
73
+ > svg {
74
+ > g {
75
+ fill: var(--color-primary-500);
76
+ }
77
+ }
78
+ `;
79
+ //# sourceMappingURL=Thumbs.js.map
@@ -0,0 +1,5 @@
1
+ export { Rating } from '../Feedback/Rating';
2
+ export { Sentiment } from '../Feedback/Sentiment';
3
+ export { Comment } from '../Feedback/Comment';
4
+ export { Reasons } from '../Feedback/Reasons';
5
+ export * from './types';
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.Reasons = exports.Comment = exports.Sentiment = exports.Rating = void 0;
18
+ var Rating_1 = require("../Feedback/Rating");
19
+ Object.defineProperty(exports, "Rating", { enumerable: true, get: function () { return Rating_1.Rating; } });
20
+ var Sentiment_1 = require("../Feedback/Sentiment");
21
+ Object.defineProperty(exports, "Sentiment", { enumerable: true, get: function () { return Sentiment_1.Sentiment; } });
22
+ var Comment_1 = require("../Feedback/Comment");
23
+ Object.defineProperty(exports, "Comment", { enumerable: true, get: function () { return Comment_1.Comment; } });
24
+ var Reasons_1 = require("../Feedback/Reasons");
25
+ Object.defineProperty(exports, "Reasons", { enumerable: true, get: function () { return Reasons_1.Reasons; } });
26
+ __exportStar(require("./types"), exports);
27
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,71 @@
1
+ export type RatingProps = {
2
+ onSubmit: (value: {
3
+ score: number;
4
+ comment?: string;
5
+ reasons?: string[];
6
+ }) => void;
7
+ settings?: {
8
+ label?: string;
9
+ max?: number;
10
+ submitText?: string;
11
+ comment?: {
12
+ enable: boolean;
13
+ label?: string;
14
+ };
15
+ reasons?: {
16
+ enable: boolean;
17
+ label?: string;
18
+ multi?: boolean;
19
+ items: string[];
20
+ };
21
+ };
22
+ };
23
+ export type SentimentProps = {
24
+ onSubmit: (value: {
25
+ score: number;
26
+ comment?: string;
27
+ reasons?: string[];
28
+ }) => void;
29
+ settings?: {
30
+ label?: string;
31
+ submitText?: string;
32
+ comment?: {
33
+ enable: boolean;
34
+ likeLabel?: string;
35
+ dislikeLabel?: string;
36
+ };
37
+ reasons?: {
38
+ enable: boolean;
39
+ label?: string;
40
+ multi?: boolean;
41
+ items: string[];
42
+ };
43
+ };
44
+ };
45
+ export type CommentProps = {
46
+ onSubmit: (value: {
47
+ comment: string;
48
+ }) => void;
49
+ settings?: {
50
+ label?: string;
51
+ submitText?: string;
52
+ };
53
+ };
54
+ export type ReasonsProps = {
55
+ onSubmit: (value: {
56
+ reasons: string[];
57
+ }) => void;
58
+ settings: {
59
+ label?: string;
60
+ multi?: boolean;
61
+ items: string[];
62
+ submitText?: string;
63
+ buttonText?: string;
64
+ };
65
+ };
66
+ export type ProblemProps = {
67
+ onSubmit: (value: string, location: string) => void;
68
+ settings?: {
69
+ label?: string;
70
+ };
71
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  type MarkdownLayoutProps = {
3
3
  tableOfContent: React.ReactNode;
4
4
  markdownWrapper: React.ReactNode;
5
+ feedback: React.ReactNode;
5
6
  editPage?: {
6
7
  to: string;
7
8
  text: string;
@@ -10,5 +11,5 @@ type MarkdownLayoutProps = {
10
11
  /** String in ISO format */
11
12
  lastModified?: string | null;
12
13
  };
13
- export declare function MarkdownLayout({ tableOfContent, markdownWrapper, editPage, lastModified, }: MarkdownLayoutProps): JSX.Element;
14
+ export declare function MarkdownLayout({ tableOfContent, markdownWrapper, feedback, editPage, lastModified, }: MarkdownLayoutProps): JSX.Element;
14
15
  export {};
@@ -12,16 +12,17 @@ const PageNavigation_1 = require("../PageNavigation/PageNavigation");
12
12
  const EditPageButton_1 = require("../EditPageButton");
13
13
  const LastUpdated_1 = require("../LastUpdated/LastUpdated");
14
14
  const hooks_1 = require("../hooks");
15
- function MarkdownLayout({ tableOfContent, markdownWrapper, editPage, lastModified, }) {
15
+ function MarkdownLayout({ tableOfContent, markdownWrapper, feedback, editPage, lastModified, }) {
16
16
  const { markdown } = (0, hooks_1.useThemeConfig)();
17
17
  const { editPage: themeEditPage } = markdown || {};
18
- const mergedConf = editPage ? Object.assign(Object.assign({}, editPage), themeEditPage) : undefined;
18
+ const mergedConf = editPage ? Object.assign(Object.assign({}, themeEditPage), editPage) : undefined;
19
19
  return (react_1.default.createElement(PageWrapper_1.PageWrapper, { "data-component-name": "Markdown/MarkdownLayout" },
20
20
  react_1.default.createElement(ContainerWrapper_1.ContainerWrapper, { withToc: true },
21
21
  react_1.default.createElement(LayoutTop, null,
22
22
  lastModified && react_1.default.createElement(LastUpdated_1.LastUpdated, { lastModified: new Date(lastModified) }),
23
23
  mergedConf && (react_1.default.createElement(EditPageButton_1.EditPageButton, { text: mergedConf.text, to: mergedConf.to, icon: mergedConf.icon }))),
24
24
  markdownWrapper,
25
+ react_1.default.createElement(LayoutBottom, null, feedback),
25
26
  react_1.default.createElement(PageNavigation_1.PageNavigation, null)),
26
27
  tableOfContent));
27
28
  }
@@ -31,4 +32,9 @@ const LayoutTop = styled_components_1.default.div `
31
32
  justify-content: space-between;
32
33
  flex-flow: row nowrap;
33
34
  `;
35
+ const LayoutBottom = (0, styled_components_1.default)(LayoutTop) `
36
+ > * {
37
+ margin: 25px 5px;
38
+ }
39
+ `;
34
40
  //# sourceMappingURL=MarkdownLayout.js.map
@@ -14,15 +14,21 @@ exports.Tab = Tab;
14
14
  const TabItem = styled_components_1.default.li `
15
15
  display: inline-block;
16
16
  list-style: none;
17
- margin-bottom: -1px;
18
17
  padding: 0.75rem 1rem;
19
18
  cursor: pointer;
20
19
 
21
- ${({ active }) => active &&
20
+ ${({ active }) => active
21
+ ? `
22
+ background-color: var(--background-color);
23
+ border: solid var(--md-tabs-active-tab-border-color);
24
+ border-width: 0 0 1px 0;
25
+ color: var(--text-color);
22
26
  `
23
- background-color: white;
24
- border: solid #ccc;
25
- border-width: 1px 1px 0 1px;
27
+ : `
28
+ &:hover {
29
+ border: solid var(--md-tabs-hover-tab-border-color);
30
+ border-width: 0 0 1px 0;
31
+ }
26
32
  `}
27
33
  `;
28
34
  //# sourceMappingURL=Tab.js.map
@@ -47,16 +47,25 @@ function Tabs({ children }) {
47
47
  exports.Tabs = Tabs;
48
48
  const TabsContainer = styled_components_1.default.div `
49
49
  margin: 10px 0;
50
+
51
+ ol[class^='Tabs__TabList'] {
52
+ margin: 0;
53
+ padding: 0;
54
+ }
50
55
  `;
51
56
  const TabList = styled_components_1.default.ol `
52
- border-bottom: 1px solid #ccc;
57
+ color: var(--md-tabs-tab-text-color);
53
58
  padding: 0;
54
59
  margin-block-end: 0;
60
+ border: solid var(--color-secondary-400);
61
+ border-width: 0 0 1px 0;
62
+
63
+ li[class^='Tab__TabItem'] {
64
+ margin: 0;
65
+ margin-bottom: -1px;
66
+ }
55
67
  `;
56
68
  const TabContent = styled_components_1.default.div `
57
- padding: 10px 5px;
58
- border: 1px solid #ccc;
59
- border-top: none;
60
- padding: 1rem;
69
+ padding: 1rem 0;
61
70
  `;
62
71
  //# sourceMappingURL=Tabs.js.map