@@ -6,41 +6,21 @@ import { fr } from "../../dist/fr";
66import { NonPostableEvt } from "evt" ;
77import { useEvt } from "evt/hooks" ;
88import { Select } from "../../dist/Select" ;
9- import { colorDecisionAndCorrespondingOption } from "../../dist/fr/generatedFromCss/colorDecisionAndCorrespondingOptions" ;
10-
11- const colors = Array . from (
12- new Set (
13- colorDecisionAndCorrespondingOption . map (
14- ( { parsedColorDecisionName } ) => parsedColorDecisionName . colorName
15- )
16- )
17- ) ;
18- const contextes = Array . from (
19- new Set (
20- colorDecisionAndCorrespondingOption . map (
21- ( { parsedColorDecisionName } ) => parsedColorDecisionName . context
22- )
23- )
24- ) ;
25- const usages = Array . from (
26- new Set (
27- colorDecisionAndCorrespondingOption . map (
28- ( { parsedColorDecisionName } ) => parsedColorDecisionName . usage
29- )
30- )
31- ) ;
329
3310export type Props = {
3411 className ?: string ;
3512 search : string ;
3613 onSearchChange : ( search : string ) => void ;
3714 evtAction : NonPostableEvt < "scroll to" > ;
38- context : typeof contextes [ number ] | undefined ;
39- onContextChange : ( context : typeof contextes [ number ] | undefined ) => void ;
40- color : typeof colors [ number ] | undefined ;
41- onColorChange : ( color : typeof colors [ number ] | undefined ) => void ;
42- usage : typeof usages [ number ] | undefined ;
43- onUsageChange : ( usage : typeof usages [ number ] | undefined ) => void ;
15+ contextes : string [ ] ;
16+ context : string | undefined ;
17+ onContextChange : ( context : string | undefined ) => void ;
18+ colors : string [ ] ;
19+ color : string | undefined ;
20+ onColorChange : ( color : string | undefined ) => void ;
21+ usages : string [ ] ;
22+ usage : string | undefined ;
23+ onUsageChange : ( usage : string | undefined ) => void ;
4424} ;
4525
4626export function Search ( props : Props ) {
@@ -49,10 +29,13 @@ export function Search(props: Props) {
4929 search,
5030 onSearchChange,
5131 evtAction,
32+ contextes,
5233 context,
5334 onContextChange,
35+ colors,
5436 color,
5537 onColorChange,
38+ usages,
5639 usage,
5740 onUsageChange
5841 } = props ;
0 commit comments