@redocly/theme 0.59.0-next.5 → 0.59.0-next.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/Catalog/CatalogEntity/CatalogEntityInfoBar.js +1 -0
- package/lib/components/Catalog/CatalogEntityIcon.js +2 -1
- package/lib/components/Catalog/variables.js +1 -1
- package/lib/icons/CubeIcon/CubeIcon.d.ts +9 -0
- package/lib/icons/CubeIcon/CubeIcon.js +17 -0
- package/lib/markdoc/components/Cards/Card.js +1 -28
- package/lib/markdoc/tags/card.js +0 -1
- package/package.json +1 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityInfoBar.tsx +1 -0
- package/src/components/Catalog/CatalogEntityIcon.tsx +2 -1
- package/src/components/Catalog/variables.ts +1 -1
- package/src/icons/CubeIcon/CubeIcon.tsx +27 -0
- package/src/markdoc/components/Cards/Card.tsx +1 -28
- package/src/markdoc/tags/card.ts +0 -1
|
@@ -14,6 +14,7 @@ const HierarchyIcon_1 = require("../../icons/HierarchyIcon/HierarchyIcon");
|
|
|
14
14
|
const Image_1 = require("../../components/Image/Image");
|
|
15
15
|
const core_1 = require("../../core");
|
|
16
16
|
const NoteIcon_1 = require("../../icons/NoteIcon/NoteIcon");
|
|
17
|
+
const CubeIcon_1 = require("../../icons/CubeIcon/CubeIcon");
|
|
17
18
|
const getIconColor = (entityType) => `var(--catalog-entity-icon-color-${entityType})`;
|
|
18
19
|
const getEntityIcon = ({ entityType, defaultColor, forceColor, entitiesCatalogConfig, }) => {
|
|
19
20
|
var _a, _b;
|
|
@@ -34,7 +35,7 @@ const getEntityIcon = ({ entityType, defaultColor, forceColor, entitiesCatalogCo
|
|
|
34
35
|
if ((iconConfig === null || iconConfig === void 0 ? void 0 : iconConfig.src) || (iconConfig === null || iconConfig === void 0 ? void 0 : iconConfig.srcSet)) {
|
|
35
36
|
return (react_1.default.createElement(Image_1.Image, { src: iconConfig === null || iconConfig === void 0 ? void 0 : iconConfig.src, srcSet: iconConfig === null || iconConfig === void 0 ? void 0 : iconConfig.srcSet, alt: `${entityType} icon`, width: "16", height: "16" }));
|
|
36
37
|
}
|
|
37
|
-
return react_1.default.createElement(
|
|
38
|
+
return react_1.default.createElement(CubeIcon_1.CubeIcon, { color: "var(--catalog-entity-icon-color)" });
|
|
38
39
|
};
|
|
39
40
|
function CatalogEntityIcon({ entityType, defaultColor = false, forceColor, }) {
|
|
40
41
|
const themeConfig = (0, core_1.useThemeConfig)();
|
|
@@ -99,7 +99,7 @@ exports.catalog = (0, styled_components_1.css) `
|
|
|
99
99
|
/**
|
|
100
100
|
* @tokens Catalog entity icon
|
|
101
101
|
*/
|
|
102
|
-
--catalog-entity-icon-color: var(--color-
|
|
102
|
+
--catalog-entity-icon-color: var(--color-persian-green-8);
|
|
103
103
|
--catalog-entity-border-color: var(--border-color-secondary);
|
|
104
104
|
--catalog-entity-bg-color: var(--bg-color-tonal);
|
|
105
105
|
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { IconProps } from '../../icons/types';
|
|
3
|
+
export declare const CubeIcon: 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,17 @@
|
|
|
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.CubeIcon = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
+
const Icon = (props) => (react_1.default.createElement("svg", Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor" }, props),
|
|
10
|
+
react_1.default.createElement("path", { d: "M14.252 4.06812L8.25195 0.568119C8.17548 0.523507 8.08853 0.5 8 0.5C7.91147 0.5 7.82452 0.523507 7.74805 0.568119L1.74805 4.06812C1.67257 4.11215 1.60994 4.1752 1.56642 4.25099C1.5229 4.32677 1.5 4.41263 1.5 4.50002V11.5C1.5 11.5874 1.5229 11.6733 1.56642 11.7491C1.60994 11.8248 1.67257 11.8879 1.74805 11.9319L7.74805 15.4319C7.82452 15.4765 7.91147 15.5 8 15.5C8.08853 15.5 8.17548 15.4765 8.25195 15.4319L14.252 11.9319C14.3274 11.8879 14.3901 11.8248 14.4336 11.7491C14.4771 11.6733 14.5 11.5874 14.5 11.5V4.50002C14.5 4.41263 14.4771 4.32677 14.4336 4.25099C14.3901 4.1752 14.3274 4.11215 14.252 4.06812ZM8 1.57887L13.0078 4.50002L8 7.42117L2.9922 4.50002L8 1.57887ZM2.5 5.37062L7.5 8.28712V14.1294L2.5 11.2129V5.37062ZM8.5 14.1294V8.28712L13.5 5.37062V11.2129L8.5 14.1294Z", fill: "currentColor" })));
|
|
11
|
+
exports.CubeIcon = (0, styled_components_1.default)(Icon).attrs(() => ({
|
|
12
|
+
'data-component-name': 'icons/CubeIcon/CubeIcon',
|
|
13
|
+
})) `
|
|
14
|
+
height: ${({ size }) => size || '16px'};
|
|
15
|
+
width: ${({ size }) => size || '16px'};
|
|
16
|
+
`;
|
|
17
|
+
//# sourceMappingURL=CubeIcon.js.map
|
|
@@ -43,6 +43,7 @@ const ContentWrapper = styled_components_1.default.div `
|
|
|
43
43
|
flex-direction: column;
|
|
44
44
|
flex-shrink: 1;
|
|
45
45
|
gap: var(--card-content-gap);
|
|
46
|
+
width: 100%;
|
|
46
47
|
`;
|
|
47
48
|
const Title = styled_components_1.default.h3 `
|
|
48
49
|
margin: var(--card-title-margin);
|
|
@@ -82,28 +83,6 @@ const Body = styled_components_1.default.div `
|
|
|
82
83
|
> *:last-child {
|
|
83
84
|
margin-bottom: 0;
|
|
84
85
|
}
|
|
85
|
-
|
|
86
|
-
/* Icon link styles */
|
|
87
|
-
& a {
|
|
88
|
-
display: inline-flex;
|
|
89
|
-
align-items: center;
|
|
90
|
-
line-height: 1;
|
|
91
|
-
|
|
92
|
-
& svg {
|
|
93
|
-
width: 1.2em;
|
|
94
|
-
height: 1.2em;
|
|
95
|
-
margin-right: 0.25em;
|
|
96
|
-
vertical-align: middle;
|
|
97
|
-
|
|
98
|
-
& g {
|
|
99
|
-
fill: var(--link-color-primary);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
& a:visited > span > svg > g {
|
|
105
|
-
fill: var(--link-color-visited);
|
|
106
|
-
}
|
|
107
86
|
`;
|
|
108
87
|
const CardWrapper = styled_components_1.default.div.attrs(({ $isCardLink, $variant }) => ({
|
|
109
88
|
className: getCardWrapperClass($isCardLink, $variant),
|
|
@@ -149,12 +128,6 @@ const CardWrapper = styled_components_1.default.div.attrs(({ $isCardLink, $varia
|
|
|
149
128
|
}
|
|
150
129
|
}
|
|
151
130
|
}
|
|
152
|
-
|
|
153
|
-
&& ul {
|
|
154
|
-
list-style: none;
|
|
155
|
-
padding-left: 0;
|
|
156
|
-
margin: var(--spacing-xs) 0;
|
|
157
|
-
}
|
|
158
131
|
`;
|
|
159
132
|
const getCardWrapperClass = ($isCardLink, $variant) => {
|
|
160
133
|
let classes = [];
|
package/lib/markdoc/tags/card.js
CHANGED
package/package.json
CHANGED
|
@@ -11,6 +11,7 @@ import { HierarchyIcon } from '@redocly/theme/icons/HierarchyIcon/HierarchyIcon'
|
|
|
11
11
|
import { Image } from '@redocly/theme/components/Image/Image';
|
|
12
12
|
import { PREDEFINED_ENTITY_TYPES, useThemeConfig } from '@redocly/theme/core';
|
|
13
13
|
import { NoteIcon } from '@redocly/theme/icons/NoteIcon/NoteIcon';
|
|
14
|
+
import { CubeIcon } from '@redocly/theme/icons/CubeIcon/CubeIcon';
|
|
14
15
|
|
|
15
16
|
export type CatalogEntityIconProps = {
|
|
16
17
|
entityType: string;
|
|
@@ -59,7 +60,7 @@ const getEntityIcon = ({
|
|
|
59
60
|
);
|
|
60
61
|
}
|
|
61
62
|
|
|
62
|
-
return <
|
|
63
|
+
return <CubeIcon color="var(--catalog-entity-icon-color)" />;
|
|
63
64
|
};
|
|
64
65
|
|
|
65
66
|
export function CatalogEntityIcon({
|
|
@@ -97,7 +97,7 @@ export const catalog = css`
|
|
|
97
97
|
/**
|
|
98
98
|
* @tokens Catalog entity icon
|
|
99
99
|
*/
|
|
100
|
-
--catalog-entity-icon-color: var(--color-
|
|
100
|
+
--catalog-entity-icon-color: var(--color-persian-green-8);
|
|
101
101
|
--catalog-entity-border-color: var(--border-color-secondary);
|
|
102
102
|
--catalog-entity-bg-color: var(--bg-color-tonal);
|
|
103
103
|
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import type { IconProps } from '@redocly/theme/icons/types';
|
|
5
|
+
|
|
6
|
+
const Icon = (props: IconProps) => (
|
|
7
|
+
<svg
|
|
8
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
9
|
+
width="16"
|
|
10
|
+
height="16"
|
|
11
|
+
viewBox="0 0 16 16"
|
|
12
|
+
fill="currentColor"
|
|
13
|
+
{...props}
|
|
14
|
+
>
|
|
15
|
+
<path
|
|
16
|
+
d="M14.252 4.06812L8.25195 0.568119C8.17548 0.523507 8.08853 0.5 8 0.5C7.91147 0.5 7.82452 0.523507 7.74805 0.568119L1.74805 4.06812C1.67257 4.11215 1.60994 4.1752 1.56642 4.25099C1.5229 4.32677 1.5 4.41263 1.5 4.50002V11.5C1.5 11.5874 1.5229 11.6733 1.56642 11.7491C1.60994 11.8248 1.67257 11.8879 1.74805 11.9319L7.74805 15.4319C7.82452 15.4765 7.91147 15.5 8 15.5C8.08853 15.5 8.17548 15.4765 8.25195 15.4319L14.252 11.9319C14.3274 11.8879 14.3901 11.8248 14.4336 11.7491C14.4771 11.6733 14.5 11.5874 14.5 11.5V4.50002C14.5 4.41263 14.4771 4.32677 14.4336 4.25099C14.3901 4.1752 14.3274 4.11215 14.252 4.06812ZM8 1.57887L13.0078 4.50002L8 7.42117L2.9922 4.50002L8 1.57887ZM2.5 5.37062L7.5 8.28712V14.1294L2.5 11.2129V5.37062ZM8.5 14.1294V8.28712L13.5 5.37062V11.2129L8.5 14.1294Z"
|
|
17
|
+
fill="currentColor"
|
|
18
|
+
/>
|
|
19
|
+
</svg>
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
export const CubeIcon = styled(Icon).attrs(() => ({
|
|
23
|
+
'data-component-name': 'icons/CubeIcon/CubeIcon',
|
|
24
|
+
}))<IconProps>`
|
|
25
|
+
height: ${({ size }) => size || '16px'};
|
|
26
|
+
width: ${({ size }) => size || '16px'};
|
|
27
|
+
`;
|
|
@@ -103,6 +103,7 @@ const ContentWrapper = styled.div`
|
|
|
103
103
|
flex-direction: column;
|
|
104
104
|
flex-shrink: 1;
|
|
105
105
|
gap: var(--card-content-gap);
|
|
106
|
+
width: 100%;
|
|
106
107
|
`;
|
|
107
108
|
|
|
108
109
|
const Title = styled.h3<{ $isCardLink: boolean; $justifyContent: string }>`
|
|
@@ -146,28 +147,6 @@ const Body = styled.div<{ $lineClamp?: number }>`
|
|
|
146
147
|
> *:last-child {
|
|
147
148
|
margin-bottom: 0;
|
|
148
149
|
}
|
|
149
|
-
|
|
150
|
-
/* Icon link styles */
|
|
151
|
-
& a {
|
|
152
|
-
display: inline-flex;
|
|
153
|
-
align-items: center;
|
|
154
|
-
line-height: 1;
|
|
155
|
-
|
|
156
|
-
& svg {
|
|
157
|
-
width: 1.2em;
|
|
158
|
-
height: 1.2em;
|
|
159
|
-
margin-right: 0.25em;
|
|
160
|
-
vertical-align: middle;
|
|
161
|
-
|
|
162
|
-
& g {
|
|
163
|
-
fill: var(--link-color-primary);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
& a:visited > span > svg > g {
|
|
169
|
-
fill: var(--link-color-visited);
|
|
170
|
-
}
|
|
171
150
|
`;
|
|
172
151
|
|
|
173
152
|
const CardWrapper = styled.div.attrs<{
|
|
@@ -222,12 +201,6 @@ const CardWrapper = styled.div.attrs<{
|
|
|
222
201
|
}
|
|
223
202
|
}
|
|
224
203
|
}
|
|
225
|
-
|
|
226
|
-
&& ul {
|
|
227
|
-
list-style: none;
|
|
228
|
-
padding-left: 0;
|
|
229
|
-
margin: var(--spacing-xs) 0;
|
|
230
|
-
}
|
|
231
204
|
`;
|
|
232
205
|
|
|
233
206
|
const getCardWrapperClass = ($isCardLink: boolean, $variant?: string) => {
|