@datalayer/design 1.0.0 → 1.0.1
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/README.md +1 -1
- package/lib/App.js +4 -5
- package/lib/pages/HomePage.js +223 -45
- package/lib/pages/IconsPage.js +12 -4
- package/lib/pages/SvgPage.js +386 -106
- package/lib/svg/SvgAI.d.ts +11 -0
- package/lib/svg/SvgAI.js +15 -0
- package/lib/svg/SvgAI2.d.ts +11 -0
- package/lib/svg/SvgAI2.js +17 -0
- package/lib/svg/SvgAI3.d.ts +12 -0
- package/lib/svg/SvgAI3.js +60 -0
- package/lib/svg/SvgAssignmentArtifact.d.ts +8 -0
- package/lib/svg/SvgAssignmentArtifact.js +15 -0
- package/lib/svg/SvgCellOutputshotPlaceholder.d.ts +28 -0
- package/lib/svg/SvgCellOutputshotPlaceholder.js +70 -0
- package/lib/svg/SvgEarthHero.d.ts +2 -2
- package/lib/svg/SvgEarthHero.js +41 -8
- package/lib/svg/SvgEvalsHero.d.ts +15 -0
- package/lib/svg/SvgEvalsHero.js +23 -0
- package/lib/svg/SvgExerciseArtifact.d.ts +8 -0
- package/lib/svg/SvgExerciseArtifact.js +15 -0
- package/lib/svg/SvgLessonArtifact.d.ts +8 -0
- package/lib/svg/SvgLessonArtifact.js +15 -0
- package/lib/svg/SvgNotebookMock.d.ts +10 -0
- package/lib/svg/SvgNotebookMock.js +70 -0
- package/lib/svg/SvgOSAContributions.d.ts +11 -0
- package/lib/svg/SvgOSAContributions.js +25 -0
- package/lib/svg/SvgPartnersHero.d.ts +16 -0
- package/lib/svg/SvgPartnersHero.js +94 -0
- package/lib/svg/SvgPixel1.js +29 -2
- package/lib/svg/SvgPixel2.js +37 -8
- package/lib/svg/SvgSkubble.d.ts +11 -0
- package/lib/svg/SvgSkubble.js +23 -0
- package/lib/svg/gallery.d.ts +1 -1
- package/lib/svg/gallery.js +16 -1
- package/lib/svg/images/eric-charles-2.svg +1249 -0
- package/lib/svg/images/eric-charles.svg +1131 -0
- package/lib/svg/index.d.ts +17 -0
- package/lib/svg/index.js +12 -0
- package/package.json +11 -4
- package/lib/DatalayerIcons.d.ts +0 -2
- package/lib/DatalayerIcons.js +0 -169
package/lib/svg/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export { SvgAgentsHomeHero } from './SvgAgentsHomeHero';
|
|
|
9
9
|
export { SvgLoginHero } from './SvgLoginHero';
|
|
10
10
|
export { SvgUsecasesHero } from './SvgUsecasesHero';
|
|
11
11
|
export { SvgIntegrationsHero } from './SvgIntegrationsHero';
|
|
12
|
+
export { SvgPartnersHero } from './SvgPartnersHero';
|
|
12
13
|
export { SvgChangelogHero } from './SvgChangelogHero';
|
|
13
14
|
export { SvgAboutHero } from './SvgAboutHero';
|
|
14
15
|
export { SvgCareersHero } from './SvgCareersHero';
|
|
@@ -19,6 +20,7 @@ export { SvgInvites } from './SvgInvites';
|
|
|
19
20
|
export { SvgDiscord, SVG_DISCORD_MATRIX_LIGHT_INLINE } from './SvgDiscord';
|
|
20
21
|
export { SvgTutorialsHero } from './SvgTutorialsHero';
|
|
21
22
|
export { SvgResearchHero } from './SvgResearchHero';
|
|
23
|
+
export { SvgEvalsHero } from './SvgEvalsHero';
|
|
22
24
|
export { SvgEventsHero } from './SvgEventsHero';
|
|
23
25
|
export { SvgStarsHero } from './SvgStarsHero';
|
|
24
26
|
export { SvgSpitfire } from './SvgSpitfire';
|
|
@@ -31,14 +33,29 @@ export { SvgEarthHero } from './SvgEarthHero';
|
|
|
31
33
|
export { SvgFastA2ADonation } from './SvgFastA2ADonation';
|
|
32
34
|
export { SvgRadar } from './SvgRadar';
|
|
33
35
|
export { SvgNotebookArtifact } from './SvgNotebookArtifact';
|
|
36
|
+
export { SvgOSAContributions } from './SvgOSAContributions';
|
|
34
37
|
export { SvgDocumentArtifact } from './SvgDocumentArtifact';
|
|
35
38
|
export { SvgCellArtifact } from './SvgCellArtifact';
|
|
39
|
+
export { SvgLessonArtifact } from './SvgLessonArtifact';
|
|
40
|
+
export { SvgExerciseArtifact } from './SvgExerciseArtifact';
|
|
41
|
+
export { SvgAssignmentArtifact } from './SvgAssignmentArtifact';
|
|
42
|
+
export { SvgNotebookMock } from './SvgNotebookMock';
|
|
43
|
+
export type { SvgNotebookMockProps } from './SvgNotebookMock';
|
|
44
|
+
export { SvgCellOutputshotPlaceholder, buildCellOutputshotPlaceholderSvg, cellOutputshotPlaceholderDataUri, useCellOutputshotPlaceholderDataUri, } from './SvgCellOutputshotPlaceholder';
|
|
45
|
+
export type { SvgCellOutputshotPlaceholderProps } from './SvgCellOutputshotPlaceholder';
|
|
36
46
|
export { SvgDataset } from './SvgDataset';
|
|
37
47
|
export { SvgJupyterMcp } from './SvgJupyterMcp';
|
|
38
48
|
export { SvgLines } from './SvgLines';
|
|
39
49
|
export { SvgPublication } from './SvgPublication';
|
|
50
|
+
export { SvgAI } from './SvgAI';
|
|
51
|
+
export type { SvgAIProps } from './SvgAI';
|
|
52
|
+
export { SvgAI2 } from './SvgAI2';
|
|
53
|
+
export type { SvgAI2Props } from './SvgAI2';
|
|
54
|
+
export { SvgAI3 } from './SvgAI3';
|
|
55
|
+
export type { SvgAI3Props } from './SvgAI3';
|
|
40
56
|
export { SvgPixel1 } from './SvgPixel1';
|
|
41
57
|
export { SvgPixel2 } from './SvgPixel2';
|
|
58
|
+
export { SvgSkubble } from './SvgSkubble';
|
|
42
59
|
export { SvgPrivacyHero } from './SvgPrivacyHero';
|
|
43
60
|
export { SvgTermsHero } from './SvgTermsHero';
|
|
44
61
|
export { SvgNotFound } from './SvgNotFound';
|
package/lib/svg/index.js
CHANGED
|
@@ -14,6 +14,7 @@ export { SvgAgentsHomeHero } from './SvgAgentsHomeHero';
|
|
|
14
14
|
export { SvgLoginHero } from './SvgLoginHero';
|
|
15
15
|
export { SvgUsecasesHero } from './SvgUsecasesHero';
|
|
16
16
|
export { SvgIntegrationsHero } from './SvgIntegrationsHero';
|
|
17
|
+
export { SvgPartnersHero } from './SvgPartnersHero';
|
|
17
18
|
export { SvgChangelogHero } from './SvgChangelogHero';
|
|
18
19
|
export { SvgAboutHero } from './SvgAboutHero';
|
|
19
20
|
export { SvgCareersHero } from './SvgCareersHero';
|
|
@@ -24,6 +25,7 @@ export { SvgInvites } from './SvgInvites';
|
|
|
24
25
|
export { SvgDiscord, SVG_DISCORD_MATRIX_LIGHT_INLINE } from './SvgDiscord';
|
|
25
26
|
export { SvgTutorialsHero } from './SvgTutorialsHero';
|
|
26
27
|
export { SvgResearchHero } from './SvgResearchHero';
|
|
28
|
+
export { SvgEvalsHero } from './SvgEvalsHero';
|
|
27
29
|
export { SvgEventsHero } from './SvgEventsHero';
|
|
28
30
|
export { SvgStarsHero } from './SvgStarsHero';
|
|
29
31
|
export { SvgSpitfire } from './SvgSpitfire';
|
|
@@ -36,14 +38,24 @@ export { SvgEarthHero } from './SvgEarthHero';
|
|
|
36
38
|
export { SvgFastA2ADonation } from './SvgFastA2ADonation';
|
|
37
39
|
export { SvgRadar } from './SvgRadar';
|
|
38
40
|
export { SvgNotebookArtifact } from './SvgNotebookArtifact';
|
|
41
|
+
export { SvgOSAContributions } from './SvgOSAContributions';
|
|
39
42
|
export { SvgDocumentArtifact } from './SvgDocumentArtifact';
|
|
40
43
|
export { SvgCellArtifact } from './SvgCellArtifact';
|
|
44
|
+
export { SvgLessonArtifact } from './SvgLessonArtifact';
|
|
45
|
+
export { SvgExerciseArtifact } from './SvgExerciseArtifact';
|
|
46
|
+
export { SvgAssignmentArtifact } from './SvgAssignmentArtifact';
|
|
47
|
+
export { SvgNotebookMock } from './SvgNotebookMock';
|
|
48
|
+
export { SvgCellOutputshotPlaceholder, buildCellOutputshotPlaceholderSvg, cellOutputshotPlaceholderDataUri, useCellOutputshotPlaceholderDataUri, } from './SvgCellOutputshotPlaceholder';
|
|
41
49
|
export { SvgDataset } from './SvgDataset';
|
|
42
50
|
export { SvgJupyterMcp } from './SvgJupyterMcp';
|
|
43
51
|
export { SvgLines } from './SvgLines';
|
|
44
52
|
export { SvgPublication } from './SvgPublication';
|
|
53
|
+
export { SvgAI } from './SvgAI';
|
|
54
|
+
export { SvgAI2 } from './SvgAI2';
|
|
55
|
+
export { SvgAI3 } from './SvgAI3';
|
|
45
56
|
export { SvgPixel1 } from './SvgPixel1';
|
|
46
57
|
export { SvgPixel2 } from './SvgPixel2';
|
|
58
|
+
export { SvgSkubble } from './SvgSkubble';
|
|
47
59
|
export { SvgPrivacyHero } from './SvgPrivacyHero';
|
|
48
60
|
export { SvgTermsHero } from './SvgTermsHero';
|
|
49
61
|
export { SvgNotFound } from './SvgNotFound';
|
package/package.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datalayer/design",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"private": false,
|
|
3
|
+
"version": "1.0.1",
|
|
5
4
|
"main": "./lib/index.js",
|
|
6
5
|
"types": "./lib/index.d.ts",
|
|
7
6
|
"files": [
|
|
@@ -17,7 +16,7 @@
|
|
|
17
16
|
"build": "npm run clean && tsc && npm run copy:svg-assets && vite build",
|
|
18
17
|
"build:lib": "tsc && npm run copy:svg-assets",
|
|
19
18
|
"clean": "rimraf lib build dist tsconfig.tsbuildinfo",
|
|
20
|
-
"copy:svg-assets": "mkdir -p lib/svg/images && cp src/svg/images
|
|
19
|
+
"copy:svg-assets": "mkdir -p lib/svg/images && cp src/svg/images/*.svg lib/svg/images/",
|
|
21
20
|
"dev": "vite",
|
|
22
21
|
"landing:app": "npm run copy:svg-assets && tsc --watch",
|
|
23
22
|
"preview": "vite preview",
|
|
@@ -25,8 +24,16 @@
|
|
|
25
24
|
"watch:lib": "npm run copy:svg-assets && tsc -w"
|
|
26
25
|
},
|
|
27
26
|
"dependencies": {
|
|
27
|
+
"@datalayer/icons-all": "*",
|
|
28
28
|
"@datalayer/icons-react": "^1.0.0",
|
|
29
29
|
"@datalayer/primer-addons": "^1.0.12",
|
|
30
|
+
"@primer/css": "^21.5.1",
|
|
31
|
+
"@primer/octicons-react": "^19.29.1",
|
|
32
|
+
"@primer/primitives": "^10.7.0",
|
|
33
|
+
"@primer/react": "^37.31.0",
|
|
34
|
+
"@types/gif.js": "^0.2.5",
|
|
35
|
+
"gif.js": "^0.2.0",
|
|
36
|
+
"html2canvas": "^1.4.1",
|
|
30
37
|
"react": "18.3.1",
|
|
31
38
|
"react-dom": "18.3.1",
|
|
32
39
|
"react-router-dom": "^6.30.1",
|
|
@@ -41,7 +48,7 @@
|
|
|
41
48
|
"@vitejs/plugin-react": "^4.5.2",
|
|
42
49
|
"postcss": "^8.4.23",
|
|
43
50
|
"prettier": "^3.3.2",
|
|
44
|
-
"rimraf": "^6.
|
|
51
|
+
"rimraf": "^6.1.3",
|
|
45
52
|
"svgo": "^1.3.2",
|
|
46
53
|
"typescript": "^5.8.3",
|
|
47
54
|
"vite": "^7.0.0",
|
package/lib/DatalayerIcons.d.ts
DELETED
package/lib/DatalayerIcons.js
DELETED
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useEffect, useRef } from 'react';
|
|
3
|
-
import { ThemeProvider, BaseStyles, IconButton, Text, Box, Link, TextInput, Tooltip, Flash, Heading, Button, } from '@primer/react';
|
|
4
|
-
import { SearchIcon } from '@primer/octicons-react';
|
|
5
|
-
import { useColorPalette, useThemeStore, getColorPalette, } from '@datalayer/primer-addons';
|
|
6
|
-
import { toPng, toSvg } from 'html-to-image';
|
|
7
|
-
import styled from 'styled-components';
|
|
8
|
-
import * as dataIcons from '@datalayer/icons-react';
|
|
9
|
-
import * as eggsIcons from '@datalayer/icons-react/eggs';
|
|
10
|
-
const SpanStyle = styled.span `
|
|
11
|
-
span {
|
|
12
|
-
margin-right: 25px;
|
|
13
|
-
},
|
|
14
|
-
`;
|
|
15
|
-
const BorderStyle = styled.span `
|
|
16
|
-
svg {
|
|
17
|
-
border-color: black;
|
|
18
|
-
border: 1px dashed;
|
|
19
|
-
}
|
|
20
|
-
`;
|
|
21
|
-
const IconLine = (props) => {
|
|
22
|
-
const { name, icon } = props;
|
|
23
|
-
const palette = useColorPalette();
|
|
24
|
-
const { theme } = useThemeStore();
|
|
25
|
-
const inversePreviewMode = palette.isLight ? 'night' : 'day';
|
|
26
|
-
const inversePalette = getColorPalette(theme, palette.isLight ? 'dark' : 'light');
|
|
27
|
-
const refColored = useRef(null);
|
|
28
|
-
const refDayColoredStyled = useRef(null);
|
|
29
|
-
const refNightColredStyled = useRef(null);
|
|
30
|
-
const refDayStyled = useRef(null);
|
|
31
|
-
const refNightStyled = useRef(null);
|
|
32
|
-
const downloadPNG = (e, ref, type) => {
|
|
33
|
-
e.preventDefault();
|
|
34
|
-
if (ref.current === null) {
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
toPng(ref.current, { cacheBust: true, width: 1000, height: 1000 })
|
|
38
|
-
.then((dataUrl) => {
|
|
39
|
-
const link = document.createElement('a');
|
|
40
|
-
link.download = `${name}_${type}.png`;
|
|
41
|
-
link.href = dataUrl;
|
|
42
|
-
link.click();
|
|
43
|
-
})
|
|
44
|
-
.catch((err) => {
|
|
45
|
-
console.log(err);
|
|
46
|
-
});
|
|
47
|
-
};
|
|
48
|
-
const downloadSVG = (e, ref) => {
|
|
49
|
-
e.preventDefault();
|
|
50
|
-
if (ref.current === null) {
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
toSvg(ref.current, { cacheBust: true, })
|
|
54
|
-
.then((dataUrl) => {
|
|
55
|
-
const link = document.createElement('a');
|
|
56
|
-
link.download = `${name}.svg`;
|
|
57
|
-
link.href = dataUrl;
|
|
58
|
-
link.click();
|
|
59
|
-
})
|
|
60
|
-
.catch((err) => {
|
|
61
|
-
console.log(err);
|
|
62
|
-
});
|
|
63
|
-
};
|
|
64
|
-
const IconComponent = icon;
|
|
65
|
-
const StyledIcon = () => _jsx(IconComponent, {});
|
|
66
|
-
const ColoredStyledIcon = () => _jsx(IconComponent, { colored: true });
|
|
67
|
-
const iconLine = (_jsxs(Box, { alignItems: "center", justifyContent: "space-between", children: [_jsx(SpanStyle, { children: _jsx("span", { children: _jsx(IconComponent, { colored: true, size: "large", ref: refColored }) }) }), _jsx(BorderStyle, { children: _jsx(SpanStyle, { children: _jsx("span", { children: _jsx(IconComponent, { colored: true, size: "large" }) }) }) }), _jsx(BorderStyle, { children: _jsx(SpanStyle, { children: _jsx("span", { children: _jsx(IconComponent, { size: "large" }) }) }) }), _jsx(BorderStyle, { children: _jsx(Box, { sx: { display: 'inline-flex', mr: '25px' }, children: _jsx(ThemeProvider, { colorMode: inversePreviewMode, children: _jsx(BaseStyles, { style: { display: 'inline-flex' }, children: _jsx(Box, { as: "span", sx: {
|
|
68
|
-
display: 'inline-flex',
|
|
69
|
-
alignItems: 'center',
|
|
70
|
-
justifyContent: 'center',
|
|
71
|
-
p: 1,
|
|
72
|
-
borderRadius: 2,
|
|
73
|
-
backgroundColor: inversePalette.bg,
|
|
74
|
-
border: '1px solid',
|
|
75
|
-
borderColor: inversePalette.primary,
|
|
76
|
-
'--datalayer-icon-fg': inversePalette.primary,
|
|
77
|
-
}, children: _jsx(IconComponent, { colored: true, size: "large", inverseColormode: inversePreviewMode === 'night' ? 'dark' : 'light' }) }) }) }) }) }), _jsx(ThemeProvider, { colorMode: "day", children: _jsx(IconButton, { "aria-labelledby": "", size: "medium", sx: { marginRight: '15px' }, icon: ColoredStyledIcon, ref: refDayColoredStyled, onClick: (e) => downloadPNG(e, refDayColoredStyled, 'day_colored') }) }), _jsx(ThemeProvider, { colorMode: "night", children: _jsx(IconButton, { "aria-labelledby": "", size: "medium", sx: { marginRight: '15px' }, icon: ColoredStyledIcon, ref: refNightColredStyled, onClick: (e) => downloadPNG(e, refNightColredStyled, 'night_colored') }) }), _jsx(ThemeProvider, { colorMode: "day", children: _jsx(IconButton, { "aria-labelledby": "", size: "medium", sx: { marginRight: '15px' }, icon: StyledIcon, ref: refDayStyled, onClick: (e) => downloadPNG(e, refDayStyled, 'day') }) }), _jsx(ThemeProvider, { colorMode: "night", children: _jsx(IconButton, { "aria-labelledby": "", size: "medium", sx: { marginRight: '15px' }, icon: StyledIcon, ref: refNightStyled, onClick: (e) => downloadPNG(e, refNightStyled, 'night') }) }), _jsxs(BorderStyle, { children: [_jsx(SpanStyle, { children: _jsx("span", { children: ColoredStyledIcon() }) }), _jsx(SpanStyle, { children: _jsx("span", { children: StyledIcon() }) })] }), _jsx(SpanStyle, { children: _jsx(Link, { href: "", title: "Download PNG", onClick: (e) => downloadPNG(e, refColored, 'plain'), children: _jsx("span", { children: "PNG" }) }) }), _jsx(SpanStyle, { children: _jsx(Link, { href: "", title: "Download SVG", onClick: (e) => downloadSVG(e, refColored), children: _jsx("span", { children: "SVG" }) }) }), _jsx(SpanStyle, { children: _jsx("span", { children: name }) }), _jsx(Box, { m: 3 })] }));
|
|
78
|
-
return iconLine;
|
|
79
|
-
};
|
|
80
|
-
const IconSummary = (props) => {
|
|
81
|
-
const { name, icon } = props;
|
|
82
|
-
const IconComponent = icon;
|
|
83
|
-
const SummaryIcon = () => (_jsx(IconComponent, { colored: true, size: "medium" }));
|
|
84
|
-
return (_jsx(Box, { mr: 1, children: _jsx(Tooltip, { "aria-label": name, text: name, children: _jsx(IconButton, { "aria-label": name, icon: SummaryIcon, variant: "invisible", size: "small", sx: {
|
|
85
|
-
border: '1px solid',
|
|
86
|
-
borderColor: 'border.default',
|
|
87
|
-
borderRadius: 2,
|
|
88
|
-
} }) }) }));
|
|
89
|
-
};
|
|
90
|
-
const SummaryIcons = (props) => {
|
|
91
|
-
const { names, icons } = props;
|
|
92
|
-
return (_jsx(_Fragment, { children: _jsx(Box, { sx: { display: 'flex' }, children: names.map((name) => {
|
|
93
|
-
return _jsx(IconSummary, { name: name, icon: icons[name] }, name);
|
|
94
|
-
}) }) }));
|
|
95
|
-
};
|
|
96
|
-
const DetailledIcons = (props) => {
|
|
97
|
-
const { names, icons } = props;
|
|
98
|
-
return (_jsx(_Fragment, { children: names.map((name) => {
|
|
99
|
-
return _jsx(IconLine, { name: name, icon: icons[name] }, name);
|
|
100
|
-
}) }));
|
|
101
|
-
};
|
|
102
|
-
const DatalayerIcons = () => {
|
|
103
|
-
const palette = useColorPalette();
|
|
104
|
-
const [filter, setFilter] = useState('');
|
|
105
|
-
// const [debouncedFilter, setDebouncedFilter] = useState('');
|
|
106
|
-
const [icons, setIcons] = useState(dataIcons);
|
|
107
|
-
const [names, setNames] = useState(Object.keys(dataIcons));
|
|
108
|
-
useEffect(() => {
|
|
109
|
-
const queryParams = new URLSearchParams(window.location.search);
|
|
110
|
-
const q = queryParams.get("q");
|
|
111
|
-
q ? setFilter(q) : setFilter('');
|
|
112
|
-
// q ? setDebouncedFilter(q) : setDebouncedFilter('');
|
|
113
|
-
const eggs = queryParams.get("eggs");
|
|
114
|
-
if (eggs !== null) {
|
|
115
|
-
setIcons(eggsIcons);
|
|
116
|
-
setNames(Object.keys(eggsIcons));
|
|
117
|
-
}
|
|
118
|
-
}, []);
|
|
119
|
-
const changeUrl = (title, url) => {
|
|
120
|
-
const obj = {
|
|
121
|
-
Title: title,
|
|
122
|
-
Url: url,
|
|
123
|
-
};
|
|
124
|
-
history.pushState(obj, obj.Title, obj.Url);
|
|
125
|
-
};
|
|
126
|
-
const filterIcons = (filter) => {
|
|
127
|
-
if (filter === '') {
|
|
128
|
-
setNames(Object.keys(icons));
|
|
129
|
-
changeUrl(document.title, window.location.protocol + "//" + window.location.host);
|
|
130
|
-
}
|
|
131
|
-
else {
|
|
132
|
-
const f = filter.toLocaleLowerCase();
|
|
133
|
-
const filteredNames = Object.keys(icons).filter((name => name.toLowerCase().includes(f)));
|
|
134
|
-
setNames(filteredNames);
|
|
135
|
-
changeUrl(document.title, window.location.protocol + "//" + window.location.host + "?q=" + f);
|
|
136
|
-
}
|
|
137
|
-
};
|
|
138
|
-
const handleFilterChange = (event) => {
|
|
139
|
-
setFilter(event.target.value);
|
|
140
|
-
filterIcons(event.target.value);
|
|
141
|
-
};
|
|
142
|
-
useEffect(() => {
|
|
143
|
-
if (filter)
|
|
144
|
-
filterIcons(filter);
|
|
145
|
-
}, [filter]);
|
|
146
|
-
/*
|
|
147
|
-
const [_, __] = useDebounce(
|
|
148
|
-
() => {
|
|
149
|
-
setDebouncedFilter(filter);
|
|
150
|
-
filterIcons();
|
|
151
|
-
},
|
|
152
|
-
0,
|
|
153
|
-
[filter]
|
|
154
|
-
);
|
|
155
|
-
*/
|
|
156
|
-
return (_jsx(_Fragment, { children: _jsxs(Box, { sx: {
|
|
157
|
-
maxWidth: 1200,
|
|
158
|
-
mx: 'auto',
|
|
159
|
-
p: 4,
|
|
160
|
-
'--datalayer-icon-fg': palette.primary,
|
|
161
|
-
}, children: [_jsx(Box, { sx: { display: 'flex', alignItems: 'flex-start', justifyContent: 'space-between', gap: 3, flexWrap: 'wrap' }, children: _jsxs(Box, { children: [_jsx(Heading, { as: "h1", sx: { m: 0, mb: 2, fontSize: 5 }, children: "React icons for data products" }), _jsxs(Text, { sx: { color: 'fg.muted' }, children: ["\u2630 \uD83C\uDF89 ", Object.keys(icons).length, " curated icons for data product design."] })] }) }), _jsxs(Flash, { variant: "warning", sx: { mt: 3 }, children: ["Some icons may not be 100% compatible with existing design guidelines. Please open an issue on", ' ', _jsx(Link, { href: "https://github.com/datalayer/icons/issues", target: "_blank", children: "github.com/datalayer/icons/issues" }), "."] }), _jsxs(Box, { mt: 3, mb: 3, children: [_jsxs(Text, { as: "p", sx: { m: 0 }, children: ["Click on PNG or SVG to download an icon. Filter by name to inspect a single icon. Sources are in the", ' ', _jsx(Link, { href: "https://github.com/datalayer/icons", target: "_blank", children: "datalayer/icons repository" }), "."] }), _jsx(Text, { as: "p", sx: { mt: 2, mb: 0, color: 'fg.muted' }, children: "Preview columns configuration: (1) themed colored icon, (2) themed colored icon with border, (3) themed plain icon, (4) themed previewed in inverse colormode." }), _jsxs(Text, { as: "p", sx: { mt: 1, mb: 0, color: 'fg.muted' }, children: ["Open", ' ', _jsx(Link, { href: "https://github.com/datalayer/icons/blob/main/README.md", target: "_blank", children: "code example" }), ' ', "for a concrete usage snippet."] })] }), _jsxs(Box, { sx: { display: 'flex', gap: 2, alignItems: 'center', flexWrap: 'wrap', mb: 3 }, children: [_jsx(Box, { sx: { flex: '1 1 340px', minWidth: 260 }, children: _jsx(TextInput, { block: true, value: filter, leadingVisual: SearchIcon, placeholder: "Search icons", autoFocus: true, onChange: handleFilterChange, sx: {
|
|
162
|
-
border: '1px solid',
|
|
163
|
-
borderColor: 'border.default',
|
|
164
|
-
} }) }), _jsx(Button, { onClick: () => filterIcons(filter), children: "Apply" })] }), (filter === '') ?
|
|
165
|
-
_jsx(DetailledIcons, { names: names, icons: icons })
|
|
166
|
-
:
|
|
167
|
-
_jsx(SummaryIcons, { names: names, icons: icons })] }) }));
|
|
168
|
-
};
|
|
169
|
-
export default DatalayerIcons;
|