feat(docs/popover-preview): final version of preview for playground

This commit is contained in:
p-sw 2024-07-12 02:56:15 +09:00
parent 8e7ee48266
commit 3338fc65e2

View File

@ -1,5 +1,6 @@
import { Button } from "@pswui/Button"; import { Button } from "@pswui/Button";
import { Popover, PopoverContent, PopoverTrigger } from "@pswui/Popover"; import { Popover, PopoverContent, PopoverTrigger } from "@pswui/Popover";
/* remove */
export interface ControlledPopoverDemoProps { export interface ControlledPopoverDemoProps {
PopoverProps: { PopoverProps: {
@ -15,12 +16,18 @@ export interface ControlledPopoverDemoProps {
}; };
} }
/* end */
/* replace */
export function PopoverDemo({ export function PopoverDemo({
PopoverProps, PopoverProps,
PopoverContentProps, PopoverContentProps,
}: ControlledPopoverDemoProps) { }: ControlledPopoverDemoProps) {
/* with
export function PopoverDemo() {
*/
return ( return (
<Popover {...PopoverProps}> <Popover opened={PopoverProps.opened}>
<PopoverTrigger> <PopoverTrigger>
<Button size="icon"> <Button size="icon">
<svg <svg
@ -37,7 +44,14 @@ export function PopoverDemo({
</svg> </svg>
</Button> </Button>
</PopoverTrigger> </PopoverTrigger>
<PopoverContent {...PopoverContentProps}> <PopoverContent
direction={PopoverContentProps.direction}
position={PopoverContentProps.position}
anchor={PopoverContentProps.anchor}
align={PopoverContentProps.align}
offset={PopoverContentProps.offset}
className={PopoverContentProps.className}
>
<Button <Button
preset="ghost" preset="ghost"
className="gap-2" className="gap-2"