@@ -10,31 +10,17 @@ import {
1010 Text ,
1111 createListCollection ,
1212 parseColor ,
13+ ColorPicker ,
14+ Select ,
15+ Portal ,
1316} from "@chakra-ui/react" ;
1417import type { ComponentPropsWithoutRef , FormEvent } from "react" ;
1518import { useContext , useLayoutEffect , useState } from "react" ;
1619
1720import { LuCheck as CheckIcon , LuX as CloseIcon } from "react-icons/lu" ;
1821import { Checkbox } from "./ui/checkbox" ;
19- import {
20- ColorPickerArea ,
21- ColorPickerChannelSlider ,
22- ColorPickerContent ,
23- ColorPickerControl ,
24- ColorPickerEyeDropper ,
25- ColorPickerInput ,
26- ColorPickerRoot ,
27- ColorPickerTrigger ,
28- } from "./ui/color-picker" ;
2922import { Field } from "./ui/field" ;
3023import { Radio , RadioGroup } from "./ui/radio" ;
31- import {
32- SelectContent ,
33- SelectItem ,
34- SelectRoot ,
35- SelectTrigger ,
36- SelectValueText ,
37- } from "./ui/select" ;
3824
3925import type { Activity , NonClass } from "../lib/activity" ;
4026import { Timeslot } from "../lib/activity" ;
@@ -219,24 +205,29 @@ function ActivityColor(props: { activity: Activity; onHide: () => void }) {
219205 return (
220206 < Flex gap = { 2 } >
221207 < Flex direction = "row" gap = { 2 } >
222- < ColorPickerRoot
208+ < ColorPicker . Root
223209 value = { color }
224210 onValueChange = { ( e ) => {
225211 setColor ( e . value ) ;
226212 } }
227213 >
228- < ColorPickerControl >
229- < ColorPickerInput autoFocus />
230- < ColorPickerTrigger />
231- </ ColorPickerControl >
232- < ColorPickerContent >
233- < ColorPickerArea />
234- < HStack >
235- < ColorPickerEyeDropper />
236- < ColorPickerChannelSlider channel = "hue" />
237- </ HStack >
238- </ ColorPickerContent >
239- </ ColorPickerRoot >
214+ < ColorPicker . HiddenInput />
215+ < ColorPicker . Control >
216+ < ColorPicker . Input autoFocus />
217+ < ColorPicker . Trigger />
218+ </ ColorPicker . Control >
219+ < Portal >
220+ < ColorPicker . Positioner >
221+ < ColorPicker . Content >
222+ < ColorPicker . Area />
223+ < HStack >
224+ < ColorPicker . EyeDropper />
225+ < ColorPicker . ChannelSlider channel = "hue" />
226+ </ HStack >
227+ </ ColorPicker . Content >
228+ </ ColorPicker . Positioner >
229+ </ Portal >
230+ </ ColorPicker . Root >
240231 < ButtonGroup >
241232 < Button onClick = { onReset } > Reset</ Button >
242233 < Button onClick = { onCancel } > Cancel</ Button >
@@ -347,7 +338,7 @@ function NonClassAddTime(props: { activity: NonClass }) {
347338 } ) ;
348339
349340 const renderTimeDropdown = ( key : "start" | "end" ) => (
350- < SelectRoot
341+ < Select . Root
351342 collection = { timesCollection }
352343 size = "sm"
353344 width = "8rem"
@@ -356,17 +347,28 @@ function NonClassAddTime(props: { activity: NonClass }) {
356347 setTimes ( { ...times , [ key ] : e . value [ 0 ] } ) ;
357348 } }
358349 >
359- < SelectTrigger >
360- < SelectValueText />
361- </ SelectTrigger >
362- < SelectContent >
363- { timesCollection . items . map ( ( time ) => (
364- < SelectItem item = { time } key = { time } >
365- { time }
366- </ SelectItem >
367- ) ) }
368- </ SelectContent >
369- </ SelectRoot >
350+ < Select . HiddenSelect />
351+ < Select . Control >
352+ < Select . Trigger >
353+ < Select . ValueText />
354+ </ Select . Trigger >
355+ < Select . IndicatorGroup >
356+ < Select . Indicator />
357+ </ Select . IndicatorGroup >
358+ </ Select . Control >
359+ < Portal >
360+ < Select . Positioner >
361+ < Select . Content >
362+ { timesCollection . items . map ( ( time ) => (
363+ < Select . Item item = { time } key = { time } >
364+ { time }
365+ < Select . ItemIndicator />
366+ </ Select . Item >
367+ ) ) }
368+ </ Select . Content >
369+ </ Select . Positioner >
370+ </ Portal >
371+ </ Select . Root >
370372 ) ;
371373
372374 return (
0 commit comments