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 11{
22 "name" : " @codegouvfr/react-dsfr" ,
3- "version" : " 0.0.19 " ,
3+ "version" : " 0.0.20 " ,
44 "description" : " French State Design System React component library" ,
55 "repository" : {
66 "type" : " git" ,
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ import type { Icon } from "./css_to_ts";
33import { parseCss } from "./parseCss" ;
44import * as css from "css" ;
55import { exclude } from "tsafe/exclude" ;
6- import { assert } from "tsafe/assert" ;
76
87type IconLike = Icon . Dsfr | Omit < Icon . Remixicon , "rawSvgCode" > ;
98
@@ -70,11 +69,11 @@ export const getPatchedRawCssCodeForCompatWithRemixIcon = memoize((rawCssCode: s
7069 ( parsedCss as any ) . stylesheet . rules = ( parsedCss as any ) . stylesheet . rules
7170 . map ( ( rule : any ) => {
7271 if ( rule . type === "media" ) {
73- //TODO
74-
7572 rule . rules = rule . rules
7673 . map ( ( rule : any ) => {
77- assert ( rule . type === "rule" ) ;
74+ if ( rule . type !== "rule" ) {
75+ return undefined ;
76+ }
7877
7978 if ( prefixRegExp . test ( rule . selectors . join ( ", " ) ) ) {
8079 return rule ;
@@ -91,7 +90,9 @@ export const getPatchedRawCssCodeForCompatWithRemixIcon = memoize((rawCssCode: s
9190 return rule ;
9291 }
9392
94- assert ( rule . type === "rule" ) ;
93+ if ( rule . type !== "rule" ) {
94+ return undefined ;
95+ }
9596
9697 if ( prefixRegExp . test ( rule . selectors . join ( ", " ) ) ) {
9798 return rule ;
Original file line number Diff line number Diff line change 2121 <!--<link rel="preload" href="/dsfr/fonts/Spectral-ExtraBold.woff2" as="font" crossorigin="anonymous" />-->
2222
2323 < link rel ="stylesheet " href ="/dsfr/dsfr.min.css " />
24+ < link rel ="stylesheet " href ="/dsfr/utility/icons/icons.min.css " />
2425
2526 < title > Vite + React + TS</ title >
2627 </ head >
Original file line number Diff line number Diff line change 11import artworkLightSvgUrl from "@codegouvfr/react-dsfr/dsfr/artwork/light.svg" ;
22import artworkDarkSvgUrl from "@codegouvfr/react-dsfr/dsfr/artwork/dark.svg" ;
33import artworkSystemSvgUrl from "@codegouvfr/react-dsfr/dsfr/artwork/system.svg" ;
4- import { useIsDark } from "@codegouvfr/react-dsfr" ;
4+ import { useIsDark , fr } from "@codegouvfr/react-dsfr" ;
55
66export function App ( ) {
77 const { isDark, setIsDark } = useIsDark ( ) ;
88
99 return (
1010 < >
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+
1123 < h1 > Color Scheme: { isDark ? "dark" : "light" } </ h1 >
1224 < button onClick = { ( ) => setIsDark ( true ) } > Set color scheme to dark</ button >
1325 < button onClick = { ( ) => setIsDark ( false ) } > Set color scheme to light</ button >
You can’t perform that action at this time.
0 commit comments