@redocly/theme 0.63.0-next.4 → 0.63.0-next.6

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 (136) hide show
  1. package/lib/components/Accordion/variables.js +2 -2
  2. package/lib/components/Buttons/DownloadButton.d.ts +6 -0
  3. package/lib/components/Buttons/DownloadButton.js +20 -0
  4. package/lib/components/Buttons/EmailButton.js +6 -1
  5. package/lib/components/Buttons/NewTabButton.js +6 -1
  6. package/lib/components/Catalog/Catalog.js +114 -50
  7. package/lib/components/Catalog/CatalogAvatar.d.ts +5 -0
  8. package/lib/components/Catalog/CatalogAvatar.js +92 -0
  9. package/lib/components/Catalog/CatalogCardView/CatalogCard.js +26 -7
  10. package/lib/components/Catalog/CatalogCardView/CatalogCardView.js +10 -2
  11. package/lib/components/Catalog/CatalogEntity/CatalogEntity.js +17 -17
  12. package/lib/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsLinkedNode.js +4 -20
  13. package/lib/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsNodeContent.d.ts +7 -0
  14. package/lib/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsNodeContent.js +53 -0
  15. package/lib/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsRootNode.js +3 -17
  16. package/lib/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistoryButton.js +30 -9
  17. package/lib/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistorySidebar.js +16 -3
  18. package/lib/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityVersionItem.js +8 -4
  19. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.js +11 -5
  20. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty.js +1 -1
  21. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/OwnersProperty.js +1 -1
  22. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations.js +1 -1
  23. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.js +4 -1
  24. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTableContent.js +7 -2
  25. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.js +1 -1
  26. package/lib/components/Catalog/CatalogEntity/CatalogEntitySchema.js +1 -1
  27. package/lib/components/Catalog/CatalogFilter/CatalogFilterCheckboxes.js +1 -1
  28. package/lib/components/Catalog/CatalogFilter/CatalogFilterContent.d.ts +4 -2
  29. package/lib/components/Catalog/CatalogFilter/CatalogFilterContent.js +25 -8
  30. package/lib/components/Catalog/CatalogMobileFiltersPanel/CatalogMobileFiltersPanel.d.ts +7 -0
  31. package/lib/components/Catalog/CatalogMobileFiltersPanel/CatalogMobileFiltersPanel.js +24 -0
  32. package/lib/components/Catalog/CatalogMobileFiltersPanel/CatalogMobileFiltersPanelHeader.d.ts +6 -0
  33. package/lib/components/Catalog/CatalogMobileFiltersPanel/CatalogMobileFiltersPanelHeader.js +26 -0
  34. package/lib/components/Catalog/CatalogMobileFiltersPanel/CatalogMobileFiltersPanelOverlay.d.ts +7 -0
  35. package/lib/components/Catalog/CatalogMobileFiltersPanel/CatalogMobileFiltersPanelOverlay.js +30 -0
  36. package/lib/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBar.d.ts +13 -0
  37. package/lib/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBar.js +30 -0
  38. package/lib/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBarControls.d.ts +11 -0
  39. package/lib/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBarControls.js +21 -0
  40. package/lib/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBarFiltersButton.d.ts +7 -0
  41. package/lib/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBarFiltersButton.js +25 -0
  42. package/lib/components/Catalog/CatalogPageDescription.js +0 -6
  43. package/lib/components/Catalog/CatalogSelector.d.ts +0 -1
  44. package/lib/components/Catalog/CatalogSelector.js +50 -16
  45. package/lib/components/Catalog/CatalogTableView/CatalogTableView.d.ts +2 -1
  46. package/lib/components/Catalog/CatalogTableView/CatalogTableView.js +20 -5
  47. package/lib/components/Catalog/CatalogTableView/CatalogUserEntityCell.js +2 -23
  48. package/lib/components/Catalog/CatalogTagsWithTooltip.d.ts +2 -1
  49. package/lib/components/Catalog/CatalogTagsWithTooltip.js +14 -6
  50. package/lib/components/Catalog/variables.js +78 -36
  51. package/lib/components/Filter/variables.js +1 -1
  52. package/lib/components/LoadMore/LoadMore.js +1 -0
  53. package/lib/components/Menu/MenuItem.js +1 -1
  54. package/lib/components/PageActions/PageActions.js +1 -2
  55. package/lib/components/Search/SearchDialog.js +1 -1
  56. package/lib/components/SidebarActions/SidebarActions.js +1 -1
  57. package/lib/components/Tooltip/AnchorTooltip.js +5 -2
  58. package/lib/components/Tooltip/JsTooltip.js +5 -2
  59. package/lib/components/UserMenu/UserMenu.js +1 -3
  60. package/lib/core/hooks/index.d.ts +1 -0
  61. package/lib/core/hooks/index.js +1 -0
  62. package/lib/core/hooks/use-is-truncated.d.ts +1 -0
  63. package/lib/core/hooks/use-is-truncated.js +19 -0
  64. package/lib/core/hooks/use-tabs.d.ts +1 -1
  65. package/lib/core/hooks/use-tabs.js +30 -17
  66. package/lib/core/types/hooks.d.ts +1 -0
  67. package/lib/core/types/l10n.d.ts +1 -1
  68. package/lib/core/types/tooltip.d.ts +1 -0
  69. package/lib/core/utils/custom-catalog-options-casing.d.ts +15 -0
  70. package/lib/core/utils/custom-catalog-options-casing.js +32 -0
  71. package/lib/core/utils/index.d.ts +1 -0
  72. package/lib/core/utils/index.js +1 -0
  73. package/lib/index.d.ts +1 -0
  74. package/lib/index.js +1 -0
  75. package/lib/markdoc/components/MarkdocExample/MarkdocExample.js +2 -2
  76. package/lib/markdoc/components/Tabs/Tabs.d.ts +1 -2
  77. package/lib/markdoc/components/Tabs/Tabs.js +9 -22
  78. package/package.json +4 -4
  79. package/src/components/Accordion/variables.ts +2 -2
  80. package/src/components/Buttons/DownloadButton.tsx +41 -0
  81. package/src/components/Buttons/EmailButton.tsx +18 -8
  82. package/src/components/Buttons/NewTabButton.tsx +19 -8
  83. package/src/components/Catalog/Catalog.tsx +157 -95
  84. package/src/components/Catalog/CatalogAvatar.tsx +68 -0
  85. package/src/components/Catalog/CatalogCardView/CatalogCard.tsx +29 -5
  86. package/src/components/Catalog/CatalogCardView/CatalogCardView.tsx +10 -2
  87. package/src/components/Catalog/CatalogEntity/CatalogEntity.tsx +17 -17
  88. package/src/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsLinkedNode.tsx +4 -21
  89. package/src/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsNodeContent.tsx +82 -0
  90. package/src/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsRootNode.tsx +4 -22
  91. package/src/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistoryButton.tsx +39 -10
  92. package/src/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistorySidebar.tsx +19 -3
  93. package/src/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityVersionItem.tsx +8 -4
  94. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.tsx +12 -10
  95. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty.tsx +5 -1
  96. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/OwnersProperty.tsx +1 -0
  97. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations.tsx +1 -1
  98. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.tsx +6 -2
  99. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTableContent.tsx +10 -2
  100. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.tsx +1 -1
  101. package/src/components/Catalog/CatalogEntity/CatalogEntitySchema.tsx +1 -1
  102. package/src/components/Catalog/CatalogFilter/CatalogFilterCheckboxes.tsx +1 -1
  103. package/src/components/Catalog/CatalogFilter/CatalogFilterContent.tsx +30 -6
  104. package/src/components/Catalog/CatalogMobileFiltersPanel/CatalogMobileFiltersPanel.tsx +31 -0
  105. package/src/components/Catalog/CatalogMobileFiltersPanel/CatalogMobileFiltersPanelHeader.tsx +34 -0
  106. package/src/components/Catalog/CatalogMobileFiltersPanel/CatalogMobileFiltersPanelOverlay.tsx +40 -0
  107. package/src/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBar.tsx +54 -0
  108. package/src/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBarControls.tsx +34 -0
  109. package/src/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBarFiltersButton.tsx +39 -0
  110. package/src/components/Catalog/CatalogPageDescription.tsx +0 -6
  111. package/src/components/Catalog/CatalogSelector.tsx +23 -21
  112. package/src/components/Catalog/CatalogTableView/CatalogTableView.tsx +37 -6
  113. package/src/components/Catalog/CatalogTableView/CatalogUserEntityCell.tsx +2 -26
  114. package/src/components/Catalog/CatalogTagsWithTooltip.tsx +24 -9
  115. package/src/components/Catalog/variables.ts +78 -36
  116. package/src/components/Filter/variables.ts +1 -1
  117. package/src/components/LoadMore/LoadMore.tsx +1 -0
  118. package/src/components/Menu/MenuItem.tsx +1 -0
  119. package/src/components/PageActions/PageActions.tsx +1 -2
  120. package/src/components/Search/SearchDialog.tsx +1 -1
  121. package/src/components/SidebarActions/SidebarActions.tsx +1 -0
  122. package/src/components/Tooltip/AnchorTooltip.tsx +5 -1
  123. package/src/components/Tooltip/JsTooltip.tsx +5 -1
  124. package/src/components/UserMenu/UserMenu.tsx +1 -3
  125. package/src/core/hooks/code-walkthrough/use-code-walkthrough.ts +1 -1
  126. package/src/core/hooks/index.ts +1 -0
  127. package/src/core/hooks/use-is-truncated.ts +20 -0
  128. package/src/core/hooks/use-tabs.ts +40 -21
  129. package/src/core/types/hooks.ts +1 -1
  130. package/src/core/types/l10n.ts +7 -0
  131. package/src/core/types/tooltip.ts +1 -0
  132. package/src/core/utils/custom-catalog-options-casing.ts +29 -0
  133. package/src/core/utils/index.ts +1 -0
  134. package/src/index.ts +1 -0
  135. package/src/markdoc/components/MarkdocExample/MarkdocExample.tsx +2 -6
  136. package/src/markdoc/components/Tabs/Tabs.tsx +4 -37
@@ -0,0 +1,30 @@
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.CatalogMobileFiltersPanelOverlay = CatalogMobileFiltersPanelOverlay;
7
+ const react_1 = __importDefault(require("react"));
8
+ const styled_components_1 = __importDefault(require("styled-components"));
9
+ const core_1 = require("../../../core");
10
+ const CatalogMobileFiltersPanel_1 = require("../../../components/Catalog/CatalogMobileFiltersPanel/CatalogMobileFiltersPanel");
11
+ function CatalogMobileFiltersPanelOverlay({ setMobileFiltersPanelOpen, filterContent, }) {
12
+ return (react_1.default.createElement(CatalogMobileFiltersPanelOverlayWrapper, null,
13
+ react_1.default.createElement(CatalogMobileFiltersPanel_1.CatalogMobileFiltersPanel, { setMobileFiltersPanelOpen: setMobileFiltersPanelOpen, filterContent: filterContent })));
14
+ }
15
+ const CatalogMobileFiltersPanelOverlayWrapper = styled_components_1.default.div `
16
+ display: none;
17
+ position: fixed;
18
+ top: calc(var(--navbar-height) + var(--banner-height));
19
+ left: 0;
20
+ width: 100%;
21
+ height: calc(100vh - var(--navbar-height) - var(--banner-height));
22
+ z-index: 3;
23
+ background: var(--bg-color);
24
+ flex-direction: column;
25
+
26
+ @media screen and (max-width: ${core_1.breakpoints.medium}) {
27
+ display: flex;
28
+ }
29
+ `;
30
+ //# sourceMappingURL=CatalogMobileFiltersPanelOverlay.js.map
@@ -0,0 +1,13 @@
1
+ import { JSX } from 'react';
2
+ import { SortOption } from '../../../core';
3
+ import { CatalogViewMode } from '../../../core';
4
+ type CatalogMobileTopBarProps = {
5
+ setMobileFiltersPanelOpen: (open: boolean) => void;
6
+ activeFiltersCount: number;
7
+ setSortOption: (sortOption: SortOption | null) => void;
8
+ sortOption: SortOption | null;
9
+ viewMode: CatalogViewMode;
10
+ setViewMode: (viewMode: CatalogViewMode) => void;
11
+ };
12
+ export declare function CatalogMobileTopBar({ setMobileFiltersPanelOpen, activeFiltersCount, setSortOption, sortOption, viewMode, setViewMode, }: CatalogMobileTopBarProps): JSX.Element;
13
+ export {};
@@ -0,0 +1,30 @@
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.CatalogMobileTopBar = CatalogMobileTopBar;
7
+ const react_1 = __importDefault(require("react"));
8
+ const styled_components_1 = __importDefault(require("styled-components"));
9
+ const CatalogMobileTopBarFiltersButton_1 = require("../../../components/Catalog/CatalogMobileTopBar/CatalogMobileTopBarFiltersButton");
10
+ const CatalogMobileTopBarControls_1 = require("../../../components/Catalog/CatalogMobileTopBar/CatalogMobileTopBarControls");
11
+ const core_1 = require("../../../core");
12
+ function CatalogMobileTopBar({ setMobileFiltersPanelOpen, activeFiltersCount, setSortOption, sortOption, viewMode, setViewMode, }) {
13
+ return (react_1.default.createElement(CatalogMobileTopBarWrapper, null,
14
+ react_1.default.createElement(CatalogMobileTopBarFiltersButton_1.CatalogMobileTopBarFiltersButton, { setMobileFiltersPanelOpen: setMobileFiltersPanelOpen, activeFiltersCount: activeFiltersCount }),
15
+ react_1.default.createElement(CatalogMobileTopBarControls_1.CatalogMobileTopBarControls, { setSortOption: setSortOption, sortOption: sortOption, viewMode: viewMode, setViewMode: setViewMode })));
16
+ }
17
+ const CatalogMobileTopBarWrapper = styled_components_1.default.div `
18
+ display: none;
19
+ align-items: center;
20
+ justify-content: space-between;
21
+ padding: var(--spacing-sm) var(--catalog-page-padding-horizontal);
22
+ border-bottom: 1px solid var(--border-color-secondary);
23
+ background: var(--bg-color);
24
+ flex-shrink: 0;
25
+
26
+ @media screen and (max-width: ${core_1.breakpoints.medium}) {
27
+ display: flex;
28
+ }
29
+ `;
30
+ //# sourceMappingURL=CatalogMobileTopBar.js.map
@@ -0,0 +1,11 @@
1
+ import { JSX } from 'react';
2
+ import { SortOption } from '../../../core';
3
+ import { CatalogViewMode } from '../../../core';
4
+ type CatalogMobileTopBarControlsProps = {
5
+ setSortOption: (sortOption: SortOption | null) => void;
6
+ sortOption: SortOption | null;
7
+ viewMode: CatalogViewMode;
8
+ setViewMode: (viewMode: CatalogViewMode) => void;
9
+ };
10
+ export declare function CatalogMobileTopBarControls({ setSortOption, sortOption, viewMode, setViewMode, }: CatalogMobileTopBarControlsProps): JSX.Element;
11
+ export {};
@@ -0,0 +1,21 @@
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.CatalogMobileTopBarControls = CatalogMobileTopBarControls;
7
+ const react_1 = __importDefault(require("react"));
8
+ const styled_components_1 = __importDefault(require("styled-components"));
9
+ const CatalogSortButton_1 = require("../../../components/Catalog/CatalogSortButton");
10
+ const CatalogViewModeToggle_1 = require("../../../components/Catalog/CatalogViewModeToggle");
11
+ function CatalogMobileTopBarControls({ setSortOption, sortOption, viewMode, setViewMode, }) {
12
+ return (react_1.default.createElement(CatalogMobileTopBarControlsWrapper, null,
13
+ react_1.default.createElement(CatalogSortButton_1.CatalogSortButton, { onSortChange: setSortOption, currentSort: sortOption }),
14
+ react_1.default.createElement(CatalogViewModeToggle_1.CatalogViewModeToggle, { viewMode: viewMode, onViewModeChange: setViewMode })));
15
+ }
16
+ const CatalogMobileTopBarControlsWrapper = styled_components_1.default.div `
17
+ display: flex;
18
+ align-items: center;
19
+ gap: var(--catalog-controls-wrapper-gap);
20
+ `;
21
+ //# sourceMappingURL=CatalogMobileTopBarControls.js.map
@@ -0,0 +1,7 @@
1
+ import { JSX } from 'react';
2
+ type CatalogMobileTopBarFiltersButtonProps = {
3
+ setMobileFiltersPanelOpen: (open: boolean) => void;
4
+ activeFiltersCount: number;
5
+ };
6
+ export declare function CatalogMobileTopBarFiltersButton({ setMobileFiltersPanelOpen, activeFiltersCount, }: CatalogMobileTopBarFiltersButtonProps): JSX.Element;
7
+ export {};
@@ -0,0 +1,25 @@
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.CatalogMobileTopBarFiltersButton = CatalogMobileTopBarFiltersButton;
7
+ const react_1 = __importDefault(require("react"));
8
+ const styled_components_1 = __importDefault(require("styled-components"));
9
+ const FilterIcon_1 = require("../../../icons/FilterIcon/FilterIcon");
10
+ const CounterTag_1 = require("../../../components/Tags/CounterTag");
11
+ const core_1 = require("../../../core");
12
+ const Button_1 = require("../../../components/Button/Button");
13
+ function CatalogMobileTopBarFiltersButton({ setMobileFiltersPanelOpen, activeFiltersCount, }) {
14
+ const { useTranslate } = (0, core_1.useThemeHooks)();
15
+ const { translate } = useTranslate();
16
+ return (react_1.default.createElement(CatalogMobileTopBarFiltersButtonWrapper, { icon: react_1.default.createElement(FilterIcon_1.FilterIcon, { size: "16px" }), variant: "ghost", iconPosition: "left", size: "medium", onClick: () => setMobileFiltersPanelOpen(true) },
17
+ translate('catalog.filters.title', 'Filters'),
18
+ activeFiltersCount > 0 ? react_1.default.createElement(CounterTag_1.CounterTag, { borderless: true }, activeFiltersCount) : null));
19
+ }
20
+ const CatalogMobileTopBarFiltersButtonWrapper = (0, styled_components_1.default)(Button_1.Button) `
21
+ display: inline-flex;
22
+ align-items: center;
23
+ gap: var(--spacing-xs);
24
+ `;
25
+ //# sourceMappingURL=CatalogMobileTopBarFiltersButton.js.map
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.CatalogPageDescription = CatalogPageDescription;
7
7
  const react_1 = __importDefault(require("react"));
8
8
  const styled_components_1 = __importDefault(require("styled-components"));
9
- const utils_1 = require("../../core/utils");
10
9
  const H3_1 = require("../../components/Typography/H3");
11
10
  const Tag_1 = require("../../components/Tag/Tag");
12
11
  function CatalogPageDescription({ title, titleTranslationKey, description, descriptionTranslationKey, tag, }) {
@@ -18,11 +17,6 @@ function CatalogPageDescription({ title, titleTranslationKey, description, descr
18
17
  }
19
18
  const CatalogPageDescriptionWrapper = styled_components_1.default.div `
20
19
  margin: var(--catalog-heading-margin);
21
- display: var(--catalog-page-description-display-mobile);
22
-
23
- @media screen and (min-width: ${utils_1.breakpoints.medium}) {
24
- display: var(--catalog-page-description-display-desktop);
25
- }
26
20
  `;
27
21
  const CatalogTitleWrapper = styled_components_1.default.div `
28
22
  display: flex;
@@ -7,5 +7,4 @@ export type CatalogSelectorProps = {
7
7
  };
8
8
  export declare function CatalogSelector({ catalogSwitcherItems, onChange, }: CatalogSelectorProps): JSX.Element;
9
9
  export declare const CatalogSelectWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
10
- export declare const CatalogSelectLabel: import("styled-components").StyledComponent<"label", any, {}, never>;
11
10
  export declare const CatalogSelect: import("styled-components").StyledComponent<typeof Select, any, {}, never>;
@@ -1,13 +1,47 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
2
35
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
37
  };
5
38
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.CatalogSelect = exports.CatalogSelectLabel = exports.CatalogSelectWrapper = void 0;
39
+ exports.CatalogSelect = exports.CatalogSelectWrapper = void 0;
7
40
  exports.CatalogSelector = CatalogSelector;
8
- const react_1 = __importDefault(require("react"));
41
+ const react_1 = __importStar(require("react"));
9
42
  const styled_components_1 = __importDefault(require("styled-components"));
10
43
  const react_router_dom_1 = require("react-router-dom");
44
+ const Accordion_1 = require("../../components/Accordion/Accordion");
11
45
  const Select_1 = require("../../components/Select/Select");
12
46
  const utils_1 = require("../../core/utils");
13
47
  const hooks_1 = require("../../core/hooks");
@@ -15,6 +49,7 @@ const ChevronDownIcon_1 = require("../../icons/ChevronDownIcon/ChevronDownIcon")
15
49
  function CatalogSelector({ catalogSwitcherItems, onChange, }) {
16
50
  const { useTranslate } = (0, hooks_1.useThemeHooks)();
17
51
  const { translate } = useTranslate();
52
+ const [isExpanded, setIsExpanded] = (0, react_1.useState)(true);
18
53
  const navigate = (0, react_router_dom_1.useNavigate)();
19
54
  const pathPrefix = (0, utils_1.getPathPrefix)();
20
55
  const options = catalogSwitcherItems.map((item) => ({
@@ -23,25 +58,24 @@ function CatalogSelector({ catalogSwitcherItems, onChange, }) {
23
58
  label: translate(item.labelTranslationKey),
24
59
  }));
25
60
  const selectedCatalogItem = catalogSwitcherItems.find((item) => item.selected);
61
+ const headerLabel = translate('catalog.catalogs.label', 'Catalogs');
26
62
  return (react_1.default.createElement(exports.CatalogSelectWrapper, { "data-component-name": "Catalog/CatalogSelector" },
27
- react_1.default.createElement(exports.CatalogSelectLabel, null, translate('catalog.catalogs.label', 'Catalogs')),
28
- react_1.default.createElement(exports.CatalogSelect, { value: selectedCatalogItem === null || selectedCatalogItem === void 0 ? void 0 : selectedCatalogItem.slug, options: options, onChange: (value) => {
29
- navigate(`${pathPrefix}/catalogs/${value}`);
30
- onChange();
31
- }, icon: react_1.default.createElement(ChevronDownIcon_1.ChevronDownIcon, { color: "var(--catalog-select-icon-color)" }) })));
63
+ react_1.default.createElement(Accordion_1.Accordion, { expanded: isExpanded, header: headerLabel, onToggle: setIsExpanded },
64
+ react_1.default.createElement(exports.CatalogSelect, { value: selectedCatalogItem === null || selectedCatalogItem === void 0 ? void 0 : selectedCatalogItem.slug, options: options, onChange: (value) => {
65
+ navigate(`${pathPrefix}/catalogs/${value}`);
66
+ onChange();
67
+ }, icon: react_1.default.createElement(ChevronDownIcon_1.ChevronDownIcon, { color: "var(--catalog-select-icon-color)" }) }))));
32
68
  }
33
69
  exports.CatalogSelectWrapper = styled_components_1.default.div `
34
- margin-top: var(--catalog-select-wrapper-margin-top);
35
- `;
36
- exports.CatalogSelectLabel = styled_components_1.default.label `
37
- display: block;
38
- margin-bottom: var(--catalog-select-label-margin-bottom);
39
- font-weight: var(--catalog-select-label-font-weight);
40
- font-size: var(--catalog-select-label-font-size);
41
- line-height: var(--catalog-select-label-line-height);
70
+ display: flex;
71
+ flex-direction: column;
72
+ gap: var(--filter-group-gap);
73
+ --accordion-body-padding: var(--catalog-select-accordion-body-padding);
74
+ --accordion-header-padding: var(--catalog-select-accordion-header-padding);
75
+ --select-line-height: var(--catalog-select-select-line-height);
76
+ --select-input-padding: var(--catalog-select-select-input-padding);
42
77
  `;
43
78
  exports.CatalogSelect = (0, styled_components_1.default)(Select_1.Select) `
44
79
  border-radius: var(--catalog-select-border-radius);
45
- --select-input-padding: var(--catalog-select-input-padding);
46
80
  `;
47
81
  //# sourceMappingURL=CatalogSelector.js.map
@@ -19,6 +19,7 @@ export type CatalogTableViewProps<T extends BaseEntity> = {
19
19
  handleSortClick: (sortKey: string, direction: 'asc' | 'desc') => void;
20
20
  isColumnSorted: (sortKey: string, direction: 'asc' | 'desc') => boolean;
21
21
  style?: React.CSSProperties;
22
+ contentMinWidth?: number;
22
23
  };
23
24
  export type CatalogColumn<T> = {
24
25
  key: string;
@@ -29,4 +30,4 @@ export type CatalogColumn<T> = {
29
30
  sortable?: boolean;
30
31
  sortKey?: string;
31
32
  };
32
- export declare const CatalogTableView: <T extends BaseEntity>({ entities, entitiesCatalogConfig, catalogConfig, columns, setSortOption, currentSortOption, onRowClick, handleSortClick, isColumnSorted, style, }: CatalogTableViewProps<T>) => React.JSX.Element;
33
+ export declare const CatalogTableView: <T extends BaseEntity>({ entities, entitiesCatalogConfig, catalogConfig, columns, setSortOption, currentSortOption, onRowClick, handleSortClick, isColumnSorted, style, contentMinWidth, }: CatalogTableViewProps<T>) => React.JSX.Element;
@@ -13,6 +13,7 @@ const CatalogTableHeaderCell_1 = require("../../../components/Catalog/CatalogTab
13
13
  const CatalogTagsCell_1 = require("../../../components/Catalog/CatalogTableView/CatalogTagsCell");
14
14
  const CatalogTableViewRow_1 = require("../../../components/Catalog/CatalogTableView/CatalogTableViewRow");
15
15
  const CatalogEntityTypeTag_1 = require("../../../components/Catalog/CatalogEntityTypeTag");
16
+ const core_1 = require("../../../core");
16
17
  const baseColumns = [
17
18
  {
18
19
  key: 'entity',
@@ -60,17 +61,27 @@ const baseColumns = [
60
61
  minWidth: '120px',
61
62
  },
62
63
  ];
63
- const CatalogTableView = ({ entities, entitiesCatalogConfig, catalogConfig, columns = baseColumns, setSortOption, currentSortOption, onRowClick, handleSortClick, isColumnSorted, style, }) => {
64
- return (react_1.default.createElement(CatalogTableWrapper, { "data-component-name": "Catalog/CatalogTableView", style: style },
64
+ const CatalogTableView = ({ entities, entitiesCatalogConfig, catalogConfig, columns = baseColumns, setSortOption, currentSortOption, onRowClick, handleSortClick, isColumnSorted, style, contentMinWidth, }) => {
65
+ const tableContent = (react_1.default.createElement(react_1.default.Fragment, null,
65
66
  react_1.default.createElement(CatalogTableHeader, { columnsWidths: columns.map((column) => column.width || '1fr'), columnsMinWidths: columns.map((column) => column.minWidth || 'auto') }, columns.map((column) => (react_1.default.createElement(CatalogTableHeaderCell_1.CatalogTableHeaderCell, { key: column.key, column: column, setSortOption: setSortOption, currentSortOption: currentSortOption, handleSortClick: handleSortClick, isColumnSorted: isColumnSorted })))),
66
- react_1.default.createElement("div", null, entities.map((entity) => (react_1.default.createElement(CatalogTableViewRow_1.CatalogTableViewRow, { key: entity.id, entity: entity, entitiesCatalogConfig: entitiesCatalogConfig, catalogConfig: catalogConfig, columns: columns, onRowClick: onRowClick }))))));
67
+ react_1.default.createElement(CatalogTableBody, null, entities.map((entity) => (react_1.default.createElement(CatalogTableViewRow_1.CatalogTableViewRow, { key: entity.id, entity: entity, entitiesCatalogConfig: entitiesCatalogConfig, catalogConfig: catalogConfig, columns: columns, onRowClick: onRowClick }))))));
68
+ return (react_1.default.createElement(CatalogTableWrapper, { "data-component-name": "Catalog/CatalogTableView", style: style }, contentMinWidth != null ? (react_1.default.createElement(CatalogTableContentInner, { "$contentMinWidth": contentMinWidth }, tableContent)) : (react_1.default.createElement(CatalogTableScrollContent, null, tableContent))));
67
69
  };
68
70
  exports.CatalogTableView = CatalogTableView;
69
71
  const CatalogTableWrapper = styled_components_1.default.div `
70
72
  width: 100%;
71
73
  border-bottom: 1px solid var(--catalog-table-border-color);
72
- margin-bottom: var(--spacing-xl);
73
- margin-top: var(--spacing-xl);
74
+ overflow-x: auto;
75
+
76
+ @media screen and (max-width: ${core_1.breakpoints.medium}) {
77
+ margin-top: 0;
78
+ }
79
+ `;
80
+ const CatalogTableScrollContent = styled_components_1.default.div `
81
+ min-width: min-content;
82
+ `;
83
+ const CatalogTableContentInner = styled_components_1.default.div `
84
+ min-width: ${({ $contentMinWidth }) => $contentMinWidth}px;
74
85
  `;
75
86
  const CatalogTableHeader = styled_components_1.default.div `
76
87
  display: grid;
@@ -79,5 +90,9 @@ const CatalogTableHeader = styled_components_1.default.div `
79
90
  .join(' ')};
80
91
  background: var(--catalog-table-header-bg-color);
81
92
  font-weight: var(--catalog-table-header-font-weight);
93
+ border-radius: var(--border-radius) var(--border-radius) 0 0;
94
+ `;
95
+ const CatalogTableBody = styled_components_1.default.div `
96
+ min-width: min-content;
82
97
  `;
83
98
  //# sourceMappingURL=CatalogTableView.js.map
@@ -8,19 +8,10 @@ exports.CatalogUserEntityCell = CatalogUserEntityCell;
8
8
  const react_1 = __importDefault(require("react"));
9
9
  const styled_components_1 = __importDefault(require("styled-components"));
10
10
  const CatalogHighlight_1 = require("../../../components/Catalog/CatalogHighlight");
11
- const extractInitials = (name) => {
12
- const trimmedName = name === null || name === void 0 ? void 0 : name.trim();
13
- if (!trimmedName)
14
- return '';
15
- const initials = trimmedName.split(' ').map((n) => n[0]);
16
- if (initials.length === 1) {
17
- return initials[0];
18
- }
19
- return initials[0] + initials[initials.length - 1];
20
- };
11
+ const CatalogAvatar_1 = require("../../../components/Catalog/CatalogAvatar");
21
12
  function CatalogUserEntityCell({ name, email }) {
22
13
  return (react_1.default.createElement(EntityTitleCellWrapper, { "data-component-name": "Catalog/CatalogTableView/CatalogUserEntityCell" },
23
- react_1.default.createElement(Avatar, null, extractInitials(name)),
14
+ react_1.default.createElement(CatalogAvatar_1.CatalogAvatar, { value: name, size: "medium" }),
24
15
  react_1.default.createElement(EntityTitleContent, null,
25
16
  react_1.default.createElement(EntityTitle, null,
26
17
  react_1.default.createElement(CatalogHighlight_1.CatalogHighlight, null, name)),
@@ -33,18 +24,6 @@ const EntityTitleCellWrapper = styled_components_1.default.div `
33
24
  gap: 6px;
34
25
  max-width: 100%;
35
26
  `;
36
- const Avatar = styled_components_1.default.div `
37
- display: flex;
38
- align-items: center;
39
- justify-content: center;
40
- width: 32px;
41
- height: 32px;
42
- border-radius: 50%;
43
- background-color: var(--catalog-avatar-bg-color);
44
- flex-shrink: 0;
45
- font-size: 14px;
46
- font-weight: 400;
47
- `;
48
27
  const EntityTitleContent = styled_components_1.default.div `
49
28
  display: flex;
50
29
  flex-direction: column;
@@ -5,5 +5,6 @@ export type CatalogTagsWithTooltipProps = {
5
5
  itemsToShow?: number;
6
6
  showPlaceholder?: boolean;
7
7
  tagProps?: TagProps;
8
+ showAvatars?: boolean;
8
9
  };
9
- export declare function CatalogTagsWithTooltip({ items, itemsToShow, showPlaceholder, tagProps, }: CatalogTagsWithTooltipProps): JSX.Element | null;
10
+ export declare function CatalogTagsWithTooltip({ items, itemsToShow, showPlaceholder, showAvatars, tagProps, }: CatalogTagsWithTooltipProps): JSX.Element | null;
@@ -11,25 +11,29 @@ const Tag_1 = require("../../components/Tag/Tag");
11
11
  const Tooltip_1 = require("../../components/Tooltip/Tooltip");
12
12
  const CatalogHighlight_1 = require("../../components/Catalog/CatalogHighlight");
13
13
  const hooks_1 = require("../../core/hooks");
14
- function CatalogTagsWithTooltip({ items, itemsToShow = 1, showPlaceholder = true, tagProps, }) {
14
+ const CatalogAvatar_1 = require("../../components/Catalog/CatalogAvatar");
15
+ function CatalogTagsWithTooltip({ items, itemsToShow = 1, showPlaceholder = false, showAvatars, tagProps, }) {
15
16
  const { useTranslate } = (0, hooks_1.useThemeHooks)();
16
17
  const { translate } = useTranslate();
17
18
  if (!items || items.length === 0) {
18
19
  if (showPlaceholder) {
19
- return (react_1.default.createElement(CatalogTagsWrapper, { "data-component-name": "Catalog/CatalogTagsWithTooltip" },
20
- react_1.default.createElement(Tag_1.Tag, { style: { backgroundColor: 'var(--catalog-tags-placeholder-bg-color)' }, color: "grey" }, "N/A")));
20
+ return (react_1.default.createElement(CatalogTagsNotConnectedWrapper, { "data-component-name": "Catalog/CatalogTagsWithTooltip" }, translate('catalog.notConnected', 'Not connected')));
21
21
  }
22
22
  return null;
23
23
  }
24
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, { maxLength: constants_1.CATALOG_TAG_MAX_LENGTH }),
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 }),
26
28
  react_1.default.createElement(CatalogHighlight_1.CatalogHighlight, null, item))))));
27
29
  }
28
30
  const displayedItems = items.slice(0, itemsToShow);
29
31
  const remainingCount = items.length - itemsToShow;
30
32
  return (react_1.default.createElement(Tooltip_1.Tooltip, { tip: items.join(', '), placement: "bottom", className: "catalog", width: "400px" },
31
33
  react_1.default.createElement(CatalogTagsWrapper, { "data-component-name": "Catalog/CatalogTagsWithTooltip" },
32
- displayedItems.map((item, index) => (react_1.default.createElement(Tag_1.Tag, Object.assign({ key: `${item}-${index}` }, tagProps, { textTransform: "none", maxLength: constants_1.CATALOG_TAG_MAX_LENGTH }),
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 }),
33
37
  react_1.default.createElement(CatalogHighlight_1.CatalogHighlight, null, item)))),
34
38
  react_1.default.createElement(MoreTagsButton, null,
35
39
  "+",
@@ -40,10 +44,14 @@ function CatalogTagsWithTooltip({ items, itemsToShow = 1, showPlaceholder = true
40
44
  const CatalogTagsWrapper = styled_components_1.default.div `
41
45
  display: flex;
42
46
  flex-wrap: wrap;
43
- gap: var(--catalog-tags-wrapper-gap);
44
47
  `;
45
48
  const MoreTagsButton = styled_components_1.default.span `
46
49
  font-size: var(--catalog-tags-more-button-font-size);
47
50
  margin-left: var(--catalog-tags-more-button-margin-left);
48
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
+ `;
49
57
  //# sourceMappingURL=CatalogTagsWithTooltip.js.map