@redocly/theme 0.53.0-next.1 → 0.53.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 (47) hide show
  1. package/lib/components/CodeBlock/CodeBlockControls.js +9 -6
  2. package/lib/components/Footer/FooterColumn.js +5 -3
  3. package/lib/components/Footer/FooterItem.d.ts +2 -1
  4. package/lib/components/Footer/FooterItem.js +2 -2
  5. package/lib/components/JsonViewer/JsonViewer.d.ts +1 -0
  6. package/lib/components/JsonViewer/JsonViewer.js +12 -10
  7. package/lib/components/Menu/MenuItem.js +2 -2
  8. package/lib/components/Panel/variables.js +1 -0
  9. package/lib/components/SidebarActions/SidebarActions.d.ts +2 -2
  10. package/lib/components/SidebarActions/SidebarActions.js +2 -2
  11. package/lib/components/Tag/Tag.d.ts +3 -1
  12. package/lib/components/Tag/variables.dark.js +13 -0
  13. package/lib/components/Tag/variables.js +59 -0
  14. package/lib/components/Tooltip/TooltipWrapper.d.ts +12 -0
  15. package/lib/components/Tooltip/TooltipWrapper.js +36 -0
  16. package/lib/core/types/hooks.d.ts +1 -1
  17. package/lib/core/types/l10n.d.ts +1 -1
  18. package/lib/icons/ArrowDownIcon/ArrowDownIcon.d.ts +9 -0
  19. package/lib/icons/ArrowDownIcon/ArrowDownIcon.js +22 -0
  20. package/lib/icons/CurveAutoColonIcon/CurveAutoColonIcon.d.ts +9 -0
  21. package/lib/icons/CurveAutoColonIcon/CurveAutoColonIcon.js +22 -0
  22. package/lib/icons/KafkaIcon/KafkaIcon.d.ts +9 -0
  23. package/lib/icons/KafkaIcon/KafkaIcon.js +26 -0
  24. package/lib/icons/__tests__/IconTestUtils.js +18 -3
  25. package/lib/index.d.ts +3 -0
  26. package/lib/index.js +3 -0
  27. package/package.json +3 -2
  28. package/src/components/CodeBlock/CodeBlockControls.tsx +27 -22
  29. package/src/components/Footer/FooterColumn.tsx +15 -12
  30. package/src/components/Footer/FooterItem.tsx +8 -3
  31. package/src/components/JsonViewer/JsonViewer.tsx +15 -9
  32. package/src/components/Menu/MenuItem.tsx +2 -2
  33. package/src/components/Panel/variables.ts +1 -0
  34. package/src/components/SidebarActions/SidebarActions.tsx +3 -3
  35. package/src/components/Tag/Tag.tsx +4 -0
  36. package/src/components/Tag/variables.dark.ts +13 -0
  37. package/src/components/Tag/variables.ts +59 -0
  38. package/src/components/Tooltip/TooltipWrapper.tsx +71 -0
  39. package/src/core/styles/dark.ts +1 -0
  40. package/src/core/styles/global.ts +1 -0
  41. package/src/core/types/hooks.ts +6 -1
  42. package/src/core/types/l10n.ts +2 -0
  43. package/src/icons/ArrowDownIcon/ArrowDownIcon.tsx +33 -0
  44. package/src/icons/CurveAutoColonIcon/CurveAutoColonIcon.tsx +26 -0
  45. package/src/icons/KafkaIcon/KafkaIcon.tsx +33 -0
  46. package/src/icons/__tests__/IconTestUtils.tsx +26 -4
  47. package/src/index.ts +3 -0
@@ -10,7 +10,14 @@ export function testIconComponent(IconComponent: React.ComponentType<any>, compo
10
10
  const { container } = render(<IconComponent />);
11
11
  const svgElement = container.querySelector('svg');
12
12
  expect(svgElement).toBeInTheDocument();
13
- expect(container.firstChild).toHaveStyle('height: 16px; width: 16px;');
13
+
14
+ // Check if styles are applied either via style attribute or CSS class
15
+ const element = container.firstChild as HTMLElement | SVGElement;
16
+ const hasStyleAttr = element.style.height === '16px' && element.style.width === '16px';
17
+ const elementClass = element.getAttribute('class') || '';
18
+ const hasClassName = elementClass.includes('sc-'); // styled-components class
19
+
20
+ expect(hasStyleAttr || hasClassName).toBeTruthy();
14
21
  },
15
22
 
16
23
  appliesCustomSizeAndColor: () => {
@@ -18,9 +25,24 @@ export function testIconComponent(IconComponent: React.ComponentType<any>, compo
18
25
 
19
26
  const svgElement = container.querySelector('svg');
20
27
  expect(svgElement).toBeInTheDocument();
21
- expect(container.firstChild).toHaveStyle('height: 24px; width: 24px;');
22
- const pathElement = container.querySelector('path');
23
- expect(pathElement).toHaveStyle('fill: var(--color-primary);');
28
+
29
+ const element = container.firstChild as HTMLElement | SVGElement;
30
+ const pathElement = container.querySelector('path') as SVGPathElement;
31
+
32
+ // Check if size styles are applied either via style attribute or CSS class
33
+ const hasSizeStyle = element.style.height === '24px' && element.style.width === '24px';
34
+ const elementClass = element.getAttribute('class') || '';
35
+ const hasClassName = elementClass.includes('sc-'); // styled-components class
36
+
37
+ expect(hasSizeStyle || hasClassName).toBeTruthy();
38
+
39
+ // Check if color is applied either via style attribute or CSS class
40
+ const hasColorStyle =
41
+ pathElement.getAttribute('style')?.includes('fill: var(--color-primary)') ||
42
+ pathElement.getAttribute('fill') === 'var(--color-primary)' ||
43
+ elementClass.includes('sc-'); // check styled-components class on the root element
44
+
45
+ expect(hasColorStyle).toBeTruthy();
24
46
  },
25
47
 
26
48
  hasCorrectDataComponentName: () => {
package/src/index.ts CHANGED
@@ -143,6 +143,7 @@ export * from '@redocly/theme/components/Search/FilterFields/SearchFilterFieldSe
143
143
  export * from '@redocly/theme/components/Search/FilterFields/SearchFilterFieldTags';
144
144
  export * from '@redocly/theme/components/Search/SearchAiResponse';
145
145
  /* Icons */
146
+ export * from '@redocly/theme/icons/ArrowDownIcon/ArrowDownIcon';
146
147
  export * from '@redocly/theme/icons/ArrowRightIcon/ArrowRightIcon';
147
148
  export * from '@redocly/theme/icons/ArrowUpRightIcon/ArrowUpRightIcon';
148
149
  export * from '@redocly/theme/icons/ArrowLeftIcon/ArrowLeftIcon';
@@ -247,6 +248,8 @@ export * from '@redocly/theme/icons/ErrorFilledIcon/ErrorFilledIcon';
247
248
  export * from '@redocly/theme/icons/CheckboxFilledIcon/CheckboxFilledIcon';
248
249
  export * from '@redocly/theme/icons/WarningAltFilled/WarningAltFilled';
249
250
  export * from '@redocly/theme/icons/SettingsCogIcon/SettingsCogIcon';
251
+ export * from '@redocly/theme/icons/KafkaIcon/KafkaIcon';
252
+ export * from '@redocly/theme/icons/CurveAutoColonIcon/CurveAutoColonIcon';
250
253
  /* Layouts */
251
254
  export * from '@redocly/theme/layouts/RootLayout';
252
255
  export * from '@redocly/theme/layouts/PageLayout';