import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { createElement as _createElement } from "react";
import { Dimensions } from "react-native";
import { ScrollView, Dialog as TDialog, View, XStack, YStack, styled, useThemeName } from "tamagui";
import { Dialog } from "./Dialog.native.js";
import { Divider } from "./Divider.native.js";
function SideSheet(param) {
  var {
      open,
      onOpenChange,
      children,
      title,
      Action,
      width = 400,
      ...props
    } = param,
    theme = useThemeName();
  return /* @__PURE__ */_jsx(Dialog, {
    open,
    onOpenChange,
    children: /* @__PURE__ */_jsxs(Dialog.Portal, {
      children: [/* @__PURE__ */_jsx(Dialog.Overlay, {}, "overlay"), /* @__PURE__ */_createElement(Container, {
        ...props,
        theme,
        width,
        key: "sheet-container",
        enterStyle: {
          x: width
        },
        exitStyle: {
          x: width
        }
      }, /* @__PURE__ */_jsxs(YStack, {
        pt: 24,
        pl: 16,
        pr: 24,
        h: "100%",
        gap: 8,
        fg: 1,
        children: [/* @__PURE__ */_jsx(ScrollView, {
          showsVerticalScrollIndicator: !1,
          children
        }), /* @__PURE__ */_jsx(View, {
          fg: 1
        }), Action && /* @__PURE__ */_jsxs(View, {
          ml: -16,
          mr: -24,
          children: [/* @__PURE__ */_jsx(Divider, {
            w: "100%",
            mb: 4
          }), /* @__PURE__ */_jsx(XStack, {
            bottom: 0,
            justifyContent: "flex-end",
            px: 24,
            py: 16,
            children: Action
          })]
        })]
      }))]
    }, "portal")
  });
}
var {
    height: HEIGHT
  } = Dimensions.get("window"),
  Container = styled(TDialog.Content, {
    name: "SideSheetContainer",
    elevate: !0,
    animateOnly: ["width"],
    bblr: "$shape.corner_l",
    btlr: "$shape.corner_l",
    btrr: 0,
    bbrr: 0,
    style: {
      position: "fixed"
    },
    right: 0,
    top: 0,
    height: HEIGHT,
    maxHeight: HEIGHT,
    backgroundColor: "$surface",
    animation: "medium",
    overflow: "hidden",
    enterStyle: {
      x: 400
    },
    exitStyle: {
      x: 800
    }
  });
export { SideSheet };
//# sourceMappingURL=SideSheet.native.js.map
