@datalayer/design 1.0.9 → 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/avatar/SvgAvatarOrb.d.ts +25 -8
- package/lib/avatar/SvgAvatarOrb.js +44 -13
- package/lib/avatar/index.d.ts +1 -1
- package/lib/avatar/index.js +1 -1
- 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 +75 -205
- 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/SvgOgStacked.d.ts +26 -0
- package/lib/svg/SvgOgStacked.js +48 -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 +5 -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 +5 -0
- package/lib/svg/index.js +5 -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/App.js
CHANGED
|
@@ -7,7 +7,7 @@ import { HomePage } from './pages/HomePage';
|
|
|
7
7
|
import { IconsPage } from './pages/IconsPage';
|
|
8
8
|
import { SvgPage } from './pages/SvgPage';
|
|
9
9
|
export function App() {
|
|
10
|
-
// Apply default theme/colormode (
|
|
10
|
+
// Apply default theme/colormode (metal + dark) when no persisted
|
|
11
11
|
// value exists in localStorage. The store persists under 'datalayer-theme'.
|
|
12
12
|
useEffect(() => {
|
|
13
13
|
if (typeof window === 'undefined')
|
|
@@ -16,8 +16,8 @@ export function App() {
|
|
|
16
16
|
if (persisted)
|
|
17
17
|
return;
|
|
18
18
|
const { setTheme, setColorMode } = useThemeStore.getState();
|
|
19
|
-
setTheme('
|
|
20
|
-
setColorMode('
|
|
19
|
+
setTheme('metal');
|
|
20
|
+
setColorMode('dark');
|
|
21
21
|
}, []);
|
|
22
22
|
return (_jsx(ThemedProvider, { useStore: useThemeStore, children: _jsx(BrowserRouter, { children: _jsx(Routes, { children: _jsxs(Route, { element: _jsx(SiteLayout, {}), children: [_jsx(Route, { path: "/", element: _jsx(HomePage, {}) }), _jsx(Route, { path: "/icons", element: _jsx(IconsPage, {}) }), _jsx(Route, { path: "/svg", element: _jsx(SvgPage, {}) }), _jsx(Route, { path: "/svg/:name", element: _jsx(SvgPage, {}) }), _jsx(Route, { path: "*", element: _jsx(Navigate, { to: "/", replace: true }) })] }) }) }) }));
|
|
23
23
|
}
|
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
import { type ColorPalette } from '@datalayer/primer-addons';
|
|
2
|
-
/**
|
|
3
|
-
|
|
2
|
+
/**
|
|
3
|
+
* What the avatar is doing: the floating assistant's states, each acted out.
|
|
4
|
+
*
|
|
5
|
+
* - `idle`: resting, its colours swirling slowly.
|
|
6
|
+
* - `greeting`: it has just appeared — a pop, then the idle swirl.
|
|
7
|
+
* - `thinking`: working on an answer — a faster swirl, a ring leaving it.
|
|
8
|
+
* - `working`: running a long task — the fastest swirl, an arc orbiting it.
|
|
9
|
+
* - `waiting`: waiting for the person — a slow, breathing glow around it.
|
|
10
|
+
* - `speaking`: an answer arriving — a gentle pulse, as of a voice.
|
|
11
|
+
* - `paused`: its application paused — still, and greyed.
|
|
12
|
+
* - `goodbye`: being sent away — it shrinks and fades, once.
|
|
13
|
+
*/
|
|
14
|
+
export type AvatarOrbState = 'idle' | 'greeting' | 'thinking' | 'working' | 'waiting' | 'speaking' | 'paused' | 'goodbye';
|
|
15
|
+
/** Every state, in the order a picker shows them. */
|
|
16
|
+
export declare const AVATAR_ORB_STATES: readonly AvatarOrbState[];
|
|
4
17
|
/**
|
|
5
18
|
* Its colours: `iridescent`, the cyan, pink and lavender of an agent's orb
|
|
6
19
|
* (after CopilotKit's, on its Soar page); `theme`, the theme's own bright
|
|
@@ -10,7 +23,7 @@ export type AvatarOrbTone = 'iridescent' | 'theme';
|
|
|
10
23
|
type SvgAvatarOrbProps = {
|
|
11
24
|
/** Its diameter in pixels (it is drawn in a 100-unit box). @default 32 */
|
|
12
25
|
size?: number;
|
|
13
|
-
/**
|
|
26
|
+
/** What it is doing (`AvatarOrbState`). @default 'idle' */
|
|
14
27
|
state?: AvatarOrbState;
|
|
15
28
|
/** @default 'iridescent' */
|
|
16
29
|
tone?: AvatarOrbTone;
|
|
@@ -21,13 +34,17 @@ type SvgAvatarOrbProps = {
|
|
|
21
34
|
};
|
|
22
35
|
/**
|
|
23
36
|
* An agent's avatar: an iridescent sphere whose colours swirl inside it,
|
|
24
|
-
* after the orb CopilotKit shows beside its agents
|
|
25
|
-
*
|
|
26
|
-
* shading (a pale light high on
|
|
37
|
+
* after the orb CopilotKit shows beside its agents, acting out what the agent
|
|
38
|
+
* is doing (`state`). Soft blobs of colour turn about the centre at different
|
|
39
|
+
* speeds, blurred together, under a sphere's shading (a pale light high on
|
|
40
|
+
* the left, a darker edge) and a thin rim.
|
|
27
41
|
*
|
|
28
42
|
* Pure SVG and SMIL, so it animates wherever an image does; ids are scoped
|
|
29
|
-
* with `useId`, so several avatars share a page.
|
|
30
|
-
*
|
|
43
|
+
* with `useId`, so several avatars share a page. The drawing starts again on
|
|
44
|
+
* each change of state, so a state's one-off motion (greeting, goodbye) plays
|
|
45
|
+
* from the moment it begins. A reduced-motion reader sees it still: no
|
|
46
|
+
* animation is drawn at all (a CSS rule cannot stop SMIL), each state keeping
|
|
47
|
+
* its still pose — the ring, the glow, the arc held where they stand.
|
|
31
48
|
*/
|
|
32
49
|
export declare function SvgAvatarOrb({ size, state, tone, palette, title }: SvgAvatarOrbProps): import("react").JSX.Element;
|
|
33
50
|
export default SvgAvatarOrb;
|
|
@@ -1,11 +1,34 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
/*
|
|
3
3
|
* Copyright (c) 2022-2026 Datalayer, Inc.
|
|
4
4
|
*
|
|
5
5
|
* CC BY 4.0 License
|
|
6
6
|
*/
|
|
7
|
-
import { useId, useSyncExternalStore } from 'react';
|
|
7
|
+
import { Fragment, useId, useSyncExternalStore } from 'react';
|
|
8
8
|
import { useColorPalette } from '@datalayer/primer-addons';
|
|
9
|
+
/** Every state, in the order a picker shows them. */
|
|
10
|
+
export const AVATAR_ORB_STATES = [
|
|
11
|
+
'idle',
|
|
12
|
+
'greeting',
|
|
13
|
+
'thinking',
|
|
14
|
+
'working',
|
|
15
|
+
'waiting',
|
|
16
|
+
'speaking',
|
|
17
|
+
'paused',
|
|
18
|
+
'goodbye',
|
|
19
|
+
];
|
|
20
|
+
const IRIDESCENT = { a: '#1fd0ff', b: '#ff4fae', c: '#c4bdff' };
|
|
21
|
+
/* How fast each state swirls: the blobs' durations are idle's, divided by this. */
|
|
22
|
+
const PACE = {
|
|
23
|
+
idle: 1,
|
|
24
|
+
greeting: 1.5,
|
|
25
|
+
thinking: 3,
|
|
26
|
+
working: 5,
|
|
27
|
+
waiting: 0.8,
|
|
28
|
+
speaking: 2,
|
|
29
|
+
paused: 0,
|
|
30
|
+
goodbye: 1.5,
|
|
31
|
+
};
|
|
9
32
|
const REDUCED_MOTION = '(prefers-reduced-motion: reduce)';
|
|
10
33
|
/* Whether the reader asks for reduced motion, followed as it changes. */
|
|
11
34
|
function subscribeReducedMotion(onChange) {
|
|
@@ -18,12 +41,10 @@ function subscribeReducedMotion(onChange) {
|
|
|
18
41
|
function prefersReducedMotion() {
|
|
19
42
|
return typeof window !== 'undefined' && !!window.matchMedia && window.matchMedia(REDUCED_MOTION).matches;
|
|
20
43
|
}
|
|
21
|
-
const IRIDESCENT = { a: '#1fd0ff', b: '#ff4fae', c: '#c4bdff' };
|
|
22
44
|
/*
|
|
23
45
|
* The blobs inside the sphere: each a soft ellipse off the centre, turning
|
|
24
46
|
* about it at its own speed and in its own direction, so the colours flow
|
|
25
|
-
* into one another and never settle into one figure.
|
|
26
|
-
* thinking runs them three times faster.
|
|
47
|
+
* into one another and never settle into one figure.
|
|
27
48
|
*/
|
|
28
49
|
const BLOBS = [
|
|
29
50
|
{ colour: 'c', cx: 50, cy: 50, rx: 46, ry: 46, dur: 0, turn: 1, tilt: 0 },
|
|
@@ -33,24 +54,34 @@ const BLOBS = [
|
|
|
33
54
|
{ colour: 'b', cx: 40, cy: 72, rx: 20, ry: 11, dur: 6, turn: -1, tilt: 20 },
|
|
34
55
|
{ colour: 'a', cx: 70, cy: 64, rx: 18, ry: 10, dur: 8, turn: 1, tilt: -40 },
|
|
35
56
|
];
|
|
57
|
+
/** A scale about the sphere's centre, as SMIL's `values` take it. */
|
|
58
|
+
const scaled = (factors) => factors.map(f => `${50 - 50 * f} ${50 - 50 * f}`).join(';');
|
|
59
|
+
const scales = (factors) => factors.join(';');
|
|
36
60
|
/**
|
|
37
61
|
* An agent's avatar: an iridescent sphere whose colours swirl inside it,
|
|
38
|
-
* after the orb CopilotKit shows beside its agents
|
|
39
|
-
*
|
|
40
|
-
* shading (a pale light high on
|
|
62
|
+
* after the orb CopilotKit shows beside its agents, acting out what the agent
|
|
63
|
+
* is doing (`state`). Soft blobs of colour turn about the centre at different
|
|
64
|
+
* speeds, blurred together, under a sphere's shading (a pale light high on
|
|
65
|
+
* the left, a darker edge) and a thin rim.
|
|
41
66
|
*
|
|
42
67
|
* Pure SVG and SMIL, so it animates wherever an image does; ids are scoped
|
|
43
|
-
* with `useId`, so several avatars share a page.
|
|
44
|
-
*
|
|
68
|
+
* with `useId`, so several avatars share a page. The drawing starts again on
|
|
69
|
+
* each change of state, so a state's one-off motion (greeting, goodbye) plays
|
|
70
|
+
* from the moment it begins. A reduced-motion reader sees it still: no
|
|
71
|
+
* animation is drawn at all (a CSS rule cannot stop SMIL), each state keeping
|
|
72
|
+
* its still pose — the ring, the glow, the arc held where they stand.
|
|
45
73
|
*/
|
|
46
74
|
export function SvgAvatarOrb({ size = 32, state = 'idle', tone = 'iridescent', palette, title }) {
|
|
47
75
|
const current = useColorPalette();
|
|
48
76
|
const p = palette ?? current;
|
|
49
77
|
const id = useId().replace(/[^a-zA-Z0-9_-]/g, '');
|
|
50
|
-
const thinking = state === 'thinking';
|
|
51
78
|
const moving = !useSyncExternalStore(subscribeReducedMotion, prefersReducedMotion, () => false);
|
|
52
|
-
const pace =
|
|
79
|
+
const pace = PACE[state];
|
|
80
|
+
const swirling = moving && pace > 0;
|
|
53
81
|
const colours = tone === 'theme' ? { a: p.spark, b: p.blaze, c: p.surge, white: '#ffffff' } : { ...IRIDESCENT, white: '#ffffff' };
|
|
54
|
-
|
|
82
|
+
const paused = state === 'paused';
|
|
83
|
+
// The whole sphere's own motion: a pop, a pulse, a fade.
|
|
84
|
+
const body = !moving ? null : state === 'greeting' ? (_jsxs(Fragment, { children: [_jsx("animateTransform", { attributeName: "transform", type: "translate", values: scaled([0.4, 1.12, 0.96, 1]), keyTimes: "0;0.5;0.75;1", dur: "0.9s", fill: "freeze" }), _jsx("animateTransform", { attributeName: "transform", type: "scale", additive: "sum", values: scales([0.4, 1.12, 0.96, 1]), keyTimes: "0;0.5;0.75;1", dur: "0.9s", fill: "freeze" })] })) : state === 'speaking' ? (_jsxs(Fragment, { children: [_jsx("animateTransform", { attributeName: "transform", type: "translate", values: scaled([1, 1.05, 0.99, 1.04, 1]), dur: "0.8s", repeatCount: "indefinite" }), _jsx("animateTransform", { attributeName: "transform", type: "scale", additive: "sum", values: scales([1, 1.05, 0.99, 1.04, 1]), dur: "0.8s", repeatCount: "indefinite" })] })) : state === 'goodbye' ? (_jsxs(Fragment, { children: [_jsx("animateTransform", { attributeName: "transform", type: "translate", values: scaled([1, 1.06, 0.3]), keyTimes: "0;0.25;1", dur: "1.1s", fill: "freeze" }), _jsx("animateTransform", { attributeName: "transform", type: "scale", additive: "sum", values: scales([1, 1.06, 0.3]), keyTimes: "0;0.25;1", dur: "1.1s", fill: "freeze" }), _jsx("animate", { attributeName: "opacity", values: "1;1;0", keyTimes: "0;0.25;1", dur: "1.1s", fill: "freeze" })] })) : null;
|
|
85
|
+
return (_jsxs("svg", { width: size, height: size, viewBox: "0 0 100 100", role: title ? 'img' : undefined, "aria-hidden": title ? undefined : true, "aria-label": title, "data-avatar-orb-state": state, style: { overflow: 'visible' }, children: [title ? _jsx("title", { children: title }) : null, _jsxs("defs", { children: [_jsx("clipPath", { id: `${id}-clip`, children: _jsx("circle", { cx: "50", cy: "50", r: "44" }) }), _jsx("filter", { id: `${id}-blend`, x: "-20%", y: "-20%", width: "140%", height: "140%", children: _jsx("feGaussianBlur", { stdDeviation: "4.5" }) }), _jsx("filter", { id: `${id}-paused`, children: _jsx("feColorMatrix", { type: "saturate", values: "0.15" }) }), _jsxs("radialGradient", { id: `${id}-light`, cx: "0.32", cy: "0.28", r: "0.55", children: [_jsx("stop", { offset: "0%", stopColor: "#ffffff", stopOpacity: "0.55" }), _jsx("stop", { offset: "100%", stopColor: "#ffffff", stopOpacity: "0" })] }), _jsxs("radialGradient", { id: `${id}-edge`, cx: "0.5", cy: "0.5", r: "0.5", children: [_jsx("stop", { offset: "72%", stopColor: colours.c, stopOpacity: "0" }), _jsx("stop", { offset: "100%", stopColor: colours.c, stopOpacity: "0.55" })] }), _jsxs("radialGradient", { id: `${id}-glow`, cx: "0.5", cy: "0.5", r: "0.5", children: [_jsx("stop", { offset: "70%", stopColor: colours.a, stopOpacity: "0.5" }), _jsx("stop", { offset: "100%", stopColor: colours.a, stopOpacity: "0" })] })] }), _jsxs("g", { id: id, opacity: paused ? 0.6 : 1, filter: paused ? `url(#${id}-paused)` : undefined, children: [body, state === 'waiting' ? (_jsx("circle", { cx: "50", cy: "50", r: "56", fill: `url(#${id}-glow)`, opacity: moving ? 0.4 : 0.7, children: moving ? _jsx("animate", { attributeName: "opacity", values: "0.25;0.85;0.25", dur: "2.6s", repeatCount: "indefinite" }) : null })) : null, state === 'thinking' ? (_jsx("circle", { cx: "50", cy: "50", r: moving ? 44 : 48, fill: "none", stroke: colours.a, strokeWidth: "3", opacity: moving ? 1 : 0.5, children: moving ? (_jsxs(Fragment, { children: [_jsx("animate", { attributeName: "r", values: "44;52", dur: "1.4s", repeatCount: "indefinite" }), _jsx("animate", { attributeName: "opacity", values: "0.7;0", dur: "1.4s", repeatCount: "indefinite" })] })) : null })) : null, state === 'working' ? (_jsx("circle", { cx: "50", cy: "50", r: "49", fill: "none", stroke: colours.b, strokeWidth: "3.5", strokeLinecap: "round", strokeDasharray: "60 248", children: moving ? (_jsx("animateTransform", { attributeName: "transform", type: "rotate", from: "0 50 50", to: "360 50 50", dur: "1.2s", repeatCount: "indefinite" })) : null })) : null, _jsxs("g", { clipPath: `url(#${id}-clip)`, children: [_jsx("g", { filter: `url(#${id}-blend)`, children: BLOBS.map((blob, index) => (_jsxs("g", { children: [swirling && blob.dur ? (_jsx("animateTransform", { attributeName: "transform", type: "rotate", from: `0 50 50`, to: `${360 * blob.turn} 50 50`, dur: `${blob.dur / pace}s`, repeatCount: "indefinite" })) : null, _jsx("ellipse", { cx: blob.cx, cy: blob.cy, rx: blob.rx, ry: blob.ry, transform: `rotate(${blob.tilt} ${blob.cx} ${blob.cy})`, fill: colours[blob.colour], opacity: blob.colour === 'white' ? 0.85 : 0.95, children: swirling && blob.dur ? (_jsx("animate", { attributeName: "rx", values: `${blob.rx};${blob.rx * 1.25};${blob.rx}`, dur: `${(blob.dur * 0.7 + index) / pace}s`, repeatCount: "indefinite" })) : null })] }, index))) }), _jsx("circle", { cx: "50", cy: "50", r: "44", fill: `url(#${id}-light)` }), _jsx("circle", { cx: "50", cy: "50", r: "44", fill: `url(#${id}-edge)` })] }), _jsx("circle", { cx: "50", cy: "50", r: "43.5", fill: "none", stroke: "#ffffff", strokeOpacity: "0.35", strokeWidth: "1" })] })] }, state));
|
|
55
86
|
}
|
|
56
87
|
export default SvgAvatarOrb;
|
package/lib/avatar/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { SvgAvatarOrb } from './SvgAvatarOrb';
|
|
1
|
+
export { SvgAvatarOrb, AVATAR_ORB_STATES } from './SvgAvatarOrb';
|
|
2
2
|
export type { AvatarOrbState, AvatarOrbTone } from './SvgAvatarOrb';
|
|
3
3
|
export { DATALAYER_AVATAR_GALLERY } from './gallery';
|
|
4
4
|
export type { DatalayerAvatarGalleryName } from './gallery';
|
package/lib/avatar/index.js
CHANGED
package/lib/layout/SiteLayout.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useState } from 'react';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { Link, Text } from '@primer/react';
|
|
4
|
+
import { AppearanceControls, Box, useThemeStore } from '@datalayer/primer-addons';
|
|
5
5
|
import { DatalayerLogoText } from '@datalayer/primer-addons';
|
|
6
6
|
import { Link as RouterLink, Outlet, useLocation, useSearchParams } from 'react-router-dom';
|
|
7
7
|
const NAV_ITEMS = [
|
|
@@ -59,21 +59,12 @@ export function SiteLayout() {
|
|
|
59
59
|
window.removeEventListener('resize', applyLogoSize);
|
|
60
60
|
};
|
|
61
61
|
}, []);
|
|
62
|
-
return (_jsxs(Box, {
|
|
63
|
-
borderBottom: '1px solid',
|
|
64
|
-
borderColor: 'border.default',
|
|
65
|
-
px: 4,
|
|
66
|
-
py: 3,
|
|
67
|
-
position: 'sticky',
|
|
68
|
-
top: 0,
|
|
69
|
-
bg: 'canvas.default',
|
|
70
|
-
zIndex: 10,
|
|
71
|
-
}, children: _jsxs(Box, { sx: { maxWidth: 1200, mx: 'auto', display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 3, flexWrap: 'wrap' }, children: [_jsx(Box, { sx: { display: 'flex', alignItems: 'center', minHeight: 28 }, children: _jsx(Link, { as: RouterLink, to: "/", "aria-label": "Go to home", sx: {
|
|
62
|
+
return (_jsxs(Box, { minHeight: "100vh", display: "flex", flexDirection: "column", bg: "canvas.default", children: [_jsx(Box, { as: "header", borderBottom: "1px solid", borderColor: "border.default", px: 4, py: 3, position: "sticky", top: 0, bg: "canvas.default", backdropFilter: "blur(12px)", zIndex: 10, children: _jsxs(Box, { maxWidth: 1200, mx: "auto", display: "flex", alignItems: "center", justifyContent: "space-between", gap: 3, flexWrap: "wrap", children: [_jsx(Box, { display: "flex", alignItems: "center", minHeight: 28, children: _jsx(Link, { as: RouterLink, to: "/", "aria-label": "Go to home", sx: {
|
|
72
63
|
display: 'inline-flex',
|
|
73
64
|
alignItems: 'center',
|
|
74
65
|
textDecoration: 'none',
|
|
75
66
|
':hover': { textDecoration: 'none' },
|
|
76
|
-
}, children: _jsx(DatalayerLogoText, { size: logoSize, variant: theme, colorMode: colorMode }) }) }), _jsxs(Box, {
|
|
67
|
+
}, children: _jsx(DatalayerLogoText, { size: logoSize, variant: theme, colorMode: colorMode }) }) }), _jsxs(Box, { display: "flex", alignItems: "center", gap: 3, flexWrap: "wrap", children: [_jsx(Box, { as: "nav", display: "flex", gap: 2, children: NAV_ITEMS.map((item) => {
|
|
77
68
|
const active = location.pathname === item.to || (item.to !== '/' && location.pathname.startsWith(item.to));
|
|
78
69
|
return (_jsx(Link, { as: RouterLink, to: item.to, sx: {
|
|
79
70
|
color: active ? 'accent.fg' : 'fg.default',
|
|
@@ -81,9 +72,9 @@ export function SiteLayout() {
|
|
|
81
72
|
fontWeight: active ? 600 : 400,
|
|
82
73
|
px: 2,
|
|
83
74
|
py: 1,
|
|
84
|
-
borderRadius:
|
|
75
|
+
borderRadius: 'var(--theme-radius-control)',
|
|
85
76
|
':hover': { bg: 'canvas.subtle' },
|
|
86
77
|
}, children: item.label }, item.to));
|
|
87
|
-
}) }), _jsx(
|
|
78
|
+
}) }), _jsx(AppearanceControls, { layout: "inline", useStore: useThemeStore })] })] }) }), _jsx(Box, { as: "main", flex: 1, children: _jsx(Outlet, {}) }), _jsx(Box, { as: "footer", borderTop: "1px solid", borderColor: "border.default", px: 4, py: 4, bg: "canvas.subtle", children: _jsxs(Box, { maxWidth: 1200, mx: "auto", display: "flex", justifyContent: "space-between", gap: 3, flexWrap: "wrap", children: [_jsx(Text, { sx: { color: 'fg.muted', fontSize: 1 }, children: "Datalayer Design" }), _jsxs(Box, { display: "flex", gap: 3, children: [_jsx(Link, { href: "https://datalayer.ai", target: "_blank", children: "Datalayer" }), _jsx(Link, { href: "https://datalayer.ai/docs", target: "_blank", children: "Docs" }), _jsx(Link, { href: "https://github.com/datalayer", target: "_blank", children: "GitHub" })] })] }) })] }));
|
|
88
79
|
}
|
|
89
80
|
export default SiteLayout;
|
package/lib/pages/HomePage.js
CHANGED
|
@@ -15,26 +15,23 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
15
15
|
* The furniture is local on purpose. This package is upstream of the
|
|
16
16
|
* applications, so it cannot borrow their landing components; what it shares
|
|
17
17
|
* with them is the language — a monospace label over a short rule, headings
|
|
18
|
-
* set large and tight, hairlines instead of boxes
|
|
18
|
+
* set large and tight, hairlines instead of boxes. The surfaces are
|
|
19
|
+
* primer-addons' `Box` and `Card`, so every colour, corner and shadow on the
|
|
20
|
+
* page is the theme's.
|
|
19
21
|
*
|
|
20
22
|
* @module pages/HomePage
|
|
21
23
|
*/
|
|
22
|
-
import {
|
|
24
|
+
import { Heading, Link, Text } from "@primer/react";
|
|
23
25
|
import { Link as RouterLink } from "react-router-dom";
|
|
24
|
-
import { useColorPalette } from "@datalayer/primer-addons";
|
|
26
|
+
import { Box, Card, useColorPalette } from "@datalayer/primer-addons";
|
|
25
27
|
import { SvgAgentsHomeHero } from "../svg";
|
|
26
28
|
/** The measure everything on the page is set against. */
|
|
27
29
|
const CONTENT_WIDTH = 1200;
|
|
28
|
-
/**
|
|
29
|
-
* The face the small labels are set in. No webfont: the contrast comes from
|
|
30
|
-
* pairing the interface face set large against this one set small and wide.
|
|
31
|
-
*/
|
|
32
|
-
const MONO = 'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace';
|
|
33
30
|
const EASE = "cubic-bezier(0.22, 1, 0.36, 1)";
|
|
34
31
|
/** The small label that names a band, preceded by a rule so it is not a stray line. */
|
|
35
32
|
function Eyebrow({ children }) {
|
|
36
|
-
return (_jsxs(Box, {
|
|
37
|
-
fontFamily:
|
|
33
|
+
return (_jsxs(Box, { display: "flex", alignItems: "center", gap: 2, mb: 3, children: [_jsx(Box, { width: 24, height: "1px", bg: "accent.fg", opacity: 0.5 }), _jsx(Text, { sx: {
|
|
34
|
+
fontFamily: "mono",
|
|
38
35
|
fontSize: "11px",
|
|
39
36
|
fontWeight: "bold",
|
|
40
37
|
textTransform: "uppercase",
|
|
@@ -44,40 +41,7 @@ function Eyebrow({ children }) {
|
|
|
44
41
|
}
|
|
45
42
|
/** A band of the page: the measure, the rhythm, and an optional dividing rule. */
|
|
46
43
|
function Band({ children, divided, }) {
|
|
47
|
-
return (_jsx(Box, {
|
|
48
|
-
maxWidth: CONTENT_WIDTH,
|
|
49
|
-
mx: "auto",
|
|
50
|
-
py: [5, 6],
|
|
51
|
-
...(divided && {
|
|
52
|
-
borderTop: "1px solid",
|
|
53
|
-
borderColor: "border.subtle",
|
|
54
|
-
}),
|
|
55
|
-
}, children: children }));
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* The one card treatment on the page.
|
|
59
|
-
*
|
|
60
|
-
* Cards used to sit inside a bordered panel, which drew a border around a
|
|
61
|
-
* border. The panel is gone; these carry the only frame.
|
|
62
|
-
*/
|
|
63
|
-
function Card({ children, ...props }) {
|
|
64
|
-
return (_jsx(Box, { ...props, sx: {
|
|
65
|
-
position: "relative",
|
|
66
|
-
display: "flex",
|
|
67
|
-
flexDirection: "column",
|
|
68
|
-
p: 4,
|
|
69
|
-
borderRadius: "12px",
|
|
70
|
-
border: "1px solid",
|
|
71
|
-
borderColor: "border.default",
|
|
72
|
-
bg: "canvas.default",
|
|
73
|
-
transition: `border-color 240ms ${EASE}, transform 240ms ${EASE}, box-shadow 240ms ${EASE}`,
|
|
74
|
-
":hover": {
|
|
75
|
-
borderColor: "accent.emphasis",
|
|
76
|
-
transform: "translateY(-3px)",
|
|
77
|
-
boxShadow: "0 1px 2px rgba(0, 0, 0, 0.04), 0 16px 36px -20px rgba(0, 0, 0, 0.28)",
|
|
78
|
-
},
|
|
79
|
-
...props.sx,
|
|
80
|
-
}, children: children }));
|
|
44
|
+
return (_jsx(Box, { maxWidth: CONTENT_WIDTH, mx: "auto", py: [5, 6], ...(divided && { borderTop: "1px solid", borderColor: "border.subtle" }), children: children }));
|
|
81
45
|
}
|
|
82
46
|
/** What the platform is made of, as a list rather than a paragraph of commas. */
|
|
83
47
|
const PILLARS = [
|
|
@@ -87,19 +51,22 @@ const PILLARS = [
|
|
|
87
51
|
"Datasets & Publications",
|
|
88
52
|
"Spaces, teams & sharing",
|
|
89
53
|
];
|
|
90
|
-
/** What this collection guarantees, one claim each. */
|
|
54
|
+
/** What this collection guarantees, one claim each, on a surface of the theme. */
|
|
91
55
|
const PRINCIPLES = [
|
|
92
56
|
{
|
|
93
57
|
title: "One palette, many themes",
|
|
94
58
|
body: "Every illustration takes its colours from the shared theme palette, so one switch re-skins the whole experience across light and dark.",
|
|
59
|
+
surface: "steel",
|
|
95
60
|
},
|
|
96
61
|
{
|
|
97
62
|
title: "Composable artifacts",
|
|
98
63
|
body: "Logos, hero scenes and product illustrations ship as reusable React SVGs — the same file in a landing page, an empty state, or the docs.",
|
|
64
|
+
surface: "sage",
|
|
99
65
|
},
|
|
100
66
|
{
|
|
101
67
|
title: "Shared design tokens",
|
|
102
68
|
body: "Colour, type and motion are defined once in @datalayer/primer-addons and consumed everywhere, including the SDKs partners embed.",
|
|
69
|
+
surface: "mauve",
|
|
103
70
|
},
|
|
104
71
|
];
|
|
105
72
|
/** Where to go from here. */
|
|
@@ -114,31 +81,13 @@ const NEXT = [
|
|
|
114
81
|
];
|
|
115
82
|
export function HomePage() {
|
|
116
83
|
const palette = useColorPalette();
|
|
117
|
-
return (_jsxs(Box, {
|
|
118
|
-
|
|
119
|
-
border: "1px solid",
|
|
120
|
-
borderColor: "border.default",
|
|
121
|
-
borderRadius: "16px",
|
|
122
|
-
overflow: "hidden",
|
|
123
|
-
bg: "canvas.subtle",
|
|
124
|
-
}, children: [_jsx(Box, { sx: { position: "absolute", inset: 0, opacity: 0.9 }, children: _jsx(SvgAgentsHomeHero, {}) }), _jsx(Box, { sx: {
|
|
125
|
-
position: "absolute",
|
|
126
|
-
inset: 0,
|
|
127
|
-
background: `linear-gradient(to top, ${palette.bg} 6%, ${palette.bg}D9 34%, ${palette.bg}00 78%)`,
|
|
128
|
-
} }), _jsxs(Box, { sx: {
|
|
129
|
-
position: "relative",
|
|
130
|
-
p: [4, 5],
|
|
131
|
-
minHeight: [380, 460, 520],
|
|
132
|
-
display: "flex",
|
|
133
|
-
flexDirection: "column",
|
|
134
|
-
justifyContent: "flex-end",
|
|
135
|
-
}, children: [_jsx(Text, { sx: {
|
|
136
|
-
fontFamily: MONO,
|
|
84
|
+
return (_jsxs(Box, { px: [3, 4], py: [4, 5], children: [_jsx(Box, { maxWidth: CONTENT_WIDTH, mx: "auto", children: _jsxs(Card, { variant: "subtle", border: true, shadow: "none", position: "relative", overflow: "hidden", children: [_jsx(Box, { position: "absolute", inset: 0, opacity: 0.9, children: _jsx(SvgAgentsHomeHero, {}) }), _jsx(Box, { position: "absolute", inset: 0, background: `linear-gradient(to top, ${palette.bg} 6%, ${palette.bg}D9 34%, ${palette.bg}00 78%)` }), _jsxs(Box, { position: "relative", p: [4, 5], minHeight: [380, 460, 520], display: "flex", flexDirection: "column", justifyContent: "flex-end", children: [_jsx(Text, { sx: {
|
|
85
|
+
fontFamily: "mono",
|
|
137
86
|
fontSize: "11px",
|
|
138
87
|
fontWeight: "bold",
|
|
139
88
|
letterSpacing: "0.16em",
|
|
140
89
|
textTransform: "uppercase",
|
|
141
|
-
color:
|
|
90
|
+
color: "accent.fg",
|
|
142
91
|
mb: 3,
|
|
143
92
|
}, children: "Datalayer Design" }), _jsxs(Text, { as: "h1", sx: {
|
|
144
93
|
fontSize: [5, 6, 7],
|
|
@@ -146,20 +95,14 @@ export function HomePage() {
|
|
|
146
95
|
letterSpacing: "-0.03em",
|
|
147
96
|
mb: 3,
|
|
148
97
|
maxWidth: 880,
|
|
149
|
-
color:
|
|
98
|
+
color: "fg.default",
|
|
150
99
|
}, children: ["The visual system behind", _jsx("br", {}), "Datalayer\u2019s AI & data products"] }), _jsx(Text, { as: "p", sx: {
|
|
151
100
|
fontSize: 3,
|
|
152
101
|
lineHeight: 1.55,
|
|
153
102
|
maxWidth: 720,
|
|
154
|
-
color:
|
|
155
|
-
opacity: 0.82,
|
|
103
|
+
color: "fg.muted",
|
|
156
104
|
mb: 0,
|
|
157
|
-
}, children: "One brand, one palette, one geometry \u2014 so every notebook, runtime, agent and document feels like part of the same platform." })] })] }) }), _jsx(Band, { children: _jsxs(Box, { sx: {
|
|
158
|
-
display: "grid",
|
|
159
|
-
gridTemplateColumns: ["1fr", "1fr", "1.6fr 1fr"],
|
|
160
|
-
gap: [4, 5, 6],
|
|
161
|
-
alignItems: "start",
|
|
162
|
-
}, children: [_jsxs(Box, { children: [_jsx(Eyebrow, { children: "The platform" }), _jsx(Heading, { as: "h2", sx: {
|
|
105
|
+
}, children: "One brand, one palette, one geometry \u2014 so every notebook, runtime, agent and document feels like part of the same platform." })] })] }) }), _jsx(Band, { children: _jsxs(Box, { display: "grid", gridTemplateColumns: ["1fr", "1fr", "1.6fr 1fr"], gap: [4, 5, 6], alignItems: "start", children: [_jsxs(Box, { children: [_jsx(Eyebrow, { children: "The platform" }), _jsx(Heading, { as: "h2", sx: {
|
|
163
106
|
fontSize: [4, 5],
|
|
164
107
|
lineHeight: 1.15,
|
|
165
108
|
letterSpacing: "-0.02em",
|
|
@@ -173,36 +116,19 @@ export function HomePage() {
|
|
|
173
116
|
maxWidth: 620,
|
|
174
117
|
}, children: "Notebooks, documents, cells, datasets and publications are first-class artifacts. Agents reach them through open protocols \u2014 MCP, A2A, AG-UI \u2014 so code, content and intelligence sit in one governed environment." })] }), _jsxs(Box, { children: [_jsx(Text, { sx: {
|
|
175
118
|
display: "block",
|
|
176
|
-
fontFamily:
|
|
119
|
+
fontFamily: "mono",
|
|
177
120
|
fontSize: "11px",
|
|
178
121
|
fontWeight: "bold",
|
|
179
122
|
letterSpacing: "0.16em",
|
|
180
123
|
textTransform: "uppercase",
|
|
181
124
|
color: "fg.muted",
|
|
182
125
|
mb: 2,
|
|
183
|
-
}, children: "Pillars" }), _jsx(Box, { as: "ul",
|
|
184
|
-
py: 3,
|
|
185
|
-
borderTop: "1px solid",
|
|
186
|
-
borderColor: "border.subtle",
|
|
187
|
-
fontSize: 2,
|
|
188
|
-
}, children: pillar }, pillar))) })] })] }) }), _jsxs(Band, { divided: true, children: [_jsxs(Box, { sx: { maxWidth: 780, mb: [4, 5] }, children: [_jsx(Eyebrow, { children: "Why this site exists" }), _jsx(Heading, { as: "h2", sx: {
|
|
126
|
+
}, children: "Pillars" }), _jsx(Box, { as: "ul", listStyle: "none", p: 0, m: 0, children: PILLARS.map((pillar) => (_jsx(Box, { as: "li", py: 3, borderTop: "1px solid", borderColor: "border.subtle", fontSize: 2, children: pillar }, pillar))) })] })] }) }), _jsxs(Band, { divided: true, children: [_jsxs(Box, { maxWidth: 780, mb: [4, 5], children: [_jsx(Eyebrow, { children: "Why this site exists" }), _jsx(Heading, { as: "h2", sx: {
|
|
189
127
|
fontSize: [4, 5],
|
|
190
128
|
lineHeight: 1.15,
|
|
191
129
|
letterSpacing: "-0.02em",
|
|
192
130
|
mb: 3,
|
|
193
|
-
}, children: "One system, every surface" }), _jsx(Text, { as: "p", sx: { fontSize: 2, lineHeight: 1.7, mt: 0, mb: 0 }, children: "Every illustration, icon, logo and themed surface here is the same asset that ships inside the product, the marketing site and partner integrations. That is what lets a customer assemble a data product out of many moving parts and still feel they are using one platform." })] }), _jsx(Box, { sx: {
|
|
194
|
-
display: "grid",
|
|
195
|
-
gridTemplateColumns: [
|
|
196
|
-
"1fr",
|
|
197
|
-
"1fr 1fr",
|
|
198
|
-
"repeat(3, minmax(0, 1fr))",
|
|
199
|
-
],
|
|
200
|
-
gap: [3, 4],
|
|
201
|
-
}, children: PRINCIPLES.map((principle) => (_jsxs(Card, { children: [_jsx(Text, { as: "h3", sx: { fontSize: 3, mb: 2 }, children: principle.title }), _jsx(Text, { sx: { color: "fg.muted", lineHeight: 1.65, fontSize: 1 }, children: principle.body })] }, principle.title))) })] }), _jsxs(Band, { divided: true, children: [_jsx(Eyebrow, { children: "Start here" }), _jsx(Box, { sx: {
|
|
202
|
-
display: "grid",
|
|
203
|
-
gridTemplateColumns: ["1fr", "1fr", "repeat(3, minmax(0, 1fr))"],
|
|
204
|
-
gap: [3, 4],
|
|
205
|
-
}, children: NEXT.map((item) => {
|
|
131
|
+
}, children: "One system, every surface" }), _jsx(Text, { as: "p", sx: { fontSize: 2, lineHeight: 1.7, mt: 0, mb: 0 }, children: "Every illustration, icon, logo and themed surface here is the same asset that ships inside the product, the marketing site and partner integrations. That is what lets a customer assemble a data product out of many moving parts and still feel they are using one platform." })] }), _jsx(Box, { display: "grid", gridTemplateColumns: ["1fr", "1fr 1fr", "repeat(3, minmax(0, 1fr))"], gap: [3, 4], children: PRINCIPLES.map((principle) => (_jsxs(Card, { surface: principle.surface, p: 4, children: [_jsx(Text, { as: "h3", sx: { fontSize: 3, mb: 2 }, children: principle.title }), _jsx(Text, { sx: { color: "fg.muted", lineHeight: 1.65, fontSize: 1 }, children: principle.body })] }, principle.title))) })] }), _jsxs(Band, { divided: true, children: [_jsx(Eyebrow, { children: "Start here" }), _jsx(Box, { display: "grid", gridTemplateColumns: ["1fr", "1fr", "repeat(3, minmax(0, 1fr))"], gap: [3, 4], children: NEXT.map((item) => {
|
|
206
132
|
const linkProps = item.to
|
|
207
133
|
? { as: RouterLink, to: item.to }
|
|
208
134
|
: {
|
|
@@ -211,11 +137,7 @@ export function HomePage() {
|
|
|
211
137
|
target: "_blank",
|
|
212
138
|
rel: "noopener noreferrer",
|
|
213
139
|
};
|
|
214
|
-
return (_jsxs(Card, { ...linkProps, sx: {
|
|
215
|
-
textDecoration: "none",
|
|
216
|
-
color: "fg.default",
|
|
217
|
-
":hover .dla-go": { transform: "translateX(4px)" },
|
|
218
|
-
}, children: [_jsx(Text, { as: "h3", sx: { fontSize: 3, mb: 1 }, children: item.label }), _jsx(Text, { sx: { color: "fg.muted", fontSize: 1, mb: 3 }, children: item.desc }), _jsx(Text, { className: "dla-go", sx: {
|
|
140
|
+
return (_jsxs(Card, { ...linkProps, interactive: true, hoverEffect: "lift", p: 4, textDecoration: "none", hover: { textDecoration: "none" }, sx: { "&:hover .dla-go": { transform: "translateX(4px)" } }, children: [_jsx(Text, { as: "h3", sx: { fontSize: 3, mb: 1 }, children: item.label }), _jsx(Text, { sx: { color: "fg.muted", fontSize: 1, mb: 3 }, children: item.desc }), _jsx(Text, { className: "dla-go", sx: {
|
|
219
141
|
mt: "auto",
|
|
220
142
|
color: "accent.fg",
|
|
221
143
|
fontWeight: "bold",
|
package/lib/pages/IconsPage.js
CHANGED
|
@@ -1,16 +1,41 @@
|
|
|
1
|
-
import { jsx as _jsx,
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2023-2026 Datalayer, Inc.
|
|
4
|
+
* Distributed under the terms of the Modified BSD License.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* The icon catalogue of datalayer.design: every icon of `@datalayer/icons-react`
|
|
8
|
+
* (published on npm), searchable by name. It read `@datalayer/icons-all` until
|
|
9
|
+
* 20 November 2026; that package is never published, and design is.
|
|
10
|
+
*/
|
|
11
|
+
import { Suspense, lazy, useMemo, useState } from "react";
|
|
12
|
+
import { Spinner, Text, TextInput } from "@primer/react";
|
|
13
|
+
import { SearchIcon } from "@primer/octicons-react";
|
|
14
|
+
import { Box } from "@datalayer/primer-addons";
|
|
15
|
+
const IconGrid = lazy(() => import("@datalayer/icons-react").then((module) => {
|
|
16
|
+
const icons = Object.entries(module)
|
|
17
|
+
.filter(([name, value]) => name.endsWith("Icon") && typeof value === "function")
|
|
18
|
+
.map(([name, value]) => [name, value])
|
|
19
|
+
.sort(([a], [b]) => a.localeCompare(b));
|
|
20
|
+
function Grid({ query }) {
|
|
21
|
+
const shown = useMemo(() => {
|
|
22
|
+
const q = query.trim().toLowerCase();
|
|
23
|
+
return q ? icons.filter(([name]) => name.toLowerCase().includes(q)) : icons;
|
|
24
|
+
}, [query]);
|
|
25
|
+
return (_jsxs(_Fragment, { children: [_jsxs(Text, { as: "p", sx: { color: "fg.muted", fontSize: 1, m: 0 }, children: [shown.length, " of ", icons.length, " icons"] }), _jsx(Box, { as: "ul", display: "grid", gridTemplateColumns: "repeat(auto-fill, minmax(136px, 1fr))", gap: 2, p: 0, m: 0, style: { listStyle: "none" }, children: shown.map(([name, Icon]) => (_jsxs(Box, { as: "li", display: "flex", flexDirection: "column", alignItems: "center", gap: 2, p: 3, borderRadius: 2, border: "1px solid", borderColor: "border.default", bg: "canvas.default", title: name, children: [_jsx(Icon, { size: 32 }), _jsx(Text, { sx: {
|
|
26
|
+
fontSize: 0,
|
|
27
|
+
fontFamily: "mono",
|
|
28
|
+
color: "fg.muted",
|
|
29
|
+
maxWidth: "100%",
|
|
30
|
+
overflow: "hidden",
|
|
31
|
+
textOverflow: "ellipsis",
|
|
32
|
+
whiteSpace: "nowrap",
|
|
33
|
+
}, children: name })] }, name))) })] }));
|
|
34
|
+
}
|
|
35
|
+
return { default: Grid };
|
|
36
|
+
}));
|
|
7
37
|
export function IconsPage() {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
mx: "auto",
|
|
11
|
-
display: "flex",
|
|
12
|
-
alignItems: "center",
|
|
13
|
-
gap: 3,
|
|
14
|
-
}, children: [_jsx(Spinner, { size: "medium" }), _jsx(Text, { sx: { color: "fg.muted" }, children: "Loading icon catalog..." })] }) }), children: _jsx(DatalayerIcons, {}) }));
|
|
38
|
+
const [query, setQuery] = useState("");
|
|
39
|
+
return (_jsxs(Box, { display: "flex", flexDirection: "column", gap: 3, p: 4, children: [_jsx(TextInput, { leadingVisual: SearchIcon, placeholder: "Search the icons", "aria-label": "Search the icons", value: query, onChange: (event) => setQuery(event.target.value), sx: { maxWidth: 420 } }), _jsx(Suspense, { fallback: _jsxs(Box, { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", gap: 3, minHeight: "60vh", children: [_jsx(Spinner, { size: "large" }), _jsx(Text, { sx: { color: "fg.muted", fontSize: 2 }, children: "Loading the icons..." })] }), children: _jsx(IconGrid, { query: query }) })] }));
|
|
15
40
|
}
|
|
16
41
|
export default IconsPage;
|