@eventcatalog/core 3.39.3 → 3.39.4
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/dist/analytics/analytics.cjs +1 -1
- package/dist/analytics/analytics.js +2 -2
- package/dist/analytics/log-build.cjs +1 -1
- package/dist/analytics/log-build.js +3 -3
- package/dist/{chunk-TUEC7QBE.js → chunk-NSR4DZXS.js} +1 -1
- package/dist/{chunk-5G6OFPTY.js → chunk-O2CZERUN.js} +1 -1
- package/dist/{chunk-ABTA6BYL.js → chunk-ONQOIF2X.js} +1 -1
- package/dist/{chunk-MFYIAZEO.js → chunk-PVOVC2UV.js} +1 -1
- package/dist/{chunk-L4F5FCQK.js → chunk-WLUQZCIH.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/docs/api/03-domain-api.md +32 -2
- package/dist/docs/api/04-service-api.md +32 -2
- package/dist/docs/api/05-command-api.md +32 -2
- package/dist/docs/api/06-event-api.md +32 -2
- package/dist/docs/api/06-query-api.md +32 -2
- package/dist/docs/api/08-channel-api.md +32 -2
- package/dist/docs/api/09-flow-api.md +32 -2
- package/dist/docs/api/10-entity-api.md +32 -2
- package/dist/docs/api/12-data-product-api.md +14 -2
- package/dist/eventcatalog.cjs +1 -1
- package/dist/eventcatalog.js +5 -5
- package/dist/generate.cjs +1 -1
- package/dist/generate.js +3 -3
- package/dist/utils/cli-logger.cjs +1 -1
- package/dist/utils/cli-logger.js +2 -2
- package/eventcatalog/src/components/Tables/Discover/columns.tsx +2 -0
- package/eventcatalog/src/components/Tables/columns/SharedColumns.tsx +2 -0
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/[docType]/[docId]/[docVersion]/index.astro +4 -4
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/[docType]/[docId]/index.astro +4 -4
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/changelog/index.astro +16 -10
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/graphql/[filename].astro +6 -5
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/index.astro +22 -51
- package/eventcatalog/src/styles/theme.css +92 -0
- package/eventcatalog/src/utils/badge-styles.ts +206 -0
- package/package.json +3 -3
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createColumnHelper } from '@tanstack/react-table';
|
|
2
2
|
import { useState } from 'react';
|
|
3
|
+
import { getBadgeReactStyle } from '@utils/badge-styles';
|
|
3
4
|
import { filterByBadge } from '../filters/custom-filters';
|
|
4
5
|
import type { TCollectionTypes, TData } from '../Table';
|
|
5
6
|
import type { TableConfiguration } from '@types';
|
|
@@ -27,6 +28,7 @@ export const createBadgesColumn = <T extends { data: Pick<TData<U>['data'], 'bad
|
|
|
27
28
|
<span
|
|
28
29
|
key={`${badge.id}-${index}`}
|
|
29
30
|
className="inline-flex items-center px-2 py-0.5 text-xs font-medium rounded-md border border-[rgb(var(--ec-accent)/0.5)] text-[rgb(var(--ec-page-text))] bg-transparent"
|
|
31
|
+
style={getBadgeReactStyle(badge)}
|
|
30
32
|
title={badge.content}
|
|
31
33
|
>
|
|
32
34
|
{badge.content}
|
package/eventcatalog/src/pages/docs/[type]/[id]/[version]/[docType]/[docId]/[docVersion]/index.astro
CHANGED
|
@@ -9,6 +9,7 @@ import { buildUrl } from '@utils/url-builder';
|
|
|
9
9
|
import { AlignLeftIcon, HistoryIcon } from 'lucide-react';
|
|
10
10
|
import { isEventCatalogChatEnabled, isResourceDocsEnabled } from '@utils/feature';
|
|
11
11
|
import { getIcon } from '@utils/badges';
|
|
12
|
+
import { getBadgeStyle } from '@utils/badge-styles';
|
|
12
13
|
import { collectionToResourceMap } from '@utils/collections/util';
|
|
13
14
|
|
|
14
15
|
import { Page } from './_index.data';
|
|
@@ -83,13 +84,12 @@ const pagefindAttributes =
|
|
|
83
84
|
<span
|
|
84
85
|
class={`
|
|
85
86
|
inline-flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm font-medium
|
|
86
|
-
bg-[rgb(var(--ec-content-hover))] border border-[rgb(var(--ec-page-border))]
|
|
87
|
+
${badge.backgroundColor ? 'bg-[rgb(var(--ec-content-hover))]' : 'bg-transparent'} border border-[rgb(var(--ec-page-border))]
|
|
87
88
|
text-[rgb(var(--ec-page-text))]
|
|
88
89
|
`}
|
|
90
|
+
style={getBadgeStyle(badge)}
|
|
89
91
|
>
|
|
90
|
-
{badge.iconComponent &&
|
|
91
|
-
<badge.iconComponent className="w-4 h-4 flex-shrink-0 text-[rgb(var(--ec-icon-color))]" />
|
|
92
|
-
)}
|
|
92
|
+
{badge.iconComponent && <badge.iconComponent className="w-4 h-4 flex-shrink-0" />}
|
|
93
93
|
<span>{badge.content}</span>
|
|
94
94
|
</span>
|
|
95
95
|
))}
|
|
@@ -9,6 +9,7 @@ import { buildUrl } from '@utils/url-builder';
|
|
|
9
9
|
import { AlignLeftIcon, HistoryIcon } from 'lucide-react';
|
|
10
10
|
import { isEventCatalogChatEnabled, isResourceDocsEnabled } from '@utils/feature';
|
|
11
11
|
import { getIcon } from '@utils/badges';
|
|
12
|
+
import { getBadgeStyle } from '@utils/badge-styles';
|
|
12
13
|
import { collectionToResourceMap } from '@utils/collections/util';
|
|
13
14
|
|
|
14
15
|
import { Page } from './_index.data';
|
|
@@ -76,13 +77,12 @@ const pagefindAttributes =
|
|
|
76
77
|
<span
|
|
77
78
|
class={`
|
|
78
79
|
inline-flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm font-medium
|
|
79
|
-
bg-[rgb(var(--ec-content-hover))] border border-[rgb(var(--ec-page-border))]
|
|
80
|
+
${badge.backgroundColor ? 'bg-[rgb(var(--ec-content-hover))]' : 'bg-transparent'} border border-[rgb(var(--ec-page-border))]
|
|
80
81
|
text-[rgb(var(--ec-page-text))]
|
|
81
82
|
`}
|
|
83
|
+
style={getBadgeStyle(badge)}
|
|
82
84
|
>
|
|
83
|
-
{badge.iconComponent &&
|
|
84
|
-
<badge.iconComponent className="w-4 h-4 flex-shrink-0 text-[rgb(var(--ec-icon-color))]" />
|
|
85
|
-
)}
|
|
85
|
+
{badge.iconComponent && <badge.iconComponent className="w-4 h-4 flex-shrink-0" />}
|
|
86
86
|
<span>{badge.content}</span>
|
|
87
87
|
</span>
|
|
88
88
|
))}
|
|
@@ -15,6 +15,7 @@ import mdxComponents from '@components/MDX/components';
|
|
|
15
15
|
import 'diff2html/bundles/css/diff2html.min.css';
|
|
16
16
|
|
|
17
17
|
import { buildUrl } from '@utils/url-builder';
|
|
18
|
+
import { getBadgeStyle } from '@utils/badge-styles';
|
|
18
19
|
import { getPreviousVersion } from '@utils/collections/util';
|
|
19
20
|
import { getDiffsForCurrentAndPreviousVersion } from '@utils/file-diffs';
|
|
20
21
|
import VerticalSideBarLayout from '@layouts/VerticalSideBarLayout.astro';
|
|
@@ -71,27 +72,29 @@ const logListPromise = logsToRender.map(async (log, index) => {
|
|
|
71
72
|
|
|
72
73
|
const logList = await Promise.all(logListPromise);
|
|
73
74
|
|
|
75
|
+
const createResourceBadge = (content: string, icon: any) => ({ content, icon, textColor: 'gray' });
|
|
76
|
+
|
|
74
77
|
const getBadge = () => {
|
|
75
78
|
if (props.collection === 'services') {
|
|
76
|
-
return
|
|
79
|
+
return createResourceBadge('Service', ServerIcon);
|
|
77
80
|
}
|
|
78
81
|
if (props.collection === 'events') {
|
|
79
|
-
return
|
|
82
|
+
return createResourceBadge('Event', BoltIcon);
|
|
80
83
|
}
|
|
81
84
|
if (props.collection === 'commands') {
|
|
82
|
-
return
|
|
85
|
+
return createResourceBadge('Command', ChatBubbleLeftIcon);
|
|
83
86
|
}
|
|
84
87
|
if (props.collection === 'queries') {
|
|
85
|
-
return
|
|
88
|
+
return createResourceBadge('Query', MagnifyingGlassIcon);
|
|
86
89
|
}
|
|
87
90
|
if (props.collection === 'domains') {
|
|
88
|
-
return
|
|
91
|
+
return createResourceBadge('Domain', RectangleGroupIcon);
|
|
89
92
|
}
|
|
90
93
|
if (props.collection === 'containers') {
|
|
91
|
-
return
|
|
94
|
+
return createResourceBadge('Container', DatabaseIcon);
|
|
92
95
|
}
|
|
93
96
|
if (props.collection === 'flows') {
|
|
94
|
-
return
|
|
97
|
+
return createResourceBadge('Flow', QueueListIcon);
|
|
95
98
|
}
|
|
96
99
|
};
|
|
97
100
|
|
|
@@ -141,8 +144,8 @@ const badges = [getBadge()];
|
|
|
141
144
|
<div class="flex flex-wrap py-2 pt-4">
|
|
142
145
|
{badges.map((badge: any) => (
|
|
143
146
|
<span
|
|
144
|
-
class="text-sm font-medium px-2 py-1 rounded-md mr-2 space-x-1 flex items-center"
|
|
145
|
-
style={
|
|
147
|
+
class="text-sm font-medium px-2 py-1 rounded-md mr-2 space-x-1 flex items-center bg-transparent border border-[rgb(var(--ec-page-border))]"
|
|
148
|
+
style={getBadgeStyle(badge)}
|
|
146
149
|
>
|
|
147
150
|
{badge.icon && <badge.icon className="w-4 h-4 inline-block mr-1" />}
|
|
148
151
|
<span>{badge.content}</span>
|
|
@@ -192,7 +195,10 @@ const badges = [getBadge()];
|
|
|
192
195
|
{log.badges && (
|
|
193
196
|
<div class="flex flex-wrap">
|
|
194
197
|
{log.badges.map((badge: any) => (
|
|
195
|
-
<span
|
|
198
|
+
<span
|
|
199
|
+
class="text-sm font-medium px-2 py-1 rounded-md mr-2 space-x-1 flex items-center bg-[rgb(var(--ec-badge-default-bg))] text-[rgb(var(--ec-badge-default-text))]"
|
|
200
|
+
style={getBadgeStyle(badge)}
|
|
201
|
+
>
|
|
196
202
|
{badge.icon && <badge.icon className="w-4 h-4 inline-block mr-1" />}
|
|
197
203
|
<span>{badge.content}</span>
|
|
198
204
|
</span>
|
|
@@ -7,6 +7,7 @@ import Footer from '@layouts/Footer.astro';
|
|
|
7
7
|
import { Page } from './_[filename].data';
|
|
8
8
|
import { getAbsoluteFilePathForAstroFile } from '@utils/files';
|
|
9
9
|
import { buildUrl, buildEditUrlForResource } from '@utils/url-builder';
|
|
10
|
+
import { getBadgeStyle } from '@utils/badge-styles';
|
|
10
11
|
import Admonition from '@components/MDX/Admonition';
|
|
11
12
|
|
|
12
13
|
import { ServerIcon } from '@heroicons/react/24/outline';
|
|
@@ -36,14 +37,13 @@ if (isRemote) {
|
|
|
36
37
|
const pageTitle = `${collection} | ${data.name} | GraphQL Schema`.replace(/^\w/, (c) => c.toUpperCase());
|
|
37
38
|
|
|
38
39
|
const getServiceBadge = () => {
|
|
39
|
-
return [{
|
|
40
|
+
return [{ textColor: 'gray', content: 'Service', icon: ServerIcon }];
|
|
40
41
|
};
|
|
41
42
|
|
|
42
43
|
const getGraphQLBadge = () => {
|
|
43
44
|
return [
|
|
44
45
|
{
|
|
45
|
-
|
|
46
|
-
textColor: 'purple',
|
|
46
|
+
textColor: 'gray',
|
|
47
47
|
content: 'GraphQL Schema',
|
|
48
48
|
iconURL: buildUrl('/icons/graphql.svg', true),
|
|
49
49
|
id: 'graphql-schema-badge',
|
|
@@ -88,13 +88,14 @@ const pagefindAttributes =
|
|
|
88
88
|
id={badge.id || ''}
|
|
89
89
|
class={`
|
|
90
90
|
inline-flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm font-medium
|
|
91
|
-
bg-[rgb(var(--ec-content-hover))] border border-[rgb(var(--ec-page-border))]
|
|
91
|
+
${badge.backgroundColor ? 'bg-[rgb(var(--ec-content-hover))]' : 'bg-transparent'} border border-[rgb(var(--ec-page-border))]
|
|
92
92
|
text-[rgb(var(--ec-page-text))]
|
|
93
93
|
shadow-xs
|
|
94
94
|
${badge.class ? badge.class : ''}
|
|
95
95
|
`}
|
|
96
|
+
style={getBadgeStyle(badge)}
|
|
96
97
|
>
|
|
97
|
-
{badge.icon && <badge.icon className="w-4 h-4 flex-shrink-0
|
|
98
|
+
{badge.icon && <badge.icon className="w-4 h-4 flex-shrink-0" />}
|
|
98
99
|
{badge.iconURL && <img src={badge.iconURL} class="w-4 h-4 flex-shrink-0 opacity-80" alt="" />}
|
|
99
100
|
<span>{badge.content}</span>
|
|
100
101
|
</span>
|
|
@@ -34,6 +34,7 @@ import { getSpecificationsForService } from '@utils/collections/services';
|
|
|
34
34
|
import { resourceToCollectionMap, collectionToResourceMap, getDeprecatedDetails } from '@utils/collections/util';
|
|
35
35
|
import { getSchemasFromResource } from '@utils/collections/schemas';
|
|
36
36
|
import { getIcon } from '@utils/badges';
|
|
37
|
+
import { getBadgeStyle } from '@utils/badge-styles';
|
|
37
38
|
import { buildUrl, buildEditUrlForResource } from '@utils/url-builder';
|
|
38
39
|
import { isIconPath, resolveIconUrl } from '@utils/icon';
|
|
39
40
|
import {
|
|
@@ -72,102 +73,71 @@ const getContentBadges = () =>
|
|
|
72
73
|
icon: badge.icon ? getIcon(badge.icon) : null,
|
|
73
74
|
}));
|
|
74
75
|
|
|
76
|
+
const createResourceBadge = (content: string, icon: any) => ({ content, icon, textColor: 'gray' });
|
|
77
|
+
|
|
75
78
|
const getBadge = () => {
|
|
76
79
|
if (props.collection === 'services') {
|
|
77
|
-
return [
|
|
80
|
+
return [createResourceBadge('Service', ServerIcon)];
|
|
78
81
|
}
|
|
79
82
|
if (props.collection === 'events') {
|
|
80
|
-
return [
|
|
83
|
+
return [createResourceBadge('Event', BoltIcon)];
|
|
81
84
|
}
|
|
82
85
|
if (props.collection === 'commands') {
|
|
83
|
-
return [
|
|
86
|
+
return [createResourceBadge('Command', ChatBubbleLeftIcon)];
|
|
84
87
|
}
|
|
85
88
|
if (props.collection === 'queries') {
|
|
86
|
-
return [
|
|
89
|
+
return [createResourceBadge('Query', MagnifyingGlassIcon)];
|
|
87
90
|
}
|
|
88
91
|
if (props.collection === 'domains') {
|
|
89
|
-
return [
|
|
90
|
-
{
|
|
91
|
-
backgroundColor: 'yellow',
|
|
92
|
-
textColor: 'yellow',
|
|
93
|
-
content: 'Domain',
|
|
94
|
-
icon: RectangleGroupIcon,
|
|
95
|
-
},
|
|
96
|
-
];
|
|
92
|
+
return [createResourceBadge('Domain', RectangleGroupIcon)];
|
|
97
93
|
}
|
|
98
94
|
|
|
99
95
|
if (props.collection === 'flows') {
|
|
100
|
-
return [
|
|
96
|
+
return [createResourceBadge('Flow', QueueListIcon)];
|
|
101
97
|
}
|
|
102
98
|
|
|
103
99
|
if (props.collection === 'channels') {
|
|
104
|
-
return [
|
|
100
|
+
return [createResourceBadge('Channel', ArrowsRightLeftIcon)];
|
|
105
101
|
}
|
|
106
102
|
|
|
107
103
|
if (props.collection === 'containers') {
|
|
108
104
|
const badges = [];
|
|
109
105
|
const content = props.data.container_type?.charAt(0).toUpperCase() + props.data.container_type?.slice(1) || 'Database';
|
|
110
106
|
|
|
111
|
-
badges.push(
|
|
107
|
+
badges.push(createResourceBadge(content, DatabaseIcon));
|
|
112
108
|
|
|
113
109
|
if (props.data?.technology) {
|
|
114
|
-
badges.push({
|
|
115
|
-
backgroundColor: 'indigo',
|
|
116
|
-
textColor: 'indigo',
|
|
117
|
-
content: `${props.data.technology}`,
|
|
118
|
-
icon: DatabaseZapIcon,
|
|
119
|
-
});
|
|
110
|
+
badges.push(createResourceBadge(`${props.data.technology}`, DatabaseZapIcon));
|
|
120
111
|
}
|
|
121
112
|
|
|
122
113
|
if (props.data?.residency) {
|
|
123
|
-
badges.push({
|
|
124
|
-
backgroundColor: 'red',
|
|
125
|
-
textColor: 'red',
|
|
126
|
-
content: `Residency: ${props.data.residency}`,
|
|
127
|
-
icon: MapIcon,
|
|
128
|
-
});
|
|
114
|
+
badges.push(createResourceBadge(`Residency: ${props.data.residency}`, MapIcon));
|
|
129
115
|
}
|
|
130
116
|
|
|
131
117
|
if (props.data?.retention) {
|
|
132
|
-
badges.push({
|
|
133
|
-
backgroundColor: 'green',
|
|
134
|
-
textColor: 'green',
|
|
135
|
-
content: `Retention: ${props.data.retention}`,
|
|
136
|
-
icon: ClockIcon,
|
|
137
|
-
});
|
|
118
|
+
badges.push(createResourceBadge(`Retention: ${props.data.retention}`, ClockIcon));
|
|
138
119
|
}
|
|
139
120
|
|
|
140
121
|
if (props.data?.access_mode) {
|
|
141
|
-
badges.push({
|
|
142
|
-
backgroundColor: 'green',
|
|
143
|
-
textColor: 'green',
|
|
144
|
-
content: `Access Mode: ${props.data.access_mode}`,
|
|
145
|
-
icon: ShieldCheckIcon,
|
|
146
|
-
});
|
|
122
|
+
badges.push(createResourceBadge(`Access Mode: ${props.data.access_mode}`, ShieldCheckIcon));
|
|
147
123
|
}
|
|
148
124
|
|
|
149
125
|
return badges;
|
|
150
126
|
}
|
|
151
127
|
|
|
152
128
|
if (props.collection === 'entities') {
|
|
153
|
-
const entityBadges = [
|
|
129
|
+
const entityBadges = [createResourceBadge('Entity', Box)];
|
|
154
130
|
if (props.data.aggregateRoot) {
|
|
155
|
-
entityBadges.push(
|
|
156
|
-
backgroundColor: 'purple',
|
|
157
|
-
textColor: 'purple',
|
|
158
|
-
content: '(Aggregate Root)',
|
|
159
|
-
icon: Boxes,
|
|
160
|
-
class: 'text-gray',
|
|
161
|
-
});
|
|
131
|
+
entityBadges.push(createResourceBadge('(Aggregate Root)', Boxes));
|
|
162
132
|
}
|
|
163
133
|
return entityBadges;
|
|
164
134
|
}
|
|
165
135
|
|
|
166
136
|
if (props.collection === 'data-products') {
|
|
167
|
-
return [
|
|
137
|
+
return [createResourceBadge('Data Product', Package)];
|
|
168
138
|
}
|
|
169
139
|
|
|
170
|
-
return [
|
|
140
|
+
return [createResourceBadge('', QueueListIcon)];
|
|
171
141
|
};
|
|
172
142
|
|
|
173
143
|
const getSpecificationBadges = () => {
|
|
@@ -412,13 +382,14 @@ if (!hasCurrentFlowEmbed && !hasCurrentPageNodeGraph) {
|
|
|
412
382
|
id={badge.id || ''}
|
|
413
383
|
class={`
|
|
414
384
|
inline-flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm font-medium
|
|
415
|
-
bg-[rgb(var(--ec-content-hover))] border border-[rgb(var(--ec-page-border))]
|
|
385
|
+
${badge.backgroundColor ? 'bg-[rgb(var(--ec-content-hover))]' : 'bg-transparent'} border border-[rgb(var(--ec-page-border))]
|
|
416
386
|
text-[rgb(var(--ec-page-text))]
|
|
417
387
|
shadow-xs
|
|
418
388
|
${badge.class ? badge.class : ''}
|
|
419
389
|
`}
|
|
390
|
+
style={getBadgeStyle(badge)}
|
|
420
391
|
>
|
|
421
|
-
{badge.icon && <badge.icon className="w-4 h-4 flex-shrink-0
|
|
392
|
+
{badge.icon && <badge.icon className="w-4 h-4 flex-shrink-0" />}
|
|
422
393
|
{badge.iconURL && <img src={badge.iconURL} class="w-4 h-4 flex-shrink-0 opacity-80" alt="" />}
|
|
423
394
|
<span>{badge.content}</span>
|
|
424
395
|
</span>
|
|
@@ -114,6 +114,52 @@
|
|
|
114
114
|
--ec-badge-data-product-text: 30 64 175; /* blue-800 */
|
|
115
115
|
--ec-badge-default-bg: 243 244 246; /* gray-100 */
|
|
116
116
|
--ec-badge-default-text: 75 85 99; /* gray-600 */
|
|
117
|
+
|
|
118
|
+
/* User-defined badge colors - light mode */
|
|
119
|
+
--ec-badge-color-slate-background: 248 250 252;
|
|
120
|
+
--ec-badge-color-slate-text: 71 85 105;
|
|
121
|
+
--ec-badge-color-gray-background: 249 250 251;
|
|
122
|
+
--ec-badge-color-gray-text: 75 85 99;
|
|
123
|
+
--ec-badge-color-zinc-background: 250 250 250;
|
|
124
|
+
--ec-badge-color-zinc-text: 82 82 91;
|
|
125
|
+
--ec-badge-color-neutral-background: 250 250 250;
|
|
126
|
+
--ec-badge-color-neutral-text: 82 82 82;
|
|
127
|
+
--ec-badge-color-stone-background: 250 250 249;
|
|
128
|
+
--ec-badge-color-stone-text: 87 83 78;
|
|
129
|
+
--ec-badge-color-red-background: 254 242 242;
|
|
130
|
+
--ec-badge-color-red-text: 185 28 28;
|
|
131
|
+
--ec-badge-color-orange-background: 255 247 237;
|
|
132
|
+
--ec-badge-color-orange-text: 194 65 12;
|
|
133
|
+
--ec-badge-color-amber-background: 255 251 235;
|
|
134
|
+
--ec-badge-color-amber-text: 180 83 9;
|
|
135
|
+
--ec-badge-color-yellow-background: 254 252 232;
|
|
136
|
+
--ec-badge-color-yellow-text: 161 98 7;
|
|
137
|
+
--ec-badge-color-lime-background: 247 254 231;
|
|
138
|
+
--ec-badge-color-lime-text: 77 124 15;
|
|
139
|
+
--ec-badge-color-green-background: 240 253 244;
|
|
140
|
+
--ec-badge-color-green-text: 21 128 61;
|
|
141
|
+
--ec-badge-color-emerald-background: 236 253 245;
|
|
142
|
+
--ec-badge-color-emerald-text: 4 120 87;
|
|
143
|
+
--ec-badge-color-teal-background: 240 253 250;
|
|
144
|
+
--ec-badge-color-teal-text: 15 118 110;
|
|
145
|
+
--ec-badge-color-cyan-background: 236 254 255;
|
|
146
|
+
--ec-badge-color-cyan-text: 14 116 144;
|
|
147
|
+
--ec-badge-color-sky-background: 240 249 255;
|
|
148
|
+
--ec-badge-color-sky-text: 3 105 161;
|
|
149
|
+
--ec-badge-color-blue-background: 239 246 255;
|
|
150
|
+
--ec-badge-color-blue-text: 29 78 216;
|
|
151
|
+
--ec-badge-color-indigo-background: 238 242 255;
|
|
152
|
+
--ec-badge-color-indigo-text: 67 56 202;
|
|
153
|
+
--ec-badge-color-violet-background: 245 243 255;
|
|
154
|
+
--ec-badge-color-violet-text: 109 40 217;
|
|
155
|
+
--ec-badge-color-purple-background: 250 245 255;
|
|
156
|
+
--ec-badge-color-purple-text: 126 34 206;
|
|
157
|
+
--ec-badge-color-fuchsia-background: 253 244 255;
|
|
158
|
+
--ec-badge-color-fuchsia-text: 162 28 175;
|
|
159
|
+
--ec-badge-color-pink-background: 253 242 248;
|
|
160
|
+
--ec-badge-color-pink-text: 190 24 93;
|
|
161
|
+
--ec-badge-color-rose-background: 255 241 242;
|
|
162
|
+
--ec-badge-color-rose-text: 190 18 60;
|
|
117
163
|
}
|
|
118
164
|
|
|
119
165
|
/* Dark theme */
|
|
@@ -222,6 +268,52 @@
|
|
|
222
268
|
--ec-badge-data-product-text: 147 197 253; /* blue-300 */
|
|
223
269
|
--ec-badge-default-bg: 63 63 70 / 0.3; /* zinc-700/30 */
|
|
224
270
|
--ec-badge-default-text: 212 212 216; /* zinc-300 */
|
|
271
|
+
|
|
272
|
+
/* User-defined badge colors - dark mode */
|
|
273
|
+
--ec-badge-color-slate-background: 51 65 85 / 0.28;
|
|
274
|
+
--ec-badge-color-slate-text: 203 213 225;
|
|
275
|
+
--ec-badge-color-gray-background: 55 65 81 / 0.28;
|
|
276
|
+
--ec-badge-color-gray-text: 209 213 219;
|
|
277
|
+
--ec-badge-color-zinc-background: 63 63 70 / 0.28;
|
|
278
|
+
--ec-badge-color-zinc-text: 212 212 216;
|
|
279
|
+
--ec-badge-color-neutral-background: 64 64 64 / 0.28;
|
|
280
|
+
--ec-badge-color-neutral-text: 212 212 212;
|
|
281
|
+
--ec-badge-color-stone-background: 68 64 60 / 0.28;
|
|
282
|
+
--ec-badge-color-stone-text: 214 211 209;
|
|
283
|
+
--ec-badge-color-red-background: 127 29 29 / 0.28;
|
|
284
|
+
--ec-badge-color-red-text: 252 165 165;
|
|
285
|
+
--ec-badge-color-orange-background: 124 45 18 / 0.28;
|
|
286
|
+
--ec-badge-color-orange-text: 253 186 116;
|
|
287
|
+
--ec-badge-color-amber-background: 120 53 15 / 0.28;
|
|
288
|
+
--ec-badge-color-amber-text: 252 211 77;
|
|
289
|
+
--ec-badge-color-yellow-background: 113 63 18 / 0.28;
|
|
290
|
+
--ec-badge-color-yellow-text: 253 224 71;
|
|
291
|
+
--ec-badge-color-lime-background: 54 83 20 / 0.28;
|
|
292
|
+
--ec-badge-color-lime-text: 190 242 100;
|
|
293
|
+
--ec-badge-color-green-background: 20 83 45 / 0.28;
|
|
294
|
+
--ec-badge-color-green-text: 134 239 172;
|
|
295
|
+
--ec-badge-color-emerald-background: 6 78 59 / 0.28;
|
|
296
|
+
--ec-badge-color-emerald-text: 110 231 183;
|
|
297
|
+
--ec-badge-color-teal-background: 17 94 89 / 0.28;
|
|
298
|
+
--ec-badge-color-teal-text: 94 234 212;
|
|
299
|
+
--ec-badge-color-cyan-background: 21 94 117 / 0.28;
|
|
300
|
+
--ec-badge-color-cyan-text: 103 232 249;
|
|
301
|
+
--ec-badge-color-sky-background: 12 74 110 / 0.28;
|
|
302
|
+
--ec-badge-color-sky-text: 125 211 252;
|
|
303
|
+
--ec-badge-color-blue-background: 30 64 175 / 0.28;
|
|
304
|
+
--ec-badge-color-blue-text: 147 197 253;
|
|
305
|
+
--ec-badge-color-indigo-background: 49 46 129 / 0.28;
|
|
306
|
+
--ec-badge-color-indigo-text: 165 180 252;
|
|
307
|
+
--ec-badge-color-violet-background: 76 29 149 / 0.28;
|
|
308
|
+
--ec-badge-color-violet-text: 196 181 253;
|
|
309
|
+
--ec-badge-color-purple-background: 88 28 135 / 0.28;
|
|
310
|
+
--ec-badge-color-purple-text: 216 180 254;
|
|
311
|
+
--ec-badge-color-fuchsia-background: 112 26 117 / 0.28;
|
|
312
|
+
--ec-badge-color-fuchsia-text: 240 171 252;
|
|
313
|
+
--ec-badge-color-pink-background: 131 24 67 / 0.28;
|
|
314
|
+
--ec-badge-color-pink-text: 249 168 212;
|
|
315
|
+
--ec-badge-color-rose-background: 136 19 55 / 0.28;
|
|
316
|
+
--ec-badge-color-rose-text: 253 164 175;
|
|
225
317
|
}
|
|
226
318
|
|
|
227
319
|
/* Dark mode prose overrides for documentation content */
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
type BadgeColorKind = 'background' | 'text';
|
|
2
|
+
|
|
3
|
+
type Badge = {
|
|
4
|
+
backgroundColor?: string;
|
|
5
|
+
textColor?: string;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const NAMED_BADGE_COLOR_KEYS = new Set([
|
|
9
|
+
'slate',
|
|
10
|
+
'gray',
|
|
11
|
+
'zinc',
|
|
12
|
+
'neutral',
|
|
13
|
+
'stone',
|
|
14
|
+
'red',
|
|
15
|
+
'orange',
|
|
16
|
+
'amber',
|
|
17
|
+
'yellow',
|
|
18
|
+
'lime',
|
|
19
|
+
'green',
|
|
20
|
+
'emerald',
|
|
21
|
+
'teal',
|
|
22
|
+
'cyan',
|
|
23
|
+
'sky',
|
|
24
|
+
'blue',
|
|
25
|
+
'indigo',
|
|
26
|
+
'violet',
|
|
27
|
+
'purple',
|
|
28
|
+
'fuchsia',
|
|
29
|
+
'pink',
|
|
30
|
+
'rose',
|
|
31
|
+
]);
|
|
32
|
+
|
|
33
|
+
const CSS_COLOR_VALUE_PATTERN =
|
|
34
|
+
/^(#[0-9a-f]{3,8}|(?:rgb|rgba|hsl|hsla|oklch|oklab|lab|lch|color)\(.+\)|var\(--[a-z0-9-_]+\)|transparent|currentColor)$/i;
|
|
35
|
+
|
|
36
|
+
// Common CSS named colors that callers may use directly (e.g. textColor: "white").
|
|
37
|
+
// Palette tokens above take precedence — names like "red" or "blue" resolve to the
|
|
38
|
+
// theme-aware token rather than the raw CSS keyword.
|
|
39
|
+
const CSS_NAMED_COLORS = new Set([
|
|
40
|
+
'aliceblue',
|
|
41
|
+
'antiquewhite',
|
|
42
|
+
'aqua',
|
|
43
|
+
'aquamarine',
|
|
44
|
+
'azure',
|
|
45
|
+
'beige',
|
|
46
|
+
'bisque',
|
|
47
|
+
'black',
|
|
48
|
+
'blanchedalmond',
|
|
49
|
+
'blueviolet',
|
|
50
|
+
'brown',
|
|
51
|
+
'burlywood',
|
|
52
|
+
'cadetblue',
|
|
53
|
+
'chartreuse',
|
|
54
|
+
'chocolate',
|
|
55
|
+
'coral',
|
|
56
|
+
'cornflowerblue',
|
|
57
|
+
'cornsilk',
|
|
58
|
+
'crimson',
|
|
59
|
+
'darkblue',
|
|
60
|
+
'darkcyan',
|
|
61
|
+
'darkgoldenrod',
|
|
62
|
+
'darkgray',
|
|
63
|
+
'darkgreen',
|
|
64
|
+
'darkgrey',
|
|
65
|
+
'darkkhaki',
|
|
66
|
+
'darkmagenta',
|
|
67
|
+
'darkolivegreen',
|
|
68
|
+
'darkorange',
|
|
69
|
+
'darkorchid',
|
|
70
|
+
'darkred',
|
|
71
|
+
'darksalmon',
|
|
72
|
+
'darkseagreen',
|
|
73
|
+
'darkslateblue',
|
|
74
|
+
'darkslategray',
|
|
75
|
+
'darkslategrey',
|
|
76
|
+
'darkturquoise',
|
|
77
|
+
'darkviolet',
|
|
78
|
+
'deeppink',
|
|
79
|
+
'deepskyblue',
|
|
80
|
+
'dimgray',
|
|
81
|
+
'dimgrey',
|
|
82
|
+
'dodgerblue',
|
|
83
|
+
'firebrick',
|
|
84
|
+
'floralwhite',
|
|
85
|
+
'forestgreen',
|
|
86
|
+
'gainsboro',
|
|
87
|
+
'ghostwhite',
|
|
88
|
+
'gold',
|
|
89
|
+
'goldenrod',
|
|
90
|
+
'greenyellow',
|
|
91
|
+
'grey',
|
|
92
|
+
'honeydew',
|
|
93
|
+
'hotpink',
|
|
94
|
+
'indianred',
|
|
95
|
+
'ivory',
|
|
96
|
+
'khaki',
|
|
97
|
+
'lavender',
|
|
98
|
+
'lavenderblush',
|
|
99
|
+
'lawngreen',
|
|
100
|
+
'lemonchiffon',
|
|
101
|
+
'lightblue',
|
|
102
|
+
'lightcoral',
|
|
103
|
+
'lightcyan',
|
|
104
|
+
'lightgoldenrodyellow',
|
|
105
|
+
'lightgray',
|
|
106
|
+
'lightgreen',
|
|
107
|
+
'lightgrey',
|
|
108
|
+
'lightpink',
|
|
109
|
+
'lightsalmon',
|
|
110
|
+
'lightseagreen',
|
|
111
|
+
'lightskyblue',
|
|
112
|
+
'lightslategray',
|
|
113
|
+
'lightslategrey',
|
|
114
|
+
'lightsteelblue',
|
|
115
|
+
'lightyellow',
|
|
116
|
+
'limegreen',
|
|
117
|
+
'linen',
|
|
118
|
+
'magenta',
|
|
119
|
+
'maroon',
|
|
120
|
+
'mediumaquamarine',
|
|
121
|
+
'mediumblue',
|
|
122
|
+
'mediumorchid',
|
|
123
|
+
'mediumpurple',
|
|
124
|
+
'mediumseagreen',
|
|
125
|
+
'mediumslateblue',
|
|
126
|
+
'mediumspringgreen',
|
|
127
|
+
'mediumturquoise',
|
|
128
|
+
'mediumvioletred',
|
|
129
|
+
'midnightblue',
|
|
130
|
+
'mintcream',
|
|
131
|
+
'mistyrose',
|
|
132
|
+
'moccasin',
|
|
133
|
+
'navajowhite',
|
|
134
|
+
'navy',
|
|
135
|
+
'oldlace',
|
|
136
|
+
'olive',
|
|
137
|
+
'olivedrab',
|
|
138
|
+
'orangered',
|
|
139
|
+
'orchid',
|
|
140
|
+
'palegoldenrod',
|
|
141
|
+
'palegreen',
|
|
142
|
+
'paleturquoise',
|
|
143
|
+
'palevioletred',
|
|
144
|
+
'papayawhip',
|
|
145
|
+
'peachpuff',
|
|
146
|
+
'peru',
|
|
147
|
+
'plum',
|
|
148
|
+
'powderblue',
|
|
149
|
+
'rebeccapurple',
|
|
150
|
+
'rosybrown',
|
|
151
|
+
'royalblue',
|
|
152
|
+
'saddlebrown',
|
|
153
|
+
'salmon',
|
|
154
|
+
'sandybrown',
|
|
155
|
+
'seagreen',
|
|
156
|
+
'seashell',
|
|
157
|
+
'sienna',
|
|
158
|
+
'silver',
|
|
159
|
+
'skyblue',
|
|
160
|
+
'slateblue',
|
|
161
|
+
'slategray',
|
|
162
|
+
'slategrey',
|
|
163
|
+
'snow',
|
|
164
|
+
'springgreen',
|
|
165
|
+
'steelblue',
|
|
166
|
+
'tan',
|
|
167
|
+
'thistle',
|
|
168
|
+
'tomato',
|
|
169
|
+
'turquoise',
|
|
170
|
+
'wheat',
|
|
171
|
+
'white',
|
|
172
|
+
'whitesmoke',
|
|
173
|
+
'yellowgreen',
|
|
174
|
+
]);
|
|
175
|
+
|
|
176
|
+
const resolveBadgeColor = (color: string | undefined, kind: BadgeColorKind) => {
|
|
177
|
+
if (!color) return undefined;
|
|
178
|
+
|
|
179
|
+
const value = color.trim();
|
|
180
|
+
const namedColorKey = value.toLowerCase();
|
|
181
|
+
|
|
182
|
+
if (NAMED_BADGE_COLOR_KEYS.has(namedColorKey)) return `rgb(var(--ec-badge-color-${namedColorKey}-${kind}))`;
|
|
183
|
+
if (CSS_COLOR_VALUE_PATTERN.test(value)) return value;
|
|
184
|
+
if (CSS_NAMED_COLORS.has(namedColorKey)) return namedColorKey;
|
|
185
|
+
|
|
186
|
+
return undefined;
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
export const getBadgeStyle = (badge: Badge) => {
|
|
190
|
+
const backgroundColor = resolveBadgeColor(badge.backgroundColor, 'background');
|
|
191
|
+
const color = resolveBadgeColor(badge.textColor, 'text');
|
|
192
|
+
|
|
193
|
+
return [backgroundColor ? `background-color: ${backgroundColor};` : '', color ? `color: ${color};` : '']
|
|
194
|
+
.filter(Boolean)
|
|
195
|
+
.join(' ');
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
export const getBadgeReactStyle = (badge: Badge) => {
|
|
199
|
+
const backgroundColor = resolveBadgeColor(badge.backgroundColor, 'background');
|
|
200
|
+
const color = resolveBadgeColor(badge.textColor, 'text');
|
|
201
|
+
|
|
202
|
+
return {
|
|
203
|
+
...(backgroundColor ? { backgroundColor } : {}),
|
|
204
|
+
...(color ? { color } : {}),
|
|
205
|
+
};
|
|
206
|
+
};
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
},
|
|
8
8
|
"license": "SEE LICENSE IN LICENSE",
|
|
9
9
|
"type": "module",
|
|
10
|
-
"version": "3.39.
|
|
10
|
+
"version": "3.39.4",
|
|
11
11
|
"publishConfig": {
|
|
12
12
|
"access": "public"
|
|
13
13
|
},
|
|
@@ -106,9 +106,9 @@
|
|
|
106
106
|
"update-notifier": "^7.3.1",
|
|
107
107
|
"uuid": "^10.0.0",
|
|
108
108
|
"zod": "^4.3.6",
|
|
109
|
-
"@eventcatalog/linter": "1.0.23",
|
|
110
109
|
"@eventcatalog/sdk": "2.21.1",
|
|
111
|
-
"@eventcatalog/visualiser": "^3.21.0"
|
|
110
|
+
"@eventcatalog/visualiser": "^3.21.0",
|
|
111
|
+
"@eventcatalog/linter": "1.0.23"
|
|
112
112
|
},
|
|
113
113
|
"devDependencies": {
|
|
114
114
|
"@astrojs/check": "^0.9.9",
|