@redocly/theme 0.52.0-next.1 → 0.52.0-next.3

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 (57) hide show
  1. package/lib/components/Catalog/Catalog.js +2 -26
  2. package/lib/components/Catalog/CatalogCard.js +1 -0
  3. package/lib/components/Catalog/CatalogVirtualizedGroups.d.ts +25 -0
  4. package/lib/components/Catalog/CatalogVirtualizedGroups.js +183 -0
  5. package/lib/components/Catalog/variables.js +3 -0
  6. package/lib/components/Menu/MenuItem.js +1 -1
  7. package/lib/components/Navbar/NavbarItem.js +4 -1
  8. package/lib/components/Search/SearchAiMessage.js +6 -5
  9. package/lib/components/Search/SearchDialog.js +1 -1
  10. package/lib/core/hooks/__mocks__/index.d.ts +1 -0
  11. package/lib/core/hooks/__mocks__/index.js +1 -0
  12. package/lib/core/hooks/__mocks__/use-element-size.d.ts +4 -0
  13. package/lib/core/hooks/__mocks__/use-element-size.js +9 -0
  14. package/lib/core/hooks/index.d.ts +1 -0
  15. package/lib/core/hooks/index.js +1 -0
  16. package/lib/core/hooks/menu/use-nested-menu.js +5 -0
  17. package/lib/core/hooks/use-element-size.d.ts +13 -0
  18. package/lib/core/hooks/use-element-size.js +75 -0
  19. package/lib/core/styles/global.js +0 -1
  20. package/lib/core/types/index.d.ts +1 -0
  21. package/lib/core/types/index.js +1 -0
  22. package/lib/core/types/l10n.d.ts +1 -1
  23. package/lib/core/types/user-claims.d.ts +4 -0
  24. package/lib/core/types/user-claims.js +3 -0
  25. package/lib/ext/configure.d.ts +12 -1
  26. package/lib/ext/configure.js +1 -1
  27. package/lib/icons/CheckboxFilledIcon/CheckboxFilledIcon.d.ts +9 -0
  28. package/lib/icons/CheckboxFilledIcon/CheckboxFilledIcon.js +22 -0
  29. package/lib/icons/WarningAltFilled/WarningAltFilled.d.ts +9 -0
  30. package/lib/icons/WarningAltFilled/WarningAltFilled.js +23 -0
  31. package/lib/index.d.ts +3 -1
  32. package/lib/index.js +3 -1
  33. package/package.json +1 -1
  34. package/src/components/Catalog/Catalog.tsx +3 -37
  35. package/src/components/Catalog/CatalogCard.tsx +1 -0
  36. package/src/components/Catalog/CatalogVirtualizedGroups.tsx +236 -0
  37. package/src/components/Catalog/variables.ts +3 -0
  38. package/src/components/Menu/MenuItem.tsx +1 -0
  39. package/src/components/Navbar/NavbarItem.tsx +5 -1
  40. package/src/components/Search/SearchAiMessage.tsx +4 -4
  41. package/src/components/Search/SearchDialog.tsx +1 -1
  42. package/src/core/hooks/__mocks__/index.ts +1 -0
  43. package/src/core/hooks/__mocks__/use-element-size.ts +6 -0
  44. package/src/core/hooks/index.ts +1 -0
  45. package/src/core/hooks/menu/use-nested-menu.ts +4 -0
  46. package/src/core/hooks/use-element-size.ts +98 -0
  47. package/src/core/styles/global.ts +0 -1
  48. package/src/core/types/index.ts +1 -0
  49. package/src/core/types/l10n.ts +2 -0
  50. package/src/core/types/user-claims.ts +4 -0
  51. package/src/ext/configure.ts +14 -1
  52. package/src/icons/CheckboxFilledIcon/CheckboxFilledIcon.tsx +23 -0
  53. package/src/icons/WarningAltFilled/WarningAltFilled.tsx +24 -0
  54. package/src/index.ts +3 -1
  55. package/lib/components/Footer/FooterLogo.d.ts +0 -3
  56. package/lib/components/Footer/FooterLogo.js +0 -22
  57. package/src/components/Footer/FooterLogo.tsx +0 -20
@@ -1258,7 +1258,6 @@ export const styles = css`
1258
1258
  ${scorecard}
1259
1259
  ${datePicker}
1260
1260
  ${replay}
1261
- --api-catalog-card-min-width: 250px;
1262
1261
 
1263
1262
  background-color: var(--bg-color);
1264
1263
  color: var(--text-color-primary);
@@ -10,3 +10,4 @@ export * from '@redocly/theme/core/types/select';
10
10
  export * from '@redocly/theme/core/types/sidebar';
11
11
  export * from '@redocly/theme/core/types/filter';
12
12
  export * from '@redocly/theme/core/types/user-menu';
13
+ export * from '@redocly/theme/core/types/user-claims';
@@ -92,6 +92,8 @@ export type TranslationKey =
92
92
  | 'search.ai.suggestionsTitle'
93
93
  | 'search.ai.thinkingText'
94
94
  | 'search.ai.resourcesFound'
95
+ | 'search.ai.resourcesFound.basedOn'
96
+ | 'search.ai.resourcesFound.resources'
95
97
  | 'search.ai.button'
96
98
  | 'search.ai.label'
97
99
  | 'search.ai.disclaimer'
@@ -0,0 +1,4 @@
1
+ export type UserClaims = {
2
+ email?: string;
3
+ name?: string;
4
+ };
@@ -1,3 +1,5 @@
1
+ import { UserClaims } from '@redocly/theme';
2
+
1
3
  export type SecurityDetails = {
2
4
  password?: string;
3
5
  username?: string;
@@ -23,7 +25,18 @@ type Configure = {
23
25
  requestValues?: ConfigureRequestValues;
24
26
  };
25
27
 
26
- export function configure(): Configure {
28
+ type ContextProps = {
29
+ userClaims?: UserClaims;
30
+ operation: {
31
+ name: string;
32
+ path: string;
33
+ operationId?: string;
34
+ href?: string;
35
+ method: string;
36
+ };
37
+ };
38
+
39
+ export function configure(_context: ContextProps): Configure {
27
40
  // const exampleRequestValues: ConfigureRequestValues = {
28
41
  // body: {
29
42
  // name: 'John Doe',
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import styled from 'styled-components';
3
+
4
+ import type { IconProps } from '@redocly/theme/icons/types';
5
+
6
+ import { getCssColorVariable } from '@redocly/theme/core/utils';
7
+
8
+ const Icon = (props: IconProps) => (
9
+ <svg viewBox="0 0 16 17" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
10
+ <path d="M13 2.51172H3C2.73478 2.51172 2.48043 2.61708 2.29289 2.80461C2.10536 2.99215 2 3.2465 2 3.51172V13.5117C2 13.7769 2.10536 14.0313 2.29289 14.2188C2.48043 14.4064 2.73478 14.5117 3 14.5117H13C13.2652 14.5117 13.5196 14.4064 13.7071 14.2188C13.8946 14.0313 14 13.7769 14 13.5117V3.51172C14 3.2465 13.8946 2.99215 13.7071 2.80461C13.5196 2.61708 13.2652 2.51172 13 2.51172ZM7 11.2617L4.5 8.78307L5.2954 8.01172L7 9.68452L10.7044 6.01172L11.5002 6.80032L7 11.2617Z" />
11
+ </svg>
12
+ );
13
+
14
+ export const CheckboxFilledIcon = styled(Icon).attrs(() => ({
15
+ 'data-component-name': 'icons/CheckboxFilledIcon/CheckboxFilledIcon',
16
+ }))<IconProps>`
17
+ path {
18
+ fill: ${({ color }) => getCssColorVariable(color)};
19
+ }
20
+
21
+ height: ${({ size }) => size || '16px'};
22
+ width: ${({ size }) => size || '16px'};
23
+ `;
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+ import styled from 'styled-components';
3
+
4
+ import type { IconProps } from '@redocly/theme/icons/types';
5
+
6
+ import { getCssColorVariable } from '@redocly/theme/core/utils';
7
+
8
+ const Icon = (props: IconProps) => (
9
+ <svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
10
+ <path d="M8.001 3.08571H7.999L2.32435 13.9983L2.3253 14H13.6747L13.6757 13.9983L8.001 3.08571ZM7.4375 6.00001H8.5625V10.5H7.4375V6.00001ZM8 13C7.85167 13 7.70666 12.956 7.58333 12.8736C7.45999 12.7912 7.36386 12.6741 7.30709 12.537C7.25033 12.4 7.23548 12.2492 7.26441 12.1037C7.29335 11.9582 7.36478 11.8246 7.46967 11.7197C7.57456 11.6148 7.7082 11.5434 7.85369 11.5144C7.99917 11.4855 8.14997 11.5003 8.28702 11.5571C8.42406 11.6139 8.54119 11.71 8.62361 11.8333C8.70602 11.9567 8.75 12.1017 8.75 12.25C8.75 12.4489 8.67099 12.6397 8.53033 12.7803C8.38968 12.921 8.19892 13 8 13Z" />
11
+ <path d="M14.5 15H1.5C1.4141 15 1.32965 14.9779 1.25478 14.9357C1.17992 14.8936 1.11718 14.8329 1.0726 14.7595C1.02802 14.686 1.00311 14.6024 1.00027 14.5165C0.997436 14.4307 1.01677 14.3455 1.0564 14.2693L7.5564 1.76931C7.59862 1.68812 7.66231 1.62008 7.74053 1.5726C7.81875 1.52511 7.9085 1.5 8 1.5C8.09151 1.5 8.18126 1.52511 8.25948 1.5726C8.3377 1.62008 8.40138 1.68812 8.4436 1.76931L14.9436 14.2693C14.9832 14.3455 15.0026 14.4307 14.9997 14.5165C14.9969 14.6024 14.972 14.686 14.9274 14.7595C14.8828 14.8329 14.8201 14.8936 14.7452 14.9357C14.6704 14.9779 14.5859 15 14.5 15ZM2.3253 14H13.6747L13.6757 13.9983L8.001 3.08571H7.999L2.32435 13.9983L2.3253 14Z" />
12
+ </svg>
13
+ );
14
+
15
+ export const WarningAltFilled = styled(Icon).attrs(() => ({
16
+ 'data-component-name': 'icons/WarningAltFilled/WarningAltFilled',
17
+ }))<IconProps>`
18
+ path {
19
+ fill: ${({ color }) => getCssColorVariable(color)};
20
+ }
21
+
22
+ height: ${({ size }) => size || '16px'};
23
+ width: ${({ size }) => size || '16px'};
24
+ `;
package/src/index.ts CHANGED
@@ -47,7 +47,6 @@ export * from '@redocly/theme/components/Footer/Footer';
47
47
  export * from '@redocly/theme/components/Footer/FooterColumn';
48
48
  export * from '@redocly/theme/components/Footer/FooterCopyright';
49
49
  export * from '@redocly/theme/components/Footer/FooterItem';
50
- export * from '@redocly/theme/components/Footer/FooterLogo';
51
50
  /* Typography */
52
51
  export * from '@redocly/theme/components/Typography/CompactTypography';
53
52
  export * from '@redocly/theme/components/Typography/Emphasis';
@@ -122,6 +121,7 @@ export * from '@redocly/theme/components/Catalog/CatalogCard';
122
121
  export * from '@redocly/theme/components/Catalog/CatalogActions';
123
122
  export * from '@redocly/theme/components/Catalog/CatalogHighlight';
124
123
  export * from '@redocly/theme/components/Catalog/CatalogInfoBlock';
124
+ export * from '@redocly/theme/components/Catalog/CatalogVirtualizedGroups';
125
125
  /* Product */
126
126
  export * from '@redocly/theme/components/Product/Product';
127
127
  export * from '@redocly/theme/components/Product/ProductPicker';
@@ -244,6 +244,8 @@ export * from '@redocly/theme/icons/FlowIcon/FlowIcon';
244
244
  export * from '@redocly/theme/icons/DraggableIcon/DraggableIcon';
245
245
  export * from '@redocly/theme/icons/WarningAltFilledIcon/WarningAltFilledIcon';
246
246
  export * from '@redocly/theme/icons/ErrorFilledIcon/ErrorFilledIcon';
247
+ export * from '@redocly/theme/icons/CheckboxFilledIcon/CheckboxFilledIcon';
248
+ export * from '@redocly/theme/icons/WarningAltFilled/WarningAltFilled';
247
249
  export * from '@redocly/theme/icons/SettingsCogIcon/SettingsCogIcon';
248
250
  /* Layouts */
249
251
  export * from '@redocly/theme/layouts/RootLayout';
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import type { LogoProps } from '../../components/Logo/Logo';
3
- export declare function FooterLogo(props: LogoProps): React.JSX.Element;
@@ -1,22 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.FooterLogo = FooterLogo;
7
- const react_1 = __importDefault(require("react"));
8
- const styled_components_1 = __importDefault(require("styled-components"));
9
- const Logo_1 = require("../../components/Logo/Logo");
10
- function FooterLogo(props) {
11
- return react_1.default.createElement(FooterLogoComponent, Object.assign({}, props, { "data-component-name": "Footer/FooterLogo" }));
12
- }
13
- const FooterLogoComponent = (0, styled_components_1.default)(Logo_1.Logo) `
14
- --logo-height: var(--footer-logo-height);
15
- --logo-width: var(--footer-logo-width);
16
- --logo-max-width: var(--footer-logo-max-width);
17
- --logo-max-height: var(--footer-logo-max-height);
18
- --logo-margin: 0;
19
-
20
- display: var(--footer-logo-display);
21
- `;
22
- //# sourceMappingURL=FooterLogo.js.map
@@ -1,20 +0,0 @@
1
- import React from 'react';
2
- import styled from 'styled-components';
3
-
4
- import type { LogoProps } from '@redocly/theme/components/Logo/Logo';
5
-
6
- import { Logo } from '@redocly/theme/components/Logo/Logo';
7
-
8
- export function FooterLogo(props: LogoProps) {
9
- return <FooterLogoComponent {...props} data-component-name="Footer/FooterLogo" />;
10
- }
11
-
12
- const FooterLogoComponent = styled(Logo)<LogoProps>`
13
- --logo-height: var(--footer-logo-height);
14
- --logo-width: var(--footer-logo-width);
15
- --logo-max-width: var(--footer-logo-max-width);
16
- --logo-max-height: var(--footer-logo-max-height);
17
- --logo-margin: 0;
18
-
19
- display: var(--footer-logo-display);
20
- `;