@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 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 (matrix + light) when no persisted
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('matrix');
20
- setColorMode('light');
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,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 { Box, Link, Text } from '@primer/react';
4
- import { AppearanceControlsWithStore, useThemeStore } from '@datalayer/primer-addons';
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, { sx: { minHeight: '100vh', display: 'flex', flexDirection: 'column', bg: 'canvas.default' }, children: [_jsx(Box, { as: "header", sx: {
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, { sx: { display: 'flex', alignItems: 'center', gap: 3, flexWrap: 'wrap' }, children: [_jsx(Box, { as: "nav", sx: { display: 'flex', gap: 2 }, children: NAV_ITEMS.map((item) => {
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: 2,
75
+ borderRadius: 'var(--theme-radius-control)',
85
76
  ':hover': { bg: 'canvas.subtle' },
86
77
  }, children: item.label }, item.to));
87
- }) }), _jsx(AppearanceControlsWithStore, { useStore: useThemeStore })] })] }) }), _jsx(Box, { as: "main", sx: { flex: 1 }, children: _jsx(Outlet, {}) }), _jsx(Box, { as: "footer", sx: { borderTop: '1px solid', borderColor: 'border.default', px: 4, py: 4, bg: 'canvas.subtle' }, children: _jsxs(Box, { sx: { 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, { sx: { 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" })] })] }) })] }));
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;
@@ -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, and one card treatment.
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 { Box, Heading, Link, Text } from "@primer/react";
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, { sx: { display: "flex", alignItems: "center", gap: 2, mb: 3 }, children: [_jsx(Box, { sx: { width: 24, height: "1px", bg: "accent.fg", opacity: 0.5 } }), _jsx(Text, { sx: {
37
- fontFamily: MONO,
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, { sx: {
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, { sx: { px: [3, 4], py: [4, 5] }, children: [_jsx(Box, { sx: { maxWidth: CONTENT_WIDTH, mx: "auto" }, children: _jsxs(Box, { sx: {
118
- position: "relative",
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: palette.isLight ? palette.secondary : palette.primary,
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: palette.textLight,
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: palette.textLight,
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: MONO,
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", sx: { listStyle: "none", p: 0, m: 0 }, children: PILLARS.map((pillar) => (_jsx(Box, { as: "li", sx: {
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",
@@ -1,16 +1,41 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Suspense, lazy } from "react";
3
- import { Box, Spinner, Text } from "@primer/react";
4
- const DatalayerIcons = lazy(() => import("@datalayer/icons-all").then((module) => ({
5
- default: module.DatalayerIcons,
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
- return (_jsx(Suspense, { fallback: _jsx(Box, { sx: { px: 4, py: 6 }, children: _jsxs(Box, { sx: {
9
- maxWidth: 1200,
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;