File tree Expand file tree Collapse file tree 4 files changed +12
-5
lines changed Expand file tree Collapse file tree 4 files changed +12
-5
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @codegouvfr/react-dsfr" ,
3
- "version" : " 1.13.4-rc.0 " ,
3
+ "version" : " 1.13.4" ,
4
4
"description" : " French State Design System React integration library" ,
5
5
"repository" : {
6
6
"type" : " git" ,
Original file line number Diff line number Diff line change @@ -366,6 +366,7 @@ export const Header = memo(
366
366
< div
367
367
className = { fr . cx ( "fr-header__search" , "fr-modal" ) }
368
368
id = { searchModalId }
369
+ aria-labelledby = { `${ id } -search-bar-button` }
369
370
>
370
371
< div
371
372
className = { fr . cx (
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ import { useRerenderOnChange } from "../tools/StatefulObservable/hooks";
9
9
import { createConsentBannerAndConsentManagement } from "./ConsentBannerAndConsentManagement" ;
10
10
import { isBrowser } from "../tools/isBrowser" ;
11
11
12
- export const localStorageKeyPrefix = "@codegouvfr/react-dsfr finalityConsent" ;
12
+ export const defaultLocalStorageKeyPrefix = "@codegouvfr/react-dsfr finalityConsent" ;
13
13
14
14
export function createConsentManagement <
15
15
FinalityDescription extends Record <
@@ -21,10 +21,16 @@ export function createConsentManagement<
21
21
consentCallback ?: ConsentCallback < ExtractFinalityFromFinalityDescription < FinalityDescription > > ;
22
22
/** Optional: If you have a dedicated page that provides comprehensive information about your website's GDPR policies. */
23
23
personalDataPolicyLinkProps ?: RegisteredLinkProps ;
24
+ localStorageKeyPrefix ?: string ;
24
25
} ) {
25
26
type Finality = ExtractFinalityFromFinalityDescription < FinalityDescription > ;
26
27
27
- const { finalityDescription, personalDataPolicyLinkProps, consentCallback } = params ;
28
+ const {
29
+ finalityDescription,
30
+ personalDataPolicyLinkProps,
31
+ consentCallback,
32
+ localStorageKeyPrefix = defaultLocalStorageKeyPrefix
33
+ } = params ;
28
34
29
35
const finalities = getFinalitiesFromFinalityDescription ( {
30
36
"finalityDescription" :
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import React from "react";
2
2
import { sectionName } from "./sectionName" ;
3
3
import { getStoryFactory } from "./getStory" ;
4
4
import { createConsentManagement } from "../dist/consentManagement" ;
5
- import { localStorageKeyPrefix } from "../dist/consentManagement/createConsentManagement" ;
5
+ import { defaultLocalStorageKeyPrefix } from "../dist/consentManagement/createConsentManagement" ;
6
6
import { Placeholder } from "../dist/consentManagement/Placeholder" ;
7
7
import { Footer } from "../dist/Footer" ;
8
8
import { Button } from "../dist/Button" ;
@@ -284,7 +284,7 @@ function Story() {
284
284
< Button
285
285
onClick = { ( ) => {
286
286
Object . keys ( localStorage )
287
- . filter ( key => key . startsWith ( localStorageKeyPrefix ) )
287
+ . filter ( key => key . startsWith ( defaultLocalStorageKeyPrefix ) )
288
288
. forEach ( key => localStorage . removeItem ( key ) ) ;
289
289
290
290
location . reload ( ) ;
You can’t perform that action at this time.
0 commit comments