@redocly/theme 0.65.0-next.1 → 0.65.0-next.3

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 (53) hide show
  1. package/lib/components/Banner/Banner.js +10 -2
  2. package/lib/components/Banner/variables.js +8 -1
  3. package/lib/components/Button/variables.js +3 -3
  4. package/lib/components/CodeBlock/CodeBlockContainer.js +12 -7
  5. package/lib/components/CodeBlock/variables.dark.d.ts +1 -0
  6. package/lib/components/CodeBlock/variables.dark.js +8 -0
  7. package/lib/components/CodeBlock/variables.js +3 -1
  8. package/lib/components/Markdown/styles/links.js +2 -1
  9. package/lib/components/Menu/MenuItem.js +15 -26
  10. package/lib/components/Menu/variables.dark.js +2 -0
  11. package/lib/components/Menu/variables.js +3 -1
  12. package/lib/components/PageActions/PageActions.js +1 -0
  13. package/lib/components/PageNavigation/NavigationButton.js +19 -11
  14. package/lib/components/PageNavigation/PageNavigation.js +6 -0
  15. package/lib/components/PageNavigation/variables.d.ts +1 -0
  16. package/lib/components/PageNavigation/variables.js +27 -0
  17. package/lib/components/Search/variables.js +2 -2
  18. package/lib/core/hooks/use-modal-scroll-lock.js +21 -10
  19. package/lib/core/hooks/use-page-actions.js +43 -24
  20. package/lib/core/styles/dark.js +5 -3
  21. package/lib/core/styles/global.js +18 -13
  22. package/lib/core/styles/palette.dark.js +6 -0
  23. package/lib/core/styles/palette.js +39 -0
  24. package/lib/core/types/catalog.d.ts +1 -1
  25. package/lib/icons/LinkIcon/LinkIcon.js +6 -6
  26. package/lib/markdoc/components/Cards/Card.js +1 -0
  27. package/lib/markdoc/components/Heading/Heading.js +7 -1
  28. package/package.json +2 -2
  29. package/src/components/Banner/Banner.tsx +11 -3
  30. package/src/components/Banner/variables.ts +8 -1
  31. package/src/components/Button/variables.ts +3 -3
  32. package/src/components/CodeBlock/CodeBlockContainer.tsx +12 -7
  33. package/src/components/CodeBlock/variables.dark.ts +5 -0
  34. package/src/components/CodeBlock/variables.ts +3 -1
  35. package/src/components/Markdown/styles/links.ts +2 -1
  36. package/src/components/Menu/MenuItem.tsx +15 -26
  37. package/src/components/Menu/variables.dark.ts +2 -0
  38. package/src/components/Menu/variables.ts +3 -1
  39. package/src/components/PageActions/PageActions.tsx +1 -0
  40. package/src/components/PageNavigation/NavigationButton.tsx +24 -22
  41. package/src/components/PageNavigation/PageNavigation.tsx +6 -0
  42. package/src/components/PageNavigation/variables.ts +24 -0
  43. package/src/components/Search/variables.ts +2 -2
  44. package/src/core/hooks/use-modal-scroll-lock.ts +30 -14
  45. package/src/core/hooks/use-page-actions.ts +70 -33
  46. package/src/core/styles/dark.ts +5 -3
  47. package/src/core/styles/global.ts +18 -13
  48. package/src/core/styles/palette.dark.ts +6 -0
  49. package/src/core/styles/palette.ts +39 -0
  50. package/src/core/types/catalog.ts +1 -1
  51. package/src/icons/LinkIcon/LinkIcon.tsx +19 -6
  52. package/src/markdoc/components/Cards/Card.tsx +1 -0
  53. package/src/markdoc/components/Heading/Heading.tsx +7 -1
@@ -46,6 +46,7 @@ const variables_41 = require("../../components/SkipContent/variables");
46
46
  const variables_42 = require("../../components/PageActions/variables");
47
47
  const variables_43 = require("../../components/SvgViewer/variables");
48
48
  const variables_44 = require("../../components/Toast/variables");
49
+ const variables_45 = require("../../components/PageNavigation/variables");
49
50
  const palette_1 = require("./palette");
50
51
  const dark_1 = require("./dark");
51
52
  const themeColors = (0, styled_components_1.css) `
@@ -477,8 +478,8 @@ const headingsTypography = (0, styled_components_1.css) `
477
478
  * @tokens Typography heading anchor icon
478
479
  */
479
480
 
480
- --heading-anchor-offset-right: 4px; // @presenter Spacing
481
- --heading-anchor-color: var(--button-content-color-primary); // @presenter Color
481
+ --heading-anchor-offset-right: var(--spacing-xs); // @presenter Spacing
482
+ --heading-anchor-color: var(--icon-color-primary); // @presenter Color
482
483
  --heading-anchor-icon: none;
483
484
 
484
485
  /**
@@ -566,18 +567,19 @@ const links = (0, styled_components_1.css) `
566
567
  * @tokens Links
567
568
  */
568
569
 
569
- --link-color-primary: var(--color-blue-6); // @presenter Color
570
- --link-decoration: none;
571
- --link-font-weight: var(--font-weight-regular); // @presenter FontWeight
570
+ --link-color-primary: var(--link-color-primary-palette, var(--link-color-primary-legacy)); // @presenter Color
571
+ --link-decoration: underline 1px var(--color-primary-base, var(--link-color-primary-legacy));
572
+ --link-underline-offset: 4px;
573
+ --link-font-weight: var(--font-weight-medium); // @presenter FontWeight
572
574
 
573
- --link-color-primary-hover: var(--color-blue-7); // @presenter Color
574
- --link-color-primary-pressed: var(--color-blue-8);
575
- --link-decoration-hover: underline;
575
+ --link-color-primary-hover: var(--link-color-primary-palette, var(--link-color-primary-hover-legacy)); // @presenter Color
576
+ --link-color-primary-pressed: var(--link-color-primary-palette, var(--link-color-primary-pressed-legacy));
577
+ --link-decoration-hover: underline 2px var(--color-primary-base, var(--link-color-primary-hover-legacy));
576
578
 
577
579
  --link-color-inverse: var(--color-blue-5); // @presenter Color
578
580
 
579
- --link-color-visited: var(--color-purple-7); // @presenter Color
580
- --link-visited-decoration: none;
581
+ --link-color-visited: var(--link-color-primary-palette, var(--link-color-visited-legacy)); // @presenter Color
582
+ --link-decoration-visited: underline 1px var(--color-primary-base, var(--link-color-visited-legacy));
581
583
 
582
584
  // @tokens End
583
585
  `;
@@ -699,9 +701,10 @@ const apiReferenceDocs = (0, styled_components_1.css) `
699
701
  * @tokens API Reference Schema Nested styles
700
702
  */
701
703
 
702
- --schema-nested-offset: calc(var(--spacing-unit) * 2.5); // @presenter Spacing
704
+ --schema-nested-offset: calc(var(--spacing-sm) - 1px); // @presenter Spacing
703
705
  --schema-nested-bg-color: var(--tree-bg-color-active); // @presenter Color
704
-
706
+ --schema-nested-hyperlink-offset: 2px; // @presenter Spacing
707
+
705
708
  /**
706
709
  * @tokens API Reference Schema Required styles
707
710
  */
@@ -733,7 +736,8 @@ const apiReferenceDocs = (0, styled_components_1.css) `
733
736
  * @tokens API Reference Schema Properties
734
737
  */
735
738
 
736
- --schemas-property-name-text-color: var(--text-color-primary); //@presenter Color
739
+ --schemas-property-name-text-color: var(--color-primary-base, var(--text-color-primary)); //@presenter Color
740
+ --schemas-property-name-box-text-color: var(--text-color-primary); // @presenter Color
737
741
  --schemas-property-name-font-size: var(--font-size-base); // @presenter FontSize
738
742
  --schemas-property-name-font-family: var(--code-font-family); // @presenter FontFamily
739
743
  --schemas-property-name-font-weight: var(--font-weight-regular); // @presenter FontWeight
@@ -1319,6 +1323,7 @@ exports.styles = (0, styled_components_1.css) `
1319
1323
  ${variables_42.pageActions}
1320
1324
  ${variables_43.svgViewer}
1321
1325
  ${variables_44.toast}
1326
+ ${variables_45.pageNavigation}
1322
1327
 
1323
1328
  background-color: var(--bg-color);
1324
1329
  color: var(--text-color-primary);
@@ -192,6 +192,12 @@ function brandPaletteDark(palette) {
192
192
 
193
193
  --admonition-default-bg-color-legacy: var(--color-warm-grey-3);
194
194
  --admonition-default-border-color-legacy: var(--color-warm-grey-5);
195
+
196
+ --code-block-highlighted-bg-color-legacy: color-mix(in srgb, var(--color-warm-grey-4) 40%, transparent);
197
+
198
+ --link-color-primary-legacy: var(--color-blue-7);
199
+ --link-color-primary-hover-legacy: var(--color-blue-8);
200
+ --link-color-visited-legacy: var(--color-purple-8);
195
201
  `;
196
202
  }
197
203
  }
@@ -18,6 +18,8 @@ function brandPaletteLight(palette) {
18
18
  --color-brand-10: #555761; // @presenter Color
19
19
  --color-brand-11: #6e6f7a; // @presenter Color
20
20
  --text-color-on-color: #ffffff; // @presenter Color
21
+
22
+ --link-color-primary-palette: var(--text-color-primary); // @presenter Color
21
23
  `;
22
24
  case 'pink':
23
25
  return (0, styled_components_1.css) `
@@ -33,6 +35,8 @@ function brandPaletteLight(palette) {
33
35
  --color-brand-10: #6a3055; // @presenter Color
34
36
  --color-brand-11: #4f2841; // @presenter Color
35
37
  --text-color-on-color: #ffffff; // @presenter Color
38
+
39
+ --link-color-primary-palette: var(--text-color-primary); // @presenter Color
36
40
  `;
37
41
  case 'coral':
38
42
  return (0, styled_components_1.css) `
@@ -48,6 +52,8 @@ function brandPaletteLight(palette) {
48
52
  --color-brand-10: #6d3338; // @presenter Color
49
53
  --color-brand-11: #4f282b; // @presenter Color
50
54
  --text-color-on-color: #ffffff; // @presenter Color
55
+
56
+ --link-color-primary-palette: var(--text-color-primary); // @presenter Color
51
57
  `;
52
58
  case 'amber':
53
59
  return (0, styled_components_1.css) `
@@ -63,6 +69,8 @@ function brandPaletteLight(palette) {
63
69
  --color-brand-10: #71512e; // @presenter Color
64
70
  --color-brand-11: #4f3c28; // @presenter Color
65
71
  --text-color-on-color: #ffffff; // @presenter Color
72
+
73
+ --link-color-primary-palette: var(--text-color-primary); // @presenter Color
66
74
  `;
67
75
  case 'jade':
68
76
  return (0, styled_components_1.css) `
@@ -78,6 +86,8 @@ function brandPaletteLight(palette) {
78
86
  --color-brand-10: #2a6052; // @presenter Color
79
87
  --color-brand-11: #284f45; // @presenter Color
80
88
  --text-color-on-color: #ffffff; // @presenter Color
89
+
90
+ --link-color-primary-palette: var(--text-color-primary); // @presenter Color
81
91
  `;
82
92
  case 'cyan':
83
93
  return (0, styled_components_1.css) `
@@ -93,6 +103,8 @@ function brandPaletteLight(palette) {
93
103
  --color-brand-10: #285c67; // @presenter Color
94
104
  --color-brand-11: #28484f; // @presenter Color
95
105
  --text-color-on-color: #ffffff; // @presenter Color
106
+
107
+ --link-color-primary-palette: var(--text-color-primary); // @presenter Color
96
108
  `;
97
109
  case 'ocean':
98
110
  return (0, styled_components_1.css) `
@@ -108,6 +120,8 @@ function brandPaletteLight(palette) {
108
120
  --color-brand-10: #2d5472; // @presenter Color
109
121
  --color-brand-11: #283e4f; // @presenter Color
110
122
  --text-color-on-color: #ffffff; // @presenter Color
123
+
124
+ --link-color-primary-palette: var(--text-color-primary); // @presenter Color
111
125
  `;
112
126
  case 'indigo':
113
127
  return (0, styled_components_1.css) `
@@ -123,6 +137,8 @@ function brandPaletteLight(palette) {
123
137
  --color-brand-10: #303e6b; // @presenter Color
124
138
  --color-brand-11: #28314f; // @presenter Color
125
139
  --text-color-on-color: #ffffff; // @presenter Color
140
+
141
+ --link-color-primary-palette: var(--text-color-primary); // @presenter Color
126
142
  `;
127
143
  case 'iris':
128
144
  return (0, styled_components_1.css) `
@@ -138,6 +154,8 @@ function brandPaletteLight(palette) {
138
154
  --color-brand-10: #3a3a6a; // @presenter Color
139
155
  --color-brand-11: #2e2e4f; // @presenter Color
140
156
  --text-color-on-color: #ffffff; // @presenter Color
157
+
158
+ --link-color-primary-palette: var(--text-color-primary); // @presenter Color
141
159
  `;
142
160
  default:
143
161
  return (0, styled_components_1.css) `
@@ -163,6 +181,27 @@ function brandPaletteLight(palette) {
163
181
 
164
182
  --menu-item-bg-color-active-legacy: var(--tree-bg-color-active); // @presenter Color
165
183
  --menu-item-color-active-legacy: var(--tree-content-color-default); // @presenter Color
184
+ --menu-item-color-active-hover-legacy: var(--tree-content-color-hover); // @presenter Color
185
+ --menu-item-bg-color-active-hover-legacy: var(--color-hover-base); // @presenter Color
186
+
187
+ --code-block-highlighted-bg-color-legacy: var(--layer-color-hover); // @presenter Color
188
+ --code-block-tokens-string-color-legacy: var(--color-blue-7); // @presenter Color
189
+
190
+ --security-header-color-legacy: var(--link-color-primary); // @presenter Color
191
+
192
+ --schema-name-color-legacy: var(--text-color-primary); // @presenter Color
193
+
194
+ --search-ai-conversation-input-border-color-focus-legacy: var(--color-blue-6); // @presenter Color
195
+ --search-ai-user-bg-color-legacy: var(--color-blue-6); // @presenter Color
196
+
197
+ --button-content-color-link-legacy: var(--link-color-primary); // @presenter Color
198
+ --button-content-color-link-hover-legacy: var(--link-color-primary-hover); // @presenter Color
199
+ --button-content-color-link-pressed-legacy: var(--link-color-primary-pressed); // @presenter Color
200
+
201
+ --link-color-primary-legacy: var(--color-blue-6); // @presenter Color
202
+ --link-color-primary-hover-legacy: var(--color-blue-7); // @presenter Color
203
+ --link-color-primary-pressed-legacy: var(--color-blue-8); // @presenter Color
204
+ --link-color-visited-legacy: var(--color-purple-7); // @presenter Color
166
205
  `;
167
206
  }
168
207
  }
@@ -143,7 +143,7 @@ export type BffCatalogEntity = {
143
143
  key: string;
144
144
  type: string;
145
145
  title: string;
146
- readonly source: 'api' | 'file';
146
+ readonly source: 'remote' | 'file';
147
147
  domains?: Array<BffCatalogRelatedEntity>;
148
148
  owners?: Array<BffCatalogRelatedEntity>;
149
149
  summary?: string | null;
@@ -7,17 +7,17 @@ exports.LinkIcon = void 0;
7
7
  const react_1 = __importDefault(require("react"));
8
8
  const styled_components_1 = __importDefault(require("styled-components"));
9
9
  const utils_1 = require("../../core/utils");
10
- const Icon = (props) => (react_1.default.createElement("svg", Object.assign({ viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
11
- react_1.default.createElement("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" }),
12
- react_1.default.createElement("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" })));
10
+ const Icon = (props) => (react_1.default.createElement("svg", Object.assign({ width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
11
+ react_1.default.createElement("path", { 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", fill: "var(--layer-color)" }),
12
+ react_1.default.createElement("path", { 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", fill: "var(--icon-color-primary)" })));
13
13
  exports.LinkIcon = (0, styled_components_1.default)(Icon).attrs(() => ({
14
14
  'data-component-name': 'icons/LinkIcon/LinkIcon',
15
15
  })) `
16
- path {
16
+ path:last-of-type {
17
17
  fill: ${({ color }) => (0, utils_1.getCssColorVariable)(color)};
18
18
  }
19
19
 
20
- height: ${({ size }) => size || '16px'};
21
- width: ${({ size }) => size || '16px'};
20
+ height: ${({ size }) => size || '20px'};
21
+ width: ${({ size }) => size || '20px'};
22
22
  `;
23
23
  //# sourceMappingURL=LinkIcon.js.map
@@ -98,6 +98,7 @@ const CardWrapper = styled_components_1.default.div.attrs(({ $isCardLink, $varia
98
98
  text-decoration: none;
99
99
  --md-paragraph-margin: 0;
100
100
  --link-decoration-hover: none;
101
+ --link-decoration: none;
101
102
 
102
103
  background-color: var(--card-bg-color);
103
104
  border-width: var(--card-border-width);
@@ -76,7 +76,7 @@ function Heading({ level, id, children, 'data-source': dataSource, 'data-hash':
76
76
  const pageProps = usePageProps();
77
77
  const isMarkdownPage = ((_a = pageProps === null || pageProps === void 0 ? void 0 : pageProps.metadata) === null || _a === void 0 ? void 0 : _a.type) === 'markdown' || ((_b = pageProps === null || pageProps === void 0 ? void 0 : pageProps.metadata) === null || _b === void 0 ? void 0 : _b.type) === 'asciidoc';
78
78
  const linkEl = (react_1.default.createElement("a", { "aria-label": `link to ${id}`, href: `#${id}`, className: (0, utils_1.concatClassNames)('anchor', 'before') },
79
- react_1.default.createElement(LinkIcon_1.LinkIcon, { size: "14px", color: "--heading-anchor-color" })));
79
+ react_1.default.createElement(LinkIcon_1.LinkIcon, { color: "--heading-anchor-color" })));
80
80
  return (0, react_1.createElement)(`h${level}`, {
81
81
  id,
82
82
  className: (0, utils_1.concatClassNames)('heading-anchor', mdClassName, className),
@@ -92,6 +92,12 @@ const HeadingContentWrapper = styled_components_1.default.div `
92
92
  display: flex;
93
93
  gap: var(--spacing-xs);
94
94
 
95
+ & > .anchor {
96
+ display: flex;
97
+ align-items: center;
98
+ height: 1lh;
99
+ }
100
+
95
101
  & > span {
96
102
  display: flex;
97
103
  align-items: flex-start;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/theme",
3
- "version": "0.65.0-next.1",
3
+ "version": "0.65.0-next.3",
4
4
  "description": "Shared UI components lib",
5
5
  "keywords": [
6
6
  "theme",
@@ -63,7 +63,7 @@
63
63
  "vitest": "4.0.10",
64
64
  "vitest-when": "0.6.2",
65
65
  "webpack": "5.105.2",
66
- "@redocly/realm-asyncapi-sdk": "0.11.0-next.1"
66
+ "@redocly/realm-asyncapi-sdk": "0.11.0-next.2"
67
67
  },
68
68
  "dependencies": {
69
69
  "@tanstack/react-query": "5.62.3",
@@ -138,7 +138,7 @@ export function Banner({ className }: BannerProps): JSX.Element | null {
138
138
  $color={displayBanner.color}
139
139
  $isVisible={isVisible}
140
140
  >
141
- <BannerContent>
141
+ <BannerContent $color={displayBanner.color}>
142
142
  <MarkdownLinkContext.Provider value={markdownLinkContextValue}>
143
143
  <Markdown compact>{markdownContent}</Markdown>
144
144
  </MarkdownLinkContext.Provider>
@@ -159,7 +159,7 @@ export function Banner({ className }: BannerProps): JSX.Element | null {
159
159
  );
160
160
  }
161
161
 
162
- const BannerContent = styled.div`
162
+ const BannerContent = styled.div<{ $color: DisplayBanner['color'] }>`
163
163
  flex: 1;
164
164
  display: flex;
165
165
  align-items: center;
@@ -172,7 +172,15 @@ const BannerContent = styled.div`
172
172
 
173
173
  a:not([role='button']) {
174
174
  color: var(--banner-link-color);
175
- text-decoration: var(--banner-link-decoration);
175
+ text-decoration: ${({ $color }) => $color && `var(--banner-${$color}-link-decoration)`};
176
+
177
+ &:hover, &:focus {
178
+ text-decoration: ${({ $color }) => $color && `var(--banner-${$color}-link-decoration-hover)`};
179
+ }
180
+
181
+ &:visited {
182
+ text-decoration: ${({ $color }) => $color && `var(--banner-${$color}-link-decoration)`};
183
+ }
176
184
  }
177
185
 
178
186
  [data-component-name='Button/Button'] {
@@ -17,7 +17,6 @@ export const banner = css`
17
17
  --banner-button-icon-right-padding: 1px 10px 1px var(--spacing-sm); // @presenter Spacing
18
18
  --banner-button-margin: 0 var(--spacing-xs); // @presenter Spacing
19
19
  --banner-padding: var(--spacing-xs); // @presenter Spacing
20
- --banner-link-decoration: var(--link-decoration-hover);
21
20
  --banner-min-height: 38px;
22
21
  --banner-gap: var(--spacing-xxs); // @presenter Spacing
23
22
 
@@ -25,20 +24,28 @@ export const banner = css`
25
24
  --banner-info-text-color: var(--color-static-white); // @presenter Color
26
25
  --banner-info-icon-color: var(--color-static-white); // @presenter Color
27
26
  --banner-info-link-color: var(--banner-info-text-color); // @presenter Color
27
+ --banner-info-link-decoration: underline 1px var(--banner-info-link-color);
28
+ --banner-info-link-decoration-hover: underline 2px var(--banner-info-link-color);
28
29
 
29
30
  --banner-success-bg-color: var(--color-success-base); // @presenter Color
30
31
  --banner-success-text-color: var(--color-static-white); // @presenter Color
31
32
  --banner-success-icon-color: var(--color-static-white); // @presenter Color
32
33
  --banner-success-link-color: var(--banner-success-text-color); // @presenter Color
34
+ --banner-success-link-decoration: underline 1px var(--banner-success-link-color);
35
+ --banner-success-link-decoration-hover: underline 2px var(--banner-success-link-color);
33
36
 
34
37
  --banner-warning-bg-color: var(--color-warning-base); // @presenter Color
35
38
  --banner-warning-text-color: var(--color-black); // @presenter Color
36
39
  --banner-warning-icon-color: var(--color-black); // @presenter Color
37
40
  --banner-warning-link-color: var(--banner-warning-text-color); // @presenter Color
41
+ --banner-warning-link-decoration: underline 1px var(--banner-warning-link-color);
42
+ --banner-warning-link-decoration-hover: underline 2px var(--banner-warning-link-color);
38
43
 
39
44
  --banner-error-bg-color: var(--color-error-base); // @presenter Color
40
45
  --banner-error-text-color: var(--color-static-white); // @presenter Color
41
46
  --banner-error-icon-color: var(--color-static-white); // @presenter Color
42
47
  --banner-error-link-color: var(--banner-error-text-color); // @presenter Color
48
+ --banner-error-link-decoration: underline 1px var(--banner-error-link-color);
49
+ --banner-error-link-decoration-hover: underline 2px var(--banner-error-link-color);
43
50
  `;
44
51
 
@@ -47,9 +47,9 @@ export const button = css`
47
47
  --button-content-color-custom-hover: var(--color-warm-grey-11); // @presenter Color
48
48
  --button-bg-color-custom: var(--color-white); // @presenter Color
49
49
 
50
- --button-content-color-link: var(--link-color-primary);
51
- --button-content-color-link-hover: var(--link-color-primary-hover);
52
- --button-content-color-link-pressed: var(--link-color-primary-pressed);
50
+ --button-content-color-link: var(--color-primary-base, var(--button-content-color-link-legacy));
51
+ --button-content-color-link-hover: var(--color-primary-active, var(--button-content-color-link-hover-legacy));
52
+ --button-content-color-link-pressed: var(--color-primary-base, var(--button-content-color-link-pressed-legacy));
53
53
 
54
54
  /**
55
55
  * @tokens Button default values
@@ -47,18 +47,21 @@ const CodeBlockContainerComponent = styled.pre<CodeBlockContainerProps>`
47
47
  }
48
48
 
49
49
  .highlighted {
50
- background: var(--layer-color-hover);
50
+ background: var(--code-block-highlighted-bg-color);
51
51
  margin-left: calc(var(--spacing-sm) * -1);
52
52
  padding-left: var(--spacing-sm);
53
53
  width: calc(100% + var(--spacing-sm));
54
54
  display: inline-block;
55
+ border-left: var(--code-block-highlighted-border-left);
55
56
 
56
57
  &.error {
57
- background: var(--color-raspberry-2);
58
+ background: var(--color-error-bg);
59
+ border-left: 1px solid var(--color-error-base);
58
60
  }
59
61
 
60
62
  &.warning {
61
- background: var(--color-carrot-2);
63
+ background: var(--color-warning-bg);
64
+ border-left: 1px solid var(--color-warning-base);
62
65
  }
63
66
  }
64
67
 
@@ -97,18 +100,20 @@ const CodeBlockContainerComponent = styled.pre<CodeBlockContainerProps>`
97
100
  display: inline-block;
98
101
 
99
102
  &.add {
100
- background: var(--color-grass-2);
103
+ background: var(--color-success-bg);
104
+ border-left: 1px solid var(--color-success-base);
101
105
  &:before {
102
106
  content: attr(data-line-number) ' +';
103
- color: var(--color-grass-7);
107
+ color: var(--color-success-active);
104
108
  }
105
109
  }
106
110
  &.remove {
107
- background: var(--color-raspberry-2);
111
+ background: var(--color-error-bg);
112
+ border-left: 1px solid var(--color-error-base);
108
113
 
109
114
  &:before {
110
115
  content: attr(data-line-number) ' -';
111
- color: var(--color-raspberry-7);
116
+ color: var(--color-error-active);
112
117
  }
113
118
  }
114
119
  }
@@ -0,0 +1,5 @@
1
+ import { css } from 'styled-components';
2
+
3
+ export const codeBlockDarkMode = css`
4
+ --code-block-highlighted-bg-color: var(--color-brand-subtle-2, var(--code-block-highlighted-bg-color-legacy)); // @presenter Color
5
+ `;
@@ -60,6 +60,8 @@ export const code = css`
60
60
  --code-block-margin: 0;
61
61
  --code-block-max-height: calc(100vh - 300px); // Where 300 is combined value of navbar, code block heading, controls height and paddings
62
62
  --code-block-word-break: initial;
63
+ --code-block-highlighted-border-left: 1px solid var(--color-primary-base, var(--color-warm-grey-11)); // @presenter Color
64
+ --code-block-highlighted-bg-color: var(--color-primary-bg, var(--code-block-highlighted-bg-color-legacy)); // @presenter Color
63
65
 
64
66
  /**
65
67
  * @tokens Code Block controls
@@ -91,7 +93,7 @@ export const code = css`
91
93
  --code-block-tokens-constant-color: var(--code-block-tokens-default-color); // @presenter Color
92
94
  --code-block-tokens-symbol-color: var(--code-block-tokens-default-color); // @presenter Color
93
95
  --code-block-tokens-boolean-color: var(--color-green-7); // @presenter Color
94
- --code-block-tokens-string-color: var(--color-blue-7); // @presenter Color
96
+ --code-block-tokens-string-color: var(--color-primary-active, var(--code-block-tokens-string-color-legacy)); // @presenter Color
95
97
  --code-block-tokens-property-string-color: var(--color-blue-7); // @presenter Color
96
98
  --code-block-tokens-selector-color: var(--code-block-tokens-string-color); // @presenter Color
97
99
  --code-block-tokens-attr-name-color: var(--code-block-tokens-string-color); // @presenter Color
@@ -3,12 +3,13 @@ import { css } from 'styled-components';
3
3
  export const markdownLinksCss = css`
4
4
  a:not([role='button']) {
5
5
  text-decoration: var(--link-decoration);
6
+ text-underline-offset: var(--link-underline-offset);
6
7
  color: var(--link-color-primary);
7
8
  font-weight: var(--link-font-weight);
8
9
 
9
10
  &:visited {
10
11
  color: var(--link-color-visited);
11
- text-decoration: var(--link-visited-decoration);
12
+ text-decoration: var(--link-decoration-visited);
12
13
  }
13
14
 
14
15
  &:hover,
@@ -256,7 +256,7 @@ const MenuItemNestedWrapper = styled.div<{
256
256
  (var(--menu-item-label-chevron-size) / 2 - 1px) +
257
257
  var(--menu-item-nested-offset) * ${depth})
258
258
  `};
259
- border: 0.5px solid var(--border-color-primary);
259
+ border: 0.5px solid var(--menu-item-border-color-hover);
260
260
  }
261
261
  `;
262
262
 
@@ -286,6 +286,18 @@ const MenuItemLabelWrapper = styled.li<{
286
286
  ${depth ? 'var(--menu-item-nested-offset) * ' + depth : '0px'}
287
287
  )`};
288
288
 
289
+ &:hover {
290
+ color: var(--menu-item-color-hover);
291
+ background: var(--menu-item-bg-color-hover);
292
+
293
+ ${ChevronDownIcon} path {
294
+ fill: var(--menu-item-color-hover);
295
+ }
296
+ ${ChevronRightIcon} path {
297
+ fill: var(--menu-item-color-hover);
298
+ }
299
+ }
300
+
289
301
  ${({ active, deprecated }) =>
290
302
  active &&
291
303
  css`
@@ -301,7 +313,8 @@ const MenuItemLabelWrapper = styled.li<{
301
313
  }
302
314
 
303
315
  &:hover {
304
- background: var(--menu-item-bg-color-active);
316
+ color: var(--menu-item-color-active-hover);
317
+ background: var(--menu-item-bg-color-active-hover);
305
318
  }
306
319
  `};
307
320
 
@@ -315,30 +328,6 @@ const MenuItemLabelWrapper = styled.li<{
315
328
  }
316
329
  `};
317
330
 
318
- &:hover {
319
- color: var(--menu-item-color-hover);
320
- background: var(--menu-item-bg-color-hover);
321
-
322
- ${ChevronDownIcon} path {
323
- fill: var(--menu-item-color-hover);
324
- }
325
- ${ChevronRightIcon} path {
326
- fill: var(--menu-item-color-hover);
327
- }
328
- }
329
-
330
- &:active {
331
- color: var(--menu-item-color-active);
332
- background: var(--menu-item-bg-color-active);
333
-
334
- ${ChevronDownIcon} path {
335
- fill: var(--menu-item-color-active);
336
- }
337
- ${ChevronRightIcon} path {
338
- fill: var(--menu-item-color-active);
339
- }
340
- }
341
-
342
331
  &:empty {
343
332
  padding: 0;
344
333
  }
@@ -7,4 +7,6 @@ export const menuDarkMode = css`
7
7
  --menu-content-color-disabled: var(--text-color-disabled); // @presenter Color
8
8
 
9
9
  --menu-item-bg-color-active: var(--color-primary-bg, var(--menu-item-bg-color-active-legacy)); // @presenter Color
10
+
11
+ --menu-item-border-color-hover: color-mix(in srgb, var(--color-black) 8%, transparent); // @presenter Color
10
12
  `;
@@ -33,7 +33,9 @@ export const menu = css`
33
33
 
34
34
  --menu-item-color-hover: var(--tree-content-color-hover); // @presenter Color
35
35
  --menu-item-color-active: var(--color-primary-text, var(--menu-item-color-active-legacy)); // @presenter Color
36
-
36
+ --menu-item-color-active-hover: var(--color-primary-text, var(--menu-item-color-active-hover-legacy)); // @presenter Color
37
+ --menu-item-bg-color-active-hover: var(--color-primary-bg, var(--menu-item-bg-color-active-hover-legacy)); // @presenter Color
38
+ --menu-item-border-color-hover: color-mix(in srgb, var(--color-warm-grey-11) 6%, transparent); // @presenter Color
37
39
  /**
38
40
  * @tokens Menu item spacing
39
41
  * @presenter Spacing
@@ -120,6 +120,7 @@ const PageActionsWrapper = styled.div`
120
120
 
121
121
  const LinkMenuItem = styled(Link)`
122
122
  text-decoration: none;
123
+ --link-decoration: none;
123
124
  --link-decoration-hover: none;
124
125
  `;
125
126
 
@@ -4,8 +4,8 @@ import styled from 'styled-components';
4
4
  import type { JSX } from 'react';
5
5
 
6
6
  import { ArrowRightIcon } from '@redocly/theme/icons/ArrowRightIcon/ArrowRightIcon';
7
- import { Button } from '@redocly/theme/components/Button/Button';
8
7
  import { ArrowLeftIcon } from '@redocly/theme/icons/ArrowLeftIcon/ArrowLeftIcon';
8
+ import { Button } from '@redocly/theme/components/Button/Button';
9
9
 
10
10
  type NavigationButtonPosition = 'left' | 'right';
11
11
 
@@ -34,35 +34,37 @@ export function NavigationButton({
34
34
  data-translation-key={translationKey}
35
35
  position={position}
36
36
  >
37
- <NavigationButtonLabel>{text}</NavigationButtonLabel>
38
- <StyledNavigationButton
39
- size="large"
40
- to={link}
41
- extraClass={className}
42
- variant="link"
43
- icon={icon}
44
- iconPosition={position}
45
- >
46
- {label}
47
- </StyledNavigationButton>
37
+ <PageNavigationTitle>{label}</PageNavigationTitle>
38
+ <Button to={link} extraClass={className} variant="link" icon={icon} iconPosition={position}>
39
+ {text}
40
+ </Button>
48
41
  </NavigationButtonWrapper>
49
42
  );
50
43
  }
51
44
 
52
- const NavigationButtonWrapper = styled.div<{ position: NavigationButtonPosition }>`
45
+ const NavigationButtonWrapper = styled.div<{
46
+ position: NavigationButtonPosition;
47
+ }>`
53
48
  display: flex;
54
49
  flex-direction: column;
50
+ width: var(--page-navigation-button-width);
55
51
  text-align: ${({ position }) => position};
56
- `;
52
+ padding: var(--page-navigation-button-padding);
53
+ gap: var(--page-navigation-button-gap);
54
+ border: var(--page-navigation-button-border);
55
+ border-radius: var(--page-navigation-button-border-radius);
56
+ min-width: var(--page-navigation-button-min-width);
57
57
 
58
- const StyledNavigationButton = styled(Button)`
59
- text-wrap: wrap;
60
- padding-left: 0;
61
- padding-right: 0;
58
+ &:hover {
59
+ border: var(--page-navigation-button-border-hover);
60
+ }
62
61
  `;
63
62
 
64
- const NavigationButtonLabel = styled.span`
65
- font-size: var(--font-size-sm);
66
- line-height: var(--line-height-sm);
67
- font-weight: var(--font-weight-regular);
63
+ const PageNavigationTitle = styled.p`
64
+ font-size: var(--page-navigation-button-title-font-size);
65
+ font-weight: var(--page-navigation-button-title-font-weight);
66
+ line-height: var(--page-navigation-button-title-line-height);
67
+ color: var(--page-navigation-button-title-color);
68
+ text-wrap: wrap;
69
+ margin: 0;
68
70
  `;