@redocly/theme 0.64.0-next.0 → 0.64.0-next.2

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 (143) hide show
  1. package/lib/components/Banner/Banner.js +3 -3
  2. package/lib/components/Catalog/CatalogActionsRow.d.ts +3 -3
  3. package/lib/components/Catalog/CatalogCardView/CatalogCard.js +4 -6
  4. package/lib/components/Catalog/CatalogEntities.d.ts +2 -2
  5. package/lib/components/Catalog/CatalogEntities.js +1 -1
  6. package/lib/components/Catalog/CatalogEntity/CatalogEntity.d.ts +1 -8
  7. package/lib/components/Catalog/CatalogEntity/CatalogEntityMetadata.js +1 -1
  8. package/lib/components/Catalog/CatalogEntity/CatalogEntityMethodAndPath.js +1 -1
  9. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.js +1 -0
  10. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.js +2 -1
  11. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/ContactProperty.js +2 -6
  12. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty.js +5 -5
  13. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/FormatProperty.js +1 -1
  14. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/OwnersProperty.js +15 -7
  15. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/TagsProperty.js +2 -2
  16. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations.d.ts +3 -3
  17. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations.js +4 -1
  18. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.d.ts +3 -3
  19. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.js +14 -2
  20. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.js +1 -1
  21. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.d.ts +3 -3
  22. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.js +1 -1
  23. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTableContent.d.ts +2 -2
  24. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.d.ts +3 -3
  25. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.js +13 -3
  26. package/lib/components/Catalog/CatalogEntity/CatalogEntitySchema.js +4 -3
  27. package/lib/components/Catalog/CatalogEntityTypeIcon.d.ts +3 -2
  28. package/lib/components/Catalog/CatalogEntityTypeIcon.js +9 -9
  29. package/lib/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBar.d.ts +2 -3
  30. package/lib/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBarControls.d.ts +2 -3
  31. package/lib/components/Catalog/CatalogPageDescription.js +1 -1
  32. package/lib/components/Catalog/CatalogSortButton.d.ts +4 -5
  33. package/lib/components/Catalog/CatalogTableView/CatalogDomainsCell.js +6 -2
  34. package/lib/components/Catalog/CatalogTableView/CatalogEntityCell.js +2 -2
  35. package/lib/components/Catalog/CatalogTableView/CatalogLastUpdateCell.d.ts +5 -0
  36. package/lib/components/Catalog/CatalogTableView/CatalogLastUpdateCell.js +45 -0
  37. package/lib/components/Catalog/CatalogTableView/CatalogOwnersCell.js +5 -3
  38. package/lib/components/Catalog/CatalogTableView/CatalogTableHeaderCell.d.ts +2 -3
  39. package/lib/components/Catalog/CatalogTableView/CatalogTableHeaderCell.js +3 -2
  40. package/lib/components/Catalog/CatalogTableView/CatalogTableView.d.ts +1 -2
  41. package/lib/components/Catalog/CatalogTableView/CatalogTableView.js +15 -5
  42. package/lib/components/Catalog/CatalogTableView/CatalogTagsCell.js +3 -2
  43. package/lib/components/Catalog/CatalogTableView/CatalogUserEntityCell.js +2 -2
  44. package/lib/components/Catalog/CatalogTags.d.ts +11 -0
  45. package/lib/components/Catalog/CatalogTags.js +62 -0
  46. package/lib/components/Catalog/variables.js +22 -14
  47. package/lib/components/Search/SearchDialog.js +118 -116
  48. package/lib/components/SvgViewer/variables.dark.js +1 -1
  49. package/lib/core/constants/catalog.d.ts +1 -1
  50. package/lib/core/constants/catalog.js +1 -1
  51. package/lib/core/hooks/catalog/use-catalog-entity-link.d.ts +8 -0
  52. package/lib/core/hooks/catalog/use-catalog-entity-link.js +42 -0
  53. package/lib/core/hooks/catalog/use-catalog-table-header-cell-actions.d.ts +2 -1
  54. package/lib/core/hooks/catalog/use-catalog-table-header-cell-actions.js +5 -3
  55. package/lib/core/hooks/index.d.ts +1 -0
  56. package/lib/core/hooks/index.js +1 -0
  57. package/lib/core/styles/dark.d.ts +3 -1
  58. package/lib/core/styles/dark.js +42 -31
  59. package/lib/core/styles/global.d.ts +6 -2
  60. package/lib/core/styles/global.js +54 -39
  61. package/lib/core/styles/palette.d.ts +6 -0
  62. package/lib/core/styles/palette.dark.d.ts +3 -0
  63. package/lib/core/styles/palette.dark.js +216 -0
  64. package/lib/core/styles/palette.js +179 -0
  65. package/lib/core/types/catalog.d.ts +23 -7
  66. package/lib/core/types/hooks.d.ts +6 -4
  67. package/lib/icons/ColorPaletteIcon/ColorPaletteIcon.d.ts +9 -0
  68. package/lib/icons/ColorPaletteIcon/ColorPaletteIcon.js +27 -0
  69. package/lib/icons/StopIcon/StopIcon.d.ts +9 -0
  70. package/lib/icons/StopIcon/StopIcon.js +22 -0
  71. package/lib/index.d.ts +3 -1
  72. package/lib/index.js +3 -1
  73. package/lib/markdoc/components/ExcalidrawDiagram/ExcalidrawDiagram.d.ts +7 -0
  74. package/lib/markdoc/components/ExcalidrawDiagram/ExcalidrawDiagram.js +95 -0
  75. package/lib/markdoc/components/ExcalidrawDiagram/variables.d.ts +1 -0
  76. package/lib/markdoc/components/ExcalidrawDiagram/variables.dark.d.ts +1 -0
  77. package/lib/markdoc/components/ExcalidrawDiagram/variables.dark.js +8 -0
  78. package/lib/markdoc/components/ExcalidrawDiagram/variables.js +15 -0
  79. package/lib/markdoc/components/Heading/Heading.js +2 -2
  80. package/lib/markdoc/components/Mermaid/Mermaid.js +2 -0
  81. package/lib/markdoc/components/default.d.ts +1 -0
  82. package/lib/markdoc/components/default.js +1 -0
  83. package/package.json +2 -2
  84. package/src/components/Banner/Banner.tsx +7 -7
  85. package/src/components/Catalog/CatalogActionsRow.tsx +3 -3
  86. package/src/components/Catalog/CatalogCardView/CatalogCard.tsx +4 -6
  87. package/src/components/Catalog/CatalogEntities.tsx +3 -3
  88. package/src/components/Catalog/CatalogEntity/CatalogEntity.tsx +3 -24
  89. package/src/components/Catalog/CatalogEntity/CatalogEntityMetadata.tsx +1 -1
  90. package/src/components/Catalog/CatalogEntity/CatalogEntityMethodAndPath.tsx +1 -1
  91. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.tsx +1 -0
  92. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.tsx +2 -1
  93. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/ContactProperty.tsx +8 -10
  94. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty.tsx +13 -8
  95. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/FormatProperty.tsx +1 -0
  96. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/OwnersProperty.tsx +27 -15
  97. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/TagsProperty.tsx +2 -2
  98. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations.tsx +9 -9
  99. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.tsx +17 -9
  100. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.tsx +1 -1
  101. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.tsx +4 -8
  102. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTableContent.tsx +2 -2
  103. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.tsx +16 -10
  104. package/src/components/Catalog/CatalogEntity/CatalogEntitySchema.tsx +4 -3
  105. package/src/components/Catalog/CatalogEntityTypeIcon.tsx +18 -11
  106. package/src/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBar.tsx +3 -3
  107. package/src/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBarControls.tsx +2 -3
  108. package/src/components/Catalog/CatalogPageDescription.tsx +1 -1
  109. package/src/components/Catalog/CatalogSortButton.tsx +5 -6
  110. package/src/components/Catalog/CatalogTableView/CatalogDomainsCell.tsx +6 -2
  111. package/src/components/Catalog/CatalogTableView/CatalogEntityCell.tsx +2 -2
  112. package/src/components/Catalog/CatalogTableView/CatalogLastUpdateCell.tsx +54 -0
  113. package/src/components/Catalog/CatalogTableView/CatalogOwnersCell.tsx +5 -2
  114. package/src/components/Catalog/CatalogTableView/CatalogTableHeaderCell.tsx +4 -3
  115. package/src/components/Catalog/CatalogTableView/CatalogTableView.tsx +17 -7
  116. package/src/components/Catalog/CatalogTableView/CatalogTagsCell.tsx +3 -2
  117. package/src/components/Catalog/CatalogTableView/CatalogUserEntityCell.tsx +2 -2
  118. package/src/components/Catalog/CatalogTags.tsx +115 -0
  119. package/src/components/Catalog/variables.ts +22 -14
  120. package/src/components/Search/SearchDialog.tsx +299 -293
  121. package/src/components/SvgViewer/variables.dark.ts +1 -1
  122. package/src/core/constants/catalog.ts +1 -1
  123. package/src/core/hooks/catalog/use-catalog-entity-link.ts +46 -0
  124. package/src/core/hooks/catalog/use-catalog-table-header-cell-actions.ts +10 -2
  125. package/src/core/hooks/index.ts +1 -0
  126. package/src/core/styles/dark.ts +14 -2
  127. package/src/core/styles/global.ts +28 -13
  128. package/src/core/styles/palette.dark.ts +214 -0
  129. package/src/core/styles/palette.ts +177 -0
  130. package/src/core/types/catalog.ts +24 -8
  131. package/src/core/types/hooks.ts +5 -10
  132. package/src/icons/ColorPaletteIcon/ColorPaletteIcon.tsx +28 -0
  133. package/src/icons/StopIcon/StopIcon.tsx +23 -0
  134. package/src/index.ts +3 -1
  135. package/src/markdoc/components/ExcalidrawDiagram/ExcalidrawDiagram.tsx +85 -0
  136. package/src/markdoc/components/ExcalidrawDiagram/variables.dark.ts +5 -0
  137. package/src/markdoc/components/ExcalidrawDiagram/variables.ts +12 -0
  138. package/src/markdoc/components/Heading/Heading.tsx +2 -1
  139. package/src/markdoc/components/Mermaid/Mermaid.tsx +2 -0
  140. package/src/markdoc/components/default.ts +1 -0
  141. package/lib/components/Catalog/CatalogTagsWithTooltip.d.ts +0 -10
  142. package/lib/components/Catalog/CatalogTagsWithTooltip.js +0 -57
  143. package/src/components/Catalog/CatalogTagsWithTooltip.tsx +0 -101
@@ -1,11 +1,6 @@
1
+ import type { ResolvedBannerConfig } from '@redocly/config';
1
2
  import type { AsyncApiRealmUI } from '@redocly/realm-asyncapi-sdk';
2
- import type {
3
- BannerConfig,
4
- PageData,
5
- PageProps,
6
- ResolvedNavItemWithLink,
7
- Version,
8
- } from '@redocly/config';
3
+ import type { PageData, PageProps, ResolvedNavItemWithLink, Version } from '@redocly/config';
9
4
  import type { ShikiTransformer } from '@shikijs/types';
10
5
  import type { Callback, TFunction as TFunc } from 'i18next';
11
6
  import type { To, Location, NavigateFunction } from 'react-router-dom';
@@ -19,7 +14,6 @@ import type {
19
14
  UseCatalogProps,
20
15
  CatalogApiParams,
21
16
  CatalogApiResults,
22
- SortOption,
23
17
  } from './catalog';
24
18
  import type { UserMenuData } from './user-menu';
25
19
  import type { ItemState } from './sidebar';
@@ -91,7 +85,7 @@ export type ThemeHooks = {
91
85
  currentItemSiblings?: BreadcrumbItem[];
92
86
  };
93
87
  useBanner: () => {
94
- banner: BannerConfig | undefined;
88
+ banner: ResolvedBannerConfig | undefined;
95
89
  dismissBanner: (content: string) => void;
96
90
  };
97
91
  useSearch: (
@@ -140,6 +134,7 @@ export type ThemeHooks = {
140
134
  contentSegments: ContentSegment[];
141
135
  };
142
136
  useMarkdownText: (text: string) => React.ReactNode;
137
+ useMarkdocRenderer: (ast: unknown) => React.ReactNode;
143
138
  useFacetQuery: (field: string) => {
144
139
  searchFacet: SearchFacet | null;
145
140
  setSearchFacet: React.Dispatch<React.SetStateAction<SearchFacet | null>>;
@@ -165,7 +160,7 @@ export type ThemeHooks = {
165
160
  }
166
161
  | undefined;
167
162
  useCatalog: (props?: UseCatalogProps) => UseCatalogResponse;
168
- useCatalogSort: (defaultSortOption?: SortOption | null) => UseCatalogSortResponse;
163
+ useCatalogSort: (defaultSortOption?: string | null) => UseCatalogSortResponse;
169
164
  useCatalogSearch: () => UseCatalogSearchResponse;
170
165
  useFetchCatalogEntities: (
171
166
  params: CatalogApiParams,
@@ -0,0 +1,28 @@
1
+ import React from 'react';
2
+ import styled from 'styled-components';
3
+
4
+ import type { IconProps } from '@redocly/theme/icons/types';
5
+
6
+ import { getCssColorVariable } from '@redocly/theme/core/utils';
7
+
8
+ const Icon = (props: IconProps) => (
9
+ <svg viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
10
+ <path d="M3.5 5.25456C3.98325 5.25456 4.375 4.86281 4.375 4.37956C4.375 3.89631 3.98325 3.50456 3.5 3.50456C3.01675 3.50456 2.625 3.89631 2.625 4.37956C2.625 4.86281 3.01675 5.25456 3.5 5.25456Z" />
11
+ <path d="M6.125 3.94206C6.60825 3.94206 7 3.55031 7 3.06706C7 2.58381 6.60825 2.19206 6.125 2.19206C5.64175 2.19206 5.25 2.58381 5.25 3.06706C5.25 3.55031 5.64175 3.94206 6.125 3.94206Z" />
12
+ <path d="M8.75 5.25456C9.23325 5.25456 9.625 4.86281 9.625 4.37956C9.625 3.89631 9.23325 3.50456 8.75 3.50456C8.26675 3.50456 7.875 3.89631 7.875 4.37956C7.875 4.86281 8.26675 5.25456 8.75 5.25456Z" />
13
+ <path d="M9.1875 7.87956C9.67075 7.87956 10.0625 7.48781 10.0625 7.00456C10.0625 6.52131 9.67075 6.12956 9.1875 6.12956C8.70425 6.12956 8.3125 6.52131 8.3125 7.00456C8.3125 7.48781 8.70425 7.87956 9.1875 7.87956Z" />
14
+ <path d="M7.4375 10.0671C7.92075 10.0671 8.3125 9.67531 8.3125 9.19206C8.3125 8.70881 7.92075 8.31706 7.4375 8.31706C6.95425 8.31706 6.5625 8.70881 6.5625 9.19206C6.5625 9.67531 6.95425 10.0671 7.4375 10.0671Z" />
15
+ <path d="M6.36125 0.00455826C5.53725 -0.0272487 4.7153 0.107661 3.9447 0.401198C3.17409 0.694735 2.4707 1.14086 1.87668 1.71281C1.28266 2.28477 0.810249 2.97079 0.487771 3.72974C0.165293 4.48869 -0.000611956 5.30494 1.69613e-06 6.12956C-2.00107e-05 6.45389 0.074769 6.77385 0.218553 7.06457C0.362337 7.35528 0.57124 7.60891 0.829017 7.80574C1.08679 8.00256 1.3865 8.13728 1.70482 8.1994C2.02315 8.26153 2.35151 8.24939 2.66438 8.16393L3.15438 8.02831C3.3493 7.9751 3.55388 7.96761 3.75217 8.00643C3.95047 8.04526 4.13712 8.12934 4.29759 8.25212C4.45806 8.37491 4.58801 8.53309 4.67733 8.71433C4.76664 8.89558 4.8129 9.095 4.8125 9.29706V10.9421C4.8125 11.2902 4.95078 11.624 5.19692 11.8701C5.44307 12.1163 5.77691 12.2546 6.125 12.2546C6.94962 12.2552 7.76587 12.0893 8.52482 11.7668C9.28377 11.4443 9.96979 10.9719 10.5417 10.3779C11.1137 9.78386 11.5598 9.08046 11.8534 8.30986C12.1469 7.53926 12.2818 6.71731 12.25 5.89331C12.1865 4.35185 11.5457 2.89063 10.4548 1.79973C9.36393 0.708834 7.90271 0.0680368 6.36125 0.00455826ZM9.90938 9.76518C9.42087 10.2766 8.83352 10.6835 8.18297 10.961C7.53243 11.2385 6.83227 11.3809 6.125 11.3796C6.00897 11.3796 5.89769 11.3335 5.81564 11.2514C5.7336 11.1694 5.6875 11.0581 5.6875 10.9421V9.29706C5.6875 8.7169 5.45703 8.1605 5.0468 7.75026C4.63656 7.34003 4.08016 7.10956 3.5 7.10956C3.30341 7.10991 3.10774 7.13639 2.91813 7.18831L2.42813 7.32393C2.24511 7.37298 2.05326 7.37922 1.86744 7.34216C1.68163 7.3051 1.50685 7.22574 1.35665 7.11024C1.20645 6.99474 1.08488 6.84619 1.00135 6.67612C0.917824 6.50605 0.87459 6.31903 0.875002 6.12956C0.874459 5.42247 1.01676 4.72256 1.29336 4.07181C1.56996 3.42107 1.97517 2.83291 2.48466 2.34261C2.99416 1.85232 3.59745 1.47 4.25833 1.21859C4.91922 0.967181 5.62408 0.851864 6.33063 0.879558C7.64627 0.948081 8.8899 1.50154 9.82146 2.4331C10.753 3.36466 11.3065 4.60829 11.375 5.92393C11.4051 6.63092 11.2907 7.33662 11.0387 7.99785C10.7867 8.65908 10.4024 9.26195 9.90938 9.76956V9.76518Z" />
16
+ </svg>
17
+ );
18
+
19
+ export const ColorPaletteIcon = styled(Icon).attrs(() => ({
20
+ 'data-component-name': 'icons/ColorPaletteIcon/ColorPaletteIcon',
21
+ }))<IconProps>`
22
+ path {
23
+ fill: ${({ color }) => getCssColorVariable(color)};
24
+ }
25
+
26
+ height: ${({ size }) => size || '16px'};
27
+ width: ${({ size }) => size || '16px'};
28
+ `;
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import styled from 'styled-components';
3
+
4
+ import type { IconProps } from '@redocly/theme/icons/types';
5
+
6
+ import { getCssColorVariable } from '@redocly/theme/core/utils';
7
+
8
+ const Icon = (props: IconProps) => (
9
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14" fill="none" {...props}>
10
+ <path d="M10.5 3.5V10.5H3.5V3.5H10.5ZM10.5 2.625H3.5C3.26794 2.625 3.04538 2.71719 2.88128 2.88128C2.71719 3.04538 2.625 3.26794 2.625 3.5V10.5C2.625 10.7321 2.71719 10.9546 2.88128 11.1187C3.04538 11.2828 3.26794 11.375 3.5 11.375H10.5C10.7321 11.375 10.9546 11.2828 11.1187 11.1187C11.2828 10.9546 11.375 10.7321 11.375 10.5V3.5C11.375 3.26794 11.2828 3.04538 11.1187 2.88128C10.9546 2.71719 10.7321 2.625 10.5 2.625Z" />
11
+ </svg>
12
+ );
13
+
14
+ export const StopIcon = styled(Icon).attrs(() => ({
15
+ 'data-component-name': 'icons/StopIcon/StopIcon',
16
+ }))<IconProps>`
17
+ path {
18
+ fill: ${({ color }) => getCssColorVariable(color)};
19
+ }
20
+
21
+ height: ${({ size }) => size || '16px'};
22
+ width: ${({ size }) => size || '16px'};
23
+ `;
package/src/index.ts CHANGED
@@ -136,7 +136,7 @@ export * from '@redocly/theme/components/Catalog/CatalogTableView/CatalogTableHe
136
136
  export * from '@redocly/theme/components/Catalog/CatalogTableView/CatalogTableView';
137
137
  export * from '@redocly/theme/components/Catalog/CatalogSelector';
138
138
  export * from '@redocly/theme/components/Catalog/CatalogSortButton';
139
- export * from '@redocly/theme/components/Catalog/CatalogTagsWithTooltip';
139
+ export * from '@redocly/theme/components/Catalog/CatalogTags';
140
140
  export * from '@redocly/theme/components/Catalog/CatalogViewModeToggle';
141
141
  export * from '@redocly/theme/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistoryButton';
142
142
  export * from '@redocly/theme/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistorySidebar';
@@ -274,6 +274,7 @@ export * from '@redocly/theme/icons/FileIcon/FileIcon';
274
274
  export * from '@redocly/theme/icons/ExportIcon/ExportIcon';
275
275
  export * from '@redocly/theme/icons/CertificateIcon/CertificateIcon';
276
276
  export * from '@redocly/theme/icons/PlayIcon/PlayIcon';
277
+ export * from '@redocly/theme/icons/StopIcon/StopIcon';
277
278
  export * from '@redocly/theme/icons/PlaylistIcon/PlaylistIcon';
278
279
  export * from '@redocly/theme/icons/WorkflowAutomationIcon/WorkflowAutomationIcon';
279
280
  export * from '@redocly/theme/icons/TaskViewIcon/TaskViewIcon';
@@ -296,6 +297,7 @@ export * from '@redocly/theme/icons/GenericIcon/GenericIcon';
296
297
  export * from '@redocly/theme/icons/ShareIcon/ShareIcon';
297
298
  export * from '@redocly/theme/icons/HashtagIcon/HashtagIcon';
298
299
  export * from '@redocly/theme/icons/FitToViewIcon/FitToViewIcon';
300
+ export * from '@redocly/theme/icons/ColorPaletteIcon/ColorPaletteIcon';
299
301
  /* Layouts */
300
302
  export * from '@redocly/theme/layouts/RootLayout';
301
303
  export * from '@redocly/theme/layouts/PageLayout';
@@ -0,0 +1,85 @@
1
+ import React, { useState } from 'react';
2
+ import styled from 'styled-components';
3
+
4
+ import type { JSX } from 'react';
5
+
6
+ import { concatClassNames } from '@redocly/theme/core/utils';
7
+ import { useThemeHooks } from '@redocly/theme/core/hooks';
8
+ import { SvgViewer } from '@redocly/theme/components/SvgViewer/SvgViewer';
9
+
10
+ type ExcalidrawDiagramProps = {
11
+ diagramHtml: string;
12
+ className?: string;
13
+ };
14
+
15
+ export function ExcalidrawDiagram({ diagramHtml, className }: ExcalidrawDiagramProps): JSX.Element {
16
+ const { useTranslate } = useThemeHooks();
17
+ const { translate } = useTranslate();
18
+ const [isOpen, setIsOpen] = useState(false);
19
+
20
+ const open = () => setIsOpen(true);
21
+ const close = () => setIsOpen(false);
22
+
23
+ return (
24
+ <>
25
+ <Wrapper
26
+ className={concatClassNames('excalidraw-wrapper', className)}
27
+ dangerouslySetInnerHTML={{ __html: diagramHtml }}
28
+ data-component-name="Markdoc/ExcalidrawDiagram/ExcalidrawDiagram"
29
+ onClick={open}
30
+ onKeyDown={(e) => (e.key === 'Enter' || e.key === ' ') && open()}
31
+ role="button"
32
+ tabIndex={0}
33
+ aria-label={translate('excalidraw.openFullscreen', 'Click to open diagram in fullscreen')}
34
+ />
35
+ <SvgViewer
36
+ isOpen={isOpen}
37
+ onClose={close}
38
+ labels={{
39
+ zoomIn: translate('excalidraw.zoomIn', 'Zoom in'),
40
+ zoomOut: translate('excalidraw.zoomOut', 'Zoom out'),
41
+ fitToView: translate('excalidraw.reset', 'Fit to view'),
42
+ close: translate('excalidraw.close', 'Close'),
43
+ dialogLabel: translate('excalidraw.viewer', 'Excalidraw diagram viewer'),
44
+ }}
45
+ >
46
+ <ViewerContent dangerouslySetInnerHTML={{ __html: diagramHtml }} />
47
+ </SvgViewer>
48
+ </>
49
+ );
50
+ }
51
+
52
+ const Wrapper = styled.div`
53
+ background-color: var(--excalidraw-bg-color);
54
+ border-radius: var(--excalidraw-border-radius);
55
+ cursor: pointer;
56
+ transition: box-shadow 0.2s ease;
57
+ overflow: hidden;
58
+
59
+ &:hover,
60
+ &:focus {
61
+ outline: none;
62
+ box-shadow: 0 0 0 2px var(--border-color-input-focus);
63
+ }
64
+
65
+ svg {
66
+ max-width: 100%;
67
+ height: auto;
68
+ display: block;
69
+
70
+ > rect {
71
+ fill: var(--excalidraw-bg-color);
72
+ }
73
+ }
74
+
75
+ & + & {
76
+ margin-top: var(--spacing-md);
77
+ }
78
+ `;
79
+
80
+ const ViewerContent = styled.div`
81
+ svg {
82
+ display: block;
83
+ max-width: none !important;
84
+ }
85
+ `;
@@ -0,0 +1,5 @@
1
+ import { css } from "styled-components";
2
+
3
+ export const excalidrawDarkMode = css`
4
+ --excalidraw-bg-color: var(--bg-color); // @presenter Color
5
+ `;
@@ -0,0 +1,12 @@
1
+ import { css } from "styled-components";
2
+
3
+ export const excalidraw = css`
4
+ /**
5
+ * @tokens Excalidraw
6
+ */
7
+
8
+ --excalidraw-bg-color: var(--bg-color); // @presenter Color
9
+ --excalidraw-border-radius: var(--border-radius-lg); // @presenter BorderRadius
10
+
11
+ // @tokens End
12
+ `;
@@ -64,7 +64,8 @@ export function Heading({
64
64
  const { usePageProps } = useThemeHooks();
65
65
  const pageProps = usePageProps();
66
66
 
67
- const isMarkdownPage = pageProps?.metadata?.type === 'markdown';
67
+ const isMarkdownPage =
68
+ pageProps?.metadata?.type === 'markdown' || pageProps?.metadata?.type === 'asciidoc';
68
69
 
69
70
  const linkEl = (
70
71
  <a
@@ -81,6 +81,8 @@ const Wrapper = styled.div`
81
81
  `;
82
82
 
83
83
  const ViewerContent = styled.div`
84
+ background-color: var(--mermaid-bg-color);
85
+
84
86
  * {
85
87
  font-family: var(--mermaid-font-family) !important;
86
88
  }
@@ -3,6 +3,7 @@ export * from '@redocly/theme/markdoc/components/InlineSvg/InlineSvg';
3
3
  export * from '@redocly/theme/markdoc/components/MarkdocExample/MarkdocExample';
4
4
  export * from '@redocly/theme/markdoc/components/Heading/Heading';
5
5
  export * from '@redocly/theme/markdoc/components/Mermaid/Mermaid';
6
+ export * from '@redocly/theme/markdoc/components/ExcalidrawDiagram/ExcalidrawDiagram';
6
7
  export * from '@redocly/theme/markdoc/components/HtmlBlock/HtmlBlock';
7
8
  export * from '@redocly/theme/markdoc/components/Tabs/Tab';
8
9
  export * from '@redocly/theme/markdoc/components/Tabs/TabList';
@@ -1,10 +0,0 @@
1
- import { JSX } from 'react';
2
- import { TagProps } from '../../components/Tag/Tag';
3
- export type CatalogTagsWithTooltipProps = {
4
- items: string[];
5
- itemsToShow?: number;
6
- showPlaceholder?: boolean;
7
- tagProps?: TagProps;
8
- showAvatars?: boolean;
9
- };
10
- export declare function CatalogTagsWithTooltip({ items, itemsToShow, showPlaceholder, showAvatars, tagProps, }: CatalogTagsWithTooltipProps): JSX.Element | null;
@@ -1,57 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.CatalogTagsWithTooltip = CatalogTagsWithTooltip;
7
- const react_1 = __importDefault(require("react"));
8
- const styled_components_1 = __importDefault(require("styled-components"));
9
- const constants_1 = require("../../core/constants");
10
- const Tag_1 = require("../../components/Tag/Tag");
11
- const Tooltip_1 = require("../../components/Tooltip/Tooltip");
12
- const CatalogHighlight_1 = require("../../components/Catalog/CatalogHighlight");
13
- const hooks_1 = require("../../core/hooks");
14
- const CatalogAvatar_1 = require("../../components/Catalog/CatalogAvatar");
15
- function CatalogTagsWithTooltip({ items, itemsToShow = 1, showPlaceholder = false, showAvatars, tagProps, }) {
16
- const { useTranslate } = (0, hooks_1.useThemeHooks)();
17
- const { translate } = useTranslate();
18
- if (!items || items.length === 0) {
19
- if (showPlaceholder) {
20
- return (react_1.default.createElement(CatalogTagsNotConnectedWrapper, { "data-component-name": "Catalog/CatalogTagsWithTooltip" }, translate('catalog.notConnected', 'Not connected')));
21
- }
22
- return null;
23
- }
24
- if (items.length <= itemsToShow) {
25
- return (react_1.default.createElement(CatalogTagsWrapper, { "data-component-name": "Catalog/CatalogTagsWithTooltip" }, items.map((item, index) => (react_1.default.createElement(Tag_1.Tag, Object.assign({ key: `${item}-${index}` }, tagProps, (showAvatars && {
26
- icon: react_1.default.createElement(CatalogAvatar_1.CatalogAvatar, { value: item, size: "small" }),
27
- }), { maxLength: constants_1.CATALOG_TAG_MAX_LENGTH }),
28
- react_1.default.createElement(CatalogHighlight_1.CatalogHighlight, null, item))))));
29
- }
30
- const displayedItems = items.slice(0, itemsToShow);
31
- const remainingCount = items.length - itemsToShow;
32
- return (react_1.default.createElement(Tooltip_1.Tooltip, { tip: items.join(', '), placement: "bottom", className: "catalog", width: "400px" },
33
- react_1.default.createElement(CatalogTagsWrapper, { "data-component-name": "Catalog/CatalogTagsWithTooltip" },
34
- displayedItems.map((item, index) => (react_1.default.createElement(Tag_1.Tag, Object.assign({ key: `${item}-${index}` }, tagProps, (showAvatars && {
35
- icon: react_1.default.createElement(CatalogAvatar_1.CatalogAvatar, { value: item, size: "small" }),
36
- }), { textTransform: "none", maxLength: constants_1.CATALOG_TAG_MAX_LENGTH }),
37
- react_1.default.createElement(CatalogHighlight_1.CatalogHighlight, null, item)))),
38
- react_1.default.createElement(MoreTagsButton, null,
39
- "+",
40
- remainingCount,
41
- " ",
42
- translate('catalog.tags.more', 'more')))));
43
- }
44
- const CatalogTagsWrapper = styled_components_1.default.div `
45
- display: flex;
46
- flex-wrap: wrap;
47
- `;
48
- const MoreTagsButton = styled_components_1.default.span `
49
- font-size: var(--catalog-tags-more-button-font-size);
50
- margin-left: var(--catalog-tags-more-button-margin-left);
51
- `;
52
- const CatalogTagsNotConnectedWrapper = styled_components_1.default.span `
53
- font-size: var(--catalog-tags-not-connected-font-size);
54
- line-height: var(--catalog-tags-not-connected-line-height);
55
- color: var(--catalog-tags-not-connected-color);
56
- `;
57
- //# sourceMappingURL=CatalogTagsWithTooltip.js.map
@@ -1,101 +0,0 @@
1
- import React, { JSX } from 'react';
2
- import styled from 'styled-components';
3
-
4
- import { CATALOG_TAG_MAX_LENGTH } from '@redocly/theme/core/constants';
5
- import { Tag, TagProps } from '@redocly/theme/components/Tag/Tag';
6
- import { Tooltip } from '@redocly/theme/components/Tooltip/Tooltip';
7
- import { CatalogHighlight } from '@redocly/theme/components/Catalog/CatalogHighlight';
8
- import { useThemeHooks } from '@redocly/theme/core/hooks';
9
- import { CatalogAvatar } from '@redocly/theme/components/Catalog/CatalogAvatar';
10
-
11
- export type CatalogTagsWithTooltipProps = {
12
- items: string[];
13
- itemsToShow?: number;
14
- showPlaceholder?: boolean;
15
- tagProps?: TagProps;
16
- showAvatars?: boolean;
17
- };
18
-
19
- export function CatalogTagsWithTooltip({
20
- items,
21
- itemsToShow = 1,
22
- showPlaceholder = false,
23
- showAvatars,
24
- tagProps,
25
- }: CatalogTagsWithTooltipProps): JSX.Element | null {
26
- const { useTranslate } = useThemeHooks();
27
- const { translate } = useTranslate();
28
-
29
- if (!items || items.length === 0) {
30
- if (showPlaceholder) {
31
- return (
32
- <CatalogTagsNotConnectedWrapper data-component-name="Catalog/CatalogTagsWithTooltip">
33
- {translate('catalog.notConnected', 'Not connected')}
34
- </CatalogTagsNotConnectedWrapper>
35
- );
36
- }
37
- return null;
38
- }
39
-
40
- if (items.length <= itemsToShow) {
41
- return (
42
- <CatalogTagsWrapper data-component-name="Catalog/CatalogTagsWithTooltip">
43
- {items.map((item, index) => (
44
- <Tag
45
- key={`${item}-${index}`}
46
- {...tagProps}
47
- {...(showAvatars && {
48
- icon: <CatalogAvatar value={item} size="small" />,
49
- })}
50
- maxLength={CATALOG_TAG_MAX_LENGTH}
51
- >
52
- <CatalogHighlight>{item}</CatalogHighlight>
53
- </Tag>
54
- ))}
55
- </CatalogTagsWrapper>
56
- );
57
- }
58
-
59
- const displayedItems = items.slice(0, itemsToShow);
60
- const remainingCount = items.length - itemsToShow;
61
-
62
- return (
63
- <Tooltip tip={items.join(', ')} placement="bottom" className="catalog" width="400px">
64
- <CatalogTagsWrapper data-component-name="Catalog/CatalogTagsWithTooltip">
65
- {displayedItems.map((item, index) => (
66
- <Tag
67
- key={`${item}-${index}`}
68
- {...tagProps}
69
- {...(showAvatars && {
70
- icon: <CatalogAvatar value={item} size="small" />,
71
- })}
72
- textTransform="none"
73
- maxLength={CATALOG_TAG_MAX_LENGTH}
74
- >
75
- <CatalogHighlight>{item}</CatalogHighlight>
76
- </Tag>
77
- ))}
78
-
79
- <MoreTagsButton>
80
- +{remainingCount} {translate('catalog.tags.more', 'more')}
81
- </MoreTagsButton>
82
- </CatalogTagsWrapper>
83
- </Tooltip>
84
- );
85
- }
86
-
87
- const CatalogTagsWrapper = styled.div`
88
- display: flex;
89
- flex-wrap: wrap;
90
- `;
91
-
92
- const MoreTagsButton = styled.span`
93
- font-size: var(--catalog-tags-more-button-font-size);
94
- margin-left: var(--catalog-tags-more-button-margin-left);
95
- `;
96
-
97
- const CatalogTagsNotConnectedWrapper = styled.span`
98
- font-size: var(--catalog-tags-not-connected-font-size);
99
- line-height: var(--catalog-tags-not-connected-line-height);
100
- color: var(--catalog-tags-not-connected-color);
101
- `;