@redocly/theme 0.65.0-next.1 → 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.
Files changed (43) hide show
  1. package/lib/components/Button/variables.js +3 -3
  2. package/lib/components/CodeBlock/CodeBlockContainer.js +12 -7
  3. package/lib/components/CodeBlock/variables.dark.d.ts +1 -0
  4. package/lib/components/CodeBlock/variables.dark.js +8 -0
  5. package/lib/components/CodeBlock/variables.js +3 -1
  6. package/lib/components/Menu/MenuItem.js +15 -26
  7. package/lib/components/Menu/variables.dark.js +2 -0
  8. package/lib/components/Menu/variables.js +3 -1
  9. package/lib/components/PageNavigation/NavigationButton.js +19 -11
  10. package/lib/components/PageNavigation/PageNavigation.js +6 -0
  11. package/lib/components/PageNavigation/variables.d.ts +1 -0
  12. package/lib/components/PageNavigation/variables.js +27 -0
  13. package/lib/components/Search/variables.js +2 -2
  14. package/lib/core/hooks/use-modal-scroll-lock.js +21 -10
  15. package/lib/core/hooks/use-page-actions.js +43 -24
  16. package/lib/core/styles/dark.js +2 -0
  17. package/lib/core/styles/global.js +9 -5
  18. package/lib/core/styles/palette.dark.js +2 -0
  19. package/lib/core/styles/palette.js +16 -0
  20. package/lib/core/types/catalog.d.ts +1 -1
  21. package/lib/icons/LinkIcon/LinkIcon.js +6 -6
  22. package/lib/markdoc/components/Heading/Heading.js +7 -1
  23. package/package.json +2 -2
  24. package/src/components/Button/variables.ts +3 -3
  25. package/src/components/CodeBlock/CodeBlockContainer.tsx +12 -7
  26. package/src/components/CodeBlock/variables.dark.ts +5 -0
  27. package/src/components/CodeBlock/variables.ts +3 -1
  28. package/src/components/Menu/MenuItem.tsx +15 -26
  29. package/src/components/Menu/variables.dark.ts +2 -0
  30. package/src/components/Menu/variables.ts +3 -1
  31. package/src/components/PageNavigation/NavigationButton.tsx +24 -22
  32. package/src/components/PageNavigation/PageNavigation.tsx +6 -0
  33. package/src/components/PageNavigation/variables.ts +24 -0
  34. package/src/components/Search/variables.ts +2 -2
  35. package/src/core/hooks/use-modal-scroll-lock.ts +30 -14
  36. package/src/core/hooks/use-page-actions.ts +70 -33
  37. package/src/core/styles/dark.ts +2 -0
  38. package/src/core/styles/global.ts +9 -5
  39. package/src/core/styles/palette.dark.ts +2 -0
  40. package/src/core/styles/palette.ts +16 -0
  41. package/src/core/types/catalog.ts +1 -1
  42. package/src/icons/LinkIcon/LinkIcon.tsx +19 -6
  43. package/src/markdoc/components/Heading/Heading.tsx +7 -1
@@ -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: 4px; // @presenter Spacing
485
- --heading-anchor-color: var(--button-content-color-primary); // @presenter Color
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-unit) * 2.5); // @presenter 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: 'api' | 'file';
174
+ readonly source: 'remote' | 'file';
175
175
  domains?: Array<BffCatalogRelatedEntity>;
176
176
  owners?: Array<BffCatalogRelatedEntity>;
177
177
  summary?: string | null;
@@ -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 viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
10
- <path d="M14.625 3.37992C14.3463 3.10024 14.0151 2.87833 13.6505 2.72692C13.2858 2.5755 12.8949 2.49756 12.5 2.49756C12.1052 2.49756 11.7142 2.5755 11.3496 2.72692C10.9849 2.87833 10.6537 3.10024 10.375 3.37992L11.085 4.08992C11.2712 3.90378 11.4922 3.75611 11.7354 3.65537C11.9786 3.55463 12.2393 3.50278 12.5025 3.50278C12.7658 3.50278 13.0264 3.55463 13.2697 3.65537C13.5129 3.75611 13.7339 3.90378 13.92 4.08992C14.1062 4.27607 14.2538 4.49706 14.3546 4.74028C14.4553 4.98349 14.5072 5.24417 14.5072 5.50742C14.5072 5.77068 14.4553 6.03135 14.3546 6.27457C14.2538 6.51778 14.1062 6.73878 13.92 6.92492L9.92002 10.9249C9.54473 11.3009 9.03548 11.5123 8.50428 11.5128C7.97309 11.5133 7.46346 11.3027 7.08752 10.9274C6.71157 10.5521 6.5001 10.0429 6.49964 9.51169C6.49917 8.98049 6.70973 8.47087 7.08502 8.09492L7.79002 7.38492L7.08502 6.67492L6.37502 7.38492C6.09534 7.66363 5.87343 7.99481 5.72201 8.35947C5.57059 8.72412 5.49265 9.11508 5.49265 9.50992C5.49265 9.90477 5.57059 10.2957 5.72201 10.6604C5.87343 11.025 6.09534 11.3562 6.37502 11.6349C6.94076 12.1934 7.70505 12.5045 8.50002 12.4999C8.89637 12.5016 9.28913 12.4246 9.65558 12.2736C10.022 12.1225 10.3549 11.9004 10.635 11.6199L14.635 7.61992C15.1955 7.0561 15.5093 6.29286 15.5074 5.49785C15.5055 4.70285 15.1881 3.9411 14.625 3.37992Z" />
11
- <path d="M2.09502 12.4099C1.90831 12.2241 1.76016 12.0032 1.65907 11.7599C1.55798 11.5167 1.50593 11.2559 1.50593 10.9924C1.50593 10.729 1.55798 10.4682 1.65907 10.2249C1.76016 9.98165 1.90831 9.76076 2.09502 9.57492L6.09502 5.57492C6.28085 5.38822 6.50174 5.24007 6.745 5.13898C6.98826 5.03788 7.24909 4.98584 7.51252 4.98584C7.77594 4.98584 8.03677 5.03788 8.28003 5.13898C8.52329 5.24007 8.74418 5.38822 8.93002 5.57492C9.11554 5.76222 9.26158 5.98486 9.35949 6.22963C9.4574 6.47441 9.50519 6.73634 9.50002 6.99992C9.50154 7.26433 9.45062 7.52641 9.35021 7.771C9.2498 8.0156 9.10188 8.23786 8.91502 8.42492L7.85502 9.49992L8.56501 10.2099L9.62502 9.14992C10.1893 8.58568 10.5063 7.82039 10.5063 7.02242C10.5063 6.22446 10.1893 5.45917 9.62502 4.89492C9.06077 4.33068 8.29548 4.01368 7.49752 4.01368C6.69955 4.01368 5.93426 4.33068 5.37002 4.89492L1.37002 8.89492C1.08958 9.17373 0.867037 9.50522 0.715177 9.87033C0.563316 10.2354 0.485138 10.627 0.485138 11.0224C0.485138 11.4179 0.563316 11.8094 0.715177 12.1745C0.867037 12.5396 1.08958 12.8711 1.37002 13.1499C1.93943 13.7042 2.70546 14.0099 3.50002 13.9999C4.30157 14.0007 5.07087 13.6843 5.64002 13.1199L4.93002 12.4099C4.74418 12.5966 4.52329 12.7448 4.28003 12.8459C4.03677 12.947 3.77594 12.999 3.51252 12.999C3.24909 12.999 2.98826 12.947 2.745 12.8459C2.50174 12.7448 2.28085 12.5966 2.09502 12.4099Z" />
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 || '16px'};
23
- width: ${({ size }) => size || '16px'};
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 size="14px" color="--heading-anchor-color" />
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;