11'use client' ;
2+ import { Times } from '@primeicons/react/times' ;
23import { usePopoverOpenChangeEvent } from '@primereact/types/shared/popover' ;
34import { Button } from '@primereact/ui/button' ;
45import { InputText } from '@primereact/ui/inputtext' ;
5- import { Label } from '@primereact/ui/label' ;
66import { Popover } from '@primereact/ui/popover' ;
77import React from 'react' ;
88
9- function ControlledDemo ( ) {
9+ export default function ControlledDemo ( ) {
1010 const [ open , setOpen ] = React . useState ( false ) ;
1111
1212 return (
@@ -16,32 +16,31 @@ function ControlledDemo() {
1616 < Popover . Root open = { open } onOpenChange = { ( e : usePopoverOpenChangeEvent ) => setOpen ( e . value ) } >
1717 < Popover . Trigger > Popover Trigger</ Popover . Trigger >
1818 < Popover . Portal >
19- < Popover . Content >
20- < div className = "flex flex-col gap-2 p-2 max-w-xs" >
21- < p className = "text-lg font-semibold mb-0.5" > Dimensions</ p >
22- < div className = "grid grid-cols-2 items-center" >
23- < Label htmlFor = "width" > Width</ Label >
24- < InputText id = "width" fluid />
25- </ div >
26- < div className = "grid grid-cols-2 items-center" >
27- < Label htmlFor = "maxWidth" > Max. width</ Label >
28- < InputText id = "maxWidth" fluid />
29- </ div >
30- < div className = "grid grid-cols-2 items-center" >
31- < Label htmlFor = "height" > Height</ Label >
32- < InputText id = "height" fluid />
33- </ div >
34- < div className = "grid grid-cols-2 items-center" >
35- < Label htmlFor = "maxHeight" > Max. height</ Label >
36- < InputText id = "maxHeight" fluid />
37- </ div >
38- </ div >
39- < Popover . Close className = "absolute top-4 right-4" />
40- </ Popover . Content >
19+ < Popover . Positioner sideOffset = { 12 } >
20+ < Popover . Popup className = "max-w-72 w-full" >
21+ < Popover . Header >
22+ < Popover . Title > Create a New Workspace</ Popover . Title >
23+ < Popover . Close as = { Button } severity = "secondary" variant = "text" size = "small" iconOnly >
24+ < Times />
25+ </ Popover . Close >
26+ </ Popover . Header >
27+ < Popover . Content >
28+ < Popover . Description > Name your workspace to get started. You can always change this later.</ Popover . Description >
29+ < InputText placeholder = "Workspace Name" className = "mt-3 w-full" />
30+ </ Popover . Content >
31+ < Popover . Footer >
32+ < span className = "text-xs text-surface-500 dark:text-surface-400 " > 1 of 3</ span >
33+ < div className = "flex-1 flex items-center justify-end gap-2" >
34+ < Button severity = "secondary" variant = "outlined" size = "small" >
35+ Back
36+ </ Button >
37+ < Button size = "small" > Next</ Button >
38+ </ div >
39+ </ Popover . Footer >
40+ </ Popover . Popup >
41+ </ Popover . Positioner >
4142 </ Popover . Portal >
4243 </ Popover . Root >
4344 </ div >
4445 ) ;
4546}
46-
47- export default ControlledDemo ;
0 commit comments