@datalayer/design 1.0.10 → 1.0.13
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 +78 -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 +5 -5
- 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
|
}
|
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,81 @@
|
|
|
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, in two views, chosen at the top of
|
|
8
|
+
* the page and kept in the address (`?view=viewer`) so a link opens either:
|
|
9
|
+
*
|
|
10
|
+
* - Grid, the default: every icon of `@datalayer/icons-react` (published on
|
|
11
|
+
* npm), searchable by name.
|
|
12
|
+
* - Viewer: the viewer of the icons repository, which `@datalayer/icons-react`
|
|
13
|
+
* ships as its subpath `@datalayer/icons-react/viewer` (in no barrel), the
|
|
14
|
+
* four treatments of each icon with their downloads. Imported when chosen,
|
|
15
|
+
* so the grid never loads its chunk.
|
|
16
|
+
*
|
|
17
|
+
* It read `@datalayer/icons-all` until 20 November 2026; that package is
|
|
18
|
+
* never published, and design is.
|
|
19
|
+
*/
|
|
20
|
+
import { Suspense, lazy, useMemo, useState } from "react";
|
|
21
|
+
import { useSearchParams } from "react-router-dom";
|
|
22
|
+
import { SegmentedControl, Spinner, Text, TextInput } from "@primer/react";
|
|
23
|
+
import { SearchIcon } from "@primer/octicons-react";
|
|
24
|
+
import { Box } from "@datalayer/primer-addons";
|
|
25
|
+
/** A React component: a function, or a `forwardRef` / `memo` object. */
|
|
26
|
+
const isComponent = (value) => typeof value === "function" ||
|
|
27
|
+
(typeof value === "object" && value !== null && "$$typeof" in value);
|
|
28
|
+
const IconGrid = lazy(() => import("@datalayer/icons-react").then((module) => {
|
|
29
|
+
const icons = Object.entries(module)
|
|
30
|
+
// Each icon is a `forwardRef` component, an object (a `$$typeof` element
|
|
31
|
+
// type), not a function: a check for functions alone listed none.
|
|
32
|
+
.filter(([name, value]) => name.endsWith("Icon") && isComponent(value))
|
|
33
|
+
.map(([name, value]) => [name, value])
|
|
34
|
+
.sort(([a], [b]) => a.localeCompare(b));
|
|
35
|
+
function Grid({ query }) {
|
|
36
|
+
const shown = useMemo(() => {
|
|
37
|
+
const q = query.trim().toLowerCase();
|
|
38
|
+
return q ? icons.filter(([name]) => name.toLowerCase().includes(q)) : icons;
|
|
39
|
+
}, [query]);
|
|
40
|
+
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: {
|
|
41
|
+
fontSize: 0,
|
|
42
|
+
fontFamily: "mono",
|
|
43
|
+
color: "fg.muted",
|
|
44
|
+
maxWidth: "100%",
|
|
45
|
+
overflow: "hidden",
|
|
46
|
+
textOverflow: "ellipsis",
|
|
47
|
+
whiteSpace: "nowrap",
|
|
48
|
+
}, children: name })] }, name))) })] }));
|
|
49
|
+
}
|
|
50
|
+
return { default: Grid };
|
|
51
|
+
}));
|
|
52
|
+
/** The icons viewer of `@datalayer/icons-react`, loaded when chosen. */
|
|
53
|
+
const IconsViewer = lazy(() => import("@datalayer/icons-react/viewer"));
|
|
54
|
+
const VIEWS = ["grid", "viewer"];
|
|
55
|
+
const VIEW_LABELS = { grid: "Grid", viewer: "Viewer" };
|
|
56
|
+
function Loading({ children }) {
|
|
57
|
+
return (_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: children })] }));
|
|
58
|
+
}
|
|
59
|
+
function IconsGrid() {
|
|
60
|
+
const [query, setQuery] = useState("");
|
|
61
|
+
return (_jsxs(_Fragment, { 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: _jsx(Loading, { children: "Loading the icons..." }), children: _jsx(IconGrid, { query: query }) })] }));
|
|
62
|
+
}
|
|
7
63
|
export function IconsPage() {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
64
|
+
const [searchParams, setSearchParams] = useSearchParams();
|
|
65
|
+
const view = searchParams.get("view") === "viewer" ? "viewer" : "grid";
|
|
66
|
+
const choose = (index) => {
|
|
67
|
+
const next = VIEWS[index];
|
|
68
|
+
setSearchParams((current) => {
|
|
69
|
+
const params = new URLSearchParams(current);
|
|
70
|
+
if (next === "viewer")
|
|
71
|
+
params.set("view", "viewer");
|
|
72
|
+
else
|
|
73
|
+
params.delete("view");
|
|
74
|
+
// The viewer keeps its search in `q`; the grid has its own.
|
|
75
|
+
params.delete("q");
|
|
76
|
+
return params;
|
|
77
|
+
}, { replace: true });
|
|
78
|
+
};
|
|
79
|
+
return (_jsxs(Box, { display: "flex", flexDirection: "column", gap: 3, p: 4, children: [_jsx(Box, { alignSelf: "flex-start", children: _jsx(SegmentedControl, { "aria-label": "How to show the icons", onChange: choose, children: VIEWS.map((option) => (_jsx(SegmentedControl.Button, { selected: view === option, children: VIEW_LABELS[option] }, option))) }) }), view === "viewer" ? (_jsx(Box, { mx: -4, mt: -3, children: _jsx(Suspense, { fallback: _jsx(Loading, { children: "Loading the viewer..." }), children: _jsx(IconsViewer, {}) }) })) : (_jsx(IconsGrid, {}))] }));
|
|
15
80
|
}
|
|
16
81
|
export default IconsPage;
|