import{n as e,r as t}from"./rolldown-runtime-C0FnF6B9.js";import{t as n}from"./react-C21x__mS.js";import{n as r}from"./iframe-DaN-XFub.js";import{n as i,t as a}from"./Popover-D6gSyjaW.js";import{n as o,t as s}from"./Button-mjF9HSg0.js";import{c,t as l}from"./Input-Co--DMHY.js";var u=t({AnchorPlacement:()=>g,Controlled:()=>h,Default:()=>m,WithInteractiveContent:()=>_,__namedExportsOrder:()=>v,default:()=>p}),d,f,p,m,h,g,_,v;function y(){return(y=e((()=>{d=n(),o(),c(),i(),f=r(),p={title:`Shared/UI/Popover`,component:a,parameters:{atomicCanvas:!0,layout:`centered`}},m={render:()=>(0,f.jsxs)(a,{children:[(0,f.jsx)(a.Trigger,{children:(0,f.jsx)(`button`,{children:`Открыть`})}),(0,f.jsx)(a.Content,{children:e=>(0,f.jsxs)(`div`,{style:{padding:12,maxWidth:160},children:[(0,f.jsx)(`p`,{children:`Пример простого поповера`}),(0,f.jsx)(`button`,{onClick:e.setClose,children:`Закрыть`})]})})]})},h={render:()=>{let[e,t]=(0,d.useState)(!1);return(0,f.jsxs)(a,{open:e,onOpenChange:t,children:[(0,f.jsx)(a.Trigger,{children:(0,f.jsx)(`button`,{children:e?`Закрыть`:`Открыть`})}),(0,f.jsx)(a.Content,{children:(0,f.jsx)(`div`,{style:{padding:12},children:`Контролируемый режим`})})]})}},g={render:()=>(0,f.jsx)(`div`,{style:{display:`flex`,gap:32,flexWrap:`wrap`,justifyContent:`center`},children:[`top`,`bottom`,`left`,`right`,`top-start`,`bottom-end`].map(e=>(0,f.jsxs)(a,{placement:e,children:[(0,f.jsx)(a.Trigger,{children:(0,f.jsx)(`button`,{children:e})}),(0,f.jsx)(a.Content,{children:(0,f.jsx)(`div`,{style:{padding:8},children:e})})]},e))})},_={render:()=>(0,f.jsxs)(a,{children:[(0,f.jsx)(a.Trigger,{children:(0,f.jsx)(`button`,{children:`Форма`})}),(0,f.jsx)(a.Content,{children:e=>(0,f.jsxs)(`form`,{onSubmit:t=>{t.preventDefault(),e.setClose()},style:{display:`flex`,flexDirection:`column`,gap:8,padding:12,width:180},children:[(0,f.jsx)(l,{label:`Имя`,placeholder:`Введите имя`,value:``,onChange:()=>{}}),(0,f.jsx)(s,{children:`Отправить`})]})})]})},m.parameters={...m.parameters,docs:{...m.parameters?.docs,source:{originalSource:`{
  render: () => <Popover>
            <Popover.Trigger>
                <button>Открыть</button>
            </Popover.Trigger>
            <Popover.Content>
                {ctx => <div style={{
        padding: 12,
        maxWidth: 160
      }}>
                        <p>Пример простого поповера</p>
                        <button onClick={ctx.setClose}>Закрыть</button>
                    </div>}
            </Popover.Content>
        </Popover>
}`,...m.parameters?.docs?.source}}},h.parameters={...h.parameters,docs:{...h.parameters?.docs,source:{originalSource:`{
  render: () => {
    const [open, setOpen] = useState(false);
    return <Popover open={open} onOpenChange={setOpen}>
                <Popover.Trigger>
                    <button>{open ? "Закрыть" : "Открыть"}</button>
                </Popover.Trigger>
                <Popover.Content>
                    <div style={{
          padding: 12
        }}>Контролируемый режим</div>
                </Popover.Content>
            </Popover>;
  }
}`,...h.parameters?.docs?.source}}},g.parameters={...g.parameters,docs:{...g.parameters?.docs,source:{originalSource:`{
  render: () => <div style={{
    display: "flex",
    gap: 32,
    flexWrap: "wrap",
    justifyContent: "center"
  }}>
            {["top", "bottom", "left", "right", "top-start", "bottom-end"].map(pos => <Popover key={pos} placement={pos as Placement}>
                    <Popover.Trigger>
                        <button>{pos}</button>
                    </Popover.Trigger>
                    <Popover.Content>
                        <div style={{
          padding: 8
        }}>{pos}</div>
                    </Popover.Content>
                </Popover>)}
        </div>
}`,...g.parameters?.docs?.source}}},_.parameters={..._.parameters,docs:{..._.parameters?.docs,source:{originalSource:`{
  render: () => <Popover>
            <Popover.Trigger>
                <button>Форма</button>
            </Popover.Trigger>
            <Popover.Content>
                {ctx => <form onSubmit={e => {
        e.preventDefault();
        ctx.setClose();
      }} style={{
        display: "flex",
        flexDirection: "column",
        gap: 8,
        padding: 12,
        width: 180
      }}>
                        <Input label="Имя" placeholder="Введите имя" value={""} onChange={() => {}} />
                        <Button>Отправить</Button>
                    </form>}
            </Popover.Content>
        </Popover>
}`,..._.parameters?.docs?.source}}},v=[`Default`,`Controlled`,`AnchorPlacement`,`WithInteractiveContent`]})))()}export{_ as a,u as i,h as n,y as o,m as r,g as t};