import _defineProperty from "@babel/runtime/helpers/defineProperty";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["type", "shape", "preIcon", "postIcon", "disabled", "styleType", "loading", "extra", "children"];
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
import "core-js/modules/es.symbol.js";
import "core-js/modules/es.array.filter.js";
import "core-js/modules/es.array.for-each.js";
import "core-js/modules/es.array.map.js";
import "core-js/modules/es.array.push.js";
import "core-js/modules/es.object.define-properties.js";
import "core-js/modules/es.object.define-property.js";
import "core-js/modules/es.object.get-own-property-descriptor.js";
import "core-js/modules/es.object.get-own-property-descriptors.js";
import "core-js/modules/es.object.keys.js";
import "core-js/modules/es.object.to-string.js";
import "core-js/modules/esnext.iterator.constructor.js";
import "core-js/modules/esnext.iterator.filter.js";
import "core-js/modules/esnext.iterator.for-each.js";
import "core-js/modules/web.dom-collections.for-each.js";
import { FcrButton } from '.';
import { FcrIconType } from '../icon/type';
import { FcrActionButton } from './action';
import React from 'react';
import { useI18n } from '../../i18n';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
var meta = {
  title: 'Components/Button',
  tags: ['autodocs'],
  argTypes: {
    text: {
      control: 'text',
      defaultValue: 'text'
    },
    type: {
      control: 'radio',
      options: ['primary', 'secondary', 'text', 'link'],
      defaultValue: 'primary'
    },
    shape: {
      control: 'radio',
      options: ['circle', 'rounded'],
      defaultValue: 'circle'
    },
    loading: {
      control: 'boolean',
      defaultValue: false
    },
    preIcon: {
      control: 'boolean',
      defaultValue: false
    },
    postIcon: {
      control: 'boolean',
      defaultValue: false
    },
    disabled: {
      control: 'boolean',
      defaultValue: false
    },
    styleType: {
      control: 'radio',
      options: ['danger', 'gray', 'white']
    },
    extra: {
      control: 'text',
      defaultValue: ''
    }
  }
};
export var Basic = {
  args: {
    children: 'Test Button'
  },
  render: function render(props) {
    var sizes = ['XL', 'L', 'M', 'S', 'XS', 'XXS'];
    var type = props.type,
      shape = props.shape,
      preIcon = props.preIcon,
      postIcon = props.postIcon,
      disabled = props.disabled,
      styleType = props.styleType,
      loading = props.loading,
      extra = props.extra,
      children = props.children,
      others = _objectWithoutProperties(props, _excluded);
    var t = useI18n();
    return /*#__PURE__*/_jsxs("div", {
      style: {
        display: 'flex',
        flexDirection: 'column',
        padding: 20
      },
      children: [/*#__PURE__*/_jsxs("div", {
        children: [/*#__PURE__*/_jsxs("div", {
          children: [/*#__PURE__*/_jsx("h3", {
            children: "type"
          }), /*#__PURE__*/_jsxs("div", {
            style: {
              display: 'flex',
              gap: '10px'
            },
            children: [/*#__PURE__*/_jsx(FcrButton, {
              styleType: "danger",
              type: "primary",
              children: "primary"
            }), /*#__PURE__*/_jsx(FcrButton, {
              type: "secondary",
              children: "secondary"
            }), /*#__PURE__*/_jsx(FcrButton, {
              type: "secondary-bordered",
              children: "secondary-bordered"
            }), /*#__PURE__*/_jsx(FcrButton, {
              type: "gray",
              children: "gray"
            }), /*#__PURE__*/_jsx(FcrButton, {
              type: "text",
              children: "text"
            }), /*#__PURE__*/_jsx(FcrButton, {
              type: "link",
              children: "link"
            })]
          })]
        }), /*#__PURE__*/_jsxs("div", {
          children: [/*#__PURE__*/_jsx("h3", {
            children: "shape"
          }), /*#__PURE__*/_jsxs("div", {
            style: {
              display: 'flex',
              gap: '10px'
            },
            children: [/*#__PURE__*/_jsx(FcrButton, {
              shape: "circle",
              children: "circle"
            }), /*#__PURE__*/_jsx(FcrButton, {
              shape: "rounded",
              children: "rounded"
            })]
          })]
        })]
      }), /*#__PURE__*/_jsxs("div", {
        style: {
          marginLeft: 20
        },
        children: [/*#__PURE__*/_jsx("h3", {
          children: "Size"
        }), /*#__PURE__*/_jsx("div", {
          style: {
            display: 'flex',
            flexDirection: 'column',
            gap: '10px'
          },
          children: sizes.map(function (size) {
            return /*#__PURE__*/_jsx(FcrButton, _objectSpread(_objectSpread({
              onClick: function onClick() {
                console.log('click');
              },
              extra: extra,
              size: size,
              loading: loading,
              disabled: disabled,
              type: type,
              shape: shape,
              preIcon: preIcon && FcrIconType.FCR_HOST,
              postIcon: postIcon && FcrIconType.FCR_HOST,
              styleType: styleType
            }, others), {}, {
              children: children
            }), size);
          })
        })]
      }), /*#__PURE__*/_jsxs("div", {
        children: [/*#__PURE__*/_jsx("h3", {
          children: "action"
        }), /*#__PURE__*/_jsxs("div", {
          style: {
            display: 'flex',
            alignItems: 'center',
            gap: 5
          },
          children: [/*#__PURE__*/_jsx(FcrActionButton, {
            iconType: FcrIconType.FCR_DROPDOWN,
            children: t('fmt_participants_member_button_more')
          }), /*#__PURE__*/_jsx(FcrActionButton, {
            iconType: FcrIconType.FCR_DROPDOWN,
            active: true,
            children: t('fmt_participants_member_button_more')
          }), /*#__PURE__*/_jsx(FcrActionButton, {
            size: "small",
            children: t('fmt_device_label_audio_unmute')
          }), /*#__PURE__*/_jsx(FcrActionButton, {
            size: "small",
            iconType: FcrIconType.FCR_MOBILE_MORE
          }), /*#__PURE__*/_jsx(FcrActionButton, {
            active: true,
            children: t('fmt_device_label_audio_unmute')
          }), /*#__PURE__*/_jsx(FcrActionButton, {
            styleType: "primary",
            children: t('fmt_device_label_audio_mute')
          }), /*#__PURE__*/_jsx(FcrActionButton, {
            iconType: FcrIconType.FCR_MOBILE_MORE
          })]
        })]
      })]
    });
  }
};
export default meta;