summaryrefslogtreecommitdiffhomepage
path: root/cloud/web/src/ui/dialog.tsx
blob: 101f23d2ba49fd6458e2061e4c830b0e3cdb3f45 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { Dialog as Kobalte } from "@kobalte/core/dialog"
import { ComponentProps, ParentProps } from "solid-js"

export type Props = ParentProps<{
  size?: "sm" | "md"
  transition?: boolean
}> &
  ComponentProps<typeof Kobalte>

export function Dialog(props: Props) {
  return (
    <Kobalte {...props}>
      <Kobalte.Portal>
        <Kobalte.Overlay data-component="dialog-overlay" />
        <div data-component="dialog-center">
          <Kobalte.Content
            data-transition={props.transition ? "" : undefined}
            data-size={props.size}
            data-slot="content"
          >
            {props.children}
          </Kobalte.Content>
        </div>
      </Kobalte.Portal>
    </Kobalte>
  )
}