(props: PopoverRootProps)
| 102 | /// - `data-state`: Indicates if the popover is open or closed. Values are `open` or `closed`. |
| 103 | #[component] |
| 104 | pub fn PopoverRoot(props: PopoverRootProps) -> Element { |
| 105 | let labelledby = use_unique_id(); |
| 106 | let gen_root_id = use_unique_id(); |
| 107 | let root_id = use_id_or(gen_root_id, props.id); |
| 108 | |
| 109 | let (open, set_open) = use_controlled(props.open, props.default_open, props.on_open_change); |
| 110 | |
| 111 | use_context_provider(|| PopoverCtx { |
| 112 | open, |
| 113 | set_open, |
| 114 | is_modal: props.is_modal, |
| 115 | labelledby, |
| 116 | root_id, |
| 117 | }); |
| 118 | |
| 119 | rsx! { |
| 120 | div { |
| 121 | id: root_id, |
| 122 | "data-state": if open() { "open" } else { "closed" }, |
| 123 | ..props.attributes, |
| 124 | {props.children} |
| 125 | } |
| 126 | } |
| 127 | } |
| 128 | |
| 129 | /// The props for the [`PopoverContent`] component. |
| 130 | #[derive(Props, Clone, PartialEq)] |
nothing calls this directly
no test coverage detected