@redocly/theme 0.62.0-next.5 → 0.62.0-next.7

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 (66) hide show
  1. package/lib/components/Banner/Banner.js +19 -1
  2. package/lib/components/Banner/variables.js +1 -0
  3. package/lib/components/Breadcrumbs/Breadcrumb.js +1 -1
  4. package/lib/components/Breadcrumbs/BreadcrumbDropdown.js +9 -6
  5. package/lib/components/Breadcrumbs/Breadcrumbs.js +24 -15
  6. package/lib/components/Buttons/AIAssistantButton.js +6 -3
  7. package/lib/components/Catalog/CatalogEntities.js +10 -8
  8. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.js +13 -11
  9. package/lib/components/Catalog/CatalogEntity/CatalogEntitySchema.js +7 -5
  10. package/lib/components/Catalog/CatalogFilter/CatalogFilterCheckboxes.js +9 -7
  11. package/lib/components/Catalog/CatalogTagsWithTooltip.js +1 -1
  12. package/lib/components/CatalogClassic/CatalogClassicInfoBlock.js +1 -1
  13. package/lib/components/CodeBlock/CodeBlockControls.js +8 -6
  14. package/lib/components/Filter/FilterCheckboxes.js +1 -1
  15. package/lib/components/LanguagePicker/LanguagePicker.js +1 -1
  16. package/lib/components/Markdown/Markdown.js +2 -2
  17. package/lib/components/Menu/MenuItem.js +7 -4
  18. package/lib/components/Navbar/NavbarItem.js +1 -1
  19. package/lib/components/Search/SearchAiMessage.js +8 -5
  20. package/lib/components/Search/SearchDialog.js +37 -22
  21. package/lib/components/Tooltip/Tooltip.d.ts +2 -3
  22. package/lib/components/Tooltip/Tooltip.js +66 -113
  23. package/lib/components/Tooltip/variables.dark.js +4 -0
  24. package/lib/components/Tooltip/variables.js +3 -3
  25. package/lib/core/hooks/search/use-search-dialog.js +2 -2
  26. package/lib/core/hooks/use-color-switcher.js +3 -1
  27. package/lib/core/hooks/use-outside-click.d.ts +3 -1
  28. package/lib/core/hooks/use-outside-click.js +8 -4
  29. package/lib/core/hooks/use-page-actions.js +15 -5
  30. package/lib/core/hooks/use-product-picker.js +1 -1
  31. package/lib/markdoc/components/Cards/Card.js +1 -0
  32. package/lib/markdoc/components/Heading/Heading.js +34 -2
  33. package/package.json +4 -4
  34. package/src/components/Banner/Banner.tsx +23 -1
  35. package/src/components/Banner/variables.ts +1 -0
  36. package/src/components/Breadcrumbs/Breadcrumb.tsx +3 -3
  37. package/src/components/Breadcrumbs/BreadcrumbDropdown.tsx +11 -8
  38. package/src/components/Breadcrumbs/Breadcrumbs.tsx +24 -15
  39. package/src/components/Buttons/AIAssistantButton.tsx +6 -3
  40. package/src/components/Catalog/CatalogEntities.tsx +10 -8
  41. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.tsx +13 -11
  42. package/src/components/Catalog/CatalogEntity/CatalogEntitySchema.tsx +7 -5
  43. package/src/components/Catalog/CatalogFilter/CatalogFilterCheckboxes.tsx +9 -7
  44. package/src/components/Catalog/CatalogTagsWithTooltip.tsx +3 -3
  45. package/src/components/CatalogClassic/CatalogClassicInfoBlock.tsx +3 -1
  46. package/src/components/CodeBlock/CodeBlockControls.tsx +16 -10
  47. package/src/components/Filter/FilterCheckboxes.tsx +1 -1
  48. package/src/components/LanguagePicker/LanguagePicker.tsx +1 -1
  49. package/src/components/Markdown/Markdown.tsx +2 -2
  50. package/src/components/Menu/MenuItem.tsx +7 -4
  51. package/src/components/Navbar/NavbarItem.tsx +3 -1
  52. package/src/components/Search/SearchAiMessage.tsx +8 -5
  53. package/src/components/Search/SearchDialog.tsx +37 -22
  54. package/src/components/Tooltip/Tooltip.tsx +77 -120
  55. package/src/components/Tooltip/variables.dark.ts +4 -0
  56. package/src/components/Tooltip/variables.ts +3 -3
  57. package/src/core/hooks/search/use-search-dialog.ts +2 -2
  58. package/src/core/hooks/use-color-switcher.ts +3 -1
  59. package/src/core/hooks/use-outside-click.ts +16 -5
  60. package/src/core/hooks/use-page-actions.ts +30 -20
  61. package/src/core/hooks/use-product-picker.ts +1 -1
  62. package/src/markdoc/components/Cards/Card.tsx +1 -0
  63. package/src/markdoc/components/Heading/Heading.tsx +46 -4
  64. package/lib/components/Tooltip/TooltipWrapper.d.ts +0 -12
  65. package/lib/components/Tooltip/TooltipWrapper.js +0 -34
  66. package/src/components/Tooltip/TooltipWrapper.tsx +0 -70
@@ -1,70 +0,0 @@
1
- import styled from 'styled-components';
2
- import React from 'react';
3
-
4
- import type { JSX, ReactElement } from 'react';
5
- import type { TooltipProps } from '@redocly/theme/components/Tooltip/Tooltip';
6
-
7
- import { useControl } from '@redocly/theme/core/hooks';
8
- import { Tooltip } from '@redocly/theme/components/Tooltip/Tooltip';
9
-
10
- export type TooltipWrapperProps = {
11
- children: ReactElement;
12
- tip: string;
13
- placement?: TooltipProps['placement'];
14
- width?: string;
15
- className?: string;
16
- showOnHover?: boolean;
17
- disabled?: boolean;
18
- };
19
-
20
- export function TooltipWrapper({
21
- children,
22
- tip,
23
- placement = 'top',
24
- width = 'max-content',
25
- className = '',
26
- showOnHover = true,
27
- disabled = false,
28
- }: TooltipWrapperProps): JSX.Element {
29
- const tooltip = useControl(false);
30
-
31
- const handleMouseEnter = (): void => {
32
- if (showOnHover && !disabled) {
33
- tooltip.handleOpen();
34
- }
35
- };
36
-
37
- const handleMouseLeave = (): void => {
38
- if (showOnHover) {
39
- tooltip.handleClose();
40
- }
41
- };
42
-
43
- const handleClick = (): void => {
44
- if (showOnHover) {
45
- tooltip.handleClose();
46
- }
47
- };
48
-
49
- return (
50
- <Tooltip
51
- className={className}
52
- tip={tip}
53
- isOpen={tooltip.isOpened}
54
- placement={placement}
55
- width={width}
56
- >
57
- <TooltipEventWrapper
58
- onMouseEnter={handleMouseEnter}
59
- onMouseLeave={handleMouseLeave}
60
- onClick={handleClick}
61
- >
62
- {children}
63
- </TooltipEventWrapper>
64
- </Tooltip>
65
- );
66
- }
67
-
68
- const TooltipEventWrapper = styled.div`
69
- display: contents;
70
- `;