File tree Expand file tree Collapse file tree 4 files changed +21
-7
lines changed Expand file tree Collapse file tree 4 files changed +21
-7
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @codegouvfr/react-dsfr" ,
3
- "version" : " 0.0.19 " ,
3
+ "version" : " 0.0.20 " ,
4
4
"description" : " French State Design System React component library" ,
5
5
"repository" : {
6
6
"type" : " git" ,
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ import type { Icon } from "./css_to_ts";
3
3
import { parseCss } from "./parseCss" ;
4
4
import * as css from "css" ;
5
5
import { exclude } from "tsafe/exclude" ;
6
- import { assert } from "tsafe/assert" ;
7
6
8
7
type IconLike = Icon . Dsfr | Omit < Icon . Remixicon , "rawSvgCode" > ;
9
8
@@ -70,11 +69,11 @@ export const getPatchedRawCssCodeForCompatWithRemixIcon = memoize((rawCssCode: s
70
69
( parsedCss as any ) . stylesheet . rules = ( parsedCss as any ) . stylesheet . rules
71
70
. map ( ( rule : any ) => {
72
71
if ( rule . type === "media" ) {
73
- //TODO
74
-
75
72
rule . rules = rule . rules
76
73
. map ( ( rule : any ) => {
77
- assert ( rule . type === "rule" ) ;
74
+ if ( rule . type !== "rule" ) {
75
+ return undefined ;
76
+ }
78
77
79
78
if ( prefixRegExp . test ( rule . selectors . join ( ", " ) ) ) {
80
79
return rule ;
@@ -91,7 +90,9 @@ export const getPatchedRawCssCodeForCompatWithRemixIcon = memoize((rawCssCode: s
91
90
return rule ;
92
91
}
93
92
94
- assert ( rule . type === "rule" ) ;
93
+ if ( rule . type !== "rule" ) {
94
+ return undefined ;
95
+ }
95
96
96
97
if ( prefixRegExp . test ( rule . selectors . join ( ", " ) ) ) {
97
98
return rule ;
Original file line number Diff line number Diff line change 21
21
<!--<link rel="preload" href="/dsfr/fonts/Spectral-ExtraBold.woff2" as="font" crossorigin="anonymous" />-->
22
22
23
23
< link rel ="stylesheet " href ="/dsfr/dsfr.min.css " />
24
+ < link rel ="stylesheet " href ="/dsfr/utility/icons/icons.min.css " />
24
25
25
26
< title > Vite + React + TS</ title >
26
27
</ head >
Original file line number Diff line number Diff line change 1
1
import artworkLightSvgUrl from "@codegouvfr/react-dsfr/dsfr/artwork/light.svg" ;
2
2
import artworkDarkSvgUrl from "@codegouvfr/react-dsfr/dsfr/artwork/dark.svg" ;
3
3
import artworkSystemSvgUrl from "@codegouvfr/react-dsfr/dsfr/artwork/system.svg" ;
4
- import { useIsDark } from "@codegouvfr/react-dsfr" ;
4
+ import { useIsDark , fr } from "@codegouvfr/react-dsfr" ;
5
5
6
6
export function App ( ) {
7
7
const { isDark, setIsDark } = useIsDark ( ) ;
8
8
9
9
return (
10
10
< >
11
+
12
+ < button className = { fr . cx ( "fr-btn" , "fr-icon-checkbox-circle-line" , "fr-btn--icon-left" ) } >
13
+ Label bouton MD
14
+ </ button >
15
+ < span className = "fr-icon-ancient-gate-fill" aria-hidden = "true" > </ span >
16
+ < i className = "fr-icon-ancient-gate-fill" aria-hidden = "true" />
17
+
18
+ < button className = { fr . cx ( "fr-btn" , "ri-amazon-fill" , "fr-btn--icon-left" ) } >
19
+ Download
20
+ </ button >
21
+
22
+
11
23
< h1 > Color Scheme: { isDark ? "dark" : "light" } </ h1 >
12
24
< button onClick = { ( ) => setIsDark ( true ) } > Set color scheme to dark</ button >
13
25
< button onClick = { ( ) => setIsDark ( false ) } > Set color scheme to light</ button >
You can’t perform that action at this time.
0 commit comments