Skip to content

Commit b8670cb

Browse files
committed
new demo page in test
1 parent f2d4713 commit b8670cb

File tree

7 files changed

+147
-2
lines changed

7 files changed

+147
-2
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@
120120
"patch-package": "^8.0.0",
121121
"powerhooks": "^0.22.0",
122122
"prettier": "^2.3.0",
123-
"react": "18.2.0",
124-
"react-dom": "18.2.0",
123+
"react": "^19.1.0",
124+
"react-dom": "^19.1.0",
125125
"remixicon": "^4.2.0",
126126
"storybook-dark-mode": "^1.1.2",
127127
"svgo": "^3.3.2",

src/picto/Datalma.tsx

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
import React from "react";
2+
import { createIcon } from "./utils/IconWrapper";
3+
4+
export default createIcon(
5+
<>
6+
<path
7+
d="M20.8854 10V26.1817L10 35.4712H31.7707L31.7707 19.5238L20.8854 10Z"
8+
fill="url(#paint0_linear_1_11)"
9+
/>
10+
<path
11+
d="M20.8854 10L31.7707 19.5238L70 52.9714L43.7233 10H20.8854Z"
12+
fill="url(#paint1_linear_1_11)"
13+
/>
14+
<path
15+
d="M20.8854 70V53.8183L10 44.5288H31.7707L31.7707 60.4762L20.8854 70Z"
16+
fill="url(#paint2_linear_1_11)"
17+
/>
18+
<path
19+
d="M20.8854 70L31.7707 60.4762L70 27.0286L43.7233 70H20.8854Z"
20+
fill="url(#paint3_linear_1_11)"
21+
/>
22+
<defs>
23+
<linearGradient
24+
id="paint0_linear_1_11"
25+
x1="12.4467"
26+
y1="36.1486"
27+
x2="33.8223"
28+
y2="23.2122"
29+
gradientUnits="userSpaceOnUse"
30+
>
31+
<stop stop-color="#539ED7" />
32+
<stop offset="0.65546" stop-color="#4D85CB" />
33+
<stop offset="1" stop-color="#4A77C4" />
34+
</linearGradient>
35+
<linearGradient
36+
id="paint1_linear_1_11"
37+
x1="34.9641"
38+
y1="7.57789"
39+
x2="67.7788"
40+
y2="54.4708"
41+
gradientUnits="userSpaceOnUse"
42+
>
43+
<stop stop-color="#59AEE0" />
44+
<stop offset="0.06089" stop-color="#56A4DB" />
45+
<stop offset="0.22177" stop-color="#5090D0" />
46+
<stop offset="0.40496" stop-color="#4C81C9" />
47+
<stop offset="0.62759" stop-color="#4A79C5" />
48+
<stop offset="1" stop-color="#4A77C4" />
49+
</linearGradient>
50+
<linearGradient
51+
id="paint2_linear_1_11"
52+
x1="34.6004"
53+
y1="58.6197"
54+
x2="5.15366"
55+
y2="55.5981"
56+
gradientUnits="userSpaceOnUse"
57+
>
58+
<stop stop-color="#D81C69" />
59+
<stop offset="0.13574" stop-color="#DF2150" />
60+
<stop offset="0.29333" stop-color="#E6263B" />
61+
<stop offset="0.46977" stop-color="#EB2A2C" />
62+
<stop offset="0.67834" stop-color="#EE2C23" />
63+
<stop offset="1" stop-color="#EF2D21" />
64+
</linearGradient>
65+
<linearGradient
66+
id="paint3_linear_1_11"
67+
x1="81.1802"
68+
y1="26.4739"
69+
x2="11.5761"
70+
y2="65.2971"
71+
gradientUnits="userSpaceOnUse"
72+
>
73+
<stop stop-color="#DC1A59" />
74+
<stop offset="0.33338" stop-color="#E5273B" />
75+
<stop offset="0.63484" stop-color="#EB2F28" />
76+
<stop offset="0.84116" stop-color="#EE3321" />
77+
</linearGradient>
78+
</defs>
79+
</>,
80+
"Datalma"
81+
);

src/picto/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export const ConnectionLost: SvgIconComponent;
2727
export const Contract: SvgIconComponent;
2828
export const Culture: SvgIconComponent;
2929
export const DataVisualization: SvgIconComponent;
30+
export const Datalma: SvgIconComponent;
3031
export const DigitalArt: SvgIconComponent;
3132
export const Doctor: SvgIconComponent;
3233
export const Document: SvgIconComponent;

src/picto/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export { default as ConnectionLost } from "./ConnectionLost";
2323
export { default as Contract } from "./Contract";
2424
export { default as Culture } from "./Culture";
2525
export { default as DataVisualization } from "./DataVisualization";
26+
export { default as Datalma } from "./Datalma";
2627
export { default as DigitalArt } from "./DigitalArt";
2728
export { default as Doctor } from "./Doctor";
2829
export { default as Document } from "./Document";
Lines changed: 35 additions & 0 deletions
Loading
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { fr } from "@codegouvfr/react-dsfr";
2+
3+
import * as Pictogrammes from '@codegouvfr/react-dsfr/picto';
4+
5+
export function Picto() {
6+
return (
7+
<div className={fr.cx("fr-my-4w")}>
8+
{
9+
Object.entries(Pictogrammes).map(([name, Component]) => (
10+
<Component
11+
key={name}
12+
fontSize="10em"
13+
/>
14+
))
15+
}
16+
</div>
17+
)
18+
}

test/integration/vite/src/main.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from "react";
22
import ReactDOM from "react-dom/client";
33
import { Home } from "./Home";
44
import { Mui } from "./Mui";
5+
import { Picto } from "./Picto";
56
import { startReactDsfr } from "@codegouvfr/react-dsfr/spa";
67
import { Header } from "@codegouvfr/react-dsfr/Header";
78
import { Footer } from "@codegouvfr/react-dsfr/Footer";
@@ -90,6 +91,13 @@ function Root() {
9091
},
9192
"isActive": location.pathname === "/mui"
9293
},
94+
{
95+
"text": "Picto playground",
96+
"linkProps": {
97+
"to": "/picto"
98+
},
99+
"isActive": location.pathname === "/picto"
100+
},
93101
{
94102
"text": "External link",
95103
"linkProps": {
@@ -108,6 +116,7 @@ function Root() {
108116
<Routes>
109117
<Route path="/" element={<Home />} />
110118
<Route path="/mui" element={<Mui />} />
119+
<Route path="/picto" element={<Picto />} />
111120
<Route path="*" element={<h1>404</h1>} />
112121
</Routes>
113122
</div>

0 commit comments

Comments
 (0)