import { PisellContactBrief } from "./PisellContactBrief";
var meta = {
  title: 'Data Display/PisellContactBrief',
  component: PisellContactBrief,
  tags: ['autodocs'],
  decorators: [function (Story) {
    return /*#__PURE__*/React.createElement("div", {
      style: {
        width: 340
      }
    }, /*#__PURE__*/React.createElement(Story, null));
  }],
  argTypes: {
    layout: {
      description: '布局方向',
      control: 'radio',
      options: ['horizontal', 'vertical']
    },
    showAvatar: {
      description: '显示头像',
      control: 'boolean'
    },
    showPhone: {
      description: '显示电话',
      control: 'boolean'
    },
    showEmail: {
      description: '显示邮箱',
      control: 'boolean'
    },
    swipeToDelete: {
      description: '开启左滑删除',
      control: 'boolean'
    }
  }
};
export default meta;
/** 默认：姓名 + 电话 + 邮箱，横向，有编辑图标 */
export var Default = {
  args: {
    name: 'Allen King',
    phone: '+61 412 345 1656',
    email: 'Allenking@pisell.com',
    layout: 'horizontal'
  }
};

/** 无头像（占位） */
export var NoAvatar = {
  args: {
    name: 'Bill Camp',
    phone: '+86 151 0548 2457',
    email: 'Billcamp@pisell.com',
    showAvatar: true,
    avatar: undefined
  }
};

/** 有头像 */
export var WithAvatar = {
  args: {
    name: '张三',
    phone: '+86 138 0000 0000',
    email: 'zhangsan@example.com',
    avatar: 'https://ui-avatars.com/api/?name=Zhang+San&background=4a90d9&color=fff&size=32'
  }
};

/** 竖向布局 */
export var Vertical = {
  args: {
    name: 'Allen King',
    phone: '+61 412 345 1656',
    email: 'Allenking@pisell.com',
    layout: 'vertical'
  }
};

/** 仅姓名 + 电话（无邮箱） */
export var NoEmail = {
  args: {
    name: 'Bill Camp',
    phone: '(+86 151 0548 2457)',
    showEmail: false
  }
};

/** 仅姓名 + 邮箱（无电话） */
export var NoPhone = {
  args: {
    name: 'Bill Camp',
    email: 'Billcamp@pisell.com',
    showPhone: false
  }
};

/** 扩展字段：生日、地址 */
export var WithExtraFields = {
  args: {
    name: 'Bill Camp',
    phone: '+86 151 0548 2457',
    email: 'Billcamp@pisell.com',
    extraFields: [{
      key: 'birthday',
      label: '生日'
    }, {
      key: 'address',
      label: '地址'
    }],
    extraData: {
      birthday: '30 July 1990',
      address: '30 Jersey Parade, suburban, VIC, 3000'
    }
  }
};

/** 左滑删除 */
export var SwipeToDelete = {
  args: {
    name: 'Bill Camp',
    phone: '+86 151 0548 2457',
    email: 'Billcamp@pisell.com',
    swipeToDelete: true,
    onDelete: function onDelete() {
      return console.log('onDelete');
    }
  }
};

/** 编辑提交回调（仅日志） */
export var WithEditSubmit = {
  args: {
    name: '张三',
    phone: '138 0000 0000',
    email: 'zhangsan@example.com',
    onSubmit: function onSubmit(values) {
      return console.log('onSubmit', values);
    }
  }
};

/** 禁用态 */
export var Disabled = {
  args: {
    name: '张三',
    phone: '138 0000 0000',
    email: 'a@b.com',
    disabled: true
  }
};

/** 主文案行数限制为 1 */
export var PrimaryLineClamp = {
  args: {
    name: '非常长的联系人姓名用于测试单行省略效果',
    phone: '138 0000 0000',
    email: 'a@b.com',
    primaryLineClamp: 1
  }
};

/** 新建联系人按钮（CreateButton） */
export var CreateButtonOnly = {
  render: function render() {
    return /*#__PURE__*/React.createElement(PisellContactBrief.CreateButton, {
      onCreate: function onCreate(values) {
        return console.log('onCreate', values);
      }
    });
  }
};

/** 卡片 + 新建按钮（列表场景） */
export var ListWithCreateButton = {
  render: function render() {
    return /*#__PURE__*/React.createElement("div", {
      style: {
        display: 'flex',
        flexDirection: 'column',
        gap: 8,
        width: 340
      }
    }, /*#__PURE__*/React.createElement(PisellContactBrief, {
      name: "Allen King",
      phone: "+61 412 345 1656",
      email: "Allenking@pisell.com",
      onSubmit: function onSubmit(v) {
        return console.log('onSubmit', v);
      }
    }), /*#__PURE__*/React.createElement(PisellContactBrief.CreateButton, {
      onCreate: function onCreate(v) {
        return console.log('onCreate', v);
      }
    }));
  }
};