@datalayer/design 1.0.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/LICENSE +23 -0
- package/README.md +5 -0
- package/lib/App.d.ts +2 -0
- package/lib/App.js +25 -0
- package/lib/DatalayerIcons.d.ts +2 -0
- package/lib/DatalayerIcons.js +169 -0
- package/lib/footer/MinimalFooter.d.ts +38 -0
- package/lib/footer/MinimalFooter.js +160 -0
- package/lib/footer/component-helpers.d.ts +33 -0
- package/lib/footer/component-helpers.js +19 -0
- package/lib/footer/index.d.ts +1 -0
- package/lib/footer/index.js +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/layout/SiteLayout.d.ts +2 -0
- package/lib/layout/SiteLayout.js +89 -0
- package/lib/main.d.ts +1 -0
- package/lib/main.js +10 -0
- package/lib/pages/HomePage.d.ts +2 -0
- package/lib/pages/HomePage.js +50 -0
- package/lib/pages/IconsPage.d.ts +2 -0
- package/lib/pages/IconsPage.js +8 -0
- package/lib/pages/SvgPage.d.ts +2 -0
- package/lib/pages/SvgPage.js +592 -0
- package/lib/svg/SvgAboutHero.d.ts +26 -0
- package/lib/svg/SvgAboutHero.js +76 -0
- package/lib/svg/SvgAgentRuntimes.d.ts +7 -0
- package/lib/svg/SvgAgentRuntimes.js +26 -0
- package/lib/svg/SvgAgentsHero.d.ts +13 -0
- package/lib/svg/SvgAgentsHero.js +55 -0
- package/lib/svg/SvgAgentsHomeHero.d.ts +4 -0
- package/lib/svg/SvgAgentsHomeHero.js +194 -0
- package/lib/svg/SvgBlackSnake.d.ts +5 -0
- package/lib/svg/SvgBlackSnake.js +76 -0
- package/lib/svg/SvgBlogHero.d.ts +7 -0
- package/lib/svg/SvgBlogHero.js +18 -0
- package/lib/svg/SvgCareersHero.d.ts +23 -0
- package/lib/svg/SvgCareersHero.js +97 -0
- package/lib/svg/SvgCellArtifact.d.ts +8 -0
- package/lib/svg/SvgCellArtifact.js +15 -0
- package/lib/svg/SvgChangelogHero.d.ts +23 -0
- package/lib/svg/SvgChangelogHero.js +128 -0
- package/lib/svg/SvgCommunityHero.d.ts +5 -0
- package/lib/svg/SvgCommunityHero.js +170 -0
- package/lib/svg/SvgContactHero.d.ts +11 -0
- package/lib/svg/SvgContactHero.js +19 -0
- package/lib/svg/SvgDataset.d.ts +5 -0
- package/lib/svg/SvgDataset.js +13 -0
- package/lib/svg/SvgDiscord.d.ts +12 -0
- package/lib/svg/SvgDiscord.js +20 -0
- package/lib/svg/SvgDocumentArtifact.d.ts +8 -0
- package/lib/svg/SvgDocumentArtifact.js +15 -0
- package/lib/svg/SvgEarthHero.d.ts +8 -0
- package/lib/svg/SvgEarthHero.js +23 -0
- package/lib/svg/SvgEventsHero.d.ts +16 -0
- package/lib/svg/SvgEventsHero.js +42 -0
- package/lib/svg/SvgFastA2ADonation.d.ts +5 -0
- package/lib/svg/SvgFastA2ADonation.js +13 -0
- package/lib/svg/SvgIndividualsAndTeams.d.ts +11 -0
- package/lib/svg/SvgIndividualsAndTeams.js +26 -0
- package/lib/svg/SvgIntegrationsHero.d.ts +22 -0
- package/lib/svg/SvgIntegrationsHero.js +67 -0
- package/lib/svg/SvgInvites.d.ts +11 -0
- package/lib/svg/SvgInvites.js +19 -0
- package/lib/svg/SvgJoin.d.ts +19 -0
- package/lib/svg/SvgJoin.js +95 -0
- package/lib/svg/SvgJoinConfirm.d.ts +16 -0
- package/lib/svg/SvgJoinConfirm.js +34 -0
- package/lib/svg/SvgJupyterEmbed.d.ts +7 -0
- package/lib/svg/SvgJupyterEmbed.js +15 -0
- package/lib/svg/SvgJupyterMcp.d.ts +16 -0
- package/lib/svg/SvgJupyterMcp.js +27 -0
- package/lib/svg/SvgLines.d.ts +16 -0
- package/lib/svg/SvgLines.js +28 -0
- package/lib/svg/SvgLinesLogo.d.ts +10 -0
- package/lib/svg/SvgLinesLogo.js +59 -0
- package/lib/svg/SvgLoginHero.d.ts +12 -0
- package/lib/svg/SvgLoginHero.js +23 -0
- package/lib/svg/SvgNotFound.d.ts +12 -0
- package/lib/svg/SvgNotFound.js +23 -0
- package/lib/svg/SvgNotebookArtifact.d.ts +8 -0
- package/lib/svg/SvgNotebookArtifact.js +15 -0
- package/lib/svg/SvgOrganizationsAtScale.d.ts +11 -0
- package/lib/svg/SvgOrganizationsAtScale.js +19 -0
- package/lib/svg/SvgPixel1.d.ts +5 -0
- package/lib/svg/SvgPixel1.js +85 -0
- package/lib/svg/SvgPixel2.d.ts +5 -0
- package/lib/svg/SvgPixel2.js +71 -0
- package/lib/svg/SvgPricingHero.d.ts +11 -0
- package/lib/svg/SvgPricingHero.js +19 -0
- package/lib/svg/SvgPrivacyHero.d.ts +11 -0
- package/lib/svg/SvgPrivacyHero.js +22 -0
- package/lib/svg/SvgPublication.d.ts +5 -0
- package/lib/svg/SvgPublication.js +13 -0
- package/lib/svg/SvgRadar.d.ts +8 -0
- package/lib/svg/SvgRadar.js +92 -0
- package/lib/svg/SvgResearchHero.d.ts +17 -0
- package/lib/svg/SvgResearchHero.js +61 -0
- package/lib/svg/SvgSpitfire.d.ts +11 -0
- package/lib/svg/SvgSpitfire.js +79 -0
- package/lib/svg/SvgStarsHero.d.ts +15 -0
- package/lib/svg/SvgStarsHero.js +50 -0
- package/lib/svg/SvgTermsHero.d.ts +11 -0
- package/lib/svg/SvgTermsHero.js +22 -0
- package/lib/svg/SvgTutorialsHero.d.ts +16 -0
- package/lib/svg/SvgTutorialsHero.js +27 -0
- package/lib/svg/SvgUnauthorized.d.ts +12 -0
- package/lib/svg/SvgUnauthorized.js +23 -0
- package/lib/svg/SvgUsecasesHero.d.ts +16 -0
- package/lib/svg/SvgUsecasesHero.js +46 -0
- package/lib/svg/SvgVSCodeExtension.d.ts +7 -0
- package/lib/svg/SvgVSCodeExtension.js +15 -0
- package/lib/svg/gallery.d.ts +2 -0
- package/lib/svg/gallery.js +49 -0
- package/lib/svg/images/datalayer-1.2.0-black-snake.svg +1 -0
- package/lib/svg/images/datalayer-1.3.0-spitfire.svg +1 -0
- package/lib/svg/index.d.ts +45 -0
- package/lib/svg/index.js +50 -0
- package/package.json +50 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Heading, Link, Text } from '@primer/react';
|
|
3
|
+
import { Link as RouterLink } from 'react-router-dom';
|
|
4
|
+
import { SvgAgentsHomeHero } from '../svg';
|
|
5
|
+
export function HomePage() {
|
|
6
|
+
return (_jsxs(Box, { sx: { maxWidth: 1200, mx: 'auto', px: 4, py: 5 }, children: [_jsxs(Box, { sx: {
|
|
7
|
+
position: 'relative',
|
|
8
|
+
border: '1px solid',
|
|
9
|
+
borderColor: 'border.default',
|
|
10
|
+
borderRadius: 2,
|
|
11
|
+
overflow: 'hidden',
|
|
12
|
+
mb: 4,
|
|
13
|
+
bg: 'canvas.subtle',
|
|
14
|
+
}, children: [_jsx(Box, { sx: { position: 'absolute', inset: 0, opacity: 0.9 }, children: _jsx(SvgAgentsHomeHero, {}) }), _jsxs(Box, { sx: {
|
|
15
|
+
position: 'relative',
|
|
16
|
+
p: [4, 5],
|
|
17
|
+
minHeight: [380, 460, 520],
|
|
18
|
+
display: 'flex',
|
|
19
|
+
flexDirection: 'column',
|
|
20
|
+
justifyContent: 'flex-end',
|
|
21
|
+
}, children: [_jsx(Text, { sx: {
|
|
22
|
+
color: 'accent.fg',
|
|
23
|
+
fontSize: 1,
|
|
24
|
+
fontWeight: 600,
|
|
25
|
+
letterSpacing: '0.08em',
|
|
26
|
+
textTransform: 'uppercase',
|
|
27
|
+
mb: 2,
|
|
28
|
+
}, children: "Datalayer Design" }), _jsx(Heading, { as: "h1", sx: {
|
|
29
|
+
fontSize: [5, 6, 7],
|
|
30
|
+
lineHeight: 1.1,
|
|
31
|
+
mb: 3,
|
|
32
|
+
maxWidth: 880,
|
|
33
|
+
}, children: "The visual system behind Datalayer\u2019s AI & data products." }), _jsx(Text, { as: "p", sx: { fontSize: 3, lineHeight: 1.55, maxWidth: 760, color: 'fg.default', mb: 0 }, children: "One brand, one palette, one geometry \u2014 so every notebook, runtime, agent and document feels like part of the same platform." })] })] }), _jsxs(Box, { sx: { display: 'grid', gridTemplateColumns: ['1fr', '1fr', '2fr 1fr'], gap: 4, mb: 4 }, children: [_jsxs(Box, { children: [_jsx(Heading, { as: "h2", sx: { fontSize: 4, mb: 2 }, children: "What Datalayer is building" }), _jsxs(Text, { as: "p", sx: { fontSize: 2, lineHeight: 1.65, color: 'fg.default', mb: 3 }, children: [_jsx(Link, { href: "https://datalayer.ai", target: "_blank", rel: "noopener noreferrer", children: "Datalayer" }), ' ', "is the platform to build, run, and ship custom data products powered by AI. It unifies Jupyter notebooks, cloud-managed runtimes, real-time collaboration, agents, and data assets \u2014 so teams can move from a blank notebook to a production data product without leaving the workspace."] }), _jsx(Text, { as: "p", sx: { fontSize: 2, lineHeight: 1.65, color: 'fg.default', mb: 0 }, children: "Notebooks, lexical documents, cells, datasets and publications are first-class artifacts. Agents and AI runtimes plug into them through open protocols (MCP, A2A, AG-UI) so developers can mix code, content, and intelligence inside a single, governed environment." })] }), _jsxs(Box, { sx: {
|
|
34
|
+
border: '1px solid',
|
|
35
|
+
borderColor: 'border.default',
|
|
36
|
+
borderRadius: 2,
|
|
37
|
+
p: 3,
|
|
38
|
+
bg: 'canvas.subtle',
|
|
39
|
+
display: 'flex',
|
|
40
|
+
flexDirection: 'column',
|
|
41
|
+
gap: 2,
|
|
42
|
+
}, children: [_jsx(Text, { sx: { fontSize: 1, fontWeight: 600, letterSpacing: '0.04em', textTransform: 'uppercase', color: 'fg.muted' }, children: "Pillars" }), _jsx(Text, { sx: { fontSize: 2, color: 'fg.default' }, children: "\u00B7 Notebooks & Documents" }), _jsx(Text, { sx: { fontSize: 2, color: 'fg.default' }, children: "\u00B7 Runtimes & Visualizations" }), _jsx(Text, { sx: { fontSize: 2, color: 'fg.default' }, children: "\u00B7 Agents & AI workflows" }), _jsx(Text, { sx: { fontSize: 2, color: 'fg.default' }, children: "\u00B7 Datasets & Publications" }), _jsx(Text, { sx: { fontSize: 2, color: 'fg.default' }, children: "\u00B7 Spaces, teams & sharing" })] })] }), _jsxs(Box, { sx: {
|
|
43
|
+
border: '1px solid',
|
|
44
|
+
borderColor: 'border.default',
|
|
45
|
+
borderRadius: 2,
|
|
46
|
+
p: [3, 4],
|
|
47
|
+
mb: 4,
|
|
48
|
+
}, children: [_jsx(Heading, { as: "h2", sx: { fontSize: 4, mb: 2 }, children: "A coherent surface for custom data products" }), _jsx(Text, { as: "p", sx: { fontSize: 2, lineHeight: 1.65, color: 'fg.default', mb: 3, maxWidth: 920 }, children: "This design site is the single source of truth for how Datalayer looks and feels. Every illustration, icon, logo variant, and themed surface here is the same asset that ships inside the product, the marketing site, and partner integrations. That consistency is what lets customers assemble custom data products from many moving parts \u2014 runtimes, agents, notebooks, dashboards \u2014 and still feel like they are using one platform." }), _jsxs(Box, { sx: { display: 'grid', gridTemplateColumns: ['1fr', '1fr 1fr', 'repeat(3, 1fr)'], gap: 3 }, children: [_jsxs(Box, { sx: { border: '1px solid', borderColor: 'border.default', borderRadius: 2, p: 3 }, children: [_jsx(Heading, { as: "h3", sx: { fontSize: 2, mb: 2 }, children: "One palette, many themes" }), _jsx(Text, { sx: { color: 'fg.muted', lineHeight: 1.55 }, children: "Every illustration pulls colors from the shared theme palette, so a single switch re-skins the whole experience across light and dark color modes." })] }), _jsxs(Box, { sx: { border: '1px solid', borderColor: 'border.default', borderRadius: 2, p: 3 }, children: [_jsx(Heading, { as: "h3", sx: { fontSize: 2, mb: 2 }, children: "Composable artifacts" }), _jsx(Text, { sx: { color: 'fg.muted', lineHeight: 1.55 }, children: "Logos, hero scenes, feature illustrations, and product artifacts are exported as reusable React SVGs \u2014 usable in landing pages, in-app empty states, and docs." })] }), _jsxs(Box, { sx: { border: '1px solid', borderColor: 'border.default', borderRadius: 2, p: 3 }, children: [_jsx(Heading, { as: "h3", sx: { fontSize: 2, mb: 2 }, children: "Shared design tokens" }), _jsx(Text, { sx: { color: 'fg.muted', lineHeight: 1.55 }, children: "Color, type, and motion tokens are defined once in @datalayer/primer-addons and consumed everywhere \u2014 including the SDKs partners use to embed Datalayer." })] })] }), _jsxs(Box, { sx: { mt: 3, display: 'flex', gap: 3, flexWrap: 'wrap' }, children: [_jsx(Link, { as: RouterLink, to: "/svg", children: "Browse the SVG gallery \u2192" }), _jsx(Link, { as: RouterLink, to: "/icons", children: "Browse icons \u2192" }), _jsx(Link, { href: "https://datalayer.ai", target: "_blank", rel: "noopener noreferrer", children: "Visit datalayer.ai \u2192" })] })] })] }));
|
|
49
|
+
}
|
|
50
|
+
export default HomePage;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Suspense, lazy } from 'react';
|
|
3
|
+
import { Box, Spinner, Text } from '@primer/react';
|
|
4
|
+
const DatalayerIcons = lazy(() => import('../DatalayerIcons'));
|
|
5
|
+
export function IconsPage() {
|
|
6
|
+
return (_jsx(Suspense, { fallback: _jsxs(Box, { sx: { maxWidth: 1200, mx: 'auto', px: 4, py: 6, display: 'flex', alignItems: 'center', gap: 3 }, children: [_jsx(Spinner, { size: "medium" }), _jsx(Text, { sx: { color: 'fg.muted' }, children: "Loading icon catalog..." })] }), children: _jsx(DatalayerIcons, {}) }));
|
|
7
|
+
}
|
|
8
|
+
export default IconsPage;
|
|
@@ -0,0 +1,592 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
3
|
+
import { useNavigate, useParams } from 'react-router-dom';
|
|
4
|
+
import { Box, Button, Heading, Text } from '@primer/react';
|
|
5
|
+
import { AI, DatalayerLogo, DatalayerLogoText, DatalayerTextAI, getLogoColors, useColorPalette, useThemeStore, } from '@datalayer/primer-addons';
|
|
6
|
+
import { DATALAYER_SVG_GALLERY } from '../svg/gallery';
|
|
7
|
+
import * as SvgAssets from '../svg';
|
|
8
|
+
import SpitfireAssetUrl from '../svg/images/datalayer-1.3.0-spitfire.svg';
|
|
9
|
+
import BlackSnakeAssetUrl from '../svg/images/datalayer-1.2.0-black-snake.svg';
|
|
10
|
+
const SEGMENTS = ['Hero', 'Features', 'System', 'Artifacts', 'Pixels', 'Communication', 'Cases', 'Releases', 'Logo'];
|
|
11
|
+
const SEGMENT_BY_SLUG = SEGMENTS.reduce((acc, segment) => {
|
|
12
|
+
acc[segment.toLowerCase()] = segment;
|
|
13
|
+
return acc;
|
|
14
|
+
}, {});
|
|
15
|
+
const slugForSegment = (segment) => segment.toLowerCase();
|
|
16
|
+
const BaseSvgLinesLogo = SvgAssets.SvgLinesLogo;
|
|
17
|
+
function SvgSpitfireInline() {
|
|
18
|
+
const p = useColorPalette();
|
|
19
|
+
const tint = p.isLight ? p.primary : p.spark;
|
|
20
|
+
const [svgMarkup, setSvgMarkup] = useState('');
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
let cancelled = false;
|
|
23
|
+
const loadAndTint = async () => {
|
|
24
|
+
const response = await fetch(SpitfireAssetUrl);
|
|
25
|
+
const source = await response.text();
|
|
26
|
+
if (cancelled) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const parser = new DOMParser();
|
|
30
|
+
const doc = parser.parseFromString(source, 'image/svg+xml');
|
|
31
|
+
const svg = doc.querySelector('svg');
|
|
32
|
+
if (!svg) {
|
|
33
|
+
setSvgMarkup(source);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
svg.setAttribute('width', '100%');
|
|
37
|
+
svg.setAttribute('height', '100%');
|
|
38
|
+
svg.setAttribute('preserveAspectRatio', 'xMidYMid meet');
|
|
39
|
+
svg.setAttribute('style', `width:100%;height:100%;display:block;background:${p.bg};color:${tint};`);
|
|
40
|
+
const blackFills = new Set(['#000', '#000000', 'black', 'rgb(0,0,0)']);
|
|
41
|
+
doc.querySelectorAll('[fill]').forEach((node) => {
|
|
42
|
+
const fill = (node.getAttribute('fill') || '').replace(/\s+/g, '').toLowerCase();
|
|
43
|
+
if (blackFills.has(fill)) {
|
|
44
|
+
node.setAttribute('fill', tint);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
doc.querySelectorAll('[stroke]').forEach((node) => {
|
|
48
|
+
const stroke = (node.getAttribute('stroke') || '').replace(/\s+/g, '').toLowerCase();
|
|
49
|
+
if (blackFills.has(stroke)) {
|
|
50
|
+
node.setAttribute('stroke', tint);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
const serialized = new XMLSerializer().serializeToString(svg);
|
|
54
|
+
setSvgMarkup(serialized);
|
|
55
|
+
};
|
|
56
|
+
loadAndTint().catch(() => setSvgMarkup(''));
|
|
57
|
+
return () => {
|
|
58
|
+
cancelled = true;
|
|
59
|
+
};
|
|
60
|
+
}, [p.bg, tint]);
|
|
61
|
+
return (_jsx(Box, { "aria-label": "Spitfire aircraft", sx: {
|
|
62
|
+
width: '100%',
|
|
63
|
+
height: '100%',
|
|
64
|
+
display: 'block',
|
|
65
|
+
overflow: 'hidden',
|
|
66
|
+
}, dangerouslySetInnerHTML: { __html: svgMarkup } }));
|
|
67
|
+
}
|
|
68
|
+
function SvgBlackSnakeInline() {
|
|
69
|
+
const p = useColorPalette();
|
|
70
|
+
const tint = p.isLight ? p.primary : p.spark;
|
|
71
|
+
const [svgMarkup, setSvgMarkup] = useState('');
|
|
72
|
+
useEffect(() => {
|
|
73
|
+
let cancelled = false;
|
|
74
|
+
const loadAndTint = async () => {
|
|
75
|
+
const response = await fetch(BlackSnakeAssetUrl);
|
|
76
|
+
const source = await response.text();
|
|
77
|
+
if (cancelled) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
const parser = new DOMParser();
|
|
81
|
+
const doc = parser.parseFromString(source, 'image/svg+xml');
|
|
82
|
+
const svg = doc.querySelector('svg');
|
|
83
|
+
if (!svg) {
|
|
84
|
+
setSvgMarkup(source);
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
svg.setAttribute('width', '100%');
|
|
88
|
+
svg.setAttribute('height', '100%');
|
|
89
|
+
svg.setAttribute('preserveAspectRatio', 'xMidYMid meet');
|
|
90
|
+
svg.setAttribute('style', `width:100%;height:100%;display:block;background:${p.bg};color:${tint};`);
|
|
91
|
+
const blackFills = new Set(['#000', '#000000', 'black', 'rgb(0,0,0)']);
|
|
92
|
+
doc.querySelectorAll('[fill]').forEach((node) => {
|
|
93
|
+
const fill = (node.getAttribute('fill') || '').replace(/\s+/g, '').toLowerCase();
|
|
94
|
+
if (blackFills.has(fill)) {
|
|
95
|
+
node.setAttribute('fill', tint);
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
doc.querySelectorAll('[stroke]').forEach((node) => {
|
|
99
|
+
const stroke = (node.getAttribute('stroke') || '').replace(/\s+/g, '').toLowerCase();
|
|
100
|
+
if (blackFills.has(stroke)) {
|
|
101
|
+
node.setAttribute('stroke', tint);
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
const serialized = new XMLSerializer().serializeToString(svg);
|
|
105
|
+
setSvgMarkup(serialized);
|
|
106
|
+
};
|
|
107
|
+
loadAndTint().catch(() => setSvgMarkup(''));
|
|
108
|
+
return () => {
|
|
109
|
+
cancelled = true;
|
|
110
|
+
};
|
|
111
|
+
}, [p.bg, tint]);
|
|
112
|
+
return (_jsx(Box, { "aria-label": "Black snake", sx: {
|
|
113
|
+
width: '100%',
|
|
114
|
+
height: '100%',
|
|
115
|
+
display: 'block',
|
|
116
|
+
overflow: 'hidden',
|
|
117
|
+
}, dangerouslySetInnerHTML: { __html: svgMarkup } }));
|
|
118
|
+
}
|
|
119
|
+
function SvgLinesLogo(props) {
|
|
120
|
+
const { colorMode, theme } = useThemeStore();
|
|
121
|
+
const effectiveColorMode = colorMode === 'auto'
|
|
122
|
+
? (typeof window !== 'undefined' && window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')
|
|
123
|
+
: colorMode;
|
|
124
|
+
const logoColors = getLogoColors(theme, effectiveColorMode);
|
|
125
|
+
const hostStyle = props?.style;
|
|
126
|
+
return (_jsx(Box, { "aria-label": "Lines logo", sx: {
|
|
127
|
+
width: '100%',
|
|
128
|
+
height: '100%',
|
|
129
|
+
minHeight: 120,
|
|
130
|
+
px: 2,
|
|
131
|
+
display: 'flex',
|
|
132
|
+
alignItems: 'center',
|
|
133
|
+
justifyContent: 'center',
|
|
134
|
+
overflow: 'hidden',
|
|
135
|
+
}, style: hostStyle, children: _jsx(BaseSvgLinesLogo, { height: 42, colored: true, primaryColor: logoColors.primary, secondaryColor: logoColors.secondary, textColor: logoColors.textColor }) }));
|
|
136
|
+
}
|
|
137
|
+
function SvgLinesColored(props) {
|
|
138
|
+
const hostStyle = props?.style;
|
|
139
|
+
return (_jsx(Box, { "aria-label": "Colored lines", sx: {
|
|
140
|
+
width: '100%',
|
|
141
|
+
height: '100%',
|
|
142
|
+
minHeight: 120,
|
|
143
|
+
px: 2,
|
|
144
|
+
display: 'flex',
|
|
145
|
+
alignItems: 'center',
|
|
146
|
+
justifyContent: 'center',
|
|
147
|
+
overflow: 'hidden',
|
|
148
|
+
}, style: hostStyle, children: _jsx(SvgAssets.SvgLines, { colored: true, width: "100%", height: 44 }) }));
|
|
149
|
+
}
|
|
150
|
+
function SvgDatalayerLogo(props) {
|
|
151
|
+
const { colorMode, theme } = useThemeStore();
|
|
152
|
+
const effectiveColorMode = colorMode === 'auto'
|
|
153
|
+
? (typeof window !== 'undefined' && window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')
|
|
154
|
+
: colorMode;
|
|
155
|
+
const logoColors = getLogoColors(theme, effectiveColorMode);
|
|
156
|
+
const hostStyle = props?.style;
|
|
157
|
+
return (_jsx(Box, { "aria-label": "Datalayer logo", sx: {
|
|
158
|
+
width: '100%',
|
|
159
|
+
height: '100%',
|
|
160
|
+
minHeight: 120,
|
|
161
|
+
px: 2,
|
|
162
|
+
display: 'flex',
|
|
163
|
+
alignItems: 'center',
|
|
164
|
+
justifyContent: 'center',
|
|
165
|
+
overflow: 'hidden',
|
|
166
|
+
}, style: hostStyle, children: _jsx(DatalayerLogo, { size: 64, variant: theme, colorMode: effectiveColorMode, primaryColor: logoColors.primary, secondaryColor: logoColors.secondary, primaryGradient: logoColors.primaryGradient, secondaryGradient: logoColors.secondaryGradient }) }));
|
|
167
|
+
}
|
|
168
|
+
function SvgDatalayerTextLogo(props) {
|
|
169
|
+
const { colorMode, theme } = useThemeStore();
|
|
170
|
+
const effectiveColorMode = colorMode === 'auto'
|
|
171
|
+
? (typeof window !== 'undefined' && window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')
|
|
172
|
+
: colorMode;
|
|
173
|
+
const logoColors = getLogoColors(theme, effectiveColorMode);
|
|
174
|
+
const hostStyle = props?.style;
|
|
175
|
+
return (_jsx(Box, { "aria-label": "Datalayer text logo", sx: {
|
|
176
|
+
width: '100%',
|
|
177
|
+
height: '100%',
|
|
178
|
+
minHeight: 120,
|
|
179
|
+
px: 2,
|
|
180
|
+
display: 'flex',
|
|
181
|
+
alignItems: 'center',
|
|
182
|
+
justifyContent: 'center',
|
|
183
|
+
overflow: 'hidden',
|
|
184
|
+
}, style: hostStyle, children: _jsx(DatalayerLogoText, { size: 30, variant: theme, colorMode: effectiveColorMode, primaryColor: logoColors.primary, secondaryColor: logoColors.secondary, textColor: logoColors.textColor }) }));
|
|
185
|
+
}
|
|
186
|
+
function SvgDatalayerTextLogoFirst(props) {
|
|
187
|
+
const { colorMode, theme } = useThemeStore();
|
|
188
|
+
const effectiveColorMode = colorMode === 'auto'
|
|
189
|
+
? (typeof window !== 'undefined' && window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')
|
|
190
|
+
: colorMode;
|
|
191
|
+
const logoColors = getLogoColors(theme, effectiveColorMode);
|
|
192
|
+
const hostStyle = props?.style;
|
|
193
|
+
return (_jsx(Box, { "aria-label": "Datalayer text logo first", sx: {
|
|
194
|
+
width: '100%',
|
|
195
|
+
height: '100%',
|
|
196
|
+
minHeight: 120,
|
|
197
|
+
px: 2,
|
|
198
|
+
display: 'flex',
|
|
199
|
+
alignItems: 'center',
|
|
200
|
+
justifyContent: 'center',
|
|
201
|
+
overflow: 'hidden',
|
|
202
|
+
}, style: hostStyle, children: _jsx(DatalayerLogoText, { size: 30, inverse: true, variant: theme, colorMode: effectiveColorMode, primaryColor: logoColors.primary, secondaryColor: logoColors.secondary, textColor: logoColors.textColor }) }));
|
|
203
|
+
}
|
|
204
|
+
function SvgAI(props) {
|
|
205
|
+
const { colorMode, theme } = useThemeStore();
|
|
206
|
+
const effectiveColorMode = colorMode === 'auto'
|
|
207
|
+
? (typeof window !== 'undefined' && window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')
|
|
208
|
+
: colorMode;
|
|
209
|
+
const hostStyle = props?.style;
|
|
210
|
+
return (_jsx(Box, { "aria-label": "AI mark", sx: {
|
|
211
|
+
width: '100%',
|
|
212
|
+
height: '100%',
|
|
213
|
+
minHeight: 120,
|
|
214
|
+
px: 2,
|
|
215
|
+
display: 'flex',
|
|
216
|
+
alignItems: 'center',
|
|
217
|
+
justifyContent: 'center',
|
|
218
|
+
overflow: 'hidden',
|
|
219
|
+
}, style: hostStyle, children: _jsx(AI, { size: 96, variant: theme, colorMode: effectiveColorMode }) }));
|
|
220
|
+
}
|
|
221
|
+
function SvgDatalayerTextAI(props) {
|
|
222
|
+
const { colorMode, theme } = useThemeStore();
|
|
223
|
+
const effectiveColorMode = colorMode === 'auto'
|
|
224
|
+
? (typeof window !== 'undefined' && window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')
|
|
225
|
+
: colorMode;
|
|
226
|
+
const hostStyle = props?.style;
|
|
227
|
+
return (_jsx(Box, { "aria-label": "Datalayer text AI", sx: {
|
|
228
|
+
width: '100%',
|
|
229
|
+
height: '100%',
|
|
230
|
+
minHeight: 120,
|
|
231
|
+
px: 2,
|
|
232
|
+
display: 'flex',
|
|
233
|
+
alignItems: 'center',
|
|
234
|
+
justifyContent: 'center',
|
|
235
|
+
overflow: 'hidden',
|
|
236
|
+
}, style: hostStyle, children: _jsx(DatalayerTextAI, { aiGap: 1, variant: theme, colorMode: effectiveColorMode }) }));
|
|
237
|
+
}
|
|
238
|
+
const SVG_COMPONENT_OVERRIDES = {
|
|
239
|
+
SvgSpitfire: SvgSpitfireInline,
|
|
240
|
+
SvgBlackSnake: SvgBlackSnakeInline,
|
|
241
|
+
SvgLinesLogo,
|
|
242
|
+
SvgDatalayerLogo,
|
|
243
|
+
SvgDatalayerTextLogo,
|
|
244
|
+
SvgDatalayerTextLogoFirst,
|
|
245
|
+
SvgDatalayerTextAI,
|
|
246
|
+
};
|
|
247
|
+
const DATALAYER_SVGS = [
|
|
248
|
+
...DATALAYER_SVG_GALLERY
|
|
249
|
+
.map((name) => {
|
|
250
|
+
const component = SvgAssets[name];
|
|
251
|
+
if (typeof component !== 'function' && !SVG_COMPONENT_OVERRIDES[name]) {
|
|
252
|
+
return null;
|
|
253
|
+
}
|
|
254
|
+
return {
|
|
255
|
+
name,
|
|
256
|
+
Component: SVG_COMPONENT_OVERRIDES[name] || component,
|
|
257
|
+
};
|
|
258
|
+
})
|
|
259
|
+
.filter((entry) => entry !== null),
|
|
260
|
+
{
|
|
261
|
+
name: 'SvgDatalayerLogo',
|
|
262
|
+
Component: SvgDatalayerLogo,
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
name: 'SvgDatalayerTextLogo',
|
|
266
|
+
Component: SvgDatalayerTextLogo,
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
name: 'SvgDatalayerTextLogoFirst',
|
|
270
|
+
Component: SvgDatalayerTextLogoFirst,
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
name: 'SvgDatalayerTextAI',
|
|
274
|
+
Component: SvgDatalayerTextAI,
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
name: 'SvgAI',
|
|
278
|
+
Component: SvgAI,
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
name: 'SvgLinesColored',
|
|
282
|
+
Component: SvgLinesColored,
|
|
283
|
+
},
|
|
284
|
+
];
|
|
285
|
+
const RELEASE_SVG_NAMES = new Set(['SvgSpitfire', 'SvgBlackSnake']);
|
|
286
|
+
const SYSTEM_SVG_NAMES = new Set(['SvgNotFound', 'SvgUnauthorized']);
|
|
287
|
+
const LOGO_SVG_NAMES = new Set([
|
|
288
|
+
'SvgAI',
|
|
289
|
+
'SvgDatalayerLogo',
|
|
290
|
+
'SvgDatalayerTextLogo',
|
|
291
|
+
'SvgDatalayerTextLogoFirst',
|
|
292
|
+
'SvgDatalayerTextAI',
|
|
293
|
+
'SvgLines',
|
|
294
|
+
'SvgLinesColored',
|
|
295
|
+
'SvgLinesLogo',
|
|
296
|
+
]);
|
|
297
|
+
const LOGO_SVG_TRAILING_NAMES = new Set(['SvgLines', 'SvgLinesColored', 'SvgLinesLogo']);
|
|
298
|
+
const LOGO_SVG_TRAILING_ORDER = {
|
|
299
|
+
SvgLines: 0,
|
|
300
|
+
SvgLinesColored: 1,
|
|
301
|
+
SvgLinesLogo: 2,
|
|
302
|
+
};
|
|
303
|
+
const COMMUNICATION_SVG_NAMES = new Set(['SvgFastA2ADonation', 'SvgJupyterMcp', 'SvgDiscord', 'SvgRadar']);
|
|
304
|
+
const CASES_SVG_NAMES = new Set(['SvgEarthHero', 'SvgUsecasesHero']);
|
|
305
|
+
const ARTIFACTS_SVG_NAMES = new Set([
|
|
306
|
+
'SvgNotebookArtifact',
|
|
307
|
+
'SvgDocumentArtifact',
|
|
308
|
+
'SvgCellArtifact',
|
|
309
|
+
'SvgDataset',
|
|
310
|
+
'SvgPublication',
|
|
311
|
+
]);
|
|
312
|
+
const PIXELS_SVG_NAMES = new Set(['SvgPixel1', 'SvgPixel2']);
|
|
313
|
+
const ARTIFACTS_SVG_ORDER = {
|
|
314
|
+
SvgNotebookArtifact: 0,
|
|
315
|
+
SvgDocumentArtifact: 1,
|
|
316
|
+
SvgCellArtifact: 2,
|
|
317
|
+
SvgDataset: 3,
|
|
318
|
+
SvgPublication: 4,
|
|
319
|
+
};
|
|
320
|
+
function isCaseSvg(name) {
|
|
321
|
+
return CASES_SVG_NAMES.has(name);
|
|
322
|
+
}
|
|
323
|
+
function isHeroSvg(name) {
|
|
324
|
+
return name.endsWith('Hero') && !isCaseSvg(name);
|
|
325
|
+
}
|
|
326
|
+
function isReleaseSvg(name) {
|
|
327
|
+
return RELEASE_SVG_NAMES.has(name);
|
|
328
|
+
}
|
|
329
|
+
function isSystemSvg(name) {
|
|
330
|
+
return SYSTEM_SVG_NAMES.has(name);
|
|
331
|
+
}
|
|
332
|
+
function isLogoSvg(name) {
|
|
333
|
+
return LOGO_SVG_NAMES.has(name);
|
|
334
|
+
}
|
|
335
|
+
function isCommunicationSvg(name) {
|
|
336
|
+
return COMMUNICATION_SVG_NAMES.has(name);
|
|
337
|
+
}
|
|
338
|
+
function isArtifactsSvg(name) {
|
|
339
|
+
return ARTIFACTS_SVG_NAMES.has(name);
|
|
340
|
+
}
|
|
341
|
+
function isPixelsSvg(name) {
|
|
342
|
+
return PIXELS_SVG_NAMES.has(name);
|
|
343
|
+
}
|
|
344
|
+
function svgInSegment(entry, segment) {
|
|
345
|
+
if (segment === 'Hero') {
|
|
346
|
+
return isHeroSvg(entry.name);
|
|
347
|
+
}
|
|
348
|
+
if (segment === 'Releases') {
|
|
349
|
+
return isReleaseSvg(entry.name);
|
|
350
|
+
}
|
|
351
|
+
if (segment === 'System') {
|
|
352
|
+
return isSystemSvg(entry.name);
|
|
353
|
+
}
|
|
354
|
+
if (segment === 'Logo') {
|
|
355
|
+
return isLogoSvg(entry.name);
|
|
356
|
+
}
|
|
357
|
+
if (segment === 'Communication') {
|
|
358
|
+
return isCommunicationSvg(entry.name);
|
|
359
|
+
}
|
|
360
|
+
if (segment === 'Artifacts') {
|
|
361
|
+
return isArtifactsSvg(entry.name);
|
|
362
|
+
}
|
|
363
|
+
if (segment === 'Pixels') {
|
|
364
|
+
return isPixelsSvg(entry.name);
|
|
365
|
+
}
|
|
366
|
+
if (segment === 'Cases') {
|
|
367
|
+
return isCaseSvg(entry.name);
|
|
368
|
+
}
|
|
369
|
+
return (!isHeroSvg(entry.name)
|
|
370
|
+
&& !isReleaseSvg(entry.name)
|
|
371
|
+
&& !isSystemSvg(entry.name)
|
|
372
|
+
&& !isLogoSvg(entry.name)
|
|
373
|
+
&& !isCommunicationSvg(entry.name)
|
|
374
|
+
&& !isArtifactsSvg(entry.name)
|
|
375
|
+
&& !isPixelsSvg(entry.name)
|
|
376
|
+
&& !isCaseSvg(entry.name));
|
|
377
|
+
}
|
|
378
|
+
function SegmentControl({ value, onChange, counts, }) {
|
|
379
|
+
const segments = SEGMENTS;
|
|
380
|
+
return (_jsx(Box, { role: "tablist", "aria-label": "SVG segment filter", sx: {
|
|
381
|
+
display: 'inline-flex',
|
|
382
|
+
border: '1px solid',
|
|
383
|
+
borderColor: 'border.default',
|
|
384
|
+
borderRadius: 2,
|
|
385
|
+
overflow: 'hidden',
|
|
386
|
+
bg: 'canvas.default',
|
|
387
|
+
}, children: segments.map((segment, index) => {
|
|
388
|
+
const active = value === segment;
|
|
389
|
+
return (_jsxs(Button, { role: "tab", "aria-selected": active, onClick: () => onChange(segment), sx: {
|
|
390
|
+
border: 'none',
|
|
391
|
+
borderRadius: 0,
|
|
392
|
+
borderLeft: index === 0 ? 'none' : '1px solid',
|
|
393
|
+
borderLeftColor: 'border.default',
|
|
394
|
+
bg: active ? 'accent.subtle' : 'canvas.default',
|
|
395
|
+
color: active ? 'accent.fg' : 'fg.default',
|
|
396
|
+
fontWeight: active ? 600 : 400,
|
|
397
|
+
':hover': {
|
|
398
|
+
bg: active ? 'accent.subtle' : 'canvas.subtle',
|
|
399
|
+
},
|
|
400
|
+
}, children: [segment, " (", counts[segment], ")"] }, segment));
|
|
401
|
+
}) }));
|
|
402
|
+
}
|
|
403
|
+
async function downloadSvgElement(svg, fileName, format) {
|
|
404
|
+
const clone = svg.cloneNode(true);
|
|
405
|
+
const rect = svg.getBoundingClientRect();
|
|
406
|
+
const width = Math.max(1, Math.round(rect.width));
|
|
407
|
+
const height = Math.max(1, Math.round(rect.height));
|
|
408
|
+
clone.setAttribute('width', String(width));
|
|
409
|
+
clone.setAttribute('height', String(height));
|
|
410
|
+
const serializer = new XMLSerializer();
|
|
411
|
+
const markup = serializer.serializeToString(clone);
|
|
412
|
+
if (format === 'svg') {
|
|
413
|
+
const blob = new Blob([markup], { type: 'image/svg+xml;charset=utf-8' });
|
|
414
|
+
const url = URL.createObjectURL(blob);
|
|
415
|
+
const link = document.createElement('a');
|
|
416
|
+
link.href = url;
|
|
417
|
+
link.download = `${fileName}.svg`;
|
|
418
|
+
link.click();
|
|
419
|
+
URL.revokeObjectURL(url);
|
|
420
|
+
return;
|
|
421
|
+
}
|
|
422
|
+
const blob = new Blob([markup], { type: 'image/svg+xml;charset=utf-8' });
|
|
423
|
+
const url = URL.createObjectURL(blob);
|
|
424
|
+
const mimeType = format === 'jpg' ? 'image/jpeg' : 'image/png';
|
|
425
|
+
const extension = format === 'jpg' ? 'jpg' : 'png';
|
|
426
|
+
await new Promise((resolve, reject) => {
|
|
427
|
+
const img = new Image();
|
|
428
|
+
img.onload = () => {
|
|
429
|
+
const canvas = document.createElement('canvas');
|
|
430
|
+
canvas.width = width;
|
|
431
|
+
canvas.height = height;
|
|
432
|
+
const ctx = canvas.getContext('2d');
|
|
433
|
+
if (!ctx) {
|
|
434
|
+
URL.revokeObjectURL(url);
|
|
435
|
+
reject(new Error('Unable to create canvas context'));
|
|
436
|
+
return;
|
|
437
|
+
}
|
|
438
|
+
ctx.clearRect(0, 0, width, height);
|
|
439
|
+
ctx.drawImage(img, 0, 0, width, height);
|
|
440
|
+
canvas.toBlob((output) => {
|
|
441
|
+
URL.revokeObjectURL(url);
|
|
442
|
+
if (!output) {
|
|
443
|
+
reject(new Error(`Unable to export ${format.toUpperCase()}`));
|
|
444
|
+
return;
|
|
445
|
+
}
|
|
446
|
+
const outUrl = URL.createObjectURL(output);
|
|
447
|
+
const link = document.createElement('a');
|
|
448
|
+
link.href = outUrl;
|
|
449
|
+
link.download = `${fileName}.${extension}`;
|
|
450
|
+
link.click();
|
|
451
|
+
URL.revokeObjectURL(outUrl);
|
|
452
|
+
resolve();
|
|
453
|
+
}, mimeType, 0.95);
|
|
454
|
+
};
|
|
455
|
+
img.onerror = () => {
|
|
456
|
+
URL.revokeObjectURL(url);
|
|
457
|
+
reject(new Error('Unable to render SVG image'));
|
|
458
|
+
};
|
|
459
|
+
img.src = url;
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
function SvgCard({ name, Component }) {
|
|
463
|
+
const navigate = useNavigate();
|
|
464
|
+
const ref = useRef(null);
|
|
465
|
+
const openDetail = () => navigate(`/svg/${name}`);
|
|
466
|
+
return (_jsxs(Box, { sx: { border: '1px solid', borderColor: 'border.default', borderRadius: 2, p: 3, bg: 'canvas.default' }, children: [_jsx(Text, { sx: { fontWeight: 600, display: 'block', mb: 2 }, children: name }), _jsx(Box, { ref: ref, role: "button", tabIndex: 0, "aria-label": `Open ${name}`, onClick: openDetail, onKeyDown: (event) => {
|
|
467
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
468
|
+
event.preventDefault();
|
|
469
|
+
openDetail();
|
|
470
|
+
}
|
|
471
|
+
}, sx: {
|
|
472
|
+
p: 2,
|
|
473
|
+
border: '1px dashed',
|
|
474
|
+
borderColor: 'border.default',
|
|
475
|
+
borderRadius: 2,
|
|
476
|
+
minHeight: 160,
|
|
477
|
+
display: 'flex',
|
|
478
|
+
alignItems: 'center',
|
|
479
|
+
justifyContent: 'center',
|
|
480
|
+
mb: 2,
|
|
481
|
+
overflow: 'hidden',
|
|
482
|
+
position: 'relative',
|
|
483
|
+
isolation: 'isolate',
|
|
484
|
+
cursor: 'pointer',
|
|
485
|
+
':hover': {
|
|
486
|
+
borderColor: 'accent.fg',
|
|
487
|
+
bg: 'canvas.subtle',
|
|
488
|
+
},
|
|
489
|
+
':focus-visible': {
|
|
490
|
+
outline: '2px solid',
|
|
491
|
+
outlineColor: 'accent.fg',
|
|
492
|
+
outlineOffset: '2px',
|
|
493
|
+
},
|
|
494
|
+
}, children: _jsx(Component, { style: { width: '100%', height: '100%' } }) }), _jsxs(Box, { sx: { display: 'flex', gap: 2, flexWrap: 'wrap' }, children: [_jsx(Button, { onClick: openDetail, children: "View" }), _jsx(Button, { onClick: async () => {
|
|
495
|
+
const svg = ref.current?.querySelector('svg');
|
|
496
|
+
if (!svg)
|
|
497
|
+
return;
|
|
498
|
+
await downloadSvgElement(svg, name, 'png');
|
|
499
|
+
}, children: "Download PNG" }), _jsx(Button, { onClick: async () => {
|
|
500
|
+
const svg = ref.current?.querySelector('svg');
|
|
501
|
+
if (!svg)
|
|
502
|
+
return;
|
|
503
|
+
await downloadSvgElement(svg, name, 'jpg');
|
|
504
|
+
}, children: "Download JPG" }), _jsx(Button, { onClick: async () => {
|
|
505
|
+
const svg = ref.current?.querySelector('svg');
|
|
506
|
+
if (!svg)
|
|
507
|
+
return;
|
|
508
|
+
await downloadSvgElement(svg, name, 'svg');
|
|
509
|
+
}, children: "Download SVG" })] })] }));
|
|
510
|
+
}
|
|
511
|
+
function SvgDetailPage() {
|
|
512
|
+
const navigate = useNavigate();
|
|
513
|
+
const { name } = useParams();
|
|
514
|
+
const entry = useMemo(() => DATALAYER_SVGS.find((item) => item.name === name), [name]);
|
|
515
|
+
const ref = useRef(null);
|
|
516
|
+
if (!entry) {
|
|
517
|
+
return (_jsx(Box, { sx: { maxWidth: 1200, mx: 'auto', px: 4, py: 5 }, children: _jsx(Text, { children: "SVG not found." }) }));
|
|
518
|
+
}
|
|
519
|
+
const Component = entry.Component;
|
|
520
|
+
return (_jsxs(Box, { sx: { maxWidth: 1200, mx: 'auto', px: 4, py: 5 }, children: [_jsxs(Box, { sx: { display: 'flex', gap: 2, flexWrap: 'wrap' }, children: [_jsx(Button, { onClick: () => navigate('/svg'), children: "Back" }), _jsx(Button, { onClick: async () => {
|
|
521
|
+
const svg = ref.current?.querySelector('svg');
|
|
522
|
+
if (!svg)
|
|
523
|
+
return;
|
|
524
|
+
await downloadSvgElement(svg, entry.name, 'png');
|
|
525
|
+
}, children: "Download PNG" }), _jsx(Button, { onClick: async () => {
|
|
526
|
+
const svg = ref.current?.querySelector('svg');
|
|
527
|
+
if (!svg)
|
|
528
|
+
return;
|
|
529
|
+
await downloadSvgElement(svg, entry.name, 'jpg');
|
|
530
|
+
}, children: "Download JPG" }), _jsx(Button, { onClick: async () => {
|
|
531
|
+
const svg = ref.current?.querySelector('svg');
|
|
532
|
+
if (!svg)
|
|
533
|
+
return;
|
|
534
|
+
await downloadSvgElement(svg, entry.name, 'svg');
|
|
535
|
+
}, children: "Download SVG" })] }), _jsx(Heading, { as: "h2", sx: { mt: 3, mb: 3 }, children: entry.name }), _jsx(Box, { ref: ref, sx: { p: 4, border: '1px solid', borderColor: 'border.default', borderRadius: 2, display: 'flex', justifyContent: 'center', minHeight: 280, overflow: 'hidden', position: 'relative', isolation: 'isolate' }, children: _jsx(Component, { style: { width: '100%', maxWidth: 900 } }) })] }));
|
|
536
|
+
}
|
|
537
|
+
export function SvgPage() {
|
|
538
|
+
const navigate = useNavigate();
|
|
539
|
+
const { name } = useParams();
|
|
540
|
+
const routeSegment = name ? SEGMENT_BY_SLUG[name.toLowerCase()] : undefined;
|
|
541
|
+
const isDetailRoute = !!name && !routeSegment;
|
|
542
|
+
const [segment, setSegmentState] = useState(routeSegment ?? 'Hero');
|
|
543
|
+
useEffect(() => {
|
|
544
|
+
if (routeSegment && routeSegment !== segment) {
|
|
545
|
+
setSegmentState(routeSegment);
|
|
546
|
+
}
|
|
547
|
+
}, [routeSegment, segment]);
|
|
548
|
+
const setSegment = (next) => {
|
|
549
|
+
setSegmentState(next);
|
|
550
|
+
navigate(`/svg/${slugForSegment(next)}`);
|
|
551
|
+
};
|
|
552
|
+
const segmentCounts = useMemo(() => {
|
|
553
|
+
return {
|
|
554
|
+
Hero: DATALAYER_SVGS.filter((entry) => svgInSegment(entry, 'Hero')).length,
|
|
555
|
+
System: DATALAYER_SVGS.filter((entry) => svgInSegment(entry, 'System')).length,
|
|
556
|
+
Features: DATALAYER_SVGS.filter((entry) => svgInSegment(entry, 'Features')).length,
|
|
557
|
+
Artifacts: DATALAYER_SVGS.filter((entry) => svgInSegment(entry, 'Artifacts')).length,
|
|
558
|
+
Pixels: DATALAYER_SVGS.filter((entry) => svgInSegment(entry, 'Pixels')).length,
|
|
559
|
+
Releases: DATALAYER_SVGS.filter((entry) => svgInSegment(entry, 'Releases')).length,
|
|
560
|
+
Logo: DATALAYER_SVGS.filter((entry) => svgInSegment(entry, 'Logo')).length,
|
|
561
|
+
Communication: DATALAYER_SVGS.filter((entry) => svgInSegment(entry, 'Communication')).length,
|
|
562
|
+
Cases: DATALAYER_SVGS.filter((entry) => svgInSegment(entry, 'Cases')).length,
|
|
563
|
+
};
|
|
564
|
+
}, []);
|
|
565
|
+
const filteredSvgs = useMemo(() => {
|
|
566
|
+
const entries = DATALAYER_SVGS.filter((entry) => svgInSegment(entry, segment));
|
|
567
|
+
if (segment === 'Artifacts') {
|
|
568
|
+
return [...entries].sort((a, b) => {
|
|
569
|
+
return (ARTIFACTS_SVG_ORDER[a.name] ?? 99) - (ARTIFACTS_SVG_ORDER[b.name] ?? 99);
|
|
570
|
+
});
|
|
571
|
+
}
|
|
572
|
+
if (segment !== 'Logo') {
|
|
573
|
+
return entries;
|
|
574
|
+
}
|
|
575
|
+
return [...entries].sort((a, b) => {
|
|
576
|
+
const aTrailing = LOGO_SVG_TRAILING_NAMES.has(a.name);
|
|
577
|
+
const bTrailing = LOGO_SVG_TRAILING_NAMES.has(b.name);
|
|
578
|
+
if (aTrailing === bTrailing) {
|
|
579
|
+
if (aTrailing && bTrailing) {
|
|
580
|
+
return (LOGO_SVG_TRAILING_ORDER[a.name] ?? 99) - (LOGO_SVG_TRAILING_ORDER[b.name] ?? 99);
|
|
581
|
+
}
|
|
582
|
+
return 0;
|
|
583
|
+
}
|
|
584
|
+
return aTrailing ? 1 : -1;
|
|
585
|
+
});
|
|
586
|
+
}, [segment]);
|
|
587
|
+
if (isDetailRoute) {
|
|
588
|
+
return _jsx(SvgDetailPage, {});
|
|
589
|
+
}
|
|
590
|
+
return (_jsxs(Box, { sx: { maxWidth: 1200, mx: 'auto', px: 4, py: 5 }, children: [_jsxs(Box, { sx: { border: '1px solid', borderColor: 'border.default', borderRadius: 2, bg: 'canvas.subtle', p: [3, 4], mb: 4 }, children: [_jsx(Heading, { as: "h2", sx: { fontSize: 4, mb: 2 }, children: "SVG Gallery" }), _jsx(Text, { sx: { color: 'fg.muted' }, children: "Gallery generated from local design SVG exports." }), _jsx(Box, { sx: { mt: 3, display: 'flex', alignItems: 'center', gap: 2, flexWrap: 'wrap' }, children: _jsx(SegmentControl, { value: segment, onChange: setSegment, counts: segmentCounts }) })] }), _jsx(Box, { sx: { display: 'grid', gridTemplateColumns: ['1fr', '1fr', '1fr 1fr'], gap: 3 }, children: filteredSvgs.map((entry) => (_jsx(SvgCard, { ...entry }, entry.name))) })] }));
|
|
591
|
+
}
|
|
592
|
+
export default SvgPage;
|