@redocly/theme 0.59.0-next.0 → 0.59.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 (196) hide show
  1. package/lib/components/Accordion/Accordion.d.ts +12 -0
  2. package/lib/components/Accordion/Accordion.js +85 -0
  3. package/lib/components/Accordion/AccordionBody.d.ts +8 -0
  4. package/lib/components/Accordion/AccordionBody.js +73 -0
  5. package/lib/components/Accordion/AccordionHeader.d.ts +10 -0
  6. package/lib/components/Accordion/AccordionHeader.js +37 -0
  7. package/lib/components/Accordion/AccordionTitle.d.ts +6 -0
  8. package/lib/components/Accordion/AccordionTitle.js +20 -0
  9. package/lib/components/Accordion/variables.d.ts +1 -0
  10. package/lib/components/Accordion/variables.js +59 -0
  11. package/lib/components/Admonition/Admonition.js +17 -7
  12. package/lib/components/Badge/Badge.js +17 -7
  13. package/lib/components/Breadcrumbs/Breadcrumb.js +17 -7
  14. package/lib/components/Breadcrumbs/BreadcrumbDropdown.js +17 -7
  15. package/lib/components/Button/Button.js +17 -7
  16. package/lib/components/Buttons/AIAssistantButton.d.ts +2 -0
  17. package/lib/components/Buttons/AIAssistantButton.js +135 -0
  18. package/lib/components/Buttons/CopyButton.js +17 -7
  19. package/lib/components/Buttons/variables.d.ts +1 -0
  20. package/lib/components/Buttons/variables.dark.d.ts +1 -0
  21. package/lib/components/Buttons/variables.dark.js +10 -0
  22. package/lib/components/Buttons/variables.js +51 -0
  23. package/lib/components/Catalog/Catalog.d.ts +6 -0
  24. package/lib/components/Catalog/Catalog.js +9 -8
  25. package/lib/components/Catalog/CatalogEntities.js +17 -7
  26. package/lib/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsGraph.js +17 -7
  27. package/lib/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsGraph.lazy.js +17 -7
  28. package/lib/components/Catalog/CatalogEntity/CatalogEntityMetadata.js +17 -7
  29. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations.js +1 -1
  30. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.js +17 -7
  31. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.js +1 -1
  32. package/lib/components/Catalog/CatalogEntity/CatalogEntitySchema.js +17 -7
  33. package/lib/components/Catalog/CatalogFilter/CatalogFilter.d.ts +6 -0
  34. package/lib/components/Catalog/CatalogFilter/CatalogFilter.js +35 -0
  35. package/lib/components/Catalog/CatalogFilter/CatalogFilterCheckboxes.d.ts +6 -0
  36. package/lib/components/Catalog/CatalogFilter/CatalogFilterCheckboxes.js +152 -0
  37. package/lib/components/Catalog/CatalogFilter/CatalogFilterContent.d.ts +13 -0
  38. package/lib/components/Catalog/CatalogFilter/CatalogFilterContent.js +102 -0
  39. package/lib/components/Catalog/CatalogFilter/CatalogFilterDateRange.d.ts +6 -0
  40. package/lib/components/Catalog/CatalogFilter/CatalogFilterDateRange.js +121 -0
  41. package/lib/components/Catalog/CatalogFilter/CatalogFilterSelect.d.ts +6 -0
  42. package/lib/components/Catalog/CatalogFilter/CatalogFilterSelect.js +126 -0
  43. package/lib/components/Catalog/CatalogSelector.js +0 -1
  44. package/lib/components/Catalog/CatalogSortButton.js +17 -7
  45. package/lib/components/Catalog/CatalogTableView/CatalogTableHeaderCell.js +17 -7
  46. package/lib/components/Catalog/CatalogViewModeToggle.js +17 -7
  47. package/lib/components/Catalog/variables.js +0 -1
  48. package/lib/components/CatalogClassic/CatalogClassicActions.js +17 -7
  49. package/lib/components/CatalogClassic/CatalogClassicCard.js +17 -7
  50. package/lib/components/CatalogClassic/CatalogClassicHighlight.js +17 -7
  51. package/lib/components/CatalogClassic/CatalogClassicVirtualizedGroups.js +17 -7
  52. package/lib/components/CodeBlock/CodeBlock.js +17 -7
  53. package/lib/components/CodeBlock/CodeBlockContainer.js +17 -7
  54. package/lib/components/CodeBlock/CodeBlockTabs.js +17 -7
  55. package/lib/components/Dropdown/Dropdown.d.ts +16 -2
  56. package/lib/components/Dropdown/Dropdown.js +22 -12
  57. package/lib/components/Dropdown/DropdownMenuItem.js +17 -7
  58. package/lib/components/Feedback/Comment.js +17 -7
  59. package/lib/components/Feedback/Feedback.js +17 -7
  60. package/lib/components/Feedback/Mood.js +17 -7
  61. package/lib/components/Feedback/Rating.js +17 -7
  62. package/lib/components/Feedback/Reasons.js +17 -7
  63. package/lib/components/Feedback/Scale.js +17 -7
  64. package/lib/components/Feedback/Sentiment.js +17 -7
  65. package/lib/components/Feedback/Stars.js +17 -7
  66. package/lib/components/Filter/FilterContent.js +17 -7
  67. package/lib/components/Filter/FilterInput.d.ts +1 -0
  68. package/lib/components/Filter/FilterInput.js +19 -9
  69. package/lib/components/Filter/FilterOptions.js +2 -0
  70. package/lib/components/Filter/variables.js +7 -4
  71. package/lib/components/Image/Image.js +17 -7
  72. package/lib/components/JsonViewer/JsonViewer.js +17 -7
  73. package/lib/components/JsonViewer/helpers.js +17 -7
  74. package/lib/components/LastUpdated/LastUpdated.js +17 -7
  75. package/lib/components/Link/Link.js +17 -7
  76. package/lib/components/Markdown/Markdown.js +17 -7
  77. package/lib/components/Marker/Marker.js +17 -7
  78. package/lib/components/Menu/MenuContainer.js +17 -7
  79. package/lib/components/Menu/MenuItem.js +18 -8
  80. package/lib/components/Menu/MenuMobile.js +17 -7
  81. package/lib/components/PageActions/PageActions.js +17 -7
  82. package/lib/components/PageNavigation/NextButton.js +17 -7
  83. package/lib/components/Panel/Panel.js +17 -7
  84. package/lib/components/Panel/PanelBody.js +17 -7
  85. package/lib/components/Search/FilterFields/SearchFilterFieldSelect.js +17 -7
  86. package/lib/components/Search/SearchAiConversationInput.d.ts +2 -1
  87. package/lib/components/Search/SearchAiConversationInput.js +28 -10
  88. package/lib/components/Search/SearchAiDialog.js +19 -10
  89. package/lib/components/Search/SearchAiResponse.js +2 -3
  90. package/lib/components/Search/SearchDialog.d.ts +2 -1
  91. package/lib/components/Search/SearchDialog.js +25 -12
  92. package/lib/components/Search/SearchFilter.js +17 -7
  93. package/lib/components/Search/SearchGroups.js +17 -7
  94. package/lib/components/Search/SearchHighlight.js +17 -7
  95. package/lib/components/Search/SearchItem.js +17 -7
  96. package/lib/components/Search/SearchRecent.js +17 -7
  97. package/lib/components/Search/SearchShortcut.js +17 -7
  98. package/lib/components/Search/SearchSuggestedPages.js +17 -7
  99. package/lib/components/Search/SearchTrigger.js +17 -7
  100. package/lib/components/Search/variables.js +5 -1
  101. package/lib/components/Segmented/Segmented.js +17 -7
  102. package/lib/components/Select/Select.js +17 -7
  103. package/lib/components/Select/SelectInput.js +17 -7
  104. package/lib/components/Sidebar/Sidebar.js +17 -7
  105. package/lib/components/SidebarActions/styled.js +17 -7
  106. package/lib/components/SkipContent/SkipContent.js +17 -7
  107. package/lib/components/Switch/Switch.js +17 -7
  108. package/lib/components/TableOfContent/TableOfContent.js +17 -7
  109. package/lib/components/Tag/variables.dark.js +2 -2
  110. package/lib/components/Tooltip/Tooltip.js +17 -7
  111. package/lib/components/VersionPicker/VersionPicker.js +17 -7
  112. package/lib/core/constants/search.d.ts +5 -4
  113. package/lib/core/constants/search.js +4 -5
  114. package/lib/core/contexts/CodeSnippetContext.js +17 -7
  115. package/lib/core/hooks/use-tabs.d.ts +3 -2
  116. package/lib/core/hooks/use-tabs.js +115 -57
  117. package/lib/core/styles/dark.js +29 -26
  118. package/lib/core/styles/global.js +64 -59
  119. package/lib/core/templates/Markdown.js +17 -7
  120. package/lib/core/types/hooks.d.ts +6 -3
  121. package/lib/core/types/l10n.d.ts +1 -1
  122. package/lib/core/utils/download-code-walkthrough.js +17 -7
  123. package/lib/core/utils/get-file-icon.js +17 -7
  124. package/lib/icons/AiStarsIcon/AiStarsIcon.js +11 -2
  125. package/lib/icons/GenericIcon/GenericIcon.js +17 -7
  126. package/lib/icons/RedoclyIcon/RedoclyIcon.d.ts +9 -0
  127. package/lib/icons/RedoclyIcon/RedoclyIcon.js +24 -0
  128. package/lib/icons/Spinner/Spinner.js +17 -7
  129. package/lib/index.d.ts +2 -0
  130. package/lib/index.js +19 -7
  131. package/lib/layouts/OIDCForbidden.js +17 -7
  132. package/lib/layouts/RootLayout.js +6 -1
  133. package/lib/layouts/ThreePanelLayout.js +17 -7
  134. package/lib/markdoc/components/Cards/Cards.js +17 -7
  135. package/lib/markdoc/components/CodeGroup/CodeGroup.js +17 -7
  136. package/lib/markdoc/components/CodeWalkthrough/CodeContainer.js +17 -7
  137. package/lib/markdoc/components/CodeWalkthrough/CodePanel.js +17 -7
  138. package/lib/markdoc/components/CodeWalkthrough/CodePanelHeader.js +17 -7
  139. package/lib/markdoc/components/CodeWalkthrough/CodePanelPreview.js +17 -7
  140. package/lib/markdoc/components/CodeWalkthrough/CodePanelToolbar.js +17 -7
  141. package/lib/markdoc/components/CodeWalkthrough/CodeStep.js +17 -7
  142. package/lib/markdoc/components/CodeWalkthrough/CodeToggle.js +17 -7
  143. package/lib/markdoc/components/CodeWalkthrough/CodeWalkthrough.js +17 -7
  144. package/lib/markdoc/components/CodeWalkthrough/Input.js +17 -7
  145. package/lib/markdoc/components/Heading/Heading.js +17 -7
  146. package/lib/markdoc/components/HtmlBlock/HtmlBlock.js +17 -7
  147. package/lib/markdoc/components/InlineSvg/InlineSvg.js +17 -7
  148. package/lib/markdoc/components/MarkdocExample/MarkdocExample.js +17 -7
  149. package/lib/markdoc/components/Tabs/TabList.d.ts +3 -1
  150. package/lib/markdoc/components/Tabs/TabList.js +214 -54
  151. package/lib/markdoc/components/Tabs/Tabs.d.ts +2 -1
  152. package/lib/markdoc/components/Tabs/Tabs.js +74 -19
  153. package/lib/markdoc/default.d.ts +104 -1
  154. package/lib/markdoc/default.js +17 -7
  155. package/package.json +5 -5
  156. package/src/components/Accordion/Accordion.tsx +100 -0
  157. package/src/components/Accordion/AccordionBody.tsx +65 -0
  158. package/src/components/Accordion/AccordionHeader.tsx +68 -0
  159. package/src/components/Accordion/AccordionTitle.tsx +26 -0
  160. package/src/components/Accordion/variables.ts +56 -0
  161. package/src/components/Buttons/AIAssistantButton.tsx +141 -0
  162. package/src/components/Buttons/variables.dark.ts +7 -0
  163. package/src/components/Buttons/variables.ts +48 -0
  164. package/src/components/Catalog/Catalog.tsx +18 -6
  165. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations.tsx +1 -1
  166. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.tsx +1 -1
  167. package/src/components/Catalog/CatalogFilter/CatalogFilter.tsx +56 -0
  168. package/src/components/Catalog/CatalogFilter/CatalogFilterCheckboxes.tsx +169 -0
  169. package/src/components/Catalog/CatalogFilter/CatalogFilterContent.tsx +121 -0
  170. package/src/components/Catalog/CatalogFilter/CatalogFilterDateRange.tsx +147 -0
  171. package/src/components/Catalog/CatalogFilter/CatalogFilterSelect.tsx +136 -0
  172. package/src/components/Catalog/CatalogSelector.tsx +0 -1
  173. package/src/components/Catalog/variables.ts +0 -1
  174. package/src/components/Dropdown/Dropdown.tsx +84 -79
  175. package/src/components/Filter/FilterInput.tsx +3 -2
  176. package/src/components/Filter/FilterOptions.tsx +2 -0
  177. package/src/components/Filter/variables.ts +7 -4
  178. package/src/components/Menu/MenuItem.tsx +1 -0
  179. package/src/components/Search/SearchAiConversationInput.tsx +12 -2
  180. package/src/components/Search/SearchAiDialog.tsx +2 -2
  181. package/src/components/Search/SearchAiResponse.tsx +2 -2
  182. package/src/components/Search/SearchDialog.tsx +13 -5
  183. package/src/components/Search/variables.ts +5 -1
  184. package/src/components/Tag/variables.dark.ts +2 -2
  185. package/src/core/constants/search.ts +8 -4
  186. package/src/core/hooks/use-tabs.ts +168 -86
  187. package/src/core/styles/dark.ts +11 -8
  188. package/src/core/styles/global.ts +7 -2
  189. package/src/core/types/hooks.ts +6 -1
  190. package/src/core/types/l10n.ts +2 -0
  191. package/src/icons/AiStarsIcon/AiStarsIcon.tsx +11 -2
  192. package/src/icons/RedoclyIcon/RedoclyIcon.tsx +26 -0
  193. package/src/index.ts +2 -0
  194. package/src/layouts/RootLayout.tsx +6 -0
  195. package/src/markdoc/components/Tabs/TabList.tsx +312 -105
  196. package/src/markdoc/components/Tabs/Tabs.tsx +136 -11
@@ -0,0 +1,12 @@
1
+ import type { PropsWithChildren, ReactNode, JSX } from 'react';
2
+ import type { AccordionHeaderProps } from '../../components/Accordion/AccordionHeader';
3
+ export type AccordionProps = {
4
+ expanded?: boolean;
5
+ isExpandable?: boolean;
6
+ className?: string;
7
+ renderChildrenHidden?: boolean;
8
+ header?: ReactNode | ((props: AccordionHeaderProps) => ReactNode);
9
+ onToggle?: (expanded: boolean) => void;
10
+ dataTestId?: string;
11
+ };
12
+ export declare function Accordion({ expanded, isExpandable, renderChildrenHidden, header, className, children, onToggle, dataTestId, }: PropsWithChildren<AccordionProps>): JSX.Element;
@@ -0,0 +1,85 @@
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
+ })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.Accordion = Accordion;
40
+ const react_1 = __importStar(require("react"));
41
+ const styled_components_1 = __importDefault(require("styled-components"));
42
+ const AccordionBody_1 = require("../../components/Accordion/AccordionBody");
43
+ const AccordionHeader_1 = require("../../components/Accordion/AccordionHeader");
44
+ const AccordionTitle_1 = require("../../components/Accordion/AccordionTitle");
45
+ const ChevronDownIcon_1 = require("../../icons/ChevronDownIcon/ChevronDownIcon");
46
+ const ChevronRightIcon_1 = require("../../icons/ChevronRightIcon/ChevronRightIcon");
47
+ function Accordion({ expanded = true, isExpandable = true, renderChildrenHidden = false, header, className, children, onToggle, dataTestId, }) {
48
+ const [isExpanded, setExpanded] = (0, react_1.useState)(expanded);
49
+ const [animate, setAnimate] = (0, react_1.useState)(false);
50
+ const toggle = ({ target }) => {
51
+ if (target instanceof HTMLAnchorElement || !isExpandable)
52
+ return;
53
+ setAnimate(true);
54
+ setExpanded(!isExpanded);
55
+ onToggle === null || onToggle === void 0 ? void 0 : onToggle(!isExpanded);
56
+ };
57
+ (0, react_1.useEffect)(() => setExpanded(expanded), [expanded]);
58
+ return (react_1.default.createElement(AccordionWrapper, { className: className, "data-testid": dataTestId, "data-component-name": "Accordion/Accordion" },
59
+ header &&
60
+ (typeof header === 'function' ? (header({ expanded: isExpanded })) : (react_1.default.createElement(AccordionHeader_1.AccordionHeader, { "data-testid": "accordion-header", onClick: toggle, expanded: isExpanded, isExpandable: isExpandable },
61
+ react_1.default.createElement(HeaderContent, null,
62
+ react_1.default.createElement(AccordionTitle_1.AccordionTitle, { "data-testid": "title" }, header),
63
+ isExpandable &&
64
+ (isExpanded ? (react_1.default.createElement(ChevronDownIcon_1.ChevronDownIcon, { color: "--accordion-chevron-icon-color" })) : (react_1.default.createElement(ChevronRightIcon_1.ChevronRightIcon, { color: "--accordion-chevron-icon-color" }))))))),
65
+ (isExpanded || renderChildrenHidden) && (react_1.default.createElement(AccordionBody_1.AccordionBody, { "data-testid": "accordion-body", hidden: !isExpanded, animate: animate }, children))));
66
+ }
67
+ const AccordionWrapper = styled_components_1.default.div `
68
+ background-color: transparent;
69
+ font-family: var(--accordion-font-family);
70
+ font-size: var(--accordion-font-size);
71
+ font-weight: var(--accordion-font-weight);
72
+ border-radius: var(--accordion-border-radius);
73
+ border: var(--accordion-border);
74
+
75
+ &:not(:last-child) {
76
+ margin-bottom: var(--accordion-gap);
77
+ }
78
+ `;
79
+ const HeaderContent = styled_components_1.default.div `
80
+ display: flex;
81
+ align-items: center;
82
+ width: 100%;
83
+ gap: var(--spacing-xs);
84
+ `;
85
+ //# sourceMappingURL=Accordion.js.map
@@ -0,0 +1,8 @@
1
+ import type { JSX, ReactNode } from 'react';
2
+ export type AccordionBodyProps = {
3
+ animate?: boolean;
4
+ hidden?: boolean;
5
+ children?: ReactNode;
6
+ className?: string;
7
+ };
8
+ export declare function AccordionBody({ animate, hidden, children, className, }: AccordionBodyProps): JSX.Element;
@@ -0,0 +1,73 @@
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
+ })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.AccordionBody = AccordionBody;
40
+ const react_1 = __importDefault(require("react"));
41
+ const styled_components_1 = __importStar(require("styled-components"));
42
+ function AccordionBody({ animate, hidden, children, className, }) {
43
+ return (react_1.default.createElement(AccordionBodyWrapper, { className: className, "$animate": animate, "$hidden": hidden, "data-component-name": "Accordion/AccordionBody" }, children));
44
+ }
45
+ const showAccordion = (0, styled_components_1.keyframes) `
46
+ 0% {
47
+ opacity: 0;
48
+ transform: translateY(-5px);
49
+ }
50
+ 100% {
51
+ opacity: 1;
52
+ transform: translateY(0);
53
+ }
54
+ `;
55
+ const showAccordionAnimation = (0, styled_components_1.css) `
56
+ animation: ${showAccordion} 0.15s ease-out;
57
+ `;
58
+ const AccordionBodyWrapper = styled_components_1.default.div `
59
+ ${({ $animate }) => $animate && showAccordionAnimation};
60
+ ${({ $hidden }) => $hidden && 'visibility: hidden'};
61
+
62
+ background-color: var(--accordion-body-bg-color);
63
+
64
+ font-family: var(--accordion-body-font-family);
65
+ font-size: var(--accordion-body-font-size);
66
+ font-weight: var(--accordion-body-font-weight);
67
+ border: var(--accordion-body-border);
68
+ padding: var(--accordion-body-padding);
69
+ color: var(--accordion-body-text-color);
70
+
71
+ border-radius: var(--accordion-border-radius);
72
+ `;
73
+ //# sourceMappingURL=AccordionBody.js.map
@@ -0,0 +1,10 @@
1
+ import type { BaseSyntheticEvent, JSX, ReactNode } from 'react';
2
+ export type AccordionHeaderProps = {
3
+ isExpandable?: boolean;
4
+ expanded?: boolean;
5
+ disabled?: boolean;
6
+ children?: ReactNode;
7
+ className?: string;
8
+ onClick?: (e: BaseSyntheticEvent) => void;
9
+ };
10
+ export declare function AccordionHeader({ isExpandable, expanded, disabled, children, className, onClick, }: AccordionHeaderProps): JSX.Element;
@@ -0,0 +1,37 @@
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.AccordionHeader = AccordionHeader;
7
+ const react_1 = __importDefault(require("react"));
8
+ const styled_components_1 = __importDefault(require("styled-components"));
9
+ function AccordionHeader({ isExpandable, expanded, disabled, children, className, onClick, }) {
10
+ return (react_1.default.createElement(AccordionHeaderWrapper, { className: className, "$isExpandable": isExpandable, "$expanded": expanded, "$disabled": disabled, onClick: onClick, "data-component-name": "Accordion/AccordionHeader" }, children));
11
+ }
12
+ const AccordionHeaderWrapper = styled_components_1.default.div `
13
+ display: flex;
14
+ gap: var(--spacing-xs);
15
+ align-items: center;
16
+ justify-content: space-between;
17
+ min-height: 32px;
18
+ color: var(--accordion-header-text-color);
19
+
20
+ cursor: ${({ $isExpandable = true }) => ($isExpandable ? 'pointer' : 'default')};
21
+
22
+ line-height: var(--accordion-header-line-height);
23
+ font-size: var(--accordion-header-font-size);
24
+ font-family: var(--accordion-header-font-family);
25
+ font-weight: var(--accordion-header-font-weight);
26
+ padding: var(--accordion-header-padding);
27
+ border: var(--accordion-header-border);
28
+ background-color: var(--accordion-header-bg-color);
29
+ border-radius: var(--accordion-border-radius);
30
+
31
+ pointer-events: ${({ $disabled }) => ($disabled ? 'none' : 'auto')};
32
+
33
+ &:hover {
34
+ color: ${({ $isExpandable = true }) => $isExpandable ? 'var(--text-color-primary)' : 'var(--accordion-header-text-color)'};
35
+ }
36
+ `;
37
+ //# sourceMappingURL=AccordionHeader.js.map
@@ -0,0 +1,6 @@
1
+ import type { JSX, ReactNode } from 'react';
2
+ export type AccordionTitleProps = {
3
+ children?: ReactNode;
4
+ className?: string;
5
+ };
6
+ export declare function AccordionTitle({ children, className }: AccordionTitleProps): JSX.Element;
@@ -0,0 +1,20 @@
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.AccordionTitle = AccordionTitle;
7
+ const react_1 = __importDefault(require("react"));
8
+ const styled_components_1 = __importDefault(require("styled-components"));
9
+ function AccordionTitle({ children, className }) {
10
+ return (react_1.default.createElement(AccordionTitleWrapper, { className: className, "data-component-name": "Accordion/AccordionTitle" }, children));
11
+ }
12
+ const AccordionTitleWrapper = styled_components_1.default.span `
13
+ font-weight: var(--accordion-header-font-weight);
14
+ line-height: var(--line-height-base);
15
+ overflow: hidden;
16
+ text-overflow: ellipsis;
17
+ color: var(--accordion-header-text-color);
18
+ flex: 1;
19
+ `;
20
+ //# sourceMappingURL=AccordionTitle.js.map
@@ -0,0 +1 @@
1
+ export declare const accordion: import("styled-components").FlattenSimpleInterpolation;
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.accordion = void 0;
4
+ const styled_components_1 = require("styled-components");
5
+ exports.accordion = (0, styled_components_1.css) `
6
+ /**
7
+ * @tokens Accordion spacing
8
+ * @presenter Spacing
9
+ */
10
+
11
+ --accordion-gap: var(--spacing-base);
12
+
13
+ /**
14
+ * @tokens Accordion common
15
+ */
16
+
17
+ --accordion-border-radius: var(--border-radius); // @presenter BorderRadius
18
+ --accordion-border: none; // @presenter Border
19
+
20
+ --accordion-line-height: var(--line-height-base); // @presenter LineHeight
21
+ --accordion-font-size: var(--font-size-base); // @presenter FontSize
22
+ --accordion-font-family: var(--font-family-base); // @presenter FontFamily
23
+ --accordion-font-weight: var(--font-weight-regular); // @presenter FontWeight
24
+
25
+ /**
26
+ * @tokens Accordion header common
27
+ */
28
+
29
+ --accordion-header-font-family: var(--font-family-base); // @presenter FontFamily
30
+ --accordion-header-font-size: var(--font-size-base); // @presenter FontSize
31
+ --accordion-header-font-weight: var(--font-weight-medium, 500); // @presenter FontWeight
32
+ --accordion-header-text-color: var(--text-color-primary);
33
+ --accordion-header-padding: var(--spacing-sm) var(--spacing-base);
34
+ --accordion-header-line-height: var(--line-height-base); // @presenter LineHeight
35
+ --accordion-header-bg-color: transparent; // @presenter Color
36
+ --accordion-header-border: none; // @presenter Border
37
+
38
+ /**
39
+ * @tokens Accordion body common
40
+ */
41
+
42
+ --accordion-body-font-family: var(--font-family-base); // @presenter FontFamily
43
+ --accordion-body-font-size: var(--font-size-base); // @presenter FontSize
44
+ --accordion-body-font-weight: var(--font-weight-regular); // @presenter FontWeight
45
+ --accordion-body-text-color: var(--text-color-secondary);
46
+ --accordion-body-padding: 0 var(--spacing-xs) var(--spacing-sm);
47
+ --accordion-body-bg-color: transparent; // @presenter Color
48
+ --accordion-body-border: none; // @presenter Border
49
+
50
+ /**
51
+ * @tokens Accordion chevron icon
52
+ */
53
+
54
+ --accordion-chevron-icon-color: var(--text-color-secondary); // @presenter Color
55
+ --accordion-chevron-icon-size: 16px;
56
+
57
+ // @tokens End
58
+ `;
59
+ //# sourceMappingURL=variables.js.map
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
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
+ })();
25
35
  var __importDefault = (this && this.__importDefault) || function (mod) {
26
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
37
  };
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
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
+ })();
25
35
  var __importDefault = (this && this.__importDefault) || function (mod) {
26
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
37
  };
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
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
+ })();
25
35
  var __importDefault = (this && this.__importDefault) || function (mod) {
26
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
37
  };
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
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
+ })();
25
35
  var __importDefault = (this && this.__importDefault) || function (mod) {
26
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
37
  };
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
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
+ })();
25
35
  var __importDefault = (this && this.__importDefault) || function (mod) {
26
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
37
  };
@@ -0,0 +1,2 @@
1
+ import * as React from 'react';
2
+ export declare function AIAssistantButton(): React.JSX.Element | null;
@@ -0,0 +1,135 @@
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
+ })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.AIAssistantButton = AIAssistantButton;
40
+ const React = __importStar(require("react"));
41
+ const react_1 = require("react");
42
+ const styled_components_1 = __importDefault(require("styled-components"));
43
+ const Button_1 = require("../../components/Button/Button");
44
+ const SearchDialog_1 = require("../../components/Search/SearchDialog");
45
+ const hooks_1 = require("../../core/hooks");
46
+ const ChatIcon_1 = require("../../icons/ChatIcon/ChatIcon");
47
+ const AiStarsGradientIcon_1 = require("../../icons/AiStarsGradientIcon/AiStarsGradientIcon");
48
+ const RedoclyIcon_1 = require("../../icons/RedoclyIcon/RedoclyIcon");
49
+ const defaultConfig = {
50
+ hide: false,
51
+ inputType: 'button',
52
+ inputIcon: 'redocly',
53
+ };
54
+ const getIcon = (iconType, inputType = 'button') => {
55
+ const iconSize = inputType === 'icon'
56
+ ? 'var(--ai-assistant-button-icon-icon-size)'
57
+ : 'var(--ai-assistant-button-text-icon-size)';
58
+ const redoclyIcon = (React.createElement(RedoclyIcon_1.RedoclyIcon, { size: iconSize, color: "var(--ai-assistant-button-redocly-icon-color)" }));
59
+ const sparklesIcon = (React.createElement(AiStarsGradientIcon_1.AiStarsGradientIcon, { size: iconSize, color: "var(--search-ai-button-icon-color)" }));
60
+ const chatIcon = React.createElement(ChatIcon_1.ChatIcon, { size: iconSize });
61
+ switch (iconType) {
62
+ case 'chat':
63
+ return chatIcon;
64
+ case 'sparkles':
65
+ return sparklesIcon;
66
+ case 'redocly':
67
+ return redoclyIcon;
68
+ default:
69
+ return redoclyIcon;
70
+ }
71
+ };
72
+ function AIAssistantButton() {
73
+ var _a, _b;
74
+ const [isOpen, setIsOpen] = (0, react_1.useState)(false);
75
+ const themeConfig = (0, hooks_1.useThemeConfig)();
76
+ const { useTranslate } = (0, hooks_1.useThemeHooks)();
77
+ const { translate } = useTranslate();
78
+ const buttonConfig = Object.assign(Object.assign({}, defaultConfig), ((_b = (_a = themeConfig.aiAssistant) === null || _a === void 0 ? void 0 : _a.trigger) !== null && _b !== void 0 ? _b : {}));
79
+ const { hide, inputIcon, inputType } = buttonConfig;
80
+ if (hide) {
81
+ return null;
82
+ }
83
+ const icon = getIcon(inputIcon, inputType);
84
+ const text = translate('aiAssistant.trigger', 'Ask AI');
85
+ const handleOpen = () => {
86
+ setIsOpen(true);
87
+ };
88
+ const handleClose = () => {
89
+ setIsOpen(false);
90
+ };
91
+ return (React.createElement(React.Fragment, null,
92
+ React.createElement(StyledAIAssistantButton, { variant: "outlined", size: "medium", "$inputType": inputType, onClick: handleOpen, "aria-label": `AI Assistant button - ${inputIcon}`, "data-component-name": "Buttons/AIAssistantButton" },
93
+ icon,
94
+ inputType === 'button' && text),
95
+ isOpen && React.createElement(SearchDialog_1.SearchDialog, { onClose: handleClose, initialMode: "ai-dialog" })));
96
+ }
97
+ const StyledAIAssistantButton = (0, styled_components_1.default)(Button_1.Button) `
98
+ position: fixed;
99
+ bottom: var(--ai-assistant-button-bottom);
100
+ right: var(--ai-assistant-button-right);
101
+ ${({ $inputType }) => $inputType === 'icon'
102
+ ? `
103
+ border-radius: var(--ai-assistant-button-border-radius-icon);
104
+ width: var(--ai-assistant-button-icon-size);
105
+ height: var(--ai-assistant-button-icon-size);
106
+ `
107
+ : `
108
+ border-radius: var(--ai-assistant-button-border-radius-text);
109
+ padding: var(--ai-assistant-button-text-padding);
110
+ height: var(--ai-assistant-button-text-height);
111
+ `}
112
+ min-width: var(--ai-assistant-button-min-width);
113
+ font-size: var(--ai-assistant-button-font-size);
114
+ font-weight: var(--ai-assistant-button-font-weight);
115
+ box-shadow: var(--bg-raised-shadow);
116
+ z-index: var(--ai-assistant-button-z-index);
117
+ display: flex;
118
+ align-items: center;
119
+ justify-content: center;
120
+ gap: var(--ai-assistant-button-gap);
121
+ background-color: var(--ai-assistant-button-bg-color) !important;
122
+
123
+ transition: var(--ai-assistant-button-transition);
124
+
125
+ &:hover {
126
+ box-shadow: var(--ai-assistant-button-shadow-hover);
127
+ transform: var(--ai-assistant-button-transform-hover);
128
+ }
129
+
130
+ &:active {
131
+ transform: var(--bg-raised-shadow);
132
+ box-shadow: var(--ai-assistant-button-shadow-active);
133
+ }
134
+ `;
135
+ //# sourceMappingURL=AIAssistantButton.js.map
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
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
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
36
  exports.CopyButton = void 0;
27
37
  const react_1 = __importStar(require("react"));
@@ -0,0 +1 @@
1
+ export declare const aiAssistantButton: import("styled-components").FlattenSimpleInterpolation;