@redocly/theme 0.58.0-next.4 → 0.58.0-next.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/lib/components/Catalog/Catalog.d.ts +2 -2
- package/lib/components/Catalog/Catalog.js +3 -3
- package/lib/components/Catalog/CatalogCardView/CatalogCard.js +15 -14
- package/lib/components/Catalog/CatalogEntity/CatalogEntityLinks.js +0 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityMetadata.js +0 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityMethodAndPath.js +0 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.js +1 -1
- package/lib/components/Catalog/CatalogEntityIcon.d.ts +2 -0
- package/lib/components/Catalog/CatalogEntityIcon.js +31 -14
- package/lib/components/Catalog/CatalogEntityTypeIcon.js +19 -6
- package/lib/components/Catalog/CatalogEntityTypeTag.js +9 -3
- package/lib/components/Catalog/CatalogSelector.d.ts +1 -1
- package/lib/components/Catalog/CatalogTableView/CatalogEntityCell.js +1 -1
- package/lib/components/Catalog/CatalogViewModeToggle.d.ts +1 -1
- package/lib/components/Catalog/variables.js +9 -6
- package/lib/components/Tooltip/Tooltip.js +7 -9
- package/lib/components/Tooltip/TooltipWrapper.js +1 -1
- package/lib/core/constants/catalog.d.ts +1 -1
- package/lib/core/constants/catalog.js +9 -27
- package/lib/core/hooks/use-control.js +17 -2
- package/lib/core/openapi/index.d.ts +1 -1
- package/lib/core/openapi/index.js +3 -3
- package/lib/core/styles/global.js +19 -0
- package/lib/core/types/catalog.d.ts +1 -1
- package/lib/core/types/hooks.d.ts +2 -2
- package/lib/core/types/l10n.d.ts +1 -1
- package/lib/icons/HierarchyIcon/HierarchyIcon.d.ts +9 -0
- package/lib/icons/HierarchyIcon/HierarchyIcon.js +23 -0
- package/lib/icons/NoteIcon/NoteIcon.d.ts +9 -0
- package/lib/icons/NoteIcon/NoteIcon.js +24 -0
- package/lib/icons/ShareIcon/ShareIcon.d.ts +9 -0
- package/lib/icons/ShareIcon/ShareIcon.js +22 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +2 -0
- package/package.json +3 -3
- package/src/components/Catalog/Catalog.tsx +15 -5
- package/src/components/Catalog/CatalogCardView/CatalogCard.tsx +20 -19
- package/src/components/Catalog/CatalogEntity/CatalogEntityLinks.tsx +0 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityMetadata.tsx +0 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityMethodAndPath.tsx +0 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.tsx +1 -1
- package/src/components/Catalog/CatalogEntityIcon.tsx +53 -18
- package/src/components/Catalog/CatalogEntityTypeIcon.tsx +19 -8
- package/src/components/Catalog/CatalogEntityTypeTag.tsx +11 -3
- package/src/components/Catalog/CatalogSelector.tsx +1 -1
- package/src/components/Catalog/CatalogTableView/CatalogEntityCell.tsx +1 -1
- package/src/components/Catalog/CatalogViewModeToggle.tsx +1 -1
- package/src/components/Catalog/variables.ts +9 -6
- package/src/components/Tooltip/Tooltip.tsx +6 -8
- package/src/components/Tooltip/TooltipWrapper.tsx +1 -1
- package/src/core/constants/catalog.ts +9 -27
- package/src/core/hooks/use-control.ts +21 -3
- package/src/core/openapi/index.ts +1 -1
- package/src/core/styles/global.ts +19 -0
- package/src/core/types/catalog.ts +1 -2
- package/src/core/types/hooks.ts +6 -1
- package/src/core/types/l10n.ts +3 -0
- package/src/icons/HierarchyIcon/HierarchyIcon.tsx +32 -0
- package/src/icons/NoteIcon/NoteIcon.tsx +35 -0
- package/src/icons/ShareIcon/ShareIcon.tsx +23 -0
- package/src/index.ts +2 -0
|
@@ -130,10 +130,14 @@ export const catalog = css`
|
|
|
130
130
|
--catalog-entity-border-color-api-operation: var(--color-raspberry-3);
|
|
131
131
|
--catalog-entity-bg-color-api-operation: var(--color-raspberry-1);
|
|
132
132
|
|
|
133
|
+
--catalog-entity-icon-color-custom: var(--color-persian-green-8);
|
|
134
|
+
--catalog-entity-border-color-custom: var(--color-persian-green-5);
|
|
135
|
+
--catalog-entity-bg-color-custom: var(--color-persian-green-1);
|
|
136
|
+
|
|
133
137
|
/**
|
|
134
138
|
* @tokens Catalog tags
|
|
135
139
|
*/
|
|
136
|
-
--catalog-tags-wrapper-gap:
|
|
140
|
+
--catalog-tags-wrapper-gap: var(--spacing-xs) calc(var(--spacing-xs) - 5px);
|
|
137
141
|
--catalog-tags-more-button-font-size: var(--font-size-base);
|
|
138
142
|
--catalog-tags-more-button-margin-left: 4px;
|
|
139
143
|
--catalog-tags-placeholder-bg-color: var(--bg-color);
|
|
@@ -193,7 +197,7 @@ export const catalog = css`
|
|
|
193
197
|
*/
|
|
194
198
|
--catalog-card-height: 241px;
|
|
195
199
|
--catalog-card-min-width: 400px;
|
|
196
|
-
--catalog-card-padding-vertical: var(--spacing-
|
|
200
|
+
--catalog-card-padding-vertical: var(--spacing-base);
|
|
197
201
|
--catalog-card-padding-horizontal: var(--spacing-md);
|
|
198
202
|
--catalog-card-gap: var(--spacing-sm);
|
|
199
203
|
--catalog-card-text-color: var(--text-color-secondary);
|
|
@@ -223,12 +227,11 @@ export const catalog = css`
|
|
|
223
227
|
/**
|
|
224
228
|
* @tokens Catalog metadata
|
|
225
229
|
*/
|
|
226
|
-
--catalog-metadata-section-margin-top: var(--spacing-
|
|
227
|
-
--catalog-metadata-section-gap: var(--spacing-
|
|
230
|
+
--catalog-metadata-section-margin-top: var(--spacing-base);
|
|
231
|
+
--catalog-metadata-section-gap: var(--spacing-xs);
|
|
228
232
|
--catalog-metadata-label-font-size: var(--font-size-base);
|
|
229
233
|
--catalog-metadata-label-font-weight: var(--font-weight-medium);
|
|
230
234
|
--catalog-metadata-label-color: var(--text-color-secondary);
|
|
231
|
-
--catalog-metadata-label-margin-bottom: var(--spacing-unit);
|
|
232
235
|
--catalog-metadata-column-half-gap: var(--spacing-sm);
|
|
233
236
|
--catalog-metadata-heading-size: var(--font-size-md);
|
|
234
237
|
|
|
@@ -263,7 +266,7 @@ export const catalog = css`
|
|
|
263
266
|
--catalog-card-description-line-height: var(--line-height-base);
|
|
264
267
|
--catalog-card-description-font-weight: var(--font-weight-regular);
|
|
265
268
|
--catalog-card-description-height: 62px;
|
|
266
|
-
--catalog-card-description-margin-top:
|
|
269
|
+
--catalog-card-description-margin-top: 8px;
|
|
267
270
|
|
|
268
271
|
--catalog-card-content-gap: var(--spacing-xs);
|
|
269
272
|
--catalog-card-content-gap-vertical: var(--spacing-sm);
|
|
@@ -98,14 +98,12 @@ export function TooltipComponent({
|
|
|
98
98
|
}, [isOpened, placement, updateTooltipPosition]);
|
|
99
99
|
|
|
100
100
|
useEffect(() => {
|
|
101
|
-
if (
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
handleClose();
|
|
106
|
-
}
|
|
101
|
+
if (isOpen && !disabled) {
|
|
102
|
+
handleOpen();
|
|
103
|
+
} else {
|
|
104
|
+
handleClose();
|
|
107
105
|
}
|
|
108
|
-
}, [isOpen,
|
|
106
|
+
}, [isOpen, handleOpen, handleClose, disabled]);
|
|
109
107
|
|
|
110
108
|
const controllers = !isControlled &&
|
|
111
109
|
!disabled && {
|
|
@@ -268,7 +266,7 @@ const TooltipBody = styled.span<
|
|
|
268
266
|
display: inline-block;
|
|
269
267
|
|
|
270
268
|
padding: var(--tooltip-padding);
|
|
271
|
-
max-width: var(--tooltip-max-width);
|
|
269
|
+
max-width: ${({ width }) => width || 'var(--tooltip-max-width)'};
|
|
272
270
|
white-space: normal;
|
|
273
271
|
word-break: normal;
|
|
274
272
|
overflow-wrap: break-word;
|
|
@@ -26,7 +26,7 @@ export function TooltipWrapper({
|
|
|
26
26
|
showOnHover = true,
|
|
27
27
|
disabled = false,
|
|
28
28
|
}: TooltipWrapperProps): JSX.Element {
|
|
29
|
-
const tooltip = useControl();
|
|
29
|
+
const tooltip = useControl(false);
|
|
30
30
|
|
|
31
31
|
const handleMouseEnter = (): void => {
|
|
32
32
|
if (showOnHover && !disabled) {
|
|
@@ -2,33 +2,15 @@ import type { EntityRelationType } from '../types/catalog';
|
|
|
2
2
|
|
|
3
3
|
export const CATALOG_TAG_MAX_LENGTH = 15;
|
|
4
4
|
|
|
5
|
-
export const
|
|
6
|
-
'
|
|
7
|
-
'
|
|
8
|
-
'
|
|
9
|
-
'
|
|
10
|
-
'
|
|
11
|
-
'
|
|
12
|
-
'
|
|
13
|
-
|
|
14
|
-
'dependsOn',
|
|
15
|
-
'dependencyOf',
|
|
16
|
-
'uses',
|
|
17
|
-
'usedBy',
|
|
18
|
-
'produces',
|
|
19
|
-
'consumes',
|
|
20
|
-
'linksTo',
|
|
21
|
-
'supersedes',
|
|
22
|
-
'supersededBy',
|
|
23
|
-
'compatibleWith',
|
|
24
|
-
'extends',
|
|
25
|
-
'extendedBy',
|
|
26
|
-
'relatesTo',
|
|
27
|
-
'hasMember',
|
|
28
|
-
'memberOf',
|
|
29
|
-
'triggers',
|
|
30
|
-
'triggeredBy',
|
|
31
|
-
] as const;
|
|
5
|
+
export const PREDEFINED_ENTITY_TYPES = [
|
|
6
|
+
'service',
|
|
7
|
+
'domain',
|
|
8
|
+
'team',
|
|
9
|
+
'user',
|
|
10
|
+
'api-description',
|
|
11
|
+
'data-schema',
|
|
12
|
+
'api-operation',
|
|
13
|
+
];
|
|
32
14
|
|
|
33
15
|
export const reverseRelationMap: Record<EntityRelationType, EntityRelationType> = {
|
|
34
16
|
partOf: 'hasParts',
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { useState, useCallback } from 'react';
|
|
1
|
+
import { useState, useCallback, useRef } from 'react';
|
|
2
|
+
|
|
3
|
+
const DEFAULT_CONTROL_OPEN_DELAY = 300;
|
|
2
4
|
|
|
3
5
|
export type UseControlReturnType = {
|
|
4
6
|
isOpened: boolean;
|
|
@@ -8,9 +10,25 @@ export type UseControlReturnType = {
|
|
|
8
10
|
|
|
9
11
|
export const useControl = (initialVal = false): UseControlReturnType => {
|
|
10
12
|
const [isOpened, setIsOpened] = useState<boolean>(initialVal);
|
|
13
|
+
const timeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
|
14
|
+
|
|
15
|
+
const clearOpenTimer = useCallback(() => {
|
|
16
|
+
if (timeoutRef.current) {
|
|
17
|
+
clearTimeout(timeoutRef.current);
|
|
18
|
+
}
|
|
19
|
+
}, []);
|
|
20
|
+
|
|
21
|
+
const handleOpen = useCallback(() => {
|
|
22
|
+
clearOpenTimer();
|
|
23
|
+
timeoutRef.current = setTimeout(() => {
|
|
24
|
+
setIsOpened(true);
|
|
25
|
+
}, DEFAULT_CONTROL_OPEN_DELAY);
|
|
26
|
+
}, [clearOpenTimer]);
|
|
11
27
|
|
|
12
|
-
const
|
|
13
|
-
|
|
28
|
+
const handleClose = useCallback(() => {
|
|
29
|
+
clearOpenTimer();
|
|
30
|
+
setIsOpened(false);
|
|
31
|
+
}, [clearOpenTimer]);
|
|
14
32
|
|
|
15
33
|
return {
|
|
16
34
|
isOpened,
|
|
@@ -22,6 +22,7 @@ export { useMount } from '../hooks/use-mount';
|
|
|
22
22
|
export { GlobalStyle } from '../styles/global';
|
|
23
23
|
export { breakpoints } from '../utils/media-css';
|
|
24
24
|
export { isPrimitive } from '../utils/args-typecheck';
|
|
25
|
+
export { ClipboardService } from '../utils/clipboard-service';
|
|
25
26
|
export { getUserAgent } from '../utils/get-user-agent';
|
|
26
27
|
export { useFocusTrap } from '../hooks/use-focus-trap';
|
|
27
28
|
export { useThemeHooks } from '../hooks/use-theme-hooks';
|
|
@@ -33,4 +34,3 @@ export { useDialogHotKeys } from '../hooks/use-dialog-hotkeys';
|
|
|
33
34
|
export { SecurityVariablesEnvSuffix } from '../constants/environments';
|
|
34
35
|
export { isUndefined, isString, isNotNull, isObject } from '../utils/type-guards';
|
|
35
36
|
export { ThemeDataContext, type ThemeDataTransferObject } from '../contexts/ThemeDataContext';
|
|
36
|
-
export { ENTITY_RELATION_TYPES } from '../constants/catalog';
|
|
@@ -780,6 +780,25 @@ const apiReferenceDocs = css`
|
|
|
780
780
|
--fab-icon-color: var(--navbar-text-color); // @presenter Color
|
|
781
781
|
|
|
782
782
|
// @tokens End
|
|
783
|
+
|
|
784
|
+
/**
|
|
785
|
+
* @tokens OpenAPI Schema Catalog Link
|
|
786
|
+
*/
|
|
787
|
+
|
|
788
|
+
--schema-catalog-link-margin-bottom: var(--spacing-lg);
|
|
789
|
+
--schema-catalog-link-padding: 2px;
|
|
790
|
+
--schema-catalog-link-border-radius: var(--border-radius-md);
|
|
791
|
+
--schema-catalog-link-background-color: var(--layer-color);
|
|
792
|
+
--schema-catalog-link-color: var(--color-purple-7);
|
|
793
|
+
|
|
794
|
+
--schema-catalog-link-share-icon-color: var(--color-purple-7);
|
|
795
|
+
--schema-catalog-link-share-icon-background-color: var(--color-purple-1);
|
|
796
|
+
--schema-catalog-link-share-icon-border-radius: var(--border-radius-md);
|
|
797
|
+
--schema-catalog-link-share-icon-wrapper-size: var(--spacing-xl);
|
|
798
|
+
|
|
799
|
+
--schema-catalog-link-text-color: var(--text-color-primary);
|
|
800
|
+
|
|
801
|
+
// @tokens End
|
|
783
802
|
`;
|
|
784
803
|
|
|
785
804
|
const badges = css`
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { InfiniteData, UseInfiniteQueryResult } from '@tanstack/react-query';
|
|
2
2
|
import { CatalogEntityConfig, LayoutVariant } from '@redocly/config';
|
|
3
|
+
import { ENTITY_RELATION_TYPES } from '@redocly/config';
|
|
3
4
|
|
|
4
5
|
import type { CatalogFilterConfig } from '@redocly/theme/config';
|
|
5
6
|
|
|
6
|
-
import { ENTITY_RELATION_TYPES } from '../constants/catalog';
|
|
7
|
-
|
|
8
7
|
export type SortOption = 'title' | '-title' | 'type' | '-type';
|
|
9
8
|
|
|
10
9
|
export type UseCatalogResponse = {
|
package/src/core/types/hooks.ts
CHANGED
|
@@ -17,6 +17,7 @@ import type {
|
|
|
17
17
|
FilteredCatalog,
|
|
18
18
|
UseCatalogSortResponse,
|
|
19
19
|
UseCatalogSearchResponse,
|
|
20
|
+
CatalogViewMode,
|
|
20
21
|
} from './catalog';
|
|
21
22
|
import type { UserMenuData } from './user-menu';
|
|
22
23
|
import type { ItemState } from './sidebar';
|
|
@@ -139,7 +140,11 @@ export type ThemeHooks = {
|
|
|
139
140
|
nextPage?: ResolvedNavItemWithLink;
|
|
140
141
|
}
|
|
141
142
|
| undefined;
|
|
142
|
-
useCatalog: (
|
|
143
|
+
useCatalog: (
|
|
144
|
+
config?: CatalogEntityConfig,
|
|
145
|
+
entitiesCounterInitial?: number,
|
|
146
|
+
initialViewMode?: CatalogViewMode,
|
|
147
|
+
) => UseCatalogResponse;
|
|
143
148
|
useCatalogSort: () => UseCatalogSortResponse;
|
|
144
149
|
useCatalogSearch: () => UseCatalogSearchResponse;
|
|
145
150
|
useFetchCatalogEntities: (
|
package/src/core/types/l10n.ts
CHANGED
|
@@ -280,6 +280,9 @@ export type TranslationKey =
|
|
|
280
280
|
| 'openapi.requiredScopes'
|
|
281
281
|
| 'openapi.unsupportedLanguage'
|
|
282
282
|
| 'openapi.failedToGenerateCodeSample'
|
|
283
|
+
| 'openapi.schemaCatalogLink.title'
|
|
284
|
+
| 'openapi.schemaCatalogLink.copyButtonTooltip'
|
|
285
|
+
| 'openapi.schemaCatalogLink.copiedTooltip'
|
|
283
286
|
| 'asyncapi.download.description.title'
|
|
284
287
|
| 'asyncapi.info.title'
|
|
285
288
|
| 'graphql.queries'
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import type { IconProps } from '@redocly/theme/icons/types';
|
|
5
|
+
|
|
6
|
+
import { getCssColorVariable } from '@redocly/theme/core/utils';
|
|
7
|
+
|
|
8
|
+
const Icon = (props: IconProps) => (
|
|
9
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" {...props}>
|
|
10
|
+
<path
|
|
11
|
+
fillRule="evenodd"
|
|
12
|
+
clipRule="evenodd"
|
|
13
|
+
d="M5.0625 7.3125H15.1875C15.4858 7.31216 15.7717 7.19352 15.9826 6.98262C16.1935 6.77171 16.3122 6.48576 16.3125 6.1875V2.8125C16.3122 2.51424 16.1935 2.22829 15.9826 2.01738C15.7717 1.80648 15.4858 1.68784 15.1875 1.6875H2.8125C2.51424 1.68784 2.22829 1.80648 2.01738 2.01738C1.80648 2.22829 1.68784 2.51424 1.6875 2.8125V6.1875C1.68784 6.48576 1.80648 6.77171 2.01738 6.98262C2.22829 7.19352 2.51424 7.31216 2.8125 7.3125H3.9375H5.0625ZM15.1875 2.8125H2.8125V6.1875H15.1875V2.8125Z"
|
|
14
|
+
/>
|
|
15
|
+
<path
|
|
16
|
+
fillRule="evenodd"
|
|
17
|
+
clipRule="evenodd"
|
|
18
|
+
d="M15.1875 10.6875H9.5625C9.26424 10.6878 8.97829 10.8065 8.76738 11.0174C8.55648 11.2283 8.43784 11.5142 8.4375 11.8125V12.9375H5.0625V10.4546V9.5625V7.3125H3.9375V10.4546V12.9375C3.93784 13.2358 4.05648 13.5217 4.26738 13.7326C4.47829 13.9435 4.76424 14.0622 5.0625 14.0625H8.4375V15.1875C8.43784 15.4858 8.55648 15.7717 8.76738 15.9826C8.97829 16.1935 9.26424 16.3122 9.5625 16.3125H15.1875C15.4858 16.3122 15.7717 16.1935 15.9826 15.9826C16.1935 15.7717 16.3122 15.4858 16.3125 15.1875V11.8125C16.3122 11.5142 16.1935 11.2283 15.9826 11.0174C15.7717 10.8065 15.4858 10.6878 15.1875 10.6875ZM9.5625 11.8125V15.1875H15.1875V11.8125H9.5625Z"
|
|
19
|
+
/>
|
|
20
|
+
</svg>
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
export const HierarchyIcon = styled(Icon).attrs(() => ({
|
|
24
|
+
'data-component-name': 'icons/HierarchyIcon/HierarchyIcon',
|
|
25
|
+
}))<IconProps>`
|
|
26
|
+
path {
|
|
27
|
+
fill: ${({ color }) => getCssColorVariable(color)};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
height: ${({ size }) => size || '16px'};
|
|
31
|
+
width: ${({ size }) => size || '16px'};
|
|
32
|
+
`;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import type { IconProps } from '@redocly/theme/icons/types';
|
|
5
|
+
|
|
6
|
+
import { getCssColorVariable } from '@redocly/theme/core/utils';
|
|
7
|
+
|
|
8
|
+
const Icon = (props: IconProps) => (
|
|
9
|
+
<svg
|
|
10
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
11
|
+
width="8"
|
|
12
|
+
height="12"
|
|
13
|
+
viewBox="0 0 8 12"
|
|
14
|
+
fill="none"
|
|
15
|
+
{...props}
|
|
16
|
+
>
|
|
17
|
+
<path
|
|
18
|
+
d="M7.6375 3.4875L5.0125 0.8625C4.9375 0.7875 4.8625 0.75 4.75 0.75H1C0.5875 0.75 0.25 1.0875 0.25 1.5V10.5C0.25 10.9125 0.5875 11.25 1 11.25H7C7.4125 11.25 7.75 10.9125 7.75 10.5V3.75C7.75 3.6375 7.7125 3.5625 7.6375 3.4875ZM4.75 1.65L6.85 3.75H4.75V1.65ZM7 10.5H1V1.5H4V3.75C4 4.1625 4.3375 4.5 4.75 4.5H7V10.5Z"
|
|
19
|
+
fill="currentColor"
|
|
20
|
+
/>
|
|
21
|
+
<path d="M6.25 8.25H1.75V9H6.25V8.25Z" fill="currentColor" />
|
|
22
|
+
<path d="M6.25 6H1.75V6.75H6.25V6Z" fill="currentColor" />
|
|
23
|
+
</svg>
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
export const NoteIcon = styled(Icon).attrs(() => ({
|
|
27
|
+
'data-component-name': 'icons/NoteIcon/NoteIcon',
|
|
28
|
+
}))<IconProps>`
|
|
29
|
+
path {
|
|
30
|
+
fill: ${({ color }) => getCssColorVariable(color)};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
height: ${({ size }) => size || '16px'};
|
|
34
|
+
width: ${({ size }) => size || '16px'};
|
|
35
|
+
`;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import type { IconProps } from '@redocly/theme/icons/types';
|
|
5
|
+
|
|
6
|
+
import { getCssColorVariable } from '@redocly/theme/core/utils';
|
|
7
|
+
|
|
8
|
+
const Icon = (props: IconProps) => (
|
|
9
|
+
<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
|
|
10
|
+
<path d="M11.5 10.0001C11.1257 10.002 10.7566 10.0879 10.42 10.2514C10.0834 10.415 9.78776 10.652 9.55497 10.9451L5.89997 8.6601C6.03318 8.23018 6.03318 7.77002 5.89997 7.3401L9.55497 5.0551C9.92594 5.51446 10.4475 5.82769 11.0273 5.93931C11.6071 6.05092 12.2077 5.95372 12.7227 5.66491C13.2377 5.37611 13.6339 4.91435 13.841 4.36143C14.0482 3.8085 14.0529 3.20011 13.8544 2.64402C13.656 2.08793 13.2671 1.62003 12.7567 1.32322C12.2462 1.0264 11.6472 0.919827 11.0657 1.02237C10.4843 1.12491 9.95785 1.42996 9.57975 1.88346C9.20164 2.33697 8.99626 2.90966 8.99997 3.5001C9.00233 3.72369 9.03599 3.94585 9.09997 4.1601L5.44497 6.4451C5.12229 6.03889 4.68124 5.74313 4.18295 5.5988C3.68465 5.45447 3.1538 5.46873 2.66398 5.63961C2.17415 5.81048 1.74961 6.1295 1.44921 6.55245C1.14881 6.9754 0.987427 7.48133 0.987427 8.0001C0.987427 8.51888 1.14881 9.0248 1.44921 9.44775C1.74961 9.8707 2.17415 10.1897 2.66398 10.3606C3.1538 10.5315 3.68465 10.5457 4.18295 10.4014C4.68124 10.2571 5.12229 9.96131 5.44497 9.5551L9.09997 11.8401C9.03599 12.0544 9.00233 12.2765 8.99997 12.5001C8.99997 12.9946 9.14659 13.4779 9.4213 13.889C9.696 14.3002 10.0864 14.6206 10.5433 14.8098C11.0001 14.999 11.5027 15.0485 11.9877 14.9521C12.4726 14.8556 12.9181 14.6175 13.2677 14.2679C13.6174 13.9182 13.8555 13.4728 13.9519 12.9878C14.0484 12.5029 13.9989 12.0002 13.8097 11.5434C13.6204 11.0866 13.3 10.6961 12.8889 10.4214C12.4778 10.1467 11.9944 10.0001 11.5 10.0001ZM11.5 2.0001C11.7966 2.0001 12.0867 2.08808 12.3333 2.2529C12.58 2.41772 12.7723 2.65199 12.8858 2.92608C12.9993 3.20017 13.029 3.50177 12.9711 3.79274C12.9133 4.08371 12.7704 4.35098 12.5606 4.56076C12.3509 4.77054 12.0836 4.9134 11.7926 4.97128C11.5016 5.02916 11.2 4.99945 10.9259 4.88592C10.6519 4.77239 10.4176 4.58013 10.2528 4.33346C10.0879 4.08678 9.99997 3.79677 9.99997 3.5001C9.99997 3.10228 10.158 2.72075 10.4393 2.43944C10.7206 2.15814 11.1021 2.0001 11.5 2.0001ZM3.49997 9.5001C3.2033 9.5001 2.91329 9.41213 2.66661 9.24731C2.41994 9.08248 2.22768 8.84822 2.11415 8.57413C2.00062 8.30004 1.97091 7.99844 2.02879 7.70747C2.08667 7.4165 2.22953 7.14922 2.43931 6.93944C2.64909 6.72966 2.91636 6.5868 3.20733 6.52892C3.49831 6.47105 3.79991 6.50075 4.074 6.61428C4.34808 6.72781 4.58235 6.92007 4.74717 7.16675C4.912 7.41342 4.99997 7.70343 4.99997 8.0001C4.99997 8.39793 4.84193 8.77946 4.56063 9.06076C4.27933 9.34207 3.89779 9.5001 3.49997 9.5001ZM11.5 14.0001C11.2033 14.0001 10.9133 13.9121 10.6666 13.7473C10.4199 13.5825 10.2277 13.3482 10.1142 13.0741C10.0006 12.8 9.97091 12.4984 10.0288 12.2075C10.0867 11.9165 10.2295 11.6492 10.4393 11.4394C10.6491 11.2297 10.9164 11.0868 11.2073 11.0289C11.4983 10.971 11.7999 11.0008 12.074 11.1143C12.3481 11.2278 12.5824 11.4201 12.7472 11.6667C12.912 11.9134 13 12.2034 13 12.5001C13 12.8979 12.8419 13.2795 12.5606 13.5608C12.2793 13.8421 11.8978 14.0001 11.5 14.0001Z" />
|
|
11
|
+
</svg>
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
export const ShareIcon = styled(Icon).attrs(() => ({
|
|
15
|
+
'data-component-name': 'icons/ShareIcon/ShareIcon',
|
|
16
|
+
}))<IconProps>`
|
|
17
|
+
path {
|
|
18
|
+
fill: ${({ color }) => getCssColorVariable(color)};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
height: ${({ size }) => size || '16px'};
|
|
22
|
+
width: ${({ size }) => size || '16px'};
|
|
23
|
+
`;
|
package/src/index.ts
CHANGED
|
@@ -245,6 +245,7 @@ export * from '@redocly/theme/icons/MarkdownFullIcon/MarkdownFullIcon';
|
|
|
245
245
|
export * from '@redocly/theme/icons/DocumentBlankIcon/DocumentBlankIcon';
|
|
246
246
|
export * from '@redocly/theme/icons/WarningSquareIcon/WarningSquareIcon';
|
|
247
247
|
export * from '@redocly/theme/icons/MenuIcon/MenuIcon';
|
|
248
|
+
export * from '@redocly/theme/icons/NoteIcon/NoteIcon';
|
|
248
249
|
export * from '@redocly/theme/icons/GlobalOutlinedIcon/GlobalOutlinedIcon';
|
|
249
250
|
export * from '@redocly/theme/icons/FaceDissatisfiedIcon/FaceDissatisfiedIcon';
|
|
250
251
|
export * from '@redocly/theme/icons/FaceNeutralIcon/FaceNeutralIcon';
|
|
@@ -283,6 +284,7 @@ export * from '@redocly/theme/icons/AiStarsIcon/AiStarsIcon';
|
|
|
283
284
|
export * from '@redocly/theme/icons/AiStarsGradientIcon/AiStarsGradientIcon';
|
|
284
285
|
export * from '@redocly/theme/icons/WorkflowHierarchyIcon/WorkflowHierarchyIcon';
|
|
285
286
|
export * from '@redocly/theme/icons/GenericIcon/GenericIcon';
|
|
287
|
+
export * from '@redocly/theme/icons/ShareIcon/ShareIcon';
|
|
286
288
|
/* Layouts */
|
|
287
289
|
export * from '@redocly/theme/layouts/RootLayout';
|
|
288
290
|
export * from '@redocly/theme/layouts/PageLayout';
|