@redocly/theme 0.67.0-next.0 → 0.67.0-next.1

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 (201) hide show
  1. package/lib/components/Admonition/Admonition.js +9 -9
  2. package/lib/components/Badge/Badge.d.ts +1 -1
  3. package/lib/components/Badge/Badge.js +4 -4
  4. package/lib/components/Button/Button.d.ts +1 -1
  5. package/lib/components/Button/Button.js +16 -17
  6. package/lib/components/Buttons/AIAssistantButton.js +2 -0
  7. package/lib/components/Catalog/CatalogActionsRow.js +3 -1
  8. package/lib/components/Catalog/CatalogAvatar.d.ts +3 -1
  9. package/lib/components/Catalog/CatalogAvatar.js +3 -3
  10. package/lib/components/Catalog/CatalogCardView/CatalogCard.js +4 -4
  11. package/lib/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsNodeContent.js +7 -7
  12. package/lib/components/Catalog/CatalogEntity/CatalogEntityInfoBar.js +6 -6
  13. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.js +2 -2
  14. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations.js +4 -6
  15. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.js +3 -5
  16. package/lib/components/Catalog/CatalogEntityTypeIcon.js +15 -11
  17. package/lib/components/Catalog/CatalogEntityTypeTag.js +5 -5
  18. package/lib/components/Catalog/CatalogTableView/CatalogTableView.js +5 -3
  19. package/lib/components/CatalogClassic/CatalogClassic.d.ts +4 -2
  20. package/lib/components/CatalogClassic/CatalogClassic.js +3 -1
  21. package/lib/components/CodeBlock/CodeBlockContainer.js +16 -4
  22. package/lib/components/CodeBlock/CodeBlockControls.d.ts +2 -1
  23. package/lib/components/CodeBlock/CodeBlockControls.js +9 -7
  24. package/lib/components/CodeBlock/CodeBlockTabs.js +2 -2
  25. package/lib/components/Dropdown/Dropdown.js +6 -6
  26. package/lib/components/Dropdown/DropdownMenuItem.d.ts +1 -1
  27. package/lib/components/Feedback/Comment.js +3 -3
  28. package/lib/components/Feedback/Mood.js +3 -3
  29. package/lib/components/Filter/FilterContent.js +2 -2
  30. package/lib/components/Footer/Footer.js +2 -2
  31. package/lib/components/Footer/FooterColumn.js +2 -2
  32. package/lib/components/Footer/FooterItem.js +5 -5
  33. package/lib/components/Image/Image.js +2 -2
  34. package/lib/components/LastUpdated/LastUpdated.js +2 -2
  35. package/lib/components/Link/Link.d.ts +2 -19
  36. package/lib/components/Link/Link.js +2 -9
  37. package/lib/components/Loaders/Loading.js +2 -2
  38. package/lib/components/Loaders/SpinnerLoader.js +4 -4
  39. package/lib/components/Markdown/Markdown.d.ts +7 -10
  40. package/lib/components/Markdown/Markdown.js +6 -3
  41. package/lib/components/Marker/Marker.js +3 -3
  42. package/lib/components/Menu/MenuContainer.d.ts +2 -2
  43. package/lib/components/Menu/MenuContainer.js +9 -11
  44. package/lib/components/Menu/MenuItem.js +14 -14
  45. package/lib/components/Menu/MenuMobile.js +8 -8
  46. package/lib/components/Navbar/NavbarItem.js +7 -7
  47. package/lib/components/PageNavigation/NavigationButton.js +3 -3
  48. package/lib/components/Panel/PanelBody.d.ts +5 -5
  49. package/lib/components/Panel/PanelBody.js +6 -3
  50. package/lib/components/Panel/PanelHeader.d.ts +2 -5
  51. package/lib/components/Panel/PanelHeader.js +6 -2
  52. package/lib/components/Search/SearchAiMessage.js +10 -8
  53. package/lib/components/Search/SearchDialog.js +6 -0
  54. package/lib/components/Search/SearchSuggestedPages.js +2 -2
  55. package/lib/components/Select/Select.js +3 -1
  56. package/lib/components/Select/SelectInput.d.ts +1 -0
  57. package/lib/components/Select/SelectInput.js +8 -8
  58. package/lib/components/Sidebar/Sidebar.d.ts +4 -2
  59. package/lib/components/Sidebar/Sidebar.js +10 -8
  60. package/lib/components/SidebarActions/styled.d.ts +6 -6
  61. package/lib/components/SidebarActions/styled.js +12 -4
  62. package/lib/components/StatusCode/StatusCode.d.ts +6 -4
  63. package/lib/components/StatusCode/StatusCode.js +8 -2
  64. package/lib/components/Switch/Switch.js +13 -13
  65. package/lib/components/TableOfContent/TableOfContent.js +2 -2
  66. package/lib/components/Tag/Tag.js +11 -11
  67. package/lib/components/Tooltip/AnchorTooltip.js +26 -25
  68. package/lib/components/Tooltip/JsTooltip.js +5 -5
  69. package/lib/components/Typography/CompactTypography.d.ts +27 -11
  70. package/lib/components/Typography/CompactTypography.js +2 -2
  71. package/lib/components/Typography/Typography.d.ts +6 -2
  72. package/lib/components/Typography/Typography.js +18 -3
  73. package/lib/components/UserMenu/UserAvatar.js +5 -5
  74. package/lib/core/contexts/ThemeDataContext.d.ts +1 -1
  75. package/lib/core/hooks/feedback/use-report-dialog.d.ts +8 -5
  76. package/lib/core/styles/global.js +1 -0
  77. package/lib/core/templates/Markdown.js +5 -6
  78. package/lib/core/types/index.d.ts +1 -0
  79. package/lib/core/types/link.d.ts +19 -0
  80. package/lib/core/types/link.js +3 -0
  81. package/lib/core/utils/details.d.ts +1 -1
  82. package/lib/core/utils/details.js +3 -0
  83. package/lib/core/utils/dom.d.ts +0 -1
  84. package/lib/core/utils/dom.js +0 -9
  85. package/lib/core/utils/index.d.ts +0 -1
  86. package/lib/core/utils/index.js +0 -1
  87. package/lib/icons/AiStarsGradientIcon/AiStarsGradientIcon.d.ts +1 -1
  88. package/lib/icons/AiStarsGradientIcon/AiStarsGradientIcon.js +6 -1
  89. package/lib/icons/AiStarsIcon/AiStarsIcon.d.ts +1 -1
  90. package/lib/icons/AiStarsIcon/AiStarsIcon.js +6 -1
  91. package/lib/icons/MagicWandIcon/MagicWandIcon.d.ts +23 -0
  92. package/lib/icons/MagicWandIcon/MagicWandIcon.js +25 -0
  93. package/lib/icons/ReturnKeyIcon/ReturnKeyIcon.d.ts +25 -5
  94. package/lib/index.d.ts +1 -0
  95. package/lib/index.js +1 -0
  96. package/lib/layouts/DocumentationLayout.js +2 -2
  97. package/lib/layouts/ThreePanelLayout.d.ts +27 -7
  98. package/lib/layouts/ThreePanelLayout.js +11 -8
  99. package/lib/markdoc/components/CodeWalkthrough/CodeContainer.js +2 -2
  100. package/lib/markdoc/components/CodeWalkthrough/CodePanelHeader.js +2 -2
  101. package/lib/markdoc/components/CodeWalkthrough/CodePanelPreview.js +2 -2
  102. package/lib/markdoc/components/CodeWalkthrough/CodeStep.d.ts +4 -2
  103. package/lib/markdoc/components/CodeWalkthrough/CodeStep.js +6 -2
  104. package/lib/markdoc/components/Image/Image.js +3 -3
  105. package/lib/markdoc/components/Tabs/TabItemFragment.d.ts +9 -0
  106. package/lib/markdoc/components/Tabs/TabItemFragment.js +11 -0
  107. package/lib/markdoc/components/Tabs/TabList.d.ts +7 -4
  108. package/lib/markdoc/components/Tabs/TabList.js +6 -4
  109. package/lib/markdoc/components/Tabs/Tabs.d.ts +3 -9
  110. package/lib/markdoc/components/Tabs/Tabs.js +12 -5
  111. package/lib/markdoc/components/default.d.ts +1 -0
  112. package/lib/markdoc/components/default.js +1 -0
  113. package/lib/markdoc/tags/tab.js +1 -1
  114. package/lib/markdoc/tags/tabs.js +1 -1
  115. package/package.json +1 -2
  116. package/src/components/Admonition/Admonition.tsx +11 -11
  117. package/src/components/Badge/Badge.tsx +11 -6
  118. package/src/components/Button/Button.tsx +51 -21
  119. package/src/components/Buttons/AIAssistantButton.tsx +2 -0
  120. package/src/components/Catalog/CatalogActionsRow.tsx +3 -1
  121. package/src/components/Catalog/CatalogAvatar.tsx +6 -10
  122. package/src/components/Catalog/CatalogCardView/CatalogCard.tsx +6 -6
  123. package/src/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsNodeContent.tsx +14 -14
  124. package/src/components/Catalog/CatalogEntity/CatalogEntityInfoBar.tsx +11 -11
  125. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.tsx +4 -4
  126. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations.tsx +8 -11
  127. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.tsx +10 -9
  128. package/src/components/Catalog/CatalogEntityTypeIcon.tsx +22 -16
  129. package/src/components/Catalog/CatalogEntityTypeTag.tsx +8 -8
  130. package/src/components/Catalog/CatalogTableView/CatalogTableView.tsx +8 -6
  131. package/src/components/CatalogClassic/CatalogClassic.tsx +3 -1
  132. package/src/components/CodeBlock/CodeBlockContainer.tsx +23 -7
  133. package/src/components/CodeBlock/CodeBlockControls.tsx +16 -10
  134. package/src/components/CodeBlock/CodeBlockTabs.tsx +4 -4
  135. package/src/components/Dropdown/Dropdown.tsx +9 -9
  136. package/src/components/Dropdown/DropdownMenuItem.tsx +1 -1
  137. package/src/components/Feedback/Comment.tsx +5 -5
  138. package/src/components/Feedback/Mood.tsx +5 -5
  139. package/src/components/Filter/FilterContent.tsx +4 -4
  140. package/src/components/Filter/FilterPopover.tsx +1 -1
  141. package/src/components/Footer/Footer.tsx +4 -4
  142. package/src/components/Footer/FooterColumn.tsx +3 -3
  143. package/src/components/Footer/FooterItem.tsx +9 -9
  144. package/src/components/Image/Image.tsx +3 -3
  145. package/src/components/LastUpdated/LastUpdated.tsx +4 -4
  146. package/src/components/Link/Link.tsx +6 -51
  147. package/src/components/Loaders/Loading.tsx +3 -3
  148. package/src/components/Loaders/SpinnerLoader.tsx +5 -5
  149. package/src/components/Markdown/Markdown.tsx +7 -7
  150. package/src/components/Marker/Marker.tsx +4 -4
  151. package/src/components/Menu/MenuContainer.tsx +32 -16
  152. package/src/components/Menu/MenuItem.tsx +34 -29
  153. package/src/components/Menu/MenuMobile.tsx +12 -12
  154. package/src/components/Navbar/NavbarItem.tsx +13 -13
  155. package/src/components/PageNavigation/NavigationButton.tsx +4 -4
  156. package/src/components/Panel/PanelBody.tsx +7 -4
  157. package/src/components/Panel/PanelHeader.tsx +9 -4
  158. package/src/components/Search/SearchAiMessage.tsx +17 -15
  159. package/src/components/Search/SearchDialog.tsx +6 -0
  160. package/src/components/Search/SearchSuggestedPages.tsx +20 -5
  161. package/src/components/Select/Select.tsx +3 -1
  162. package/src/components/Select/SelectInput.tsx +10 -9
  163. package/src/components/Sidebar/Sidebar.tsx +15 -13
  164. package/src/components/SidebarActions/styled.ts +12 -4
  165. package/src/components/StatusCode/StatusCode.tsx +12 -4
  166. package/src/components/Switch/Switch.tsx +21 -21
  167. package/src/components/TableOfContent/TableOfContent.tsx +3 -3
  168. package/src/components/Tag/Tag.tsx +34 -27
  169. package/src/components/Tooltip/AnchorTooltip.tsx +50 -42
  170. package/src/components/Tooltip/JsTooltip.tsx +14 -13
  171. package/src/components/Typography/CompactTypography.tsx +4 -4
  172. package/src/components/Typography/Typography.tsx +21 -5
  173. package/src/components/UserMenu/UserAvatar.tsx +7 -7
  174. package/src/core/contexts/ThemeDataContext.tsx +1 -1
  175. package/src/core/hooks/feedback/use-report-dialog.ts +1 -5
  176. package/src/core/styles/dark.ts +1 -1
  177. package/src/core/styles/global.ts +1 -0
  178. package/src/core/templates/Markdown.tsx +6 -7
  179. package/src/core/types/index.ts +1 -0
  180. package/src/core/types/link.ts +20 -0
  181. package/src/core/utils/details.ts +4 -0
  182. package/src/core/utils/dom.ts +0 -8
  183. package/src/core/utils/index.ts +0 -1
  184. package/src/icons/AiStarsGradientIcon/AiStarsGradientIcon.tsx +9 -3
  185. package/src/icons/AiStarsIcon/AiStarsIcon.tsx +9 -3
  186. package/src/icons/MagicWandIcon/MagicWandIcon.tsx +26 -0
  187. package/src/icons/ReturnKeyIcon/ReturnKeyIcon.tsx +1 -1
  188. package/src/index.ts +1 -0
  189. package/src/layouts/DocumentationLayout.tsx +3 -3
  190. package/src/layouts/ThreePanelLayout.tsx +27 -14
  191. package/src/markdoc/components/CodeWalkthrough/CodeContainer.tsx +4 -4
  192. package/src/markdoc/components/CodeWalkthrough/CodePanelHeader.tsx +4 -4
  193. package/src/markdoc/components/CodeWalkthrough/CodePanelPreview.tsx +3 -3
  194. package/src/markdoc/components/CodeWalkthrough/CodeStep.tsx +6 -2
  195. package/src/markdoc/components/Image/Image.tsx +4 -4
  196. package/src/markdoc/components/Tabs/TabItemFragment.tsx +15 -0
  197. package/src/markdoc/components/Tabs/TabList.tsx +9 -6
  198. package/src/markdoc/components/Tabs/Tabs.tsx +21 -15
  199. package/src/markdoc/components/default.ts +1 -0
  200. package/src/markdoc/tags/tab.ts +1 -1
  201. package/src/markdoc/tags/tabs.ts +1 -1
@@ -49,7 +49,7 @@ export function CodeBlockTabs({ tabs }: CodeBlockTabsProps): JSX.Element {
49
49
  tabRefs.current[i] = el as HTMLButtonElement;
50
50
  }}
51
51
  data-name={name}
52
- active={id === tabs.value}
52
+ $active={id === tabs.value}
53
53
  key={id}
54
54
  onClick={() => tabs.onChange(id)}
55
55
  >
@@ -118,7 +118,7 @@ const Tabs = styled.div`
118
118
  }
119
119
  `;
120
120
 
121
- const Tab = styled.button<{ active: boolean }>`
121
+ const Tab = styled.button<{ $active: boolean }>`
122
122
  --icon-size: 18px;
123
123
  display: inline-flex;
124
124
  align-items: center;
@@ -131,8 +131,8 @@ const Tab = styled.button<{ active: boolean }>`
131
131
  gap: var(--spacing-xs);
132
132
  color: var(--text-color-secondary);
133
133
 
134
- ${({ active }) =>
135
- active
134
+ ${({ $active }) =>
135
+ $active
136
136
  ? css`
137
137
  color: var(--text-color-primary);
138
138
  background-color: var(--tab-bg-color-filled);
@@ -104,9 +104,9 @@ export const Dropdown = forwardRef<HTMLDivElement, DropdownProps>(
104
104
  {dropdownTrigger}
105
105
 
106
106
  <ChildrenWrapper
107
- placement={placement}
108
- alignment={alignment}
109
- isOpen={isOpen}
107
+ $placement={placement}
108
+ $alignment={alignment}
109
+ $isOpen={isOpen}
110
110
  onClick={closeOnClick ? handleChildClick : undefined}
111
111
  >
112
112
  {children}
@@ -133,14 +133,14 @@ const DropdownWrapper = styled.div`
133
133
  text-decoration: none;
134
134
  `;
135
135
 
136
- const ChildrenWrapper = styled.div<{ placement?: string; alignment?: string; isOpen?: boolean }>`
136
+ const ChildrenWrapper = styled.div<{ $placement?: string; $alignment?: string; $isOpen?: boolean }>`
137
137
  padding-top: var(--dropdown-menu-padding-top);
138
138
  position: absolute;
139
- top: ${({ placement }) => (placement === 'top' ? 'auto' : '100%')};
140
- bottom: ${({ placement }) => (placement === 'top' ? '100%' : 'auto')};
141
- left: ${({ alignment }) => (alignment === 'start' ? '0' : 'auto')};
142
- right: ${({ alignment }) => (alignment === 'end' ? '0' : 'auto')};
143
- display: ${({ isOpen }) => (isOpen ? 'block' : 'none')};
139
+ top: ${({ $placement }) => ($placement === 'top' ? 'auto' : '100%')};
140
+ bottom: ${({ $placement }) => ($placement === 'top' ? '100%' : 'auto')};
141
+ left: ${({ $alignment }) => ($alignment === 'start' ? '0' : 'auto')};
142
+ right: ${({ $alignment }) => ($alignment === 'end' ? '0' : 'auto')};
143
+ display: ${({ $isOpen }) => ($isOpen ? 'block' : 'none')};
144
144
 
145
145
  z-index: var(--dropdown-menu-z-index);
146
146
  `;
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import styled, { css } from 'styled-components';
3
3
 
4
4
  import type { KeyboardEvent, CSSProperties, ReactNode, PropsWithChildren, JSX } from 'react';
5
- import type { LinkProps } from '@redocly/theme/components/Link/Link';
5
+ import type { LinkProps } from '@redocly/theme/core/types';
6
6
 
7
7
  import { Link } from '@redocly/theme/components/Link/Link';
8
8
 
@@ -60,7 +60,7 @@ export function Comment({
60
60
  <StyledFormMandatoryFields>
61
61
  <Label
62
62
  data-translation-key="feedback.settings.comment.submitText"
63
- standAlone={standAlone}
63
+ $standAlone={standAlone}
64
64
  >
65
65
  {submitText ||
66
66
  translate(
@@ -81,7 +81,7 @@ export function Comment({
81
81
  className={className}
82
82
  style={standAlone ? { width: 'var(--feedback-report-dialog-width)' } : { width: 'auto' }}
83
83
  >
84
- <Label data-translation-key="feedback.settings.comment.label" standAlone={standAlone}>
84
+ <Label data-translation-key="feedback.settings.comment.label" $standAlone={standAlone}>
85
85
  {label ||
86
86
  translate('feedback.settings.comment.label', 'Please share your feedback with us.')}
87
87
  </Label>
@@ -149,13 +149,13 @@ const StateWrapper = styled(CommentWrapper)`
149
149
  gap: var(--spacing-xxs);
150
150
  `;
151
151
 
152
- const Label = styled.h4<{ standAlone: boolean }>`
152
+ const Label = styled.h4<{ $standAlone: boolean }>`
153
153
  font-weight: var(--font-weight-regular);
154
154
  font-size: var(--feedback-font-size);
155
155
  line-height: var(--feedback-line-height);
156
156
 
157
- ${({ standAlone }) =>
158
- standAlone &&
157
+ ${({ $standAlone }) =>
158
+ $standAlone &&
159
159
  css`
160
160
  font-size: var(--feedback-header-font-size);
161
161
  line-height: var(--feedback-header-line-height);
@@ -165,7 +165,7 @@ export function Mood({ settings, onSubmit, className }: MoodProps): JSX.Element
165
165
  return (
166
166
  <MoodWrapper data-component-name="Feedback/Mood">
167
167
  <StyledFormMandatoryFields>
168
- <Label standAlone={true} data-translation-key="feedback.settings.submitText">
168
+ <Label $standAlone={true} data-translation-key="feedback.settings.submitText">
169
169
  {submitText ||
170
170
  translate(
171
171
  'feedback.settings.submitText',
@@ -182,7 +182,7 @@ export function Mood({ settings, onSubmit, className }: MoodProps): JSX.Element
182
182
  <MoodWrapper data-component-name="Feedback/Mood" className={className}>
183
183
  <StyledForm onSubmit={onSubmitMoodForm}>
184
184
  <StyledFormMandatoryFields>
185
- <Label standAlone={true} data-translation-key="feedback.settings.label">
185
+ <Label $standAlone={true} data-translation-key="feedback.settings.label">
186
186
  {label || translate('feedback.settings.label', 'Was this helpful?')}
187
187
  </Label>
188
188
  <StyledMandatoryFieldContainer>
@@ -305,15 +305,15 @@ const MoodWrapper = styled.div`
305
305
  align-items: center;
306
306
  `;
307
307
 
308
- const Label = styled.h4<{ standAlone?: boolean }>`
308
+ const Label = styled.h4<{ $standAlone: boolean }>`
309
309
  font-family: var(--feedback-font-family);
310
310
  font-weight: var(--font-weight-regular);
311
311
  font-size: var(--feedback-font-size);
312
312
  line-height: var(--feedback-line-height);
313
313
  color: var(--feedback-text-color);
314
314
 
315
- ${({ standAlone = false }) =>
316
- standAlone &&
315
+ ${({ $standAlone = false }) =>
316
+ $standAlone &&
317
317
  css`
318
318
  font-size: var(--feedback-header-font-size);
319
319
  line-height: var(--feedback-header-line-height);
@@ -70,7 +70,7 @@ export function FilterContent({
70
70
  {!hideSearch && (
71
71
  <FilterInput value={filterTerm} onChange={(updatedTerm) => setFilterTerm(updatedTerm)} />
72
72
  )}
73
- <FilterItems hideSearch={hideSearch}>
73
+ <FilterItems $hideSearch={hideSearch}>
74
74
  {filters.map((filter, idx) => (
75
75
  <Filter
76
76
  filter={filter}
@@ -104,15 +104,15 @@ const FiltersTitle = styled.div`
104
104
  line-height: var(--filter-content-title-line-height);
105
105
  `;
106
106
 
107
- const FilterItems = styled.div<{ hideSearch?: boolean }>`
107
+ const FilterItems = styled.div<{ $hideSearch?: boolean }>`
108
108
  padding: var(--filter-content-items-padding);
109
109
  height: 100%;
110
110
  display: flex;
111
111
  flex-direction: column;
112
112
  gap: var(--spacing-base);
113
113
  border-top: 1px solid var(--border-color-secondary);
114
- ${({ hideSearch }) =>
115
- hideSearch &&
114
+ ${({ $hideSearch }) =>
115
+ $hideSearch &&
116
116
  css`
117
117
  border-top: none;
118
118
  `}
@@ -47,7 +47,7 @@ export function FilterPopover({
47
47
  );
48
48
  }
49
49
 
50
- const FilterPopoverWrapper = styled.aside<{ isActiveInMobileMode?: boolean }>`
50
+ const FilterPopoverWrapper = styled.aside`
51
51
  position: absolute;
52
52
  top: 0;
53
53
  z-index: var(--z-index-popover);
@@ -28,7 +28,7 @@ export function Footer({ className }: FooterProps): JSX.Element | null {
28
28
  <FooterWrapper
29
29
  data-component-name="Footer/Footer"
30
30
  className={className}
31
- withColumns={withColumns}
31
+ $withColumns={withColumns}
32
32
  >
33
33
  {!!items.length && (
34
34
  <FooterColumnsSection>
@@ -83,7 +83,7 @@ const FooterColumnsSection = styled.div`
83
83
  }
84
84
  `;
85
85
 
86
- const FooterWrapper = styled.footer<{ withColumns?: boolean }>`
86
+ const FooterWrapper = styled.footer<{ $withColumns: boolean }>`
87
87
  padding: var(--mobile-footer-padding-vertical) var(--mobile-footer-padding-horizontal);
88
88
  border-top: 1px solid var(--footer-border-color);
89
89
  font-size: var(--footer-font-size);
@@ -100,8 +100,8 @@ const FooterWrapper = styled.footer<{ withColumns?: boolean }>`
100
100
  @media screen and (min-width: ${breakpoints.small}) {
101
101
  padding: var(--footer-padding-vertical) var(--footer-padding-horizontal);
102
102
  flex-direction: row;
103
- ${({ withColumns }) =>
104
- withColumns
103
+ ${({ $withColumns }) =>
104
+ $withColumns
105
105
  ? `
106
106
  flex-direction: column;
107
107
  align-items: stretch;
@@ -23,7 +23,7 @@ export function FooterColumn({ column, className }: FooterColumnProps): JSX.Elem
23
23
  return (
24
24
  <FooterColumnWrapper data-component-name="Footer/FooterColumn" className={className}>
25
25
  {!isNavLinkItem(column) && <FooterColumnTitle>{label}</FooterColumnTitle>}
26
- <FooterColumnItems iconsOnly={isNavLinkItem(column) ? false : iconsOnly}>
26
+ <FooterColumnItems $iconsOnly={isNavLinkItem(column) ? false : iconsOnly}>
27
27
  {isNavLinkItem(column) ? (
28
28
  <NonGroupItem
29
29
  item={column}
@@ -87,11 +87,11 @@ const FooterColumnTitle = styled.div`
87
87
  }
88
88
  `;
89
89
 
90
- const FooterColumnItems = styled.div<{ iconsOnly: boolean }>`
90
+ const FooterColumnItems = styled.div<{ $iconsOnly?: boolean }>`
91
91
  display: flex;
92
92
  flex-wrap: wrap;
93
93
  justify-content: center;
94
- flex-direction: ${(props) => (props.iconsOnly ? 'row' : 'column')};
94
+ flex-direction: ${(props) => (props.$iconsOnly ? 'row' : 'column')};
95
95
 
96
96
  @media screen and (min-width: ${breakpoints.small}) {
97
97
  justify-content: flex-start;
@@ -31,8 +31,8 @@ export function FooterItem({ item, iconsOnly, className }: FooterItemProps): JSX
31
31
  <FooterItemWrapper
32
32
  className={className}
33
33
  data-component-name="Footer/FooterItem"
34
- iconsOnly={iconsOnly}
35
- item={item}
34
+ $iconsOnly={iconsOnly}
35
+ $item={item}
36
36
  >
37
37
  {item.type === 'separator' ? (
38
38
  <FooterSeparator data-translation-key={item.labelTranslationKey}>
@@ -48,7 +48,7 @@ export function FooterItem({ item, iconsOnly, className }: FooterItemProps): JSX
48
48
  data-translation-key={item.labelTranslationKey}
49
49
  >
50
50
  {hasIcon ? (
51
- <FooterLinkIcon iconsOnly={iconsOnly}>
51
+ <FooterLinkIcon $iconsOnly={iconsOnly}>
52
52
  <GenericIcon icon={item.icon} srcSet={item.srcSet} />
53
53
  </FooterLinkIcon>
54
54
  ) : null}
@@ -67,11 +67,11 @@ const FooterSeparator = styled.div`
67
67
  opacity: var(--footer-separator-item-opacity);
68
68
  `;
69
69
 
70
- const FooterLinkIcon = styled.div<{ iconsOnly?: boolean }>`
70
+ const FooterLinkIcon = styled.div<{ $iconsOnly?: boolean }>`
71
71
  --icon-width: var(--footer-item-icon-width);
72
72
  --icon-height: var(--footer-item-icon-height);
73
73
  display: inline-flex;
74
- margin-right: ${({ iconsOnly }) => (iconsOnly ? '0' : 'var(--footer-item-icon-margin-right)')};
74
+ margin-right: ${({ $iconsOnly }) => ($iconsOnly ? '0' : 'var(--footer-item-icon-margin-right)')};
75
75
  vertical-align: middle;
76
76
  border: 1px solid var(--footer-item-icon-border-color);
77
77
  border-radius: var(--footer-item-icon-border-radius);
@@ -91,11 +91,11 @@ const FooterLink = styled(Link)`
91
91
  }
92
92
  `;
93
93
 
94
- const FooterItemWrapper = styled.div<{ iconsOnly?: boolean; item: ResolvedNavItem }>`
95
- margin: ${({ iconsOnly, item }) =>
96
- iconsOnly
94
+ const FooterItemWrapper = styled.div<{ $iconsOnly?: boolean; $item: ResolvedNavItem }>`
95
+ margin: ${({ $iconsOnly, $item }) =>
96
+ $iconsOnly
97
97
  ? '0 var(--footer-item-icon-margin-right) 0 0;'
98
- : item.type === 'link'
98
+ : $item.type === 'link'
99
99
  ? 'var(--footer-link-padding-vertical) var(--footer-link-padding-horizontal);'
100
100
  : '0'};
101
101
  `;
@@ -93,7 +93,7 @@ export function Image(props: ImageProps): JSX.Element {
93
93
  Array.from(parsedSourceSetMap).map(([key, value]) => (
94
94
  <ColorModeAwareImage
95
95
  key={key}
96
- colorMode={key}
96
+ $colorMode={key}
97
97
  src={value}
98
98
  alt={alt}
99
99
  className={className}
@@ -109,8 +109,8 @@ export function Image(props: ImageProps): JSX.Element {
109
109
  );
110
110
  }
111
111
 
112
- const ColorModeAwareImage = styled.img<{ colorMode: string; $withLightbox?: boolean }>`
113
- html:not(.${(props) => props.colorMode}) && {
112
+ const ColorModeAwareImage = styled.img<{ $colorMode: string; $withLightbox?: boolean }>`
113
+ html:not(.${(props) => props.$colorMode}) && {
114
114
  display: none;
115
115
  }
116
116
  ${({ $withLightbox }) =>
@@ -59,7 +59,7 @@ export function LastUpdated(props: LastUpdatedProps): JSX.Element | null {
59
59
  <LastUpdatedWrapper
60
60
  className={props.className}
61
61
  data-component-name="LastUpdated/LastUpdated"
62
- rawOnPrint={format === 'timeago'}
62
+ $rawOnPrint={format === 'timeago'}
63
63
  data-print-datetime={isoDate}
64
64
  data-translation-key={translationKey}
65
65
  >
@@ -70,15 +70,15 @@ export function LastUpdated(props: LastUpdatedProps): JSX.Element | null {
70
70
  );
71
71
  }
72
72
 
73
- const LastUpdatedWrapper = styled.div<{ rawOnPrint?: boolean }>`
73
+ const LastUpdatedWrapper = styled.div<{ $rawOnPrint: boolean }>`
74
74
  color: var(--last-updated-text-color);
75
75
  font-size: var(--last-updated-font-size);
76
76
  font-family: var(--last-updated-font-family);
77
77
  line-height: var(--last-updated-line-height);
78
78
  padding-bottom: 30px;
79
79
 
80
- ${({ rawOnPrint }) =>
81
- rawOnPrint &&
80
+ ${({ $rawOnPrint }) =>
81
+ $rawOnPrint &&
82
82
  `@media print {
83
83
  time {
84
84
  display: none;
@@ -1,31 +1,13 @@
1
1
  import * as React from 'react';
2
2
  import { useContext } from 'react';
3
3
  import { Link as ReactLink } from 'react-router-dom';
4
- import isPropValid from '@emotion/is-prop-valid';
5
4
 
6
5
  import type { JSX } from 'react';
7
- import type { RelativeRoutingType } from 'react-router-dom';
6
+ import type { LinkProps } from '@redocly/theme/core/types';
8
7
 
9
8
  import { ThemeDataContext } from '@redocly/theme/core/contexts/ThemeDataContext';
10
9
 
11
- export type LinkProps = {
12
- to: string;
13
- target?: '_self' | '_blank';
14
- external?: boolean;
15
- className?: string;
16
- style?: React.CSSProperties;
17
- innerRef?: React.Ref<HTMLAnchorElement>;
18
- languageInsensitive?: boolean;
19
- onClick?: () => void;
20
- reloadDocument?: boolean;
21
- replace?: boolean;
22
- state?: unknown;
23
- preventScrollReset?: boolean;
24
- relative?: RelativeRoutingType;
25
- viewTransition?: boolean;
26
- [key: string]: unknown;
27
- rel?: string;
28
- };
10
+ export type { LinkProps };
29
11
 
30
12
  export function Link(props: React.PropsWithChildren<LinkProps>): JSX.Element {
31
13
  const context = useContext(ThemeDataContext);
@@ -33,36 +15,9 @@ export function Link(props: React.PropsWithChildren<LinkProps>): JSX.Element {
33
15
  if (context?.components) {
34
16
  const { LinkComponent } = context.components;
35
17
  return <LinkComponent {...props} />;
36
- } else {
37
- const {
38
- innerRef,
39
- to,
40
- external: _external,
41
- languageInsensitive: _languageInsensitive,
42
- reloadDocument,
43
- replace,
44
- state,
45
- preventScrollReset,
46
- relative,
47
- viewTransition,
48
- ...restProps
49
- } = props;
50
- const linkProps = Object.fromEntries(
51
- Object.entries(restProps).filter(([key, value]) => value !== undefined && isPropValid(key)),
52
- );
53
-
54
- return (
55
- <ReactLink
56
- ref={innerRef}
57
- to={to}
58
- reloadDocument={reloadDocument}
59
- replace={replace}
60
- state={state}
61
- preventScrollReset={preventScrollReset}
62
- relative={relative}
63
- viewTransition={viewTransition}
64
- {...linkProps}
65
- />
66
- );
67
18
  }
19
+
20
+ const { external: _1, languageInsensitive: _2, innerRef, ...filteredProps } = props;
21
+
22
+ return <ReactLink ref={innerRef} {...filteredProps} />;
68
23
  }
@@ -7,13 +7,13 @@ import { getCssColorVariable } from '@redocly/theme/core/utils';
7
7
  import { Spinner } from '@redocly/theme/icons/Spinner/Spinner';
8
8
  import { useThemeHooks } from '@redocly/theme/core/hooks';
9
9
 
10
- const LoadingMessage = styled.div<{ color: string }>`
10
+ const LoadingMessage = styled.div<{ $color: string }>`
11
11
  font-family: helvetica, sans, sans-serif;
12
12
  width: 100%;
13
13
  text-align: center;
14
14
  font-size: 25px;
15
15
  margin: 30px 0 20px 0;
16
- color: ${({ color }) => getCssColorVariable(color)};
16
+ color: ${({ $color }) => getCssColorVariable($color)};
17
17
  `;
18
18
 
19
19
  export type LoadingProps = {
@@ -26,7 +26,7 @@ export function Loading({ color }: LoadingProps): JSX.Element {
26
26
 
27
27
  return (
28
28
  <div style={{ textAlign: 'center' }}>
29
- <LoadingMessage color={color}>{translate('loaders.loading', 'Loading...')}</LoadingMessage>
29
+ <LoadingMessage $color={color}>{translate('loaders.loading', 'Loading...')}</LoadingMessage>
30
30
  <Spinner color={color} />
31
31
  </div>
32
32
  );
@@ -9,13 +9,13 @@ export type LoadingProps = {
9
9
  };
10
10
 
11
11
  export function SpinnerLoader({ color, size }: LoadingProps): JSX.Element {
12
- return <Spinner color={color} size={size} />;
12
+ return <Spinner $color={color} $size={size} />;
13
13
  }
14
14
 
15
- const Spinner = styled.div<{ color: string; size: string }>`
16
- width: ${({ size }) => size};
17
- height: ${({ size }) => size};
18
- border: 3px solid ${({ color }) => color};
15
+ const Spinner = styled.div<{ $color: string; $size: string }>`
16
+ width: ${({ $size }) => $size};
17
+ height: ${({ $size }) => $size};
18
+ border: 3px solid ${({ $color }) => $color};
19
19
  border-bottom-color: transparent;
20
20
  border-radius: 50%;
21
21
  display: inline-block;
@@ -23,15 +23,15 @@ export type MarkdownProps = PropsWithChildren<{
23
23
  compact?: boolean;
24
24
  inline?: boolean;
25
25
  base?: boolean;
26
- ref?: (node: HTMLDivElement) => void;
27
26
  }>;
28
27
 
29
- export const Markdown = styled.main.attrs<{
30
- className?: string;
31
- }>(({ className }) => ({
32
- 'data-component-name': 'Markdown/Markdown',
33
- className,
34
- }))<MarkdownProps>`
28
+ export const Markdown = styled.main
29
+ .withConfig({
30
+ shouldForwardProp: (prop) => !['compact', 'inline', 'base'].includes(prop),
31
+ })
32
+ .attrs<{ 'data-component-name': string }>({
33
+ 'data-component-name': 'Markdown/Markdown',
34
+ })<MarkdownProps>`
35
35
  font-size: var(--md-content-font-size);
36
36
  font-family: var(--md-content-font-family);
37
37
  font-weight: var(--md-content-font-weight);
@@ -36,18 +36,18 @@ export const Marker = forwardRef<HTMLDivElement, MarkerProps>(
36
36
  <StyledMarker
37
37
  data-component-name="Marker/Marker"
38
38
  ref={internalRef}
39
- marker={marker}
39
+ $marker={marker}
40
40
  {...(dataAttribures ?? {})}
41
41
  />
42
42
  );
43
43
  },
44
44
  );
45
45
 
46
- const StyledMarker = styled.div<{ marker: MarkerArea }>`
46
+ const StyledMarker = styled.div<{ $marker: MarkerArea }>`
47
47
  position: absolute;
48
48
  z-index: -1;
49
- top: ${({ marker }) => marker.offset}px;
50
- height: ${({ marker }) => marker.height}px;
49
+ top: ${({ $marker }) => $marker.offset}px;
50
+ height: ${({ $marker }) => $marker.height}px;
51
51
  width: 100%;
52
52
  left: 0;
53
53
  `;
@@ -1,7 +1,6 @@
1
- import React from 'react';
1
+ import React, { type JSX, type PropsWithChildren } from 'react';
2
2
  import styled, { keyframes } from 'styled-components';
3
3
 
4
- import type { JSX, PropsWithChildren } from 'react';
5
4
  import type { MenuItemsAnimation } from '@redocly/theme/core/types';
6
5
 
7
6
  export type MenuContainerProps = PropsWithChildren<{
@@ -11,8 +10,24 @@ export type MenuContainerProps = PropsWithChildren<{
11
10
  animation?: MenuItemsAnimation;
12
11
  }>;
13
12
 
14
- export function MenuContainer(props: MenuContainerProps): JSX.Element {
15
- return <MenuContainerComponent {...props} data-component-name="Menu/MenuContainer" />;
13
+ export function MenuContainer({
14
+ growContent,
15
+ className,
16
+ hidden,
17
+ animation,
18
+ children,
19
+ }: MenuContainerProps): JSX.Element {
20
+ return (
21
+ <MenuContainerComponent
22
+ data-component-name="Menu/MenuContainer"
23
+ $growContent={growContent === undefined ? true : growContent}
24
+ $animation={animation}
25
+ $hidden={hidden}
26
+ className={className}
27
+ >
28
+ {children}
29
+ </MenuContainerComponent>
30
+ );
16
31
  }
17
32
 
18
33
  const slideInRightAnimation = keyframes`
@@ -33,17 +48,18 @@ const slideInLeftAnimation = keyframes`
33
48
  }
34
49
  `;
35
50
 
36
- const MenuContainerComponent = styled.div.attrs<MenuContainerProps>(
37
- ({ growContent, className, animation }) => ({
38
- growContent: growContent === undefined ? true : growContent,
39
- className,
40
- animation,
41
- }),
42
- )<MenuContainerProps>`
43
- animation-name: ${({ animation }) =>
44
- animation === 'slideInRight'
51
+ const MenuContainerComponent = styled.div.attrs<{
52
+ 'data-component-name': string;
53
+ $growContent: boolean;
54
+ $animation: MenuItemsAnimation;
55
+ $hidden: boolean;
56
+ }>({
57
+ 'data-component-name': 'Menu/MenuContainer',
58
+ })`
59
+ animation-name: ${({ $animation }) =>
60
+ $animation === 'slideInRight'
45
61
  ? slideInRightAnimation
46
- : animation === 'slideInLeft'
62
+ : $animation === 'slideInLeft'
47
63
  ? slideInLeftAnimation
48
64
  : 'none'};
49
65
  animation-fill-mode: forwards;
@@ -51,8 +67,8 @@ const MenuContainerComponent = styled.div.attrs<MenuContainerProps>(
51
67
  animation-timing-function: ease;
52
68
  position: relative;
53
69
  overflow-y: auto;
54
- flex-grow: ${({ growContent }) => (growContent ? 1 : 0)};
70
+ flex-grow: ${({ $growContent }) => ($growContent ? 1 : 0)};
55
71
  padding-top: var(--menu-container-padding-top);
56
- display: ${({ hidden }) => (hidden ? 'none' : 'block')};
72
+ display: ${({ $hidden }) => ($hidden ? 'none' : 'block')};
57
73
  overscroll-behavior: contain;
58
74
  `;