@datalayer/design 1.0.10 → 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/App.js +3 -3
- package/lib/layout/SiteLayout.js +6 -15
- package/lib/pages/HomePage.js +22 -100
- package/lib/pages/IconsPage.js +38 -13
- package/lib/pages/SvgPage.js +60 -192
- package/lib/svg/SvgHorizonHero.d.ts +5 -0
- package/lib/svg/SvgHorizonHero.js +415 -0
- package/lib/svg/SvgKingKong.d.ts +11 -0
- package/lib/svg/SvgKingKong.js +79 -0
- package/lib/svg/SvgKingKong2.d.ts +11 -0
- package/lib/svg/SvgKingKong2.js +79 -0
- package/lib/svg/SvgPoppy1_0.d.ts +15 -0
- package/lib/svg/SvgPoppy1_0.js +82 -0
- package/lib/svg/gallery.d.ts +1 -1
- package/lib/svg/gallery.js +4 -0
- package/lib/svg/images/datalayer-king-kong-2.svg +782 -0
- package/lib/svg/images/datalayer-king-kong.svg +3364 -0
- package/lib/svg/index.d.ts +4 -0
- package/lib/svg/index.js +4 -0
- package/package.json +3 -4
- package/lib/footer/MinimalFooter.d.ts +0 -38
- package/lib/footer/MinimalFooter.js +0 -162
- package/lib/footer/component-helpers.d.ts +0 -33
- package/lib/footer/component-helpers.js +0 -19
- package/lib/footer/index.d.ts +0 -1
- package/lib/footer/index.js +0 -1
package/lib/pages/SvgPage.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
3
3
|
import { useNavigate, useParams } from 'react-router-dom';
|
|
4
|
-
import { ActionList, ActionMenu,
|
|
4
|
+
import { ActionList, ActionMenu, Button, Heading, Text, TextInput } from '@primer/react';
|
|
5
5
|
import { ArrowLeftIcon } from '@primer/octicons-react';
|
|
6
6
|
import GIF from 'gif.js';
|
|
7
7
|
import gifWorkerUrl from 'gif.js/dist/gif.worker.js?url';
|
|
8
|
-
import { DatalayerLogo, DatalayerLogoText, DatalayerTextAI, getLogoColors, useColorPalette, useThemeStore, } from '@datalayer/primer-addons';
|
|
8
|
+
import { Box, Card, DatalayerLogo, DatalayerLogoText, DatalayerTextAI, getLogoColors, useColorPalette, useThemeStore, } from '@datalayer/primer-addons';
|
|
9
9
|
import { DATALAYER_SVG_GALLERY } from '../svg/gallery';
|
|
10
10
|
import { AVATAR_ORB_STATES, SvgAvatarOrb } from '../avatar';
|
|
11
11
|
import DI from '../svg/SvgDI';
|
|
@@ -13,6 +13,8 @@ import { SvgDla as DlaMark } from '../svg/SvgDla';
|
|
|
13
13
|
import * as SvgAssets from '../svg';
|
|
14
14
|
import SpitfireAssetUrl from '../svg/images/datalayer-1.3.0-spitfire.svg';
|
|
15
15
|
import BlackSnakeAssetUrl from '../svg/images/datalayer-1.2.0-black-snake.svg';
|
|
16
|
+
import KingKongAssetUrl from '../svg/images/datalayer-king-kong.svg';
|
|
17
|
+
import KingKong2AssetUrl from '../svg/images/datalayer-king-kong-2.svg';
|
|
16
18
|
const SEGMENTS = ['All', 'Artifacts', 'Avatar', 'Cases', 'Communication', 'Features', 'Heros', 'Logos', 'Partners', 'Pictos', 'Pixels', 'Releases', 'Systems'];
|
|
17
19
|
const SEGMENT_BY_SLUG = SEGMENTS.reduce((acc, segment) => {
|
|
18
20
|
acc[segment.toLowerCase()] = segment;
|
|
@@ -23,15 +25,33 @@ SEGMENT_BY_SLUG.hero = 'Heros';
|
|
|
23
25
|
SEGMENT_BY_SLUG.system = 'Systems';
|
|
24
26
|
SEGMENT_BY_SLUG.partner = 'Partners';
|
|
25
27
|
const slugForSegment = (segment) => segment.toLowerCase();
|
|
28
|
+
/** A name too long for the row of tabs; the tab keeps the full one as its title. */
|
|
29
|
+
const SEGMENT_SHORT_LABELS = { Communication: 'Comms' };
|
|
26
30
|
const BaseSvgLinesLogo = SvgAssets.SvgLinesLogo;
|
|
27
|
-
|
|
31
|
+
/** What holds a logo in the gallery: centred, with room around it. */
|
|
32
|
+
const LOGO_HOST = {
|
|
33
|
+
width: '100%',
|
|
34
|
+
height: '100%',
|
|
35
|
+
minHeight: 120,
|
|
36
|
+
px: 2,
|
|
37
|
+
display: 'flex',
|
|
38
|
+
alignItems: 'center',
|
|
39
|
+
justifyContent: 'center',
|
|
40
|
+
overflow: 'hidden',
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* A release's trace, fetched and tinted from the theme (the Spitfire, the
|
|
44
|
+
* Black Snake, King Kong): its black ink in the palette's primary on a light
|
|
45
|
+
* theme and its spark on a dark one, on the palette's background.
|
|
46
|
+
*/
|
|
47
|
+
function TintedSvgInline({ url, label }) {
|
|
28
48
|
const p = useColorPalette();
|
|
29
49
|
const tint = p.isLight ? p.primary : p.spark;
|
|
30
50
|
const [svgMarkup, setSvgMarkup] = useState('');
|
|
31
51
|
useEffect(() => {
|
|
32
52
|
let cancelled = false;
|
|
33
53
|
const loadAndTint = async () => {
|
|
34
|
-
const response = await fetch(
|
|
54
|
+
const response = await fetch(url);
|
|
35
55
|
const source = await response.text();
|
|
36
56
|
if (cancelled) {
|
|
37
57
|
return;
|
|
@@ -67,64 +87,20 @@ function SvgSpitfireInline() {
|
|
|
67
87
|
return () => {
|
|
68
88
|
cancelled = true;
|
|
69
89
|
};
|
|
70
|
-
}, [p.bg, tint]);
|
|
71
|
-
return (_jsx(Box, { "aria-label": "
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
overflow: 'hidden',
|
|
76
|
-
}, dangerouslySetInnerHTML: { __html: svgMarkup } }));
|
|
90
|
+
}, [url, p.bg, tint]);
|
|
91
|
+
return (_jsx(Box, { "aria-label": label, width: "100%", height: "100%", display: "block", overflow: "hidden", dangerouslySetInnerHTML: { __html: svgMarkup } }));
|
|
92
|
+
}
|
|
93
|
+
function SvgSpitfireInline() {
|
|
94
|
+
return _jsx(TintedSvgInline, { url: SpitfireAssetUrl, label: "Spitfire aircraft" });
|
|
77
95
|
}
|
|
78
96
|
function SvgBlackSnakeInline() {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
const source = await response.text();
|
|
87
|
-
if (cancelled) {
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
const parser = new DOMParser();
|
|
91
|
-
const doc = parser.parseFromString(source, 'image/svg+xml');
|
|
92
|
-
const svg = doc.querySelector('svg');
|
|
93
|
-
if (!svg) {
|
|
94
|
-
setSvgMarkup(source);
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
svg.setAttribute('width', '100%');
|
|
98
|
-
svg.setAttribute('height', '100%');
|
|
99
|
-
svg.setAttribute('preserveAspectRatio', 'xMidYMid meet');
|
|
100
|
-
svg.setAttribute('style', `width:100%;height:100%;display:block;background:${p.bg};color:${tint};`);
|
|
101
|
-
const blackFills = new Set(['#000', '#000000', 'black', 'rgb(0,0,0)']);
|
|
102
|
-
doc.querySelectorAll('[fill]').forEach((node) => {
|
|
103
|
-
const fill = (node.getAttribute('fill') || '').replace(/\s+/g, '').toLowerCase();
|
|
104
|
-
if (blackFills.has(fill)) {
|
|
105
|
-
node.setAttribute('fill', tint);
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
doc.querySelectorAll('[stroke]').forEach((node) => {
|
|
109
|
-
const stroke = (node.getAttribute('stroke') || '').replace(/\s+/g, '').toLowerCase();
|
|
110
|
-
if (blackFills.has(stroke)) {
|
|
111
|
-
node.setAttribute('stroke', tint);
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
const serialized = new XMLSerializer().serializeToString(svg);
|
|
115
|
-
setSvgMarkup(serialized);
|
|
116
|
-
};
|
|
117
|
-
loadAndTint().catch(() => setSvgMarkup(''));
|
|
118
|
-
return () => {
|
|
119
|
-
cancelled = true;
|
|
120
|
-
};
|
|
121
|
-
}, [p.bg, tint]);
|
|
122
|
-
return (_jsx(Box, { "aria-label": "Black snake", sx: {
|
|
123
|
-
width: '100%',
|
|
124
|
-
height: '100%',
|
|
125
|
-
display: 'block',
|
|
126
|
-
overflow: 'hidden',
|
|
127
|
-
}, dangerouslySetInnerHTML: { __html: svgMarkup } }));
|
|
97
|
+
return _jsx(TintedSvgInline, { url: BlackSnakeAssetUrl, label: "Black snake" });
|
|
98
|
+
}
|
|
99
|
+
function SvgKingKongInline() {
|
|
100
|
+
return _jsx(TintedSvgInline, { url: KingKongAssetUrl, label: "King Kong facing a tyrannosaur" });
|
|
101
|
+
}
|
|
102
|
+
function SvgKingKong2Inline() {
|
|
103
|
+
return _jsx(TintedSvgInline, { url: KingKong2AssetUrl, label: "A tyrannosaur facing King Kong" });
|
|
128
104
|
}
|
|
129
105
|
function SvgLinesLogo(props) {
|
|
130
106
|
const { colorMode, theme } = useThemeStore();
|
|
@@ -133,29 +109,11 @@ function SvgLinesLogo(props) {
|
|
|
133
109
|
: colorMode;
|
|
134
110
|
const logoColors = getLogoColors(theme, effectiveColorMode);
|
|
135
111
|
const hostStyle = props?.style;
|
|
136
|
-
return (_jsx(Box, { "aria-label": "Lines logo",
|
|
137
|
-
width: '100%',
|
|
138
|
-
height: '100%',
|
|
139
|
-
minHeight: 120,
|
|
140
|
-
px: 2,
|
|
141
|
-
display: 'flex',
|
|
142
|
-
alignItems: 'center',
|
|
143
|
-
justifyContent: 'center',
|
|
144
|
-
overflow: 'hidden',
|
|
145
|
-
}, style: hostStyle, children: _jsx(BaseSvgLinesLogo, { height: 42, colored: true, primaryColor: logoColors.primary, secondaryColor: logoColors.secondary, textColor: logoColors.textColor }) }));
|
|
112
|
+
return (_jsx(Box, { "aria-label": "Lines logo", ...LOGO_HOST, style: hostStyle, children: _jsx(BaseSvgLinesLogo, { height: 42, colored: true, primaryColor: logoColors.primary, secondaryColor: logoColors.secondary, textColor: logoColors.textColor }) }));
|
|
146
113
|
}
|
|
147
114
|
function SvgLinesColored(props) {
|
|
148
115
|
const hostStyle = props?.style;
|
|
149
|
-
return (_jsx(Box, { "aria-label": "Colored lines",
|
|
150
|
-
width: '100%',
|
|
151
|
-
height: '100%',
|
|
152
|
-
minHeight: 120,
|
|
153
|
-
px: 2,
|
|
154
|
-
display: 'flex',
|
|
155
|
-
alignItems: 'center',
|
|
156
|
-
justifyContent: 'center',
|
|
157
|
-
overflow: 'hidden',
|
|
158
|
-
}, style: hostStyle, children: _jsx(SvgAssets.SvgLines, { colored: true, width: "100%", height: 44 }) }));
|
|
116
|
+
return (_jsx(Box, { "aria-label": "Colored lines", ...LOGO_HOST, style: hostStyle, children: _jsx(SvgAssets.SvgLines, { colored: true, width: "100%", height: 44 }) }));
|
|
159
117
|
}
|
|
160
118
|
function SvgDatalayerLogo(props) {
|
|
161
119
|
const { colorMode, theme } = useThemeStore();
|
|
@@ -164,16 +122,7 @@ function SvgDatalayerLogo(props) {
|
|
|
164
122
|
: colorMode;
|
|
165
123
|
const logoColors = getLogoColors(theme, effectiveColorMode);
|
|
166
124
|
const hostStyle = props?.style;
|
|
167
|
-
return (_jsx(Box, { "aria-label": "Datalayer logo",
|
|
168
|
-
width: '100%',
|
|
169
|
-
height: '100%',
|
|
170
|
-
minHeight: 120,
|
|
171
|
-
px: 2,
|
|
172
|
-
display: 'flex',
|
|
173
|
-
alignItems: 'center',
|
|
174
|
-
justifyContent: 'center',
|
|
175
|
-
overflow: 'hidden',
|
|
176
|
-
}, style: hostStyle, children: _jsx(DatalayerLogo, { size: 64, variant: theme, colorMode: effectiveColorMode, primaryColor: logoColors.primary, secondaryColor: logoColors.secondary, primaryGradient: logoColors.primaryGradient, secondaryGradient: logoColors.secondaryGradient }) }));
|
|
125
|
+
return (_jsx(Box, { "aria-label": "Datalayer logo", ...LOGO_HOST, style: hostStyle, children: _jsx(DatalayerLogo, { size: 64, variant: theme, colorMode: effectiveColorMode, primaryColor: logoColors.primary, secondaryColor: logoColors.secondary, primaryGradient: logoColors.primaryGradient, secondaryGradient: logoColors.secondaryGradient }) }));
|
|
177
126
|
}
|
|
178
127
|
function SvgDatalayerTextLogo(props) {
|
|
179
128
|
const { colorMode, theme } = useThemeStore();
|
|
@@ -182,16 +131,7 @@ function SvgDatalayerTextLogo(props) {
|
|
|
182
131
|
: colorMode;
|
|
183
132
|
const logoColors = getLogoColors(theme, effectiveColorMode);
|
|
184
133
|
const hostStyle = props?.style;
|
|
185
|
-
return (_jsx(Box, { "aria-label": "Datalayer text logo",
|
|
186
|
-
width: '100%',
|
|
187
|
-
height: '100%',
|
|
188
|
-
minHeight: 120,
|
|
189
|
-
px: 2,
|
|
190
|
-
display: 'flex',
|
|
191
|
-
alignItems: 'center',
|
|
192
|
-
justifyContent: 'center',
|
|
193
|
-
overflow: 'hidden',
|
|
194
|
-
}, style: hostStyle, children: _jsx(DatalayerLogoText, { size: 30, variant: theme, colorMode: effectiveColorMode, primaryColor: logoColors.primary, secondaryColor: logoColors.secondary, textColor: logoColors.textColor }) }));
|
|
134
|
+
return (_jsx(Box, { "aria-label": "Datalayer text logo", ...LOGO_HOST, style: hostStyle, children: _jsx(DatalayerLogoText, { size: 30, variant: theme, colorMode: effectiveColorMode, primaryColor: logoColors.primary, secondaryColor: logoColors.secondary, textColor: logoColors.textColor }) }));
|
|
195
135
|
}
|
|
196
136
|
function SvgDatalayerTextLogoFirst(props) {
|
|
197
137
|
const { colorMode, theme } = useThemeStore();
|
|
@@ -200,16 +140,7 @@ function SvgDatalayerTextLogoFirst(props) {
|
|
|
200
140
|
: colorMode;
|
|
201
141
|
const logoColors = getLogoColors(theme, effectiveColorMode);
|
|
202
142
|
const hostStyle = props?.style;
|
|
203
|
-
return (_jsx(Box, { "aria-label": "Datalayer text logo first",
|
|
204
|
-
width: '100%',
|
|
205
|
-
height: '100%',
|
|
206
|
-
minHeight: 120,
|
|
207
|
-
px: 2,
|
|
208
|
-
display: 'flex',
|
|
209
|
-
alignItems: 'center',
|
|
210
|
-
justifyContent: 'center',
|
|
211
|
-
overflow: 'hidden',
|
|
212
|
-
}, style: hostStyle, children: _jsx(DatalayerLogoText, { size: 30, inverse: true, variant: theme, colorMode: effectiveColorMode, primaryColor: logoColors.primary, secondaryColor: logoColors.secondary, textColor: logoColors.textColor }) }));
|
|
143
|
+
return (_jsx(Box, { "aria-label": "Datalayer text logo first", ...LOGO_HOST, style: hostStyle, children: _jsx(DatalayerLogoText, { size: 30, inverse: true, variant: theme, colorMode: effectiveColorMode, primaryColor: logoColors.primary, secondaryColor: logoColors.secondary, textColor: logoColors.textColor }) }));
|
|
213
144
|
}
|
|
214
145
|
function SvgDI(props) {
|
|
215
146
|
const { colorMode, theme } = useThemeStore();
|
|
@@ -217,16 +148,7 @@ function SvgDI(props) {
|
|
|
217
148
|
? (typeof window !== 'undefined' && window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')
|
|
218
149
|
: colorMode;
|
|
219
150
|
const hostStyle = props?.style;
|
|
220
|
-
return (_jsx(Box, { "aria-label": "DI mark",
|
|
221
|
-
width: '100%',
|
|
222
|
-
height: '100%',
|
|
223
|
-
minHeight: 120,
|
|
224
|
-
px: 2,
|
|
225
|
-
display: 'flex',
|
|
226
|
-
alignItems: 'center',
|
|
227
|
-
justifyContent: 'center',
|
|
228
|
-
overflow: 'hidden',
|
|
229
|
-
}, style: hostStyle, children: _jsx(DI, { size: 96, variant: theme, colorMode: effectiveColorMode }) }));
|
|
151
|
+
return (_jsx(Box, { "aria-label": "DI mark", ...LOGO_HOST, style: hostStyle, children: _jsx(DI, { size: 96, variant: theme, colorMode: effectiveColorMode }) }));
|
|
230
152
|
}
|
|
231
153
|
function SvgDla(props) {
|
|
232
154
|
const { colorMode, theme } = useThemeStore();
|
|
@@ -234,16 +156,7 @@ function SvgDla(props) {
|
|
|
234
156
|
? (typeof window !== 'undefined' && window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')
|
|
235
157
|
: colorMode;
|
|
236
158
|
const hostStyle = props?.style;
|
|
237
|
-
return (_jsx(Box, { "aria-label": "Datalayer mark",
|
|
238
|
-
width: '100%',
|
|
239
|
-
height: '100%',
|
|
240
|
-
minHeight: 120,
|
|
241
|
-
px: 2,
|
|
242
|
-
display: 'flex',
|
|
243
|
-
alignItems: 'center',
|
|
244
|
-
justifyContent: 'center',
|
|
245
|
-
overflow: 'hidden',
|
|
246
|
-
}, style: hostStyle, children: _jsx(DlaMark, { size: 96, variant: theme, colorMode: effectiveColorMode }) }));
|
|
159
|
+
return (_jsx(Box, { "aria-label": "Datalayer mark", ...LOGO_HOST, style: hostStyle, children: _jsx(DlaMark, { size: 96, variant: theme, colorMode: effectiveColorMode }) }));
|
|
247
160
|
}
|
|
248
161
|
function SvgDatalayerTextAI(props) {
|
|
249
162
|
const { colorMode, theme } = useThemeStore();
|
|
@@ -251,16 +164,7 @@ function SvgDatalayerTextAI(props) {
|
|
|
251
164
|
? (typeof window !== 'undefined' && window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')
|
|
252
165
|
: colorMode;
|
|
253
166
|
const hostStyle = props?.style;
|
|
254
|
-
return (_jsx(Box, { "aria-label": "Datalayer text AI",
|
|
255
|
-
width: '100%',
|
|
256
|
-
height: '100%',
|
|
257
|
-
minHeight: 120,
|
|
258
|
-
px: 2,
|
|
259
|
-
display: 'flex',
|
|
260
|
-
alignItems: 'center',
|
|
261
|
-
justifyContent: 'center',
|
|
262
|
-
overflow: 'hidden',
|
|
263
|
-
}, style: hostStyle, children: _jsx(DatalayerTextAI, { aiGap: 1, variant: theme, colorMode: effectiveColorMode }) }));
|
|
167
|
+
return (_jsx(Box, { "aria-label": "Datalayer text AI", ...LOGO_HOST, style: hostStyle, children: _jsx(DatalayerTextAI, { aiGap: 1, variant: theme, colorMode: effectiveColorMode }) }));
|
|
264
168
|
}
|
|
265
169
|
function SvgAIMarkPreview({ ariaLabel, Component, props, }) {
|
|
266
170
|
const { colorMode, theme } = useThemeStore();
|
|
@@ -268,16 +172,7 @@ function SvgAIMarkPreview({ ariaLabel, Component, props, }) {
|
|
|
268
172
|
? (typeof window !== 'undefined' && window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')
|
|
269
173
|
: colorMode;
|
|
270
174
|
const hostStyle = props?.style;
|
|
271
|
-
return (_jsx(Box, { "aria-label": ariaLabel,
|
|
272
|
-
width: '100%',
|
|
273
|
-
height: '100%',
|
|
274
|
-
minHeight: 120,
|
|
275
|
-
px: 2,
|
|
276
|
-
display: 'flex',
|
|
277
|
-
alignItems: 'center',
|
|
278
|
-
justifyContent: 'center',
|
|
279
|
-
overflow: 'hidden',
|
|
280
|
-
}, style: hostStyle, children: _jsx(Component, { size: 96, variant: theme, colorMode: effectiveColorMode }) }));
|
|
175
|
+
return (_jsx(Box, { "aria-label": ariaLabel, ...LOGO_HOST, style: hostStyle, children: _jsx(Component, { size: 96, variant: theme, colorMode: effectiveColorMode }) }));
|
|
281
176
|
}
|
|
282
177
|
function SvgAIPreview(props) {
|
|
283
178
|
return _jsx(SvgAIMarkPreview, { ariaLabel: "AI mark", Component: SvgAssets.SvgAI, props: props });
|
|
@@ -296,7 +191,7 @@ function SvgAI3Preview(props) {
|
|
|
296
191
|
function AvatarOrbCard({ tone, title }) {
|
|
297
192
|
const [state, setState] = useState('idle');
|
|
298
193
|
const [replay, setReplay] = useState(0);
|
|
299
|
-
return (_jsxs(Box, {
|
|
194
|
+
return (_jsxs(Box, { width: "100%", display: "flex", flexDirection: "column", alignItems: "center", gap: 2, py: 2, children: [_jsx(Box, { minHeight: 150, display: "flex", alignItems: "center", justifyContent: "center", children: _jsx(SvgAvatarOrb, { size: 120, state: state, tone: tone, title: `${title}, ${state}` }, replay) }), _jsx(Box, { role: "group", "aria-label": "Avatar state", onClick: (event) => event.stopPropagation(), display: "flex", flexWrap: "wrap", gap: 1, justifyContent: "center", children: AVATAR_ORB_STATES.map(one => (_jsx(Button, { size: "small", variant: one === state ? 'primary' : 'default', "aria-pressed": one === state, onClick: () => {
|
|
300
195
|
setState(one);
|
|
301
196
|
setReplay(count => count + 1);
|
|
302
197
|
}, children: one }, one))) })] }));
|
|
@@ -310,6 +205,8 @@ function SvgAvatarOrbThemePreview() {
|
|
|
310
205
|
const SVG_COMPONENT_OVERRIDES = {
|
|
311
206
|
SvgSpitfire: SvgSpitfireInline,
|
|
312
207
|
SvgBlackSnake: SvgBlackSnakeInline,
|
|
208
|
+
SvgKingKong: SvgKingKongInline,
|
|
209
|
+
SvgKingKong2: SvgKingKong2Inline,
|
|
313
210
|
SvgAI: SvgAIPreview,
|
|
314
211
|
SvgAI2: SvgAI2Preview,
|
|
315
212
|
SvgAI3: SvgAI3Preview,
|
|
@@ -382,7 +279,7 @@ const DATALAYER_SVGS = [
|
|
|
382
279
|
Component: SvgAvatarOrbThemePreview,
|
|
383
280
|
},
|
|
384
281
|
];
|
|
385
|
-
const RELEASE_SVG_NAMES = new Set(['SvgSpitfire', 'SvgBlackSnake']);
|
|
282
|
+
const RELEASE_SVG_NAMES = new Set(['SvgSpitfire', 'SvgBlackSnake', 'SvgKingKong', 'SvgKingKong2']);
|
|
386
283
|
const SYSTEM_SVG_NAMES = new Set(['SvgNotFound', 'SvgUnauthorized']);
|
|
387
284
|
const LOGO_SVG_NAMES = new Set([
|
|
388
285
|
'SvgAI',
|
|
@@ -398,7 +295,7 @@ const LOGO_SVG_NAMES = new Set([
|
|
|
398
295
|
'SvgLinesColored',
|
|
399
296
|
'SvgLinesLogo',
|
|
400
297
|
]);
|
|
401
|
-
const COMMUNICATION_SVG_NAMES = new Set(['SvgDiscord', 'SvgFastA2ADonation', 'SvgJupyterMcp', 'SvgJupyterMcp2', 'SvgOSAContributions', 'SvgOg', 'SvgOgStacked', 'SvgRadar']);
|
|
298
|
+
const COMMUNICATION_SVG_NAMES = new Set(['SvgDiscord', 'SvgFastA2ADonation', 'SvgJupyterMcp', 'SvgJupyterMcp2', 'SvgOSAContributions', 'SvgOg', 'SvgOgStacked', 'SvgPoppy1_0', 'SvgRadar']);
|
|
402
299
|
const CASES_SVG_NAMES = new Set(['SvgEarthHero', 'SvgUsecasesHero', 'SvgLightHouse']);
|
|
403
300
|
const ARTIFACTS_SVG_NAMES = new Set([
|
|
404
301
|
'SvgNotebookArtifact',
|
|
@@ -505,16 +402,10 @@ function svgInSegment(entry, segment) {
|
|
|
505
402
|
}
|
|
506
403
|
function SegmentControl({ value, onChange, counts, }) {
|
|
507
404
|
const segments = SEGMENTS;
|
|
508
|
-
return (_jsx(Box, { role: "tablist", "aria-label": "SVG segment filter",
|
|
509
|
-
display: 'inline-flex',
|
|
510
|
-
border: '1px solid',
|
|
511
|
-
borderColor: 'border.default',
|
|
512
|
-
borderRadius: 2,
|
|
513
|
-
overflow: 'hidden',
|
|
514
|
-
bg: 'canvas.default',
|
|
515
|
-
}, children: segments.map((segment, index) => {
|
|
405
|
+
return (_jsx(Box, { role: "tablist", "aria-label": "SVG segment filter", display: "inline-flex", flexWrap: "wrap", maxWidth: "100%", border: "1px solid", borderColor: "border.default", borderRadius: "medium", overflow: "hidden", bg: "canvas.default", children: segments.map((segment, index) => {
|
|
516
406
|
const active = value === segment;
|
|
517
|
-
return (_jsxs(Button, { role: "tab", "aria-selected": active, onClick: () => onChange(segment), sx: {
|
|
407
|
+
return (_jsxs(Button, { role: "tab", size: "small", "aria-selected": active, "aria-label": `${segment}, ${counts[segment]}`, title: segment, onClick: () => onChange(segment), sx: {
|
|
408
|
+
paddingInline: '6px',
|
|
518
409
|
border: 'none',
|
|
519
410
|
borderRadius: 0,
|
|
520
411
|
borderLeft: index === 0 ? 'none' : '1px solid',
|
|
@@ -525,7 +416,7 @@ function SegmentControl({ value, onChange, counts, }) {
|
|
|
525
416
|
':hover': {
|
|
526
417
|
bg: active ? 'accent.subtle' : 'canvas.subtle',
|
|
527
418
|
},
|
|
528
|
-
}, children: [segment, " (", counts[segment]
|
|
419
|
+
}, children: [SEGMENT_SHORT_LABELS[segment] ?? segment, " ", _jsx("span", { style: { opacity: 0.7 }, children: counts[segment] })] }, segment));
|
|
529
420
|
}) }));
|
|
530
421
|
}
|
|
531
422
|
function getSvgExportDimensions(svg) {
|
|
@@ -839,35 +730,12 @@ function SvgCard({ name, Component }) {
|
|
|
839
730
|
const navigate = useNavigate();
|
|
840
731
|
const ref = useRef(null);
|
|
841
732
|
const openDetail = () => navigate(`/svg/${name}`);
|
|
842
|
-
return (_jsxs(
|
|
733
|
+
return (_jsxs(Card, { border: true, p: 3, children: [_jsx(Text, { sx: { fontWeight: 600, display: 'block', mb: 2 }, children: name }), _jsx(Card, { ref: ref, role: "button", tabIndex: 0, "aria-label": `Open ${name}`, onClick: openDetail, onKeyDown: (event) => {
|
|
843
734
|
if (event.key === 'Enter' || event.key === ' ') {
|
|
844
735
|
event.preventDefault();
|
|
845
736
|
openDetail();
|
|
846
737
|
}
|
|
847
|
-
},
|
|
848
|
-
p: 2,
|
|
849
|
-
border: '1px dashed',
|
|
850
|
-
borderColor: 'border.default',
|
|
851
|
-
bg: 'canvas.subtle',
|
|
852
|
-
borderRadius: 2,
|
|
853
|
-
minHeight: 160,
|
|
854
|
-
display: 'flex',
|
|
855
|
-
alignItems: 'center',
|
|
856
|
-
justifyContent: 'center',
|
|
857
|
-
mb: 2,
|
|
858
|
-
overflow: 'hidden',
|
|
859
|
-
position: 'relative',
|
|
860
|
-
isolation: 'isolate',
|
|
861
|
-
cursor: 'pointer',
|
|
862
|
-
':hover': {
|
|
863
|
-
borderColor: 'accent.fg',
|
|
864
|
-
},
|
|
865
|
-
':focus-visible': {
|
|
866
|
-
outline: '2px solid',
|
|
867
|
-
outlineColor: 'accent.fg',
|
|
868
|
-
outlineOffset: '2px',
|
|
869
|
-
},
|
|
870
|
-
}, 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(RasterDownloadMenu, { label: "Download PNG", format: "png", fileName: name, containerRef: ref }), _jsx(RasterDownloadMenu, { label: "Download JPG", format: "jpg", fileName: name, containerRef: ref }), _jsx(GifDownloadMenu, { fileName: name, containerRef: ref }), _jsx(Button, { onClick: async () => {
|
|
738
|
+
}, variant: "subtle", dashed: true, interactive: true, shadow: "none", rounded: "small", p: 2, minHeight: 160, flexDirection: "row", alignItems: "center", justifyContent: "center", mb: 2, overflow: "hidden", position: "relative", isolation: "isolate", children: _jsx(Component, { style: { width: '100%', height: '100%' } }) }), _jsxs(Box, { display: "flex", gap: 2, flexWrap: "wrap", children: [_jsx(Button, { onClick: openDetail, children: "View" }), _jsx(RasterDownloadMenu, { label: "Download PNG", format: "png", fileName: name, containerRef: ref }), _jsx(RasterDownloadMenu, { label: "Download JPG", format: "jpg", fileName: name, containerRef: ref }), _jsx(GifDownloadMenu, { fileName: name, containerRef: ref }), _jsx(Button, { onClick: async () => {
|
|
871
739
|
const svg = ref.current?.querySelector('svg');
|
|
872
740
|
if (!svg)
|
|
873
741
|
return;
|
|
@@ -881,15 +749,15 @@ function SvgDetailPage() {
|
|
|
881
749
|
const entry = useMemo(() => DATALAYER_SVGS.find((item) => item.name === resolvedName), [resolvedName]);
|
|
882
750
|
const ref = useRef(null);
|
|
883
751
|
if (!entry) {
|
|
884
|
-
return (_jsx(Box, {
|
|
752
|
+
return (_jsx(Box, { px: 4, py: 5, children: _jsx(Box, { maxWidth: 1200, mx: "auto", children: _jsx(Text, { children: "SVG not found." }) }) }));
|
|
885
753
|
}
|
|
886
754
|
const Component = entry.Component;
|
|
887
|
-
return (_jsx(Box, {
|
|
755
|
+
return (_jsx(Box, { px: 4, py: 5, children: _jsxs(Box, { maxWidth: 1200, mx: "auto", children: [_jsxs(Box, { display: "flex", gap: 2, flexWrap: "wrap", children: [_jsx(Button, { variant: "invisible", leadingVisual: ArrowLeftIcon, onClick: () => navigate('/svg'), children: "Back" }), _jsx(RasterDownloadMenu, { label: "Download PNG", format: "png", fileName: entry.name, containerRef: ref }), _jsx(RasterDownloadMenu, { label: "Download JPG", format: "jpg", fileName: entry.name, containerRef: ref }), _jsx(GifDownloadMenu, { fileName: entry.name, containerRef: ref }), _jsx(Button, { onClick: async () => {
|
|
888
756
|
const svg = ref.current?.querySelector('svg');
|
|
889
757
|
if (!svg)
|
|
890
758
|
return;
|
|
891
759
|
await downloadSvgElement(svg, entry.name, 'svg');
|
|
892
|
-
}, children: "Download SVG" })] }), _jsx(Heading, { as: "h2", sx: { mt: 3, mb: 3 }, children: entry.name }), _jsx(
|
|
760
|
+
}, children: "Download SVG" })] }), _jsx(Heading, { as: "h2", sx: { mt: 3, mb: 3 }, children: entry.name }), _jsx(Card, { ref: ref, border: true, rounded: "small", p: 4, flexDirection: "row", justifyContent: "center", minHeight: 280, overflow: "hidden", position: "relative", isolation: "isolate", children: _jsx(Component, { style: { width: '100%', maxWidth: 900 } }) })] }) }));
|
|
893
761
|
}
|
|
894
762
|
export function SvgPage() {
|
|
895
763
|
const navigate = useNavigate();
|
|
@@ -942,6 +810,6 @@ export function SvgPage() {
|
|
|
942
810
|
if (isDetailRoute) {
|
|
943
811
|
return _jsx(SvgDetailPage, {});
|
|
944
812
|
}
|
|
945
|
-
return (_jsx(Box, {
|
|
813
|
+
return (_jsx(Box, { px: 4, py: 5, children: _jsxs(Box, { maxWidth: 1200, mx: "auto", children: [_jsxs(Card, { variant: "subtle", border: true, shadow: "none", 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, { mt: 3, maxWidth: 420, children: _jsx(TextInput, { block: true, value: filter, onChange: (event) => setFilter(event.target.value), placeholder: "Filter SVGs by name...", "aria-label": "Filter SVGs by name" }) }), _jsx(Box, { mt: 3, display: "flex", alignItems: "center", gap: 2, flexWrap: "wrap", children: _jsx(SegmentControl, { value: segment, onChange: setSegment, counts: segmentCounts }) })] }), _jsxs(Box, { display: "grid", gridTemplateColumns: ['1fr', '1fr', '1fr 1fr'], gap: 3, children: [filteredSvgs.length === 0 && (_jsx(Card, { variant: "subtle", border: true, shadow: "none", gridColumn: "1 / -1", p: 4, children: _jsx(Text, { sx: { color: 'fg.muted' }, children: "No SVG matches this filter in the current segment." }) })), filteredSvgs.map((entry) => (_jsx(SvgCard, { ...entry }, entry.name)))] })] }) }));
|
|
946
814
|
}
|
|
947
815
|
export default SvgPage;
|