@redocly/theme 0.9.5 → 0.9.7

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.
@@ -44,7 +44,7 @@ function CopyButtonWrapperComponent({ data, children, onCopyClick, dataTestId =
44
44
  onCopyClick === null || onCopyClick === void 0 ? void 0 : onCopyClick();
45
45
  };
46
46
  const renderCopyButton = (placement = 'top') => {
47
- return (react_1.default.createElement(Tooltip_1.Tooltip, { className: "copy-button", tip: utils_1.ClipboardService.isSupported() ? 'Copied' : 'Not supported in your browser', isOpen: tooltip.isOpened, placement: placement },
47
+ return (react_1.default.createElement(Tooltip_1.Tooltip, { className: "copy-button", tip: "Copied", isOpen: tooltip.isOpened, placement: placement },
48
48
  react_1.default.createElement(SamplesPanelControls_1.SamplesControlButton, { onClick: copy, "data-cy": dataTestId }, "Copy")));
49
49
  };
50
50
  return children({ renderCopyButton });
@@ -8,6 +8,5 @@ export interface UserProfileProps {
8
8
  };
9
9
  handleLogout: (logoutRedirect?: string) => void;
10
10
  hasDeveloperOnboarding?: boolean;
11
- hasApiLogs?: boolean;
12
11
  }
13
- export declare function UserProfile({ userInfo, handleLogout, hasDeveloperOnboarding, hasApiLogs, }: UserProfileProps): JSX.Element;
12
+ export declare function UserProfile({ userInfo, handleLogout, hasDeveloperOnboarding, }: UserProfileProps): JSX.Element;
@@ -33,15 +33,13 @@ const Link_1 = require("../mocks/Link");
33
33
  const Profile_1 = require("../Profile/Profile");
34
34
  const Tooltip_1 = require("../Tooltip/Tooltip");
35
35
  const useThemeConfig_1 = require("../hooks/useThemeConfig");
36
- function UserProfile({ userInfo, handleLogout, hasDeveloperOnboarding = false, hasApiLogs = false, }) {
36
+ function UserProfile({ userInfo, handleLogout, hasDeveloperOnboarding = false, }) {
37
37
  const [isOpened, setIsOpened] = (0, react_1.useState)(false);
38
38
  const { userProfile: userProfileSettings } = (0, useThemeConfig_1.useThemeConfig)();
39
39
  const logoutRedirect = (userProfileSettings === null || userProfileSettings === void 0 ? void 0 : userProfileSettings.logoutRedirect) || '/';
40
- return (react_1.default.createElement(StyledTooltip, { isOpen: isOpened, withArrow: false, className: "copy-button", placement: "bottom", width: "100%", tip: react_1.default.createElement(StyledUl, null,
40
+ return (react_1.default.createElement(StyledTooltip, { isOpen: isOpened, withArrow: false, className: "copy-button", placement: "bottom", width: "100%", tip: react_1.default.createElement(StyledUl, { onClick: () => setIsOpened(false) },
41
41
  hasDeveloperOnboarding ? (react_1.default.createElement(Link_1.Link, { to: "/apps" },
42
42
  react_1.default.createElement(StyledLi, null, "My Apps"))) : null,
43
- hasApiLogs ? (react_1.default.createElement(Link_1.Link, { to: "/api-logs" },
44
- react_1.default.createElement(StyledLi, null, "API logs"))) : null,
45
43
  react_1.default.createElement(StyledLi, { onClick: () => handleLogout(logoutRedirect) }, (userProfileSettings === null || userProfileSettings === void 0 ? void 0 : userProfileSettings.logoutLabel) || 'Log out')) },
46
44
  react_1.default.createElement(Profile_1.Profile, { name: userInfo.name, imageUrl: userInfo.picture, onClick: userInfo.logoutDisabled ? undefined : () => setIsOpened(!isOpened) })));
47
45
  }
@@ -117,6 +117,6 @@ const Overlay = styled_components_1.default.div `
117
117
  `;
118
118
  const Message = styled_components_1.default.div `
119
119
  padding: 24px;
120
- color: var(--text-color);
120
+ color: var(--search-item-title-text-color);
121
121
  `;
122
122
  //# sourceMappingURL=Autocomplete.js.map
@@ -1892,9 +1892,6 @@ const tile = (0, styled_components_1.css) `
1892
1892
  --wide-tile-background-color: var(--color-secondary-100);
1893
1893
  --thin-tile-background-color: var(--color-secondary-100);
1894
1894
  `;
1895
- const apiLogsTable = (0, styled_components_1.css) `
1896
- --api-logs-row-hover-background-color: var(--color-secondary-300);
1897
- `;
1898
1895
  const pages = (0, styled_components_1.css) `
1899
1896
  /**
1900
1897
  * @tokens 404 Page
@@ -1979,7 +1976,6 @@ exports.styles = (0, styled_components_1.css) `
1979
1976
  ${lastUpdated}
1980
1977
  ${tile}
1981
1978
  ${loadProgressBar}
1982
- ${apiLogsTable}
1983
1979
  ${pages}
1984
1980
  ${modal}
1985
1981
 
@@ -1,5 +1,4 @@
1
1
  export declare class ClipboardService {
2
- static isSupported(): boolean;
3
2
  static copyCustom(text: string): boolean;
4
3
  static selectElement(element: HTMLDivElement | null): void;
5
4
  }
@@ -6,9 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.ClipboardService = void 0;
7
7
  const copy_to_clipboard_1 = __importDefault(require("copy-to-clipboard"));
8
8
  class ClipboardService {
9
- static isSupported() {
10
- return typeof navigator !== 'undefined' && !!navigator.clipboard;
11
- }
12
9
  static copyCustom(text) {
13
10
  return (0, copy_to_clipboard_1.default)(text);
14
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/theme",
3
- "version": "0.9.5",
3
+ "version": "0.9.7",
4
4
  "description": "Shared UI components lib",
5
5
  "author": "team@redocly.com",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -41,12 +41,7 @@ function CopyButtonWrapperComponent({
41
41
 
42
42
  const renderCopyButton = (placement: TooltipProps['placement'] = 'top'): JSX.Element => {
43
43
  return (
44
- <Tooltip
45
- className="copy-button"
46
- tip={ClipboardService.isSupported() ? 'Copied' : 'Not supported in your browser'}
47
- isOpen={tooltip.isOpened}
48
- placement={placement}
49
- >
44
+ <Tooltip className="copy-button" tip="Copied" isOpen={tooltip.isOpened} placement={placement}>
50
45
  <SamplesControlButton onClick={copy} data-cy={dataTestId}>
51
46
  Copy
52
47
  </SamplesControlButton>
@@ -15,14 +15,12 @@ export interface UserProfileProps {
15
15
  };
16
16
  handleLogout: (logoutRedirect?: string) => void;
17
17
  hasDeveloperOnboarding?: boolean;
18
- hasApiLogs?: boolean;
19
18
  }
20
19
 
21
20
  export function UserProfile({
22
21
  userInfo,
23
22
  handleLogout,
24
23
  hasDeveloperOnboarding = false,
25
- hasApiLogs = false,
26
24
  }: UserProfileProps): JSX.Element {
27
25
  const [isOpened, setIsOpened] = useState<boolean>(false);
28
26
 
@@ -38,17 +36,12 @@ export function UserProfile({
38
36
  placement="bottom"
39
37
  width="100%"
40
38
  tip={
41
- <StyledUl>
39
+ <StyledUl onClick={() => setIsOpened(false)}>
42
40
  {hasDeveloperOnboarding ? (
43
41
  <Link to="/apps">
44
42
  <StyledLi>My Apps</StyledLi>
45
43
  </Link>
46
44
  ) : null}
47
- {hasApiLogs ? (
48
- <Link to="/api-logs">
49
- <StyledLi>API logs</StyledLi>
50
- </Link>
51
- ) : null}
52
45
  <StyledLi onClick={() => handleLogout(logoutRedirect)}>
53
46
  {userProfileSettings?.logoutLabel || 'Log out'}
54
47
  </StyledLi>
@@ -144,5 +144,5 @@ const Overlay = styled.div`
144
144
 
145
145
  const Message = styled.div`
146
146
  padding: 24px;
147
- color: var(--text-color);
147
+ color: var(--search-item-title-text-color);
148
148
  `;
@@ -1917,10 +1917,6 @@ const tile = css`
1917
1917
  --thin-tile-background-color: var(--color-secondary-100);
1918
1918
  `;
1919
1919
 
1920
- const apiLogsTable = css`
1921
- --api-logs-row-hover-background-color: var(--color-secondary-300);
1922
- `
1923
-
1924
1920
  const pages = css`
1925
1921
  /**
1926
1922
  * @tokens 404 Page
@@ -2007,7 +2003,6 @@ export const styles = css`
2007
2003
  ${lastUpdated}
2008
2004
  ${tile}
2009
2005
  ${loadProgressBar}
2010
- ${apiLogsTable}
2011
2006
  ${pages}
2012
2007
  ${modal}
2013
2008
 
@@ -1,9 +1,5 @@
1
1
  import copy from 'copy-to-clipboard';
2
2
  export class ClipboardService {
3
- static isSupported(): boolean {
4
- return typeof navigator !== 'undefined' && !!navigator.clipboard;
5
- }
6
-
7
3
  static copyCustom(text: string): boolean {
8
4
  return copy(text);
9
5
  }