@@ -60,237 +60,246 @@ popover = do
63− mkAutosuggest ∷ Effect (ReactComponent {})
63+ mkAutosuggest ∷ Effect (ReactComponent {})
64− mkAutosuggest = do
64+ mkAutosuggest = do
65− motionStack <- Motion.custom Stack.component
65+ motionStack <- Motion.custom Stack.component
66− motionPopover <- Motion.custom Popover.component
66+ motionPopover <- Motion.custom Popover.component
67− reactComponent "PopoverExample" \props -> React.do
67+ reactComponent "PopoverExample" \props -> React.do
68− referenceElement /\ setReferenceElement <- React.useState' nullRef
68+ referenceElement /\ setReferenceElement <- React.useState' nullRef
69− text /\ setText <- React.useState' ""
69+ text /\ setText <- React.useState' ""
70− visible /\ setVisible <- React.useState' false
70+ visible /\ setVisible <- React.useState' false
72− matchingAuthors =
72+ matchingAuthors =
74− # Array.filter (\a -> String.contains (String.Pattern (String.toLower text)) (String.toLower a))
76+ String.contains (String.Pattern (String.toLower text))
76− inputWrapper =
80+ inputWrapper =
78− </ { ref: unsafeCoerce (mkEffectFn1 setReferenceElement)
82+ </ { ref: unsafeCoerce (mkEffectFn1 setReferenceElement)
81− Input.component
85+ Input.component
82− </> { id: "author"
86+ </> { id: "author"
83− , type: HTMLInput.Text
87+ , type: HTMLInput.Text
84− , label: nes (SProxy ∷ _ "Author")
88+ , label: nes (SProxy ∷ _ "Author")
85− , placeholder: "e.g. William Shakespeare"
89+ , placeholder: "e.g. William Shakespeare"
86− , value: text
90+ , value: text
87− , style: css { width: "280px" }
91+ , style: css { width: "280px" }
88− , onChange: handler targetValue $ traverse_ setText
92+ , onChange: handler targetValue $ traverse_ setText
89− , onBlur: handler_ (setVisible false)
93+ , onBlur: handler_ (setVisible false)
90− , onFocus: handler_ (setVisible true)
94+ , onFocus: handler_ (setVisible true)
91− , trailing: R.text "▼"
95+ , trailing: R.text "▼"
92− , autoComplete: "off"
96+ , autoComplete: "off"
95− elementKeyed motionPopover
97− { initial: Motion.initial $ css { clipPath: "polygon(0% 0%, 100% 0%, 100% 0%, 0% 0%)" }
98− , exit: Motion.exit $ css { clipPath: "polygon(0% 0%, 100% 0%, 100% 0%, 0% 0%)" }
99− , animate: Motion.animate $ css { clipPath: "polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%)" }
99+ elementKeyed motionPopover
102+ css { clipPath: "polygon(0% 0%, 100% 0%, 100% 0%, 0% 0%)" }
104+ css { clipPath: "polygon(0% 0%, 100% 0%, 100% 0%, 0% 0%)" }
107+ { clipPath: "polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%)"
109− { placement: Placement Placement.Bottom (Just Placement.Start)
118+ { placement: Placement Placement.Bottom (Just Placement.Start)
110− , referenceElement
119+ , referenceElement
122+ { boxShadow: "0px 9px 12px rgba(40,40,40,0.5)"
123+ , background: "rgba(50,50,70, 0.7)"
124+ , borderRadius: "9px"
125+ , borderTop: "solid 1px rgba(80,80,100,1.0)"
126+ , overflowY: "scroll"
127+ , maxHeight: "400px"
111− , style:
135+ </ { style:
113− { boxShadow: "0px 9px 12px rgba(40,40,40,0.5)"
114− , background: "rgba(50,50,70, 0.7)"
115− , borderRadius: "9px"
116− , borderTop: "solid 1px rgba(80,80,100,1.0)"
117− , overflowY: "scroll"
118− , maxHeight: "400px"
125− Box.component
140+ motionStack
126− </ { style:
141+ </ Motion.motion {}
127− css
142+ -- { variants: Motion.variants containerVariants
143+ -- , animate: Motion.animate (if visible then containerVariant.visible else containerVariant.hidden)
144+ -- , layout: Motion.layout true
130− stack =
148+ Motion.div
131− motionStack
149+ </ { key: a
133− -- { variants: Motion.variants containerVariants
134− -- , animate: Motion.animate (if visible then containerVariant.visible else containerVariant.hidden)
135 -- , layout: Motion.layout true
150 -- , layout: Motion.layout true
141− -- , layout: Motion.layout true
142− -- , variants: Motion.variants itemVariants
151+ -- , variants: Motion.variants itemVariants
144− /> [ R.text a ]
153+ /> [ R.text a ]
146− $ fragment
155+ $ fragment
147− [ inputWrapper [ input ]
156+ [ inputWrapper [ input ]
148− , animatePresence
157+ , animatePresence
150− /> [ guard visible
159+ /> [ guard visible
153− [ stack (entry <$> matchingAuthors)
162+ [ stack (entry <$> matchingAuthors)
159− itemVariants ∷
168+ itemVariants ∷
160− { hidden ∷ CSS
169+ { hidden ∷ CSS
161− , visible ∷ CSS
170+ , visible ∷ CSS
168− , hidden:
177+ , hidden:
170− { left: -20
179+ { left: -20
174− containerVariants ∷
183+ containerVariants ∷
175− { hidden ∷ CSS
184+ { hidden ∷ CSS
176− , visible ∷ CSS
185+ , visible ∷ CSS
181− { transition: { when: "beforeChildren" }
182− , staggerChildren: 0.3
185− , hidden:
187+ containerVariants =
190+ { transition: { when: "beforeChildren" }
191+ , staggerChildren: 0.3
187− { transition: { when: "afterChildren" }
196+ { transition: { when: "afterChildren" }
188− , opacity: 0
197+ , opacity: 0
192− containerVariant ∷
201+ containerVariant ∷
193− { hidden ∷ Motion.VariantLabel
202+ { hidden ∷ Motion.VariantLabel
194− , visible ∷ Motion.VariantLabel
203+ , visible ∷ Motion.VariantLabel
196− containerVariant = Motion.makeVariantLabels containerVariants
205+ containerVariant = Motion.makeVariantLabels containerVariants
198− authors =
207+ authors =
199− [ "William Shakespeare"
208+ [ "William Shakespeare"
200− , "Agatha Christie"
209+ , "Agatha Christie"
201− , "Barbara Cartland"
210+ , "Barbara Cartland"
202− , "Danielle Steel"
211+ , "Danielle Steel"
203− , "Harold Robbins"
212+ , "Harold Robbins"
204− , "Georges Simenon"
213+ , "Georges Simenon"
205− , "Enid Blyton"
214+ , "Enid Blyton"
206− , "Sidney Sheldon"
215+ , "Sidney Sheldon"
207− , "J. K. Rowling"
216+ , "J. K. Rowling"
208− , "Gilbert Patten"
217+ , "Gilbert Patten"
209− , "Dr. Seuss"
218+ , "Dr. Seuss"
210− , "Eiichiro Oda"
219+ , "Eiichiro Oda"
211− , "Leo Tolstoy"
220+ , "Leo Tolstoy"
212− , "Corín Tellado"
221+ , "Corín Tellado"
213− , "Jackie Collins"
222+ , "Jackie Collins"
214− , "Horatio Alger"
223+ , "Horatio Alger"
215− , "R. L. Stine"
224+ , "R. L. Stine"
216− , "Dean Koontz"
225+ , "Dean Koontz"
217− , "Nora Roberts"
226+ , "Nora Roberts"
218− , "Alexander Pushkin"
227+ , "Alexander Pushkin"
219− , "Stephen King"
228+ , "Stephen King"
220− , "Paulo Coelho"
229+ , "Paulo Coelho"
221− , "Jeffrey Archer"
230+ , "Jeffrey Archer"
222− , "Louis L'Amour"
231+ , "Louis L'Amour"
223− , "Jirō Akagawa"
232+ , "Jirō Akagawa"
224− , "René Goscinny"
233+ , "René Goscinny"
225− , "Erle Stanley Gardner"
234+ , "Erle Stanley Gardner"
226− , "Edgar Wallace"
235+ , "Edgar Wallace"
227− , "Jin Yong"
236+ , "Jin Yong"
228− , "Janet Dailey"
237+ , "Janet Dailey"
229− , "Robert Ludlum"
238+ , "Robert Ludlum"
230− , "Akira Toriyama"
239+ , "Akira Toriyama"
231− , "Osamu Tezuka"
240+ , "Osamu Tezuka"
232− , "James Patterson"
241+ , "James Patterson"
233− , "Frédéric Dard"
242+ , "Frédéric Dard"
234− , "Stan and Jan Berenstain"
243+ , "Stan and Jan Berenstain"
235− , "Roald Dahl"
244+ , "Roald Dahl"
236− , "John Grisham"
245+ , "John Grisham"
237− , "Zane Grey"
246+ , "Zane Grey"
238− , "Irving Wallace"
247+ , "Irving Wallace"
239− , "J. R. R. Tolkien"
248+ , "J. R. R. Tolkien"
240− , "Masashi Kishimoto"
249+ , "Masashi Kishimoto"
241− , "Karl May"
250+ , "Karl May"
242− , "Carter Brown"
251+ , "Carter Brown"
243− , "Mickey Spillane"
252+ , "Mickey Spillane"
244− , "C. S. Lewis"
253+ , "C. S. Lewis"
245− , "Kyotaro Nishimura"
254+ , "Kyotaro Nishimura"
246− , "Mitsuru Adachi"
255+ , "Mitsuru Adachi"
247− , "Rumiko Takahashi"
256+ , "Rumiko Takahashi"
248− , "Gosho Aoyama"
257+ , "Gosho Aoyama"
249− , "Dan Brown"
258+ , "Dan Brown"
250− , "Ann M. Martin"
259+ , "Ann M. Martin"
251− , "Ryōtarō Shiba"
260+ , "Ryōtarō Shiba"
252− , "Arthur Hailey"
261+ , "Arthur Hailey"
253− , "Gérard de Villiers"
262+ , "Gérard de Villiers"
254− , "Beatrix Potter"
263+ , "Beatrix Potter"
255− , "Michael Crichton"
264+ , "Michael Crichton"
256− , "Richard Scarry"
265+ , "Richard Scarry"
257− , "Clive Cussler"
266+ , "Clive Cussler"
258− , "Alistair MacLean"
267+ , "Alistair MacLean"
259− , "Ken Follett"
268+ , "Ken Follett"
260− , "Astrid Lindgren"
269+ , "Astrid Lindgren"
261− , "Debbie Macomber"
270+ , "Debbie Macomber"
262− , "EL James"
271+ , "EL James"
263− , "Tite Kubo"
272+ , "Tite Kubo"
264− , "Eiji Yoshikawa"
273+ , "Eiji Yoshikawa"
265− , "Catherine Cookson"
274+ , "Catherine Cookson"
266− , "Stephenie Meyer"
275+ , "Stephenie Meyer"
267− , "Norman Bridwell"
276+ , "Norman Bridwell"
268− , "David Baldacci"
277+ , "David Baldacci"
269− , "Nicholas Sparks"
278+ , "Nicholas Sparks"
270− , "Hirohiko Araki"
279+ , "Hirohiko Araki"
271− , "Evan Hunter"
280+ , "Evan Hunter"
272− , "Andrew Neiderman"
281+ , "Andrew Neiderman"
273− , "Roger Hargreaves"
282+ , "Roger Hargreaves"
274− , "Anne Rice"
283+ , "Anne Rice"
275− , "Robin Cook"
284+ , "Robin Cook"
276− , "Wilbur Smith"
285+ , "Wilbur Smith"
277− , "Erskine Caldwell"
286+ , "Erskine Caldwell"
278− , "Judith Krantz"
287+ , "Judith Krantz"
279− , "Eleanor Hibbert"
288+ , "Eleanor Hibbert"
280− , "Lewis Carroll"
289+ , "Lewis Carroll"
281− , "Denise Robins"
290+ , "Denise Robins"
282− , "Cao Xueqin"
291+ , "Cao Xueqin"
283− , "Ian Fleming"
292+ , "Ian Fleming"
284− , "Hermann Hesse"
293+ , "Hermann Hesse"
285− , "Rex Stout"
294+ , "Rex Stout"
286− , "Anne Golon"
295+ , "Anne Golon"
287− , "Frank G. Slaughter"
296+ , "Frank G. Slaughter"
288− , "Edgar Rice Burroughs"
297+ , "Edgar Rice Burroughs"
289− , "John Creasey"
298+ , "John Creasey"
290− , "James A. Michener"
299+ , "James A. Michener"
291− , "Yasuo Uchida"
300+ , "Yasuo Uchida"
292− , "Seiichi Morimura"
301+ , "Seiichi Morimura"
293− , "Mary Higgins Clark"
302+ , "Mary Higgins Clark"
294− , "Penny Jordan"
303+ , "Penny Jordan"
295− , "Patricia Cornwell"
304+ , "Patricia Cornwell"