@eventcatalog/core 3.0.0 → 3.2.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.
- 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-VO5WYA44.js → chunk-AA47DJ43.js} +1 -1
- package/dist/{chunk-EKGR533N.js → chunk-GGRXP5WM.js} +1 -1
- package/dist/{chunk-E5Q7TZYT.js → chunk-L3QRQT7U.js} +1 -1
- package/dist/{chunk-BYP43AAT.js → chunk-RWYEP5SD.js} +1 -1
- package/dist/{chunk-KF5PARQK.js → chunk-VPQCMMRM.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/eventcatalog.cjs +1 -1
- package/dist/eventcatalog.config.d.cts +7 -0
- package/dist/eventcatalog.config.d.ts +7 -0
- 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/ChatPanel/ChatPanel.tsx +520 -247
- package/eventcatalog/src/components/ChatPanel/ChatPanelButton.tsx +3 -3
- package/eventcatalog/src/components/Checkbox.astro +7 -4
- package/eventcatalog/src/components/CopyAsMarkdown.tsx +15 -15
- package/eventcatalog/src/components/EnvironmentDropdown.tsx +15 -7
- package/eventcatalog/src/components/FavoriteButton.tsx +1 -1
- package/eventcatalog/src/components/Grids/DomainGrid.tsx +72 -60
- package/eventcatalog/src/components/Grids/MessageGrid.tsx +68 -48
- package/eventcatalog/src/components/Header.astro +15 -10
- package/eventcatalog/src/components/Lists/OwnersList.tsx +17 -10
- package/eventcatalog/src/components/Lists/PillListFlat.styles.css +12 -0
- package/eventcatalog/src/components/Lists/PillListFlat.tsx +15 -15
- package/eventcatalog/src/components/Lists/VersionList.astro +15 -5
- package/eventcatalog/src/components/MDX/Accordion/Accordion.tsx +3 -3
- package/eventcatalog/src/components/MDX/Admonition.tsx +49 -9
- package/eventcatalog/src/components/MDX/Attachments.astro +15 -11
- package/eventcatalog/src/components/MDX/ChannelInformation/ChannelInformation.tsx +29 -15
- package/eventcatalog/src/components/MDX/EntityPropertiesTable/EntityPropertiesTable.astro +20 -13
- package/eventcatalog/src/components/MDX/Link/Link.astro +1 -1
- package/eventcatalog/src/components/MDX/MessageTable/MessageTable.client.tsx +50 -29
- package/eventcatalog/src/components/MDX/NodeGraph/NodeGraph.tsx +14 -12
- package/eventcatalog/src/components/MDX/NodeGraph/StepWalkthrough.tsx +4 -4
- package/eventcatalog/src/components/MDX/NodeGraph/StudioModal.tsx +4 -4
- package/eventcatalog/src/components/MDX/NodeGraph/VisualiserSearch.tsx +2 -2
- package/eventcatalog/src/components/MDX/ResourceGroupTable/ResourceGroupTable.client.tsx +54 -33
- package/eventcatalog/src/components/MDX/ResourceLink/ResourceLink.astro +1 -1
- package/eventcatalog/src/components/MDX/Steps/Step.astro +2 -2
- package/eventcatalog/src/components/MDX/Steps/Steps.astro +3 -3
- package/eventcatalog/src/components/MDX/Tabs/Tabs.astro +13 -9
- package/eventcatalog/src/components/MDX/Tiles/Tile.astro +25 -13
- package/eventcatalog/src/components/MDX/Tiles/Tiles.astro +1 -1
- package/eventcatalog/src/components/SchemaExplorer/ApiAccessSection.tsx +3 -3
- package/eventcatalog/src/components/SchemaExplorer/ApiContentViewer.tsx +3 -3
- package/eventcatalog/src/components/SchemaExplorer/AvroSchemaViewer.tsx +29 -25
- package/eventcatalog/src/components/SchemaExplorer/DiffViewer.tsx +3 -3
- package/eventcatalog/src/components/SchemaExplorer/JSONSchemaViewer.tsx +61 -42
- package/eventcatalog/src/components/SchemaExplorer/OwnersSection.tsx +13 -9
- package/eventcatalog/src/components/SchemaExplorer/Pagination.tsx +6 -4
- package/eventcatalog/src/components/SchemaExplorer/ProducersConsumersSection.tsx +17 -13
- package/eventcatalog/src/components/SchemaExplorer/SchemaContentViewer.tsx +35 -8
- package/eventcatalog/src/components/SchemaExplorer/SchemaDetailsHeader.tsx +33 -21
- package/eventcatalog/src/components/SchemaExplorer/SchemaDetailsPanel.tsx +1 -1
- package/eventcatalog/src/components/SchemaExplorer/SchemaExplorer.tsx +41 -33
- package/eventcatalog/src/components/SchemaExplorer/SchemaListItem.tsx +19 -7
- package/eventcatalog/src/components/SchemaExplorer/SchemaViewerModal.tsx +8 -8
- package/eventcatalog/src/components/Search/Search.astro +3 -3
- package/eventcatalog/src/components/Search/SearchModal.tsx +65 -36
- package/eventcatalog/src/components/SideNav/NestedSideBar/SearchBar.tsx +31 -21
- package/eventcatalog/src/components/SideNav/NestedSideBar/index.tsx +92 -59
- package/eventcatalog/src/components/Tables/Table.tsx +25 -24
- package/eventcatalog/src/components/Tables/columns/ContainersTableColumns.tsx +22 -16
- package/eventcatalog/src/components/Tables/columns/DomainTableColumns.tsx +14 -11
- package/eventcatalog/src/components/Tables/columns/FlowTableColumns.tsx +6 -6
- package/eventcatalog/src/components/Tables/columns/MessageTableColumns.tsx +22 -16
- package/eventcatalog/src/components/Tables/columns/ServiceTableColumns.tsx +22 -16
- package/eventcatalog/src/components/Tables/columns/SharedColumns.tsx +4 -4
- package/eventcatalog/src/components/Tables/columns/TeamsTableColumns.tsx +21 -13
- package/eventcatalog/src/components/Tables/columns/UserTableColumns.tsx +30 -19
- package/eventcatalog/src/components/ThemeToggle.tsx +18 -0
- package/eventcatalog/src/enterprise/ai/chat-api.ts +24 -3
- package/eventcatalog/src/enterprise/custom-documentation/components/CustomDocsNav/components/NestedItem.tsx +15 -7
- package/eventcatalog/src/enterprise/custom-documentation/components/CustomDocsNav/components/NoResultsFound.tsx +2 -2
- package/eventcatalog/src/enterprise/custom-documentation/components/CustomDocsNav/index.tsx +19 -15
- package/eventcatalog/src/enterprise/custom-documentation/pages/docs/custom/index.astro +50 -17
- package/eventcatalog/src/layouts/DirectoryLayout.astro +11 -6
- package/eventcatalog/src/layouts/DiscoverLayout.astro +13 -8
- package/eventcatalog/src/layouts/Footer.astro +6 -6
- package/eventcatalog/src/layouts/VerticalSideBarLayout.astro +62 -14
- package/eventcatalog/src/pages/_index.astro +135 -179
- package/eventcatalog/src/pages/architecture/[type]/[id]/[version]/index.astro +2 -2
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/graphql/[filename].astro +4 -4
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/index.astro +77 -63
- package/eventcatalog/src/pages/docs/[type]/[id]/language/[dictionaryId]/index.astro +23 -24
- package/eventcatalog/src/pages/docs/[type]/[id]/language/index.astro +66 -50
- package/eventcatalog/src/pages/docs/custom/index.astro +2 -2
- package/eventcatalog/src/pages/docs/teams/[id]/index.astro +25 -21
- package/eventcatalog/src/pages/docs/users/[id]/index.astro +25 -21
- package/eventcatalog/src/pages/schemas/explorer/index.astro +1 -1
- package/eventcatalog/src/pages/studio.astro +59 -31
- package/eventcatalog/src/remark-plugins/directives.ts +6 -6
- package/eventcatalog/src/remark-plugins/mermaid.ts +2 -2
- package/eventcatalog/src/stores/theme-store.ts +93 -0
- package/eventcatalog/src/styles/theme.css +255 -0
- package/eventcatalog/src/styles/themes/forest.css +230 -0
- package/eventcatalog/src/styles/themes/ocean.css +235 -0
- package/eventcatalog/src/styles/themes/sapphire.css +230 -0
- package/eventcatalog/src/styles/themes/sunset.css +230 -0
- package/eventcatalog/src/utils/feature.ts +4 -0
- package/eventcatalog/tailwind.config.mjs +6 -3
- package/package.json +7 -6
|
@@ -25,26 +25,32 @@ export default function SchemaListItem({ message, isSelected, versions, onClick,
|
|
|
25
25
|
ref={itemRef}
|
|
26
26
|
onClick={onClick}
|
|
27
27
|
className={`w-full text-left px-3 py-2 transition-all duration-75 group border-l-2 ${
|
|
28
|
-
isSelected
|
|
28
|
+
isSelected
|
|
29
|
+
? `bg-${color}-50 dark:bg-${color}-500/10 border-l-${color}-500`
|
|
30
|
+
: 'hover:bg-[rgb(var(--ec-content-hover))] border-l-transparent'
|
|
29
31
|
}`}
|
|
30
32
|
>
|
|
31
33
|
<div className="flex items-center gap-2.5">
|
|
32
34
|
{/* Collection Icon */}
|
|
33
35
|
<div
|
|
34
36
|
className={`flex-shrink-0 flex items-center justify-center w-7 h-7 rounded-md ${
|
|
35
|
-
isSelected ? `bg-${color}-100` : `bg-${color}-100/60`
|
|
37
|
+
isSelected ? `bg-${color}-100 dark:bg-${color}-500/20` : `bg-${color}-100/60 dark:bg-${color}-500/10`
|
|
36
38
|
}`}
|
|
37
39
|
>
|
|
38
|
-
<Icon className={`h-3.5 w-3.5 text-${color}-600`} />
|
|
40
|
+
<Icon className={`h-3.5 w-3.5 text-${color}-600 dark:text-${color}-400`} />
|
|
39
41
|
</div>
|
|
40
42
|
|
|
41
43
|
<div className="flex-1 min-w-0">
|
|
42
44
|
{/* Name row with version */}
|
|
43
45
|
<div className="flex items-center gap-1.5">
|
|
44
|
-
<span
|
|
46
|
+
<span
|
|
47
|
+
className={`text-[13px] font-semibold truncate ${isSelected ? 'text-[rgb(var(--ec-page-text))]' : 'text-[rgb(var(--ec-page-text))]'}`}
|
|
48
|
+
>
|
|
45
49
|
{message.data.name}
|
|
46
50
|
</span>
|
|
47
|
-
<span
|
|
51
|
+
<span
|
|
52
|
+
className={`text-[10px] tabular-nums flex-shrink-0 ${isSelected ? 'text-[rgb(var(--ec-page-text-muted))]' : 'text-[rgb(var(--ec-icon-color))]'}`}
|
|
53
|
+
>
|
|
48
54
|
v{message.data.version}
|
|
49
55
|
</span>
|
|
50
56
|
</div>
|
|
@@ -52,7 +58,9 @@ export default function SchemaListItem({ message, isSelected, versions, onClick,
|
|
|
52
58
|
{/* Meta row */}
|
|
53
59
|
<div className="flex items-center gap-1.5 mt-0.5">
|
|
54
60
|
{/* Schema Format */}
|
|
55
|
-
<span
|
|
61
|
+
<span
|
|
62
|
+
className={`inline-flex items-center gap-1 text-[10px] ${isSelected ? 'text-[rgb(var(--ec-page-text-muted))]' : 'text-[rgb(var(--ec-page-text-muted))]'}`}
|
|
63
|
+
>
|
|
56
64
|
{hasSchemaIcon && (
|
|
57
65
|
<img src={buildUrl(`/icons/${iconName}.svg`, true)} alt={`${ext} icon`} className="h-3 w-3 opacity-70" />
|
|
58
66
|
)}
|
|
@@ -61,7 +69,11 @@ export default function SchemaListItem({ message, isSelected, versions, onClick,
|
|
|
61
69
|
|
|
62
70
|
{/* Versions count */}
|
|
63
71
|
{hasMultipleVersions && (
|
|
64
|
-
<span
|
|
72
|
+
<span
|
|
73
|
+
className={`text-[10px] ${isSelected ? 'text-[rgb(var(--ec-page-text-muted))]' : 'text-[rgb(var(--ec-icon-color))]'}`}
|
|
74
|
+
>
|
|
75
|
+
· {versions.length}v
|
|
76
|
+
</span>
|
|
65
77
|
)}
|
|
66
78
|
</div>
|
|
67
79
|
</div>
|
|
@@ -27,14 +27,14 @@ export default function SchemaViewerModal({
|
|
|
27
27
|
<Dialog.Root open={isOpen} onOpenChange={onOpenChange}>
|
|
28
28
|
<Dialog.Portal>
|
|
29
29
|
<Dialog.Overlay className="fixed inset-0 bg-black/50 data-[state=open]:animate-overlayShow z-50" />
|
|
30
|
-
<Dialog.Content className="fixed inset-4 md:inset-8 rounded-lg bg-
|
|
30
|
+
<Dialog.Content className="fixed inset-4 md:inset-8 rounded-lg bg-[rgb(var(--ec-card-bg,var(--ec-page-bg)))] shadow-xl focus:outline-none data-[state=open]:animate-contentShow z-[100] flex flex-col">
|
|
31
31
|
{/* Header */}
|
|
32
|
-
<div className="flex items-center justify-between p-6 border-b border-
|
|
32
|
+
<div className="flex items-center justify-between p-6 border-b border-[rgb(var(--ec-page-border))] flex-shrink-0">
|
|
33
33
|
<div className="flex items-center gap-3">
|
|
34
|
-
<ArrowsPointingOutIcon className="h-6 w-6 text-
|
|
34
|
+
<ArrowsPointingOutIcon className="h-6 w-6 text-[rgb(var(--ec-icon-color))]" />
|
|
35
35
|
<div>
|
|
36
|
-
<Dialog.Title className="text-xl font-semibold text-
|
|
37
|
-
<Dialog.Description className="text-sm text-
|
|
36
|
+
<Dialog.Title className="text-xl font-semibold text-[rgb(var(--ec-page-text))]">{message.data.name}</Dialog.Title>
|
|
37
|
+
<Dialog.Description className="text-sm text-[rgb(var(--ec-page-text-muted))] mt-1">
|
|
38
38
|
v{message.data.version} · {isAvro ? 'Avro' : 'JSON'} Schema
|
|
39
39
|
</Dialog.Description>
|
|
40
40
|
</div>
|
|
@@ -42,7 +42,7 @@ export default function SchemaViewerModal({
|
|
|
42
42
|
<Dialog.Close asChild>
|
|
43
43
|
<button
|
|
44
44
|
type="button"
|
|
45
|
-
className="p-2 text-
|
|
45
|
+
className="p-2 text-[rgb(var(--ec-icon-color))] hover:text-[rgb(var(--ec-page-text))] hover:bg-[rgb(var(--ec-content-hover))] rounded-md transition-colors"
|
|
46
46
|
aria-label="Close"
|
|
47
47
|
>
|
|
48
48
|
<XMarkIcon className="h-6 w-6" />
|
|
@@ -60,11 +60,11 @@ export default function SchemaViewerModal({
|
|
|
60
60
|
</div>
|
|
61
61
|
|
|
62
62
|
{/* Footer */}
|
|
63
|
-
<div className="flex justify-end p-4 border-t border-
|
|
63
|
+
<div className="flex justify-end p-4 border-t border-[rgb(var(--ec-page-border))] flex-shrink-0">
|
|
64
64
|
<Dialog.Close asChild>
|
|
65
65
|
<button
|
|
66
66
|
type="button"
|
|
67
|
-
className="px-4 py-2 text-sm font-medium text-
|
|
67
|
+
className="px-4 py-2 text-sm font-medium text-[rgb(var(--ec-page-text))] bg-[rgb(var(--ec-card-bg,var(--ec-page-bg)))] border border-[rgb(var(--ec-page-border))] rounded-md hover:bg-[rgb(var(--ec-content-hover))] focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ec-accent))] focus:ring-offset-2 transition-colors"
|
|
68
68
|
>
|
|
69
69
|
Close
|
|
70
70
|
</button>
|
|
@@ -11,11 +11,11 @@ import SearchModal from './SearchModal.tsx';
|
|
|
11
11
|
name="search"
|
|
12
12
|
placeholder="Search EventCatalog"
|
|
13
13
|
autocomplete="off"
|
|
14
|
-
class="block w-full rounded-md caret-transparent border-0 py-1.5 pr-14 pl-10 text-
|
|
14
|
+
class="block w-full rounded-md caret-transparent border-0 py-1.5 pr-14 pl-10 text-[rgb(var(--ec-header-text))] bg-[rgb(var(--ec-dropdown-bg))] shadow-sm ring-1 ring-inset ring-[rgb(var(--ec-dropdown-border))] placeholder:text-[rgb(var(--ec-icon-color))] font-light sm:text-sm sm:leading-6 px-4"
|
|
15
15
|
/>
|
|
16
|
-
<MagnifyingGlassIcon className="absolute inset-y-0 left-0 h-9 w-8 flex items-center pl-4 text-
|
|
16
|
+
<MagnifyingGlassIcon className="absolute inset-y-0 left-0 h-9 w-8 flex items-center pl-4 text-[rgb(var(--ec-icon-color))]" />
|
|
17
17
|
<div class="absolute inset-y-0 right-0 flex py-1.5 pr-6">
|
|
18
|
-
<kbd class="inline-flex items-center rounded px-1 font-sans text-xs text-
|
|
18
|
+
<kbd class="inline-flex items-center rounded px-1 font-sans text-xs text-[rgb(var(--ec-icon-color))]">⌘K</kbd>
|
|
19
19
|
</div>
|
|
20
20
|
</div>
|
|
21
21
|
</div>
|
|
@@ -46,21 +46,22 @@ const typeIcons: any = {
|
|
|
46
46
|
};
|
|
47
47
|
|
|
48
48
|
const typeColors: any = {
|
|
49
|
-
Domain: 'text-orange-500 bg-orange-50 ring-orange-200',
|
|
50
|
-
Service: 'text-pink-500 bg-pink-50 ring-pink-200',
|
|
51
|
-
Event: 'text-orange-500 bg-orange-50 ring-orange-200',
|
|
52
|
-
Command: 'text-blue-500 bg-blue-50 ring-blue-200',
|
|
53
|
-
Query: 'text-green-500 bg-green-50 ring-green-200',
|
|
54
|
-
Entity: 'text-purple-500 bg-purple-50 ring-purple-200',
|
|
55
|
-
Channel: 'text-indigo-500 bg-indigo-50 ring-indigo-200',
|
|
56
|
-
Team: 'text-teal-500 bg-teal-50 ring-teal-200',
|
|
57
|
-
User: 'text-cyan-500 bg-cyan-50 ring-cyan-200',
|
|
58
|
-
Language: 'text-amber-500 bg-amber-50 ring-amber-200',
|
|
59
|
-
OpenAPI:
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
49
|
+
Domain: 'text-orange-500 dark:text-orange-400 bg-orange-50 dark:bg-orange-500/10 ring-orange-200 dark:ring-orange-500/30',
|
|
50
|
+
Service: 'text-pink-500 dark:text-pink-400 bg-pink-50 dark:bg-pink-500/10 ring-pink-200 dark:ring-pink-500/30',
|
|
51
|
+
Event: 'text-orange-500 dark:text-orange-400 bg-orange-50 dark:bg-orange-500/10 ring-orange-200 dark:ring-orange-500/30',
|
|
52
|
+
Command: 'text-blue-500 dark:text-blue-400 bg-blue-50 dark:bg-blue-500/10 ring-blue-200 dark:ring-blue-500/30',
|
|
53
|
+
Query: 'text-green-500 dark:text-green-400 bg-green-50 dark:bg-green-500/10 ring-green-200 dark:ring-green-500/30',
|
|
54
|
+
Entity: 'text-purple-500 dark:text-purple-400 bg-purple-50 dark:bg-purple-500/10 ring-purple-200 dark:ring-purple-500/30',
|
|
55
|
+
Channel: 'text-indigo-500 dark:text-indigo-400 bg-indigo-50 dark:bg-indigo-500/10 ring-indigo-200 dark:ring-indigo-500/30',
|
|
56
|
+
Team: 'text-teal-500 dark:text-teal-400 bg-teal-50 dark:bg-teal-500/10 ring-teal-200 dark:ring-teal-500/30',
|
|
57
|
+
User: 'text-cyan-500 dark:text-cyan-400 bg-cyan-50 dark:bg-cyan-500/10 ring-cyan-200 dark:ring-cyan-500/30',
|
|
58
|
+
Language: 'text-amber-500 dark:text-amber-400 bg-amber-50 dark:bg-amber-500/10 ring-amber-200 dark:ring-amber-500/30',
|
|
59
|
+
OpenAPI:
|
|
60
|
+
'text-emerald-500 dark:text-emerald-400 bg-emerald-50 dark:bg-emerald-500/10 ring-emerald-200 dark:ring-emerald-500/30',
|
|
61
|
+
AsyncAPI: 'text-violet-500 dark:text-violet-400 bg-violet-50 dark:bg-violet-500/10 ring-violet-200 dark:ring-violet-500/30',
|
|
62
|
+
Design: 'text-gray-500 dark:text-gray-400 bg-gray-50 dark:bg-gray-500/10 ring-gray-200 dark:ring-gray-500/30',
|
|
63
|
+
Container: 'text-indigo-500 dark:text-indigo-400 bg-indigo-50 dark:bg-indigo-500/10 ring-indigo-200 dark:ring-indigo-500/30',
|
|
64
|
+
default: 'text-gray-500 dark:text-gray-400 bg-gray-50 dark:bg-gray-500/10 ring-gray-200 dark:ring-gray-500/30',
|
|
64
65
|
};
|
|
65
66
|
|
|
66
67
|
function classNames(...classes: (string | boolean | undefined)[]) {
|
|
@@ -294,7 +295,7 @@ export default function SearchModal() {
|
|
|
294
295
|
leaveFrom="opacity-100"
|
|
295
296
|
leaveTo="opacity-0"
|
|
296
297
|
>
|
|
297
|
-
<div className="fixed inset-0 bg-
|
|
298
|
+
<div className="fixed inset-0 bg-black/40 dark:bg-black/60 transition-opacity backdrop-blur-sm" />
|
|
298
299
|
</Transition.Child>
|
|
299
300
|
|
|
300
301
|
<div className="fixed inset-0 z-10 w-screen overflow-y-auto p-4 sm:p-6 md:p-20">
|
|
@@ -307,7 +308,7 @@ export default function SearchModal() {
|
|
|
307
308
|
leaveFrom="opacity-100 scale-100"
|
|
308
309
|
leaveTo="opacity-0 scale-95"
|
|
309
310
|
>
|
|
310
|
-
<Dialog.Panel className="mx-auto max-w-2xl transform divide-y divide-
|
|
311
|
+
<Dialog.Panel className="mx-auto max-w-2xl transform divide-y divide-[rgb(var(--ec-page-border))] overflow-hidden rounded-xl bg-[rgb(var(--ec-card-bg,var(--ec-page-bg)))] shadow-2xl ring-1 ring-black/10 dark:ring-white/10 transition-all">
|
|
311
312
|
<Combobox
|
|
312
313
|
onChange={(item: any) => {
|
|
313
314
|
if (item?.url) {
|
|
@@ -316,14 +317,14 @@ export default function SearchModal() {
|
|
|
316
317
|
}
|
|
317
318
|
}}
|
|
318
319
|
>
|
|
319
|
-
<div className="relative border-b border-
|
|
320
|
+
<div className="relative border-b border-[rgb(var(--ec-page-border))]">
|
|
320
321
|
<MagnifyingGlassIcon
|
|
321
|
-
className="pointer-events-none absolute left-4 top-3.5 h-5 w-5 text-
|
|
322
|
+
className="pointer-events-none absolute left-4 top-3.5 h-5 w-5 text-[rgb(var(--ec-icon-color))]"
|
|
322
323
|
aria-hidden="true"
|
|
323
324
|
/>
|
|
324
325
|
<Combobox.Input
|
|
325
326
|
ref={inputRef}
|
|
326
|
-
className="h-12 w-full border-0 bg-transparent pl-11 pr-4 text-
|
|
327
|
+
className="h-12 w-full border-0 bg-transparent pl-11 pr-4 text-[rgb(var(--ec-page-text))] placeholder:text-[rgb(var(--ec-icon-color))] focus:ring-0 sm:text-sm focus:outline-none"
|
|
327
328
|
placeholder="Search..."
|
|
328
329
|
onChange={(event) => setQuery(event.target.value)}
|
|
329
330
|
value={query}
|
|
@@ -333,14 +334,16 @@ export default function SearchModal() {
|
|
|
333
334
|
</div>
|
|
334
335
|
|
|
335
336
|
{/* Filter Tabs */}
|
|
336
|
-
<div className="flex items-center gap-2 px-4 py-3 overflow-x-auto no-scrollbar border-b border-
|
|
337
|
+
<div className="flex items-center gap-2 px-4 py-3 overflow-x-auto no-scrollbar border-b border-[rgb(var(--ec-page-border))]">
|
|
337
338
|
{filters.map((tab) => (
|
|
338
339
|
<button
|
|
339
340
|
key={tab.id}
|
|
340
341
|
onClick={() => setActiveFilter(tab.id)}
|
|
341
342
|
className={classNames(
|
|
342
343
|
'px-3 py-1 text-xs font-medium rounded-full transition-colors whitespace-nowrap',
|
|
343
|
-
activeFilter === tab.id
|
|
344
|
+
activeFilter === tab.id
|
|
345
|
+
? 'bg-[rgb(var(--ec-accent-subtle))] text-[rgb(var(--ec-accent-text))]'
|
|
346
|
+
: 'bg-[rgb(var(--ec-content-hover))] text-[rgb(var(--ec-page-text-muted))] hover:bg-[rgb(var(--ec-content-active))]'
|
|
344
347
|
)}
|
|
345
348
|
>
|
|
346
349
|
{tab.name}
|
|
@@ -352,7 +355,7 @@ export default function SearchModal() {
|
|
|
352
355
|
<>
|
|
353
356
|
{query === '' && favorites.length > 0 && (
|
|
354
357
|
<div className="px-6 pt-3 pb-2">
|
|
355
|
-
<p className="text-xs text-
|
|
358
|
+
<p className="text-xs text-[rgb(var(--ec-page-text-muted))]">Favourites</p>
|
|
356
359
|
</div>
|
|
357
360
|
)}
|
|
358
361
|
<Combobox.Options static className="max-h-96 scroll-py-3 overflow-y-auto p-3">
|
|
@@ -367,7 +370,10 @@ export default function SearchModal() {
|
|
|
367
370
|
key={item.id}
|
|
368
371
|
value={item}
|
|
369
372
|
className={({ active }) =>
|
|
370
|
-
classNames(
|
|
373
|
+
classNames(
|
|
374
|
+
'flex cursor-default select-none rounded-xl p-3 group',
|
|
375
|
+
active && 'bg-[rgb(var(--ec-content-active))]'
|
|
376
|
+
)
|
|
371
377
|
}
|
|
372
378
|
>
|
|
373
379
|
{({ active }) => (
|
|
@@ -381,17 +387,30 @@ export default function SearchModal() {
|
|
|
381
387
|
<Icon className="h-6 w-6" aria-hidden="true" />
|
|
382
388
|
</div>
|
|
383
389
|
<div className="ml-4 flex-auto min-w-0">
|
|
384
|
-
<p
|
|
390
|
+
<p
|
|
391
|
+
className={classNames(
|
|
392
|
+
'text-sm font-medium',
|
|
393
|
+
active ? 'text-[rgb(var(--ec-page-text))]' : 'text-[rgb(var(--ec-page-text))]'
|
|
394
|
+
)}
|
|
395
|
+
>
|
|
385
396
|
{item.name}
|
|
386
397
|
</p>
|
|
387
398
|
<div className="flex items-center gap-2">
|
|
388
399
|
<p
|
|
389
|
-
className={classNames(
|
|
400
|
+
className={classNames(
|
|
401
|
+
'text-sm flex-shrink-0',
|
|
402
|
+
active ? 'text-[rgb(var(--ec-page-text))]' : 'text-[rgb(var(--ec-page-text-muted))]'
|
|
403
|
+
)}
|
|
390
404
|
>
|
|
391
405
|
{item.type}
|
|
392
406
|
</p>
|
|
393
407
|
{item.rawNode.summary && (
|
|
394
|
-
<p
|
|
408
|
+
<p
|
|
409
|
+
className={classNames(
|
|
410
|
+
'text-sm truncate',
|
|
411
|
+
active ? 'text-[rgb(var(--ec-page-text-muted))]' : 'text-[rgb(var(--ec-icon-color))]'
|
|
412
|
+
)}
|
|
413
|
+
>
|
|
395
414
|
• {item.rawNode.summary}
|
|
396
415
|
</p>
|
|
397
416
|
)}
|
|
@@ -408,12 +427,14 @@ export default function SearchModal() {
|
|
|
408
427
|
'p-1 rounded-md transition-colors mr-2',
|
|
409
428
|
isFavorite
|
|
410
429
|
? 'text-amber-400 hover:text-amber-500'
|
|
411
|
-
: 'text-
|
|
430
|
+
: 'text-[rgb(var(--ec-icon-color))] opacity-0 group-hover:opacity-100 hover:text-amber-400'
|
|
412
431
|
)}
|
|
413
432
|
>
|
|
414
433
|
{isFavorite ? <StarIconSolid className="h-5 w-5" /> : <StarIcon className="h-5 w-5" />}
|
|
415
434
|
</button>
|
|
416
|
-
{active &&
|
|
435
|
+
{active && (
|
|
436
|
+
<ArrowRightIcon className="h-5 w-5 text-[rgb(var(--ec-icon-color))]" aria-hidden="true" />
|
|
437
|
+
)}
|
|
417
438
|
</div>
|
|
418
439
|
</>
|
|
419
440
|
)}
|
|
@@ -426,22 +447,30 @@ export default function SearchModal() {
|
|
|
426
447
|
|
|
427
448
|
{query !== '' && filteredItems.length === 0 && (
|
|
428
449
|
<div className="py-14 px-6 text-center text-sm sm:px-14">
|
|
429
|
-
<ExclamationCircleIcon
|
|
430
|
-
|
|
431
|
-
|
|
450
|
+
<ExclamationCircleIcon
|
|
451
|
+
type="outline"
|
|
452
|
+
name="exclamation-circle"
|
|
453
|
+
className="mx-auto h-6 w-6 text-[rgb(var(--ec-icon-color))]"
|
|
454
|
+
/>
|
|
455
|
+
<p className="mt-4 font-semibold text-[rgb(var(--ec-page-text))]">No results found</p>
|
|
456
|
+
<p className="mt-2 text-[rgb(var(--ec-page-text-muted))]">
|
|
457
|
+
No components found for this search term. Please try again.
|
|
458
|
+
</p>
|
|
432
459
|
</div>
|
|
433
460
|
)}
|
|
434
461
|
|
|
435
462
|
{query === '' && filteredItems.length === 0 && (
|
|
436
463
|
<div className="py-14 px-6 text-center text-sm sm:px-14">
|
|
437
|
-
<MagnifyingGlassIcon className="mx-auto h-6 w-6 text-
|
|
438
|
-
<p className="mt-4 font-semibold text-
|
|
439
|
-
<p className="mt-2 text-
|
|
464
|
+
<MagnifyingGlassIcon className="mx-auto h-6 w-6 text-[rgb(var(--ec-icon-color))]" />
|
|
465
|
+
<p className="mt-4 font-semibold text-[rgb(var(--ec-page-text))]">Search for anything</p>
|
|
466
|
+
<p className="mt-2 text-[rgb(var(--ec-page-text-muted))]">
|
|
467
|
+
Search for domains, services, events, commands, queries and more.
|
|
468
|
+
</p>
|
|
440
469
|
</div>
|
|
441
470
|
)}
|
|
442
471
|
|
|
443
472
|
{/* Footer */}
|
|
444
|
-
<div className="flex flex-wrap items-center bg-
|
|
473
|
+
<div className="flex flex-wrap items-center bg-[rgb(var(--ec-content-hover))] py-2.5 px-4 text-xs text-[rgb(var(--ec-page-text-muted))] border-t border-[rgb(var(--ec-page-border))]">
|
|
445
474
|
<div className="flex items-center mr-4">
|
|
446
475
|
<ArrowUturnLeftIcon className="h-3 w-3 mr-1" />
|
|
447
476
|
to select
|
|
@@ -27,7 +27,7 @@ const getBadgeClasses = (badge: string): string => {
|
|
|
27
27
|
service: 'bg-green-100 text-green-700',
|
|
28
28
|
event: 'bg-amber-100 text-amber-700',
|
|
29
29
|
command: 'bg-pink-100 text-pink-700',
|
|
30
|
-
query: 'bg-
|
|
30
|
+
query: 'bg-green-100 text-green-700',
|
|
31
31
|
message: 'bg-indigo-100 text-indigo-700',
|
|
32
32
|
design: 'bg-teal-100 text-teal-700',
|
|
33
33
|
channel: 'bg-indigo-100 text-indigo-700',
|
|
@@ -163,21 +163,21 @@ export default function SearchBar({ nodes, onSelectResult, onSearchChange }: Pro
|
|
|
163
163
|
return (
|
|
164
164
|
<>
|
|
165
165
|
{/* Search Input */}
|
|
166
|
-
<div className="px-3 py-2 bg-
|
|
166
|
+
<div className="px-3 py-2 bg-[rgb(var(--ec-content-bg))] border-b border-[rgb(var(--ec-content-border))]">
|
|
167
167
|
<div className="flex gap-2">
|
|
168
168
|
<div className="relative flex-1">
|
|
169
|
-
<Search className="absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-
|
|
169
|
+
<Search className="absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-[rgb(var(--ec-input-placeholder))]" />
|
|
170
170
|
<input
|
|
171
171
|
type="text"
|
|
172
172
|
placeholder="Search resources..."
|
|
173
173
|
value={searchQuery}
|
|
174
174
|
onChange={(e) => handleSearchChange(e.target.value)}
|
|
175
|
-
className="w-full pl-9 pr-8 py-2 text-sm bg-
|
|
175
|
+
className="w-full pl-9 pr-8 py-2 text-sm bg-[rgb(var(--ec-input-bg))] border border-[rgb(var(--ec-input-border))] rounded-lg focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ec-accent))] focus:border-transparent text-[rgb(var(--ec-input-text))] placeholder:text-[rgb(var(--ec-input-placeholder))]"
|
|
176
176
|
/>
|
|
177
177
|
{searchQuery && (
|
|
178
178
|
<button
|
|
179
179
|
onClick={clearSearch}
|
|
180
|
-
className="absolute right-3 top-1/2 -translate-y-1/2 text-
|
|
180
|
+
className="absolute right-3 top-1/2 -translate-y-1/2 text-[rgb(var(--ec-icon-color))] hover:text-[rgb(var(--ec-icon-hover))]"
|
|
181
181
|
aria-label="Clear search"
|
|
182
182
|
>
|
|
183
183
|
<X className="w-4 h-4" aria-hidden="true" />
|
|
@@ -191,15 +191,15 @@ export default function SearchBar({ nodes, onSelectResult, onSearchChange }: Pro
|
|
|
191
191
|
className={cn(
|
|
192
192
|
'flex items-center justify-center w-10 h-10 rounded-lg border transition-colors',
|
|
193
193
|
searchFilters.size > 0
|
|
194
|
-
? 'bg-
|
|
195
|
-
: 'bg-
|
|
194
|
+
? 'bg-[rgb(var(--ec-accent)/0.1)] border-[rgb(var(--ec-accent)/0.3)] text-[rgb(var(--ec-accent))]'
|
|
195
|
+
: 'bg-[rgb(var(--ec-input-bg))] border-[rgb(var(--ec-input-border))] text-[rgb(var(--ec-icon-color))] hover:text-[rgb(var(--ec-icon-hover))] hover:bg-[rgb(var(--ec-content-hover))]'
|
|
196
196
|
)}
|
|
197
197
|
aria-label="Filter search results"
|
|
198
198
|
aria-expanded={showFilterDropdown}
|
|
199
199
|
>
|
|
200
200
|
<SlidersHorizontal className="w-4 h-4" aria-hidden="true" />
|
|
201
201
|
{searchFilters.size > 0 && (
|
|
202
|
-
<span className="absolute -top-1 -right-1 w-4 h-4 bg-
|
|
202
|
+
<span className="absolute -top-1 -right-1 w-4 h-4 bg-[rgb(var(--ec-accent))] text-white text-[10px] font-bold rounded-full flex items-center justify-center">
|
|
203
203
|
{searchFilters.size}
|
|
204
204
|
</span>
|
|
205
205
|
)}
|
|
@@ -209,9 +209,11 @@ export default function SearchBar({ nodes, onSelectResult, onSearchChange }: Pro
|
|
|
209
209
|
{showFilterDropdown && (
|
|
210
210
|
<>
|
|
211
211
|
<div className="fixed inset-0 z-20" onClick={() => setShowFilterDropdown(false)} />
|
|
212
|
-
<div className="absolute right-0 top-full mt-1 w-48 bg-
|
|
212
|
+
<div className="absolute right-0 top-full mt-1 w-48 bg-[rgb(var(--ec-dropdown-bg))] rounded-lg shadow-lg border border-[rgb(var(--ec-dropdown-border))] z-30">
|
|
213
213
|
<div className="p-2">
|
|
214
|
-
<div className="text-[10px] font-medium text-
|
|
214
|
+
<div className="text-[10px] font-medium text-[rgb(var(--ec-content-text-muted))] uppercase tracking-wide px-2 py-1">
|
|
215
|
+
Filter by type
|
|
216
|
+
</div>
|
|
215
217
|
<div className="flex flex-col gap-0.5 mt-1">
|
|
216
218
|
{filterTypes.map((filter) => {
|
|
217
219
|
const isActive = searchFilters.has(filter.key);
|
|
@@ -222,27 +224,29 @@ export default function SearchBar({ nodes, onSelectResult, onSearchChange }: Pro
|
|
|
222
224
|
onClick={() => toggleSearchFilter(filter.key)}
|
|
223
225
|
className={cn(
|
|
224
226
|
'flex items-center justify-between px-2 py-1.5 rounded text-sm transition-colors',
|
|
225
|
-
isActive
|
|
227
|
+
isActive
|
|
228
|
+
? 'bg-[rgb(var(--ec-accent)/0.1)] text-[rgb(var(--ec-accent))]'
|
|
229
|
+
: 'text-[rgb(var(--ec-dropdown-text))] hover:bg-[rgb(var(--ec-dropdown-hover))]'
|
|
226
230
|
)}
|
|
227
231
|
>
|
|
228
232
|
<span className="flex items-center gap-2">
|
|
229
233
|
<Icon className="w-3 h-3" />
|
|
230
234
|
{filter.label}
|
|
231
235
|
</span>
|
|
232
|
-
{isActive && <span className="text-
|
|
236
|
+
{isActive && <span className="text-[rgb(var(--ec-accent))]">✓</span>}
|
|
233
237
|
</button>
|
|
234
238
|
);
|
|
235
239
|
})}
|
|
236
240
|
</div>
|
|
237
241
|
{searchFilters.size > 0 && (
|
|
238
242
|
<>
|
|
239
|
-
<div className="border-t border-
|
|
243
|
+
<div className="border-t border-[rgb(var(--ec-content-border))] my-2" />
|
|
240
244
|
<button
|
|
241
245
|
onClick={() => {
|
|
242
246
|
setSearchFilters(new Set());
|
|
243
247
|
setShowFilterDropdown(false);
|
|
244
248
|
}}
|
|
245
|
-
className="w-full px-2 py-1.5 text-sm text-
|
|
249
|
+
className="w-full px-2 py-1.5 text-sm text-[rgb(var(--ec-content-text-muted))] hover:text-[rgb(var(--ec-content-text))] hover:bg-[rgb(var(--ec-dropdown-hover))] rounded text-left"
|
|
246
250
|
>
|
|
247
251
|
Reset filters
|
|
248
252
|
</button>
|
|
@@ -258,9 +262,9 @@ export default function SearchBar({ nodes, onSelectResult, onSearchChange }: Pro
|
|
|
258
262
|
|
|
259
263
|
{/* Search Results */}
|
|
260
264
|
{showSearchResults && (
|
|
261
|
-
<div className="flex-1 overflow-y-auto bg-
|
|
265
|
+
<div className="flex-1 overflow-y-auto bg-[rgb(var(--ec-content-bg))] border-b border-[rgb(var(--ec-content-border))]">
|
|
262
266
|
<div className="px-3 py-2">
|
|
263
|
-
<div className="text-[10px] font-medium text-
|
|
267
|
+
<div className="text-[10px] font-medium text-[rgb(var(--ec-content-text-muted))] uppercase tracking-wide mb-2">
|
|
264
268
|
{results.length > 0 ? `${results.length} result${results.length > 1 ? 's' : ''}` : 'No results'}
|
|
265
269
|
</div>
|
|
266
270
|
{results.length > 0 && (
|
|
@@ -269,11 +273,15 @@ export default function SearchBar({ nodes, onSelectResult, onSearchChange }: Pro
|
|
|
269
273
|
<button
|
|
270
274
|
key={nodeKey}
|
|
271
275
|
onClick={() => handleSelectResult(nodeKey, node)}
|
|
272
|
-
className="group flex items-center justify-between w-full px-3 py-2 rounded-lg cursor-pointer text-left transition-colors hover:bg-
|
|
276
|
+
className="group flex items-center justify-between w-full px-3 py-2 rounded-lg cursor-pointer text-left transition-colors hover:bg-[rgb(var(--ec-content-hover))]"
|
|
273
277
|
>
|
|
274
278
|
<div className="flex flex-col min-w-0 flex-1">
|
|
275
|
-
<span className="text-sm text-
|
|
276
|
-
{matchType === 'id' &&
|
|
279
|
+
<span className="text-sm text-[rgb(var(--ec-content-text))] truncate">{node.title}</span>
|
|
280
|
+
{matchType === 'id' && (
|
|
281
|
+
<span className="text-xs text-[rgb(var(--ec-content-text-muted))] truncate">
|
|
282
|
+
ID: {nodeKey.split(':')[2]}
|
|
283
|
+
</span>
|
|
284
|
+
)}
|
|
277
285
|
</div>
|
|
278
286
|
<div className="flex items-center gap-2 flex-shrink-0">
|
|
279
287
|
{node.badge && (
|
|
@@ -287,7 +295,7 @@ export default function SearchBar({ nodes, onSelectResult, onSearchChange }: Pro
|
|
|
287
295
|
</span>
|
|
288
296
|
)}
|
|
289
297
|
{node.pages && node.pages.length > 0 && (
|
|
290
|
-
<ChevronRight className="w-4 h-4 text-
|
|
298
|
+
<ChevronRight className="w-4 h-4 text-[rgb(var(--ec-icon-color))] group-hover:text-[rgb(var(--ec-accent))]" />
|
|
291
299
|
)}
|
|
292
300
|
</div>
|
|
293
301
|
</button>
|
|
@@ -295,7 +303,9 @@ export default function SearchBar({ nodes, onSelectResult, onSearchChange }: Pro
|
|
|
295
303
|
</div>
|
|
296
304
|
)}
|
|
297
305
|
{results.length === 0 && searchQuery.trim() && (
|
|
298
|
-
<div className="text-sm text-
|
|
306
|
+
<div className="text-sm text-[rgb(var(--ec-content-text-muted))] py-4 text-center">
|
|
307
|
+
No resources found for "{searchQuery}"
|
|
308
|
+
</div>
|
|
299
309
|
)}
|
|
300
310
|
</div>
|
|
301
311
|
</div>
|