var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: !0 });
}, __copyProps = (to, from, except, desc) => {
  if (from && typeof from == "object" || typeof from == "function")
    for (let key of __getOwnPropNames(from))
      !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
var Alert_exports = {};
__export(Alert_exports, {
  Alert: () => Alert
});
module.exports = __toCommonJS(Alert_exports);
var import_icons_ui = require("@truststack/icons-ui"), import_tamagui = require("tamagui"), import_Icon = require("./Icon"), import_typography = require("./typography"), import_jsx_runtime = require("react/jsx-runtime");
const AlertContext = (0, import_tamagui.createStyledContext)({
  severity: void 0,
  hidden: !1
}), AlertFrame = (0, import_tamagui.styled)(import_tamagui.XStack, {
  name: "Alert",
  context: AlertContext,
  padding: 12,
  flexDirection: "row",
  flexShrink: 1,
  gap: 12,
  variants: {
    // Border width is 0 by default,
    // set attributed `outlined` as true AFTER the severity to apply border
    // e.g. <Alert severity="info" outlined />
    severity: {
      info: {
        bg: "$infoContainer",
        borderColor: "$info",
        borderWidth: 0
      },
      success: {
        bg: "$successContainer",
        borderColor: "$success",
        borderWidth: 0
      },
      error: {
        bg: "$errorContainer",
        borderColor: "$error",
        borderWidth: 0
      },
      warning: {
        bg: "$warningContainer",
        borderColor: "$warning",
        borderWidth: 0
      }
    },
    outlined: {
      true: {
        borderWidth: "$border.outline"
      }
    },
    hidden: {
      true: {
        display: "none"
      }
    },
    shape: {
      none: {
        borderRadius: 0
      },
      xs: {
        borderRadius: "$shape.corner_xs"
      },
      sm: {
        borderRadius: "$shape.corner_sm"
      },
      m: {
        borderRadius: "$shape.corner_m"
      },
      l: {
        borderRadius: "$shape.corner_l"
      },
      xl: {
        borderRadius: "$shape.corner_xl"
      }
    }
  },
  defaultVariants: {
    severity: "info",
    shape: "xs"
  }
}), AlertIcon = (0, import_tamagui.styled)(import_Icon.Icon, {
  context: AlertContext,
  variants: {
    severity: {
      success: {
        Icon: import_icons_ui.Check,
        col: "$onSuccessContainer"
      },
      warning: {
        Icon: import_icons_ui.AlertTriangle,
        col: "$onWarningContainer"
      },
      error: {
        Icon: import_icons_ui.XSquare,
        col: "$onErrorContainer"
      },
      info: {
        Icon: import_icons_ui.AlertCircle,
        col: "$onInfoContainer"
      }
    }
  }
}), variants = {
  severity: {
    info: {
      col: "$onInfoContainer"
    },
    success: {
      col: "$onSuccessContainer"
    },
    error: {
      col: "$onErrorContainer"
    },
    warning: {
      col: "$onWarningContainer"
    }
  }
}, AlertHeading = (0, import_tamagui.styled)(import_typography.Title, {
  name: "AlertHeading",
  context: AlertContext,
  variants: {
    ...variants
  }
}), AlertText = (0, import_tamagui.styled)(import_typography.Body, {
  name: "AlertText",
  context: AlertContext,
  variants: {
    ...variants
  }
}), AlertLiDot = (0, import_tamagui.styled)(import_tamagui.View, {
  name: "AlertLiDot",
  context: AlertContext,
  width: 6,
  height: 6,
  borderRadius: 100,
  variants: {
    severity: {
      info: {
        backgroundColor: "$onInfoContainer"
      },
      success: {
        backgroundColor: "$onSuccessContainer"
      },
      error: {
        backgroundColor: "$onErrorContainer"
      },
      warning: {
        backgroundColor: "$onWarningContainer"
      }
    }
  }
}), AlertLi = AlertText.styleable((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.XStack, { gap: 12, children: [
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.View, { marginTop: 8, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertLiDot, {}) }),
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertText, { ref, ...props })
] })), Container = (0, import_tamagui.styled)(import_tamagui.YStack, {
  name: "AlertContainer",
  minWidth: 0,
  flex: 1
}), Actions = (0, import_tamagui.styled)(import_tamagui.XStack, {
  name: "AlertActions",
  justifyContent: "flex-end",
  marginTop: 12
}), Alert = (0, import_tamagui.withStaticProperties)(AlertFrame, {
  Props: AlertContext.Provider,
  Heading: AlertHeading,
  Container,
  Text: AlertText,
  Icon: AlertIcon,
  Li: AlertLi,
  Actions
});
//# sourceMappingURL=Alert.js.map
