@redocly/theme 0.65.0-next.0 → 0.65.0-next.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.
- package/lib/components/Button/variables.js +3 -3
- package/lib/components/CodeBlock/CodeBlockContainer.js +12 -7
- package/lib/components/CodeBlock/variables.dark.d.ts +1 -0
- package/lib/components/CodeBlock/variables.dark.js +8 -0
- package/lib/components/CodeBlock/variables.js +3 -1
- package/lib/components/Menu/MenuItem.js +15 -26
- package/lib/components/Menu/variables.dark.js +2 -0
- package/lib/components/Menu/variables.js +3 -1
- package/lib/components/PageNavigation/NavigationButton.js +19 -11
- package/lib/components/PageNavigation/PageNavigation.js +6 -0
- package/lib/components/PageNavigation/variables.d.ts +1 -0
- package/lib/components/PageNavigation/variables.js +27 -0
- package/lib/components/Search/variables.js +2 -2
- package/lib/core/hooks/use-modal-scroll-lock.js +21 -10
- package/lib/core/hooks/use-page-actions.js +43 -24
- package/lib/core/styles/dark.js +2 -0
- package/lib/core/styles/global.js +9 -5
- package/lib/core/styles/palette.dark.js +2 -0
- package/lib/core/styles/palette.js +16 -0
- package/lib/core/types/catalog.d.ts +1 -1
- package/lib/core/types/l10n.d.ts +1 -1
- package/lib/icons/LinkIcon/LinkIcon.js +6 -6
- package/lib/markdoc/components/Heading/Heading.js +7 -1
- package/package.json +3 -3
- package/src/components/Button/variables.ts +3 -3
- package/src/components/CodeBlock/CodeBlockContainer.tsx +12 -7
- package/src/components/CodeBlock/variables.dark.ts +5 -0
- package/src/components/CodeBlock/variables.ts +3 -1
- package/src/components/Menu/MenuItem.tsx +15 -26
- package/src/components/Menu/variables.dark.ts +2 -0
- package/src/components/Menu/variables.ts +3 -1
- package/src/components/PageNavigation/NavigationButton.tsx +24 -22
- package/src/components/PageNavigation/PageNavigation.tsx +6 -0
- package/src/components/PageNavigation/variables.ts +24 -0
- package/src/components/Search/variables.ts +2 -2
- package/src/core/hooks/use-modal-scroll-lock.ts +30 -14
- package/src/core/hooks/use-page-actions.ts +70 -33
- package/src/core/styles/dark.ts +2 -0
- package/src/core/styles/global.ts +9 -5
- package/src/core/styles/palette.dark.ts +2 -0
- package/src/core/styles/palette.ts +16 -0
- package/src/core/types/catalog.ts +1 -1
- package/src/core/types/l10n.ts +9 -0
- package/src/icons/LinkIcon/LinkIcon.tsx +19 -6
- package/src/markdoc/components/Heading/Heading.tsx +7 -1
|
@@ -64,21 +64,14 @@ export function usePageActions(
|
|
|
64
64
|
const openApiSharedData = usePageSharedData<
|
|
65
65
|
{ options: { excludeFromSearch: boolean } } | undefined
|
|
66
66
|
>('openAPIDocsStore');
|
|
67
|
+
const openapiExcludeFromSearch = openApiSharedData?.options?.excludeFromSearch;
|
|
67
68
|
const mcpConfig = useMCPConfig();
|
|
68
69
|
|
|
69
|
-
const shouldHideAllActions = shouldHidePageActions(
|
|
70
|
-
pageProps,
|
|
71
|
-
themeConfig,
|
|
72
|
-
openApiSharedData?.options?.excludeFromSearch,
|
|
73
|
-
);
|
|
74
70
|
const { isPublic } = usePageData() || {};
|
|
75
71
|
|
|
76
72
|
const createMCPHandler = useCallback(
|
|
77
73
|
(clientType: MCPClientType, requiresMcpUrl: boolean = false) =>
|
|
78
|
-
() => {
|
|
79
|
-
if (requiresMcpUrl && !mcpUrl) return null;
|
|
80
|
-
if (!requiresMcpUrl && (mcpUrl || mcpConfig.isMcpDisabled)) return null;
|
|
81
|
-
|
|
74
|
+
(): PageAction => {
|
|
82
75
|
const config = requiresMcpUrl
|
|
83
76
|
? { serverName: mcpConfig.serverName, url: mcpUrl || '' }
|
|
84
77
|
: { serverName: mcpConfig.serverName, url: mcpConfig.serverUrl || '' };
|
|
@@ -107,9 +100,14 @@ export function usePageActions(
|
|
|
107
100
|
);
|
|
108
101
|
|
|
109
102
|
const result: PageAction[] = useMemo(() => {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
103
|
+
const hideActionContext: ShouldHideActionContext = {
|
|
104
|
+
pageProps,
|
|
105
|
+
themeConfig,
|
|
106
|
+
openapiExcludeFromSearch,
|
|
107
|
+
isPublic,
|
|
108
|
+
mcpUrl,
|
|
109
|
+
isMcpDisabled: mcpConfig.isMcpDisabled,
|
|
110
|
+
};
|
|
113
111
|
|
|
114
112
|
const origin = IS_BROWSER
|
|
115
113
|
? window.location.origin
|
|
@@ -121,7 +119,7 @@ export function usePageActions(
|
|
|
121
119
|
? combineUrls(origin, pathname, 'index.html.md')
|
|
122
120
|
: combineUrls(origin, removeTrailingSlash(pathname) + '.md');
|
|
123
121
|
|
|
124
|
-
const actionHandlers: Record<PageActionType, () => PageAction
|
|
122
|
+
const actionHandlers: Record<PageActionType, () => PageAction> = {
|
|
125
123
|
'docs-mcp-cursor': createMCPHandler('cursor', false),
|
|
126
124
|
'docs-mcp-vscode': createMCPHandler('vscode', false),
|
|
127
125
|
'mcp-cursor': createMCPHandler('cursor', true),
|
|
@@ -169,9 +167,6 @@ export function usePageActions(
|
|
|
169
167
|
}),
|
|
170
168
|
|
|
171
169
|
chatgpt: () => {
|
|
172
|
-
if (!isPublic) {
|
|
173
|
-
return null;
|
|
174
|
-
}
|
|
175
170
|
const link = getExternalAiPromptLink('https://chat.openai.com', mdPageUrl);
|
|
176
171
|
return {
|
|
177
172
|
buttonText: translate('page.actions.chatGptButtonText', 'Open in ChatGPT'),
|
|
@@ -192,9 +187,6 @@ export function usePageActions(
|
|
|
192
187
|
},
|
|
193
188
|
|
|
194
189
|
claude: () => {
|
|
195
|
-
if (!isPublic) {
|
|
196
|
-
return null;
|
|
197
|
-
}
|
|
198
190
|
const link = getExternalAiPromptLink('https://claude.ai/new', mdPageUrl);
|
|
199
191
|
return {
|
|
200
192
|
buttonText: translate('page.actions.claudeButtonText', 'Open in Claude'),
|
|
@@ -216,15 +208,18 @@ export function usePageActions(
|
|
|
216
208
|
};
|
|
217
209
|
|
|
218
210
|
return (themeConfig.navigation?.actions?.items || actions || DEFAULT_ENABLED_ACTIONS)
|
|
219
|
-
.
|
|
220
|
-
.
|
|
211
|
+
.filter((action) => !shouldHideAction(action, hideActionContext))
|
|
212
|
+
.map((action) => actionHandlers[action]());
|
|
221
213
|
}, [
|
|
222
|
-
|
|
214
|
+
pageProps,
|
|
215
|
+
themeConfig,
|
|
216
|
+
openapiExcludeFromSearch,
|
|
217
|
+
isPublic,
|
|
218
|
+
mcpUrl,
|
|
219
|
+
mcpConfig.isMcpDisabled,
|
|
223
220
|
pageSlug,
|
|
224
|
-
themeConfig.navigation?.actions?.items,
|
|
225
221
|
actions,
|
|
226
222
|
translate,
|
|
227
|
-
isPublic,
|
|
228
223
|
createMCPHandler,
|
|
229
224
|
telemetry,
|
|
230
225
|
]);
|
|
@@ -285,35 +280,77 @@ function createMCPAction({
|
|
|
285
280
|
};
|
|
286
281
|
}
|
|
287
282
|
|
|
288
|
-
|
|
289
|
-
pageProps: PageProps
|
|
290
|
-
themeConfig: UiAccessibleConfig
|
|
291
|
-
openapiExcludeFromSearch?: boolean
|
|
283
|
+
type ShouldHideActionContext = {
|
|
284
|
+
pageProps: PageProps;
|
|
285
|
+
themeConfig: UiAccessibleConfig;
|
|
286
|
+
openapiExcludeFromSearch?: boolean;
|
|
287
|
+
isPublic?: boolean;
|
|
288
|
+
mcpUrl?: string;
|
|
289
|
+
isMcpDisabled: boolean;
|
|
290
|
+
};
|
|
291
|
+
|
|
292
|
+
function shouldHideAction(
|
|
293
|
+
action: PageActionType,
|
|
294
|
+
{
|
|
295
|
+
pageProps,
|
|
296
|
+
themeConfig,
|
|
297
|
+
openapiExcludeFromSearch,
|
|
298
|
+
isPublic,
|
|
299
|
+
mcpUrl,
|
|
300
|
+
isMcpDisabled,
|
|
301
|
+
}: ShouldHideActionContext,
|
|
292
302
|
): boolean {
|
|
293
303
|
// Can't use any actions if search is globally disabled (markdown files are not generated)
|
|
294
304
|
if (themeConfig.search?.hide) {
|
|
295
305
|
return true;
|
|
296
306
|
}
|
|
297
|
-
|
|
298
307
|
// Can't use any actions if no markdown files are generated for LLMs
|
|
299
308
|
if (pageProps?.seo?.llmstxt?.hide) {
|
|
300
309
|
return true;
|
|
301
310
|
}
|
|
302
|
-
|
|
303
311
|
// Page actions are explicitly disabled in config
|
|
304
312
|
if (themeConfig.navigation?.actions?.hide) {
|
|
305
313
|
return true;
|
|
306
314
|
}
|
|
307
315
|
|
|
308
|
-
// Page is excluded from search
|
|
309
316
|
const isOpenApiPage =
|
|
310
317
|
pageProps?.metadata?.type === 'openapi' || pageProps?.metadata?.subType === 'openapi-operation';
|
|
311
318
|
const isPageExcludedFromSearch =
|
|
312
319
|
pageProps?.frontmatter?.excludeFromSearch || (isOpenApiPage && openapiExcludeFromSearch);
|
|
313
320
|
|
|
314
|
-
|
|
321
|
+
// Page excluded from search: only explicit MCP connect actions remain visible,
|
|
322
|
+
// since they don't depend on the page's markdown.
|
|
323
|
+
if (isPageExcludedFromSearch && action !== 'mcp-cursor' && action !== 'mcp-vscode') {
|
|
315
324
|
return true;
|
|
316
325
|
}
|
|
317
326
|
|
|
318
|
-
return
|
|
327
|
+
return shouldHideActionByType(action, { isPublic, mcpUrl, isMcpDisabled });
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
function shouldHideActionByType(
|
|
331
|
+
action: PageActionType,
|
|
332
|
+
{
|
|
333
|
+
isPublic,
|
|
334
|
+
mcpUrl,
|
|
335
|
+
isMcpDisabled,
|
|
336
|
+
}: Pick<ShouldHideActionContext, 'isPublic' | 'mcpUrl' | 'isMcpDisabled'>,
|
|
337
|
+
): boolean {
|
|
338
|
+
switch (action) {
|
|
339
|
+
case 'chatgpt':
|
|
340
|
+
case 'claude':
|
|
341
|
+
return !isPublic;
|
|
342
|
+
case 'docs-mcp-cursor':
|
|
343
|
+
case 'docs-mcp-vscode':
|
|
344
|
+
return Boolean(mcpUrl) || isMcpDisabled;
|
|
345
|
+
case 'mcp-cursor':
|
|
346
|
+
case 'mcp-vscode':
|
|
347
|
+
return !mcpUrl;
|
|
348
|
+
case 'copy':
|
|
349
|
+
case 'view':
|
|
350
|
+
return false;
|
|
351
|
+
default: {
|
|
352
|
+
action satisfies never;
|
|
353
|
+
return true;
|
|
354
|
+
}
|
|
355
|
+
}
|
|
319
356
|
}
|
package/src/core/styles/dark.ts
CHANGED
|
@@ -15,6 +15,7 @@ import { pageActionsDarkMode } from '@redocly/theme/components/PageActions/varia
|
|
|
15
15
|
import { tooltipDarkMode } from '@redocly/theme/components/Tooltip/variables.dark';
|
|
16
16
|
import { bannerDarkMode } from '@redocly/theme/components/Banner/variables.dark';
|
|
17
17
|
import { admonitionDarkMode } from '@redocly/theme/components/Admonition/variables.dark';
|
|
18
|
+
import { codeBlockDarkMode } from '@redocly/theme/components/CodeBlock/variables.dark';
|
|
18
19
|
|
|
19
20
|
import { activeBrandPaletteDark } from './palette.dark';
|
|
20
21
|
|
|
@@ -352,6 +353,7 @@ export const darkMode = css`
|
|
|
352
353
|
${admonitionDarkMode}
|
|
353
354
|
${badgesDarkMode}
|
|
354
355
|
${activeBrandPaletteDark}
|
|
356
|
+
${codeBlockDarkMode}
|
|
355
357
|
/**
|
|
356
358
|
* @tokens Dark Theme Scrollbar Config
|
|
357
359
|
* @presenter Color
|
|
@@ -44,6 +44,7 @@ import { skipContent } from '@redocly/theme/components/SkipContent/variables';
|
|
|
44
44
|
import { pageActions } from '@redocly/theme/components/PageActions/variables';
|
|
45
45
|
import { svgViewer } from '@redocly/theme/components/SvgViewer/variables';
|
|
46
46
|
import { toast } from '@redocly/theme/components/Toast/variables';
|
|
47
|
+
import { pageNavigation } from '@redocly/theme/components/PageNavigation/variables';
|
|
47
48
|
|
|
48
49
|
import { activeBrandPaletteLight } from './palette';
|
|
49
50
|
import { darkMode } from './dark';
|
|
@@ -481,8 +482,8 @@ const headingsTypography = css`
|
|
|
481
482
|
* @tokens Typography heading anchor icon
|
|
482
483
|
*/
|
|
483
484
|
|
|
484
|
-
--heading-anchor-offset-right:
|
|
485
|
-
--heading-anchor-color: var(--
|
|
485
|
+
--heading-anchor-offset-right: var(--spacing-xs); // @presenter Spacing
|
|
486
|
+
--heading-anchor-color: var(--icon-color-primary); // @presenter Color
|
|
486
487
|
--heading-anchor-icon: none;
|
|
487
488
|
|
|
488
489
|
/**
|
|
@@ -706,9 +707,10 @@ const apiReferenceDocs = css`
|
|
|
706
707
|
* @tokens API Reference Schema Nested styles
|
|
707
708
|
*/
|
|
708
709
|
|
|
709
|
-
--schema-nested-offset: calc(var(--spacing-
|
|
710
|
+
--schema-nested-offset: calc(var(--spacing-sm) - 1px); // @presenter Spacing
|
|
710
711
|
--schema-nested-bg-color: var(--tree-bg-color-active); // @presenter Color
|
|
711
|
-
|
|
712
|
+
--schema-nested-hyperlink-offset: 2px; // @presenter Spacing
|
|
713
|
+
|
|
712
714
|
/**
|
|
713
715
|
* @tokens API Reference Schema Required styles
|
|
714
716
|
*/
|
|
@@ -740,7 +742,8 @@ const apiReferenceDocs = css`
|
|
|
740
742
|
* @tokens API Reference Schema Properties
|
|
741
743
|
*/
|
|
742
744
|
|
|
743
|
-
--schemas-property-name-text-color: var(--text-color-primary); //@presenter Color
|
|
745
|
+
--schemas-property-name-text-color: var(--color-primary-base, var(--text-color-primary)); //@presenter Color
|
|
746
|
+
--schemas-property-name-box-text-color: var(--text-color-primary); // @presenter Color
|
|
744
747
|
--schemas-property-name-font-size: var(--font-size-base); // @presenter FontSize
|
|
745
748
|
--schemas-property-name-font-family: var(--code-font-family); // @presenter FontFamily
|
|
746
749
|
--schemas-property-name-font-weight: var(--font-weight-regular); // @presenter FontWeight
|
|
@@ -1342,6 +1345,7 @@ export const styles = css<{ palette?: string }>`
|
|
|
1342
1345
|
${pageActions}
|
|
1343
1346
|
${svgViewer}
|
|
1344
1347
|
${toast}
|
|
1348
|
+
${pageNavigation}
|
|
1345
1349
|
|
|
1346
1350
|
background-color: var(--bg-color);
|
|
1347
1351
|
color: var(--text-color-primary);
|
|
@@ -190,6 +190,8 @@ function brandPaletteDark(palette: string | undefined): FlattenSimpleInterpolati
|
|
|
190
190
|
|
|
191
191
|
--admonition-default-bg-color-legacy: var(--color-warm-grey-3);
|
|
192
192
|
--admonition-default-border-color-legacy: var(--color-warm-grey-5);
|
|
193
|
+
|
|
194
|
+
--code-block-highlighted-bg-color-legacy: color-mix(in srgb, var(--color-warm-grey-4) 40%, transparent);
|
|
193
195
|
`;
|
|
194
196
|
}
|
|
195
197
|
}
|
|
@@ -161,6 +161,22 @@ function brandPaletteLight(palette: string | undefined): FlattenSimpleInterpolat
|
|
|
161
161
|
|
|
162
162
|
--menu-item-bg-color-active-legacy: var(--tree-bg-color-active); // @presenter Color
|
|
163
163
|
--menu-item-color-active-legacy: var(--tree-content-color-default); // @presenter Color
|
|
164
|
+
--menu-item-color-active-hover-legacy: var(--tree-content-color-hover); // @presenter Color
|
|
165
|
+
--menu-item-bg-color-active-hover-legacy: var(--color-hover-base); // @presenter Color
|
|
166
|
+
|
|
167
|
+
--code-block-highlighted-bg-color-legacy: var(--layer-color-hover); // @presenter Color
|
|
168
|
+
--code-block-tokens-string-color-legacy: var(--color-blue-7); // @presenter Color
|
|
169
|
+
|
|
170
|
+
--security-header-color-legacy: var(--link-color-primary); // @presenter Color
|
|
171
|
+
|
|
172
|
+
--schema-name-color-legacy: var(--text-color-primary); // @presenter Color
|
|
173
|
+
|
|
174
|
+
--search-ai-conversation-input-border-color-focus-legacy: var(--color-blue-6); // @presenter Color
|
|
175
|
+
--search-ai-user-bg-color-legacy: var(--color-blue-6); // @presenter Color
|
|
176
|
+
|
|
177
|
+
--button-content-color-link-legacy: var(--link-color-primary); // @presenter Color
|
|
178
|
+
--button-content-color-link-hover-legacy: var(--link-color-primary-hover); // @presenter Color
|
|
179
|
+
--button-content-color-link-pressed-legacy: var(--link-color-primary-pressed); // @presenter Color
|
|
164
180
|
`;
|
|
165
181
|
}
|
|
166
182
|
}
|
|
@@ -171,7 +171,7 @@ export type BffCatalogEntity = {
|
|
|
171
171
|
key: string;
|
|
172
172
|
type: string;
|
|
173
173
|
title: string;
|
|
174
|
-
readonly source: '
|
|
174
|
+
readonly source: 'remote' | 'file';
|
|
175
175
|
domains?: Array<BffCatalogRelatedEntity>;
|
|
176
176
|
owners?: Array<BffCatalogRelatedEntity>;
|
|
177
177
|
summary?: string | null;
|
package/src/core/types/l10n.ts
CHANGED
|
@@ -18,6 +18,15 @@ export type TranslationKey =
|
|
|
18
18
|
| 'dev.edit.description.dialog.title'
|
|
19
19
|
| 'dev.edit.description.dialog.save'
|
|
20
20
|
| 'dev.edit.description.dialog.cancel'
|
|
21
|
+
| 'dev.create.app.dialog.callbackUrls'
|
|
22
|
+
| 'dev.create.app.dialog.callbackUrls.placeholder'
|
|
23
|
+
| 'dev.create.app.dialog.callbackUrls.hint'
|
|
24
|
+
| 'dev.app.callbackUrls.title'
|
|
25
|
+
| 'dev.edit.callbackUrls.dialog.title'
|
|
26
|
+
| 'dev.edit.callbackUrls.dialog.placeholder'
|
|
27
|
+
| 'dev.edit.callbackUrls.dialog.hint'
|
|
28
|
+
| 'dev.edit.callbackUrls.dialog.save'
|
|
29
|
+
| 'dev.edit.callbackUrls.dialog.cancel'
|
|
21
30
|
| 'dev.edit.apis.dialog.selectedAPIs'
|
|
22
31
|
| 'dev.app.key.create'
|
|
23
32
|
| 'dev.create.key.dialog.title'
|
|
@@ -6,19 +6,32 @@ import type { IconProps } from '@redocly/theme/icons/types';
|
|
|
6
6
|
import { getCssColorVariable } from '@redocly/theme/core/utils';
|
|
7
7
|
|
|
8
8
|
const Icon = (props: IconProps) => (
|
|
9
|
-
<svg
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
<svg
|
|
10
|
+
width="20"
|
|
11
|
+
height="20"
|
|
12
|
+
viewBox="0 0 20 20"
|
|
13
|
+
fill="none"
|
|
14
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
15
|
+
{...props}
|
|
16
|
+
>
|
|
17
|
+
<path
|
|
18
|
+
d="M0 4C0 1.79086 1.79086 0 4 0H16C18.2091 0 20 1.79086 20 4V16C20 18.2091 18.2091 20 16 20H4C1.79086 20 0 18.2091 0 16V4Z"
|
|
19
|
+
fill="var(--layer-color)"
|
|
20
|
+
/>
|
|
21
|
+
<path
|
|
22
|
+
d="M7.37318 9.56229H12.6232C12.7392 9.56229 12.8505 9.60838 12.9325 9.69043C13.0146 9.77247 13.0607 9.88375 13.0607 9.99979C13.0607 10.1158 13.0146 10.2271 12.9325 10.3091C12.8505 10.3912 12.7392 10.4373 12.6232 10.4373H7.37318C7.25714 10.4373 7.14586 10.3912 7.06382 10.3091C6.98177 10.2271 6.93568 10.1158 6.93568 9.99979C6.93568 9.88375 6.98177 9.77247 7.06382 9.69043C7.14586 9.60838 7.25714 9.56229 7.37318 9.56229ZM8.6853 12.1875H6.4978C5.91764 12.1875 5.36124 11.957 4.95101 11.5468C4.54077 11.1366 4.3103 10.5802 4.3103 10C4.3103 9.41984 4.54077 8.86344 4.95101 8.4532C5.36124 8.04297 5.91764 7.8125 6.4978 7.8125H8.6853C8.80133 7.8125 8.91262 7.76641 8.99466 7.68436C9.07671 7.60231 9.1228 7.49103 9.1228 7.375C9.1228 7.25897 9.07671 7.14769 8.99466 7.06564C8.91262 6.98359 8.80133 6.9375 8.6853 6.9375H6.4978C5.68558 6.9375 4.90662 7.26016 4.33229 7.83449C3.75796 8.40882 3.4353 9.18777 3.4353 10C3.4353 10.8122 3.75796 11.5912 4.33229 12.1655C4.90662 12.7398 5.68558 13.0625 6.4978 13.0625H8.6853C8.80133 13.0625 8.91262 13.0164 8.99466 12.9344C9.07671 12.8523 9.1228 12.741 9.1228 12.625C9.1228 12.509 9.07671 12.3977 8.99466 12.3156C8.91262 12.2336 8.80133 12.1875 8.6853 12.1875ZM13.4982 6.9375H11.3107C11.1946 6.9375 11.0834 6.98359 11.0013 7.06564C10.9193 7.14769 10.8732 7.25897 10.8732 7.375C10.8732 7.49103 10.9193 7.60231 11.0013 7.68436C11.0834 7.76641 11.1946 7.8125 11.3107 7.8125H13.4982C14.0783 7.8125 14.6347 8.04297 15.045 8.4532C15.4552 8.86344 15.6857 9.41984 15.6857 10C15.6857 10.5802 15.4552 11.1366 15.045 11.5468C14.6347 11.957 14.0783 12.1875 13.4982 12.1875H11.3107C11.1946 12.1875 11.0834 12.2336 11.0013 12.3156C10.9193 12.3977 10.8732 12.509 10.8732 12.625C10.8732 12.741 10.9193 12.8523 11.0013 12.9344C11.0834 13.0164 11.1946 13.0625 11.3107 13.0625H13.4982C14.3104 13.0625 15.0894 12.7398 15.6637 12.1655C16.238 11.5912 16.5607 10.8122 16.5607 10C16.5607 9.18777 16.238 8.40882 15.6637 7.83449C15.0894 7.26016 14.3104 6.9375 13.4982 6.9375Z"
|
|
23
|
+
fill="var(--icon-color-primary)"
|
|
24
|
+
/>
|
|
12
25
|
</svg>
|
|
13
26
|
);
|
|
14
27
|
|
|
15
28
|
export const LinkIcon = styled(Icon).attrs(() => ({
|
|
16
29
|
'data-component-name': 'icons/LinkIcon/LinkIcon',
|
|
17
30
|
}))<IconProps>`
|
|
18
|
-
path {
|
|
31
|
+
path:last-of-type {
|
|
19
32
|
fill: ${({ color }) => getCssColorVariable(color)};
|
|
20
33
|
}
|
|
21
34
|
|
|
22
|
-
height: ${({ size }) => size || '
|
|
23
|
-
width: ${({ size }) => size || '
|
|
35
|
+
height: ${({ size }) => size || '20px'};
|
|
36
|
+
width: ${({ size }) => size || '20px'};
|
|
24
37
|
`;
|
|
@@ -73,7 +73,7 @@ export function Heading({
|
|
|
73
73
|
href={`#${id}`}
|
|
74
74
|
className={concatClassNames('anchor', 'before')}
|
|
75
75
|
>
|
|
76
|
-
<LinkIcon
|
|
76
|
+
<LinkIcon color="--heading-anchor-color" />
|
|
77
77
|
</a>
|
|
78
78
|
);
|
|
79
79
|
|
|
@@ -98,6 +98,12 @@ const HeadingContentWrapper = styled.div`
|
|
|
98
98
|
display: flex;
|
|
99
99
|
gap: var(--spacing-xs);
|
|
100
100
|
|
|
101
|
+
& > .anchor {
|
|
102
|
+
display: flex;
|
|
103
|
+
align-items: center;
|
|
104
|
+
height: 1lh;
|
|
105
|
+
}
|
|
106
|
+
|
|
101
107
|
& > span {
|
|
102
108
|
display: flex;
|
|
103
109
|
align-items: flex-start;
|