import{c as e,i as t}from"./preload-helper-B45gAKPr.js";import{C as n}from"./iframe-SfMJGCsn.js";import{t as r}from"./jsx-runtime-BBQGix-2.js";import{a as i,i as a}from"./utils-CReRlw17.js";import{Q as o,et as s,g as c,m as l,t as u,ut as d,v as f}from"./lucide-react-CK2oyDtF.js";import{t as p}from"./Button-BUkCW8Zg.js";import{t as m}from"./CheckBox-DTSi8Yok.js";import{t as h}from"./button-Bl3Hu8CS.js";import{a as g}from"./Input-B7DWcGCL.js";import{t as _}from"./input-Be5K9_B7.js";import{t as v}from"./Select-DYVS7SCZ.js";import{t as y}from"./select-BPvMbVDe.js";import{t as b}from"./check-box-BrnNQnSi.js";import{o as x,t as S}from"./misc-CPvLzCFJ.js";var C,w,T,E,D,O,k,A=t((()=>{C=`sj-rIq`,w=`_3anR7j`,T=`gMRIsT`,E=`f5Pv1e`,D=`q7eZzv`,O=`maUL24`,k={expandableActionPanel:C,content:w,contentScroller:T,labeledPanel:E,label:D,labeledActionPanel:O}}));function j({children:e,className:t,contentClassName:n,toggleClassName:r,open:a,defaultOpen:c=!1,disabled:l,onOpenChange:u,expandLabel:d=`Раскрыть панель действий влево`,collapseLabel:f=`Свернуть панель действий`,panelLabel:m=`Действия панели`,itemSelector:h,scrollPadding:g,smoothScroll:_}){let[v,y]=(0,M.useState)(c),b=(0,M.useId)(),S=a!==void 0,C=S?a:v,w=(0,M.useCallback)(e=>{let t=typeof e==`function`?e(C):e;S||y(t),u?.(t)},[S,u,C]),T=()=>w(e=>!e),E=C?o:s;return(0,N.jsxs)(`div`,{className:i(k.expandableActionPanel,t),"data-ui":`expandable-action-panel`,"data-open":C?``:void 0,children:[(0,N.jsx)(p,{className:r,icon:(0,N.jsx)(E,{}),title:C?f:d,disabled:l,variant:`neutralOutline`,"aria-expanded":C,"aria-controls":b,"data-ui":`expandable-action-panel-toggle`,"data-action":C?`collapse-action-panel`:`expand-action-panel`,onClick:T}),C&&(0,N.jsx)(`div`,{id:b,role:`group`,"aria-label":m,className:i(k.content,n),children:(0,N.jsx)(x,{className:k.contentScroller,itemSelector:h,scrollPadding:g,smooth:_,children:e})})]})}var M,N,P=t((()=>{M=e(n(),1),a(),u(),h(),S(),A(),N=r(),j.__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 F({label:e,className:t,labelClassName:n,labelStyle:r,labelMinWidth:a=`12em`,panelClassName:o,open:s,defaultOpen:c,...l}){let u={...r,minWidth:a},d=typeof e==`string`?e:void 0;return(0,I.jsxs)(`div`,{className:i(k.labeledPanel,t),"data-ui":`labeled-expandable-action-panel`,children:[(0,I.jsx)(`div`,{className:i(`flexEllipsis`,k.label,n),style:u,title:d,children:e}),(0,I.jsx)(j,{...l,open:s,defaultOpen:c,className:i(k.labeledActionPanel,o)})]})}var I,L=t((()=>{n(),a(),P(),A(),I=r(),F.__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 R(){let[e,t]=(0,z.useState)(``),[n,r]=(0,z.useState)(!1),[i,a]=(0,z.useState)(`Все`);return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{style:{width:`calc(14em + var(--width-add))`},children:(0,B.jsx)(g,{placeholder:`Поиск`,value:e,onChange:t,endAdornment:(0,B.jsx)(c,{})})}),(0,B.jsx)(`div`,{style:{width:`calc(12em + var(--width-add))`},children:(0,B.jsx)(v,{placeholder:`Статус`,options:U,value:i,onChange:a,getOptionKey:e=>e,getOptionLabel:e=>e})}),(0,B.jsx)(m,{placeholder:`Только мои`,value:n,onChange:r,noWrap:!0}),(0,B.jsx)(p,{icon:(0,B.jsx)(f,{}),title:`Обновить`}),(0,B.jsx)(p,{icon:(0,B.jsx)(l,{}),title:`Настроить`}),(0,B.jsx)(p,{icon:(0,B.jsx)(d,{}),tone:`success`,appearance:`solid`,children:`Применить`})]})}var z,B,V,H,U,W,G,K;t((()=>{z=e(n(),1),u(),h(),b(),_(),y(),P(),L(),B=r(),{fn:V}=__STORYBOOK_MODULE_TEST__,H={title:`Shared/UI/ExpandableActionPanel`,component:F,args:{label:`Длинное название строки с результатами расчёта и параметрами отбора`,labelMinWidth:`18em`,defaultOpen:!1,onOpenChange:V()},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}}},U=[`Все`,`Активные`,`Архив`],W={render:e=>(0,B.jsx)(`div`,{style:{width:`min(100%, 920px)`},children:(0,B.jsx)(F,{...e,children:(0,B.jsx)(R,{})})})},G={render:()=>(0,B.jsx)(`div`,{style:{width:`min(100%, 720px)`,display:`flex`,justifyContent:`flex-end`},children:(0,B.jsx)(j,{defaultOpen:!0,children:(0,B.jsx)(R,{})})})},W.parameters={...W.parameters,docs:{...W.parameters?.docs,source:{originalSource:`{
  render: args => <div style={{
    width: "min(100%, 920px)"
  }}>
            <LabeledExpandableActionPanel {...args}>
                <DemoControls />
            </LabeledExpandableActionPanel>
        </div>
}`,...W.parameters?.docs?.source}}},G.parameters={...G.parameters,docs:{...G.parameters?.docs,source:{originalSource:`{
  render: () => <div style={{
    width: "min(100%, 720px)",
    display: "flex",
    justifyContent: "flex-end"
  }}>
            <ExpandableActionPanel defaultOpen>
                <DemoControls />
            </ExpandableActionPanel>
        </div>
}`,...G.parameters?.docs?.source}}},K=[`Labeled`,`BasePanel`]}))();export{G as BasePanel,W as Labeled,K as __namedExportsOrder,H as default};