@redocly/theme 0.66.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 +2 -3
  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
@@ -51,9 +51,9 @@ export function Sidebar({
51
51
  return (
52
52
  <SidebarContent
53
53
  data-component-name="Sidebar/Sidebar"
54
- opened={isOpen}
54
+ $opened={isOpen}
55
55
  className={className}
56
- collapsed={mappedCollapsed}
56
+ $collapsed={mappedCollapsed}
57
57
  >
58
58
  {header ? <SidebarHeader collapsed={mappedCollapsed}>{header}</SidebarHeader> : null}
59
59
  {!mappedCollapsed && versions ? versions : null}
@@ -65,7 +65,7 @@ export function Sidebar({
65
65
  {menu}
66
66
  </MenuContainer>
67
67
  {footer && !isOpen ? (
68
- <SidebarFooter collapsed={mappedCollapsed} data-component-name="Sidebar/FooterWrapper">
68
+ <SidebarFooter $collapsed={mappedCollapsed} data-component-name="Sidebar/FooterWrapper">
69
69
  {footer}
70
70
  </SidebarFooter>
71
71
  ) : null}
@@ -73,7 +73,7 @@ export function Sidebar({
73
73
  );
74
74
  }
75
75
 
76
- const SidebarContent = styled.aside<{ opened?: boolean; collapsed?: boolean }>`
76
+ const SidebarContent = styled.aside<{ $opened: boolean; $collapsed?: boolean }>`
77
77
  border-right: 1px solid var(--sidebar-border-color);
78
78
  position: fixed;
79
79
  left: 0;
@@ -91,8 +91,8 @@ const SidebarContent = styled.aside<{ opened?: boolean; collapsed?: boolean }>`
91
91
  top: calc(var(--navbar-height) + var(--banner-height));
92
92
  height: calc(100vh - var(--navbar-height) - var(--banner-height));
93
93
  overflow-x: hidden;
94
- ${({ opened }) => `
95
- display: ${opened ? 'flex' : 'none'}
94
+ ${({ $opened }) => `
95
+ display: ${$opened ? 'flex' : 'none'}
96
96
  `};
97
97
 
98
98
  @media screen and (min-width: ${breakpoints.medium}) {
@@ -103,8 +103,8 @@ const SidebarContent = styled.aside<{ opened?: boolean; collapsed?: boolean }>`
103
103
  flex-shrink: 0;
104
104
  overflow: clip;
105
105
 
106
- ${({ collapsed }) =>
107
- collapsed
106
+ ${({ $collapsed }) =>
107
+ $collapsed
108
108
  ? `
109
109
  flex-direction: column;
110
110
  width: var(--sidebar-collapsed-width);
@@ -121,7 +121,9 @@ const SidebarContent = styled.aside<{ opened?: boolean; collapsed?: boolean }>`
121
121
  }
122
122
  `;
123
123
 
124
- export const SidebarHeader = styled.div<{ collapsed?: boolean }>`
124
+ export const SidebarHeader = styled.div.withConfig({
125
+ shouldForwardProp: (prop) => prop !== 'collapsed',
126
+ })<{ collapsed?: boolean; className?: string }>`
125
127
  margin: var(--sidebar-offset-top) var(--sidebar-margin-horizontal) 0
126
128
  var(--sidebar-margin-horizontal);
127
129
  padding: 0 0 var(--sidebar-header-padding-bottom) 0;
@@ -133,17 +135,17 @@ export const SidebarHeader = styled.div<{ collapsed?: boolean }>`
133
135
  `}
134
136
  `;
135
137
 
136
- const SidebarFooter = styled.div<{ collapsed?: boolean }>`
138
+ const SidebarFooter = styled.div<{ $collapsed?: boolean }>`
137
139
  display: none;
138
140
  padding: var(--sidebar-footer-padding-vertical) var(--sidebar-footer-padding-horizontal);
139
141
 
140
142
  @media screen and (min-width: ${breakpoints.medium}) {
141
143
  display: flex;
142
- justify-content: ${({ collapsed }) => (collapsed ? 'center' : 'flex-end')};
144
+ justify-content: ${({ $collapsed }) => ($collapsed ? 'center' : 'flex-end')};
143
145
  }
144
146
 
145
- ${({ collapsed }) =>
146
- collapsed &&
147
+ ${({ $collapsed }) =>
148
+ $collapsed &&
147
149
  `
148
150
  position: sticky;
149
151
  bottom: 0;
@@ -3,7 +3,9 @@ import styled, { css } from 'styled-components';
3
3
  import { breakpoints } from '@redocly/theme/core/utils';
4
4
  import { Tooltip } from '@redocly/theme/components/Tooltip/Tooltip';
5
5
 
6
- const StyledChangeViewButton = styled.span<{ collapsedSidebar?: boolean }>`
6
+ const StyledChangeViewButton = styled.span.withConfig({
7
+ shouldForwardProp: (prop) => prop !== 'collapsedSidebar',
8
+ })<{ collapsedSidebar: boolean }>`
7
9
  display: flex;
8
10
  position: relative;
9
11
  flex-direction: ${({ collapsedSidebar }) => (collapsedSidebar ? 'column' : 'row')};
@@ -16,7 +18,9 @@ const StyledChangeViewButton = styled.span<{ collapsedSidebar?: boolean }>`
16
18
  padding: calc(var(--spacing-unit) / 2);
17
19
  `;
18
20
 
19
- const StyledChangeViewButtonWrap = styled(Tooltip)<{ active?: boolean }>`
21
+ const StyledChangeViewButtonWrap = styled(Tooltip).withConfig({
22
+ shouldForwardProp: (prop) => prop !== 'active',
23
+ })<{ active: boolean }>`
20
24
  width: 20px;
21
25
  height: 20px;
22
26
  border-radius: var(--border-radius);
@@ -26,7 +30,9 @@ const StyledChangeViewButtonWrap = styled(Tooltip)<{ active?: boolean }>`
26
30
  background-color: ${({ active }) => active && 'var(--segmented-buttons-bg-color-inner)'};
27
31
  `;
28
32
 
29
- const ControlsWrap = styled.span<{
33
+ const ControlsWrap = styled.span.withConfig({
34
+ shouldForwardProp: (prop) => prop !== 'iconCount' && prop !== 'isCollapsed',
35
+ })<{
30
36
  iconCount?: number;
31
37
  isCollapsed?: boolean;
32
38
  }>`
@@ -59,7 +65,9 @@ const ControlsWrap = styled.span<{
59
65
  }
60
66
  `;
61
67
 
62
- const ControlsWrapChangeLayoutButtons = styled.span<{ isCollapsed?: boolean }>`
68
+ const ControlsWrapChangeLayoutButtons = styled.span.withConfig({
69
+ shouldForwardProp: (prop) => prop !== 'isCollapsed',
70
+ })<{ isCollapsed: boolean }>`
63
71
  display: flex;
64
72
  bottom: 0;
65
73
  flex-direction: ${({ isCollapsed }) => (isCollapsed ? 'column-reverse' : 'row')};
@@ -1,14 +1,22 @@
1
1
  import styled from 'styled-components';
2
2
 
3
- export const StatusCode = styled.button.attrs<{
3
+ export type StatusCodeProps = {
4
4
  status: string;
5
- 'data-component-name': string;
6
- }>({ 'data-component-name': 'StatusCode/StatusCode' })`
5
+ className?: string;
6
+ };
7
+
8
+ export const StatusCode = styled.button
9
+ .withConfig({
10
+ shouldForwardProp: (prop) => prop !== 'status',
11
+ })
12
+ .attrs<{ 'data-component-name': string }>({
13
+ 'data-component-name': 'StatusCode/StatusCode',
14
+ })<StatusCodeProps>`
7
15
  background: none;
8
16
  padding: 0;
9
17
  display: flex;
10
18
  align-items: center;
11
-
19
+
12
20
  &:before {
13
21
  display: inline-block;
14
22
  content: '';
@@ -44,43 +44,43 @@ export function Switch({
44
44
  role="switch"
45
45
  aria-checked={value}
46
46
  aria-disabled={disabled}
47
- selected={value}
48
- disabled={disabled}
47
+ $selected={value}
48
+ $disabled={disabled}
49
49
  className={className}
50
50
  >
51
- <Knob selected={value} disabled={disabled} />
51
+ <Knob $selected={value} $disabled={disabled} />
52
52
  </SwitchWrapper>
53
53
  );
54
54
  }
55
55
 
56
- const SwitchWrapper = styled.div<{ selected: boolean; disabled: boolean }>`
56
+ const SwitchWrapper = styled.div<{ $selected: boolean; $disabled: boolean }>`
57
57
  width: var(--switch-width);
58
58
  height: var(--switch-height);
59
59
  border-radius: var(--switch-border-radius);
60
60
  border: var(--switch-border-width) solid
61
- ${({ selected, disabled }) =>
62
- disabled
61
+ ${({ $selected, $disabled }) =>
62
+ $disabled
63
63
  ? 'var(--switch-border-color-disabled)'
64
- : selected
64
+ : $selected
65
65
  ? 'var(--switch-border-color-selected)'
66
66
  : 'var(--switch-border-color)'};
67
- background-color: ${({ selected, disabled }) =>
68
- disabled
69
- ? selected
67
+ background-color: ${({ $selected, $disabled }) =>
68
+ $disabled
69
+ ? $selected
70
70
  ? 'var(--switch-bg-color-disabled-selected)'
71
71
  : 'var(--switch-bg-color-disabled)'
72
- : selected
72
+ : $selected
73
73
  ? 'var(--switch-bg-color-selected)'
74
74
  : 'var(--switch-bg-color)'};
75
75
  display: flex;
76
76
  align-items: center;
77
77
  padding: var(--switch-padding);
78
- cursor: ${({ disabled }) => (disabled ? 'not-allowed' : 'pointer')};
78
+ cursor: ${({ $disabled }) => ($disabled ? 'not-allowed' : 'pointer')};
79
79
  transition: var(--switch-bg-transition);
80
80
 
81
- ${({ selected, disabled }) =>
82
- !disabled &&
83
- !selected &&
81
+ ${({ $selected, $disabled }) =>
82
+ !$disabled &&
83
+ !$selected &&
84
84
  css`
85
85
  &:hover {
86
86
  background-color: var(--switch-bg-color-hover);
@@ -93,17 +93,17 @@ const SwitchWrapper = styled.div<{ selected: boolean; disabled: boolean }>`
93
93
  `}
94
94
  `;
95
95
 
96
- const Knob = styled.div<{ selected: boolean; disabled: boolean }>`
96
+ const Knob = styled.div<{ $selected: boolean; $disabled: boolean }>`
97
97
  width: var(--switch-knob-width);
98
98
  height: var(--switch-knob-height);
99
99
  border-radius: var(--switch-knob-border-radius);
100
- background-color: ${({ selected, disabled }) =>
101
- disabled
100
+ background-color: ${({ $selected, $disabled }) =>
101
+ $disabled
102
102
  ? 'var(--switch-knob-bg-color-disabled)'
103
- : selected
103
+ : $selected
104
104
  ? 'var(--switch-knob-bg-color-selected)'
105
105
  : 'var(--switch-knob-bg-color)'};
106
- transform: ${({ selected }) =>
107
- selected ? 'translateX(var(--switch-knob-width))' : 'translateX(0)'};
106
+ transform: ${({ $selected }) =>
107
+ $selected ? 'translateX(var(--switch-knob-width))' : 'translateX(0)'};
108
108
  transition: var(--switch-knob-transition);
109
109
  `;
@@ -56,7 +56,7 @@ export function TableOfContent(props: TableOfContentProps): JSX.Element | null {
56
56
  <TableOfContentMenuItem
57
57
  key={href + idx}
58
58
  href={href}
59
- depth={heading.depth - leastDepth + 1 || 0}
59
+ $depth={heading.depth - leastDepth + 1 || 0}
60
60
  className={activeHeading === heading.id ? 'active' : ''}
61
61
  dangerouslySetInnerHTML={{ __html: heading.value || '' }}
62
62
  data-testid={`toc-${heading.value}`}
@@ -103,7 +103,7 @@ const TableOfContentItems = styled.div`
103
103
  border-left: solid 1px var(--toc-border-color);
104
104
  `;
105
105
 
106
- const TableOfContentMenuItem = styled.a<{ depth: number }>`
106
+ const TableOfContentMenuItem = styled.a<{ $depth: number }>`
107
107
  display: block;
108
108
  color: var(--toc-item-text-color);
109
109
  font-weight: var(--toc-item-font-weight);
@@ -111,7 +111,7 @@ const TableOfContentMenuItem = styled.a<{ depth: number }>`
111
111
  cursor: pointer;
112
112
  font-size: var(--toc-item-font-size);
113
113
  padding: var(--toc-item-padding-vertical) var(--toc-item-padding-horizontal);
114
- padding-left: calc(var(--toc-item-nested-offset) * ${({ depth }) => depth});
114
+ padding-left: calc(var(--toc-item-nested-offset) * ${({ $depth }) => $depth});
115
115
  transition:
116
116
  background-color 0.3s,
117
117
  color 0.3s;
@@ -147,18 +147,18 @@ export function Tag({
147
147
  <TagWrapper
148
148
  tabIndex={tabIndex}
149
149
  data-component-name="Tag/Tag"
150
- borderless={borderless}
151
- color={color}
152
- size={size}
150
+ $borderless={borderless}
151
+ $color={color}
152
+ $size={size}
153
153
  onClick={onClick}
154
154
  onKeyDown={onKeyDown}
155
- hasCloseButton={closable}
156
- textTransform={textTransform}
157
- variant={variant}
158
- selectable={selectable}
155
+ $hasCloseButton={closable}
156
+ $textTransform={textTransform}
157
+ $variant={variant}
158
+ $selectable={selectable}
159
159
  {...otherProps}
160
160
  >
161
- {withStatusDot ? <StatusDot color={statusDotColor} /> : icon ? icon : null}
161
+ {withStatusDot ? <StatusDot $color={statusDotColor} /> : icon ? icon : null}
162
162
  <ContentWrapper>{renderChildren()}</ContentWrapper>
163
163
  {closable && (
164
164
  <CloseButton
@@ -202,22 +202,29 @@ const CloseButton = styled.div`
202
202
  }
203
203
  `;
204
204
 
205
- const TagWrapper = styled.div.attrs<
206
- TagProps & {
207
- hasCloseButton?: boolean;
208
- textTransform?: 'uppercase' | 'lowercase' | 'capitalize' | 'none';
209
- }
210
- >(({ className, color, size, variant }) => ({
205
+ const TagWrapper = styled.div.attrs<{
206
+ $color?: string;
207
+ $size?: string;
208
+ $variant?: string;
209
+ }>(({ className, $color, $size, $variant }) => ({
211
210
  className: [
212
211
  className,
213
212
  'tag-default',
214
- color && `tag-${color}`,
215
- size && `tag-size-${size}`,
216
- `tag-variant-${variant || 'filled'}`,
213
+ $color && `tag-${$color}`,
214
+ $size && `tag-size-${$size}`,
215
+ `tag-variant-${$variant || 'filled'}`,
217
216
  ]
218
217
  .filter(Boolean)
219
218
  .join(' '),
220
- }))`
219
+ }))<{
220
+ $borderless?: boolean;
221
+ $hasCloseButton?: boolean;
222
+ $textTransform?: string;
223
+ $selectable?: boolean;
224
+ $color?: string;
225
+ $size?: string;
226
+ $variant?: string;
227
+ }>`
221
228
  display: inline-flex;
222
229
  align-items: center;
223
230
  justify-content: center;
@@ -225,7 +232,7 @@ const TagWrapper = styled.div.attrs<
225
232
  position: relative;
226
233
 
227
234
  padding: var(--tag-padding);
228
- ${({ hasCloseButton }) => (hasCloseButton ? 'padding-right: 0;' : '')};
235
+ ${({ $hasCloseButton }) => ($hasCloseButton ? 'padding-right: 0;' : '')};
229
236
  margin: var(--tag-margin);
230
237
 
231
238
  &:last-child {
@@ -239,13 +246,13 @@ const TagWrapper = styled.div.attrs<
239
246
  font-weight: var(--tag-font-weight);
240
247
  line-height: var(--tag-line-height);
241
248
  box-shadow: var(--tag-box-shadow);
242
- ${({ textTransform }) =>
243
- `text-transform: ${textTransform ? `${textTransform}` : 'var(--tag-text-transform)'};`}
249
+ ${({ $textTransform }) =>
250
+ `text-transform: ${$textTransform ? `${$textTransform}` : 'var(--tag-text-transform)'};`}
244
251
 
245
252
  color: var(--tag-color);
246
253
  background-color: var(--tag-bg-color);
247
- ${({ borderless }) =>
248
- borderless
254
+ ${({ $borderless }) =>
255
+ $borderless
249
256
  ? ''
250
257
  : `border: var(--tag-border-width) var(--tag-border-style) var(--tag-border-color);`}
251
258
  border-radius: var(--tag-border-radius);
@@ -255,8 +262,8 @@ const TagWrapper = styled.div.attrs<
255
262
  height: var(--tag-icon-height);
256
263
  }
257
264
 
258
- ${({ selectable }) =>
259
- selectable &&
265
+ ${({ $selectable }) =>
266
+ $selectable &&
260
267
  css`
261
268
  &:hover {
262
269
  background-color: var(--tag-bg-color-hover);
@@ -271,13 +278,13 @@ const TagWrapper = styled.div.attrs<
271
278
  `};
272
279
  `;
273
280
 
274
- const StatusDot = styled.div<{ color: string }>`
281
+ const StatusDot = styled.div<{ $color: string }>`
275
282
  display: inline-block;
276
283
  width: var(--tag-badge-size);
277
284
  height: var(--tag-badge-size);
278
285
  border: var(--tag-badge-border-width) solid var(--tag-badge-border-color);
279
286
  border-radius: 50%;
280
- background-color: ${({ color }) => color};
287
+ background-color: ${({ $color }) => $color};
281
288
  `;
282
289
 
283
290
  const ActiveIcon = styled(CheckmarkFilledIcon)`
@@ -76,7 +76,7 @@ function TooltipComponent({
76
76
  {...controllers}
77
77
  className={`tooltip-${className}`}
78
78
  data-component-name="Tooltip/Tooltip"
79
- anchorName={anchorName}
79
+ $anchorName={anchorName}
80
80
  >
81
81
  {children}
82
82
  {isOpened && !disabled && (
@@ -84,15 +84,15 @@ function TooltipComponent({
84
84
  <TooltipBody
85
85
  ref={tooltipBodyRef}
86
86
  data-testid={dataTestId || (typeof tip === 'string' ? tip : '')}
87
- placement={activePlacement}
88
- width={width}
89
- withArrow={withArrow}
90
- arrowPosition={
87
+ $placement={activePlacement}
88
+ $width={width}
89
+ $withArrow={withArrow}
90
+ $arrowPosition={
91
91
  activeArrowPosition === 'left' || activeArrowPosition === 'right'
92
92
  ? activeArrowPosition
93
93
  : 'center'
94
94
  }
95
- anchorName={anchorName}
95
+ $anchorName={anchorName}
96
96
  >
97
97
  {tip}
98
98
  </TooltipBody>
@@ -104,16 +104,21 @@ function TooltipComponent({
104
104
 
105
105
  export const Tooltip = memo<PropsWithChildren<Props>>(TooltipComponent);
106
106
 
107
+ type TooltipBodyStyleProps = {
108
+ $withArrow?: boolean;
109
+ $arrowPosition?: 'left' | 'right' | 'center';
110
+ };
111
+
107
112
  const PLACEMENTS = {
108
- top: css<Pick<Props, 'withArrow' | 'arrowPosition'>>`
113
+ top: css<TooltipBodyStyleProps>`
109
114
  bottom: anchor(top);
110
- ${({ withArrow, arrowPosition }) =>
111
- withArrow && arrowPosition === 'left'
115
+ ${({ $withArrow, $arrowPosition }) =>
116
+ $withArrow && $arrowPosition === 'left'
112
117
  ? css`
113
118
  transform: translate(-32px, -6px);
114
119
  left: anchor(center);
115
120
  `
116
- : arrowPosition === 'right'
121
+ : $arrowPosition === 'right'
117
122
  ? css`
118
123
  transform: translate(32px, -6px);
119
124
  right: anchor(center);
@@ -123,8 +128,8 @@ const PLACEMENTS = {
123
128
  left: anchor(center);
124
129
  `}
125
130
 
126
- ${({ withArrow, arrowPosition }) =>
127
- withArrow &&
131
+ ${({ $withArrow, $arrowPosition }) =>
132
+ $withArrow &&
128
133
  css`
129
134
  &::after {
130
135
  border-left: 14px solid transparent;
@@ -133,21 +138,21 @@ const PLACEMENTS = {
133
138
  border-top-style: solid;
134
139
  border-radius: 2px;
135
140
  bottom: 0;
136
- ${arrowPosition === 'left' && 'left: 16px; transform: translateY(100%);'}
137
- ${arrowPosition === 'center' && 'left: 50%; transform: translate(-50%, 100%);'}
138
- ${arrowPosition === 'right' && 'right: 16px; transform: translateY(100%);'}
141
+ ${$arrowPosition === 'left' && 'left: 16px; transform: translateY(100%);'}
142
+ ${$arrowPosition === 'center' && 'left: 50%; transform: translate(-50%, 100%);'}
143
+ ${$arrowPosition === 'right' && 'right: 16px; transform: translateY(100%);'}
139
144
  }
140
145
  `}
141
146
  `,
142
- bottom: css<Pick<Props, 'withArrow' | 'arrowPosition'>>`
147
+ bottom: css<TooltipBodyStyleProps>`
143
148
  top: anchor(bottom);
144
- ${({ withArrow, arrowPosition }) =>
145
- withArrow && arrowPosition === 'left'
149
+ ${({ $withArrow, $arrowPosition }) =>
150
+ $withArrow && $arrowPosition === 'left'
146
151
  ? css`
147
152
  transform: translate(-32px, 6px);
148
153
  left: anchor(center);
149
154
  `
150
- : arrowPosition === 'right'
155
+ : $arrowPosition === 'right'
151
156
  ? css`
152
157
  transform: translate(32px, 6px);
153
158
  right: anchor(center);
@@ -157,8 +162,8 @@ const PLACEMENTS = {
157
162
  left: anchor(center);
158
163
  `}
159
164
 
160
- ${({ withArrow, arrowPosition }) =>
161
- withArrow &&
165
+ ${({ $withArrow, $arrowPosition }) =>
166
+ $withArrow &&
162
167
  css`
163
168
  &::after {
164
169
  border-left: 14px solid transparent;
@@ -167,20 +172,20 @@ const PLACEMENTS = {
167
172
  border-bottom-style: solid;
168
173
  border-radius: 0 0 2px 2px;
169
174
  top: 0;
170
- ${arrowPosition === 'left' && 'left: 16px; transform: translateY(-100%);'}
171
- ${arrowPosition === 'center' && 'left: 50%; transform: translate(-50%, -100%);'}
172
- ${arrowPosition === 'right' && 'right: 16px; transform: translateY(-100%);'}
175
+ ${$arrowPosition === 'left' && 'left: 16px; transform: translateY(-100%);'}
176
+ ${$arrowPosition === 'center' && 'left: 50%; transform: translate(-50%, -100%);'}
177
+ ${$arrowPosition === 'right' && 'right: 16px; transform: translateY(-100%);'}
173
178
  }
174
179
  `}
175
180
  `,
176
- left: css<Pick<Props, 'withArrow' | 'arrowPosition'>>`
181
+ left: css<TooltipBodyStyleProps>`
177
182
  transform: translate(-100%, -50%);
178
183
  margin-left: -7px;
179
184
  top: anchor(center);
180
185
  left: anchor(left);
181
186
 
182
- ${({ withArrow }) =>
183
- withArrow &&
187
+ ${({ $withArrow }) =>
188
+ $withArrow &&
184
189
  css`
185
190
  &::after {
186
191
  border-top: 14px solid transparent;
@@ -194,14 +199,14 @@ const PLACEMENTS = {
194
199
  }
195
200
  `}
196
201
  `,
197
- right: css<Pick<Props, 'withArrow' | 'arrowPosition'>>`
202
+ right: css<TooltipBodyStyleProps>`
198
203
  transform: translate(0, -50%);
199
204
  margin-left: 7px;
200
205
  top: anchor(center);
201
206
  left: anchor(right);
202
207
 
203
- ${({ withArrow }) =>
204
- withArrow &&
208
+ ${({ $withArrow }) =>
209
+ $withArrow &&
205
210
  css`
206
211
  &::after {
207
212
  border-top: 14px solid transparent;
@@ -217,22 +222,23 @@ const PLACEMENTS = {
217
222
  `,
218
223
  };
219
224
 
220
- const TooltipWrapper = styled.div.attrs<{ anchorName: string }>(({ anchorName }) => ({
225
+ const TooltipWrapper = styled.div.attrs<{ $anchorName: string }>(({ $anchorName }) => ({
221
226
  style: {
222
- anchorName: anchorName,
227
+ anchorName: $anchorName,
223
228
  } as React.CSSProperties,
224
- }))<{ anchorName: string }>`
229
+ }))<{ $anchorName: string }>`
225
230
  display: flex;
226
231
  `;
227
232
 
228
- const TooltipBody = styled.span.attrs<{ anchorName: string }>(({ anchorName }) => ({
233
+ const TooltipBody = styled.span.attrs<{ $anchorName: string }>(({ $anchorName }) => ({
229
234
  style: {
230
- positionAnchor: anchorName,
235
+ positionAnchor: $anchorName,
231
236
  } as React.CSSProperties,
232
237
  }))<
233
- Pick<Required<Props>, 'placement' | 'withArrow' | 'arrowPosition'> & {
234
- width?: string;
235
- anchorName: string;
238
+ TooltipBodyStyleProps & {
239
+ $placement: Props['placement'];
240
+ $width?: string;
241
+ $anchorName: string;
236
242
  }
237
243
  >`
238
244
  position: fixed;
@@ -268,9 +274,11 @@ const TooltipBody = styled.span.attrs<{ anchorName: string }>(({ anchorName }) =
268
274
  var(--tooltip-border-color, transparent);
269
275
  box-shadow: var(--bg-raised-shadow);
270
276
 
271
- width: ${({ width }) => width || 'max-content'};
277
+ width: ${({ $width }) => $width || 'max-content'};
272
278
 
273
- ${({ placement }) => css`
274
- ${PLACEMENTS[placement]};
275
- `}
279
+ ${({ $placement }) =>
280
+ $placement &&
281
+ css`
282
+ ${PLACEMENTS[$placement]};
283
+ `}
276
284
  `;
@@ -105,10 +105,10 @@ function TooltipComponent({
105
105
  <TooltipBody
106
106
  ref={tooltipBodyRef}
107
107
  data-testid={dataTestId || (typeof tip === 'string' ? tip : '')}
108
- placement={activePlacement}
109
- width={width}
110
- withArrow={withArrow}
111
- arrowPosition={activeArrowPosition}
108
+ $placement={activePlacement}
109
+ $width={width}
110
+ $withArrow={withArrow}
111
+ $arrowPosition={activeArrowPosition}
112
112
  style={{
113
113
  position: 'fixed',
114
114
  top: tooltipPosition.top,
@@ -240,15 +240,16 @@ const TooltipWrapper = styled.div`
240
240
  position: relative;
241
241
  display: flex;
242
242
  `;
243
- const TooltipBody = styled.span<
244
- Pick<Required<TooltipProps>, 'placement' | 'withArrow' | 'arrowPosition'> & {
245
- width?: string;
246
- }
247
- >`
243
+ const TooltipBody = styled.span<{
244
+ $placement: NonNullable<TooltipProps['placement']>;
245
+ $withArrow: boolean;
246
+ $arrowPosition: NonNullable<TooltipProps['arrowPosition']>;
247
+ $width?: string;
248
+ }>`
248
249
  display: inline-block;
249
250
 
250
251
  padding: var(--tooltip-padding);
251
- max-width: ${({ width }) => width || 'var(--tooltip-max-width)'};
252
+ max-width: ${({ $width }) => $width || 'var(--tooltip-max-width)'};
252
253
  white-space: normal;
253
254
  word-break: normal;
254
255
  overflow-wrap: break-word;
@@ -277,8 +278,8 @@ const TooltipBody = styled.span<
277
278
  var(--tooltip-border-color, transparent);
278
279
  box-shadow: var(--bg-raised-shadow);
279
280
 
280
- width: ${({ width }) => width || 'max-content'};
281
- ${({ placement }) => css`
282
- ${PLACEMENTS[placement]};
281
+ width: ${({ $width }) => $width || 'max-content'};
282
+ ${({ $placement }) => css`
283
+ ${PLACEMENTS[$placement]};
283
284
  `}
284
285
  `;
@@ -3,11 +3,11 @@ import styled from 'styled-components';
3
3
  import { Typography } from '@redocly/theme/components/Typography/Typography';
4
4
 
5
5
  export const CompactTypography = styled(Typography).attrs<{
6
- mt: string;
7
- mb: string;
6
+ marginBottom: string;
7
+ marginTop: string;
8
8
  'data-component-name': string;
9
9
  }>({
10
- mt: '0em',
11
- mb: '0em',
10
+ marginBottom: '0em',
11
+ marginTop: '0em',
12
12
  'data-component-name': 'Typography/CompactTypography',
13
13
  })``;