@redocly/theme 0.47.0 → 0.48.0

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 (219) hide show
  1. package/lib/components/Buttons/CopyButton.d.ts +8 -3
  2. package/lib/components/Buttons/CopyButton.js +4 -3
  3. package/lib/components/Feedback/Mood.d.ts +2 -2
  4. package/lib/components/Feedback/Mood.js +6 -6
  5. package/lib/components/Feedback/Rating.d.ts +2 -2
  6. package/lib/components/Feedback/Rating.js +6 -6
  7. package/lib/components/Feedback/Scale.d.ts +2 -2
  8. package/lib/components/Feedback/Scale.js +6 -6
  9. package/lib/components/Feedback/Sentiment.d.ts +2 -2
  10. package/lib/components/Feedback/Sentiment.js +6 -6
  11. package/lib/components/Search/SearchDialog.js +8 -8
  12. package/lib/components/Search/SearchFilter.d.ts +3 -2
  13. package/lib/components/Search/SearchFilter.js +2 -2
  14. package/lib/components/Search/SearchFilterField.d.ts +3 -2
  15. package/lib/components/Search/SearchFilterField.js +2 -2
  16. package/lib/components/Search/SearchGroups.d.ts +5 -4
  17. package/lib/components/Search/SearchGroups.js +3 -3
  18. package/lib/components/StatusCode/StatusCode.js +11 -14
  19. package/lib/core/constants/code-walkthrough.d.ts +1 -0
  20. package/lib/core/constants/code-walkthrough.js +5 -0
  21. package/lib/core/constants/index.d.ts +1 -0
  22. package/lib/core/constants/index.js +1 -0
  23. package/lib/core/contexts/CodeWalkthrough/CodeWalkthroughControlsContext.d.ts +2 -0
  24. package/lib/core/contexts/CodeWalkthrough/CodeWalkthroughControlsContext.js +18 -0
  25. package/lib/core/contexts/CodeWalkthrough/CodeWalkthroughStepsContext.d.ts +2 -0
  26. package/lib/core/contexts/CodeWalkthrough/CodeWalkthroughStepsContext.js +11 -0
  27. package/lib/core/contexts/index.d.ts +2 -0
  28. package/lib/core/contexts/index.js +2 -0
  29. package/lib/core/hooks/__mocks__/search/use-search-filter.d.ts +1 -1
  30. package/lib/core/hooks/__mocks__/search/use-search-filter.js +1 -1
  31. package/lib/core/hooks/code-walkthrough/__mocks__/MockIntersectionObserver.d.ts +10 -0
  32. package/lib/core/hooks/code-walkthrough/__mocks__/MockIntersectionObserver.js +55 -0
  33. package/lib/core/hooks/code-walkthrough/use-code-panel.d.ts +6 -0
  34. package/lib/core/hooks/code-walkthrough/use-code-panel.js +93 -0
  35. package/lib/core/hooks/code-walkthrough/use-code-walkthrough-controls.d.ts +22 -0
  36. package/lib/core/hooks/code-walkthrough/use-code-walkthrough-controls.js +183 -0
  37. package/lib/core/hooks/code-walkthrough/use-code-walkthrough-steps.d.ts +16 -0
  38. package/lib/core/hooks/code-walkthrough/use-code-walkthrough-steps.js +117 -0
  39. package/lib/core/hooks/code-walkthrough/use-code-walkthrough.d.ts +14 -0
  40. package/lib/core/hooks/code-walkthrough/use-code-walkthrough.js +22 -0
  41. package/lib/core/hooks/index.d.ts +4 -0
  42. package/lib/core/hooks/index.js +4 -0
  43. package/lib/core/hooks/search/use-search-filter.d.ts +2 -2
  44. package/lib/core/hooks/search/use-search-filter.js +5 -5
  45. package/lib/core/styles/global.js +2 -0
  46. package/lib/core/templates/Markdown.d.ts +8 -2
  47. package/lib/core/templates/Markdown.js +5 -2
  48. package/lib/core/types/hooks.d.ts +3 -0
  49. package/lib/core/types/l10n.d.ts +1 -1
  50. package/lib/core/types/search.d.ts +1 -2
  51. package/lib/core/utils/download-code-walkthrough.d.ts +4 -0
  52. package/lib/core/utils/download-code-walkthrough.js +32 -0
  53. package/lib/core/utils/get-code-walkthrough-file-text.d.ts +4 -0
  54. package/lib/core/utils/get-code-walkthrough-file-text.js +22 -0
  55. package/lib/core/utils/get-file-icon.d.ts +2 -0
  56. package/lib/core/utils/get-file-icon.js +31 -0
  57. package/lib/core/utils/index.d.ts +5 -0
  58. package/lib/core/utils/index.js +5 -0
  59. package/lib/core/utils/js-utils.d.ts +30 -0
  60. package/lib/core/utils/js-utils.js +41 -0
  61. package/lib/core/utils/match-code-walkthrough-conditions.d.ts +4 -0
  62. package/lib/core/utils/match-code-walkthrough-conditions.js +23 -0
  63. package/lib/core/utils/replace-inputs-with-value.d.ts +3 -0
  64. package/lib/core/utils/replace-inputs-with-value.js +16 -0
  65. package/lib/icons/DocumentCssIcon/DocumentCssIcon.d.ts +9 -0
  66. package/lib/icons/DocumentCssIcon/DocumentCssIcon.js +23 -0
  67. package/lib/icons/DocumentCssIcon/index.d.ts +1 -0
  68. package/lib/icons/DocumentCssIcon/index.js +6 -0
  69. package/lib/icons/DocumentGraphqlIcon/DocumentGraphqlIcon.d.ts +9 -0
  70. package/lib/icons/DocumentGraphqlIcon/DocumentGraphqlIcon.js +31 -0
  71. package/lib/icons/DocumentGraphqlIcon/index.d.ts +1 -0
  72. package/lib/icons/DocumentGraphqlIcon/index.js +6 -0
  73. package/lib/icons/DocumentHtmlIcon/DocumentHtmlIcon.d.ts +9 -0
  74. package/lib/icons/DocumentHtmlIcon/DocumentHtmlIcon.js +23 -0
  75. package/lib/icons/DocumentHtmlIcon/index.d.ts +1 -0
  76. package/lib/icons/DocumentHtmlIcon/index.js +6 -0
  77. package/lib/icons/DocumentJsIcon/DocumentJsIcon.d.ts +9 -0
  78. package/lib/icons/DocumentJsIcon/DocumentJsIcon.js +23 -0
  79. package/lib/icons/DocumentJsIcon/index.d.ts +1 -0
  80. package/lib/icons/DocumentJsIcon/index.js +6 -0
  81. package/lib/icons/DocumentJsonIcon/DocumentJsonIcon.d.ts +9 -0
  82. package/lib/icons/DocumentJsonIcon/DocumentJsonIcon.js +23 -0
  83. package/lib/icons/DocumentJsonIcon/index.d.ts +1 -0
  84. package/lib/icons/DocumentJsonIcon/index.js +6 -0
  85. package/lib/icons/DocumentMarkdownIcon/DocumentMarkdownIcon.d.ts +9 -0
  86. package/lib/icons/DocumentMarkdownIcon/DocumentMarkdownIcon.js +23 -0
  87. package/lib/icons/DocumentMarkdownIcon/index.d.ts +1 -0
  88. package/lib/icons/DocumentMarkdownIcon/index.js +6 -0
  89. package/lib/icons/DocumentReactIcon/DocumentReactIcon.d.ts +9 -0
  90. package/lib/icons/DocumentReactIcon/DocumentReactIcon.js +23 -0
  91. package/lib/icons/DocumentReactIcon/index.d.ts +1 -0
  92. package/lib/icons/DocumentReactIcon/index.js +6 -0
  93. package/lib/icons/DocumentTsIcon/DocumentTsIcon.d.ts +9 -0
  94. package/lib/icons/DocumentTsIcon/DocumentTsIcon.js +23 -0
  95. package/lib/icons/DocumentTsIcon/index.d.ts +1 -0
  96. package/lib/icons/DocumentTsIcon/index.js +6 -0
  97. package/lib/icons/DocumentYamlIcon/DocumentYamlIcon.d.ts +9 -0
  98. package/lib/icons/DocumentYamlIcon/DocumentYamlIcon.js +23 -0
  99. package/lib/icons/DocumentYamlIcon/index.d.ts +1 -0
  100. package/lib/icons/DocumentYamlIcon/index.js +6 -0
  101. package/lib/index.d.ts +1 -0
  102. package/lib/index.js +1 -0
  103. package/lib/layouts/CodeWalkthroughLayout.d.ts +5 -0
  104. package/lib/layouts/CodeWalkthroughLayout.js +72 -0
  105. package/lib/markdoc/attributes/code-walkthrough-filesets.d.ts +5 -0
  106. package/lib/markdoc/attributes/code-walkthrough-filesets.js +16 -0
  107. package/lib/markdoc/attributes/code-walkthrough-filters.d.ts +5 -0
  108. package/lib/markdoc/attributes/code-walkthrough-filters.js +16 -0
  109. package/lib/markdoc/components/CodeWalkthrough/CodeContainer.d.ts +5 -0
  110. package/lib/markdoc/components/CodeWalkthrough/CodeContainer.js +81 -0
  111. package/lib/markdoc/components/CodeWalkthrough/CodeFilters.d.ts +12 -0
  112. package/lib/markdoc/components/CodeWalkthrough/CodeFilters.js +58 -0
  113. package/lib/markdoc/components/CodeWalkthrough/CodePanel.d.ts +8 -0
  114. package/lib/markdoc/components/CodeWalkthrough/CodePanel.js +64 -0
  115. package/lib/markdoc/components/CodeWalkthrough/CodePanelHeader.d.ts +8 -0
  116. package/lib/markdoc/components/CodeWalkthrough/CodePanelHeader.js +155 -0
  117. package/lib/markdoc/components/CodeWalkthrough/CodePanelPreview.d.ts +2 -0
  118. package/lib/markdoc/components/CodeWalkthrough/CodePanelPreview.js +73 -0
  119. package/lib/markdoc/components/CodeWalkthrough/CodePanelToolbar.d.ts +5 -0
  120. package/lib/markdoc/components/CodeWalkthrough/CodePanelToolbar.js +47 -0
  121. package/lib/markdoc/components/CodeWalkthrough/CodeStep.d.ts +12 -0
  122. package/lib/markdoc/components/CodeWalkthrough/CodeStep.js +128 -0
  123. package/lib/markdoc/components/CodeWalkthrough/CodeToggle.d.ts +9 -0
  124. package/lib/markdoc/components/CodeWalkthrough/CodeToggle.js +69 -0
  125. package/lib/markdoc/components/CodeWalkthrough/CodeWalkthrough.d.ts +4 -0
  126. package/lib/markdoc/components/CodeWalkthrough/CodeWalkthrough.js +121 -0
  127. package/lib/markdoc/components/CodeWalkthrough/Input.d.ts +8 -0
  128. package/lib/markdoc/components/CodeWalkthrough/Input.js +99 -0
  129. package/lib/markdoc/components/CodeWalkthrough/variables.d.ts +1 -0
  130. package/lib/markdoc/components/CodeWalkthrough/variables.js +19 -0
  131. package/lib/markdoc/components/default.d.ts +5 -0
  132. package/lib/markdoc/components/default.js +5 -0
  133. package/lib/markdoc/default.js +8 -0
  134. package/lib/markdoc/tags/code-step.d.ts +2 -0
  135. package/lib/markdoc/tags/code-step.js +28 -0
  136. package/lib/markdoc/tags/code-toggle.d.ts +2 -0
  137. package/lib/markdoc/tags/code-toggle.js +40 -0
  138. package/lib/markdoc/tags/code-walkthrough.d.ts +8 -0
  139. package/lib/markdoc/tags/code-walkthrough.js +242 -0
  140. package/lib/markdoc/tags/input.d.ts +2 -0
  141. package/lib/markdoc/tags/input.js +37 -0
  142. package/lib/plugin.d.ts +2 -1
  143. package/lib/plugin.js +2 -4
  144. package/package.json +10 -3
  145. package/src/components/Buttons/CopyButton.tsx +24 -6
  146. package/src/components/Feedback/Mood.tsx +9 -10
  147. package/src/components/Feedback/Rating.tsx +9 -10
  148. package/src/components/Feedback/Scale.tsx +9 -10
  149. package/src/components/Feedback/Sentiment.tsx +9 -10
  150. package/src/components/Search/SearchDialog.tsx +11 -6
  151. package/src/components/Search/SearchFilter.tsx +6 -3
  152. package/src/components/Search/SearchFilterField.tsx +4 -2
  153. package/src/components/Search/SearchGroups.tsx +13 -8
  154. package/src/components/StatusCode/StatusCode.ts +11 -10
  155. package/src/core/constants/code-walkthrough.ts +1 -0
  156. package/src/core/constants/index.ts +1 -0
  157. package/src/core/contexts/CodeWalkthrough/CodeWalkthroughControlsContext.tsx +21 -0
  158. package/src/core/contexts/CodeWalkthrough/CodeWalkthroughStepsContext.tsx +10 -0
  159. package/src/core/contexts/index.ts +2 -0
  160. package/src/core/hooks/__mocks__/search/use-search-filter.ts +1 -1
  161. package/src/core/hooks/code-walkthrough/__mocks__/MockIntersectionObserver.ts +22 -0
  162. package/src/core/hooks/code-walkthrough/use-code-panel.ts +164 -0
  163. package/src/core/hooks/code-walkthrough/use-code-walkthrough-controls.ts +302 -0
  164. package/src/core/hooks/code-walkthrough/use-code-walkthrough-steps.ts +165 -0
  165. package/src/core/hooks/code-walkthrough/use-code-walkthrough.ts +51 -0
  166. package/src/core/hooks/index.ts +4 -0
  167. package/src/core/hooks/search/use-search-filter.ts +9 -5
  168. package/src/core/styles/global.ts +2 -0
  169. package/src/core/templates/Markdown.tsx +16 -5
  170. package/src/core/types/hooks.ts +3 -0
  171. package/src/core/types/l10n.ts +5 -3
  172. package/src/core/types/search.ts +1 -2
  173. package/src/core/utils/download-code-walkthrough.ts +25 -0
  174. package/src/core/utils/get-code-walkthrough-file-text.ts +32 -0
  175. package/src/core/utils/get-file-icon.ts +35 -0
  176. package/src/core/utils/index.ts +5 -0
  177. package/src/core/utils/js-utils.ts +48 -0
  178. package/src/core/utils/match-code-walkthrough-conditions.ts +29 -0
  179. package/src/core/utils/replace-inputs-with-value.ts +11 -0
  180. package/src/icons/DocumentCssIcon/DocumentCssIcon.tsx +36 -0
  181. package/src/icons/DocumentCssIcon/index.ts +1 -0
  182. package/src/icons/DocumentGraphqlIcon/DocumentGraphqlIcon.tsx +64 -0
  183. package/src/icons/DocumentGraphqlIcon/index.ts +1 -0
  184. package/src/icons/DocumentHtmlIcon/DocumentHtmlIcon.tsx +36 -0
  185. package/src/icons/DocumentHtmlIcon/index.ts +1 -0
  186. package/src/icons/DocumentJsIcon/DocumentJsIcon.tsx +36 -0
  187. package/src/icons/DocumentJsIcon/index.ts +1 -0
  188. package/src/icons/DocumentJsonIcon/DocumentJsonIcon.tsx +36 -0
  189. package/src/icons/DocumentJsonIcon/index.ts +1 -0
  190. package/src/icons/DocumentMarkdownIcon/DocumentMarkdownIcon.tsx +36 -0
  191. package/src/icons/DocumentMarkdownIcon/index.ts +1 -0
  192. package/src/icons/DocumentReactIcon/DocumentReactIcon.tsx +36 -0
  193. package/src/icons/DocumentReactIcon/index.ts +1 -0
  194. package/src/icons/DocumentTsIcon/DocumentTsIcon.tsx +38 -0
  195. package/src/icons/DocumentTsIcon/index.ts +1 -0
  196. package/src/icons/DocumentYamlIcon/DocumentYamlIcon.tsx +36 -0
  197. package/src/icons/DocumentYamlIcon/index.ts +1 -0
  198. package/src/index.ts +1 -0
  199. package/src/layouts/CodeWalkthroughLayout.tsx +78 -0
  200. package/src/markdoc/attributes/code-walkthrough-filesets.ts +9 -0
  201. package/src/markdoc/attributes/code-walkthrough-filters.ts +9 -0
  202. package/src/markdoc/components/CodeWalkthrough/CodeContainer.tsx +76 -0
  203. package/src/markdoc/components/CodeWalkthrough/CodeFilters.tsx +87 -0
  204. package/src/markdoc/components/CodeWalkthrough/CodePanel.tsx +68 -0
  205. package/src/markdoc/components/CodeWalkthrough/CodePanelHeader.tsx +192 -0
  206. package/src/markdoc/components/CodeWalkthrough/CodePanelPreview.tsx +53 -0
  207. package/src/markdoc/components/CodeWalkthrough/CodePanelToolbar.tsx +31 -0
  208. package/src/markdoc/components/CodeWalkthrough/CodeStep.tsx +149 -0
  209. package/src/markdoc/components/CodeWalkthrough/CodeToggle.tsx +63 -0
  210. package/src/markdoc/components/CodeWalkthrough/CodeWalkthrough.tsx +111 -0
  211. package/src/markdoc/components/CodeWalkthrough/Input.tsx +101 -0
  212. package/src/markdoc/components/CodeWalkthrough/variables.ts +16 -0
  213. package/src/markdoc/components/default.ts +5 -0
  214. package/src/markdoc/default.ts +8 -0
  215. package/src/markdoc/tags/code-step.ts +27 -0
  216. package/src/markdoc/tags/code-toggle.ts +37 -0
  217. package/src/markdoc/tags/code-walkthrough.ts +315 -0
  218. package/src/markdoc/tags/input.ts +35 -0
  219. package/src/plugin.js +2 -2
@@ -0,0 +1,23 @@
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.DocumentMarkdownIcon = void 0;
7
+ const react_1 = __importDefault(require("react"));
8
+ const styled_components_1 = __importDefault(require("styled-components"));
9
+ const utils_1 = require("../../core/utils");
10
+ const Icon = (props) => (react_1.default.createElement("svg", Object.assign({ width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
11
+ react_1.default.createElement("g", { id: "iconMarkdown" },
12
+ react_1.default.createElement("path", { id: "Vector", d: "M1.5 10.5003V5.16699H2.83333L4.83333 7.16699L6.83333 5.16699H8.16667V10.5003H6.83333V7.05366L4.83333 9.05366L2.83333 7.05366V10.5003H1.5ZM10.8333 5.16699H12.8333V7.83366H14.5L11.8333 10.8337L9.16667 7.83366H10.8333V5.16699Z", fill: "#3B3C45" }))));
13
+ exports.DocumentMarkdownIcon = (0, styled_components_1.default)(Icon).attrs(() => ({
14
+ 'data-component-name': 'icons/DocumentMarkdownIcon/DocumentMarkdownIcon',
15
+ })) `
16
+ path {
17
+ fill: ${({ color }) => (0, utils_1.getCssColorVariable)(color)};
18
+ }
19
+
20
+ height: ${({ size }) => size || '16px'};
21
+ width: ${({ size }) => size || '16px'};
22
+ `;
23
+ //# sourceMappingURL=DocumentMarkdownIcon.js.map
@@ -0,0 +1 @@
1
+ export { DocumentMarkdownIcon } from '../../icons/DocumentMarkdownIcon/DocumentMarkdownIcon';
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DocumentMarkdownIcon = void 0;
4
+ var DocumentMarkdownIcon_1 = require("../../icons/DocumentMarkdownIcon/DocumentMarkdownIcon");
5
+ Object.defineProperty(exports, "DocumentMarkdownIcon", { enumerable: true, get: function () { return DocumentMarkdownIcon_1.DocumentMarkdownIcon; } });
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import type { IconProps } from '../../icons/types';
3
+ export declare const DocumentReactIcon: import("styled-components").StyledComponent<(props: IconProps) => React.JSX.Element, any, {
4
+ 'data-component-name': string;
5
+ } & {
6
+ color?: string;
7
+ size?: string;
8
+ className?: string;
9
+ } & React.SVGProps<SVGSVGElement>, "data-component-name">;
@@ -0,0 +1,23 @@
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.DocumentReactIcon = void 0;
7
+ const react_1 = __importDefault(require("react"));
8
+ const styled_components_1 = __importDefault(require("styled-components"));
9
+ const utils_1 = require("../../core/utils");
10
+ const Icon = (props) => (react_1.default.createElement("svg", Object.assign({ width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
11
+ react_1.default.createElement("g", { id: "iconReact" },
12
+ react_1.default.createElement("path", { id: "Vector", d: "M7.99992 6.74022C8.68658 6.74022 9.24658 7.30022 9.24658 8.00022C9.24658 8.66689 8.68658 9.23356 7.99992 9.23356C7.31325 9.23356 6.75325 8.66689 6.75325 8.00022C6.75325 7.30022 7.31325 6.74022 7.99992 6.74022ZM4.91325 13.3336C5.33325 13.5869 6.25325 13.2002 7.31325 12.2002C6.96659 11.8069 6.62659 11.3802 6.30658 10.9336C5.76935 10.8821 5.23526 10.802 4.70658 10.6936C4.36659 12.1202 4.49325 13.1002 4.91325 13.3336ZM5.38658 9.50689L5.19325 9.16689C5.11992 9.36022 5.04659 9.55356 4.99992 9.74022C5.17992 9.78022 5.37992 9.81356 5.58659 9.84689L5.38658 9.50689ZM9.74658 9.00022L10.2866 8.00022L9.74658 7.00022C9.54659 6.64689 9.33325 6.33356 9.13992 6.02022C8.77992 6.00022 8.39992 6.00022 7.99992 6.00022C7.59992 6.00022 7.21992 6.00022 6.85992 6.02022C6.66658 6.33356 6.45325 6.64689 6.25325 7.00022L5.71325 8.00022L6.25325 9.00022C6.45325 9.35356 6.66658 9.66689 6.85992 9.98022C7.21992 10.0002 7.59992 10.0002 7.99992 10.0002C8.39992 10.0002 8.77992 10.0002 9.13992 9.98022C9.33325 9.66689 9.54659 9.35356 9.74658 9.00022ZM7.99992 4.52022C7.87325 4.66689 7.73992 4.82022 7.60658 5.00022H8.39325C8.25992 4.82022 8.12659 4.66689 7.99992 4.52022ZM7.99992 11.4802C8.12659 11.3336 8.25992 11.1802 8.39325 11.0002H7.60658C7.73992 11.1802 7.87325 11.3336 7.99992 11.4802ZM11.0799 2.66689C10.6666 2.41356 9.74658 2.80022 8.68658 3.80022C9.03325 4.19356 9.37325 4.62022 9.69325 5.06689C10.2399 5.12022 10.7799 5.20022 11.2933 5.30689C11.6333 3.88022 11.5066 2.90022 11.0799 2.66689ZM10.6133 6.49356L10.8066 6.83356C10.8799 6.64022 10.9533 6.44689 10.9999 6.26022C10.8199 6.22022 10.6199 6.18689 10.4133 6.15356L10.6133 6.49356ZM11.5799 1.79356C12.5599 2.35356 12.6666 3.82689 12.2533 5.54689C13.9466 6.04689 15.1666 6.87356 15.1666 8.00022C15.1666 9.12689 13.9466 9.95356 12.2533 10.4536C12.6666 12.1736 12.5599 13.6469 11.5799 14.2069C10.6066 14.7669 9.27992 14.1269 7.99992 12.9069C6.71992 14.1269 5.39325 14.7669 4.41325 14.2069C3.43992 13.6469 3.33325 12.1736 3.74659 10.4536C2.05325 9.95356 0.833252 9.12689 0.833252 8.00022C0.833252 6.87356 2.05325 6.04689 3.74659 5.54689C3.33325 3.82689 3.43992 2.35356 4.41325 1.79356C5.39325 1.23356 6.71992 1.87356 7.99992 3.09356C9.27992 1.87356 10.6066 1.23356 11.5799 1.79356ZM11.3866 8.00022C11.6133 8.50022 11.8133 9.00022 11.9799 9.50689C13.3799 9.08689 14.1666 8.48689 14.1666 8.00022C14.1666 7.51356 13.3799 6.91356 11.9799 6.49356C11.8133 7.00022 11.6133 7.50022 11.3866 8.00022ZM4.61325 8.00022C4.38659 7.50022 4.18659 7.00022 4.01992 6.49356C2.61992 6.91356 1.83325 7.51356 1.83325 8.00022C1.83325 8.48689 2.61992 9.08689 4.01992 9.50689C4.18659 9.00022 4.38659 8.50022 4.61325 8.00022ZM10.6133 9.50689L10.4133 9.84689C10.6199 9.81356 10.8199 9.78022 10.9999 9.74022C10.9533 9.55356 10.8799 9.36022 10.8066 9.16689L10.6133 9.50689ZM8.68658 12.2002C9.74658 13.2002 10.6666 13.5869 11.0799 13.3336C11.5066 13.1002 11.6333 12.1202 11.2933 10.6936C10.7799 10.8002 10.2399 10.8802 9.69325 10.9336C9.37325 11.3802 9.03325 11.8069 8.68658 12.2002ZM5.38658 6.49356L5.58659 6.15356C5.37992 6.18689 5.17992 6.22022 4.99992 6.26022C5.04659 6.44689 5.11992 6.64022 5.19325 6.83356L5.38658 6.49356ZM7.31325 3.80022C6.25325 2.80022 5.33325 2.41356 4.91325 2.66689C4.49325 2.90022 4.36659 3.88022 4.70658 5.30689C5.23526 5.19842 5.76935 5.1183 6.30658 5.06689C6.62659 4.62022 6.96659 4.19356 7.31325 3.80022Z", fill: "#3B3C45" }))));
13
+ exports.DocumentReactIcon = (0, styled_components_1.default)(Icon).attrs(() => ({
14
+ 'data-component-name': 'icons/DocumentReactIcon/DocumentReactIcon',
15
+ })) `
16
+ path {
17
+ fill: ${({ color }) => (0, utils_1.getCssColorVariable)(color)};
18
+ }
19
+
20
+ height: ${({ size }) => size || '16px'};
21
+ width: ${({ size }) => size || '16px'};
22
+ `;
23
+ //# sourceMappingURL=DocumentReactIcon.js.map
@@ -0,0 +1 @@
1
+ export { DocumentReactIcon } from '../../icons/DocumentReactIcon/DocumentReactIcon';
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DocumentReactIcon = void 0;
4
+ var DocumentReactIcon_1 = require("../../icons/DocumentReactIcon/DocumentReactIcon");
5
+ Object.defineProperty(exports, "DocumentReactIcon", { enumerable: true, get: function () { return DocumentReactIcon_1.DocumentReactIcon; } });
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import type { IconProps } from '../../icons/types';
3
+ export declare const DocumentTsIcon: import("styled-components").StyledComponent<(props: IconProps) => React.JSX.Element, any, {
4
+ 'data-component-name': string;
5
+ } & {
6
+ color?: string;
7
+ size?: string;
8
+ className?: string;
9
+ } & React.SVGProps<SVGSVGElement>, "data-component-name">;
@@ -0,0 +1,23 @@
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.DocumentTsIcon = void 0;
7
+ const react_1 = __importDefault(require("react"));
8
+ const styled_components_1 = __importDefault(require("styled-components"));
9
+ const utils_1 = require("../../core/utils");
10
+ const Icon = (props) => (react_1.default.createElement("svg", Object.assign({ width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
11
+ react_1.default.createElement("g", { id: "iconTS" },
12
+ react_1.default.createElement("path", { id: "Vector", fillRule: "evenodd", clipRule: "evenodd", d: "M1.47192 1.47168V14.5277H14.5279V1.47168H1.47192ZM11.3926 7.81312V7.81331C11.5177 7.81369 11.6601 7.82013 11.7671 7.83174C12.2029 7.87888 12.5423 8.06691 12.831 8.42106C12.9748 8.59747 13.024 8.67465 13.0135 8.70768C13.0067 8.72899 12.9081 8.79965 12.5944 9.00784C12.2863 9.21242 12.1871 9.27369 12.164 9.27369C12.1406 9.27369 12.0919 9.22358 12.0217 9.12736C11.8865 8.94211 11.7485 8.85757 11.5352 8.82938C11.3057 8.79898 11.0999 8.8713 10.9991 9.01779C10.9129 9.14298 10.8999 9.34438 10.9684 9.49075C11.0478 9.66026 11.1914 9.75398 11.7417 9.9953C12.3765 10.2736 12.6982 10.4641 12.9324 10.7006C13.1847 10.9552 13.3125 11.2491 13.3518 11.6649C13.371 11.8676 13.3475 12.1078 13.2896 12.3031C13.1473 12.7819 12.7635 13.1324 12.2009 13.2974C12.0454 13.343 11.9007 13.3702 11.7576 13.3807C11.539 13.3968 11.2263 13.388 11.038 13.3606C10.5617 13.2912 10.0241 13.014 9.75596 12.6998C9.62434 12.5455 9.45631 12.2916 9.45631 12.247C9.45631 12.2254 9.467 12.2132 9.5093 12.1863C9.6348 12.1065 10.3539 11.6955 10.3679 11.6955C10.3763 11.6955 10.4139 11.7397 10.4513 11.7938C10.5361 11.9163 10.7448 12.1268 10.8508 12.1971C10.9374 12.2545 11.0482 12.3005 11.1797 12.3338C11.2551 12.3525 11.2949 12.3559 11.4593 12.3559C11.6272 12.3558 11.6617 12.353 11.7368 12.3328C11.9355 12.2794 12.0906 12.1687 12.1563 12.0335C12.1851 11.9751 12.1857 11.9678 12.1857 11.8261V11.6793L12.1504 11.6092C12.0649 11.4394 11.8805 11.3229 11.2977 11.0705C11.0301 10.9545 10.7022 10.791 10.5742 10.7097C10.2821 10.524 10.0796 10.3118 9.94677 10.052C9.81461 9.79369 9.79493 9.69754 9.79461 9.30909C9.79429 9.00499 9.79378 9.00873 9.85672 8.81465C9.91384 8.63853 10.0308 8.44179 10.1599 8.30458C10.4175 8.03075 10.7939 7.85475 11.1969 7.81974C11.2484 7.81485 11.3174 7.81296 11.3925 7.81318L11.3926 7.81312ZM7.92504 7.87318H7.92517C8.70127 7.87357 9.14616 7.87626 9.1533 7.88074C9.16674 7.88906 9.16844 7.95661 9.16844 8.38768V8.88499L8.394 8.88781L7.61957 8.89062V11.0894C7.61957 12.2988 7.61711 13.2955 7.61375 13.3043C7.60828 13.3191 7.54869 13.3202 7.04479 13.3202H6.482L6.47618 13.2975C6.47244 13.285 6.46968 12.2883 6.46962 11.0826L6.46943 8.8905L5.69503 8.88774L4.92056 8.88493V8.3935C4.92056 8.00374 4.92325 7.89936 4.93365 7.88899C4.94431 7.87802 5.33954 7.8752 7.04252 7.8735C7.37084 7.87318 7.66632 7.87302 7.92504 7.87318Z", fill: "#3B3C45" }))));
13
+ exports.DocumentTsIcon = (0, styled_components_1.default)(Icon).attrs(() => ({
14
+ 'data-component-name': 'icons/DocumentTsIcon/DocumentTsIcon',
15
+ })) `
16
+ path {
17
+ fill: ${({ color }) => (0, utils_1.getCssColorVariable)(color)};
18
+ }
19
+
20
+ height: ${({ size }) => size || '16px'};
21
+ width: ${({ size }) => size || '16px'};
22
+ `;
23
+ //# sourceMappingURL=DocumentTsIcon.js.map
@@ -0,0 +1 @@
1
+ export { DocumentTsIcon } from '../../icons/DocumentTsIcon/DocumentTsIcon';
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DocumentTsIcon = void 0;
4
+ var DocumentTsIcon_1 = require("../../icons/DocumentTsIcon/DocumentTsIcon");
5
+ Object.defineProperty(exports, "DocumentTsIcon", { enumerable: true, get: function () { return DocumentTsIcon_1.DocumentTsIcon; } });
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import type { IconProps } from '../../icons/types';
3
+ export declare const DocumentYamlIcon: import("styled-components").StyledComponent<(props: IconProps) => React.JSX.Element, any, {
4
+ 'data-component-name': string;
5
+ } & {
6
+ color?: string;
7
+ size?: string;
8
+ className?: string;
9
+ } & React.SVGProps<SVGSVGElement>, "data-component-name">;
@@ -0,0 +1,23 @@
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.DocumentYamlIcon = void 0;
7
+ const react_1 = __importDefault(require("react"));
8
+ const styled_components_1 = __importDefault(require("styled-components"));
9
+ const utils_1 = require("../../core/utils");
10
+ const Icon = (props) => (react_1.default.createElement("svg", Object.assign({ width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
11
+ react_1.default.createElement("g", { id: "iconYaml" },
12
+ react_1.default.createElement("path", { id: "Vector", d: "M8.66675 5.99967H12.3334L8.66675 2.33301V5.99967ZM4.00008 1.33301H9.33342L13.3334 5.33301V13.333C13.3334 14.0663 12.7334 14.6663 12.0001 14.6663H4.00008C3.26675 14.6663 2.66675 14.0663 2.66675 13.333V2.66634C2.66675 1.93301 3.26675 1.33301 4.00008 1.33301ZM12.0001 11.9997V10.6663H6.00008V11.9997H12.0001ZM9.33342 9.33301V7.99967H4.00008V9.33301H9.33342Z", fill: "#3B3C45" }))));
13
+ exports.DocumentYamlIcon = (0, styled_components_1.default)(Icon).attrs(() => ({
14
+ 'data-component-name': 'icons/DocumentYamlIcon/DocumentYamlIcon',
15
+ })) `
16
+ path {
17
+ fill: ${({ color }) => (0, utils_1.getCssColorVariable)(color)};
18
+ }
19
+
20
+ height: ${({ size }) => size || '16px'};
21
+ width: ${({ size }) => size || '16px'};
22
+ `;
23
+ //# sourceMappingURL=DocumentYamlIcon.js.map
@@ -0,0 +1 @@
1
+ export { DocumentYamlIcon } from '../../icons/DocumentYamlIcon/DocumentYamlIcon';
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DocumentYamlIcon = void 0;
4
+ var DocumentYamlIcon_1 = require("../../icons/DocumentYamlIcon/DocumentYamlIcon");
5
+ Object.defineProperty(exports, "DocumentYamlIcon", { enumerable: true, get: function () { return DocumentYamlIcon_1.DocumentYamlIcon; } });
6
+ //# sourceMappingURL=index.js.map
package/lib/index.d.ts CHANGED
@@ -217,5 +217,6 @@ export * from './layouts/NotFound';
217
217
  export * from './layouts/Forbidden';
218
218
  export * from './layouts/OIDCForbidden';
219
219
  export * from './layouts/ThreePanelLayout';
220
+ export * from './layouts/CodeWalkthroughLayout';
220
221
  export * as markdoc from './markdoc/default';
221
222
  export * from './components/DatePicker/DatePicker';
package/lib/index.js CHANGED
@@ -270,6 +270,7 @@ __exportStar(require("./layouts/NotFound"), exports);
270
270
  __exportStar(require("./layouts/Forbidden"), exports);
271
271
  __exportStar(require("./layouts/OIDCForbidden"), exports);
272
272
  __exportStar(require("./layouts/ThreePanelLayout"), exports);
273
+ __exportStar(require("./layouts/CodeWalkthroughLayout"), exports);
273
274
  /* Markdoc */
274
275
  exports.markdoc = __importStar(require("./markdoc/default"));
275
276
  /* DatePicker */
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ export type CodeWalkthroughLayoutProps = React.PropsWithChildren<{
3
+ className?: string;
4
+ }>;
5
+ export declare function CodeWalkthroughLayout({ className, children, }: CodeWalkthroughLayoutProps): JSX.Element;
@@ -0,0 +1,72 @@
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.CodeWalkthroughLayout = CodeWalkthroughLayout;
7
+ const react_1 = __importDefault(require("react"));
8
+ const styled_components_1 = __importDefault(require("styled-components"));
9
+ function CodeWalkthroughLayout({ className, children, }) {
10
+ return (react_1.default.createElement(LayoutWrapper, { "data-component-name": "Layout/CodeWalkthroughLayout", className: className },
11
+ react_1.default.createElement(ContentWrapper, null, children)));
12
+ }
13
+ const LayoutWrapper = styled_components_1.default.div.attrs(({ className }) => ({
14
+ className,
15
+ })) `
16
+ display: flex;
17
+ flex: 1;
18
+ width: 100%;
19
+ `;
20
+ const ContentWrapper = styled_components_1.default.section `
21
+ width: 100%;
22
+ --md-content-font-size: var(--font-size-lg);
23
+ --md-content-line-height: var(--line-height-lg);
24
+ --md-table-font-size: var(--md-content-font-size);
25
+ --md-table-line-height: var(--md-content-line-height);
26
+ --md-tabs-content-font-size: var(--md-content-font-size);
27
+ --md-tabs-content-line-height: var(--md-content-line-height);
28
+
29
+ article {
30
+ padding: var(--spacing-xl) 0;
31
+
32
+ /* Spacing for elements preceding a code walkthrough */
33
+ > :not(.code-walkthrough):has(+ .code-walkthrough) {
34
+ margin-bottom: var(--spacing-xl);
35
+ }
36
+
37
+ /* Spacing for code walkthroughs not at the end */
38
+ > .code-walkthrough:not(:last-child) {
39
+ margin-bottom: var(--spacing-xl);
40
+ }
41
+
42
+ /* Layout constraints for direct children except .code-walkthrough */
43
+ > :not(.code-walkthrough) {
44
+ max-width: var(--md-content-max-width);
45
+ padding-left: 0;
46
+ padding-right: 0;
47
+ margin-left: auto !important;
48
+ margin-right: auto !important;
49
+ }
50
+
51
+ /* Adjust padding for edge cases with .code-walkthrough */
52
+ &:has(.code-walkthrough:first-child) {
53
+ padding-top: 0;
54
+ }
55
+
56
+ &:has(.code-walkthrough:last-child) {
57
+ padding-bottom: 0;
58
+ }
59
+
60
+ /* Full-width styling for all .code-walkthroughs */
61
+ .code-walkthrough {
62
+ max-width: none;
63
+ width: 100%;
64
+ }
65
+
66
+ &:first-child > h1:first-child {
67
+ // disable margin top for h1 on the title heading
68
+ margin-top: 0;
69
+ }
70
+ }
71
+ `;
72
+ //# sourceMappingURL=CodeWalkthroughLayout.js.map
@@ -0,0 +1,5 @@
1
+ import type { CustomAttributeTypeInterface, ValidationError } from '@markdoc/markdoc';
2
+ export declare class CodeWalkthroughFilesets implements CustomAttributeTypeInterface {
3
+ validate(_value: string): ValidationError[];
4
+ static resolver: string;
5
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CodeWalkthroughFilesets = void 0;
4
+ class CodeWalkthroughFilesets {
5
+ validate(_value) {
6
+ return [];
7
+ }
8
+ }
9
+ exports.CodeWalkthroughFilesets = CodeWalkthroughFilesets;
10
+ Object.defineProperty(CodeWalkthroughFilesets, "resolver", {
11
+ enumerable: true,
12
+ configurable: true,
13
+ writable: true,
14
+ value: 'codeWalkthroughFilesets'
15
+ });
16
+ //# sourceMappingURL=code-walkthrough-filesets.js.map
@@ -0,0 +1,5 @@
1
+ import type { CustomAttributeTypeInterface, ValidationError } from '@markdoc/markdoc';
2
+ export declare class CodeWalkthroughFilters implements CustomAttributeTypeInterface {
3
+ validate(_value: string): ValidationError[];
4
+ static resolver: string;
5
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CodeWalkthroughFilters = void 0;
4
+ class CodeWalkthroughFilters {
5
+ validate(_value) {
6
+ return [];
7
+ }
8
+ }
9
+ exports.CodeWalkthroughFilters = CodeWalkthroughFilters;
10
+ Object.defineProperty(CodeWalkthroughFilters, "resolver", {
11
+ enumerable: true,
12
+ configurable: true,
13
+ writable: true,
14
+ value: 'codeWalkthroughFilters'
15
+ });
16
+ //# sourceMappingURL=code-walkthrough-filters.js.map
@@ -0,0 +1,5 @@
1
+ export type CodeContainerProps = {
2
+ highlightedCode: string;
3
+ toolbar: JSX.Element;
4
+ };
5
+ export declare function CodeContainer({ highlightedCode, toolbar, }: CodeContainerProps): JSX.Element | null;
@@ -0,0 +1,81 @@
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 (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
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.CodeContainer = CodeContainer;
27
+ const react_1 = __importStar(require("react"));
28
+ const styled_components_1 = __importStar(require("styled-components"));
29
+ const contexts_1 = require("../../../core/contexts");
30
+ const CodeBlockContainer_1 = require("../../../components/CodeBlock/CodeBlockContainer");
31
+ function CodeContainer({ highlightedCode, toolbar, }) {
32
+ const { activeStep } = (0, react_1.useContext)(contexts_1.CodeWalkthroughStepsContext);
33
+ const [isHovered, setIsHovered] = (0, react_1.useState)(false);
34
+ const compRef = (0, react_1.useRef)(null);
35
+ (0, react_1.useEffect)(() => {
36
+ // useEffect executed before DOM is updated due to re-render called before "painting" phase.
37
+ setTimeout(() => {
38
+ if (compRef.current) {
39
+ const element = compRef.current.querySelector('span.line.highlighted');
40
+ if (element) {
41
+ element.scrollIntoView({ behavior: 'smooth', block: 'nearest', inline: 'start' });
42
+ }
43
+ }
44
+ }, 200);
45
+ }, [activeStep]);
46
+ return (react_1.default.createElement(CodeContainerWrapper, { ref: compRef, hideCodeColors: !isHovered, onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false) },
47
+ react_1.default.createElement(CodeBlockContainer_1.CodeBlockContainer, { dangerouslySetInnerHTML: { __html: highlightedCode } }),
48
+ toolbar));
49
+ }
50
+ const CodeContainerWrapper = styled_components_1.default.div `
51
+ position: relative;
52
+
53
+ display: flex;
54
+ flex-direction: column;
55
+ flex-grow: 1;
56
+ min-height: 0;
57
+
58
+ pre {
59
+ display: grid;
60
+ grid-auto-rows: min-content;
61
+ min-height: 0;
62
+ overflow: scroll;
63
+ margin: 0 !important;
64
+ height: 100%;
65
+ padding-left: 0 !important;
66
+
67
+ span.line::before {
68
+ color: var(--code-panel-line-numbering-color);
69
+ }
70
+ ${({ hideCodeColors }) => hideCodeColors &&
71
+ (0, styled_components_1.css) `
72
+ .line.greyed-out {
73
+ color: var(--text-color-helper) !important;
74
+ * {
75
+ color: var(--text-color-helper) !important;
76
+ }
77
+ }
78
+ `}
79
+ }
80
+ `;
81
+ //# sourceMappingURL=CodeContainer.js.map
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import type { CodeWalkthroughFilter } from '@redocly/config';
3
+ export type CodeFilterProps = {
4
+ filters: CodeWalkthroughFilter[];
5
+ getFilterState: (groupId: string) => {
6
+ value: string;
7
+ render: boolean;
8
+ } | null;
9
+ handleFilterSelect: (groupId: string, id: string) => void;
10
+ filtersElementRef?: React.RefObject<HTMLDivElement>;
11
+ };
12
+ export declare function CodeFilters({ filters, getFilterState, handleFilterSelect, filtersElementRef, }: CodeFilterProps): React.JSX.Element | null;
@@ -0,0 +1,58 @@
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.CodeFilters = CodeFilters;
7
+ const react_1 = __importDefault(require("react"));
8
+ const styled_components_1 = __importDefault(require("styled-components"));
9
+ const Tag_1 = require("../../../components/Tag/Tag");
10
+ function CodeFilters({ filters, getFilterState, handleFilterSelect, filtersElementRef, }) {
11
+ if (filters.length === 0) {
12
+ return null;
13
+ }
14
+ return (react_1.default.createElement(FilterWrapper, { ref: filtersElementRef }, filters.map(({ label, items, id }) => {
15
+ return (react_1.default.createElement(Filter, { key: id },
16
+ label && react_1.default.createElement(FilterName, null,
17
+ label,
18
+ ":"),
19
+ react_1.default.createElement(ButtonsWrapper, null, items === null || items === void 0 ? void 0 : items.map((item) => {
20
+ var _a;
21
+ return (react_1.default.createElement(TagButton, { size: "large", borderless: true, active: ((_a = getFilterState(id)) === null || _a === void 0 ? void 0 : _a.value) === item.value, key: item.value, onClick: () => handleFilterSelect(id, item.value) }, item.value));
22
+ }))));
23
+ })));
24
+ }
25
+ const Filter = styled_components_1.default.div `
26
+ display: flex;
27
+ align-items: center;
28
+ gap: var(--spacing-xs);
29
+ `;
30
+ const FilterName = styled_components_1.default.div `
31
+ color: var(--color-text-primary);
32
+ font-size: var(--font-size-base);
33
+ `;
34
+ const FilterWrapper = styled_components_1.default.div `
35
+ --tag-text-transform: none;
36
+ display: flex;
37
+ flex-direction: row;
38
+ gap: var(--spacing-sm);
39
+ flex-wrap: wrap;
40
+ position: sticky;
41
+
42
+ padding-top: calc(var(--spacing-xs) + var(--spacing-xl));
43
+ padding-right: var(--spacing-xl);
44
+ padding-left: var(--spacing-xl);
45
+ padding-bottom: var(--spacing-xs);
46
+ top: calc(var(--navbar-height));
47
+ background-color: var(--bg-color);
48
+ z-index: 1;
49
+ `;
50
+ const ButtonsWrapper = styled_components_1.default.div `
51
+ display: flex;
52
+ `;
53
+ const TagButton = (0, styled_components_1.default)(Tag_1.Tag) `
54
+ cursor: pointer;
55
+ padding: 0px var(--spacing-xs);
56
+ margin-right: var(--spacing-xs);
57
+ `;
58
+ //# sourceMappingURL=CodeFilters.js.map
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import type { CodeWalkthroughFile } from '@redocly/config';
3
+ export type CodePanelProps = {
4
+ files: CodeWalkthroughFile[];
5
+ downloadAssociatedFiles: CodeWalkthroughFile[];
6
+ preview: React.ReactNode[];
7
+ };
8
+ export declare function CodePanel({ files, downloadAssociatedFiles, preview, }: CodePanelProps): JSX.Element | null;
@@ -0,0 +1,64 @@
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 (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
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.CodePanel = CodePanel;
30
+ const react_1 = __importStar(require("react"));
31
+ const styled_components_1 = __importDefault(require("styled-components"));
32
+ const hooks_1 = require("../../../core/hooks");
33
+ const contexts_1 = require("../../../core/contexts");
34
+ const CodePanelHeader_1 = require("../../../markdoc/components/CodeWalkthrough/CodePanelHeader");
35
+ const CodePanelPreview_1 = require("../../../markdoc/components/CodeWalkthrough/CodePanelPreview");
36
+ const CodeContainer_1 = require("../../../markdoc/components/CodeWalkthrough/CodeContainer");
37
+ const CodePanelToolbar_1 = require("../../../markdoc/components/CodeWalkthrough/CodePanelToolbar");
38
+ function CodePanel({ files, downloadAssociatedFiles, preview, }) {
39
+ const { activeFile, handleTabSwitch, highlightedCode } = (0, hooks_1.useCodePanel)(files);
40
+ const { handleDownloadCode } = (0, react_1.useContext)(contexts_1.CodeWalkthroughControlsStateContext);
41
+ return (react_1.default.createElement(CodePanelWrapper, null,
42
+ preview ? (react_1.default.createElement(CodePanelPreview_1.CodePanelPreview, null, preview.map((element, idx) => (react_1.default.createElement(react_1.default.Fragment, { key: idx }, element))))) : null,
43
+ react_1.default.createElement(CodePanelHeader_1.CodePanelHeader, { files: files, activeTabName: (activeFile === null || activeFile === void 0 ? void 0 : activeFile.path) || '', handleTabSwitch: handleTabSwitch, onDownloadCode: () => handleDownloadCode([...files, ...downloadAssociatedFiles]) }),
44
+ react_1.default.createElement(CodeContainer_1.CodeContainer, { key: (activeFile === null || activeFile === void 0 ? void 0 : activeFile.path) || '', highlightedCode: highlightedCode, toolbar: react_1.default.createElement(CodePanelToolbar_1.CodePanelToolbar, { file: activeFile }) })));
45
+ }
46
+ const CodePanelWrapper = styled_components_1.default.div `
47
+ display: flex;
48
+ flex-direction: column;
49
+ align-self: flex-start;
50
+
51
+ min-height: 144px;
52
+ min-width: 0;
53
+ height: 100%;
54
+ word-wrap: break-word;
55
+
56
+ background-color: var(--code-panel-bg-color);
57
+ border: 1px solid var(--code-panel-border-color);
58
+ border-radius: var(--code-panel-border-radius);
59
+ --code-block-max-height: calc(100vh - var(--navbar-height) - 2 * var(--spacing-xl));
60
+ height: calc(100vh - var(--navbar-height) - 2 * var(--spacing-xl));
61
+ position: sticky;
62
+ top: calc(var(--navbar-height) + var(--spacing-xl));
63
+ `;
64
+ //# sourceMappingURL=CodePanel.js.map
@@ -0,0 +1,8 @@
1
+ import type { CodeWalkthroughFile } from '@redocly/config';
2
+ export type CodePanelHeaderProps = {
3
+ files: CodeWalkthroughFile[];
4
+ handleTabSwitch: (name: string) => void;
5
+ activeTabName: string;
6
+ onDownloadCode: () => void;
7
+ };
8
+ export declare function CodePanelHeader({ files, handleTabSwitch, activeTabName, onDownloadCode, }: CodePanelHeaderProps): JSX.Element;