@redocly/theme 0.14.0 → 0.14.2

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.
@@ -22,10 +22,14 @@ var __importStar = (this && this.__importStar) || function (mod) {
22
22
  __setModuleDefault(result, mod);
23
23
  return result;
24
24
  };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
25
28
  Object.defineProperty(exports, "__esModule", { value: true });
26
29
  exports.Feedback = void 0;
27
30
  const React = __importStar(require("react"));
28
31
  const react_router_dom_1 = require("react-router-dom");
32
+ const styled_components_1 = __importDefault(require("styled-components"));
29
33
  const Feedback_1 = require("../../components/Feedback");
30
34
  const hooks_1 = require("../../hooks");
31
35
  const useSubmitFeedback_1 = require("../../mocks/Feedback/useSubmitFeedback");
@@ -37,11 +41,14 @@ const Feedback = (props) => {
37
41
  const renderFeedbackComponent = () => {
38
42
  switch (type) {
39
43
  case 'rating':
40
- return (React.createElement(Feedback_1.Rating, { settings: settings, onSubmit: (values) => submitFeedback({ type: 'rating', values, path }) }));
44
+ return (React.createElement(Wrapper, null,
45
+ React.createElement(Feedback_1.Rating, { settings: settings, onSubmit: (values) => submitFeedback({ type: 'rating', values, path }) })));
41
46
  case 'sentiment':
42
- return (React.createElement(Feedback_1.Sentiment, { settings: settings, onSubmit: (values) => submitFeedback({ type: 'sentiment', values, path }) }));
47
+ return (React.createElement(Wrapper, null,
48
+ React.createElement(Feedback_1.Sentiment, { settings: settings, onSubmit: (values) => submitFeedback({ type: 'sentiment', values, path }) })));
43
49
  case 'comment':
44
- return (React.createElement(Feedback_1.Comment, { settings: settings, onSubmit: (values) => submitFeedback({ type: 'comment', values, path }) }));
50
+ return (React.createElement(Wrapper, null,
51
+ React.createElement(Feedback_1.Comment, { settings: settings, onSubmit: (values) => submitFeedback({ type: 'comment', values, path }) })));
45
52
  default:
46
53
  console.log(`No feedback with type ${type}!`);
47
54
  break;
@@ -51,4 +58,9 @@ const Feedback = (props) => {
51
58
  return React.createElement(React.Fragment, { key: pathname }, renderFeedbackComponent());
52
59
  };
53
60
  exports.Feedback = Feedback;
61
+ const Wrapper = styled_components_1.default.div `
62
+ @media print {
63
+ display: none;
64
+ }
65
+ `;
54
66
  //# sourceMappingURL=Feedback.js.map
@@ -64,7 +64,7 @@ const SearchDialog = ({ onClose }) => {
64
64
  return (react_1.default.createElement(Overlay, { "data-component-name": "Search/SearchDialog", ref: modalRef, onClick: handleOverlayClick, className: "overlay" },
65
65
  react_1.default.createElement(Container, null,
66
66
  react_1.default.createElement(TopContainer, null,
67
- react_1.default.createElement(InputWrapper_1.InputWrapper, { value: query, change: setQuery, placeholder: translate('theme.search.label', 'Search all products...'), isLoading: isLoading })),
67
+ react_1.default.createElement(InputWrapper_1.InputWrapper, { value: query, change: setQuery, placeholder: translate('theme.search.label', 'Search docs...'), isLoading: isLoading })),
68
68
  react_1.default.createElement(Results, null, items !== null ? (items.length ? (items.map(mapItem)) : (react_1.default.createElement(Message, { "data-translation-key": translationKeys.noResults }, translate(translationKeys.noResults, 'No results')))) : (react_1.default.createElement(react_1.default.Fragment, null,
69
69
  react_1.default.createElement(RecentSearches_1.RecentSearches, { onSelect: setQuery }),
70
70
  react_1.default.createElement(SuggestedPages_1.SuggestedPages, null)))),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/theme",
3
- "version": "0.14.0",
3
+ "version": "0.14.2",
4
4
  "description": "Shared UI components library",
5
5
  "keywords": [],
6
6
  "author": "team@redocly.com",
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { useLocation } from 'react-router-dom';
3
+ import styled from 'styled-components';
3
4
 
4
5
  import type { FeedbackProps } from '@theme/types/portal/src/shared/types/feedback';
5
6
  import { Rating, Sentiment, Comment } from '@theme/components/Feedback';
@@ -16,24 +17,30 @@ export const Feedback = (props: FeedbackProps & { path?: string }) => {
16
17
  switch (type) {
17
18
  case 'rating':
18
19
  return (
19
- <Rating
20
- settings={settings}
21
- onSubmit={(values) => submitFeedback({ type: 'rating', values, path })}
22
- />
20
+ <Wrapper>
21
+ <Rating
22
+ settings={settings}
23
+ onSubmit={(values) => submitFeedback({ type: 'rating', values, path })}
24
+ />
25
+ </Wrapper>
23
26
  );
24
27
  case 'sentiment':
25
28
  return (
26
- <Sentiment
27
- settings={settings}
28
- onSubmit={(values) => submitFeedback({ type: 'sentiment', values, path })}
29
- />
29
+ <Wrapper>
30
+ <Sentiment
31
+ settings={settings}
32
+ onSubmit={(values) => submitFeedback({ type: 'sentiment', values, path })}
33
+ />
34
+ </Wrapper>
30
35
  );
31
36
  case 'comment':
32
37
  return (
33
- <Comment
34
- settings={settings}
35
- onSubmit={(values) => submitFeedback({ type: 'comment', values, path })}
36
- />
38
+ <Wrapper>
39
+ <Comment
40
+ settings={settings}
41
+ onSubmit={(values) => submitFeedback({ type: 'comment', values, path })}
42
+ />
43
+ </Wrapper>
37
44
  );
38
45
  default:
39
46
  console.log(`No feedback with type ${type}!`);
@@ -45,3 +52,9 @@ export const Feedback = (props: FeedbackProps & { path?: string }) => {
45
52
 
46
53
  return <React.Fragment key={pathname}>{renderFeedbackComponent()}</React.Fragment>;
47
54
  };
55
+
56
+ const Wrapper = styled.div`
57
+ @media print {
58
+ display: none;
59
+ }
60
+ `;
@@ -52,7 +52,7 @@ export const SearchDialog = ({ onClose }: { onClose: () => void }): JSX.Element
52
52
  <InputWrapper
53
53
  value={query}
54
54
  change={setQuery}
55
- placeholder={translate('theme.search.label', 'Search all products...')}
55
+ placeholder={translate('theme.search.label', 'Search docs...')}
56
56
  isLoading={isLoading}
57
57
  />
58
58
  </TopContainer>