@redocly/theme 0.60.0-next.5 → 0.60.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 (65) hide show
  1. package/lib/components/Banner/Banner.d.ts +6 -0
  2. package/lib/components/Banner/Banner.js +172 -0
  3. package/lib/components/Banner/variables.d.ts +1 -0
  4. package/lib/components/Banner/variables.dark.d.ts +1 -0
  5. package/lib/components/Banner/variables.dark.js +12 -0
  6. package/lib/components/Banner/variables.js +45 -0
  7. package/lib/components/Breadcrumbs/BreadcrumbDropdown.d.ts +1 -1
  8. package/lib/components/Breadcrumbs/Breadcrumbs.d.ts +1 -1
  9. package/lib/components/Catalog/Catalog.d.ts +1 -1
  10. package/lib/components/Catalog/CatalogCardView/CatalogCard.d.ts +1 -1
  11. package/lib/components/Catalog/CatalogCardView/CatalogCardView.d.ts +2 -2
  12. package/lib/components/Catalog/CatalogEntities.d.ts +1 -1
  13. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations.d.ts +2 -2
  14. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.d.ts +2 -2
  15. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.d.ts +2 -2
  16. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.d.ts +2 -2
  17. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTableContent.d.ts +2 -2
  18. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.d.ts +2 -2
  19. package/lib/components/Catalog/CatalogEntityIcon.d.ts +1 -1
  20. package/lib/components/Catalog/CatalogTableView/CatalogTableView.d.ts +2 -2
  21. package/lib/components/Catalog/CatalogTableView/CatalogTableViewRow.d.ts +1 -1
  22. package/lib/components/LanguagePicker/LanguagePicker.js +1 -0
  23. package/lib/components/Navbar/Navbar.js +13 -5
  24. package/lib/components/Search/SearchAiConversationInput.js +1 -1
  25. package/lib/core/hooks/catalog/use-catalog-table-view-row.d.ts +1 -1
  26. package/lib/core/hooks/use-theme-hooks.js +1 -0
  27. package/lib/core/styles/dark.js +2 -0
  28. package/lib/core/styles/global.js +32 -30
  29. package/lib/core/types/catalog.d.ts +1 -1
  30. package/lib/core/types/hooks.d.ts +5 -1
  31. package/lib/core/utils/type-guards.d.ts +1 -1
  32. package/lib/index.d.ts +1 -0
  33. package/lib/index.js +2 -0
  34. package/package.json +7 -14
  35. package/src/components/Banner/Banner.tsx +179 -0
  36. package/src/components/Banner/variables.dark.ts +10 -0
  37. package/src/components/Banner/variables.ts +43 -0
  38. package/src/components/Breadcrumbs/BreadcrumbDropdown.tsx +1 -1
  39. package/src/components/Breadcrumbs/Breadcrumbs.tsx +1 -1
  40. package/src/components/Catalog/Catalog.tsx +2 -1
  41. package/src/components/Catalog/CatalogCardView/CatalogCard.tsx +2 -1
  42. package/src/components/Catalog/CatalogCardView/CatalogCardView.tsx +3 -2
  43. package/src/components/Catalog/CatalogEntities.tsx +2 -1
  44. package/src/components/Catalog/CatalogEntity/CatalogEntity.tsx +1 -1
  45. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations.tsx +7 -2
  46. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.tsx +6 -2
  47. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.tsx +3 -2
  48. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.tsx +6 -2
  49. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTableContent.tsx +2 -2
  50. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.tsx +7 -2
  51. package/src/components/Catalog/CatalogEntityIcon.tsx +2 -1
  52. package/src/components/Catalog/CatalogTableView/CatalogTableView.tsx +3 -2
  53. package/src/components/Catalog/CatalogTableView/CatalogTableViewRow.tsx +3 -2
  54. package/src/components/LanguagePicker/LanguagePicker.tsx +1 -0
  55. package/src/components/Navbar/Navbar.tsx +13 -5
  56. package/src/components/Search/SearchAiConversationInput.tsx +1 -1
  57. package/src/core/hooks/__mocks__/use-theme-hooks.ts +4 -0
  58. package/src/core/hooks/catalog/use-catalog-table-view-row.ts +1 -1
  59. package/src/core/hooks/use-theme-hooks.ts +1 -0
  60. package/src/core/styles/dark.ts +2 -0
  61. package/src/core/styles/global.ts +2 -0
  62. package/src/core/types/catalog.ts +1 -1
  63. package/src/core/types/hooks.ts +5 -0
  64. package/src/core/utils/type-guards.ts +1 -1
  65. package/src/index.ts +2 -0
@@ -26,6 +26,7 @@ import { menu, mobileMenu } from '@redocly/theme/components/Menu/variables';
26
26
  import { code } from '@redocly/theme/components/CodeBlock/variables';
27
27
  import { productPicker } from '@redocly/theme/components/Product/variables';
28
28
  import { markdown } from '@redocly/theme/components/Markdown/variables';
29
+ import { banner } from '@redocly/theme/components/Banner/variables';
29
30
  import { markdownTabs } from '@redocly/theme/markdoc/components/Tabs/variables';
30
31
  import { mermaid } from '@redocly/theme/markdoc/components/Mermaid/variables';
31
32
  import { lastUpdated } from '@redocly/theme/components/LastUpdated/variables';
@@ -1239,6 +1240,7 @@ export const styles = css`
1239
1240
  ${apiReferenceDocs}
1240
1241
  ${apiReferencePanels}
1241
1242
  ${badges}
1243
+ ${banner}
1242
1244
  ${borders}
1243
1245
  ${breadcrumbs}
1244
1246
  ${button}
@@ -1,7 +1,7 @@
1
1
  import { InfiniteData, UseInfiniteQueryResult } from '@tanstack/react-query';
2
- import { CatalogEntityConfig, LayoutVariant } from '@redocly/config';
3
2
  import { ENTITY_RELATION_TYPES } from '@redocly/config';
4
3
 
4
+ import type { CatalogEntityConfig, LayoutVariant } from '@redocly/config';
5
5
  import type { CatalogFilterConfig } from '@redocly/theme/config';
6
6
 
7
7
  export type SortOption = 'title' | '-title' | 'type' | '-type';
@@ -1,5 +1,6 @@
1
1
  import type { AsyncApiRealmUI } from '@redocly/realm-asyncapi-sdk';
2
2
  import type {
3
+ BannerConfig,
3
4
  CatalogEntityConfig,
4
5
  PageData,
5
6
  PageProps,
@@ -83,6 +84,10 @@ export type ThemeHooks = {
83
84
  breadcrumbs: BreadcrumbItem[];
84
85
  currentItemSiblings?: BreadcrumbItem[];
85
86
  };
87
+ useBanner: () => {
88
+ banner: BannerConfig | undefined;
89
+ dismissBanner: (content: string) => void;
90
+ };
86
91
  useSearch: (
87
92
  product?: string,
88
93
  autoSearchDisabled?: boolean,
@@ -1,4 +1,4 @@
1
- import { ResolvedNavItem, ResolvedNavLinkItem } from '@redocly/config';
1
+ import type { ResolvedNavItem, ResolvedNavLinkItem } from '@redocly/config';
2
2
 
3
3
  export function isUndefined<T>(value: T | undefined): value is undefined {
4
4
  return value === undefined;
package/src/index.ts CHANGED
@@ -52,6 +52,8 @@ export * from '@redocly/theme/components/Footer/Footer';
52
52
  export * from '@redocly/theme/components/Footer/FooterColumn';
53
53
  export * from '@redocly/theme/components/Footer/FooterCopyright';
54
54
  export * from '@redocly/theme/components/Footer/FooterItem';
55
+ /* Banner */
56
+ export * from '@redocly/theme/components/Banner/Banner';
55
57
  /* Typography */
56
58
  export * from '@redocly/theme/components/Typography/CompactTypography';
57
59
  export * from '@redocly/theme/components/Typography/Emphasis';