import{j as e}from"./assertThisInitialized-ClXgY4BW.js";import{A as j}from"./utils-CkyKHvS2.js";import{d as S,u as h}from"./dataProvider-BSMCbdJg.js";import{r as B}from"./api-D469Uxm1.js";import{E as s}from"./EditButton-DudJBc_J.js";import{A as P}from"./AdminContext-jMMnnv4u.js";import{d as b}from"./defaultI18nProvider-C_r1y4tu.js";import{R as O}from"./ResourceContextProvider-_t2ysSg2.js";import{R}from"./useRecordContext-CmNI-aHo.js";import"./index-BP8_t0zE.js";import"./useResourceDefinitionContext-mEDLreK0.js";import"./createSvgIcon-BeVLBbd8.js";import"./createSvgIcon-C1LdFc73.js";import"./index-qEiLzbkV.js";import"./index-BCKAMao3.js";import"./Button-C3j8Wgdd.js";import"./useResourceContext-BI9mATY-.js";import"./PreferencesEditorContext-oPOmBo-a.js";const N={title:"Buttons/EditButton",component:j,args:{label:"Edit"},argTypes:{label:{control:"text"},variant:{control:"select",options:["text","outlined","contained"]},icon:{control:"text"},scrollToTop:{control:"boolean"}},decorators:[r=>y(r)]},t={render:({...r})=>e.jsx(s,{...r})},o={render:({...r})=>e.jsx(s,{...r}),args:{variant:"outlined"}},n={render:({...r})=>e.jsx(s,{...r}),args:{variant:"contained"}},a={name:"Edit with predefined record attributes",render:({...r})=>e.jsx(s,{...r}),args:{state:B({})},decorators:[r=>e.jsx(r,{})]},y=r=>e.jsx(P,{dataProvider:S,i18nProvider:b,children:e.jsx(O,{value:"users",children:e.jsx(R,{value:h[0],children:e.jsx(r,{})})})});var i,d,p;t.parameters={...t.parameters,docs:{...(i=t.parameters)==null?void 0:i.docs,source:{originalSource:`{
  render: ({
    ...props
  }) => {
    return <EditButton {...props} />;
  }
}`,...(p=(d=t.parameters)==null?void 0:d.docs)==null?void 0:p.source}}};var c,m,u;o.parameters={...o.parameters,docs:{...(c=o.parameters)==null?void 0:c.docs,source:{originalSource:`{
  render: ({
    ...props
  }) => {
    return <EditButton {...props} />;
  },
  args: {
    variant: "outlined"
  }
}`,...(u=(m=o.parameters)==null?void 0:m.docs)==null?void 0:u.source}}};var l,x,f;n.parameters={...n.parameters,docs:{...(l=n.parameters)==null?void 0:l.docs,source:{originalSource:`{
  render: ({
    ...props
  }) => {
    return <EditButton {...props} />;
  },
  args: {
    variant: "contained"
  }
}`,...(f=(x=n.parameters)==null?void 0:x.docs)==null?void 0:f.source}}};var g,v,E;a.parameters={...a.parameters,docs:{...(g=a.parameters)==null?void 0:g.docs,source:{originalSource:`{
  name: "Edit with predefined record attributes",
  render: ({
    ...props
  }) => {
    return <EditButton {...props} />;
  },
  args: {
    state: replaceOnGenerate({}, {
      record: {
        /*default record*/
      }
    })
  },
  decorators: [Story => <Story />]
}`,...(E=(v=a.parameters)==null?void 0:v.docs)==null?void 0:E.source}}};const Q=["Default","Outlined","Filled","WithState"];export{t as Default,n as Filled,o as Outlined,a as WithState,Q as __namedExportsOrder,N as default};
