"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var Button_stories_exports = {};
__export(Button_stories_exports, {
  Default: () => Default,
  Expand: () => Expand,
  IconButton: () => IconButton,
  Inverted: () => Inverted,
  Overview: () => Overview,
  default: () => Button_stories_default
});
module.exports = __toCommonJS(Button_stories_exports);
var import_react = __toESM(require("react"));
var import_index = __toESM(require("./index"));
var import_Text = __toESM(require("../../asorted/Text"));
var import_reactLegacy = require("@ledgerhq/icons-ui/reactLegacy");
var import_InvertTheme = require("../../../styles/InvertTheme");
var import_Flex = __toESM(require("../../layout/Flex"));
var import_Grid = __toESM(require("../../layout/Grid"));
const iconPositions = ["left", "right"];
const buttonVariants = ["main", "shade", "color", "error"];
var Button_stories_default = {
  title: "cta/Button",
  component: import_index.default,
  argTypes: {
    variant: {
      options: [void 0, ...buttonVariants],
      control: {
        type: "radio"
      }
    },
    size: {
      options: [void 0, "small", "medium", "large"],
      control: { type: "radio" }
    },
    fontSize: {
      options: [void 0, 0, 1, 2, 3, 4, 5, 6, 7, 8],
      control: {
        type: "radio"
      }
    },
    children: {
      type: "text"
    },
    iconPosition: {
      options: iconPositions,
      control: {
        type: "radio"
      }
    },
    disabled: {
      type: "boolean"
    },
    outline: {
      type: "boolean"
    }
  }
};
const Overview = ((args) => {
  const templateProps = { Icon: import_reactLegacy.PlusMedium, children: "Try me", onClick: () => {
  } };
  const propsArr = [
    { ...templateProps, Icon: void 0 },
    { ...templateProps, iconPosition: iconPositions[0] },
    { ...templateProps, iconPosition: iconPositions[1] },
    { ...templateProps, children: "" }
  ];
  return /* @__PURE__ */ import_react.default.createElement(import_Grid.default, { columns: "none", gridTemplateColumns: "max-content repeat(4, 1fr)", columnGap: 8, rowGap: 8 }, buttonVariants.flatMap(
    (buttonType, i) => [false, true].map((outline, j) => /* @__PURE__ */ import_react.default.createElement(import_react.Fragment, { key: `${i}:${j}` }, /* @__PURE__ */ import_react.default.createElement(import_Text.default, { variant: "small", color: "neutral.c70" }, 'variant="', buttonType, '"', /* @__PURE__ */ import_react.default.createElement("br", null), "outline=", `{${outline.toString()}}`), propsArr.map((buttonProps) => /* @__PURE__ */ import_react.default.createElement(import_Flex.default, { flex: 1, columnGap: 4 }, [false, true].map((disabled) => /* @__PURE__ */ import_react.default.createElement(
      import_index.default,
      {
        size: args.size,
        variant: buttonType,
        outline,
        disabled,
        ...buttonProps
      }
    ))))))
  ));
}).bind({});
const Default = (args) => {
  return /* @__PURE__ */ import_react.default.createElement(import_index.default, { ...args }, args.children || "Regular button");
};
const Inverted = (args) => {
  return /* @__PURE__ */ import_react.default.createElement(import_Flex.default, { flexDirection: "column" }, /* @__PURE__ */ import_react.default.createElement(import_Flex.default, { flex: "0 0 1", p: 4, alignItems: "center", bg: "background.main" }, /* @__PURE__ */ import_react.default.createElement(import_index.default, { ...args }, args.children || "Regular button")), /* @__PURE__ */ import_react.default.createElement(import_InvertTheme.InvertTheme, null, /* @__PURE__ */ import_react.default.createElement(import_Flex.default, { flex: "0 0 1", p: 4, alignItems: "center", bg: "background.main" }, /* @__PURE__ */ import_react.default.createElement(import_index.default, { ...args }, args.children || "Inverted button"))));
};
const IconButton = (args) => {
  return /* @__PURE__ */ import_react.default.createElement(import_index.default, { ...args }, args.children || "Regular button");
};
IconButton.args = {
  children: "",
  Icon: import_reactLegacy.WalletAddMedium,
  iconPosition: "right"
};
const Expand = (args) => {
  const [show, setShow] = import_react.default.useState(false);
  return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(import_index.default.Expand, { ...args, onToggle: setShow }, args.children), show && /* @__PURE__ */ import_react.default.createElement(
    "div",
    {
      style: {
        padding: "1rem"
      }
    },
    "Hello world!"
  ));
};
Expand.args = {
  children: "Show all"
};
//# sourceMappingURL=Button.stories.js.map
