import{n as e,o as t}from"./rolldown-runtime-C0FnF6B9.js";import{t as n}from"./react-C21x__mS.js";import{n as r,t as i}from"./check-fB4gCKB_.js";import{n as a,t as o}from"./CheckBox-Clpeg9q7.js";import{n as s,t as c}from"./refresh-cw-BN3JCsXv.js";import{n as l,t as u}from"./settings-2-jtcbbWm5.js";import{i as d,n as f,r as p}from"./iframe-DaN-XFub.js";import{a as m,i as h}from"./utils-DUM89eIj.js";import{n as g,t as _}from"./Button-mjF9HSg0.js";import{a as v,c as y}from"./Input-Co--DMHY.js";import{n as b,t as x}from"./Select-X_O4M8Hi.js";import{n as S,t as ee}from"./OneStepScroller-BSvYN6QP.js";var C,w;function T(){return(T=e((()=>{d(),C=[[`path`,{d:`m11 17-5-5 5-5`,key:`13zhaf`}],[`path`,{d:`m18 17-5-5 5-5`,key:`h8a8et`}]],w=p(`chevrons-left`,C)})))()}var E,D;function O(){return(O=e((()=>{d(),E=[[`path`,{d:`m6 17 5-5-5-5`,key:`xnjwq`}],[`path`,{d:`m13 17 5-5-5-5`,key:`17xmmf`}]],D=p(`chevrons-right`,E)})))()}var k,A;function j(){return(j=e((()=>{d(),k=[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]],A=p(`search`,k)})))()}var M,te,N,P,F,I,L;function R(){return(R=e((()=>{M=`sj-rIq`,te=`_3anR7j`,N=`gMRIsT`,P=`f5Pv1e`,F=`q7eZzv`,I=`maUL24`,L={expandableActionPanel:M,content:te,contentScroller:N,labeledPanel:P,label:F,labeledActionPanel:I}})))()}function z({children:e,className:t,contentClassName:n,toggleClassName:r,open:i,defaultOpen:a=!1,disabled:o,onOpenChange:s,expandLabel:c=`Раскрыть панель действий влево`,collapseLabel:l=`Свернуть панель действий`,panelLabel:u=`Действия панели`,itemSelector:d,scrollPadding:f,smoothScroll:p}){let[h,g]=(0,B.useState)(a),v=(0,B.useId)(),y=i!==void 0,b=y?i:h,x=(0,B.useCallback)(e=>{let t=typeof e==`function`?e(b):e;y||g(t),s?.(t)},[y,s,b]),S=()=>x(e=>!e),C=b?D:w;return(0,V.jsxs)(`div`,{className:m(L.expandableActionPanel,t),"data-ui":`expandable-action-panel`,"data-open":b?``:void 0,children:[(0,V.jsx)(_,{className:r,icon:(0,V.jsx)(C,{}),title:b?l:c,disabled:o,variant:`neutralOutline`,"aria-expanded":b,"aria-controls":v,"data-ui":`expandable-action-panel-toggle`,"data-action":b?`collapse-action-panel`:`expand-action-panel`,onClick:S}),b&&(0,V.jsx)(`div`,{id:v,role:`group`,"aria-label":u,className:m(L.content,n),children:(0,V.jsx)(ee,{className:L.contentScroller,itemSelector:d,scrollPadding:f,smooth:p,children:e})})]})}var B,V;function H(){return(H=e((()=>{B=t(n(),1),h(),T(),O(),g(),S(),R(),V=f(),z.__docgenInfo={description:`Горизонтальная раскрывающаяся панель действий.
Не знает о внешнем layout и может использоваться рядом с любым содержимым.`,methods:[],displayName:`ExpandableActionPanel`,props:{className:{required:!1,tsType:{name:`string`},description:``},contentClassName:{required:!1,tsType:{name:`string`},description:``},toggleClassName:{required:!1,tsType:{name:`string`},description:``},open:{required:!1,tsType:{name:`boolean`},description:``},defaultOpen:{required:!1,tsType:{name:`boolean`},description:``,defaultValue:{value:`false`,computed:!1}},disabled:{required:!1,tsType:{name:`boolean`},description:``},onOpenChange:{required:!1,tsType:{name:`signature`,type:`function`,raw:`(open: boolean) => void`,signature:{arguments:[{type:{name:`boolean`},name:`open`}],return:{name:`void`}}},description:``},expandLabel:{required:!1,tsType:{name:`string`},description:``,defaultValue:{value:`"Раскрыть панель действий влево"`,computed:!1}},collapseLabel:{required:!1,tsType:{name:`string`},description:``,defaultValue:{value:`"Свернуть панель действий"`,computed:!1}},panelLabel:{required:!1,tsType:{name:`string`},description:``,defaultValue:{value:`"Действия панели"`,computed:!1}},itemSelector:{required:!1,tsType:{name:`string`},description:``},scrollPadding:{required:!1,tsType:{name:`number`},description:``},smoothScroll:{required:!1,tsType:{name:`boolean`},description:``}},composes:[`PropsWithChildren`]}})))()}function U({label:e,className:t,labelClassName:n,labelStyle:r,labelMinWidth:i=`12em`,panelClassName:a,open:o,defaultOpen:s,...c}){let l={...r,minWidth:i},u=typeof e==`string`?e:void 0;return(0,W.jsxs)(`div`,{className:m(L.labeledPanel,t),"data-ui":`labeled-expandable-action-panel`,children:[(0,W.jsx)(`div`,{className:m(`flexEllipsis`,L.label,n),style:l,title:u,children:e}),(0,W.jsx)(z,{...c,open:o,defaultOpen:s,className:m(L.labeledActionPanel,a)})]})}var W;function G(){return(G=e((()=>{n(),h(),H(),R(),W=f(),U.__docgenInfo={description:"Раскрывающаяся панель действий с левым текстом, который сжимается через `flexEllipsis`.",methods:[],displayName:`LabeledExpandableActionPanel`,props:{label:{required:!0,tsType:{name:`ReactReactNode`,raw:`React.ReactNode`},description:``},className:{required:!1,tsType:{name:`string`},description:``},labelClassName:{required:!1,tsType:{name:`string`},description:``},labelStyle:{required:!1,tsType:{name:`ReactCSSProperties`,raw:`React.CSSProperties`},description:``},labelMinWidth:{required:!1,tsType:{name:`ReactCSSProperties["minWidth"]`,raw:`React.CSSProperties["minWidth"]`},description:``,defaultValue:{value:`"12em"`,computed:!1}},panelClassName:{required:!1,tsType:{name:`string`},description:``}},composes:[`Omit`]}})))()}function K(){let[e,t]=(0,q.useState)(``),[n,r]=(0,q.useState)(!1),[a,s]=(0,q.useState)(`Все`);return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`div`,{style:{width:`calc(14em + var(--width-add))`},children:(0,J.jsx)(v,{placeholder:`Поиск`,value:e,onChange:t,endAdornment:(0,J.jsx)(A,{})})}),(0,J.jsx)(`div`,{style:{width:`calc(12em + var(--width-add))`},children:(0,J.jsx)(x,{placeholder:`Статус`,options:Z,value:a,onChange:s,getOptionKey:e=>e,getOptionLabel:e=>e})}),(0,J.jsx)(o,{placeholder:`Только мои`,value:n,onChange:r,noWrap:!0}),(0,J.jsx)(_,{icon:(0,J.jsx)(c,{}),title:`Обновить`}),(0,J.jsx)(_,{icon:(0,J.jsx)(u,{}),title:`Настроить`}),(0,J.jsx)(_,{icon:(0,J.jsx)(i,{}),tone:`success`,appearance:`solid`,children:`Применить`})]})}var q,J,Y,X,Z,Q,$,ne;function re(){return(re=e((()=>{q=n(),r(),s(),j(),l(),g(),a(),y(),b(),H(),G(),J=f(),{fn:Y}=__STORYBOOK_MODULE_TEST__,X={title:`Shared/UI/ExpandableActionPanel`,component:U,args:{label:`Длинное название строки с результатами расчёта и параметрами отбора`,labelMinWidth:`18em`,defaultOpen:!1,onOpenChange:Y()},parameters:{atomicCanvas:!0,layout:`padded`},argTypes:{label:{description:`Текст или ReactNode слева от панели.`,control:`text`},labelMinWidth:{description:"Минимальная ширина `flexEllipsis`-текста.",control:`text`},defaultOpen:{description:`Начальное состояние раскрытия в uncontrolled-режиме.`,control:`boolean`},open:{description:`Контролируемое состояние раскрытия.`,control:`boolean`},onOpenChange:{description:`Вызывается при раскрытии или сворачивании панели.`,control:!1}}},Z=[`Все`,`Активные`,`Архив`],Q={render:e=>(0,J.jsx)(`div`,{style:{width:`min(100%, 920px)`},children:(0,J.jsx)(U,{...e,children:(0,J.jsx)(K,{})})})},$={render:()=>(0,J.jsx)(`div`,{style:{width:`min(100%, 720px)`,display:`flex`,justifyContent:`flex-end`},children:(0,J.jsx)(z,{defaultOpen:!0,children:(0,J.jsx)(K,{})})})},Q.parameters={...Q.parameters,docs:{...Q.parameters?.docs,source:{originalSource:`{
  render: args => <div style={{
    width: "min(100%, 920px)"
  }}>
            <LabeledExpandableActionPanel {...args}>
                <DemoControls />
            </LabeledExpandableActionPanel>
        </div>
}`,...Q.parameters?.docs?.source}}},$.parameters={...$.parameters,docs:{...$.parameters?.docs,source:{originalSource:`{
  render: () => <div style={{
    width: "min(100%, 720px)",
    display: "flex",
    justifyContent: "flex-end"
  }}>
            <ExpandableActionPanel defaultOpen>
                <DemoControls />
            </ExpandableActionPanel>
        </div>
}`,...$.parameters?.docs?.source}}},ne=[`Labeled`,`BasePanel`]})))()}re();export{$ as BasePanel,Q as Labeled,ne as __namedExportsOrder,X as default};